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

41 lines
685 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

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

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

/*! This file is auto-generated */
!function(){var e={6411:function(e,t){var n,o,r;
/*!
autosize 4.0.4
license: MIT
http://www.jacklmoore.com/autosize
*/o=[e,t],n=function(e,t){"use strict";var n,o,r="function"==typeof Map?new Map:(n=[],o=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return o[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),o.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),o.splice(t,1))}}),l=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){l=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!r.has(e)){var t=null,n=null,o=null,i=function(){e.clientWidth!==n&&p()},a=function(t){window.removeEventListener("resize",i,!1),e.removeEventListener("input",p,!1),e.removeEventListener("keyup",p,!1),e.removeEventListener("autosize:destroy",a,!1),e.removeEventListener("autosize:update",p,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),r.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",a,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",p,!1),window.addEventListener("resize",i,!1),e.addEventListener("input",p,!1),e.addEventListener("autosize:update",p,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",r.set(e,{destroy:a,update:p}),s()}function s(){var n=window.getComputedStyle(e,null);"vertical"===n.resize?e.style.resize="none":"both"===n.resize&&(e.style.resize="horizontal"),t="content-box"===n.boxSizing?-(parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)):parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),isNaN(t)&&(t=0),p()}function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}function d(){if(0!==e.scrollHeight){var o=u(e),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,o.forEach((function(e){e.node.scrollTop=e.scrollTop})),r&&(document.documentElement.scrollTop=r)}}function p(){d();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r<t?"hidden"===n.overflowY&&(c("scroll"),d(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),d(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),o!==r){o=r;var i=l("autosize:resized");try{e.dispatchEvent(i)}catch(e){}}}}function a(e){var t=r.get(e);t&&t.destroy()}function s(e){var t=r.get(e);t&&t.update()}var c=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((c=function(e){return e}).destroy=function(e){return e},c.update=function(e){return e}):((c=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return i(e,t)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],s),e}),t.default=c,e.exports=t.default},void 0===(r="function"==typeof n?n.apply(t,o):n)||(e.exports=r)},4403:function(e,t){var n;
/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var l=typeof n;if("string"===l||"number"===l)e.push(n);else if(Array.isArray(n)){if(n.length){var i=r.apply(null,n);i&&e.push(i)}}else if("object"===l){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var a in n)o.call(n,a)&&n[a]&&e.push(a)}}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},4827:function(e){e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},1198:function(e,t){"use strict";function n(){}function o(e,t,n,o,r){for(var l=0,i=t.length,a=0,s=0;l<i;l++){var c=t[l];if(c.removed){if(c.value=e.join(o.slice(s,s+c.count)),s+=c.count,l&&t[l-1].added){var u=t[l-1];t[l-1]=t[l],t[l]=u}}else{if(!c.added&&r){var d=n.slice(a,a+c.count);d=d.map((function(e,t){var n=o[s+t];return n.length>e.length?n:e})),c.value=e.join(d)}else c.value=e.join(n.slice(a,a+c.count));a+=c.count,c.added||(s+=c.count)}}var p=t[i-1];return i>1&&"string"==typeof p.value&&(p.added||p.removed)&&e.equals("",p.value)&&(t[i-2].value+=p.value,t.pop()),t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.callback;"function"==typeof n&&(r=n,n={}),this.options=n;var l=this;function i(e){return r?(setTimeout((function(){r(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var a=(t=this.removeEmpty(this.tokenize(t))).length,s=e.length,c=1,u=a+s,d=[{newPos:-1,components:[]}],p=this.extractCommon(d[0],t,e,0);if(d[0].newPos+1>=a&&p+1>=s)return i([{value:this.join(t),count:t.length}]);function m(){for(var n=-1*c;n<=c;n+=2){var r=void 0,u=d[n-1],p=d[n+1],m=(p?p.newPos:0)-n;u&&(d[n-1]=void 0);var f=u&&u.newPos+1<a,g=p&&0<=m&&m<s;if(f||g){if(!f||g&&u.newPos<p.newPos?(r={newPos:(h=p).newPos,components:h.components.slice(0)},l.pushComponent(r.components,void 0,!0)):((r=u).newPos++,l.pushComponent(r.components,!0,void 0)),m=l.extractCommon(r,t,e,n),r.newPos+1>=a&&m+1>=s)return i(o(l,r.components,t,e,l.useLongestToken));d[n]=r}else d[n]=void 0}var h;c++}if(r)!function e(){setTimeout((function(){if(c>u)return r();m()||e()}),0)}();else for(;c<=u;){var f=m();if(f)return f}},pushComponent:function(e,t,n){var o=e[e.length-1];o&&o.added===t&&o.removed===n?e[e.length-1]={count:o.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,o){for(var r=t.length,l=n.length,i=e.newPos,a=i-o,s=0;i+1<r&&a+1<l&&this.equals(t[i+1],n[a+1]);)i++,a++,s++;return s&&e.components.push({count:s}),e.newPos=i,a},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}}},1973:function(e,t,n){"use strict";var o;t.Kx=function(e,t,n){return r.diff(e,t,n)};var r=new(((o=n(1198))&&o.__esModule?o:{default:o}).default)},1345:function(e,t,n){"use strict";var o=n(5022);e.exports=function(e,t,n){n=n||{},9===t.nodeType&&(t=o.getWindow(t));var r=n.allowHorizontalScroll,l=n.onlyScrollIfNeeded,i=n.alignWithTop,a=n.alignWithLeft,s=n.offsetTop||0,c=n.offsetLeft||0,u=n.offsetBottom||0,d=n.offsetRight||0;r=void 0===r||r;var p=o.isWindow(t),m=o.offset(e),f=o.outerHeight(e),g=o.outerWidth(e),h=void 0,b=void 0,v=void 0,_=void 0,k=void 0,y=void 0,E=void 0,w=void 0,S=void 0,C=void 0;p?(E=t,C=o.height(E),S=o.width(E),w={left:o.scrollLeft(E),top:o.scrollTop(E)},k={left:m.left-w.left-c,top:m.top-w.top-s},y={left:m.left+g-(w.left+S)+d,top:m.top+f-(w.top+C)+u},_=w):(h=o.offset(t),b=t.clientHeight,v=t.clientWidth,_={left:t.scrollLeft,top:t.scrollTop},k={left:m.left-(h.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-c,top:m.top-(h.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-s},y={left:m.left+g-(h.left+v+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:m.top+f-(h.top+b+(parseFloat(o.css(t,"borderBottomWidth"))||0))+u}),k.top<0||y.top>0?!0===i?o.scrollTop(t,_.top+k.top):!1===i?o.scrollTop(t,_.top+y.top):k.top<0?o.scrollTop(t,_.top+k.top):o.scrollTop(t,_.top+y.top):l||((i=void 0===i||!!i)?o.scrollTop(t,_.top+k.top):o.scrollTop(t,_.top+y.top)),r&&(k.left<0||y.left>0?!0===a?o.scrollLeft(t,_.left+k.left):!1===a?o.scrollLeft(t,_.left+y.left):k.left<0?o.scrollLeft(t,_.left+k.left):o.scrollLeft(t,_.left+y.left):l||((a=void 0===a||!!a)?o.scrollLeft(t,_.left+k.left):o.scrollLeft(t,_.left+y.left)))}},5425:function(e,t,n){"use strict";e.exports=n(1345)},5022:function(e){"use strict";var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function o(e,t){var n=e["page"+(t?"Y":"X")+"Offset"],o="scroll"+(t?"Top":"Left");if("number"!=typeof n){var r=e.document;"number"!=typeof(n=r.documentElement[o])&&(n=r.body[o])}return n}function r(e){return o(e)}function l(e){return o(e,!0)}function i(e){var t=function(e){var t,n=void 0,o=void 0,r=e.ownerDocument,l=r.body,i=r&&r.documentElement;return n=(t=e.getBoundingClientRect()).left,o=t.top,{left:n-=i.clientLeft||l.clientLeft||0,top:o-=i.clientTop||l.clientTop||0}}(e),n=e.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=r(o),t.top+=l(o),t}var a=new RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+")(?!px)[a-z%]+$","i"),s=/^(top|right|bottom|left)$/,c="currentStyle",u="runtimeStyle",d="left";var p=void 0;function m(e,t){for(var n=0;n<e.length;n++)t(e[n])}function f(e){return"border-box"===p(e,"boxSizing")}"undefined"!=typeof window&&(p=window.getComputedStyle?function(e,t,n){var o="",r=e.ownerDocument,l=n||r.defaultView.getComputedStyle(e,null);return l&&(o=l.getPropertyValue(t)||l[t]),o}:function(e,t){var n=e[c]&&e[c][t];if(a.test(n)&&!s.test(t)){var o=e.style,r=o[d],l=e[u][d];e[u][d]=e[c][d],o[d]="fontSize"===t?"1em":n||0,n=o.pixelLeft+"px",o[d]=r,e[u][d]=l}return""===n?"auto":n});var g=["margin","border","padding"],h=-1,b=2,v=1;function _(e,t,n){var o=0,r=void 0,l=void 0,i=void 0;for(l=0;l<t.length;l++)if(r=t[l])for(i=0;i<n.length;i++){var a=void 0;a="border"===r?r+n[i]+"Width":r+n[i],o+=parseFloat(p(e,a))||0}return o}function k(e){return null!=e&&e==e.window}var y={};function E(e,t,n){if(k(e))return"width"===t?y.viewportWidth(e):y.viewportHeight(e);if(9===e.nodeType)return"width"===t?y.docWidth(e):y.docHeight(e);var o="width"===t?["Left","Right"]:["Top","Bottom"],r="width"===t?e.offsetWidth:e.offsetHeight,l=(p(e),f(e)),i=0;(null==r||r<=0)&&(r=void 0,(null==(i=p(e,t))||Number(i)<0)&&(i=e.style[t]||0),i=parseFloat(i)||0),void 0===n&&(n=l?v:h);var a=void 0!==r||l,s=r||i;if(n===h)return a?s-_(e,["border","padding"],o):i;if(a){var c=n===b?-_(e,["border"],o):_(e,["margin"],o);return s+(n===v?0:c)}return i+_(e,g.slice(n),o)}m(["Width","Height"],(function(e){y["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],y["viewport"+e](n))},y["viewport"+e]=function(t){var n="client"+e,o=t.document,r=o.body,l=o.documentElement[n];return"CSS1Compat"===o.compatMode&&l||r&&r[n]||l}}));var w={position:"absolute",visibility:"hidden",display:"block"};function S(e){var t=void 0,n=arguments;return 0!==e.offsetWidth?t=E.apply(void 0,n):function(e,t,n){var o={},r=e.style,l=void 0;for(l in t)t.hasOwnProperty(l)&&(o[l]=r[l],r[l]=t[l]);for(l in n.call(e),t)t.hasOwnProperty(l)&&(r[l]=o[l])}(e,w,(function(){t=E.apply(void 0,n)})),t}function C(e,t,o){var r=o;if("object"!==(void 0===t?"undefined":n(t)))return void 0!==r?("number"==typeof r&&(r+="px"),void(e.style[t]=r)):p(e,t);for(var l in t)t.hasOwnProperty(l)&&C(e,l,t[l])}m(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);y["outer"+t]=function(t,n){return t&&S(t,e,n?0:v)};var n="width"===e?["Left","Right"]:["Top","Bottom"];y[e]=function(t,o){if(void 0===o)return t&&S(t,e,h);if(t){p(t);return f(t)&&(o+=_(t,["padding","border"],n)),C(t,e,o)}}})),e.exports=t({getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},offset:function(e,t){if(void 0===t)return i(e);!function(e,t){"static"===C(e,"position")&&(e.style.position="relative");var n=i(e),o={},r=void 0,l=void 0;for(l in t)t.hasOwnProperty(l)&&(r=parseFloat(C(e,l))||0,o[l]=r+t[l]-n[l]);C(e,o)}(e,t)},isWindow:k,each:m,css:C,clone:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);if(e.overflow)for(var n in e)e.hasOwnProperty(n)&&(t.overflow[n]=e.overflow[n]);return t},scrollLeft:function(e,t){if(k(e)){if(void 0===t)return r(e);window.scrollTo(t,l(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(k(e)){if(void 0===t)return l(e);window.scrollTo(r(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},viewportWidth:0,viewportHeight:0},y)},5619:function(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,l;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=(l=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(r=o;0!=r--;)if(!Object.prototype.hasOwnProperty.call(n,l[r]))return!1;for(r=o;0!=r--;){var i=l[r];if(!e(t[i],n[i]))return!1}return!0}return t!=t&&n!=n}},8575:function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},9894:function(e,t,n){var o=n(4827);e.exports=function(e){var t=o(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var r=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),n=parseFloat(t,10),r?e.style.lineHeight=r:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var l=e.nodeName,i=document.createElement(l);i.innerHTML="&nbsp;","TEXTAREA"===l.toUpperCase()&&i.setAttribute("rows","1");var a=o(e,"font-size");i.style.fontSize=a,i.style.padding="0px",i.style.border="0px";var s=document.body;s.appendChild(i),n=i.offsetHeight,s.removeChild(i)}return n}},7970:function(e,t,n){e.exports=n(195)},3110:function(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},3812:function(e){var t,n,o,r,l,i,a,s,c,u,d,p,m,f,g,h=!1;function b(){if(!h){h=!0;var e=navigator.userAgent,b=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),v=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(p=/\b(iPhone|iP[ao]d)/.exec(e),m=/\b(iP[ao]d)/.exec(e),u=/Android/i.exec(e),f=/FBAN\/\w+;/i.exec(e),g=/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 _=/(?:Trident\/(\d+.\d+))/.exec(e);i=_?parseFloat(_[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),l=b&&b[1]?parseFloat(b[1]):NaN):l=NaN}else t=n=o=l=r=NaN;if(v){if(v[1]){var k=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);a=!k||parseFloat(k[1].replace("_","."))}else a=!1;s=!!v[2],c=!!v[3]}else a=s=c=!1}}var v={ie:function(){return b()||t},ieCompatibilityMode:function(){return b()||i>t},ie64:function(){return v.ie()&&d},firefox:function(){return b()||n},opera:function(){return b()||o},webkit:function(){return b()||r},safari:function(){return v.webkit()},chrome:function(){return b()||l},windows:function(){return b()||s},osx:function(){return b()||a},linux:function(){return b()||c},iphone:function(){return b()||p},mobile:function(){return b()||p||m||u||g},nativeApp:function(){return b()||f},android:function(){return b()||u},ipad:function(){return b()||m}};e.exports=v},7939:function(e,t,n){"use strict";var o,r=n(3110);r.canUseDOM&&(o=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("",""))
/**
* Checks if an event is supported in the current execution environment.
*
* NOTE: This will not work correctly for non-generic events such as `change`,
* `reset`, `load`, `error`, and `select`.
*
* Borrows from Modernizr.
*
* @param {string} eventNameSuffix Event name, e.g. "click".
* @param {?boolean} capture Check if the capture phase is supported.
* @return {boolean} True if the event is supported.
* @internal
* @license Modernizr 3.0.0pre (Custom Build) | MIT
*/,e.exports=function(e,t){if(!r.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,l=n in document;if(!l){var i=document.createElement("div");i.setAttribute(n,"return;"),l="function"==typeof i[n]}return!l&&o&&"wheel"===e&&(l=document.implementation.hasFeature("Events.wheel","3.0")),l}},195:function(e,t,n){"use strict";var o=n(3812),r=n(7939);function l(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}}l.getEventType=function(){return o.firefox()?"DOMMouseScroll":r("wheel")?"wheel":"mousewheel"},e.exports=l},5372:function(e,t,n){"use strict";var o=n(9567);function r(){}function l(){}l.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,l,i){if(i!==o){var a=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 a.name="Invariant Violation",a}}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:l,resetWarningCache:r};return n.PropTypes=n,n}},2652:function(e,t,n){e.exports=n(5372)()},9567:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5438:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),l=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};t.__esModule=!0;var a=n(9196),s=n(2652),c=n(6411),u=n(9894),d="autosize:resized",p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return 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),s=i(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return a.createElement("textarea",l({},s,{onChange:this.onChange,style:u?l({},o,{maxHeight:u}):o,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),r)},t.prototype.componentDidUpdate=function(){this.textarea&&c.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:s.number,maxRows:s.number,onResize:s.func,innerRef:s.any,async:s.bool},t}(a.Component);t.TextareaAutosize=a.forwardRef((function(e,t){return a.createElement(p,l({},e,{innerRef:t}))}))},773:function(e,t,n){"use strict";var o=n(5438);t.Z=o.TextareaAutosize},4793:function(e){var t={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Ấ":"A","Ắ":"A","Ẳ":"A","Ẵ":"A","Ặ":"A","Æ":"AE","Ầ":"A","Ằ":"A","Ȃ":"A","Ç":"C","Ḉ":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ế":"E","Ḗ":"E","Ề":"E","Ḕ":"E","Ḝ":"E","Ȇ":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ḯ":"I","Ȋ":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ố":"O","Ṍ":"O","Ṓ":"O","Ȏ":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","ấ":"a","ắ":"a","ẳ":"a","ẵ":"a","ặ":"a","æ":"ae","ầ":"a","ằ":"a","ȃ":"a","ç":"c","ḉ":"c","è":"e","é":"e","ê":"e","ë":"e","ế":"e","ḗ":"e","ề":"e","ḕ":"e","ḝ":"e","ȇ":"e","ì":"i","í":"i","î":"i","ï":"i","ḯ":"i","ȋ":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ố":"o","ṍ":"o","ṓ":"o","ȏ":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Ĉ":"C","ĉ":"c","Ċ":"C","ċ":"c","Č":"C","č":"c","C̆":"C","c̆":"c","Ď":"D","ď":"d","Đ":"D","đ":"d","Ē":"E","ē":"e","Ĕ":"E","ĕ":"e","Ė":"E","ė":"e","Ę":"E","ę":"e","Ě":"E","ě":"e","Ĝ":"G","Ǵ":"G","ĝ":"g","ǵ":"g","Ğ":"G","ğ":"g","Ġ":"G","ġ":"g","Ģ":"G","ģ":"g","Ĥ":"H","ĥ":"h","Ħ":"H","ħ":"h","Ḫ":"H","ḫ":"h","Ĩ":"I","ĩ":"i","Ī":"I","ī":"i","Ĭ":"I","ĭ":"i","Į":"I","į":"i","İ":"I","ı":"i","IJ":"IJ","ij":"ij","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","Ḱ":"K","ḱ":"k","K̆":"K","k̆":"k","Ĺ":"L","ĺ":"l","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ŀ":"L","ŀ":"l","Ł":"l","ł":"l","Ḿ":"M","ḿ":"m","M̆":"M","m̆":"m","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","ʼn":"n","N̆":"N","n̆":"n","Ō":"O","ō":"o","Ŏ":"O","ŏ":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","P̆":"P","p̆":"p","Ŕ":"R","ŕ":"r","Ŗ":"R","ŗ":"r","Ř":"R","ř":"r","R̆":"R","r̆":"r","Ȓ":"R","ȓ":"r","Ś":"S","ś":"s","Ŝ":"S","ŝ":"s","Ş":"S","Ș":"S","ș":"s","ş":"s","Š":"S","š":"s","ß":"ss","Ţ":"T","ţ":"t","ț":"t","Ț":"T","Ť":"T","ť":"t","Ŧ":"T","ŧ":"t","T̆":"T","t̆":"t","Ũ":"U","ũ":"u","Ū":"U","ū":"u","Ŭ":"U","ŭ":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ȗ":"U","ȗ":"u","V̆":"V","v̆":"v","Ŵ":"W","ŵ":"w","Ẃ":"W","ẃ":"w","X̆":"X","x̆":"x","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Y̆":"Y","y̆":"y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","ſ":"s","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Ǎ":"A","ǎ":"a","Ǐ":"I","ǐ":"i","Ǒ":"O","ǒ":"o","Ǔ":"U","ǔ":"u","Ǖ":"U","ǖ":"u","Ǘ":"U","ǘ":"u","Ǚ":"U","ǚ":"u","Ǜ":"U","ǜ":"u","Ứ":"U","ứ":"u","Ṹ":"U","ṹ":"u","Ǻ":"A","ǻ":"a","Ǽ":"AE","ǽ":"ae","Ǿ":"O","ǿ":"o","Þ":"TH","þ":"th","Ṕ":"P","ṕ":"p","Ṥ":"S","ṥ":"s","X́":"X","x́":"x","Ѓ":"Г","ѓ":"г","Ќ":"К","ќ":"к","A̋":"A","a̋":"a","E̋":"E","e̋":"e","I̋":"I","i̋":"i","Ǹ":"N","ǹ":"n","Ồ":"O","ồ":"o","Ṑ":"O","ṑ":"o","Ừ":"U","ừ":"u","Ẁ":"W","ẁ":"w","Ỳ":"Y","ỳ":"y","Ȁ":"A","ȁ":"a","Ȅ":"E","ȅ":"e","Ȉ":"I","ȉ":"i","Ȍ":"O","ȍ":"o","Ȑ":"R","ȑ":"r","Ȕ":"U","ȕ":"u","B̌":"B","b̌":"b","Č̣":"C","č̣":"c","Ê̌":"E","ê̌":"e","F̌":"F","f̌":"f","Ǧ":"G","ǧ":"g","Ȟ":"H","ȟ":"h","J̌":"J","ǰ":"j","Ǩ":"K","ǩ":"k","M̌":"M","m̌":"m","P̌":"P","p̌":"p","Q̌":"Q","q̌":"q","Ř̩":"R","ř̩":"r","Ṧ":"S","ṧ":"s","V̌":"V","v̌":"v","W̌":"W","w̌":"w","X̌":"X","x̌":"x","Y̌":"Y","y̌":"y","A̧":"A","a̧":"a","B̧":"B","b̧":"b","Ḑ":"D","ḑ":"d","Ȩ":"E","ȩ":"e","Ɛ̧":"E","ɛ̧":"e","Ḩ":"H","ḩ":"h","I̧":"I","i̧":"i","Ɨ̧":"I","ɨ̧":"i","M̧":"M","m̧":"m","O̧":"O","o̧":"o","Q̧":"Q","q̧":"q","U̧":"U","u̧":"u","X̧":"X","x̧":"x","Z̧":"Z","z̧":"z","й":"и","Й":"И","ё":"е","Ё":"Е"},n=Object.keys(t).join("|"),o=new RegExp(n,"g"),r=new RegExp(n,"");function l(e){return t[e]}var i=function(e){return e.replace(o,l)};e.exports=i,e.exports.has=function(e){return!!e.match(r)},e.exports.remove=i},3124:function(e){"use strict";function t(e){return Object.prototype.toString.call(e)}var n=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function o(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)}var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t},l=Object.prototype.hasOwnProperty||function(e,t){return t in e};function i(e){if("object"==typeof e&&null!==e){var l;if(n(e))l=[];else if("[object Date]"===t(e))l=new Date(e.getTime?e.getTime():e);else if(function(e){return"[object RegExp]"===t(e)}(e))l=new RegExp(e);else if(function(e){return"[object Error]"===t(e)}(e))l={message:e.message};else if(function(e){return"[object Boolean]"===t(e)}(e)||function(e){return"[object Number]"===t(e)}(e)||function(e){return"[object String]"===t(e)}(e))l=Object(e);else if(Object.create&&Object.getPrototypeOf)l=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)l={};else{var i=e.constructor&&e.constructor.prototype||e.__proto__||{},a=function(){};a.prototype=i,l=new a}return o(r(e),(function(t){l[t]=e[t]})),l}return e}function a(e,t,a){var s=[],c=[],u=!0;return function e(d){var p=a?i(d):d,m={},f=!0,g={node:p,node_:d,path:[].concat(s),parent:c[c.length-1],parents:c,key:s[s.length-1],isRoot:0===s.length,level:s.length,circular:null,update:function(e,t){g.isRoot||(g.parent.node[g.key]=e),g.node=e,t&&(f=!1)},delete:function(e){delete g.parent.node[g.key],e&&(f=!1)},remove:function(e){n(g.parent.node)?g.parent.node.splice(g.key,1):delete g.parent.node[g.key],e&&(f=!1)},keys:null,before:function(e){m.before=e},after:function(e){m.after=e},pre:function(e){m.pre=e},post:function(e){m.post=e},stop:function(){u=!1},block:function(){f=!1}};if(!u)return g;function h(){if("object"==typeof g.node&&null!==g.node){g.keys&&g.node_===g.node||(g.keys=r(g.node)),g.isLeaf=0===g.keys.length;for(var e=0;e<c.length;e++)if(c[e].node_===d){g.circular=c[e];break}}else g.isLeaf=!0,g.keys=null;g.notLeaf=!g.isLeaf,g.notRoot=!g.isRoot}h();var b=t.call(g,g.node);return void 0!==b&&g.update&&g.update(b),m.before&&m.before.call(g,g.node),f?("object"!=typeof g.node||null===g.node||g.circular||(c.push(g),h(),o(g.keys,(function(t,n){s.push(t),m.pre&&m.pre.call(g,g.node[t],t);var o=e(g.node[t]);a&&l.call(g.node,t)&&(g.node[t]=o.node),o.isLast=n===g.keys.length-1,o.isFirst=0===n,m.post&&m.post.call(g,o),s.pop()})),c.pop()),m.after&&m.after.call(g,g.node),g):g}(e).node}function s(e){this.value=e}function c(e){return new s(e)}s.prototype.get=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!l.call(t,o))return;t=t[o]}return t},s.prototype.has=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!l.call(t,o))return!1;t=t[o]}return!0},s.prototype.set=function(e,t){for(var n=this.value,o=0;o<e.length-1;o++){var r=e[o];l.call(n,r)||(n[r]={}),n=n[r]}return n[e[o]]=t,t},s.prototype.map=function(e){return a(this.value,e,!0)},s.prototype.forEach=function(e){return this.value=a(this.value,e,!1),this.value},s.prototype.reduce=function(e,t){var n=1===arguments.length,o=n?this.value:t;return this.forEach((function(t){this.isRoot&&n||(o=e.call(this,o,t))})),o},s.prototype.paths=function(){var e=[];return this.forEach((function(){e.push(this.path)})),e},s.prototype.nodes=function(){var e=[];return this.forEach((function(){e.push(this.node)})),e},s.prototype.clone=function(){var e=[],t=[];return function n(l){for(var a=0;a<e.length;a++)if(e[a]===l)return t[a];if("object"==typeof l&&null!==l){var s=i(l);return e.push(l),t.push(s),o(r(l),(function(e){s[e]=n(l[e])})),e.pop(),t.pop(),s}return l}(this.value)},o(r(s.prototype),(function(e){c[e]=function(t){var n=[].slice.call(arguments,1),o=new s(t);return o[e].apply(o,n)}})),e.exports=c},9196:function(e){"use strict";e.exports=window.React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var l=t[o]={exports:{}};return e[o].call(l.exports,l,l.exports,n),l.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};!function(){"use strict";n.r(o),n.d(o,{AlignmentControl:function(){return ew},AlignmentToolbar:function(){return tw},Autocomplete:function(){return dw},BlockAlignmentControl:function(){return Si},BlockAlignmentToolbar:function(){return Ci},BlockBreadcrumb:function(){return bw},BlockColorsStyleSelector:function(){return yw},BlockContextProvider:function(){return oa},BlockControls:function(){return nr},BlockEdit:function(){return sa},BlockEditorKeyboardShortcuts:function(){return fI},BlockEditorProvider:function(){return Xd},BlockFormatControls:function(){return tr},BlockIcon:function(){return jd},BlockInspector:function(){return aI},BlockList:function(){return wv},BlockMover:function(){return qg},BlockNavigationDropdown:function(){return Qw},BlockPreview:function(){return wm},BlockSelectionClearer:function(){return Jd},BlockSettingsMenu:function(){return Sb},BlockSettingsMenuControls:function(){return _b},BlockStyles:function(){return nS},BlockTitle:function(){return Og},BlockToolbar:function(){return Lb},BlockTools:function(){return uI},BlockVerticalAlignmentControl:function(){return Hr},BlockVerticalAlignmentToolbar:function(){return Gr},ButtonBlockAppender:function(){return _g},ButtonBlockerAppender:function(){return vg},ColorPalette:function(){return CS},ColorPaletteControl:function(){return xS},ContrastChecker:function(){return O_},CopyHandler:function(){return Fh},DefaultBlockAppender:function(){return hg},FontSizePicker:function(){return $E},HeadingLevelDropdown:function(){return aS},HeightControl:function(){return iy},InnerBlocks:function(){return vv},Inserter:function(){return gg},InspectorAdvancedControls:function(){return qi},InspectorControls:function(){return Zi},JustifyContentControl:function(){return jr},JustifyToolbar:function(){return Wr},LineHeightControl:function(){return ik},MediaPlaceholder:function(){return yx},MediaReplaceFlow:function(){return px},MediaUpload:function(){return Yf},MediaUploadCheck:function(){return Zf},MultiSelectScrollIntoView:function(){return gI},NavigableToolbar:function(){return eh},ObserveTyping:function(){return _I},PanelColorSettings:function(){return Ex},PlainText:function(){return lB},ReusableBlocksRenameHint:function(){return Tf},RichText:function(){return nB},RichTextShortcut:function(){return sB},RichTextToolbarButton:function(){return cB},SETTINGS_DEFAULTS:function(){return k},SkipToSelectedBlock:function(){return TB},ToolSelector:function(){return pB},Typewriter:function(){return SI},URLInput:function(){return SC},URLInputButton:function(){return hB},URLPopover:function(){return bx},Warning:function(){return ua},WritingFlow:function(){return mp},__experimentalBlockAlignmentMatrixControl:function(){return gw},__experimentalBlockFullHeightAligmentControl:function(){return mw},__experimentalBlockPatternSetup:function(){return kS},__experimentalBlockPatternsList:function(){return Wm},__experimentalBlockVariationPicker:function(){return cS},__experimentalBlockVariationTransforms:function(){return wS},__experimentalBorderRadiusControl:function(){return $v},__experimentalColorGradientControl:function(){return E_},__experimentalColorGradientSettingsDropdown:function(){return RS},__experimentalDateFormatPicker:function(){return TS},__experimentalDuotoneControl:function(){return Wy},__experimentalFontAppearanceControl:function(){return ok},__experimentalFontFamilyControl:function(){return J_},__experimentalGetBorderClassesAndStyles:function(){return ME},__experimentalGetColorClassesAndStyles:function(){return NE},__experimentalGetElementClassName:function(){return NI},__experimentalGetGapCSSValue:function(){return Nr},__experimentalGetGradientClass:function(){return d_},__experimentalGetGradientObjectByGradientValue:function(){return m_},__experimentalGetMatchingVariation:function(){return RI},__experimentalGetSpacingClassesAndStyles:function(){return AE},__experimentalImageEditor:function(){return gC},__experimentalImageSizeControl:function(){return vC},__experimentalImageURLInputUI:function(){return wB},__experimentalInspectorPopoverHeader:function(){return TI},__experimentalLetterSpacingControl:function(){return ak},__experimentalLibrary:function(){return pI},__experimentalLinkControl:function(){return ix},__experimentalLinkControlSearchInput:function(){return KC},__experimentalLinkControlSearchItem:function(){return LC},__experimentalLinkControlSearchResults:function(){return VC},__experimentalListView:function(){return Yw},__experimentalPanelColorGradientSettings:function(){return zS},__experimentalPreviewOptions:function(){return BB},__experimentalPublishDateTimePicker:function(){return MI},__experimentalRecursionProvider:function(){return xI},__experimentalResponsiveBlockControl:function(){return aB},__experimentalSpacingSizesControl:function(){return ry},__experimentalTextDecorationControl:function(){return bk},__experimentalTextTransformControl:function(){return mk},__experimentalUnitControl:function(){return mB},__experimentalUseBlockOverlayActive:function(){return Pd},__experimentalUseBlockPreview:function(){return Sm},__experimentalUseBorderProps:function(){return PE},__experimentalUseColorProps:function(){return RE},__experimentalUseCustomSides:function(){return Ry},__experimentalUseGradient:function(){return g_},__experimentalUseHasRecursion:function(){return BI},__experimentalUseMultipleOriginColorsAndGradients:function(){return Tv},__experimentalUseResizeCanvas:function(){return IB},__unstableBlockNameContext:function(){return Nb},__unstableBlockSettingsMenuFirstItem:function(){return ob},__unstableBlockToolbarLastItem:function(){return Dh},__unstableDuotoneFilter:function(){return Yy},__unstableDuotoneStylesheet:function(){return qy},__unstableDuotoneUnsetStylesheet:function(){return Zy},__unstableEditorStyles:function(){return vm},__unstableGetValuesFromColors:function(){return Ky},__unstableIframe:function(){return gp},__unstableInserterMenuExtension:function(){return tg},__unstablePresetDuotoneFilter:function(){return Xy},__unstableRichTextInputEvent:function(){return uB},__unstableUseBlockSelectionClearer:function(){return Qd},__unstableUseClipboardHandler:function(){return Vh},__unstableUseMouseMoveTypingReset:function(){return bI},__unstableUseTypewriter:function(){return wI},__unstableUseTypingObserver:function(){return vI},createCustomColorsHOC:function(){return GE},getColorClassName:function(){return Iv},getColorObjectByAttributeValues:function(){return xv},getColorObjectByColorValue:function(){return Bv},getComputedFluidTypographyValue:function(){return ll},getCustomValueFromPreset:function(){return Ir},getFontSize:function(){return Ak},getFontSizeClass:function(){return Ok},getFontSizeObjectByValue:function(){return Dk},getGradientSlugByValue:function(){return f_},getGradientValueBySlug:function(){return p_},getPxFromCssUnit:function(){return GI},getSpacingPresetCssVar:function(){return Tr},getTypographyClassesAndStyles:function(){return DE},isValueSpacingPreset:function(){return Br},privateApis:function(){return nP},store:function(){return $o},storeConfig:function(){return Uo},transformStyles:function(){return gm},useBlockDisplayInformation:function(){return Ag},useBlockEditContext:function(){return Zo},useBlockProps:function(){return Ld},useCachedTruthy:function(){return OE},useInnerBlocksProps:function(){return bv},useSetting:function(){return Qr},withColorContext:function(){return SS},withColors:function(){return UE},withFontSizes:function(){return KE}});var e={};n.r(e),n.d(e,{getBlockEditingMode:function(){return Y},getEnabledBlockParents:function(){return J},getEnabledClientIdsTree:function(){return Q},getLastInsertedBlocksClientIds:function(){return Z},getRemovalPromptData:function(){return ee},isBlockInterfaceHidden:function(){return q},isBlockSubtreeDisabled:function(){return X},isRemovalPromptSupported:function(){return te}});var t={};n.r(t),n.d(t,{__experimentalGetActiveBlockIdByBlockNames:function(){return an},__experimentalGetAllowedBlocks:function(){return Dt},__experimentalGetAllowedPatterns:function(){return Ht},__experimentalGetBlockListSettingsForBlocks:function(){return Zt},__experimentalGetDirectInsertBlock:function(){return Ot},__experimentalGetGlobalBlocksByName:function(){return ge},__experimentalGetLastBlockAttributeChanges:function(){return Qt},__experimentalGetParsedPattern:function(){return Vt},__experimentalGetPatternTransformItems:function(){return $t},__experimentalGetPatternsByBlockTypes:function(){return Ut},__experimentalGetReusableBlockTitle:function(){return Yt},__unstableGetBlockWithoutInnerBlocks:function(){return se},__unstableGetClientIdWithClientIdsTree:function(){return ue},__unstableGetClientIdsTree:function(){return de},__unstableGetContentLockingParent:function(){return dn},__unstableGetEditorMode:function(){return tn},__unstableGetSelectedBlocksWithPartialSelection:function(){return Ye},__unstableGetTemporarilyEditingAsBlocks:function(){return pn},__unstableGetVisibleBlocks:function(){return un},__unstableHasActiveBlockOverlayActive:function(){return mn},__unstableIsFullySelected:function(){return We},__unstableIsLastBlockChangeIgnored:function(){return Xt},__unstableIsSelectionCollapsed:function(){return Ke},__unstableIsSelectionMergeable:function(){return Ze},__unstableIsWithinBlockOverlay:function(){return fn},__unstableSelectionHasUnmergeableBlock:function(){return qe},areInnerBlocksControlled:function(){return ln},canEditBlock:function(){return xt},canInsertBlockType:function(){return kt},canInsertBlocks:function(){return yt},canLockBlockType:function(){return Bt},canMoveBlock:function(){return St},canMoveBlocks:function(){return Ct},canRemoveBlock:function(){return Et},canRemoveBlocks:function(){return wt},didAutomaticChange:function(){return on},getAdjacentBlockClientId:function(){return Ne},getAllowedBlocks:function(){return At},getBehaviors:function(){return Kt},getBlock:function(){return ae},getBlockAttributes:function(){return ie},getBlockCount:function(){return ve},getBlockHierarchyRootClientId:function(){return Me},getBlockIndex:function(){return Qe},getBlockInsertionPoint:function(){return mt},getBlockListSettings:function(){return jt},getBlockMode:function(){return it},getBlockName:function(){return re},getBlockNamesByClientId:function(){return be},getBlockOrder:function(){return Xe},getBlockParents:function(){return Ie},getBlockParentsByBlockName:function(){return Te},getBlockRootClientId:function(){return Be},getBlockSelectionEnd:function(){return Ee},getBlockSelectionStart:function(){return ye},getBlockTransformItems:function(){return Lt},getBlocks:function(){return ce},getBlocksByClientId:function(){return he},getClientIdsOfDescendants:function(){return pe},getClientIdsWithDescendants:function(){return me},getDraggedBlockClientIds:function(){return ct},getFirstMultiSelectedBlockClientId:function(){return Ve},getGlobalBlockCount:function(){return fe},getInserterItems:function(){return Nt},getLastMultiSelectedBlockClientId:function(){return Fe},getLowestCommonAncestorWithSelectedBlock:function(){return Pe},getMultiSelectedBlockClientIds:function(){return Oe},getMultiSelectedBlocks:function(){return ze},getMultiSelectedBlocksEndClientId:function(){return je},getMultiSelectedBlocksStartClientId:function(){return $e},getNextBlockClientId:function(){return Re},getPatternsByBlockTypes:function(){return Gt},getPreviousBlockClientId:function(){return Le},getSelectedBlock:function(){return xe},getSelectedBlockClientId:function(){return Ce},getSelectedBlockClientIds:function(){return De},getSelectedBlockCount:function(){return we},getSelectedBlocksInitialCaretPosition:function(){return Ae},getSelectionEnd:function(){return ke},getSelectionStart:function(){return _e},getSettings:function(){return Wt},getTemplate:function(){return ht},getTemplateLock:function(){return bt},hasBlockMovingClientId:function(){return nn},hasDraggedInnerBlock:function(){return tt},hasInserterItems:function(){return Rt},hasMultiSelection:function(){return ot},hasSelectedBlock:function(){return Se},hasSelectedInnerBlock:function(){return et},isAncestorBeingDragged:function(){return dt},isAncestorMultiSelected:function(){return Ue},isBlockBeingDragged:function(){return ut},isBlockHighlighted:function(){return rn},isBlockInsertionPointVisible:function(){return ft},isBlockMultiSelected:function(){return Ge},isBlockSelected:function(){return Je},isBlockValid:function(){return le},isBlockVisible:function(){return cn},isBlockWithinSelection:function(){return nt},isCaretWithinFormattedText:function(){return pt},isDraggingBlocks:function(){return st},isFirstMultiSelectedBlock:function(){return He},isLastBlockChangePersistent:function(){return qt},isMultiSelecting:function(){return rt},isNavigationMode:function(){return en},isSelectionEnabled:function(){return lt},isTyping:function(){return at},isValidTemplate:function(){return gt},wasBlockJustInserted:function(){return sn}});var r={};n.r(r),n.d(r,{__experimentalUpdateSettings:function(){return kn},clearRemovalPrompt:function(){return In},displayRemovalPrompt:function(){return Bn},ensureDefaultBlock:function(){return xn},hideBlockInterface:function(){return yn},privateRemoveBlocks:function(){return Cn},setBlockEditingMode:function(){return wn},showBlockInterface:function(){return En},toggleRemovalPromptSupport:function(){return Tn},unsetBlockEditingMode:function(){return Sn}});var l={};n.r(l),n.d(l,{__unstableDeleteSelection:function(){return so},__unstableExpandSelection:function(){return uo},__unstableMarkAutomaticChange:function(){return Mo},__unstableMarkLastChangeAsPersistent:function(){return Io},__unstableMarkNextChangeAsNotPersistent:function(){return To},__unstableSaveReusableBlock:function(){return Bo},__unstableSetEditorMode:function(){return No},__unstableSetTemporarilyEditingAsBlocks:function(){return Ho},__unstableSplitSelection:function(){return co},clearSelectedBlock:function(){return Wn},duplicateBlocks:function(){return Ro},enterFormattedText:function(){return yo},exitFormattedText:function(){return Eo},flashBlock:function(){return zo},hideInsertionPoint:function(){return lo},insertAfterBlock:function(){return Do},insertBeforeBlock:function(){return Ao},insertBlock:function(){return no},insertBlocks:function(){return oo},insertDefaultBlock:function(){return So},mergeBlocks:function(){return po},moveBlockToPosition:function(){return to},moveBlocksDown:function(){return Qn},moveBlocksToPosition:function(){return eo},moveBlocksUp:function(){return Jn},multiSelect:function(){return jn},receiveBlocks:function(){return On},removeBlock:function(){return fo},removeBlocks:function(){return mo},replaceBlock:function(){return Yn},replaceBlocks:function(){return Zn},replaceInnerBlocks:function(){return go},resetBlocks:function(){return Rn},resetSelection:function(){return Dn},selectBlock:function(){return Fn},selectNextBlock:function(){return Gn},selectPreviousBlock:function(){return Hn},selectionChange:function(){return wo},setBlockMovingClientId:function(){return Lo},setBlockVisibility:function(){return Fo},setHasControlledInnerBlocks:function(){return Vo},setNavigationMode:function(){return Po},setTemplateValidity:function(){return io},showInsertionPoint:function(){return ro},startDraggingBlocks:function(){return _o},startMultiSelect:function(){return Un},startTyping:function(){return bo},stopDraggingBlocks:function(){return ko},stopMultiSelect:function(){return $n},stopTyping:function(){return vo},synchronizeTemplate:function(){return ao},toggleBlockHighlight:function(){return Oo},toggleBlockMode:function(){return ho},toggleSelection:function(){return Kn},updateBlock:function(){return Vn},updateBlockAttributes:function(){return zn},updateBlockListSettings:function(){return Co},updateSettings:function(){return xo},validateBlocksToTemplate:function(){return An}});var i={};n.r(i),n.d(i,{AdvancedPanel:function(){return gT},BorderPanel:function(){return Qv},ColorPanel:function(){return D_},DimensionsPanel:function(){return wy},EffectsPanel:function(){return uT},FiltersPanel:function(){return aE},GlobalStylesContext:function(){return vl},TypographyPanel:function(){return Pk},areGlobalStyleConfigsEqual:function(){return bl},getBlockCSSSelector:function(){return Qy},getLayoutStyles:function(){return qI},useGlobalSetting:function(){return El},useGlobalStyle:function(){return wl},useGlobalStylesOutput:function(){return rT},useGlobalStylesOutputWithConfig:function(){return oT},useGlobalStylesReset:function(){return yl},useHasBorderPanel:function(){return jv},useHasColorPanel:function(){return w_},useHasDimensionsPanel:function(){return dy},useHasEffectsPanel:function(){return iT},useHasFiltersPanel:function(){return tE},useHasTypographyPanel:function(){return kk},useSettingsForBlockElement:function(){return Sl}});var a=window.wp.blocks,s=window.wp.hooks;(0,s.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&(0,a.hasBlockSupport)(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}));var c=window.wp.element,u=n(4403),d=n.n(u),p=window.wp.compose,m=window.wp.components,f=window.wp.data;var g={default:(0,m.createSlotFill)("BlockControls"),block:(0,m.createSlotFill)("BlockControlsBlock"),inline:(0,m.createSlotFill)("BlockFormatControls"),other:(0,m.createSlotFill)("BlockControlsOther"),parent:(0,m.createSlotFill)("BlockControlsParent")},h=n(5619),b=n.n(h),v=window.wp.i18n;const _={insertUsage:{}},k={alignWide:!1,supportsLayout:!0,colors:[{name:(0,v.__)("Black"),slug:"black",color:"#000000"},{name:(0,v.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,v.__)("White"),slug:"white",color:"#ffffff"},{name:(0,v.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,v.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,v.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,v.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,v.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,v.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,v.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,v.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,v.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,v._x)("Small","font size name"),size:13,slug:"small"},{name:(0,v._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,v._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,v._x)("Large","font size name"),size:36,slug:"large"},{name:(0,v._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,v.__)("Thumbnail")},{slug:"medium",name:(0,v.__)("Medium")},{slug:"large",name:(0,v.__)("Large")},{slug:"full",name:(0,v.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,canLockBlocks:!0,enableOpenverseMediaCategory:!0,clearBlockSelection:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__unstableGalleryWithImageBlocks:!1,__unstableIsPreviewMode:!1,blockInspectorAnimation:{animationParent:"core/navigation","core/navigation":{enterDirection:"leftToRight"},"core/navigation-submenu":{enterDirection:"rightToLeft"},"core/navigation-link":{enterDirection:"rightToLeft"},"core/search":{enterDirection:"rightToLeft"},"core/social-links":{enterDirection:"rightToLeft"},"core/page-list":{enterDirection:"rightToLeft"},"core/spacer":{enterDirection:"rightToLeft"},"core/home-link":{enterDirection:"rightToLeft"},"core/site-title":{enterDirection:"rightToLeft"},"core/site-logo":{enterDirection:"rightToLeft"}},generateAnchors:!1,gradients:[{name:(0,v.__)("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,v.__)("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,v.__)("Luminous vivid amber to luminous vivid orange"),gradient:"linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)",slug:"luminous-vivid-amber-to-luminous-vivid-orange"},{name:(0,v.__)("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,v.__)("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,v.__)("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,v.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,v.__)("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,v.__)("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,v.__)("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,v.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,v.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function y(e,t,n){return[...e.slice(0,n),...Array.isArray(t)?t:[t],...e.slice(n)]}function E(e,t,n,o=1){const r=[...e];return r.splice(t,o),y(r,e.slice(t,t+o),n)}const w=e=>e;function S(e,t=""){const n=new Map,o=[];return n.set(t,o),e.forEach((e=>{const{clientId:t,innerBlocks:r}=e;o.push(t),S(r,t).forEach(((e,t)=>{n.set(t,e)}))})),n}function C(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 x(e,t=w){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 B(e){return x(e,(e=>{const{attributes:t,...n}=e;return n}))}function I(e){return x(e,(e=>e.attributes))}function T(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&b()(e.clientIds,t.clientIds)&&function(e,t){return b()(Object.keys(e),Object.keys(t))}(e.attributes,t.attributes)}function M(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 P(e,t,n=!1){const o=e.tree,r=new Set([]),l=new Set;for(const o of t){let t=n?o:e.parents.get(o);do{if(e.controlledInnerBlocks[t]){l.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 l)o.set("controlled||"+t,{innerBlocks:(e.order.get(t)||[]).map((e=>o.get(e)))})}const N=(0,p.pipe)(f.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:l}=t.byClientId.get(r);"core/block"===l&&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),M(o,n.blocks),P(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)}),P(o,[n.clientId],!1);break;case"UPDATE_BLOCK_ATTRIBUTES":o.tree=new Map(o.tree),n.clientIds.forEach((e=>{o.tree.set(e,{...o.tree.get(e),attributes:o.attributes.get(e)})})),P(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.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e))).forEach((e=>{o.tree.delete(e)})),M(o,n.blocks),P(o,n.blocks.map((e=>e.clientId)),!1);const r=[];for(const e of n.clientIds)void 0===t.parents.get(e)||""!==t.parents.get(e)&&!o.byClientId.get(t.parents.get(e))||r.push(t.parents.get(e));P(o,r,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const r of n.clientIds)void 0===t.parents.get(r)||""!==t.parents.get(r)&&!o.byClientId.get(t.parents.get(r))||e.push(t.parents.get(r));o.tree=new Map(o.tree),n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e))).forEach((e=>{o.tree.delete(e)})),P(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),P(o,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=new Map(o.tree),P(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})})),P(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 l=r;if(n.blocks.length){l=e(l,{...n,type:"INSERT_BLOCKS",index:0});const r=new Map(l.order);Object.keys(o).forEach((e=>{t.order.get(e)&&r.set(e,t.order.get(e))})),l.order=r,l.tree=new Map(l.tree),Object.keys(o).forEach((e=>{const n=`controlled||${e}`;t.tree.has(n)&&l.tree.set(n,t.tree.get(n))}))}return l}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:new Map(B(n.blocks)),attributes:new Map(I(n.blocks)),order:S(n.blocks),parents:new Map(C(n.blocks)),controlledInnerBlocks:{}};return e.tree=new Map(t?.tree),M(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=!1;return(o,r)=>{let l=e(o,r);const i="MARK_LAST_CHANGE_AS_PERSISTENT"===r.type||n;if(o===l&&!i){var a;n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type;const e=null===(a=o?.isPersistentChange)||void 0===a||a;return o.isPersistentChange===e?o:{...l,isPersistentChange:e}}return l={...l,isPersistentChange:i?!n:!T(r,t)},t=r,n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type,l}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,o)=>{const r=e(n,o);return r!==n&&(r.isIgnoredChange=t.has(o.type)),r}}),(e=>(t,n)=>{if("SET_HAS_CONTROLLED_INNER_BLOCKS"===n.type){const o=e(t,{type:"REPLACE_INNER_BLOCKS",rootClientId:n.clientId,blocks:[]});return e(o,n)}return e(t,n)}))({byClientId(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const n=new Map(e);return B(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)})),B(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 I(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"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e.get(t))))return e;let o=!1;const r=new Map(e);for(const l of t.clientIds){var n;const i=Object.entries(t.uniqueByBlock?t.attributes[l]:null!==(n=t.attributes)&&void 0!==n?n:{});if(0===i.length)continue;let a=!1;const s=e.get(l),c={};i.forEach((([e,t])=>{s[e]!==t&&(a=!0,c[e]=t)})),o=o||a,a&&r.set(l,{...s,...c})}return o?r:e}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),I(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},order(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":{var n;const o=S(t.blocks),r=new Map(e);return o.forEach(((e,t)=>{""!==t&&r.set(t,e)})),r.set("",(null!==(n=e.get(""))&&void 0!==n?n:[]).concat(o[""])),r}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e.get(n)||[],r=S(t.blocks,n),{index:l=o.length}=t,i=new Map(e);return r.forEach(((e,t)=>{i.set(t,e)})),i.set(n,y(o,r.get(n),l)),i}case"MOVE_BLOCKS_TO_POSITION":{var o;const{fromRootClientId:n="",toRootClientId:r="",clientIds:l}=t,{index:i=e.get(r).length}=t;if(n===r){const t=e.get(r).indexOf(l[0]),n=new Map(e);return n.set(r,E(e.get(r),t,i,l.length)),n}const a=new Map(e);return a.set(n,null!==(o=e.get(n)?.filter((e=>!l.includes(e))))&&void 0!==o?o:[]),a.set(r,y(e.get(r),l,i)),a}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=n[0],l=e.get(o);if(!l.length||r===l[0])return e;const i=l.indexOf(r),a=new Map(e);return a.set(o,E(l,i,i-1,n.length)),a}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=n[0],l=n[n.length-1],i=e.get(o);if(!i.length||l===i[i.length-1])return e;const a=i.indexOf(r),s=new Map(e);return s.set(o,E(i,a,a+1,n.length)),s}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=S(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 l=Object.values(e).reduce(((e,t)=>t===n[0]?[...e,...o.get("")]:(-1===n.indexOf(t)&&e.push(t),e)),[]);r.set(t,l)})),r}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n.forEach(((e,o)=>{var r;const l=null!==(r=e?.filter((e=>!t.removedClientIds.includes(e))))&&void 0!==r?r:[];l.length!==e.length&&n.set(o,l)})),n}}return e},parents(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":{const n=new Map(e);return C(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"INSERT_BLOCKS":{const n=new Map(e);return C(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)})),C(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}){return"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e}});function L(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 R=(0,f.combineReducers)({blocks:N,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:l}=t;return r===e.selectionStart?.clientId&&l===e.selectionEnd?.clientId?e:{selectionStart:{clientId:r},selectionEnd:{clientId:l}};case"RESET_BLOCKS":const i=e?.selectionStart?.clientId,a=e?.selectionEnd?.clientId;if(!i&&!a)return e;if(!t.blocks.some((e=>e.clientId===i)))return{selectionStart:{},selectionEnd:{}};if(!t.blocks.some((e=>e.clientId===a)))return{...e,selectionEnd:e.selectionStart}}const n=L(e.selectionStart,t),o=L(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{clientId:n}=t;if(!t.settings){if(e.hasOwnProperty(n)){const{[n]:t,...o}=e;return o}return e}return b()(e[n],t.settings)?e:{...e,[n]:t.settings}}}return e},insertionPoint:function(e=null,t){switch(t.type){case"SHOW_INSERTION_POINT":{const{rootClientId:n,index:o,__unstableWithInserter:r,operation:l}=t,i={rootClientId:n,index:o,__unstableWithInserter:r,operation:l};return b()(e,i)?e:i}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=k,t){return"UPDATE_SETTINGS"===t.type?{...e,...t.settings}:e},preferences:function(e=_,t){switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":return t.blocks.reduce(((e,n)=>{const{attributes:o,name:r}=n;let l=r;const i=(0,f.select)(a.store).getActiveBlockVariation(r,o);return i?.name&&(l+="/"+i.name),"core/block"===r&&(l+="/"+o.ref),{...e,insertUsage:{...e.insertUsage,[l]:{time:t.time,count:e.insertUsage[l]?e.insertUsage[l].count+1:1}}}}),e)}return e},lastBlockAttributesChange:function(e=null,t){switch(t.type){case"UPDATE_BLOCK":if(!t.updates.attributes)break;return{[t.clientId]:t.updates.attributes};case"UPDATE_BLOCK_ATTRIBUTES":return t.clientIds.reduce(((e,n)=>({...e,[n]:t.uniqueByBlock?t.attributes[n]:t.attributes})),{})}return e},editorMode:function(e="edit",t){return"INSERT_BLOCKS"===t.type&&"navigation"===e?"edit":"SET_EDITOR_MODE"===t.type?t.mode:e},hasBlockMovingClientId:function(e=null,t){return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_EDITOR_MODE"===t.type?null:e},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":case"REPLACE_INNER_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},blockVisibility:function(e={},t){return"SET_BLOCK_VISIBILITY"===t.type?{...e,...t.updates}:e},blockEditingModes:function(e=new Map,t){switch(t.type){case"SET_BLOCK_EDITING_MODE":return new Map(e).set(t.clientId,t.mode);case"UNSET_BLOCK_EDITING_MODE":{const n=new Map(e);return n.delete(t.clientId),n}case"RESET_BLOCKS":return e.has("")?(new Map).set("",e.get("")):e}return e},removalPromptData:function(e=!1,t){switch(t.type){case"DISPLAY_REMOVAL_PROMPT":const{clientIds:e,selectPrevious:n,blockNamesForPrompt:o}=t;return{clientIds:e,selectPrevious:n,blockNamesForPrompt:o};case"CLEAR_REMOVAL_PROMPT":return!1}return e},isRemovalPromptSupported:function(e=!1,t){return"TOGGLE_REMOVAL_PROMPT_SUPPORT"===t.type?t.status:e}});var A=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}}(R),D={};function O(e){return[e]}function z(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}function V(e,t){var n,o=t||O;function r(){n=new WeakMap}function l(){var t,r,l,i,a,s=arguments.length;for(i=new Array(s),l=0;l<s;l++)i[l]=arguments[l];for(t=function(e){var t,o,r,l,i,a=n,s=!0;for(t=0;t<e.length;t++){if(!(i=o=e[t])||"object"!=typeof i){s=!1;break}a.has(o)?a=a.get(o):(r=new WeakMap,a.set(o,r),a=r)}return a.has(D)||((l=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=s,a.set(D,l)),a.get(D)}(a=o.apply(null,i)),t.isUniqueByDependants||(t.lastDependants&&!z(a,t.lastDependants,0)&&t.clear(),t.lastDependants=a),r=t.head;r;){if(z(r.args,i,1))return r!==t.head&&(r.prev.next=r.next,r.next&&(r.next.prev=r.prev),r.next=t.head,r.prev=null,t.head.prev=r,t.head=r),r.val;r=r.next}return r={val:e.apply(null,i)},i[0]=null,r.args=i,t.head&&(t.head.prev=r,r.next=t.head),t.head=r,r.val}return l.getDependants=o,l.clear=r,r(),l}var F=window.wp.primitives;var H=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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"})),G=window.wp.richText,U=window.wp.deprecated,$=n.n(U);function j(e){const{multiline:t,__unstableMultilineWrapperTags:n,__unstablePreserveWhiteSpace:o}=e;return{multilineTag:t,multilineWrapperTags:n,preserveWhiteSpace:o}}const W=(e,t,n)=>(o,r)=>{let l,i;if("function"==typeof e?(l=e(o),i=e(r)):(l=o[e],i=r[e]),l>i)return"asc"===n?1:-1;if(i>l)return"asc"===n?-1:1;const a=t.findIndex((e=>e===o)),s=t.findIndex((e=>e===r));return a>s?1:s>a?-1:0};function K(e,t,n="asc"){return e.concat().sort(W(t,e,n))}function q(e){return e.isBlockInterfaceHidden}function Z(e){return e?.lastBlockInserted?.clientIds}function Y(e,t=""){if(e.blockEditingModes.has(t))return e.blockEditingModes.get(t);if(!t)return"default";const n=Be(e,t);if("contentOnly"===bt(e,n)){const n=re(e,t);return(0,f.select)(a.store).__experimentalHasContentRoleAttribute(n)?"contentOnly":"disabled"}const o=Y(e,n);return"contentOnly"===o?"default":o}const X=V(((e,t)=>{const n=t=>{const o=e.blockEditingModes.get(t);return(void 0===o||"disabled"===o)&&Xe(e,t).every(n)};return"disabled"===Y(e,t)&&Xe(e,t).every(n)}),(e=>[e.blockEditingModes,e.blocks.parents])),Q=V(((e,t="")=>Xe(e,t).flatMap((t=>"disabled"!==Y(e,t)?[{clientId:t,innerBlocks:Q(e,t)}]:Q(e,t)))),(e=>[e.blocks.order,e.blockEditingModes,e.settings.templateLock,e.blockListSettings])),J=V(((e,t,n=!1)=>Ie(e,t,n).filter((t=>"disabled"!==Y(e,t)))),(e=>[e.blocks.parents,e.blockEditingModes,e.settings.templateLock,e.blockListSettings]));function ee(e){return e.removalPromptData}function te(e){return e.isRemovalPromptSupported}const ne=[],oe=new Set;function re(e,t){const n=e.blocks.byClientId.get(t),o="core/social-link";if("web"!==c.Platform.OS&&n?.name===o){const n=e.blocks.attributes.get(t),{service:r}=null!=n?n:{};return r?`${o}-${r}`:o}return n?n.name:null}function le(e,t){const n=e.blocks.byClientId.get(t);return!!n&&n.isValid}function ie(e,t){return e.blocks.byClientId.get(t)?e.blocks.attributes.get(t):null}function ae(e,t){return e.blocks.byClientId.has(t)?e.blocks.tree.get(t):null}const se=V(((e,t)=>e.blocks.byClientId.has(t)?{...e.blocks.byClientId.get(t),attributes:ie(e,t)}:null),((e,t)=>[e.blocks.byClientId.get(t),e.blocks.attributes.get(t)]));function ce(e,t){const n=t&&ln(e,t)?"controlled||"+t:t||"";return e.blocks.tree.get(n)?.innerBlocks||ne}const ue=V(((e,t)=>($()("wp.data.select( 'core/block-editor' ).__unstableGetClientIdWithClientIdsTree",{since:"6.3",version:"6.5"}),{clientId:t,innerBlocks:de(e,t)})),(e=>[e.blocks.order])),de=V(((e,t="")=>($()("wp.data.select( 'core/block-editor' ).__unstableGetClientIdsTree",{since:"6.3",version:"6.5"}),Xe(e,t).map((t=>ue(e,t))))),(e=>[e.blocks.order])),pe=V(((e,t)=>{const n=[];for(const o of t)for(const t of Xe(e,o))n.push(t,...pe(e,[t]));return n}),(e=>[e.blocks.order])),me=V((e=>{const t=[];for(const n of Xe(e))t.push(n,...pe(e,[n]));return t}),(e=>[e.blocks.order])),fe=V(((e,t)=>{const n=me(e);return t?n.reduce(((n,o)=>e.blocks.byClientId.get(o).name===t?n+1:n),0):n.length}),(e=>[e.blocks.order,e.blocks.byClientId])),ge=V(((e,t)=>{if(!t)return ne;const n=Array.isArray(t)?t:[t],o=me(e).filter((t=>{const o=e.blocks.byClientId.get(t);return n.includes(o.name)}));return o.length>0?o:ne}),(e=>[e.blocks.order,e.blocks.byClientId])),he=V(((e,t)=>(Array.isArray(t)?t:[t]).map((t=>ae(e,t)))),((e,t)=>(Array.isArray(t)?t:[t]).map((t=>e.blocks.tree.get(t))))),be=V(((e,t)=>he(e,t).filter(Boolean).map((e=>e.name))),((e,t)=>he(e,t)));function ve(e,t){return Xe(e,t).length}function _e(e){return e.selection.selectionStart}function ke(e){return e.selection.selectionEnd}function ye(e){return e.selection.selectionStart.clientId}function Ee(e){return e.selection.selectionEnd.clientId}function we(e){const t=Oe(e).length;return t||(e.selection.selectionStart.clientId?1:0)}function Se(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function Ce(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function xe(e){const t=Ce(e);return t?ae(e,t):null}function Be(e,t){return e.blocks.parents.has(t)?e.blocks.parents.get(t):null}const Ie=V(((e,t,n=!1)=>{const o=[];let r=t;for(;e.blocks.parents.get(r);)r=e.blocks.parents.get(r),o.push(r);return o.length?n?o:o.reverse():ne}),(e=>[e.blocks.parents])),Te=V(((e,t,n,o=!1)=>{const r=Ie(e,t,o),l=Array.isArray(n)?e=>n.includes(e):e=>n===e;return r.filter((t=>l(re(e,t))))}),(e=>[e.blocks.parents]));function Me(e,t){let n,o=t;do{n=o,o=e.blocks.parents.get(o)}while(o);return n}function Pe(e,t){const n=Ce(e),o=[...Ie(e,t),t],r=[...Ie(e,n),n];let l;const i=Math.min(o.length,r.length);for(let e=0;e<i&&o[e]===r[e];e++)l=o[e];return l}function Ne(e,t,n=1){if(void 0===t&&(t=Ce(e)),void 0===t&&(t=n<0?Ve(e):Fe(e)),!t)return null;const o=Be(e,t);if(null===o)return null;const{order:r}=e.blocks,l=r.get(o),i=l.indexOf(t)+1*n;return i<0||i===l.length?null:l[i]}function Le(e,t){return Ne(e,t,-1)}function Re(e,t){return Ne(e,t,1)}function Ae(e){return e.initialPosition}const De=V((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(!t.clientId||!n.clientId)return ne;if(t.clientId===n.clientId)return[t.clientId];const o=Be(e,t.clientId);if(null===o)return ne;const r=Xe(e,o),l=r.indexOf(t.clientId),i=r.indexOf(n.clientId);return l>i?r.slice(i,l+1):r.slice(l,i+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Oe(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?ne:De(e)}const ze=V((e=>{const t=Oe(e);return t.length?t.map((t=>ae(e,t))):ne}),(e=>[...De.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Ve(e){return Oe(e)[0]||null}function Fe(e){const t=Oe(e);return t[t.length-1]||null}function He(e,t){return Ve(e)===t}function Ge(e,t){return-1!==Oe(e).indexOf(t)}const Ue=V(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=Be(e,n),o=Ge(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function $e(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function je(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function We(e){const t=_e(e),n=ke(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Ke(e){const t=_e(e),n=ke(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function qe(e){return De(e).some((t=>{const n=re(e,t);return!(0,a.getBlockType)(n).merge}))}function Ze(e,t){const n=_e(e),o=ke(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=Be(e,n.clientId);if(r!==Be(e,o.clientId))return!1;const l=Xe(e,r);let i,s;l.indexOf(n.clientId)>l.indexOf(o.clientId)?(i=o,s=n):(i=n,s=o);const c=t?s.clientId:i.clientId,u=t?i.clientId:s.clientId,d=re(e,c);if(!(0,a.getBlockType)(d).merge)return!1;const p=ae(e,u);if(p.name===d)return!0;const m=(0,a.switchToBlockType)(p,d);return m&&m.length}const Ye=e=>{const t=_e(e),n=ke(e);if(t.clientId===n.clientId)return ne;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return ne;const o=Be(e,t.clientId);if(o!==Be(e,n.clientId))return ne;const r=Xe(e,o),l=r.indexOf(t.clientId),i=r.indexOf(n.clientId),[s,c]=l>i?[n,t]:[t,n],u=ae(e,s.clientId),d=(0,a.getBlockType)(u.name),p=ae(e,c.clientId),m=(0,a.getBlockType)(p.name),f=u.attributes[s.attributeKey],g=p.attributes[c.attributeKey],h=d.attributes[s.attributeKey],b=m.attributes[c.attributeKey];let v=(0,G.create)({html:f,...j(h)}),_=(0,G.create)({html:g,...j(b)});return v=(0,G.remove)(v,0,s.offset),_=(0,G.remove)(_,c.offset,_.text.length),[{...u,attributes:{...u.attributes,[s.attributeKey]:(0,G.toHTMLString)({value:v,...j(h)})}},{...p,attributes:{...p.attributes,[c.attributeKey]:(0,G.toHTMLString)({value:_,...j(b)})}}]};function Xe(e,t){return e.blocks.order.get(t||"")||ne}function Qe(e,t){return Xe(e,Be(e,t)).indexOf(t)}function Je(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function et(e,t,n=!1){return Xe(e,t).some((t=>Je(e,t)||Ge(e,t)||n&&et(e,t,n)))}function tt(e,t,n=!1){return Xe(e,t).some((t=>ut(e,t)||n&&tt(e,t,n)))}function nt(e,t){if(!t)return!1;const n=Oe(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function ot(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function rt(e){return e.isMultiSelecting}function lt(e){return e.isSelectionEnabled}function it(e,t){return e.blocksMode[t]||"visual"}function at(e){return e.isTyping}function st(e){return!!e.draggedBlocks.length}function ct(e){return e.draggedBlocks}function ut(e,t){return e.draggedBlocks.includes(t)}function dt(e,t){if(!st(e))return!1;return Ie(e,t).some((t=>ut(e,t)))}function pt(){return $()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}const mt=V((e=>{let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=Be(e,l)||void 0,n=Qe(e,r.clientId)+1):n=Xe(e).length,{rootClientId:t,index:n}}),(e=>[e.insertionPoint,e.selection.selectionEnd.clientId,e.blocks.parents,e.blocks.order]));function ft(e){return null!==e.insertionPoint}function gt(e){return e.template.isValid}function ht(e){return e.settings.template}function bt(e,t){var n,o;return t?null!==(n=jt(e,t)?.templateLock)&&void 0!==n&&n:null!==(o=e.settings.templateLock)&&void 0!==o&&o}const vt=(e,t,n=null)=>"boolean"==typeof e?e:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n,_t=(e,t,n=null)=>{let o;if(t&&"object"==typeof t?(o=t,t=o.name):o=(0,a.getBlockType)(t),!o)return!1;const{allowedBlockTypes:r}=Wt(e);if(!vt(r,t,!0))return!1;if(!!bt(e,n))return!1;if("disabled"===Y(e,null!=n?n:""))return!1;const l=jt(e,n);if(n&&void 0===l)return!1;const i=l?.allowedBlocks,c=vt(i,t),u=o.parent,d=re(e,n),p=vt(u,d);let m=!0;const f=o.ancestor;if(f){m=[n,...Ie(e,n)].some((t=>vt(f,re(e,t))))}const g=m&&(null===c&&null===p||!0===c||!0===p);return g?(0,s.applyFilters)("blockEditor.__unstableCanInsertBlockType",g,o,n,{getBlock:ae.bind(null,e),getBlockParentsByBlockName:Te.bind(null,e)}):g},kt=V(_t,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId.get(n),e.settings.allowedBlockTypes,e.settings.templateLock,e.blockEditingModes]));function yt(e,t,n=null){return t.every((t=>kt(e,re(e,t),n)))}function Et(e,t,n=null){const o=ie(e,t);return null===o||(void 0!==o.lock?.remove?!o.lock.remove:!bt(e,n)&&"disabled"!==Y(e,n))}function wt(e,t,n=null){return t.every((t=>Et(e,t,n)))}function St(e,t,n=null){const o=ie(e,t);return null===o||(void 0!==o.lock?.move?!o.lock.move:"all"!==bt(e,n)&&"disabled"!==Y(e,n))}function Ct(e,t,n=null){return t.every((t=>St(e,t,n)))}function xt(e,t){const n=ie(e,t);if(null===n)return!0;const{lock:o}=n;return!o?.edit}function Bt(e,t){return!!(0,a.hasBlockSupport)(t,"lock",!0)&&!!e.settings?.canLockBlocks}function It(e,t){var n;return null!==(n=e.preferences.insertUsage?.[t])&&void 0!==n?n:null}const Tt=(e,t,n)=>!!(0,a.hasBlockSupport)(t,"inserter",!0)&&_t(e,t.name,n),Mt=(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}},Pt=(e,{buildScope:t="inserter"})=>n=>{const o=n.name;let r=!1;(0,a.hasBlockSupport)(n.name,"multiple",!0)||(r=he(e,me(e)).some((({name:e})=>e===n.name)));const{time:l,count:i=0}=It(e,o)||{},s={id:o,name:n.name,title:n.title,icon:n.icon,isDisabled:r,frecency:Mt(l,i)};if("transform"===t)return s;const c=(0,a.getBlockVariations)(n.name,"inserter");return{...s,initialAttributes:{},description:n.description,category:n.category,keywords:n.keywords,variations:c,example:n.example,utility:1}},Nt=V(((e,t=null)=>{const n=/^\s*<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/,o=_t(e,"core/block",t)?Jt(e).filter((e=>"fully"===e.wp_pattern_sync_status||""===e.wp_pattern_sync_status||!e.wp_pattern_sync_status)).map((t=>{let o=H;if("web"===c.Platform.OS){const e=("string"==typeof t.content.raw?t.content.raw:t.content).match(n);if(e){const[,,t="core/",n]=e,r=(0,a.getBlockType)(t+n);r&&(o=r.icon)}}const r=`core/block/${t.id}`,{time:l,count:i=0}=It(e,r)||{},s=Mt(l,i);return{id:r,name:"core/block",initialAttributes:{ref:t.id},title:t.title.raw,icon:o,category:"reusable",keywords:[],isDisabled:!1,utility:1,frecency:s,content:t.content.raw}})):[],r=Pt(e,{buildScope:"inserter"}),l=(0,a.getBlockTypes)().filter((n=>Tt(e,n,t))).map(r).reduce(((t,n)=>{const{variations:o=[]}=n;if(o.some((({isDefault:e})=>e))||t.push(n),o.length){const r=((e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=It(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:Mt(r,l)}})(e,n);t.push(...o.map(r))}return t}),[]),{core:i,noncore:s}=l.reduce(((e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e}),{core:[],noncore:[]});return[...[...i,...s],...o]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,Jt(e),(0,a.getBlockTypes)()])),Lt=V(((e,t,n=null)=>{const o=Array.isArray(t)?t:[t],r=Pt(e,{buildScope:"transform"}),l=(0,a.getBlockTypes)().filter((t=>Tt(e,t,n))).map(r),i=Object.fromEntries(Object.entries(l).map((([,e])=>[e.name,e]))),s=(0,a.getPossibleBlockTransformations)(o).reduce(((e,t)=>(i[t?.name]&&e.push(i[t.name]),e)),[]);return K(s,(e=>i[e.name].frecency),"desc")}),((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,a.getBlockTypes)()])),Rt=V(((e,t=null)=>{if((0,a.getBlockTypes)().some((n=>Tt(e,n,t))))return!0;return _t(e,"core/block",t)&&Jt(e).length>0}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Jt(e),(0,a.getBlockTypes)()])),At=V(((e,t=null)=>{if(t)return(0,a.getBlockTypes)().filter((n=>Tt(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,a.getBlockTypes)()])),Dt=V(((e,t=null)=>($()('wp.data.select( "core/block-editor" ).__experimentalGetAllowedBlocks',{alternative:'wp.data.select( "core/block-editor" ).getAllowedBlocks',since:"6.2",version:"6.4"}),At(e,t))),((e,t)=>[...At.getDependants(e,t)])),Ot=V(((e,t=null)=>{if(!t)return;const n=e.blockListSettings[t]?.__experimentalDefaultBlock,o=e.blockListSettings[t]?.__experimentalDirectInsert;return n&&o?"function"==typeof o?o(ae(e,t))?n:null:n:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree.get(t)]));function zt(e){var t;return(null!==(t=e?.settings?.__experimentalReusableBlocks)&&void 0!==t?t:ne).filter((e=>"unsynced"===e.wp_pattern_sync_status)).map((e=>({name:`core/block/${e.id}`,title:e.title.raw,categories:["custom"],content:e.content.raw})))}const Vt=V(((e,t)=>{const n=[...e.settings.__experimentalBlockPatterns,...zt(e)].find((({name:e})=>e===t));return n?{...n,blocks:(0,a.parse)(n.content,{__unstableSkipMigrationLogs:!0})}:null}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.__experimentalReusableBlocks])),Ft=V((e=>{const t=e.settings.__experimentalBlockPatterns,n=zt(e),{allowedBlockTypes:o}=Wt(e),r=[...t,...n].filter((({inserter:e=!0})=>!!e)).map((({name:t})=>Vt(e,t))),l=r.filter((({blocks:e})=>((e,t)=>{if("boolean"==typeof t)return t;const n=[...e];for(;n.length>0;){const e=n.shift();if(!vt(t,e.name||e.blockName,!0))return!1;e.innerBlocks?.forEach((e=>{n.push(e)}))}return!0})(e,o)));return l}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.__experimentalReusableBlocks,e.settings.allowedBlockTypes])),Ht=V(((e,t=null)=>{const n=Ft(e).filter((({blocks:n})=>n.every((({name:n})=>kt(e,n,t)))));return n}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.__experimentalReusableBlocks,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId.get(t)])),Gt=V(((e,t,n=null)=>{if(!t)return ne;const o=Ht(e,n),r=Array.isArray(t)?t:[t],l=o.filter((e=>e?.blockTypes?.some?.((e=>r.includes(e)))));return 0===l.length?ne:l}),((e,t,n)=>[...Ht.getDependants(e,n)])),Ut=V(((e,t,n=null)=>($()('wp.data.select( "core/block-editor" ).__experimentalGetPatternsByBlockTypes',{alternative:'wp.data.select( "core/block-editor" ).getPatternsByBlockTypes',since:"6.2",version:"6.4"}),Gt(e,t,n))),((e,t,n)=>[...Ht.getDependants(e,n)])),$t=V(((e,t,n=null)=>{if(!t)return ne;if(t.some((({clientId:t,innerBlocks:n})=>n.length||ln(e,t))))return ne;const o=Array.from(new Set(t.map((({name:e})=>e))));return Gt(e,o,n)}),((e,t,n)=>[...Gt.getDependants(e,n)]));function jt(e,t){return e.blockListSettings[t]}function Wt(e){return e.settings}function Kt(e){return e.settings.behaviors}function qt(e){return e.blocks.isPersistentChange}const Zt=V(((e,t=[])=>t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})),(e=>[e.blockListSettings])),Yt=V(((e,t)=>{const n=Jt(e).find((e=>e.id===t));return n?n.title?.raw:null}),(e=>[Jt(e)]));function Xt(e){return e.blocks.isIgnoredChange}function Qt(e){return e.lastBlockAttributesChange}function Jt(e){var t;return null!==(t=e?.settings?.__experimentalReusableBlocks)&&void 0!==t?t:ne}function en(e){return"navigation"===e.editorMode}function tn(e){return e.editorMode}function nn(e){return e.hasBlockMovingClientId}function on(e){return!!e.automaticChangeStatus}function rn(e,t){return e.highlightedBlock===t}function ln(e,t){return!!e.blocks.controlledInnerBlocks[t]}const an=V(((e,t)=>{if(!t.length)return null;const n=Ce(e);if(t.includes(re(e,n)))return n;const o=Oe(e),r=Te(e,n||o[0],t);return r?r[r.length-1]:null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function sn(e,t,n){const{lastBlockInserted:o}=e;return o.clientIds?.includes(t)&&o.source===n}function cn(e,t){var n;return null===(n=e.blockVisibility?.[t])||void 0===n||n}const un=V((e=>{const t=new Set(Object.keys(e.blockVisibility).filter((t=>e.blockVisibility[t])));return 0===t.size?oe:t}),(e=>[e.blockVisibility])),dn=V(((e,t)=>{let n,o=t;for(;e.blocks.parents.has(o);)o=e.blocks.parents.get(o),o&&"contentOnly"===bt(e,o)&&(n=o);return n}),(e=>[e.blocks.parents,e.blockListSettings]));function pn(e){return e.temporarilyEditingAsBlocks}function mn(e,t){if("default"!==Y(e,t))return!1;if(!xt(e,t))return!0;const n=tn(e);if("zoom-out"===n&&t&&!Be(e,t))return!0;const o=(0,a.hasBlockSupport)(re(e,t),"__experimentalDisableBlockOverlay",!1);return("navigation"===n||!o&&ln(e,t))&&!Je(e,t)&&!et(e,t,!0)}function fn(e,t){let n=e.blocks.parents.get(t);for(;n;){if(mn(e,n))return!0;n=e.blocks.parents.get(n)}return!1}var gn=window.wp.privateApis;const{lock:hn,unlock:bn}=(0,gn.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.","@wordpress/block-editor"),vn={"core/query":(0,v.__)("Query Loop displays a list of posts or pages."),"core/post-content":(0,v.__)("Post Content displays the content of a post or page.")};const _n=["inserterMediaCategories","blockInspectorAnimation"];function kn(e,t=!1){let n=e;if(t&&"web"===c.Platform.OS){n={};for(const t in e)_n.includes(t)||(n[t]=e[t])}return{type:"UPDATE_SETTINGS",settings:n}}function yn(){return{type:"HIDE_BLOCK_INTERFACE"}}function En(){return{type:"SHOW_BLOCK_INTERFACE"}}function wn(e="",t){return{type:"SET_BLOCK_EDITING_MODE",clientId:e,mode:t}}function Sn(e=""){return{type:"UNSET_BLOCK_EDITING_MODE",clientId:e}}const Cn=(e,t=!0,n=!1)=>({select:o,dispatch:r})=>{if(!e||!e.length)return;var l;l=e,e=Array.isArray(l)?l:[l];const i=o.getBlockRootClientId(e[0]);if(o.canRemoveBlocks(e,i)){if(!n&&o.isRemovalPromptSupported&&o.isRemovalPromptSupported()){const n=new Set,l=[...e];for(;l.length;){const e=l.shift(),t=o.getBlockName(e);vn[t]&&n.add(t);const r=o.getBlockOrder(e);l.push(...r)}if(n.size)return void r(Bn(e,t,Array.from(n)))}t&&r.selectPreviousBlock(e[0],t),r({type:"REMOVE_BLOCKS",clientIds:e}),r(xn())}},xn=()=>({select:e,dispatch:t})=>{if(e.getBlockCount()>0)return;const{__unstableHasCustomAppender:n}=e.getSettings();n||t.insertDefaultBlock()};function Bn(e,t,n){return{type:"DISPLAY_REMOVAL_PROMPT",clientIds:e,selectPrevious:t,blockNamesForPrompt:n}}function In(){return{type:"CLEAR_REMOVAL_PROMPT"}}function Tn(e=!0){return{type:"TOGGLE_REMOVAL_PROMPT_SUPPORT",status:e}}var Mn=window.wp.a11y;const Pn="†";function Nn(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return"string"==typeof n&&-1!==n.indexOf(Pn)}))}const Ln=e=>Array.isArray(e)?e:[e],Rn=e=>({dispatch:t})=>{t({type:"RESET_BLOCKS",blocks:e}),t(An(e))},An=e=>({select:t,dispatch:n})=>{const o=t.getTemplate(),r=t.getTemplateLock(),l=!o||"all"!==r||(0,a.doBlocksMatchTemplate)(e,o);if(l!==t.isValidTemplate())return n.setTemplateValidity(l),l};function Dn(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function On(e){return $()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function zn(e,t,n=!1){return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:Ln(e),attributes:t,uniqueByBlock:n}}function Vn(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function Fn(e,t=0){return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const Hn=(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)}},Gn=e=>({select:t,dispatch:n})=>{const o=t.getNextBlockClientId(e);o&&n.selectBlock(o)};function Un(){return{type:"START_MULTI_SELECT"}}function $n(){return{type:"STOP_MULTI_SELECT"}}const jn=(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 l=o.getSelectedBlockCount();(0,Mn.speak)((0,v.sprintf)((0,v._n)("%s block selected.","%s blocks selected.",l),l),"assertive")};function Wn(){return{type:"CLEAR_SELECTED_BLOCK"}}function Kn(e=!0){return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function qn(e,t){var n;const o=null!==(n=t?.__experimentalPreferredStyleVariations?.value)&&void 0!==n?n:{};return e.map((e=>{const t=e.name;if(!(0,a.hasBlockSupport)(t,"defaultStylePicker",!0))return e;if(!o[t])return e;const n=e.attributes?.className;if(n?.includes("is-style-"))return e;const{attributes:r={}}=e,l=o[t];return{...e,attributes:{...r,className:`${n||""} is-style-${l}`.trim()}}}))}const Zn=(e,t,n,o=0,r)=>({select:l,dispatch:i})=>{e=Ln(e),t=qn(Ln(t),l.getSettings());const a=l.getBlockRootClientId(e[0]);for(let e=0;e<t.length;e++){const n=t[e];if(!l.canInsertBlockType(n.name,a))return}i({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:o,meta:r}),i(xn())};function Yn(e,t){return Zn(e,t)}const Xn=e=>(t,n)=>({select:o,dispatch:r})=>{o.canMoveBlocks(t,n)&&r({type:e,clientIds:Ln(t),rootClientId:n})},Qn=Xn("MOVE_BLOCKS_DOWN"),Jn=Xn("MOVE_BLOCKS_UP"),eo=(e,t="",n="",o)=>({select:r,dispatch:l})=>{if(r.canMoveBlocks(e,t)){if(t!==n){if(!r.canRemoveBlocks(e,t))return;if(!r.canInsertBlocks(e,n))return}l({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o})}};function to(e,t="",n="",o){return eo([e],t,n,o)}function no(e,t,n,o,r){return oo([e],t,n,o,0,r)}const oo=(e,t,n,o=!0,r=0,l)=>({select:i,dispatch:a})=>{null!==r&&"object"==typeof r&&(l=r,r=0,$()("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=qn(Ln(e),i.getSettings());const s=[];for(const t of e){i.canInsertBlockType(t.name,n)&&s.push(t)}s.length&&a({type:"INSERT_BLOCKS",blocks:s,index:t,rootClientId:n,time:Date.now(),updateSelection:o,initialPosition:o?r:null,meta:l})};function ro(e,t,n={}){const{__unstableWithInserter:o,operation:r}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o,operation:r}}const lo=()=>({select:e,dispatch:t})=>{e.isBlockInsertionPointVisible()&&t({type:"HIDE_INSERTION_POINT"})};function io(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const ao=()=>({select:e,dispatch:t})=>{t({type:"SYNCHRONIZE_TEMPLATE"});const n=e.getBlocks(),o=e.getTemplate(),r=(0,a.synchronizeBlocksWithTemplate)(n,o);t.resetBlocks(r)},so=e=>({registry:t,select:n,dispatch:o})=>{const r=n.getSelectionStart(),l=n.getSelectionEnd();if(r.clientId===l.clientId)return;if(!r.attributeKey||!l.attributeKey||void 0===r.offset||void 0===l.offset)return!1;const i=n.getBlockRootClientId(r.clientId);if(i!==n.getBlockRootClientId(l.clientId))return;const s=n.getBlockOrder(i);let c,u;s.indexOf(r.clientId)>s.indexOf(l.clientId)?(c=l,u=r):(c=r,u=l);const d=e?u:c,p=n.getBlock(d.clientId),m=(0,a.getBlockType)(p.name);if(!m.merge)return;const f=c,g=u,h=n.getBlock(f.clientId),b=(0,a.getBlockType)(h.name),v=n.getBlock(g.clientId),_=(0,a.getBlockType)(v.name),k=h.attributes[f.attributeKey],y=v.attributes[g.attributeKey],E=b.attributes[f.attributeKey],w=_.attributes[g.attributeKey];let S=(0,G.create)({html:k,...j(E)}),C=(0,G.create)({html:y,...j(w)});S=(0,G.remove)(S,f.offset,S.text.length),C=(0,G.insert)(C,Pn,0,g.offset);const x=(0,a.cloneBlock)(h,{[f.attributeKey]:(0,G.toHTMLString)({value:S,...j(E)})}),B=(0,a.cloneBlock)(v,{[g.attributeKey]:(0,G.toHTMLString)({value:C,...j(w)})}),I=e?x:B,T=h.name===v.name?[I]:(0,a.switchToBlockType)(I,m.name);if(!T||!T.length)return;let M;if(e){const e=T.pop();M=m.merge(e.attributes,B.attributes)}else{const e=T.shift();M=m.merge(x.attributes,e.attributes)}const P=Nn(M),N=M[P],L=(0,G.create)({html:N,...j(m.attributes[P])}),R=L.text.indexOf(Pn),A=(0,G.remove)(L,R,R+1),D=(0,G.toHTMLString)({value:A,...j(m.attributes[P])});M[P]=D;const O=n.getSelectedBlockClientIds(),z=[...e?T:[],{...p,attributes:{...p.attributes,...M}},...e?[]:T];t.batch((()=>{o.selectionChange(p.clientId,P,R,R),o.replaceBlocks(O,z,0,n.getSelectedBlocksInitialCaretPosition())}))},co=()=>({select:e,dispatch:t})=>{const n=e.getSelectionStart(),o=e.getSelectionEnd();if(n.clientId===o.clientId)return;if(!n.attributeKey||!o.attributeKey||void 0===n.offset||void 0===o.offset)return;const r=e.getBlockRootClientId(n.clientId);if(r!==e.getBlockRootClientId(o.clientId))return;const l=e.getBlockOrder(r);let i,s;l.indexOf(n.clientId)>l.indexOf(o.clientId)?(i=o,s=n):(i=n,s=o);const c=i,u=s,d=e.getBlock(c.clientId),p=(0,a.getBlockType)(d.name),m=e.getBlock(u.clientId),f=(0,a.getBlockType)(m.name),g=d.attributes[c.attributeKey],h=m.attributes[u.attributeKey],b=p.attributes[c.attributeKey],v=f.attributes[u.attributeKey];let _=(0,G.create)({html:g,...j(b)}),k=(0,G.create)({html:h,...j(v)});_=(0,G.remove)(_,c.offset,_.text.length),k=(0,G.remove)(k,0,u.offset),t.replaceBlocks(e.getSelectedBlockClientIds(),[{...d,attributes:{...d.attributes,[c.attributeKey]:(0,G.toHTMLString)({value:_,...j(b)})}},(0,a.createBlock)((0,a.getDefaultBlockName)()),{...m,attributes:{...m.attributes,[u.attributeKey]:(0,G.toHTMLString)({value:k,...j(v)})}}],1,e.getSelectedBlocksInitialCaretPosition())},uo=()=>({select:e,dispatch:t})=>{const n=e.getSelectionStart(),o=e.getSelectionEnd();t.selectionChange({start:{clientId:n.clientId},end:{clientId:o.clientId}})},po=(e,t)=>({registry:n,select:o,dispatch:r})=>{const l=[e,t];r({type:"MERGE_BLOCKS",blocks:l});const[i,s]=l,c=o.getBlock(i),u=(0,a.getBlockType)(c.name);if(!u)return;const d=o.getBlock(s);if(u&&!u.merge){const e=(0,a.switchToBlockType)(d,u.name);if(1!==e?.length)return void r.selectBlock(c.clientId);const[t]=e;return t.innerBlocks.length<1?void r.selectBlock(c.clientId):void n.batch((()=>{r.insertBlocks(t.innerBlocks,void 0,i),r.removeBlock(s),r.selectBlock(t.innerBlocks[0].clientId)}))}const p=(0,a.getBlockType)(d.name),{clientId:m,attributeKey:f,offset:g}=o.getSelectionStart(),h=(m===i?u:p).attributes[f],b=(m===i||m===s)&&void 0!==f&&void 0!==g&&!!h;h||("number"==typeof f?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 f):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const v=(0,a.cloneBlock)(c),_=(0,a.cloneBlock)(d);if(b){const e=m===i?v:_,t=e.attributes[f],n=(0,G.insert)((0,G.create)({html:t,...j(h)}),Pn,g,g);e.attributes[f]=(0,G.toHTMLString)({value:n,...j(h)})}const k=c.name===d.name?[_]:(0,a.switchToBlockType)(_,c.name);if(!k||!k.length)return;const y=u.merge(v.attributes,k[0].attributes);if(b){const e=Nn(y),t=y[e],n=(0,G.create)({html:t,...j(u.attributes[e])}),o=n.text.indexOf(Pn),l=(0,G.remove)(n,o,o+1),i=(0,G.toHTMLString)({value:l,...j(u.attributes[e])});y[e]=i,r.selectionChange(c.clientId,e,o,o)}r.replaceBlocks([c.clientId,d.clientId],[{...c,attributes:{...c.attributes,...y}},...k.slice(1)],0)},mo=(e,t=!0)=>Cn(e,t);function fo(e,t){return mo([e],t)}function go(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 ho(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function bo(){return{type:"START_TYPING"}}function vo(){return{type:"STOP_TYPING"}}function _o(e=[]){return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function ko(){return{type:"STOP_DRAGGING_BLOCKS"}}function yo(){return $()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Eo(){return $()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function wo(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const So=(e,t,n)=>({dispatch:o})=>{const r=(0,a.getDefaultBlockName)();if(!r)return;const l=(0,a.createBlock)(r,e);return o.insertBlock(l,n,t)};function Co(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function xo(e){return kn(e,!0)}function Bo(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function Io(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function To(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const Mo=()=>({dispatch:e})=>{e({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:t=(e=>setTimeout(e,100))}=window;t((()=>{e({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))},Po=(e=!0)=>({dispatch:t})=>{t.__unstableSetEditorMode(e?"navigation":"edit")},No=e=>({dispatch:t,select:n})=>{if("zoom-out"===e){const e=n.getBlockSelectionStart();e&&t.selectBlock(n.getBlockHierarchyRootClientId(e))}t({type:"SET_EDITOR_MODE",mode:e}),"navigation"===e?(0,Mn.speak)((0,v.__)("You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.")):"edit"===e?(0,Mn.speak)((0,v.__)("You are currently in edit mode. To return to the navigation mode, press Escape.")):"zoom-out"===e&&(0,Mn.speak)((0,v.__)("You are currently in zoom-out mode."))},Lo=(e=null)=>({dispatch:t})=>{t({type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e}),e&&(0,Mn.speak)((0,v.__)("Use the Tab key and Arrow keys to choose new block location. Use Left and Right Arrow keys to move between nesting levels. Once location is selected press Enter or Space to move the block."))},Ro=(e,t=!0)=>({select:n,dispatch:o})=>{if(!e||!e.length)return;const r=n.getBlocksByClientId(e);if(r.some((e=>!e)))return;const l=r.map((e=>e.name));if(l.some((e=>!(0,a.hasBlockSupport)(e,"multiple",!0))))return;const i=n.getBlockRootClientId(e[0]),s=Ln(e),c=n.getBlockIndex(s[s.length-1]),u=r.map((e=>(0,a.__experimentalCloneSanitizedBlock)(e)));return o.insertBlocks(u,c+1,i,t),u.length>1&&t&&o.multiSelect(u[0].clientId,u[u.length-1].clientId),u.map((e=>e.clientId))},Ao=e=>({select:t,dispatch:n})=>{if(!e)return;const o=t.getBlockRootClientId(e);if(t.getTemplateLock(o))return;const r=t.getBlockIndex(e);return n.insertDefaultBlock({},o,r)},Do=e=>({select:t,dispatch:n})=>{if(!e)return;const o=t.getBlockRootClientId(e);if(t.getTemplateLock(o))return;const r=t.getBlockIndex(e);return n.insertDefaultBlock({},o,r+1)};function Oo(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const zo=e=>async({dispatch:t})=>{t(Oo(e,!0)),await new Promise((e=>setTimeout(e,150))),t(Oo(e,!1))};function Vo(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function Fo(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}function Ho(e){return{type:"SET_TEMPORARILY_EDITING_AS_BLOCKS",temporarilyEditingAsBlocks:e}}const Go="core/block-editor",Uo={reducer:A,selectors:t,actions:l},$o=(0,f.createReduxStore)(Go,{...Uo,persist:["preferences"]}),jo=(0,f.registerStore)(Go,{...Uo,persist:["preferences"]});bn(jo).registerPrivateActions(r),bn(jo).registerPrivateSelectors(e);const Wo={name:"",isSelected:!1},Ko=(0,c.createContext)(Wo),{Provider:qo}=Ko;function Zo(){return(0,c.useContext)(Ko)}function Yo(){const{isSelected:e,clientId:t,name:n}=Zo();return(0,f.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o($o);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function Xo({group:e="default",controls:t,children:n,__experimentalShareWithChildBlocks:o=!1}){const r=function(e,t){const n=Yo(),{clientId:o}=Zo(),r=(0,f.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:r}=e($o),{hasBlockSupport:l}=e(a.store);return t&&l(n(o),"__experimentalExposeControlsToChildren",!1)&&r(o)}),[t,o]);return n?g[e]?.Fill:r?g.parent.Fill:null}(e,o);if(!r)return null;const l=(0,c.createElement)(c.Fragment,null,"default"===e&&(0,c.createElement)(m.ToolbarGroup,{controls:t}),n);return(0,c.createElement)(m.__experimentalStyleProvider,{document:document},(0,c.createElement)(r,null,(e=>{const{forwardedContext:t=[]}=e;return t.reduce(((e,[t,n])=>(0,c.createElement)(t,{...n},e)),l)})))}window.wp.warning;const{ComponentsContext:Qo}=bn(m.privateApis);function Jo({group:e="default",...t}){const n=(0,c.useContext)(m.__experimentalToolbarContext),o=(0,c.useContext)(Qo),r=(0,c.useMemo)((()=>({forwardedContext:[[m.__experimentalToolbarContext.Provider,{value:n}],[Qo.Provider,{value:o}]]})),[n,o]),l=g[e]?.Slot,i=(0,m.__experimentalUseSlotFills)(l?.__unstableName);if(!l)return"undefined"!=typeof process&&process.env,null;if(!i?.length)return null;const a=(0,c.createElement)(l,{...t,bubblesVirtually:!0,fillProps:r});return"default"===e?a:(0,c.createElement)(m.ToolbarGroup,null,a)}const er=Xo;er.Slot=Jo;const tr=e=>(0,c.createElement)(Xo,{group:"inline",...e});tr.Slot=e=>(0,c.createElement)(Jo,{group:"inline",...e});var nr=er;var or=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"}));var rr=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M12.5 15v5H11v-5H4V9h7V4h1.5v5h7v6h-7Z"}));var lr=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"}));var ir=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"}));var ar=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M4 4H5.5V20H4V4ZM7 10L17 10V14L7 14V10ZM20 4H18.5V20H20V4Z"}));var sr=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"}));var cr=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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 ur={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:first-child",rules:{"margin-block-start":"0"}},{selector:" > :last-child:last-child",rules:{"margin-block-end":"0"}},{selector:" > *",rules:{"margin-block-start":null,"margin-block-end":"0"}}]},constrained:{name:"constrained",slug:"constrained",className:"is-layout-constrained",baseStyles:[{selector:" > .alignleft",rules:{float:"left","margin-inline-start":"0","margin-inline-end":"2em"}},{selector:" > .alignright",rules:{float:"right","margin-inline-start":"2em","margin-inline-end":"0"}},{selector:" > .aligncenter",rules:{"margin-left":"auto !important","margin-right":"auto !important"}},{selector:" > :where(:not(.alignleft):not(.alignright):not(.alignfull))",rules:{"max-width":"var(--wp--style--global--content-size)","margin-left":"auto !important","margin-right":"auto !important"}},{selector:" > .alignwide",rules:{"max-width":"var(--wp--style--global--wide-size)"}}],spacingStyles:[{selector:" > :first-child:first-child",rules:{"margin-block-start":"0"}},{selector:" > :last-child: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:" > *",rules:{margin:"0"}}],spacingStyles:[{selector:"",rules:{gap:null}}]},grid:{name:"grid",slug:"grid",className:"is-layout-grid",displayMode:"grid",baseStyles:[{selector:" > *",rules:{margin:"0"}}],spacingStyles:[{selector:"",rules:{gap:null}}]}};function dr(e,t=""){return e.split(",").map((e=>`.editor-styles-wrapper ${e}${t?` ${t}`:""}`)).join(",")}function pr(e,t=ur,n,o){let r="";return t?.[n]?.spacingStyles?.length&&o&&t[n].spacingStyles.forEach((t=>{r+=`${dr(e,t.selector.trim())} { `,r+=Object.entries(t.rules).map((([e,t])=>`${e}: ${t||o}`)).join("; "),r+="; }"})),r}function mr(e){const{contentSize:t,wideSize:n,type:o="default"}=e,r={},l=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;return l.test(t)&&"constrained"===o&&(r.none=(0,v.sprintf)((0,v.__)("Max %s wide"),t)),l.test(n)&&(r.wide=(0,v.sprintf)((0,v.__)("Max %s wide"),n)),r}var fr=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M3.5 17H5V7H3.5v10zM7 20.5h10V19H7v1.5zM19 7v10h1.5V7H19zM7 5h10V3.5H7V5z",style:{fill:"#1e1e1e"}}));var gr=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M8.2 5.3h8V3.8h-8v1.5zm0 14.5h8v-1.5h-8v1.5zm3.5-6.5h1v-1h-1v1zm1-6.5h-1v.5h1v-.5zm-1 4.5h1v-1h-1v1zm0-2h1v-1h-1v1zm0 7.5h1v-.5h-1v.5zm1-2.5h-1v1h1v-1zm-8.5 1.5h1.5v-8H4.2v8zm14.5-8v8h1.5v-8h-1.5zm-5 4.5v-1h-1v1h1zm-6.5 0h.5v-1h-.5v1zm3.5-1v1h1v-1h-1zm6 1h.5v-1h-.5v1zm-8-1v1h1v-1h-1zm6 0v1h1v-1h-1z",style:{fill:"#1e1e1e",fillRule:"evenodd",clipRule:"evenodd"}}));var hr=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M3.5 17H5V7H3.5v10zM19 7v10h1.5V7H19z",style:{fill:"#1e1e1e"}}),(0,c.createElement)(F.Path,{d:"M7 20.5h10V19H7v1.5zm0-17V5h10V3.5H7z",style:{fill:"#1e1e1e",opacity:.1}}));var br=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M3.5 17H5V7H3.5v10zM19 7v10h1.5V7H19z",style:{fill:"#1e1e1e",opacity:.1}}),(0,c.createElement)(F.Path,{d:"M7 20.5h10V19H7v1.5zm0-17V5h10V3.5H7z",style:{fill:"#1e1e1e"}}));var vr=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M3.5 17H5V7H3.5v10zM7 20.5h10V19H7v1.5zM19 7v10h1.5V7H19z",style:{fill:"#1e1e1e",opacity:.1}}),(0,c.createElement)(F.Path,{d:"M7 5h10V3.5H7V5z",style:{fill:"#1e1e1e"}}));var _r=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M20.5 7H19v10h1.5V7z",style:{fill:"#1e1e1e"}}),(0,c.createElement)(F.Path,{d:"M3.5 17H5V7H3.5v10zM7 20.5h10V19H7v1.5zm0-17V5h10V3.5H7z",style:{fill:"#1e1e1e",opacity:.1}}));var kr=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M7 20.5h10V19H7v1.5z",style:{fill:"#1e1e1e"}}),(0,c.createElement)(F.Path,{d:"M3.5 17H5V7H3.5v10zM19 7v10h1.5V7H19zM7 5h10V3.5H7V5z",style:{fill:"#1e1e1e",opacity:.1}}));const yr=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M5 17H3.5V7H5v10z",style:{fill:"#1e1e1e"}}),(0,c.createElement)(F.Path,{d:"M7 20.5h10V19H7v1.5zM19 7v10h1.5V7H19zM7 5h10V3.5H7V5z",style:{fill:"#1e1e1e",opacity:.1}}));const Er=["top","right","bottom","left"],wr={top:void 0,right:void 0,bottom:void 0,left:void 0},Sr={custom:fr,axial:gr,horizontal:hr,vertical:br,top:vr,right:_r,bottom:kr,left:yr},Cr={default:(0,v.__)("Spacing control"),top:(0,v.__)("Top"),bottom:(0,v.__)("Bottom"),left:(0,v.__)("Left"),right:(0,v.__)("Right"),mixed:(0,v.__)("Mixed"),vertical:(0,v.__)("Vertical"),horizontal:(0,v.__)("Horizontal"),axial:(0,v.__)("Horizontal & vertical"),custom:(0,v.__)("Custom")},xr={axial:"axial",top:"top",right:"right",bottom:"bottom",left:"left",custom:"custom"};function Br(e){return!!e?.includes&&("0"===e||e.includes("var:preset|spacing|"))}function Ir(e,t){if(!Br(e))return e;const n=Mr(e),o=t.find((e=>String(e.slug)===n));return o?.size}function Tr(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function Mr(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 Pr(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 Nr(e,t="0"){const n=function(e){if(!e)return null;const t="string"==typeof e;return{top:t?e:e?.top,left:t?e:e?.left}}(e);if(!n)return null;const o=Tr(n?.top)||t,r=Tr(n?.left)||t;return o===r?o:`${o} ${r}`}const Lr=(0,c.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(m.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),Rr=(0,c.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(m.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),Ar=(0,c.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(m.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),Dr=(0,c.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(m.Path,{d:"M4 4L20 4L20 5.5L4 5.5L4 4ZM10 7L14 7L14 17L10 17L10 7ZM20 18.5L4 18.5L4 20L20 20L20 18.5Z"})),Or=(0,c.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(m.Path,{d:"M7 4H17V8L7 8V4ZM7 16L17 16V20L7 20V16ZM20 11.25H4V12.75H20V11.25Z"})),zr={top:{icon:Ar,title:(0,v._x)("Align top","Block vertical alignment setting")},center:{icon:Rr,title:(0,v._x)("Align middle","Block vertical alignment setting")},bottom:{icon:Lr,title:(0,v._x)("Align bottom","Block vertical alignment setting")},stretch:{icon:Dr,title:(0,v._x)("Stretch to fill","Block vertical alignment setting")},"space-between":{icon:Or,title:(0,v._x)("Space between","Block vertical alignment setting")}},Vr=["top","center","bottom"];var Fr=function({value:e,onChange:t,controls:n=Vr,isCollapsed:o=!0,isToolbar:r}){const l=zr[e],i=zr.top,a=r?m.ToolbarGroup:m.ToolbarDropdownMenu,s=r?{isCollapsed:o}:{};return(0,c.createElement)(a,{icon:l?l.icon:i.icon,label:(0,v._x)("Change vertical alignment","Block vertical alignment setting label"),controls:n.map((n=>{return{...zr[n],isActive:e===n,role:o?"menuitemradio":void 0,onClick:(r=n,()=>t(e===r?void 0:r))};var r})),...s})};const Hr=e=>(0,c.createElement)(Fr,{...e,isToolbar:!1}),Gr=e=>(0,c.createElement)(Fr,{...e,isToolbar:!0}),Ur={left:or,center:rr,right:lr,"space-between":ir,stretch:ar};var $r=function({allowedControls:e=["left","center","right","space-between"],isCollapsed:t=!0,onChange:n,value:o,popoverProps:r,isToolbar:l}){const i=e=>{n(e===o?void 0:e)},a=o?Ur[o]:Ur.left,s=[{name:"left",icon:or,title:(0,v.__)("Justify items left"),isActive:"left"===o,onClick:()=>i("left")},{name:"center",icon:rr,title:(0,v.__)("Justify items center"),isActive:"center"===o,onClick:()=>i("center")},{name:"right",icon:lr,title:(0,v.__)("Justify items right"),isActive:"right"===o,onClick:()=>i("right")},{name:"space-between",icon:ir,title:(0,v.__)("Space between items"),isActive:"space-between"===o,onClick:()=>i("space-between")},{name:"stretch",icon:ar,title:(0,v.__)("Stretch items"),isActive:"stretch"===o,onClick:()=>i("stretch")}],u=l?m.ToolbarGroup:m.ToolbarDropdownMenu,d=l?{isCollapsed:t}:{};return(0,c.createElement)(u,{icon:a,popoverProps:r,label:(0,v.__)("Change items justification"),controls:s.filter((t=>e.includes(t.name))),...d})};const jr=e=>(0,c.createElement)($r,{...e,isToolbar:!1}),Wr=e=>(0,c.createElement)($r,{...e,isToolbar:!0});var Kr=window.lodash;const qr=["color","border","dimensions","typography","spacing"],Zr={"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},Yr={"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"},Xr=e=>Yr[e]||e;function Qr(e){const{name:t,clientId:n}=Zo();return(0,f.useSelect)((o=>{if(qr.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let r=(0,s.applyFilters)("blockEditor.useSetting.before",void 0,e,n,t);if(void 0!==r)return r;const l=Xr(e),i=[n,...o($o).getBlockParents(n,!0)];for(const e of i){const n=o($o).getBlockName(e);if((0,a.hasBlockSupport)(n,"__experimentalSettings",!1)){var c;const n=o($o).getBlockAttributes(e);if(r=null!==(c=(0,Kr.get)(n,`settings.blocks.${t}.${l}`))&&void 0!==c?c:(0,Kr.get)(n,`settings.${l}`),void 0!==r)break}}const u=o($o).getSettings();if(void 0===r){var d;const e=`__experimentalFeatures.${l}`,n=`__experimentalFeatures.blocks.${t}.${l}`;r=null!==(d=(0,Kr.get)(u,n))&&void 0!==d?d:(0,Kr.get)(u,e)}var p,m;if(void 0!==r)return a.__EXPERIMENTAL_PATHS_WITH_MERGE[l]?null!==(p=null!==(m=r.custom)&&void 0!==m?m:r.theme)&&void 0!==p?p:r.default:r;const f=Zr[l]?Zr[l](u):void 0;return void 0!==f?f:"typography.dropCap"===l||void 0}),[t,n,e])}const Jr="1600px",el="320px",tl=1,nl=.25,ol=.75,rl="14px";function ll({minimumFontSize:e,maximumFontSize:t,fontSize:n,minimumViewPortWidth:o=el,maximumViewPortWidth:r=Jr,scaleFactor:l=tl,minimumFontSizeLimit:i}){if(i=il(i)?i:rl,n){const o=il(n);if(!o?.unit)return null;const r=il(i,{coerceTo:o.unit});if(r?.value&&!e&&!t&&o?.value<=r?.value)return null;if(t||(t=`${o.value}${o.unit}`),!e){const t="px"===o.unit?o.value:16*o.value,n=Math.min(Math.max(1-.075*Math.log2(t),nl),ol),l=al(o.value*n,3);e=r?.value&&l<r?.value?`${r.value}${r.unit}`:`${l}${o.unit}`}}const a=il(e),s=a?.unit||"rem",c=il(t,{coerceTo:s});if(!a||!c)return null;const u=il(e,{coerceTo:"rem"}),d=il(r,{coerceTo:s}),p=il(o,{coerceTo:s});if(!d||!p||!u)return null;const m=al(p.value/100,3),f=al(m,3)+s,g=al(((c.value-a.value)/(d.value-p.value)*100||1)*l,3);return`clamp(${e}, ${`${u.value}${u.unit} + ((1vw - ${f}) * ${g})`}, ${t})`}function il(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},l=r?.join("|"),i=new RegExp(`^(\\d*\\.?\\d+)(${l}){1,1}$`),a=e.match(i);if(!a||a.length<3)return null;let[,s,c]=a,u=parseFloat(s);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:al(u,3),unit:c}}function al(e,t=3){const n=Math.pow(10,t);return Number.isFinite(e)?parseFloat(Math.round(e*n)/n):void 0}function sl(e,t){const{size:n}=e;if(!cl(t))return n;if(!n||"0"===n||!1===e?.fluid)return n;const o="object"==typeof t?.fluid?t?.fluid:{},r=ll({minimumFontSize:e?.fluid?.min,maximumFontSize:e?.fluid?.max,fontSize:n,minimumFontSizeLimit:o?.minFontSize,maximumViewPortWidth:o?.maxViewPortWidth});return r||n}function cl(e){const t=e?.fluid;return!0===t||t&&"object"==typeof t&&Object.keys(t).length>0}function ul(e){const t=e?.typography,n=e?.layout;return cl(t)&&n?.wideSize?{fluid:{maxViewPortWidth:n.wideSize,...t.fluid}}:{fluid:t?.fluid}}const dl="body",pl=[{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)=>sl(e,ul(t)),valueKey:"size",cssVarInfix:"font-size",classes:[{classSuffix:"font-size",propertyName:"font-size"}]},{path:["typography","fontFamilies"],valueKey:"fontFamily",cssVarInfix:"font-family",classes:[{classSuffix:"font-family",propertyName:"font-family"}]},{path:["spacing","spacingSizes"],valueKey:"size",cssVarInfix:"spacing",valueFunc:({size:e})=>e,classes:[]}],ml={"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 fl(e,t,n,o,r){const l=[(0,Kr.get)(e,["blocks",t,...n]),(0,Kr.get)(e,n)];for(const i of l)if(i){const l=["custom","theme","default"];for(const a of l){const l=i[a];if(l){const i=l.find((e=>e[o]===r));if(i){if("slug"===o)return i;return fl(e,t,n,"slug",i.slug)[o]===i[o]?i:void 0}}}}}function gl(e,t,n){if(!n||"string"!=typeof n){if(!n?.ref||"string"!=typeof n?.ref)return n;{const t=n.ref.split(".");if(!(n=(0,Kr.get)(e,t))||n?.ref)return n}}const o="var:",r="var(--wp--";let l;if(n.startsWith(o))l=n.slice(4).split("|");else{if(!n.startsWith(r)||!n.endsWith(")"))return n;l=n.slice(10,-1).split("--")}const[i,...a]=l;return"preset"===i?function(e,t,n,[o,r]){const l=pl.find((e=>e.cssVarInfix===o));if(!l)return n;const i=fl(e.settings,t,l.path,"slug",r);if(i){const{valueKey:n}=l;return gl(e,t,i[n])}return n}(e,t,n,a):"custom"===i?function(e,t,n,o){var r;const l=null!==(r=(0,Kr.get)(e.settings,["blocks",t,"custom",...o]))&&void 0!==r?r:(0,Kr.get)(e.settings,["custom",...o]);return l?gl(e,t,l):n}(e,t,n,a):n}function hl(e,t){const n=e.split(","),o=t.split(","),r=[];return n.forEach((e=>{o.forEach((t=>{r.push(`${e.trim()} ${t.trim()}`)}))})),r.join(", ")}function bl(e,t){return"object"!=typeof e||"object"!=typeof t?e===t:b()(e?.styles,t?.styles)&&b()(e?.settings,t?.settings)}const vl=(0,c.createContext)({user:{},base:{},merged:{},setUserConfig:()=>{}}),_l={settings:{},styles:{}},kl=["appearanceTools","useRootPaddingAwareAlignments","border.color","border.radius","border.style","border.width","shadow.presets","shadow.defaultPresets","color.background","color.button","color.caption","color.custom","color.customDuotone","color.customGradient","color.defaultDuotone","color.defaultGradients","color.defaultPalette","color.duotone","color.gradients","color.heading","color.link","color.palette","color.text","custom","dimensions.minHeight","layout.contentSize","layout.definitions","layout.wideSize","position.fixed","position.sticky","spacing.customSpacingSize","spacing.spacingSizes","spacing.spacingScale","spacing.blockGap","spacing.margin","spacing.padding","spacing.units","typography.fluid","typography.customFontSize","typography.dropCap","typography.fontFamilies","typography.fontSizes","typography.fontStyle","typography.fontWeight","typography.letterSpacing","typography.lineHeight","typography.textColumns","typography.textDecoration","typography.textTransform"],yl=()=>{const{user:e,setUserConfig:t}=(0,c.useContext)(vl);return[!!e&&!b()(e,_l),(0,c.useCallback)((()=>t((()=>_l))),[t])]};function El(e,t,n="all"){const{setUserConfig:o,...r}=(0,c.useContext)(vl),l=t?".blocks."+t:"",i=e?"."+e:"",a=`settings${l}${i}`,s=`settings${i}`,u="all"===n?"merged":n;return[(0,c.useMemo)((()=>{const t=r[u];if(!t)throw"Unsupported source";var n;if(e)return null!==(n=(0,Kr.get)(t,a))&&void 0!==n?n:(0,Kr.get)(t,s);const o={};return kl.forEach((e=>{var n;const r=null!==(n=(0,Kr.get)(t,`settings${l}.${e}`))&&void 0!==n?n:(0,Kr.get)(t,`settings.${e}`);r&&(0,Kr.set)(o,e,r)})),o}),[r,u,e,a,s,l]),e=>{o((t=>{const n=JSON.parse(JSON.stringify(t));return(0,Kr.set)(n,a,e),n}))}]}function wl(e,t,n="all",{shouldDecodeEncode:o=!0}={}){const{merged:r,base:l,user:i,setUserConfig:a}=(0,c.useContext)(vl),s=e?"."+e:"",u=t?`styles.blocks.${t}${s}`:`styles${s}`;let d,p;switch(n){case"all":d=(0,Kr.get)(r,u),p=o?gl(r,t,d):d;break;case"user":d=(0,Kr.get)(i,u),p=o?gl(r,t,d):d;break;case"base":d=(0,Kr.get)(l,u),p=o?gl(l,t,d):d;break;default:throw"Unsupported source"}return[p,n=>{a((l=>{const i=JSON.parse(JSON.stringify(l));return(0,Kr.set)(i,u,o?function(e,t,n,o){if(!o)return o;const r=ml[n],l=pl.find((e=>e.cssVarInfix===r));if(!l)return o;const{valueKey:i,path:a}=l,s=fl(e,t,a,i,o);return s?`var:preset|${r}|${s.slug}`:o}(r.settings,t,e,n):n),i}))}]}function Sl(e,t,n){const{supportedStyles:o,supports:r}=(0,f.useSelect)((e=>({supportedStyles:bn(e(a.store)).getSupportedStyles(t,n),supports:e(a.store).getBlockType(t)?.supports})),[t,n]);return(0,c.useMemo)((()=>{const t={...e};return o.includes("fontSize")||(t.typography={...t.typography,fontSizes:{},customFontSize:!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","textTransform","textDecoration"].forEach((e=>{o.includes(e)||(t.typography={...t.typography,[e]:!1})})),o.includes("columnCount")||(t.typography={...t.typography,textColumns:!1}),["contentSize","wideSize"].forEach((e=>{o.includes(e)||(t.layout={...t.layout,[e]:!1})})),["padding","margin","blockGap"].forEach((e=>{o.includes(e)||(t.spacing={...t.spacing,[e]:!1});const n=Array.isArray(r?.spacing?.[e])?r?.spacing?.[e]:r?.spacing?.[e]?.sides;n?.length&&(t.spacing={...t.spacing,[e]:{...t.spacing?.[e],sides:n}})})),o.includes("minHeight")||(t.dimensions={...t.dimensions,minHeight:!1}),["radius","color","style","width"].forEach((e=>{o.includes("border"+e.charAt(0).toUpperCase()+e.slice(1))||(t.border={...t.border,[e]:!1})})),t.shadow=!!o.includes("shadow")&&t.shadow,t}),[e,o,r])}function Cl(e){const t=e?.color?.palette?.custom,n=e?.color?.palette?.theme,o=e?.color?.palette?.default,r=e?.color?.defaultPalette;return(0,c.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,v._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,v._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,v._x)("Custom","Indicates this palette is created by the user."),colors:t}),e}),[t,n,o,r])}function xl(e){const t=e?.color?.gradients?.custom,n=e?.color?.gradients?.theme,o=e?.color?.gradients?.default,r=e?.color?.defaultGradients;return(0,c.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,v._x)("Theme","Indicates this palette comes from the theme."),gradients:n}),r&&o&&o.length&&e.push({name:(0,v._x)("Default","Indicates this palette comes from WordPress."),gradients:o}),t&&t.length&&e.push({name:(0,v._x)("Custom","Indicates this palette is created by the user."),gradients:t}),e}),[t,n,o,r])}var Bl=function(){return Bl=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},Bl.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;function Il(e){return e.toLowerCase()}var Tl=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],Ml=/[^A-Z0-9]+/gi;function Pl(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,o=void 0===n?Tl:n,r=t.stripRegexp,l=void 0===r?Ml:r,i=t.transform,a=void 0===i?Il:i,s=t.delimiter,c=void 0===s?" ":s,u=Nl(Nl(e,o,"$1\0$2"),l,"\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(a).join(c)}function Nl(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}function Ll(e,t){return void 0===t&&(t={}),function(e,t){return void 0===t&&(t={}),Pl(e,Bl({delimiter:"."},t))}(e,Bl({delimiter:"-"},t))}function Rl(e){let t=e;var n;"string"!=typeof e&&(t=null!==(n=e?.toString?.())&&void 0!==n?n:"");return t=t.replace(/['\u2019]/,""),Ll(t,{splitRegexp:[/(?!(?:1ST|2ND|3RD|[4-9]TH)(?![a-z]))([a-z0-9])([A-Z])/g,/(?!(?:1st|2nd|3rd|[4-9]th)(?![a-z]))([0-9])([a-z])/g,/([A-Za-z])([0-9])/g,/([A-Z])([A-Z][a-z])/g]})}function Al(e){return e&&"object"==typeof e?{...Object.fromEntries(Object.entries(e).map((([e,t])=>[e,Al(t)])))}:e}function Dl(e,t,n){const o=function(e){return Array.isArray(e)?e:"number"==typeof e?[e.toString()]:[e]}(t),r=e?Al(e):{};return o.reduce(((e,t,r)=>(void 0===e[t]&&(e[t]={}),r===o.length-1&&(e[t]=n),e[t])),r),r}const Ol=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=Object.entries(e).map((([e,t])=>[e,Ol(t)])).filter((([,e])=>void 0!==e));return t.length?Object.fromEntries(t):void 0};function zl(e,t,n,o,r,l){if(Object.values(null!=e?e:{}).every((e=>!e)))return n;if(1===l.length&&n.innerBlocks.length===o.length)return n;let i=o[0]?.attributes;if(l.length>1&&o.length>1){if(!o[r])return n;i=o[r]?.attributes}let a=n;return Object.entries(e).forEach((([e,n])=>{n&&t[e].forEach((e=>{const t=(0,Kr.get)(i,e);t&&(a={...a,attributes:Dl(a.attributes,e,t)})}))})),a}function Vl(e,t,n){const o=(0,a.getBlockSupport)(e,t),r=o?.__experimentalSkipSerialization;return Array.isArray(r)?r.includes(n):r}function Fl(e,t){const n=Qr("typography.fontFamilies"),o=Qr("typography.fontSizes"),r=Qr("typography.customFontSize"),l=Qr("typography.fontStyle"),i=Qr("typography.fontWeight"),a=Qr("typography.lineHeight"),s=Qr("typography.textColumns"),u=Qr("typography.textDecoration"),d=Qr("typography.textTransform"),p=Qr("typography.letterSpacing"),m=Qr("spacing.padding"),f=Qr("spacing.margin"),g=Qr("spacing.blockGap"),h=Qr("spacing.spacingSizes"),b=Qr("spacing.units"),v=Qr("dimensions.minHeight"),_=Qr("layout"),k=Qr("border.color"),y=Qr("border.radius"),E=Qr("border.style"),w=Qr("border.width"),S=Qr("color.custom"),C=Qr("color.palette.custom"),x=Qr("color.customDuotone"),B=Qr("color.palette.theme"),I=Qr("color.palette.default"),T=Qr("color.defaultPalette"),M=Qr("color.defaultDuotone"),P=Qr("color.duotone.custom"),N=Qr("color.duotone.theme"),L=Qr("color.duotone.default"),R=Qr("color.gradients.custom"),A=Qr("color.gradients.theme"),D=Qr("color.gradients.default"),O=Qr("color.defaultGradients"),z=Qr("color.customGradient"),V=Qr("color.background"),F=Qr("color.link"),H=Qr("color.text");return Sl((0,c.useMemo)((()=>({color:{palette:{custom:C,theme:B,default:I},gradients:{custom:R,theme:A,default:D},duotone:{custom:P,theme:N,default:L},defaultGradients:O,defaultPalette:T,defaultDuotone:M,custom:S,customGradient:z,customDuotone:x,background:V,link:F,text:H},typography:{fontFamilies:{custom:n},fontSizes:{custom:o},customFontSize:r,fontStyle:l,fontWeight:i,lineHeight:a,textColumns:s,textDecoration:u,textTransform:d,letterSpacing:p},spacing:{spacingSizes:{custom:h},padding:m,margin:f,blockGap:g,units:b},border:{color:k,radius:y,style:E,width:w},dimensions:{minHeight:v},layout:_,parentLayout:t})),[n,o,r,l,i,a,s,u,d,p,m,f,g,h,b,v,_,t,k,y,E,w,S,C,x,B,I,T,M,P,N,L,R,A,D,O,z,V,F,H]),e)}const Hl={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},Gl={left:"flex-start",right:"flex-end",center:"center",stretch:"stretch"},Ul={top:"flex-start",center:"center",bottom:"flex-end",stretch:"stretch","space-between":"space-between"},$l=["wrap","nowrap"];var jl={name:"flex",label:(0,v.__)("Flex"),inspectorControls:function({layout:e={},onChange:t,layoutBlockSupport:n={}}){const{allowOrientation:o=!0}=n;return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.Flex,null,(0,c.createElement)(m.FlexItem,null,(0,c.createElement)(ql,{layout:e,onChange:t})),(0,c.createElement)(m.FlexItem,null,o&&(0,c.createElement)(Yl,{layout:e,onChange:t}))),(0,c.createElement)(Zl,{layout:e,onChange:t}))},toolBarControls:function({layout:e={},onChange:t,layoutBlockSupport:n}){if(n?.allowSwitching)return null;const{allowVerticalAlignment:o=!0}=n;return(0,c.createElement)(nr,{group:"block",__experimentalShareWithChildBlocks:!0},(0,c.createElement)(ql,{layout:e,onChange:t,isToolbar:!0}),o&&(0,c.createElement)(Wl,{layout:e,onChange:t,isToolbar:!0}))},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:o,hasBlockGapSupport:r,layoutDefinitions:l=ur}){const{orientation:i="horizontal"}=t,a=n?.spacing?.blockGap&&!Vl(o,"spacing","blockGap")?Nr(n?.spacing?.blockGap,"0.5em"):void 0,s=Hl[t.justifyContent],c=$l.includes(t.flexWrap)?t.flexWrap:"wrap",u=Ul[t.verticalAlignment],d=Gl[t.justifyContent]||Gl.left;let p="";const m=[];return c&&"wrap"!==c&&m.push(`flex-wrap: ${c}`),"horizontal"===i?(u&&m.push(`align-items: ${u}`),s&&m.push(`justify-content: ${s}`)):(u&&m.push(`justify-content: ${u}`),m.push("flex-direction: column"),m.push(`align-items: ${d}`)),m.length&&(p=`${dr(e)} {\n\t\t\t\t${m.join("; ")};\n\t\t\t}`),r&&a&&(p+=pr(e,l,"flex",a)),p},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments(){return[]}};function Wl({layout:e,onChange:t,isToolbar:n=!1}){const{orientation:o="horizontal"}=e,r="horizontal"===o?Ul.center:Ul.top,{verticalAlignment:l=r}=e,i=n=>{t({...e,verticalAlignment:n})};if(n)return(0,c.createElement)(Hr,{onChange:i,value:l,controls:"horizontal"===o?["top","center","bottom","stretch"]:["top","center","bottom","space-between"]});const a=[{value:"flex-start",label:(0,v.__)("Align items top")},{value:"center",label:(0,v.__)("Align items center")},{value:"flex-end",label:(0,v.__)("Align items bottom")}];return(0,c.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,c.createElement)("legend",null,(0,v.__)("Vertical alignment")),(0,c.createElement)("div",null,a.map(((e,t,n)=>(0,c.createElement)(m.Button,{key:e,label:n,icon:t,isPressed:l===e,onClick:()=>i(e)})))))}const Kl={placement:"bottom-start"};function ql({layout:e,onChange:t,isToolbar:n=!1}){const{justifyContent:o="left",orientation:r="horizontal"}=e,l=n=>{t({...e,justifyContent:n})},i=["left","center","right"];if("horizontal"===r?i.push("space-between"):i.push("stretch"),n)return(0,c.createElement)(jr,{allowedControls:i,value:o,onChange:l,popoverProps:Kl});const a=[{value:"left",icon:or,label:(0,v.__)("Justify items left")},{value:"center",icon:rr,label:(0,v.__)("Justify items center")},{value:"right",icon:lr,label:(0,v.__)("Justify items right")}];return"horizontal"===r?a.push({value:"space-between",icon:ir,label:(0,v.__)("Space between items")}):a.push({value:"stretch",icon:ar,label:(0,v.__)("Stretch items")}),(0,c.createElement)(m.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,v.__)("Justification"),value:o,onChange:l,className:"block-editor-hooks__flex-layout-justification-controls"},a.map((({value:e,icon:t,label:n})=>(0,c.createElement)(m.__experimentalToggleGroupControlOptionIcon,{key:e,value:e,icon:t,label:n}))))}function Zl({layout:e,onChange:t}){const{flexWrap:n="wrap"}=e;return(0,c.createElement)(m.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,v.__)("Allow to wrap to multiple lines"),onChange:n=>{t({...e,flexWrap:n?"wrap":"nowrap"})},checked:"wrap"===n})}function Yl({layout:e,onChange:t}){const{orientation:n="horizontal",verticalAlignment:o,justifyContent:r}=e;return(0,c.createElement)(m.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,className:"block-editor-hooks__flex-layout-orientation-controls",label:(0,v.__)("Orientation"),value:n,onChange:n=>{let l=o,i=r;return"horizontal"===n?("space-between"===o&&(l="center"),"stretch"===r&&(i="left")):("stretch"===o&&(l="top"),"space-between"===r&&(i="left")),t({...e,orientation:n,verticalAlignment:l,justifyContent:i})}},(0,c.createElement)(m.__experimentalToggleGroupControlOptionIcon,{icon:sr,value:"horizontal",label:(0,v.__)("Horizontal")}),(0,c.createElement)(m.__experimentalToggleGroupControlOptionIcon,{icon:cr,value:"vertical",label:(0,v.__)("Vertical")}))}var Xl={name:"default",label:(0,v.__)("Flow"),inspectorControls:function(){return null},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,style:t,blockName:n,hasBlockGapSupport:o,layoutDefinitions:r=ur}){const l=Nr(t?.spacing?.blockGap);let i="";Vl(n,"spacing","blockGap")||(l?.top?i=Nr(l?.top):"string"==typeof l&&(i=Nr(l)));let a="";return o&&i&&(a+=pr(e,r,"default",i)),a},getOrientation(){return"vertical"},getAlignments(e,t){const n=mr(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}};var Ql=function({icon:e,size:t=24,...n}){return(0,c.cloneElement)(e,{width:t,height:t,...n})};var Jl=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM7 9h10v6H7V9Z"}));var ei=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M16 5.5H8V4h8v1.5ZM16 20H8v-1.5h8V20ZM5 9h14v6H5V9Z"})),ti=window.wp.styleEngine,ni={name:"constrained",label:(0,v.__)("Constrained"),inspectorControls:function({layout:e,onChange:t,layoutBlockSupport:n={}}){const{wideSize:o,contentSize:r,justifyContent:l="center"}=e,{allowJustification:i=!0}=n,a=[{value:"left",icon:or,label:(0,v.__)("Justify items left")},{value:"center",icon:rr,label:(0,v.__)("Justify items center")},{value:"right",icon:lr,label:(0,v.__)("Justify items right")}],s=(0,m.__experimentalUseCustomUnits)({availableUnits:Qr("spacing.units")||["%","px","em","rem","vw"]});return(0,c.createElement)(c.Fragment,null,(0,c.createElement)("div",{className:"block-editor-hooks__layout-controls"},(0,c.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,c.createElement)(m.__experimentalUnitControl,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,v.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,contentSize:n})},units:s}),(0,c.createElement)(Ql,{icon:Jl})),(0,c.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,c.createElement)(m.__experimentalUnitControl,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,v.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,wideSize:n})},units:s}),(0,c.createElement)(Ql,{icon:ei}))),(0,c.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,v.__)("Customize the width for all elements that are assigned to the center or wide columns.")),i&&(0,c.createElement)(m.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,v.__)("Justification"),value:l,onChange:n=>{t({...e,justifyContent:n})}},a.map((({value:e,icon:t,label:n})=>(0,c.createElement)(m.__experimentalToggleGroupControlOptionIcon,{key:e,value:e,icon:t,label:n})))))},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,layout:t={},style:n,blockName:o,hasBlockGapSupport:r,layoutDefinitions:l=ur}){const{contentSize:i,wideSize:a,justifyContent:s}=t,c=Nr(n?.spacing?.blockGap);let u="";Vl(o,"spacing","blockGap")||(c?.top?u=Nr(c?.top):"string"==typeof c&&(u=Nr(c)));const d="left"===s?"0 !important":"auto !important",p="right"===s?"0 !important":"auto !important";let m=i||a?`\n\t\t\t\t\t${dr(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} {\n\t\t\t\t\t\tmax-width: ${null!=i?i:a};\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${dr(e,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=a?a:i};\n\t\t\t\t\t}\n\t\t\t\t\t${dr(e,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";if("left"===s?m+=`${dr(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-left: ${d}; }`:"right"===s&&(m+=`${dr(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-right: ${p}; }`),n?.spacing?.padding){(0,ti.getCSSRules)(n).forEach((t=>{"paddingRight"===t.key?m+=`\n\t\t\t\t\t${dr(e,"> .alignfull")} {\n\t\t\t\t\t\tmargin-right: calc(${t.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`:"paddingLeft"===t.key&&(m+=`\n\t\t\t\t\t${dr(e,"> .alignfull")} {\n\t\t\t\t\t\tmargin-left: calc(${t.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`)}))}return r&&u&&(m+=pr(e,l,"constrained",u)),m},getOrientation(){return"vertical"},getAlignments(e){const t=mr(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 oi={px:600,"%":100,vw:100,vh:100,em:38,rem:38};var ri={name:"grid",label:(0,v.__)("Grid"),inspectorControls:function({layout:e={},onChange:t}){return e?.columnCount?(0,c.createElement)(ii,{layout:e,onChange:t}):(0,c.createElement)(li,{layout:e,onChange:t})},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:o,hasBlockGapSupport:r,layoutDefinitions:l=ur}){const{minimumColumnWidth:i="12rem",columnCount:a=null}=t,s=n?.spacing?.blockGap&&!Vl(o,"spacing","blockGap")?Nr(n?.spacing?.blockGap,"0.5em"):void 0;let c="";const u=[];return a?u.push(`grid-template-columns: repeat(${a}, minmax(0, 1fr))`):i&&u.push(`grid-template-columns: repeat(auto-fill, minmax(min(${i}, 100%), 1fr))`),u.length&&(c=`${dr(e)} { ${u.join("; ")}; }`),r&&s&&(c+=pr(e,l,"grid",s)),c},getOrientation(){return"horizontal"},getAlignments(){return[]}};function li({layout:e,onChange:t}){const{minimumColumnWidth:n="12rem"}=e,[o,r]=(0,m.__experimentalParseQuantityAndUnitFromRawValue)(n);return(0,c.createElement)("fieldset",null,(0,c.createElement)(m.BaseControl.VisualLabel,{as:"legend"},(0,v.__)("Minimum column width")),(0,c.createElement)(m.Flex,{gap:4},(0,c.createElement)(m.FlexItem,{isBlock:!0},(0,c.createElement)(m.__experimentalUnitControl,{size:"__unstable-large",onChange:n=>{t({...e,minimumColumnWidth:n})},onUnitChange:n=>{let l;["em","rem"].includes(n)&&"px"===r?l=(o/16).toFixed(2)+n:["em","rem"].includes(r)&&"px"===n?l=Math.round(16*o)+n:["vh","vw","%"].includes(n)&&o>100&&(l=100+n),t({...e,minimumColumnWidth:l})},value:n,min:0})),(0,c.createElement)(m.FlexItem,{isBlock:!0},(0,c.createElement)(m.RangeControl,{onChange:n=>{t({...e,minimumColumnWidth:[n,r].join("")})},value:o,min:0,max:oi[r]||600,withInputField:!1}))))}function ii({layout:e,onChange:t}){const{columnCount:n=3}=e;return(0,c.createElement)(m.RangeControl,{label:(0,v.__)("Columns"),value:n,onChange:n=>t({...e,columnCount:n}),min:1,max:6})}const ai=[Xl,jl,ni,ri];function si(e="default"){return ai.find((t=>t.name===e))}const ci={type:"default"},ui=(0,c.createContext)(ci),di=ui.Provider;function pi(){return(0,c.useContext)(ui)}function mi({layout:e={},css:t,...n}){const o=si(e.type),r=null!==Qr("spacing.blockGap");if(o){if(t)return(0,c.createElement)("style",null,t);const l=o.getLayoutStyle?.({hasBlockGapSupport:r,layout:e,...n});if(l)return(0,c.createElement)("style",null,l)}return null}const fi=[],gi=["none","left","center","right","wide","full"],hi=["wide","full"];function bi(e=gi){e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n,isBlockBasedTheme:o}=(0,f.useSelect)((e=>{const{getSettings:t}=e($o),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout,isBlockBasedTheme:n.__unstableIsBlockBasedTheme}}),[]),r=pi(),l=si(r?.type),i=l.getAlignments(r,o);if(n){const t=i.filter((({name:t})=>e.includes(t)));return 1===t.length&&"none"===t[0].name?fi:t}if("default"!==l.name&&"constrained"!==l.name)return fi;const{alignments:a=gi}=r,s=e.filter((e=>(r.alignments||t||!hi.includes(e))&&a.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?fi:s}var vi=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM5 9h14v6H5V9Z"}));var _i=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M5 5.5h8V4H5v1.5ZM5 20h8v-1.5H5V20ZM19 9H5v6h14V9Z"}));var ki=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M19 5.5h-8V4h8v1.5ZM19 20h-8v-1.5h8V20ZM5 9h14v6H5V9Z"}));var yi=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M5 4h14v11H5V4Zm11 16H8v-1.5h8V20Z"}));const Ei={none:{icon:vi,title:(0,v._x)("None","Alignment option")},left:{icon:_i,title:(0,v.__)("Align left")},center:{icon:Jl,title:(0,v.__)("Align center")},right:{icon:ki,title:(0,v.__)("Align right")},wide:{icon:ei,title:(0,v.__)("Wide width")},full:{icon:yi,title:(0,v.__)("Full width")}};var wi=function({value:e,onChange:t,controls:n,isToolbar:o,isCollapsed:r=!0}){const l=bi(n);if(!!!l.length)return null;function i(n){t([e,"none"].includes(n)?void 0:n)}const a=Ei[e],s=Ei.none,u=o?m.ToolbarGroup:m.ToolbarDropdownMenu,p={icon:a?a.icon:s.icon,label:(0,v.__)("Align")},f=o?{isCollapsed:r,controls:l.map((({name:t})=>({...Ei[t],isActive:e===t||!e&&"none"===t,role:r?"menuitemradio":void 0,onClick:()=>i(t)})))}:{toggleProps:{describedBy:(0,v.__)("Change alignment")},children:({onClose:t})=>(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},l.map((({name:n,info:o})=>{const{icon:r,title:l}=Ei[n],a=n===e||!e&&"none"===n;return(0,c.createElement)(m.MenuItem,{key:n,icon:r,iconPosition:"left",className:d()("components-dropdown-menu__menu-item",{"is-active":a}),isSelected:a,onClick:()=>{i(n),t()},role:"menuitemradio",info:o},l)}))))};return(0,c.createElement)(u,{...p,...f})};const Si=e=>(0,c.createElement)(wi,{...e,isToolbar:!1}),Ci=e=>(0,c.createElement)(wi,{...e,isToolbar:!0}),xi=(0,c.createContext)(null);function Bi(e){var t;const{clientId:n=""}=null!==(t=(0,c.useContext)(xi))&&void 0!==t?t:{},o=(0,f.useSelect)((e=>bn(e($o)).getBlockEditingMode(n)),[n]),{setBlockEditingMode:r,unsetBlockEditingMode:l}=bn((0,f.useDispatch)($o));return(0,c.useEffect)((()=>(e&&r(n,e),()=>{e&&l(n)})),[n,e]),o}const Ii=["left","center","right","wide","full"],Ti=["wide","full"];function Mi(e,t=!0,n=!0){let o;return o=Array.isArray(e)?Ii.filter((t=>e.includes(t))):!0===e?[...Ii]:[],!n||!0===e&&!t?o.filter((e=>!Ti.includes(e))):o}const Pi=(0,p.createHigherOrderComponent)((e=>t=>{const n=(0,c.createElement)(e,{key:"edit",...t}),{name:o}=t,r=bi(Mi((0,a.getBlockSupport)(o,"align"),(0,a.hasBlockSupport)(o,"alignWide",!0))).map((({name:e})=>e)),l=Bi();if(!r.length||"default"!==l)return n;return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(nr,{group:"block",__experimentalShareWithChildBlocks:!0},(0,c.createElement)(Si,{value:t.attributes.align,onChange:e=>{if(!e){const n=(0,a.getBlockType)(t.name),o=n?.attributes?.align?.default;o&&(e="")}t.setAttributes({align:e})},controls:r})),n)}),"withToolbarControls"),Ni=(0,p.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:r}=o,l=bi(Mi((0,a.getBlockSupport)(n,"align"),(0,a.hasBlockSupport)(n,"alignWide",!0)));if(void 0===r)return(0,c.createElement)(e,{...t});let i=t.wrapperProps;return l.some((e=>e.name===r))&&(i={...i,"data-align":r}),(0,c.createElement)(e,{...t,wrapperProps:i})}),"withDataAlign");(0,s.addFilter)("blocks.registerBlockType","core/align/addAttribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.align)&&void 0!==t?t:{})||(0,a.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...Ii,""]}}),e})),(0,s.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",Ni),(0,s.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",Pi),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return Mi((0,a.getBlockSupport)(t,"align"),(0,a.hasBlockSupport)(t,"alignWide",!0)).includes(o)&&(e.className=d()(`align${o}`,e.className)),e})),(0,s.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.lock)&&void 0!==t?t:{})||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));const Li=(0,m.createSlotFill)("InspectorControls"),Ri=(0,m.createSlotFill)("InspectorAdvancedControls"),Ai=(0,m.createSlotFill)("InspectorControlsBorder"),Di=(0,m.createSlotFill)("InspectorControlsColor"),Oi=(0,m.createSlotFill)("InspectorControlsFilter"),zi=(0,m.createSlotFill)("InspectorControlsDimensions"),Vi=(0,m.createSlotFill)("InspectorControlsPosition"),Fi=(0,m.createSlotFill)("InspectorControlsTypography");var Hi={default:Li,advanced:Ri,border:Ai,color:Di,filter:Oi,dimensions:zi,list:(0,m.createSlotFill)("InspectorControlsListView"),settings:Li,styles:(0,m.createSlotFill)("InspectorControlsStyles"),typography:Fi,position:Vi};function Gi({children:e,group:t="default",__experimentalGroup:n,resetAllFilter:o}){n&&($()("`__experimentalGroup` property in `InspectorControlsFill`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=n);const r=Yo(),l=Hi[t]?.Fill;return l?r?(0,c.createElement)(m.__experimentalStyleProvider,{document:document},(0,c.createElement)(l,null,(t=>(0,c.createElement)(Ui,{fillProps:t,children:e,resetAllFilter:o})))):null:("undefined"!=typeof process&&process.env,null)}function Ui({children:e,resetAllFilter:t,fillProps:n}){const{registerResetAllFilter:o,deregisterResetAllFilter:r}=n;(0,c.useEffect)((()=>(t&&o&&o(t),()=>{t&&r&&r(t)})),[t,o,r]);const l=n&&Object.keys(n).length>0?n:null;return(0,c.createElement)(m.__experimentalToolsPanelContext.Provider,{value:l},e)}function $i({children:e,group:t,label:n}){const{updateBlockAttributes:o}=(0,f.useDispatch)($o),{getBlockAttributes:r,getMultiSelectedBlockClientIds:l,getSelectedBlockClientId:i,hasMultiSelection:a}=(0,f.useSelect)($o),s=i(),u=(0,c.useCallback)(((e=[])=>{const t={},n=a()?l():[s];n.forEach((n=>{const{style:o}=r(n);let l={style:o};e.forEach((e=>{l={...l,...e(l)}})),l={...l,style:Ol(l.style)},t[n]=l})),o(n,t,!0)}),[r,l,a,s,o]);return(0,c.createElement)(m.__experimentalToolsPanel,{className:`${t}-block-support-panel`,label:n,resetAll:u,key:s,panelId:s,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},e)}function ji({Slot:e,...t}){const n=(0,c.useContext)(m.__experimentalToolsPanelContext);return(0,c.createElement)(e,{...t,fillProps:n,bubblesVirtually:!0})}function Wi({__experimentalGroup:e,group:t="default",label:n,...o}){e&&($()("`__experimentalGroup` property in `InspectorControlsSlot`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=e);const r=Hi[t]?.Slot,l=(0,m.__experimentalUseSlotFills)(r?.__unstableName);return r?l?.length?n?(0,c.createElement)($i,{group:t,label:n},(0,c.createElement)(ji,{...o,Slot:r})):(0,c.createElement)(r,{...o,bubblesVirtually:!0}):null:("undefined"!=typeof process&&process.env,null)}const Ki=Gi;Ki.Slot=Wi;const qi=e=>(0,c.createElement)(Gi,{...e,group:"advanced"});qi.Slot=e=>(0,c.createElement)(Wi,{...e,group:"advanced"}),qi.slotName="InspectorAdvancedControls";var Zi=Ki;const Yi=/[\s#]/g,Xi={type:"string",source:"attribute",attribute:"id",selector:"*"};const Qi=(0,p.createHigherOrderComponent)((e=>t=>{const n=(0,a.hasBlockSupport)(t.name,"anchor"),o=Bi();if(n&&t.isSelected){const n="web"===c.Platform.OS,r=(0,c.createElement)(m.TextControl,{__nextHasNoMarginBottom:!0,className:"html-anchor-control",label:(0,v.__)("HTML anchor"),help:(0,c.createElement)(c.Fragment,null,(0,v.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, youll be able to link directly to this section of your page."),n&&(0,c.createElement)(m.ExternalLink,{href:(0,v.__)("https://wordpress.org/documentation/article/page-jumps/")},(0,v.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,v.__)("Add an anchor"),onChange:e=>{e=e.replace(Yi,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(e,{...t}),n&&"default"===o&&(0,c.createElement)(Zi,{group:"advanced"},r),!n&&"core/heading"===t.name&&(0,c.createElement)(Zi,null,(0,c.createElement)(m.PanelBody,{title:(0,v.__)("Heading settings")},r)))}return(0,c.createElement)(e,{...t})}),"withInspectorControl");(0,s.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.anchor)&&void 0!==t?t:{})||(0,a.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:Xi}),e})),(0,s.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",Qi),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return(0,a.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const Ji={type:"string",source:"attribute",attribute:"aria-label",selector:"*"};(0,s.addFilter)("blocks.registerBlockType","core/ariaLabel/attribute",(function(e){return e?.attributes?.ariaLabel?.type||(0,a.hasBlockSupport)(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:Ji}),e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/ariaLabel/save-props",(function(e,t,n){return(0,a.hasBlockSupport)(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e}));const ea=(0,p.createHigherOrderComponent)((e=>t=>{const n=Bi();return(0,a.hasBlockSupport)(t.name,"customClassName",!0)&&t.isSelected?(0,c.createElement)(c.Fragment,null,(0,c.createElement)(e,{...t}),"default"===n&&(0,c.createElement)(Zi,{group:"advanced"},(0,c.createElement)(m.TextControl,{__nextHasNoMarginBottom:!0,autoComplete:"off",label:(0,v.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,v.__)("Separate multiple classes with spaces.")}))):(0,c.createElement)(e,{...t})}),"withInspectorControl");(0,s.addFilter)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return(0,a.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,s.addFilter)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",ea),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return(0,a.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=d()(e.className,n.className)),e})),(0,s.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){if(!(0,a.hasBlockSupport)(e.name,"customClassName",!0))return e;if(1===o.length&&e.innerBlocks.length===t.length)return e;if(1===o.length&&t.length>1||o.length>1&&1===t.length)return e;if(t[n]){const o=t[n]?.attributes.className;if(o)return{...e,attributes:{...e.attributes,className:o}}}return e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return(0,a.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=[...new Set([(0,a.getBlockDefaultClassName)(t.name),...e.className.split(" ")])].join(" ").trim():e.className=(0,a.getBlockDefaultClassName)(t.name)),e}));var ta=window.wp.dom;const na=(0,c.createContext)({});function oa({value:e,children:t}){const n=(0,c.useContext)(na),o=(0,c.useMemo)((()=>({...n,...e})),[n,e]);return(0,c.createElement)(na.Provider,{value:o,children:t})}var ra=na;const la={},ia=(0,m.withFilters)("editor.BlockEdit")((e=>{const{name:t}=e,n=(0,a.getBlockType)(t);if(!n)return null;const o=n.edit||n.save;return(0,c.createElement)(o,{...e})}));var aa=e=>{const{attributes:t={},name:n}=e,o=(0,a.getBlockType)(n),r=(0,c.useContext)(ra),l=(0,c.useMemo)((()=>o&&o.usesContext?Object.fromEntries(Object.entries(r).filter((([e])=>o.usesContext.includes(e)))):la),[o,r]);if(!o)return null;if(o.apiVersion>1)return(0,c.createElement)(ia,{...e,context:l});const i=(0,a.hasBlockSupport)(o,"className",!0)?(0,a.getBlockDefaultClassName)(n):null,s=d()(i,t.className,e.className);return(0,c.createElement)(ia,{...e,context:l,className:s})};function sa(e){const{name:t,isSelected:n,clientId:o,attributes:r={},__unstableLayoutClassNames:l}=e,{layout:i=null}=r,s={name:t,isSelected:n,clientId:o,layout:(0,a.hasBlockSupport)(t,"layout",!1)||(0,a.hasBlockSupport)(t,"__experimentalLayout",!1)?i:null,__unstableLayoutClassNames:l};return(0,c.createElement)(qo,{value:(0,c.useMemo)((()=>s),Object.values(s))},(0,c.createElement)(aa,{...e}))}var ca=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"}));var ua=function({className:e,actions:t,children:n,secondaryActions:o}){return(0,c.createElement)("div",{style:{display:"contents",all:"initial"}},(0,c.createElement)("div",{className:d()(e,"block-editor-warning")},(0,c.createElement)("div",{className:"block-editor-warning__contents"},(0,c.createElement)("p",{className:"block-editor-warning__message"},n),(c.Children.count(t)>0||o)&&(0,c.createElement)("div",{className:"block-editor-warning__actions"},c.Children.count(t)>0&&c.Children.map(t,((e,t)=>(0,c.createElement)("span",{key:t,className:"block-editor-warning__action"},e))),o&&(0,c.createElement)(m.DropdownMenu,{className:"block-editor-warning__secondary",icon:ca,label:(0,v.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,c.createElement)(m.MenuGroup,null,o.map(((e,t)=>(0,c.createElement)(m.MenuItem,{onClick:e.onClick,key:t},e.title))))))))))},da=n(1973);function pa({title:e,rawContent:t,renderedContent:n,action:o,actionText:r,className:l}){return(0,c.createElement)("div",{className:l},(0,c.createElement)("div",{className:"block-editor-block-compare__content"},(0,c.createElement)("h2",{className:"block-editor-block-compare__heading"},e),(0,c.createElement)("div",{className:"block-editor-block-compare__html"},t),(0,c.createElement)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor"},(0,c.createElement)(c.RawHTML,null,(0,ta.safeHTML)(n)))),(0,c.createElement)("div",{className:"block-editor-block-compare__action"},(0,c.createElement)(m.Button,{variant:"secondary",tabIndex:"0",onClick:o},r)))}var ma=function({block:e,onKeep:t,onConvert:n,convertor:o,convertButtonText:r}){const l=(i=o(e),(Array.isArray(i)?i:[i]).map((e=>(0,a.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var i;const s=(u=e.originalContent,p=l,(0,da.Kx)(u,p).map(((e,t)=>{const n=d()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,c.createElement)("span",{key:t,className:n},e.value)})));var u,p;return(0,c.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,c.createElement)(pa,{title:(0,v.__)("Current"),className:"block-editor-block-compare__current",action:t,actionText:(0,v.__)("Convert to HTML"),rawContent:e.originalContent,renderedContent:e.originalContent}),(0,c.createElement)(pa,{title:(0,v.__)("After Conversion"),className:"block-editor-block-compare__converted",action:n,actionText:r,rawContent:s,renderedContent:l}))};const fa=e=>(0,a.rawHandler)({HTML:e.originalContent});function ga({clientId:e}){const{block:t,canInsertHTMLBlock:n,canInsertClassicBlock:o}=(0,f.useSelect)((t=>{const{canInsertBlockType:n,getBlock:o,getBlockRootClientId:r}=t($o),l=r(e);return{block:o(e),canInsertHTMLBlock:n("core/html",l),canInsertClassicBlock:n("core/freeform",l)}}),[e]),{replaceBlock:r}=(0,f.useDispatch)($o),[l,i]=(0,c.useState)(!1),s=(0,c.useCallback)((()=>i(!1)),[]),u=(0,c.useMemo)((()=>({toClassic(){const e=(0,a.createBlock)("core/freeform",{content:t.originalContent});return r(t.clientId,e)},toHTML(){const e=(0,a.createBlock)("core/html",{content:t.originalContent});return r(t.clientId,e)},toBlocks(){const e=fa(t);return r(t.clientId,e)},toRecoveredBlock(){const e=(0,a.createBlock)(t.name,t.attributes,t.innerBlocks);return r(t.clientId,e)}})),[t,r]),d=(0,c.useMemo)((()=>[{title:(0,v._x)("Resolve","imperative verb"),onClick:()=>i(!0)},n&&{title:(0,v.__)("Convert to HTML"),onClick:u.toHTML},o&&{title:(0,v.__)("Convert to Classic Block"),onClick:u.toClassic}].filter(Boolean)),[n,o,u]);return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(ua,{actions:[(0,c.createElement)(m.Button,{key:"recover",onClick:u.toRecoveredBlock,variant:"primary"},(0,v.__)("Attempt Block Recovery"))],secondaryActions:d},(0,v.__)("This block contains unexpected or invalid content.")),l&&(0,c.createElement)(m.Modal,{title:(0,v.__)("Resolve Block"),onRequestClose:s,className:"block-editor-block-compare"},(0,c.createElement)(ma,{block:t,onKeep:u.toHTML,onConvert:u.toBlocks,convertor:fa,convertButtonText:(0,v.__)("Convert to Blocks")})))}const ha=(0,c.createElement)(ua,{className:"block-editor-block-list__block-crash-warning"},(0,v.__)("This block has encountered an error and cannot be previewed."));var ba=()=>ha;class va extends c.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 _a=va,ka=n(773);var ya=function({clientId:e}){const[t,n]=(0,c.useState)(""),o=(0,f.useSelect)((t=>t($o).getBlock(e)),[e]),{updateBlock:r}=(0,f.useDispatch)($o);return(0,c.useEffect)((()=>{n((0,a.getBlockContent)(o))}),[o]),(0,c.createElement)(ka.Z,{className:"block-editor-block-list__block-html-textarea",value:t,onBlur:()=>{const l=(0,a.getBlockType)(o.name);if(!l)return;const i=(0,a.getBlockAttributes)(l,t,o.attributes),s=t||(0,a.getSaveContent)(l,i),[c]=t?(0,a.validateBlock)({...o,attributes:i,originalContent:s}):[!0];r(e,{attributes:i,originalContent:s,isValid:c}),t||n(s)},onChange:e=>n(e.target.value)})},Ea=n(9196),wa=n.n(Ea),Sa=Object.defineProperty,Ca={};((e,t)=>{for(var n in t)Sa(e,n,{get:t[n],enumerable:!0})})(Ca,{assign:()=>rs,colors:()=>ts,createStringInterpolator:()=>Xa,skipAnimation:()=>ns,to:()=>Qa,willAdvance:()=>os});var xa=Ga(),Ba=e=>za(e,xa),Ia=Ga();Ba.write=e=>za(e,Ia);var Ta=Ga();Ba.onStart=e=>za(e,Ta);var Ma=Ga();Ba.onFrame=e=>za(e,Ma);var Pa=Ga();Ba.onFinish=e=>za(e,Pa);var Na=[];Ba.setTimeout=(e,t)=>{const n=Ba.now()+t,o=()=>{const e=Na.findIndex((e=>e.cancel==o));~e&&Na.splice(e,1),Da-=~e?1:0},r={time:n,handler:e,cancel:o};return Na.splice(La(n),0,r),Da+=1,Va(),r};var La=e=>~(~Na.findIndex((t=>t.time>e))||~Na.length);Ba.cancel=e=>{Ta.delete(e),Ma.delete(e),Pa.delete(e),xa.delete(e),Ia.delete(e)},Ba.sync=e=>{Oa=!0,Ba.batchedUpdates(e),Oa=!1},Ba.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,Ba.onStart(n)}return o.handler=e,o.cancel=()=>{Ta.delete(n),t=null},o};var Ra="undefined"!=typeof window?window.requestAnimationFrame:()=>{};Ba.use=e=>Ra=e,Ba.now="undefined"!=typeof performance?()=>performance.now():Date.now,Ba.batchedUpdates=e=>e(),Ba.catch=console.error,Ba.frameLoop="always",Ba.advance=()=>{"demand"!==Ba.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Ha()};var Aa=-1,Da=0,Oa=!1;function za(e,t){Oa?(t.delete(e),e(0)):(t.add(e),Va())}function Va(){Aa<0&&(Aa=0,"demand"!==Ba.frameLoop&&Ra(Fa))}function Fa(){~Aa&&(Ra(Fa),Ba.batchedUpdates(Ha))}function Ha(){const e=Aa;Aa=Ba.now();const t=La(Aa);t&&(Ua(Na.splice(0,t),(e=>e.handler())),Da-=t),Da?(Ta.flush(),xa.flush(e?Math.min(64,Aa-e):16.667),Ma.flush(),Ia.flush(),Pa.flush()):Aa=-1}function Ga(){let e=new Set,t=e;return{add(n){Da+=t!=e||e.has(n)?0:1,e.add(n)},delete(n){return Da-=t==e&&e.has(n)?1:0,e.delete(n)},flush(n){t.size&&(e=new Set,Da-=t.size,Ua(t,(t=>t(n)&&e.add(t))),Da+=e.size,t=e)}}}function Ua(e,t){e.forEach((e=>{try{t(e)}catch(e){Ba.catch(e)}}))}function $a(){}var ja={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 Wa(e,t){if(ja.arr(e)){if(!ja.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 Ka=(e,t)=>e.forEach(t);function qa(e,t,n){if(ja.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 Za=e=>ja.und(e)?[]:ja.arr(e)?e:[e];function Ya(e,t){if(e.size){const n=Array.from(e);e.clear(),Ka(n,t)}}var Xa,Qa,Ja=(e,...t)=>Ya(e,(e=>e(...t))),es=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),ts=null,ns=!1,os=$a,rs=e=>{e.to&&(Qa=e.to),e.now&&(Ba.now=e.now),void 0!==e.colors&&(ts=e.colors),null!=e.skipAnimation&&(ns=e.skipAnimation),e.createStringInterpolator&&(Xa=e.createStringInterpolator),e.requestAnimationFrame&&Ba.use(e.requestAnimationFrame),e.batchedUpdates&&(Ba.batchedUpdates=e.batchedUpdates),e.willAdvance&&(os=e.willAdvance),e.frameLoop&&(Ba.frameLoop=e.frameLoop)},ls=new Set,is=[],as=[],ss=0,cs={get idle(){return!ls.size&&!is.length},start(e){ss>e.priority?(ls.add(e),Ba.onStart(us)):(ds(e),Ba(ms))},advance:ms,sort(e){if(ss)Ba.onFrame((()=>cs.sort(e)));else{const t=is.indexOf(e);~t&&(is.splice(t,1),ps(e))}},clear(){is=[],ls.clear()}};function us(){ls.forEach(ds),ls.clear(),Ba(ms)}function ds(e){is.includes(e)||ps(e)}function ps(e){is.splice(function(e,t){const n=e.findIndex(t);return n<0?e.length:n}(is,(t=>t.priority>e.priority)),0,e)}function ms(e){const t=as;for(let n=0;n<is.length;n++){const o=is[n];ss=o.priority,o.idle||(os(o),o.advance(e),o.idle||t.push(o))}return ss=0,(as=is).length=0,(is=t).length>0}var fs="[-+]?\\d*\\.?\\d+",gs=fs+"%";function hs(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var bs=new RegExp("rgb"+hs(fs,fs,fs)),vs=new RegExp("rgba"+hs(fs,fs,fs,fs)),_s=new RegExp("hsl"+hs(fs,gs,gs)),ks=new RegExp("hsla"+hs(fs,gs,gs,fs)),ys=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Es=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ws=/^#([0-9a-fA-F]{6})$/,Ss=/^#([0-9a-fA-F]{8})$/;function Cs(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 xs(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=Cs(r,o,e+1/3),i=Cs(r,o,e),a=Cs(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*a)<<8}function Bs(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function Is(e){return(parseFloat(e)%360+360)%360/360}function Ts(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Ms(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Ps(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=ws.exec(e))?parseInt(t[1]+"ff",16)>>>0:ts&&void 0!==ts[e]?ts[e]:(t=bs.exec(e))?(Bs(t[1])<<24|Bs(t[2])<<16|Bs(t[3])<<8|255)>>>0:(t=vs.exec(e))?(Bs(t[1])<<24|Bs(t[2])<<16|Bs(t[3])<<8|Ts(t[4]))>>>0:(t=ys.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=Ss.exec(e))?parseInt(t[1],16)>>>0:(t=Es.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=_s.exec(e))?(255|xs(Is(t[1]),Ms(t[2]),Ms(t[3])))>>>0:(t=ks.exec(e))?(xs(Is(t[1]),Ms(t[2]),Ms(t[3]))|Ts(t[4]))>>>0:null}(e);if(null===t)return e;t=t||0;return`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`}var Ns=(e,t,n)=>{if(ja.fun(e))return e;if(ja.arr(e))return Ns({range:e,output:t,extrapolate:n});if(ja.str(e.output[0]))return Xa(e);const o=e,r=o.output,l=o.range||[0,1],i=o.extrapolateLeft||o.extrapolate||"extend",a=o.extrapolateRight||o.extrapolate||"extend",s=o.easing||(e=>e);return e=>{const t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,l);return function(e,t,n,o,r,l,i,a,s){let c=s?s(e):e;if(c<t){if("identity"===i)return c;"clamp"===i&&(c=t)}if(c>n){if("identity"===a)return c;"clamp"===a&&(c=n)}if(o===r)return o;if(t===n)return e<=t?o:r;t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t);c=l(c),o===-1/0?c=-c:r===1/0?c+=o:c=c*(r-o)+o;return c}(e,l[t],l[t+1],r[t],r[t+1],s,i,a,o.map)}};var Ls=1.70158,Rs=1.525*Ls,As=Ls+1,Ds=2*Math.PI/3,Os=2*Math.PI/4.5,zs=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},Vs={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=>As*e*e*e-Ls*e*e,easeOutBack:e=>1+As*Math.pow(e-1,3)+Ls*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(7.189819*e-Rs)/2:(Math.pow(2*e-2,2)*((Rs+1)*(2*e-2)+Rs)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*Ds),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*Ds)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*Os)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*Os)/2+1,easeInBounce:e=>1-zs(1-e),easeOutBounce:zs,easeInOutBounce:e=>e<.5?(1-zs(1-2*e))/2:(1+zs(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,e),t))(0,1,("end"===t?Math.floor(o):Math.ceil(o))/e)}},Fs=Symbol.for("FluidValue.get"),Hs=Symbol.for("FluidValue.observers"),Gs=e=>Boolean(e&&e[Fs]),Us=e=>e&&e[Fs]?e[Fs]():e,$s=e=>e[Hs]||null;function js(e,t){const n=e[Hs];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}var Ws=class{constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");Ks(this,e)}},Ks=(e,t)=>Xs(e,Fs,t);function qs(e,t){if(e[Fs]){let n=e[Hs];n||Xs(e,Hs,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Zs(e,t){const n=e[Hs];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[Hs]=null,e.observerRemoved&&e.observerRemoved(o,t)}}var Ys,Xs=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Qs=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Js=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,ec=new RegExp(`(${Qs.source})(%|[a-z]+)`,"i"),tc=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,nc=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,oc=e=>{const[t,n]=rc(e);if(!t||es())return e;const o=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(o)return o.trim();if(n&&n.startsWith("--")){const t=window.getComputedStyle(document.documentElement).getPropertyValue(n);return t||e}return n&&nc.test(n)?oc(n):n||e},rc=e=>{const t=nc.exec(e);if(!t)return[,];const[,n,o]=t;return[n,o]},lc=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,ic=e=>{Ys||(Ys=ts?new RegExp(`(${Object.keys(ts).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>Us(e).replace(nc,oc).replace(Js,Ps).replace(Ys,Ps))),n=t.map((e=>e.match(Qs).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=>Ns({...e,output:t})));return e=>{const n=!ec.test(t[0])&&t.find((e=>ec.test(e)))?.replace(Qs,"");let o=0;return t[0].replace(Qs,(()=>`${r[o++](e)}${n||""}`)).replace(tc,lc)}},ac="react-spring: ",sc=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${ac}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},cc=sc(console.warn);var uc=sc(console.warn);function dc(e){return ja.str(e)&&("#"==e[0]||/\d/.test(e)||!es()&&nc.test(e)||e in(ts||{}))}var pc=es()?Ea.useEffect:Ea.useLayoutEffect,mc=()=>{const e=(0,Ea.useRef)(!1);return pc((()=>(e.current=!0,()=>{e.current=!1})),[]),e};function fc(){const e=(0,Ea.useState)()[1],t=mc();return()=>{t.current&&e(Math.random())}}var gc=e=>(0,Ea.useEffect)(e,hc),hc=[];function bc(e){const t=(0,Ea.useRef)();return(0,Ea.useEffect)((()=>{t.current=e})),t.current}var vc=Symbol.for("Animated:node"),_c=e=>e&&e[vc],kc=(e,t)=>{return n=e,o=vc,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},yc=e=>e&&e[vc]&&e[vc].getPayload(),Ec=class{constructor(){kc(this,this)}getPayload(){return this.payload||[]}},wc=class extends Ec{constructor(e){super(),this._value=e,this.done=!0,this.durationProgress=0,ja.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new wc(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return ja.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,ja.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},Sc=class extends wc{constructor(e){super(0),this._string=null,this._toString=Ns({output:[e,e]})}static create(e){return new Sc(e)}getValue(){const e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(ja.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=Ns({output:[this.getValue(),e]})),this._value=0,super.reset()}},Cc={dependencies:null},xc=class extends Ec{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return qa(this.source,((n,o)=>{var r;(r=n)&&r[vc]===r?t[o]=n.getValue(e):Gs(n)?t[o]=Us(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Ka(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return qa(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Cc.dependencies&&Gs(e)&&Cc.dependencies.add(e);const t=yc(e);t&&Ka(t,(e=>this.add(e)))}},Bc=class extends xc{constructor(e){super(e)}static create(e){return new Bc(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){const t=this.getPayload();return e.length==t.length?t.map(((t,n)=>t.setValue(e[n]))).some(Boolean):(super.setValue(e.map(Ic)),!0)}};function Ic(e){return(dc(e)?Sc:wc).create(e)}function Tc(e){const t=_c(e);return t?t.constructor:ja.arr(e)?Bc:dc(e)?Sc:wc}var Mc=(e,t)=>{const n=!ja.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,Ea.forwardRef)(((o,r)=>{const l=(0,Ea.useRef)(null),i=n&&(0,Ea.useCallback)((e=>{l.current=function(e,t){e&&(ja.fun(e)?e(t):e.current=t);return t}(r,e)}),[r]),[a,s]=function(e,t){const n=new Set;Cc.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)});return e=new xc(e),Cc.dependencies=null,[e,n]}(o,t),c=fc(),u=()=>{const e=l.current;if(n&&!e)return;!1===(!!e&&t.applyAnimatedValues(e,a.getValue(!0)))&&c()},d=new Pc(u,s),p=(0,Ea.useRef)();pc((()=>(p.current=d,Ka(s,(e=>qs(e,d))),()=>{p.current&&(Ka(p.current.deps,(e=>Zs(e,p.current))),Ba.cancel(p.current.update))}))),(0,Ea.useEffect)(u,[]),gc((()=>()=>{const e=p.current;Ka(e.deps,(t=>Zs(t,e)))}));const m=t.getComponentProps(a.getValue());return Ea.createElement(e,{...m,ref:i})}))},Pc=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&Ba.write(this.update)}};var Nc=Symbol.for("AnimatedComponent"),Lc=e=>ja.str(e)?e:e&&ja.str(e.displayName)?e.displayName:ja.fun(e)&&e.name||null;function Rc(e,...t){return ja.fun(e)?e(...t):e}var Ac=(e,t)=>!0===e||!!(t&&e&&(ja.fun(e)?e(t):Za(e).includes(t))),Dc=(e,t)=>ja.obj(e)?t&&e[t]:e,Oc=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,zc=e=>e,Vc=(e,t=zc)=>{let n=Fc;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);ja.und(n)||(o[r]=n)}return o},Fc=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Hc={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 Gc(e){const t=function(e){const t={};let n=0;if(qa(e,((e,o)=>{Hc[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return qa(e,((e,o)=>o in t||(n[o]=e))),n}return{...e}}function Uc(e){return e=Us(e),ja.arr(e)?e.map(Uc):dc(e)?Ca.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function $c(e){for(const t in e)return!0;return!1}function jc(e){return ja.fun(e)||ja.arr(e)&&ja.obj(e[0])}function Wc(e,t){e.ref?.delete(e),t?.delete(e)}function Kc(e,t){t&&e.ref!==t&&(e.ref?.delete(e),t.add(e),e.ref=t)}var qc={tension:170,friction:26,mass:1,damping:1,easing:Vs.linear,clamp:!1};function Zc(e,t){if(ja.und(t.decay)){const n=!ja.und(t.tension)||!ja.und(t.friction);!n&&ja.und(t.frequency)&&ja.und(t.damping)&&ja.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}var Yc=[];function Xc(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,a)=>{let s,c,u=Ac(n.cancel??o?.cancel,t);if(u)m();else{ja.und(n.pause)||(r.paused=Ac(n.pause,t));let e=o?.pause;!0!==e&&(e=r.paused||Ac(e,t)),s=Rc(n.delay||0,t),e?(r.resumeQueue.add(p),l.pause()):(l.resume(),p())}function d(){r.resumeQueue.add(p),r.timeouts.delete(c),c.cancel(),s=c.time-Ba.now()}function p(){s>0&&!Ca.skipAnimation?(r.delayed=!0,c=Ba.setTimeout(m,s),r.pauseQueue.add(d),r.timeouts.add(c)):m()}function m(){r.delayed&&(r.delayed=!1),r.pauseQueue.delete(d),r.timeouts.delete(c),e<=(r.cancelId||0)&&(u=!0);try{l.start({...n,callId:e,cancel:u},i)}catch(e){a(e)}}}))}var Qc=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?tu(e.get()):t.every((e=>e.noop))?Jc(e.get()):eu(e.get(),t.every((e=>e.finished))),Jc=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),eu=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),tu=e=>({value:e,cancelled:!0,finished:!1});function nu(e,t,n,o){const{callId:r,parentId:l,onRest:i}=t,{asyncTo:a,promise:s}=n;return l||e!==a||t.reset?n.promise=(async()=>{n.asyncId=r,n.asyncTo=e;const c=Vc(t,((e,t)=>"onRest"===t?void 0:e));let u,d;const p=new Promise(((e,t)=>(u=e,d=t))),m=e=>{const t=r<=(n.cancelId||0)&&tu(o)||r!==n.asyncId&&eu(o,!1);if(t)throw e.result=t,d(e),e},f=(e,t)=>{const l=new ru,i=new lu;return(async()=>{if(Ca.skipAnimation)throw ou(n),i.result=eu(o,!1),d(i),i;m(l);const a=ja.obj(e)?{...e}:{...t,to:e};a.parentId=r,qa(c,((e,t)=>{ja.und(a[t])&&(a[t]=e)}));const s=await o.start(a);return m(l),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),s})()};let g;if(Ca.skipAnimation)return ou(n),eu(o,!1);try{let t;t=ja.arr(e)?(async e=>{for(const t of e)await f(t)})(e):Promise.resolve(e(f,o.stop.bind(o))),await Promise.all([t.then(u),p]),g=eu(o.get(),!0,!1)}catch(e){if(e instanceof ru)g=e.result;else{if(!(e instanceof lu))throw e;g=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?a:void 0,n.promise=l?s:void 0)}return ja.fun(i)&&Ba.batchedUpdates((()=>{i(g,o,o.item)})),g})():s}function ou(e,t){Ya(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var ru=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.")}},lu=class extends Error{constructor(){super("SkipAnimationSignal")}},iu=e=>e instanceof su,au=1,su=class extends Ws{constructor(){super(...arguments),this.id=au++,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=_c(this);return e&&e.getValue()}to(...e){return Ca.to(this,e)}interpolate(...e){return cc(`${ac}The "interpolate" function is deprecated in v9 (use "to" instead)`),Ca.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){js(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||cs.sort(this),js(this,{type:"priority",parent:this,priority:e})}},cu=Symbol.for("SpringPhase"),uu=e=>(1&e[cu])>0,du=e=>(2&e[cu])>0,pu=e=>(4&e[cu])>0,mu=(e,t)=>t?e[cu]|=3:e[cu]&=-3,fu=(e,t)=>t?e[cu]|=4:e[cu]&=-5,gu=class extends su{constructor(e,t){if(super(),this.animation=new class{constructor(){this.changed=!1,this.values=Yc,this.toValues=null,this.fromValues=Yc,this.config=new class{constructor(){this.velocity=0,Object.assign(this,qc)}},this.immediate=!1}},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,!ja.und(e)||!ja.und(t)){const n=ja.obj(e)?{...e}:{...t,from:e};ja.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(du(this)||this._state.asyncTo)||pu(this)}get goal(){return Us(this.animation.to)}get velocity(){const e=_c(this);return e instanceof wc?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return uu(this)}get isAnimating(){return du(this)}get isPaused(){return pu(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const o=this.animation;let{toValues:r}=o;const{config:l}=o,i=yc(o.to);!i&&Gs(o.to)&&(r=Za(Us(o.to))),o.values.forEach(((a,s)=>{if(a.done)return;const c=a.constructor==Sc?1:i?i[s].lastPosition:r[s];let u=o.immediate,d=c;if(!u){if(d=a.lastPosition,l.tension<=0)return void(a.done=!0);let t=a.elapsedTime+=e;const n=o.fromValues[s],r=null!=a.v0?a.v0:a.v0=ja.arr(l.velocity)?l.velocity[s]:l.velocity;let i;const p=l.precision||(n==c?.005:Math.min(1,.001*Math.abs(c-n)));if(ja.und(l.duration))if(l.decay){const e=!0===l.decay?.998:l.decay,o=Math.exp(-(1-e)*t);d=n+r/(1-e)*(1-o),u=Math.abs(a.lastPosition-d)<=p,i=r*o}else{i=null==a.lastVelocity?r:a.lastVelocity;const t=l.restVelocity||p/10,o=l.clamp?0:l.bounce,s=!ja.und(o),m=n==c?a.v0>0:n<c;let f,g=!1;const h=1,b=Math.ceil(e/h);for(let e=0;e<b&&(f=Math.abs(i)>t,f||(u=Math.abs(c-d)<=p,!u));++e){s&&(g=d==c||d>c==m,g&&(i=-i*o,d=c));i+=(1e-6*-l.tension*(d-c)+.001*-l.friction*i)/l.mass*h,d+=i*h}}else{let o=1;l.duration>0&&(this._memoizedDuration!==l.duration&&(this._memoizedDuration=l.duration,a.durationProgress>0&&(a.elapsedTime=l.duration*a.durationProgress,t=a.elapsedTime+=e)),o=(l.progress||0)+t/this._memoizedDuration,o=o>1?1:o<0?0:o,a.durationProgress=o),d=n+l.easing(o)*(c-n),i=(d-a.lastPosition)/e,u=1==o}a.lastVelocity=i,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}i&&!i[s].done&&(u=!1),u?a.done=!0:t=!1,a.setValue(d,l.round)&&(n=!0)}));const a=_c(this),s=a.getValue();if(t){const e=Us(o.to);s===e&&!n||l.decay?n&&l.decay&&this._onChange(s):(a.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(s)}set(e){return Ba.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(du(this)){const{to:e,config:t}=this.animation;Ba.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 ja.und(e)?(n=this.queue||[],this.queue=[]):n=[ja.obj(e)?e:{...t,to:e}],Promise.all(n.map((e=>this._update(e)))).then((e=>Qc(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),ou(this._state,e&&this._lastCallId),Ba.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=ja.obj(n)?n[t]:n,(null==n||jc(n))&&(n=void 0),o=ja.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return uu(this)||(e.reverse&&([n,o]=[o,n]),o=Us(o),ja.und(o)?_c(this)||this._set(n):this._set(o)),r}_update({...e},t){const{key:n,defaultProps:o}=this;e.default&&Object.assign(o,Vc(e,((e,t)=>/^on/.test(t)?Dc(e,n):e))),Eu(this,e,"onProps"),wu(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 l=this._state;return Xc(++this._lastCallId,{key:n,props:e,defaultProps:o,state:l,actions:{pause:()=>{pu(this)||(fu(this,!0),Ja(l.pauseQueue),wu(this,"onPause",eu(this,hu(this,this.animation.to)),this))},resume:()=>{pu(this)&&(fu(this,!1),du(this)&&this._resume(),Ja(l.resumeQueue),wu(this,"onResume",eu(this,hu(this,this.animation.to)),this))},start:this._merge.bind(this,r)}}).then((n=>{if(e.loop&&n.finished&&(!t||!n.noop)){const t=bu(e);if(t)return this._update(t,!0)}return n}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(tu(this));const o=!ja.und(e.to),r=!ja.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(tu(this));this._lastToId=t.callId}const{key:l,defaultProps:i,animation:a}=this,{to:s,from:c}=a;let{to:u=s,from:d=c}=e;!r||o||t.default&&!ja.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!Wa(d,c);p&&(a.from=d),d=Us(d);const m=!Wa(u,s);m&&this._focus(u);const f=jc(t.to),{config:g}=a,{decay:h,velocity:b}=g;(o||r)&&(g.velocity=0),t.config&&!f&&function(e,t,n){n&&(Zc(n={...n},t),t={...n,...t}),Zc(e,t),Object.assign(e,t);for(const t in qc)null==e[t]&&(e[t]=qc[t]);let{frequency:o,damping:r}=e;const{mass:l}=e;ja.und(o)||(o<.01&&(o=.01),r<0&&(r=0),e.tension=Math.pow(2*Math.PI/o,2)*l,e.friction=4*Math.PI*r*l/o)}(g,Rc(t.config,l),t.config!==i.config?Rc(i.config,l):void 0);let v=_c(this);if(!v||ja.und(u))return n(eu(this,!0));const _=ja.und(t.reset)?r&&!t.default:!ja.und(d)&&Ac(t.reset,l),k=_?d:this.get(),y=Uc(u),E=ja.num(y)||ja.arr(y)||dc(y),w=!f&&(!E||Ac(i.immediate||t.immediate,l));if(m){const e=Tc(u);if(e!==v.constructor){if(!w)throw Error(`Cannot animate between ${v.constructor.name} and ${e.name}, as the "to" prop suggests`);v=this._set(y)}}const S=v.constructor;let C=Gs(u),x=!1;if(!C){const e=_||!uu(this)&&p;(m||e)&&(x=Wa(Uc(k),y),C=!x),(Wa(a.immediate,w)||w)&&Wa(g.decay,h)&&Wa(g.velocity,b)||(C=!0)}if(x&&du(this)&&(a.changed&&!_?C=!0:C||this._stop(s)),!f&&((C||Gs(s))&&(a.values=v.getPayload(),a.toValues=Gs(u)?null:S==Sc?[1]:Za(y)),a.immediate!=w&&(a.immediate=w,w||_||this._set(s)),C)){const{onRest:e}=a;Ka(yu,(e=>Eu(this,t,e)));const o=eu(this,hu(this,s));Ja(this._pendingCalls,o),this._pendingCalls.add(n),a.changed&&Ba.batchedUpdates((()=>{a.changed=!_,e?.(o,this),_?Rc(i.onRest,o):a.onStart?.(o,this)}))}_&&this._set(k),f?n(nu(t.to,t,this._state,this)):C?this._start():du(this)&&!m?this._pendingCalls.add(n):n(Jc(k))}_focus(e){const t=this.animation;e!==t.to&&($s(this)&&this._detach(),t.to=e,$s(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Gs(t)&&(qs(t,this),iu(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Gs(e)&&Zs(e,this)}_set(e,t=!0){const n=Us(e);if(!ja.und(n)){const e=_c(this);if(!e||!Wa(n,e.getValue())){const o=Tc(n);e&&e.constructor==o?e.setValue(n):kc(this,o.create(n)),e&&Ba.batchedUpdates((()=>{this._onChange(n,t)}))}}return _c(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,wu(this,"onStart",eu(this,hu(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),Rc(this.animation.onChange,e,this)),Rc(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;_c(this).reset(Us(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),du(this)||(mu(this,!0),pu(this)||this._resume())}_resume(){Ca.skipAnimation?this.finish():cs.start(this)}_stop(e,t){if(du(this)){mu(this,!1);const n=this.animation;Ka(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),js(this,{type:"idle",parent:this});const o=t?tu(this.get()):eu(this.get(),hu(this,e??n.to));Ja(this._pendingCalls,o),n.changed&&(n.changed=!1,wu(this,"onRest",o,this))}}};function hu(e,t){const n=Uc(t);return Wa(Uc(e.get()),n)}function bu(e,t=e.loop,n=e.to){const o=Rc(t);if(o){const r=!0!==o&&Gc(o),l=(r||e).reverse,i=!r||r.reset;return vu({...e,loop:t,default:!1,pause:void 0,to:!l||jc(n)?n:void 0,from:i?e.from:void 0,reset:i,...r})}}function vu(e){const{to:t,from:n}=e=Gc(e),o=new Set;return ja.obj(t)&&ku(t,o),ja.obj(n)&&ku(n,o),e.keys=o.size?Array.from(o):null,e}function _u(e){const t=vu(e);return ja.und(t.default)&&(t.default=Vc(t)),t}function ku(e,t){qa(e,((e,n)=>null!=e&&t.add(n)))}var yu=["onStart","onRest","onChange","onPause","onResume"];function Eu(e,t,n){e.animation[n]=t[n]!==Oc(t,n)?Dc(t[n],e.key):void 0}function wu(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var Su=["onStart","onChange","onRest"],Cu=1,xu=class{constructor(e,t){this.id=Cu++,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];ja.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(vu(e)),this}start(e){let{queue:t}=this;return e?t=Za(e).map(vu):this.queue=[],this._flush?this._flush(this,t):(Lu(this,t),Bu(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Ka(Za(t),(t=>n[t].stop(!!e)))}else ou(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(ja.und(e))this.start({pause:!0});else{const t=this.springs;Ka(Za(e),(e=>t[e].pause()))}return this}resume(e){if(ja.und(e))this.start({pause:!1});else{const t=this.springs;Ka(Za(e),(e=>t[e].resume()))}return this}each(e){qa(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,Ya(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));const l=!o&&this._started,i=r||l&&n.size?this.get():null;r&&t.size&&Ya(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,Ya(n,(([e,t])=>{t.value=i,e(t,this,this._item)})))}eventObserved(e){if("change"==e.type)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else{if("idle"!=e.type)return;this._active.delete(e.parent)}Ba.onFrame(this._onFrame)}};function Bu(e,t){return Promise.all(t.map((t=>Iu(e,t)))).then((t=>Qc(e,t)))}async function Iu(e,t,n){const{keys:o,to:r,from:l,loop:i,onRest:a,onResolve:s}=t,c=ja.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=ja.arr(r)||ja.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Ka(Su,(n=>{const o=t[n];if(ja.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,Ja(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);const p=(o||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),m=!0===t.cancel||!0===Oc(t,"cancel");(u||m&&d.asyncId)&&p.push(Xc(++e._lastAsyncId,{props:t,state:d,actions:{pause:$a,resume:$a,start(t,n){m?(ou(d,e._lastAsyncId),n(tu(e))):(t.onRest=a,n(nu(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const f=Qc(e,await Promise.all(p));if(i&&f.finished&&(!n||!f.noop)){const n=bu(t,i,r);if(n)return Lu(e,[n]),Iu(e,n,!0)}return s&&Ba.batchedUpdates((()=>s(f,e,e.item))),f}function Tu(e,t){const n={...e.springs};return t&&Ka(Za(t),(e=>{ja.und(e.keys)&&(e=vu(e)),ja.obj(e.to)||(e={...e,to:void 0}),Nu(n,e,(e=>Pu(e)))})),Mu(e,n),n}function Mu(e,t){qa(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,qs(t,e))}))}function Pu(e,t){const n=new gu;return n.key=e,t&&qs(n,t),n}function Nu(e,t,n){t.keys&&Ka(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function Lu(e,t){Ka(t,(t=>{Nu(e.springs,t,(t=>Pu(t,e)))}))}var Ru,Au,Du=({children:e,...t})=>{const n=(0,Ea.useContext)(Ou),o=t.pause||!!n.pause,r=t.immediate||!!n.immediate;t=function(e,t){const[n]=(0,Ea.useState)((()=>({inputs:t,result:e()}))),o=(0,Ea.useRef)(),r=o.current;let l=r;if(l){const n=Boolean(t&&l.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,l.inputs));n||(l={inputs:t,result:e()})}else l=n;return(0,Ea.useEffect)((()=>{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:o,immediate:r})),[o,r]);const{Provider:l}=Ou;return Ea.createElement(l,{value:t},e)},Ou=(Ru=Du,Au={},Object.assign(Ru,Ea.createContext(Au)),Ru.Provider._context=Ru,Ru.Consumer._context=Ru,Ru);Du.Provider=Ou.Provider,Du.Consumer=Ou.Consumer;var zu=()=>{const e=[],t=function(t){uc(`${ac}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`);const o=[];return Ka(e,((e,r)=>{if(ja.und(t))o.push(e.start());else{const l=n(t,e,r);l&&o.push(e.start(l))}})),o};t.current=e,t.add=function(t){e.includes(t)||e.push(t)},t.delete=function(t){const n=e.indexOf(t);~n&&e.splice(n,1)},t.pause=function(){return Ka(e,(e=>e.pause(...arguments))),this},t.resume=function(){return Ka(e,(e=>e.resume(...arguments))),this},t.set=function(t){Ka(e,((e,n)=>{const o=ja.fun(t)?t(n,e):t;o&&e.set(o)}))},t.start=function(t){const n=[];return Ka(e,((e,o)=>{if(ja.und(t))n.push(e.start());else{const r=this._getProps(t,e,o);r&&n.push(e.start(r))}})),n},t.stop=function(){return Ka(e,(e=>e.stop(...arguments))),this},t.update=function(t){return Ka(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return ja.fun(e)?e(n,t):e};return t._getProps=n,t};function Vu(e,t,n){const o=ja.fun(t)&&t;o&&!n&&(n=[]);const r=(0,Ea.useMemo)((()=>o||3==arguments.length?zu():void 0),[]),l=(0,Ea.useRef)(0),i=fc(),a=(0,Ea.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=Tu(e,t);return l.current>0&&!a.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?Bu(e,t):new Promise((o=>{Mu(e,n),a.queue.push((()=>{o(Bu(e,t))})),i()}))}})),[]),s=(0,Ea.useRef)([...a.ctrls]),c=[],u=bc(e)||0;function d(e,n){for(let r=e;r<n;r++){const e=s.current[r]||(s.current[r]=new xu(null,a.flush)),n=o?o(r,e):t[r];n&&(c[r]=_u(n))}}(0,Ea.useMemo)((()=>{Ka(s.current.slice(e,u),(e=>{Wc(e,r),e.stop(!0)})),s.current.length=e,d(u,e)}),[e]),(0,Ea.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=s.current.map(((e,t)=>Tu(e,c[t]))),m=(0,Ea.useContext)(Du),f=bc(m),g=m!==f&&$c(m);pc((()=>{l.current++,a.ctrls=s.current;const{queue:e}=a;e.length&&(a.queue=[],Ka(e,(e=>e()))),Ka(s.current,((e,t)=>{r?.add(e),g&&e.start({default:m});const n=c[t];n&&(Kc(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),gc((()=>()=>{Ka(a.ctrls,(e=>e.stop(!0)))}));const h=p.map((e=>({...e})));return r?[h,r]:h}function Fu(e,t){const n=ja.fun(e),[[o],r]=Vu(1,n?e:[e],n?t||[]:t);return n||2==arguments.length?[o,r]:o}var Hu=class extends su{constructor(e,t){super(),this.source=e,this.idle=!0,this._active=new Set,this.calc=Ns(...t);const n=this._get(),o=Tc(n);kc(this,o.create(n))}advance(e){const t=this._get();Wa(t,this.get())||(_c(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Uu(this._active)&&$u(this)}_get(){const e=ja.arr(this.source)?this.source.map(Us):Za(Us(this.source));return this.calc(...e)}_start(){this.idle&&!Uu(this._active)&&(this.idle=!1,Ka(yc(this),(e=>{e.done=!1})),Ca.skipAnimation?(Ba.batchedUpdates((()=>this.advance())),$u(this)):cs.start(this))}_attach(){let e=1;Ka(Za(this.source),(t=>{Gs(t)&&qs(t,this),iu(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Ka(Za(this.source),(e=>{Gs(e)&&Zs(e,this)})),this._active.clear(),$u(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=Za(this.source).reduce(((e,t)=>Math.max(e,(iu(t)?t.priority:0)+1)),0))}};function Gu(e){return!1!==e.idle}function Uu(e){return!e.size||Array.from(e).every(Gu)}function $u(e){e.idle||(e.idle=!0,Ka(yc(e),(e=>{e.done=!0})),js(e,{type:"idle",parent:e}))}Ca.assign({createStringInterpolator:ic,to:(e,t)=>new Hu(e,t)});cs.advance;var ju=window.ReactDOM,Wu=/^--/;function Ku(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||Wu.test(e)||Zu.hasOwnProperty(e)&&Zu[e]?(""+t).trim():t+"px"}var qu={};var Zu={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},Yu=["Webkit","Ms","Moz","O"];Zu=Object.keys(Zu).reduce(((e,t)=>(Yu.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),Zu);var Xu=/^(matrix|translate|scale|rotate|skew)/,Qu=/^(translate)/,Ju=/^(rotate|skew)/,ed=(e,t)=>ja.num(e)&&0!==e?e+t:e,td=(e,t)=>ja.arr(e)?e.every((e=>td(e,t))):ja.num(e)?e===t:parseFloat(e)===t,nd=class extends xc{constructor({x:e,y:t,z:n,...o}){const r=[],l=[];(e||t||n)&&(r.push([e||0,t||0,n||0]),l.push((e=>[`translate3d(${e.map((e=>ed(e,"px"))).join(",")})`,td(e,0)]))),qa(o,((e,t)=>{if("transform"===t)r.push([e||""]),l.push((e=>[e,""===e]));else if(Xu.test(t)){if(delete o[t],ja.und(e))return;const n=Qu.test(t)?"px":Ju.test(t)?"deg":"";r.push(Za(e)),l.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${ed(r,n)})`,td(r,0)]:e=>[`${t}(${e.map((e=>ed(e,n))).join(",")})`,td(e,t.startsWith("scale")?1:0)])}})),r.length&&(o.transform=new od(r,l)),super(o)}},od=class extends Ws{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 Ka(this.inputs,((n,o)=>{const r=Us(n[0]),[l,i]=this.transforms[o](ja.arr(r)?r:n.map(Us));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&Ka(this.inputs,(e=>Ka(e,(e=>Gs(e)&&qs(e,this)))))}observerRemoved(e){0==e&&Ka(this.inputs,(e=>Ka(e,(e=>Gs(e)&&Zs(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),js(this,e)}};Ca.assign({batchedUpdates:ju.unstable_batchedUpdates,createStringInterpolator:ic,colors:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199}});var rd=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new xc(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=Lc(e)||"Anonymous";return(e=ja.str(e)?l[e]||(l[e]=Mc(e,r)):e[Nc]||(e[Nc]=Mc(e,r))).displayName=`Animated(${t})`,e};return qa(e,((t,n)=>{ja.arr(e)&&(n=Lc(t)),l[n]=l(t)})),{animated:l}})(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(e,t){if(!e.nodeType||!e.setAttribute)return!1;const n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,{style:o,children:r,scrollTop:l,scrollLeft:i,viewBox:a,...s}=t,c=Object.values(s),u=Object.keys(s).map((t=>n||e.hasAttribute(t)?t:qu[t]||(qu[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==r&&(e.textContent=r);for(const t in o)if(o.hasOwnProperty(t)){const n=Ku(t,o[t]);Wu.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==l&&(e.scrollTop=l),void 0!==i&&(e.scrollLeft=i),void 0!==a&&e.setAttribute("viewBox",a)},createAnimatedStyle:e=>new nd(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),ld=rd.animated;const id=e=>e+1,ad=e=>({top:e.offsetTop,left:e.offsetLeft});var sd=function({isSelected:e,adjustScrolling:t,enableAnimation:n,triggerAnimationOnChange:o}){const r=(0,c.useRef)(),l=(0,p.useReducedMotion)()||!n,[i,a]=(0,c.useReducer)(id,0),[s,u]=(0,c.useReducer)(id,0),[d,m]=(0,c.useState)({x:0,y:0}),f=(0,c.useMemo)((()=>r.current?ad(r.current):null),[o]),g=(0,c.useMemo)((()=>{if(!t||!r.current)return()=>{};const e=(0,ta.getScrollContainer)(r.current);if(!e)return()=>{};const n=r.current.getBoundingClientRect();return()=>{const t=r.current.getBoundingClientRect().top-n.top;t&&(e.scrollTop+=t)}}),[o,t]);return(0,c.useLayoutEffect)((()=>{i&&u()}),[i]),(0,c.useLayoutEffect)((()=>{if(!f)return;if(l)return void g();r.current.style.transform=void 0;const e=ad(r.current);a(),m({x:Math.round(f.left-e.left),y:Math.round(f.top-e.top)})}),[o]),Fu({from:{x:d.x,y:d.y},to:{x:0,y:0},reset:i!==s,config:{mass:5,tension:2e3,friction:200},immediate:l,onChange:function({value:t}){if(!r.current)return;let{x:n,y:o}=t;n=Math.round(n),o=Math.round(o);const l=0===n&&0===o;r.current.style.transformOrigin="center center",r.current.style.transform=l?void 0:`translate3d(${n}px,${o}px,0)`,r.current.style.zIndex=e?"1":"",g()}}),r};const cd=".block-editor-block-list__block",ud=".block-list-appender",dd=".block-editor-button-block-appender";function pd(e,t){return t.closest([cd,ud,dd].join(","))===e}function md(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(cd);return t?t.id.slice(6):void 0}function fd(e){const t=(0,c.useRef)(),n=function(e){return(0,f.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,__unstableGetEditorMode:o,isBlockSelected:r}=t($o);if(r(e)&&"edit"===o())return n()}),[e])}(e),{isBlockSelected:o,isMultiSelecting:r}=(0,f.useSelect)($o);return(0,c.useEffect)((()=>{if(!o(e)||r())return;if(null==n)return;if(!t.current)return;const{ownerDocument:l}=t.current;if(pd(t.current,l.activeElement))return;const i=ta.focus.tabbable.find(t.current).filter((e=>(0,ta.isTextField)(e))),a=-1===n,s=i[a?i.length-1:0]||t.current;if(pd(t.current,s)){if(!t.current.getAttribute("contenteditable")){const e=ta.focus.tabbable.findNext(t.current);if(e&&pd(t.current,e)&&(0,ta.isFormElement)(e))return void e.focus()}(0,ta.placeCaretAtHorizontalEdge)(s,a)}else t.current.focus()}),[n,e]),t}function gd(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function hd(){const e=(0,f.useSelect)((e=>{const{getSettings:t}=e($o);return t().outlineMode}),[]);return(0,p.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",gd),t.addEventListener("mouseover",gd),()=>{t.removeEventListener("mouseout",gd),t.removeEventListener("mouseover",gd),t.classList.remove("is-hovered")}}),[e])}function bd(e){return(0,f.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:r,isBlockMultiSelected:l,getBlockName:i,getSettings:s,hasSelectedInnerBlock:c,isTyping:u,__unstableIsFullySelected:p,__unstableSelectionHasUnmergeableBlock:m}=t($o),{outlineMode:f}=s(),g=n(e),h=r(e),b=i(e),v=c(e,!0),_=l(e);return d()({"is-selected":h,"is-highlighted":o(e),"is-multi-selected":_,"is-partially-selected":_&&!p()&&!m(),"is-reusable":(0,a.isReusableBlock)((0,a.getBlockType)(b)),"is-dragging":g,"has-child-selected":v,"remove-outline":h&&f&&u()})}),[e])}function vd(e){return(0,f.useSelect)((t=>{const n=t($o).getBlockName(e),o=(0,a.getBlockType)(n);if(o?.apiVersion>1)return(0,a.getBlockDefaultClassName)(n)}),[e])}function _d(e){return(0,f.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t($o),r=o(e);if(!r?.className)return;const l=(0,a.getBlockType)(n(e));return l?.apiVersion>1?r.className:void 0}),[e])}function kd(e){return(0,f.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t($o);if(!i(e))return;const a=n();return a?d()("is-block-moving-mode",{"can-insert-moving-block":o(r(a),l(e))}):void 0}),[e])}function yd(e){const{isBlockSelected:t}=(0,f.useSelect)($o),{selectBlock:n,selectionChange:o}=(0,f.useDispatch)($o);return(0,p.useRefEffect)((r=>{function l(l){r.parentElement.closest('[contenteditable="true"]')||(t(e)?l.target.isContentEditable||o(e):pd(r,l.target)&&n(e))}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}var Ed=window.wp.keycodes;function wd(e){const t=(0,f.useSelect)((t=>t($o).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,f.useSelect)($o),{insertDefaultBlock:r,removeBlock:l}=(0,f.useDispatch)($o);return(0,p.useRefEffect)((i=>{if(t)return i.addEventListener("keydown",a),i.addEventListener("dragstart",s),()=>{i.removeEventListener("keydown",a),i.removeEventListener("dragstart",s)};function a(t){const{keyCode:a,target:s}=t;a!==Ed.ENTER&&a!==Ed.BACKSPACE&&a!==Ed.DELETE||s!==i||(0,ta.isTextField)(s)||(t.preventDefault(),a===Ed.ENTER?r({},n(e),o(e)+1):l(e))}function s(e){e.preventDefault()}}),[e,t,n,o,r,l])}function Sd(e){const{isNavigationMode:t,isBlockSelected:n}=(0,f.useSelect)($o),{setNavigationMode:o,selectBlock:r}=(0,f.useDispatch)($o);return(0,p.useRefEffect)((l=>{function i(l){t()&&!l.defaultPrevented&&(l.preventDefault(),n(e)?o(!1):r(e))}return l.addEventListener("mousedown",i),()=>{l.addEventListener("mousedown",i)}}),[e,t,n,o])}const Cd=(0,c.createContext)({refs:new Map,callbacks:new Map});function xd({children:e}){const t=(0,c.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,c.createElement)(Cd.Provider,{value:t},e)}function Bd(e){const{refs:t,callbacks:n}=(0,c.useContext)(Cd),o=(0,c.useRef)();return(0,c.useLayoutEffect)((()=>(t.set(o,e),()=>{t.delete(o)})),[e]),(0,p.useRefEffect)((t=>{o.current=t,n.forEach(((n,o)=>{e===n&&o(t)}))}),[e])}function Id(e){const{refs:t}=(0,c.useContext)(Cd),n=(0,c.useRef)();return n.current=e,(0,c.useMemo)((()=>({get current(){let e=null;for(const[o,r]of t.entries())r===n.current&&o.current&&(e=o.current);return e}})),[])}function Td(e){const{callbacks:t}=(0,c.useContext)(Cd),n=Id(e),[o,r]=(0,c.useState)(null);return(0,c.useLayoutEffect)((()=>{if(e)return t.set(r,e),()=>{t.delete(r)}}),[e]),n.current||o}function Md(){const e=(0,c.useContext)(kv);return(0,p.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function Pd(e){return(0,f.useSelect)((t=>{const{__unstableHasActiveBlockOverlayActive:n}=t($o);return n(e)}),[e])}const Nd=200;function Ld(e={},{__unstableIsHtml:t}={}){const{clientId:n,className:o,wrapperProps:r={},isAligned:l}=(0,c.useContext)(xi),{index:i,mode:s,name:u,blockApiVersion:m,blockTitle:g,isPartOfSelection:h,adjustScrolling:b,enableAnimation:_,isSubtreeDisabled:k}=(0,f.useSelect)((e=>{const{getBlockAttributes:t,getBlockIndex:o,getBlockMode:r,getBlockName:l,isTyping:i,getGlobalBlockCount:s,isBlockSelected:c,isBlockMultiSelected:u,isAncestorMultiSelected:d,isFirstMultiSelectedBlock:p,isBlockSubtreeDisabled:m}=bn(e($o)),{getActiveBlockVariation:f}=e(a.store),g=c(n),h=u(n)||d(n),b=l(n),v=(0,a.getBlockType)(b),_=f(b,t(n));return{index:o(n),mode:r(n),name:b,blockApiVersion:v?.apiVersion||1,blockTitle:_?.title||v?.title,isPartOfSelection:g||h,adjustScrolling:g||p(n),enableAnimation:!i()&&s()<=Nd,isSubtreeDisabled:m(n)}}),[n]),y=Pd(n),E=(0,v.sprintf)((0,v.__)("Block: %s"),g),w="html"!==s||t?"":"-visual",S=(0,p.useMergeRefs)([e.ref,fd(n),Bd(n),yd(n),wd(n),Sd(n),hd(),Md(),sd({isSelected:h,adjustScrolling:b,enableAnimation:_,triggerAnimationOnChange:i}),(0,p.useDisabled)({isDisabled:!y})]),C=Zo();return m<2&&n===C.clientId&&"undefined"!=typeof process&&process.env,{tabIndex:0,...r,...e,ref:S,id:`block-${n}${w}`,role:"document","aria-label":E,"data-block":n,"data-type":u,"data-title":g,inert:k?"true":void 0,className:d()(d()("block-editor-block-list__block",{"wp-block":!l,"has-block-overlay":y}),o,e.className,r.className,bd(n),vd(n),_d(n),kd(n)),style:{...r.style,...e.style}}}function Rd({children:e,isHtml:t,...n}){return(0,c.createElement)("div",{...Ld(n,{__unstableIsHtml:t})},e)}Ld.save=a.__unstableGetBlockProps;const Ad=(0,f.withSelect)(((e,{clientId:t,rootClientId:n})=>{const{isBlockSelected:o,getBlockMode:r,isSelectionEnabled:l,getTemplateLock:i,__unstableGetBlockWithoutInnerBlocks:a,canRemoveBlock:s,canMoveBlock:c}=e($o),u=a(t),d=o(t),p=i(n),m=s(t,n),f=c(t,n),{name:g,attributes:h,isValid:b}=u||{};return{mode:r(t),isSelectionEnabled:l(),isLocked:!!p,canRemove:m,canMove:f,block:u,name:g,attributes:h,isValid:b,isSelected:d}})),Dd=(0,f.withDispatch)(((e,t,n)=>{const{updateBlockAttributes:o,insertBlocks:r,mergeBlocks:l,replaceBlocks:i,toggleSelection:s,__unstableMarkLastChangeAsPersistent:c,moveBlocksToPosition:u,removeBlock:d}=e($o);return{setAttributes(e){const{getMultiSelectedBlockClientIds:r}=n.select($o),l=r(),{clientId:i}=t,a=l.length?l:[i];o(a,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;r(e,n,o)},onInsertBlocksAfter(e){const{clientId:o,rootClientId:l}=t,{getBlockIndex:i}=n.select($o),a=i(o);r(e,a+1,l)},onMerge(e){const{clientId:o,rootClientId:i}=t,{getPreviousBlockClientId:s,getNextBlockClientId:c,getBlock:p,getBlockAttributes:m,getBlockName:f,getBlockOrder:g,getBlockIndex:h,getBlockRootClientId:b,canInsertBlockType:v}=n.select($o);function _(e,t=!0){const o=b(e),l=g(e),[i]=l;1===l.length&&(0,a.isUnmodifiedBlock)(p(i))?d(e):n.batch((()=>{if(v(f(i),o))u([i],e,o,h(e));else{const n=(0,a.switchToBlockType)(p(i),(0,a.getDefaultBlockName)());n&&n.length&&(r(n,h(e),o,t),d(i,!1))}!g(e).length&&(0,a.isUnmodifiedBlock)(p(e))&&d(e,!1)}))}if(e){if(i){const e=c(i);if(e){if(f(i)!==f(e))return void l(i,e);{const t=m(i),o=m(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{u(g(e),e,i),d(e,!1)}))}}}const e=c(o);if(!e)return;g(e).length?_(e,!1):l(o,e)}else{const e=s(o);if(e)l(e,o);else if(i){const e=s(i);if(e&&f(i)===f(e)){const t=m(i),o=m(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{u(g(i),i,e),d(i,!1)}))}_(i)}}},onReplace(e,n,o){e.length&&!(0,a.isUnmodifiedDefaultBlock)(e[e.length-1])&&c(),i([t.clientId],e,n,o)},toggleSelection(e){s(e)}}}));var Od=(0,p.compose)(p.pure,Ad,Dd,(0,p.ifCondition)((({block:e})=>!!e)),(0,m.withFilters)("editor.BlockListBlock"))((function({block:{__unstableBlockSource:e},mode:t,isLocked:n,canRemove:o,clientId:r,isSelected:l,isSelectionEnabled:i,className:s,__unstableLayoutClassNames:u,name:p,isValid:m,attributes:g,wrapperProps:h,setAttributes:b,onReplace:v,onInsertBlocksAfter:_,onMerge:k,toggleSelection:y}){var E;const{themeSupportsLayout:w,isTemporarilyEditingAsBlocks:S,blockEditingMode:C}=(0,f.useSelect)((e=>{const{getSettings:t,__unstableGetTemporarilyEditingAsBlocks:n,getBlockEditingMode:o}=bn(e($o));return{themeSupportsLayout:t().supportsLayout,isTemporarilyEditingAsBlocks:n()===r,blockEditingMode:o(r)}}),[r]),{removeBlock:x}=(0,f.useDispatch)($o),B=(0,c.useCallback)((()=>x(r)),[r]),I=pi()||{};let T=(0,c.createElement)(sa,{name:p,isSelected:l,attributes:g,setAttributes:b,insertBlocksAfter:n?void 0:_,onReplace:o?v:void 0,onRemove:o?B:void 0,mergeBlocks:o?k:void 0,clientId:r,isSelectionEnabled:i,toggleSelection:y,__unstableLayoutClassNames:u,__unstableParentLayout:Object.keys(I).length?I:void 0});const M=(0,a.getBlockType)(p);"disabled"===C&&(h={...h,tabIndex:-1}),M?.getEditWrapperProps&&(h=function(e,t){const n={...e,...t};return e?.className&&t?.className&&(n.className=d()(e.className,t.className)),e?.style&&t?.style&&(n.style={...e.style,...t.style}),n}(h,M.getEditWrapperProps(g)));const P=h&&!!h["data-align"]&&!w;let N;if(P&&(T=(0,c.createElement)("div",{className:"wp-block","data-align":h["data-align"]},T)),m)N="html"===t?(0,c.createElement)(c.Fragment,null,(0,c.createElement)("div",{style:{display:"none"}},T),(0,c.createElement)(Rd,{isHtml:!0},(0,c.createElement)(ya,{clientId:r}))):M?.apiVersion>1?T:(0,c.createElement)(Rd,{...h},T);else{const t=e?(0,a.serializeRawBlock)(e):(0,a.getSaveContent)(M,g);N=(0,c.createElement)(Rd,{className:"has-warning"},(0,c.createElement)(ga,{clientId:r}),(0,c.createElement)(c.RawHTML,null,(0,ta.safeHTML)(t)))}const{"data-align":L,...R}=null!==(E=h)&&void 0!==E?E:{},A={clientId:r,className:d()({"is-editing-disabled":"disabled"===C,"is-content-locked-temporarily-editing-as-blocks":S},L&&w&&`align${L}`,s),wrapperProps:R,isAligned:P},D=(0,c.useMemo)((()=>A),Object.values(A));return(0,c.createElement)(xi.Provider,{value:D},(0,c.createElement)(_a,{fallback:(0,c.createElement)(Rd,{className:"has-warning"},(0,c.createElement)(ba,null))},N))})),zd=window.wp.htmlEntities;var Vd=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));const Fd=[(0,c.createInterpolateElement)((0,v.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,c.createElement)("kbd",null)}),(0,c.createInterpolateElement)((0,v.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,c.createElement)("kbd",null)}),(0,c.createInterpolateElement)((0,v.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,c.createElement)("kbd",null)}),(0,v.__)("Drag files into the editor to automatically insert media blocks."),(0,v.__)("Change a block's type by pressing the block icon on the toolbar.")];var Hd=function(){const[e]=(0,c.useState)(Math.floor(Math.random()*Fd.length));return(0,c.createElement)(m.Tip,null,Fd[e])};var Gd=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));var Ud=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));var $d=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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"}));var jd=(0,c.memo)((function({icon:e,showColors:t=!1,className:n,context:o}){"block-default"===e?.src&&(e={src:$d});const r=(0,c.createElement)(m.Icon,{icon:e&&e.src?e.src:e,context:o}),l=t?{backgroundColor:e&&e.background,color:e&&e.foreground}:{};return(0,c.createElement)("span",{style:l,className:d()("block-editor-block-icon",n,{"has-colors":t})},r)}));var Wd=function({title:e,icon:t,description:n,blockType:o,className:r}){o&&($()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:e,icon:t,description:n}=o));const{parentNavBlockClientId:l}=(0,f.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockParentsByBlockName:n}=e($o);return{parentNavBlockClientId:n(t(),"core/navigation",!0)[0]}}),[]),{selectBlock:i}=(0,f.useDispatch)($o);return(0,c.createElement)("div",{className:d()("block-editor-block-card",r)},l&&(0,c.createElement)(m.Button,{onClick:()=>i(l),label:(0,v.__)("Go to parent Navigation block"),style:{minWidth:24,padding:0},icon:(0,v.isRTL)()?Gd:Ud,isSmall:!0}),(0,c.createElement)(jd,{icon:t,showColors:!0}),(0,c.createElement)("div",{className:"block-editor-block-card__content"},(0,c.createElement)("h2",{className:"block-editor-block-card__title"},e),(0,c.createElement)("span",{className:"block-editor-block-card__description"},n)))};const Kd=(0,p.createHigherOrderComponent)((e=>(0,f.withRegistry)((({useSubRegistry:t=!0,registry:n,...o})=>{if(!t)return(0,c.createElement)(e,{registry:n,...o});const[r,l]=(0,c.useState)(null);return(0,c.useEffect)((()=>{const e=(0,f.createRegistry)({},n);e.registerStore(Go,Uo),l(e)}),[n]),r?(0,c.createElement)(f.RegistryProvider,{value:r},(0,c.createElement)(e,{registry:r,...o})):null}))),"withRegistryProvider");const qd=()=>{};function Zd({clientId:e=null,value:t,selection:n,onChange:o=qd,onInput:r=qd}){const l=(0,f.useRegistry)(),{resetBlocks:i,resetSelection:s,replaceInnerBlocks:u,selectBlock:d,setHasControlledInnerBlocks:p,__unstableMarkNextChangeAsNotPersistent:m}=l.dispatch($o),{hasSelectedBlock:g,getBlockName:h,getBlocks:b,getSelectionStart:v,getSelectionEnd:_,getBlock:k}=l.select($o),y=(0,f.useSelect)((t=>!e||t($o).areInnerBlocksControlled(e)),[e]),E=(0,c.useRef)({incoming:null,outgoing:[]}),w=(0,c.useRef)(!1),S=()=>{t&&(m(),e?l.batch((()=>{p(e,!0);const n=t.map((e=>(0,a.cloneBlock)(e)));w.current&&(E.current.incoming=n),m(),u(e,n)})):(w.current&&(E.current.incoming=t),i(t)))},C=(0,c.useRef)(r),x=(0,c.useRef)(o);(0,c.useEffect)((()=>{C.current=r,x.current=o}),[r,o]),(0,c.useEffect)((()=>{if(E.current.outgoing.includes(t))E.current.outgoing[E.current.outgoing.length-1]===t&&(E.current.outgoing=[]);else if(b(e)!==t){E.current.outgoing=[];const t=g(),o=v(),r=_();if(S(),n)s(n.selectionStart,n.selectionEnd,n.initialPosition);else{const n=k(o.clientId);t&&!n?d(e):s(o,r)}}}),[t,e]),(0,c.useEffect)((()=>{y||(E.current.outgoing=[],S())}),[y]),(0,c.useEffect)((()=>{const{getSelectedBlocksInitialCaretPosition:t,isLastBlockChangePersistent:n,__unstableIsLastBlockChangeIgnored:o,areInnerBlocksControlled:r}=l.select($o);let i=b(e),a=n(),s=!1;w.current=!0;const c=l.subscribe((()=>{if(null!==e&&null===h(e))return;if(!(!e||r(e)))return;const l=n(),c=b(e),u=c!==i;if(i=c,u&&(E.current.incoming||o()))return E.current.incoming=null,void(a=l);if(u||s&&!u&&l&&!a){a=l,E.current.outgoing.push(i);(a?x.current:C.current)(i,{selection:{selectionStart:v(),selectionEnd:_(),initialPosition:t()}})}s=u}));return()=>{w.current=!1,c()}}),[l,e]),(0,c.useEffect)((()=>()=>{m(),e?(p(e,!1),m(),u(e,[])):i([])}),[])}const Yd=Kd((e=>{const{children:t,settings:n,stripExperimentalSettings:o=!1}=e,{__experimentalUpdateSettings:r}=bn((0,f.useDispatch)($o));return(0,c.useEffect)((()=>{r({...n,__internalIsInitialized:!0},o)}),[n]),Zd(e),(0,c.createElement)(xd,null,t)}));var Xd=e=>(0,c.createElement)(Yd,{...e,stripExperimentalSettings:!0},e.children);function Qd(){const{getSettings:e,hasSelectedBlock:t,hasMultiSelection:n}=(0,f.useSelect)($o),{clearSelectedBlock:o}=(0,f.useDispatch)($o),{clearBlockSelection:r}=e();return(0,p.useRefEffect)((e=>{if(r)return e.addEventListener("mousedown",l),()=>{e.removeEventListener("mousedown",l)};function l(r){(t()||n())&&r.target===e&&o()}}),[t,n,o,r])}function Jd(e){return(0,c.createElement)("div",{ref:Qd(),...e})}function ep(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l,__unstableIsFullySelected:i}=e($o);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l(),isFullSelection:i()}}function tp(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:l}=(0,f.useSelect)(ep,[]);return(0,p.useRefEffect)((r=>{const{ownerDocument:i}=r,{defaultView:a}=i;if(null==e)return;if(!o||t)return;const{length:s}=n;s<2||l&&(r.contentEditable=!0,r.focus(),a.getSelection().removeAllRanges())}),[o,t,n,r,e,l])}function np(e,t,n,o){let r,l=ta.focus.focusable.find(n);return t&&l.reverse(),l=l.slice(l.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),l.find((function(e){if(1!==e.children.length||!function(e,t){return e.closest(cd)===t.closest(cd)}(e,e.firstElementChild)||"true"!==e.firstElementChild.getAttribute("contenteditable")){if(!ta.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 op(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:o,__unstableIsFullySelected:r}=(0,f.useSelect)($o),{selectBlock:l}=(0,f.useDispatch)($o);return(0,p.useRefEffect)((i=>{let a;function s(){a=null}function c(s){if(s.defaultPrevented)return;const{keyCode:c,target:u,shiftKey:d,ctrlKey:p,altKey:m,metaKey:f}=s,g=c===Ed.UP,h=c===Ed.DOWN,b=c===Ed.LEFT,v=c===Ed.RIGHT,_=g||b,k=b||v,y=g||h,E=k||y,w=d||p||m||f,S=y?ta.isVerticalEdge:ta.isHorizontalEdge,{ownerDocument:C}=i,{defaultView:x}=C;if(!E)return;if(o()){if(d)return;if(!r())return;return s.preventDefault(),void(_?l(e()):l(t(),-1))}if(!function(e,t,n){const o=t===Ed.UP||t===Ed.DOWN,{tagName:r}=e,l=e.getAttribute("type");if(o&&!n)return"INPUT"!==r||!["date","datetime-local","month","number","range","time","week"].includes(l);if("INPUT"===r)return["button","checkbox","number","color","file","image","radio","reset","submit"].includes(l);return"TEXTAREA"!==r}(u,c,w))return;y?a||(a=(0,ta.computeCaretRect)(x)):a=null;const B=(0,ta.isRTL)(u)?!_:_,{keepCaretInsideBlock:I}=n();if(d)(function(e,t){const n=np(e,t,i);return n&&md(n)})(u,_)&&S(u,_)&&(i.contentEditable=!0,i.focus());else if(!y||!(0,ta.isVerticalEdge)(u,_)||m&&!(0,ta.isHorizontalEdge)(u,B)||I){if(k&&x.getSelection().isCollapsed&&(0,ta.isHorizontalEdge)(u,B)&&!I){const e=np(u,B,i);(0,ta.placeCaretAtHorizontalEdge)(e,_),s.preventDefault()}}else{const e=np(u,_,i,!0);e&&((0,ta.placeCaretAtVerticalEdge)(e,m?!_:_,m?void 0:a),s.preventDefault())}}return i.addEventListener("mousedown",s),i.addEventListener("keydown",c),()=>{i.removeEventListener("mousedown",s),i.removeEventListener("keydown",c)}}),[])}var rp=window.wp.keyboardShortcuts;function lp(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,f.useSelect)($o),{multiSelect:o,selectBlock:r}=(0,f.useDispatch)($o),l=(0,rp.__unstableUseShortcutEventMatch)();return(0,p.useRefEffect)((i=>{function a(a){if(!l("core/block-editor/select-all",a))return;const s=t();if(s.length<2&&!(0,ta.isEntirelySelected)(a.target))return;a.preventDefault();const[c]=s,u=n(c),d=e(u);s.length!==d.length?o(d[0],d[d.length-1]):u&&(i.ownerDocument.defaultView.getSelection().removeAllRanges(),r(u))}return i.addEventListener("keydown",a),()=>{i.removeEventListener("keydown",a)}}),[])}function ip(e,t){e.contentEditable=t,t&&e.focus()}function ap(){const{startMultiSelect:e,stopMultiSelect:t}=(0,f.useDispatch)($o),{isSelectionEnabled:n,hasMultiSelection:o,isDraggingBlocks:r}=(0,f.useSelect)($o);return(0,p.useRefEffect)((l=>{const{ownerDocument:i}=l,{defaultView:a}=i;let s,c;function u(){t(),a.removeEventListener("mouseup",u),c=a.requestAnimationFrame((()=>{if(o())return;ip(l,!1);const e=a.getSelection();if(e.rangeCount){const{commonAncestorContainer:t}=e.getRangeAt(0);s.contains(t)&&s.focus()}}))}function d({buttons:t,target:o}){r()||1===t&&"true"===o.getAttribute("contenteditable")&&n()&&(s=i.activeElement,e(),a.addEventListener("mouseup",u),ip(l,!0))}return l.addEventListener("mouseout",d),()=>{l.removeEventListener("mouseout",d),a.removeEventListener("mouseup",u),a.cancelAnimationFrame(c)}}),[e,t,n,o])}function sp(e,t){e.contentEditable!==String(t)&&(e.contentEditable=t),t&&e.focus()}function cp(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,f.useDispatch)($o),{getBlockParents:o,getBlockSelectionStart:r}=(0,f.useSelect)($o);return(0,p.useRefEffect)((n=>{const{ownerDocument:l}=n,{defaultView:i}=l;function a(l){const a=i.getSelection();if(!a.rangeCount)return;const s=l.shiftKey&&"mouseup"===l.type;if(a.isCollapsed&&!s)return void sp(n,!1);let c=md(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE||0===n?t:t.childNodes[n-1]}(a)),u=md(function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE||n===t.childNodes.length?t:t.childNodes[n]}(a));if(s){const e=r(),t=md(l.target),n=t!==u;(c===u&&a.isCollapsed||!u||n)&&(u=t),c!==e&&(c=e)}if(void 0===c&&void 0===u)return void sp(n,!1);if(c===u)t(c);else{const t=[...o(c),c],n=[...o(u),u],r=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,n);e(t[r],n[r])}}function s(){l.addEventListener("selectionchange",a),i.addEventListener("mouseup",a)}function c(){l.removeEventListener("selectionchange",a),i.removeEventListener("mouseup",a)}function u(){c(),s()}return s(),n.addEventListener("focusin",u),()=>{c(),n.removeEventListener("focusin",u)}}),[e,t,n,o])}function up(){const{selectBlock:e}=(0,f.useDispatch)($o),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,f.useSelect)($o);return(0,p.useRefEffect)((r=>{function l(l){if(!t()||0!==l.button)return;const i=n(),a=md(l.target);l.shiftKey?i!==a&&(r.contentEditable=!0,r.focus()):o()&&e(a)}return r.addEventListener("mousedown",l),()=>{r.removeEventListener("mousedown",l)}}),[e,t,n,o])}function dp(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:o}=(0,f.useSelect)($o),{replaceBlocks:r,__unstableSplitSelection:l,removeBlocks:i,__unstableDeleteSelection:s,__unstableExpandSelection:c}=(0,f.useDispatch)($o);return(0,p.useRefEffect)((u=>{function d(e){"true"===u.contentEditable&&e.preventDefault()}function p(d){d.defaultPrevented||o()&&(d.keyCode===Ed.ENTER?(u.contentEditable=!1,d.preventDefault(),e()?r(t(),(0,a.createBlock)((0,a.getDefaultBlockName)())):l()):d.keyCode===Ed.BACKSPACE||d.keyCode===Ed.DELETE?(u.contentEditable=!1,d.preventDefault(),e()?i(t()):n()?s(d.keyCode===Ed.DELETE):c()):1!==d.key.length||d.metaKey||d.ctrlKey||(u.contentEditable=!1,n()?s(d.keyCode===Ed.DELETE):(d.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges())))}function m(e){o()&&(u.contentEditable=!1,n()?s():(e.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges()))}return u.addEventListener("beforeinput",d),u.addEventListener("keydown",p),u.addEventListener("compositionstart",m),()=>{u.removeEventListener("beforeinput",d),u.removeEventListener("keydown",p),u.removeEventListener("compositionstart",m)}}),[])}function pp(){const[e,t,n]=function(){const e=(0,c.useRef)(),t=(0,c.useRef)(),n=(0,c.useRef)(),o=(0,c.useRef)(),{hasMultiSelection:r,getSelectedBlockClientId:l,getBlockCount:i}=(0,f.useSelect)($o),{setNavigationMode:a}=(0,f.useDispatch)($o),s=(0,f.useSelect)((e=>e($o).isNavigationMode()),[])?void 0:"0",u=(0,c.useRef)();function d(t){if(u.current)u.current=null;else if(r())e.current.focus();else if(l())o.current.focus();else{a(!0);const n=e.current.ownerDocument===t.target.ownerDocument?e.current:e.current.ownerDocument.defaultView.frameElement,o=t.target.compareDocumentPosition(n)&t.target.DOCUMENT_POSITION_FOLLOWING,r=ta.focus.tabbable.find(e.current);r.length&&(o?r[0]:r[r.length-1]).focus()}}const m=(0,c.createElement)("div",{ref:t,tabIndex:s,onFocus:d}),g=(0,c.createElement)("div",{ref:n,tabIndex:s,onFocus:d}),h=(0,p.useRefEffect)((s=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===Ed.ESCAPE&&!r())return e.preventDefault(),void a(!0);if(e.keyCode!==Ed.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===s&&a(!0));const c=ta.focus.tabbable[i](e.target);if((0,ta.isFormElement)(c)&&((e,t)=>{const n=t.closest("[data-block]")?.getAttribute("data-block"),o=n===l(),r=e.contains(t);return o||r})(e.target.closest("[data-block]"),c))return;const d=o?t:n;u.current=!0,d.current.focus({preventScroll:!0})}function d(e){o.current=e.target;const{ownerDocument:t}=s;e.relatedTarget||t.activeElement!==t.body||0!==i()||s.focus()}function p(o){if(o.keyCode!==Ed.TAB)return;if("region"===o.target?.getAttribute("role"))return;if(e.current===o.target)return;const r=o.shiftKey?"findPrevious":"findNext",l=ta.focus.tabbable[r](o.target);l!==t.current&&l!==n.current||(o.preventDefault(),l.focus({preventScroll:!0}))}const{ownerDocument:m}=s,{defaultView:f}=m;return f.addEventListener("keydown",p),s.addEventListener("keydown",c),s.addEventListener("focusout",d),()=>{f.removeEventListener("keydown",p),s.removeEventListener("keydown",c),s.removeEventListener("focusout",d)}}),[]);return[m,(0,p.useMergeRefs)([e,h]),g]}(),o=(0,f.useSelect)((e=>e($o).hasMultiSelection()),[]);return[e,(0,p.useMergeRefs)([t,dp(),ap(),cp(),up(),tp(),lp(),op(),(0,p.useRefEffect)((e=>{if(e.tabIndex=0,e.contentEditable=o,o)return e.classList.add("has-multi-selection"),e.setAttribute("aria-label",(0,v.__)("Multiple selected blocks")),()=>{e.classList.remove("has-multi-selection"),e.removeAttribute("aria-label")}}),[o])]),n]}var mp=(0,c.forwardRef)((function({children:e,...t},n){const[o,r,l]=pp();return(0,c.createElement)(c.Fragment,null,o,(0,c.createElement)("div",{...t,ref:(0,p.useMergeRefs)([r,n]),className:d()(t.className,"block-editor-writing-flow")},e),l)}));function fp({contentRef:e,children:t,tabIndex:n=0,scale:o=1,frameSize:r=0,expand:l=!1,readonly:i,forwardedRef:a,...s}){const{styles:u="",scripts:g=""}=(0,f.useSelect)((e=>e($o).getSettings().__unstableResolvedAssets),[]),[h,b]=(0,c.useState)(),[_,k]=(0,c.useState)([]),y=(0,c.useMemo)((()=>Array.from(document.styleSheets).reduce(((e,t)=>{try{t.cssRules}catch(t){return e}const{ownerNode:n,cssRules:o}=t;if(null===n)return e;if(!o)return e;if("wp-reset-editor-styles-css"===n.id)return e;if(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}),[])),[]),E=Qd(),[w,S,C]=pp(),[x,{height:B}]=(0,p.useResizeObserver)(),I=(0,p.useRefEffect)((e=>{let t;function n(e){e.preventDefault()}function o(){const{contentDocument:o,ownerDocument:r}=e,{documentElement:l}=o;t=o,function(e){const{defaultView:t}=e,{frameElement:n}=t;function o(e){const o=Object.getPrototypeOf(e).constructor.name,r=window[o],l={};for(const t in e)l[t]=e[t];if(e instanceof t.MouseEvent){const e=n.getBoundingClientRect();l.clientX+=e.left,l.clientY+=e.top}const i=new r(e.type,l);!n.dispatchEvent(i)&&e.preventDefault()}const r=["dragover","mousemove"];for(const t of r)e.addEventListener(t,o)}(o),E(l),k(Array.from(r.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),o.dir=r.dir;for(const e of y)o.getElementById(e.id)||(o.head.appendChild(e.cloneNode(!0)),console.warn(`${e.id} was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,e));t.addEventListener("dragover",n,!1),t.addEventListener("drop",n,!1)}return e._load=()=>{b(e.contentDocument)},e.addEventListener("load",o),()=>{e.removeEventListener("load",o),t?.removeEventListener("dragover",n),t?.removeEventListener("drop",n)}}),[]),T=(0,p.useDisabled)({isDisabled:!i}),M=(0,p.useMergeRefs)([e,E,S,T]),P=`<!doctype html>\n<html>\n\t<head>\n\t\t<script>window.frameElement._load()<\/script>\n\t\t<style>html{height:auto!important;min-height:100%;}body{margin:0}</style>\n\t\t${u}\n\t\t${g}\n\t</head>\n\t<body>\n\t\t<script>document.currentScript.parentElement.remove()<\/script>\n\t</body>\n</html>`,[N,L]=(0,c.useMemo)((()=>{const e=URL.createObjectURL(new window.Blob([P],{type:"text/html"}));return[e,()=>URL.revokeObjectURL(e)]}),[P]);(0,c.useEffect)((()=>L),[L]);const R=B*(1-o)/2;return(0,c.createElement)(c.Fragment,null,n>=0&&w,(0,c.createElement)("iframe",{...s,style:{...s.style,height:l?B:s.style?.height,marginTop:1!==o?-R+r:s.style?.marginTop,marginBottom:1!==o?-R+r:s.style?.marginBottom,transform:1!==o?`scale( ${o} )`:s.style?.transform,transition:"all .3s"},ref:(0,p.useMergeRefs)([a,I]),tabIndex:n,src:N,title:(0,v.__)("Editor canvas")},h&&(0,c.createPortal)((0,c.createElement)("body",{ref:M,className:d()("block-editor-iframe__body","editor-styles-wrapper",..._)},x,(0,c.createElement)(m.__experimentalStyleProvider,{document:h},t)),h.documentElement)),n>=0&&C)}var gp=(0,c.forwardRef)((function(e,t){return(0,f.useSelect)((e=>e($o).getSettings().__internalIsInitialized),[])?(0,c.createElement)(fp,{...e,forwardedRef:t}):null})),hp={grad:.9,turn:360,rad:360/(2*Math.PI)},bp=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},vp=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},_p=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},kp=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},yp=function(e){return{r:_p(e.r,0,255),g:_p(e.g,0,255),b:_p(e.b,0,255),a:_p(e.a)}},Ep=function(e){return{r:vp(e.r),g:vp(e.g),b:vp(e.b),a:vp(e.a,3)}},wp=/^#([0-9a-f]{3,8})$/i,Sp=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Cp=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=Math.max(t,n,o),i=l-Math.min(t,n,o),a=i?l===t?(n-o)/i:l===n?2+(o-t)/i:4+(t-n)/i:0;return{h:60*(a<0?a+6:a),s:l?i/l*100:0,v:l/255*100,a:r}},xp=function(e){var t=e.h,n=e.s,o=e.v,r=e.a;t=t/360*6,n/=100,o/=100;var l=Math.floor(t),i=o*(1-n),a=o*(1-(t-l)*n),s=o*(1-(1-t+l)*n),c=l%6;return{r:255*[o,a,i,i,s,o][c],g:255*[s,o,o,a,i,i][c],b:255*[i,i,s,o,o,a][c],a:r}},Bp=function(e){return{h:kp(e.h),s:_p(e.s,0,100),l:_p(e.l,0,100),a:_p(e.a)}},Ip=function(e){return{h:vp(e.h),s:vp(e.s),l:vp(e.l),a:vp(e.a,3)}},Tp=function(e){return xp((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},Mp=function(e){return{h:(t=Cp(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},Pp=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Np=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Lp=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Rp=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ap={string:[[function(e){var t=wp.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?vp(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?vp(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Lp.exec(e)||Rp.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:yp({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=Pp.exec(e)||Np.exec(e);if(!t)return null;var n,o,r=Bp({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(hp[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return Tp(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=void 0===r?1:r;return bp(t)&&bp(n)&&bp(o)?yp({r:Number(t),g:Number(n),b:Number(o),a:Number(l)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,r=e.a,l=void 0===r?1:r;if(!bp(t)||!bp(n)||!bp(o))return null;var i=Bp({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return Tp(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!bp(t)||!bp(n)||!bp(o))return null;var i=function(e){return{h:kp(e.h),s:_p(e.s,0,100),v:_p(e.v,0,100),a:_p(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return xp(i)},"hsv"]]},Dp=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]},Op=function(e){return"string"==typeof e?Dp(e.trim(),Ap.string):"object"==typeof e&&null!==e?Dp(e,Ap.object):[null,void 0]},zp=function(e,t){var n=Mp(e);return{h:n.h,s:_p(n.s+100*t,0,100),l:n.l,a:n.a}},Vp=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Fp=function(e,t){var n=Mp(e);return{h:n.h,s:n.s,l:_p(n.l+100*t,0,100),a:n.a}},Hp=function(){function e(e){this.parsed=Op(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 vp(Vp(this.rgba),2)},e.prototype.isDark=function(){return Vp(this.rgba)<.5},e.prototype.isLight=function(){return Vp(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=Ep(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?Sp(vp(255*r)):"","#"+Sp(t)+Sp(n)+Sp(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return Ep(this.rgba)},e.prototype.toRgbString=function(){return t=(e=Ep(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 Ip(Mp(this.rgba))},e.prototype.toHslString=function(){return t=(e=Ip(Mp(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=Cp(this.rgba),{h:vp(e.h),s:vp(e.s),v:vp(e.v),a:vp(e.a,3)};var e},e.prototype.invert=function(){return Gp({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),Gp(zp(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Gp(zp(this.rgba,-e))},e.prototype.grayscale=function(){return Gp(zp(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Gp(Fp(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Gp(Fp(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?Gp({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):vp(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=Mp(this.rgba);return"number"==typeof e?Gp({h:e,s:t.s,l:t.l,a:t.a}):vp(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Gp(e).toHex()},e}(),Gp=function(e){return e instanceof Hp?e:new Hp(e)},Up=[],$p=function(e){e.forEach((function(e){Up.indexOf(e)<0&&(e(Hp,Ap),Up.push(e))}))};function jp(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},o={};for(var r in n)o[n[r]]=r;var l={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var r,i,a=o[this.toHex()];if(a)return a;if(null==t?void 0:t.closest){var s=this.toRgb(),c=1/0,u="black";if(!l.length)for(var d in n)l[d]=new e(n[d]).toRgb();for(var p in n){var m=(r=s,i=l[p],Math.pow(r.r-i.r,2)+Math.pow(r.g-i.g,2)+Math.pow(r.b-i.b,2));m<c&&(c=m,u=p)}return u}},t.string.push([function(t){var o=t.toLowerCase(),r="transparent"===o?"#0000":n[o];return r?new e(r).toRgb():null},"name"])}var Wp=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Kp=function(e){return.2126*Wp(e.r)+.7152*Wp(e.g)+.0722*Wp(e.b)};function qp(e){e.prototype.luminance=function(){return e=Kp(this.rgba),void 0===(t=2)&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0;var e,t,n},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var n,o,r,l,i,a,s,c=t instanceof e?t:new e(t);return l=this.rgba,i=c.toRgb(),n=(a=Kp(l))>(s=Kp(i))?(a+.05)/(s+.05):(s+.05)/(a+.05),void 0===(o=2)&&(o=0),void 0===r&&(r=Math.pow(10,o)),Math.floor(r*n)/r+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(i=void 0===(l=(n=t).size)?"normal":l,"AAA"===(r=void 0===(o=n.level)?"AA":o)&&"normal"===i?7:"AA"===r&&"large"===i?3:4.5);var n,o,r,l,i}}var Zp=n(3124),Yp=n.n(Zp);const Xp=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Qp(e,t){t=t||{};let n=1,o=1;function r(e){const t=e.match(/\n/g);t&&(n+=t.length);const r=e.lastIndexOf("\n");o=~r?e.length-r:o+e.length}function l(){const e={line:n,column:o};return function(t){return t.position=new i(e),m(),t}}function i(e){this.start=e,this.end={line:n,column:o},this.source=t.source}i.prototype.content=e;const a=[];function s(r){const l=new Error(t.source+":"+n+":"+o+": "+r);if(l.reason=r,l.filename=t.source,l.line=n,l.column=o,l.source=e,!t.silent)throw l;a.push(l)}function c(){return p(/^{\s*/)}function u(){return p(/^}/)}function d(){let t;const n=[];for(m(),f(n);e.length&&"}"!==e.charAt(0)&&(t=S()||C());)!1!==t&&(n.push(t),f(n));return n}function p(t){const n=t.exec(e);if(!n)return;const o=n[0];return r(o),e=e.slice(o.length),n}function m(){p(/^\s*/)}function f(e){let t;for(e=e||[];t=g();)!1!==t&&e.push(t);return e}function g(){const t=l();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return s("End of comment missing");const i=e.slice(2,n-2);return o+=2,r(i),e=e.slice(n),o+=2,t({type:"comment",comment:i})}function h(){const e=p(/^([^{]+)/);if(e)return Jp(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function b(){const e=l();let t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;if(t=Jp(t[0]),!p(/^:\s*/))return s("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(Xp,""),value:n?Jp(n[0]).replace(Xp,""):""});return p(/^[;\s]*/),o}function v(){const e=[];if(!c())return s("missing '{'");let t;for(f(e);t=b();)!1!==t&&(e.push(t),f(e));return u()?e:s("missing '}'")}function _(){let e;const t=[],n=l();for(;e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:v()})}const k=w("import"),y=w("charset"),E=w("namespace");function w(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){const n=l(),o=p(t);if(!o)return;const r={type:e};return r[e]=o[1].trim(),n(r)}}function S(){if("@"===e[0])return function(){const e=l();let t=p(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=p(/^([-\w]+)\s*/),!t)return s("@keyframes missing name");const o=t[1];if(!c())return s("@keyframes missing '{'");let r,i=f();for(;r=_();)i.push(r),i=i.concat(f());return u()?e({type:"keyframes",name:o,vendor:n,keyframes:i}):s("@keyframes missing '}'")}()||function(){const e=l(),t=p(/^@media *([^{]+)/);if(!t)return;const n=Jp(t[1]);if(!c())return s("@media missing '{'");const o=f().concat(d());return u()?e({type:"media",media:n,rules:o}):s("@media missing '}'")}()||function(){const e=l(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:Jp(t[1]),media:Jp(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=Jp(t[1]);if(!c())return s("@supports missing '{'");const o=f().concat(d());return u()?e({type:"supports",supports:n,rules:o}):s("@supports missing '}'")}()||k()||y()||E()||function(){const e=l(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=Jp(t[1]),o=Jp(t[2]);if(!c())return s("@document missing '{'");const r=f().concat(d());return u()?e({type:"document",document:o,vendor:n,rules:r}):s("@document missing '}'")}()||function(){const e=l();if(!p(/^@page */))return;const t=h()||[];if(!c())return s("@page missing '{'");let n,o=f();for(;n=b();)o.push(n),o=o.concat(f());return u()?e({type:"page",selectors:t,declarations:o}):s("@page missing '}'")}()||function(){const e=l();if(!p(/^@host\s*/))return;if(!c())return s("@host missing '{'");const t=f().concat(d());return u()?e({type:"host",rules:t}):s("@host missing '}'")}()||function(){const e=l();if(!p(/^@font-face\s*/))return;if(!c())return s("@font-face missing '{'");let t,n=f();for(;t=b();)n.push(t),n=n.concat(f());return u()?e({type:"font-face",declarations:n}):s("@font-face missing '}'")}()}function C(){const e=l(),t=h();return t?(f(),e({type:"rule",selectors:t,declarations:v()})):s("selector missing")}return em(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:a}}}())}function Jp(e){return e?e.replace(/^\s+|\s+$/g,""):""}function em(e,t){const n=e&&"string"==typeof e.type,o=n?e:t;for(const t in e){const n=e[t];Array.isArray(n)?n.forEach((function(e){em(e,o)})):n&&"object"==typeof n&&em(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var tm=n(8575),nm=n.n(tm),om=rm;function rm(e){this.options=e||{}}rm.prototype.emit=function(e){return e},rm.prototype.visit=function(e){return this[e.type](e)},rm.prototype.mapVisit=function(e,t){let n="";t=t||"";for(let o=0,r=e.length;o<r;o++)n+=this.visit(e[o]),t&&o<r-1&&(n+=this.emit(t));return n};var lm=im;function im(e){om.call(this,e)}nm()(im,om),im.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},im.prototype.comment=function(e){return this.emit("",e.position)},im.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},im.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},im.prototype.document=function(e){const t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},im.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},im.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},im.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},im.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},im.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},im.prototype.page=function(e){const t=e.selectors.length?e.selectors.join(", "):"";return this.emit("@page "+t,e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},im.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},im.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},im.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},im.prototype.rule=function(e){const t=e.declarations;return t.length?this.emit(e.selectors.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}"):""},im.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};var am=sm;function sm(e){e=e||{},om.call(this,e),this.indentation=e.indent}nm()(sm,om),sm.prototype.compile=function(e){return this.stylesheet(e)},sm.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},sm.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},sm.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},sm.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},sm.prototype.document=function(e){const t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},sm.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},sm.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},sm.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},sm.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.keyframes,"\n")+this.emit(this.indent(-1)+"}")},sm.prototype.keyframe=function(e){const t=e.declarations;return this.emit(this.indent())+this.emit(e.values.join(", "),e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(t,"\n")+this.emit(this.indent(-1)+"\n"+this.indent()+"}\n")},sm.prototype.page=function(e){const t=e.selectors.length?e.selectors.join(", ")+" ":"";return this.emit("@page "+t,e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},sm.prototype["font-face"]=function(e){return this.emit("@font-face ",e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},sm.prototype.host=function(e){return this.emit("@host",e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},sm.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},sm.prototype.rule=function(e){const t=this.indent(),n=e.declarations;return n.length?this.emit(e.selectors.map((function(e){return t+e})).join(",\n"),e.position)+this.emit(" {\n")+this.emit(this.indent(1))+this.mapVisit(n,"\n")+this.emit(this.indent(-1))+this.emit("\n"+this.indent()+"}"):""},sm.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},sm.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};var cm=function(e,t){try{const n=Qp(e),o=Yp().map(n,(function(e){if(!e)return e;const n=t(e);return this.update(n)}));return function(e,t){return((t=t||{}).compress?new lm(t):new am(t)).compile(e)}(o)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}};function um(e){return 0!==e.value.indexOf("data:")&&0!==e.value.indexOf("#")&&(t=e.value,!/^\/(?!\/)/.test(t)&&!function(e){return/^(?:https?:)?\/\//.test(e)}(e.value));var t}function dm(e,t){return new URL(e,t).toString()}var pm=e=>t=>{if("declaration"===t.type){const l=function(e){const t=/url\((\s*)(['"]?)(.+?)\2(\s*)\)/g;let n;const o=[];for(;null!==(n=t.exec(e));){const e={source:n[0],before:n[1],quote:n[2],value:n[3],after:n[4]};um(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+dm(e.value,r)+e.quote+e.after+")"})));return{...t,value:(n=t.value,o=l,o.forEach((e=>{n=n.replace(e.source,e.newUrl)})),n)}}var n,o,r;return t};const mm=/^(body|html|:root).*$/;var fm=(e,t=[])=>n=>{const o=n=>t.includes(n.trim())?n:n.match(mm)?n.replace(/^(body|html|:root)/,e):e+" "+n;return"rule"===n.type?{...n,selectors:n.selectors.map(o)}:n};var gm=(e,t="")=>Object.values(null!=e?e:[]).map((({css:e,baseURL:n})=>{const o=[];return t&&o.push(fm(t)),n&&o.push(pm(n)),o.length?cm(e,(0,p.compose)(o)):e}));const hm=".editor-styles-wrapper";function bm(e){return(0,c.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(hm);let l;if(r)l=n.getComputedStyle(r,null).getPropertyValue("background-color");else{const e=t.createElement("div");e.classList.add("editor-styles-wrapper"),o.appendChild(e),l=n.getComputedStyle(e,null).getPropertyValue("background-color"),o.removeChild(e)}const i=Gp(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function vm({styles:e}){const t=(0,c.useMemo)((()=>Object.values(null!=e?e:[])),[e]),n=(0,c.useMemo)((()=>gm(t.filter((e=>e?.css)),hm)),[t]),o=(0,c.useMemo)((()=>t.filter((e=>"svgs"===e.__unstableType)).map((e=>e.assets)).join("")),[t]);return(0,c.createElement)(c.Fragment,null,(0,c.createElement)("style",{ref:bm(t)}),n.map(((e,t)=>(0,c.createElement)("style",{key:t},e))),(0,c.createElement)(m.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:o}}))}let _m;$p([jp,qp]);const km=2e3;function ym({viewportWidth:e,containerWidth:t,minHeight:n,additionalStyles:o=[]}){e||(e=t);const[r,{height:l}]=(0,p.useResizeObserver)(),{styles:i}=(0,f.useSelect)((e=>({styles:e($o).getSettings().styles})),[]),a=(0,c.useMemo)((()=>i?[...i,{css:"body{height:auto;overflow:hidden;border:none;padding:0;}",__unstableType:"presets"},...o]:i),[i,o]);_m=_m||(0,p.pure)(wv);const s=t/e;return(0,c.createElement)(m.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${s})`,height:l*s,maxHeight:l>km?km*s:void 0,minHeight:n}},(0,c.createElement)(gp,{contentRef:(0,p.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:l,pointerEvents:"none",maxHeight:km,minHeight:0!==s&&s<1&&n?n/s:n}},(0,c.createElement)(vm,{styles:a}),r,(0,c.createElement)(_m,{renderAppender:!1})))}function Em(e){const[t,{width:n}]=(0,p.useResizeObserver)();return(0,c.createElement)(c.Fragment,null,(0,c.createElement)("div",{style:{position:"relative",width:"100%",height:0}},t),(0,c.createElement)("div",{className:"block-editor-block-preview__container"},!!n&&(0,c.createElement)(ym,{...e,containerWidth:n})))}var wm=(0,c.memo)((function({blocks:e,viewportWidth:t=1200,minHeight:n,additionalStyles:o=[],__experimentalMinHeight:r,__experimentalPadding:l}){r&&(n=r,$()("The __experimentalMinHeight prop",{since:"6.2",version:"6.4",alternative:"minHeight"})),l&&(o=[...o,{css:`body { padding: ${l}px; }`}],$()("The __experimentalPadding prop of BlockPreview",{since:"6.2",version:"6.4",alternative:"additionalStyles"}));const i=(0,f.useSelect)((e=>e($o).getSettings()),[]),a=(0,c.useMemo)((()=>({...i,__unstableIsPreviewMode:!0})),[i]),s=(0,c.useMemo)((()=>Array.isArray(e)?e:[e]),[e]);return e&&0!==e.length?(0,c.createElement)(Yd,{value:s,settings:a},(0,c.createElement)(Em,{viewportWidth:t,minHeight:n,additionalStyles:o})):null}));function Sm({blocks:e,props:t={},layout:n}){const o=(0,f.useSelect)((e=>e($o).getSettings()),[]),r=(0,c.useMemo)((()=>({...o,__unstableIsPreviewMode:!0})),[o]),l=(0,p.useDisabled)(),i=(0,p.useMergeRefs)([t.ref,l]),a=(0,c.useMemo)((()=>Array.isArray(e)?e:[e]),[e]),s=(0,c.createElement)(Yd,{value:a,settings:r},(0,c.createElement)(Cv,{renderAppender:!1,layout:n}));return{...t,ref:i,className:d()(t.className,"block-editor-block-preview__live-content","components-disabled"),children:e?.length?s:null}}var Cm=function({item:e}){var t;const{name:n,title:o,icon:r,description:l,initialAttributes:i,example:s}=e,u=(0,a.isReusableBlock)(e);return(0,c.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,c.createElement)("div",{className:"block-editor-inserter__preview"},u||s?(0,c.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,c.createElement)(wm,{blocks:s?(0,a.getBlockFromExample)(n,{attributes:{...s.attributes,...i},innerBlocks:s.innerBlocks}):(0,a.createBlock)(n,i),viewportWidth:null!==(t=s?.viewportWidth)&&void 0!==t?t:500,additionalStyles:[{css:"body { padding: 16px; }"}]})):(0,c.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,v.__)("No Preview Available."))),!u&&(0,c.createElement)(Wd,{title:o,icon:r,description:l}))};var xm=(0,c.createContext)();var Bm=(0,c.forwardRef)((function({isFirst:e,as:t,children:n,...o},r){const l=(0,c.useContext)(xm);return(0,c.createElement)(m.__unstableCompositeItem,{ref:r,state:l,role:"option",focusable:!0,...o},(o=>{const r={...o,tabIndex:e?0:o.tabIndex};return t?(0,c.createElement)(t,{...r},n):"function"==typeof n?n(r):(0,c.createElement)(m.Button,{...r},n)}))}));var Im=(0,c.createElement)(F.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function Tm({count:e,icon:t,isPattern:n}){const o=n&&(0,v.__)("Pattern");return(0,c.createElement)("div",{className:"block-editor-block-draggable-chip-wrapper"},(0,c.createElement)("div",{className:"block-editor-block-draggable-chip","data-testid":"block-draggable-chip"},(0,c.createElement)(m.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},(0,c.createElement)(m.FlexItem,null,t?(0,c.createElement)(jd,{icon:t}):o||(0,v.sprintf)((0,v._n)("%d block","%d blocks",e),e)),(0,c.createElement)(m.FlexItem,null,(0,c.createElement)(jd,{icon:Im})))))}var Mm=({isEnabled:e,blocks:t,icon:n,children:o,isPattern:r})=>{const l={type:"inserter",blocks:t};return(0,c.createElement)(m.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:l,onDragStart:e=>{e.dataTransfer.setData("text/html",(0,a.serialize)(t))},__experimentalDragComponent:(0,c.createElement)(Tm,{count:t.length,icon:n,isPattern:r})},(({onDraggableStart:t,onDraggableEnd:n})=>o({draggable:e,onDragStart:e?t:void 0,onDragEnd:e?n:void 0})))};var Pm=(0,c.memo)((function({className:e,isFirst:t,item:n,onSelect:o,onHover:r,isDraggable:l,...i}){const s=(0,c.useRef)(!1),u=n.icon?{backgroundColor:n.icon.background,color:n.icon.foreground}:{},p=(0,c.useMemo)((()=>[(0,a.createBlock)(n.name,n.initialAttributes,(0,a.createBlocksFromInnerBlocksTemplate)(n.innerBlocks))]),[n.name,n.initialAttributes,n.initialAttributes]),f=(0,a.isReusableBlock)(n)||(0,a.isTemplatePart)(n);return(0,c.createElement)(Mm,{isEnabled:l&&!n.disabled,blocks:p,icon:n.icon},(({draggable:l,onDragStart:a,onDragEnd:p})=>(0,c.createElement)("div",{className:d()("block-editor-block-types-list__list-item",{"is-synced":f}),draggable:l,onDragStart:e=>{s.current=!0,a&&(r(null),a(e))},onDragEnd:e=>{s.current=!1,p&&p(e)}},(0,c.createElement)(Bm,{isFirst:t,className:d()("block-editor-block-types-list__item",e),disabled:n.isDisabled,onClick:e=>{e.preventDefault(),o(n,(0,Ed.isAppleOS)()?e.metaKey:e.ctrlKey),r(null)},onKeyDown:e=>{const{keyCode:t}=e;t===Ed.ENTER&&(e.preventDefault(),o(n,(0,Ed.isAppleOS)()?e.metaKey:e.ctrlKey),r(null))},onMouseEnter:()=>{s.current||r(n)},onMouseLeave:()=>r(null),...i},(0,c.createElement)("span",{className:"block-editor-block-types-list__item-icon",style:u},(0,c.createElement)(jd,{icon:n.icon,showColors:!0})),(0,c.createElement)("span",{className:"block-editor-block-types-list__item-title"},(0,c.createElement)(m.__experimentalTruncate,{numberOfLines:3},n.title))))))}));var Nm=(0,c.forwardRef)((function(e,t){const[n,o]=(0,c.useState)(!1);return(0,c.useEffect)((()=>{n&&(0,Mn.speak)((0,v.__)("Use left and right arrow keys to move through blocks"))}),[n]),(0,c.createElement)("div",{ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{o(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&o(!1)},...e})}));var Lm=(0,c.forwardRef)((function(e,t){const n=(0,c.useContext)(xm);return(0,c.createElement)(m.__unstableCompositeGroup,{state:n,role:"presentation",ref:t,...e})}));var Rm=function({items:e=[],onSelect:t,onHover:n=(()=>{}),children:o,label:r,isDraggable:l=!0}){return(0,c.createElement)(Nm,{className:"block-editor-block-types-list","aria-label":r},function(e,t){const n=[];for(let o=0,r=e.length;o<r;o+=t)n.push(e.slice(o,o+t));return n}(e,3).map(((e,o)=>(0,c.createElement)(Lm,{key:o},e.map(((e,r)=>(0,c.createElement)(Pm,{key:e.id,item:e,className:(0,a.getBlockMenuDefaultClassName)(e.id),onSelect:t,onHover:n,isDraggable:l&&!e.isDisabled,isFirst:0===o&&0===r})))))),o)};var Am=function({title:e,icon:t,children:n}){return(0,c.createElement)(c.Fragment,null,(0,c.createElement)("div",{className:"block-editor-inserter__panel-header"},(0,c.createElement)("h2",{className:"block-editor-inserter__panel-title"},e),(0,c.createElement)(m.Icon,{icon:t})),(0,c.createElement)("div",{className:"block-editor-inserter__panel-content"},n))};var Dm=(e,t)=>{const{categories:n,collections:o,items:r}=(0,f.useSelect)((t=>{const{getInserterItems:n}=t($o),{getCategories:o,getCollections:r}=t(a.store);return{categories:o(),collections:r(),items:n(e)}}),[e]);return[r,n,o,(0,c.useCallback)((({name:e,initialAttributes:n,innerBlocks:o},r)=>{const l=(0,a.createBlock)(e,n,(0,a.createBlocksFromInnerBlocksTemplate)(o));t(l,void 0,r)}),[t])]};var Om=function({children:e}){const t=(0,m.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,c.createElement)(xm.Provider,{value:t},e)};const zm=[];var Vm=function({rootClientId:e,onInsert:t,onHover:n,showMostUsedBlocks:o}){const[r,l,i,a]=Dm(e,t),s=(0,c.useMemo)((()=>K(r,"frecency","desc").slice(0,6)),[r]),u=(0,c.useMemo)((()=>r.filter((e=>!e.category))),[r]),d=(0,c.useMemo)((()=>(0,p.pipe)((e=>e.filter((e=>e.category&&"reusable"!==e.category))),(e=>e.reduce(((e,t)=>{const{category:n}=t;return e[n]||(e[n]=[]),e[n].push(t),e}),{})))(r)),[r]),m=(0,c.useMemo)((()=>{const e={...i};return Object.keys(i).forEach((t=>{e[t]=r.filter((e=>(e=>e.name.split("/")[0])(e)===t)),0===e[t].length&&delete e[t]})),e}),[r,i]);(0,c.useEffect)((()=>()=>n(null)),[]);const f=(0,p.useAsyncList)(l),g=l.length===f.length,h=(0,c.useMemo)((()=>Object.entries(i)),[i]),b=(0,p.useAsyncList)(g?h:zm);return(0,c.createElement)(Om,null,(0,c.createElement)("div",null,o&&!!s.length&&(0,c.createElement)(Am,{title:(0,v._x)("Most used","blocks")},(0,c.createElement)(Rm,{items:s,onSelect:a,onHover:n,label:(0,v._x)("Most used","blocks")})),f.map((e=>{const t=d[e.slug];return t&&t.length?(0,c.createElement)(Am,{key:e.slug,title:e.title,icon:e.icon},(0,c.createElement)(Rm,{items:t,onSelect:a,onHover:n,label:e.title})):null})),g&&u.length>0&&(0,c.createElement)(Am,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,v.__)("Uncategorized")},(0,c.createElement)(Rm,{items:u,onSelect:a,onHover:n,label:(0,v.__)("Uncategorized")})),b.map((([e,t])=>{const o=m[e];return o&&o.length?(0,c.createElement)(Am,{key:e,title:t.title,icon:t.icon},(0,c.createElement)(Rm,{items:o,onSelect:a,onHover:n,label:t.title})):null}))))},Fm=window.wp.notices;const Hm={name:"custom",label:(0,v.__)("My patterns"),description:(0,v.__)("Custom patterns add by site users")};var Gm=(e,t)=>{const{patternCategories:n,patterns:o}=(0,f.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e($o);return{patterns:n(t),patternCategories:o().__experimentalBlockPatternCategories}}),[t]),r=(0,c.useMemo)((()=>[...n,Hm]),[n]),{createSuccessNotice:l}=(0,f.useDispatch)(Fm.store),i=(0,c.useCallback)(((t,n)=>{e((null!=n?n:[]).map((e=>(0,a.cloneBlock)(e))),t.name),l((0,v.sprintf)((0,v.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[l,e]);return[o,r,i]};const Um=({showTooltip:e,title:t,children:n})=>e?(0,c.createElement)(m.Tooltip,{text:t},n):(0,c.createElement)(c.Fragment,null,n);function $m({isDraggable:e,pattern:t,onClick:n,onHover:o,composite:r,showTooltip:l}){const[i,a]=(0,c.useState)(!1),{blocks:s,viewportWidth:u}=t,d=`block-editor-block-patterns-list__item-description-${(0,p.useInstanceId)($m)}`;return(0,c.createElement)(Mm,{isEnabled:e,blocks:s,isPattern:!!t},(({draggable:e,onDragStart:p,onDragEnd:f})=>(0,c.createElement)("div",{className:"block-editor-block-patterns-list__list-item",draggable:e,onDragStart:e=>{a(!0),p&&(o?.(null),p(e))},onDragEnd:e=>{a(!1),f&&f(e)}},(0,c.createElement)(Um,{showTooltip:l,title:t.title},(0,c.createElement)(m.__unstableCompositeItem,{role:"option",as:"div",...r,className:"block-editor-block-patterns-list__item",onClick:()=>{n(t,s),o?.(null)},onMouseEnter:()=>{i||o?.(t)},onMouseLeave:()=>o?.(null),"aria-label":t.title,"aria-describedby":t.description?d:void 0},(0,c.createElement)(wm,{blocks:s,viewportWidth:u}),!l&&(0,c.createElement)("div",{className:"block-editor-block-patterns-list__item-title"},t.title),!!t.description&&(0,c.createElement)(m.VisuallyHidden,{id:d},t.description))))))}function jm(){return(0,c.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}var Wm=function({isDraggable:e,blockPatterns:t,shownPatterns:n,onHover:o,onClickPattern:r,orientation:l,label:i=(0,v.__)("Block Patterns"),showTitlesAsTooltip:a}){const s=(0,m.__unstableUseCompositeState)({orientation:l});return(0,c.createElement)(m.__unstableComposite,{...s,role:"listbox",className:"block-editor-block-patterns-list","aria-label":i},t.map((t=>n.includes(t)?(0,c.createElement)($m,{key:t.name,pattern:t,onClick:r,onHover:o,isDraggable:e,composite:s,showTooltip:a}):(0,c.createElement)(jm,{key:t.name}))))};function Km({selectedCategory:e,patternCategories:t,onClickCategory:n}){const o="block-editor-block-patterns-explorer__sidebar";return(0,c.createElement)("div",{className:`${o}__categories-list`},t.map((({name:t,label:r})=>(0,c.createElement)(m.Button,{key:t,label:r,className:`${o}__categories-list__item`,isPressed:e===t,onClick:()=>{n(t)}},r))))}function qm({filterValue:e,setFilterValue:t}){return(0,c.createElement)("div",{className:"block-editor-block-patterns-explorer__search"},(0,c.createElement)(m.SearchControl,{__nextHasNoMarginBottom:!0,onChange:t,value:e,label:(0,v.__)("Search for patterns"),placeholder:(0,v.__)("Search")}))}var Zm=function({selectedCategory:e,patternCategories:t,onClickCategory:n,filterValue:o,setFilterValue:r}){return(0,c.createElement)("div",{className:"block-editor-block-patterns-explorer__sidebar"},(0,c.createElement)(qm,{filterValue:o,setFilterValue:r}),!o&&(0,c.createElement)(Km,{selectedCategory:e,patternCategories:t,onClickCategory:n}))};var Ym=function(){return(0,c.createElement)("div",{className:"block-editor-inserter__no-results"},(0,c.createElement)(Ql,{className:"block-editor-inserter__no-results-icon",icon:$d}),(0,c.createElement)("p",null,(0,v.__)("No results found.")))};var Xm=function({rootClientId:e="",insertionIndex:t,clientId:n,isAppender:o,onSelect:r,shouldFocusBlock:l=!0,selectBlockOnInsert:i=!0}){const{getSelectedBlock:s}=(0,f.useSelect)($o),{destinationRootClientId:u,destinationIndex:d}=(0,f.useSelect)((r=>{const{getSelectedBlockClientId:l,getBlockRootClientId:i,getBlockIndex:a,getBlockOrder:s}=r($o),c=l();let u,d=e;return void 0!==t?u=t:n?u=a(n):!o&&c?(d=i(c),u=a(c)+1):u=s(d).length,{destinationRootClientId:d,destinationIndex:u}}),[e,t,n,o]),{replaceBlocks:p,insertBlocks:m,showInsertionPoint:g,hideInsertionPoint:h}=(0,f.useDispatch)($o),b=(0,c.useCallback)(((e,t,n=!1)=>{const c=s();!o&&c&&(0,a.isUnmodifiedDefaultBlock)(c)?p(c.clientId,e,null,l||n?0:null,t):m(e,d,u,i,l||n?0:null,t);const f=Array.isArray(e)?e.length:1,g=(0,v.sprintf)((0,v._n)("%d block added.","%d blocks added.",f),f);(0,Mn.speak)(g),r&&r(e)}),[o,s,p,m,u,d,r,l,i]),_=(0,c.useCallback)((e=>{e?g(u,d):h()}),[g,h,u,d]);return[u,b,_]},Qm=n(4793),Jm=n.n(Qm);const ef=e=>e.name||"",tf=e=>e.title,nf=e=>e.description||"",of=e=>e.keywords||[],rf=e=>e.category,lf=()=>null;function af(e=""){return Pl(e,{splitRegexp:[/([\p{Ll}\p{Lo}\p{N}])([\p{Lu}\p{Lt}])/gu,/([\p{Lu}\p{Lt}])([\p{Lu}\p{Lt}][\p{Ll}\p{Lo}])/gu],stripRegexp:/(\p{C}|\p{P}|\p{S})+/giu}).split(" ").filter(Boolean)}function sf(e=""){return e=(e=(e=Jm()(e)).replace(/^\//,"")).toLowerCase()}const cf=(e="")=>af(sf(e)),uf=(e,t,n,o)=>{if(0===cf(o).length)return e;return df(e,o,{getCategory:e=>t.find((({slug:t})=>t===e.category))?.title,getCollection:e=>n[e.name.split("/")[0]]?.title})},df=(e=[],t="",n={})=>{if(0===cf(t).length)return e;const o=e.map((e=>[e,pf(e,t,n)])).filter((([,e])=>e>0));return o.sort((([,e],[,t])=>t-e)),o.map((([e])=>e))};function pf(e,t,n={}){const{getName:o=ef,getTitle:r=tf,getDescription:l=nf,getKeywords:i=of,getCategory:a=rf,getCollection:s=lf}=n,c=o(e),u=r(e),d=l(e),p=i(e),m=a(e),f=s(e),g=sf(t),h=sf(u);let b=0;if(g===h)b+=30;else if(h.startsWith(g))b+=20;else{const e=[c,u,d,...p,m,f].join(" ");0===((e,t)=>e.filter((e=>!cf(t).some((t=>t.includes(e))))))(af(g),e).length&&(b+=10)}if(0!==b&&c.startsWith("core/")){b+=c!==e.id?1:2}return b}function mf({filterValue:e,filteredBlockPatternsLength:t}){return e?(0,c.createElement)(m.__experimentalHeading,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count"},(0,v.sprintf)((0,v._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',t),t,e)):null}var ff=function({filterValue:e,selectedCategory:t,patternCategories:n}){const o=(0,p.useDebounce)(Mn.speak,500),[r,l]=Xm({shouldFocusBlock:!0}),[i,,a]=Gm(l,r),s=(0,c.useMemo)((()=>n.map((e=>e.name))),[n]),u=(0,c.useMemo)((()=>e?df(i,e):i.filter((e=>"uncategorized"===t?!e.categories?.length||e.categories.every((e=>!s.includes(e))):e.categories?.includes(t)))),[e,i,t,s]);(0,c.useEffect)((()=>{if(!e)return;const t=u.length,n=(0,v.sprintf)((0,v._n)("%d result found.","%d results found.",t),t);o(n)}),[e,o,u.length]);const d=(0,p.useAsyncList)(u,{step:2}),m=!!u?.length;return(0,c.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},m&&(0,c.createElement)(mf,{filterValue:e,filteredBlockPatternsLength:u.length}),(0,c.createElement)(Om,null,!m&&(0,c.createElement)(Ym,null),m&&(0,c.createElement)(Wm,{shownPatterns:d,blockPatterns:u,onClickPattern:a,isDraggable:!1})))};function gf({initialCategory:e,patternCategories:t}){const[n,o]=(0,c.useState)(""),[r,l]=(0,c.useState)(e?.name);return(0,c.createElement)("div",{className:"block-editor-block-patterns-explorer"},(0,c.createElement)(Zm,{selectedCategory:r,patternCategories:t,onClickCategory:l,filterValue:n,setFilterValue:o}),(0,c.createElement)(ff,{filterValue:n,selectedCategory:r,patternCategories:t}))}var hf=function({onModalClose:e,...t}){return(0,c.createElement)(m.Modal,{title:(0,v.__)("Patterns"),onRequestClose:e,isFullScreen:!0},(0,c.createElement)(gf,{...t}))};function bf({title:e}){return(0,c.createElement)(m.__experimentalVStack,{spacing:0},(0,c.createElement)(m.__experimentalView,null,(0,c.createElement)(m.__experimentalSpacer,{marginBottom:0,paddingX:4,paddingY:3},(0,c.createElement)(m.__experimentalHStack,{spacing:2},(0,c.createElement)(m.__experimentalNavigatorBackButton,{style:{minWidth:24,padding:0},icon:(0,v.isRTL)()?Gd:Ud,isSmall:!0,"aria-label":(0,v.__)("Navigate to the previous view")}),(0,c.createElement)(m.__experimentalSpacer,null,(0,c.createElement)(m.__experimentalHeading,{level:5},e))))))}function vf({categories:e,children:t}){return(0,c.createElement)(m.__experimentalNavigatorProvider,{initialPath:"/",className:"block-editor-inserter__mobile-tab-navigation"},(0,c.createElement)(m.__experimentalNavigatorScreen,{path:"/"},(0,c.createElement)(m.__experimentalItemGroup,null,e.map((e=>(0,c.createElement)(m.__experimentalNavigatorButton,{key:e.name,path:`/category/${e.name}`,as:m.__experimentalItem,isAction:!0},(0,c.createElement)(m.__experimentalHStack,null,(0,c.createElement)(m.FlexBlock,null,e.label),(0,c.createElement)(Ql,{icon:(0,v.isRTL)()?Ud:Gd}))))))),e.map((e=>(0,c.createElement)(m.__experimentalNavigatorScreen,{key:e.name,path:`/category/${e.name}`},(0,c.createElement)(bf,{title:(0,v.__)("Back")}),t(e)))))}const _f=()=>{},kf=["custom","featured","posts","text","gallery","call-to-action","banner","header","footer"];function yf(e){const[t,n]=Gm(void 0,e),o=(0,c.useCallback)((e=>!(!e.categories||!e.categories.length)&&e.categories.some((e=>n.some((t=>t.name===e))))),[n]),r=(0,c.useMemo)((()=>{const e=n.filter((e=>t.some((t=>t.categories?.includes(e.name))))).sort((({name:e},{name:t})=>{let n=kf.indexOf(e),o=kf.indexOf(t);return n<0&&(n=kf.length),o<0&&(o=kf.length),n-o}));return t.some((e=>!o(e)))&&!e.find((e=>"uncategorized"===e.name))&&e.push({name:"uncategorized",label:(0,v._x)("Uncategorized")}),e}),[n,t,o]);return r}function Ef({rootClientId:e,onInsert:t,onHover:n,category:o,showTitlesAsTooltip:r}){const l=(0,c.useRef)();return(0,c.useEffect)((()=>{const e=setTimeout((()=>{const[e]=ta.focus.tabbable.find(l.current);e?.focus()}));return()=>clearTimeout(e)}),[o]),(0,c.createElement)("div",{ref:l,className:"block-editor-inserter__patterns-category-dialog"},(0,c.createElement)(wf,{rootClientId:e,onInsert:t,onHover:n,category:o,showTitlesAsTooltip:r}))}function wf({rootClientId:e,onInsert:t,onHover:n=_f,category:o,showTitlesAsTooltip:r}){const[l,,i]=Gm(t,e),a=yf(e),s=(0,c.useMemo)((()=>l.filter((e=>{var t;if("uncategorized"!==o.name)return e.categories?.includes(o.name);return 0===(null!==(t=e.categories?.filter((e=>a.find((t=>t.name===e)))))&&void 0!==t?t:[]).length}))),[l,a,o.name]),u=(0,p.useAsyncList)(s);return(0,c.useEffect)((()=>()=>n(null)),[]),s.length?(0,c.createElement)("div",{className:"block-editor-inserter__patterns-category-panel"},(0,c.createElement)("div",{className:"block-editor-inserter__patterns-category-panel-title"},o.label),(0,c.createElement)("p",null,o.description),(0,c.createElement)(Wm,{shownPatterns:u,blockPatterns:s,onClickPattern:i,onHover:n,label:o.label,orientation:"vertical",category:o.label,isDraggable:!0,showTitlesAsTooltip:r})):null}var Sf=function({onSelectCategory:e,selectedCategory:t,onInsert:n,rootClientId:o}){const[r,l]=(0,c.useState)(!1),i=yf(o),a=t||i[0],s=(0,p.useViewportMatch)("medium","<");return(0,c.createElement)(c.Fragment,null,!s&&(0,c.createElement)("div",{className:"block-editor-inserter__block-patterns-tabs-container"},(0,c.createElement)("nav",{"aria-label":(0,v.__)("Block pattern categories")},(0,c.createElement)(m.__experimentalItemGroup,{role:"list",className:"block-editor-inserter__block-patterns-tabs"},i.map((n=>(0,c.createElement)(m.__experimentalItem,{role:"listitem",key:n.name,onClick:()=>e(n),className:n===t?"block-editor-inserter__patterns-category block-editor-inserter__patterns-selected-category":"block-editor-inserter__patterns-category","aria-label":n.label,"aria-current":n===t?"true":void 0},(0,c.createElement)(m.__experimentalHStack,null,(0,c.createElement)(m.FlexBlock,null,n.label),(0,c.createElement)(Ql,{icon:(0,v.isRTL)()?Ud:Gd}))))),(0,c.createElement)("div",{role:"listitem"},(0,c.createElement)(m.Button,{className:"block-editor-inserter__patterns-explore-button",onClick:()=>l(!0),variant:"secondary"},(0,v.__)("Explore all patterns")))))),s&&(0,c.createElement)(vf,{categories:i},(e=>(0,c.createElement)(wf,{onInsert:n,rootClientId:o,category:e,showTitlesAsTooltip:!1}))),r&&(0,c.createElement)(hf,{initialCategory:a,patternCategories:i,onModalClose:()=>l(!1)}))},Cf=window.wp.url;var xf=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"})),Bf=window.wp.preferences;const If="isResuableBlocksrRenameHintVisible";function Tf(){const e=(0,f.useSelect)((e=>{var t;return null===(t=e(Bf.store).get("core",If))||void 0===t||t}),[]),t=(0,c.useRef)(),{set:n}=(0,f.useDispatch)(Bf.store);return e?(0,c.createElement)("div",{ref:t,className:"reusable-blocks-menu-items__rename-hint"},(0,c.createElement)("div",{className:"reusable-blocks-menu-items__rename-hint-content"},(0,v.__)("Reusable blocks are now called patterns. A synced pattern will behave in exactly the same way as a reusable block.")),(0,c.createElement)(m.Button,{className:"reusable-blocks-menu-items__rename-hint-dismiss",icon:xf,iconSize:"16",label:(0,v.__)("Dismiss hint"),onClick:()=>{const e=ta.focus.tabbable.findPrevious(t.current);e?.focus(),n("core",If,!1)},showTooltip:!1})):null}function Mf({onHover:e,onInsert:t,rootClientId:n}){const[o,,,r]=Dm(n,t),l=(0,c.useMemo)((()=>o.filter((({category:e})=>"reusable"===e))),[o]);return 0===l.length?(0,c.createElement)(Ym,null):(0,c.createElement)(Am,{title:(0,v.__)("Synced patterns")},(0,c.createElement)(Rm,{items:l,onSelect:r,onHover:e,label:(0,v.__)("Synced patterns")}))}var Pf=function({rootClientId:e,onInsert:t,onHover:n}){return(0,c.createElement)(c.Fragment,null,(0,c.createElement)("div",{className:"block-editor-inserter__hint"},(0,c.createElement)(Tf,null)),(0,c.createElement)(Mf,{onHover:n,onInsert:t,rootClientId:e}),(0,c.createElement)("div",{className:"block-editor-inserter__manage-reusable-blocks-container"},(0,c.createElement)(m.Button,{className:"block-editor-inserter__manage-reusable-blocks",variant:"secondary",href:(0,Cf.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,v.__)("Manage my patterns"))))};function Nf(e){const[t,n]=(0,c.useState)([]),{canInsertImage:o,canInsertVideo:r,canInsertAudio:l}=(0,f.useSelect)((t=>{const{canInsertBlockType:n}=t($o);return{canInsertImage:n("core/image",e),canInsertVideo:n("core/video",e),canInsertAudio:n("core/audio",e)}}),[e]),i=function(){const{inserterMediaCategories:e,allowedMimeTypes:t,enableOpenverseMediaCategory:n}=(0,f.useSelect)((e=>{const t=e($o).getSettings();return{inserterMediaCategories:t.inserterMediaCategories,allowedMimeTypes:t.allowedMimeTypes,enableOpenverseMediaCategory:t.enableOpenverseMediaCategory}}),[]),o=(0,c.useMemo)((()=>{if(e&&t)return e.filter((e=>!(!n&&"openverse"===e.name)&&Object.values(t).some((t=>t.startsWith(`${e.mediaType}/`)))))}),[e,t,n]);return o}();return(0,c.useEffect)((()=>{(async()=>{const e=[];if(!i)return;const t=new Map(await Promise.all(i.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]})))),a={image:o,video:r,audio:l};i.forEach((n=>{a[n.mediaType]&&t.get(n.name)&&e.push(n)})),e.length&&n(e)})()}),[o,r,l,i]),t}var Lf=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));var Rf=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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"})),Af=window.wp.blob;const Df={image:"img",video:"video",audio:"audio"};function Of(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 l=Df[t],i=(0,c.createElement)(l,{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,a.createBlock)(`core/${t}`,n),i]}const zf=["image"],Vf=25,Ff={position:"bottom left",className:"block-editor-inserter__media-list__item-preview-options__popover"};function Hf({category:e,media:t}){if(!e.getReportUrl)return null;const n=e.getReportUrl(t);return(0,c.createElement)(m.DropdownMenu,{className:"block-editor-inserter__media-list__item-preview-options",label:(0,v.__)("Options"),popoverProps:Ff,icon:Lf},(()=>(0,c.createElement)(m.MenuGroup,null,(0,c.createElement)(m.MenuItem,{onClick:()=>window.open(n,"_blank").focus(),icon:Rf},(0,v.sprintf)((0,v.__)("Report %s"),e.mediaType)))))}function Gf({onClose:e,onSubmit:t}){return(0,c.createElement)(m.Modal,{title:(0,v.__)("Insert external image"),onRequestClose:e,className:"block-editor-inserter-media-tab-media-preview-inserter-external-image-modal"},(0,c.createElement)(m.__experimentalVStack,{spacing:3},(0,c.createElement)("p",null,(0,v.__)("This image cannot be uploaded to your Media Library, but it can still be inserted as an external image.")),(0,c.createElement)("p",null,(0,v.__)("External images can be removed by the external provider without warning and could even have legal compliance issues related to privacy legislation."))),(0,c.createElement)(m.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,c.createElement)(m.FlexItem,null,(0,c.createElement)(m.Button,{variant:"tertiary",onClick:e},(0,v.__)("Cancel"))),(0,c.createElement)(m.FlexItem,null,(0,c.createElement)(m.Button,{variant:"primary",onClick:t},(0,v.__)("Insert")))))}function Uf({media:e,onClick:t,composite:n,category:o}){const[r,l]=(0,c.useState)(!1),[i,s]=(0,c.useState)(!1),[u,p]=(0,c.useState)(!1),[g,h]=(0,c.useMemo)((()=>Of(e,o.mediaType)),[e,o.mediaType]),{createErrorNotice:b,createSuccessNotice:_}=(0,f.useDispatch)(Fm.store),k=(0,f.useSelect)((e=>e($o).getSettings().mediaUpload),[]),y=(0,c.useCallback)((e=>{if(u)return;const n=(0,a.cloneBlock)(e),{id:o,url:r,caption:i}=n.attributes;o?t(n):(p(!0),window.fetch(r).then((e=>e.blob())).then((e=>{k({filesList:[e],additionalData:{caption:i},onFileChange([e]){(0,Af.isBlobURL)(e.url)||(t({...n,attributes:{...n.attributes,id:e.id,url:e.url}}),_((0,v.__)("Image uploaded and inserted."),{type:"snackbar"}),p(!1))},allowedTypes:zf,onError(e){b(e,{type:"snackbar"}),p(!1)}})})).catch((()=>{l(!0),p(!1)})))}),[u,t,k,b,_]),E=e.title?.rendered||e.title;let w;if(E.length>Vf){const e="...";w=E.slice(0,Vf-e.length)+e}const S=(0,c.useCallback)((()=>s(!0)),[]),C=(0,c.useCallback)((()=>s(!1)),[]);return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(Mm,{isEnabled:!0,blocks:[g]},(({draggable:t,onDragStart:r,onDragEnd:l})=>(0,c.createElement)("div",{className:d()("block-editor-inserter__media-list__list-item",{"is-hovered":i}),draggable:t,onDragStart:r,onDragEnd:l},(0,c.createElement)(m.Tooltip,{text:w||E},(0,c.createElement)("div",{onMouseEnter:S,onMouseLeave:C},(0,c.createElement)(m.__unstableCompositeItem,{role:"option",as:"div",...n,className:"block-editor-inserter__media-list__item",onClick:()=>y(g),"aria-label":E},(0,c.createElement)("div",{className:"block-editor-inserter__media-list__item-preview"},h,u&&(0,c.createElement)("div",{className:"block-editor-inserter__media-list__item-preview-spinner"},(0,c.createElement)(m.Spinner,null)))),!u&&(0,c.createElement)(Hf,{category:o,media:e})))))),r&&(0,c.createElement)(Gf,{onClose:()=>l(!1),onSubmit:()=>{t((0,a.cloneBlock)(g)),_((0,v.__)("Image inserted."),{type:"snackbar"}),l(!1)}}))}var $f=function({mediaList:e,category:t,onClick:n,label:o=(0,v.__)("Media List")}){const r=(0,m.__unstableUseCompositeState)();return(0,c.createElement)(m.__unstableComposite,{...r,role:"listbox",className:"block-editor-inserter__media-list","aria-label":o},e.map(((e,o)=>(0,c.createElement)(Uf,{key:e.id||e.sourceId||o,media:e,category:t,onClick:n,composite:r}))))};function jf(e=""){const[t,n]=(0,c.useState)(e),[o,r]=(0,c.useState)(e),l=(0,p.useDebounce)(r,250);return(0,c.useEffect)((()=>{o!==t&&l(t)}),[o,t]),[t,n,o]}const Wf=10;function Kf({rootClientId:e,onInsert:t,category:n}){const o=(0,c.useRef)();return(0,c.useEffect)((()=>{const e=setTimeout((()=>{const[e]=ta.focus.tabbable.find(o.current);e?.focus()}));return()=>clearTimeout(e)}),[n]),(0,c.createElement)("div",{ref:o,className:"block-editor-inserter__media-dialog"},(0,c.createElement)(qf,{rootClientId:e,onInsert:t,category:n}))}function qf({rootClientId:e,onInsert:t,category:n}){const[o,r,l]=jf(),{mediaList:i,isLoading:a}=function(e,t={}){const[n,o]=(0,c.useState)(),[r,l]=(0,c.useState)(!1),i=(0,c.useRef)();return(0,c.useEffect)((()=>{(async()=>{const n=JSON.stringify({category:e.name,...t});i.current=n,l(!0),o([]);const r=await(e.fetch?.(t));n===i.current&&(o(r),l(!1))})()}),[e.name,...Object.values(t)]),{mediaList:n,isLoading:r}}(n,{per_page:l?20:Wf,search:l}),s="block-editor-inserter__media-panel",u=n.labels.search_items||(0,v.__)("Search");return(0,c.createElement)("div",{className:s},(0,c.createElement)(m.SearchControl,{className:`${s}-search`,onChange:r,value:o,label:u,placeholder:u}),a&&(0,c.createElement)("div",{className:`${s}-spinner`},(0,c.createElement)(m.Spinner,null)),!a&&!i?.length&&(0,c.createElement)(Ym,null),!a&&!!i?.length&&(0,c.createElement)($f,{rootClientId:e,onClick:t,mediaList:i,category:n}))}var Zf=function({fallback:e=null,children:t}){const n=(0,f.useSelect)((e=>{const{getSettings:t}=e($o);return!!t().mediaUpload}),[]);return n?t:e};var Yf=(0,m.withFilters)("editor.MediaUpload")((()=>null));const Xf=["image","video","audio"];var Qf=function({rootClientId:e,selectedCategory:t,onSelectCategory:n,onInsert:o}){const r=Nf(e),l=(0,p.useViewportMatch)("medium","<"),i="block-editor-inserter__media-tabs",a=(0,c.useCallback)((e=>{if(!e?.url)return;const[t]=Of(e,e.type);o(t)}),[o]),s=(0,c.useMemo)((()=>r.map((e=>({...e,label:e.labels.name})))),[r]);return(0,c.createElement)(c.Fragment,null,!l&&(0,c.createElement)("div",{className:`${i}-container`},(0,c.createElement)("nav",{"aria-label":(0,v.__)("Media categories")},(0,c.createElement)(m.__experimentalItemGroup,{role:"list",className:i},r.map((e=>(0,c.createElement)(m.__experimentalItem,{role:"listitem",key:e.name,onClick:()=>n(e),className:d()(`${i}__media-category`,{"is-selected":t===e}),"aria-label":e.labels.name,"aria-current":e===t?"true":void 0},(0,c.createElement)(m.__experimentalHStack,null,(0,c.createElement)(m.FlexBlock,null,e.labels.name),(0,c.createElement)(Ql,{icon:(0,v.isRTL)()?Ud:Gd}))))),(0,c.createElement)("div",{role:"listitem"},(0,c.createElement)(Zf,null,(0,c.createElement)(Yf,{multiple:!1,onSelect:a,allowedTypes:Xf,render:({open:e})=>(0,c.createElement)(m.Button,{onClick:t=>{t.target.focus(),e()},className:"block-editor-inserter__media-library-button",variant:"secondary","data-unstable-ignore-focus-outside-for-relatedtarget":".media-modal"},(0,v.__)("Open Media Library"))})))))),l&&(0,c.createElement)(vf,{categories:s},(t=>(0,c.createElement)(qf,{onInsert:o,rootClientId:e,category:t}))))};const{Fill:Jf,Slot:eg}=(0,m.createSlotFill)("__unstableInserterMenuExtension");Jf.Slot=eg;var tg=Jf;const ng=(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,og=[];var rg=function({filterValue:e,onSelect:t,onHover:n,rootClientId:o,clientId:r,isAppender:l,__experimentalInsertionIndex:i,maxBlockPatterns:a,maxBlockTypes:s,showBlockDirectory:u=!1,isDraggable:d=!0,shouldFocusBlock:g=!0,prioritizePatterns:h,selectBlockOnInsert:b}){const _=(0,p.useDebounce)(Mn.speak,500),{prioritizedBlocks:k}=(0,f.useSelect)((e=>{const t=e($o).getBlockListSettings(o);return{prioritizedBlocks:t?.prioritizedInserterBlocks||og}}),[o]),[y,E]=Xm({onSelect:t,rootClientId:o,clientId:r,isAppender:l,insertionIndex:i,shouldFocusBlock:g,selectBlockOnInsert:b}),[w,S,C,x]=Dm(y,E),[B,,I]=Gm(E,y),T=(0,c.useMemo)((()=>{if(0===a)return[];const t=df(B,e);return void 0!==a?t.slice(0,a):t}),[e,B,a]);let M=s;h&&T.length>2&&(M=0);const P=(0,c.useMemo)((()=>{if(0===M)return[];let t=K(w,"frecency","desc");!e&&k.length&&(t=ng(t,k));const n=uf(t,S,C,e);return void 0!==M?n.slice(0,M):n}),[e,w,S,C,M,k]);(0,c.useEffect)((()=>{if(!e)return;const t=P.length+T.length,n=(0,v.sprintf)((0,v._n)("%d result found.","%d results found.",t),t);_(n)}),[e,_,P,T]);const N=(0,p.useAsyncList)(P,{step:9}),L=(0,p.useAsyncList)(N.length===P.length?T:og),R=P.length>0||T.length>0,A=!!P.length&&(0,c.createElement)(Am,{title:(0,c.createElement)(m.VisuallyHidden,null,(0,v.__)("Blocks"))},(0,c.createElement)(Rm,{items:N,onSelect:x,onHover:n,label:(0,v.__)("Blocks"),isDraggable:d})),D=!!T.length&&(0,c.createElement)(Am,{title:(0,c.createElement)(m.VisuallyHidden,null,(0,v.__)("Block Patterns"))},(0,c.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,c.createElement)(Wm,{shownPatterns:L,blockPatterns:T,onClickPattern:I,onHover:n,isDraggable:d})));return(0,c.createElement)(Om,null,!u&&!R&&(0,c.createElement)(Ym,null),h?D:A,!!P.length&&!!T.length&&(0,c.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),h?A:D,u&&(0,c.createElement)(tg.Slot,{fillProps:{onSelect:x,onHover:n,filterValue:e,hasItems:R,rootClientId:y}},(e=>e.length?e:R?null:(0,c.createElement)(Ym,null))))};const lg={name:"blocks",title:(0,v.__)("Blocks")},ig={name:"patterns",title:(0,v.__)("Patterns")},ag={name:"reusable",title:(0,v.__)("Synced patterns"),icon:H},sg={name:"media",title:(0,v.__)("Media")};var cg=function({children:e,showPatterns:t=!1,showReusableBlocks:n=!1,showMedia:o=!1,onSelect:r,prioritizePatterns:l}){const i=(0,c.useMemo)((()=>{const e=[];return l&&t&&e.push(ig),e.push(lg),!l&&t&&e.push(ig),o&&e.push(sg),n&&e.push(ag),e}),[l,t,n,o]);return(0,c.createElement)(m.TabPanel,{className:"block-editor-inserter__tabs",tabs:i,onSelect:r},e)};var ug=(0,c.forwardRef)((function({rootClientId:e,clientId:t,isAppender:n,__experimentalInsertionIndex:o,onSelect:r,showInserterHelpPanel:l,showMostUsedBlocks:i,__experimentalFilterValue:a="",shouldFocusBlock:s=!0,prioritizePatterns:u},p){const[g,h,b]=jf(a),[_,k]=(0,c.useState)(null),[y,E]=(0,c.useState)(null),[w,S]=(0,c.useState)(null),[C,x]=(0,c.useState)(null),[B,I,T]=Xm({rootClientId:e,clientId:t,isAppender:n,insertionIndex:o,shouldFocusBlock:s}),{showPatterns:M,inserterItems:P}=(0,f.useSelect)((e=>{const{__experimentalGetAllowedPatterns:t,getInserterItems:n}=e($o);return{showPatterns:!!t(B).length,inserterItems:n(B)}}),[B]),N=(0,c.useMemo)((()=>P.some((({category:e})=>"reusable"===e))),[P]),L=!!Nf(B).length,R=(0,c.useCallback)(((e,t,n)=>{I(e,t,n),r()}),[I,r]),A=(0,c.useCallback)(((e,t)=>{I(e,{patternName:t}),r()}),[I,r]),D=(0,c.useCallback)((e=>{T(!!e),k(e)}),[T,k]),O=(0,c.useCallback)((e=>{T(!!e)}),[T]),z=(0,c.useCallback)((e=>{E(e)}),[E]),V=(0,c.useMemo)((()=>(0,c.createElement)(c.Fragment,null,(0,c.createElement)("div",{className:"block-editor-inserter__block-list"},(0,c.createElement)(Vm,{rootClientId:B,onInsert:R,onHover:D,showMostUsedBlocks:i})),l&&(0,c.createElement)("div",{className:"block-editor-inserter__tips"},(0,c.createElement)(m.VisuallyHidden,{as:"h2"},(0,v.__)("A tip for using the block editor")),(0,c.createElement)(Hd,null)))),[B,R,D,i,l]),F=(0,c.useMemo)((()=>(0,c.createElement)(Sf,{rootClientId:B,onInsert:A,onSelectCategory:z,selectedCategory:y})),[B,A,z,y]),H=(0,c.useMemo)((()=>(0,c.createElement)(Pf,{rootClientId:B,onInsert:R,onHover:D})),[B,R,D]),G=(0,c.useMemo)((()=>(0,c.createElement)(Qf,{rootClientId:B,selectedCategory:w,onSelectCategory:S,onInsert:R})),[B,R,w,S]),U=(0,c.useCallback)((e=>"blocks"===e.name?V:"patterns"===e.name?F:"reusable"===e.name?H:"media"===e.name?G:void 0),[V,F,H,G]),$=(0,c.useRef)();(0,c.useImperativeHandle)(p,(()=>({focusSearch:()=>{$.current.focus()}})));const j="patterns"===C&&!b&&y,W=!b&&(M||N||L),K="media"===C&&!b&&w;return(0,c.createElement)("div",{className:"block-editor-inserter__menu"},(0,c.createElement)("div",{className:d()("block-editor-inserter__main-area",{"show-as-tabs":W})},(0,c.createElement)(m.SearchControl,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",onChange:e=>{_&&k(null),h(e)},value:g,label:(0,v.__)("Search for blocks and patterns"),placeholder:(0,v.__)("Search"),ref:$}),!!b&&(0,c.createElement)("div",{className:"block-editor-inserter__no-tab-container"},(0,c.createElement)(rg,{filterValue:b,onSelect:r,onHover:D,rootClientId:e,clientId:t,isAppender:n,__experimentalInsertionIndex:o,showBlockDirectory:!0,shouldFocusBlock:s})),W&&(0,c.createElement)(cg,{showPatterns:M,showReusableBlocks:N,showMedia:L,prioritizePatterns:u,onSelect:x},U),!b&&!W&&(0,c.createElement)("div",{className:"block-editor-inserter__no-tab-container"},V)),K&&(0,c.createElement)(Kf,{rootClientId:B,onInsert:R,category:w}),l&&_&&(0,c.createElement)(Cm,{item:_}),j&&(0,c.createElement)(Ef,{rootClientId:B,onInsert:A,onHover:O,category:y,showTitlesAsTooltip:!0}))}));function dg({onSelect:e,rootClientId:t,clientId:n,isAppender:o,prioritizePatterns:r,selectBlockOnInsert:l}){const[i,a]=(0,c.useState)(""),[s,u]=Xm({onSelect:e,rootClientId:t,clientId:n,isAppender:o,selectBlockOnInsert:l}),[p]=Dm(s,u),[g]=Gm(u,s),{setInserterIsOpened:h,insertionIndex:b}=(0,f.useSelect)((e=>{const{getSettings:t,getBlockIndex:o,getBlockCount:r}=e($o),l=t(),i=o(n),a=r();return{setInserterIsOpened:l.__experimentalSetIsInserterOpened,insertionIndex:-1===i?a:i}}),[n]),_=g.length&&(!!i||r),k=_&&g.length>6||p.length>6;(0,c.useEffect)((()=>{h&&h(!1)}),[h]);let y=0;return _&&(y=r?4:2),(0,c.createElement)("div",{className:d()("block-editor-inserter__quick-inserter",{"has-search":k,"has-expand":h})},k&&(0,c.createElement)(m.SearchControl,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",value:i,onChange:e=>{a(e)},label:(0,v.__)("Search for blocks and patterns"),placeholder:(0,v.__)("Search")}),(0,c.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},(0,c.createElement)(rg,{filterValue:i,onSelect:e,rootClientId:t,clientId:n,isAppender:o,maxBlockPatterns:y,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:r,selectBlockOnInsert:l})),h&&(0,c.createElement)(m.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{h({rootClientId:t,insertionIndex:b,filterValue:i})},"aria-label":(0,v.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,v.__)("Browse all")))}const pg=({onToggle:e,disabled:t,isOpen:n,blockTitle:o,hasSingleBlockType:r,toggleProps:l={},prioritizePatterns:i})=>{const{as:a=m.Button,label:s,onClick:u,...d}=l;let p=s;return!p&&r?p=(0,v.sprintf)((0,v._x)("Add %s","directly add the only allowed block"),o):!p&&i?p=(0,v.__)("Add pattern"):p||(p=(0,v._x)("Add block","Generic label for block inserter button")),(0,c.createElement)(a,{icon:Vd,label:p,tooltipPosition:"bottom",onClick:function(t){e&&e(t),u&&u(t)},className:"block-editor-inserter__toggle","aria-haspopup":!r&&"true","aria-expanded":!r&&n,disabled:t,...d})};class mg extends c.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:l,toggleProps:i,hasItems:a,renderToggle:s=pg,prioritizePatterns:c}=this.props;return s({onToggle:e,isOpen:t,disabled:n||!a,blockTitle:o,hasSingleBlockType:r,directInsertBlock:l,toggleProps:i,prioritizePatterns:c})}renderContent({onClose:e}){const{rootClientId:t,clientId:n,isAppender:o,showInserterHelpPanel:r,__experimentalIsQuick:l,prioritizePatterns:i,onSelectOrClose:a,selectBlockOnInsert:s}=this.props;return l?(0,c.createElement)(dg,{onSelect:t=>{const n=Array.isArray(t)&&t?.length?t[0]:t;a&&"function"==typeof a&&a(n),e()},rootClientId:t,clientId:n,isAppender:o,prioritizePatterns:i,selectBlockOnInsert:s}):(0,c.createElement)(ug,{onSelect:()=>{e()},rootClientId:t,clientId:n,isAppender:o,showInserterHelpPanel:r,prioritizePatterns:i})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:o,__experimentalIsQuick:r,onSelectOrClose:l}=this.props;return t||n?this.renderToggle({onToggle:o}):(0,c.createElement)(m.Dropdown,{className:"block-editor-inserter",contentClassName:d()("block-editor-inserter__popover",{"is-quick":r}),popoverProps:{position:e,shift:!0},onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,v.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:l})}}const fg=(0,p.compose)([(0,f.withSelect)(((e,{clientId:t,rootClientId:n,shouldDirectInsert:o=!0})=>{const{getBlockRootClientId:r,hasInserterItems:l,getAllowedBlocks:i,__experimentalGetDirectInsertBlock:s,getSettings:c}=e($o),{getBlockVariations:u}=e(a.store),d=i(n=n||r(t)||void 0),p=o&&s(n),m=c(),f=1===d?.length&&0===u(d[0].name,"inserter")?.length;let g=!1;return f&&(g=d[0]),{hasItems:l(n),hasSingleBlockType:f,blockTitle:g?g.title:"",allowedBlockType:g,directInsertBlock:p,rootClientId:n,prioritizePatterns:m.__experimentalPreferPatternsOnRoot&&!n}})),(0,f.withDispatch)(((e,t,{select:n})=>({insertOnlyAllowedBlock(){const{rootClientId:o,clientId:r,isAppender:l,hasSingleBlockType:i,allowedBlockType:s,directInsertBlock:c,onSelectOrClose:u,selectBlockOnInsert:d}=t;if(!i&&!c)return;const{insertBlock:p}=e($o);let m;if(c){const e=function(e){const{getBlock:t,getPreviousBlockClientId:l}=n($o);if(!e||!r&&!o)return{};const i={};let a={};if(r){const e=t(r),n=t(l(r));e?.name===n?.name&&(a=n?.attributes||{})}else{const e=t(o);if(e?.innerBlocks?.length){const t=e.innerBlocks[e.innerBlocks.length-1];c&&c?.name===t.name&&(a=t.attributes)}}return e.forEach((e=>{a.hasOwnProperty(e)&&(i[e]=a[e])})),i}(c.attributesToCopy);m=(0,a.createBlock)(c.name,{...c.attributes||{},...e})}else m=(0,a.createBlock)(s.name);p(m,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:i,getBlockRootClientId:a}=n($o);if(r)return e(r);const s=t();return!l&&s&&a(s)===o?e(s)+1:i(o).length}(),o,d),u&&u({clientId:m?.clientId});const f=(0,v.sprintf)((0,v.__)("%s block added"),s.title);(0,Mn.speak)(f)}}))),(0,p.ifCondition)((({hasItems:e,isAppender:t,rootClientId:n,clientId:o})=>e||!t&&!n&&!o))])(mg);var gg=(0,c.forwardRef)(((e,t)=>(0,c.createElement)(fg,{ref:t,...e})));var hg=(0,p.compose)((0,f.withSelect)(((e,t)=>{const{getBlockCount:n,getSettings:o,getTemplateLock:r}=e($o),l=!n(t.rootClientId),{bodyPlaceholder:i}=o();return{showPrompt:l,isLocked:!!r(t.rootClientId),placeholder:i}})),(0,f.withDispatch)(((e,t)=>{const{insertDefaultBlock:n,startTyping:o}=e($o);return{onAppend(){const{rootClientId:e}=t;n(void 0,e),o()}}})))((function({isLocked:e,onAppend:t,showPrompt:n,placeholder:o,rootClientId:r}){if(e)return null;const l=(0,zd.decodeEntities)(o)||(0,v.__)("Type / to choose a block");return(0,c.createElement)("div",{"data-root-client-id":r||"",className:d()("block-editor-default-block-appender",{"has-visible-prompt":n})},(0,c.createElement)("p",{tabIndex:"0",role:"button","aria-label":(0,v.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{Ed.ENTER!==e.keyCode&&Ed.SPACE!==e.keyCode||t()},onClick:()=>t(),onFocus:()=>{n&&t()}},n?l:"\ufeff"),(0,c.createElement)(gg,{rootClientId:r,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function bg({rootClientId:e,className:t,onFocus:n,tabIndex:o},r){return(0,c.createElement)(gg,{position:"bottom center",rootClientId:e,__experimentalIsQuick:!0,renderToggle:({onToggle:e,disabled:l,isOpen:i,blockTitle:a,hasSingleBlockType:s})=>{let u;u=s?(0,v.sprintf)((0,v._x)("Add %s","directly add the only allowed block"),a):(0,v._x)("Add block","Generic label for block inserter button");const p=!s;let f=(0,c.createElement)(m.Button,{ref:r,onFocus:n,tabIndex:o,className:d()(t,"block-editor-button-block-appender"),onClick:e,"aria-haspopup":p?"true":void 0,"aria-expanded":p?i:void 0,disabled:l,label:u},!s&&(0,c.createElement)(m.VisuallyHidden,{as:"span"},u),(0,c.createElement)(Ql,{icon:Vd}));return(p||s)&&(f=(0,c.createElement)(m.Tooltip,{text:u},f)),f},isAppender:!0})}const vg=(0,c.forwardRef)(((e,t)=>($()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),bg(e,t))));var _g=(0,c.forwardRef)(bg);function kg({rootClientId:e}){return(0,f.useSelect)((t=>t($o).canInsertBlockType((0,a.getDefaultBlockName)(),e)))?(0,c.createElement)(hg,{rootClientId:e}):(0,c.createElement)(_g,{rootClientId:e,className:"block-list-appender__toggle"})}var yg=function({rootClientId:e,renderAppender:t,className:n,tagName:o="div"}){const r=function(e,t){const n=(0,f.useSelect)((n=>{const{getTemplateLock:o,getSelectedBlockClientId:r,__unstableGetEditorMode:l,getBlockEditingMode:i}=bn(n($o));if(!1===t)return!1;if(!t){const t=r();if(e!==t&&(e||t))return!1}return!o(e)&&"disabled"!==i(e)&&"zoom-out"!==l()}),[e,t]);return n?t?(0,c.createElement)(t,null):(0,c.createElement)(kg,{rootClientId:e}):null}(e,t),l=(0,f.useSelect)((t=>{const{getBlockInsertionPoint:n,isBlockInsertionPointVisible:o,getBlockCount:r}=t($o),l=n();return o()&&e===l?.rootClientId&&0===r(e)}),[e]);return r?(0,c.createElement)(o,{tabIndex:-1,className:d()("block-list-appender wp-block",n,{"is-drag-over":l}),contentEditable:!1,"data-block":!0},r):null};var Eg=function(e){return(0,p.useRefEffect)((t=>{if(!e)return;function n(t){const{deltaX:n,deltaY:o}=t;e.current.scrollBy(n,o)}const o={passive:!0};return t.addEventListener("wheel",n,o),()=>{t.removeEventListener("wheel",n,o)}}),[e])};const wg=Number.MAX_SAFE_INTEGER;(0,c.createContext)();var Sg=function({previousClientId:e,nextClientId:t,children:n,__unstablePopoverSlot:o,__unstableContentRef:r,...l}){const[i,a]=(0,c.useReducer)((e=>(e+1)%wg),0),{orientation:s,rootClientId:u,isVisible:p}=(0,f.useSelect)((n=>{const{getBlockListSettings:o,getBlockRootClientId:r,isBlockVisible:l}=n($o),i=r(null!=e?e:t);return{orientation:o(i)?.orientation||"vertical",rootClientId:i,isVisible:l(e)&&l(t)}}),[e,t]),g=Td(e),h=Td(t),b="vertical"===s,_=(0,c.useMemo)((()=>{if(i<0||!g&&!h||!p)return;const{ownerDocument:e}=g||h;return{ownerDocument:e,getBoundingClientRect(){const e=g?g.getBoundingClientRect():null,t=h?h.getBoundingClientRect():null;let n=0,o=0,r=0,l=0;return b?(o=e?e.bottom:t.top,r=e?e.width:t.width,l=t&&e?t.top-e.bottom:0,n=e?e.left:t.left):(o=e?e.top:t.top,l=e?e.height:t.height,(0,v.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)),new window.DOMRect(n,o,r,l)}}}),[g,h,i,b,p]),k=Eg(r);return(0,c.useLayoutEffect)((()=>{if(!g)return;const e=new window.MutationObserver(a);return e.observe(g,{attributes:!0}),()=>{e.disconnect()}}),[g]),(0,c.useLayoutEffect)((()=>{if(!h)return;const e=new window.MutationObserver(a);return e.observe(h,{attributes:!0}),()=>{e.disconnect()}}),[h]),(0,c.useLayoutEffect)((()=>{if(g)return g.ownerDocument.defaultView.addEventListener("resize",a),()=>{g.ownerDocument.defaultView?.removeEventListener("resize",a)}}),[g]),(g||h)&&p?(0,c.createElement)(m.Popover,{ref:k,animate:!1,anchor:_,focusOnMount:!1,__unstableSlotName:o||null,key:t+"--"+u,...l,className:d()("block-editor-block-popover","block-editor-block-popover__inbetween",l.className),resize:!1,flip:!1,placement:"overlay",variant:"unstyled"},(0,c.createElement)("div",{className:"block-editor-block-popover__inbetween-container"},n)):null};const Cg=Number.MAX_SAFE_INTEGER;var xg=(0,c.forwardRef)((function({clientId:e,bottomClientId:t,children:n,__unstableRefreshSize:o,__unstableCoverTarget:r=!1,__unstablePopoverSlot:l,__unstableContentRef:i,shift:a=!0,...s},u){const f=Td(e),g=Td(null!=t?t:e),h=(0,p.useMergeRefs)([u,Eg(i)]),[b,v]=(0,c.useReducer)((e=>(e+1)%Cg),0);(0,c.useLayoutEffect)((()=>{if(!f)return;const e=new window.MutationObserver(v);return e.observe(f,{attributes:!0}),()=>{e.disconnect()}}),[f]);const _=(0,c.useMemo)((()=>b<0||!f||g!==f?{}:{position:"absolute",width:f.offsetWidth,height:f.offsetHeight}),[f,g,o,b]),k=(0,c.useMemo)((()=>{if(!(b<0||!f||t&&!g))return{getBoundingClientRect(){var e,t,n,o;const r=f.getBoundingClientRect(),l=g?.getBoundingClientRect(),i=Math.min(r.left,null!==(e=l?.left)&&void 0!==e?e:1/0),a=Math.min(r.top,null!==(t=l?.top)&&void 0!==t?t:1/0),s=Math.max(r.right,null!==(n=l.right)&&void 0!==n?n:-1/0)-i,c=Math.max(r.bottom,null!==(o=l.bottom)&&void 0!==o?o:-1/0)-a;return new window.DOMRect(i,a,s,c)},ownerDocument:f.ownerDocument}}),[t,g,f,b]);return!f||t&&!g?null:(0,c.createElement)(m.Popover,{ref:h,animate:!1,focusOnMount:!1,anchor:k,__unstableSlotName:l||null,placement:"top-start",resize:!1,flip:!1,shift:a,...s,className:d()("block-editor-block-popover",s.className),variant:"unstyled"},r&&(0,c.createElement)("div",{style:_},n),!r&&n)}));const Bg={hide:{opacity:0,scaleY:.75},show:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:.9}};var Ig=function({__unstablePopoverSlot:e,__unstableContentRef:t}){const{clientId:n}=(0,f.useSelect)((e=>{const{getBlockOrder:t,getBlockInsertionPoint:n}=e($o),o=n(),r=t(o.rootClientId);return r.length?{clientId:r[o.index]}:{}}),[]),o=(0,p.useReducedMotion)();return(0,c.createElement)(xg,{clientId:n,__unstableCoverTarget:!0,__unstablePopoverSlot:e,__unstableContentRef:t,className:"block-editor-block-popover__drop-zone"},(0,c.createElement)(m.__unstableMotion.div,{"data-testid":"block-popover-drop-zone",initial:o?Bg.show:Bg.hide,animate:Bg.show,exit:o?Bg.show:Bg.exit,className:"block-editor-block-popover__drop-zone-foreground"}))};const Tg=(0,c.createContext)();function Mg({__unstablePopoverSlot:e,__unstableContentRef:t}){const{selectBlock:n,hideInsertionPoint:o}=(0,f.useDispatch)($o),r=(0,c.useContext)(Tg),l=(0,c.useRef)(),{orientation:i,previousClientId:a,nextClientId:s,rootClientId:u,isInserterShown:g,isDistractionFree:h,isNavigationMode:b}=(0,f.useSelect)((e=>{const{getBlockOrder:t,getBlockListSettings:n,getBlockInsertionPoint:o,isBlockBeingDragged:r,getPreviousBlockClientId:l,getNextBlockClientId:i,getSettings:a,isNavigationMode:s}=e($o),c=o(),u=t(c.rootClientId);if(!u.length)return{};let d=u[c.index-1],p=u[c.index];for(;r(d);)d=l(d);for(;r(p);)p=i(p);const m=a();return{previousClientId:d,nextClientId:p,orientation:n(c.rootClientId)?.orientation||"vertical",rootClientId:c.rootClientId,isNavigationMode:s(),isDistractionFree:m.isDistractionFree,isInserterShown:c?.__unstableWithInserter}}),[]),v=(0,p.useReducedMotion)();const _={start:{opacity:0,scale:0},rest:{opacity:1,scale:1,transition:{delay:g?.5:0,type:"tween"}},hover:{opacity:1,scale:1,transition:{delay:.5,type:"tween"}}},k={start:{scale:v?1:0},rest:{scale:1,transition:{delay:.4,type:"tween"}}};if(h&&!b)return null;const y=d()("block-editor-block-list__insertion-point","is-"+i);return(0,c.createElement)(Sg,{previousClientId:a,nextClientId:s,__unstablePopoverSlot:e,__unstableContentRef:t},(0,c.createElement)(m.__unstableMotion.div,{layout:!v,initial:v?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:l,tabIndex:-1,onClick:function(e){e.target===l.current&&s&&n(s,-1)},onFocus:function(e){e.target!==l.current&&(r.current=!0)},className:d()(y,{"is-with-inserter":g}),onHoverEnd:function(e){e.target!==l.current||r.current||o()}},(0,c.createElement)(m.__unstableMotion.div,{variants:_,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),g&&(0,c.createElement)(m.__unstableMotion.div,{variants:k,className:d()("block-editor-block-list__insertion-point-inserter")},(0,c.createElement)(gg,{position:"bottom center",clientId:s,rootClientId:u,__experimentalIsQuick:!0,onToggle:e=>{r.current=e},onSelectOrClose:()=>{r.current=!1}}))))}function Pg(e){const{insertionPoint:t,isVisible:n,isBlockListEmpty:o}=(0,f.useSelect)((e=>{const{getBlockInsertionPoint:t,isBlockInsertionPointVisible:n,getBlockCount:o}=e($o),r=t();return{insertionPoint:r,isVisible:n(),isBlockListEmpty:0===o(r?.rootClientId)}}),[]);return!n||o?null:"replace"===t.operation?(0,c.createElement)(Ig,{key:`${t.rootClientId}-${t.index}`,...e}):(0,c.createElement)(Mg,{...e})}function Ng(){const e=(0,c.useContext)(Tg),t=(0,f.useSelect)((e=>e($o).getSettings().isDistractionFree||"zoom-out"===e($o).__unstableGetEditorMode()),[]),{getBlockListSettings:n,getBlockIndex:o,isMultiSelecting:r,getSelectedBlockClientIds:l,getTemplateLock:i,__unstableIsWithinBlockOverlay:a,getBlockEditingMode:s}=bn((0,f.useSelect)($o)),{showInsertionPoint:u,hideInsertionPoint:d}=(0,f.useDispatch)($o);return(0,p.useRefEffect)((c=>{if(!t)return c.addEventListener("mousemove",p),()=>{c.removeEventListener("mousemove",p)};function p(t){if(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 d();let c;if(!t.target.classList.contains("is-root-container")){c=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")}if(i(c)||"disabled"===s(c))return;const p=n(c)?.orientation||"vertical",m=t.clientY,f=t.clientX;let g=Array.from(t.target.children).find((e=>{const t=e.getBoundingClientRect();return e.classList.contains("wp-block")&&"vertical"===p&&t.top>m||e.classList.contains("wp-block")&&"horizontal"===p&&((0,v.isRTL)()?t.right<f:t.left>f)}));if(!g)return void d();if(!g.id&&(g=g.firstElementChild,!g))return void d();const h=g.id.slice(6);if(!h||a(h))return;if(l().includes(h))return;const b=g.getBoundingClientRect();if("horizontal"===p&&(t.clientY>b.bottom||t.clientY<b.top)||"vertical"===p&&(t.clientX>b.right||t.clientX<b.left))return void d();const _=o(h);0!==_?u(c,_,{__unstableWithInserter:!0}):d()}}),[e,n,o,r,u,d,l,t])}const Lg="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,Rg="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function Ag(e){return(0,f.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t($o),{getBlockType:r,getActiveBlockVariation:l}=t(a.store),i=n(e),s=r(i);if(!s)return null;const c=o(e),u=l(i,c),d=(0,a.isReusableBlock)(s)||(0,a.isTemplatePart)(s),p=function(e){const t=e?.style?.position?.type;return"sticky"===t?(0,v.__)("Sticky"):"fixed"===t?(0,v.__)("Fixed"):null}(c),m={isSynced:d,title:s.title,icon:s.icon,description:s.description,anchor:c?.anchor,positionLabel:p,positionType:c?.style?.position?.type};return u?{isSynced:d,title:u.title||s.title,icon:u.icon||s.icon,description:u.description||s.description,anchor:c?.anchor,positionLabel:p,positionType:c?.style?.position?.type}:m}),[e])}function Dg({clientId:e,maximumLength:t,context:n}){const{attributes:o,name:r,reusableBlockTitle:l}=(0,f.useSelect)((t=>{if(!e)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:r}=t($o),l=n(e);if(!l)return{};const i=(0,a.isReusableBlock)((0,a.getBlockType)(l));return{attributes:o(e),name:l,reusableBlockTitle:i&&r(o(e).ref)}}),[e]),i=Ag(e);if(!r||!i)return null;const s=(0,a.getBlockType)(r),c=s?(0,a.__experimentalGetBlockLabel)(s,o,n):null,u=l||c,d=u&&u!==s.title?u:i.title;if(t&&t>0&&d.length>t){const e="...";return d.slice(0,t-e.length)+e}return d}function Og({clientId:e,maximumLength:t,context:n}){return Dg({clientId:e,maximumLength:t,context:n})}var zg=({children:e,clientIds:t,cloneClassname:n,onDragStart:o,onDragEnd:r})=>{const{srcRootClientId:l,isDraggable:i,icon:s}=(0,f.useSelect)((e=>{const{canMoveBlocks:n,getBlockRootClientId:o,getBlockName:r}=e($o),{getBlockType:l}=e(a.store),i=o(t[0]),s=r(t[0]);return{srcRootClientId:i,isDraggable:n(t,i),icon:l(s)?.icon}}),[t]),u=(0,c.useRef)(!1),[d,p,g]=function(){const e=(0,c.useRef)(null),t=(0,c.useRef)(null),n=(0,c.useRef)(null),o=(0,c.useRef)(null);return(0,c.useEffect)((()=>()=>{o.current&&(clearInterval(o.current),o.current=null)}),[]),[(0,c.useCallback)((r=>{e.current=r.clientY,n.current=(0,ta.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,c.useCallback)((o=>{if(!n.current)return;const r=n.current.offsetHeight,l=e.current-n.current.offsetTop,i=o.clientY-n.current.offsetTop;if(o.clientY>l){const e=Math.max(r-l-50,0),n=Math.max(i-l-50,0),o=0===e||0===n?0:n/e;t.current=25*o}else if(o.clientY<l){const e=Math.max(l-50,0),n=Math.max(l-i-50,0),o=0===e||0===n?0:n/e;t.current=-25*o}else t.current=0}),[]),()=>{e.current=null,n.current=null,o.current&&(clearInterval(o.current),o.current=null)}]}(),{startDraggingBlocks:h,stopDraggingBlocks:b}=(0,f.useDispatch)($o);if((0,c.useEffect)((()=>()=>{u.current&&b()}),[]),!i)return e({draggable:!1});const v={type:"block",srcClientIds:t,srcRootClientId:l};return(0,c.createElement)(m.Draggable,{cloneClassname:n,__experimentalTransferDataType:"wp-blocks",transferData:v,onDragStart:e=>{window.requestAnimationFrame((()=>{h(t),u.current=!0,d(e),o&&o()}))},onDragOver:p,onDragEnd:()=>{b(),u.current=!1,g(),r&&r()},__experimentalDragComponent:(0,c.createElement)(Tm,{count:t.length,icon:s})},(({onDraggableStart:t,onDraggableEnd:n})=>e({draggable:!0,onDragStart:t,onDragEnd:n})))};var Vg=(0,c.createElement)(F.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(F.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"}));var Fg=(0,c.createElement)(F.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(F.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));const Hg=(e,t)=>"up"===e?"horizontal"===t?(0,v.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,v.isRTL)()?"left":"right":"down":null;function Gg(e,t,n,o,r,l,i){const a=n+1;if(e>1)return function(e,t,n,o,r,l){const i=t+1;if(n&&o)return(0,v.__)("All blocks are selected, and cannot be moved");if(r>0&&!o){const t=Hg("down",l);if("down"===t)return(0,v.sprintf)((0,v.__)("Move %1$d blocks from position %2$d down by one place"),e,i);if("left"===t)return(0,v.sprintf)((0,v.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,v.sprintf)((0,v.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r>0&&o){const e=Hg("down",l);if("down"===e)return(0,v.__)("Blocks cannot be moved down as they are already at the bottom");if("left"===e)return(0,v.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,v.__)("Blocks cannot be moved right as they are already are at the rightmost position")}if(r<0&&!n){const t=Hg("up",l);if("up"===t)return(0,v.sprintf)((0,v.__)("Move %1$d blocks from position %2$d up by one place"),e,i);if("left"===t)return(0,v.sprintf)((0,v.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,v.sprintf)((0,v.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r<0&&n){const e=Hg("up",l);if("up"===e)return(0,v.__)("Blocks cannot be moved up as they are already at the top");if("left"===e)return(0,v.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,v.__)("Blocks cannot be moved right as they are already are at the rightmost position")}}(e,n,o,r,l,i);if(o&&r)return(0,v.sprintf)((0,v.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=Hg("down",i);if("down"===e)return(0,v.sprintf)((0,v.__)("Move %1$s block from position %2$d down to position %3$d"),t,a,a+1);if("left"===e)return(0,v.sprintf)((0,v.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a+1);if("right"===e)return(0,v.sprintf)((0,v.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a+1)}if(l>0&&r){const e=Hg("down",i);if("down"===e)return(0,v.sprintf)((0,v.__)("Block %1$s is at the end of the content and cant be moved down"),t);if("left"===e)return(0,v.sprintf)((0,v.__)("Block %1$s is at the end of the content and cant be moved left"),t);if("right"===e)return(0,v.sprintf)((0,v.__)("Block %1$s is at the end of the content and cant be moved right"),t)}if(l<0&&!o){const e=Hg("up",i);if("up"===e)return(0,v.sprintf)((0,v.__)("Move %1$s block from position %2$d up to position %3$d"),t,a,a-1);if("left"===e)return(0,v.sprintf)((0,v.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a-1);if("right"===e)return(0,v.sprintf)((0,v.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a-1)}if(l<0&&o){const e=Hg("up",i);if("up"===e)return(0,v.sprintf)((0,v.__)("Block %1$s is at the beginning of the content and cant be moved up"),t);if("left"===e)return(0,v.sprintf)((0,v.__)("Block %1$s is at the beginning of the content and cant be moved left"),t);if("right"===e)return(0,v.sprintf)((0,v.__)("Block %1$s is at the beginning of the content and cant be moved right"),t)}}const Ug=(e,t)=>"up"===e?"horizontal"===t?(0,v.isRTL)()?Gd:Ud:Vg:"down"===e?"horizontal"===t?(0,v.isRTL)()?Ud:Gd:Fg:null,$g=(e,t)=>"up"===e?"horizontal"===t?(0,v.isRTL)()?(0,v.__)("Move right"):(0,v.__)("Move left"):(0,v.__)("Move up"):"down"===e?"horizontal"===t?(0,v.isRTL)()?(0,v.__)("Move left"):(0,v.__)("Move right"):(0,v.__)("Move down"):null,jg=(0,c.forwardRef)((({clientIds:e,direction:t,orientation:n,...o},r)=>{const l=(0,p.useInstanceId)(jg),i=Array.isArray(e)?e:[e],s=i.length,{blockType:u,isDisabled:g,rootClientId:h,isFirst:b,isLast:v,firstIndex:_,orientation:k="vertical"}=(0,f.useSelect)((e=>{const{getBlockIndex:o,getBlockRootClientId:r,getBlockOrder:l,getBlock:s,getBlockListSettings:c}=e($o),u=i[0],d=r(u),p=o(u),m=o(i[i.length-1]),f=l(d),g=s(u),h=0===p,b=m===f.length-1,{orientation:v}=c(d)||{};return{blockType:g?(0,a.getBlockType)(g.name):null,isDisabled:"up"===t?h:b,rootClientId:d,firstIndex:p,isFirst:h,isLast:b,orientation:n||v}}),[e,t]),{moveBlocksDown:y,moveBlocksUp:E}=(0,f.useDispatch)($o),w="up"===t?E:y,S=`block-editor-block-mover-button__description-${l}`;return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.Button,{ref:r,className:d()("block-editor-block-mover-button",`is-${t}-button`),icon:Ug(t,k),label:$g(t,k),"aria-describedby":S,...o,onClick:g?null:t=>{w(e,h),o.onClick&&o.onClick(t)},disabled:g,__experimentalIsFocusable:!0}),(0,c.createElement)(m.VisuallyHidden,{id:S},Gg(s,u&&u.title,_,b,v,"up"===t?-1:1,k)))})),Wg=(0,c.forwardRef)(((e,t)=>(0,c.createElement)(jg,{direction:"up",ref:t,...e}))),Kg=(0,c.forwardRef)(((e,t)=>(0,c.createElement)(jg,{direction:"down",ref:t,...e})));var qg=function({clientIds:e,hideDragHandle:t}){const{canMove:n,rootClientId:o,isFirst:r,isLast:l,orientation:i}=(0,f.useSelect)((t=>{const{getBlockIndex:n,getBlockListSettings:o,canMoveBlocks:r,getBlockOrder:l,getBlockRootClientId:i}=t($o),a=Array.isArray(e)?e:[e],s=a[0],c=i(s),u=n(s),d=n(a[a.length-1]),p=l(c);return{canMove:r(e,c),rootClientId:c,isFirst:0===u,isLast:d===p.length-1,orientation:o(c)?.orientation}}),[e]);if(!n||r&&l&&!o)return null;const a=(0,v.__)("Drag");return(0,c.createElement)(m.ToolbarGroup,{className:d()("block-editor-block-mover",{"is-horizontal":"horizontal"===i})},!t&&(0,c.createElement)(zg,{clientIds:e},(e=>(0,c.createElement)(m.Button,{icon:Im,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:a,tabIndex:"-1",...e}))),(0,c.createElement)("div",{className:"block-editor-block-mover__move-button-container"},(0,c.createElement)(m.ToolbarItem,null,(t=>(0,c.createElement)(Wg,{clientIds:e,...t}))),(0,c.createElement)(m.ToolbarItem,null,(t=>(0,c.createElement)(Kg,{clientIds:e,...t})))))};var Zg=function({clientId:e,rootClientId:t}){const n=Ag(e),o=(0,f.useSelect)((n=>{const{getBlock:o,getBlockIndex:r,hasBlockMovingClientId:l,getBlockListSettings:i,__unstableGetEditorMode:a}=n($o),s=r(e),{name:c,attributes:u}=o(e);return{index:s,name:c,attributes:u,blockMovingMode:l(),orientation:i(t)?.orientation,editorMode:a()}}),[e,t]),{index:r,name:l,attributes:i,blockMovingMode:s,orientation:u,editorMode:p}=o,{setNavigationMode:g,removeBlock:h}=(0,f.useDispatch)($o),b=(0,c.useRef)(),_=(0,a.getBlockType)(l),k=(0,a.__experimentalGetAccessibleBlockLabel)(_,i,r+1,u);(0,c.useEffect)((()=>{b.current.focus(),(0,Mn.speak)(k)}),[k]);const y=Td(e),{hasBlockMovingClientId:E,getBlockIndex:w,getBlockRootClientId:S,getClientIdsOfDescendants:C,getSelectedBlockClientId:x,getMultiSelectedBlocksEndClientId:B,getPreviousBlockClientId:I,getNextBlockClientId:T}=(0,f.useSelect)($o),{selectBlock:M,clearSelectedBlock:P,setBlockMovingClientId:N,moveBlockToPosition:L}=(0,f.useDispatch)($o),R=d()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!s}),A=(0,v.__)("Drag");return(0,c.createElement)("div",{className:R},(0,c.createElement)(m.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},(0,c.createElement)(m.FlexItem,null,(0,c.createElement)(jd,{icon:n?.icon,showColors:!0})),(0,c.createElement)(m.FlexItem,null,"zoom-out"===p&&(0,c.createElement)(qg,{clientIds:[e],hideDragHandle:!0}),"navigation"===p&&(0,c.createElement)(zg,{clientIds:[e]},(e=>(0,c.createElement)(m.Button,{icon:Im,className:"block-selection-button_drag-handle","aria-hidden":"true",label:A,tabIndex:"-1",...e})))),(0,c.createElement)(m.FlexItem,null,(0,c.createElement)(m.Button,{ref:b,onClick:"navigation"===p?()=>g(!1):void 0,onKeyDown:function(t){const{keyCode:n}=t,o=n===Ed.UP,r=n===Ed.DOWN,l=n===Ed.LEFT,i=n===Ed.RIGHT,a=n===Ed.TAB,s=n===Ed.ESCAPE,c=n===Ed.ENTER,u=n===Ed.SPACE,d=t.shiftKey;if(n===Ed.BACKSPACE||n===Ed.DELETE)return h(e),void t.preventDefault();const p=x(),m=B(),f=I(m||p),g=T(m||p),b=a&&d||o,v=a&&!d||r,_=l,k=i;let R;if(b)R=f;else if(v)R=g;else if(_){var A;R=null!==(A=S(p))&&void 0!==A?A:p}else if(k){var D;R=null!==(D=C([p])[0])&&void 0!==D?D:p}const O=E();if(s&&O&&!t.defaultPrevented&&(N(null),t.preventDefault()),(c||u)&&O){const e=S(O),t=S(p),n=w(O);let o=w(p);n<o&&e===t&&(o-=1),L(O,e,t,o),M(O),N(null)}if(v||b||_||k)if(R)t.preventDefault(),M(R);else if(a&&p){let e;if(v){e=y;do{e=ta.focus.tabbable.findNext(e)}while(e&&y.contains(e));e||(e=y.ownerDocument.defaultView.frameElement,e=ta.focus.tabbable.findNext(e))}else e=ta.focus.tabbable.findPrevious(y);e&&(t.preventDefault(),e.focus(),P())}},label:k,showTooltip:!1,className:"block-selection-button_select-button"},(0,c.createElement)(Og,{clientId:e,maximumLength:35})))))};var Yg=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"}));var Xg=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"}));function Qg(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}function Jg(e,t,n,o,r,l){const[i]=(0,c.useState)(t),[a]=(0,c.useState)(o),s=(0,c.useCallback)((()=>{!function(e){const[t]=ta.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)}),[]);(0,rp.useShortcut)("core/block-editor/focus-toolbar",(()=>{l&&s()})),(0,c.useEffect)((()=>{i&&s()}),[n,i,s]),(0,c.useEffect)((()=>{const t=e.current;let n=0;return i||(n=window.requestAnimationFrame((()=>{const e=Qg(t),n=a||0;var o;e[n]&&(o=t).contains(o.ownerDocument.activeElement)&&e[n].focus({preventScroll:!0})}))),()=>{if(window.cancelAnimationFrame(n),!r||!t)return;const e=Qg(t).findIndex((e=>0===e.tabIndex));r(e)}}),[a,i])}var eh=function({children:e,focusOnMount:t,shouldUseKeyboardFocusShortcut:n=!0,__experimentalInitialIndex:o,__experimentalOnIndexChange:r,...l}){const i=(0,c.useRef)(),a=function(e){const[t,n]=(0,c.useState)(!0),o=(0,c.useCallback)((()=>{const t=!ta.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||$()("Using custom components as toolbar controls",{since:"5.6",alternative:"ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",link:"https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"}),n(t)}),[]);return(0,c.useLayoutEffect)((()=>{const t=new window.MutationObserver(o);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[t]),t}(i);return Jg(i,t,a,o,r,n),a?(0,c.createElement)(m.Toolbar,{label:l["aria-label"],ref:i,...l},e):(0,c.createElement)(m.NavigableMenu,{orientation:"horizontal",role:"toolbar",ref:i,...l},e)};const{clearTimeout:th,setTimeout:nh}=window,oh=()=>{},rh=200;function lh({ref:e,isFocused:t,debounceTimeout:n=rh,onChange:o=oh}){const[r,l]=(0,c.useState)(!1),i=(0,c.useRef)(),a=t=>{e?.current&&l(t),o(t)},s=()=>{const n=e?.current&&e.current.matches(":hover");return!t&&!n},u=()=>{const e=i.current;e&&th&&th(e)};return(0,c.useEffect)((()=>()=>{a(!1),u()}),[]),{showMovers:r,debouncedShowMovers:e=>{e&&e.stopPropagation(),u(),r||a(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),u(),i.current=nh((()=>{s()&&a(!1)}),n)}}}function ih({ref:e,debounceTimeout:t=rh,onChange:n=oh}){const[o,r]=(0,c.useState)(!1),{showMovers:l,debouncedShowMovers:i,debouncedHideMovers:a}=lh({ref:e,debounceTimeout:t,isFocused:o,onChange:n}),s=(0,c.useRef)(!1),u=()=>e?.current&&e.current.contains(e.current.ownerDocument.activeElement);return(0,c.useEffect)((()=>{const t=e.current,n=()=>{u()&&(r(!0),i())},o=()=>{u()||(r(!1),a())};return t&&!s.current&&(t.addEventListener("focus",n,!0),t.addEventListener("blur",o,!0),s.current=!0),()=>{t&&(t.removeEventListener("focus",n),t.removeEventListener("blur",o))}}),[e,s,r,i,a]),{showMovers:l,gestures:{onMouseMove:i,onMouseLeave:a}}}function ah(){const{selectBlock:e,toggleBlockHighlight:t}=(0,f.useDispatch)($o),{firstParentClientId:n,isVisible:o,isDistractionFree:r}=(0,f.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getSettings:r,getBlockEditingMode:l}=bn(e($o)),{hasBlockSupport:i}=e(a.store),s=n(o()),c=s[s.length-1],u=t(c),d=(0,a.getBlockType)(u),p=r();return{firstParentClientId:c,isVisible:c&&"default"===l(c)&&i(d,"__experimentalParentSelector",!0),isDistractionFree:p.isDistractionFree}}),[]),l=Ag(n),i=(0,c.useRef)(),{gestures:s}=ih({ref:i,onChange(e){e&&r||t(n,e)}});return o?(0,c.createElement)("div",{className:"block-editor-block-parent-selector",key:n,ref:i,...s},(0,c.createElement)(m.ToolbarButton,{className:"block-editor-block-parent-selector__button",onClick:()=>e(n),label:(0,v.sprintf)((0,v.__)("Select %s"),l?.title),showTooltip:!0,icon:(0,c.createElement)(jd,{icon:l?.icon})})):null}var sh=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zm-13.5 0V4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1v11.8c0 .1-.1.1-.1.1H4.6l-.1-.1z"}));function ch({blocks:e}){return(0,c.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,c.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,c.createElement)(m.Popover,{className:"block-editor-block-switcher__preview__popover",placement:"bottom-start",focusOnMount:!1},(0,c.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,c.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,v.__)("Preview")),(0,c.createElement)(wm,{viewportWidth:500,blocks:e})))))}const uh={};function dh({item:e,onSelect:t,setHoveredTransformItemName:n}){const{name:o,icon:r,title:l}=e;return(0,c.createElement)(m.MenuItem,{className:(0,a.getBlockMenuDefaultClassName)(o),onClick:e=>{e.preventDefault(),t(o)},onMouseLeave:()=>n(null),onMouseEnter:()=>n(o)},(0,c.createElement)(jd,{icon:r,showColors:!0}),l)}var ph=({transformations:e,onSelect:t,blocks:n})=>{const[o,r]=(0,c.useState)();return(0,c.createElement)(c.Fragment,null,o&&(0,c.createElement)(ch,{blocks:(0,a.cloneBlock)(n[0],e.find((({name:e})=>e===o)).attributes)}),e?.map((e=>(0,c.createElement)(dh,{key:e.name,item:e,onSelect:t,setHoveredTransformItemName:r}))))};function mh({restTransformations:e,onSelect:t,setHoveredTransformItemName:n}){return e.map((e=>(0,c.createElement)(fh,{key:e.name,item:e,onSelect:t,setHoveredTransformItemName:n})))}function fh({item:e,onSelect:t,setHoveredTransformItemName:n}){const{name:o,icon:r,title:l,isDisabled:i}=e;return(0,c.createElement)(m.MenuItem,{className:(0,a.getBlockMenuDefaultClassName)(o),onClick:e=>{e.preventDefault(),t(o)},disabled:i,onMouseLeave:()=>n(null),onMouseEnter:()=>n(o)},(0,c.createElement)(jd,{icon:r,showColors:!0}),l)}var gh=({className:e,possibleBlockTransformations:t,possibleBlockVariationTransformations:n,onSelect:o,onSelectVariation:r,blocks:l})=>{const[i,s]=(0,c.useState)(),{priorityTextTransformations:u,restTransformations:d}=function(e){const t={"core/paragraph":1,"core/heading":2,"core/list":3,"core/quote":4},n=(0,c.useMemo)((()=>{const n=Object.keys(t);return e.reduce(((e,t)=>{const{name:o}=t;return n.includes(o)?e.priorityTextTransformations.push(t):e.restTransformations.push(t),e}),{priorityTextTransformations:[],restTransformations:[]})}),[e]);return n.priorityTextTransformations.sort((({name:e},{name:n})=>t[e]<t[n]?-1:1)),n}(t),p=u.length&&d.length,f=!!d.length&&(0,c.createElement)(mh,{restTransformations:d,onSelect:o,setHoveredTransformItemName:s});return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.MenuGroup,{label:(0,v.__)("Transform to"),className:e},i&&(0,c.createElement)(ch,{blocks:(0,a.switchToBlockType)(l,i)}),!!n?.length&&(0,c.createElement)(ph,{transformations:n,blocks:l,onSelect:r}),u.map((e=>(0,c.createElement)(fh,{key:e.name,item:e,onSelect:o,setHoveredTransformItemName:s}))),!p&&f),!!p&&(0,c.createElement)(m.MenuGroup,{className:e},f))};var hh=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),bh=window.wp.tokenList,vh=n.n(bh);function _h(e,t,n){const o=new(vh())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function kh(e){return e?.find((e=>e.isDefault))}function yh({clientId:e,onSwitch:t}){const{styles:n,block:o,blockType:r,className:l}=(0,f.useSelect)((t=>{const{getBlock:n}=t($o),o=n(e);if(!o)return{};const r=(0,a.getBlockType)(o.name),{getBlockStyles:l}=t(a.store);return{block:o,blockType:r,styles:l(o.name),className:o.attributes.className||""}}),[e]),{updateBlockAttributes:i}=(0,f.useDispatch)($o),s=function(e){return e&&0!==e.length?kh(e)?e:[{name:"default",label:(0,v._x)("Default","block style"),isDefault:!0},...e]:[]}(n),u=function(e,t){for(const n of new(vh())(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 kh(e)}(s,l),d=function(e,t){return(0,c.useMemo)((()=>{const n=t?.example,o=t?.name;return n&&o?(0,a.getBlockFromExample)(o,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?(0,a.cloneBlock)(e):void 0}),[t?.example?e?.name:e,t])}(o,r);return{onSelect:n=>{const o=_h(l,u,n);i(e,{className:o}),t()},stylesToRender:s,activeStyle:u,genericPreviewBlock:d,className:l}}const Eh=()=>{};function wh({clientId:e,onSwitch:t=Eh}){const{onSelect:n,stylesToRender:o,activeStyle:r}=yh({clientId:e,onSwitch:t});return o&&0!==o.length?(0,c.createElement)(c.Fragment,null,o.map((e=>{const t=e.label||e.name;return(0,c.createElement)(m.MenuItem,{key:e.name,icon:r.name===e.name?hh:null,onClick:()=>n(e)},(0,c.createElement)(m.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function Sh({hoveredBlock:e,onSwitch:t}){const{clientId:n}=e;return(0,c.createElement)(m.MenuGroup,{label:(0,v.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,c.createElement)(wh,{clientId:n,onSwitch:t}))}const Ch=(e,t,n=new Set)=>{const{clientId:o,name:r,innerBlocks:l=[]}=e;if(!n.has(o)){if(r===t)return e;for(const e of l){const o=Ch(e,t,n);if(o)return o}}},xh=(e,t)=>{const n=((e,t)=>{const n=(0,a.__experimentalGetBlockAttributesNamesByRole)(e,"content");return n?.length?n.reduce(((e,n)=>(t[n]&&(e[n]=t[n]),e)),{}):t})(t.name,t.attributes);e.attributes={...e.attributes,...n}};var Bh=(e,t)=>(0,c.useMemo)((()=>e.reduce(((e,n)=>{const o=((e,t)=>{const n=t.map((e=>(0,a.cloneBlock)(e))),o=new Set;for(const t of e){let e=!1;for(const r of n){const n=Ch(r,t.name,o);if(n){e=!0,o.add(n.clientId),xh(n,t);break}}if(!e)return}return n})(t,n.blocks);return o&&e.push({...n,transformedBlocks:o}),e}),[])),[e,t]);function Ih({patterns:e,onSelect:t}){return(0,c.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,c.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,c.createElement)(m.Popover,{className:"block-editor-block-switcher__preview__popover",position:"bottom right"},(0,c.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,c.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,v.__)("Preview")),(0,c.createElement)(Th,{patterns:e,onSelect:t})))))}function Th({patterns:e,onSelect:t}){const n=(0,m.__unstableUseCompositeState)();return(0,c.createElement)(m.__unstableComposite,{...n,role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,v.__)("Patterns list")},e.map((e=>(0,c.createElement)(Mh,{key:e.name,pattern:e,onSelect:t,composite:n}))))}function Mh({pattern:e,onSelect:t,composite:n}){const o="block-editor-block-switcher__preview-patterns-container",r=(0,p.useInstanceId)(Mh,`${o}-list__item-description`);return(0,c.createElement)("div",{className:`${o}-list__list-item`},(0,c.createElement)(m.__unstableCompositeItem,{role:"option",as:"div",...n,"aria-label":e.title,"aria-describedby":e.description?r:void 0,className:`${o}-list__item`,onClick:()=>t(e.transformedBlocks)},(0,c.createElement)(wm,{blocks:e.transformedBlocks,viewportWidth:e.viewportWidth||500}),(0,c.createElement)("div",{className:`${o}-list__item-title`},e.title)),!!e.description&&(0,c.createElement)(m.VisuallyHidden,{id:r},e.description))}var Ph=function({blocks:e,patterns:t,onSelect:n}){const[o,r]=(0,c.useState)(!1),l=Bh(t,e);return l.length?(0,c.createElement)(m.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup"},o&&(0,c.createElement)(Ih,{patterns:l,onSelect:n}),(0,c.createElement)(m.MenuItem,{onClick:e=>{e.preventDefault(),r(!o)},icon:Gd},(0,v.__)("Patterns"))):null};const Nh=({clientIds:e,blocks:t})=>{const{replaceBlocks:n,multiSelect:o,updateBlockAttributes:r}=(0,f.useDispatch)($o),l=Ag(t[0].clientId),{possibleBlockTransformations:i,canRemove:s,hasBlockStyles:u,icon:d,patterns:p}=(0,f.useSelect)((n=>{const{getBlockRootClientId:o,getBlockTransformItems:r,__experimentalGetPatternTransformItems:i,canRemoveBlocks:s}=n($o),{getBlockStyles:c,getBlockType:u}=n(a.store),d=o(Array.isArray(e)?e[0]:e),[{name:p}]=t,m=1===t.length,f=m&&c(p);let g;if(m)g=l?.icon;else{g=1===new Set(t.map((({name:e})=>e))).size?u(p)?.icon:sh}return{possibleBlockTransformations:r(t,d),canRemove:s(e,d),hasBlockStyles:!!f?.length,icon:g,patterns:i(t,d)}}),[e,t,l?.icon]),g=function({clientIds:e,blocks:t}){const{activeBlockVariation:n,blockVariationTransformations:o}=(0,f.useSelect)((n=>{const{getBlockRootClientId:o,getBlockAttributes:r,canRemoveBlocks:l}=n($o),{getActiveBlockVariation:i,getBlockVariations:s}=n(a.store),c=o(Array.isArray(e)?e[0]:e),u=l(e,c);if(1!==t.length||!u)return uh;const[d]=t;return{blockVariationTransformations:s(d.name,"transform"),activeBlockVariation:i(d.name,r(d.clientId))}}),[e,t]);return(0,c.useMemo)((()=>o?.filter((({name:e})=>e!==n?.name))),[o,n])}({clientIds:e,blocks:t}),h=Dg({clientId:Array.isArray(e)?e[0]:e,maximumLength:35}),b=1===t.length&&(0,a.isReusableBlock)(t[0]),_=1===t.length&&(0,a.isTemplatePart)(t[0]);function k(e){e.length>1&&o(e[0].clientId,e[e.length-1].clientId)}const y=!!i.length&&s&&!_,E=!!g?.length,w=!!p?.length&&s;if(!u&&!y&&!E)return(0,c.createElement)(m.ToolbarGroup,null,(0,c.createElement)(m.ToolbarButton,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:h,icon:(0,c.createElement)(c.Fragment,null,(0,c.createElement)(jd,{icon:d,showColors:!0}),(b||_)&&(0,c.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},h))}));const S=h,C=1===t.length?(0,v.sprintf)((0,v.__)("%s: Change block type or style"),h):(0,v.sprintf)((0,v._n)("Change type of %d block","Change type of %d blocks",t.length),t.length),x=y||E,B=u||x||w;return(0,c.createElement)(m.ToolbarGroup,null,(0,c.createElement)(m.ToolbarItem,null,(o=>(0,c.createElement)(m.DropdownMenu,{className:"block-editor-block-switcher",label:S,popoverProps:{placement:"bottom-start",className:"block-editor-block-switcher__popover"},icon:(0,c.createElement)(c.Fragment,null,(0,c.createElement)(jd,{icon:d,className:"block-editor-block-switcher__toggle",showColors:!0}),(b||_)&&(0,c.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},h)),toggleProps:{describedBy:C,...o},menuProps:{orientation:"both"}},(({onClose:o})=>B&&(0,c.createElement)("div",{className:"block-editor-block-switcher__container"},w&&(0,c.createElement)(Ph,{blocks:t,patterns:p,onSelect:t=>{!function(t){n(e,t),k(t)}(t),o()}}),x&&(0,c.createElement)(gh,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:i,possibleBlockVariationTransformations:g,blocks:t,onSelect:r=>{!function(o){const r=(0,a.switchToBlockType)(t,o);n(e,r),k(r)}(r),o()},onSelectVariation:e=>{!function(e){r(t[0].clientId,{...g.find((({name:t})=>t===e)).attributes})}(e),o()}}),u&&(0,c.createElement)(Sh,{hoveredBlock:t[0],onSwitch:o})))))))};var Lh=({clientIds:e})=>{const t=(0,f.useSelect)((t=>t($o).getBlocksByClientId(e)),[e]);return!t.length||t.some((e=>!e))?null:(0,c.createElement)(Nh,{clientIds:e,blocks:t})};const{Fill:Rh,Slot:Ah}=(0,m.createSlotFill)("__unstableBlockToolbarLastItem");Rh.Slot=Ah;var Dh=Rh;function Oh(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}function zh(){const{getBlockName:e}=(0,f.useSelect)($o),{getBlockType:t}=(0,f.useSelect)(a.store),{createSuccessNotice:n}=(0,f.useDispatch)(Fm.store);return(0,c.useCallback)(((o,r)=>{let l="";if(1===r.length){const n=r[0],i=t(e(n))?.title;l="copy"===o?(0,v.sprintf)((0,v.__)('Copied "%s" to clipboard.'),i):(0,v.sprintf)((0,v.__)('Moved "%s" to clipboard.'),i)}else l="copy"===o?(0,v.sprintf)((0,v._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,v.sprintf)((0,v._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function Vh(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o,__unstableIsFullySelected:r,__unstableIsSelectionCollapsed:l,__unstableIsSelectionMergeable:i,__unstableGetSelectedBlocksWithPartialSelection:s,canInsertBlockType:c}=(0,f.useSelect)($o),{flashBlock:u,removeBlocks:d,replaceBlocks:m,__unstableDeleteSelection:g,__unstableExpandSelection:h,insertBlocks:b}=(0,f.useDispatch)($o),v=zh();return(0,p.useRefEffect)((p=>{function f(f){if(f.defaultPrevented)return;const _=t();if(0===_.length)return;if(!n()){const{target:e}=f,{ownerDocument:t}=e;if("copy"===f.type||"cut"===f.type?(0,ta.documentHasUncollapsedSelection)(t):(0,ta.documentHasSelection)(t))return}if(!p.contains(f.target.ownerDocument.activeElement))return;f.preventDefault();const k=i(),y=l()||r(),E=!y&&!k;if("copy"===f.type||"cut"===f.type)if(1===_.length&&u(_[0]),E)h();else{let t;if(v(f.type,_),y)t=e(_);else{const[n,o]=s();t=[n,...e(_.slice(1,_.length-1)),o]}const n=f.clipboardData.getData("__unstableWrapperBlockName");n&&(t=(0,a.createBlock)(n,JSON.parse(f.clipboardData.getData("__unstableWrapperBlockAttributes")),t));const o=(0,a.serialize)(t);f.clipboardData.setData("text/plain",function(e){e=e.replace(/<br>/g,"\n");return(0,ta.__unstableStripHTML)(e).trim().replace(/\n\n+/g,"\n\n")}(o)),f.clipboardData.setData("text/html",o)}if("cut"===f.type)y&&!E?d(_):g();else if("paste"===f.type){const{__experimentalCanUserUseUnfilteredHTML:e}=o(),{plainText:t,html:n,files:r}=function({clipboardData:e}){let t="",n="";try{t=e.getData("text/plain"),n=e.getData("text/html")}catch(t){try{n=e.getData("Text")}catch(e){return}}const o=(0,ta.getFilesFromDataTransfer)(e);return o.length&&!Oh(o,n)?{files:o}:{html:n,plainText:t,files:[]}}(f);let l=[];if(r.length){const e=(0,a.getBlockTransforms)("from");l=r.reduce(((t,n)=>{const o=(0,a.findTransform)(e,(e=>"files"===e.type&&e.isMatch([n])));return o&&t.push(o.transform([n])),t}),[]).flat()}else l=(0,a.pasteHandler)({HTML:n,plainText:t,mode:"BLOCKS",canUserUseUnfilteredHTML:e});if(1===_.length){const[e]=_;if(l.every((t=>c(t.name,e))))return void b(l,void 0,e)}m(_,l,l.length-1,-1)}}return p.ownerDocument.addEventListener("copy",f),p.ownerDocument.addEventListener("cut",f),p.ownerDocument.addEventListener("paste",f),()=>{p.ownerDocument.removeEventListener("copy",f),p.ownerDocument.removeEventListener("cut",f),p.ownerDocument.removeEventListener("paste",f)}}),[])}var Fh=function({children:e}){return(0,c.createElement)("div",{ref:Vh()},e)};const Hh="align",Gh="__experimentalBorder",Uh="color",$h="customClassName",jh="typography.__experimentalFontFamily",Wh="typography.fontSize",Kh="layout",qh=[...["typography.lineHeight",Wh,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",jh,"typography.textColumns","typography.__experimentalTextDecoration","typography.__experimentalTextTransform","typography.__experimentalLetterSpacing"],Gh,Uh,"spacing"];const Zh={align:e=>(0,a.hasBlockSupport)(e,Hh),borderColor:e=>function(e,t="any"){if("web"!==c.Platform.OS)return!1;const n=(0,a.getBlockSupport)(e,Gh);return!0===n||("any"===t?!!(n?.color||n?.radius||n?.width||n?.style):!!n?.[t])}(e,"color"),backgroundColor:e=>{const t=(0,a.getBlockSupport)(e,Uh);return t&&!1!==t.background},textColor:e=>{const t=(0,a.getBlockSupport)(e,Uh);return t&&!1!==t.text},gradient:e=>{const t=(0,a.getBlockSupport)(e,Uh);return null!==t&&"object"==typeof t&&!!t.gradients},className:e=>(0,a.hasBlockSupport)(e,$h,!0),fontFamily:e=>(0,a.hasBlockSupport)(e,jh),fontSize:e=>(0,a.hasBlockSupport)(e,Wh),layout:e=>(0,a.hasBlockSupport)(e,Kh),style:e=>qh.some((t=>(0,a.hasBlockSupport)(e,t)))};function Yh(e,t){return Object.entries(Zh).reduce(((n,[o,r])=>(r(e.name)&&r(t.name)&&(n[o]=e.attributes[o]),n)),{})}function Xh(e,t,n){for(let o=0;o<Math.min(t.length,e.length);o+=1)n(e[o].clientId,Yh(t[o],e[o])),Xh(e[o].innerBlocks,t[o].innerBlocks,n)}function Qh(){const e=(0,f.useRegistry)(),{updateBlockAttributes:t}=(0,f.useDispatch)($o),{createSuccessNotice:n,createWarningNotice:o,createErrorNotice:r}=(0,f.useDispatch)(Fm.store);return(0,c.useCallback)((async l=>{let i="";try{if(!window.navigator.clipboard)return void r((0,v.__)("Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers."),{type:"snackbar"});i=await window.navigator.clipboard.readText()}catch(e){return void r((0,v.__)("Unable to paste styles. Please allow browser clipboard permissions before continuing."),{type:"snackbar"})}if(!i||!function(e){try{const t=(0,a.parse)(e,{__unstableSkipMigrationLogs:!0,__unstableSkipAutop:!0});return 1!==t.length||"core/freeform"!==t[0].name}catch(e){return!1}}(i))return void o((0,v.__)("Unable to paste styles. Block styles couldn't be found within the copied content."),{type:"snackbar"});const s=(0,a.parse)(i);if(1===s.length?e.batch((()=>{Xh(l,l.map((()=>s[0])),t)})):e.batch((()=>{Xh(l,s,t)})),1===l.length){const e=(0,a.getBlockType)(l[0].name)?.title;n((0,v.sprintf)((0,v.__)("Pasted styles to %s."),e),{type:"snackbar"})}else n((0,v.sprintf)((0,v.__)("Pasted styles to %d blocks."),l.length),{type:"snackbar"})}),[e.batch,t,n,o,r])}function Jh({clientIds:e,children:t,__experimentalUpdateSelection:n}){const{canInsertBlockType:o,getBlockRootClientId:r,getBlocksByClientId:l,canMoveBlocks:i,canRemoveBlocks:s}=(0,f.useSelect)($o),{getDefaultBlockName:c,getGroupingBlockName:u}=(0,f.useSelect)(a.store),d=l(e),p=r(e[0]),m=d.every((e=>!!e&&((0,a.hasBlockSupport)(e.name,"color")||(0,a.hasBlockSupport)(e.name,"typography")))),g=d.every((e=>!!e&&(0,a.hasBlockSupport)(e.name,"multiple",!0)&&o(e.name,p))),h=o(c(),p),b=i(e,p),v=s(e,p),{removeBlocks:_,replaceBlocks:k,duplicateBlocks:y,insertAfterBlock:E,insertBeforeBlock:w,flashBlock:S,setBlockMovingClientId:C,setNavigationMode:x,selectBlock:B}=(0,f.useDispatch)($o),I=zh(),T=Qh();return t({canCopyStyles:m,canDuplicate:g,canInsertDefaultBlock:h,canMove:b,canRemove:v,rootClientId:p,blocks:d,onDuplicate(){return y(e,n)},onRemove(){return _(e,n)},onInsertBefore(){const t=Array.isArray(e)?e[0]:t;w(t)},onInsertAfter(){const t=Array.isArray(e)?e[e.length-1]:t;E(t)},onMoveTo(){x(!0),B(e[0]),C(e[0])},onGroup(){if(!d.length)return;const t=u(),n=(0,a.switchToBlockType)(d,t);n&&k(e,n)},onUngroup(){if(!d.length)return;const t=d[0].innerBlocks;t.length&&k(e,t)},onCopy(){const e=d.map((({clientId:e})=>e));1===d.length&&S(e[0]),I("copy",e)},async onPasteStyles(){await T(d)}})}var eb=(0,p.compose)((0,f.withSelect)(((e,{clientId:t})=>{const n=e($o).getBlock(t);return{block:n,shouldRender:n&&"core/html"===n.name}})),(0,f.withDispatch)(((e,{block:t})=>({onClick:()=>e($o).replaceBlocks(t.clientId,(0,a.rawHandler)({HTML:(0,a.getBlockContent)(t)}))}))))((function({shouldRender:e,onClick:t,small:n}){if(!e)return null;const o=(0,v.__)("Convert to Blocks");return(0,c.createElement)(m.MenuItem,{onClick:t},!n&&o)}));const{Fill:tb,Slot:nb}=(0,m.createSlotFill)("__unstableBlockSettingsMenuFirstItem");tb.Slot=nb;var ob=tb;function rb(e){return(0,f.useSelect)((t=>{const{getBlockRootClientId:n,getBlocksByClientId:o,canInsertBlockType:r,getSelectedBlockClientIds:l}=t($o),{getGroupingBlockName:i,getBlockType:s}=t(a.store),c=e?.length?e:l(),u=i(),d=r(u,c?.length?n(c[0]):void 0),p=o(c),m=1===p.length,[f]=p,g=m&&(f.name===u||s(f.name)?.transforms?.ungroup)&&!!f.innerBlocks.length;return{clientIds:c,isGroupable:d&&p.length,isUngroupable:g,blocksSelection:p,groupingBlockName:u,onUngroup:g&&s(f.name)?.transforms?.ungroup}}),[e])}function lb({clientIds:e,isGroupable:t,isUngroupable:n,onUngroup:o,blocksSelection:r,groupingBlockName:l,onClose:i=(()=>{})}){const{replaceBlocks:s}=(0,f.useDispatch)($o);return t||n?(0,c.createElement)(c.Fragment,null,t&&(0,c.createElement)(m.MenuItem,{onClick:()=>{(()=>{const t=(0,a.switchToBlockType)(r,l);t&&s(e,t)})(),i()}},(0,v._x)("Group","verb")),n&&(0,c.createElement)(m.MenuItem,{onClick:()=>{(()=>{let t=r[0].innerBlocks;t.length&&(o&&(t=o(r[0].attributes,r[0].innerBlocks)),s(e,t))})(),i()}},(0,v._x)("Ungroup","Ungrouping blocks from within a grouping block back into individual blocks within the Editor "))):null}function ib(e){return(0,f.useSelect)((t=>{const{canEditBlock:n,canMoveBlock:o,canRemoveBlock:r,canLockBlockType:l,getBlockName:i,getBlockRootClientId:a,getTemplateLock:s}=t($o),c=a(e),u=n(e),d=o(e,c),p=r(e,c);return{canEdit:u,canMove:d,canRemove:p,canLock:l(i(e)),isContentLocked:"contentOnly"===s(e),isLocked:!u||!d||!p}}),[e])}var ab=(0,c.createElement)(F.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(F.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"}));var sb=(0,c.createElement)(F.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(F.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"}));var cb=(0,c.createElement)(F.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(F.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 ub=["core/block","core/navigation"];function db(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function pb({clientId:e,onClose:t}){const[n,o]=(0,c.useState)({move:!1,remove:!1}),{canEdit:r,canMove:l,canRemove:i}=ib(e),{allowsEditLocking:s,templateLock:u,hasTemplateLock:d}=(0,f.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t($o),r=n(e),l=(0,a.getBlockType)(r);return{allowsEditLocking:ub.includes(r),templateLock:o(e)?.templateLock,hasTemplateLock:!!l?.attributes?.templateLock}}),[e]),[g,h]=(0,c.useState)(!!u),{updateBlockAttributes:b}=(0,f.useDispatch)($o),_=Ag(e),k=(0,p.useInstanceId)(pb,"block-editor-block-lock-modal__options-title");(0,c.useEffect)((()=>{o({move:!l,remove:!i,...s?{edit:!r}:{}})}),[r,l,i,s]);const y=Object.values(n).every(Boolean),E=Object.values(n).some(Boolean)&&!y;return(0,c.createElement)(m.Modal,{title:(0,v.sprintf)((0,v.__)("Lock %s"),_.title),overlayClassName:"block-editor-block-lock-modal",onRequestClose:t},(0,c.createElement)("p",null,(0,v.__)("Choose specific attributes to restrict or lock all available options.")),(0,c.createElement)("form",{onSubmit:o=>{o.preventDefault(),b([e],{lock:n,templateLock:g?db(n):void 0}),t()}},(0,c.createElement)("div",{role:"group","aria-labelledby":k,className:"block-editor-block-lock-modal__options"},(0,c.createElement)(m.CheckboxControl,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__options-title",label:(0,c.createElement)("span",{id:k},(0,v.__)("Lock all")),checked:y,indeterminate:E,onChange:e=>o({move:e,remove:e,...s?{edit:e}:{}})}),(0,c.createElement)("ul",{className:"block-editor-block-lock-modal__checklist"},s&&(0,c.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,c.createElement)(m.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,v.__)("Restrict editing"),checked:!!n.edit,onChange:e=>o((t=>({...t,edit:e})))}),(0,c.createElement)(m.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:n.edit?cb:ab})),(0,c.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,c.createElement)(m.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,v.__)("Disable movement"),checked:n.move,onChange:e=>o((t=>({...t,move:e})))}),(0,c.createElement)(m.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:n.move?cb:ab})),(0,c.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,c.createElement)(m.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,v.__)("Prevent removal"),checked:n.remove,onChange:e=>o((t=>({...t,remove:e})))}),(0,c.createElement)(m.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:n.remove?cb:ab}))),d&&(0,c.createElement)(m.ToggleControl,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__template-lock",label:(0,v.__)("Apply to all blocks inside"),checked:g,disabled:n.move&&!n.remove,onChange:()=>h(!g)})),(0,c.createElement)(m.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,c.createElement)(m.FlexItem,null,(0,c.createElement)(m.Button,{variant:"tertiary",onClick:t},(0,v.__)("Cancel"))),(0,c.createElement)(m.FlexItem,null,(0,c.createElement)(m.Button,{variant:"primary",type:"submit"},(0,v.__)("Apply"))))))}function mb({clientId:e}){const{canLock:t,isLocked:n}=ib(e),[o,r]=(0,c.useReducer)((e=>!e),!1);if(!t)return null;const l=n?(0,v.__)("Unlock"):(0,v.__)("Lock");return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.MenuItem,{icon:n?ab:sb,onClick:r},l),o&&(0,c.createElement)(pb,{clientId:e,onClose:r}))}const fb=()=>{};var gb=(0,p.compose)([(0,f.withSelect)(((e,{clientId:t})=>{const{getBlock:n,getBlockMode:o,getSettings:r}=e($o),l=n(t),i=r().codeEditingEnabled;return{mode:o(t),blockType:l?(0,a.getBlockType)(l.name):null,isCodeEditingEnabled:i}})),(0,f.withDispatch)(((e,{onToggle:t=fb,clientId:n})=>({onToggleMode(){e($o).toggleBlockMode(n),t()}})))])((function({blockType:e,mode:t,onToggleMode:n,small:o=!1,isCodeEditingEnabled:r=!0}){if(!e||!(0,a.hasBlockSupport)(e,"html",!0)||!r)return null;const l="visual"===t?(0,v.__)("Edit as HTML"):(0,v.__)("Edit visually");return(0,c.createElement)(m.MenuItem,{onClick:n},!o&&l)}));const{Fill:hb,Slot:bb}=(0,m.createSlotFill)("BlockSettingsMenuControls");function vb({...e}){return(0,c.createElement)(m.__experimentalStyleProvider,{document:document},(0,c.createElement)(hb,{...e}))}vb.Slot=({fillProps:e,clientIds:t=null,__unstableDisplayLocation:n})=>{const{selectedBlocks:o,selectedClientIds:r,canRemove:l}=(0,f.useSelect)((e=>{const{getBlockNamesByClientId:n,getSelectedBlockClientIds:o,canRemoveBlocks:r}=e($o),l=null!==t?t:o();return{selectedBlocks:n(l),selectedClientIds:l,canRemove:r(l)}}),[t]),{canLock:i}=ib(r[0]),a=1===r.length&&i,s=rb(r),{isGroupable:u,isUngroupable:d}=s,g=(u||d)&&l;return(0,c.createElement)(bb,{fillProps:{...e,__unstableDisplayLocation:n,selectedBlocks:o,selectedClientIds:r}},(t=>!t?.length>0&&!g&&!a?null:(0,c.createElement)(m.MenuGroup,null,g&&(0,c.createElement)(lb,{...s,onClose:e?.onClose}),a&&(0,c.createElement)(mb,{clientId:r[0]}),t,e?.canMove&&!e?.onlyBlock&&(0,c.createElement)(m.MenuItem,{onClick:(0,p.pipe)(e?.onClose,e?.onMoveTo)},(0,v.__)("Move to")),1===e?.count&&(0,c.createElement)(gb,{clientId:e?.firstBlockClientId,onToggle:e?.onClose}))))};var _b=vb;const kb={className:"block-editor-block-settings-menu__popover",placement:"bottom-start"};function yb({blocks:e,onCopy:t,label:n}){const o=(0,p.useCopyToClipboard)((()=>(0,a.serialize)(e)),t),r=e.length>1?(0,v.__)("Copy blocks"):(0,v.__)("Copy"),l=n||r;return(0,c.createElement)(m.MenuItem,{ref:o},l)}function Eb({clientIds:e,__experimentalSelectBlock:t,children:n,__unstableDisplayLocation:o,...r}){const l=Array.isArray(e)?e:[e],i=l.length,s=l[0],{firstParentClientId:u,isDistractionFree:d,onlyBlock:g,parentBlockType:h,previousBlockClientId:b,selectedBlockClientIds:_}=(0,f.useSelect)((e=>{const{getBlockCount:t,getBlockName:n,getBlockRootClientId:o,getPreviousBlockClientId:r,getSelectedBlockClientIds:l,getSettings:i,getBlockAttributes:c}=e($o),{getActiveBlockVariation:u}=e(a.store),d=o(s),p=d&&n(d);return{firstParentClientId:d,isDistractionFree:i().isDistractionFree,onlyBlock:1===t(d),parentBlockType:d&&(u(p,c(d))||(0,a.getBlockType)(p)),previousBlockClientId:r(s),selectedBlockClientIds:l()}}),[s]),{getBlockOrder:k,getSelectedBlockClientIds:y}=(0,f.useSelect)($o),E=(0,f.useSelect)((e=>{const{getShortcutRepresentation:t}=e(rp.store);return{duplicate:t("core/block-editor/duplicate"),remove:t("core/block-editor/remove"),insertAfter:t("core/block-editor/insert-after"),insertBefore:t("core/block-editor/insert-before")}}),[]),w=(0,rp.__unstableUseShortcutEventMatch)(),{selectBlock:S,toggleBlockHighlight:C}=(0,f.useDispatch)($o),x=_.length>0,B=(0,c.useCallback)((async e=>{if(t){const n=await e;n&&n[0]&&t(n[0],!1)}}),[t]),I=(0,c.useCallback)((()=>{if(t){let e=b||u;e||(e=k()[0]);const n=x&&0===y().length;t(e,n)}}),[t,b,u,k,x,y]),T=1===i?(0,v.__)("Delete"):(0,v.__)("Delete blocks"),M=(0,c.useRef)(),{gestures:P}=ih({ref:M,onChange(e){e&&d||C(u,e)}}),N=_?.includes(u);return(0,c.createElement)(Jh,{clientIds:e,__experimentalUpdateSelection:!t},(({canCopyStyles:t,canDuplicate:l,canInsertDefaultBlock:a,canMove:d,canRemove:f,onDuplicate:b,onInsertAfter:_,onInsertBefore:k,onRemove:y,onCopy:C,onPasteStyles:x,onMoveTo:L,blocks:R})=>(0,c.createElement)(m.DropdownMenu,{icon:Lf,label:(0,v.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:kb,noIcons:!0,menuProps:{onKeyDown(e){e.defaultPrevented||(w("core/block-editor/remove",e)&&f?(e.preventDefault(),I(y())):w("core/block-editor/duplicate",e)&&l?(e.preventDefault(),B(b())):w("core/block-editor/insert-after",e)&&a?(e.preventDefault(),_()):w("core/block-editor/insert-before",e)&&a&&(e.preventDefault(),k()))}},...r},(({onClose:r})=>(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.MenuGroup,null,(0,c.createElement)(ob.Slot,{fillProps:{onClose:r}}),!N&&!!u&&(0,c.createElement)(m.MenuItem,{...P,ref:M,icon:(0,c.createElement)(jd,{icon:h.icon}),onClick:()=>S(u)},(0,v.sprintf)((0,v.__)("Select parent block (%s)"),h.title)),1===i&&(0,c.createElement)(eb,{clientId:s}),(0,c.createElement)(yb,{blocks:R,onCopy:C}),l&&(0,c.createElement)(m.MenuItem,{onClick:(0,p.pipe)(r,b,B),shortcut:E.duplicate},(0,v.__)("Duplicate")),a&&(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.MenuItem,{onClick:(0,p.pipe)(r,k),shortcut:E.insertBefore},(0,v.__)("Add before")),(0,c.createElement)(m.MenuItem,{onClick:(0,p.pipe)(r,_),shortcut:E.insertAfter},(0,v.__)("Add after")))),t&&(0,c.createElement)(m.MenuGroup,null,(0,c.createElement)(yb,{blocks:R,onCopy:C,label:(0,v.__)("Copy styles")}),(0,c.createElement)(m.MenuItem,{onClick:x},(0,v.__)("Paste styles"))),(0,c.createElement)(_b.Slot,{fillProps:{onClose:r,canMove:d,onMoveTo:L,onlyBlock:g,count:i,firstBlockClientId:s},clientIds:e,__unstableDisplayLocation:o}),"function"==typeof n?n({onClose:r}):c.Children.map((e=>(0,c.cloneElement)(e,{onClose:r}))),f&&(0,c.createElement)(m.MenuGroup,null,(0,c.createElement)(m.MenuItem,{onClick:(0,p.pipe)(r,y,I),shortcut:E.remove},T)))))))}var wb=Eb;var Sb=function({clientIds:e,...t}){return(0,c.createElement)(m.ToolbarGroup,null,(0,c.createElement)(m.ToolbarItem,null,(n=>(0,c.createElement)(wb,{clientIds:e,toggleProps:n,...t}))))};function Cb({clientId:e,wrapperRef:t}){const{canEdit:n,canMove:o,canRemove:r,canLock:l}=ib(e),[i,a]=(0,c.useReducer)((e=>!e),!1),s=(0,c.useRef)(null),u=(0,c.useRef)(!0),d=!l||n&&o&&r;return(0,c.useEffect)((()=>{u.current?u.current=!1:!i&&d&&ta.focus.focusable.find(t.current,{sequential:!1}).find((e=>"BUTTON"===e.tagName&&e!==s.current))?.focus()}),[i,d,t]),d?null:(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.ToolbarGroup,{className:"block-editor-block-lock-toolbar"},(0,c.createElement)(m.ToolbarButton,{icon:cb,label:(0,v.__)("Unlock"),onClick:a,ref:s})),i&&(0,c.createElement)(pb,{clientId:e,onClose:a}))}var xb=(0,c.createElement)(F.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(F.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"}));var Bb=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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"}));var Ib=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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"}));const Tb={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}};var Mb=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=rb(),{replaceBlocks:r}=(0,f.useDispatch)($o),{canRemove:l,variations:i}=(0,f.useSelect)((e=>{const{canRemoveBlocks:o}=e($o),{getBlockVariations:r}=e(a.store);return{canRemove:o(t),variations:r(n,"transform")}}),[t,n]),s=o=>{const l=(0,a.switchToBlockType)(e,n);"string"!=typeof o&&(o="group"),l&&l.length>0&&(l[0].attributes.layout=Tb[o],r(t,l))};if(!o||!l)return null;const u=!!i.find((({name:e})=>"group-row"===e)),d=!!i.find((({name:e})=>"group-stack"===e));return(0,c.createElement)(m.ToolbarGroup,null,(0,c.createElement)(m.ToolbarButton,{icon:xb,label:(0,v._x)("Group","verb"),onClick:s}),u&&(0,c.createElement)(m.ToolbarButton,{icon:Bb,label:(0,v._x)("Row","single horizontal line"),onClick:()=>s("row")}),d&&(0,c.createElement)(m.ToolbarButton,{icon:Ib,label:(0,v._x)("Stack","verb"),onClick:()=>s("stack")}))};function Pb({clientIds:e}){const t=1===e.length?e[0]:void 0,n=(0,f.useSelect)((e=>!!t&&"html"===e($o).getBlockMode(t)),[t]),{toggleBlockMode:o}=(0,f.useDispatch)($o);return n?(0,c.createElement)(m.ToolbarGroup,null,(0,c.createElement)(m.ToolbarButton,{onClick:()=>{o(t)}},(0,v.__)("Edit visually"))):null}var Nb=(0,c.createContext)("");var Lb=({hideDragHandle:e})=>{const{blockClientIds:t,blockClientId:n,blockType:o,hasFixedToolbar:r,isDistractionFree:l,isValid:i,isVisual:s,blockEditingMode:u}=(0,f.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:o,isBlockValid:r,getBlockRootClientId:l,getSettings:i,getBlockEditingMode:s}=bn(e($o)),c=o(),u=c[0],d=l(u),p=i();return{blockClientIds:c,blockClientId:u,blockType:u&&(0,a.getBlockType)(t(u)),hasFixedToolbar:p.hasFixedToolbar,isDistractionFree:p.isDistractionFree,rootClientId:d,isValid:c.every((e=>r(e))),isVisual:c.every((e=>"visual"===n(e))),blockEditingMode:s(u)}}),[]),g=(0,c.useRef)(null),{toggleBlockHighlight:h}=(0,f.useDispatch)($o),b=(0,c.useRef)(),{showMovers:v,gestures:_}=ih({ref:b,onChange(e){e&&l||h(n,e)}}),k=(0,p.useViewportMatch)("medium","<")||r,y=!(0,p.useViewportMatch)("medium","<");if(o&&!(0,a.hasBlockSupport)(o,"__experimentalToolbar",!0))return null;const E=k||v;if(0===t.length)return null;const w=i&&s,S=t.length>1,C=(0,a.isReusableBlock)(o)||(0,a.isTemplatePart)(o),x=d()("block-editor-block-toolbar",{"is-showing-movers":E,"is-synced":C});return(0,c.createElement)("div",{className:x,ref:g},!S&&y&&"default"===u&&(0,c.createElement)(ah,null),(w||S)&&"default"===u&&(0,c.createElement)("div",{ref:b,..._},(0,c.createElement)(m.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls"},(0,c.createElement)(Lh,{clientIds:t}),!S&&(0,c.createElement)(Cb,{clientId:t[0],wrapperRef:g}),(0,c.createElement)(qg,{clientIds:t,hideDragHandle:e}))),w&&S&&(0,c.createElement)(Mb,null),w&&(0,c.createElement)(c.Fragment,null,(0,c.createElement)(nr.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,c.createElement)(nr.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,c.createElement)(nr.Slot,{className:"block-editor-block-toolbar__slot"}),(0,c.createElement)(nr.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,c.createElement)(nr.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,c.createElement)(Nb.Provider,{value:o?.name},(0,c.createElement)(Dh.Slot,null))),(0,c.createElement)(Pb,{clientIds:t}),"default"===u&&(0,c.createElement)(Sb,{clientIds:t}))};var Rb=function({focusOnMount:e,isFixed:t,...n}){const[o,r]=(0,c.useState)(!1),l=(0,c.useRef)(),i=(0,p.useViewportMatch)("medium"),{blockType:s,hasParents:u,showParentSelector:g,selectedBlockClientId:h}=(0,f.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientIds:o,getBlockEditingMode:r}=bn(e($o)),{getBlockType:l}=e(a.store),i=o(),s=i[0],c=n(s),u=c[c.length-1],d=l(t(u));return{selectedBlockClientId:s,blockType:s&&l(t(s)),hasParents:c.length,showParentSelector:d&&"default"===r(u)&&(0,a.hasBlockSupport)(d,"__experimentalParentSelector",!0)&&i.length<=1&&"default"===r(s)}}),[]);if((0,c.useEffect)((()=>{r(!1)}),[h]),s&&!(0,a.hasBlockSupport)(s,"__experimentalToolbar",!0))return null;const b=d()("block-editor-block-contextual-toolbar",{"has-parent":u&&g,"is-fixed":t,"is-collapsed":o});return(0,c.createElement)(eh,{focusOnMount:e,className:b,"aria-label":(0,v.__)("Block tools"),...n},!o&&(0,c.createElement)(Lb,{hideDragHandle:t}),t&&i&&s&&(0,c.createElement)(m.ToolbarGroup,{className:o?"block-editor-block-toolbar__group-expand-fixed-toolbar":"block-editor-block-toolbar__group-collapse-fixed-toolbar"},(0,c.createElement)(m.ToolbarItem,{as:m.ToolbarButton,ref:l,icon:o?Yg:Xg,onClick:()=>{r((e=>!e)),l.current.focus()},label:o?(0,v.__)("Show block tools"):(0,v.__)("Hide block tools")})))};const{CustomSelectControl:Ab}=bn(m.privateApis),Db="position",Ob="block-editor-hooks__position-selection__select-control__option",zb={key:"default",value:"",name:(0,v.__)("Default"),className:Ob},Vb={key:"sticky",value:"sticky",name:(0,v._x)("Sticky","Name for the value of the CSS position property"),className:Ob,__experimentalHint:(0,v.__)("The block will stick to the top of the window instead of scrolling.")},Fb={key:"fixed",value:"fixed",name:(0,v._x)("Fixed","Name for the value of the CSS position property"),className:Ob,__experimentalHint:(0,v.__)("The block will not move when the page is scrolled.")},Hb=["top","right","bottom","left"],Gb=["sticky","fixed"];function Ub(e){const t=e.style?.position?.type;return"sticky"===t||"fixed"===t}function $b({name:e}={}){const t=Qr("position.fixed"),n=Qr("position.sticky"),o=!t&&!n;return r=e,!(0,a.getBlockSupport)(r,Db)||o;var r}function jb(e){const{attributes:{style:t={}},clientId:n,name:o,setAttributes:r}=e,l=function(e){const t=(0,a.getBlockSupport)(e,Db);return!(!0!==t&&!t?.fixed)}(o),i=function(e){const t=(0,a.getBlockSupport)(e,Db);return!(!0!==t&&!t?.sticky)}(o),s=t?.position?.type,{firstParentClientId:u}=(0,f.useSelect)((e=>{const{getBlockParents:t}=e($o),o=t(n);return{firstParentClientId:o[o.length-1]}}),[n]),d=Ag(u),p=i&&s===Vb.value&&d?(0,v.sprintf)((0,v.__)("The block will stick to the scrollable area of the parent %s block."),d.title):null,g=(0,c.useMemo)((()=>{const e=[zb];return(i||s===Vb.value)&&e.push(Vb),(l||s===Fb.value)&&e.push(Fb),e}),[l,i,s]),h=s&&g.find((e=>e.value===s))||zb;return c.Platform.select({web:g.length>1?(0,c.createElement)(Zi,{group:"position"},(0,c.createElement)(m.BaseControl,{className:"block-editor-hooks__position-selection",__nextHasNoMarginBottom:!0,help:p},(0,c.createElement)(Ab,{__nextUnconstrainedWidth:!0,__next36pxDefaultSize:!0,className:"block-editor-hooks__position-selection__select-control",label:(0,v.__)("Position"),hideLabelFromVision:!0,describedBy:(0,v.sprintf)((0,v.__)("Currently selected position: %s"),h.name),options:g,value:h,__experimentalShowSelectedHint:!0,onChange:({selectedItem:e})=>{(e=>{const n={...t,position:{...t?.position,type:e,top:"sticky"===e||"fixed"===e?"0px":void 0}};r({style:Ol(n)})})(e.value)},size:"__unstable-large"}))):null,native:null})}const Wb=(0,p.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,a.hasBlockSupport)(n,Db)&&!$b(t)&&(0,c.createElement)(jb,{key:"position",...t}),(0,c.createElement)(e,{key:"edit",...t})]}),"withInspectorControls"),Kb=(0,p.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,r=(0,a.hasBlockSupport)(n,Db)&&!$b(t),l=(0,p.useInstanceId)(e),i=(0,c.useContext)(wv.__unstableElementContext);let s;r&&(s=function({selector:e,style:t}){let n="";const{type:o}=t?.position||{};return Gb.includes(o)?(n+=`${e} {`,n+=`position: ${o};`,Hb.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-${l}.wp-container-${l}`,style:o?.style})||"");const u=d()(t?.className,{[`wp-container-${l}`]:r&&!!s,[`is-position-${o?.style?.position?.type}`]:r&&!!s&&!!o?.style?.position?.type});return(0,c.createElement)(c.Fragment,null,r&&i&&!!s&&(0,c.createPortal)((0,c.createElement)("style",null,s),i),(0,c.createElement)(e,{...t,className:u}))}),"withPositionStyles");(0,s.addFilter)("editor.BlockListBlock","core/editor/position/with-position-styles",Kb),(0,s.addFilter)("editor.BlockEdit","core/editor/position/with-inspector-controls",Wb);const qb={placement:"top-start"},Zb={...qb,flip:!1,shift:!0},Yb={...qb,flip:!0,shift:!1};function Xb(e,t,n,o,r){if(!e||!t)return Zb;const l=n?.scrollTop||0,i=t.getBoundingClientRect(),a=l+e.getBoundingClientRect().top,s=e.ownerDocument.documentElement.clientHeight,c=a+o,u=i.top>c,d=i.height>s-o;return r||!u&&!d?Yb:Zb}function Qb(){const e=(0,p.useViewportMatch)("medium"),{shouldShowContextualToolbar:t,canFocusHiddenToolbar:n,fixedToolbarCanBeFocused:o}=(0,f.useSelect)((t=>{const{__unstableGetEditorMode:n,isMultiSelecting:o,isTyping:r,isBlockInterfaceHidden:l,getBlock:i,getSettings:s,isNavigationMode:c,getSelectedBlockClientId:u,getFirstMultiSelectedBlockClientId:d}=bn(t($o)),p="edit"===n(),m=s().hasFixedToolbar,f=s().isDistractionFree,g=d()||u(),h=!!g,b=(0,a.isUnmodifiedDefaultBlock)(i(g)||{}),v=p&&!m&&(!f||c())&&e&&!o()&&!r()&&h&&!b&&!l();return{shouldShowContextualToolbar:v,canFocusHiddenToolbar:p&&h&&!v&&!m&&!f&&!b,fixedToolbarCanBeFocused:(m||!e)&&g}}),[e]);return{shouldShowContextualToolbar:t,canFocusHiddenToolbar:n,fixedToolbarCanBeFocused:o}}function Jb(e){const{__unstableGetEditorMode:t,hasMultiSelection:n,isTyping:o,getLastMultiSelectedBlockClientId:r}=e($o);return{editorMode:t(),hasMultiSelection:n(),isTyping:o(),lastClientId:n()?r():null}}function ev({clientId:e,rootClientId:t,isEmptyDefaultBlock:n,capturingClientId:o,__unstablePopoverSlot:r,__unstableContentRef:l}){const{editorMode:i,hasMultiSelection:a,isTyping:s,lastClientId:u}=(0,f.useSelect)(Jb,[]),m=(0,f.useSelect)((t=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=t($o);if(!n())return!1;const l=o();return r(l.rootClientId)[l.index]===e}),[e]),g=(0,c.useRef)(!1),{shouldShowContextualToolbar:h,canFocusHiddenToolbar:b}=Qb(),{stopTyping:v}=(0,f.useDispatch)($o),_=!s&&"edit"===i&&n,k=!a&&("navigation"===i||"zoom-out"===i);(0,rp.useShortcut)("core/block-editor/focus-toolbar",(()=>{g.current=!0,v(!0)}),{isDisabled:!b}),(0,c.useEffect)((()=>{g.current=!1}));const y=(0,c.useRef)();(0,c.useEffect)((()=>{y.current=void 0}),[e]);const E=function({contentElement:e,clientId:t}){const n=Td(t),[o,r]=(0,c.useState)(0),{blockIndex:l,isSticky:i}=(0,f.useSelect)((e=>{const{getBlockIndex:n,getBlockAttributes:o}=e($o);return{blockIndex:n(t),isSticky:Ub(o(t))}}),[t]),a=(0,c.useMemo)((()=>{if(e)return(0,ta.getScrollContainer)(e)}),[e]),[s,u]=(0,c.useState)((()=>Xb(e,n,a,o,i))),d=(0,p.useRefEffect)((e=>{r(e.offsetHeight)}),[]),m=(0,c.useCallback)((()=>u(Xb(e,n,a,o,i))),[e,n,a,o]);return(0,c.useLayoutEffect)(m,[l,m]),(0,c.useLayoutEffect)((()=>{if(!e||!n)return;const t=e?.ownerDocument?.defaultView;let o;t?.addEventHandler?.("resize",m);const r=n?.ownerDocument?.defaultView;return r.ResizeObserver&&(o=new r.ResizeObserver(m),o.observe(n)),()=>{t?.removeEventHandler?.("resize",m),o&&o.disconnect()}}),[m,e,n]),{...s,ref:d}}({contentElement:l?.current,clientId:e});return _?(0,c.createElement)(xg,{clientId:o||e,__unstableCoverTarget:!0,bottomClientId:u,className:d()("block-editor-block-list__block-side-inserter-popover",{"is-insertion-point-visible":m}),__unstablePopoverSlot:r,__unstableContentRef:l,resize:!1,shift:!1,...E},(0,c.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},(0,c.createElement)(gg,{position:"bottom right",rootClientId:t,clientId:e,__experimentalIsQuick:!0}))):k||h?(0,c.createElement)(xg,{clientId:o||e,bottomClientId:u,className:d()("block-editor-block-list__block-popover",{"is-insertion-point-visible":m}),__unstablePopoverSlot:r,__unstableContentRef:l,resize:!1,...E},h&&(0,c.createElement)(Rb,{focusOnMount:g.current,__experimentalInitialIndex:y.current,__experimentalOnIndexChange:e=>{y.current=e},key:e}),k&&(0,c.createElement)(Zg,{clientId:e,rootClientId:t})):null}function tv(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:r,getBlockParents:l,__experimentalGetBlockListSettingsForBlocks:i}=e($o),s=t()||n();if(!s)return;const{name:c,attributes:u={}}=r(s)||{},d=l(s),p=i(d),m=d.find((e=>p[e]?.__experimentalCaptureToolbars));return{clientId:s,rootClientId:o(s),name:c,isEmptyDefaultBlock:c&&(0,a.isUnmodifiedDefaultBlock)({name:c,attributes:u}),capturingClientId:m}}function nv({__unstablePopoverSlot:e,__unstableContentRef:t}){const n=(0,f.useSelect)(tv,[]);if(!n)return null;const{clientId:o,rootClientId:r,name:l,isEmptyDefaultBlock:i,capturingClientId:a}=n;return l?(0,c.createElement)(ev,{clientId:o,rootClientId:r,isEmptyDefaultBlock:i,capturingClientId:a,__unstablePopoverSlot:e,__unstableContentRef:t}):null}function ov({children:e}){const t=(0,c.useContext)(Tg),n=(0,c.useContext)(m.Disabled.Context);return t||n?e:($()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8",version:"6.3"}),(0,c.createElement)(Pg,{__unstablePopoverSlot:"block-toolbar"},(0,c.createElement)(nv,{__unstablePopoverSlot:"block-toolbar"}),e))}var rv=(0,p.createHigherOrderComponent)((e=>t=>{const{clientId:n}=Zo();return(0,c.createElement)(e,{...t,clientId:n})}),"withClientId");var lv=rv((({clientId:e,showSeparator:t,isFloating:n,onAddBlock:o,isToggle:r})=>(0,c.createElement)(_g,{className:d()({"block-list-appender__toggle":r}),rootClientId:e,showSeparator:t,isFloating:n,onAddBlock:o})));var iv=(0,p.compose)([rv,(0,f.withSelect)(((e,{clientId:t})=>{const{getBlockOrder:n}=e($o),o=n(t);return{lastBlockClientId:o[o.length-1]}}))])((({clientId:e})=>(0,c.createElement)(hg,{rootClientId:e})));const av=new WeakMap;function sv(e,t,n,o,r,l,i){return s=>{const{srcRootClientId:c,srcClientIds:u,type:d,blocks:p}=function(e){let t={srcRootClientId:null,srcClientIds:null,srcIndex:null,type:null,blocks:null};if(!e.dataTransfer)return t;try{t=Object.assign(t,JSON.parse(e.dataTransfer.getData("wp-blocks")))}catch(e){return t}return t}(s);if("inserter"===d){i();const e=p.map((e=>(0,a.cloneBlock)(e)));l(e,!0,null)}if("block"===d){const l=n(u[0]);if(c===e&&l===t)return;if(u.includes(e)||o(u).some((t=>t===e)))return;const i=c===e,a=u.length;r(u,c,i&&l<t?t-a:t)}}}function cv(e,t,n={}){const{operation:o="insert"}=n,r=(0,f.useSelect)((e=>e($o).getSettings().mediaUpload),[]),{canInsertBlockType:l,getBlockIndex:i,getClientIdsOfDescendants:s,getBlockOrder:u,getBlocksByClientId:d}=(0,f.useSelect)($o),{insertBlocks:p,moveBlocksToPosition:m,updateBlockAttributes:g,clearSelectedBlock:h,replaceBlocks:b,removeBlocks:v}=(0,f.useDispatch)($o),_=(0,f.useRegistry)(),k=(0,c.useCallback)(((n,r=!0,l=0)=>{if("replace"===o){const o=u(e)[t];b(o,n,void 0,l)}else p(n,t,e,r,l)}),[o,u,p,b,t,e]),y=(0,c.useCallback)(((n,r,l)=>{if("replace"===o){const o=d(n),r=u(e)[t];_.batch((()=>{v(n,!1),b(r,o,void 0,0)}))}else m(n,r,e,l)}),[o,u,d,p,m,v,t,e]),E=sv(e,t,i,s,y,k,h),w=function(e,t,n,o,r,l){return t=>{if(!n)return;const i=(0,a.findTransform)((0,a.getBlockTransforms)("from"),(n=>"files"===n.type&&r(n.blockName,e)&&n.isMatch(t)));if(i){const e=i.transform(t,o);l(e)}}}(e,0,r,g,l,k),S=function(e,t,n){return e=>{const t=(0,a.pasteHandler)({HTML:e,mode:"BLOCKS"});t.length&&n(t)}}(0,0,k);return e=>{const t=(0,ta.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?S(n):t.length?w(t):E(e)}}function uv(e,t,n=["top","bottom","left","right"]){let o,r;return n.forEach((n=>{const l=function(e,t,n){const o="top"===n||"bottom"===n,{x:r,y:l}=e,i=o?r:l,a=o?l:r,s=o?t.left:t.top,c=o?t.right:t.bottom,u=t[n];let d;return d=i>=s&&i<=c?i:i<c?s:c,Math.sqrt((i-d)**2+(a-u)**2)}(e,t,n);(void 0===o||l<o)&&(o=l,r=n)})),[o,r]}function dv(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}function pv({rootClientId:e=""}={}){const t=(0,f.useRegistry)(),[n,o]=(0,c.useState)({index:null,operation:"insert"}),r=(0,f.useSelect)((t=>{const{__unstableIsWithinBlockOverlay:n,__unstableHasActiveBlockOverlayActive:o,getBlockEditingMode:r}=bn(t($o));return"default"!==r(e)||o(e)||n(e)}),[e]),{getBlockListSettings:l,getBlocks:i,getBlockIndex:s}=(0,f.useSelect)($o),{showInsertionPoint:u,hideInsertionPoint:d}=(0,f.useDispatch)($o),m=cv(e,n.index,{operation:n.operation}),g=(0,p.useThrottle)((0,c.useCallback)(((n,r)=>{const c=i(e);if(0===c.length)return void t.batch((()=>{o({index:0,operation:"insert"}),u(e,0,{operation:"insert"})}));const d=c.map((e=>{const t=e.clientId;return{isUnmodifiedDefaultBlock:(0,a.isUnmodifiedDefaultBlock)(e),getBoundingClientRect:()=>r.getElementById(`block-${t}`).getBoundingClientRect(),blockIndex:s(t)}})),[p,m]=function(e,t,n="vertical"){const o="horizontal"===n?["left","right"]:["top","bottom"],r=(0,v.isRTL)();let l=0,i="before",a=1/0;e.forEach((({isUnmodifiedDefaultBlock:e,getBoundingClientRect:n,blockIndex:s})=>{const c=n();let[u,d]=uv(t,c,o);e&&dv(t,c)&&(u=0),u<a&&(i="bottom"===d||!r&&"right"===d||r&&"left"===d?"after":"before",a=u,l=s)}));const s=l+("after"===i?1:-1),c=!!e[l]?.isUnmodifiedDefaultBlock,u=!!e[s]?.isUnmodifiedDefaultBlock;if(!c&&!u)return["after"===i?l+1:l,"insert"];return[c?l:s,"replace"]}(d,{x:n.clientX,y:n.clientY},l(e)?.orientation);t.batch((()=>{o({index:p,operation:m}),u(e,p,{operation:m})}))}),[i,e,l,t,u,s]),200);return(0,p.__experimentalUseDropZone)({isDisabled:r,onDrop:m,onDragOver(e){g(e,e.currentTarget.ownerDocument)},onDragLeave(){g.cancel(),d()},onDragEnd(){g.cancel(),d()}})}const mv={};function fv(e){const{clientId:t,allowedBlocks:n,prioritizedInserterBlocks:o,__experimentalDefaultBlock:r,__experimentalDirectInsert:l,template:i,templateLock:s,wrapperRef:u,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:p,__experimentalAppenderTagName:m,renderAppender:g,orientation:h,placeholder:v,layout:_}=e;!function(e,t,n,o,r,l,i,a,s){const{updateBlockListSettings:u}=(0,f.useDispatch)($o),d=(0,f.useRegistry)(),{parentLock:p}=(0,f.useSelect)((t=>{const n=t($o).getBlockRootClientId(e);return{parentLock:t($o).getTemplateLock(n)}}),[e]),m=(0,c.useMemo)((()=>t),t),g=(0,c.useMemo)((()=>n),n),h=void 0===l||"contentOnly"===p?p:l;(0,c.useLayoutEffect)((()=>{const t={allowedBlocks:m,prioritizedInserterBlocks:g,templateLock:h};if(void 0!==i&&(t.__experimentalCaptureToolbars=i),void 0!==a)t.orientation=a;else{const e=si(s?.type);t.orientation=e.getOrientation(s)}void 0!==o&&(t.__experimentalDefaultBlock=o),void 0!==r&&(t.__experimentalDirectInsert=r),av.get(d)||av.set(d,[]),av.get(d).push([e,t]),window.queueMicrotask((()=>{av.get(d)?.length&&d.batch((()=>{av.get(d).forEach((e=>{u(...e)})),av.set(d,[])}))}))}),[e,m,g,h,o,r,i,a,u,s,d])}(t,n,o,r,l,s,p,h,_),function(e,t,n,o){const{getBlocks:r,getSelectedBlocksInitialCaretPosition:l,isBlockSelected:i}=(0,f.useSelect)($o),{replaceInnerBlocks:s,__unstableMarkNextChangeAsNotPersistent:u}=(0,f.useDispatch)($o),{innerBlocks:d}=(0,f.useSelect)((t=>({innerBlocks:t($o).getBlocks(e)})),[e]),p=(0,c.useRef)(null);(0,c.useLayoutEffect)((()=>{let c=!1;return window.queueMicrotask((()=>{if(c)return;const d=r(e),m=0===d.length||"all"===n||"contentOnly"===n,f=!b()(t,p.current);if(!m||!f)return;p.current=t;const g=(0,a.synchronizeBlocksWithTemplate)(d,t);b()(g,d)||(u(),s(e,g,0===d.length&&o&&0!==g.length&&i(e),l()))})),()=>{c=!0}}),[d,t,n,e])}(t,i,s,d);const k=function(e){return(0,f.useSelect)((t=>{const n=t($o).getBlock(e);if(!n)return;const o=t(a.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),y=(0,f.useSelect)((e=>e($o).getBlock(t)?.name),[t]),E=(0,a.getBlockSupport)(y,"layout")||(0,a.getBlockSupport)(y,"__experimentalLayout")||mv,{allowSizingOnChildren:w=!1}=E,S=Qr("layout")||mv,C=_||E,x=(0,c.useMemo)((()=>({...S,...C,...w&&{allowSizingOnChildren:!0}})),[S,C,w]);return(0,c.createElement)(oa,{value:k},(0,c.createElement)(Cv,{rootClientId:t,renderAppender:g,__experimentalAppenderTagName:m,layout:x,wrapperRef:u,placeholder:v}))}function gv(e){return Zd(e),(0,c.createElement)(fv,{...e})}const hv=(0,c.forwardRef)(((e,t)=>{const n=bv({ref:t},e);return(0,c.createElement)("div",{className:"block-editor-inner-blocks"},(0,c.createElement)("div",{...n}))}));function bv(e={},t={}){const{__unstableDisableLayoutClassNames:n,__unstableDisableDropZone:o}=t,{clientId:r,layout:l=null,__unstableLayoutClassNames:i=""}=Zo(),s=(0,p.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:u,hasOverlay:m}=(0,f.useSelect)((e=>{if(!r)return{};const{getBlockName:t,isBlockSelected:n,hasSelectedInnerBlock:o,__unstableGetEditorMode:l}=e($o),i=t(r),c="navigation"===l()||s;return{__experimentalCaptureToolbars:e(a.store).hasBlockSupport(i,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==i&&!n(r)&&!o(r,!0)&&c}}),[r,s]),g=pv({rootClientId:r}),h=(0,p.useMergeRefs)([e.ref,o?null:g]),b={__experimentalCaptureToolbars:u,layout:l,...t},v=b.value&&b.onChange?gv:fv;return{...e,ref:h,className:d()(e.className,"block-editor-block-list__layout",n?"":i,{"has-overlay":m}),children:r?(0,c.createElement)(v,{...b,clientId:r}):(0,c.createElement)(Cv,{...t})}}bv.save=a.__unstableGetInnerBlocksProps,hv.DefaultBlockAppender=iv,hv.ButtonBlockAppender=lv,hv.Content=()=>bv.save().children;var vv=hv;const _v=(0,c.createContext)(),kv=(0,c.createContext)(),yv=new WeakMap;function Ev({className:e,...t}){const[n,o]=(0,c.useState)(),r=(0,p.useViewportMatch)("medium"),{isOutlineMode:l,isFocusMode:i,editorMode:a}=(0,f.useSelect)((e=>{const{getSettings:t,__unstableGetEditorMode:n}=e($o),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,editorMode:n()}}),[]),s=(0,f.useRegistry)(),{setBlockVisibility:u}=(0,f.useDispatch)($o),m=(0,p.useDebounce)((0,c.useCallback)((()=>{const e={};yv.get(s).forEach((([t,n])=>{e[t]=n})),u(e)}),[s]),300,{trailing:!0}),g=(0,c.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{yv.get(s)||yv.set(s,[]);for(const t of e){const e=t.target.getAttribute("data-block");yv.get(s).push([e,t.isIntersecting])}m()}))}),[]),h=bv({ref:(0,p.useMergeRefs)([Qd(),Ng(),o]),className:d()("is-root-container",e,{"is-outline-mode":l,"is-focus-mode":i&&r,"is-navigate-mode":"navigation"===a})},t);return(0,c.createElement)(_v.Provider,{value:n},(0,c.createElement)(kv.Provider,{value:g},(0,c.createElement)("div",{...h})))}function wv(e){return function(){const{patterns:e,isPreviewMode:t}=(0,f.useSelect)((e=>{const{__experimentalBlockPatterns:t,__unstableIsPreviewMode:n}=e($o).getSettings();return{patterns:t,isPreviewMode:n}}),[]);(0,c.useEffect)((()=>{if(t)return;if(!e?.length)return;let n,o=-1;const r=()=>{o++,o>=e.length||((0,f.select)($o).__experimentalGetParsedPattern(e[o].name),n=Lg(r))};return n=Lg(r),()=>Rg(n)}),[e,t])}(),(0,c.createElement)(ov,null,(0,c.createElement)(qo,{value:Wo},(0,c.createElement)(Ev,{...e})))}function Sv({placeholder:e,rootClientId:t,renderAppender:n,__experimentalAppenderTagName:o,layout:r=ci}){const{order:l,selectedBlocks:i,visibleBlocks:a}=(0,f.useSelect)((e=>{const{getBlockOrder:n,getSelectedBlockClientIds:o,__unstableGetVisibleBlocks:r}=e($o);return{order:n(t),selectedBlocks:o(),visibleBlocks:r()}}),[t]);return(0,c.createElement)(di,{value:r},l.map((e=>(0,c.createElement)(f.AsyncModeProvider,{key:e,value:!a.has(e)&&!i.includes(e)},(0,c.createElement)(Od,{rootClientId:t,clientId:e})))),l.length<1&&e,(0,c.createElement)(yg,{tagName:o,rootClientId:t,renderAppender:n}))}function Cv(e){return(0,c.createElement)(f.AsyncModeProvider,{value:!1},(0,c.createElement)(Sv,{...e}))}wv.__unstableElementContext=_v,$p([jp,qp]);const xv=(e,t,n)=>{if(t){const n=e?.find((e=>e.slug===t));if(n)return n}return{color:n}},Bv=(e,t)=>e?.find((e=>e.color===t));function Iv(e,t){if(e&&t)return`has-${Rl(t)}-${e}`}function Tv(){const e={disableCustomColors:!Qr("color.custom"),disableCustomGradients:!Qr("color.customGradient")},t=Qr("color.palette.custom"),n=Qr("color.palette.theme"),o=Qr("color.palette.default"),r=Qr("color.defaultPalette");e.colors=(0,c.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,v._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,v._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,v._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[o,n,t,r]);const l=Qr("color.gradients.custom"),i=Qr("color.gradients.theme"),a=Qr("color.gradients.default"),s=Qr("color.defaultGradients");return e.gradients=(0,c.useMemo)((()=>{const e=[];return i&&i.length&&e.push({name:(0,v._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),s&&a&&a.length&&e.push({name:(0,v._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),l&&l.length&&e.push({name:(0,v._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,a,s]),e.hasColorsOrGradients=!!e.colors.length||!!e.gradients.length,e}function Mv(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function Pv(e={}){const{flat:t,...n}=e;return t||Mv(Object.values(n).filter(Boolean))||"px"}function Nv(e={}){if("string"==typeof e)return e;const t=Object.values(e).map((e=>(0,m.__experimentalParseQuantityAndUnitFromRawValue)(e))),n=t.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),o=t.map((e=>e[1])),r=n.every((e=>e===n[0]))?n[0]:"",l=Mv(o);return 0===r||r?`${r}${l}`:void 0}function Lv(e={}){const t=Nv(e);return"string"!=typeof e&&isNaN(parseFloat(t))}function Rv(e){if(!e)return!1;if("string"==typeof e)return!0;return!!Object.values(e).filter((e=>!!e||0===e)).length}function Av({onChange:e,selectedUnits:t,setSelectedUnits:n,values:o,...r}){let l=Nv(o);void 0===l&&(l=Pv(t));const i=Rv(o)&&Lv(o),a=i?(0,v.__)("Mixed"):null;return(0,c.createElement)(m.__experimentalUnitControl,{...r,"aria-label":(0,v.__)("Border radius"),disableUnits:i,isOnly:!0,value:l,onChange:t=>{const n=!isNaN(parseFloat(t));e(n?t:void 0)},onUnitChange:e=>{n({topLeft:e,topRight:e,bottomLeft:e,bottomRight:e})},placeholder:a,size:"__unstable-large"})}const Dv={topLeft:(0,v.__)("Top left"),topRight:(0,v.__)("Top right"),bottomLeft:(0,v.__)("Bottom left"),bottomRight:(0,v.__)("Bottom right")};function Ov({onChange:e,selectedUnits:t,setSelectedUnits:n,values:o,...r}){const l=t=>n=>{if(!e)return;const o=!isNaN(parseFloat(n))?n:void 0;e({...i,[t]:o})},i="string"!=typeof o?o:{topLeft:o,topRight:o,bottomLeft:o,bottomRight:o};return(0,c.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries(Dv).map((([e,o])=>{const[a,s]=(0,m.__experimentalParseQuantityAndUnitFromRawValue)(i[e]),u=i[e]?s:t[e]||t.flat;return(0,c.createElement)(m.Tooltip,{text:o,position:"top",key:e},(0,c.createElement)("div",{className:"components-border-radius-control__tooltip-wrapper"},(0,c.createElement)(m.__experimentalUnitControl,{...r,"aria-label":o,value:[a,u].join(""),onChange:l(e),onUnitChange:(d=e,e=>{const o={...t};o[d]=e,n(o)}),size:"__unstable-large"})));var d})))}var zv=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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"}));var Vv=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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"}));function Fv({isLinked:e,...t}){const n=e?(0,v.__)("Unlink radii"):(0,v.__)("Link radii");return(0,c.createElement)(m.Tooltip,{text:n},(0,c.createElement)("span",null,(0,c.createElement)(m.Button,{...t,className:"component-border-radius-control__linked-button",isSmall:!0,icon:e?zv:Vv,iconSize:24,"aria-label":n})))}const Hv={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},Gv=0,Uv={px:100,em:20,rem:20};function $v({onChange:e,values:t}){const[n,o]=(0,c.useState)(!Rv(t)||!Lv(t)),[r,l]=(0,c.useState)({flat:"string"==typeof t?(0,m.__experimentalParseQuantityAndUnitFromRawValue)(t)[1]:void 0,topLeft:(0,m.__experimentalParseQuantityAndUnitFromRawValue)(t?.topLeft)[1],topRight:(0,m.__experimentalParseQuantityAndUnitFromRawValue)(t?.topRight)[1],bottomLeft:(0,m.__experimentalParseQuantityAndUnitFromRawValue)(t?.bottomLeft)[1],bottomRight:(0,m.__experimentalParseQuantityAndUnitFromRawValue)(t?.bottomRight)[1]}),i=(0,m.__experimentalUseCustomUnits)({availableUnits:Qr("spacing.units")||["px","em","rem"]}),a=Pv(r),s=i&&i.find((e=>e.value===a)),u=s?.step||1,[d]=(0,m.__experimentalParseQuantityAndUnitFromRawValue)(Nv(t));return(0,c.createElement)("fieldset",{className:"components-border-radius-control"},(0,c.createElement)(m.BaseControl.VisualLabel,{as:"legend"},(0,v.__)("Radius")),(0,c.createElement)("div",{className:"components-border-radius-control__wrapper"},n?(0,c.createElement)(c.Fragment,null,(0,c.createElement)(Av,{className:"components-border-radius-control__unit-control",values:t,min:Gv,onChange:e,selectedUnits:r,setSelectedUnits:l,units:i}),(0,c.createElement)(m.RangeControl,{label:(0,v.__)("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:null!=d?d:"",min:Gv,max:Uv[a],initialPosition:0,withInputField:!1,onChange:t=>{e(void 0!==t?`${t}${a}`:void 0)},step:u,__nextHasNoMarginBottom:!0})):(0,c.createElement)(Ov,{min:Gv,onChange:e,selectedUnits:r,setSelectedUnits:l,values:t||Hv,units:i}),(0,c.createElement)(Fv,{onClick:()=>o(!n),isLinked:n})))}function jv(e){return[Wv(e),Kv(e),qv(e),Zv(e)].some(Boolean)}function Wv(e){return e?.border?.color}function Kv(e){return e?.border?.radius}function qv(e){return e?.border?.style}function Zv(e){return e?.border?.width}function Yv({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){return(0,c.createElement)(m.__experimentalToolsPanel,{label:(0,v.__)("Border"),resetAll:()=>{const o=e(n);t(o)},panelId:o},r)}const Xv={radius:!0,color:!0,width:!0};function Qv({as:e=Yv,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:l,defaultControls:i=Xv}){const a=Cl(r),s=e=>{const t=a.flatMap((({colors:e})=>e)).find((({color:t})=>t===e));return t?"var:preset|color|"+t.slug:e},u=(0,c.useCallback)((e=>{const t=a.flatMap((({colors:e})=>e)).find((({slug:t})=>e==="var:preset|color|"+t));return t?t.color:e}),[a]),d=(0,c.useMemo)((()=>{if((0,m.__experimentalHasSplitBorders)(o?.border)){const e={...o?.border};return["top","right","bottom","left"].forEach((t=>{e[t]={...e[t],color:u(e[t]?.color)}})),e}return{...o?.border,color:o?.border?.color?u(o?.border?.color):void 0}}),[o?.border,u]),p=e=>n({...t,border:e}),f=Wv(r),g=qv(r),h=Zv(r),b=Kv(r),_=(k=d?.radius,gl({settings:r},"",k));var k;const y=e=>p({...d,radius:e}),E=()=>{const e=t?.border?.radius;return"object"==typeof e?Object.entries(e).some(Boolean):!!e},w=(0,c.useCallback)((e=>({...e,border:void 0})),[]),S=i?.color||i?.width;return(0,c.createElement)(e,{resetAllFilter:w,value:t,onChange:n,panelId:l},(h||f)&&(0,c.createElement)(m.__experimentalToolsPanelItem,{hasValue:()=>(0,m.__experimentalIsDefinedBorder)(t?.border),label:(0,v.__)("Border"),onDeselect:()=>(()=>{if(E())return p({radius:t?.border?.radius});p(void 0)})(),isShownByDefault:S,panelId:l},(0,c.createElement)(m.__experimentalBorderBoxControl,{colors:a,enableAlpha:!0,enableStyle:g,onChange:e=>{const t={...e};(0,m.__experimentalHasSplitBorders)(t)?["top","right","bottom","left"].forEach((e=>{t[e]&&(t[e]={...t[e],color:s(t[e]?.color)})})):t&&(t.color=s(t.color)),p({radius:d?.radius,...t})},popoverOffset:40,popoverPlacement:"left-start",value:d,__experimentalIsRenderedInSidebar:!0,size:"__unstable-large"})),b&&(0,c.createElement)(m.__experimentalToolsPanelItem,{hasValue:E,label:(0,v.__)("Radius"),onDeselect:()=>y(void 0),isShownByDefault:i.radius,panelId:l},(0,c.createElement)($v,{values:_,onChange:e=>{y(e||void 0)}})))}const Jv="__experimentalBorder",e_=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},t_=({colors:e,namedColor:t,customColor:n})=>{if(t){const n=e_(e,"slug",t);if(n)return n}if(!n)return{color:void 0};const o=e_(e,"color",n);return o||{color:n}};function n_(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function o_(e){if((0,m.__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:Ol(o),borderColor:n}}function r_(e){return(0,m.__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 l_({children:e,resetAllFilter:t}){const n=(0,c.useCallback)((e=>{const n=r_(e),o=t(n);return{...e,...o_(o)}}),[t]);return(0,c.createElement)(Zi,{group:"border",resetAllFilter:n},e)}function i_(e){const{clientId:t,name:n,attributes:o,setAttributes:r}=e,l=Fl(n),i=jv(l),s=(0,c.useMemo)((()=>r_({style:o.style,borderColor:o.borderColor})),[o.style,o.borderColor]);if(!i)return null;const u=(0,a.getBlockSupport)(e.name,[Jv,"__experimentalDefaultControls"]);return(0,c.createElement)(Qv,{as:l_,panelId:t,settings:l,value:s,onChange:e=>{r(o_(e))},defaultControls:u})}function a_(e,t="any"){if("web"!==c.Platform.OS)return!1;const n=(0,a.getBlockSupport)(e,Jv);return!0===n||("any"===t?!!(n?.color||n?.radius||n?.width||n?.style):!!n?.[t])}function s_(e,t,n){if(!a_(t,"color")||Vl(t,Jv,"color"))return e;const o=c_(n),r=d()(e.className,o);return e.className=r||void 0,e}function c_(e){const{borderColor:t,style:n}=e,o=Iv("border-color",t);return d()({"has-border-color":t||n?.border?.color,[o]:!!o})}const u_=(0,p.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{borderColor:r,style:l}=o,{colors:i}=Tv();if(!a_(n,"color")||Vl(n,Jv,"color"))return(0,c.createElement)(e,{...t});const{color:a}=t_({colors:i,namedColor:r}),{color:s}=t_({colors:i,namedColor:n_(l?.border?.top?.color)}),{color:u}=t_({colors:i,namedColor:n_(l?.border?.right?.color)}),{color:d}=t_({colors:i,namedColor:n_(l?.border?.bottom?.color)}),{color:p}=t_({colors:i,namedColor:n_(l?.border?.left?.color)}),m={borderTopColor:s||a,borderRightColor:u||a,borderBottomColor:d||a,borderLeftColor:p||a};let f=t.wrapperProps;return f={...t.wrapperProps,style:{...t.wrapperProps?.style,...m}},(0,c.createElement)(e,{...t,wrapperProps:f})}),"withBorderColorPaletteStyles");function d_(e){if(e)return`has-${e}-gradient-background`}function p_(e,t){const n=e?.find((e=>e.slug===t));return n&&n.gradient}function m_(e,t){const n=e?.find((e=>e.gradient===t));return n}function f_(e,t){const n=m_(e,t);return n&&n.slug}function g_({gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}={}){const{clientId:n}=Zo(),o=Qr("color.gradients.custom"),r=Qr("color.gradients.theme"),l=Qr("color.gradients.default"),i=(0,c.useMemo)((()=>[...o||[],...r||[],...l||[]]),[o,r,l]),{gradient:a,customGradient:s}=(0,f.useSelect)((o=>{const{getBlockAttributes:r}=o($o),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:u}=(0,f.useDispatch)($o),d=(0,c.useCallback)((o=>{const r=f_(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),p=d_(a);let m;return m=a?p_(i,a):s,{gradientClass:p,gradientValue:m,setGradient:d}}(0,s.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return a_(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",s_),(0,s.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!a_(e,"color")||Vl(e,Jv,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),s_(o,e,n)},e})),(0,s.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",u_);const h_=["colors","disableCustomColors","gradients","disableCustomGradients"],b_={name:"color",title:"Solid",value:"color"},v_={name:"gradient",title:"Gradient",value:"gradient"},__=[b_,v_];function k_({colors:e,gradients:t,disableCustomColors:n,disableCustomGradients:o,__experimentalIsRenderedInSidebar:r,className:l,label:i,onColorChange:a,onGradientChange:s,colorValue:u,gradientValue:p,clearable:f,showTitle:g=!0,enableAlpha:h,headingLevel:b}){const v=a&&(e&&e.length>0||!n),_=s&&(t&&t.length>0||!o);if(!v&&!_)return null;const k={[b_.value]:(0,c.createElement)(m.ColorPalette,{value:u,onChange:_?e=>{a(e),s()}:a,colors:e,disableCustomColors:n,__experimentalIsRenderedInSidebar:r,clearable:f,enableAlpha:h,headingLevel:b}),[v_.value]:(0,c.createElement)(m.GradientPicker,{__nextHasNoMargin:!0,value:p,onChange:v?e=>{s(e),a()}:s,gradients:t,disableCustomGradients:o,__experimentalIsRenderedInSidebar:r,clearable:f,headingLevel:b})},y=e=>(0,c.createElement)("div",{className:"block-editor-color-gradient-control__panel"},k[e]);return(0,c.createElement)(m.BaseControl,{__nextHasNoMarginBottom:!0,className:d()("block-editor-color-gradient-control",l)},(0,c.createElement)("fieldset",{className:"block-editor-color-gradient-control__fieldset"},(0,c.createElement)(m.__experimentalVStack,{spacing:1},g&&(0,c.createElement)("legend",null,(0,c.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,c.createElement)(m.BaseControl.VisualLabel,null,i))),v&&_&&(0,c.createElement)(m.TabPanel,{className:"block-editor-color-gradient-control__tabs",tabs:__,initialTabName:p?v_.value:!!v&&b_.value},(e=>y(e.value))),!_&&y(b_.value),!v&&y(v_.value))))}function y_(e){const t={};return t.colors=Qr("color.palette"),t.gradients=Qr("color.gradients"),t.disableCustomColors=!Qr("color.custom"),t.disableCustomGradients=!Qr("color.customGradient"),(0,c.createElement)(k_,{...t,...e})}var E_=function(e){return h_.every((t=>e.hasOwnProperty(t)))?(0,c.createElement)(k_,{...e}):(0,c.createElement)(y_,{...e})};function w_(e){const t=S_(e),n=T_(e),o=C_(e),r=B_(e),l=B_(e),i=x_(e);return t||n||o||r||l||i}function S_(e){const t=Cl(e);return e?.color?.text&&(t?.length>0||e?.color?.custom)}function C_(e){const t=Cl(e);return e?.color?.link&&(t?.length>0||e?.color?.custom)}function x_(e){const t=Cl(e);return e?.color?.caption&&(t?.length>0||e?.color?.custom)}function B_(e){const t=Cl(e),n=xl(e);return e?.color?.heading&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function I_(e){const t=Cl(e),n=xl(e);return e?.color?.button&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function T_(e){const t=Cl(e),n=xl(e);return e?.color?.background&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function M_({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){return(0,c.createElement)(m.__experimentalToolsPanel,{label:(0,v.__)("Color"),resetAll:()=>{const o=e(n);t(o)},panelId:o,hasInnerWrapper:!0,className:"color-block-support-panel",__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},(0,c.createElement)("div",{className:"color-block-support-panel__inner-wrapper"},r))}const P_={text:!0,background:!0,link:!0,heading:!0,button:!0,caption:!0},N_={placement:"left-start",offset:36,shift:!0},L_=({indicators:e,label:t})=>(0,c.createElement)(m.__experimentalHStack,{justify:"flex-start"},(0,c.createElement)(m.__experimentalZStack,{isLayered:!1,offset:-8},e.map(((e,t)=>(0,c.createElement)(m.Flex,{key:t,expanded:!1},(0,c.createElement)(m.ColorIndicator,{colorValue:e}))))),(0,c.createElement)(m.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:t},t));function R_({isGradient:e,inheritedValue:t,userValue:n,setValue:o,colorGradientControlSettings:r}){return(0,c.createElement)(E_,{...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 A_({label:e,hasValue:t,resetValue:n,isShownByDefault:o,indicators:r,tabs:l,colorGradientControlSettings:i,panelId:a}){const s=l.map((({key:e,label:t})=>({name:e,title:t})));return(0,c.createElement)(m.__experimentalToolsPanelItem,{className:"block-editor-tools-panel-color-gradient-settings__item",hasValue:t,label:e,onDeselect:n,isShownByDefault:o,panelId:a},(0,c.createElement)(m.Dropdown,{popoverProps:N_,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:({onToggle:t,isOpen:n})=>{const o={onClick:t,className:d()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":n}),"aria-expanded":n,"aria-label":(0,v.sprintf)((0,v.__)("Color %s styles"),e)};return(0,c.createElement)(m.Button,{...o},(0,c.createElement)(L_,{indicators:r,label:e}))},renderContent:()=>(0,c.createElement)(m.__experimentalDropdownContentWrapper,{paddingSize:"none"},(0,c.createElement)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content"},1===l.length&&(0,c.createElement)(R_,{...l[0],colorGradientControlSettings:i}),l.length>1&&(0,c.createElement)(m.TabPanel,{tabs:s},(e=>{const t=l.find((t=>t.key===e.name));return t?(0,c.createElement)(R_,{...t,colorGradientControlSettings:i}):null}))))}))}function D_({as:e=M_,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:l,defaultControls:i=P_,children:a}){const s=Cl(r),u=xl(r),d=r?.color?.custom,p=r?.color?.customGradient,m=s.length>0||d,f=u.length>0||p,g=e=>gl({settings:r},"",e),h=e=>{const t=s.flatMap((({colors:e})=>e)).find((({color:t})=>t===e));return t?"var:preset|color|"+t.slug:e},b=e=>{const t=u.flatMap((({gradients:e})=>e)).find((({gradient:t})=>t===e));return t?"var:preset|gradient|"+t.slug:e},_=S_(r),k=g(o?.color?.text),y=g(t?.color?.text),E=e=>{n(Dl(t,["color","text"],h(e)))},w=T_(r),S=g(o?.color?.background),C=g(t?.color?.background),x=g(o?.color?.gradient),B=g(t?.color?.gradient),I=C_(r),T=g(o?.elements?.link?.color?.text),M=g(t?.elements?.link?.color?.text),P=g(o?.elements?.link?.[":hover"]?.color?.text),N=g(t?.elements?.link?.[":hover"]?.color?.text),L=[{name:"caption",label:(0,v.__)("Captions"),showPanel:x_(r)},{name:"button",label:(0,v.__)("Button"),showPanel:I_(r)},{name:"heading",label:(0,v.__)("Heading"),showPanel:B_(r)},{name:"h1",label:(0,v.__)("H1"),showPanel:B_(r)},{name:"h2",label:(0,v.__)("H2"),showPanel:B_(r)},{name:"h3",label:(0,v.__)("H3"),showPanel:B_(r)},{name:"h4",label:(0,v.__)("H4"),showPanel:B_(r)},{name:"h5",label:(0,v.__)("H5"),showPanel:B_(r)},{name:"h6",label:(0,v.__)("H6"),showPanel:B_(r)}],R=(0,c.useCallback)((e=>({...e,color:void 0,elements:{...e?.elements,link:{...e?.elements?.link,color:void 0,":hover":{color:void 0}},...L.reduce(((t,n)=>({...t,[n.name]:{...e?.elements?.[n.name],color:void 0}})),{})}})),[]),A=[_&&{key:"text",label:(0,v.__)("Text"),hasValue:()=>!!y,resetValue:()=>E(void 0),isShownByDefault:i.text,indicators:[k],tabs:[{key:"text",label:(0,v.__)("Text"),inheritedValue:k,setValue:E,userValue:y}]},w&&{key:"background",label:(0,v.__)("Background"),hasValue:()=>!!C||!!B,resetValue:()=>{const e=Dl(t,["color","background"],void 0);e.color.gradient=void 0,n(e)},isShownByDefault:i.background,indicators:[null!=x?x:S],tabs:[m&&{key:"background",label:(0,v.__)("Solid"),inheritedValue:S,setValue:e=>{const o=Dl(t,["color","background"],h(e));o.color.gradient=void 0,n(o)},userValue:C},f&&{key:"gradient",label:(0,v.__)("Gradient"),inheritedValue:x,setValue:e=>{const o=Dl(t,["color","gradient"],b(e));o.color.background=void 0,n(o)},userValue:B,isGradient:!0}].filter(Boolean)},I&&{key:"link",label:(0,v.__)("Link"),hasValue:()=>!!M||!!N,resetValue:()=>{let e=Dl(t,["elements","link",":hover","color","text"],void 0);e=Dl(e,["elements","link","color","text"],void 0),n(e)},isShownByDefault:i.link,indicators:[T,P],tabs:[{key:"link",label:(0,v.__)("Default"),inheritedValue:T,setValue:e=>{n(Dl(t,["elements","link","color","text"],h(e)))},userValue:M},{key:"hover",label:(0,v.__)("Hover"),inheritedValue:P,setValue:e=>{n(Dl(t,["elements","link",":hover","color","text"],h(e)))},userValue:N}]}].filter(Boolean);return L.forEach((({name:e,label:r,showPanel:l})=>{if(!l)return;const a=g(o?.elements?.[e]?.color?.background),s=g(o?.elements?.[e]?.color?.gradient),c=g(o?.elements?.[e]?.color?.text),u=g(t?.elements?.[e]?.color?.background),d=g(t?.elements?.[e]?.color?.gradient),p=g(t?.elements?.[e]?.color?.text),_="caption"!==e;A.push({key:e,label:r,hasValue:()=>!!(p||u||d),resetValue:()=>{const o=Dl(t,["elements",e,"color","background"],void 0);o.elements[e].color.gradient=void 0,o.elements[e].color.text=void 0,n(o)},isShownByDefault:i[e],indicators:_?[c,null!=s?s:a]:[c],tabs:[m&&{key:"text",label:(0,v.__)("Text"),inheritedValue:c,setValue:o=>{n(Dl(t,["elements",e,"color","text"],h(o)))},userValue:p},m&&_&&{key:"background",label:(0,v.__)("Background"),inheritedValue:a,setValue:o=>{const r=Dl(t,["elements",e,"color","background"],h(o));r.elements[e].color.gradient=void 0,n(r)},userValue:u},f&&_&&{key:"gradient",label:(0,v.__)("Gradient"),inheritedValue:s,setValue:o=>{const r=Dl(t,["elements",e,"color","gradient"],b(o));r.elements[e].color.background=void 0,n(r)},userValue:d,isGradient:!0}].filter(Boolean)})})),(0,c.createElement)(e,{resetAllFilter:R,value:t,onChange:n,panelId:l},A.map((e=>(0,c.createElement)(A_,{key:e.key,...e,colorGradientControlSettings:{colors:s,disableCustomColors:!d,gradients:u,disableCustomGradients:!p},panelId:l}))),a)}$p([jp,qp]);var O_=function({backgroundColor:e,fallbackBackgroundColor:t,fallbackTextColor:n,fallbackLinkColor:o,fontSize:r,isLargeText:l,textColor:i,linkColor:a,enableAlphaChecker:s=!1}){const u=e||t;if(!u)return null;const d=i||n,p=a||o;if(!d&&!p)return null;const f=[{color:d,description:(0,v.__)("text color")},{color:p,description:(0,v.__)("link color")}],g=Gp(u),h=g.alpha()<1,b=g.brightness(),_={level:"AA",size:l||!1!==l&&r>=24?"large":"small"};let k="",y="";for(const e of f){if(!e.color)continue;const t=Gp(e.color),n=t.isReadable(g,_),o=t.alpha()<1;if(!n){if(h||o)continue;k=b<t.brightness()?(0,v.sprintf)((0,v.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,v.sprintf)((0,v.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),e.description),y=(0,v.__)("This color combination may be hard for people to read.");break}o&&s&&(k=(0,v.__)("Transparent text may be hard for people to read."),y=(0,v.__)("Transparent text may be hard for people to read."))}return k?((0,Mn.speak)(y),(0,c.createElement)("div",{className:"block-editor-contrast-checker"},(0,c.createElement)(m.Notice,{spokenMessage:null,status:"warning",isDismissible:!1},k))):null};function z_(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function V_({clientId:e}){const[t,n]=(0,c.useState)(),[o,r]=(0,c.useState)(),[l,i]=(0,c.useState)(),a=Id(e);return(0,c.useEffect)((()=>{if(!a.current)return;r(z_(a.current).color);const e=a.current?.querySelector("a");e&&e.innerText&&i(z_(e).color);let t=a.current,o=z_(t).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&t.parentNode&&t.parentNode.nodeType===t.parentNode.ELEMENT_NODE;)t=t.parentNode,o=z_(t).backgroundColor;n(o)})),(0,c.createElement)(O_,{backgroundColor:t,textColor:o,enableAlphaChecker:!0,linkColor:l})}const F_="color",H_=e=>{const t=(0,a.getBlockSupport)(e,F_);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},G_=e=>{if("web"!==c.Platform.OS)return!1;const t=(0,a.getBlockSupport)(e,F_);return null!==t&&"object"==typeof t&&!!t.link},U_=e=>{const t=(0,a.getBlockSupport)(e,F_);return null!==t&&"object"==typeof t&&!!t.gradients},$_=e=>{const t=(0,a.getBlockSupport)(e,F_);return t&&!1!==t.background},j_=e=>{const t=(0,a.getBlockSupport)(e,F_);return t&&!1!==t.text};function W_(e,t,n){if(!H_(t)||Vl(t,F_))return e;const o=U_(t),{backgroundColor:r,textColor:l,gradient:i,style:a}=n,s=e=>!Vl(t,F_,e),c=s("text")?Iv("color",l):void 0,u=s("gradients")?d_(i):void 0,p=s("background")?Iv("background-color",r):void 0,m=s("background")||s("gradients"),f=r||a?.color?.background||o&&(i||a?.color?.gradient),g=d()(e.className,c,u,{[p]:!(o&&a?.color?.gradient||!p),"has-text-color":s("text")&&(l||a?.color?.text),"has-background":m&&f,"has-link-color":s("link")&&a?.elements?.link?.color});return e.className=g||void 0,e}function K_(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,l=e?.color?.gradient,i=l?.startsWith("var:preset|gradient|")?l.substring(20):void 0,a={...e};return a.color={...a.color,text:n?void 0:t,background:r?void 0:o,gradient:i?void 0:l},{style:Ol(a),textColor:n,backgroundColor:r,gradient:i}}function q_(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 Z_({children:e,resetAllFilter:t}){const n=(0,c.useCallback)((e=>{const n=q_(e),o=t(n);return{...e,...K_(o)}}),[t]);return(0,c.createElement)(Zi,{group:"color",resetAllFilter:n},e)}function Y_(e){const{clientId:t,name:n,attributes:o,setAttributes:r}=e,l=Fl(n),i=w_(l),s=(0,c.useMemo)((()=>q_({style:o.style,textColor:o.textColor,backgroundColor:o.backgroundColor,gradient:o.gradient})),[o.style,o.textColor,o.backgroundColor,o.gradient]);if(!i)return null;const u=(0,a.getBlockSupport)(e.name,[F_,"__experimentalDefaultControls"]),d="web"===c.Platform.OS&&!s?.color?.gradient&&(l?.color?.text||l?.color?.link)&&!1!==(0,a.getBlockSupport)(e.name,[F_,"enableContrastChecker"]);return(0,c.createElement)(D_,{as:Z_,panelId:t,settings:l,value:s,onChange:e=>{r(K_(e))},defaultControls:u,enableContrastChecker:!1!==(0,a.getBlockSupport)(e.name,[F_,"enableContrastChecker"])},d&&(0,c.createElement)(V_,{clientId:t}))}const X_=(0,p.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{backgroundColor:r,textColor:l}=o,i=Qr("color.palette.custom"),a=Qr("color.palette.theme"),s=Qr("color.palette.default"),u=(0,c.useMemo)((()=>[...i||[],...a||[],...s||[]]),[i,a,s]);if(!H_(n)||Vl(n,F_))return(0,c.createElement)(e,{...t});const d={};l&&!Vl(n,F_,"text")&&(d.color=xv(u,l)?.color),r&&!Vl(n,F_,"background")&&(d.backgroundColor=xv(u,r)?.color);let p=t.wrapperProps;return p={...t.wrapperProps,style:{...d,...t.wrapperProps?.style}},(0,c.createElement)(e,{...t,wrapperProps:p})}),"withColorPaletteStyles"),Q_={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};function J_({value:e="",onChange:t,fontFamilies:n,...o}){const r=Qr("typography.fontFamilies");if(n||(n=r),!n||0===n.length)return null;const l=[{value:"",label:(0,v.__)("Default")},...n.map((({fontFamily:e,name:t})=>({value:e,label:t||e})))];return(0,c.createElement)(m.SelectControl,{label:(0,v.__)("Font"),options:l,value:e,onChange:t,labelPosition:"top",...o})}(0,s.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return H_(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),U_(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",W_),(0,s.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!H_(e)||Vl(e,F_))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),W_(o,e,n)},e})),(0,s.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",X_),(0,s.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return zl({linkColor:G_(r),textColor:j_(r),backgroundColor:$_(r),gradient:U_(r)},Q_,e,t,n,o)}));const ek=[{name:(0,v._x)("Regular","font style"),value:"normal"},{name:(0,v._x)("Italic","font style"),value:"italic"}],tk=[{name:(0,v._x)("Thin","font weight"),value:"100"},{name:(0,v._x)("Extra Light","font weight"),value:"200"},{name:(0,v._x)("Light","font weight"),value:"300"},{name:(0,v._x)("Regular","font weight"),value:"400"},{name:(0,v._x)("Medium","font weight"),value:"500"},{name:(0,v._x)("Semi Bold","font weight"),value:"600"},{name:(0,v._x)("Bold","font weight"),value:"700"},{name:(0,v._x)("Extra Bold","font weight"),value:"800"},{name:(0,v._x)("Black","font weight"),value:"900"}],nk=(e,t)=>e?t?(0,v.__)("Appearance"):(0,v.__)("Font style"):(0,v.__)("Font weight");function ok(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l},...i}=e,a=n||o,s=nk(n,o),u={key:"default",name:(0,v.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},d=(0,c.useMemo)((()=>n&&o?(()=>{const e=[u];return ek.forEach((({name:t,value:n})=>{tk.forEach((({name:o,value:r})=>{const l="normal"===n?o:(0,v.sprintf)((0,v.__)("%1$s %2$s"),o,t);e.push({key:`${n}-${r}`,name:l,style:{fontStyle:n,fontWeight:r}})}))})),e})():n?(()=>{const e=[u];return ek.forEach((({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:n,fontWeight:void 0}})})),e})():(()=>{const e=[u];return tk.forEach((({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:void 0,fontWeight:n}})})),e})()),[e.options]),p=d.find((e=>e.style.fontStyle===r&&e.style.fontWeight===l))||d[0];return a&&(0,c.createElement)(m.CustomSelectControl,{...i,className:"components-font-appearance-control",label:s,describedBy:p?n?o?(0,v.sprintf)((0,v.__)("Currently selected font appearance: %s"),p.name):(0,v.sprintf)((0,v.__)("Currently selected font style: %s"),p.name):(0,v.sprintf)((0,v.__)("Currently selected font weight: %s"),p.name):(0,v.__)("No selected font appearance"),options:d,value:p,onChange:({selectedItem:e})=>t(e.style),__nextUnconstrainedWidth:!0})}const rk=1.5,lk=.1;var ik=({value:e,onChange:t,__nextHasNoMarginBottom:n=!1,__unstableInputWidth:o="60px",...r})=>{const l=function(e){return void 0!==e&&""!==e}(e),i=(e,t)=>{if(l)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return rk;default:return e}},a=l?e:"";n||$()("Bottom margin styles for wp.blockEditor.LineHeightControl",{since:"6.0",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"});const s=n?void 0:{marginBottom:24};return(0,c.createElement)("div",{className:"block-editor-line-height-control",style:s},(0,c.createElement)(m.__experimentalNumberControl,{...r,__unstableInputWidth:o,__unstableStateReducer:(e,t)=>{const n=["insertText","insertFromPaste"].includes(t.payload.event.nativeEvent?.inputType),o=i(e.value,n);return{...e,value:o}},onChange:(e,{event:n})=>{""!==e?"click"!==n.type?t(`${e}`):t(i(`${e}`,!1)):t()},label:(0,v.__)("Line height"),placeholder:rk,step:lk,value:a,min:0,spinControls:"custom"}))};function ak({value:e,onChange:t,__unstableInputWidth:n="60px",...o}){const r=(0,m.__experimentalUseCustomUnits)({availableUnits:Qr("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,c.createElement)(m.__experimentalUnitControl,{...o,label:(0,v.__)("Letter spacing"),value:e,__unstableInputWidth:n,units:r,onChange:t})}var sk=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M7 11.5h10V13H7z"}));var ck=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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"}));var uk=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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"}));var dk=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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 pk=[{name:(0,v.__)("None"),value:"none",icon:sk},{name:(0,v.__)("Uppercase"),value:"uppercase",icon:ck},{name:(0,v.__)("Lowercase"),value:"lowercase",icon:uk},{name:(0,v.__)("Capitalize"),value:"capitalize",icon:dk}];function mk({className:e,value:t,onChange:n}){return(0,c.createElement)("fieldset",{className:d()("block-editor-text-transform-control",e)},(0,c.createElement)(m.BaseControl.VisualLabel,{as:"legend"},(0,v.__)("Letter case")),(0,c.createElement)("div",{className:"block-editor-text-transform-control__buttons"},pk.map((e=>(0,c.createElement)(m.Button,{key:e.value,icon:e.icon,label:e.name,isPressed:e.value===t,onClick:()=>{n(e.value===t?void 0:e.value)}})))))}var fk=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z"}));var gk=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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 hk=[{name:(0,v.__)("None"),value:"none",icon:sk},{name:(0,v.__)("Underline"),value:"underline",icon:fk},{name:(0,v.__)("Strikethrough"),value:"line-through",icon:gk}];function bk({value:e,onChange:t,className:n}){return(0,c.createElement)("fieldset",{className:d()("block-editor-text-decoration-control",n)},(0,c.createElement)(m.BaseControl.VisualLabel,{as:"legend"},(0,v.__)("Decoration")),(0,c.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},hk.map((n=>(0,c.createElement)(m.Button,{key:n.value,icon:n.icon,label:n.name,isPressed:n.value===e,onClick:()=>{t(n.value===e?void 0:n.value)}})))))}const vk=1,_k=6;function kk(e){const t=Ek(e),n=wk(e),o=Sk(e),r=Ck(e),l=xk(e),i=Bk(e),a=Ik(e),s=yk(e);return t||n||o||r||l||s||i||a}function yk(e){var t,n,o,r;const l=!e?.typography?.customFontSize,i=null!==(t=e?.typography?.fontSizes)&&void 0!==t?t:{},a=[].concat(null!==(n=i?.custom)&&void 0!==n?n:[]).concat(null!==(o=i?.theme)&&void 0!==o?o:[]).concat(null!==(r=i.default)&&void 0!==r?r:[]);return!!a?.length||!l}function Ek(e){var t,n,o;const r=e?.typography?.fontFamilies,l=[].concat(null!==(t=r?.custom)&&void 0!==t?t:[]).concat(null!==(n=r?.theme)&&void 0!==n?n:[]).concat(null!==(o=r?.default)&&void 0!==o?o:[]).sort(((e,t)=>(e?.name||e?.slug).localeCompare(t?.name||e?.slug)));return!!l?.length}function wk(e){return e?.typography?.lineHeight}function Sk(e){const t=e?.typography?.fontStyle,n=e?.typography?.fontWeight;return t||n}function Ck(e){return e?.typography?.letterSpacing}function xk(e){return e?.typography?.textTransform}function Bk(e){return e?.typography?.textDecoration}function Ik(e){return e?.typography?.textColumns}function Tk({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){return(0,c.createElement)(m.__experimentalToolsPanel,{label:(0,v.__)("Typography"),resetAll:()=>{const o=e(n);t(o)},panelId:o},r)}const Mk={fontFamily:!0,fontSize:!0,fontAppearance:!0,lineHeight:!0,letterSpacing:!0,textTransform:!0,textDecoration:!0,textColumns:!0};function Pk({as:e=Tk,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:l,defaultControls:i=Mk}){var a,s,u,d,p,f,g;const h=e=>gl({settings:r},"",e),b=Ek(r),_=r?.typography?.fontFamilies,k=[].concat(null!==(a=_?.custom)&&void 0!==a?a:[]).concat(null!==(s=_?.theme)&&void 0!==s?s:[]).concat(null!==(u=_?.default)&&void 0!==u?u:[]),y=h(o?.typography?.fontFamily),E=e=>{const o=k?.find((({fontFamily:t})=>t===e))?.slug;n(Dl(t,["typography","fontFamily"],o?`var:preset|font-family|${o}`:e||void 0))},w=yk(r),S=!r?.typography?.customFontSize,C=null!==(d=r?.typography?.fontSizes)&&void 0!==d?d:{},x=[].concat(null!==(p=C?.custom)&&void 0!==p?p:[]).concat(null!==(f=C?.theme)&&void 0!==f?f:[]).concat(null!==(g=C.default)&&void 0!==g?g:[]),B=h(o?.typography?.fontSize),I=(e,o)=>{n(Dl(t,["typography","fontSize"],(o?.slug?`var:preset|font-size|${o?.slug}`:e)||void 0))},T=Sk(r),M=function(e){const t=e?.typography?.fontStyle,n=e?.typography?.fontWeight;return t?n?(0,v.__)("Appearance"):(0,v.__)("Font style"):(0,v.__)("Font weight")}(r),P=r?.typography?.fontStyle,N=r?.typography?.fontWeight,L=h(o?.typography?.fontStyle),R=h(o?.typography?.fontWeight),A=({fontStyle:e,fontWeight:o})=>{n({...t,typography:{...t?.typography,fontStyle:e||void 0,fontWeight:o||void 0}})},D=wk(r),O=h(o?.typography?.lineHeight),z=e=>{n(Dl(t,["typography","lineHeight"],e||void 0))},V=Ck(r),F=h(o?.typography?.letterSpacing),H=e=>{n(Dl(t,["typography","letterSpacing"],e||void 0))},G=Ik(r),U=h(o?.typography?.textColumns),$=e=>{n(Dl(t,["typography","textColumns"],e||void 0))},j=xk(r),W=h(o?.typography?.textTransform),K=e=>{n(Dl(t,["typography","textTransform"],e||void 0))},q=Bk(r),Z=h(o?.typography?.textDecoration),Y=e=>{n(Dl(t,["typography","textDecoration"],e||void 0))},X=(0,c.useCallback)((e=>({...e,typography:{}})),[]);return(0,c.createElement)(e,{resetAllFilter:X,value:t,onChange:n,panelId:l},b&&(0,c.createElement)(m.__experimentalToolsPanelItem,{label:(0,v.__)("Font family"),hasValue:()=>!!t?.typography?.fontFamily,onDeselect:()=>E(void 0),isShownByDefault:i.fontFamily,panelId:l},(0,c.createElement)(J_,{fontFamilies:k,value:y,onChange:E,size:"__unstable-large",__nextHasNoMarginBottom:!0})),w&&(0,c.createElement)(m.__experimentalToolsPanelItem,{label:(0,v.__)("Font size"),hasValue:()=>!!t?.typography?.fontSize,onDeselect:()=>I(void 0),isShownByDefault:i.fontSize,panelId:l},(0,c.createElement)(m.FontSizePicker,{value:B,onChange:I,fontSizes:x,disableCustomFontSizes:S,withReset:!1,withSlider:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})),T&&(0,c.createElement)(m.__experimentalToolsPanelItem,{className:"single-column",label:M,hasValue:()=>!!t?.typography?.fontStyle||!!t?.typography?.fontWeight,onDeselect:()=>{A({})},isShownByDefault:i.fontAppearance,panelId:l},(0,c.createElement)(ok,{value:{fontStyle:L,fontWeight:R},onChange:A,hasFontStyles:P,hasFontWeights:N,size:"__unstable-large",__nextHasNoMarginBottom:!0})),D&&(0,c.createElement)(m.__experimentalToolsPanelItem,{className:"single-column",label:(0,v.__)("Line height"),hasValue:()=>void 0!==t?.typography?.lineHeight,onDeselect:()=>z(void 0),isShownByDefault:i.lineHeight,panelId:l},(0,c.createElement)(ik,{__nextHasNoMarginBottom:!0,__unstableInputWidth:"auto",value:O,onChange:z,size:"__unstable-large"})),V&&(0,c.createElement)(m.__experimentalToolsPanelItem,{className:"single-column",label:(0,v.__)("Letter spacing"),hasValue:()=>!!t?.typography?.letterSpacing,onDeselect:()=>H(void 0),isShownByDefault:i.letterSpacing,panelId:l},(0,c.createElement)(ak,{value:F,onChange:H,size:"__unstable-large",__unstableInputWidth:"auto"})),G&&(0,c.createElement)(m.__experimentalToolsPanelItem,{className:"single-column",label:(0,v.__)("Text columns"),hasValue:()=>!!t?.typography?.textColumns,onDeselect:()=>$(void 0),isShownByDefault:i.textColumns,panelId:l},(0,c.createElement)(m.__experimentalNumberControl,{label:(0,v.__)("Text columns"),max:_k,min:vk,onChange:$,size:"__unstable-large",spinControls:"custom",value:U,initialPosition:1})),q&&(0,c.createElement)(m.__experimentalToolsPanelItem,{className:"single-column",label:(0,v.__)("Text decoration"),hasValue:()=>!!t?.typography?.textDecoration,onDeselect:()=>Y(void 0),isShownByDefault:i.textDecoration,panelId:l},(0,c.createElement)(bk,{value:Z,onChange:Y,size:"__unstable-large",__unstableInputWidth:"auto"})),j&&(0,c.createElement)(m.__experimentalToolsPanelItem,{label:(0,v.__)("Letter case"),hasValue:()=>!!t?.typography?.textTransform,onDeselect:()=>K(void 0),isShownByDefault:i.textTransform,panelId:l},(0,c.createElement)(mk,{value:W,onChange:K,showNone:!0,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})))}const Nk="typography.lineHeight";const Lk="typography.__experimentalFontFamily";function Rk(e,t,n){if(!(0,a.hasBlockSupport)(t,Lk))return e;if(Vl(t,Uk,"fontFamily"))return e;if(!n?.fontFamily)return e;const o=new(vh())(e.className);o.add(`has-${Rl(n?.fontFamily)}-font-family`);const r=o.value;return e.className=r||void 0,e}(0,s.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,a.hasBlockSupport)(e,Lk)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",Rk),(0,s.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,a.hasBlockSupport)(e,Lk))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Rk(o,e,n)},e}));const Ak=(e,t,n)=>{if(t){const n=e?.find((({slug:e})=>e===t));if(n)return n}return{size:n}};function Dk(e,t){const n=e?.find((({size:e})=>e===t));return n||{size:t}}function Ok(e){if(e)return`has-${Rl(e)}-font-size`}const zk="typography.fontSize";function Vk(e,t,n){if(!(0,a.hasBlockSupport)(t,zk))return e;if(Vl(t,Uk,"fontSize"))return e;const o=new(vh())(e.className);o.add(Ok(n.fontSize));const r=o.value;return e.className=r||void 0,e}const Fk=(0,p.createHigherOrderComponent)((e=>t=>{const n=Qr("typography.fontSizes"),{name:o,attributes:{fontSize:r,style:l},wrapperProps:i}=t;if(!(0,a.hasBlockSupport)(o,zk)||Vl(o,Uk,"fontSize")||!r||l?.typography?.fontSize)return(0,c.createElement)(e,{...t});const s=Ak(n,r,l?.typography?.fontSize).size,u={...t,wrapperProps:{...i,style:{fontSize:s,...i?.style}}};return(0,c.createElement)(e,{...u})}),"withFontSizeInlineStyles"),Hk={fontSize:[["fontSize"],["style","typography","fontSize"]]};function Gk(e,t){return Object.fromEntries(Object.entries(e).filter((([e])=>!t.includes(e))))}(0,s.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,a.hasBlockSupport)(e,zk)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",Vk),(0,s.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,a.hasBlockSupport)(e,zk))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Vk(o,e,n)},e})),(0,s.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",Fk),(0,s.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const r=e.name;return zl({fontSize:(0,a.hasBlockSupport)(r,zk)},Hk,e,t,n,o)})),(0,s.addFilter)("blocks.registerBlockType","core/font-size/addEditPropsForFluidCustomFontSizes",(function(e){if(!(0,a.hasBlockSupport)(e,zk)||Vl(e,Uk,"fontSize"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=e=>{const n=t?t(e):{},o=n?.style?.fontSize,r=ul((0,f.select)($o).getSettings().__experimentalFeatures),l=o?sl({size:o},r):null;return null===l?n:{...n,style:{...n?.style,fontSize:l}}},e}),11);const Uk="typography",$k=[Nk,zk,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",Lk,"typography.textColumns","typography.__experimentalTextDecoration","typography.__experimentalTextTransform","typography.__experimentalLetterSpacing"];function jk(e){const t={...Gk(e,["fontFamily"])},n=e?.typography?.fontSize,o=e?.typography?.fontFamily,r=n?.startsWith("var:preset|font-size|")?n.substring(21):void 0,l=o?.startsWith("var:preset|font-family|")?o.substring(23):void 0;return t.typography={...Gk(t.typography,["fontFamily"]),fontSize:r?void 0:n},{style:Ol(t),fontFamily:l,fontSize:r}}function Wk(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 Kk({children:e,resetAllFilter:t}){const n=(0,c.useCallback)((e=>{const n=Wk(e),o=t(n);return{...e,...jk(o)}}),[t]);return(0,c.createElement)(Zi,{group:"typography",resetAllFilter:n},e)}function qk({clientId:e,name:t,attributes:n,setAttributes:o,__unstableParentLayout:r}){const l=Fl(t,r),i=kk(l),s=(0,c.useMemo)((()=>Wk({style:n.style,fontFamily:n.fontFamily,fontSize:n.fontSize})),[n.style,n.fontSize,n.fontFamily]);if(!i)return null;const u=(0,a.getBlockSupport)(t,[Uk,"__experimentalDefaultControls"]);return(0,c.createElement)(Pk,{as:Kk,panelId:e,settings:l,value:s,onChange:e=>{o(jk(e))},defaultControls:u})}var Zk=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M14.5 13.8c-1.1 0-2.1.7-2.4 1.8H4V17h8.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20v-1.5h-3.1c-.3-1-1.3-1.7-2.4-1.7zM11.9 7c-.3-1-1.3-1.8-2.4-1.8S7.4 6 7.1 7H4v1.5h3.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20V7h-8.1z"}));const Yk={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}};function Xk({icon:e,isMixed:t=!1,minimumCustomValue:n,onChange:o,onMouseOut:r,onMouseOver:l,showSideInLabel:i=!0,side:a,spacingSizes:s,type:u,value:d}){var g,h;d=function(e,t){if(Br(e))return e;const n=t.find((t=>String(t.size)===String(e)));return n?.slug?`var:preset|spacing|${n.slug}`:e}(d,s);let b=s;const _=s.length<=8,k=(0,f.useSelect)((e=>{const t=e($o).getSettings();return t?.disableCustomSpacingSizes})),[y,E]=(0,c.useState)(!k&&void 0!==d&&!Br(d)),w=(0,p.usePrevious)(d);d&&w!==d&&!Br(d)&&!0!==y&&E(!0);const S=(0,m.__experimentalUseCustomUnits)({availableUnits:Qr("spacing.units")||["px","em","rem"]});let C=null;!_&&!y&&void 0!==d&&(!Br(d)||Br(d)&&t)?(b=[...s,{name:t?(0,v.__)("Mixed"):(0,v.sprintf)((0,v.__)("Custom (%s)"),d),slug:"custom",size:d}],C=b.length-1):t||(C=y?Ir(d,s):function(e,t){if(void 0===e)return 0;const n=0===parseFloat(e,10)?"0":Mr(e),o=t.findIndex((e=>String(e.slug)===n));return-1!==o?o:NaN}(d,s));const x=(0,c.useMemo)((()=>(0,m.__experimentalParseQuantityAndUnitFromRawValue)(C)),[C])[1]||S[0].value,B=parseFloat(C,10),I=(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|${s[e]?.slug}`},T=t?(0,v.__)("Mixed"):null,M=b.map(((e,t)=>({key:t,name:e.name}))),P=s.map(((e,t)=>({value:t,label:void 0}))),N=Er.includes(a)&&i?Cr[a]:"",L=i?u?.toLowerCase():u,R=(0,v.sprintf)((0,v.__)("%1$s %2$s"),N,L).trim();return(0,c.createElement)(m.__experimentalHStack,{className:"spacing-sizes-control__wrapper"},e&&(0,c.createElement)(m.Icon,{className:"spacing-sizes-control__icon",icon:e,size:24}),y&&(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.__experimentalUnitControl,{onMouseOver:l,onMouseOut:r,onFocus:l,onBlur:r,onChange:e=>o((e=>isNaN(parseFloat(e))?void 0:e)(e)),value:C,units:S,min:n,placeholder:T,disableUnits:t,label:R,hideLabelFromVision:!0,className:"spacing-sizes-control__custom-value-input",size:"__unstable-large"}),(0,c.createElement)(m.RangeControl,{onMouseOver:l,onMouseOut:r,onFocus:l,onBlur:r,value:B,min:0,max:null!==(g=Yk[x]?.max)&&void 0!==g?g:10,step:null!==(h=Yk[x]?.steps)&&void 0!==h?h:.1,withInputField:!1,onChange:e=>{o([e,x].join(""))},className:"spacing-sizes-control__custom-value-range",__nextHasNoMarginBottom:!0})),_&&!y&&(0,c.createElement)(m.RangeControl,{onMouseOver:l,onMouseOut:r,className:"spacing-sizes-control__range-control",value:C,onChange:e=>o(I(e)),onMouseDown:e=>{e?.nativeEvent?.offsetX<35&&void 0===d&&o("0")},withInputField:!1,"aria-valuenow":C,"aria-valuetext":s[C]?.name,renderTooltipContent:e=>void 0===d?void 0:s[e]?.name,min:0,max:s.length-1,marks:P,label:R,hideLabelFromVision:!0,__nextHasNoMarginBottom:!0,onFocus:l,onBlur:r}),!_&&!y&&(0,c.createElement)(m.CustomSelectControl,{className:"spacing-sizes-control__custom-select-control",value:M.find((e=>e.key===C))||"",onChange:e=>{o(I(e.selectedItem.key,"selectList"))},options:M,label:R,hideLabelFromVision:!0,__nextUnconstrainedWidth:!0,size:"__unstable-large",onMouseOver:l,onMouseOut:r,onFocus:l,onBlur:r}),!k&&(0,c.createElement)(m.Button,{label:y?(0,v.__)("Use size preset"):(0,v.__)("Set custom size"),icon:Zk,onClick:()=>{E(!y)},isPressed:y,isSmall:!0,className:"spacing-sizes-control__custom-toggle",iconSize:24}))}const Qk=["vertical","horizontal"];function Jk({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,sides:r,spacingSizes:l,type:i,values:a}){const s=e=>n=>{if(!t)return;const o={...a};"vertical"===e&&(o.top=n,o.bottom=n),"horizontal"===e&&(o.left=n,o.right=n),t(o)},u=r?.length?Qk.filter((e=>Pr(r,e))):Qk;return(0,c.createElement)(c.Fragment,null,u.map((t=>{const r="vertical"===t?a.top:a.left;return(0,c.createElement)(Xk,{key:`spacing-sizes-control-${t}`,icon:Sr[t],label:Cr[t],minimumCustomValue:e,onChange:s(t),onMouseOut:n,onMouseOver:o,side:t,spacingSizes:l,type:i,value:r,withInputField:!1})})))}function ey({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,sides:r,spacingSizes:l,type:i,values:a}){const s=r?.length?Er.filter((e=>r.includes(e))):Er,u=e=>n=>{const o={...a};o[e]=n,t(o)};return(0,c.createElement)(c.Fragment,null,s.map((t=>(0,c.createElement)(Xk,{key:`spacing-sizes-control-${t}`,icon:Sr[t],label:Cr[t],minimumCustomValue:e,onChange:u(t),onMouseOut:n,onMouseOver:o,side:t,spacingSizes:l,type:i,value:a[t],withInputField:!1}))))}function ty({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,showSideInLabel:r,side:l,spacingSizes:i,type:a,values:s}){return(0,c.createElement)(Xk,{label:Cr[l],minimumCustomValue:e,onChange:(u=l,e=>{const n={...s};n[u]=e,t(n)}),onMouseOut:n,onMouseOver:o,showSideInLabel:r,side:l,spacingSizes:i,type:a,value:s[l],withInputField:!1});var u}const ny=(0,c.createElement)(m.Icon,{icon:hh,size:24});function oy({label:e,onChange:t,sides:n,value:o}){if(!n||!n.length)return;const r=function(e){if(!e||!e.length)return{};const t={},n=Pr(e,"horizontal"),o=Pr(e,"vertical");n&&o?t.axial={label:Cr.axial,icon:Sr.axial}:n?t.axial={label:Cr.horizontal,icon:Sr.horizontal}:o&&(t.axial={label:Cr.vertical,icon:Sr.vertical});let r=0;return Er.forEach((n=>{e.includes(n)&&(r+=1,t[n]={label:Cr[n],icon:Sr[n]})})),r>1&&(t.custom={label:Cr.custom,icon:Sr.custom}),t}(n),l=r[o].icon,{custom:i,...a}=r;return(0,c.createElement)(m.DropdownMenu,{icon:l,label:e,className:"spacing-sizes-control__dropdown",toggleProps:{isSmall:!0}},(({onClose:e})=>(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.MenuGroup,null,Object.entries(a).map((([n,{label:r,icon:l}])=>{const i=o===n;return(0,c.createElement)(m.MenuItem,{key:n,icon:l,iconPosition:"left",isSelected:i,role:"menuitemradio",onClick:()=>{t(n),e()},suffix:i?ny:void 0},r)}))),!!i&&(0,c.createElement)(m.MenuGroup,null,(0,c.createElement)(m.MenuItem,{icon:i.icon,iconPosition:"left",isSelected:o===xr.custom,role:"menuitemradio",onClick:()=>{t(xr.custom),e()},suffix:o===xr.custom?ny:void 0},i.label)))))}function ry({inputProps:e,label:t,minimumCustomValue:n=0,onChange:o,onMouseOut:r,onMouseOver:l,showSideInLabel:i=!0,sides:a=Er,useSelect:s,values:u}){const d=function(){const e=[{name:0,slug:"0",side:0},...Qr("spacing.spacingSizes")||[]];return e.length>8&&e.unshift({name:(0,v.__)("Default"),slug:"default",size:void 0}),e}(),p=u||wr,f=1===a?.length,g=a?.includes("horizontal")&&a?.includes("vertical")&&2===a?.length,[h,b]=(0,c.useState)(function(e={},t){const{top:n,right:o,bottom:r,left:l}=e,i=[n,o,r,l].filter(Boolean),a=!(n!==r||l!==o||!n&&!l),s=!i.length&&function(e=[]){const t={top:0,right:0,bottom:0,left:0};return e.forEach((e=>t[e]+=1)),(t.top+t.bottom)%2==0&&(t.left+t.right)%2==0}(t);if(Pr(t)&&(a||s))return xr.axial;if(1===i.length){let t;return Object.entries(e).some((([e,n])=>(t=e,void 0!==n))),t}return 1!==t?.length||i.length?xr.custom:t[0]}(p,a)),_={...e,minimumCustomValue:n,onChange:e=>{const t={...u,...e};o(t)},onMouseOut:r,onMouseOver:l,sides:a,spacingSizes:d,type:t,useSelect:s,values:p},k=Er.includes(h)&&i?Cr[h]:"",y=(0,v.sprintf)((0,v.__)("%1$s %2$s"),t,k).trim(),E=(0,v.sprintf)((0,v._x)("%s options","Button label to reveal side configuration options"),t);return(0,c.createElement)("fieldset",{className:"spacing-sizes-control"},(0,c.createElement)(m.__experimentalHStack,{className:"spacing-sizes-control__header"},(0,c.createElement)(m.BaseControl.VisualLabel,{as:"legend",className:"spacing-sizes-control__label"},y),!f&&!g&&(0,c.createElement)(oy,{label:E,onChange:b,sides:a,value:h})),h===xr.axial?(0,c.createElement)(Jk,{..._}):h===xr.custom?(0,c.createElement)(ey,{..._}):(0,c.createElement)(ty,{side:h,..._,showSideInLabel:i}))}const ly={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}};function iy({label:e=(0,v.__)("Height"),onChange:t,value:n}){var o,r;const l=parseFloat(n),i=(0,m.__experimentalUseCustomUnits)({availableUnits:Qr("spacing.units")||["%","px","em","rem","vh","vw"]}),a=(0,c.useMemo)((()=>(0,m.__experimentalParseQuantityAndUnitFromRawValue)(n)),[n])[1]||i[0]?.value||"px";return(0,c.createElement)("fieldset",{className:"block-editor-height-control"},(0,c.createElement)(m.BaseControl.VisualLabel,{as:"legend"},e),(0,c.createElement)(m.Flex,null,(0,c.createElement)(m.FlexItem,{isBlock:!0},(0,c.createElement)(m.__experimentalUnitControl,{value:n,units:i,onChange:t,onUnitChange:e=>{const[o,r]=(0,m.__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):["vh","vw","%"].includes(e)&&o>100&&t(100+e)},min:0,size:"__unstable-large"})),(0,c.createElement)(m.FlexItem,{isBlock:!0},(0,c.createElement)(m.__experimentalSpacer,{marginX:2,marginBottom:0},(0,c.createElement)(m.RangeControl,{value:l,min:0,max:null!==(o=ly[a]?.max)&&void 0!==o?o:100,step:null!==(r=ly[a]?.step)&&void 0!==r?r:.1,withInputField:!1,onChange:e=>{t([e,a].join(""))},__nextHasNoMarginBottom:!0})))))}function ay(e,t){const{orientation:n="horizontal"}=t;return"fill"===e?(0,v.__)("Stretch to fill available space."):"fixed"===e&&"horizontal"===n?(0,v.__)("Specify a fixed width."):"fixed"===e?(0,v.__)("Specify a fixed height."):(0,v.__)("Fit contents.")}function sy({value:e={},onChange:t,parentLayout:n}){const{selfStretch:o,flexSize:r}=e;return(0,c.useEffect)((()=>{"fixed"!==o||r||t({...e,selfStretch:"fit"})}),[]),(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:cy(n),value:o||"fit",help:ay(o,n),onChange:n=>{const o="fixed"!==n?null:r;t({...e,selfStretch:n,flexSize:o})},isBlock:!0},(0,c.createElement)(m.__experimentalToggleGroupControlOption,{key:"fit",value:"fit",label:(0,v.__)("Fit")}),(0,c.createElement)(m.__experimentalToggleGroupControlOption,{key:"fill",value:"fill",label:(0,v.__)("Fill")}),(0,c.createElement)(m.__experimentalToggleGroupControlOption,{key:"fixed",value:"fixed",label:(0,v.__)("Fixed")})),"fixed"===o&&(0,c.createElement)(m.__experimentalUnitControl,{size:"__unstable-large",onChange:n=>{t({...e,flexSize:n})},value:r}))}function cy(e){const{orientation:t="horizontal"}=e;return"horizontal"===t?(0,v.__)("Width"):(0,v.__)("Height")}const uy=["horizontal","vertical"];function dy(e){const t=py(e),n=my(e),o=fy(e),r=gy(e),l=hy(e),i=by(e),a=vy(e);return"web"===c.Platform.OS&&(t||n||o||r||l||i||a)}function py(e){return e?.layout?.contentSize}function my(e){return e?.layout?.wideSize}function fy(e){return e?.spacing?.padding}function gy(e){return e?.spacing?.margin}function hy(e){return e?.spacing?.blockGap}function by(e){return e?.dimensions?.minHeight}function vy(e){var t;const{type:n="default",default:{type:o="default"}={},allowSizingOnChildren:r=!1}=null!==(t=e?.parentLayout)&&void 0!==t?t:{},l=("flex"===o||"flex"===n)&&r;return!!e?.layout&&l}function _y(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 ky(e){return e&&"string"==typeof e?{top:e,right:e,bottom:e,left:e}:e}function yy({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){return(0,c.createElement)(m.__experimentalToolsPanel,{label:(0,v.__)("Dimensions"),resetAll:()=>{const o=e(n);t(o)},panelId:o},r)}const Ey={contentSize:!0,wideSize:!0,padding:!0,margin:!0,blockGap:!0,minHeight:!0,childLayout:!0};function wy({as:e=yy,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:l,defaultControls:i=Ey,onVisualize:a=(()=>{}),includeLayoutControls:s=!1}){var u,p,f,g,h,b,_,k;const y=e=>e&&"object"==typeof e?Object.keys(e).reduce(((t,n)=>(t[n]=gl({settings:r},"",e[n]),t)),{}):gl({settings:r},"",e),E=function(e){var t,n;const{custom:o,theme:r,default:l}=e?.spacing?.spacingSizes||{};return(null!==(t=null!==(n=null!=o?o:r)&&void 0!==n?n:l)&&void 0!==t?t:[]).length>0}(r),w=(0,m.__experimentalUseCustomUnits)({availableUnits:r?.spacing?.units||["%","px","em","rem","vw"]}),S=py(r)&&s,C=y(o?.layout?.contentSize),x=e=>{n(Dl(t,["layout","contentSize"],e||void 0))},B=my(r)&&s,I=y(o?.layout?.wideSize),T=e=>{n(Dl(t,["layout","wideSize"],e||void 0))},M=fy(r),P=ky(y(o?.spacing?.padding)),N=Array.isArray(r?.spacing?.padding)?r?.spacing?.padding:r?.spacing?.padding?.sides,L=N&&N.some((e=>uy.includes(e))),R=e=>{const o=_y(e,N);n(Dl(t,["spacing","padding"],o))},A=()=>a("padding"),D=gy(r),O=ky(y(o?.spacing?.margin)),z=Array.isArray(r?.spacing?.margin)?r?.spacing?.margin:r?.spacing?.margin?.sides,V=z&&z.some((e=>uy.includes(e))),F=e=>{const o=_y(e,z);n(Dl(t,["spacing","margin"],o))},H=()=>a("margin"),G=hy(r),U=y(o?.spacing?.blockGap),$=function(e){return e&&"string"==typeof e?{top:e}:e?{...e,right:e?.left,bottom:e?.top}:e}(U),j=Array.isArray(r?.spacing?.blockGap)?r?.spacing?.blockGap:r?.spacing?.blockGap?.sides,W=j&&j.some((e=>uy.includes(e))),K=e=>{n(Dl(t,["spacing","blockGap"],e))},q=e=>{e||K(null),!W&&e?.hasOwnProperty("top")?K(e.top):K({top:e?.top,left:e?.left})},Z=by(r),Y=y(o?.dimensions?.minHeight),X=e=>{n(Dl(t,["dimensions","minHeight"],e))},Q=vy(r),J=o?.layout,{orientation:ee="horizontal"}=null!==(u=r?.parentLayout)&&void 0!==u?u:{},te="horizontal"===ee?(0,v.__)("Width"):(0,v.__)("Height"),ne=e=>{n({...t,layout:{...t?.layout,...e}})},oe=(0,c.useCallback)((e=>({...e,layout:Ol({...e?.layout,contentSize:void 0,wideSize:void 0,selfStretch:void 0,flexSize:void 0}),spacing:{...e?.spacing,padding:void 0,margin:void 0,blockGap:void 0},dimensions:{...e?.dimensions,minHeight:void 0}})),[]),re=()=>a(!1);return(0,c.createElement)(e,{resetAllFilter:oe,value:t,onChange:n,panelId:l},(S||B)&&(0,c.createElement)("span",{className:"span-columns"},(0,v.__)("Set the width of the main content area.")),S&&(0,c.createElement)(m.__experimentalToolsPanelItem,{className:"single-column",label:(0,v.__)("Content size"),hasValue:()=>!!t?.layout?.contentSize,onDeselect:()=>x(void 0),isShownByDefault:null!==(p=i.contentSize)&&void 0!==p?p:Ey.contentSize,panelId:l},(0,c.createElement)(m.__experimentalHStack,{alignment:"flex-end",justify:"flex-start"},(0,c.createElement)(m.__experimentalUnitControl,{label:(0,v.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:C||"",onChange:e=>{x(e)},units:w}),(0,c.createElement)(m.__experimentalView,null,(0,c.createElement)(Ql,{icon:Jl})))),B&&(0,c.createElement)(m.__experimentalToolsPanelItem,{className:"single-column",label:(0,v.__)("Wide size"),hasValue:()=>!!t?.layout?.wideSize,onDeselect:()=>T(void 0),isShownByDefault:null!==(f=i.wideSize)&&void 0!==f?f:Ey.wideSize,panelId:l},(0,c.createElement)(m.__experimentalHStack,{alignment:"flex-end",justify:"flex-start"},(0,c.createElement)(m.__experimentalUnitControl,{label:(0,v.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:I||"",onChange:e=>{T(e)},units:w}),(0,c.createElement)(m.__experimentalView,null,(0,c.createElement)(Ql,{icon:ei})))),M&&(0,c.createElement)(m.__experimentalToolsPanelItem,{hasValue:()=>!!t?.spacing?.padding&&Object.keys(t?.spacing?.padding).length,label:(0,v.__)("Padding"),onDeselect:()=>R(void 0),isShownByDefault:null!==(g=i.padding)&&void 0!==g?g:Ey.padding,className:d()({"tools-panel-item-spacing":E}),panelId:l},!E&&(0,c.createElement)(m.__experimentalBoxControl,{values:P,onChange:R,label:(0,v.__)("Padding"),sides:N,units:w,allowReset:!1,splitOnAxis:L,onMouseOver:A,onMouseOut:re}),E&&(0,c.createElement)(ry,{values:P,onChange:R,label:(0,v.__)("Padding"),sides:N,units:w,allowReset:!1,onMouseOver:A,onMouseOut:re})),D&&(0,c.createElement)(m.__experimentalToolsPanelItem,{hasValue:()=>!!t?.spacing?.margin&&Object.keys(t?.spacing?.margin).length,label:(0,v.__)("Margin"),onDeselect:()=>F(void 0),isShownByDefault:null!==(h=i.margin)&&void 0!==h?h:Ey.margin,className:d()({"tools-panel-item-spacing":E}),panelId:l},!E&&(0,c.createElement)(m.__experimentalBoxControl,{values:O,onChange:F,label:(0,v.__)("Margin"),sides:z,units:w,allowReset:!1,splitOnAxis:V,onMouseOver:H,onMouseOut:re}),E&&(0,c.createElement)(ry,{values:O,onChange:F,label:(0,v.__)("Margin"),sides:z,units:w,allowReset:!1,onMouseOver:H,onMouseOut:re})),G&&(0,c.createElement)(m.__experimentalToolsPanelItem,{hasValue:()=>!!t?.spacing?.blockGap,label:(0,v.__)("Block spacing"),onDeselect:()=>K(void 0),isShownByDefault:null!==(b=i.blockGap)&&void 0!==b?b:Ey.blockGap,className:d()({"tools-panel-item-spacing":E}),panelId:l},!E&&(W?(0,c.createElement)(m.__experimentalBoxControl,{label:(0,v.__)("Block spacing"),min:0,onChange:q,units:w,sides:j,values:$,allowReset:!1,splitOnAxis:W}):(0,c.createElement)(m.__experimentalUnitControl,{label:(0,v.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:K,units:w,value:U})),E&&(0,c.createElement)(ry,{label:(0,v.__)("Block spacing"),min:0,onChange:q,showSideInLabel:!1,sides:W?j:["top"],values:$,allowReset:!1})),Z&&(0,c.createElement)(m.__experimentalToolsPanelItem,{hasValue:()=>!!t?.dimensions?.minHeight,label:(0,v.__)("Min. height"),onDeselect:()=>{X(void 0)},isShownByDefault:null!==(_=i.minHeight)&&void 0!==_?_:Ey.minHeight,panelId:l},(0,c.createElement)(iy,{label:(0,v.__)("Min. height"),value:Y,onChange:X})),Q&&(0,c.createElement)(m.__experimentalVStack,{as:m.__experimentalToolsPanelItem,spacing:2,hasValue:()=>!!t?.layout,label:te,onDeselect:()=>{ne({selfStretch:void 0,flexSize:void 0})},isShownByDefault:null!==(k=i.childLayout)&&void 0!==k?k:Ey.childLayout,panelId:l},(0,c.createElement)(sy,{value:J,onChange:ne,parentLayout:r?.parentLayout})))}var Sy=window.wp.isShallowEqual,Cy=n.n(Sy);function xy(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function By({clientId:e,attributes:t,forceShow:n}){const o=Td(e),[r,l]=(0,c.useState)(),i=t?.style?.spacing?.margin;(0,c.useEffect)((()=>{if(!o)return;const e=xy(o,"margin-top"),t=xy(o,"margin-right"),n=xy(o,"margin-bottom"),r=xy(o,"margin-left");l({borderTopWidth:e,borderRightWidth:t,borderBottomWidth:n,borderLeftWidth:r,top:e?`-${e}`:0,right:t?`-${t}`:0,bottom:n?`-${n}`:0,left:r?`-${r}`:0})}),[o,i]);const[a,s]=(0,c.useState)(!1),u=(0,c.useRef)(i),d=(0,c.useRef)();return(0,c.useEffect)((()=>(Cy()(i,u.current)||n||(s(!0),u.current=i,d.current=setTimeout((()=>{s(!1)}),400)),()=>{s(!1),d.current&&window.clearTimeout(d.current)})),[i,n]),a||n?(0,c.createElement)(xg,{clientId:e,__unstableCoverTarget:!0,__unstableRefreshSize:i,__unstablePopoverSlot:"block-toolbar",shift:!1},(0,c.createElement)("div",{className:"block-editor__padding-visualizer",style:r})):null}function Iy(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function Ty({clientId:e,attributes:t,forceShow:n}){const o=Td(e),[r,l]=(0,c.useState)(),i=t?.style?.spacing?.padding;(0,c.useEffect)((()=>{o&&l({borderTopWidth:Iy(o,"padding-top"),borderRightWidth:Iy(o,"padding-right"),borderBottomWidth:Iy(o,"padding-bottom"),borderLeftWidth:Iy(o,"padding-left")})}),[o,i]);const[a,s]=(0,c.useState)(!1),u=(0,c.useRef)(i),d=(0,c.useRef)();return(0,c.useEffect)((()=>(Cy()(i,u.current)||n||(s(!0),u.current=i,d.current=setTimeout((()=>{s(!1)}),400)),()=>{s(!1),d.current&&window.clearTimeout(d.current)})),[i,n]),a||n?(0,c.createElement)(xg,{clientId:e,__unstableCoverTarget:!0,__unstableRefreshSize:i,__unstablePopoverSlot:"block-toolbar",shift:!1},(0,c.createElement)("div",{className:"block-editor__padding-visualizer",style:r})):null}const My="dimensions",Py="spacing";function Ny({children:e,resetAllFilter:t}){const n=(0,c.useCallback)((e=>{const n=e.style,o=t(n);return{...e,style:o}}),[t]);return(0,c.createElement)(Zi,{group:"dimensions",resetAllFilter:n},e)}function Ly(e){const{clientId:t,name:n,attributes:o,setAttributes:r,__unstableParentLayout:l}=e,i=Fl(n,l),s=dy(i),u=o.style,[d,p]=function(){const[e,t]=(0,c.useState)(!1),{hideBlockInterface:n,showBlockInterface:o}=bn((0,f.useDispatch)($o));return(0,c.useEffect)((()=>{e?n():o()}),[e,o,n]),[e,t]}();if(!s)return null;const m={...(0,a.getBlockSupport)(e.name,[My,"__experimentalDefaultControls"]),...(0,a.getBlockSupport)(e.name,[Py,"__experimentalDefaultControls"])};return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(wy,{as:Ny,panelId:t,settings:i,value:u,onChange:e=>{r({style:Ol(e)})},defaultControls:m,onVisualize:p}),!!i?.spacing?.padding&&(0,c.createElement)(Ty,{forceShow:"padding"===d,...e}),!!i?.spacing?.margin&&(0,c.createElement)(By,{forceShow:"margin"===d,...e}))}function Ry(){$()("wp.blockEditor.__experimentalUseCustomSides",{since:"6.3",version:"6.4"})}const Ay=[...$k,Jv,F_,My,Py],Dy=e=>Ay.some((t=>(0,a.hasBlockSupport)(e,t)));function Oy(e={}){const t={};return(0,ti.getCSSRules)(e).forEach((e=>{t[e.key]=e.value})),t}const zy={[`${Jv}.__experimentalSkipSerialization`]:["border"],[`${F_}.__experimentalSkipSerialization`]:[F_],[`${Uk}.__experimentalSkipSerialization`]:[Uk],[`${My}.__experimentalSkipSerialization`]:[My],[`${Py}.__experimentalSkipSerialization`]:[Py]},Vy={...zy,[`${Py}`]:["spacing.blockGap"]},Fy={gradients:"gradient"};function Hy(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;Hy(o[t],[n],!0)}else 1===e.length&&delete o[e[0]]})),o}function Gy(e,t,n,o=Vy){if(!Dy(t))return e;let{style:r}=n;return Object.entries(o).forEach((([e,n])=>{const o=(0,a.getBlockSupport)(t,e);!0===o&&(r=Hy(r,n)),Array.isArray(o)&&o.forEach((e=>{const t=Fy[e]||e;r=Hy(r,[[...n,t]])}))})),e.style={...Oy(r),...e.style},e}const Uy=(0,p.createHigherOrderComponent)((e=>t=>{const n=Yo(),o=Bi();return(0,c.createElement)(c.Fragment,null,n&&"default"===o&&(0,c.createElement)(c.Fragment,null,(0,c.createElement)(Y_,{...t}),(0,c.createElement)(qk,{...t}),(0,c.createElement)(i_,{...t}),(0,c.createElement)(Ly,{...t})),(0,c.createElement)(e,{...t}))}),"withToolbarControls"),$y=(0,p.createHigherOrderComponent)((e=>t=>{const n=`wp-elements-${(0,p.useInstanceId)(e)}`,o=Vl(t.name,F_,"link"),r=(0,c.useMemo)((()=>{const e=[{styles:o?void 0:t.attributes.style?.elements?.link,selector:`.editor-styles-wrapper .${n} ${a.__EXPERIMENTAL_ELEMENTS.link}`},{styles:o?void 0:t.attributes.style?.elements?.link?.[":hover"],selector:`.editor-styles-wrapper .${n} ${a.__EXPERIMENTAL_ELEMENTS.link}:hover`}],r=[];for(const{styles:t,selector:n}of e)if(t){const e=(0,ti.compileCSS)(t,{selector:n});r.push(e)}return r.length>0?r.join(""):void 0}),[t.attributes.style?.elements,n,o]),l=(0,c.useContext)(wv.__unstableElementContext);return(0,c.createElement)(c.Fragment,null,r&&l&&(0,c.createPortal)((0,c.createElement)("style",{dangerouslySetInnerHTML:{__html:r}}),l),(0,c.createElement)(e,{...t,className:t.attributes.style?.elements?d()(t.className,n):t.className}))}),"withElementsStyles");(0,s.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return Dy(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",Gy),(0,s.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!Dy(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Gy(o,e,n,zy)},e})),(0,s.addFilter)("editor.BlockEdit","core/style/with-block-controls",Uy),(0,s.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",$y);(0,s.addFilter)("blocks.registerBlockType","core/settings/addAttribute",(function(e){return t=e,(0,a.hasBlockSupport)(t,"__experimentalSettings",!1)?(e?.attributes?.settings||(e.attributes={...e.attributes,settings:{type:"object"}}),e):e;var t}));var jy=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"}));var Wy=function({colorPalette:e,duotonePalette:t,disableCustomColors:n,disableCustomDuotone:o,value:r,onChange:l}){let i;return i="unset"===r?(0,c.createElement)(m.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):r?(0,c.createElement)(m.DuotoneSwatch,{values:r}):(0,c.createElement)(Ql,{icon:jy}),(0,c.createElement)(m.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,v.__)("Duotone")},renderToggle:({isOpen:e,onToggle:t})=>(0,c.createElement)(m.ToolbarButton,{showTooltip:!0,onClick:t,"aria-haspopup":"true","aria-expanded":e,onKeyDown:n=>{e||n.keyCode!==Ed.DOWN||(n.preventDefault(),t())},label:(0,v.__)("Apply duotone filter"),icon:i}),renderContent:()=>(0,c.createElement)(m.MenuGroup,{label:(0,v.__)("Duotone")},(0,c.createElement)("div",{className:"block-editor-duotone-control__description"},(0,v.__)("Create a two-tone color effect without losing your original image.")),(0,c.createElement)(m.DuotonePicker,{colorPalette:e,duotonePalette:t,disableCustomColors:n,disableCustomDuotone:o,value:r,onChange:l}))})};function Ky(e=[]){const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=Gp(e).toRgb();t.r.push(n.r/255),t.g.push(n.g/255),t.b.push(n.b/255),t.a.push(n.a)})),t}function qy({selector:e,id:t}){const n=`\n${e} {\n\tfilter: url( #${t} );\n}\n`;return(0,c.createElement)("style",null,n)}function Zy({selector:e}){const t=`\n${e} {\n\tfilter: none;\n}\n`;return(0,c.createElement)("style",null,t)}function Yy({id:e,colors:t}){const n=Ky(t);return(0,c.createElement)(m.SVG,{xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 0 0",width:"0",height:"0",focusable:"false",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"}},(0,c.createElement)("defs",null,(0,c.createElement)("filter",{id:e},(0,c.createElement)("feColorMatrix",{colorInterpolationFilters:"sRGB",type:"matrix",values:" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "}),(0,c.createElement)("feComponentTransfer",{colorInterpolationFilters:"sRGB"},(0,c.createElement)("feFuncR",{type:"table",tableValues:n.r.join(" ")}),(0,c.createElement)("feFuncG",{type:"table",tableValues:n.g.join(" ")}),(0,c.createElement)("feFuncB",{type:"table",tableValues:n.b.join(" ")}),(0,c.createElement)("feFuncA",{type:"table",tableValues:n.a.join(" ")})),(0,c.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"}))))}function Xy({preset:e}){return(0,c.createElement)(Yy,{id:`wp-duotone-${e.slug}`,colors:e.colors})}function Qy(e,t="root",n={}){if(!t)return null;const{fallback:o=!1}=n,{name:r,selectors:l,supports:i}=e,a=l&&Object.keys(l).length>0,s=Array.isArray(t)?t.join("."):t;let c=null;if(c=a&&l.root?l?.root:i?.__experimentalSelector?i.__experimentalSelector:".wp-block-"+r.replace("core/","").replace("/","-"),"root"===s)return c;const u=Array.isArray(t)?t:t.split(".");if(1===u.length){const e=o?c:null;if(a){return(0,Kr.get)(l,`${s}.root`,null)||(0,Kr.get)(l,s,null)||e}const t=(0,Kr.get)(i,`${s}.__experimentalSelector`,null);return t?hl(c,t):e}let d;return a&&(d=(0,Kr.get)(l,s,null)),d||(o?Qy(e,u[0],n):null)}const Jy=[];function eE(e,{presetSetting:t,defaultSetting:n}){const o=!e?.color?.[n],r=e?.color?.[t]?.custom||Jy,l=e?.color?.[t]?.theme||Jy,i=e?.color?.[t]?.default||Jy;return(0,c.useMemo)((()=>[...r,...l,...o?Jy:i]),[o,r,l,i])}function tE(e){return nE(e)}function nE(e){return e.color.customDuotone||e.color.defaultDuotone}function oE({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){return(0,c.createElement)(m.__experimentalToolsPanel,{label:(0,v._x)("Filters","Name for applying graphical effects"),resetAll:()=>{const o=e(n);t(o)},panelId:o},r)}const rE={duotone:!0},lE={placement:"left-start",offset:36,shift:!0,className:"block-editor-duotone-control__popover",headerTitle:(0,v.__)("Duotone")},iE=({indicator:e,label:t})=>(0,c.createElement)(m.__experimentalHStack,{justify:"flex-start"},(0,c.createElement)(m.__experimentalZStack,{isLayered:!1,offset:-8},(0,c.createElement)(m.Flex,{expanded:!1},"unset"!==e&&e?(0,c.createElement)(m.DuotoneSwatch,{values:e}):(0,c.createElement)(m.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}))),(0,c.createElement)(m.FlexItem,{title:t},t));function aE({as:e=oE,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:l,defaultControls:i=rE}){const a=nE(r),s=eE(r,{presetSetting:"duotone",defaultSetting:"defaultDuotone"}),u=eE(r,{presetSetting:"palette",defaultSetting:"defaultPalette"}),p=(f=o?.filter?.duotone,gl({settings:r},"",f));var f;const g=e=>{const o=s.find((({colors:t})=>t===e)),r=o?`var:preset|duotone|${o.slug}`:e;n(Dl(t,["filter","duotone"],r))},h=!r?.color?.custom,b=!r?.color?.customDuotone||0===u?.length&&h,_=(0,c.useCallback)((e=>({...e,filter:{...e.filter,duotone:void 0}})),[]);return(0,c.createElement)(e,{resetAllFilter:_,value:t,onChange:n,panelId:l},a&&(0,c.createElement)(m.__experimentalToolsPanelItem,{label:(0,v.__)("Duotone"),hasValue:()=>!!t?.filter?.duotone,onDeselect:()=>g(void 0),isShownByDefault:i.duotone,panelId:l},(0,c.createElement)(m.Dropdown,{popoverProps:lE,className:"block-editor-global-styles-filters-panel__dropdown",renderToggle:({onToggle:e,isOpen:t})=>{const n={onClick:e,className:d()({"is-open":t}),"aria-expanded":t};return(0,c.createElement)(m.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,c.createElement)(m.Button,{...n},(0,c.createElement)(iE,{indicator:p,label:(0,v.__)("Duotone")})))},renderContent:()=>(0,c.createElement)(m.__experimentalDropdownContentWrapper,{paddingSize:"medium"},(0,c.createElement)(m.__experimentalVStack,null,(0,c.createElement)("p",null,(0,v.__)("Create a two-tone color effect without losing your original image.")),(0,c.createElement)(m.DuotonePicker,{colorPalette:u,duotonePalette:s,disableCustomColors:h,disableCustomDuotone:b,value:p,onChange:g})))})))}const sE=[];function cE({selector:e,id:t,colors:n}){return"unset"===n?(0,c.createElement)(Zy,{selector:e}):(0,c.createElement)(c.Fragment,null,(0,c.createElement)(Yy,{id:t,colors:n}),(0,c.createElement)(qy,{id:t,selector:e}))}function uE({presetSetting:e,defaultSetting:t}){const n=!Qr(t),o=Qr(`${e}.custom`)||sE,r=Qr(`${e}.theme`)||sE,l=Qr(`${e}.default`)||sE;return(0,c.useMemo)((()=>[...o,...r,...n?sE:l]),[n,o,r,l])}function dE(e,t){if(!e)return;const n=t?.find((({slug:t})=>e===`var:preset|duotone|${t}`));return n?n.colors:void 0}function pE({attributes:e,setAttributes:t,name:n}){const o=e?.style,r=o?.color?.duotone,l=Fl(n),i=uE({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=uE({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),s=!Qr("color.custom"),u=!Qr("color.customDuotone")||0===a?.length&&s;if(0===i?.length&&u)return null;const d=Array.isArray(r)?r:dE(r,i);return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(Zi,{group:"filter"},(0,c.createElement)(aE,{value:{filter:{duotone:d}},onChange:e=>{const n={...o,color:{...e?.filter}};t({style:n})},settings:l})),(0,c.createElement)(nr,{group:"block",__experimentalShareWithChildBlocks:!0},(0,c.createElement)(Wy,{duotonePalette:i,colorPalette:a,disableCustomDuotone:u,disableCustomColors:s,value:d,onChange:e=>{const n=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}(e,i),r={...o,color:{...o?.color,duotone:null!=n?n:e}};t({style:r})},settings:l})))}$p([jp]);const mE=(0,p.createHigherOrderComponent)((e=>t=>{const n=(0,a.hasBlockSupport)(t.name,"filter.duotone"),o=Bi();return(0,c.createElement)(c.Fragment,null,n&&"default"===o&&(0,c.createElement)(pE,{...t}),(0,c.createElement)(e,{...t}))}),"withDuotoneControls");function fE({id:e,selector:t,attribute:n}){const o=(0,c.useContext)(wv.__unstableElementContext),r=uE({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),l=Array.isArray(n),i=l?void 0:dE(n,r),a="string"==typeof n&&i;let s=null;a?s=i:("string"==typeof n&&!a||l)&&(s=n);const u=t.split(",").map((t=>`.editor-styles-wrapper .${e}${t.trim()}`)).join(", "),d=Array.isArray(s)||"unset"===s;return o&&d&&(0,c.createPortal)((0,c.createElement)(cE,{selector:u,id:e,colors:s}),o)}const gE=(0,p.createHigherOrderComponent)((e=>t=>{const n=(0,p.useInstanceId)(e),o=(0,c.useMemo)((()=>{const e=(0,a.getBlockType)(t.name);if(e){if(!(0,a.getBlockSupport)(e,"filter.duotone",!1))return null;const t=(0,a.getBlockSupport)(e,"color.__experimentalDuotone",!1);if(t){const n=Qy(e);return"string"==typeof t?hl(n,t):n}return Qy(e,"filter.duotone",{fallback:!0})}}),[t.name]),r=t?.attributes?.style?.color?.duotone,l=`wp-duotone-${n}`,i=o&&r,s=i?d()(t?.className,l):t?.className;return(0,c.createElement)(c.Fragment,null,i&&(0,c.createElement)(fE,{id:l,selector:o,attribute:r}),(0,c.createElement)(e,{...t,className:s}))}),"withDuotoneStyles");(0,s.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,a.hasBlockSupport)(e,"filter.duotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,s.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",mE),(0,s.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",gE);const hE="layout";function bE(e){return(0,a.hasBlockSupport)(e,"layout")||(0,a.hasBlockSupport)(e,"__experimentalLayout")}function vE(e={},t=""){const n=(0,f.useSelect)((e=>{const{getSettings:t}=e($o);return t().__experimentalFeatures?.useRootPaddingAwareAlignments}),[]),{layout:o}=e,{default:r}=(0,a.getBlockSupport)(t,hE)||{},l=o?.inherit||o?.contentSize||o?.wideSize?{...o,type:"constrained"}:o||r||{},i=[];if(ur[l?.type||"default"]?.className){const e=ur[l?.type||"default"]?.className,n=`wp-block-${t.split("/").pop()}-${e}`;i.push(e,n)}return(l?.inherit||l?.contentSize||"constrained"===l?.type)&&n&&i.push("has-global-padding"),l?.orientation&&i.push(`is-${Rl(l.orientation)}`),l?.justifyContent&&i.push(`is-content-justification-${Rl(l.justifyContent)}`),l?.flexWrap&&"nowrap"===l.flexWrap&&i.push("is-nowrap"),i}function _E({setAttributes:e,attributes:t,name:n}){const{layout:o}=t,r=Qr("layout"),{themeSupportsLayout:l}=(0,f.useSelect)((e=>{const{getSettings:t}=e($o);return{themeSupportsLayout:t().supportsLayout}}),[]),i=Bi(),s=(0,a.getBlockSupport)(n,hE,{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:p=!0,default:g}=s;if(!d)return null;const h=!(!p||!r||o?.type&&"default"!==o?.type&&"constrained"!==o?.type&&!o?.inherit),b=o||g||{},{inherit:_=!1,type:k="default",contentSize:y=null}=b;if(("default"===k||"constrained"===k)&&!l)return null;const E=si(k),w=si("constrained"),S=!b.type&&(y||_),C=!!_||!!y,x=t=>e({layout:t});return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(Zi,null,(0,c.createElement)(m.PanelBody,{title:(0,v.__)("Layout")},h&&(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.ToggleControl,{__nextHasNoMarginBottom:!0,className:"block-editor-hooks__toggle-control",label:(0,v.__)("Inner blocks use content width"),checked:"constrained"===E?.name||C,onChange:()=>e({layout:{type:"constrained"===E?.name||C?"default":"constrained"}}),help:"constrained"===E?.name||C?(0,v.__)("Nested blocks use content width with options for full and wide widths."):(0,v.__)("Nested blocks will fill the width of this container. Toggle to constrain.")})),!_&&u&&(0,c.createElement)(kE,{type:k,onChange:t=>e({layout:{type:t}})}),E&&"default"!==E.name&&(0,c.createElement)(E.inspectorControls,{layout:b,onChange:x,layoutBlockSupport:s}),w&&S&&(0,c.createElement)(w.inspectorControls,{layout:b,onChange:x,layoutBlockSupport:s}))),!_&&"default"===i&&E&&(0,c.createElement)(E.toolBarControls,{layout:b,onChange:x,layoutBlockSupport:s}))}function kE({type:e,onChange:t}){return(0,c.createElement)(m.ButtonGroup,null,ai.map((({name:n,label:o})=>(0,c.createElement)(m.Button,{key:n,isPressed:e===n,onClick:()=>t(n)},o))))}const yE=(0,p.createHigherOrderComponent)((e=>t=>{const{name:n}=t,o=bE(n),r=Bi();return[o&&"default"===r&&(0,c.createElement)(_E,{key:"layout",...t}),(0,c.createElement)(e,{key:"edit",...t})]}),"withInspectorControls"),EE=(0,p.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,r=bE(n),l=(0,f.useSelect)((e=>{const{getSettings:t}=e($o);return!!t().disableLayoutStyles})),i=r&&!l,s=(0,p.useInstanceId)(e),u=(0,c.useContext)(wv.__unstableElementContext),{layout:m}=o,{default:g}=(0,a.getBlockSupport)(n,hE)||{},h=m?.inherit||m?.contentSize||m?.wideSize?{...m,type:"constrained"}:m||g||{},b=r?vE(o,n):null,v=`.wp-container-${s}.wp-container-${s}`,_=null!==Qr("spacing.blockGap");let k;if(i){const e=si(h?.type||"default");k=e?.getLayoutStyle?.({blockName:n,selector:v,layout:h,style:o?.style,hasBlockGapSupport:_})}const y=d()({[`wp-container-${s}`]:i&&!!k},b);return(0,c.createElement)(c.Fragment,null,i&&u&&!!k&&(0,c.createPortal)((0,c.createElement)(mi,{blockName:n,selector:v,css:k,layout:h,style:o?.style}),u),(0,c.createElement)(e,{...t,__unstableLayoutClassNames:y}))}),"withLayoutStyles"),wE=(0,p.createHigherOrderComponent)((e=>t=>{const{attributes:n}=t,{style:{layout:o={}}={}}=n,{selfStretch:r,flexSize:l}=o,i=r||l,a=(0,f.useSelect)((e=>{const{getSettings:t}=e($o);return!!t().disableLayoutStyles})),s=i&&!a,u=(0,c.useContext)(wv.__unstableElementContext),m=(0,p.useInstanceId)(e),g=`.wp-container-content-${m}`;let h="";"fixed"===r&&l?h+=`${g} {\n\t\t\t\tflex-basis: ${l};\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}`:"fill"===r&&(h+=`${g} {\n\t\t\t\tflex-grow: 1;\n\t\t\t}`);const b=d()(t?.className,{[`wp-container-content-${m}`]:s&&!!h});return(0,c.createElement)(c.Fragment,null,s&&u&&!!h&&(0,c.createPortal)((0,c.createElement)("style",null,h),u),(0,c.createElement)(e,{...t,className:b}))}),"withChildLayoutStyles");function SE({clientId:e,stopEditingAsBlock:t}){const n=(0,f.useSelect)((t=>{const{isBlockSelected:n,hasSelectedInnerBlock:o}=t($o);return n(e)||o(e,!0)}),[e]);return(0,c.useEffect)((()=>{n||t()}),[n,t]),null}(0,s.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.layout)&&void 0!==t?t:{})||bE(e)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,s.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",EE),(0,s.addFilter)("editor.BlockListBlock","core/editor/layout/with-child-layout-styles",wE),(0,s.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",yE);const CE=(0,p.createHigherOrderComponent)((e=>t=>{const{getBlockListSettings:n,getSettings:o}=(0,f.useSelect)($o),r=(0,c.useRef)(),{templateLock:l,isLockedByParent:i,isEditingAsBlocks:a}=(0,f.useSelect)((e=>{const{__unstableGetContentLockingParent:n,getTemplateLock:o,__unstableGetTemporarilyEditingAsBlocks:r}=e($o);return{templateLock:o(t.clientId),isLockedByParent:!!n(t.clientId),isEditingAsBlocks:r()===t.clientId}}),[t.clientId]),{updateSettings:s,updateBlockListSettings:u,__unstableSetTemporarilyEditingAsBlocks:d}=(0,f.useDispatch)($o),p=!i&&"contentOnly"===l,{__unstableMarkNextChangeAsNotPersistent:g,updateBlockAttributes:h}=(0,f.useDispatch)($o),b=(0,c.useCallback)((()=>{g(),h(t.clientId,{templateLock:"contentOnly"}),u(t.clientId,{...n(t.clientId),templateLock:"contentOnly"}),s({focusMode:r.current}),d()}),[t.clientId,s,u,n,g,h,d]);if(!p&&!a)return(0,c.createElement)(e,{key:"edit",...t});const _=a&&!p,k=!a&&p&&t.isSelected;return(0,c.createElement)(c.Fragment,null,_&&(0,c.createElement)(c.Fragment,null,(0,c.createElement)(SE,{clientId:t.clientId,stopEditingAsBlock:b}),(0,c.createElement)(nr,{group:"other"},(0,c.createElement)(m.ToolbarButton,{onClick:()=>{b()}},(0,v.__)("Done")))),k&&(0,c.createElement)(_b,null,(({onClose:e})=>(0,c.createElement)(m.MenuItem,{onClick:()=>{g(),h(t.clientId,{templateLock:void 0}),u(t.clientId,{...n(t.clientId),templateLock:!1}),r.current=o().focusMode,s({focusMode:!0}),d(t.clientId),e()}},(0,v.__)("Modify")))),(0,c.createElement)(e,{key:"edit",...t}))}),"withToolbarControls");(0,s.addFilter)("editor.BlockEdit","core/content-lock-ui/with-block-controls",CE);const xE="metadata";function BE(e,t=""){if(!e.name.startsWith("core/"))return!1;const n=(0,a.getBlockSupport)(e,"__experimentalMetadata");return!(!0!==n&&!n?.[t])}function IE({blockName:e,blockBehaviors:t,onChangeBehavior:n,onChangeAnimation:o,disabled:r=!1}){const{settings:l,themeBehaviors:i}=(0,f.useSelect)((t=>{const{getBehaviors:n,getSettings:o}=t($o);return{settings:o()?.__experimentalFeatures?.blocks?.[e]?.behaviors,themeBehaviors:n()?.blocks?.[e]}}),[e]),s={default:{value:"default",label:(0,v.__)("Default")},noBehaviors:{value:"",label:(0,v.__)("No behaviors")}},u=Object.entries(l).filter((([t,n])=>(0,a.hasBlockSupport)(e,`behaviors.${t}`)&&n)).map((([e])=>({value:e,label:`${e.charAt(0).toUpperCase()}${e.slice(1).toLowerCase()}`}))),d=[...Object.values(s),...u];if(0===u.length)return null;const p={...i,...t||{}},g=r?(0,v.__)("The lightbox behavior is disabled for linked images."):"";return(0,c.createElement)(Zi,{group:"advanced"},(0,c.createElement)("div",null,(0,c.createElement)(m.SelectControl,{label:(0,v.__)("Behaviors"),value:void 0===t?"default":p?.lightbox.enabled?"lightbox":"",options:d,onChange:n,hideCancelButton:!0,help:g,size:"__unstable-large",disabled:r}),p?.lightbox.enabled&&(0,c.createElement)(m.SelectControl,{label:(0,v.__)("Animation"),value:p?.lightbox.animation?p?.lightbox.animation:"",options:[{value:"zoom",label:(0,v.__)("Zoom")},{value:"fade",label:"Fade"}],onChange:o,hideCancelButton:!1,size:"__unstable-large",disabled:r})))}(0,s.addFilter)("blocks.registerBlockType","core/metadata/addMetaAttribute",(function(e){return e?.attributes?.[xE]?.type||BE(e,"name")&&(e.attributes={...e.attributes,[xE]:{type:"object"}}),e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/metadata/save-props",(function(e,t,n){return BE(t)&&(e[xE]=n[xE]),e})),(0,s.addFilter)("blocks.registerBlockType","core/metadata/addLabelCallback",(function(e){return e.__experimentalLabel||BE(e,"name")&&(e.__experimentalLabel=(e,{context:t})=>{const{metadata:n}=e;if("list-view"===t&&n?.name)return n.name}),e}));const TE=(0,p.createHigherOrderComponent)((e=>t=>{const n=(0,c.createElement)(e,{key:"edit",...t});if(!(0,a.hasBlockSupport)(t.name,"behaviors"))return n;const o=void 0!==t.attributes?.linkDestination&&"none"!==t.attributes?.linkDestination;return(0,c.createElement)(c.Fragment,null,n,(0,c.createElement)(IE,{blockName:t.name,blockBehaviors:t.attributes.behaviors,onChangeBehavior:e=>{"default"===e?t.setAttributes({behaviors:void 0}):t.setAttributes({behaviors:{lightbox:{enabled:"lightbox"===e,animation:"lightbox"===e?"zoom":""}}})},onChangeAnimation:e=>{t.setAttributes({behaviors:{lightbox:{enabled:t.attributes.behaviors.lightbox.enabled,animation:e}}})},disabled:o}))}),"withBehaviors");function ME(e){const t=e.style?.border||{};return{className:c_(e)||void 0,style:Oy({border:t})}}function PE(e){const{colors:t}=Tv(),n=ME(e),{borderColor:o}=e;if(o){const e=t_({colors:t,namedColor:o});n.style.borderColor=e.color}return n}function NE(e){const{backgroundColor:t,textColor:n,gradient:o,style:r}=e,l=Iv("background-color",t),i=Iv("color",n),a=d_(o),s=a||r?.color?.gradient;return{className:d()(i,a,{[l]:!s&&!!l,"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:Oy({color:r?.color||{}})}}window?.__experimentalInteractivityAPI&&(0,s.addFilter)("editor.BlockEdit","core/behaviors/with-inspector-control",TE);const LE={};function RE(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=Qr("color.palette.custom"),l=Qr("color.palette.theme"),i=Qr("color.palette.default"),a=Qr("color.gradients")||LE,s=(0,c.useMemo)((()=>[...r||[],...l||[],...i||[]]),[r,l,i]),u=(0,c.useMemo)((()=>[...a?.custom||[],...a?.theme||[],...a?.default||[]]),[a]),d=NE(e);if(t){const e=xv(s,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=p_(u,o)),n){const e=xv(s,n);d.style.color=e.color}return d}function AE(e){const{style:t}=e;return{style:Oy({spacing:t?.spacing||{}})}}function DE(e,t){let n=e?.style?.typography||{};const o=ul(t);n={...n,fontSize:sl({size:e?.style?.typography?.fontSize},o)};const r=Oy({typography:n}),l=e?.fontFamily?`has-${Rl(e.fontFamily)}-font-family`:"";return{className:d()(l,Ok(e?.fontSize)),style:r}}function OE(e){const[t,n]=(0,c.useState)(e);return(0,c.useEffect)((()=>{e&&n(e)}),[e]),t}const zE=([e,...t])=>e.toUpperCase()+t.join(""),VE=e=>(0,p.createHigherOrderComponent)((t=>n=>(0,c.createElement)(t,{...n,colors:e})),"withCustomColorPalette"),FE=()=>(0,p.createHigherOrderComponent)((e=>t=>{const n=Qr("color.palette.custom"),o=Qr("color.palette.theme"),r=Qr("color.palette.default"),l=(0,c.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,c.createElement)(e,{...t,colors:l})}),"withEditorColorPalette");function HE(e,t){const n=e.reduce(((e,t)=>({...e,..."string"==typeof t?{[t]:Rl(t)}:t})),{});return(0,p.compose)([t,e=>class extends c.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=Gp(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=zE(t),o=`custom${n}`;return e[`set${n}`]=this.createSetColor(t,o),e}),{})}createSetColor(e,t){return n=>{const o=Bv(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,l])=>{const i=xv(t,e[r],e[`custom${zE(r)}`]),a=o[r],s=a?.color;return s===i.color&&a?n[r]=a:n[r]={...i,class:Iv(l,i.slug)},n}),{})}render(){return(0,c.createElement)(e,{...this.props,colors:void 0,...this.state,...this.setters,colorUtils:this.colorUtils})}}])}function GE(e){return(...t)=>{const n=VE(e);return(0,p.createHigherOrderComponent)(HE(t,n),"withCustomColors")}}function UE(...e){const t=FE();return(0,p.createHigherOrderComponent)(HE(e,t),"withColors")}var $E=function(e){const t=Qr("typography.fontSizes"),n=!Qr("typography.customFontSize");return(0,c.createElement)(m.FontSizePicker,{...e,fontSizes:t,disableCustomFontSizes:n})};const jE=[],WE=([e,...t])=>e.toUpperCase()+t.join("");var KE=(...e)=>{const t=e.reduce(((e,t)=>(e[t]=`custom${WE(t)}`,e)),{});return(0,p.createHigherOrderComponent)((0,p.compose)([(0,p.createHigherOrderComponent)((e=>t=>{const n=Qr("typography.fontSizes")||jE;return(0,c.createElement)(e,{...t,fontSizes:n})}),"withFontSizes"),e=>class extends c.Component{constructor(e){super(e),this.setters=this.createSetters(),this.state={}}createSetters(){return Object.entries(t).reduce(((e,[t,n])=>(e[`set${WE(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 l=Object.entries(t).filter((([e,t])=>r(t,e))).reduce(((t,[o,r])=>{const l=e[o],i=Ak(n,l,e[r]);return t[o]={...i,class:Ok(l)},t}),{});return{...o,...l}}render(){return(0,c.createElement)(e,{...this.props,fontSizes:void 0,...this.state,...this.setters})}}]),"withFontSizes")};var qE=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M13 5.5H4V4h9v1.5Zm7 7H4V11h16v1.5Zm-7 7H4V18h9v1.5Z"}));var ZE=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M7.5 5.5h9V4h-9v1.5Zm-3.5 7h16V11H4v1.5Zm3.5 7h9V18h-9v1.5Z"}));var YE=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M11.111 5.5H20V4h-8.889v1.5ZM4 12.5h16V11H4v1.5Zm7.111 7H20V18h-8.889v1.5Z"}));const XE=[{icon:qE,title:(0,v.__)("Align text left"),align:"left"},{icon:ZE,title:(0,v.__)("Align text center"),align:"center"},{icon:YE,title:(0,v.__)("Align text right"),align:"right"}],QE={placement:"bottom-start"};var JE=function({value:e,onChange:t,alignmentControls:n=XE,label:o=(0,v.__)("Align text"),describedBy:r=(0,v.__)("Change text alignment"),isCollapsed:l=!0,isToolbar:i}){function a(n){return()=>t(e===n?void 0:n)}const s=n.find((t=>t.align===e)),u=i?m.ToolbarGroup:m.ToolbarDropdownMenu,d=i?{isCollapsed:l}:{toggleProps:{describedBy:r},popoverProps:QE};return(0,c.createElement)(u,{icon:s?s.icon:(0,v.isRTL)()?YE:qE,label:o,controls:n.map((t=>{const{align:n}=t,o=e===n;return{...t,isActive:o,role:l?"menuitemradio":void 0,onClick:a(n)}})),...d})};const ew=e=>(0,c.createElement)(JE,{...e,isToolbar:!1}),tw=e=>(0,c.createElement)(JE,{...e,isToolbar:!0}),nw=()=>{};var ow={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n,prioritizedBlocks:o}=(0,f.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockListSettings:o,getBlockRootClientId:r}=e($o),l=t(),i=r(l);return{selectedBlockName:l?n(l):null,rootClientId:i,prioritizedBlocks:o(i)?.prioritizedInserterBlocks}}),[]),[r,l,i]=Dm(t,nw),a=(0,c.useMemo)((()=>(e.trim()?uf(r,l,i,e):ng(K(r,"frecency","desc"),o)).filter((e=>e.name!==n)).slice(0,9)),[e,n,r,l,i,o]),s=(0,c.useMemo)((()=>a.map((e=>{const{title:t,icon:n,isDisabled:o}=e;return{key:`block-${e.id}`,value:e,label:(0,c.createElement)(c.Fragment,null,(0,c.createElement)(jd,{key:"icon",icon:n,showColors:!0}),t),isDisabled:o}}))),[a]);return[s]},allowContext(e,t){return!(/\S/.test(e)||/\S/.test(t))},getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:o}=e;return{action:"replace",value:(0,a.createBlock)(t,n,(0,a.createBlocksFromInnerBlocksTemplate)(o))}}},rw=window.wp.apiFetch,lw=n.n(rw);var iw=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"}));var aw=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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"}));var sw={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await lw()({path:(0,Cf.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){return[...e.title.split(/\s+/)]},getOptionLabel(e){return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(Ql,{key:"icon",icon:"page"===e.subtype?iw:aw}),e.title)},getOptionCompletion(e){return(0,c.createElement)("a",{href:e.url},e.title)}};const cw=[];function uw({completers:e=cw}){const{name:t}=Zo();return(0,c.useMemo)((()=>{let n=[...e,sw];return(t===(0,a.getDefaultBlockName)()||(0,a.getBlockSupport)(t,"__experimentalSlashInserter",!1))&&(n=[...n,ow]),(0,s.hasFilter)("editor.Autocomplete.completers")&&(n===e&&(n=n.map((e=>({...e})))),n=(0,s.applyFilters)("editor.Autocomplete.completers",n,t)),n}),[e,t])}var dw=function(e){return(0,c.createElement)(m.Autocomplete,{...e,completers:uw(e)})};var pw=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M4.2 9h1.5V5.8H9V4.2H4.2V9zm14 9.2H15v1.5h4.8V15h-1.5v3.2zM15 4.2v1.5h3.2V9h1.5V4.2H15zM5.8 15H4.2v4.8H9v-1.5H5.8V15z"}));var mw=function({isActive:e,label:t=(0,v.__)("Toggle full height"),onToggle:n,isDisabled:o}){return(0,c.createElement)(m.ToolbarButton,{isActive:e,icon:pw,label:t,onClick:()=>n(!e),disabled:o})};const fw=()=>{};var gw=function(e){const{label:t=(0,v.__)("Change matrix alignment"),onChange:n=fw,value:o="center",isDisabled:r}=e,l=(0,c.createElement)(m.__experimentalAlignmentMatrixControl.Icon,{value:o});return(0,c.createElement)(m.Dropdown,{popoverProps:{placement:"bottom-start"},renderToggle:({onToggle:e,isOpen:n})=>(0,c.createElement)(m.ToolbarButton,{onClick:e,"aria-haspopup":"true","aria-expanded":n,onKeyDown:t=>{n||t.keyCode!==Ed.DOWN||(t.preventDefault(),e())},label:t,icon:l,showTooltip:!0,disabled:r}),renderContent:()=>(0,c.createElement)(m.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})};var hw=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"}));var bw=function({rootLabelText:e}){const{selectBlock:t,clearSelectedBlock:n}=(0,f.useDispatch)($o),{clientId:o,parents:r,hasSelection:l}=(0,f.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getEnabledBlockParents:o}=bn(e($o)),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),i=e||(0,v.__)("Document");return(0,c.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,v.__)("Block breadcrumb")},(0,c.createElement)("li",{className:l?void 0:"block-editor-block-breadcrumb__current","aria-current":l?void 0:"true"},l&&(0,c.createElement)(m.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:n},i),!l&&i,!!o&&(0,c.createElement)(Ql,{icon:hw,className:"block-editor-block-breadcrumb__separator"})),r.map((e=>(0,c.createElement)("li",{key:e},(0,c.createElement)(m.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:()=>t(e)},(0,c.createElement)(Og,{clientId:e,maximumLength:35})),(0,c.createElement)(Ql,{icon:hw,className:"block-editor-block-breadcrumb__separator"})))),!!o&&(0,c.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,c.createElement)(Og,{clientId:o,maximumLength:35})))};const vw=()=>(0,c.createElement)(m.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,c.createElement)(m.Path,{d:"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z"})),_w=({style:e,className:t})=>(0,c.createElement)("div",{className:"block-library-colors-selector__icon-container"},(0,c.createElement)("div",{className:`${t} block-library-colors-selector__state-selection`,style:e},(0,c.createElement)(vw,null))),kw=({TextColor:e,BackgroundColor:t})=>({onToggle:n,isOpen:o})=>(0,c.createElement)(m.ToolbarGroup,null,(0,c.createElement)(m.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,v.__)("Open Colors Selector"),onClick:n,onKeyDown:e=>{o||e.keyCode!==Ed.DOWN||(e.preventDefault(),n())},icon:(0,c.createElement)(t,null,(0,c.createElement)(e,null,(0,c.createElement)(_w,null)))}));var yw=({children:e,...t})=>($()("wp.blockEditor.BlockColorsStyleSelector",{alternative:"block supports API",since:"6.1",version:"6.3"}),(0,c.createElement)(m.Dropdown,{popoverProps:{placement:"bottom-start"},className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:kw(t),renderContent:()=>e}));var Ew=(0,c.createElement)(F.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(F.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"}));const ww=(0,c.createContext)({}),Sw=()=>(0,c.useContext)(ww);function Cw({children:e,...t}){const n=(0,c.useRef)();return(0,c.useEffect)((()=>{n.current&&(n.current.textContent=n.current.textContent)}),[e]),(0,c.createElement)("div",{hidden:!0,...t,ref:n},e)}const xw=(0,c.forwardRef)((({nestingLevel:e,blockCount:t,clientId:n,...o},r)=>{const{insertedBlock:l,setInsertedBlock:i}=Sw(),a=(0,p.useInstanceId)(xw),{hideInserter:s}=(0,f.useSelect)((e=>{const{getTemplateLock:t,__unstableGetEditorMode:o}=e($o);return{hideInserter:!!t(n)||"zoom-out"===o()}}),[n]),u=Dg({clientId:n,context:"list-view"}),d=Dg({clientId:l?.clientId,context:"list-view"});if((0,c.useEffect)((()=>{d?.length&&(0,Mn.speak)((0,v.sprintf)((0,v.__)("%s block inserted"),d),"assertive")}),[d]),s)return null;const m=`list-view-appender__${a}`,g=(0,v.sprintf)((0,v.__)("Append to %1$s block at position %2$d, Level %3$d"),u,t+1,e);return(0,c.createElement)("div",{className:"list-view-appender"},(0,c.createElement)(gg,{ref:r,rootClientId:n,position:"bottom right",isAppender:!0,selectBlockOnInsert:!1,shouldDirectInsert:!1,__experimentalIsQuick:!0,...o,toggleProps:{"aria-describedby":m},onSelectOrClose:e=>{e?.clientId&&i(e)}}),(0,c.createElement)(Cw,{id:m},g))})),Bw=ld(m.__experimentalTreeGridRow),Iw=(0,c.forwardRef)((({isSelected:e,position:t,level:n,rowCount:o,children:r,className:l,path:i,...a},s)=>{const u=sd({isSelected:e,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:i}),m=(0,p.useMergeRefs)([s,u]);return(0,c.createElement)(Bw,{ref:m,className:d()("block-editor-list-view-leaf",l),level:n,positionInSet:t,setSize:o,isExpanded:void 0,...a},r)}));var Tw=Iw;var Mw=(0,c.createElement)(F.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(F.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"}));var Pw=(0,c.createElement)(F.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(F.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"}));var Nw=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"}));function Lw({onClick:e}){return(0,c.createElement)("span",{className:"block-editor-list-view__expander",onClick:t=>e(t,{forceToggle:!0}),"aria-hidden":"true","data-testid":"list-view-expander"},(0,c.createElement)(Ql,{icon:(0,v.isRTL)()?Nw:hw}))}var Rw=(0,c.forwardRef)((function({className:e,block:{clientId:t},onClick:n,onToggleExpanded:o,tabIndex:r,onFocus:l,onDragStart:i,onDragEnd:a,draggable:s,isExpanded:u,ariaLabel:p,ariaDescribedBy:g,updateFocusAndSelection:h},b){const _=Ag(t),k=Dg({clientId:t,context:"list-view"}),{isLocked:y}=ib(t),{getSelectedBlockClientIds:E,getPreviousBlockClientId:w,getBlockRootClientId:S,getBlockOrder:C,canRemoveBlocks:x}=(0,f.useSelect)($o),{removeBlocks:B}=(0,f.useDispatch)($o),I=(0,rp.__unstableUseShortcutEventMatch)(),T="sticky"===_?.positionType,M=_?.positionLabel?(0,v.sprintf)((0,v.__)("Position: %1$s"),_.positionLabel):"";return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.Button,{className:d()("block-editor-list-view-block-select-button",e),onClick:n,onKeyDown:function(e){if(e.keyCode===Ed.ENTER||e.keyCode===Ed.SPACE)n(e);else if(e.keyCode===Ed.BACKSPACE||e.keyCode===Ed.DELETE||I("core/block-editor/remove",e)){var o;const e=E(),n=e.includes(t),r=n?e[0]:t,l=S(r),i=n?e:[t];if(!x(i,l))return;let a=null!==(o=w(r))&&void 0!==o?o:l;B(i,!1);const s=e.length>0&&0===E().length;a||(a=C()[0]),h(a,s)}},ref:b,tabIndex:r,onFocus:l,onDragStart:e=>{e.dataTransfer.clearData(),i?.(e)},onDragEnd:a,draggable:s,href:`#block-${t}`,"aria-label":p,"aria-describedby":g,"aria-expanded":u},(0,c.createElement)(Lw,{onClick:o}),(0,c.createElement)(jd,{icon:_?.icon,showColors:!0,context:"list-view"}),(0,c.createElement)(m.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1},(0,c.createElement)("span",{className:"block-editor-list-view-block-select-button__title"},(0,c.createElement)(m.__experimentalTruncate,{ellipsizeMode:"auto"},k)),_?.anchor&&(0,c.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper"},(0,c.createElement)(m.__experimentalTruncate,{className:"block-editor-list-view-block-select-button__anchor",ellipsizeMode:"auto"},_.anchor)),M&&T&&(0,c.createElement)(m.Tooltip,{text:M},(0,c.createElement)("span",{className:"block-editor-list-view-block-select-button__sticky"},(0,c.createElement)(Ql,{icon:Mw}))),y&&(0,c.createElement)("span",{className:"block-editor-list-view-block-select-button__lock"},(0,c.createElement)(Ql,{icon:Pw})))))}));const Aw=(0,c.forwardRef)((({onClick:e,onToggleExpanded:t,block:n,isSelected:o,position:r,siblingBlockCount:l,level:i,isExpanded:a,selectedClientIds:s,...u},p)=>{const{clientId:m}=n,{blockMovingClientId:g,selectedBlockInBlockEditor:h}=(0,f.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e($o);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[]),{AdditionalBlockContent:b,insertedBlock:v,setInsertedBlock:_}=Sw(),k=g&&h===m,y=d()("block-editor-list-view-block-contents",{"is-dropping-before":k}),E=s.includes(m)?s:[m];return(0,c.createElement)(c.Fragment,null,b&&(0,c.createElement)(b,{block:n,insertedBlock:v,setInsertedBlock:_}),(0,c.createElement)(zg,{clientIds:E},(({draggable:s,onDragStart:d,onDragEnd:m})=>(0,c.createElement)(Rw,{ref:p,className:y,block:n,onClick:e,onToggleExpanded:t,isSelected:o,position:r,siblingBlockCount:l,level:i,draggable:s,onDragStart:d,onDragEnd:m,isExpanded:a,...u}))))}));var Dw=Aw;var Ow=(0,c.memo)((function e({block:{clientId:t},isDragged:n,isSelected:o,isBranchSelected:r,selectBlock:l,position:i,level:s,rowCount:u,siblingBlockCount:g,showBlockMovers:h,path:b,isExpanded:_,selectedClientIds:k,isSyncedBranch:y}){const E=(0,c.useRef)(null),w=(0,c.useRef)(null),[S,C]=(0,c.useState)(!1),{isLocked:x,canEdit:B}=ib(t),I=o&&k[0]===t,T=o&&k[k.length-1]===t,{toggleBlockHighlight:M}=(0,f.useDispatch)($o),P=Ag(t),N=P?.title||(0,v.__)("Untitled"),L=(0,f.useSelect)((e=>e($o).getBlock(t)),[t]),R=(0,f.useSelect)((e=>e($o).getBlockName(t)),[t]),A=(0,f.useSelect)((e=>bn(e($o)).getBlockEditingMode(t)),[t]),D=(0,a.hasBlockSupport)(R,"__experimentalToolbar",!0)&&"default"===A,O=`list-view-block-select-button__${(0,p.useInstanceId)(e)}`,z=((e,t,n)=>(0,v.sprintf)((0,v.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(i,g,s),V=x?(0,v.sprintf)((0,v.__)("%s (locked)"),N):N,F=(0,v.sprintf)((0,v.__)("Options for %s"),N),{isTreeGridMounted:H,expand:G,collapse:U,BlockSettingsMenu:$,listViewInstanceId:j,expandedState:W,setInsertedBlock:K,treeGridElementRef:q}=Sw(),Z=h&&g>0,Y=d()("block-editor-list-view-block__mover-cell",{"is-visible":S||o}),X=d()("block-editor-list-view-block__menu-cell",{"is-visible":S||I});(0,c.useEffect)((()=>{!H&&o&&E.current.focus()}),[]);const Q=(0,c.useCallback)((()=>{C(!0),M(t,!0)}),[t,C,M]),J=(0,c.useCallback)((()=>{C(!1),M(t,!1)}),[t,C,M]),ee=(0,c.useCallback)((e=>{l(e,t),e.preventDefault()}),[t,l]),te=(0,c.useCallback)(((e,t)=>{t&&l(void 0,e,null,null);const n=()=>{const t=q.current?.querySelector(`[role=row][data-block="${e}"]`);return t?ta.focus.focusable.find(t)[0]:null};let o=n();o?o.focus():window.requestAnimationFrame((()=>{o=n(),o&&o.focus()}))}),[l,q]),ne=(0,c.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===_?U(t):!1===_&&G(t)}),[t,G,U,_]);let oe;Z?oe=2:D||(oe=3);const re=d()({"is-selected":o,"is-first-selected":I,"is-last-selected":T,"is-branch-selected":r,"is-synced-branch":y,"is-dragging":n,"has-single-cell":!D,"is-synced":P?.isSynced}),le=k.includes(t)?k:[t];!function({isSelected:e,selectedClientIds:t,rowItemRef:n}){const o=1===t.length;(0,c.useLayoutEffect)((()=>{if(!e||!o||!n.current)return;const t=(0,ta.getScrollContainer)(n.current),{ownerDocument:r}=n.current;if(t===r.body||t===r.documentElement||!t)return;const l=n.current.getBoundingClientRect(),i=t.getBoundingClientRect();(l.top<i.top||l.bottom>i.bottom)&&n.current.scrollIntoView()}),[e,o,n])}({isSelected:o,rowItemRef:w,selectedClientIds:k});const ie=o&&1===k.length;return(0,c.createElement)(Tw,{className:re,onMouseEnter:Q,onMouseLeave:J,onFocus:Q,onBlur:J,level:s,position:i,rowCount:u,path:b,id:`list-view-${j}-block-${t}`,"data-block":t,"data-expanded":B?_:void 0,ref:w},(0,c.createElement)(m.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:oe,ref:E,"aria-selected":!!o},(({ref:e,tabIndex:t,onFocus:n})=>(0,c.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,c.createElement)(Dw,{block:L,onClick:ee,onToggleExpanded:ne,isSelected:o,position:i,siblingBlockCount:g,level:s,ref:e,tabIndex:ie?0:t,onFocus:n,isExpanded:B?_:void 0,selectedClientIds:k,ariaLabel:V,ariaDescribedBy:O,updateFocusAndSelection:te}),(0,c.createElement)(Cw,{id:O},z)))),Z&&(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.__experimentalTreeGridCell,{className:Y,withoutGridItem:!0},(0,c.createElement)(m.__experimentalTreeGridItem,null,(({ref:e,tabIndex:n,onFocus:o})=>(0,c.createElement)(Wg,{orientation:"vertical",clientIds:[t],ref:e,tabIndex:n,onFocus:o}))),(0,c.createElement)(m.__experimentalTreeGridItem,null,(({ref:e,tabIndex:n,onFocus:o})=>(0,c.createElement)(Kg,{orientation:"vertical",clientIds:[t],ref:e,tabIndex:n,onFocus:o}))))),D&&$&&(0,c.createElement)(m.__experimentalTreeGridCell,{className:X,"aria-selected":!!o},(({ref:e,tabIndex:t,onFocus:n})=>(0,c.createElement)($,{clientIds:le,block:L,icon:Lf,label:F,toggleProps:{ref:e,className:"block-editor-list-view-block__menu",tabIndex:t,onFocus:n},disableOpenOnArrowDown:!0,expand:G,expandedState:W,setInsertedBlock:K,__experimentalSelectBlock:te}))))}));function zw(e,t,n,o){var r;const l=n?.includes(e.clientId);if(l)return 0;return(null!==(r=t[e.clientId])&&void 0!==r?r:o)?1+e.innerBlocks.reduce(Vw(t,n,o),0):1}const Vw=(e,t,n)=>(o,r)=>{var l;const i=t?.includes(r.clientId);if(i)return o;return(null!==(l=e[r.clientId])&&void 0!==l?l:n)&&r.innerBlocks.length>0?o+zw(r,e,t,n):o+1},Fw=()=>{};var Hw=(0,c.memo)((function e(t){const{blocks:n,selectBlock:o=Fw,showBlockMovers:r,selectedClientIds:l,level:i=1,path:a="",isBranchDragged:s=!1,isBranchSelected:u=!1,listPosition:d=0,fixedListWindow:p,isExpanded:g,parentId:h,shouldShowInnerBlocks:b=!0,isSyncedBranch:v=!1,showAppender:_=!0}=t,k=Ag(h),y=v||!!k?.isSynced,E=(0,f.useSelect)((e=>!h||e($o).canEditBlock(h)),[h]),{expandedState:w,draggedClientIds:S}=Sw();if(!E)return null;const C=_&&1===i,x=n.filter(Boolean),B=x.length,I=C?B+1:B;let T=d;return(0,c.createElement)(c.Fragment,null,x.map(((t,n)=>{var d;const{clientId:m,innerBlocks:h}=t;n>0&&(T+=zw(x[n-1],w,S,g));const{itemInView:v}=p,_=v(T),k=n+1,E=a.length>0?`${a}_${k}`:`${k}`,C=!!h?.length,M=C&&b?null!==(d=w[m])&&void 0!==d?d:g:void 0,P=!!S?.includes(m),N=((e,t)=>Array.isArray(t)&&t.length?-1!==t.indexOf(e):t===e)(m,l),L=u||N&&C,R=P||_||N||s;return(0,c.createElement)(f.AsyncModeProvider,{key:m,value:!N},R&&(0,c.createElement)(Ow,{block:t,selectBlock:o,isSelected:N,isBranchSelected:L,isDragged:P||s,level:i,position:k,rowCount:I,siblingBlockCount:B,showBlockMovers:r,path:E,isExpanded:M,listPosition:T,selectedClientIds:l,isSyncedBranch:y}),!R&&(0,c.createElement)("tr",null,(0,c.createElement)("td",{className:"block-editor-list-view-placeholder"})),C&&M&&(0,c.createElement)(e,{parentId:m,blocks:h,selectBlock:o,showBlockMovers:r,level:i+1,path:E,listPosition:T+1,fixedListWindow:p,isBranchSelected:L,isBranchDragged:P||s,selectedClientIds:l,isExpanded:g,isSyncedBranch:y}))})),C&&(0,c.createElement)(m.__experimentalTreeGridRow,{level:i,setSize:I,positionInSet:I,isExpanded:!0},(0,c.createElement)(m.__experimentalTreeGridCell,null,(e=>(0,c.createElement)(xw,{clientId:h,nestingLevel:i,blockCount:B,...e})))))}));function Gw({listViewRef:e,blockDropTarget:t}){const{rootClientId:n,clientId:o,dropPosition:r}=t||{},[l,i]=(0,c.useMemo)((()=>{if(!e.current)return[];return[n?e.current.querySelector(`[data-block="${n}"]`):void 0,o?e.current.querySelector(`[data-block="${o}"]`):void 0]}),[n,o]),a=i||l,s=(0,v.isRTL)(),u=(0,c.useCallback)((e=>{if(!l)return 0;const t=l.querySelector(".block-editor-block-icon").getBoundingClientRect();return s?e.right-t.left:t.right-e.left}),[l,s]),d=(0,c.useCallback)(((e,t)=>{if(!a)return 0;let n=a.offsetWidth;const o=(0,ta.getScrollContainer)(a,"horizontal"),r=a.ownerDocument,l=o===r.body||o===r.documentElement;if(o&&!l){const r=o.getBoundingClientRect(),l=(0,v.isRTL)()?r.right-e.right:e.left-r.left,i=o.clientWidth;if(i<n+l&&(n=i-l),!s&&e.left+t<r.left)return n-=r.left-e.left,n;if(s&&e.right-t>r.right)return n-=e.right-r.right,n}return n-t}),[s,a]),p=(0,c.useMemo)((()=>{if(!a)return{};const e=a.getBoundingClientRect(),t=u(e);return{width:d(e,t)}}),[u,d,a]),f=(0,c.useMemo)((()=>{if(!a||!("top"===r||"bottom"===r||"inside"===r))return;const e=a.ownerDocument;return{ownerDocument:e,getBoundingClientRect(){const t=a.getBoundingClientRect(),n=u(t);let o=s?t.left:t.left+n,l=0,i=0;const c=(0,ta.getScrollContainer)(a,"horizontal"),p=c===e.body||c===e.documentElement;if(c&&!p){const e=c.getBoundingClientRect(),t=s?c.offsetWidth-c.clientWidth:0;o<e.left+t&&(o=e.left+t)}"top"===r?(l=t.top,i=t.top):(l=t.bottom,i=t.bottom);const m=d(t,n),f=i-l;return new window.DOMRect(o,l,m,f)}}}),[a,r,u,d,s]);return a?(0,c.createElement)(m.Popover,{animate:!1,anchor:f,focusOnMount:!1,className:"block-editor-list-view-drop-indicator",variant:"unstyled"},(0,c.createElement)("div",{style:p,className:"block-editor-list-view-drop-indicator__line"})):null}function Uw(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,f.useDispatch)($o),{getBlockName:o,getBlockParents:r,getBlockSelectionStart:l,getSelectedBlockClientIds:i,hasMultiSelection:s,hasSelectedBlock:u}=(0,f.useSelect)($o),{getBlockType:d}=(0,f.useSelect)(a.store),p=(0,c.useCallback)((async(a,c,p,m)=>{if(!a?.shiftKey)return void n(c,m);a.preventDefault();const f="keydown"===a.type&&(a.keyCode===Ed.UP||a.keyCode===Ed.DOWN||a.keyCode===Ed.HOME||a.keyCode===Ed.END);if(!f&&!u()&&!s())return void n(c,null);const g=i(),h=[...r(c),c];f&&!g.some((e=>h.includes(e)))&&await e();let b=l(),_=c;f&&(u()||s()||(b=c),p&&(_=p));const k=r(b),y=r(_),{start:E,end:w}=function(e,t,n,o){const r=[...n,e],l=[...o,t],i=Math.min(r.length,l.length)-1;return{start:r[i],end:l[i]}}(b,_,k,y);await t(E,w,null);const S=i();if((a.keyCode===Ed.HOME||a.keyCode===Ed.END)&&S.length>1)return;const C=g.filter((e=>!S.includes(e)));let x;if(1===C.length){const e=d(o(C[0]))?.title;e&&(x=(0,v.sprintf)((0,v.__)("%s deselected."),e))}else C.length>1&&(x=(0,v.sprintf)((0,v.__)("%s blocks deselected."),C.length));x&&(0,Mn.speak)(x,"assertive")}),[e,o,d,r,l,i,s,u,t,n]);return{updateBlockSelection:p}}const $w=28;function jw(e,t){const n=e[t+1];return n&&n.isDraggedBlock?jw(e,t+1):n}const Ww=["top","bottom"];function Kw(e,t,n=!1){let o,r,l,i,a;for(let n=0;n<e.length;n++){const s=e[n];if(s.isDraggedBlock)continue;const c=s.element.getBoundingClientRect(),[u,d]=uv(t,c,Ww),p=dv(t,c);if(void 0===l||u<l||p){l=u;const t=e.indexOf(s),n=e[t-1];if("top"===d&&n&&n.rootClientId===s.rootClientId&&!n.isDraggedBlock?(r=n,o="bottom",i=n.element.getBoundingClientRect(),a=t-1):(r=s,o=d,i=c,a=t),p)break}}if(!r)return;const s=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*$w:t.left+n*$w;return(o?e.x<r-$w:e.x>r+$w)&&e.y<t.bottom}(t,i,s.length,n))){const e=r.isExpanded?0:r.innerBlockCount||0;return{rootClientId:r.clientId,blockIndex:e,dropPosition:"inside"}}if(c&&r.rootClientId&&function(e,t,n=1,o=!1){const r=o?t.right-n*$w:t.left+n*$w;return o?e.x>r:e.x<r}(t,i,s.length,n)){const l=jw(e,a),c=r.nestingLevel,u=l?l.nestingLevel:1;if(c&&u){const d=function(e,t,n=1,o=!1){const r=o?t.right-n*$w:t.left+n*$w,l=o?r-e.x:e.x-r,i=Math.round(l/$w);return Math.abs(i)}(t,i,s.length,n),p=Math.max(Math.min(d,c-u),0);if(s[p]){let t=r.blockIndex;if(s[p].nestingLevel===l?.nestingLevel)t=l?.blockIndex;else for(let n=a;n>=0;n--){const o=e[n];if(o.rootClientId===s[p].rootClientId){t=o.blockIndex+1;break}}return{rootClientId:s[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 qw=(e,t)=>Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e;const Zw=(0,c.forwardRef)((function e({id:t,blocks:n,dropZoneElement:o,showBlockMovers:r=!1,isExpanded:l=!1,showAppender:i=!1,blockSettingsMenu:a=Eb,rootClientId:s,description:u,onSelect:d,additionalBlockContent:g},h){n&&$()("`blocks` property in `wp.blockEditor.__experimentalListView`",{since:"6.3",alternative:"`rootClientId` property"});const b=(0,p.useInstanceId)(e),{clientIdsTree:_,draggedClientIds:k,selectedClientIds:y}=function({blocks:e,rootClientId:t}){return(0,f.useSelect)((n=>{const{getDraggedBlockClientIds:o,getSelectedBlockClientIds:r,getEnabledClientIdsTree:l}=bn(n($o));return{selectedClientIds:r(),draggedClientIds:o(),clientIdsTree:null!=e?e:l(t)}}),[e,t])}({blocks:n,rootClientId:s}),{getBlock:E}=(0,f.useSelect)($o),{visibleBlockCount:w,shouldShowInnerBlocks:S}=(0,f.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n,__unstableGetEditorMode:o}=e($o),r=k?.length>0?n(k).length+1:0;return{visibleBlockCount:t()-r,shouldShowInnerBlocks:"zoom-out"!==o()}}),[k]),{updateBlockSelection:C}=Uw(),[x,B]=(0,c.useReducer)(qw,{}),{ref:I,target:T}=function({dropZoneElement:e}){const{getBlockRootClientId:t,getBlockIndex:n,getBlockCount:o,getDraggedBlockClientIds:r,canInsertBlocks:l}=(0,f.useSelect)($o),[i,a]=(0,c.useState)(),{rootClientId:s,blockIndex:u}=i||{},d=cv(s,u),m=(0,v.isRTL)(),g=r(),h=(0,p.useThrottle)((0,c.useCallback)(((e,r)=>{const i={x:e.clientX,y:e.clientY},s=!!g?.length,c=Kw(Array.from(r.querySelectorAll("[data-block]")).map((e=>{const r=e.dataset.block,i="true"===e.dataset.expanded,a=e.classList.contains("is-dragging"),c=parseInt(e.getAttribute("aria-level"),10),u=t(r);return{clientId:r,isExpanded:i,rootClientId:u,blockIndex:n(r),element:e,nestingLevel:c||void 0,isDraggedBlock:!!s&&a,innerBlockCount:o(r),canInsertDraggedBlocksAsSibling:!s||l(g,u),canInsertDraggedBlocksAsChild:!s||l(g,r)}})),i,m);c&&a(c)}),[l,g,o,n,t,m]),200);return{ref:(0,p.__experimentalUseDropZone)({dropZoneElement:e,onDrop:d,onDragLeave(){h.cancel(),a(null)},onDragOver(e){h(e,e.currentTarget)},onDragEnd(){h.cancel(),a(null)}}),target:i}}({dropZoneElement:o}),M=(0,c.useRef)(),P=(0,p.useMergeRefs)([M,I,h]),N=(0,c.useRef)(!1),[L,R]=(0,c.useState)(null),{setSelectedTreeId:A}=function({firstSelectedBlockClientId:e,setExpandedState:t}){const[n,o]=(0,c.useState)(null),{selectedBlockParentClientIds:r}=(0,f.useSelect)((t=>{const{getBlockParents:n}=t($o);return{selectedBlockParentClientIds:n(e,!1)}}),[e]),l=Array.isArray(r)&&r.length?r:null;return(0,c.useEffect)((()=>{n!==e&&l&&t({type:"expand",clientIds:r})}),[e]),{setSelectedTreeId:o}}({firstSelectedBlockClientId:y[0],setExpandedState:B}),D=(0,c.useCallback)(((e,t,n)=>{C(e,t,null,n),A(t),d&&d(E(t))}),[A,C,d,E]);(0,c.useEffect)((()=>{N.current=!0}),[]);const[O]=(0,p.__experimentalUseFixedWindowList)(M,36,w,{useWindowing:!0,windowOverscan:40}),z=(0,c.useCallback)((e=>{e&&B({type:"expand",clientIds:[e]})}),[B]),V=(0,c.useCallback)((e=>{e&&B({type:"collapse",clientIds:[e]})}),[B]),F=(0,c.useCallback)((e=>{z(e?.dataset?.block)}),[z]),H=(0,c.useCallback)((e=>{V(e?.dataset?.block)}),[V]),G=(0,c.useCallback)(((e,t,n)=>{e.shiftKey&&C(e,t?.dataset?.block,n?.dataset?.block)}),[C]),U=(0,c.useMemo)((()=>({isTreeGridMounted:N.current,draggedClientIds:k,expandedState:x,expand:z,collapse:V,BlockSettingsMenu:a,listViewInstanceId:b,AdditionalBlockContent:g,insertedBlock:L,setInsertedBlock:R,treeGridElementRef:M})),[k,x,z,V,a,b,g,L,R]);return _.length||i?(0,c.createElement)(f.AsyncModeProvider,{value:!0},(0,c.createElement)(Gw,{listViewRef:M,blockDropTarget:T}),(0,c.createElement)(m.__experimentalTreeGrid,{id:t,className:"block-editor-list-view-tree","aria-label":(0,v.__)("Block navigation structure"),ref:P,onCollapseRow:H,onExpandRow:F,onFocusRow:G,applicationAriaLabel:(0,v.__)("Block navigation structure"),"aria-description":u},(0,c.createElement)(ww.Provider,{value:U},(0,c.createElement)(Hw,{blocks:_,parentId:s,selectBlock:D,showBlockMovers:r,fixedListWindow:O,selectedClientIds:y,isExpanded:l,shouldShowInnerBlocks:S,showAppender:i})))):null}));var Yw=(0,c.forwardRef)(((e,t)=>(0,c.createElement)(Zw,{ref:t,...e,showAppender:!1,rootClientId:null,onSelect:null,additionalBlockContent:null,blockSettingsMenu:void 0})));function Xw({isEnabled:e,onToggle:t,isOpen:n,innerRef:o,...r}){return(0,c.createElement)(m.Button,{...r,ref:o,icon:Ew,"aria-expanded":n,"aria-haspopup":"true",onClick:e?t:void 0,label:(0,v.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!e})}var Qw=(0,c.forwardRef)((function({isDisabled:e,...t},n){$()("wp.blockEditor.BlockNavigationDropdown",{since:"6.1",alternative:"wp.components.Dropdown and wp.blockEditor.ListView"});const o=(0,f.useSelect)((e=>!!e($o).getBlockCount()),[])&&!e;return(0,c.createElement)(m.Dropdown,{contentClassName:"block-editor-block-navigation__popover",popoverProps:{placement:"bottom-start"},renderToggle:({isOpen:e,onToggle:r})=>(0,c.createElement)(Xw,{...t,innerRef:n,isOpen:e,onToggle:r,isEnabled:o}),renderContent:()=>(0,c.createElement)("div",{className:"block-editor-block-navigation__container"},(0,c.createElement)("p",{className:"block-editor-block-navigation__label"},(0,v.__)("List view")),(0,c.createElement)(Yw,null))})}));function Jw({genericPreviewBlock:e,style:t,className:n,activeStyle:o}){const r=(0,a.getBlockType)(e.name)?.example,l=_h(n,o,t),i=(0,c.useMemo)((()=>({...e,title:t.label||t.name,description:t.description,initialAttributes:{...e.attributes,className:l+" block-editor-block-styles__block-preview-container"},example:r})),[e,l]);return(0,c.createElement)(Cm,{item:i})}const eS=()=>{};function tS({clientId:e,onSwitch:t=eS,onHoverClassName:n=eS}){const{onSelect:o,stylesToRender:r,activeStyle:l,genericPreviewBlock:i,className:a}=yh({clientId:e,onSwitch:t}),[s,u]=(0,c.useState)(null),f=(0,p.useViewportMatch)("medium","<");if(!r||0===r.length)return null;const g=(0,p.debounce)(u,250),h=e=>{var t;s!==e?(g(e),n(null!==(t=e?.name)&&void 0!==t?t:null)):g.cancel()};return(0,c.createElement)("div",{className:"block-editor-block-styles"},(0,c.createElement)("div",{className:"block-editor-block-styles__variants"},r.map((e=>{const t=e.isDefault?(0,v.__)("Default"):e.label||e.name;return(0,c.createElement)(m.Button,{className:d()("block-editor-block-styles__item",{"is-active":l.name===e.name}),key:e.name,variant:"secondary",label:t,onMouseEnter:()=>h(e),onFocus:()=>h(e),onMouseLeave:()=>h(null),onBlur:()=>h(null),onClick:()=>(e=>{o(e),n(null),u(null),g.cancel()})(e),"aria-current":l.name===e.name},(0,c.createElement)(m.__experimentalTruncate,{numberOfLines:1,className:"block-editor-block-styles__item-text"},t))}))),s&&!f&&(0,c.createElement)(m.Popover,{placement:"left-start",offset:20,focusOnMount:!1},(0,c.createElement)("div",{className:"block-editor-block-styles__preview-panel",onMouseLeave:()=>h(null)},(0,c.createElement)(Jw,{activeStyle:l,className:a,genericPreviewBlock:i,style:s}))))}var nS=tS;tS.Slot=()=>($()("BlockStyles.Slot",{version:"6.4",since:"6.2"}),null);const oS={0:(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M17.6 7c-.6.9-1.5 1.7-2.6 2v1h2v7h2V7h-1.4zM11 11H7V7H5v10h2v-4h4v4h2V7h-2v4z"})),2:(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M9 11.1H5v-4H3v10h2v-4h4v4h2v-10H9v4zm8 4c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6v1.5h8v-2H17z"})),3:(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M20 13V7h-3l-4 6v2h5v2h2v-2h1v-2h-1zm-2 0h-2.8L18 9v4zm-9-2H5V7H3v10h2v-4h4v4h2V7H9v4z"})),5:(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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 rS({level:e}){var t;return null!==(t=oS[e])&&void 0!==t?t:null}const lS=[1,2,3,4,5,6],iS={className:"block-library-heading-level-dropdown"};function aS({options:e=lS,value:t,onChange:n}){return(0,c.createElement)(m.ToolbarDropdownMenu,{popoverProps:iS,icon:(0,c.createElement)(rS,{level:t}),label:(0,v.__)("Change level"),controls:e.map((e=>{{const o=e===t;return{icon:(0,c.createElement)(rS,{level:e,isPressed:o}),label:0===e?(0,v.__)("Paragraph"):(0,v.sprintf)((0,v.__)("Heading %d"),e),isActive:o,onClick(){n(e)},role:"menuitemradio"}}}))})}var sS=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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"}));var cS=function({icon:e=sS,label:t=(0,v.__)("Choose variation"),instructions:n=(0,v.__)("Select a variation to start with."),variations:o,onSelect:r,allowSkip:l}){const i=d()("block-editor-block-variation-picker",{"has-many-variations":o.length>4});return(0,c.createElement)(m.Placeholder,{icon:e,label:t,instructions:n,className:i},(0,c.createElement)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,v.__)("Block variations")},o.map((e=>(0,c.createElement)("li",{key:e.name},(0,c.createElement)(m.Button,{variant:"secondary",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,c.createElement)("span",{className:"block-editor-block-variation-picker__variation-label"},e.title))))),l&&(0,c.createElement)("div",{className:"block-editor-block-variation-picker__skip"},(0,c.createElement)(m.Button,{variant:"link",onClick:()=>r()},(0,v.__)("Skip"))))};var uS=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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 dS="carousel",pS="grid",mS=({onBlockPatternSelect:e})=>(0,c.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},(0,c.createElement)(m.Button,{variant:"primary",onClick:e},(0,v.__)("Choose"))),fS=({handlePrevious:e,handleNext:t,activeSlide:n,totalSlides:o})=>(0,c.createElement)("div",{className:"block-editor-block-pattern-setup__navigation"},(0,c.createElement)(m.Button,{icon:Ud,label:(0,v.__)("Previous pattern"),onClick:e,disabled:0===n}),(0,c.createElement)(m.Button,{icon:Gd,label:(0,v.__)("Next pattern"),onClick:t,disabled:n===o-1}));var gS=({viewMode:e,setViewMode:t,handlePrevious:n,handleNext:o,activeSlide:r,totalSlides:l,onBlockPatternSelect:i})=>{const a=e===dS,s=(0,c.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,c.createElement)(m.Button,{icon:yi,label:(0,v.__)("Carousel view"),onClick:()=>t(dS),isPressed:a}),(0,c.createElement)(m.Button,{icon:uS,label:(0,v.__)("Grid view"),onClick:()=>t(pS),isPressed:e===pS}));return(0,c.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},a&&(0,c.createElement)(fS,{handlePrevious:n,handleNext:o,activeSlide:r,totalSlides:l}),s,a&&(0,c.createElement)(mS,{onBlockPatternSelect:i}))};var hS=function(e,t,n){return(0,f.useSelect)((o=>{const{getBlockRootClientId:r,getPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o($o),a=r(e);return n?i(a).filter(n):l(t,a)}),[e,t,n])};const bS=({viewMode:e,activeSlide:t,patterns:n,onBlockPatternSelect:o,showTitles:r})=>{const l=(0,m.__unstableUseCompositeState)(),i="block-editor-block-pattern-setup__container";if(e===dS){const e=new Map([[t,"active-slide"],[t-1,"previous-slide"],[t+1,"next-slide"]]);return(0,c.createElement)("div",{className:"block-editor-block-pattern-setup__carousel"},(0,c.createElement)("div",{className:i},(0,c.createElement)("ul",{className:"carousel-container"},n.map(((t,n)=>(0,c.createElement)(_S,{className:e.get(n)||"",key:t.name,pattern:t}))))))}return(0,c.createElement)("div",{className:"block-editor-block-pattern-setup__grid"},(0,c.createElement)(m.__unstableComposite,{...l,role:"listbox",className:i,"aria-label":(0,v.__)("Patterns list")},n.map((e=>(0,c.createElement)(vS,{key:e.name,pattern:e,onSelect:o,composite:l,showTitles:r})))))};function vS({pattern:e,onSelect:t,composite:n,showTitles:o}){const r="block-editor-block-pattern-setup-list",{blocks:l,description:i,viewportWidth:a=700}=e,s=(0,p.useInstanceId)(vS,`${r}__item-description`);return(0,c.createElement)("div",{className:`${r}__list-item`,"aria-label":e.title,"aria-describedby":e.description?s:void 0},(0,c.createElement)(m.__unstableCompositeItem,{role:"option",as:"div",...n,className:`${r}__item`,onClick:()=>t(l)},(0,c.createElement)(wm,{blocks:l,viewportWidth:a}),o&&(0,c.createElement)("div",{className:`${r}__item-title`},e.title),!!i&&(0,c.createElement)(m.VisuallyHidden,{id:s},i)))}function _S({className:e,pattern:t,minHeight:n}){const{blocks:o,title:r,description:l}=t,i=(0,p.useInstanceId)(_S,"block-editor-block-pattern-setup-list__item-description");return(0,c.createElement)("li",{className:`pattern-slide ${e}`,"aria-label":r,"aria-describedby":l?i:void 0},(0,c.createElement)(wm,{blocks:o,minHeight:n}),!!l&&(0,c.createElement)(m.VisuallyHidden,{id:i},l))}var kS=({clientId:e,blockName:t,filterPatternsFn:n,onBlockPatternSelect:o,initialViewMode:r=dS,showTitles:l=!1})=>{const[i,s]=(0,c.useState)(r),[u,d]=(0,c.useState)(0),{replaceBlock:p}=(0,f.useDispatch)($o),m=hS(e,t,n);if(!m?.length)return null;const g=o||(t=>{const n=t.map((e=>(0,a.cloneBlock)(e)));p(e,n)});return(0,c.createElement)(c.Fragment,null,(0,c.createElement)("div",{className:`block-editor-block-pattern-setup view-mode-${i}`},(0,c.createElement)(bS,{viewMode:i,activeSlide:u,patterns:m,onBlockPatternSelect:g,showTitles:l}),(0,c.createElement)(gS,{viewMode:i,setViewMode:s,activeSlide:u,totalSlides:m.length,handleNext:()=>{d((e=>e+1))},handlePrevious:()=>{d((e=>e-1))},onBlockPatternSelect:()=>{g(m[u].blocks)}})))};function yS({className:e,onSelectVariation:t,selectedValue:n,variations:o}){return(0,c.createElement)("fieldset",{className:e},(0,c.createElement)(m.VisuallyHidden,{as:"legend"},(0,v.__)("Transform to variation")),o.map((e=>(0,c.createElement)(m.Button,{key:e.name,icon:(0,c.createElement)(jd,{icon:e.icon,showColors:!0}),isPressed:n===e.name,label:n===e.name?e.title:(0,v.sprintf)((0,v.__)("Transform to %s"),e.title),onClick:()=>t(e.name),"aria-label":e.title,showTooltip:!0}))))}function ES({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,c.createElement)(m.DropdownMenu,{className:e,label:(0,v.__)("Transform to variation"),text:(0,v.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${e}__popover`},icon:Fg,toggleProps:{iconPosition:"right"}},(()=>(0,c.createElement)("div",{className:`${e}__container`},(0,c.createElement)(m.MenuGroup,null,(0,c.createElement)(m.MenuItemsChoice,{choices:r,value:n,onSelect:t})))))}var wS=function({blockClientId:e}){const{updateBlockAttributes:t}=(0,f.useDispatch)($o),{activeBlockVariation:n,variations:o}=(0,f.useSelect)((t=>{const{getActiveBlockVariation:n,getBlockVariations:o}=t(a.store),{getBlockName:r,getBlockAttributes:l}=t($o),i=e&&r(e);return{activeBlockVariation:n(i,l(e)),variations:i&&o(i,"transform")}}),[e]),r=n?.name,l=(0,c.useMemo)((()=>{const e=new Set;return!!o&&(o.forEach((t=>{t.icon&&e.add(t.icon?.src||t.icon)})),e.size===o.length)}),[o]);if(!o?.length)return null;const i=l?yS:ES;return(0,c.createElement)(i,{className:"block-editor-block-variation-transforms",onSelectVariation:n=>{t(e,{...o.find((({name:e})=>e===n)).attributes})},selectedValue:r,variations:o})},SS=(0,p.createHigherOrderComponent)((e=>t=>{const n=Qr("color.palette"),o=!Qr("color.custom"),r=void 0===t.colors?n:t.colors,l=void 0===t.disableCustomColors?o:t.disableCustomColors,i=r&&r.length>0||!l;return(0,c.createElement)(e,{...t,colors:r,disableCustomColors:l,hasColorsToChoose:i})}),"withColorContext"),CS=SS(m.ColorPalette);function xS({onChange:e,value:t,...n}){return(0,c.createElement)(E_,{...n,onColorChange:e,colorValue:t,gradients:[],disableCustomGradients:!0})}var BS=window.wp.date;const IS=new Date(2022,0,25);function TS({format:e,defaultFormat:t,onChange:n}){return(0,c.createElement)("fieldset",{className:"block-editor-date-format-picker"},(0,c.createElement)(m.VisuallyHidden,{as:"legend"},(0,v.__)("Date format")),(0,c.createElement)(m.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,v.__)("Default format"),help:`${(0,v.__)("Example:")} ${(0,BS.dateI18n)(t,IS)}`,checked:!e,onChange:e=>n(e?null:t)}),e&&(0,c.createElement)(MS,{format:e,onChange:n}))}function MS({format:e,onChange:t}){var n;const o=[...new Set(["Y-m-d",(0,v._x)("n/j/Y","short date format"),(0,v._x)("n/j/Y g:i A","short date format with time"),(0,v._x)("M j, Y","medium date format"),(0,v._x)("M j, Y g:i A","medium date format with time"),(0,v._x)("F j, Y","long date format"),(0,v._x)("M j","short date format without the year")])],r=o.map(((e,t)=>({key:`suggested-${t}`,name:(0,BS.dateI18n)(e,IS),format:e}))),l={key:"custom",name:(0,v.__)("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",__experimentalHint:(0,v.__)("Enter your own date format")},[i,a]=(0,c.useState)((()=>!!e&&!o.includes(e)));return(0,c.createElement)(m.__experimentalVStack,null,(0,c.createElement)(m.CustomSelectControl,{__nextUnconstrainedWidth:!0,label:(0,v.__)("Choose a format"),options:[...r,l],value:i?l:null!==(n=r.find((t=>t.format===e)))&&void 0!==n?n:l,onChange:({selectedItem:e})=>{e===l?a(!0):(a(!1),t(e.format))}}),i&&(0,c.createElement)(m.TextControl,{__nextHasNoMarginBottom:!0,label:(0,v.__)("Custom format"),hideLabelFromVision:!0,help:(0,c.createInterpolateElement)((0,v.__)("Enter a date or time <Link>format string</Link>."),{Link:(0,c.createElement)(m.ExternalLink,{href:(0,v.__)("https://wordpress.org/documentation/article/customize-date-and-time-format/")})}),value:e,onChange:e=>t(e)}))}const PS=({setting:e,children:t,panelId:n,...o})=>(0,c.createElement)(m.__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},t),NS=({colorValue:e,label:t})=>(0,c.createElement)(m.__experimentalHStack,{justify:"flex-start"},(0,c.createElement)(m.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:e}),(0,c.createElement)(m.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:t},t)),LS=e=>({onToggle:t,isOpen:n})=>{const{colorValue:o,label:r}=e,l={onClick:t,className:d()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":n}),"aria-expanded":n};return(0,c.createElement)(m.Button,{...l},(0,c.createElement)(NS,{colorValue:o,label:r}))};function RS({colors:e,disableCustomColors:t,disableCustomGradients:n,enableAlpha:o,gradients:r,settings:l,__experimentalIsRenderedInSidebar:i,...a}){let s;return i&&(s={placement:"left-start",offset:36,shift:!0}),(0,c.createElement)(c.Fragment,null,l.map(((l,u)=>{var d;const p={clearable:!1,colorValue:l.colorValue,colors:e,disableCustomColors:t,disableCustomGradients:n,enableAlpha:o,gradientValue:l.gradientValue,gradients:r,label:l.label,onColorChange:l.onColorChange,onGradientChange:l.onGradientChange,showTitle:!1,__experimentalIsRenderedInSidebar:i,...l},f={colorValue:null!==(d=l.gradientValue)&&void 0!==d?d:l.colorValue,label:l.label};return l&&(0,c.createElement)(PS,{key:u,setting:l,...a},(0,c.createElement)(m.Dropdown,{popoverProps:s,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:LS(f),renderContent:()=>(0,c.createElement)(m.__experimentalDropdownContentWrapper,{paddingSize:"none"},(0,c.createElement)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content"},(0,c.createElement)(E_,{...p})))}))})))}const AS=["colors","disableCustomColors","gradients","disableCustomGradients"],DS=({className:e,colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,children:l,settings:i,title:a,showTitle:s=!0,__experimentalIsRenderedInSidebar:u,enableAlpha:g})=>{const h=(0,p.useInstanceId)(DS),{batch:b}=(0,f.useRegistry)();return t&&0!==t.length||n&&0!==n.length||!o||!r||!i?.every((e=>(!e.colors||0===e.colors.length)&&(!e.gradients||0===e.gradients.length)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients)))?(0,c.createElement)(m.__experimentalToolsPanel,{className:d()("block-editor-panel-color-gradient-settings",e),label:s?a:void 0,resetAll:()=>{b((()=>{i.forEach((({colorValue:e,gradientValue:t,onColorChange:n,onGradientChange:o})=>{e?n():t&&o()}))}))},panelId:h,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},(0,c.createElement)(RS,{settings:i,panelId:h,colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalIsRenderedInSidebar:u,enableAlpha:g}),!!l&&(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.__experimentalSpacer,{marginY:4})," ",l)):null},OS=e=>{const t=Tv();return(0,c.createElement)(DS,{...t,...e})};var zS=e=>AS.every((t=>e.hasOwnProperty(t)))?(0,c.createElement)(DS,{...e}):(0,c.createElement)(OS,{...e});const VS=(0,c.createContext)({}),FS=()=>(0,c.useContext)(VS);function HS({id:e,url:t,naturalWidth:n,naturalHeight:o,onFinishEditing:r,onSaveImage:l,children:i}){const a=function({url:e,naturalWidth:t,naturalHeight:n}){const[o,r]=(0,c.useState)(),[l,i]=(0,c.useState)(),[a,u]=(0,c.useState)({x:0,y:0}),[d,p]=(0,c.useState)(100),[m,f]=(0,c.useState)(0),g=t/n,[h,b]=(0,c.useState)(g),v=(0,c.useCallback)((()=>{const t=(m+90)%360;let n=g;if(m%180==90&&(n=1/g),0===t)return r(),f(t),b(g),void u({x:-a.y*n,y:a.x*n});const o=new window.Image;o.src=e,o.onload=function(e){const o=document.createElement("canvas");let l=0,i=0;t%180?(o.width=e.target.height,o.height=e.target.width):(o.width=e.target.width,o.height=e.target.height),90!==t&&180!==t||(l=o.width),270!==t&&180!==t||(i=o.height);const s=o.getContext("2d");s.translate(l,i),s.rotate(t*Math.PI/180),s.drawImage(e.target,0,0),o.toBlob((e=>{r(URL.createObjectURL(e)),f(t),b(o.width/o.height),u({x:-a.y*n,y:a.x*n})}))};const l=(0,s.applyFilters)("media.crossOrigin",void 0,e);"string"==typeof l&&(o.crossOrigin=l)}),[m,g]);return(0,c.useMemo)((()=>({editedUrl:o,setEditedUrl:r,crop:l,setCrop:i,position:a,setPosition:u,zoom:d,setZoom:p,rotation:m,setRotation:f,rotateClockwise:v,aspect:h,setAspect:b,defaultAspect:g})),[o,l,a,d,m,v,h,g])}({url:t,naturalWidth:n,naturalHeight:o}),u=function({crop:e,rotation:t,height:n,width:o,aspect:r,url:l,id:i,onSaveImage:a,onFinishEditing:s}){const{createErrorNotice:u}=(0,f.useDispatch)(Fm.store),[d,p]=(0,c.useState)(!1),m=(0,c.useCallback)((()=>{p(!1),s()}),[p,s]),g=(0,c.useCallback)((()=>{p(!0);const n=[];t>0&&n.push({type:"rotate",args:{angle:t}}),(e.width<99.9||e.height<99.9)&&n.push({type:"crop",args:{left:e.x,top:e.y,width:e.width,height:e.height}}),lw()({path:`/wp/v2/media/${i}/edit`,method:"POST",data:{src:l,modifiers:n}}).then((e=>{a({id:e.id,url:e.source_url})})).catch((e=>{u((0,v.sprintf)((0,v.__)("Could not edit image. %s"),(0,ta.__unstableStripHTML)(e.message)),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{p(!1),s()}))}),[p,e,t,n,o,r,l,a,u,p,s]);return(0,c.useMemo)((()=>({isInProgress:d,apply:g,cancel:m})),[d,g,m])}({id:e,url:t,onSaveImage:l,onFinishEditing:r,...a}),d=(0,c.useMemo)((()=>({...a,...u})),[a,u]);return(0,c.createElement)(VS.Provider,{value:d},i)}
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var GS=function(e,t){return GS=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])},GS(e,t)};var US=function(){return US=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},US.apply(this,arguments)};Object.create;Object.create;var $S=n(7970),jS=n.n($S);function WS(e,t,n,o,r){void 0===r&&(r=0);var l=JS(t.width,t.height,r),i=l.width,a=l.height;return{x:KS(e.x,i,n.width,o),y:KS(e.y,a,n.height,o)}}function KS(e,t,n,o){var r=t*o/2-n/2;return eC(e,-r,r)}function qS(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function ZS(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function YS(e,t){return Math.min(e,Math.max(0,t))}function XS(e,t){return t}function QS(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function JS(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 eC(e,t,n){return Math.min(Math.max(e,t),n)}function tC(){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 nC=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=wa().createRef(),n.videoRef=wa().createRef(),n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc="undefined"!=typeof document?document:null,n.currentWindow="undefined"!=typeof window?window:null,n.resizeObserver=null,n.state={cropSize:null,hasWheelJustStarted:!1},n.initResizeObserver=function(){if(void 0!==window.ResizeObserver&&n.containerRef){var e=!0;n.resizeObserver=new window.ResizeObserver((function(t){e?e=!1:n.computeSizes()})),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd))},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var e=n.computeSizes();e&&(n.emitCropData(),n.setInitialCrop(e)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(e){if(n.props.initialCroppedAreaPercentages){var t=function(e,t,n,o,r,l){var i=JS(t.width,t.height,n),a=eC(o.width/i.width*(100/e.width),r,l);return{crop:{x:a*i.width/2-o.width/2-i.width*a*(e.x/100),y:a*i.height/2-o.height/2-i.height*a*(e.y/100)},zoom:a}}(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 l=function(e,t,n,o,r,l){void 0===n&&(n=0);var i=JS(t.naturalWidth,t.naturalHeight,n),a=eC(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,l),s=o.height>o.width?o.height/e.height:o.width/e.width;return{crop:{x:((i.width-e.width)/2-e.x)*s,y:((i.height-e.height)/2-e.y)*s},zoom:a}}(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom);o=l.crop,r=l.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(r)}},n.computeSizes=function(){var e,t,o,r,l,i,a=n.imageRef.current||n.videoRef.current;if(a&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect();var s=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(a.offsetWidth<c||a.offsetHeight<u)switch(n.props.objectFit){default:case"contain":p=s>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};break;case"auto-cover":p=c>u?{width:n.containerRect.width,height:n.containerRect.width/d}:{width:n.containerRect.height*d,height:n.containerRect.height}}else p={width:a.offsetWidth,height:a.offsetHeight};n.mediaSize=US(US({},p),{naturalWidth:c,naturalHeight:u}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var m=n.props.cropSize?n.props.cropSize:function(e,t,n,o,r,l){void 0===l&&(l=0);var i=JS(e,t,l),a=i.width,s=i.height,c=Math.min(a,n),u=Math.min(s,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===(l=n.state.cropSize)||void 0===l?void 0:l.height)===m.height&&(null===(i=n.state.cropSize)||void 0===i?void 0:i.width)===m.width||n.props.onCropSizeChange&&n.props.onCropSizeChange(m),n.setState({cropSize:m},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(m),m}},n.onMouseDown=function(e){n.currentDoc&&(e.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e)))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},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),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onGestureStart=function(e){n.currentDoc&&(e.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureMove),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureMove=function(e){if(e.preventDefault(),!n.isTouching){var o=t.getMousePoint(e),r=n.gestureZoomStart-1+e.scale;if(n.setNewZoom(r,o,{shouldUpdatePosition:!0}),n.props.onRotationChange){var l=n.gestureRotationStart+e.rotation;n.props.onRotationChange(l)}}},n.onGestureEnd=function(e){n.cleanEvents()},n.onDragStart=function(e){var t,o,r=e.x,l=e.y;n.dragStartPosition={x:r,y:l},n.dragStartCrop=US({},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,l={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+r},i=n.props.restrictPosition?WS(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(i)}})))},n.onDragStopped=function(){var e,t;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){if(n.currentWindow&&(!n.props.onWheelRequest||n.props.onWheelRequest(e))){e.preventDefault();var o=t.getMousePoint(e),r=jS()(e).pixelY,l=n.props.zoom-r*n.props.zoomSpeed/200;n.setNewZoom(l,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){var t=e.x,o=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(t-n.containerRect.left),y:n.containerRect.height/2-(o-n.containerRect.top)}},n.getPointOnMedia=function(e){var t=e.x,o=e.y,r=n.props,l=r.crop,i=r.zoom;return{x:(t+l.x)/i,y:(o+l.y)/i}},n.setNewZoom=function(e,t,o){var r=(void 0===o?{}:o).shouldUpdatePosition,l=void 0===r||r;if(n.state.cropSize&&n.props.onZoomChange){var i=eC(e,n.props.minZoom,n.props.maxZoom);if(l){var a=n.getPointOnContainer(t),s=n.getPointOnMedia(a),c={x:s.x*i-a.x,y:s.y*i-a.y},u=n.props.restrictPosition?WS(c,n.mediaSize,n.state.cropSize,i,n.props.rotation):c;n.props.onCropChange(u)}n.props.onZoomChange(i)}},n.getCropData=function(){return n.state.cropSize?function(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var a=i?YS:XS,s=JS(t.width,t.height,l),c=JS(t.naturalWidth,t.naturalHeight,l),u={x:a(100,((s.width-n.width/r)/2-e.x/r)/s.width*100),y:a(100,((s.height-n.height/r)/2-e.y/r)/s.height*100),width:a(100,n.width/s.width*100/r),height:a(100,n.height/s.height*100/r)},d=Math.round(a(c.width,u.width*c.width/100)),p=Math.round(a(c.height,u.height*c.height/100)),m=c.width>=c.height*o?{width:Math.round(p*o),height:p}:{width:d,height:Math.round(d/o)};return{croppedAreaPercentages:u,croppedAreaPixels:US(US({},m),{x:Math.round(a(c.width-m.width,u.x*c.width/100)),y:Math.round(a(c.height-m.height,u.y*c.height/100))})}}(n.props.restrictPosition?WS(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition):null},n.emitCropData=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,o),n.props.onCropAreaChange&&n.props.onCropAreaChange(t,o)}},n.emitCropAreaChange=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(t,o)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?WS(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(e),n.emitCropData()}},n}return function(e,t){function n(){this.constructor=e}GS(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.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef))},t.prototype.componentWillUnmount=function(){var e,t;this.currentDoc&&this.currentWindow&&(void 0===window.ResizeObserver&&this.currentWindow.removeEventListener("resize",this.computeSizes),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&(null===(t=this.styleRef.parentNode)||void 0===t||t.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(e){var t,n,o,r,l,i,a,s,c;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?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===(l=e.crop)||void 0===l?void 0:l.x)===(null===(i=this.props.crop)||void 0===i?void 0:i.x)&&(null===(a=e.crop)||void 0===a?void 0:a.y)===(null===(s=this.props.crop)||void 0===s?void 0:s.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())},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=qS(n,o),this.lastPinchRotation=ZS(n,o),this.onDragStart(QS(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]),l=QS(o,r);this.onDrag(l),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame((function(){var e=qS(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l,{shouldUpdatePosition:!1}),n.lastPinchDistance=e;var i=ZS(o,r),a=n.props.rotation+(i-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(a),n.lastPinchRotation=i}))}},t.prototype.render=function(){var e=this,t=this.props,n=t.image,o=t.video,r=t.mediaProps,l=t.transform,i=t.crop,a=i.x,s=i.y,c=t.rotation,u=t.zoom,d=t.cropShape,p=t.showGrid,m=t.style,f=m.containerStyle,g=m.cropAreaStyle,h=m.mediaStyle,b=t.classes,v=b.containerClassName,_=b.cropAreaClassName,k=b.mediaClassName,y=t.objectFit;return wa().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:f,className:tC("reactEasyCrop_Container",v)},n?wa().createElement("img",US({alt:"",className:tC("reactEasyCrop_Image","contain"===y&&"reactEasyCrop_Contain","horizontal-cover"===y&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===y&&"reactEasyCrop_Cover_Vertical","auto-cover"===y&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),k)},r,{src:n,ref:this.imageRef,style:US(US({},h),{transform:l||"translate(".concat(a,"px, ").concat(s,"px) rotate(").concat(c,"deg) scale(").concat(u,")")}),onLoad:this.onMediaLoad})):o&&wa().createElement("video",US({autoPlay:!0,loop:!0,muted:!0,className:tC("reactEasyCrop_Video","contain"===y&&"reactEasyCrop_Contain","horizontal-cover"===y&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===y&&"reactEasyCrop_Cover_Vertical","auto-cover"===y&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),k)},r,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:US(US({},h),{transform:l||"translate(".concat(a,"px, ").concat(s,"px) rotate(").concat(c,"deg) scale(").concat(u,")")}),controls:!1}),(Array.isArray(o)?o:[{src:o}]).map((function(e){return wa().createElement("source",US({key:e.src},e))}))),this.state.cropSize&&wa().createElement("div",{style:US(US({},g),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:tC("reactEasyCrop_CropArea","round"===d&&"reactEasyCrop_CropAreaRound",p&&"reactEasyCrop_CropAreaGrid",_)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(wa().Component);const oC=100,rC=300,lC={placement:"bottom-start"};function iC({url:e,width:t,height:n,clientWidth:o,naturalHeight:r,naturalWidth:l,borderProps:i}){const{isInProgress:a,editedUrl:s,position:u,zoom:p,aspect:f,setPosition:g,setCrop:h,setZoom:b,rotation:v}=FS();let _=n||o*r/l;return v%180==90&&(_=o*l/r),(0,c.createElement)("div",{className:d()("wp-block-image__crop-area",i?.className,{"is-applying":a}),style:{...i?.style,width:t||o,height:_}},(0,c.createElement)(nC,{image:s||e,disabled:a,minZoom:oC/100,maxZoom:rC/100,crop:u,zoom:p/100,aspect:f,onCropChange:e=>{g(e)},onCropComplete:e=>{h(e)},onZoomChange:e=>{b(100*e)}}),a&&(0,c.createElement)(m.Spinner,null))}var aC=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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 sC(){const{isInProgress:e,zoom:t,setZoom:n}=FS();return(0,c.createElement)(m.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:lC,renderToggle:({isOpen:t,onToggle:n})=>(0,c.createElement)(m.ToolbarButton,{icon:aC,label:(0,v.__)("Zoom"),onClick:n,"aria-expanded":t,disabled:e}),renderContent:()=>(0,c.createElement)(m.RangeControl,{__nextHasNoMarginBottom:!0,label:(0,v.__)("Zoom"),min:oC,max:rC,value:Math.round(t),onChange:n})})}var cC=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z"}));function uC({aspectRatios:e,isDisabled:t,label:n,onClick:o,value:r}){return(0,c.createElement)(m.MenuGroup,{label:n},e.map((({title:e,aspect:n})=>(0,c.createElement)(m.MenuItem,{key:n,disabled:t,onClick:()=>{o(n)},role:"menuitemradio",isSelected:n===r,icon:n===r?hh:void 0},e))))}function dC({toggleProps:e}){const{isInProgress:t,aspect:n,setAspect:o,defaultAspect:r}=FS();return(0,c.createElement)(m.DropdownMenu,{icon:cC,label:(0,v.__)("Aspect Ratio"),popoverProps:lC,toggleProps:e,className:"wp-block-image__aspect-ratio"},(({onClose:e})=>(0,c.createElement)(c.Fragment,null,(0,c.createElement)(uC,{isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:[{title:(0,v.__)("Original"),aspect:r},{title:(0,v.__)("Square"),aspect:1}]}),(0,c.createElement)(uC,{label:(0,v.__)("Landscape"),isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:[{title:(0,v.__)("16:10"),aspect:1.6},{title:(0,v.__)("16:9"),aspect:16/9},{title:(0,v.__)("4:3"),aspect:4/3},{title:(0,v.__)("3:2"),aspect:1.5}]}),(0,c.createElement)(uC,{label:(0,v.__)("Portrait"),isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:[{title:(0,v.__)("10:16"),aspect:.625},{title:(0,v.__)("9:16"),aspect:9/16},{title:(0,v.__)("3:4"),aspect:3/4},{title:(0,v.__)("2:3"),aspect:2/3}]}))))}var pC=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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 mC(){const{isInProgress:e,rotateClockwise:t}=FS();return(0,c.createElement)(m.ToolbarButton,{icon:pC,label:(0,v.__)("Rotate"),onClick:t,disabled:e})}function fC(){const{isInProgress:e,apply:t,cancel:n}=FS();return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.ToolbarButton,{onClick:t,disabled:e},(0,v.__)("Apply")),(0,c.createElement)(m.ToolbarButton,{onClick:n},(0,v.__)("Cancel")))}function gC({id:e,url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i,onSaveImage:a,onFinishEditing:s,borderProps:u}){return(0,c.createElement)(HS,{id:e,url:t,naturalWidth:i,naturalHeight:l,onSaveImage:a,onFinishEditing:s},(0,c.createElement)(iC,{borderProps:u,url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}),(0,c.createElement)(nr,null,(0,c.createElement)(m.ToolbarGroup,null,(0,c.createElement)(sC,null),(0,c.createElement)(m.ToolbarItem,null,(e=>(0,c.createElement)(dC,{toggleProps:e}))),(0,c.createElement)(mC,null)),(0,c.createElement)(m.ToolbarGroup,null,(0,c.createElement)(fC,null))))}const hC=[25,50,75,100],bC=()=>{};function vC({imageSizeHelp:e,imageWidth:t,imageHeight:n,imageSizeOptions:o=[],isResizable:r=!0,slug:l,width:i,height:a,onChange:s,onChangeImage:u=bC}){$()("wp.blockEditor.__experimentalImageSizeControl",{since:"6.3",alternative:"wp.blockEditor.privateApis.DimensionsTool and wp.blockEditor.privateApis.ResolutionTool"});const{currentHeight:d,currentWidth:p,updateDimension:f,updateDimensions:g}=function(e,t,n,o,r){var l,i;const[a,s]=(0,c.useState)(null!==(l=null!=t?t:o)&&void 0!==l?l:""),[u,d]=(0,c.useState)(null!==(i=null!=e?e:n)&&void 0!==i?i:"");return(0,c.useEffect)((()=>{void 0===t&&void 0!==o&&s(o),void 0===e&&void 0!==n&&d(n)}),[o,n]),(0,c.useEffect)((()=>{void 0!==t&&Number.parseInt(t)!==Number.parseInt(a)&&s(t),void 0!==e&&Number.parseInt(e)!==Number.parseInt(u)&&d(e)}),[t,e]),{currentHeight:u,currentWidth:a,updateDimension:(e,t)=>{const n=""===t?void 0:parseInt(t,10);"width"===e?s(n):d(n),r({[e]:n})},updateDimensions:(e,t)=>{d(null!=e?e:n),s(null!=t?t:o),r({height:e,width:t})}}}(a,i,n,t,s);return(0,c.createElement)(c.Fragment,null,o&&o.length>0&&(0,c.createElement)(m.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,v.__)("Resolution"),value:l,options:o,onChange:u,help:e,size:"__unstable-large"}),r&&(0,c.createElement)("div",{className:"block-editor-image-size-control"},(0,c.createElement)(m.__experimentalHStack,{align:"baseline",spacing:"3"},(0,c.createElement)(m.__experimentalNumberControl,{className:"block-editor-image-size-control__width",label:(0,v.__)("Width"),value:p,min:1,onChange:e=>f("width",e),size:"__unstable-large"}),(0,c.createElement)(m.__experimentalNumberControl,{className:"block-editor-image-size-control__height",label:(0,v.__)("Height"),value:d,min:1,onChange:e=>f("height",e),size:"__unstable-large"})),(0,c.createElement)(m.__experimentalHStack,null,(0,c.createElement)(m.ButtonGroup,{"aria-label":(0,v.__)("Image size presets")},hC.map((e=>{const o=Math.round(t*(e/100)),r=Math.round(n*(e/100)),l=p===o&&d===r;return(0,c.createElement)(m.Button,{key:e,isSmall:!0,variant:l?"primary":void 0,isPressed:l,onClick:()=>g(r,o)},e,"%")}))),(0,c.createElement)(m.Button,{isSmall:!0,onClick:()=>g()},(0,v.__)("Reset")))))}var _C=function e({children:t,settingsOpen:n,setSettingsOpen:o}){const r=(0,p.useReducedMotion)(),l=r?c.Fragment:m.__unstableAnimatePresence,i=r?"div":m.__unstableMotion.div,a=`link-control-settings-drawer-${(0,p.useInstanceId)(e)}`;return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.Button,{className:"block-editor-link-control__drawer-toggle","aria-expanded":n,onClick:()=>o(!n),icon:(0,v.isRTL)()?Nw:hw,"aria-controls":a},(0,v._x)("Advanced","Additional link settings")),(0,c.createElement)(l,null,n&&(0,c.createElement)(i,{className:"block-editor-link-control__drawer",hidden:!n,id:a,initial:"collapsed",animate:"open",exit:"collapsed",variants:{open:{opacity:1,height:"auto"},collapsed:{opacity:0,height:0}},transition:{duration:.1}},(0,c.createElement)("div",{className:"block-editor-link-control__drawer-inner"},t))))},kC=n(5425),yC=n.n(kC);function EC(e){return"function"==typeof e}class wC extends c.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,c.createRef)(),this.inputRef=(0,c.createRef)(),this.updateSuggestions=(0,p.debounce)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.suggestionsRequest=null,this.state={suggestions:[],showSuggestions:!1,isUpdatingSuggestions:!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.scrollingIntoView&&(this.scrollingIntoView=!0,yC()(this.suggestionNodes[n],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),this.props.setTimeout((()=>{this.scrollingIntoView=!1}),100)),e.value===o||this.props.disableSuggestions||this.state.isUpdatingSuggestions||(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,Cf.isURL)(e)))return this.suggestionsRequest?.cancel?.(),this.suggestionsRequest=null,void this.setState({suggestions:[],showSuggestions:!1,suggestionsValue:e,selectedSuggestion:null,loading:!1});this.setState({isUpdatingSuggestions:!0,selectedSuggestion:null,loading:!0});const r=t(e,{isInitialSuggestions:o});r.then((t=>{this.suggestionsRequest===r&&(this.setState({suggestions:t,isUpdatingSuggestions:!1,suggestionsValue:e,loading:!1,showSuggestions:!!t.length}),t.length?this.props.debouncedSpeak((0,v.sprintf)((0,v._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,v.__)("No results."),"assertive"))})).catch((()=>{this.suggestionsRequest===r&&this.setState({isUpdatingSuggestions:!1,loading:!1})})),this.suggestionsRequest=r}onChange(e){this.props.onChange(e.target.value)}onFocus(){const{suggestions:e}=this.state,{disableSuggestions:t,value:n}=this.props;!n||t||this.state.isUpdatingSuggestions||e&&e.length||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 Ed.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case Ed.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case Ed.ENTER:this.props.onSubmit&&(e.preventDefault(),this.props.onSubmit(null,e))}return}const l=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case Ed.UP:{e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case Ed.DOWN:{e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case Ed.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(l),this.props.speak((0,v.__)("Link selected.")));break;case Ed.ENTER:e.preventDefault(),null!==this.state.selectedSuggestion?(this.selectLink(l),this.props.onSubmit&&this.props.onSubmit(l,e)):this.props.onSubmit&&this.props.onSubmit(null,e)}}selectLink(e){this.props.onChange(e.url,e),this.setState({selectedSuggestion:null,showSuggestions:!1})}handleOnClick(e){this.selectLink(e),this.inputRef.current.focus()}static getDerivedStateFromProps({value:e,instanceId:t,disableSuggestions:n,__experimentalShowInitialSuggestions:o=!1},{showSuggestions:r}){let l=r;const i=e&&e.length;return o||i||(l=!1),!0===n&&(l=!1),{showSuggestions:l,suggestionsListboxId:`block-editor-url-input-suggestions-${t}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${t}`}}render(){return(0,c.createElement)(c.Fragment,null,this.renderControl(),this.renderSuggestions())}renderControl(){const{__nextHasNoMarginBottom:e=!1,label:t=null,className:n,isFullWidth:o,instanceId:r,placeholder:l=(0,v.__)("Paste URL or type to search"),__experimentalRenderControl:i,value:a="",hideLabelFromVision:s=!1}=this.props,{loading:u,showSuggestions:p,selectedSuggestion:f,suggestionsListboxId:g,suggestionOptionIdPrefix:h}=this.state,b=`url-input-control-${r}`,_={id:b,label:t,className:d()("block-editor-url-input",n,{"is-full-width":o}),hideLabelFromVision:s},k={id:b,value:a,required:!0,className:"block-editor-url-input__input",type:"text",onChange:this.onChange,onFocus:this.onFocus,placeholder:l,onKeyDown:this.onKeyDown,role:"combobox","aria-label":t?void 0:(0,v.__)("URL"),"aria-expanded":p,"aria-autocomplete":"list","aria-owns":g,"aria-activedescendant":null!==f?`${h}-${f}`:void 0,ref:this.inputRef};return i?i(_,k,u):(e||$()("Bottom margin styles for wp.blockEditor.URLInput",{since:"6.2",version:"6.5",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"}),(0,c.createElement)(m.BaseControl,{__nextHasNoMarginBottom:e,..._},(0,c.createElement)("input",{...k}),u&&(0,c.createElement)(m.Spinner,null)))}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t}=this.props,{showSuggestions:n,suggestions:o,suggestionsValue:r,selectedSuggestion:l,suggestionsListboxId:i,suggestionOptionIdPrefix:a,loading:s}=this.state;if(!n||0===o.length)return null;const u={id:i,ref:this.autocompleteRef,role:"listbox"},p=(e,t)=>({role:"option",tabIndex:"-1",id:`${a}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===l||void 0});return EC(t)?t({suggestions:o,selectedSuggestion:l,suggestionsListProps:u,buildSuggestionItemProps:p,isLoading:s,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:!r?.length,currentInputValue:r}):(0,c.createElement)(m.Popover,{placement:"bottom",focusOnMount:!1},(0,c.createElement)("div",{...u,className:d()("block-editor-url-input__suggestions",`${e}__suggestions`)},o.map(((e,t)=>(0,c.createElement)(m.Button,{...p(0,t),key:e.id,className:d()("block-editor-url-input__suggestion",{"is-selected":t===l}),onClick:()=>this.handleOnClick(e)},e.title)))))}}var SC=(0,p.compose)(p.withSafeTimeout,m.withSpokenMessages,p.withInstanceId,(0,f.withSelect)(((e,t)=>{if(EC(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e($o);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(wC);var CC=({searchTerm:e,onClick:t,itemProps:n,isSelected:o,buttonText:r})=>{if(!e)return null;let l;return l=r?"function"==typeof r?r(e):r:(0,c.createInterpolateElement)((0,v.sprintf)((0,v.__)("Create: <mark>%s</mark>"),e),{mark:(0,c.createElement)("mark",null)}),(0,c.createElement)(m.Button,{...n,className:d()("block-editor-link-control__search-create block-editor-link-control__search-item",{"is-selected":o}),onClick:t},(0,c.createElement)(Ql,{className:"block-editor-link-control__search-item-icon",icon:Vd}),(0,c.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,c.createElement)("span",{className:"block-editor-link-control__search-item-title"},l)))};var xC=(0,c.createElement)(F.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(F.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 11h2V9H7v2zm0 4h2v-2H7v2zm3-4h7V9h-7v2zm0 4h7v-2h-7v2z"}));var BC=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M20.1 11.2l-6.7-6.7c-.1-.1-.3-.2-.5-.2H5c-.4-.1-.8.3-.8.7v7.8c0 .2.1.4.2.5l6.7 6.7c.2.2.5.4.7.5s.6.2.9.2c.3 0 .6-.1.9-.2.3-.1.5-.3.8-.5l5.6-5.6c.4-.4.7-1 .7-1.6.1-.6-.2-1.2-.6-1.6zM19 13.4L13.4 19c-.1.1-.2.1-.3.2-.2.1-.4.1-.6 0-.1 0-.2-.1-.3-.2l-6.5-6.5V5.8h6.8l6.5 6.5c.2.2.2.4.2.6 0 .1 0 .3-.2.5zM9 8c-.6 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.4-1-1-1z"}));var IC=(0,c.createElement)(F.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(F.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"}));var TC=(0,c.createElement)(F.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(F.Path,{d:"M19 6.2h-5.9l-.6-1.1c-.3-.7-1-1.1-1.8-1.1H5c-1.1 0-2 .9-2 2v11.8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8.2c0-1.1-.9-2-2-2zm.5 11.6c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h5.8c.2 0 .4.1.4.3l1 2H19c.3 0 .5.2.5.5v9.5z"}));var MC=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M12 3.3c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8s-4-8.8-8.8-8.8zm6.5 5.5h-2.6C15.4 7.3 14.8 6 14 5c2 .6 3.6 2 4.5 3.8zm.7 3.2c0 .6-.1 1.2-.2 1.8h-2.9c.1-.6.1-1.2.1-1.8s-.1-1.2-.1-1.8H19c.2.6.2 1.2.2 1.8zM12 18.7c-1-.7-1.8-1.9-2.3-3.5h4.6c-.5 1.6-1.3 2.9-2.3 3.5zm-2.6-4.9c-.1-.6-.1-1.1-.1-1.8 0-.6.1-1.2.1-1.8h5.2c.1.6.1 1.1.1 1.8s-.1 1.2-.1 1.8H9.4zM4.8 12c0-.6.1-1.2.2-1.8h2.9c-.1.6-.1 1.2-.1 1.8 0 .6.1 1.2.1 1.8H5c-.2-.6-.2-1.2-.2-1.8zM12 5.3c1 .7 1.8 1.9 2.3 3.5H9.7c.5-1.6 1.3-2.9 2.3-3.5zM10 5c-.8 1-1.4 2.3-1.8 3.8H5.5C6.4 7 8 5.6 10 5zM5.5 15.3h2.6c.4 1.5 1 2.8 1.8 3.7-1.8-.6-3.5-2-4.4-3.7zM14 19c.8-1 1.4-2.2 1.8-3.7h2.6C17.6 17 16 18.4 14 19z"}));const PC={post:xC,page:iw,post_tag:BC,category:IC,attachment:TC};function NC({isURL:e,suggestion:t}){let n=null;return e?n=MC:t.type in PC&&(n=PC[t.type]),n?(0,c.createElement)(Ql,{className:"block-editor-link-control__search-item-icon",icon:n}):null}var LC=({itemProps:e,suggestion:t,isSelected:n=!1,onClick:o,isURL:r=!1,searchTerm:l="",shouldShowType:i=!1})=>(0,c.createElement)(m.Button,{...e,onClick:o,className:d()("block-editor-link-control__search-item",{"is-selected":n,"is-url":r,"is-entity":!r})},(0,c.createElement)(NC,{suggestion:t,isURL:r}),(0,c.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,c.createElement)("span",{className:"block-editor-link-control__search-item-title"},(0,c.createElement)(m.TextHighlight,{text:(0,ta.__unstableStripHTML)(t.title),highlight:l})),(0,c.createElement)("span",{"aria-hidden":!r,className:"block-editor-link-control__search-item-info"},!r&&((0,Cf.filterURLForDisplay)((0,Cf.safeDecodeURI)(t.url))||""),r&&(0,v.__)("Press ENTER to add this link"))),i&&t.type&&(0,c.createElement)("span",{className:"block-editor-link-control__search-item-type"},function(e){if(e.isFrontPage)return"front page";return"post_tag"===e.type?"tag":e.type}(t)));const RC="__CREATE__",AC="mailto",DC="internal",OC=["URL",AC,"tel",DC],zC=[{id:"opensInNewTab",title:(0,v.__)("Open in new tab")}];function VC({instanceId:e,withCreateSuggestion:t,currentInputValue:n,handleSuggestionClick:o,suggestionsListProps:r,buildSuggestionItemProps:l,suggestions:i,selectedSuggestion:a,isLoading:s,isInitialSuggestions:u,createSuggestionButtonText:p,suggestionsQuery:f}){const g=d()("block-editor-link-control__search-results",{"is-loading":s}),h=1===i.length&&OC.includes(i[0].type),b=t&&!h&&!u,_=!f?.type,k=`block-editor-link-control-search-results-label-${e}`,y=u?(0,v.__)("Suggestions"):(0,v.sprintf)((0,v.__)('Search results for "%s"'),n),E=(0,c.createElement)(m.VisuallyHidden,{id:k},y);return(0,c.createElement)("div",{className:"block-editor-link-control__search-results-wrapper"},E,(0,c.createElement)("div",{...r,className:g,"aria-labelledby":k},i.map(((e,t)=>b&&RC===e.type?(0,c.createElement)(CC,{searchTerm:n,buttonText:p,onClick:()=>o(e),key:e.type,itemProps:l(e,t),isSelected:t===a}):RC===e.type?null:(0,c.createElement)(LC,{key:`${e.id}-${e.type}`,itemProps:l(e,t),suggestion:e,index:t,onClick:()=>{o(e)},isSelected:t===a,isURL:OC.includes(e.type),searchTerm:n,shouldShowType:_,isFrontPage:e?.isFrontPage})))))}function FC(e){if(e.includes(" "))return!1;const t=(0,Cf.getProtocol)(e),n=(0,Cf.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."),l=e?.startsWith("#")&&(0,Cf.isValidFragment)(e);return n||r||l||o}const HC=()=>Promise.resolve([]),GC=e=>{let t="URL";const n=(0,Cf.getProtocol)(e)||"";return n.includes("mailto")&&(t=AC),n.includes("tel")&&(t="tel"),e?.startsWith("#")&&(t=DC),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,Cf.prependHTTP)(e):e,type:t}])};function UC(e,t,n,o){const{fetchSearchSuggestions:r,pageOnFront:l}=(0,f.useSelect)((e=>{const{getSettings:t}=e($o);return{pageOnFront:t().pageOnFront,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),i=t?GC:HC;return(0,c.useCallback)(((t,{isInitialSuggestions:l})=>FC(t)?i(t,{isInitialSuggestions:l}):(async(e,t,n,o,r)=>{const{isInitialSuggestions:l}=t,i=await n(e,t);return i.map((e=>Number(e.id)===r?(e.isFrontPage=!0,e):e)),l||FC(e)||!o?i:i.concat({title:e,url:e,type:RC})})(t,{...e,isInitialSuggestions:l},r,n,o)),[i,r,l,e,n,o])}const $C=()=>Promise.resolve([]),jC=()=>{},WC=(0,c.forwardRef)((({value:e,children:t,currentLink:n={},className:o=null,placeholder:r=null,withCreateSuggestion:l=!1,onCreateSuggestion:i=jC,onChange:a=jC,onSelect:s=jC,showSuggestions:u=!0,renderSuggestions:m=(e=>(0,c.createElement)(VC,{...e})),fetchSuggestions:f=null,allowDirectEntry:g=!0,showInitialSuggestions:h=!1,suggestionsQuery:b={},withURLSuggestion:_=!0,createSuggestionButtonText:k,hideLabelFromVision:y=!1},E)=>{const w=UC(b,g,l,_),S=u?f||w:$C,C=(0,p.useInstanceId)(WC),[x,B]=(0,c.useState)(),I=async e=>{let t=e;if(RC!==e.type){if(g||t&&Object.keys(t).length>=1){const{id:e,url:o,...r}=null!=n?n:{};s({...r,...t},t)}}else try{t=await i(e.title),t?.url&&s(t)}catch(e){}},T=d()(o,{});return(0,c.createElement)("div",{className:"block-editor-link-control__search-input-container"},(0,c.createElement)(SC,{disableSuggestions:n?.url===e,__nextHasNoMarginBottom:!0,label:(0,v.__)("Link"),hideLabelFromVision:y,className:T,value:e,onChange:(e,t)=>{a(e),B(t)},placeholder:null!=r?r:(0,v.__)("Search or type url"),__experimentalRenderSuggestions:u?e=>m({...e,instanceId:C,withCreateSuggestion:l,createSuggestionButtonText:k,suggestionsQuery:b,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),I(t)}}):null,__experimentalFetchLinkSuggestions:S,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:h,onSubmit:(t,n)=>{const o=t||x;o||e?.trim()?.length?I(o||{url:e}):n.preventDefault()},ref:E}),t)}));var KC=WC;var qC=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"}));var ZC=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"}));const{Slot:YC,Fill:XC}=(0,m.createSlotFill)("BlockEditorLinkControlViewer");function QC(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}`)}}var JC=function(e){const[t,n]=(0,c.useReducer)(QC,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=(0,f.useSelect)((e=>{const{getSettings:t}=e($o);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}}),[]);return(0,c.useEffect)((()=>{if(e?.length&&o&&"undefined"!=typeof AbortController){n({type:"LOADING"});const t=new window.AbortController,r=t.signal;return o(e,{signal:r}).then((e=>{n({type:"RESOLVED",richData:e})})).catch((()=>{r.aborted||n({type:"ERROR"})})),()=>{t.abort()}}}),[e]),t};function ex({value:e,onEditClick:t,hasRichPreviews:n=!1,hasUnlinkControl:o=!1,onRemove:r}){const l=n?e?.url:null,{richData:i,isFetching:a}=JC(l),s=i&&Object.keys(i).length,u=e&&(0,Cf.filterURLForDisplay)((0,Cf.safeDecodeURI)(e.url),16)||"",p=i?.title||e?.title||u,f=!e?.url?.length;let g;return g=i?.icon?(0,c.createElement)("img",{src:i?.icon,alt:""}):f?(0,c.createElement)(Ql,{icon:qC,size:32}):(0,c.createElement)(Ql,{icon:MC}),(0,c.createElement)("div",{"aria-label":(0,v.__)("Currently selected"),className:d()("block-editor-link-control__search-item",{"is-current":!0,"is-rich":s,"is-fetching":!!a,"is-preview":!0,"is-error":f})},(0,c.createElement)("div",{className:"block-editor-link-control__search-item-top"},(0,c.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,c.createElement)("span",{className:d()("block-editor-link-control__search-item-icon",{"is-image":i?.icon})},g),(0,c.createElement)("span",{className:"block-editor-link-control__search-item-details"},f?(0,c.createElement)("span",{className:"block-editor-link-control__search-item-error-notice"},(0,v.__)("Link is empty")):(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.ExternalLink,{className:"block-editor-link-control__search-item-title",href:e.url},(0,ta.__unstableStripHTML)(p)),e?.url&&(0,c.createElement)("span",{className:"block-editor-link-control__search-item-info"},u)))),(0,c.createElement)(m.Button,{icon:ZC,label:(0,v.__)("Edit"),className:"block-editor-link-control__search-item-action",onClick:t,iconSize:24}),o&&(0,c.createElement)(m.Button,{icon:Vv,label:(0,v.__)("Unlink"),className:"block-editor-link-control__search-item-action block-editor-link-control__unlink",onClick:r,iconSize:24}),(0,c.createElement)(YC,{fillProps:e})),!!(s&&(i?.image||i?.description)||a)&&(0,c.createElement)("div",{className:"block-editor-link-control__search-item-bottom"},(i?.image||a)&&(0,c.createElement)("div",{"aria-hidden":!i?.image,className:d()("block-editor-link-control__search-item-image",{"is-placeholder":!i?.image})},i?.image&&(0,c.createElement)("img",{src:i?.image,alt:""})),(i?.description||a)&&(0,c.createElement)("div",{"aria-hidden":!i?.description,className:d()("block-editor-link-control__search-item-description",{"is-placeholder":!i?.description})},i?.description&&(0,c.createElement)(m.__experimentalText,{truncate:!0,numberOfLines:"2"},i.description))))}const tx=()=>{};var nx=({value:e,onChange:t=tx,settings:n})=>{if(!n||!n.length)return null;const o=n=>o=>{t({...e,[n.id]:o})},r=n.map((t=>(0,c.createElement)(m.CheckboxControl,{__nextHasNoMarginBottom:!0,className:"block-editor-link-control__setting",key:t.id,label:t.title,onChange:o(t),checked:!!e&&!!e[t.id]})));return(0,c.createElement)("fieldset",{className:"block-editor-link-control__settings"},(0,c.createElement)(m.VisuallyHidden,{as:"legend"},(0,v.__)("Currently selected link settings")),r)};const ox=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}}};const rx=()=>{};function lx({searchInputPlaceholder:e,value:t,settings:n=zC,onChange:o=rx,onRemove:r,onCancel:l,noDirectEntry:i=!1,showSuggestions:a=!0,showInitialSuggestions:s,forceIsEditingLink:u,createSuggestion:p,withCreateSuggestion:f,inputValue:g="",suggestionsQuery:h={},noURLSuggestion:b=!1,createSuggestionButtonText:_,hasRichPreviews:k=!1,hasTextControl:y=!1,renderControlBottom:E=null}){void 0===f&&p&&(f=!0);const w=(0,c.useRef)(!0),S=(0,c.useRef)(),C=(0,c.useRef)(),x=(0,c.useRef)(!1),B=n.map((({id:e})=>e)),[I,T]=(0,c.useState)(!1),[M,P,N,L,R]=function(e){const[t,n]=(0,c.useState)(e||{});return(0,c.useEffect)((()=>{n((t=>e&&e!==t?e:t))}),[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),A=t&&!(0,Sy.isShallowEqualObjects)(M,t),[D,O]=(0,c.useState)(void 0!==u?u:!t||!t.url),{createPage:z,isCreatingPage:V,errorMessage:F}=function(e){const t=(0,c.useRef)(),[n,o]=(0,c.useState)(!1),[r,l]=(0,c.useState)(null);return(0,c.useEffect)((()=>()=>{t.current&&t.current.cancel()}),[]),{createPage:async function(n){o(!0),l(null);try{return t.current=ox(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw l(e.message||(0,v.__)("An unknown error occurred during creation. Please try again.")),e}finally{o(!1)}},isCreatingPage:n,errorMessage:r}}(p);(0,c.useEffect)((()=>{void 0!==u&&u!==D&&O(u)}),[u]),(0,c.useEffect)((()=>{if(w.current)return void(w.current=!1);(ta.focus.focusable.find(S.current)[0]||S.current).focus(),x.current=!1}),[D,V]);const H=t?.url?.trim()?.length>0,G=()=>{x.current=!!S.current?.contains(S.current.ownerDocument.activeElement),T(!1),O(!1)},U=()=>{A&&o({...t,...M,url:$}),G()},$=g||M?.url||"",j=!$?.trim()?.length,W=r&&t&&!D&&!V,K=!!n?.length&&D&&H,q=D&&H,Z=H&&y,Y=(D||!t)&&!V,X=!A||j;return(0,c.createElement)("div",{tabIndex:-1,ref:S,className:"block-editor-link-control"},V&&(0,c.createElement)("div",{className:"block-editor-link-control__loading"},(0,c.createElement)(m.Spinner,null)," ",(0,v.__)("Creating"),"…"),Y&&(0,c.createElement)(c.Fragment,null,(0,c.createElement)("div",{className:d()({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":Z})},Z&&(0,c.createElement)(m.TextControl,{__nextHasNoMarginBottom:!0,ref:C,className:"block-editor-link-control__field block-editor-link-control__text-content",label:(0,v.__)("Text"),value:M?.title,onChange:L,onKeyDown:e=>{const{keyCode:t}=e;t!==Ed.ENTER||j||(e.preventDefault(),U())},size:"__unstable-large"}),(0,c.createElement)(KC,{currentLink:t,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:e,value:$,withCreateSuggestion:f,onCreateSuggestion:z,onChange:N,onSelect:e=>{const t=Object.keys(e).reduce(((t,n)=>(B.includes(n)||(t[n]=e[n]),t)),{});o({...M,...t,title:M?.title||e?.title}),G()},showInitialSuggestions:s,allowDirectEntry:!i,showSuggestions:a,suggestionsQuery:h,withURLSuggestion:!b,createSuggestionButtonText:_,hideLabelFromVision:!Z})),F&&(0,c.createElement)(m.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1},F)),t&&!D&&!V&&(0,c.createElement)(ex,{key:t?.url,value:t,onEditClick:()=>O(!0),hasRichPreviews:k,hasUnlinkControl:W,onRemove:r}),K&&(0,c.createElement)("div",{className:"block-editor-link-control__tools"},!j&&(0,c.createElement)(_C,{settingsOpen:I,setSettingsOpen:T},(0,c.createElement)(nx,{value:M,settings:n,onChange:R(B)}))),q&&(0,c.createElement)("div",{className:"block-editor-link-control__search-actions"},(0,c.createElement)(m.Button,{variant:"primary",onClick:X?rx:U,className:"block-editor-link-control__search-submit","aria-disabled":X},(0,v.__)("Save")),(0,c.createElement)(m.Button,{variant:"tertiary",onClick:e=>{e.preventDefault(),e.stopPropagation(),P(t),H?G():r?.(),l?.()}},(0,v.__)("Cancel"))),E&&E())}lx.ViewerFill=XC;var ix=lx;var ax=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"m7 6.5 4 2.5-4 2.5z"}),(0,c.createElement)(F.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"}));var sx=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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"}));var cx=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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"}));const ux=()=>{};let dx=0;var px=(0,p.compose)([(0,f.withDispatch)((e=>{const{createNotice:t,removeNotice:n}=e(Fm.store);return{createNotice:t,removeNotice:n}})),(0,m.withFilters)("editor.MediaReplaceFlow")])((({mediaURL:e,mediaId:t,mediaIds:n,allowedTypes:o,accept:r,onError:l,onSelect:i,onSelectURL:a,onToggleFeaturedImage:s,useFeaturedImage:u,onFilesUpload:p=ux,name:g=(0,v.__)("Replace"),createNotice:h,removeNotice:b,children:_,multiple:k=!1,addToGallery:y,handleUpload:E=!0,popoverProps:w})=>{const S=(0,f.useSelect)((e=>e($o).getSettings().mediaUpload),[]),C=!!S,x=(0,c.useRef)(),B="block-editor/media-replace-flow/error-notice/"+ ++dx,I=e=>{const t=(0,ta.__unstableStripHTML)(e);l?l(t):setTimeout((()=>{h("error",t,{speak:!0,id:B,isDismissible:!0})}),1e3)},T=(e,t)=>{u&&s&&s(),t(),i(e),(0,Mn.speak)((0,v.__)("The media file has been replaced")),b(B)},M=e=>{e.keyCode===Ed.DOWN&&(e.preventDefault(),e.target.click())},P=k&&!(!o||0===o.length)&&o.every((e=>"image"===e||e.startsWith("image/")));return(0,c.createElement)(m.Dropdown,{popoverProps:w,contentClassName:"block-editor-media-replace-flow__options",renderToggle:({isOpen:e,onToggle:t})=>(0,c.createElement)(m.ToolbarButton,{ref:x,"aria-expanded":e,"aria-haspopup":"true",onClick:t,onKeyDown:M},g),renderContent:({onClose:l})=>(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu"},(0,c.createElement)(Zf,null,(0,c.createElement)(Yf,{gallery:P,addToGallery:y,multiple:k,value:k?n:t,onSelect:e=>T(e,l),allowedTypes:o,render:({open:e})=>(0,c.createElement)(m.MenuItem,{icon:ax,onClick:e},(0,v.__)("Open Media Library"))}),(0,c.createElement)(m.FormFileUpload,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!E)return t(),i(n);p(n),S({allowedTypes:o,filesList:n,onFileChange:([e])=>{T(e,t)},onError:I})})(e,l)},accept:r,multiple:k,render:({openFileDialog:e})=>(0,c.createElement)(m.MenuItem,{icon:sx,onClick:()=>{e()}},(0,v.__)("Upload"))})),s&&(0,c.createElement)(m.MenuItem,{icon:cx,onClick:s,isPressed:u},(0,v.__)("Use featured image")),_),a&&(0,c.createElement)("form",{className:d()("block-editor-media-flow__url-input",{"has-siblings":C||s})},(0,c.createElement)("span",{className:"block-editor-media-replace-flow__image-url-label"},(0,v.__)("Current media URL:")),(0,c.createElement)(m.Tooltip,{text:e,position:"bottom"},(0,c.createElement)("div",null,(0,c.createElement)(ix,{value:{url:e},settings:[],showSuggestions:!1,onChange:({url:e})=>{a(e),x.current.focus()}})))))})}));var mx=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,c.createElement)(F.Path,{d:"M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"}));function fx({url:e,urlLabel:t,className:n}){const o=d()(n,"block-editor-url-popover__link-viewer-url");return e?(0,c.createElement)(m.ExternalLink,{className:o,href:e},t||(0,Cf.filterURLForDisplay)((0,Cf.safeDecodeURI)(e))):(0,c.createElement)("span",{className:o})}const{__experimentalPopoverLegacyPositionToPlacement:gx}=bn(m.privateApis);function hx({additionalControls:e,children:t,renderSettings:n,placement:o,focusOnMount:r="firstElement",position:l,...i}){let a;void 0!==l&&$()("`position` prop in wp.blockEditor.URLPopover",{since:"6.2",alternative:"`placement` prop"}),void 0!==o?a=o:void 0!==l&&(a=gx(l)),a=a||"bottom";const[s,u]=(0,c.useState)(!1),d=!!n&&s;return(0,c.createElement)(m.Popover,{className:"block-editor-url-popover",focusOnMount:r,placement:a,shift:!0,...i},(0,c.createElement)("div",{className:"block-editor-url-popover__input-container"},(0,c.createElement)("div",{className:"block-editor-url-popover__row"},t,!!n&&(0,c.createElement)(m.Button,{className:"block-editor-url-popover__settings-toggle",icon:Fg,label:(0,v.__)("Link settings"),onClick:()=>{u(!s)},"aria-expanded":s})),d&&(0,c.createElement)("div",{className:"block-editor-url-popover__row block-editor-url-popover__settings"},n())),e&&!d&&(0,c.createElement)("div",{className:"block-editor-url-popover__additional-controls"},e))}hx.LinkEditor=function({autocompleteRef:e,className:t,onChangeInputValue:n,value:o,...r}){return(0,c.createElement)("form",{className:d()("block-editor-url-popover__link-editor",t),...r},(0,c.createElement)(SC,{__nextHasNoMarginBottom:!0,value:o,onChange:n,autocompleteRef:e}),(0,c.createElement)(m.Button,{icon:mx,label:(0,v.__)("Apply"),type:"submit"}))},hx.LinkViewer=function({className:e,linkClassName:t,onEditLinkClick:n,url:o,urlLabel:r,...l}){return(0,c.createElement)("div",{className:d()("block-editor-url-popover__link-viewer",e),...l},(0,c.createElement)(fx,{url:o,urlLabel:r,className:t}),n&&(0,c.createElement)(m.Button,{icon:ZC,label:(0,v.__)("Edit"),onClick:n}))};var bx=hx;const vx=()=>{},_x=({src:e,onChange:t,onSubmit:n,onClose:o,popoverAnchor:r})=>(0,c.createElement)(bx,{anchor:r,onClose:o},(0,c.createElement)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:n},(0,c.createElement)("input",{className:"block-editor-media-placeholder__url-input-field",type:"text","aria-label":(0,v.__)("URL"),placeholder:(0,v.__)("Paste or type URL"),onChange:t,value:e}),(0,c.createElement)(m.Button,{className:"block-editor-media-placeholder__url-input-submit-button",icon:mx,label:(0,v.__)("Apply"),type:"submit"}))),kx=({isURLInputVisible:e,src:t,onChangeSrc:n,onSubmitSrc:o,openURLInput:r,closeURLInput:l})=>{const[i,a]=(0,c.useState)(null);return(0,c.createElement)("div",{className:"block-editor-media-placeholder__url-input-container",ref:a},(0,c.createElement)(m.Button,{className:"block-editor-media-placeholder__button",onClick:r,isPressed:e,variant:"tertiary"},(0,v.__)("Insert from URL")),e&&(0,c.createElement)(_x,{src:t,onChange:n,onSubmit:o,onClose:l,popoverAnchor:i}))};var yx=(0,m.withFilters)("editor.MediaPlaceholder")((function({value:e={},allowedTypes:t,className:n,icon:o,labels:r={},mediaPreview:l,notices:i,isAppender:s,accept:u,addToGallery:p,multiple:g=!1,handleUpload:h=!0,disableDropZone:b,disableMediaButtons:_,onError:k,onSelect:y,onCancel:E,onSelectURL:w,onToggleFeaturedImage:S,onDoubleClick:C,onFilesPreUpload:x=vx,onHTMLDrop:B,children:I,mediaLibraryButton:T,placeholder:M,style:P}){B&&$()("wp.blockEditor.MediaPlaceholder onHTMLDrop prop",{since:"6.2",version:"6.4"});const N=(0,f.useSelect)((e=>{const{getSettings:t}=e($o);return t().mediaUpload}),[]),[L,R]=(0,c.useState)(""),[A,D]=(0,c.useState)(!1);(0,c.useEffect)((()=>{var t;R(null!==(t=e?.src)&&void 0!==t?t:"")}),[e?.src]);const O=e=>{R(e.target.value)},z=()=>{D(!0)},V=()=>{D(!1)},F=e=>{e.preventDefault(),L&&w&&(w(L),V())},H=n=>{if(!h)return y(n);let o;if(x(n),g)if(p){let t=[];o=n=>{const o=(null!=e?e:[]).filter((e=>e.id?!t.some((({id:t})=>Number(t)===Number(e.id))):!t.some((({urlSlug:t})=>e.url.includes(t)))));y(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=y;else o=([e])=>y(e);N({allowedTypes:t,filesList:n,onFileChange:o,onError:k})};async function G(e){const n=(0,a.pasteHandler)({HTML:e});return await async function(e){if(!e||!Array.isArray(e))return;const n=function e(t){return t.flatMap((t=>"core/image"!==t.name&&"core/audio"!==t.name&&"core/video"!==t.name||!t.attributes.url?e(t.innerBlocks):[t]))}(e);if(!n.length)return;const o=await Promise.all(n.map((e=>e.attributes.id?e.attributes:new Promise(((n,o)=>{window.fetch(e.attributes.url).then((e=>e.blob())).then((r=>N({filesList:[r],additionalData:{title:e.attributes.title,alt_text:e.attributes.alt,caption:e.attributes.caption},onFileChange:([e])=>{e.id&&n(e)},allowedTypes:t,onError:o}))).catch((()=>n(e.attributes.url)))}))))).catch((e=>k(e)));y(g?o:o[0])}(n)}const U=e=>{H(e.target.files)},j=null!=M?M:e=>{let{instructions:a,title:u}=r;if(N||w||(a=(0,v.__)("To edit this block, you need permission to upload media.")),void 0===a||void 0===u){const e=null!=t?t:[],[n]=e,o=1===e.length,r=o&&"audio"===n,l=o&&"image"===n,i=o&&"video"===n;void 0===a&&N&&(a=(0,v.__)("Upload a media file or pick one from your media library."),r?a=(0,v.__)("Upload an audio file, pick one from your media library, or add one with a URL."):l?a=(0,v.__)("Upload an image file, pick one from your media library, or add one with a URL."):i&&(a=(0,v.__)("Upload a video file, pick one from your media library, or add one with a URL."))),void 0===u&&(u=(0,v.__)("Media"),r?u=(0,v.__)("Audio"):l?u=(0,v.__)("Image"):i&&(u=(0,v.__)("Video")))}const p=d()("block-editor-media-placeholder",n,{"is-appender":s});return(0,c.createElement)(m.Placeholder,{icon:o,label:u,instructions:a,className:p,notices:i,onDoubleClick:C,preview:l,style:P},e,I)},W=()=>b?null:(0,c.createElement)(m.DropZone,{onFilesDrop:H,onHTMLDrop:G}),K=()=>E&&(0,c.createElement)(m.Button,{className:"block-editor-media-placeholder__cancel-button",title:(0,v.__)("Cancel"),variant:"link",onClick:E},(0,v.__)("Cancel")),q=()=>w&&(0,c.createElement)(kx,{isURLInputVisible:A,src:L,onChangeSrc:O,onSubmitSrc:F,openURLInput:z,closeURLInput:V}),Z=()=>S&&(0,c.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,c.createElement)(m.Button,{className:"block-editor-media-placeholder__button",onClick:S,variant:"tertiary"},(0,v.__)("Use featured image")));return _?(0,c.createElement)(Zf,null,W()):(0,c.createElement)(Zf,{fallback:j(q())},(()=>{const n=null!=T?T:({open:e})=>(0,c.createElement)(m.Button,{variant:"tertiary",onClick:()=>{e()}},(0,v.__)("Media Library")),o=(0,c.createElement)(Yf,{addToGallery:p,gallery:g&&!(!t||0===t.length)&&t.every((e=>"image"===e||e.startsWith("image/"))),multiple:g,onSelect:y,allowedTypes:t,mode:"browse",value:Array.isArray(e)?e.map((({id:e})=>e)):e.id,render:n});if(N&&s)return(0,c.createElement)(c.Fragment,null,W(),(0,c.createElement)(m.FormFileUpload,{onChange:U,accept:u,multiple:g,render:({openFileDialog:e})=>{const t=(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.Button,{variant:"primary",className:d()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:e},(0,v.__)("Upload")),o,q(),Z(),K());return j(t)}}));if(N){const e=(0,c.createElement)(c.Fragment,null,W(),(0,c.createElement)(m.FormFileUpload,{variant:"primary",className:d()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:U,accept:u,multiple:g},(0,v.__)("Upload")),o,q(),Z(),K());return j(e)}return j(o)})())}));var Ex=({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,c.createElement)(zS,{settings:n,gradients:[],disableCustomGradients:!0,...t})};const wx={placement:"bottom-start"};var Sx=()=>(0,c.createElement)(c.Fragment,null,["bold","italic","link","unknown"].map((e=>(0,c.createElement)(m.Slot,{name:`RichText.ToolbarControls.${e}`,key:e}))),(0,c.createElement)(m.Slot,{name:"RichText.ToolbarControls"},(e=>{if(!e.length)return null;const t=e.map((([{props:e}])=>e)).some((({isActive:e})=>e));return(0,c.createElement)(m.ToolbarItem,null,(n=>(0,c.createElement)(m.DropdownMenu,{icon:Fg,label:(0,v.__)("More"),toggleProps:{...n,className:d()(n.className,{"is-pressed":t}),describedBy:(0,v.__)("Displays more block tools")},controls:K(e.map((([{props:e}])=>e)),"title"),popoverProps:wx})))})));function Cx({editableContentElement:e,activeFormats:t}){const n=t[t.length-1],o=n?.type,r=(0,f.useSelect)((e=>e(G.store).getFormatType(o)),[o]),l=(0,G.useAnchor)({editableContentElement:e,settings:r});return(0,c.createElement)(xx,{popoverAnchor:l})}function xx({popoverAnchor:e}){return(0,c.createElement)(m.Popover,{placement:"top",focusOnMount:!1,anchor:e,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar"},(0,c.createElement)(eh,{className:"block-editor-rich-text__inline-format-toolbar-group","aria-label":(0,v.__)("Format tools")},(0,c.createElement)(m.ToolbarGroup,null,(0,c.createElement)(Sx,null))))}var Bx=({inline:e,editableContentElement:t,value:n})=>{const o=(0,f.useSelect)((e=>e($o).getSettings().hasInlineToolbar),[]);if(e)return(0,c.createElement)(xx,{popoverAnchor:t});if(o){const e=(0,G.getActiveFormats)(n);return(0,G.isCollapsed)(n)&&!e.length?null:(0,c.createElement)(Cx,{editableContentElement:t,activeFormats:e})}return(0,c.createElement)(nr,{group:"inline"},(0,c.createElement)(Sx,null))};function Ix(){const{didAutomaticChange:e,getSettings:t}=(0,f.useSelect)($o);return(0,p.useRefEffect)((n=>{function o(n){const{keyCode:o}=n;if(n.defaultPrevented)return;if(o!==Ed.DELETE&&o!==Ed.BACKSPACE&&o!==Ed.ESCAPE)return;const{__experimentalUndo:r}=t();r&&e()&&(n.preventDefault(),r())}return n.addEventListener("keydown",o),()=>{n.removeEventListener("keydown",o)}}),[])}var Tx=window.wp.shortcode;function Mx(e,t){if(t?.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}function Px(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function Nx({allowedFormats:e,disableFormats:t}){return t?Nx.EMPTY_ARRAY:e}Nx.EMPTY_ARRAY=[];const Lx=e=>(0,Tx.regexp)(".*").test(e);function Rx({value:e,pastedBlocks:t=[],onReplace:n,onSplit:o,onSplitMiddle:r,multilineTag:l}){if(!n||!o)return;const{start:i=0,end:a=0}=e,s={...e,start:i,end:a},c=[],[u,d]=(0,G.split)(s),p=t.length>0;let m=-1;const f=(0,G.isEmpty)(u)&&!(0,G.isEmpty)(d);p&&(0,G.isEmpty)(u)||(c.push(o((0,G.toHTMLString)({value:u,multilineTag:l}),!f)),m+=1),p?(c.push(...t),m+=t.length):r&&c.push(r()),(p||r)&&(0,G.isEmpty)(d)||c.push(o((0,G.toHTMLString)({value:d,multilineTag:l}),f));n(c,p?m:1,p?-1:0)}function Ax(e,t){return t?(0,G.replace)(e,/\n+/g,G.__UNSTABLE_LINE_SEPARATOR):(0,G.replace)(e,new RegExp(G.__UNSTABLE_LINE_SEPARATOR,"g"),"\n")}function Dx(e){const t=(0,c.useRef)(e);return t.current=e,(0,p.useRefEffect)((e=>{function n(e){const{isSelected:n,disableFormats:o,onChange:r,value:l,formatTypes:i,tagName:s,onReplace:c,onSplit:u,onSplitMiddle:d,__unstableEmbedURLOnPaste:p,multilineTag:m,preserveWhiteSpace:f,pastePlainText:g}=t.current;if(!n)return;const{clipboardData:h}=e;let b="",v="";try{b=h.getData("text/plain"),v=h.getData("text/html")}catch(e){try{v=h.getData("Text")}catch(e){return}}if(v=function(e){const t="\x3c!--StartFragment--\x3e",n=e.indexOf(t);if(!(n>-1))return e;e=e.substring(n+t.length);const o="\x3c!--EndFragment--\x3e",r=e.indexOf(o);r>-1&&(e=e.substring(0,r));return e}(v),v=function(e){const t="<meta charset='utf-8'>";if(e.startsWith(t))return e.slice(t.length);return e}(v),e.preventDefault(),window.console.log("Received HTML:\n\n",v),window.console.log("Received plain text:\n\n",b),o)return void r((0,G.insert)(l,b));const _=i.reduce(((e,{__unstablePasteRule:t})=>(t&&e===l&&(e=t(l,{html:v,plainText:b})),e)),l);if(_!==l)return void r(_);const k=[...(0,ta.getFilesFromDataTransfer)(h)];if("true"===h.getData("rich-text")){const e=h.getData("rich-text-multi-line-tag")||void 0;let t=(0,G.create)({html:v,multilineTag:e,multilineWrapperTags:"li"===e?["ul","ol"]:void 0,preserveWhiteSpace:f});return t=Ax(t,!!m),Mx(t,l.activeFormats),void r((0,G.insert)(l,t))}if(g)return void r((0,G.insert)(l,(0,G.create)({text:b})));if(k?.length&&window.console.log("Received items:\n\n",k),k?.length&&!Oh(k,v)){const e=(0,a.getBlockTransforms)("from"),t=k.reduce(((t,n)=>{const o=(0,a.findTransform)(e,(e=>"files"===e.type&&e.isMatch([n])));return o&&t.push(o.transform([n])),t}),[]).flat();if(!t.length)return;return void(c&&(0,G.isEmpty)(l)?c(t):Rx({value:l,pastedBlocks:t,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}let y=c&&u?"AUTO":"INLINE";"AUTO"===y&&(0,G.isEmpty)(l)&&Lx(b)&&(y="BLOCKS"),p&&(0,G.isEmpty)(l)&&(0,Cf.isURL)(b.trim())&&(y="BLOCKS");const E=(0,a.pasteHandler)({HTML:v,plainText:b,mode:y,tagName:s,preserveWhiteSpace:f});if("string"==typeof E){let e=(0,G.create)({html:E});e=Ax(e,!!m),Mx(e,l.activeFormats),r((0,G.insert)(l,e))}else E.length>0&&(c&&(0,G.isEmpty)(l)?c(E,E.length-1,-1):Rx({value:l,pastedBlocks:E,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}return e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}}),[])}const Ox=["`",'"',"'","“”",""];function zx(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,f.useDispatch)($o),o=(0,c.useRef)(e);return o.current=e,(0,p.useRefEffect)((e=>{function r(r){const{inputType:l,data:i}=r,{value:a,onChange:c}=o.current;if("insertText"!==l)return;if((0,G.isCollapsed)(a))return;const u=(0,s.applyFilters)("blockEditor.wrapSelectionSettings",Ox).find((([e,t])=>e===i||t===i));if(!u)return;const[d,p=d]=u,m=a.start,f=a.end+d.length;let g=(0,G.insert)(a,d,m,m);g=(0,G.insert)(g,p,f,f),t(),c(g),n();const h={};for(const e in r)h[e]=r[e];h.data=p;const{ownerDocument:b}=e,{defaultView:v}=b,_=new v.InputEvent("input",h);window.queueMicrotask((()=>{r.target.dispatchEvent(_)})),r.preventDefault()}return e.addEventListener("beforeinput",r),()=>{e.removeEventListener("beforeinput",r)}}),[])}function Vx(e){let t=e.length;for(;t--;){const n=Nn(e[t].attributes);if(n)return e[t].attributes[n]=e[t].attributes[n].replace(Pn,""),[e[t].clientId,n,0,0];const o=Vx(e[t].innerBlocks);if(o)return o}return[]}function Fx(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,f.useDispatch)($o),o=(0,c.useRef)(e);return o.current=e,(0,p.useRefEffect)((e=>{function r(){const{getValue:e,onReplace:t,selectionChange:r}=o.current;if(!t)return;const l=e(),{start:i,text:s}=l;if(" "!==s.slice(i-1,i))return;const c=s.slice(0,i).trim(),u=(0,a.getBlockTransforms)("from").filter((({type:e})=>"prefix"===e)),d=(0,a.findTransform)(u,(({prefix:e})=>c===e));if(!d)return;const p=(0,G.toHTMLString)({value:(0,G.insert)(l,Pn,0,i)}),m=d.transform(p);return r(...Vx([m])),t([m]),n(),!0}function l(e){const{inputType:l,type:i}=e,{getValue:a,onChange:s,__unstableAllowPrefixTransformations:c,formatTypes:u}=o.current;if("insertText"!==l&&"compositionend"!==i)return;if(c&&r&&r())return;const d=a(),p=u.reduce(((e,{__unstableInputRule:t})=>(t&&(e=t(e)),e)),function(e){const t="tales of gutenberg",{start:n,text:o}=e;return n<18||o.slice(n-18,n).toLowerCase()!==t?e:(0,G.insert)(e," 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️")}(d));p!==d&&(t(),s({...p,activeFormats:d.activeFormats}),n())}return e.addEventListener("input",l),e.addEventListener("compositionend",l),()=>{e.removeEventListener("input",l),e.removeEventListener("compositionend",l)}}),[])}function Hx(e){const t=(0,c.useRef)(e);return t.current=e,(0,p.useRefEffect)((e=>{function n(e){const{keyCode:n}=e;if(e.defaultPrevented)return;const{value:o,onMerge:r,onRemove:l}=t.current;if(n===Ed.DELETE||n===Ed.BACKSPACE){const{start:t,end:i,text:a}=o,s=n===Ed.BACKSPACE,c=o.activeFormats&&!!o.activeFormats.length;if(!(0,G.isCollapsed)(o)||c||s&&0!==t||!s&&i!==a.length)return;r&&r(!s),l&&(0,G.isEmpty)(o)&&s&&l(!s),e.preventDefault()}}return e.addEventListener("keydown",n),()=>{e.removeEventListener("keydown",n)}}),[])}function Gx(e){const{__unstableMarkAutomaticChange:t}=(0,f.useDispatch)($o),n=(0,c.useRef)(e);return n.current=e,(0,p.useRefEffect)((e=>{function o(e){if(e.defaultPrevented)return;if(e.keyCode!==Ed.ENTER)return;const{removeEditorOnlyFormats:o,value:r,onReplace:l,onSplit:i,onSplitMiddle:s,multilineTag:c,onChange:u,disableLineBreaks:d,onSplitAtEnd:p}=n.current;e.preventDefault();const m={...r};m.formats=o(r);const f=l&&i;if(l){const e=(0,a.getBlockTransforms)("from").filter((({type:e})=>"enter"===e)),n=(0,a.findTransform)(e,(e=>e.regExp.test(m.text)));n&&(l([n.transform({content:m.text})]),t())}if(c)e.shiftKey?d||u((0,G.insert)(m,"\n")):f&&(0,G.__unstableIsEmptyLine)(m)?Rx({value:m,onReplace:l,onSplit:i,onSplitMiddle:s,multilineTag:c}):u((0,G.__unstableInsertLineSeparator)(m));else{const{text:t,start:n,end:o}=m,r=p&&n===o&&o===t.length;e.shiftKey||!f&&!r?d||u((0,G.insert)(m,"\n")):!f&&r?p():f&&Rx({value:m,onReplace:l,onSplit:i,onSplitMiddle:s,multilineTag:c})}}return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o)}}),[])}function Ux(e){return e(G.store).getFormatTypes()}const $x=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function jx(e,t){return"object"!=typeof e?{[t]:e}:Object.fromEntries(Object.entries(e).map((([e,n])=>[`${t}.${e}`,n])))}function Wx(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)),{})}function Kx(e){return(0,p.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}}),[])}function qx(e){return(0,p.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("input",n),()=>{t.removeEventListener("input",n)}}),[])}function Zx(){const{__unstableMarkLastChangeAsPersistent:e}=(0,f.useDispatch)($o);return(0,p.useRefEffect)((t=>{function n(t){"insertReplacementText"===t.inputType&&e()}return t.addEventListener("beforeinput",n),()=>{t.removeEventListener("beforeinput",n)}}),[])}function Yx(e){const t=(0,c.useRef)(e);t.current=e;const{isMultiSelecting:n}=(0,f.useSelect)($o);return(0,p.useRefEffect)((e=>{function o(){if(!n())return;const t=e.parentElement.closest('[contenteditable="true"]');t&&t.focus()}function r(n){if(n.keyCode!==Ed.SPACE)return;if(null===e.closest("button, summary"))return;const{value:o,onChange:r}=t.current;r((0,G.insert)(o," ")),n.preventDefault()}return e.addEventListener("focus",o),e.addEventListener("keydown",r),()=>{e.removeEventListener("focus",o),e.removeEventListener("keydown",r)}}),[])}function Xx({formatTypes:e,onChange:t,onFocus:n,value:o,forwardedRef:r}){return e.map((e=>{const{name:l,edit:i}=e;if(!i)return null;const a=(0,G.getActiveFormat)(o,l),s=void 0!==a,u=(0,G.getActiveObject)(o),d=void 0!==u&&u.type===l;return(0,c.createElement)(i,{key:l,isActive:s,activeAttributes:s&&a.attributes||{},isObjectActive:d,activeObjectAttributes:d&&u.attributes||{},value:o,onChange:t,onFocus:n,contentRef:r})}))}const Qx=({value:e,tagName:t,multiline:n,...o})=>{Array.isArray(e)&&($()("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/"}),e=a.children.toHTML(e));const r=Px(n);!e&&r&&(e=`<${r}></${r}>`);const l=(0,c.createElement)(c.RawHTML,null,e);if(t){const{format:e,...n}=o;return(0,c.createElement)(t,{...n},l)}return l},Jx=(0,c.createContext)(),eB=(0,c.createContext)();const tB=(0,c.forwardRef)((function e({children:t,tagName:n="div",value:o="",onChange:r,isSelected:l,multiline:i,inlineToolbar:s,wrapperClassName:u,autocompleters:g,onReplace:h,placeholder:b,allowedFormats:v,withoutInteractiveFormatting:_,onRemove:k,onMerge:y,onSplit:E,__unstableOnSplitAtEnd:w,__unstableOnSplitMiddle:S,identifier:C,preserveWhiteSpace:x,__unstablePastePlainText:B,__unstableEmbedURLOnPaste:I,__unstableDisableFormats:T,disableLineBreaks:M,__unstableAllowPrefixTransformations:P,...N},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 R=(0,p.useInstanceId)(e);C=C||R,N=function(e){const{__unstableMobileNoFocusOnMount:t,deleteEnter:n,placeholderTextColor:o,textAlign:r,selectionColor:l,tagsToEliminate:i,disableEditingMenu:a,fontSize:s,fontFamily:c,fontWeight:u,fontStyle:d,minWidth:p,maxWidth:m,setRef:f,disableSuggestions:g,disableAutocorrection:h,...b}=e;return b}(N);const A=(0,c.useRef)(),{clientId:D}=Zo(),{selectionStart:O,selectionEnd:z,isSelected:V}=(0,f.useSelect)((e=>{const{getSelectionStart:t,getSelectionEnd:n}=e($o),o=t(),r=n();let i;return void 0===l?i=o.clientId===D&&r.clientId===D&&o.attributeKey===C:l&&(i=o.clientId===D),{selectionStart:i?o.offset:void 0,selectionEnd:i?r.offset:void 0,isSelected:i}})),{getSelectionStart:F,getSelectionEnd:H,getBlockRootClientId:U}=(0,f.useSelect)($o),{selectionChange:j}=(0,f.useDispatch)($o),W=Px(i),K=Nx({allowedFormats:v,disableFormats:T}),q=!K||K.length>0;let Z=o,Y=r;Array.isArray(o)&&($()("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/"}),Z=a.children.toHTML(o),Y=e=>r(a.children.fromDOM((0,G.__unstableCreateElement)(document,e).childNodes)));const X=(0,c.useCallback)(((e,t)=>{const n={},o=void 0===e&&void 0===t;if("number"==typeof e||o){if(void 0===t&&U(D)!==U(H().clientId))return;n.start={clientId:D,attributeKey:C,offset:e}}if("number"==typeof t||o){if(void 0===e&&U(D)!==U(F().clientId))return;n.end={clientId:D,attributeKey:C,offset:t}}j(n)}),[D,C]),{formatTypes:Q,prepareHandlers:J,valueHandlers:ee,changeHandlers:te,dependencies:ne}=function({clientId:e,identifier:t,withoutInteractiveFormatting:n,allowedFormats:o}){const r=(0,f.useSelect)(Ux,[]),l=(0,c.useMemo)((()=>r.filter((({name:e,tagName:t})=>!(o&&!o.includes(e)||n&&$x.has(t))))),[r,o,$x]),i=(0,f.useSelect)((n=>l.reduce(((o,r)=>r.__experimentalGetPropsForEditableTreePreparation?{...o,...jx(r.__experimentalGetPropsForEditableTreePreparation(n,{richTextIdentifier:t,blockClientId:e}),r.name)}:o),{})),[l,e,t]),a=(0,f.useDispatch)(),s=[],u=[],d=[],p=[];for(const e in i)p.push(i[e]);return l.forEach((n=>{if(n.__experimentalCreatePrepareEditableTree){const o=n.__experimentalCreatePrepareEditableTree(Wx(i,n.name),{richTextIdentifier:t,blockClientId:e});n.__experimentalCreateOnChangeEditableValue?u.push(o):s.push(o)}if(n.__experimentalCreateOnChangeEditableValue){let o={};n.__experimentalGetPropsForEditableTreeChangeHandler&&(o=n.__experimentalGetPropsForEditableTreeChangeHandler(a,{richTextIdentifier:t,blockClientId:e}));const r=Wx(i,n.name);d.push(n.__experimentalCreateOnChangeEditableValue({..."object"==typeof r?r:{},...o},{richTextIdentifier:t,blockClientId:e}))}})),{formatTypes:l,prepareHandlers:s,valueHandlers:u,changeHandlers:d,dependencies:p}}({clientId:D,identifier:C,withoutInteractiveFormatting:_,allowedFormats:K});function oe(e){return Q.forEach((t=>{t.__experimentalCreatePrepareEditableTree&&(e=(0,G.removeFormat)(e,t.name,0,e.text.length))})),e.formats}const{value:re,getValue:le,onChange:ie,ref:ae}=(0,G.__unstableUseRichText)({value:Z,onChange(e,{__unstableFormats:t,__unstableText:n}){Y(e),Object.values(te).forEach((e=>{e(t,n)}))},selectionStart:O,selectionEnd:z,onSelectionChange:X,placeholder:b,__unstableIsSelected:V,__unstableMultilineTag:W,__unstableDisableFormats:T,preserveWhiteSpace:x,__unstableDependencies:[...ne,n],__unstableAfterParse:function(e){return ee.reduce(((t,n)=>n(t,e.text)),e.formats)},__unstableBeforeSerialize:oe,__unstableAddInvisibleFormats:function(e){return J.reduce(((t,n)=>n(t,e.text)),e.formats)}}),se=function(e){return(0,m.__unstableUseAutocompleteProps)({...e,completers:uw(e)})}({onReplace:h,completers:g,record:re,onChange:ie});!function({html:e,value:t}){const n=(0,c.useRef)(),o=t.activeFormats&&!!t.activeFormats.length,{__unstableMarkLastChangeAsPersistent:r}=(0,f.useDispatch)($o);(0,c.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:Z,value:re});const ce=(0,c.useRef)(new Set),ue=(0,c.useRef)(new Set);function de(){A.current?.focus()}const pe=n;return(0,c.createElement)(c.Fragment,null,V&&(0,c.createElement)(Jx.Provider,{value:ce},(0,c.createElement)(eB.Provider,{value:ue},(0,c.createElement)(m.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after"},t&&t({value:re,onChange:ie,onFocus:de}),(0,c.createElement)(Xx,{value:re,onChange:ie,onFocus:de,formatTypes:Q,forwardedRef:A})))),V&&q&&(0,c.createElement)(Bx,{inline:s,editableContentElement:A.current,value:re}),(0,c.createElement)(pe,{role:"textbox","aria-multiline":!M,"aria-label":b,...N,...se,ref:(0,p.useMergeRefs)([L,se.ref,N.ref,ae,zx({value:re,onChange:ie}),Fx({getValue:le,onChange:ie,__unstableAllowPrefixTransformations:P,formatTypes:Q,onReplace:h,selectionChange:j}),Zx(),(0,p.useRefEffect)((e=>{function t(e){(Ed.isKeyboardEvent.primary(e,"z")||Ed.isKeyboardEvent.primary(e,"y")||Ed.isKeyboardEvent.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.addEventListener("keydown",t)}}),[]),Kx(ce),qx(ue),Ix(),Dx({isSelected:V,disableFormats:T,onChange:ie,value:re,formatTypes:Q,tagName:n,onReplace:h,onSplit:E,onSplitMiddle:S,__unstableEmbedURLOnPaste:I,multilineTag:W,preserveWhiteSpace:x,pastePlainText:B}),Hx({value:re,onMerge:y,onRemove:k}),Gx({removeEditorOnlyFormats:oe,value:re,onReplace:h,onSplit:E,onSplitMiddle:S,multilineTag:W,onChange:ie,disableLineBreaks:M,onSplitAtEnd:w}),Yx({value:re,onChange:ie}),A]),contentEditable:!0,suppressContentEditableWarning:!0,className:d()("block-editor-rich-text__editable",N.className,"rich-text")}))}));tB.Content=Qx,tB.isEmpty=e=>!e||0===e.length;var nB=tB;const oB=(0,c.forwardRef)(((e,t)=>(0,c.createElement)(nB,{ref:t,...e,__unstableDisableFormats:!0,preserveWhiteSpace:!0})));oB.Content=({value:e="",tagName:t="div",...n})=>(0,c.createElement)(t,{...n},e);var rB=oB;var lB=(0,c.forwardRef)((({__experimentalVersion:e,...t},n)=>{if(2===e)return(0,c.createElement)(rB,{ref:n,...t});const{className:o,onChange:r,...l}=t;return(0,c.createElement)(ka.Z,{ref:n,className:d()("block-editor-plain-text",o),onChange:e=>r(e.target.value),...l})}));function iB({property:e,viewport:t,desc:n}){const o=(0,p.useInstanceId)(iB),r=n||(0,v.sprintf)((0,v._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,c.createElement)(c.Fragment,null,(0,c.createElement)("span",{"aria-describedby":`rbc-desc-${o}`},t.label),(0,c.createElement)(m.VisuallyHidden,{as:"span",id:`rbc-desc-${o}`},r))}var aB=function(e){const{title:t,property:n,toggleLabel:o,onIsResponsiveChange:r,renderDefaultControl:l,renderResponsiveControls:i,isResponsive:a=!1,defaultLabel:s={id:"all",label:(0,v.__)("All")},viewports:u=[{id:"small",label:(0,v.__)("Small screens")},{id:"medium",label:(0,v.__)("Medium screens")},{id:"large",label:(0,v.__)("Large screens")}]}=e;if(!t||!n||!l)return null;const p=o||(0,v.sprintf)((0,v.__)("Use the same %s on all screensizes."),n),f=(0,v.__)("Toggle between using the same value for all screen sizes or using a unique value per screen size."),g=l((0,c.createElement)(iB,{property:n,viewport:s}),s);return(0,c.createElement)("fieldset",{className:"block-editor-responsive-block-control"},(0,c.createElement)("legend",{className:"block-editor-responsive-block-control__title"},t),(0,c.createElement)("div",{className:"block-editor-responsive-block-control__inner"},(0,c.createElement)(m.ToggleControl,{__nextHasNoMarginBottom:!0,className:"block-editor-responsive-block-control__toggle",label:p,checked:!a,onChange:r,help:f}),(0,c.createElement)("div",{className:d()("block-editor-responsive-block-control__group",{"is-responsive":a})},!a&&g,a&&(i?i(u):u.map((e=>(0,c.createElement)(c.Fragment,{key:e.id},l((0,c.createElement)(iB,{property:n,viewport:e}),e))))))))};function sB({character:e,type:t,onUse:n}){const o=(0,c.useContext)(Jx),r=(0,c.useRef)();return r.current=n,(0,c.useEffect)((()=>{function n(n){Ed.isKeyboardEvent[t](n,e)&&(r.current(),n.preventDefault())}return o.current.add(n),()=>{o.current.delete(n)}}),[e,t]),null}function cB({name:e,shortcutType:t,shortcutCharacter:n,...o}){let r,l="RichText.ToolbarControls";return e&&(l+=`.${e}`),t&&n&&(r=Ed.displayShortcut[t](n)),(0,c.createElement)(m.Fill,{name:l},(0,c.createElement)(m.ToolbarButton,{...o,shortcut:r}))}function uB({inputType:e,onInput:t}){const n=(0,c.useContext)(eB),o=(0,c.useRef)();return o.current=t,(0,c.useEffect)((()=>{function t(t){t.inputType===e&&(o.current(),t.preventDefault())}return n.current.add(t),()=>{n.current.delete(t)}}),[e]),null}const dB=(0,c.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,c.createElement)(m.Path,{d:"M9.4 20.5L5.2 3.8l14.6 9-2 .3c-.2 0-.4.1-.7.1-.9.2-1.6.3-2.2.5-.8.3-1.4.5-1.8.8-.4.3-.8.8-1.3 1.5-.4.5-.8 1.2-1.2 2l-.3.6-.9 1.9zM7.6 7.1l2.4 9.3c.2-.4.5-.8.7-1.1.6-.8 1.1-1.4 1.6-1.8.5-.4 1.3-.8 2.2-1.1l1.2-.3-8.1-5z"}));var pB=(0,c.forwardRef)((function(e,t){const n=(0,f.useSelect)((e=>e($o).__unstableGetEditorMode()),[]),{__unstableSetEditorMode:o}=(0,f.useDispatch)($o);return(0,c.createElement)(m.Dropdown,{renderToggle:({isOpen:o,onToggle:r})=>(0,c.createElement)(m.Button,{...e,ref:t,icon:"navigation"===n?dB:ZC,"aria-expanded":o,"aria-haspopup":"true",onClick:r,label:(0,v.__)("Tools")}),popoverProps:{placement:"bottom-start"},renderContent:()=>(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.NavigableMenu,{role:"menu","aria-label":(0,v.__)("Tools")},(0,c.createElement)(m.MenuItemsChoice,{value:"navigation"===n?"navigation":"edit",onSelect:o,choices:[{value:"edit",label:(0,c.createElement)(c.Fragment,null,(0,c.createElement)(Ql,{icon:ZC}),(0,v.__)("Edit"))},{value:"navigation",label:(0,c.createElement)(c.Fragment,null,dB,(0,v.__)("Select"))}]})),(0,c.createElement)("div",{className:"block-editor-tool-selector__help"},(0,v.__)("Tools provide different interactions for selecting, navigating, and editing blocks. Toggle between select and edit by pressing Escape and Enter.")))})}));function mB({units:e,...t}){const n=(0,m.__experimentalUseCustomUnits)({availableUnits:Qr("spacing.units")||["%","px","em","rem","vw"],units:e});return(0,c.createElement)(m.__experimentalUnitControl,{units:n,...t})}var fB=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"}));class gB extends c.Component{constructor(){super(...arguments),this.toggle=this.toggle.bind(this),this.submitLink=this.submitLink.bind(this),this.state={expanded:!1}}toggle(){this.setState({expanded:!this.state.expanded})}submitLink(e){e.preventDefault(),this.toggle()}render(){const{url:e,onChange:t}=this.props,{expanded:n}=this.state,o=e?(0,v.__)("Edit link"):(0,v.__)("Insert link");return(0,c.createElement)("div",{className:"block-editor-url-input__button"},(0,c.createElement)(m.Button,{icon:zv,label:o,onClick:this.toggle,className:"components-toolbar__control",isPressed:!!e}),n&&(0,c.createElement)("form",{className:"block-editor-url-input__button-modal",onSubmit:this.submitLink},(0,c.createElement)("div",{className:"block-editor-url-input__button-modal-line"},(0,c.createElement)(m.Button,{className:"block-editor-url-input__back",icon:fB,label:(0,v.__)("Close"),onClick:this.toggle}),(0,c.createElement)(SC,{__nextHasNoMarginBottom:!0,value:e||"",onChange:t}),(0,c.createElement)(m.Button,{icon:mx,label:(0,v.__)("Submit"),type:"submit"}))))}}var hB=gB;const bB="none",vB="custom",_B="media",kB="attachment",yB=["noreferrer","noopener"],EB=(0,c.createElement)(m.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(m.Path,{d:"M0,0h24v24H0V0z",fill:"none"}),(0,c.createElement)(m.Path,{d:"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z"}),(0,c.createElement)(m.Path,{d:"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z"})),wB=({linkDestination:e,onChangeUrl:t,url:n,mediaType:o="image",mediaUrl:r,mediaLink:l,linkTarget:i,linkClass:a,rel:s})=>{const[u,d]=(0,c.useState)(!1),[p,f]=(0,c.useState)(null),[g,h]=(0,c.useState)(!1),[b,_]=(0,c.useState)(null),k=(0,c.useRef)(null),y=()=>{h(!1)},E=()=>{const e=[{linkDestination:_B,title:(0,v.__)("Media File"),url:"image"===o?r:void 0,icon:EB}];return"image"===o&&l&&e.push({linkDestination:kB,title:(0,v.__)("Attachment Page"),url:"image"===o?l:void 0,icon:(0,c.createElement)(m.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(m.Path,{d:"M0 0h24v24H0V0z",fill:"none"}),(0,c.createElement)(m.Path,{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z"}))}),e},w=(0,c.createElement)(m.__experimentalVStack,{spacing:"3"},(0,c.createElement)(m.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,v.__)("Open in new tab"),onChange:e=>{const n=(e=>{const t=e?"_blank":void 0;let n;if(t){const e=(null!=s?s:"").split(" ");yB.forEach((t=>{e.includes(t)||e.push(t)})),n=e.join(" ")}else{const e=(null!=s?s:"").split(" ").filter((e=>!1===yB.includes(e)));n=e.length?e.join(" "):void 0}return{linkTarget:t,rel:n}})(e);t(n)},checked:"_blank"===i}),(0,c.createElement)(m.TextControl,{__nextHasNoMarginBottom:!0,label:(0,v.__)("Link rel"),value:null!=s?s:"",onChange:e=>{t({rel:e})}}),(0,c.createElement)(m.TextControl,{__nextHasNoMarginBottom:!0,label:(0,v.__)("Link CSS Class"),value:a||"",onChange:e=>{t({linkClass:e})}})),S=null!==b?b:n,C=(E().find((t=>t.linkDestination===e))||{}).title;return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.ToolbarButton,{icon:zv,className:"components-toolbar__control",label:n?(0,v.__)("Edit link"):(0,v.__)("Insert link"),"aria-expanded":u,onClick:()=>{d(!0)},ref:f}),u&&(0,c.createElement)(bx,{anchor:p,onFocusOutside:e=>{const t=k.current;t&&t.contains(e.target)||(d(!1),_(null),y())},onClose:()=>{_(null),y(),d(!1)},renderSettings:()=>w,additionalControls:!S&&(0,c.createElement)(m.NavigableMenu,null,E().map((e=>(0,c.createElement)(m.MenuItem,{key:e.linkDestination,icon:e.icon,onClick:()=>{_(null),(e=>{const n=E();let o;o=e?(n.find((t=>t.url===e))||{linkDestination:vB}).linkDestination:bB,t({linkDestination:o,href:e})})(e.url),y()}},e.title))))},(!n||g)&&(0,c.createElement)(bx.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:S,onChangeInputValue:_,onSubmit:e=>{if(b){const e=E().find((e=>e.url===b))?.linkDestination||vB;t({href:b,linkDestination:e})}y(),_(null),e.preventDefault()},autocompleteRef:k}),n&&!g&&(0,c.createElement)(c.Fragment,null,(0,c.createElement)(bx.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:n,onEditLinkClick:()=>{e!==_B&&e!==kB||_(""),h(!0)},urlLabel:C}),(0,c.createElement)(m.Button,{icon:xf,label:(0,v.__)("Remove link"),onClick:()=>{t({linkDestination:bB,href:""})}}))))};var SB=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M15 4H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h6c.3 0 .5.2.5.5v12zm-4.5-.5h2V16h-2v1.5z"}));var CB=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M17 4H7c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v12zm-7.5-.5h4V16h-4v1.5z"}));var xB=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M20.5 16h-.7V8c0-1.1-.9-2-2-2H6.2c-1.1 0-2 .9-2 2v8h-.7c-.8 0-1.5.7-1.5 1.5h20c0-.8-.7-1.5-1.5-1.5zM5.7 8c0-.3.2-.5.5-.5h11.6c.3 0 .5.2.5.5v7.6H5.7V8z"}));function BB({children:e,viewLabel:t,className:n,isEnabled:o=!0,deviceType:r,setDeviceType:l,label:i}){if((0,p.useViewportMatch)("small","<"))return null;const a={className:d()(n,"block-editor-post-preview__dropdown-content"),placement:"bottom-end"},s={className:"block-editor-post-preview__button-toggle",disabled:!o,children:t},u={"aria-label":(0,v.__)("View options")},f={mobile:SB,tablet:CB,desktop:xB};return(0,c.createElement)(m.DropdownMenu,{className:"block-editor-post-preview__dropdown",popoverProps:a,toggleProps:s,menuProps:u,icon:f[r.toLowerCase()],label:i||(0,v.__)("Preview")},(()=>(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.MenuGroup,null,(0,c.createElement)(m.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Desktop"),icon:"Desktop"===r&&hh},(0,v.__)("Desktop")),(0,c.createElement)(m.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Tablet"),icon:"Tablet"===r&&hh},(0,v.__)("Tablet")),(0,c.createElement)(m.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Mobile"),icon:"Mobile"===r&&hh},(0,v.__)("Mobile"))),e)))}function IB(e){const[t,n]=(0,c.useState)(window.innerWidth);(0,c.useEffect)((()=>{if("Desktop"===e)return;const t=()=>n(window.innerWidth);return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}}),[e]);const o=e=>{let n;switch(e){case"Tablet":n=780;break;case"Mobile":n=360;break;default:return null}return n<t?n:t};return(e=>{const t="Mobile"===e?"768px":"1024px",n=(window.innerHeight<800?36:72)+"px",r="auto";switch(e){case"Tablet":case"Mobile":return{width:o(e),marginTop:n,marginBottom:n,marginLeft:r,marginRight:r,height:t,borderRadius:"2px 2px 2px 2px",border:"1px solid #ddd",overflowY:"auto"};default:return null}})(e)}var TB=(0,f.withSelect)((e=>({selectedBlockClientId:e($o).getBlockSelectionStart()})))((({selectedBlockClientId:e})=>{const t=Id(e);return e?(0,c.createElement)(m.Button,{variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{t.current.focus()}},(0,v.__)("Skip to the selected block")):null})),MB=window.wp.wordcount;var PB=(0,f.withSelect)((e=>{const{getMultiSelectedBlocks:t}=e($o);return{blocks:t()}}))((function({blocks:e}){const t=(0,MB.count)((0,a.serialize)(e),"words");return(0,c.createElement)("div",{className:"block-editor-multi-selection-inspector__card"},(0,c.createElement)(jd,{icon:sh,showColors:!0}),(0,c.createElement)("div",{className:"block-editor-multi-selection-inspector__card-content"},(0,c.createElement)("div",{className:"block-editor-multi-selection-inspector__card-title"},(0,v.sprintf)((0,v._n)("%d Block","%d Blocks",e.length),e.length)),(0,c.createElement)("div",{className:"block-editor-multi-selection-inspector__card-description"},(0,v.sprintf)((0,v._n)("%d word selected.","%d words selected.",t),t))))}));function NB({blockName:e}){const{preferredStyle:t,onUpdatePreferredStyleVariations:n,styles:o}=(0,f.useSelect)((t=>{var n;const o=t($o).getSettings().__experimentalPreferredStyleVariations;return{preferredStyle:o?.value?.[e],onUpdatePreferredStyleVariations:null!==(n=o?.onChange)&&void 0!==n?n:null,styles:t(a.store).getBlockStyles(e)}}),[e]),r=(0,c.useMemo)((()=>[{label:(0,v.__)("Not set"),value:""},...o.map((({label:e,name:t})=>({label:e,value:t})))]),[o]),l=(0,c.useMemo)((()=>kh(o)?.name),[o]),i=(0,c.useCallback)((t=>{n(e,t)}),[e,n]);return t&&t!==l?n&&(0,c.createElement)("div",{className:"default-style-picker__default-switcher"},(0,c.createElement)(m.SelectControl,{__nextHasNoMarginBottom:!0,options:r,value:t||"",label:(0,v.__)("Default Style"),onChange:i})):null}var LB=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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"}));var RB=(0,c.createElement)(F.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(F.Path,{d:"M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z"}));const AB={name:"settings",title:(0,v.__)("Settings"),value:"settings",icon:LB,className:"block-editor-block-inspector__tab-item"},DB={name:"styles",title:(0,v.__)("Styles"),value:"styles",icon:RB,className:"block-editor-block-inspector__tab-item"},OB={name:"list",title:(0,v.__)("List View"),value:"list-view",icon:Ew,className:"block-editor-block-inspector__tab-item"};var zB=()=>{const e=(0,m.__experimentalUseSlotFills)(qi.slotName);return Boolean(e&&e.length)?(0,c.createElement)(m.PanelBody,{className:"block-editor-block-inspector__advanced",title:(0,v.__)("Advanced"),initialOpen:!1},(0,c.createElement)(Zi.Slot,{group:"advanced"})):null};const VB=()=>{const[e,t]=(0,c.useState)(),{multiSelectedBlocks:n}=(0,f.useSelect)((e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:n}=e($o);return{multiSelectedBlocks:t(n())}}),[]);return(0,c.useLayoutEffect)((()=>{void 0===e&&t(n.some((({attributes:e})=>!!e?.style?.position?.type)))}),[e,n,t]),(0,c.createElement)(m.PanelBody,{className:"block-editor-block-inspector__position",title:(0,v.__)("Position"),initialOpen:null!=e&&e},(0,c.createElement)(Zi.Slot,{group:"position"}))};var FB=()=>{const e=(0,m.__experimentalUseSlotFills)(Hi.position.Slot.__unstableName);return Boolean(e&&e.length)?(0,c.createElement)(VB,null):null};const HB="isInspectorControlsTabsHintVisible";function GB(){const e=(0,f.useSelect)((e=>{var t;return null===(t=e(Bf.store).get("core",HB))||void 0===t||t}),[]),t=(0,c.useRef)(),{set:n}=(0,f.useDispatch)(Bf.store);return e?(0,c.createElement)("div",{ref:t,className:"block-editor-inspector-controls-tabs__hint"},(0,c.createElement)("div",{className:"block-editor-inspector-controls-tabs__hint-content"},(0,v.__)("Looking for other block settings? They've moved to the styles tab.")),(0,c.createElement)(m.Button,{className:"block-editor-inspector-controls-tabs__hint-dismiss",icon:xf,iconSize:"16",label:(0,v.__)("Dismiss hint"),onClick:()=>{const e=ta.focus.tabbable.findPrevious(t.current);e?.focus(),n("core",HB,!1)},showTooltip:!1})):null}var UB=({showAdvancedControls:e=!1})=>(0,c.createElement)(c.Fragment,null,(0,c.createElement)(Zi.Slot,null),(0,c.createElement)(FB,null),e&&(0,c.createElement)("div",null,(0,c.createElement)(zB,null)),(0,c.createElement)(GB,null));var $B=({blockName:e,clientId:t,hasBlockStyles:n})=>(0,c.createElement)(c.Fragment,null,n&&(0,c.createElement)("div",null,(0,c.createElement)(m.PanelBody,{title:(0,v.__)("Styles")},(0,c.createElement)(nS,{clientId:t}),(0,a.hasBlockSupport)(e,"defaultStylePicker",!0)&&(0,c.createElement)(NB,{blockName:e}))),(0,c.createElement)(Zi.Slot,{group:"color",label:(0,v.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,c.createElement)(Zi.Slot,{group:"filter"}),(0,c.createElement)(Zi.Slot,{group:"typography",label:(0,v.__)("Typography")}),(0,c.createElement)(Zi.Slot,{group:"dimensions",label:(0,v.__)("Dimensions")}),(0,c.createElement)(Zi.Slot,{group:"border",label:(0,v.__)("Border")}),(0,c.createElement)(Zi.Slot,{group:"styles"}));const jB=["core/navigation"];var WB=e=>!jB.includes(e);function KB({blockName:e,clientId:t,hasBlockStyles:n,tabs:o}){const r=WB(e)?void 0:OB.name;return(0,c.createElement)(m.TabPanel,{className:"block-editor-block-inspector__tabs",tabs:o,initialTabName:r,key:t},(o=>o.name===AB.name?(0,c.createElement)(UB,{showAdvancedControls:!!e}):o.name===DB.name?(0,c.createElement)($B,{blockName:e,clientId:t,hasBlockStyles:n}):o.name===OB.name?(0,c.createElement)(Zi.Slot,{group:"list"}):void 0))}const qB=[];function ZB(e){const t=[],{border:n,color:o,default:r,dimensions:l,list:i,position:a,styles:s,typography:c}=Hi,u=WB(e),d=(0,m.__experimentalUseSlotFills)(i.Slot.__unstableName),p=!u&&!!d&&d.length,g=[...(0,m.__experimentalUseSlotFills)(n.Slot.__unstableName)||[],...(0,m.__experimentalUseSlotFills)(o.Slot.__unstableName)||[],...(0,m.__experimentalUseSlotFills)(l.Slot.__unstableName)||[],...(0,m.__experimentalUseSlotFills)(s.Slot.__unstableName)||[],...(0,m.__experimentalUseSlotFills)(c.Slot.__unstableName)||[]].length,h=(0,m.__experimentalUseSlotFills)(qi.slotName)||[],b=[...(0,m.__experimentalUseSlotFills)(r.Slot.__unstableName)||[],...(0,m.__experimentalUseSlotFills)(a.Slot.__unstableName)||[],...p&&g>1?h:[]];p&&t.push(OB),b.length&&t.push(AB),g&&t.push(DB);const v=function(e,t={}){return void 0!==t[e]?t[e]:void 0===t.default||t.default}(e,(0,f.useSelect)((e=>e($o).getSettings().blockInspectorTabs),[]));return v?t:qB}const{createPrivateSlotFill:YB}=bn(m.privateApis),{Fill:XB,Slot:QB}=YB("BlockInformation"),JB=e=>Yo()?(0,c.createElement)(XB,{...e}):null;JB.Slot=e=>(0,c.createElement)(QB,{...e});var eI=JB;function tI({clientIds:e}){return e.length?(0,c.createElement)(m.__experimentalVStack,{spacing:1},e.map((e=>(0,c.createElement)(nI,{key:e,clientId:e})))):null}function nI({clientId:e}){const{name:t,icon:n,isSelected:o}=(0,f.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o,isBlockSelected:r,hasSelectedInnerBlock:l}=t($o),{getBlockType:i}=t(a.store),s=i(n(e)),c=o(e);return{name:s&&(0,a.__experimentalGetBlockLabel)(s,c,"list-view"),icon:s?.icon,isSelected:r(e)||l(e,!0)}}),[e]),{selectBlock:r}=(0,f.useDispatch)($o);return(0,c.createElement)(m.Button,{isPressed:o,onClick:()=>r(e)},(0,c.createElement)(m.__experimentalHStack,{justify:"flex-start"},(0,c.createElement)(jd,{icon:n}),(0,c.createElement)(m.FlexItem,null,t)))}function oI({topLevelLockedBlock:e}){const t=(0,f.useSelect)((t=>{const{getClientIdsOfDescendants:n,getBlockName:o,getBlockEditingMode:r}=bn(t($o));return n([e]).filter((e=>"core/list-item"!==o(e)&&"contentOnly"===r(e)))}),[e]),n=Ag(e);return(0,c.createElement)("div",{className:"block-editor-block-inspector"},(0,c.createElement)(Wd,{...n,className:n.isSynced&&"is-synced"}),(0,c.createElement)(wS,{blockClientId:e}),(0,c.createElement)(eI.Slot,null),(0,c.createElement)(m.PanelBody,{title:(0,v.__)("Content")},(0,c.createElement)(tI,{clientIds:t})))}const rI=({animate:e,wrapper:t,children:n})=>e?t(n):n,lI=({blockInspectorAnimationSettings:e,selectedBlockClientId:t,children:n})=>{const o=e&&"leftToRight"===e.enterDirection?-50:50;return(0,c.createElement)(m.__unstableMotion.div,{animate:{x:0,opacity:1,transition:{ease:"easeInOut",duration:.14}},initial:{x:o,opacity:0},key:t},n)},iI=({clientId:e,blockName:t})=>{const n=ZB(t),o=n?.length>1,r=(0,f.useSelect)((e=>{const{getBlockStyles:n}=e(a.store),o=n(t);return o&&o.length>0}),[t]),l=Ag(e);return(0,c.createElement)("div",{className:"block-editor-block-inspector"},(0,c.createElement)(Wd,{...l,className:l.isSynced&&"is-synced"}),(0,c.createElement)(wS,{blockClientId:e}),(0,c.createElement)(eI.Slot,null),o&&(0,c.createElement)(KB,{hasBlockStyles:r,clientId:e,blockName:t,tabs:n}),!o&&(0,c.createElement)(c.Fragment,null,r&&(0,c.createElement)("div",null,(0,c.createElement)(m.PanelBody,{title:(0,v.__)("Styles")},(0,c.createElement)(nS,{clientId:e}),(0,a.hasBlockSupport)(t,"defaultStylePicker",!0)&&(0,c.createElement)(NB,{blockName:t}))),(0,c.createElement)(Zi.Slot,null),(0,c.createElement)(Zi.Slot,{group:"list"}),(0,c.createElement)(Zi.Slot,{group:"color",label:(0,v.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,c.createElement)(Zi.Slot,{group:"typography",label:(0,v.__)("Typography")}),(0,c.createElement)(Zi.Slot,{group:"dimensions",label:(0,v.__)("Dimensions")}),(0,c.createElement)(Zi.Slot,{group:"border",label:(0,v.__)("Border")}),(0,c.createElement)(Zi.Slot,{group:"styles"}),(0,c.createElement)(FB,null),(0,c.createElement)("div",null,(0,c.createElement)(zB,null))),(0,c.createElement)(TB,{key:"back"}))};var aI=({showNoBlockSelectedMessage:e=!0})=>{const{count:t,selectedBlockName:n,selectedBlockClientId:o,blockType:r,topLevelLockedBlock:l}=(0,f.useSelect)((e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:o,__unstableGetContentLockingParent:r,getTemplateLock:l}=e($o),i=t(),s=i&&o(i),c=s&&(0,a.getBlockType)(s);return{count:n(),selectedBlockClientId:i,selectedBlockName:s,blockType:c,topLevelLockedBlock:r(i)||("contentOnly"===l(i)?i:void 0)}}),[]),i=ZB(r?.name),s=i?.length>1,u=function(e,t){return(0,f.useSelect)((t=>{if(e){const n=t($o).getSettings().blockInspectorAnimation,o=n?.animationParent,{getSelectedBlockClientId:r,getBlockParentsByBlockName:l}=t($o);return l(r(),o,!0)[0]||e.name===o?n?.[e.name]:null}return null}),[t,e])}(r,o);if(t>1)return(0,c.createElement)("div",{className:"block-editor-block-inspector"},(0,c.createElement)(PB,null),s?(0,c.createElement)(KB,{tabs:i}):(0,c.createElement)(c.Fragment,null,(0,c.createElement)(Zi.Slot,null),(0,c.createElement)(Zi.Slot,{group:"color",label:(0,v.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,c.createElement)(Zi.Slot,{group:"typography",label:(0,v.__)("Typography")}),(0,c.createElement)(Zi.Slot,{group:"dimensions",label:(0,v.__)("Dimensions")}),(0,c.createElement)(Zi.Slot,{group:"border",label:(0,v.__)("Border")}),(0,c.createElement)(Zi.Slot,{group:"styles"})));const d=n===(0,a.getUnregisteredTypeHandlerName)();return r&&o&&!d?l?(0,c.createElement)(oI,{topLevelLockedBlock:l}):(0,c.createElement)(rI,{animate:u,wrapper:e=>(0,c.createElement)(lI,{blockInspectorAnimationSettings:u,selectedBlockClientId:o},e)},(0,c.createElement)(iI,{clientId:o,blockName:r.name})):e?(0,c.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},(0,v.__)("No block selected.")):null};var sI=function({__unstableContentRef:e}){const[t,n]=(0,c.useState)(!1),o=(0,f.useSelect)((e=>e($o).getBlockOrder()),[]);return(0,c.useEffect)((()=>{const e=setTimeout((()=>{n(!0)}),500);return()=>{clearTimeout(e)}}),[]),t?o.map(((t,n)=>n===o.length-1?null:(0,c.createElement)(Sg,{key:t,previousClientId:t,nextClientId:o[n+1],__unstableContentRef:e},(0,c.createElement)("div",{className:"block-editor-block-list__insertion-point-inserter is-with-inserter"},(0,c.createElement)(gg,{position:"bottom center",clientId:o[n+1],__experimentalIsQuick:!0}))))):null};function cI(e){const{__unstableGetEditorMode:t,getSettings:n,isTyping:o}=e($o);return{isZoomOutMode:"zoom-out"===t(),hasFixedToolbar:n().hasFixedToolbar,isTyping:o()}}function uI({children:e,__unstableContentRef:t,...n}){const o=(0,p.useViewportMatch)("medium"),{hasFixedToolbar:r,isZoomOutMode:l,isTyping:i}=(0,f.useSelect)(cI,[]),a=(0,rp.__unstableUseShortcutEventMatch)(),{getSelectedBlockClientIds:s,getBlockRootClientId:u}=(0,f.useSelect)($o),{duplicateBlocks:d,removeBlocks:g,insertAfterBlock:h,insertBeforeBlock:b,clearSelectedBlock:v,selectBlock:_,moveBlocksUp:k,moveBlocksDown:y}=(0,f.useDispatch)($o);const E=Eg(t),w=Eg(t);return(0,c.createElement)("div",{...n,onKeyDown:function(e){if(!e.defaultPrevented)if(a("core/block-editor/move-up",e)){const t=s();if(t.length){e.preventDefault();const n=u(t[0]);k(t,n)}}else if(a("core/block-editor/move-down",e)){const t=s();if(t.length){e.preventDefault();const n=u(t[0]);y(t,n)}}else if(a("core/block-editor/duplicate",e)){const t=s();t.length&&(e.preventDefault(),d(t))}else if(a("core/block-editor/remove",e)){const t=s();t.length&&(e.preventDefault(),g(t))}else if(a("core/block-editor/insert-after",e)){const t=s();t.length&&(e.preventDefault(),h(t[t.length-1]))}else if(a("core/block-editor/insert-before",e)){const t=s();t.length&&(e.preventDefault(),b(t[0]))}else if(a("core/block-editor/unselect",e)){const n=s();n.length&&(e.preventDefault(),n.length>1?_(n[0]):v(),e.target.ownerDocument.defaultView.getSelection().removeAllRanges(),t?.current.focus())}}},(0,c.createElement)(Tg.Provider,{value:(0,c.useRef)(!1)},!i&&(0,c.createElement)(Pg,{__unstableContentRef:t}),!l&&(r||!o)&&(0,c.createElement)(Rb,{isFixed:!0}),(0,c.createElement)(nv,{__unstableContentRef:t}),(0,c.createElement)(m.Popover.Slot,{name:"block-toolbar",ref:E}),e,(0,c.createElement)(m.Popover.Slot,{name:"__unstable-block-tools-after",ref:w}),l&&(0,c.createElement)(sI,{__unstableContentRef:t})))}const dI=()=>{};var pI=(0,c.forwardRef)((function({rootClientId:e,clientId:t,isAppender:n,showInserterHelpPanel:o,showMostUsedBlocks:r=!1,__experimentalInsertionIndex:l,__experimentalFilterValue:i,onSelect:a=dI,shouldFocusBlock:s=!1},u){const{destinationRootClientId:d,prioritizePatterns:p}=(0,f.useSelect)((n=>{const{getBlockRootClientId:o,getSettings:r}=n($o),l=e||o(t)||void 0;return{destinationRootClientId:l,prioritizePatterns:r().__experimentalPreferPatternsOnRoot&&!l}}),[t,e]);return(0,c.createElement)(ug,{onSelect:a,rootClientId:d,clientId:t,isAppender:n,showInserterHelpPanel:o,showMostUsedBlocks:r,__experimentalInsertionIndex:l,__experimentalFilterValue:i,shouldFocusBlock:s,prioritizePatterns:p,ref:u})}));function mI(){return null}mI.Register=function(){const{registerShortcut:e}=(0,f.useDispatch)(rp.store);return(0,c.useEffect)((()=>{e({name:"core/block-editor/duplicate",category:"block",description:(0,v.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,v.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,v.__)("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,v.__)("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,v.__)("Delete selection."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:(0,v.__)("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,v.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,v.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,v.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,v.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}})}),[e]),null};var fI=mI;function gI(){return $()("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in.",since:"5.8"}),null}const hI=new Set([Ed.UP,Ed.RIGHT,Ed.DOWN,Ed.LEFT,Ed.ENTER,Ed.BACKSPACE]);function bI(){const e=(0,f.useSelect)((e=>e($o).isTyping()),[]),{stopTyping:t}=(0,f.useDispatch)($o);return(0,p.useRefEffect)((n=>{if(!e)return;const{ownerDocument:o}=n;let r,l;function i(e){const{clientX:n,clientY:o}=e;r&&l&&(r!==n||l!==o)&&t(),r=n,l=o}return o.addEventListener("mousemove",i),()=>{o.removeEventListener("mousemove",i)}}),[e,t])}function vI(){const{isTyping:e,hasInlineToolbar:t}=(0,f.useSelect)((e=>{const{isTyping:t,getSettings:n}=e($o);return{isTyping:t(),hasInlineToolbar:n().hasInlineToolbar}}),[]),{startTyping:n,stopTyping:o}=(0,f.useDispatch)($o),r=bI(),l=(0,p.useRefEffect)((r=>{const{ownerDocument:l}=r,{defaultView:i}=l,a=i.getSelection();if(e){let c;function u(e){const{target:t}=e;c=i.setTimeout((()=>{(0,ta.isTextField)(t)||o()}))}function d(e){const{keyCode:t}=e;t!==Ed.ESCAPE&&t!==Ed.TAB||o()}function p(){a.isCollapsed||o()}return r.addEventListener("focus",u),r.addEventListener("keydown",d),t||l.addEventListener("selectionchange",p),()=>{i.clearTimeout(c),r.removeEventListener("focus",u),r.removeEventListener("keydown",d),l.removeEventListener("selectionchange",p)}}function s(e){const{type:t,target:o}=e;(0,ta.isTextField)(o)&&r.contains(o)&&("keydown"!==t||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&hI.has(t)}(e))&&n()}return r.addEventListener("keypress",s),r.addEventListener("keydown",s),()=>{r.removeEventListener("keypress",s),r.removeEventListener("keydown",s)}}),[e,t,n,o]);return(0,p.useMergeRefs)([r,l])}var _I=function({children:e}){return(0,c.createElement)("div",{ref:vI()},e)};const kI=-1!==window.navigator.userAgent.indexOf("Trident"),yI=new Set([Ed.UP,Ed.DOWN,Ed.LEFT,Ed.RIGHT]),EI=.75;function wI(){const e=(0,f.useSelect)((e=>e($o).hasSelectedBlock()),[]);return(0,p.useRefEffect)((t=>{if(!e)return;const{ownerDocument:n}=t,{defaultView:o}=n;let r,l,i;function a(){r||(r=o.requestAnimationFrame((()=>{p(),r=null})))}function s(e){l&&o.cancelAnimationFrame(l),l=o.requestAnimationFrame((()=>{c(e),l=null}))}function c({keyCode:e}){if(!m())return;const r=(0,ta.computeCaretRect)(o);if(!r)return;if(!i)return void(i=r);if(yI.has(e))return void(i=r);const l=r.top-i.top;if(0===l)return;const a=(0,ta.getScrollContainer)(t);if(!a)return;const s=a===n.body||a===n.documentElement,c=s?o.scrollY:a.scrollTop,u=s?0:a.getBoundingClientRect().top,d=s?i.top/o.innerHeight:(i.top-u)/(o.innerHeight-u);if(0===c&&d<EI&&function(){const e=t.querySelectorAll('[contenteditable="true"]');return e[e.length-1]===n.activeElement}())return void(i=r);const p=s?o.innerHeight:a.clientHeight;i.top+i.height>u+p||i.top<u?i=r:s?o.scrollBy(0,l):a.scrollTop+=l}function u(){n.addEventListener("selectionchange",d)}function d(){n.removeEventListener("selectionchange",d),p()}function p(){m()&&(i=(0,ta.computeCaretRect)(o))}function m(){return t.contains(n.activeElement)&&n.activeElement.isContentEditable}return o.addEventListener("scroll",a,!0),o.addEventListener("resize",a,!0),t.addEventListener("keydown",s),t.addEventListener("keyup",c),t.addEventListener("mousedown",u),t.addEventListener("touchstart",u),()=>{o.removeEventListener("scroll",a,!0),o.removeEventListener("resize",a,!0),t.removeEventListener("keydown",s),t.removeEventListener("keyup",c),t.removeEventListener("mousedown",u),t.removeEventListener("touchstart",u),n.removeEventListener("selectionchange",d),o.cancelAnimationFrame(r),o.cancelAnimationFrame(l)}}),[e])}var SI=kI?e=>e.children:function({children:e}){return(0,c.createElement)("div",{ref:wI(),className:"block-editor__typewriter"},e)};const CI=(0,c.createContext)({});function xI({children:e,uniqueId:t,blockName:n=""}){const o=(0,c.useContext)(CI),{name:r}=Zo();n=n||r;const l=(0,c.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,c.createElement)(CI.Provider,{value:l},e)}function BI(e,t=""){const n=(0,c.useContext)(CI),{name:o}=Zo();return t=t||o,Boolean(n[t]?.has(e))}var II=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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"}));function TI({title:e,help:t,actions:n=[],onClose:o}){return(0,c.createElement)(m.__experimentalVStack,{className:"block-editor-inspector-popover-header",spacing:4},(0,c.createElement)(m.__experimentalHStack,{alignment:"center"},(0,c.createElement)(m.__experimentalHeading,{className:"block-editor-inspector-popover-header__heading",level:2,size:13},e),(0,c.createElement)(m.__experimentalSpacer,null),n.map((({label:e,icon:t,onClick:n})=>(0,c.createElement)(m.Button,{key:e,className:"block-editor-inspector-popover-header__action",label:e,icon:t,variant:!t&&"tertiary",onClick:n},!t&&e))),o&&(0,c.createElement)(m.Button,{className:"block-editor-inspector-popover-header__action",label:(0,v.__)("Close"),icon:II,onClick:o})),t&&(0,c.createElement)(m.__experimentalText,null,t))}var MI=(0,c.forwardRef)((function({onClose:e,onChange:t,...n},o){return(0,c.createElement)("div",{ref:o,className:"block-editor-publish-date-time-picker"},(0,c.createElement)(TI,{title:(0,v.__)("Publish"),actions:[{label:(0,v.__)("Now"),onClick:()=>t?.(null)}],onClose:e}),(0,c.createElement)(m.DateTimePicker,{startOfWeek:(0,BS.getSettings)().l10n.startOfWeek,onChange:t,...n}))}));const PI={button:"wp-element-button",caption:"wp-element-caption"},NI=e=>PI[e]?PI[e]:"";function LI(e,t){return Object.entries(t).every((([t,n])=>"object"==typeof n&&"object"==typeof e[t]?LI(e[t],n):e[t]===n))}const RI=(e,t)=>{if(!t||!e)return;const n=t.filter((({attributes:t})=>!(!t||!Object.keys(t).length)&&LI(e,t)));return 1===n.length?n[0]:void 0};function AI(e){const t=e?.trim().match(/^(0?[-.]?\d*\.?\d+)(r?e[m|x]|v[h|w|min|max]+|p[x|t|c]|[c|m]m|%|in|ch|Q|lh)$/);return isNaN(e)||isNaN(parseFloat(e))?t?{value:parseFloat(t[1])||t[1],unit:t[2]}:{value:e,unit:void 0}:{value:parseFloat(e),unit:"px"}}function DI(e){try{return Function(`'use strict'; return (${e})`)()}catch(e){return null}}function OI(e,t){const n=e.split(/[(),]/g).filter(Boolean),o=n.slice(1).map((e=>AI(FI(e,t)).value)).filter(Boolean);switch(n[0]){case"min":return Math.min(...o)+"px";case"max":return Math.max(...o)+"px";case"clamp":return 3!==o.length?null:o[1]<o[0]?o[0]+"px":o[1]>o[2]?o[2]+"px":o[1]+"px";case"calc":return o[0]+"px"}}function zI(e){for(;;){const t=e,n=/(max|min|calc|clamp)\(([^()]*)\)/g.exec(e)||[];if(n[0]){const t=OI(n[0]);e=e.replace(n[0],t)}if(e===t||parseFloat(e))break}return AI(e)}function VI(e){for(let t=0;t<e.length;t++)if(["+","-","/","*"].includes(e[t]))return!0;return!1}function FI(e,t={}){if(Number.isFinite(e))return e.toFixed(0)+"px";if(void 0===e)return null;let n=AI(e);return n.unit||(n=zI(e)),VI(e)&&!n.unit?function(e){let t=!1;const n=e.match(/\d+\.?\d*[a-zA-Z]+|\.\d+[a-zA-Z]+/g);if(n)for(const o of n){const n=AI(FI(o));if(!parseFloat(n.value)){t=!0;break}e=e.replace(o,n.value)}else t=!0;const o=e.match(/(max|min|clamp)/g);if(!t&&o){const t=e.split(",");for(const n of t){const t=n.replace(/\s|calc/g,"");if(VI(t)){const o=DI(t);if(o){const t=o.toFixed(0)+"px";e=e.replace(n,t)}}}const n=zI(e);return n?n.value+n.unit:null}if(t)return null;const r=DI(e);return r?r.toFixed(0)+"px":null}(e):function(e,t){const n=96,o=.01,r=Object.assign({},{fontSize:16,lineHeight:16,width:375,height:812,type:"font"},t),l={em:r.fontSize,rem:r.fontSize,vh:r.height*o,vw:r.width*o,vmin:(r.width<r.height?r.width:r.height)*o,vmax:(r.width>r.height?r.width:r.height)*o,"%":("font"===r.type?r.fontSize:r.width)*o,ch:8,ex:7.15625,lh:r.lineHeight},i={in:n,cm:37.79527559055118,mm:3.7795275590551185,pt:1.3333333333333333,pc:16,px:1,Q:.9448818897637794};return l[e.unit]?(l[e.unit]*e.value).toFixed(0)+"px":i[e.unit]?(i[e.unit]*e.value).toFixed(0)+"px":null}(n,t)}const HI={};var GI=function(e,t={}){const n=e+function(e){let t="";e.hasOwnProperty("fontSize")&&(t=":"+e.width);e.hasOwnProperty("lineHeight")&&(t=":"+e.lineHeight);e.hasOwnProperty("width")&&(t=":"+e.width);e.hasOwnProperty("height")&&(t=":"+e.height);e.hasOwnProperty("type")&&(t=":"+e.type);return t}(t);return HI[n]||(HI[n]=FI(e,t)),HI[n]};const UI={__experimentalBorder:"border",color:"color",spacing:"spacing",typography:"typography"};function $I(e){const t="var:";if(e?.startsWith?.(t)){return`var(--wp--${e.slice(4).split("|").join("--")})`}return e}function jI(e={},t,n){let o=[];return Object.keys(e).forEach((r=>{const l=t+Rl(r.replace("/","-")),i=e[r];if(i instanceof Object){const e=l+n;o=[...o,...jI(i,e,n)]}else o.push(`${l}: ${i}`)})),o}const WI=(e,t)=>{const n={};return Object.entries(e).forEach((([e,o])=>{if("root"===e||!t?.[e])return;const r="string"==typeof o;if(r||Object.entries(o).forEach((([o,r])=>{if("root"===o||!t?.[e][o])return;const l=KI({[e]:{[o]:t[e][o]}});n[r]=[...n[r]||[],...l],delete t[e][o]})),r||o.root){const l=r?o:o.root,i=KI({[e]:t[e]});n[l]=[...n[l]||[],...i],delete t[e]}})),n};function KI(e={},t="",n,o={}){const r=dl===t,l=Object.entries(a.__EXPERIMENTAL_STYLE_PROPERTY).reduce(((t,[o,{value:l,properties:i,useEngine:a,rootOnly:s}])=>{if(s&&!r)return t;const c=l;if("elements"===c[0]||a)return t;const u=(0,Kr.get)(e,c);if("--wp--style--root--padding"===o&&("string"==typeof u||!n))return t;if(i&&"string"!=typeof u)Object.entries(i).forEach((e=>{const[n,o]=e;if(!(0,Kr.get)(u,[o],!1))return;const r=n.startsWith("--")?n:Rl(n);t.push(`${r}: ${$I((0,Kr.get)(u,[o]))}`)}));else if((0,Kr.get)(e,c,!1)){const n=o.startsWith("--")?o:Rl(o);t.push(`${n}: ${$I((0,Kr.get)(e,c))}`)}return t}),[]);return(0,ti.getCSSRules)(e).forEach((e=>{if(r&&n&&e.key.startsWith("padding"))return;const t=e.key.startsWith("--")?e.key:Rl(e.key);let i=e.value;if("string"!=typeof i&&i?.ref){const e=i.ref.split(".");if(i=(0,Kr.get)(o,e),!i||i?.ref)return}"font-size"===t&&(i=sl({size:i},ul(o?.settings))),l.push(`${t}: ${i}`)})),l}function qI({layoutDefinitions:e=ur,style:t,selector:n,hasBlockGapSupport:o,hasFallbackGapSupport:r,fallbackGapValue:l}){let i="",a=o?Nr(t?.spacing?.blockGap):"";if(r&&(n===dl?a=a||"0.5em":!o&&l&&(a=l)),a&&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||a}`)})),r.length){let l="";l=o?n===dl?`:where(${n} .${e})${t?.selector||""}`:`${n}-${e}${t?.selector||""}`:n===dl?`:where(.${e}${t?.selector||""})`:`:where(${n}.${e}${t?.selector||""})`,i+=`${l} { ${r.join("; ")}; }`}}))})),n===dl&&o&&(i+=`${n} { --wp--style--block-gap: ${a}; }`)),n===dl&&e){const t=["block","flex","grid"];Object.values(e).forEach((({className:e,displayMode:o,baseStyles:r})=>{o&&t.includes(o)&&(i+=`${n} .${e} { display:${o}; }`),r?.length&&r.forEach((t=>{const o=[];if(t.rules&&Object.entries(t.rules).forEach((([e,t])=>{o.push(`${e}: ${t}`)})),o.length){i+=`${`${n} .${e}${t?.selector||""}`} { ${o.join("; ")}; }`}}))}))}return i}const ZI=["border","color","dimensions","spacing","typography","filter","outline","shadow"];function YI(e){if(!e)return{};const t=Object.entries(e).filter((([e])=>ZI.includes(e))).map((([e,t])=>[e,JSON.parse(JSON.stringify(t))]));return Object.fromEntries(t)}const XI=(e,t)=>{var n;const o=[];if(!e?.settings)return o;const r=e=>{const t={};return pl.forEach((({path:n})=>{const o=(0,Kr.get)(e,n,!1);!1!==o&&(0,Kr.set)(t,n,o)})),t},l=r(e.settings),i=e.settings?.custom;return(Object.keys(l).length>0||i)&&o.push({presets:l,custom:i,selector:dl}),Object.entries(null!==(n=e.settings?.blocks)&&void 0!==n?n:{}).forEach((([e,n])=>{const l=r(n),i=n.custom;(Object.keys(l).length>0||i)&&o.push({presets:l,custom:i,selector:t[e]?.selector})})),o},QI=(e,t)=>{const n=XI(e,t);let o="";return n.forEach((({presets:t,custom:n,selector:r})=>{const l=function(e={},t){return pl.reduce(((n,{path:o,valueKey:r,valueFunc:l,cssVarInfix:i})=>{const a=(0,Kr.get)(e,o,[]);return["default","theme","custom"].forEach((e=>{a[e]&&a[e].forEach((e=>{r&&!l?n.push(`--wp--preset--${i}--${Rl(e.slug)}: ${e[r]}`):l&&"function"==typeof l&&n.push(`--wp--preset--${i}--${Rl(e.slug)}: ${l(e,t)}`)}))})),n}),[])}(t,e?.settings),i=jI(n,"--wp--custom--","--");i.length>0&&l.push(...i),l.length>0&&(o+=`${r}{${l.join(";")};}`)})),o},JI=(e,t,n,o,r=!1)=>{const l=((e,t)=>{var n;const o=[];if(!e?.styles)return o;const r=YI(e.styles);return r&&o.push({styles:r,selector:dl}),Object.entries(a.__EXPERIMENTAL_ELEMENTS).forEach((([t,n])=>{e.styles?.elements?.[t]&&o.push({styles:e.styles?.elements?.[t],selector:n})})),Object.entries(null!==(n=e.styles?.blocks)&&void 0!==n?n:{}).forEach((([e,n])=>{var r;const l=YI(n);if(n?.variations){const e={};Object.keys(n.variations).forEach((t=>{e[t]=YI(n.variations[t])})),l.variations=e}l&&t?.[e]?.selector&&o.push({duotoneSelector:t[e].duotoneSelector,fallbackGapValue:t[e].fallbackGapValue,hasLayoutSupport:t[e].hasLayoutSupport,selector:t[e].selector,styles:l,featureSelectors:t[e].featureSelectors,styleVariationSelectors:t[e].styleVariationSelectors}),Object.entries(null!==(r=n?.elements)&&void 0!==r?r:{}).forEach((([n,r])=>{r&&t?.[e]&&a.__EXPERIMENTAL_ELEMENTS[n]&&o.push({styles:r,selector:t[e]?.selector.split(",").map((e=>a.__EXPERIMENTAL_ELEMENTS[n].split(",").map((t=>e+" "+t)))).join(",")})}))})),o})(e,t),i=XI(e,t),s=e?.settings?.useRootPaddingAwareAlignments,{contentSize:c,wideSize:u}=e?.settings?.layout||{};let d="body {margin: 0;";if(c&&(d+=` --wp--style--global--content-size: ${c};`),u&&(d+=` --wp--style--global--wide-size: ${u};`),s&&(d+="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.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t.has-global-padding :where(.has-global-padding) { padding-right: 0; padding-left: 0; }\n\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.has-global-padding :where(.has-global-padding) > .alignfull { margin-right: 0; margin-left: 0; }\n\t\t\t.has-global-padding > .alignfull:where(:not(.has-global-padding)) > :where(.wp-block:not(.alignfull),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t.has-global-padding :where(.has-global-padding) > .alignfull:where(:not(.has-global-padding)) > :where(.wp-block:not(.alignfull),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: 0; padding-left: 0;"),d+="}",l.forEach((({selector:t,duotoneSelector:l,styles:i,fallbackGapValue:a,hasLayoutSupport:c,featureSelectors:u,styleVariationSelectors:p})=>{if(u){const e=WI(u,i);Object.entries(e).forEach((([e,t])=>{if(t.length){const n=t.join(";");d+=`${e}{${n};}`}}))}if(p&&Object.entries(p).forEach((([t,n])=>{const o=i?.variations?.[t];if(o){if(u){const e=WI(u,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(";");d+=`${o}{${r};}`}}))}const t=KI(o,n,s,e);t.length&&(d+=`${n}{${t.join(";")};}`)}})),l){const e={};i?.filter&&(e.filter=i.filter,delete i.filter);const t=KI(e);t.length&&(d+=`${l}{${t.join(";")};}`)}r||dl!==t&&!c||(d+=qI({style:i,selector:t,hasBlockGapSupport:n,hasFallbackGapSupport:o,fallbackGapValue:a}));const m=KI(i,t,s,e);m?.length&&(d+=`${t}{${m.join(";")};}`);const f=Object.entries(i).filter((([e])=>e.startsWith(":")));f?.length&&f.forEach((([e,n])=>{const o=KI(n);if(!o?.length)return;const r=`${t.split(",").map((t=>t+e)).join(",")}{${o.join(";")};}`;d+=r}))})),d+=".wp-site-blocks > .alignleft { float: left; margin-right: 2em; }",d+=".wp-site-blocks > .alignright { float: right; margin-left: 2em; }",d+=".wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }",n){const t=Nr(e?.styles?.spacing?.blockGap)||"0.5em";d+=`:where(.wp-site-blocks) > * { margin-block-start: ${t}; margin-block-end: 0; }`,d+=":where(.wp-site-blocks) > :first-child:first-child { margin-block-start: 0; }",d+=":where(.wp-site-blocks) > :last-child:last-child { margin-block-end: 0; }"}return i.forEach((({selector:e,presets:t})=>{dl===e&&(e="");const n=function(e="*",t={}){return pl.reduce(((n,{path:o,cssVarInfix:r,classes:l})=>{if(!l)return n;const i=(0,Kr.get)(t,o,[]);return["default","theme","custom"].forEach((t=>{i[t]&&i[t].forEach((({slug:t})=>{l.forEach((({classSuffix:o,propertyName:l})=>{const i=`.has-${Rl(t)}-${o}`,a=e.split(",").map((e=>`${e}${i}`)).join(","),s=`var(--wp--preset--${r}--${Rl(t)})`;n+=`${a}{${l}: ${s} !important;}`}))}))})),n}),"")}(e,t);n.length>0&&(d+=n)})),d};function eT(e,t){return XI(e,t).flatMap((({presets:e})=>function(e={}){return pl.filter((e=>"duotone"===e.path.at(-1))).flatMap((t=>{const n=(0,Kr.get)(e,t.path,{});return["default","theme"].filter((e=>n[e])).flatMap((e=>n[e].map((e=>(0,c.renderToString)((0,c.createElement)(Xy,{preset:e,key:e.slug})))))).join("")}))}(e)))}const tT=(e,t)=>{const n={};return e.forEach((e=>{const o=e.name,r=Qy(e);let l=Qy(e,"filter.duotone");if(!l){const t=Qy(e),n=(0,a.getBlockSupport)(e,"color.__experimentalDuotone",!1);l=n&&hl(t,n)}const i=!!e?.supports?.layout||!!e?.supports?.__experimentalLayout,s=e?.supports?.spacing?.blockGap?.__experimentalDefault,c=t(o),u={};c?.length&&c.forEach((e=>{const t=`.is-style-${e.name}${r}`;u[e.name]=t}));const d=((e,t)=>{if(e?.selectors&&Object.keys(e.selectors).length>0)return e.selectors;const n={root:t};return Object.entries(UI).forEach((([t,o])=>{const r=Qy(e,t);r&&(n[o]=r)})),n})(e,r);n[o]={duotoneSelector:l,fallbackGapValue:s,featureSelectors:Object.keys(d).length?d:void 0,hasLayoutSupport:i,name:o,selector:r,styleVariationSelectors:Object.keys(u).length?u:void 0}})),n};const nT=(e,t)=>{let n="";return e.split("&").forEach((e=>{n+=e.includes("{")?t+e:t+"{"+e+"}"})),n};function oT(e={}){const[t]=El("spacing.blockGap"),n=null!==t,o=!n,r=(0,f.useSelect)((e=>{const{getSettings:t}=e($o);return!!t().disableLayoutStyles})),l=(0,f.useSelect)((e=>e(a.store).getBlockStyles),[]);return(0,c.useMemo)((()=>{var t;if(!e?.styles||!e?.settings)return[];e=function(e){return e.styles?.blocks?.["core/separator"]&&e.styles?.blocks?.["core/separator"].color?.background&&!e.styles?.blocks?.["core/separator"].color?.text&&!e.styles?.blocks?.["core/separator"].border?.color?{...e,styles:{...e.styles,blocks:{...e.styles.blocks,"core/separator":{...e.styles.blocks["core/separator"],color:{...e.styles.blocks["core/separator"].color,text:e.styles?.blocks["core/separator"].color.background}}}}}:e}(e);const i=tT((0,a.getBlockTypes)(),l),s=QI(e,i),c=JI(e,i,n,o,r),u=eT(e,i),d=[{css:s,isGlobalStyles:!0},{css:c,isGlobalStyles:!0},{css:null!==(t=e.styles.css)&&void 0!==t?t:"",isGlobalStyles:!0},{assets:u,__unstableType:"svg",isGlobalStyles:!0}];return(0,a.getBlockTypes)().forEach((t=>{if(e.styles.blocks[t.name]?.css){const n=i[t.name].selector;d.push({css:nT(e.styles.blocks[t.name]?.css,n),isGlobalStyles:!0})}})),[d,e.settings]}),[n,o,e,r])}function rT(){const{merged:e}=(0,c.useContext)(vl);return oT(e)}var lT=(0,c.createElement)(F.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(F.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"}));function iT(e){return aT(e)}function aT(e){return!!e?.shadow}function sT({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){return(0,c.createElement)(m.__experimentalToolsPanel,{label:(0,v.__)("Effects"),resetAll:()=>{const o=e(n);t(o)},panelId:o},r)}const cT={shadow:!0};function uT({as:e=sT,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:l,defaultControls:i=cT}){const a=aT(r),s=(u=o?.shadow,gl({settings:r},"",u));var u;const d=e=>{n(Dl(t,["shadow"],e))},p=(0,c.useCallback)((e=>({...e,shadow:void 0})),[]);return(0,c.createElement)(e,{resetAllFilter:p,value:t,onChange:n,panelId:l},a&&(0,c.createElement)(m.__experimentalToolsPanelItem,{label:(0,v.__)("Shadow"),hasValue:()=>!!t?.shadow,onDeselect:()=>d(void 0),isShownByDefault:i.shadow,panelId:l},(0,c.createElement)(m.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,c.createElement)(dT,{shadow:s,onShadowChange:d,settings:r}))))}const dT=({shadow:e,onShadowChange:t,settings:n})=>(0,c.createElement)(m.Dropdown,{popoverProps:{placement:"left-start",offset:36,shift:!0},className:"block-editor-global-styles-effects-panel__shadow-dropdown",renderToggle:({onToggle:e,isOpen:t})=>{const n={onClick:e,className:d()({"is-open":t}),"aria-expanded":t};return(0,c.createElement)(m.Button,{...n},(0,c.createElement)(m.__experimentalHStack,{justify:"flex-start"},(0,c.createElement)(Ql,{className:"block-editor-global-styles-effects-panel__toggle-icon",icon:lT,size:24}),(0,c.createElement)(m.FlexItem,null,(0,v.__)("Shadow"))))},renderContent:()=>(0,c.createElement)(m.__experimentalDropdownContentWrapper,{paddingSize:"medium"},(0,c.createElement)(pT,{shadow:e,onShadowChange:t,settings:n}))});function pT({shadow:e,onShadowChange:t,settings:n}){const o=n?.shadow?.presets?.default,r=n?.shadow?.presets?.theme,l=n?.shadow?.defaultPresets,i=[...l?o:[],...r||[]];return(0,c.createElement)("div",{className:"block-editor-global-styles-effects-panel__shadow-popover-container"},(0,c.createElement)(m.__experimentalVStack,{spacing:4},(0,c.createElement)(m.__experimentalHeading,{level:5},(0,v.__)("Shadow")),(0,c.createElement)(mT,{presets:i,activeShadow:e,onSelect:t})))}function mT({presets:e,activeShadow:t,onSelect:n}){return e?(0,c.createElement)(m.__experimentalGrid,{columns:6,gap:0,align:"center",justify:"center"},e.map((({name:e,slug:o,shadow:r})=>(0,c.createElement)(fT,{key:o,label:e,isActive:r===t,onSelect:()=>n(r===t?void 0:r),shadow:r})))):null}function fT({label:e,isActive:t,onSelect:n,shadow:o}){return(0,c.createElement)("div",{className:"block-editor-global-styles-effects-panel__shadow-indicator-wrapper"},(0,c.createElement)(m.Button,{className:"block-editor-global-styles-effects-panel__shadow-indicator",onClick:n,label:e,style:{boxShadow:o},showTooltip:!0},t&&(0,c.createElement)(Ql,{icon:hh})))}function gT({value:e,onChange:t,inheritedValue:n=e}){const[o,r]=(0,c.useState)(null),l=n?.css;return(0,c.createElement)(m.__experimentalVStack,{spacing:3},(0,c.createElement)(m.TextareaControl,{label:(0,v.__)("Additional CSS"),__nextHasNoMarginBottom:!0,value:l,onChange:n=>function(n){if(t({...e,css:n}),o){const[t]=gm([{css:e}],".editor-styles-wrapper");t&&r(null)}}(n),onBlur:function(e){if(!e?.target?.value)return void r(null);const[t]=gm([{css:e.target.value}],".editor-styles-wrapper");r(null===t?(0,v.__)("There is an error with your CSS structure."):null)},className:"block-editor-global-styles-advanced-panel__custom-css-input",spellCheck:!1}),o&&(0,c.createElement)(m.Tooltip,{text:o},(0,c.createElement)("div",{className:"block-editor-global-styles-advanced-panel__custom-css-validation-wrapper"},(0,c.createElement)(Ql,{icon:qC,className:"block-editor-global-styles-advanced-panel__custom-css-validation-icon"}))))}function hT(e,...t){if(null==e||!1===e)return;if(Array.isArray(e))return bT(e,...t);switch(typeof e){case"string":case"number":return}const{type:n,props:o}=e;switch(n){case c.StrictMode:case c.Fragment:return bT(o.children,...t);case c.RawHTML:return;case vv.Content:return vT(...t);case Qx:const[e]=t;return void e.push(o.value)}switch(typeof n){case"string":return void 0!==o.children?bT(o.children,...t):void 0;case"function":return n.prototype&&"function"==typeof n.prototype.render?hT(new n(o).render(),...t):hT(n(o),...t)}}function bT(e,...t){e=Array.isArray(e)?e:[e];for(let n=0;n<e.length;n++)hT(e[n],...t)}function vT(e,t){for(let n=0;n<t.length;n++){const{name:o,attributes:r,innerBlocks:l}=t[n];hT((0,a.getSaveElement)(o,r),e,l)}}const _T=[{label:(0,v._x)("Original","Aspect ratio option for dimensions control"),value:"auto"},{label:(0,v._x)("Square - 1:1","Aspect ratio option for dimensions control"),value:"1"},{label:(0,v._x)("Standard - 4:3","Aspect ratio option for dimensions control"),value:"4/3"},{label:(0,v._x)("Portrait - 3:4","Aspect ratio option for dimensions control"),value:"3/4"},{label:(0,v._x)("Classic - 3:2","Aspect ratio option for dimensions control"),value:"3/2"},{label:(0,v._x)("Classic Portrait - 2:3","Aspect ratio option for dimensions control"),value:"2/3"},{label:(0,v._x)("Wide - 16:9","Aspect ratio option for dimensions control"),value:"16/9"},{label:(0,v._x)("Tall - 9:16","Aspect ratio option for dimensions control"),value:"9/16"},{label:(0,v._x)("Custom","Aspect ratio option for dimensions control"),value:"custom",disabled:!0,hidden:!0}];function kT({panelId:e,value:t,onChange:n=(()=>{}),options:o=_T,defaultValue:r=_T[0].value,isShownByDefault:l=!0}){const i=null!=t?t:"auto";return(0,c.createElement)(m.__experimentalToolsPanelItem,{hasValue:()=>i!==r,label:(0,v.__)("Aspect ratio"),onDeselect:()=>n(void 0),isShownByDefault:l,panelId:e},(0,c.createElement)(m.SelectControl,{label:(0,v.__)("Aspect ratio"),value:i,options:o,onChange:n,size:"__unstable-large",__nextHasNoMarginBottom:!0}))}const yT=[{value:"fill",label:(0,v._x)("Fill","Scale option for dimensions control"),help:(0,v.__)("Fill the space by stretching the content.")},{value:"contain",label:(0,v._x)("Contain","Scale option for dimensions control"),help:(0,v.__)("Fit the content to the space without clipping.")},{value:"cover",label:(0,v._x)("Cover","Scale option for dimensions control"),help:(0,v.__)("Fill the space by clipping what doesn't fit.")},{value:"none",label:(0,v._x)("None","Scale option for dimensions control"),help:(0,v.__)("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,v._x)("Scale down","Scale option for dimensions control"),help:(0,v.__)("Scale down the content to fit the space if it is too big. Content that is too small will have additional padding.")}];function ET({panelId:e,value:t,onChange:n,options:o=yT,defaultValue:r=yT[0].value,isShownByDefault:l=!0}){const i=null!=t?t:"fill",a=(0,c.useMemo)((()=>o.reduce(((e,t)=>(e[t.value]=t.help,e)),{})),[o]);return(0,c.createElement)(m.__experimentalToolsPanelItem,{label:(0,v.__)("Scale"),isShownByDefault:l,hasValue:()=>i!==r,onDeselect:()=>n(r),panelId:e},(0,c.createElement)(m.__experimentalToggleGroupControl,{label:(0,v.__)("Scale"),isBlock:!0,help:a[i],value:i,onChange:n,__nextHasNoMarginBottom:!0},o.map((e=>(0,c.createElement)(m.__experimentalToggleGroupControlOption,{key:e.value,...e})))))}function wT(){return wT=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},wT.apply(this,arguments)}function ST(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var CT=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,xT=ST((function(e){return CT.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));var BT=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(e){0}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){return e.parentNode&&e.parentNode.removeChild(e)})),this.tags=[],this.ctr=0},e}(),IT=Math.abs,TT=String.fromCharCode,MT=Object.assign;function PT(e){return e.trim()}function NT(e,t,n){return e.replace(t,n)}function LT(e,t){return e.indexOf(t)}function RT(e,t){return 0|e.charCodeAt(t)}function AT(e,t,n){return e.slice(t,n)}function DT(e){return e.length}function OT(e){return e.length}function zT(e,t){return t.push(e),e}var VT=1,FT=1,HT=0,GT=0,UT=0,$T="";function jT(e,t,n,o,r,l,i){return{value:e,root:t,parent:n,type:o,props:r,children:l,line:VT,column:FT,length:i,return:""}}function WT(e,t){return MT(jT("",null,null,"",null,null,0),e,{length:-e.length},t)}function KT(){return UT=GT>0?RT($T,--GT):0,FT--,10===UT&&(FT=1,VT--),UT}function qT(){return UT=GT<HT?RT($T,GT++):0,FT++,10===UT&&(FT=1,VT++),UT}function ZT(){return RT($T,GT)}function YT(){return GT}function XT(e,t){return AT($T,e,t)}function QT(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 JT(e){return VT=FT=1,HT=DT($T=e),GT=0,[]}function eM(e){return $T="",e}function tM(e){return PT(XT(GT-1,rM(91===e?e+2:40===e?e+1:e)))}function nM(e){for(;(UT=ZT())&&UT<33;)qT();return QT(e)>2||QT(UT)>3?"":" "}function oM(e,t){for(;--t&&qT()&&!(UT<48||UT>102||UT>57&&UT<65||UT>70&&UT<97););return XT(e,YT()+(t<6&&32==ZT()&&32==qT()))}function rM(e){for(;qT();)switch(UT){case e:return GT;case 34:case 39:34!==e&&39!==e&&rM(UT);break;case 40:41===e&&rM(e);break;case 92:qT()}return GT}function lM(e,t){for(;qT()&&e+UT!==57&&(e+UT!==84||47!==ZT()););return"/*"+XT(t,GT-1)+"*"+TT(47===e?e:qT())}function iM(e){for(;!QT(ZT());)qT();return XT(e,GT)}var aM="-ms-",sM="-moz-",cM="-webkit-",uM="comm",dM="rule",pM="decl",mM="@keyframes";function fM(e,t){for(var n="",o=OT(e),r=0;r<o;r++)n+=t(e[r],r,e,t)||"";return n}function gM(e,t,n,o){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case pM:return e.return=e.return||e.value;case uM:return"";case mM:return e.return=e.value+"{"+fM(e.children,o)+"}";case dM:e.value=e.props.join(",")}return DT(n=fM(e.children,o))?e.return=e.value+"{"+n+"}":""}function hM(e){return eM(bM("",null,null,null,[""],e=JT(e),0,[0],e))}function bM(e,t,n,o,r,l,i,a,s){for(var c=0,u=0,d=i,p=0,m=0,f=0,g=1,h=1,b=1,v=0,_="",k=r,y=l,E=o,w=_;h;)switch(f=v,v=qT()){case 40:if(108!=f&&58==RT(w,d-1)){-1!=LT(w+=NT(tM(v),"&","&\f"),"&\f")&&(b=-1);break}case 34:case 39:case 91:w+=tM(v);break;case 9:case 10:case 13:case 32:w+=nM(f);break;case 92:w+=oM(YT()-1,7);continue;case 47:switch(ZT()){case 42:case 47:zT(_M(lM(qT(),YT()),t,n),s);break;default:w+="/"}break;case 123*g:a[c++]=DT(w)*b;case 125*g:case 59:case 0:switch(v){case 0:case 125:h=0;case 59+u:-1==b&&(w=NT(w,/\f/g,"")),m>0&&DT(w)-d&&zT(m>32?kM(w+";",o,n,d-1):kM(NT(w," ","")+";",o,n,d-2),s);break;case 59:w+=";";default:if(zT(E=vM(w,t,n,c,u,r,a,_,k=[],y=[],d),l),123===v)if(0===u)bM(w,t,E,E,k,l,d,a,y);else switch(99===p&&110===RT(w,3)?100:p){case 100:case 108:case 109:case 115:bM(e,E,E,o&&zT(vM(e,E,E,0,0,r,a,_,r,k=[],d),y),r,y,d,a,o?k:y);break;default:bM(w,E,E,E,[""],y,0,a,y)}}c=u=m=0,g=b=1,_=w="",d=i;break;case 58:d=1+DT(w),m=f;default:if(g<1)if(123==v)--g;else if(125==v&&0==g++&&125==KT())continue;switch(w+=TT(v),v*g){case 38:b=u>0?1:(w+="\f",-1);break;case 44:a[c++]=(DT(w)-1)*b,b=1;break;case 64:45===ZT()&&(w+=tM(qT())),p=ZT(),u=d=DT(_=w+=iM(YT())),v++;break;case 45:45===f&&2==DT(w)&&(g=0)}}return l}function vM(e,t,n,o,r,l,i,a,s,c,u){for(var d=r-1,p=0===r?l:[""],m=OT(p),f=0,g=0,h=0;f<o;++f)for(var b=0,v=AT(e,d+1,d=IT(g=i[f])),_=e;b<m;++b)(_=PT(g>0?p[b]+" "+v:NT(v,/&\f/g,p[b])))&&(s[h++]=_);return jT(e,t,n,0===r?dM:a,s,c,u)}function _M(e,t,n){return jT(e,t,n,uM,TT(UT),AT(e,2,-2),0)}function kM(e,t,n,o){return jT(e,t,n,pM,AT(e,0,o),AT(e,o+1,-1),o)}var yM=function(e,t,n){for(var o=0,r=0;o=r,r=ZT(),38===o&&12===r&&(t[n]=1),!QT(r);)qT();return XT(e,GT)},EM=function(e,t){return eM(function(e,t){var n=-1,o=44;do{switch(QT(o)){case 0:38===o&&12===ZT()&&(t[n]=1),e[n]+=yM(GT-1,t,n);break;case 2:e[n]+=tM(o);break;case 4:if(44===o){e[++n]=58===ZT()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=TT(o)}}while(o=qT());return e}(JT(e),t))},wM=new WeakMap,SM=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)||wM.get(n))&&!o){wM.set(e,!0);for(var r=[],l=EM(t,r),i=n.props,a=0,s=0;a<l.length;a++)for(var c=0;c<i.length;c++,s++)e.props[s]=r[a]?l[a].replace(/&\f/g,i[c]):i[c]+" "+l[a]}}},CM=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function xM(e,t){switch(function(e,t){return 45^RT(e,0)?(((t<<2^RT(e,0))<<2^RT(e,1))<<2^RT(e,2))<<2^RT(e,3):0}(e,t)){case 5103:return cM+"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 cM+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return cM+e+sM+e+aM+e+e;case 6828:case 4268:return cM+e+aM+e+e;case 6165:return cM+e+aM+"flex-"+e+e;case 5187:return cM+e+NT(e,/(\w+).+(:[^]+)/,cM+"box-$1$2"+aM+"flex-$1$2")+e;case 5443:return cM+e+aM+"flex-item-"+NT(e,/flex-|-self/,"")+e;case 4675:return cM+e+aM+"flex-line-pack"+NT(e,/align-content|flex-|-self/,"")+e;case 5548:return cM+e+aM+NT(e,"shrink","negative")+e;case 5292:return cM+e+aM+NT(e,"basis","preferred-size")+e;case 6060:return cM+"box-"+NT(e,"-grow","")+cM+e+aM+NT(e,"grow","positive")+e;case 4554:return cM+NT(e,/([^-])(transform)/g,"$1"+cM+"$2")+e;case 6187:return NT(NT(NT(e,/(zoom-|grab)/,cM+"$1"),/(image-set)/,cM+"$1"),e,"")+e;case 5495:case 3959:return NT(e,/(image-set\([^]*)/,cM+"$1$`$1");case 4968:return NT(NT(e,/(.+:)(flex-)?(.*)/,cM+"box-pack:$3"+aM+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+cM+e+e;case 4095:case 3583:case 4068:case 2532:return NT(e,/(.+)-inline(.+)/,cM+"$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(DT(e)-1-t>6)switch(RT(e,t+1)){case 109:if(45!==RT(e,t+4))break;case 102:return NT(e,/(.+:)(.+)-([^]+)/,"$1"+cM+"$2-$3$1"+sM+(108==RT(e,t+3)?"$3":"$2-$3"))+e;case 115:return~LT(e,"stretch")?xM(NT(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==RT(e,t+1))break;case 6444:switch(RT(e,DT(e)-3-(~LT(e,"!important")&&10))){case 107:return NT(e,":",":"+cM)+e;case 101:return NT(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+cM+(45===RT(e,14)?"inline-":"")+"box$3$1"+cM+"$2$3$1"+aM+"$2box$3")+e}break;case 5936:switch(RT(e,t+11)){case 114:return cM+e+aM+NT(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return cM+e+aM+NT(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return cM+e+aM+NT(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return cM+e+aM+e+e}return e}var BM=[function(e,t,n,o){if(e.length>-1&&!e.return)switch(e.type){case pM:e.return=xM(e.value,e.length);break;case mM:return fM([WT(e,{value:NT(e.value,"@","@"+cM)})],o);case dM:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return fM([WT(e,{props:[NT(t,/:(read-\w+)/,":-moz-$1")]})],o);case"::placeholder":return fM([WT(e,{props:[NT(t,/:(plac\w+)/,":"+cM+"input-$1")]}),WT(e,{props:[NT(t,/:(plac\w+)/,":-moz-$1")]}),WT(e,{props:[NT(t,/:(plac\w+)/,aM+"input-$1")]})],o)}return""}))}}],IM=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var o=e.stylisPlugins||BM;var r,l,i={},a=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)i[t[n]]=!0;a.push(e)}));var s,c,u,d,p=[gM,(d=function(e){s.insert(e)},function(e){e.root||(e=e.return)&&d(e)})],m=(c=[SM,CM].concat(o,p),u=OT(c),function(e,t,n,o){for(var r="",l=0;l<u;l++)r+=c[l](e,t,n,o)||"";return r});l=function(e,t,n,o){s=n,function(e){fM(hM(e),m)}(e?e+"{"+t.styles+"}":t.styles),o&&(f.inserted[t.name]=!0)};var f={key:t,sheet:new BT({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:l};return f.sheet.hydrate(a),f};var TM={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,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 MM(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var PM=/[A-Z]|^ms/g,NM=/_EMO_([^_]+?)_([^]*?)_EMO_/g,LM=function(e){return 45===e.charCodeAt(1)},RM=function(e){return null!=e&&"boolean"!=typeof e},AM=MM((function(e){return LM(e)?e:e.replace(PM,"-$&").toLowerCase()})),DM=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(NM,(function(e,t,n){return zM={name:t,styles:n,next:zM},t}))}return 1===TM[e]||LM(e)||"number"!=typeof t||0===t?t:t+"px"};function OM(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return zM={name:n.name,styles:n.styles,next:zM},n.name;if(void 0!==n.styles){var o=n.next;if(void 0!==o)for(;void 0!==o;)zM={name:o.name,styles:o.styles,next:zM},o=o.next;return n.styles+";"}return function(e,t,n){var o="";if(Array.isArray(n))for(var r=0;r<n.length;r++)o+=OM(e,t,n[r])+";";else for(var l in n){var i=n[l];if("object"!=typeof i)null!=t&&void 0!==t[i]?o+=l+"{"+t[i]+"}":RM(i)&&(o+=AM(l)+":"+DM(l,i)+";");else if(!Array.isArray(i)||"string"!=typeof i[0]||null!=t&&void 0!==t[i[0]]){var a=OM(e,t,i);switch(l){case"animation":case"animationName":o+=AM(l)+":"+a+";";break;default:o+=l+"{"+a+"}"}}else for(var s=0;s<i.length;s++)RM(i[s])&&(o+=AM(l)+":"+DM(l,i[s])+";")}return o}(e,t,n);case"function":if(void 0!==e){var r=zM,l=n(e);return zM=r,OM(e,t,l)}}if(null==t)return n;var i=t[n];return void 0!==i?i:n}var zM,VM=/label:\s*([^\s;\n{]+)\s*(;|$)/g;var FM=!!Ea.useInsertionEffect&&Ea.useInsertionEffect,HM=FM||function(e){return e()},GM=(FM||Ea.useLayoutEffect,Ea.createContext("undefined"!=typeof HTMLElement?IM({key:"css"}):null));GM.Provider;var UM=function(e){return(0,Ea.forwardRef)((function(t,n){var o=(0,Ea.useContext)(GM);return e(t,o,n)}))};var $M=Ea.createContext({});var jM=function(e,t,n){var o=e.key+"-"+t.name;!1===n&&void 0===e.registered[o]&&(e.registered[o]=t.styles)},WM=xT,KM=function(e){return"theme"!==e},qM=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?WM:KM},ZM=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},YM=function(e){var t=e.cache,n=e.serialized,o=e.isStringTag;return jM(t,n,o),HM((function(){return function(e,t,n){jM(e,t,n);var o=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var r=t;do{e.insert(t===r?"."+o:"",r,e.sheet,!0),r=r.next}while(void 0!==r)}}(t,n,o)})),null},XM=function e(t,n){var o,r,l=t.__emotion_real===t,i=l&&t.__emotion_base||t;void 0!==n&&(o=n.label,r=n.target);var a=ZM(t,n,l),s=a||qM(i),c=!s("as");return function(){var u=arguments,d=l&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==o&&d.push("label:"+o+";"),null==u[0]||void 0===u[0].raw)d.push.apply(d,u);else{0,d.push(u[0][0]);for(var p=u.length,m=1;m<p;m++)d.push(u[m],u[0][m])}var f=UM((function(e,t,n){var o=c&&e.as||i,l="",u=[],p=e;if(null==e.theme){for(var m in p={},e)p[m]=e[m];p.theme=Ea.useContext($M)}"string"==typeof e.className?l=function(e,t,n){var o="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):o+=n+" "})),o}(t.registered,u,e.className):null!=e.className&&(l=e.className+" ");var f=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="";zM=void 0;var l=e[0];null==l||void 0===l.raw?(o=!1,r+=OM(n,t,l)):r+=l[0];for(var i=1;i<e.length;i++)r+=OM(n,t,e[i]),o&&(r+=l[i]);VM.lastIndex=0;for(var a,s="";null!==(a=VM.exec(r));)s+="-"+a[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)+s;return{name:c,styles:r,next:zM}}(d.concat(u),t.registered,p);l+=t.key+"-"+f.name,void 0!==r&&(l+=" "+r);var g=c&&void 0===a?qM(o):s,h={};for(var b in e)c&&"as"===b||g(b)&&(h[b]=e[b]);return h.className=l,h.ref=n,Ea.createElement(Ea.Fragment,null,Ea.createElement(YM,{cache:t,serialized:f,isStringTag:"string"==typeof o}),Ea.createElement(o,h))}));return f.displayName=void 0!==o?o:"Styled("+("string"==typeof i?i:i.displayName||i.name||"Component")+")",f.defaultProps=t.defaultProps,f.__emotion_real=f,f.__emotion_base=i,f.__emotion_styles=d,f.__emotion_forwardProp=a,Object.defineProperty(f,"toString",{value:function(){return"."+r}}),f.withComponent=function(t,o){return e(t,wT({},n,o,{shouldForwardProp:ZM(f,o,!0)})).apply(void 0,d)},f}};const QM=XM(m.__experimentalToolsPanelItem,{target:"ef8pe3d0"})({name:"957xgf",styles:"grid-column:span 1"});function JM({panelId:e,value:t={},onChange:n=(()=>{}),units:o,isShownByDefault:r=!0}){var l,i;const a="auto"===t.width?"":null!==(l=t.width)&&void 0!==l?l:"",s="auto"===t.height?"":null!==(i=t.height)&&void 0!==i?i:"",u=e=>o=>{const r={...t};o?r[e]=o:delete r[e],n(r)};return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(QM,{label:(0,v.__)("Width"),isShownByDefault:r,hasValue:()=>""!==a,onDeselect:u("width"),panelId:e},(0,c.createElement)(m.__experimentalUnitControl,{label:(0,v.__)("Width"),placeholder:(0,v.__)("Auto"),labelPosition:"top",units:o,min:0,value:a,onChange:u("width"),size:"__unstable-large"})),(0,c.createElement)(QM,{label:(0,v.__)("Height"),isShownByDefault:r,hasValue:()=>""!==s,onDeselect:u("height"),panelId:e},(0,c.createElement)(m.__experimentalUnitControl,{label:(0,v.__)("Height"),placeholder:(0,v.__)("Auto"),labelPosition:"top",units:o,min:0,value:s,onChange:u("height"),size:"__unstable-large"})))}var eP=function({panelId:e,value:t={},onChange:n=(()=>{}),aspectRatioOptions:o,defaultAspectRatio:r="auto",scaleOptions:l,defaultScale:i="fill",unitsOptions:a}){const s=void 0===t.width||"auto"===t.width?null:t.width,u=void 0===t.height||"auto"===t.height?null:t.height,d=void 0===t.aspectRatio||"auto"===t.aspectRatio?null:t.aspectRatio,p=void 0===t.scale||"fill"===t.scale?null:t.scale,[m,f]=(0,c.useState)(p),[g,h]=(0,c.useState)(d),b=s&&u?"custom":g,v=d||s&&u;return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(kT,{panelId:e,options:o,defaultValue:r,value:b,onChange:e=>{const o={...t};h(e="auto"===e?null:e),e?o.aspectRatio=e:delete o.aspectRatio,e?m?o.scale=m:(o.scale=i,f(i)):delete o.scale,e&&s&&u&&delete o.height,n(o)}}),v&&(0,c.createElement)(ET,{panelId:e,options:l,defaultValue:i,value:m,onChange:e=>{const o={...t};f(e="fill"===e?null:e),e?o.scale=e:delete o.scale,n(o)}}),(0,c.createElement)(JM,{panelId:e,units:a,value:{width:s,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:g&&(r.aspectRatio=g),g||!!e==!!o?m?r.scale=m:(r.scale=i,f(i)):delete r.scale,n(r)}}))};const tP=[{label:(0,v._x)("Thumbnail","Image size option for resolution control"),value:"thumbnail"},{label:(0,v._x)("Medium","Image size option for resolution control"),value:"medium"},{label:(0,v._x)("Large","Image size option for resolution control"),value:"large"},{label:(0,v._x)("Full Size","Image size option for resolution control"),value:"full"}];const nP={};hn(nP,{...i,ExperimentalBlockEditorProvider:Yd,getRichTextValues:function(e=[]){a.__unstableGetBlockProps.skipFilters=!0;const t=[];return vT(t,e),a.__unstableGetBlockProps.skipFilters=!1,t},PrivateInserter:fg,PrivateListView:Zw,ResizableBoxPopover:function({clientId:e,resizableBoxProps:t,...n}){return(0,c.createElement)(xg,{clientId:e,__unstableCoverTarget:!0,__unstablePopoverSlot:"block-toolbar",shift:!1,...n},(0,c.createElement)(m.ResizableBox,{...t}))},BlockInfo:eI,useShouldContextualToolbarShow:Qb,cleanEmptyObject:Ol,useBlockEditingMode:Bi,BlockQuickNavigation:tI,LayoutStyle:mi,BlockRemovalWarningModal:function(){const{clientIds:e,selectPrevious:t,blockNamesForPrompt:n}=(0,f.useSelect)((e=>bn(e($o)).getRemovalPromptData())),{clearRemovalPrompt:o,toggleRemovalPromptSupport:r,privateRemoveBlocks:l}=bn((0,f.useDispatch)($o));if((0,c.useEffect)((()=>(r(!0),()=>{r(!1)})),[r]),!n)return;return(0,c.createElement)(m.Modal,{title:(0,v.__)("Are you sure?"),onRequestClose:o,style:{maxWidth:"40rem"}},1===n.length?(0,c.createElement)("p",null,vn[n[0]]):(0,c.createElement)("ul",{style:{listStyleType:"disc",paddingLeft:"1rem"}},n.map((e=>(0,c.createElement)("li",{key:e},vn[e])))),(0,c.createElement)("p",null,n.length>1?(0,v.__)("Removing these blocks is not advised."):(0,v.__)("Removing this block is not advised.")),(0,c.createElement)(m.__experimentalHStack,{justify:"right"},(0,c.createElement)(m.Button,{variant:"tertiary",onClick:o},(0,v.__)("Cancel")),(0,c.createElement)(m.Button,{variant:"primary",onClick:()=>{l(e,t,!0),o()}},(0,v.__)("Delete"))))},useLayoutClasses:vE,useLayoutStyles:function(e={},t,n){const{layout:o={},style:r={}}=e,l=o?.inherit||o?.contentSize||o?.wideSize?{...o,type:"constrained"}:o||{},i=si(l?.type||"default"),a=null!==Qr("spacing.blockGap"),s=i?.getLayoutStyle?.({blockName:t,selector:n,layout:o,style:r,hasBlockGapSupport:a});return s},DimensionsTool:eP,ResolutionTool:function({panelId:e,value:t,onChange:n,options:o=tP,defaultValue:r=tP[0].value,isShownByDefault:l=!0}){const i=null!=t?t:r;return(0,c.createElement)(m.__experimentalToolsPanelItem,{hasValue:()=>i!==r,label:(0,v.__)("Resolution"),onDeselect:()=>n(r),isShownByDefault:l,panelId:e},(0,c.createElement)(m.SelectControl,{label:(0,v.__)("Resolution"),value:i,options:o,onChange:n,help:(0,v.__)("Select the size of the source image."),size:"__unstable-large"}))}})}(),(window.wp=window.wp||{}).blockEditor=o}();