diff --git a/android/Gutenberg/src/main/java/org/wordpress/gutenberg/EditorConfiguration.kt b/android/Gutenberg/src/main/java/org/wordpress/gutenberg/EditorConfiguration.kt index 7c022eec..cdf7f4e8 100644 --- a/android/Gutenberg/src/main/java/org/wordpress/gutenberg/EditorConfiguration.kt +++ b/android/Gutenberg/src/main/java/org/wordpress/gutenberg/EditorConfiguration.kt @@ -1,7 +1,6 @@ package org.wordpress.gutenberg import android.os.Parcelable -import android.os.Parcel import kotlinx.parcelize.Parcelize @Parcelize @@ -60,7 +59,8 @@ open class EditorConfiguration constructor( val siteApiNamespace: Array, val namespaceExcludedPaths: Array, val authHeader: String, - val webViewGlobals: List + val webViewGlobals: List, + val editorSettings: String? ) : Parcelable { companion object { @JvmStatic @@ -81,6 +81,7 @@ open class EditorConfiguration constructor( private var namespaceExcludedPaths: Array = arrayOf() private var authHeader: String = "" private var webViewGlobals: List = emptyList() + private var editorSettings: String? = null fun setTitle(title: String) = apply { this.title = title } fun setContent(content: String) = apply { this.content = content } @@ -95,6 +96,7 @@ open class EditorConfiguration constructor( fun setNamespaceExcludedPaths(namespaceExcludedPaths: Array) = apply { this.namespaceExcludedPaths = namespaceExcludedPaths } fun setAuthHeader(authHeader: String) = apply { this.authHeader = authHeader } fun setWebViewGlobals(webViewGlobals: List) = apply { this.webViewGlobals = webViewGlobals } + fun setEditorSettings(editorSettings: String?) = apply { this.editorSettings = editorSettings } fun build(): EditorConfiguration = EditorConfiguration( title = title, @@ -109,7 +111,8 @@ open class EditorConfiguration constructor( siteApiNamespace = siteApiNamespace, namespaceExcludedPaths = namespaceExcludedPaths, authHeader = authHeader, - webViewGlobals = webViewGlobals + webViewGlobals = webViewGlobals, + editorSettings = editorSettings ) } @@ -132,6 +135,7 @@ open class EditorConfiguration constructor( if (!namespaceExcludedPaths.contentEquals(other.namespaceExcludedPaths)) return false if (authHeader != other.authHeader) return false if (webViewGlobals != other.webViewGlobals) return false + if (editorSettings != other.editorSettings) return false return true } @@ -150,6 +154,7 @@ open class EditorConfiguration constructor( result = 31 * result + namespaceExcludedPaths.contentHashCode() result = 31 * result + authHeader.hashCode() result = 31 * result + webViewGlobals.hashCode() + result = 31 * result + (editorSettings?.hashCode() ?: 0) return result } } diff --git a/android/Gutenberg/src/main/java/org/wordpress/gutenberg/GutenbergView.kt b/android/Gutenberg/src/main/java/org/wordpress/gutenberg/GutenbergView.kt index 5642ff5b..83314006 100644 --- a/android/Gutenberg/src/main/java/org/wordpress/gutenberg/GutenbergView.kt +++ b/android/Gutenberg/src/main/java/org/wordpress/gutenberg/GutenbergView.kt @@ -260,6 +260,7 @@ class GutenbergView : WebView { val escapedTitle = encodeForEditor(configuration.title) val escapedContent = encodeForEditor(configuration.content) + val editorSettings = configuration.editorSettings ?: "undefined" val gbKitConfig = """ window.GBKit = { @@ -269,6 +270,7 @@ class GutenbergView : WebView { "authHeader": "${configuration.authHeader}", "themeStyles": ${configuration.themeStyles}, "hideTitle": ${configuration.hideTitle}, + "editorSettings": $editorSettings, ${if (configuration.postId != null) """ "post": { "id": ${configuration.postId}, diff --git a/ios/Sources/GutenbergKit/Gutenberg/assets/index-CH3ipafv.js b/ios/Sources/GutenbergKit/Gutenberg/assets/index-CH3ipafv.js deleted file mode 100644 index 6d5fff31..00000000 --- a/ios/Sources/GutenbergKit/Gutenberg/assets/index-CH3ipafv.js +++ /dev/null @@ -1,4 +0,0 @@ -import{o as K,l as W,e as Z,b as q,c as Q}from"./bridge-B_oa8MnC.js";function F(t){var e,o,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e{const[e,o]=it(!1),{isSelected:n}=L(c=>{const{getSelectedBlockClientId:r}=c(dt);return{isSelected:r()!==null}}),{isInserterOpened:s}=L(c=>({isInserterOpened:c(T).isInserterOpened()}),[]),{setIsInserterOpened:a}=ct(T);function l(){o(!0)}function w(){o(!1)}const d=b("gutenberg-kit-editor-toolbar",t);return E(C,{children:[E(pt,{className:d,label:"Editor toolbar",variant:"unstyled",children:[g(A,{children:g(lt,{open:s,onToggle:a})}),n&&g(A,{children:g(gt,{title:mt("Open Settings"),icon:st,onClick:l})}),g(at,{hideDragHandle:!0})]}),e&&g(wt,{className:"block-settings-menu",variant:"unstyled",placement:"overlay",children:E(C,{children:[g("div",{className:"block-settings-menu__header",children:g(ut,{className:"block-settings-menu__close",icon:et,onClick:w})}),g(rt,{})]})})]})},{__dangerousOptInToUnstableAPIsOnlyForCoreModules:ft}=window.wp.privateApis,{lock:Je,unlock:R}=ft("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/editor"),yt=".gutenberg-kit-visual-editor__post-title-wrapper .wp-block-post-title{font-size:20px}.block-editor-default-block-appender__content{opacity:.62}",bt=".editor-visual-editor__post-title-wrapper>:where(:not(.alignleft):not(.alignright):not(.alignfull)){max-width:var(--wp--style--global--content-size);margin-left:auto!important;margin-right:auto!important}.editor-visual-editor__post-title-wrapper>.alignwide{max-width:1340px}.editor-visual-editor__post-title-wrapper>.alignfull{max-width:none}:root :where(.is-layout-flow)>:first-child{margin-block-start:0}:root :where(.is-layout-flow)>:last-child{margin-block-end:0}:root :where(.is-layout-flow)>*{margin-block-start:1.2rem;margin-block-end:0}:root :where(.is-layout-constrained)>:first-child{margin-block-start:0}:root :where(.is-layout-constrained)>:last-child{margin-block-end:0}:root :where(.is-layout-constrained)>*{margin-block-start:1.2rem;margin-block-end:0}",{store:St}=window.wp.editor,{useSelect:kt}=window.wp.data,{privateApis:Et}=window.wp.blockEditor,{store:vt}=window.wp.editPost,{useMemo:_t}=window.wp.element,{getLayoutStyles:Rt}=R(Et);function xt(){const{hasThemeStyleSupport:t,editorSettings:e}=kt(o=>({hasThemeStyleSupport:o(vt).isFeatureActive("themeStyles"),editorSettings:o(St).getEditorSettings()}),[]);return _t(()=>{const o=[...e?.defaultEditorStyles??[]];!e.disableLayoutStyles&&!t&&o.push({css:Rt({style:{},selector:"body",hasBlockGapSupport:!1,hasFallbackGapSupport:!0,fallbackGapValue:"0.5em"})}),t||o.push({css:yt});const n=t?e.styles??[]:o;return[{css:bt},...n]},[e.defaultEditorStyles,e.disableLayoutStyles,e.styles,t])}const{jsx:$t}=window.ReactJSXRuntime,{createBlock:Ct}=window.wp.blocks,{useDispatch:Lt,useSelect:At}=window.wp.data,{__:Tt}=window.wp.i18n,{store:B}=window.wp.blockEditor;function Bt(){const{insertBlock:t}=Lt(B),{blockCount:e}=At(n=>{const{getBlockCount:s}=n(B);return{blockCount:s()}}),o=()=>{const n=Ct("core/paragraph");t(n,e)};return $t("button",{"aria-label":Tt("Add paragraph block"),onClick:o,className:"gutenberg-kit-default-block-appender"})}const{Fragment:Pt,jsx:u,jsxs:v}=window.ReactJSXRuntime,{useRef:jt}=window.wp.element,{BlockList:It,privateApis:Mt,store:Dt}=window.wp.blockEditor,{Popover:Nt}=window.wp.components,{store:Ut,PostTitle:Ot}=window.wp.editor,{useSelect:Gt}=window.wp.data,{store:Ft}=window.wp.editPost,{ExperimentalBlockCanvas:Jt,LayoutStyle:f,useLayoutClasses:Xt,useLayoutStyles:Ht}=R(Mt),zt=`.is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;} - .is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);} - .is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;} - .is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}`;function Vt({hideTitle:t}){const e=jt(),{renderingMode:o,hasThemeStyleSupport:n,themeHasDisabledLayoutStyles:s,themeSupportsLayout:a,hasRootPaddingAwareAlignments:l}=Gt(S=>{const{getRenderingMode:H}=S(Ut),z=H(),{getSettings:V}=R(S(Dt)),k=V();return{renderingMode:z,hasThemeStyleSupport:S(Ft).isFeatureActive("themeStyles"),themeSupportsLayout:k.supportsLayout,themeHasDisabledLayoutStyles:k.disableLayoutStyles,hasRootPaddingAwareAlignments:k.__experimentalFeatures?.useRootPaddingAwareAlignments}},[]),w=xt(),d=b("gutenberg-kit-visual-editor",{"has-root-padding":!n||!l}),c=b("gutenberg-kit-visual-editor__post-title-wrapper","editor-visual-editor__post-title-wrapper",{"has-global-padding":n&&l}),r={align:"full",layout:{type:"constrained"}},{layout:i={},align:p=""}=r,m=Xt(r,"core/post-content"),h=Ht(r,"core/post-content",".block-editor-block-list__layout.is-root-container"),X=b(a&&m,p&&`align${p}`,{"is-layout-flow":!a,"has-global-padding":n&&l});return v("div",{className:d,children:[v(Jt,{shouldIframe:!1,height:"100%",styles:w,children:[a&&!s&&o==="post-only"&&v(Pt,{children:[u(f,{selector:".editor-visual-editor__post-title-wrapper",layout:i}),u(f,{selector:".block-editor-block-list__layout.is-root-container",layout:i}),p&&u(f,{css:zt}),h&&u(f,{layout:i,css:h})]}),!t&&u("div",{className:c,children:u(Ot,{ref:e})}),u(It,{className:X,layout:i}),u(Bt,{})]}),u(ht,{className:"gutenberg-kit-visual-editor__toolbar"}),u(Nt.Slot,{})]})}const{useEffect:Kt}=window.wp.element,{useSelect:Wt}=window.wp.data,{store:Zt}=window.wp.editor;function qt(){const{hasUndo:t,hasRedo:e}=Wt(o=>{const n=o(Zt);return{hasUndo:n.hasEditorUndo(),hasRedo:n.hasEditorRedo()}},[]);Kt(()=>{K(t,e)},[t,e])}const{useEffect:Qt,useCallback:Yt,useRef:P}=window.wp.element,{useDispatch:j,useSelect:te}=window.wp.data,{store:ee}=window.wp.coreData,{store:I}=window.wp.editor,{parse:oe,serialize:ne}=window.wp.blocks;window.editor=window.editor||{};function se(t,e){const{editEntityRecord:o}=j(ee),{undo:n,redo:s,switchEditorMode:a}=j(I),{getEditedPostAttribute:l,getEditedPostContent:w}=te(I),d=Yt(i=>{o("postType",t.type,t.id,i)},[o,t.id,t.type]),c=P(t.title.raw),r=P(null);r.current===null&&(r.current=ne(oe(t.content.raw||""))),Qt(()=>(window.editor.setContent=i=>{d({content:decodeURIComponent(i)})},window.editor.setTitle=i=>{d({title:decodeURIComponent(i)})},window.editor.getContent=(i=!1)=>(i&&M(e.current),w()),window.editor.getTitleAndContent=(i=!1)=>{i&&M(e.current);const p=l("title"),m=w(),h=p!==c.current||m!==r.current;return h&&(c.current=p,r.current=m),{title:p,content:m,changed:h}},window.editor.undo=()=>{n()},window.editor.redo=()=>{s()},window.editor.switchEditorMode=i=>{a(i)},()=>{delete window.editor.setContent,delete window.editor.setTitle,delete window.editor.getContent,delete window.editor.getTitleAndContent,delete window.editor.undo,delete window.editor.redo,delete window.editor.switchEditorMode}),[e,d,l,w,s,a,n])}function M(t){const e=t?.ownerDocument.activeElement;if(e&&e.contentEditable==="true"){const o=new Event("compositionend");e.dispatchEvent(o)}}const{useEffect:ie}=window.wp.element,{addAction:re,removeAction:ae}=window.wp.hooks;function le(){ie(()=>(re("editor.ErrorBoundary.errorLogged","GutenbergKit",t=>{W(t,{isHandled:!0,handledBy:"editor.ErrorBoundary.errorLogged"})}),()=>{ae("editor.ErrorBoundary.errorLogged","GutenbergKit")}),[])}const de=[{name:"post",baseURL:"/wp/v2/posts"},{name:"page",baseURL:"/wp/v2/pages"},{name:"attachment",baseURL:"/wp/v2/media"},{name:"wp_block",baseURL:"/wp/v2/blocks"}].map(t=>({kind:"postType",...t,transientEdits:{blocks:!0,selection:!0},mergedEdits:{meta:!0},rawAttributes:["title","excerpt","content"]})),{useEffect:ce}=window.wp.element,{useDispatch:D}=window.wp.data,{store:ue}=window.wp.coreData,{store:we}=window.wp.editor;function pe(t){const{addEntities:e,receiveEntityRecords:o}=D(ue),{setEditedPost:n,setupEditor:s}=D(we);ce(()=>{e(de),o("postType",t.type,t),s(t,{}),Z(),n(t.type,t.id)},[])}const{addFilter:ge,removeFilter:me}=window.wp.hooks,{useCallback:he,useEffect:J}=window.wp.element;function fe(){J(()=>(ge("editor.MediaUpload","GutenbergKit",()=>ye),()=>{me("editor.MediaUpload","GutenbergKit")}),[])}function ye({render:t,...e}){const{open:o}=be(e);return t({open:o})}function be({onSelect:t,...e}){return J(()=>(window.editor.setMediaUploadAttachment=n=>{t(e.multiple?n:n[0])},()=>{window.editor.setMediaUploadAttachment=()=>{}}),[t,e.multiple]),{open:he(()=>q(e),[e])}}const{jsx:N,jsxs:Se}=window.ReactJSXRuntime,{PostTitleRaw:ke,PostTextEditor:Ee}=window.wp.editor;function ve({hideTitle:t}){return Se("div",{className:"gutenberg-kit-text-editor",children:[!t&&N(ke,{}),N(Ee,{})]})}const{jsx:_,jsxs:_e}=window.ReactJSXRuntime,{store:Re}=window.wp.coreData,{useSelect:xe}=window.wp.data,{store:$e,EditorProvider:Ce}=window.wp.editor,{useRef:Le}=window.wp.element;function Ae({post:t,children:e,hideTitle:o}){const n=Le(null);se(t,n),qt(),le(),pe(t),fe();const{isReady:s,mode:a,isRichEditingEnabled:l,currentPost:w}=xe(d=>{const{__unstableIsEditorReady:c,getEditorSettings:r,getEditorMode:i}=d($e),p=r(),{getEntityRecord:m}=d(Re),h=m("postType",t.type,t.id);return{isReady:c(),mode:i(),isRichEditingEnabled:p.richEditingEnabled,currentPost:h}},[t.id,t.type]);return s?_("div",{className:"gutenberg-kit-editor",ref:n,children:_e(Ce,{post:w,settings:Te,useSubRegistry:!1,children:[a==="visual"&&l&&_(Vt,{hideTitle:o}),(a==="text"||!l)&&_(ve,{autoFocus:!0,hideTitle:o}),e]})}):null}const Te={},{jsx:U}=window.ReactJSXRuntime,{Notice:Be}=window.wp.components,{__:O}=window.wp.i18n,{useState:Pe,useEffect:G}=window.wp.element;function je({className:t}){const{notice:e,clearNotice:o}=Ie(),n=[{label:"Retry",onClick:()=>window.location.href="remote.html",variant:"primary"},{label:"Dismiss",onClick:o,variant:"secondary"}];return e?U("div",{className:t,children:U(Be,{actions:n,status:"warning",isDismissible:!1,children:e})}):null}function Ie(){const[t,e]=Pe(null);return G(()=>{const n=new URL(window.location.href).searchParams.get("error");let s=null;switch(n){case Me:s=O("Oops! We couldn't load your site's editor and plugins. Don't worry, you can use the default editor for now.");break;case De:s=O("Oops! Configuration for your site editor was unavailable. Don't worry, you can use the default editor for now.");break;default:s=null}e(s)},[]),G(()=>{if(t){const o=setTimeout(()=>{e(null)},2e4);return()=>clearTimeout(o)}},[t]),{notice:t,clearNotice:()=>e(null)}}const Me="remote_editor_load_error",De="gbkit_global_unavailable",{jsx:y,jsxs:Ne}=window.ReactJSXRuntime,{EditorSnackbars:Ue,ErrorBoundary:Oe,AutosaveMonitor:Ge}=window.wp.editor;function Xe(t){return Ne(Oe,{canCopyContent:!0,children:[y(Ge,{autosave:Q}),y(Ae,{...t,children:y(Ue,{})}),y(je,{className:"gutenberg-kit-layout__load-notice"})]})}export{Xe as default}; diff --git a/ios/Sources/GutenbergKit/Gutenberg/assets/index-DGgRt8ws.js b/ios/Sources/GutenbergKit/Gutenberg/assets/index-CvPL7PjT.js similarity index 96% rename from ios/Sources/GutenbergKit/Gutenberg/assets/index-DGgRt8ws.js rename to ios/Sources/GutenbergKit/Gutenberg/assets/index-CvPL7PjT.js index 78cb6a8c..08b916e6 100644 --- a/ios/Sources/GutenbergKit/Gutenberg/assets/index-DGgRt8ws.js +++ b/ios/Sources/GutenbergKit/Gutenberg/assets/index-CvPL7PjT.js @@ -1,4 +1,4 @@ -import{g as _N,o as Y_e,l as Z_e,e as qre,a as Q_e,b as J_e,w as eke,c as tke}from"./bridge-CYSxxzEK.js";function nke(e,t){for(var n=0;no[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&o(i)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function o(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();var p1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function g5(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function o(){return this instanceof o?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(o){var r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(n,o,r.get?r:{enumerable:!0,get:function(){return e[o]}})}),n}var iS={exports:{}},Og={},aS={exports:{}},Vn={};/** +import{g as _N,e as qre,o as Y_e,l as Z_e,a as Q_e,b as J_e,w as eke,c as tke}from"./bridge-CYSxxzEK.js";function nke(e,t){for(var n=0;no[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&o(i)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function o(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();var p1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function g5(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function o(){return this instanceof o?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(o){var r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(n,o,r.get?r:{enumerable:!0,get:function(){return e[o]}})}),n}var iS={exports:{}},Og={},aS={exports:{}},Vn={};/** * @license React * react.production.min.js * @@ -34,38 +34,38 @@ import{g as _N,o as Y_e,l as Z_e,e as qre,a as Q_e,b as J_e,w as eke,c as tke}fr `+V+O}var te=!1;function ee(O,w){if(!O||te)return"";te=!0;var q=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(w)if(w=function(){throw Error()},Object.defineProperty(w.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(w,[])}catch(Ge){var W=Ge}Reflect.construct(O,[],w)}else{try{w.call()}catch(Ge){W=Ge}O.call(w.prototype)}else{try{throw Error()}catch(Ge){W=Ge}O()}}catch(Ge){if(Ge&&W&&typeof Ge.stack=="string"){for(var D=Ge.stack.split(` `),K=W.stack.split(` `),le=D.length-1,Te=K.length-1;1<=le&&0<=Te&&D[le]!==K[Te];)Te--;for(;1<=le&&0<=Te;le--,Te--)if(D[le]!==K[Te]){if(le!==1||Te!==1)do if(le--,Te--,0>Te||D[le]!==K[Te]){var Le=` -`+D[le].replace(" at new "," at ");return O.displayName&&Le.includes("")&&(Le=Le.replace("",O.displayName)),Le}while(1<=le&&0<=Te);break}}}finally{te=!1,Error.prepareStackTrace=q}return(O=O?O.displayName||O.name:"")?Q(O):""}function ue(O){switch(O.tag){case 5:return Q(O.type);case 16:return Q("Lazy");case 13:return Q("Suspense");case 19:return Q("SuspenseList");case 0:case 2:case 15:return O=ee(O.type,!1),O;case 11:return O=ee(O.type.render,!1),O;case 1:return O=ee(O.type,!0),O;default:return""}}function ce(O){if(O==null)return null;if(typeof O=="function")return O.displayName||O.name||null;if(typeof O=="string")return O;switch(O){case S:return"Fragment";case k:return"Portal";case R:return"Profiler";case C:return"StrictMode";case N:return"Suspense";case j:return"SuspenseList"}if(typeof O=="object")switch(O.$$typeof){case E:return(O.displayName||"Context")+".Consumer";case T:return(O._context.displayName||"Context")+".Provider";case B:var w=O.render;return O=O.displayName,O||(O=w.displayName||w.name||"",O=O!==""?"ForwardRef("+O+")":"ForwardRef"),O;case I:return w=O.displayName||null,w!==null?w:ce(O.type)||"Memo";case P:w=O._payload,O=O._init;try{return ce(O(w))}catch{}}return null}function me(O){var w=O.type;switch(O.tag){case 24:return"Cache";case 9:return(w.displayName||"Context")+".Consumer";case 10:return(w._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return O=w.render,O=O.displayName||O.name||"",w.displayName||(O!==""?"ForwardRef("+O+")":"ForwardRef");case 7:return"Fragment";case 5:return w;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ce(w);case 8:return w===C?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof w=="function")return w.displayName||w.name||null;if(typeof w=="string")return w}return null}function de(O){switch(typeof O){case"boolean":case"number":case"string":case"undefined":return O;case"object":return O;default:return""}}function Ae(O){var w=O.type;return(O=O.nodeName)&&O.toLowerCase()==="input"&&(w==="checkbox"||w==="radio")}function ye(O){var w=Ae(O)?"checked":"value",q=Object.getOwnPropertyDescriptor(O.constructor.prototype,w),W=""+O[w];if(!O.hasOwnProperty(w)&&typeof q<"u"&&typeof q.get=="function"&&typeof q.set=="function"){var D=q.get,K=q.set;return Object.defineProperty(O,w,{configurable:!0,get:function(){return D.call(this)},set:function(le){W=""+le,K.call(this,le)}}),Object.defineProperty(O,w,{enumerable:q.enumerable}),{getValue:function(){return W},setValue:function(le){W=""+le},stopTracking:function(){O._valueTracker=null,delete O[w]}}}}function Ne(O){O._valueTracker||(O._valueTracker=ye(O))}function je(O){if(!O)return!1;var w=O._valueTracker;if(!w)return!0;var q=w.getValue(),W="";return O&&(W=Ae(O)?O.checked?"true":"false":O.value),O=W,O!==q?(w.setValue(O),!0):!1}function ie(O){if(O=O||(typeof document<"u"?document:void 0),typeof O>"u")return null;try{return O.activeElement||O.body}catch{return O.body}}function we(O,w){var q=w.checked;return Z({},w,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:q??O._wrapperState.initialChecked})}function re(O,w){var q=w.defaultValue==null?"":w.defaultValue,W=w.checked!=null?w.checked:w.defaultChecked;q=de(w.value!=null?w.value:q),O._wrapperState={initialChecked:W,initialValue:q,controlled:w.type==="checkbox"||w.type==="radio"?w.checked!=null:w.value!=null}}function pe(O,w){w=w.checked,w!=null&&v(O,"checked",w,!1)}function ke(O,w){pe(O,w);var q=de(w.value),W=w.type;if(q!=null)W==="number"?(q===0&&O.value===""||O.value!=q)&&(O.value=""+q):O.value!==""+q&&(O.value=""+q);else if(W==="submit"||W==="reset"){O.removeAttribute("value");return}w.hasOwnProperty("value")?se(O,w.type,q):w.hasOwnProperty("defaultValue")&&se(O,w.type,de(w.defaultValue)),w.checked==null&&w.defaultChecked!=null&&(O.defaultChecked=!!w.defaultChecked)}function Se(O,w,q){if(w.hasOwnProperty("value")||w.hasOwnProperty("defaultValue")){var W=w.type;if(!(W!=="submit"&&W!=="reset"||w.value!==void 0&&w.value!==null))return;w=""+O._wrapperState.initialValue,q||w===O.value||(O.value=w),O.defaultValue=w}q=O.name,q!==""&&(O.name=""),O.defaultChecked=!!O._wrapperState.initialChecked,q!==""&&(O.name=q)}function se(O,w,q){(w!=="number"||ie(O.ownerDocument)!==O)&&(q==null?O.defaultValue=""+O._wrapperState.initialValue:O.defaultValue!==""+q&&(O.defaultValue=""+q))}var L=Array.isArray;function U(O,w,q,W){if(O=O.options,w){w={};for(var D=0;D"+w.valueOf().toString()+"",w=wt.firstChild;O.firstChild;)O.removeChild(O.firstChild);for(;w.firstChild;)O.appendChild(w.firstChild)}});function ae(O,w){if(w){var q=O.firstChild;if(q&&q===O.lastChild&&q.nodeType===3){q.nodeValue=w;return}}O.textContent=w}var H={animationIterationCount:!0,aspectRatio:!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,gridArea:!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},Y=["Webkit","ms","Moz","O"];Object.keys(H).forEach(function(O){Y.forEach(function(w){w=w+O.charAt(0).toUpperCase()+O.substring(1),H[w]=H[O]})});function fe(O,w,q){return w==null||typeof w=="boolean"||w===""?"":q||typeof w!="number"||w===0||H.hasOwnProperty(O)&&H[O]?(""+w).trim():w+"px"}function Re(O,w){O=O.style;for(var q in w)if(w.hasOwnProperty(q)){var W=q.indexOf("--")===0,D=fe(q,w[q],W);q==="float"&&(q="cssFloat"),W?O.setProperty(q,D):O[q]=D}}var be=Z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ze(O,w){if(w){if(be[O]&&(w.children!=null||w.dangerouslySetInnerHTML!=null))throw Error(n(137,O));if(w.dangerouslySetInnerHTML!=null){if(w.children!=null)throw Error(n(60));if(typeof w.dangerouslySetInnerHTML!="object"||!("__html"in w.dangerouslySetInnerHTML))throw Error(n(61))}if(w.style!=null&&typeof w.style!="object")throw Error(n(62))}}function nt(O,w){if(O.indexOf("-")===-1)return typeof w.is=="string";switch(O){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Mt=null;function ot(O){return O=O.target||O.srcElement||window,O.correspondingUseElement&&(O=O.correspondingUseElement),O.nodeType===3?O.parentNode:O}var Ue=null,yt=null,fn=null;function Ln(O){if(O=sg(O)){if(typeof Ue!="function")throw Error(n(280));var w=O.stateNode;w&&(w=hy(w),Ue(O.stateNode,O.type,w))}}function Mo(O){yt?fn?fn.push(O):fn=[O]:yt=O}function rr(){if(yt){var O=yt,w=fn;if(fn=yt=null,Ln(O),w)for(O=0;O>>=0,O===0?32:31-(mp(O)/gp|0)|0}var Mp=64,Dc=4194304;function Ea(O){switch(O&-O){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return O&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return O&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return O}}function Dm(O,w){var q=O.pendingLanes;if(q===0)return 0;var W=0,D=O.suspendedLanes,K=O.pingedLanes,le=q&268435455;if(le!==0){var Te=le&~D;Te!==0?W=Ea(Te):(K&=le,K!==0&&(W=Ea(K)))}else le=q&~D,le!==0?W=Ea(le):K!==0&&(W=Ea(K));if(W===0)return 0;if(w!==0&&w!==W&&!(w&D)&&(D=W&-W,K=w&-w,D>=K||D===16&&(K&4194240)!==0))return w;if(W&4&&(W|=q&16),w=O.entangledLanes,w!==0)for(O=O.entanglements,w&=W;0q;q++)w.push(O);return w}function Fm(O,w,q){O.pendingLanes|=w,w!==536870912&&(O.suspendedLanes=0,O.pingedLanes=0),O=O.eventTimes,w=31-I0(w),O[w]=q}function gwe(O,w){var q=O.pendingLanes&~w;O.pendingLanes=w,O.suspendedLanes=0,O.pingedLanes=0,O.expiredLanes&=w,O.mutableReadLanes&=w,O.entangledLanes&=w,w=O.entanglements;var W=O.eventTimes;for(O=O.expirationTimes;0=Ym),jF=" ",IF=!1;function DF(O,w){switch(O){case"keyup":return Hwe.indexOf(w.keyCode)!==-1;case"keydown":return w.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function FF(O){return O=O.detail,typeof O=="object"&&"data"in O?O.data:null}var yb=!1;function Xwe(O,w){switch(O){case"compositionend":return FF(w);case"keypress":return w.which!==32?null:(IF=!0,jF);case"textInput":return O=w.data,O===jF&&IF?null:O;default:return null}}function Gwe(O,w){if(yb)return O==="compositionend"||!Ik&&DF(O,w)?(O=EF(),ry=Wk=bu=null,yb=!1,O):null;switch(O){case"paste":return null;case"keypress":if(!(w.ctrlKey||w.altKey||w.metaKey)||w.ctrlKey&&w.altKey){if(w.char&&1=w)return{node:q,offset:w-O};O=W}e:{for(;q;){if(q.nextSibling){q=q.nextSibling;break e}q=q.parentNode}q=void 0}q=KF(q)}}function ZF(O,w){return O&&w?O===w?!0:O&&O.nodeType===3?!1:w&&w.nodeType===3?ZF(O,w.parentNode):"contains"in O?O.contains(w):O.compareDocumentPosition?!!(O.compareDocumentPosition(w)&16):!1:!1}function QF(){for(var O=window,w=ie();w instanceof O.HTMLIFrameElement;){try{var q=typeof w.contentWindow.location.href=="string"}catch{q=!1}if(q)O=w.contentWindow;else break;w=ie(O.document)}return w}function $k(O){var w=O&&O.nodeName&&O.nodeName.toLowerCase();return w&&(w==="input"&&(O.type==="text"||O.type==="search"||O.type==="tel"||O.type==="url"||O.type==="password")||w==="textarea"||O.contentEditable==="true")}function o_e(O){var w=QF(),q=O.focusedElem,W=O.selectionRange;if(w!==q&&q&&q.ownerDocument&&ZF(q.ownerDocument.documentElement,q)){if(W!==null&&$k(q)){if(w=W.start,O=W.end,O===void 0&&(O=w),"selectionStart"in q)q.selectionStart=w,q.selectionEnd=Math.min(O,q.value.length);else if(O=(w=q.ownerDocument||document)&&w.defaultView||window,O.getSelection){O=O.getSelection();var D=q.textContent.length,K=Math.min(W.start,D);W=W.end===void 0?K:Math.min(W.end,D),!O.extend&&K>W&&(D=W,W=K,K=D),D=YF(q,K);var le=YF(q,W);D&&le&&(O.rangeCount!==1||O.anchorNode!==D.node||O.anchorOffset!==D.offset||O.focusNode!==le.node||O.focusOffset!==le.offset)&&(w=w.createRange(),w.setStart(D.node,D.offset),O.removeAllRanges(),K>W?(O.addRange(w),O.extend(le.node,le.offset)):(w.setEnd(le.node,le.offset),O.addRange(w)))}}for(w=[],O=q;O=O.parentNode;)O.nodeType===1&&w.push({element:O,left:O.scrollLeft,top:O.scrollTop});for(typeof q.focus=="function"&&q.focus(),q=0;q=document.documentMode,Ab=null,Vk=null,eg=null,Hk=!1;function JF(O,w,q){var W=q.window===q?q.document:q.nodeType===9?q:q.ownerDocument;Hk||Ab==null||Ab!==ie(W)||(W=Ab,"selectionStart"in W&&$k(W)?W={start:W.selectionStart,end:W.selectionEnd}:(W=(W.ownerDocument&&W.ownerDocument.defaultView||window).getSelection(),W={anchorNode:W.anchorNode,anchorOffset:W.anchorOffset,focusNode:W.focusNode,focusOffset:W.focusOffset}),eg&&Jm(eg,W)||(eg=W,W=py(Vk,"onSelect"),0kb||(O.current=o6[kb],o6[kb]=null,kb--)}function er(O,w){kb++,o6[kb]=O.current,O.current=w}var Mu={},r1=gu(Mu),K1=gu(!1),Op=Mu;function Sb(O,w){var q=O.type.contextTypes;if(!q)return Mu;var W=O.stateNode;if(W&&W.__reactInternalMemoizedUnmaskedChildContext===w)return W.__reactInternalMemoizedMaskedChildContext;var D={},K;for(K in q)D[K]=w[K];return W&&(O=O.stateNode,O.__reactInternalMemoizedUnmaskedChildContext=w,O.__reactInternalMemoizedMaskedChildContext=D),D}function Y1(O){return O=O.childContextTypes,O!=null}function my(){ir(K1),ir(r1)}function b$(O,w,q){if(r1.current!==Mu)throw Error(n(168));er(r1,w),er(K1,q)}function h$(O,w,q){var W=O.stateNode;if(w=w.childContextTypes,typeof W.getChildContext!="function")return q;W=W.getChildContext();for(var D in W)if(!(D in w))throw Error(n(108,me(O)||"Unknown",D));return Z({},q,W)}function gy(O){return O=(O=O.stateNode)&&O.__reactInternalMemoizedMergedChildContext||Mu,Op=r1.current,er(r1,O),er(K1,K1.current),!0}function m$(O,w,q){var W=O.stateNode;if(!W)throw Error(n(169));q?(O=h$(O,w,Op),W.__reactInternalMemoizedMergedChildContext=O,ir(K1),ir(r1),er(r1,O)):ir(K1),er(K1,q)}var $c=null,My=!1,r6=!1;function g$(O){$c===null?$c=[O]:$c.push(O)}function h_e(O){My=!0,g$(O)}function zu(){if(!r6&&$c!==null){r6=!0;var O=0,w=Eo;try{var q=$c;for(Eo=1;O>=le,D-=le,Vc=1<<32-I0(w)+D|q<yn?(v0=ln,ln=null):v0=ln.sibling;var po=st(Fe,ln,Ve[yn],ft);if(po===null){ln===null&&(ln=v0);break}O&&ln&&po.alternate===null&&w(Fe,ln),De=K(po,De,yn),cn===null?Kt=po:cn.sibling=po,cn=po,ln=v0}if(yn===Ve.length)return q(Fe,ln),fr&&Ap(Fe,yn),Kt;if(ln===null){for(;ynyn?(v0=ln,ln=null):v0=ln.sibling;var Su=st(Fe,ln,po.value,ft);if(Su===null){ln===null&&(ln=v0);break}O&&ln&&Su.alternate===null&&w(Fe,ln),De=K(Su,De,yn),cn===null?Kt=Su:cn.sibling=Su,cn=Su,ln=v0}if(po.done)return q(Fe,ln),fr&&Ap(Fe,yn),Kt;if(ln===null){for(;!po.done;yn++,po=Ve.next())po=ut(Fe,po.value,ft),po!==null&&(De=K(po,De,yn),cn===null?Kt=po:cn.sibling=po,cn=po);return fr&&Ap(Fe,yn),Kt}for(ln=W(Fe,ln);!po.done;yn++,po=Ve.next())po=Wt(ln,Fe,yn,po.value,ft),po!==null&&(O&&po.alternate!==null&&ln.delete(po.key===null?yn:po.key),De=K(po,De,yn),cn===null?Kt=po:cn.sibling=po,cn=po);return O&&ln.forEach(function(K_e){return w(Fe,K_e)}),fr&&Ap(Fe,yn),Kt}function Vr(Fe,De,Ve,ft){if(typeof Ve=="object"&&Ve!==null&&Ve.type===S&&Ve.key===null&&(Ve=Ve.props.children),typeof Ve=="object"&&Ve!==null){switch(Ve.$$typeof){case y:e:{for(var Kt=Ve.key,cn=De;cn!==null;){if(cn.key===Kt){if(Kt=Ve.type,Kt===S){if(cn.tag===7){q(Fe,cn.sibling),De=D(cn,Ve.props.children),De.return=Fe,Fe=De;break e}}else if(cn.elementType===Kt||typeof Kt=="object"&&Kt!==null&&Kt.$$typeof===P&&v$(Kt)===cn.type){q(Fe,cn.sibling),De=D(cn,Ve.props),De.ref=ig(Fe,cn,Ve),De.return=Fe,Fe=De;break e}q(Fe,cn);break}else w(Fe,cn);cn=cn.sibling}Ve.type===S?(De=qp(Ve.props.children,Fe.mode,ft,Ve.key),De.return=Fe,Fe=De):(ft=Uy(Ve.type,Ve.key,Ve.props,null,Fe.mode,ft),ft.ref=ig(Fe,De,Ve),ft.return=Fe,Fe=ft)}return le(Fe);case k:e:{for(cn=Ve.key;De!==null;){if(De.key===cn)if(De.tag===4&&De.stateNode.containerInfo===Ve.containerInfo&&De.stateNode.implementation===Ve.implementation){q(Fe,De.sibling),De=D(De,Ve.children||[]),De.return=Fe,Fe=De;break e}else{q(Fe,De);break}else w(Fe,De);De=De.sibling}De=tS(Ve,Fe.mode,ft),De.return=Fe,Fe=De}return le(Fe);case P:return cn=Ve._init,Vr(Fe,De,cn(Ve._payload),ft)}if(L(Ve))return $t(Fe,De,Ve,ft);if(X(Ve))return Ut(Fe,De,Ve,ft);Ay(Fe,Ve)}return typeof Ve=="string"&&Ve!==""||typeof Ve=="number"?(Ve=""+Ve,De!==null&&De.tag===6?(q(Fe,De.sibling),De=D(De,Ve),De.return=Fe,Fe=De):(q(Fe,De),De=eS(Ve,Fe.mode,ft),De.return=Fe,Fe=De),le(Fe)):q(Fe,De)}return Vr}var Tb=x$(!0),w$=x$(!1),vy=gu(null),xy=null,Eb=null,u6=null;function d6(){u6=Eb=xy=null}function p6(O){var w=vy.current;ir(vy),O._currentValue=w}function f6(O,w,q){for(;O!==null;){var W=O.alternate;if((O.childLanes&w)!==w?(O.childLanes|=w,W!==null&&(W.childLanes|=w)):W!==null&&(W.childLanes&w)!==w&&(W.childLanes|=w),O===q)break;O=O.return}}function Wb(O,w){xy=O,u6=Eb=null,O=O.dependencies,O!==null&&O.firstContext!==null&&(O.lanes&w&&(Z1=!0),O.firstContext=null)}function oi(O){var w=O._currentValue;if(u6!==O)if(O={context:O,memoizedValue:w,next:null},Eb===null){if(xy===null)throw Error(n(308));Eb=O,xy.dependencies={lanes:0,firstContext:O}}else Eb=Eb.next=O;return w}var vp=null;function b6(O){vp===null?vp=[O]:vp.push(O)}function _$(O,w,q,W){var D=w.interleaved;return D===null?(q.next=q,b6(w)):(q.next=D.next,D.next=q),w.interleaved=q,Uc(O,W)}function Uc(O,w){O.lanes|=w;var q=O.alternate;for(q!==null&&(q.lanes|=w),q=O,O=O.return;O!==null;)O.childLanes|=w,q=O.alternate,q!==null&&(q.childLanes|=w),q=O,O=O.return;return q.tag===3?q.stateNode:null}var Ou=!1;function h6(O){O.updateQueue={baseState:O.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function k$(O,w){O=O.updateQueue,w.updateQueue===O&&(w.updateQueue={baseState:O.baseState,firstBaseUpdate:O.firstBaseUpdate,lastBaseUpdate:O.lastBaseUpdate,shared:O.shared,effects:O.effects})}function Xc(O,w){return{eventTime:O,lane:w,tag:0,payload:null,callback:null,next:null}}function yu(O,w,q){var W=O.updateQueue;if(W===null)return null;if(W=W.shared,co&2){var D=W.pending;return D===null?w.next=w:(w.next=D.next,D.next=w),W.pending=w,Uc(O,q)}return D=W.interleaved,D===null?(w.next=w,b6(W)):(w.next=D.next,D.next=w),W.interleaved=w,Uc(O,q)}function wy(O,w,q){if(w=w.updateQueue,w!==null&&(w=w.shared,(q&4194240)!==0)){var W=w.lanes;W&=O.pendingLanes,q|=W,w.lanes=q,Ck(O,q)}}function S$(O,w){var q=O.updateQueue,W=O.alternate;if(W!==null&&(W=W.updateQueue,q===W)){var D=null,K=null;if(q=q.firstBaseUpdate,q!==null){do{var le={eventTime:q.eventTime,lane:q.lane,tag:q.tag,payload:q.payload,callback:q.callback,next:null};K===null?D=K=le:K=K.next=le,q=q.next}while(q!==null);K===null?D=K=w:K=K.next=w}else D=K=w;q={baseState:W.baseState,firstBaseUpdate:D,lastBaseUpdate:K,shared:W.shared,effects:W.effects},O.updateQueue=q;return}O=q.lastBaseUpdate,O===null?q.firstBaseUpdate=w:O.next=w,q.lastBaseUpdate=w}function _y(O,w,q,W){var D=O.updateQueue;Ou=!1;var K=D.firstBaseUpdate,le=D.lastBaseUpdate,Te=D.shared.pending;if(Te!==null){D.shared.pending=null;var Le=Te,Ge=Le.next;Le.next=null,le===null?K=Ge:le.next=Ge,le=Le;var at=O.alternate;at!==null&&(at=at.updateQueue,Te=at.lastBaseUpdate,Te!==le&&(Te===null?at.firstBaseUpdate=Ge:Te.next=Ge,at.lastBaseUpdate=Le))}if(K!==null){var ut=D.baseState;le=0,at=Ge=Le=null,Te=K;do{var st=Te.lane,Wt=Te.eventTime;if((W&st)===st){at!==null&&(at=at.next={eventTime:Wt,lane:0,tag:Te.tag,payload:Te.payload,callback:Te.callback,next:null});e:{var $t=O,Ut=Te;switch(st=w,Wt=q,Ut.tag){case 1:if($t=Ut.payload,typeof $t=="function"){ut=$t.call(Wt,ut,st);break e}ut=$t;break e;case 3:$t.flags=$t.flags&-65537|128;case 0:if($t=Ut.payload,st=typeof $t=="function"?$t.call(Wt,ut,st):$t,st==null)break e;ut=Z({},ut,st);break e;case 2:Ou=!0}}Te.callback!==null&&Te.lane!==0&&(O.flags|=64,st=D.effects,st===null?D.effects=[Te]:st.push(Te))}else Wt={eventTime:Wt,lane:st,tag:Te.tag,payload:Te.payload,callback:Te.callback,next:null},at===null?(Ge=at=Wt,Le=ut):at=at.next=Wt,le|=st;if(Te=Te.next,Te===null){if(Te=D.shared.pending,Te===null)break;st=Te,Te=st.next,st.next=null,D.lastBaseUpdate=st,D.shared.pending=null}}while(!0);if(at===null&&(Le=ut),D.baseState=Le,D.firstBaseUpdate=Ge,D.lastBaseUpdate=at,w=D.shared.interleaved,w!==null){D=w;do le|=D.lane,D=D.next;while(D!==w)}else K===null&&(D.shared.lanes=0);_p|=le,O.lanes=le,O.memoizedState=ut}}function C$(O,w,q){if(O=w.effects,w.effects=null,O!==null)for(w=0;wq?q:4,O(!0);var W=O6.transition;O6.transition={};try{O(!1),w()}finally{Eo=q,O6.transition=W}}function G$(){return ri().memoizedState}function z_e(O,w,q){var W=wu(O);if(q={lane:W,action:q,hasEagerState:!1,eagerState:null,next:null},K$(O))Y$(w,q);else if(q=_$(O,w,q,W),q!==null){var D=N1();Ji(q,O,W,D),Z$(q,w,W)}}function O_e(O,w,q){var W=wu(O),D={lane:W,action:q,hasEagerState:!1,eagerState:null,next:null};if(K$(O))Y$(w,D);else{var K=O.alternate;if(O.lanes===0&&(K===null||K.lanes===0)&&(K=w.lastRenderedReducer,K!==null))try{var le=w.lastRenderedState,Te=K(le,q);if(D.hasEagerState=!0,D.eagerState=Te,Gi(Te,le)){var Le=w.interleaved;Le===null?(D.next=D,b6(w)):(D.next=Le.next,Le.next=D),w.interleaved=D;return}}catch{}finally{}q=_$(O,w,D,W),q!==null&&(D=N1(),Ji(q,O,W,D),Z$(q,w,W))}}function K$(O){var w=O.alternate;return O===wr||w!==null&&w===wr}function Y$(O,w){ug=Cy=!0;var q=O.pending;q===null?w.next=w:(w.next=q.next,q.next=w),O.pending=w}function Z$(O,w,q){if(q&4194240){var W=w.lanes;W&=O.pendingLanes,q|=W,w.lanes=q,Ck(O,q)}}var Ty={readContext:oi,useCallback:s1,useContext:s1,useEffect:s1,useImperativeHandle:s1,useInsertionEffect:s1,useLayoutEffect:s1,useMemo:s1,useReducer:s1,useRef:s1,useState:s1,useDebugValue:s1,useDeferredValue:s1,useTransition:s1,useMutableSource:s1,useSyncExternalStore:s1,useId:s1,unstable_isNewReconciler:!1},y_e={readContext:oi,useCallback:function(O,w){return Ba().memoizedState=[O,w===void 0?null:w],O},useContext:oi,useEffect:I$,useImperativeHandle:function(O,w,q){return q=q!=null?q.concat([O]):null,qy(4194308,4,$$.bind(null,w,O),q)},useLayoutEffect:function(O,w){return qy(4194308,4,O,w)},useInsertionEffect:function(O,w){return qy(4,2,O,w)},useMemo:function(O,w){var q=Ba();return w=w===void 0?null:w,O=O(),q.memoizedState=[O,w],O},useReducer:function(O,w,q){var W=Ba();return w=q!==void 0?q(w):w,W.memoizedState=W.baseState=w,O={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:O,lastRenderedState:w},W.queue=O,O=O.dispatch=z_e.bind(null,wr,O),[W.memoizedState,O]},useRef:function(O){var w=Ba();return O={current:O},w.memoizedState=O},useState:P$,useDebugValue:k6,useDeferredValue:function(O){return Ba().memoizedState=O},useTransition:function(){var O=P$(!1),w=O[0];return O=M_e.bind(null,O[1]),Ba().memoizedState=O,[w,O]},useMutableSource:function(){},useSyncExternalStore:function(O,w,q){var W=wr,D=Ba();if(fr){if(q===void 0)throw Error(n(407));q=q()}else{if(q=w(),A0===null)throw Error(n(349));wp&30||E$(W,w,q)}D.memoizedState=q;var K={value:q,getSnapshot:w};return D.queue=K,I$(N$.bind(null,W,K,O),[O]),W.flags|=2048,fg(9,W$.bind(null,W,K,q,w),void 0,null),q},useId:function(){var O=Ba(),w=A0.identifierPrefix;if(fr){var q=Hc,W=Vc;q=(W&~(1<<32-I0(W)-1)).toString(32)+q,w=":"+w+"R"+q,q=dg++,0")&&(Le=Le.replace("",O.displayName)),Le}while(1<=le&&0<=Te);break}}}finally{te=!1,Error.prepareStackTrace=q}return(O=O?O.displayName||O.name:"")?Q(O):""}function ue(O){switch(O.tag){case 5:return Q(O.type);case 16:return Q("Lazy");case 13:return Q("Suspense");case 19:return Q("SuspenseList");case 0:case 2:case 15:return O=ee(O.type,!1),O;case 11:return O=ee(O.type.render,!1),O;case 1:return O=ee(O.type,!0),O;default:return""}}function ce(O){if(O==null)return null;if(typeof O=="function")return O.displayName||O.name||null;if(typeof O=="string")return O;switch(O){case S:return"Fragment";case k:return"Portal";case R:return"Profiler";case C:return"StrictMode";case N:return"Suspense";case j:return"SuspenseList"}if(typeof O=="object")switch(O.$$typeof){case E:return(O.displayName||"Context")+".Consumer";case T:return(O._context.displayName||"Context")+".Provider";case B:var w=O.render;return O=O.displayName,O||(O=w.displayName||w.name||"",O=O!==""?"ForwardRef("+O+")":"ForwardRef"),O;case I:return w=O.displayName||null,w!==null?w:ce(O.type)||"Memo";case P:w=O._payload,O=O._init;try{return ce(O(w))}catch{}}return null}function me(O){var w=O.type;switch(O.tag){case 24:return"Cache";case 9:return(w.displayName||"Context")+".Consumer";case 10:return(w._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return O=w.render,O=O.displayName||O.name||"",w.displayName||(O!==""?"ForwardRef("+O+")":"ForwardRef");case 7:return"Fragment";case 5:return w;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ce(w);case 8:return w===C?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof w=="function")return w.displayName||w.name||null;if(typeof w=="string")return w}return null}function de(O){switch(typeof O){case"boolean":case"number":case"string":case"undefined":return O;case"object":return O;default:return""}}function Ae(O){var w=O.type;return(O=O.nodeName)&&O.toLowerCase()==="input"&&(w==="checkbox"||w==="radio")}function ye(O){var w=Ae(O)?"checked":"value",q=Object.getOwnPropertyDescriptor(O.constructor.prototype,w),W=""+O[w];if(!O.hasOwnProperty(w)&&typeof q<"u"&&typeof q.get=="function"&&typeof q.set=="function"){var D=q.get,K=q.set;return Object.defineProperty(O,w,{configurable:!0,get:function(){return D.call(this)},set:function(le){W=""+le,K.call(this,le)}}),Object.defineProperty(O,w,{enumerable:q.enumerable}),{getValue:function(){return W},setValue:function(le){W=""+le},stopTracking:function(){O._valueTracker=null,delete O[w]}}}}function Ne(O){O._valueTracker||(O._valueTracker=ye(O))}function je(O){if(!O)return!1;var w=O._valueTracker;if(!w)return!0;var q=w.getValue(),W="";return O&&(W=Ae(O)?O.checked?"true":"false":O.value),O=W,O!==q?(w.setValue(O),!0):!1}function ie(O){if(O=O||(typeof document<"u"?document:void 0),typeof O>"u")return null;try{return O.activeElement||O.body}catch{return O.body}}function we(O,w){var q=w.checked;return Z({},w,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:q??O._wrapperState.initialChecked})}function re(O,w){var q=w.defaultValue==null?"":w.defaultValue,W=w.checked!=null?w.checked:w.defaultChecked;q=de(w.value!=null?w.value:q),O._wrapperState={initialChecked:W,initialValue:q,controlled:w.type==="checkbox"||w.type==="radio"?w.checked!=null:w.value!=null}}function pe(O,w){w=w.checked,w!=null&&v(O,"checked",w,!1)}function ke(O,w){pe(O,w);var q=de(w.value),W=w.type;if(q!=null)W==="number"?(q===0&&O.value===""||O.value!=q)&&(O.value=""+q):O.value!==""+q&&(O.value=""+q);else if(W==="submit"||W==="reset"){O.removeAttribute("value");return}w.hasOwnProperty("value")?se(O,w.type,q):w.hasOwnProperty("defaultValue")&&se(O,w.type,de(w.defaultValue)),w.checked==null&&w.defaultChecked!=null&&(O.defaultChecked=!!w.defaultChecked)}function Se(O,w,q){if(w.hasOwnProperty("value")||w.hasOwnProperty("defaultValue")){var W=w.type;if(!(W!=="submit"&&W!=="reset"||w.value!==void 0&&w.value!==null))return;w=""+O._wrapperState.initialValue,q||w===O.value||(O.value=w),O.defaultValue=w}q=O.name,q!==""&&(O.name=""),O.defaultChecked=!!O._wrapperState.initialChecked,q!==""&&(O.name=q)}function se(O,w,q){(w!=="number"||ie(O.ownerDocument)!==O)&&(q==null?O.defaultValue=""+O._wrapperState.initialValue:O.defaultValue!==""+q&&(O.defaultValue=""+q))}var L=Array.isArray;function U(O,w,q,W){if(O=O.options,w){w={};for(var D=0;D"+w.valueOf().toString()+"",w=wt.firstChild;O.firstChild;)O.removeChild(O.firstChild);for(;w.firstChild;)O.appendChild(w.firstChild)}});function ae(O,w){if(w){var q=O.firstChild;if(q&&q===O.lastChild&&q.nodeType===3){q.nodeValue=w;return}}O.textContent=w}var H={animationIterationCount:!0,aspectRatio:!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,gridArea:!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},Y=["Webkit","ms","Moz","O"];Object.keys(H).forEach(function(O){Y.forEach(function(w){w=w+O.charAt(0).toUpperCase()+O.substring(1),H[w]=H[O]})});function fe(O,w,q){return w==null||typeof w=="boolean"||w===""?"":q||typeof w!="number"||w===0||H.hasOwnProperty(O)&&H[O]?(""+w).trim():w+"px"}function Re(O,w){O=O.style;for(var q in w)if(w.hasOwnProperty(q)){var W=q.indexOf("--")===0,D=fe(q,w[q],W);q==="float"&&(q="cssFloat"),W?O.setProperty(q,D):O[q]=D}}var be=Z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ze(O,w){if(w){if(be[O]&&(w.children!=null||w.dangerouslySetInnerHTML!=null))throw Error(n(137,O));if(w.dangerouslySetInnerHTML!=null){if(w.children!=null)throw Error(n(60));if(typeof w.dangerouslySetInnerHTML!="object"||!("__html"in w.dangerouslySetInnerHTML))throw Error(n(61))}if(w.style!=null&&typeof w.style!="object")throw Error(n(62))}}function nt(O,w){if(O.indexOf("-")===-1)return typeof w.is=="string";switch(O){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Mt=null;function ot(O){return O=O.target||O.srcElement||window,O.correspondingUseElement&&(O=O.correspondingUseElement),O.nodeType===3?O.parentNode:O}var Ue=null,yt=null,fn=null;function Ln(O){if(O=sg(O)){if(typeof Ue!="function")throw Error(n(280));var w=O.stateNode;w&&(w=hy(w),Ue(O.stateNode,O.type,w))}}function Mo(O){yt?fn?fn.push(O):fn=[O]:yt=O}function rr(){if(yt){var O=yt,w=fn;if(fn=yt=null,Ln(O),w)for(O=0;O>>=0,O===0?32:31-(mp(O)/gp|0)|0}var Mp=64,Dc=4194304;function Ea(O){switch(O&-O){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return O&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return O&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return O}}function Dm(O,w){var q=O.pendingLanes;if(q===0)return 0;var W=0,D=O.suspendedLanes,K=O.pingedLanes,le=q&268435455;if(le!==0){var Te=le&~D;Te!==0?W=Ea(Te):(K&=le,K!==0&&(W=Ea(K)))}else le=q&~D,le!==0?W=Ea(le):K!==0&&(W=Ea(K));if(W===0)return 0;if(w!==0&&w!==W&&!(w&D)&&(D=W&-W,K=w&-w,D>=K||D===16&&(K&4194240)!==0))return w;if(W&4&&(W|=q&16),w=O.entangledLanes,w!==0)for(O=O.entanglements,w&=W;0q;q++)w.push(O);return w}function Fm(O,w,q){O.pendingLanes|=w,w!==536870912&&(O.suspendedLanes=0,O.pingedLanes=0),O=O.eventTimes,w=31-I0(w),O[w]=q}function gwe(O,w){var q=O.pendingLanes&~w;O.pendingLanes=w,O.suspendedLanes=0,O.pingedLanes=0,O.expiredLanes&=w,O.mutableReadLanes&=w,O.entangledLanes&=w,w=O.entanglements;var W=O.eventTimes;for(O=O.expirationTimes;0=Ym),jF=" ",IF=!1;function DF(O,w){switch(O){case"keyup":return Hwe.indexOf(w.keyCode)!==-1;case"keydown":return w.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function FF(O){return O=O.detail,typeof O=="object"&&"data"in O?O.data:null}var yb=!1;function Xwe(O,w){switch(O){case"compositionend":return FF(w);case"keypress":return w.which!==32?null:(IF=!0,jF);case"textInput":return O=w.data,O===jF&&IF?null:O;default:return null}}function Gwe(O,w){if(yb)return O==="compositionend"||!Ik&&DF(O,w)?(O=EF(),ry=Wk=bu=null,yb=!1,O):null;switch(O){case"paste":return null;case"keypress":if(!(w.ctrlKey||w.altKey||w.metaKey)||w.ctrlKey&&w.altKey){if(w.char&&1=w)return{node:q,offset:w-O};O=W}e:{for(;q;){if(q.nextSibling){q=q.nextSibling;break e}q=q.parentNode}q=void 0}q=KF(q)}}function ZF(O,w){return O&&w?O===w?!0:O&&O.nodeType===3?!1:w&&w.nodeType===3?ZF(O,w.parentNode):"contains"in O?O.contains(w):O.compareDocumentPosition?!!(O.compareDocumentPosition(w)&16):!1:!1}function QF(){for(var O=window,w=ie();w instanceof O.HTMLIFrameElement;){try{var q=typeof w.contentWindow.location.href=="string"}catch{q=!1}if(q)O=w.contentWindow;else break;w=ie(O.document)}return w}function $k(O){var w=O&&O.nodeName&&O.nodeName.toLowerCase();return w&&(w==="input"&&(O.type==="text"||O.type==="search"||O.type==="tel"||O.type==="url"||O.type==="password")||w==="textarea"||O.contentEditable==="true")}function o_e(O){var w=QF(),q=O.focusedElem,W=O.selectionRange;if(w!==q&&q&&q.ownerDocument&&ZF(q.ownerDocument.documentElement,q)){if(W!==null&&$k(q)){if(w=W.start,O=W.end,O===void 0&&(O=w),"selectionStart"in q)q.selectionStart=w,q.selectionEnd=Math.min(O,q.value.length);else if(O=(w=q.ownerDocument||document)&&w.defaultView||window,O.getSelection){O=O.getSelection();var D=q.textContent.length,K=Math.min(W.start,D);W=W.end===void 0?K:Math.min(W.end,D),!O.extend&&K>W&&(D=W,W=K,K=D),D=YF(q,K);var le=YF(q,W);D&&le&&(O.rangeCount!==1||O.anchorNode!==D.node||O.anchorOffset!==D.offset||O.focusNode!==le.node||O.focusOffset!==le.offset)&&(w=w.createRange(),w.setStart(D.node,D.offset),O.removeAllRanges(),K>W?(O.addRange(w),O.extend(le.node,le.offset)):(w.setEnd(le.node,le.offset),O.addRange(w)))}}for(w=[],O=q;O=O.parentNode;)O.nodeType===1&&w.push({element:O,left:O.scrollLeft,top:O.scrollTop});for(typeof q.focus=="function"&&q.focus(),q=0;q=document.documentMode,Ab=null,Vk=null,eg=null,Hk=!1;function JF(O,w,q){var W=q.window===q?q.document:q.nodeType===9?q:q.ownerDocument;Hk||Ab==null||Ab!==ie(W)||(W=Ab,"selectionStart"in W&&$k(W)?W={start:W.selectionStart,end:W.selectionEnd}:(W=(W.ownerDocument&&W.ownerDocument.defaultView||window).getSelection(),W={anchorNode:W.anchorNode,anchorOffset:W.anchorOffset,focusNode:W.focusNode,focusOffset:W.focusOffset}),eg&&Jm(eg,W)||(eg=W,W=py(Vk,"onSelect"),0kb||(O.current=o6[kb],o6[kb]=null,kb--)}function er(O,w){kb++,o6[kb]=O.current,O.current=w}var Mu={},r1=gu(Mu),K1=gu(!1),Op=Mu;function Sb(O,w){var q=O.type.contextTypes;if(!q)return Mu;var W=O.stateNode;if(W&&W.__reactInternalMemoizedUnmaskedChildContext===w)return W.__reactInternalMemoizedMaskedChildContext;var D={},K;for(K in q)D[K]=w[K];return W&&(O=O.stateNode,O.__reactInternalMemoizedUnmaskedChildContext=w,O.__reactInternalMemoizedMaskedChildContext=D),D}function Y1(O){return O=O.childContextTypes,O!=null}function my(){ir(K1),ir(r1)}function b$(O,w,q){if(r1.current!==Mu)throw Error(n(168));er(r1,w),er(K1,q)}function h$(O,w,q){var W=O.stateNode;if(w=w.childContextTypes,typeof W.getChildContext!="function")return q;W=W.getChildContext();for(var D in W)if(!(D in w))throw Error(n(108,me(O)||"Unknown",D));return Z({},q,W)}function gy(O){return O=(O=O.stateNode)&&O.__reactInternalMemoizedMergedChildContext||Mu,Op=r1.current,er(r1,O),er(K1,K1.current),!0}function m$(O,w,q){var W=O.stateNode;if(!W)throw Error(n(169));q?(O=h$(O,w,Op),W.__reactInternalMemoizedMergedChildContext=O,ir(K1),ir(r1),er(r1,O)):ir(K1),er(K1,q)}var $c=null,My=!1,r6=!1;function g$(O){$c===null?$c=[O]:$c.push(O)}function h_e(O){My=!0,g$(O)}function zu(){if(!r6&&$c!==null){r6=!0;var O=0,w=Eo;try{var q=$c;for(Eo=1;O>=le,D-=le,Vc=1<<32-I0(w)+D|q<yn?(v0=ln,ln=null):v0=ln.sibling;var po=st(Fe,ln,Ve[yn],ft);if(po===null){ln===null&&(ln=v0);break}O&&ln&&po.alternate===null&&w(Fe,ln),De=K(po,De,yn),cn===null?Kt=po:cn.sibling=po,cn=po,ln=v0}if(yn===Ve.length)return q(Fe,ln),fr&&Ap(Fe,yn),Kt;if(ln===null){for(;ynyn?(v0=ln,ln=null):v0=ln.sibling;var Su=st(Fe,ln,po.value,ft);if(Su===null){ln===null&&(ln=v0);break}O&&ln&&Su.alternate===null&&w(Fe,ln),De=K(Su,De,yn),cn===null?Kt=Su:cn.sibling=Su,cn=Su,ln=v0}if(po.done)return q(Fe,ln),fr&&Ap(Fe,yn),Kt;if(ln===null){for(;!po.done;yn++,po=Ve.next())po=ut(Fe,po.value,ft),po!==null&&(De=K(po,De,yn),cn===null?Kt=po:cn.sibling=po,cn=po);return fr&&Ap(Fe,yn),Kt}for(ln=W(Fe,ln);!po.done;yn++,po=Ve.next())po=Et(ln,Fe,yn,po.value,ft),po!==null&&(O&&po.alternate!==null&&ln.delete(po.key===null?yn:po.key),De=K(po,De,yn),cn===null?Kt=po:cn.sibling=po,cn=po);return O&&ln.forEach(function(K_e){return w(Fe,K_e)}),fr&&Ap(Fe,yn),Kt}function Vr(Fe,De,Ve,ft){if(typeof Ve=="object"&&Ve!==null&&Ve.type===S&&Ve.key===null&&(Ve=Ve.props.children),typeof Ve=="object"&&Ve!==null){switch(Ve.$$typeof){case y:e:{for(var Kt=Ve.key,cn=De;cn!==null;){if(cn.key===Kt){if(Kt=Ve.type,Kt===S){if(cn.tag===7){q(Fe,cn.sibling),De=D(cn,Ve.props.children),De.return=Fe,Fe=De;break e}}else if(cn.elementType===Kt||typeof Kt=="object"&&Kt!==null&&Kt.$$typeof===P&&v$(Kt)===cn.type){q(Fe,cn.sibling),De=D(cn,Ve.props),De.ref=ig(Fe,cn,Ve),De.return=Fe,Fe=De;break e}q(Fe,cn);break}else w(Fe,cn);cn=cn.sibling}Ve.type===S?(De=qp(Ve.props.children,Fe.mode,ft,Ve.key),De.return=Fe,Fe=De):(ft=Uy(Ve.type,Ve.key,Ve.props,null,Fe.mode,ft),ft.ref=ig(Fe,De,Ve),ft.return=Fe,Fe=ft)}return le(Fe);case k:e:{for(cn=Ve.key;De!==null;){if(De.key===cn)if(De.tag===4&&De.stateNode.containerInfo===Ve.containerInfo&&De.stateNode.implementation===Ve.implementation){q(Fe,De.sibling),De=D(De,Ve.children||[]),De.return=Fe,Fe=De;break e}else{q(Fe,De);break}else w(Fe,De);De=De.sibling}De=tS(Ve,Fe.mode,ft),De.return=Fe,Fe=De}return le(Fe);case P:return cn=Ve._init,Vr(Fe,De,cn(Ve._payload),ft)}if(L(Ve))return $t(Fe,De,Ve,ft);if(X(Ve))return Ut(Fe,De,Ve,ft);Ay(Fe,Ve)}return typeof Ve=="string"&&Ve!==""||typeof Ve=="number"?(Ve=""+Ve,De!==null&&De.tag===6?(q(Fe,De.sibling),De=D(De,Ve),De.return=Fe,Fe=De):(q(Fe,De),De=eS(Ve,Fe.mode,ft),De.return=Fe,Fe=De),le(Fe)):q(Fe,De)}return Vr}var Tb=x$(!0),w$=x$(!1),vy=gu(null),xy=null,Eb=null,u6=null;function d6(){u6=Eb=xy=null}function p6(O){var w=vy.current;ir(vy),O._currentValue=w}function f6(O,w,q){for(;O!==null;){var W=O.alternate;if((O.childLanes&w)!==w?(O.childLanes|=w,W!==null&&(W.childLanes|=w)):W!==null&&(W.childLanes&w)!==w&&(W.childLanes|=w),O===q)break;O=O.return}}function Wb(O,w){xy=O,u6=Eb=null,O=O.dependencies,O!==null&&O.firstContext!==null&&(O.lanes&w&&(Z1=!0),O.firstContext=null)}function oi(O){var w=O._currentValue;if(u6!==O)if(O={context:O,memoizedValue:w,next:null},Eb===null){if(xy===null)throw Error(n(308));Eb=O,xy.dependencies={lanes:0,firstContext:O}}else Eb=Eb.next=O;return w}var vp=null;function b6(O){vp===null?vp=[O]:vp.push(O)}function _$(O,w,q,W){var D=w.interleaved;return D===null?(q.next=q,b6(w)):(q.next=D.next,D.next=q),w.interleaved=q,Uc(O,W)}function Uc(O,w){O.lanes|=w;var q=O.alternate;for(q!==null&&(q.lanes|=w),q=O,O=O.return;O!==null;)O.childLanes|=w,q=O.alternate,q!==null&&(q.childLanes|=w),q=O,O=O.return;return q.tag===3?q.stateNode:null}var Ou=!1;function h6(O){O.updateQueue={baseState:O.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function k$(O,w){O=O.updateQueue,w.updateQueue===O&&(w.updateQueue={baseState:O.baseState,firstBaseUpdate:O.firstBaseUpdate,lastBaseUpdate:O.lastBaseUpdate,shared:O.shared,effects:O.effects})}function Xc(O,w){return{eventTime:O,lane:w,tag:0,payload:null,callback:null,next:null}}function yu(O,w,q){var W=O.updateQueue;if(W===null)return null;if(W=W.shared,co&2){var D=W.pending;return D===null?w.next=w:(w.next=D.next,D.next=w),W.pending=w,Uc(O,q)}return D=W.interleaved,D===null?(w.next=w,b6(W)):(w.next=D.next,D.next=w),W.interleaved=w,Uc(O,q)}function wy(O,w,q){if(w=w.updateQueue,w!==null&&(w=w.shared,(q&4194240)!==0)){var W=w.lanes;W&=O.pendingLanes,q|=W,w.lanes=q,Ck(O,q)}}function S$(O,w){var q=O.updateQueue,W=O.alternate;if(W!==null&&(W=W.updateQueue,q===W)){var D=null,K=null;if(q=q.firstBaseUpdate,q!==null){do{var le={eventTime:q.eventTime,lane:q.lane,tag:q.tag,payload:q.payload,callback:q.callback,next:null};K===null?D=K=le:K=K.next=le,q=q.next}while(q!==null);K===null?D=K=w:K=K.next=w}else D=K=w;q={baseState:W.baseState,firstBaseUpdate:D,lastBaseUpdate:K,shared:W.shared,effects:W.effects},O.updateQueue=q;return}O=q.lastBaseUpdate,O===null?q.firstBaseUpdate=w:O.next=w,q.lastBaseUpdate=w}function _y(O,w,q,W){var D=O.updateQueue;Ou=!1;var K=D.firstBaseUpdate,le=D.lastBaseUpdate,Te=D.shared.pending;if(Te!==null){D.shared.pending=null;var Le=Te,Ge=Le.next;Le.next=null,le===null?K=Ge:le.next=Ge,le=Le;var at=O.alternate;at!==null&&(at=at.updateQueue,Te=at.lastBaseUpdate,Te!==le&&(Te===null?at.firstBaseUpdate=Ge:Te.next=Ge,at.lastBaseUpdate=Le))}if(K!==null){var ut=D.baseState;le=0,at=Ge=Le=null,Te=K;do{var st=Te.lane,Et=Te.eventTime;if((W&st)===st){at!==null&&(at=at.next={eventTime:Et,lane:0,tag:Te.tag,payload:Te.payload,callback:Te.callback,next:null});e:{var $t=O,Ut=Te;switch(st=w,Et=q,Ut.tag){case 1:if($t=Ut.payload,typeof $t=="function"){ut=$t.call(Et,ut,st);break e}ut=$t;break e;case 3:$t.flags=$t.flags&-65537|128;case 0:if($t=Ut.payload,st=typeof $t=="function"?$t.call(Et,ut,st):$t,st==null)break e;ut=Z({},ut,st);break e;case 2:Ou=!0}}Te.callback!==null&&Te.lane!==0&&(O.flags|=64,st=D.effects,st===null?D.effects=[Te]:st.push(Te))}else Et={eventTime:Et,lane:st,tag:Te.tag,payload:Te.payload,callback:Te.callback,next:null},at===null?(Ge=at=Et,Le=ut):at=at.next=Et,le|=st;if(Te=Te.next,Te===null){if(Te=D.shared.pending,Te===null)break;st=Te,Te=st.next,st.next=null,D.lastBaseUpdate=st,D.shared.pending=null}}while(!0);if(at===null&&(Le=ut),D.baseState=Le,D.firstBaseUpdate=Ge,D.lastBaseUpdate=at,w=D.shared.interleaved,w!==null){D=w;do le|=D.lane,D=D.next;while(D!==w)}else K===null&&(D.shared.lanes=0);_p|=le,O.lanes=le,O.memoizedState=ut}}function C$(O,w,q){if(O=w.effects,w.effects=null,O!==null)for(w=0;wq?q:4,O(!0);var W=O6.transition;O6.transition={};try{O(!1),w()}finally{Eo=q,O6.transition=W}}function G$(){return ri().memoizedState}function z_e(O,w,q){var W=wu(O);if(q={lane:W,action:q,hasEagerState:!1,eagerState:null,next:null},K$(O))Y$(w,q);else if(q=_$(O,w,q,W),q!==null){var D=N1();Ji(q,O,W,D),Z$(q,w,W)}}function O_e(O,w,q){var W=wu(O),D={lane:W,action:q,hasEagerState:!1,eagerState:null,next:null};if(K$(O))Y$(w,D);else{var K=O.alternate;if(O.lanes===0&&(K===null||K.lanes===0)&&(K=w.lastRenderedReducer,K!==null))try{var le=w.lastRenderedState,Te=K(le,q);if(D.hasEagerState=!0,D.eagerState=Te,Gi(Te,le)){var Le=w.interleaved;Le===null?(D.next=D,b6(w)):(D.next=Le.next,Le.next=D),w.interleaved=D;return}}catch{}finally{}q=_$(O,w,D,W),q!==null&&(D=N1(),Ji(q,O,W,D),Z$(q,w,W))}}function K$(O){var w=O.alternate;return O===wr||w!==null&&w===wr}function Y$(O,w){ug=Cy=!0;var q=O.pending;q===null?w.next=w:(w.next=q.next,q.next=w),O.pending=w}function Z$(O,w,q){if(q&4194240){var W=w.lanes;W&=O.pendingLanes,q|=W,w.lanes=q,Ck(O,q)}}var Ty={readContext:oi,useCallback:s1,useContext:s1,useEffect:s1,useImperativeHandle:s1,useInsertionEffect:s1,useLayoutEffect:s1,useMemo:s1,useReducer:s1,useRef:s1,useState:s1,useDebugValue:s1,useDeferredValue:s1,useTransition:s1,useMutableSource:s1,useSyncExternalStore:s1,useId:s1,unstable_isNewReconciler:!1},y_e={readContext:oi,useCallback:function(O,w){return Ba().memoizedState=[O,w===void 0?null:w],O},useContext:oi,useEffect:I$,useImperativeHandle:function(O,w,q){return q=q!=null?q.concat([O]):null,qy(4194308,4,$$.bind(null,w,O),q)},useLayoutEffect:function(O,w){return qy(4194308,4,O,w)},useInsertionEffect:function(O,w){return qy(4,2,O,w)},useMemo:function(O,w){var q=Ba();return w=w===void 0?null:w,O=O(),q.memoizedState=[O,w],O},useReducer:function(O,w,q){var W=Ba();return w=q!==void 0?q(w):w,W.memoizedState=W.baseState=w,O={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:O,lastRenderedState:w},W.queue=O,O=O.dispatch=z_e.bind(null,wr,O),[W.memoizedState,O]},useRef:function(O){var w=Ba();return O={current:O},w.memoizedState=O},useState:P$,useDebugValue:k6,useDeferredValue:function(O){return Ba().memoizedState=O},useTransition:function(){var O=P$(!1),w=O[0];return O=M_e.bind(null,O[1]),Ba().memoizedState=O,[w,O]},useMutableSource:function(){},useSyncExternalStore:function(O,w,q){var W=wr,D=Ba();if(fr){if(q===void 0)throw Error(n(407));q=q()}else{if(q=w(),A0===null)throw Error(n(349));wp&30||E$(W,w,q)}D.memoizedState=q;var K={value:q,getSnapshot:w};return D.queue=K,I$(N$.bind(null,W,K,O),[O]),W.flags|=2048,fg(9,W$.bind(null,W,K,q,w),void 0,null),q},useId:function(){var O=Ba(),w=A0.identifierPrefix;if(fr){var q=Hc,W=Vc;q=(W&~(1<<32-I0(W)-1)).toString(32)+q,w=":"+w+"R"+q,q=dg++,0<\/script>",O=O.removeChild(O.firstChild)):typeof W.is=="string"?O=le.createElement(q,{is:W.is}):(O=le.createElement(q),q==="select"&&(le=O,W.multiple?le.multiple=!0:W.size&&(le.size=W.size))):O=le.createElementNS(O,q),O[Wa]=w,O[rg]=W,gV(O,w,!1,!1),w.stateNode=O;e:{switch(le=nt(q,W),q){case"dialog":sr("cancel",O),sr("close",O),D=W;break;case"iframe":case"object":case"embed":sr("load",O),D=W;break;case"video":case"audio":for(D=0;Djb&&(w.flags|=128,W=!0,bg(K,!1),w.lanes=4194304)}else{if(!W)if(O=ky(le),O!==null){if(w.flags|=128,W=!0,q=O.updateQueue,q!==null&&(w.updateQueue=q,w.flags|=4),bg(K,!0),K.tail===null&&K.tailMode==="hidden"&&!le.alternate&&!fr)return i1(w),null}else 2*Ar()-K.renderingStartTime>jb&&q!==1073741824&&(w.flags|=128,W=!0,bg(K,!1),w.lanes=4194304);K.isBackwards?(le.sibling=w.child,w.child=le):(q=K.last,q!==null?q.sibling=le:w.child=le,K.last=le)}return K.tail!==null?(w=K.tail,K.rendering=w,K.tail=w.sibling,K.renderingStartTime=Ar(),w.sibling=null,q=xr.current,er(xr,W?q&1|2:q&1),w):(i1(w),null);case 22:case 23:return Z6(),W=w.memoizedState!==null,O!==null&&O.memoizedState!==null!==W&&(w.flags|=8192),W&&w.mode&1?qs&1073741824&&(i1(w),w.subtreeFlags&6&&(w.flags|=8192)):i1(w),null;case 24:return null;case 25:return null}throw Error(n(156,w.tag))}function C_e(O,w){switch(i6(w),w.tag){case 1:return Y1(w.type)&&my(),O=w.flags,O&65536?(w.flags=O&-65537|128,w):null;case 3:return Nb(),ir(K1),ir(r1),z6(),O=w.flags,O&65536&&!(O&128)?(w.flags=O&-65537|128,w):null;case 5:return g6(w),null;case 13:if(ir(xr),O=w.memoizedState,O!==null&&O.dehydrated!==null){if(w.alternate===null)throw Error(n(340));Rb()}return O=w.flags,O&65536?(w.flags=O&-65537|128,w):null;case 19:return ir(xr),null;case 4:return Nb(),null;case 10:return p6(w.type._context),null;case 22:case 23:return Z6(),null;case 24:return null;default:return null}}var By=!1,a1=!1,q_e=typeof WeakSet=="function"?WeakSet:Set,Ft=null;function Lb(O,w){var q=O.ref;if(q!==null)if(typeof q=="function")try{q(null)}catch(W){Lr(O,w,W)}else q.current=null}function j6(O,w,q){try{q()}catch(W){Lr(O,w,W)}}var OV=!1;function R_e(O,w){if(Zk=ny,O=QF(),$k(O)){if("selectionStart"in O)var q={start:O.selectionStart,end:O.selectionEnd};else e:{q=(q=O.ownerDocument)&&q.defaultView||window;var W=q.getSelection&&q.getSelection();if(W&&W.rangeCount!==0){q=W.anchorNode;var D=W.anchorOffset,K=W.focusNode;W=W.focusOffset;try{q.nodeType,K.nodeType}catch{q=null;break e}var le=0,Te=-1,Le=-1,Ge=0,at=0,ut=O,st=null;t:for(;;){for(var Wt;ut!==q||D!==0&&ut.nodeType!==3||(Te=le+D),ut!==K||W!==0&&ut.nodeType!==3||(Le=le+W),ut.nodeType===3&&(le+=ut.nodeValue.length),(Wt=ut.firstChild)!==null;)st=ut,ut=Wt;for(;;){if(ut===O)break t;if(st===q&&++Ge===D&&(Te=le),st===K&&++at===W&&(Le=le),(Wt=ut.nextSibling)!==null)break;ut=st,st=ut.parentNode}ut=Wt}q=Te===-1||Le===-1?null:{start:Te,end:Le}}else q=null}q=q||{start:0,end:0}}else q=null;for(Qk={focusedElem:O,selectionRange:q},ny=!1,Ft=w;Ft!==null;)if(w=Ft,O=w.child,(w.subtreeFlags&1028)!==0&&O!==null)O.return=w,Ft=O;else for(;Ft!==null;){w=Ft;try{var $t=w.alternate;if(w.flags&1024)switch(w.tag){case 0:case 11:case 15:break;case 1:if($t!==null){var Ut=$t.memoizedProps,Vr=$t.memoizedState,Fe=w.stateNode,De=Fe.getSnapshotBeforeUpdate(w.elementType===w.type?Ut:Yi(w.type,Ut),Vr);Fe.__reactInternalSnapshotBeforeUpdate=De}break;case 3:var Ve=w.stateNode.containerInfo;Ve.nodeType===1?Ve.textContent="":Ve.nodeType===9&&Ve.documentElement&&Ve.removeChild(Ve.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ft){Lr(w,w.return,ft)}if(O=w.sibling,O!==null){O.return=w.return,Ft=O;break}Ft=w.return}return $t=OV,OV=!1,$t}function hg(O,w,q){var W=w.updateQueue;if(W=W!==null?W.lastEffect:null,W!==null){var D=W=W.next;do{if((D.tag&O)===O){var K=D.destroy;D.destroy=void 0,K!==void 0&&j6(w,q,K)}D=D.next}while(D!==W)}}function Ly(O,w){if(w=w.updateQueue,w=w!==null?w.lastEffect:null,w!==null){var q=w=w.next;do{if((q.tag&O)===O){var W=q.create;q.destroy=W()}q=q.next}while(q!==w)}}function I6(O){var w=O.ref;if(w!==null){var q=O.stateNode;switch(O.tag){case 5:O=q;break;default:O=q}typeof w=="function"?w(O):w.current=O}}function yV(O){var w=O.alternate;w!==null&&(O.alternate=null,yV(w)),O.child=null,O.deletions=null,O.sibling=null,O.tag===5&&(w=O.stateNode,w!==null&&(delete w[Wa],delete w[rg],delete w[n6],delete w[f_e],delete w[b_e])),O.stateNode=null,O.return=null,O.dependencies=null,O.memoizedProps=null,O.memoizedState=null,O.pendingProps=null,O.stateNode=null,O.updateQueue=null}function AV(O){return O.tag===5||O.tag===3||O.tag===4}function vV(O){e:for(;;){for(;O.sibling===null;){if(O.return===null||AV(O.return))return null;O=O.return}for(O.sibling.return=O.return,O=O.sibling;O.tag!==5&&O.tag!==6&&O.tag!==18;){if(O.flags&2||O.child===null||O.tag===4)continue e;O.child.return=O,O=O.child}if(!(O.flags&2))return O.stateNode}}function D6(O,w,q){var W=O.tag;if(W===5||W===6)O=O.stateNode,w?q.nodeType===8?q.parentNode.insertBefore(O,w):q.insertBefore(O,w):(q.nodeType===8?(w=q.parentNode,w.insertBefore(O,q)):(w=q,w.appendChild(O)),q=q._reactRootContainer,q!=null||w.onclick!==null||(w.onclick=by));else if(W!==4&&(O=O.child,O!==null))for(D6(O,w,q),O=O.sibling;O!==null;)D6(O,w,q),O=O.sibling}function F6(O,w,q){var W=O.tag;if(W===5||W===6)O=O.stateNode,w?q.insertBefore(O,w):q.appendChild(O);else if(W!==4&&(O=O.child,O!==null))for(F6(O,w,q),O=O.sibling;O!==null;)F6(O,w,q),O=O.sibling}var D0=null,Zi=!1;function Au(O,w,q){for(q=q.child;q!==null;)xV(O,w,q),q=q.sibling}function xV(O,w,q){if($o&&typeof $o.onCommitFiberUnmount=="function")try{$o.onCommitFiberUnmount(E1,q)}catch{}switch(q.tag){case 5:a1||Lb(q,w);case 6:var W=D0,D=Zi;D0=null,Au(O,w,q),D0=W,Zi=D,D0!==null&&(Zi?(O=D0,q=q.stateNode,O.nodeType===8?O.parentNode.removeChild(q):O.removeChild(q)):D0.removeChild(q.stateNode));break;case 18:D0!==null&&(Zi?(O=D0,q=q.stateNode,O.nodeType===8?t6(O.parentNode,q):O.nodeType===1&&t6(O,q),Xm(O)):t6(D0,q.stateNode));break;case 4:W=D0,D=Zi,D0=q.stateNode.containerInfo,Zi=!0,Au(O,w,q),D0=W,Zi=D;break;case 0:case 11:case 14:case 15:if(!a1&&(W=q.updateQueue,W!==null&&(W=W.lastEffect,W!==null))){D=W=W.next;do{var K=D,le=K.destroy;K=K.tag,le!==void 0&&(K&2||K&4)&&j6(q,w,le),D=D.next}while(D!==W)}Au(O,w,q);break;case 1:if(!a1&&(Lb(q,w),W=q.stateNode,typeof W.componentWillUnmount=="function"))try{W.props=q.memoizedProps,W.state=q.memoizedState,W.componentWillUnmount()}catch(Te){Lr(q,w,Te)}Au(O,w,q);break;case 21:Au(O,w,q);break;case 22:q.mode&1?(a1=(W=a1)||q.memoizedState!==null,Au(O,w,q),a1=W):Au(O,w,q);break;default:Au(O,w,q)}}function wV(O){var w=O.updateQueue;if(w!==null){O.updateQueue=null;var q=O.stateNode;q===null&&(q=O.stateNode=new q_e),w.forEach(function(W){var D=I_e.bind(null,O,W);q.has(W)||(q.add(W),W.then(D,D))})}}function Qi(O,w){var q=w.deletions;if(q!==null)for(var W=0;WD&&(D=le),W&=~K}if(W=D,W=Ar()-W,W=(120>W?120:480>W?480:1080>W?1080:1920>W?1920:3e3>W?3e3:4320>W?4320:1960*E_e(W/1960))-W,10O?16:O,xu===null)var W=!1;else{if(O=xu,xu=null,Fy=0,co&6)throw Error(n(331));var D=co;for(co|=4,Ft=O.current;Ft!==null;){var K=Ft,le=K.child;if(Ft.flags&16){var Te=K.deletions;if(Te!==null){for(var Le=0;LeAr()-H6?Sp(O,0):V6|=q),J1(O,w)}function PV(O,w){w===0&&(O.mode&1?(w=Dc,Dc<<=1,!(Dc&130023424)&&(Dc=4194304)):w=1);var q=N1();O=Uc(O,w),O!==null&&(Fm(O,w,q),J1(O,q))}function j_e(O){var w=O.memoizedState,q=0;w!==null&&(q=w.retryLane),PV(O,q)}function I_e(O,w){var q=0;switch(O.tag){case 13:var W=O.stateNode,D=O.memoizedState;D!==null&&(q=D.retryLane);break;case 19:W=O.stateNode;break;default:throw Error(n(314))}W!==null&&W.delete(w),PV(O,q)}var jV;jV=function(O,w,q){if(O!==null)if(O.memoizedProps!==w.pendingProps||K1.current)Z1=!0;else{if(!(O.lanes&q)&&!(w.flags&128))return Z1=!1,k_e(O,w,q);Z1=!!(O.flags&131072)}else Z1=!1,fr&&w.flags&1048576&&M$(w,Oy,w.index);switch(w.lanes=0,w.tag){case 2:var W=w.type;Ny(O,w),O=w.pendingProps;var D=Sb(w,r1.current);Wb(w,q),D=A6(null,w,W,O,D,q);var K=v6();return w.flags|=1,typeof D=="object"&&D!==null&&typeof D.render=="function"&&D.$$typeof===void 0?(w.tag=1,w.memoizedState=null,w.updateQueue=null,Y1(W)?(K=!0,gy(w)):K=!1,w.memoizedState=D.state!==null&&D.state!==void 0?D.state:null,h6(w),D.updater=Ey,w.stateNode=D,D._reactInternals=w,C6(w,W,O,q),w=E6(null,w,W,!0,K,q)):(w.tag=0,fr&&K&&s6(w),W1(null,w,D,q),w=w.child),w;case 16:W=w.elementType;e:{switch(Ny(O,w),O=w.pendingProps,D=W._init,W=D(W._payload),w.type=W,D=w.tag=F_e(W),O=Yi(W,O),D){case 0:w=T6(null,w,W,O,q);break e;case 1:w=dV(null,w,W,O,q);break e;case 11:w=iV(null,w,W,O,q);break e;case 14:w=aV(null,w,W,Yi(W.type,O),q);break e}throw Error(n(306,W,""))}return w;case 0:return W=w.type,D=w.pendingProps,D=w.elementType===W?D:Yi(W,D),T6(O,w,W,D,q);case 1:return W=w.type,D=w.pendingProps,D=w.elementType===W?D:Yi(W,D),dV(O,w,W,D,q);case 3:e:{if(pV(w),O===null)throw Error(n(387));W=w.pendingProps,K=w.memoizedState,D=K.element,k$(O,w),_y(w,W,null,q);var le=w.memoizedState;if(W=le.element,K.isDehydrated)if(K={element:W,isDehydrated:!1,cache:le.cache,pendingSuspenseBoundaries:le.pendingSuspenseBoundaries,transitions:le.transitions},w.updateQueue.baseState=K,w.memoizedState=K,w.flags&256){D=Bb(Error(n(423)),w),w=fV(O,w,W,q,D);break e}else if(W!==D){D=Bb(Error(n(424)),w),w=fV(O,w,W,q,D);break e}else for(Cs=mu(w.stateNode.containerInfo.firstChild),Ss=w,fr=!0,Ki=null,q=w$(w,null,W,q),w.child=q;q;)q.flags=q.flags&-3|4096,q=q.sibling;else{if(Rb(),W===D){w=Gc(O,w,q);break e}W1(O,w,W,q)}w=w.child}return w;case 5:return q$(w),O===null&&c6(w),W=w.type,D=w.pendingProps,K=O!==null?O.memoizedProps:null,le=D.children,Jk(W,D)?le=null:K!==null&&Jk(W,K)&&(w.flags|=32),uV(O,w),W1(O,w,le,q),w.child;case 6:return O===null&&c6(w),null;case 13:return bV(O,w,q);case 4:return m6(w,w.stateNode.containerInfo),W=w.pendingProps,O===null?w.child=Tb(w,null,W,q):W1(O,w,W,q),w.child;case 11:return W=w.type,D=w.pendingProps,D=w.elementType===W?D:Yi(W,D),iV(O,w,W,D,q);case 7:return W1(O,w,w.pendingProps,q),w.child;case 8:return W1(O,w,w.pendingProps.children,q),w.child;case 12:return W1(O,w,w.pendingProps.children,q),w.child;case 10:e:{if(W=w.type._context,D=w.pendingProps,K=w.memoizedProps,le=D.value,er(vy,W._currentValue),W._currentValue=le,K!==null)if(Gi(K.value,le)){if(K.children===D.children&&!K1.current){w=Gc(O,w,q);break e}}else for(K=w.child,K!==null&&(K.return=w);K!==null;){var Te=K.dependencies;if(Te!==null){le=K.child;for(var Le=Te.firstContext;Le!==null;){if(Le.context===W){if(K.tag===1){Le=Xc(-1,q&-q),Le.tag=2;var Ge=K.updateQueue;if(Ge!==null){Ge=Ge.shared;var at=Ge.pending;at===null?Le.next=Le:(Le.next=at.next,at.next=Le),Ge.pending=Le}}K.lanes|=q,Le=K.alternate,Le!==null&&(Le.lanes|=q),f6(K.return,q,w),Te.lanes|=q;break}Le=Le.next}}else if(K.tag===10)le=K.type===w.type?null:K.child;else if(K.tag===18){if(le=K.return,le===null)throw Error(n(341));le.lanes|=q,Te=le.alternate,Te!==null&&(Te.lanes|=q),f6(le,q,w),le=K.sibling}else le=K.child;if(le!==null)le.return=K;else for(le=K;le!==null;){if(le===w){le=null;break}if(K=le.sibling,K!==null){K.return=le.return,le=K;break}le=le.return}K=le}W1(O,w,D.children,q),w=w.child}return w;case 9:return D=w.type,W=w.pendingProps.children,Wb(w,q),D=oi(D),W=W(D),w.flags|=1,W1(O,w,W,q),w.child;case 14:return W=w.type,D=Yi(W,w.pendingProps),D=Yi(W.type,D),aV(O,w,W,D,q);case 15:return cV(O,w,w.type,w.pendingProps,q);case 17:return W=w.type,D=w.pendingProps,D=w.elementType===W?D:Yi(W,D),Ny(O,w),w.tag=1,Y1(W)?(O=!0,gy(w)):O=!1,Wb(w,q),J$(w,W,D),C6(w,W,D,q),E6(null,w,W,!0,O,q);case 19:return mV(O,w,q);case 22:return lV(O,w,q)}throw Error(n(156,w.tag))};function IV(O,w){return hp(O,w)}function D_e(O,w,q,W){this.tag=O,this.key=q,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=w,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=W,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ii(O,w,q,W){return new D_e(O,w,q,W)}function J6(O){return O=O.prototype,!(!O||!O.isReactComponent)}function F_e(O){if(typeof O=="function")return J6(O)?1:0;if(O!=null){if(O=O.$$typeof,O===B)return 11;if(O===I)return 14}return 2}function ku(O,w){var q=O.alternate;return q===null?(q=ii(O.tag,w,O.key,O.mode),q.elementType=O.elementType,q.type=O.type,q.stateNode=O.stateNode,q.alternate=O,O.alternate=q):(q.pendingProps=w,q.type=O.type,q.flags=0,q.subtreeFlags=0,q.deletions=null),q.flags=O.flags&14680064,q.childLanes=O.childLanes,q.lanes=O.lanes,q.child=O.child,q.memoizedProps=O.memoizedProps,q.memoizedState=O.memoizedState,q.updateQueue=O.updateQueue,w=O.dependencies,q.dependencies=w===null?null:{lanes:w.lanes,firstContext:w.firstContext},q.sibling=O.sibling,q.index=O.index,q.ref=O.ref,q}function Uy(O,w,q,W,D,K){var le=2;if(W=O,typeof O=="function")J6(O)&&(le=1);else if(typeof O=="string")le=5;else e:switch(O){case S:return qp(q.children,D,K,w);case C:le=8,D|=8;break;case R:return O=ii(12,q,w,D|2),O.elementType=R,O.lanes=K,O;case N:return O=ii(13,q,w,D),O.elementType=N,O.lanes=K,O;case j:return O=ii(19,q,w,D),O.elementType=j,O.lanes=K,O;case $:return Xy(q,D,K,w);default:if(typeof O=="object"&&O!==null)switch(O.$$typeof){case T:le=10;break e;case E:le=9;break e;case B:le=11;break e;case I:le=14;break e;case P:le=16,W=null;break e}throw Error(n(130,O==null?O:typeof O,""))}return w=ii(le,q,w,D),w.elementType=O,w.type=W,w.lanes=K,w}function qp(O,w,q,W){return O=ii(7,O,W,w),O.lanes=q,O}function Xy(O,w,q,W){return O=ii(22,O,W,w),O.elementType=$,O.lanes=q,O.stateNode={isHidden:!1},O}function eS(O,w,q){return O=ii(6,O,null,w),O.lanes=q,O}function tS(O,w,q){return w=ii(4,O.children!==null?O.children:[],O.key,w),w.lanes=q,w.stateNode={containerInfo:O.containerInfo,pendingChildren:null,implementation:O.implementation},w}function $_e(O,w,q,W,D){this.tag=w,this.containerInfo=O,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Sk(0),this.expirationTimes=Sk(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sk(0),this.identifierPrefix=W,this.onRecoverableError=D,this.mutableSourceEagerHydrationData=null}function nS(O,w,q,W,D,K,le,Te,Le){return O=new $_e(O,w,q,Te,Le),w===1?(w=1,K===!0&&(w|=8)):w=0,K=ii(3,null,null,w),O.current=K,K.stateNode=O,K.memoizedState={element:W,isDehydrated:q,cache:null,transitions:null,pendingSuspenseBoundaries:null},h6(K),O}function V_e(O,w,q){var W=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),uS.exports=pke(),uS.exports}var hs=Tre(),eA={},tH;function fke(){if(tH)return eA;tH=1;var e=Tre();return eA.createRoot=e.createRoot,eA.hydrateRoot=e.hydrateRoot,eA}var kN=fke();const bke=e=>typeof e=="number"?!1:typeof e?.valueOf()=="string"||Array.isArray(e)?!e.length:!e,f0={OS:"web",select:e=>"web"in e?e.web:e.default,isWeb:!0};/*! +`+K.stack}return{value:O,source:w,stack:D,digest:null}}function q6(O,w,q){return{value:O,source:null,stack:q??null,digest:w??null}}function R6(O,w){try{console.error(w.value)}catch(q){setTimeout(function(){throw q})}}var x_e=typeof WeakMap=="function"?WeakMap:Map;function tV(O,w,q){q=Xc(-1,q),q.tag=3,q.payload={element:null};var W=w.value;return q.callback=function(){Iy||(Iy=!0,U6=W),R6(O,w)},q}function nV(O,w,q){q=Xc(-1,q),q.tag=3;var W=O.type.getDerivedStateFromError;if(typeof W=="function"){var D=w.value;q.payload=function(){return W(D)},q.callback=function(){R6(O,w)}}var K=O.stateNode;return K!==null&&typeof K.componentDidCatch=="function"&&(q.callback=function(){R6(O,w),typeof W!="function"&&(vu===null?vu=new Set([this]):vu.add(this));var le=w.stack;this.componentDidCatch(w.value,{componentStack:le!==null?le:""})}),q}function oV(O,w,q){var W=O.pingCache;if(W===null){W=O.pingCache=new x_e;var D=new Set;W.set(w,D)}else D=W.get(w),D===void 0&&(D=new Set,W.set(w,D));D.has(q)||(D.add(q),O=P_e.bind(null,O,w,q),w.then(O,O))}function rV(O){do{var w;if((w=O.tag===13)&&(w=O.memoizedState,w=w!==null?w.dehydrated!==null:!0),w)return O;O=O.return}while(O!==null);return null}function sV(O,w,q,W,D){return O.mode&1?(O.flags|=65536,O.lanes=D,O):(O===w?O.flags|=65536:(O.flags|=128,q.flags|=131072,q.flags&=-52805,q.tag===1&&(q.alternate===null?q.tag=17:(w=Xc(-1,1),w.tag=2,yu(q,w,1))),q.lanes|=1),O)}var w_e=M.ReactCurrentOwner,Z1=!1;function W1(O,w,q,W){w.child=O===null?w$(w,null,q,W):Tb(w,O.child,q,W)}function iV(O,w,q,W,D){q=q.render;var K=w.ref;return Wb(w,D),W=A6(O,w,q,W,K,D),q=v6(),O!==null&&!Z1?(w.updateQueue=O.updateQueue,w.flags&=-2053,O.lanes&=~D,Gc(O,w,D)):(fr&&q&&s6(w),w.flags|=1,W1(O,w,W,D),w.child)}function aV(O,w,q,W,D){if(O===null){var K=q.type;return typeof K=="function"&&!J6(K)&&K.defaultProps===void 0&&q.compare===null&&q.defaultProps===void 0?(w.tag=15,w.type=K,cV(O,w,K,W,D)):(O=Uy(q.type,null,W,w,w.mode,D),O.ref=w.ref,O.return=w,w.child=O)}if(K=O.child,!(O.lanes&D)){var le=K.memoizedProps;if(q=q.compare,q=q!==null?q:Jm,q(le,W)&&O.ref===w.ref)return Gc(O,w,D)}return w.flags|=1,O=ku(K,W),O.ref=w.ref,O.return=w,w.child=O}function cV(O,w,q,W,D){if(O!==null){var K=O.memoizedProps;if(Jm(K,W)&&O.ref===w.ref)if(Z1=!1,w.pendingProps=W=K,(O.lanes&D)!==0)O.flags&131072&&(Z1=!0);else return w.lanes=O.lanes,Gc(O,w,D)}return T6(O,w,q,W,D)}function lV(O,w,q){var W=w.pendingProps,D=W.children,K=O!==null?O.memoizedState:null;if(W.mode==="hidden")if(!(w.mode&1))w.memoizedState={baseLanes:0,cachePool:null,transitions:null},er(Pb,qs),qs|=q;else{if(!(q&1073741824))return O=K!==null?K.baseLanes|q:q,w.lanes=w.childLanes=1073741824,w.memoizedState={baseLanes:O,cachePool:null,transitions:null},w.updateQueue=null,er(Pb,qs),qs|=O,null;w.memoizedState={baseLanes:0,cachePool:null,transitions:null},W=K!==null?K.baseLanes:q,er(Pb,qs),qs|=W}else K!==null?(W=K.baseLanes|q,w.memoizedState=null):W=q,er(Pb,qs),qs|=W;return W1(O,w,D,q),w.child}function uV(O,w){var q=w.ref;(O===null&&q!==null||O!==null&&O.ref!==q)&&(w.flags|=512,w.flags|=2097152)}function T6(O,w,q,W,D){var K=Y1(q)?Op:r1.current;return K=Sb(w,K),Wb(w,D),q=A6(O,w,q,W,K,D),W=v6(),O!==null&&!Z1?(w.updateQueue=O.updateQueue,w.flags&=-2053,O.lanes&=~D,Gc(O,w,D)):(fr&&W&&s6(w),w.flags|=1,W1(O,w,q,D),w.child)}function dV(O,w,q,W,D){if(Y1(q)){var K=!0;gy(w)}else K=!1;if(Wb(w,D),w.stateNode===null)Ny(O,w),J$(w,q,W),C6(w,q,W,D),W=!0;else if(O===null){var le=w.stateNode,Te=w.memoizedProps;le.props=Te;var Le=le.context,Ge=q.contextType;typeof Ge=="object"&&Ge!==null?Ge=oi(Ge):(Ge=Y1(q)?Op:r1.current,Ge=Sb(w,Ge));var at=q.getDerivedStateFromProps,ut=typeof at=="function"||typeof le.getSnapshotBeforeUpdate=="function";ut||typeof le.UNSAFE_componentWillReceiveProps!="function"&&typeof le.componentWillReceiveProps!="function"||(Te!==W||Le!==Ge)&&eV(w,le,W,Ge),Ou=!1;var st=w.memoizedState;le.state=st,_y(w,W,le,D),Le=w.memoizedState,Te!==W||st!==Le||K1.current||Ou?(typeof at=="function"&&(S6(w,q,at,W),Le=w.memoizedState),(Te=Ou||Q$(w,q,Te,W,st,Le,Ge))?(ut||typeof le.UNSAFE_componentWillMount!="function"&&typeof le.componentWillMount!="function"||(typeof le.componentWillMount=="function"&&le.componentWillMount(),typeof le.UNSAFE_componentWillMount=="function"&&le.UNSAFE_componentWillMount()),typeof le.componentDidMount=="function"&&(w.flags|=4194308)):(typeof le.componentDidMount=="function"&&(w.flags|=4194308),w.memoizedProps=W,w.memoizedState=Le),le.props=W,le.state=Le,le.context=Ge,W=Te):(typeof le.componentDidMount=="function"&&(w.flags|=4194308),W=!1)}else{le=w.stateNode,k$(O,w),Te=w.memoizedProps,Ge=w.type===w.elementType?Te:Yi(w.type,Te),le.props=Ge,ut=w.pendingProps,st=le.context,Le=q.contextType,typeof Le=="object"&&Le!==null?Le=oi(Le):(Le=Y1(q)?Op:r1.current,Le=Sb(w,Le));var Et=q.getDerivedStateFromProps;(at=typeof Et=="function"||typeof le.getSnapshotBeforeUpdate=="function")||typeof le.UNSAFE_componentWillReceiveProps!="function"&&typeof le.componentWillReceiveProps!="function"||(Te!==ut||st!==Le)&&eV(w,le,W,Le),Ou=!1,st=w.memoizedState,le.state=st,_y(w,W,le,D);var $t=w.memoizedState;Te!==ut||st!==$t||K1.current||Ou?(typeof Et=="function"&&(S6(w,q,Et,W),$t=w.memoizedState),(Ge=Ou||Q$(w,q,Ge,W,st,$t,Le)||!1)?(at||typeof le.UNSAFE_componentWillUpdate!="function"&&typeof le.componentWillUpdate!="function"||(typeof le.componentWillUpdate=="function"&&le.componentWillUpdate(W,$t,Le),typeof le.UNSAFE_componentWillUpdate=="function"&&le.UNSAFE_componentWillUpdate(W,$t,Le)),typeof le.componentDidUpdate=="function"&&(w.flags|=4),typeof le.getSnapshotBeforeUpdate=="function"&&(w.flags|=1024)):(typeof le.componentDidUpdate!="function"||Te===O.memoizedProps&&st===O.memoizedState||(w.flags|=4),typeof le.getSnapshotBeforeUpdate!="function"||Te===O.memoizedProps&&st===O.memoizedState||(w.flags|=1024),w.memoizedProps=W,w.memoizedState=$t),le.props=W,le.state=$t,le.context=Le,W=Ge):(typeof le.componentDidUpdate!="function"||Te===O.memoizedProps&&st===O.memoizedState||(w.flags|=4),typeof le.getSnapshotBeforeUpdate!="function"||Te===O.memoizedProps&&st===O.memoizedState||(w.flags|=1024),W=!1)}return E6(O,w,q,W,K,D)}function E6(O,w,q,W,D,K){uV(O,w);var le=(w.flags&128)!==0;if(!W&&!le)return D&&m$(w,q,!1),Gc(O,w,K);W=w.stateNode,w_e.current=w;var Te=le&&typeof q.getDerivedStateFromError!="function"?null:W.render();return w.flags|=1,O!==null&&le?(w.child=Tb(w,O.child,null,K),w.child=Tb(w,null,Te,K)):W1(O,w,Te,K),w.memoizedState=W.state,D&&m$(w,q,!0),w.child}function pV(O){var w=O.stateNode;w.pendingContext?b$(O,w.pendingContext,w.pendingContext!==w.context):w.context&&b$(O,w.context,!1),m6(O,w.containerInfo)}function fV(O,w,q,W,D){return Rb(),l6(D),w.flags|=256,W1(O,w,q,W),w.child}var W6={dehydrated:null,treeContext:null,retryLane:0};function N6(O){return{baseLanes:O,cachePool:null,transitions:null}}function bV(O,w,q){var W=w.pendingProps,D=xr.current,K=!1,le=(w.flags&128)!==0,Te;if((Te=le)||(Te=O!==null&&O.memoizedState===null?!1:(D&2)!==0),Te?(K=!0,w.flags&=-129):(O===null||O.memoizedState!==null)&&(D|=1),er(xr,D&1),O===null)return c6(w),O=w.memoizedState,O!==null&&(O=O.dehydrated,O!==null)?(w.mode&1?O.data==="$!"?w.lanes=8:w.lanes=1073741824:w.lanes=1,null):(le=W.children,O=W.fallback,K?(W=w.mode,K=w.child,le={mode:"hidden",children:le},!(W&1)&&K!==null?(K.childLanes=0,K.pendingProps=le):K=Xy(le,W,0,null),O=qp(O,W,q,null),K.return=w,O.return=w,K.sibling=O,w.child=K,w.child.memoizedState=N6(q),w.memoizedState=W6,O):B6(w,le));if(D=O.memoizedState,D!==null&&(Te=D.dehydrated,Te!==null))return __e(O,w,le,W,Te,D,q);if(K){K=W.fallback,le=w.mode,D=O.child,Te=D.sibling;var Le={mode:"hidden",children:W.children};return!(le&1)&&w.child!==D?(W=w.child,W.childLanes=0,W.pendingProps=Le,w.deletions=null):(W=ku(D,Le),W.subtreeFlags=D.subtreeFlags&14680064),Te!==null?K=ku(Te,K):(K=qp(K,le,q,null),K.flags|=2),K.return=w,W.return=w,W.sibling=K,w.child=W,W=K,K=w.child,le=O.child.memoizedState,le=le===null?N6(q):{baseLanes:le.baseLanes|q,cachePool:null,transitions:le.transitions},K.memoizedState=le,K.childLanes=O.childLanes&~q,w.memoizedState=W6,W}return K=O.child,O=K.sibling,W=ku(K,{mode:"visible",children:W.children}),!(w.mode&1)&&(W.lanes=q),W.return=w,W.sibling=null,O!==null&&(q=w.deletions,q===null?(w.deletions=[O],w.flags|=16):q.push(O)),w.child=W,w.memoizedState=null,W}function B6(O,w){return w=Xy({mode:"visible",children:w},O.mode,0,null),w.return=O,O.child=w}function Wy(O,w,q,W){return W!==null&&l6(W),Tb(w,O.child,null,q),O=B6(w,w.pendingProps.children),O.flags|=2,w.memoizedState=null,O}function __e(O,w,q,W,D,K,le){if(q)return w.flags&256?(w.flags&=-257,W=q6(Error(n(422))),Wy(O,w,le,W)):w.memoizedState!==null?(w.child=O.child,w.flags|=128,null):(K=W.fallback,D=w.mode,W=Xy({mode:"visible",children:W.children},D,0,null),K=qp(K,D,le,null),K.flags|=2,W.return=w,K.return=w,W.sibling=K,w.child=W,w.mode&1&&Tb(w,O.child,null,le),w.child.memoizedState=N6(le),w.memoizedState=W6,K);if(!(w.mode&1))return Wy(O,w,le,null);if(D.data==="$!"){if(W=D.nextSibling&&D.nextSibling.dataset,W)var Te=W.dgst;return W=Te,K=Error(n(419)),W=q6(K,W,void 0),Wy(O,w,le,W)}if(Te=(le&O.childLanes)!==0,Z1||Te){if(W=A0,W!==null){switch(le&-le){case 4:D=2;break;case 16:D=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:D=32;break;case 536870912:D=268435456;break;default:D=0}D=D&(W.suspendedLanes|le)?0:D,D!==0&&D!==K.retryLane&&(K.retryLane=D,Uc(O,D),Ji(W,O,D,-1))}return Q6(),W=q6(Error(n(421))),Wy(O,w,le,W)}return D.data==="$?"?(w.flags|=128,w.child=O.child,w=j_e.bind(null,O),D._reactRetry=w,null):(O=K.treeContext,Cs=mu(D.nextSibling),Ss=w,fr=!0,Ki=null,O!==null&&(ti[ni++]=Vc,ti[ni++]=Hc,ti[ni++]=yp,Vc=O.id,Hc=O.overflow,yp=w),w=B6(w,W.children),w.flags|=4096,w)}function hV(O,w,q){O.lanes|=w;var W=O.alternate;W!==null&&(W.lanes|=w),f6(O.return,w,q)}function L6(O,w,q,W,D){var K=O.memoizedState;K===null?O.memoizedState={isBackwards:w,rendering:null,renderingStartTime:0,last:W,tail:q,tailMode:D}:(K.isBackwards=w,K.rendering=null,K.renderingStartTime=0,K.last=W,K.tail=q,K.tailMode=D)}function mV(O,w,q){var W=w.pendingProps,D=W.revealOrder,K=W.tail;if(W1(O,w,W.children,q),W=xr.current,W&2)W=W&1|2,w.flags|=128;else{if(O!==null&&O.flags&128)e:for(O=w.child;O!==null;){if(O.tag===13)O.memoizedState!==null&&hV(O,q,w);else if(O.tag===19)hV(O,q,w);else if(O.child!==null){O.child.return=O,O=O.child;continue}if(O===w)break e;for(;O.sibling===null;){if(O.return===null||O.return===w)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}W&=1}if(er(xr,W),!(w.mode&1))w.memoizedState=null;else switch(D){case"forwards":for(q=w.child,D=null;q!==null;)O=q.alternate,O!==null&&ky(O)===null&&(D=q),q=q.sibling;q=D,q===null?(D=w.child,w.child=null):(D=q.sibling,q.sibling=null),L6(w,!1,D,q,K);break;case"backwards":for(q=null,D=w.child,w.child=null;D!==null;){if(O=D.alternate,O!==null&&ky(O)===null){w.child=D;break}O=D.sibling,D.sibling=q,q=D,D=O}L6(w,!0,q,null,K);break;case"together":L6(w,!1,null,null,void 0);break;default:w.memoizedState=null}return w.child}function Ny(O,w){!(w.mode&1)&&O!==null&&(O.alternate=null,w.alternate=null,w.flags|=2)}function Gc(O,w,q){if(O!==null&&(w.dependencies=O.dependencies),_p|=w.lanes,!(q&w.childLanes))return null;if(O!==null&&w.child!==O.child)throw Error(n(153));if(w.child!==null){for(O=w.child,q=ku(O,O.pendingProps),w.child=q,q.return=w;O.sibling!==null;)O=O.sibling,q=q.sibling=ku(O,O.pendingProps),q.return=w;q.sibling=null}return w.child}function k_e(O,w,q){switch(w.tag){case 3:pV(w),Rb();break;case 5:q$(w);break;case 1:Y1(w.type)&&gy(w);break;case 4:m6(w,w.stateNode.containerInfo);break;case 10:var W=w.type._context,D=w.memoizedProps.value;er(vy,W._currentValue),W._currentValue=D;break;case 13:if(W=w.memoizedState,W!==null)return W.dehydrated!==null?(er(xr,xr.current&1),w.flags|=128,null):q&w.child.childLanes?bV(O,w,q):(er(xr,xr.current&1),O=Gc(O,w,q),O!==null?O.sibling:null);er(xr,xr.current&1);break;case 19:if(W=(q&w.childLanes)!==0,O.flags&128){if(W)return mV(O,w,q);w.flags|=128}if(D=w.memoizedState,D!==null&&(D.rendering=null,D.tail=null,D.lastEffect=null),er(xr,xr.current),W)break;return null;case 22:case 23:return w.lanes=0,lV(O,w,q)}return Gc(O,w,q)}var gV,P6,MV,zV;gV=function(O,w){for(var q=w.child;q!==null;){if(q.tag===5||q.tag===6)O.appendChild(q.stateNode);else if(q.tag!==4&&q.child!==null){q.child.return=q,q=q.child;continue}if(q===w)break;for(;q.sibling===null;){if(q.return===null||q.return===w)return;q=q.return}q.sibling.return=q.return,q=q.sibling}},P6=function(){},MV=function(O,w,q,W){var D=O.memoizedProps;if(D!==W){O=w.stateNode,xp(Na.current);var K=null;switch(q){case"input":D=we(O,D),W=we(O,W),K=[];break;case"select":D=Z({},D,{value:void 0}),W=Z({},W,{value:void 0}),K=[];break;case"textarea":D=ne(O,D),W=ne(O,W),K=[];break;default:typeof D.onClick!="function"&&typeof W.onClick=="function"&&(O.onclick=by)}ze(q,W);var le;q=null;for(Ge in D)if(!W.hasOwnProperty(Ge)&&D.hasOwnProperty(Ge)&&D[Ge]!=null)if(Ge==="style"){var Te=D[Ge];for(le in Te)Te.hasOwnProperty(le)&&(q||(q={}),q[le]="")}else Ge!=="dangerouslySetInnerHTML"&&Ge!=="children"&&Ge!=="suppressContentEditableWarning"&&Ge!=="suppressHydrationWarning"&&Ge!=="autoFocus"&&(r.hasOwnProperty(Ge)?K||(K=[]):(K=K||[]).push(Ge,null));for(Ge in W){var Le=W[Ge];if(Te=D?.[Ge],W.hasOwnProperty(Ge)&&Le!==Te&&(Le!=null||Te!=null))if(Ge==="style")if(Te){for(le in Te)!Te.hasOwnProperty(le)||Le&&Le.hasOwnProperty(le)||(q||(q={}),q[le]="");for(le in Le)Le.hasOwnProperty(le)&&Te[le]!==Le[le]&&(q||(q={}),q[le]=Le[le])}else q||(K||(K=[]),K.push(Ge,q)),q=Le;else Ge==="dangerouslySetInnerHTML"?(Le=Le?Le.__html:void 0,Te=Te?Te.__html:void 0,Le!=null&&Te!==Le&&(K=K||[]).push(Ge,Le)):Ge==="children"?typeof Le!="string"&&typeof Le!="number"||(K=K||[]).push(Ge,""+Le):Ge!=="suppressContentEditableWarning"&&Ge!=="suppressHydrationWarning"&&(r.hasOwnProperty(Ge)?(Le!=null&&Ge==="onScroll"&&sr("scroll",O),K||Te===Le||(K=[])):(K=K||[]).push(Ge,Le))}q&&(K=K||[]).push("style",q);var Ge=K;(w.updateQueue=Ge)&&(w.flags|=4)}},zV=function(O,w,q,W){q!==W&&(w.flags|=4)};function bg(O,w){if(!fr)switch(O.tailMode){case"hidden":w=O.tail;for(var q=null;w!==null;)w.alternate!==null&&(q=w),w=w.sibling;q===null?O.tail=null:q.sibling=null;break;case"collapsed":q=O.tail;for(var W=null;q!==null;)q.alternate!==null&&(W=q),q=q.sibling;W===null?w||O.tail===null?O.tail=null:O.tail.sibling=null:W.sibling=null}}function i1(O){var w=O.alternate!==null&&O.alternate.child===O.child,q=0,W=0;if(w)for(var D=O.child;D!==null;)q|=D.lanes|D.childLanes,W|=D.subtreeFlags&14680064,W|=D.flags&14680064,D.return=O,D=D.sibling;else for(D=O.child;D!==null;)q|=D.lanes|D.childLanes,W|=D.subtreeFlags,W|=D.flags,D.return=O,D=D.sibling;return O.subtreeFlags|=W,O.childLanes=q,w}function S_e(O,w,q){var W=w.pendingProps;switch(i6(w),w.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return i1(w),null;case 1:return Y1(w.type)&&my(),i1(w),null;case 3:return W=w.stateNode,Nb(),ir(K1),ir(r1),z6(),W.pendingContext&&(W.context=W.pendingContext,W.pendingContext=null),(O===null||O.child===null)&&(yy(w)?w.flags|=4:O===null||O.memoizedState.isDehydrated&&!(w.flags&256)||(w.flags|=1024,Ki!==null&&(K6(Ki),Ki=null))),P6(O,w),i1(w),null;case 5:g6(w);var D=xp(lg.current);if(q=w.type,O!==null&&w.stateNode!=null)MV(O,w,q,W,D),O.ref!==w.ref&&(w.flags|=512,w.flags|=2097152);else{if(!W){if(w.stateNode===null)throw Error(n(166));return i1(w),null}if(O=xp(Na.current),yy(w)){W=w.stateNode,q=w.type;var K=w.memoizedProps;switch(W[Wa]=w,W[rg]=K,O=(w.mode&1)!==0,q){case"dialog":sr("cancel",W),sr("close",W);break;case"iframe":case"object":case"embed":sr("load",W);break;case"video":case"audio":for(D=0;D<\/script>",O=O.removeChild(O.firstChild)):typeof W.is=="string"?O=le.createElement(q,{is:W.is}):(O=le.createElement(q),q==="select"&&(le=O,W.multiple?le.multiple=!0:W.size&&(le.size=W.size))):O=le.createElementNS(O,q),O[Wa]=w,O[rg]=W,gV(O,w,!1,!1),w.stateNode=O;e:{switch(le=nt(q,W),q){case"dialog":sr("cancel",O),sr("close",O),D=W;break;case"iframe":case"object":case"embed":sr("load",O),D=W;break;case"video":case"audio":for(D=0;Djb&&(w.flags|=128,W=!0,bg(K,!1),w.lanes=4194304)}else{if(!W)if(O=ky(le),O!==null){if(w.flags|=128,W=!0,q=O.updateQueue,q!==null&&(w.updateQueue=q,w.flags|=4),bg(K,!0),K.tail===null&&K.tailMode==="hidden"&&!le.alternate&&!fr)return i1(w),null}else 2*Ar()-K.renderingStartTime>jb&&q!==1073741824&&(w.flags|=128,W=!0,bg(K,!1),w.lanes=4194304);K.isBackwards?(le.sibling=w.child,w.child=le):(q=K.last,q!==null?q.sibling=le:w.child=le,K.last=le)}return K.tail!==null?(w=K.tail,K.rendering=w,K.tail=w.sibling,K.renderingStartTime=Ar(),w.sibling=null,q=xr.current,er(xr,W?q&1|2:q&1),w):(i1(w),null);case 22:case 23:return Z6(),W=w.memoizedState!==null,O!==null&&O.memoizedState!==null!==W&&(w.flags|=8192),W&&w.mode&1?qs&1073741824&&(i1(w),w.subtreeFlags&6&&(w.flags|=8192)):i1(w),null;case 24:return null;case 25:return null}throw Error(n(156,w.tag))}function C_e(O,w){switch(i6(w),w.tag){case 1:return Y1(w.type)&&my(),O=w.flags,O&65536?(w.flags=O&-65537|128,w):null;case 3:return Nb(),ir(K1),ir(r1),z6(),O=w.flags,O&65536&&!(O&128)?(w.flags=O&-65537|128,w):null;case 5:return g6(w),null;case 13:if(ir(xr),O=w.memoizedState,O!==null&&O.dehydrated!==null){if(w.alternate===null)throw Error(n(340));Rb()}return O=w.flags,O&65536?(w.flags=O&-65537|128,w):null;case 19:return ir(xr),null;case 4:return Nb(),null;case 10:return p6(w.type._context),null;case 22:case 23:return Z6(),null;case 24:return null;default:return null}}var By=!1,a1=!1,q_e=typeof WeakSet=="function"?WeakSet:Set,Ft=null;function Lb(O,w){var q=O.ref;if(q!==null)if(typeof q=="function")try{q(null)}catch(W){Br(O,w,W)}else q.current=null}function j6(O,w,q){try{q()}catch(W){Br(O,w,W)}}var OV=!1;function R_e(O,w){if(Zk=ny,O=QF(),$k(O)){if("selectionStart"in O)var q={start:O.selectionStart,end:O.selectionEnd};else e:{q=(q=O.ownerDocument)&&q.defaultView||window;var W=q.getSelection&&q.getSelection();if(W&&W.rangeCount!==0){q=W.anchorNode;var D=W.anchorOffset,K=W.focusNode;W=W.focusOffset;try{q.nodeType,K.nodeType}catch{q=null;break e}var le=0,Te=-1,Le=-1,Ge=0,at=0,ut=O,st=null;t:for(;;){for(var Et;ut!==q||D!==0&&ut.nodeType!==3||(Te=le+D),ut!==K||W!==0&&ut.nodeType!==3||(Le=le+W),ut.nodeType===3&&(le+=ut.nodeValue.length),(Et=ut.firstChild)!==null;)st=ut,ut=Et;for(;;){if(ut===O)break t;if(st===q&&++Ge===D&&(Te=le),st===K&&++at===W&&(Le=le),(Et=ut.nextSibling)!==null)break;ut=st,st=ut.parentNode}ut=Et}q=Te===-1||Le===-1?null:{start:Te,end:Le}}else q=null}q=q||{start:0,end:0}}else q=null;for(Qk={focusedElem:O,selectionRange:q},ny=!1,Ft=w;Ft!==null;)if(w=Ft,O=w.child,(w.subtreeFlags&1028)!==0&&O!==null)O.return=w,Ft=O;else for(;Ft!==null;){w=Ft;try{var $t=w.alternate;if(w.flags&1024)switch(w.tag){case 0:case 11:case 15:break;case 1:if($t!==null){var Ut=$t.memoizedProps,Vr=$t.memoizedState,Fe=w.stateNode,De=Fe.getSnapshotBeforeUpdate(w.elementType===w.type?Ut:Yi(w.type,Ut),Vr);Fe.__reactInternalSnapshotBeforeUpdate=De}break;case 3:var Ve=w.stateNode.containerInfo;Ve.nodeType===1?Ve.textContent="":Ve.nodeType===9&&Ve.documentElement&&Ve.removeChild(Ve.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ft){Br(w,w.return,ft)}if(O=w.sibling,O!==null){O.return=w.return,Ft=O;break}Ft=w.return}return $t=OV,OV=!1,$t}function hg(O,w,q){var W=w.updateQueue;if(W=W!==null?W.lastEffect:null,W!==null){var D=W=W.next;do{if((D.tag&O)===O){var K=D.destroy;D.destroy=void 0,K!==void 0&&j6(w,q,K)}D=D.next}while(D!==W)}}function Ly(O,w){if(w=w.updateQueue,w=w!==null?w.lastEffect:null,w!==null){var q=w=w.next;do{if((q.tag&O)===O){var W=q.create;q.destroy=W()}q=q.next}while(q!==w)}}function I6(O){var w=O.ref;if(w!==null){var q=O.stateNode;switch(O.tag){case 5:O=q;break;default:O=q}typeof w=="function"?w(O):w.current=O}}function yV(O){var w=O.alternate;w!==null&&(O.alternate=null,yV(w)),O.child=null,O.deletions=null,O.sibling=null,O.tag===5&&(w=O.stateNode,w!==null&&(delete w[Wa],delete w[rg],delete w[n6],delete w[f_e],delete w[b_e])),O.stateNode=null,O.return=null,O.dependencies=null,O.memoizedProps=null,O.memoizedState=null,O.pendingProps=null,O.stateNode=null,O.updateQueue=null}function AV(O){return O.tag===5||O.tag===3||O.tag===4}function vV(O){e:for(;;){for(;O.sibling===null;){if(O.return===null||AV(O.return))return null;O=O.return}for(O.sibling.return=O.return,O=O.sibling;O.tag!==5&&O.tag!==6&&O.tag!==18;){if(O.flags&2||O.child===null||O.tag===4)continue e;O.child.return=O,O=O.child}if(!(O.flags&2))return O.stateNode}}function D6(O,w,q){var W=O.tag;if(W===5||W===6)O=O.stateNode,w?q.nodeType===8?q.parentNode.insertBefore(O,w):q.insertBefore(O,w):(q.nodeType===8?(w=q.parentNode,w.insertBefore(O,q)):(w=q,w.appendChild(O)),q=q._reactRootContainer,q!=null||w.onclick!==null||(w.onclick=by));else if(W!==4&&(O=O.child,O!==null))for(D6(O,w,q),O=O.sibling;O!==null;)D6(O,w,q),O=O.sibling}function F6(O,w,q){var W=O.tag;if(W===5||W===6)O=O.stateNode,w?q.insertBefore(O,w):q.appendChild(O);else if(W!==4&&(O=O.child,O!==null))for(F6(O,w,q),O=O.sibling;O!==null;)F6(O,w,q),O=O.sibling}var D0=null,Zi=!1;function Au(O,w,q){for(q=q.child;q!==null;)xV(O,w,q),q=q.sibling}function xV(O,w,q){if($o&&typeof $o.onCommitFiberUnmount=="function")try{$o.onCommitFiberUnmount(E1,q)}catch{}switch(q.tag){case 5:a1||Lb(q,w);case 6:var W=D0,D=Zi;D0=null,Au(O,w,q),D0=W,Zi=D,D0!==null&&(Zi?(O=D0,q=q.stateNode,O.nodeType===8?O.parentNode.removeChild(q):O.removeChild(q)):D0.removeChild(q.stateNode));break;case 18:D0!==null&&(Zi?(O=D0,q=q.stateNode,O.nodeType===8?t6(O.parentNode,q):O.nodeType===1&&t6(O,q),Xm(O)):t6(D0,q.stateNode));break;case 4:W=D0,D=Zi,D0=q.stateNode.containerInfo,Zi=!0,Au(O,w,q),D0=W,Zi=D;break;case 0:case 11:case 14:case 15:if(!a1&&(W=q.updateQueue,W!==null&&(W=W.lastEffect,W!==null))){D=W=W.next;do{var K=D,le=K.destroy;K=K.tag,le!==void 0&&(K&2||K&4)&&j6(q,w,le),D=D.next}while(D!==W)}Au(O,w,q);break;case 1:if(!a1&&(Lb(q,w),W=q.stateNode,typeof W.componentWillUnmount=="function"))try{W.props=q.memoizedProps,W.state=q.memoizedState,W.componentWillUnmount()}catch(Te){Br(q,w,Te)}Au(O,w,q);break;case 21:Au(O,w,q);break;case 22:q.mode&1?(a1=(W=a1)||q.memoizedState!==null,Au(O,w,q),a1=W):Au(O,w,q);break;default:Au(O,w,q)}}function wV(O){var w=O.updateQueue;if(w!==null){O.updateQueue=null;var q=O.stateNode;q===null&&(q=O.stateNode=new q_e),w.forEach(function(W){var D=I_e.bind(null,O,W);q.has(W)||(q.add(W),W.then(D,D))})}}function Qi(O,w){var q=w.deletions;if(q!==null)for(var W=0;WD&&(D=le),W&=~K}if(W=D,W=Ar()-W,W=(120>W?120:480>W?480:1080>W?1080:1920>W?1920:3e3>W?3e3:4320>W?4320:1960*E_e(W/1960))-W,10O?16:O,xu===null)var W=!1;else{if(O=xu,xu=null,Fy=0,co&6)throw Error(n(331));var D=co;for(co|=4,Ft=O.current;Ft!==null;){var K=Ft,le=K.child;if(Ft.flags&16){var Te=K.deletions;if(Te!==null){for(var Le=0;LeAr()-H6?Sp(O,0):V6|=q),J1(O,w)}function PV(O,w){w===0&&(O.mode&1?(w=Dc,Dc<<=1,!(Dc&130023424)&&(Dc=4194304)):w=1);var q=N1();O=Uc(O,w),O!==null&&(Fm(O,w,q),J1(O,q))}function j_e(O){var w=O.memoizedState,q=0;w!==null&&(q=w.retryLane),PV(O,q)}function I_e(O,w){var q=0;switch(O.tag){case 13:var W=O.stateNode,D=O.memoizedState;D!==null&&(q=D.retryLane);break;case 19:W=O.stateNode;break;default:throw Error(n(314))}W!==null&&W.delete(w),PV(O,q)}var jV;jV=function(O,w,q){if(O!==null)if(O.memoizedProps!==w.pendingProps||K1.current)Z1=!0;else{if(!(O.lanes&q)&&!(w.flags&128))return Z1=!1,k_e(O,w,q);Z1=!!(O.flags&131072)}else Z1=!1,fr&&w.flags&1048576&&M$(w,Oy,w.index);switch(w.lanes=0,w.tag){case 2:var W=w.type;Ny(O,w),O=w.pendingProps;var D=Sb(w,r1.current);Wb(w,q),D=A6(null,w,W,O,D,q);var K=v6();return w.flags|=1,typeof D=="object"&&D!==null&&typeof D.render=="function"&&D.$$typeof===void 0?(w.tag=1,w.memoizedState=null,w.updateQueue=null,Y1(W)?(K=!0,gy(w)):K=!1,w.memoizedState=D.state!==null&&D.state!==void 0?D.state:null,h6(w),D.updater=Ey,w.stateNode=D,D._reactInternals=w,C6(w,W,O,q),w=E6(null,w,W,!0,K,q)):(w.tag=0,fr&&K&&s6(w),W1(null,w,D,q),w=w.child),w;case 16:W=w.elementType;e:{switch(Ny(O,w),O=w.pendingProps,D=W._init,W=D(W._payload),w.type=W,D=w.tag=F_e(W),O=Yi(W,O),D){case 0:w=T6(null,w,W,O,q);break e;case 1:w=dV(null,w,W,O,q);break e;case 11:w=iV(null,w,W,O,q);break e;case 14:w=aV(null,w,W,Yi(W.type,O),q);break e}throw Error(n(306,W,""))}return w;case 0:return W=w.type,D=w.pendingProps,D=w.elementType===W?D:Yi(W,D),T6(O,w,W,D,q);case 1:return W=w.type,D=w.pendingProps,D=w.elementType===W?D:Yi(W,D),dV(O,w,W,D,q);case 3:e:{if(pV(w),O===null)throw Error(n(387));W=w.pendingProps,K=w.memoizedState,D=K.element,k$(O,w),_y(w,W,null,q);var le=w.memoizedState;if(W=le.element,K.isDehydrated)if(K={element:W,isDehydrated:!1,cache:le.cache,pendingSuspenseBoundaries:le.pendingSuspenseBoundaries,transitions:le.transitions},w.updateQueue.baseState=K,w.memoizedState=K,w.flags&256){D=Bb(Error(n(423)),w),w=fV(O,w,W,q,D);break e}else if(W!==D){D=Bb(Error(n(424)),w),w=fV(O,w,W,q,D);break e}else for(Cs=mu(w.stateNode.containerInfo.firstChild),Ss=w,fr=!0,Ki=null,q=w$(w,null,W,q),w.child=q;q;)q.flags=q.flags&-3|4096,q=q.sibling;else{if(Rb(),W===D){w=Gc(O,w,q);break e}W1(O,w,W,q)}w=w.child}return w;case 5:return q$(w),O===null&&c6(w),W=w.type,D=w.pendingProps,K=O!==null?O.memoizedProps:null,le=D.children,Jk(W,D)?le=null:K!==null&&Jk(W,K)&&(w.flags|=32),uV(O,w),W1(O,w,le,q),w.child;case 6:return O===null&&c6(w),null;case 13:return bV(O,w,q);case 4:return m6(w,w.stateNode.containerInfo),W=w.pendingProps,O===null?w.child=Tb(w,null,W,q):W1(O,w,W,q),w.child;case 11:return W=w.type,D=w.pendingProps,D=w.elementType===W?D:Yi(W,D),iV(O,w,W,D,q);case 7:return W1(O,w,w.pendingProps,q),w.child;case 8:return W1(O,w,w.pendingProps.children,q),w.child;case 12:return W1(O,w,w.pendingProps.children,q),w.child;case 10:e:{if(W=w.type._context,D=w.pendingProps,K=w.memoizedProps,le=D.value,er(vy,W._currentValue),W._currentValue=le,K!==null)if(Gi(K.value,le)){if(K.children===D.children&&!K1.current){w=Gc(O,w,q);break e}}else for(K=w.child,K!==null&&(K.return=w);K!==null;){var Te=K.dependencies;if(Te!==null){le=K.child;for(var Le=Te.firstContext;Le!==null;){if(Le.context===W){if(K.tag===1){Le=Xc(-1,q&-q),Le.tag=2;var Ge=K.updateQueue;if(Ge!==null){Ge=Ge.shared;var at=Ge.pending;at===null?Le.next=Le:(Le.next=at.next,at.next=Le),Ge.pending=Le}}K.lanes|=q,Le=K.alternate,Le!==null&&(Le.lanes|=q),f6(K.return,q,w),Te.lanes|=q;break}Le=Le.next}}else if(K.tag===10)le=K.type===w.type?null:K.child;else if(K.tag===18){if(le=K.return,le===null)throw Error(n(341));le.lanes|=q,Te=le.alternate,Te!==null&&(Te.lanes|=q),f6(le,q,w),le=K.sibling}else le=K.child;if(le!==null)le.return=K;else for(le=K;le!==null;){if(le===w){le=null;break}if(K=le.sibling,K!==null){K.return=le.return,le=K;break}le=le.return}K=le}W1(O,w,D.children,q),w=w.child}return w;case 9:return D=w.type,W=w.pendingProps.children,Wb(w,q),D=oi(D),W=W(D),w.flags|=1,W1(O,w,W,q),w.child;case 14:return W=w.type,D=Yi(W,w.pendingProps),D=Yi(W.type,D),aV(O,w,W,D,q);case 15:return cV(O,w,w.type,w.pendingProps,q);case 17:return W=w.type,D=w.pendingProps,D=w.elementType===W?D:Yi(W,D),Ny(O,w),w.tag=1,Y1(W)?(O=!0,gy(w)):O=!1,Wb(w,q),J$(w,W,D),C6(w,W,D,q),E6(null,w,W,!0,O,q);case 19:return mV(O,w,q);case 22:return lV(O,w,q)}throw Error(n(156,w.tag))};function IV(O,w){return hp(O,w)}function D_e(O,w,q,W){this.tag=O,this.key=q,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=w,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=W,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ii(O,w,q,W){return new D_e(O,w,q,W)}function J6(O){return O=O.prototype,!(!O||!O.isReactComponent)}function F_e(O){if(typeof O=="function")return J6(O)?1:0;if(O!=null){if(O=O.$$typeof,O===B)return 11;if(O===I)return 14}return 2}function ku(O,w){var q=O.alternate;return q===null?(q=ii(O.tag,w,O.key,O.mode),q.elementType=O.elementType,q.type=O.type,q.stateNode=O.stateNode,q.alternate=O,O.alternate=q):(q.pendingProps=w,q.type=O.type,q.flags=0,q.subtreeFlags=0,q.deletions=null),q.flags=O.flags&14680064,q.childLanes=O.childLanes,q.lanes=O.lanes,q.child=O.child,q.memoizedProps=O.memoizedProps,q.memoizedState=O.memoizedState,q.updateQueue=O.updateQueue,w=O.dependencies,q.dependencies=w===null?null:{lanes:w.lanes,firstContext:w.firstContext},q.sibling=O.sibling,q.index=O.index,q.ref=O.ref,q}function Uy(O,w,q,W,D,K){var le=2;if(W=O,typeof O=="function")J6(O)&&(le=1);else if(typeof O=="string")le=5;else e:switch(O){case S:return qp(q.children,D,K,w);case C:le=8,D|=8;break;case R:return O=ii(12,q,w,D|2),O.elementType=R,O.lanes=K,O;case N:return O=ii(13,q,w,D),O.elementType=N,O.lanes=K,O;case j:return O=ii(19,q,w,D),O.elementType=j,O.lanes=K,O;case $:return Xy(q,D,K,w);default:if(typeof O=="object"&&O!==null)switch(O.$$typeof){case T:le=10;break e;case E:le=9;break e;case B:le=11;break e;case I:le=14;break e;case P:le=16,W=null;break e}throw Error(n(130,O==null?O:typeof O,""))}return w=ii(le,q,w,D),w.elementType=O,w.type=W,w.lanes=K,w}function qp(O,w,q,W){return O=ii(7,O,W,w),O.lanes=q,O}function Xy(O,w,q,W){return O=ii(22,O,W,w),O.elementType=$,O.lanes=q,O.stateNode={isHidden:!1},O}function eS(O,w,q){return O=ii(6,O,null,w),O.lanes=q,O}function tS(O,w,q){return w=ii(4,O.children!==null?O.children:[],O.key,w),w.lanes=q,w.stateNode={containerInfo:O.containerInfo,pendingChildren:null,implementation:O.implementation},w}function $_e(O,w,q,W,D){this.tag=w,this.containerInfo=O,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Sk(0),this.expirationTimes=Sk(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sk(0),this.identifierPrefix=W,this.onRecoverableError=D,this.mutableSourceEagerHydrationData=null}function nS(O,w,q,W,D,K,le,Te,Le){return O=new $_e(O,w,q,Te,Le),w===1?(w=1,K===!0&&(w|=8)):w=0,K=ii(3,null,null,w),O.current=K,K.stateNode=O,K.memoizedState={element:W,isDehydrated:q,cache:null,transitions:null,pendingSuspenseBoundaries:null},h6(K),O}function V_e(O,w,q){var W=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),uS.exports=pke(),uS.exports}var hs=Tre(),eA={},tH;function fke(){if(tH)return eA;tH=1;var e=Tre();return eA.createRoot=e.createRoot,eA.hydrateRoot=e.hydrateRoot,eA}var kN=fke();const bke=e=>typeof e=="number"?!1:typeof e?.valueOf()=="string"||Array.isArray(e)?!e.length:!e,f0={OS:"web",select:e=>"web"in e?e.web:e.default,isWeb:!0};/*! * is-plain-object * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. - */function nH(e){return Object.prototype.toString.call(e)==="[object Object]"}function a3(e){var t,n;return nH(e)===!1?!1:(t=e.constructor,t===void 0?!0:(n=t.prototype,!(nH(n)===!1||n.hasOwnProperty("isPrototypeOf")===!1)))}var pE=function(e,t){return pE=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(n[r]=o[r])},pE(e,t)};function hke(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");pE(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Pr=function(){return Pr=Object.assign||function(t){for(var n,o=1,r=arguments.length;o0&&n>="0"&&n<="9"?"_"+n+o:""+n.toUpperCase()+o}function w4(e,t){return t===void 0&&(t={}),M5(e,Pr({delimiter:"",transform:Ere},t))}function zke(e,t){return t===0?e.toLowerCase():Ere(e,t)}function SN(e,t){return t===void 0&&(t={}),w4(e,Pr({transform:zke},t))}function Oke(e){return e.charAt(0).toUpperCase()+e.substr(1)}function yke(e){return Oke(e.toLowerCase())}function Wre(e,t){return t===void 0&&(t={}),M5(e,Pr({delimiter:" ",transform:yke},t))}function Ake(e,t){return t===void 0&&(t={}),M5(e,Pr({delimiter:"."},t))}function Ti(e,t){return t===void 0&&(t={}),Ake(e,Pr({delimiter:"-"},t))}function vke(e){return e.replace(/>/g,">")}const xke=/[\u007F-\u009F "'>/="\uFDD0-\uFDEF]/;function Nre(e){return e.replace(/&(?!([a-z0-9]+|#[0-9]+|#x[a-f0-9]+);)/gi,"&")}function wke(e){return e.replace(/"/g,""")}function Bre(e){return e.replace(/{typeof o=="string"&&o.trim()!==""&&(n+=o)}),x.createElement("div",{dangerouslySetInnerHTML:{__html:n},...t})}const{Provider:kke,Consumer:Ske}=x.createContext(void 0),Cke=x.forwardRef(()=>null),qke=new Set(["string","boolean","number"]),Rke=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),Tke=new Set(["allowfullscreen","allowpaymentrequest","allowusermedia","async","autofocus","autoplay","checked","controls","default","defer","disabled","download","formnovalidate","hidden","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","typemustmatch"]),Eke=new Set(["autocapitalize","autocomplete","charset","contenteditable","crossorigin","decoding","dir","draggable","enctype","formenctype","formmethod","http-equiv","inputmode","kind","method","preload","scope","shape","spellcheck","translate","type","wrap"]),Wke=new Set(["animation","animationIterationCount","baselineShift","borderImageOutset","borderImageSlice","borderImageWidth","columnCount","cx","cy","fillOpacity","flexGrow","flexShrink","floodOpacity","fontWeight","gridColumnEnd","gridColumnStart","gridRowEnd","gridRowStart","lineHeight","opacity","order","orphans","r","rx","ry","shapeImageThreshold","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","tabSize","widows","x","y","zIndex","zoom"]);function Pre(e,t){return t.some(n=>e.indexOf(n)===0)}function Nke(e){return e==="key"||e==="children"}function Bke(e,t){switch(e){case"style":return Fke(t)}return t}const rH=["accentHeight","alignmentBaseline","arabicForm","baselineShift","capHeight","clipPath","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","dominantBaseline","enableBackground","fillOpacity","fillRule","floodColor","floodOpacity","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","horizAdvX","horizOriginX","imageRendering","letterSpacing","lightingColor","markerEnd","markerMid","markerStart","overlinePosition","overlineThickness","paintOrder","panose1","pointerEvents","renderingIntent","shapeRendering","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","textAnchor","textDecoration","textRendering","underlinePosition","underlineThickness","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","vHanging","vIdeographic","vMathematical","vectorEffect","vertAdvY","vertOriginX","vertOriginY","wordSpacing","writingMode","xmlnsXlink","xHeight"].reduce((e,t)=>(e[t.toLowerCase()]=t,e),{}),sH=["allowReorder","attributeName","attributeType","autoReverse","baseFrequency","baseProfile","calcMode","clipPathUnits","contentScriptType","contentStyleType","diffuseConstant","edgeMode","externalResourcesRequired","filterRes","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","suppressContentEditableWarning","suppressHydrationWarning","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector"].reduce((e,t)=>(e[t.toLowerCase()]=t,e),{}),iH=["xlink:actuate","xlink:arcrole","xlink:href","xlink:role","xlink:show","xlink:title","xlink:type","xml:base","xml:lang","xml:space","xmlns:xlink"].reduce((e,t)=>(e[t.replace(":","").toLowerCase()]=t,e),{});function Lke(e){switch(e){case"htmlFor":return"for";case"className":return"class"}const t=e.toLowerCase();return sH[t]?sH[t]:rH[t]?Ti(rH[t]):iH[t]?iH[t]:t}function Pke(e){return e.startsWith("--")?e:Pre(e,["ms","O","Moz","Webkit"])?"-"+Ti(e):Ti(e)}function jke(e,t){return typeof t=="number"&&t!==0&&!Wke.has(e)?t+"px":t}function M1(e,t,n={}){if(e==null||e===!1)return"";if(Array.isArray(e))return hM(e,t,n);switch(typeof e){case"string":return fE(e);case"number":return e.toString()}const{type:o,props:r}=e;switch(o){case x.StrictMode:case x.Fragment:return hM(r.children,t,n);case i0:const{children:s,...i}=r;return aH(Object.keys(i).length?"div":null,{...i,dangerouslySetInnerHTML:{__html:s}},t,n)}switch(typeof o){case"string":return aH(o,r,t,n);case"function":return o.prototype&&typeof o.prototype.render=="function"?Ike(o,r,t,n):M1(o(r,n),t,n)}switch(o&&o.$$typeof){case kke.$$typeof:return hM(r.children,r.value,n);case Ske.$$typeof:return M1(r.children(t||o._currentValue),t,n);case Cke.$$typeof:return M1(o.render(r),t,n)}return""}function aH(e,t,n,o={}){let r="";if(e==="textarea"&&t.hasOwnProperty("value")){r=hM(t.value,n,o);const{value:i,...c}=t;t=c}else t.dangerouslySetInnerHTML&&typeof t.dangerouslySetInnerHTML.__html=="string"?r=t.dangerouslySetInnerHTML.__html:typeof t.children<"u"&&(r=hM(t.children,n,o));if(!e)return r;const s=Dke(t);return Rke.has(e)?"<"+e+s+"/>":"<"+e+s+">"+r+""}function Ike(e,t,n,o={}){const r=new e(t,o);return typeof r.getChildContext=="function"&&Object.assign(o,r.getChildContext()),M1(r.render(),n,o)}function hM(e,t,n={}){let o="";e=Array.isArray(e)?e:[e];for(let r=0;r=0),g.type){case"b":p=parseInt(p,10).toString(2);break;case"c":p=String.fromCharCode(parseInt(p,10));break;case"d":case"i":p=parseInt(p,10);break;case"j":p=JSON.stringify(p,null,g.width?parseInt(g.width):0);break;case"e":p=g.precision?parseFloat(p).toExponential(g.precision):parseFloat(p).toExponential();break;case"f":p=g.precision?parseFloat(p).toFixed(g.precision):parseFloat(p);break;case"g":p=g.precision?String(Number(p.toPrecision(g.precision))):parseFloat(p);break;case"o":p=(parseInt(p,10)>>>0).toString(8);break;case"s":p=String(p),p=g.precision?p.substring(0,g.precision):p;break;case"t":p=String(!!p),p=g.precision?p.substring(0,g.precision):p;break;case"T":p=Object.prototype.toString.call(p).slice(8,-1).toLowerCase(),p=g.precision?p.substring(0,g.precision):p;break;case"u":p=parseInt(p,10)>>>0;break;case"v":p=p.valueOf(),p=g.precision?p.substring(0,g.precision):p;break;case"x":p=(parseInt(p,10)>>>0).toString(16);break;case"X":p=(parseInt(p,10)>>>0).toString(16).toUpperCase();break}t.json.test(g.type)?f+=p:(t.number.test(g.type)&&(!v||g.sign)?(M=v?"+":"-",p=p.toString().replace(t.sign,"")):M="",A=g.pad_char?g.pad_char==="0"?"0":g.pad_char.charAt(1):" ",_=g.width-(M+p).length,z=g.width&&_>0?A.repeat(_):"",f+=g.align?M+p+z:A==="0"?M+z+p:z+M+p)}return f}var s=Object.create(null);function i(c){if(s[c])return s[c];for(var l=c,u,d=[],p=0;l;){if((u=t.text.exec(l))!==null)d.push(u[0]);else if((u=t.modulo.exec(l))!==null)d.push("%");else if((u=t.placeholder.exec(l))!==null){if(u[2]){p|=1;var f=[],b=u[2],h=[];if((h=t.key.exec(b))!==null)for(f.push(h[1]);(b=b.substring(h[0].length))!=="";)if((h=t.key_access.exec(b))!==null)f.push(h[1]);else if((h=t.index_access.exec(b))!==null)f.push(h[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");u[2]=f}else p|=2;if(p===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");d.push({placeholder:u[0],param_no:u[1],keys:u[2],sign:u[3],pad_char:u[4],align:u[5],width:u[6],precision:u[7],type:u[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");l=l.substring(u[0].length)}return s[c]=d}e.sprintf=n,e.vsprintf=o,typeof window<"u"&&(window.sprintf=n,window.vsprintf=o)})()}(fS)),fS}var Vke=$ke();const Hke=Zr(Vke),Uke=Hs(console.error);function xe(e,...t){try{return Hke.sprintf(e,...t)}catch(n){return n instanceof Error&&Uke(`sprintf error: - -`+n.toString()),e}}var bE,jre,Kg,Ire;bE={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1};jre=["(","?"];Kg={")":["("],":":["?","?:"]};Ire=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;function Xke(e){for(var t=[],n=[],o,r,s,i;o=e.match(Ire);){for(r=o[0],s=e.substr(0,o.index).trim(),s&&t.push(s);i=n.pop();){if(Kg[r]){if(Kg[r][0]===i){r=Kg[r][1]||r;break}}else if(jre.indexOf(i)>=0||bE[i]":function(e,t){return e>t},">=":function(e,t){return e>=t},"==":function(e,t){return e===t},"!=":function(e,t){return e!==t},"&&":function(e,t){return e&&t},"||":function(e,t){return e||t},"?:":function(e,t,n){if(e)throw t;return n}};function Kke(e,t){var n=[],o,r,s,i,c,l;for(o=0;o{const o=new CN({}),r=new Set,s=()=>{r.forEach(M=>M())},i=M=>(r.add(M),()=>r.delete(M)),c=(M="default")=>o.data[M],l=(M,y="default")=>{o.data[y]={...o.data[y],...M},o.data[y][""]={...uH[""],...o.data[y]?.[""]},delete o.pluralForms[y]},u=(M,y)=>{l(M,y),s()},d=(M,y="default")=>{o.data[y]={...o.data[y],...M,"":{...uH[""],...o.data[y]?.[""],...M?.[""]}},delete o.pluralForms[y],s()},p=(M,y)=>{o.data={},o.pluralForms={},u(M,y)},f=(M="default",y,k,S,C)=>(o.data[M]||l(void 0,M),o.dcnpgettext(M,y,k,S,C)),b=(M="default")=>M,h=(M,y)=>{let k=f(y,void 0,M);return n?(k=n.applyFilters("i18n.gettext",k,M,y),n.applyFilters("i18n.gettext_"+b(y),k,M,y)):k},g=(M,y,k)=>{let S=f(k,y,M);return n?(S=n.applyFilters("i18n.gettext_with_context",S,M,y,k),n.applyFilters("i18n.gettext_with_context_"+b(k),S,M,y,k)):S},z=(M,y,k,S)=>{let C=f(S,void 0,M,y,k);return n?(C=n.applyFilters("i18n.ngettext",C,M,y,k,S),n.applyFilters("i18n.ngettext_"+b(S),C,M,y,k,S)):C},A=(M,y,k,S,C)=>{let R=f(C,S,M,y,k);return n?(R=n.applyFilters("i18n.ngettext_with_context",R,M,y,k,S,C),n.applyFilters("i18n.ngettext_with_context_"+b(C),R,M,y,k,S,C)):R},_=()=>g("ltr","text direction")==="rtl",v=(M,y,k)=>{const S=y?y+""+M:M;let C=!!o.data?.[k??"default"]?.[S];return n&&(C=n.applyFilters("i18n.has_translation",C,M,y,k),C=n.applyFilters("i18n.has_translation_"+b(k),C,M,y,k)),C};if(n){const M=y=>{Jke.test(y)&&s()};n.addAction("hookAdded","core/i18n",M),n.addAction("hookRemoved","core/i18n",M)}return{getLocaleData:c,setLocaleData:u,addLocaleData:d,resetLocaleData:p,subscribe:i,__:h,_x:g,_n:z,_nx:A,isRTL:_,hasTranslation:v}};function Dre(e){return typeof e!="string"||e===""?(console.error("The namespace must be a non-empty string."),!1):/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(e)?!0:(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)}function qN(e){return typeof e!="string"||e===""?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(e)?(console.error("The hook name cannot begin with `__`."),!1):/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(e)?!0:(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)}function dH(e,t){return function(o,r,s,i=10){const c=e[t];if(!qN(o)||!Dre(r))return;if(typeof s!="function"){console.error("The hook callback must be a function.");return}if(typeof i!="number"){console.error("If specified, the hook priority must be a number.");return}const l={callback:s,priority:i,namespace:r};if(c[o]){const u=c[o].handlers;let d;for(d=u.length;d>0&&!(i>=u[d-1].priority);d--);d===u.length?u[d]=l:u.splice(d,0,l),c.__current.forEach(p=>{p.name===o&&p.currentIndex>=d&&p.currentIndex++})}else c[o]={handlers:[l],runs:0};o!=="hookAdded"&&e.doAction("hookAdded",o,r,s,i)}}function tA(e,t,n=!1){return function(r,s){const i=e[t];if(!qN(r)||!n&&!Dre(s))return;if(!i[r])return 0;let c=0;if(n)c=i[r].handlers.length,i[r]={runs:i[r].runs,handlers:[]};else{const l=i[r].handlers;for(let u=l.length-1;u>=0;u--)l[u].namespace===s&&(l.splice(u,1),c++,i.__current.forEach(d=>{d.name===r&&d.currentIndex>=u&&d.currentIndex--}))}return r!=="hookRemoved"&&e.doAction("hookRemoved",r,s),c}}function pH(e,t){return function(o,r){const s=e[t];return typeof r<"u"?o in s&&s[o].handlers.some(i=>i.namespace===r):o in s}}function nA(e,t,n,o){return function(s,...i){const c=e[t];c[s]||(c[s]={handlers:[],runs:0}),c[s].runs++;const l=c[s].handlers;if(!l||!l.length)return n?i[0]:void 0;const u={name:s,currentIndex:0};async function d(){try{c.__current.add(u);let f=n?i[0]:void 0;for(;u.currentIndex"u"?r.__current.size>0:Array.from(r.__current).some(s=>s.name===o)}}function hH(e,t){return function(o){const r=e[t];if(qN(o))return r[o]&&r[o].runs?r[o].runs:0}}class t6e{constructor(){this.actions=Object.create(null),this.actions.__current=new Set,this.filters=Object.create(null),this.filters.__current=new Set,this.addAction=dH(this,"actions"),this.addFilter=dH(this,"filters"),this.removeAction=tA(this,"actions"),this.removeFilter=tA(this,"filters"),this.hasAction=pH(this,"actions"),this.hasFilter=pH(this,"filters"),this.removeAllActions=tA(this,"actions",!0),this.removeAllFilters=tA(this,"filters",!0),this.doAction=nA(this,"actions",!1,!1),this.doActionAsync=nA(this,"actions",!1,!0),this.applyFilters=nA(this,"filters",!0,!1),this.applyFiltersAsync=nA(this,"filters",!0,!0),this.currentAction=fH(this,"actions"),this.currentFilter=fH(this,"filters"),this.doingAction=bH(this,"actions"),this.doingFilter=bH(this,"filters"),this.didAction=hH(this,"actions"),this.didFilter=hH(this,"filters")}}function Fre(){return new t6e}const $re=Fre(),{addAction:_4,addFilter:Bn,removeAction:hE,removeFilter:mE,hasAction:vmn,hasFilter:Vre,removeAllActions:xmn,removeAllFilters:wmn,doAction:RN,doActionAsync:n6e,applyFilters:gr,applyFiltersAsync:o6e,currentAction:_mn,currentFilter:kmn,doingAction:Smn,doingFilter:Cmn,didAction:qmn,didFilter:Rmn,actions:Tmn,filters:Emn}=$re,a0=e6e(void 0,void 0,$re);a0.getLocaleData.bind(a0);a0.setLocaleData.bind(a0);a0.resetLocaleData.bind(a0);a0.subscribe.bind(a0);const m=a0.__.bind(a0),We=a0._x.bind(a0),Dn=a0._n.bind(a0);a0._nx.bind(a0);const jt=a0.isRTL.bind(a0);a0.hasTranslation.bind(a0);function r6e(e){const t=(n,o)=>{const{headers:r={}}=n;for(const s in r)if(s.toLowerCase()==="x-wp-nonce"&&r[s]===t.nonce)return o(n);return o({...n,headers:{...r,"X-WP-Nonce":t.nonce}})};return t.nonce=e,t}const Hre=(e,t)=>{let n=e.path,o,r;return typeof e.namespace=="string"&&typeof e.endpoint=="string"&&(o=e.namespace.replace(/^\/|\/$/g,""),r=e.endpoint.replace(/^\//,""),r?n=o+"/"+r:n=o),delete e.namespace,delete e.endpoint,t({...e,path:n})},s6e=e=>(t,n)=>Hre(t,o=>{let r=o.url,s=o.path,i;return typeof s=="string"&&(i=e,e.indexOf("?")!==-1&&(s=s.replace("?","&")),s=s.replace(/^\//,""),typeof i=="string"&&i.indexOf("?")!==-1&&(s=s.replace("?","&")),r=i+s),n({...o,url:r})});function Pf(e){try{return new URL(e),!0}catch{return!1}}const i6e=/^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\.[a-z]{2,63}$/i;function Ure(e){return i6e.test(e)}const a6e=/^(tel:)?(\+)?\d{6,15}$/;function c6e(e){return e=e.replace(/[-.() ]/g,""),a6e.test(e)}function O5(e){const t=/^([^\s:]+:)/.exec(e);if(t)return t[1]}function TN(e){return e?/^[a-z\-.\+]+[0-9]*:$/i.test(e):!1}function EN(e){const t=/^[^\/\s:]+:(?:\/\/)?\/?([^\/\s#?]+)[\/#?]{0,1}\S*$/.exec(e);if(t)return t[1]}function l6e(e){return e?/^[^\s#?]+$/.test(e):!1}function Aa(e){const t=/^[^\/\s:]+:(?:\/\/)?[^\/\s#?]+[\/]([^\s#?]+)[#?]{0,1}\S*$/.exec(e);if(t)return t[1]}function u6e(e){return e?/^[^\s#?]+$/.test(e):!1}function WN(e){let t;try{t=new URL(e,"http://example.com").search.substring(1)}catch{}if(t)return t}function y5(e){let t="";const n=Object.entries(e);let o;for(;o=n.shift();){let[r,s]=o;if(Array.isArray(s)||s&&s.constructor===Object){const c=Object.entries(s).reverse();for(const[l,u]of c)n.unshift([`${r}[${l}]`,u])}else s!==void 0&&(s===null&&(s=""),t+="&"+[r,s].map(encodeURIComponent).join("="))}return t.substr(1)}function d6e(e){return e?/^[^\s#?\/]+$/.test(e):!1}function p6e(e){const t=Aa(e),n=WN(e);let o="/";return t&&(o+=t),n&&(o+=`?${n}`),o}function f6e(e){const t=/^\S+?(#[^\s\?]*)/.exec(e);if(t)return t[1]}function gE(e){return e?/^#[^\s#?\/]*$/.test(e):!1}function Y2(e){try{return decodeURIComponent(e)}catch{return e}}function b6e(e,t,n){const o=t.length,r=o-1;for(let s=0;s{const[o,r=""]=n.split("=").filter(Boolean).map(Y2);if(o){const s=o.replace(/\]/g,"").split("[");b6e(t,s,r)}return t},Object.create(null))}function tn(e="",t){if(!t||!Object.keys(t).length)return e;let n=e;const o=e.indexOf("?");return o!==-1&&(t=Object.assign(Lh(e),t),n=n.substr(0,o)),n+"?"+y5(t)}function ME(e,t){return Lh(e)[t]}function mH(e,t){return ME(e,t)!==void 0}function k4(e,...t){const n=e.indexOf("?");if(n===-1)return e;const o=Lh(e),r=e.substr(0,n);t.forEach(i=>delete o[i]);const s=y5(o);return s?r+"?"+s:r}const h6e=/^(?:[a-z]+:|#|\?|\.|\/)/i;function jf(e){return e&&(e=e.trim(),!h6e.test(e)&&!Ure(e)?"http://"+e:e)}function c3(e){try{return decodeURI(e)}catch{return e}}function Ph(e,t=null){if(!e)return"";let n=e.replace(/^[a-z\-.\+]+[0-9]*:(\/\/)?/i,"").replace(/^www\./i,"");n.match(/^[^\/]+\/$/)&&(n=n.replace("/",""));const o=/\/([^\/?]+)\.(?:[\w]+)(?=\?|$)/;if(!t||n.length<=t||!n.match(o))return n;n=n.split("?")[0];const r=n.split("/"),s=r[r.length-1];if(s.length<=t)return"…"+n.slice(-t);const i=s.lastIndexOf("."),[c,l]=[s.slice(0,i),s.slice(i+1)],u=c.slice(-3)+"."+l;return s.slice(0,t-u.length-1)+"…"+u}var yg={exports:{}},gH;function m6e(){if(gH)return yg.exports;gH=1;var e={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},t=Object.keys(e).join("|"),n=new RegExp(t,"g"),o=new RegExp(t,"");function r(c){return e[c]}var s=function(c){return c.replace(n,r)},i=function(c){return!!c.match(o)};return yg.exports=s,yg.exports.has=i,yg.exports.remove=s,yg.exports}var g6e=m6e();const ms=Zr(g6e);function A5(e){return e?ms(e).replace(/[\s\./]+/g,"-").replace(/[^\p{L}\p{N}_-]+/gu,"").toLowerCase().replace(/-+/g,"-").replace(/(^-+)|(-+$)/g,""):""}function If(e){let t;if(e){try{t=new URL(e,"http://example.com").pathname.split("/").pop()}catch{}if(t)return t}}function MH(e){const t=e.split("?"),n=t[1],o=t[0];return n?o+"?"+n.split("&").map(r=>r.split("=")).map(r=>r.map(decodeURIComponent)).sort((r,s)=>r[0].localeCompare(s[0])).map(r=>r.map(encodeURIComponent)).map(r=>r.join("=")).join("&"):o}function M6e(e){const t=Object.fromEntries(Object.entries(e).map(([n,o])=>[MH(n),o]));return(n,o)=>{const{parse:r=!0}=n;let s=n.path;if(!s&&n.url){const{rest_route:l,...u}=Lh(n.url);typeof l=="string"&&(s=tn(l,u))}if(typeof s!="string")return o(n);const i=n.method||"GET",c=MH(s);if(i==="GET"&&t[c]){const l=t[c];return delete t[c],zH(l,!!r)}else if(i==="OPTIONS"&&t[i]&&t[i][c]){const l=t[i][c];return delete t[i][c],zH(l,!!r)}return o(n)}}function zH(e,t){return Promise.resolve(t?e.body:new window.Response(JSON.stringify(e.body),{status:200,statusText:"OK",headers:e.headers}))}const z6e=({path:e,url:t,...n},o)=>({...n,url:t&&tn(t,o),path:e&&tn(e,o)}),OH=e=>e.json?e.json():Promise.reject(e),O6e=e=>{if(!e)return{};const t=e.match(/<([^>]+)>; rel="next"/);return t?{next:t[1]}:{}},yH=e=>{const{next:t}=O6e(e.headers.get("link"));return t},y6e=e=>{const t=!!e.path&&e.path.indexOf("per_page=-1")!==-1,n=!!e.url&&e.url.indexOf("per_page=-1")!==-1;return t||n},Xre=async(e,t)=>{if(e.parse===!1||!y6e(e))return t(e);const n=await Tt({...z6e(e,{per_page:100}),parse:!1}),o=await OH(n);if(!Array.isArray(o))return o;let r=yH(n);if(!r)return o;let s=[].concat(o);for(;r;){const i=await Tt({...e,path:void 0,url:r,parse:!1}),c=await OH(i);s=s.concat(c),r=yH(i)}return s},A6e=new Set(["PATCH","PUT","DELETE"]),v6e="GET",x6e=(e,t)=>{const{method:n=v6e}=e;return A6e.has(n.toUpperCase())&&(e={...e,headers:{...e.headers,"X-HTTP-Method-Override":n,"Content-Type":"application/json"},method:"POST"}),t(e)},w6e=(e,t)=>(typeof e.url=="string"&&!mH(e.url,"_locale")&&(e.url=tn(e.url,{_locale:"user"})),typeof e.path=="string"&&!mH(e.path,"_locale")&&(e.path=tn(e.path,{_locale:"user"})),t(e)),_6e=(e,t=!0)=>t?e.status===204?null:e.json?e.json():Promise.reject(e):e,k6e=e=>{const t={code:"invalid_json",message:m("The response is not a valid JSON response.")};if(!e||!e.json)throw t;return e.json().catch(()=>{throw t})},Gre=(e,t=!0)=>Promise.resolve(_6e(e,t)).catch(n=>NN(n,t));function NN(e,t=!0){if(!t)throw e;return k6e(e).then(n=>{const o={code:"unknown_error",message:m("An unknown error occurred.")};throw n||o})}function S6e(e){const t=!!e.method&&e.method==="POST";return(!!e.path&&e.path.indexOf("/wp/v2/media")!==-1||!!e.url&&e.url.indexOf("/wp/v2/media")!==-1)&&t}const C6e=(e,t)=>{if(!S6e(e))return t(e);let n=0;const o=5,r=s=>(n++,t({path:`/wp/v2/media/${s}/post-process`,method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch(()=>n{if(!s.headers)return Promise.reject(s);const i=s.headers.get("x-wp-upload-attachment-id");return s.status>=500&&s.status<600&&i?r(i).catch(()=>e.parse!==!1?Promise.reject({code:"post_process",message:m("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(s)):NN(s,e.parse)}).then(s=>Gre(s,e.parse))},q6e=e=>(t,n)=>{if(typeof t.url=="string"){const o=ME(t.url,"wp_theme_preview");o===void 0?t.url=tn(t.url,{wp_theme_preview:e}):o===""&&(t.url=k4(t.url,"wp_theme_preview"))}if(typeof t.path=="string"){const o=ME(t.path,"wp_theme_preview");o===void 0?t.path=tn(t.path,{wp_theme_preview:e}):o===""&&(t.path=k4(t.path,"wp_theme_preview"))}return n(t)},R6e={Accept:"application/json, */*;q=0.1"},T6e={credentials:"include"},Kre=[w6e,Hre,x6e,Xre];function E6e(e){Kre.unshift(e)}const Yre=e=>{if(e.status>=200&&e.status<300)return e;throw e},W6e=e=>{const{url:t,path:n,data:o,parse:r=!0,...s}=e;let{body:i,headers:c}=e;return c={...R6e,...c},o&&(i=JSON.stringify(o),c["Content-Type"]="application/json"),window.fetch(t||n||window.location.href,{...T6e,...s,body:i,headers:c}).then(u=>Promise.resolve(u).then(Yre).catch(d=>NN(d,r)).then(d=>Gre(d,r)),u=>{throw u&&u.name==="AbortError"?u:{code:"fetch_error",message:m("You are probably offline.")}})};let Zre=W6e;function N6e(e){Zre=e}function Tt(e){return Kre.reduceRight((n,o)=>r=>o(r,n),Zre)(e).catch(n=>n.code!=="rest_cookie_invalid_nonce"?Promise.reject(n):window.fetch(Tt.nonceEndpoint).then(Yre).then(o=>o.text()).then(o=>(Tt.nonceMiddleware.nonce=o,Tt(e))))}Tt.use=E6e;Tt.setFetchHandler=N6e;Tt.createNonceMiddleware=r6e;Tt.createPreloadingMiddleware=M6e;Tt.createRootURLMiddleware=s6e;Tt.fetchAllMiddleware=Xre;Tt.mediaUploadMiddleware=C6e;Tt.createThemePreviewMiddleware=q6e;const AH=Object.create(null);function Ke(e,t={}){const{since:n,version:o,alternative:r,plugin:s,link:i,hint:c}=t,l=s?` from ${s}`:"",u=n?` since version ${n}`:"",d=o?` and will be removed${l} in version ${o}`:"",p=r?` Please use ${r} instead.`:"",f=i?` See: ${i}`:"",b=c?` Note: ${c}`:"",h=`${e} is deprecated${u}${d}.${p}${f}${b}`;h in AH||(RN("deprecated",e,t,h),console.warn(h),AH[h]=!0)}function os(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var B6e=typeof Symbol=="function"&&Symbol.observable||"@@observable",vH=B6e,bS=()=>Math.random().toString(36).substring(7).split("").join("."),L6e={INIT:`@@redux/INIT${bS()}`,REPLACE:`@@redux/REPLACE${bS()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${bS()}`},xH=L6e;function P6e(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Qre(e,t,n){if(typeof e!="function")throw new Error(os(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(os(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(os(1));return n(Qre)(e,t)}let o=e,r=t,s=new Map,i=s,c=0,l=!1;function u(){i===s&&(i=new Map,s.forEach((z,A)=>{i.set(A,z)}))}function d(){if(l)throw new Error(os(3));return r}function p(z){if(typeof z!="function")throw new Error(os(4));if(l)throw new Error(os(5));let A=!0;u();const _=c++;return i.set(_,z),function(){if(A){if(l)throw new Error(os(6));A=!1,u(),i.delete(_),s=null}}}function f(z){if(!P6e(z))throw new Error(os(7));if(typeof z.type>"u")throw new Error(os(8));if(typeof z.type!="string")throw new Error(os(17));if(l)throw new Error(os(9));try{l=!0,r=o(r,z)}finally{l=!1}return(s=i).forEach(_=>{_()}),z}function b(z){if(typeof z!="function")throw new Error(os(10));o=z,f({type:xH.REPLACE})}function h(){const z=p;return{subscribe(A){if(typeof A!="object"||A===null)throw new Error(os(11));function _(){const M=A;M.next&&M.next(d())}return _(),{unsubscribe:z(_)}},[vH](){return this}}}return f({type:xH.INIT}),{dispatch:f,subscribe:p,getState:d,replaceReducer:b,[vH]:h}}function j6e(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...o)=>t(n(...o)))}function I6e(...e){return t=>(n,o)=>{const r=t(n,o);let s=()=>{throw new Error(os(15))};const i={getState:r.getState,dispatch:(l,...u)=>s(l,...u)},c=e.map(l=>l(i));return s=j6e(...c)(r.dispatch),{...r,dispatch:s}}}var hS,wH;function D6e(){if(wH)return hS;wH=1;function e(i){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?e=function(c){return typeof c}:e=function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},e(i)}function t(i,c){if(!(i instanceof c))throw new TypeError("Cannot call a class as a function")}function n(i,c){for(var l=0;l1&&arguments[1]!==void 0?arguments[1]:this;this._map.forEach(function(p,f){f!==null&&e(f)==="object"&&(p=p[1]),l.call(d,p,f,u)})}},{key:"clear",value:function(){this._map=new Map,this._arrayTreeMap=new Map,this._objectTreeMap=new Map}},{key:"size",get:function(){return this._map.size}}]),i}();return hS=s,hS}var F6e=D6e();const Va=Zr(F6e);function $6e(e){return!!e&&typeof e[Symbol.iterator]=="function"&&typeof e.next=="function"}var mS={},Vo={},oA={},_H;function Jre(){if(_H)return oA;_H=1,Object.defineProperty(oA,"__esModule",{value:!0});var e={all:Symbol("all"),error:Symbol("error"),fork:Symbol("fork"),join:Symbol("join"),race:Symbol("race"),call:Symbol("call"),cps:Symbol("cps"),subscribe:Symbol("subscribe")};return oA.default=e,oA}var kH;function e0e(){if(kH)return Vo;kH=1,Object.defineProperty(Vo,"__esModule",{value:!0}),Vo.createChannel=Vo.subscribe=Vo.cps=Vo.apply=Vo.call=Vo.invoke=Vo.delay=Vo.race=Vo.join=Vo.fork=Vo.error=Vo.all=void 0;var e=Jre(),t=n(e);function n(o){return o&&o.__esModule?o:{default:o}}return Vo.all=function(r){return{type:t.default.all,value:r}},Vo.error=function(r){return{type:t.default.error,error:r}},Vo.fork=function(r){for(var s=arguments.length,i=Array(s>1?s-1:0),c=1;c1?s-1:0),c=1;c2?i-2:0),l=2;l1?s-1:0),c=1;c"u"?"undefined":e(i))==="object"&&!!i},all:function(i){return r.obj(i)&&i.type===n.default.all},error:function(i){return r.obj(i)&&i.type===n.default.error},array:Array.isArray,func:function(i){return typeof i=="function"},promise:function(i){return i&&r.func(i.then)},iterator:function(i){return i&&r.func(i.next)&&r.func(i.throw)},fork:function(i){return r.obj(i)&&i.type===n.default.fork},join:function(i){return r.obj(i)&&i.type===n.default.join},race:function(i){return r.obj(i)&&i.type===n.default.race},call:function(i){return r.obj(i)&&i.type===n.default.call},cps:function(i){return r.obj(i)&&i.type===n.default.cps},subscribe:function(i){return r.obj(i)&&i.type===n.default.subscribe},channel:function(i){return r.obj(i)&&r.func(i.subscribe)}};return sA.default=r,sA}var CH;function V6e(){if(CH)return ts;CH=1,Object.defineProperty(ts,"__esModule",{value:!0}),ts.iterator=ts.array=ts.object=ts.error=ts.any=void 0;var e=v5(),t=n(e);function n(l){return l&&l.__esModule?l:{default:l}}var o=ts.any=function(u,d,p,f){return f(u),!0},r=ts.error=function(u,d,p,f,b){return t.default.error(u)?(b(u.error),!0):!1},s=ts.object=function(u,d,p,f,b){if(!t.default.all(u)||!t.default.obj(u.value))return!1;var h={},g=Object.keys(u.value),z=0,A=!1,_=function(y,k){A||(h[y]=k,z++,z===g.length&&f(h))},v=function(y,k){A||(A=!0,b(k))};return g.map(function(M){p(u.value[M],function(y){return _(M,y)},function(y){return v(M,y)})}),!0},i=ts.array=function(u,d,p,f,b){if(!t.default.all(u)||!t.default.array(u.value))return!1;var h=[],g=0,z=!1,A=function(M,y){z||(h[M]=y,g++,g===u.value.length&&f(h))},_=function(M,y){z||(z=!0,b(y))};return u.value.map(function(v,M){p(v,function(y){return A(M,y)},function(y){return _(M,y)})}),!0},c=ts.iterator=function(u,d,p,f,b){return t.default.iterator(u)?(p(u,d,b),!0):!1};return ts.default=[r,c,i,s,o],ts}var qH;function H6e(){if(qH)return rA;qH=1,Object.defineProperty(rA,"__esModule",{value:!0});var e=V6e(),t=r(e),n=v5(),o=r(n);function r(c){return c&&c.__esModule?c:{default:c}}function s(c){if(Array.isArray(c)){for(var l=0,u=Array(c.length);l(c,l,u,d,p)=>{if(!Z6e(c,s))return!1;const f=i(c);return t0e(f)?f.then(d,p):d(f),!0}),o=(s,i)=>zE(s)?(t(s),i(),!0):!1;n.push(o);const r=Y6e.create(n);return s=>new Promise((i,c)=>r(s,l=>{zE(l)&&t(l),i(l)},c))}function J6e(e={}){return t=>{const n=Q6e(e,t.dispatch);return o=>r=>$6e(r)?n(r):o(r)}}function Or(e,t){return n=>{const o=e(n);return o.displayName=eSe(t,n),o}}const eSe=(e,t)=>{const n=t.displayName||t.name||"Component";return`${w4(e??"")}(${n})`},F1=(e,t,n)=>{let o,r,s=0,i,c,l,u=0,d=!1,p=!1,f=!0;n&&(d=!!n.leading,p="maxWait"in n,n.maxWait!==void 0&&(s=Math.max(n.maxWait,t)),f="trailing"in n?!!n.trailing:f);function b(E){const B=o,N=r;return o=void 0,r=void 0,u=E,i=e.apply(N,B),i}function h(E,B){c=setTimeout(E,B)}function g(){c!==void 0&&clearTimeout(c)}function z(E){return u=E,h(M,t),d?b(E):i}function A(E){return E-(l||0)}function _(E){const B=A(E),N=E-u,j=t-B;return p?Math.min(j,s-N):j}function v(E){const B=A(E),N=E-u;return l===void 0||B>=t||B<0||p&&N>=s}function M(){const E=Date.now();if(v(E))return k(E);h(M,_(E))}function y(){c=void 0}function k(E){return y(),f&&o?b(E):(o=r=void 0,i)}function S(){g(),u=0,y(),o=l=r=void 0}function C(){return R()?k(Date.now()):i}function R(){return c!==void 0}function T(...E){const B=Date.now(),N=v(B);if(o=E,r=this,l=B,N){if(!R())return z(l);if(p)return h(M,t),b(l)}return R()||h(M,t),i}return T.cancel=S,T.flush=C,T.pending=R,T},BN=(e,t,n)=>{let o=!0,r=!0;return n&&(o="leading"in n?!!n.leading:o,r="trailing"in n?!!n.trailing:r),F1(e,t,{leading:o,trailing:r,maxWait:t})};function gc(){const e=new Map,t=new Map;function n(o){const r=t.get(o);if(r)for(const s of r)s()}return{get(o){return e.get(o)},set(o,r){e.set(o,r),n(o)},delete(o){e.delete(o),n(o)},subscribe(o,r){let s=t.get(o);return s||(s=new Set,t.set(o,s)),s.add(r),()=>{s.delete(r),s.size===0&&t.delete(o)}}}}const n0e=(e=!1)=>(...t)=>(...n)=>{const o=t.flat();return e&&o.reverse(),o.reduce((r,s)=>[s(...r)],n)[0]},Ku=n0e(),Co=n0e(!0);function tSe(e){return Or(t=>n=>e(n)?a.jsx(t,{...n}):null,"ifCondition")}function o0e(e,t){if(e===t)return!0;const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;let r=0;for(;r{if(n)return n;const o=rSe(e);return t?`${t}-${o}`:o},[e,n,t])}const sSe=Or(e=>t=>{const n=vt(e);return a.jsx(e,{...t,instanceId:n})},"instanceId"),iSe=Or(e=>class extends x.Component{constructor(n){super(n),this.timeouts=[],this.setTimeout=this.setTimeout.bind(this),this.clearTimeout=this.clearTimeout.bind(this)}componentWillUnmount(){this.timeouts.forEach(clearTimeout)}setTimeout(n,o){const r=setTimeout(()=>{n(),this.clearTimeout(r)},o);return this.timeouts.push(r),r}clearTimeout(n){clearTimeout(n),this.timeouts=this.timeouts.filter(o=>o!==n)}render(){return a.jsx(e,{...this.props,setTimeout:this.setTimeout,clearTimeout:this.clearTimeout})}},"withSafeTimeout");function aSe(e){return[e?'[tabindex]:not([tabindex^="-"])':"[tabindex]","a[href]","button:not([disabled])",'input:not([type="hidden"]):not([disabled])',"select:not([disabled])","textarea:not([disabled])",'iframe:not([tabindex^="-"])',"object","embed","area[href]","[contenteditable]:not([contenteditable=false])"].join(",")}function r0e(e){return e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0}function cSe(e){const t=e.closest("map[name]");if(!t)return!1;const n=e.ownerDocument.querySelector('img[usemap="#'+t.name+'"]');return!!n&&r0e(n)}function x5(e,{sequential:t=!1}={}){const n=e.querySelectorAll(aSe(t));return Array.from(n).filter(o=>{if(!r0e(o))return!1;const{nodeName:r}=o;return r==="AREA"?cSe(o):!0})}const lSe=Object.freeze(Object.defineProperty({__proto__:null,find:x5},Symbol.toStringTag,{value:"Module"}));function OE(e){const t=e.getAttribute("tabindex");return t===null?0:parseInt(t,10)}function s0e(e){return OE(e)!==-1}function uSe(){const e={};return function(n,o){const{nodeName:r,type:s,checked:i,name:c}=o;if(r!=="INPUT"||s!=="radio"||!c)return n.concat(o);const l=e.hasOwnProperty(c);if(!(i||!l))return n;if(l){const d=e[c];n=n.filter(p=>p!==d)}return e[c]=o,n.concat(o)}}function dSe(e,t){return{element:e,index:t}}function pSe(e){return e.element}function fSe(e,t){const n=OE(e.element),o=OE(t.element);return n===o?e.index-t.index:n-o}function LN(e){return e.filter(s0e).map(dSe).sort(fSe).map(pSe).reduce(uSe(),[])}function bSe(e){return LN(x5(e))}function hSe(e){return LN(x5(e.ownerDocument.body)).reverse().find(t=>e.compareDocumentPosition(t)&e.DOCUMENT_POSITION_PRECEDING)}function mSe(e){return LN(x5(e.ownerDocument.body)).find(t=>e.compareDocumentPosition(t)&e.DOCUMENT_POSITION_FOLLOWING)}const gSe=Object.freeze(Object.defineProperty({__proto__:null,find:bSe,findNext:mSe,findPrevious:hSe,isTabbableIndex:s0e},Symbol.toStringTag,{value:"Module"}));function Ev(e){if(!e.collapsed){const s=Array.from(e.getClientRects());if(s.length===1)return s[0];const i=s.filter(({width:p})=>p>1);if(i.length===0)return e.getBoundingClientRect();if(i.length===1)return i[0];let{top:c,bottom:l,left:u,right:d}=i[0];for(const{top:p,bottom:f,left:b,right:h}of i)pl&&(l=f),bd&&(d=h);return new window.DOMRect(u,c,d-u,l-c)}const{startContainer:t}=e,{ownerDocument:n}=t;if(t.nodeName==="BR"){const{parentNode:s}=t,i=Array.from(s.childNodes).indexOf(t);e=n.createRange(),e.setStart(s,i),e.setEnd(s,i)}const o=e.getClientRects();if(o.length>1)return null;let r=o[0];if(!r||r.height===0){const s=n.createTextNode("​");e=e.cloneRange(),e.insertNode(s),r=e.getClientRects()[0],s.parentNode,s.parentNode.removeChild(s)}return r}function yE(e){const t=e.getSelection(),n=t.rangeCount?t.getRangeAt(0):null;return n?Ev(n):null}function i0e(e){e.defaultView;const t=e.defaultView.getSelection(),n=t.rangeCount?t.getRangeAt(0):null;return!!n&&!n.collapsed}function PN(e){return e?.nodeName==="INPUT"}function md(e){const t=["button","checkbox","hidden","file","radio","image","range","reset","submit","number","email","time"];return PN(e)&&e.type&&!t.includes(e.type)||e.nodeName==="TEXTAREA"||e.contentEditable==="true"}function MSe(e){if(!PN(e)&&!md(e))return!1;try{const{selectionStart:t,selectionEnd:n}=e;return t===null||t!==n}catch{return!0}}function zSe(e){return i0e(e)||!!e.activeElement&&MSe(e.activeElement)}function OSe(e){return!!e.activeElement&&(PN(e.activeElement)||md(e.activeElement)||i0e(e))}function S4(e){return e.ownerDocument.defaultView,e.ownerDocument.defaultView.getComputedStyle(e)}function ps(e,t="vertical"){if(e){if((t==="vertical"||t==="all")&&e.scrollHeight>e.clientHeight){const{overflowY:n}=S4(e);if(/(auto|scroll)/.test(n))return e}if((t==="horizontal"||t==="all")&&e.scrollWidth>e.clientWidth){const{overflowX:n}=S4(e);if(/(auto|scroll)/.test(n))return e}return e.ownerDocument===e.parentNode?e:ps(e.parentNode,t)}}function w5(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"}function ySe(e){if(w5(e))return e.selectionStart===0&&e.value.length===e.selectionEnd;if(!e.isContentEditable)return!0;const{ownerDocument:t}=e,{defaultView:n}=t,o=n.getSelection(),r=o.rangeCount?o.getRangeAt(0):null;if(!r)return!0;const{startContainer:s,endContainer:i,startOffset:c,endOffset:l}=r;if(s===e&&i===e&&c===0&&l===e.childNodes.length)return!0;e.lastChild;const u=i.nodeType===i.TEXT_NODE?i.data.length:i.childNodes.length;return BH(s,e,"firstChild")&&BH(i,e,"lastChild")&&c===0&&l===u}function BH(e,t,n){let o=t;do{if(e===o)return!0;o=o[n]}while(o);return!1}function a0e(e){if(!e)return!1;const{tagName:t}=e;return w5(e)||t==="BUTTON"||t==="SELECT"}function jN(e){return S4(e).direction==="rtl"}function ASe(e){const t=Array.from(e.getClientRects());if(!t.length)return;const n=Math.min(...t.map(({top:r})=>r));return Math.max(...t.map(({bottom:r})=>r))-n}function c0e(e){const{anchorNode:t,focusNode:n,anchorOffset:o,focusOffset:r}=e,s=t.compareDocumentPosition(n);return s&t.DOCUMENT_POSITION_PRECEDING?!1:s&t.DOCUMENT_POSITION_FOLLOWING?!0:s===0?o<=r:!0}function vSe(e,t,n){if(e.caretRangeFromPoint)return e.caretRangeFromPoint(t,n);if(!e.caretPositionFromPoint)return null;const o=e.caretPositionFromPoint(t,n);if(!o)return null;const r=e.createRange();return r.setStart(o.offsetNode,o.offset),r.collapse(!0),r}function l0e(e,t,n,o){const r=o.style.zIndex,s=o.style.position,{position:i="static"}=S4(o);i==="static"&&(o.style.position="relative"),o.style.zIndex="10000";const c=vSe(e,t,n);return o.style.zIndex=r,o.style.position=s,c}function u0e(e,t,n){let o=n();return(!o||!o.startContainer||!e.contains(o.startContainer))&&(e.scrollIntoView(t),o=n(),!o||!o.startContainer||!e.contains(o.startContainer))?null:o}function d0e(e,t,n=!1){if(w5(e)&&typeof e.selectionStart=="number")return e.selectionStart!==e.selectionEnd?!1:t?e.selectionStart===0:e.value.length===e.selectionStart;if(!e.isContentEditable)return!0;const{ownerDocument:o}=e,{defaultView:r}=o,s=r.getSelection();if(!s||!s.rangeCount)return!1;const i=s.getRangeAt(0),c=i.cloneRange(),l=c0e(s),u=s.isCollapsed;u||c.collapse(!l);const d=Ev(c),p=Ev(i);if(!d||!p)return!1;const f=ASe(i);if(!u&&f&&f>d.height&&l===t)return!1;const b=jN(e)?!t:t,h=e.getBoundingClientRect(),g=b?h.left+1:h.right-1,z=t?h.top+1:h.bottom-1,A=u0e(e,t,()=>l0e(o,g,z,e));if(!A)return!1;const _=Ev(A);if(!_)return!1;const v=t?"top":"bottom",M=b?"left":"right",y=_[v]-p[v],k=_[M]-d[M],S=Math.abs(y)<=1,C=Math.abs(k)<=1;return n?S:S&&C}function gS(e,t){return d0e(e,t)}function LH(e,t){return d0e(e,t,!0)}function xSe(e,t,n){const{ownerDocument:o}=e,r=jN(e)?!t:t,s=e.getBoundingClientRect();n===void 0?n=t?s.right-1:s.left+1:n<=s.left?n=s.left+1:n>=s.right&&(n=s.right-1);const i=r?s.bottom-1:s.top+1;return l0e(o,n,i,e)}function p0e(e,t,n){if(!e)return;if(e.focus(),w5(e)){if(typeof e.selectionStart!="number")return;t?(e.selectionStart=e.value.length,e.selectionEnd=e.value.length):(e.selectionStart=0,e.selectionEnd=0);return}if(!e.isContentEditable)return;const o=u0e(e,t,()=>xSe(e,t,n));if(!o)return;const{ownerDocument:r}=e,{defaultView:s}=r,i=s.getSelection();i.removeAllRanges(),i.addRange(o)}function f0e(e,t){return p0e(e,t,void 0)}function wSe(e,t,n){return p0e(e,t,n?.left)}function b0e(e,t){t.parentNode,t.parentNode.insertBefore(e,t.nextSibling)}function pf(e){e.parentNode,e.parentNode.removeChild(e)}function _Se(e,t){e.parentNode,b0e(t,e.parentNode),pf(e)}function mM(e){const t=e.parentNode;for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}function PH(e,t){const n=e.ownerDocument.createElement(t);for(;e.firstChild;)n.appendChild(e.firstChild);return e.parentNode,e.parentNode.replaceChild(n,e),n}function Ag(e,t){t.parentNode,t.parentNode.insertBefore(e,t),e.appendChild(t)}function _5(e){const{body:t}=document.implementation.createHTMLDocument("");t.innerHTML=e;const n=t.getElementsByTagName("*");let o=n.length;for(;o--;){const r=n[o];if(r.tagName==="SCRIPT")pf(r);else{let s=r.attributes.length;for(;s--;){const{name:i}=r.attributes[s];i.startsWith("on")&&r.removeAttribute(i)}}}return t.innerHTML}function x1(e){e=_5(e);const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,t.body.textContent||""}function C4(e){switch(e.nodeType){case e.TEXT_NODE:return/^[ \f\n\r\t\v\u00a0]*$/.test(e.nodeValue||"");case e.ELEMENT_NODE:return e.hasAttributes()?!1:e.hasChildNodes()?Array.from(e.childNodes).every(C4):!0;default:return!0}}const gM={strong:{},em:{},s:{},del:{},ins:{},a:{attributes:["href","target","rel","id"]},code:{},abbr:{attributes:["title"]},sub:{},sup:{},br:{},small:{},q:{attributes:["cite"]},dfn:{attributes:["title"]},data:{attributes:["value"]},time:{attributes:["datetime"]},var:{},samp:{},kbd:{},i:{},b:{},u:{},mark:{},ruby:{},rt:{},rp:{},bdi:{attributes:["dir"]},bdo:{attributes:["dir"]},wbr:{},"#text":{}},kSe=["#text","br"];Object.keys(gM).filter(e=>!kSe.includes(e)).forEach(e=>{const{[e]:t,...n}=gM;gM[e].children=n});const SSe={audio:{attributes:["src","preload","autoplay","mediagroup","loop","muted"]},canvas:{attributes:["width","height"]},embed:{attributes:["src","type","width","height"]},img:{attributes:["alt","src","srcset","usemap","ismap","width","height"]},object:{attributes:["data","type","name","usemap","form","width","height"]},video:{attributes:["src","poster","preload","playsinline","autoplay","mediagroup","loop","muted","controls","width","height"]}},aA={...gM,...SSe};function k5(e){if(e!=="paste")return aA;const{u:t,abbr:n,data:o,time:r,wbr:s,bdi:i,bdo:c,...l}={...aA,ins:{children:aA.ins.children},del:{children:aA.del.children}};return l}function k2(e){const t=e.nodeName.toLowerCase();return k5().hasOwnProperty(t)||t==="span"}function h0e(e){const t=e.nodeName.toLowerCase();return gM.hasOwnProperty(t)||t==="span"}function CSe(e){return!!e&&e.nodeType===e.ELEMENT_NODE}const qSe=()=>{};function Yg(e,t,n,o){Array.from(e).forEach(r=>{const s=r.nodeName.toLowerCase();if(n.hasOwnProperty(s)&&(!n[s].isMatch||n[s].isMatch?.(r))){if(CSe(r)){const{attributes:i=[],classes:c=[],children:l,require:u=[],allowEmpty:d}=n[s];if(l&&!d&&C4(r)){pf(r);return}if(r.hasAttributes()&&(Array.from(r.attributes).forEach(({name:p})=>{p!=="class"&&!i.includes(p)&&r.removeAttribute(p)}),r.classList&&r.classList.length)){const p=c.map(f=>f==="*"?()=>!0:typeof f=="string"?b=>b===f:f instanceof RegExp?b=>f.test(b):qSe);Array.from(r.classList).forEach(f=>{p.some(b=>b(f))||r.classList.remove(f)}),r.classList.length||r.removeAttribute("class")}if(r.hasChildNodes()){if(l==="*")return;if(l)u.length&&!r.querySelector(u.join(","))?(Yg(r.childNodes,t,n,o),mM(r)):r.parentNode&&r.parentNode.nodeName==="BODY"&&k2(r)?(Yg(r.childNodes,t,n,o),Array.from(r.childNodes).some(p=>!k2(p))&&mM(r)):Yg(r.childNodes,t,l,o);else for(;r.firstChild;)pf(r.firstChild)}}}else Yg(r.childNodes,t,n,o),o&&!k2(r)&&r.nextElementSibling&&b0e(t.createElement("br"),r),mM(r)})}function AE(e,t,n){const o=document.implementation.createHTMLDocument("");return o.body.innerHTML=e,Yg(o.body.childNodes,o,t,n),o.body.innerHTML}function q4(e){const t=Array.from(e.files);return Array.from(e.items).forEach(n=>{const o=n.getAsFile();o&&!t.find(({name:r,type:s,size:i})=>r===o.name&&s===o.type&&i===o.size)&&t.push(o)}),t}const Xr={focusable:lSe,tabbable:gSe};function Mn(e,t){const n=x.useRef();return x.useCallback(o=>{o?n.current=e(o):n.current&&n.current()},t)}function IN(){return Mn(e=>{function t(n){const{key:o,shiftKey:r,target:s}=n;if(o!=="Tab")return;const i=r?"findPrevious":"findNext",c=Xr.tabbable[i](s)||null;if(s.contains(c)){n.preventDefault(),c?.focus();return}if(e.contains(c))return;const l=r?"append":"prepend",{ownerDocument:u}=e,d=u.createElement("div");d.tabIndex=-1,e[l](d),d.addEventListener("blur",()=>e.removeChild(d)),d.focus()}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}},[])}var Wv={exports:{}};/*! + */function nH(e){return Object.prototype.toString.call(e)==="[object Object]"}function a3(e){var t,n;return nH(e)===!1?!1:(t=e.constructor,t===void 0?!0:(n=t.prototype,!(nH(n)===!1||n.hasOwnProperty("isPrototypeOf")===!1)))}var pE=function(e,t){return pE=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(n[r]=o[r])},pE(e,t)};function hke(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");pE(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Lr=function(){return Lr=Object.assign||function(t){for(var n,o=1,r=arguments.length;o0&&n>="0"&&n<="9"?"_"+n+o:""+n.toUpperCase()+o}function w4(e,t){return t===void 0&&(t={}),M5(e,Lr({delimiter:"",transform:Ere},t))}function zke(e,t){return t===0?e.toLowerCase():Ere(e,t)}function SN(e,t){return t===void 0&&(t={}),w4(e,Lr({transform:zke},t))}function Oke(e){return e.charAt(0).toUpperCase()+e.substr(1)}function yke(e){return Oke(e.toLowerCase())}function Wre(e,t){return t===void 0&&(t={}),M5(e,Lr({delimiter:" ",transform:yke},t))}function Ake(e,t){return t===void 0&&(t={}),M5(e,Lr({delimiter:"."},t))}function Ti(e,t){return t===void 0&&(t={}),Ake(e,Lr({delimiter:"-"},t))}function vke(e){return e.replace(/>/g,">")}const xke=/[\u007F-\u009F "'>/="\uFDD0-\uFDEF]/;function Nre(e){return e.replace(/&(?!([a-z0-9]+|#[0-9]+|#x[a-f0-9]+);)/gi,"&")}function wke(e){return e.replace(/"/g,""")}function Bre(e){return e.replace(/{typeof o=="string"&&o.trim()!==""&&(n+=o)}),x.createElement("div",{dangerouslySetInnerHTML:{__html:n},...t})}const{Provider:kke,Consumer:Ske}=x.createContext(void 0),Cke=x.forwardRef(()=>null),qke=new Set(["string","boolean","number"]),Rke=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),Tke=new Set(["allowfullscreen","allowpaymentrequest","allowusermedia","async","autofocus","autoplay","checked","controls","default","defer","disabled","download","formnovalidate","hidden","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","typemustmatch"]),Eke=new Set(["autocapitalize","autocomplete","charset","contenteditable","crossorigin","decoding","dir","draggable","enctype","formenctype","formmethod","http-equiv","inputmode","kind","method","preload","scope","shape","spellcheck","translate","type","wrap"]),Wke=new Set(["animation","animationIterationCount","baselineShift","borderImageOutset","borderImageSlice","borderImageWidth","columnCount","cx","cy","fillOpacity","flexGrow","flexShrink","floodOpacity","fontWeight","gridColumnEnd","gridColumnStart","gridRowEnd","gridRowStart","lineHeight","opacity","order","orphans","r","rx","ry","shapeImageThreshold","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","tabSize","widows","x","y","zIndex","zoom"]);function Pre(e,t){return t.some(n=>e.indexOf(n)===0)}function Nke(e){return e==="key"||e==="children"}function Bke(e,t){switch(e){case"style":return Fke(t)}return t}const rH=["accentHeight","alignmentBaseline","arabicForm","baselineShift","capHeight","clipPath","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","dominantBaseline","enableBackground","fillOpacity","fillRule","floodColor","floodOpacity","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","horizAdvX","horizOriginX","imageRendering","letterSpacing","lightingColor","markerEnd","markerMid","markerStart","overlinePosition","overlineThickness","paintOrder","panose1","pointerEvents","renderingIntent","shapeRendering","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","textAnchor","textDecoration","textRendering","underlinePosition","underlineThickness","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","vHanging","vIdeographic","vMathematical","vectorEffect","vertAdvY","vertOriginX","vertOriginY","wordSpacing","writingMode","xmlnsXlink","xHeight"].reduce((e,t)=>(e[t.toLowerCase()]=t,e),{}),sH=["allowReorder","attributeName","attributeType","autoReverse","baseFrequency","baseProfile","calcMode","clipPathUnits","contentScriptType","contentStyleType","diffuseConstant","edgeMode","externalResourcesRequired","filterRes","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","suppressContentEditableWarning","suppressHydrationWarning","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector"].reduce((e,t)=>(e[t.toLowerCase()]=t,e),{}),iH=["xlink:actuate","xlink:arcrole","xlink:href","xlink:role","xlink:show","xlink:title","xlink:type","xml:base","xml:lang","xml:space","xmlns:xlink"].reduce((e,t)=>(e[t.replace(":","").toLowerCase()]=t,e),{});function Lke(e){switch(e){case"htmlFor":return"for";case"className":return"class"}const t=e.toLowerCase();return sH[t]?sH[t]:rH[t]?Ti(rH[t]):iH[t]?iH[t]:t}function Pke(e){return e.startsWith("--")?e:Pre(e,["ms","O","Moz","Webkit"])?"-"+Ti(e):Ti(e)}function jke(e,t){return typeof t=="number"&&t!==0&&!Wke.has(e)?t+"px":t}function M1(e,t,n={}){if(e==null||e===!1)return"";if(Array.isArray(e))return hM(e,t,n);switch(typeof e){case"string":return fE(e);case"number":return e.toString()}const{type:o,props:r}=e;switch(o){case x.StrictMode:case x.Fragment:return hM(r.children,t,n);case i0:const{children:s,...i}=r;return aH(Object.keys(i).length?"div":null,{...i,dangerouslySetInnerHTML:{__html:s}},t,n)}switch(typeof o){case"string":return aH(o,r,t,n);case"function":return o.prototype&&typeof o.prototype.render=="function"?Ike(o,r,t,n):M1(o(r,n),t,n)}switch(o&&o.$$typeof){case kke.$$typeof:return hM(r.children,r.value,n);case Ske.$$typeof:return M1(r.children(t||o._currentValue),t,n);case Cke.$$typeof:return M1(o.render(r),t,n)}return""}function aH(e,t,n,o={}){let r="";if(e==="textarea"&&t.hasOwnProperty("value")){r=hM(t.value,n,o);const{value:i,...c}=t;t=c}else t.dangerouslySetInnerHTML&&typeof t.dangerouslySetInnerHTML.__html=="string"?r=t.dangerouslySetInnerHTML.__html:typeof t.children<"u"&&(r=hM(t.children,n,o));if(!e)return r;const s=Dke(t);return Rke.has(e)?"<"+e+s+"/>":"<"+e+s+">"+r+""}function Ike(e,t,n,o={}){const r=new e(t,o);return typeof r.getChildContext=="function"&&Object.assign(o,r.getChildContext()),M1(r.render(),n,o)}function hM(e,t,n={}){let o="";e=Array.isArray(e)?e:[e];for(let r=0;r0&&!(i>=u[d-1].priority);d--);d===u.length?u[d]=l:u.splice(d,0,l),c.__current.forEach(p=>{p.name===o&&p.currentIndex>=d&&p.currentIndex++})}else c[o]={handlers:[l],runs:0};o!=="hookAdded"&&e.doAction("hookAdded",o,r,s,i)}}function tA(e,t,n=!1){return function(r,s){const i=e[t];if(!CN(r)||!n&&!jre(s))return;if(!i[r])return 0;let c=0;if(n)c=i[r].handlers.length,i[r]={runs:i[r].runs,handlers:[]};else{const l=i[r].handlers;for(let u=l.length-1;u>=0;u--)l[u].namespace===s&&(l.splice(u,1),c++,i.__current.forEach(d=>{d.name===r&&d.currentIndex>=u&&d.currentIndex--}))}return r!=="hookRemoved"&&e.doAction("hookRemoved",r,s),c}}function lH(e,t){return function(o,r){const s=e[t];return typeof r<"u"?o in s&&s[o].handlers.some(i=>i.namespace===r):o in s}}function nA(e,t,n,o){return function(s,...i){const c=e[t];c[s]||(c[s]={handlers:[],runs:0}),c[s].runs++;const l=c[s].handlers;if(!l||!l.length)return n?i[0]:void 0;const u={name:s,currentIndex:0};async function d(){try{c.__current.add(u);let f=n?i[0]:void 0;for(;u.currentIndex"u"?r.__current.size>0:Array.from(r.__current).some(s=>s.name===o)}}function pH(e,t){return function(o){const r=e[t];if(CN(o))return r[o]&&r[o].runs?r[o].runs:0}}class $ke{constructor(){this.actions=Object.create(null),this.actions.__current=new Set,this.filters=Object.create(null),this.filters.__current=new Set,this.addAction=cH(this,"actions"),this.addFilter=cH(this,"filters"),this.removeAction=tA(this,"actions"),this.removeFilter=tA(this,"filters"),this.hasAction=lH(this,"actions"),this.hasFilter=lH(this,"filters"),this.removeAllActions=tA(this,"actions",!0),this.removeAllFilters=tA(this,"filters",!0),this.doAction=nA(this,"actions",!1,!1),this.doActionAsync=nA(this,"actions",!1,!0),this.applyFilters=nA(this,"filters",!0,!1),this.applyFiltersAsync=nA(this,"filters",!0,!0),this.currentAction=uH(this,"actions"),this.currentFilter=uH(this,"filters"),this.doingAction=dH(this,"actions"),this.doingFilter=dH(this,"filters"),this.didAction=pH(this,"actions"),this.didFilter=pH(this,"filters")}}function Ire(){return new $ke}const Dre=Ire(),{addAction:_4,addFilter:Bn,removeAction:bE,removeFilter:hE,hasAction:xmn,hasFilter:Fre,removeAllActions:wmn,removeAllFilters:_mn,doAction:qN,doActionAsync:Vke,applyFilters:gr,applyFiltersAsync:Hke,currentAction:kmn,currentFilter:Smn,doingAction:Cmn,doingFilter:qmn,didAction:Rmn,didFilter:Tmn,actions:Emn,filters:Wmn}=Dre,fH=Object.create(null);function Ke(e,t={}){const{since:n,version:o,alternative:r,plugin:s,link:i,hint:c}=t,l=s?` from ${s}`:"",u=n?` since version ${n}`:"",d=o?` and will be removed${l} in version ${o}`:"",p=r?` Please use ${r} instead.`:"",f=i?` See: ${i}`:"",b=c?` Note: ${c}`:"",h=`${e} is deprecated${u}${d}.${p}${f}${b}`;h in fH||(qN("deprecated",e,t,h),console.warn(h),fH[h]=!0)}function os(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Uke=typeof Symbol=="function"&&Symbol.observable||"@@observable",bH=Uke,fS=()=>Math.random().toString(36).substring(7).split("").join("."),Xke={INIT:`@@redux/INIT${fS()}`,REPLACE:`@@redux/REPLACE${fS()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${fS()}`},hH=Xke;function Gke(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function $re(e,t,n){if(typeof e!="function")throw new Error(os(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(os(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(os(1));return n($re)(e,t)}let o=e,r=t,s=new Map,i=s,c=0,l=!1;function u(){i===s&&(i=new Map,s.forEach((z,A)=>{i.set(A,z)}))}function d(){if(l)throw new Error(os(3));return r}function p(z){if(typeof z!="function")throw new Error(os(4));if(l)throw new Error(os(5));let A=!0;u();const _=c++;return i.set(_,z),function(){if(A){if(l)throw new Error(os(6));A=!1,u(),i.delete(_),s=null}}}function f(z){if(!Gke(z))throw new Error(os(7));if(typeof z.type>"u")throw new Error(os(8));if(typeof z.type!="string")throw new Error(os(17));if(l)throw new Error(os(9));try{l=!0,r=o(r,z)}finally{l=!1}return(s=i).forEach(_=>{_()}),z}function b(z){if(typeof z!="function")throw new Error(os(10));o=z,f({type:hH.REPLACE})}function h(){const z=p;return{subscribe(A){if(typeof A!="object"||A===null)throw new Error(os(11));function _(){const M=A;M.next&&M.next(d())}return _(),{unsubscribe:z(_)}},[bH](){return this}}}return f({type:hH.INIT}),{dispatch:f,subscribe:p,getState:d,replaceReducer:b,[bH]:h}}function Kke(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...o)=>t(n(...o)))}function Yke(...e){return t=>(n,o)=>{const r=t(n,o);let s=()=>{throw new Error(os(15))};const i={getState:r.getState,dispatch:(l,...u)=>s(l,...u)},c=e.map(l=>l(i));return s=Kke(...c)(r.dispatch),{...r,dispatch:s}}}var bS,mH;function Zke(){if(mH)return bS;mH=1;function e(i){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?e=function(c){return typeof c}:e=function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},e(i)}function t(i,c){if(!(i instanceof c))throw new TypeError("Cannot call a class as a function")}function n(i,c){for(var l=0;l1&&arguments[1]!==void 0?arguments[1]:this;this._map.forEach(function(p,f){f!==null&&e(f)==="object"&&(p=p[1]),l.call(d,p,f,u)})}},{key:"clear",value:function(){this._map=new Map,this._arrayTreeMap=new Map,this._objectTreeMap=new Map}},{key:"size",get:function(){return this._map.size}}]),i}();return bS=s,bS}var Qke=Zke();const Va=Zr(Qke);function Jke(e){return!!e&&typeof e[Symbol.iterator]=="function"&&typeof e.next=="function"}var hS={},Vo={},oA={},gH;function Vre(){if(gH)return oA;gH=1,Object.defineProperty(oA,"__esModule",{value:!0});var e={all:Symbol("all"),error:Symbol("error"),fork:Symbol("fork"),join:Symbol("join"),race:Symbol("race"),call:Symbol("call"),cps:Symbol("cps"),subscribe:Symbol("subscribe")};return oA.default=e,oA}var MH;function Hre(){if(MH)return Vo;MH=1,Object.defineProperty(Vo,"__esModule",{value:!0}),Vo.createChannel=Vo.subscribe=Vo.cps=Vo.apply=Vo.call=Vo.invoke=Vo.delay=Vo.race=Vo.join=Vo.fork=Vo.error=Vo.all=void 0;var e=Vre(),t=n(e);function n(o){return o&&o.__esModule?o:{default:o}}return Vo.all=function(r){return{type:t.default.all,value:r}},Vo.error=function(r){return{type:t.default.error,error:r}},Vo.fork=function(r){for(var s=arguments.length,i=Array(s>1?s-1:0),c=1;c1?s-1:0),c=1;c2?i-2:0),l=2;l1?s-1:0),c=1;c"u"?"undefined":e(i))==="object"&&!!i},all:function(i){return r.obj(i)&&i.type===n.default.all},error:function(i){return r.obj(i)&&i.type===n.default.error},array:Array.isArray,func:function(i){return typeof i=="function"},promise:function(i){return i&&r.func(i.then)},iterator:function(i){return i&&r.func(i.next)&&r.func(i.throw)},fork:function(i){return r.obj(i)&&i.type===n.default.fork},join:function(i){return r.obj(i)&&i.type===n.default.join},race:function(i){return r.obj(i)&&i.type===n.default.race},call:function(i){return r.obj(i)&&i.type===n.default.call},cps:function(i){return r.obj(i)&&i.type===n.default.cps},subscribe:function(i){return r.obj(i)&&i.type===n.default.subscribe},channel:function(i){return r.obj(i)&&r.func(i.subscribe)}};return sA.default=r,sA}var OH;function e6e(){if(OH)return ts;OH=1,Object.defineProperty(ts,"__esModule",{value:!0}),ts.iterator=ts.array=ts.object=ts.error=ts.any=void 0;var e=O5(),t=n(e);function n(l){return l&&l.__esModule?l:{default:l}}var o=ts.any=function(u,d,p,f){return f(u),!0},r=ts.error=function(u,d,p,f,b){return t.default.error(u)?(b(u.error),!0):!1},s=ts.object=function(u,d,p,f,b){if(!t.default.all(u)||!t.default.obj(u.value))return!1;var h={},g=Object.keys(u.value),z=0,A=!1,_=function(y,k){A||(h[y]=k,z++,z===g.length&&f(h))},v=function(y,k){A||(A=!0,b(k))};return g.map(function(M){p(u.value[M],function(y){return _(M,y)},function(y){return v(M,y)})}),!0},i=ts.array=function(u,d,p,f,b){if(!t.default.all(u)||!t.default.array(u.value))return!1;var h=[],g=0,z=!1,A=function(M,y){z||(h[M]=y,g++,g===u.value.length&&f(h))},_=function(M,y){z||(z=!0,b(y))};return u.value.map(function(v,M){p(v,function(y){return A(M,y)},function(y){return _(M,y)})}),!0},c=ts.iterator=function(u,d,p,f,b){return t.default.iterator(u)?(p(u,d,b),!0):!1};return ts.default=[r,c,i,s,o],ts}var yH;function t6e(){if(yH)return rA;yH=1,Object.defineProperty(rA,"__esModule",{value:!0});var e=e6e(),t=r(e),n=O5(),o=r(n);function r(c){return c&&c.__esModule?c:{default:c}}function s(c){if(Array.isArray(c)){for(var l=0,u=Array(c.length);l(c,l,u,d,p)=>{if(!a6e(c,s))return!1;const f=i(c);return Ure(f)?f.then(d,p):d(f),!0}),o=(s,i)=>mE(s)?(t(s),i(),!0):!1;n.push(o);const r=i6e.create(n);return s=>new Promise((i,c)=>r(s,l=>{mE(l)&&t(l),i(l)},c))}function l6e(e={}){return t=>{const n=c6e(e,t.dispatch);return o=>r=>Jke(r)?n(r):o(r)}}function Or(e,t){return n=>{const o=e(n);return o.displayName=u6e(t,n),o}}const u6e=(e,t)=>{const n=t.displayName||t.name||"Component";return`${w4(e??"")}(${n})`},F1=(e,t,n)=>{let o,r,s=0,i,c,l,u=0,d=!1,p=!1,f=!0;n&&(d=!!n.leading,p="maxWait"in n,n.maxWait!==void 0&&(s=Math.max(n.maxWait,t)),f="trailing"in n?!!n.trailing:f);function b(E){const B=o,N=r;return o=void 0,r=void 0,u=E,i=e.apply(N,B),i}function h(E,B){c=setTimeout(E,B)}function g(){c!==void 0&&clearTimeout(c)}function z(E){return u=E,h(M,t),d?b(E):i}function A(E){return E-(l||0)}function _(E){const B=A(E),N=E-u,j=t-B;return p?Math.min(j,s-N):j}function v(E){const B=A(E),N=E-u;return l===void 0||B>=t||B<0||p&&N>=s}function M(){const E=Date.now();if(v(E))return k(E);h(M,_(E))}function y(){c=void 0}function k(E){return y(),f&&o?b(E):(o=r=void 0,i)}function S(){g(),u=0,y(),o=l=r=void 0}function C(){return R()?k(Date.now()):i}function R(){return c!==void 0}function T(...E){const B=Date.now(),N=v(B);if(o=E,r=this,l=B,N){if(!R())return z(l);if(p)return h(M,t),b(l)}return R()||h(M,t),i}return T.cancel=S,T.flush=C,T.pending=R,T},RN=(e,t,n)=>{let o=!0,r=!0;return n&&(o="leading"in n?!!n.leading:o,r="trailing"in n?!!n.trailing:r),F1(e,t,{leading:o,trailing:r,maxWait:t})};function gc(){const e=new Map,t=new Map;function n(o){const r=t.get(o);if(r)for(const s of r)s()}return{get(o){return e.get(o)},set(o,r){e.set(o,r),n(o)},delete(o){e.delete(o),n(o)},subscribe(o,r){let s=t.get(o);return s||(s=new Set,t.set(o,s)),s.add(r),()=>{s.delete(r),s.size===0&&t.delete(o)}}}}const Xre=(e=!1)=>(...t)=>(...n)=>{const o=t.flat();return e&&o.reverse(),o.reduce((r,s)=>[s(...r)],n)[0]},Ku=Xre(),Co=Xre(!0);function d6e(e){return Or(t=>n=>e(n)?a.jsx(t,{...n}):null,"ifCondition")}function Gre(e,t){if(e===t)return!0;const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;let r=0;for(;r{if(n)return n;const o=b6e(e);return t?`${t}-${o}`:o},[e,n,t])}const h6e=Or(e=>t=>{const n=vt(e);return a.jsx(e,{...t,instanceId:n})},"instanceId"),m6e=Or(e=>class extends x.Component{constructor(n){super(n),this.timeouts=[],this.setTimeout=this.setTimeout.bind(this),this.clearTimeout=this.clearTimeout.bind(this)}componentWillUnmount(){this.timeouts.forEach(clearTimeout)}setTimeout(n,o){const r=setTimeout(()=>{n(),this.clearTimeout(r)},o);return this.timeouts.push(r),r}clearTimeout(n){clearTimeout(n),this.timeouts=this.timeouts.filter(o=>o!==n)}render(){return a.jsx(e,{...this.props,setTimeout:this.setTimeout,clearTimeout:this.clearTimeout})}},"withSafeTimeout");function g6e(e){return[e?'[tabindex]:not([tabindex^="-"])':"[tabindex]","a[href]","button:not([disabled])",'input:not([type="hidden"]):not([disabled])',"select:not([disabled])","textarea:not([disabled])",'iframe:not([tabindex^="-"])',"object","embed","area[href]","[contenteditable]:not([contenteditable=false])"].join(",")}function Kre(e){return e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0}function M6e(e){const t=e.closest("map[name]");if(!t)return!1;const n=e.ownerDocument.querySelector('img[usemap="#'+t.name+'"]');return!!n&&Kre(n)}function y5(e,{sequential:t=!1}={}){const n=e.querySelectorAll(g6e(t));return Array.from(n).filter(o=>{if(!Kre(o))return!1;const{nodeName:r}=o;return r==="AREA"?M6e(o):!0})}const z6e=Object.freeze(Object.defineProperty({__proto__:null,find:y5},Symbol.toStringTag,{value:"Module"}));function gE(e){const t=e.getAttribute("tabindex");return t===null?0:parseInt(t,10)}function Yre(e){return gE(e)!==-1}function O6e(){const e={};return function(n,o){const{nodeName:r,type:s,checked:i,name:c}=o;if(r!=="INPUT"||s!=="radio"||!c)return n.concat(o);const l=e.hasOwnProperty(c);if(!(i||!l))return n;if(l){const d=e[c];n=n.filter(p=>p!==d)}return e[c]=o,n.concat(o)}}function y6e(e,t){return{element:e,index:t}}function A6e(e){return e.element}function v6e(e,t){const n=gE(e.element),o=gE(t.element);return n===o?e.index-t.index:n-o}function TN(e){return e.filter(Yre).map(y6e).sort(v6e).map(A6e).reduce(O6e(),[])}function x6e(e){return TN(y5(e))}function w6e(e){return TN(y5(e.ownerDocument.body)).reverse().find(t=>e.compareDocumentPosition(t)&e.DOCUMENT_POSITION_PRECEDING)}function _6e(e){return TN(y5(e.ownerDocument.body)).find(t=>e.compareDocumentPosition(t)&e.DOCUMENT_POSITION_FOLLOWING)}const k6e=Object.freeze(Object.defineProperty({__proto__:null,find:x6e,findNext:_6e,findPrevious:w6e,isTabbableIndex:Yre},Symbol.toStringTag,{value:"Module"}));function Ev(e){if(!e.collapsed){const s=Array.from(e.getClientRects());if(s.length===1)return s[0];const i=s.filter(({width:p})=>p>1);if(i.length===0)return e.getBoundingClientRect();if(i.length===1)return i[0];let{top:c,bottom:l,left:u,right:d}=i[0];for(const{top:p,bottom:f,left:b,right:h}of i)pl&&(l=f),bd&&(d=h);return new window.DOMRect(u,c,d-u,l-c)}const{startContainer:t}=e,{ownerDocument:n}=t;if(t.nodeName==="BR"){const{parentNode:s}=t,i=Array.from(s.childNodes).indexOf(t);e=n.createRange(),e.setStart(s,i),e.setEnd(s,i)}const o=e.getClientRects();if(o.length>1)return null;let r=o[0];if(!r||r.height===0){const s=n.createTextNode("​");e=e.cloneRange(),e.insertNode(s),r=e.getClientRects()[0],s.parentNode,s.parentNode.removeChild(s)}return r}function ME(e){const t=e.getSelection(),n=t.rangeCount?t.getRangeAt(0):null;return n?Ev(n):null}function Zre(e){e.defaultView;const t=e.defaultView.getSelection(),n=t.rangeCount?t.getRangeAt(0):null;return!!n&&!n.collapsed}function EN(e){return e?.nodeName==="INPUT"}function md(e){const t=["button","checkbox","hidden","file","radio","image","range","reset","submit","number","email","time"];return EN(e)&&e.type&&!t.includes(e.type)||e.nodeName==="TEXTAREA"||e.contentEditable==="true"}function S6e(e){if(!EN(e)&&!md(e))return!1;try{const{selectionStart:t,selectionEnd:n}=e;return t===null||t!==n}catch{return!0}}function C6e(e){return Zre(e)||!!e.activeElement&&S6e(e.activeElement)}function q6e(e){return!!e.activeElement&&(EN(e.activeElement)||md(e.activeElement)||Zre(e))}function k4(e){return e.ownerDocument.defaultView,e.ownerDocument.defaultView.getComputedStyle(e)}function ps(e,t="vertical"){if(e){if((t==="vertical"||t==="all")&&e.scrollHeight>e.clientHeight){const{overflowY:n}=k4(e);if(/(auto|scroll)/.test(n))return e}if((t==="horizontal"||t==="all")&&e.scrollWidth>e.clientWidth){const{overflowX:n}=k4(e);if(/(auto|scroll)/.test(n))return e}return e.ownerDocument===e.parentNode?e:ps(e.parentNode,t)}}function A5(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"}function R6e(e){if(A5(e))return e.selectionStart===0&&e.value.length===e.selectionEnd;if(!e.isContentEditable)return!0;const{ownerDocument:t}=e,{defaultView:n}=t,o=n.getSelection(),r=o.rangeCount?o.getRangeAt(0):null;if(!r)return!0;const{startContainer:s,endContainer:i,startOffset:c,endOffset:l}=r;if(s===e&&i===e&&c===0&&l===e.childNodes.length)return!0;e.lastChild;const u=i.nodeType===i.TEXT_NODE?i.data.length:i.childNodes.length;return kH(s,e,"firstChild")&&kH(i,e,"lastChild")&&c===0&&l===u}function kH(e,t,n){let o=t;do{if(e===o)return!0;o=o[n]}while(o);return!1}function Qre(e){if(!e)return!1;const{tagName:t}=e;return A5(e)||t==="BUTTON"||t==="SELECT"}function WN(e){return k4(e).direction==="rtl"}function T6e(e){const t=Array.from(e.getClientRects());if(!t.length)return;const n=Math.min(...t.map(({top:r})=>r));return Math.max(...t.map(({bottom:r})=>r))-n}function Jre(e){const{anchorNode:t,focusNode:n,anchorOffset:o,focusOffset:r}=e,s=t.compareDocumentPosition(n);return s&t.DOCUMENT_POSITION_PRECEDING?!1:s&t.DOCUMENT_POSITION_FOLLOWING?!0:s===0?o<=r:!0}function E6e(e,t,n){if(e.caretRangeFromPoint)return e.caretRangeFromPoint(t,n);if(!e.caretPositionFromPoint)return null;const o=e.caretPositionFromPoint(t,n);if(!o)return null;const r=e.createRange();return r.setStart(o.offsetNode,o.offset),r.collapse(!0),r}function e0e(e,t,n,o){const r=o.style.zIndex,s=o.style.position,{position:i="static"}=k4(o);i==="static"&&(o.style.position="relative"),o.style.zIndex="10000";const c=E6e(e,t,n);return o.style.zIndex=r,o.style.position=s,c}function t0e(e,t,n){let o=n();return(!o||!o.startContainer||!e.contains(o.startContainer))&&(e.scrollIntoView(t),o=n(),!o||!o.startContainer||!e.contains(o.startContainer))?null:o}function n0e(e,t,n=!1){if(A5(e)&&typeof e.selectionStart=="number")return e.selectionStart!==e.selectionEnd?!1:t?e.selectionStart===0:e.value.length===e.selectionStart;if(!e.isContentEditable)return!0;const{ownerDocument:o}=e,{defaultView:r}=o,s=r.getSelection();if(!s||!s.rangeCount)return!1;const i=s.getRangeAt(0),c=i.cloneRange(),l=Jre(s),u=s.isCollapsed;u||c.collapse(!l);const d=Ev(c),p=Ev(i);if(!d||!p)return!1;const f=T6e(i);if(!u&&f&&f>d.height&&l===t)return!1;const b=WN(e)?!t:t,h=e.getBoundingClientRect(),g=b?h.left+1:h.right-1,z=t?h.top+1:h.bottom-1,A=t0e(e,t,()=>e0e(o,g,z,e));if(!A)return!1;const _=Ev(A);if(!_)return!1;const v=t?"top":"bottom",M=b?"left":"right",y=_[v]-p[v],k=_[M]-d[M],S=Math.abs(y)<=1,C=Math.abs(k)<=1;return n?S:S&&C}function mS(e,t){return n0e(e,t)}function SH(e,t){return n0e(e,t,!0)}function W6e(e,t,n){const{ownerDocument:o}=e,r=WN(e)?!t:t,s=e.getBoundingClientRect();n===void 0?n=t?s.right-1:s.left+1:n<=s.left?n=s.left+1:n>=s.right&&(n=s.right-1);const i=r?s.bottom-1:s.top+1;return e0e(o,n,i,e)}function o0e(e,t,n){if(!e)return;if(e.focus(),A5(e)){if(typeof e.selectionStart!="number")return;t?(e.selectionStart=e.value.length,e.selectionEnd=e.value.length):(e.selectionStart=0,e.selectionEnd=0);return}if(!e.isContentEditable)return;const o=t0e(e,t,()=>W6e(e,t,n));if(!o)return;const{ownerDocument:r}=e,{defaultView:s}=r,i=s.getSelection();i.removeAllRanges(),i.addRange(o)}function r0e(e,t){return o0e(e,t,void 0)}function N6e(e,t,n){return o0e(e,t,n?.left)}function s0e(e,t){t.parentNode,t.parentNode.insertBefore(e,t.nextSibling)}function pf(e){e.parentNode,e.parentNode.removeChild(e)}function B6e(e,t){e.parentNode,s0e(t,e.parentNode),pf(e)}function mM(e){const t=e.parentNode;for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}function CH(e,t){const n=e.ownerDocument.createElement(t);for(;e.firstChild;)n.appendChild(e.firstChild);return e.parentNode,e.parentNode.replaceChild(n,e),n}function yg(e,t){t.parentNode,t.parentNode.insertBefore(e,t),e.appendChild(t)}function v5(e){const{body:t}=document.implementation.createHTMLDocument("");t.innerHTML=e;const n=t.getElementsByTagName("*");let o=n.length;for(;o--;){const r=n[o];if(r.tagName==="SCRIPT")pf(r);else{let s=r.attributes.length;for(;s--;){const{name:i}=r.attributes[s];i.startsWith("on")&&r.removeAttribute(i)}}}return t.innerHTML}function x1(e){e=v5(e);const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,t.body.textContent||""}function S4(e){switch(e.nodeType){case e.TEXT_NODE:return/^[ \f\n\r\t\v\u00a0]*$/.test(e.nodeValue||"");case e.ELEMENT_NODE:return e.hasAttributes()?!1:e.hasChildNodes()?Array.from(e.childNodes).every(S4):!0;default:return!0}}const gM={strong:{},em:{},s:{},del:{},ins:{},a:{attributes:["href","target","rel","id"]},code:{},abbr:{attributes:["title"]},sub:{},sup:{},br:{},small:{},q:{attributes:["cite"]},dfn:{attributes:["title"]},data:{attributes:["value"]},time:{attributes:["datetime"]},var:{},samp:{},kbd:{},i:{},b:{},u:{},mark:{},ruby:{},rt:{},rp:{},bdi:{attributes:["dir"]},bdo:{attributes:["dir"]},wbr:{},"#text":{}},L6e=["#text","br"];Object.keys(gM).filter(e=>!L6e.includes(e)).forEach(e=>{const{[e]:t,...n}=gM;gM[e].children=n});const P6e={audio:{attributes:["src","preload","autoplay","mediagroup","loop","muted"]},canvas:{attributes:["width","height"]},embed:{attributes:["src","type","width","height"]},img:{attributes:["alt","src","srcset","usemap","ismap","width","height"]},object:{attributes:["data","type","name","usemap","form","width","height"]},video:{attributes:["src","poster","preload","playsinline","autoplay","mediagroup","loop","muted","controls","width","height"]}},aA={...gM,...P6e};function x5(e){if(e!=="paste")return aA;const{u:t,abbr:n,data:o,time:r,wbr:s,bdi:i,bdo:c,...l}={...aA,ins:{children:aA.ins.children},del:{children:aA.del.children}};return l}function k2(e){const t=e.nodeName.toLowerCase();return x5().hasOwnProperty(t)||t==="span"}function i0e(e){const t=e.nodeName.toLowerCase();return gM.hasOwnProperty(t)||t==="span"}function j6e(e){return!!e&&e.nodeType===e.ELEMENT_NODE}const I6e=()=>{};function Kg(e,t,n,o){Array.from(e).forEach(r=>{const s=r.nodeName.toLowerCase();if(n.hasOwnProperty(s)&&(!n[s].isMatch||n[s].isMatch?.(r))){if(j6e(r)){const{attributes:i=[],classes:c=[],children:l,require:u=[],allowEmpty:d}=n[s];if(l&&!d&&S4(r)){pf(r);return}if(r.hasAttributes()&&(Array.from(r.attributes).forEach(({name:p})=>{p!=="class"&&!i.includes(p)&&r.removeAttribute(p)}),r.classList&&r.classList.length)){const p=c.map(f=>f==="*"?()=>!0:typeof f=="string"?b=>b===f:f instanceof RegExp?b=>f.test(b):I6e);Array.from(r.classList).forEach(f=>{p.some(b=>b(f))||r.classList.remove(f)}),r.classList.length||r.removeAttribute("class")}if(r.hasChildNodes()){if(l==="*")return;if(l)u.length&&!r.querySelector(u.join(","))?(Kg(r.childNodes,t,n,o),mM(r)):r.parentNode&&r.parentNode.nodeName==="BODY"&&k2(r)?(Kg(r.childNodes,t,n,o),Array.from(r.childNodes).some(p=>!k2(p))&&mM(r)):Kg(r.childNodes,t,l,o);else for(;r.firstChild;)pf(r.firstChild)}}}else Kg(r.childNodes,t,n,o),o&&!k2(r)&&r.nextElementSibling&&s0e(t.createElement("br"),r),mM(r)})}function zE(e,t,n){const o=document.implementation.createHTMLDocument("");return o.body.innerHTML=e,Kg(o.body.childNodes,o,t,n),o.body.innerHTML}function C4(e){const t=Array.from(e.files);return Array.from(e.items).forEach(n=>{const o=n.getAsFile();o&&!t.find(({name:r,type:s,size:i})=>r===o.name&&s===o.type&&i===o.size)&&t.push(o)}),t}const Xr={focusable:z6e,tabbable:k6e};function Mn(e,t){const n=x.useRef();return x.useCallback(o=>{o?n.current=e(o):n.current&&n.current()},t)}function NN(){return Mn(e=>{function t(n){const{key:o,shiftKey:r,target:s}=n;if(o!=="Tab")return;const i=r?"findPrevious":"findNext",c=Xr.tabbable[i](s)||null;if(s.contains(c)){n.preventDefault(),c?.focus();return}if(e.contains(c))return;const l=r?"append":"prepend",{ownerDocument:u}=e,d=u.createElement("div");d.tabIndex=-1,e[l](d),d.addEventListener("blur",()=>e.removeChild(d)),d.focus()}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}},[])}var Wv={exports:{}};/*! * clipboard.js v2.0.11 * https://clipboardjs.com/ * * Licensed MIT © Zeno Rocha - */var RSe=Wv.exports,jH;function TSe(){return jH||(jH=1,function(e,t){(function(o,r){e.exports=r()})(RSe,function(){return function(){var n={686:function(s,i,c){c.d(i,{default:function(){return V}});var l=c(279),u=c.n(l),d=c(370),p=c.n(d),f=c(817),b=c.n(f);function h(Q){try{return document.execCommand(Q)}catch{return!1}}var g=function(te){var ee=b()(te);return h("cut"),ee},z=g;function A(Q){var te=document.documentElement.getAttribute("dir")==="rtl",ee=document.createElement("textarea");ee.style.fontSize="12pt",ee.style.border="0",ee.style.padding="0",ee.style.margin="0",ee.style.position="absolute",ee.style[te?"right":"left"]="-9999px";var ue=window.pageYOffset||document.documentElement.scrollTop;return ee.style.top="".concat(ue,"px"),ee.setAttribute("readonly",""),ee.value=Q,ee}var _=function(te,ee){var ue=A(te);ee.container.appendChild(ue);var ce=b()(ue);return h("copy"),ue.remove(),ce},v=function(te){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},ue="";return typeof te=="string"?ue=_(te,ee):te instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(te?.type)?ue=_(te.value,ee):(ue=b()(te),h("copy")),ue},M=v;function y(Q){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?y=function(ee){return typeof ee}:y=function(ee){return ee&&typeof Symbol=="function"&&ee.constructor===Symbol&&ee!==Symbol.prototype?"symbol":typeof ee},y(Q)}var k=function(){var te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ee=te.action,ue=ee===void 0?"copy":ee,ce=te.container,me=te.target,de=te.text;if(ue!=="copy"&&ue!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(me!==void 0)if(me&&y(me)==="object"&&me.nodeType===1){if(ue==="copy"&&me.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(ue==="cut"&&(me.hasAttribute("readonly")||me.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(de)return M(de,{container:ce});if(me)return ue==="cut"?z(me):M(me,{container:ce})},S=k;function C(Q){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?C=function(ee){return typeof ee}:C=function(ee){return ee&&typeof Symbol=="function"&&ee.constructor===Symbol&&ee!==Symbol.prototype?"symbol":typeof ee},C(Q)}function R(Q,te){if(!(Q instanceof te))throw new TypeError("Cannot call a class as a function")}function T(Q,te){for(var ee=0;ee"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function F(Q){return F=Object.setPrototypeOf?Object.getPrototypeOf:function(ee){return ee.__proto__||Object.getPrototypeOf(ee)},F(Q)}function X(Q,te){var ee="data-clipboard-".concat(Q);if(te.hasAttribute(ee))return te.getAttribute(ee)}var Z=function(Q){B(ee,Q);var te=j(ee);function ee(ue,ce){var me;return R(this,ee),me=te.call(this),me.resolveOptions(ce),me.listenClick(ue),me}return E(ee,[{key:"resolveOptions",value:function(){var ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof ce.action=="function"?ce.action:this.defaultAction,this.target=typeof ce.target=="function"?ce.target:this.defaultTarget,this.text=typeof ce.text=="function"?ce.text:this.defaultText,this.container=C(ce.container)==="object"?ce.container:document.body}},{key:"listenClick",value:function(ce){var me=this;this.listener=p()(ce,"click",function(de){return me.onClick(de)})}},{key:"onClick",value:function(ce){var me=ce.delegateTarget||ce.currentTarget,de=this.action(me)||"copy",Ae=S({action:de,container:this.container,target:this.target(me),text:this.text(me)});this.emit(Ae?"success":"error",{action:de,text:Ae,trigger:me,clearSelection:function(){me&&me.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(ce){return X("action",ce)}},{key:"defaultTarget",value:function(ce){var me=X("target",ce);if(me)return document.querySelector(me)}},{key:"defaultText",value:function(ce){return X("text",ce)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(ce){var me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return M(ce,me)}},{key:"cut",value:function(ce){return z(ce)}},{key:"isSupported",value:function(){var ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],me=typeof ce=="string"?[ce]:ce,de=!!document.queryCommandSupported;return me.forEach(function(Ae){de=de&&!!document.queryCommandSupported(Ae)}),de}}]),ee}(u()),V=Z},828:function(s){var i=9;if(typeof Element<"u"&&!Element.prototype.matches){var c=Element.prototype;c.matches=c.matchesSelector||c.mozMatchesSelector||c.msMatchesSelector||c.oMatchesSelector||c.webkitMatchesSelector}function l(u,d){for(;u&&u.nodeType!==i;){if(typeof u.matches=="function"&&u.matches(d))return u;u=u.parentNode}}s.exports=l},438:function(s,i,c){var l=c(828);function u(f,b,h,g,z){var A=p.apply(this,arguments);return f.addEventListener(h,A,z),{destroy:function(){f.removeEventListener(h,A,z)}}}function d(f,b,h,g,z){return typeof f.addEventListener=="function"?u.apply(null,arguments):typeof h=="function"?u.bind(null,document).apply(null,arguments):(typeof f=="string"&&(f=document.querySelectorAll(f)),Array.prototype.map.call(f,function(A){return u(A,b,h,g,z)}))}function p(f,b,h,g){return function(z){z.delegateTarget=l(z.target,b),z.delegateTarget&&g.call(f,z)}}s.exports=d},879:function(s,i){i.node=function(c){return c!==void 0&&c instanceof HTMLElement&&c.nodeType===1},i.nodeList=function(c){var l=Object.prototype.toString.call(c);return c!==void 0&&(l==="[object NodeList]"||l==="[object HTMLCollection]")&&"length"in c&&(c.length===0||i.node(c[0]))},i.string=function(c){return typeof c=="string"||c instanceof String},i.fn=function(c){var l=Object.prototype.toString.call(c);return l==="[object Function]"}},370:function(s,i,c){var l=c(879),u=c(438);function d(h,g,z){if(!h&&!g&&!z)throw new Error("Missing required arguments");if(!l.string(g))throw new TypeError("Second argument must be a String");if(!l.fn(z))throw new TypeError("Third argument must be a Function");if(l.node(h))return p(h,g,z);if(l.nodeList(h))return f(h,g,z);if(l.string(h))return b(h,g,z);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function p(h,g,z){return h.addEventListener(g,z),{destroy:function(){h.removeEventListener(g,z)}}}function f(h,g,z){return Array.prototype.forEach.call(h,function(A){A.addEventListener(g,z)}),{destroy:function(){Array.prototype.forEach.call(h,function(A){A.removeEventListener(g,z)})}}}function b(h,g,z){return u(document.body,h,g,z)}s.exports=d},817:function(s){function i(c){var l;if(c.nodeName==="SELECT")c.focus(),l=c.value;else if(c.nodeName==="INPUT"||c.nodeName==="TEXTAREA"){var u=c.hasAttribute("readonly");u||c.setAttribute("readonly",""),c.select(),c.setSelectionRange(0,c.value.length),u||c.removeAttribute("readonly"),l=c.value}else{c.hasAttribute("contenteditable")&&c.focus();var d=window.getSelection(),p=document.createRange();p.selectNodeContents(c),d.removeAllRanges(),d.addRange(p),l=d.toString()}return l}s.exports=i},279:function(s){function i(){}i.prototype={on:function(c,l,u){var d=this.e||(this.e={});return(d[c]||(d[c]=[])).push({fn:l,ctx:u}),this},once:function(c,l,u){var d=this;function p(){d.off(c,p),l.apply(u,arguments)}return p._=l,this.on(c,p,u)},emit:function(c){var l=[].slice.call(arguments,1),u=((this.e||(this.e={}))[c]||[]).slice(),d=0,p=u.length;for(d;d{t.current=e},[e]),t}function Hl(e,t){const n=IH(e),o=IH(t);return Mn(r=>{const s=new WSe(r,{text(){return typeof n.current=="function"?n.current():n.current||""}});return s.on("success",({clearSelection:i})=>{i(),o.current&&o.current()}),()=>{s.destroy()}},[])}function da(e=null){if(!e){if(typeof window>"u")return!1;e=window}const{platform:t}=e.navigator;return t.indexOf("Mac")!==-1||["iPad","iPhone"].includes(t)}const Mc=8,Z2=9,Gr=13,gd=27,DN=32,NSe=33,BSe=34,FM=35,S2=36,wi=37,cc=38,_i=39,Ps=40,zl=46,LSe=121,ea="alt",Ga="ctrl",Up="meta",ta="shift";function m0e(e){return e.length<2?e.toUpperCase():e.charAt(0).toUpperCase()+e.slice(1)}function l3(e,t){return Object.fromEntries(Object.entries(e).map(([n,o])=>[n,t(o)]))}const S5={primary:e=>e()?[Up]:[Ga],primaryShift:e=>e()?[ta,Up]:[Ga,ta],primaryAlt:e=>e()?[ea,Up]:[Ga,ea],secondary:e=>e()?[ta,ea,Up]:[Ga,ta,ea],access:e=>e()?[Ga,ea]:[ta,ea],ctrl:()=>[Ga],alt:()=>[ea],ctrlShift:()=>[Ga,ta],shift:()=>[ta],shiftAlt:()=>[ta,ea],undefined:()=>[]},PSe=l3(S5,e=>(t,n=da)=>[...e(n),t.toLowerCase()].join("+")),g0e=l3(S5,e=>(t,n=da)=>{const o=n(),r={[ea]:o?"⌥":"Alt",[Ga]:o?"⌃":"Ctrl",[Up]:"⌘",[ta]:o?"⇧":"Shift"};return[...e(n).reduce((i,c)=>{var l;const u=(l=r[c])!==null&&l!==void 0?l:c;return o?[...i,u]:[...i,u,"+"]},[]),m0e(t)]}),j1=l3(g0e,e=>(t,n=da)=>e(t,n).join("")),M0e=l3(S5,e=>(t,n=da)=>{const o=n(),r={[ta]:"Shift",[Up]:o?"Command":"Control",[Ga]:"Control",[ea]:o?"Option":"Alt",",":m("Comma"),".":m("Period"),"`":m("Backtick"),"~":m("Tilde")};return[...e(n),t].map(s=>{var i;return m0e((i=r[s])!==null&&i!==void 0?i:s)}).join(o?" ":" + ")});function jSe(e){return[ea,Ga,Up,ta].filter(t=>e[`${t}Key`])}const lc=l3(S5,e=>(t,n,o=da)=>{const r=e(o),s=jSe(t),i={Comma:",",Backslash:"\\",IntlRo:"\\",IntlYen:"\\"},c=r.filter(d=>!s.includes(d)),l=s.filter(d=>!r.includes(d));if(c.length>0||l.length>0)return!1;let u=t.key.toLowerCase();return n?(t.altKey&&n.length===1&&(u=String.fromCharCode(t.keyCode).toLowerCase()),t.shiftKey&&n.length===1&&i[t.code]&&(u=i[t.code]),n==="del"&&(n="delete"),u===n.toLowerCase()):r.includes(u)});function C5(e="firstElement"){const t=x.useRef(e),n=r=>{r.focus({preventScroll:!0})},o=x.useRef();return x.useEffect(()=>{t.current=e},[e]),Mn(r=>{var s;if(!(!r||t.current===!1)&&!r.contains((s=r.ownerDocument?.activeElement)!==null&&s!==void 0?s:null)){if(t.current!=="firstElement"){n(r);return}return o.current=setTimeout(()=>{const i=Xr.tabbable.find(r)[0];i&&n(i)},0),()=>{o.current&&clearTimeout(o.current)}}},[])}let cA=null;function FN(e){const t=x.useRef(null),n=x.useRef(null),o=x.useRef(e);return x.useEffect(()=>{o.current=e},[e]),x.useCallback(r=>{if(r){var s;if(t.current=r,n.current)return;const c=r.ownerDocument.activeElement instanceof window.HTMLIFrameElement?r.ownerDocument.activeElement.contentDocument:r.ownerDocument;n.current=(s=c?.activeElement)!==null&&s!==void 0?s:null}else if(n.current){const c=t.current?.contains(t.current?.ownerDocument.activeElement);if(t.current?.isConnected&&!c){var i;(i=cA)!==null&&i!==void 0||(cA=n.current);return}o.current?o.current():(n.current.isConnected?n.current:cA)?.focus(),cA=null}},[])}const ISe=["button","submit"];function DSe(e){if(!(e instanceof window.HTMLElement))return!1;switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return ISe.includes(e.type)}return!1}function z0e(e){const t=x.useRef(e);x.useEffect(()=>{t.current=e},[e]);const n=x.useRef(!1),o=x.useRef(),r=x.useCallback(()=>{clearTimeout(o.current)},[]);x.useEffect(()=>()=>r(),[]),x.useEffect(()=>{e||r()},[e,r]);const s=x.useCallback(c=>{const{type:l,target:u}=c;["mouseup","touchend"].includes(l)?n.current=!1:DSe(u)&&(n.current=!0)},[]),i=x.useCallback(c=>{if(c.persist(),n.current)return;const l=c.target.getAttribute("data-unstable-ignore-focus-outside-for-relatedtarget");l&&c.relatedTarget?.closest(l)||(o.current=setTimeout(()=>{if(!document.hasFocus()){c.preventDefault();return}typeof t.current=="function"&&t.current(c)},0))},[]);return{onFocus:r,onMouseDown:s,onMouseUp:s,onTouchStart:s,onTouchEnd:s,onBlur:i}}function lA(e,t){typeof e=="function"?e(t):e&&e.hasOwnProperty("current")&&(e.current=t)}function xn(e){const t=x.useRef(),n=x.useRef(!1),o=x.useRef(!1),r=x.useRef([]),s=x.useRef(e);return s.current=e,x.useLayoutEffect(()=>{o.current===!1&&n.current===!0&&e.forEach((i,c)=>{const l=r.current[c];i!==l&&(lA(l,null),lA(i,t.current))}),r.current=e},e),x.useLayoutEffect(()=>{o.current=!1}),x.useCallback(i=>{lA(t,i),o.current=!0,n.current=i!==null;const c=i?s.current:r.current;for(const l of c)lA(l,i)},[])}function O0e(e){const t=x.useRef(),{constrainTabbing:n=e.focusOnMount!==!1}=e;x.useEffect(()=>{t.current=e},Object.values(e));const o=IN(),r=C5(e.focusOnMount),s=FN(),i=z0e(l=>{t.current?.__unstableOnClose?t.current.__unstableOnClose("focus-outside",l):t.current?.onClose&&t.current.onClose()}),c=x.useCallback(l=>{l&&l.addEventListener("keydown",u=>{u.keyCode===gd&&!u.defaultPrevented&&t.current?.onClose&&(u.preventDefault(),t.current.onClose())})},[]);return[xn([n?o:null,e.focusOnMount!==!1?s:null,e.focusOnMount!==!1?r:null,c]),{...i,tabIndex:-1}]}function $N({isDisabled:e=!1}={}){return Mn(t=>{if(e)return;const n=t?.ownerDocument?.defaultView;if(!n)return;const o=[],r=()=>{t.childNodes.forEach(c=>{c instanceof n.HTMLElement&&(c.getAttribute("inert")||(c.setAttribute("inert","true"),o.push(()=>{c.removeAttribute("inert")})))})},s=F1(r,0,{leading:!0});r();const i=new window.MutationObserver(s);return i.observe(t,{childList:!0}),()=>{i&&i.disconnect(),s.cancel(),o.forEach(c=>c())}},[e])}function Ts(e){const t=x.useRef(()=>{throw new Error("Callbacks created with `useEvent` cannot be called during rendering.")});return x.useInsertionEffect(()=>{t.current=e}),x.useCallback((...n)=>t.current?.(...n),[])}const VN=typeof window<"u"?x.useLayoutEffect:x.useEffect;function y0e({onDragStart:e,onDragMove:t,onDragEnd:n}){const[o,r]=x.useState(!1),s=x.useRef({onDragStart:e,onDragMove:t,onDragEnd:n});VN(()=>{s.current.onDragStart=e,s.current.onDragMove=t,s.current.onDragEnd=n},[e,t,n]);const i=x.useCallback(u=>s.current.onDragMove&&s.current.onDragMove(u),[]),c=x.useCallback(u=>{s.current.onDragEnd&&s.current.onDragEnd(u),document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",c),r(!1)},[]),l=x.useCallback(u=>{s.current.onDragStart&&s.current.onDragStart(u),document.addEventListener("mousemove",i),document.addEventListener("mouseup",c),r(!0)},[]);return x.useEffect(()=>()=>{o&&(document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",c))},[o]),{startDrag:l,endDrag:c,isDragging:o}}const DH=new Map;function FSe(e){if(!e)return null;let t=DH.get(e);return t||(typeof window<"u"&&typeof window.matchMedia=="function"?(t=window.matchMedia(e),DH.set(e,t),t):null)}function HN(e){const t=x.useMemo(()=>{const n=FSe(e);return{subscribe(o){return n?(n.addEventListener?.("change",o),()=>{n.removeEventListener?.("change",o)}):()=>{}},getValue(){var o;return(o=n?.matches)!==null&&o!==void 0?o:!1}}},[e]);return x.useSyncExternalStore(t.subscribe,t.getValue,()=>!1)}function Fr(e){const t=x.useRef();return x.useEffect(()=>{t.current=e},[e]),t.current}const $1=()=>HN("(prefers-reduced-motion: reduce)");function $Se(e,t){const n={...e};return Object.entries(t).forEach(([o,r])=>{n[o]?n[o]={...n[o],to:r.to}:n[o]=r}),n}const FH=(e,t)=>{const n=e?.findIndex(({id:r})=>typeof r=="string"?r===t.id:ds(r,t.id)),o=[...e];return n!==-1?o[n]={id:t.id,changes:$Se(o[n].changes,t.changes)}:o.push(t),o};function VSe(){let e=[],t=[],n=0;const o=()=>{e=e.slice(0,n||void 0),n=0},r=()=>{var i;const c=e.length===0?0:e.length-1;let l=(i=e[c])!==null&&i!==void 0?i:[];t.forEach(u=>{l=FH(l,u)}),t=[],e[c]=l},s=i=>!i.filter(({changes:l})=>Object.values(l).some(({from:u,to:d})=>typeof u!="function"&&typeof d!="function"&&!ds(u,d))).length;return{addRecord(i,c=!1){const l=!i||s(i);if(c){if(l)return;i.forEach(u=>{t=FH(t,u)})}else{if(o(),t.length&&r(),l)return;e.push(i)}},undo(){t.length&&(o(),r());const i=e[e.length-1+n];if(i)return n-=1,i},redo(){const i=e[e.length+n];if(i)return n+=1,i},hasUndo(){return!!e[e.length-1+n]},hasRedo(){return!!e[e.length+n]}}}const $H={xhuge:1920,huge:1440,wide:1280,xlarge:1080,large:960,medium:782,small:600,mobile:480},HSe={">=":"min-width","<":"max-width"},USe={">=":(e,t)=>t>=e,"<":(e,t)=>t=")=>{const n=x.useContext(A0e),o=!n&&`(${HSe[t]}: ${$H[e]}px)`,r=HN(o||void 0);return n?USe[t]($H[e],n):r};Yn.__experimentalWidthProvider=A0e.Provider;function v0e(e,t={}){const n=Ts(e),o=x.useRef(),r=x.useRef();return Ts(s=>{var i;if(s===o.current)return;(i=r.current)!==null&&i!==void 0||(r.current=new ResizeObserver(n));const{current:c}=r;o.current&&c.unobserve(o.current),o.current=s,s&&c.observe(s,t)})}const XSe=e=>{let t;if(!e.contentBoxSize)t=[e.contentRect.width,e.contentRect.height];else if(e.contentBoxSize[0]){const r=e.contentBoxSize[0];t=[r.inlineSize,r.blockSize]}else{const r=e.contentBoxSize;t=[r.inlineSize,r.blockSize]}const[n,o]=t.map(r=>Math.round(r));return{width:n,height:o}},GSe={position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none",opacity:0,overflow:"hidden",zIndex:-1};function KSe({onResize:e}){const t=v0e(n=>{const o=XSe(n.at(-1));e(o)});return a.jsx("div",{ref:t,style:GSe,"aria-hidden":"true"})}function YSe(e,t){return e.width===t.width&&e.height===t.height}const VH={width:null,height:null};function ZSe(){const[e,t]=x.useState(VH),n=x.useRef(VH),o=x.useCallback(s=>{YSe(n.current,s)||(n.current=s,t(s))},[]);return[a.jsx(KSe,{onResize:o}),e]}function js(e,t={}){return e?v0e(e,t):ZSe()}var MS={exports:{}},HH;function QSe(){return HH||(HH=1,function(e){(function(t){e.exports?e.exports=t():window.idleCallbackShim=t()})(function(){var t,n,o,r,s=typeof window<"u"?window:typeof p1!=null?p1:this||{},i=s.cancelRequestAnimationFrame&&s.requestAnimationFrame||setTimeout,c=s.cancelRequestAnimationFrame||clearTimeout,l=[],u=0,d=!1,p=7,f=35,b=125,h=0,g=0,z=0,A={get didTimeout(){return!1},timeRemaining:function(){var B=p-(Date.now()-g);return B<0?0:B}},_=v(function(){p=22,b=66,f=0});function v(B){var N,j,I=99,P=function(){var $=Date.now()-j;$9?o=setTimeout(S,n):(n=0,S()))}function R(){var B,N,j,I=p>9?9:1;if(g=Date.now(),d=!1,o=null,u>2||g-n-50I;N++)B=l.shift(),z++,B&&B(A);l.length?C():u=0}function T(B){return h++,l.push(B),C(),h}function E(B){var N=B-1-z;l[N]&&(l[N]=null)}if(!s.requestIdleCallback||!s.cancelIdleCallback)s.requestIdleCallback=T,s.cancelIdleCallback=E,s.document&&document.addEventListener&&(s.addEventListener("scroll",y,!0),s.addEventListener("resize",y),document.addEventListener("focus",y,!0),document.addEventListener("mouseover",y,!0),["click","keypress","touchstart","mousedown"].forEach(function(B){document.addEventListener(B,y,{capture:!0,passive:!0})}),s.MutationObserver&&new MutationObserver(y).observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}));else try{s.requestIdleCallback(function(){},{timeout:0})}catch{(function(N){var j,I;if(s.requestIdleCallback=function(P,$){return $&&typeof $.timeout=="number"?N(P,$.timeout):N(P)},s.IdleCallbackDeadline&&(j=IdleCallbackDeadline.prototype)){if(I=Object.getOwnPropertyDescriptor(j,"timeRemaining"),!I||!I.configurable||!I.get)return;Object.defineProperty(j,"timeRemaining",{value:function(){return I.get.call(this)},enumerable:!0,configurable:!0})}})(s.requestIdleCallback)}return{request:T,cancel:E}})}(MS)),MS.exports}QSe();function JSe(){return typeof window>"u"?e=>{setTimeout(()=>e(Date.now()),0)}:window.requestIdleCallback}const UH=JSe(),UN=()=>{const e=new Map;let t=!1;const n=c=>{for(const[l,u]of e)if(e.delete(l),u(),typeof c=="number"||c.timeRemaining()<=0)break;if(e.size===0){t=!1;return}UH(n)};return{add:(c,l)=>{e.set(c,l),t||(t=!0,UH(n))},flush:c=>{const l=e.get(c);return l===void 0?!1:(e.delete(c),l(),!0)},cancel:c=>e.delete(c),reset:()=>{e.clear(),t=!1}}};function eCe(e,t){const n=[];for(let o=0;o{let s=eCe(e,o);s.length{hs.flushSync(()=>{r(l=>[...l,...e.slice(c,c+n)])})});return()=>i.reset()},[e]),o}function tCe(e,t){if(e.length!==t.length)return!1;for(var n=0;nF1(e,t??0,n),[e,t,n]);return x.useEffect(()=>()=>o.cancel(),[o]),o}function w0e(e=""){const[t,n]=x.useState(e),[o,r]=x.useState(e),s=q1(r,250);return x.useEffect(()=>{s(t)},[t,s]),[t,n,o]}function vE(e,t,n){const o=x0e(()=>BN(e,t??0,n),[e,t,n]);return x.useEffect(()=>()=>o.cancel(),[o]),o}function q5({dropZoneElement:e,isDisabled:t,onDrop:n,onDragStart:o,onDragEnter:r,onDragLeave:s,onDragEnd:i,onDragOver:c}){const l=Ts(n),u=Ts(o),d=Ts(r),p=Ts(s),f=Ts(i),b=Ts(c);return Mn(h=>{if(t)return;const g=e??h;let z=!1;const{ownerDocument:A}=g;function _(R){const{defaultView:T}=A;if(!R||!T||!(R instanceof T.HTMLElement)||!g.contains(R))return!1;let E=R;do if(E.dataset.isDropZone)return E===g;while(E=E.parentElement);return!1}function v(R){z||(z=!0,A.addEventListener("dragend",C),A.addEventListener("mousemove",C),o&&u(R))}function M(R){R.preventDefault(),!g.contains(R.relatedTarget)&&r&&d(R)}function y(R){!R.defaultPrevented&&c&&b(R),R.preventDefault()}function k(R){_(R.relatedTarget)||s&&p(R)}function S(R){R.defaultPrevented||(R.preventDefault(),R.dataTransfer&&R.dataTransfer.files.length,n&&l(R),C(R))}function C(R){z&&(z=!1,A.removeEventListener("dragend",C),A.removeEventListener("mousemove",C),i&&f(R))}return g.setAttribute("data-is-drop-zone","true"),g.addEventListener("drop",S),g.addEventListener("dragenter",M),g.addEventListener("dragover",y),g.addEventListener("dragleave",k),A.addEventListener("dragenter",v),()=>{g.removeAttribute("data-is-drop-zone"),g.removeEventListener("drop",S),g.removeEventListener("dragenter",M),g.removeEventListener("dragover",y),g.removeEventListener("dragleave",k),A.removeEventListener("dragend",C),A.removeEventListener("mousemove",C),A.removeEventListener("dragenter",v)}},[t,e])}function _0e(){return Mn(e=>{const{ownerDocument:t}=e;if(!t)return;const{defaultView:n}=t;if(!n)return;function o(){t&&t.activeElement===e&&e.focus()}return n.addEventListener("blur",o),()=>{n.removeEventListener("blur",o)}},[])}const nCe=30;function oCe(e,t,n,o){var r,s;const i=(r=o?.initWindowSize)!==null&&r!==void 0?r:nCe,c=(s=o?.useWindowing)!==null&&s!==void 0?s:!0,[l,u]=x.useState({visibleItems:i,start:0,end:i,itemInView:d=>d>=0&&d<=i});return x.useLayoutEffect(()=>{if(!c)return;const d=ps(e.current),p=b=>{var h;if(!d)return;const g=Math.ceil(d.clientHeight/t),z=b?g:(h=o?.windowOverscan)!==null&&h!==void 0?h:g,A=Math.floor(d.scrollTop/t),_=Math.max(0,A-z),v=Math.min(n-1,A+g+z);u(M=>{const y={visibleItems:g,start:_,end:v,itemInView:k=>_<=k&&k<=v};return M.start!==y.start||M.end!==y.end||M.visibleItems!==y.visibleItems?y:M})};p(!0);const f=F1(()=>{p()},16);return d?.addEventListener("scroll",f),d?.ownerDocument?.defaultView?.addEventListener("resize",f),d?.ownerDocument?.defaultView?.addEventListener("resize",f),()=>{d?.removeEventListener("scroll",f),d?.ownerDocument?.defaultView?.removeEventListener("resize",f)}},[t,e,n,o?.expandedState,o?.windowOverscan,c]),x.useLayoutEffect(()=>{if(!c)return;const d=ps(e.current),p=f=>{switch(f.keyCode){case S2:return d?.scrollTo({top:0});case FM:return d?.scrollTo({top:n*t});case NSe:return d?.scrollTo({top:d.scrollTop-l.visibleItems*t});case BSe:return d?.scrollTo({top:d.scrollTop+l.visibleItems*t})}};return d?.ownerDocument?.defaultView?.addEventListener("keydown",p),()=>{d?.ownerDocument?.defaultView?.removeEventListener("keydown",p)}},[n,t,e,l.visibleItems,c,o?.expandedState]),[l,u]}function $M(e,t){const[n,o]=x.useMemo(()=>[r=>e.subscribe(t,r),()=>e.get(t)],[e,t]);return x.useSyncExternalStore(n,o,o)}function k0e(e){const t=Object.keys(e);return function(o={},r){const s={};let i=!1;for(const c of t){const l=e[c],u=o[c],d=l(u,r);s[c]=d,i=i||d!==u}return i?s:o}}function At(e){const t=new WeakMap,n=(...o)=>{let r=t.get(n.registry);return r||(r=e(n.registry.select),t.set(n.registry,r)),r(...o)};return n.isRegistrySelector=!0,n}function zS(e){return e.isRegistryControl=!0,e}const rCe="@@data/SELECT",sCe="@@data/RESOLVE_SELECT",iCe="@@data/DISPATCH",aCe={[rCe]:zS(e=>({storeKey:t,selectorName:n,args:o})=>e.select(t)[n](...o)),[sCe]:zS(e=>({storeKey:t,selectorName:n,args:o})=>{const r=e.select(t)[n].hasResolver?"resolveSelect":"select";return e[r](t)[n](...o)}),[iCe]:zS(e=>({storeKey:t,actionName:n,args:o})=>e.dispatch(t)[n](...o))},cCe=["@wordpress/block-directory","@wordpress/block-editor","@wordpress/block-library","@wordpress/blocks","@wordpress/commands","@wordpress/components","@wordpress/core-commands","@wordpress/core-data","@wordpress/customize-widgets","@wordpress/data","@wordpress/edit-post","@wordpress/edit-site","@wordpress/edit-widgets","@wordpress/editor","@wordpress/format-library","@wordpress/patterns","@wordpress/preferences","@wordpress/reusable-blocks","@wordpress/router","@wordpress/dataviews","@wordpress/fields","@wordpress/media-utils","@wordpress/upload-media"],XH=[],lCe=!globalThis.IS_WORDPRESS_CORE,P0=(e,t)=>{if(!cCe.includes(t))throw new Error(`You tried to opt-in to unstable APIs as module "${t}". This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will be removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on one of the next WordPress releases.`);if(!lCe&&XH.includes(t))throw new Error(`You tried to opt-in to unstable APIs as module "${t}" which is already registered. This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will be removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on one of the next WordPress releases.`);return XH.push(t),{lock:uCe,unlock:dCe}};function uCe(e,t){if(!e)throw new Error("Cannot lock an undefined object.");const n=e;MM in n||(n[MM]={}),S0e.set(n[MM],t)}function dCe(e){if(!e)throw new Error("Cannot unlock an undefined object.");const t=e;if(!(MM in t))throw new Error("Cannot unlock an object that was not locked before. ");return S0e.get(t[MM])}const S0e=new WeakMap,MM=Symbol("Private API ID"),{lock:Zg,unlock:Db}=P0("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/data"),pCe=()=>e=>t=>t0e(t)?t.then(n=>{if(n)return e(n)}):e(t),fCe=(e,t)=>()=>n=>o=>{const r=e.select(t).getCachedResolvers();return Object.entries(r).forEach(([i,c])=>{const l=e.stores[t]?.resolvers?.[i];!l||!l.shouldInvalidate||c.forEach((u,d)=>{u!==void 0&&(u.status!=="finished"&&u.status!=="error"||l.shouldInvalidate(o,...d)&&e.dispatch(t).invalidateResolution(i,d))})}),n(o)};function bCe(e){return()=>t=>n=>typeof n=="function"?n(e):t(n)}const hCe=e=>t=>(n={},o)=>{const r=o[e];if(r===void 0)return n;const s=t(n[r],o);return s===n[r]?n:{...n,[r]:s}};function Lu(e){if(e==null)return[];const t=e.length;let n=t;for(;n>0&&e[n-1]===void 0;)n--;return n===t?e:e.slice(0,n)}const mCe=hCe("selectorName")((e=new Va,t)=>{switch(t.type){case"START_RESOLUTION":{const n=new Va(e);return n.set(Lu(t.args),{status:"resolving"}),n}case"FINISH_RESOLUTION":{const n=new Va(e);return n.set(Lu(t.args),{status:"finished"}),n}case"FAIL_RESOLUTION":{const n=new Va(e);return n.set(Lu(t.args),{status:"error",error:t.error}),n}case"START_RESOLUTIONS":{const n=new Va(e);for(const o of t.args)n.set(Lu(o),{status:"resolving"});return n}case"FINISH_RESOLUTIONS":{const n=new Va(e);for(const o of t.args)n.set(Lu(o),{status:"finished"});return n}case"FAIL_RESOLUTIONS":{const n=new Va(e);return t.args.forEach((o,r)=>{const s={status:"error",error:void 0},i=t.errors[r];i&&(s.error=i),n.set(Lu(o),s)}),n}case"INVALIDATE_RESOLUTION":{const n=new Va(e);return n.delete(Lu(t.args)),n}}return e}),gCe=(e={},t)=>{switch(t.type){case"INVALIDATE_RESOLUTION_FOR_STORE":return{};case"INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR":{if(t.selectorName in e){const{[t.selectorName]:n,...o}=e;return o}return e}case"START_RESOLUTION":case"FINISH_RESOLUTION":case"FAIL_RESOLUTION":case"START_RESOLUTIONS":case"FINISH_RESOLUTIONS":case"FAIL_RESOLUTIONS":case"INVALIDATE_RESOLUTION":return mCe(e,t)}return e};var OS={};function MCe(e){return[e]}function zCe(e){return!!e&&typeof e=="object"}function OCe(){var e={clear:function(){e.head=null}};return e}function GH(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;oArray.from(t._map.values()).some(n=>n[1]?.status==="resolving"))}const SCe=It(e=>{const t={};return Object.values(e).forEach(n=>Array.from(n._map.values()).forEach(o=>{var r;const s=(r=o[1]?.status)!==null&&r!==void 0?r:"error";t[s]||(t[s]=0),t[s]++})),t},e=>[e]),CCe=Object.freeze(Object.defineProperty({__proto__:null,countSelectorsByStatus:SCe,getCachedResolvers:_Ce,getIsResolving:yCe,getResolutionError:xCe,getResolutionState:Df,hasFinishedResolution:ACe,hasResolutionFailed:vCe,hasResolvingSelectors:kCe,hasStartedResolution:C0e,isResolving:wCe},Symbol.toStringTag,{value:"Module"}));function q0e(e,t){return{type:"START_RESOLUTION",selectorName:e,args:t}}function R0e(e,t){return{type:"FINISH_RESOLUTION",selectorName:e,args:t}}function T0e(e,t,n){return{type:"FAIL_RESOLUTION",selectorName:e,args:t,error:n}}function qCe(e,t){return{type:"START_RESOLUTIONS",selectorName:e,args:t}}function RCe(e,t){return{type:"FINISH_RESOLUTIONS",selectorName:e,args:t}}function TCe(e,t,n){return{type:"FAIL_RESOLUTIONS",selectorName:e,args:t,errors:n}}function ECe(e,t){return{type:"INVALIDATE_RESOLUTION",selectorName:e,args:t}}function WCe(){return{type:"INVALIDATE_RESOLUTION_FOR_STORE"}}function NCe(e){return{type:"INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR",selectorName:e}}const BCe=Object.freeze(Object.defineProperty({__proto__:null,failResolution:T0e,failResolutions:TCe,finishResolution:R0e,finishResolutions:RCe,invalidateResolution:ECe,invalidateResolutionForStore:WCe,invalidateResolutionForStoreSelector:NCe,startResolution:q0e,startResolutions:qCe},Symbol.toStringTag,{value:"Module"})),yS=e=>{const t=[...e];for(let n=t.length-1;n>=0;n--)t[n]===void 0&&t.splice(n,1);return t},Yu=(e,t)=>Object.fromEntries(Object.entries(e??{}).map(([n,o])=>[n,t(o,n)])),LCe=(e,t)=>t instanceof Map?Object.fromEntries(t):t instanceof window.HTMLElement?null:t;function PCe(){const e={};return{isRunning(t,n){return e[t]&&e[t].get(yS(n))},clear(t,n){e[t]&&e[t].delete(yS(n))},markAsRunning(t,n){e[t]||(e[t]=new Va),e[t].set(yS(n),!0)}}}function KH(e){const t=new WeakMap;return{get(n,o){let r=t.get(n);return r||(r=e(n,o),t.set(n,r)),r}}}function w1(e,t){const n={},o={},r={privateActions:n,registerPrivateActions:i=>{Object.assign(n,i)},privateSelectors:o,registerPrivateSelectors:i=>{Object.assign(o,i)}},s={name:e,instantiate:i=>{const c=new Set,l=t.reducer,d=jCe(e,t,i,{registry:i,get dispatch(){return z},get select(){return S},get resolveSelect(){return B()}});Zg(d,r);const p=PCe();function f(P){return(...$)=>Promise.resolve(d.dispatch(P(...$)))}const b={...Yu(BCe,f),...Yu(t.actions,f)},h=KH(f),g=new Proxy(()=>{},{get:(P,$)=>{const F=n[$];return F?h.get(F,$):b[$]}}),z=new Proxy(g,{apply:(P,$,[F])=>d.dispatch(F)});Zg(b,g);const A=t.resolvers?FCe(t.resolvers):{};function _(P,$){P.isRegistrySelector&&(P.registry=i);const F=(...Z)=>{Z=xE(P,Z);const V=d.__unstableOriginalGetState();return P.isRegistrySelector&&(P.registry=i),P(V.root,...Z)};F.__unstableNormalizeArgs=P.__unstableNormalizeArgs;const X=A[$];return X?$Ce(F,$,X,d,p):(F.hasResolver=!1,F)}function v(P){const $=(...F)=>{const X=d.__unstableOriginalGetState(),Z=F&&F[0],V=F&&F[1],Q=t?.selectors?.[Z];return Z&&Q&&(F[1]=xE(Q,V)),P(X.metadata,...F)};return $.hasResolver=!1,$}const M={...Yu(CCe,v),...Yu(t.selectors,_)},y=KH(_);for(const[P,$]of Object.entries(o))y.get($,P);const k=new Proxy(()=>{},{get:(P,$)=>{const F=o[$];return F?y.get(F,$):M[$]}}),S=new Proxy(k,{apply:(P,$,[F])=>F(d.__unstableOriginalGetState())});Zg(M,k);const C=ICe(M,d),R=DCe(M,d),T=()=>M,E=()=>b,B=()=>C,N=()=>R;d.__unstableOriginalGetState=d.getState,d.getState=()=>d.__unstableOriginalGetState().root;const j=d&&(P=>(c.add(P),()=>c.delete(P)));let I=d.__unstableOriginalGetState();return d.subscribe(()=>{const P=d.__unstableOriginalGetState(),$=P!==I;if(I=P,$)for(const F of c)F()}),{reducer:l,store:d,actions:b,selectors:M,resolvers:A,getSelectors:T,getResolveSelectors:B,getSuspendSelectors:N,getActions:E,subscribe:j}}};return Zg(s,r),s}function jCe(e,t,n,o){const r={...t.controls,...aCe},s=Yu(r,p=>p.isRegistryControl?p(n):p),i=[fCe(n,e),pCe,J6e(s),bCe(o)],c=[I6e(...i)];typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__&&c.push(window.__REDUX_DEVTOOLS_EXTENSION__({name:e,instanceId:e,serialize:{replacer:LCe}}));const{reducer:l,initialState:u}=t,d=k0e({metadata:gCe,root:l});return Qre(d,{root:u},Co(c))}function ICe(e,t){const{getIsResolving:n,hasStartedResolution:o,hasFinishedResolution:r,hasResolutionFailed:s,isResolving:i,getCachedResolvers:c,getResolutionState:l,getResolutionError:u,hasResolvingSelectors:d,countSelectorsByStatus:p,...f}=e;return Yu(f,(b,h)=>b.hasResolver?(...g)=>new Promise((z,A)=>{const _=()=>e.hasFinishedResolution(h,g),v=S=>{if(e.hasResolutionFailed(h,g)){const R=e.getResolutionError(h,g);A(R)}else z(S)},M=()=>b.apply(null,g),y=M();if(_())return v(y);const k=t.subscribe(()=>{_()&&(k(),v(M()))})}):async(...g)=>b.apply(null,g))}function DCe(e,t){return Yu(e,(n,o)=>n.hasResolver?(...r)=>{const s=n.apply(null,r);if(e.hasFinishedResolution(o,r)){if(e.hasResolutionFailed(o,r))throw e.getResolutionError(o,r);return s}throw new Promise(i=>{const c=t.subscribe(()=>{e.hasFinishedResolution(o,r)&&(i(),c())})})}:n)}function FCe(e){return Yu(e,t=>t.fulfill?t:{...t,fulfill:t})}function $Ce(e,t,n,o,r){function s(c){const l=o.getState();if(r.isRunning(t,c)||typeof n.isFulfilled=="function"&&n.isFulfilled(l,...c))return;const{metadata:u}=o.__unstableOriginalGetState();C0e(u,t,c)||(r.markAsRunning(t,c),setTimeout(async()=>{r.clear(t,c),o.dispatch(q0e(t,c));try{const d=n.fulfill(...c);d&&await o.dispatch(d),o.dispatch(R0e(t,c))}catch(d){o.dispatch(T0e(t,c,d))}},0))}const i=(...c)=>(c=xE(e,c),s(c),e(...c));return i.hasResolver=!0,i}function xE(e,t){return e.__unstableNormalizeArgs&&typeof e.__unstableNormalizeArgs=="function"&&t?.length?e.__unstableNormalizeArgs(t):t}const VCe={name:"core/data",instantiate(e){const t=o=>(r,...s)=>e.select(r)[o](...s),n=o=>(r,...s)=>e.dispatch(r)[o](...s);return{getSelectors(){return Object.fromEntries(["getIsResolving","hasStartedResolution","hasFinishedResolution","isResolving","getCachedResolvers"].map(o=>[o,t(o)]))},getActions(){return Object.fromEntries(["startResolution","finishResolution","invalidateResolution","invalidateResolutionForStore","invalidateResolutionForStoreSelector"].map(o=>[o,n(o)]))},subscribe(){return()=>()=>{}}}}};function YH(){let e=!1,t=!1;const n=new Set,o=()=>Array.from(n).forEach(r=>r());return{get isPaused(){return e},subscribe(r){return n.add(r),()=>n.delete(r)},pause(){e=!0},resume(){e=!1,t&&(t=!1,o())},emit(){if(e){t=!0;return}o()}}}function vg(e){return typeof e=="string"?e:e.name}function R5(e={},t=null){const n={},o=YH();let r=null;function s(){o.emit()}const i=(y,k)=>{if(!k)return o.subscribe(y);const S=vg(k),C=n[S];return C?C.subscribe(y):t?t.subscribe(y,k):o.subscribe(y)};function c(y){const k=vg(y);r?.add(k);const S=n[k];return S?S.getSelectors():t?.select(k)}function l(y,k){r=new Set;try{return y.call(this)}finally{k.current=Array.from(r),r=null}}function u(y){const k=vg(y);r?.add(k);const S=n[k];return S?S.getResolveSelectors():t&&t.resolveSelect(k)}function d(y){const k=vg(y);r?.add(k);const S=n[k];return S?S.getSuspendSelectors():t&&t.suspendSelect(k)}function p(y){const k=vg(y),S=n[k];return S?S.getActions():t&&t.dispatch(k)}function f(y){return Object.fromEntries(Object.entries(y).map(([k,S])=>typeof S!="function"?[k,S]:[k,function(){return _[k].apply(null,arguments)}]))}function b(y,k){if(n[y])return console.error('Store "'+y+'" is already registered.'),n[y];const S=k();if(typeof S.getSelectors!="function")throw new TypeError("store.getSelectors must be a function");if(typeof S.getActions!="function")throw new TypeError("store.getActions must be a function");if(typeof S.subscribe!="function")throw new TypeError("store.subscribe must be a function");S.emitter=YH();const C=S.subscribe;if(S.subscribe=R=>{const T=S.emitter.subscribe(R),E=C(()=>{if(S.emitter.isPaused){S.emitter.emit();return}R()});return()=>{E?.(),T?.()}},n[y]=S,S.subscribe(s),t)try{Db(S.store).registerPrivateActions(Db(t).privateActionsOf(y)),Db(S.store).registerPrivateSelectors(Db(t).privateSelectorsOf(y))}catch{}return S}function h(y){b(y.name,()=>y.instantiate(_))}function g(y,k){Ke("wp.data.registerGenericStore",{since:"5.9",alternative:"wp.data.register( storeDescriptor )"}),b(y,()=>k)}function z(y,k){if(!k.reducer)throw new TypeError("Must specify store reducer");return b(y,()=>w1(y,k).instantiate(_)).store}function A(y){if(o.isPaused){y();return}o.pause(),Object.values(n).forEach(k=>k.emitter.pause());try{y()}finally{o.resume(),Object.values(n).forEach(k=>k.emitter.resume())}}let _={batch:A,stores:n,namespaces:n,subscribe:i,select:c,resolveSelect:u,suspendSelect:d,dispatch:p,use:v,register:h,registerGenericStore:g,registerStore:z,__unstableMarkListeningStores:l};function v(y,k){if(y)return _={..._,...y(_,k)},_}_.register(VCe);for(const[y,k]of Object.entries(e))_.register(w1(y,k));t&&t.subscribe(s);const M=f(_);return Zg(M,{privateActionsOf:y=>{try{return Db(n[y].store).privateActions}catch{return{}}},privateSelectorsOf:y=>{try{return Db(n[y].store).privateSelectors}catch{return{}}}}),M}const qc=R5();var AS,ZH;function HCe(){if(ZH)return AS;ZH=1;var e=function(_){return t(_)&&!n(_)};function t(A){return!!A&&typeof A=="object"}function n(A){var _=Object.prototype.toString.call(A);return _==="[object RegExp]"||_==="[object Date]"||s(A)}var o=typeof Symbol=="function"&&Symbol.for,r=o?Symbol.for("react.element"):60103;function s(A){return A.$$typeof===r}function i(A){return Array.isArray(A)?[]:{}}function c(A,_){return _.clone!==!1&&_.isMergeableObject(A)?g(i(A),A,_):A}function l(A,_,v){return A.concat(_).map(function(M){return c(M,v)})}function u(A,_){if(!_.customMerge)return g;var v=_.customMerge(A);return typeof v=="function"?v:g}function d(A){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(A).filter(function(_){return Object.propertyIsEnumerable.call(A,_)}):[]}function p(A){return Object.keys(A).concat(d(A))}function f(A,_){try{return _ in A}catch{return!1}}function b(A,_){return f(A,_)&&!(Object.hasOwnProperty.call(A,_)&&Object.propertyIsEnumerable.call(A,_))}function h(A,_,v){var M={};return v.isMergeableObject(A)&&p(A).forEach(function(y){M[y]=c(A[y],v)}),p(_).forEach(function(y){b(A,y)||(f(A,y)&&v.isMergeableObject(_[y])?M[y]=u(y,v)(A[y],_[y],v):M[y]=c(_[y],v))}),M}function g(A,_,v){v=v||{},v.arrayMerge=v.arrayMerge||l,v.isMergeableObject=v.isMergeableObject||e,v.cloneUnlessOtherwiseSpecified=c;var M=Array.isArray(_),y=Array.isArray(A),k=M===y;return k?M?v.arrayMerge(A,_,v):h(A,_,v):c(_,v)}g.all=function(_,v){if(!Array.isArray(_))throw new Error("first argument should be an array");return _.reduce(function(M,y){return g(M,y,v)},{})};var z=g;return AS=z,AS}var UCe=HCe();const E0e=Zr(UCe),W0e=x.createContext(qc),{Consumer:Nmn,Provider:XN}=W0e;function Fn(){return x.useContext(W0e)}const N0e=x.createContext(!1),{Consumer:Bmn,Provider:T5}=N0e;function XCe(){return x.useContext(N0e)}const vS=UN();function GCe(e,t){if(!e||!t)return;const n=typeof e=="object"&&typeof t=="object"?Object.keys(e).filter(o=>e[o]!==t[o]):[];console.warn(`The \`useSelect\` hook returns different values when called with the same state and parameters. + */var D6e=Wv.exports,qH;function F6e(){return qH||(qH=1,function(e,t){(function(o,r){e.exports=r()})(D6e,function(){return function(){var n={686:function(s,i,c){c.d(i,{default:function(){return V}});var l=c(279),u=c.n(l),d=c(370),p=c.n(d),f=c(817),b=c.n(f);function h(Q){try{return document.execCommand(Q)}catch{return!1}}var g=function(te){var ee=b()(te);return h("cut"),ee},z=g;function A(Q){var te=document.documentElement.getAttribute("dir")==="rtl",ee=document.createElement("textarea");ee.style.fontSize="12pt",ee.style.border="0",ee.style.padding="0",ee.style.margin="0",ee.style.position="absolute",ee.style[te?"right":"left"]="-9999px";var ue=window.pageYOffset||document.documentElement.scrollTop;return ee.style.top="".concat(ue,"px"),ee.setAttribute("readonly",""),ee.value=Q,ee}var _=function(te,ee){var ue=A(te);ee.container.appendChild(ue);var ce=b()(ue);return h("copy"),ue.remove(),ce},v=function(te){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},ue="";return typeof te=="string"?ue=_(te,ee):te instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(te?.type)?ue=_(te.value,ee):(ue=b()(te),h("copy")),ue},M=v;function y(Q){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?y=function(ee){return typeof ee}:y=function(ee){return ee&&typeof Symbol=="function"&&ee.constructor===Symbol&&ee!==Symbol.prototype?"symbol":typeof ee},y(Q)}var k=function(){var te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ee=te.action,ue=ee===void 0?"copy":ee,ce=te.container,me=te.target,de=te.text;if(ue!=="copy"&&ue!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(me!==void 0)if(me&&y(me)==="object"&&me.nodeType===1){if(ue==="copy"&&me.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(ue==="cut"&&(me.hasAttribute("readonly")||me.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(de)return M(de,{container:ce});if(me)return ue==="cut"?z(me):M(me,{container:ce})},S=k;function C(Q){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?C=function(ee){return typeof ee}:C=function(ee){return ee&&typeof Symbol=="function"&&ee.constructor===Symbol&&ee!==Symbol.prototype?"symbol":typeof ee},C(Q)}function R(Q,te){if(!(Q instanceof te))throw new TypeError("Cannot call a class as a function")}function T(Q,te){for(var ee=0;ee"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function F(Q){return F=Object.setPrototypeOf?Object.getPrototypeOf:function(ee){return ee.__proto__||Object.getPrototypeOf(ee)},F(Q)}function X(Q,te){var ee="data-clipboard-".concat(Q);if(te.hasAttribute(ee))return te.getAttribute(ee)}var Z=function(Q){B(ee,Q);var te=j(ee);function ee(ue,ce){var me;return R(this,ee),me=te.call(this),me.resolveOptions(ce),me.listenClick(ue),me}return E(ee,[{key:"resolveOptions",value:function(){var ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof ce.action=="function"?ce.action:this.defaultAction,this.target=typeof ce.target=="function"?ce.target:this.defaultTarget,this.text=typeof ce.text=="function"?ce.text:this.defaultText,this.container=C(ce.container)==="object"?ce.container:document.body}},{key:"listenClick",value:function(ce){var me=this;this.listener=p()(ce,"click",function(de){return me.onClick(de)})}},{key:"onClick",value:function(ce){var me=ce.delegateTarget||ce.currentTarget,de=this.action(me)||"copy",Ae=S({action:de,container:this.container,target:this.target(me),text:this.text(me)});this.emit(Ae?"success":"error",{action:de,text:Ae,trigger:me,clearSelection:function(){me&&me.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(ce){return X("action",ce)}},{key:"defaultTarget",value:function(ce){var me=X("target",ce);if(me)return document.querySelector(me)}},{key:"defaultText",value:function(ce){return X("text",ce)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(ce){var me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return M(ce,me)}},{key:"cut",value:function(ce){return z(ce)}},{key:"isSupported",value:function(){var ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],me=typeof ce=="string"?[ce]:ce,de=!!document.queryCommandSupported;return me.forEach(function(Ae){de=de&&!!document.queryCommandSupported(Ae)}),de}}]),ee}(u()),V=Z},828:function(s){var i=9;if(typeof Element<"u"&&!Element.prototype.matches){var c=Element.prototype;c.matches=c.matchesSelector||c.mozMatchesSelector||c.msMatchesSelector||c.oMatchesSelector||c.webkitMatchesSelector}function l(u,d){for(;u&&u.nodeType!==i;){if(typeof u.matches=="function"&&u.matches(d))return u;u=u.parentNode}}s.exports=l},438:function(s,i,c){var l=c(828);function u(f,b,h,g,z){var A=p.apply(this,arguments);return f.addEventListener(h,A,z),{destroy:function(){f.removeEventListener(h,A,z)}}}function d(f,b,h,g,z){return typeof f.addEventListener=="function"?u.apply(null,arguments):typeof h=="function"?u.bind(null,document).apply(null,arguments):(typeof f=="string"&&(f=document.querySelectorAll(f)),Array.prototype.map.call(f,function(A){return u(A,b,h,g,z)}))}function p(f,b,h,g){return function(z){z.delegateTarget=l(z.target,b),z.delegateTarget&&g.call(f,z)}}s.exports=d},879:function(s,i){i.node=function(c){return c!==void 0&&c instanceof HTMLElement&&c.nodeType===1},i.nodeList=function(c){var l=Object.prototype.toString.call(c);return c!==void 0&&(l==="[object NodeList]"||l==="[object HTMLCollection]")&&"length"in c&&(c.length===0||i.node(c[0]))},i.string=function(c){return typeof c=="string"||c instanceof String},i.fn=function(c){var l=Object.prototype.toString.call(c);return l==="[object Function]"}},370:function(s,i,c){var l=c(879),u=c(438);function d(h,g,z){if(!h&&!g&&!z)throw new Error("Missing required arguments");if(!l.string(g))throw new TypeError("Second argument must be a String");if(!l.fn(z))throw new TypeError("Third argument must be a Function");if(l.node(h))return p(h,g,z);if(l.nodeList(h))return f(h,g,z);if(l.string(h))return b(h,g,z);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function p(h,g,z){return h.addEventListener(g,z),{destroy:function(){h.removeEventListener(g,z)}}}function f(h,g,z){return Array.prototype.forEach.call(h,function(A){A.addEventListener(g,z)}),{destroy:function(){Array.prototype.forEach.call(h,function(A){A.removeEventListener(g,z)})}}}function b(h,g,z){return u(document.body,h,g,z)}s.exports=d},817:function(s){function i(c){var l;if(c.nodeName==="SELECT")c.focus(),l=c.value;else if(c.nodeName==="INPUT"||c.nodeName==="TEXTAREA"){var u=c.hasAttribute("readonly");u||c.setAttribute("readonly",""),c.select(),c.setSelectionRange(0,c.value.length),u||c.removeAttribute("readonly"),l=c.value}else{c.hasAttribute("contenteditable")&&c.focus();var d=window.getSelection(),p=document.createRange();p.selectNodeContents(c),d.removeAllRanges(),d.addRange(p),l=d.toString()}return l}s.exports=i},279:function(s){function i(){}i.prototype={on:function(c,l,u){var d=this.e||(this.e={});return(d[c]||(d[c]=[])).push({fn:l,ctx:u}),this},once:function(c,l,u){var d=this;function p(){d.off(c,p),l.apply(u,arguments)}return p._=l,this.on(c,p,u)},emit:function(c){var l=[].slice.call(arguments,1),u=((this.e||(this.e={}))[c]||[]).slice(),d=0,p=u.length;for(d;d{t.current=e},[e]),t}function Hl(e,t){const n=RH(e),o=RH(t);return Mn(r=>{const s=new V6e(r,{text(){return typeof n.current=="function"?n.current():n.current||""}});return s.on("success",({clearSelection:i})=>{i(),o.current&&o.current()}),()=>{s.destroy()}},[])}function Hs(e,t){var n=0,o,r;t=t||{};function s(){var i=o,c=arguments.length,l,u;e:for(;i;){if(i.args.length!==arguments.length){i=i.next;continue}for(u=0;u=0),g.type){case"b":p=parseInt(p,10).toString(2);break;case"c":p=String.fromCharCode(parseInt(p,10));break;case"d":case"i":p=parseInt(p,10);break;case"j":p=JSON.stringify(p,null,g.width?parseInt(g.width):0);break;case"e":p=g.precision?parseFloat(p).toExponential(g.precision):parseFloat(p).toExponential();break;case"f":p=g.precision?parseFloat(p).toFixed(g.precision):parseFloat(p);break;case"g":p=g.precision?String(Number(p.toPrecision(g.precision))):parseFloat(p);break;case"o":p=(parseInt(p,10)>>>0).toString(8);break;case"s":p=String(p),p=g.precision?p.substring(0,g.precision):p;break;case"t":p=String(!!p),p=g.precision?p.substring(0,g.precision):p;break;case"T":p=Object.prototype.toString.call(p).slice(8,-1).toLowerCase(),p=g.precision?p.substring(0,g.precision):p;break;case"u":p=parseInt(p,10)>>>0;break;case"v":p=p.valueOf(),p=g.precision?p.substring(0,g.precision):p;break;case"x":p=(parseInt(p,10)>>>0).toString(16);break;case"X":p=(parseInt(p,10)>>>0).toString(16).toUpperCase();break}t.json.test(g.type)?f+=p:(t.number.test(g.type)&&(!v||g.sign)?(M=v?"+":"-",p=p.toString().replace(t.sign,"")):M="",A=g.pad_char?g.pad_char==="0"?"0":g.pad_char.charAt(1):" ",_=g.width-(M+p).length,z=g.width&&_>0?A.repeat(_):"",f+=g.align?M+p+z:A==="0"?M+z+p:z+M+p)}return f}var s=Object.create(null);function i(c){if(s[c])return s[c];for(var l=c,u,d=[],p=0;l;){if((u=t.text.exec(l))!==null)d.push(u[0]);else if((u=t.modulo.exec(l))!==null)d.push("%");else if((u=t.placeholder.exec(l))!==null){if(u[2]){p|=1;var f=[],b=u[2],h=[];if((h=t.key.exec(b))!==null)for(f.push(h[1]);(b=b.substring(h[0].length))!=="";)if((h=t.key_access.exec(b))!==null)f.push(h[1]);else if((h=t.index_access.exec(b))!==null)f.push(h[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");u[2]=f}else p|=2;if(p===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");d.push({placeholder:u[0],param_no:u[1],keys:u[2],sign:u[3],pad_char:u[4],align:u[5],width:u[6],precision:u[7],type:u[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");l=l.substring(u[0].length)}return s[c]=d}e.sprintf=n,e.vsprintf=o,typeof window<"u"&&(window.sprintf=n,window.vsprintf=o)})()}(gS)),gS}var U6e=H6e();const X6e=Zr(U6e),G6e=Hs(console.error);function xe(e,...t){try{return X6e.sprintf(e,...t)}catch(n){return n instanceof Error&&G6e(`sprintf error: + +`+n.toString()),e}}var OE,a0e,Yg,c0e;OE={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1};a0e=["(","?"];Yg={")":["("],":":["?","?:"]};c0e=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;function K6e(e){for(var t=[],n=[],o,r,s,i;o=e.match(c0e);){for(r=o[0],s=e.substr(0,o.index).trim(),s&&t.push(s);i=n.pop();){if(Yg[r]){if(Yg[r][0]===i){r=Yg[r][1]||r;break}}else if(a0e.indexOf(i)>=0||OE[i]":function(e,t){return e>t},">=":function(e,t){return e>=t},"==":function(e,t){return e===t},"!=":function(e,t){return e!==t},"&&":function(e,t){return e&&t},"||":function(e,t){return e||t},"?:":function(e,t,n){if(e)throw t;return n}};function Z6e(e,t){var n=[],o,r,s,i,c,l;for(o=0;o{const o=new BN({}),r=new Set,s=()=>{r.forEach(M=>M())},i=M=>(r.add(M),()=>r.delete(M)),c=(M="default")=>o.data[M],l=(M,y="default")=>{o.data[y]={...o.data[y],...M},o.data[y][""]={...WH[""],...o.data[y]?.[""]},delete o.pluralForms[y]},u=(M,y)=>{l(M,y),s()},d=(M,y="default")=>{o.data[y]={...o.data[y],...M,"":{...WH[""],...o.data[y]?.[""],...M?.[""]}},delete o.pluralForms[y],s()},p=(M,y)=>{o.data={},o.pluralForms={},u(M,y)},f=(M="default",y,k,S,C)=>(o.data[M]||l(void 0,M),o.dcnpgettext(M,y,k,S,C)),b=(M="default")=>M,h=(M,y)=>{let k=f(y,void 0,M);return n?(k=n.applyFilters("i18n.gettext",k,M,y),n.applyFilters("i18n.gettext_"+b(y),k,M,y)):k},g=(M,y,k)=>{let S=f(k,y,M);return n?(S=n.applyFilters("i18n.gettext_with_context",S,M,y,k),n.applyFilters("i18n.gettext_with_context_"+b(k),S,M,y,k)):S},z=(M,y,k,S)=>{let C=f(S,void 0,M,y,k);return n?(C=n.applyFilters("i18n.ngettext",C,M,y,k,S),n.applyFilters("i18n.ngettext_"+b(S),C,M,y,k,S)):C},A=(M,y,k,S,C)=>{let R=f(C,S,M,y,k);return n?(R=n.applyFilters("i18n.ngettext_with_context",R,M,y,k,S,C),n.applyFilters("i18n.ngettext_with_context_"+b(C),R,M,y,k,S,C)):R},_=()=>g("ltr","text direction")==="rtl",v=(M,y,k)=>{const S=y?y+""+M:M;let C=!!o.data?.[k??"default"]?.[S];return n&&(C=n.applyFilters("i18n.has_translation",C,M,y,k),C=n.applyFilters("i18n.has_translation_"+b(k),C,M,y,k)),C};if(n){const M=y=>{tSe.test(y)&&s()};n.addAction("hookAdded","core/i18n",M),n.addAction("hookRemoved","core/i18n",M)}return{getLocaleData:c,setLocaleData:u,addLocaleData:d,resetLocaleData:p,subscribe:i,__:h,_x:g,_n:z,_nx:A,isRTL:_,hasTranslation:v}},a0=nSe(void 0,void 0,Dre);a0.getLocaleData.bind(a0);a0.setLocaleData.bind(a0);a0.resetLocaleData.bind(a0);a0.subscribe.bind(a0);const m=a0.__.bind(a0),We=a0._x.bind(a0),Dn=a0._n.bind(a0);a0._nx.bind(a0);const jt=a0.isRTL.bind(a0);a0.hasTranslation.bind(a0);function da(e=null){if(!e){if(typeof window>"u")return!1;e=window}const{platform:t}=e.navigator;return t.indexOf("Mac")!==-1||["iPad","iPhone"].includes(t)}const Mc=8,Y2=9,Gr=13,gd=27,LN=32,oSe=33,rSe=34,FM=35,S2=36,wi=37,cc=38,_i=39,Ps=40,zl=46,sSe=121,ea="alt",Ga="ctrl",Up="meta",ta="shift";function l0e(e){return e.length<2?e.toUpperCase():e.charAt(0).toUpperCase()+e.slice(1)}function c3(e,t){return Object.fromEntries(Object.entries(e).map(([n,o])=>[n,t(o)]))}const w5={primary:e=>e()?[Up]:[Ga],primaryShift:e=>e()?[ta,Up]:[Ga,ta],primaryAlt:e=>e()?[ea,Up]:[Ga,ea],secondary:e=>e()?[ta,ea,Up]:[Ga,ta,ea],access:e=>e()?[Ga,ea]:[ta,ea],ctrl:()=>[Ga],alt:()=>[ea],ctrlShift:()=>[Ga,ta],shift:()=>[ta],shiftAlt:()=>[ta,ea],undefined:()=>[]},iSe=c3(w5,e=>(t,n=da)=>[...e(n),t.toLowerCase()].join("+")),u0e=c3(w5,e=>(t,n=da)=>{const o=n(),r={[ea]:o?"⌥":"Alt",[Ga]:o?"⌃":"Ctrl",[Up]:"⌘",[ta]:o?"⇧":"Shift"};return[...e(n).reduce((i,c)=>{var l;const u=(l=r[c])!==null&&l!==void 0?l:c;return o?[...i,u]:[...i,u,"+"]},[]),l0e(t)]}),j1=c3(u0e,e=>(t,n=da)=>e(t,n).join("")),d0e=c3(w5,e=>(t,n=da)=>{const o=n(),r={[ta]:"Shift",[Up]:o?"Command":"Control",[Ga]:"Control",[ea]:o?"Option":"Alt",",":m("Comma"),".":m("Period"),"`":m("Backtick"),"~":m("Tilde")};return[...e(n),t].map(s=>{var i;return l0e((i=r[s])!==null&&i!==void 0?i:s)}).join(o?" ":" + ")});function aSe(e){return[ea,Ga,Up,ta].filter(t=>e[`${t}Key`])}const lc=c3(w5,e=>(t,n,o=da)=>{const r=e(o),s=aSe(t),i={Comma:",",Backslash:"\\",IntlRo:"\\",IntlYen:"\\"},c=r.filter(d=>!s.includes(d)),l=s.filter(d=>!r.includes(d));if(c.length>0||l.length>0)return!1;let u=t.key.toLowerCase();return n?(t.altKey&&n.length===1&&(u=String.fromCharCode(t.keyCode).toLowerCase()),t.shiftKey&&n.length===1&&i[t.code]&&(u=i[t.code]),n==="del"&&(n="delete"),u===n.toLowerCase()):r.includes(u)});function _5(e="firstElement"){const t=x.useRef(e),n=r=>{r.focus({preventScroll:!0})},o=x.useRef();return x.useEffect(()=>{t.current=e},[e]),Mn(r=>{var s;if(!(!r||t.current===!1)&&!r.contains((s=r.ownerDocument?.activeElement)!==null&&s!==void 0?s:null)){if(t.current!=="firstElement"){n(r);return}return o.current=setTimeout(()=>{const i=Xr.tabbable.find(r)[0];i&&n(i)},0),()=>{o.current&&clearTimeout(o.current)}}},[])}let cA=null;function PN(e){const t=x.useRef(null),n=x.useRef(null),o=x.useRef(e);return x.useEffect(()=>{o.current=e},[e]),x.useCallback(r=>{if(r){var s;if(t.current=r,n.current)return;const c=r.ownerDocument.activeElement instanceof window.HTMLIFrameElement?r.ownerDocument.activeElement.contentDocument:r.ownerDocument;n.current=(s=c?.activeElement)!==null&&s!==void 0?s:null}else if(n.current){const c=t.current?.contains(t.current?.ownerDocument.activeElement);if(t.current?.isConnected&&!c){var i;(i=cA)!==null&&i!==void 0||(cA=n.current);return}o.current?o.current():(n.current.isConnected?n.current:cA)?.focus(),cA=null}},[])}const cSe=["button","submit"];function lSe(e){if(!(e instanceof window.HTMLElement))return!1;switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return cSe.includes(e.type)}return!1}function p0e(e){const t=x.useRef(e);x.useEffect(()=>{t.current=e},[e]);const n=x.useRef(!1),o=x.useRef(),r=x.useCallback(()=>{clearTimeout(o.current)},[]);x.useEffect(()=>()=>r(),[]),x.useEffect(()=>{e||r()},[e,r]);const s=x.useCallback(c=>{const{type:l,target:u}=c;["mouseup","touchend"].includes(l)?n.current=!1:lSe(u)&&(n.current=!0)},[]),i=x.useCallback(c=>{if(c.persist(),n.current)return;const l=c.target.getAttribute("data-unstable-ignore-focus-outside-for-relatedtarget");l&&c.relatedTarget?.closest(l)||(o.current=setTimeout(()=>{if(!document.hasFocus()){c.preventDefault();return}typeof t.current=="function"&&t.current(c)},0))},[]);return{onFocus:r,onMouseDown:s,onMouseUp:s,onTouchStart:s,onTouchEnd:s,onBlur:i}}function lA(e,t){typeof e=="function"?e(t):e&&e.hasOwnProperty("current")&&(e.current=t)}function xn(e){const t=x.useRef(),n=x.useRef(!1),o=x.useRef(!1),r=x.useRef([]),s=x.useRef(e);return s.current=e,x.useLayoutEffect(()=>{o.current===!1&&n.current===!0&&e.forEach((i,c)=>{const l=r.current[c];i!==l&&(lA(l,null),lA(i,t.current))}),r.current=e},e),x.useLayoutEffect(()=>{o.current=!1}),x.useCallback(i=>{lA(t,i),o.current=!0,n.current=i!==null;const c=i?s.current:r.current;for(const l of c)lA(l,i)},[])}function f0e(e){const t=x.useRef(),{constrainTabbing:n=e.focusOnMount!==!1}=e;x.useEffect(()=>{t.current=e},Object.values(e));const o=NN(),r=_5(e.focusOnMount),s=PN(),i=p0e(l=>{t.current?.__unstableOnClose?t.current.__unstableOnClose("focus-outside",l):t.current?.onClose&&t.current.onClose()}),c=x.useCallback(l=>{l&&l.addEventListener("keydown",u=>{u.keyCode===gd&&!u.defaultPrevented&&t.current?.onClose&&(u.preventDefault(),t.current.onClose())})},[]);return[xn([n?o:null,e.focusOnMount!==!1?s:null,e.focusOnMount!==!1?r:null,c]),{...i,tabIndex:-1}]}function jN({isDisabled:e=!1}={}){return Mn(t=>{if(e)return;const n=t?.ownerDocument?.defaultView;if(!n)return;const o=[],r=()=>{t.childNodes.forEach(c=>{c instanceof n.HTMLElement&&(c.getAttribute("inert")||(c.setAttribute("inert","true"),o.push(()=>{c.removeAttribute("inert")})))})},s=F1(r,0,{leading:!0});r();const i=new window.MutationObserver(s);return i.observe(t,{childList:!0}),()=>{i&&i.disconnect(),s.cancel(),o.forEach(c=>c())}},[e])}function Ts(e){const t=x.useRef(()=>{throw new Error("Callbacks created with `useEvent` cannot be called during rendering.")});return x.useInsertionEffect(()=>{t.current=e}),x.useCallback((...n)=>t.current?.(...n),[])}const IN=typeof window<"u"?x.useLayoutEffect:x.useEffect;function b0e({onDragStart:e,onDragMove:t,onDragEnd:n}){const[o,r]=x.useState(!1),s=x.useRef({onDragStart:e,onDragMove:t,onDragEnd:n});IN(()=>{s.current.onDragStart=e,s.current.onDragMove=t,s.current.onDragEnd=n},[e,t,n]);const i=x.useCallback(u=>s.current.onDragMove&&s.current.onDragMove(u),[]),c=x.useCallback(u=>{s.current.onDragEnd&&s.current.onDragEnd(u),document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",c),r(!1)},[]),l=x.useCallback(u=>{s.current.onDragStart&&s.current.onDragStart(u),document.addEventListener("mousemove",i),document.addEventListener("mouseup",c),r(!0)},[]);return x.useEffect(()=>()=>{o&&(document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",c))},[o]),{startDrag:l,endDrag:c,isDragging:o}}const NH=new Map;function uSe(e){if(!e)return null;let t=NH.get(e);return t||(typeof window<"u"&&typeof window.matchMedia=="function"?(t=window.matchMedia(e),NH.set(e,t),t):null)}function DN(e){const t=x.useMemo(()=>{const n=uSe(e);return{subscribe(o){return n?(n.addEventListener?.("change",o),()=>{n.removeEventListener?.("change",o)}):()=>{}},getValue(){var o;return(o=n?.matches)!==null&&o!==void 0?o:!1}}},[e]);return x.useSyncExternalStore(t.subscribe,t.getValue,()=>!1)}function Fr(e){const t=x.useRef();return x.useEffect(()=>{t.current=e},[e]),t.current}const $1=()=>DN("(prefers-reduced-motion: reduce)");function dSe(e,t){const n={...e};return Object.entries(t).forEach(([o,r])=>{n[o]?n[o]={...n[o],to:r.to}:n[o]=r}),n}const BH=(e,t)=>{const n=e?.findIndex(({id:r})=>typeof r=="string"?r===t.id:ds(r,t.id)),o=[...e];return n!==-1?o[n]={id:t.id,changes:dSe(o[n].changes,t.changes)}:o.push(t),o};function pSe(){let e=[],t=[],n=0;const o=()=>{e=e.slice(0,n||void 0),n=0},r=()=>{var i;const c=e.length===0?0:e.length-1;let l=(i=e[c])!==null&&i!==void 0?i:[];t.forEach(u=>{l=BH(l,u)}),t=[],e[c]=l},s=i=>!i.filter(({changes:l})=>Object.values(l).some(({from:u,to:d})=>typeof u!="function"&&typeof d!="function"&&!ds(u,d))).length;return{addRecord(i,c=!1){const l=!i||s(i);if(c){if(l)return;i.forEach(u=>{t=BH(t,u)})}else{if(o(),t.length&&r(),l)return;e.push(i)}},undo(){t.length&&(o(),r());const i=e[e.length-1+n];if(i)return n-=1,i},redo(){const i=e[e.length+n];if(i)return n+=1,i},hasUndo(){return!!e[e.length-1+n]},hasRedo(){return!!e[e.length+n]}}}const LH={xhuge:1920,huge:1440,wide:1280,xlarge:1080,large:960,medium:782,small:600,mobile:480},fSe={">=":"min-width","<":"max-width"},bSe={">=":(e,t)=>t>=e,"<":(e,t)=>t=")=>{const n=x.useContext(h0e),o=!n&&`(${fSe[t]}: ${LH[e]}px)`,r=DN(o||void 0);return n?bSe[t](LH[e],n):r};Yn.__experimentalWidthProvider=h0e.Provider;function m0e(e,t={}){const n=Ts(e),o=x.useRef(),r=x.useRef();return Ts(s=>{var i;if(s===o.current)return;(i=r.current)!==null&&i!==void 0||(r.current=new ResizeObserver(n));const{current:c}=r;o.current&&c.unobserve(o.current),o.current=s,s&&c.observe(s,t)})}const hSe=e=>{let t;if(!e.contentBoxSize)t=[e.contentRect.width,e.contentRect.height];else if(e.contentBoxSize[0]){const r=e.contentBoxSize[0];t=[r.inlineSize,r.blockSize]}else{const r=e.contentBoxSize;t=[r.inlineSize,r.blockSize]}const[n,o]=t.map(r=>Math.round(r));return{width:n,height:o}},mSe={position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none",opacity:0,overflow:"hidden",zIndex:-1};function gSe({onResize:e}){const t=m0e(n=>{const o=hSe(n.at(-1));e(o)});return a.jsx("div",{ref:t,style:mSe,"aria-hidden":"true"})}function MSe(e,t){return e.width===t.width&&e.height===t.height}const PH={width:null,height:null};function zSe(){const[e,t]=x.useState(PH),n=x.useRef(PH),o=x.useCallback(s=>{MSe(n.current,s)||(n.current=s,t(s))},[]);return[a.jsx(gSe,{onResize:o}),e]}function js(e,t={}){return e?m0e(e,t):zSe()}var MS={exports:{}},jH;function OSe(){return jH||(jH=1,function(e){(function(t){e.exports?e.exports=t():window.idleCallbackShim=t()})(function(){var t,n,o,r,s=typeof window<"u"?window:typeof p1!=null?p1:this||{},i=s.cancelRequestAnimationFrame&&s.requestAnimationFrame||setTimeout,c=s.cancelRequestAnimationFrame||clearTimeout,l=[],u=0,d=!1,p=7,f=35,b=125,h=0,g=0,z=0,A={get didTimeout(){return!1},timeRemaining:function(){var B=p-(Date.now()-g);return B<0?0:B}},_=v(function(){p=22,b=66,f=0});function v(B){var N,j,I=99,P=function(){var $=Date.now()-j;$9?o=setTimeout(S,n):(n=0,S()))}function R(){var B,N,j,I=p>9?9:1;if(g=Date.now(),d=!1,o=null,u>2||g-n-50I;N++)B=l.shift(),z++,B&&B(A);l.length?C():u=0}function T(B){return h++,l.push(B),C(),h}function E(B){var N=B-1-z;l[N]&&(l[N]=null)}if(!s.requestIdleCallback||!s.cancelIdleCallback)s.requestIdleCallback=T,s.cancelIdleCallback=E,s.document&&document.addEventListener&&(s.addEventListener("scroll",y,!0),s.addEventListener("resize",y),document.addEventListener("focus",y,!0),document.addEventListener("mouseover",y,!0),["click","keypress","touchstart","mousedown"].forEach(function(B){document.addEventListener(B,y,{capture:!0,passive:!0})}),s.MutationObserver&&new MutationObserver(y).observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}));else try{s.requestIdleCallback(function(){},{timeout:0})}catch{(function(N){var j,I;if(s.requestIdleCallback=function(P,$){return $&&typeof $.timeout=="number"?N(P,$.timeout):N(P)},s.IdleCallbackDeadline&&(j=IdleCallbackDeadline.prototype)){if(I=Object.getOwnPropertyDescriptor(j,"timeRemaining"),!I||!I.configurable||!I.get)return;Object.defineProperty(j,"timeRemaining",{value:function(){return I.get.call(this)},enumerable:!0,configurable:!0})}})(s.requestIdleCallback)}return{request:T,cancel:E}})}(MS)),MS.exports}OSe();function ySe(){return typeof window>"u"?e=>{setTimeout(()=>e(Date.now()),0)}:window.requestIdleCallback}const IH=ySe(),FN=()=>{const e=new Map;let t=!1;const n=c=>{for(const[l,u]of e)if(e.delete(l),u(),typeof c=="number"||c.timeRemaining()<=0)break;if(e.size===0){t=!1;return}IH(n)};return{add:(c,l)=>{e.set(c,l),t||(t=!0,IH(n))},flush:c=>{const l=e.get(c);return l===void 0?!1:(e.delete(c),l(),!0)},cancel:c=>e.delete(c),reset:()=>{e.clear(),t=!1}}};function ASe(e,t){const n=[];for(let o=0;o{let s=ASe(e,o);s.length{hs.flushSync(()=>{r(l=>[...l,...e.slice(c,c+n)])})});return()=>i.reset()},[e]),o}function vSe(e,t){if(e.length!==t.length)return!1;for(var n=0;nF1(e,t??0,n),[e,t,n]);return x.useEffect(()=>()=>o.cancel(),[o]),o}function M0e(e=""){const[t,n]=x.useState(e),[o,r]=x.useState(e),s=q1(r,250);return x.useEffect(()=>{s(t)},[t,s]),[t,n,o]}function yE(e,t,n){const o=g0e(()=>RN(e,t??0,n),[e,t,n]);return x.useEffect(()=>()=>o.cancel(),[o]),o}function k5({dropZoneElement:e,isDisabled:t,onDrop:n,onDragStart:o,onDragEnter:r,onDragLeave:s,onDragEnd:i,onDragOver:c}){const l=Ts(n),u=Ts(o),d=Ts(r),p=Ts(s),f=Ts(i),b=Ts(c);return Mn(h=>{if(t)return;const g=e??h;let z=!1;const{ownerDocument:A}=g;function _(R){const{defaultView:T}=A;if(!R||!T||!(R instanceof T.HTMLElement)||!g.contains(R))return!1;let E=R;do if(E.dataset.isDropZone)return E===g;while(E=E.parentElement);return!1}function v(R){z||(z=!0,A.addEventListener("dragend",C),A.addEventListener("mousemove",C),o&&u(R))}function M(R){R.preventDefault(),!g.contains(R.relatedTarget)&&r&&d(R)}function y(R){!R.defaultPrevented&&c&&b(R),R.preventDefault()}function k(R){_(R.relatedTarget)||s&&p(R)}function S(R){R.defaultPrevented||(R.preventDefault(),R.dataTransfer&&R.dataTransfer.files.length,n&&l(R),C(R))}function C(R){z&&(z=!1,A.removeEventListener("dragend",C),A.removeEventListener("mousemove",C),i&&f(R))}return g.setAttribute("data-is-drop-zone","true"),g.addEventListener("drop",S),g.addEventListener("dragenter",M),g.addEventListener("dragover",y),g.addEventListener("dragleave",k),A.addEventListener("dragenter",v),()=>{g.removeAttribute("data-is-drop-zone"),g.removeEventListener("drop",S),g.removeEventListener("dragenter",M),g.removeEventListener("dragover",y),g.removeEventListener("dragleave",k),A.removeEventListener("dragend",C),A.removeEventListener("mousemove",C),A.removeEventListener("dragenter",v)}},[t,e])}function z0e(){return Mn(e=>{const{ownerDocument:t}=e;if(!t)return;const{defaultView:n}=t;if(!n)return;function o(){t&&t.activeElement===e&&e.focus()}return n.addEventListener("blur",o),()=>{n.removeEventListener("blur",o)}},[])}const xSe=30;function wSe(e,t,n,o){var r,s;const i=(r=o?.initWindowSize)!==null&&r!==void 0?r:xSe,c=(s=o?.useWindowing)!==null&&s!==void 0?s:!0,[l,u]=x.useState({visibleItems:i,start:0,end:i,itemInView:d=>d>=0&&d<=i});return x.useLayoutEffect(()=>{if(!c)return;const d=ps(e.current),p=b=>{var h;if(!d)return;const g=Math.ceil(d.clientHeight/t),z=b?g:(h=o?.windowOverscan)!==null&&h!==void 0?h:g,A=Math.floor(d.scrollTop/t),_=Math.max(0,A-z),v=Math.min(n-1,A+g+z);u(M=>{const y={visibleItems:g,start:_,end:v,itemInView:k=>_<=k&&k<=v};return M.start!==y.start||M.end!==y.end||M.visibleItems!==y.visibleItems?y:M})};p(!0);const f=F1(()=>{p()},16);return d?.addEventListener("scroll",f),d?.ownerDocument?.defaultView?.addEventListener("resize",f),d?.ownerDocument?.defaultView?.addEventListener("resize",f),()=>{d?.removeEventListener("scroll",f),d?.ownerDocument?.defaultView?.removeEventListener("resize",f)}},[t,e,n,o?.expandedState,o?.windowOverscan,c]),x.useLayoutEffect(()=>{if(!c)return;const d=ps(e.current),p=f=>{switch(f.keyCode){case S2:return d?.scrollTo({top:0});case FM:return d?.scrollTo({top:n*t});case oSe:return d?.scrollTo({top:d.scrollTop-l.visibleItems*t});case rSe:return d?.scrollTo({top:d.scrollTop+l.visibleItems*t})}};return d?.ownerDocument?.defaultView?.addEventListener("keydown",p),()=>{d?.ownerDocument?.defaultView?.removeEventListener("keydown",p)}},[n,t,e,l.visibleItems,c,o?.expandedState]),[l,u]}function $M(e,t){const[n,o]=x.useMemo(()=>[r=>e.subscribe(t,r),()=>e.get(t)],[e,t]);return x.useSyncExternalStore(n,o,o)}function O0e(e){const t=Object.keys(e);return function(o={},r){const s={};let i=!1;for(const c of t){const l=e[c],u=o[c],d=l(u,r);s[c]=d,i=i||d!==u}return i?s:o}}function At(e){const t=new WeakMap,n=(...o)=>{let r=t.get(n.registry);return r||(r=e(n.registry.select),t.set(n.registry,r)),r(...o)};return n.isRegistrySelector=!0,n}function zS(e){return e.isRegistryControl=!0,e}const _Se="@@data/SELECT",kSe="@@data/RESOLVE_SELECT",SSe="@@data/DISPATCH",CSe={[_Se]:zS(e=>({storeKey:t,selectorName:n,args:o})=>e.select(t)[n](...o)),[kSe]:zS(e=>({storeKey:t,selectorName:n,args:o})=>{const r=e.select(t)[n].hasResolver?"resolveSelect":"select";return e[r](t)[n](...o)}),[SSe]:zS(e=>({storeKey:t,actionName:n,args:o})=>e.dispatch(t)[n](...o))},qSe=["@wordpress/block-directory","@wordpress/block-editor","@wordpress/block-library","@wordpress/blocks","@wordpress/commands","@wordpress/components","@wordpress/core-commands","@wordpress/core-data","@wordpress/customize-widgets","@wordpress/data","@wordpress/edit-post","@wordpress/edit-site","@wordpress/edit-widgets","@wordpress/editor","@wordpress/format-library","@wordpress/patterns","@wordpress/preferences","@wordpress/reusable-blocks","@wordpress/router","@wordpress/dataviews","@wordpress/fields","@wordpress/media-utils","@wordpress/upload-media"],DH=[],RSe=!globalThis.IS_WORDPRESS_CORE,P0=(e,t)=>{if(!qSe.includes(t))throw new Error(`You tried to opt-in to unstable APIs as module "${t}". This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will be removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on one of the next WordPress releases.`);if(!RSe&&DH.includes(t))throw new Error(`You tried to opt-in to unstable APIs as module "${t}" which is already registered. This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will be removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on one of the next WordPress releases.`);return DH.push(t),{lock:TSe,unlock:ESe}};function TSe(e,t){if(!e)throw new Error("Cannot lock an undefined object.");const n=e;MM in n||(n[MM]={}),y0e.set(n[MM],t)}function ESe(e){if(!e)throw new Error("Cannot unlock an undefined object.");const t=e;if(!(MM in t))throw new Error("Cannot unlock an object that was not locked before. ");return y0e.get(t[MM])}const y0e=new WeakMap,MM=Symbol("Private API ID"),{lock:Zg,unlock:Db}=P0("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/data"),WSe=()=>e=>t=>Ure(t)?t.then(n=>{if(n)return e(n)}):e(t),NSe=(e,t)=>()=>n=>o=>{const r=e.select(t).getCachedResolvers();return Object.entries(r).forEach(([i,c])=>{const l=e.stores[t]?.resolvers?.[i];!l||!l.shouldInvalidate||c.forEach((u,d)=>{u!==void 0&&(u.status!=="finished"&&u.status!=="error"||l.shouldInvalidate(o,...d)&&e.dispatch(t).invalidateResolution(i,d))})}),n(o)};function BSe(e){return()=>t=>n=>typeof n=="function"?n(e):t(n)}const LSe=e=>t=>(n={},o)=>{const r=o[e];if(r===void 0)return n;const s=t(n[r],o);return s===n[r]?n:{...n,[r]:s}};function Lu(e){if(e==null)return[];const t=e.length;let n=t;for(;n>0&&e[n-1]===void 0;)n--;return n===t?e:e.slice(0,n)}const PSe=LSe("selectorName")((e=new Va,t)=>{switch(t.type){case"START_RESOLUTION":{const n=new Va(e);return n.set(Lu(t.args),{status:"resolving"}),n}case"FINISH_RESOLUTION":{const n=new Va(e);return n.set(Lu(t.args),{status:"finished"}),n}case"FAIL_RESOLUTION":{const n=new Va(e);return n.set(Lu(t.args),{status:"error",error:t.error}),n}case"START_RESOLUTIONS":{const n=new Va(e);for(const o of t.args)n.set(Lu(o),{status:"resolving"});return n}case"FINISH_RESOLUTIONS":{const n=new Va(e);for(const o of t.args)n.set(Lu(o),{status:"finished"});return n}case"FAIL_RESOLUTIONS":{const n=new Va(e);return t.args.forEach((o,r)=>{const s={status:"error",error:void 0},i=t.errors[r];i&&(s.error=i),n.set(Lu(o),s)}),n}case"INVALIDATE_RESOLUTION":{const n=new Va(e);return n.delete(Lu(t.args)),n}}return e}),jSe=(e={},t)=>{switch(t.type){case"INVALIDATE_RESOLUTION_FOR_STORE":return{};case"INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR":{if(t.selectorName in e){const{[t.selectorName]:n,...o}=e;return o}return e}case"START_RESOLUTION":case"FINISH_RESOLUTION":case"FAIL_RESOLUTION":case"START_RESOLUTIONS":case"FINISH_RESOLUTIONS":case"FAIL_RESOLUTIONS":case"INVALIDATE_RESOLUTION":return PSe(e,t)}return e};var OS={};function ISe(e){return[e]}function DSe(e){return!!e&&typeof e=="object"}function FSe(){var e={clear:function(){e.head=null}};return e}function FH(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;oArray.from(t._map.values()).some(n=>n[1]?.status==="resolving"))}const YSe=It(e=>{const t={};return Object.values(e).forEach(n=>Array.from(n._map.values()).forEach(o=>{var r;const s=(r=o[1]?.status)!==null&&r!==void 0?r:"error";t[s]||(t[s]=0),t[s]++})),t},e=>[e]),ZSe=Object.freeze(Object.defineProperty({__proto__:null,countSelectorsByStatus:YSe,getCachedResolvers:GSe,getIsResolving:$Se,getResolutionError:USe,getResolutionState:Pf,hasFinishedResolution:VSe,hasResolutionFailed:HSe,hasResolvingSelectors:KSe,hasStartedResolution:A0e,isResolving:XSe},Symbol.toStringTag,{value:"Module"}));function v0e(e,t){return{type:"START_RESOLUTION",selectorName:e,args:t}}function x0e(e,t){return{type:"FINISH_RESOLUTION",selectorName:e,args:t}}function w0e(e,t,n){return{type:"FAIL_RESOLUTION",selectorName:e,args:t,error:n}}function QSe(e,t){return{type:"START_RESOLUTIONS",selectorName:e,args:t}}function JSe(e,t){return{type:"FINISH_RESOLUTIONS",selectorName:e,args:t}}function eCe(e,t,n){return{type:"FAIL_RESOLUTIONS",selectorName:e,args:t,errors:n}}function tCe(e,t){return{type:"INVALIDATE_RESOLUTION",selectorName:e,args:t}}function nCe(){return{type:"INVALIDATE_RESOLUTION_FOR_STORE"}}function oCe(e){return{type:"INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR",selectorName:e}}const rCe=Object.freeze(Object.defineProperty({__proto__:null,failResolution:w0e,failResolutions:eCe,finishResolution:x0e,finishResolutions:JSe,invalidateResolution:tCe,invalidateResolutionForStore:nCe,invalidateResolutionForStoreSelector:oCe,startResolution:v0e,startResolutions:QSe},Symbol.toStringTag,{value:"Module"})),yS=e=>{const t=[...e];for(let n=t.length-1;n>=0;n--)t[n]===void 0&&t.splice(n,1);return t},Yu=(e,t)=>Object.fromEntries(Object.entries(e??{}).map(([n,o])=>[n,t(o,n)])),sCe=(e,t)=>t instanceof Map?Object.fromEntries(t):t instanceof window.HTMLElement?null:t;function iCe(){const e={};return{isRunning(t,n){return e[t]&&e[t].get(yS(n))},clear(t,n){e[t]&&e[t].delete(yS(n))},markAsRunning(t,n){e[t]||(e[t]=new Va),e[t].set(yS(n),!0)}}}function $H(e){const t=new WeakMap;return{get(n,o){let r=t.get(n);return r||(r=e(n,o),t.set(n,r)),r}}}function w1(e,t){const n={},o={},r={privateActions:n,registerPrivateActions:i=>{Object.assign(n,i)},privateSelectors:o,registerPrivateSelectors:i=>{Object.assign(o,i)}},s={name:e,instantiate:i=>{const c=new Set,l=t.reducer,d=aCe(e,t,i,{registry:i,get dispatch(){return z},get select(){return S},get resolveSelect(){return B()}});Zg(d,r);const p=iCe();function f(P){return(...$)=>Promise.resolve(d.dispatch(P(...$)))}const b={...Yu(rCe,f),...Yu(t.actions,f)},h=$H(f),g=new Proxy(()=>{},{get:(P,$)=>{const F=n[$];return F?h.get(F,$):b[$]}}),z=new Proxy(g,{apply:(P,$,[F])=>d.dispatch(F)});Zg(b,g);const A=t.resolvers?uCe(t.resolvers):{};function _(P,$){P.isRegistrySelector&&(P.registry=i);const F=(...Z)=>{Z=AE(P,Z);const V=d.__unstableOriginalGetState();return P.isRegistrySelector&&(P.registry=i),P(V.root,...Z)};F.__unstableNormalizeArgs=P.__unstableNormalizeArgs;const X=A[$];return X?dCe(F,$,X,d,p):(F.hasResolver=!1,F)}function v(P){const $=(...F)=>{const X=d.__unstableOriginalGetState(),Z=F&&F[0],V=F&&F[1],Q=t?.selectors?.[Z];return Z&&Q&&(F[1]=AE(Q,V)),P(X.metadata,...F)};return $.hasResolver=!1,$}const M={...Yu(ZSe,v),...Yu(t.selectors,_)},y=$H(_);for(const[P,$]of Object.entries(o))y.get($,P);const k=new Proxy(()=>{},{get:(P,$)=>{const F=o[$];return F?y.get(F,$):M[$]}}),S=new Proxy(k,{apply:(P,$,[F])=>F(d.__unstableOriginalGetState())});Zg(M,k);const C=cCe(M,d),R=lCe(M,d),T=()=>M,E=()=>b,B=()=>C,N=()=>R;d.__unstableOriginalGetState=d.getState,d.getState=()=>d.__unstableOriginalGetState().root;const j=d&&(P=>(c.add(P),()=>c.delete(P)));let I=d.__unstableOriginalGetState();return d.subscribe(()=>{const P=d.__unstableOriginalGetState(),$=P!==I;if(I=P,$)for(const F of c)F()}),{reducer:l,store:d,actions:b,selectors:M,resolvers:A,getSelectors:T,getResolveSelectors:B,getSuspendSelectors:N,getActions:E,subscribe:j}}};return Zg(s,r),s}function aCe(e,t,n,o){const r={...t.controls,...CSe},s=Yu(r,p=>p.isRegistryControl?p(n):p),i=[NSe(n,e),WSe,l6e(s),BSe(o)],c=[Yke(...i)];typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__&&c.push(window.__REDUX_DEVTOOLS_EXTENSION__({name:e,instanceId:e,serialize:{replacer:sCe}}));const{reducer:l,initialState:u}=t,d=O0e({metadata:jSe,root:l});return $re(d,{root:u},Co(c))}function cCe(e,t){const{getIsResolving:n,hasStartedResolution:o,hasFinishedResolution:r,hasResolutionFailed:s,isResolving:i,getCachedResolvers:c,getResolutionState:l,getResolutionError:u,hasResolvingSelectors:d,countSelectorsByStatus:p,...f}=e;return Yu(f,(b,h)=>b.hasResolver?(...g)=>new Promise((z,A)=>{const _=()=>e.hasFinishedResolution(h,g),v=S=>{if(e.hasResolutionFailed(h,g)){const R=e.getResolutionError(h,g);A(R)}else z(S)},M=()=>b.apply(null,g),y=M();if(_())return v(y);const k=t.subscribe(()=>{_()&&(k(),v(M()))})}):async(...g)=>b.apply(null,g))}function lCe(e,t){return Yu(e,(n,o)=>n.hasResolver?(...r)=>{const s=n.apply(null,r);if(e.hasFinishedResolution(o,r)){if(e.hasResolutionFailed(o,r))throw e.getResolutionError(o,r);return s}throw new Promise(i=>{const c=t.subscribe(()=>{e.hasFinishedResolution(o,r)&&(i(),c())})})}:n)}function uCe(e){return Yu(e,t=>t.fulfill?t:{...t,fulfill:t})}function dCe(e,t,n,o,r){function s(c){const l=o.getState();if(r.isRunning(t,c)||typeof n.isFulfilled=="function"&&n.isFulfilled(l,...c))return;const{metadata:u}=o.__unstableOriginalGetState();A0e(u,t,c)||(r.markAsRunning(t,c),setTimeout(async()=>{r.clear(t,c),o.dispatch(v0e(t,c));try{const d=n.fulfill(...c);d&&await o.dispatch(d),o.dispatch(x0e(t,c))}catch(d){o.dispatch(w0e(t,c,d))}},0))}const i=(...c)=>(c=AE(e,c),s(c),e(...c));return i.hasResolver=!0,i}function AE(e,t){return e.__unstableNormalizeArgs&&typeof e.__unstableNormalizeArgs=="function"&&t?.length?e.__unstableNormalizeArgs(t):t}const pCe={name:"core/data",instantiate(e){const t=o=>(r,...s)=>e.select(r)[o](...s),n=o=>(r,...s)=>e.dispatch(r)[o](...s);return{getSelectors(){return Object.fromEntries(["getIsResolving","hasStartedResolution","hasFinishedResolution","isResolving","getCachedResolvers"].map(o=>[o,t(o)]))},getActions(){return Object.fromEntries(["startResolution","finishResolution","invalidateResolution","invalidateResolutionForStore","invalidateResolutionForStoreSelector"].map(o=>[o,n(o)]))},subscribe(){return()=>()=>{}}}}};function VH(){let e=!1,t=!1;const n=new Set,o=()=>Array.from(n).forEach(r=>r());return{get isPaused(){return e},subscribe(r){return n.add(r),()=>n.delete(r)},pause(){e=!0},resume(){e=!1,t&&(t=!1,o())},emit(){if(e){t=!0;return}o()}}}function Ag(e){return typeof e=="string"?e:e.name}function S5(e={},t=null){const n={},o=VH();let r=null;function s(){o.emit()}const i=(y,k)=>{if(!k)return o.subscribe(y);const S=Ag(k),C=n[S];return C?C.subscribe(y):t?t.subscribe(y,k):o.subscribe(y)};function c(y){const k=Ag(y);r?.add(k);const S=n[k];return S?S.getSelectors():t?.select(k)}function l(y,k){r=new Set;try{return y.call(this)}finally{k.current=Array.from(r),r=null}}function u(y){const k=Ag(y);r?.add(k);const S=n[k];return S?S.getResolveSelectors():t&&t.resolveSelect(k)}function d(y){const k=Ag(y);r?.add(k);const S=n[k];return S?S.getSuspendSelectors():t&&t.suspendSelect(k)}function p(y){const k=Ag(y),S=n[k];return S?S.getActions():t&&t.dispatch(k)}function f(y){return Object.fromEntries(Object.entries(y).map(([k,S])=>typeof S!="function"?[k,S]:[k,function(){return _[k].apply(null,arguments)}]))}function b(y,k){if(n[y])return console.error('Store "'+y+'" is already registered.'),n[y];const S=k();if(typeof S.getSelectors!="function")throw new TypeError("store.getSelectors must be a function");if(typeof S.getActions!="function")throw new TypeError("store.getActions must be a function");if(typeof S.subscribe!="function")throw new TypeError("store.subscribe must be a function");S.emitter=VH();const C=S.subscribe;if(S.subscribe=R=>{const T=S.emitter.subscribe(R),E=C(()=>{if(S.emitter.isPaused){S.emitter.emit();return}R()});return()=>{E?.(),T?.()}},n[y]=S,S.subscribe(s),t)try{Db(S.store).registerPrivateActions(Db(t).privateActionsOf(y)),Db(S.store).registerPrivateSelectors(Db(t).privateSelectorsOf(y))}catch{}return S}function h(y){b(y.name,()=>y.instantiate(_))}function g(y,k){Ke("wp.data.registerGenericStore",{since:"5.9",alternative:"wp.data.register( storeDescriptor )"}),b(y,()=>k)}function z(y,k){if(!k.reducer)throw new TypeError("Must specify store reducer");return b(y,()=>w1(y,k).instantiate(_)).store}function A(y){if(o.isPaused){y();return}o.pause(),Object.values(n).forEach(k=>k.emitter.pause());try{y()}finally{o.resume(),Object.values(n).forEach(k=>k.emitter.resume())}}let _={batch:A,stores:n,namespaces:n,subscribe:i,select:c,resolveSelect:u,suspendSelect:d,dispatch:p,use:v,register:h,registerGenericStore:g,registerStore:z,__unstableMarkListeningStores:l};function v(y,k){if(y)return _={..._,...y(_,k)},_}_.register(pCe);for(const[y,k]of Object.entries(e))_.register(w1(y,k));t&&t.subscribe(s);const M=f(_);return Zg(M,{privateActionsOf:y=>{try{return Db(n[y].store).privateActions}catch{return{}}},privateSelectorsOf:y=>{try{return Db(n[y].store).privateSelectors}catch{return{}}}}),M}const qc=S5();var AS,HH;function fCe(){if(HH)return AS;HH=1;var e=function(_){return t(_)&&!n(_)};function t(A){return!!A&&typeof A=="object"}function n(A){var _=Object.prototype.toString.call(A);return _==="[object RegExp]"||_==="[object Date]"||s(A)}var o=typeof Symbol=="function"&&Symbol.for,r=o?Symbol.for("react.element"):60103;function s(A){return A.$$typeof===r}function i(A){return Array.isArray(A)?[]:{}}function c(A,_){return _.clone!==!1&&_.isMergeableObject(A)?g(i(A),A,_):A}function l(A,_,v){return A.concat(_).map(function(M){return c(M,v)})}function u(A,_){if(!_.customMerge)return g;var v=_.customMerge(A);return typeof v=="function"?v:g}function d(A){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(A).filter(function(_){return Object.propertyIsEnumerable.call(A,_)}):[]}function p(A){return Object.keys(A).concat(d(A))}function f(A,_){try{return _ in A}catch{return!1}}function b(A,_){return f(A,_)&&!(Object.hasOwnProperty.call(A,_)&&Object.propertyIsEnumerable.call(A,_))}function h(A,_,v){var M={};return v.isMergeableObject(A)&&p(A).forEach(function(y){M[y]=c(A[y],v)}),p(_).forEach(function(y){b(A,y)||(f(A,y)&&v.isMergeableObject(_[y])?M[y]=u(y,v)(A[y],_[y],v):M[y]=c(_[y],v))}),M}function g(A,_,v){v=v||{},v.arrayMerge=v.arrayMerge||l,v.isMergeableObject=v.isMergeableObject||e,v.cloneUnlessOtherwiseSpecified=c;var M=Array.isArray(_),y=Array.isArray(A),k=M===y;return k?M?v.arrayMerge(A,_,v):h(A,_,v):c(_,v)}g.all=function(_,v){if(!Array.isArray(_))throw new Error("first argument should be an array");return _.reduce(function(M,y){return g(M,y,v)},{})};var z=g;return AS=z,AS}var bCe=fCe();const _0e=Zr(bCe),k0e=x.createContext(qc),{Consumer:Bmn,Provider:$N}=k0e;function Fn(){return x.useContext(k0e)}const S0e=x.createContext(!1),{Consumer:Lmn,Provider:C5}=S0e;function hCe(){return x.useContext(S0e)}const vS=FN();function mCe(e,t){if(!e||!t)return;const n=typeof e=="object"&&typeof t=="object"?Object.keys(e).filter(o=>e[o]!==t[o]):[];console.warn(`The \`useSelect\` hook returns different values when called with the same state and parameters. This can lead to unnecessary re-renders and performance issues if not fixed. Non-equal value keys: %s -`,n.join(", "))}function KCe(e,t){const n=e.select,o={};let r,s,i=!1,c,l,u;const d=new Map;function p(b){var h;return(h=e.stores[b]?.store?.getState?.())!==null&&h!==void 0?h:{}}const f=b=>{const h=[...b],g=new Set;function z(_){if(i)for(const S of h)d.get(S)!==p(S)&&(i=!1);d.clear();const v=()=>{i=!1,_()},M=()=>{c?vS.add(o,v):v()},y=[];function k(S){y.push(e.subscribe(M,S))}for(const S of h)k(S);return g.add(k),()=>{g.delete(k);for(const S of y.values())S?.();vS.cancel(o)}}function A(_){for(const v of _)if(!h.includes(v)){h.push(v);for(const M of g)M(v)}}return{subscribe:z,updateStores:A}};return(b,h)=>{function g(){if(i&&b===r)return s;const A={current:null},_=e.__unstableMarkListeningStores(()=>b(n,e),A);if(globalThis.SCRIPT_DEBUG&&!u){const v=b(n,e);ds(_,v)||(GCe(_,v),u=!0)}if(l)l.updateStores(A.current);else{for(const v of A.current)d.set(v,p(v));l=f(A.current)}ds(s,_)||(s=_),r=b,i=!0}function z(){return g(),s}return c&&!h&&(i=!1,vS.cancel(o)),g(),c=h,{subscribe:l.subscribe,getValue:z}}}function YCe(e){return Fn().select(e)}function ZCe(e,t,n){const o=Fn(),r=XCe(),s=x.useMemo(()=>KCe(o),[o,e]),i=x.useCallback(t,n),{subscribe:c,getValue:l}=s(i,r),u=x.useSyncExternalStore(c,l,l);return x.useDebugValue(u),u}function G(e,t){const n=typeof e!="function",o=x.useRef(n);if(n!==o.current){const r=o.current?"static":"mapping",s=n?"static":"mapping";throw new Error(`Switching useSelect from ${r} to ${s} is not allowed`)}return n?YCe(e):ZCe(!1,e,t)}const Ul=e=>Or(t=>oSe(n=>{const r=G((s,i)=>e(s,n,i));return a.jsx(t,{...n,...r})}),"withSelect"),Oe=e=>{const{dispatch:t}=Fn();return e===void 0?t:t(e)},QCe=(e,t)=>{const n=Fn(),o=x.useRef(e);return VN(()=>{o.current=e}),x.useMemo(()=>{const r=o.current(n.dispatch,n);return Object.fromEntries(Object.entries(r).map(([s,i])=>(typeof i!="function"&&console.warn(`Property ${s} returned from dispatchMap in useDispatchWithMap must be a function.`),[s,(...c)=>o.current(n.dispatch,n)[s](...c)])))},[n,...t])},Ff=e=>Or(t=>n=>{const r=QCe((s,i)=>e(s,n,i),[]);return a.jsx(t,{...n,...r})},"withDispatch");function kr(e){return qc.dispatch(e)}function uo(e){return qc.select(e)}const J0=k0e,B0e=qc.resolveSelect;qc.suspendSelect;const JCe=qc.subscribe;qc.registerGenericStore;const eqe=qc.registerStore;qc.use;const Us=qc.register;var xS,QH;function tqe(){return QH||(QH=1,xS=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var o,r,s;if(Array.isArray(t)){if(o=t.length,o!=n.length)return!1;for(r=o;r--!==0;)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,o!=n.length)return!1;for(r=o;r--!==0;)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(s=Object.keys(t),o=s.length,o!==Object.keys(n).length)return!1;for(r=o;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[r]))return!1;for(r=o;r--!==0;){var i=s[r];if(!e(t[i],n[i]))return!1}return!0}return t!==t&&n!==n}),xS}var nqe=tqe();const N0=Zr(nqe);function oqe(e,t){if(!e)return t;let n=!1;const o={};for(const r in t)N0(e[r],t[r])?o[r]=e[r]:(n=!0,o[r]=t[r]);if(!n)return e;for(const r in e)o.hasOwnProperty(r)||(o[r]=e[r]);return o}function Md(e){return typeof e=="string"?e.split(","):Array.isArray(e)?e:null}const L0e=e=>t=>(n,o)=>n===void 0||e(o)?t(n,o):n,GN=e=>(...t)=>async({resolveSelect:n})=>{await n[e](...t)},JH=e=>t=>(n={},o)=>{const r=o[e];if(r===void 0)return n;const s=t(n[r],o);return s===n[r]?n:{...n,[r]:s}},P0e=e=>t=>(n,o)=>t(n,e(o));function rqe(e){const t=new WeakMap;return n=>{let o;return t.has(n)?o=t.get(n):(o=e(n),n!==null&&typeof n=="object"&&t.set(n,o)),o}}function sqe(e,t){return(e.rawAttributes||[]).includes(t)}function E5(e,t,n){if(!e||typeof e!="object")return e;const o=Array.isArray(t)?t:t.split(".");return o.reduce((r,s,i)=>(r[s]===void 0&&(Number.isInteger(o[i+1])?r[s]=[]:r[s]={}),i===o.length-1&&(r[s]=n),r[s]),e),e}function iqe(e,t,n){if(!e||typeof e!="object"||typeof t!="string"&&!Array.isArray(t))return e;const o=Array.isArray(t)?t:t.split(".");let r=e;return o.forEach(s=>{r=r?.[s]}),r!==void 0?r:n}function aqe(e){return/^\s*\d+\s*$/.test(e)}const zM=["create","read","update","delete"];function KN(e){const t={};if(!e)return t;const n={create:"POST",read:"GET",update:"PUT",delete:"DELETE"};for(const[o,r]of Object.entries(n))t[o]=e.includes(r);return t}function W5(e,t,n){return(typeof t=="object"?[e,t.kind,t.name,t.id]:[e,t,n]).filter(Boolean).join("/")}const j0e=Symbol("RECEIVE_INTERMEDIATE_RESULTS");function I0e(e,t,n){return{type:"RECEIVE_ITEMS",items:Array.isArray(e)?e:[e],persistedEdits:t,meta:n}}function cqe(e,t,n,o=!1){return{type:"REMOVE_ITEMS",itemIds:Array.isArray(n)?n:[n],kind:e,name:t,invalidateCache:o}}function lqe(e,t={},n,o){return{...I0e(e,n,o),query:t}}function uqe(e){const t={stableKey:"",page:1,perPage:10,fields:null,include:null,context:"default"},n=Object.keys(e).sort();for(let s=0;s{_=_?.[v]}),E5(g,A,_)}}else{if(!e.itemIsComplete[c]?.[b])return null;g=h}p.push(g)}return p}const D0e=It((e,t={})=>{let n=eU.get(e);if(n){const r=n.get(t);if(r!==void 0)return r}else n=new Va,eU.set(e,n);const o=dqe(e,t);return n.set(t,o),o});function F0e(e,t={}){var n;const{stableKey:o,context:r}=jh(t);return(n=e.queries?.[r]?.[o]?.meta?.totalItems)!==null&&n!==void 0?n:null}function pqe(e,t={}){var n;const{stableKey:o,context:r}=jh(t);return(n=e.queries?.[r]?.[o]?.meta?.totalPages)!==null&&n!==void 0?n:null}function fqe(e={},t){switch(t.type){case"ADD_FORMAT_TYPES":return{...e,...t.formatTypes.reduce((n,o)=>({...n,[o.name]:o}),{})};case"REMOVE_FORMAT_TYPES":return Object.fromEntries(Object.entries(e).filter(([n])=>!t.names.includes(n)))}return e}const bqe=J0({formatTypes:fqe}),YN=It(e=>Object.values(e.formatTypes),e=>[e.formatTypes]);function hqe(e,t){return e.formatTypes[t]}function mqe(e,t){const n=YN(e);return n.find(({className:o,tagName:r})=>o===null&&t===r)||n.find(({className:o,tagName:r})=>o===null&&r==="*")}function gqe(e,t){return YN(e).find(({className:n})=>n===null?!1:` ${t} `.indexOf(` ${n} `)>=0)}const Mqe=Object.freeze(Object.defineProperty({__proto__:null,getFormatType:hqe,getFormatTypeForBareElement:mqe,getFormatTypeForClassName:gqe,getFormatTypes:YN},Symbol.toStringTag,{value:"Module"}));function zqe(e){return{type:"ADD_FORMAT_TYPES",formatTypes:Array.isArray(e)?e:[e]}}function Oqe(e){return{type:"REMOVE_FORMAT_TYPES",names:Array.isArray(e)?e:[e]}}const yqe=Object.freeze(Object.defineProperty({__proto__:null,addFormatTypes:zqe,removeFormatTypes:Oqe},Symbol.toStringTag,{value:"Module"})),Aqe="core/rich-text",ul=w1(Aqe,{reducer:bqe,selectors:Mqe,actions:yqe});Us(ul);function T4(e,t){if(e===t)return!0;if(!e||!t||e.type!==t.type)return!1;const n=e.attributes,o=t.attributes;if(n===o)return!0;if(!n||!o)return!1;const r=Object.keys(n),s=Object.keys(o);if(r.length!==s.length)return!1;const i=r.length;for(let c=0;c{const r=t[o-1];if(r){const s=n.slice();s.forEach((i,c)=>{const l=r[c];T4(i,l)&&(s[c]=l)}),t[o]=s}}),{...e,formats:t}}function tU(e,t,n){return e=e.slice(),e[t]=n,e}function qi(e,t,n=e.start,o=e.end){const{formats:r,activeFormats:s}=e,i=r.slice();if(n===o){const c=i[n]?.find(({type:l})=>l===t.type);if(c){const l=i[n].indexOf(c);for(;i[n]&&i[n][l]===c;)i[n]=tU(i[n],l,t),n--;for(o++;i[o]&&i[o][l]===c;)i[o]=tU(i[o],l,t),o++}}else{let c=1/0;for(let l=n;ld!==t.type);const u=i[l].length;uc!==t.type)||[],t]})}function dl({implementation:e},t){return dl.body||(dl.body=e.createHTMLDocument("").body),dl.body.innerHTML=t,dl.body}const pl="",$0e="\uFEFF";function ZN(e,t=[]){const{formats:n,start:o,end:r,activeFormats:s}=e;if(o===void 0)return t;if(o===r){if(s)return s;const u=n[o-1]||t,d=n[o]||t;return u.lengthT4(p,f))||c.splice(d,1)}if(c.length===0)return t}return c||t}function V0e(e){return uo(ul).getFormatType(e)}function nU(e,t){if(t)return e;const n={};for(const o in e){let r=o;o.startsWith("data-disable-rich-text-")&&(r=o.slice(23)),n[r]=e[o]}return n}function uA({type:e,tagName:t,attributes:n,unregisteredAttributes:o,object:r,boundaryClass:s,isEditableTree:i}){const c=V0e(e);let l={};if(s&&i&&(l["data-rich-text-format-boundary"]="true"),!c)return n&&(l={...n,...l}),{type:e,attributes:nU(l,i),object:r};l={...o,...l};for(const u in n){const d=c.attributes?c.attributes[u]:!1;d?l[d]=n[u]:l[u]=n[u]}return c.className&&(l.class?l.class=`${c.className} ${l.class}`:l.class=c.className),i&&c.contentEditable===!1&&(l.contenteditable="false"),{type:t||c.tagName,object:c.object,attributes:nU(l,i)}}function vqe(e,t,n){do if(e[n]!==t[n])return!1;while(n--);return!0}function H0e({value:e,preserveWhiteSpace:t,createEmpty:n,append:o,getLastChild:r,getParent:s,isText:i,getText:c,remove:l,appendText:u,onStartIndex:d,onEndIndex:p,isEditableTree:f,placeholder:b}){const{formats:h,replacements:g,text:z,start:A,end:_}=e,v=h.length+1,M=n(),y=ZN(e),k=y[y.length-1];let S,C;o(M,"");for(let R=0;R{const h=[...b],g=new Set;function z(_){if(i)for(const S of h)d.get(S)!==p(S)&&(i=!1);d.clear();const v=()=>{i=!1,_()},M=()=>{c?vS.add(o,v):v()},y=[];function k(S){y.push(e.subscribe(M,S))}for(const S of h)k(S);return g.add(k),()=>{g.delete(k);for(const S of y.values())S?.();vS.cancel(o)}}function A(_){for(const v of _)if(!h.includes(v)){h.push(v);for(const M of g)M(v)}}return{subscribe:z,updateStores:A}};return(b,h)=>{function g(){if(i&&b===r)return s;const A={current:null},_=e.__unstableMarkListeningStores(()=>b(n,e),A);if(globalThis.SCRIPT_DEBUG&&!u){const v=b(n,e);ds(_,v)||(mCe(_,v),u=!0)}if(l)l.updateStores(A.current);else{for(const v of A.current)d.set(v,p(v));l=f(A.current)}ds(s,_)||(s=_),r=b,i=!0}function z(){return g(),s}return c&&!h&&(i=!1,vS.cancel(o)),g(),c=h,{subscribe:l.subscribe,getValue:z}}}function MCe(e){return Fn().select(e)}function zCe(e,t,n){const o=Fn(),r=hCe(),s=x.useMemo(()=>gCe(o),[o,e]),i=x.useCallback(t,n),{subscribe:c,getValue:l}=s(i,r),u=x.useSyncExternalStore(c,l,l);return x.useDebugValue(u),u}function G(e,t){const n=typeof e!="function",o=x.useRef(n);if(n!==o.current){const r=o.current?"static":"mapping",s=n?"static":"mapping";throw new Error(`Switching useSelect from ${r} to ${s} is not allowed`)}return n?MCe(e):zCe(!1,e,t)}const Ul=e=>Or(t=>f6e(n=>{const r=G((s,i)=>e(s,n,i));return a.jsx(t,{...n,...r})}),"withSelect"),Oe=e=>{const{dispatch:t}=Fn();return e===void 0?t:t(e)},OCe=(e,t)=>{const n=Fn(),o=x.useRef(e);return IN(()=>{o.current=e}),x.useMemo(()=>{const r=o.current(n.dispatch,n);return Object.fromEntries(Object.entries(r).map(([s,i])=>(typeof i!="function"&&console.warn(`Property ${s} returned from dispatchMap in useDispatchWithMap must be a function.`),[s,(...c)=>o.current(n.dispatch,n)[s](...c)])))},[n,...t])},jf=e=>Or(t=>n=>{const r=OCe((s,i)=>e(s,n,i),[]);return a.jsx(t,{...n,...r})},"withDispatch");function jr(e){return qc.dispatch(e)}function uo(e){return qc.select(e)}const J0=O0e,C0e=qc.resolveSelect;qc.suspendSelect;const yCe=qc.subscribe;qc.registerGenericStore;const ACe=qc.registerStore;qc.use;const Us=qc.register;var xS,UH;function vCe(){return UH||(UH=1,xS=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var o,r,s;if(Array.isArray(t)){if(o=t.length,o!=n.length)return!1;for(r=o;r--!==0;)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,o!=n.length)return!1;for(r=o;r--!==0;)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(s=Object.keys(t),o=s.length,o!==Object.keys(n).length)return!1;for(r=o;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[r]))return!1;for(r=o;r--!==0;){var i=s[r];if(!e(t[i],n[i]))return!1}return!0}return t!==t&&n!==n}),xS}var xCe=vCe();const N0=Zr(xCe);function wCe(e,t){if(!e)return t;let n=!1;const o={};for(const r in t)N0(e[r],t[r])?o[r]=e[r]:(n=!0,o[r]=t[r]);if(!n)return e;for(const r in e)o.hasOwnProperty(r)||(o[r]=e[r]);return o}function Md(e){return typeof e=="string"?e.split(","):Array.isArray(e)?e:null}const q0e=e=>t=>(n,o)=>n===void 0||e(o)?t(n,o):n,VN=e=>(...t)=>async({resolveSelect:n})=>{await n[e](...t)},XH=e=>t=>(n={},o)=>{const r=o[e];if(r===void 0)return n;const s=t(n[r],o);return s===n[r]?n:{...n,[r]:s}},R0e=e=>t=>(n,o)=>t(n,e(o));function _Ce(e){const t=new WeakMap;return n=>{let o;return t.has(n)?o=t.get(n):(o=e(n),n!==null&&typeof n=="object"&&t.set(n,o)),o}}function kCe(e,t){return(e.rawAttributes||[]).includes(t)}function q5(e,t,n){if(!e||typeof e!="object")return e;const o=Array.isArray(t)?t:t.split(".");return o.reduce((r,s,i)=>(r[s]===void 0&&(Number.isInteger(o[i+1])?r[s]=[]:r[s]={}),i===o.length-1&&(r[s]=n),r[s]),e),e}function SCe(e,t,n){if(!e||typeof e!="object"||typeof t!="string"&&!Array.isArray(t))return e;const o=Array.isArray(t)?t:t.split(".");let r=e;return o.forEach(s=>{r=r?.[s]}),r!==void 0?r:n}function CCe(e){return/^\s*\d+\s*$/.test(e)}const zM=["create","read","update","delete"];function HN(e){const t={};if(!e)return t;const n={create:"POST",read:"GET",update:"PUT",delete:"DELETE"};for(const[o,r]of Object.entries(n))t[o]=e.includes(r);return t}function R5(e,t,n){return(typeof t=="object"?[e,t.kind,t.name,t.id]:[e,t,n]).filter(Boolean).join("/")}const T0e=Symbol("RECEIVE_INTERMEDIATE_RESULTS");function E0e(e,t,n){return{type:"RECEIVE_ITEMS",items:Array.isArray(e)?e:[e],persistedEdits:t,meta:n}}function qCe(e,t,n,o=!1){return{type:"REMOVE_ITEMS",itemIds:Array.isArray(n)?n:[n],kind:e,name:t,invalidateCache:o}}function RCe(e,t={},n,o){return{...E0e(e,n,o),query:t}}function If(e){try{return new URL(e),!0}catch{return!1}}const TCe=/^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\.[a-z]{2,63}$/i;function W0e(e){return TCe.test(e)}const ECe=/^(tel:)?(\+)?\d{6,15}$/;function WCe(e){return e=e.replace(/[-.() ]/g,""),ECe.test(e)}function T5(e){const t=/^([^\s:]+:)/.exec(e);if(t)return t[1]}function UN(e){return e?/^[a-z\-.\+]+[0-9]*:$/i.test(e):!1}function XN(e){const t=/^[^\/\s:]+:(?:\/\/)?\/?([^\/\s#?]+)[\/#?]{0,1}\S*$/.exec(e);if(t)return t[1]}function NCe(e){return e?/^[^\s#?]+$/.test(e):!1}function Aa(e){const t=/^[^\/\s:]+:(?:\/\/)?[^\/\s#?]+[\/]([^\s#?]+)[#?]{0,1}\S*$/.exec(e);if(t)return t[1]}function BCe(e){return e?/^[^\s#?]+$/.test(e):!1}function GN(e){let t;try{t=new URL(e,"http://example.com").search.substring(1)}catch{}if(t)return t}function E5(e){let t="";const n=Object.entries(e);let o;for(;o=n.shift();){let[r,s]=o;if(Array.isArray(s)||s&&s.constructor===Object){const c=Object.entries(s).reverse();for(const[l,u]of c)n.unshift([`${r}[${l}]`,u])}else s!==void 0&&(s===null&&(s=""),t+="&"+[r,s].map(encodeURIComponent).join("="))}return t.substr(1)}function LCe(e){return e?/^[^\s#?\/]+$/.test(e):!1}function PCe(e){const t=Aa(e),n=GN(e);let o="/";return t&&(o+=t),n&&(o+=`?${n}`),o}function jCe(e){const t=/^\S+?(#[^\s\?]*)/.exec(e);if(t)return t[1]}function vE(e){return e?/^#[^\s#?\/]*$/.test(e):!1}function Z2(e){try{return decodeURIComponent(e)}catch{return e}}function ICe(e,t,n){const o=t.length,r=o-1;for(let s=0;s{const[o,r=""]=n.split("=").filter(Boolean).map(Z2);if(o){const s=o.replace(/\]/g,"").split("[");ICe(t,s,r)}return t},Object.create(null))}function tn(e="",t){if(!t||!Object.keys(t).length)return e;let n=e;const o=e.indexOf("?");return o!==-1&&(t=Object.assign(Lh(e),t),n=n.substr(0,o)),n+"?"+E5(t)}function xE(e,t){return Lh(e)[t]}function GH(e,t){return xE(e,t)!==void 0}function R4(e,...t){const n=e.indexOf("?");if(n===-1)return e;const o=Lh(e),r=e.substr(0,n);t.forEach(i=>delete o[i]);const s=E5(o);return s?r+"?"+s:r}const DCe=/^(?:[a-z]+:|#|\?|\.|\/)/i;function Df(e){return e&&(e=e.trim(),!DCe.test(e)&&!W0e(e)?"http://"+e:e)}function l3(e){try{return decodeURI(e)}catch{return e}}function Ph(e,t=null){if(!e)return"";let n=e.replace(/^[a-z\-.\+]+[0-9]*:(\/\/)?/i,"").replace(/^www\./i,"");n.match(/^[^\/]+\/$/)&&(n=n.replace("/",""));const o=/\/([^\/?]+)\.(?:[\w]+)(?=\?|$)/;if(!t||n.length<=t||!n.match(o))return n;n=n.split("?")[0];const r=n.split("/"),s=r[r.length-1];if(s.length<=t)return"…"+n.slice(-t);const i=s.lastIndexOf("."),[c,l]=[s.slice(0,i),s.slice(i+1)],u=c.slice(-3)+"."+l;return s.slice(0,t-u.length-1)+"…"+u}var vg={exports:{}},KH;function FCe(){if(KH)return vg.exports;KH=1;var e={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},t=Object.keys(e).join("|"),n=new RegExp(t,"g"),o=new RegExp(t,"");function r(c){return e[c]}var s=function(c){return c.replace(n,r)},i=function(c){return!!c.match(o)};return vg.exports=s,vg.exports.has=i,vg.exports.remove=s,vg.exports}var $Ce=FCe();const ms=Zr($Ce);function W5(e){return e?ms(e).replace(/[\s\./]+/g,"-").replace(/[^\p{L}\p{N}_-]+/gu,"").toLowerCase().replace(/-+/g,"-").replace(/(^-+)|(-+$)/g,""):""}function Ff(e){let t;if(e){try{t=new URL(e,"http://example.com").pathname.split("/").pop()}catch{}if(t)return t}}function YH(e){const t=e.split("?"),n=t[1],o=t[0];return n?o+"?"+n.split("&").map(r=>r.split("=")).map(r=>r.map(decodeURIComponent)).sort((r,s)=>r[0].localeCompare(s[0])).map(r=>r.map(encodeURIComponent)).map(r=>r.join("=")).join("&"):o}function VCe(e){const t={stableKey:"",page:1,perPage:10,fields:null,include:null,context:"default"},n=Object.keys(e).sort();for(let s=0;s{_=_?.[v]}),q5(g,A,_)}}else{if(!e.itemIsComplete[c]?.[b])return null;g=h}p.push(g)}return p}const N0e=It((e,t={})=>{let n=ZH.get(e);if(n){const r=n.get(t);if(r!==void 0)return r}else n=new Va,ZH.set(e,n);const o=HCe(e,t);return n.set(t,o),o});function B0e(e,t={}){var n;const{stableKey:o,context:r}=jh(t);return(n=e.queries?.[r]?.[o]?.meta?.totalItems)!==null&&n!==void 0?n:null}function UCe(e,t={}){var n;const{stableKey:o,context:r}=jh(t);return(n=e.queries?.[r]?.[o]?.meta?.totalPages)!==null&&n!==void 0?n:null}function XCe(e){const t=(n,o)=>{const{headers:r={}}=n;for(const s in r)if(s.toLowerCase()==="x-wp-nonce"&&r[s]===t.nonce)return o(n);return o({...n,headers:{...r,"X-WP-Nonce":t.nonce}})};return t.nonce=e,t}const L0e=(e,t)=>{let n=e.path,o,r;return typeof e.namespace=="string"&&typeof e.endpoint=="string"&&(o=e.namespace.replace(/^\/|\/$/g,""),r=e.endpoint.replace(/^\//,""),r?n=o+"/"+r:n=o),delete e.namespace,delete e.endpoint,t({...e,path:n})},GCe=e=>(t,n)=>L0e(t,o=>{let r=o.url,s=o.path,i;return typeof s=="string"&&(i=e,e.indexOf("?")!==-1&&(s=s.replace("?","&")),s=s.replace(/^\//,""),typeof i=="string"&&i.indexOf("?")!==-1&&(s=s.replace("?","&")),r=i+s),n({...o,url:r})});function KCe(e){const t=Object.fromEntries(Object.entries(e).map(([n,o])=>[YH(n),o]));return(n,o)=>{const{parse:r=!0}=n;let s=n.path;if(!s&&n.url){const{rest_route:l,...u}=Lh(n.url);typeof l=="string"&&(s=tn(l,u))}if(typeof s!="string")return o(n);const i=n.method||"GET",c=YH(s);if(i==="GET"&&t[c]){const l=t[c];return delete t[c],QH(l,!!r)}else if(i==="OPTIONS"&&t[i]&&t[i][c]){const l=t[i][c];return delete t[i][c],QH(l,!!r)}return o(n)}}function QH(e,t){return Promise.resolve(t?e.body:new window.Response(JSON.stringify(e.body),{status:200,statusText:"OK",headers:e.headers}))}const YCe=({path:e,url:t,...n},o)=>({...n,url:t&&tn(t,o),path:e&&tn(e,o)}),JH=e=>e.json?e.json():Promise.reject(e),ZCe=e=>{if(!e)return{};const t=e.match(/<([^>]+)>; rel="next"/);return t?{next:t[1]}:{}},eU=e=>{const{next:t}=ZCe(e.headers.get("link"));return t},QCe=e=>{const t=!!e.path&&e.path.indexOf("per_page=-1")!==-1,n=!!e.url&&e.url.indexOf("per_page=-1")!==-1;return t||n},P0e=async(e,t)=>{if(e.parse===!1||!QCe(e))return t(e);const n=await Wt({...YCe(e,{per_page:100}),parse:!1}),o=await JH(n);if(!Array.isArray(o))return o;let r=eU(n);if(!r)return o;let s=[].concat(o);for(;r;){const i=await Wt({...e,path:void 0,url:r,parse:!1}),c=await JH(i);s=s.concat(c),r=eU(i)}return s},JCe=new Set(["PATCH","PUT","DELETE"]),eqe="GET",tqe=(e,t)=>{const{method:n=eqe}=e;return JCe.has(n.toUpperCase())&&(e={...e,headers:{...e.headers,"X-HTTP-Method-Override":n,"Content-Type":"application/json"},method:"POST"}),t(e)},nqe=(e,t)=>(typeof e.url=="string"&&!GH(e.url,"_locale")&&(e.url=tn(e.url,{_locale:"user"})),typeof e.path=="string"&&!GH(e.path,"_locale")&&(e.path=tn(e.path,{_locale:"user"})),t(e)),oqe=(e,t=!0)=>t?e.status===204?null:e.json?e.json():Promise.reject(e):e,rqe=e=>{const t={code:"invalid_json",message:m("The response is not a valid JSON response.")};if(!e||!e.json)throw t;return e.json().catch(()=>{throw t})},j0e=(e,t=!0)=>Promise.resolve(oqe(e,t)).catch(n=>KN(n,t));function KN(e,t=!0){if(!t)throw e;return rqe(e).then(n=>{const o={code:"unknown_error",message:m("An unknown error occurred.")};throw n||o})}function sqe(e){const t=!!e.method&&e.method==="POST";return(!!e.path&&e.path.indexOf("/wp/v2/media")!==-1||!!e.url&&e.url.indexOf("/wp/v2/media")!==-1)&&t}const iqe=(e,t)=>{if(!sqe(e))return t(e);let n=0;const o=5,r=s=>(n++,t({path:`/wp/v2/media/${s}/post-process`,method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch(()=>n{if(!s.headers)return Promise.reject(s);const i=s.headers.get("x-wp-upload-attachment-id");return s.status>=500&&s.status<600&&i?r(i).catch(()=>e.parse!==!1?Promise.reject({code:"post_process",message:m("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(s)):KN(s,e.parse)}).then(s=>j0e(s,e.parse))},aqe=e=>(t,n)=>{if(typeof t.url=="string"){const o=xE(t.url,"wp_theme_preview");o===void 0?t.url=tn(t.url,{wp_theme_preview:e}):o===""&&(t.url=R4(t.url,"wp_theme_preview"))}if(typeof t.path=="string"){const o=xE(t.path,"wp_theme_preview");o===void 0?t.path=tn(t.path,{wp_theme_preview:e}):o===""&&(t.path=R4(t.path,"wp_theme_preview"))}return n(t)},cqe={Accept:"application/json, */*;q=0.1"},lqe={credentials:"include"},I0e=[nqe,L0e,tqe,P0e];function uqe(e){I0e.unshift(e)}const D0e=e=>{if(e.status>=200&&e.status<300)return e;throw e},dqe=e=>{const{url:t,path:n,data:o,parse:r=!0,...s}=e;let{body:i,headers:c}=e;return c={...cqe,...c},o&&(i=JSON.stringify(o),c["Content-Type"]="application/json"),window.fetch(t||n||window.location.href,{...lqe,...s,body:i,headers:c}).then(u=>Promise.resolve(u).then(D0e).catch(d=>KN(d,r)).then(d=>j0e(d,r)),u=>{throw u&&u.name==="AbortError"?u:{code:"fetch_error",message:m("You are probably offline.")}})};let F0e=dqe;function pqe(e){F0e=e}function Wt(e){return I0e.reduceRight((n,o)=>r=>o(r,n),F0e)(e).catch(n=>n.code!=="rest_cookie_invalid_nonce"?Promise.reject(n):window.fetch(Wt.nonceEndpoint).then(D0e).then(o=>o.text()).then(o=>(Wt.nonceMiddleware.nonce=o,Wt(e))))}Wt.use=uqe;Wt.setFetchHandler=pqe;Wt.createNonceMiddleware=XCe;Wt.createPreloadingMiddleware=KCe;Wt.createRootURLMiddleware=GCe;Wt.fetchAllMiddleware=P0e;Wt.mediaUploadMiddleware=iqe;Wt.createThemePreviewMiddleware=aqe;function fqe(e={},t){switch(t.type){case"ADD_FORMAT_TYPES":return{...e,...t.formatTypes.reduce((n,o)=>({...n,[o.name]:o}),{})};case"REMOVE_FORMAT_TYPES":return Object.fromEntries(Object.entries(e).filter(([n])=>!t.names.includes(n)))}return e}const bqe=J0({formatTypes:fqe}),YN=It(e=>Object.values(e.formatTypes),e=>[e.formatTypes]);function hqe(e,t){return e.formatTypes[t]}function mqe(e,t){const n=YN(e);return n.find(({className:o,tagName:r})=>o===null&&t===r)||n.find(({className:o,tagName:r})=>o===null&&r==="*")}function gqe(e,t){return YN(e).find(({className:n})=>n===null?!1:` ${t} `.indexOf(` ${n} `)>=0)}const Mqe=Object.freeze(Object.defineProperty({__proto__:null,getFormatType:hqe,getFormatTypeForBareElement:mqe,getFormatTypeForClassName:gqe,getFormatTypes:YN},Symbol.toStringTag,{value:"Module"}));function zqe(e){return{type:"ADD_FORMAT_TYPES",formatTypes:Array.isArray(e)?e:[e]}}function Oqe(e){return{type:"REMOVE_FORMAT_TYPES",names:Array.isArray(e)?e:[e]}}const yqe=Object.freeze(Object.defineProperty({__proto__:null,addFormatTypes:zqe,removeFormatTypes:Oqe},Symbol.toStringTag,{value:"Module"})),Aqe="core/rich-text",ul=w1(Aqe,{reducer:bqe,selectors:Mqe,actions:yqe});Us(ul);function T4(e,t){if(e===t)return!0;if(!e||!t||e.type!==t.type)return!1;const n=e.attributes,o=t.attributes;if(n===o)return!0;if(!n||!o)return!1;const r=Object.keys(n),s=Object.keys(o);if(r.length!==s.length)return!1;const i=r.length;for(let c=0;c{const r=t[o-1];if(r){const s=n.slice();s.forEach((i,c)=>{const l=r[c];T4(i,l)&&(s[c]=l)}),t[o]=s}}),{...e,formats:t}}function tU(e,t,n){return e=e.slice(),e[t]=n,e}function qi(e,t,n=e.start,o=e.end){const{formats:r,activeFormats:s}=e,i=r.slice();if(n===o){const c=i[n]?.find(({type:l})=>l===t.type);if(c){const l=i[n].indexOf(c);for(;i[n]&&i[n][l]===c;)i[n]=tU(i[n],l,t),n--;for(o++;i[o]&&i[o][l]===c;)i[o]=tU(i[o],l,t),o++}}else{let c=1/0;for(let l=n;ld!==t.type);const u=i[l].length;uc!==t.type)||[],t]})}function dl({implementation:e},t){return dl.body||(dl.body=e.createHTMLDocument("").body),dl.body.innerHTML=t,dl.body}const pl="",$0e="\uFEFF";function ZN(e,t=[]){const{formats:n,start:o,end:r,activeFormats:s}=e;if(o===void 0)return t;if(o===r){if(s)return s;const u=n[o-1]||t,d=n[o]||t;return u.lengthT4(p,f))||c.splice(d,1)}if(c.length===0)return t}return c||t}function V0e(e){return uo(ul).getFormatType(e)}function nU(e,t){if(t)return e;const n={};for(const o in e){let r=o;o.startsWith("data-disable-rich-text-")&&(r=o.slice(23)),n[r]=e[o]}return n}function uA({type:e,tagName:t,attributes:n,unregisteredAttributes:o,object:r,boundaryClass:s,isEditableTree:i}){const c=V0e(e);let l={};if(s&&i&&(l["data-rich-text-format-boundary"]="true"),!c)return n&&(l={...n,...l}),{type:e,attributes:nU(l,i),object:r};l={...o,...l};for(const u in n){const d=c.attributes?c.attributes[u]:!1;d?l[d]=n[u]:l[u]=n[u]}return c.className&&(l.class?l.class=`${c.className} ${l.class}`:l.class=c.className),i&&c.contentEditable===!1&&(l.contenteditable="false"),{type:t||c.tagName,object:c.object,attributes:nU(l,i)}}function vqe(e,t,n){do if(e[n]!==t[n])return!1;while(n--);return!0}function H0e({value:e,preserveWhiteSpace:t,createEmpty:n,append:o,getLastChild:r,getParent:s,isText:i,getText:c,remove:l,appendText:u,onStartIndex:d,onEndIndex:p,isEditableTree:f,placeholder:b}){const{formats:h,replacements:g,text:z,start:A,end:_}=e,v=h.length+1,M=n(),y=ZN(e),k=y[y.length-1];let S,C;o(M,"");for(let R=0;R{if(N&&S&&vqe(B,S,I)){N=r(N);return}const{type:P,tagName:$,attributes:F,unregisteredAttributes:X}=j,Z=f&&j===k,V=s(N),Q=o(V,uA({type:P,tagName:$,attributes:F,unregisteredAttributes:X,boundaryClass:Z,isEditableTree:f}));i(N)&&c(N).length===0&&l(N),N=o(Q,"")}),R===0&&(d&&A===0&&d(M,N),p&&_===0&&p(M,N)),T===pl){const j=g[R];if(!j)continue;const{type:I,attributes:P,innerHTML:$}=j,F=V0e(I);f&&I==="#comment"?(N=o(s(N),{type:"span",attributes:{contenteditable:"false","data-rich-text-comment":P["data-rich-text-comment"]}}),o(o(N,{type:"span"}),P["data-rich-text-comment"].trim())):!f&&I==="script"?(N=o(s(N),uA({type:"script",isEditableTree:f})),o(N,{html:decodeURIComponent(P["data-rich-text-script"])})):F?.contentEditable===!1?(N=o(s(N),uA({...j,isEditableTree:f,boundaryClass:A===R&&_===R+1})),$&&o(N,{html:$})):N=o(s(N),uA({...j,object:!0,isEditableTree:f})),N=o(s(N),"")}else!t&&T===` `?(N=o(s(N),{type:"br",attributes:f?{"data-rich-text-line-break":"true"}:void 0,object:!0}),N=o(s(N),"")):i(N)?u(N,T):N=o(s(N),T);d&&A===R+1&&d(M,N),p&&_===R+1&&p(M,N),E&&R===z.length&&(o(s(N),$0e),b&&z.length===0&&o(s(N),{type:"span",attributes:{"data-rich-text-placeholder":b,style:"pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;"}})),S=B,C=T}return M}function T0({value:e,preserveWhiteSpace:t}){const n=H0e({value:e,preserveWhiteSpace:t,createEmpty:xqe,append:_qe,getLastChild:wqe,getParent:Sqe,isText:Cqe,getText:qqe,remove:Rqe,appendText:kqe});return U0e(n.children)}function xqe(){return{}}function wqe({children:e}){return e&&e[e.length-1]}function _qe(e,t){return typeof t=="string"&&(t={text:t}),t.parent=e,e.children=e.children||[],e.children.push(t),t}function kqe(e,t){e.text+=t}function Sqe({parent:e}){return e}function Cqe({text:e}){return typeof e=="string"}function qqe({text:e}){return e}function Rqe(e){const t=e.parent.children.indexOf(e);return t!==-1&&e.parent.children.splice(t,1),e}function Tqe({type:e,attributes:t,object:n,children:o}){if(e==="#comment")return``;let r="";for(const s in t)Lre(s)&&(r+=` ${s}="${z5(t[s])}"`);return n?`<${e}${r}>`:`<${e}${r}>${U0e(o)}`}function U0e(e=[]){return e.map(t=>t.html!==void 0?t.html:t.text===void 0?Tqe(t):_ke(t.text)).join("")}function Jp({text:e}){return e.replace(pl,"")}function $p(){return{formats:[],replacements:[],text:""}}function Eqe({tagName:e,attributes:t}){let n;if(t&&t.class&&(n=uo(ul).getFormatTypeForClassName(t.class),n&&(t.class=` ${t.class} `.replace(` ${n.className} `," ").trim(),t.class||delete t.class)),n||(n=uo(ul).getFormatTypeForBareElement(e)),!n)return t?{type:e,attributes:t}:{type:e};if(n.__experimentalCreatePrepareEditableTree&&!n.__experimentalCreateOnChangeEditableValue)return null;if(!t)return{formatType:n,type:n.name,tagName:e};const o={},r={},s={...t};for(const i in n.attributes){const c=n.attributes[i];o[i]=s[c],delete s[c],typeof o[i]>"u"&&delete o[i]}for(const i in s)r[i]=t[i];return n.contentEditable===!1&&delete r.contenteditable,{formatType:n,type:n.name,tagName:e,attributes:o,unregisteredAttributes:r}}class Xo{#e;static empty(){return new Xo}static fromPlainText(t){return new Xo(eo({text:t}))}static fromHTMLString(t){return new Xo(eo({html:t}))}static fromHTMLElement(t,n={}){const{preserveWhiteSpace:o=!1}=n,r=o?t:X0e(t),s=new Xo(eo({element:r}));return Object.defineProperty(s,"originalHTML",{value:t.innerHTML}),s}constructor(t=$p()){this.#e=t}toPlainText(){return Jp(this.#e)}toHTMLString({preserveWhiteSpace:t}={}){return this.originalHTML||T0({value:this.#e,preserveWhiteSpace:t})}valueOf(){return this.toHTMLString()}toString(){return this.toHTMLString()}toJSON(){return this.toHTMLString()}get length(){return this.text.length}get formats(){return this.#e.formats}get replacements(){return this.#e.replacements}get text(){return this.#e.text}}for(const e of Object.getOwnPropertyNames(String.prototype))Xo.prototype.hasOwnProperty(e)||Object.defineProperty(Xo.prototype,e,{value(...t){return this.toHTMLString()[e](...t)}});function eo({element:e,text:t,html:n,range:o,__unstableIsEditableTree:r}={}){return n instanceof Xo?{text:n.text,formats:n.formats,replacements:n.replacements}:typeof t=="string"&&t.length>0?{formats:Array(t.length),replacements:Array(t.length),text:t}:(typeof n=="string"&&n.length>0&&(e=dl(document,n)),typeof e!="object"?$p():G0e({element:e,range:o,isEditableTree:r}))}function qu(e,t,n,o){if(!n)return;const{parentNode:r}=t,{startContainer:s,startOffset:i,endContainer:c,endOffset:l}=n,u=e.text.length;o.start!==void 0?e.start=u+o.start:t===s&&t.nodeType===t.TEXT_NODE?e.start=u+i:r===s&&t===s.childNodes[i]?e.start=u:r===s&&t===s.childNodes[i-1]?e.start=u+o.text.length:t===s&&(e.start=u),o.end!==void 0?e.end=u+o.end:t===c&&t.nodeType===t.TEXT_NODE?e.end=u+l:r===c&&t===c.childNodes[l-1]?e.end=u+o.text.length:r===c&&t===c.childNodes[l]?e.end=u:t===c&&(e.end=u+l)}function Wqe(e,t,n){if(!t)return;const{startContainer:o,endContainer:r}=t;let{startOffset:s,endOffset:i}=t;return e===o&&(s=n(e.nodeValue.slice(0,s)).length),e===r&&(i=n(e.nodeValue.slice(0,i)).length),{startContainer:o,startOffset:s,endContainer:r,endOffset:i}}function X0e(e,t=!0){const n=e.cloneNode(!0);return n.normalize(),Array.from(n.childNodes).forEach((o,r,s)=>{if(o.nodeType===o.TEXT_NODE){let i=o.nodeValue;/[\n\t\r\f]/.test(i)&&(i=i.replace(/[\n\t\r\f]+/g," ")),i.indexOf(" ")!==-1&&(i=i.replace(/ {2,}/g," ")),r===0&&i.startsWith(" ")?i=i.slice(1):t&&r===s.length-1&&i.endsWith(" ")&&(i=i.slice(0,-1)),o.nodeValue=i}else o.nodeType===o.ELEMENT_NODE&&X0e(o,!1)}),n}const Nqe="\r";function oU(e){return e.replace(new RegExp(`[${$0e}${pl}${Nqe}]`,"gu"),"")}function G0e({element:e,range:t,isEditableTree:n}){const o=$p();if(!e)return o;if(!e.hasChildNodes())return qu(o,e,t,$p()),o;const r=e.childNodes.length;for(let s=0;sn===t)}function Pqe({start:e,end:t,replacements:n,text:o}){if(!(e+1!==t||o[e]!==pl))return n[e]}function Xl({start:e,end:t}){if(!(e===void 0||t===void 0))return e===t}function wE({text:e}){return e.length===0}function jqe(e,t=""){return typeof t=="string"&&(t=eo({text:t})),Ih(e.reduce((n,{formats:o,replacements:r,text:s})=>({formats:n.formats.concat(t.formats,o),replacements:n.replacements.concat(t.replacements,r),text:n.text+t.text+s})))}function K0e(e,t){if(t={name:e,...t},typeof t.name!="string"){window.console.error("Format names must be strings.");return}if(!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(t.name)){window.console.error("Format names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-format");return}if(uo(ul).getFormatType(t.name)){window.console.error('Format "'+t.name+'" is already registered.');return}if(typeof t.tagName!="string"||t.tagName===""){window.console.error("Format tag names must be a string.");return}if((typeof t.className!="string"||t.className==="")&&t.className!==null){window.console.error("Format class names must be a string, or null to handle bare elements.");return}if(!/^[_a-zA-Z]+[a-zA-Z0-9_-]*$/.test(t.className)){window.console.error("A class name must begin with a letter, followed by any number of hyphens, underscores, letters, or numbers.");return}if(t.className===null){const n=uo(ul).getFormatTypeForBareElement(t.tagName);if(n&&n.name!=="core/unknown"){window.console.error(`Format "${n.name}" is already registered to handle bare tag name "${t.tagName}".`);return}}else{const n=uo(ul).getFormatTypeForClassName(t.className);if(n){window.console.error(`Format "${n.name}" is already registered to handle class name "${t.className}".`);return}}if(!("title"in t)||t.title===""){window.console.error('The format "'+t.name+'" must have a title.');return}if("keywords"in t&&t.keywords.length>3){window.console.error('The format "'+t.name+'" can have a maximum of 3 keywords.');return}if(typeof t.title!="string"){window.console.error("Format titles must be strings.");return}return kr(ul).addFormatTypes(t),t}function Yd(e,t,n=e.start,o=e.end){const{formats:r,activeFormats:s}=e,i=r.slice();if(n===o){const c=i[n]?.find(({type:l})=>l===t);if(c){for(;i[n]?.find(l=>l===c);)wS(i,n,t),n--;for(o++;i[o]?.find(l=>l===c);)wS(i,o,t),o++}}else for(let c=n;cc!==t)||[]})}function wS(e,t,n){const o=e[t].filter(({type:r})=>r!==n);o.length?e[t]=o:delete e[t]}function E0(e,t,n=e.start,o=e.end){const{formats:r,replacements:s,text:i}=e;typeof t=="string"&&(t=eo({text:t}));const c=n+t.text.length;return Ih({formats:r.slice(0,n).concat(t.formats,r.slice(o)),replacements:s.slice(0,n).concat(t.replacements,s.slice(o)),text:i.slice(0,n)+t.text+i.slice(o),start:c,end:c})}function pa(e,t,n){return E0(e,eo(),t,n)}function Iqe({formats:e,replacements:t,text:n,start:o,end:r},s,i){return n=n.replace(s,(c,...l)=>{const u=l[l.length-2];let d=i,p,f;return typeof d=="function"&&(d=i(c,...l)),typeof d=="object"?(p=d.formats,f=d.replacements,d=d.text):(p=Array(d.length),f=Array(d.length),e[u]&&(p=p.fill(e[u]))),e=e.slice(0,u).concat(p,e.slice(u+c.length)),t=t.slice(0,u).concat(f,t.slice(u+c.length)),o&&(o=r=u+d.length),d}),Ih({formats:e,replacements:t,text:n,start:o,end:r})}function Y0e(e,t,n,o){return E0(e,{formats:[,],replacements:[t],text:pl},n,o)}function Q2(e,t=e.start,n=e.end){const{formats:o,replacements:r,text:s}=e;return t===void 0||n===void 0?{...e}:{formats:o.slice(t,n),replacements:r.slice(t,n),text:s.slice(t,n)}}function JN({formats:e,replacements:t,text:n,start:o,end:r},s){if(typeof s!="string")return Dqe(...arguments);let i=0;return n.split(s).map(c=>{const l=i,u={formats:e.slice(l,l+c.length),replacements:t.slice(l,l+c.length),text:c};return i+=s.length+c.length,o!==void 0&&r!==void 0&&(o>=l&&ol&&(u.start=0),r>=l&&ri&&(u.end=c.length)),u})}function Dqe({formats:e,replacements:t,text:n,start:o,end:r},s=o,i=r){if(o===void 0||r===void 0)return;const c={formats:e.slice(0,s),replacements:t.slice(0,s),text:n.slice(0,s)},l={formats:e.slice(i),replacements:t.slice(i),text:n.slice(i),start:0,end:0};return[c,l]}function Z0e(e,t){return e===t||e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset}function _E(e,t,n){const o=e.parentNode;let r=0;for(;e=e.previousSibling;)r++;return n=[r,...n],o!==t&&(n=_E(o,t,n)),n}function rU(e,t){for(t=[...t];e&&t.length>1;)e=e.childNodes[t.shift()];return{node:e,offset:t[0]}}function Fqe(e,t){if(t.html!==void 0)return e.innerHTML+=t.html;typeof t=="string"&&(t=e.ownerDocument.createTextNode(t));const{type:n,attributes:o}=t;if(n)if(n==="#comment")t=e.ownerDocument.createComment(o["data-rich-text-comment"]);else{t=e.ownerDocument.createElement(n);for(const r in o)t.setAttribute(r,o[r])}return e.appendChild(t)}function $qe(e,t){e.appendData(t)}function Vqe({lastChild:e}){return e}function Hqe({parentNode:e}){return e}function Uqe(e){return e.nodeType===e.TEXT_NODE}function Xqe({nodeValue:e}){return e}function Gqe(e){return e.parentNode.removeChild(e)}function Kqe({value:e,prepareEditableTree:t,isEditableTree:n=!0,placeholder:o,doc:r=document}){let s=[],i=[];return t&&(e={...e,formats:t(e)}),{body:H0e({value:e,createEmpty:()=>dl(r,""),append:Fqe,getLastChild:Vqe,getParent:Hqe,isText:Uqe,getText:Xqe,remove:Gqe,appendText:$qe,onStartIndex(u,d){s=_E(d,u,[d.nodeValue.length])},onEndIndex(u,d){i=_E(d,u,[d.nodeValue.length])},isEditableTree:n,placeholder:o}),selection:{startPath:s,endPath:i}}}function Yqe({value:e,current:t,prepareEditableTree:n,__unstableDomOnly:o,placeholder:r}){const{body:s,selection:i}=Kqe({value:e,prepareEditableTree:n,placeholder:r,doc:t.ownerDocument});Q0e(s,t),e.start!==void 0&&!o&&Zqe(i,t)}function Q0e(e,t){let n=0,o;for(;o=e.firstChild;){const r=t.childNodes[n];if(!r)t.appendChild(o);else if(r.isEqualNode(o))e.removeChild(o);else if(r.nodeName!==o.nodeName||r.nodeType===r.TEXT_NODE&&r.data!==o.data)t.replaceChild(o,r);else{const s=r.attributes,i=o.attributes;if(s){let c=s.length;for(;c--;){const{name:l}=s[c];o.getAttribute(l)||r.removeAttribute(l)}}if(i)for(let c=0;c0){if(Z0e(d,u.getRangeAt(0)))return;u.removeAllRanges()}u.addRange(d),p!==c.activeElement&&p instanceof l.HTMLElement&&p.focus()}function Qqe(e){if(!(typeof document>"u")){if(document.readyState==="complete"||document.readyState==="interactive")return void e();document.addEventListener("DOMContentLoaded",e)}}function sU(e="polite"){const t=document.createElement("div");t.id=`a11y-speak-${e}`,t.className="a11y-speak-region",t.setAttribute("style","position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;"),t.setAttribute("aria-live",e),t.setAttribute("aria-relevant","additions text"),t.setAttribute("aria-atomic","true");const{body:n}=document;return n&&n.appendChild(t),t}function Jqe(){const e=document.createElement("p");e.id="a11y-speak-intro-text",e.className="a11y-speak-intro-text",e.textContent=m("Notifications"),e.setAttribute("style","position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;"),e.setAttribute("hidden","hidden");const{body:t}=document;return t&&t.appendChild(e),e}function eRe(){const e=document.getElementsByClassName("a11y-speak-region"),t=document.getElementById("a11y-speak-intro-text");for(let n=0;n]+>/g," "),iU===e&&(e+=" "),iU=e,e}function Yt(e,t){eRe(),e=tRe(e);const n=document.getElementById("a11y-speak-intro-text"),o=document.getElementById("a11y-speak-assertive"),r=document.getElementById("a11y-speak-polite");o&&t==="assertive"?o.textContent=e:r&&(r.textContent=e),n&&n.removeAttribute("hidden")}function nRe(){const e=document.getElementById("a11y-speak-intro-text"),t=document.getElementById("a11y-speak-assertive"),n=document.getElementById("a11y-speak-polite");e===null&&Jqe(),t===null&&sU("assertive"),n===null&&sU("polite")}Qqe(nRe);function zc(e,t){return QN(e,t.type)?(t.title&&Yt(xe(m("%s removed."),t.title),"assertive"),Yd(e,t.type)):(t.title&&Yt(xe(m("%s applied."),t.title),"assertive"),qi(e,t))}function oRe(e,t,n,o){let r=e.startContainer;if(r.nodeType===r.TEXT_NODE&&e.startOffset===r.length&&r.nextSibling)for(r=r.nextSibling;r.firstChild;)r=r.firstChild;if(r.nodeType!==r.ELEMENT_NODE&&(r=r.parentElement),!r||r===t||!t.contains(r))return;const s=n+(o?"."+o:"");for(;r!==t;){if(r.matches(s))return r;r=r.parentElement}}function rRe(e,t){return{contextElement:t,getBoundingClientRect(){return t.contains(e.startContainer)?e.getBoundingClientRect():t.getBoundingClientRect()}}}function _S(e,t,n){if(!e)return;const{ownerDocument:o}=e,{defaultView:r}=o,s=r.getSelection();if(!s||!s.rangeCount)return;const i=s.getRangeAt(0);if(!i||!i.startContainer)return;const c=oRe(i,e,t,n);return c||rRe(i,e)}function u3({editableContentElement:e,settings:t={}}){const{tagName:n,className:o,isActive:r}=t,[s,i]=x.useState(()=>_S(e,n,o)),c=Fr(r);return x.useLayoutEffect(()=>{if(!e)return;function l(){i(_S(e,n,o))}function u(){p.addEventListener("selectionchange",l)}function d(){p.removeEventListener("selectionchange",l)}const{ownerDocument:p}=e;return(e===p.activeElement||!c&&r||c&&!r)&&(i(_S(e,n,o)),u()),e.addEventListener("focusin",u),e.addEventListener("focusout",d),()=>{d(),e.removeEventListener("focusin",u),e.removeEventListener("focusout",d)}},[e,n,o,r,c]),s}const sRe="pre-wrap",iRe="1px";function aRe(){return x.useCallback(e=>{e&&(e.style.whiteSpace=sRe,e.style.minWidth=iRe)},[])}function cRe({record:e}){const t=x.useRef(),{activeFormats:n=[],replacements:o,start:r}=e.current,s=o[r];return x.useEffect(()=>{if((!n||!n.length)&&!s)return;const i="*[data-rich-text-format-boundary]",c=t.current.querySelector(i);if(!c)return;const{ownerDocument:l}=c,{defaultView:u}=l,p=u.getComputedStyle(c).color.replace(")",", 0.2)").replace("rgb","rgba"),f=`.rich-text:focus ${i}`,b=`background-color: ${p}`,h=`${f} {${b}}`,g="rich-text-boundary-style";let z=l.getElementById(g);z||(z=l.createElement("style"),z.id=g,l.head.appendChild(z)),z.innerHTML!==h&&(z.innerHTML=h)},[n,s]),t}const lRe=e=>t=>{function n(r){const{record:s}=e.current,{ownerDocument:i}=t;if(Xl(s.current)||!t.contains(i.activeElement))return;const c=Q2(s.current),l=Jp(c),u=T0({value:c});r.clipboardData.setData("text/plain",l),r.clipboardData.setData("text/html",u),r.clipboardData.setData("rich-text","true"),r.preventDefault(),r.type==="cut"&&i.execCommand("delete")}const{defaultView:o}=t.ownerDocument;return o.addEventListener("copy",n),o.addEventListener("cut",n),()=>{o.removeEventListener("copy",n),o.removeEventListener("cut",n)}},uRe=()=>e=>{function t(o){const{target:r}=o;if(r===e||r.textContent&&r.isContentEditable)return;const{ownerDocument:s}=r,{defaultView:i}=s,c=i.getSelection();if(c.containsNode(r))return;const l=s.createRange(),u=r.isContentEditable?r:r.closest("[contenteditable]");l.selectNode(u),c.removeAllRanges(),c.addRange(l),o.preventDefault()}function n(o){o.relatedTarget&&!e.contains(o.relatedTarget)&&o.relatedTarget.tagName==="A"&&t(o)}return e.addEventListener("click",t),e.addEventListener("focusin",n),()=>{e.removeEventListener("click",t),e.removeEventListener("focusin",n)}},aU=[],dRe=e=>t=>{function n(o){const{keyCode:r,shiftKey:s,altKey:i,metaKey:c,ctrlKey:l}=o;if(s||i||c||l||r!==wi&&r!==_i)return;const{record:u,applyRecord:d,forceRender:p}=e.current,{text:f,formats:b,start:h,end:g,activeFormats:z=[]}=u.current,A=Xl(u.current),{ownerDocument:_}=t,{defaultView:v}=_,{direction:M}=v.getComputedStyle(t),y=M==="rtl"?_i:wi,k=o.keyCode===y;if(A&&z.length===0&&(h===0&&k||g===f.length&&!k)||!A)return;const S=b[h-1]||aU,C=b[h]||aU,R=k?S:C,T=z.every((P,$)=>P===R[$]);let E=z.length;if(T?E{t.removeEventListener("keydown",n)}},pRe=e=>t=>{function n(o){const{keyCode:r}=o,{createRecord:s,handleChange:i}=e.current;if(o.defaultPrevented||r!==zl&&r!==Mc)return;const c=s(),{start:l,end:u,text:d}=c;l===0&&u!==0&&u===d.length&&(i(pa(c)),o.preventDefault())}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}};function fRe({value:e,start:t,end:n,formats:o}){const r=Math.min(t,n),s=Math.max(t,n),i=e.formats[r-1]||[],c=e.formats[s]||[];for(e.activeFormats=o.map((l,u)=>{if(i[u]){if(T4(l,i[u]))return i[u]}else if(c[u]&&T4(l,c[u]))return c[u];return l});--n>=t;)e.activeFormats.length>0?e.formats[n]=e.activeFormats:delete e.formats[n];return e}const bRe=new Set(["insertParagraph","insertOrderedList","insertUnorderedList","insertHorizontalRule","insertLink"]),cU=[],J0e="data-rich-text-placeholder";function hRe(e){const t=e.getSelection(),{anchorNode:n,anchorOffset:o}=t;if(n.nodeType!==n.ELEMENT_NODE)return;const r=n.childNodes[o];!r||r.nodeType!==r.ELEMENT_NODE||!r.hasAttribute(J0e)||t.collapseToStart()}const mRe=e=>t=>{const{ownerDocument:n}=t,{defaultView:o}=n;let r=!1;function s(d){if(r)return;let p;d&&(p=d.inputType);const{record:f,applyRecord:b,createRecord:h,handleChange:g}=e.current;if(p&&(p.indexOf("format")===0||bRe.has(p))){b(f.current);return}const z=h(),{start:A,activeFormats:_=[]}=f.current,v=fRe({value:z,start:A,end:z.start,formats:_});g(v)}function i(){const{record:d,applyRecord:p,createRecord:f,onSelectionChange:b}=e.current;if(t.contentEditable!=="true")return;if(n.activeElement!==t){n.removeEventListener("selectionchange",i);return}if(r)return;const{start:h,end:g,text:z}=f(),A=d.current;if(z!==A.text){s();return}if(h===A.start&&g===A.end){A.text.length===0&&h===0&&hRe(o);return}const _={...A,start:h,end:g,activeFormats:A._newActiveFormats,_newActiveFormats:void 0},v=ZN(_,cU);_.activeFormats=v,d.current=_,p(_,{domOnly:!0}),b(h,g)}function c(){r=!0,n.removeEventListener("selectionchange",i),t.querySelector(`[${J0e}]`)?.remove()}function l(){r=!1,s({inputType:"insertText"}),n.addEventListener("selectionchange",i)}function u(){const{record:d,isSelected:p,onSelectionChange:f,applyRecord:b}=e.current;t.parentElement.closest('[contenteditable="true"]')||(p?b(d.current,{domOnly:!0}):d.current={...d.current,start:void 0,end:void 0,activeFormats:cU},f(d.current.start,d.current.end),window.queueMicrotask(i),n.addEventListener("selectionchange",i))}return t.addEventListener("input",s),t.addEventListener("compositionstart",c),t.addEventListener("compositionend",l),t.addEventListener("focus",u),()=>{t.removeEventListener("input",s),t.removeEventListener("compositionstart",c),t.removeEventListener("compositionend",l),t.removeEventListener("focus",u)}},gRe=()=>e=>{const{ownerDocument:t}=e,{defaultView:n}=t,o=n?.getSelection();let r;function s(){return o.rangeCount?o.getRangeAt(0):null}function i(c){const l=c.type==="keydown"?"keyup":"pointerup";function u(){t.removeEventListener(l,d),t.removeEventListener("selectionchange",u),t.removeEventListener("input",u)}function d(){u(),!Z0e(r,s())&&t.dispatchEvent(new Event("selectionchange"))}t.addEventListener(l,d),t.addEventListener("selectionchange",u),t.addEventListener("input",u),r=s()}return e.addEventListener("pointerdown",i),e.addEventListener("keydown",i),()=>{e.removeEventListener("pointerdown",i),e.removeEventListener("keydown",i)}};function MRe(){return e=>{const{ownerDocument:t}=e,{defaultView:n}=t;let o=null;function r(i){i.defaultPrevented||i.target!==e&&i.target.contains(e)&&(o=e.getAttribute("contenteditable"),e.setAttribute("contenteditable","false"),n.getSelection().removeAllRanges())}function s(){o!==null&&(e.setAttribute("contenteditable",o),o=null)}return n.addEventListener("pointerdown",r),n.addEventListener("pointerup",s),()=>{n.removeEventListener("pointerdown",r),n.removeEventListener("pointerup",s)}}}const zRe=[lRe,uRe,dRe,pRe,mRe,gRe,MRe];function ORe(e){const t=x.useRef(e);x.useInsertionEffect(()=>{t.current=e});const n=x.useMemo(()=>zRe.map(o=>o(t)),[t]);return Mn(o=>{const r=n.map(s=>s(o));return()=>{r.forEach(s=>s())}},[n])}function e1e({value:e="",selectionStart:t,selectionEnd:n,placeholder:o,onSelectionChange:r,preserveWhiteSpace:s,onChange:i,__unstableDisableFormats:c,__unstableIsSelected:l,__unstableDependencies:u=[],__unstableAfterParse:d,__unstableBeforeSerialize:p,__unstableAddInvisibleFormats:f}){const b=Fn(),[,h]=x.useReducer(()=>({})),g=x.useRef();function z(){const{ownerDocument:{defaultView:T}}=g.current,E=T.getSelection(),B=E.rangeCount>0?E.getRangeAt(0):null;return eo({element:g.current,range:B,__unstableIsEditableTree:!0})}function A(T,{domOnly:E}={}){Yqe({value:T,current:g.current,prepareEditableTree:f,__unstableDomOnly:E,placeholder:o})}const _=x.useRef(e),v=x.useRef();function M(){_.current=e,v.current=e,e instanceof Xo||(v.current=e?Xo.fromHTMLString(e,{preserveWhiteSpace:s}):Xo.empty()),v.current={text:v.current.text,formats:v.current.formats,replacements:v.current.replacements},c&&(v.current.formats=Array(e.length),v.current.replacements=Array(e.length)),d&&(v.current.formats=d(v.current)),v.current.start=t,v.current.end=n}const y=x.useRef(!1);v.current?(t!==v.current.start||n!==v.current.end)&&(y.current=l,v.current={...v.current,start:t,end:n,activeFormats:void 0}):(y.current=l,M());function k(T){if(v.current=T,A(T),c)_.current=T.text;else{const I=p?p(T):T.formats;T={...T,formats:I},typeof e=="string"?_.current=T0({value:T,preserveWhiteSpace:s}):_.current=new Xo(T)}const{start:E,end:B,formats:N,text:j}=v.current;b.batch(()=>{r(E,B),i(_.current,{__unstableFormats:N,__unstableText:j})}),h()}function S(){M(),A(v.current)}const C=x.useRef(!1);x.useLayoutEffect(()=>{C.current&&e!==_.current&&(S(),h())},[e]),x.useLayoutEffect(()=>{y.current&&(g.current.ownerDocument.activeElement!==g.current&&g.current.focus(),A(v.current),y.current=!1)},[y.current]);const R=xn([g,aRe(),cRe({record:v}),ORe({record:v,handleChange:k,applyRecord:A,createRecord:z,isSelected:l,onSelectionChange:r,forceRender:h}),Mn(()=>{S(),C.current=!0},[o,...u])]);return{value:v.current,getValue:()=>v.current,onChange:k,ref:R}}const e1="id",yRe=["title","excerpt","content"],t1e=[{label:m("Base"),kind:"root",name:"__unstableBase",baseURL:"/",baseURLParams:{_fields:["description","gmt_offset","home","name","site_icon","site_icon_url","site_logo","timezone_string","default_template_part_areas","default_template_types","url"].join(",")},plural:"__unstableBases",syncConfig:{fetch:async()=>Tt({path:"/"}),applyChangesToDoc:(e,t)=>{const n=e.getMap("document");Object.entries(t).forEach(([o,r])=>{n.get(o)!==r&&n.set(o,r)})},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"root/base",getSyncObjectId:()=>"index"},{label:m("Post Type"),name:"postType",kind:"root",key:"slug",baseURL:"/wp/v2/types",baseURLParams:{context:"edit"},plural:"postTypes",syncConfig:{fetch:async e=>Tt({path:`/wp/v2/types/${e}?context=edit`}),applyChangesToDoc:(e,t)=>{const n=e.getMap("document");Object.entries(t).forEach(([o,r])=>{n.get(o)!==r&&n.set(o,r)})},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"root/postType",getSyncObjectId:e=>e},{name:"media",kind:"root",baseURL:"/wp/v2/media",baseURLParams:{context:"edit"},plural:"mediaItems",label:m("Media"),rawAttributes:["caption","title","description"],supportsPagination:!0},{name:"taxonomy",kind:"root",key:"slug",baseURL:"/wp/v2/taxonomies",baseURLParams:{context:"edit"},plural:"taxonomies",label:m("Taxonomy")},{name:"sidebar",kind:"root",baseURL:"/wp/v2/sidebars",baseURLParams:{context:"edit"},plural:"sidebars",transientEdits:{blocks:!0},label:m("Widget areas")},{name:"widget",kind:"root",baseURL:"/wp/v2/widgets",baseURLParams:{context:"edit"},plural:"widgets",transientEdits:{blocks:!0},label:m("Widgets")},{name:"widgetType",kind:"root",baseURL:"/wp/v2/widget-types",baseURLParams:{context:"edit"},plural:"widgetTypes",label:m("Widget types")},{label:m("User"),name:"user",kind:"root",baseURL:"/wp/v2/users",baseURLParams:{context:"edit"},plural:"users"},{name:"comment",kind:"root",baseURL:"/wp/v2/comments",baseURLParams:{context:"edit"},plural:"comments",label:m("Comment")},{name:"menu",kind:"root",baseURL:"/wp/v2/menus",baseURLParams:{context:"edit"},plural:"menus",label:m("Menu")},{name:"menuItem",kind:"root",baseURL:"/wp/v2/menu-items",baseURLParams:{context:"edit"},plural:"menuItems",label:m("Menu Item"),rawAttributes:["title"]},{name:"menuLocation",kind:"root",baseURL:"/wp/v2/menu-locations",baseURLParams:{context:"edit"},plural:"menuLocations",label:m("Menu Location"),key:"name"},{label:m("Global Styles"),name:"globalStyles",kind:"root",baseURL:"/wp/v2/global-styles",baseURLParams:{context:"edit"},plural:"globalStylesVariations",getTitle:e=>e?.title?.rendered||e?.title,getRevisionsUrl:(e,t)=>`/wp/v2/global-styles/${e}/revisions${t?"/"+t:""}`,supportsPagination:!0},{label:m("Themes"),name:"theme",kind:"root",baseURL:"/wp/v2/themes",baseURLParams:{context:"edit"},plural:"themes",key:"stylesheet"},{label:m("Plugins"),name:"plugin",kind:"root",baseURL:"/wp/v2/plugins",baseURLParams:{context:"edit"},plural:"plugins",key:"plugin"},{label:m("Status"),name:"status",kind:"root",baseURL:"/wp/v2/statuses",baseURLParams:{context:"edit"},plural:"statuses",key:"slug"}],n1e=[{kind:"postType",loadEntities:xRe},{kind:"taxonomy",loadEntities:wRe},{kind:"root",name:"site",plural:"sites",loadEntities:_Re}],ARe=(e,t)=>{const n={};return e?.status==="auto-draft"&&(!t.status&&!n.status&&(n.status="draft"),(!t.title||t.title==="Auto Draft")&&!n.title&&(!e?.title||e?.title==="Auto Draft")&&(n.title="")),n},kS=new WeakMap;function vRe(e){const t={...e};for(const[n,o]of Object.entries(e))o instanceof Xo&&(t[n]=o.valueOf());return t}function o1e(e){return e.map(t=>{const{innerBlocks:n,attributes:o,...r}=t;return{...r,attributes:vRe(o),innerBlocks:o1e(n)}})}async function xRe(){const e=await Tt({path:"/wp/v2/types?context=view"});return Object.entries(e??{}).map(([t,n])=>{var o;const r=["wp_template","wp_template_part"].includes(t),s=(o=n?.rest_namespace)!==null&&o!==void 0?o:"wp/v2";return{kind:"postType",baseURL:`/${s}/${n.rest_base}`,baseURLParams:{context:"edit"},name:t,label:n.name,transientEdits:{blocks:!0,selection:!0},mergedEdits:{meta:!0},rawAttributes:yRe,getTitle:i=>{var c;return i?.title?.rendered||i?.title||(r?Wre((c=i.slug)!==null&&c!==void 0?c:""):String(i.id))},__unstablePrePersist:r?void 0:ARe,__unstable_rest_base:n.rest_base,syncConfig:{fetch:async i=>Tt({path:`/${s}/${n.rest_base}/${i}?context=edit`}),applyChangesToDoc:(i,c)=>{const l=i.getMap("document");Object.entries(c).forEach(([u,d])=>{typeof d!="function"&&(u==="blocks"&&(kS.has(d)||kS.set(d,o1e(d)),d=kS.get(d)),l.get(u)!==d&&l.set(u,d))})},fromCRDTDoc:i=>i.getMap("document").toJSON()},syncObjectType:"postType/"+n.name,getSyncObjectId:i=>i,supportsPagination:!0,getRevisionsUrl:(i,c)=>`/${s}/${n.rest_base}/${i}/revisions${c?"/"+c:""}`,revisionKey:r?"wp_id":e1}})}async function wRe(){const e=await Tt({path:"/wp/v2/taxonomies?context=view"});return Object.entries(e??{}).map(([t,n])=>{var o;return{kind:"taxonomy",baseURL:`/${(o=n?.rest_namespace)!==null&&o!==void 0?o:"wp/v2"}/${n.rest_base}`,baseURLParams:{context:"edit"},name:t,label:n.name}})}async function _Re(){var e;const t={label:m("Site"),name:"site",kind:"root",baseURL:"/wp/v2/settings",syncConfig:{fetch:async()=>Tt({path:"/wp/v2/settings"}),applyChangesToDoc:(r,s)=>{const i=r.getMap("document");Object.entries(s).forEach(([c,l])=>{i.get(c)!==l&&i.set(c,l)})},fromCRDTDoc:r=>r.getMap("document").toJSON()},syncObjectType:"root/site",getSyncObjectId:()=>"index",meta:{}},n=await Tt({path:t.baseURL,method:"OPTIONS"}),o={};return Object.entries((e=n?.schema?.properties)!==null&&e!==void 0?e:{}).forEach(([r,s])=>{typeof s=="object"&&s.title&&(o[r]=s.title)}),[{...t,meta:{labels:o}}]}const J2=(e,t,n="get")=>{const o=e==="root"?"":w4(e),r=w4(t);return`${n}${o}${r}`};function r1e(e){const{query:t}=e;return t?jh(t).context:"default"}function kRe(e,t,n,o){var r;if(n===1&&o===-1)return t;const i=(n-1)*o,c=Math.max((r=e?.length)!==null&&r!==void 0?r:0,i+t.length),l=new Array(c);for(let u=0;u=i&&u!t.some(o=>Number.isInteger(o)?o===+n:o===n)))}function SRe(e={},t){switch(t.type){case"RECEIVE_ITEMS":{const n=r1e(t),o=t.key||e1;return{...e,[n]:{...e[n],...t.items.reduce((r,s)=>{const i=s?.[o];return r[i]=oqe(e?.[n]?.[i],s),r},{})}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(e).map(([n,o])=>[n,s1e(o,t.itemIds)]))}return e}function CRe(e={},t){switch(t.type){case"RECEIVE_ITEMS":{const n=r1e(t),{query:o,key:r=e1}=t,s=o?jh(o):{},i=!o||!Array.isArray(s.fields);return{...e,[n]:{...e[n],...t.items.reduce((c,l)=>{const u=l?.[r];return c[u]=e?.[n]?.[u]||i,c},{})}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(e).map(([n,o])=>[n,s1e(o,t.itemIds)]))}return e}const qRe=Co([L0e(e=>"query"in e),P0e(e=>e.query?{...e,...jh(e.query)}:e),JH("context"),JH("stableKey")])((e={},t)=>{const{type:n,page:o,perPage:r,key:s=e1}=t;return n!=="RECEIVE_ITEMS"?e:{itemIds:kRe(e?.itemIds||[],t.items.map(i=>i?.[s]).filter(Boolean),o,r),meta:t.meta}}),RRe=(e={},t)=>{switch(t.type){case"RECEIVE_ITEMS":return qRe(e,t);case"REMOVE_ITEMS":const n=t.itemIds.reduce((o,r)=>(o[r]=!0,o),{});return Object.fromEntries(Object.entries(e).map(([o,r])=>[o,Object.fromEntries(Object.entries(r).map(([s,i])=>[s,{...i,itemIds:i.itemIds.filter(c=>!n[c])}]))]));default:return e}},lU=J0({items:SRe,itemIsComplete:CRe,queries:RRe});function TRe(e={},t){switch(t.type){case"RECEIVE_TERMS":return{...e,[t.taxonomy]:t.terms}}return e}function ERe(e={byId:{},queries:{}},t){switch(t.type){case"RECEIVE_USER_QUERY":return{byId:{...e.byId,...t.users.reduce((n,o)=>({...n,[o.id]:o}),{})},queries:{...e.queries,[t.queryID]:t.users.map(n=>n.id)}}}return e}function WRe(e={},t){switch(t.type){case"RECEIVE_CURRENT_USER":return t.currentUser}return e}function NRe(e=[],t){switch(t.type){case"RECEIVE_TAXONOMIES":return t.taxonomies}return e}function BRe(e=void 0,t){switch(t.type){case"RECEIVE_CURRENT_THEME":return t.currentTheme.stylesheet}return e}function LRe(e=void 0,t){switch(t.type){case"RECEIVE_CURRENT_GLOBAL_STYLES_ID":return t.id}return e}function PRe(e={},t){switch(t.type){case"RECEIVE_THEME_GLOBAL_STYLES":return{...e,[t.stylesheet]:t.globalStyles}}return e}function jRe(e={},t){switch(t.type){case"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS":return{...e,[t.stylesheet]:t.variations}}return e}const IRe=e=>(t,n)=>{if(n.type==="UNDO"||n.type==="REDO"){const{record:o}=n;let r=t;return o.forEach(({id:{kind:s,name:i,recordId:c},changes:l})=>{r=e(r,{type:"EDIT_ENTITY_RECORD",kind:s,name:i,recordId:c,edits:Object.entries(l).reduce((u,[d,p])=>(u[d]=n.type==="UNDO"?p.from:p.to,u),{})})}),r}return e(t,n)};function DRe(e){return Co([IRe,L0e(t=>t.name&&t.kind&&t.name===e.name&&t.kind===e.kind),P0e(t=>({key:e.key||e1,...t}))])(J0({queriedData:lU,edits:(t={},n)=>{var o;switch(n.type){case"RECEIVE_ITEMS":if(((o=n?.query?.context)!==null&&o!==void 0?o:"default")!=="default")return t;const s={...t};for(const c of n.items){const l=c?.[n.key],u=s[l];if(!u)continue;const d=Object.keys(u).reduce((p,f)=>{var b;return!N0(u[f],(b=c[f]?.raw)!==null&&b!==void 0?b:c[f])&&(!n.persistedEdits||!N0(u[f],n.persistedEdits[f]))&&(p[f]=u[f]),p},{});Object.keys(d).length?s[l]=d:delete s[l]}return s;case"EDIT_ENTITY_RECORD":const i={...t[n.recordId],...n.edits};return Object.keys(i).forEach(c=>{i[c]===void 0&&delete i[c]}),{...t,[n.recordId]:i}}return t},saving:(t={},n)=>{switch(n.type){case"SAVE_ENTITY_RECORD_START":case"SAVE_ENTITY_RECORD_FINISH":return{...t,[n.recordId]:{pending:n.type==="SAVE_ENTITY_RECORD_START",error:n.error,isAutosave:n.isAutosave}}}return t},deleting:(t={},n)=>{switch(n.type){case"DELETE_ENTITY_RECORD_START":case"DELETE_ENTITY_RECORD_FINISH":return{...t,[n.recordId]:{pending:n.type==="DELETE_ENTITY_RECORD_START",error:n.error}}}return t},revisions:(t={},n)=>{if(n.type==="RECEIVE_ITEM_REVISIONS"){const o=n.recordKey;delete n.recordKey;const r=lU(t[o],{...n,type:"RECEIVE_ITEMS"});return{...t,[o]:r}}return n.type==="REMOVE_ITEMS"?Object.fromEntries(Object.entries(t).filter(([o])=>!n.itemIds.some(r=>Number.isInteger(r)?r===+o:r===o))):t}}))}function FRe(e=t1e,t){switch(t.type){case"ADD_ENTITIES":return[...e,...t.entities]}return e}const $Re=(e={},t)=>{const n=FRe(e.config,t);let o=e.reducer;if(!o||n!==e.config){const s=n.reduce((i,c)=>{const{kind:l}=c;return i[l]||(i[l]=[]),i[l].push(c),i},{});o=J0(Object.entries(s).reduce((i,[c,l])=>{const u=J0(l.reduce((d,p)=>({...d,[p.name]:DRe(p)}),{}));return i[c]=u,i},{}))}const r=o(e.records,t);return r===e.records&&n===e.config&&o===e.reducer?e:{reducer:o,records:r,config:n}};function VRe(e=VSe()){return e}function HRe(e={},t){switch(t.type){case"EDIT_ENTITY_RECORD":case"UNDO":case"REDO":return{}}return e}function URe(e={},t){switch(t.type){case"RECEIVE_EMBED_PREVIEW":const{url:n,preview:o}=t;return{...e,[n]:o}}return e}function XRe(e={},t){switch(t.type){case"RECEIVE_USER_PERMISSION":return{...e,[t.key]:t.isAllowed};case"RECEIVE_USER_PERMISSIONS":return{...e,...t.permissions}}return e}function GRe(e={},t){switch(t.type){case"RECEIVE_AUTOSAVES":const{postId:n,autosaves:o}=t;return{...e,[n]:o}}return e}function KRe(e=[],t){switch(t.type){case"RECEIVE_BLOCK_PATTERNS":return t.patterns}return e}function YRe(e=[],t){switch(t.type){case"RECEIVE_BLOCK_PATTERN_CATEGORIES":return t.categories}return e}function ZRe(e=[],t){switch(t.type){case"RECEIVE_USER_PATTERN_CATEGORIES":return t.patternCategories}return e}function QRe(e=null,t){switch(t.type){case"RECEIVE_NAVIGATION_FALLBACK_ID":return t.fallbackId}return e}function JRe(e={},t){switch(t.type){case"RECEIVE_THEME_GLOBAL_STYLE_REVISIONS":return{...e,[t.currentId]:t.revisions}}return e}function eTe(e={},t){switch(t.type){case"RECEIVE_DEFAULT_TEMPLATE":return{...e,[JSON.stringify(t.query)]:t.templateId}}return e}function tTe(e={},t){switch(t.type){case"RECEIVE_REGISTERED_POST_META":return{...e,[t.postType]:t.registeredPostMeta}}return e}const nTe=J0({terms:TRe,users:ERe,currentTheme:BRe,currentGlobalStylesId:LRe,currentUser:WRe,themeGlobalStyleVariations:jRe,themeBaseGlobalStyles:PRe,themeGlobalStyleRevisions:JRe,taxonomies:NRe,entities:$Re,editsReference:HRe,undoManager:VRe,embedPreviews:URe,userPermissions:XRe,autosaves:GRe,blockPatterns:KRe,blockPatternCategories:YRe,userPatternCategories:ZRe,navigationFallbackId:QRe,defaultTemplates:eTe,registeredPostMeta:tTe}),No="core",oTe={},rTe=At(e=>(t,n)=>e(No).isResolving("getEmbedPreview",[n]));function sTe(e,t){Ke("select( 'core' ).getAuthors()",{since:"5.9",alternative:"select( 'core' ).getUsers({ who: 'authors' })"});const n=tn("/wp/v2/users/?who=authors&per_page=100",t);return i1e(e,n)}function iTe(e){return e.currentUser}const i1e=It((e,t)=>{var n;return((n=e.users.queries[t])!==null&&n!==void 0?n:[]).map(r=>e.users.byId[r])},(e,t)=>[e.users.queries[t],e.users.byId]);function aTe(e,t){return Ke("wp.data.select( 'core' ).getEntitiesByKind()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntitiesConfig()"}),a1e(e,t)}const a1e=It((e,t)=>e.entities.config.filter(n=>n.kind===t),(e,t)=>e.entities.config);function cTe(e,t,n){return Ke("wp.data.select( 'core' ).getEntity()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntityConfig()"}),Dh(e,t,n)}function Dh(e,t,n){return e.entities.config?.find(o=>o.kind===t&&o.name===n)}const Zd=It((e,t,n,o,r)=>{var s;const i=e.entities.records?.[t]?.[n]?.queriedData;if(!i)return;const c=(s=r?.context)!==null&&s!==void 0?s:"default";if(r===void 0)return i.itemIsComplete[c]?.[o]?i.items[c][o]:void 0;const l=i.items[c]?.[o];if(l&&r._fields){var u;const d={},p=(u=Md(r._fields))!==null&&u!==void 0?u:[];for(let f=0;f{h=h?.[g]}),E5(d,b,h)}return d}return l},(e,t,n,o,r)=>{var s;const i=(s=r?.context)!==null&&s!==void 0?s:"default";return[e.entities.records?.[t]?.[n]?.queriedData?.items[i]?.[o],e.entities.records?.[t]?.[n]?.queriedData?.itemIsComplete[i]?.[o]]});Zd.__unstableNormalizeArgs=e=>{const t=[...e],n=t?.[2];return t[2]=aqe(n)?Number(n):n,t};function lTe(e,t,n,o){return Zd(e,t,n,o)}const c1e=It((e,t,n,o)=>{const r=Zd(e,t,n,o);return r&&Object.keys(r).reduce((s,i)=>{if(sqe(Dh(e,t,n),i)){var c;s[i]=(c=r[i]?.raw)!==null&&c!==void 0?c:r[i]}else s[i]=r[i];return s},{})},(e,t,n,o,r)=>{var s;const i=(s=r?.context)!==null&&s!==void 0?s:"default";return[e.entities.config,e.entities.records?.[t]?.[n]?.queriedData?.items[i]?.[o],e.entities.records?.[t]?.[n]?.queriedData?.itemIsComplete[i]?.[o]]});function uTe(e,t,n,o){return Array.isArray(eB(e,t,n,o))}const eB=(e,t,n,o)=>{const r=e.entities.records?.[t]?.[n]?.queriedData;return r?D0e(r,o):null},dTe=(e,t,n,o)=>{const r=e.entities.records?.[t]?.[n]?.queriedData;return r?F0e(r,o):null},pTe=(e,t,n,o)=>{const r=e.entities.records?.[t]?.[n]?.queriedData;if(!r)return null;if(o.per_page===-1)return 1;const s=F0e(r,o);return s&&(o.per_page?Math.ceil(s/o.per_page):pqe(r,o))},fTe=It(e=>{const{entities:{records:t}}=e,n=[];return Object.keys(t).forEach(o=>{Object.keys(t[o]).forEach(r=>{const s=Object.keys(t[o][r].edits).filter(i=>Zd(e,o,r,i)&&u1e(e,o,r,i));if(s.length){const i=Dh(e,o,r);s.forEach(c=>{const l=nB(e,o,r,c);n.push({key:l?l[i.key||e1]:void 0,title:i?.getTitle?.(l)||"",name:r,kind:o})})}})}),n},e=>[e.entities.records]),bTe=It(e=>{const{entities:{records:t}}=e,n=[];return Object.keys(t).forEach(o=>{Object.keys(t[o]).forEach(r=>{const s=Object.keys(t[o][r].saving).filter(i=>oB(e,o,r,i));if(s.length){const i=Dh(e,o,r);s.forEach(c=>{const l=nB(e,o,r,c);n.push({key:l?l[i.key||e1]:void 0,title:i?.getTitle?.(l)||"",name:r,kind:o})})}})}),n},e=>[e.entities.records]);function tB(e,t,n,o){return e.entities.records?.[t]?.[n]?.edits?.[o]}const l1e=It((e,t,n,o)=>{const{transientEdits:r}=Dh(e,t,n)||{},s=tB(e,t,n,o)||{};return r?Object.keys(s).reduce((i,c)=>(r[c]||(i[c]=s[c]),i),{}):s},(e,t,n,o)=>[e.entities.config,e.entities.records?.[t]?.[n]?.edits?.[o]]);function u1e(e,t,n,o){return oB(e,t,n,o)||Object.keys(l1e(e,t,n,o)).length>0}const nB=It((e,t,n,o)=>{const r=c1e(e,t,n,o),s=tB(e,t,n,o);return!r&&!s?!1:{...r,...s}},(e,t,n,o,r)=>{var s;const i=(s=r?.context)!==null&&s!==void 0?s:"default";return[e.entities.config,e.entities.records?.[t]?.[n]?.queriedData.items[i]?.[o],e.entities.records?.[t]?.[n]?.queriedData.itemIsComplete[i]?.[o],e.entities.records?.[t]?.[n]?.edits?.[o]]});function hTe(e,t,n,o){var r;const{pending:s,isAutosave:i}=(r=e.entities.records?.[t]?.[n]?.saving?.[o])!==null&&r!==void 0?r:{};return!!(s&&i)}function oB(e,t,n,o){var r;return(r=e.entities.records?.[t]?.[n]?.saving?.[o]?.pending)!==null&&r!==void 0?r:!1}function mTe(e,t,n,o){var r;return(r=e.entities.records?.[t]?.[n]?.deleting?.[o]?.pending)!==null&&r!==void 0?r:!1}function gTe(e,t,n,o){return e.entities.records?.[t]?.[n]?.saving?.[o]?.error}function MTe(e,t,n,o){return e.entities.records?.[t]?.[n]?.deleting?.[o]?.error}function zTe(e){Ke("select( 'core' ).getUndoEdit()",{since:"6.3"})}function OTe(e){Ke("select( 'core' ).getRedoEdit()",{since:"6.3"})}function yTe(e){return e.undoManager.hasUndo()}function ATe(e){return e.undoManager.hasRedo()}function N5(e){return e.currentTheme?Zd(e,"root","theme",e.currentTheme):null}function d1e(e){return e.currentGlobalStylesId}function vTe(e){var t;return(t=N5(e)?.theme_supports)!==null&&t!==void 0?t:oTe}function xTe(e,t){return e.embedPreviews[t]}function wTe(e,t){const n=e.embedPreviews[t],o=''+t+"";return n?n.html===o:!1}function rB(e,t,n,o){if(typeof n=="object"&&(!n.kind||!n.name))return!1;const s=W5(t,n,o);return e.userPermissions[s]}function _Te(e,t,n,o){return Ke("wp.data.select( 'core' ).canUserEditEntityRecord()",{since:"6.7",alternative:"wp.data.select( 'core' ).canUser( 'update', { kind, name, id } )"}),rB(e,"update",{kind:t,name:n,id:o})}function kTe(e,t,n){return e.autosaves[n]}function STe(e,t,n,o){return o===void 0?void 0:e.autosaves[n]?.find(s=>s.author===o)}const CTe=At(e=>(t,n,o)=>e(No).hasFinishedResolution("getAutosaves",[n,o]));function qTe(e){return e.editsReference}function RTe(e){const t=N5(e);return t?e.themeBaseGlobalStyles[t.stylesheet]:null}function TTe(e){const t=N5(e);return t?e.themeGlobalStyleVariations[t.stylesheet]:null}function ETe(e){return e.blockPatterns}function WTe(e){return e.blockPatternCategories}function NTe(e){return e.userPatternCategories}function BTe(e){Ke("select( 'core' ).getCurrentThemeGlobalStylesRevisions()",{since:"6.5.0",alternative:"select( 'core' ).getRevisions( 'root', 'globalStyles', ${ recordKey } )"});const t=d1e(e);return t?e.themeGlobalStyleRevisions[t]:null}function p1e(e,t){return e.defaultTemplates[JSON.stringify(t)]}const LTe=(e,t,n,o,r)=>{const s=e.entities.records?.[t]?.[n]?.revisions?.[o];return s?D0e(s,r):null},PTe=It((e,t,n,o,r,s)=>{var i;const c=e.entities.records?.[t]?.[n]?.revisions?.[o];if(!c)return;const l=(i=s?.context)!==null&&i!==void 0?i:"default";if(s===void 0)return c.itemIsComplete[l]?.[r]?c.items[l][r]:void 0;const u=c.items[l]?.[r];if(u&&s._fields){var d;const p={},f=(d=Md(s._fields))!==null&&d!==void 0?d:[];for(let b=0;b{g=g?.[z]}),E5(p,h,g)}return p}return u},(e,t,n,o,r,s)=>{var i;const c=(i=s?.context)!==null&&i!==void 0?i:"default";return[e.entities.records?.[t]?.[n]?.revisions?.[o]?.items?.[c]?.[r],e.entities.records?.[t]?.[n]?.revisions?.[o]?.itemIsComplete?.[c]?.[r]]}),jTe=Object.freeze(Object.defineProperty({__proto__:null,__experimentalGetCurrentGlobalStylesId:d1e,__experimentalGetCurrentThemeBaseGlobalStyles:RTe,__experimentalGetCurrentThemeGlobalStylesVariations:TTe,__experimentalGetDirtyEntityRecords:fTe,__experimentalGetEntitiesBeingSaved:bTe,__experimentalGetEntityRecordNoResolver:lTe,canUser:rB,canUserEditEntityRecord:_Te,getAuthors:sTe,getAutosave:STe,getAutosaves:kTe,getBlockPatternCategories:WTe,getBlockPatterns:ETe,getCurrentTheme:N5,getCurrentThemeGlobalStylesRevisions:BTe,getCurrentUser:iTe,getDefaultTemplateId:p1e,getEditedEntityRecord:nB,getEmbedPreview:xTe,getEntitiesByKind:aTe,getEntitiesConfig:a1e,getEntity:cTe,getEntityConfig:Dh,getEntityRecord:Zd,getEntityRecordEdits:tB,getEntityRecordNonTransientEdits:l1e,getEntityRecords:eB,getEntityRecordsTotalItems:dTe,getEntityRecordsTotalPages:pTe,getLastEntityDeleteError:MTe,getLastEntitySaveError:gTe,getRawEntityRecord:c1e,getRedoEdit:OTe,getReferenceByDistinctEdits:qTe,getRevision:PTe,getRevisions:LTe,getThemeSupports:vTe,getUndoEdit:zTe,getUserPatternCategories:NTe,getUserQueryResults:i1e,hasEditsForEntityRecord:u1e,hasEntityRecords:uTe,hasFetchedAutosaves:CTe,hasRedo:ATe,hasUndo:yTe,isAutosavingEntityRecord:hTe,isDeletingEntityRecord:mTe,isPreviewEmbedFallback:wTe,isRequestingEmbedPreview:rTe,isSavingEntityRecord:oB},Symbol.toStringTag,{value:"Module"})),{lock:ITe,unlock:eh}=P0("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/core-data");function DTe(e){return e.undoManager}function FTe(e){return e.navigationFallbackId}const $Te=At(e=>It((t,n)=>e(No).getBlockPatterns().filter(({postTypes:o})=>!o||Array.isArray(o)&&o.includes(n)),()=>[e(No).getBlockPatterns()])),f1e=At(e=>It((t,n,o,r)=>(Array.isArray(r)?r:[r]).map(i=>({delete:e(No).canUser("delete",{kind:n,name:o,id:i}),update:e(No).canUser("update",{kind:n,name:o,id:i})})),t=>[t.userPermissions]));function VTe(e,t,n,o){return f1e(e,t,n,o)[0]}function HTe(e,t){var n;return(n=e.registeredPostMeta?.[t])!==null&&n!==void 0?n:{}}function b1e(e){return!e||!["number","string"].includes(typeof e)||Number(e)===0?null:e.toString()}const UTe=At(e=>It(()=>{if(!e(No).canUser("read",{kind:"root",name:"site"}))return null;const n=e(No).getEntityRecord("root","site");if(!n)return null;const o=n?.show_on_front==="page"?b1e(n.page_on_front):null;return o?{postType:"page",postId:o}:{postType:"wp_template",postId:e(No).getDefaultTemplateId({slug:"front-page"})}},t=>[rB(t,"read",{kind:"root",name:"site"})&&Zd(t,"root","site"),p1e(t,{slug:"front-page"})])),XTe=At(e=>()=>{if(!e(No).canUser("read",{kind:"root",name:"site"}))return null;const n=e(No).getEntityRecord("root","site");return n?.show_on_front==="page"?b1e(n.page_for_posts):null}),GTe=At(e=>(t,n,o)=>{const r=eh(e(No)).getHomePage();if(!r)return;if(n==="page"&&n===r?.postType&&o.toString()===r?.postId){const u=e(No).getEntityRecords("postType","wp_template",{per_page:-1});if(!u)return;const d=u.find(({slug:p})=>p==="front-page")?.id;if(d)return d}const s=e(No).getEditedEntityRecord("postType",n,o);if(!s)return;const i=eh(e(No)).getPostsPageId();if(n==="page"&&i===o.toString())return e(No).getDefaultTemplateId({slug:"home"});const c=s.template;if(c){const u=e(No).getEntityRecords("postType","wp_template",{per_page:-1})?.find(({slug:d})=>d===c);if(u)return u.id}let l;return s.slug?l=n==="page"?`${n}-${s.slug}`:`single-${n}-${s.slug}`:l=n==="page"?"page":`single-${n}`,e(No).getDefaultTemplateId({slug:l})}),KTe=Object.freeze(Object.defineProperty({__proto__:null,getBlockPatternsForPostType:$Te,getEntityRecordPermissions:VTe,getEntityRecordsPermissions:f1e,getHomePage:UTe,getNavigationFallbackId:FTe,getPostsPageId:XTe,getRegisteredPostMeta:HTe,getTemplateId:GTe,getUndoManager:DTe},Symbol.toStringTag,{value:"Module"}));let dA;const YTe=new Uint8Array(16);function ZTe(){if(!dA&&(dA=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!dA))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return dA(YTe)}const $0=[];for(let e=0;e<256;++e)$0.push((e+256).toString(16).slice(1));function QTe(e,t=0){return $0[e[t+0]]+$0[e[t+1]]+$0[e[t+2]]+$0[e[t+3]]+"-"+$0[e[t+4]]+$0[e[t+5]]+"-"+$0[e[t+6]]+$0[e[t+7]]+"-"+$0[e[t+8]]+$0[e[t+9]]+"-"+$0[e[t+10]]+$0[e[t+11]]+$0[e[t+12]]+$0[e[t+13]]+$0[e[t+14]]+$0[e[t+15]]}const JTe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),uU={randomUUID:JTe};function Is(e,t,n){if(uU.randomUUID&&!t&&!e)return uU.randomUUID();e=e||{};const o=e.random||(e.rng||ZTe)();return o[6]=o[6]&15|64,o[8]=o[8]&63|128,QTe(o)}let SS=null;function eEe(e,t){const n=[...e],o=[];for(;n.length;)o.push(n.splice(0,t));return o}async function tEe(e){SS===null&&(SS=(await Tt({path:"/batch/v1",method:"OPTIONS"})).endpoints[0].args.requests.maxItems);const t=[];for(const n of eEe(e,SS)){const o=await Tt({path:"/batch/v1",method:"POST",data:{validation:"require-all-validate",requests:n.map(s=>({path:s.path,body:s.data,method:s.method,headers:s.headers}))}});let r;o.failed?r=o.responses.map(s=>({error:s?.body})):r=o.responses.map(s=>{const i={};return s.status>=200&&s.status<300?i.output=s.body:i.error=s.body,i}),t.push(...r)}return t}function nEe(e=tEe){let t=0,n=[];const o=new oEe;return{add(r){const s=++t;o.add(s);const i=c=>new Promise((l,u)=>{n.push({input:c,resolve:l,reject:u}),o.delete(s)});return typeof r=="function"?Promise.resolve(r(i)).finally(()=>{o.delete(s)}):i(r)},async run(){o.size&&await new Promise(i=>{const c=o.subscribe(()=>{o.size||(c(),i(void 0))})});let r;try{if(r=await e(n.map(({input:i})=>i)),r.length!==n.length)throw new Error("run: Array returned by processor must be same size as input array.")}catch(i){for(const{reject:c}of n)c(i);throw i}let s=!0;return r.forEach((i,c)=>{const l=n[c];if(i?.error)l?.reject(i.error),s=!1;else{var u;l?.resolve((u=i?.output)!==null&&u!==void 0?u:i)}}),n=[],s}}}class oEe{constructor(...t){this.set=new Set(...t),this.subscribers=new Set}get size(){return this.set.size}add(t){return this.set.add(t),this.subscribers.forEach(n=>n()),this}delete(t){const n=this.set.delete(t);return this.subscribers.forEach(o=>o()),n}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}}const dU=globalThis||void 0||self,fs=()=>new Map,kE=e=>{const t=fs();return e.forEach((n,o)=>{t.set(o,n)}),t},_1=(e,t,n)=>{let o=e.get(t);return o===void 0&&e.set(t,o=n()),o},rEe=(e,t)=>{const n=[];for(const[o,r]of e)n.push(t(r,o));return n},sEe=(e,t)=>{for(const[n,o]of e)if(t(o,n))return!0;return!1},zd=()=>new Set,CS=e=>e[e.length-1],iEe=(e,t)=>{for(let n=0;n{this.off(t,o),n(...r)};this.on(t,o)}off(t,n){const o=this._observers.get(t);o!==void 0&&(o.delete(n),o.size===0&&this._observers.delete(t))}emit(t,n){return Rl((this._observers.get(t)||fs()).values()).forEach(o=>o(...n))}destroy(){this._observers=fs()}}class d3{constructor(){this._observers=fs()}on(t,n){_1(this._observers,t,zd).add(n)}once(t,n){const o=(...r)=>{this.off(t,o),n(...r)};this.on(t,o)}off(t,n){const o=this._observers.get(t);o!==void 0&&(o.delete(n),o.size===0&&this._observers.delete(t))}emit(t,n){return Rl((this._observers.get(t)||fs()).values()).forEach(o=>o(...n))}destroy(){this._observers=fs()}}const Oc=Math.floor,Nv=Math.abs,lEe=Math.log10,sB=(e,t)=>ee>t?e:t,h1e=e=>e!==0?e<0:1/e<0,pU=1,fU=2,qS=4,RS=8,VM=32,Ol=64,Ns=128,B5=31,SE=63,ef=127,uEe=2147483647,m1e=Number.MAX_SAFE_INTEGER,dEe=Number.isInteger||(e=>typeof e=="number"&&isFinite(e)&&Oc(e)===e),pEe=String.fromCharCode,fEe=e=>e.toLowerCase(),bEe=/^\s*/g,hEe=e=>e.replace(bEe,""),mEe=/([A-Z])/g,bU=(e,t)=>hEe(e.replace(mEe,n=>`${t}${fEe(n)}`)),gEe=e=>{const t=unescape(encodeURIComponent(e)),n=t.length,o=new Uint8Array(n);for(let r=0;rHM.encode(e),CE=HM?MEe:gEe;let OM=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});OM&&OM.decode(new Uint8Array).length===1&&(OM=null);class p3{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const k0=()=>new p3,zEe=e=>{let t=e.cpos;for(let n=0;n{const t=new Uint8Array(zEe(e));let n=0;for(let o=0;o{const n=e.cbuf.length;n-e.cpos{const n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},UM=x0,sn=(e,t)=>{for(;t>ef;)x0(e,Ns|ef&t),t=Oc(t/128);x0(e,ef&t)},iB=(e,t)=>{const n=h1e(t);for(n&&(t=-t),x0(e,(t>SE?Ns:0)|(n?Ol:0)|SE&t),t=Oc(t/64);t>0;)x0(e,(t>ef?Ns:0)|ef&t),t=Oc(t/128)},qE=new Uint8Array(3e4),yEe=qE.length/3,AEe=(e,t)=>{if(t.length{const n=unescape(encodeURIComponent(t)),o=n.length;sn(e,o);for(let r=0;r{const n=e.cbuf.length,o=e.cpos,r=sB(n-o,t.length),s=t.length-r;e.cbuf.set(t.subarray(0,r),o),e.cpos+=r,s>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array($f(n*2,s)),e.cbuf.set(t.subarray(r)),e.cpos=s)},jr=(e,t)=>{sn(e,t.byteLength),L5(e,t)},aB=(e,t)=>{OEe(e,t);const n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},xEe=(e,t)=>aB(e,4).setFloat32(0,t,!1),wEe=(e,t)=>aB(e,8).setFloat64(0,t,!1),_Ee=(e,t)=>aB(e,8).setBigInt64(0,t,!1),hU=new DataView(new ArrayBuffer(4)),kEe=e=>(hU.setFloat32(0,e),hU.getFloat32(0)===e),th=(e,t)=>{switch(typeof t){case"string":x0(e,119),uc(e,t);break;case"number":dEe(t)&&Nv(t)<=uEe?(x0(e,125),iB(e,t)):kEe(t)?(x0(e,124),xEe(e,t)):(x0(e,123),wEe(e,t));break;case"bigint":x0(e,122),_Ee(e,t);break;case"object":if(t===null)x0(e,126);else if(aEe(t)){x0(e,117),sn(e,t.length);for(let n=0;n0&&sn(this,this.count-1),this.count=1,this.w(this,t),this.s=t)}}const gU=e=>{e.count>0&&(iB(e.encoder,e.count===1?e.s:-e.s),e.count>1&&sn(e.encoder,e.count-2))};class Bv{constructor(){this.encoder=new p3,this.s=0,this.count=0}write(t){this.s===t?this.count++:(gU(this),this.count=1,this.s=t)}toUint8Array(){return gU(this),Sr(this.encoder)}}const MU=e=>{if(e.count>0){const t=e.diff*2+(e.count===1?0:1);iB(e.encoder,t),e.count>1&&sn(e.encoder,e.count-2)}};class TS{constructor(){this.encoder=new p3,this.s=0,this.count=0,this.diff=0}write(t){this.diff===t-this.s?(this.s=t,this.count++):(MU(this),this.count=1,this.diff=t-this.s,this.s=t)}toUint8Array(){return MU(this),Sr(this.encoder)}}class SEe{constructor(){this.sarr=[],this.s="",this.lensE=new Bv}write(t){this.s+=t,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(t.length)}toUint8Array(){const t=new p3;return this.sarr.push(this.s),this.s="",uc(t,this.sarr.join("")),L5(t,this.lensE.toUint8Array()),Sr(t)}}const fa=e=>new Error(e),dc=()=>{throw fa("Method unimplemented")},yc=()=>{throw fa("Unexpected case")},g1e=fa("Unexpected end of array"),M1e=fa("Integer out of Range");class P5{constructor(t){this.arr=t,this.pos=0}}const Rc=e=>new P5(e),CEe=e=>e.pos!==e.arr.length,qEe=(e,t)=>{const n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},w0=e=>qEe(e,_n(e)),ff=e=>e.arr[e.pos++],_n=e=>{let t=0,n=1;const o=e.arr.length;for(;e.posm1e)throw M1e}throw g1e},cB=e=>{let t=e.arr[e.pos++],n=t&SE,o=64;const r=(t&Ol)>0?-1:1;if(!(t&Ns))return r*n;const s=e.arr.length;for(;e.posm1e)throw M1e}throw g1e},REe=e=>{let t=_n(e);if(t===0)return"";{let n=String.fromCodePoint(ff(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(ff(e));else for(;t>0;){const o=t<1e4?t:1e4,r=e.arr.subarray(e.pos,e.pos+o);e.pos+=o,n+=String.fromCodePoint.apply(null,r),t-=o}return decodeURIComponent(escape(n))}},TEe=e=>OM.decode(w0(e)),yl=OM?TEe:REe,lB=(e,t)=>{const n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n},EEe=e=>lB(e,4).getFloat32(0,!1),WEe=e=>lB(e,8).getFloat64(0,!1),NEe=e=>lB(e,8).getBigInt64(0,!1),BEe=[e=>{},e=>null,cB,EEe,WEe,NEe,e=>!1,e=>!0,yl,e=>{const t=_n(e),n={};for(let o=0;o{const t=_n(e),n=[];for(let o=0;oBEe[127-ff(e)](e);class zU extends P5{constructor(t,n){super(t),this.reader=n,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),CEe(this)?this.count=_n(this)+1:this.count=-1),this.count--,this.s}}class Lv extends P5{constructor(t){super(t),this.s=0,this.count=0}read(){if(this.count===0){this.s=cB(this);const t=h1e(this.s);this.count=1,t&&(this.s=-this.s,this.count=_n(this)+2)}return this.count--,this.s}}class ES extends P5{constructor(t){super(t),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){const t=cB(this),n=t&1;this.diff=Oc(t/2),this.count=1,n&&(this.count=_n(this)+2)}return this.s+=this.diff,this.count--,this.s}}class LEe{constructor(t){this.decoder=new Lv(t),this.str=yl(this.decoder),this.spos=0}read(){const t=this.spos+this.decoder.read(),n=this.str.slice(this.spos,t);return this.spos=t,n}}const PEe=crypto.getRandomValues.bind(crypto),jEe=Math.random,z1e=()=>PEe(new Uint32Array(1))[0],IEe="10000000-1000-4000-8000"+-1e11,O1e=()=>IEe.replace(/[018]/g,e=>(e^z1e()&15>>e/4).toString(16)),Tl=Date.now,oh=e=>new Promise(e);Promise.all.bind(Promise);const DEe=e=>Promise.reject(e),uB=e=>Promise.resolve(e);var y1e={},j5={};j5.byteLength=VEe;j5.toByteArray=UEe;j5.fromByteArray=KEe;var rc=[],fi=[],FEe=typeof Uint8Array<"u"?Uint8Array:Array,WS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Fb=0,$Ee=WS.length;Fb<$Ee;++Fb)rc[Fb]=WS[Fb],fi[WS.charCodeAt(Fb)]=Fb;fi[45]=62;fi[95]=63;function A1e(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var o=n===t?0:4-n%4;return[n,o]}function VEe(e){var t=A1e(e),n=t[0],o=t[1];return(n+o)*3/4-o}function HEe(e,t,n){return(t+n)*3/4-n}function UEe(e){var t,n=A1e(e),o=n[0],r=n[1],s=new FEe(HEe(e,o,r)),i=0,c=r>0?o-4:o,l;for(l=0;l>16&255,s[i++]=t>>8&255,s[i++]=t&255;return r===2&&(t=fi[e.charCodeAt(l)]<<2|fi[e.charCodeAt(l+1)]>>4,s[i++]=t&255),r===1&&(t=fi[e.charCodeAt(l)]<<10|fi[e.charCodeAt(l+1)]<<4|fi[e.charCodeAt(l+2)]>>2,s[i++]=t>>8&255,s[i++]=t&255),s}function XEe(e){return rc[e>>18&63]+rc[e>>12&63]+rc[e>>6&63]+rc[e&63]}function GEe(e,t,n){for(var o,r=[],s=t;sc?c:i+s));return o===1?(t=e[n-1],r.push(rc[t>>2]+rc[t<<4&63]+"==")):o===2&&(t=(e[n-2]<<8)+e[n-1],r.push(rc[t>>10]+rc[t>>4&63]+rc[t<<2&63]+"=")),r.join("")}var dB={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */dB.read=function(e,t,n,o,r){var s,i,c=r*8-o-1,l=(1<>1,d=-7,p=n?r-1:0,f=n?-1:1,b=e[t+p];for(p+=f,s=b&(1<<-d)-1,b>>=-d,d+=c;d>0;s=s*256+e[t+p],p+=f,d-=8);for(i=s&(1<<-d)-1,s>>=-d,d+=o;d>0;i=i*256+e[t+p],p+=f,d-=8);if(s===0)s=1-u;else{if(s===l)return i?NaN:(b?-1:1)*(1/0);i=i+Math.pow(2,o),s=s-u}return(b?-1:1)*i*Math.pow(2,s-o)};dB.write=function(e,t,n,o,r,s){var i,c,l,u=s*8-r-1,d=(1<>1,f=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=o?0:s-1,h=o?1:-1,g=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(c=isNaN(t)?1:0,i=d):(i=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-i))<1&&(i--,l*=2),i+p>=1?t+=f/l:t+=f*Math.pow(2,1-p),t*l>=2&&(i++,l/=2),i+p>=d?(c=0,i=d):i+p>=1?(c=(t*l-1)*Math.pow(2,r),i=i+p):(c=t*Math.pow(2,p-1)*Math.pow(2,r),i=0));r>=8;e[n+b]=c&255,b+=h,c/=256,r-=8);for(i=i<0;e[n+b]=i&255,b+=h,i/=256,u-=8);e[n+b-h]|=g*128};/*! +`}));continue}const l=Eqe({tagName:c,attributes:Bqe({element:i})});if(l?.formatType?.contentEditable===!1){delete l.formatType,qu(o,i,t,$p()),Pu(o,{formats:[,],replacements:[{...l,innerHTML:i.innerHTML}],text:pl});continue}l&&delete l.formatType;const u=G0e({element:i,range:t,isEditableTree:n});if(qu(o,i,t,u),!l||i.getAttribute("data-rich-text-placeholder"))Pu(o,u);else if(u.text.length===0)l.attributes&&Pu(o,{formats:[,],replacements:[l],text:pl});else{let d=function(p){if(d.formats===p)return d.newFormats;const f=p?[l,...p]:[l];return d.formats=p,d.newFormats=f,f};d.newFormats=[l],Pu(o,{...u,formats:Array.from(u.formats,d)})}}return o}function Bqe({element:e}){if(!e.hasAttributes())return;const t=e.attributes.length;let n;for(let o=0;on===t)}function Pqe({start:e,end:t,replacements:n,text:o}){if(!(e+1!==t||o[e]!==pl))return n[e]}function Xl({start:e,end:t}){if(!(e===void 0||t===void 0))return e===t}function wE({text:e}){return e.length===0}function jqe(e,t=""){return typeof t=="string"&&(t=eo({text:t})),Ih(e.reduce((n,{formats:o,replacements:r,text:s})=>({formats:n.formats.concat(t.formats,o),replacements:n.replacements.concat(t.replacements,r),text:n.text+t.text+s})))}function K0e(e,t){if(t={name:e,...t},typeof t.name!="string"){window.console.error("Format names must be strings.");return}if(!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(t.name)){window.console.error("Format names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-format");return}if(uo(ul).getFormatType(t.name)){window.console.error('Format "'+t.name+'" is already registered.');return}if(typeof t.tagName!="string"||t.tagName===""){window.console.error("Format tag names must be a string.");return}if((typeof t.className!="string"||t.className==="")&&t.className!==null){window.console.error("Format class names must be a string, or null to handle bare elements.");return}if(!/^[_a-zA-Z]+[a-zA-Z0-9_-]*$/.test(t.className)){window.console.error("A class name must begin with a letter, followed by any number of hyphens, underscores, letters, or numbers.");return}if(t.className===null){const n=uo(ul).getFormatTypeForBareElement(t.tagName);if(n&&n.name!=="core/unknown"){window.console.error(`Format "${n.name}" is already registered to handle bare tag name "${t.tagName}".`);return}}else{const n=uo(ul).getFormatTypeForClassName(t.className);if(n){window.console.error(`Format "${n.name}" is already registered to handle class name "${t.className}".`);return}}if(!("title"in t)||t.title===""){window.console.error('The format "'+t.name+'" must have a title.');return}if("keywords"in t&&t.keywords.length>3){window.console.error('The format "'+t.name+'" can have a maximum of 3 keywords.');return}if(typeof t.title!="string"){window.console.error("Format titles must be strings.");return}return jr(ul).addFormatTypes(t),t}function Yd(e,t,n=e.start,o=e.end){const{formats:r,activeFormats:s}=e,i=r.slice();if(n===o){const c=i[n]?.find(({type:l})=>l===t);if(c){for(;i[n]?.find(l=>l===c);)wS(i,n,t),n--;for(o++;i[o]?.find(l=>l===c);)wS(i,o,t),o++}}else for(let c=n;cc!==t)||[]})}function wS(e,t,n){const o=e[t].filter(({type:r})=>r!==n);o.length?e[t]=o:delete e[t]}function E0(e,t,n=e.start,o=e.end){const{formats:r,replacements:s,text:i}=e;typeof t=="string"&&(t=eo({text:t}));const c=n+t.text.length;return Ih({formats:r.slice(0,n).concat(t.formats,r.slice(o)),replacements:s.slice(0,n).concat(t.replacements,s.slice(o)),text:i.slice(0,n)+t.text+i.slice(o),start:c,end:c})}function pa(e,t,n){return E0(e,eo(),t,n)}function Iqe({formats:e,replacements:t,text:n,start:o,end:r},s,i){return n=n.replace(s,(c,...l)=>{const u=l[l.length-2];let d=i,p,f;return typeof d=="function"&&(d=i(c,...l)),typeof d=="object"?(p=d.formats,f=d.replacements,d=d.text):(p=Array(d.length),f=Array(d.length),e[u]&&(p=p.fill(e[u]))),e=e.slice(0,u).concat(p,e.slice(u+c.length)),t=t.slice(0,u).concat(f,t.slice(u+c.length)),o&&(o=r=u+d.length),d}),Ih({formats:e,replacements:t,text:n,start:o,end:r})}function Y0e(e,t,n,o){return E0(e,{formats:[,],replacements:[t],text:pl},n,o)}function Q2(e,t=e.start,n=e.end){const{formats:o,replacements:r,text:s}=e;return t===void 0||n===void 0?{...e}:{formats:o.slice(t,n),replacements:r.slice(t,n),text:s.slice(t,n)}}function JN({formats:e,replacements:t,text:n,start:o,end:r},s){if(typeof s!="string")return Dqe(...arguments);let i=0;return n.split(s).map(c=>{const l=i,u={formats:e.slice(l,l+c.length),replacements:t.slice(l,l+c.length),text:c};return i+=s.length+c.length,o!==void 0&&r!==void 0&&(o>=l&&ol&&(u.start=0),r>=l&&ri&&(u.end=c.length)),u})}function Dqe({formats:e,replacements:t,text:n,start:o,end:r},s=o,i=r){if(o===void 0||r===void 0)return;const c={formats:e.slice(0,s),replacements:t.slice(0,s),text:n.slice(0,s)},l={formats:e.slice(i),replacements:t.slice(i),text:n.slice(i),start:0,end:0};return[c,l]}function Z0e(e,t){return e===t||e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset}function _E(e,t,n){const o=e.parentNode;let r=0;for(;e=e.previousSibling;)r++;return n=[r,...n],o!==t&&(n=_E(o,t,n)),n}function rU(e,t){for(t=[...t];e&&t.length>1;)e=e.childNodes[t.shift()];return{node:e,offset:t[0]}}function Fqe(e,t){if(t.html!==void 0)return e.innerHTML+=t.html;typeof t=="string"&&(t=e.ownerDocument.createTextNode(t));const{type:n,attributes:o}=t;if(n)if(n==="#comment")t=e.ownerDocument.createComment(o["data-rich-text-comment"]);else{t=e.ownerDocument.createElement(n);for(const r in o)t.setAttribute(r,o[r])}return e.appendChild(t)}function $qe(e,t){e.appendData(t)}function Vqe({lastChild:e}){return e}function Hqe({parentNode:e}){return e}function Uqe(e){return e.nodeType===e.TEXT_NODE}function Xqe({nodeValue:e}){return e}function Gqe(e){return e.parentNode.removeChild(e)}function Kqe({value:e,prepareEditableTree:t,isEditableTree:n=!0,placeholder:o,doc:r=document}){let s=[],i=[];return t&&(e={...e,formats:t(e)}),{body:H0e({value:e,createEmpty:()=>dl(r,""),append:Fqe,getLastChild:Vqe,getParent:Hqe,isText:Uqe,getText:Xqe,remove:Gqe,appendText:$qe,onStartIndex(u,d){s=_E(d,u,[d.nodeValue.length])},onEndIndex(u,d){i=_E(d,u,[d.nodeValue.length])},isEditableTree:n,placeholder:o}),selection:{startPath:s,endPath:i}}}function Yqe({value:e,current:t,prepareEditableTree:n,__unstableDomOnly:o,placeholder:r}){const{body:s,selection:i}=Kqe({value:e,prepareEditableTree:n,placeholder:r,doc:t.ownerDocument});Q0e(s,t),e.start!==void 0&&!o&&Zqe(i,t)}function Q0e(e,t){let n=0,o;for(;o=e.firstChild;){const r=t.childNodes[n];if(!r)t.appendChild(o);else if(r.isEqualNode(o))e.removeChild(o);else if(r.nodeName!==o.nodeName||r.nodeType===r.TEXT_NODE&&r.data!==o.data)t.replaceChild(o,r);else{const s=r.attributes,i=o.attributes;if(s){let c=s.length;for(;c--;){const{name:l}=s[c];o.getAttribute(l)||r.removeAttribute(l)}}if(i)for(let c=0;c0){if(Z0e(d,u.getRangeAt(0)))return;u.removeAllRanges()}u.addRange(d),p!==c.activeElement&&p instanceof l.HTMLElement&&p.focus()}function Qqe(e){if(!(typeof document>"u")){if(document.readyState==="complete"||document.readyState==="interactive")return void e();document.addEventListener("DOMContentLoaded",e)}}function sU(e="polite"){const t=document.createElement("div");t.id=`a11y-speak-${e}`,t.className="a11y-speak-region",t.setAttribute("style","position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;"),t.setAttribute("aria-live",e),t.setAttribute("aria-relevant","additions text"),t.setAttribute("aria-atomic","true");const{body:n}=document;return n&&n.appendChild(t),t}function Jqe(){const e=document.createElement("p");e.id="a11y-speak-intro-text",e.className="a11y-speak-intro-text",e.textContent=m("Notifications"),e.setAttribute("style","position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;"),e.setAttribute("hidden","hidden");const{body:t}=document;return t&&t.appendChild(e),e}function eRe(){const e=document.getElementsByClassName("a11y-speak-region"),t=document.getElementById("a11y-speak-intro-text");for(let n=0;n]+>/g," "),iU===e&&(e+=" "),iU=e,e}function Yt(e,t){eRe(),e=tRe(e);const n=document.getElementById("a11y-speak-intro-text"),o=document.getElementById("a11y-speak-assertive"),r=document.getElementById("a11y-speak-polite");o&&t==="assertive"?o.textContent=e:r&&(r.textContent=e),n&&n.removeAttribute("hidden")}function nRe(){const e=document.getElementById("a11y-speak-intro-text"),t=document.getElementById("a11y-speak-assertive"),n=document.getElementById("a11y-speak-polite");e===null&&Jqe(),t===null&&sU("assertive"),n===null&&sU("polite")}Qqe(nRe);function zc(e,t){return QN(e,t.type)?(t.title&&Yt(xe(m("%s removed."),t.title),"assertive"),Yd(e,t.type)):(t.title&&Yt(xe(m("%s applied."),t.title),"assertive"),qi(e,t))}function oRe(e,t,n,o){let r=e.startContainer;if(r.nodeType===r.TEXT_NODE&&e.startOffset===r.length&&r.nextSibling)for(r=r.nextSibling;r.firstChild;)r=r.firstChild;if(r.nodeType!==r.ELEMENT_NODE&&(r=r.parentElement),!r||r===t||!t.contains(r))return;const s=n+(o?"."+o:"");for(;r!==t;){if(r.matches(s))return r;r=r.parentElement}}function rRe(e,t){return{contextElement:t,getBoundingClientRect(){return t.contains(e.startContainer)?e.getBoundingClientRect():t.getBoundingClientRect()}}}function _S(e,t,n){if(!e)return;const{ownerDocument:o}=e,{defaultView:r}=o,s=r.getSelection();if(!s||!s.rangeCount)return;const i=s.getRangeAt(0);if(!i||!i.startContainer)return;const c=oRe(i,e,t,n);return c||rRe(i,e)}function u3({editableContentElement:e,settings:t={}}){const{tagName:n,className:o,isActive:r}=t,[s,i]=x.useState(()=>_S(e,n,o)),c=Fr(r);return x.useLayoutEffect(()=>{if(!e)return;function l(){i(_S(e,n,o))}function u(){p.addEventListener("selectionchange",l)}function d(){p.removeEventListener("selectionchange",l)}const{ownerDocument:p}=e;return(e===p.activeElement||!c&&r||c&&!r)&&(i(_S(e,n,o)),u()),e.addEventListener("focusin",u),e.addEventListener("focusout",d),()=>{d(),e.removeEventListener("focusin",u),e.removeEventListener("focusout",d)}},[e,n,o,r,c]),s}const sRe="pre-wrap",iRe="1px";function aRe(){return x.useCallback(e=>{e&&(e.style.whiteSpace=sRe,e.style.minWidth=iRe)},[])}function cRe({record:e}){const t=x.useRef(),{activeFormats:n=[],replacements:o,start:r}=e.current,s=o[r];return x.useEffect(()=>{if((!n||!n.length)&&!s)return;const i="*[data-rich-text-format-boundary]",c=t.current.querySelector(i);if(!c)return;const{ownerDocument:l}=c,{defaultView:u}=l,p=u.getComputedStyle(c).color.replace(")",", 0.2)").replace("rgb","rgba"),f=`.rich-text:focus ${i}`,b=`background-color: ${p}`,h=`${f} {${b}}`,g="rich-text-boundary-style";let z=l.getElementById(g);z||(z=l.createElement("style"),z.id=g,l.head.appendChild(z)),z.innerHTML!==h&&(z.innerHTML=h)},[n,s]),t}const lRe=e=>t=>{function n(r){const{record:s}=e.current,{ownerDocument:i}=t;if(Xl(s.current)||!t.contains(i.activeElement))return;const c=Q2(s.current),l=Jp(c),u=T0({value:c});r.clipboardData.setData("text/plain",l),r.clipboardData.setData("text/html",u),r.clipboardData.setData("rich-text","true"),r.preventDefault(),r.type==="cut"&&i.execCommand("delete")}const{defaultView:o}=t.ownerDocument;return o.addEventListener("copy",n),o.addEventListener("cut",n),()=>{o.removeEventListener("copy",n),o.removeEventListener("cut",n)}},uRe=()=>e=>{function t(o){const{target:r}=o;if(r===e||r.textContent&&r.isContentEditable)return;const{ownerDocument:s}=r,{defaultView:i}=s,c=i.getSelection();if(c.containsNode(r))return;const l=s.createRange(),u=r.isContentEditable?r:r.closest("[contenteditable]");l.selectNode(u),c.removeAllRanges(),c.addRange(l),o.preventDefault()}function n(o){o.relatedTarget&&!e.contains(o.relatedTarget)&&o.relatedTarget.tagName==="A"&&t(o)}return e.addEventListener("click",t),e.addEventListener("focusin",n),()=>{e.removeEventListener("click",t),e.removeEventListener("focusin",n)}},aU=[],dRe=e=>t=>{function n(o){const{keyCode:r,shiftKey:s,altKey:i,metaKey:c,ctrlKey:l}=o;if(s||i||c||l||r!==wi&&r!==_i)return;const{record:u,applyRecord:d,forceRender:p}=e.current,{text:f,formats:b,start:h,end:g,activeFormats:z=[]}=u.current,A=Xl(u.current),{ownerDocument:_}=t,{defaultView:v}=_,{direction:M}=v.getComputedStyle(t),y=M==="rtl"?_i:wi,k=o.keyCode===y;if(A&&z.length===0&&(h===0&&k||g===f.length&&!k)||!A)return;const S=b[h-1]||aU,C=b[h]||aU,R=k?S:C,T=z.every((P,$)=>P===R[$]);let E=z.length;if(T?E{t.removeEventListener("keydown",n)}},pRe=e=>t=>{function n(o){const{keyCode:r}=o,{createRecord:s,handleChange:i}=e.current;if(o.defaultPrevented||r!==zl&&r!==Mc)return;const c=s(),{start:l,end:u,text:d}=c;l===0&&u!==0&&u===d.length&&(i(pa(c)),o.preventDefault())}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}};function fRe({value:e,start:t,end:n,formats:o}){const r=Math.min(t,n),s=Math.max(t,n),i=e.formats[r-1]||[],c=e.formats[s]||[];for(e.activeFormats=o.map((l,u)=>{if(i[u]){if(T4(l,i[u]))return i[u]}else if(c[u]&&T4(l,c[u]))return c[u];return l});--n>=t;)e.activeFormats.length>0?e.formats[n]=e.activeFormats:delete e.formats[n];return e}const bRe=new Set(["insertParagraph","insertOrderedList","insertUnorderedList","insertHorizontalRule","insertLink"]),cU=[],J0e="data-rich-text-placeholder";function hRe(e){const t=e.getSelection(),{anchorNode:n,anchorOffset:o}=t;if(n.nodeType!==n.ELEMENT_NODE)return;const r=n.childNodes[o];!r||r.nodeType!==r.ELEMENT_NODE||!r.hasAttribute(J0e)||t.collapseToStart()}const mRe=e=>t=>{const{ownerDocument:n}=t,{defaultView:o}=n;let r=!1;function s(d){if(r)return;let p;d&&(p=d.inputType);const{record:f,applyRecord:b,createRecord:h,handleChange:g}=e.current;if(p&&(p.indexOf("format")===0||bRe.has(p))){b(f.current);return}const z=h(),{start:A,activeFormats:_=[]}=f.current,v=fRe({value:z,start:A,end:z.start,formats:_});g(v)}function i(){const{record:d,applyRecord:p,createRecord:f,onSelectionChange:b}=e.current;if(t.contentEditable!=="true")return;if(n.activeElement!==t){n.removeEventListener("selectionchange",i);return}if(r)return;const{start:h,end:g,text:z}=f(),A=d.current;if(z!==A.text){s();return}if(h===A.start&&g===A.end){A.text.length===0&&h===0&&hRe(o);return}const _={...A,start:h,end:g,activeFormats:A._newActiveFormats,_newActiveFormats:void 0},v=ZN(_,cU);_.activeFormats=v,d.current=_,p(_,{domOnly:!0}),b(h,g)}function c(){r=!0,n.removeEventListener("selectionchange",i),t.querySelector(`[${J0e}]`)?.remove()}function l(){r=!1,s({inputType:"insertText"}),n.addEventListener("selectionchange",i)}function u(){const{record:d,isSelected:p,onSelectionChange:f,applyRecord:b}=e.current;t.parentElement.closest('[contenteditable="true"]')||(p?b(d.current,{domOnly:!0}):d.current={...d.current,start:void 0,end:void 0,activeFormats:cU},f(d.current.start,d.current.end),window.queueMicrotask(i),n.addEventListener("selectionchange",i))}return t.addEventListener("input",s),t.addEventListener("compositionstart",c),t.addEventListener("compositionend",l),t.addEventListener("focus",u),()=>{t.removeEventListener("input",s),t.removeEventListener("compositionstart",c),t.removeEventListener("compositionend",l),t.removeEventListener("focus",u)}},gRe=()=>e=>{const{ownerDocument:t}=e,{defaultView:n}=t,o=n?.getSelection();let r;function s(){return o.rangeCount?o.getRangeAt(0):null}function i(c){const l=c.type==="keydown"?"keyup":"pointerup";function u(){t.removeEventListener(l,d),t.removeEventListener("selectionchange",u),t.removeEventListener("input",u)}function d(){u(),!Z0e(r,s())&&t.dispatchEvent(new Event("selectionchange"))}t.addEventListener(l,d),t.addEventListener("selectionchange",u),t.addEventListener("input",u),r=s()}return e.addEventListener("pointerdown",i),e.addEventListener("keydown",i),()=>{e.removeEventListener("pointerdown",i),e.removeEventListener("keydown",i)}};function MRe(){return e=>{const{ownerDocument:t}=e,{defaultView:n}=t;let o=null;function r(i){i.defaultPrevented||i.target!==e&&i.target.contains(e)&&(o=e.getAttribute("contenteditable"),e.setAttribute("contenteditable","false"),n.getSelection().removeAllRanges())}function s(){o!==null&&(e.setAttribute("contenteditable",o),o=null)}return n.addEventListener("pointerdown",r),n.addEventListener("pointerup",s),()=>{n.removeEventListener("pointerdown",r),n.removeEventListener("pointerup",s)}}}const zRe=[lRe,uRe,dRe,pRe,mRe,gRe,MRe];function ORe(e){const t=x.useRef(e);x.useInsertionEffect(()=>{t.current=e});const n=x.useMemo(()=>zRe.map(o=>o(t)),[t]);return Mn(o=>{const r=n.map(s=>s(o));return()=>{r.forEach(s=>s())}},[n])}function e1e({value:e="",selectionStart:t,selectionEnd:n,placeholder:o,onSelectionChange:r,preserveWhiteSpace:s,onChange:i,__unstableDisableFormats:c,__unstableIsSelected:l,__unstableDependencies:u=[],__unstableAfterParse:d,__unstableBeforeSerialize:p,__unstableAddInvisibleFormats:f}){const b=Fn(),[,h]=x.useReducer(()=>({})),g=x.useRef();function z(){const{ownerDocument:{defaultView:T}}=g.current,E=T.getSelection(),B=E.rangeCount>0?E.getRangeAt(0):null;return eo({element:g.current,range:B,__unstableIsEditableTree:!0})}function A(T,{domOnly:E}={}){Yqe({value:T,current:g.current,prepareEditableTree:f,__unstableDomOnly:E,placeholder:o})}const _=x.useRef(e),v=x.useRef();function M(){_.current=e,v.current=e,e instanceof Xo||(v.current=e?Xo.fromHTMLString(e,{preserveWhiteSpace:s}):Xo.empty()),v.current={text:v.current.text,formats:v.current.formats,replacements:v.current.replacements},c&&(v.current.formats=Array(e.length),v.current.replacements=Array(e.length)),d&&(v.current.formats=d(v.current)),v.current.start=t,v.current.end=n}const y=x.useRef(!1);v.current?(t!==v.current.start||n!==v.current.end)&&(y.current=l,v.current={...v.current,start:t,end:n,activeFormats:void 0}):(y.current=l,M());function k(T){if(v.current=T,A(T),c)_.current=T.text;else{const I=p?p(T):T.formats;T={...T,formats:I},typeof e=="string"?_.current=T0({value:T,preserveWhiteSpace:s}):_.current=new Xo(T)}const{start:E,end:B,formats:N,text:j}=v.current;b.batch(()=>{r(E,B),i(_.current,{__unstableFormats:N,__unstableText:j})}),h()}function S(){M(),A(v.current)}const C=x.useRef(!1);x.useLayoutEffect(()=>{C.current&&e!==_.current&&(S(),h())},[e]),x.useLayoutEffect(()=>{y.current&&(g.current.ownerDocument.activeElement!==g.current&&g.current.focus(),A(v.current),y.current=!1)},[y.current]);const R=xn([g,aRe(),cRe({record:v}),ORe({record:v,handleChange:k,applyRecord:A,createRecord:z,isSelected:l,onSelectionChange:r,forceRender:h}),Mn(()=>{S(),C.current=!0},[o,...u])]);return{value:v.current,getValue:()=>v.current,onChange:k,ref:R}}const e1="id",yRe=["title","excerpt","content"],t1e=[{label:m("Base"),kind:"root",name:"__unstableBase",baseURL:"/",baseURLParams:{_fields:["description","gmt_offset","home","name","site_icon","site_icon_url","site_logo","timezone_string","default_template_part_areas","default_template_types","url"].join(",")},plural:"__unstableBases",syncConfig:{fetch:async()=>Wt({path:"/"}),applyChangesToDoc:(e,t)=>{const n=e.getMap("document");Object.entries(t).forEach(([o,r])=>{n.get(o)!==r&&n.set(o,r)})},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"root/base",getSyncObjectId:()=>"index"},{label:m("Post Type"),name:"postType",kind:"root",key:"slug",baseURL:"/wp/v2/types",baseURLParams:{context:"edit"},plural:"postTypes",syncConfig:{fetch:async e=>Wt({path:`/wp/v2/types/${e}?context=edit`}),applyChangesToDoc:(e,t)=>{const n=e.getMap("document");Object.entries(t).forEach(([o,r])=>{n.get(o)!==r&&n.set(o,r)})},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"root/postType",getSyncObjectId:e=>e},{name:"media",kind:"root",baseURL:"/wp/v2/media",baseURLParams:{context:"edit"},plural:"mediaItems",label:m("Media"),rawAttributes:["caption","title","description"],supportsPagination:!0},{name:"taxonomy",kind:"root",key:"slug",baseURL:"/wp/v2/taxonomies",baseURLParams:{context:"edit"},plural:"taxonomies",label:m("Taxonomy")},{name:"sidebar",kind:"root",baseURL:"/wp/v2/sidebars",baseURLParams:{context:"edit"},plural:"sidebars",transientEdits:{blocks:!0},label:m("Widget areas")},{name:"widget",kind:"root",baseURL:"/wp/v2/widgets",baseURLParams:{context:"edit"},plural:"widgets",transientEdits:{blocks:!0},label:m("Widgets")},{name:"widgetType",kind:"root",baseURL:"/wp/v2/widget-types",baseURLParams:{context:"edit"},plural:"widgetTypes",label:m("Widget types")},{label:m("User"),name:"user",kind:"root",baseURL:"/wp/v2/users",baseURLParams:{context:"edit"},plural:"users"},{name:"comment",kind:"root",baseURL:"/wp/v2/comments",baseURLParams:{context:"edit"},plural:"comments",label:m("Comment")},{name:"menu",kind:"root",baseURL:"/wp/v2/menus",baseURLParams:{context:"edit"},plural:"menus",label:m("Menu")},{name:"menuItem",kind:"root",baseURL:"/wp/v2/menu-items",baseURLParams:{context:"edit"},plural:"menuItems",label:m("Menu Item"),rawAttributes:["title"]},{name:"menuLocation",kind:"root",baseURL:"/wp/v2/menu-locations",baseURLParams:{context:"edit"},plural:"menuLocations",label:m("Menu Location"),key:"name"},{label:m("Global Styles"),name:"globalStyles",kind:"root",baseURL:"/wp/v2/global-styles",baseURLParams:{context:"edit"},plural:"globalStylesVariations",getTitle:e=>e?.title?.rendered||e?.title,getRevisionsUrl:(e,t)=>`/wp/v2/global-styles/${e}/revisions${t?"/"+t:""}`,supportsPagination:!0},{label:m("Themes"),name:"theme",kind:"root",baseURL:"/wp/v2/themes",baseURLParams:{context:"edit"},plural:"themes",key:"stylesheet"},{label:m("Plugins"),name:"plugin",kind:"root",baseURL:"/wp/v2/plugins",baseURLParams:{context:"edit"},plural:"plugins",key:"plugin"},{label:m("Status"),name:"status",kind:"root",baseURL:"/wp/v2/statuses",baseURLParams:{context:"edit"},plural:"statuses",key:"slug"}],n1e=[{kind:"postType",loadEntities:xRe},{kind:"taxonomy",loadEntities:wRe},{kind:"root",name:"site",plural:"sites",loadEntities:_Re}],ARe=(e,t)=>{const n={};return e?.status==="auto-draft"&&(!t.status&&!n.status&&(n.status="draft"),(!t.title||t.title==="Auto Draft")&&!n.title&&(!e?.title||e?.title==="Auto Draft")&&(n.title="")),n},kS=new WeakMap;function vRe(e){const t={...e};for(const[n,o]of Object.entries(e))o instanceof Xo&&(t[n]=o.valueOf());return t}function o1e(e){return e.map(t=>{const{innerBlocks:n,attributes:o,...r}=t;return{...r,attributes:vRe(o),innerBlocks:o1e(n)}})}async function xRe(){const e=await Wt({path:"/wp/v2/types?context=view"});return Object.entries(e??{}).map(([t,n])=>{var o;const r=["wp_template","wp_template_part"].includes(t),s=(o=n?.rest_namespace)!==null&&o!==void 0?o:"wp/v2";return{kind:"postType",baseURL:`/${s}/${n.rest_base}`,baseURLParams:{context:"edit"},name:t,label:n.name,transientEdits:{blocks:!0,selection:!0},mergedEdits:{meta:!0},rawAttributes:yRe,getTitle:i=>{var c;return i?.title?.rendered||i?.title||(r?Wre((c=i.slug)!==null&&c!==void 0?c:""):String(i.id))},__unstablePrePersist:r?void 0:ARe,__unstable_rest_base:n.rest_base,syncConfig:{fetch:async i=>Wt({path:`/${s}/${n.rest_base}/${i}?context=edit`}),applyChangesToDoc:(i,c)=>{const l=i.getMap("document");Object.entries(c).forEach(([u,d])=>{typeof d!="function"&&(u==="blocks"&&(kS.has(d)||kS.set(d,o1e(d)),d=kS.get(d)),l.get(u)!==d&&l.set(u,d))})},fromCRDTDoc:i=>i.getMap("document").toJSON()},syncObjectType:"postType/"+n.name,getSyncObjectId:i=>i,supportsPagination:!0,getRevisionsUrl:(i,c)=>`/${s}/${n.rest_base}/${i}/revisions${c?"/"+c:""}`,revisionKey:r?"wp_id":e1}})}async function wRe(){const e=await Wt({path:"/wp/v2/taxonomies?context=view"});return Object.entries(e??{}).map(([t,n])=>{var o;return{kind:"taxonomy",baseURL:`/${(o=n?.rest_namespace)!==null&&o!==void 0?o:"wp/v2"}/${n.rest_base}`,baseURLParams:{context:"edit"},name:t,label:n.name}})}async function _Re(){var e;const t={label:m("Site"),name:"site",kind:"root",baseURL:"/wp/v2/settings",syncConfig:{fetch:async()=>Wt({path:"/wp/v2/settings"}),applyChangesToDoc:(r,s)=>{const i=r.getMap("document");Object.entries(s).forEach(([c,l])=>{i.get(c)!==l&&i.set(c,l)})},fromCRDTDoc:r=>r.getMap("document").toJSON()},syncObjectType:"root/site",getSyncObjectId:()=>"index",meta:{}},n=await Wt({path:t.baseURL,method:"OPTIONS"}),o={};return Object.entries((e=n?.schema?.properties)!==null&&e!==void 0?e:{}).forEach(([r,s])=>{typeof s=="object"&&s.title&&(o[r]=s.title)}),[{...t,meta:{labels:o}}]}const J2=(e,t,n="get")=>{const o=e==="root"?"":w4(e),r=w4(t);return`${n}${o}${r}`};function r1e(e){const{query:t}=e;return t?jh(t).context:"default"}function kRe(e,t,n,o){var r;if(n===1&&o===-1)return t;const i=(n-1)*o,c=Math.max((r=e?.length)!==null&&r!==void 0?r:0,i+t.length),l=new Array(c);for(let u=0;u=i&&u!t.some(o=>Number.isInteger(o)?o===+n:o===n)))}function SRe(e={},t){switch(t.type){case"RECEIVE_ITEMS":{const n=r1e(t),o=t.key||e1;return{...e,[n]:{...e[n],...t.items.reduce((r,s)=>{const i=s?.[o];return r[i]=wCe(e?.[n]?.[i],s),r},{})}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(e).map(([n,o])=>[n,s1e(o,t.itemIds)]))}return e}function CRe(e={},t){switch(t.type){case"RECEIVE_ITEMS":{const n=r1e(t),{query:o,key:r=e1}=t,s=o?jh(o):{},i=!o||!Array.isArray(s.fields);return{...e,[n]:{...e[n],...t.items.reduce((c,l)=>{const u=l?.[r];return c[u]=e?.[n]?.[u]||i,c},{})}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(e).map(([n,o])=>[n,s1e(o,t.itemIds)]))}return e}const qRe=Co([q0e(e=>"query"in e),R0e(e=>e.query?{...e,...jh(e.query)}:e),XH("context"),XH("stableKey")])((e={},t)=>{const{type:n,page:o,perPage:r,key:s=e1}=t;return n!=="RECEIVE_ITEMS"?e:{itemIds:kRe(e?.itemIds||[],t.items.map(i=>i?.[s]).filter(Boolean),o,r),meta:t.meta}}),RRe=(e={},t)=>{switch(t.type){case"RECEIVE_ITEMS":return qRe(e,t);case"REMOVE_ITEMS":const n=t.itemIds.reduce((o,r)=>(o[r]=!0,o),{});return Object.fromEntries(Object.entries(e).map(([o,r])=>[o,Object.fromEntries(Object.entries(r).map(([s,i])=>[s,{...i,itemIds:i.itemIds.filter(c=>!n[c])}]))]));default:return e}},lU=J0({items:SRe,itemIsComplete:CRe,queries:RRe});function TRe(e={},t){switch(t.type){case"RECEIVE_TERMS":return{...e,[t.taxonomy]:t.terms}}return e}function ERe(e={byId:{},queries:{}},t){switch(t.type){case"RECEIVE_USER_QUERY":return{byId:{...e.byId,...t.users.reduce((n,o)=>({...n,[o.id]:o}),{})},queries:{...e.queries,[t.queryID]:t.users.map(n=>n.id)}}}return e}function WRe(e={},t){switch(t.type){case"RECEIVE_CURRENT_USER":return t.currentUser}return e}function NRe(e=[],t){switch(t.type){case"RECEIVE_TAXONOMIES":return t.taxonomies}return e}function BRe(e=void 0,t){switch(t.type){case"RECEIVE_CURRENT_THEME":return t.currentTheme.stylesheet}return e}function LRe(e=void 0,t){switch(t.type){case"RECEIVE_CURRENT_GLOBAL_STYLES_ID":return t.id}return e}function PRe(e={},t){switch(t.type){case"RECEIVE_THEME_GLOBAL_STYLES":return{...e,[t.stylesheet]:t.globalStyles}}return e}function jRe(e={},t){switch(t.type){case"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS":return{...e,[t.stylesheet]:t.variations}}return e}const IRe=e=>(t,n)=>{if(n.type==="UNDO"||n.type==="REDO"){const{record:o}=n;let r=t;return o.forEach(({id:{kind:s,name:i,recordId:c},changes:l})=>{r=e(r,{type:"EDIT_ENTITY_RECORD",kind:s,name:i,recordId:c,edits:Object.entries(l).reduce((u,[d,p])=>(u[d]=n.type==="UNDO"?p.from:p.to,u),{})})}),r}return e(t,n)};function DRe(e){return Co([IRe,q0e(t=>t.name&&t.kind&&t.name===e.name&&t.kind===e.kind),R0e(t=>({key:e.key||e1,...t}))])(J0({queriedData:lU,edits:(t={},n)=>{var o;switch(n.type){case"RECEIVE_ITEMS":if(((o=n?.query?.context)!==null&&o!==void 0?o:"default")!=="default")return t;const s={...t};for(const c of n.items){const l=c?.[n.key],u=s[l];if(!u)continue;const d=Object.keys(u).reduce((p,f)=>{var b;return!N0(u[f],(b=c[f]?.raw)!==null&&b!==void 0?b:c[f])&&(!n.persistedEdits||!N0(u[f],n.persistedEdits[f]))&&(p[f]=u[f]),p},{});Object.keys(d).length?s[l]=d:delete s[l]}return s;case"EDIT_ENTITY_RECORD":const i={...t[n.recordId],...n.edits};return Object.keys(i).forEach(c=>{i[c]===void 0&&delete i[c]}),{...t,[n.recordId]:i}}return t},saving:(t={},n)=>{switch(n.type){case"SAVE_ENTITY_RECORD_START":case"SAVE_ENTITY_RECORD_FINISH":return{...t,[n.recordId]:{pending:n.type==="SAVE_ENTITY_RECORD_START",error:n.error,isAutosave:n.isAutosave}}}return t},deleting:(t={},n)=>{switch(n.type){case"DELETE_ENTITY_RECORD_START":case"DELETE_ENTITY_RECORD_FINISH":return{...t,[n.recordId]:{pending:n.type==="DELETE_ENTITY_RECORD_START",error:n.error}}}return t},revisions:(t={},n)=>{if(n.type==="RECEIVE_ITEM_REVISIONS"){const o=n.recordKey;delete n.recordKey;const r=lU(t[o],{...n,type:"RECEIVE_ITEMS"});return{...t,[o]:r}}return n.type==="REMOVE_ITEMS"?Object.fromEntries(Object.entries(t).filter(([o])=>!n.itemIds.some(r=>Number.isInteger(r)?r===+o:r===o))):t}}))}function FRe(e=t1e,t){switch(t.type){case"ADD_ENTITIES":return[...e,...t.entities]}return e}const $Re=(e={},t)=>{const n=FRe(e.config,t);let o=e.reducer;if(!o||n!==e.config){const s=n.reduce((i,c)=>{const{kind:l}=c;return i[l]||(i[l]=[]),i[l].push(c),i},{});o=J0(Object.entries(s).reduce((i,[c,l])=>{const u=J0(l.reduce((d,p)=>({...d,[p.name]:DRe(p)}),{}));return i[c]=u,i},{}))}const r=o(e.records,t);return r===e.records&&n===e.config&&o===e.reducer?e:{reducer:o,records:r,config:n}};function VRe(e=pSe()){return e}function HRe(e={},t){switch(t.type){case"EDIT_ENTITY_RECORD":case"UNDO":case"REDO":return{}}return e}function URe(e={},t){switch(t.type){case"RECEIVE_EMBED_PREVIEW":const{url:n,preview:o}=t;return{...e,[n]:o}}return e}function XRe(e={},t){switch(t.type){case"RECEIVE_USER_PERMISSION":return{...e,[t.key]:t.isAllowed};case"RECEIVE_USER_PERMISSIONS":return{...e,...t.permissions}}return e}function GRe(e={},t){switch(t.type){case"RECEIVE_AUTOSAVES":const{postId:n,autosaves:o}=t;return{...e,[n]:o}}return e}function KRe(e=[],t){switch(t.type){case"RECEIVE_BLOCK_PATTERNS":return t.patterns}return e}function YRe(e=[],t){switch(t.type){case"RECEIVE_BLOCK_PATTERN_CATEGORIES":return t.categories}return e}function ZRe(e=[],t){switch(t.type){case"RECEIVE_USER_PATTERN_CATEGORIES":return t.patternCategories}return e}function QRe(e=null,t){switch(t.type){case"RECEIVE_NAVIGATION_FALLBACK_ID":return t.fallbackId}return e}function JRe(e={},t){switch(t.type){case"RECEIVE_THEME_GLOBAL_STYLE_REVISIONS":return{...e,[t.currentId]:t.revisions}}return e}function eTe(e={},t){switch(t.type){case"RECEIVE_DEFAULT_TEMPLATE":return{...e,[JSON.stringify(t.query)]:t.templateId}}return e}function tTe(e={},t){switch(t.type){case"RECEIVE_REGISTERED_POST_META":return{...e,[t.postType]:t.registeredPostMeta}}return e}const nTe=J0({terms:TRe,users:ERe,currentTheme:BRe,currentGlobalStylesId:LRe,currentUser:WRe,themeGlobalStyleVariations:jRe,themeBaseGlobalStyles:PRe,themeGlobalStyleRevisions:JRe,taxonomies:NRe,entities:$Re,editsReference:HRe,undoManager:VRe,embedPreviews:URe,userPermissions:XRe,autosaves:GRe,blockPatterns:KRe,blockPatternCategories:YRe,userPatternCategories:ZRe,navigationFallbackId:QRe,defaultTemplates:eTe,registeredPostMeta:tTe}),No="core",oTe={},rTe=At(e=>(t,n)=>e(No).isResolving("getEmbedPreview",[n]));function sTe(e,t){Ke("select( 'core' ).getAuthors()",{since:"5.9",alternative:"select( 'core' ).getUsers({ who: 'authors' })"});const n=tn("/wp/v2/users/?who=authors&per_page=100",t);return i1e(e,n)}function iTe(e){return e.currentUser}const i1e=It((e,t)=>{var n;return((n=e.users.queries[t])!==null&&n!==void 0?n:[]).map(r=>e.users.byId[r])},(e,t)=>[e.users.queries[t],e.users.byId]);function aTe(e,t){return Ke("wp.data.select( 'core' ).getEntitiesByKind()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntitiesConfig()"}),a1e(e,t)}const a1e=It((e,t)=>e.entities.config.filter(n=>n.kind===t),(e,t)=>e.entities.config);function cTe(e,t,n){return Ke("wp.data.select( 'core' ).getEntity()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntityConfig()"}),Dh(e,t,n)}function Dh(e,t,n){return e.entities.config?.find(o=>o.kind===t&&o.name===n)}const Zd=It((e,t,n,o,r)=>{var s;const i=e.entities.records?.[t]?.[n]?.queriedData;if(!i)return;const c=(s=r?.context)!==null&&s!==void 0?s:"default";if(r===void 0)return i.itemIsComplete[c]?.[o]?i.items[c][o]:void 0;const l=i.items[c]?.[o];if(l&&r._fields){var u;const d={},p=(u=Md(r._fields))!==null&&u!==void 0?u:[];for(let f=0;f{h=h?.[g]}),q5(d,b,h)}return d}return l},(e,t,n,o,r)=>{var s;const i=(s=r?.context)!==null&&s!==void 0?s:"default";return[e.entities.records?.[t]?.[n]?.queriedData?.items[i]?.[o],e.entities.records?.[t]?.[n]?.queriedData?.itemIsComplete[i]?.[o]]});Zd.__unstableNormalizeArgs=e=>{const t=[...e],n=t?.[2];return t[2]=CCe(n)?Number(n):n,t};function lTe(e,t,n,o){return Zd(e,t,n,o)}const c1e=It((e,t,n,o)=>{const r=Zd(e,t,n,o);return r&&Object.keys(r).reduce((s,i)=>{if(kCe(Dh(e,t,n),i)){var c;s[i]=(c=r[i]?.raw)!==null&&c!==void 0?c:r[i]}else s[i]=r[i];return s},{})},(e,t,n,o,r)=>{var s;const i=(s=r?.context)!==null&&s!==void 0?s:"default";return[e.entities.config,e.entities.records?.[t]?.[n]?.queriedData?.items[i]?.[o],e.entities.records?.[t]?.[n]?.queriedData?.itemIsComplete[i]?.[o]]});function uTe(e,t,n,o){return Array.isArray(eB(e,t,n,o))}const eB=(e,t,n,o)=>{const r=e.entities.records?.[t]?.[n]?.queriedData;return r?N0e(r,o):null},dTe=(e,t,n,o)=>{const r=e.entities.records?.[t]?.[n]?.queriedData;return r?B0e(r,o):null},pTe=(e,t,n,o)=>{const r=e.entities.records?.[t]?.[n]?.queriedData;if(!r)return null;if(o.per_page===-1)return 1;const s=B0e(r,o);return s&&(o.per_page?Math.ceil(s/o.per_page):UCe(r,o))},fTe=It(e=>{const{entities:{records:t}}=e,n=[];return Object.keys(t).forEach(o=>{Object.keys(t[o]).forEach(r=>{const s=Object.keys(t[o][r].edits).filter(i=>Zd(e,o,r,i)&&u1e(e,o,r,i));if(s.length){const i=Dh(e,o,r);s.forEach(c=>{const l=nB(e,o,r,c);n.push({key:l?l[i.key||e1]:void 0,title:i?.getTitle?.(l)||"",name:r,kind:o})})}})}),n},e=>[e.entities.records]),bTe=It(e=>{const{entities:{records:t}}=e,n=[];return Object.keys(t).forEach(o=>{Object.keys(t[o]).forEach(r=>{const s=Object.keys(t[o][r].saving).filter(i=>oB(e,o,r,i));if(s.length){const i=Dh(e,o,r);s.forEach(c=>{const l=nB(e,o,r,c);n.push({key:l?l[i.key||e1]:void 0,title:i?.getTitle?.(l)||"",name:r,kind:o})})}})}),n},e=>[e.entities.records]);function tB(e,t,n,o){return e.entities.records?.[t]?.[n]?.edits?.[o]}const l1e=It((e,t,n,o)=>{const{transientEdits:r}=Dh(e,t,n)||{},s=tB(e,t,n,o)||{};return r?Object.keys(s).reduce((i,c)=>(r[c]||(i[c]=s[c]),i),{}):s},(e,t,n,o)=>[e.entities.config,e.entities.records?.[t]?.[n]?.edits?.[o]]);function u1e(e,t,n,o){return oB(e,t,n,o)||Object.keys(l1e(e,t,n,o)).length>0}const nB=It((e,t,n,o)=>{const r=c1e(e,t,n,o),s=tB(e,t,n,o);return!r&&!s?!1:{...r,...s}},(e,t,n,o,r)=>{var s;const i=(s=r?.context)!==null&&s!==void 0?s:"default";return[e.entities.config,e.entities.records?.[t]?.[n]?.queriedData.items[i]?.[o],e.entities.records?.[t]?.[n]?.queriedData.itemIsComplete[i]?.[o],e.entities.records?.[t]?.[n]?.edits?.[o]]});function hTe(e,t,n,o){var r;const{pending:s,isAutosave:i}=(r=e.entities.records?.[t]?.[n]?.saving?.[o])!==null&&r!==void 0?r:{};return!!(s&&i)}function oB(e,t,n,o){var r;return(r=e.entities.records?.[t]?.[n]?.saving?.[o]?.pending)!==null&&r!==void 0?r:!1}function mTe(e,t,n,o){var r;return(r=e.entities.records?.[t]?.[n]?.deleting?.[o]?.pending)!==null&&r!==void 0?r:!1}function gTe(e,t,n,o){return e.entities.records?.[t]?.[n]?.saving?.[o]?.error}function MTe(e,t,n,o){return e.entities.records?.[t]?.[n]?.deleting?.[o]?.error}function zTe(e){Ke("select( 'core' ).getUndoEdit()",{since:"6.3"})}function OTe(e){Ke("select( 'core' ).getRedoEdit()",{since:"6.3"})}function yTe(e){return e.undoManager.hasUndo()}function ATe(e){return e.undoManager.hasRedo()}function N5(e){return e.currentTheme?Zd(e,"root","theme",e.currentTheme):null}function d1e(e){return e.currentGlobalStylesId}function vTe(e){var t;return(t=N5(e)?.theme_supports)!==null&&t!==void 0?t:oTe}function xTe(e,t){return e.embedPreviews[t]}function wTe(e,t){const n=e.embedPreviews[t],o=''+t+"";return n?n.html===o:!1}function rB(e,t,n,o){if(typeof n=="object"&&(!n.kind||!n.name))return!1;const s=R5(t,n,o);return e.userPermissions[s]}function _Te(e,t,n,o){return Ke("wp.data.select( 'core' ).canUserEditEntityRecord()",{since:"6.7",alternative:"wp.data.select( 'core' ).canUser( 'update', { kind, name, id } )"}),rB(e,"update",{kind:t,name:n,id:o})}function kTe(e,t,n){return e.autosaves[n]}function STe(e,t,n,o){return o===void 0?void 0:e.autosaves[n]?.find(s=>s.author===o)}const CTe=At(e=>(t,n,o)=>e(No).hasFinishedResolution("getAutosaves",[n,o]));function qTe(e){return e.editsReference}function RTe(e){const t=N5(e);return t?e.themeBaseGlobalStyles[t.stylesheet]:null}function TTe(e){const t=N5(e);return t?e.themeGlobalStyleVariations[t.stylesheet]:null}function ETe(e){return e.blockPatterns}function WTe(e){return e.blockPatternCategories}function NTe(e){return e.userPatternCategories}function BTe(e){Ke("select( 'core' ).getCurrentThemeGlobalStylesRevisions()",{since:"6.5.0",alternative:"select( 'core' ).getRevisions( 'root', 'globalStyles', ${ recordKey } )"});const t=d1e(e);return t?e.themeGlobalStyleRevisions[t]:null}function p1e(e,t){return e.defaultTemplates[JSON.stringify(t)]}const LTe=(e,t,n,o,r)=>{const s=e.entities.records?.[t]?.[n]?.revisions?.[o];return s?N0e(s,r):null},PTe=It((e,t,n,o,r,s)=>{var i;const c=e.entities.records?.[t]?.[n]?.revisions?.[o];if(!c)return;const l=(i=s?.context)!==null&&i!==void 0?i:"default";if(s===void 0)return c.itemIsComplete[l]?.[r]?c.items[l][r]:void 0;const u=c.items[l]?.[r];if(u&&s._fields){var d;const p={},f=(d=Md(s._fields))!==null&&d!==void 0?d:[];for(let b=0;b{g=g?.[z]}),q5(p,h,g)}return p}return u},(e,t,n,o,r,s)=>{var i;const c=(i=s?.context)!==null&&i!==void 0?i:"default";return[e.entities.records?.[t]?.[n]?.revisions?.[o]?.items?.[c]?.[r],e.entities.records?.[t]?.[n]?.revisions?.[o]?.itemIsComplete?.[c]?.[r]]}),jTe=Object.freeze(Object.defineProperty({__proto__:null,__experimentalGetCurrentGlobalStylesId:d1e,__experimentalGetCurrentThemeBaseGlobalStyles:RTe,__experimentalGetCurrentThemeGlobalStylesVariations:TTe,__experimentalGetDirtyEntityRecords:fTe,__experimentalGetEntitiesBeingSaved:bTe,__experimentalGetEntityRecordNoResolver:lTe,canUser:rB,canUserEditEntityRecord:_Te,getAuthors:sTe,getAutosave:STe,getAutosaves:kTe,getBlockPatternCategories:WTe,getBlockPatterns:ETe,getCurrentTheme:N5,getCurrentThemeGlobalStylesRevisions:BTe,getCurrentUser:iTe,getDefaultTemplateId:p1e,getEditedEntityRecord:nB,getEmbedPreview:xTe,getEntitiesByKind:aTe,getEntitiesConfig:a1e,getEntity:cTe,getEntityConfig:Dh,getEntityRecord:Zd,getEntityRecordEdits:tB,getEntityRecordNonTransientEdits:l1e,getEntityRecords:eB,getEntityRecordsTotalItems:dTe,getEntityRecordsTotalPages:pTe,getLastEntityDeleteError:MTe,getLastEntitySaveError:gTe,getRawEntityRecord:c1e,getRedoEdit:OTe,getReferenceByDistinctEdits:qTe,getRevision:PTe,getRevisions:LTe,getThemeSupports:vTe,getUndoEdit:zTe,getUserPatternCategories:NTe,getUserQueryResults:i1e,hasEditsForEntityRecord:u1e,hasEntityRecords:uTe,hasFetchedAutosaves:CTe,hasRedo:ATe,hasUndo:yTe,isAutosavingEntityRecord:hTe,isDeletingEntityRecord:mTe,isPreviewEmbedFallback:wTe,isRequestingEmbedPreview:rTe,isSavingEntityRecord:oB},Symbol.toStringTag,{value:"Module"})),{lock:ITe,unlock:eh}=P0("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/core-data");function DTe(e){return e.undoManager}function FTe(e){return e.navigationFallbackId}const $Te=At(e=>It((t,n)=>e(No).getBlockPatterns().filter(({postTypes:o})=>!o||Array.isArray(o)&&o.includes(n)),()=>[e(No).getBlockPatterns()])),f1e=At(e=>It((t,n,o,r)=>(Array.isArray(r)?r:[r]).map(i=>({delete:e(No).canUser("delete",{kind:n,name:o,id:i}),update:e(No).canUser("update",{kind:n,name:o,id:i})})),t=>[t.userPermissions]));function VTe(e,t,n,o){return f1e(e,t,n,o)[0]}function HTe(e,t){var n;return(n=e.registeredPostMeta?.[t])!==null&&n!==void 0?n:{}}function b1e(e){return!e||!["number","string"].includes(typeof e)||Number(e)===0?null:e.toString()}const UTe=At(e=>It(()=>{if(!e(No).canUser("read",{kind:"root",name:"site"}))return null;const n=e(No).getEntityRecord("root","site");if(!n)return null;const o=n?.show_on_front==="page"?b1e(n.page_on_front):null;return o?{postType:"page",postId:o}:{postType:"wp_template",postId:e(No).getDefaultTemplateId({slug:"front-page"})}},t=>[rB(t,"read",{kind:"root",name:"site"})&&Zd(t,"root","site"),p1e(t,{slug:"front-page"})])),XTe=At(e=>()=>{if(!e(No).canUser("read",{kind:"root",name:"site"}))return null;const n=e(No).getEntityRecord("root","site");return n?.show_on_front==="page"?b1e(n.page_for_posts):null}),GTe=At(e=>(t,n,o)=>{const r=eh(e(No)).getHomePage();if(!r)return;if(n==="page"&&n===r?.postType&&o.toString()===r?.postId){const u=e(No).getEntityRecords("postType","wp_template",{per_page:-1});if(!u)return;const d=u.find(({slug:p})=>p==="front-page")?.id;if(d)return d}const s=e(No).getEditedEntityRecord("postType",n,o);if(!s)return;const i=eh(e(No)).getPostsPageId();if(n==="page"&&i===o.toString())return e(No).getDefaultTemplateId({slug:"home"});const c=s.template;if(c){const u=e(No).getEntityRecords("postType","wp_template",{per_page:-1})?.find(({slug:d})=>d===c);if(u)return u.id}let l;return s.slug?l=n==="page"?`${n}-${s.slug}`:`single-${n}-${s.slug}`:l=n==="page"?"page":`single-${n}`,e(No).getDefaultTemplateId({slug:l})}),KTe=Object.freeze(Object.defineProperty({__proto__:null,getBlockPatternsForPostType:$Te,getEntityRecordPermissions:VTe,getEntityRecordsPermissions:f1e,getHomePage:UTe,getNavigationFallbackId:FTe,getPostsPageId:XTe,getRegisteredPostMeta:HTe,getTemplateId:GTe,getUndoManager:DTe},Symbol.toStringTag,{value:"Module"}));let dA;const YTe=new Uint8Array(16);function ZTe(){if(!dA&&(dA=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!dA))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return dA(YTe)}const $0=[];for(let e=0;e<256;++e)$0.push((e+256).toString(16).slice(1));function QTe(e,t=0){return $0[e[t+0]]+$0[e[t+1]]+$0[e[t+2]]+$0[e[t+3]]+"-"+$0[e[t+4]]+$0[e[t+5]]+"-"+$0[e[t+6]]+$0[e[t+7]]+"-"+$0[e[t+8]]+$0[e[t+9]]+"-"+$0[e[t+10]]+$0[e[t+11]]+$0[e[t+12]]+$0[e[t+13]]+$0[e[t+14]]+$0[e[t+15]]}const JTe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),uU={randomUUID:JTe};function Is(e,t,n){if(uU.randomUUID&&!t&&!e)return uU.randomUUID();e=e||{};const o=e.random||(e.rng||ZTe)();return o[6]=o[6]&15|64,o[8]=o[8]&63|128,QTe(o)}let SS=null;function eEe(e,t){const n=[...e],o=[];for(;n.length;)o.push(n.splice(0,t));return o}async function tEe(e){SS===null&&(SS=(await Wt({path:"/batch/v1",method:"OPTIONS"})).endpoints[0].args.requests.maxItems);const t=[];for(const n of eEe(e,SS)){const o=await Wt({path:"/batch/v1",method:"POST",data:{validation:"require-all-validate",requests:n.map(s=>({path:s.path,body:s.data,method:s.method,headers:s.headers}))}});let r;o.failed?r=o.responses.map(s=>({error:s?.body})):r=o.responses.map(s=>{const i={};return s.status>=200&&s.status<300?i.output=s.body:i.error=s.body,i}),t.push(...r)}return t}function nEe(e=tEe){let t=0,n=[];const o=new oEe;return{add(r){const s=++t;o.add(s);const i=c=>new Promise((l,u)=>{n.push({input:c,resolve:l,reject:u}),o.delete(s)});return typeof r=="function"?Promise.resolve(r(i)).finally(()=>{o.delete(s)}):i(r)},async run(){o.size&&await new Promise(i=>{const c=o.subscribe(()=>{o.size||(c(),i(void 0))})});let r;try{if(r=await e(n.map(({input:i})=>i)),r.length!==n.length)throw new Error("run: Array returned by processor must be same size as input array.")}catch(i){for(const{reject:c}of n)c(i);throw i}let s=!0;return r.forEach((i,c)=>{const l=n[c];if(i?.error)l?.reject(i.error),s=!1;else{var u;l?.resolve((u=i?.output)!==null&&u!==void 0?u:i)}}),n=[],s}}}class oEe{constructor(...t){this.set=new Set(...t),this.subscribers=new Set}get size(){return this.set.size}add(t){return this.set.add(t),this.subscribers.forEach(n=>n()),this}delete(t){const n=this.set.delete(t);return this.subscribers.forEach(o=>o()),n}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}}const dU=globalThis||void 0||self,fs=()=>new Map,kE=e=>{const t=fs();return e.forEach((n,o)=>{t.set(o,n)}),t},_1=(e,t,n)=>{let o=e.get(t);return o===void 0&&e.set(t,o=n()),o},rEe=(e,t)=>{const n=[];for(const[o,r]of e)n.push(t(r,o));return n},sEe=(e,t)=>{for(const[n,o]of e)if(t(o,n))return!0;return!1},zd=()=>new Set,CS=e=>e[e.length-1],iEe=(e,t)=>{for(let n=0;n{this.off(t,o),n(...r)};this.on(t,o)}off(t,n){const o=this._observers.get(t);o!==void 0&&(o.delete(n),o.size===0&&this._observers.delete(t))}emit(t,n){return Rl((this._observers.get(t)||fs()).values()).forEach(o=>o(...n))}destroy(){this._observers=fs()}}class d3{constructor(){this._observers=fs()}on(t,n){_1(this._observers,t,zd).add(n)}once(t,n){const o=(...r)=>{this.off(t,o),n(...r)};this.on(t,o)}off(t,n){const o=this._observers.get(t);o!==void 0&&(o.delete(n),o.size===0&&this._observers.delete(t))}emit(t,n){return Rl((this._observers.get(t)||fs()).values()).forEach(o=>o(...n))}destroy(){this._observers=fs()}}const Oc=Math.floor,Nv=Math.abs,lEe=Math.log10,sB=(e,t)=>ee>t?e:t,h1e=e=>e!==0?e<0:1/e<0,pU=1,fU=2,qS=4,RS=8,VM=32,Ol=64,Ns=128,B5=31,SE=63,ef=127,uEe=2147483647,m1e=Number.MAX_SAFE_INTEGER,dEe=Number.isInteger||(e=>typeof e=="number"&&isFinite(e)&&Oc(e)===e),pEe=String.fromCharCode,fEe=e=>e.toLowerCase(),bEe=/^\s*/g,hEe=e=>e.replace(bEe,""),mEe=/([A-Z])/g,bU=(e,t)=>hEe(e.replace(mEe,n=>`${t}${fEe(n)}`)),gEe=e=>{const t=unescape(encodeURIComponent(e)),n=t.length,o=new Uint8Array(n);for(let r=0;rHM.encode(e),CE=HM?MEe:gEe;let OM=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});OM&&OM.decode(new Uint8Array).length===1&&(OM=null);class p3{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const k0=()=>new p3,zEe=e=>{let t=e.cpos;for(let n=0;n{const t=new Uint8Array(zEe(e));let n=0;for(let o=0;o{const n=e.cbuf.length;n-e.cpos{const n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},UM=x0,sn=(e,t)=>{for(;t>ef;)x0(e,Ns|ef&t),t=Oc(t/128);x0(e,ef&t)},iB=(e,t)=>{const n=h1e(t);for(n&&(t=-t),x0(e,(t>SE?Ns:0)|(n?Ol:0)|SE&t),t=Oc(t/64);t>0;)x0(e,(t>ef?Ns:0)|ef&t),t=Oc(t/128)},qE=new Uint8Array(3e4),yEe=qE.length/3,AEe=(e,t)=>{if(t.length{const n=unescape(encodeURIComponent(t)),o=n.length;sn(e,o);for(let r=0;r{const n=e.cbuf.length,o=e.cpos,r=sB(n-o,t.length),s=t.length-r;e.cbuf.set(t.subarray(0,r),o),e.cpos+=r,s>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array($f(n*2,s)),e.cbuf.set(t.subarray(r)),e.cpos=s)},Pr=(e,t)=>{sn(e,t.byteLength),L5(e,t)},aB=(e,t)=>{OEe(e,t);const n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},xEe=(e,t)=>aB(e,4).setFloat32(0,t,!1),wEe=(e,t)=>aB(e,8).setFloat64(0,t,!1),_Ee=(e,t)=>aB(e,8).setBigInt64(0,t,!1),hU=new DataView(new ArrayBuffer(4)),kEe=e=>(hU.setFloat32(0,e),hU.getFloat32(0)===e),th=(e,t)=>{switch(typeof t){case"string":x0(e,119),uc(e,t);break;case"number":dEe(t)&&Nv(t)<=uEe?(x0(e,125),iB(e,t)):kEe(t)?(x0(e,124),xEe(e,t)):(x0(e,123),wEe(e,t));break;case"bigint":x0(e,122),_Ee(e,t);break;case"object":if(t===null)x0(e,126);else if(aEe(t)){x0(e,117),sn(e,t.length);for(let n=0;n0&&sn(this,this.count-1),this.count=1,this.w(this,t),this.s=t)}}const gU=e=>{e.count>0&&(iB(e.encoder,e.count===1?e.s:-e.s),e.count>1&&sn(e.encoder,e.count-2))};class Bv{constructor(){this.encoder=new p3,this.s=0,this.count=0}write(t){this.s===t?this.count++:(gU(this),this.count=1,this.s=t)}toUint8Array(){return gU(this),kr(this.encoder)}}const MU=e=>{if(e.count>0){const t=e.diff*2+(e.count===1?0:1);iB(e.encoder,t),e.count>1&&sn(e.encoder,e.count-2)}};class TS{constructor(){this.encoder=new p3,this.s=0,this.count=0,this.diff=0}write(t){this.diff===t-this.s?(this.s=t,this.count++):(MU(this),this.count=1,this.diff=t-this.s,this.s=t)}toUint8Array(){return MU(this),kr(this.encoder)}}class SEe{constructor(){this.sarr=[],this.s="",this.lensE=new Bv}write(t){this.s+=t,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(t.length)}toUint8Array(){const t=new p3;return this.sarr.push(this.s),this.s="",uc(t,this.sarr.join("")),L5(t,this.lensE.toUint8Array()),kr(t)}}const fa=e=>new Error(e),dc=()=>{throw fa("Method unimplemented")},yc=()=>{throw fa("Unexpected case")},g1e=fa("Unexpected end of array"),M1e=fa("Integer out of Range");class P5{constructor(t){this.arr=t,this.pos=0}}const Rc=e=>new P5(e),CEe=e=>e.pos!==e.arr.length,qEe=(e,t)=>{const n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},w0=e=>qEe(e,_n(e)),ff=e=>e.arr[e.pos++],_n=e=>{let t=0,n=1;const o=e.arr.length;for(;e.posm1e)throw M1e}throw g1e},cB=e=>{let t=e.arr[e.pos++],n=t&SE,o=64;const r=(t&Ol)>0?-1:1;if(!(t&Ns))return r*n;const s=e.arr.length;for(;e.posm1e)throw M1e}throw g1e},REe=e=>{let t=_n(e);if(t===0)return"";{let n=String.fromCodePoint(ff(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(ff(e));else for(;t>0;){const o=t<1e4?t:1e4,r=e.arr.subarray(e.pos,e.pos+o);e.pos+=o,n+=String.fromCodePoint.apply(null,r),t-=o}return decodeURIComponent(escape(n))}},TEe=e=>OM.decode(w0(e)),yl=OM?TEe:REe,lB=(e,t)=>{const n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n},EEe=e=>lB(e,4).getFloat32(0,!1),WEe=e=>lB(e,8).getFloat64(0,!1),NEe=e=>lB(e,8).getBigInt64(0,!1),BEe=[e=>{},e=>null,cB,EEe,WEe,NEe,e=>!1,e=>!0,yl,e=>{const t=_n(e),n={};for(let o=0;o{const t=_n(e),n=[];for(let o=0;oBEe[127-ff(e)](e);class zU extends P5{constructor(t,n){super(t),this.reader=n,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),CEe(this)?this.count=_n(this)+1:this.count=-1),this.count--,this.s}}class Lv extends P5{constructor(t){super(t),this.s=0,this.count=0}read(){if(this.count===0){this.s=cB(this);const t=h1e(this.s);this.count=1,t&&(this.s=-this.s,this.count=_n(this)+2)}return this.count--,this.s}}class ES extends P5{constructor(t){super(t),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){const t=cB(this),n=t&1;this.diff=Oc(t/2),this.count=1,n&&(this.count=_n(this)+2)}return this.s+=this.diff,this.count--,this.s}}class LEe{constructor(t){this.decoder=new Lv(t),this.str=yl(this.decoder),this.spos=0}read(){const t=this.spos+this.decoder.read(),n=this.str.slice(this.spos,t);return this.spos=t,n}}const PEe=crypto.getRandomValues.bind(crypto),jEe=Math.random,z1e=()=>PEe(new Uint32Array(1))[0],IEe="10000000-1000-4000-8000"+-1e11,O1e=()=>IEe.replace(/[018]/g,e=>(e^z1e()&15>>e/4).toString(16)),Tl=Date.now,oh=e=>new Promise(e);Promise.all.bind(Promise);const DEe=e=>Promise.reject(e),uB=e=>Promise.resolve(e);var y1e={},j5={};j5.byteLength=VEe;j5.toByteArray=UEe;j5.fromByteArray=KEe;var rc=[],fi=[],FEe=typeof Uint8Array<"u"?Uint8Array:Array,WS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Fb=0,$Ee=WS.length;Fb<$Ee;++Fb)rc[Fb]=WS[Fb],fi[WS.charCodeAt(Fb)]=Fb;fi[45]=62;fi[95]=63;function A1e(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var o=n===t?0:4-n%4;return[n,o]}function VEe(e){var t=A1e(e),n=t[0],o=t[1];return(n+o)*3/4-o}function HEe(e,t,n){return(t+n)*3/4-n}function UEe(e){var t,n=A1e(e),o=n[0],r=n[1],s=new FEe(HEe(e,o,r)),i=0,c=r>0?o-4:o,l;for(l=0;l>16&255,s[i++]=t>>8&255,s[i++]=t&255;return r===2&&(t=fi[e.charCodeAt(l)]<<2|fi[e.charCodeAt(l+1)]>>4,s[i++]=t&255),r===1&&(t=fi[e.charCodeAt(l)]<<10|fi[e.charCodeAt(l+1)]<<4|fi[e.charCodeAt(l+2)]>>2,s[i++]=t>>8&255,s[i++]=t&255),s}function XEe(e){return rc[e>>18&63]+rc[e>>12&63]+rc[e>>6&63]+rc[e&63]}function GEe(e,t,n){for(var o,r=[],s=t;sc?c:i+s));return o===1?(t=e[n-1],r.push(rc[t>>2]+rc[t<<4&63]+"==")):o===2&&(t=(e[n-2]<<8)+e[n-1],r.push(rc[t>>10]+rc[t>>4&63]+rc[t<<2&63]+"=")),r.join("")}var dB={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */dB.read=function(e,t,n,o,r){var s,i,c=r*8-o-1,l=(1<>1,d=-7,p=n?r-1:0,f=n?-1:1,b=e[t+p];for(p+=f,s=b&(1<<-d)-1,b>>=-d,d+=c;d>0;s=s*256+e[t+p],p+=f,d-=8);for(i=s&(1<<-d)-1,s>>=-d,d+=o;d>0;i=i*256+e[t+p],p+=f,d-=8);if(s===0)s=1-u;else{if(s===l)return i?NaN:(b?-1:1)*(1/0);i=i+Math.pow(2,o),s=s-u}return(b?-1:1)*i*Math.pow(2,s-o)};dB.write=function(e,t,n,o,r,s){var i,c,l,u=s*8-r-1,d=(1<>1,f=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=o?0:s-1,h=o?1:-1,g=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(c=isNaN(t)?1:0,i=d):(i=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-i))<1&&(i--,l*=2),i+p>=1?t+=f/l:t+=f*Math.pow(2,1-p),t*l>=2&&(i++,l/=2),i+p>=d?(c=0,i=d):i+p>=1?(c=(t*l-1)*Math.pow(2,r),i=i+p):(c=t*Math.pow(2,p-1)*Math.pow(2,r),i=0));r>=8;e[n+b]=c&255,b+=h,c/=256,r-=8);for(i=i<0;e[n+b]=i&255,b+=h,i/=256,u-=8);e[n+b-h]|=g*128};/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT - */(function(e){const t=j5,n=dB,o=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=d,e.SlowBuffer=y,e.INSPECT_MAX_BYTES=50;const r=2147483647;e.kMaxLength=r;const{Uint8Array:s,ArrayBuffer:i,SharedArrayBuffer:c}=globalThis;d.TYPED_ARRAY_SUPPORT=l(),!d.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function l(){try{const ae=new s(1),H={foo:function(){return 42}};return Object.setPrototypeOf(H,s.prototype),Object.setPrototypeOf(ae,H),ae.foo()===42}catch{return!1}}Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}}),Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}});function u(ae){if(ae>r)throw new RangeError('The value "'+ae+'" is invalid for option "size"');const H=new s(ae);return Object.setPrototypeOf(H,d.prototype),H}function d(ae,H,Y){if(typeof ae=="number"){if(typeof H=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return h(ae)}return p(ae,H,Y)}d.poolSize=8192;function p(ae,H,Y){if(typeof ae=="string")return g(ae,H);if(i.isView(ae))return A(ae);if(ae==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ae);if(Pe(ae,i)||ae&&Pe(ae.buffer,i)||typeof c<"u"&&(Pe(ae,c)||ae&&Pe(ae.buffer,c)))return _(ae,H,Y);if(typeof ae=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const fe=ae.valueOf&&ae.valueOf();if(fe!=null&&fe!==ae)return d.from(fe,H,Y);const Re=v(ae);if(Re)return Re;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof ae[Symbol.toPrimitive]=="function")return d.from(ae[Symbol.toPrimitive]("string"),H,Y);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ae)}d.from=function(ae,H,Y){return p(ae,H,Y)},Object.setPrototypeOf(d.prototype,s.prototype),Object.setPrototypeOf(d,s);function f(ae){if(typeof ae!="number")throw new TypeError('"size" argument must be of type number');if(ae<0)throw new RangeError('The value "'+ae+'" is invalid for option "size"')}function b(ae,H,Y){return f(ae),ae<=0?u(ae):H!==void 0?typeof Y=="string"?u(ae).fill(H,Y):u(ae).fill(H):u(ae)}d.alloc=function(ae,H,Y){return b(ae,H,Y)};function h(ae){return f(ae),u(ae<0?0:M(ae)|0)}d.allocUnsafe=function(ae){return h(ae)},d.allocUnsafeSlow=function(ae){return h(ae)};function g(ae,H){if((typeof H!="string"||H==="")&&(H="utf8"),!d.isEncoding(H))throw new TypeError("Unknown encoding: "+H);const Y=k(ae,H)|0;let fe=u(Y);const Re=fe.write(ae,H);return Re!==Y&&(fe=fe.slice(0,Re)),fe}function z(ae){const H=ae.length<0?0:M(ae.length)|0,Y=u(H);for(let fe=0;fe=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return ae|0}function y(ae){return+ae!=ae&&(ae=0),d.alloc(+ae)}d.isBuffer=function(H){return H!=null&&H._isBuffer===!0&&H!==d.prototype},d.compare=function(H,Y){if(Pe(H,s)&&(H=d.from(H,H.offset,H.byteLength)),Pe(Y,s)&&(Y=d.from(Y,Y.offset,Y.byteLength)),!d.isBuffer(H)||!d.isBuffer(Y))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(H===Y)return 0;let fe=H.length,Re=Y.length;for(let be=0,ze=Math.min(fe,Re);beRe.length?(d.isBuffer(ze)||(ze=d.from(ze)),ze.copy(Re,be)):s.prototype.set.call(Re,ze,be);else if(d.isBuffer(ze))ze.copy(Re,be);else throw new TypeError('"list" argument must be an Array of Buffers');be+=ze.length}return Re};function k(ae,H){if(d.isBuffer(ae))return ae.length;if(i.isView(ae)||Pe(ae,i))return ae.byteLength;if(typeof ae!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof ae);const Y=ae.length,fe=arguments.length>2&&arguments[2]===!0;if(!fe&&Y===0)return 0;let Re=!1;for(;;)switch(H){case"ascii":case"latin1":case"binary":return Y;case"utf8":case"utf-8":return L(ae).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Y*2;case"hex":return Y>>>1;case"base64":return ve(ae).length;default:if(Re)return fe?-1:L(ae).length;H=(""+H).toLowerCase(),Re=!0}}d.byteLength=k;function S(ae,H,Y){let fe=!1;if((H===void 0||H<0)&&(H=0),H>this.length||((Y===void 0||Y>this.length)&&(Y=this.length),Y<=0)||(Y>>>=0,H>>>=0,Y<=H))return"";for(ae||(ae="utf8");;)switch(ae){case"hex":return Q(this,H,Y);case"utf8":case"utf-8":return $(this,H,Y);case"ascii":return Z(this,H,Y);case"latin1":case"binary":return V(this,H,Y);case"base64":return P(this,H,Y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return te(this,H,Y);default:if(fe)throw new TypeError("Unknown encoding: "+ae);ae=(ae+"").toLowerCase(),fe=!0}}d.prototype._isBuffer=!0;function C(ae,H,Y){const fe=ae[H];ae[H]=ae[Y],ae[Y]=fe}d.prototype.swap16=function(){const H=this.length;if(H%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Y=0;YY&&(H+=" ... "),""},o&&(d.prototype[o]=d.prototype.inspect),d.prototype.compare=function(H,Y,fe,Re,be){if(Pe(H,s)&&(H=d.from(H,H.offset,H.byteLength)),!d.isBuffer(H))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof H);if(Y===void 0&&(Y=0),fe===void 0&&(fe=H?H.length:0),Re===void 0&&(Re=0),be===void 0&&(be=this.length),Y<0||fe>H.length||Re<0||be>this.length)throw new RangeError("out of range index");if(Re>=be&&Y>=fe)return 0;if(Re>=be)return-1;if(Y>=fe)return 1;if(Y>>>=0,fe>>>=0,Re>>>=0,be>>>=0,this===H)return 0;let ze=be-Re,nt=fe-Y;const Mt=Math.min(ze,nt),ot=this.slice(Re,be),Ue=H.slice(Y,fe);for(let yt=0;yt2147483647?Y=2147483647:Y<-2147483648&&(Y=-2147483648),Y=+Y,rt(Y)&&(Y=Re?0:ae.length-1),Y<0&&(Y=ae.length+Y),Y>=ae.length){if(Re)return-1;Y=ae.length-1}else if(Y<0)if(Re)Y=0;else return-1;if(typeof H=="string"&&(H=d.from(H,fe)),d.isBuffer(H))return H.length===0?-1:T(ae,H,Y,fe,Re);if(typeof H=="number")return H=H&255,typeof s.prototype.indexOf=="function"?Re?s.prototype.indexOf.call(ae,H,Y):s.prototype.lastIndexOf.call(ae,H,Y):T(ae,[H],Y,fe,Re);throw new TypeError("val must be string, number or Buffer")}function T(ae,H,Y,fe,Re){let be=1,ze=ae.length,nt=H.length;if(fe!==void 0&&(fe=String(fe).toLowerCase(),fe==="ucs2"||fe==="ucs-2"||fe==="utf16le"||fe==="utf-16le")){if(ae.length<2||H.length<2)return-1;be=2,ze/=2,nt/=2,Y/=2}function Mt(Ue,yt){return be===1?Ue[yt]:Ue.readUInt16BE(yt*be)}let ot;if(Re){let Ue=-1;for(ot=Y;otze&&(Y=ze-nt),ot=Y;ot>=0;ot--){let Ue=!0;for(let yt=0;ytRe&&(fe=Re)):fe=Re;const be=H.length;fe>be/2&&(fe=be/2);let ze;for(ze=0;ze>>0,isFinite(fe)?(fe=fe>>>0,Re===void 0&&(Re="utf8")):(Re=fe,fe=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const be=this.length-Y;if((fe===void 0||fe>be)&&(fe=be),H.length>0&&(fe<0||Y<0)||Y>this.length)throw new RangeError("Attempt to write outside buffer bounds");Re||(Re="utf8");let ze=!1;for(;;)switch(Re){case"hex":return E(this,H,Y,fe);case"utf8":case"utf-8":return B(this,H,Y,fe);case"ascii":case"latin1":case"binary":return N(this,H,Y,fe);case"base64":return j(this,H,Y,fe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,H,Y,fe);default:if(ze)throw new TypeError("Unknown encoding: "+Re);Re=(""+Re).toLowerCase(),ze=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function P(ae,H,Y){return H===0&&Y===ae.length?t.fromByteArray(ae):t.fromByteArray(ae.slice(H,Y))}function $(ae,H,Y){Y=Math.min(ae.length,Y);const fe=[];let Re=H;for(;Re239?4:be>223?3:be>191?2:1;if(Re+nt<=Y){let Mt,ot,Ue,yt;switch(nt){case 1:be<128&&(ze=be);break;case 2:Mt=ae[Re+1],(Mt&192)===128&&(yt=(be&31)<<6|Mt&63,yt>127&&(ze=yt));break;case 3:Mt=ae[Re+1],ot=ae[Re+2],(Mt&192)===128&&(ot&192)===128&&(yt=(be&15)<<12|(Mt&63)<<6|ot&63,yt>2047&&(yt<55296||yt>57343)&&(ze=yt));break;case 4:Mt=ae[Re+1],ot=ae[Re+2],Ue=ae[Re+3],(Mt&192)===128&&(ot&192)===128&&(Ue&192)===128&&(yt=(be&15)<<18|(Mt&63)<<12|(ot&63)<<6|Ue&63,yt>65535&&yt<1114112&&(ze=yt))}}ze===null?(ze=65533,nt=1):ze>65535&&(ze-=65536,fe.push(ze>>>10&1023|55296),ze=56320|ze&1023),fe.push(ze),Re+=nt}return X(fe)}const F=4096;function X(ae){const H=ae.length;if(H<=F)return String.fromCharCode.apply(String,ae);let Y="",fe=0;for(;fefe)&&(Y=fe);let Re="";for(let be=H;befe&&(H=fe),Y<0?(Y+=fe,Y<0&&(Y=0)):Y>fe&&(Y=fe),YY)throw new RangeError("Trying to access beyond buffer length")}d.prototype.readUintLE=d.prototype.readUIntLE=function(H,Y,fe){H=H>>>0,Y=Y>>>0,fe||ee(H,Y,this.length);let Re=this[H],be=1,ze=0;for(;++ze>>0,Y=Y>>>0,fe||ee(H,Y,this.length);let Re=this[H+--Y],be=1;for(;Y>0&&(be*=256);)Re+=this[H+--Y]*be;return Re},d.prototype.readUint8=d.prototype.readUInt8=function(H,Y){return H=H>>>0,Y||ee(H,1,this.length),this[H]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(H,Y){return H=H>>>0,Y||ee(H,2,this.length),this[H]|this[H+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(H,Y){return H=H>>>0,Y||ee(H,2,this.length),this[H]<<8|this[H+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(H,Y){return H=H>>>0,Y||ee(H,4,this.length),(this[H]|this[H+1]<<8|this[H+2]<<16)+this[H+3]*16777216},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(H,Y){return H=H>>>0,Y||ee(H,4,this.length),this[H]*16777216+(this[H+1]<<16|this[H+2]<<8|this[H+3])},d.prototype.readBigUInt64LE=wt(function(H){H=H>>>0,pe(H,"offset");const Y=this[H],fe=this[H+7];(Y===void 0||fe===void 0)&&ke(H,this.length-8);const Re=Y+this[++H]*2**8+this[++H]*2**16+this[++H]*2**24,be=this[++H]+this[++H]*2**8+this[++H]*2**16+fe*2**24;return BigInt(Re)+(BigInt(be)<>>0,pe(H,"offset");const Y=this[H],fe=this[H+7];(Y===void 0||fe===void 0)&&ke(H,this.length-8);const Re=Y*2**24+this[++H]*2**16+this[++H]*2**8+this[++H],be=this[++H]*2**24+this[++H]*2**16+this[++H]*2**8+fe;return(BigInt(Re)<>>0,Y=Y>>>0,fe||ee(H,Y,this.length);let Re=this[H],be=1,ze=0;for(;++ze=be&&(Re-=Math.pow(2,8*Y)),Re},d.prototype.readIntBE=function(H,Y,fe){H=H>>>0,Y=Y>>>0,fe||ee(H,Y,this.length);let Re=Y,be=1,ze=this[H+--Re];for(;Re>0&&(be*=256);)ze+=this[H+--Re]*be;return be*=128,ze>=be&&(ze-=Math.pow(2,8*Y)),ze},d.prototype.readInt8=function(H,Y){return H=H>>>0,Y||ee(H,1,this.length),this[H]&128?(255-this[H]+1)*-1:this[H]},d.prototype.readInt16LE=function(H,Y){H=H>>>0,Y||ee(H,2,this.length);const fe=this[H]|this[H+1]<<8;return fe&32768?fe|4294901760:fe},d.prototype.readInt16BE=function(H,Y){H=H>>>0,Y||ee(H,2,this.length);const fe=this[H+1]|this[H]<<8;return fe&32768?fe|4294901760:fe},d.prototype.readInt32LE=function(H,Y){return H=H>>>0,Y||ee(H,4,this.length),this[H]|this[H+1]<<8|this[H+2]<<16|this[H+3]<<24},d.prototype.readInt32BE=function(H,Y){return H=H>>>0,Y||ee(H,4,this.length),this[H]<<24|this[H+1]<<16|this[H+2]<<8|this[H+3]},d.prototype.readBigInt64LE=wt(function(H){H=H>>>0,pe(H,"offset");const Y=this[H],fe=this[H+7];(Y===void 0||fe===void 0)&&ke(H,this.length-8);const Re=this[H+4]+this[H+5]*2**8+this[H+6]*2**16+(fe<<24);return(BigInt(Re)<>>0,pe(H,"offset");const Y=this[H],fe=this[H+7];(Y===void 0||fe===void 0)&&ke(H,this.length-8);const Re=(Y<<24)+this[++H]*2**16+this[++H]*2**8+this[++H];return(BigInt(Re)<>>0,Y||ee(H,4,this.length),n.read(this,H,!0,23,4)},d.prototype.readFloatBE=function(H,Y){return H=H>>>0,Y||ee(H,4,this.length),n.read(this,H,!1,23,4)},d.prototype.readDoubleLE=function(H,Y){return H=H>>>0,Y||ee(H,8,this.length),n.read(this,H,!0,52,8)},d.prototype.readDoubleBE=function(H,Y){return H=H>>>0,Y||ee(H,8,this.length),n.read(this,H,!1,52,8)};function ue(ae,H,Y,fe,Re,be){if(!d.isBuffer(ae))throw new TypeError('"buffer" argument must be a Buffer instance');if(H>Re||Hae.length)throw new RangeError("Index out of range")}d.prototype.writeUintLE=d.prototype.writeUIntLE=function(H,Y,fe,Re){if(H=+H,Y=Y>>>0,fe=fe>>>0,!Re){const nt=Math.pow(2,8*fe)-1;ue(this,H,Y,fe,nt,0)}let be=1,ze=0;for(this[Y]=H&255;++ze>>0,fe=fe>>>0,!Re){const nt=Math.pow(2,8*fe)-1;ue(this,H,Y,fe,nt,0)}let be=fe-1,ze=1;for(this[Y+be]=H&255;--be>=0&&(ze*=256);)this[Y+be]=H/ze&255;return Y+fe},d.prototype.writeUint8=d.prototype.writeUInt8=function(H,Y,fe){return H=+H,Y=Y>>>0,fe||ue(this,H,Y,1,255,0),this[Y]=H&255,Y+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(H,Y,fe){return H=+H,Y=Y>>>0,fe||ue(this,H,Y,2,65535,0),this[Y]=H&255,this[Y+1]=H>>>8,Y+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(H,Y,fe){return H=+H,Y=Y>>>0,fe||ue(this,H,Y,2,65535,0),this[Y]=H>>>8,this[Y+1]=H&255,Y+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(H,Y,fe){return H=+H,Y=Y>>>0,fe||ue(this,H,Y,4,4294967295,0),this[Y+3]=H>>>24,this[Y+2]=H>>>16,this[Y+1]=H>>>8,this[Y]=H&255,Y+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(H,Y,fe){return H=+H,Y=Y>>>0,fe||ue(this,H,Y,4,4294967295,0),this[Y]=H>>>24,this[Y+1]=H>>>16,this[Y+2]=H>>>8,this[Y+3]=H&255,Y+4};function ce(ae,H,Y,fe,Re){re(H,fe,Re,ae,Y,7);let be=Number(H&BigInt(4294967295));ae[Y++]=be,be=be>>8,ae[Y++]=be,be=be>>8,ae[Y++]=be,be=be>>8,ae[Y++]=be;let ze=Number(H>>BigInt(32)&BigInt(4294967295));return ae[Y++]=ze,ze=ze>>8,ae[Y++]=ze,ze=ze>>8,ae[Y++]=ze,ze=ze>>8,ae[Y++]=ze,Y}function me(ae,H,Y,fe,Re){re(H,fe,Re,ae,Y,7);let be=Number(H&BigInt(4294967295));ae[Y+7]=be,be=be>>8,ae[Y+6]=be,be=be>>8,ae[Y+5]=be,be=be>>8,ae[Y+4]=be;let ze=Number(H>>BigInt(32)&BigInt(4294967295));return ae[Y+3]=ze,ze=ze>>8,ae[Y+2]=ze,ze=ze>>8,ae[Y+1]=ze,ze=ze>>8,ae[Y]=ze,Y+8}d.prototype.writeBigUInt64LE=wt(function(H,Y=0){return ce(this,H,Y,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeBigUInt64BE=wt(function(H,Y=0){return me(this,H,Y,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeIntLE=function(H,Y,fe,Re){if(H=+H,Y=Y>>>0,!Re){const Mt=Math.pow(2,8*fe-1);ue(this,H,Y,fe,Mt-1,-Mt)}let be=0,ze=1,nt=0;for(this[Y]=H&255;++be>0)-nt&255;return Y+fe},d.prototype.writeIntBE=function(H,Y,fe,Re){if(H=+H,Y=Y>>>0,!Re){const Mt=Math.pow(2,8*fe-1);ue(this,H,Y,fe,Mt-1,-Mt)}let be=fe-1,ze=1,nt=0;for(this[Y+be]=H&255;--be>=0&&(ze*=256);)H<0&&nt===0&&this[Y+be+1]!==0&&(nt=1),this[Y+be]=(H/ze>>0)-nt&255;return Y+fe},d.prototype.writeInt8=function(H,Y,fe){return H=+H,Y=Y>>>0,fe||ue(this,H,Y,1,127,-128),H<0&&(H=255+H+1),this[Y]=H&255,Y+1},d.prototype.writeInt16LE=function(H,Y,fe){return H=+H,Y=Y>>>0,fe||ue(this,H,Y,2,32767,-32768),this[Y]=H&255,this[Y+1]=H>>>8,Y+2},d.prototype.writeInt16BE=function(H,Y,fe){return H=+H,Y=Y>>>0,fe||ue(this,H,Y,2,32767,-32768),this[Y]=H>>>8,this[Y+1]=H&255,Y+2},d.prototype.writeInt32LE=function(H,Y,fe){return H=+H,Y=Y>>>0,fe||ue(this,H,Y,4,2147483647,-2147483648),this[Y]=H&255,this[Y+1]=H>>>8,this[Y+2]=H>>>16,this[Y+3]=H>>>24,Y+4},d.prototype.writeInt32BE=function(H,Y,fe){return H=+H,Y=Y>>>0,fe||ue(this,H,Y,4,2147483647,-2147483648),H<0&&(H=4294967295+H+1),this[Y]=H>>>24,this[Y+1]=H>>>16,this[Y+2]=H>>>8,this[Y+3]=H&255,Y+4},d.prototype.writeBigInt64LE=wt(function(H,Y=0){return ce(this,H,Y,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeBigInt64BE=wt(function(H,Y=0){return me(this,H,Y,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function de(ae,H,Y,fe,Re,be){if(Y+fe>ae.length)throw new RangeError("Index out of range");if(Y<0)throw new RangeError("Index out of range")}function Ae(ae,H,Y,fe,Re){return H=+H,Y=Y>>>0,Re||de(ae,H,Y,4),n.write(ae,H,Y,fe,23,4),Y+4}d.prototype.writeFloatLE=function(H,Y,fe){return Ae(this,H,Y,!0,fe)},d.prototype.writeFloatBE=function(H,Y,fe){return Ae(this,H,Y,!1,fe)};function ye(ae,H,Y,fe,Re){return H=+H,Y=Y>>>0,Re||de(ae,H,Y,8),n.write(ae,H,Y,fe,52,8),Y+8}d.prototype.writeDoubleLE=function(H,Y,fe){return ye(this,H,Y,!0,fe)},d.prototype.writeDoubleBE=function(H,Y,fe){return ye(this,H,Y,!1,fe)},d.prototype.copy=function(H,Y,fe,Re){if(!d.isBuffer(H))throw new TypeError("argument should be a Buffer");if(fe||(fe=0),!Re&&Re!==0&&(Re=this.length),Y>=H.length&&(Y=H.length),Y||(Y=0),Re>0&&Re=this.length)throw new RangeError("Index out of range");if(Re<0)throw new RangeError("sourceEnd out of bounds");Re>this.length&&(Re=this.length),H.length-Y>>0,fe=fe===void 0?this.length:fe>>>0,H||(H=0);let be;if(typeof H=="number")for(be=Y;be2**32?Re=ie(String(Y)):typeof Y=="bigint"&&(Re=String(Y),(Y>BigInt(2)**BigInt(32)||Y<-(BigInt(2)**BigInt(32)))&&(Re=ie(Re)),Re+="n"),fe+=` It must be ${H}. Received ${Re}`,fe},RangeError);function ie(ae){let H="",Y=ae.length;const fe=ae[0]==="-"?1:0;for(;Y>=fe+4;Y-=3)H=`_${ae.slice(Y-3,Y)}${H}`;return`${ae.slice(0,Y)}${H}`}function we(ae,H,Y){pe(H,"offset"),(ae[H]===void 0||ae[H+Y]===void 0)&&ke(H,ae.length-(Y+1))}function re(ae,H,Y,fe,Re,be){if(ae>Y||ae= 0${ze} and < 2${ze} ** ${(be+1)*8}${ze}`:nt=`>= -(2${ze} ** ${(be+1)*8-1}${ze}) and < 2 ** ${(be+1)*8-1}${ze}`,new Ne.ERR_OUT_OF_RANGE("value",nt,ae)}we(fe,Re,be)}function pe(ae,H){if(typeof ae!="number")throw new Ne.ERR_INVALID_ARG_TYPE(H,"number",ae)}function ke(ae,H,Y){throw Math.floor(ae)!==ae?(pe(ae,Y),new Ne.ERR_OUT_OF_RANGE("offset","an integer",ae)):H<0?new Ne.ERR_BUFFER_OUT_OF_BOUNDS:new Ne.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${H}`,ae)}const Se=/[^+/0-9A-Za-z-_]/g;function se(ae){if(ae=ae.split("=")[0],ae=ae.trim().replace(Se,""),ae.length<2)return"";for(;ae.length%4!==0;)ae=ae+"=";return ae}function L(ae,H){H=H||1/0;let Y;const fe=ae.length;let Re=null;const be=[];for(let ze=0;ze55295&&Y<57344){if(!Re){if(Y>56319){(H-=3)>-1&&be.push(239,191,189);continue}else if(ze+1===fe){(H-=3)>-1&&be.push(239,191,189);continue}Re=Y;continue}if(Y<56320){(H-=3)>-1&&be.push(239,191,189),Re=Y;continue}Y=(Re-55296<<10|Y-56320)+65536}else Re&&(H-=3)>-1&&be.push(239,191,189);if(Re=null,Y<128){if((H-=1)<0)break;be.push(Y)}else if(Y<2048){if((H-=2)<0)break;be.push(Y>>6|192,Y&63|128)}else if(Y<65536){if((H-=3)<0)break;be.push(Y>>12|224,Y>>6&63|128,Y&63|128)}else if(Y<1114112){if((H-=4)<0)break;be.push(Y>>18|240,Y>>12&63|128,Y>>6&63|128,Y&63|128)}else throw new Error("Invalid code point")}return be}function U(ae){const H=[];for(let Y=0;Y>8,Re=Y%256,be.push(Re),be.push(fe);return be}function ve(ae){return t.toByteArray(se(ae))}function qe(ae,H,Y,fe){let Re;for(Re=0;Re=H.length||Re>=ae.length);++Re)H[Re+Y]=ae[Re];return Re}function Pe(ae,H){return ae instanceof H||ae!=null&&ae.constructor!=null&&ae.constructor.name!=null&&ae.constructor.name===H.name}function rt(ae){return ae!==ae}const qt=function(){const ae="0123456789abcdef",H=new Array(256);for(let Y=0;Y<16;++Y){const fe=Y*16;for(let Re=0;Re<16;++Re)H[fe+Re]=ae[Y]+ae[Re]}return H}();function wt(ae){return typeof BigInt>"u"?Bt:ae}function Bt(){throw new Error("BigInt not supported")}})(y1e);const rh=y1e.Buffer;function YEe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var v1e={exports:{}},Qr=v1e.exports={},Ka,Ya;function RE(){throw new Error("setTimeout has not been defined")}function TE(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Ka=setTimeout:Ka=RE}catch{Ka=RE}try{typeof clearTimeout=="function"?Ya=clearTimeout:Ya=TE}catch{Ya=TE}})();function x1e(e){if(Ka===setTimeout)return setTimeout(e,0);if((Ka===RE||!Ka)&&setTimeout)return Ka=setTimeout,setTimeout(e,0);try{return Ka(e,0)}catch{try{return Ka.call(null,e,0)}catch{return Ka.call(this,e,0)}}}function ZEe(e){if(Ya===clearTimeout)return clearTimeout(e);if((Ya===TE||!Ya)&&clearTimeout)return Ya=clearTimeout,clearTimeout(e);try{return Ya(e)}catch{try{return Ya.call(null,e)}catch{return Ya.call(this,e)}}}var fl=[],C2=!1,Xp,Pv=-1;function QEe(){!C2||!Xp||(C2=!1,Xp.length?fl=Xp.concat(fl):Pv=-1,fl.length&&w1e())}function w1e(){if(!C2){var e=x1e(QEe);C2=!0;for(var t=fl.length;t;){for(Xp=fl,fl=[];++Pv1)for(var n=1;ne===void 0?null:e;class e8e{constructor(){this.map=new Map}setItem(t,n){this.map.set(t,n)}getItem(t){return this.map.get(t)}}let k1e=new e8e,pB=!0;try{typeof localStorage<"u"&&localStorage&&(k1e=localStorage,pB=!1)}catch{}const S1e=k1e,t8e=e=>pB||addEventListener("storage",e),n8e=e=>pB||removeEventListener("storage",e),o8e=Object.assign,C1e=Object.keys,r8e=(e,t)=>{for(const n in e)t(e[n],n)},yU=e=>C1e(e).length,AU=e=>C1e(e).length,s8e=e=>{for(const t in e)return!1;return!0},i8e=(e,t)=>{for(const n in e)if(!t(e[n],n))return!1;return!0},q1e=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a8e=(e,t)=>e===t||AU(e)===AU(t)&&i8e(e,(n,o)=>(n!==void 0||q1e(t,o))&&t[o]===n),c8e=Object.freeze,R1e=e=>{for(const t in e){const n=e[t];(typeof n=="object"||typeof n=="function")&&R1e(e[t])}return c8e(e)},fB=(e,t,n=0)=>{try{for(;n{},u8e=e=>e,d8e=(e,t)=>e===t,yM=(e,t)=>{if(e==null||t==null)return d8e(e,t);if(e.constructor!==t.constructor)return!1;if(e===t)return!0;switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:{if(e.byteLength!==t.byteLength)return!1;for(let n=0;nt.includes(e);var T1e={};const sh=typeof Oi<"u"&&Oi.release&&/node|io\.js/.test(Oi.release.name)&&Object.prototype.toString.call(typeof Oi<"u"?Oi:0)==="[object process]",E1e=typeof window<"u"&&typeof document<"u"&&!sh;let Pa;const f8e=()=>{if(Pa===void 0)if(sh){Pa=fs();const e=Oi.argv;let t=null;for(let n=0;n{if(e.length!==0){const[t,n]=e.split("=");Pa.set(`--${bU(t,"-")}`,n),Pa.set(`-${bU(t,"-")}`,n)}})):Pa=fs();return Pa},EE=e=>f8e().has(e),XM=e=>OU(sh?T1e[e.toUpperCase().replaceAll("-","_")]:S1e.getItem(e)),W1e=e=>EE("--"+e)||XM(e)!==null;W1e("production");const b8e=sh&&p8e(T1e.FORCE_COLOR,["true","1","2"]),h8e=b8e||!EE("--no-colors")&&!W1e("no-color")&&(!sh||Oi.stdout.isTTY)&&(!sh||EE("--color")||XM("COLORTERM")!==null||(XM("TERM")||"").includes("color")),N1e=e=>new Uint8Array(e),m8e=(e,t,n)=>new Uint8Array(e,t,n),g8e=e=>new Uint8Array(e),M8e=e=>{let t="";for(let n=0;nrh.from(e.buffer,e.byteOffset,e.byteLength).toString("base64"),O8e=e=>{const t=atob(e),n=N1e(t.length);for(let o=0;o{const t=rh.from(e,"base64");return m8e(t.buffer,t.byteOffset,t.byteLength)},B1e=E1e?M8e:z8e,bB=E1e?O8e:y8e,A8e=e=>{const t=N1e(e.byteLength);return t.set(e),t};class v8e{constructor(t,n){this.left=t,this.right=n}}const Yc=(e,t)=>new v8e(e,t);typeof DOMParser<"u"&&new DOMParser;const x8e=e=>rEe(e,(t,n)=>`${n}:${t};`).join(""),w8e=JSON.stringify,Kl=Symbol,ki=Kl(),bf=Kl(),L1e=Kl(),hB=Kl(),P1e=Kl(),j1e=Kl(),I1e=Kl(),I5=Kl(),D5=Kl(),_8e=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());const t=[],n=[];let o=0;for(;o0&&n.push(t.join(""));o{const n=vU[NS],o=XM("log"),r=o!==null&&(o==="*"||o==="true"||new RegExp(o,"gi").test(t));return NS=(NS+1)%vU.length,t+=": ",r?(...s)=>{s.length===1&&s[0]?.constructor===Function&&(s=s[0]());const i=Tl(),c=i-xU;xU=i,e(n,t,D5,...s.map(l=>{switch(l!=null&&l.constructor===Uint8Array&&(l=Array.from(l)),typeof l){case"string":case"symbol":return l;default:return w8e(l)}}),n," +"+c+"ms")}:l8e},S8e={[ki]:Yc("font-weight","bold"),[bf]:Yc("font-weight","normal"),[L1e]:Yc("color","blue"),[P1e]:Yc("color","green"),[hB]:Yc("color","grey"),[j1e]:Yc("color","red"),[I1e]:Yc("color","purple"),[I5]:Yc("color","orange"),[D5]:Yc("color","black")},C8e=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());const t=[],n=[],o=fs();let r=[],s=0;for(;s0||l.length>0?(t.push("%c"+i),n.push(l)):t.push(i)}else break}}for(s>0&&(r=n,r.unshift(t.join("")));s{console.log(...D1e(e)),$1e.forEach(t=>t.print(e))},q8e=(...e)=>{console.warn(...D1e(e)),e.unshift(I5),$1e.forEach(t=>t.print(e))},$1e=zd(),R8e=e=>k8e(F1e,e),V1e=e=>({[Symbol.iterator](){return this},next:e}),T8e=(e,t)=>V1e(()=>{let n;do n=e.next();while(!n.done&&!t(n.value));return n}),BS=(e,t)=>V1e(()=>{const{done:n,value:o}=e.next();return{done:n,value:n?void 0:t(o)}});class mB{constructor(t,n){this.clock=t,this.len=n}}class f3{constructor(){this.clients=new Map}}const H1e=(e,t,n)=>t.clients.forEach((o,r)=>{const s=e.doc.store.clients.get(r);for(let i=0;i{let n=0,o=e.length-1;for(;n<=o;){const r=Oc((n+o)/2),s=e[r],i=s.clock;if(i<=t){if(t{const n=e.clients.get(t.client);return n!==void 0&&E8e(n,t.clock)!==null},gB=e=>{e.clients.forEach(t=>{t.sort((r,s)=>r.clock-s.clock);let n,o;for(n=1,o=1;n=s.clock?r.len=$f(r.len,s.clock+s.len-r.clock):(o{const t=new f3;for(let n=0;n{if(!t.clients.has(r)){const s=o.slice();for(let i=n+1;i{_1(e.clients,t,()=>[]).push(new mB(n,o))},N8e=()=>new f3,B8e=e=>{const t=N8e();return e.clients.forEach((n,o)=>{const r=[];for(let s=0;s0&&t.clients.set(o,r)}),t},Fh=(e,t)=>{sn(e.restEncoder,t.clients.size),Rl(t.clients.entries()).sort((n,o)=>o[0]-n[0]).forEach(([n,o])=>{e.resetDsCurVal(),sn(e.restEncoder,n);const r=o.length;sn(e.restEncoder,r);for(let s=0;s{const t=new f3,n=_n(e.restDecoder);for(let o=0;o0){const i=_1(t.clients,r,()=>[]);for(let c=0;c{const o=new f3,r=_n(e.restDecoder);for(let s=0;s0){const s=new hf;return sn(s.restEncoder,0),Fh(s,o),s.toUint8Array()}return null},X1e=z1e;class $h extends cEe{constructor({guid:t=O1e(),collectionid:n=null,gc:o=!0,gcFilter:r=()=>!0,meta:s=null,autoLoad:i=!1,shouldLoad:c=!0}={}){super(),this.gc=o,this.gcFilter=r,this.clientID=X1e(),this.guid=t,this.collectionid=n,this.share=new Map,this.store=new ose,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=c,this.autoLoad=i,this.meta=s,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=oh(u=>{this.on("load",()=>{this.isLoaded=!0,u(this)})});const l=()=>oh(u=>{const d=p=>{(p===void 0||p===!0)&&(this.off("sync",d),u())};this.on("sync",d)});this.on("sync",u=>{u===!1&&this.isSynced&&(this.whenSynced=l()),this.isSynced=u===void 0||u===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=l()}load(){const t=this._item;t!==null&&!this.shouldLoad&&Ho(t.parent.doc,n=>{n.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(Rl(this.subdocs).map(t=>t.guid))}transact(t,n=null){return Ho(this,t,n)}get(t,n=Y0){const o=_1(this.share,t,()=>{const s=new n;return s._integrate(this,null),s}),r=o.constructor;if(n!==Y0&&r!==n)if(r===Y0){const s=new n;s._map=o._map,o._map.forEach(i=>{for(;i!==null;i=i.left)i.parent=s}),s._start=o._start;for(let i=s._start;i!==null;i=i.right)i.parent=s;return s._length=o._length,this.share.set(t,s),s._integrate(this,null),s}else throw new Error(`Type with the name ${t} has already been defined with a different constructor`);return o}getArray(t=""){return this.get(t,R2)}getText(t=""){return this.get(t,ch)}getMap(t=""){return this.get(t,ah)}getXmlElement(t=""){return this.get(t,lh)}getXmlFragment(t=""){return this.get(t,mf)}toJSON(){const t={};return this.share.forEach((n,o)=>{t[o]=n.toJSON()}),t}destroy(){this.isDestroyed=!0,Rl(this.subdocs).forEach(n=>n.destroy());const t=this._item;if(t!==null){this._item=null;const n=t.content;n.doc=new $h({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=t,Ho(t.parent.doc,o=>{const r=n.doc;t.deleted||o.subdocsAdded.add(r),o.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class G1e{constructor(t){this.restDecoder=t}resetDsCurVal(){}readDsClock(){return _n(this.restDecoder)}readDsLen(){return _n(this.restDecoder)}}class K1e extends G1e{readLeftID(){return to(_n(this.restDecoder),_n(this.restDecoder))}readRightID(){return to(_n(this.restDecoder),_n(this.restDecoder))}readClient(){return _n(this.restDecoder)}readInfo(){return ff(this.restDecoder)}readString(){return yl(this.restDecoder)}readParentInfo(){return _n(this.restDecoder)===1}readTypeRef(){return _n(this.restDecoder)}readLen(){return _n(this.restDecoder)}readAny(){return nh(this.restDecoder)}readBuf(){return A8e(w0(this.restDecoder))}readJSON(){return JSON.parse(yl(this.restDecoder))}readKey(){return yl(this.restDecoder)}}class L8e{constructor(t){this.dsCurrVal=0,this.restDecoder=t}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=_n(this.restDecoder),this.dsCurrVal}readDsLen(){const t=_n(this.restDecoder)+1;return this.dsCurrVal+=t,t}}class ih extends L8e{constructor(t){super(t),this.keys=[],_n(t),this.keyClockDecoder=new ES(w0(t)),this.clientDecoder=new Lv(w0(t)),this.leftClockDecoder=new ES(w0(t)),this.rightClockDecoder=new ES(w0(t)),this.infoDecoder=new zU(w0(t),ff),this.stringDecoder=new LEe(w0(t)),this.parentInfoDecoder=new zU(w0(t),ff),this.typeRefDecoder=new Lv(w0(t)),this.lenDecoder=new Lv(w0(t))}readLeftID(){return new q2(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new q2(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return nh(this.restDecoder)}readBuf(){return w0(this.restDecoder)}readJSON(){return nh(this.restDecoder)}readKey(){const t=this.keyClockDecoder.read();if(t{o=$f(o,t[0].id.clock);const r=Ac(t,o);sn(e.restEncoder,t.length-r),e.writeClient(n),sn(e.restEncoder,o);const s=t[r];s.write(e,o-s.id.clock);for(let i=r+1;i{const o=new Map;n.forEach((r,s)=>{q0(t,s)>r&&o.set(s,r)}),F5(t).forEach((r,s)=>{n.has(s)||o.set(s,0)}),sn(e.restEncoder,o.size),Rl(o.entries()).sort((r,s)=>s[0]-r[0]).forEach(([r,s])=>{P8e(e,t.clients.get(r),r,s)})},j8e=(e,t)=>{const n=fs(),o=_n(e.restDecoder);for(let r=0;r{const o=[];let r=Rl(n.keys()).sort((b,h)=>b-h);if(r.length===0)return null;const s=()=>{if(r.length===0)return null;let b=n.get(r[r.length-1]);for(;b.refs.length===b.i;)if(r.pop(),r.length>0)b=n.get(r[r.length-1]);else return null;return b};let i=s();if(i===null)return null;const c=new ose,l=new Map,u=(b,h)=>{const g=l.get(b);(g==null||g>h)&&l.set(b,h)};let d=i.refs[i.i++];const p=new Map,f=()=>{for(const b of o){const h=b.id.client,g=n.get(h);g?(g.i--,c.clients.set(h,g.refs.slice(g.i)),n.delete(h),g.i=0,g.refs=[]):c.clients.set(h,[b]),r=r.filter(z=>z!==h)}o.length=0};for(;;){if(d.constructor!==Ai){const h=_1(p,d.id.client,()=>q0(t,d.id.client))-d.id.clock;if(h<0)o.push(d),u(d.id.client,d.id.clock-1),f();else{const g=d.getMissing(e,t);if(g!==null){o.push(d);const z=n.get(g)||{refs:[],i:0};if(z.refs.length===z.i)u(g,q0(t,g)),f();else{d=z.refs[z.i++];continue}}else(h===0||h0)d=o.pop();else if(i!==null&&i.i0){const b=new hf;return zB(b,c,new Map),sn(b.restEncoder,0),{missing:l,update:b.toUint8Array()}}return null},D8e=(e,t)=>zB(e,t.doc.store,t.beforeState),F8e=(e,t,n,o=new ih(e))=>Ho(t,r=>{r.local=!1;let s=!1;const i=r.doc,c=i.store,l=j8e(o,i),u=I8e(r,c,l),d=c.pendingStructs;if(d){for(const[f,b]of d.missing)if(bb)&&d.missing.set(f,b)}d.update=W4([d.update,u.update])}}else c.pendingStructs=u;const p=wU(o,r,c);if(c.pendingDs){const f=new ih(Rc(c.pendingDs));_n(f.restDecoder);const b=wU(f,r,c);p&&b?c.pendingDs=W4([p,b]):c.pendingDs=p||b}else c.pendingDs=p;if(s){const f=c.pendingStructs.update;c.pendingStructs=null,Q1e(r.doc,f)}},n,!1),Q1e=(e,t,n,o=ih)=>{const r=Rc(t);F8e(r,e,n,new o(r))},J1e=(e,t,n)=>Q1e(e,t,n,K1e),$8e=(e,t,n=new Map)=>{zB(e,t.store,n),Fh(e,B8e(t.store))},V8e=(e,t=new Uint8Array([0]),n=new hf)=>{const o=ese(t);$8e(n,e,o);const r=[n.toUint8Array()];if(e.store.pendingDs&&r.push(e.store.pendingDs),e.store.pendingStructs&&r.push(sWe(e.store.pendingStructs.update,t)),r.length>1){if(n.constructor===b3)return oWe(r.map((s,i)=>i===0?s:aWe(s)));if(n.constructor===hf)return W4(r)}return r[0]},OB=(e,t)=>V8e(e,t,new b3),H8e=e=>{const t=new Map,n=_n(e.restDecoder);for(let o=0;oH8e(new G1e(Rc(e))),tse=(e,t)=>(sn(e.restEncoder,t.size),Rl(t.entries()).sort((n,o)=>o[0]-n[0]).forEach(([n,o])=>{sn(e.restEncoder,n),sn(e.restEncoder,o)}),e),U8e=(e,t)=>tse(e,F5(t.store)),X8e=(e,t=new Z1e)=>(e instanceof Map?tse(t,e):U8e(t,e),t.toUint8Array()),G8e=e=>X8e(e,new Y1e);class K8e{constructor(){this.l=[]}}const _U=()=>new K8e,kU=(e,t)=>e.l.push(t),SU=(e,t)=>{const n=e.l,o=n.length;e.l=n.filter(r=>t!==r),o===e.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},nse=(e,t,n)=>fB(e.l,[t,n]);class q2{constructor(t,n){this.client=t,this.clock=n}}const pA=(e,t)=>e===t||e!==null&&t!==null&&e.client===t.client&&e.clock===t.clock,to=(e,t)=>new q2(e,t),Y8e=e=>{for(const[t,n]of e.doc.share.entries())if(n===e)return t;throw yc()},o2=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!U1e(t.ds,e.id),WE=(e,t)=>{const n=_1(e.meta,WE,zd),o=e.doc.store;n.has(t)||(t.sv.forEach((r,s)=>{r{}),n.add(t))};class ose{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const F5=e=>{const t=new Map;return e.clients.forEach((n,o)=>{const r=n[n.length-1];t.set(o,r.id.clock+r.length)}),t},q0=(e,t)=>{const n=e.clients.get(t);if(n===void 0)return 0;const o=n[n.length-1];return o.id.clock+o.length},rse=(e,t)=>{let n=e.clients.get(t.id.client);if(n===void 0)n=[],e.clients.set(t.id.client,n);else{const o=n[n.length-1];if(o.id.clock+o.length!==t.id.clock)throw yc()}n.push(t)},Ac=(e,t)=>{let n=0,o=e.length-1,r=e[o],s=r.id.clock;if(s===t)return o;let i=Oc(t/(s+r.length-1)*o);for(;n<=o;){if(r=e[i],s=r.id.clock,s<=t){if(t{const n=e.clients.get(t.client);return n[Ac(n,t.clock)]},LS=Z8e,NE=(e,t,n)=>{const o=Ac(t,n),r=t[o];return r.id.clock{const n=e.doc.store.clients.get(t.client);return n[NE(e,n,t.clock)]},CU=(e,t,n)=>{const o=t.clients.get(n.client),r=Ac(o,n.clock),s=o[r];return n.clock!==s.id.clock+s.length-1&&s.constructor!==yi&&o.splice(r+1,0,I4(e,s,n.clock-s.id.clock+1)),s},Q8e=(e,t,n)=>{const o=e.clients.get(t.id.client);o[Ac(o,t.id.clock)]=n},sse=(e,t,n,o,r)=>{if(o===0)return;const s=n+o;let i=NE(e,t,n),c;do c=t[i++],st.deleteSet.clients.size===0&&!sEe(t.afterState,(n,o)=>t.beforeState.get(o)!==n)?!1:(gB(t.deleteSet),D8e(e,t),Fh(e,t.deleteSet),!0),RU=(e,t,n)=>{const o=t._item;(o===null||o.id.clock<(e.beforeState.get(o.id.client)||0)&&!o.deleted)&&_1(e.changed,t,zd).add(n)},jv=(e,t)=>{let n=e[t],o=e[t-1],r=t;for(;r>0;n=o,o=e[--r-1]){if(o.deleted===n.deleted&&o.constructor===n.constructor&&o.mergeWith(n)){n instanceof b1&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,o);continue}break}const s=t-r;return s&&e.splice(t+1-s,s),s},eWe=(e,t,n)=>{for(const[o,r]of e.clients.entries()){const s=t.clients.get(o);for(let i=r.length-1;i>=0;i--){const c=r[i],l=c.clock+c.len;for(let u=Ac(s,c.clock),d=s[u];u{e.clients.forEach((n,o)=>{const r=t.clients.get(o);for(let s=n.length-1;s>=0;s--){const i=n[s],c=sB(r.length-1,1+Ac(r,i.clock+i.len-1));for(let l=c,u=r[l];l>0&&u.id.clock>=i.clock;u=r[l])l-=1+jv(r,l)}})},ise=(e,t)=>{if(tc.push(()=>{(u._item===null||!u._item.deleted)&&u._callObserver(n,l)})),c.push(()=>{n.changedParentTypes.forEach((l,u)=>{u._dEH.l.length>0&&(u._item===null||!u._item.deleted)&&(l=l.filter(d=>d.target._item===null||!d.target._item.deleted),l.forEach(d=>{d.currentTarget=u,d._path=null}),l.sort((d,p)=>d.path.length-p.path.length),nse(u._dEH,l,n))})}),c.push(()=>o.emit("afterTransaction",[n,o])),fB(c,[]),n._needFormattingCleanup&&yWe(n)}finally{o.gc&&eWe(s,r,o.gcFilter),tWe(s,r),n.afterState.forEach((d,p)=>{const f=n.beforeState.get(p)||0;if(f!==d){const b=r.clients.get(p),h=$f(Ac(b,f),1);for(let g=b.length-1;g>=h;)g-=1+jv(b,g)}});for(let d=i.length-1;d>=0;d--){const{client:p,clock:f}=i[d].id,b=r.clients.get(p),h=Ac(b,f);h+11||h>0&&jv(b,h)}if(!n.local&&n.afterState.get(o.clientID)!==n.beforeState.get(o.clientID)&&(F1e(I5,ki,"[yjs] ",bf,j1e,"Changed the client-id because another client seems to be using it."),o.clientID=X1e()),o.emit("afterTransactionCleanup",[n,o]),o._observers.has("update")){const d=new b3;qU(d,n)&&o.emit("update",[d.toUint8Array(),n.origin,o,n])}if(o._observers.has("updateV2")){const d=new hf;qU(d,n)&&o.emit("updateV2",[d.toUint8Array(),n.origin,o,n])}const{subdocsAdded:c,subdocsLoaded:l,subdocsRemoved:u}=n;(c.size>0||u.size>0||l.size>0)&&(c.forEach(d=>{d.clientID=o.clientID,d.collectionid==null&&(d.collectionid=o.collectionid),o.subdocs.add(d)}),u.forEach(d=>o.subdocs.delete(d)),o.emit("subdocs",[{loaded:l,added:c,removed:u},o,n]),u.forEach(d=>d.destroy())),e.length<=t+1?(o._transactionCleanups=[],o.emit("afterAllTransactions",[o,e])):ise(e,t+1)}}},Ho=(e,t,n=null,o=!0)=>{const r=e._transactionCleanups;let s=!1,i=null;e._transaction===null&&(s=!0,e._transaction=new J8e(e,n,o),r.push(e._transaction),r.length===1&&e.emit("beforeAllTransactions",[e]),e.emit("beforeTransaction",[e._transaction,e]));try{i=t(e._transaction)}finally{if(s){const c=e._transaction===r[0];e._transaction=null,c&&ise(r,0)}}return i};function*nWe(e){const t=_n(e.restDecoder);for(let n=0;nW4(e,K1e,b3),rWe=(e,t)=>{if(e.constructor===yi){const{client:n,clock:o}=e.id;return new yi(to(n,o+t),e.length-t)}else if(e.constructor===Ai){const{client:n,clock:o}=e.id;return new Ai(to(n,o+t),e.length-t)}else{const n=e,{client:o,clock:r}=n.id;return new b1(to(o,r+t),null,to(o,r+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},W4=(e,t=ih,n=hf)=>{if(e.length===1)return e[0];const o=e.map(d=>new t(Rc(d)));let r=o.map(d=>new yB(d,!0)),s=null;const i=new n,c=new AB(i);for(;r=r.filter(f=>f.curr!==null),r.sort((f,b)=>{if(f.curr.id.client===b.curr.id.client){const h=f.curr.id.clock-b.curr.id.clock;return h===0?f.curr.constructor===b.curr.constructor?0:f.curr.constructor===Ai?1:-1:h}else return b.curr.id.client-f.curr.id.client}),r.length!==0;){const d=r[0],p=d.curr.id.client;if(s!==null){let f=d.curr,b=!1;for(;f!==null&&f.id.clock+f.length<=s.struct.id.clock+s.struct.length&&f.id.client>=s.struct.id.client;)f=d.next(),b=!0;if(f===null||f.id.client!==p||b&&f.id.clock>s.struct.id.clock+s.struct.length)continue;if(p!==s.struct.id.client)Hu(c,s.struct,s.offset),s={struct:f,offset:0},d.next();else if(s.struct.id.clock+s.struct.length0&&(s.struct.constructor===Ai?s.struct.length-=h:f=rWe(f,h)),s.struct.mergeWith(f)||(Hu(c,s.struct,s.offset),s={struct:f,offset:0},d.next())}}else s={struct:d.curr,offset:0},d.next();for(let f=d.curr;f!==null&&f.id.client===p&&f.id.clock===s.struct.id.clock+s.struct.length&&f.constructor!==Ai;f=d.next())Hu(c,s.struct,s.offset),s={struct:f,offset:0}}s!==null&&(Hu(c,s.struct,s.offset),s=null),vB(c);const l=o.map(d=>MB(d)),u=W8e(l);return Fh(i,u),i.toUint8Array()},sWe=(e,t,n=ih,o=hf)=>{const r=ese(t),s=new o,i=new AB(s),c=new n(Rc(e)),l=new yB(c,!1);for(;l.curr;){const d=l.curr,p=d.id.client,f=r.get(p)||0;if(l.curr.constructor===Ai){l.next();continue}if(d.id.clock+d.length>f)for(Hu(i,d,$f(f-d.id.clock,0)),l.next();l.curr&&l.curr.id.client===p;)Hu(i,l.curr,0),l.next();else for(;l.curr&&l.curr.id.client===p&&l.curr.id.clock+l.curr.length<=f;)l.next()}vB(i);const u=MB(c);return Fh(s,u),s.toUint8Array()},ase=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:Sr(e.encoder.restEncoder)}),e.encoder.restEncoder=k0(),e.written=0)},Hu=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&ase(e),e.written===0&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),sn(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},vB=e=>{ase(e);const t=e.encoder.restEncoder;sn(t,e.clientStructs.length);for(let n=0;n{const r=new n(Rc(e)),s=new yB(r,!1),i=new o,c=new AB(i);for(let u=s.curr;u!==null;u=s.next())Hu(c,t(u),0);vB(c);const l=MB(r);return Fh(i,l),i.toUint8Array()},aWe=e=>iWe(e,u8e,ih,b3),TU="You must not compute changes after the event-handler fired.";class $5{constructor(t,n){this.target=t,this.currentTarget=t,this.transaction=n,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=cWe(this.currentTarget,this.target))}deletes(t){return U1e(this.transaction.deleteSet,t.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw fa(TU);const t=new Map,n=this.target;this.transaction.changed.get(n).forEach(r=>{if(r!==null){const s=n._map.get(r);let i,c;if(this.adds(s)){let l=s.left;for(;l!==null&&this.adds(l);)l=l.left;if(this.deletes(s))if(l!==null&&this.deletes(l))i="delete",c=CS(l.content.getContent());else return;else l!==null&&this.deletes(l)?(i="update",c=CS(l.content.getContent())):(i="add",c=void 0)}else if(this.deletes(s))i="delete",c=CS(s.content.getContent());else return;t.set(r,{action:i,oldValue:c})}}),this._keys=t}return this._keys}get delta(){return this.changes.delta}adds(t){return t.id.clock>=(this.transaction.beforeState.get(t.id.client)||0)}get changes(){let t=this._changes;if(t===null){if(this.transaction.doc._transactionCleanups.length===0)throw fa(TU);const n=this.target,o=zd(),r=zd(),s=[];if(t={added:o,deleted:r,delta:s,keys:this.keys},this.transaction.changed.get(n).has(null)){let c=null;const l=()=>{c&&s.push(c)};for(let u=n._start;u!==null;u=u.right)u.deleted?this.deletes(u)&&!this.adds(u)&&((c===null||c.delete===void 0)&&(l(),c={delete:0}),c.delete+=u.length,r.add(u)):this.adds(u)?((c===null||c.insert===void 0)&&(l(),c={insert:[]}),c.insert=c.insert.concat(u.content.getContent()),o.add(u)):((c===null||c.retain===void 0)&&(l(),c={retain:0}),c.retain+=u.length);c!==null&&c.retain===void 0&&l()}this._changes=t}return t}}const cWe=(e,t)=>{const n=[];for(;t._item!==null&&t!==e;){if(t._item.parentSub!==null)n.unshift(t._item.parentSub);else{let o=0,r=t._item.parent._start;for(;r!==t._item&&r!==null;)!r.deleted&&r.countable&&(o+=r.length),r=r.right;n.unshift(o)}t=t._item.parent}return n},z1=()=>{q8e("Invalid access: Add Yjs type to a document before reading data.")},cse=80;let xB=0;class lWe{constructor(t,n){t.marker=!0,this.p=t,this.index=n,this.timestamp=xB++}}const uWe=e=>{e.timestamp=xB++},lse=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=xB++},dWe=(e,t,n)=>{if(e.length>=cse){const o=e.reduce((r,s)=>r.timestamp{if(e._start===null||t===0||e._searchMarker===null)return null;const n=e._searchMarker.length===0?null:e._searchMarker.reduce((s,i)=>Nv(t-s.index)t;)o=o.left,!o.deleted&&o.countable&&(r-=o.length);for(;o.left!==null&&o.left.id.client===o.id.client&&o.left.id.clock+o.left.length===o.id.clock;)o=o.left,!o.deleted&&o.countable&&(r-=o.length);return n!==null&&Nv(n.index-r){for(let o=e.length-1;o>=0;o--){const r=e[o];if(n>0){let s=r.p;for(s.marker=!1;s&&(s.deleted||!s.countable);)s=s.left,s&&!s.deleted&&s.countable&&(r.index-=s.length);if(s===null||s.marker===!0){e.splice(o,1);continue}r.p=s,s.marker=!0}(t0&&t===r.index)&&(r.index=$f(t,r.index+n))}},H5=(e,t,n)=>{const o=e,r=t.changedParentTypes;for(;_1(r,e,()=>[]).push(n),e._item!==null;)e=e._item.parent;nse(o._eH,n,t)};class Y0{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=_U(),this._dEH=_U(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(t,n){this.doc=t,this._item=n}_copy(){throw dc()}clone(){throw dc()}_write(t){}get _first(){let t=this._start;for(;t!==null&&t.deleted;)t=t.right;return t}_callObserver(t,n){!t.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(t){kU(this._eH,t)}observeDeep(t){kU(this._dEH,t)}unobserve(t){SU(this._eH,t)}unobserveDeep(t){SU(this._dEH,t)}toJSON(){}}const use=(e,t,n)=>{e.doc??z1(),t<0&&(t=e._length+t),n<0&&(n=e._length+n);let o=n-t;const r=[];let s=e._start;for(;s!==null&&o>0;){if(s.countable&&!s.deleted){const i=s.content.getContent();if(i.length<=t)t-=i.length;else{for(let c=t;c0;c++)r.push(i[c]),o--;t=0}}s=s.right}return r},dse=e=>{e.doc??z1();const t=[];let n=e._start;for(;n!==null;){if(n.countable&&!n.deleted){const o=n.content.getContent();for(let r=0;r{let n=0,o=e._start;for(e.doc??z1();o!==null;){if(o.countable&&!o.deleted){const r=o.content.getContent();for(let s=0;s{const n=[];return KM(e,(o,r)=>{n.push(t(o,r,e))}),n},pWe=e=>{let t=e._start,n=null,o=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;t!==null&&t.deleted;)t=t.right;if(t===null)return{done:!0,value:void 0};n=t.content.getContent(),o=0,t=t.right}const r=n[o++];return n.length<=o&&(n=null),{done:!1,value:r}}}},fse=(e,t)=>{e.doc??z1();const n=V5(e,t);let o=e._start;for(n!==null&&(o=n.p,t-=n.index);o!==null;o=o.right)if(!o.deleted&&o.countable){if(t{let r=n;const s=e.doc,i=s.clientID,c=s.store,l=n===null?t._start:n.right;let u=[];const d=()=>{u.length>0&&(r=new b1(to(i,q0(c,i)),r,r&&r.lastId,l,l&&l.id,t,null,new gf(u)),r.integrate(e,0),u=[])};o.forEach(p=>{if(p===null)u.push(p);else switch(p.constructor){case Number:case Object:case Boolean:case Array:case String:u.push(p);break;default:switch(d(),p.constructor){case Uint8Array:case ArrayBuffer:r=new b1(to(i,q0(c,i)),r,r&&r.lastId,l,l&&l.id,t,null,new h3(new Uint8Array(p))),r.integrate(e,0);break;case $h:r=new b1(to(i,q0(c,i)),r,r&&r.lastId,l,l&&l.id,t,null,new m3(p)),r.integrate(e,0);break;default:if(p instanceof Y0)r=new b1(to(i,q0(c,i)),r,r&&r.lastId,l,l&&l.id,t,null,new Yl(p)),r.integrate(e,0);else throw new Error("Unexpected content type in insert operation")}}}),d()},bse=()=>fa("Length exceeded!"),hse=(e,t,n,o)=>{if(n>t._length)throw bse();if(n===0)return t._searchMarker&&GM(t._searchMarker,n,o.length),N4(e,t,null,o);const r=n,s=V5(t,n);let i=t._start;for(s!==null&&(i=s.p,n-=s.index,n===0&&(i=i.prev,n+=i&&i.countable&&!i.deleted?i.length:0));i!==null;i=i.right)if(!i.deleted&&i.countable){if(n<=i.length){n{let r=(t._searchMarker||[]).reduce((s,i)=>i.index>s.index?i:s,{index:0,p:t._start}).p;if(r)for(;r.right;)r=r.right;return N4(e,t,r,n)},mse=(e,t,n,o)=>{if(o===0)return;const r=n,s=o,i=V5(t,n);let c=t._start;for(i!==null&&(c=i.p,n-=i.index);c!==null&&n>0;c=c.right)!c.deleted&&c.countable&&(n0&&c!==null;)c.deleted||(o0)throw bse();t._searchMarker&&GM(t._searchMarker,r,-s+o)},B4=(e,t,n)=>{const o=t._map.get(n);o!==void 0&&o.delete(e)},wB=(e,t,n,o)=>{const r=t._map.get(n)||null,s=e.doc,i=s.clientID;let c;if(o==null)c=new gf([o]);else switch(o.constructor){case Number:case Object:case Boolean:case Array:case String:c=new gf([o]);break;case Uint8Array:c=new h3(o);break;case $h:c=new m3(o);break;default:if(o instanceof Y0)c=new Yl(o);else throw new Error("Unexpected content type")}new b1(to(i,q0(s.store,i)),r,r&&r.lastId,null,null,t,n,c).integrate(e,0)},_B=(e,t)=>{e.doc??z1();const n=e._map.get(t);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},gse=e=>{const t={};return e.doc??z1(),e._map.forEach((n,o)=>{n.deleted||(t[o]=n.content.getContent()[n.length-1])}),t},Mse=(e,t)=>{e.doc??z1();const n=e._map.get(t);return n!==void 0&&!n.deleted},bWe=(e,t)=>{const n={};return e._map.forEach((o,r)=>{let s=o;for(;s!==null&&(!t.sv.has(s.id.client)||s.id.clock>=(t.sv.get(s.id.client)||0));)s=s.left;s!==null&&o2(s,t)&&(n[r]=s.content.getContent()[s.length-1])}),n},fA=e=>(e.doc??z1(),T8e(e._map.entries(),t=>!t[1].deleted));class hWe extends $5{}class R2 extends Y0{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(t){const n=new R2;return n.push(t),n}_integrate(t,n){super._integrate(t,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new R2}clone(){const t=new R2;return t.insert(0,this.toArray().map(n=>n instanceof Y0?n.clone():n)),t}get length(){return this.doc??z1(),this._length}_callObserver(t,n){super._callObserver(t,n),H5(this,t,new hWe(this,t))}insert(t,n){this.doc!==null?Ho(this.doc,o=>{hse(o,this,t,n)}):this._prelimContent.splice(t,0,...n)}push(t){this.doc!==null?Ho(this.doc,n=>{fWe(n,this,t)}):this._prelimContent.push(...t)}unshift(t){this.insert(0,t)}delete(t,n=1){this.doc!==null?Ho(this.doc,o=>{mse(o,this,t,n)}):this._prelimContent.splice(t,n)}get(t){return fse(this,t)}toArray(){return dse(this)}slice(t=0,n=this.length){return use(this,t,n)}toJSON(){return this.map(t=>t instanceof Y0?t.toJSON():t)}map(t){return pse(this,t)}forEach(t){KM(this,t)}[Symbol.iterator](){return pWe(this)}_write(t){t.writeTypeRef(IWe)}}const mWe=e=>new R2;class gWe extends $5{constructor(t,n,o){super(t,n),this.keysChanged=o}}class ah extends Y0{constructor(t){super(),this._prelimContent=null,t===void 0?this._prelimContent=new Map:this._prelimContent=new Map(t)}_integrate(t,n){super._integrate(t,n),this._prelimContent.forEach((o,r)=>{this.set(r,o)}),this._prelimContent=null}_copy(){return new ah}clone(){const t=new ah;return this.forEach((n,o)=>{t.set(o,n instanceof Y0?n.clone():n)}),t}_callObserver(t,n){H5(this,t,new gWe(this,t,n))}toJSON(){this.doc??z1();const t={};return this._map.forEach((n,o)=>{if(!n.deleted){const r=n.content.getContent()[n.length-1];t[o]=r instanceof Y0?r.toJSON():r}}),t}get size(){return[...fA(this)].length}keys(){return BS(fA(this),t=>t[0])}values(){return BS(fA(this),t=>t[1].content.getContent()[t[1].length-1])}entries(){return BS(fA(this),t=>[t[0],t[1].content.getContent()[t[1].length-1]])}forEach(t){this.doc??z1(),this._map.forEach((n,o)=>{n.deleted||t(n.content.getContent()[n.length-1],o,this)})}[Symbol.iterator](){return this.entries()}delete(t){this.doc!==null?Ho(this.doc,n=>{B4(n,this,t)}):this._prelimContent.delete(t)}set(t,n){return this.doc!==null?Ho(this.doc,o=>{wB(o,this,t,n)}):this._prelimContent.set(t,n),n}get(t){return _B(this,t)}has(t){return Mse(this,t)}clear(){this.doc!==null?Ho(this.doc,t=>{this.forEach(function(n,o,r){B4(t,r,o)})}):this._prelimContent.clear()}_write(t){t.writeTypeRef(DWe)}}const MWe=e=>new ah,Zu=(e,t)=>e===t||typeof e=="object"&&typeof t=="object"&&e&&t&&a8e(e,t);class BE{constructor(t,n,o,r){this.left=t,this.right=n,this.index=o,this.currentAttributes=r}forward(){switch(this.right===null&&yc(),this.right.content.constructor){case m0:this.right.deleted||Vh(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}}const EU=(e,t,n)=>{for(;t.right!==null&&n>0;){switch(t.right.content.constructor){case m0:t.right.deleted||Vh(t.currentAttributes,t.right.content);break;default:t.right.deleted||(n{const r=new Map,s=o?V5(t,n):null;if(s){const i=new BE(s.p.left,s.p,s.index,r);return EU(e,i,n-s.index)}else{const i=new BE(null,t._start,0,r);return EU(e,i,n)}},zse=(e,t,n,o)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===m0&&Zu(o.get(n.right.content.key),n.right.content.value));)n.right.deleted||o.delete(n.right.content.key),n.forward();const r=e.doc,s=r.clientID;o.forEach((i,c)=>{const l=n.left,u=n.right,d=new b1(to(s,q0(r.store,s)),l,l&&l.lastId,u,u&&u.id,t,null,new m0(c,i));d.integrate(e,0),n.right=d,n.forward()})},Vh=(e,t)=>{const{key:n,value:o}=t;o===null?e.delete(n):e.set(n,o)},Ose=(e,t)=>{for(;e.right!==null;){if(!(e.right.deleted||e.right.content.constructor===m0&&Zu(t[e.right.content.key]??null,e.right.content.value)))break;e.forward()}},yse=(e,t,n,o)=>{const r=e.doc,s=r.clientID,i=new Map;for(const c in o){const l=o[c],u=n.currentAttributes.get(c)??null;if(!Zu(u,l)){i.set(c,u);const{left:d,right:p}=n;n.right=new b1(to(s,q0(r.store,s)),d,d&&d.lastId,p,p&&p.id,t,null,new m0(c,l)),n.right.integrate(e,0),n.forward()}}return i},PS=(e,t,n,o,r)=>{n.currentAttributes.forEach((f,b)=>{r[b]===void 0&&(r[b]=null)});const s=e.doc,i=s.clientID;Ose(n,r);const c=yse(e,t,n,r),l=o.constructor===String?new vc(o):o instanceof Y0?new Yl(o):new Vf(o);let{left:u,right:d,index:p}=n;t._searchMarker&&GM(t._searchMarker,n.index,l.getLength()),d=new b1(to(i,q0(s.store,i)),u,u&&u.lastId,d,d&&d.id,t,null,l),d.integrate(e,0),n.right=d,n.index=p,n.forward(),zse(e,t,n,c)},WU=(e,t,n,o,r)=>{const s=e.doc,i=s.clientID;Ose(n,r);const c=yse(e,t,n,r);e:for(;n.right!==null&&(o>0||c.size>0&&(n.right.deleted||n.right.content.constructor===m0));){if(!n.right.deleted)switch(n.right.content.constructor){case m0:{const{key:l,value:u}=n.right.content,d=r[l];if(d!==void 0){if(Zu(d,u))c.delete(l);else{if(o===0)break e;c.set(l,u)}n.right.delete(e)}else n.currentAttributes.set(l,u);break}default:o0){let l="";for(;o>0;o--)l+=` + */(function(e){const t=j5,n=dB,o=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=d,e.SlowBuffer=y,e.INSPECT_MAX_BYTES=50;const r=2147483647;e.kMaxLength=r;const{Uint8Array:s,ArrayBuffer:i,SharedArrayBuffer:c}=globalThis;d.TYPED_ARRAY_SUPPORT=l(),!d.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function l(){try{const ae=new s(1),H={foo:function(){return 42}};return Object.setPrototypeOf(H,s.prototype),Object.setPrototypeOf(ae,H),ae.foo()===42}catch{return!1}}Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}}),Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}});function u(ae){if(ae>r)throw new RangeError('The value "'+ae+'" is invalid for option "size"');const H=new s(ae);return Object.setPrototypeOf(H,d.prototype),H}function d(ae,H,Y){if(typeof ae=="number"){if(typeof H=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return h(ae)}return p(ae,H,Y)}d.poolSize=8192;function p(ae,H,Y){if(typeof ae=="string")return g(ae,H);if(i.isView(ae))return A(ae);if(ae==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ae);if(Pe(ae,i)||ae&&Pe(ae.buffer,i)||typeof c<"u"&&(Pe(ae,c)||ae&&Pe(ae.buffer,c)))return _(ae,H,Y);if(typeof ae=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const fe=ae.valueOf&&ae.valueOf();if(fe!=null&&fe!==ae)return d.from(fe,H,Y);const Re=v(ae);if(Re)return Re;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof ae[Symbol.toPrimitive]=="function")return d.from(ae[Symbol.toPrimitive]("string"),H,Y);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ae)}d.from=function(ae,H,Y){return p(ae,H,Y)},Object.setPrototypeOf(d.prototype,s.prototype),Object.setPrototypeOf(d,s);function f(ae){if(typeof ae!="number")throw new TypeError('"size" argument must be of type number');if(ae<0)throw new RangeError('The value "'+ae+'" is invalid for option "size"')}function b(ae,H,Y){return f(ae),ae<=0?u(ae):H!==void 0?typeof Y=="string"?u(ae).fill(H,Y):u(ae).fill(H):u(ae)}d.alloc=function(ae,H,Y){return b(ae,H,Y)};function h(ae){return f(ae),u(ae<0?0:M(ae)|0)}d.allocUnsafe=function(ae){return h(ae)},d.allocUnsafeSlow=function(ae){return h(ae)};function g(ae,H){if((typeof H!="string"||H==="")&&(H="utf8"),!d.isEncoding(H))throw new TypeError("Unknown encoding: "+H);const Y=k(ae,H)|0;let fe=u(Y);const Re=fe.write(ae,H);return Re!==Y&&(fe=fe.slice(0,Re)),fe}function z(ae){const H=ae.length<0?0:M(ae.length)|0,Y=u(H);for(let fe=0;fe=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return ae|0}function y(ae){return+ae!=ae&&(ae=0),d.alloc(+ae)}d.isBuffer=function(H){return H!=null&&H._isBuffer===!0&&H!==d.prototype},d.compare=function(H,Y){if(Pe(H,s)&&(H=d.from(H,H.offset,H.byteLength)),Pe(Y,s)&&(Y=d.from(Y,Y.offset,Y.byteLength)),!d.isBuffer(H)||!d.isBuffer(Y))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(H===Y)return 0;let fe=H.length,Re=Y.length;for(let be=0,ze=Math.min(fe,Re);beRe.length?(d.isBuffer(ze)||(ze=d.from(ze)),ze.copy(Re,be)):s.prototype.set.call(Re,ze,be);else if(d.isBuffer(ze))ze.copy(Re,be);else throw new TypeError('"list" argument must be an Array of Buffers');be+=ze.length}return Re};function k(ae,H){if(d.isBuffer(ae))return ae.length;if(i.isView(ae)||Pe(ae,i))return ae.byteLength;if(typeof ae!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof ae);const Y=ae.length,fe=arguments.length>2&&arguments[2]===!0;if(!fe&&Y===0)return 0;let Re=!1;for(;;)switch(H){case"ascii":case"latin1":case"binary":return Y;case"utf8":case"utf-8":return L(ae).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Y*2;case"hex":return Y>>>1;case"base64":return ve(ae).length;default:if(Re)return fe?-1:L(ae).length;H=(""+H).toLowerCase(),Re=!0}}d.byteLength=k;function S(ae,H,Y){let fe=!1;if((H===void 0||H<0)&&(H=0),H>this.length||((Y===void 0||Y>this.length)&&(Y=this.length),Y<=0)||(Y>>>=0,H>>>=0,Y<=H))return"";for(ae||(ae="utf8");;)switch(ae){case"hex":return Q(this,H,Y);case"utf8":case"utf-8":return $(this,H,Y);case"ascii":return Z(this,H,Y);case"latin1":case"binary":return V(this,H,Y);case"base64":return P(this,H,Y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return te(this,H,Y);default:if(fe)throw new TypeError("Unknown encoding: "+ae);ae=(ae+"").toLowerCase(),fe=!0}}d.prototype._isBuffer=!0;function C(ae,H,Y){const fe=ae[H];ae[H]=ae[Y],ae[Y]=fe}d.prototype.swap16=function(){const H=this.length;if(H%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Y=0;YY&&(H+=" ... "),""},o&&(d.prototype[o]=d.prototype.inspect),d.prototype.compare=function(H,Y,fe,Re,be){if(Pe(H,s)&&(H=d.from(H,H.offset,H.byteLength)),!d.isBuffer(H))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof H);if(Y===void 0&&(Y=0),fe===void 0&&(fe=H?H.length:0),Re===void 0&&(Re=0),be===void 0&&(be=this.length),Y<0||fe>H.length||Re<0||be>this.length)throw new RangeError("out of range index");if(Re>=be&&Y>=fe)return 0;if(Re>=be)return-1;if(Y>=fe)return 1;if(Y>>>=0,fe>>>=0,Re>>>=0,be>>>=0,this===H)return 0;let ze=be-Re,nt=fe-Y;const Mt=Math.min(ze,nt),ot=this.slice(Re,be),Ue=H.slice(Y,fe);for(let yt=0;yt2147483647?Y=2147483647:Y<-2147483648&&(Y=-2147483648),Y=+Y,rt(Y)&&(Y=Re?0:ae.length-1),Y<0&&(Y=ae.length+Y),Y>=ae.length){if(Re)return-1;Y=ae.length-1}else if(Y<0)if(Re)Y=0;else return-1;if(typeof H=="string"&&(H=d.from(H,fe)),d.isBuffer(H))return H.length===0?-1:T(ae,H,Y,fe,Re);if(typeof H=="number")return H=H&255,typeof s.prototype.indexOf=="function"?Re?s.prototype.indexOf.call(ae,H,Y):s.prototype.lastIndexOf.call(ae,H,Y):T(ae,[H],Y,fe,Re);throw new TypeError("val must be string, number or Buffer")}function T(ae,H,Y,fe,Re){let be=1,ze=ae.length,nt=H.length;if(fe!==void 0&&(fe=String(fe).toLowerCase(),fe==="ucs2"||fe==="ucs-2"||fe==="utf16le"||fe==="utf-16le")){if(ae.length<2||H.length<2)return-1;be=2,ze/=2,nt/=2,Y/=2}function Mt(Ue,yt){return be===1?Ue[yt]:Ue.readUInt16BE(yt*be)}let ot;if(Re){let Ue=-1;for(ot=Y;otze&&(Y=ze-nt),ot=Y;ot>=0;ot--){let Ue=!0;for(let yt=0;ytRe&&(fe=Re)):fe=Re;const be=H.length;fe>be/2&&(fe=be/2);let ze;for(ze=0;ze>>0,isFinite(fe)?(fe=fe>>>0,Re===void 0&&(Re="utf8")):(Re=fe,fe=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const be=this.length-Y;if((fe===void 0||fe>be)&&(fe=be),H.length>0&&(fe<0||Y<0)||Y>this.length)throw new RangeError("Attempt to write outside buffer bounds");Re||(Re="utf8");let ze=!1;for(;;)switch(Re){case"hex":return E(this,H,Y,fe);case"utf8":case"utf-8":return B(this,H,Y,fe);case"ascii":case"latin1":case"binary":return N(this,H,Y,fe);case"base64":return j(this,H,Y,fe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,H,Y,fe);default:if(ze)throw new TypeError("Unknown encoding: "+Re);Re=(""+Re).toLowerCase(),ze=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function P(ae,H,Y){return H===0&&Y===ae.length?t.fromByteArray(ae):t.fromByteArray(ae.slice(H,Y))}function $(ae,H,Y){Y=Math.min(ae.length,Y);const fe=[];let Re=H;for(;Re239?4:be>223?3:be>191?2:1;if(Re+nt<=Y){let Mt,ot,Ue,yt;switch(nt){case 1:be<128&&(ze=be);break;case 2:Mt=ae[Re+1],(Mt&192)===128&&(yt=(be&31)<<6|Mt&63,yt>127&&(ze=yt));break;case 3:Mt=ae[Re+1],ot=ae[Re+2],(Mt&192)===128&&(ot&192)===128&&(yt=(be&15)<<12|(Mt&63)<<6|ot&63,yt>2047&&(yt<55296||yt>57343)&&(ze=yt));break;case 4:Mt=ae[Re+1],ot=ae[Re+2],Ue=ae[Re+3],(Mt&192)===128&&(ot&192)===128&&(Ue&192)===128&&(yt=(be&15)<<18|(Mt&63)<<12|(ot&63)<<6|Ue&63,yt>65535&&yt<1114112&&(ze=yt))}}ze===null?(ze=65533,nt=1):ze>65535&&(ze-=65536,fe.push(ze>>>10&1023|55296),ze=56320|ze&1023),fe.push(ze),Re+=nt}return X(fe)}const F=4096;function X(ae){const H=ae.length;if(H<=F)return String.fromCharCode.apply(String,ae);let Y="",fe=0;for(;fefe)&&(Y=fe);let Re="";for(let be=H;befe&&(H=fe),Y<0?(Y+=fe,Y<0&&(Y=0)):Y>fe&&(Y=fe),YY)throw new RangeError("Trying to access beyond buffer length")}d.prototype.readUintLE=d.prototype.readUIntLE=function(H,Y,fe){H=H>>>0,Y=Y>>>0,fe||ee(H,Y,this.length);let Re=this[H],be=1,ze=0;for(;++ze>>0,Y=Y>>>0,fe||ee(H,Y,this.length);let Re=this[H+--Y],be=1;for(;Y>0&&(be*=256);)Re+=this[H+--Y]*be;return Re},d.prototype.readUint8=d.prototype.readUInt8=function(H,Y){return H=H>>>0,Y||ee(H,1,this.length),this[H]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(H,Y){return H=H>>>0,Y||ee(H,2,this.length),this[H]|this[H+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(H,Y){return H=H>>>0,Y||ee(H,2,this.length),this[H]<<8|this[H+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(H,Y){return H=H>>>0,Y||ee(H,4,this.length),(this[H]|this[H+1]<<8|this[H+2]<<16)+this[H+3]*16777216},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(H,Y){return H=H>>>0,Y||ee(H,4,this.length),this[H]*16777216+(this[H+1]<<16|this[H+2]<<8|this[H+3])},d.prototype.readBigUInt64LE=wt(function(H){H=H>>>0,pe(H,"offset");const Y=this[H],fe=this[H+7];(Y===void 0||fe===void 0)&&ke(H,this.length-8);const Re=Y+this[++H]*2**8+this[++H]*2**16+this[++H]*2**24,be=this[++H]+this[++H]*2**8+this[++H]*2**16+fe*2**24;return BigInt(Re)+(BigInt(be)<>>0,pe(H,"offset");const Y=this[H],fe=this[H+7];(Y===void 0||fe===void 0)&&ke(H,this.length-8);const Re=Y*2**24+this[++H]*2**16+this[++H]*2**8+this[++H],be=this[++H]*2**24+this[++H]*2**16+this[++H]*2**8+fe;return(BigInt(Re)<>>0,Y=Y>>>0,fe||ee(H,Y,this.length);let Re=this[H],be=1,ze=0;for(;++ze=be&&(Re-=Math.pow(2,8*Y)),Re},d.prototype.readIntBE=function(H,Y,fe){H=H>>>0,Y=Y>>>0,fe||ee(H,Y,this.length);let Re=Y,be=1,ze=this[H+--Re];for(;Re>0&&(be*=256);)ze+=this[H+--Re]*be;return be*=128,ze>=be&&(ze-=Math.pow(2,8*Y)),ze},d.prototype.readInt8=function(H,Y){return H=H>>>0,Y||ee(H,1,this.length),this[H]&128?(255-this[H]+1)*-1:this[H]},d.prototype.readInt16LE=function(H,Y){H=H>>>0,Y||ee(H,2,this.length);const fe=this[H]|this[H+1]<<8;return fe&32768?fe|4294901760:fe},d.prototype.readInt16BE=function(H,Y){H=H>>>0,Y||ee(H,2,this.length);const fe=this[H+1]|this[H]<<8;return fe&32768?fe|4294901760:fe},d.prototype.readInt32LE=function(H,Y){return H=H>>>0,Y||ee(H,4,this.length),this[H]|this[H+1]<<8|this[H+2]<<16|this[H+3]<<24},d.prototype.readInt32BE=function(H,Y){return H=H>>>0,Y||ee(H,4,this.length),this[H]<<24|this[H+1]<<16|this[H+2]<<8|this[H+3]},d.prototype.readBigInt64LE=wt(function(H){H=H>>>0,pe(H,"offset");const Y=this[H],fe=this[H+7];(Y===void 0||fe===void 0)&&ke(H,this.length-8);const Re=this[H+4]+this[H+5]*2**8+this[H+6]*2**16+(fe<<24);return(BigInt(Re)<>>0,pe(H,"offset");const Y=this[H],fe=this[H+7];(Y===void 0||fe===void 0)&&ke(H,this.length-8);const Re=(Y<<24)+this[++H]*2**16+this[++H]*2**8+this[++H];return(BigInt(Re)<>>0,Y||ee(H,4,this.length),n.read(this,H,!0,23,4)},d.prototype.readFloatBE=function(H,Y){return H=H>>>0,Y||ee(H,4,this.length),n.read(this,H,!1,23,4)},d.prototype.readDoubleLE=function(H,Y){return H=H>>>0,Y||ee(H,8,this.length),n.read(this,H,!0,52,8)},d.prototype.readDoubleBE=function(H,Y){return H=H>>>0,Y||ee(H,8,this.length),n.read(this,H,!1,52,8)};function ue(ae,H,Y,fe,Re,be){if(!d.isBuffer(ae))throw new TypeError('"buffer" argument must be a Buffer instance');if(H>Re||Hae.length)throw new RangeError("Index out of range")}d.prototype.writeUintLE=d.prototype.writeUIntLE=function(H,Y,fe,Re){if(H=+H,Y=Y>>>0,fe=fe>>>0,!Re){const nt=Math.pow(2,8*fe)-1;ue(this,H,Y,fe,nt,0)}let be=1,ze=0;for(this[Y]=H&255;++ze>>0,fe=fe>>>0,!Re){const nt=Math.pow(2,8*fe)-1;ue(this,H,Y,fe,nt,0)}let be=fe-1,ze=1;for(this[Y+be]=H&255;--be>=0&&(ze*=256);)this[Y+be]=H/ze&255;return Y+fe},d.prototype.writeUint8=d.prototype.writeUInt8=function(H,Y,fe){return H=+H,Y=Y>>>0,fe||ue(this,H,Y,1,255,0),this[Y]=H&255,Y+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(H,Y,fe){return H=+H,Y=Y>>>0,fe||ue(this,H,Y,2,65535,0),this[Y]=H&255,this[Y+1]=H>>>8,Y+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(H,Y,fe){return H=+H,Y=Y>>>0,fe||ue(this,H,Y,2,65535,0),this[Y]=H>>>8,this[Y+1]=H&255,Y+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(H,Y,fe){return H=+H,Y=Y>>>0,fe||ue(this,H,Y,4,4294967295,0),this[Y+3]=H>>>24,this[Y+2]=H>>>16,this[Y+1]=H>>>8,this[Y]=H&255,Y+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(H,Y,fe){return H=+H,Y=Y>>>0,fe||ue(this,H,Y,4,4294967295,0),this[Y]=H>>>24,this[Y+1]=H>>>16,this[Y+2]=H>>>8,this[Y+3]=H&255,Y+4};function ce(ae,H,Y,fe,Re){re(H,fe,Re,ae,Y,7);let be=Number(H&BigInt(4294967295));ae[Y++]=be,be=be>>8,ae[Y++]=be,be=be>>8,ae[Y++]=be,be=be>>8,ae[Y++]=be;let ze=Number(H>>BigInt(32)&BigInt(4294967295));return ae[Y++]=ze,ze=ze>>8,ae[Y++]=ze,ze=ze>>8,ae[Y++]=ze,ze=ze>>8,ae[Y++]=ze,Y}function me(ae,H,Y,fe,Re){re(H,fe,Re,ae,Y,7);let be=Number(H&BigInt(4294967295));ae[Y+7]=be,be=be>>8,ae[Y+6]=be,be=be>>8,ae[Y+5]=be,be=be>>8,ae[Y+4]=be;let ze=Number(H>>BigInt(32)&BigInt(4294967295));return ae[Y+3]=ze,ze=ze>>8,ae[Y+2]=ze,ze=ze>>8,ae[Y+1]=ze,ze=ze>>8,ae[Y]=ze,Y+8}d.prototype.writeBigUInt64LE=wt(function(H,Y=0){return ce(this,H,Y,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeBigUInt64BE=wt(function(H,Y=0){return me(this,H,Y,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeIntLE=function(H,Y,fe,Re){if(H=+H,Y=Y>>>0,!Re){const Mt=Math.pow(2,8*fe-1);ue(this,H,Y,fe,Mt-1,-Mt)}let be=0,ze=1,nt=0;for(this[Y]=H&255;++be>0)-nt&255;return Y+fe},d.prototype.writeIntBE=function(H,Y,fe,Re){if(H=+H,Y=Y>>>0,!Re){const Mt=Math.pow(2,8*fe-1);ue(this,H,Y,fe,Mt-1,-Mt)}let be=fe-1,ze=1,nt=0;for(this[Y+be]=H&255;--be>=0&&(ze*=256);)H<0&&nt===0&&this[Y+be+1]!==0&&(nt=1),this[Y+be]=(H/ze>>0)-nt&255;return Y+fe},d.prototype.writeInt8=function(H,Y,fe){return H=+H,Y=Y>>>0,fe||ue(this,H,Y,1,127,-128),H<0&&(H=255+H+1),this[Y]=H&255,Y+1},d.prototype.writeInt16LE=function(H,Y,fe){return H=+H,Y=Y>>>0,fe||ue(this,H,Y,2,32767,-32768),this[Y]=H&255,this[Y+1]=H>>>8,Y+2},d.prototype.writeInt16BE=function(H,Y,fe){return H=+H,Y=Y>>>0,fe||ue(this,H,Y,2,32767,-32768),this[Y]=H>>>8,this[Y+1]=H&255,Y+2},d.prototype.writeInt32LE=function(H,Y,fe){return H=+H,Y=Y>>>0,fe||ue(this,H,Y,4,2147483647,-2147483648),this[Y]=H&255,this[Y+1]=H>>>8,this[Y+2]=H>>>16,this[Y+3]=H>>>24,Y+4},d.prototype.writeInt32BE=function(H,Y,fe){return H=+H,Y=Y>>>0,fe||ue(this,H,Y,4,2147483647,-2147483648),H<0&&(H=4294967295+H+1),this[Y]=H>>>24,this[Y+1]=H>>>16,this[Y+2]=H>>>8,this[Y+3]=H&255,Y+4},d.prototype.writeBigInt64LE=wt(function(H,Y=0){return ce(this,H,Y,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeBigInt64BE=wt(function(H,Y=0){return me(this,H,Y,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function de(ae,H,Y,fe,Re,be){if(Y+fe>ae.length)throw new RangeError("Index out of range");if(Y<0)throw new RangeError("Index out of range")}function Ae(ae,H,Y,fe,Re){return H=+H,Y=Y>>>0,Re||de(ae,H,Y,4),n.write(ae,H,Y,fe,23,4),Y+4}d.prototype.writeFloatLE=function(H,Y,fe){return Ae(this,H,Y,!0,fe)},d.prototype.writeFloatBE=function(H,Y,fe){return Ae(this,H,Y,!1,fe)};function ye(ae,H,Y,fe,Re){return H=+H,Y=Y>>>0,Re||de(ae,H,Y,8),n.write(ae,H,Y,fe,52,8),Y+8}d.prototype.writeDoubleLE=function(H,Y,fe){return ye(this,H,Y,!0,fe)},d.prototype.writeDoubleBE=function(H,Y,fe){return ye(this,H,Y,!1,fe)},d.prototype.copy=function(H,Y,fe,Re){if(!d.isBuffer(H))throw new TypeError("argument should be a Buffer");if(fe||(fe=0),!Re&&Re!==0&&(Re=this.length),Y>=H.length&&(Y=H.length),Y||(Y=0),Re>0&&Re=this.length)throw new RangeError("Index out of range");if(Re<0)throw new RangeError("sourceEnd out of bounds");Re>this.length&&(Re=this.length),H.length-Y>>0,fe=fe===void 0?this.length:fe>>>0,H||(H=0);let be;if(typeof H=="number")for(be=Y;be2**32?Re=ie(String(Y)):typeof Y=="bigint"&&(Re=String(Y),(Y>BigInt(2)**BigInt(32)||Y<-(BigInt(2)**BigInt(32)))&&(Re=ie(Re)),Re+="n"),fe+=` It must be ${H}. Received ${Re}`,fe},RangeError);function ie(ae){let H="",Y=ae.length;const fe=ae[0]==="-"?1:0;for(;Y>=fe+4;Y-=3)H=`_${ae.slice(Y-3,Y)}${H}`;return`${ae.slice(0,Y)}${H}`}function we(ae,H,Y){pe(H,"offset"),(ae[H]===void 0||ae[H+Y]===void 0)&&ke(H,ae.length-(Y+1))}function re(ae,H,Y,fe,Re,be){if(ae>Y||ae= 0${ze} and < 2${ze} ** ${(be+1)*8}${ze}`:nt=`>= -(2${ze} ** ${(be+1)*8-1}${ze}) and < 2 ** ${(be+1)*8-1}${ze}`,new Ne.ERR_OUT_OF_RANGE("value",nt,ae)}we(fe,Re,be)}function pe(ae,H){if(typeof ae!="number")throw new Ne.ERR_INVALID_ARG_TYPE(H,"number",ae)}function ke(ae,H,Y){throw Math.floor(ae)!==ae?(pe(ae,Y),new Ne.ERR_OUT_OF_RANGE("offset","an integer",ae)):H<0?new Ne.ERR_BUFFER_OUT_OF_BOUNDS:new Ne.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${H}`,ae)}const Se=/[^+/0-9A-Za-z-_]/g;function se(ae){if(ae=ae.split("=")[0],ae=ae.trim().replace(Se,""),ae.length<2)return"";for(;ae.length%4!==0;)ae=ae+"=";return ae}function L(ae,H){H=H||1/0;let Y;const fe=ae.length;let Re=null;const be=[];for(let ze=0;ze55295&&Y<57344){if(!Re){if(Y>56319){(H-=3)>-1&&be.push(239,191,189);continue}else if(ze+1===fe){(H-=3)>-1&&be.push(239,191,189);continue}Re=Y;continue}if(Y<56320){(H-=3)>-1&&be.push(239,191,189),Re=Y;continue}Y=(Re-55296<<10|Y-56320)+65536}else Re&&(H-=3)>-1&&be.push(239,191,189);if(Re=null,Y<128){if((H-=1)<0)break;be.push(Y)}else if(Y<2048){if((H-=2)<0)break;be.push(Y>>6|192,Y&63|128)}else if(Y<65536){if((H-=3)<0)break;be.push(Y>>12|224,Y>>6&63|128,Y&63|128)}else if(Y<1114112){if((H-=4)<0)break;be.push(Y>>18|240,Y>>12&63|128,Y>>6&63|128,Y&63|128)}else throw new Error("Invalid code point")}return be}function U(ae){const H=[];for(let Y=0;Y>8,Re=Y%256,be.push(Re),be.push(fe);return be}function ve(ae){return t.toByteArray(se(ae))}function qe(ae,H,Y,fe){let Re;for(Re=0;Re=H.length||Re>=ae.length);++Re)H[Re+Y]=ae[Re];return Re}function Pe(ae,H){return ae instanceof H||ae!=null&&ae.constructor!=null&&ae.constructor.name!=null&&ae.constructor.name===H.name}function rt(ae){return ae!==ae}const qt=function(){const ae="0123456789abcdef",H=new Array(256);for(let Y=0;Y<16;++Y){const fe=Y*16;for(let Re=0;Re<16;++Re)H[fe+Re]=ae[Y]+ae[Re]}return H}();function wt(ae){return typeof BigInt>"u"?Bt:ae}function Bt(){throw new Error("BigInt not supported")}})(y1e);const rh=y1e.Buffer;function YEe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var v1e={exports:{}},Qr=v1e.exports={},Ka,Ya;function RE(){throw new Error("setTimeout has not been defined")}function TE(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Ka=setTimeout:Ka=RE}catch{Ka=RE}try{typeof clearTimeout=="function"?Ya=clearTimeout:Ya=TE}catch{Ya=TE}})();function x1e(e){if(Ka===setTimeout)return setTimeout(e,0);if((Ka===RE||!Ka)&&setTimeout)return Ka=setTimeout,setTimeout(e,0);try{return Ka(e,0)}catch{try{return Ka.call(null,e,0)}catch{return Ka.call(this,e,0)}}}function ZEe(e){if(Ya===clearTimeout)return clearTimeout(e);if((Ya===TE||!Ya)&&clearTimeout)return Ya=clearTimeout,clearTimeout(e);try{return Ya(e)}catch{try{return Ya.call(null,e)}catch{return Ya.call(this,e)}}}var fl=[],C2=!1,Xp,Pv=-1;function QEe(){!C2||!Xp||(C2=!1,Xp.length?fl=Xp.concat(fl):Pv=-1,fl.length&&w1e())}function w1e(){if(!C2){var e=x1e(QEe);C2=!0;for(var t=fl.length;t;){for(Xp=fl,fl=[];++Pv1)for(var n=1;ne===void 0?null:e;class e8e{constructor(){this.map=new Map}setItem(t,n){this.map.set(t,n)}getItem(t){return this.map.get(t)}}let k1e=new e8e,pB=!0;try{typeof localStorage<"u"&&localStorage&&(k1e=localStorage,pB=!1)}catch{}const S1e=k1e,t8e=e=>pB||addEventListener("storage",e),n8e=e=>pB||removeEventListener("storage",e),o8e=Object.assign,C1e=Object.keys,r8e=(e,t)=>{for(const n in e)t(e[n],n)},yU=e=>C1e(e).length,AU=e=>C1e(e).length,s8e=e=>{for(const t in e)return!1;return!0},i8e=(e,t)=>{for(const n in e)if(!t(e[n],n))return!1;return!0},q1e=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a8e=(e,t)=>e===t||AU(e)===AU(t)&&i8e(e,(n,o)=>(n!==void 0||q1e(t,o))&&t[o]===n),c8e=Object.freeze,R1e=e=>{for(const t in e){const n=e[t];(typeof n=="object"||typeof n=="function")&&R1e(e[t])}return c8e(e)},fB=(e,t,n=0)=>{try{for(;n{},u8e=e=>e,d8e=(e,t)=>e===t,yM=(e,t)=>{if(e==null||t==null)return d8e(e,t);if(e.constructor!==t.constructor)return!1;if(e===t)return!0;switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:{if(e.byteLength!==t.byteLength)return!1;for(let n=0;nt.includes(e);var T1e={};const sh=typeof Oi<"u"&&Oi.release&&/node|io\.js/.test(Oi.release.name)&&Object.prototype.toString.call(typeof Oi<"u"?Oi:0)==="[object process]",E1e=typeof window<"u"&&typeof document<"u"&&!sh;let Pa;const f8e=()=>{if(Pa===void 0)if(sh){Pa=fs();const e=Oi.argv;let t=null;for(let n=0;n{if(e.length!==0){const[t,n]=e.split("=");Pa.set(`--${bU(t,"-")}`,n),Pa.set(`-${bU(t,"-")}`,n)}})):Pa=fs();return Pa},EE=e=>f8e().has(e),XM=e=>OU(sh?T1e[e.toUpperCase().replaceAll("-","_")]:S1e.getItem(e)),W1e=e=>EE("--"+e)||XM(e)!==null;W1e("production");const b8e=sh&&p8e(T1e.FORCE_COLOR,["true","1","2"]),h8e=b8e||!EE("--no-colors")&&!W1e("no-color")&&(!sh||Oi.stdout.isTTY)&&(!sh||EE("--color")||XM("COLORTERM")!==null||(XM("TERM")||"").includes("color")),N1e=e=>new Uint8Array(e),m8e=(e,t,n)=>new Uint8Array(e,t,n),g8e=e=>new Uint8Array(e),M8e=e=>{let t="";for(let n=0;nrh.from(e.buffer,e.byteOffset,e.byteLength).toString("base64"),O8e=e=>{const t=atob(e),n=N1e(t.length);for(let o=0;o{const t=rh.from(e,"base64");return m8e(t.buffer,t.byteOffset,t.byteLength)},B1e=E1e?M8e:z8e,bB=E1e?O8e:y8e,A8e=e=>{const t=N1e(e.byteLength);return t.set(e),t};class v8e{constructor(t,n){this.left=t,this.right=n}}const Yc=(e,t)=>new v8e(e,t);typeof DOMParser<"u"&&new DOMParser;const x8e=e=>rEe(e,(t,n)=>`${n}:${t};`).join(""),w8e=JSON.stringify,Kl=Symbol,ki=Kl(),bf=Kl(),L1e=Kl(),hB=Kl(),P1e=Kl(),j1e=Kl(),I1e=Kl(),I5=Kl(),D5=Kl(),_8e=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());const t=[],n=[];let o=0;for(;o0&&n.push(t.join(""));o{const n=vU[NS],o=XM("log"),r=o!==null&&(o==="*"||o==="true"||new RegExp(o,"gi").test(t));return NS=(NS+1)%vU.length,t+=": ",r?(...s)=>{s.length===1&&s[0]?.constructor===Function&&(s=s[0]());const i=Tl(),c=i-xU;xU=i,e(n,t,D5,...s.map(l=>{switch(l!=null&&l.constructor===Uint8Array&&(l=Array.from(l)),typeof l){case"string":case"symbol":return l;default:return w8e(l)}}),n," +"+c+"ms")}:l8e},S8e={[ki]:Yc("font-weight","bold"),[bf]:Yc("font-weight","normal"),[L1e]:Yc("color","blue"),[P1e]:Yc("color","green"),[hB]:Yc("color","grey"),[j1e]:Yc("color","red"),[I1e]:Yc("color","purple"),[I5]:Yc("color","orange"),[D5]:Yc("color","black")},C8e=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());const t=[],n=[],o=fs();let r=[],s=0;for(;s0||l.length>0?(t.push("%c"+i),n.push(l)):t.push(i)}else break}}for(s>0&&(r=n,r.unshift(t.join("")));s{console.log(...D1e(e)),$1e.forEach(t=>t.print(e))},q8e=(...e)=>{console.warn(...D1e(e)),e.unshift(I5),$1e.forEach(t=>t.print(e))},$1e=zd(),R8e=e=>k8e(F1e,e),V1e=e=>({[Symbol.iterator](){return this},next:e}),T8e=(e,t)=>V1e(()=>{let n;do n=e.next();while(!n.done&&!t(n.value));return n}),BS=(e,t)=>V1e(()=>{const{done:n,value:o}=e.next();return{done:n,value:n?void 0:t(o)}});class mB{constructor(t,n){this.clock=t,this.len=n}}class f3{constructor(){this.clients=new Map}}const H1e=(e,t,n)=>t.clients.forEach((o,r)=>{const s=e.doc.store.clients.get(r);for(let i=0;i{let n=0,o=e.length-1;for(;n<=o;){const r=Oc((n+o)/2),s=e[r],i=s.clock;if(i<=t){if(t{const n=e.clients.get(t.client);return n!==void 0&&E8e(n,t.clock)!==null},gB=e=>{e.clients.forEach(t=>{t.sort((r,s)=>r.clock-s.clock);let n,o;for(n=1,o=1;n=s.clock?r.len=$f(r.len,s.clock+s.len-r.clock):(o{const t=new f3;for(let n=0;n{if(!t.clients.has(r)){const s=o.slice();for(let i=n+1;i{_1(e.clients,t,()=>[]).push(new mB(n,o))},N8e=()=>new f3,B8e=e=>{const t=N8e();return e.clients.forEach((n,o)=>{const r=[];for(let s=0;s0&&t.clients.set(o,r)}),t},Fh=(e,t)=>{sn(e.restEncoder,t.clients.size),Rl(t.clients.entries()).sort((n,o)=>o[0]-n[0]).forEach(([n,o])=>{e.resetDsCurVal(),sn(e.restEncoder,n);const r=o.length;sn(e.restEncoder,r);for(let s=0;s{const t=new f3,n=_n(e.restDecoder);for(let o=0;o0){const i=_1(t.clients,r,()=>[]);for(let c=0;c{const o=new f3,r=_n(e.restDecoder);for(let s=0;s0){const s=new hf;return sn(s.restEncoder,0),Fh(s,o),s.toUint8Array()}return null},X1e=z1e;class $h extends cEe{constructor({guid:t=O1e(),collectionid:n=null,gc:o=!0,gcFilter:r=()=>!0,meta:s=null,autoLoad:i=!1,shouldLoad:c=!0}={}){super(),this.gc=o,this.gcFilter=r,this.clientID=X1e(),this.guid=t,this.collectionid=n,this.share=new Map,this.store=new ose,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=c,this.autoLoad=i,this.meta=s,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=oh(u=>{this.on("load",()=>{this.isLoaded=!0,u(this)})});const l=()=>oh(u=>{const d=p=>{(p===void 0||p===!0)&&(this.off("sync",d),u())};this.on("sync",d)});this.on("sync",u=>{u===!1&&this.isSynced&&(this.whenSynced=l()),this.isSynced=u===void 0||u===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=l()}load(){const t=this._item;t!==null&&!this.shouldLoad&&Ho(t.parent.doc,n=>{n.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(Rl(this.subdocs).map(t=>t.guid))}transact(t,n=null){return Ho(this,t,n)}get(t,n=Y0){const o=_1(this.share,t,()=>{const s=new n;return s._integrate(this,null),s}),r=o.constructor;if(n!==Y0&&r!==n)if(r===Y0){const s=new n;s._map=o._map,o._map.forEach(i=>{for(;i!==null;i=i.left)i.parent=s}),s._start=o._start;for(let i=s._start;i!==null;i=i.right)i.parent=s;return s._length=o._length,this.share.set(t,s),s._integrate(this,null),s}else throw new Error(`Type with the name ${t} has already been defined with a different constructor`);return o}getArray(t=""){return this.get(t,R2)}getText(t=""){return this.get(t,ch)}getMap(t=""){return this.get(t,ah)}getXmlElement(t=""){return this.get(t,lh)}getXmlFragment(t=""){return this.get(t,mf)}toJSON(){const t={};return this.share.forEach((n,o)=>{t[o]=n.toJSON()}),t}destroy(){this.isDestroyed=!0,Rl(this.subdocs).forEach(n=>n.destroy());const t=this._item;if(t!==null){this._item=null;const n=t.content;n.doc=new $h({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=t,Ho(t.parent.doc,o=>{const r=n.doc;t.deleted||o.subdocsAdded.add(r),o.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class G1e{constructor(t){this.restDecoder=t}resetDsCurVal(){}readDsClock(){return _n(this.restDecoder)}readDsLen(){return _n(this.restDecoder)}}class K1e extends G1e{readLeftID(){return to(_n(this.restDecoder),_n(this.restDecoder))}readRightID(){return to(_n(this.restDecoder),_n(this.restDecoder))}readClient(){return _n(this.restDecoder)}readInfo(){return ff(this.restDecoder)}readString(){return yl(this.restDecoder)}readParentInfo(){return _n(this.restDecoder)===1}readTypeRef(){return _n(this.restDecoder)}readLen(){return _n(this.restDecoder)}readAny(){return nh(this.restDecoder)}readBuf(){return A8e(w0(this.restDecoder))}readJSON(){return JSON.parse(yl(this.restDecoder))}readKey(){return yl(this.restDecoder)}}class L8e{constructor(t){this.dsCurrVal=0,this.restDecoder=t}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=_n(this.restDecoder),this.dsCurrVal}readDsLen(){const t=_n(this.restDecoder)+1;return this.dsCurrVal+=t,t}}class ih extends L8e{constructor(t){super(t),this.keys=[],_n(t),this.keyClockDecoder=new ES(w0(t)),this.clientDecoder=new Lv(w0(t)),this.leftClockDecoder=new ES(w0(t)),this.rightClockDecoder=new ES(w0(t)),this.infoDecoder=new zU(w0(t),ff),this.stringDecoder=new LEe(w0(t)),this.parentInfoDecoder=new zU(w0(t),ff),this.typeRefDecoder=new Lv(w0(t)),this.lenDecoder=new Lv(w0(t))}readLeftID(){return new q2(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new q2(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return nh(this.restDecoder)}readBuf(){return w0(this.restDecoder)}readJSON(){return nh(this.restDecoder)}readKey(){const t=this.keyClockDecoder.read();if(t{o=$f(o,t[0].id.clock);const r=Ac(t,o);sn(e.restEncoder,t.length-r),e.writeClient(n),sn(e.restEncoder,o);const s=t[r];s.write(e,o-s.id.clock);for(let i=r+1;i{const o=new Map;n.forEach((r,s)=>{q0(t,s)>r&&o.set(s,r)}),F5(t).forEach((r,s)=>{n.has(s)||o.set(s,0)}),sn(e.restEncoder,o.size),Rl(o.entries()).sort((r,s)=>s[0]-r[0]).forEach(([r,s])=>{P8e(e,t.clients.get(r),r,s)})},j8e=(e,t)=>{const n=fs(),o=_n(e.restDecoder);for(let r=0;r{const o=[];let r=Rl(n.keys()).sort((b,h)=>b-h);if(r.length===0)return null;const s=()=>{if(r.length===0)return null;let b=n.get(r[r.length-1]);for(;b.refs.length===b.i;)if(r.pop(),r.length>0)b=n.get(r[r.length-1]);else return null;return b};let i=s();if(i===null)return null;const c=new ose,l=new Map,u=(b,h)=>{const g=l.get(b);(g==null||g>h)&&l.set(b,h)};let d=i.refs[i.i++];const p=new Map,f=()=>{for(const b of o){const h=b.id.client,g=n.get(h);g?(g.i--,c.clients.set(h,g.refs.slice(g.i)),n.delete(h),g.i=0,g.refs=[]):c.clients.set(h,[b]),r=r.filter(z=>z!==h)}o.length=0};for(;;){if(d.constructor!==Ai){const h=_1(p,d.id.client,()=>q0(t,d.id.client))-d.id.clock;if(h<0)o.push(d),u(d.id.client,d.id.clock-1),f();else{const g=d.getMissing(e,t);if(g!==null){o.push(d);const z=n.get(g)||{refs:[],i:0};if(z.refs.length===z.i)u(g,q0(t,g)),f();else{d=z.refs[z.i++];continue}}else(h===0||h0)d=o.pop();else if(i!==null&&i.i0){const b=new hf;return zB(b,c,new Map),sn(b.restEncoder,0),{missing:l,update:b.toUint8Array()}}return null},D8e=(e,t)=>zB(e,t.doc.store,t.beforeState),F8e=(e,t,n,o=new ih(e))=>Ho(t,r=>{r.local=!1;let s=!1;const i=r.doc,c=i.store,l=j8e(o,i),u=I8e(r,c,l),d=c.pendingStructs;if(d){for(const[f,b]of d.missing)if(bb)&&d.missing.set(f,b)}d.update=W4([d.update,u.update])}}else c.pendingStructs=u;const p=wU(o,r,c);if(c.pendingDs){const f=new ih(Rc(c.pendingDs));_n(f.restDecoder);const b=wU(f,r,c);p&&b?c.pendingDs=W4([p,b]):c.pendingDs=p||b}else c.pendingDs=p;if(s){const f=c.pendingStructs.update;c.pendingStructs=null,Q1e(r.doc,f)}},n,!1),Q1e=(e,t,n,o=ih)=>{const r=Rc(t);F8e(r,e,n,new o(r))},J1e=(e,t,n)=>Q1e(e,t,n,K1e),$8e=(e,t,n=new Map)=>{zB(e,t.store,n),Fh(e,B8e(t.store))},V8e=(e,t=new Uint8Array([0]),n=new hf)=>{const o=ese(t);$8e(n,e,o);const r=[n.toUint8Array()];if(e.store.pendingDs&&r.push(e.store.pendingDs),e.store.pendingStructs&&r.push(sWe(e.store.pendingStructs.update,t)),r.length>1){if(n.constructor===b3)return oWe(r.map((s,i)=>i===0?s:aWe(s)));if(n.constructor===hf)return W4(r)}return r[0]},OB=(e,t)=>V8e(e,t,new b3),H8e=e=>{const t=new Map,n=_n(e.restDecoder);for(let o=0;oH8e(new G1e(Rc(e))),tse=(e,t)=>(sn(e.restEncoder,t.size),Rl(t.entries()).sort((n,o)=>o[0]-n[0]).forEach(([n,o])=>{sn(e.restEncoder,n),sn(e.restEncoder,o)}),e),U8e=(e,t)=>tse(e,F5(t.store)),X8e=(e,t=new Z1e)=>(e instanceof Map?tse(t,e):U8e(t,e),t.toUint8Array()),G8e=e=>X8e(e,new Y1e);class K8e{constructor(){this.l=[]}}const _U=()=>new K8e,kU=(e,t)=>e.l.push(t),SU=(e,t)=>{const n=e.l,o=n.length;e.l=n.filter(r=>t!==r),o===e.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},nse=(e,t,n)=>fB(e.l,[t,n]);class q2{constructor(t,n){this.client=t,this.clock=n}}const pA=(e,t)=>e===t||e!==null&&t!==null&&e.client===t.client&&e.clock===t.clock,to=(e,t)=>new q2(e,t),Y8e=e=>{for(const[t,n]of e.doc.share.entries())if(n===e)return t;throw yc()},o2=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!U1e(t.ds,e.id),WE=(e,t)=>{const n=_1(e.meta,WE,zd),o=e.doc.store;n.has(t)||(t.sv.forEach((r,s)=>{r{}),n.add(t))};class ose{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const F5=e=>{const t=new Map;return e.clients.forEach((n,o)=>{const r=n[n.length-1];t.set(o,r.id.clock+r.length)}),t},q0=(e,t)=>{const n=e.clients.get(t);if(n===void 0)return 0;const o=n[n.length-1];return o.id.clock+o.length},rse=(e,t)=>{let n=e.clients.get(t.id.client);if(n===void 0)n=[],e.clients.set(t.id.client,n);else{const o=n[n.length-1];if(o.id.clock+o.length!==t.id.clock)throw yc()}n.push(t)},Ac=(e,t)=>{let n=0,o=e.length-1,r=e[o],s=r.id.clock;if(s===t)return o;let i=Oc(t/(s+r.length-1)*o);for(;n<=o;){if(r=e[i],s=r.id.clock,s<=t){if(t{const n=e.clients.get(t.client);return n[Ac(n,t.clock)]},LS=Z8e,NE=(e,t,n)=>{const o=Ac(t,n),r=t[o];return r.id.clock{const n=e.doc.store.clients.get(t.client);return n[NE(e,n,t.clock)]},CU=(e,t,n)=>{const o=t.clients.get(n.client),r=Ac(o,n.clock),s=o[r];return n.clock!==s.id.clock+s.length-1&&s.constructor!==yi&&o.splice(r+1,0,I4(e,s,n.clock-s.id.clock+1)),s},Q8e=(e,t,n)=>{const o=e.clients.get(t.id.client);o[Ac(o,t.id.clock)]=n},sse=(e,t,n,o,r)=>{if(o===0)return;const s=n+o;let i=NE(e,t,n),c;do c=t[i++],st.deleteSet.clients.size===0&&!sEe(t.afterState,(n,o)=>t.beforeState.get(o)!==n)?!1:(gB(t.deleteSet),D8e(e,t),Fh(e,t.deleteSet),!0),RU=(e,t,n)=>{const o=t._item;(o===null||o.id.clock<(e.beforeState.get(o.id.client)||0)&&!o.deleted)&&_1(e.changed,t,zd).add(n)},jv=(e,t)=>{let n=e[t],o=e[t-1],r=t;for(;r>0;n=o,o=e[--r-1]){if(o.deleted===n.deleted&&o.constructor===n.constructor&&o.mergeWith(n)){n instanceof b1&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,o);continue}break}const s=t-r;return s&&e.splice(t+1-s,s),s},eWe=(e,t,n)=>{for(const[o,r]of e.clients.entries()){const s=t.clients.get(o);for(let i=r.length-1;i>=0;i--){const c=r[i],l=c.clock+c.len;for(let u=Ac(s,c.clock),d=s[u];u{e.clients.forEach((n,o)=>{const r=t.clients.get(o);for(let s=n.length-1;s>=0;s--){const i=n[s],c=sB(r.length-1,1+Ac(r,i.clock+i.len-1));for(let l=c,u=r[l];l>0&&u.id.clock>=i.clock;u=r[l])l-=1+jv(r,l)}})},ise=(e,t)=>{if(tc.push(()=>{(u._item===null||!u._item.deleted)&&u._callObserver(n,l)})),c.push(()=>{n.changedParentTypes.forEach((l,u)=>{u._dEH.l.length>0&&(u._item===null||!u._item.deleted)&&(l=l.filter(d=>d.target._item===null||!d.target._item.deleted),l.forEach(d=>{d.currentTarget=u,d._path=null}),l.sort((d,p)=>d.path.length-p.path.length),nse(u._dEH,l,n))})}),c.push(()=>o.emit("afterTransaction",[n,o])),fB(c,[]),n._needFormattingCleanup&&yWe(n)}finally{o.gc&&eWe(s,r,o.gcFilter),tWe(s,r),n.afterState.forEach((d,p)=>{const f=n.beforeState.get(p)||0;if(f!==d){const b=r.clients.get(p),h=$f(Ac(b,f),1);for(let g=b.length-1;g>=h;)g-=1+jv(b,g)}});for(let d=i.length-1;d>=0;d--){const{client:p,clock:f}=i[d].id,b=r.clients.get(p),h=Ac(b,f);h+11||h>0&&jv(b,h)}if(!n.local&&n.afterState.get(o.clientID)!==n.beforeState.get(o.clientID)&&(F1e(I5,ki,"[yjs] ",bf,j1e,"Changed the client-id because another client seems to be using it."),o.clientID=X1e()),o.emit("afterTransactionCleanup",[n,o]),o._observers.has("update")){const d=new b3;qU(d,n)&&o.emit("update",[d.toUint8Array(),n.origin,o,n])}if(o._observers.has("updateV2")){const d=new hf;qU(d,n)&&o.emit("updateV2",[d.toUint8Array(),n.origin,o,n])}const{subdocsAdded:c,subdocsLoaded:l,subdocsRemoved:u}=n;(c.size>0||u.size>0||l.size>0)&&(c.forEach(d=>{d.clientID=o.clientID,d.collectionid==null&&(d.collectionid=o.collectionid),o.subdocs.add(d)}),u.forEach(d=>o.subdocs.delete(d)),o.emit("subdocs",[{loaded:l,added:c,removed:u},o,n]),u.forEach(d=>d.destroy())),e.length<=t+1?(o._transactionCleanups=[],o.emit("afterAllTransactions",[o,e])):ise(e,t+1)}}},Ho=(e,t,n=null,o=!0)=>{const r=e._transactionCleanups;let s=!1,i=null;e._transaction===null&&(s=!0,e._transaction=new J8e(e,n,o),r.push(e._transaction),r.length===1&&e.emit("beforeAllTransactions",[e]),e.emit("beforeTransaction",[e._transaction,e]));try{i=t(e._transaction)}finally{if(s){const c=e._transaction===r[0];e._transaction=null,c&&ise(r,0)}}return i};function*nWe(e){const t=_n(e.restDecoder);for(let n=0;nW4(e,K1e,b3),rWe=(e,t)=>{if(e.constructor===yi){const{client:n,clock:o}=e.id;return new yi(to(n,o+t),e.length-t)}else if(e.constructor===Ai){const{client:n,clock:o}=e.id;return new Ai(to(n,o+t),e.length-t)}else{const n=e,{client:o,clock:r}=n.id;return new b1(to(o,r+t),null,to(o,r+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},W4=(e,t=ih,n=hf)=>{if(e.length===1)return e[0];const o=e.map(d=>new t(Rc(d)));let r=o.map(d=>new yB(d,!0)),s=null;const i=new n,c=new AB(i);for(;r=r.filter(f=>f.curr!==null),r.sort((f,b)=>{if(f.curr.id.client===b.curr.id.client){const h=f.curr.id.clock-b.curr.id.clock;return h===0?f.curr.constructor===b.curr.constructor?0:f.curr.constructor===Ai?1:-1:h}else return b.curr.id.client-f.curr.id.client}),r.length!==0;){const d=r[0],p=d.curr.id.client;if(s!==null){let f=d.curr,b=!1;for(;f!==null&&f.id.clock+f.length<=s.struct.id.clock+s.struct.length&&f.id.client>=s.struct.id.client;)f=d.next(),b=!0;if(f===null||f.id.client!==p||b&&f.id.clock>s.struct.id.clock+s.struct.length)continue;if(p!==s.struct.id.client)Hu(c,s.struct,s.offset),s={struct:f,offset:0},d.next();else if(s.struct.id.clock+s.struct.length0&&(s.struct.constructor===Ai?s.struct.length-=h:f=rWe(f,h)),s.struct.mergeWith(f)||(Hu(c,s.struct,s.offset),s={struct:f,offset:0},d.next())}}else s={struct:d.curr,offset:0},d.next();for(let f=d.curr;f!==null&&f.id.client===p&&f.id.clock===s.struct.id.clock+s.struct.length&&f.constructor!==Ai;f=d.next())Hu(c,s.struct,s.offset),s={struct:f,offset:0}}s!==null&&(Hu(c,s.struct,s.offset),s=null),vB(c);const l=o.map(d=>MB(d)),u=W8e(l);return Fh(i,u),i.toUint8Array()},sWe=(e,t,n=ih,o=hf)=>{const r=ese(t),s=new o,i=new AB(s),c=new n(Rc(e)),l=new yB(c,!1);for(;l.curr;){const d=l.curr,p=d.id.client,f=r.get(p)||0;if(l.curr.constructor===Ai){l.next();continue}if(d.id.clock+d.length>f)for(Hu(i,d,$f(f-d.id.clock,0)),l.next();l.curr&&l.curr.id.client===p;)Hu(i,l.curr,0),l.next();else for(;l.curr&&l.curr.id.client===p&&l.curr.id.clock+l.curr.length<=f;)l.next()}vB(i);const u=MB(c);return Fh(s,u),s.toUint8Array()},ase=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:kr(e.encoder.restEncoder)}),e.encoder.restEncoder=k0(),e.written=0)},Hu=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&ase(e),e.written===0&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),sn(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},vB=e=>{ase(e);const t=e.encoder.restEncoder;sn(t,e.clientStructs.length);for(let n=0;n{const r=new n(Rc(e)),s=new yB(r,!1),i=new o,c=new AB(i);for(let u=s.curr;u!==null;u=s.next())Hu(c,t(u),0);vB(c);const l=MB(r);return Fh(i,l),i.toUint8Array()},aWe=e=>iWe(e,u8e,ih,b3),TU="You must not compute changes after the event-handler fired.";class $5{constructor(t,n){this.target=t,this.currentTarget=t,this.transaction=n,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=cWe(this.currentTarget,this.target))}deletes(t){return U1e(this.transaction.deleteSet,t.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw fa(TU);const t=new Map,n=this.target;this.transaction.changed.get(n).forEach(r=>{if(r!==null){const s=n._map.get(r);let i,c;if(this.adds(s)){let l=s.left;for(;l!==null&&this.adds(l);)l=l.left;if(this.deletes(s))if(l!==null&&this.deletes(l))i="delete",c=CS(l.content.getContent());else return;else l!==null&&this.deletes(l)?(i="update",c=CS(l.content.getContent())):(i="add",c=void 0)}else if(this.deletes(s))i="delete",c=CS(s.content.getContent());else return;t.set(r,{action:i,oldValue:c})}}),this._keys=t}return this._keys}get delta(){return this.changes.delta}adds(t){return t.id.clock>=(this.transaction.beforeState.get(t.id.client)||0)}get changes(){let t=this._changes;if(t===null){if(this.transaction.doc._transactionCleanups.length===0)throw fa(TU);const n=this.target,o=zd(),r=zd(),s=[];if(t={added:o,deleted:r,delta:s,keys:this.keys},this.transaction.changed.get(n).has(null)){let c=null;const l=()=>{c&&s.push(c)};for(let u=n._start;u!==null;u=u.right)u.deleted?this.deletes(u)&&!this.adds(u)&&((c===null||c.delete===void 0)&&(l(),c={delete:0}),c.delete+=u.length,r.add(u)):this.adds(u)?((c===null||c.insert===void 0)&&(l(),c={insert:[]}),c.insert=c.insert.concat(u.content.getContent()),o.add(u)):((c===null||c.retain===void 0)&&(l(),c={retain:0}),c.retain+=u.length);c!==null&&c.retain===void 0&&l()}this._changes=t}return t}}const cWe=(e,t)=>{const n=[];for(;t._item!==null&&t!==e;){if(t._item.parentSub!==null)n.unshift(t._item.parentSub);else{let o=0,r=t._item.parent._start;for(;r!==t._item&&r!==null;)!r.deleted&&r.countable&&(o+=r.length),r=r.right;n.unshift(o)}t=t._item.parent}return n},z1=()=>{q8e("Invalid access: Add Yjs type to a document before reading data.")},cse=80;let xB=0;class lWe{constructor(t,n){t.marker=!0,this.p=t,this.index=n,this.timestamp=xB++}}const uWe=e=>{e.timestamp=xB++},lse=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=xB++},dWe=(e,t,n)=>{if(e.length>=cse){const o=e.reduce((r,s)=>r.timestamp{if(e._start===null||t===0||e._searchMarker===null)return null;const n=e._searchMarker.length===0?null:e._searchMarker.reduce((s,i)=>Nv(t-s.index)t;)o=o.left,!o.deleted&&o.countable&&(r-=o.length);for(;o.left!==null&&o.left.id.client===o.id.client&&o.left.id.clock+o.left.length===o.id.clock;)o=o.left,!o.deleted&&o.countable&&(r-=o.length);return n!==null&&Nv(n.index-r){for(let o=e.length-1;o>=0;o--){const r=e[o];if(n>0){let s=r.p;for(s.marker=!1;s&&(s.deleted||!s.countable);)s=s.left,s&&!s.deleted&&s.countable&&(r.index-=s.length);if(s===null||s.marker===!0){e.splice(o,1);continue}r.p=s,s.marker=!0}(t0&&t===r.index)&&(r.index=$f(t,r.index+n))}},H5=(e,t,n)=>{const o=e,r=t.changedParentTypes;for(;_1(r,e,()=>[]).push(n),e._item!==null;)e=e._item.parent;nse(o._eH,n,t)};class Y0{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=_U(),this._dEH=_U(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(t,n){this.doc=t,this._item=n}_copy(){throw dc()}clone(){throw dc()}_write(t){}get _first(){let t=this._start;for(;t!==null&&t.deleted;)t=t.right;return t}_callObserver(t,n){!t.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(t){kU(this._eH,t)}observeDeep(t){kU(this._dEH,t)}unobserve(t){SU(this._eH,t)}unobserveDeep(t){SU(this._dEH,t)}toJSON(){}}const use=(e,t,n)=>{e.doc??z1(),t<0&&(t=e._length+t),n<0&&(n=e._length+n);let o=n-t;const r=[];let s=e._start;for(;s!==null&&o>0;){if(s.countable&&!s.deleted){const i=s.content.getContent();if(i.length<=t)t-=i.length;else{for(let c=t;c0;c++)r.push(i[c]),o--;t=0}}s=s.right}return r},dse=e=>{e.doc??z1();const t=[];let n=e._start;for(;n!==null;){if(n.countable&&!n.deleted){const o=n.content.getContent();for(let r=0;r{let n=0,o=e._start;for(e.doc??z1();o!==null;){if(o.countable&&!o.deleted){const r=o.content.getContent();for(let s=0;s{const n=[];return KM(e,(o,r)=>{n.push(t(o,r,e))}),n},pWe=e=>{let t=e._start,n=null,o=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;t!==null&&t.deleted;)t=t.right;if(t===null)return{done:!0,value:void 0};n=t.content.getContent(),o=0,t=t.right}const r=n[o++];return n.length<=o&&(n=null),{done:!1,value:r}}}},fse=(e,t)=>{e.doc??z1();const n=V5(e,t);let o=e._start;for(n!==null&&(o=n.p,t-=n.index);o!==null;o=o.right)if(!o.deleted&&o.countable){if(t{let r=n;const s=e.doc,i=s.clientID,c=s.store,l=n===null?t._start:n.right;let u=[];const d=()=>{u.length>0&&(r=new b1(to(i,q0(c,i)),r,r&&r.lastId,l,l&&l.id,t,null,new gf(u)),r.integrate(e,0),u=[])};o.forEach(p=>{if(p===null)u.push(p);else switch(p.constructor){case Number:case Object:case Boolean:case Array:case String:u.push(p);break;default:switch(d(),p.constructor){case Uint8Array:case ArrayBuffer:r=new b1(to(i,q0(c,i)),r,r&&r.lastId,l,l&&l.id,t,null,new h3(new Uint8Array(p))),r.integrate(e,0);break;case $h:r=new b1(to(i,q0(c,i)),r,r&&r.lastId,l,l&&l.id,t,null,new m3(p)),r.integrate(e,0);break;default:if(p instanceof Y0)r=new b1(to(i,q0(c,i)),r,r&&r.lastId,l,l&&l.id,t,null,new Yl(p)),r.integrate(e,0);else throw new Error("Unexpected content type in insert operation")}}}),d()},bse=()=>fa("Length exceeded!"),hse=(e,t,n,o)=>{if(n>t._length)throw bse();if(n===0)return t._searchMarker&&GM(t._searchMarker,n,o.length),N4(e,t,null,o);const r=n,s=V5(t,n);let i=t._start;for(s!==null&&(i=s.p,n-=s.index,n===0&&(i=i.prev,n+=i&&i.countable&&!i.deleted?i.length:0));i!==null;i=i.right)if(!i.deleted&&i.countable){if(n<=i.length){n{let r=(t._searchMarker||[]).reduce((s,i)=>i.index>s.index?i:s,{index:0,p:t._start}).p;if(r)for(;r.right;)r=r.right;return N4(e,t,r,n)},mse=(e,t,n,o)=>{if(o===0)return;const r=n,s=o,i=V5(t,n);let c=t._start;for(i!==null&&(c=i.p,n-=i.index);c!==null&&n>0;c=c.right)!c.deleted&&c.countable&&(n0&&c!==null;)c.deleted||(o0)throw bse();t._searchMarker&&GM(t._searchMarker,r,-s+o)},B4=(e,t,n)=>{const o=t._map.get(n);o!==void 0&&o.delete(e)},wB=(e,t,n,o)=>{const r=t._map.get(n)||null,s=e.doc,i=s.clientID;let c;if(o==null)c=new gf([o]);else switch(o.constructor){case Number:case Object:case Boolean:case Array:case String:c=new gf([o]);break;case Uint8Array:c=new h3(o);break;case $h:c=new m3(o);break;default:if(o instanceof Y0)c=new Yl(o);else throw new Error("Unexpected content type")}new b1(to(i,q0(s.store,i)),r,r&&r.lastId,null,null,t,n,c).integrate(e,0)},_B=(e,t)=>{e.doc??z1();const n=e._map.get(t);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},gse=e=>{const t={};return e.doc??z1(),e._map.forEach((n,o)=>{n.deleted||(t[o]=n.content.getContent()[n.length-1])}),t},Mse=(e,t)=>{e.doc??z1();const n=e._map.get(t);return n!==void 0&&!n.deleted},bWe=(e,t)=>{const n={};return e._map.forEach((o,r)=>{let s=o;for(;s!==null&&(!t.sv.has(s.id.client)||s.id.clock>=(t.sv.get(s.id.client)||0));)s=s.left;s!==null&&o2(s,t)&&(n[r]=s.content.getContent()[s.length-1])}),n},fA=e=>(e.doc??z1(),T8e(e._map.entries(),t=>!t[1].deleted));class hWe extends $5{}class R2 extends Y0{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(t){const n=new R2;return n.push(t),n}_integrate(t,n){super._integrate(t,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new R2}clone(){const t=new R2;return t.insert(0,this.toArray().map(n=>n instanceof Y0?n.clone():n)),t}get length(){return this.doc??z1(),this._length}_callObserver(t,n){super._callObserver(t,n),H5(this,t,new hWe(this,t))}insert(t,n){this.doc!==null?Ho(this.doc,o=>{hse(o,this,t,n)}):this._prelimContent.splice(t,0,...n)}push(t){this.doc!==null?Ho(this.doc,n=>{fWe(n,this,t)}):this._prelimContent.push(...t)}unshift(t){this.insert(0,t)}delete(t,n=1){this.doc!==null?Ho(this.doc,o=>{mse(o,this,t,n)}):this._prelimContent.splice(t,n)}get(t){return fse(this,t)}toArray(){return dse(this)}slice(t=0,n=this.length){return use(this,t,n)}toJSON(){return this.map(t=>t instanceof Y0?t.toJSON():t)}map(t){return pse(this,t)}forEach(t){KM(this,t)}[Symbol.iterator](){return pWe(this)}_write(t){t.writeTypeRef(IWe)}}const mWe=e=>new R2;class gWe extends $5{constructor(t,n,o){super(t,n),this.keysChanged=o}}class ah extends Y0{constructor(t){super(),this._prelimContent=null,t===void 0?this._prelimContent=new Map:this._prelimContent=new Map(t)}_integrate(t,n){super._integrate(t,n),this._prelimContent.forEach((o,r)=>{this.set(r,o)}),this._prelimContent=null}_copy(){return new ah}clone(){const t=new ah;return this.forEach((n,o)=>{t.set(o,n instanceof Y0?n.clone():n)}),t}_callObserver(t,n){H5(this,t,new gWe(this,t,n))}toJSON(){this.doc??z1();const t={};return this._map.forEach((n,o)=>{if(!n.deleted){const r=n.content.getContent()[n.length-1];t[o]=r instanceof Y0?r.toJSON():r}}),t}get size(){return[...fA(this)].length}keys(){return BS(fA(this),t=>t[0])}values(){return BS(fA(this),t=>t[1].content.getContent()[t[1].length-1])}entries(){return BS(fA(this),t=>[t[0],t[1].content.getContent()[t[1].length-1]])}forEach(t){this.doc??z1(),this._map.forEach((n,o)=>{n.deleted||t(n.content.getContent()[n.length-1],o,this)})}[Symbol.iterator](){return this.entries()}delete(t){this.doc!==null?Ho(this.doc,n=>{B4(n,this,t)}):this._prelimContent.delete(t)}set(t,n){return this.doc!==null?Ho(this.doc,o=>{wB(o,this,t,n)}):this._prelimContent.set(t,n),n}get(t){return _B(this,t)}has(t){return Mse(this,t)}clear(){this.doc!==null?Ho(this.doc,t=>{this.forEach(function(n,o,r){B4(t,r,o)})}):this._prelimContent.clear()}_write(t){t.writeTypeRef(DWe)}}const MWe=e=>new ah,Zu=(e,t)=>e===t||typeof e=="object"&&typeof t=="object"&&e&&t&&a8e(e,t);class BE{constructor(t,n,o,r){this.left=t,this.right=n,this.index=o,this.currentAttributes=r}forward(){switch(this.right===null&&yc(),this.right.content.constructor){case m0:this.right.deleted||Vh(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}}const EU=(e,t,n)=>{for(;t.right!==null&&n>0;){switch(t.right.content.constructor){case m0:t.right.deleted||Vh(t.currentAttributes,t.right.content);break;default:t.right.deleted||(n{const r=new Map,s=o?V5(t,n):null;if(s){const i=new BE(s.p.left,s.p,s.index,r);return EU(e,i,n-s.index)}else{const i=new BE(null,t._start,0,r);return EU(e,i,n)}},zse=(e,t,n,o)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===m0&&Zu(o.get(n.right.content.key),n.right.content.value));)n.right.deleted||o.delete(n.right.content.key),n.forward();const r=e.doc,s=r.clientID;o.forEach((i,c)=>{const l=n.left,u=n.right,d=new b1(to(s,q0(r.store,s)),l,l&&l.lastId,u,u&&u.id,t,null,new m0(c,i));d.integrate(e,0),n.right=d,n.forward()})},Vh=(e,t)=>{const{key:n,value:o}=t;o===null?e.delete(n):e.set(n,o)},Ose=(e,t)=>{for(;e.right!==null;){if(!(e.right.deleted||e.right.content.constructor===m0&&Zu(t[e.right.content.key]??null,e.right.content.value)))break;e.forward()}},yse=(e,t,n,o)=>{const r=e.doc,s=r.clientID,i=new Map;for(const c in o){const l=o[c],u=n.currentAttributes.get(c)??null;if(!Zu(u,l)){i.set(c,u);const{left:d,right:p}=n;n.right=new b1(to(s,q0(r.store,s)),d,d&&d.lastId,p,p&&p.id,t,null,new m0(c,l)),n.right.integrate(e,0),n.forward()}}return i},PS=(e,t,n,o,r)=>{n.currentAttributes.forEach((f,b)=>{r[b]===void 0&&(r[b]=null)});const s=e.doc,i=s.clientID;Ose(n,r);const c=yse(e,t,n,r),l=o.constructor===String?new vc(o):o instanceof Y0?new Yl(o):new Vf(o);let{left:u,right:d,index:p}=n;t._searchMarker&&GM(t._searchMarker,n.index,l.getLength()),d=new b1(to(i,q0(s.store,i)),u,u&&u.lastId,d,d&&d.id,t,null,l),d.integrate(e,0),n.right=d,n.index=p,n.forward(),zse(e,t,n,c)},WU=(e,t,n,o,r)=>{const s=e.doc,i=s.clientID;Ose(n,r);const c=yse(e,t,n,r);e:for(;n.right!==null&&(o>0||c.size>0&&(n.right.deleted||n.right.content.constructor===m0));){if(!n.right.deleted)switch(n.right.content.constructor){case m0:{const{key:l,value:u}=n.right.content,d=r[l];if(d!==void 0){if(Zu(d,u))c.delete(l);else{if(o===0)break e;c.set(l,u)}n.right.delete(e)}else n.currentAttributes.set(l,u);break}default:o0){let l="";for(;o>0;o--)l+=` `;n.right=new b1(to(i,q0(s.store,i)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new vc(l)),n.right.integrate(e,0),n.forward()}zse(e,t,n,c)},Ase=(e,t,n,o,r)=>{let s=t;const i=fs();for(;s&&(!s.countable||s.deleted);){if(!s.deleted&&s.content.constructor===m0){const u=s.content;i.set(u.key,u)}s=s.right}let c=0,l=!1;for(;t!==s;){if(n===t&&(l=!0),!t.deleted){const u=t.content;switch(u.constructor){case m0:{const{key:d,value:p}=u,f=o.get(d)??null;(i.get(d)!==u||f===p)&&(t.delete(e),c++,!l&&(r.get(d)??null)===p&&f!==p&&(f===null?r.delete(d):r.set(d,f))),!l&&!t.deleted&&Vh(r,u);break}}}t=t.right}return c},zWe=(e,t)=>{for(;t&&t.right&&(t.right.deleted||!t.right.countable);)t=t.right;const n=new Set;for(;t&&(t.deleted||!t.countable);){if(!t.deleted&&t.content.constructor===m0){const o=t.content.key;n.has(o)?t.delete(e):n.add(o)}t=t.left}},OWe=e=>{let t=0;return Ho(e.doc,n=>{let o=e._start,r=e._start,s=fs();const i=kE(s);for(;r;){if(r.deleted===!1)switch(r.content.constructor){case m0:Vh(i,r.content);break;default:t+=Ase(n,o,r,s,i),s=kE(i),o=r;break}r=r.right}}),t},yWe=e=>{const t=new Set,n=e.doc;for(const[o,r]of e.afterState.entries()){const s=e.beforeState.get(o)||0;r!==s&&sse(e,n.store.clients.get(o),s,r,i=>{!i.deleted&&i.content.constructor===m0&&i.constructor!==yi&&t.add(i.parent)})}Ho(n,o=>{H1e(e,e.deleteSet,r=>{if(r instanceof yi||!r.parent._hasFormatting||t.has(r.parent))return;const s=r.parent;r.content.constructor===m0?t.add(s):zWe(o,r)});for(const r of t)OWe(r)})},NU=(e,t,n)=>{const o=n,r=kE(t.currentAttributes),s=t.right;for(;n>0&&t.right!==null;){if(t.right.deleted===!1)switch(t.right.content.constructor){case Yl:case Vf:case vc:n{r===null?this.childListChanged=!0:this.keysChanged.add(r)})}get changes(){if(this._changes===null){const t={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=t}return this._changes}get delta(){if(this._delta===null){const t=this.target.doc,n=[];Ho(t,o=>{const r=new Map,s=new Map;let i=this.target._start,c=null;const l={};let u="",d=0,p=0;const f=()=>{if(c!==null){let b=null;switch(c){case"delete":p>0&&(b={delete:p}),p=0;break;case"insert":(typeof u=="object"||u.length>0)&&(b={insert:u},r.size>0&&(b.attributes={},r.forEach((h,g)=>{h!==null&&(b.attributes[g]=h)}))),u="";break;case"retain":d>0&&(b={retain:d},s8e(l)||(b.attributes=o8e({},l))),d=0;break}b&&n.push(b),c=null}};for(;i!==null;){switch(i.content.constructor){case Yl:case Vf:this.adds(i)?this.deletes(i)||(f(),c="insert",u=i.content.getContent()[0],f()):this.deletes(i)?(c!=="delete"&&(f(),c="delete"),p+=1):i.deleted||(c!=="retain"&&(f(),c="retain"),d+=1);break;case vc:this.adds(i)?this.deletes(i)||(c!=="insert"&&(f(),c="insert"),u+=i.content.str):this.deletes(i)?(c!=="delete"&&(f(),c="delete"),p+=i.length):i.deleted||(c!=="retain"&&(f(),c="retain"),d+=i.length);break;case m0:{const{key:b,value:h}=i.content;if(this.adds(i)){if(!this.deletes(i)){const g=r.get(b)??null;Zu(g,h)?h!==null&&i.delete(o):(c==="retain"&&f(),Zu(h,s.get(b)??null)?delete l[b]:l[b]=h)}}else if(this.deletes(i)){s.set(b,h);const g=r.get(b)??null;Zu(g,h)||(c==="retain"&&f(),l[b]=g)}else if(!i.deleted){s.set(b,h);const g=l[b];g!==void 0&&(Zu(g,h)?g!==null&&i.delete(o):(c==="retain"&&f(),h===null?delete l[b]:l[b]=h))}i.deleted||(c==="insert"&&f(),Vh(r,i.content));break}}i=i.right}for(f();n.length>0;){const b=n[n.length-1];if(b.retain!==void 0&&b.attributes===void 0)n.pop();else break}}),this._delta=n}return this._delta}}class ch extends Y0{constructor(t){super(),this._pending=t!==void 0?[()=>this.insert(0,t)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??z1(),this._length}_integrate(t,n){super._integrate(t,n);try{this._pending.forEach(o=>o())}catch(o){console.error(o)}this._pending=null}_copy(){return new ch}clone(){const t=new ch;return t.applyDelta(this.toDelta()),t}_callObserver(t,n){super._callObserver(t,n);const o=new AWe(this,t,n);H5(this,t,o),!t.local&&this._hasFormatting&&(t._needFormattingCleanup=!0)}toString(){this.doc??z1();let t="",n=this._start;for(;n!==null;)!n.deleted&&n.countable&&n.content.constructor===vc&&(t+=n.content.str),n=n.right;return t}toJSON(){return this.toString()}applyDelta(t,{sanitize:n=!0}={}){this.doc!==null?Ho(this.doc,o=>{const r=new BE(null,this._start,0,new Map);for(let s=0;s0)&&PS(o,this,r,c,i.attributes||{})}else i.retain!==void 0?WU(o,this,r,i.retain,i.attributes||{}):i.delete!==void 0&&NU(o,r,i.delete)}}):this._pending.push(()=>this.applyDelta(t))}toDelta(t,n,o){this.doc??z1();const r=[],s=new Map,i=this.doc;let c="",l=this._start;function u(){if(c.length>0){const p={};let f=!1;s.forEach((h,g)=>{f=!0,p[g]=h});const b={insert:c};f&&(b.attributes=p),r.push(b),c=""}}const d=()=>{for(;l!==null;){if(o2(l,t)||n!==void 0&&o2(l,n))switch(l.content.constructor){case vc:{const p=s.get("ychange");t!==void 0&&!o2(l,t)?(p===void 0||p.user!==l.id.client||p.type!=="removed")&&(u(),s.set("ychange",o?o("removed",l.id):{type:"removed"})):n!==void 0&&!o2(l,n)?(p===void 0||p.user!==l.id.client||p.type!=="added")&&(u(),s.set("ychange",o?o("added",l.id):{type:"added"})):p!==void 0&&(u(),s.delete("ychange")),c+=l.content.str;break}case Yl:case Vf:{u();const p={insert:l.content.getContent()[0]};if(s.size>0){const f={};p.attributes=f,s.forEach((b,h)=>{f[h]=b})}r.push(p);break}case m0:o2(l,t)&&(u(),Vh(s,l.content));break}l=l.right}u()};return t||n?Ho(i,p=>{t&&WE(p,t),n&&WE(p,n),d()},"cleanup"):d(),r}insert(t,n,o){if(n.length<=0)return;const r=this.doc;r!==null?Ho(r,s=>{const i=bA(s,this,t,!o);o||(o={},i.currentAttributes.forEach((c,l)=>{o[l]=c})),PS(s,this,i,n,o)}):this._pending.push(()=>this.insert(t,n,o))}insertEmbed(t,n,o){const r=this.doc;r!==null?Ho(r,s=>{const i=bA(s,this,t,!o);PS(s,this,i,n,o||{})}):this._pending.push(()=>this.insertEmbed(t,n,o||{}))}delete(t,n){if(n===0)return;const o=this.doc;o!==null?Ho(o,r=>{NU(r,bA(r,this,t,!0),n)}):this._pending.push(()=>this.delete(t,n))}format(t,n,o){if(n===0)return;const r=this.doc;r!==null?Ho(r,s=>{const i=bA(s,this,t,!1);i.right!==null&&WU(s,this,i,n,o)}):this._pending.push(()=>this.format(t,n,o))}removeAttribute(t){this.doc!==null?Ho(this.doc,n=>{B4(n,this,t)}):this._pending.push(()=>this.removeAttribute(t))}setAttribute(t,n){this.doc!==null?Ho(this.doc,o=>{wB(o,this,t,n)}):this._pending.push(()=>this.setAttribute(t,n))}getAttribute(t){return _B(this,t)}getAttributes(){return gse(this)}_write(t){t.writeTypeRef(FWe)}}const vWe=e=>new ch;class jS{constructor(t,n=()=>!0){this._filter=n,this._root=t,this._currentNode=t._start,this._firstCall=!0,t.doc??z1()}[Symbol.iterator](){return this}next(){let t=this._currentNode,n=t&&t.content&&t.content.type;if(t!==null&&(!this._firstCall||t.deleted||!this._filter(n)))do if(n=t.content.type,!t.deleted&&(n.constructor===lh||n.constructor===mf)&&n._start!==null)t=n._start;else for(;t!==null;)if(t.right!==null){t=t.right;break}else t.parent===this._root?t=null:t=t.parent._item;while(t!==null&&(t.deleted||!this._filter(t.content.type)));return this._firstCall=!1,t===null?{value:void 0,done:!0}:(this._currentNode=t,{value:t.content.type,done:!1})}}class mf extends Y0{constructor(){super(),this._prelimContent=[]}get firstChild(){const t=this._first;return t?t.content.getContent()[0]:null}_integrate(t,n){super._integrate(t,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new mf}clone(){const t=new mf;return t.insert(0,this.toArray().map(n=>n instanceof Y0?n.clone():n)),t}get length(){return this.doc??z1(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(t){return new jS(this,t)}querySelector(t){t=t.toUpperCase();const o=new jS(this,r=>r.nodeName&&r.nodeName.toUpperCase()===t).next();return o.done?null:o.value}querySelectorAll(t){return t=t.toUpperCase(),Rl(new jS(this,n=>n.nodeName&&n.nodeName.toUpperCase()===t))}_callObserver(t,n){H5(this,t,new _We(this,n,t))}toString(){return pse(this,t=>t.toString()).join("")}toJSON(){return this.toString()}toDOM(t=document,n={},o){const r=t.createDocumentFragment();return o!==void 0&&o._createAssociation(r,this),KM(this,s=>{r.insertBefore(s.toDOM(t,n,o),null)}),r}insert(t,n){this.doc!==null?Ho(this.doc,o=>{hse(o,this,t,n)}):this._prelimContent.splice(t,0,...n)}insertAfter(t,n){if(this.doc!==null)Ho(this.doc,o=>{const r=t&&t instanceof Y0?t._item:t;N4(o,this,r,n)});else{const o=this._prelimContent,r=t===null?0:o.findIndex(s=>s===t)+1;if(r===0&&t!==null)throw fa("Reference item not found");o.splice(r,0,...n)}}delete(t,n=1){this.doc!==null?Ho(this.doc,o=>{mse(o,this,t,n)}):this._prelimContent.splice(t,n)}toArray(){return dse(this)}push(t){this.insert(this.length,t)}unshift(t){this.insert(0,t)}get(t){return fse(this,t)}slice(t=0,n=this.length){return use(this,t,n)}forEach(t){KM(this,t)}_write(t){t.writeTypeRef(VWe)}}const xWe=e=>new mf;class lh extends mf{constructor(t="UNDEFINED"){super(),this.nodeName=t,this._prelimAttrs=new Map}get nextSibling(){const t=this._item?this._item.next:null;return t?t.content.type:null}get prevSibling(){const t=this._item?this._item.prev:null;return t?t.content.type:null}_integrate(t,n){super._integrate(t,n),this._prelimAttrs.forEach((o,r)=>{this.setAttribute(r,o)}),this._prelimAttrs=null}_copy(){return new lh(this.nodeName)}clone(){const t=new lh(this.nodeName),n=this.getAttributes();return r8e(n,(o,r)=>{typeof o=="string"&&t.setAttribute(r,o)}),t.insert(0,this.toArray().map(o=>o instanceof Y0?o.clone():o)),t}toString(){const t=this.getAttributes(),n=[],o=[];for(const c in t)o.push(c);o.sort();const r=o.length;for(let c=0;c0?" "+n.join(" "):"";return`<${s}${i}>${super.toString()}`}removeAttribute(t){this.doc!==null?Ho(this.doc,n=>{B4(n,this,t)}):this._prelimAttrs.delete(t)}setAttribute(t,n){this.doc!==null?Ho(this.doc,o=>{wB(o,this,t,n)}):this._prelimAttrs.set(t,n)}getAttribute(t){return _B(this,t)}hasAttribute(t){return Mse(this,t)}getAttributes(t){return t?bWe(this,t):gse(this)}toDOM(t=document,n={},o){const r=t.createElement(this.nodeName),s=this.getAttributes();for(const i in s){const c=s[i];typeof c=="string"&&r.setAttribute(i,c)}return KM(this,i=>{r.appendChild(i.toDOM(t,n,o))}),o!==void 0&&o._createAssociation(r,this),r}_write(t){t.writeTypeRef($We),t.writeKey(this.nodeName)}}const wWe=e=>new lh(e.readKey());class _We extends $5{constructor(t,n,o){super(t,o),this.childListChanged=!1,this.attributesChanged=new Set,n.forEach(r=>{r===null?this.childListChanged=!0:this.attributesChanged.add(r)})}}class L4 extends ah{constructor(t){super(),this.hookName=t}_copy(){return new L4(this.hookName)}clone(){const t=new L4(this.hookName);return this.forEach((n,o)=>{t.set(o,n)}),t}toDOM(t=document,n={},o){const r=n[this.hookName];let s;return r!==void 0?s=r.createDom(this):s=document.createElement(this.hookName),s.setAttribute("data-yjs-hook",this.hookName),o!==void 0&&o._createAssociation(s,this),s}_write(t){t.writeTypeRef(HWe),t.writeKey(this.hookName)}}const kWe=e=>new L4(e.readKey());class P4 extends ch{get nextSibling(){const t=this._item?this._item.next:null;return t?t.content.type:null}get prevSibling(){const t=this._item?this._item.prev:null;return t?t.content.type:null}_copy(){return new P4}clone(){const t=new P4;return t.applyDelta(this.toDelta()),t}toDOM(t=document,n,o){const r=t.createTextNode(this.toString());return o!==void 0&&o._createAssociation(r,this),r}toString(){return this.toDelta().map(t=>{const n=[];for(const r in t.attributes){const s=[];for(const i in t.attributes[r])s.push({key:i,value:t.attributes[r][i]});s.sort((i,c)=>i.keyr.nodeName=0;r--)o+=``;return o}).join("")}toJSON(){return this.toString()}_write(t){t.writeTypeRef(UWe)}}const SWe=e=>new P4;class kB{constructor(t,n){this.id=t,this.length=n}get deleted(){throw dc()}mergeWith(t){return!1}write(t,n,o){throw dc()}integrate(t,n){throw dc()}}const CWe=0;class yi extends kB{get deleted(){return!0}delete(){}mergeWith(t){return this.constructor!==t.constructor?!1:(this.length+=t.length,!0)}integrate(t,n){n>0&&(this.id.clock+=n,this.length-=n),rse(t.doc.store,this)}write(t,n){t.writeInfo(CWe),t.writeLen(this.length-n)}getMissing(t,n){return null}}class h3{constructor(t){this.content=t}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new h3(this.content)}splice(t){throw dc()}mergeWith(t){return!1}integrate(t,n){}delete(t){}gc(t){}write(t,n){t.writeBuf(this.content)}getRef(){return 3}}const qWe=e=>new h3(e.readBuf());class YM{constructor(t){this.len=t}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new YM(this.len)}splice(t){const n=new YM(this.len-t);return this.len=t,n}mergeWith(t){return this.len+=t.len,!0}integrate(t,n){E4(t.deleteSet,n.id.client,n.id.clock,this.len),n.markDeleted()}delete(t){}gc(t){}write(t,n){t.writeLen(this.len-n)}getRef(){return 1}}const RWe=e=>new YM(e.readLen()),vse=(e,t)=>new $h({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1});class m3{constructor(t){t._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=t;const n={};this.opts=n,t.gc||(n.gc=!1),t.autoLoad&&(n.autoLoad=!0),t.meta!==null&&(n.meta=t.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new m3(vse(this.doc.guid,this.opts))}splice(t){throw dc()}mergeWith(t){return!1}integrate(t,n){this.doc._item=n,t.subdocsAdded.add(this.doc),this.doc.shouldLoad&&t.subdocsLoaded.add(this.doc)}delete(t){t.subdocsAdded.has(this.doc)?t.subdocsAdded.delete(this.doc):t.subdocsRemoved.add(this.doc)}gc(t){}write(t,n){t.writeString(this.doc.guid),t.writeAny(this.opts)}getRef(){return 9}}const TWe=e=>new m3(vse(e.readString(),e.readAny()));class Vf{constructor(t){this.embed=t}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new Vf(this.embed)}splice(t){throw dc()}mergeWith(t){return!1}integrate(t,n){}delete(t){}gc(t){}write(t,n){t.writeJSON(this.embed)}getRef(){return 5}}const EWe=e=>new Vf(e.readJSON());class m0{constructor(t,n){this.key=t,this.value=n}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new m0(this.key,this.value)}splice(t){throw dc()}mergeWith(t){return!1}integrate(t,n){const o=n.parent;o._searchMarker=null,o._hasFormatting=!0}delete(t){}gc(t){}write(t,n){t.writeKey(this.key),t.writeJSON(this.value)}getRef(){return 6}}const WWe=e=>new m0(e.readKey(),e.readJSON());class j4{constructor(t){this.arr=t}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new j4(this.arr)}splice(t){const n=new j4(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(t){return this.arr=this.arr.concat(t.arr),!0}integrate(t,n){}delete(t){}gc(t){}write(t,n){const o=this.arr.length;t.writeLen(o-n);for(let r=n;r{const t=e.readLen(),n=[];for(let o=0;o{const t=e.readLen(),n=[];for(let o=0;o=55296&&o<=56319&&(this.str=this.str.slice(0,t-1)+"�",n.str="�"+n.str.slice(1)),n}mergeWith(t){return this.str+=t.str,!0}integrate(t,n){}delete(t){}gc(t){}write(t,n){t.writeString(n===0?this.str:this.str.slice(n))}getRef(){return 4}}const PWe=e=>new vc(e.readString()),jWe=[mWe,MWe,vWe,wWe,xWe,kWe,SWe],IWe=0,DWe=1,FWe=2,$We=3,VWe=4,HWe=5,UWe=6;class Yl{constructor(t){this.type=t}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new Yl(this.type._copy())}splice(t){throw dc()}mergeWith(t){return!1}integrate(t,n){this.type._integrate(t.doc,n)}delete(t){let n=this.type._start;for(;n!==null;)n.deleted?n.id.clock<(t.beforeState.get(n.id.client)||0)&&t._mergeStructs.push(n):n.delete(t),n=n.right;this.type._map.forEach(o=>{o.deleted?o.id.clock<(t.beforeState.get(o.id.client)||0)&&t._mergeStructs.push(o):o.delete(t)}),t.changed.delete(this.type)}gc(t){let n=this.type._start;for(;n!==null;)n.gc(t,!0),n=n.right;this.type._start=null,this.type._map.forEach(o=>{for(;o!==null;)o.gc(t,!0),o=o.left}),this.type._map=new Map}write(t,n){this.type._write(t)}getRef(){return 7}}const XWe=e=>new Yl(jWe[e.readTypeRef()](e)),I4=(e,t,n)=>{const{client:o,clock:r}=t.id,s=new b1(to(o,r+n),t,to(o,r+n-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(n));return t.deleted&&s.markDeleted(),t.keep&&(s.keep=!0),t.redone!==null&&(s.redone=to(t.redone.client,t.redone.clock+n)),t.right=s,s.right!==null&&(s.right.left=s),e._mergeStructs.push(s),s.parentSub!==null&&s.right===null&&s.parent._map.set(s.parentSub,s),t.length=n,s};let b1=class LE extends kB{constructor(t,n,o,r,s,i,c,l){super(t,l.getLength()),this.origin=o,this.left=n,this.right=r,this.rightOrigin=s,this.parent=i,this.parentSub=c,this.redone=null,this.content=l,this.info=this.content.isCountable()?fU:0}set marker(t){(this.info&RS)>0!==t&&(this.info^=RS)}get marker(){return(this.info&RS)>0}get keep(){return(this.info&pU)>0}set keep(t){this.keep!==t&&(this.info^=pU)}get countable(){return(this.info&fU)>0}get deleted(){return(this.info&qS)>0}set deleted(t){this.deleted!==t&&(this.info^=qS)}markDeleted(){this.info|=qS}getMissing(t,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=q0(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=q0(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===q2&&this.id.client!==this.parent.client&&this.parent.clock>=q0(n,this.parent.client))return this.parent.client;if(this.origin&&(this.left=CU(t,n,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=Od(t,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===yi||this.right&&this.right.constructor===yi)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===LE&&(this.parent=this.left.parent,this.parentSub=this.left.parentSub),this.right&&this.right.constructor===LE&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===q2){const o=LS(n,this.parent);o.constructor===yi?this.parent=null:this.parent=o.content.type}return null}integrate(t,n){if(n>0&&(this.id.clock+=n,this.left=CU(t,t.doc.store,to(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(n),this.length-=n),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let o=this.left,r;if(o!==null)r=o.right;else if(this.parentSub!==null)for(r=this.parent._map.get(this.parentSub)||null;r!==null&&r.left!==null;)r=r.left;else r=this.parent._start;const s=new Set,i=new Set;for(;r!==null&&r!==this.right;){if(i.add(r),s.add(r),pA(this.origin,r.origin)){if(r.id.client{o.p===t&&(o.p=this,!this.deleted&&this.countable&&(o.index-=this.length))}),t.keep&&(this.keep=!0),this.right=t.right,this.right!==null&&(this.right.left=this),this.length+=t.length,!0}return!1}delete(t){if(!this.deleted){const n=this.parent;this.countable&&this.parentSub===null&&(n._length-=this.length),this.markDeleted(),E4(t.deleteSet,this.id.client,this.id.clock,this.length),RU(t,n,this.parentSub),this.content.delete(t)}}gc(t,n){if(!this.deleted)throw yc();this.content.gc(t),n?Q8e(t,this,new yi(this.id,this.length)):this.content=new YM(this.length)}write(t,n){const o=n>0?to(this.id.client,this.id.clock+n-1):this.origin,r=this.rightOrigin,s=this.parentSub,i=this.content.getRef()&B5|(o===null?0:Ns)|(r===null?0:Ol)|(s===null?0:VM);if(t.writeInfo(i),o!==null&&t.writeLeftID(o),r!==null&&t.writeRightID(r),o===null&&r===null){const c=this.parent;if(c._item!==void 0){const l=c._item;if(l===null){const u=Y8e(c);t.writeParentInfo(!0),t.writeString(u)}else t.writeParentInfo(!1),t.writeLeftID(l.id)}else c.constructor===String?(t.writeParentInfo(!0),t.writeString(c)):c.constructor===q2?(t.writeParentInfo(!1),t.writeLeftID(c)):yc();s!==null&&t.writeString(s)}this.content.write(t,n)}};const xse=(e,t)=>GWe[t&B5](e),GWe=[()=>{yc()},RWe,NWe,qWe,PWe,EWe,WWe,XWe,LWe,TWe,()=>{yc()}],KWe=10;class Ai extends kB{get deleted(){return!0}delete(){}mergeWith(t){return this.constructor!==t.constructor?!1:(this.length+=t.length,!0)}integrate(t,n){yc()}write(t,n){t.writeInfo(KWe),sn(t.restEncoder,this.length-n)}getMissing(t,n){return null}}const wse=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof dU<"u"?dU:{},_se="__ $YJS$ __";wse[_se]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");wse[_se]=!0;const Hf=e=>oh((t,n)=>{e.onerror=o=>n(new Error(o.target.error)),e.onsuccess=o=>t(o.target.result)}),YWe=(e,t)=>oh((n,o)=>{const r=indexedDB.open(e);r.onupgradeneeded=s=>t(s.target.result),r.onerror=s=>o(fa(s.target.error)),r.onsuccess=s=>{const i=s.target.result;i.onversionchange=()=>{i.close()},n(i)}}),ZWe=e=>Hf(indexedDB.deleteDatabase(e)),QWe=(e,t)=>t.forEach(n=>e.createObjectStore.apply(e,n)),Qg=(e,t,n="readwrite")=>{const o=e.transaction(t,n);return t.map(r=>iNe(o,r))},kse=(e,t)=>Hf(e.count(t)),JWe=(e,t)=>Hf(e.get(t)),Sse=(e,t)=>Hf(e.delete(t)),eNe=(e,t,n)=>Hf(e.put(t,n)),PE=(e,t)=>Hf(e.add(t)),tNe=(e,t,n)=>Hf(e.getAll(t,n)),nNe=(e,t,n)=>{let o=null;return sNe(e,t,r=>(o=r,!1),n).then(()=>o)},oNe=(e,t=null)=>nNe(e,t,"prev"),rNe=(e,t)=>oh((n,o)=>{e.onerror=o,e.onsuccess=async r=>{const s=r.target.result;if(s===null||await t(s)===!1)return n();s.continue()}}),sNe=(e,t,n,o="next")=>rNe(e.openKeyCursor(t,o),r=>n(r.key)),iNe=(e,t)=>e.objectStore(t),aNe=(e,t)=>IDBKeyRange.upperBound(e,t),cNe=(e,t)=>IDBKeyRange.lowerBound(e,t),IS="custom",Cse="updates",qse=500,Rse=(e,t=()=>{},n=()=>{})=>{const[o]=Qg(e.db,[Cse]);return tNe(o,cNe(e._dbref,!1)).then(r=>{e._destroyed||(t(o),Ho(e.doc,()=>{r.forEach(s=>J1e(e.doc,s))},e,!1),n(o))}).then(()=>oNe(o).then(r=>{e._dbref=r+1})).then(()=>kse(o).then(r=>{e._dbsize=r})).then(()=>o)},lNe=(e,t=!0)=>Rse(e).then(n=>{(t||e._dbsize>=qse)&&PE(n,OB(e.doc)).then(()=>Sse(n,aNe(e._dbref,!0))).then(()=>kse(n).then(o=>{e._dbsize=o}))});class uNe extends d3{constructor(t,n){super(),this.doc=n,this.name=t,this._dbref=0,this._dbsize=0,this._destroyed=!1,this.db=null,this.synced=!1,this._db=YWe(t,o=>QWe(o,[["updates",{autoIncrement:!0}],["custom"]])),this.whenSynced=oh(o=>this.on("synced",()=>o(this))),this._db.then(o=>{this.db=o,Rse(this,i=>PE(i,OB(n)),()=>{if(this._destroyed)return this;this.synced=!0,this.emit("synced",[this])})}),this._storeTimeout=1e3,this._storeTimeoutId=null,this._storeUpdate=(o,r)=>{if(this.db&&r!==this){const[s]=Qg(this.db,[Cse]);PE(s,o),++this._dbsize>=qse&&(this._storeTimeoutId!==null&&clearTimeout(this._storeTimeoutId),this._storeTimeoutId=setTimeout(()=>{lNe(this,!1),this._storeTimeoutId=null},this._storeTimeout))}},n.on("update",this._storeUpdate),this.destroy=this.destroy.bind(this),n.on("destroy",this.destroy)}destroy(){return this._storeTimeoutId&&clearTimeout(this._storeTimeoutId),this.doc.off("update",this._storeUpdate),this.doc.off("destroy",this.destroy),this._destroyed=!0,this._db.then(t=>{t.close()})}clearData(){return this.destroy().then(()=>{ZWe(this.name)})}get(t){return this._db.then(n=>{const[o]=Qg(n,[IS],"readonly");return JWe(o,t)})}set(t,n){return this._db.then(o=>{const[r]=Qg(o,[IS]);return eNe(r,n,t)})}del(t){return this._db.then(n=>{const[o]=Qg(n,[IS]);return Sse(o,t)})}}function dNe(e,t,n){const o=`${t}-${e}`,r=new uNe(o,n);return new Promise(s=>{r.on("synced",()=>{s(()=>r.destroy())})})}const pNe=1200,fNe=2500,D4=3e4,jE=e=>{if(e.shouldConnect&&e.ws===null){const t=new WebSocket(e.url),n=e.binaryType;let o=null;n&&(t.binaryType=n),e.ws=t,e.connecting=!0,e.connected=!1,t.onmessage=i=>{e.lastMessageReceived=Tl();const c=i.data,l=typeof c=="string"?JSON.parse(c):c;l&&l.type==="pong"&&(clearTimeout(o),o=setTimeout(s,D4/2)),e.emit("message",[l,e])};const r=i=>{e.ws!==null&&(e.ws=null,e.connecting=!1,e.connected?(e.connected=!1,e.emit("disconnect",[{type:"disconnect",error:i},e])):e.unsuccessfulReconnects++,setTimeout(jE,sB(lEe(e.unsuccessfulReconnects+1)*pNe,fNe),e)),clearTimeout(o)},s=()=>{e.ws===t&&e.send({type:"ping"})};t.onclose=()=>r(null),t.onerror=i=>r(i),t.onopen=()=>{e.lastMessageReceived=Tl(),e.connecting=!1,e.connected=!0,e.unsuccessfulReconnects=0,e.emit("connect",[{type:"connect"},e]),o=setTimeout(s,D4/2)}}};class bNe extends d3{constructor(t,{binaryType:n}={}){super(),this.url=t,this.ws=null,this.binaryType=n||null,this.connected=!1,this.connecting=!1,this.unsuccessfulReconnects=0,this.lastMessageReceived=0,this.shouldConnect=!0,this._checkInterval=setInterval(()=>{this.connected&&D4n.key===t&&this.onmessage!==null&&this.onmessage({data:bB(n.newValue||"")}),t8e(this._onChange)}postMessage(t){S1e.setItem(this.room,B1e(g8e(t)))}close(){n8e(this._onChange)}}const mNe=typeof BroadcastChannel>"u"?hNe:BroadcastChannel,SB=e=>_1(Tse,e,()=>{const t=zd(),n=new mNe(e);return n.onmessage=o=>t.forEach(r=>r(o.data,"broadcastchannel")),{bc:n,subs:t}}),gNe=(e,t)=>(SB(e).subs.add(t),t),MNe=(e,t)=>{const n=SB(e),o=n.subs.delete(t);return o&&n.subs.size===0&&(n.bc.close(),Tse.delete(e)),o},zNe=(e,t,n=null)=>{const o=SB(e);o.bc.postMessage(t),o.subs.forEach(r=>r(t,n))},ONe=()=>{let e=!0;return(t,n)=>{if(e){e=!1;try{t()}finally{e=!0}}else n!==void 0&&n()}};function hA(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var DS={exports:{}},BU;function yNe(){return BU||(BU=1,function(e,t){(function(n){e.exports=n()})(function(){var n=Math.floor,o=Math.abs,r=Math.pow;return function(){function s(i,c,l){function u(f,b){if(!c[f]){if(!i[f]){var h=typeof hA=="function"&&hA;if(!b&&h)return h(f,!0);if(d)return d(f,!0);var g=new Error("Cannot find module '"+f+"'");throw g.code="MODULE_NOT_FOUND",g}var z=c[f]={exports:{}};i[f][0].call(z.exports,function(A){var _=i[f][1][A];return u(_||A)},z,z.exports,s,i,c,l)}return c[f].exports}for(var d=typeof hA=="function"&&hA,p=0;p>16,T[E++]=255&y>>8,T[E++]=255&y;return R===2&&(y=g[M.charCodeAt(k)]<<2|g[M.charCodeAt(k+1)]>>4,T[E++]=255&y),R===1&&(y=g[M.charCodeAt(k)]<<10|g[M.charCodeAt(k+1)]<<4|g[M.charCodeAt(k+2)]>>2,T[E++]=255&y>>8,T[E++]=255&y),T}function p(M){return h[63&M>>18]+h[63&M>>12]+h[63&M>>6]+h[63&M]}function f(M,y,k){for(var S,C=[],R=y;RE?E:T+R));return S===1?(y=M[k-1],C.push(h[y>>2]+h[63&y<<4]+"==")):S===2&&(y=(M[k-2]<<8)+M[k-1],C.push(h[y>>10]+h[63&y>>4]+h[63&y<<2]+"=")),C.join("")}c.byteLength=function(M){var y=l(M),k=y[0],S=y[1];return 3*(k+S)/4-S},c.toByteArray=d,c.fromByteArray=b;for(var h=[],g=[],z=typeof Uint8Array>"u"?Array:Uint8Array,A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_=0,v=A.length;_L)throw new RangeError('The value "'+L+'" is invalid for option "size"')}function h(L,U,ne){return b(L),0>=L||U===void 0?d(L):typeof ne=="string"?d(L).fill(U,ne):d(L).fill(U)}function g(L){return b(L),d(0>L?0:0|M(L))}function z(L,U){if((typeof U!="string"||U==="")&&(U="utf8"),!p.isEncoding(U))throw new TypeError("Unknown encoding: "+U);var ne=0|y(L,U),ve=d(ne),qe=ve.write(L,U);return qe!==ne&&(ve=ve.slice(0,qe)),ve}function A(L){for(var U=0>L.length?0:0|M(L.length),ne=d(U),ve=0;veU||L.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|L}function y(L,U){if(p.isBuffer(L))return L.length;if(ArrayBuffer.isView(L)||re(L,ArrayBuffer))return L.byteLength;if(typeof L!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof L);var ne=L.length,ve=2>>1;case"base64":return ie(L).length;default:if(qe)return ve?-1:ye(L).length;U=(""+U).toLowerCase(),qe=!0}}function k(L,U,ne){var ve=!1;if((U===void 0||0>U)&&(U=0),U>this.length||((ne===void 0||ne>this.length)&&(ne=this.length),0>=ne)||(ne>>>=0,U>>>=0,ne<=U))return"";for(L||(L="utf8");;)switch(L){case"hex":return V(this,U,ne);case"utf8":case"utf-8":return $(this,U,ne);case"ascii":return X(this,U,ne);case"latin1":case"binary":return Z(this,U,ne);case"base64":return P(this,U,ne);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Q(this,U,ne);default:if(ve)throw new TypeError("Unknown encoding: "+L);L=(L+"").toLowerCase(),ve=!0}}function S(L,U,ne){var ve=L[U];L[U]=L[ne],L[ne]=ve}function C(L,U,ne,ve,qe){if(L.length===0)return-1;if(typeof ne=="string"?(ve=ne,ne=0):2147483647ne&&(ne=-2147483648),ne=+ne,pe(ne)&&(ne=qe?0:L.length-1),0>ne&&(ne=L.length+ne),ne>=L.length){if(qe)return-1;ne=L.length-1}else if(0>ne)if(qe)ne=0;else return-1;if(typeof U=="string"&&(U=p.from(U,ve)),p.isBuffer(U))return U.length===0?-1:R(L,U,ne,ve,qe);if(typeof U=="number")return U&=255,typeof Uint8Array.prototype.indexOf=="function"?qe?Uint8Array.prototype.indexOf.call(L,U,ne):Uint8Array.prototype.lastIndexOf.call(L,U,ne):R(L,[U],ne,ve,qe);throw new TypeError("val must be string, number or Buffer")}function R(L,U,ne,ve,qe){function Pe(fe,Re){return rt===1?fe[Re]:fe.readUInt16BE(Re*rt)}var rt=1,qt=L.length,wt=U.length;if(ve!==void 0&&(ve=(ve+"").toLowerCase(),ve==="ucs2"||ve==="ucs-2"||ve==="utf16le"||ve==="utf-16le")){if(2>L.length||2>U.length)return-1;rt=2,qt/=2,wt/=2,ne/=2}var Bt;if(qe){var ae=-1;for(Bt=ne;Btqt&&(ne=qt-wt),Bt=ne;0<=Bt;Bt--){for(var H=!0,Y=0;Yqe&&(ve=qe)):ve=qe;var Pe=U.length;ve>Pe/2&&(ve=Pe/2);for(var rt,qt=0;qtPe&&(rt=Pe):qt===2?(wt=L[qe+1],(192&wt)==128&&(H=(31&Pe)<<6|63&wt,127H||57343H&&(rt=H)))}rt===null?(rt=65533,qt=1):65535>>10),rt=56320|1023&rt),ve.push(rt),qe+=qt}return F(ve)}function F(L){var U=L.length;if(U<=4096)return l.apply(String,L);for(var ne="",ve=0;veU)&&(U=0),(!ne||0>ne||ne>ve)&&(ne=ve);for(var qe="",Pe=U;PeL)throw new RangeError("offset is not uint");if(L+U>ne)throw new RangeError("Trying to access beyond buffer length")}function ee(L,U,ne,ve,qe,Pe){if(!p.isBuffer(L))throw new TypeError('"buffer" argument must be a Buffer instance');if(U>qe||UL.length)throw new RangeError("Index out of range")}function ue(L,U,ne,ve){if(ne+ve>L.length)throw new RangeError("Index out of range");if(0>ne)throw new RangeError("Index out of range")}function ce(L,U,ne,ve,qe){return U=+U,ne>>>=0,qe||ue(L,U,ne,4),Se.write(L,U,ne,ve,23,4),ne+4}function me(L,U,ne,ve,qe){return U=+U,ne>>>=0,qe||ue(L,U,ne,8),Se.write(L,U,ne,ve,52,8),ne+8}function de(L){if(L=L.split("=")[0],L=L.trim().replace(se,""),2>L.length)return"";for(;L.length%4!=0;)L+="=";return L}function Ae(L){return 16>L?"0"+L.toString(16):L.toString(16)}function ye(L,U){U=U||1/0;for(var ne,ve=L.length,qe=null,Pe=[],rt=0;rtne){if(!qe){if(56319ne){-1<(U-=3)&&Pe.push(239,191,189),qe=ne;continue}ne=(qe-55296<<10|ne-56320)+65536}else qe&&-1<(U-=3)&&Pe.push(239,191,189);if(qe=null,128>ne){if(0>(U-=1))break;Pe.push(ne)}else if(2048>ne){if(0>(U-=2))break;Pe.push(192|ne>>6,128|63&ne)}else if(65536>ne){if(0>(U-=3))break;Pe.push(224|ne>>12,128|63&ne>>6,128|63&ne)}else if(1114112>ne){if(0>(U-=4))break;Pe.push(240|ne>>18,128|63&ne>>12,128|63&ne>>6,128|63&ne)}else throw new Error("Invalid code point")}return Pe}function Ne(L){for(var U=[],ne=0;ne(U-=2));++rt)ne=L.charCodeAt(rt),ve=ne>>8,qe=ne%256,Pe.push(qe),Pe.push(ve);return Pe}function ie(L){return ke.toByteArray(de(L))}function we(L,U,ne,ve){for(var qe=0;qe=U.length||qe>=L.length);++qe)U[qe+ne]=L[qe];return qe}function re(L,U){return L instanceof U||L!=null&&L.constructor!=null&&L.constructor.name!=null&&L.constructor.name===U.name}function pe(L){return L!==L}var ke=s("base64-js"),Se=s("ieee754");c.Buffer=p,c.SlowBuffer=function(L){return+L!=L&&(L=0),p.alloc(+L)},c.INSPECT_MAX_BYTES=50,c.kMaxLength=2147483647,p.TYPED_ARRAY_SUPPORT=function(){try{var L=new Uint8Array(1);return L.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},L.foo()===42}catch{return!1}}(),p.TYPED_ARRAY_SUPPORT||typeof console>"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){return p.isBuffer(this)?this.buffer:void 0}}),Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){return p.isBuffer(this)?this.byteOffset:void 0}}),typeof Symbol<"u"&&Symbol.species!=null&&p[Symbol.species]===p&&Object.defineProperty(p,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),p.poolSize=8192,p.from=function(L,U,ne){return f(L,U,ne)},p.prototype.__proto__=Uint8Array.prototype,p.__proto__=Uint8Array,p.alloc=function(L,U,ne){return h(L,U,ne)},p.allocUnsafe=function(L){return g(L)},p.allocUnsafeSlow=function(L){return g(L)},p.isBuffer=function(L){return L!=null&&L._isBuffer===!0&&L!==p.prototype},p.compare=function(L,U){if(re(L,Uint8Array)&&(L=p.from(L,L.offset,L.byteLength)),re(U,Uint8Array)&&(U=p.from(U,U.offset,U.byteLength)),!p.isBuffer(L)||!p.isBuffer(U))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(L===U)return 0;for(var ne=L.length,ve=U.length,qe=0,Pe=u(ne,ve);qeU&&(L+=" ... "),""},p.prototype.compare=function(L,U,ne,ve,qe){if(re(L,Uint8Array)&&(L=p.from(L,L.offset,L.byteLength)),!p.isBuffer(L))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof L);if(U===void 0&&(U=0),ne===void 0&&(ne=L?L.length:0),ve===void 0&&(ve=0),qe===void 0&&(qe=this.length),0>U||ne>L.length||0>ve||qe>this.length)throw new RangeError("out of range index");if(ve>=qe&&U>=ne)return 0;if(ve>=qe)return-1;if(U>=ne)return 1;if(U>>>=0,ne>>>=0,ve>>>=0,qe>>>=0,this===L)return 0;for(var Pe=qe-ve,rt=ne-U,qt=u(Pe,rt),wt=this.slice(ve,qe),Bt=L.slice(U,ne),ae=0;ae>>=0,isFinite(ne)?(ne>>>=0,ve===void 0&&(ve="utf8")):(ve=ne,ne=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var qe=this.length-U;if((ne===void 0||ne>qe)&&(ne=qe),0ne||0>U)||U>this.length)throw new RangeError("Attempt to write outside buffer bounds");ve||(ve="utf8");for(var Pe=!1;;)switch(ve){case"hex":return T(this,L,U,ne);case"utf8":case"utf-8":return E(this,L,U,ne);case"ascii":return B(this,L,U,ne);case"latin1":case"binary":return N(this,L,U,ne);case"base64":return j(this,L,U,ne);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,L,U,ne);default:if(Pe)throw new TypeError("Unknown encoding: "+ve);ve=(""+ve).toLowerCase(),Pe=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},p.prototype.slice=function(L,U){var ne=this.length;L=~~L,U=U===void 0?ne:~~U,0>L?(L+=ne,0>L&&(L=0)):L>ne&&(L=ne),0>U?(U+=ne,0>U&&(U=0)):U>ne&&(U=ne),U>>=0,U>>>=0,ne||te(L,U,this.length);for(var ve=this[L],qe=1,Pe=0;++Pe>>=0,U>>>=0,ne||te(L,U,this.length);for(var ve=this[L+--U],qe=1;0>>=0,U||te(L,1,this.length),this[L]},p.prototype.readUInt16LE=function(L,U){return L>>>=0,U||te(L,2,this.length),this[L]|this[L+1]<<8},p.prototype.readUInt16BE=function(L,U){return L>>>=0,U||te(L,2,this.length),this[L]<<8|this[L+1]},p.prototype.readUInt32LE=function(L,U){return L>>>=0,U||te(L,4,this.length),(this[L]|this[L+1]<<8|this[L+2]<<16)+16777216*this[L+3]},p.prototype.readUInt32BE=function(L,U){return L>>>=0,U||te(L,4,this.length),16777216*this[L]+(this[L+1]<<16|this[L+2]<<8|this[L+3])},p.prototype.readIntLE=function(L,U,ne){L>>>=0,U>>>=0,ne||te(L,U,this.length);for(var ve=this[L],qe=1,Pe=0;++Pe=qe&&(ve-=r(2,8*U)),ve},p.prototype.readIntBE=function(L,U,ne){L>>>=0,U>>>=0,ne||te(L,U,this.length);for(var ve=U,qe=1,Pe=this[L+--ve];0=qe&&(Pe-=r(2,8*U)),Pe},p.prototype.readInt8=function(L,U){return L>>>=0,U||te(L,1,this.length),128&this[L]?-1*(255-this[L]+1):this[L]},p.prototype.readInt16LE=function(L,U){L>>>=0,U||te(L,2,this.length);var ne=this[L]|this[L+1]<<8;return 32768&ne?4294901760|ne:ne},p.prototype.readInt16BE=function(L,U){L>>>=0,U||te(L,2,this.length);var ne=this[L+1]|this[L]<<8;return 32768&ne?4294901760|ne:ne},p.prototype.readInt32LE=function(L,U){return L>>>=0,U||te(L,4,this.length),this[L]|this[L+1]<<8|this[L+2]<<16|this[L+3]<<24},p.prototype.readInt32BE=function(L,U){return L>>>=0,U||te(L,4,this.length),this[L]<<24|this[L+1]<<16|this[L+2]<<8|this[L+3]},p.prototype.readFloatLE=function(L,U){return L>>>=0,U||te(L,4,this.length),Se.read(this,L,!0,23,4)},p.prototype.readFloatBE=function(L,U){return L>>>=0,U||te(L,4,this.length),Se.read(this,L,!1,23,4)},p.prototype.readDoubleLE=function(L,U){return L>>>=0,U||te(L,8,this.length),Se.read(this,L,!0,52,8)},p.prototype.readDoubleBE=function(L,U){return L>>>=0,U||te(L,8,this.length),Se.read(this,L,!1,52,8)},p.prototype.writeUIntLE=function(L,U,ne,ve){if(L=+L,U>>>=0,ne>>>=0,!ve){var qe=r(2,8*ne)-1;ee(this,L,U,ne,qe,0)}var Pe=1,rt=0;for(this[U]=255&L;++rt>>=0,ne>>>=0,!ve){var qe=r(2,8*ne)-1;ee(this,L,U,ne,qe,0)}var Pe=ne-1,rt=1;for(this[U+Pe]=255&L;0<=--Pe&&(rt*=256);)this[U+Pe]=255&L/rt;return U+ne},p.prototype.writeUInt8=function(L,U,ne){return L=+L,U>>>=0,ne||ee(this,L,U,1,255,0),this[U]=255&L,U+1},p.prototype.writeUInt16LE=function(L,U,ne){return L=+L,U>>>=0,ne||ee(this,L,U,2,65535,0),this[U]=255&L,this[U+1]=L>>>8,U+2},p.prototype.writeUInt16BE=function(L,U,ne){return L=+L,U>>>=0,ne||ee(this,L,U,2,65535,0),this[U]=L>>>8,this[U+1]=255&L,U+2},p.prototype.writeUInt32LE=function(L,U,ne){return L=+L,U>>>=0,ne||ee(this,L,U,4,4294967295,0),this[U+3]=L>>>24,this[U+2]=L>>>16,this[U+1]=L>>>8,this[U]=255&L,U+4},p.prototype.writeUInt32BE=function(L,U,ne){return L=+L,U>>>=0,ne||ee(this,L,U,4,4294967295,0),this[U]=L>>>24,this[U+1]=L>>>16,this[U+2]=L>>>8,this[U+3]=255&L,U+4},p.prototype.writeIntLE=function(L,U,ne,ve){if(L=+L,U>>>=0,!ve){var qe=r(2,8*ne-1);ee(this,L,U,ne,qe-1,-qe)}var Pe=0,rt=1,qt=0;for(this[U]=255&L;++PeL&&qt===0&&this[U+Pe-1]!==0&&(qt=1),this[U+Pe]=255&(L/rt>>0)-qt;return U+ne},p.prototype.writeIntBE=function(L,U,ne,ve){if(L=+L,U>>>=0,!ve){var qe=r(2,8*ne-1);ee(this,L,U,ne,qe-1,-qe)}var Pe=ne-1,rt=1,qt=0;for(this[U+Pe]=255&L;0<=--Pe&&(rt*=256);)0>L&&qt===0&&this[U+Pe+1]!==0&&(qt=1),this[U+Pe]=255&(L/rt>>0)-qt;return U+ne},p.prototype.writeInt8=function(L,U,ne){return L=+L,U>>>=0,ne||ee(this,L,U,1,127,-128),0>L&&(L=255+L+1),this[U]=255&L,U+1},p.prototype.writeInt16LE=function(L,U,ne){return L=+L,U>>>=0,ne||ee(this,L,U,2,32767,-32768),this[U]=255&L,this[U+1]=L>>>8,U+2},p.prototype.writeInt16BE=function(L,U,ne){return L=+L,U>>>=0,ne||ee(this,L,U,2,32767,-32768),this[U]=L>>>8,this[U+1]=255&L,U+2},p.prototype.writeInt32LE=function(L,U,ne){return L=+L,U>>>=0,ne||ee(this,L,U,4,2147483647,-2147483648),this[U]=255&L,this[U+1]=L>>>8,this[U+2]=L>>>16,this[U+3]=L>>>24,U+4},p.prototype.writeInt32BE=function(L,U,ne){return L=+L,U>>>=0,ne||ee(this,L,U,4,2147483647,-2147483648),0>L&&(L=4294967295+L+1),this[U]=L>>>24,this[U+1]=L>>>16,this[U+2]=L>>>8,this[U+3]=255&L,U+4},p.prototype.writeFloatLE=function(L,U,ne){return ce(this,L,U,!0,ne)},p.prototype.writeFloatBE=function(L,U,ne){return ce(this,L,U,!1,ne)},p.prototype.writeDoubleLE=function(L,U,ne){return me(this,L,U,!0,ne)},p.prototype.writeDoubleBE=function(L,U,ne){return me(this,L,U,!1,ne)},p.prototype.copy=function(L,U,ne,ve){if(!p.isBuffer(L))throw new TypeError("argument should be a Buffer");if(ne||(ne=0),ve||ve===0||(ve=this.length),U>=L.length&&(U=L.length),U||(U=0),0U)throw new RangeError("targetStart out of bounds");if(0>ne||ne>=this.length)throw new RangeError("Index out of range");if(0>ve)throw new RangeError("sourceEnd out of bounds");ve>this.length&&(ve=this.length),L.length-Uqe||ve==="latin1")&&(L=qe)}}else typeof L=="number"&&(L&=255);if(0>U||this.length>>=0,ne=ne===void 0?this.length:ne>>>0,L||(L=0);var Pe;if(typeof L=="number")for(Pe=U;Pe{g==="%%"||(b++,g==="%c"&&(h=b))}),p.splice(h,0,f)},c.save=function(p){try{p?c.storage.setItem("debug",p):c.storage.removeItem("debug")}catch{}},c.load=u,c.useColors=function(){return!!(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))||!(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&(typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&31<=parseInt(RegExp.$1,10)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},c.storage=function(){try{return localStorage}catch{}}(),c.destroy=(()=>{let p=!1;return()=>{p||(p=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),c.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],c.log=console.debug||console.log||(()=>{}),i.exports=s("./common")(c);const{formatters:d}=i.exports;d.j=function(p){try{return JSON.stringify(p)}catch(f){return"[UnexpectedJSONParseError]: "+f.message}}}).call(this)}).call(this,s("_process"))},{"./common":5,_process:12}],5:[function(s,i){i.exports=function(c){function l(p){function f(...g){if(!f.enabled)return;const z=f,A=+new Date,_=A-(b||A);z.diff=_,z.prev=b,z.curr=A,b=A,g[0]=l.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let v=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,(y,k)=>{if(y==="%%")return"%";v++;const S=l.formatters[k];if(typeof S=="function"){const C=g[v];y=S.call(z,C),g.splice(v,1),v--}return y}),l.formatArgs.call(z,g),(z.log||l.log).apply(z,g)}let b,h=null;return f.namespace=p,f.useColors=l.useColors(),f.color=l.selectColor(p),f.extend=u,f.destroy=l.destroy,Object.defineProperty(f,"enabled",{enumerable:!0,configurable:!1,get:()=>h===null?l.enabled(p):h,set:g=>{h=g}}),typeof l.init=="function"&&l.init(f),f}function u(p,f){const b=l(this.namespace+(typeof f>"u"?":":f)+p);return b.log=this.log,b}function d(p){return p.toString().substring(2,p.toString().length-2).replace(/\.\*\?$/,"*")}return l.debug=l,l.default=l,l.coerce=function(p){return p instanceof Error?p.stack||p.message:p},l.disable=function(){const p=[...l.names.map(d),...l.skips.map(d).map(f=>"-"+f)].join(",");return l.enable(""),p},l.enable=function(p){l.save(p),l.names=[],l.skips=[];let f;const b=(typeof p=="string"?p:"").split(/[\s,]+/),h=b.length;for(f=0;f{l[p]=c[p]}),l.names=[],l.skips=[],l.formatters={},l.selectColor=function(p){let f=0;for(let b=0;bj&&!P.warned){P.warned=!0;var $=new Error("Possible EventEmitter memory leak detected. "+P.length+" "+(E+" listeners added. Use emitter.setMaxListeners() to increase limit"));$.name="MaxListenersExceededWarning",$.emitter=T,$.type=E,$.count=P.length,c($)}return T}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function b(T,E,B){var N={fired:!1,wrapFn:void 0,target:T,type:E,listener:B},j=f.bind(N);return j.listener=B,N.wrapFn=j,j}function h(T,E,B){var N=T._events;if(N===void 0)return[];var j=N[E];return j===void 0?[]:typeof j=="function"?B?[j.listener||j]:[j]:B?_(j):z(j,j.length)}function g(T){var E=this._events;if(E!==void 0){var B=E[T];if(typeof B=="function")return 1;if(B!==void 0)return B.length}return 0}function z(T,E){for(var B=Array(E),N=0;NT||C(T))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+T+".");R=T}}),l.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},l.prototype.setMaxListeners=function(T){if(typeof T!="number"||0>T||C(T))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+T+".");return this._maxListeners=T,this},l.prototype.getMaxListeners=function(){return d(this)},l.prototype.emit=function(T){for(var E=[],B=1;Bj)return this;j===0?B.shift():A(B,j),B.length===1&&(N[T]=B[0]),N.removeListener!==void 0&&this.emit("removeListener",T,P||E)}return this},l.prototype.off=l.prototype.removeListener,l.prototype.removeAllListeners=function(T){var E,B,N;if(B=this._events,B===void 0)return this;if(B.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):B[T]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete B[T]),this;if(arguments.length===0){var j,I=Object.keys(B);for(N=0;N"u")return null;var c={RTCPeerConnection:globalThis.RTCPeerConnection||globalThis.mozRTCPeerConnection||globalThis.webkitRTCPeerConnection,RTCSessionDescription:globalThis.RTCSessionDescription||globalThis.mozRTCSessionDescription||globalThis.webkitRTCSessionDescription,RTCIceCandidate:globalThis.RTCIceCandidate||globalThis.mozRTCIceCandidate||globalThis.webkitRTCIceCandidate};return c.RTCPeerConnection?c:null}},{}],9:[function(s,i,c){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */c.read=function(l,u,d,p,f){var b,h,g=8*f-p-1,z=(1<>1,_=-7,v=d?f-1:0,M=d?-1:1,y=l[u+v];for(v+=M,b=y&(1<<-_)-1,y>>=-_,_+=g;0<_;b=256*b+l[u+v],v+=M,_-=8);for(h=b&(1<<-_)-1,b>>=-_,_+=p;0<_;h=256*h+l[u+v],v+=M,_-=8);if(b===0)b=1-A;else{if(b===z)return h?NaN:(y?-1:1)*(1/0);h+=r(2,p),b-=A}return(y?-1:1)*h*r(2,b-p)},c.write=function(l,u,d,p,f,b){var h,g,z,A=Math.LN2,_=Math.log,v=8*b-f-1,M=(1<>1,k=f===23?r(2,-24)-r(2,-77):0,S=p?0:b-1,C=p?1:-1,R=0>u||u===0&&0>1/u?1:0;for(u=o(u),isNaN(u)||u===1/0?(g=isNaN(u)?1:0,h=M):(h=n(_(u)/A),1>u*(z=r(2,-h))&&(h--,z*=2),u+=1<=h+y?k/z:k*r(2,1-y),2<=u*z&&(h++,z/=2),h+y>=M?(g=0,h=M):1<=h+y?(g=(u*z-1)*r(2,f),h+=y):(g=u*r(2,y-1)*r(2,f),h=0));8<=f;l[d+S]=255&g,S+=C,g/=256,f-=8);for(h=h<=1.5*h?"s":"")}i.exports=function(f,b){b=b||{};var h=typeof f;if(h=="string"&&0 */let l;i.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window>"u"?c:window):u=>(l||(l=Promise.resolve())).then(u).catch(d=>setTimeout(()=>{throw d},0))}).call(this)}).call(this,typeof p1>"u"?typeof self>"u"?typeof window>"u"?{}:window:self:p1)},{}],14:[function(s,i){(function(c,l){(function(){var u=s("safe-buffer").Buffer,d=l.crypto||l.msCrypto;i.exports=d&&d.getRandomValues?function(p,f){if(p>4294967295)throw new RangeError("requested too many random bytes");var b=u.allocUnsafe(p);if(0"u"?typeof self>"u"?typeof window>"u"?{}:window:self:p1)},{_process:12,"safe-buffer":30}],15:[function(s,i){function c(h,g){h.prototype=Object.create(g.prototype),h.prototype.constructor=h,h.__proto__=g}function l(h,g,z){function A(v,M,y){return typeof g=="string"?g:g(v,M,y)}z||(z=Error);var _=function(v){function M(y,k,S){return v.call(this,A(y,k,S))||this}return c(M,v),M}(z);_.prototype.name=z.name,_.prototype.code=h,b[h]=_}function u(h,g){if(Array.isArray(h)){var z=h.length;return h=h.map(function(A){return A+""}),2h.length)&&(z=h.length),h.substring(z-g.length,z)===g}function f(h,g,z){return typeof z!="number"&&(z=0),!(z+g.length>h.length)&&h.indexOf(g,z)!==-1}var b={};l("ERR_INVALID_OPT_VALUE",function(h,g){return'The value "'+g+'" is invalid for option "'+h+'"'},TypeError),l("ERR_INVALID_ARG_TYPE",function(h,g,z){var A;typeof g=="string"&&d(g,"not ")?(A="must not be",g=g.replace(/^not /,"")):A="must be";var _;if(p(h," argument"))_="The ".concat(h," ").concat(A," ").concat(u(g,"type"));else{var v=f(h,".")?"property":"argument";_='The "'.concat(h,'" ').concat(v," ").concat(A," ").concat(u(g,"type"))}return _+=". Received type ".concat(typeof z),_},TypeError),l("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),l("ERR_METHOD_NOT_IMPLEMENTED",function(h){return"The "+h+" method is not implemented"}),l("ERR_STREAM_PREMATURE_CLOSE","Premature close"),l("ERR_STREAM_DESTROYED",function(h){return"Cannot call "+h+" after a stream was destroyed"}),l("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),l("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),l("ERR_STREAM_WRITE_AFTER_END","write after end"),l("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),l("ERR_UNKNOWN_ENCODING",function(h){return"Unknown encoding: "+h},TypeError),l("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),i.exports.codes=b},{}],16:[function(s,i){(function(c){(function(){function l(A){return this instanceof l?(f.call(this,A),b.call(this,A),this.allowHalfOpen=!0,void(A&&(A.readable===!1&&(this.readable=!1),A.writable===!1&&(this.writable=!1),A.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",u))))):new l(A)}function u(){this._writableState.ended||c.nextTick(d,this)}function d(A){A.end()}var p=Object.keys||function(A){var _=[];for(var v in A)_.push(v);return _};i.exports=l;var f=s("./_stream_readable"),b=s("./_stream_writable");s("inherits")(l,f);for(var h,g=p(b.prototype),z=0;z>>1,se|=se>>>2,se|=se>>>4,se|=se>>>8,se|=se>>>16,se++),se}function _(se,L){return 0>=se||L.length===0&&L.ended?0:L.objectMode?1:se===se?(se>L.highWaterMark&&(L.highWaterMark=A(se)),se<=L.length?se:L.ended?L.length:(L.needReadable=!0,0)):L.flowing&&L.length?L.buffer.head.data.length:L.length}function v(se,L){if(X("onEofChunk"),!L.ended){if(L.decoder){var U=L.decoder.end();U&&U.length&&(L.buffer.push(U),L.length+=L.objectMode?1:U.length)}L.ended=!0,L.sync?M(se):(L.needReadable=!1,!L.emittedReadable&&(L.emittedReadable=!0,y(se)))}}function M(se){var L=se._readableState;X("emitReadable",L.needReadable,L.emittedReadable),L.needReadable=!1,L.emittedReadable||(X("emitReadable",L.flowing),L.emittedReadable=!0,c.nextTick(y,se))}function y(se){var L=se._readableState;X("emitReadable_",L.destroyed,L.length,L.ended),!L.destroyed&&(L.length||L.ended)&&(se.emit("readable"),L.emittedReadable=!1),L.needReadable=!L.flowing&&!L.ended&&L.length<=L.highWaterMark,N(se)}function k(se,L){L.readingMore||(L.readingMore=!0,c.nextTick(S,se,L))}function S(se,L){for(;!L.reading&&!L.ended&&(L.length=L.length?(U=L.decoder?L.buffer.join(""):L.buffer.length===1?L.buffer.first():L.buffer.concat(L.length),L.buffer.clear()):U=L.buffer.consume(se,L.decoder),U}function I(se){var L=se._readableState;X("endReadable",L.endEmitted),L.endEmitted||(L.ended=!0,c.nextTick(P,L,se))}function P(se,L){if(X("endReadableNT",se.endEmitted,se.length),!se.endEmitted&&se.length===0&&(se.endEmitted=!0,L.readable=!1,L.emit("end"),se.autoDestroy)){var U=L._writableState;(!U||U.autoDestroy&&U.finished)&&L.destroy()}}function $(se,L){for(var U=0,ne=se.length;U=L.highWaterMark)||L.ended))return X("read: emitReadable",L.length,L.ended),L.length===0&&L.ended?I(this):M(this),null;if(se=_(se,L),se===0&&L.ended)return L.length===0&&I(this),null;var ne=L.needReadable;X("need readable",ne),(L.length===0||L.length-se"u"?typeof self>"u"?typeof window>"u"?{}:window:self:p1)},{"../errors":15,"./_stream_duplex":16,"./internal/streams/async_iterator":21,"./internal/streams/buffer_list":22,"./internal/streams/destroy":23,"./internal/streams/from":25,"./internal/streams/state":27,"./internal/streams/stream":28,_process:12,buffer:3,events:7,inherits:10,"string_decoder/":31,util:2}],19:[function(s,i){function c(A,_){var v=this._transformState;v.transforming=!1;var M=v.writecb;if(M===null)return this.emit("error",new b);v.writechunk=null,v.writecb=null,_!=null&&this.push(_),M(A);var y=this._readableState;y.reading=!1,(y.needReadable||y.length"u"?typeof self>"u"?typeof window>"u"?{}:window:self:p1)},{"../errors":15,"./_stream_duplex":16,"./internal/streams/destroy":23,"./internal/streams/state":27,"./internal/streams/stream":28,_process:12,buffer:3,inherits:10,"util-deprecate":32}],21:[function(s,i){(function(c){(function(){function l(C,R,T){return R in C?Object.defineProperty(C,R,{value:T,enumerable:!0,configurable:!0,writable:!0}):C[R]=T,C}function u(C,R){return{value:C,done:R}}function d(C){var R=C[g];if(R!==null){var T=C[y].read();T!==null&&(C[v]=null,C[g]=null,C[z]=null,R(u(T,!1)))}}function p(C){c.nextTick(d,C)}function f(C,R){return function(T,E){C.then(function(){return R[_]?void T(u(void 0,!0)):void R[M](T,E)},E)}}var b,h=s("./end-of-stream"),g=Symbol("lastResolve"),z=Symbol("lastReject"),A=Symbol("error"),_=Symbol("ended"),v=Symbol("lastPromise"),M=Symbol("handlePromise"),y=Symbol("stream"),k=Object.getPrototypeOf(function(){}),S=Object.setPrototypeOf((b={get stream(){return this[y]},next:function(){var C=this,R=this[A];if(R!==null)return Promise.reject(R);if(this[_])return Promise.resolve(u(void 0,!0));if(this[y].destroyed)return new Promise(function(N,j){c.nextTick(function(){C[A]?j(C[A]):N(u(void 0,!0))})});var T,E=this[v];if(E)T=new Promise(f(E,this));else{var B=this[y].read();if(B!==null)return Promise.resolve(u(B,!1));T=new Promise(this[M])}return this[v]=T,T}},l(b,Symbol.asyncIterator,function(){return this}),l(b,"return",function(){var C=this;return new Promise(function(R,T){C[y].destroy(null,function(E){return E?void T(E):void R(u(void 0,!0))})})}),b),k);i.exports=function(C){var R,T=Object.create(S,(R={},l(R,y,{value:C,writable:!0}),l(R,g,{value:null,writable:!0}),l(R,z,{value:null,writable:!0}),l(R,A,{value:null,writable:!0}),l(R,_,{value:C._readableState.endEmitted,writable:!0}),l(R,M,{value:function(E,B){var N=T[y].read();N?(T[v]=null,T[g]=null,T[z]=null,E(u(N,!1))):(T[g]=E,T[z]=B)},writable:!0}),R));return T[v]=null,h(C,function(E){if(E&&E.code!=="ERR_STREAM_PREMATURE_CLOSE"){var B=T[z];return B!==null&&(T[v]=null,T[g]=null,T[z]=null,B(E)),void(T[A]=E)}var N=T[g];N!==null&&(T[v]=null,T[g]=null,T[z]=null,N(u(void 0,!0))),T[_]=!0}),C.on("readable",p.bind(null,T)),T}}).call(this)}).call(this,s("_process"))},{"./end-of-stream":24,_process:12}],22:[function(s,i){function c(v,M){var y=Object.keys(v);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(v);M&&(k=k.filter(function(S){return Object.getOwnPropertyDescriptor(v,S).enumerable})),y.push.apply(y,k)}return y}function l(v){for(var M,y=1;y>>0),k=this.head,S=0;k;)b(k.data,y,S),S+=k.data.length,k=k.next;return y}},{key:"consume",value:function(M,y){var k;return MC.length?C.length:M;if(S+=R===C.length?C:C.slice(0,M),M-=R,M===0){R===C.length?(++k,this.head=y.next?y.next:this.tail=null):(this.head=y,y.data=C.slice(R));break}++k}return this.length-=k,S}},{key:"_getBuffer",value:function(M){var y=g.allocUnsafe(M),k=this.head,S=1;for(k.data.copy(y),M-=k.data.length;k=k.next;){var C=k.data,R=M>C.length?C.length:M;if(C.copy(y,y.length-M,0,R),M-=R,M===0){R===C.length?(++S,this.head=k.next?k.next:this.tail=null):(this.head=k,k.data=C.slice(R));break}++S}return this.length-=S,y}},{key:_,value:function(M,y){return A(this,l({},y,{depth:0,customInspect:!1}))}}]),v}()},{buffer:3,util:2}],23:[function(s,i){(function(c){(function(){function l(p,f){d(p,f),u(p)}function u(p){p._writableState&&!p._writableState.emitClose||p._readableState&&!p._readableState.emitClose||p.emit("close")}function d(p,f){p.emit("error",f)}i.exports={destroy:function(p,f){var b=this,h=this._readableState&&this._readableState.destroyed,g=this._writableState&&this._writableState.destroyed;return h||g?(f?f(p):p&&(this._writableState?!this._writableState.errorEmitted&&(this._writableState.errorEmitted=!0,c.nextTick(d,this,p)):c.nextTick(d,this,p)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(p||null,function(z){!f&&z?b._writableState?b._writableState.errorEmitted?c.nextTick(u,b):(b._writableState.errorEmitted=!0,c.nextTick(l,b,z)):c.nextTick(l,b,z):f?(c.nextTick(u,b),f(z)):c.nextTick(u,b)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(p,f){var b=p._readableState,h=p._writableState;b&&b.autoDestroy||h&&h.autoDestroy?p.destroy(f):p.emit("error",f)}}}).call(this)}).call(this,s("_process"))},{_process:12}],24:[function(s,i){function c(f){var b=!1;return function(){if(!b){b=!0;for(var h=arguments.length,g=Array(h),z=0;zv.length)throw new z("streams");var k,S=v.map(function(C,R){var T=Rb){var h=f?p:"highWaterMark";throw new l(h,b)}return n(b)}return u.objectMode?16:16384}}},{"../../../errors":15}],28:[function(s,i){i.exports=s("events").EventEmitter},{events:7}],29:[function(s,i,c){c=i.exports=s("./lib/_stream_readable.js"),c.Stream=c,c.Readable=c,c.Writable=s("./lib/_stream_writable.js"),c.Duplex=s("./lib/_stream_duplex.js"),c.Transform=s("./lib/_stream_transform.js"),c.PassThrough=s("./lib/_stream_passthrough.js"),c.finished=s("./lib/internal/streams/end-of-stream.js"),c.pipeline=s("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":16,"./lib/_stream_passthrough.js":17,"./lib/_stream_readable.js":18,"./lib/_stream_transform.js":19,"./lib/_stream_writable.js":20,"./lib/internal/streams/end-of-stream.js":24,"./lib/internal/streams/pipeline.js":26}],30:[function(s,i,c){function l(f,b){for(var h in f)b[h]=f[h]}function u(f,b,h){return p(f,b,h)}/*! safe-buffer. MIT License. Feross Aboukhadijeh */var d=s("buffer"),p=d.Buffer;p.from&&p.alloc&&p.allocUnsafe&&p.allocUnsafeSlow?i.exports=d:(l(d,c),c.Buffer=u),u.prototype=Object.create(p.prototype),l(p,u),u.from=function(f,b,h){if(typeof f=="number")throw new TypeError("Argument must not be a number");return p(f,b,h)},u.alloc=function(f,b,h){if(typeof f!="number")throw new TypeError("Argument must be a number");var g=p(f);return b===void 0?g.fill(0):typeof h=="string"?g.fill(b,h):g.fill(b),g},u.allocUnsafe=function(f){if(typeof f!="number")throw new TypeError("Argument must be a number");return p(f)},u.allocUnsafeSlow=function(f){if(typeof f!="number")throw new TypeError("Argument must be a number");return d.SlowBuffer(f)}},{buffer:3}],31:[function(s,i,c){function l(S){if(!S)return"utf8";for(var C;;)switch(S){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return S;default:if(C)return;S=(""+S).toLowerCase(),C=!0}}function u(S){var C=l(S);if(typeof C!="string"&&(y.isEncoding===k||!k(S)))throw new Error("Unknown encoding: "+S);return C||S}function d(S){this.encoding=u(S);var C;switch(this.encoding){case"utf16le":this.text=g,this.end=z,C=4;break;case"utf8":this.fillLast=h,C=4;break;case"base64":this.text=A,this.end=_,C=3;break;default:return this.write=v,void(this.end=M)}this.lastNeed=0,this.lastTotal=0,this.lastChar=y.allocUnsafe(C)}function p(S){return 127>=S?0:S>>5==6?2:S>>4==14?3:S>>3==30?4:S>>6==2?-1:-2}function f(S,C,R){var T=C.length-1;if(T=T)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=S[S.length-2],this.lastChar[1]=S[S.length-1],R.slice(0,-1)}return R}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=S[S.length-1],S.toString("utf16le",C,S.length-1)}function z(S){var C=S&&S.length?this.write(S):"";if(this.lastNeed){var R=this.lastTotal-this.lastNeed;return C+this.lastChar.toString("utf16le",0,R)}return C}function A(S,C){var R=(S.length-C)%3;return R==0?S.toString("base64",C):(this.lastNeed=3-R,this.lastTotal=3,R==1?this.lastChar[0]=S[S.length-1]:(this.lastChar[0]=S[S.length-2],this.lastChar[1]=S[S.length-1]),S.toString("base64",C,S.length-R))}function _(S){var C=S&&S.length?this.write(S):"";return this.lastNeed?C+this.lastChar.toString("base64",0,3-this.lastNeed):C}function v(S){return S.toString(this.encoding)}function M(S){return S&&S.length?this.write(S):""}var y=s("safe-buffer").Buffer,k=y.isEncoding||function(S){switch(S=""+S,S&&S.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};c.StringDecoder=d,d.prototype.write=function(S){if(S.length===0)return"";var C,R;if(this.lastNeed){if(C=this.fillLast(S),C===void 0)return"";R=this.lastNeed,this.lastNeed=0}else R=0;return R"u"?typeof self>"u"?typeof window>"u"?{}:window:self:p1)},{}],"/":[function(s,i){function c(_){return _.replace(/a=ice-options:trickle\s\n/g,"")}function l(_){console.warn(_)}/*! simple-peer. MIT License. Feross Aboukhadijeh */const u=s("debug")("simple-peer"),d=s("get-browser-rtc"),p=s("randombytes"),f=s("readable-stream"),b=s("queue-microtask"),h=s("err-code"),{Buffer:g}=s("buffer"),z=65536;class A extends f.Duplex{constructor(v){if(v=Object.assign({allowHalfOpen:!1},v),super(v),this._id=p(4).toString("hex").slice(0,7),this._debug("new peer %o",v),this.channelName=v.initiator?v.channelName||p(20).toString("hex"):null,this.initiator=v.initiator||!1,this.channelConfig=v.channelConfig||A.channelConfig,this.channelNegotiated=this.channelConfig.negotiated,this.config=Object.assign({},A.config,v.config),this.offerOptions=v.offerOptions||{},this.answerOptions=v.answerOptions||{},this.sdpTransform=v.sdpTransform||(M=>M),this.streams=v.streams||(v.stream?[v.stream]:[]),this.trickle=v.trickle===void 0||v.trickle,this.allowHalfTrickle=v.allowHalfTrickle!==void 0&&v.allowHalfTrickle,this.iceCompleteTimeout=v.iceCompleteTimeout||5e3,this.destroyed=!1,this.destroying=!1,this._connected=!1,this.remoteAddress=void 0,this.remoteFamily=void 0,this.remotePort=void 0,this.localAddress=void 0,this.localFamily=void 0,this.localPort=void 0,this._wrtc=v.wrtc&&typeof v.wrtc=="object"?v.wrtc:d(),!this._wrtc)throw h(typeof window>"u"?new Error("No WebRTC support: Specify `opts.wrtc` option in this environment"):new Error("No WebRTC support: Not a supported browser"),"ERR_WEBRTC_SUPPORT");this._pcReady=!1,this._channelReady=!1,this._iceComplete=!1,this._iceCompleteTimer=null,this._channel=null,this._pendingCandidates=[],this._isNegotiating=!1,this._firstNegotiation=!0,this._batchedNegotiation=!1,this._queuedNegotiation=!1,this._sendersAwaitingStable=[],this._senderMap=new Map,this._closingInterval=null,this._remoteTracks=[],this._remoteStreams=[],this._chunk=null,this._cb=null,this._interval=null;try{this._pc=new this._wrtc.RTCPeerConnection(this.config)}catch(M){return void this.destroy(h(M,"ERR_PC_CONSTRUCTOR"))}this._isReactNativeWebrtc=typeof this._pc._peerConnectionId=="number",this._pc.oniceconnectionstatechange=()=>{this._onIceStateChange()},this._pc.onicegatheringstatechange=()=>{this._onIceStateChange()},this._pc.onconnectionstatechange=()=>{this._onConnectionStateChange()},this._pc.onsignalingstatechange=()=>{this._onSignalingStateChange()},this._pc.onicecandidate=M=>{this._onIceCandidate(M)},typeof this._pc.peerIdentity=="object"&&this._pc.peerIdentity.catch(M=>{this.destroy(h(M,"ERR_PC_PEER_IDENTITY"))}),this.initiator||this.channelNegotiated?this._setupData({channel:this._pc.createDataChannel(this.channelName,this.channelConfig)}):this._pc.ondatachannel=M=>{this._setupData(M)},this.streams&&this.streams.forEach(M=>{this.addStream(M)}),this._pc.ontrack=M=>{this._onTrack(M)},this._debug("initial negotiation"),this._needsNegotiation(),this._onFinishBound=()=>{this._onFinish()},this.once("finish",this._onFinishBound)}get bufferSize(){return this._channel&&this._channel.bufferedAmount||0}get connected(){return this._connected&&this._channel.readyState==="open"}address(){return{port:this.localPort,family:this.localFamily,address:this.localAddress}}signal(v){if(!this.destroying){if(this.destroyed)throw h(new Error("cannot signal after peer is destroyed"),"ERR_DESTROYED");if(typeof v=="string")try{v=JSON.parse(v)}catch{v={}}this._debug("signal()"),v.renegotiate&&this.initiator&&(this._debug("got request to renegotiate"),this._needsNegotiation()),v.transceiverRequest&&this.initiator&&(this._debug("got request for transceiver"),this.addTransceiver(v.transceiverRequest.kind,v.transceiverRequest.init)),v.candidate&&(this._pc.remoteDescription&&this._pc.remoteDescription.type?this._addIceCandidate(v.candidate):this._pendingCandidates.push(v.candidate)),v.sdp&&this._pc.setRemoteDescription(new this._wrtc.RTCSessionDescription(v)).then(()=>{this.destroyed||(this._pendingCandidates.forEach(M=>{this._addIceCandidate(M)}),this._pendingCandidates=[],this._pc.remoteDescription.type==="offer"&&this._createAnswer())}).catch(M=>{this.destroy(h(M,"ERR_SET_REMOTE_DESCRIPTION"))}),v.sdp||v.candidate||v.renegotiate||v.transceiverRequest||this.destroy(h(new Error("signal() called with invalid signal data"),"ERR_SIGNALING"))}}_addIceCandidate(v){const M=new this._wrtc.RTCIceCandidate(v);this._pc.addIceCandidate(M).catch(y=>{!M.address||M.address.endsWith(".local")?l("Ignoring unsupported ICE candidate."):this.destroy(h(y,"ERR_ADD_ICE_CANDIDATE"))})}send(v){if(!this.destroying){if(this.destroyed)throw h(new Error("cannot send after peer is destroyed"),"ERR_DESTROYED");this._channel.send(v)}}addTransceiver(v,M){if(!this.destroying){if(this.destroyed)throw h(new Error("cannot addTransceiver after peer is destroyed"),"ERR_DESTROYED");if(this._debug("addTransceiver()"),this.initiator)try{this._pc.addTransceiver(v,M),this._needsNegotiation()}catch(y){this.destroy(h(y,"ERR_ADD_TRANSCEIVER"))}else this.emit("signal",{type:"transceiverRequest",transceiverRequest:{kind:v,init:M}})}}addStream(v){if(!this.destroying){if(this.destroyed)throw h(new Error("cannot addStream after peer is destroyed"),"ERR_DESTROYED");this._debug("addStream()"),v.getTracks().forEach(M=>{this.addTrack(M,v)})}}addTrack(v,M){if(this.destroying)return;if(this.destroyed)throw h(new Error("cannot addTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("addTrack()");const y=this._senderMap.get(v)||new Map;let k=y.get(M);if(!k)k=this._pc.addTrack(v,M),y.set(M,k),this._senderMap.set(v,y),this._needsNegotiation();else throw k.removed?h(new Error("Track has been removed. You should enable/disable tracks that you want to re-add."),"ERR_SENDER_REMOVED"):h(new Error("Track has already been added to that stream."),"ERR_SENDER_ALREADY_ADDED")}replaceTrack(v,M,y){if(this.destroying)return;if(this.destroyed)throw h(new Error("cannot replaceTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("replaceTrack()");const k=this._senderMap.get(v),S=k?k.get(y):null;if(!S)throw h(new Error("Cannot replace track that was never added."),"ERR_TRACK_NOT_ADDED");M&&this._senderMap.set(M,k),S.replaceTrack==null?this.destroy(h(new Error("replaceTrack is not supported in this browser"),"ERR_UNSUPPORTED_REPLACETRACK")):S.replaceTrack(M)}removeTrack(v,M){if(this.destroying)return;if(this.destroyed)throw h(new Error("cannot removeTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSender()");const y=this._senderMap.get(v),k=y?y.get(M):null;if(!k)throw h(new Error("Cannot remove track that was never added."),"ERR_TRACK_NOT_ADDED");try{k.removed=!0,this._pc.removeTrack(k)}catch(S){S.name==="NS_ERROR_UNEXPECTED"?this._sendersAwaitingStable.push(k):this.destroy(h(S,"ERR_REMOVE_TRACK"))}this._needsNegotiation()}removeStream(v){if(!this.destroying){if(this.destroyed)throw h(new Error("cannot removeStream after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSenders()"),v.getTracks().forEach(M=>{this.removeTrack(M,v)})}}_needsNegotiation(){this._debug("_needsNegotiation"),this._batchedNegotiation||(this._batchedNegotiation=!0,b(()=>{this._batchedNegotiation=!1,this.initiator||!this._firstNegotiation?(this._debug("starting batched negotiation"),this.negotiate()):this._debug("non-initiator initial negotiation request discarded"),this._firstNegotiation=!1}))}negotiate(){if(!this.destroying){if(this.destroyed)throw h(new Error("cannot negotiate after peer is destroyed"),"ERR_DESTROYED");this.initiator?this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("start negotiation"),setTimeout(()=>{this._createOffer()},0)):this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("requesting negotiation from initiator"),this.emit("signal",{type:"renegotiate",renegotiate:!0})),this._isNegotiating=!0}}destroy(v){this._destroy(v,()=>{})}_destroy(v,M){this.destroyed||this.destroying||(this.destroying=!0,this._debug("destroying (error: %s)",v&&(v.message||v)),b(()=>{if(this.destroyed=!0,this.destroying=!1,this._debug("destroy (error: %s)",v&&(v.message||v)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this._connected=!1,this._pcReady=!1,this._channelReady=!1,this._remoteTracks=null,this._remoteStreams=null,this._senderMap=null,clearInterval(this._closingInterval),this._closingInterval=null,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._onFinishBound&&this.removeListener("finish",this._onFinishBound),this._onFinishBound=null,this._channel){try{this._channel.close()}catch{}this._channel.onmessage=null,this._channel.onopen=null,this._channel.onclose=null,this._channel.onerror=null}if(this._pc){try{this._pc.close()}catch{}this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ontrack=null,this._pc.ondatachannel=null}this._pc=null,this._channel=null,v&&this.emit("error",v),this.emit("close"),M()}))}_setupData(v){if(!v.channel)return this.destroy(h(new Error("Data channel event is missing `channel` property"),"ERR_DATA_CHANNEL"));this._channel=v.channel,this._channel.binaryType="arraybuffer",typeof this._channel.bufferedAmountLowThreshold=="number"&&(this._channel.bufferedAmountLowThreshold=z),this.channelName=this._channel.label,this._channel.onmessage=y=>{this._onChannelMessage(y)},this._channel.onbufferedamountlow=()=>{this._onChannelBufferedAmountLow()},this._channel.onopen=()=>{this._onChannelOpen()},this._channel.onclose=()=>{this._onChannelClose()},this._channel.onerror=y=>{const k=y.error instanceof Error?y.error:new Error(`Datachannel error: ${y.message} ${y.filename}:${y.lineno}:${y.colno}`);this.destroy(h(k,"ERR_DATA_CHANNEL"))};let M=!1;this._closingInterval=setInterval(()=>{this._channel&&this._channel.readyState==="closing"?(M&&this._onChannelClose(),M=!0):M=!1},5e3)}_read(){}_write(v,M,y){if(this.destroyed)return y(h(new Error("cannot write after peer is destroyed"),"ERR_DATA_CHANNEL"));if(this._connected){try{this.send(v)}catch(k){return this.destroy(h(k,"ERR_DATA_CHANNEL"))}this._channel.bufferedAmount>z?(this._debug("start backpressure: bufferedAmount %d",this._channel.bufferedAmount),this._cb=y):y(null)}else this._debug("write before connect"),this._chunk=v,this._cb=y}_onFinish(){if(!this.destroyed){const v=()=>{setTimeout(()=>this.destroy(),1e3)};this._connected?v():this.once("connect",v)}}_startIceCompleteTimeout(){this.destroyed||this._iceCompleteTimer||(this._debug("started iceComplete timeout"),this._iceCompleteTimer=setTimeout(()=>{this._iceComplete||(this._iceComplete=!0,this._debug("iceComplete timeout completed"),this.emit("iceTimeout"),this.emit("_iceComplete"))},this.iceCompleteTimeout))}_createOffer(){this.destroyed||this._pc.createOffer(this.offerOptions).then(v=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(v.sdp=c(v.sdp)),v.sdp=this.sdpTransform(v.sdp);const M=()=>{if(!this.destroyed){const y=this._pc.localDescription||v;this._debug("signal"),this.emit("signal",{type:y.type,sdp:y.sdp})}};this._pc.setLocalDescription(v).then(()=>{this._debug("createOffer success"),this.destroyed||(this.trickle||this._iceComplete?M():this.once("_iceComplete",M))}).catch(y=>{this.destroy(h(y,"ERR_SET_LOCAL_DESCRIPTION"))})}).catch(v=>{this.destroy(h(v,"ERR_CREATE_OFFER"))})}_requestMissingTransceivers(){this._pc.getTransceivers&&this._pc.getTransceivers().forEach(v=>{v.mid||!v.sender.track||v.requested||(v.requested=!0,this.addTransceiver(v.sender.track.kind))})}_createAnswer(){this.destroyed||this._pc.createAnswer(this.answerOptions).then(v=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(v.sdp=c(v.sdp)),v.sdp=this.sdpTransform(v.sdp);const M=()=>{if(!this.destroyed){const y=this._pc.localDescription||v;this._debug("signal"),this.emit("signal",{type:y.type,sdp:y.sdp}),this.initiator||this._requestMissingTransceivers()}};this._pc.setLocalDescription(v).then(()=>{this.destroyed||(this.trickle||this._iceComplete?M():this.once("_iceComplete",M))}).catch(y=>{this.destroy(h(y,"ERR_SET_LOCAL_DESCRIPTION"))})}).catch(v=>{this.destroy(h(v,"ERR_CREATE_ANSWER"))})}_onConnectionStateChange(){this.destroyed||this._pc.connectionState==="failed"&&this.destroy(h(new Error("Connection failed."),"ERR_CONNECTION_FAILURE"))}_onIceStateChange(){if(this.destroyed)return;const v=this._pc.iceConnectionState,M=this._pc.iceGatheringState;this._debug("iceStateChange (connection: %s) (gathering: %s)",v,M),this.emit("iceStateChange",v,M),(v==="connected"||v==="completed")&&(this._pcReady=!0,this._maybeReady()),v==="failed"&&this.destroy(h(new Error("Ice connection failed."),"ERR_ICE_CONNECTION_FAILURE")),v==="closed"&&this.destroy(h(new Error("Ice connection closed."),"ERR_ICE_CONNECTION_CLOSED"))}getStats(v){const M=y=>(Object.prototype.toString.call(y.values)==="[object Array]"&&y.values.forEach(k=>{Object.assign(y,k)}),y);this._pc.getStats.length===0||this._isReactNativeWebrtc?this._pc.getStats().then(y=>{const k=[];y.forEach(S=>{k.push(M(S))}),v(null,k)},y=>v(y)):0{if(this.destroyed)return;const k=[];y.result().forEach(S=>{const C={};S.names().forEach(R=>{C[R]=S.stat(R)}),C.id=S.id,C.type=S.type,C.timestamp=S.timestamp,k.push(M(C))}),v(null,k)},y=>v(y)):v(null,[])}_maybeReady(){if(this._debug("maybeReady pc %s channel %s",this._pcReady,this._channelReady),this._connected||this._connecting||!this._pcReady||!this._channelReady)return;this._connecting=!0;const v=()=>{this.destroyed||this.getStats((M,y)=>{if(this.destroyed)return;M&&(y=[]);const k={},S={},C={};let R=!1;y.forEach(E=>{(E.type==="remotecandidate"||E.type==="remote-candidate")&&(k[E.id]=E),(E.type==="localcandidate"||E.type==="local-candidate")&&(S[E.id]=E),(E.type==="candidatepair"||E.type==="candidate-pair")&&(C[E.id]=E)});const T=E=>{R=!0;let B=S[E.localCandidateId];B&&(B.ip||B.address)?(this.localAddress=B.ip||B.address,this.localPort=+B.port):B&&B.ipAddress?(this.localAddress=B.ipAddress,this.localPort=+B.portNumber):typeof E.googLocalAddress=="string"&&(B=E.googLocalAddress.split(":"),this.localAddress=B[0],this.localPort=+B[1]),this.localAddress&&(this.localFamily=this.localAddress.includes(":")?"IPv6":"IPv4");let N=k[E.remoteCandidateId];N&&(N.ip||N.address)?(this.remoteAddress=N.ip||N.address,this.remotePort=+N.port):N&&N.ipAddress?(this.remoteAddress=N.ipAddress,this.remotePort=+N.portNumber):typeof E.googRemoteAddress=="string"&&(N=E.googRemoteAddress.split(":"),this.remoteAddress=N[0],this.remotePort=+N[1]),this.remoteAddress&&(this.remoteFamily=this.remoteAddress.includes(":")?"IPv6":"IPv4"),this._debug("connect local: %s:%s remote: %s:%s",this.localAddress,this.localPort,this.remoteAddress,this.remotePort)};if(y.forEach(E=>{E.type==="transport"&&E.selectedCandidatePairId&&T(C[E.selectedCandidatePairId]),(E.type==="googCandidatePair"&&E.googActiveConnection==="true"||(E.type==="candidatepair"||E.type==="candidate-pair")&&E.selected)&&T(E)}),!R&&(!Object.keys(C).length||Object.keys(S).length))return void setTimeout(v,100);if(this._connecting=!1,this._connected=!0,this._chunk){try{this.send(this._chunk)}catch(B){return this.destroy(h(B,"ERR_DATA_CHANNEL"))}this._chunk=null,this._debug('sent chunk from "write before connect"');const E=this._cb;this._cb=null,E(null)}typeof this._channel.bufferedAmountLowThreshold!="number"&&(this._interval=setInterval(()=>this._onInterval(),150),this._interval.unref&&this._interval.unref()),this._debug("connect"),this.emit("connect")})};v()}_onInterval(){this._cb&&this._channel&&!(this._channel.bufferedAmount>z)&&this._onChannelBufferedAmountLow()}_onSignalingStateChange(){this.destroyed||(this._pc.signalingState==="stable"&&(this._isNegotiating=!1,this._debug("flushing sender queue",this._sendersAwaitingStable),this._sendersAwaitingStable.forEach(v=>{this._pc.removeTrack(v),this._queuedNegotiation=!0}),this._sendersAwaitingStable=[],this._queuedNegotiation?(this._debug("flushing negotiation queue"),this._queuedNegotiation=!1,this._needsNegotiation()):(this._debug("negotiated"),this.emit("negotiated"))),this._debug("signalingStateChange %s",this._pc.signalingState),this.emit("signalingStateChange",this._pc.signalingState))}_onIceCandidate(v){this.destroyed||(v.candidate&&this.trickle?this.emit("signal",{type:"candidate",candidate:{candidate:v.candidate.candidate,sdpMLineIndex:v.candidate.sdpMLineIndex,sdpMid:v.candidate.sdpMid}}):!v.candidate&&!this._iceComplete&&(this._iceComplete=!0,this.emit("_iceComplete")),v.candidate&&this._startIceCompleteTimeout())}_onChannelMessage(v){if(this.destroyed)return;let M=v.data;M instanceof ArrayBuffer&&(M=g.from(M)),this.push(M)}_onChannelBufferedAmountLow(){if(!this.destroyed&&this._cb){this._debug("ending backpressure: bufferedAmount %d",this._channel.bufferedAmount);const v=this._cb;this._cb=null,v(null)}}_onChannelOpen(){this._connected||this.destroyed||(this._debug("on channel open"),this._channelReady=!0,this._maybeReady())}_onChannelClose(){this.destroyed||(this._debug("on channel close"),this.destroy())}_onTrack(v){this.destroyed||v.streams.forEach(M=>{this._debug("on track"),this.emit("track",v.track,M),this._remoteTracks.push({track:v.track,stream:M}),this._remoteStreams.some(y=>y.id===M.id)||(this._remoteStreams.push(M),b(()=>{this._debug("on stream"),this.emit("stream",M)}))})}_debug(){const v=[].slice.call(arguments);v[0]="["+this._id+"] "+v[0],u.apply(null,v)}}A.WEBRTC_SUPPORT=!!d(),A.config={iceServers:[{urls:["stun:stun.l.google.com:19302","stun:global.stun.twilio.com:3478"]}],sdpSemantics:"unified-plan"},A.channelConfig={},i.exports=A},{buffer:3,debug:4,"err-code":6,"get-browser-rtc":8,"queue-microtask":13,randombytes:14,"readable-stream":29}]},{},[])("/")})}(DS)),DS.exports}var ANe=yNe();const vNe=Zr(ANe),CB=0,qB=1,Ese=2,Wse=(e,t)=>{sn(e,CB);const n=G8e(t);jr(e,n)},Nse=(e,t,n)=>{sn(e,qB),jr(e,OB(t,n))},xNe=(e,t,n)=>Nse(t,n,w0(e)),Bse=(e,t,n)=>{try{J1e(t,w0(e),n)}catch(o){console.error("Caught error while handling a Yjs update",o)}},wNe=(e,t)=>{sn(e,Ese),jr(e,t)},_Ne=Bse,kNe=(e,t,n,o)=>{const r=_n(e);switch(r){case CB:xNe(e,t,n);break;case qB:Bse(e,n,o);break;case Ese:_Ne(e,n,o);break;default:throw new Error("Unknown message type")}return r},FS=3e4;class SNe extends d3{constructor(t){super(),this.doc=t,this.clientID=t.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{const n=Tl();this.getLocalState()!==null&&FS/2<=n-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const o=[];this.meta.forEach((r,s)=>{s!==this.clientID&&FS<=n-r.lastUpdated&&this.states.has(s)&&o.push(s)}),o.length>0&&IE(this,o,"timeout")},Oc(FS/10)),t.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(t){const n=this.clientID,o=this.meta.get(n),r=o===void 0?0:o.clock+1,s=this.states.get(n);t===null?this.states.delete(n):this.states.set(n,t),this.meta.set(n,{clock:r,lastUpdated:Tl()});const i=[],c=[],l=[],u=[];t===null?u.push(n):s==null?t!=null&&i.push(n):(c.push(n),yM(s,t)||l.push(n)),(i.length>0||l.length>0||u.length>0)&&this.emit("change",[{added:i,updated:l,removed:u},"local"]),this.emit("update",[{added:i,updated:c,removed:u},"local"])}setLocalStateField(t,n){const o=this.getLocalState();o!==null&&this.setLocalState({...o,[t]:n})}getStates(){return this.states}}const IE=(e,t,n)=>{const o=[];for(let r=0;r0&&(e.emit("change",[{added:[],updated:[],removed:o},n]),e.emit("update",[{added:[],updated:[],removed:o},n]))},F4=(e,t,n=e.states)=>{const o=t.length,r=k0();sn(r,o);for(let s=0;s{const o=Rc(t),r=Tl(),s=[],i=[],c=[],l=[],u=_n(o);for(let d=0;d0||c.length>0||l.length>0)&&e.emit("change",[{added:s,updated:c,removed:l},n]),(s.length>0||i.length>0||l.length>0)&&e.emit("update",[{added:s,updated:i,removed:l},n])},qNe=(e,t)=>{const n=CE(e).buffer,o=CE(t).buffer;return crypto.subtle.importKey("raw",n,"PBKDF2",!1,["deriveKey"]).then(r=>crypto.subtle.deriveKey({name:"PBKDF2",salt:o,iterations:1e5,hash:"SHA-256"},r,{name:"AES-GCM",length:256},!0,["encrypt","decrypt"]))},Lse=(e,t)=>{if(!t)return uB(e);const n=crypto.getRandomValues(new Uint8Array(12));return crypto.subtle.encrypt({name:"AES-GCM",iv:n},t,e).then(o=>{const r=k0();return uc(r,"AES-GCM"),jr(r,n),jr(r,new Uint8Array(o)),Sr(r)})},RNe=(e,t)=>{const n=k0();return th(n,e),Lse(Sr(n),t)},Pse=(e,t)=>{if(!t)return uB(e);const n=Rc(e);yl(n)!=="AES-GCM"&&DEe(fa("Unknown encryption algorithm"));const r=w0(n),s=w0(n);return crypto.subtle.decrypt({name:"AES-GCM",iv:r},t,s).then(i=>new Uint8Array(i))},jse=(e,t)=>Pse(e,t).then(n=>nh(Rc(new Uint8Array(n)))),R0=R8e("y-webrtc"),T2=0,Ise=3,ZM=1,RB=4,QM=new Map,pc=new Map,Dse=e=>{let t=!0;e.webrtcConns.forEach(n=>{n.synced||(t=!1)}),(!t&&e.synced||t&&!e.synced)&&(e.synced=t,e.provider.emit("synced",[{synced:t}]),R0("synced ",ki,e.name,bf," with all peers"))},Fse=(e,t,n)=>{const o=Rc(t),r=k0(),s=_n(o);if(e===void 0)return null;const i=e.awareness,c=e.doc;let l=!1;switch(s){case T2:{sn(r,T2);const u=kNe(o,r,c,e);u===qB&&!e.synced&&n(),u===CB&&(l=!0);break}case Ise:sn(r,ZM),jr(r,F4(i,Array.from(i.getStates().keys()))),l=!0;break;case ZM:CNe(i,w0(o),e);break;case RB:{const u=ff(o)===1,d=yl(o);if(d!==e.peerId&&(e.bcConns.has(d)&&!u||!e.bcConns.has(d)&&u)){const p=[],f=[];u?(e.bcConns.add(d),f.push(d)):(e.bcConns.delete(d),p.push(d)),e.provider.emit("peers",[{added:f,removed:p,webrtcPeers:Array.from(e.webrtcConns.keys()),bcPeers:Array.from(e.bcConns)}]),$se(e)}break}default:return console.error("Unable to compute message"),r}return l?r:null},TNe=(e,t)=>{const n=e.room;return R0("received message from ",ki,e.remotePeerId,hB," (",n.name,")",bf,D5),Fse(n,t,()=>{e.synced=!0,R0("synced ",ki,n.name,bf," with ",ki,e.remotePeerId),Dse(n)})},$S=(e,t)=>{R0("send message to ",ki,e.remotePeerId,bf,hB," (",e.room.name,")",D5);try{e.peer.send(Sr(t))}catch{}},ENe=(e,t)=>{R0("broadcast message in ",ki,e.name,bf),e.webrtcConns.forEach(n=>{try{n.peer.send(t)}catch{}})};class $4{constructor(t,n,o,r){R0("establishing connection to ",ki,o),this.room=r,this.remotePeerId=o,this.glareToken=void 0,this.closed=!1,this.connected=!1,this.synced=!1,this.peer=new vNe({initiator:n,...r.provider.peerOpts}),this.peer.on("signal",s=>{this.glareToken===void 0&&(this.glareToken=Date.now()+Math.random()),U5(t,r,{to:o,from:r.peerId,type:"signal",token:this.glareToken,signal:s})}),this.peer.on("connect",()=>{R0("connected to ",ki,o),this.connected=!0;const i=r.provider.doc,c=r.awareness,l=k0();sn(l,T2),Wse(l,i),$S(this,l);const u=c.getStates();if(u.size>0){const d=k0();sn(d,ZM),jr(d,F4(c,Array.from(u.keys()))),$S(this,d)}}),this.peer.on("close",()=>{this.connected=!1,this.closed=!0,r.webrtcConns.has(this.remotePeerId)&&(r.webrtcConns.delete(this.remotePeerId),r.provider.emit("peers",[{removed:[this.remotePeerId],added:[],webrtcPeers:Array.from(r.webrtcConns.keys()),bcPeers:Array.from(r.bcConns)}])),Dse(r),this.peer.destroy(),R0("closed connection to ",ki,o),DE(r)}),this.peer.on("error",s=>{R0("Error in connection to ",ki,o,": ",s),DE(r)}),this.peer.on("data",s=>{const i=TNe(this,s);i!==null&&$S(this,i)})}destroy(){this.peer.destroy()}}const Du=(e,t)=>Lse(t,e.key).then(n=>e.mux(()=>zNe(e.name,n))),LU=(e,t)=>{e.bcconnected&&Du(e,t),ENe(e,t)},DE=e=>{QM.forEach(t=>{t.connected&&(t.send({type:"subscribe",topics:[e.name]}),e.webrtcConns.size{if(e.provider.filterBcConns){const t=k0();sn(t,RB),UM(t,1),uc(t,e.peerId),Du(e,Sr(t))}};class WNe{constructor(t,n,o,r){this.peerId=O1e(),this.doc=t,this.awareness=n.awareness,this.provider=n,this.synced=!1,this.name=o,this.key=r,this.webrtcConns=new Map,this.bcConns=new Set,this.mux=ONe(),this.bcconnected=!1,this._bcSubscriber=s=>Pse(new Uint8Array(s),r).then(i=>this.mux(()=>{const c=Fse(this,i,()=>{});c&&Du(this,Sr(c))})),this._docUpdateHandler=(s,i)=>{const c=k0();sn(c,T2),wNe(c,s),LU(this,Sr(c))},this._awarenessUpdateHandler=({added:s,updated:i,removed:c},l)=>{const u=s.concat(i).concat(c),d=k0();sn(d,ZM),jr(d,F4(this.awareness,u)),LU(this,Sr(d))},this._beforeUnloadHandler=()=>{IE(this.awareness,[t.clientID],"window unload"),pc.forEach(s=>{s.disconnect()})},typeof window<"u"?window.addEventListener("beforeunload",this._beforeUnloadHandler):typeof Oi<"u"&&Oi.on("exit",this._beforeUnloadHandler)}connect(){this.doc.on("update",this._docUpdateHandler),this.awareness.on("update",this._awarenessUpdateHandler),DE(this);const t=this.name;gNe(t,this._bcSubscriber),this.bcconnected=!0,$se(this);const n=k0();sn(n,T2),Wse(n,this.doc),Du(this,Sr(n));const o=k0();sn(o,T2),Nse(o,this.doc),Du(this,Sr(o));const r=k0();sn(r,Ise),Du(this,Sr(r));const s=k0();sn(s,ZM),jr(s,F4(this.awareness,[this.doc.clientID])),Du(this,Sr(s))}disconnect(){QM.forEach(n=>{n.connected&&n.send({type:"unsubscribe",topics:[this.name]})}),IE(this.awareness,[this.doc.clientID],"disconnect");const t=k0();sn(t,RB),UM(t,0),uc(t,this.peerId),Du(this,Sr(t)),MNe(this.name,this._bcSubscriber),this.bcconnected=!1,this.doc.off("update",this._docUpdateHandler),this.awareness.off("update",this._awarenessUpdateHandler),this.webrtcConns.forEach(n=>n.destroy())}destroy(){this.disconnect(),typeof window<"u"?window.removeEventListener("beforeunload",this._beforeUnloadHandler):typeof Oi<"u"&&Oi.off("exit",this._beforeUnloadHandler)}}const NNe=(e,t,n,o)=>{if(pc.has(n))throw fa(`A Yjs Doc connected to room "${n}" already exists!`);const r=new WNe(e,t,n,o);return pc.set(n,r),r},U5=(e,t,n)=>{t.key?RNe(n,t.key).then(o=>{e.send({type:"publish",topic:t.name,data:B1e(o)})}):e.send({type:"publish",topic:t.name,data:n})};class Vse extends bNe{constructor(t){super(t),this.providers=new Set,this.on("connect",()=>{R0(`connected (${t})`);const n=Array.from(pc.keys());this.send({type:"subscribe",topics:n}),pc.forEach(o=>U5(this,o,{type:"announce",from:o.peerId}))}),this.on("message",n=>{switch(n.type){case"publish":{const o=n.topic,r=pc.get(o);if(r==null||typeof o!="string")return;const s=i=>{const c=r.webrtcConns,l=r.peerId;if(i==null||i.from===l||i.to!==void 0&&i.to!==l||r.bcConns.has(i.from))return;const u=c.has(i.from)?()=>{}:()=>r.provider.emit("peers",[{removed:[],added:[i.from],webrtcPeers:Array.from(r.webrtcConns.keys()),bcPeers:Array.from(r.bcConns)}]);switch(i.type){case"announce":c.sizenew $4(this,!0,i.from,r)),u());break;case"signal":if(i.signal.type==="offer"){const d=c.get(i.from);if(d){const p=i.token,f=d.glareToken;if(f&&f>p){R0("offer rejected: ",i.from);return}d.glareToken=void 0}}if(i.signal.type==="answer"){R0("offer answered by: ",i.from);const d=c.get(i.from);d.glareToken=void 0}i.to===l&&(_1(c,i.from,()=>new $4(this,!1,i.from,r)).peer.signal(i.signal),u());break}};r.key?typeof n.data=="string"&&jse(bB(n.data),r.key).then(s):s(n.data)}}}),this.on("disconnect",()=>R0(`disconnect (${t})`))}}class BNe extends d3{constructor(t,n,{signaling:o=["wss://y-webrtc-eu.fly.dev"],password:r=null,awareness:s=new SNe(n),maxConns:i=20+Oc(jEe()*15),filterBcConns:c=!0,peerOpts:l={}}={}){super(),this.roomName=t,this.doc=n,this.filterBcConns=c,this.awareness=s,this.shouldConnect=!1,this.signalingUrls=o,this.signalingConns=[],this.maxConns=i,this.peerOpts=l,this.key=r?qNe(r,t):uB(null),this.room=null,this.key.then(u=>{this.room=NNe(n,this,t,u),this.shouldConnect?this.room.connect():this.room.disconnect()}),this.connect(),this.destroy=this.destroy.bind(this),n.on("destroy",this.destroy)}get connected(){return this.room!==null&&this.shouldConnect}connect(){this.shouldConnect=!0,this.signalingUrls.forEach(t=>{const n=_1(QM,t,()=>new Vse(t));this.signalingConns.push(n),n.providers.add(this)}),this.room&&this.room.connect()}disconnect(){this.shouldConnect=!1,this.signalingConns.forEach(t=>{t.providers.delete(this),t.providers.size===0&&(t.destroy(),QM.delete(t.url))}),this.room&&this.room.disconnect()}destroy(){this.doc.off("destroy",this.destroy),this.key.then(()=>{this.room.destroy(),pc.delete(this.roomName)}),super.destroy()}}function LNe(e,t){e.on("connect",()=>{R0(`connected (${t})`);const n=Array.from(pc.keys());e.send({type:"subscribe",topics:n}),pc.forEach(o=>U5(e,o,{type:"announce",from:o.peerId}))}),e.on("message",n=>{switch(n.type){case"publish":{const o=n.topic,r=pc.get(o);if(r===null||typeof o!="string"||r===void 0)return;const s=i=>{const c=r.webrtcConns,l=r.peerId;if(i===null||i.from===l||i.to!==void 0&&i.to!==l||r.bcConns.has(i.from))return;const u=c.has(i.from)?()=>{}:()=>r.provider.emit("peers",[{removed:[],added:[i.from],webrtcPeers:Array.from(r.webrtcConns.keys()),bcPeers:Array.from(r.bcConns)}]);switch(i.type){case"announce":c.sizenew $4(e,!0,i.from,r)),u());break;case"signal":if(i.signal.type==="offer"){const d=c.get(i.from);if(d){const p=i.token,f=d.glareToken;if(f&&f>p){R0("offer rejected: ",i.from);return}d.glareToken=void 0}}if(i.signal.type==="answer"){R0("offer answered by: ",i.from);const d=c.get(i.from);d&&(d.glareToken=void 0)}i.to===l&&(_1(c,i.from,()=>new $4(e,!1,i.from,r)).peer.signal(i.signal),u());break}};r.key?typeof n.data=="string"&&jse(bB(n.data),r.key).then(s):s(n.data)}}}),e.on("disconnect",()=>R0(`disconnect (${t})`))}function PU(e){if(e.shouldConnect&&e.ws===null){const t=Math.floor(1e5+Math.random()*9e5),n=e.url,o=new window.EventSource(tn(n,{subscriber_id:t,action:"gutenberg_signaling_server"}));let r=null;o.onmessage=l=>{e.lastMessageReceived=Date.now();const u=l.data;if(u){const d=JSON.parse(u);Array.isArray(d)&&d.forEach(s)}},e.ws=o,e.connecting=!0,e.connected=!1;const s=l=>{l&&l.type==="pong"&&(clearTimeout(r),r=setTimeout(c,V4/2)),e.emit("message",[l,e])},i=l=>{e.ws!==null&&(e.ws.close(),e.ws=null,e.connecting=!1,e.connected?(e.connected=!1,e.emit("disconnect",[{type:"disconnect",error:l},e])):e.unsuccessfulReconnects++),clearTimeout(r)},c=()=>{e.ws&&e.ws.readyState===window.EventSource.OPEN&&e.send({type:"ping"})};e.ws&&(e.ws.onclose=()=>{i(null)},e.ws.send=function(u){window.fetch(n,{body:new URLSearchParams({subscriber_id:t.toString(),action:"gutenberg_signaling_server",message:u}),method:"POST"}).catch(()=>{R0("Error sending to server with message: "+u)})}),o.onerror=()=>{},o.onopen=()=>{e.connected||o.readyState===window.EventSource.OPEN&&(e.lastMessageReceived=Date.now(),e.connecting=!1,e.connected=!0,e.unsuccessfulReconnects=0,e.emit("connect",[{type:"connect"},e]),r=setTimeout(c,V4/2))}}}const V4=3e4;class PNe extends d3{constructor(t){super(),this.url=t,this.ws=null,this.binaryType=null,this.connected=!1,this.connecting=!1,this.unsuccessfulReconnects=0,this.lastMessageReceived=0,this.shouldConnect=!0,this._checkInterval=setInterval(()=>{this.connected&&V4{const n=_1(QM,t,t.startsWith("ws://")||t.startsWith("wss://")?()=>new Vse(t):()=>new PNe(t));this.signalingConns.push(n),n.providers.add(this)}),this.room&&this.room.connect()}}function INe({signaling:e,password:t}){return function(n,o,r){const s=`${o}-${n}`;return new jNe(s,r,{signaling:e,password:t}),Promise.resolve(()=>!0)}}const DNe=(e,t)=>{const n={},o={},r={};function s(u,d){n[u]=d}async function i(u,d,p){const f=new $h;r[u]=r[u]||{},r[u][d]=f;const b=()=>{const z=n[u].fromCRDTDoc(f);p(z)};f.on("update",b);const h=await e(d,u,f);t&&await t(d,u,f);const g=n[u].fetch;g&&g(d).then(z=>{f.transact(()=>{n[u].applyChangesToDoc(f,z)})}),o[u]=o[u]||{},o[u][d]=()=>{h(),f.off("update",b)}}async function c(u,d,p){const f=r[u][d];if(!f)throw"Error doc "+u+" "+d+" not found";f.transact(()=>{n[u].applyChangesToDoc(f,p)})}async function l(u,d){o?.[u]?.[d]&&o[u][d]()}return{register:s,bootstrap:i,update:c,discard:l}};let VS;function FE(){return VS||(VS=DNe(dNe,INe({signaling:[window?.wp?.ajax?.settings?.url],password:window?.__experimentalCollaborativeEditingSecret}))),VS}function FNe(e,t){return{type:"RECEIVE_USER_QUERY",users:Array.isArray(t)?t:[t],queryID:e}}function $Ne(e){return{type:"RECEIVE_CURRENT_USER",currentUser:e}}function VNe(e){return{type:"ADD_ENTITIES",entities:e}}function HNe(e,t,n,o,r=!1,s,i){e==="postType"&&(n=(Array.isArray(n)?n:[n]).map(l=>l.status==="auto-draft"?{...l,title:""}:l));let c;return o?c=lqe(n,o,s,i):c=I0e(n,s,i),{...c,kind:e,name:t,invalidateCache:r}}function UNe(e){return{type:"RECEIVE_CURRENT_THEME",currentTheme:e}}function XNe(e){return{type:"RECEIVE_CURRENT_GLOBAL_STYLES_ID",id:e}}function GNe(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLES",stylesheet:e,globalStyles:t}}function KNe(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS",stylesheet:e,variations:t}}function YNe(){return Ke("wp.data.dispatch( 'core' ).receiveThemeSupports",{since:"5.9"}),{type:"DO_NOTHING"}}function ZNe(e,t){return Ke("wp.data.dispatch( 'core' ).receiveThemeGlobalStyleRevisions()",{since:"6.5.0",alternative:"wp.data.dispatch( 'core' ).receiveRevisions"}),{type:"RECEIVE_THEME_GLOBAL_STYLE_REVISIONS",currentId:e,revisions:t}}function QNe(e,t){return{type:"RECEIVE_EMBED_PREVIEW",url:e,preview:t}}const Hse=(e,t,n,o,{__unstableFetch:r=Tt,throwOnError:s=!1}={})=>async({dispatch:i,resolveSelect:c})=>{const u=(await c.getEntitiesConfig(e)).find(b=>b.kind===e&&b.name===t);let d,p=!1;if(!u)return;const f=await i.__unstableAcquireStoreLock(No,["entities","records",e,t,n],{exclusive:!0});try{i({type:"DELETE_ENTITY_RECORD_START",kind:e,name:t,recordId:n});let b=!1;try{let h=`${u.baseURL}/${n}`;o&&(h=tn(h,o)),p=await r({path:h,method:"DELETE"}),await i(cqe(e,t,n,!0))}catch(h){b=!0,d=h}if(i({type:"DELETE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:n,error:d}),b&&s)throw d;return p}finally{i.__unstableReleaseStoreLock(f)}},JNe=(e,t,n,o,r={})=>({select:s,dispatch:i})=>{const c=s.getEntityConfig(e,t);if(!c)throw new Error(`The entity being edited (${e}, ${t}) does not have a loaded config.`);const{mergedEdits:l={}}=c,u=s.getRawEntityRecord(e,t,n),d=s.getEditedEntityRecord(e,t,n),p={kind:e,name:t,recordId:n,edits:Object.keys(o).reduce((f,b)=>{const h=u[b],g=d[b],z=l[b]?{...g,...o[b]}:o[b];return f[b]=N0(h,z)?void 0:z,f},{})};if(window.__experimentalEnableSync&&c.syncConfig){if(globalThis.IS_GUTENBERG_PLUGIN){const f=c.getSyncObjectId(n);FE().update(c.syncObjectType+"--edit",f,p.edits)}}else r.undoIgnore||s.getUndoManager().addRecord([{id:{kind:e,name:t,recordId:n},changes:Object.keys(o).reduce((f,b)=>(f[b]={from:d[b],to:o[b]},f),{})}],r.isCached),i({type:"EDIT_ENTITY_RECORD",...p})},eBe=()=>({select:e,dispatch:t})=>{const n=e.getUndoManager().undo();n&&t({type:"UNDO",record:n})},tBe=()=>({select:e,dispatch:t})=>{const n=e.getUndoManager().redo();n&&t({type:"REDO",record:n})},nBe=()=>({select:e})=>{e.getUndoManager().addRecord()},Use=(e,t,n,{isAutosave:o=!1,__unstableFetch:r=Tt,throwOnError:s=!1}={})=>async({select:i,resolveSelect:c,dispatch:l})=>{const d=(await c.getEntitiesConfig(e)).find(h=>h.kind===e&&h.name===t);if(!d)return;const p=d.key||e1,f=n[p],b=await l.__unstableAcquireStoreLock(No,["entities","records",e,t,f||Is()],{exclusive:!0});try{for(const[A,_]of Object.entries(n))if(typeof _=="function"){const v=_(i.getEditedEntityRecord(e,t,f));l.editEntityRecord(e,t,f,{[A]:v},{undoIgnore:!0}),n[A]=v}l({type:"SAVE_ENTITY_RECORD_START",kind:e,name:t,recordId:f,isAutosave:o});let h,g,z=!1;try{const A=`${d.baseURL}${f?"/"+f:""}`,_=i.getRawEntityRecord(e,t,f);if(o){const v=i.getCurrentUser(),M=v?v.id:void 0,y=await c.getAutosave(_.type,_.id,M);let k={..._,...y,...n};if(k=Object.keys(k).reduce((S,C)=>(["title","excerpt","content","meta"].includes(C)&&(S[C]=k[C]),S),{status:k.status==="auto-draft"?"draft":void 0}),h=await r({path:`${A}/autosaves`,method:"POST",data:k}),_.id===h.id){let S={..._,...k,...h};S=Object.keys(S).reduce((C,R)=>(["title","excerpt","content"].includes(R)?C[R]=S[R]:R==="status"?C[R]=_.status==="auto-draft"&&S.status==="draft"?S.status:_.status:C[R]=_[R],C),{}),l.receiveEntityRecords(e,t,S,void 0,!0)}else l.receiveAutosaves(_.id,h)}else{let v=n;d.__unstablePrePersist&&(v={...v,...d.__unstablePrePersist(_,v)}),h=await r({path:A,method:f?"PUT":"POST",data:v}),l.receiveEntityRecords(e,t,h,void 0,!0,v)}}catch(A){z=!0,g=A}if(l({type:"SAVE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:f,error:g,isAutosave:o}),z&&s)throw g;return h}finally{l.__unstableReleaseStoreLock(b)}},oBe=e=>async({dispatch:t})=>{const n=nEe(),o={saveEntityRecord(i,c,l,u){return n.add(d=>t.saveEntityRecord(i,c,l,{...u,__unstableFetch:d}))},saveEditedEntityRecord(i,c,l,u){return n.add(d=>t.saveEditedEntityRecord(i,c,l,{...u,__unstableFetch:d}))},deleteEntityRecord(i,c,l,u,d){return n.add(p=>t.deleteEntityRecord(i,c,l,u,{...d,__unstableFetch:p}))}},r=e.map(i=>i(o)),[,...s]=await Promise.all([n.run(),...r]);return s},rBe=(e,t,n,o)=>async({select:r,dispatch:s,resolveSelect:i})=>{if(!r.hasEditsForEntityRecord(e,t,n))return;const l=(await i.getEntitiesConfig(e)).find(f=>f.kind===e&&f.name===t);if(!l)return;const u=l.key||e1,d=r.getEntityRecordNonTransientEdits(e,t,n),p={[u]:n,...d};return await s.saveEntityRecord(e,t,p,o)},sBe=(e,t,n,o,r)=>async({select:s,dispatch:i,resolveSelect:c})=>{if(!s.hasEditsForEntityRecord(e,t,n))return;const l=s.getEntityRecordNonTransientEdits(e,t,n),u={};for(const b of o)E5(u,b,iqe(l,b));const f=(await c.getEntitiesConfig(e)).find(b=>b.kind===e&&b.name===t)?.key||e1;return n&&(u[f]=n),await i.saveEntityRecord(e,t,u,r)};function iBe(e){return Ke("wp.data.dispatch( 'core' ).receiveUploadPermissions",{since:"5.9",alternative:"receiveUserPermission"}),Xse("create/media",e)}function Xse(e,t){return{type:"RECEIVE_USER_PERMISSION",key:e,isAllowed:t}}function aBe(e){return{type:"RECEIVE_USER_PERMISSIONS",permissions:e}}function cBe(e,t){return{type:"RECEIVE_AUTOSAVES",postId:e,autosaves:Array.isArray(t)?t:[t]}}function lBe(e){return{type:"RECEIVE_NAVIGATION_FALLBACK_ID",fallbackId:e}}function uBe(e,t){return{type:"RECEIVE_DEFAULT_TEMPLATE",query:e,templateId:t}}const dBe=(e,t,n,o,r,s=!1,i)=>async({dispatch:c,resolveSelect:l})=>{const d=(await l.getEntitiesConfig(e)).find(f=>f.kind===e&&f.name===t),p=d&&d?.revisionKey?d.revisionKey:e1;c({type:"RECEIVE_ITEM_REVISIONS",key:p,items:Array.isArray(o)?o:[o],recordKey:n,meta:i,query:r,kind:e,name:t,invalidateCache:s})},pBe=Object.freeze(Object.defineProperty({__proto__:null,__experimentalBatch:oBe,__experimentalReceiveCurrentGlobalStylesId:XNe,__experimentalReceiveThemeBaseGlobalStyles:GNe,__experimentalReceiveThemeGlobalStyleVariations:KNe,__experimentalSaveSpecifiedEntityEdits:sBe,__unstableCreateUndoLevel:nBe,addEntities:VNe,deleteEntityRecord:Hse,editEntityRecord:JNe,receiveAutosaves:cBe,receiveCurrentTheme:UNe,receiveCurrentUser:$Ne,receiveDefaultTemplateId:uBe,receiveEmbedPreview:QNe,receiveEntityRecords:HNe,receiveNavigationFallbackId:lBe,receiveRevisions:dBe,receiveThemeGlobalStyleRevisions:ZNe,receiveThemeSupports:YNe,receiveUploadPermissions:iBe,receiveUserPermission:Xse,receiveUserPermissions:aBe,receiveUserQuery:FNe,redo:tBe,saveEditedEntityRecord:rBe,saveEntityRecord:Use,undo:eBe},Symbol.toStringTag,{value:"Module"}));function fBe(e,t){return{type:"RECEIVE_REGISTERED_POST_META",postType:e,registeredPostMeta:t}}const bBe=Object.freeze(Object.defineProperty({__proto__:null,receiveRegisteredPostMeta:fBe},Symbol.toStringTag,{value:"Module"}));let $b;function Lt(e){if(typeof e!="string"||e.indexOf("&")===-1)return e;$b===void 0&&(document.implementation&&document.implementation.createHTMLDocument?$b=document.implementation.createHTMLDocument("").createElement("textarea"):$b=document.createElement("textarea")),$b.innerHTML=e;const t=$b.textContent;return $b.innerHTML="",t}async function hBe(e,t={},n={}){const o=t.isInitialSuggestions&&t.initialSuggestionsSearchOptions?{...t,...t.initialSuggestionsSearchOptions}:t,{type:r,subtype:s,page:i,perPage:c=t.isInitialSuggestions?3:20}=o,{disablePostFormats:l=!1}=n,u=[];(!r||r==="post")&&u.push(Tt({path:tn("/wp/v2/search",{search:e,page:i,per_page:c,type:"post",subtype:s})}).then(f=>f.map(b=>({id:b.id,url:b.url,title:Lt(b.title||"")||m("(no title)"),type:b.subtype||b.type,kind:"post-type"}))).catch(()=>[])),(!r||r==="term")&&u.push(Tt({path:tn("/wp/v2/search",{search:e,page:i,per_page:c,type:"term",subtype:s})}).then(f=>f.map(b=>({id:b.id,url:b.url,title:Lt(b.title||"")||m("(no title)"),type:b.subtype||b.type,kind:"taxonomy"}))).catch(()=>[])),!l&&(!r||r==="post-format")&&u.push(Tt({path:tn("/wp/v2/search",{search:e,page:i,per_page:c,type:"post-format",subtype:s})}).then(f=>f.map(b=>({id:b.id,url:b.url,title:Lt(b.title||"")||m("(no title)"),type:b.subtype||b.type,kind:"taxonomy"}))).catch(()=>[])),(!r||r==="attachment")&&u.push(Tt({path:tn("/wp/v2/media",{search:e,page:i,per_page:c})}).then(f=>f.map(b=>({id:b.id,url:b.source_url,title:Lt(b.title.rendered||"")||m("(no title)"),type:b.type,kind:"media"}))).catch(()=>[]));let p=(await Promise.all(u)).flat();return p=p.filter(f=>!!f.id),p=mBe(p,e),p=p.slice(0,c),p}function mBe(e,t){const n=jU(t),o={};for(const r of e)if(r.title){const s=jU(r.title),i=s.filter(d=>n.some(p=>d===p)),c=s.filter(d=>n.some(p=>d!==p&&d.includes(p))),l=i.length/s.length*10,u=c.length/s.length;o[r.id]=l+u}else o[r.id]=0;return e.sort((r,s)=>o[s.id]-o[r.id])}function jU(e){return e.toLowerCase().match(/[\p{L}\p{N}]+/gu)||[]}const HS=new Map,gBe=async(e,t={})=>{const n="/wp-block-editor/v1/url-details",o={url:jf(e)};if(!Pf(e))return Promise.reject(`${e} is not a valid URL.`);const r=O5(e);return!r||!TN(r)||!r.startsWith("http")||!/^https?:\/\/[^\/\s]/i.test(e)?Promise.reject(`${e} does not have a valid protocol. URLs must be "http" based`):HS.has(e)?HS.get(e):Tt({path:tn(n,o),...t}).then(s=>(HS.set(e,s),s))};async function MBe(){const e=await Tt({path:"/wp/v2/block-patterns/patterns"});return e?e.map(t=>Object.fromEntries(Object.entries(t).map(([n,o])=>[SN(n),o]))):[]}const zBe=e=>async({dispatch:t})=>{const n=tn("/wp/v2/users/?who=authors&per_page=100",e),o=await Tt({path:n});t.receiveUserQuery(n,o)},OBe=()=>async({dispatch:e})=>{const t=await Tt({path:"/wp/v2/users/me"});e.receiveCurrentUser(t)},Gse=(e,t,n="",o)=>async({select:r,dispatch:s,registry:i,resolveSelect:c})=>{const u=(await c.getEntitiesConfig(e)).find(p=>p.name===t&&p.kind===e);if(!u)return;const d=await s.__unstableAcquireStoreLock(No,["entities","records",e,t,n],{exclusive:!1});try{if(window.__experimentalEnableSync&&u.syncConfig&&!o){if(globalThis.IS_GUTENBERG_PLUGIN){const p=u.getSyncObjectId(n);await FE().bootstrap(u.syncObjectType,p,f=>{s.receiveEntityRecords(e,t,f,o)}),await FE().bootstrap(u.syncObjectType+"--edit",p,f=>{s({type:"EDIT_ENTITY_RECORD",kind:e,name:t,recordId:n,edits:f,meta:{undo:void 0}})})}}else{o!==void 0&&o._fields&&(o={...o,_fields:[...new Set([...Md(o._fields)||[],u.key||e1])].join()});const p=tn(u.baseURL+(n?"/"+n:""),{...u.baseURLParams,...o});if(o!==void 0&&o._fields&&(o={...o,include:[n]},r.hasEntityRecords(e,t,o)))return;const f=await Tt({path:p,parse:!1}),b=await f.json(),h=KN(f.headers?.get("allow")),g=[],z={};for(const A of zM)z[W5(A,{kind:e,name:t,id:n})]=h[A],g.push([A,{kind:e,name:t,id:n}]);i.batch(()=>{s.receiveEntityRecords(e,t,b,o),s.receiveUserPermissions(z),s.finishResolutions("canUser",g)})}}finally{s.__unstableReleaseStoreLock(d)}},yBe=GN("getEntityRecord"),ABe=GN("getEntityRecord"),H4=(e,t,n={})=>async({dispatch:o,registry:r,resolveSelect:s})=>{const c=(await s.getEntitiesConfig(e)).find(p=>p.name===t&&p.kind===e);if(!c)return;const l=await o.__unstableAcquireStoreLock(No,["entities","records",e,t],{exclusive:!1}),u=c.key||e1;function d(p){return p.filter(f=>f?.[u]).map(f=>[e,t,f[u]])}try{n._fields&&(n={...n,_fields:[...new Set([...Md(n._fields)||[],c.key||e1])].join()});const p=tn(c.baseURL,{...c.baseURLParams,...n});let f=[],b;if(c.supportsPagination&&n.per_page!==-1){const h=await Tt({path:p,parse:!1});f=Object.values(await h.json()),b={totalItems:parseInt(h.headers.get("X-WP-Total")),totalPages:parseInt(h.headers.get("X-WP-TotalPages"))}}else if(n.per_page===-1&&n[j0e]===!0){let h=1,g;do{const z=await Tt({path:tn(p,{page:h,per_page:100}),parse:!1}),A=Object.values(await z.json());g=parseInt(z.headers.get("X-WP-TotalPages")),f.push(...A),r.batch(()=>{o.receiveEntityRecords(e,t,f,n),o.finishResolutions("getEntityRecord",d(A))}),h++}while(h<=g);b={totalItems:f.length,totalPages:1}}else f=Object.values(await Tt({path:p})),b={totalItems:f.length,totalPages:1};n._fields&&(f=f.map(h=>(n._fields.split(",").forEach(g=>{h.hasOwnProperty(g)||(h[g]=void 0)}),h))),r.batch(()=>{if(o.receiveEntityRecords(e,t,f,n,!1,void 0,b),!n?._fields&&!n.context){const h=f.filter(A=>A?.[u]).map(A=>({id:A[u],permissions:KN(A?._links?.self?.[0].targetHints.allow)})),g=[],z={};for(const A of h)for(const _ of zM)g.push([_,{kind:e,name:t,id:A.id}]),z[W5(_,{kind:e,name:t,id:A.id})]=A.permissions[_];o.receiveUserPermissions(z),o.finishResolutions("getEntityRecord",d(f)),o.finishResolutions("canUser",g)}o.__unstableReleaseStoreLock(l)})}catch{o.__unstableReleaseStoreLock(l)}};H4.shouldInvalidate=(e,t,n)=>(e.type==="RECEIVE_ITEMS"||e.type==="REMOVE_ITEMS")&&e.invalidateCache&&t===e.kind&&n===e.name;const vBe=()=>async({dispatch:e,resolveSelect:t})=>{const n=await t.getEntityRecords("root","theme",{status:"active"});e.receiveCurrentTheme(n[0])},xBe=GN("getCurrentTheme"),wBe=e=>async({dispatch:t})=>{try{const n=await Tt({path:tn("/oembed/1.0/proxy",{url:e})});t.receiveEmbedPreview(e,n)}catch{t.receiveEmbedPreview(e,!1)}},Kse=(e,t,n)=>async({dispatch:o,registry:r,resolveSelect:s})=>{if(!zM.includes(e))throw new Error(`'${e}' is not a valid action.`);const{hasStartedResolution:i}=r.select(No);for(const d of zM){if(d===e)continue;if(i("canUser",[d,t,n]))return}let c=null;if(typeof t=="object"){if(!t.kind||!t.name)throw new Error("The entity resource object is not valid.");const p=(await s.getEntitiesConfig(t.kind)).find(f=>f.name===t.name&&f.kind===t.kind);if(!p)return;c=p.baseURL+(t.id?"/"+t.id:"")}else c=`/wp/v2/${t}`+(n?"/"+n:"");let l;try{l=await Tt({path:c,method:"OPTIONS",parse:!1})}catch{return}const u=KN(l.headers?.get("allow"));r.batch(()=>{for(const d of zM){const p=W5(d,t,n);o.receiveUserPermission(p,u[d]),d!==e&&o.finishResolution("canUser",[d,t,n])}})},_Be=(e,t,n)=>async({dispatch:o})=>{await o(Kse("update",{kind:e,name:t,id:n}))},kBe=(e,t)=>async({dispatch:n,resolveSelect:o})=>{const{rest_base:r,rest_namespace:s="wp/v2",supports:i}=await o.getPostType(e);if(!i?.autosave)return;const c=await Tt({path:`/${s}/${r}/${t}/autosaves?context=edit`});c&&c.length&&n.receiveAutosaves(t,c)},SBe=(e,t)=>async({resolveSelect:n})=>{await n.getAutosaves(e,t)},CBe=()=>async({dispatch:e,resolveSelect:t})=>{const o=(await t.getEntityRecords("root","theme",{status:"active"}))?.[0]?._links?.["wp:user-global-styles"]?.[0]?.href;if(!o)return;const r=o.match(/\/(\d+)(?:\?|$)/),s=r?Number(r[1]):null;s&&e.__experimentalReceiveCurrentGlobalStylesId(s)},qBe=()=>async({resolveSelect:e,dispatch:t})=>{const n=await e.getCurrentTheme(),o=await Tt({path:`/wp/v2/global-styles/themes/${n.stylesheet}?context=view`});t.__experimentalReceiveThemeBaseGlobalStyles(n.stylesheet,o)},RBe=()=>async({resolveSelect:e,dispatch:t})=>{const n=await e.getCurrentTheme(),o=await Tt({path:`/wp/v2/global-styles/themes/${n.stylesheet}/variations?context=view`});t.__experimentalReceiveThemeGlobalStyleVariations(n.stylesheet,o)},Yse=()=>async({resolveSelect:e,dispatch:t})=>{const n=await e.__experimentalGetCurrentGlobalStylesId(),r=(n?await e.getEntityRecord("root","globalStyles",n):void 0)?._links?.["version-history"]?.[0]?.href;if(r){const i=(await Tt({url:r}))?.map(c=>Object.fromEntries(Object.entries(c).map(([l,u])=>[SN(l),u])));t.receiveThemeGlobalStyleRevisions(n,i)}};Yse.shouldInvalidate=e=>e.type==="SAVE_ENTITY_RECORD_FINISH"&&e.kind==="root"&&!e.error&&e.name==="globalStyles";const TBe=()=>async({dispatch:e})=>{const t=await MBe();e({type:"RECEIVE_BLOCK_PATTERNS",patterns:t})},EBe=()=>async({dispatch:e})=>{const t=await Tt({path:"/wp/v2/block-patterns/categories"});e({type:"RECEIVE_BLOCK_PATTERN_CATEGORIES",categories:t})},WBe=()=>async({dispatch:e,resolveSelect:t})=>{const o=(await t.getEntityRecords("taxonomy","wp_pattern_category",{per_page:-1,_fields:"id,name,description,slug",context:"view"}))?.map(r=>({...r,label:Lt(r.name),name:r.slug}))||[];e({type:"RECEIVE_USER_PATTERN_CATEGORIES",patternCategories:o})},NBe=()=>async({dispatch:e,select:t,registry:n})=>{const o=await Tt({path:tn("/wp-block-editor/v1/navigation-fallback",{_embed:!0})}),r=o?._embedded?.self;n.batch(()=>{if(e.receiveNavigationFallbackId(o?.id),!r)return;const i=!t.getEntityRecord("postType","wp_navigation",o.id);e.receiveEntityRecords("postType","wp_navigation",r,void 0,i),e.finishResolution("getEntityRecord",["postType","wp_navigation",o.id])})},BBe=e=>async({dispatch:t,registry:n,resolveSelect:o})=>{const r=await Tt({path:tn("/wp/v2/templates/lookup",e)});await o.getEntitiesConfig("postType"),r?.id&&n.batch(()=>{t.receiveDefaultTemplateId(e,r.id),t.receiveEntityRecords("postType","wp_template",[r]),t.finishResolution("getEntityRecord",["postType","wp_template",r.id])})},Zse=(e,t,n,o={})=>async({dispatch:r,registry:s,resolveSelect:i})=>{const l=(await i.getEntitiesConfig(e)).find(h=>h.name===t&&h.kind===e);if(!l)return;o._fields&&(o={...o,_fields:[...new Set([...Md(o._fields)||[],l.revisionKey||e1])].join()});const u=tn(l.getRevisionsUrl(n),o);let d,p;const f={},b=l.supportsPagination&&o.per_page!==-1;try{p=await Tt({path:u,parse:!b})}catch{return}p&&(b?(d=Object.values(await p.json()),f.totalItems=parseInt(p.headers.get("X-WP-Total"))):d=Object.values(p),o._fields&&(d=d.map(h=>(o._fields.split(",").forEach(g=>{h.hasOwnProperty(g)||(h[g]=void 0)}),h))),s.batch(()=>{if(r.receiveRevisions(e,t,n,d,o,!1,f),!o?._fields&&!o.context){const h=l.key||e1,g=d.filter(z=>z[h]).map(z=>[e,t,n,z[h]]);r.finishResolutions("getRevision",g)}}))};Zse.shouldInvalidate=(e,t,n,o)=>e.type==="SAVE_ENTITY_RECORD_FINISH"&&n===e.name&&t===e.kind&&!e.error&&o===e.recordId;const LBe=(e,t,n,o,r)=>async({dispatch:s,resolveSelect:i})=>{const l=(await i.getEntitiesConfig(e)).find(p=>p.name===t&&p.kind===e);if(!l)return;r!==void 0&&r._fields&&(r={...r,_fields:[...new Set([...Md(r._fields)||[],l.revisionKey||e1])].join()});const u=tn(l.getRevisionsUrl(n,o),r);let d;try{d=await Tt({path:u})}catch{return}d&&s.receiveRevisions(e,t,n,d,r)},PBe=e=>async({dispatch:t,resolveSelect:n})=>{let o;try{const{rest_namespace:r="wp/v2",rest_base:s}=await n.getPostType(e)||{};o=await Tt({path:`${r}/${s}/?context=edit`,method:"OPTIONS"})}catch{return}o&&t.receiveRegisteredPostMeta(e,o?.schema?.properties?.meta?.properties)},jBe=e=>async({dispatch:t})=>{const n=n1e.find(o=>o.kind===e);if(n)try{const o=await n.loadEntities();if(!o.length)return;t.addEntities(o)}catch{}},IBe=Object.freeze(Object.defineProperty({__proto__:null,__experimentalGetCurrentGlobalStylesId:CBe,__experimentalGetCurrentThemeBaseGlobalStyles:qBe,__experimentalGetCurrentThemeGlobalStylesVariations:RBe,canUser:Kse,canUserEditEntityRecord:_Be,getAuthors:zBe,getAutosave:SBe,getAutosaves:kBe,getBlockPatternCategories:EBe,getBlockPatterns:TBe,getCurrentTheme:vBe,getCurrentThemeGlobalStylesRevisions:Yse,getCurrentUser:OBe,getDefaultTemplateId:BBe,getEditedEntityRecord:ABe,getEmbedPreview:wBe,getEntitiesConfig:jBe,getEntityRecord:Gse,getEntityRecords:H4,getNavigationFallbackId:NBe,getRawEntityRecord:yBe,getRegisteredPostMeta:PBe,getRevision:LBe,getRevisions:Zse,getThemeSupports:xBe,getUserPatternCategories:WBe},Symbol.toStringTag,{value:"Module"}));function IU(e,t){const n={...e};let o=n;for(const r of t)o.children={...o.children,[r]:{locks:[],children:{},...o.children[r]}},o=o.children[r];return n}function $E(e,t){let n=e;for(const o of t){const r=n.children[o];if(!r)return null;n=r}return n}function*DBe(e,t){let n=e;yield n;for(const o of t){const r=n.children[o];if(!r)break;yield r,n=r}}function*FBe(e){const t=Object.values(e.children);for(;t.length;){const n=t.pop();yield n,t.push(...Object.values(n.children))}}function DU({exclusive:e},t){return!!(e&&t.length||!e&&t.filter(n=>n.exclusive).length)}const $Be={requests:[],tree:{locks:[],children:{}}};function mA(e=$Be,t){switch(t.type){case"ENQUEUE_LOCK_REQUEST":{const{request:n}=t;return{...e,requests:[n,...e.requests]}}case"GRANT_LOCK_REQUEST":{const{lock:n,request:o}=t,{store:r,path:s}=o,i=[r,...s],c=IU(e.tree,i),l=$E(c,i);return l.locks=[...l.locks,n],{...e,requests:e.requests.filter(u=>u!==o),tree:c}}case"RELEASE_LOCK":{const{lock:n}=t,o=[n.store,...n.path],r=IU(e.tree,o),s=$E(r,o);return s.locks=s.locks.filter(i=>i!==n),{...e,tree:r}}}return e}function VBe(e){return e.requests}function HBe(e,t,n,{exclusive:o}){const r=[t,...n],s=e.tree;for(const c of DBe(s,r))if(DU({exclusive:o},c.locks))return!1;const i=$E(s,r);if(!i)return!0;for(const c of FBe(i))if(DU({exclusive:o},c.locks))return!1;return!0}function UBe(){let e=mA(void 0,{type:"@@INIT"});function t(){for(const r of VBe(e)){const{store:s,path:i,exclusive:c,notifyAcquired:l}=r;if(HBe(e,s,i,{exclusive:c})){const u={store:s,path:i,exclusive:c};e=mA(e,{type:"GRANT_LOCK_REQUEST",lock:u,request:r}),l(u)}}}function n(r,s,i){return new Promise(c=>{e=mA(e,{type:"ENQUEUE_LOCK_REQUEST",request:{store:r,path:s,exclusive:i,notifyAcquired:c}}),t()})}function o(r){e=mA(e,{type:"RELEASE_LOCK",lock:r}),t()}return{acquire:n,release:o}}function XBe(){const e=UBe();function t(o,r,{exclusive:s}){return()=>e.acquire(o,r,s)}function n(o){return()=>e.release(o)}return{__unstableAcquireStoreLock:t,__unstableReleaseStoreLock:n}}let GBe,KBe;const VE=x.createContext({});function HE({kind:e,type:t,id:n,children:o}){const r=x.useContext(VE),s=x.useMemo(()=>({...r,[e]:{...r?.[e],[t]:n}}),[r,e,t,n]);return a.jsx(VE.Provider,{value:s,children:o})}let is=function(e){return e.Idle="IDLE",e.Resolving="RESOLVING",e.Error="ERROR",e.Success="SUCCESS",e}({});const YBe=["getIsResolving","hasStartedResolution","hasFinishedResolution","isResolving","getCachedResolvers"];function TB(e,t){return G((n,o)=>e(s=>ZBe(n(s)),o),t)}const ZBe=Hs(e=>{const t={};for(const n in e)YBe.includes(n)||Object.defineProperty(t,n,{get:()=>(...o)=>{const r=e[n](...o),s=e.getResolutionState(n,o)?.status;let i;switch(s){case"resolving":i=is.Resolving;break;case"finished":i=is.Success;break;case"error":i=is.Error;break;case void 0:i=is.Idle;break}return{data:r,status:i,isResolving:i===is.Resolving,hasStarted:i!==is.Idle,hasResolved:i===is.Success||i===is.Error}}});return t}),FU={};function X5(e,t,n,o={enabled:!0}){const{editEntityRecord:r,saveEditedEntityRecord:s}=Oe(Me),i=x.useMemo(()=>({edit:(f,b={})=>r(e,t,n,f,b),save:(f={})=>s(e,t,n,{throwOnError:!0,...f})}),[r,e,t,n,s]),{editedRecord:c,hasEdits:l,edits:u}=G(f=>o.enabled?{editedRecord:f(Me).getEditedEntityRecord(e,t,n),hasEdits:f(Me).hasEditsForEntityRecord(e,t,n),edits:f(Me).getEntityRecordNonTransientEdits(e,t,n)}:{editedRecord:FU,hasEdits:!1,edits:FU},[e,t,n,o.enabled]),{data:d,...p}=TB(f=>o.enabled?f(Me).getEntityRecord(e,t,n):{data:null},[e,t,n,o.enabled]);return{record:d,editedRecord:c,hasEdits:l,edits:u,...p,...i}}const QBe=[];function Al(e,t,n={},o={enabled:!0}){const r=tn("",n),{data:s,...i}=TB(u=>o.enabled?u(Me).getEntityRecords(e,t,n):{data:QBe},[e,t,r,o.enabled]),{totalItems:c,totalPages:l}=G(u=>o.enabled?{totalItems:u(Me).getEntityRecordsTotalItems(e,t,n),totalPages:u(Me).getEntityRecordsTotalPages(e,t,n)}:{totalItems:null,totalPages:null},[e,t,r,o.enabled]);return{records:s,totalItems:c,totalPages:l,...i}}function JBe(e,t,n={},o={enabled:!0}){const r=G(d=>d(Me).getEntityConfig(e,t),[e,t]),{records:s,...i}=Al(e,t,n,o),c=x.useMemo(()=>{var d;return(d=s?.map(p=>{var f;return p[(f=r?.key)!==null&&f!==void 0?f:"id"]}))!==null&&d!==void 0?d:[]},[s,r?.key]),l=G(d=>{const{getEntityRecordsPermissions:p}=eh(d(Me));return p(e,t,c)},[c,e,t]);return{records:x.useMemo(()=>{var d;return(d=s?.map((p,f)=>({...p,permissions:l[f]})))!==null&&d!==void 0?d:[]},[s,l]),...i}}const $U=new Set;function eLe(){return globalThis.SCRIPT_DEBUG===!0}function zn(e){if(eLe()&&!$U.has(e)){console.warn(e);try{throw Error(e)}catch{}$U.add(e)}}function Qse(e,t){const n=typeof e=="object",o=n?JSON.stringify(e):e;return n&&typeof t<"u"&&globalThis.SCRIPT_DEBUG===!0&&zn("When 'resource' is an entity object, passing 'id' as a separate argument isn't supported."),TB(r=>{const s=n?!!e.id:!!t,{canUser:i}=r(Me),c=i("create",n?{kind:e.kind,name:e.name}:e);if(!s){const h=i("read",e),g=c.isResolving||h.isResolving,z=c.hasResolved&&h.hasResolved;let A=is.Idle;return g?A=is.Resolving:z&&(A=is.Success),{status:A,isResolving:g,hasResolved:z,canCreate:c.hasResolved&&c.data,canRead:h.hasResolved&&h.data}}const l=i("read",e,t),u=i("update",e,t),d=i("delete",e,t),p=l.isResolving||c.isResolving||u.isResolving||d.isResolving,f=l.hasResolved&&c.hasResolved&&u.hasResolved&&d.hasResolved;let b=is.Idle;return p?b=is.Resolving:f&&(b=is.Success),{status:b,isResolving:p,hasResolved:f,canRead:f&&l.data,canCreate:f&&c.data,canUpdate:f&&u.data,canDelete:f&&d.data}},[o,t])}var tLe={grad:.9,turn:360,rad:360/(2*Math.PI)},Zc=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},_0=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Si=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e>t?e:t},Jse=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},VU=function(e){return{r:Si(e.r,0,255),g:Si(e.g,0,255),b:Si(e.b,0,255),a:Si(e.a)}},US=function(e){return{r:_0(e.r),g:_0(e.g),b:_0(e.b),a:_0(e.a,3)}},nLe=/^#([0-9a-f]{3,8})$/i,gA=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},eie=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,s=Math.max(t,n,o),i=s-Math.min(t,n,o),c=i?s===t?(n-o)/i:s===n?2+(o-t)/i:4+(t-n)/i:0;return{h:60*(c<0?c+6:c),s:s?i/s*100:0,v:s/255*100,a:r}},tie=function(e){var t=e.h,n=e.s,o=e.v,r=e.a;t=t/360*6,n/=100,o/=100;var s=Math.floor(t),i=o*(1-n),c=o*(1-(t-s)*n),l=o*(1-(1-t+s)*n),u=s%6;return{r:255*[o,c,i,i,l,o][u],g:255*[l,o,o,c,i,i][u],b:255*[i,i,l,o,o,c][u],a:r}},HU=function(e){return{h:Jse(e.h),s:Si(e.s,0,100),l:Si(e.l,0,100),a:Si(e.a)}},UU=function(e){return{h:_0(e.h),s:_0(e.s),l:_0(e.l),a:_0(e.a,3)}},XU=function(e){return tie((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},AM=function(e){return{h:(t=eie(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},oLe=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,rLe=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,sLe=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,iLe=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,UE={string:[[function(e){var t=nLe.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:e.length===4?_0(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?_0(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=sLe.exec(e)||iLe.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:VU({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:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=oLe.exec(e)||rLe.exec(e);if(!t)return null;var n,o,r=HU({h:(n=t[1],o=t[2],o===void 0&&(o="deg"),Number(n)*(tLe[o]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return XU(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,r=e.a,s=r===void 0?1:r;return Zc(t)&&Zc(n)&&Zc(o)?VU({r:Number(t),g:Number(n),b:Number(o),a:Number(s)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,r=e.a,s=r===void 0?1:r;if(!Zc(t)||!Zc(n)||!Zc(o))return null;var i=HU({h:Number(t),s:Number(n),l:Number(o),a:Number(s)});return XU(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,s=r===void 0?1:r;if(!Zc(t)||!Zc(n)||!Zc(o))return null;var i=function(c){return{h:Jse(c.h),s:Si(c.s,0,100),v:Si(c.v,0,100),a:Si(c.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(s)});return tie(i)},"hsv"]]},GU=function(e,t){for(var n=0;n=.5},e.prototype.toHex=function(){return t=US(this.rgba),n=t.r,o=t.g,r=t.b,i=(s=t.a)<1?gA(_0(255*s)):"","#"+gA(n)+gA(o)+gA(r)+i;var t,n,o,r,s,i},e.prototype.toRgb=function(){return US(this.rgba)},e.prototype.toRgbString=function(){return t=US(this.rgba),n=t.r,o=t.g,r=t.b,(s=t.a)<1?"rgba("+n+", "+o+", "+r+", "+s+")":"rgb("+n+", "+o+", "+r+")";var t,n,o,r,s},e.prototype.toHsl=function(){return UU(AM(this.rgba))},e.prototype.toHslString=function(){return t=UU(AM(this.rgba)),n=t.h,o=t.s,r=t.l,(s=t.a)<1?"hsla("+n+", "+o+"%, "+r+"%, "+s+")":"hsl("+n+", "+o+"%, "+r+"%)";var t,n,o,r,s},e.prototype.toHsv=function(){return t=eie(this.rgba),{h:_0(t.h),s:_0(t.s),v:_0(t.v),a:_0(t.a,3)};var t},e.prototype.invert=function(){return an({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},e.prototype.saturate=function(t){return t===void 0&&(t=.1),an(XS(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),an(XS(this.rgba,-t))},e.prototype.grayscale=function(){return an(XS(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),an(KU(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),an(KU(this.rgba,-t))},e.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},e.prototype.alpha=function(t){return typeof t=="number"?an({r:(n=this.rgba).r,g:n.g,b:n.b,a:t}):_0(this.rgba.a,3);var n},e.prototype.hue=function(t){var n=AM(this.rgba);return typeof t=="number"?an({h:t,s:n.s,l:n.l,a:n.a}):_0(n.h)},e.prototype.isEqual=function(t){return this.toHex()===an(t).toHex()},e}(),an=function(e){return e instanceof XE?e:new XE(e)},YU=[],Xs=function(e){e.forEach(function(t){YU.indexOf(t)<0&&(t(XE,UE),YU.push(t))})};function Gs(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},o={};for(var r in n)o[n[r]]=r;var s={};e.prototype.toName=function(i){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var c,l,u=o[this.toHex()];if(u)return u;if(i?.closest){var d=this.toRgb(),p=1/0,f="black";if(!s.length)for(var b in n)s[b]=new e(n[b]).toRgb();for(var h in n){var g=(c=d,l=s[h],Math.pow(c.r-l.r,2)+Math.pow(c.g-l.g,2)+Math.pow(c.b-l.b,2));gl?(c+.05)/(l+.05):(l+.05)/(c+.05),(o=2)===void 0&&(o=0),r===void 0&&(r=Math.pow(10,o)),Math.floor(r*n)/r+0},e.prototype.isReadable=function(t,n){return t===void 0&&(t="#FFF"),n===void 0&&(n={}),this.contrast(t)>=(c=(i=(o=n).size)===void 0?"normal":i,(s=(r=o.level)===void 0?"AA":r)==="AAA"&&c==="normal"?7:s==="AA"&&c==="large"?3:4.5);var o,r,s,i,c}}const nie="block-default",GE=["attributes","supports","save","migrate","isEligible","apiVersion"],Pp={"--wp--style--color--link":{value:["color","link"],support:["color","link"]},aspectRatio:{value:["dimensions","aspectRatio"],support:["dimensions","aspectRatio"],useEngine:!0},background:{value:["color","gradient"],support:["color","gradients"],useEngine:!0},backgroundColor:{value:["color","background"],support:["color","background"],requiresOptOut:!0,useEngine:!0},backgroundImage:{value:["background","backgroundImage"],support:["background","backgroundImage"],useEngine:!0},backgroundRepeat:{value:["background","backgroundRepeat"],support:["background","backgroundRepeat"],useEngine:!0},backgroundSize:{value:["background","backgroundSize"],support:["background","backgroundSize"],useEngine:!0},backgroundPosition:{value:["background","backgroundPosition"],support:["background","backgroundPosition"],useEngine:!0},borderColor:{value:["border","color"],support:["__experimentalBorder","color"],useEngine:!0},borderRadius:{value:["border","radius"],support:["__experimentalBorder","radius"],properties:{borderTopLeftRadius:"topLeft",borderTopRightRadius:"topRight",borderBottomLeftRadius:"bottomLeft",borderBottomRightRadius:"bottomRight"},useEngine:!0},borderStyle:{value:["border","style"],support:["__experimentalBorder","style"],useEngine:!0},borderWidth:{value:["border","width"],support:["__experimentalBorder","width"],useEngine:!0},borderTopColor:{value:["border","top","color"],support:["__experimentalBorder","color"],useEngine:!0},borderTopStyle:{value:["border","top","style"],support:["__experimentalBorder","style"],useEngine:!0},borderTopWidth:{value:["border","top","width"],support:["__experimentalBorder","width"],useEngine:!0},borderRightColor:{value:["border","right","color"],support:["__experimentalBorder","color"],useEngine:!0},borderRightStyle:{value:["border","right","style"],support:["__experimentalBorder","style"],useEngine:!0},borderRightWidth:{value:["border","right","width"],support:["__experimentalBorder","width"],useEngine:!0},borderBottomColor:{value:["border","bottom","color"],support:["__experimentalBorder","color"],useEngine:!0},borderBottomStyle:{value:["border","bottom","style"],support:["__experimentalBorder","style"],useEngine:!0},borderBottomWidth:{value:["border","bottom","width"],support:["__experimentalBorder","width"],useEngine:!0},borderLeftColor:{value:["border","left","color"],support:["__experimentalBorder","color"],useEngine:!0},borderLeftStyle:{value:["border","left","style"],support:["__experimentalBorder","style"],useEngine:!0},borderLeftWidth:{value:["border","left","width"],support:["__experimentalBorder","width"],useEngine:!0},color:{value:["color","text"],support:["color","text"],requiresOptOut:!0,useEngine:!0},columnCount:{value:["typography","textColumns"],support:["typography","textColumns"],useEngine:!0},filter:{value:["filter","duotone"],support:["filter","duotone"]},linkColor:{value:["elements","link","color","text"],support:["color","link"]},captionColor:{value:["elements","caption","color","text"],support:["color","caption"]},buttonColor:{value:["elements","button","color","text"],support:["color","button"]},buttonBackgroundColor:{value:["elements","button","color","background"],support:["color","button"]},headingColor:{value:["elements","heading","color","text"],support:["color","heading"]},headingBackgroundColor:{value:["elements","heading","color","background"],support:["color","heading"]},fontFamily:{value:["typography","fontFamily"],support:["typography","__experimentalFontFamily"],useEngine:!0},fontSize:{value:["typography","fontSize"],support:["typography","fontSize"],useEngine:!0},fontStyle:{value:["typography","fontStyle"],support:["typography","__experimentalFontStyle"],useEngine:!0},fontWeight:{value:["typography","fontWeight"],support:["typography","__experimentalFontWeight"],useEngine:!0},lineHeight:{value:["typography","lineHeight"],support:["typography","lineHeight"],useEngine:!0},margin:{value:["spacing","margin"],support:["spacing","margin"],properties:{marginTop:"top",marginRight:"right",marginBottom:"bottom",marginLeft:"left"},useEngine:!0},minHeight:{value:["dimensions","minHeight"],support:["dimensions","minHeight"],useEngine:!0},padding:{value:["spacing","padding"],support:["spacing","padding"],properties:{paddingTop:"top",paddingRight:"right",paddingBottom:"bottom",paddingLeft:"left"},useEngine:!0},textAlign:{value:["typography","textAlign"],support:["typography","textAlign"],useEngine:!1},textDecoration:{value:["typography","textDecoration"],support:["typography","__experimentalTextDecoration"],useEngine:!0},textTransform:{value:["typography","textTransform"],support:["typography","__experimentalTextTransform"],useEngine:!0},letterSpacing:{value:["typography","letterSpacing"],support:["typography","__experimentalLetterSpacing"],useEngine:!0},writingMode:{value:["typography","writingMode"],support:["typography","__experimentalWritingMode"],useEngine:!0},"--wp--style--root--padding":{value:["spacing","padding"],support:["spacing","padding"],properties:{"--wp--style--root--padding-top":"top","--wp--style--root--padding-right":"right","--wp--style--root--padding-bottom":"bottom","--wp--style--root--padding-left":"left"},rootOnly:!0}},Za={link:"a:where(:not(.wp-element-button))",heading:"h1, h2, h3, h4, h5, h6",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",button:".wp-element-button, .wp-block-button__link",caption:".wp-element-caption, .wp-block-audio figcaption, .wp-block-embed figcaption, .wp-block-gallery figcaption, .wp-block-image figcaption, .wp-block-table figcaption, .wp-block-video figcaption",cite:"cite"},cLe={"color.duotone":!0,"color.gradients":!0,"color.palette":!0,"dimensions.aspectRatios":!0,"typography.fontSizes":!0,"spacing.spacingSizes":!0},{lock:lLe,unlock:Mf}=P0("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/blocks"),ZU={title:"block title",description:"block description",keywords:["block keyword"],styles:[{label:"block style label"}],variations:[{title:"block variation title",description:"block variation description",keywords:["block variation keyword"]}]};function U4(e){return e!==null&&typeof e=="object"}function uLe({textdomain:e,...t}){const n=["apiVersion","title","category","parent","ancestor","icon","description","keywords","attributes","providesContext","usesContext","selectors","supports","styles","example","variations","blockHooks","allowedBlocks"],o=Object.fromEntries(Object.entries(t).filter(([r])=>n.includes(r)));return e&&Object.keys(ZU).forEach(r=>{o[r]&&(o[r]=KE(ZU[r],o[r],e))}),o}function dLe(e,t){const n=U4(e)?e.name:e;if(typeof n!="string"){globalThis.SCRIPT_DEBUG===!0&&zn("Block names must be strings.");return}if(!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(n)){globalThis.SCRIPT_DEBUG===!0&&zn("Block names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-block");return}if(uo(kt).getBlockType(n)){globalThis.SCRIPT_DEBUG===!0&&zn('Block "'+n+'" is already registered.');return}const{addBootstrappedBlockType:o,addUnprocessedBlockType:r}=Mf(kr(kt));if(U4(e)){const s=uLe(e);o(n,s)}return r(n,t),uo(kt).getBlockType(n)}function KE(e,t,n){return typeof e=="string"&&typeof t=="string"?We(t,e,n):Array.isArray(e)&&e.length&&Array.isArray(t)?t.map(o=>KE(e[0],o,n)):U4(e)&&Object.entries(e).length&&U4(t)?Object.keys(t).reduce((o,r)=>e[r]?(o[r]=KE(e[r],t[r],n),o):(o[r]=t[r],o),{}):t}function pLe(e){kr(kt).setFreeformFallbackBlockName(e)}function yd(){return uo(kt).getFreeformFallbackBlockName()}function oie(){return uo(kt).getGroupingBlockName()}function fLe(e){kr(kt).setUnregisteredFallbackBlockName(e)}function g3(){return uo(kt).getUnregisteredFallbackBlockName()}function bLe(e){kr(kt).setDefaultBlockName(e)}function hLe(e){kr(kt).setGroupingBlockName(e)}function Mr(){return uo(kt).getDefaultBlockName()}function on(e){return uo(kt)?.getBlockType(e)}function gs(){return uo(kt).getBlockTypes()}function An(e,t,n){return uo(kt).getBlockSupport(e,t,n)}function Et(e,t,n){return uo(kt).hasBlockSupport(e,t,n)}function Qd(e){return e?.name==="core/block"}function Hh(e){return e?.name==="core/template-part"}const G5=(e,t)=>uo(kt).getBlockVariations(e,t),QU=e=>{const{name:t,label:n,usesContext:o,getValues:r,setValues:s,canUserEditValue:i,getFieldsList:c}=e,l=Mf(uo(kt)).getBlockBindingsSource(t),u=["label","usesContext"];for(const d in l)if(!u.includes(d)&&l[d]){globalThis.SCRIPT_DEBUG===!0&&zn('Block bindings source "'+t+'" is already registered.');return}if(!t){globalThis.SCRIPT_DEBUG===!0&&zn("Block bindings source must contain a name.");return}if(typeof t!="string"){globalThis.SCRIPT_DEBUG===!0&&zn("Block bindings source name must be a string.");return}if(/[A-Z]+/.test(t)){globalThis.SCRIPT_DEBUG===!0&&zn("Block bindings source name must not contain uppercase characters.");return}if(!/^[a-z0-9/-]+$/.test(t)){globalThis.SCRIPT_DEBUG===!0&&zn("Block bindings source name must contain only valid characters: lowercase characters, hyphens, or digits. Example: my-plugin/my-custom-source.");return}if(!/^[a-z0-9-]+\/[a-z0-9-]+$/.test(t)){globalThis.SCRIPT_DEBUG===!0&&zn("Block bindings source name must contain a namespace and valid characters. Example: my-plugin/my-custom-source.");return}if(!n&&!l?.label){globalThis.SCRIPT_DEBUG===!0&&zn("Block bindings source must contain a label.");return}if(n&&typeof n!="string"){globalThis.SCRIPT_DEBUG===!0&&zn("Block bindings source label must be a string.");return}if(n&&l?.label&&n!==l?.label&&globalThis.SCRIPT_DEBUG===!0&&zn('Block bindings "'+t+'" source label was overridden.'),o&&!Array.isArray(o)){globalThis.SCRIPT_DEBUG===!0&&zn("Block bindings source usesContext must be an array.");return}if(r&&typeof r!="function"){globalThis.SCRIPT_DEBUG===!0&&zn("Block bindings source getValues must be a function.");return}if(s&&typeof s!="function"){globalThis.SCRIPT_DEBUG===!0&&zn("Block bindings source setValues must be a function.");return}if(i&&typeof i!="function"){globalThis.SCRIPT_DEBUG===!0&&zn("Block bindings source canUserEditValue must be a function.");return}if(c&&typeof c!="function"){globalThis.SCRIPT_DEBUG===!0&&zn("Block bindings source getFieldsList must be a function.");return}return Mf(kr(kt)).addBlockBindingsSource(e)};function vl(e){return Mf(uo(kt)).getBlockBindingsSource(e)}function rie(){return Mf(uo(kt)).getAllBlockBindingsSources()}Xs([Gs,Uf]);const JU=["#191e23","#f8f9f9"];function E2(e){var t;return Object.entries((t=on(e.name)?.attributes)!==null&&t!==void 0?t:{}).every(([n,o])=>{const r=e.attributes[n];return o.hasOwnProperty("default")?r===o.default:o.type==="rich-text"?!r?.length:r===void 0})}function El(e){return e.name===Mr()&&E2(e)}function sie(e){return!!e&&(typeof e=="string"||x.isValidElement(e)||typeof e=="function"||e instanceof x.Component)}function mLe(e){if(e=e||nie,sie(e))return{src:e};if("background"in e){const t=an(e.background),n=r=>t.contrast(r),o=Math.max(...JU.map(n));return{...e,foreground:e.foreground?e.foreground:JU.find(r=>n(r)===o),shadowColor:t.alpha(.3).toRgbString()}}return e}function M3(e){return typeof e=="string"?on(e):e}function iie(e,t,n="visual"){const{__experimentalLabel:o,title:r}=e,s=o&&o(t,{context:n});return s?s.toPlainText?s.toPlainText():x1(s):r}function aie(e){if(e.default!==void 0)return e.default;if(e.type==="rich-text")return new Xo}function cie(e){return on(e)!==void 0}function EB(e,t){const n=on(e);if(n===void 0)throw new Error(`Block type '${e}' is not registered.`);return Object.entries(n.attributes).reduce((o,[r,s])=>{const i=t[r];if(i!==void 0)s.type==="rich-text"?i instanceof Xo?o[r]=i:typeof i=="string"&&(o[r]=Xo.fromHTMLString(i)):s.type==="string"&&i instanceof Xo?o[r]=i.toHTMLString():o[r]=i;else{const c=aie(s);c!==void 0&&(o[r]=c)}return["node","children"].indexOf(s.source)!==-1&&(typeof o[r]=="string"?o[r]=[o[r]]:Array.isArray(o[r])||(o[r]=[])),o},{})}function gLe(e,t){const n=on(e)?.attributes;return n?Object.keys(n).filter(r=>{const s=n[r];return s?.role===t?!0:s?.__experimentalRole===t?(Ke("__experimentalRole attribute",{since:"6.7",version:"6.8",alternative:"role attribute",hint:`Check the block.json of the ${e} block.`}),!0):!1}):[]}function MLe(e){const t=on(e)?.attributes;return t?!!Object.keys(t)?.some(n=>{const o=t[n];return o?.role==="content"||o?.__experimentalRole==="content"}):!1}function Xf(e,t){return Object.fromEntries(Object.entries(e).filter(([n])=>!t.includes(n)))}const zLe=[{slug:"text",title:m("Text")},{slug:"media",title:m("Media")},{slug:"design",title:m("Design")},{slug:"widgets",title:m("Widgets")},{slug:"theme",title:m("Theme")},{slug:"embed",title:m("Embeds")},{slug:"reusable",title:m("Reusable blocks")}];function WB(e){return e.reduce((t,n)=>({...t,[n.name]:n}),{})}function X4(e){return e.reduce((t,n)=>(t.some(o=>o.name===n.name)||t.push(n),t),[])}function OLe(e={},t){switch(t.type){case"ADD_BOOTSTRAPPED_BLOCK_TYPE":const{name:n,blockType:o}=t,r=e[n];let s;return r?(r.blockHooks===void 0&&o.blockHooks&&(s={...r,...s,blockHooks:o.blockHooks}),r.allowedBlocks===void 0&&o.allowedBlocks&&(s={...r,...s,allowedBlocks:o.allowedBlocks})):(s=Object.fromEntries(Object.entries(o).filter(([,i])=>i!=null).map(([i,c])=>[SN(i),c])),s.name=n),s?{...e,[n]:s}:e;case"REMOVE_BLOCK_TYPES":return Xf(e,t.names)}return e}function yLe(e={},t){switch(t.type){case"ADD_UNPROCESSED_BLOCK_TYPE":return{...e,[t.name]:t.blockType};case"REMOVE_BLOCK_TYPES":return Xf(e,t.names)}return e}function ALe(e={},t){switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...WB(t.blockTypes)};case"REMOVE_BLOCK_TYPES":return Xf(e,t.names)}return e}function vLe(e={},t){var n;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Object.fromEntries(Object.entries(WB(t.blockTypes)).map(([r,s])=>{var i,c;return[r,X4([...((i=s.styles)!==null&&i!==void 0?i:[]).map(l=>({...l,source:"block"})),...((c=e[s.name])!==null&&c!==void 0?c:[]).filter(({source:l})=>l!=="block")])]}))};case"ADD_BLOCK_STYLES":const o={};return t.blockNames.forEach(r=>{var s;o[r]=X4([...(s=e[r])!==null&&s!==void 0?s:[],...t.styles])}),{...e,...o};case"REMOVE_BLOCK_STYLES":return{...e,[t.blockName]:((n=e[t.blockName])!==null&&n!==void 0?n:[]).filter(r=>t.styleNames.indexOf(r.name)===-1)}}return e}function xLe(e={},t){var n,o;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Object.fromEntries(Object.entries(WB(t.blockTypes)).map(([r,s])=>{var i,c;return[r,X4([...((i=s.variations)!==null&&i!==void 0?i:[]).map(l=>({...l,source:"block"})),...((c=e[s.name])!==null&&c!==void 0?c:[]).filter(({source:l})=>l!=="block")])]}))};case"ADD_BLOCK_VARIATIONS":return{...e,[t.blockName]:X4([...(n=e[t.blockName])!==null&&n!==void 0?n:[],...t.variations])};case"REMOVE_BLOCK_VARIATIONS":return{...e,[t.blockName]:((o=e[t.blockName])!==null&&o!==void 0?o:[]).filter(r=>t.variationNames.indexOf(r.name)===-1)}}return e}function K5(e){return(t=null,n)=>{switch(n.type){case"REMOVE_BLOCK_TYPES":return n.names.indexOf(t)!==-1?null:t;case e:return n.name||null}return t}}const wLe=K5("SET_DEFAULT_BLOCK_NAME"),_Le=K5("SET_FREEFORM_FALLBACK_BLOCK_NAME"),kLe=K5("SET_UNREGISTERED_FALLBACK_BLOCK_NAME"),SLe=K5("SET_GROUPING_BLOCK_NAME");function CLe(e=zLe,t){switch(t.type){case"SET_CATEGORIES":const n=new Map;return(t.categories||[]).forEach(o=>{n.set(o.slug,o)}),[...n.values()];case"UPDATE_CATEGORY":{if(!t.category||!Object.keys(t.category).length)return e;if(e.find(({slug:r})=>r===t.slug))return e.map(r=>r.slug===t.slug?{...r,...t.category}:r)}}return e}function qLe(e={},t){switch(t.type){case"ADD_BLOCK_COLLECTION":return{...e,[t.namespace]:{title:t.title,icon:t.icon}};case"REMOVE_BLOCK_COLLECTION":return Xf(e,t.namespace)}return e}function RLe(e=[],t=[]){const n=Array.from(new Set(e.concat(t)));return n.length>0?n:void 0}function TLe(e={},t){switch(t.type){case"ADD_BLOCK_BINDINGS_SOURCE":let n;return(globalThis.IS_GUTENBERG_PLUGIN||t.name==="core/post-meta")&&(n=t.getFieldsList),{...e,[t.name]:{label:t.label||e[t.name]?.label,usesContext:RLe(e[t.name]?.usesContext,t.usesContext),getValues:t.getValues,setValues:t.setValues,canUserEditValue:t.setValues&&t.canUserEditValue,getFieldsList:n}};case"REMOVE_BLOCK_BINDINGS_SOURCE":return Xf(e,t.name)}return e}const ELe=J0({bootstrappedBlockTypes:OLe,unprocessedBlockTypes:yLe,blockTypes:ALe,blockStyles:vLe,blockVariations:xLe,defaultBlockName:wLe,freeformFallbackBlockName:_Le,unregisteredFallbackBlockName:kLe,groupingBlockName:SLe,categories:CLe,collections:qLe,blockBindingsSources:TLe}),JM=(e,t,n)=>{var o;const r=Array.isArray(t)?t:t.split(".");let s=e;return r.forEach(i=>{s=s?.[i]}),(o=s)!==null&&o!==void 0?o:n};function eX(e){return typeof e=="object"&&e.constructor===Object&&e!==null}function lie(e,t){return eX(e)&&eX(t)?Object.entries(t).every(([n,o])=>lie(e?.[n],o)):e===t}const WLe=["background","backgroundColor","color","linkColor","captionColor","buttonColor","headingColor","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","padding","contentSize","wideSize","blockGap","textDecoration","textTransform","letterSpacing"];function tX(e,t,n){return e.filter(o=>!(o==="fontSize"&&n==="heading"||o==="textDecoration"&&!t&&n!=="link"||o==="textTransform"&&!t&&!(["heading","h1","h2","h3","h4","h5","h6"].includes(n)||n==="button"||n==="caption"||n==="text")||o==="letterSpacing"&&!t&&!(["heading","h1","h2","h3","h4","h5","h6"].includes(n)||n==="button"||n==="caption"||n==="text")||o==="textColumns"&&!t))}const NLe=It((e,t,n)=>{if(!t)return tX(WLe,t,n);const o=z3(e,t);if(!o)return[];const r=[];return o?.supports?.spacing?.blockGap&&r.push("blockGap"),o?.supports?.shadow&&r.push("shadow"),Object.keys(Pp).forEach(s=>{if(Pp[s].support){if(Pp[s].requiresOptOut&&Pp[s].support[0]in o.supports&&JM(o.supports,Pp[s].support)!==!1){r.push(s);return}JM(o.supports,Pp[s].support,!1)&&r.push(s)}}),tX(r,t,n)},(e,t)=>[e.blockTypes[t]]);function BLe(e,t){return e.bootstrappedBlockTypes[t]}function LLe(e){return e.unprocessedBlockTypes}function PLe(e){return e.blockBindingsSources}function jLe(e,t){return e.blockBindingsSources[t]}const uie=(e,t)=>{const n=z3(e,t);return n?Object.values(n.attributes).some(({role:o,__experimentalRole:r})=>o==="content"?!0:r==="content"?(Ke("__experimentalRole attribute",{since:"6.7",version:"6.8",alternative:"role attribute",hint:`Check the block.json of the ${t} block.`}),!0):!1):!1},ILe=Object.freeze(Object.defineProperty({__proto__:null,getAllBlockBindingsSources:PLe,getBlockBindingsSource:jLe,getBootstrappedBlockType:BLe,getSupportedStyles:NLe,getUnprocessedBlockTypes:LLe,hasContentRoleAttribute:uie},Symbol.toStringTag,{value:"Module"})),die=(e,t)=>typeof t=="string"?z3(e,t):t,pie=It(e=>Object.values(e.blockTypes),e=>[e.blockTypes]);function z3(e,t){return e.blockTypes[t]}function DLe(e,t){return e.blockStyles[t]}const NB=It((e,t,n)=>{const o=e.blockVariations[t];return!o||!n?o:o.filter(r=>(r.scope||["block","inserter"]).includes(n))},(e,t)=>[e.blockVariations[t]]);function FLe(e,t,n,o){const r=NB(e,t,o);if(!r)return r;const s=z3(e,t),i=Object.keys(s?.attributes||{});let c,l=0;for(const u of r)if(Array.isArray(u.isActive)){const d=u.isActive.filter(b=>{const h=b.split(".")[0];return i.includes(h)}),p=d.length;if(p===0)continue;d.every(b=>{const h=JM(u.attributes,b);if(h===void 0)return!1;let g=JM(n,b);return g instanceof Xo&&(g=g.toHTMLString()),lie(g,h)})&&p>l&&(c=u,l=p)}else if(u.isActive?.(n,u.attributes))return c||u;return c}function $Le(e,t,n){const o=NB(e,t,n);return[...o].reverse().find(({isDefault:s})=>!!s)||o[0]}function VLe(e){return e.categories}function HLe(e){return e.collections}function ULe(e){return e.defaultBlockName}function XLe(e){return e.freeformFallbackBlockName}function GLe(e){return e.unregisteredFallbackBlockName}function KLe(e){return e.groupingBlockName}const BB=It((e,t)=>pie(e).filter(n=>n.parent?.includes(t)).map(({name:n})=>n),e=>[e.blockTypes]),fie=(e,t,n,o)=>{const r=die(e,t);return r?.supports?JM(r.supports,n,o):o};function bie(e,t,n,o){return!!fie(e,t,n,o)}function nX(e){return ms(e??"").toLowerCase().trim()}function YLe(e,t,n=""){const o=die(e,t),r=nX(n),s=i=>nX(i).includes(r);return s(o.title)||o.keywords?.some(s)||s(o.category)||typeof o.description=="string"&&s(o.description)}const ZLe=(e,t)=>BB(e,t).length>0,QLe=(e,t)=>BB(e,t).some(n=>bie(e,n,"inserter",!0)),JLe=(...e)=>(Ke("__experimentalHasContentRoleAttribute",{since:"6.7",version:"6.8",hint:"This is a private selector."}),uie(...e)),ePe=Object.freeze(Object.defineProperty({__proto__:null,__experimentalHasContentRoleAttribute:JLe,getActiveBlockVariation:FLe,getBlockStyles:DLe,getBlockSupport:fie,getBlockType:z3,getBlockTypes:pie,getBlockVariations:NB,getCategories:VLe,getChildBlockNames:BB,getCollections:HLe,getDefaultBlockName:ULe,getDefaultBlockVariation:$Le,getFreeformFallbackBlockName:XLe,getGroupingBlockName:KLe,getUnregisteredFallbackBlockName:GLe,hasBlockSupport:bie,hasChildBlocks:ZLe,hasChildBlocksWithInserterSupport:QLe,isMatchingSearchTerm:YLe},Symbol.toStringTag,{value:"Module"}));var ZS={exports:{}},ko={};/** +Use Chrome, Firefox or Internet Explorer 11`)}}).call(this)}).call(this,s("_process"),typeof p1>"u"?typeof self>"u"?typeof window>"u"?{}:window:self:p1)},{_process:12,"safe-buffer":30}],15:[function(s,i){function c(h,g){h.prototype=Object.create(g.prototype),h.prototype.constructor=h,h.__proto__=g}function l(h,g,z){function A(v,M,y){return typeof g=="string"?g:g(v,M,y)}z||(z=Error);var _=function(v){function M(y,k,S){return v.call(this,A(y,k,S))||this}return c(M,v),M}(z);_.prototype.name=z.name,_.prototype.code=h,b[h]=_}function u(h,g){if(Array.isArray(h)){var z=h.length;return h=h.map(function(A){return A+""}),2h.length)&&(z=h.length),h.substring(z-g.length,z)===g}function f(h,g,z){return typeof z!="number"&&(z=0),!(z+g.length>h.length)&&h.indexOf(g,z)!==-1}var b={};l("ERR_INVALID_OPT_VALUE",function(h,g){return'The value "'+g+'" is invalid for option "'+h+'"'},TypeError),l("ERR_INVALID_ARG_TYPE",function(h,g,z){var A;typeof g=="string"&&d(g,"not ")?(A="must not be",g=g.replace(/^not /,"")):A="must be";var _;if(p(h," argument"))_="The ".concat(h," ").concat(A," ").concat(u(g,"type"));else{var v=f(h,".")?"property":"argument";_='The "'.concat(h,'" ').concat(v," ").concat(A," ").concat(u(g,"type"))}return _+=". Received type ".concat(typeof z),_},TypeError),l("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),l("ERR_METHOD_NOT_IMPLEMENTED",function(h){return"The "+h+" method is not implemented"}),l("ERR_STREAM_PREMATURE_CLOSE","Premature close"),l("ERR_STREAM_DESTROYED",function(h){return"Cannot call "+h+" after a stream was destroyed"}),l("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),l("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),l("ERR_STREAM_WRITE_AFTER_END","write after end"),l("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),l("ERR_UNKNOWN_ENCODING",function(h){return"Unknown encoding: "+h},TypeError),l("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),i.exports.codes=b},{}],16:[function(s,i){(function(c){(function(){function l(A){return this instanceof l?(f.call(this,A),b.call(this,A),this.allowHalfOpen=!0,void(A&&(A.readable===!1&&(this.readable=!1),A.writable===!1&&(this.writable=!1),A.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",u))))):new l(A)}function u(){this._writableState.ended||c.nextTick(d,this)}function d(A){A.end()}var p=Object.keys||function(A){var _=[];for(var v in A)_.push(v);return _};i.exports=l;var f=s("./_stream_readable"),b=s("./_stream_writable");s("inherits")(l,f);for(var h,g=p(b.prototype),z=0;z>>1,se|=se>>>2,se|=se>>>4,se|=se>>>8,se|=se>>>16,se++),se}function _(se,L){return 0>=se||L.length===0&&L.ended?0:L.objectMode?1:se===se?(se>L.highWaterMark&&(L.highWaterMark=A(se)),se<=L.length?se:L.ended?L.length:(L.needReadable=!0,0)):L.flowing&&L.length?L.buffer.head.data.length:L.length}function v(se,L){if(X("onEofChunk"),!L.ended){if(L.decoder){var U=L.decoder.end();U&&U.length&&(L.buffer.push(U),L.length+=L.objectMode?1:U.length)}L.ended=!0,L.sync?M(se):(L.needReadable=!1,!L.emittedReadable&&(L.emittedReadable=!0,y(se)))}}function M(se){var L=se._readableState;X("emitReadable",L.needReadable,L.emittedReadable),L.needReadable=!1,L.emittedReadable||(X("emitReadable",L.flowing),L.emittedReadable=!0,c.nextTick(y,se))}function y(se){var L=se._readableState;X("emitReadable_",L.destroyed,L.length,L.ended),!L.destroyed&&(L.length||L.ended)&&(se.emit("readable"),L.emittedReadable=!1),L.needReadable=!L.flowing&&!L.ended&&L.length<=L.highWaterMark,N(se)}function k(se,L){L.readingMore||(L.readingMore=!0,c.nextTick(S,se,L))}function S(se,L){for(;!L.reading&&!L.ended&&(L.length=L.length?(U=L.decoder?L.buffer.join(""):L.buffer.length===1?L.buffer.first():L.buffer.concat(L.length),L.buffer.clear()):U=L.buffer.consume(se,L.decoder),U}function I(se){var L=se._readableState;X("endReadable",L.endEmitted),L.endEmitted||(L.ended=!0,c.nextTick(P,L,se))}function P(se,L){if(X("endReadableNT",se.endEmitted,se.length),!se.endEmitted&&se.length===0&&(se.endEmitted=!0,L.readable=!1,L.emit("end"),se.autoDestroy)){var U=L._writableState;(!U||U.autoDestroy&&U.finished)&&L.destroy()}}function $(se,L){for(var U=0,ne=se.length;U=L.highWaterMark)||L.ended))return X("read: emitReadable",L.length,L.ended),L.length===0&&L.ended?I(this):M(this),null;if(se=_(se,L),se===0&&L.ended)return L.length===0&&I(this),null;var ne=L.needReadable;X("need readable",ne),(L.length===0||L.length-se"u"?typeof self>"u"?typeof window>"u"?{}:window:self:p1)},{"../errors":15,"./_stream_duplex":16,"./internal/streams/async_iterator":21,"./internal/streams/buffer_list":22,"./internal/streams/destroy":23,"./internal/streams/from":25,"./internal/streams/state":27,"./internal/streams/stream":28,_process:12,buffer:3,events:7,inherits:10,"string_decoder/":31,util:2}],19:[function(s,i){function c(A,_){var v=this._transformState;v.transforming=!1;var M=v.writecb;if(M===null)return this.emit("error",new b);v.writechunk=null,v.writecb=null,_!=null&&this.push(_),M(A);var y=this._readableState;y.reading=!1,(y.needReadable||y.length"u"?typeof self>"u"?typeof window>"u"?{}:window:self:p1)},{"../errors":15,"./_stream_duplex":16,"./internal/streams/destroy":23,"./internal/streams/state":27,"./internal/streams/stream":28,_process:12,buffer:3,inherits:10,"util-deprecate":32}],21:[function(s,i){(function(c){(function(){function l(C,R,T){return R in C?Object.defineProperty(C,R,{value:T,enumerable:!0,configurable:!0,writable:!0}):C[R]=T,C}function u(C,R){return{value:C,done:R}}function d(C){var R=C[g];if(R!==null){var T=C[y].read();T!==null&&(C[v]=null,C[g]=null,C[z]=null,R(u(T,!1)))}}function p(C){c.nextTick(d,C)}function f(C,R){return function(T,E){C.then(function(){return R[_]?void T(u(void 0,!0)):void R[M](T,E)},E)}}var b,h=s("./end-of-stream"),g=Symbol("lastResolve"),z=Symbol("lastReject"),A=Symbol("error"),_=Symbol("ended"),v=Symbol("lastPromise"),M=Symbol("handlePromise"),y=Symbol("stream"),k=Object.getPrototypeOf(function(){}),S=Object.setPrototypeOf((b={get stream(){return this[y]},next:function(){var C=this,R=this[A];if(R!==null)return Promise.reject(R);if(this[_])return Promise.resolve(u(void 0,!0));if(this[y].destroyed)return new Promise(function(N,j){c.nextTick(function(){C[A]?j(C[A]):N(u(void 0,!0))})});var T,E=this[v];if(E)T=new Promise(f(E,this));else{var B=this[y].read();if(B!==null)return Promise.resolve(u(B,!1));T=new Promise(this[M])}return this[v]=T,T}},l(b,Symbol.asyncIterator,function(){return this}),l(b,"return",function(){var C=this;return new Promise(function(R,T){C[y].destroy(null,function(E){return E?void T(E):void R(u(void 0,!0))})})}),b),k);i.exports=function(C){var R,T=Object.create(S,(R={},l(R,y,{value:C,writable:!0}),l(R,g,{value:null,writable:!0}),l(R,z,{value:null,writable:!0}),l(R,A,{value:null,writable:!0}),l(R,_,{value:C._readableState.endEmitted,writable:!0}),l(R,M,{value:function(E,B){var N=T[y].read();N?(T[v]=null,T[g]=null,T[z]=null,E(u(N,!1))):(T[g]=E,T[z]=B)},writable:!0}),R));return T[v]=null,h(C,function(E){if(E&&E.code!=="ERR_STREAM_PREMATURE_CLOSE"){var B=T[z];return B!==null&&(T[v]=null,T[g]=null,T[z]=null,B(E)),void(T[A]=E)}var N=T[g];N!==null&&(T[v]=null,T[g]=null,T[z]=null,N(u(void 0,!0))),T[_]=!0}),C.on("readable",p.bind(null,T)),T}}).call(this)}).call(this,s("_process"))},{"./end-of-stream":24,_process:12}],22:[function(s,i){function c(v,M){var y=Object.keys(v);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(v);M&&(k=k.filter(function(S){return Object.getOwnPropertyDescriptor(v,S).enumerable})),y.push.apply(y,k)}return y}function l(v){for(var M,y=1;y>>0),k=this.head,S=0;k;)b(k.data,y,S),S+=k.data.length,k=k.next;return y}},{key:"consume",value:function(M,y){var k;return MC.length?C.length:M;if(S+=R===C.length?C:C.slice(0,M),M-=R,M===0){R===C.length?(++k,this.head=y.next?y.next:this.tail=null):(this.head=y,y.data=C.slice(R));break}++k}return this.length-=k,S}},{key:"_getBuffer",value:function(M){var y=g.allocUnsafe(M),k=this.head,S=1;for(k.data.copy(y),M-=k.data.length;k=k.next;){var C=k.data,R=M>C.length?C.length:M;if(C.copy(y,y.length-M,0,R),M-=R,M===0){R===C.length?(++S,this.head=k.next?k.next:this.tail=null):(this.head=k,k.data=C.slice(R));break}++S}return this.length-=S,y}},{key:_,value:function(M,y){return A(this,l({},y,{depth:0,customInspect:!1}))}}]),v}()},{buffer:3,util:2}],23:[function(s,i){(function(c){(function(){function l(p,f){d(p,f),u(p)}function u(p){p._writableState&&!p._writableState.emitClose||p._readableState&&!p._readableState.emitClose||p.emit("close")}function d(p,f){p.emit("error",f)}i.exports={destroy:function(p,f){var b=this,h=this._readableState&&this._readableState.destroyed,g=this._writableState&&this._writableState.destroyed;return h||g?(f?f(p):p&&(this._writableState?!this._writableState.errorEmitted&&(this._writableState.errorEmitted=!0,c.nextTick(d,this,p)):c.nextTick(d,this,p)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(p||null,function(z){!f&&z?b._writableState?b._writableState.errorEmitted?c.nextTick(u,b):(b._writableState.errorEmitted=!0,c.nextTick(l,b,z)):c.nextTick(l,b,z):f?(c.nextTick(u,b),f(z)):c.nextTick(u,b)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(p,f){var b=p._readableState,h=p._writableState;b&&b.autoDestroy||h&&h.autoDestroy?p.destroy(f):p.emit("error",f)}}}).call(this)}).call(this,s("_process"))},{_process:12}],24:[function(s,i){function c(f){var b=!1;return function(){if(!b){b=!0;for(var h=arguments.length,g=Array(h),z=0;zv.length)throw new z("streams");var k,S=v.map(function(C,R){var T=Rb){var h=f?p:"highWaterMark";throw new l(h,b)}return n(b)}return u.objectMode?16:16384}}},{"../../../errors":15}],28:[function(s,i){i.exports=s("events").EventEmitter},{events:7}],29:[function(s,i,c){c=i.exports=s("./lib/_stream_readable.js"),c.Stream=c,c.Readable=c,c.Writable=s("./lib/_stream_writable.js"),c.Duplex=s("./lib/_stream_duplex.js"),c.Transform=s("./lib/_stream_transform.js"),c.PassThrough=s("./lib/_stream_passthrough.js"),c.finished=s("./lib/internal/streams/end-of-stream.js"),c.pipeline=s("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":16,"./lib/_stream_passthrough.js":17,"./lib/_stream_readable.js":18,"./lib/_stream_transform.js":19,"./lib/_stream_writable.js":20,"./lib/internal/streams/end-of-stream.js":24,"./lib/internal/streams/pipeline.js":26}],30:[function(s,i,c){function l(f,b){for(var h in f)b[h]=f[h]}function u(f,b,h){return p(f,b,h)}/*! safe-buffer. MIT License. Feross Aboukhadijeh */var d=s("buffer"),p=d.Buffer;p.from&&p.alloc&&p.allocUnsafe&&p.allocUnsafeSlow?i.exports=d:(l(d,c),c.Buffer=u),u.prototype=Object.create(p.prototype),l(p,u),u.from=function(f,b,h){if(typeof f=="number")throw new TypeError("Argument must not be a number");return p(f,b,h)},u.alloc=function(f,b,h){if(typeof f!="number")throw new TypeError("Argument must be a number");var g=p(f);return b===void 0?g.fill(0):typeof h=="string"?g.fill(b,h):g.fill(b),g},u.allocUnsafe=function(f){if(typeof f!="number")throw new TypeError("Argument must be a number");return p(f)},u.allocUnsafeSlow=function(f){if(typeof f!="number")throw new TypeError("Argument must be a number");return d.SlowBuffer(f)}},{buffer:3}],31:[function(s,i,c){function l(S){if(!S)return"utf8";for(var C;;)switch(S){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return S;default:if(C)return;S=(""+S).toLowerCase(),C=!0}}function u(S){var C=l(S);if(typeof C!="string"&&(y.isEncoding===k||!k(S)))throw new Error("Unknown encoding: "+S);return C||S}function d(S){this.encoding=u(S);var C;switch(this.encoding){case"utf16le":this.text=g,this.end=z,C=4;break;case"utf8":this.fillLast=h,C=4;break;case"base64":this.text=A,this.end=_,C=3;break;default:return this.write=v,void(this.end=M)}this.lastNeed=0,this.lastTotal=0,this.lastChar=y.allocUnsafe(C)}function p(S){return 127>=S?0:S>>5==6?2:S>>4==14?3:S>>3==30?4:S>>6==2?-1:-2}function f(S,C,R){var T=C.length-1;if(T=T)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=S[S.length-2],this.lastChar[1]=S[S.length-1],R.slice(0,-1)}return R}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=S[S.length-1],S.toString("utf16le",C,S.length-1)}function z(S){var C=S&&S.length?this.write(S):"";if(this.lastNeed){var R=this.lastTotal-this.lastNeed;return C+this.lastChar.toString("utf16le",0,R)}return C}function A(S,C){var R=(S.length-C)%3;return R==0?S.toString("base64",C):(this.lastNeed=3-R,this.lastTotal=3,R==1?this.lastChar[0]=S[S.length-1]:(this.lastChar[0]=S[S.length-2],this.lastChar[1]=S[S.length-1]),S.toString("base64",C,S.length-R))}function _(S){var C=S&&S.length?this.write(S):"";return this.lastNeed?C+this.lastChar.toString("base64",0,3-this.lastNeed):C}function v(S){return S.toString(this.encoding)}function M(S){return S&&S.length?this.write(S):""}var y=s("safe-buffer").Buffer,k=y.isEncoding||function(S){switch(S=""+S,S&&S.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};c.StringDecoder=d,d.prototype.write=function(S){if(S.length===0)return"";var C,R;if(this.lastNeed){if(C=this.fillLast(S),C===void 0)return"";R=this.lastNeed,this.lastNeed=0}else R=0;return R"u"?typeof self>"u"?typeof window>"u"?{}:window:self:p1)},{}],"/":[function(s,i){function c(_){return _.replace(/a=ice-options:trickle\s\n/g,"")}function l(_){console.warn(_)}/*! simple-peer. MIT License. Feross Aboukhadijeh */const u=s("debug")("simple-peer"),d=s("get-browser-rtc"),p=s("randombytes"),f=s("readable-stream"),b=s("queue-microtask"),h=s("err-code"),{Buffer:g}=s("buffer"),z=65536;class A extends f.Duplex{constructor(v){if(v=Object.assign({allowHalfOpen:!1},v),super(v),this._id=p(4).toString("hex").slice(0,7),this._debug("new peer %o",v),this.channelName=v.initiator?v.channelName||p(20).toString("hex"):null,this.initiator=v.initiator||!1,this.channelConfig=v.channelConfig||A.channelConfig,this.channelNegotiated=this.channelConfig.negotiated,this.config=Object.assign({},A.config,v.config),this.offerOptions=v.offerOptions||{},this.answerOptions=v.answerOptions||{},this.sdpTransform=v.sdpTransform||(M=>M),this.streams=v.streams||(v.stream?[v.stream]:[]),this.trickle=v.trickle===void 0||v.trickle,this.allowHalfTrickle=v.allowHalfTrickle!==void 0&&v.allowHalfTrickle,this.iceCompleteTimeout=v.iceCompleteTimeout||5e3,this.destroyed=!1,this.destroying=!1,this._connected=!1,this.remoteAddress=void 0,this.remoteFamily=void 0,this.remotePort=void 0,this.localAddress=void 0,this.localFamily=void 0,this.localPort=void 0,this._wrtc=v.wrtc&&typeof v.wrtc=="object"?v.wrtc:d(),!this._wrtc)throw h(typeof window>"u"?new Error("No WebRTC support: Specify `opts.wrtc` option in this environment"):new Error("No WebRTC support: Not a supported browser"),"ERR_WEBRTC_SUPPORT");this._pcReady=!1,this._channelReady=!1,this._iceComplete=!1,this._iceCompleteTimer=null,this._channel=null,this._pendingCandidates=[],this._isNegotiating=!1,this._firstNegotiation=!0,this._batchedNegotiation=!1,this._queuedNegotiation=!1,this._sendersAwaitingStable=[],this._senderMap=new Map,this._closingInterval=null,this._remoteTracks=[],this._remoteStreams=[],this._chunk=null,this._cb=null,this._interval=null;try{this._pc=new this._wrtc.RTCPeerConnection(this.config)}catch(M){return void this.destroy(h(M,"ERR_PC_CONSTRUCTOR"))}this._isReactNativeWebrtc=typeof this._pc._peerConnectionId=="number",this._pc.oniceconnectionstatechange=()=>{this._onIceStateChange()},this._pc.onicegatheringstatechange=()=>{this._onIceStateChange()},this._pc.onconnectionstatechange=()=>{this._onConnectionStateChange()},this._pc.onsignalingstatechange=()=>{this._onSignalingStateChange()},this._pc.onicecandidate=M=>{this._onIceCandidate(M)},typeof this._pc.peerIdentity=="object"&&this._pc.peerIdentity.catch(M=>{this.destroy(h(M,"ERR_PC_PEER_IDENTITY"))}),this.initiator||this.channelNegotiated?this._setupData({channel:this._pc.createDataChannel(this.channelName,this.channelConfig)}):this._pc.ondatachannel=M=>{this._setupData(M)},this.streams&&this.streams.forEach(M=>{this.addStream(M)}),this._pc.ontrack=M=>{this._onTrack(M)},this._debug("initial negotiation"),this._needsNegotiation(),this._onFinishBound=()=>{this._onFinish()},this.once("finish",this._onFinishBound)}get bufferSize(){return this._channel&&this._channel.bufferedAmount||0}get connected(){return this._connected&&this._channel.readyState==="open"}address(){return{port:this.localPort,family:this.localFamily,address:this.localAddress}}signal(v){if(!this.destroying){if(this.destroyed)throw h(new Error("cannot signal after peer is destroyed"),"ERR_DESTROYED");if(typeof v=="string")try{v=JSON.parse(v)}catch{v={}}this._debug("signal()"),v.renegotiate&&this.initiator&&(this._debug("got request to renegotiate"),this._needsNegotiation()),v.transceiverRequest&&this.initiator&&(this._debug("got request for transceiver"),this.addTransceiver(v.transceiverRequest.kind,v.transceiverRequest.init)),v.candidate&&(this._pc.remoteDescription&&this._pc.remoteDescription.type?this._addIceCandidate(v.candidate):this._pendingCandidates.push(v.candidate)),v.sdp&&this._pc.setRemoteDescription(new this._wrtc.RTCSessionDescription(v)).then(()=>{this.destroyed||(this._pendingCandidates.forEach(M=>{this._addIceCandidate(M)}),this._pendingCandidates=[],this._pc.remoteDescription.type==="offer"&&this._createAnswer())}).catch(M=>{this.destroy(h(M,"ERR_SET_REMOTE_DESCRIPTION"))}),v.sdp||v.candidate||v.renegotiate||v.transceiverRequest||this.destroy(h(new Error("signal() called with invalid signal data"),"ERR_SIGNALING"))}}_addIceCandidate(v){const M=new this._wrtc.RTCIceCandidate(v);this._pc.addIceCandidate(M).catch(y=>{!M.address||M.address.endsWith(".local")?l("Ignoring unsupported ICE candidate."):this.destroy(h(y,"ERR_ADD_ICE_CANDIDATE"))})}send(v){if(!this.destroying){if(this.destroyed)throw h(new Error("cannot send after peer is destroyed"),"ERR_DESTROYED");this._channel.send(v)}}addTransceiver(v,M){if(!this.destroying){if(this.destroyed)throw h(new Error("cannot addTransceiver after peer is destroyed"),"ERR_DESTROYED");if(this._debug("addTransceiver()"),this.initiator)try{this._pc.addTransceiver(v,M),this._needsNegotiation()}catch(y){this.destroy(h(y,"ERR_ADD_TRANSCEIVER"))}else this.emit("signal",{type:"transceiverRequest",transceiverRequest:{kind:v,init:M}})}}addStream(v){if(!this.destroying){if(this.destroyed)throw h(new Error("cannot addStream after peer is destroyed"),"ERR_DESTROYED");this._debug("addStream()"),v.getTracks().forEach(M=>{this.addTrack(M,v)})}}addTrack(v,M){if(this.destroying)return;if(this.destroyed)throw h(new Error("cannot addTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("addTrack()");const y=this._senderMap.get(v)||new Map;let k=y.get(M);if(!k)k=this._pc.addTrack(v,M),y.set(M,k),this._senderMap.set(v,y),this._needsNegotiation();else throw k.removed?h(new Error("Track has been removed. You should enable/disable tracks that you want to re-add."),"ERR_SENDER_REMOVED"):h(new Error("Track has already been added to that stream."),"ERR_SENDER_ALREADY_ADDED")}replaceTrack(v,M,y){if(this.destroying)return;if(this.destroyed)throw h(new Error("cannot replaceTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("replaceTrack()");const k=this._senderMap.get(v),S=k?k.get(y):null;if(!S)throw h(new Error("Cannot replace track that was never added."),"ERR_TRACK_NOT_ADDED");M&&this._senderMap.set(M,k),S.replaceTrack==null?this.destroy(h(new Error("replaceTrack is not supported in this browser"),"ERR_UNSUPPORTED_REPLACETRACK")):S.replaceTrack(M)}removeTrack(v,M){if(this.destroying)return;if(this.destroyed)throw h(new Error("cannot removeTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSender()");const y=this._senderMap.get(v),k=y?y.get(M):null;if(!k)throw h(new Error("Cannot remove track that was never added."),"ERR_TRACK_NOT_ADDED");try{k.removed=!0,this._pc.removeTrack(k)}catch(S){S.name==="NS_ERROR_UNEXPECTED"?this._sendersAwaitingStable.push(k):this.destroy(h(S,"ERR_REMOVE_TRACK"))}this._needsNegotiation()}removeStream(v){if(!this.destroying){if(this.destroyed)throw h(new Error("cannot removeStream after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSenders()"),v.getTracks().forEach(M=>{this.removeTrack(M,v)})}}_needsNegotiation(){this._debug("_needsNegotiation"),this._batchedNegotiation||(this._batchedNegotiation=!0,b(()=>{this._batchedNegotiation=!1,this.initiator||!this._firstNegotiation?(this._debug("starting batched negotiation"),this.negotiate()):this._debug("non-initiator initial negotiation request discarded"),this._firstNegotiation=!1}))}negotiate(){if(!this.destroying){if(this.destroyed)throw h(new Error("cannot negotiate after peer is destroyed"),"ERR_DESTROYED");this.initiator?this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("start negotiation"),setTimeout(()=>{this._createOffer()},0)):this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("requesting negotiation from initiator"),this.emit("signal",{type:"renegotiate",renegotiate:!0})),this._isNegotiating=!0}}destroy(v){this._destroy(v,()=>{})}_destroy(v,M){this.destroyed||this.destroying||(this.destroying=!0,this._debug("destroying (error: %s)",v&&(v.message||v)),b(()=>{if(this.destroyed=!0,this.destroying=!1,this._debug("destroy (error: %s)",v&&(v.message||v)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this._connected=!1,this._pcReady=!1,this._channelReady=!1,this._remoteTracks=null,this._remoteStreams=null,this._senderMap=null,clearInterval(this._closingInterval),this._closingInterval=null,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._onFinishBound&&this.removeListener("finish",this._onFinishBound),this._onFinishBound=null,this._channel){try{this._channel.close()}catch{}this._channel.onmessage=null,this._channel.onopen=null,this._channel.onclose=null,this._channel.onerror=null}if(this._pc){try{this._pc.close()}catch{}this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ontrack=null,this._pc.ondatachannel=null}this._pc=null,this._channel=null,v&&this.emit("error",v),this.emit("close"),M()}))}_setupData(v){if(!v.channel)return this.destroy(h(new Error("Data channel event is missing `channel` property"),"ERR_DATA_CHANNEL"));this._channel=v.channel,this._channel.binaryType="arraybuffer",typeof this._channel.bufferedAmountLowThreshold=="number"&&(this._channel.bufferedAmountLowThreshold=z),this.channelName=this._channel.label,this._channel.onmessage=y=>{this._onChannelMessage(y)},this._channel.onbufferedamountlow=()=>{this._onChannelBufferedAmountLow()},this._channel.onopen=()=>{this._onChannelOpen()},this._channel.onclose=()=>{this._onChannelClose()},this._channel.onerror=y=>{const k=y.error instanceof Error?y.error:new Error(`Datachannel error: ${y.message} ${y.filename}:${y.lineno}:${y.colno}`);this.destroy(h(k,"ERR_DATA_CHANNEL"))};let M=!1;this._closingInterval=setInterval(()=>{this._channel&&this._channel.readyState==="closing"?(M&&this._onChannelClose(),M=!0):M=!1},5e3)}_read(){}_write(v,M,y){if(this.destroyed)return y(h(new Error("cannot write after peer is destroyed"),"ERR_DATA_CHANNEL"));if(this._connected){try{this.send(v)}catch(k){return this.destroy(h(k,"ERR_DATA_CHANNEL"))}this._channel.bufferedAmount>z?(this._debug("start backpressure: bufferedAmount %d",this._channel.bufferedAmount),this._cb=y):y(null)}else this._debug("write before connect"),this._chunk=v,this._cb=y}_onFinish(){if(!this.destroyed){const v=()=>{setTimeout(()=>this.destroy(),1e3)};this._connected?v():this.once("connect",v)}}_startIceCompleteTimeout(){this.destroyed||this._iceCompleteTimer||(this._debug("started iceComplete timeout"),this._iceCompleteTimer=setTimeout(()=>{this._iceComplete||(this._iceComplete=!0,this._debug("iceComplete timeout completed"),this.emit("iceTimeout"),this.emit("_iceComplete"))},this.iceCompleteTimeout))}_createOffer(){this.destroyed||this._pc.createOffer(this.offerOptions).then(v=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(v.sdp=c(v.sdp)),v.sdp=this.sdpTransform(v.sdp);const M=()=>{if(!this.destroyed){const y=this._pc.localDescription||v;this._debug("signal"),this.emit("signal",{type:y.type,sdp:y.sdp})}};this._pc.setLocalDescription(v).then(()=>{this._debug("createOffer success"),this.destroyed||(this.trickle||this._iceComplete?M():this.once("_iceComplete",M))}).catch(y=>{this.destroy(h(y,"ERR_SET_LOCAL_DESCRIPTION"))})}).catch(v=>{this.destroy(h(v,"ERR_CREATE_OFFER"))})}_requestMissingTransceivers(){this._pc.getTransceivers&&this._pc.getTransceivers().forEach(v=>{v.mid||!v.sender.track||v.requested||(v.requested=!0,this.addTransceiver(v.sender.track.kind))})}_createAnswer(){this.destroyed||this._pc.createAnswer(this.answerOptions).then(v=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(v.sdp=c(v.sdp)),v.sdp=this.sdpTransform(v.sdp);const M=()=>{if(!this.destroyed){const y=this._pc.localDescription||v;this._debug("signal"),this.emit("signal",{type:y.type,sdp:y.sdp}),this.initiator||this._requestMissingTransceivers()}};this._pc.setLocalDescription(v).then(()=>{this.destroyed||(this.trickle||this._iceComplete?M():this.once("_iceComplete",M))}).catch(y=>{this.destroy(h(y,"ERR_SET_LOCAL_DESCRIPTION"))})}).catch(v=>{this.destroy(h(v,"ERR_CREATE_ANSWER"))})}_onConnectionStateChange(){this.destroyed||this._pc.connectionState==="failed"&&this.destroy(h(new Error("Connection failed."),"ERR_CONNECTION_FAILURE"))}_onIceStateChange(){if(this.destroyed)return;const v=this._pc.iceConnectionState,M=this._pc.iceGatheringState;this._debug("iceStateChange (connection: %s) (gathering: %s)",v,M),this.emit("iceStateChange",v,M),(v==="connected"||v==="completed")&&(this._pcReady=!0,this._maybeReady()),v==="failed"&&this.destroy(h(new Error("Ice connection failed."),"ERR_ICE_CONNECTION_FAILURE")),v==="closed"&&this.destroy(h(new Error("Ice connection closed."),"ERR_ICE_CONNECTION_CLOSED"))}getStats(v){const M=y=>(Object.prototype.toString.call(y.values)==="[object Array]"&&y.values.forEach(k=>{Object.assign(y,k)}),y);this._pc.getStats.length===0||this._isReactNativeWebrtc?this._pc.getStats().then(y=>{const k=[];y.forEach(S=>{k.push(M(S))}),v(null,k)},y=>v(y)):0{if(this.destroyed)return;const k=[];y.result().forEach(S=>{const C={};S.names().forEach(R=>{C[R]=S.stat(R)}),C.id=S.id,C.type=S.type,C.timestamp=S.timestamp,k.push(M(C))}),v(null,k)},y=>v(y)):v(null,[])}_maybeReady(){if(this._debug("maybeReady pc %s channel %s",this._pcReady,this._channelReady),this._connected||this._connecting||!this._pcReady||!this._channelReady)return;this._connecting=!0;const v=()=>{this.destroyed||this.getStats((M,y)=>{if(this.destroyed)return;M&&(y=[]);const k={},S={},C={};let R=!1;y.forEach(E=>{(E.type==="remotecandidate"||E.type==="remote-candidate")&&(k[E.id]=E),(E.type==="localcandidate"||E.type==="local-candidate")&&(S[E.id]=E),(E.type==="candidatepair"||E.type==="candidate-pair")&&(C[E.id]=E)});const T=E=>{R=!0;let B=S[E.localCandidateId];B&&(B.ip||B.address)?(this.localAddress=B.ip||B.address,this.localPort=+B.port):B&&B.ipAddress?(this.localAddress=B.ipAddress,this.localPort=+B.portNumber):typeof E.googLocalAddress=="string"&&(B=E.googLocalAddress.split(":"),this.localAddress=B[0],this.localPort=+B[1]),this.localAddress&&(this.localFamily=this.localAddress.includes(":")?"IPv6":"IPv4");let N=k[E.remoteCandidateId];N&&(N.ip||N.address)?(this.remoteAddress=N.ip||N.address,this.remotePort=+N.port):N&&N.ipAddress?(this.remoteAddress=N.ipAddress,this.remotePort=+N.portNumber):typeof E.googRemoteAddress=="string"&&(N=E.googRemoteAddress.split(":"),this.remoteAddress=N[0],this.remotePort=+N[1]),this.remoteAddress&&(this.remoteFamily=this.remoteAddress.includes(":")?"IPv6":"IPv4"),this._debug("connect local: %s:%s remote: %s:%s",this.localAddress,this.localPort,this.remoteAddress,this.remotePort)};if(y.forEach(E=>{E.type==="transport"&&E.selectedCandidatePairId&&T(C[E.selectedCandidatePairId]),(E.type==="googCandidatePair"&&E.googActiveConnection==="true"||(E.type==="candidatepair"||E.type==="candidate-pair")&&E.selected)&&T(E)}),!R&&(!Object.keys(C).length||Object.keys(S).length))return void setTimeout(v,100);if(this._connecting=!1,this._connected=!0,this._chunk){try{this.send(this._chunk)}catch(B){return this.destroy(h(B,"ERR_DATA_CHANNEL"))}this._chunk=null,this._debug('sent chunk from "write before connect"');const E=this._cb;this._cb=null,E(null)}typeof this._channel.bufferedAmountLowThreshold!="number"&&(this._interval=setInterval(()=>this._onInterval(),150),this._interval.unref&&this._interval.unref()),this._debug("connect"),this.emit("connect")})};v()}_onInterval(){this._cb&&this._channel&&!(this._channel.bufferedAmount>z)&&this._onChannelBufferedAmountLow()}_onSignalingStateChange(){this.destroyed||(this._pc.signalingState==="stable"&&(this._isNegotiating=!1,this._debug("flushing sender queue",this._sendersAwaitingStable),this._sendersAwaitingStable.forEach(v=>{this._pc.removeTrack(v),this._queuedNegotiation=!0}),this._sendersAwaitingStable=[],this._queuedNegotiation?(this._debug("flushing negotiation queue"),this._queuedNegotiation=!1,this._needsNegotiation()):(this._debug("negotiated"),this.emit("negotiated"))),this._debug("signalingStateChange %s",this._pc.signalingState),this.emit("signalingStateChange",this._pc.signalingState))}_onIceCandidate(v){this.destroyed||(v.candidate&&this.trickle?this.emit("signal",{type:"candidate",candidate:{candidate:v.candidate.candidate,sdpMLineIndex:v.candidate.sdpMLineIndex,sdpMid:v.candidate.sdpMid}}):!v.candidate&&!this._iceComplete&&(this._iceComplete=!0,this.emit("_iceComplete")),v.candidate&&this._startIceCompleteTimeout())}_onChannelMessage(v){if(this.destroyed)return;let M=v.data;M instanceof ArrayBuffer&&(M=g.from(M)),this.push(M)}_onChannelBufferedAmountLow(){if(!this.destroyed&&this._cb){this._debug("ending backpressure: bufferedAmount %d",this._channel.bufferedAmount);const v=this._cb;this._cb=null,v(null)}}_onChannelOpen(){this._connected||this.destroyed||(this._debug("on channel open"),this._channelReady=!0,this._maybeReady())}_onChannelClose(){this.destroyed||(this._debug("on channel close"),this.destroy())}_onTrack(v){this.destroyed||v.streams.forEach(M=>{this._debug("on track"),this.emit("track",v.track,M),this._remoteTracks.push({track:v.track,stream:M}),this._remoteStreams.some(y=>y.id===M.id)||(this._remoteStreams.push(M),b(()=>{this._debug("on stream"),this.emit("stream",M)}))})}_debug(){const v=[].slice.call(arguments);v[0]="["+this._id+"] "+v[0],u.apply(null,v)}}A.WEBRTC_SUPPORT=!!d(),A.config={iceServers:[{urls:["stun:stun.l.google.com:19302","stun:global.stun.twilio.com:3478"]}],sdpSemantics:"unified-plan"},A.channelConfig={},i.exports=A},{buffer:3,debug:4,"err-code":6,"get-browser-rtc":8,"queue-microtask":13,randombytes:14,"readable-stream":29}]},{},[])("/")})}(DS)),DS.exports}var ANe=yNe();const vNe=Zr(ANe),CB=0,qB=1,Ese=2,Wse=(e,t)=>{sn(e,CB);const n=G8e(t);Pr(e,n)},Nse=(e,t,n)=>{sn(e,qB),Pr(e,OB(t,n))},xNe=(e,t,n)=>Nse(t,n,w0(e)),Bse=(e,t,n)=>{try{J1e(t,w0(e),n)}catch(o){console.error("Caught error while handling a Yjs update",o)}},wNe=(e,t)=>{sn(e,Ese),Pr(e,t)},_Ne=Bse,kNe=(e,t,n,o)=>{const r=_n(e);switch(r){case CB:xNe(e,t,n);break;case qB:Bse(e,n,o);break;case Ese:_Ne(e,n,o);break;default:throw new Error("Unknown message type")}return r},FS=3e4;class SNe extends d3{constructor(t){super(),this.doc=t,this.clientID=t.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{const n=Tl();this.getLocalState()!==null&&FS/2<=n-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const o=[];this.meta.forEach((r,s)=>{s!==this.clientID&&FS<=n-r.lastUpdated&&this.states.has(s)&&o.push(s)}),o.length>0&&IE(this,o,"timeout")},Oc(FS/10)),t.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(t){const n=this.clientID,o=this.meta.get(n),r=o===void 0?0:o.clock+1,s=this.states.get(n);t===null?this.states.delete(n):this.states.set(n,t),this.meta.set(n,{clock:r,lastUpdated:Tl()});const i=[],c=[],l=[],u=[];t===null?u.push(n):s==null?t!=null&&i.push(n):(c.push(n),yM(s,t)||l.push(n)),(i.length>0||l.length>0||u.length>0)&&this.emit("change",[{added:i,updated:l,removed:u},"local"]),this.emit("update",[{added:i,updated:c,removed:u},"local"])}setLocalStateField(t,n){const o=this.getLocalState();o!==null&&this.setLocalState({...o,[t]:n})}getStates(){return this.states}}const IE=(e,t,n)=>{const o=[];for(let r=0;r0&&(e.emit("change",[{added:[],updated:[],removed:o},n]),e.emit("update",[{added:[],updated:[],removed:o},n]))},F4=(e,t,n=e.states)=>{const o=t.length,r=k0();sn(r,o);for(let s=0;s{const o=Rc(t),r=Tl(),s=[],i=[],c=[],l=[],u=_n(o);for(let d=0;d0||c.length>0||l.length>0)&&e.emit("change",[{added:s,updated:c,removed:l},n]),(s.length>0||i.length>0||l.length>0)&&e.emit("update",[{added:s,updated:i,removed:l},n])},qNe=(e,t)=>{const n=CE(e).buffer,o=CE(t).buffer;return crypto.subtle.importKey("raw",n,"PBKDF2",!1,["deriveKey"]).then(r=>crypto.subtle.deriveKey({name:"PBKDF2",salt:o,iterations:1e5,hash:"SHA-256"},r,{name:"AES-GCM",length:256},!0,["encrypt","decrypt"]))},Lse=(e,t)=>{if(!t)return uB(e);const n=crypto.getRandomValues(new Uint8Array(12));return crypto.subtle.encrypt({name:"AES-GCM",iv:n},t,e).then(o=>{const r=k0();return uc(r,"AES-GCM"),Pr(r,n),Pr(r,new Uint8Array(o)),kr(r)})},RNe=(e,t)=>{const n=k0();return th(n,e),Lse(kr(n),t)},Pse=(e,t)=>{if(!t)return uB(e);const n=Rc(e);yl(n)!=="AES-GCM"&&DEe(fa("Unknown encryption algorithm"));const r=w0(n),s=w0(n);return crypto.subtle.decrypt({name:"AES-GCM",iv:r},t,s).then(i=>new Uint8Array(i))},jse=(e,t)=>Pse(e,t).then(n=>nh(Rc(new Uint8Array(n)))),R0=R8e("y-webrtc"),T2=0,Ise=3,ZM=1,RB=4,QM=new Map,pc=new Map,Dse=e=>{let t=!0;e.webrtcConns.forEach(n=>{n.synced||(t=!1)}),(!t&&e.synced||t&&!e.synced)&&(e.synced=t,e.provider.emit("synced",[{synced:t}]),R0("synced ",ki,e.name,bf," with all peers"))},Fse=(e,t,n)=>{const o=Rc(t),r=k0(),s=_n(o);if(e===void 0)return null;const i=e.awareness,c=e.doc;let l=!1;switch(s){case T2:{sn(r,T2);const u=kNe(o,r,c,e);u===qB&&!e.synced&&n(),u===CB&&(l=!0);break}case Ise:sn(r,ZM),Pr(r,F4(i,Array.from(i.getStates().keys()))),l=!0;break;case ZM:CNe(i,w0(o),e);break;case RB:{const u=ff(o)===1,d=yl(o);if(d!==e.peerId&&(e.bcConns.has(d)&&!u||!e.bcConns.has(d)&&u)){const p=[],f=[];u?(e.bcConns.add(d),f.push(d)):(e.bcConns.delete(d),p.push(d)),e.provider.emit("peers",[{added:f,removed:p,webrtcPeers:Array.from(e.webrtcConns.keys()),bcPeers:Array.from(e.bcConns)}]),$se(e)}break}default:return console.error("Unable to compute message"),r}return l?r:null},TNe=(e,t)=>{const n=e.room;return R0("received message from ",ki,e.remotePeerId,hB," (",n.name,")",bf,D5),Fse(n,t,()=>{e.synced=!0,R0("synced ",ki,n.name,bf," with ",ki,e.remotePeerId),Dse(n)})},$S=(e,t)=>{R0("send message to ",ki,e.remotePeerId,bf,hB," (",e.room.name,")",D5);try{e.peer.send(kr(t))}catch{}},ENe=(e,t)=>{R0("broadcast message in ",ki,e.name,bf),e.webrtcConns.forEach(n=>{try{n.peer.send(t)}catch{}})};class $4{constructor(t,n,o,r){R0("establishing connection to ",ki,o),this.room=r,this.remotePeerId=o,this.glareToken=void 0,this.closed=!1,this.connected=!1,this.synced=!1,this.peer=new vNe({initiator:n,...r.provider.peerOpts}),this.peer.on("signal",s=>{this.glareToken===void 0&&(this.glareToken=Date.now()+Math.random()),U5(t,r,{to:o,from:r.peerId,type:"signal",token:this.glareToken,signal:s})}),this.peer.on("connect",()=>{R0("connected to ",ki,o),this.connected=!0;const i=r.provider.doc,c=r.awareness,l=k0();sn(l,T2),Wse(l,i),$S(this,l);const u=c.getStates();if(u.size>0){const d=k0();sn(d,ZM),Pr(d,F4(c,Array.from(u.keys()))),$S(this,d)}}),this.peer.on("close",()=>{this.connected=!1,this.closed=!0,r.webrtcConns.has(this.remotePeerId)&&(r.webrtcConns.delete(this.remotePeerId),r.provider.emit("peers",[{removed:[this.remotePeerId],added:[],webrtcPeers:Array.from(r.webrtcConns.keys()),bcPeers:Array.from(r.bcConns)}])),Dse(r),this.peer.destroy(),R0("closed connection to ",ki,o),DE(r)}),this.peer.on("error",s=>{R0("Error in connection to ",ki,o,": ",s),DE(r)}),this.peer.on("data",s=>{const i=TNe(this,s);i!==null&&$S(this,i)})}destroy(){this.peer.destroy()}}const Du=(e,t)=>Lse(t,e.key).then(n=>e.mux(()=>zNe(e.name,n))),LU=(e,t)=>{e.bcconnected&&Du(e,t),ENe(e,t)},DE=e=>{QM.forEach(t=>{t.connected&&(t.send({type:"subscribe",topics:[e.name]}),e.webrtcConns.size{if(e.provider.filterBcConns){const t=k0();sn(t,RB),UM(t,1),uc(t,e.peerId),Du(e,kr(t))}};class WNe{constructor(t,n,o,r){this.peerId=O1e(),this.doc=t,this.awareness=n.awareness,this.provider=n,this.synced=!1,this.name=o,this.key=r,this.webrtcConns=new Map,this.bcConns=new Set,this.mux=ONe(),this.bcconnected=!1,this._bcSubscriber=s=>Pse(new Uint8Array(s),r).then(i=>this.mux(()=>{const c=Fse(this,i,()=>{});c&&Du(this,kr(c))})),this._docUpdateHandler=(s,i)=>{const c=k0();sn(c,T2),wNe(c,s),LU(this,kr(c))},this._awarenessUpdateHandler=({added:s,updated:i,removed:c},l)=>{const u=s.concat(i).concat(c),d=k0();sn(d,ZM),Pr(d,F4(this.awareness,u)),LU(this,kr(d))},this._beforeUnloadHandler=()=>{IE(this.awareness,[t.clientID],"window unload"),pc.forEach(s=>{s.disconnect()})},typeof window<"u"?window.addEventListener("beforeunload",this._beforeUnloadHandler):typeof Oi<"u"&&Oi.on("exit",this._beforeUnloadHandler)}connect(){this.doc.on("update",this._docUpdateHandler),this.awareness.on("update",this._awarenessUpdateHandler),DE(this);const t=this.name;gNe(t,this._bcSubscriber),this.bcconnected=!0,$se(this);const n=k0();sn(n,T2),Wse(n,this.doc),Du(this,kr(n));const o=k0();sn(o,T2),Nse(o,this.doc),Du(this,kr(o));const r=k0();sn(r,Ise),Du(this,kr(r));const s=k0();sn(s,ZM),Pr(s,F4(this.awareness,[this.doc.clientID])),Du(this,kr(s))}disconnect(){QM.forEach(n=>{n.connected&&n.send({type:"unsubscribe",topics:[this.name]})}),IE(this.awareness,[this.doc.clientID],"disconnect");const t=k0();sn(t,RB),UM(t,0),uc(t,this.peerId),Du(this,kr(t)),MNe(this.name,this._bcSubscriber),this.bcconnected=!1,this.doc.off("update",this._docUpdateHandler),this.awareness.off("update",this._awarenessUpdateHandler),this.webrtcConns.forEach(n=>n.destroy())}destroy(){this.disconnect(),typeof window<"u"?window.removeEventListener("beforeunload",this._beforeUnloadHandler):typeof Oi<"u"&&Oi.off("exit",this._beforeUnloadHandler)}}const NNe=(e,t,n,o)=>{if(pc.has(n))throw fa(`A Yjs Doc connected to room "${n}" already exists!`);const r=new WNe(e,t,n,o);return pc.set(n,r),r},U5=(e,t,n)=>{t.key?RNe(n,t.key).then(o=>{e.send({type:"publish",topic:t.name,data:B1e(o)})}):e.send({type:"publish",topic:t.name,data:n})};class Vse extends bNe{constructor(t){super(t),this.providers=new Set,this.on("connect",()=>{R0(`connected (${t})`);const n=Array.from(pc.keys());this.send({type:"subscribe",topics:n}),pc.forEach(o=>U5(this,o,{type:"announce",from:o.peerId}))}),this.on("message",n=>{switch(n.type){case"publish":{const o=n.topic,r=pc.get(o);if(r==null||typeof o!="string")return;const s=i=>{const c=r.webrtcConns,l=r.peerId;if(i==null||i.from===l||i.to!==void 0&&i.to!==l||r.bcConns.has(i.from))return;const u=c.has(i.from)?()=>{}:()=>r.provider.emit("peers",[{removed:[],added:[i.from],webrtcPeers:Array.from(r.webrtcConns.keys()),bcPeers:Array.from(r.bcConns)}]);switch(i.type){case"announce":c.sizenew $4(this,!0,i.from,r)),u());break;case"signal":if(i.signal.type==="offer"){const d=c.get(i.from);if(d){const p=i.token,f=d.glareToken;if(f&&f>p){R0("offer rejected: ",i.from);return}d.glareToken=void 0}}if(i.signal.type==="answer"){R0("offer answered by: ",i.from);const d=c.get(i.from);d.glareToken=void 0}i.to===l&&(_1(c,i.from,()=>new $4(this,!1,i.from,r)).peer.signal(i.signal),u());break}};r.key?typeof n.data=="string"&&jse(bB(n.data),r.key).then(s):s(n.data)}}}),this.on("disconnect",()=>R0(`disconnect (${t})`))}}class BNe extends d3{constructor(t,n,{signaling:o=["wss://y-webrtc-eu.fly.dev"],password:r=null,awareness:s=new SNe(n),maxConns:i=20+Oc(jEe()*15),filterBcConns:c=!0,peerOpts:l={}}={}){super(),this.roomName=t,this.doc=n,this.filterBcConns=c,this.awareness=s,this.shouldConnect=!1,this.signalingUrls=o,this.signalingConns=[],this.maxConns=i,this.peerOpts=l,this.key=r?qNe(r,t):uB(null),this.room=null,this.key.then(u=>{this.room=NNe(n,this,t,u),this.shouldConnect?this.room.connect():this.room.disconnect()}),this.connect(),this.destroy=this.destroy.bind(this),n.on("destroy",this.destroy)}get connected(){return this.room!==null&&this.shouldConnect}connect(){this.shouldConnect=!0,this.signalingUrls.forEach(t=>{const n=_1(QM,t,()=>new Vse(t));this.signalingConns.push(n),n.providers.add(this)}),this.room&&this.room.connect()}disconnect(){this.shouldConnect=!1,this.signalingConns.forEach(t=>{t.providers.delete(this),t.providers.size===0&&(t.destroy(),QM.delete(t.url))}),this.room&&this.room.disconnect()}destroy(){this.doc.off("destroy",this.destroy),this.key.then(()=>{this.room.destroy(),pc.delete(this.roomName)}),super.destroy()}}function LNe(e,t){e.on("connect",()=>{R0(`connected (${t})`);const n=Array.from(pc.keys());e.send({type:"subscribe",topics:n}),pc.forEach(o=>U5(e,o,{type:"announce",from:o.peerId}))}),e.on("message",n=>{switch(n.type){case"publish":{const o=n.topic,r=pc.get(o);if(r===null||typeof o!="string"||r===void 0)return;const s=i=>{const c=r.webrtcConns,l=r.peerId;if(i===null||i.from===l||i.to!==void 0&&i.to!==l||r.bcConns.has(i.from))return;const u=c.has(i.from)?()=>{}:()=>r.provider.emit("peers",[{removed:[],added:[i.from],webrtcPeers:Array.from(r.webrtcConns.keys()),bcPeers:Array.from(r.bcConns)}]);switch(i.type){case"announce":c.sizenew $4(e,!0,i.from,r)),u());break;case"signal":if(i.signal.type==="offer"){const d=c.get(i.from);if(d){const p=i.token,f=d.glareToken;if(f&&f>p){R0("offer rejected: ",i.from);return}d.glareToken=void 0}}if(i.signal.type==="answer"){R0("offer answered by: ",i.from);const d=c.get(i.from);d&&(d.glareToken=void 0)}i.to===l&&(_1(c,i.from,()=>new $4(e,!1,i.from,r)).peer.signal(i.signal),u());break}};r.key?typeof n.data=="string"&&jse(bB(n.data),r.key).then(s):s(n.data)}}}),e.on("disconnect",()=>R0(`disconnect (${t})`))}function PU(e){if(e.shouldConnect&&e.ws===null){const t=Math.floor(1e5+Math.random()*9e5),n=e.url,o=new window.EventSource(tn(n,{subscriber_id:t,action:"gutenberg_signaling_server"}));let r=null;o.onmessage=l=>{e.lastMessageReceived=Date.now();const u=l.data;if(u){const d=JSON.parse(u);Array.isArray(d)&&d.forEach(s)}},e.ws=o,e.connecting=!0,e.connected=!1;const s=l=>{l&&l.type==="pong"&&(clearTimeout(r),r=setTimeout(c,V4/2)),e.emit("message",[l,e])},i=l=>{e.ws!==null&&(e.ws.close(),e.ws=null,e.connecting=!1,e.connected?(e.connected=!1,e.emit("disconnect",[{type:"disconnect",error:l},e])):e.unsuccessfulReconnects++),clearTimeout(r)},c=()=>{e.ws&&e.ws.readyState===window.EventSource.OPEN&&e.send({type:"ping"})};e.ws&&(e.ws.onclose=()=>{i(null)},e.ws.send=function(u){window.fetch(n,{body:new URLSearchParams({subscriber_id:t.toString(),action:"gutenberg_signaling_server",message:u}),method:"POST"}).catch(()=>{R0("Error sending to server with message: "+u)})}),o.onerror=()=>{},o.onopen=()=>{e.connected||o.readyState===window.EventSource.OPEN&&(e.lastMessageReceived=Date.now(),e.connecting=!1,e.connected=!0,e.unsuccessfulReconnects=0,e.emit("connect",[{type:"connect"},e]),r=setTimeout(c,V4/2))}}}const V4=3e4;class PNe extends d3{constructor(t){super(),this.url=t,this.ws=null,this.binaryType=null,this.connected=!1,this.connecting=!1,this.unsuccessfulReconnects=0,this.lastMessageReceived=0,this.shouldConnect=!0,this._checkInterval=setInterval(()=>{this.connected&&V4{const n=_1(QM,t,t.startsWith("ws://")||t.startsWith("wss://")?()=>new Vse(t):()=>new PNe(t));this.signalingConns.push(n),n.providers.add(this)}),this.room&&this.room.connect()}}function INe({signaling:e,password:t}){return function(n,o,r){const s=`${o}-${n}`;return new jNe(s,r,{signaling:e,password:t}),Promise.resolve(()=>!0)}}const DNe=(e,t)=>{const n={},o={},r={};function s(u,d){n[u]=d}async function i(u,d,p){const f=new $h;r[u]=r[u]||{},r[u][d]=f;const b=()=>{const z=n[u].fromCRDTDoc(f);p(z)};f.on("update",b);const h=await e(d,u,f);t&&await t(d,u,f);const g=n[u].fetch;g&&g(d).then(z=>{f.transact(()=>{n[u].applyChangesToDoc(f,z)})}),o[u]=o[u]||{},o[u][d]=()=>{h(),f.off("update",b)}}async function c(u,d,p){const f=r[u][d];if(!f)throw"Error doc "+u+" "+d+" not found";f.transact(()=>{n[u].applyChangesToDoc(f,p)})}async function l(u,d){o?.[u]?.[d]&&o[u][d]()}return{register:s,bootstrap:i,update:c,discard:l}};let VS;function FE(){return VS||(VS=DNe(dNe,INe({signaling:[window?.wp?.ajax?.settings?.url],password:window?.__experimentalCollaborativeEditingSecret}))),VS}function FNe(e,t){return{type:"RECEIVE_USER_QUERY",users:Array.isArray(t)?t:[t],queryID:e}}function $Ne(e){return{type:"RECEIVE_CURRENT_USER",currentUser:e}}function VNe(e){return{type:"ADD_ENTITIES",entities:e}}function HNe(e,t,n,o,r=!1,s,i){e==="postType"&&(n=(Array.isArray(n)?n:[n]).map(l=>l.status==="auto-draft"?{...l,title:""}:l));let c;return o?c=RCe(n,o,s,i):c=E0e(n,s,i),{...c,kind:e,name:t,invalidateCache:r}}function UNe(e){return{type:"RECEIVE_CURRENT_THEME",currentTheme:e}}function XNe(e){return{type:"RECEIVE_CURRENT_GLOBAL_STYLES_ID",id:e}}function GNe(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLES",stylesheet:e,globalStyles:t}}function KNe(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS",stylesheet:e,variations:t}}function YNe(){return Ke("wp.data.dispatch( 'core' ).receiveThemeSupports",{since:"5.9"}),{type:"DO_NOTHING"}}function ZNe(e,t){return Ke("wp.data.dispatch( 'core' ).receiveThemeGlobalStyleRevisions()",{since:"6.5.0",alternative:"wp.data.dispatch( 'core' ).receiveRevisions"}),{type:"RECEIVE_THEME_GLOBAL_STYLE_REVISIONS",currentId:e,revisions:t}}function QNe(e,t){return{type:"RECEIVE_EMBED_PREVIEW",url:e,preview:t}}const Hse=(e,t,n,o,{__unstableFetch:r=Wt,throwOnError:s=!1}={})=>async({dispatch:i,resolveSelect:c})=>{const u=(await c.getEntitiesConfig(e)).find(b=>b.kind===e&&b.name===t);let d,p=!1;if(!u)return;const f=await i.__unstableAcquireStoreLock(No,["entities","records",e,t,n],{exclusive:!0});try{i({type:"DELETE_ENTITY_RECORD_START",kind:e,name:t,recordId:n});let b=!1;try{let h=`${u.baseURL}/${n}`;o&&(h=tn(h,o)),p=await r({path:h,method:"DELETE"}),await i(qCe(e,t,n,!0))}catch(h){b=!0,d=h}if(i({type:"DELETE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:n,error:d}),b&&s)throw d;return p}finally{i.__unstableReleaseStoreLock(f)}},JNe=(e,t,n,o,r={})=>({select:s,dispatch:i})=>{const c=s.getEntityConfig(e,t);if(!c)throw new Error(`The entity being edited (${e}, ${t}) does not have a loaded config.`);const{mergedEdits:l={}}=c,u=s.getRawEntityRecord(e,t,n),d=s.getEditedEntityRecord(e,t,n),p={kind:e,name:t,recordId:n,edits:Object.keys(o).reduce((f,b)=>{const h=u[b],g=d[b],z=l[b]?{...g,...o[b]}:o[b];return f[b]=N0(h,z)?void 0:z,f},{})};if(window.__experimentalEnableSync&&c.syncConfig){if(globalThis.IS_GUTENBERG_PLUGIN){const f=c.getSyncObjectId(n);FE().update(c.syncObjectType+"--edit",f,p.edits)}}else r.undoIgnore||s.getUndoManager().addRecord([{id:{kind:e,name:t,recordId:n},changes:Object.keys(o).reduce((f,b)=>(f[b]={from:d[b],to:o[b]},f),{})}],r.isCached),i({type:"EDIT_ENTITY_RECORD",...p})},eBe=()=>({select:e,dispatch:t})=>{const n=e.getUndoManager().undo();n&&t({type:"UNDO",record:n})},tBe=()=>({select:e,dispatch:t})=>{const n=e.getUndoManager().redo();n&&t({type:"REDO",record:n})},nBe=()=>({select:e})=>{e.getUndoManager().addRecord()},Use=(e,t,n,{isAutosave:o=!1,__unstableFetch:r=Wt,throwOnError:s=!1}={})=>async({select:i,resolveSelect:c,dispatch:l})=>{const d=(await c.getEntitiesConfig(e)).find(h=>h.kind===e&&h.name===t);if(!d)return;const p=d.key||e1,f=n[p],b=await l.__unstableAcquireStoreLock(No,["entities","records",e,t,f||Is()],{exclusive:!0});try{for(const[A,_]of Object.entries(n))if(typeof _=="function"){const v=_(i.getEditedEntityRecord(e,t,f));l.editEntityRecord(e,t,f,{[A]:v},{undoIgnore:!0}),n[A]=v}l({type:"SAVE_ENTITY_RECORD_START",kind:e,name:t,recordId:f,isAutosave:o});let h,g,z=!1;try{const A=`${d.baseURL}${f?"/"+f:""}`,_=i.getRawEntityRecord(e,t,f);if(o){const v=i.getCurrentUser(),M=v?v.id:void 0,y=await c.getAutosave(_.type,_.id,M);let k={..._,...y,...n};if(k=Object.keys(k).reduce((S,C)=>(["title","excerpt","content","meta"].includes(C)&&(S[C]=k[C]),S),{status:k.status==="auto-draft"?"draft":void 0}),h=await r({path:`${A}/autosaves`,method:"POST",data:k}),_.id===h.id){let S={..._,...k,...h};S=Object.keys(S).reduce((C,R)=>(["title","excerpt","content"].includes(R)?C[R]=S[R]:R==="status"?C[R]=_.status==="auto-draft"&&S.status==="draft"?S.status:_.status:C[R]=_[R],C),{}),l.receiveEntityRecords(e,t,S,void 0,!0)}else l.receiveAutosaves(_.id,h)}else{let v=n;d.__unstablePrePersist&&(v={...v,...d.__unstablePrePersist(_,v)}),h=await r({path:A,method:f?"PUT":"POST",data:v}),l.receiveEntityRecords(e,t,h,void 0,!0,v)}}catch(A){z=!0,g=A}if(l({type:"SAVE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:f,error:g,isAutosave:o}),z&&s)throw g;return h}finally{l.__unstableReleaseStoreLock(b)}},oBe=e=>async({dispatch:t})=>{const n=nEe(),o={saveEntityRecord(i,c,l,u){return n.add(d=>t.saveEntityRecord(i,c,l,{...u,__unstableFetch:d}))},saveEditedEntityRecord(i,c,l,u){return n.add(d=>t.saveEditedEntityRecord(i,c,l,{...u,__unstableFetch:d}))},deleteEntityRecord(i,c,l,u,d){return n.add(p=>t.deleteEntityRecord(i,c,l,u,{...d,__unstableFetch:p}))}},r=e.map(i=>i(o)),[,...s]=await Promise.all([n.run(),...r]);return s},rBe=(e,t,n,o)=>async({select:r,dispatch:s,resolveSelect:i})=>{if(!r.hasEditsForEntityRecord(e,t,n))return;const l=(await i.getEntitiesConfig(e)).find(f=>f.kind===e&&f.name===t);if(!l)return;const u=l.key||e1,d=r.getEntityRecordNonTransientEdits(e,t,n),p={[u]:n,...d};return await s.saveEntityRecord(e,t,p,o)},sBe=(e,t,n,o,r)=>async({select:s,dispatch:i,resolveSelect:c})=>{if(!s.hasEditsForEntityRecord(e,t,n))return;const l=s.getEntityRecordNonTransientEdits(e,t,n),u={};for(const b of o)q5(u,b,SCe(l,b));const f=(await c.getEntitiesConfig(e)).find(b=>b.kind===e&&b.name===t)?.key||e1;return n&&(u[f]=n),await i.saveEntityRecord(e,t,u,r)};function iBe(e){return Ke("wp.data.dispatch( 'core' ).receiveUploadPermissions",{since:"5.9",alternative:"receiveUserPermission"}),Xse("create/media",e)}function Xse(e,t){return{type:"RECEIVE_USER_PERMISSION",key:e,isAllowed:t}}function aBe(e){return{type:"RECEIVE_USER_PERMISSIONS",permissions:e}}function cBe(e,t){return{type:"RECEIVE_AUTOSAVES",postId:e,autosaves:Array.isArray(t)?t:[t]}}function lBe(e){return{type:"RECEIVE_NAVIGATION_FALLBACK_ID",fallbackId:e}}function uBe(e,t){return{type:"RECEIVE_DEFAULT_TEMPLATE",query:e,templateId:t}}const dBe=(e,t,n,o,r,s=!1,i)=>async({dispatch:c,resolveSelect:l})=>{const d=(await l.getEntitiesConfig(e)).find(f=>f.kind===e&&f.name===t),p=d&&d?.revisionKey?d.revisionKey:e1;c({type:"RECEIVE_ITEM_REVISIONS",key:p,items:Array.isArray(o)?o:[o],recordKey:n,meta:i,query:r,kind:e,name:t,invalidateCache:s})},pBe=Object.freeze(Object.defineProperty({__proto__:null,__experimentalBatch:oBe,__experimentalReceiveCurrentGlobalStylesId:XNe,__experimentalReceiveThemeBaseGlobalStyles:GNe,__experimentalReceiveThemeGlobalStyleVariations:KNe,__experimentalSaveSpecifiedEntityEdits:sBe,__unstableCreateUndoLevel:nBe,addEntities:VNe,deleteEntityRecord:Hse,editEntityRecord:JNe,receiveAutosaves:cBe,receiveCurrentTheme:UNe,receiveCurrentUser:$Ne,receiveDefaultTemplateId:uBe,receiveEmbedPreview:QNe,receiveEntityRecords:HNe,receiveNavigationFallbackId:lBe,receiveRevisions:dBe,receiveThemeGlobalStyleRevisions:ZNe,receiveThemeSupports:YNe,receiveUploadPermissions:iBe,receiveUserPermission:Xse,receiveUserPermissions:aBe,receiveUserQuery:FNe,redo:tBe,saveEditedEntityRecord:rBe,saveEntityRecord:Use,undo:eBe},Symbol.toStringTag,{value:"Module"}));function fBe(e,t){return{type:"RECEIVE_REGISTERED_POST_META",postType:e,registeredPostMeta:t}}const bBe=Object.freeze(Object.defineProperty({__proto__:null,receiveRegisteredPostMeta:fBe},Symbol.toStringTag,{value:"Module"}));let $b;function Lt(e){if(typeof e!="string"||e.indexOf("&")===-1)return e;$b===void 0&&(document.implementation&&document.implementation.createHTMLDocument?$b=document.implementation.createHTMLDocument("").createElement("textarea"):$b=document.createElement("textarea")),$b.innerHTML=e;const t=$b.textContent;return $b.innerHTML="",t}async function hBe(e,t={},n={}){const o=t.isInitialSuggestions&&t.initialSuggestionsSearchOptions?{...t,...t.initialSuggestionsSearchOptions}:t,{type:r,subtype:s,page:i,perPage:c=t.isInitialSuggestions?3:20}=o,{disablePostFormats:l=!1}=n,u=[];(!r||r==="post")&&u.push(Wt({path:tn("/wp/v2/search",{search:e,page:i,per_page:c,type:"post",subtype:s})}).then(f=>f.map(b=>({id:b.id,url:b.url,title:Lt(b.title||"")||m("(no title)"),type:b.subtype||b.type,kind:"post-type"}))).catch(()=>[])),(!r||r==="term")&&u.push(Wt({path:tn("/wp/v2/search",{search:e,page:i,per_page:c,type:"term",subtype:s})}).then(f=>f.map(b=>({id:b.id,url:b.url,title:Lt(b.title||"")||m("(no title)"),type:b.subtype||b.type,kind:"taxonomy"}))).catch(()=>[])),!l&&(!r||r==="post-format")&&u.push(Wt({path:tn("/wp/v2/search",{search:e,page:i,per_page:c,type:"post-format",subtype:s})}).then(f=>f.map(b=>({id:b.id,url:b.url,title:Lt(b.title||"")||m("(no title)"),type:b.subtype||b.type,kind:"taxonomy"}))).catch(()=>[])),(!r||r==="attachment")&&u.push(Wt({path:tn("/wp/v2/media",{search:e,page:i,per_page:c})}).then(f=>f.map(b=>({id:b.id,url:b.source_url,title:Lt(b.title.rendered||"")||m("(no title)"),type:b.type,kind:"media"}))).catch(()=>[]));let p=(await Promise.all(u)).flat();return p=p.filter(f=>!!f.id),p=mBe(p,e),p=p.slice(0,c),p}function mBe(e,t){const n=jU(t),o={};for(const r of e)if(r.title){const s=jU(r.title),i=s.filter(d=>n.some(p=>d===p)),c=s.filter(d=>n.some(p=>d!==p&&d.includes(p))),l=i.length/s.length*10,u=c.length/s.length;o[r.id]=l+u}else o[r.id]=0;return e.sort((r,s)=>o[s.id]-o[r.id])}function jU(e){return e.toLowerCase().match(/[\p{L}\p{N}]+/gu)||[]}const HS=new Map,gBe=async(e,t={})=>{const n="/wp-block-editor/v1/url-details",o={url:Df(e)};if(!If(e))return Promise.reject(`${e} is not a valid URL.`);const r=T5(e);return!r||!UN(r)||!r.startsWith("http")||!/^https?:\/\/[^\/\s]/i.test(e)?Promise.reject(`${e} does not have a valid protocol. URLs must be "http" based`):HS.has(e)?HS.get(e):Wt({path:tn(n,o),...t}).then(s=>(HS.set(e,s),s))};async function MBe(){const e=await Wt({path:"/wp/v2/block-patterns/patterns"});return e?e.map(t=>Object.fromEntries(Object.entries(t).map(([n,o])=>[SN(n),o]))):[]}const zBe=e=>async({dispatch:t})=>{const n=tn("/wp/v2/users/?who=authors&per_page=100",e),o=await Wt({path:n});t.receiveUserQuery(n,o)},OBe=()=>async({dispatch:e})=>{const t=await Wt({path:"/wp/v2/users/me"});e.receiveCurrentUser(t)},Gse=(e,t,n="",o)=>async({select:r,dispatch:s,registry:i,resolveSelect:c})=>{const u=(await c.getEntitiesConfig(e)).find(p=>p.name===t&&p.kind===e);if(!u)return;const d=await s.__unstableAcquireStoreLock(No,["entities","records",e,t,n],{exclusive:!1});try{if(window.__experimentalEnableSync&&u.syncConfig&&!o){if(globalThis.IS_GUTENBERG_PLUGIN){const p=u.getSyncObjectId(n);await FE().bootstrap(u.syncObjectType,p,f=>{s.receiveEntityRecords(e,t,f,o)}),await FE().bootstrap(u.syncObjectType+"--edit",p,f=>{s({type:"EDIT_ENTITY_RECORD",kind:e,name:t,recordId:n,edits:f,meta:{undo:void 0}})})}}else{o!==void 0&&o._fields&&(o={...o,_fields:[...new Set([...Md(o._fields)||[],u.key||e1])].join()});const p=tn(u.baseURL+(n?"/"+n:""),{...u.baseURLParams,...o});if(o!==void 0&&o._fields&&(o={...o,include:[n]},r.hasEntityRecords(e,t,o)))return;const f=await Wt({path:p,parse:!1}),b=await f.json(),h=HN(f.headers?.get("allow")),g=[],z={};for(const A of zM)z[R5(A,{kind:e,name:t,id:n})]=h[A],g.push([A,{kind:e,name:t,id:n}]);i.batch(()=>{s.receiveEntityRecords(e,t,b,o),s.receiveUserPermissions(z),s.finishResolutions("canUser",g)})}}finally{s.__unstableReleaseStoreLock(d)}},yBe=VN("getEntityRecord"),ABe=VN("getEntityRecord"),H4=(e,t,n={})=>async({dispatch:o,registry:r,resolveSelect:s})=>{const c=(await s.getEntitiesConfig(e)).find(p=>p.name===t&&p.kind===e);if(!c)return;const l=await o.__unstableAcquireStoreLock(No,["entities","records",e,t],{exclusive:!1}),u=c.key||e1;function d(p){return p.filter(f=>f?.[u]).map(f=>[e,t,f[u]])}try{n._fields&&(n={...n,_fields:[...new Set([...Md(n._fields)||[],c.key||e1])].join()});const p=tn(c.baseURL,{...c.baseURLParams,...n});let f=[],b;if(c.supportsPagination&&n.per_page!==-1){const h=await Wt({path:p,parse:!1});f=Object.values(await h.json()),b={totalItems:parseInt(h.headers.get("X-WP-Total")),totalPages:parseInt(h.headers.get("X-WP-TotalPages"))}}else if(n.per_page===-1&&n[T0e]===!0){let h=1,g;do{const z=await Wt({path:tn(p,{page:h,per_page:100}),parse:!1}),A=Object.values(await z.json());g=parseInt(z.headers.get("X-WP-TotalPages")),f.push(...A),r.batch(()=>{o.receiveEntityRecords(e,t,f,n),o.finishResolutions("getEntityRecord",d(A))}),h++}while(h<=g);b={totalItems:f.length,totalPages:1}}else f=Object.values(await Wt({path:p})),b={totalItems:f.length,totalPages:1};n._fields&&(f=f.map(h=>(n._fields.split(",").forEach(g=>{h.hasOwnProperty(g)||(h[g]=void 0)}),h))),r.batch(()=>{if(o.receiveEntityRecords(e,t,f,n,!1,void 0,b),!n?._fields&&!n.context){const h=f.filter(A=>A?.[u]).map(A=>({id:A[u],permissions:HN(A?._links?.self?.[0].targetHints.allow)})),g=[],z={};for(const A of h)for(const _ of zM)g.push([_,{kind:e,name:t,id:A.id}]),z[R5(_,{kind:e,name:t,id:A.id})]=A.permissions[_];o.receiveUserPermissions(z),o.finishResolutions("getEntityRecord",d(f)),o.finishResolutions("canUser",g)}o.__unstableReleaseStoreLock(l)})}catch{o.__unstableReleaseStoreLock(l)}};H4.shouldInvalidate=(e,t,n)=>(e.type==="RECEIVE_ITEMS"||e.type==="REMOVE_ITEMS")&&e.invalidateCache&&t===e.kind&&n===e.name;const vBe=()=>async({dispatch:e,resolveSelect:t})=>{const n=await t.getEntityRecords("root","theme",{status:"active"});e.receiveCurrentTheme(n[0])},xBe=VN("getCurrentTheme"),wBe=e=>async({dispatch:t})=>{try{const n=await Wt({path:tn("/oembed/1.0/proxy",{url:e})});t.receiveEmbedPreview(e,n)}catch{t.receiveEmbedPreview(e,!1)}},Kse=(e,t,n)=>async({dispatch:o,registry:r,resolveSelect:s})=>{if(!zM.includes(e))throw new Error(`'${e}' is not a valid action.`);const{hasStartedResolution:i}=r.select(No);for(const d of zM){if(d===e)continue;if(i("canUser",[d,t,n]))return}let c=null;if(typeof t=="object"){if(!t.kind||!t.name)throw new Error("The entity resource object is not valid.");const p=(await s.getEntitiesConfig(t.kind)).find(f=>f.name===t.name&&f.kind===t.kind);if(!p)return;c=p.baseURL+(t.id?"/"+t.id:"")}else c=`/wp/v2/${t}`+(n?"/"+n:"");let l;try{l=await Wt({path:c,method:"OPTIONS",parse:!1})}catch{return}const u=HN(l.headers?.get("allow"));r.batch(()=>{for(const d of zM){const p=R5(d,t,n);o.receiveUserPermission(p,u[d]),d!==e&&o.finishResolution("canUser",[d,t,n])}})},_Be=(e,t,n)=>async({dispatch:o})=>{await o(Kse("update",{kind:e,name:t,id:n}))},kBe=(e,t)=>async({dispatch:n,resolveSelect:o})=>{const{rest_base:r,rest_namespace:s="wp/v2",supports:i}=await o.getPostType(e);if(!i?.autosave)return;const c=await Wt({path:`/${s}/${r}/${t}/autosaves?context=edit`});c&&c.length&&n.receiveAutosaves(t,c)},SBe=(e,t)=>async({resolveSelect:n})=>{await n.getAutosaves(e,t)},CBe=()=>async({dispatch:e,resolveSelect:t})=>{const o=(await t.getEntityRecords("root","theme",{status:"active"}))?.[0]?._links?.["wp:user-global-styles"]?.[0]?.href;if(!o)return;const r=o.match(/\/(\d+)(?:\?|$)/),s=r?Number(r[1]):null;s&&e.__experimentalReceiveCurrentGlobalStylesId(s)},qBe=()=>async({resolveSelect:e,dispatch:t})=>{const n=await e.getCurrentTheme(),o=await Wt({path:`/wp/v2/global-styles/themes/${n.stylesheet}?context=view`});t.__experimentalReceiveThemeBaseGlobalStyles(n.stylesheet,o)},RBe=()=>async({resolveSelect:e,dispatch:t})=>{const n=await e.getCurrentTheme(),o=await Wt({path:`/wp/v2/global-styles/themes/${n.stylesheet}/variations?context=view`});t.__experimentalReceiveThemeGlobalStyleVariations(n.stylesheet,o)},Yse=()=>async({resolveSelect:e,dispatch:t})=>{const n=await e.__experimentalGetCurrentGlobalStylesId(),r=(n?await e.getEntityRecord("root","globalStyles",n):void 0)?._links?.["version-history"]?.[0]?.href;if(r){const i=(await Wt({url:r}))?.map(c=>Object.fromEntries(Object.entries(c).map(([l,u])=>[SN(l),u])));t.receiveThemeGlobalStyleRevisions(n,i)}};Yse.shouldInvalidate=e=>e.type==="SAVE_ENTITY_RECORD_FINISH"&&e.kind==="root"&&!e.error&&e.name==="globalStyles";const TBe=()=>async({dispatch:e})=>{const t=await MBe();e({type:"RECEIVE_BLOCK_PATTERNS",patterns:t})},EBe=()=>async({dispatch:e})=>{const t=await Wt({path:"/wp/v2/block-patterns/categories"});e({type:"RECEIVE_BLOCK_PATTERN_CATEGORIES",categories:t})},WBe=()=>async({dispatch:e,resolveSelect:t})=>{const o=(await t.getEntityRecords("taxonomy","wp_pattern_category",{per_page:-1,_fields:"id,name,description,slug",context:"view"}))?.map(r=>({...r,label:Lt(r.name),name:r.slug}))||[];e({type:"RECEIVE_USER_PATTERN_CATEGORIES",patternCategories:o})},NBe=()=>async({dispatch:e,select:t,registry:n})=>{const o=await Wt({path:tn("/wp-block-editor/v1/navigation-fallback",{_embed:!0})}),r=o?._embedded?.self;n.batch(()=>{if(e.receiveNavigationFallbackId(o?.id),!r)return;const i=!t.getEntityRecord("postType","wp_navigation",o.id);e.receiveEntityRecords("postType","wp_navigation",r,void 0,i),e.finishResolution("getEntityRecord",["postType","wp_navigation",o.id])})},BBe=e=>async({dispatch:t,registry:n,resolveSelect:o})=>{const r=await Wt({path:tn("/wp/v2/templates/lookup",e)});await o.getEntitiesConfig("postType"),r?.id&&n.batch(()=>{t.receiveDefaultTemplateId(e,r.id),t.receiveEntityRecords("postType","wp_template",[r]),t.finishResolution("getEntityRecord",["postType","wp_template",r.id])})},Zse=(e,t,n,o={})=>async({dispatch:r,registry:s,resolveSelect:i})=>{const l=(await i.getEntitiesConfig(e)).find(h=>h.name===t&&h.kind===e);if(!l)return;o._fields&&(o={...o,_fields:[...new Set([...Md(o._fields)||[],l.revisionKey||e1])].join()});const u=tn(l.getRevisionsUrl(n),o);let d,p;const f={},b=l.supportsPagination&&o.per_page!==-1;try{p=await Wt({path:u,parse:!b})}catch{return}p&&(b?(d=Object.values(await p.json()),f.totalItems=parseInt(p.headers.get("X-WP-Total"))):d=Object.values(p),o._fields&&(d=d.map(h=>(o._fields.split(",").forEach(g=>{h.hasOwnProperty(g)||(h[g]=void 0)}),h))),s.batch(()=>{if(r.receiveRevisions(e,t,n,d,o,!1,f),!o?._fields&&!o.context){const h=l.key||e1,g=d.filter(z=>z[h]).map(z=>[e,t,n,z[h]]);r.finishResolutions("getRevision",g)}}))};Zse.shouldInvalidate=(e,t,n,o)=>e.type==="SAVE_ENTITY_RECORD_FINISH"&&n===e.name&&t===e.kind&&!e.error&&o===e.recordId;const LBe=(e,t,n,o,r)=>async({dispatch:s,resolveSelect:i})=>{const l=(await i.getEntitiesConfig(e)).find(p=>p.name===t&&p.kind===e);if(!l)return;r!==void 0&&r._fields&&(r={...r,_fields:[...new Set([...Md(r._fields)||[],l.revisionKey||e1])].join()});const u=tn(l.getRevisionsUrl(n,o),r);let d;try{d=await Wt({path:u})}catch{return}d&&s.receiveRevisions(e,t,n,d,r)},PBe=e=>async({dispatch:t,resolveSelect:n})=>{let o;try{const{rest_namespace:r="wp/v2",rest_base:s}=await n.getPostType(e)||{};o=await Wt({path:`${r}/${s}/?context=edit`,method:"OPTIONS"})}catch{return}o&&t.receiveRegisteredPostMeta(e,o?.schema?.properties?.meta?.properties)},jBe=e=>async({dispatch:t})=>{const n=n1e.find(o=>o.kind===e);if(n)try{const o=await n.loadEntities();if(!o.length)return;t.addEntities(o)}catch{}},IBe=Object.freeze(Object.defineProperty({__proto__:null,__experimentalGetCurrentGlobalStylesId:CBe,__experimentalGetCurrentThemeBaseGlobalStyles:qBe,__experimentalGetCurrentThemeGlobalStylesVariations:RBe,canUser:Kse,canUserEditEntityRecord:_Be,getAuthors:zBe,getAutosave:SBe,getAutosaves:kBe,getBlockPatternCategories:EBe,getBlockPatterns:TBe,getCurrentTheme:vBe,getCurrentThemeGlobalStylesRevisions:Yse,getCurrentUser:OBe,getDefaultTemplateId:BBe,getEditedEntityRecord:ABe,getEmbedPreview:wBe,getEntitiesConfig:jBe,getEntityRecord:Gse,getEntityRecords:H4,getNavigationFallbackId:NBe,getRawEntityRecord:yBe,getRegisteredPostMeta:PBe,getRevision:LBe,getRevisions:Zse,getThemeSupports:xBe,getUserPatternCategories:WBe},Symbol.toStringTag,{value:"Module"}));function IU(e,t){const n={...e};let o=n;for(const r of t)o.children={...o.children,[r]:{locks:[],children:{},...o.children[r]}},o=o.children[r];return n}function $E(e,t){let n=e;for(const o of t){const r=n.children[o];if(!r)return null;n=r}return n}function*DBe(e,t){let n=e;yield n;for(const o of t){const r=n.children[o];if(!r)break;yield r,n=r}}function*FBe(e){const t=Object.values(e.children);for(;t.length;){const n=t.pop();yield n,t.push(...Object.values(n.children))}}function DU({exclusive:e},t){return!!(e&&t.length||!e&&t.filter(n=>n.exclusive).length)}const $Be={requests:[],tree:{locks:[],children:{}}};function mA(e=$Be,t){switch(t.type){case"ENQUEUE_LOCK_REQUEST":{const{request:n}=t;return{...e,requests:[n,...e.requests]}}case"GRANT_LOCK_REQUEST":{const{lock:n,request:o}=t,{store:r,path:s}=o,i=[r,...s],c=IU(e.tree,i),l=$E(c,i);return l.locks=[...l.locks,n],{...e,requests:e.requests.filter(u=>u!==o),tree:c}}case"RELEASE_LOCK":{const{lock:n}=t,o=[n.store,...n.path],r=IU(e.tree,o),s=$E(r,o);return s.locks=s.locks.filter(i=>i!==n),{...e,tree:r}}}return e}function VBe(e){return e.requests}function HBe(e,t,n,{exclusive:o}){const r=[t,...n],s=e.tree;for(const c of DBe(s,r))if(DU({exclusive:o},c.locks))return!1;const i=$E(s,r);if(!i)return!0;for(const c of FBe(i))if(DU({exclusive:o},c.locks))return!1;return!0}function UBe(){let e=mA(void 0,{type:"@@INIT"});function t(){for(const r of VBe(e)){const{store:s,path:i,exclusive:c,notifyAcquired:l}=r;if(HBe(e,s,i,{exclusive:c})){const u={store:s,path:i,exclusive:c};e=mA(e,{type:"GRANT_LOCK_REQUEST",lock:u,request:r}),l(u)}}}function n(r,s,i){return new Promise(c=>{e=mA(e,{type:"ENQUEUE_LOCK_REQUEST",request:{store:r,path:s,exclusive:i,notifyAcquired:c}}),t()})}function o(r){e=mA(e,{type:"RELEASE_LOCK",lock:r}),t()}return{acquire:n,release:o}}function XBe(){const e=UBe();function t(o,r,{exclusive:s}){return()=>e.acquire(o,r,s)}function n(o){return()=>e.release(o)}return{__unstableAcquireStoreLock:t,__unstableReleaseStoreLock:n}}let GBe,KBe;const VE=x.createContext({});function HE({kind:e,type:t,id:n,children:o}){const r=x.useContext(VE),s=x.useMemo(()=>({...r,[e]:{...r?.[e],[t]:n}}),[r,e,t,n]);return a.jsx(VE.Provider,{value:s,children:o})}let is=function(e){return e.Idle="IDLE",e.Resolving="RESOLVING",e.Error="ERROR",e.Success="SUCCESS",e}({});const YBe=["getIsResolving","hasStartedResolution","hasFinishedResolution","isResolving","getCachedResolvers"];function TB(e,t){return G((n,o)=>e(s=>ZBe(n(s)),o),t)}const ZBe=Hs(e=>{const t={};for(const n in e)YBe.includes(n)||Object.defineProperty(t,n,{get:()=>(...o)=>{const r=e[n](...o),s=e.getResolutionState(n,o)?.status;let i;switch(s){case"resolving":i=is.Resolving;break;case"finished":i=is.Success;break;case"error":i=is.Error;break;case void 0:i=is.Idle;break}return{data:r,status:i,isResolving:i===is.Resolving,hasStarted:i!==is.Idle,hasResolved:i===is.Success||i===is.Error}}});return t}),FU={};function X5(e,t,n,o={enabled:!0}){const{editEntityRecord:r,saveEditedEntityRecord:s}=Oe(Me),i=x.useMemo(()=>({edit:(f,b={})=>r(e,t,n,f,b),save:(f={})=>s(e,t,n,{throwOnError:!0,...f})}),[r,e,t,n,s]),{editedRecord:c,hasEdits:l,edits:u}=G(f=>o.enabled?{editedRecord:f(Me).getEditedEntityRecord(e,t,n),hasEdits:f(Me).hasEditsForEntityRecord(e,t,n),edits:f(Me).getEntityRecordNonTransientEdits(e,t,n)}:{editedRecord:FU,hasEdits:!1,edits:FU},[e,t,n,o.enabled]),{data:d,...p}=TB(f=>o.enabled?f(Me).getEntityRecord(e,t,n):{data:null},[e,t,n,o.enabled]);return{record:d,editedRecord:c,hasEdits:l,edits:u,...p,...i}}const QBe=[];function Al(e,t,n={},o={enabled:!0}){const r=tn("",n),{data:s,...i}=TB(u=>o.enabled?u(Me).getEntityRecords(e,t,n):{data:QBe},[e,t,r,o.enabled]),{totalItems:c,totalPages:l}=G(u=>o.enabled?{totalItems:u(Me).getEntityRecordsTotalItems(e,t,n),totalPages:u(Me).getEntityRecordsTotalPages(e,t,n)}:{totalItems:null,totalPages:null},[e,t,r,o.enabled]);return{records:s,totalItems:c,totalPages:l,...i}}function JBe(e,t,n={},o={enabled:!0}){const r=G(d=>d(Me).getEntityConfig(e,t),[e,t]),{records:s,...i}=Al(e,t,n,o),c=x.useMemo(()=>{var d;return(d=s?.map(p=>{var f;return p[(f=r?.key)!==null&&f!==void 0?f:"id"]}))!==null&&d!==void 0?d:[]},[s,r?.key]),l=G(d=>{const{getEntityRecordsPermissions:p}=eh(d(Me));return p(e,t,c)},[c,e,t]);return{records:x.useMemo(()=>{var d;return(d=s?.map((p,f)=>({...p,permissions:l[f]})))!==null&&d!==void 0?d:[]},[s,l]),...i}}const $U=new Set;function eLe(){return globalThis.SCRIPT_DEBUG===!0}function zn(e){if(eLe()&&!$U.has(e)){console.warn(e);try{throw Error(e)}catch{}$U.add(e)}}function Qse(e,t){const n=typeof e=="object",o=n?JSON.stringify(e):e;return n&&typeof t<"u"&&globalThis.SCRIPT_DEBUG===!0&&zn("When 'resource' is an entity object, passing 'id' as a separate argument isn't supported."),TB(r=>{const s=n?!!e.id:!!t,{canUser:i}=r(Me),c=i("create",n?{kind:e.kind,name:e.name}:e);if(!s){const h=i("read",e),g=c.isResolving||h.isResolving,z=c.hasResolved&&h.hasResolved;let A=is.Idle;return g?A=is.Resolving:z&&(A=is.Success),{status:A,isResolving:g,hasResolved:z,canCreate:c.hasResolved&&c.data,canRead:h.hasResolved&&h.data}}const l=i("read",e,t),u=i("update",e,t),d=i("delete",e,t),p=l.isResolving||c.isResolving||u.isResolving||d.isResolving,f=l.hasResolved&&c.hasResolved&&u.hasResolved&&d.hasResolved;let b=is.Idle;return p?b=is.Resolving:f&&(b=is.Success),{status:b,isResolving:p,hasResolved:f,canRead:f&&l.data,canCreate:f&&c.data,canUpdate:f&&u.data,canDelete:f&&d.data}},[o,t])}var tLe={grad:.9,turn:360,rad:360/(2*Math.PI)},Zc=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},_0=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Si=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e>t?e:t},Jse=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},VU=function(e){return{r:Si(e.r,0,255),g:Si(e.g,0,255),b:Si(e.b,0,255),a:Si(e.a)}},US=function(e){return{r:_0(e.r),g:_0(e.g),b:_0(e.b),a:_0(e.a,3)}},nLe=/^#([0-9a-f]{3,8})$/i,gA=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},eie=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,s=Math.max(t,n,o),i=s-Math.min(t,n,o),c=i?s===t?(n-o)/i:s===n?2+(o-t)/i:4+(t-n)/i:0;return{h:60*(c<0?c+6:c),s:s?i/s*100:0,v:s/255*100,a:r}},tie=function(e){var t=e.h,n=e.s,o=e.v,r=e.a;t=t/360*6,n/=100,o/=100;var s=Math.floor(t),i=o*(1-n),c=o*(1-(t-s)*n),l=o*(1-(1-t+s)*n),u=s%6;return{r:255*[o,c,i,i,l,o][u],g:255*[l,o,o,c,i,i][u],b:255*[i,i,l,o,o,c][u],a:r}},HU=function(e){return{h:Jse(e.h),s:Si(e.s,0,100),l:Si(e.l,0,100),a:Si(e.a)}},UU=function(e){return{h:_0(e.h),s:_0(e.s),l:_0(e.l),a:_0(e.a,3)}},XU=function(e){return tie((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},AM=function(e){return{h:(t=eie(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},oLe=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,rLe=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,sLe=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,iLe=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,UE={string:[[function(e){var t=nLe.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:e.length===4?_0(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?_0(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=sLe.exec(e)||iLe.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:VU({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:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=oLe.exec(e)||rLe.exec(e);if(!t)return null;var n,o,r=HU({h:(n=t[1],o=t[2],o===void 0&&(o="deg"),Number(n)*(tLe[o]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return XU(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,r=e.a,s=r===void 0?1:r;return Zc(t)&&Zc(n)&&Zc(o)?VU({r:Number(t),g:Number(n),b:Number(o),a:Number(s)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,r=e.a,s=r===void 0?1:r;if(!Zc(t)||!Zc(n)||!Zc(o))return null;var i=HU({h:Number(t),s:Number(n),l:Number(o),a:Number(s)});return XU(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,s=r===void 0?1:r;if(!Zc(t)||!Zc(n)||!Zc(o))return null;var i=function(c){return{h:Jse(c.h),s:Si(c.s,0,100),v:Si(c.v,0,100),a:Si(c.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(s)});return tie(i)},"hsv"]]},GU=function(e,t){for(var n=0;n=.5},e.prototype.toHex=function(){return t=US(this.rgba),n=t.r,o=t.g,r=t.b,i=(s=t.a)<1?gA(_0(255*s)):"","#"+gA(n)+gA(o)+gA(r)+i;var t,n,o,r,s,i},e.prototype.toRgb=function(){return US(this.rgba)},e.prototype.toRgbString=function(){return t=US(this.rgba),n=t.r,o=t.g,r=t.b,(s=t.a)<1?"rgba("+n+", "+o+", "+r+", "+s+")":"rgb("+n+", "+o+", "+r+")";var t,n,o,r,s},e.prototype.toHsl=function(){return UU(AM(this.rgba))},e.prototype.toHslString=function(){return t=UU(AM(this.rgba)),n=t.h,o=t.s,r=t.l,(s=t.a)<1?"hsla("+n+", "+o+"%, "+r+"%, "+s+")":"hsl("+n+", "+o+"%, "+r+"%)";var t,n,o,r,s},e.prototype.toHsv=function(){return t=eie(this.rgba),{h:_0(t.h),s:_0(t.s),v:_0(t.v),a:_0(t.a,3)};var t},e.prototype.invert=function(){return an({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},e.prototype.saturate=function(t){return t===void 0&&(t=.1),an(XS(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),an(XS(this.rgba,-t))},e.prototype.grayscale=function(){return an(XS(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),an(KU(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),an(KU(this.rgba,-t))},e.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},e.prototype.alpha=function(t){return typeof t=="number"?an({r:(n=this.rgba).r,g:n.g,b:n.b,a:t}):_0(this.rgba.a,3);var n},e.prototype.hue=function(t){var n=AM(this.rgba);return typeof t=="number"?an({h:t,s:n.s,l:n.l,a:n.a}):_0(n.h)},e.prototype.isEqual=function(t){return this.toHex()===an(t).toHex()},e}(),an=function(e){return e instanceof XE?e:new XE(e)},YU=[],Xs=function(e){e.forEach(function(t){YU.indexOf(t)<0&&(t(XE,UE),YU.push(t))})};function Gs(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},o={};for(var r in n)o[n[r]]=r;var s={};e.prototype.toName=function(i){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var c,l,u=o[this.toHex()];if(u)return u;if(i?.closest){var d=this.toRgb(),p=1/0,f="black";if(!s.length)for(var b in n)s[b]=new e(n[b]).toRgb();for(var h in n){var g=(c=d,l=s[h],Math.pow(c.r-l.r,2)+Math.pow(c.g-l.g,2)+Math.pow(c.b-l.b,2));gl?(c+.05)/(l+.05):(l+.05)/(c+.05),(o=2)===void 0&&(o=0),r===void 0&&(r=Math.pow(10,o)),Math.floor(r*n)/r+0},e.prototype.isReadable=function(t,n){return t===void 0&&(t="#FFF"),n===void 0&&(n={}),this.contrast(t)>=(c=(i=(o=n).size)===void 0?"normal":i,(s=(r=o.level)===void 0?"AA":r)==="AAA"&&c==="normal"?7:s==="AA"&&c==="large"?3:4.5);var o,r,s,i,c}}const nie="block-default",GE=["attributes","supports","save","migrate","isEligible","apiVersion"],Pp={"--wp--style--color--link":{value:["color","link"],support:["color","link"]},aspectRatio:{value:["dimensions","aspectRatio"],support:["dimensions","aspectRatio"],useEngine:!0},background:{value:["color","gradient"],support:["color","gradients"],useEngine:!0},backgroundColor:{value:["color","background"],support:["color","background"],requiresOptOut:!0,useEngine:!0},backgroundImage:{value:["background","backgroundImage"],support:["background","backgroundImage"],useEngine:!0},backgroundRepeat:{value:["background","backgroundRepeat"],support:["background","backgroundRepeat"],useEngine:!0},backgroundSize:{value:["background","backgroundSize"],support:["background","backgroundSize"],useEngine:!0},backgroundPosition:{value:["background","backgroundPosition"],support:["background","backgroundPosition"],useEngine:!0},borderColor:{value:["border","color"],support:["__experimentalBorder","color"],useEngine:!0},borderRadius:{value:["border","radius"],support:["__experimentalBorder","radius"],properties:{borderTopLeftRadius:"topLeft",borderTopRightRadius:"topRight",borderBottomLeftRadius:"bottomLeft",borderBottomRightRadius:"bottomRight"},useEngine:!0},borderStyle:{value:["border","style"],support:["__experimentalBorder","style"],useEngine:!0},borderWidth:{value:["border","width"],support:["__experimentalBorder","width"],useEngine:!0},borderTopColor:{value:["border","top","color"],support:["__experimentalBorder","color"],useEngine:!0},borderTopStyle:{value:["border","top","style"],support:["__experimentalBorder","style"],useEngine:!0},borderTopWidth:{value:["border","top","width"],support:["__experimentalBorder","width"],useEngine:!0},borderRightColor:{value:["border","right","color"],support:["__experimentalBorder","color"],useEngine:!0},borderRightStyle:{value:["border","right","style"],support:["__experimentalBorder","style"],useEngine:!0},borderRightWidth:{value:["border","right","width"],support:["__experimentalBorder","width"],useEngine:!0},borderBottomColor:{value:["border","bottom","color"],support:["__experimentalBorder","color"],useEngine:!0},borderBottomStyle:{value:["border","bottom","style"],support:["__experimentalBorder","style"],useEngine:!0},borderBottomWidth:{value:["border","bottom","width"],support:["__experimentalBorder","width"],useEngine:!0},borderLeftColor:{value:["border","left","color"],support:["__experimentalBorder","color"],useEngine:!0},borderLeftStyle:{value:["border","left","style"],support:["__experimentalBorder","style"],useEngine:!0},borderLeftWidth:{value:["border","left","width"],support:["__experimentalBorder","width"],useEngine:!0},color:{value:["color","text"],support:["color","text"],requiresOptOut:!0,useEngine:!0},columnCount:{value:["typography","textColumns"],support:["typography","textColumns"],useEngine:!0},filter:{value:["filter","duotone"],support:["filter","duotone"]},linkColor:{value:["elements","link","color","text"],support:["color","link"]},captionColor:{value:["elements","caption","color","text"],support:["color","caption"]},buttonColor:{value:["elements","button","color","text"],support:["color","button"]},buttonBackgroundColor:{value:["elements","button","color","background"],support:["color","button"]},headingColor:{value:["elements","heading","color","text"],support:["color","heading"]},headingBackgroundColor:{value:["elements","heading","color","background"],support:["color","heading"]},fontFamily:{value:["typography","fontFamily"],support:["typography","__experimentalFontFamily"],useEngine:!0},fontSize:{value:["typography","fontSize"],support:["typography","fontSize"],useEngine:!0},fontStyle:{value:["typography","fontStyle"],support:["typography","__experimentalFontStyle"],useEngine:!0},fontWeight:{value:["typography","fontWeight"],support:["typography","__experimentalFontWeight"],useEngine:!0},lineHeight:{value:["typography","lineHeight"],support:["typography","lineHeight"],useEngine:!0},margin:{value:["spacing","margin"],support:["spacing","margin"],properties:{marginTop:"top",marginRight:"right",marginBottom:"bottom",marginLeft:"left"},useEngine:!0},minHeight:{value:["dimensions","minHeight"],support:["dimensions","minHeight"],useEngine:!0},padding:{value:["spacing","padding"],support:["spacing","padding"],properties:{paddingTop:"top",paddingRight:"right",paddingBottom:"bottom",paddingLeft:"left"},useEngine:!0},textAlign:{value:["typography","textAlign"],support:["typography","textAlign"],useEngine:!1},textDecoration:{value:["typography","textDecoration"],support:["typography","__experimentalTextDecoration"],useEngine:!0},textTransform:{value:["typography","textTransform"],support:["typography","__experimentalTextTransform"],useEngine:!0},letterSpacing:{value:["typography","letterSpacing"],support:["typography","__experimentalLetterSpacing"],useEngine:!0},writingMode:{value:["typography","writingMode"],support:["typography","__experimentalWritingMode"],useEngine:!0},"--wp--style--root--padding":{value:["spacing","padding"],support:["spacing","padding"],properties:{"--wp--style--root--padding-top":"top","--wp--style--root--padding-right":"right","--wp--style--root--padding-bottom":"bottom","--wp--style--root--padding-left":"left"},rootOnly:!0}},Za={link:"a:where(:not(.wp-element-button))",heading:"h1, h2, h3, h4, h5, h6",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",button:".wp-element-button, .wp-block-button__link",caption:".wp-element-caption, .wp-block-audio figcaption, .wp-block-embed figcaption, .wp-block-gallery figcaption, .wp-block-image figcaption, .wp-block-table figcaption, .wp-block-video figcaption",cite:"cite"},cLe={"color.duotone":!0,"color.gradients":!0,"color.palette":!0,"dimensions.aspectRatios":!0,"typography.fontSizes":!0,"spacing.spacingSizes":!0},{lock:lLe,unlock:Mf}=P0("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/blocks"),ZU={title:"block title",description:"block description",keywords:["block keyword"],styles:[{label:"block style label"}],variations:[{title:"block variation title",description:"block variation description",keywords:["block variation keyword"]}]};function U4(e){return e!==null&&typeof e=="object"}function uLe({textdomain:e,...t}){const n=["apiVersion","title","category","parent","ancestor","icon","description","keywords","attributes","providesContext","usesContext","selectors","supports","styles","example","variations","blockHooks","allowedBlocks"],o=Object.fromEntries(Object.entries(t).filter(([r])=>n.includes(r)));return e&&Object.keys(ZU).forEach(r=>{o[r]&&(o[r]=KE(ZU[r],o[r],e))}),o}function dLe(e,t){const n=U4(e)?e.name:e;if(typeof n!="string"){globalThis.SCRIPT_DEBUG===!0&&zn("Block names must be strings.");return}if(!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(n)){globalThis.SCRIPT_DEBUG===!0&&zn("Block names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-block");return}if(uo(kt).getBlockType(n)){globalThis.SCRIPT_DEBUG===!0&&zn('Block "'+n+'" is already registered.');return}const{addBootstrappedBlockType:o,addUnprocessedBlockType:r}=Mf(jr(kt));if(U4(e)){const s=uLe(e);o(n,s)}return r(n,t),uo(kt).getBlockType(n)}function KE(e,t,n){return typeof e=="string"&&typeof t=="string"?We(t,e,n):Array.isArray(e)&&e.length&&Array.isArray(t)?t.map(o=>KE(e[0],o,n)):U4(e)&&Object.entries(e).length&&U4(t)?Object.keys(t).reduce((o,r)=>e[r]?(o[r]=KE(e[r],t[r],n),o):(o[r]=t[r],o),{}):t}function pLe(e){jr(kt).setFreeformFallbackBlockName(e)}function yd(){return uo(kt).getFreeformFallbackBlockName()}function oie(){return uo(kt).getGroupingBlockName()}function fLe(e){jr(kt).setUnregisteredFallbackBlockName(e)}function g3(){return uo(kt).getUnregisteredFallbackBlockName()}function bLe(e){jr(kt).setDefaultBlockName(e)}function hLe(e){jr(kt).setGroupingBlockName(e)}function Mr(){return uo(kt).getDefaultBlockName()}function on(e){return uo(kt)?.getBlockType(e)}function gs(){return uo(kt).getBlockTypes()}function An(e,t,n){return uo(kt).getBlockSupport(e,t,n)}function Tt(e,t,n){return uo(kt).hasBlockSupport(e,t,n)}function Qd(e){return e?.name==="core/block"}function Hh(e){return e?.name==="core/template-part"}const G5=(e,t)=>uo(kt).getBlockVariations(e,t),QU=e=>{const{name:t,label:n,usesContext:o,getValues:r,setValues:s,canUserEditValue:i,getFieldsList:c}=e,l=Mf(uo(kt)).getBlockBindingsSource(t),u=["label","usesContext"];for(const d in l)if(!u.includes(d)&&l[d]){globalThis.SCRIPT_DEBUG===!0&&zn('Block bindings source "'+t+'" is already registered.');return}if(!t){globalThis.SCRIPT_DEBUG===!0&&zn("Block bindings source must contain a name.");return}if(typeof t!="string"){globalThis.SCRIPT_DEBUG===!0&&zn("Block bindings source name must be a string.");return}if(/[A-Z]+/.test(t)){globalThis.SCRIPT_DEBUG===!0&&zn("Block bindings source name must not contain uppercase characters.");return}if(!/^[a-z0-9/-]+$/.test(t)){globalThis.SCRIPT_DEBUG===!0&&zn("Block bindings source name must contain only valid characters: lowercase characters, hyphens, or digits. Example: my-plugin/my-custom-source.");return}if(!/^[a-z0-9-]+\/[a-z0-9-]+$/.test(t)){globalThis.SCRIPT_DEBUG===!0&&zn("Block bindings source name must contain a namespace and valid characters. Example: my-plugin/my-custom-source.");return}if(!n&&!l?.label){globalThis.SCRIPT_DEBUG===!0&&zn("Block bindings source must contain a label.");return}if(n&&typeof n!="string"){globalThis.SCRIPT_DEBUG===!0&&zn("Block bindings source label must be a string.");return}if(n&&l?.label&&n!==l?.label&&globalThis.SCRIPT_DEBUG===!0&&zn('Block bindings "'+t+'" source label was overridden.'),o&&!Array.isArray(o)){globalThis.SCRIPT_DEBUG===!0&&zn("Block bindings source usesContext must be an array.");return}if(r&&typeof r!="function"){globalThis.SCRIPT_DEBUG===!0&&zn("Block bindings source getValues must be a function.");return}if(s&&typeof s!="function"){globalThis.SCRIPT_DEBUG===!0&&zn("Block bindings source setValues must be a function.");return}if(i&&typeof i!="function"){globalThis.SCRIPT_DEBUG===!0&&zn("Block bindings source canUserEditValue must be a function.");return}if(c&&typeof c!="function"){globalThis.SCRIPT_DEBUG===!0&&zn("Block bindings source getFieldsList must be a function.");return}return Mf(jr(kt)).addBlockBindingsSource(e)};function vl(e){return Mf(uo(kt)).getBlockBindingsSource(e)}function rie(){return Mf(uo(kt)).getAllBlockBindingsSources()}Xs([Gs,Uf]);const JU=["#191e23","#f8f9f9"];function E2(e){var t;return Object.entries((t=on(e.name)?.attributes)!==null&&t!==void 0?t:{}).every(([n,o])=>{const r=e.attributes[n];return o.hasOwnProperty("default")?r===o.default:o.type==="rich-text"?!r?.length:r===void 0})}function El(e){return e.name===Mr()&&E2(e)}function sie(e){return!!e&&(typeof e=="string"||x.isValidElement(e)||typeof e=="function"||e instanceof x.Component)}function mLe(e){if(e=e||nie,sie(e))return{src:e};if("background"in e){const t=an(e.background),n=r=>t.contrast(r),o=Math.max(...JU.map(n));return{...e,foreground:e.foreground?e.foreground:JU.find(r=>n(r)===o),shadowColor:t.alpha(.3).toRgbString()}}return e}function M3(e){return typeof e=="string"?on(e):e}function iie(e,t,n="visual"){const{__experimentalLabel:o,title:r}=e,s=o&&o(t,{context:n});return s?s.toPlainText?s.toPlainText():x1(s):r}function aie(e){if(e.default!==void 0)return e.default;if(e.type==="rich-text")return new Xo}function cie(e){return on(e)!==void 0}function EB(e,t){const n=on(e);if(n===void 0)throw new Error(`Block type '${e}' is not registered.`);return Object.entries(n.attributes).reduce((o,[r,s])=>{const i=t[r];if(i!==void 0)s.type==="rich-text"?i instanceof Xo?o[r]=i:typeof i=="string"&&(o[r]=Xo.fromHTMLString(i)):s.type==="string"&&i instanceof Xo?o[r]=i.toHTMLString():o[r]=i;else{const c=aie(s);c!==void 0&&(o[r]=c)}return["node","children"].indexOf(s.source)!==-1&&(typeof o[r]=="string"?o[r]=[o[r]]:Array.isArray(o[r])||(o[r]=[])),o},{})}function gLe(e,t){const n=on(e)?.attributes;return n?Object.keys(n).filter(r=>{const s=n[r];return s?.role===t?!0:s?.__experimentalRole===t?(Ke("__experimentalRole attribute",{since:"6.7",version:"6.8",alternative:"role attribute",hint:`Check the block.json of the ${e} block.`}),!0):!1}):[]}function MLe(e){const t=on(e)?.attributes;return t?!!Object.keys(t)?.some(n=>{const o=t[n];return o?.role==="content"||o?.__experimentalRole==="content"}):!1}function Xf(e,t){return Object.fromEntries(Object.entries(e).filter(([n])=>!t.includes(n)))}const zLe=[{slug:"text",title:m("Text")},{slug:"media",title:m("Media")},{slug:"design",title:m("Design")},{slug:"widgets",title:m("Widgets")},{slug:"theme",title:m("Theme")},{slug:"embed",title:m("Embeds")},{slug:"reusable",title:m("Reusable blocks")}];function WB(e){return e.reduce((t,n)=>({...t,[n.name]:n}),{})}function X4(e){return e.reduce((t,n)=>(t.some(o=>o.name===n.name)||t.push(n),t),[])}function OLe(e={},t){switch(t.type){case"ADD_BOOTSTRAPPED_BLOCK_TYPE":const{name:n,blockType:o}=t,r=e[n];let s;return r?(r.blockHooks===void 0&&o.blockHooks&&(s={...r,...s,blockHooks:o.blockHooks}),r.allowedBlocks===void 0&&o.allowedBlocks&&(s={...r,...s,allowedBlocks:o.allowedBlocks})):(s=Object.fromEntries(Object.entries(o).filter(([,i])=>i!=null).map(([i,c])=>[SN(i),c])),s.name=n),s?{...e,[n]:s}:e;case"REMOVE_BLOCK_TYPES":return Xf(e,t.names)}return e}function yLe(e={},t){switch(t.type){case"ADD_UNPROCESSED_BLOCK_TYPE":return{...e,[t.name]:t.blockType};case"REMOVE_BLOCK_TYPES":return Xf(e,t.names)}return e}function ALe(e={},t){switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...WB(t.blockTypes)};case"REMOVE_BLOCK_TYPES":return Xf(e,t.names)}return e}function vLe(e={},t){var n;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Object.fromEntries(Object.entries(WB(t.blockTypes)).map(([r,s])=>{var i,c;return[r,X4([...((i=s.styles)!==null&&i!==void 0?i:[]).map(l=>({...l,source:"block"})),...((c=e[s.name])!==null&&c!==void 0?c:[]).filter(({source:l})=>l!=="block")])]}))};case"ADD_BLOCK_STYLES":const o={};return t.blockNames.forEach(r=>{var s;o[r]=X4([...(s=e[r])!==null&&s!==void 0?s:[],...t.styles])}),{...e,...o};case"REMOVE_BLOCK_STYLES":return{...e,[t.blockName]:((n=e[t.blockName])!==null&&n!==void 0?n:[]).filter(r=>t.styleNames.indexOf(r.name)===-1)}}return e}function xLe(e={},t){var n,o;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Object.fromEntries(Object.entries(WB(t.blockTypes)).map(([r,s])=>{var i,c;return[r,X4([...((i=s.variations)!==null&&i!==void 0?i:[]).map(l=>({...l,source:"block"})),...((c=e[s.name])!==null&&c!==void 0?c:[]).filter(({source:l})=>l!=="block")])]}))};case"ADD_BLOCK_VARIATIONS":return{...e,[t.blockName]:X4([...(n=e[t.blockName])!==null&&n!==void 0?n:[],...t.variations])};case"REMOVE_BLOCK_VARIATIONS":return{...e,[t.blockName]:((o=e[t.blockName])!==null&&o!==void 0?o:[]).filter(r=>t.variationNames.indexOf(r.name)===-1)}}return e}function K5(e){return(t=null,n)=>{switch(n.type){case"REMOVE_BLOCK_TYPES":return n.names.indexOf(t)!==-1?null:t;case e:return n.name||null}return t}}const wLe=K5("SET_DEFAULT_BLOCK_NAME"),_Le=K5("SET_FREEFORM_FALLBACK_BLOCK_NAME"),kLe=K5("SET_UNREGISTERED_FALLBACK_BLOCK_NAME"),SLe=K5("SET_GROUPING_BLOCK_NAME");function CLe(e=zLe,t){switch(t.type){case"SET_CATEGORIES":const n=new Map;return(t.categories||[]).forEach(o=>{n.set(o.slug,o)}),[...n.values()];case"UPDATE_CATEGORY":{if(!t.category||!Object.keys(t.category).length)return e;if(e.find(({slug:r})=>r===t.slug))return e.map(r=>r.slug===t.slug?{...r,...t.category}:r)}}return e}function qLe(e={},t){switch(t.type){case"ADD_BLOCK_COLLECTION":return{...e,[t.namespace]:{title:t.title,icon:t.icon}};case"REMOVE_BLOCK_COLLECTION":return Xf(e,t.namespace)}return e}function RLe(e=[],t=[]){const n=Array.from(new Set(e.concat(t)));return n.length>0?n:void 0}function TLe(e={},t){switch(t.type){case"ADD_BLOCK_BINDINGS_SOURCE":let n;return(globalThis.IS_GUTENBERG_PLUGIN||t.name==="core/post-meta")&&(n=t.getFieldsList),{...e,[t.name]:{label:t.label||e[t.name]?.label,usesContext:RLe(e[t.name]?.usesContext,t.usesContext),getValues:t.getValues,setValues:t.setValues,canUserEditValue:t.setValues&&t.canUserEditValue,getFieldsList:n}};case"REMOVE_BLOCK_BINDINGS_SOURCE":return Xf(e,t.name)}return e}const ELe=J0({bootstrappedBlockTypes:OLe,unprocessedBlockTypes:yLe,blockTypes:ALe,blockStyles:vLe,blockVariations:xLe,defaultBlockName:wLe,freeformFallbackBlockName:_Le,unregisteredFallbackBlockName:kLe,groupingBlockName:SLe,categories:CLe,collections:qLe,blockBindingsSources:TLe}),JM=(e,t,n)=>{var o;const r=Array.isArray(t)?t:t.split(".");let s=e;return r.forEach(i=>{s=s?.[i]}),(o=s)!==null&&o!==void 0?o:n};function eX(e){return typeof e=="object"&&e.constructor===Object&&e!==null}function lie(e,t){return eX(e)&&eX(t)?Object.entries(t).every(([n,o])=>lie(e?.[n],o)):e===t}const WLe=["background","backgroundColor","color","linkColor","captionColor","buttonColor","headingColor","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","padding","contentSize","wideSize","blockGap","textDecoration","textTransform","letterSpacing"];function tX(e,t,n){return e.filter(o=>!(o==="fontSize"&&n==="heading"||o==="textDecoration"&&!t&&n!=="link"||o==="textTransform"&&!t&&!(["heading","h1","h2","h3","h4","h5","h6"].includes(n)||n==="button"||n==="caption"||n==="text")||o==="letterSpacing"&&!t&&!(["heading","h1","h2","h3","h4","h5","h6"].includes(n)||n==="button"||n==="caption"||n==="text")||o==="textColumns"&&!t))}const NLe=It((e,t,n)=>{if(!t)return tX(WLe,t,n);const o=z3(e,t);if(!o)return[];const r=[];return o?.supports?.spacing?.blockGap&&r.push("blockGap"),o?.supports?.shadow&&r.push("shadow"),Object.keys(Pp).forEach(s=>{if(Pp[s].support){if(Pp[s].requiresOptOut&&Pp[s].support[0]in o.supports&&JM(o.supports,Pp[s].support)!==!1){r.push(s);return}JM(o.supports,Pp[s].support,!1)&&r.push(s)}}),tX(r,t,n)},(e,t)=>[e.blockTypes[t]]);function BLe(e,t){return e.bootstrappedBlockTypes[t]}function LLe(e){return e.unprocessedBlockTypes}function PLe(e){return e.blockBindingsSources}function jLe(e,t){return e.blockBindingsSources[t]}const uie=(e,t)=>{const n=z3(e,t);return n?Object.values(n.attributes).some(({role:o,__experimentalRole:r})=>o==="content"?!0:r==="content"?(Ke("__experimentalRole attribute",{since:"6.7",version:"6.8",alternative:"role attribute",hint:`Check the block.json of the ${t} block.`}),!0):!1):!1},ILe=Object.freeze(Object.defineProperty({__proto__:null,getAllBlockBindingsSources:PLe,getBlockBindingsSource:jLe,getBootstrappedBlockType:BLe,getSupportedStyles:NLe,getUnprocessedBlockTypes:LLe,hasContentRoleAttribute:uie},Symbol.toStringTag,{value:"Module"})),die=(e,t)=>typeof t=="string"?z3(e,t):t,pie=It(e=>Object.values(e.blockTypes),e=>[e.blockTypes]);function z3(e,t){return e.blockTypes[t]}function DLe(e,t){return e.blockStyles[t]}const NB=It((e,t,n)=>{const o=e.blockVariations[t];return!o||!n?o:o.filter(r=>(r.scope||["block","inserter"]).includes(n))},(e,t)=>[e.blockVariations[t]]);function FLe(e,t,n,o){const r=NB(e,t,o);if(!r)return r;const s=z3(e,t),i=Object.keys(s?.attributes||{});let c,l=0;for(const u of r)if(Array.isArray(u.isActive)){const d=u.isActive.filter(b=>{const h=b.split(".")[0];return i.includes(h)}),p=d.length;if(p===0)continue;d.every(b=>{const h=JM(u.attributes,b);if(h===void 0)return!1;let g=JM(n,b);return g instanceof Xo&&(g=g.toHTMLString()),lie(g,h)})&&p>l&&(c=u,l=p)}else if(u.isActive?.(n,u.attributes))return c||u;return c}function $Le(e,t,n){const o=NB(e,t,n);return[...o].reverse().find(({isDefault:s})=>!!s)||o[0]}function VLe(e){return e.categories}function HLe(e){return e.collections}function ULe(e){return e.defaultBlockName}function XLe(e){return e.freeformFallbackBlockName}function GLe(e){return e.unregisteredFallbackBlockName}function KLe(e){return e.groupingBlockName}const BB=It((e,t)=>pie(e).filter(n=>n.parent?.includes(t)).map(({name:n})=>n),e=>[e.blockTypes]),fie=(e,t,n,o)=>{const r=die(e,t);return r?.supports?JM(r.supports,n,o):o};function bie(e,t,n,o){return!!fie(e,t,n,o)}function nX(e){return ms(e??"").toLowerCase().trim()}function YLe(e,t,n=""){const o=die(e,t),r=nX(n),s=i=>nX(i).includes(r);return s(o.title)||o.keywords?.some(s)||s(o.category)||typeof o.description=="string"&&s(o.description)}const ZLe=(e,t)=>BB(e,t).length>0,QLe=(e,t)=>BB(e,t).some(n=>bie(e,n,"inserter",!0)),JLe=(...e)=>(Ke("__experimentalHasContentRoleAttribute",{since:"6.7",version:"6.8",hint:"This is a private selector."}),uie(...e)),ePe=Object.freeze(Object.defineProperty({__proto__:null,__experimentalHasContentRoleAttribute:JLe,getActiveBlockVariation:FLe,getBlockStyles:DLe,getBlockSupport:fie,getBlockType:z3,getBlockTypes:pie,getBlockVariations:NB,getCategories:VLe,getChildBlockNames:BB,getCollections:HLe,getDefaultBlockName:ULe,getDefaultBlockVariation:$Le,getFreeformFallbackBlockName:XLe,getGroupingBlockName:KLe,getUnregisteredFallbackBlockName:GLe,hasBlockSupport:bie,hasChildBlocks:ZLe,hasChildBlocksWithInserterSupport:QLe,isMatchingSearchTerm:YLe},Symbol.toStringTag,{value:"Module"}));var ZS={exports:{}},ko={};/** * @license React * react-is.production.min.js * @@ -73,7 +73,7 @@ Use Chrome, Firefox or Internet Explorer 11`)}}).call(this)}).call(this,s("_proc * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var oX;function tPe(){if(oX)return ko;oX=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),i=Symbol.for("react.context"),c=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),h;h=Symbol.for("react.module.reference");function g(z){if(typeof z=="object"&&z!==null){var A=z.$$typeof;switch(A){case e:switch(z=z.type,z){case n:case r:case o:case u:case d:return z;default:switch(z=z&&z.$$typeof,z){case c:case i:case l:case f:case p:case s:return z;default:return A}}case t:return A}}}return ko.ContextConsumer=i,ko.ContextProvider=s,ko.Element=e,ko.ForwardRef=l,ko.Fragment=n,ko.Lazy=f,ko.Memo=p,ko.Portal=t,ko.Profiler=r,ko.StrictMode=o,ko.Suspense=u,ko.SuspenseList=d,ko.isAsyncMode=function(){return!1},ko.isConcurrentMode=function(){return!1},ko.isContextConsumer=function(z){return g(z)===i},ko.isContextProvider=function(z){return g(z)===s},ko.isElement=function(z){return typeof z=="object"&&z!==null&&z.$$typeof===e},ko.isForwardRef=function(z){return g(z)===l},ko.isFragment=function(z){return g(z)===n},ko.isLazy=function(z){return g(z)===f},ko.isMemo=function(z){return g(z)===p},ko.isPortal=function(z){return g(z)===t},ko.isProfiler=function(z){return g(z)===r},ko.isStrictMode=function(z){return g(z)===o},ko.isSuspense=function(z){return g(z)===u},ko.isSuspenseList=function(z){return g(z)===d},ko.isValidElementType=function(z){return typeof z=="string"||typeof z=="function"||z===n||z===r||z===o||z===u||z===d||z===b||typeof z=="object"&&z!==null&&(z.$$typeof===f||z.$$typeof===p||z.$$typeof===s||z.$$typeof===i||z.$$typeof===l||z.$$typeof===h||z.getModuleId!==void 0)},ko.typeOf=g,ko}var rX;function nPe(){return rX||(rX=1,ZS.exports=tPe()),ZS.exports}var oPe=nPe();const sX={common:"text",formatting:"text",layout:"design"};function rPe(e=[],t=[]){const n=[...e];return t.forEach(o=>{const r=n.findIndex(s=>s.name===o.name);r!==-1?n[r]={...n[r],...o}:n.push(o)}),n}const hie=(e,t)=>({select:n})=>{const o=n.getBootstrappedBlockType(e),r={name:e,icon:nie,keywords:[],attributes:{},providesContext:{},usesContext:[],selectors:{},supports:{},styles:[],blockHooks:{},save:()=>null,...o,...t,variations:rPe(Array.isArray(o?.variations)?o.variations:[],Array.isArray(t?.variations)?t.variations:[])},s=gr("blocks.registerBlockType",r,e,null);if(s.description&&typeof s.description!="string"&&Ke("Declaring non-string block descriptions",{since:"6.2"}),s.deprecated&&(s.deprecated=s.deprecated.map(i=>Object.fromEntries(Object.entries(gr("blocks.registerBlockType",{...Xf(r,GE),...i},r.name,i)).filter(([c])=>GE.includes(c))))),!a3(s)){globalThis.SCRIPT_DEBUG===!0&&zn("Block settings must be a valid object.");return}if(typeof s.save!="function"){globalThis.SCRIPT_DEBUG===!0&&zn('The "save" property must be a valid function.');return}if("edit"in s&&!oPe.isValidElementType(s.edit)){globalThis.SCRIPT_DEBUG===!0&&zn('The "edit" property must be a valid component.');return}if(sX.hasOwnProperty(s.category)&&(s.category=sX[s.category]),"category"in s&&!n.getCategories().some(({slug:i})=>i===s.category)&&(globalThis.SCRIPT_DEBUG===!0&&zn('The block "'+e+'" is registered with an invalid category "'+s.category+'".'),delete s.category),!("title"in s)||s.title===""){globalThis.SCRIPT_DEBUG===!0&&zn('The block "'+e+'" must have a title.');return}if(typeof s.title!="string"){globalThis.SCRIPT_DEBUG===!0&&zn("Block titles must be strings.");return}if(s.icon=mLe(s.icon),!sie(s.icon.src)){globalThis.SCRIPT_DEBUG===!0&&zn("The icon passed is invalid. The icon should be a string, an element, a function, or an object following the specifications documented in https://developer.wordpress.org/block-editor/developers/block-api/block-registration/#icon-optional");return}if((typeof s?.parent=="string"||s?.parent instanceof String)&&(s.parent=[s.parent],globalThis.SCRIPT_DEBUG===!0&&zn("Parent must be undefined or an array of strings (block types), but it is a string.")),!Array.isArray(s?.parent)&&s?.parent!==void 0){globalThis.SCRIPT_DEBUG===!0&&zn("Parent must be undefined or an array of block types, but it is ",s.parent);return}if(s?.parent?.length===1&&e===s.parent[0]){globalThis.SCRIPT_DEBUG===!0&&zn('Block "'+e+'" cannot be a parent of itself. Please remove the block name from the parent list.');return}return s};function sPe(e){return{type:"ADD_BLOCK_TYPES",blockTypes:Array.isArray(e)?e:[e]}}function mie(){return({dispatch:e,select:t})=>{const n=[];for(const[o,r]of Object.entries(t.getUnprocessedBlockTypes())){const s=e(hie(o,r));s&&n.push(s)}n.length&&e.addBlockTypes(n)}}function iPe(){return Ke('wp.data.dispatch( "core/blocks" ).__experimentalReapplyBlockFilters',{since:"6.4",alternative:"reapplyBlockFilters"}),mie()}function aPe(e){return{type:"REMOVE_BLOCK_TYPES",names:Array.isArray(e)?e:[e]}}function cPe(e,t){return{type:"ADD_BLOCK_STYLES",styles:Array.isArray(t)?t:[t],blockNames:Array.isArray(e)?e:[e]}}function lPe(e,t){return{type:"REMOVE_BLOCK_STYLES",styleNames:Array.isArray(t)?t:[t],blockName:e}}function uPe(e,t){return{type:"ADD_BLOCK_VARIATIONS",variations:Array.isArray(t)?t:[t],blockName:e}}function dPe(e,t){return{type:"REMOVE_BLOCK_VARIATIONS",variationNames:Array.isArray(t)?t:[t],blockName:e}}function pPe(e){return{type:"SET_DEFAULT_BLOCK_NAME",name:e}}function fPe(e){return{type:"SET_FREEFORM_FALLBACK_BLOCK_NAME",name:e}}function bPe(e){return{type:"SET_UNREGISTERED_FALLBACK_BLOCK_NAME",name:e}}function hPe(e){return{type:"SET_GROUPING_BLOCK_NAME",name:e}}function mPe(e){return{type:"SET_CATEGORIES",categories:e}}function gPe(e,t){return{type:"UPDATE_CATEGORY",slug:e,category:t}}function MPe(e,t,n){return{type:"ADD_BLOCK_COLLECTION",namespace:e,title:t,icon:n}}function zPe(e){return{type:"REMOVE_BLOCK_COLLECTION",namespace:e}}const OPe=Object.freeze(Object.defineProperty({__proto__:null,__experimentalReapplyBlockFilters:iPe,addBlockCollection:MPe,addBlockStyles:cPe,addBlockTypes:sPe,addBlockVariations:uPe,reapplyBlockTypeFilters:mie,removeBlockCollection:zPe,removeBlockStyles:lPe,removeBlockTypes:aPe,removeBlockVariations:dPe,setCategories:mPe,setDefaultBlockName:pPe,setFreeformFallbackBlockName:fPe,setGroupingBlockName:hPe,setUnregisteredFallbackBlockName:bPe,updateCategory:gPe},Symbol.toStringTag,{value:"Module"}));function yPe(e,t){return{type:"ADD_BOOTSTRAPPED_BLOCK_TYPE",name:e,blockType:t}}function APe(e,t){return({dispatch:n})=>{n({type:"ADD_UNPROCESSED_BLOCK_TYPE",name:e,blockType:t});const o=n(hie(e,t));o&&n.addBlockTypes(o)}}function vPe(e){return{type:"ADD_BLOCK_BINDINGS_SOURCE",name:e.name,label:e.label,usesContext:e.usesContext,getValues:e.getValues,setValues:e.setValues,canUserEditValue:e.canUserEditValue,getFieldsList:e.getFieldsList}}function xPe(e){return{type:"REMOVE_BLOCK_BINDINGS_SOURCE",name:e}}const wPe=Object.freeze(Object.defineProperty({__proto__:null,addBlockBindingsSource:vPe,addBootstrappedBlockType:yPe,addUnprocessedBlockType:APe,removeBlockBindingsSource:xPe},Symbol.toStringTag,{value:"Module"})),_Pe="core/blocks",kt=w1(_Pe,{reducer:ELe,selectors:ePe,actions:OPe});Us(kt);Mf(kt).registerPrivateSelectors(ILe);Mf(kt).registerPrivateActions(wPe);function Ee(e,t={},n=[]){if(!cie(e))return Ee("core/missing",{originalName:e,originalContent:"",originalUndelimitedContent:""});const o=EB(e,t);return{clientId:Is(),name:e,isValid:!0,attributes:o,innerBlocks:n}}function Ad(e=[]){return e.map(t=>{const n=Array.isArray(t)?t:[t.name,t.attributes,t.innerBlocks],[o,r,s=[]]=n;return Ee(o,r,Ad(s))})}function gie(e,t={},n){const{name:o}=e;if(!cie(o))return Ee("core/missing",{originalName:o,originalContent:"",originalUndelimitedContent:""});const r=Is(),s=EB(o,{...e.attributes,...t});return{...e,clientId:r,attributes:s,innerBlocks:n||e.innerBlocks.map(i=>gie(i))}}function jo(e,t={},n){const o=Is();return{...e,clientId:o,attributes:{...e.attributes,...t},innerBlocks:n||e.innerBlocks.map(r=>jo(r))}}const Mie=(e,t,n)=>{if(!n.length)return!1;const o=n.length>1,r=n[0].name;if(!(W2(e)||!o||e.isMultiBlock)||!W2(e)&&!n.every(u=>u.name===r)||!(e.type==="block"))return!1;const c=n[0];return!(!(t!=="from"||e.blocks.indexOf(c.name)!==-1||W2(e))||!o&&t==="from"&&iX(c.name)&&iX(e.blockName)||!YE(e,n))},kPe=e=>e.length?gs().filter(o=>{const r=Ei("from",o.name);return!!xc(r,s=>Mie(s,"from",e))}):[],SPe=e=>{if(!e.length)return[];const t=e[0],n=on(t.name);return(n?Ei("to",n.name):[]).filter(i=>i&&Mie(i,"to",e)).map(i=>i.blocks).flat().map(on)},W2=e=>e&&e.type==="block"&&Array.isArray(e.blocks)&&e.blocks.includes("*"),iX=e=>e===oie();function zie(e){if(!e.length)return[];const t=kPe(e),n=SPe(e);return[...new Set([...t,...n])]}function xc(e,t){const n=Fre();for(let o=0;os||r,r.priority)}return n.applyFilters("transform",null)}function Ei(e,t){if(t===void 0)return gs().map(({name:c})=>Ei(e,c)).flat();const n=M3(t),{name:o,transforms:r}=n||{};if(!r||!Array.isArray(r[e]))return[];const s=r.supportedMobileTransforms&&Array.isArray(r.supportedMobileTransforms);return(s?r[e].filter(c=>c.type==="raw"||c.type==="prefix"?!0:!c.blocks||!c.blocks.length?!1:W2(c)?!0:c.blocks.every(l=>r.supportedMobileTransforms.includes(l))):r[e]).map(c=>({...c,blockName:o,usingMobileTransformations:s}))}function YE(e,t){if(typeof e.isMatch!="function")return!0;const n=t[0],o=e.isMultiBlock?t.map(s=>s.attributes):n.attributes,r=e.isMultiBlock?t:n;return e.isMatch(o,r)}function Kr(e,t){const n=Array.isArray(e)?e:[e],o=n.length>1,r=n[0],s=r.name,i=Ei("from",t),c=Ei("to",s),l=xc(c,f=>f.type==="block"&&(W2(f)||f.blocks.indexOf(t)!==-1)&&(!o||f.isMultiBlock)&&YE(f,n))||xc(i,f=>f.type==="block"&&(W2(f)||f.blocks.indexOf(s)!==-1)&&(!o||f.isMultiBlock)&&YE(f,n));if(!l)return null;let u;return l.isMultiBlock?"__experimentalConvert"in l?u=l.__experimentalConvert(n):u=l.transform(n.map(f=>f.attributes),n.map(f=>f.innerBlocks)):"__experimentalConvert"in l?u=l.__experimentalConvert(r):u=l.transform(r.attributes,r.innerBlocks),u===null||typeof u!="object"||(u=Array.isArray(u)?u:[u],u.some(f=>!on(f.name)))||!u.some(f=>f.name===t)?null:u.map((f,b,h)=>gr("blocks.switchToBlockType.transformedBlock",f,e,b,h))}const LB=(e,t)=>{var n;return Ee(e,t.attributes,((n=t.innerBlocks)!==null&&n!==void 0?n:[]).map(o=>LB(o.name,o)))};let fc,Qa,zf,Qu;const Oie=/)[^])*)\5|[^]*?)}\s+)?(\/)?-->/g;function Iv(e,t,n,o,r){return{blockName:e,attrs:t,innerBlocks:n,innerHTML:o,innerContent:r}}function PB(e){return Iv(null,{},[],e,[e])}function CPe(e,t,n,o,r){return{block:e,tokenStart:t,tokenLength:n,prevOffset:o||t+n,leadingHtmlStart:r}}const yie=e=>{fc=e,Qa=0,zf=[],Qu=[],Oie.lastIndex=0;do;while(qPe());return zf};function qPe(){const e=Qu.length,t=TPe(),[n,o,r,s,i]=t,c=s>Qa?Qa:null;switch(n){case"no-more-tokens":if(e===0)return QS(),!1;if(e===1)return JS(),!1;for(;0{const o="(<("+("(?=!--|!\\[CDATA\\[)((?=!-)"+"!(?:-(?!->)[^\\-]*)*(?:-->)?"+"|"+"!\\[CDATA\\[[^\\]]*(?:](?!]>)[^\\]]*)*?(?:]]>)?"+")")+"|[^>]*>?))";return new RegExp(o)})();function WPe(e){const t=[];let n=e,o;for(;o=n.match(EPe);){const r=o.index;t.push(n.slice(0,r)),t.push(o[0]),n=n.slice(r+o[0].length)}return n.length&&t.push(n),t}function NPe(e,t){const n=WPe(e);let o=!1;const r=Object.keys(t);for(let s=1;s{const r=n.findIndex(s=>s.name===o.name);r!==-1?n[r]={...n[r],...o}:n.push(o)}),n}const hie=(e,t)=>({select:n})=>{const o=n.getBootstrappedBlockType(e),r={name:e,icon:nie,keywords:[],attributes:{},providesContext:{},usesContext:[],selectors:{},supports:{},styles:[],blockHooks:{},save:()=>null,...o,...t,variations:rPe(Array.isArray(o?.variations)?o.variations:[],Array.isArray(t?.variations)?t.variations:[])},s=gr("blocks.registerBlockType",r,e,null);if(s.description&&typeof s.description!="string"&&Ke("Declaring non-string block descriptions",{since:"6.2"}),s.deprecated&&(s.deprecated=s.deprecated.map(i=>Object.fromEntries(Object.entries(gr("blocks.registerBlockType",{...Xf(r,GE),...i},r.name,i)).filter(([c])=>GE.includes(c))))),!a3(s)){globalThis.SCRIPT_DEBUG===!0&&zn("Block settings must be a valid object.");return}if(typeof s.save!="function"){globalThis.SCRIPT_DEBUG===!0&&zn('The "save" property must be a valid function.');return}if("edit"in s&&!oPe.isValidElementType(s.edit)){globalThis.SCRIPT_DEBUG===!0&&zn('The "edit" property must be a valid component.');return}if(sX.hasOwnProperty(s.category)&&(s.category=sX[s.category]),"category"in s&&!n.getCategories().some(({slug:i})=>i===s.category)&&(globalThis.SCRIPT_DEBUG===!0&&zn('The block "'+e+'" is registered with an invalid category "'+s.category+'".'),delete s.category),!("title"in s)||s.title===""){globalThis.SCRIPT_DEBUG===!0&&zn('The block "'+e+'" must have a title.');return}if(typeof s.title!="string"){globalThis.SCRIPT_DEBUG===!0&&zn("Block titles must be strings.");return}if(s.icon=mLe(s.icon),!sie(s.icon.src)){globalThis.SCRIPT_DEBUG===!0&&zn("The icon passed is invalid. The icon should be a string, an element, a function, or an object following the specifications documented in https://developer.wordpress.org/block-editor/developers/block-api/block-registration/#icon-optional");return}if((typeof s?.parent=="string"||s?.parent instanceof String)&&(s.parent=[s.parent],globalThis.SCRIPT_DEBUG===!0&&zn("Parent must be undefined or an array of strings (block types), but it is a string.")),!Array.isArray(s?.parent)&&s?.parent!==void 0){globalThis.SCRIPT_DEBUG===!0&&zn("Parent must be undefined or an array of block types, but it is ",s.parent);return}if(s?.parent?.length===1&&e===s.parent[0]){globalThis.SCRIPT_DEBUG===!0&&zn('Block "'+e+'" cannot be a parent of itself. Please remove the block name from the parent list.');return}return s};function sPe(e){return{type:"ADD_BLOCK_TYPES",blockTypes:Array.isArray(e)?e:[e]}}function mie(){return({dispatch:e,select:t})=>{const n=[];for(const[o,r]of Object.entries(t.getUnprocessedBlockTypes())){const s=e(hie(o,r));s&&n.push(s)}n.length&&e.addBlockTypes(n)}}function iPe(){return Ke('wp.data.dispatch( "core/blocks" ).__experimentalReapplyBlockFilters',{since:"6.4",alternative:"reapplyBlockFilters"}),mie()}function aPe(e){return{type:"REMOVE_BLOCK_TYPES",names:Array.isArray(e)?e:[e]}}function cPe(e,t){return{type:"ADD_BLOCK_STYLES",styles:Array.isArray(t)?t:[t],blockNames:Array.isArray(e)?e:[e]}}function lPe(e,t){return{type:"REMOVE_BLOCK_STYLES",styleNames:Array.isArray(t)?t:[t],blockName:e}}function uPe(e,t){return{type:"ADD_BLOCK_VARIATIONS",variations:Array.isArray(t)?t:[t],blockName:e}}function dPe(e,t){return{type:"REMOVE_BLOCK_VARIATIONS",variationNames:Array.isArray(t)?t:[t],blockName:e}}function pPe(e){return{type:"SET_DEFAULT_BLOCK_NAME",name:e}}function fPe(e){return{type:"SET_FREEFORM_FALLBACK_BLOCK_NAME",name:e}}function bPe(e){return{type:"SET_UNREGISTERED_FALLBACK_BLOCK_NAME",name:e}}function hPe(e){return{type:"SET_GROUPING_BLOCK_NAME",name:e}}function mPe(e){return{type:"SET_CATEGORIES",categories:e}}function gPe(e,t){return{type:"UPDATE_CATEGORY",slug:e,category:t}}function MPe(e,t,n){return{type:"ADD_BLOCK_COLLECTION",namespace:e,title:t,icon:n}}function zPe(e){return{type:"REMOVE_BLOCK_COLLECTION",namespace:e}}const OPe=Object.freeze(Object.defineProperty({__proto__:null,__experimentalReapplyBlockFilters:iPe,addBlockCollection:MPe,addBlockStyles:cPe,addBlockTypes:sPe,addBlockVariations:uPe,reapplyBlockTypeFilters:mie,removeBlockCollection:zPe,removeBlockStyles:lPe,removeBlockTypes:aPe,removeBlockVariations:dPe,setCategories:mPe,setDefaultBlockName:pPe,setFreeformFallbackBlockName:fPe,setGroupingBlockName:hPe,setUnregisteredFallbackBlockName:bPe,updateCategory:gPe},Symbol.toStringTag,{value:"Module"}));function yPe(e,t){return{type:"ADD_BOOTSTRAPPED_BLOCK_TYPE",name:e,blockType:t}}function APe(e,t){return({dispatch:n})=>{n({type:"ADD_UNPROCESSED_BLOCK_TYPE",name:e,blockType:t});const o=n(hie(e,t));o&&n.addBlockTypes(o)}}function vPe(e){return{type:"ADD_BLOCK_BINDINGS_SOURCE",name:e.name,label:e.label,usesContext:e.usesContext,getValues:e.getValues,setValues:e.setValues,canUserEditValue:e.canUserEditValue,getFieldsList:e.getFieldsList}}function xPe(e){return{type:"REMOVE_BLOCK_BINDINGS_SOURCE",name:e}}const wPe=Object.freeze(Object.defineProperty({__proto__:null,addBlockBindingsSource:vPe,addBootstrappedBlockType:yPe,addUnprocessedBlockType:APe,removeBlockBindingsSource:xPe},Symbol.toStringTag,{value:"Module"})),_Pe="core/blocks",kt=w1(_Pe,{reducer:ELe,selectors:ePe,actions:OPe});Us(kt);Mf(kt).registerPrivateSelectors(ILe);Mf(kt).registerPrivateActions(wPe);function Ee(e,t={},n=[]){if(!cie(e))return Ee("core/missing",{originalName:e,originalContent:"",originalUndelimitedContent:""});const o=EB(e,t);return{clientId:Is(),name:e,isValid:!0,attributes:o,innerBlocks:n}}function Ad(e=[]){return e.map(t=>{const n=Array.isArray(t)?t:[t.name,t.attributes,t.innerBlocks],[o,r,s=[]]=n;return Ee(o,r,Ad(s))})}function gie(e,t={},n){const{name:o}=e;if(!cie(o))return Ee("core/missing",{originalName:o,originalContent:"",originalUndelimitedContent:""});const r=Is(),s=EB(o,{...e.attributes,...t});return{...e,clientId:r,attributes:s,innerBlocks:n||e.innerBlocks.map(i=>gie(i))}}function jo(e,t={},n){const o=Is();return{...e,clientId:o,attributes:{...e.attributes,...t},innerBlocks:n||e.innerBlocks.map(r=>jo(r))}}const Mie=(e,t,n)=>{if(!n.length)return!1;const o=n.length>1,r=n[0].name;if(!(W2(e)||!o||e.isMultiBlock)||!W2(e)&&!n.every(u=>u.name===r)||!(e.type==="block"))return!1;const c=n[0];return!(!(t!=="from"||e.blocks.indexOf(c.name)!==-1||W2(e))||!o&&t==="from"&&iX(c.name)&&iX(e.blockName)||!YE(e,n))},kPe=e=>e.length?gs().filter(o=>{const r=Ei("from",o.name);return!!xc(r,s=>Mie(s,"from",e))}):[],SPe=e=>{if(!e.length)return[];const t=e[0],n=on(t.name);return(n?Ei("to",n.name):[]).filter(i=>i&&Mie(i,"to",e)).map(i=>i.blocks).flat().map(on)},W2=e=>e&&e.type==="block"&&Array.isArray(e.blocks)&&e.blocks.includes("*"),iX=e=>e===oie();function zie(e){if(!e.length)return[];const t=kPe(e),n=SPe(e);return[...new Set([...t,...n])]}function xc(e,t){const n=Ire();for(let o=0;os||r,r.priority)}return n.applyFilters("transform",null)}function Ei(e,t){if(t===void 0)return gs().map(({name:c})=>Ei(e,c)).flat();const n=M3(t),{name:o,transforms:r}=n||{};if(!r||!Array.isArray(r[e]))return[];const s=r.supportedMobileTransforms&&Array.isArray(r.supportedMobileTransforms);return(s?r[e].filter(c=>c.type==="raw"||c.type==="prefix"?!0:!c.blocks||!c.blocks.length?!1:W2(c)?!0:c.blocks.every(l=>r.supportedMobileTransforms.includes(l))):r[e]).map(c=>({...c,blockName:o,usingMobileTransformations:s}))}function YE(e,t){if(typeof e.isMatch!="function")return!0;const n=t[0],o=e.isMultiBlock?t.map(s=>s.attributes):n.attributes,r=e.isMultiBlock?t:n;return e.isMatch(o,r)}function Kr(e,t){const n=Array.isArray(e)?e:[e],o=n.length>1,r=n[0],s=r.name,i=Ei("from",t),c=Ei("to",s),l=xc(c,f=>f.type==="block"&&(W2(f)||f.blocks.indexOf(t)!==-1)&&(!o||f.isMultiBlock)&&YE(f,n))||xc(i,f=>f.type==="block"&&(W2(f)||f.blocks.indexOf(s)!==-1)&&(!o||f.isMultiBlock)&&YE(f,n));if(!l)return null;let u;return l.isMultiBlock?"__experimentalConvert"in l?u=l.__experimentalConvert(n):u=l.transform(n.map(f=>f.attributes),n.map(f=>f.innerBlocks)):"__experimentalConvert"in l?u=l.__experimentalConvert(r):u=l.transform(r.attributes,r.innerBlocks),u===null||typeof u!="object"||(u=Array.isArray(u)?u:[u],u.some(f=>!on(f.name)))||!u.some(f=>f.name===t)?null:u.map((f,b,h)=>gr("blocks.switchToBlockType.transformedBlock",f,e,b,h))}const LB=(e,t)=>{var n;return Ee(e,t.attributes,((n=t.innerBlocks)!==null&&n!==void 0?n:[]).map(o=>LB(o.name,o)))};let fc,Qa,zf,Qu;const Oie=/)[^])*)\5|[^]*?)}\s+)?(\/)?-->/g;function Iv(e,t,n,o,r){return{blockName:e,attrs:t,innerBlocks:n,innerHTML:o,innerContent:r}}function PB(e){return Iv(null,{},[],e,[e])}function CPe(e,t,n,o,r){return{block:e,tokenStart:t,tokenLength:n,prevOffset:o||t+n,leadingHtmlStart:r}}const yie=e=>{fc=e,Qa=0,zf=[],Qu=[],Oie.lastIndex=0;do;while(qPe());return zf};function qPe(){const e=Qu.length,t=TPe(),[n,o,r,s,i]=t,c=s>Qa?Qa:null;switch(n){case"no-more-tokens":if(e===0)return QS(),!1;if(e===1)return JS(),!1;for(;0{const o="(<("+("(?=!--|!\\[CDATA\\[)((?=!-)"+"!(?:-(?!->)[^\\-]*)*(?:-->)?"+"|"+"!\\[CDATA\\[[^\\]]*(?:](?!]>)[^\\]]*)*?(?:]]>)?"+")")+"|[^>]*>?))";return new RegExp(o)})();function WPe(e){const t=[];let n=e,o;for(;o=n.match(EPe);){const r=o.index;t.push(n.slice(0,r)),t.push(o[0]),n=n.slice(r+o[0].length)}return n.length&&t.push(n),t}function NPe(e,t){const n=WPe(e);let o=!1;const r=Object.keys(t);for(let s=1;s"),i=s.pop();e="";for(let c=0;c";n.push([d,l.substr(u)+""]),e+=l.substr(0,u)+d}e+=i}e=e.replace(/\s*/g,` `);const o="(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)";e=e.replace(new RegExp("(<"+o+"[\\s/>])","g"),` @@ -120,7 +120,7 @@ $1`),e=e.replace(new RegExp("()","g"),`$1 $1`),e=e.replace(/^\s+/,""),e=e.replace(/[\s\u00a0]+$/,""),s&&(e=e.replace(//g,` `)),i&&(e=e.replace(/]*)>/g,"")),r.length&&(e=e.replace(//g,()=>r.shift())),e):""}function ez(e,t={}){const{isCommentDelimited:n=!0}=t,{blockName:o,attrs:r={},innerBlocks:s=[],innerContent:i=[]}=e;let c=0;const l=i.map(u=>u!==null?u:ez(s[c++],t)).join(` `).replace(/\n+/g,` -`).trim();return n?_ie(o,r,l):l}function G4(e){const t="wp-block-"+e.replace(/\//,"-").replace(/^core-/,"");return gr("blocks.getBlockDefaultClassName",t,e)}function jB(e){const t="editor-block-list-item-"+e.replace(/\//,"-").replace(/^core-/,"");return gr("blocks.getBlockMenuDefaultClassName",t,e)}const ZE={},xie={};function K4(e={}){const{blockType:t,attributes:n}=ZE;return K4.skipFilters?e:gr("blocks.getSaveContent.extraProps",{...e},t,n)}function BPe(e={}){const{innerBlocks:t}=xie;if(!Array.isArray(t))return{...e,children:t};const n=Ks(t,{isInnerBlocks:!0});return{...e,children:a.jsx(i0,{children:n})}}function wie(e,t,n=[]){const o=M3(e);if(!o?.save)return null;let{save:r}=o;if(r.prototype instanceof x.Component){const i=new r({attributes:t});r=i.render.bind(i)}ZE.blockType=o,ZE.attributes=t,xie.innerBlocks=n;let s=r({attributes:t,innerBlocks:n});if(s!==null&&typeof s=="object"&&Vre("blocks.getSaveContent.extraProps")&&!(o.apiVersion>1)){const i=gr("blocks.getSaveContent.extraProps",{...s.props},o,t);ds(i,s.props)||(s=x.cloneElement(s,i))}return gr("blocks.getSaveElement",s,o,t)}function Gf(e,t,n){const o=M3(e);return M1(wie(o,t,n))}function LPe(e,t){var n;return Object.entries((n=e.attributes)!==null&&n!==void 0?n:{}).reduce((o,[r,s])=>{const i=t[r];return i===void 0||s.source!==void 0||s.role==="local"?o:s.__experimentalRole==="local"?(Ke("__experimentalRole attribute",{since:"6.7",version:"6.8",alternative:"role attribute",hint:`Check the block.json of the ${e?.name} block.`}),o):("default"in s&&JSON.stringify(s.default)===JSON.stringify(i)||(o[r]=i),o)},{})}function PPe(e){return JSON.stringify(e).replace(/--/g,"\\u002d\\u002d").replace(//g,"\\u003e").replace(/&/g,"\\u0026").replace(/\\"/g,"\\u0022")}function Y5(e){let t=e.originalContent;if(e.isValid||e.innerBlocks.length)try{t=Gf(e.name,e.attributes,e.innerBlocks)}catch{}return t}function _ie(e,t,n){const o=t&&Object.entries(t).length?PPe(t)+" ":"",r=e?.startsWith("core/")?e.slice(5):e;return n?` +`).trim();return n?_ie(o,r,l):l}function G4(e){const t="wp-block-"+e.replace(/\//,"-").replace(/^core-/,"");return gr("blocks.getBlockDefaultClassName",t,e)}function jB(e){const t="editor-block-list-item-"+e.replace(/\//,"-").replace(/^core-/,"");return gr("blocks.getBlockMenuDefaultClassName",t,e)}const ZE={},xie={};function K4(e={}){const{blockType:t,attributes:n}=ZE;return K4.skipFilters?e:gr("blocks.getSaveContent.extraProps",{...e},t,n)}function BPe(e={}){const{innerBlocks:t}=xie;if(!Array.isArray(t))return{...e,children:t};const n=Ks(t,{isInnerBlocks:!0});return{...e,children:a.jsx(i0,{children:n})}}function wie(e,t,n=[]){const o=M3(e);if(!o?.save)return null;let{save:r}=o;if(r.prototype instanceof x.Component){const i=new r({attributes:t});r=i.render.bind(i)}ZE.blockType=o,ZE.attributes=t,xie.innerBlocks=n;let s=r({attributes:t,innerBlocks:n});if(s!==null&&typeof s=="object"&&Fre("blocks.getSaveContent.extraProps")&&!(o.apiVersion>1)){const i=gr("blocks.getSaveContent.extraProps",{...s.props},o,t);ds(i,s.props)||(s=x.cloneElement(s,i))}return gr("blocks.getSaveElement",s,o,t)}function Gf(e,t,n){const o=M3(e);return M1(wie(o,t,n))}function LPe(e,t){var n;return Object.entries((n=e.attributes)!==null&&n!==void 0?n:{}).reduce((o,[r,s])=>{const i=t[r];return i===void 0||s.source!==void 0||s.role==="local"?o:s.__experimentalRole==="local"?(Ke("__experimentalRole attribute",{since:"6.7",version:"6.8",alternative:"role attribute",hint:`Check the block.json of the ${e?.name} block.`}),o):("default"in s&&JSON.stringify(s.default)===JSON.stringify(i)||(o[r]=i),o)},{})}function PPe(e){return JSON.stringify(e).replace(/--/g,"\\u002d\\u002d").replace(//g,"\\u003e").replace(/&/g,"\\u0026").replace(/\\"/g,"\\u0022")}function Y5(e){let t=e.originalContent;if(e.isValid||e.innerBlocks.length)try{t=Gf(e.name,e.attributes,e.innerBlocks)}catch{}return t}function _ie(e,t,n){const o=t&&Object.entries(t).length?PPe(t)+" ":"",r=e?.startsWith("core/")?e.slice(5):e;return n?` `+n+` `:``}function jPe(e,{isInnerBlocks:t=!1}={}){if(!e.isValid&&e.__unstableBlockSource)return ez(e.__unstableBlockSource);const n=e.name,o=Y5(e);if(n===g3()||!t&&n===yd())return o;const r=on(n);if(!r)return o;const s=LPe(r,e.attributes);return _ie(n,s,o)}function Jd(e){e.length===1&&El(e[0])&&(e=[]);let t=Ks(e);return e.length===1&&e[0].name===yd()&&e[0].name==="core/freeform"&&(t=vie(t)),t}function Ks(e,t){return(Array.isArray(e)?e:[e]).map(o=>jPe(o,t)).join(` @@ -137,7 +137,7 @@ Content generated by \`save\` function: Content retrieved from post body: -%s`,r.name,r,s,e.originalContent),[i,o.getItems()]}function Sie(e,t){const n={...t};if(e==="core/cover-image"&&(e="core/cover"),(e==="core/text"||e==="core/cover-text")&&(e="core/paragraph"),e&&e.indexOf("core/social-link-")===0&&(n.service=e.substring(17),e="core/social-link"),e&&e.indexOf("core-embed/")===0){const o=e.substring(11),r={speaker:"speaker-deck",polldaddy:"crowdsignal"};n.providerNameSlug=o in r?r[o]:o,["amazon-kindle","wordpress"].includes(o)||(n.responsive=!0),e="core/embed"}if(e==="core/post-comment-author"&&(e="core/comment-author-name"),e==="core/post-comment-content"&&(e="core/comment-content"),e==="core/post-comment-date"&&(e="core/comment-date"),e==="core/comments-query-loop"){e="core/comments";const{className:o=""}=n;o.includes("wp-block-comments-query-loop")||(n.className=["wp-block-comments-query-loop",o].join(" "))}if(e==="core/post-comments"&&(e="core/comments",n.legacy=!0),t.layout?.type==="grid"&&typeof t.layout?.columnCount=="string"&&(n.layout={...n.layout,columnCount:parseInt(t.layout.columnCount,10)}),typeof t.style?.layout?.columnSpan=="string"){const o=parseInt(t.style.layout.columnSpan,10);n.style={...n.style,layout:{...n.style.layout,columnSpan:isNaN(o)?void 0:o}}}if(typeof t.style?.layout?.rowSpan=="string"){const o=parseInt(t.style.layout.rowSpan,10);n.style={...n.style,layout:{...n.style.layout,rowSpan:isNaN(o)?void 0:o}}}if(globalThis.IS_GUTENBERG_PLUGIN&&n.metadata?.bindings&&(e==="core/paragraph"||e==="core/heading"||e==="core/image"||e==="core/button")&&n.metadata.bindings.__default?.source!=="core/pattern-overrides"){const o=["content","url","title","id","alt","text","linkTarget"];let r=!1;o.forEach(s=>{n.metadata.bindings[s]?.source==="core/pattern-overrides"&&(r=!0,n.metadata={...n.metadata,bindings:{...n.metadata.bindings}},delete n.metadata.bindings[s])}),r&&(n.metadata.bindings.__default={source:"core/pattern-overrides"})}return[e,n]}function bje(e,t){for(var n=t.split("."),o;o=n.shift();){if(!(o in e))return;e=e[o]}return e}var hje=function(){var e;return function(){return e||(e=document.implementation.createHTMLDocument("")),e}}();function DB(e,t){if(t){if(typeof e=="string"){var n=hje();n.body.innerHTML=e,e=n.body}if(typeof t=="function")return t(e);if(Object===t.constructor)return Object.keys(t).reduce(function(o,r){var s=t[r];return o[r]=DB(e,s),o},{})}}function FB(e,t){var n,o;return arguments.length===1?(n=e,o=void 0):(n=t,o=e),function(r){var s=r;if(o&&(s=r.querySelector(o)),s)return bje(s,n)}}function mje(e,t){var n,o;return arguments.length===1?(n=e,o=void 0):(n=t,o=e),function(r){var s=FB(o,"attributes")(r);if(s&&Object.prototype.hasOwnProperty.call(s,n))return s[n].value}}function gje(e){return FB(e,"textContent")}function Mje(e,t){return function(n){var o=n.querySelectorAll(e);return[].map.call(o,function(r){return DB(r,t)})}}function zje(e){return Ke("wp.blocks.children.getChildrenArray",{since:"6.1",version:"6.3",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),e}function Oje(...e){Ke("wp.blocks.children.concat",{since:"6.1",version:"6.3",alternative:"wp.richText.concat",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"});const t=[];for(let n=0;n{let n=t;return e&&(n=t.querySelector(e)),n?$B(n.childNodes):[]}}const QE={concat:Oje,getChildrenArray:zje,fromDOM:$B,toHTML:yje,matcher:Cie};function Aje(e){const t={};for(let n=0;n{let n=t;e&&(n=t.querySelector(e));try{return qie(n)}catch{return null}}}function xje(e,t){return n=>{let o=n;if(e&&(o=n.querySelector(e)),!o)return"";if(t){let r="";const s=o.children.length;for(let i=0;in=>{const o=e?n.querySelector(e):n;return o?Xo.fromHTMLElement(o,{preserveWhiteSpace:t}):Xo.empty()},_je=e=>t=>e(t)!==void 0;function kje(e,t){switch(t){case"rich-text":return e instanceof Xo;case"string":return typeof e=="string";case"boolean":return typeof e=="boolean";case"object":return!!e&&e.constructor===Object;case"null":return e===null;case"array":return Array.isArray(e);case"integer":case"number":return typeof e=="number"}return!0}function Sje(e,t){return t.some(n=>kje(e,n))}function Cje(e,t,n,o,r){let s;switch(t.source){case void 0:s=o?o[e]:void 0;break;case"raw":s=r;break;case"attribute":case"property":case"html":case"text":case"rich-text":case"children":case"node":case"query":case"tag":s=Z5(n,t);break}return(!qje(s,t.type)||!Rje(s,t.enum))&&(s=void 0),s===void 0&&(s=aie(t)),s}function qje(e,t){return t===void 0||Sje(e,Array.isArray(t)?t:[t])}function Rje(e,t){return!Array.isArray(t)||t.includes(e)}const Rie=Hs(e=>{switch(e.source){case"attribute":{let n=mje(e.selector,e.attribute);return e.type==="boolean"&&(n=_je(n)),n}case"html":return xje(e.selector,e.multiline);case"text":return gje(e.selector);case"rich-text":return wje(e.selector,e.__unstablePreserveWhiteSpace);case"children":return Cie(e.selector);case"node":return vje(e.selector);case"query":const t=Object.fromEntries(Object.entries(e.query).map(([n,o])=>[n,Rie(o)]));return Mje(e.selector,t);case"tag":{const n=FB(e.selector,"nodeName");return o=>n(o)?.toLowerCase()}default:console.error(`Unknown source type "${e.source}"`)}});function Tie(e){return DB(e,t=>t)}function Z5(e,t){return Rie(t)(Tie(e))}function Wl(e,t,n={}){var o;const r=Tie(t),s=M3(e),i=Object.fromEntries(Object.entries((o=s.attributes)!==null&&o!==void 0?o:{}).map(([c,l])=>[c,Cje(c,l,r,n,t)]));return gr("blocks.getBlockAttributes",i,s,t,n)}const Tje={type:"string",source:"attribute",selector:"[data-custom-class-name] > *",attribute:"class"};function pX(e){const t=Z5(`
${e}
`,Tje);return t?t.trim().split(/\s+/):[]}function Eje(e,t,n){if(!Et(t,"customClassName",!0))return e;const o={...e},{className:r,...s}=o,i=Gf(t,s),c=pX(i),u=pX(n).filter(d=>!c.includes(d));return u.length?o.className=u.join(" "):i&&delete o.className,o}const Wje={type:"string",source:"attribute",selector:"[data-aria-label] > *",attribute:"aria-label"};function Nje(e){return Z5(`
${e}
`,Wje)}function Bje(e,t,n){if(!Et(t,"ariaLabel",!1))return e;const o={...e},r=Nje(n);return r&&(o.ariaLabel=r),o}function Y4(e,t){const{attributes:n,originalContent:o}=e;let r=n;return r=Eje(n,t,o),r=Bje(r,t,o),{...e,attributes:r}}function Lje(){return!1}function Pje(e,t,n){const o=t.attrs,{deprecated:r}=n;if(!r||!r.length)return e;for(let s=0;sEie(d,t)).filter(d=>!!d),i=Ee(n.blockName,Wl(o,n.innerHTML,n.attrs),s);i.originalContent=n.innerHTML;const c=Fje(i,o),{validationIssues:l}=c,u=Pje(c,n,o);return u.isValid||(u.__unstableBlockSource=e),!c.isValid&&u.isValid&&!t?.__unstableSkipMigrationLogs?(console.groupCollapsed("Updated Block: %s",o.name),console.info(`Block successfully updated for \`%s\` (%o). +%s`,r.name,r,s,e.originalContent),[i,o.getItems()]}function Sie(e,t){const n={...t};if(e==="core/cover-image"&&(e="core/cover"),(e==="core/text"||e==="core/cover-text")&&(e="core/paragraph"),e&&e.indexOf("core/social-link-")===0&&(n.service=e.substring(17),e="core/social-link"),e&&e.indexOf("core-embed/")===0){const o=e.substring(11),r={speaker:"speaker-deck",polldaddy:"crowdsignal"};n.providerNameSlug=o in r?r[o]:o,["amazon-kindle","wordpress"].includes(o)||(n.responsive=!0),e="core/embed"}if(e==="core/post-comment-author"&&(e="core/comment-author-name"),e==="core/post-comment-content"&&(e="core/comment-content"),e==="core/post-comment-date"&&(e="core/comment-date"),e==="core/comments-query-loop"){e="core/comments";const{className:o=""}=n;o.includes("wp-block-comments-query-loop")||(n.className=["wp-block-comments-query-loop",o].join(" "))}if(e==="core/post-comments"&&(e="core/comments",n.legacy=!0),t.layout?.type==="grid"&&typeof t.layout?.columnCount=="string"&&(n.layout={...n.layout,columnCount:parseInt(t.layout.columnCount,10)}),typeof t.style?.layout?.columnSpan=="string"){const o=parseInt(t.style.layout.columnSpan,10);n.style={...n.style,layout:{...n.style.layout,columnSpan:isNaN(o)?void 0:o}}}if(typeof t.style?.layout?.rowSpan=="string"){const o=parseInt(t.style.layout.rowSpan,10);n.style={...n.style,layout:{...n.style.layout,rowSpan:isNaN(o)?void 0:o}}}if(globalThis.IS_GUTENBERG_PLUGIN&&n.metadata?.bindings&&(e==="core/paragraph"||e==="core/heading"||e==="core/image"||e==="core/button")&&n.metadata.bindings.__default?.source!=="core/pattern-overrides"){const o=["content","url","title","id","alt","text","linkTarget"];let r=!1;o.forEach(s=>{n.metadata.bindings[s]?.source==="core/pattern-overrides"&&(r=!0,n.metadata={...n.metadata,bindings:{...n.metadata.bindings}},delete n.metadata.bindings[s])}),r&&(n.metadata.bindings.__default={source:"core/pattern-overrides"})}return[e,n]}function bje(e,t){for(var n=t.split("."),o;o=n.shift();){if(!(o in e))return;e=e[o]}return e}var hje=function(){var e;return function(){return e||(e=document.implementation.createHTMLDocument("")),e}}();function DB(e,t){if(t){if(typeof e=="string"){var n=hje();n.body.innerHTML=e,e=n.body}if(typeof t=="function")return t(e);if(Object===t.constructor)return Object.keys(t).reduce(function(o,r){var s=t[r];return o[r]=DB(e,s),o},{})}}function FB(e,t){var n,o;return arguments.length===1?(n=e,o=void 0):(n=t,o=e),function(r){var s=r;if(o&&(s=r.querySelector(o)),s)return bje(s,n)}}function mje(e,t){var n,o;return arguments.length===1?(n=e,o=void 0):(n=t,o=e),function(r){var s=FB(o,"attributes")(r);if(s&&Object.prototype.hasOwnProperty.call(s,n))return s[n].value}}function gje(e){return FB(e,"textContent")}function Mje(e,t){return function(n){var o=n.querySelectorAll(e);return[].map.call(o,function(r){return DB(r,t)})}}function zje(e){return Ke("wp.blocks.children.getChildrenArray",{since:"6.1",version:"6.3",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),e}function Oje(...e){Ke("wp.blocks.children.concat",{since:"6.1",version:"6.3",alternative:"wp.richText.concat",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"});const t=[];for(let n=0;n{let n=t;return e&&(n=t.querySelector(e)),n?$B(n.childNodes):[]}}const QE={concat:Oje,getChildrenArray:zje,fromDOM:$B,toHTML:yje,matcher:Cie};function Aje(e){const t={};for(let n=0;n{let n=t;e&&(n=t.querySelector(e));try{return qie(n)}catch{return null}}}function xje(e,t){return n=>{let o=n;if(e&&(o=n.querySelector(e)),!o)return"";if(t){let r="";const s=o.children.length;for(let i=0;in=>{const o=e?n.querySelector(e):n;return o?Xo.fromHTMLElement(o,{preserveWhiteSpace:t}):Xo.empty()},_je=e=>t=>e(t)!==void 0;function kje(e,t){switch(t){case"rich-text":return e instanceof Xo;case"string":return typeof e=="string";case"boolean":return typeof e=="boolean";case"object":return!!e&&e.constructor===Object;case"null":return e===null;case"array":return Array.isArray(e);case"integer":case"number":return typeof e=="number"}return!0}function Sje(e,t){return t.some(n=>kje(e,n))}function Cje(e,t,n,o,r){let s;switch(t.source){case void 0:s=o?o[e]:void 0;break;case"raw":s=r;break;case"attribute":case"property":case"html":case"text":case"rich-text":case"children":case"node":case"query":case"tag":s=Z5(n,t);break}return(!qje(s,t.type)||!Rje(s,t.enum))&&(s=void 0),s===void 0&&(s=aie(t)),s}function qje(e,t){return t===void 0||Sje(e,Array.isArray(t)?t:[t])}function Rje(e,t){return!Array.isArray(t)||t.includes(e)}const Rie=Hs(e=>{switch(e.source){case"attribute":{let n=mje(e.selector,e.attribute);return e.type==="boolean"&&(n=_je(n)),n}case"html":return xje(e.selector,e.multiline);case"text":return gje(e.selector);case"rich-text":return wje(e.selector,e.__unstablePreserveWhiteSpace);case"children":return Cie(e.selector);case"node":return vje(e.selector);case"query":const t=Object.fromEntries(Object.entries(e.query).map(([n,o])=>[n,Rie(o)]));return Mje(e.selector,t);case"tag":{const n=FB(e.selector,"nodeName");return o=>n(o)?.toLowerCase()}default:console.error(`Unknown source type "${e.source}"`)}});function Tie(e){return DB(e,t=>t)}function Z5(e,t){return Rie(t)(Tie(e))}function Wl(e,t,n={}){var o;const r=Tie(t),s=M3(e),i=Object.fromEntries(Object.entries((o=s.attributes)!==null&&o!==void 0?o:{}).map(([c,l])=>[c,Cje(c,l,r,n,t)]));return gr("blocks.getBlockAttributes",i,s,t,n)}const Tje={type:"string",source:"attribute",selector:"[data-custom-class-name] > *",attribute:"class"};function pX(e){const t=Z5(`
${e}
`,Tje);return t?t.trim().split(/\s+/):[]}function Eje(e,t,n){if(!Tt(t,"customClassName",!0))return e;const o={...e},{className:r,...s}=o,i=Gf(t,s),c=pX(i),u=pX(n).filter(d=>!c.includes(d));return u.length?o.className=u.join(" "):i&&delete o.className,o}const Wje={type:"string",source:"attribute",selector:"[data-aria-label] > *",attribute:"aria-label"};function Nje(e){return Z5(`
${e}
`,Wje)}function Bje(e,t,n){if(!Tt(t,"ariaLabel",!1))return e;const o={...e},r=Nje(n);return r&&(o.ariaLabel=r),o}function Y4(e,t){const{attributes:n,originalContent:o}=e;let r=n;return r=Eje(n,t,o),r=Bje(r,t,o),{...e,attributes:r}}function Lje(){return!1}function Pje(e,t,n){const o=t.attrs,{deprecated:r}=n;if(!r||!r.length)return e;for(let s=0;sEie(d,t)).filter(d=>!!d),i=Ee(n.blockName,Wl(o,n.innerHTML,n.attrs),s);i.originalContent=n.innerHTML;const c=Fje(i,o),{validationIssues:l}=c,u=Pje(c,n,o);return u.isValid||(u.__unstableBlockSource=e),!c.isValid&&u.isValid&&!t?.__unstableSkipMigrationLogs?(console.groupCollapsed("Updated Block: %s",o.name),console.info(`Block successfully updated for \`%s\` (%o). New content generated by \`save\` function: @@ -145,7 +145,7 @@ New content generated by \`save\` function: Content retrieved from post body: -%s`,o.name,o,Gf(o,u.attributes),u.originalContent),console.groupEnd()):!c.isValid&&!u.isValid&&l.forEach(({log:d,args:p})=>d(...p)),u}function Ko(e,t){return yie(e).reduce((n,o)=>{const r=Eie(o,t);return r&&n.push(r),n},[])}function Wie(){return Ei("from").filter(({type:e})=>e==="raw").map(e=>e.isMatch?e:{...e,isMatch:t=>e.selector&&t.matches(e.selector)})}function Nie(e,t){const n=document.implementation.createHTMLDocument("");return n.body.innerHTML=e,Array.from(n.body.children).flatMap(o=>{const r=xc(Wie(),({isMatch:c})=>c(o));if(!r)return f0.isNative?Ko(`${o.outerHTML}`):Ee("core/html",Wl("core/html",o.outerHTML));const{transform:s,blockName:i}=r;if(s){const c=s(o,t);return o.hasAttribute("class")&&(c.attributes.className=o.getAttribute("class")),c}return Ee(i,Wl(i,o.outerHTML))})}function Q5(e,t={}){const n=document.implementation.createHTMLDocument(""),o=document.implementation.createHTMLDocument(""),r=n.body,s=o.body;for(r.innerHTML=e;r.firstChild;){const i=r.firstChild;i.nodeType===i.TEXT_NODE?C4(i)?r.removeChild(i):((!s.lastChild||s.lastChild.nodeName!=="P")&&s.appendChild(o.createElement("P")),s.lastChild.appendChild(i)):i.nodeType===i.ELEMENT_NODE?i.nodeName==="BR"?(i.nextSibling&&i.nextSibling.nodeName==="BR"&&(s.appendChild(o.createElement("P")),r.removeChild(i.nextSibling)),s.lastChild&&s.lastChild.nodeName==="P"&&s.lastChild.hasChildNodes()?s.lastChild.appendChild(i):r.removeChild(i)):i.nodeName==="P"?C4(i)&&!t.raw?r.removeChild(i):s.appendChild(i):k2(i)?((!s.lastChild||s.lastChild.nodeName!=="P")&&s.appendChild(o.createElement("P")),s.lastChild.appendChild(i)):s.appendChild(i):r.removeChild(i)}return s.innerHTML}function Bie(e,t){if(e.nodeType!==e.COMMENT_NODE||e.nodeValue!=="nextpage"&&e.nodeValue.indexOf("more")!==0)return;const n=$je(e,t);if(!e.parentNode||e.parentNode.nodeName!=="P")_Se(e,n);else{const o=Array.from(e.parentNode.childNodes),r=o.indexOf(e),s=e.parentNode.parentNode||t.body,i=(c,l)=>(c||(c=t.createElement("p")),c.appendChild(l),c);[o.slice(0,r).reduce(i,null),n,o.slice(r+1).reduce(i,null)].forEach(c=>c&&s.insertBefore(c,e.parentNode)),pf(e.parentNode)}}function $je(e,t){if(e.nodeValue==="nextpage")return Hje(t);const n=e.nodeValue.slice(4).trim();let o=e,r=!1;for(;o=o.nextSibling;)if(o.nodeType===o.COMMENT_NODE&&o.nodeValue==="noteaser"){r=!0,pf(o);break}return Vje(n,r,t)}function Vje(e,t,n){const o=n.createElement("wp-block");return o.dataset.block="core/more",e&&(o.dataset.customText=e),t&&(o.dataset.noTeaser=""),o}function Hje(e){const t=e.createElement("wp-block");return t.dataset.block="core/nextpage",t}function fX(e){return e.nodeName==="OL"||e.nodeName==="UL"}function Uje(e){return Array.from(e.childNodes).map(({nodeValue:t=""})=>t).join("")}function Lie(e){if(!fX(e))return;const t=e,n=e.previousElementSibling;if(n&&n.nodeName===e.nodeName&&t.children.length===1){for(;t.firstChild;)n.appendChild(t.firstChild);t.parentNode.removeChild(t)}const o=e.parentNode;if(o&&o.nodeName==="LI"&&o.children.length===1&&!/\S/.test(Uje(o))){const r=o,s=r.previousElementSibling,i=r.parentNode;s&&(s.appendChild(t),i.removeChild(r))}if(o&&fX(o)){const r=e.previousElementSibling;r?r.appendChild(e):mM(e)}}function Pie(e){return t=>{t.nodeName==="BLOCKQUOTE"&&(t.innerHTML=Q5(t.innerHTML,e))}}function Xje(e,t){var n;const o=e.nodeName.toLowerCase();return o==="figcaption"||h0e(e)?!1:o in((n=t?.figure?.children)!==null&&n!==void 0?n:{})}function Gje(e,t){var n;return e.nodeName.toLowerCase()in((n=t?.figure?.children?.a?.children)!==null&&n!==void 0?n:{})}function eC(e,t=e){const n=e.ownerDocument.createElement("figure");t.parentNode.insertBefore(n,t),n.appendChild(e)}function jie(e,t,n){if(!Xje(e,n))return;let o=e;const r=e.parentNode;Gje(e,n)&&r.nodeName==="A"&&r.childNodes.length===1&&(o=e.parentNode);const s=o.closest("p,div");s?e.classList?(e.classList.contains("alignright")||e.classList.contains("alignleft")||e.classList.contains("aligncenter")||!s.textContent.trim())&&eC(o,s):eC(o,s):eC(o)}function VB(e,t,n=0){const o=nz(e);o.lastIndex=n;const r=o.exec(t);if(!r)return;if(r[1]==="["&&r[7]==="]")return VB(e,t,o.lastIndex);const s={index:r.index,content:r[0],shortcode:HB(r)};return r[1]&&(s.content=s.content.slice(1),s.index++),r[7]&&(s.content=s.content.slice(0,-1)),s}function Kje(e,t,n){return t.replace(nz(e),function(o,r,s,i,c,l,u,d){if(r==="["&&d==="]")return o;const p=n(HB(arguments));return p||p===""?r+p+d:o})}function Yje(e){return new UB(e).string()}function nz(e){return new RegExp("\\[(\\[?)("+e+")(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*(?:\\[(?!\\/\\2\\])[^\\[]*)*)(\\[\\/\\2\\]))?)(\\]?)","g")}const bX=Hs(e=>{const t={},n=[],o=/([\w-]+)\s*=\s*"([^"]*)"(?:\s|$)|([\w-]+)\s*=\s*'([^']*)'(?:\s|$)|([\w-]+)\s*=\s*([^\s'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|'([^']*)'(?:\s|$)|(\S+)(?:\s|$)/g;e=e.replace(/[\u00a0\u200b]/g," ");let r;for(;r=o.exec(e);)r[1]?t[r[1].toLowerCase()]=r[2]:r[3]?t[r[3].toLowerCase()]=r[4]:r[5]?t[r[5].toLowerCase()]=r[6]:r[7]?n.push(r[7]):r[8]?n.push(r[8]):r[9]&&n.push(r[9]);return{named:t,numeric:n}});function HB(e){let t;return e[4]?t="self-closing":e[6]?t="closed":t="single",new UB({tag:e[2],attrs:e[3],type:t,content:e[5]})}const UB=Object.assign(function(e){const{tag:t,attrs:n,type:o,content:r}=e||{};if(Object.assign(this,{tag:t,type:o,content:r}),this.attrs={named:{},numeric:[]},!n)return;const s=["named","numeric"];typeof n=="string"?this.attrs=bX(n):n.length===s.length&&s.every((i,c)=>i===n[c])?this.attrs=n:Object.entries(n).forEach(([i,c])=>{this.set(i,c)})},{next:VB,replace:Kje,string:Yje,regexp:nz,attrs:bX,fromMatch:HB});Object.assign(UB.prototype,{get(e){return this.attrs[typeof e=="number"?"numeric":"named"][e]},set(e,t){return this.attrs[typeof e=="number"?"numeric":"named"][e]=t,this},string(){let e="["+this.tag;return this.attrs.numeric.forEach(t=>{/\s/.test(t)?e+=' "'+t+'"':e+=" "+t}),Object.entries(this.attrs.named).forEach(([t,n])=>{e+=" "+t+'="'+n+'"'}),this.type==="single"?e+"]":this.type==="self-closing"?e+" /]":(e+="]",this.content&&(e+=this.content),e+"[/"+this.tag+"]")}});const hX=e=>Array.isArray(e)?e:[e],mX=/(\n|

)\s*$/,gX=/^\s*(\n|<\/p>)/;function u2(e,t=0,n=[]){const o=Ei("from"),r=xc(o,u=>n.indexOf(u.blockName)===-1&&u.type==="shortcode"&&hX(u.tag).some(d=>nz(d).test(e)));if(!r)return[e];const i=hX(r.tag).find(u=>nz(u).test(e));let c;const l=t;if(c=VB(i,e,t)){t=c.index+c.content.length;const u=e.substr(0,c.index),d=e.substr(t);if(!c.shortcode.content?.includes("<")&&!(mX.test(u)&&gX.test(d)))return u2(e,t);if(r.isMatch&&!r.isMatch(c.shortcode.attrs))return u2(e,l,[...n,r.blockName]);let p=[];if(typeof r.transform=="function")p=[].concat(r.transform(c.shortcode.attrs,c)),p=p.map(f=>(f.originalContent=c.shortcode.content,Y4(f,on(f.name))));else{const f=Object.fromEntries(Object.entries(r.attributes).filter(([,z])=>z.shortcode).map(([z,A])=>[z,A.shortcode(c.shortcode.attrs,c)])),b=on(r.blockName);if(!b)return[e];const h={...b,attributes:r.attributes};let g=Ee(r.blockName,Wl(h,c.shortcode.content,f));g.originalContent=c.shortcode.content,g=Y4(g,h),p=[g]}return[...u2(u.replace(mX,"")),...p,...u2(d.replace(gX,""))]}return[e]}function Zje(e,t){const o={phrasingContentSchema:k5(t),isPaste:t==="paste"},r=e.map(({isMatch:l,blockName:u,schema:d})=>{const p=Et(u,"anchor");return d=typeof d=="function"?d(o):d,!p&&!l?d:d?Object.fromEntries(Object.entries(d).map(([f,b])=>{let h=b.attributes||[];return p&&(h=[...h,"id"]),[f,{...b,attributes:h,isMatch:l||void 0}]})):{}});function s(l,u,d){switch(d){case"children":return l==="*"||u==="*"?"*":{...l,...u};case"attributes":case"require":return[...l||[],...u||[]];case"isMatch":return!l||!u?void 0:(...p)=>l(...p)||u(...p)}}function i(l,u){for(const d in u)l[d]=l[d]?s(l[d],u[d],d):{...u[d]};return l}function c(l,u){for(const d in u)l[d]=l[d]?i(l[d],u[d]):{...u[d]};return l}return r.reduce(c,{})}function Iie(e){return Zje(Wie(),e)}function Qje(e){return!/<(?!br[ />])/i.test(e)}function Die(e,t,n,o){Array.from(e).forEach(r=>{Die(r.childNodes,t,n,o),t.forEach(s=>{n.contains(r)&&s(r,n,o)})})}function tf(e,t=[],n){const o=document.implementation.createHTMLDocument("");return o.body.innerHTML=e,Die(o.body.childNodes,t,o,n),o.body.innerHTML}function Z4(e,t){const n=e[`${t}Sibling`];if(n&&k2(n))return n;const{parentNode:o}=e;if(!(!o||!k2(o)))return Z4(o,t)}function Fie(e){e.nodeType===e.COMMENT_NODE&&pf(e)}function Jje(e,t){if(h0e(e))return!0;if(!t)return!1;const n=e.nodeName.toLowerCase();return[["ul","li","ol"],["h1","h2","h3","h4","h5","h6"]].some(r=>[n,t].filter(s=>!r.includes(s)).length===0)}function $ie(e,t){return e.every(n=>Jje(n,t)&&$ie(Array.from(n.children),t))}function e7e(e){return e.nodeName==="BR"&&e.previousSibling&&e.previousSibling.nodeName==="BR"}function t7e(e,t){const n=document.implementation.createHTMLDocument("");n.body.innerHTML=e;const o=Array.from(n.body.children);return!o.some(e7e)&&$ie(o,t)}function Vie(e,t){if(e.nodeName==="SPAN"&&e.style){const{fontWeight:n,fontStyle:o,textDecorationLine:r,textDecoration:s,verticalAlign:i}=e.style;(n==="bold"||n==="700")&&Ag(t.createElement("strong"),e),o==="italic"&&Ag(t.createElement("em"),e),(r==="line-through"||s.includes("line-through"))&&Ag(t.createElement("s"),e),i==="super"?Ag(t.createElement("sup"),e):i==="sub"&&Ag(t.createElement("sub"),e)}else e.nodeName==="B"?e=PH(e,"strong"):e.nodeName==="I"?e=PH(e,"em"):e.nodeName==="A"&&(e.target&&e.target.toLowerCase()==="_blank"?e.rel="noreferrer noopener":(e.removeAttribute("target"),e.removeAttribute("rel")),e.name&&!e.id&&(e.id=e.name),e.id&&!e.ownerDocument.querySelector(`[href="#${e.id}"]`)&&e.removeAttribute("id"))}function Hie(e){e.nodeName!=="SCRIPT"&&e.nodeName!=="NOSCRIPT"&&e.nodeName!=="TEMPLATE"&&e.nodeName!=="STYLE"||e.parentNode.removeChild(e)}function Uie(e){if(e.nodeType!==e.ELEMENT_NODE)return;const t=e.getAttribute("style");if(!t||!t.includes("mso-list"))return;t.split(";").reduce((o,r)=>{const[s,i]=r.split(":");return s&&i&&(o[s.trim().toLowerCase()]=i.trim().toLowerCase()),o},{})["mso-list"]==="ignore"&&e.remove()}function tC(e){return e.nodeName==="OL"||e.nodeName==="UL"}function n7e(e,t){if(e.nodeName!=="P")return;const n=e.getAttribute("style");if(!n||!n.includes("mso-list"))return;const o=e.previousElementSibling;if(!o||!tC(o)){const d=e.textContent.trim().slice(0,1),p=/[1iIaA]/.test(d),f=t.createElement(p?"ol":"ul");p&&f.setAttribute("type",d),e.parentNode.insertBefore(f,e)}const r=e.previousElementSibling,s=r.nodeName,i=t.createElement("li");let c=r;i.innerHTML=tf(e.innerHTML,[Uie]);const l=/mso-list\s*:[^;]+level([0-9]+)/i.exec(n);let u=l&&parseInt(l[1],10)-1||0;for(;u--;)c=c.lastChild||c,tC(c)&&(c=c.lastChild||c);tC(c)||(c=c.appendChild(t.createElement(s))),c.appendChild(i),e.parentNode.removeChild(e)}const Q4={};function ls(e){const t=window.URL.createObjectURL(e);return Q4[t]=e,t}function Xie(e){return Q4[e]}function Gie(e){return Xie(e)?.type.split("/")[0]}function J4(e){Q4[e]&&window.URL.revokeObjectURL(e),delete Q4[e]}function Nr(e){return!e||!e.indexOf?!1:e.indexOf("blob:")===0}function MX(e,t,n=""){if(!e||!t)return;const o=new window.Blob([t],{type:n}),r=window.URL.createObjectURL(o),s=document.createElement("a");s.href=r,s.download=e,s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(r)}function o7e(e){if(e.nodeName==="IMG"){if(e.src.indexOf("file:")===0&&(e.src=""),e.src.indexOf("data:")===0){const[t,n]=e.src.split(","),[o]=t.slice(5).split(";");if(!n||!o){e.src="";return}let r;try{r=atob(n)}catch{e.src="";return}const s=new Uint8Array(r.length);for(let l=0;l (GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,description:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,description:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",description:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,description:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,description:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,description:"Support for HTML Tag escaping. ex:

foo
",type:"boolean"},emoji:{defaultValue:!1,description:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,description:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `` and ``",type:"boolean"},completeHTMLDocument:{defaultValue:!1,description:"Outputs a complete html document, including ``, `` and `` tags",type:"boolean"},metadata:{defaultValue:!1,description:"Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).",type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,description:"Split adjacent blockquote blocks",type:"boolean"}};if(M===!1)return JSON.parse(JSON.stringify(y));var k={};for(var S in y)y.hasOwnProperty(S)&&(k[S]=y[S].defaultValue);return k}function n(){var M=t(!0),y={};for(var k in M)M.hasOwnProperty(k)&&(y[k]=!0);return y}var o={},r={},s={},i=t(!0),c="vanilla",l={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:t(!0),allOn:n()};o.helper={},o.extensions={},o.setOption=function(M,y){return i[M]=y,this},o.getOption=function(M){return i[M]},o.getOptions=function(){return i},o.resetOptions=function(){i=t(!0)},o.setFlavor=function(M){if(!l.hasOwnProperty(M))throw Error(M+" flavor was not found");o.resetOptions();var y=l[M];c=M;for(var k in y)y.hasOwnProperty(k)&&(i[k]=y[k])},o.getFlavor=function(){return c},o.getFlavorOptions=function(M){if(l.hasOwnProperty(M))return l[M]},o.getDefaultOptions=function(M){return t(M)},o.subParser=function(M,y){if(o.helper.isString(M))if(typeof y<"u")r[M]=y;else{if(r.hasOwnProperty(M))return r[M];throw Error("SubParser named "+M+" not registered!")}},o.extension=function(M,y){if(!o.helper.isString(M))throw Error("Extension 'name' must be a string");if(M=o.helper.stdExtName(M),o.helper.isUndefined(y)){if(!s.hasOwnProperty(M))throw Error("Extension named "+M+" is not registered!");return s[M]}else{typeof y=="function"&&(y=y()),o.helper.isArray(y)||(y=[y]);var k=u(y,M);if(k.valid)s[M]=y;else throw Error(k.error)}},o.getAllExtensions=function(){return s},o.removeExtension=function(M){delete s[M]},o.resetExtensions=function(){s={}};function u(M,y){var k=y?"Error in "+y+" extension->":"Error in unnamed extension",S={valid:!0,error:""};o.helper.isArray(M)||(M=[M]);for(var C=0;C"u"},o.helper.forEach=function(M,y){if(o.helper.isUndefined(M))throw new Error("obj param is required");if(o.helper.isUndefined(y))throw new Error("callback param is required");if(!o.helper.isFunction(y))throw new Error("callback param must be a function/closure");if(typeof M.forEach=="function")M.forEach(y);else if(o.helper.isArray(M))for(var k=0;k").replace(/&/g,"&")};var p=function(M,y,k,S){var C=S||"",R=C.indexOf("g")>-1,T=new RegExp(y+"|"+k,"g"+C.replace(/g/g,"")),E=new RegExp(y,C.replace(/g/g,"")),B=[],N,j,I,P,$;do for(N=0;I=T.exec(M);)if(E.test(I[0]))N++||(j=T.lastIndex,P=j-I[0].length);else if(N&&!--N){$=I.index+I[0].length;var F={left:{start:P,end:j},match:{start:j,end:I.index},right:{start:I.index,end:$},wholeMatch:{start:P,end:$}};if(B.push(F),!R)return B}while(N&&(T.lastIndex=j));return B};o.helper.matchRecursiveRegExp=function(M,y,k,S){for(var C=p(M,y,k,S),R=[],T=0;T0){var N=[];T[0].wholeMatch.start!==0&&N.push(M.slice(0,T[0].wholeMatch.start));for(var j=0;j=0?S+(k||0):S},o.helper.splitAtIndex=function(M,y){if(!o.helper.isString(M))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[M.substring(0,y),M.substring(y)]},o.helper.encodeEmailAddress=function(M){var y=[function(k){return"&#"+k.charCodeAt(0)+";"},function(k){return"&#x"+k.charCodeAt(0).toString(16)+";"},function(k){return k}];return M=M.replace(/./g,function(k){if(k==="@")k=y[Math.floor(Math.random()*2)](k);else{var S=Math.random();k=S>.9?y[2](k):S>.45?y[1](k):y[0](k)}return k}),M},o.helper.padEnd=function(y,k,S){return k=k>>0,S=String(S||" "),y.length>k?String(y):(k=k-y.length,k>S.length&&(S+=S.repeat(k/S.length)),String(y)+S.slice(0,k))},typeof console>"u"&&(console={warn:function(M){alert(M)},log:function(M){alert(M)},error:function(M){throw M}}),o.helper.regexes={asteriskDashAndColon:/([*_:~])/g},o.helper.emojis={"+1":"👍","-1":"👎",100:"💯",1234:"🔢","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉","8ball":"🎱",a:"🅰️",ab:"🆎",abc:"🔤",abcd:"🔡",accept:"🉑",aerial_tramway:"🚡",airplane:"✈️",alarm_clock:"⏰",alembic:"⚗️",alien:"👽",ambulance:"🚑",amphora:"🏺",anchor:"⚓️",angel:"👼",anger:"💢",angry:"😠",anguished:"😧",ant:"🐜",apple:"🍎",aquarius:"♒️",aries:"♈️",arrow_backward:"◀️",arrow_double_down:"⏬",arrow_double_up:"⏫",arrow_down:"⬇️",arrow_down_small:"🔽",arrow_forward:"▶️",arrow_heading_down:"⤵️",arrow_heading_up:"⤴️",arrow_left:"⬅️",arrow_lower_left:"↙️",arrow_lower_right:"↘️",arrow_right:"➡️",arrow_right_hook:"↪️",arrow_up:"⬆️",arrow_up_down:"↕️",arrow_up_small:"🔼",arrow_upper_left:"↖️",arrow_upper_right:"↗️",arrows_clockwise:"🔃",arrows_counterclockwise:"🔄",art:"🎨",articulated_lorry:"🚛",artificial_satellite:"🛰",astonished:"😲",athletic_shoe:"👟",atm:"🏧",atom_symbol:"⚛️",avocado:"🥑",b:"🅱️",baby:"👶",baby_bottle:"🍼",baby_chick:"🐤",baby_symbol:"🚼",back:"🔙",bacon:"🥓",badminton:"🏸",baggage_claim:"🛄",baguette_bread:"🥖",balance_scale:"⚖️",balloon:"🎈",ballot_box:"🗳",ballot_box_with_check:"☑️",bamboo:"🎍",banana:"🍌",bangbang:"‼️",bank:"🏦",bar_chart:"📊",barber:"💈",baseball:"⚾️",basketball:"🏀",basketball_man:"⛹️",basketball_woman:"⛹️‍♀️",bat:"🦇",bath:"🛀",bathtub:"🛁",battery:"🔋",beach_umbrella:"🏖",bear:"🐻",bed:"🛏",bee:"🐝",beer:"🍺",beers:"🍻",beetle:"🐞",beginner:"🔰",bell:"🔔",bellhop_bell:"🛎",bento:"🍱",biking_man:"🚴",bike:"🚲",biking_woman:"🚴‍♀️",bikini:"👙",biohazard:"☣️",bird:"🐦",birthday:"🎂",black_circle:"⚫️",black_flag:"🏴",black_heart:"🖤",black_joker:"🃏",black_large_square:"⬛️",black_medium_small_square:"◾️",black_medium_square:"◼️",black_nib:"✒️",black_small_square:"▪️",black_square_button:"🔲",blonde_man:"👱",blonde_woman:"👱‍♀️",blossom:"🌼",blowfish:"🐡",blue_book:"📘",blue_car:"🚙",blue_heart:"💙",blush:"😊",boar:"🐗",boat:"⛵️",bomb:"💣",book:"📖",bookmark:"🔖",bookmark_tabs:"📑",books:"📚",boom:"💥",boot:"👢",bouquet:"💐",bowing_man:"🙇",bow_and_arrow:"🏹",bowing_woman:"🙇‍♀️",bowling:"🎳",boxing_glove:"🥊",boy:"👦",bread:"🍞",bride_with_veil:"👰",bridge_at_night:"🌉",briefcase:"💼",broken_heart:"💔",bug:"🐛",building_construction:"🏗",bulb:"💡",bullettrain_front:"🚅",bullettrain_side:"🚄",burrito:"🌯",bus:"🚌",business_suit_levitating:"🕴",busstop:"🚏",bust_in_silhouette:"👤",busts_in_silhouette:"👥",butterfly:"🦋",cactus:"🌵",cake:"🍰",calendar:"📆",call_me_hand:"🤙",calling:"📲",camel:"🐫",camera:"📷",camera_flash:"📸",camping:"🏕",cancer:"♋️",candle:"🕯",candy:"🍬",canoe:"🛶",capital_abcd:"🔠",capricorn:"♑️",car:"🚗",card_file_box:"🗃",card_index:"📇",card_index_dividers:"🗂",carousel_horse:"🎠",carrot:"🥕",cat:"🐱",cat2:"🐈",cd:"💿",chains:"⛓",champagne:"🍾",chart:"💹",chart_with_downwards_trend:"📉",chart_with_upwards_trend:"📈",checkered_flag:"🏁",cheese:"🧀",cherries:"🍒",cherry_blossom:"🌸",chestnut:"🌰",chicken:"🐔",children_crossing:"🚸",chipmunk:"🐿",chocolate_bar:"🍫",christmas_tree:"🎄",church:"⛪️",cinema:"🎦",circus_tent:"🎪",city_sunrise:"🌇",city_sunset:"🌆",cityscape:"🏙",cl:"🆑",clamp:"🗜",clap:"👏",clapper:"🎬",classical_building:"🏛",clinking_glasses:"🥂",clipboard:"📋",clock1:"🕐",clock10:"🕙",clock1030:"🕥",clock11:"🕚",clock1130:"🕦",clock12:"🕛",clock1230:"🕧",clock130:"🕜",clock2:"🕑",clock230:"🕝",clock3:"🕒",clock330:"🕞",clock4:"🕓",clock430:"🕟",clock5:"🕔",clock530:"🕠",clock6:"🕕",clock630:"🕡",clock7:"🕖",clock730:"🕢",clock8:"🕗",clock830:"🕣",clock9:"🕘",clock930:"🕤",closed_book:"📕",closed_lock_with_key:"🔐",closed_umbrella:"🌂",cloud:"☁️",cloud_with_lightning:"🌩",cloud_with_lightning_and_rain:"⛈",cloud_with_rain:"🌧",cloud_with_snow:"🌨",clown_face:"🤡",clubs:"♣️",cocktail:"🍸",coffee:"☕️",coffin:"⚰️",cold_sweat:"😰",comet:"☄️",computer:"💻",computer_mouse:"🖱",confetti_ball:"🎊",confounded:"😖",confused:"😕",congratulations:"㊗️",construction:"🚧",construction_worker_man:"👷",construction_worker_woman:"👷‍♀️",control_knobs:"🎛",convenience_store:"🏪",cookie:"🍪",cool:"🆒",policeman:"👮",copyright:"©️",corn:"🌽",couch_and_lamp:"🛋",couple:"👫",couple_with_heart_woman_man:"💑",couple_with_heart_man_man:"👨‍❤️‍👨",couple_with_heart_woman_woman:"👩‍❤️‍👩",couplekiss_man_man:"👨‍❤️‍💋‍👨",couplekiss_man_woman:"💏",couplekiss_woman_woman:"👩‍❤️‍💋‍👩",cow:"🐮",cow2:"🐄",cowboy_hat_face:"🤠",crab:"🦀",crayon:"🖍",credit_card:"💳",crescent_moon:"🌙",cricket:"🏏",crocodile:"🐊",croissant:"🥐",crossed_fingers:"🤞",crossed_flags:"🎌",crossed_swords:"⚔️",crown:"👑",cry:"😢",crying_cat_face:"😿",crystal_ball:"🔮",cucumber:"🥒",cupid:"💘",curly_loop:"➰",currency_exchange:"💱",curry:"🍛",custard:"🍮",customs:"🛃",cyclone:"🌀",dagger:"🗡",dancer:"💃",dancing_women:"👯",dancing_men:"👯‍♂️",dango:"🍡",dark_sunglasses:"🕶",dart:"🎯",dash:"💨",date:"📅",deciduous_tree:"🌳",deer:"🦌",department_store:"🏬",derelict_house:"🏚",desert:"🏜",desert_island:"🏝",desktop_computer:"🖥",male_detective:"🕵️",diamond_shape_with_a_dot_inside:"💠",diamonds:"♦️",disappointed:"😞",disappointed_relieved:"😥",dizzy:"💫",dizzy_face:"😵",do_not_litter:"🚯",dog:"🐶",dog2:"🐕",dollar:"💵",dolls:"🎎",dolphin:"🐬",door:"🚪",doughnut:"🍩",dove:"🕊",dragon:"🐉",dragon_face:"🐲",dress:"👗",dromedary_camel:"🐪",drooling_face:"🤤",droplet:"💧",drum:"🥁",duck:"🦆",dvd:"📀","e-mail":"📧",eagle:"🦅",ear:"👂",ear_of_rice:"🌾",earth_africa:"🌍",earth_americas:"🌎",earth_asia:"🌏",egg:"🥚",eggplant:"🍆",eight_pointed_black_star:"✴️",eight_spoked_asterisk:"✳️",electric_plug:"🔌",elephant:"🐘",email:"✉️",end:"🔚",envelope_with_arrow:"📩",euro:"💶",european_castle:"🏰",european_post_office:"🏤",evergreen_tree:"🌲",exclamation:"❗️",expressionless:"😑",eye:"👁",eye_speech_bubble:"👁‍🗨",eyeglasses:"👓",eyes:"👀",face_with_head_bandage:"🤕",face_with_thermometer:"🤒",fist_oncoming:"👊",factory:"🏭",fallen_leaf:"🍂",family_man_woman_boy:"👪",family_man_boy:"👨‍👦",family_man_boy_boy:"👨‍👦‍👦",family_man_girl:"👨‍👧",family_man_girl_boy:"👨‍👧‍👦",family_man_girl_girl:"👨‍👧‍👧",family_man_man_boy:"👨‍👨‍👦",family_man_man_boy_boy:"👨‍👨‍👦‍👦",family_man_man_girl:"👨‍👨‍👧",family_man_man_girl_boy:"👨‍👨‍👧‍👦",family_man_man_girl_girl:"👨‍👨‍👧‍👧",family_man_woman_boy_boy:"👨‍👩‍👦‍👦",family_man_woman_girl:"👨‍👩‍👧",family_man_woman_girl_boy:"👨‍👩‍👧‍👦",family_man_woman_girl_girl:"👨‍👩‍👧‍👧",family_woman_boy:"👩‍👦",family_woman_boy_boy:"👩‍👦‍👦",family_woman_girl:"👩‍👧",family_woman_girl_boy:"👩‍👧‍👦",family_woman_girl_girl:"👩‍👧‍👧",family_woman_woman_boy:"👩‍👩‍👦",family_woman_woman_boy_boy:"👩‍👩‍👦‍👦",family_woman_woman_girl:"👩‍👩‍👧",family_woman_woman_girl_boy:"👩‍👩‍👧‍👦",family_woman_woman_girl_girl:"👩‍👩‍👧‍👧",fast_forward:"⏩",fax:"📠",fearful:"😨",feet:"🐾",female_detective:"🕵️‍♀️",ferris_wheel:"🎡",ferry:"⛴",field_hockey:"🏑",file_cabinet:"🗄",file_folder:"📁",film_projector:"📽",film_strip:"🎞",fire:"🔥",fire_engine:"🚒",fireworks:"🎆",first_quarter_moon:"🌓",first_quarter_moon_with_face:"🌛",fish:"🐟",fish_cake:"🍥",fishing_pole_and_fish:"🎣",fist_raised:"✊",fist_left:"🤛",fist_right:"🤜",flags:"🎏",flashlight:"🔦",fleur_de_lis:"⚜️",flight_arrival:"🛬",flight_departure:"🛫",floppy_disk:"💾",flower_playing_cards:"🎴",flushed:"😳",fog:"🌫",foggy:"🌁",football:"🏈",footprints:"👣",fork_and_knife:"🍴",fountain:"⛲️",fountain_pen:"🖋",four_leaf_clover:"🍀",fox_face:"🦊",framed_picture:"🖼",free:"🆓",fried_egg:"🍳",fried_shrimp:"🍤",fries:"🍟",frog:"🐸",frowning:"😦",frowning_face:"☹️",frowning_man:"🙍‍♂️",frowning_woman:"🙍",middle_finger:"🖕",fuelpump:"⛽️",full_moon:"🌕",full_moon_with_face:"🌝",funeral_urn:"⚱️",game_die:"🎲",gear:"⚙️",gem:"💎",gemini:"♊️",ghost:"👻",gift:"🎁",gift_heart:"💝",girl:"👧",globe_with_meridians:"🌐",goal_net:"🥅",goat:"🐐",golf:"⛳️",golfing_man:"🏌️",golfing_woman:"🏌️‍♀️",gorilla:"🦍",grapes:"🍇",green_apple:"🍏",green_book:"📗",green_heart:"💚",green_salad:"🥗",grey_exclamation:"❕",grey_question:"❔",grimacing:"😬",grin:"😁",grinning:"😀",guardsman:"💂",guardswoman:"💂‍♀️",guitar:"🎸",gun:"🔫",haircut_woman:"💇",haircut_man:"💇‍♂️",hamburger:"🍔",hammer:"🔨",hammer_and_pick:"⚒",hammer_and_wrench:"🛠",hamster:"🐹",hand:"✋",handbag:"👜",handshake:"🤝",hankey:"💩",hatched_chick:"🐥",hatching_chick:"🐣",headphones:"🎧",hear_no_evil:"🙉",heart:"❤️",heart_decoration:"💟",heart_eyes:"😍",heart_eyes_cat:"😻",heartbeat:"💓",heartpulse:"💗",hearts:"♥️",heavy_check_mark:"✔️",heavy_division_sign:"➗",heavy_dollar_sign:"💲",heavy_heart_exclamation:"❣️",heavy_minus_sign:"➖",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",helicopter:"🚁",herb:"🌿",hibiscus:"🌺",high_brightness:"🔆",high_heel:"👠",hocho:"🔪",hole:"🕳",honey_pot:"🍯",horse:"🐴",horse_racing:"🏇",hospital:"🏥",hot_pepper:"🌶",hotdog:"🌭",hotel:"🏨",hotsprings:"♨️",hourglass:"⌛️",hourglass_flowing_sand:"⏳",house:"🏠",house_with_garden:"🏡",houses:"🏘",hugs:"🤗",hushed:"😯",ice_cream:"🍨",ice_hockey:"🏒",ice_skate:"⛸",icecream:"🍦",id:"🆔",ideograph_advantage:"🉐",imp:"👿",inbox_tray:"📥",incoming_envelope:"📨",tipping_hand_woman:"💁",information_source:"ℹ️",innocent:"😇",interrobang:"⁉️",iphone:"📱",izakaya_lantern:"🏮",jack_o_lantern:"🎃",japan:"🗾",japanese_castle:"🏯",japanese_goblin:"👺",japanese_ogre:"👹",jeans:"👖",joy:"😂",joy_cat:"😹",joystick:"🕹",kaaba:"🕋",key:"🔑",keyboard:"⌨️",keycap_ten:"🔟",kick_scooter:"🛴",kimono:"👘",kiss:"💋",kissing:"😗",kissing_cat:"😽",kissing_closed_eyes:"😚",kissing_heart:"😘",kissing_smiling_eyes:"😙",kiwi_fruit:"🥝",koala:"🐨",koko:"🈁",label:"🏷",large_blue_circle:"🔵",large_blue_diamond:"🔷",large_orange_diamond:"🔶",last_quarter_moon:"🌗",last_quarter_moon_with_face:"🌜",latin_cross:"✝️",laughing:"😆",leaves:"🍃",ledger:"📒",left_luggage:"🛅",left_right_arrow:"↔️",leftwards_arrow_with_hook:"↩️",lemon:"🍋",leo:"♌️",leopard:"🐆",level_slider:"🎚",libra:"♎️",light_rail:"🚈",link:"🔗",lion:"🦁",lips:"👄",lipstick:"💄",lizard:"🦎",lock:"🔒",lock_with_ink_pen:"🔏",lollipop:"🍭",loop:"➿",loud_sound:"🔊",loudspeaker:"📢",love_hotel:"🏩",love_letter:"💌",low_brightness:"🔅",lying_face:"🤥",m:"Ⓜ️",mag:"🔍",mag_right:"🔎",mahjong:"🀄️",mailbox:"📫",mailbox_closed:"📪",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",man:"👨",man_artist:"👨‍🎨",man_astronaut:"👨‍🚀",man_cartwheeling:"🤸‍♂️",man_cook:"👨‍🍳",man_dancing:"🕺",man_facepalming:"🤦‍♂️",man_factory_worker:"👨‍🏭",man_farmer:"👨‍🌾",man_firefighter:"👨‍🚒",man_health_worker:"👨‍⚕️",man_in_tuxedo:"🤵",man_judge:"👨‍⚖️",man_juggling:"🤹‍♂️",man_mechanic:"👨‍🔧",man_office_worker:"👨‍💼",man_pilot:"👨‍✈️",man_playing_handball:"🤾‍♂️",man_playing_water_polo:"🤽‍♂️",man_scientist:"👨‍🔬",man_shrugging:"🤷‍♂️",man_singer:"👨‍🎤",man_student:"👨‍🎓",man_teacher:"👨‍🏫",man_technologist:"👨‍💻",man_with_gua_pi_mao:"👲",man_with_turban:"👳",tangerine:"🍊",mans_shoe:"👞",mantelpiece_clock:"🕰",maple_leaf:"🍁",martial_arts_uniform:"🥋",mask:"😷",massage_woman:"💆",massage_man:"💆‍♂️",meat_on_bone:"🍖",medal_military:"🎖",medal_sports:"🏅",mega:"📣",melon:"🍈",memo:"📝",men_wrestling:"🤼‍♂️",menorah:"🕎",mens:"🚹",metal:"🤘",metro:"🚇",microphone:"🎤",microscope:"🔬",milk_glass:"🥛",milky_way:"🌌",minibus:"🚐",minidisc:"💽",mobile_phone_off:"📴",money_mouth_face:"🤑",money_with_wings:"💸",moneybag:"💰",monkey:"🐒",monkey_face:"🐵",monorail:"🚝",moon:"🌔",mortar_board:"🎓",mosque:"🕌",motor_boat:"🛥",motor_scooter:"🛵",motorcycle:"🏍",motorway:"🛣",mount_fuji:"🗻",mountain:"⛰",mountain_biking_man:"🚵",mountain_biking_woman:"🚵‍♀️",mountain_cableway:"🚠",mountain_railway:"🚞",mountain_snow:"🏔",mouse:"🐭",mouse2:"🐁",movie_camera:"🎥",moyai:"🗿",mrs_claus:"🤶",muscle:"💪",mushroom:"🍄",musical_keyboard:"🎹",musical_note:"🎵",musical_score:"🎼",mute:"🔇",nail_care:"💅",name_badge:"📛",national_park:"🏞",nauseated_face:"🤢",necktie:"👔",negative_squared_cross_mark:"❎",nerd_face:"🤓",neutral_face:"😐",new:"🆕",new_moon:"🌑",new_moon_with_face:"🌚",newspaper:"📰",newspaper_roll:"🗞",next_track_button:"⏭",ng:"🆖",no_good_man:"🙅‍♂️",no_good_woman:"🙅",night_with_stars:"🌃",no_bell:"🔕",no_bicycles:"🚳",no_entry:"⛔️",no_entry_sign:"🚫",no_mobile_phones:"📵",no_mouth:"😶",no_pedestrians:"🚷",no_smoking:"🚭","non-potable_water":"🚱",nose:"👃",notebook:"📓",notebook_with_decorative_cover:"📔",notes:"🎶",nut_and_bolt:"🔩",o:"⭕️",o2:"🅾️",ocean:"🌊",octopus:"🐙",oden:"🍢",office:"🏢",oil_drum:"🛢",ok:"🆗",ok_hand:"👌",ok_man:"🙆‍♂️",ok_woman:"🙆",old_key:"🗝",older_man:"👴",older_woman:"👵",om:"🕉",on:"🔛",oncoming_automobile:"🚘",oncoming_bus:"🚍",oncoming_police_car:"🚔",oncoming_taxi:"🚖",open_file_folder:"📂",open_hands:"👐",open_mouth:"😮",open_umbrella:"☂️",ophiuchus:"⛎",orange_book:"📙",orthodox_cross:"☦️",outbox_tray:"📤",owl:"🦉",ox:"🐂",package:"📦",page_facing_up:"📄",page_with_curl:"📃",pager:"📟",paintbrush:"🖌",palm_tree:"🌴",pancakes:"🥞",panda_face:"🐼",paperclip:"📎",paperclips:"🖇",parasol_on_ground:"⛱",parking:"🅿️",part_alternation_mark:"〽️",partly_sunny:"⛅️",passenger_ship:"🛳",passport_control:"🛂",pause_button:"⏸",peace_symbol:"☮️",peach:"🍑",peanuts:"🥜",pear:"🍐",pen:"🖊",pencil2:"✏️",penguin:"🐧",pensive:"😔",performing_arts:"🎭",persevere:"😣",person_fencing:"🤺",pouting_woman:"🙎",phone:"☎️",pick:"⛏",pig:"🐷",pig2:"🐖",pig_nose:"🐽",pill:"💊",pineapple:"🍍",ping_pong:"🏓",pisces:"♓️",pizza:"🍕",place_of_worship:"🛐",plate_with_cutlery:"🍽",play_or_pause_button:"⏯",point_down:"👇",point_left:"👈",point_right:"👉",point_up:"☝️",point_up_2:"👆",police_car:"🚓",policewoman:"👮‍♀️",poodle:"🐩",popcorn:"🍿",post_office:"🏣",postal_horn:"📯",postbox:"📮",potable_water:"🚰",potato:"🥔",pouch:"👝",poultry_leg:"🍗",pound:"💷",rage:"😡",pouting_cat:"😾",pouting_man:"🙎‍♂️",pray:"🙏",prayer_beads:"📿",pregnant_woman:"🤰",previous_track_button:"⏮",prince:"🤴",princess:"👸",printer:"🖨",purple_heart:"💜",purse:"👛",pushpin:"📌",put_litter_in_its_place:"🚮",question:"❓",rabbit:"🐰",rabbit2:"🐇",racehorse:"🐎",racing_car:"🏎",radio:"📻",radio_button:"🔘",radioactive:"☢️",railway_car:"🚃",railway_track:"🛤",rainbow:"🌈",rainbow_flag:"🏳️‍🌈",raised_back_of_hand:"🤚",raised_hand_with_fingers_splayed:"🖐",raised_hands:"🙌",raising_hand_woman:"🙋",raising_hand_man:"🙋‍♂️",ram:"🐏",ramen:"🍜",rat:"🐀",record_button:"⏺",recycle:"♻️",red_circle:"🔴",registered:"®️",relaxed:"☺️",relieved:"😌",reminder_ribbon:"🎗",repeat:"🔁",repeat_one:"🔂",rescue_worker_helmet:"⛑",restroom:"🚻",revolving_hearts:"💞",rewind:"⏪",rhinoceros:"🦏",ribbon:"🎀",rice:"🍚",rice_ball:"🍙",rice_cracker:"🍘",rice_scene:"🎑",right_anger_bubble:"🗯",ring:"💍",robot:"🤖",rocket:"🚀",rofl:"🤣",roll_eyes:"🙄",roller_coaster:"🎢",rooster:"🐓",rose:"🌹",rosette:"🏵",rotating_light:"🚨",round_pushpin:"📍",rowing_man:"🚣",rowing_woman:"🚣‍♀️",rugby_football:"🏉",running_man:"🏃",running_shirt_with_sash:"🎽",running_woman:"🏃‍♀️",sa:"🈂️",sagittarius:"♐️",sake:"🍶",sandal:"👡",santa:"🎅",satellite:"📡",saxophone:"🎷",school:"🏫",school_satchel:"🎒",scissors:"✂️",scorpion:"🦂",scorpius:"♏️",scream:"😱",scream_cat:"🙀",scroll:"📜",seat:"💺",secret:"㊙️",see_no_evil:"🙈",seedling:"🌱",selfie:"🤳",shallow_pan_of_food:"🥘",shamrock:"☘️",shark:"🦈",shaved_ice:"🍧",sheep:"🐑",shell:"🐚",shield:"🛡",shinto_shrine:"⛩",ship:"🚢",shirt:"👕",shopping:"🛍",shopping_cart:"🛒",shower:"🚿",shrimp:"🦐",signal_strength:"📶",six_pointed_star:"🔯",ski:"🎿",skier:"⛷",skull:"💀",skull_and_crossbones:"☠️",sleeping:"😴",sleeping_bed:"🛌",sleepy:"😪",slightly_frowning_face:"🙁",slightly_smiling_face:"🙂",slot_machine:"🎰",small_airplane:"🛩",small_blue_diamond:"🔹",small_orange_diamond:"🔸",small_red_triangle:"🔺",small_red_triangle_down:"🔻",smile:"😄",smile_cat:"😸",smiley:"😃",smiley_cat:"😺",smiling_imp:"😈",smirk:"😏",smirk_cat:"😼",smoking:"🚬",snail:"🐌",snake:"🐍",sneezing_face:"🤧",snowboarder:"🏂",snowflake:"❄️",snowman:"⛄️",snowman_with_snow:"☃️",sob:"😭",soccer:"⚽️",soon:"🔜",sos:"🆘",sound:"🔉",space_invader:"👾",spades:"♠️",spaghetti:"🍝",sparkle:"❇️",sparkler:"🎇",sparkles:"✨",sparkling_heart:"💖",speak_no_evil:"🙊",speaker:"🔈",speaking_head:"🗣",speech_balloon:"💬",speedboat:"🚤",spider:"🕷",spider_web:"🕸",spiral_calendar:"🗓",spiral_notepad:"🗒",spoon:"🥄",squid:"🦑",stadium:"🏟",star:"⭐️",star2:"🌟",star_and_crescent:"☪️",star_of_david:"✡️",stars:"🌠",station:"🚉",statue_of_liberty:"🗽",steam_locomotive:"🚂",stew:"🍲",stop_button:"⏹",stop_sign:"🛑",stopwatch:"⏱",straight_ruler:"📏",strawberry:"🍓",stuck_out_tongue:"😛",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue_winking_eye:"😜",studio_microphone:"🎙",stuffed_flatbread:"🥙",sun_behind_large_cloud:"🌥",sun_behind_rain_cloud:"🌦",sun_behind_small_cloud:"🌤",sun_with_face:"🌞",sunflower:"🌻",sunglasses:"😎",sunny:"☀️",sunrise:"🌅",sunrise_over_mountains:"🌄",surfing_man:"🏄",surfing_woman:"🏄‍♀️",sushi:"🍣",suspension_railway:"🚟",sweat:"😓",sweat_drops:"💦",sweat_smile:"😅",sweet_potato:"🍠",swimming_man:"🏊",swimming_woman:"🏊‍♀️",symbols:"🔣",synagogue:"🕍",syringe:"💉",taco:"🌮",tada:"🎉",tanabata_tree:"🎋",taurus:"♉️",taxi:"🚕",tea:"🍵",telephone_receiver:"📞",telescope:"🔭",tennis:"🎾",tent:"⛺️",thermometer:"🌡",thinking:"🤔",thought_balloon:"💭",ticket:"🎫",tickets:"🎟",tiger:"🐯",tiger2:"🐅",timer_clock:"⏲",tipping_hand_man:"💁‍♂️",tired_face:"😫",tm:"™️",toilet:"🚽",tokyo_tower:"🗼",tomato:"🍅",tongue:"👅",top:"🔝",tophat:"🎩",tornado:"🌪",trackball:"🖲",tractor:"🚜",traffic_light:"🚥",train:"🚋",train2:"🚆",tram:"🚊",triangular_flag_on_post:"🚩",triangular_ruler:"📐",trident:"🔱",triumph:"😤",trolleybus:"🚎",trophy:"🏆",tropical_drink:"🍹",tropical_fish:"🐠",truck:"🚚",trumpet:"🎺",tulip:"🌷",tumbler_glass:"🥃",turkey:"🦃",turtle:"🐢",tv:"📺",twisted_rightwards_arrows:"🔀",two_hearts:"💕",two_men_holding_hands:"👬",two_women_holding_hands:"👭",u5272:"🈹",u5408:"🈴",u55b6:"🈺",u6307:"🈯️",u6708:"🈷️",u6709:"🈶",u6e80:"🈵",u7121:"🈚️",u7533:"🈸",u7981:"🈲",u7a7a:"🈳",umbrella:"☔️",unamused:"😒",underage:"🔞",unicorn:"🦄",unlock:"🔓",up:"🆙",upside_down_face:"🙃",v:"✌️",vertical_traffic_light:"🚦",vhs:"📼",vibration_mode:"📳",video_camera:"📹",video_game:"🎮",violin:"🎻",virgo:"♍️",volcano:"🌋",volleyball:"🏐",vs:"🆚",vulcan_salute:"🖖",walking_man:"🚶",walking_woman:"🚶‍♀️",waning_crescent_moon:"🌘",waning_gibbous_moon:"🌖",warning:"⚠️",wastebasket:"🗑",watch:"⌚️",water_buffalo:"🐃",watermelon:"🍉",wave:"👋",wavy_dash:"〰️",waxing_crescent_moon:"🌒",wc:"🚾",weary:"😩",wedding:"💒",weight_lifting_man:"🏋️",weight_lifting_woman:"🏋️‍♀️",whale:"🐳",whale2:"🐋",wheel_of_dharma:"☸️",wheelchair:"♿️",white_check_mark:"✅",white_circle:"⚪️",white_flag:"🏳️",white_flower:"💮",white_large_square:"⬜️",white_medium_small_square:"◽️",white_medium_square:"◻️",white_small_square:"▫️",white_square_button:"🔳",wilted_flower:"🥀",wind_chime:"🎐",wind_face:"🌬",wine_glass:"🍷",wink:"😉",wolf:"🐺",woman:"👩",woman_artist:"👩‍🎨",woman_astronaut:"👩‍🚀",woman_cartwheeling:"🤸‍♀️",woman_cook:"👩‍🍳",woman_facepalming:"🤦‍♀️",woman_factory_worker:"👩‍🏭",woman_farmer:"👩‍🌾",woman_firefighter:"👩‍🚒",woman_health_worker:"👩‍⚕️",woman_judge:"👩‍⚖️",woman_juggling:"🤹‍♀️",woman_mechanic:"👩‍🔧",woman_office_worker:"👩‍💼",woman_pilot:"👩‍✈️",woman_playing_handball:"🤾‍♀️",woman_playing_water_polo:"🤽‍♀️",woman_scientist:"👩‍🔬",woman_shrugging:"🤷‍♀️",woman_singer:"👩‍🎤",woman_student:"👩‍🎓",woman_teacher:"👩‍🏫",woman_technologist:"👩‍💻",woman_with_turban:"👳‍♀️",womans_clothes:"👚",womans_hat:"👒",women_wrestling:"🤼‍♀️",womens:"🚺",world_map:"🗺",worried:"😟",wrench:"🔧",writing_hand:"✍️",x:"❌",yellow_heart:"💛",yen:"💴",yin_yang:"☯️",yum:"😋",zap:"⚡️",zipper_mouth_face:"🤐",zzz:"💤",octocat:':octocat:',showdown:`S`},o.Converter=function(M){var y={},k=[],S=[],C={},R=c,T={parsed:{},raw:"",format:""};E();function E(){M=M||{};for(var P in i)i.hasOwnProperty(P)&&(y[P]=i[P]);if(typeof M=="object")for(var $ in M)M.hasOwnProperty($)&&(y[$]=M[$]);else throw Error("Converter expects the passed parameter to be an object, but "+typeof M+" was passed instead.");y.extensions&&o.helper.forEach(y.extensions,B)}function B(P,$){if($=$||null,o.helper.isString(P))if(P=o.helper.stdExtName(P),$=P,o.extensions[P]){console.warn("DEPRECATION WARNING: "+P+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),N(o.extensions[P],P);return}else if(!o.helper.isUndefined(s[P]))P=s[P];else throw Error('Extension "'+P+'" could not be loaded. It was either not found or is not a valid extension.');typeof P=="function"&&(P=P()),o.helper.isArray(P)||(P=[P]);var F=u(P,$);if(!F.valid)throw Error(F.error);for(var X=0;Xd(...p)),u}function Ko(e,t){return yie(e).reduce((n,o)=>{const r=Eie(o,t);return r&&n.push(r),n},[])}function Wie(){return Ei("from").filter(({type:e})=>e==="raw").map(e=>e.isMatch?e:{...e,isMatch:t=>e.selector&&t.matches(e.selector)})}function Nie(e,t){const n=document.implementation.createHTMLDocument("");return n.body.innerHTML=e,Array.from(n.body.children).flatMap(o=>{const r=xc(Wie(),({isMatch:c})=>c(o));if(!r)return f0.isNative?Ko(`${o.outerHTML}`):Ee("core/html",Wl("core/html",o.outerHTML));const{transform:s,blockName:i}=r;if(s){const c=s(o,t);return o.hasAttribute("class")&&(c.attributes.className=o.getAttribute("class")),c}return Ee(i,Wl(i,o.outerHTML))})}function Q5(e,t={}){const n=document.implementation.createHTMLDocument(""),o=document.implementation.createHTMLDocument(""),r=n.body,s=o.body;for(r.innerHTML=e;r.firstChild;){const i=r.firstChild;i.nodeType===i.TEXT_NODE?S4(i)?r.removeChild(i):((!s.lastChild||s.lastChild.nodeName!=="P")&&s.appendChild(o.createElement("P")),s.lastChild.appendChild(i)):i.nodeType===i.ELEMENT_NODE?i.nodeName==="BR"?(i.nextSibling&&i.nextSibling.nodeName==="BR"&&(s.appendChild(o.createElement("P")),r.removeChild(i.nextSibling)),s.lastChild&&s.lastChild.nodeName==="P"&&s.lastChild.hasChildNodes()?s.lastChild.appendChild(i):r.removeChild(i)):i.nodeName==="P"?S4(i)&&!t.raw?r.removeChild(i):s.appendChild(i):k2(i)?((!s.lastChild||s.lastChild.nodeName!=="P")&&s.appendChild(o.createElement("P")),s.lastChild.appendChild(i)):s.appendChild(i):r.removeChild(i)}return s.innerHTML}function Bie(e,t){if(e.nodeType!==e.COMMENT_NODE||e.nodeValue!=="nextpage"&&e.nodeValue.indexOf("more")!==0)return;const n=$je(e,t);if(!e.parentNode||e.parentNode.nodeName!=="P")B6e(e,n);else{const o=Array.from(e.parentNode.childNodes),r=o.indexOf(e),s=e.parentNode.parentNode||t.body,i=(c,l)=>(c||(c=t.createElement("p")),c.appendChild(l),c);[o.slice(0,r).reduce(i,null),n,o.slice(r+1).reduce(i,null)].forEach(c=>c&&s.insertBefore(c,e.parentNode)),pf(e.parentNode)}}function $je(e,t){if(e.nodeValue==="nextpage")return Hje(t);const n=e.nodeValue.slice(4).trim();let o=e,r=!1;for(;o=o.nextSibling;)if(o.nodeType===o.COMMENT_NODE&&o.nodeValue==="noteaser"){r=!0,pf(o);break}return Vje(n,r,t)}function Vje(e,t,n){const o=n.createElement("wp-block");return o.dataset.block="core/more",e&&(o.dataset.customText=e),t&&(o.dataset.noTeaser=""),o}function Hje(e){const t=e.createElement("wp-block");return t.dataset.block="core/nextpage",t}function fX(e){return e.nodeName==="OL"||e.nodeName==="UL"}function Uje(e){return Array.from(e.childNodes).map(({nodeValue:t=""})=>t).join("")}function Lie(e){if(!fX(e))return;const t=e,n=e.previousElementSibling;if(n&&n.nodeName===e.nodeName&&t.children.length===1){for(;t.firstChild;)n.appendChild(t.firstChild);t.parentNode.removeChild(t)}const o=e.parentNode;if(o&&o.nodeName==="LI"&&o.children.length===1&&!/\S/.test(Uje(o))){const r=o,s=r.previousElementSibling,i=r.parentNode;s&&(s.appendChild(t),i.removeChild(r))}if(o&&fX(o)){const r=e.previousElementSibling;r?r.appendChild(e):mM(e)}}function Pie(e){return t=>{t.nodeName==="BLOCKQUOTE"&&(t.innerHTML=Q5(t.innerHTML,e))}}function Xje(e,t){var n;const o=e.nodeName.toLowerCase();return o==="figcaption"||i0e(e)?!1:o in((n=t?.figure?.children)!==null&&n!==void 0?n:{})}function Gje(e,t){var n;return e.nodeName.toLowerCase()in((n=t?.figure?.children?.a?.children)!==null&&n!==void 0?n:{})}function eC(e,t=e){const n=e.ownerDocument.createElement("figure");t.parentNode.insertBefore(n,t),n.appendChild(e)}function jie(e,t,n){if(!Xje(e,n))return;let o=e;const r=e.parentNode;Gje(e,n)&&r.nodeName==="A"&&r.childNodes.length===1&&(o=e.parentNode);const s=o.closest("p,div");s?e.classList?(e.classList.contains("alignright")||e.classList.contains("alignleft")||e.classList.contains("aligncenter")||!s.textContent.trim())&&eC(o,s):eC(o,s):eC(o)}function VB(e,t,n=0){const o=nz(e);o.lastIndex=n;const r=o.exec(t);if(!r)return;if(r[1]==="["&&r[7]==="]")return VB(e,t,o.lastIndex);const s={index:r.index,content:r[0],shortcode:HB(r)};return r[1]&&(s.content=s.content.slice(1),s.index++),r[7]&&(s.content=s.content.slice(0,-1)),s}function Kje(e,t,n){return t.replace(nz(e),function(o,r,s,i,c,l,u,d){if(r==="["&&d==="]")return o;const p=n(HB(arguments));return p||p===""?r+p+d:o})}function Yje(e){return new UB(e).string()}function nz(e){return new RegExp("\\[(\\[?)("+e+")(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*(?:\\[(?!\\/\\2\\])[^\\[]*)*)(\\[\\/\\2\\]))?)(\\]?)","g")}const bX=Hs(e=>{const t={},n=[],o=/([\w-]+)\s*=\s*"([^"]*)"(?:\s|$)|([\w-]+)\s*=\s*'([^']*)'(?:\s|$)|([\w-]+)\s*=\s*([^\s'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|'([^']*)'(?:\s|$)|(\S+)(?:\s|$)/g;e=e.replace(/[\u00a0\u200b]/g," ");let r;for(;r=o.exec(e);)r[1]?t[r[1].toLowerCase()]=r[2]:r[3]?t[r[3].toLowerCase()]=r[4]:r[5]?t[r[5].toLowerCase()]=r[6]:r[7]?n.push(r[7]):r[8]?n.push(r[8]):r[9]&&n.push(r[9]);return{named:t,numeric:n}});function HB(e){let t;return e[4]?t="self-closing":e[6]?t="closed":t="single",new UB({tag:e[2],attrs:e[3],type:t,content:e[5]})}const UB=Object.assign(function(e){const{tag:t,attrs:n,type:o,content:r}=e||{};if(Object.assign(this,{tag:t,type:o,content:r}),this.attrs={named:{},numeric:[]},!n)return;const s=["named","numeric"];typeof n=="string"?this.attrs=bX(n):n.length===s.length&&s.every((i,c)=>i===n[c])?this.attrs=n:Object.entries(n).forEach(([i,c])=>{this.set(i,c)})},{next:VB,replace:Kje,string:Yje,regexp:nz,attrs:bX,fromMatch:HB});Object.assign(UB.prototype,{get(e){return this.attrs[typeof e=="number"?"numeric":"named"][e]},set(e,t){return this.attrs[typeof e=="number"?"numeric":"named"][e]=t,this},string(){let e="["+this.tag;return this.attrs.numeric.forEach(t=>{/\s/.test(t)?e+=' "'+t+'"':e+=" "+t}),Object.entries(this.attrs.named).forEach(([t,n])=>{e+=" "+t+'="'+n+'"'}),this.type==="single"?e+"]":this.type==="self-closing"?e+" /]":(e+="]",this.content&&(e+=this.content),e+"[/"+this.tag+"]")}});const hX=e=>Array.isArray(e)?e:[e],mX=/(\n|

)\s*$/,gX=/^\s*(\n|<\/p>)/;function u2(e,t=0,n=[]){const o=Ei("from"),r=xc(o,u=>n.indexOf(u.blockName)===-1&&u.type==="shortcode"&&hX(u.tag).some(d=>nz(d).test(e)));if(!r)return[e];const i=hX(r.tag).find(u=>nz(u).test(e));let c;const l=t;if(c=VB(i,e,t)){t=c.index+c.content.length;const u=e.substr(0,c.index),d=e.substr(t);if(!c.shortcode.content?.includes("<")&&!(mX.test(u)&&gX.test(d)))return u2(e,t);if(r.isMatch&&!r.isMatch(c.shortcode.attrs))return u2(e,l,[...n,r.blockName]);let p=[];if(typeof r.transform=="function")p=[].concat(r.transform(c.shortcode.attrs,c)),p=p.map(f=>(f.originalContent=c.shortcode.content,Y4(f,on(f.name))));else{const f=Object.fromEntries(Object.entries(r.attributes).filter(([,z])=>z.shortcode).map(([z,A])=>[z,A.shortcode(c.shortcode.attrs,c)])),b=on(r.blockName);if(!b)return[e];const h={...b,attributes:r.attributes};let g=Ee(r.blockName,Wl(h,c.shortcode.content,f));g.originalContent=c.shortcode.content,g=Y4(g,h),p=[g]}return[...u2(u.replace(mX,"")),...p,...u2(d.replace(gX,""))]}return[e]}function Zje(e,t){const o={phrasingContentSchema:x5(t),isPaste:t==="paste"},r=e.map(({isMatch:l,blockName:u,schema:d})=>{const p=Tt(u,"anchor");return d=typeof d=="function"?d(o):d,!p&&!l?d:d?Object.fromEntries(Object.entries(d).map(([f,b])=>{let h=b.attributes||[];return p&&(h=[...h,"id"]),[f,{...b,attributes:h,isMatch:l||void 0}]})):{}});function s(l,u,d){switch(d){case"children":return l==="*"||u==="*"?"*":{...l,...u};case"attributes":case"require":return[...l||[],...u||[]];case"isMatch":return!l||!u?void 0:(...p)=>l(...p)||u(...p)}}function i(l,u){for(const d in u)l[d]=l[d]?s(l[d],u[d],d):{...u[d]};return l}function c(l,u){for(const d in u)l[d]=l[d]?i(l[d],u[d]):{...u[d]};return l}return r.reduce(c,{})}function Iie(e){return Zje(Wie(),e)}function Qje(e){return!/<(?!br[ />])/i.test(e)}function Die(e,t,n,o){Array.from(e).forEach(r=>{Die(r.childNodes,t,n,o),t.forEach(s=>{n.contains(r)&&s(r,n,o)})})}function tf(e,t=[],n){const o=document.implementation.createHTMLDocument("");return o.body.innerHTML=e,Die(o.body.childNodes,t,o,n),o.body.innerHTML}function Z4(e,t){const n=e[`${t}Sibling`];if(n&&k2(n))return n;const{parentNode:o}=e;if(!(!o||!k2(o)))return Z4(o,t)}function Fie(e){e.nodeType===e.COMMENT_NODE&&pf(e)}function Jje(e,t){if(i0e(e))return!0;if(!t)return!1;const n=e.nodeName.toLowerCase();return[["ul","li","ol"],["h1","h2","h3","h4","h5","h6"]].some(r=>[n,t].filter(s=>!r.includes(s)).length===0)}function $ie(e,t){return e.every(n=>Jje(n,t)&&$ie(Array.from(n.children),t))}function e7e(e){return e.nodeName==="BR"&&e.previousSibling&&e.previousSibling.nodeName==="BR"}function t7e(e,t){const n=document.implementation.createHTMLDocument("");n.body.innerHTML=e;const o=Array.from(n.body.children);return!o.some(e7e)&&$ie(o,t)}function Vie(e,t){if(e.nodeName==="SPAN"&&e.style){const{fontWeight:n,fontStyle:o,textDecorationLine:r,textDecoration:s,verticalAlign:i}=e.style;(n==="bold"||n==="700")&&yg(t.createElement("strong"),e),o==="italic"&&yg(t.createElement("em"),e),(r==="line-through"||s.includes("line-through"))&&yg(t.createElement("s"),e),i==="super"?yg(t.createElement("sup"),e):i==="sub"&&yg(t.createElement("sub"),e)}else e.nodeName==="B"?e=CH(e,"strong"):e.nodeName==="I"?e=CH(e,"em"):e.nodeName==="A"&&(e.target&&e.target.toLowerCase()==="_blank"?e.rel="noreferrer noopener":(e.removeAttribute("target"),e.removeAttribute("rel")),e.name&&!e.id&&(e.id=e.name),e.id&&!e.ownerDocument.querySelector(`[href="#${e.id}"]`)&&e.removeAttribute("id"))}function Hie(e){e.nodeName!=="SCRIPT"&&e.nodeName!=="NOSCRIPT"&&e.nodeName!=="TEMPLATE"&&e.nodeName!=="STYLE"||e.parentNode.removeChild(e)}function Uie(e){if(e.nodeType!==e.ELEMENT_NODE)return;const t=e.getAttribute("style");if(!t||!t.includes("mso-list"))return;t.split(";").reduce((o,r)=>{const[s,i]=r.split(":");return s&&i&&(o[s.trim().toLowerCase()]=i.trim().toLowerCase()),o},{})["mso-list"]==="ignore"&&e.remove()}function tC(e){return e.nodeName==="OL"||e.nodeName==="UL"}function n7e(e,t){if(e.nodeName!=="P")return;const n=e.getAttribute("style");if(!n||!n.includes("mso-list"))return;const o=e.previousElementSibling;if(!o||!tC(o)){const d=e.textContent.trim().slice(0,1),p=/[1iIaA]/.test(d),f=t.createElement(p?"ol":"ul");p&&f.setAttribute("type",d),e.parentNode.insertBefore(f,e)}const r=e.previousElementSibling,s=r.nodeName,i=t.createElement("li");let c=r;i.innerHTML=tf(e.innerHTML,[Uie]);const l=/mso-list\s*:[^;]+level([0-9]+)/i.exec(n);let u=l&&parseInt(l[1],10)-1||0;for(;u--;)c=c.lastChild||c,tC(c)&&(c=c.lastChild||c);tC(c)||(c=c.appendChild(t.createElement(s))),c.appendChild(i),e.parentNode.removeChild(e)}const Q4={};function ls(e){const t=window.URL.createObjectURL(e);return Q4[t]=e,t}function Xie(e){return Q4[e]}function Gie(e){return Xie(e)?.type.split("/")[0]}function J4(e){Q4[e]&&window.URL.revokeObjectURL(e),delete Q4[e]}function Wr(e){return!e||!e.indexOf?!1:e.indexOf("blob:")===0}function MX(e,t,n=""){if(!e||!t)return;const o=new window.Blob([t],{type:n}),r=window.URL.createObjectURL(o),s=document.createElement("a");s.href=r,s.download=e,s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(r)}function o7e(e){if(e.nodeName==="IMG"){if(e.src.indexOf("file:")===0&&(e.src=""),e.src.indexOf("data:")===0){const[t,n]=e.src.split(","),[o]=t.slice(5).split(";");if(!n||!o){e.src="";return}let r;try{r=atob(n)}catch{e.src="";return}const s=new Uint8Array(r.length);for(let l=0;l (GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,description:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,description:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",description:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,description:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,description:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,description:"Support for HTML Tag escaping. ex:

foo
",type:"boolean"},emoji:{defaultValue:!1,description:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,description:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `` and ``",type:"boolean"},completeHTMLDocument:{defaultValue:!1,description:"Outputs a complete html document, including ``, `` and `` tags",type:"boolean"},metadata:{defaultValue:!1,description:"Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).",type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,description:"Split adjacent blockquote blocks",type:"boolean"}};if(M===!1)return JSON.parse(JSON.stringify(y));var k={};for(var S in y)y.hasOwnProperty(S)&&(k[S]=y[S].defaultValue);return k}function n(){var M=t(!0),y={};for(var k in M)M.hasOwnProperty(k)&&(y[k]=!0);return y}var o={},r={},s={},i=t(!0),c="vanilla",l={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:t(!0),allOn:n()};o.helper={},o.extensions={},o.setOption=function(M,y){return i[M]=y,this},o.getOption=function(M){return i[M]},o.getOptions=function(){return i},o.resetOptions=function(){i=t(!0)},o.setFlavor=function(M){if(!l.hasOwnProperty(M))throw Error(M+" flavor was not found");o.resetOptions();var y=l[M];c=M;for(var k in y)y.hasOwnProperty(k)&&(i[k]=y[k])},o.getFlavor=function(){return c},o.getFlavorOptions=function(M){if(l.hasOwnProperty(M))return l[M]},o.getDefaultOptions=function(M){return t(M)},o.subParser=function(M,y){if(o.helper.isString(M))if(typeof y<"u")r[M]=y;else{if(r.hasOwnProperty(M))return r[M];throw Error("SubParser named "+M+" not registered!")}},o.extension=function(M,y){if(!o.helper.isString(M))throw Error("Extension 'name' must be a string");if(M=o.helper.stdExtName(M),o.helper.isUndefined(y)){if(!s.hasOwnProperty(M))throw Error("Extension named "+M+" is not registered!");return s[M]}else{typeof y=="function"&&(y=y()),o.helper.isArray(y)||(y=[y]);var k=u(y,M);if(k.valid)s[M]=y;else throw Error(k.error)}},o.getAllExtensions=function(){return s},o.removeExtension=function(M){delete s[M]},o.resetExtensions=function(){s={}};function u(M,y){var k=y?"Error in "+y+" extension->":"Error in unnamed extension",S={valid:!0,error:""};o.helper.isArray(M)||(M=[M]);for(var C=0;C"u"},o.helper.forEach=function(M,y){if(o.helper.isUndefined(M))throw new Error("obj param is required");if(o.helper.isUndefined(y))throw new Error("callback param is required");if(!o.helper.isFunction(y))throw new Error("callback param must be a function/closure");if(typeof M.forEach=="function")M.forEach(y);else if(o.helper.isArray(M))for(var k=0;k").replace(/&/g,"&")};var p=function(M,y,k,S){var C=S||"",R=C.indexOf("g")>-1,T=new RegExp(y+"|"+k,"g"+C.replace(/g/g,"")),E=new RegExp(y,C.replace(/g/g,"")),B=[],N,j,I,P,$;do for(N=0;I=T.exec(M);)if(E.test(I[0]))N++||(j=T.lastIndex,P=j-I[0].length);else if(N&&!--N){$=I.index+I[0].length;var F={left:{start:P,end:j},match:{start:j,end:I.index},right:{start:I.index,end:$},wholeMatch:{start:P,end:$}};if(B.push(F),!R)return B}while(N&&(T.lastIndex=j));return B};o.helper.matchRecursiveRegExp=function(M,y,k,S){for(var C=p(M,y,k,S),R=[],T=0;T0){var N=[];T[0].wholeMatch.start!==0&&N.push(M.slice(0,T[0].wholeMatch.start));for(var j=0;j=0?S+(k||0):S},o.helper.splitAtIndex=function(M,y){if(!o.helper.isString(M))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[M.substring(0,y),M.substring(y)]},o.helper.encodeEmailAddress=function(M){var y=[function(k){return"&#"+k.charCodeAt(0)+";"},function(k){return"&#x"+k.charCodeAt(0).toString(16)+";"},function(k){return k}];return M=M.replace(/./g,function(k){if(k==="@")k=y[Math.floor(Math.random()*2)](k);else{var S=Math.random();k=S>.9?y[2](k):S>.45?y[1](k):y[0](k)}return k}),M},o.helper.padEnd=function(y,k,S){return k=k>>0,S=String(S||" "),y.length>k?String(y):(k=k-y.length,k>S.length&&(S+=S.repeat(k/S.length)),String(y)+S.slice(0,k))},typeof console>"u"&&(console={warn:function(M){alert(M)},log:function(M){alert(M)},error:function(M){throw M}}),o.helper.regexes={asteriskDashAndColon:/([*_:~])/g},o.helper.emojis={"+1":"👍","-1":"👎",100:"💯",1234:"🔢","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉","8ball":"🎱",a:"🅰️",ab:"🆎",abc:"🔤",abcd:"🔡",accept:"🉑",aerial_tramway:"🚡",airplane:"✈️",alarm_clock:"⏰",alembic:"⚗️",alien:"👽",ambulance:"🚑",amphora:"🏺",anchor:"⚓️",angel:"👼",anger:"💢",angry:"😠",anguished:"😧",ant:"🐜",apple:"🍎",aquarius:"♒️",aries:"♈️",arrow_backward:"◀️",arrow_double_down:"⏬",arrow_double_up:"⏫",arrow_down:"⬇️",arrow_down_small:"🔽",arrow_forward:"▶️",arrow_heading_down:"⤵️",arrow_heading_up:"⤴️",arrow_left:"⬅️",arrow_lower_left:"↙️",arrow_lower_right:"↘️",arrow_right:"➡️",arrow_right_hook:"↪️",arrow_up:"⬆️",arrow_up_down:"↕️",arrow_up_small:"🔼",arrow_upper_left:"↖️",arrow_upper_right:"↗️",arrows_clockwise:"🔃",arrows_counterclockwise:"🔄",art:"🎨",articulated_lorry:"🚛",artificial_satellite:"🛰",astonished:"😲",athletic_shoe:"👟",atm:"🏧",atom_symbol:"⚛️",avocado:"🥑",b:"🅱️",baby:"👶",baby_bottle:"🍼",baby_chick:"🐤",baby_symbol:"🚼",back:"🔙",bacon:"🥓",badminton:"🏸",baggage_claim:"🛄",baguette_bread:"🥖",balance_scale:"⚖️",balloon:"🎈",ballot_box:"🗳",ballot_box_with_check:"☑️",bamboo:"🎍",banana:"🍌",bangbang:"‼️",bank:"🏦",bar_chart:"📊",barber:"💈",baseball:"⚾️",basketball:"🏀",basketball_man:"⛹️",basketball_woman:"⛹️‍♀️",bat:"🦇",bath:"🛀",bathtub:"🛁",battery:"🔋",beach_umbrella:"🏖",bear:"🐻",bed:"🛏",bee:"🐝",beer:"🍺",beers:"🍻",beetle:"🐞",beginner:"🔰",bell:"🔔",bellhop_bell:"🛎",bento:"🍱",biking_man:"🚴",bike:"🚲",biking_woman:"🚴‍♀️",bikini:"👙",biohazard:"☣️",bird:"🐦",birthday:"🎂",black_circle:"⚫️",black_flag:"🏴",black_heart:"🖤",black_joker:"🃏",black_large_square:"⬛️",black_medium_small_square:"◾️",black_medium_square:"◼️",black_nib:"✒️",black_small_square:"▪️",black_square_button:"🔲",blonde_man:"👱",blonde_woman:"👱‍♀️",blossom:"🌼",blowfish:"🐡",blue_book:"📘",blue_car:"🚙",blue_heart:"💙",blush:"😊",boar:"🐗",boat:"⛵️",bomb:"💣",book:"📖",bookmark:"🔖",bookmark_tabs:"📑",books:"📚",boom:"💥",boot:"👢",bouquet:"💐",bowing_man:"🙇",bow_and_arrow:"🏹",bowing_woman:"🙇‍♀️",bowling:"🎳",boxing_glove:"🥊",boy:"👦",bread:"🍞",bride_with_veil:"👰",bridge_at_night:"🌉",briefcase:"💼",broken_heart:"💔",bug:"🐛",building_construction:"🏗",bulb:"💡",bullettrain_front:"🚅",bullettrain_side:"🚄",burrito:"🌯",bus:"🚌",business_suit_levitating:"🕴",busstop:"🚏",bust_in_silhouette:"👤",busts_in_silhouette:"👥",butterfly:"🦋",cactus:"🌵",cake:"🍰",calendar:"📆",call_me_hand:"🤙",calling:"📲",camel:"🐫",camera:"📷",camera_flash:"📸",camping:"🏕",cancer:"♋️",candle:"🕯",candy:"🍬",canoe:"🛶",capital_abcd:"🔠",capricorn:"♑️",car:"🚗",card_file_box:"🗃",card_index:"📇",card_index_dividers:"🗂",carousel_horse:"🎠",carrot:"🥕",cat:"🐱",cat2:"🐈",cd:"💿",chains:"⛓",champagne:"🍾",chart:"💹",chart_with_downwards_trend:"📉",chart_with_upwards_trend:"📈",checkered_flag:"🏁",cheese:"🧀",cherries:"🍒",cherry_blossom:"🌸",chestnut:"🌰",chicken:"🐔",children_crossing:"🚸",chipmunk:"🐿",chocolate_bar:"🍫",christmas_tree:"🎄",church:"⛪️",cinema:"🎦",circus_tent:"🎪",city_sunrise:"🌇",city_sunset:"🌆",cityscape:"🏙",cl:"🆑",clamp:"🗜",clap:"👏",clapper:"🎬",classical_building:"🏛",clinking_glasses:"🥂",clipboard:"📋",clock1:"🕐",clock10:"🕙",clock1030:"🕥",clock11:"🕚",clock1130:"🕦",clock12:"🕛",clock1230:"🕧",clock130:"🕜",clock2:"🕑",clock230:"🕝",clock3:"🕒",clock330:"🕞",clock4:"🕓",clock430:"🕟",clock5:"🕔",clock530:"🕠",clock6:"🕕",clock630:"🕡",clock7:"🕖",clock730:"🕢",clock8:"🕗",clock830:"🕣",clock9:"🕘",clock930:"🕤",closed_book:"📕",closed_lock_with_key:"🔐",closed_umbrella:"🌂",cloud:"☁️",cloud_with_lightning:"🌩",cloud_with_lightning_and_rain:"⛈",cloud_with_rain:"🌧",cloud_with_snow:"🌨",clown_face:"🤡",clubs:"♣️",cocktail:"🍸",coffee:"☕️",coffin:"⚰️",cold_sweat:"😰",comet:"☄️",computer:"💻",computer_mouse:"🖱",confetti_ball:"🎊",confounded:"😖",confused:"😕",congratulations:"㊗️",construction:"🚧",construction_worker_man:"👷",construction_worker_woman:"👷‍♀️",control_knobs:"🎛",convenience_store:"🏪",cookie:"🍪",cool:"🆒",policeman:"👮",copyright:"©️",corn:"🌽",couch_and_lamp:"🛋",couple:"👫",couple_with_heart_woman_man:"💑",couple_with_heart_man_man:"👨‍❤️‍👨",couple_with_heart_woman_woman:"👩‍❤️‍👩",couplekiss_man_man:"👨‍❤️‍💋‍👨",couplekiss_man_woman:"💏",couplekiss_woman_woman:"👩‍❤️‍💋‍👩",cow:"🐮",cow2:"🐄",cowboy_hat_face:"🤠",crab:"🦀",crayon:"🖍",credit_card:"💳",crescent_moon:"🌙",cricket:"🏏",crocodile:"🐊",croissant:"🥐",crossed_fingers:"🤞",crossed_flags:"🎌",crossed_swords:"⚔️",crown:"👑",cry:"😢",crying_cat_face:"😿",crystal_ball:"🔮",cucumber:"🥒",cupid:"💘",curly_loop:"➰",currency_exchange:"💱",curry:"🍛",custard:"🍮",customs:"🛃",cyclone:"🌀",dagger:"🗡",dancer:"💃",dancing_women:"👯",dancing_men:"👯‍♂️",dango:"🍡",dark_sunglasses:"🕶",dart:"🎯",dash:"💨",date:"📅",deciduous_tree:"🌳",deer:"🦌",department_store:"🏬",derelict_house:"🏚",desert:"🏜",desert_island:"🏝",desktop_computer:"🖥",male_detective:"🕵️",diamond_shape_with_a_dot_inside:"💠",diamonds:"♦️",disappointed:"😞",disappointed_relieved:"😥",dizzy:"💫",dizzy_face:"😵",do_not_litter:"🚯",dog:"🐶",dog2:"🐕",dollar:"💵",dolls:"🎎",dolphin:"🐬",door:"🚪",doughnut:"🍩",dove:"🕊",dragon:"🐉",dragon_face:"🐲",dress:"👗",dromedary_camel:"🐪",drooling_face:"🤤",droplet:"💧",drum:"🥁",duck:"🦆",dvd:"📀","e-mail":"📧",eagle:"🦅",ear:"👂",ear_of_rice:"🌾",earth_africa:"🌍",earth_americas:"🌎",earth_asia:"🌏",egg:"🥚",eggplant:"🍆",eight_pointed_black_star:"✴️",eight_spoked_asterisk:"✳️",electric_plug:"🔌",elephant:"🐘",email:"✉️",end:"🔚",envelope_with_arrow:"📩",euro:"💶",european_castle:"🏰",european_post_office:"🏤",evergreen_tree:"🌲",exclamation:"❗️",expressionless:"😑",eye:"👁",eye_speech_bubble:"👁‍🗨",eyeglasses:"👓",eyes:"👀",face_with_head_bandage:"🤕",face_with_thermometer:"🤒",fist_oncoming:"👊",factory:"🏭",fallen_leaf:"🍂",family_man_woman_boy:"👪",family_man_boy:"👨‍👦",family_man_boy_boy:"👨‍👦‍👦",family_man_girl:"👨‍👧",family_man_girl_boy:"👨‍👧‍👦",family_man_girl_girl:"👨‍👧‍👧",family_man_man_boy:"👨‍👨‍👦",family_man_man_boy_boy:"👨‍👨‍👦‍👦",family_man_man_girl:"👨‍👨‍👧",family_man_man_girl_boy:"👨‍👨‍👧‍👦",family_man_man_girl_girl:"👨‍👨‍👧‍👧",family_man_woman_boy_boy:"👨‍👩‍👦‍👦",family_man_woman_girl:"👨‍👩‍👧",family_man_woman_girl_boy:"👨‍👩‍👧‍👦",family_man_woman_girl_girl:"👨‍👩‍👧‍👧",family_woman_boy:"👩‍👦",family_woman_boy_boy:"👩‍👦‍👦",family_woman_girl:"👩‍👧",family_woman_girl_boy:"👩‍👧‍👦",family_woman_girl_girl:"👩‍👧‍👧",family_woman_woman_boy:"👩‍👩‍👦",family_woman_woman_boy_boy:"👩‍👩‍👦‍👦",family_woman_woman_girl:"👩‍👩‍👧",family_woman_woman_girl_boy:"👩‍👩‍👧‍👦",family_woman_woman_girl_girl:"👩‍👩‍👧‍👧",fast_forward:"⏩",fax:"📠",fearful:"😨",feet:"🐾",female_detective:"🕵️‍♀️",ferris_wheel:"🎡",ferry:"⛴",field_hockey:"🏑",file_cabinet:"🗄",file_folder:"📁",film_projector:"📽",film_strip:"🎞",fire:"🔥",fire_engine:"🚒",fireworks:"🎆",first_quarter_moon:"🌓",first_quarter_moon_with_face:"🌛",fish:"🐟",fish_cake:"🍥",fishing_pole_and_fish:"🎣",fist_raised:"✊",fist_left:"🤛",fist_right:"🤜",flags:"🎏",flashlight:"🔦",fleur_de_lis:"⚜️",flight_arrival:"🛬",flight_departure:"🛫",floppy_disk:"💾",flower_playing_cards:"🎴",flushed:"😳",fog:"🌫",foggy:"🌁",football:"🏈",footprints:"👣",fork_and_knife:"🍴",fountain:"⛲️",fountain_pen:"🖋",four_leaf_clover:"🍀",fox_face:"🦊",framed_picture:"🖼",free:"🆓",fried_egg:"🍳",fried_shrimp:"🍤",fries:"🍟",frog:"🐸",frowning:"😦",frowning_face:"☹️",frowning_man:"🙍‍♂️",frowning_woman:"🙍",middle_finger:"🖕",fuelpump:"⛽️",full_moon:"🌕",full_moon_with_face:"🌝",funeral_urn:"⚱️",game_die:"🎲",gear:"⚙️",gem:"💎",gemini:"♊️",ghost:"👻",gift:"🎁",gift_heart:"💝",girl:"👧",globe_with_meridians:"🌐",goal_net:"🥅",goat:"🐐",golf:"⛳️",golfing_man:"🏌️",golfing_woman:"🏌️‍♀️",gorilla:"🦍",grapes:"🍇",green_apple:"🍏",green_book:"📗",green_heart:"💚",green_salad:"🥗",grey_exclamation:"❕",grey_question:"❔",grimacing:"😬",grin:"😁",grinning:"😀",guardsman:"💂",guardswoman:"💂‍♀️",guitar:"🎸",gun:"🔫",haircut_woman:"💇",haircut_man:"💇‍♂️",hamburger:"🍔",hammer:"🔨",hammer_and_pick:"⚒",hammer_and_wrench:"🛠",hamster:"🐹",hand:"✋",handbag:"👜",handshake:"🤝",hankey:"💩",hatched_chick:"🐥",hatching_chick:"🐣",headphones:"🎧",hear_no_evil:"🙉",heart:"❤️",heart_decoration:"💟",heart_eyes:"😍",heart_eyes_cat:"😻",heartbeat:"💓",heartpulse:"💗",hearts:"♥️",heavy_check_mark:"✔️",heavy_division_sign:"➗",heavy_dollar_sign:"💲",heavy_heart_exclamation:"❣️",heavy_minus_sign:"➖",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",helicopter:"🚁",herb:"🌿",hibiscus:"🌺",high_brightness:"🔆",high_heel:"👠",hocho:"🔪",hole:"🕳",honey_pot:"🍯",horse:"🐴",horse_racing:"🏇",hospital:"🏥",hot_pepper:"🌶",hotdog:"🌭",hotel:"🏨",hotsprings:"♨️",hourglass:"⌛️",hourglass_flowing_sand:"⏳",house:"🏠",house_with_garden:"🏡",houses:"🏘",hugs:"🤗",hushed:"😯",ice_cream:"🍨",ice_hockey:"🏒",ice_skate:"⛸",icecream:"🍦",id:"🆔",ideograph_advantage:"🉐",imp:"👿",inbox_tray:"📥",incoming_envelope:"📨",tipping_hand_woman:"💁",information_source:"ℹ️",innocent:"😇",interrobang:"⁉️",iphone:"📱",izakaya_lantern:"🏮",jack_o_lantern:"🎃",japan:"🗾",japanese_castle:"🏯",japanese_goblin:"👺",japanese_ogre:"👹",jeans:"👖",joy:"😂",joy_cat:"😹",joystick:"🕹",kaaba:"🕋",key:"🔑",keyboard:"⌨️",keycap_ten:"🔟",kick_scooter:"🛴",kimono:"👘",kiss:"💋",kissing:"😗",kissing_cat:"😽",kissing_closed_eyes:"😚",kissing_heart:"😘",kissing_smiling_eyes:"😙",kiwi_fruit:"🥝",koala:"🐨",koko:"🈁",label:"🏷",large_blue_circle:"🔵",large_blue_diamond:"🔷",large_orange_diamond:"🔶",last_quarter_moon:"🌗",last_quarter_moon_with_face:"🌜",latin_cross:"✝️",laughing:"😆",leaves:"🍃",ledger:"📒",left_luggage:"🛅",left_right_arrow:"↔️",leftwards_arrow_with_hook:"↩️",lemon:"🍋",leo:"♌️",leopard:"🐆",level_slider:"🎚",libra:"♎️",light_rail:"🚈",link:"🔗",lion:"🦁",lips:"👄",lipstick:"💄",lizard:"🦎",lock:"🔒",lock_with_ink_pen:"🔏",lollipop:"🍭",loop:"➿",loud_sound:"🔊",loudspeaker:"📢",love_hotel:"🏩",love_letter:"💌",low_brightness:"🔅",lying_face:"🤥",m:"Ⓜ️",mag:"🔍",mag_right:"🔎",mahjong:"🀄️",mailbox:"📫",mailbox_closed:"📪",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",man:"👨",man_artist:"👨‍🎨",man_astronaut:"👨‍🚀",man_cartwheeling:"🤸‍♂️",man_cook:"👨‍🍳",man_dancing:"🕺",man_facepalming:"🤦‍♂️",man_factory_worker:"👨‍🏭",man_farmer:"👨‍🌾",man_firefighter:"👨‍🚒",man_health_worker:"👨‍⚕️",man_in_tuxedo:"🤵",man_judge:"👨‍⚖️",man_juggling:"🤹‍♂️",man_mechanic:"👨‍🔧",man_office_worker:"👨‍💼",man_pilot:"👨‍✈️",man_playing_handball:"🤾‍♂️",man_playing_water_polo:"🤽‍♂️",man_scientist:"👨‍🔬",man_shrugging:"🤷‍♂️",man_singer:"👨‍🎤",man_student:"👨‍🎓",man_teacher:"👨‍🏫",man_technologist:"👨‍💻",man_with_gua_pi_mao:"👲",man_with_turban:"👳",tangerine:"🍊",mans_shoe:"👞",mantelpiece_clock:"🕰",maple_leaf:"🍁",martial_arts_uniform:"🥋",mask:"😷",massage_woman:"💆",massage_man:"💆‍♂️",meat_on_bone:"🍖",medal_military:"🎖",medal_sports:"🏅",mega:"📣",melon:"🍈",memo:"📝",men_wrestling:"🤼‍♂️",menorah:"🕎",mens:"🚹",metal:"🤘",metro:"🚇",microphone:"🎤",microscope:"🔬",milk_glass:"🥛",milky_way:"🌌",minibus:"🚐",minidisc:"💽",mobile_phone_off:"📴",money_mouth_face:"🤑",money_with_wings:"💸",moneybag:"💰",monkey:"🐒",monkey_face:"🐵",monorail:"🚝",moon:"🌔",mortar_board:"🎓",mosque:"🕌",motor_boat:"🛥",motor_scooter:"🛵",motorcycle:"🏍",motorway:"🛣",mount_fuji:"🗻",mountain:"⛰",mountain_biking_man:"🚵",mountain_biking_woman:"🚵‍♀️",mountain_cableway:"🚠",mountain_railway:"🚞",mountain_snow:"🏔",mouse:"🐭",mouse2:"🐁",movie_camera:"🎥",moyai:"🗿",mrs_claus:"🤶",muscle:"💪",mushroom:"🍄",musical_keyboard:"🎹",musical_note:"🎵",musical_score:"🎼",mute:"🔇",nail_care:"💅",name_badge:"📛",national_park:"🏞",nauseated_face:"🤢",necktie:"👔",negative_squared_cross_mark:"❎",nerd_face:"🤓",neutral_face:"😐",new:"🆕",new_moon:"🌑",new_moon_with_face:"🌚",newspaper:"📰",newspaper_roll:"🗞",next_track_button:"⏭",ng:"🆖",no_good_man:"🙅‍♂️",no_good_woman:"🙅",night_with_stars:"🌃",no_bell:"🔕",no_bicycles:"🚳",no_entry:"⛔️",no_entry_sign:"🚫",no_mobile_phones:"📵",no_mouth:"😶",no_pedestrians:"🚷",no_smoking:"🚭","non-potable_water":"🚱",nose:"👃",notebook:"📓",notebook_with_decorative_cover:"📔",notes:"🎶",nut_and_bolt:"🔩",o:"⭕️",o2:"🅾️",ocean:"🌊",octopus:"🐙",oden:"🍢",office:"🏢",oil_drum:"🛢",ok:"🆗",ok_hand:"👌",ok_man:"🙆‍♂️",ok_woman:"🙆",old_key:"🗝",older_man:"👴",older_woman:"👵",om:"🕉",on:"🔛",oncoming_automobile:"🚘",oncoming_bus:"🚍",oncoming_police_car:"🚔",oncoming_taxi:"🚖",open_file_folder:"📂",open_hands:"👐",open_mouth:"😮",open_umbrella:"☂️",ophiuchus:"⛎",orange_book:"📙",orthodox_cross:"☦️",outbox_tray:"📤",owl:"🦉",ox:"🐂",package:"📦",page_facing_up:"📄",page_with_curl:"📃",pager:"📟",paintbrush:"🖌",palm_tree:"🌴",pancakes:"🥞",panda_face:"🐼",paperclip:"📎",paperclips:"🖇",parasol_on_ground:"⛱",parking:"🅿️",part_alternation_mark:"〽️",partly_sunny:"⛅️",passenger_ship:"🛳",passport_control:"🛂",pause_button:"⏸",peace_symbol:"☮️",peach:"🍑",peanuts:"🥜",pear:"🍐",pen:"🖊",pencil2:"✏️",penguin:"🐧",pensive:"😔",performing_arts:"🎭",persevere:"😣",person_fencing:"🤺",pouting_woman:"🙎",phone:"☎️",pick:"⛏",pig:"🐷",pig2:"🐖",pig_nose:"🐽",pill:"💊",pineapple:"🍍",ping_pong:"🏓",pisces:"♓️",pizza:"🍕",place_of_worship:"🛐",plate_with_cutlery:"🍽",play_or_pause_button:"⏯",point_down:"👇",point_left:"👈",point_right:"👉",point_up:"☝️",point_up_2:"👆",police_car:"🚓",policewoman:"👮‍♀️",poodle:"🐩",popcorn:"🍿",post_office:"🏣",postal_horn:"📯",postbox:"📮",potable_water:"🚰",potato:"🥔",pouch:"👝",poultry_leg:"🍗",pound:"💷",rage:"😡",pouting_cat:"😾",pouting_man:"🙎‍♂️",pray:"🙏",prayer_beads:"📿",pregnant_woman:"🤰",previous_track_button:"⏮",prince:"🤴",princess:"👸",printer:"🖨",purple_heart:"💜",purse:"👛",pushpin:"📌",put_litter_in_its_place:"🚮",question:"❓",rabbit:"🐰",rabbit2:"🐇",racehorse:"🐎",racing_car:"🏎",radio:"📻",radio_button:"🔘",radioactive:"☢️",railway_car:"🚃",railway_track:"🛤",rainbow:"🌈",rainbow_flag:"🏳️‍🌈",raised_back_of_hand:"🤚",raised_hand_with_fingers_splayed:"🖐",raised_hands:"🙌",raising_hand_woman:"🙋",raising_hand_man:"🙋‍♂️",ram:"🐏",ramen:"🍜",rat:"🐀",record_button:"⏺",recycle:"♻️",red_circle:"🔴",registered:"®️",relaxed:"☺️",relieved:"😌",reminder_ribbon:"🎗",repeat:"🔁",repeat_one:"🔂",rescue_worker_helmet:"⛑",restroom:"🚻",revolving_hearts:"💞",rewind:"⏪",rhinoceros:"🦏",ribbon:"🎀",rice:"🍚",rice_ball:"🍙",rice_cracker:"🍘",rice_scene:"🎑",right_anger_bubble:"🗯",ring:"💍",robot:"🤖",rocket:"🚀",rofl:"🤣",roll_eyes:"🙄",roller_coaster:"🎢",rooster:"🐓",rose:"🌹",rosette:"🏵",rotating_light:"🚨",round_pushpin:"📍",rowing_man:"🚣",rowing_woman:"🚣‍♀️",rugby_football:"🏉",running_man:"🏃",running_shirt_with_sash:"🎽",running_woman:"🏃‍♀️",sa:"🈂️",sagittarius:"♐️",sake:"🍶",sandal:"👡",santa:"🎅",satellite:"📡",saxophone:"🎷",school:"🏫",school_satchel:"🎒",scissors:"✂️",scorpion:"🦂",scorpius:"♏️",scream:"😱",scream_cat:"🙀",scroll:"📜",seat:"💺",secret:"㊙️",see_no_evil:"🙈",seedling:"🌱",selfie:"🤳",shallow_pan_of_food:"🥘",shamrock:"☘️",shark:"🦈",shaved_ice:"🍧",sheep:"🐑",shell:"🐚",shield:"🛡",shinto_shrine:"⛩",ship:"🚢",shirt:"👕",shopping:"🛍",shopping_cart:"🛒",shower:"🚿",shrimp:"🦐",signal_strength:"📶",six_pointed_star:"🔯",ski:"🎿",skier:"⛷",skull:"💀",skull_and_crossbones:"☠️",sleeping:"😴",sleeping_bed:"🛌",sleepy:"😪",slightly_frowning_face:"🙁",slightly_smiling_face:"🙂",slot_machine:"🎰",small_airplane:"🛩",small_blue_diamond:"🔹",small_orange_diamond:"🔸",small_red_triangle:"🔺",small_red_triangle_down:"🔻",smile:"😄",smile_cat:"😸",smiley:"😃",smiley_cat:"😺",smiling_imp:"😈",smirk:"😏",smirk_cat:"😼",smoking:"🚬",snail:"🐌",snake:"🐍",sneezing_face:"🤧",snowboarder:"🏂",snowflake:"❄️",snowman:"⛄️",snowman_with_snow:"☃️",sob:"😭",soccer:"⚽️",soon:"🔜",sos:"🆘",sound:"🔉",space_invader:"👾",spades:"♠️",spaghetti:"🍝",sparkle:"❇️",sparkler:"🎇",sparkles:"✨",sparkling_heart:"💖",speak_no_evil:"🙊",speaker:"🔈",speaking_head:"🗣",speech_balloon:"💬",speedboat:"🚤",spider:"🕷",spider_web:"🕸",spiral_calendar:"🗓",spiral_notepad:"🗒",spoon:"🥄",squid:"🦑",stadium:"🏟",star:"⭐️",star2:"🌟",star_and_crescent:"☪️",star_of_david:"✡️",stars:"🌠",station:"🚉",statue_of_liberty:"🗽",steam_locomotive:"🚂",stew:"🍲",stop_button:"⏹",stop_sign:"🛑",stopwatch:"⏱",straight_ruler:"📏",strawberry:"🍓",stuck_out_tongue:"😛",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue_winking_eye:"😜",studio_microphone:"🎙",stuffed_flatbread:"🥙",sun_behind_large_cloud:"🌥",sun_behind_rain_cloud:"🌦",sun_behind_small_cloud:"🌤",sun_with_face:"🌞",sunflower:"🌻",sunglasses:"😎",sunny:"☀️",sunrise:"🌅",sunrise_over_mountains:"🌄",surfing_man:"🏄",surfing_woman:"🏄‍♀️",sushi:"🍣",suspension_railway:"🚟",sweat:"😓",sweat_drops:"💦",sweat_smile:"😅",sweet_potato:"🍠",swimming_man:"🏊",swimming_woman:"🏊‍♀️",symbols:"🔣",synagogue:"🕍",syringe:"💉",taco:"🌮",tada:"🎉",tanabata_tree:"🎋",taurus:"♉️",taxi:"🚕",tea:"🍵",telephone_receiver:"📞",telescope:"🔭",tennis:"🎾",tent:"⛺️",thermometer:"🌡",thinking:"🤔",thought_balloon:"💭",ticket:"🎫",tickets:"🎟",tiger:"🐯",tiger2:"🐅",timer_clock:"⏲",tipping_hand_man:"💁‍♂️",tired_face:"😫",tm:"™️",toilet:"🚽",tokyo_tower:"🗼",tomato:"🍅",tongue:"👅",top:"🔝",tophat:"🎩",tornado:"🌪",trackball:"🖲",tractor:"🚜",traffic_light:"🚥",train:"🚋",train2:"🚆",tram:"🚊",triangular_flag_on_post:"🚩",triangular_ruler:"📐",trident:"🔱",triumph:"😤",trolleybus:"🚎",trophy:"🏆",tropical_drink:"🍹",tropical_fish:"🐠",truck:"🚚",trumpet:"🎺",tulip:"🌷",tumbler_glass:"🥃",turkey:"🦃",turtle:"🐢",tv:"📺",twisted_rightwards_arrows:"🔀",two_hearts:"💕",two_men_holding_hands:"👬",two_women_holding_hands:"👭",u5272:"🈹",u5408:"🈴",u55b6:"🈺",u6307:"🈯️",u6708:"🈷️",u6709:"🈶",u6e80:"🈵",u7121:"🈚️",u7533:"🈸",u7981:"🈲",u7a7a:"🈳",umbrella:"☔️",unamused:"😒",underage:"🔞",unicorn:"🦄",unlock:"🔓",up:"🆙",upside_down_face:"🙃",v:"✌️",vertical_traffic_light:"🚦",vhs:"📼",vibration_mode:"📳",video_camera:"📹",video_game:"🎮",violin:"🎻",virgo:"♍️",volcano:"🌋",volleyball:"🏐",vs:"🆚",vulcan_salute:"🖖",walking_man:"🚶",walking_woman:"🚶‍♀️",waning_crescent_moon:"🌘",waning_gibbous_moon:"🌖",warning:"⚠️",wastebasket:"🗑",watch:"⌚️",water_buffalo:"🐃",watermelon:"🍉",wave:"👋",wavy_dash:"〰️",waxing_crescent_moon:"🌒",wc:"🚾",weary:"😩",wedding:"💒",weight_lifting_man:"🏋️",weight_lifting_woman:"🏋️‍♀️",whale:"🐳",whale2:"🐋",wheel_of_dharma:"☸️",wheelchair:"♿️",white_check_mark:"✅",white_circle:"⚪️",white_flag:"🏳️",white_flower:"💮",white_large_square:"⬜️",white_medium_small_square:"◽️",white_medium_square:"◻️",white_small_square:"▫️",white_square_button:"🔳",wilted_flower:"🥀",wind_chime:"🎐",wind_face:"🌬",wine_glass:"🍷",wink:"😉",wolf:"🐺",woman:"👩",woman_artist:"👩‍🎨",woman_astronaut:"👩‍🚀",woman_cartwheeling:"🤸‍♀️",woman_cook:"👩‍🍳",woman_facepalming:"🤦‍♀️",woman_factory_worker:"👩‍🏭",woman_farmer:"👩‍🌾",woman_firefighter:"👩‍🚒",woman_health_worker:"👩‍⚕️",woman_judge:"👩‍⚖️",woman_juggling:"🤹‍♀️",woman_mechanic:"👩‍🔧",woman_office_worker:"👩‍💼",woman_pilot:"👩‍✈️",woman_playing_handball:"🤾‍♀️",woman_playing_water_polo:"🤽‍♀️",woman_scientist:"👩‍🔬",woman_shrugging:"🤷‍♀️",woman_singer:"👩‍🎤",woman_student:"👩‍🎓",woman_teacher:"👩‍🏫",woman_technologist:"👩‍💻",woman_with_turban:"👳‍♀️",womans_clothes:"👚",womans_hat:"👒",women_wrestling:"🤼‍♀️",womens:"🚺",world_map:"🗺",worried:"😟",wrench:"🔧",writing_hand:"✍️",x:"❌",yellow_heart:"💛",yen:"💴",yin_yang:"☯️",yum:"😋",zap:"⚡️",zipper_mouth_face:"🤐",zzz:"💤",octocat:':octocat:',showdown:`S`},o.Converter=function(M){var y={},k=[],S=[],C={},R=c,T={parsed:{},raw:"",format:""};E();function E(){M=M||{};for(var P in i)i.hasOwnProperty(P)&&(y[P]=i[P]);if(typeof M=="object")for(var $ in M)M.hasOwnProperty($)&&(y[$]=M[$]);else throw Error("Converter expects the passed parameter to be an object, but "+typeof M+" was passed instead.");y.extensions&&o.helper.forEach(y.extensions,B)}function B(P,$){if($=$||null,o.helper.isString(P))if(P=o.helper.stdExtName(P),$=P,o.extensions[P]){console.warn("DEPRECATION WARNING: "+P+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),N(o.extensions[P],P);return}else if(!o.helper.isUndefined(s[P]))P=s[P];else throw Error('Extension "'+P+'" could not be loaded. It was either not found or is not a valid extension.');typeof P=="function"&&(P=P()),o.helper.isArray(P)||(P=[P]);var F=u(P,$);if(!F.valid)throw Error(F.error);for(var X=0;X/g,"\\$1>"),y=y.replace(/^#/gm,"\\#"),y=y.replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3"),y=y.replace(/^( {0,3}\d+)\./gm,"$1\\."),y=y.replace(/^( {0,3})([+-])/gm,"$1\\$2"),y=y.replace(/]([\s]*)\(/g,"\\]$1\\("),y=y.replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:"),y});var v=this;e.exports?e.exports=o:v.showdown=o}).call(s7e)}(Dv)),Dv.exports}var a7e=i7e();const c7e=Zr(a7e),l7e=new c7e.Converter({noHeaderId:!0,tables:!0,literalMidWordUnderscores:!0,omitExtraWLInCodeBlocks:!0,simpleLineBreaks:!0,strikethrough:!0});function u7e(e){return e.replace(/((?:^|\n)```)([^\n`]+)(```(?:$|\n))/,(t,n,o,r)=>`${n} ${o} ${r}`)}function d7e(e){return e.replace(/(^|\n)•( +)/g,"$1*$2")}function p7e(e){return l7e.makeHtml(u7e(d7e(e)))}function f7e(e){if(e.nodeName==="IFRAME"){const t=e.ownerDocument.createTextNode(e.src);e.parentNode.replaceChild(t,e)}}function Kie(e){!e.id||e.id.indexOf("docs-internal-guid-")!==0||(e.tagName==="B"?mM(e):e.removeAttribute("id"))}function b7e(e){return e===" "||e==="\r"||e===` -`||e===" "}function Yie(e){if(e.nodeType!==e.TEXT_NODE)return;let t=e;for(;t=t.parentNode;)if(t.nodeType===t.ELEMENT_NODE&&t.nodeName==="PRE")return;let n=e.data.replace(/[ \r\n\t]+/g," ");if(n[0]===" "){const o=Z4(e,"previous");(!o||o.nodeName==="BR"||o.textContent.slice(-1)===" ")&&(n=n.slice(1))}if(n[n.length-1]===" "){const o=Z4(e,"next");(!o||o.nodeName==="BR"||o.nodeType===o.TEXT_NODE&&b7e(o.textContent[0]))&&(n=n.slice(0,-1))}n?e.data=n:e.parentNode.removeChild(e)}function Zie(e){e.nodeName==="BR"&&(Z4(e,"next")||e.parentNode.removeChild(e))}function h7e(e){e.nodeName==="P"&&(e.hasChildNodes()||e.parentNode.removeChild(e))}function m7e(e){if(e.nodeName!=="SPAN"||e.getAttribute("data-stringify-type")!=="paragraph-break")return;const{parentNode:t}=e;t.insertBefore(e.ownerDocument.createElement("br"),e),t.insertBefore(e.ownerDocument.createElement("br"),e),t.removeChild(e)}const Qie=(...e)=>window?.console?.log?.(...e);function OX(e){return e=tf(e,[Hie,Kie,Uie,Vie,Fie]),e=AE(e,k5("paste"),{inline:!0}),e=tf(e,[Yie,Zie]),Qie(`Processed inline HTML: +`||e===" "}function Yie(e){if(e.nodeType!==e.TEXT_NODE)return;let t=e;for(;t=t.parentNode;)if(t.nodeType===t.ELEMENT_NODE&&t.nodeName==="PRE")return;let n=e.data.replace(/[ \r\n\t]+/g," ");if(n[0]===" "){const o=Z4(e,"previous");(!o||o.nodeName==="BR"||o.textContent.slice(-1)===" ")&&(n=n.slice(1))}if(n[n.length-1]===" "){const o=Z4(e,"next");(!o||o.nodeName==="BR"||o.nodeType===o.TEXT_NODE&&b7e(o.textContent[0]))&&(n=n.slice(0,-1))}n?e.data=n:e.parentNode.removeChild(e)}function Zie(e){e.nodeName==="BR"&&(Z4(e,"next")||e.parentNode.removeChild(e))}function h7e(e){e.nodeName==="P"&&(e.hasChildNodes()||e.parentNode.removeChild(e))}function m7e(e){if(e.nodeName!=="SPAN"||e.getAttribute("data-stringify-type")!=="paragraph-break")return;const{parentNode:t}=e;t.insertBefore(e.ownerDocument.createElement("br"),e),t.insertBefore(e.ownerDocument.createElement("br"),e),t.removeChild(e)}const Qie=(...e)=>window?.console?.log?.(...e);function OX(e){return e=tf(e,[Hie,Kie,Uie,Vie,Fie]),e=zE(e,x5("paste"),{inline:!0}),e=tf(e,[Yie,Zie]),Qie(`Processed inline HTML: `,e),e}function Xh({HTML:e="",plainText:t="",mode:n="AUTO",tagName:o}){if(e=e.replace(/]+>/g,""),e=e.replace(/^\s*]*>\s*]*>(?:\s*)?/i,""),e=e.replace(/(?:\s*)?<\/body>\s*<\/html>\s*$/i,""),n!=="INLINE"){const d=e||t;if(d.indexOf("",n=e.indexOf(t);if(n>-1)e=e.substring(n+t.length);else return e;const r=e.indexOf("");return r>-1&&(e=e.substring(0,r)),e}function nwt(e){const t="";return e.startsWith(t)?e.slice(t.length):e}function T7({clipboardData:e}){let t="",n="";try{t=e.getData("text/plain"),n=e.getData("text/html")}catch{return}n=twt(n),n=nwt(n);const o=q4(e);return o.length&&!owt(o,n)?{files:o}:{html:n,plainText:t,files:[]}}function owt(e,t){if(t&&e?.length===1&&e[0].type.indexOf("image/")===0){const n=/<\s*img\b/gi;if(t.match(n)?.length!==1)return!0;const o=/<\s*img\b[^>]*\bsrc="file:\/\//i;if(t.match(o))return!0}return!1}const _me=Symbol("requiresWrapperOnCopy");function kme(e,t,n){let o=t;const[r]=t;if(r&&n.select(kt).getBlockType(r.name)[_me]){const{getBlockRootClientId:c,getBlockName:l,getBlockAttributes:u}=n.select(J),d=c(r.clientId),p=l(d);p&&(o=Ee(p,u(d),o))}const s=Ks(o);e.clipboardData.setData("text/plain",swt(s)),e.clipboardData.setData("text/html",s)}function rwt(e,t){const{plainText:n,html:o,files:r}=T7(e);let s=[];if(r.length){const i=Ei("from");s=r.reduce((c,l)=>{const u=xc(i,d=>d.type==="files"&&d.isMatch([l]));return u&&c.push(u.transform([l])),c},[]).flat()}else s=Xh({HTML:o,plainText:n,mode:"BLOCKS",canUserUseUnfilteredHTML:t});return s}function swt(e){return e=e.replace(/
/g,` +*/var Dvt=cM.exports,rQ;function Fvt(){return rQ||(rQ=1,function(e,t){(function(n,o){o(e,t)})(Dvt,function(n,o){var r=typeof Map=="function"?new Map:function(){var d=[],p=[];return{has:function(b){return d.indexOf(b)>-1},get:function(b){return p[d.indexOf(b)]},set:function(b,h){d.indexOf(b)===-1&&(d.push(b),p.push(h))},delete:function(b){var h=d.indexOf(b);h>-1&&(d.splice(h,1),p.splice(h,1))}}}(),s=function(p){return new Event(p,{bubbles:!0})};try{new Event("test")}catch{s=function(f){var b=document.createEvent("Event");return b.initEvent(f,!0,!1),b}}function i(d){if(!d||!d.nodeName||d.nodeName!=="TEXTAREA"||r.has(d))return;var p=null,f=null,b=null;function h(){var y=window.getComputedStyle(d,null);y.resize==="vertical"?d.style.resize="none":y.resize==="both"&&(d.style.resize="horizontal"),y.boxSizing==="content-box"?p=-(parseFloat(y.paddingTop)+parseFloat(y.paddingBottom)):p=parseFloat(y.borderTopWidth)+parseFloat(y.borderBottomWidth),isNaN(p)&&(p=0),_()}function g(y){{var k=d.style.width;d.style.width="0px",d.offsetWidth,d.style.width=k}d.style.overflowY=y}function z(y){for(var k=[];y&&y.parentNode&&y.parentNode instanceof Element;)y.parentNode.scrollTop&&k.push({node:y.parentNode,scrollTop:y.parentNode.scrollTop}),y=y.parentNode;return k}function A(){if(d.scrollHeight!==0){var y=z(d),k=document.documentElement&&document.documentElement.scrollTop;d.style.height="",d.style.height=d.scrollHeight+p+"px",f=d.clientWidth,y.forEach(function(S){S.node.scrollTop=S.scrollTop}),k&&(document.documentElement.scrollTop=k)}}function _(){A();var y=Math.round(parseFloat(d.style.height)),k=window.getComputedStyle(d,null),S=k.boxSizing==="content-box"?Math.round(parseFloat(k.height)):d.offsetHeight;if(S"u"||typeof window.getComputedStyle!="function"?(u=function(p){return p},u.destroy=function(d){return d},u.update=function(d){return d}):(u=function(p,f){return p&&Array.prototype.forEach.call(p.length?p:[p],function(b){return i(b)}),p},u.destroy=function(d){return d&&Array.prototype.forEach.call(d.length?d:[d],c),d},u.update=function(d){return d&&Array.prototype.forEach.call(d.length?d:[d],l),d}),o.default=u,n.exports=o.default})}(cM,cM.exports)),cM.exports}var uq,sQ;function $vt(){if(sQ)return uq;sQ=1;var e=function(t,n,o){return o=window.getComputedStyle,(o?o(t):t.currentStyle)[n.replace(/-(\w)/gi,function(r,s){return s.toUpperCase()})]};return uq=e,uq}var dq,iQ;function Vvt(){if(iQ)return dq;iQ=1;var e=$vt();function t(n){var o=e(n,"line-height"),r=parseFloat(o,10);if(o===r+""){var s=n.style.lineHeight;n.style.lineHeight=o+"em",o=e(n,"line-height"),r=parseFloat(o,10),s?n.style.lineHeight=s:delete n.style.lineHeight}if(o.indexOf("pt")!==-1?(r*=4,r/=3):o.indexOf("mm")!==-1?(r*=96,r/=25.4):o.indexOf("cm")!==-1?(r*=96,r/=2.54):o.indexOf("in")!==-1?r*=96:o.indexOf("pc")!==-1&&(r*=16),r=Math.round(r),o==="normal"){var i=n.nodeName,c=document.createElement(i);c.innerHTML=" ",i.toUpperCase()==="TEXTAREA"&&c.setAttribute("rows","1");var l=e(n,"font-size");c.style.fontSize=l,c.style.padding="0px",c.style.border="0px";var u=document.body;u.appendChild(c);var d=c.offsetHeight;r=d,u.removeChild(c)}return r}return dq=t,dq}var aQ;function Hvt(){if(aQ)return ja;aQ=1;var e=ja&&ja.__extends||function(){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,f){p.__proto__=f}||function(p,f){for(var b in f)f.hasOwnProperty(b)&&(p[b]=f[b])};return function(p,f){d(p,f);function b(){this.constructor=p}p.prototype=f===null?Object.create(f):(b.prototype=f.prototype,new b)}}(),t=ja&&ja.__assign||Object.assign||function(d){for(var p,f=1,b=arguments.length;fi(J).getBlock(e),[e]),{updateBlock:r}=Oe(J),s=()=>{const i=on(o.name);if(!i)return;const c=Wl(i,t,o.attributes),l=t||Gf(i,c),[u]=t?tz({...o,attributes:c,originalContent:l}):[!0];r(e,{attributes:c,originalContent:l,isValid:u}),t||n(l)};return x.useEffect(()=>{n(Y5(o))},[o]),a.jsx(b7,{className:"block-editor-block-list__block-html-textarea",value:t,onBlur:s,onChange:i=>n(i.target.value)})}var h7=wO(),kn=e=>xO(e,h7),m7=wO();kn.write=e=>xO(e,m7);var A_=wO();kn.onStart=e=>xO(e,A_);var g7=wO();kn.onFrame=e=>xO(e,g7);var M7=wO();kn.onFinish=e=>xO(e,M7);var F2=[];kn.setTimeout=(e,t)=>{const n=kn.now()+t,o=()=>{const s=F2.findIndex(i=>i.cancel==o);~s&&F2.splice(s,1),od-=~s?1:0},r={time:n,handler:e,cancel:o};return F2.splice(Ehe(n),0,r),od+=1,Whe(),r};var Ehe=e=>~(~F2.findIndex(t=>t.time>e)||~F2.length);kn.cancel=e=>{A_.delete(e),g7.delete(e),M7.delete(e),h7.delete(e),m7.delete(e)};kn.sync=e=>{vW=!0,kn.batchedUpdates(e),vW=!1};kn.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...r){t=r,kn.onStart(n)}return o.handler=e,o.cancel=()=>{A_.delete(n),t=null},o};var z7=typeof window<"u"?window.requestAnimationFrame:()=>{};kn.use=e=>z7=e;kn.now=typeof performance<"u"?()=>performance.now():Date.now;kn.batchedUpdates=e=>e();kn.catch=console.error;kn.frameLoop="always";kn.advance=()=>{kn.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Bhe()};var nd=-1,od=0,vW=!1;function xO(e,t){vW?(t.delete(e),e(0)):(t.add(e),Whe())}function Whe(){nd<0&&(nd=0,kn.frameLoop!=="demand"&&z7(Nhe))}function Kvt(){nd=-1}function Nhe(){~nd&&(z7(Nhe),kn.batchedUpdates(Bhe))}function Bhe(){const e=nd;nd=kn.now();const t=Ehe(nd);if(t&&(Lhe(F2.splice(0,t),n=>n.handler()),od-=t),!od){Kvt();return}A_.flush(),h7.flush(e?Math.min(64,nd-e):16.667),g7.flush(),m7.flush(),M7.flush()}function wO(){let e=new Set,t=e;return{add(n){od+=t==e&&!e.has(n)?1:0,e.add(n)},delete(n){return od-=t==e&&e.has(n)?1:0,e.delete(n)},flush(n){t.size&&(e=new Set,od-=t.size,Lhe(t,o=>o(n)&&e.add(o)),od+=e.size,t=e)}}}function Lhe(e,t){e.forEach(n=>{try{t(n)}catch(o){kn.catch(o)}})}var Yvt=Object.defineProperty,Zvt=(e,t)=>{for(var n in t)Yvt(e,n,{get:t[n],enumerable:!0})},Oa={};Zvt(Oa,{assign:()=>Jvt,colors:()=>dd,createStringInterpolator:()=>y7,skipAnimation:()=>jhe,to:()=>Phe,willAdvance:()=>A7});function xW(){}var Qvt=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),_t={arr:Array.isArray,obj:e=>!!e&&e.constructor.name==="Object",fun:e=>typeof e=="function",str:e=>typeof e=="string",num:e=>typeof e=="number",und:e=>e===void 0};function al(e,t){if(_t.arr(e)){if(!_t.arr(t)||e.length!==t.length)return!1;for(let n=0;ne.forEach(t);function Dl(e,t,n){if(_t.arr(e)){for(let o=0;o_t.und(e)?[]:_t.arr(e)?e:[e];function EM(e,t){if(e.size){const n=Array.from(e);e.clear(),Cr(n,t)}}var lM=(e,...t)=>EM(e,n=>n(...t)),O7=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),y7,Phe,dd=null,jhe=!1,A7=xW,Jvt=e=>{e.to&&(Phe=e.to),e.now&&(kn.now=e.now),e.colors!==void 0&&(dd=e.colors),e.skipAnimation!=null&&(jhe=e.skipAnimation),e.createStringInterpolator&&(y7=e.createStringInterpolator),e.requestAnimationFrame&&kn.use(e.requestAnimationFrame),e.batchedUpdates&&(kn.batchedUpdates=e.batchedUpdates),e.willAdvance&&(A7=e.willAdvance),e.frameLoop&&(kn.frameLoop=e.frameLoop)},WM=new Set,vi=[],pq=[],Wx=0,v_={get idle(){return!WM.size&&!vi.length},start(e){Wx>e.priority?(WM.add(e),kn.onStart(e4t)):(Ihe(e),kn(wW))},advance:wW,sort(e){if(Wx)kn.onFrame(()=>v_.sort(e));else{const t=vi.indexOf(e);~t&&(vi.splice(t,1),Dhe(e))}},clear(){vi=[],WM.clear()}};function e4t(){WM.forEach(Ihe),WM.clear(),kn(wW)}function Ihe(e){vi.includes(e)||Dhe(e)}function Dhe(e){vi.splice(t4t(vi,t=>t.priority>e.priority),0,e)}function wW(e){const t=pq;for(let n=0;n0}function t4t(e,t){const n=e.findIndex(t);return n<0?e.length:n}var n4t=(e,t,n)=>Math.min(Math.max(n,e),t),o4t={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},ia="[-+]?\\d*\\.?\\d+",Nx=ia+"%";function x_(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var r4t=new RegExp("rgb"+x_(ia,ia,ia)),s4t=new RegExp("rgba"+x_(ia,ia,ia,ia)),i4t=new RegExp("hsl"+x_(ia,Nx,Nx)),a4t=new RegExp("hsla"+x_(ia,Nx,Nx,ia)),c4t=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,l4t=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,u4t=/^#([0-9a-fA-F]{6})$/,d4t=/^#([0-9a-fA-F]{8})$/;function p4t(e){let t;return typeof e=="number"?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=u4t.exec(e))?parseInt(t[1]+"ff",16)>>>0:dd&&dd[e]!==void 0?dd[e]:(t=r4t.exec(e))?(Yb(t[1])<<24|Yb(t[2])<<16|Yb(t[3])<<8|255)>>>0:(t=s4t.exec(e))?(Yb(t[1])<<24|Yb(t[2])<<16|Yb(t[3])<<8|dQ(t[4]))>>>0:(t=c4t.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=d4t.exec(e))?parseInt(t[1],16)>>>0:(t=l4t.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=i4t.exec(e))?(lQ(uQ(t[1]),YA(t[2]),YA(t[3]))|255)>>>0:(t=a4t.exec(e))?(lQ(uQ(t[1]),YA(t[2]),YA(t[3]))|dQ(t[4]))>>>0:null}function fq(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function lQ(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,s=fq(r,o,e+1/3),i=fq(r,o,e),c=fq(r,o,e-1/3);return Math.round(s*255)<<24|Math.round(i*255)<<16|Math.round(c*255)<<8}function Yb(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function uQ(e){return(parseFloat(e)%360+360)%360/360}function dQ(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function YA(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function pQ(e){let t=p4t(e);if(t===null)return e;t=t||0;const n=(t&4278190080)>>>24,o=(t&16711680)>>>16,r=(t&65280)>>>8,s=(t&255)/255;return`rgba(${n}, ${o}, ${r}, ${s})`}var Fz=(e,t,n)=>{if(_t.fun(e))return e;if(_t.arr(e))return Fz({range:e,output:t,extrapolate:n});if(_t.str(e.output[0]))return y7(e);const o=e,r=o.output,s=o.range||[0,1],i=o.extrapolateLeft||o.extrapolate||"extend",c=o.extrapolateRight||o.extrapolate||"extend",l=o.easing||(u=>u);return u=>{const d=b4t(u,s);return f4t(u,s[d],s[d+1],r[d],r[d+1],l,i,c,o.map)}};function f4t(e,t,n,o,r,s,i,c,l){let u=l?l(e):e;if(un){if(c==="identity")return u;c==="clamp"&&(u=n)}return o===r?o:t===n?e<=t?o:r:(t===-1/0?u=-u:n===1/0?u=u-t:u=(u-t)/(n-t),u=s(u),o===-1/0?u=-u:r===1/0?u=u+o:u=u*(r-o)+o,u)}function b4t(e,t){for(var n=1;n=e);++n);return n-1}var h4t=(e,t="end")=>n=>{n=t==="end"?Math.min(n,.999):Math.max(n,.001);const o=n*e,r=t==="end"?Math.floor(o):Math.ceil(o);return n4t(0,1,r/e)},Bx=1.70158,ZA=Bx*1.525,fQ=Bx+1,bQ=2*Math.PI/3,hQ=2*Math.PI/4.5,QA=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,m4t={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=>e===0?0:Math.pow(2,10*e-10),easeOutExpo:e=>e===1?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>e===0?0:e===1?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=>fQ*e*e*e-Bx*e*e,easeOutBack:e=>1+fQ*Math.pow(e-1,3)+Bx*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*((ZA+1)*2*e-ZA)/2:(Math.pow(2*e-2,2)*((ZA+1)*(e*2-2)+ZA)+2)/2,easeInElastic:e=>e===0?0:e===1?1:-Math.pow(2,10*e-10)*Math.sin((e*10-10.75)*bQ),easeOutElastic:e=>e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e*10-.75)*bQ)+1,easeInOutElastic:e=>e===0?0:e===1?1:e<.5?-(Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*hQ))/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*hQ)/2+1,easeInBounce:e=>1-QA(1-e),easeOutBounce:QA,easeInOutBounce:e=>e<.5?(1-QA(1-2*e))/2:(1+QA(2*e-1))/2,steps:h4t},$z=Symbol.for("FluidValue.get"),wh=Symbol.for("FluidValue.observers"),zi=e=>!!(e&&e[$z]),as=e=>e&&e[$z]?e[$z]():e,mQ=e=>e[wh]||null;function g4t(e,t){e.eventObserved?e.eventObserved(t):e(t)}function Vz(e,t){const n=e[wh];n&&n.forEach(o=>{g4t(o,t)})}var Fhe=class{constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");M4t(this,e)}},M4t=(e,t)=>$he(e,$z,t);function _O(e,t){if(e[$z]){let n=e[wh];n||$he(e,wh,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Hz(e,t){const n=e[wh];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[wh]=null,e.observerRemoved&&e.observerRemoved(o,t)}}var $he=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),f4=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,z4t=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,gQ=new RegExp(`(${f4.source})(%|[a-z]+)`,"i"),O4t=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,w_=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,Vhe=e=>{const[t,n]=y4t(e);if(!t||O7())return e;const o=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(o)return o.trim();if(n&&n.startsWith("--")){const r=window.getComputedStyle(document.documentElement).getPropertyValue(n);return r||e}else{if(n&&w_.test(n))return Vhe(n);if(n)return n}return e},y4t=e=>{const t=w_.exec(e);if(!t)return[,];const[,n,o]=t;return[n,o]},bq,A4t=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,Hhe=e=>{bq||(bq=dd?new RegExp(`(${Object.keys(dd).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map(s=>as(s).replace(w_,Vhe).replace(z4t,pQ).replace(bq,pQ)),n=t.map(s=>s.match(f4).map(Number)),r=n[0].map((s,i)=>n.map(c=>{if(!(i in c))throw Error('The arity of each "output" value must be equal');return c[i]})).map(s=>Fz({...e,output:s}));return s=>{const i=!gQ.test(t[0])&&t.find(l=>gQ.test(l))?.replace(f4,"");let c=0;return t[0].replace(f4,()=>`${r[c++](s)}${i||""}`).replace(O4t,A4t)}},Uhe="react-spring: ",Xhe=e=>{const t=e;let n=!1;if(typeof t!="function")throw new TypeError(`${Uhe}once requires a function parameter`);return(...o)=>{n||(t(...o),n=!0)}},v4t=Xhe(console.warn);function x4t(){v4t(`${Uhe}The "interpolate" function is deprecated in v9 (use "to" instead)`)}Xhe(console.warn);function __(e){return _t.str(e)&&(e[0]=="#"||/\d/.test(e)||!O7()&&w_.test(e)||e in(dd||{}))}var Ghe=O7()?x.useEffect:x.useLayoutEffect,w4t=()=>{const e=x.useRef(!1);return Ghe(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function _4t(){const e=x.useState()[1],t=w4t();return()=>{t.current&&e(Math.random())}}function k4t(e,t){const[n]=x.useState(()=>({inputs:t,result:e()})),o=x.useRef(),r=o.current;let s=r;return s?t&&s.inputs&&S4t(t,s.inputs)||(s={inputs:t,result:e()}):s=n,x.useEffect(()=>{o.current=s,r==n&&(n.inputs=n.result=void 0)},[s]),s.result}function S4t(e,t){if(e.length!==t.length)return!1;for(let n=0;nx.useEffect(e,q4t),q4t=[],Uz=Symbol.for("Animated:node"),R4t=e=>!!e&&e[Uz]===e,ec=e=>e&&e[Uz],v7=(e,t)=>Qvt(e,Uz,t),k_=e=>e&&e[Uz]&&e[Uz].getPayload(),Khe=class{constructor(){v7(this,this)}getPayload(){return this.payload||[]}},kO=class extends Khe{constructor(e){super(),this._value=e,this.done=!0,this.durationProgress=0,_t.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new kO(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return _t.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value===e?!1:(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,_t.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},Xz=class extends kO{constructor(e){super(0),this._string=null,this._toString=Fz({output:[e,e]})}static create(e){return new Xz(e)}getValue(){const e=this._string;return e??(this._string=this._toString(this._value))}setValue(e){if(_t.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else if(super.setValue(e))this._string=null;else return!1;return!0}reset(e){e&&(this._toString=Fz({output:[this.getValue(),e]})),this._value=0,super.reset()}},Lx={dependencies:null},S_=class extends Khe{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return Dl(this.source,(n,o)=>{R4t(n)?t[o]=n.getValue(e):zi(n)?t[o]=as(n):e||(t[o]=n)}),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Cr(this.payload,e=>e.reset())}_makePayload(e){if(e){const t=new Set;return Dl(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Lx.dependencies&&zi(e)&&Lx.dependencies.add(e);const t=k_(e);t&&Cr(t,n=>this.add(n))}},Yhe=class extends S_{constructor(e){super(e)}static create(e){return new Yhe(e)}getValue(){return this.source.map(e=>e.getValue())}setValue(e){const t=this.getPayload();return e.length==t.length?t.map((n,o)=>n.setValue(e[o])).some(Boolean):(super.setValue(e.map(T4t)),!0)}};function T4t(e){return(__(e)?Xz:kO).create(e)}function _W(e){const t=ec(e);return t?t.constructor:_t.arr(e)?Yhe:__(e)?Xz:kO}var MQ=(e,t)=>{const n=!_t.fun(e)||e.prototype&&e.prototype.isReactComponent;return x.forwardRef((o,r)=>{const s=x.useRef(null),i=n&&x.useCallback(h=>{s.current=N4t(r,h)},[r]),[c,l]=W4t(o,t),u=_4t(),d=()=>{const h=s.current;if(n&&!h)return;(h?t.applyAnimatedValues(h,c.getValue(!0)):!1)===!1&&u()},p=new E4t(d,l),f=x.useRef();Ghe(()=>(f.current=p,Cr(l,h=>_O(h,p)),()=>{f.current&&(Cr(f.current.deps,h=>Hz(h,f.current)),kn.cancel(f.current.update))})),x.useEffect(d,[]),C4t(()=>()=>{const h=f.current;Cr(h.deps,g=>Hz(g,h))});const b=t.getComponentProps(c.getValue());return x.createElement(e,{...b,ref:i})})},E4t=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){e.type=="change"&&kn.write(this.update)}};function W4t(e,t){const n=new Set;return Lx.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new S_(e),Lx.dependencies=null,[e,n]}function N4t(e,t){return e&&(_t.fun(e)?e(t):e.current=t),t}var zQ=Symbol.for("AnimatedComponent"),B4t=(e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:n=r=>new S_(r),getComponentProps:o=r=>r}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},s=i=>{const c=OQ(i)||"Anonymous";return _t.str(i)?i=s[i]||(s[i]=MQ(i,r)):i=i[zQ]||(i[zQ]=MQ(i,r)),i.displayName=`Animated(${c})`,i};return Dl(e,(i,c)=>{_t.arr(e)&&(c=OQ(i)),s[c]=s(i)}),{animated:s}},OQ=e=>_t.str(e)?e:e&&_t.str(e.displayName)?e.displayName:_t.fun(e)&&e.name||null;function Hp(e,...t){return _t.fun(e)?e(...t):e}var NM=(e,t)=>e===!0||!!(t&&e&&(_t.fun(e)?e(t):Ci(e).includes(t))),Zhe=(e,t)=>_t.obj(e)?t&&e[t]:e,Qhe=(e,t)=>e.default===!0?e[t]:e.default?e.default[t]:void 0,L4t=e=>e,Jhe=(e,t=L4t)=>{let n=P4t;e.default&&e.default!==!0&&(e=e.default,n=Object.keys(e));const o={};for(const r of n){const s=t(e[r],r);_t.und(s)||(o[r]=s)}return o},P4t=["config","onProps","onStart","onChange","onPause","onResume","onRest"],j4t={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 I4t(e){const t={};let n=0;if(Dl(e,(o,r)=>{j4t[r]||(t[r]=o,n++)}),n)return t}function eme(e){const t=I4t(e);if(t){const n={to:t};return Dl(e,(o,r)=>r in t||(n[r]=o)),n}return{...e}}function Gz(e){return e=as(e),_t.arr(e)?e.map(Gz):__(e)?Oa.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function kW(e){return _t.fun(e)||_t.arr(e)&&_t.obj(e[0])}var D4t={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},SW={...D4t.default,mass:1,damping:1,easing:m4t.linear,clamp:!1},F4t=class{constructor(){this.velocity=0,Object.assign(this,SW)}};function $4t(e,t,n){n&&(n={...n},yQ(n,t),t={...n,...t}),yQ(e,t),Object.assign(e,t);for(const i in SW)e[i]==null&&(e[i]=SW[i]);let{frequency:o,damping:r}=e;const{mass:s}=e;return _t.und(o)||(o<.01&&(o=.01),r<0&&(r=0),e.tension=Math.pow(2*Math.PI/o,2)*s,e.friction=4*Math.PI*r*s/o),e}function yQ(e,t){if(!_t.und(t.decay))e.duration=void 0;else{const n=!_t.und(t.tension)||!_t.und(t.friction);(n||!_t.und(t.frequency)||!_t.und(t.damping)||!_t.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}}var AQ=[],V4t=class{constructor(){this.changed=!1,this.values=AQ,this.toValues=null,this.fromValues=AQ,this.config=new F4t,this.immediate=!1}};function tme(e,{key:t,props:n,defaultProps:o,state:r,actions:s}){return new Promise((i,c)=>{let l,u,d=NM(n.cancel??o?.cancel,t);if(d)b();else{_t.und(n.pause)||(r.paused=NM(n.pause,t));let h=o?.pause;h!==!0&&(h=r.paused||NM(h,t)),l=Hp(n.delay||0,t),h?(r.resumeQueue.add(f),s.pause()):(s.resume(),f())}function p(){r.resumeQueue.add(f),r.timeouts.delete(u),u.cancel(),l=u.time-kn.now()}function f(){l>0&&!Oa.skipAnimation?(r.delayed=!0,u=kn.setTimeout(b,l),r.pauseQueue.add(p),r.timeouts.add(u)):b()}function b(){r.delayed&&(r.delayed=!1),r.pauseQueue.delete(p),r.timeouts.delete(u),e<=(r.cancelId||0)&&(d=!0);try{s.start({...n,callId:e,cancel:d},i)}catch(h){c(h)}}})}var x7=(e,t)=>t.length==1?t[0]:t.some(n=>n.cancelled)?$2(e.get()):t.every(n=>n.noop)?nme(e.get()):na(e.get(),t.every(n=>n.finished)),nme=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),na=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),$2=e=>({value:e,cancelled:!0,finished:!1});function ome(e,t,n,o){const{callId:r,parentId:s,onRest:i}=t,{asyncTo:c,promise:l}=n;return!s&&e===c&&!t.reset?l:n.promise=(async()=>{n.asyncId=r,n.asyncTo=e;const u=Jhe(t,(z,A)=>A==="onRest"?void 0:z);let d,p;const f=new Promise((z,A)=>(d=z,p=A)),b=z=>{const A=r<=(n.cancelId||0)&&$2(o)||r!==n.asyncId&&na(o,!1);if(A)throw z.result=A,p(z),z},h=(z,A)=>{const _=new vQ,v=new xQ;return(async()=>{if(Oa.skipAnimation)throw Kz(n),v.result=na(o,!1),p(v),v;b(_);const M=_t.obj(z)?{...z}:{...A,to:z};M.parentId=r,Dl(u,(k,S)=>{_t.und(M[S])&&(M[S]=k)});const y=await o.start(M);return b(_),n.paused&&await new Promise(k=>{n.resumeQueue.add(k)}),y})()};let g;if(Oa.skipAnimation)return Kz(n),na(o,!1);try{let z;_t.arr(e)?z=(async A=>{for(const _ of A)await h(_)})(e):z=Promise.resolve(e(h,o.stop.bind(o))),await Promise.all([z.then(d),f]),g=na(o.get(),!0,!1)}catch(z){if(z instanceof vQ)g=z.result;else if(z instanceof xQ)g=z.result;else throw z}finally{r==n.asyncId&&(n.asyncId=s,n.asyncTo=s?c:void 0,n.promise=s?l:void 0)}return _t.fun(i)&&kn.batchedUpdates(()=>{i(g,o,o.item)}),g})()}function Kz(e,t){EM(e.timeouts,n=>n.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var vQ=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.")}},xQ=class extends Error{constructor(){super("SkipAnimationSignal")}},CW=e=>e instanceof w7,H4t=1,w7=class extends Fhe{constructor(){super(...arguments),this.id=H4t++,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=ec(this);return e&&e.getValue()}to(...e){return Oa.to(this,e)}interpolate(...e){return x4t(),Oa.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){Vz(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||v_.sort(this),Vz(this,{type:"priority",parent:this,priority:e})}},Tf=Symbol.for("SpringPhase"),rme=1,qW=2,RW=4,hq=e=>(e[Tf]&rme)>0,Nu=e=>(e[Tf]&qW)>0,Pg=e=>(e[Tf]&RW)>0,wQ=(e,t)=>t?e[Tf]|=qW|rme:e[Tf]&=~qW,_Q=(e,t)=>t?e[Tf]|=RW:e[Tf]&=~RW,U4t=class extends w7{constructor(e,t){if(super(),this.animation=new V4t,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,!_t.und(e)||!_t.und(t)){const n=_t.obj(e)?{...e}:{...t,from:e};_t.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(Nu(this)||this._state.asyncTo)||Pg(this)}get goal(){return as(this.animation.to)}get velocity(){const e=ec(this);return e instanceof kO?e.lastVelocity||0:e.getPayload().map(t=>t.lastVelocity||0)}get hasAnimated(){return hq(this)}get isAnimating(){return Nu(this)}get isPaused(){return Pg(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const o=this.animation;let{toValues:r}=o;const{config:s}=o,i=k_(o.to);!i&&zi(o.to)&&(r=Ci(as(o.to))),o.values.forEach((u,d)=>{if(u.done)return;const p=u.constructor==Xz?1:i?i[d].lastPosition:r[d];let f=o.immediate,b=p;if(!f){if(b=u.lastPosition,s.tension<=0){u.done=!0;return}let h=u.elapsedTime+=e;const g=o.fromValues[d],z=u.v0!=null?u.v0:u.v0=_t.arr(s.velocity)?s.velocity[d]:s.velocity;let A;const _=s.precision||(g==p?.005:Math.min(1,Math.abs(p-g)*.001));if(_t.und(s.duration))if(s.decay){const v=s.decay===!0?.998:s.decay,M=Math.exp(-(1-v)*h);b=g+z/(1-v)*(1-M),f=Math.abs(u.lastPosition-b)<=_,A=z*M}else{A=u.lastVelocity==null?z:u.lastVelocity;const v=s.restVelocity||_/10,M=s.clamp?0:s.bounce,y=!_t.und(M),k=g==p?u.v0>0:gv,!(!S&&(f=Math.abs(p-b)<=_,f)));++E){y&&(C=b==p||b>p==k,C&&(A=-A*M,b=p));const B=-s.tension*1e-6*(b-p),N=-s.friction*.001*A,j=(B+N)/s.mass;A=A+j*R,b=b+A*R}}else{let v=1;s.duration>0&&(this._memoizedDuration!==s.duration&&(this._memoizedDuration=s.duration,u.durationProgress>0&&(u.elapsedTime=s.duration*u.durationProgress,h=u.elapsedTime+=e)),v=(s.progress||0)+h/this._memoizedDuration,v=v>1?1:v<0?0:v,u.durationProgress=v),b=g+s.easing(v)*(p-g),A=(b-u.lastPosition)/e,f=v==1}u.lastVelocity=A,Number.isNaN(b)&&(console.warn("Got NaN while animating:",this),f=!0)}i&&!i[d].done&&(f=!1),f?u.done=!0:t=!1,u.setValue(b,s.round)&&(n=!0)});const c=ec(this),l=c.getValue();if(t){const u=as(o.to);(l!==u||n)&&!s.decay?(c.setValue(u),this._onChange(u)):n&&s.decay&&this._onChange(l),this._stop()}else n&&this._onChange(l)}set(e){return kn.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Nu(this)){const{to:e,config:t}=this.animation;kn.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 _t.und(e)?(n=this.queue||[],this.queue=[]):n=[_t.obj(e)?e:{...t,to:e}],Promise.all(n.map(o=>this._update(o))).then(o=>x7(this,o))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),Kz(this._state,e&&this._lastCallId),kn.batchedUpdates(()=>this._stop(t,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type=="change"?this._start():e.type=="priority"&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:n,from:o}=e;n=_t.obj(n)?n[t]:n,(n==null||kW(n))&&(n=void 0),o=_t.obj(o)?o[t]:o,o==null&&(o=void 0);const r={to:n,from:o};return hq(this)||(e.reverse&&([n,o]=[o,n]),o=as(o),_t.und(o)?ec(this)||this._set(n):this._set(o)),r}_update({...e},t){const{key:n,defaultProps:o}=this;e.default&&Object.assign(o,Jhe(e,(i,c)=>/^on/.test(c)?Zhe(i,n):i)),SQ(this,e,"onProps"),Ig(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 s=this._state;return tme(++this._lastCallId,{key:n,props:e,defaultProps:o,state:s,actions:{pause:()=>{Pg(this)||(_Q(this,!0),lM(s.pauseQueue),Ig(this,"onPause",na(this,jg(this,this.animation.to)),this))},resume:()=>{Pg(this)&&(_Q(this,!1),Nu(this)&&this._resume(),lM(s.resumeQueue),Ig(this,"onResume",na(this,jg(this,this.animation.to)),this))},start:this._merge.bind(this,r)}}).then(i=>{if(e.loop&&i.finished&&!(t&&i.noop)){const c=sme(e);if(c)return this._update(c,!0)}return i})}_merge(e,t,n){if(t.cancel)return this.stop(!0),n($2(this));const o=!_t.und(e.to),r=!_t.und(e.from);if(o||r)if(t.callId>this._lastToId)this._lastToId=t.callId;else return n($2(this));const{key:s,defaultProps:i,animation:c}=this,{to:l,from:u}=c;let{to:d=l,from:p=u}=e;r&&!o&&(!t.default||_t.und(d))&&(d=p),t.reverse&&([d,p]=[p,d]);const f=!al(p,u);f&&(c.from=p),p=as(p);const b=!al(d,l);b&&this._focus(d);const h=kW(t.to),{config:g}=c,{decay:z,velocity:A}=g;(o||r)&&(g.velocity=0),t.config&&!h&&$4t(g,Hp(t.config,s),t.config!==i.config?Hp(i.config,s):void 0);let _=ec(this);if(!_||_t.und(d))return n(na(this,!0));const v=_t.und(t.reset)?r&&!t.default:!_t.und(p)&&NM(t.reset,s),M=v?p:this.get(),y=Gz(d),k=_t.num(y)||_t.arr(y)||__(y),S=!h&&(!k||NM(i.immediate||t.immediate,s));if(b){const E=_W(d);if(E!==_.constructor)if(S)_=this._set(y);else throw Error(`Cannot animate between ${_.constructor.name} and ${E.name}, as the "to" prop suggests`)}const C=_.constructor;let R=zi(d),T=!1;if(!R){const E=v||!hq(this)&&f;(b||E)&&(T=al(Gz(M),y),R=!T),(!al(c.immediate,S)&&!S||!al(g.decay,z)||!al(g.velocity,A))&&(R=!0)}if(T&&Nu(this)&&(c.changed&&!v?R=!0:R||this._stop(l)),!h&&((R||zi(l))&&(c.values=_.getPayload(),c.toValues=zi(d)?null:C==Xz?[1]:Ci(y)),c.immediate!=S&&(c.immediate=S,!S&&!v&&this._set(l)),R)){const{onRest:E}=c;Cr(X4t,N=>SQ(this,t,N));const B=na(this,jg(this,l));lM(this._pendingCalls,B),this._pendingCalls.add(n),c.changed&&kn.batchedUpdates(()=>{c.changed=!v,E?.(B,this),v?Hp(i.onRest,B):c.onStart?.(B,this)})}v&&this._set(M),h?n(ome(t.to,t,this._state,this)):R?this._start():Nu(this)&&!b?this._pendingCalls.add(n):n(nme(M))}_focus(e){const t=this.animation;e!==t.to&&(mQ(this)&&this._detach(),t.to=e,mQ(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;zi(t)&&(_O(t,this),CW(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;zi(e)&&Hz(e,this)}_set(e,t=!0){const n=as(e);if(!_t.und(n)){const o=ec(this);if(!o||!al(n,o.getValue())){const r=_W(n);!o||o.constructor!=r?v7(this,r.create(n)):o.setValue(n),o&&kn.batchedUpdates(()=>{this._onChange(n,t)})}}return ec(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,Ig(this,"onStart",na(this,jg(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),Hp(this.animation.onChange,e,this)),Hp(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;ec(this).reset(as(e.to)),e.immediate||(e.fromValues=e.values.map(t=>t.lastPosition)),Nu(this)||(wQ(this,!0),Pg(this)||this._resume())}_resume(){Oa.skipAnimation?this.finish():v_.start(this)}_stop(e,t){if(Nu(this)){wQ(this,!1);const n=this.animation;Cr(n.values,r=>{r.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Vz(this,{type:"idle",parent:this});const o=t?$2(this.get()):na(this.get(),jg(this,e??n.to));lM(this._pendingCalls,o),n.changed&&(n.changed=!1,Ig(this,"onRest",o,this))}}};function jg(e,t){const n=Gz(t),o=Gz(e.get());return al(o,n)}function sme(e,t=e.loop,n=e.to){const o=Hp(t);if(o){const r=o!==!0&&eme(o),s=(r||e).reverse,i=!r||r.reset;return TW({...e,loop:t,default:!1,pause:void 0,to:!s||kW(n)?n:void 0,from:i?e.from:void 0,reset:i,...r})}}function TW(e){const{to:t,from:n}=e=eme(e),o=new Set;return _t.obj(t)&&kQ(t,o),_t.obj(n)&&kQ(n,o),e.keys=o.size?Array.from(o):null,e}function kQ(e,t){Dl(e,(n,o)=>n!=null&&t.add(o))}var X4t=["onStart","onRest","onChange","onPause","onResume"];function SQ(e,t,n){e.animation[n]=t[n]!==Qhe(t,n)?Zhe(t[n],e.key):void 0}function Ig(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var G4t=["onStart","onChange","onRest"],K4t=1,Y4t=class{constructor(e,t){this.id=K4t++,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];_t.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(TW(e)),this}start(e){let{queue:t}=this;return e?t=Ci(e).map(TW):this.queue=[],this._flush?this._flush(this,t):(ame(this,t),Z4t(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Cr(Ci(t),o=>n[o].stop(!!e))}else Kz(this._state,this._lastAsyncId),this.each(n=>n.stop(!!e));return this}pause(e){if(_t.und(e))this.start({pause:!0});else{const t=this.springs;Cr(Ci(e),n=>t[n].pause())}return this}resume(e){if(_t.und(e))this.start({pause:!1});else{const t=this.springs;Cr(Ci(e),n=>t[n].resume())}return this}each(e){Dl(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,EM(e,([c,l])=>{l.value=this.get(),c(l,this,this._item)}));const s=!o&&this._started,i=r||s&&n.size?this.get():null;r&&t.size&&EM(t,([c,l])=>{l.value=i,c(l,this,this._item)}),s&&(this._started=!1,EM(n,([c,l])=>{l.value=i,c(l,this,this._item)}))}eventObserved(e){if(e.type=="change")this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type=="idle")this._active.delete(e.parent);else return;kn.onFrame(this._onFrame)}};function Z4t(e,t){return Promise.all(t.map(n=>ime(e,n))).then(n=>x7(e,n))}async function ime(e,t,n){const{keys:o,to:r,from:s,loop:i,onRest:c,onResolve:l}=t,u=_t.obj(t.default)&&t.default;i&&(t.loop=!1),r===!1&&(t.to=null),s===!1&&(t.from=null);const d=_t.arr(r)||_t.fun(r)?r:void 0;d?(t.to=void 0,t.onRest=void 0,u&&(u.onRest=void 0)):Cr(G4t,g=>{const z=t[g];if(_t.fun(z)){const A=e._events[g];t[g]=({finished:_,cancelled:v})=>{const M=A.get(z);M?(_||(M.finished=!1),v&&(M.cancelled=!0)):A.set(z,{value:null,finished:_||!1,cancelled:v||!1})},u&&(u[g]=t[g])}});const p=e._state;t.pause===!p.paused?(p.paused=t.pause,lM(t.pause?p.pauseQueue:p.resumeQueue)):p.paused&&(t.pause=!0);const f=(o||Object.keys(e.springs)).map(g=>e.springs[g].start(t)),b=t.cancel===!0||Qhe(t,"cancel")===!0;(d||b&&p.asyncId)&&f.push(tme(++e._lastAsyncId,{props:t,state:p,actions:{pause:xW,resume:xW,start(g,z){b?(Kz(p,e._lastAsyncId),z($2(e))):(g.onRest=c,z(ome(d,g,p,e)))}}})),p.paused&&await new Promise(g=>{p.resumeQueue.add(g)});const h=x7(e,await Promise.all(f));if(i&&h.finished&&!(n&&h.noop)){const g=sme(t,i,r);if(g)return ame(e,[g]),ime(e,g,!0)}return l&&kn.batchedUpdates(()=>l(h,e,e.item)),h}function Q4t(e,t){const n=new U4t;return n.key=e,t&&_O(n,t),n}function J4t(e,t,n){t.keys&&Cr(t.keys,o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)})}function ame(e,t){Cr(t,n=>{J4t(e.springs,n,o=>Q4t(o,e))})}var _7=({children:e,...t})=>{const n=x.useContext(Px),o=t.pause||!!n.pause,r=t.immediate||!!n.immediate;t=k4t(()=>({pause:o,immediate:r}),[o,r]);const{Provider:s}=Px;return x.createElement(s,{value:t},e)},Px=ext(_7,{});_7.Provider=Px.Provider;_7.Consumer=Px.Consumer;function ext(e,t){return Object.assign(e,x.createContext(t)),e.Provider._context=e,e.Consumer._context=e,e}var txt=class extends w7{constructor(e,t){super(),this.source=e,this.idle=!0,this._active=new Set,this.calc=Fz(...t);const n=this._get(),o=_W(n);v7(this,o.create(n))}advance(e){const t=this._get(),n=this.get();al(t,n)||(ec(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&CQ(this._active)&&mq(this)}_get(){const e=_t.arr(this.source)?this.source.map(as):Ci(as(this.source));return this.calc(...e)}_start(){this.idle&&!CQ(this._active)&&(this.idle=!1,Cr(k_(this),e=>{e.done=!1}),Oa.skipAnimation?(kn.batchedUpdates(()=>this.advance()),mq(this)):v_.start(this))}_attach(){let e=1;Cr(Ci(this.source),t=>{zi(t)&&_O(t,this),CW(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){Cr(Ci(this.source),e=>{zi(e)&&Hz(e,this)}),this._active.clear(),mq(this)}eventObserved(e){e.type=="change"?e.idle?this.advance():(this._active.add(e.parent),this._start()):e.type=="idle"?this._active.delete(e.parent):e.type=="priority"&&(this.priority=Ci(this.source).reduce((t,n)=>Math.max(t,(CW(n)?n.priority:0)+1),0))}};function nxt(e){return e.idle!==!1}function CQ(e){return!e.size||Array.from(e).every(nxt)}function mq(e){e.idle||(e.idle=!0,Cr(k_(e),t=>{t.done=!0}),Vz(e,{type:"idle",parent:e}))}Oa.assign({createStringInterpolator:Hhe,to:(e,t)=>new txt(e,t)});var cme=/^--/;function oxt(e,t){return t==null||typeof t=="boolean"||t===""?"":typeof t=="number"&&t!==0&&!cme.test(e)&&!(BM.hasOwnProperty(e)&&BM[e])?t+"px":(""+t).trim()}var qQ={};function rxt(e,t){if(!e.nodeType||!e.setAttribute)return!1;const n=e.nodeName==="filter"||e.parentNode&&e.parentNode.nodeName==="filter",{className:o,style:r,children:s,scrollTop:i,scrollLeft:c,viewBox:l,...u}=t,d=Object.values(u),p=Object.keys(u).map(f=>n||e.hasAttribute(f)?f:qQ[f]||(qQ[f]=f.replace(/([A-Z])/g,b=>"-"+b.toLowerCase())));s!==void 0&&(e.textContent=s);for(const f in r)if(r.hasOwnProperty(f)){const b=oxt(f,r[f]);cme.test(f)?e.style.setProperty(f,b):e.style[f]=b}p.forEach((f,b)=>{e.setAttribute(f,d[b])}),o!==void 0&&(e.className=o),i!==void 0&&(e.scrollTop=i),c!==void 0&&(e.scrollLeft=c),l!==void 0&&e.setAttribute("viewBox",l)}var BM={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},sxt=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1),ixt=["Webkit","Ms","Moz","O"];BM=Object.keys(BM).reduce((e,t)=>(ixt.forEach(n=>e[sxt(n,t)]=e[t]),e),BM);var axt=/^(matrix|translate|scale|rotate|skew)/,cxt=/^(translate)/,lxt=/^(rotate|skew)/,gq=(e,t)=>_t.num(e)&&e!==0?e+t:e,b4=(e,t)=>_t.arr(e)?e.every(n=>b4(n,t)):_t.num(e)?e===t:parseFloat(e)===t,uxt=class extends S_{constructor({x:e,y:t,z:n,...o}){const r=[],s=[];(e||t||n)&&(r.push([e||0,t||0,n||0]),s.push(i=>[`translate3d(${i.map(c=>gq(c,"px")).join(",")})`,b4(i,0)])),Dl(o,(i,c)=>{if(c==="transform")r.push([i||""]),s.push(l=>[l,l===""]);else if(axt.test(c)){if(delete o[c],_t.und(i))return;const l=cxt.test(c)?"px":lxt.test(c)?"deg":"";r.push(Ci(i)),s.push(c==="rotate3d"?([u,d,p,f])=>[`rotate3d(${u},${d},${p},${gq(f,l)})`,b4(f,0)]:u=>[`${c}(${u.map(d=>gq(d,l)).join(",")})`,b4(u,c.startsWith("scale")?1:0)])}}),r.length&&(o.transform=new dxt(r,s)),super(o)}},dxt=class extends Fhe{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 Cr(this.inputs,(n,o)=>{const r=as(n[0]),[s,i]=this.transforms[o](_t.arr(r)?r:n.map(as));e+=" "+s,t=t&&i}),t?"none":e}observerAdded(e){e==1&&Cr(this.inputs,t=>Cr(t,n=>zi(n)&&_O(n,this)))}observerRemoved(e){e==0&&Cr(this.inputs,t=>Cr(t,n=>zi(n)&&Hz(n,this)))}eventObserved(e){e.type=="change"&&(this._value=null),Vz(this,e)}},pxt=["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"];Oa.assign({batchedUpdates:hs.unstable_batchedUpdates,createStringInterpolator:Hhe,colors:o4t});var fxt=B4t(pxt,{applyAnimatedValues:rxt,createAnimatedStyle:e=>new uxt(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),bxt=fxt.animated;const hxt=200;function RQ(e){return{top:e.offsetTop,left:e.offsetLeft}}function lme({triggerAnimationOnChange:e,clientId:t}){const n=x.useRef(),{isTyping:o,getGlobalBlockCount:r,isBlockSelected:s,isFirstMultiSelectedBlock:i,isBlockMultiSelected:c,isAncestorMultiSelected:l,isDraggingBlocks:u}=G(J),{previous:d,prevRect:p}=x.useMemo(()=>({previous:n.current&&RQ(n.current),prevRect:n.current&&n.current.getBoundingClientRect()}),[e]);return x.useLayoutEffect(()=>{if(!d||!n.current)return;const f=ps(n.current),b=s(t),h=b||i(t),g=u();function z(){if(!g&&h&&p){const R=n.current.getBoundingClientRect().top-p.top;R&&(f.scrollTop+=R)}}if(window.matchMedia("(prefers-reduced-motion: reduce)").matches||o()||r()>hxt){z();return}const _=b||c(t)||l(t);if(_&&g)return;const v=_?"1":"",M=new Y4t({x:0,y:0,config:{mass:5,tension:2e3,friction:200},onChange({value:C}){if(!n.current)return;let{x:R,y:T}=C;R=Math.round(R),T=Math.round(T);const E=R===0&&T===0;n.current.style.transformOrigin="center center",n.current.style.transform=E?null:`translate3d(${R}px,${T}px,0)`,n.current.style.zIndex=v,z()}});n.current.style.transform=void 0;const y=RQ(n.current),k=Math.round(d.left-y.left),S=Math.round(d.top-y.top);return M.start({x:0,y:0,from:{x:k,y:S}}),()=>{M.stop(),M.set({x:0,y:0})}},[d,p,t,o,r,s,i,c,l,u]),n}const jx=".block-editor-block-list__block",mxt=".block-list-appender",gxt=".block-editor-button-block-appender";function ume(e,t){return e.closest(jx)===t.closest(jx)}function LM(e,t){return t.closest([jx,mxt,gxt].join(","))===e}function PM(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const n=e.closest(jx);if(n)return n.id.slice(6)}function dme(e,t){const n=Math.min(e.left,t.left),o=Math.max(e.right,t.right),r=Math.max(e.bottom,t.bottom),s=Math.min(e.top,t.top);return new window.DOMRectReadOnly(n,s,o-n,r-s)}function Mxt(e){const t=e.ownerDocument.defaultView;if(!t||e.classList.contains("components-visually-hidden"))return!1;const n=e.getBoundingClientRect();if(n.width===0||n.height===0)return!1;if(e.checkVisibility)return e.checkVisibility?.({opacityProperty:!0,contentVisibilityAuto:!0,visibilityProperty:!0});const o=t.getComputedStyle(e);return!(o.display==="none"||o.visibility==="hidden"||o.opacity==="0")}function zxt(e){const t=window.getComputedStyle(e);return t.overflowX==="auto"||t.overflowX==="scroll"||t.overflowY==="auto"||t.overflowY==="scroll"}const Oxt=["core/navigation"];function h4(e){const t=e.ownerDocument.defaultView;if(!t)return new window.DOMRectReadOnly;let n=e.getBoundingClientRect();const o=e.getAttribute("data-type");if(o&&Oxt.includes(o)){const i=[e];let c;for(;c=i.pop();)if(!zxt(c)){for(const l of c.children)if(Mxt(l)){const u=l.getBoundingClientRect();n=dme(n,u),i.push(l)}}}const r=Math.max(n.left,0),s=Math.min(n.right,t.innerWidth);return n=new window.DOMRectReadOnly(r,n.top,s-r,n.height),n}function yxt({clientId:e,initialPosition:t}){const n=x.useRef(),{isBlockSelected:o,isMultiSelecting:r,isZoomOut:s}=ct(G(J));return x.useEffect(()=>{if(!o(e)||r()||s()||t==null||!n.current)return;const{ownerDocument:i}=n.current;if(LM(n.current,i.activeElement))return;const c=Xr.tabbable.find(n.current).filter(d=>md(d)),l=t===-1,u=c[l?c.length-1:0]||n.current;if(!LM(n.current,u)){n.current.focus();return}if(!n.current.getAttribute("contenteditable")){const d=Xr.tabbable.findNext(n.current);if(d&&LM(n.current,d)&&Qre(d)){d.focus();return}}r0e(u,l)},[t,e]),n}function Axt({clientId:e}){const{hoverBlock:t}=Oe(J);function n(o){if(o.defaultPrevented)return;const r=o.type==="mouseover"?"add":"remove";o.preventDefault(),o.currentTarget.classList[r]("is-hovered"),t(r==="add"?e:null)}return Mn(o=>(o.addEventListener("mouseout",n),o.addEventListener("mouseover",n),()=>{o.removeEventListener("mouseout",n),o.removeEventListener("mouseover",n),o.classList.remove("is-hovered"),t(null)}),[])}function vxt(e){const{isBlockSelected:t}=G(J),{selectBlock:n,selectionChange:o}=Oe(J);return Mn(r=>{function s(i){if(!r.parentElement.closest('[contenteditable="true"]')){if(t(e)){i.target.isContentEditable||o(e);return}LM(r,i.target)&&n(e)}}return r.addEventListener("focusin",s),()=>{r.removeEventListener("focusin",s)}},[t,n])}function k7({count:e,icon:t,isPattern:n,fadeWhenDisabled:o}){const r=n&&m("Pattern");return a.jsx("div",{className:"block-editor-block-draggable-chip-wrapper",children:a.jsx("div",{className:"block-editor-block-draggable-chip","data-testid":"block-draggable-chip",children:a.jsxs(Yo,{justify:"center",className:"block-editor-block-draggable-chip__content",children:[a.jsx(Tn,{children:t?a.jsx(Zn,{icon:t}):r||xe(Dn("%d block","%d blocks",e),e)}),a.jsx(Tn,{children:a.jsx(Zn,{icon:Jue})}),o&&a.jsx(Tn,{className:"block-editor-block-draggable-chip__disabled",children:a.jsx("span",{className:"block-editor-block-draggable-chip__disabled-icon"})})]})})})}function xxt({clientId:e,isSelected:t}){const{getBlockType:n}=G(kt),{getBlockRootClientId:o,isZoomOut:r,hasMultiSelection:s,getBlockName:i}=ct(G(J)),{insertAfterBlock:c,removeBlock:l,resetZoomLevel:u,startDraggingBlocks:d,stopDraggingBlocks:p}=ct(Oe(J));return Mn(f=>{if(!t)return;function b(g){const{keyCode:z,target:A}=g;z!==Gr&&z!==Mc&&z!==zl||A!==f||md(A)||(g.preventDefault(),z===Gr&&r()?u():z===Gr?c(e):l(e))}function h(g){if(f!==g.target||f.isContentEditable||f.ownerDocument.activeElement!==f||s()){g.preventDefault();return}const z=JSON.stringify({type:"block",srcClientIds:[e],srcRootClientId:o(e)});g.dataTransfer.effectAllowed="move",g.dataTransfer.clearData(),g.dataTransfer.setData("wp-blocks",z);const{ownerDocument:A}=f,{defaultView:_}=A;_.getSelection().removeAllRanges();const M=document.createElement("div");kN.createRoot(M).render(a.jsx(k7,{icon:n(i(e)).icon})),document.body.appendChild(M),M.style.position="absolute",M.style.top="0",M.style.left="0",M.style.zIndex="1000",M.style.pointerEvents="none";const k=A.createElement("div");k.style.width="1px",k.style.height="1px",k.style.position="fixed",k.style.visibility="hidden",A.body.appendChild(k),g.dataTransfer.setDragImage(k,0,0);let S={x:0,y:0};if(document!==A){const T=_.frameElement;if(T){const E=T.getBoundingClientRect();S={x:E.left,y:E.top}}}S.x-=58;function C(T){M.style.transform=`translate( ${T.clientX+S.x}px, ${T.clientY+S.y}px )`}C(g);function R(){A.removeEventListener("dragover",C),A.removeEventListener("dragend",R),M.remove(),k.remove(),p(),document.body.classList.remove("is-dragging-components-draggable"),A.documentElement.classList.remove("is-dragging")}A.addEventListener("dragover",C),A.addEventListener("dragend",R),A.addEventListener("drop",R),d([e]),document.body.classList.add("is-dragging-components-draggable"),A.documentElement.classList.add("is-dragging")}return f.addEventListener("keydown",b),f.addEventListener("dragstart",h),()=>{f.removeEventListener("keydown",b),f.removeEventListener("dragstart",h)}},[e,t,o,c,l,r,u,s,d,p])}function wxt(){const e=x.useContext(Rge);return Mn(t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}},[e])}function _xt({isSelected:e}){const t=$1();return Mn(n=>{if(e){const{ownerDocument:o}=n,{defaultView:r}=o;if(!r.IntersectionObserver)return;const s=new r.IntersectionObserver(i=>{i[0].isIntersecting||n.scrollIntoView({behavior:t?"instant":"smooth"}),s.disconnect()});return s.observe(n),()=>{s.disconnect()}}},[e])}function pme({clientId:e="",isEnabled:t=!0}={}){const{getEnabledClientIdsTree:n}=ct(G(J));return Mn(o=>{if(!t)return;const r=()=>{n(e).forEach(({clientId:i})=>{const c=o.querySelector(`[data-block="${i}"]`);c&&(c.classList.remove("has-editable-outline"),c.offsetWidth,c.classList.add("has-editable-outline"))})},s=i=>{(i.target===o||i.target.classList.contains("is-root-container"))&&(i.defaultPrevented||(i.preventDefault(),r()))};return o.addEventListener("click",s),()=>o.removeEventListener("click",s)},[t])}const Yz=new Map;function kxt(e,t){let n=Yz.get(e);n||(n=new Set,Yz.set(e,n),e.addEventListener("pointerdown",bme)),n.add(t)}function Sxt(e,t){const n=Yz.get(e);n&&(n.delete(t),fme(t),n.size===0&&(Yz.delete(e),e.removeEventListener("pointerdown",bme)))}function fme(e){const t=e.getAttribute("data-draggable");t&&(e.removeAttribute("data-draggable"),t==="true"&&!e.getAttribute("draggable")&&e.setAttribute("draggable","true"))}function bme(e){const{target:t}=e,{ownerDocument:n,isContentEditable:o}=t,r=Yz.get(n);if(o)for(const s of r)s.getAttribute("draggable")==="true"&&s.contains(t)&&(s.removeAttribute("draggable"),s.setAttribute("data-draggable","true"));else for(const s of r)fme(s)}function Cxt(){return Mn(e=>(kxt(e.ownerDocument,e),()=>{Sxt(e.ownerDocument,e)}),[])}function Be(e={},{__unstableIsHtml:t}={}){const{clientId:n,className:o,wrapperProps:r={},isAligned:s,index:i,mode:c,name:l,blockApiVersion:u,blockTitle:d,isSelected:p,isSubtreeDisabled:f,hasOverlay:b,initialPosition:h,blockEditingMode:g,isHighlighted:z,isMultiSelected:A,isPartiallySelected:_,isReusable:v,isDragging:M,hasChildSelected:y,isEditingDisabled:k,hasEditableOutline:S,isTemporarilyEditingAsBlocks:C,defaultClassName:R,isSectionBlock:T,canMove:E}=x.useContext(Pz),B=xe(m("Block: %s"),d),N=c==="html"&&!t?"-visual":"",j=Cxt(),I=xn([e.ref,yxt({clientId:n,initialPosition:h}),kvt(n),vxt(n),xxt({clientId:n,isSelected:p}),Axt({clientId:n}),wxt(),lme({triggerAnimationOnChange:i,clientId:n}),jN({isDisabled:!b}),pme({clientId:n,isEnabled:T}),_xt({isSelected:p}),E?j:void 0]),P=j0(),F=!!P[KB]&&a7(l)?{"--wp-admin-theme-color":"var(--wp-block-synced-color)","--wp-admin-theme-color--rgb":"var(--wp-block-synced-color--rgb)"}:{};u<2&&n===P.clientId&&globalThis.SCRIPT_DEBUG===!0&&zn(`Block type "${l}" must support API version 2 or higher to work correctly with "useBlockProps" method.`);let X=!1;return(r?.style?.marginTop?.charAt(0)==="-"||r?.style?.marginBottom?.charAt(0)==="-"||r?.style?.marginLeft?.charAt(0)==="-"||r?.style?.marginRight?.charAt(0)==="-")&&(X=!0),{tabIndex:g==="disabled"?-1:0,draggable:E&&!y?!0:void 0,...r,...e,ref:I,id:`block-${n}${N}`,role:"document","aria-label":B,"data-block":n,"data-type":l,"data-title":d,inert:f?"true":void 0,className:oe("block-editor-block-list__block",{"wp-block":!s,"has-block-overlay":b,"is-selected":p,"is-highlighted":z,"is-multi-selected":A,"is-partially-selected":_,"is-reusable":v,"is-dragging":M,"has-child-selected":y,"is-editing-disabled":k,"has-editable-outline":S,"has-negative-margin":X,"is-content-locked-temporarily-editing-as-blocks":C},o,e.className,r.className,R),style:{...r.style,...e.style,...F}}}Be.save=K4;function qxt(e,t){const n={...e,...t};return e?.hasOwnProperty("className")&&t?.hasOwnProperty("className")&&(n.className=oe(e.className,t.className)),e?.hasOwnProperty("style")&&t?.hasOwnProperty("style")&&(n.style={...e.style,...t.style}),n}function JA({children:e,isHtml:t,...n}){return a.jsx("div",{...Be(n,{__unstableIsHtml:t}),children:e})}function EW({block:{__unstableBlockSource:e},mode:t,isLocked:n,canRemove:o,clientId:r,isSelected:s,isSelectionEnabled:i,className:c,__unstableLayoutClassNames:l,name:u,isValid:d,attributes:p,wrapperProps:f,setAttributes:b,onReplace:h,onRemove:g,onInsertBlocksAfter:z,onMerge:A,toggleSelection:_}){var v;const{mayDisplayControls:M,mayDisplayParentControls:y,themeSupportsLayout:k,...S}=x.useContext(Pz),C=y_()||{};let R=a.jsx(myt,{name:u,isSelected:s,attributes:p,setAttributes:b,insertBlocksAfter:n?void 0:z,onReplace:o?h:void 0,onRemove:o?g:void 0,mergeBlocks:o?A:void 0,clientId:r,isSelectionEnabled:i,toggleSelection:_,__unstableLayoutClassNames:l,__unstableParentLayout:Object.keys(C).length?C:void 0,mayDisplayControls:M,mayDisplayParentControls:y,blockEditingMode:S.blockEditingMode,isPreviewMode:S.isPreviewMode});const T=on(u);T?.getEditWrapperProps&&(f=qxt(f,T.getEditWrapperProps(p)));const E=f&&!!f["data-align"]&&!k,B=c?.includes("is-position-sticky");E&&(R=a.jsx("div",{className:oe("wp-block",B&&c),"data-align":f["data-align"],children:R}));let N;if(d)t==="html"?N=a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{display:"none"},children:R}),a.jsx(JA,{isHtml:!0,children:a.jsx(Gvt,{clientId:r})})]}):T?.apiVersion>1?N=R:N=a.jsx(JA,{children:R});else{const $=e?ez(e):Gf(T,p);N=a.jsxs(JA,{className:"has-warning",children:[a.jsx(Wvt,{clientId:r}),a.jsx(i0,{children:v5($)})]})}const{"data-align":j,...I}=(v=f)!==null&&v!==void 0?v:{},P={...I,className:oe(I.className,j&&k&&`align${j}`,!(j&&B)&&c)};return a.jsx(Pz.Provider,{value:{wrapperProps:P,isAligned:E,...S},children:a.jsx(Lvt,{fallback:a.jsx(JA,{className:"has-warning",children:a.jsx(Bvt,{})}),children:N})})}const Rxt=jf((e,t,n)=>{const{updateBlockAttributes:o,insertBlocks:r,mergeBlocks:s,replaceBlocks:i,toggleSelection:c,__unstableMarkLastChangeAsPersistent:l,moveBlocksToPosition:u,removeBlock:d,selectBlock:p}=e(J);return{setAttributes(f){const{getMultiSelectedBlockClientIds:b}=n.select(J),h=b(),{clientId:g}=t,z=h.length?h:[g];o(z,f)},onInsertBlocks(f,b){const{rootClientId:h}=t;r(f,b,h)},onInsertBlocksAfter(f){const{clientId:b,rootClientId:h}=t,{getBlockIndex:g}=n.select(J),z=g(b);r(f,z+1,h)},onMerge(f){const{clientId:b,rootClientId:h}=t,{getPreviousBlockClientId:g,getNextBlockClientId:z,getBlock:A,getBlockAttributes:_,getBlockName:v,getBlockOrder:M,getBlockIndex:y,getBlockRootClientId:k,canInsertBlockType:S}=n.select(J);function C(){const T=A(b),E=Mr(),B=on(E);if(v(b)!==E){const N=Kr(T,E);N&&N.length&&i(b,N)}else if(El(T)){const N=z(b);N&&n.batch(()=>{d(b),p(N)})}else if(B.merge){const N=B.merge({},T.attributes);i([b],[Ee(E,N)])}}function R(T,E=!0){const B=v(T),j=on(B).category==="text",I=k(T),P=M(T),[$]=P;P.length===1&&E2(A($))?d(T):j?n.batch(()=>{if(S(v($),I))u([$],T,I,y(T));else{const F=Kr(A($),Mr());F&&F.length&&F.every(X=>S(X.name,I))?(r(F,y(T),I,E),d($,!1)):C()}!M(T).length&&E2(A(T))&&d(T,!1)}):C()}if(f){if(h){const E=z(h);if(E)if(v(h)===v(E)){const B=_(h),N=_(E);if(Object.keys(B).every(j=>B[j]===N[j])){n.batch(()=>{u(M(E),E,h),d(E,!1)});return}}else{s(h,E);return}}const T=z(b);if(!T)return;M(T).length?R(T,!1):s(b,T)}else{const T=g(b);if(T)s(T,b);else if(h){const E=g(h);if(E&&v(h)===v(E)){const B=_(h),N=_(E);if(Object.keys(B).every(j=>B[j]===N[j])){n.batch(()=>{u(M(h),h,E),d(h,!1)});return}}R(h)}else C()}},onReplace(f,b,h){f.length&&!El(f[f.length-1])&&l();const g=f?.length===1&&Array.isArray(f[0])?f[0]:f;i([t.clientId],g,b,h)},onRemove(){d(t.clientId)},toggleSelection(f){c(f)}}});EW=Co(Rxt,ap("editor.BlockListBlock"))(EW);function Txt(e){const{clientId:t,rootClientId:n}=e,o=G(ee=>{const{isBlockSelected:ue,getBlockMode:ce,isSelectionEnabled:me,getTemplateLock:de,isSectionBlock:Ae,getBlockWithoutAttributes:ye,getBlockAttributes:Ne,canRemoveBlock:je,canMoveBlock:ie,getSettings:we,getTemporarilyEditingAsBlocks:re,getBlockEditingMode:pe,getBlockName:ke,isFirstMultiSelectedBlock:Se,getMultiSelectedBlockClientIds:se,hasSelectedInnerBlock:L,getBlocksByName:U,getBlockIndex:ne,isBlockMultiSelected:ve,isBlockSubtreeDisabled:qe,isBlockHighlighted:Pe,__unstableIsFullySelected:rt,__unstableSelectionHasUnmergeableBlock:qt,isBlockBeingDragged:wt,isDragging:Bt,__unstableHasActiveBlockOverlayActive:ae,getSelectedBlocksInitialCaretPosition:H}=ct(ee(J)),Y=ye(t);if(!Y)return;const{hasBlockSupport:fe,getActiveBlockVariation:Re}=ee(kt),be=Ne(t),{name:ze,isValid:nt}=Y,Mt=on(ze),{supportsLayout:ot,isPreviewMode:Ue}=we(),yt=Mt?.apiVersion>1,fn={isPreviewMode:Ue,blockWithoutAttributes:Y,name:ze,attributes:be,isValid:nt,themeSupportsLayout:ot,index:ne(t),isReusable:Qd(Mt),className:yt?be.className:void 0,defaultClassName:yt?G4(ze):void 0,blockTitle:Mt?.title};if(Ue)return fn;const Ln=ue(t),Mo=je(t),rr=ie(t),Jo=Re(ze,be),To=ve(t),Rt=L(t,!0),Qe=pe(t),Gt=Tt(ze,"multiple",!0)?[]:U(ze),On=Gt.length&&Gt[0]!==t;return{...fn,mode:ce(t),isSelectionEnabled:me(),isLocked:!!de(n),isSectionBlock:Ae(t),canRemove:Mo,canMove:rr,isSelected:Ln,isTemporarilyEditingAsBlocks:re()===t,blockEditingMode:Qe,mayDisplayControls:Ln||Se(t)&&se().every($n=>ke($n)===ze),mayDisplayParentControls:fe(ke(t),"__experimentalExposeControlsToChildren",!1)&&L(t),blockApiVersion:Mt?.apiVersion||1,blockTitle:Jo?.title||Mt?.title,isSubtreeDisabled:Qe==="disabled"&&qe(t),hasOverlay:ae(t)&&!Bt(),initialPosition:Ln?H():void 0,isHighlighted:Pe(t),isMultiSelected:To,isPartiallySelected:To&&!rt()&&!qt(),isDragging:wt(t),hasChildSelected:Rt,isEditingDisabled:Qe==="disabled",hasEditableOutline:Qe!=="disabled"&&pe(n)==="disabled",originalBlockClientId:On?Gt[0]:!1}},[t,n]),{isPreviewMode:r,mode:s="visual",isSelectionEnabled:i=!1,isLocked:c=!1,canRemove:l=!1,canMove:u=!1,blockWithoutAttributes:d,name:p,attributes:f,isValid:b,isSelected:h=!1,themeSupportsLayout:g,isTemporarilyEditingAsBlocks:z,blockEditingMode:A,mayDisplayControls:_,mayDisplayParentControls:v,index:M,blockApiVersion:y,blockTitle:k,isSubtreeDisabled:S,hasOverlay:C,initialPosition:R,isHighlighted:T,isMultiSelected:E,isPartiallySelected:B,isReusable:N,isDragging:j,hasChildSelected:I,isSectionBlock:P,isEditingDisabled:$,hasEditableOutline:F,className:X,defaultClassName:Z,originalBlockClientId:V}=o,Q=x.useMemo(()=>({...d,attributes:f}),[d,f]);if(!o)return null;const te={isPreviewMode:r,clientId:t,className:X,index:M,mode:s,name:p,blockApiVersion:y,blockTitle:k,isSelected:h,isSubtreeDisabled:S,hasOverlay:C,initialPosition:R,blockEditingMode:A,isHighlighted:T,isMultiSelected:E,isPartiallySelected:B,isReusable:N,isDragging:j,hasChildSelected:I,isSectionBlock:P,isEditingDisabled:$,hasEditableOutline:F,isTemporarilyEditingAsBlocks:z,defaultClassName:Z,mayDisplayControls:_,mayDisplayParentControls:v,originalBlockClientId:V,themeSupportsLayout:g,canMove:u};return a.jsx(Pz.Provider,{value:te,children:a.jsx(EW,{...e,mode:s,isSelectionEnabled:i,isLocked:c,canRemove:l,canMove:u,block:Q,name:p,attributes:f,isValid:b,isSelected:h})})}const Ext=x.memo(Txt),TQ=[cr(m("While writing, you can press / to quickly insert new blocks."),{kbd:a.jsx("kbd",{})}),cr(m("Indent a list by pressing space at the beginning of a line."),{kbd:a.jsx("kbd",{})}),cr(m("Outdent a list by pressing backspace at the beginning of a line."),{kbd:a.jsx("kbd",{})}),m("Drag files into the editor to automatically insert media blocks."),m("Change a block's type by pressing the block icon on the toolbar.")];function Wxt(){const[e]=x.useState(Math.floor(Math.random()*TQ.length));return a.jsx(iht,{children:TQ[e]})}const{Badge:Nxt}=ct(tr);function hme({title:e,icon:t,description:n,blockType:o,className:r,name:s}){o&&(Ke("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),{title:e,icon:t,description:n}=o);const{parentNavBlockClientId:i}=G(l=>{const{getSelectedBlockClientId:u,getBlockParentsByBlockName:d}=l(J),p=u();return{parentNavBlockClientId:d(p,"core/navigation",!0)[0]}},[]),{selectBlock:c}=Oe(J);return a.jsxs("div",{className:oe("block-editor-block-card",r),children:[i&&a.jsx(Ce,{onClick:()=>c(i),label:m("Go to parent Navigation block"),style:{minWidth:24,padding:0},icon:jt()?ma:Ll,size:"small"}),a.jsx(Zn,{icon:t,showColors:!0}),a.jsxs(dt,{spacing:1,children:[a.jsxs("h2",{className:"block-editor-block-card__title",children:[a.jsx("span",{className:"block-editor-block-card__name",children:s?.length?s:e}),!!s?.length&&a.jsx(Nxt,{children:e})]}),n&&a.jsx(Sn,{className:"block-editor-block-card__description",children:n})]})]})}let _r=function(e){return e.Unknown="REDUX_UNKNOWN",e.Add="ADD_ITEM",e.Prepare="PREPARE_ITEM",e.Cancel="CANCEL_ITEM",e.Remove="REMOVE_ITEM",e.PauseItem="PAUSE_ITEM",e.ResumeItem="RESUME_ITEM",e.PauseQueue="PAUSE_QUEUE",e.ResumeQueue="RESUME_QUEUE",e.OperationStart="OPERATION_START",e.OperationFinish="OPERATION_FINISH",e.AddOperations="ADD_OPERATIONS",e.CacheBlobUrl="CACHE_BLOB_URL",e.RevokeBlobUrls="REVOKE_BLOB_URLS",e.UpdateSettings="UPDATE_SETTINGS",e}({}),mme=function(e){return e.Processing="PROCESSING",e.Paused="PAUSED",e}({}),Zz=function(e){return e.Prepare="PREPARE",e.Upload="UPLOAD",e}({});const Bxt=()=>{},Lxt={queue:[],queueStatus:"active",blobUrls:{},settings:{mediaUpload:Bxt}};function gme(e=Lxt,t={type:_r.Unknown}){switch(t.type){case _r.PauseQueue:return{...e,queueStatus:"paused"};case _r.ResumeQueue:return{...e,queueStatus:"active"};case _r.Add:return{...e,queue:[...e.queue,t.item]};case _r.Cancel:return{...e,queue:e.queue.map(n=>n.id===t.id?{...n,error:t.error}:n)};case _r.Remove:return{...e,queue:e.queue.filter(n=>n.id!==t.id)};case _r.OperationStart:return{...e,queue:e.queue.map(n=>n.id===t.id?{...n,currentOperation:t.operation}:n)};case _r.AddOperations:return{...e,queue:e.queue.map(n=>n.id!==t.id?n:{...n,operations:[...n.operations||[],...t.operations]})};case _r.OperationFinish:return{...e,queue:e.queue.map(n=>{if(n.id!==t.id)return n;const o=n.operations?n.operations.slice(1):[],r=n.attachment||t.item.attachment?{...n.attachment,...t.item.attachment}:void 0;return{...n,currentOperation:void 0,operations:o,...t.item,attachment:r,additionalData:{...n.additionalData,...t.item.additionalData}}})};case _r.CacheBlobUrl:{const n=e.blobUrls[t.id]||[];return{...e,blobUrls:{...e.blobUrls,[t.id]:[...n,t.blobUrl]}}}case _r.RevokeBlobUrls:{const n={...e.blobUrls};return delete n[t.id],{...e,blobUrls:n}}case _r.UpdateSettings:return{...e,settings:{...e.settings,...t.settings}}}return e}function Pxt(e){return e.queue}function jxt(e){return e.queue.length>=1}function Ixt(e,t){return e.queue.some(n=>n.attachment?.url===t||n.sourceUrl===t)}function Dxt(e,t){return e.queue.some(n=>n.attachment?.id===t||n.sourceAttachmentId===t)}function Fxt(e){return e.settings}const Mme=Object.freeze(Object.defineProperty({__proto__:null,getItems:Pxt,getSettings:Fxt,isUploading:jxt,isUploadingById:Dxt,isUploadingByUrl:Ixt},Symbol.toStringTag,{value:"Module"}));function $xt(e){return e.queue}function Vxt(e,t){return e.queue.find(n=>n.id===t)}function Hxt(e,t){return e.queue.filter(o=>t===o.batchId).length===0}function Uxt(e,t){return e.queue.some(n=>n.currentOperation===Zz.Upload&&n.additionalData.post===t)}function Xxt(e,t){return e.queue.find(n=>n.status===mme.Paused&&n.additionalData.post===t)}function Gxt(e){return e.queueStatus==="paused"}function Kxt(e,t){return e.blobUrls[t]||[]}const Yxt=Object.freeze(Object.defineProperty({__proto__:null,getAllItems:$xt,getBlobUrls:Kxt,getItem:Vxt,getPausedUploadForPost:Xxt,isBatchUploaded:Hxt,isPaused:Gxt,isUploadingToPost:Uxt},Symbol.toStringTag,{value:"Module"}));let Ix=class extends Error{constructor({code:t,message:n,file:o,cause:r}){super(n,{cause:r}),Object.setPrototypeOf(this,new.target.prototype),this.code=t,this.file=o}};function Zxt(e,t){if(!t)return;const n=t.some(o=>o.includes("/")?o===e.type:e.type.startsWith(`${o}/`));if(e.type&&!n)throw new Ix({code:"MIME_TYPE_NOT_SUPPORTED",message:xe(m("%s: Sorry, this file type is not supported here."),e.name),file:e})}function Qxt(e){return e?Object.entries(e).flatMap(([t,n])=>{const[o]=n.split("/"),r=t.split("|");return[n,...r.map(s=>`${o}/${s}`)]}):null}function Jxt(e,t){const n=Qxt(t);if(!n)return;const o=n.includes(e.type);if(e.type&&!o)throw new Ix({code:"MIME_TYPE_NOT_ALLOWED_FOR_USER",message:xe(m("%s: Sorry, you are not allowed to upload this file type."),e.name),file:e})}function e5t(e,t){if(e.size<=0)throw new Ix({code:"EMPTY_FILE",message:xe(m("%s: This file is empty."),e.name),file:e});if(t&&e.size>t)throw new Ix({code:"SIZE_ABOVE_LIMIT",message:xe(m("%s: This file exceeds the maximum upload size for this site."),e.name),file:e})}function t5t({files:e,onChange:t,onSuccess:n,onError:o,onBatchSuccess:r,additionalData:s,allowedTypes:i}){return async({select:c,dispatch:l})=>{const u=Is();for(const d of e){try{Zxt(d,i),Jxt(d,c.getSettings().allowedMimeTypes)}catch(p){o?.(p);continue}try{e5t(d,c.getSettings().maxUploadFileSize)}catch(p){o?.(p);continue}l.addItem({file:d,batchId:u,onChange:t,onSuccess:n,onBatchSuccess:r,onError:o,additionalData:s})}}}function n5t(e,t,n=!1){return async({select:o,dispatch:r})=>{const s=o.getItem(e);if(s){if(s.abortController?.abort(),!n){const{onError:i}=s;i?.(t??new Error("Upload cancelled")),!i&&t&&console.error("Upload cancelled",t)}r({type:_r.Cancel,id:e,error:t}),r.removeItem(e),r.revokeBlobUrls(e),s.batchId&&o.isBatchUploaded(s.batchId)&&s.onBatchSuccess?.()}}}const zme=Object.freeze(Object.defineProperty({__proto__:null,addItems:t5t,cancelItem:n5t},Symbol.toStringTag,{value:"Module"}));function o5t(e){if(e instanceof File)return e;const t=e.type.split("/")[1],n=e.type==="application/pdf"?"document":e.type.split("/")[0];return new File([e],`${n}.${t}`,{type:e.type})}function r5t(e,t){return new File([e],t,{type:e.type,lastModified:e.lastModified})}function s5t(e){return r5t(e,e.name)}class i5t extends File{constructor(t="stub-file"){super([],t)}}function a5t({file:e,batchId:t,onChange:n,onSuccess:o,onBatchSuccess:r,onError:s,additionalData:i={},sourceUrl:c,sourceAttachmentId:l,abortController:u,operations:d}){return async({dispatch:p})=>{const f=Is(),b=o5t(e);let h;b instanceof i5t||(h=ls(b),p({type:_r.CacheBlobUrl,id:f,blobUrl:h})),p({type:_r.Add,item:{id:f,batchId:t,status:mme.Processing,sourceFile:s5t(b),file:b,attachment:{url:h},additionalData:{convert_format:!1,...i},onChange:n,onSuccess:o,onBatchSuccess:r,onError:s,sourceUrl:c,sourceAttachmentId:l,abortController:u||new AbortController,operations:Array.isArray(d)?d:[Zz.Prepare]}}),p.processItem(f)}}function c5t(e){return async({select:t,dispatch:n})=>{if(t.isPaused())return;const o=t.getItem(e),{attachment:r,onChange:s,onSuccess:i,onBatchSuccess:c,batchId:l}=o,u=Array.isArray(o.operations?.[0])?o.operations[0][0]:o.operations?.[0];if(r&&s?.([r]),!u){r&&i?.([r]),n.revokeBlobUrls(e),l&&t.isBatchUploaded(l)&&c?.();return}if(u)switch(n({type:_r.OperationStart,id:e,operation:u}),u){case Zz.Prepare:n.prepareItem(o.id);break;case Zz.Upload:n.uploadItem(e);break}}}function l5t(){return{type:_r.PauseQueue}}function u5t(){return async({select:e,dispatch:t})=>{t({type:_r.ResumeQueue});for(const n of e.getAllItems())t.processItem(n.id)}}function d5t(e){return async({select:t,dispatch:n})=>{t.getItem(e)&&n({type:_r.Remove,id:e})}}function p5t(e,t){return async({dispatch:n})=>{n({type:_r.OperationFinish,id:e,item:t}),n.processItem(e)}}function f5t(e){return async({dispatch:t})=>{const n=[Zz.Upload];t({type:_r.AddOperations,id:e,operations:n}),t.finishOperation(e,{})}}function b5t(e){return async({select:t,dispatch:n})=>{const o=t.getItem(e);t.getSettings().mediaUpload({filesList:[o.file],additionalData:o.additionalData,signal:o.abortController?.signal,onFileChange:([r])=>{Wr(r.url)||n.finishOperation(e,{attachment:r})},onSuccess:([r])=>{n.finishOperation(e,{attachment:r})},onError:r=>{n.cancelItem(e,r)}})}}function h5t(e){return async({select:t,dispatch:n})=>{const o=t.getBlobUrls(e);for(const r of o)J4(r);n({type:_r.RevokeBlobUrls,id:e})}}function m5t(e){return{type:_r.UpdateSettings,settings:e}}const g5t=Object.freeze(Object.defineProperty({__proto__:null,addItem:a5t,finishOperation:p5t,pauseQueue:l5t,prepareItem:f5t,processItem:c5t,removeItem:d5t,resumeQueue:u5t,revokeBlobUrls:h5t,updateSettings:m5t,uploadItem:b5t},Symbol.toStringTag,{value:"Module"})),{lock:Vmn,unlock:S7}=P0("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/upload-media"),Ome="core/upload-media",M5t={reducer:gme,selectors:Mme,actions:zme},SO=w1(Ome,{reducer:gme,selectors:Mme,actions:zme});Us(SO);S7(SO).registerPrivateActions(g5t);S7(SO).registerPrivateSelectors(Yxt);function z5t(e,t,n){if(!n)return t;let o=e.get(t);return o||(o=S5({},t),o.registerStore(Ome,M5t),e.set(t,o)),o}const O5t=Or(e=>({useSubRegistry:t=!0,...n})=>{const o=Fn(),[r]=x.useState(()=>new WeakMap),s=z5t(r,o,t);return s===o?a.jsx(e,{registry:o,...n}):a.jsx($N,{value:s,children:a.jsx(e,{registry:s,...n})})},"withRegistryProvider"),y5t=O5t(e=>{const{children:t,settings:n}=e,{updateSettings:o}=S7(Oe(SO));return x.useEffect(()=>{o(n)},[n,o]),a.jsx(a.Fragment,{children:t})});function A5t(e,t,n){if(!n)return t;let o=e.get(t);return o||(o=S5({},t),o.registerStore($r,u_),e.set(t,o)),o}const v5t=Or(e=>({useSubRegistry:t=!0,...n})=>{const o=Fn(),[r]=x.useState(()=>new WeakMap),s=A5t(r,o,t);return s===o?a.jsx(e,{registry:o,...n}):a.jsx($N,{value:s,children:a.jsx(e,{registry:s,...n})})},"withRegistryProvider"),EQ=()=>{};function yme({clientId:e=null,value:t,selection:n,onChange:o=EQ,onInput:r=EQ}){const s=Fn(),{resetBlocks:i,resetSelection:c,replaceInnerBlocks:l,setHasControlledInnerBlocks:u,__unstableMarkNextChangeAsNotPersistent:d}=s.dispatch(J),{getBlockName:p,getBlocks:f,getSelectionStart:b,getSelectionEnd:h}=s.select(J),g=G(S=>!e||S(J).areInnerBlocksControlled(e),[e]),z=x.useRef({incoming:null,outgoing:[]}),A=x.useRef(!1),_=()=>{t&&(d(),e?s.batch(()=>{u(e,!0);const S=t.map(C=>jo(C));A.current&&(z.current.incoming=S),d(),l(e,S)}):(A.current&&(z.current.incoming=t),i(t)))},v=()=>{d(),e?(u(e,!1),d(),l(e,[])):i([])},M=x.useRef(r),y=x.useRef(o);x.useEffect(()=>{M.current=r,y.current=o},[r,o]),x.useEffect(()=>{z.current.outgoing.includes(t)?z.current.outgoing[z.current.outgoing.length-1]===t&&(z.current.outgoing=[]):f(e)!==t&&(z.current.outgoing=[],_(),n&&c(n.selectionStart,n.selectionEnd,n.initialPosition))},[t,e]);const k=x.useRef(!1);x.useEffect(()=>{if(!k.current){k.current=!0;return}g||(z.current.outgoing=[],_())},[g]),x.useEffect(()=>{const{getSelectedBlocksInitialCaretPosition:S,isLastBlockChangePersistent:C,__unstableIsLastBlockChangeIgnored:R,areInnerBlocksControlled:T}=s.select(J);let E=f(e),B=C(),N=!1;A.current=!0;const j=s.subscribe(()=>{if(e!==null&&p(e)===null||!(!e||T(e)))return;const P=C(),$=f(e),F=$!==E;if(E=$,F&&(z.current.incoming||R())){z.current.incoming=null,B=P;return}(F||N&&!F&&P&&!B)&&(B=P,z.current.outgoing.push(E),(B?y.current:M.current)(E,{selection:{selectionStart:b(),selectionEnd:h(),initialPosition:S()}})),N=F},J);return()=>{A.current=!1,j()}},[s,e]),x.useEffect(()=>()=>{v()},[])}function x5t(e={},t){switch(t.type){case"REGISTER_SHORTCUT":return{...e,[t.name]:{category:t.category,keyCombination:t.keyCombination,aliases:t.aliases,description:t.description}};case"UNREGISTER_SHORTCUT":const{[t.name]:n,...o}=e;return o}return e}function w5t({name:e,category:t,description:n,keyCombination:o,aliases:r}){return{type:"REGISTER_SHORTCUT",name:e,category:t,keyCombination:o,aliases:r,description:n}}function _5t(e){return{type:"UNREGISTER_SHORTCUT",name:e}}const k5t=Object.freeze(Object.defineProperty({__proto__:null,registerShortcut:w5t,unregisterShortcut:_5t},Symbol.toStringTag,{value:"Module"})),S5t=[],C5t={display:j1,raw:iSe,ariaLabel:d0e};function Ame(e,t){return e?e.modifier?C5t[t][e.modifier](e.character):e.character:null}function C7(e,t){return e[t]?e[t].keyCombination:null}function q5t(e,t,n="display"){const o=C7(e,t);return Ame(o,n)}function R5t(e,t){return e[t]?e[t].description:null}function vme(e,t){return e[t]&&e[t].aliases?e[t].aliases:S5t}const xme=It((e,t)=>[C7(e,t),...vme(e,t)].filter(Boolean),(e,t)=>[e[t]]),T5t=It((e,t)=>xme(e,t).map(n=>Ame(n,"raw")),(e,t)=>[e[t]]),E5t=It((e,t)=>Object.entries(e).filter(([,n])=>n.category===t).map(([n])=>n),e=>[e]),W5t=Object.freeze(Object.defineProperty({__proto__:null,getAllShortcutKeyCombinations:xme,getAllShortcutRawKeyCombinations:T5t,getCategoryShortcuts:E5t,getShortcutAliases:vme,getShortcutDescription:R5t,getShortcutKeyCombination:C7,getShortcutRepresentation:q5t},Symbol.toStringTag,{value:"Module"})),N5t="core/keyboard-shortcuts",Pi=w1(N5t,{reducer:x5t,actions:k5t,selectors:W5t});Us(Pi);function C_(){const{getAllShortcutKeyCombinations:e}=G(Pi);function t(n,o){return e(n).some(({modifier:r,character:s})=>lc[r](o,s))}return t}const uM=new Set,WQ=e=>{for(const t of uM)t(e)},B5t=x.createContext({add:e=>{uM.size===0&&document.addEventListener("keydown",WQ),uM.add(e)},delete:e=>{uM.delete(e),uM.size===0&&document.removeEventListener("keydown",WQ)}});function p0(e,t,{isDisabled:n=!1}={}){const o=x.useContext(B5t),r=C_(),s=x.useRef();x.useEffect(()=>{s.current=t},[t]),x.useEffect(()=>{if(n)return;function i(c){r(e,c)&&s.current(c)}return o.add(i),()=>{o.delete(i)}},[e,n,o])}function wme(){return null}function L5t(){const{registerShortcut:e}=Oe(Pi);return x.useEffect(()=>{e({name:"core/block-editor/duplicate",category:"block",description:m("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:m("Remove the selected block(s)."),keyCombination:{modifier:"shift",character:"backspace"}}),e({name:"core/block-editor/insert-before",category:"block",description:m("Insert a new block before the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"t"}}),e({name:"core/block-editor/insert-after",category:"block",description:m("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:m("Delete selection."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:m("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:m("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/multi-text-selection",category:"selection",description:m("Select text across multiple blocks."),keyCombination:{modifier:"shift",character:"arrow"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:m("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:m("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:m("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}}),e({name:"core/block-editor/collapse-list-view",category:"list-view",description:m("Collapse all other items."),keyCombination:{modifier:"alt",character:"l"}}),e({name:"core/block-editor/group",category:"block",description:m("Create a group block from the selected multiple blocks."),keyCombination:{modifier:"primary",character:"g"}})},[e]),null}wme.Register=L5t;function P5t(e={}){return x.useMemo(()=>({mediaUpload:e.mediaUpload,mediaSideload:e.mediaSideload,maxUploadFileSize:e.maxUploadFileSize,allowedMimeTypes:e.allowedMimeTypes}),[e])}const j5t=()=>{};function I5t(e,{allowedTypes:t,additionalData:n={},filesList:o,onError:r=j5t,onFileChange:s,onSuccess:i,onBatchSuccess:c}){e.dispatch(SO).addItems({files:o,onChange:s,onSuccess:i,onBatchSuccess:c,onError:({message:l})=>r(l),additionalData:n,allowedTypes:t})}const q_=v5t(e=>{const{settings:t,registry:n,stripExperimentalSettings:o=!1}=e,r=P5t(t);let s=t;window.__experimentalMediaProcessing&&t.mediaUpload&&(s=x.useMemo(()=>({...t,mediaUpload:I5t.bind(null,n)}),[t,n]));const{__experimentalUpdateSettings:i}=ct(Oe(J));x.useEffect(()=>{i({...s,__internalIsInitialized:!0},{stripExperimentalSettings:o,reset:!0})},[s,o,i]),yme(e);const c=a.jsxs(wpe,{passthrough:!0,children:[!s?.isPreviewMode&&a.jsx(wme.Register,{}),a.jsx(_vt,{children:e.children})]});return window.__experimentalMediaProcessing?a.jsx(y5t,{settings:r,useSubRegistry:!1,children:c}):c}),D5t=e=>a.jsx(q_,{...e,stripExperimentalSettings:!1,children:e.children});function q7(){const{getSettings:e,hasSelectedBlock:t,hasMultiSelection:n}=G(J),{clearSelectedBlock:o}=Oe(J),{clearBlockSelection:r}=e();return Mn(s=>{if(!r)return;function i(c){!t()&&!n()||c.target===s&&o()}return s.addEventListener("mousedown",i),()=>{s.removeEventListener("mousedown",i)}},[t,n,o,r])}function F5t(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:s,__unstableIsFullySelected:i}=e(J);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:s(),isFullSelection:i()}}function $5t(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:s}=G(F5t,[]);return Mn(i=>{const{ownerDocument:c}=i,{defaultView:l}=c;if(e==null||!o||t)return;const{length:u}=n;u<2||s&&(i.contentEditable=!0,i.focus(),l.getSelection().removeAllRanges())},[o,t,n,r,e,s])}function V5t(){const e=x.useRef(),t=x.useRef(),n=x.useRef(),{hasMultiSelection:o,getSelectedBlockClientId:r,getBlockCount:s,getBlockOrder:i,getLastFocus:c,getSectionRootClientId:l,isZoomOut:u}=ct(G(J)),{setLastFocus:d}=ct(Oe(J)),p=x.useRef();function f(A){const _=e.current.ownerDocument===A.target.ownerDocument?e.current:e.current.ownerDocument.defaultView.frameElement;if(p.current)p.current=null;else if(o())e.current.focus();else if(r())c()?.current?c().current.focus():e.current.querySelector(`[data-block="${r()}"]`).focus();else if(u()){const v=l(),M=i(v);M.length?e.current.querySelector(`[data-block="${M[0]}"]`).focus():v?e.current.querySelector(`[data-block="${v}"]`).focus():_.focus()}else{const v=A.target.compareDocumentPosition(_)&A.target.DOCUMENT_POSITION_FOLLOWING,M=Xr.tabbable.find(e.current);M.length&&(v?M[0]:M[M.length-1]).focus()}}const b=a.jsx("div",{ref:t,tabIndex:"0",onFocus:f}),h=a.jsx("div",{ref:n,tabIndex:"0",onFocus:f}),g=Mn(A=>{function _(S){if(S.defaultPrevented||S.keyCode!==Y2)return;const C=S.shiftKey,R=C?"findPrevious":"findNext",T=Xr.tabbable[R](S.target),E=S.target.closest("[data-block]"),B=E&&T&&(ume(E,T)||LM(E,T));if(Qre(T)&&B)return;const N=C?t:n;p.current=!0,N.current.focus({preventScroll:!0})}function v(S){d({...c(),current:S.target});const{ownerDocument:C}=A;!S.relatedTarget&&C.activeElement===C.body&&s()===0&&A.focus()}function M(S){if(S.keyCode!==Y2||S.target?.getAttribute("role")==="region"||e.current===S.target)return;const R=S.shiftKey?"findPrevious":"findNext",T=Xr.tabbable[R](S.target);(T===t.current||T===n.current)&&(S.preventDefault(),T.focus({preventScroll:!0}))}const{ownerDocument:y}=A,{defaultView:k}=y;return k.addEventListener("keydown",M),A.addEventListener("keydown",_),A.addEventListener("focusout",v),()=>{k.removeEventListener("keydown",M),A.removeEventListener("keydown",_),A.removeEventListener("focusout",v)}},[]),z=xn([e,g]);return[b,z,h]}function H5t(e,t,n){const o=t===cc||t===Ps,{tagName:r}=e,s=e.getAttribute("type");return o&&!n?r==="INPUT"?!["date","datetime-local","month","number","range","time","week"].includes(s):!0:r==="INPUT"?["button","checkbox","number","color","file","image","radio","reset","submit"].includes(s):r!=="TEXTAREA"}function Mq(e,t,n,o){let r=Xr.focusable.find(n);t&&r.reverse(),r=r.slice(r.indexOf(e)+1);let s;o&&(s=e.getBoundingClientRect());function i(c){if(!c.closest("[inert]")&&!(c.children.length===1&&ume(c,c.firstElementChild)&&c.firstElementChild.getAttribute("contenteditable")==="true")){if(!Xr.tabbable.isTabbableIndex(c)||c.isContentEditable&&c.contentEditable!=="true")return!1;if(o){const l=c.getBoundingClientRect();if(l.left>=s.right||l.right<=s.left)return!1}return!0}}return r.find(i)}function U5t(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:o,__unstableIsFullySelected:r}=G(J),{selectBlock:s}=Oe(J);return Mn(i=>{let c;function l(){c=null}function u(p,f){const b=Mq(p,f,i);return b&&PM(b)}function d(p){if(p.defaultPrevented)return;const{keyCode:f,target:b,shiftKey:h,ctrlKey:g,altKey:z,metaKey:A}=p,_=f===cc,v=f===Ps,M=f===wi,y=f===_i,k=_||M,S=M||y,C=_||v,R=S||C,T=h||g||z||A,E=C?SH:mS,{ownerDocument:B}=i,{defaultView:N}=B;if(!R)return;if(o()){if(h||!r())return;p.preventDefault(),k?s(e()):s(t(),-1);return}if(!H5t(b,f,T))return;C?c||(c=ME(N)):c=null;const j=WN(b)?!k:k,{keepCaretInsideBlock:I}=n();if(h)u(b,k)&&E(b,k)&&(i.contentEditable=!0,i.focus());else if(C&&SH(b,k)&&(!z||mS(b,j))&&!I){const P=Mq(b,k,i,!0);P&&(N6e(P,z?!k:k,z?void 0:c),p.preventDefault())}else if(S&&N.getSelection().isCollapsed&&mS(b,j)&&!I){const P=Mq(b,j,i);r0e(P,k),p.preventDefault()}}return i.addEventListener("mousedown",l),i.addEventListener("keydown",d),()=>{i.removeEventListener("mousedown",l),i.removeEventListener("keydown",d)}},[])}function X5t(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=G(J),{multiSelect:o,selectBlock:r}=Oe(J),s=C_();return Mn(i=>{function c(l){if(!s("core/block-editor/select-all",l))return;const u=t();if(u.length<2&&!R6e(l.target))return;l.preventDefault();const[d]=u,p=n(d),f=e(p);if(u.length===f.length){p&&(i.ownerDocument.defaultView.getSelection().removeAllRanges(),r(p));return}o(f[0],f[f.length-1])}return i.addEventListener("keydown",c),()=>{i.removeEventListener("keydown",c)}},[])}function NQ(e,t){e.contentEditable=t,t&&e.focus()}function G5t(){const{startMultiSelect:e,stopMultiSelect:t}=Oe(J),{isSelectionEnabled:n,hasSelectedBlock:o,isDraggingBlocks:r,isMultiSelecting:s}=G(J);return Mn(i=>{const{ownerDocument:c}=i,{defaultView:l}=c;let u,d;function p(){t(),l.removeEventListener("mouseup",p),d=l.requestAnimationFrame(()=>{if(!o())return;NQ(i,!1);const g=l.getSelection();if(g.rangeCount){const z=g.getRangeAt(0),{commonAncestorContainer:A}=z,_=z.cloneRange();u.contains(A)&&(u.focus(),g.removeAllRanges(),g.addRange(_))}})}let f;function b({target:g}){f=g}function h({buttons:g,target:z,relatedTarget:A}){z.contains(f)&&(z.contains(A)||r()||g===1&&(s()||i!==z&&z.getAttribute("contenteditable")==="true"&&n()&&(u=z,e(),l.addEventListener("mouseup",p),NQ(i,!0))))}return i.addEventListener("mouseout",h),i.addEventListener("mousedown",b),()=>{i.removeEventListener("mouseout",h),l.removeEventListener("mouseup",p),l.cancelAnimationFrame(d)}},[e,t,n,o])}function K5t(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE||n===0?t:t.childNodes[n-1]}function Y5t(e){const{focusNode:t,focusOffset:n}=e;if(t.nodeType===t.TEXT_NODE||n===t.childNodes.length)return t;if(n===0&&Jre(e)){var o;return(o=t.previousSibling)!==null&&o!==void 0?o:t.parentElement}return t.childNodes[n]}function Z5t(e,t){let n=0;for(;e[n]===t[n];)n++;return n}function BQ(e,t){e.contentEditable!==String(t)&&(e.contentEditable=t)}function LQ(e){return(e.nodeType===e.ELEMENT_NODE?e:e.parentElement)?.closest("[data-wp-block-attribute-key]")}function Q5t(){const{multiSelect:e,selectBlock:t,selectionChange:n}=Oe(J),{getBlockParents:o,getBlockSelectionStart:r,isMultiSelecting:s}=G(J);return Mn(i=>{const{ownerDocument:c}=i,{defaultView:l}=c;function u(d){const p=l.getSelection();if(!p.rangeCount)return;const f=K5t(p),b=Y5t(p);if(!i.contains(f)||!i.contains(b))return;const h=d.shiftKey&&d.type==="mouseup";if(p.isCollapsed&&!h){if(i.contentEditable==="true"&&!s()){BQ(i,!1);let M=f.nodeType===f.ELEMENT_NODE?f:f.parentElement;M=M?.closest("[contenteditable]"),M?.focus()}return}let g=PM(f),z=PM(b);if(h){const M=r(),y=PM(d.target),k=y!==z;(g===z&&p.isCollapsed||!z||k)&&(z=y),g!==M&&(g=M)}if(g===void 0&&z===void 0){BQ(i,!1);return}if(g===z)s()?e(g,g):t(g);else{const M=[...o(g),g],y=[...o(z),z],k=Z5t(M,y);if(M[k]!==g||y[k]!==z){e(M[k],y[k]);return}const S=LQ(f),C=LQ(b);if(S&&C){var _,v;const R=p.getRangeAt(0),T=eo({element:S,range:R,__unstableIsEditableTree:!0}),E=eo({element:C,range:R,__unstableIsEditableTree:!0}),B=(_=T.start)!==null&&_!==void 0?_:T.end,N=(v=E.start)!==null&&v!==void 0?v:E.end;n({start:{clientId:g,attributeKey:S.dataset.wpBlockAttributeKey,offset:B},end:{clientId:z,attributeKey:C.dataset.wpBlockAttributeKey,offset:N}})}else e(g,z)}}return c.addEventListener("selectionchange",u),l.addEventListener("mouseup",u),()=>{c.removeEventListener("selectionchange",u),l.removeEventListener("mouseup",u)}},[e,t,n,o])}function J5t(){const{selectBlock:e}=Oe(J),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=G(J);return Mn(r=>{function s(i){if(!t()||i.button!==0)return;const c=n(),l=PM(i.target);i.shiftKey?c!==l&&(r.contentEditable=!0,r.focus()):o()&&e(l)}return r.addEventListener("mousedown",s),()=>{r.removeEventListener("mousedown",s)}},[e,t,n,o])}function ewt(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,getSelectedBlockClientId:n,__unstableIsSelectionMergeable:o,hasMultiSelection:r,getBlockName:s,canInsertBlockType:i,getBlockRootClientId:c,getSelectionStart:l,getSelectionEnd:u,getBlockAttributes:d}=G(J),{replaceBlocks:p,__unstableSplitSelection:f,removeBlocks:b,__unstableDeleteSelection:h,__unstableExpandSelection:g,__unstableMarkAutomaticChange:z}=Oe(J);return Mn(A=>{function _(y){A.contentEditable==="true"&&y.preventDefault()}function v(y){if(!y.defaultPrevented){if(!r()){if(y.keyCode===Gr){if(y.shiftKey||e())return;const k=n(),S=s(k),C=l(),R=u();if(C.attributeKey===R.attributeKey){const T=d(k)[C.attributeKey],E=Ei("from").filter(({type:N})=>N==="enter"),B=xc(E,N=>N.regExp.test(T));if(B){p(k,B.transform({content:T})),z();return}}if(!Tt(S,"splitting",!1)&&!y.__deprecatedOnSplit)return;i(S,c(k))&&(f(),y.preventDefault())}return}y.keyCode===Gr?(A.contentEditable=!1,y.preventDefault(),e()?p(t(),Ee(Mr())):f()):y.keyCode===Mc||y.keyCode===zl?(A.contentEditable=!1,y.preventDefault(),e()?b(t()):o()?h(y.keyCode===zl):g()):y.key.length===1&&!(y.metaKey||y.ctrlKey)&&(A.contentEditable=!1,o()?h(y.keyCode===zl):(y.preventDefault(),A.ownerDocument.defaultView.getSelection().removeAllRanges()))}}function M(y){r()&&(A.contentEditable=!1,o()?h():(y.preventDefault(),A.ownerDocument.defaultView.getSelection().removeAllRanges()))}return A.addEventListener("beforeinput",_),A.addEventListener("keydown",v),A.addEventListener("compositionstart",M),()=>{A.removeEventListener("beforeinput",_),A.removeEventListener("keydown",v),A.removeEventListener("compositionstart",M)}},[])}function R7(){const{getBlockName:e}=G(J),{getBlockType:t}=G(kt),{createSuccessNotice:n}=Oe(mt);return x.useCallback((o,r)=>{let s="";if(o==="copyStyles")s=m("Styles copied to clipboard.");else if(r.length===1){const i=r[0],c=t(e(i))?.title;o==="copy"?s=xe(m('Copied "%s" to clipboard.'),c):s=xe(m('Moved "%s" to clipboard.'),c)}else o==="copy"?s=xe(Dn("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):s=xe(Dn("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(s,{type:"snackbar"})},[n,e,t])}function twt(e){const t="",n=e.indexOf(t);if(n>-1)e=e.substring(n+t.length);else return e;const r=e.indexOf("");return r>-1&&(e=e.substring(0,r)),e}function nwt(e){const t="";return e.startsWith(t)?e.slice(t.length):e}function T7({clipboardData:e}){let t="",n="";try{t=e.getData("text/plain"),n=e.getData("text/html")}catch{return}n=twt(n),n=nwt(n);const o=C4(e);return o.length&&!owt(o,n)?{files:o}:{html:n,plainText:t,files:[]}}function owt(e,t){if(t&&e?.length===1&&e[0].type.indexOf("image/")===0){const n=/<\s*img\b/gi;if(t.match(n)?.length!==1)return!0;const o=/<\s*img\b[^>]*\bsrc="file:\/\//i;if(t.match(o))return!0}return!1}const _me=Symbol("requiresWrapperOnCopy");function kme(e,t,n){let o=t;const[r]=t;if(r&&n.select(kt).getBlockType(r.name)[_me]){const{getBlockRootClientId:c,getBlockName:l,getBlockAttributes:u}=n.select(J),d=c(r.clientId),p=l(d);p&&(o=Ee(p,u(d),o))}const s=Ks(o);e.clipboardData.setData("text/plain",swt(s)),e.clipboardData.setData("text/html",s)}function rwt(e,t){const{plainText:n,html:o,files:r}=T7(e);let s=[];if(r.length){const i=Ei("from");s=r.reduce((c,l)=>{const u=xc(i,d=>d.type==="files"&&d.isMatch([l]));return u&&c.push(u.transform([l])),c},[]).flat()}else s=Xh({HTML:o,plainText:n,mode:"BLOCKS",canUserUseUnfilteredHTML:t});return s}function swt(e){return e=e.replace(/
/g,` `),x1(e).trim().replace(/\n\n+/g,` -`)}function iwt(){const e=Fn(),{getBlocksByClientId:t,getSelectedBlockClientIds:n,hasMultiSelection:o,getSettings:r,getBlockName:s,__unstableIsFullySelected:i,__unstableIsSelectionCollapsed:c,__unstableIsSelectionMergeable:l,__unstableGetSelectedBlocksWithPartialSelection:u,canInsertBlockType:d,getBlockRootClientId:p}=G(J),{flashBlock:f,removeBlocks:b,replaceBlocks:h,__unstableDeleteSelection:g,__unstableExpandSelection:z,__unstableSplitSelection:A}=Oe(J),_=R7();return Mn(v=>{function M(y){if(y.defaultPrevented)return;const k=n();if(k.length===0)return;if(!o()){const{target:E}=y,{ownerDocument:B}=E;if(y.type==="copy"||y.type==="cut"?zSe(B):OSe(B)&&!B.activeElement.isContentEditable)return}const{activeElement:S}=y.target.ownerDocument;if(!v.contains(S))return;const C=l(),R=c()||i(),T=!R&&!C;if(y.type==="copy"||y.type==="cut")if(y.preventDefault(),k.length===1&&f(k[0]),T)z();else{_(y.type,k);let E;if(R)E=t(k);else{const[B,N]=u(),j=t(k.slice(1,k.length-1));E=[B,...j,N]}kme(y,E,e)}if(y.type==="cut")R&&!T?b(k):(y.target.ownerDocument.activeElement.contentEditable=!1,g());else if(y.type==="paste"){const{__experimentalCanUserUseUnfilteredHTML:E}=r();if(y.clipboardData.getData("rich-text")==="true")return;const{plainText:N,html:j,files:I}=T7(y),P=i();let $=[];if(I.length){const V=Ei("from");$=I.reduce((Q,te)=>{const ee=xc(V,ue=>ue.type==="files"&&ue.isMatch([te]));return ee&&Q.push(ee.transform([te])),Q},[]).flat()}else $=Xh({HTML:j,plainText:N,mode:P?"BLOCKS":"AUTO",canUserUseUnfilteredHTML:E});if(typeof $=="string")return;if(P){h(k,$,$.length-1,-1),y.preventDefault();return}if(!o()&&!Et(s(k[0]),"splitting",!1)&&!y.__deprecatedOnSplit)return;const[F]=k,X=p(F),Z=[];for(const V of $)if(d(V.name,X))Z.push(V);else{const Q=s(X),te=V.name!==Q?Kr(V,Q):[V];if(!te)return;for(const ee of te)for(const ue of ee.innerBlocks)Z.push(ue)}A(Z),y.preventDefault()}}return v.ownerDocument.addEventListener("copy",M),v.ownerDocument.addEventListener("cut",M),v.ownerDocument.addEventListener("paste",M),()=>{v.ownerDocument.removeEventListener("copy",M),v.ownerDocument.removeEventListener("cut",M),v.ownerDocument.removeEventListener("paste",M)}},[])}function Sme(){const[e,t,n]=V5t(),o=G(r=>r(J).hasMultiSelection(),[]);return[e,xn([t,iwt(),ewt(),G5t(),Q5t(),J5t(),$5t(),X5t(),U5t(),Mn(r=>(r.tabIndex=0,r.dataset.hasMultiSelection=o,o?(r.setAttribute("aria-label",m("Multiple selected blocks")),()=>{delete r.dataset.hasMultiSelection,r.removeAttribute("aria-label")}):()=>{delete r.dataset.hasMultiSelection}),[o])]),n]}function awt({children:e,...t},n){const[o,r,s]=Sme();return a.jsxs(a.Fragment,{children:[o,a.jsx("div",{...t,ref:xn([r,n]),className:oe(t.className,"block-editor-writing-flow"),children:e}),s]})}const cwt=x.forwardRef(awt);let ev=null;function lwt(){return ev||(ev=Array.from(document.styleSheets).reduce((e,t)=>{try{t.cssRules}catch{return e}const{ownerNode:n,cssRules:o}=t;if(n===null||!o||n.id.startsWith("wp-")||!n.id)return e;function r(s){return Array.from(s).find(({selectorText:i,conditionText:c,cssRules:l})=>c?r(l):i&&(i.includes(".editor-styles-wrapper")||i.includes(".wp-block")))}if(r(o)){const s=n.tagName==="STYLE";if(s){const i=n.id.replace("-inline-css","-css"),c=document.getElementById(i);c&&e.push(c.cloneNode(!0))}if(e.push(n.cloneNode(!0)),!s){const i=n.id.replace("-css","-inline-css"),c=document.getElementById(i);c&&e.push(c.cloneNode(!0))}}return e},[]),ev)}function PQ({frameSize:e,containerWidth:t,maxContainerWidth:n,scaleContainerWidth:o}){return(Math.min(t,n)-e*2)/o}function uwt(e,t){const{scaleValue:n,scrollHeight:o}=e,{frameSize:r,scaleValue:s}=t;return o*(s/n)+r*2}function dwt(e,t){const{containerHeight:n,frameSize:o,scaleValue:r,scrollTop:s}=e,{containerHeight:i,frameSize:c,scaleValue:l,scrollHeight:u}=t;let d=s;d=(d+n/2-o)/r-n/2,d=(d+i/2)*l+c-i/2,d=s<=o?0:d;const p=u-i;return Math.round(Math.min(Math.max(0,d),Math.max(0,p)))}function pwt(e,t){const{scaleValue:n,frameSize:o,scrollTop:r}=e,{scaleValue:s,frameSize:i,scrollTop:c}=t;return[{translate:"0 0",scale:n,paddingTop:`${o/n}px`,paddingBottom:`${o/n}px`},{translate:`0 ${r-c}px`,scale:s,paddingTop:`${i/s}px`,paddingBottom:`${i/s}px`}]}function fwt({frameSize:e,iframeDocument:t,maxContainerWidth:n=750,scale:o}){const[r,{height:s}]=js(),[i,{width:c,height:l}]=js(),u=x.useRef(0),d=o!==1,p=$1(),f=o==="auto-scaled",b=x.useRef(!1),h=x.useRef(null);x.useEffect(()=>{d||(u.current=c)},[c,d]);const g=Math.max(u.current,c),z=f?PQ({frameSize:e,containerWidth:c,maxContainerWidth:n,scaleContainerWidth:g}):o,A=x.useRef({scaleValue:z,frameSize:e,containerHeight:0,scrollTop:0,scrollHeight:0}),_=x.useRef({scaleValue:z,frameSize:e,containerHeight:0,scrollTop:0,scrollHeight:0}),v=x.useCallback(()=>{const{scrollTop:k}=A.current,{scrollTop:S}=_.current;return t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scroll-top",`${k}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scroll-top-next",`${S}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-overflow-behavior",A.current.scrollHeight===A.current.containerHeight?"auto":"scroll"),t.documentElement.classList.add("zoom-out-animation"),t.documentElement.animate(pwt(A.current,_.current),{easing:"cubic-bezier(0.46, 0.03, 0.52, 0.96)",duration:400})},[t]),M=x.useCallback(()=>{b.current=!1,h.current=null,t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scale",_.current.scaleValue),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-frame-size",`${_.current.frameSize}px`),t.documentElement.classList.remove("zoom-out-animation"),t.documentElement.scrollTop=_.current.scrollTop,t.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-scroll-top"),t.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-scroll-top-next"),t.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-overflow-behavior"),A.current=_.current},[t]),y=x.useRef(!1);return x.useEffect(()=>{const k=t&&y.current!==d;if(y.current=d,!!k&&(b.current=!0,!!d))return t.documentElement.classList.add("is-zoomed-out"),()=>{t.documentElement.classList.remove("is-zoomed-out")}},[t,d]),x.useEffect(()=>{if(t&&(f&&A.current.scaleValue!==1&&(A.current.scaleValue=PQ({frameSize:A.current.frameSize,containerWidth:c,maxContainerWidth:n,scaleContainerWidth:c})),z<1&&(b.current||(t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scale",z),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-frame-size",`${e}px`)),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-content-height",`${s}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-inner-height",`${l}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-container-width",`${c}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scale-container-width",`${g}px`)),b.current))if(b.current=!1,h.current){h.current.reverse();const k=A.current,S=_.current;A.current=S,_.current=k}else A.current.scrollTop=t.documentElement.scrollTop,A.current.scrollHeight=t.documentElement.scrollHeight,A.current.containerHeight=l,_.current={scaleValue:z,frameSize:e,containerHeight:t.documentElement.clientHeight},_.current.scrollHeight=uwt(A.current,_.current),_.current.scrollTop=dwt(A.current,_.current),h.current=v(),p?M():h.current.onfinish=M},[v,M,p,f,z,e,t,s,c,l,n,g]),{isZoomedOut:d,scaleContainerWidth:g,contentResizeListener:r,containerResizeListener:i}}function Cme(e,t,n){const o={};for(const i in e)o[i]=e[i];if(e instanceof n.contentDocument.defaultView.MouseEvent){const i=n.getBoundingClientRect();o.clientX+=i.left,o.clientY+=i.top}const r=new t(e.type,o);o.defaultPrevented&&r.preventDefault(),!n.dispatchEvent(r)&&e.preventDefault()}function bwt(e){return Mn(()=>{const{defaultView:t}=e;if(!t)return;const{frameElement:n}=t,o=e.documentElement,r=["dragover","mousemove"],s={};for(const i of r)s[i]=c=>{const u=Object.getPrototypeOf(c).constructor.name,d=window[u];Cme(c,d,n)},o.addEventListener(i,s[i]);return()=>{for(const i of r)o.removeEventListener(i,s[i])}})}function hwt({contentRef:e,children:t,tabIndex:n=0,scale:o=1,frameSize:r=0,readonly:s,forwardedRef:i,title:c=m("Editor canvas"),...l}){const{resolvedAssets:u,isPreviewMode:d}=G($=>{const{getSettings:F}=$(J),X=F();return{resolvedAssets:X.__unstableResolvedAssets,isPreviewMode:X.isPreviewMode}},[]),{styles:p="",scripts:f=""}=u,[b,h]=x.useState(),[g,z]=x.useState([]),A=q7(),[_,v,M]=Sme(),y=Mn($=>{$._load=()=>{h($.contentDocument)};let F;function X(V){V.preventDefault()}function Z(){const{contentDocument:V,ownerDocument:Q}=$,{documentElement:te}=V;F=V,te.classList.add("block-editor-iframe__html"),A(te),z(Array.from(Q.body.classList).filter(ee=>ee.startsWith("admin-color-")||ee.startsWith("post-type-")||ee==="wp-embed-responsive")),V.dir=Q.dir;for(const ee of lwt())V.getElementById(ee.id)||(V.head.appendChild(ee.cloneNode(!0)),d||console.warn(`${ee.id} was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,ee));F.addEventListener("dragover",X,!1),F.addEventListener("drop",X,!1),F.addEventListener("click",ee=>{if(ee.target.tagName==="A"){ee.preventDefault();const ue=ee.target.getAttribute("href");ue?.startsWith("#")&&(F.defaultView.location.hash=ue.slice(1))}})}return $.addEventListener("load",Z),()=>{delete $._load,$.removeEventListener("load",Z),F?.removeEventListener("dragover",X),F?.removeEventListener("drop",X)}},[]),{contentResizeListener:k,containerResizeListener:S,isZoomedOut:C,scaleContainerWidth:R}=fwt({scale:o,frameSize:parseInt(r),iframeDocument:b}),T=$N({isDisabled:!s}),E=xn([bwt(b),e,A,v,T]),B=` +`)}function iwt(){const e=Fn(),{getBlocksByClientId:t,getSelectedBlockClientIds:n,hasMultiSelection:o,getSettings:r,getBlockName:s,__unstableIsFullySelected:i,__unstableIsSelectionCollapsed:c,__unstableIsSelectionMergeable:l,__unstableGetSelectedBlocksWithPartialSelection:u,canInsertBlockType:d,getBlockRootClientId:p}=G(J),{flashBlock:f,removeBlocks:b,replaceBlocks:h,__unstableDeleteSelection:g,__unstableExpandSelection:z,__unstableSplitSelection:A}=Oe(J),_=R7();return Mn(v=>{function M(y){if(y.defaultPrevented)return;const k=n();if(k.length===0)return;if(!o()){const{target:E}=y,{ownerDocument:B}=E;if(y.type==="copy"||y.type==="cut"?C6e(B):q6e(B)&&!B.activeElement.isContentEditable)return}const{activeElement:S}=y.target.ownerDocument;if(!v.contains(S))return;const C=l(),R=c()||i(),T=!R&&!C;if(y.type==="copy"||y.type==="cut")if(y.preventDefault(),k.length===1&&f(k[0]),T)z();else{_(y.type,k);let E;if(R)E=t(k);else{const[B,N]=u(),j=t(k.slice(1,k.length-1));E=[B,...j,N]}kme(y,E,e)}if(y.type==="cut")R&&!T?b(k):(y.target.ownerDocument.activeElement.contentEditable=!1,g());else if(y.type==="paste"){const{__experimentalCanUserUseUnfilteredHTML:E}=r();if(y.clipboardData.getData("rich-text")==="true")return;const{plainText:N,html:j,files:I}=T7(y),P=i();let $=[];if(I.length){const V=Ei("from");$=I.reduce((Q,te)=>{const ee=xc(V,ue=>ue.type==="files"&&ue.isMatch([te]));return ee&&Q.push(ee.transform([te])),Q},[]).flat()}else $=Xh({HTML:j,plainText:N,mode:P?"BLOCKS":"AUTO",canUserUseUnfilteredHTML:E});if(typeof $=="string")return;if(P){h(k,$,$.length-1,-1),y.preventDefault();return}if(!o()&&!Tt(s(k[0]),"splitting",!1)&&!y.__deprecatedOnSplit)return;const[F]=k,X=p(F),Z=[];for(const V of $)if(d(V.name,X))Z.push(V);else{const Q=s(X),te=V.name!==Q?Kr(V,Q):[V];if(!te)return;for(const ee of te)for(const ue of ee.innerBlocks)Z.push(ue)}A(Z),y.preventDefault()}}return v.ownerDocument.addEventListener("copy",M),v.ownerDocument.addEventListener("cut",M),v.ownerDocument.addEventListener("paste",M),()=>{v.ownerDocument.removeEventListener("copy",M),v.ownerDocument.removeEventListener("cut",M),v.ownerDocument.removeEventListener("paste",M)}},[])}function Sme(){const[e,t,n]=V5t(),o=G(r=>r(J).hasMultiSelection(),[]);return[e,xn([t,iwt(),ewt(),G5t(),Q5t(),J5t(),$5t(),X5t(),U5t(),Mn(r=>(r.tabIndex=0,r.dataset.hasMultiSelection=o,o?(r.setAttribute("aria-label",m("Multiple selected blocks")),()=>{delete r.dataset.hasMultiSelection,r.removeAttribute("aria-label")}):()=>{delete r.dataset.hasMultiSelection}),[o])]),n]}function awt({children:e,...t},n){const[o,r,s]=Sme();return a.jsxs(a.Fragment,{children:[o,a.jsx("div",{...t,ref:xn([r,n]),className:oe(t.className,"block-editor-writing-flow"),children:e}),s]})}const cwt=x.forwardRef(awt);let ev=null;function lwt(){return ev||(ev=Array.from(document.styleSheets).reduce((e,t)=>{try{t.cssRules}catch{return e}const{ownerNode:n,cssRules:o}=t;if(n===null||!o||n.id.startsWith("wp-")||!n.id)return e;function r(s){return Array.from(s).find(({selectorText:i,conditionText:c,cssRules:l})=>c?r(l):i&&(i.includes(".editor-styles-wrapper")||i.includes(".wp-block")))}if(r(o)){const s=n.tagName==="STYLE";if(s){const i=n.id.replace("-inline-css","-css"),c=document.getElementById(i);c&&e.push(c.cloneNode(!0))}if(e.push(n.cloneNode(!0)),!s){const i=n.id.replace("-css","-inline-css"),c=document.getElementById(i);c&&e.push(c.cloneNode(!0))}}return e},[]),ev)}function PQ({frameSize:e,containerWidth:t,maxContainerWidth:n,scaleContainerWidth:o}){return(Math.min(t,n)-e*2)/o}function uwt(e,t){const{scaleValue:n,scrollHeight:o}=e,{frameSize:r,scaleValue:s}=t;return o*(s/n)+r*2}function dwt(e,t){const{containerHeight:n,frameSize:o,scaleValue:r,scrollTop:s}=e,{containerHeight:i,frameSize:c,scaleValue:l,scrollHeight:u}=t;let d=s;d=(d+n/2-o)/r-n/2,d=(d+i/2)*l+c-i/2,d=s<=o?0:d;const p=u-i;return Math.round(Math.min(Math.max(0,d),Math.max(0,p)))}function pwt(e,t){const{scaleValue:n,frameSize:o,scrollTop:r}=e,{scaleValue:s,frameSize:i,scrollTop:c}=t;return[{translate:"0 0",scale:n,paddingTop:`${o/n}px`,paddingBottom:`${o/n}px`},{translate:`0 ${r-c}px`,scale:s,paddingTop:`${i/s}px`,paddingBottom:`${i/s}px`}]}function fwt({frameSize:e,iframeDocument:t,maxContainerWidth:n=750,scale:o}){const[r,{height:s}]=js(),[i,{width:c,height:l}]=js(),u=x.useRef(0),d=o!==1,p=$1(),f=o==="auto-scaled",b=x.useRef(!1),h=x.useRef(null);x.useEffect(()=>{d||(u.current=c)},[c,d]);const g=Math.max(u.current,c),z=f?PQ({frameSize:e,containerWidth:c,maxContainerWidth:n,scaleContainerWidth:g}):o,A=x.useRef({scaleValue:z,frameSize:e,containerHeight:0,scrollTop:0,scrollHeight:0}),_=x.useRef({scaleValue:z,frameSize:e,containerHeight:0,scrollTop:0,scrollHeight:0}),v=x.useCallback(()=>{const{scrollTop:k}=A.current,{scrollTop:S}=_.current;return t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scroll-top",`${k}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scroll-top-next",`${S}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-overflow-behavior",A.current.scrollHeight===A.current.containerHeight?"auto":"scroll"),t.documentElement.classList.add("zoom-out-animation"),t.documentElement.animate(pwt(A.current,_.current),{easing:"cubic-bezier(0.46, 0.03, 0.52, 0.96)",duration:400})},[t]),M=x.useCallback(()=>{b.current=!1,h.current=null,t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scale",_.current.scaleValue),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-frame-size",`${_.current.frameSize}px`),t.documentElement.classList.remove("zoom-out-animation"),t.documentElement.scrollTop=_.current.scrollTop,t.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-scroll-top"),t.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-scroll-top-next"),t.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-overflow-behavior"),A.current=_.current},[t]),y=x.useRef(!1);return x.useEffect(()=>{const k=t&&y.current!==d;if(y.current=d,!!k&&(b.current=!0,!!d))return t.documentElement.classList.add("is-zoomed-out"),()=>{t.documentElement.classList.remove("is-zoomed-out")}},[t,d]),x.useEffect(()=>{if(t&&(f&&A.current.scaleValue!==1&&(A.current.scaleValue=PQ({frameSize:A.current.frameSize,containerWidth:c,maxContainerWidth:n,scaleContainerWidth:c})),z<1&&(b.current||(t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scale",z),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-frame-size",`${e}px`)),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-content-height",`${s}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-inner-height",`${l}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-container-width",`${c}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scale-container-width",`${g}px`)),b.current))if(b.current=!1,h.current){h.current.reverse();const k=A.current,S=_.current;A.current=S,_.current=k}else A.current.scrollTop=t.documentElement.scrollTop,A.current.scrollHeight=t.documentElement.scrollHeight,A.current.containerHeight=l,_.current={scaleValue:z,frameSize:e,containerHeight:t.documentElement.clientHeight},_.current.scrollHeight=uwt(A.current,_.current),_.current.scrollTop=dwt(A.current,_.current),h.current=v(),p?M():h.current.onfinish=M},[v,M,p,f,z,e,t,s,c,l,n,g]),{isZoomedOut:d,scaleContainerWidth:g,contentResizeListener:r,containerResizeListener:i}}function Cme(e,t,n){const o={};for(const i in e)o[i]=e[i];if(e instanceof n.contentDocument.defaultView.MouseEvent){const i=n.getBoundingClientRect();o.clientX+=i.left,o.clientY+=i.top}const r=new t(e.type,o);o.defaultPrevented&&r.preventDefault(),!n.dispatchEvent(r)&&e.preventDefault()}function bwt(e){return Mn(()=>{const{defaultView:t}=e;if(!t)return;const{frameElement:n}=t,o=e.documentElement,r=["dragover","mousemove"],s={};for(const i of r)s[i]=c=>{const u=Object.getPrototypeOf(c).constructor.name,d=window[u];Cme(c,d,n)},o.addEventListener(i,s[i]);return()=>{for(const i of r)o.removeEventListener(i,s[i])}})}function hwt({contentRef:e,children:t,tabIndex:n=0,scale:o=1,frameSize:r=0,readonly:s,forwardedRef:i,title:c=m("Editor canvas"),...l}){const{resolvedAssets:u,isPreviewMode:d}=G($=>{const{getSettings:F}=$(J),X=F();return{resolvedAssets:X.__unstableResolvedAssets,isPreviewMode:X.isPreviewMode}},[]),{styles:p="",scripts:f=""}=u,[b,h]=x.useState(),[g,z]=x.useState([]),A=q7(),[_,v,M]=Sme(),y=Mn($=>{$._load=()=>{h($.contentDocument)};let F;function X(V){V.preventDefault()}function Z(){const{contentDocument:V,ownerDocument:Q}=$,{documentElement:te}=V;F=V,te.classList.add("block-editor-iframe__html"),A(te),z(Array.from(Q.body.classList).filter(ee=>ee.startsWith("admin-color-")||ee.startsWith("post-type-")||ee==="wp-embed-responsive")),V.dir=Q.dir;for(const ee of lwt())V.getElementById(ee.id)||(V.head.appendChild(ee.cloneNode(!0)),d||console.warn(`${ee.id} was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,ee));F.addEventListener("dragover",X,!1),F.addEventListener("drop",X,!1),F.addEventListener("click",ee=>{if(ee.target.tagName==="A"){ee.preventDefault();const ue=ee.target.getAttribute("href");ue?.startsWith("#")&&(F.defaultView.location.hash=ue.slice(1))}})}return $.addEventListener("load",Z),()=>{delete $._load,$.removeEventListener("load",Z),F?.removeEventListener("dragover",X),F?.removeEventListener("drop",X)}},[]),{contentResizeListener:k,containerResizeListener:S,isZoomedOut:C,scaleContainerWidth:R}=fwt({scale:o,frameSize:parseInt(r),iframeDocument:b}),T=jN({isDisabled:!s}),E=xn([bwt(b),e,A,v,T]),B=` @@ -545,7 +545,7 @@ The screen with id ${t.id} will not be added.`),e):[...e,t]}function Bbt({screen `)&&(s=s.replace(/[^\n]+$/,"")),!1}),s&&(s=s.replace(/\S/g,"")),s}rawColon(r){let s;return r.walkDecls(i=>{if(typeof i.raws.between<"u")return s=i.raws.between.replace(/[^\s:]/g,""),!1}),s}rawEmptyBody(r){let s;return r.walk(i=>{if(i.nodes&&i.nodes.length===0&&(s=i.raws.after,typeof s<"u"))return!1}),s}rawIndent(r){if(r.raws.indent)return r.raws.indent;let s;return r.walk(i=>{let c=i.parent;if(c&&c!==r&&c.parent&&c.parent===r&&typeof i.raws.before<"u"){let l=i.raws.before.split(` `);return s=l[l.length-1],s=s.replace(/\S/g,""),!1}}),s}rawSemicolon(r){let s;return r.walk(i=>{if(i.nodes&&i.nodes.length&&i.last.type==="decl"&&(s=i.raws.semicolon,typeof s<"u"))return!1}),s}rawValue(r,s){let i=r[s],c=r.raws[s];return c&&c.value===i?c.raw:i}root(r){this.body(r),r.raws.after&&this.builder(r.raws.after)}rule(r){this.block(r,this.rawValue(r,"selector")),r.raws.ownSemicolon&&this.builder(r.raws.ownSemicolon,r,"end")}stringify(r,s){if(!this[r.type])throw new Error("Unknown AST node type "+r.type+". Maybe you need to change PostCSS stringifier.");this[r.type](r,s)}}return Oq=n,n.default=n,Oq}var yq,$Q;function W7(){if($Q)return yq;$Q=1;let e=Rme();function t(n,o){new e(o).stringify(n)}return yq=t,t.default=t,yq}var nv={},VQ;function N7(){return VQ||(VQ=1,nv.isClean=Symbol("isClean"),nv.my=Symbol("my")),nv}var Aq,HQ;function B7(){if(HQ)return Aq;HQ=1;let e=E7(),t=Rme(),n=W7(),{isClean:o,my:r}=N7();function s(l,u){let d=new l.constructor;for(let p in l){if(!Object.prototype.hasOwnProperty.call(l,p)||p==="proxyCache")continue;let f=l[p],b=typeof f;p==="parent"&&b==="object"?u&&(d[p]=u):p==="source"?d[p]=f:Array.isArray(f)?d[p]=f.map(h=>s(h,d)):(b==="object"&&f!==null&&(f=s(f)),d[p]=f)}return d}function i(l,u){if(u&&typeof u.offset<"u")return u.offset;let d=1,p=1,f=0;for(let b=0;bu.root().toProxy():u[d]},set(u,d,p){return u[d]===p||(u[d]=p,(d==="prop"||d==="value"||d==="name"||d==="params"||d==="important"||d==="text")&&u.markDirty()),!0}}}markClean(){this[o]=!0}markDirty(){if(this[o]){this[o]=!1;let u=this;for(;u=u.parent;)u[o]=!1}}next(){if(!this.parent)return;let u=this.parent.index(this);return this.parent.nodes[u+1]}positionBy(u){let d=this.source.start;if(u.index)d=this.positionInside(u.index);else if(u.word){let f=this.source.input.css.slice(i(this.source.input.css,this.source.start),i(this.source.input.css,this.source.end)).indexOf(u.word);f!==-1&&(d=this.positionInside(f))}return d}positionInside(u){let d=this.source.start.column,p=this.source.start.line,f=i(this.source.input.css,this.source.start),b=f+u;for(let h=f;htypeof z=="object"&&z.toJSON?z.toJSON(null,d):z);else if(typeof g=="object"&&g.toJSON)p[h]=g.toJSON(null,d);else if(h==="source"){let z=d.get(g.input);z==null&&(z=b,d.set(g.input,b),b++),p[h]={end:g.end,inputId:z,start:g.start}}else p[h]=g}return f&&(p.inputs=[...d.keys()].map(h=>h.toJSON())),p}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(u=n){u.stringify&&(u=u.stringify);let d="";return u(this,p=>{d+=p}),d}warn(u,d,p){let f={node:this};for(let b in p)f[b]=p[b];return u.warn(d,f)}get proxyOf(){return this}}return Aq=c,c.default=c,Aq}var vq,UQ;function Tme(){if(UQ)return vq;UQ=1;let e=B7();class t extends e{constructor(o){super(o),this.type="comment"}}return vq=t,t.default=t,vq}var xq,XQ;function Eme(){if(XQ)return xq;XQ=1;let e=B7();class t extends e{constructor(o){o&&typeof o.value<"u"&&typeof o.value!="string"&&(o={...o,value:String(o.value)}),super(o),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}}return xq=t,t.default=t,xq}var wq,GQ;function Am(){if(GQ)return wq;GQ=1;let e=Tme(),t=Eme(),n=B7(),{isClean:o,my:r}=N7(),s,i,c,l;function u(f){return f.map(b=>(b.nodes&&(b.nodes=u(b.nodes)),delete b.source,b))}function d(f){if(f[o]=!1,f.proxyOf.nodes)for(let b of f.proxyOf.nodes)d(b)}class p extends n{append(...b){for(let h of b){let g=this.normalize(h,this.last);for(let z of g)this.proxyOf.nodes.push(z)}return this.markDirty(),this}cleanRaws(b){if(super.cleanRaws(b),this.nodes)for(let h of this.nodes)h.cleanRaws(b)}each(b){if(!this.proxyOf.nodes)return;let h=this.getIterator(),g,z;for(;this.indexes[h]b[h](...g.map(z=>typeof z=="function"?(A,_)=>z(A.toProxy(),_):z)):h==="every"||h==="some"?g=>b[h]((z,...A)=>g(z.toProxy(),...A)):h==="root"?()=>b.root().toProxy():h==="nodes"?b.nodes.map(g=>g.toProxy()):h==="first"||h==="last"?b[h].toProxy():b[h]:b[h]},set(b,h,g){return b[h]===g||(b[h]=g,(h==="name"||h==="params"||h==="selector")&&b.markDirty()),!0}}}index(b){return typeof b=="number"?b:(b.proxyOf&&(b=b.proxyOf),this.proxyOf.nodes.indexOf(b))}insertAfter(b,h){let g=this.index(b),z=this.normalize(h,this.proxyOf.nodes[g]).reverse();g=this.index(b);for(let _ of z)this.proxyOf.nodes.splice(g+1,0,_);let A;for(let _ in this.indexes)A=this.indexes[_],g"u")b=[];else if(Array.isArray(b)){b=b.slice(0);for(let z of b)z.parent&&z.parent.removeChild(z,"ignore")}else if(b.type==="root"&&this.type!=="document"){b=b.nodes.slice(0);for(let z of b)z.parent&&z.parent.removeChild(z,"ignore")}else if(b.type)b=[b];else if(b.prop){if(typeof b.value>"u")throw new Error("Value field is missed in node creation");typeof b.value!="string"&&(b.value=String(b.value)),b=[new t(b)]}else if(b.selector||b.selectors)b=[new l(b)];else if(b.name)b=[new s(b)];else if(b.text)b=[new e(b)];else throw new Error("Unknown node type in node creation");return b.map(z=>(z[r]||p.rebuild(z),z=z.proxyOf,z.parent&&z.parent.removeChild(z),z[o]&&d(z),z.raws||(z.raws={}),typeof z.raws.before>"u"&&h&&typeof h.raws.before<"u"&&(z.raws.before=h.raws.before.replace(/\S/g,"")),z.parent=this.proxyOf,z))}prepend(...b){b=b.reverse();for(let h of b){let g=this.normalize(h,this.first,"prepend").reverse();for(let z of g)this.proxyOf.nodes.unshift(z);for(let z in this.indexes)this.indexes[z]=this.indexes[z]+g.length}return this.markDirty(),this}push(b){return b.parent=this,this.proxyOf.nodes.push(b),this}removeAll(){for(let b of this.proxyOf.nodes)b.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(b){b=this.index(b),this.proxyOf.nodes[b].parent=void 0,this.proxyOf.nodes.splice(b,1);let h;for(let g in this.indexes)h=this.indexes[g],h>=b&&(this.indexes[g]=h-1);return this.markDirty(),this}replaceValues(b,h,g){return g||(g=h,h={}),this.walkDecls(z=>{h.props&&!h.props.includes(z.prop)||h.fast&&!z.value.includes(h.fast)||(z.value=z.value.replace(b,g))}),this.markDirty(),this}some(b){return this.nodes.some(b)}walk(b){return this.each((h,g)=>{let z;try{z=b(h,g)}catch(A){throw h.addToError(A)}return z!==!1&&h.walk&&(z=h.walk(b)),z})}walkAtRules(b,h){return h?b instanceof RegExp?this.walk((g,z)=>{if(g.type==="atrule"&&b.test(g.name))return h(g,z)}):this.walk((g,z)=>{if(g.type==="atrule"&&g.name===b)return h(g,z)}):(h=b,this.walk((g,z)=>{if(g.type==="atrule")return h(g,z)}))}walkComments(b){return this.walk((h,g)=>{if(h.type==="comment")return b(h,g)})}walkDecls(b,h){return h?b instanceof RegExp?this.walk((g,z)=>{if(g.type==="decl"&&b.test(g.prop))return h(g,z)}):this.walk((g,z)=>{if(g.type==="decl"&&g.prop===b)return h(g,z)}):(h=b,this.walk((g,z)=>{if(g.type==="decl")return h(g,z)}))}walkRules(b,h){return h?b instanceof RegExp?this.walk((g,z)=>{if(g.type==="rule"&&b.test(g.selector))return h(g,z)}):this.walk((g,z)=>{if(g.type==="rule"&&g.selector===b)return h(g,z)}):(h=b,this.walk((g,z)=>{if(g.type==="rule")return h(g,z)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return p.registerParse=f=>{i=f},p.registerRule=f=>{l=f},p.registerAtRule=f=>{s=f},p.registerRoot=f=>{c=f},wq=p,p.default=p,p.rebuild=f=>{f.type==="atrule"?Object.setPrototypeOf(f,s.prototype):f.type==="rule"?Object.setPrototypeOf(f,l.prototype):f.type==="decl"?Object.setPrototypeOf(f,t.prototype):f.type==="comment"?Object.setPrototypeOf(f,e.prototype):f.type==="root"&&Object.setPrototypeOf(f,c.prototype),f[r]=!0,f.nodes&&f.nodes.forEach(b=>{p.rebuild(b)})},wq}var _q,KQ;function Wme(){if(KQ)return _q;KQ=1;let e=Am(),t,n;class o extends e{constructor(s){super({type:"document",...s}),this.nodes||(this.nodes=[])}toResult(s={}){return new t(new n,this,s).stringify()}}return o.registerLazyResult=r=>{t=r},o.registerProcessor=r=>{n=r},_q=o,o.default=o,_q}var kq,YQ;function L7(){if(YQ)return kq;YQ=1;function e(r){if(typeof r!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(r))}function t(r,s){for(var i="",c=0,l=-1,u=0,d,p=0;p<=r.length;++p){if(p2){var f=i.lastIndexOf("/");if(f!==i.length-1){f===-1?(i="",c=0):(i=i.slice(0,f),c=i.length-1-i.lastIndexOf("/")),l=p,u=0;continue}}else if(i.length===2||i.length===1){i="",c=0,l=p,u=0;continue}}s&&(i.length>0?i+="/..":i="..",c=2)}else i.length>0?i+="/"+r.slice(l+1,p):i=r.slice(l+1,p),c=p-l-1;l=p,u=0}else d===46&&u!==-1?++u:u=-1}return i}function n(r,s){var i=s.dir||s.root,c=s.base||(s.name||"")+(s.ext||"");return i?i===s.root?i+c:i+r+c:c}var o={resolve:function(){for(var s="",i=!1,c,l=arguments.length-1;l>=-1&&!i;l--){var u;l>=0?u=arguments[l]:(c===void 0&&(c=Oi.cwd()),u=c),e(u),u.length!==0&&(s=u+"/"+s,i=u.charCodeAt(0)===47)}return s=t(s,!i),i?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(s){if(e(s),s.length===0)return".";var i=s.charCodeAt(0)===47,c=s.charCodeAt(s.length-1)===47;return s=t(s,!i),s.length===0&&!i&&(s="."),s.length>0&&c&&(s+="/"),i?"/"+s:s},isAbsolute:function(s){return e(s),s.length>0&&s.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var s,i=0;i0&&(s===void 0?s=c:s+="/"+c)}return s===void 0?".":o.normalize(s)},relative:function(s,i){if(e(s),e(i),s===i||(s=o.resolve(s),i=o.resolve(i),s===i))return"";for(var c=1;cb){if(i.charCodeAt(d+g)===47)return i.slice(d+g+1);if(g===0)return i.slice(d+g)}else u>b&&(s.charCodeAt(c+g)===47?h=g:g===0&&(h=0));break}var z=s.charCodeAt(c+g),A=i.charCodeAt(d+g);if(z!==A)break;z===47&&(h=g)}var _="";for(g=c+h+1;g<=l;++g)(g===l||s.charCodeAt(g)===47)&&(_.length===0?_+="..":_+="/..");return _.length>0?_+i.slice(d+h):(d+=h,i.charCodeAt(d)===47&&++d,i.slice(d))},_makeLong:function(s){return s},dirname:function(s){if(e(s),s.length===0)return".";for(var i=s.charCodeAt(0),c=i===47,l=-1,u=!0,d=s.length-1;d>=1;--d)if(i=s.charCodeAt(d),i===47){if(!u){l=d;break}}else u=!1;return l===-1?c?"/":".":c&&l===1?"//":s.slice(0,l)},basename:function(s,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');e(s);var c=0,l=-1,u=!0,d;if(i!==void 0&&i.length>0&&i.length<=s.length){if(i.length===s.length&&i===s)return"";var p=i.length-1,f=-1;for(d=s.length-1;d>=0;--d){var b=s.charCodeAt(d);if(b===47){if(!u){c=d+1;break}}else f===-1&&(u=!1,f=d+1),p>=0&&(b===i.charCodeAt(p)?--p===-1&&(l=d):(p=-1,l=f))}return c===l?l=f:l===-1&&(l=s.length),s.slice(c,l)}else{for(d=s.length-1;d>=0;--d)if(s.charCodeAt(d)===47){if(!u){c=d+1;break}}else l===-1&&(u=!1,l=d+1);return l===-1?"":s.slice(c,l)}},extname:function(s){e(s);for(var i=-1,c=0,l=-1,u=!0,d=0,p=s.length-1;p>=0;--p){var f=s.charCodeAt(p);if(f===47){if(!u){c=p+1;break}continue}l===-1&&(u=!1,l=p+1),f===46?i===-1?i=p:d!==1&&(d=1):i!==-1&&(d=-1)}return i===-1||l===-1||d===0||d===1&&i===l-1&&i===c+1?"":s.slice(i,l)},format:function(s){if(s===null||typeof s!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof s);return n("/",s)},parse:function(s){e(s);var i={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return i;var c=s.charCodeAt(0),l=c===47,u;l?(i.root="/",u=1):u=0;for(var d=-1,p=0,f=-1,b=!0,h=s.length-1,g=0;h>=u;--h){if(c=s.charCodeAt(h),c===47){if(!b){p=h+1;break}continue}f===-1&&(b=!1,f=h+1),c===46?d===-1?d=h:g!==1&&(g=1):d!==-1&&(g=-1)}return d===-1||f===-1||g===0||g===1&&d===f-1&&d===p+1?f!==-1&&(p===0&&l?i.base=i.name=s.slice(1,f):i.base=i.name=s.slice(p,f)):(p===0&&l?(i.name=s.slice(1,d),i.base=s.slice(1,f)):(i.name=s.slice(p,d),i.base=s.slice(p,f)),i.ext=s.slice(d,f)),p>0?i.dir=s.slice(0,p-1):l&&(i.dir="/"),i},sep:"/",delimiter:":",win32:null,posix:null};return o.posix=o,kq=o,kq}var dM={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var kwt=dM.exports,ZQ;function Swt(){return ZQ||(ZQ=1,function(e,t){(function(n){var o=t&&!t.nodeType&&t,r=e&&!e.nodeType&&e,s=typeof p1=="object"&&p1;(s.global===s||s.window===s||s.self===s)&&(n=s);var i,c=2147483647,l=36,u=1,d=26,p=38,f=700,b=72,h=128,g="-",z=/^xn--/,A=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,v={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},M=l-u,y=Math.floor,k=String.fromCharCode,S;function C(Z){throw new RangeError(v[Z])}function R(Z,V){for(var Q=Z.length,te=[];Q--;)te[Q]=V(Z[Q]);return te}function T(Z,V){var Q=Z.split("@"),te="";Q.length>1&&(te=Q[0]+"@",Z=Q[1]),Z=Z.replace(_,".");var ee=Z.split("."),ue=R(ee,V).join(".");return te+ue}function E(Z){for(var V=[],Q=0,te=Z.length,ee,ue;Q=55296&&ee<=56319&&Q65535&&(V-=65536,Q+=k(V>>>10&1023|55296),V=56320|V&1023),Q+=k(V),Q}).join("")}function N(Z){return Z-48<10?Z-22:Z-65<26?Z-65:Z-97<26?Z-97:l}function j(Z,V){return Z+22+75*(Z<26)-((V!=0)<<5)}function I(Z,V,Q){var te=0;for(Z=Q?y(Z/f):Z>>1,Z+=y(Z/V);Z>M*d>>1;te+=l)Z=y(Z/M);return y(te+(M+1)*Z/(Z+p))}function P(Z){var V=[],Q=Z.length,te,ee=0,ue=h,ce=b,me,de,Ae,ye,Ne,je,ie,we,re;for(me=Z.lastIndexOf(g),me<0&&(me=0),de=0;de=128&&C("not-basic"),V.push(Z.charCodeAt(de));for(Ae=me>0?me+1:0;Ae=Q&&C("invalid-input"),ie=N(Z.charCodeAt(Ae++)),(ie>=l||ie>y((c-ee)/Ne))&&C("overflow"),ee+=ie*Ne,we=je<=ce?u:je>=ce+d?d:je-ce,!(iey(c/re)&&C("overflow"),Ne*=re;te=V.length+1,ce=I(ee-ye,te,ye==0),y(ee/te)>c-ue&&C("overflow"),ue+=y(ee/te),ee%=te,V.splice(ee++,0,ue)}return B(V)}function $(Z){var V,Q,te,ee,ue,ce,me,de,Ae,ye,Ne,je=[],ie,we,re,pe;for(Z=E(Z),ie=Z.length,V=h,Q=0,ue=b,ce=0;ce=V&&Ney((c-Q)/we)&&C("overflow"),Q+=(me-V)*we,V=me,ce=0;cec&&C("overflow"),Ne==V){for(de=Q,Ae=l;ye=Ae<=ue?u:Ae>=ue+d?d:Ae-ue,!(de-1e3&&be<1e3||k.call(/e/,ze))return ze;var nt=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof be=="number"){var Mt=be<0?-T(-be):T(be);if(Mt!==be){var ot=String(Mt),Ue=_.call(ze,ot.length+1);return v.call(ot,nt,"$&_")+"."+v.call(v.call(Ue,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(ze,nt,"$&_")}var X=_h,Z=X.custom,V=ie(Z)?Z:null,Q={__proto__:null,double:'"',single:"'"},te={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Cq=function be(ze,nt,Mt,ot){var Ue=nt||{};if(pe(Ue,"quoteStyle")&&!pe(Q,Ue.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(pe(Ue,"maxStringLength")&&(typeof Ue.maxStringLength=="number"?Ue.maxStringLength<0&&Ue.maxStringLength!==1/0:Ue.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var yt=pe(Ue,"customInspect")?Ue.customInspect:!0;if(typeof yt!="boolean"&&yt!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(pe(Ue,"indent")&&Ue.indent!==null&&Ue.indent!==" "&&!(parseInt(Ue.indent,10)===Ue.indent&&Ue.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(pe(Ue,"numericSeparator")&&typeof Ue.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var fn=Ue.numericSeparator;if(typeof ze>"u")return"undefined";if(ze===null)return"null";if(typeof ze=="boolean")return ze?"true":"false";if(typeof ze=="string")return rt(ze,Ue);if(typeof ze=="number"){if(ze===0)return 1/0/ze>0?"0":"-0";var Ln=String(ze);return fn?F(ze,Ln):Ln}if(typeof ze=="bigint"){var Mo=String(ze)+"n";return fn?F(ze,Mo):Mo}var rr=typeof Ue.depth>"u"?5:Ue.depth;if(typeof Mt>"u"&&(Mt=0),Mt>=rr&&rr>0&&typeof ze=="object")return ce(ze)?"[Array]":"[Object]";var Jo=Y(Ue,Mt);if(typeof ot>"u")ot=[];else if(se(ot,ze)>=0)return"[Circular]";function To(_s,Xi,gb){if(Xi&&(ot=R.call(ot),ot.push(Xi)),gb){var hp={depth:Ue.depth};return pe(Ue,"quoteStyle")&&(hp.quoteStyle=Ue.quoteStyle),be(_s,hp,Mt+1,ot)}return be(_s,Ue,Mt+1,ot)}if(typeof ze=="function"&&!de(ze)){var Br=Se(ze),Rt=Re(ze,To);return"[Function"+(Br?": "+Br:" (anonymous)")+"]"+(Rt.length>0?" { "+C.call(Rt,", ")+" }":"")}if(ie(ze)){var Qe=j?v.call(String(ze),/^(Symbol\(.*\))_[^)]*$/,"$1"):N.call(ze);return typeof ze=="object"&&!j?wt(Qe):Qe}if(Pe(ze)){for(var xt="<"+y.call(String(ze.nodeName)),Gt=ze.attributes||[],On=0;On",xt}if(ce(ze)){if(ze.length===0)return"[]";var $n=Re(ze,To);return Jo&&!H($n)?"["+fe($n,Jo)+"]":"[ "+C.call($n,", ")+" ]"}if(Ae(ze)){var Jn=Re(ze,To);return!("cause"in Error.prototype)&&"cause"in ze&&!P.call(ze,"cause")?"{ ["+String(ze)+"] "+C.call(S.call("[cause]: "+To(ze.cause),Jn),", ")+" }":Jn.length===0?"["+String(ze)+"]":"{ ["+String(ze)+"] "+C.call(Jn,", ")+" }"}if(typeof ze=="object"&&yt){if(V&&typeof ze[V]=="function"&&X)return X(ze,{depth:rr-Mt});if(yt!=="symbol"&&typeof ze.inspect=="function")return ze.inspect()}if(L(ze)){var pr=[];return o&&o.call(ze,function(_s,Xi){pr.push(To(Xi,ze,!0)+" => "+To(_s,ze))}),ae("Map",n.call(ze),pr,Jo)}if(ve(ze)){var O0=[];return c&&c.call(ze,function(_s){O0.push(To(_s,ze))}),ae("Set",i.call(ze),O0,Jo)}if(U(ze))return Bt("WeakMap");if(qe(ze))return Bt("WeakSet");if(ne(ze))return Bt("WeakRef");if(Ne(ze))return wt(To(Number(ze)));if(we(ze))return wt(To(E.call(ze)));if(je(ze))return wt(h.call(ze));if(ye(ze))return wt(To(String(ze)));if(typeof window<"u"&&ze===window)return"{ [object Window] }";if(typeof globalThis<"u"&&ze===globalThis||typeof p1<"u"&&ze===p1)return"{ [object globalThis] }";if(!me(ze)&&!de(ze)){var o1=Re(ze,To),yr=$?$(ze)===Object.prototype:ze instanceof Object||ze.constructor===Object,Js=ze instanceof Object?"":"null prototype",ao=!yr&&I&&Object(ze)===ze&&I in ze?_.call(ke(ze),8,-1):Js?"Object":"",Ic=yr||typeof ze.constructor!="function"?"":ze.constructor.name?ze.constructor.name+" ":"",Ui=Ic+(ao||Js?"["+C.call(S.call([],ao||[],Js||[]),": ")+"] ":"");return o1.length===0?Ui+"{}":Jo?Ui+"{"+fe(o1,Jo)+"}":Ui+"{ "+C.call(o1,", ")+" }"}return String(ze)};function ee(be,ze,nt){var Mt=nt.quoteStyle||ze,ot=Q[Mt];return ot+be+ot}function ue(be){return v.call(String(be),/"/g,""")}function ce(be){return ke(be)==="[object Array]"&&(!I||!(typeof be=="object"&&I in be))}function me(be){return ke(be)==="[object Date]"&&(!I||!(typeof be=="object"&&I in be))}function de(be){return ke(be)==="[object RegExp]"&&(!I||!(typeof be=="object"&&I in be))}function Ae(be){return ke(be)==="[object Error]"&&(!I||!(typeof be=="object"&&I in be))}function ye(be){return ke(be)==="[object String]"&&(!I||!(typeof be=="object"&&I in be))}function Ne(be){return ke(be)==="[object Number]"&&(!I||!(typeof be=="object"&&I in be))}function je(be){return ke(be)==="[object Boolean]"&&(!I||!(typeof be=="object"&&I in be))}function ie(be){if(j)return be&&typeof be=="object"&&be instanceof Symbol;if(typeof be=="symbol")return!0;if(!be||typeof be!="object"||!N)return!1;try{return N.call(be),!0}catch{}return!1}function we(be){if(!be||typeof be!="object"||!E)return!1;try{return E.call(be),!0}catch{}return!1}var re=Object.prototype.hasOwnProperty||function(be){return be in this};function pe(be,ze){return re.call(be,ze)}function ke(be){return g.call(be)}function Se(be){if(be.name)return be.name;var ze=A.call(z.call(be),/^function\s*([\w$]+)/);return ze?ze[1]:null}function se(be,ze){if(be.indexOf)return be.indexOf(ze);for(var nt=0,Mt=be.length;ntze.maxStringLength){var nt=be.length-ze.maxStringLength,Mt="... "+nt+" more character"+(nt>1?"s":"");return rt(_.call(be,0,ze.maxStringLength),ze)+Mt}var ot=te[ze.quoteStyle||"single"];ot.lastIndex=0;var Ue=v.call(v.call(be,ot,"\\$1"),/[\x00-\x1f]/g,qt);return ee(Ue,"single",ze)}function qt(be){var ze=be.charCodeAt(0),nt={8:"b",9:"t",10:"n",12:"f",13:"r"}[ze];return nt?"\\"+nt:"\\x"+(ze<16?"0":"")+M.call(ze.toString(16))}function wt(be){return"Object("+be+")"}function Bt(be){return be+" { ? }"}function ae(be,ze,nt,Mt){var ot=Mt?fe(nt,Mt):C.call(nt,", ");return be+" ("+ze+") {"+ot+"}"}function H(be){for(var ze=0;zetypeof z=="object"&&z.toJSON?z.toJSON(null,d):z);else if(typeof g=="object"&&g.toJSON)p[h]=g.toJSON(null,d);else if(h==="source"){let z=d.get(g.input);z==null&&(z=b,d.set(g.input,b),b++),p[h]={end:g.end,inputId:z,start:g.start}}else p[h]=g}return f&&(p.inputs=[...d.keys()].map(h=>h.toJSON())),p}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(u=n){u.stringify&&(u=u.stringify);let d="";return u(this,p=>{d+=p}),d}warn(u,d,p){let f={node:this};for(let b in p)f[b]=p[b];return u.warn(d,f)}get proxyOf(){return this}}return Aq=c,c.default=c,Aq}var vq,UQ;function Tme(){if(UQ)return vq;UQ=1;let e=B7();class t extends e{constructor(o){super(o),this.type="comment"}}return vq=t,t.default=t,vq}var xq,XQ;function Eme(){if(XQ)return xq;XQ=1;let e=B7();class t extends e{constructor(o){o&&typeof o.value<"u"&&typeof o.value!="string"&&(o={...o,value:String(o.value)}),super(o),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}}return xq=t,t.default=t,xq}var wq,GQ;function Am(){if(GQ)return wq;GQ=1;let e=Tme(),t=Eme(),n=B7(),{isClean:o,my:r}=N7(),s,i,c,l;function u(f){return f.map(b=>(b.nodes&&(b.nodes=u(b.nodes)),delete b.source,b))}function d(f){if(f[o]=!1,f.proxyOf.nodes)for(let b of f.proxyOf.nodes)d(b)}class p extends n{append(...b){for(let h of b){let g=this.normalize(h,this.last);for(let z of g)this.proxyOf.nodes.push(z)}return this.markDirty(),this}cleanRaws(b){if(super.cleanRaws(b),this.nodes)for(let h of this.nodes)h.cleanRaws(b)}each(b){if(!this.proxyOf.nodes)return;let h=this.getIterator(),g,z;for(;this.indexes[h]b[h](...g.map(z=>typeof z=="function"?(A,_)=>z(A.toProxy(),_):z)):h==="every"||h==="some"?g=>b[h]((z,...A)=>g(z.toProxy(),...A)):h==="root"?()=>b.root().toProxy():h==="nodes"?b.nodes.map(g=>g.toProxy()):h==="first"||h==="last"?b[h].toProxy():b[h]:b[h]},set(b,h,g){return b[h]===g||(b[h]=g,(h==="name"||h==="params"||h==="selector")&&b.markDirty()),!0}}}index(b){return typeof b=="number"?b:(b.proxyOf&&(b=b.proxyOf),this.proxyOf.nodes.indexOf(b))}insertAfter(b,h){let g=this.index(b),z=this.normalize(h,this.proxyOf.nodes[g]).reverse();g=this.index(b);for(let _ of z)this.proxyOf.nodes.splice(g+1,0,_);let A;for(let _ in this.indexes)A=this.indexes[_],g"u")b=[];else if(Array.isArray(b)){b=b.slice(0);for(let z of b)z.parent&&z.parent.removeChild(z,"ignore")}else if(b.type==="root"&&this.type!=="document"){b=b.nodes.slice(0);for(let z of b)z.parent&&z.parent.removeChild(z,"ignore")}else if(b.type)b=[b];else if(b.prop){if(typeof b.value>"u")throw new Error("Value field is missed in node creation");typeof b.value!="string"&&(b.value=String(b.value)),b=[new t(b)]}else if(b.selector||b.selectors)b=[new l(b)];else if(b.name)b=[new s(b)];else if(b.text)b=[new e(b)];else throw new Error("Unknown node type in node creation");return b.map(z=>(z[r]||p.rebuild(z),z=z.proxyOf,z.parent&&z.parent.removeChild(z),z[o]&&d(z),z.raws||(z.raws={}),typeof z.raws.before>"u"&&h&&typeof h.raws.before<"u"&&(z.raws.before=h.raws.before.replace(/\S/g,"")),z.parent=this.proxyOf,z))}prepend(...b){b=b.reverse();for(let h of b){let g=this.normalize(h,this.first,"prepend").reverse();for(let z of g)this.proxyOf.nodes.unshift(z);for(let z in this.indexes)this.indexes[z]=this.indexes[z]+g.length}return this.markDirty(),this}push(b){return b.parent=this,this.proxyOf.nodes.push(b),this}removeAll(){for(let b of this.proxyOf.nodes)b.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(b){b=this.index(b),this.proxyOf.nodes[b].parent=void 0,this.proxyOf.nodes.splice(b,1);let h;for(let g in this.indexes)h=this.indexes[g],h>=b&&(this.indexes[g]=h-1);return this.markDirty(),this}replaceValues(b,h,g){return g||(g=h,h={}),this.walkDecls(z=>{h.props&&!h.props.includes(z.prop)||h.fast&&!z.value.includes(h.fast)||(z.value=z.value.replace(b,g))}),this.markDirty(),this}some(b){return this.nodes.some(b)}walk(b){return this.each((h,g)=>{let z;try{z=b(h,g)}catch(A){throw h.addToError(A)}return z!==!1&&h.walk&&(z=h.walk(b)),z})}walkAtRules(b,h){return h?b instanceof RegExp?this.walk((g,z)=>{if(g.type==="atrule"&&b.test(g.name))return h(g,z)}):this.walk((g,z)=>{if(g.type==="atrule"&&g.name===b)return h(g,z)}):(h=b,this.walk((g,z)=>{if(g.type==="atrule")return h(g,z)}))}walkComments(b){return this.walk((h,g)=>{if(h.type==="comment")return b(h,g)})}walkDecls(b,h){return h?b instanceof RegExp?this.walk((g,z)=>{if(g.type==="decl"&&b.test(g.prop))return h(g,z)}):this.walk((g,z)=>{if(g.type==="decl"&&g.prop===b)return h(g,z)}):(h=b,this.walk((g,z)=>{if(g.type==="decl")return h(g,z)}))}walkRules(b,h){return h?b instanceof RegExp?this.walk((g,z)=>{if(g.type==="rule"&&b.test(g.selector))return h(g,z)}):this.walk((g,z)=>{if(g.type==="rule"&&g.selector===b)return h(g,z)}):(h=b,this.walk((g,z)=>{if(g.type==="rule")return h(g,z)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return p.registerParse=f=>{i=f},p.registerRule=f=>{l=f},p.registerAtRule=f=>{s=f},p.registerRoot=f=>{c=f},wq=p,p.default=p,p.rebuild=f=>{f.type==="atrule"?Object.setPrototypeOf(f,s.prototype):f.type==="rule"?Object.setPrototypeOf(f,l.prototype):f.type==="decl"?Object.setPrototypeOf(f,t.prototype):f.type==="comment"?Object.setPrototypeOf(f,e.prototype):f.type==="root"&&Object.setPrototypeOf(f,c.prototype),f[r]=!0,f.nodes&&f.nodes.forEach(b=>{p.rebuild(b)})},wq}var _q,KQ;function Wme(){if(KQ)return _q;KQ=1;let e=Am(),t,n;class o extends e{constructor(s){super({type:"document",...s}),this.nodes||(this.nodes=[])}toResult(s={}){return new t(new n,this,s).stringify()}}return o.registerLazyResult=r=>{t=r},o.registerProcessor=r=>{n=r},_q=o,o.default=o,_q}var kq,YQ;function L7(){if(YQ)return kq;YQ=1;function e(r){if(typeof r!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(r))}function t(r,s){for(var i="",c=0,l=-1,u=0,d,p=0;p<=r.length;++p){if(p2){var f=i.lastIndexOf("/");if(f!==i.length-1){f===-1?(i="",c=0):(i=i.slice(0,f),c=i.length-1-i.lastIndexOf("/")),l=p,u=0;continue}}else if(i.length===2||i.length===1){i="",c=0,l=p,u=0;continue}}s&&(i.length>0?i+="/..":i="..",c=2)}else i.length>0?i+="/"+r.slice(l+1,p):i=r.slice(l+1,p),c=p-l-1;l=p,u=0}else d===46&&u!==-1?++u:u=-1}return i}function n(r,s){var i=s.dir||s.root,c=s.base||(s.name||"")+(s.ext||"");return i?i===s.root?i+c:i+r+c:c}var o={resolve:function(){for(var s="",i=!1,c,l=arguments.length-1;l>=-1&&!i;l--){var u;l>=0?u=arguments[l]:(c===void 0&&(c=Oi.cwd()),u=c),e(u),u.length!==0&&(s=u+"/"+s,i=u.charCodeAt(0)===47)}return s=t(s,!i),i?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(s){if(e(s),s.length===0)return".";var i=s.charCodeAt(0)===47,c=s.charCodeAt(s.length-1)===47;return s=t(s,!i),s.length===0&&!i&&(s="."),s.length>0&&c&&(s+="/"),i?"/"+s:s},isAbsolute:function(s){return e(s),s.length>0&&s.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var s,i=0;i0&&(s===void 0?s=c:s+="/"+c)}return s===void 0?".":o.normalize(s)},relative:function(s,i){if(e(s),e(i),s===i||(s=o.resolve(s),i=o.resolve(i),s===i))return"";for(var c=1;cb){if(i.charCodeAt(d+g)===47)return i.slice(d+g+1);if(g===0)return i.slice(d+g)}else u>b&&(s.charCodeAt(c+g)===47?h=g:g===0&&(h=0));break}var z=s.charCodeAt(c+g),A=i.charCodeAt(d+g);if(z!==A)break;z===47&&(h=g)}var _="";for(g=c+h+1;g<=l;++g)(g===l||s.charCodeAt(g)===47)&&(_.length===0?_+="..":_+="/..");return _.length>0?_+i.slice(d+h):(d+=h,i.charCodeAt(d)===47&&++d,i.slice(d))},_makeLong:function(s){return s},dirname:function(s){if(e(s),s.length===0)return".";for(var i=s.charCodeAt(0),c=i===47,l=-1,u=!0,d=s.length-1;d>=1;--d)if(i=s.charCodeAt(d),i===47){if(!u){l=d;break}}else u=!1;return l===-1?c?"/":".":c&&l===1?"//":s.slice(0,l)},basename:function(s,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');e(s);var c=0,l=-1,u=!0,d;if(i!==void 0&&i.length>0&&i.length<=s.length){if(i.length===s.length&&i===s)return"";var p=i.length-1,f=-1;for(d=s.length-1;d>=0;--d){var b=s.charCodeAt(d);if(b===47){if(!u){c=d+1;break}}else f===-1&&(u=!1,f=d+1),p>=0&&(b===i.charCodeAt(p)?--p===-1&&(l=d):(p=-1,l=f))}return c===l?l=f:l===-1&&(l=s.length),s.slice(c,l)}else{for(d=s.length-1;d>=0;--d)if(s.charCodeAt(d)===47){if(!u){c=d+1;break}}else l===-1&&(u=!1,l=d+1);return l===-1?"":s.slice(c,l)}},extname:function(s){e(s);for(var i=-1,c=0,l=-1,u=!0,d=0,p=s.length-1;p>=0;--p){var f=s.charCodeAt(p);if(f===47){if(!u){c=p+1;break}continue}l===-1&&(u=!1,l=p+1),f===46?i===-1?i=p:d!==1&&(d=1):i!==-1&&(d=-1)}return i===-1||l===-1||d===0||d===1&&i===l-1&&i===c+1?"":s.slice(i,l)},format:function(s){if(s===null||typeof s!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof s);return n("/",s)},parse:function(s){e(s);var i={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return i;var c=s.charCodeAt(0),l=c===47,u;l?(i.root="/",u=1):u=0;for(var d=-1,p=0,f=-1,b=!0,h=s.length-1,g=0;h>=u;--h){if(c=s.charCodeAt(h),c===47){if(!b){p=h+1;break}continue}f===-1&&(b=!1,f=h+1),c===46?d===-1?d=h:g!==1&&(g=1):d!==-1&&(g=-1)}return d===-1||f===-1||g===0||g===1&&d===f-1&&d===p+1?f!==-1&&(p===0&&l?i.base=i.name=s.slice(1,f):i.base=i.name=s.slice(p,f)):(p===0&&l?(i.name=s.slice(1,d),i.base=s.slice(1,f)):(i.name=s.slice(p,d),i.base=s.slice(p,f)),i.ext=s.slice(d,f)),p>0?i.dir=s.slice(0,p-1):l&&(i.dir="/"),i},sep:"/",delimiter:":",win32:null,posix:null};return o.posix=o,kq=o,kq}var dM={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var kwt=dM.exports,ZQ;function Swt(){return ZQ||(ZQ=1,function(e,t){(function(n){var o=t&&!t.nodeType&&t,r=e&&!e.nodeType&&e,s=typeof p1=="object"&&p1;(s.global===s||s.window===s||s.self===s)&&(n=s);var i,c=2147483647,l=36,u=1,d=26,p=38,f=700,b=72,h=128,g="-",z=/^xn--/,A=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,v={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},M=l-u,y=Math.floor,k=String.fromCharCode,S;function C(Z){throw new RangeError(v[Z])}function R(Z,V){for(var Q=Z.length,te=[];Q--;)te[Q]=V(Z[Q]);return te}function T(Z,V){var Q=Z.split("@"),te="";Q.length>1&&(te=Q[0]+"@",Z=Q[1]),Z=Z.replace(_,".");var ee=Z.split("."),ue=R(ee,V).join(".");return te+ue}function E(Z){for(var V=[],Q=0,te=Z.length,ee,ue;Q=55296&&ee<=56319&&Q65535&&(V-=65536,Q+=k(V>>>10&1023|55296),V=56320|V&1023),Q+=k(V),Q}).join("")}function N(Z){return Z-48<10?Z-22:Z-65<26?Z-65:Z-97<26?Z-97:l}function j(Z,V){return Z+22+75*(Z<26)-((V!=0)<<5)}function I(Z,V,Q){var te=0;for(Z=Q?y(Z/f):Z>>1,Z+=y(Z/V);Z>M*d>>1;te+=l)Z=y(Z/M);return y(te+(M+1)*Z/(Z+p))}function P(Z){var V=[],Q=Z.length,te,ee=0,ue=h,ce=b,me,de,Ae,ye,Ne,je,ie,we,re;for(me=Z.lastIndexOf(g),me<0&&(me=0),de=0;de=128&&C("not-basic"),V.push(Z.charCodeAt(de));for(Ae=me>0?me+1:0;Ae=Q&&C("invalid-input"),ie=N(Z.charCodeAt(Ae++)),(ie>=l||ie>y((c-ee)/Ne))&&C("overflow"),ee+=ie*Ne,we=je<=ce?u:je>=ce+d?d:je-ce,!(iey(c/re)&&C("overflow"),Ne*=re;te=V.length+1,ce=I(ee-ye,te,ye==0),y(ee/te)>c-ue&&C("overflow"),ue+=y(ee/te),ee%=te,V.splice(ee++,0,ue)}return B(V)}function $(Z){var V,Q,te,ee,ue,ce,me,de,Ae,ye,Ne,je=[],ie,we,re,pe;for(Z=E(Z),ie=Z.length,V=h,Q=0,ue=b,ce=0;ce=V&&Ney((c-Q)/we)&&C("overflow"),Q+=(me-V)*we,V=me,ce=0;cec&&C("overflow"),Ne==V){for(de=Q,Ae=l;ye=Ae<=ue?u:Ae>=ue+d?d:Ae-ue,!(de-1e3&&be<1e3||k.call(/e/,ze))return ze;var nt=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof be=="number"){var Mt=be<0?-T(-be):T(be);if(Mt!==be){var ot=String(Mt),Ue=_.call(ze,ot.length+1);return v.call(ot,nt,"$&_")+"."+v.call(v.call(Ue,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(ze,nt,"$&_")}var X=_h,Z=X.custom,V=ie(Z)?Z:null,Q={__proto__:null,double:'"',single:"'"},te={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Cq=function be(ze,nt,Mt,ot){var Ue=nt||{};if(pe(Ue,"quoteStyle")&&!pe(Q,Ue.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(pe(Ue,"maxStringLength")&&(typeof Ue.maxStringLength=="number"?Ue.maxStringLength<0&&Ue.maxStringLength!==1/0:Ue.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var yt=pe(Ue,"customInspect")?Ue.customInspect:!0;if(typeof yt!="boolean"&&yt!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(pe(Ue,"indent")&&Ue.indent!==null&&Ue.indent!==" "&&!(parseInt(Ue.indent,10)===Ue.indent&&Ue.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(pe(Ue,"numericSeparator")&&typeof Ue.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var fn=Ue.numericSeparator;if(typeof ze>"u")return"undefined";if(ze===null)return"null";if(typeof ze=="boolean")return ze?"true":"false";if(typeof ze=="string")return rt(ze,Ue);if(typeof ze=="number"){if(ze===0)return 1/0/ze>0?"0":"-0";var Ln=String(ze);return fn?F(ze,Ln):Ln}if(typeof ze=="bigint"){var Mo=String(ze)+"n";return fn?F(ze,Mo):Mo}var rr=typeof Ue.depth>"u"?5:Ue.depth;if(typeof Mt>"u"&&(Mt=0),Mt>=rr&&rr>0&&typeof ze=="object")return ce(ze)?"[Array]":"[Object]";var Jo=Y(Ue,Mt);if(typeof ot>"u")ot=[];else if(se(ot,ze)>=0)return"[Circular]";function To(_s,Xi,gb){if(Xi&&(ot=R.call(ot),ot.push(Xi)),gb){var hp={depth:Ue.depth};return pe(Ue,"quoteStyle")&&(hp.quoteStyle=Ue.quoteStyle),be(_s,hp,Mt+1,ot)}return be(_s,Ue,Mt+1,ot)}if(typeof ze=="function"&&!de(ze)){var Nr=Se(ze),Rt=Re(ze,To);return"[Function"+(Nr?": "+Nr:" (anonymous)")+"]"+(Rt.length>0?" { "+C.call(Rt,", ")+" }":"")}if(ie(ze)){var Qe=j?v.call(String(ze),/^(Symbol\(.*\))_[^)]*$/,"$1"):N.call(ze);return typeof ze=="object"&&!j?wt(Qe):Qe}if(Pe(ze)){for(var xt="<"+y.call(String(ze.nodeName)),Gt=ze.attributes||[],On=0;On",xt}if(ce(ze)){if(ze.length===0)return"[]";var $n=Re(ze,To);return Jo&&!H($n)?"["+fe($n,Jo)+"]":"[ "+C.call($n,", ")+" ]"}if(Ae(ze)){var Jn=Re(ze,To);return!("cause"in Error.prototype)&&"cause"in ze&&!P.call(ze,"cause")?"{ ["+String(ze)+"] "+C.call(S.call("[cause]: "+To(ze.cause),Jn),", ")+" }":Jn.length===0?"["+String(ze)+"]":"{ ["+String(ze)+"] "+C.call(Jn,", ")+" }"}if(typeof ze=="object"&&yt){if(V&&typeof ze[V]=="function"&&X)return X(ze,{depth:rr-Mt});if(yt!=="symbol"&&typeof ze.inspect=="function")return ze.inspect()}if(L(ze)){var pr=[];return o&&o.call(ze,function(_s,Xi){pr.push(To(Xi,ze,!0)+" => "+To(_s,ze))}),ae("Map",n.call(ze),pr,Jo)}if(ve(ze)){var O0=[];return c&&c.call(ze,function(_s){O0.push(To(_s,ze))}),ae("Set",i.call(ze),O0,Jo)}if(U(ze))return Bt("WeakMap");if(qe(ze))return Bt("WeakSet");if(ne(ze))return Bt("WeakRef");if(Ne(ze))return wt(To(Number(ze)));if(we(ze))return wt(To(E.call(ze)));if(je(ze))return wt(h.call(ze));if(ye(ze))return wt(To(String(ze)));if(typeof window<"u"&&ze===window)return"{ [object Window] }";if(typeof globalThis<"u"&&ze===globalThis||typeof p1<"u"&&ze===p1)return"{ [object globalThis] }";if(!me(ze)&&!de(ze)){var o1=Re(ze,To),yr=$?$(ze)===Object.prototype:ze instanceof Object||ze.constructor===Object,Js=ze instanceof Object?"":"null prototype",ao=!yr&&I&&Object(ze)===ze&&I in ze?_.call(ke(ze),8,-1):Js?"Object":"",Ic=yr||typeof ze.constructor!="function"?"":ze.constructor.name?ze.constructor.name+" ":"",Ui=Ic+(ao||Js?"["+C.call(S.call([],ao||[],Js||[]),": ")+"] ":"");return o1.length===0?Ui+"{}":Jo?Ui+"{"+fe(o1,Jo)+"}":Ui+"{ "+C.call(o1,", ")+" }"}return String(ze)};function ee(be,ze,nt){var Mt=nt.quoteStyle||ze,ot=Q[Mt];return ot+be+ot}function ue(be){return v.call(String(be),/"/g,""")}function ce(be){return ke(be)==="[object Array]"&&(!I||!(typeof be=="object"&&I in be))}function me(be){return ke(be)==="[object Date]"&&(!I||!(typeof be=="object"&&I in be))}function de(be){return ke(be)==="[object RegExp]"&&(!I||!(typeof be=="object"&&I in be))}function Ae(be){return ke(be)==="[object Error]"&&(!I||!(typeof be=="object"&&I in be))}function ye(be){return ke(be)==="[object String]"&&(!I||!(typeof be=="object"&&I in be))}function Ne(be){return ke(be)==="[object Number]"&&(!I||!(typeof be=="object"&&I in be))}function je(be){return ke(be)==="[object Boolean]"&&(!I||!(typeof be=="object"&&I in be))}function ie(be){if(j)return be&&typeof be=="object"&&be instanceof Symbol;if(typeof be=="symbol")return!0;if(!be||typeof be!="object"||!N)return!1;try{return N.call(be),!0}catch{}return!1}function we(be){if(!be||typeof be!="object"||!E)return!1;try{return E.call(be),!0}catch{}return!1}var re=Object.prototype.hasOwnProperty||function(be){return be in this};function pe(be,ze){return re.call(be,ze)}function ke(be){return g.call(be)}function Se(be){if(be.name)return be.name;var ze=A.call(z.call(be),/^function\s*([\w$]+)/);return ze?ze[1]:null}function se(be,ze){if(be.indexOf)return be.indexOf(ze);for(var nt=0,Mt=be.length;ntze.maxStringLength){var nt=be.length-ze.maxStringLength,Mt="... "+nt+" more character"+(nt>1?"s":"");return rt(_.call(be,0,ze.maxStringLength),ze)+Mt}var ot=te[ze.quoteStyle||"single"];ot.lastIndex=0;var Ue=v.call(v.call(be,ot,"\\$1"),/[\x00-\x1f]/g,qt);return ee(Ue,"single",ze)}function qt(be){var ze=be.charCodeAt(0),nt={8:"b",9:"t",10:"n",12:"f",13:"r"}[ze];return nt?"\\"+nt:"\\x"+(ze<16?"0":"")+M.call(ze.toString(16))}function wt(be){return"Object("+be+")"}function Bt(be){return be+" { ? }"}function ae(be,ze,nt,Mt){var ot=Mt?fe(nt,Mt):C.call(nt,", ");return be+" ("+ze+") {"+ot+"}"}function H(be){for(var ze=0;ze=0)return!1;return!0}function Y(be,ze){var nt;if(be.indent===" ")nt=" ";else if(typeof be.indent=="number"&&be.indent>0)nt=C.call(Array(be.indent+1)," ");else return null;return{base:nt,prev:C.call(Array(ze+1),nt)}}function fe(be,ze){if(be.length===0)return"";var nt=` `+ze.prev+ze.base;return nt+C.call(be,","+nt)+` `+ze.prev}function Re(be,ze){var nt=ce(be),Mt=[];if(nt){Mt.length=be.length;for(var ot=0;ot"u"||!S?e:S(Uint8Array),j={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":k&&S?S([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":B,"%AsyncGenerator%":B,"%AsyncGeneratorFunction%":B,"%AsyncIteratorPrototype%":B,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":o,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":z,"%GeneratorFunction%":B,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":k&&S?S(S([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!k||!S?e:S(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":t,"%Object.getOwnPropertyDescriptor%":_,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":r,"%ReferenceError%":s,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!k||!S?e:S(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":k&&S?S(""[Symbol.iterator]()):e,"%Symbol%":k?Symbol:e,"%SyntaxError%":i,"%ThrowTypeError%":y,"%TypedArray%":N,"%TypeError%":c,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":l,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":E,"%Function.prototype.apply%":T,"%Object.defineProperty%":v,"%Object.getPrototypeOf%":C,"%Math.abs%":u,"%Math.floor%":d,"%Math.max%":p,"%Math.min%":f,"%Math.pow%":b,"%Math.round%":h,"%Math.sign%":g,"%Reflect.getPrototypeOf%":R};if(S)try{null.error}catch(Ae){var I=S(S(Ae));j["%Error.prototype%"]=I}var P=function Ae(ye){var Ne;if(ye==="%AsyncFunction%")Ne=A("async function () {}");else if(ye==="%GeneratorFunction%")Ne=A("function* () {}");else if(ye==="%AsyncGeneratorFunction%")Ne=A("async function* () {}");else if(ye==="%AsyncGenerator%"){var je=Ae("%AsyncGeneratorFunction%");je&&(Ne=je.prototype)}else if(ye==="%AsyncIteratorPrototype%"){var ie=Ae("%AsyncGenerator%");ie&&S&&(Ne=S(ie.prototype))}return j[ye]=Ne,Ne},$={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},F=T_(),X=t_t(),Z=F.call(E,Array.prototype.concat),V=F.call(T,Array.prototype.splice),Q=F.call(E,String.prototype.replace),te=F.call(E,String.prototype.slice),ee=F.call(E,RegExp.prototype.exec),ue=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ce=/\\(\\)?/g,me=function(ye){var Ne=te(ye,0,1),je=te(ye,-1);if(Ne==="%"&&je!=="%")throw new i("invalid intrinsic syntax, expected closing `%`");if(je==="%"&&Ne!=="%")throw new i("invalid intrinsic syntax, expected opening `%`");var ie=[];return Q(ye,ue,function(we,re,pe,ke){ie[ie.length]=pe?Q(ke,ce,"$1"):re||we}),ie},de=function(ye,Ne){var je=ye,ie;if(X($,je)&&(ie=$[je],je="%"+ie[0]+"%"),X(j,je)){var we=j[je];if(we===B&&(we=P(je)),typeof we>"u"&&!Ne)throw new c("intrinsic "+ye+" exists, but is not available. Please file an issue!");return{alias:ie,name:je,value:we}}throw new i("intrinsic "+ye+" does not exist!")};return lR=function(ye,Ne){if(typeof ye!="string"||ye.length===0)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof Ne!="boolean")throw new c('"allowMissing" argument must be a boolean');if(ee(/^%?[^%]*%?$/,ye)===null)throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var je=me(ye),ie=je.length>0?je[0]:"",we=de("%"+ie+"%",Ne),re=we.name,pe=we.value,ke=!1,Se=we.alias;Se&&(ie=Se[0],V(je,Z([0,1],Se)));for(var se=1,L=!0;se=je.length){var qe=_(pe,U);L=!!qe,L&&"get"in qe&&!("originalValue"in qe.get)?pe=qe.get:pe=pe[U]}else L=X(pe,U),pe=pe[U];L&&!ke&&(j[re]=pe)}}return pe},lR}var uR,WJ;function Dme(){if(WJ)return uR;WJ=1;var e=j7(),t=Ime(),n=t([e("%String.prototype.indexOf%")]);return uR=function(r,s){var i=e(r,!!s);return typeof i=="function"&&n(r,".prototype.")>-1?t([i]):i},uR}var dR,NJ;function Fme(){if(NJ)return dR;NJ=1;var e=j7(),t=Dme(),n=R_(),o=vm(),r=e("%Map%",!0),s=t("Map.prototype.get",!0),i=t("Map.prototype.set",!0),c=t("Map.prototype.has",!0),l=t("Map.prototype.delete",!0),u=t("Map.prototype.size",!0);return dR=!!r&&function(){var p,f={assert:function(b){if(!f.has(b))throw new o("Side channel does not contain "+n(b))},delete:function(b){if(p){var h=l(p,b);return u(p)===0&&(p=void 0),h}return!1},get:function(b){if(p)return s(p,b)},has:function(b){return p?c(p,b):!1},set:function(b,h){p||(p=new r),i(p,b,h)}};return f},dR}var pR,BJ;function n_t(){if(BJ)return pR;BJ=1;var e=j7(),t=Dme(),n=R_(),o=Fme(),r=vm(),s=e("%WeakMap%",!0),i=t("WeakMap.prototype.get",!0),c=t("WeakMap.prototype.set",!0),l=t("WeakMap.prototype.has",!0),u=t("WeakMap.prototype.delete",!0);return pR=s?function(){var p,f,b={assert:function(h){if(!b.has(h))throw new r("Side channel does not contain "+n(h))},delete:function(h){if(s&&h&&(typeof h=="object"||typeof h=="function")){if(p)return u(p,h)}else if(o&&f)return f.delete(h);return!1},get:function(h){return s&&h&&(typeof h=="object"||typeof h=="function")&&p?i(p,h):f&&f.get(h)},has:function(h){return s&&h&&(typeof h=="object"||typeof h=="function")&&p?l(p,h):!!f&&f.has(h)},set:function(h,g){s&&h&&(typeof h=="object"||typeof h=="function")?(p||(p=new s),c(p,h,g)):o&&(f||(f=o()),f.set(h,g))}};return b}:o,pR}var fR,LJ;function o_t(){if(LJ)return fR;LJ=1;var e=vm(),t=R_(),n=Rwt(),o=Fme(),r=n_t(),s=r||o||n;return fR=function(){var c,l={assert:function(u){if(!l.has(u))throw new e("Side channel does not contain "+t(u))},delete:function(u){return!!c&&c.delete(u)},get:function(u){return c&&c.get(u)},has:function(u){return!!c&&c.has(u)},set:function(u,d){c||(c=s()),c.set(u,d)}};return l},fR}var bR,PJ;function I7(){if(PJ)return bR;PJ=1;var e=String.prototype.replace,t=/%20/g,n={RFC1738:"RFC1738",RFC3986:"RFC3986"};return bR={default:n.RFC3986,formatters:{RFC1738:function(o){return e.call(o,t,"+")},RFC3986:function(o){return String(o)}},RFC1738:n.RFC1738,RFC3986:n.RFC3986},bR}var hR,jJ;function $me(){if(jJ)return hR;jJ=1;var e=I7(),t=Object.prototype.hasOwnProperty,n=Array.isArray,o=function(){for(var z=[],A=0;A<256;++A)z.push("%"+((A<16?"0":"")+A.toString(16)).toUpperCase());return z}(),r=function(A){for(;A.length>1;){var _=A.pop(),v=_.obj[_.prop];if(n(v)){for(var M=[],y=0;y=u?k.slice(C,C+u):k,T=[],E=0;E=48&&B<=57||B>=65&&B<=90||B>=97&&B<=122||y===e.RFC1738&&(B===40||B===41)){T[T.length]=R.charAt(E);continue}if(B<128){T[T.length]=o[B];continue}if(B<2048){T[T.length]=o[192|B>>6]+o[128|B&63];continue}if(B<55296||B>=57344){T[T.length]=o[224|B>>12]+o[128|B>>6&63]+o[128|B&63];continue}E+=1,B=65536+((B&1023)<<10|R.charCodeAt(E)&1023),T[T.length]=o[240|B>>18]+o[128|B>>12&63]+o[128|B>>6&63]+o[128|B&63]}S+=T.join("")}return S},p=function(A){for(var _=[{obj:{o:A},prop:"o"}],v=[],M=0;M<_.length;++M)for(var y=_[M],k=y.obj[y.prop],S=Object.keys(k),C=0;C"u"&&(Z=0)}if(typeof R=="function"?F=R(A,F):F instanceof Date?F=B(F):_==="comma"&&s(F)&&(F=t.maybeMap(F,function(re){return re instanceof Date?B(re):re})),F===null){if(y)return C&&!I?C(A,d.encoder,P,"key",N):A;F=""}if(p(F)||t.isBuffer(F)){if(C){var te=I?A:C(A,d.encoder,P,"key",N);return[j(te)+"="+j(C(F,d.encoder,P,"value",N))]}return[j(A)+"="+j(String(F))]}var ee=[];if(typeof F>"u")return ee;var ue;if(_==="comma"&&s(F))I&&C&&(F=t.maybeMap(F,C)),ue=[{value:F.length>0?F.join(",")||null:void 0}];else if(s(R))ue=R;else{var ce=Object.keys(F);ue=T?ce.sort(T):ce}var me=S?String(A).replace(/\./g,"%2E"):String(A),de=v&&s(F)&&F.length===1?me+"[]":me;if(M&&s(F)&&F.length===0)return de+"[]";for(var Ae=0;Ae"u"?z.encodeDotInKeys===!0?!0:d.allowDots:!!z.allowDots;return{addQueryPrefix:typeof z.addQueryPrefix=="boolean"?z.addQueryPrefix:d.addQueryPrefix,allowDots:k,allowEmptyArrays:typeof z.allowEmptyArrays=="boolean"?!!z.allowEmptyArrays:d.allowEmptyArrays,arrayFormat:y,charset:A,charsetSentinel:typeof z.charsetSentinel=="boolean"?z.charsetSentinel:d.charsetSentinel,commaRoundTrip:!!z.commaRoundTrip,delimiter:typeof z.delimiter>"u"?d.delimiter:z.delimiter,encode:typeof z.encode=="boolean"?z.encode:d.encode,encodeDotInKeys:typeof z.encodeDotInKeys=="boolean"?z.encodeDotInKeys:d.encodeDotInKeys,encoder:typeof z.encoder=="function"?z.encoder:d.encoder,encodeValuesOnly:typeof z.encodeValuesOnly=="boolean"?z.encodeValuesOnly:d.encodeValuesOnly,filter:M,format:_,formatter:v,serializeDate:typeof z.serializeDate=="function"?z.serializeDate:d.serializeDate,skipNulls:typeof z.skipNulls=="boolean"?z.skipNulls:d.skipNulls,sort:typeof z.sort=="function"?z.sort:null,strictNullHandling:typeof z.strictNullHandling=="boolean"?z.strictNullHandling:d.strictNullHandling}};return mR=function(g,z){var A=g,_=h(z),v,M;typeof _.filter=="function"?(M=_.filter,A=M("",A)):s(_.filter)&&(M=_.filter,v=M);var y=[];if(typeof A!="object"||A===null)return"";var k=r[_.arrayFormat],S=k==="comma"&&_.commaRoundTrip;v||(v=Object.keys(A)),_.sort&&v.sort(_.sort);for(var C=e(),R=0;R0?N+B:""},mR}var gR,DJ;function s_t(){if(DJ)return gR;DJ=1;var e=$me(),t=Object.prototype.hasOwnProperty,n=Array.isArray,o={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:e.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},r=function(f){return f.replace(/&#(\d+);/g,function(b,h){return String.fromCharCode(parseInt(h,10))})},s=function(f,b,h){if(f&&typeof f=="string"&&b.comma&&f.indexOf(",")>-1)return f.split(",");if(b.throwOnLimitExceeded&&h>=b.arrayLimit)throw new RangeError("Array limit exceeded. Only "+b.arrayLimit+" element"+(b.arrayLimit===1?"":"s")+" allowed in an array.");return f},i="utf8=%26%2310003%3B",c="utf8=%E2%9C%93",l=function(b,h){var g={__proto__:null},z=h.ignoreQueryPrefix?b.replace(/^\?/,""):b;z=z.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var A=h.parameterLimit===1/0?void 0:h.parameterLimit,_=z.split(h.delimiter,h.throwOnLimitExceeded?A+1:A);if(h.throwOnLimitExceeded&&_.length>A)throw new RangeError("Parameter limit exceeded. Only "+A+" parameter"+(A===1?"":"s")+" allowed.");var v=-1,M,y=h.charset;if(h.charsetSentinel)for(M=0;M<_.length;++M)_[M].indexOf("utf8=")===0&&(_[M]===c?y="utf-8":_[M]===i&&(y="iso-8859-1"),v=M,M=_.length);for(M=0;M<_.length;++M)if(M!==v){var k=_[M],S=k.indexOf("]="),C=S===-1?k.indexOf("="):S+1,R,T;C===-1?(R=h.decoder(k,o.decoder,y,"key"),T=h.strictNullHandling?null:""):(R=h.decoder(k.slice(0,C),o.decoder,y,"key"),T=e.maybeMap(s(k.slice(C+1),h,n(g[R])?g[R].length:0),function(B){return h.decoder(B,o.decoder,y,"value")})),T&&h.interpretNumericEntities&&y==="iso-8859-1"&&(T=r(String(T))),k.indexOf("[]=")>-1&&(T=n(T)?[T]:T);var E=t.call(g,R);E&&h.duplicates==="combine"?g[R]=e.combine(g[R],T):(!E||h.duplicates==="last")&&(g[R]=T)}return g},u=function(f,b,h,g){var z=0;if(f.length>0&&f[f.length-1]==="[]"){var A=f.slice(0,-1).join("");z=Array.isArray(b)&&b[A]?b[A].length:0}for(var _=g?b:s(b,h,z),v=f.length-1;v>=0;--v){var M,y=f[v];if(y==="[]"&&h.parseArrays)M=h.allowEmptyArrays&&(_===""||h.strictNullHandling&&_===null)?[]:e.combine([],_);else{M=h.plainObjects?{__proto__:null}:{};var k=y.charAt(0)==="["&&y.charAt(y.length-1)==="]"?y.slice(1,-1):y,S=h.decodeDotInKeys?k.replace(/%2E/g,"."):k,C=parseInt(S,10);!h.parseArrays&&S===""?M={0:_}:!isNaN(C)&&y!==S&&String(C)===S&&C>=0&&h.parseArrays&&C<=h.arrayLimit?(M=[],M[C]=_):S!=="__proto__"&&(M[S]=_)}_=M}return _},d=function(b,h,g,z){if(b){var A=g.allowDots?b.replace(/\.([^.[]+)/g,"[$1]"):b,_=/(\[[^[\]]*])/,v=/(\[[^[\]]*])/g,M=g.depth>0&&_.exec(A),y=M?A.slice(0,M.index):A,k=[];if(y){if(!g.plainObjects&&t.call(Object.prototype,y)&&!g.allowPrototypes)return;k.push(y)}for(var S=0;g.depth>0&&(M=v.exec(A))!==null&&S"u"?o.charset:b.charset,g=typeof b.duplicates>"u"?o.duplicates:b.duplicates;if(g!=="combine"&&g!=="first"&&g!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var z=typeof b.allowDots>"u"?b.decodeDotInKeys===!0?!0:o.allowDots:!!b.allowDots;return{allowDots:z,allowEmptyArrays:typeof b.allowEmptyArrays=="boolean"?!!b.allowEmptyArrays:o.allowEmptyArrays,allowPrototypes:typeof b.allowPrototypes=="boolean"?b.allowPrototypes:o.allowPrototypes,allowSparse:typeof b.allowSparse=="boolean"?b.allowSparse:o.allowSparse,arrayLimit:typeof b.arrayLimit=="number"?b.arrayLimit:o.arrayLimit,charset:h,charsetSentinel:typeof b.charsetSentinel=="boolean"?b.charsetSentinel:o.charsetSentinel,comma:typeof b.comma=="boolean"?b.comma:o.comma,decodeDotInKeys:typeof b.decodeDotInKeys=="boolean"?b.decodeDotInKeys:o.decodeDotInKeys,decoder:typeof b.decoder=="function"?b.decoder:o.decoder,delimiter:typeof b.delimiter=="string"||e.isRegExp(b.delimiter)?b.delimiter:o.delimiter,depth:typeof b.depth=="number"||b.depth===!1?+b.depth:o.depth,duplicates:g,ignoreQueryPrefix:b.ignoreQueryPrefix===!0,interpretNumericEntities:typeof b.interpretNumericEntities=="boolean"?b.interpretNumericEntities:o.interpretNumericEntities,parameterLimit:typeof b.parameterLimit=="number"?b.parameterLimit:o.parameterLimit,parseArrays:b.parseArrays!==!1,plainObjects:typeof b.plainObjects=="boolean"?b.plainObjects:o.plainObjects,strictDepth:typeof b.strictDepth=="boolean"?!!b.strictDepth:o.strictDepth,strictNullHandling:typeof b.strictNullHandling=="boolean"?b.strictNullHandling:o.strictNullHandling,throwOnLimitExceeded:typeof b.throwOnLimitExceeded=="boolean"?b.throwOnLimitExceeded:!1}};return gR=function(f,b){var h=p(b);if(f===""||f===null||typeof f>"u")return h.plainObjects?{__proto__:null}:{};for(var g=typeof f=="string"?l(f,h):f,z=h.plainObjects?{__proto__:null}:{},A=Object.keys(g),_=0;_",'"',"`"," ","\r",` @@ -557,7 +557,7 @@ The screen with id ${t.id} will not be added.`),e):[...e,t]}function Bbt({screen `),this.css+=b+"/*# sourceMappingURL="+f+" */"}applyPrevMaps(){for(let f of this.previous()){let b=this.toUrl(this.path(f.file)),h=f.root||e(f.file),g;this.mapOpts.sourcesContent===!1?(g=new r(f.text),g.sourcesContent&&(g.sourcesContent=null)):g=f.consumer(),this.map.applySourceMap(g,b,this.toUrl(this.path(h)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let f;for(let b=this.root.nodes.length-1;b>=0;b--)f=this.root.nodes[b],f.type==="comment"&&f.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(b)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),u&&l&&this.isMap())return this.generateMap();{let f="";return this.stringify(this.root,b=>{f+=b}),[f]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let f=this.previous()[0].consumer();f.file=this.outputFile(),this.map=s.fromSourceMap(f,{ignoreInvalidMapping:!0})}else this.map=new s({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):""});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new s({file:this.outputFile(),ignoreInvalidMapping:!0});let f=1,b=1,h="",g={generated:{column:0,line:0},original:{column:0,line:0},source:""},z,A;this.stringify(this.root,(_,v,M)=>{if(this.css+=_,v&&M!=="end"&&(g.generated.line=f,g.generated.column=b-1,v.source&&v.source.start?(g.source=this.sourcePath(v),g.original.line=v.source.start.line,g.original.column=v.source.start.column-1,this.map.addMapping(g)):(g.source=h,g.original.line=1,g.original.column=0,this.map.addMapping(g))),A=_.match(/\n/g),A?(f+=A.length,z=_.lastIndexOf(` `),b=_.length-z):b+=_.length,v&&M!=="start"){let y=v.parent||{raws:{}};(!(v.type==="decl"||v.type==="atrule"&&!v.nodes)||v!==y.last||y.raws.semicolon)&&(v.source&&v.source.end?(g.source=this.sourcePath(v),g.original.line=v.source.end.line,g.original.column=v.source.end.column-1,g.generated.line=f,g.generated.column=b-2,this.map.addMapping(g)):(g.source=h,g.original.line=1,g.original.column=0,g.generated.line=f,g.generated.column=b-1,this.map.addMapping(g)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(f=>f.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let f=this.mapOpts.annotation;return typeof f<"u"&&f!==!0?!1:this.previous().length?this.previous().some(b=>b.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(f=>f.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(f){if(this.mapOpts.absolute||f.charCodeAt(0)===60||/^\w+:\/\//.test(f))return f;let b=this.memoizedPaths.get(f);if(b)return b;let h=this.opts.to?e(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(h=e(n(h,this.mapOpts.annotation)));let g=t(h,f);return this.memoizedPaths.set(f,g),g}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(f=>{if(f.source&&f.source.input.map){let b=f.source.input.map;this.previousMaps.includes(b)||this.previousMaps.push(b)}});else{let f=new c(this.originalCSS,this.opts);f.map&&this.previousMaps.push(f.map)}return this.previousMaps}setSourcesContent(){let f={};if(this.root)this.root.walk(b=>{if(b.source){let h=b.source.input.from;if(h&&!f[h]){f[h]=!0;let g=this.usesFileUrls?this.toFileUrl(h):this.toUrl(this.path(h));this.map.setSourceContent(g,b.source.input.css)}}});else if(this.css){let b=this.opts.from?this.toUrl(this.path(this.opts.from)):"";this.map.setSourceContent(b,this.css)}}sourcePath(f){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(f.source.input.from):this.toUrl(this.path(f.source.input.from))}toBase64(f){return rh?rh.from(f).toString("base64"):window.btoa(unescape(encodeURIComponent(f)))}toFileUrl(f){let b=this.memoizedFileURLs.get(f);if(b)return b;if(i){let h=i(f).toString();return this.memoizedFileURLs.set(f,h),h}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(f){let b=this.memoizedURLs.get(f);if(b)return b;o==="\\"&&(f=f.replace(/\\/g,"/"));let h=encodeURI(f).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(f,h),h}}return AR=d,AR}var vR,YJ;function H_t(){if(YJ)return vR;YJ=1;let e=Am();class t extends e{constructor(o){super(o),this.type="atrule"}append(...o){return this.proxyOf.nodes||(this.nodes=[]),super.append(...o)}prepend(...o){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...o)}}return vR=t,t.default=t,e.registerAtRule(t),vR}var xR,ZJ;function D7(){if(ZJ)return xR;ZJ=1;let e=Am(),t,n;class o extends e{constructor(s){super(s),this.type="root",this.nodes||(this.nodes=[])}normalize(s,i,c){let l=super.normalize(s);if(i){if(c==="prepend")this.nodes.length>1?i.raws.before=this.nodes[1].raws.before:delete i.raws.before;else if(this.first!==i)for(let u of l)u.raws.before=i.raws.before}return l}removeChild(s,i){let c=this.index(s);return!i&&c===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[c].raws.before),super.removeChild(s)}toResult(s={}){return new t(new n,this,s).stringify()}}return o.registerLazyResult=r=>{t=r},o.registerProcessor=r=>{n=r},xR=o,o.default=o,e.registerRoot(o),xR}var wR,QJ;function U_t(){if(QJ)return wR;QJ=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let n=[" ",` `," "];return e.split(t,n)},split(t,n,o){let r=[],s="",i=!1,c=0,l=!1,u="",d=!1;for(let p of t)d?d=!1:p==="\\"?d=!0:l?p===u&&(l=!1):p==='"'||p==="'"?(l=!0,u=p):p==="("?c+=1:p===")"?c>0&&(c-=1):c===0&&n.includes(p)&&(i=!0),i?(s!==""&&r.push(s.trim()),s="",i=!1):s+=p;return(o||s!=="")&&r.push(s.trim()),r}};return wR=e,e.default=e,wR}var _R,JJ;function X_t(){if(JJ)return _R;JJ=1;let e=Am(),t=U_t();class n extends e{constructor(r){super(r),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(r){let s=this.selector?this.selector.match(/,\s*/):null,i=s?s[0]:","+this.raw("between","beforeOpen");this.selector=r.join(i)}}return _R=n,n.default=n,e.registerRule(n),_R}var kR,eee;function G_t(){if(eee)return kR;eee=1;const e=39,t=34,n=92,o=47,r=10,s=32,i=12,c=9,l=13,u=91,d=93,p=40,f=41,b=123,h=125,g=59,z=42,A=58,_=64,v=/[\t\n\f\r "#'()/;[\\\]{}]/g,M=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,y=/.[\r\n"'(/\\]/,k=/[\da-f]/i;return kR=function(C,R={}){let T=C.css.valueOf(),E=R.ignoreErrors,B,N,j,I,P,$,F,X,Z,V,Q=T.length,te=0,ee=[],ue=[];function ce(){return te}function me(Ne){throw C.error("Unclosed "+Ne,te)}function de(){return ue.length===0&&te>=Q}function Ae(Ne){if(ue.length)return ue.pop();if(te>=Q)return;let je=Ne?Ne.ignoreUnclosed:!1;switch(B=T.charCodeAt(te),B){case r:case s:case c:case l:case i:{I=te;do I+=1,B=T.charCodeAt(I);while(B===s||B===r||B===c||B===l||B===i);$=["space",T.slice(te,I)],te=I-1;break}case u:case d:case b:case h:case A:case g:case f:{let ie=String.fromCharCode(B);$=[ie,ie,te];break}case p:{if(V=ee.length?ee.pop()[1]:"",Z=T.charCodeAt(te+1),V==="url"&&Z!==e&&Z!==t&&Z!==s&&Z!==r&&Z!==c&&Z!==i&&Z!==l){I=te;do{if(F=!1,I=T.indexOf(")",I+1),I===-1)if(E||je){I=te;break}else me("bracket");for(X=I;T.charCodeAt(X-1)===n;)X-=1,F=!F}while(F);$=["brackets",T.slice(te,I+1),te,I],te=I}else I=T.indexOf(")",te+1),N=T.slice(te,I+1),I===-1||y.test(N)?$=["(","(",te]:($=["brackets",N,te,I],te=I);break}case e:case t:{P=B===e?"'":'"',I=te;do{if(F=!1,I=T.indexOf(P,I+1),I===-1)if(E||je){I=te+1;break}else me("string");for(X=I;T.charCodeAt(X-1)===n;)X-=1,F=!F}while(F);$=["string",T.slice(te,I+1),te,I],te=I;break}case _:{v.lastIndex=te+1,v.test(T),v.lastIndex===0?I=T.length-1:I=v.lastIndex-2,$=["at-word",T.slice(te,I+1),te,I],te=I;break}case n:{for(I=te,j=!0;T.charCodeAt(I+1)===n;)I+=1,j=!j;if(B=T.charCodeAt(I+1),j&&B!==o&&B!==s&&B!==r&&B!==c&&B!==l&&B!==i&&(I+=1,k.test(T.charAt(I)))){for(;k.test(T.charAt(I+1));)I+=1;T.charCodeAt(I+1)===s&&(I+=1)}$=["word",T.slice(te,I+1),te,I],te=I;break}default:{B===o&&T.charCodeAt(te+1)===z?(I=T.indexOf("*/",te+2)+1,I===0&&(E||je?I=T.length:me("comment")),$=["comment",T.slice(te,I+1),te,I],te=I):(M.lastIndex=te+1,M.test(T),M.lastIndex===0?I=T.length-1:I=M.lastIndex-2,$=["word",T.slice(te,I+1),te,I],ee.push($),te=I);break}}return te++,$}function ye(Ne){ue.push(Ne)}return{back:ye,endOfFile:de,nextToken:Ae,position:ce}},kR}var SR,tee;function K_t(){if(tee)return SR;tee=1;let e=H_t(),t=Tme(),n=Eme(),o=D7(),r=X_t(),s=G_t();const i={empty:!0,space:!0};function c(u){for(let d=u.length-1;d>=0;d--){let p=u[d],f=p[3]||p[2];if(f)return f}}class l{constructor(d){this.input=d,this.root=new o,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:d,start:{column:1,line:1,offset:0}}}atrule(d){let p=new e;p.name=d[1].slice(1),p.name===""&&this.unnamedAtrule(p,d),this.init(p,d[2]);let f,b,h,g=!1,z=!1,A=[],_=[];for(;!this.tokenizer.endOfFile();){if(d=this.tokenizer.nextToken(),f=d[0],f==="("||f==="["?_.push(f==="("?")":"]"):f==="{"&&_.length>0?_.push("}"):f===_[_.length-1]&&_.pop(),_.length===0)if(f===";"){p.source.end=this.getPosition(d[2]),p.source.end.offset++,this.semicolon=!0;break}else if(f==="{"){z=!0;break}else if(f==="}"){if(A.length>0){for(h=A.length-1,b=A[h];b&&b[0]==="space";)b=A[--h];b&&(p.source.end=this.getPosition(b[3]||b[2]),p.source.end.offset++)}this.end(d);break}else A.push(d);else A.push(d);if(this.tokenizer.endOfFile()){g=!0;break}}p.raws.between=this.spacesAndCommentsFromEnd(A),A.length?(p.raws.afterName=this.spacesAndCommentsFromStart(A),this.raw(p,"params",A),g&&(d=A[A.length-1],p.source.end=this.getPosition(d[3]||d[2]),p.source.end.offset++,this.spaces=p.raws.between,p.raws.between="")):(p.raws.afterName="",p.params=""),z&&(p.nodes=[],this.current=p)}checkMissedSemicolon(d){let p=this.colon(d);if(p===!1)return;let f=0,b;for(let h=p-1;h>=0&&(b=d[h],!(b[0]!=="space"&&(f+=1,f===2)));h--);throw this.input.error("Missed semicolon",b[0]==="word"?b[3]+1:b[2])}colon(d){let p=0,f,b,h;for(let[g,z]of d.entries()){if(b=z,h=b[0],h==="("&&(p+=1),h===")"&&(p-=1),p===0&&h===":")if(!f)this.doubleColon(b);else{if(f[0]==="word"&&f[1]==="progid")continue;return g}f=b}return!1}comment(d){let p=new t;this.init(p,d[2]),p.source.end=this.getPosition(d[3]||d[2]),p.source.end.offset++;let f=d[1].slice(2,-2);if(/^\s*$/.test(f))p.text="",p.raws.left=f,p.raws.right="";else{let b=f.match(/^(\s*)([^]*\S)(\s*)$/);p.text=b[2],p.raws.left=b[1],p.raws.right=b[3]}}createTokenizer(){this.tokenizer=s(this.input)}decl(d,p){let f=new n;this.init(f,d[0][2]);let b=d[d.length-1];for(b[0]===";"&&(this.semicolon=!0,d.pop()),f.source.end=this.getPosition(b[3]||b[2]||c(d)),f.source.end.offset++;d[0][0]!=="word";)d.length===1&&this.unknownWord(d),f.raws.before+=d.shift()[1];for(f.source.start=this.getPosition(d[0][2]),f.prop="";d.length;){let _=d[0][0];if(_===":"||_==="space"||_==="comment")break;f.prop+=d.shift()[1]}f.raws.between="";let h;for(;d.length;)if(h=d.shift(),h[0]===":"){f.raws.between+=h[1];break}else h[0]==="word"&&/\w/.test(h[1])&&this.unknownWord([h]),f.raws.between+=h[1];(f.prop[0]==="_"||f.prop[0]==="*")&&(f.raws.before+=f.prop[0],f.prop=f.prop.slice(1));let g=[],z;for(;d.length&&(z=d[0][0],!(z!=="space"&&z!=="comment"));)g.push(d.shift());this.precheckMissedSemicolon(d);for(let _=d.length-1;_>=0;_--){if(h=d[_],h[1].toLowerCase()==="!important"){f.important=!0;let v=this.stringFrom(d,_);v=this.spacesFromEnd(d)+v,v!==" !important"&&(f.raws.important=v);break}else if(h[1].toLowerCase()==="important"){let v=d.slice(0),M="";for(let y=_;y>0;y--){let k=v[y][0];if(M.trim().startsWith("!")&&k!=="space")break;M=v.pop()[1]+M}M.trim().startsWith("!")&&(f.important=!0,f.raws.important=M,d=v)}if(h[0]!=="space"&&h[0]!=="comment")break}d.some(_=>_[0]!=="space"&&_[0]!=="comment")&&(f.raws.between+=g.map(_=>_[1]).join(""),g=[]),this.raw(f,"value",g.concat(d),p),f.value.includes(":")&&!p&&this.checkMissedSemicolon(d)}doubleColon(d){throw this.input.error("Double colon",{offset:d[2]},{offset:d[2]+d[1].length})}emptyRule(d){let p=new r;this.init(p,d[2]),p.selector="",p.raws.between="",this.current=p}end(d){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(d[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(d)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(d){if(this.spaces+=d[1],this.current.nodes){let p=this.current.nodes[this.current.nodes.length-1];p&&p.type==="rule"&&!p.raws.ownSemicolon&&(p.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(d){let p=this.input.fromOffset(d);return{column:p.col,line:p.line,offset:d}}init(d,p){this.current.push(d),d.source={input:this.input,start:this.getPosition(p)},d.raws.before=this.spaces,this.spaces="",d.type!=="comment"&&(this.semicolon=!1)}other(d){let p=!1,f=null,b=!1,h=null,g=[],z=d[1].startsWith("--"),A=[],_=d;for(;_;){if(f=_[0],A.push(_),f==="("||f==="[")h||(h=_),g.push(f==="("?")":"]");else if(z&&b&&f==="{")h||(h=_),g.push("}");else if(g.length===0)if(f===";")if(b){this.decl(A,z);return}else break;else if(f==="{"){this.rule(A);return}else if(f==="}"){this.tokenizer.back(A.pop()),p=!0;break}else f===":"&&(b=!0);else f===g[g.length-1]&&(g.pop(),g.length===0&&(h=null));_=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(p=!0),g.length>0&&this.unclosedBracket(h),p&&b){if(!z)for(;A.length&&(_=A[A.length-1][0],!(_!=="space"&&_!=="comment"));)this.tokenizer.back(A.pop());this.decl(A,z)}else this.unknownWord(A)}parse(){let d;for(;!this.tokenizer.endOfFile();)switch(d=this.tokenizer.nextToken(),d[0]){case"space":this.spaces+=d[1];break;case";":this.freeSemicolon(d);break;case"}":this.end(d);break;case"comment":this.comment(d);break;case"at-word":this.atrule(d);break;case"{":this.emptyRule(d);break;default:this.other(d);break}this.endFile()}precheckMissedSemicolon(){}raw(d,p,f,b){let h,g,z=f.length,A="",_=!0,v,M;for(let y=0;yk+S[1],"");d.raws[p]={raw:y,value:A}}d[p]=A}rule(d){d.pop();let p=new r;this.init(p,d[0][2]),p.raws.between=this.spacesAndCommentsFromEnd(d),this.raw(p,"selector",d),this.current=p}spacesAndCommentsFromEnd(d){let p,f="";for(;d.length&&(p=d[d.length-1][0],!(p!=="space"&&p!=="comment"));)f=d.pop()[1]+f;return f}spacesAndCommentsFromStart(d){let p,f="";for(;d.length&&(p=d[0][0],!(p!=="space"&&p!=="comment"));)f+=d.shift()[1];return f}spacesFromEnd(d){let p,f="";for(;d.length&&(p=d[d.length-1][0],p==="space");)f=d.pop()[1]+f;return f}stringFrom(d,p){let f="";for(let b=p;bo.type==="warning")}get content(){return this.css}}return RR=t,t.default=t,RR}var TR,see;function Z_t(){if(see)return TR;see=1;let e=Am(),t=Wme(),n=oge(),o=rge(),r=sge(),s=D7(),i=W7(),{isClean:c,my:l}=N7();const u={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},d={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},p={Once:!0,postcssPlugin:!0,prepare:!0},f=0;function b(v){return typeof v=="object"&&typeof v.then=="function"}function h(v){let M=!1,y=u[v.type];return v.type==="decl"?M=v.prop.toLowerCase():v.type==="atrule"&&(M=v.name.toLowerCase()),M&&v.append?[y,y+"-"+M,f,y+"Exit",y+"Exit-"+M]:M?[y,y+"-"+M,y+"Exit",y+"Exit-"+M]:v.append?[y,f,y+"Exit"]:[y,y+"Exit"]}function g(v){let M;return v.type==="document"?M=["Document",f,"DocumentExit"]:v.type==="root"?M=["Root",f,"RootExit"]:M=h(v),{eventIndex:0,events:M,iterator:0,node:v,visitorIndex:0,visitors:[]}}function z(v){return v[c]=!1,v.nodes&&v.nodes.forEach(M=>z(M)),v}let A={};class _{constructor(M,y,k){this.stringified=!1,this.processed=!1;let S;if(typeof y=="object"&&y!==null&&(y.type==="root"||y.type==="document"))S=z(y);else if(y instanceof _||y instanceof r)S=z(y.root),y.map&&(typeof k.map>"u"&&(k.map={}),k.map.inline||(k.map.inline=!1),k.map.prev=y.map);else{let C=o;k.syntax&&(C=k.syntax.parse),k.parser&&(C=k.parser),C.parse&&(C=C.parse);try{S=C(y,k)}catch(R){this.processed=!0,this.error=R}S&&!S[l]&&e.rebuild(S)}this.result=new r(M,S,k),this.helpers={...A,postcss:A,result:this.result},this.plugins=this.processor.plugins.map(C=>typeof C=="object"&&C.prepare?{...C,...C.prepare(this.result)}:C)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(M){return this.async().catch(M)}finally(M){return this.async().then(M,M)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(M,y){let k=this.result.lastPlugin;try{y&&y.addToError(M),this.error=M,M.name==="CssSyntaxError"&&!M.plugin?(M.plugin=k.postcssPlugin,M.setMessage()):k.postcssVersion}catch(S){console&&console.error&&console.error(S)}return M}prepareVisitors(){this.listeners={};let M=(y,k,S)=>{this.listeners[k]||(this.listeners[k]=[]),this.listeners[k].push([y,S])};for(let y of this.plugins)if(typeof y=="object")for(let k in y){if(!d[k]&&/^[A-Z]/.test(k))throw new Error(`Unknown event ${k} in ${y.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!p[k])if(typeof y[k]=="object")for(let S in y[k])S==="*"?M(y,k,y[k][S]):M(y,k+"-"+S.toLowerCase(),y[k][S]);else typeof y[k]=="function"&&M(y,k,y[k])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let M=0;M0;){let k=this.visitTick(y);if(b(k))try{await k}catch(S){let C=y[y.length-1].node;throw this.handleError(S,C)}}}if(this.listeners.OnceExit)for(let[y,k]of this.listeners.OnceExit){this.result.lastPlugin=y;try{if(M.type==="document"){let S=M.nodes.map(C=>k(C,this.helpers));await Promise.all(S)}else await k(M,this.helpers)}catch(S){throw this.handleError(S)}}}return this.processed=!0,this.stringify()}runOnRoot(M){this.result.lastPlugin=M;try{if(typeof M=="object"&&M.Once){if(this.result.root.type==="document"){let y=this.result.root.nodes.map(k=>M.Once(k,this.helpers));return b(y[0])?Promise.all(y):y}return M.Once(this.result.root,this.helpers)}else if(typeof M=="function")return M(this.result.root,this.result)}catch(y){throw this.handleError(y)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let M=this.result.opts,y=i;M.syntax&&(y=M.syntax.stringify),M.stringifier&&(y=M.stringifier),y.stringify&&(y=y.stringify);let S=new n(y,this.result.root,this.result.opts).generate();return this.result.css=S[0],this.result.map=S[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let M of this.plugins){let y=this.runOnRoot(M);if(b(y))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let M=this.result.root;for(;!M[c];)M[c]=!0,this.walkSync(M);if(this.listeners.OnceExit)if(M.type==="document")for(let y of M.nodes)this.visitSync(this.listeners.OnceExit,y);else this.visitSync(this.listeners.OnceExit,M)}return this.result}then(M,y){return this.async().then(M,y)}toString(){return this.css}visitSync(M,y){for(let[k,S]of M){this.result.lastPlugin=k;let C;try{C=S(y,this.helpers)}catch(R){throw this.handleError(R,y.proxyOf)}if(y.type!=="root"&&y.type!=="document"&&!y.parent)return!0;if(b(C))throw this.getAsyncError()}}visitTick(M){let y=M[M.length-1],{node:k,visitors:S}=y;if(k.type!=="root"&&k.type!=="document"&&!k.parent){M.pop();return}if(S.length>0&&y.visitorIndex{S[c]||this.walkSync(S)});else{let S=this.listeners[k];if(S&&this.visitSync(S,M.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return _.registerPostcss=v=>{A=v},TR=_,_.default=_,s.registerLazyResult(_),t.registerLazyResult(_),TR}var ER,iee;function Q_t(){if(iee)return ER;iee=1;let e=oge(),t=rge();const n=sge();let o=W7();class r{constructor(i,c,l){c=c.toString(),this.stringified=!1,this._processor=i,this._css=c,this._opts=l,this._map=void 0;let u,d=o;this.result=new n(this._processor,u,this._opts),this.result.css=c;let p=this;Object.defineProperty(this.result,"root",{get(){return p.root}});let f=new e(d,u,this._opts,c);if(f.isMap()){let[b,h]=f.generate();b&&(this.result.css=b),h&&(this.result.map=h)}else f.clearAnnotation(),this.result.css=f.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(i){return this.async().catch(i)}finally(i){return this.async().then(i,i)}sync(){if(this.error)throw this.error;return this.result}then(i,c){return this.async().then(i,c)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let i,c=t;try{i=c(this._css,this._opts)}catch(l){this.error=l}if(this.error)throw this.error;return this._root=i,i}get[Symbol.toStringTag](){return"NoWorkResult"}}return ER=r,r.default=r,ER}var WR,aee;function J_t(){if(aee)return WR;aee=1;let e=Wme(),t=Z_t(),n=Q_t(),o=D7();class r{constructor(i=[]){this.version="8.4.49",this.plugins=this.normalize(i)}normalize(i){let c=[];for(let l of i)if(l.postcss===!0?l=l():l.postcss&&(l=l.postcss),typeof l=="object"&&Array.isArray(l.plugins))c=c.concat(l.plugins);else if(typeof l=="object"&&l.postcssPlugin)c.push(l);else if(typeof l=="function")c.push(l);else if(!(typeof l=="object"&&(l.parse||l.stringify)))throw new Error(l+" is not a PostCSS plugin");return c}process(i,c={}){return!this.plugins.length&&!c.parser&&!c.stringifier&&!c.syntax?new n(this,i,c):new t(this,i,c)}use(i){return this.plugins=this.plugins.concat(this.normalize([i])),this}}return WR=r,r.default=r,o.registerProcessor(r),e.registerProcessor(r),WR}var ekt=J_t();const tkt=Zr(ekt);var nkt=E7();const okt=Zr(nkt);var NR,cee;function rkt(){if(cee)return NR;cee=1,NR=function(o){const r=o.prefix,s=/\s+$/.test(r)?r:`${r} `,i=o.ignoreFiles?[].concat(o.ignoreFiles):[],c=o.includeFiles?[].concat(o.includeFiles):[];return function(l){i.length&&l.source.input.file&&e(l.source.input.file,i)||c.length&&l.source.input.file&&!e(l.source.input.file,c)||l.walkRules(u=>{const d=["keyframes","-webkit-keyframes","-moz-keyframes","-o-keyframes","-ms-keyframes"];u.parent&&d.includes(u.parent.name)||(u.selectors=u.selectors.map(p=>o.exclude&&t(p,o.exclude)?p:o.transform?o.transform(r,p,s+p,l.source.input.file,u):s+p))})}};function e(n,o){return o.some(r=>r instanceof RegExp?r.test(n):n.includes(r))}function t(n,o){return o.some(r=>r instanceof RegExp?r.test(n):n===r)}return NR}var skt=rkt();const ikt=Zr(skt);var ov={exports:{}},BR,lee;function akt(){if(lee)return BR;lee=1;var e=40,t=41,n=39,o=34,r=92,s=47,i=44,c=58,l=42,u=117,d=85,p=43,f=/^[a-f0-9?-]+$/i;return BR=function(b){for(var h=[],g=b,z,A,_,v,M,y,k,S,C=0,R=g.charCodeAt(C),T=g.length,E=[{nodes:h}],B=0,N,j="",I="",P="";C=48&&l<=57)return!0;var u=i.charCodeAt(2);return l===n&&u>=48&&u<=57}return c===n?(l=i.charCodeAt(1),l>=48&&l<=57):c>=48&&c<=57}return jR=function(i){var c=0,l=i.length,u,d,p;if(l===0||!s(i))return!1;for(u=i.charCodeAt(c),(u===t||u===e)&&c++;c57));)c+=1;if(u=i.charCodeAt(c),d=i.charCodeAt(c+1),u===n&&d>=48&&d<=57)for(c+=2;c57));)c+=1;if(u=i.charCodeAt(c),d=i.charCodeAt(c+1),p=i.charCodeAt(c+2),(u===o||u===r)&&(d>=48&&d<=57||(d===t||d===e)&&p>=48&&p<=57))for(c+=d===t||d===e?3:2;c57));)c+=1;return{number:i.slice(0,c),unit:i.slice(c)}},jR}var IR,fee;function dkt(){if(fee)return IR;fee=1;var e=akt(),t=ckt(),n=lkt();function o(r){return this instanceof o?(this.nodes=e(r),this):new o(r)}return o.prototype.toString=function(){return Array.isArray(this.nodes)?n(this.nodes):""},o.prototype.walk=function(r,s){return t(this.nodes,r,s),this},o.unit=ukt(),o.walk=t,o.stringify=n,IR=o,IR}var bee;function pkt(){if(bee)return ov.exports;bee=1;const e=dkt();return ov.exports=t=>{const o=Object.assign({skipHostRelativeUrls:!0},t);return{postcssPlugin:"rebaseUrl",Declaration(r){const s=e(r.value);let i=!1;s.walk(c=>{if(c.type!=="function"||c.value!=="url")return;const l=c.nodes[0].value,u=new URL(l,t.rootUrl);return u.pathname===l&&o.skipHostRelativeUrls||(c.nodes[0].value=u.toString(),i=!0),!1}),i&&(r.value=e.stringify(s))}}},ov.exports.postcss=!0,ov.exports}var fkt=pkt();const bkt=Zr(fkt),hee=new Map,ige=[{type:"type",content:"body"},{type:"type",content:"html"},{type:"pseudo-class",content:":root"},{type:"pseudo-class",content:":where(body)"},{type:"pseudo-class",content:":where(:root)"},{type:"pseudo-class",content:":where(html)"}];function hkt(e,t){const n=jQ(t),o=n.findLastIndex(({content:i,type:c})=>ige.some(l=>i===l.content&&c===l.type));let r=-1;for(let i=o+1;ip instanceof RegExp?l.match(p):l.includes(p))?l:ige.some(p=>l.startsWith(p.content))?hkt(c,l):u}}),n&&bkt({rootUrl:n})].filter(Boolean)).process(e,{}).css}catch(i){return i instanceof okt?console.warn("wp.blockEditor.transformStyles Failed to transform CSS.",i.message+` -`+i.showSourceCode(!1)):console.warn("wp.blockEditor.transformStyles Failed to transform CSS.",i),null}}const Fx=(e,t="",n)=>{let o=hee.get(t);return o||(o=new WeakMap,hee.set(t,o)),e.map(r=>{let s=o.get(r);return s||(s=mkt(r,t,n),o.set(r,s)),s})};Xs([Gs,Uf]);function gkt(e,t){return x.useCallback(n=>{if(!n)return;const{ownerDocument:o}=n,{defaultView:r,body:s}=o,i=t?o.querySelector(t):s;let c;if(i)c=r?.getComputedStyle(i,null).getPropertyValue("background-color");else{const u=o.createElement("div");u.classList.add("editor-styles-wrapper"),s.appendChild(u),c=r?.getComputedStyle(u,null).getPropertyValue("background-color"),s.removeChild(u)}const l=an(c);l.luminance()>.5||l.alpha()===0?s.classList.remove("is-dark-theme"):s.classList.add("is-dark-theme")},[e,t])}function Mkt({styles:e,scope:t,transformOptions:n}){const o=G(i=>ct(i(J)).getStyleOverrides(),[]),[r,s]=x.useMemo(()=>{const i=Object.values(e??[]);for(const[c,l]of o){const u=i.findIndex(({id:p})=>c===p),d={...l,id:c};u===-1?i.push(d):i[u]=d}return[Fx(i.filter(c=>c?.css),t,n),i.filter(c=>c.__unstableType==="svgs").map(c=>c.assets).join("")]},[e,o,t,n]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{ref:gkt(r,t)}),r.map((i,c)=>a.jsx("style",{children:i},c)),a.jsx(ge,{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:s}})]})}const $x=x.memo(Mkt),zkt=x.memo(B_),DR=2e3,Okt=[];function ykt({viewportWidth:e,containerWidth:t,minHeight:n,additionalStyles:o=Okt}){e||(e=t);const[r,{height:s}]=js(),{styles:i}=G(d=>({styles:d(J).getSettings().styles}),[]),c=x.useMemo(()=>i&&[...i,{css:"body{height:auto;overflow:hidden;border:none;padding:0;}",__unstableType:"presets"},...o],[i,o]),l=t/e,u=s?t/(s*l):0;return a.jsx(I1,{className:"block-editor-block-preview__content",style:{transform:`scale(${l})`,aspectRatio:u,maxHeight:s>DR?DR*l:void 0,minHeight:n},children:a.jsxs(qme,{contentRef:Mn(d=>{const{ownerDocument:{documentElement:p}}=d;p.classList.add("block-editor-block-preview__content-iframe"),p.style.position="absolute",p.style.width="100%",d.style.boxSizing="border-box",d.style.position="absolute",d.style.width="100%"},[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:e,height:s,pointerEvents:"none",maxHeight:DR,minHeight:l!==0&&l<1&&n?n/l:n},children:[a.jsx($x,{styles:c}),r,a.jsx(zkt,{renderAppender:!1})]})})}function Akt(e){const[t,{width:n}]=js();return a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{position:"relative",width:"100%",height:0},children:t}),a.jsx("div",{className:"block-editor-block-preview__container",children:!!n&&a.jsx(ykt,{...e,containerWidth:n})})]})}const mee=UN();function vkt({children:e,placeholder:t}){const[n,o]=x.useState(!1);return x.useEffect(()=>{const r={};return mee.add(r,()=>{hs.flushSync(()=>{o(!0)})}),()=>{mee.cancel(r)}},[]),n?e:t}const xkt=[];function wkt({blocks:e,viewportWidth:t=1200,minHeight:n,additionalStyles:o=xkt,__experimentalMinHeight:r,__experimentalPadding:s}){r&&(n=r,Ke("The __experimentalMinHeight prop",{since:"6.2",version:"6.4",alternative:"minHeight"})),s&&(o=[...o,{css:`body { padding: ${s}px; }`}],Ke("The __experimentalPadding prop of BlockPreview",{since:"6.2",version:"6.4",alternative:"additionalStyles"}));const i=G(u=>u(J).getSettings(),[]),c=x.useMemo(()=>({...i,focusMode:!1,isPreviewMode:!0}),[i]),l=x.useMemo(()=>Array.isArray(e)?e:[e],[e]);return!e||e.length===0?null:a.jsx(q_,{value:l,settings:c,children:a.jsx(Akt,{viewportWidth:t,minHeight:n,additionalStyles:o})})}const Vd=x.memo(wkt);Vd.Async=vkt;function F7({blocks:e,props:t={},layout:n}){const o=G(u=>u(J).getSettings(),[]),r=x.useMemo(()=>({...o,styles:void 0,focusMode:!1,isPreviewMode:!0}),[o]),s=$N(),i=xn([t.ref,s]),c=x.useMemo(()=>Array.isArray(e)?e:[e],[e]),l=a.jsxs(q_,{value:c,settings:r,children:[a.jsx($x,{}),a.jsx(G7,{renderAppender:!1,layout:n})]});return{...t,ref:i,className:oe(t.className,"block-editor-block-preview__live-content","components-disabled"),children:e?.length?l:null}}function age({item:e}){var t;const{name:n,title:o,icon:r,description:s,initialAttributes:i,example:c}=e,l=Qd(e),u=x.useMemo(()=>c?LB(n,{attributes:{...c.attributes,...i},innerBlocks:c.innerBlocks}):Ee(n,i),[n,c,i]),d=144,p=280,f=(t=c?.viewportWidth)!==null&&t!==void 0?t:500,b=p/f,h=b!==0&&b<1&&d?d/b:d;return a.jsxs("div",{className:"block-editor-inserter__preview-container",children:[a.jsx("div",{className:"block-editor-inserter__preview",children:l||c?a.jsx("div",{className:"block-editor-inserter__preview-content",children:a.jsx(Vd,{blocks:u,viewportWidth:f,minHeight:d,additionalStyles:[{css:` +`+i.showSourceCode(!1)):console.warn("wp.blockEditor.transformStyles Failed to transform CSS.",i),null}}const Fx=(e,t="",n)=>{let o=hee.get(t);return o||(o=new WeakMap,hee.set(t,o)),e.map(r=>{let s=o.get(r);return s||(s=mkt(r,t,n),o.set(r,s)),s})};Xs([Gs,Uf]);function gkt(e,t){return x.useCallback(n=>{if(!n)return;const{ownerDocument:o}=n,{defaultView:r,body:s}=o,i=t?o.querySelector(t):s;let c;if(i)c=r?.getComputedStyle(i,null).getPropertyValue("background-color");else{const u=o.createElement("div");u.classList.add("editor-styles-wrapper"),s.appendChild(u),c=r?.getComputedStyle(u,null).getPropertyValue("background-color"),s.removeChild(u)}const l=an(c);l.luminance()>.5||l.alpha()===0?s.classList.remove("is-dark-theme"):s.classList.add("is-dark-theme")},[e,t])}function Mkt({styles:e,scope:t,transformOptions:n}){const o=G(i=>ct(i(J)).getStyleOverrides(),[]),[r,s]=x.useMemo(()=>{const i=Object.values(e??[]);for(const[c,l]of o){const u=i.findIndex(({id:p})=>c===p),d={...l,id:c};u===-1?i.push(d):i[u]=d}return[Fx(i.filter(c=>c?.css),t,n),i.filter(c=>c.__unstableType==="svgs").map(c=>c.assets).join("")]},[e,o,t,n]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{ref:gkt(r,t)}),r.map((i,c)=>a.jsx("style",{children:i},c)),a.jsx(ge,{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:s}})]})}const $x=x.memo(Mkt),zkt=x.memo(B_),DR=2e3,Okt=[];function ykt({viewportWidth:e,containerWidth:t,minHeight:n,additionalStyles:o=Okt}){e||(e=t);const[r,{height:s}]=js(),{styles:i}=G(d=>({styles:d(J).getSettings().styles}),[]),c=x.useMemo(()=>i&&[...i,{css:"body{height:auto;overflow:hidden;border:none;padding:0;}",__unstableType:"presets"},...o],[i,o]),l=t/e,u=s?t/(s*l):0;return a.jsx(I1,{className:"block-editor-block-preview__content",style:{transform:`scale(${l})`,aspectRatio:u,maxHeight:s>DR?DR*l:void 0,minHeight:n},children:a.jsxs(qme,{contentRef:Mn(d=>{const{ownerDocument:{documentElement:p}}=d;p.classList.add("block-editor-block-preview__content-iframe"),p.style.position="absolute",p.style.width="100%",d.style.boxSizing="border-box",d.style.position="absolute",d.style.width="100%"},[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:e,height:s,pointerEvents:"none",maxHeight:DR,minHeight:l!==0&&l<1&&n?n/l:n},children:[a.jsx($x,{styles:c}),r,a.jsx(zkt,{renderAppender:!1})]})})}function Akt(e){const[t,{width:n}]=js();return a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{position:"relative",width:"100%",height:0},children:t}),a.jsx("div",{className:"block-editor-block-preview__container",children:!!n&&a.jsx(ykt,{...e,containerWidth:n})})]})}const mee=FN();function vkt({children:e,placeholder:t}){const[n,o]=x.useState(!1);return x.useEffect(()=>{const r={};return mee.add(r,()=>{hs.flushSync(()=>{o(!0)})}),()=>{mee.cancel(r)}},[]),n?e:t}const xkt=[];function wkt({blocks:e,viewportWidth:t=1200,minHeight:n,additionalStyles:o=xkt,__experimentalMinHeight:r,__experimentalPadding:s}){r&&(n=r,Ke("The __experimentalMinHeight prop",{since:"6.2",version:"6.4",alternative:"minHeight"})),s&&(o=[...o,{css:`body { padding: ${s}px; }`}],Ke("The __experimentalPadding prop of BlockPreview",{since:"6.2",version:"6.4",alternative:"additionalStyles"}));const i=G(u=>u(J).getSettings(),[]),c=x.useMemo(()=>({...i,focusMode:!1,isPreviewMode:!0}),[i]),l=x.useMemo(()=>Array.isArray(e)?e:[e],[e]);return!e||e.length===0?null:a.jsx(q_,{value:l,settings:c,children:a.jsx(Akt,{viewportWidth:t,minHeight:n,additionalStyles:o})})}const Vd=x.memo(wkt);Vd.Async=vkt;function F7({blocks:e,props:t={},layout:n}){const o=G(u=>u(J).getSettings(),[]),r=x.useMemo(()=>({...o,styles:void 0,focusMode:!1,isPreviewMode:!0}),[o]),s=jN(),i=xn([t.ref,s]),c=x.useMemo(()=>Array.isArray(e)?e:[e],[e]),l=a.jsxs(q_,{value:c,settings:r,children:[a.jsx($x,{}),a.jsx(G7,{renderAppender:!1,layout:n})]});return{...t,ref:i,className:oe(t.className,"block-editor-block-preview__live-content","components-disabled"),children:e?.length?l:null}}function age({item:e}){var t;const{name:n,title:o,icon:r,description:s,initialAttributes:i,example:c}=e,l=Qd(e),u=x.useMemo(()=>c?LB(n,{attributes:{...c.attributes,...i},innerBlocks:c.innerBlocks}):Ee(n,i),[n,c,i]),d=144,p=280,f=(t=c?.viewportWidth)!==null&&t!==void 0?t:500,b=p/f,h=b!==0&&b<1&&d?d/b:d;return a.jsxs("div",{className:"block-editor-inserter__preview-container",children:[a.jsx("div",{className:"block-editor-inserter__preview",children:l||c?a.jsx("div",{className:"block-editor-inserter__preview-content",children:a.jsx(Vd,{blocks:u,viewportWidth:f,minHeight:d,additionalStyles:[{css:` body { padding: 24px; min-height:${Math.round(h)}px; @@ -565,7 +565,7 @@ The screen with id ${t.id} will not be added.`),e):[...e,t]}function Bbt({screen align-items:center; } .is-root-container { width: 100%; } - `}]})}):a.jsx("div",{className:"block-editor-inserter__preview-content-missing",children:m("No preview available.")})}),!l&&a.jsx(hme,{title:o,icon:r,description:s})]})}function _kt(e,t){const[n,o]=x.useState(!1);return x.useEffect(()=>{n&&Yt(m("Use left and right arrow keys to move through blocks"))},[n]),a.jsx("div",{ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{o(!0)},onBlur:r=>{!r.currentTarget.contains(r.relatedTarget)&&o(!1)},...e})}const kkt=x.forwardRef(_kt);function Skt(e,t){return a.jsx(C1.Group,{role:"presentation",ref:t,...e})}const Ckt=x.forwardRef(Skt);function qkt({isFirst:e,as:t,children:n,...o},r){return a.jsx(C1.Item,{ref:r,role:"option",accessibleWhenDisabled:!0,...o,render:s=>{const i={...s,tabIndex:e?0:s.tabIndex};return t?a.jsx(t,{...i,children:n}):typeof n=="function"?n(i):a.jsx(Ce,{__next40pxDefaultSize:!0,...i,children:n})}})}const Rkt=x.forwardRef(qkt);function $7({children:e}){return a.jsx(C1,{focusShift:!0,focusWrap:"horizontal",render:a.jsx(a.Fragment,{}),children:e})}const V7=({isEnabled:e,blocks:t,icon:n,children:o,pattern:r})=>{const s=G(d=>{const{getBlockType:p}=d(kt);return t.length===1&&p(t[0].name)?.icon},[t]),{startDragging:i,stopDragging:c}=ct(Oe(J)),l=x.useMemo(()=>r?.type===g1.user&&r?.syncStatus!=="unsynced"?[Ee("core/block",{ref:r.id})]:void 0,[r?.type,r?.syncStatus,r?.id]);if(!e)return o({draggable:!1,onDragStart:void 0,onDragEnd:void 0});const u=l??t;return a.jsx(Hbe,{__experimentalTransferDataType:"wp-blocks",transferData:{type:"inserter",blocks:u},onDragStart:d=>{i();for(const p of u){const f=`wp-block:${p.name}`;d.dataTransfer.items.add("",f)}},onDragEnd:()=>{c()},__experimentalDragComponent:a.jsx(k7,{count:t.length,icon:n||!r&&s,isPattern:!!r}),children:({onDraggableStart:d,onDraggableEnd:p})=>o({draggable:!0,onDragStart:d,onDragEnd:p})})};function Tkt({className:e,isFirst:t,item:n,onSelect:o,onHover:r,isDraggable:s,...i}){const c=x.useRef(!1),l=n.icon?{backgroundColor:n.icon.background,color:n.icon.foreground}:{},u=x.useMemo(()=>[Ee(n.name,n.initialAttributes,Ad(n.innerBlocks))],[n.name,n.initialAttributes,n.innerBlocks]),d=Qd(n)&&n.syncStatus!=="unsynced"||Hh(n);return a.jsx(V7,{isEnabled:s&&!n.isDisabled,blocks:u,icon:n.icon,children:({draggable:p,onDragStart:f,onDragEnd:b})=>a.jsx("div",{className:oe("block-editor-block-types-list__list-item",{"is-synced":d}),draggable:p,onDragStart:h=>{c.current=!0,f&&(r(null),f(h))},onDragEnd:h=>{c.current=!1,b&&b(h)},children:a.jsxs(Rkt,{isFirst:t,className:oe("block-editor-block-types-list__item",e),disabled:n.isDisabled,onClick:h=>{h.preventDefault(),o(n,da()?h.metaKey:h.ctrlKey),r(null)},onKeyDown:h=>{const{keyCode:g}=h;g===Gr&&(h.preventDefault(),o(n,da()?h.metaKey:h.ctrlKey),r(null))},onMouseEnter:()=>{c.current||r(n)},onMouseLeave:()=>r(null),...i,children:[a.jsx("span",{className:"block-editor-block-types-list__item-icon",style:l,children:a.jsx(Zn,{icon:n.icon,showColors:!0})}),a.jsx("span",{className:"block-editor-block-types-list__item-title",children:a.jsx(zs,{numberOfLines:3,children:n.title})})]})})})}const Ekt=x.memo(Tkt);function Wkt(e,t){const n=[];for(let o=0,r=e.length;o{},children:o,label:r,isDraggable:s=!0}){const i="block-editor-block-types-list",c=vt(O2,i);return a.jsxs(kkt,{className:i,"aria-label":r,children:[Wkt(e,3).map((l,u)=>a.jsx(Ckt,{children:l.map((d,p)=>a.jsx(Ekt,{item:d,className:jB(d.id),onSelect:t,onHover:n,isDraggable:s&&!d.isDisabled,isFirst:u===0&&p===0,rowId:`${c}-${u}`},d.id))},u)),o]})}function y2({title:e,icon:t,children:n}){return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"block-editor-inserter__panel-header",children:[a.jsx("h2",{className:"block-editor-inserter__panel-title",children:e}),a.jsx(qo,{icon:t})]}),a.jsx("div",{className:"block-editor-inserter__panel-content",children:n})]})}function kh(){return a.jsxs("div",{className:"block-editor-inserter__no-results",children:[a.jsx(wn,{className:"block-editor-inserter__no-results-icon",icon:Cw}),a.jsx("p",{children:m("No results found.")})]})}const Nkt=e=>e.name.split("/")[0],Bkt=6,Lkt=[];function gee({items:e,collections:t,categories:n,onSelectItem:o,onHover:r,showMostUsedBlocks:s,className:i}){const c=x.useMemo(()=>hO(e,"frecency","desc").slice(0,Bkt),[e]),l=x.useMemo(()=>e.filter(h=>!h.category),[e]),u=x.useMemo(()=>{const h={...t};return Object.keys(t).forEach(g=>{h[g]=e.filter(z=>Nkt(z)===g),h[g].length===0&&delete h[g]}),h},[e,t]);x.useEffect(()=>()=>r(null),[]);const d=R4(n),p=n.length===d.length,f=x.useMemo(()=>Object.entries(t),[t]),b=R4(p?f:Lkt);return a.jsxs("div",{className:i,children:[s&&e.length>3&&!!c.length&&a.jsx(y2,{title:We("Most used","blocks"),children:a.jsx(O2,{items:c,onSelect:o,onHover:r,label:We("Most used","blocks")})}),d.map(h=>{const g=e.filter(z=>z.category===h.slug);return!g||!g.length?null:a.jsx(y2,{title:h.title,icon:h.icon,children:a.jsx(O2,{items:g,onSelect:o,onHover:r,label:h.title})},h.slug)}),p&&l.length>0&&a.jsx(y2,{className:"block-editor-inserter__uncategorized-blocks-panel",title:m("Uncategorized"),children:a.jsx(O2,{items:l,onSelect:o,onHover:r,label:m("Uncategorized")})}),b.map(([h,g])=>{const z=u[h];return!z||!z.length?null:a.jsx(y2,{title:g.title,icon:g.icon,children:a.jsx(O2,{items:z,onSelect:o,onHover:r,label:g.title})},h)})]})}function Pkt({rootClientId:e,onInsert:t,onHover:n,showMostUsedBlocks:o},r){const[s,i,c,l]=h_(e,t);if(!s.length)return a.jsx(kh,{});const u=[],d=[];for(const p of s)p.category!=="reusable"&&(p.isAllowedInCurrentRoot?u.push(p):d.push(p));return a.jsx($7,{children:a.jsxs("div",{ref:r,children:[!!u.length&&a.jsx(a.Fragment,{children:a.jsx(gee,{items:u,categories:i,collections:c,onSelectItem:l,onHover:n,showMostUsedBlocks:o,className:"block-editor-inserter__insertable-blocks-at-selection"})}),a.jsx(gee,{items:d,categories:i,collections:c,onSelectItem:l,onHover:n,showMostUsedBlocks:o,className:"block-editor-inserter__all-blocks"})]})})}const jkt=x.forwardRef(Pkt);function Ikt({selectedCategory:e,patternCategories:t,onClickCategory:n}){const o="block-editor-block-patterns-explorer__sidebar";return a.jsx("div",{className:`${o}__categories-list`,children:t.map(({name:r,label:s})=>a.jsx(Ce,{__next40pxDefaultSize:!0,label:s,className:`${o}__categories-list__item`,isPressed:e===r,onClick:()=>{n(r)},children:s},r))})}function Dkt({searchValue:e,setSearchValue:t}){return a.jsx("div",{className:"block-editor-block-patterns-explorer__search",children:a.jsx(su,{__nextHasNoMarginBottom:!0,onChange:t,value:e,label:m("Search"),placeholder:m("Search")})})}function Fkt({selectedCategory:e,patternCategories:t,onClickCategory:n,searchValue:o,setSearchValue:r}){return a.jsxs("div",{className:"block-editor-block-patterns-explorer__sidebar",children:[a.jsx(Dkt,{searchValue:o,setSearchValue:r}),!o&&a.jsx(Ikt,{selectedCategory:e,patternCategories:t,onClickCategory:n})]})}function cge({currentPage:e,numPages:t,changePage:n,totalItems:o}){return a.jsxs(dt,{className:"block-editor-patterns__grid-pagination-wrapper",children:[a.jsx(Sn,{variant:"muted",children:xe(Dn("%s item","%s items",o),o)}),t>1&&a.jsxs(Ot,{expanded:!1,spacing:3,justify:"flex-start",className:"block-editor-patterns__grid-pagination",children:[a.jsxs(Ot,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-previous",children:[a.jsx(Ce,{variant:"tertiary",onClick:()=>n(1),disabled:e===1,"aria-label":m("First page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:a.jsx("span",{children:"«"})}),a.jsx(Ce,{variant:"tertiary",onClick:()=>n(e-1),disabled:e===1,"aria-label":m("Previous page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:a.jsx("span",{children:"‹"})})]}),a.jsx(Sn,{variant:"muted",children:xe(We("%1$s of %2$s","paging"),e,t)}),a.jsxs(Ot,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-next",children:[a.jsx(Ce,{variant:"tertiary",onClick:()=>n(e+1),disabled:e===t,"aria-label":m("Next page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:a.jsx("span",{children:"›"})}),a.jsx(Ce,{variant:"tertiary",onClick:()=>n(t),disabled:e===t,"aria-label":m("Last page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:a.jsx("span",{children:"»"})})]})]})]})}const $kt=({showTooltip:e,title:t,children:n})=>e?a.jsx(B0,{text:t,children:n}):a.jsx(a.Fragment,{children:n});function lge({id:e,isDraggable:t,pattern:n,onClick:o,onHover:r,showTitlesAsTooltip:s,category:i,isSelected:c}){const[l,u]=x.useState(!1),{blocks:d,viewportWidth:p}=n,b=`block-editor-block-patterns-list__item-description-${vt(lge)}`,h=n.type===g1.user,g=x.useMemo(()=>!i||!t?d:(d??[]).map(z=>{const A=jo(z);return A.attributes.metadata?.categories?.includes(i)&&(A.attributes.metadata.categories=[i]),A}),[d,t,i]);return a.jsx(V7,{isEnabled:t,blocks:g,pattern:n,children:({draggable:z,onDragStart:A,onDragEnd:_})=>a.jsx("div",{className:"block-editor-block-patterns-list__list-item",draggable:z,onDragStart:v=>{u(!0),A&&(r?.(null),A(v))},onDragEnd:v=>{u(!1),_&&_(v)},children:a.jsx($kt,{showTooltip:s&&!h,title:n.title,children:a.jsxs(C1.Item,{render:a.jsx("div",{role:"option","aria-label":n.title,"aria-describedby":n.description?b:void 0,className:oe("block-editor-block-patterns-list__item",{"block-editor-block-patterns-list__list-item-synced":n.type===g1.user&&!n.syncStatus,"is-selected":c})}),id:e,onClick:()=>{o(n,d),r?.(null)},onMouseEnter:()=>{l||r?.(n)},onMouseLeave:()=>r?.(null),children:[a.jsx(Vd.Async,{placeholder:a.jsx(Vkt,{}),children:a.jsx(Vd,{blocks:d,viewportWidth:p})}),(!s||h)&&a.jsxs(Ot,{className:"block-editor-patterns__pattern-details",spacing:2,children:[h&&!n.syncStatus&&a.jsx("div",{className:"block-editor-patterns__pattern-icon-wrapper",children:a.jsx(wn,{className:"block-editor-patterns__pattern-icon",icon:Bd})}),a.jsx("div",{className:"block-editor-block-patterns-list__item-title",children:n.title})]}),!!n.description&&a.jsx(qn,{id:b,children:n.description})]})})})})}function Vkt(){return a.jsx("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}function Hkt({isDraggable:e,blockPatterns:t,onHover:n,onClickPattern:o,orientation:r,label:s=m("Block patterns"),category:i,showTitlesAsTooltip:c,pagingProps:l},u){const[d,p]=x.useState(void 0),[f,b]=x.useState(null);x.useEffect(()=>{const g=t[0]?.name;p(g)},[t]);const h=(g,z)=>{b(g.name),o(g,z)};return a.jsxs(C1,{orientation:r,activeId:d,setActiveId:p,role:"listbox",className:"block-editor-block-patterns-list","aria-label":s,ref:u,children:[t.map(g=>a.jsx(lge,{id:g.name,pattern:g,onClick:h,onHover:n,isDraggable:e,showTitlesAsTooltip:c,category:i,isSelected:!!f&&f===g.name},g.name)),l&&a.jsx(cge,{...l})]})}const qa=x.forwardRef(Hkt);function Mee({destinationRootClientId:e,destinationIndex:t,rootClientId:n,registry:o}){if(n===e)return t;const r=["",...o.select(J).getBlockParents(e),e],s=r.indexOf(n);return s!==-1?o.select(J).getBlockIndex(r[s+1])+1:o.select(J).getBlockOrder(n).length}function E_({rootClientId:e="",insertionIndex:t,clientId:n,isAppender:o,onSelect:r,shouldFocusBlock:s=!0,selectBlockOnInsert:i=!0}){const c=Fn(),{getSelectedBlock:l,getClosestAllowedInsertionPoint:u,isBlockInsertionPointVisible:d}=ct(G(J)),{destinationRootClientId:p,destinationIndex:f}=G(M=>{const{getSelectedBlockClientId:y,getBlockRootClientId:k,getBlockIndex:S,getBlockOrder:C,getInsertionPoint:R}=ct(M(J)),T=y();let E=e,B;const N=R();return t!==void 0?B=t:N&&N.hasOwnProperty("index")?(E=N?.rootClientId?N.rootClientId:e,B=N.index):n?B=S(n):!o&&T?(E=k(T),B=S(T)+1):B=C(E).length,{destinationRootClientId:E,destinationIndex:B}},[e,t,n,o]),{replaceBlocks:b,insertBlocks:h,showInsertionPoint:g,hideInsertionPoint:z,setLastFocus:A}=ct(Oe(J)),_=x.useCallback((M,y,k=!1,S)=>{(k||s||i)&&A(null);const C=l();!o&&C&&El(C)?b(C.clientId,M,null,s||k?0:null,y):h(M,o||S===void 0?f:Mee({destinationRootClientId:p,destinationIndex:f,rootClientId:S,registry:c}),o||S===void 0?p:S,i,s||k?0:null,y);const R=Array.isArray(M)?M.length:1,T=xe(Dn("%d block added.","%d blocks added.",R),R);Yt(T),r&&r(M)},[o,l,b,h,p,f,r,s,i]),v=x.useCallback(M=>{if(M&&!d()){const y=u(M.name,p);y!==null&&g(y,Mee({destinationRootClientId:p,destinationIndex:f,rootClientId:y,registry:c}))}else z()},[u,d,g,z,p,f]);return[p,_,v]}const W_=(e,t,n,o)=>{const r=x.useMemo(()=>({[bO]:!!o}),[o]),{patternCategories:s,patterns:i,userPatternCategories:c}=G(f=>{const{getSettings:b,__experimentalGetAllowedPatterns:h}=ct(f(J)),{__experimentalUserPatternCategories:g,__experimentalBlockPatternCategories:z}=b();return{patterns:h(t,r),userPatternCategories:g,patternCategories:z}},[t,r]),{getClosestAllowedInsertionPointForPattern:l}=ct(G(J)),u=x.useMemo(()=>{const f=[...s];return c?.forEach(b=>{f.find(h=>h.name===b.name)||f.push(b)}),f},[s,c]),{createSuccessNotice:d}=Oe(mt),p=x.useCallback((f,b)=>{const h=l(f,t);if(h===null)return;const g=f.type===g1.user&&f.syncStatus!=="unsynced"?[Ee("core/block",{ref:f.id})]:b;e((g??[]).map(z=>{const A=jo(z);return A.attributes.metadata?.categories?.includes(n)&&(A.attributes.metadata.categories=[n]),A}),f.name,!1,h),d(xe(m('Block pattern "%s" inserted.'),f.title),{type:"snackbar",id:"inserter-notice"})},[d,e,n,t,l,o]);return[i,u,p]},rv=20;function uge(e,t,n,o=""){const[r,s]=x.useState(1),i=Fr(t),c=Fr(o);(i!==t||c!==o)&&r!==1&&s(1);const l=e.length,u=r-1,d=x.useMemo(()=>e.slice(u*rv,u*rv+rv),[u,e]),p=Math.ceil(e.length/rv),f=b=>{ps(n?.current)?.scrollTo(0,0),s(b)};return x.useEffect(function(){ps(n?.current)?.scrollTo(0,0)},[t,n]),{totalItems:l,categoryPatterns:d,numPages:p,changePage:f,currentPage:r}}function Ukt({filterValue:e,filteredBlockPatternsLength:t}){return e?a.jsx(_a,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count",children:xe(Dn("%d pattern found","%d patterns found",t),t)}):null}function Xkt({searchValue:e,selectedCategory:t,patternCategories:n,rootClientId:o}){const r=x.useRef(),s=q1(Yt,500),[i,c]=E_({rootClientId:o,shouldFocusBlock:!0}),[l,,u]=W_(c,i,t),d=x.useMemo(()=>n.map(z=>z.name),[n]),p=x.useMemo(()=>{const z=l.filter(A=>{if(t===qx.name||t===pO.name&&A.type===g1.user)return!0;if(t==="uncategorized"){var _;const v=(_=A.categories?.some(M=>d.includes(M)))!==null&&_!==void 0?_:!1;return!A.categories?.length||!v}return A.categories?.includes(t)});return e?l7(z,e):z},[e,l,t,d]);x.useEffect(()=>{if(!e)return;const z=p.length,A=xe(Dn("%d result found.","%d results found.",z),z);s(A)},[e,s,p.length]);const f=uge(p,t,r),[b,h]=x.useState(e);e!==b&&(h(e),f.changePage(1));const g=!!p?.length;return a.jsxs("div",{className:"block-editor-block-patterns-explorer__list",ref:r,children:[a.jsx(Ukt,{filterValue:e,filteredBlockPatternsLength:p.length}),a.jsx($7,{children:g&&a.jsxs(a.Fragment,{children:[a.jsx(qa,{blockPatterns:f.categoryPatterns,onClickPattern:u,isDraggable:!1}),a.jsx(cge,{...f})]})})]})}function Gkt(e,t){return!e.categories||!e.categories.length?!1:e.categories.some(n=>t.some(o=>o.name===n))}function H7(e,t="all"){const[n,o]=W_(void 0,e),r=x.useMemo(()=>t==="all"?n:n.filter(i=>!q2e(i,t)),[t,n]);return x.useMemo(()=>{const i=o.filter(c=>r.some(l=>l.categories?.includes(c.name))).sort((c,l)=>c.label.localeCompare(l.label));return r.some(c=>!Gkt(c,o))&&!i.find(c=>c.name==="uncategorized")&&i.push({name:"uncategorized",label:We("Uncategorized")}),r.some(c=>c.blockTypes?.includes("core/post-content"))&&i.unshift(C2e),r.some(c=>c.type===g1.user)&&i.unshift(pO),r.length>0&&i.unshift({name:qx.name,label:qx.label}),Yt(xe(Dn("%d category button displayed.","%d category buttons displayed.",i.length),i.length)),i},[o,r])}function Kkt({initialCategory:e,rootClientId:t}){const[n,o]=x.useState(""),[r,s]=x.useState(e),i=H7(t);return a.jsxs("div",{className:"block-editor-block-patterns-explorer",children:[a.jsx(Fkt,{selectedCategory:r,patternCategories:i,onClickCategory:s,searchValue:n,setSearchValue:o}),a.jsx(Xkt,{searchValue:n,selectedCategory:r,patternCategories:i,rootClientId:t})]})}function Ykt({onModalClose:e,...t}){return a.jsx(Zo,{title:m("Patterns"),onRequestClose:e,isFullScreen:!0,children:a.jsx(Kkt,{...t})})}function Zkt({title:e}){return a.jsx(dt,{spacing:0,children:a.jsx(mo,{children:a.jsx(t1,{marginBottom:0,paddingX:4,paddingY:3,children:a.jsxs(Ot,{spacing:2,children:[a.jsx(ic.BackButton,{style:{minWidth:24,padding:0},icon:jt()?ma:Ll,size:"small",label:m("Back")}),a.jsx(t1,{children:a.jsx(_a,{level:5,children:e})})]})})})})}function dge({categories:e,children:t}){return a.jsxs(ic,{initialPath:"/",className:"block-editor-inserter__mobile-tab-navigation",children:[a.jsx(ic.Screen,{path:"/",children:a.jsx(tb,{children:e.map(n=>a.jsx(ic.Button,{path:`/category/${n.name}`,as:oO,isAction:!0,children:a.jsxs(Ot,{children:[a.jsx(eu,{children:n.label}),a.jsx(wn,{icon:jt()?Ll:ma})]})},n.name))})}),e.map(n=>a.jsxs(ic.Screen,{path:`/category/${n.name}`,children:[a.jsx(Zkt,{title:m("Back")}),t(n)]},n.name))]})}const zee=e=>e!=="all"&&e!=="user",Qkt=e=>e?.name===pO.name,Jkt=[{value:"all",label:We("All","patterns")},{value:g1.directory,label:m("Pattern Directory")},{value:g1.theme,label:m("Theme & Plugins")},{value:g1.user,label:m("User")}];function e6t({setPatternSyncFilter:e,setPatternSourceFilter:t,patternSyncFilter:n,patternSourceFilter:o,scrollContainerRef:r,category:s}){const i=s?.name===pO.name?g1.user:o,c=zee(i),l=Qkt(s),u=x.useMemo(()=>[{value:"all",label:We("All","patterns")},{value:Cx.full,label:We("Synced","patterns"),disabled:c},{value:Cx.unsynced,label:We("Not synced","patterns"),disabled:c}],[c]);function d(p){t(p),zee(p)&&e("all")}return a.jsx(a.Fragment,{children:a.jsx(c0,{popoverProps:{placement:"right-end"},label:m("Filter patterns"),toggleProps:{size:"compact"},icon:a.jsx(wn,{icon:a.jsx(ge,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:a.jsx(he,{d:"M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z",fill:"currentColor"})})}),children:()=>a.jsxs(a.Fragment,{children:[!l&&a.jsx(Cn,{label:m("Source"),children:a.jsx(kf,{choices:Jkt,onSelect:p=>{d(p),r.current?.scrollTo(0,0)},value:i})}),a.jsx(Cn,{label:m("Type"),children:a.jsx(kf,{choices:u,onSelect:p=>{e(p),r.current?.scrollTo(0,0)},value:n})}),a.jsx("div",{className:"block-editor-inserter__patterns-filter-help",children:cr(m("Patterns are available from the WordPress.org Pattern Directory, bundled in the active theme, or created by users on this site. Only patterns created on this site can be synced."),{Link:a.jsx(hr,{href:m("https://wordpress.org/patterns/")})})})]})})})}const t6t=()=>{};function pge({rootClientId:e,onInsert:t,onHover:n=t6t,category:o,showTitlesAsTooltip:r}){const[s,,i]=W_(t,e,o?.name),[c,l]=x.useState("all"),[u,d]=x.useState("all"),p=H7(e,u),f=x.useRef(),b=x.useMemo(()=>s.filter(_=>q2e(_,u,c)?!1:o.name===qx?.name||o.name===pO?.name&&_.type===g1.user||o.name===C2e?.name&&_.blockTypes?.includes("core/post-content")?!0:o.name==="uncategorized"?_.categories?!_.categories.some(v=>p.some(M=>M.name===v)):!0:_.categories?.includes(o.name)),[s,p,o.name,u,c]),h=uge(b,o,f),{changePage:g}=h;x.useEffect(()=>()=>n(null),[]);const z=x.useCallback(_=>{l(_),g(1)},[l,g]),A=x.useCallback(_=>{d(_),g(1)},[d,g]);return a.jsxs(a.Fragment,{children:[a.jsxs(dt,{spacing:2,className:"block-editor-inserter__patterns-category-panel-header",children:[a.jsxs(Ot,{children:[a.jsx(eu,{children:a.jsx(_a,{className:"block-editor-inserter__patterns-category-panel-title",size:13,level:4,as:"div",children:o?.label})}),a.jsx(e6t,{patternSyncFilter:c,patternSourceFilter:u,setPatternSyncFilter:z,setPatternSourceFilter:A,scrollContainerRef:f,category:o})]}),!b.length&&a.jsx(Sn,{variant:"muted",className:"block-editor-inserter__patterns-category-no-results",children:m("No results found")})]}),b.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(Sn,{size:"12",as:"p",className:"block-editor-inserter__help-text",children:m("Drag and drop patterns into the canvas.")}),a.jsx(qa,{ref:f,blockPatterns:h.categoryPatterns,onClickPattern:i,onHover:n,label:o.label,orientation:"vertical",category:o.name,isDraggable:!0,showTitlesAsTooltip:r,patternFilter:u,pagingProps:h})]})]})}const{Tabs:sv}=ct(tr);function fge({categories:e,selectedCategory:t,onSelectCategory:n,children:o}){const i={type:"tween",duration:$1()?0:.25,ease:[.6,0,.4,1]},c=Fr(t),l=t?t.name:null,[u,d]=x.useState(),p=e?.[0]?.name;return l===null&&!u&&p&&d(p),a.jsxs(sv,{selectOnMove:!1,selectedTabId:l,orientation:"vertical",onSelect:f=>{n(e.find(b=>b.name===f))},activeTabId:u,onActiveTabIdChange:d,children:[a.jsx(sv.TabList,{className:"block-editor-inserter__category-tablist",children:e.map(f=>a.jsx(sv.Tab,{tabId:f.name,"aria-current":f.name===t?.name?"true":void 0,children:f.label},f.name))}),e.map(f=>a.jsx(sv.TabPanel,{tabId:f.name,focusable:!1,children:a.jsx(Rr.div,{className:"block-editor-inserter__category-panel",initial:c?"open":"closed",animate:"open",variants:{open:{transform:"translateX( 0 )",transitionEnd:{zIndex:"1"}},closed:{transform:"translateX( -100% )",zIndex:"-1"}},transition:i,children:o})},f.name))]})}function n6t({onSelectCategory:e,selectedCategory:t,onInsert:n,rootClientId:o,children:r}){const[s,i]=x.useState(!1),c=H7(o),l=Yn("medium","<");return c.length?a.jsxs(a.Fragment,{children:[!l&&a.jsxs("div",{className:"block-editor-inserter__block-patterns-tabs-container",children:[a.jsx(fge,{categories:c,selectedCategory:t,onSelectCategory:e,children:r}),a.jsx(Ce,{__next40pxDefaultSize:!0,className:"block-editor-inserter__patterns-explore-button",onClick:()=>i(!0),variant:"secondary",children:m("Explore all patterns")})]}),l&&a.jsx(dge,{categories:c,children:u=>a.jsx("div",{className:"block-editor-inserter__category-panel",children:a.jsx(pge,{onInsert:n,rootClientId:o,category:u},u.name)})}),s&&a.jsx(Ykt,{initialCategory:t?.name||c[0]?.name,patternCategories:c,onModalClose:()=>i(!1),rootClientId:o})]}):a.jsx(kh,{})}const o6t={image:"img",video:"video",audio:"audio"};function bge(e,t){const n={id:e.id||void 0,caption:e.caption||void 0},o=e.url,r=e.alt||void 0;t==="image"?(n.url=o,n.alt=r):["video","audio"].includes(t)&&(n.src=o);const s=o6t[t],i=a.jsx(s,{src:e.previewUrl||o,alt:r,controls:t==="audio"?!0:void 0,inert:"true",onError:({currentTarget:c})=>{c.src===e.previewUrl&&(c.src=o)}});return[Ee(`core/${t}`,n),i]}const r6t=["image"],Oee=25,s6t={position:"bottom left",className:"block-editor-inserter__media-list__item-preview-options__popover"};function i6t({category:e,media:t}){if(!e.getReportUrl)return null;const n=e.getReportUrl(t);return a.jsx(c0,{className:"block-editor-inserter__media-list__item-preview-options",label:m("Options"),popoverProps:s6t,icon:Wc,children:()=>a.jsx(Cn,{children:a.jsx(Ct,{onClick:()=>window.open(n,"_blank").focus(),icon:vf,children:xe(m("Report %s"),e.mediaType)})})})}function a6t({onClose:e,onSubmit:t}){return a.jsxs(Zo,{title:m("Insert external image"),onRequestClose:e,className:"block-editor-inserter-media-tab-media-preview-inserter-external-image-modal",children:[a.jsxs(dt,{spacing:3,children:[a.jsx("p",{children:m("This image cannot be uploaded to your Media Library, but it can still be inserted as an external image.")}),a.jsx("p",{children:m("External images can be removed by the external provider without warning and could even have legal compliance issues related to privacy legislation.")})]}),a.jsxs(Yo,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1,children:[a.jsx(Tn,{children:a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:e,children:m("Cancel")})}),a.jsx(Tn,{children:a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"primary",onClick:t,children:m("Insert")})})]})]})}function c6t({media:e,onClick:t,category:n}){const[o,r]=x.useState(!1),[s,i]=x.useState(!1),[c,l]=x.useState(!1),[u,d]=x.useMemo(()=>bge(e,n.mediaType),[e,n.mediaType]),{createErrorNotice:p,createSuccessNotice:f}=Oe(mt),{getSettings:b,getBlock:h}=G(J),{updateBlockAttributes:g}=Oe(J),z=x.useCallback(y=>{if(c)return;const k=b(),S=jo(y),{id:C,url:R,caption:T}=S.attributes;if(!C&&!k.mediaUpload){r(!0);return}if(C){t(S);return}l(!0),window.fetch(R).then(E=>E.blob()).then(E=>{const B=If(R)||"image.jpg",N=new File([E],B,{type:E.type});k.mediaUpload({filesList:[N],additionalData:{caption:T},onFileChange([j]){Nr(j.url)||(h(S.clientId)?g(S.clientId,{...S.attributes,id:j.id,url:j.url}):(t({...S,attributes:{...S.attributes,id:j.id,url:j.url}}),f(m("Image uploaded and inserted."),{type:"snackbar",id:"inserter-notice"})),l(!1))},allowedTypes:r6t,onError(j){p(j,{type:"snackbar",id:"inserter-notice"}),l(!1)}})}).catch(()=>{r(!0),l(!1)})},[c,b,t,f,g,p,h]),A=typeof e.title=="string"?e.title:e.title?.rendered||m("no title");let _;if(A.length>Oee){const y="...";_=A.slice(0,Oee-y.length)+y}const v=x.useCallback(()=>i(!0),[]),M=x.useCallback(()=>i(!1),[]);return a.jsxs(a.Fragment,{children:[a.jsx(V7,{isEnabled:!0,blocks:[u],children:({draggable:y,onDragStart:k,onDragEnd:S})=>a.jsx("div",{className:oe("block-editor-inserter__media-list__list-item",{"is-hovered":s}),draggable:y,onDragStart:k,onDragEnd:S,children:a.jsxs("div",{onMouseEnter:v,onMouseLeave:M,children:[a.jsx(B0,{text:_||A,children:a.jsx(C1.Item,{render:a.jsx("div",{"aria-label":A,role:"option",className:"block-editor-inserter__media-list__item"}),onClick:()=>z(u),children:a.jsxs("div",{className:"block-editor-inserter__media-list__item-preview",children:[d,c&&a.jsx("div",{className:"block-editor-inserter__media-list__item-preview-spinner",children:a.jsx(Xn,{})})]})})}),!c&&a.jsx(i6t,{category:n,media:e})]})})}),o&&a.jsx(a6t,{onClose:()=>r(!1),onSubmit:()=>{t(jo(u)),f(m("Image inserted."),{type:"snackbar",id:"inserter-notice"}),r(!1)}})]})}function l6t({mediaList:e,category:t,onClick:n,label:o=m("Media List")}){return a.jsx(C1,{role:"listbox",className:"block-editor-inserter__media-list","aria-label":o,children:e.map((r,s)=>a.jsx(c6t,{media:r,category:t,onClick:n},r.id||r.sourceId||s))})}function u6t(e,t={}){const[n,o]=x.useState(),[r,s]=x.useState(!1),i=x.useRef();return x.useEffect(()=>{(async()=>{const c=JSON.stringify({category:e.name,...t});i.current=c,s(!0),o([]);const l=await e.fetch?.(t);c===i.current&&(o(l),s(!1))})()},[e.name,...Object.values(t)]),{mediaList:n,isLoading:r}}function d6t(e){const[t,n]=x.useState([]),o=G(c=>ct(c(J)).getInserterMediaCategories(),[]),{canInsertImage:r,canInsertVideo:s,canInsertAudio:i}=G(c=>{const{canInsertBlockType:l}=c(J);return{canInsertImage:l("core/image",e),canInsertVideo:l("core/video",e),canInsertAudio:l("core/audio",e)}},[e]);return x.useEffect(()=>{(async()=>{const c=[];if(!o)return;const l=new Map(await Promise.all(o.map(async d=>{if(d.isExternalResource)return[d.name,!0];let p=[];try{p=await d.fetch({per_page:1})}catch{}return[d.name,!!p.length]}))),u={image:r,video:s,audio:i};o.forEach(d=>{u[d.mediaType]&&l.get(d.name)&&c.push(d)}),c.length&&n(c)})()},[r,s,i,o]),t}const p6t=10;function hge({rootClientId:e,onInsert:t,category:n}){const[o,r,s]=w0e(),{mediaList:i,isLoading:c}=u6t(n,{per_page:s?20:p6t,search:s}),l="block-editor-inserter__media-panel",u=n.labels.search_items||m("Search");return a.jsxs("div",{className:l,children:[a.jsx(su,{__nextHasNoMarginBottom:!0,className:`${l}-search`,onChange:r,value:o,label:u,placeholder:u}),c&&a.jsx("div",{className:`${l}-spinner`,children:a.jsx(Xn,{})}),!c&&!i?.length&&a.jsx(kh,{}),!c&&!!i?.length&&a.jsx(l6t,{rootClientId:e,onClick:t,mediaList:i,category:n})]})}function Hd({fallback:e=null,children:t}){return G(o=>{const{getSettings:r}=o(J);return!!r().mediaUpload},[])?t:e}const f6t=()=>null,ab=ap("editor.MediaUpload")(f6t),b6t=["image","video","audio"];function h6t({rootClientId:e,selectedCategory:t,onSelectCategory:n,onInsert:o,children:r}){const s=d6t(e),i=Yn("medium","<"),c="block-editor-inserter__media-tabs",l=x.useCallback(d=>{if(!d?.url)return;const[p]=bge(d,d.type);o(p)},[o]),u=x.useMemo(()=>s.map(d=>({...d,label:d.labels.name})),[s]);return u.length?a.jsxs(a.Fragment,{children:[!i&&a.jsxs("div",{className:`${c}-container`,children:[a.jsx(fge,{categories:u,selectedCategory:t,onSelectCategory:n,children:r}),a.jsx(Hd,{children:a.jsx(ab,{multiple:!1,onSelect:l,allowedTypes:b6t,render:({open:d})=>a.jsx(Ce,{__next40pxDefaultSize:!0,onClick:p=>{p.target.focus(),d()},className:"block-editor-inserter__media-library-button",variant:"secondary","data-unstable-ignore-focus-outside-for-relatedtarget":".media-modal",children:m("Open Media Library")})})})]}),i&&a.jsx(dge,{categories:u,children:d=>a.jsx(hge,{onInsert:o,rootClientId:e,category:d})})]}):a.jsx(kh,{})}const{Fill:mge,Slot:m6t}=Qn("__unstableInserterMenuExtension");mge.Slot=m6t;const g6t=9,M6t=[];function gge({filterValue:e,onSelect:t,onHover:n,onHoverPattern:o,rootClientId:r,clientId:s,isAppender:i,__experimentalInsertionIndex:c,maxBlockPatterns:l,maxBlockTypes:u,showBlockDirectory:d=!1,isDraggable:p=!0,shouldFocusBlock:f=!0,prioritizePatterns:b,selectBlockOnInsert:h,isQuick:g}){const z=q1(Yt,500),{prioritizedBlocks:A}=G($=>({prioritizedBlocks:$(J).getBlockListSettings(r)?.prioritizedInserterBlocks||M6t}),[r]),[_,v]=E_({onSelect:t,rootClientId:r,clientId:s,isAppender:i,insertionIndex:c,shouldFocusBlock:f,selectBlockOnInsert:h}),[M,y,k,S]=h_(_,v,g),[C,,R]=W_(v,_),T=x.useMemo(()=>{if(l===0)return[];const $=l7(C,e);return l!==void 0?$.slice(0,l):$},[e,C,l]);let E=u;b&&T.length>2&&(E=0);const B=x.useMemo(()=>{if(E===0)return[];const $=M.filter(Z=>Z.name!=="core/block");let F=hO($,"frecency","desc");!e&&A.length&&(F=Ahe(F,A));const X=yhe(F,y,k,e);return E!==void 0?X.slice(0,E):X},[e,M,y,k,E,A]);x.useEffect(()=>{if(!e)return;const $=B.length+T.length,F=xe(Dn("%d result found.","%d results found.",$),$);z(F)},[e,z,B,T]);const N=R4(B,{step:g6t}),j=B.length>0||T.length>0,I=!!B.length&&a.jsx(y2,{title:a.jsx(qn,{children:m("Blocks")}),children:a.jsx(O2,{items:N,onSelect:S,onHover:n,label:m("Blocks"),isDraggable:p})}),P=!!T.length&&a.jsx(y2,{title:a.jsx(qn,{children:m("Block patterns")}),children:a.jsx("div",{className:"block-editor-inserter__quick-inserter-patterns",children:a.jsx(qa,{blockPatterns:T,onClickPattern:R,onHover:o,isDraggable:p})})});return a.jsxs($7,{children:[!d&&!j&&a.jsx(kh,{}),b?P:I,!!B.length&&!!T.length&&a.jsx("div",{className:"block-editor-inserter__quick-inserter-separator"}),b?I:P,d&&a.jsx(mge.Slot,{fillProps:{onSelect:S,onHover:n,filterValue:e,hasItems:j,rootClientId:_},children:$=>$.length?$:j?null:a.jsx(kh,{})})]})}const{Tabs:iv}=ct(tr);function z6t({defaultTabId:e,onClose:t,onSelect:n,selectedTab:o,tabs:r,closeButtonLabel:s},i){return a.jsx("div",{className:"block-editor-tabbed-sidebar",children:a.jsxs(iv,{selectOnMove:!1,defaultTabId:e,onSelect:n,selectedTabId:o,children:[a.jsxs("div",{className:"block-editor-tabbed-sidebar__tablist-and-close-button",children:[a.jsx(Ce,{className:"block-editor-tabbed-sidebar__close-button",icon:rp,label:s,onClick:()=>t(),size:"compact"}),a.jsx(iv.TabList,{className:"block-editor-tabbed-sidebar__tablist",ref:i,children:r.map(c=>a.jsx(iv.Tab,{tabId:c.name,className:"block-editor-tabbed-sidebar__tab",children:c.title},c.name))})]}),r.map(c=>a.jsx(iv.TabPanel,{tabId:c.name,focusable:!1,className:"block-editor-tabbed-sidebar__tabpanel",ref:c.panelRef,children:c.panel},c.name))]})})}const Mge=x.forwardRef(z6t);function zge(e=!0){const{postId:t}=x.useContext(Cf),{setZoomLevel:n,resetZoomLevel:o}=ct(Oe(J)),{isZoomedOut:r,isZoomOut:s}=G(u=>{const{isZoomOut:d}=ct(u(J));return{isZoomedOut:d(),isZoomOut:d}},[]),i=x.useRef(!1),c=x.useRef(e),l=x.useRef(t);x.useEffect(()=>{r!==c.current&&(i.current=!1)},[r]),x.useEffect(()=>(c.current=e,l.current!==t&&(i.current=!0),e!==s()&&(i.current=!0,e?n("auto-scaled"):o()),()=>{i.current&&s()&&o()}),[e,s,t,o,n])}const O6t=()=>{};function y6t({rootClientId:e,clientId:t,isAppender:n,__experimentalInsertionIndex:o,onSelect:r,showInserterHelpPanel:s,showMostUsedBlocks:i,__experimentalFilterValue:c="",shouldFocusBlock:l=!0,onPatternCategorySelection:u,onClose:d,__experimentalInitialTab:p,__experimentalInitialCategory:f},b){const h=G(je=>ct(je(J)).isZoomOut(),[]),g=G(je=>!!ct(je(J)).getSectionRootClientId(),[]),[z,A,_]=w0e(c),[v,M]=x.useState(null),[y,k]=x.useState(f),[S,C]=x.useState("all"),[R,T]=x.useState(null),E=Yn("large");function B(){return p||(h?"patterns":"blocks")}const[N,j]=x.useState(B());zge(g&&(N==="patterns"||N==="media")&&E);const[P,$,F]=E_({rootClientId:e,clientId:t,isAppender:n,insertionIndex:o,shouldFocusBlock:l}),X=x.useRef(),Z=x.useCallback((je,ie,we,re)=>{$(je,ie,we,re),r(je),window.requestAnimationFrame(()=>{!l&&!X.current?.contains(b.current.ownerDocument.activeElement)&&X.current?.querySelector("button").focus()})},[$,r,l]),V=x.useCallback((je,ie,...we)=>{F(!1),$(je,{patternName:ie},...we),r()},[$,r]),Q=x.useCallback(je=>{F(je),M(je)},[F,M]),te=x.useCallback((je,ie)=>{k(je),C(ie),u?.()},[k,u]),ee=N==="patterns"&&!_&&!!y,ue=N==="media"&&!!R,ce=x.useMemo(()=>N==="media"?null:a.jsxs(a.Fragment,{children:[a.jsx(su,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",onChange:je=>{v&&M(null),A(je)},value:z,label:m("Search"),placeholder:m("Search")}),!!_&&a.jsx(gge,{filterValue:_,onSelect:r,onHover:Q,rootClientId:e,clientId:t,isAppender:n,__experimentalInsertionIndex:o,showBlockDirectory:!0,shouldFocusBlock:l,prioritizePatterns:N==="patterns"})]}),[N,v,M,A,z,_,r,Q,l,t,e,o,n]),me=x.useMemo(()=>a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"block-editor-inserter__block-list",children:a.jsx(jkt,{ref:X,rootClientId:P,onInsert:Z,onHover:Q,showMostUsedBlocks:i})}),s&&a.jsxs("div",{className:"block-editor-inserter__tips",children:[a.jsx(qn,{as:"h2",children:m("A tip for using the block editor")}),a.jsx(Wxt,{})]})]}),[P,Z,Q,i,s]),de=x.useMemo(()=>a.jsx(n6t,{rootClientId:P,onInsert:V,onSelectCategory:te,selectedCategory:y,children:ee&&a.jsx(pge,{rootClientId:P,onInsert:V,category:y,patternFilter:S,showTitlesAsTooltip:!0})}),[P,V,te,S,y,ee]),Ae=x.useMemo(()=>a.jsx(h6t,{rootClientId:P,selectedCategory:R,onSelectCategory:T,onInsert:Z,children:ue&&a.jsx(hge,{rootClientId:P,onInsert:Z,category:R})}),[P,Z,R,T,ue]),ye=je=>{je!=="patterns"&&k(null),j(je)},Ne=x.useRef();return x.useLayoutEffect(()=>{Ne.current&&window.requestAnimationFrame(()=>{Ne.current.querySelector('[role="tab"][aria-selected="true"]')?.focus()})},[]),a.jsxs("div",{className:oe("block-editor-inserter__menu",{"show-panel":ee||ue,"is-zoom-out":h}),ref:b,children:[a.jsx("div",{className:"block-editor-inserter__main-area",children:a.jsx(Mge,{ref:Ne,onSelect:ye,onClose:d,selectedTab:N,closeButtonLabel:m("Close Block Inserter"),tabs:[{name:"blocks",title:m("Blocks"),panel:a.jsxs(a.Fragment,{children:[ce,N==="blocks"&&!_&&me]})},{name:"patterns",title:m("Patterns"),panel:a.jsxs(a.Fragment,{children:[ce,N==="patterns"&&!_&&de]})},{name:"media",title:m("Media"),panel:a.jsxs(a.Fragment,{children:[ce,Ae]})}]})}),s&&v&&a.jsx(Io,{className:"block-editor-inserter__preview-container__popover",placement:"right-start",offset:16,focusOnMount:!1,animate:!1,children:a.jsx(age,{item:v})})]})}const Oge=x.forwardRef(y6t);function A6t(e,t){return a.jsx(Oge,{...e,onPatternCategorySelection:O6t,ref:t})}const v6t=x.forwardRef(A6t),x6t=6,w6t=6;function yge({onSelect:e,rootClientId:t,clientId:n,isAppender:o,selectBlockOnInsert:r,hasSearch:s=!0}){const[i,c]=x.useState(""),[l,u]=E_({onSelect:e,rootClientId:t,clientId:n,isAppender:o,selectBlockOnInsert:r}),[d]=h_(l,u,!0),{setInserterIsOpened:p,insertionIndex:f}=G(g=>{const{getSettings:z,getBlockIndex:A,getBlockCount:_}=g(J),v=z(),M=A(n),y=_();return{setInserterIsOpened:v.__experimentalSetIsInserterOpened,insertionIndex:M===-1?y:M}},[n]),b=s&&d.length>x6t;x.useEffect(()=>{p&&p(!1)},[p]);const h=()=>{p({filterValue:i,onSelect:e,rootClientId:t,insertionIndex:f})};return a.jsxs("div",{className:oe("block-editor-inserter__quick-inserter",{"has-search":b,"has-expand":p}),children:[b&&a.jsx(su,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",value:i,onChange:g=>{c(g)},label:m("Search"),placeholder:m("Search")}),a.jsx("div",{className:"block-editor-inserter__quick-inserter-results",children:a.jsx(gge,{filterValue:i,onSelect:e,rootClientId:t,clientId:n,isAppender:o,maxBlockPatterns:0,maxBlockTypes:w6t,isDraggable:!1,selectBlockOnInsert:r,isQuick:!0})}),p&&a.jsx(Ce,{__next40pxDefaultSize:!0,className:"block-editor-inserter__quick-inserter-expand",onClick:h,"aria-label":m("Browse all. This will open the main inserter panel in the editor toolbar."),children:m("Browse all")})]})}const _6t=({onToggle:e,disabled:t,isOpen:n,blockTitle:o,hasSingleBlockType:r,toggleProps:s={}})=>{const{as:i=Ce,label:c,onClick:l,...u}=s;let d=c;!d&&r?d=xe(We("Add %s","directly add the only allowed block"),o):d||(d=We("Add block","Generic label for block inserter button"));function p(f){e&&e(f),l&&l(f)}return a.jsx(i,{__next40pxDefaultSize:s.as?void 0:!0,icon:Fs,label:d,tooltipPosition:"bottom",onClick:p,className:"block-editor-inserter__toggle","aria-haspopup":r?!1:"true","aria-expanded":r?!1:n,disabled:t,...u})};class k6t extends x.Component{constructor(){super(...arguments),this.onToggle=this.onToggle.bind(this),this.renderToggle=this.renderToggle.bind(this),this.renderContent=this.renderContent.bind(this)}onToggle(t){const{onToggle:n}=this.props;n&&n(t)}renderToggle({onToggle:t,isOpen:n}){const{disabled:o,blockTitle:r,hasSingleBlockType:s,directInsertBlock:i,toggleProps:c,hasItems:l,renderToggle:u=_6t}=this.props;return u({onToggle:t,isOpen:n,disabled:o||!l,blockTitle:r,hasSingleBlockType:s,directInsertBlock:i,toggleProps:c})}renderContent({onClose:t}){const{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:s,__experimentalIsQuick:i,onSelectOrClose:c,selectBlockOnInsert:l}=this.props;return i?a.jsx(yge,{onSelect:u=>{const d=Array.isArray(u)&&u?.length?u[0]:u;c&&typeof c=="function"&&c(d),t()},rootClientId:n,clientId:o,isAppender:r,selectBlockOnInsert:l}):a.jsx(v6t,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:s})}render(){const{position:t,hasSingleBlockType:n,directInsertBlock:o,insertOnlyAllowedBlock:r,__experimentalIsQuick:s,onSelectOrClose:i}=this.props;return n||o?this.renderToggle({onToggle:r}):a.jsx(so,{className:"block-editor-inserter",contentClassName:oe("block-editor-inserter__popover",{"is-quick":s}),popoverProps:{position:t,shift:!0},onToggle:this.onToggle,open:this.props.open,expandOnMobile:!0,headerTitle:m("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:i})}}const xm=Co([Ul((e,{clientId:t,rootClientId:n,shouldDirectInsert:o=!0})=>{const{getBlockRootClientId:r,hasInserterItems:s,getAllowedBlocks:i,getDirectInsertBlock:c}=e(J),{getBlockVariations:l}=e(kt);n=n||r(t)||void 0;const u=i(n),d=o&&c(n),p=u?.length===1&&l(u[0].name,"inserter")?.length===0;let f=!1;return p&&(f=u[0]),{hasItems:s(n),hasSingleBlockType:p,blockTitle:f?f.title:"",allowedBlockType:f,directInsertBlock:d,rootClientId:n}}),Ff((e,t,{select:n})=>({insertOnlyAllowedBlock(){const{rootClientId:o,clientId:r,isAppender:s,hasSingleBlockType:i,allowedBlockType:c,directInsertBlock:l,onSelectOrClose:u,selectBlockOnInsert:d}=t;if(!i&&!l)return;function p(z){const{getBlock:A,getPreviousBlockClientId:_}=n(J);if(!z||!r&&!o)return{};const v={};let M={};if(r){const y=A(r),k=A(_(r));y?.name===k?.name&&(M=k?.attributes||{})}else{const y=A(o);if(y?.innerBlocks?.length){const k=y.innerBlocks[y.innerBlocks.length-1];l&&l?.name===k.name&&(M=k.attributes)}}return z.forEach(y=>{M.hasOwnProperty(y)&&(v[y]=M[y])}),v}function f(){const{getBlockIndex:z,getBlockSelectionEnd:A,getBlockOrder:_,getBlockRootClientId:v}=n(J);if(r)return z(r);const M=A();return!s&&M&&v(M)===o?z(M)+1:_(o).length}const{insertBlock:b}=e(J);let h;if(l){const z=p(l.attributesToCopy);h=Ee(l.name,{...l.attributes||{},...z})}else h=Ee(c.name);b(h,f(),o,d),u&&u({clientId:h?.clientId});const g=xe(m("%s block added"),c.title);Yt(g)}})),tSe(({hasItems:e,isAppender:t,rootClientId:n,clientId:o})=>e||!t&&!n&&!o)])(k6t),S6t="\uFEFF";function Age({rootClientId:e}){const{showPrompt:t,isLocked:n,placeholder:o,isManualGrid:r}=G(u=>{const{getBlockCount:d,getSettings:p,getTemplateLock:f,getBlockAttributes:b}=u(J),h=!d(e),{bodyPlaceholder:g}=p();return{showPrompt:h,isLocked:!!f(e),placeholder:g,isManualGrid:b(e)?.layout?.isManualPlacement}},[e]),{insertDefaultBlock:s,startTyping:i}=Oe(J);if(n||r)return null;const c=Lt(o)||m("Type / to choose a block"),l=()=>{s(void 0,e),i()};return a.jsxs("div",{"data-root-client-id":e||"",className:oe("block-editor-default-block-appender",{"has-visible-prompt":t}),children:[a.jsx("p",{tabIndex:"0",role:"button","aria-label":m("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:u=>{(Gr===u.keyCode||DN===u.keyCode)&&l()},onClick:()=>l(),onFocus:()=>{t&&l()},children:t?c:S6t}),a.jsx(xm,{rootClientId:e,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0})]})}function vge({rootClientId:e,className:t,onFocus:n,tabIndex:o,onSelect:r},s){return a.jsx(xm,{position:"bottom center",rootClientId:e,__experimentalIsQuick:!0,onSelectOrClose:(...i)=>{r&&typeof r=="function"&&r(...i)},renderToggle:({onToggle:i,disabled:c,isOpen:l,blockTitle:u,hasSingleBlockType:d})=>{const p=!d,f=d?xe(We("Add %s","directly add the only allowed block"),u):We("Add block","Generic label for block inserter button");return a.jsx(Ce,{__next40pxDefaultSize:!0,ref:s,onFocus:n,tabIndex:o,className:oe(t,"block-editor-button-block-appender"),onClick:i,"aria-haspopup":p?"true":void 0,"aria-expanded":p?l:void 0,disabled:c,label:f,showTooltip:!0,children:a.jsx(wn,{icon:Fs})})},isAppender:!0})}x.forwardRef((e,t)=>(Ke("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),vge(e,t)));const N_=x.forwardRef(vge);function C6t({rootClientId:e}){return G(n=>n(J).canInsertBlockType(Mr(),e))?a.jsx(Age,{rootClientId:e}):a.jsx(N_,{rootClientId:e,className:"block-list-appender__toggle"})}function q6t({rootClientId:e,CustomAppender:t,className:n,tagName:o="div"}){const r=G(s=>{const{getBlockInsertionPoint:i,isBlockInsertionPointVisible:c,getBlockCount:l}=s(J),u=i();return c()&&e===u?.rootClientId&&l(e)===0},[e]);return a.jsx(o,{tabIndex:-1,className:oe("block-list-appender wp-block",n,{"is-drag-over":r}),contentEditable:!1,"data-block":!0,children:t?a.jsx(t,{}):a.jsx(C6t,{rootClientId:e})})}function Vx(e){return Mn(t=>{if(!e)return;function n(r){const{deltaX:s,deltaY:i}=r;e.current.scrollBy(s,i)}const o={passive:!0};return t.addEventListener("wheel",n,o),()=>{t.removeEventListener("wheel",n,o)}},[e])}const R6t=Number.MAX_SAFE_INTEGER;x.createContext();function xge({previousClientId:e,nextClientId:t,children:n,__unstablePopoverSlot:o,__unstableContentRef:r,operation:s="insert",nearestSide:i="right",...c}){const[l,u]=x.useReducer(_=>(_+1)%R6t,0),{orientation:d,rootClientId:p,isVisible:f}=G(_=>{const{getBlockListSettings:v,getBlockRootClientId:M,isBlockVisible:y}=_(J),k=M(e??t);return{orientation:v(k)?.orientation||"vertical",rootClientId:k,isVisible:y(e)&&y(t)}},[e,t]),b=Wi(e),h=Wi(t),g=d==="vertical",z=x.useMemo(()=>l<0||!b&&!h||!f?void 0:{contextElement:s==="group"?h||b:b||h,getBoundingClientRect(){const v=b?b.getBoundingClientRect():null,M=h?h.getBoundingClientRect():null;let y=0,k=0,S=0,C=0;if(s==="group"){const R=M||v;k=R.top,S=0,C=R.bottom-R.top,y=i==="left"?R.left-2:R.right-2}else g?(k=v?v.bottom:M.top,S=v?v.width:M.width,C=M&&v?M.top-v.bottom:0,y=v?v.left:M.left):(k=v?v.top:M.top,C=v?v.height:M.height,jt()?(y=M?M.right:v.left,S=v&&M?v.left-M.right:0):(y=v?v.right:M.left,S=v&&M?M.left-v.right:0),S=Math.max(S,0));return new window.DOMRect(y,k,S,C)}},[b,h,l,g,f,s,i]),A=Vx(r);return x.useLayoutEffect(()=>{if(!b)return;const _=new window.MutationObserver(u);return _.observe(b,{attributes:!0}),()=>{_.disconnect()}},[b]),x.useLayoutEffect(()=>{if(!h)return;const _=new window.MutationObserver(u);return _.observe(h,{attributes:!0}),()=>{_.disconnect()}},[h]),x.useLayoutEffect(()=>{if(b)return b.ownerDocument.defaultView.addEventListener("resize",u),()=>{b.ownerDocument.defaultView?.removeEventListener("resize",u)}},[b]),!b&&!h||!f?null:a.jsx(Io,{ref:A,animate:!1,anchor:z,focusOnMount:!1,__unstableSlotName:o,inline:!o,...c,className:oe("block-editor-block-popover","block-editor-block-popover__inbetween",c.className),resize:!1,flip:!1,placement:"overlay",variant:"unstyled",children:a.jsx("div",{className:"block-editor-block-popover__inbetween-container",children:n})},t+"--"+p)}const T6t=Number.MAX_SAFE_INTEGER;function E6t({clientId:e,bottomClientId:t,children:n,__unstablePopoverSlot:o,__unstableContentRef:r,shift:s=!0,...i},c){const l=Wi(e),u=Wi(t??e),d=xn([c,Vx(r)]),[p,f]=x.useReducer(h=>(h+1)%T6t,0);x.useLayoutEffect(()=>{if(!l)return;const h=new window.MutationObserver(f);return h.observe(l,{attributes:!0}),()=>{h.disconnect()}},[l]);const b=x.useMemo(()=>{if(!(p<0||!l||t&&!u))return{getBoundingClientRect(){return u?dme(h4(l),h4(u)):h4(l)},contextElement:l}},[p,l,t,u]);return!l||t&&!u?null:a.jsx(Io,{ref:d,animate:!1,focusOnMount:!1,anchor:b,__unstableSlotName:o,inline:!o,placement:"top-start",resize:!1,flip:!1,shift:s,...i,className:oe("block-editor-block-popover",i.className),variant:"unstyled",children:n})}const U7=x.forwardRef(E6t),W6t=({clientId:e,bottomClientId:t,children:n,...o},r)=>a.jsx(U7,{...o,bottomClientId:t,clientId:e,__unstableContentRef:void 0,__unstablePopoverSlot:void 0,ref:r,children:n}),N6t=x.forwardRef(W6t);function B6t({clientId:e,bottomClientId:t,children:n,shift:o=!1,additionalStyles:r,...s},i){var c;(c=t)!==null&&c!==void 0||(t=e);const l=Wi(e);return a.jsx(U7,{ref:i,clientId:e,bottomClientId:t,shift:o,...s,children:l&&e===t?a.jsx(L6t,{selectedElement:l,additionalStyles:r,children:n}):n})}function L6t({selectedElement:e,additionalStyles:t={},children:n}){const[o,r]=x.useState(e.offsetWidth),[s,i]=x.useState(e.offsetHeight);x.useEffect(()=>{const l=new window.ResizeObserver(()=>{r(e.offsetWidth),i(e.offsetHeight)});return l.observe(e,{box:"border-box"}),()=>l.disconnect()},[e]);const c=x.useMemo(()=>({position:"absolute",width:o,height:s,...t}),[o,s,t]);return a.jsx("div",{style:c,children:n})}const wm=x.forwardRef(B6t),Dg={hide:{opacity:0,scaleY:.75},show:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:.9}};function P6t({__unstablePopoverSlot:e,__unstableContentRef:t}){const{clientId:n}=G(r=>{const{getBlockOrder:s,getBlockInsertionPoint:i}=r(J),c=i(),l=s(c.rootClientId);return l.length?{clientId:l[c.index]}:{}},[]),o=$1();return a.jsx(wm,{clientId:n,__unstablePopoverSlot:e,__unstableContentRef:t,className:"block-editor-block-popover__drop-zone",children:a.jsx(Rr.div,{"data-testid":"block-popover-drop-zone",initial:o?Dg.show:Dg.hide,animate:Dg.show,exit:o?Dg.show:Dg.exit,className:"block-editor-block-popover__drop-zone-foreground"})})}const X7=x.createContext();function j6t({__unstablePopoverSlot:e,__unstableContentRef:t,operation:n="insert",nearestSide:o="right"}){const{selectBlock:r,hideInsertionPoint:s}=Oe(J),i=x.useContext(X7),c=x.useRef(),{orientation:l,previousClientId:u,nextClientId:d,rootClientId:p,isInserterShown:f,isDistractionFree:b,isZoomOutMode:h}=G(C=>{const{getBlockOrder:R,getBlockListSettings:T,getBlockInsertionPoint:E,isBlockBeingDragged:B,getPreviousBlockClientId:N,getNextBlockClientId:j,getSettings:I,isZoomOut:P}=ct(C(J)),$=E(),F=R($.rootClientId);if(!F.length)return{};let X=F[$.index-1],Z=F[$.index];for(;B(X);)X=N(X);for(;B(Z);)Z=j(Z);const V=I();return{previousClientId:X,nextClientId:Z,orientation:T($.rootClientId)?.orientation||"vertical",rootClientId:$.rootClientId,isDistractionFree:V.isDistractionFree,isInserterShown:$?.__unstableWithInserter,isZoomOutMode:P()}},[]),{getBlockEditingMode:g}=G(J),z=$1();function A(C){C.target===c.current&&d&&g(d)!=="disabled"&&r(d,-1)}function _(C){C.target===c.current&&!i.current&&s()}function v(C){C.target!==c.current&&(i.current=!0)}const M={start:{opacity:0,scale:0},rest:{opacity:1,scale:1,transition:{delay:f?.5:0,type:"tween"}},hover:{opacity:1,scale:1,transition:{delay:.5,type:"tween"}}},y={start:{scale:z?1:0},rest:{scale:1,transition:{delay:.4,type:"tween"}}};if(b||h&&n!=="insert")return null;const S=oe("block-editor-block-list__insertion-point",l==="horizontal"||n==="group"?"is-horizontal":"is-vertical");return a.jsx(xge,{previousClientId:u,nextClientId:d,__unstablePopoverSlot:e,__unstableContentRef:t,operation:n,nearestSide:o,children:a.jsxs(Rr.div,{layout:!z,initial:z?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:c,tabIndex:-1,onClick:A,onFocus:v,className:oe(S,{"is-with-inserter":f}),onHoverEnd:_,children:[a.jsx(Rr.div,{variants:M,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),f&&a.jsx(Rr.div,{variants:y,className:oe("block-editor-block-list__insertion-point-inserter"),children:a.jsx(xm,{position:"bottom center",clientId:d,rootClientId:p,__experimentalIsQuick:!0,onToggle:C=>{i.current=C},onSelectOrClose:()=>{i.current=!1}})})]})})}function I6t(e){const{insertionPoint:t,isVisible:n,isBlockListEmpty:o}=G(r=>{const{getBlockInsertionPoint:s,isBlockInsertionPointVisible:i,getBlockCount:c}=r(J),l=s();return{insertionPoint:l,isVisible:i(),isBlockListEmpty:c(l?.rootClientId)===0}},[]);return!n||o?null:t.operation==="replace"?a.jsx(P6t,{...e},`${t.rootClientId}-${t.index}`):a.jsx(j6t,{operation:t.operation,nearestSide:t.nearestSide,...e})}function D6t(){const e=x.useContext(X7),t=G(g=>g(J).getSettings().isDistractionFree||ct(g(J)).isZoomOut(),[]),{getBlockListSettings:n,getBlockIndex:o,isMultiSelecting:r,getSelectedBlockClientIds:s,getSettings:i,getTemplateLock:c,__unstableIsWithinBlockOverlay:l,getBlockEditingMode:u,getBlockName:d,getBlockAttributes:p,getParentSectionBlock:f}=ct(G(J)),{showInsertionPoint:b,hideInsertionPoint:h}=Oe(J);return Mn(g=>{if(t)return;function z(A){if(e===void 0||e.current||A.target.nodeType===A.target.TEXT_NODE||r())return;if(!A.target.classList.contains("block-editor-block-list__layout")){h();return}let _;if(A.target.classList.contains("is-root-container")||(_=(A.target.getAttribute("data-block")?A.target:A.target.closest("[data-block]")).getAttribute("data-block")),c(_)||u(_)==="disabled"||d(_)==="core/block"||_&&p(_).layout?.isManualPlacement)return;const v=n(_),M=v?.orientation||"vertical",y=!!v?.__experimentalCaptureToolbars,k=A.clientY,S=A.clientX;let R=Array.from(A.target.children).find(N=>{const j=N.getBoundingClientRect();return N.classList.contains("wp-block")&&M==="vertical"&&j.top>k||N.classList.contains("wp-block")&&M==="horizontal"&&(jt()?j.rightS)});if(!R){h();return}if(!R.id&&(R=R.firstElementChild,!R)){h();return}const T=R.id.slice(6);if(!T||l(T)||f(T)||s().includes(T)&&M==="vertical"&&!y&&!i().hasFixedToolbar)return;const E=R.getBoundingClientRect();if(M==="horizontal"&&(A.clientY>E.bottom||A.clientYE.right||A.clientX{g.removeEventListener("mousemove",z)}},[e,n,o,r,b,h,s,t])}function F6t({showSeparator:e,isFloating:t,onAddBlock:n,isToggle:o}){const{clientId:r}=j0();return a.jsx(N_,{className:oe({"block-list-appender__toggle":o}),rootClientId:r,showSeparator:e,isFloating:t,onAddBlock:n})}function $6t(){const{clientId:e}=j0();return a.jsx(Age,{rootClientId:e})}const Fg=new WeakMap;function V6t(){let e;return t=>((e===void 0||!ds(e,t))&&(e=t),e)}function yee(e){const[t]=x.useState(V6t);return t(e)}function H6t(e,t,n,o,r,s,i,c,l,u,d,p){const f=Fn(),b=yee(n),h=yee(o),g=l===void 0||t==="contentOnly"?t:l;x.useLayoutEffect(()=>{const z={allowedBlocks:b,prioritizedInserterBlocks:h,templateLock:g};if(u!==void 0&&(z.__experimentalCaptureToolbars=u),d!==void 0)z.orientation=d;else{const A=Rf(p?.type);z.orientation=A.getOrientation(p)}i!==void 0&&(Ke("__experimentalDefaultBlock",{alternative:"defaultBlock",since:"6.3",version:"6.4"}),z.defaultBlock=i),r!==void 0&&(z.defaultBlock=r),c!==void 0&&(Ke("__experimentalDirectInsert",{alternative:"directInsert",since:"6.3",version:"6.4"}),z.directInsert=c),s!==void 0&&(z.directInsert=s),z.directInsert!==void 0&&typeof z.directInsert!="boolean"&&Ke("Using `Function` as a `directInsert` argument",{alternative:"`boolean` values",since:"6.5"}),Fg.get(f)||Fg.set(f,{}),Fg.get(f)[e]=z,window.queueMicrotask(()=>{const A=Fg.get(f);if(Object.keys(A).length){const{updateBlockListSettings:_}=f.dispatch(J);_(A),Fg.set(f,{})}})},[e,b,h,g,r,s,i,c,u,d,p,f])}function U6t(e,t,n,o){const r=Fn(),s=x.useRef(null);x.useLayoutEffect(()=>{let i=!1;const{getBlocks:c,getSelectedBlocksInitialCaretPosition:l,isBlockSelected:u}=r.select(J),{replaceInnerBlocks:d,__unstableMarkNextChangeAsNotPersistent:p}=r.dispatch(J);return window.queueMicrotask(()=>{if(i)return;const f=c(e),b=f.length===0||n==="all"||n==="contentOnly",h=!N0(t,s.current);if(!b||!h)return;s.current=t;const g=oz(f,t);N0(g,f)||(p(),d(e,g,f.length===0&&o&&g.length!==0&&u(e),l()))}),()=>{i=!0}},[t,n,e,r,o])}function X6t(e){return G(t=>{const n=t(J).getBlock(e);if(!n)return;const o=t(kt).getBlockType(n.name);if(o&&Object.keys(o.providesContext).length!==0)return Object.fromEntries(Object.entries(o.providesContext).map(([r,s])=>[r,n.attributes[s]]))},[e])}function wge(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{return t}return t}function G6t(e,t,n,o,r,s,i,c,l){return u=>{const{srcRootClientId:d,srcClientIds:p,type:f,blocks:b}=wge(u);if(f==="inserter"){i();const h=b.map(g=>jo(g));s(h,!0,null)}if(f==="block"){const h=n(p[0]);if(d===e&&h===t||p.includes(e)||o(p).some(_=>_===e))return;if(c==="group"){const _=p.map(v=>l(v));s(_,!0,null,p);return}const g=d===e,z=p.length,A=g&&h{if(!t().mediaUpload)return;const i=xc(Ei("from"),c=>c.type==="files"&&o(c.blockName,e)&&c.isMatch(s));if(i){const c=i.transform(s,n);r(c)}}}function Y6t(e){return t=>{const n=Xh({HTML:t,mode:"BLOCKS"});n.length&&e(n)}}function _ge(e,t,n={}){const{operation:o="insert",nearestSide:r="right"}=n,{canInsertBlockType:s,getBlockIndex:i,getClientIdsOfDescendants:c,getBlockOrder:l,getBlocksByClientId:u,getSettings:d,getBlock:p}=G(J),{getGroupingBlockName:f}=G(kt),{insertBlocks:b,moveBlocksToPosition:h,updateBlockAttributes:g,clearSelectedBlock:z,replaceBlocks:A,removeBlocks:_}=Oe(J),v=Fn(),M=x.useCallback((R,T=!0,E=0,B=[])=>{Array.isArray(R)||(R=[R]);const j=l(e)[t];if(o==="replace")A(j,R,void 0,E);else if(o==="group"){const I=p(j);r==="left"?R.push(I):R.unshift(I);const P=R.map(Z=>Ee(Z.name,Z.attributes,Z.innerBlocks)),$=R.every(Z=>Z.name==="core/image"),F=s("core/gallery",e),X=Ee($&&F?"core/gallery":f(),{layout:{type:"flex",flexWrap:$&&F?null:"nowrap"}},P);A([j,...B],X,void 0,E)}else b(R,t,e,T,E)},[l,e,t,o,A,p,r,s,f,b]),y=x.useCallback((R,T,E)=>{if(o==="replace"){const B=u(R),j=l(e)[t];v.batch(()=>{_(R,!1),A(j,B,void 0,0)})}else h(R,T,e,E)},[o,l,u,h,v,_,A,t,e]),k=G6t(e,t,i,c,y,M,z,o,p),S=K6t(e,d,g,s,M),C=Y6t(M);return R=>{const T=q4(R.dataTransfer),E=R.dataTransfer.getData("text/html");E?C(E):T.length?S(T):k(R)}}function Z6t(e,t,n){const o=n==="top"||n==="bottom",{x:r,y:s}=e,i=o?r:s,c=o?s:r,l=o?t.left:t.top,u=o?t.right:t.bottom,d=t[n];let p;return i>=l&&i<=u?p=i:i{const i=Z6t(e,t,s);(o===void 0||i=e.x&&t.top<=e.y&&t.bottom>=e.y}function Q6t(e,t){return t.top<=e.y&&t.bottom>=e.y}const FR=30,J6t=120,eSt=120;function tSt(e,t,n="vertical",o={}){const r=n==="horizontal"?["left","right"]:["top","bottom"];let s=0,i="before",c=1/0,l=null,u="right";const{dropZoneElement:d,parentBlockOrientation:p,rootBlockIndex:f=0}=o;if(d&&p!=="horizontal"){const A=d.getBoundingClientRect(),[_,v]=pM(t,A,["top","bottom"]);if(A.height>J6t&&_eSt&&_{const y=_();let[k,S]=pM(t,y,r);const[C,R]=pM(t,y,["left","right"]),T=kge(t,y);A&&T?k=0:n==="vertical"&&M!=="horizontal"&&(T&&Cl);r=n.every(l=>c?.includes(l))}const i=n.map(c=>e(c)).every(c=>{const[l]=c?.parent||[];return l?l===o:!0});return r&&i}function Aee(e,t){const{defaultView:n}=t;return!!(n&&e instanceof n.HTMLElement&&e.closest("[data-is-insertion-point]"))}function nSt({dropZoneElement:e,rootClientId:t="",parentClientId:n="",isDisabled:o=!1}={}){const r=Fn(),[s,i]=x.useState({index:null,operation:"insert"}),{getBlockType:c,getBlockVariations:l,getGroupingBlockName:u}=G(kt),{canInsertBlockType:d,getBlockListSettings:p,getBlocks:f,getBlockIndex:b,getDraggedBlockClientIds:h,getBlockNamesByClientId:g,getAllowedBlocks:z,isDragging:A,isGroupable:_,isZoomOut:v,getSectionRootClientId:M,getBlockParents:y}=ct(G(J)),{showInsertionPoint:k,hideInsertionPoint:S,startDragging:C,stopDragging:R}=ct(Oe(J)),T=_ge(s.operation==="before"||s.operation==="after"?n:t,s.index,{operation:s.operation,nearestSide:s.nearestSide}),E=vE(x.useCallback((B,N)=>{A()||C();const j=h(),I=[t,...y(t,!0)];if(j.some(Ae=>I.includes(Ae)))return;const $=z(t),F=g([t])[0],X=g(j);if(!LW(c,$,X,F))return;const V=M();if(v()&&V!==t)return;const Q=f(t);if(Q.length===0){r.batch(()=>{i({index:0,operation:"insert"}),k(t,0,{operation:"insert"})});return}const te=Q.map(Ae=>{const ye=Ae.clientId;return{isUnmodifiedDefaultBlock:El(Ae),getBoundingClientRect:()=>N.getElementById(`block-${ye}`).getBoundingClientRect(),blockIndex:b(ye),blockOrientation:p(ye)?.orientation}}),ee=tSt(te,{x:B.clientX,y:B.clientY},p(t)?.orientation,{dropZoneElement:e,parentBlockClientId:n,parentBlockOrientation:n?p(n)?.orientation:void 0,rootBlockIndex:b(t)}),[ue,ce,me]=ee,de=te[ue]?.isUnmodifiedDefaultBlock;if(!(v()&&!de&&ce!=="insert")){if(ce==="group"){const Ae=Q[ue],ye=[Ae.name,...X].every(re=>re==="core/image"),Ne=d("core/gallery",t),je=_([Ae.clientId,h()]),ie=l(u(),"block"),we=ie&&ie.find(({name:re})=>re==="group-row");if(ye&&!Ne&&(!je||!we)||!ye&&(!je||!we))return}r.batch(()=>{i({index:ue,operation:ce,nearestSide:me});const Ae=["before","after"].includes(ce)?n:t;k(Ae,ue,{operation:ce,nearestSide:me})})}},[A,z,t,g,h,c,M,v,f,p,e,n,b,r,C,k,d,_,l,u]),200);return q5({dropZoneElement:e,isDisabled:o,onDrop:T,onDragOver(B){E(B,B.currentTarget.ownerDocument)},onDragLeave(B){const{ownerDocument:N}=B.currentTarget;Aee(B.relatedTarget,N)||Aee(B.target,N)||(E.cancel(),S())},onDragEnd(){E.cancel(),R(),S()}})}const oSt={};function rSt({children:e,clientId:t}){const n=X6t(t);return a.jsx(uO,{value:n,children:e})}const sSt=x.memo(G7);function Sge(e){const{clientId:t,allowedBlocks:n,prioritizedInserterBlocks:o,defaultBlock:r,directInsert:s,__experimentalDefaultBlock:i,__experimentalDirectInsert:c,template:l,templateLock:u,wrapperRef:d,templateInsertUpdatesSelection:p,__experimentalCaptureToolbars:f,__experimentalAppenderTagName:b,renderAppender:h,orientation:g,placeholder:z,layout:A,name:_,blockType:v,parentLock:M,defaultLayout:y}=e;H6t(t,M,n,o,r,s,i,c,u,f,g,A),U6t(t,l,u,p);const k=An(_,"layout")||An(_,"__experimentalLayout")||oSt,{allowSizingOnChildren:S=!1}=k,C=A||k,R=x.useMemo(()=>({...y,...C,...S&&{allowSizingOnChildren:!0}}),[y,C,S]),T=a.jsx(sSt,{rootClientId:t,renderAppender:h,__experimentalAppenderTagName:b,layout:R,wrapperRef:d,placeholder:z});return!v?.providesContext||Object.keys(v.providesContext).length===0?T:a.jsx(rSt,{clientId:t,children:T})}function iSt(e){return yme(e),a.jsx(Sge,{...e})}const Ht=x.forwardRef((e,t)=>{const n=Nt({ref:t},e);return a.jsx("div",{className:"block-editor-inner-blocks",children:a.jsx("div",{...n})})});function Nt(e={},t={}){const{__unstableDisableLayoutClassNames:n,__unstableDisableDropZone:o,dropZoneElement:r}=t,{clientId:s,layout:i=null,__unstableLayoutClassNames:c=""}=j0(),l=G(M=>{const{getBlockName:y,isZoomOut:k,getTemplateLock:S,getBlockRootClientId:C,getBlockEditingMode:R,getBlockSettings:T,getSectionRootClientId:E}=ct(M(J));if(!s){const X=E();return{isDropZoneDisabled:k()&&X!==""}}const{hasBlockSupport:B,getBlockType:N}=M(kt),j=y(s),I=R(s),P=C(s),[$]=T(s,"layout");let F=I==="disabled";if(k()){const X=E();F=s!==X}return{__experimentalCaptureToolbars:B(j,"__experimentalExposeControlsToChildren",!1),name:j,blockType:N(j),parentLock:S(P),parentClientId:P,isDropZoneDisabled:F,defaultLayout:$}},[s]),{__experimentalCaptureToolbars:u,name:d,blockType:p,parentLock:f,parentClientId:b,isDropZoneDisabled:h,defaultLayout:g}=l,z=nSt({dropZoneElement:r,rootClientId:s,parentClientId:b}),A=xn([e.ref,o||h||i?.isManualPlacement&&window.__experimentalEnableGridInteractivity?null:z]),_={__experimentalCaptureToolbars:u,layout:i,name:d,blockType:p,parentLock:f,defaultLayout:g,...t},v=_.value&&_.onChange?iSt:Sge;return{...e,ref:A,className:oe(e.className,"block-editor-block-list__layout",n?"":c),children:s?a.jsx(v,{..._,clientId:s}):a.jsx(G7,{...t})}}Nt.save=BPe;Ht.DefaultBlockAppender=$6t;Ht.ButtonBlockAppender=F6t;Ht.Content=()=>Nt.save().children;const aSt=new Set([cc,_i,Ps,wi,Gr,Mc]);function cSt(e){const{keyCode:t,shiftKey:n}=e;return!n&&aSt.has(t)}function Cge(){const e=G(n=>n(J).isTyping(),[]),{stopTyping:t}=Oe(J);return Mn(n=>{if(!e)return;const{ownerDocument:o}=n;let r,s;function i(c){const{clientX:l,clientY:u}=c;r&&s&&(r!==l||s!==u)&&t(),r=l,s=u}return o.addEventListener("mousemove",i),()=>{o.removeEventListener("mousemove",i)}},[e,t])}function qge(){const{isTyping:e}=G(s=>{const{isTyping:i}=s(J);return{isTyping:i()}},[]),{startTyping:t,stopTyping:n}=Oe(J),o=Cge(),r=Mn(s=>{const{ownerDocument:i}=s,{defaultView:c}=i,l=c.getSelection();if(e){let p=function(h){const{target:g}=h;d=c.setTimeout(()=>{md(g)||n()})},f=function(h){const{keyCode:g}=h;(g===gd||g===Z2)&&n()},b=function(){l.isCollapsed||n()},d;return s.addEventListener("focus",p),s.addEventListener("keydown",f),i.addEventListener("selectionchange",b),()=>{c.clearTimeout(d),s.removeEventListener("focus",p),s.removeEventListener("keydown",f),i.removeEventListener("selectionchange",b)}}function u(d){const{type:p,target:f}=d;!md(f)||!s.contains(f)||p==="keydown"&&!cSt(d)||t()}return s.addEventListener("keypress",u),s.addEventListener("keydown",u),()=>{s.removeEventListener("keypress",u),s.removeEventListener("keydown",u)}},[e,t,n]);return xn([o,r])}function vee({clientId:e,rootClientId:t="",position:n="top"}){const[o,r]=x.useState(!1),{sectionRootClientId:s,sectionClientIds:i,insertionPoint:c,blockInsertionPointVisible:l,blockInsertionPoint:u,blocksBeingDragged:d}=G(y=>{const{getInsertionPoint:k,getBlockOrder:S,getSectionRootClientId:C,isBlockInsertionPointVisible:R,getBlockInsertionPoint:T,getDraggedBlockClientIds:E}=ct(y(J)),B=C(),N=S(B);return{sectionRootClientId:B,sectionClientIds:N,blockOrder:S(B),insertionPoint:k(),blockInsertionPoint:T(),blockInsertionPointVisible:R(),blocksBeingDragged:E()}},[]),p=$1();if(!e)return;let f=!1;if(!(t===s&&i&&i.includes(e)))return null;const h=c?.index===0&&e===i[c.index],g=c&&c.hasOwnProperty("index")&&e===i[c.index-1];n==="top"&&(f=h||l&&u.index===0&&e===i[u.index]),n==="bottom"&&(f=g||l&&e===i[u.index-1]);const z=d[0],A=d.includes(e),_=i.indexOf(z),M=(_>0?i[_-1]:null)===e;return(A||M)&&(f=!1),a.jsx(Wd,{children:f&&a.jsx(Rr.div,{initial:{height:0},animate:{height:"calc(1 * var(--wp-block-editor-iframe-zoom-out-frame-size) / var(--wp-block-editor-iframe-zoom-out-scale)"},exit:{height:0},transition:{type:"tween",duration:p?0:.2,ease:[.6,0,.4,1]},className:oe("block-editor-block-list__zoom-out-separator",{"is-dragged-over":o}),"data-is-insertion-point":"true",onDragOver:()=>r(!0),onDragLeave:()=>r(!1),children:a.jsx(Rr.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{delay:-.125}},transition:{ease:"linear",duration:.1,delay:.125},children:m("Drop pattern.")})})})}const Rge=x.createContext(),av=new WeakMap;function lSt({className:e,...t}){const{isOutlineMode:n,isFocusMode:o,temporarilyEditingAsBlocks:r}=G(d=>{const{getSettings:p,getTemporarilyEditingAsBlocks:f,isTyping:b}=ct(d(J)),{outlineMode:h,focusMode:g}=p();return{isOutlineMode:h&&!b(),isFocusMode:g,temporarilyEditingAsBlocks:f()}},[]),s=Fn(),{setBlockVisibility:i}=Oe(J),c=q1(x.useCallback(()=>{const d={};av.get(s).forEach(([p,f])=>{d[p]=f}),i(d)},[s]),300,{trailing:!0}),l=x.useMemo(()=>{const{IntersectionObserver:d}=window;if(d)return new d(p=>{av.get(s)||av.set(s,[]);for(const f of p){const b=f.target.getAttribute("data-block");av.get(s).push([b,f.isIntersecting])}c()})},[]),u=Nt({ref:xn([q7(),D6t(),qge()]),className:oe("is-root-container",e,{"is-outline-mode":n,"is-focus-mode":o})},t);return a.jsxs(Rge.Provider,{value:l,children:[a.jsx("div",{...u}),!!r&&a.jsx(uSt,{clientId:r})]})}function uSt({clientId:e}){const{stopEditingAsBlocks:t}=ct(Oe(J)),n=G(o=>{const{isBlockSelected:r,hasSelectedInnerBlock:s}=o(J);return r(e)||s(e,!0)},[e]);return x.useEffect(()=>{n||t(e)},[n,e,t]),null}function B_(e){return a.jsx(iae,{value:rae,children:a.jsx(lSt,{...e})})}const dSt=[],pSt=new Set;function fSt({placeholder:e,rootClientId:t,renderAppender:n,__experimentalAppenderTagName:o,layout:r=qhe}){const s=n!==!1,i=!!n,{order:c,isZoomOut:l,selectedBlocks:u,visibleBlocks:d,shouldRenderAppender:p}=G(f=>{const{getSettings:b,getBlockOrder:h,getSelectedBlockClientId:g,getSelectedBlockClientIds:z,__unstableGetVisibleBlocks:A,getTemplateLock:_,getBlockEditingMode:v,isSectionBlock:M,isZoomOut:y}=ct(f(J)),k=h(t);if(b().isPreviewMode)return{order:k,selectedBlocks:dSt,visibleBlocks:pSt};const S=g();return{order:k,selectedBlocks:z(),visibleBlocks:A(),isZoomOut:y(),shouldRenderAppender:!M(t)&&v(t)!=="disabled"&&!_(t)&&s&&!y()&&(i||t===S||!t&&!S&&!k.length)}},[t,s,i]);return a.jsxs(gvt,{value:r,children:[c.map(f=>a.jsxs(T5,{value:!d.has(f)&&!u.includes(f),children:[l&&a.jsx(vee,{clientId:f,rootClientId:t,position:"top"}),a.jsx(Ext,{rootClientId:t,clientId:f}),l&&a.jsx(vee,{clientId:f,rootClientId:t,position:"bottom"})]},f)),c.length<1&&e,p&&a.jsx(q6t,{tagName:o,rootClientId:t,CustomAppender:n})]})}function G7(e){return a.jsx(T5,{value:!1,children:a.jsx(fSt,{...e})})}const xee=Qn("InspectorControls"),bSt=Qn("InspectorAdvancedControls"),hSt=Qn("InspectorControlsBindings"),mSt=Qn("InspectorControlsBackground"),gSt=Qn("InspectorControlsBorder"),MSt=Qn("InspectorControlsColor"),zSt=Qn("InspectorControlsFilter"),OSt=Qn("InspectorControlsDimensions"),ySt=Qn("InspectorControlsPosition"),ASt=Qn("InspectorControlsTypography"),vSt=Qn("InspectorControlsListView"),xSt=Qn("InspectorControlsStyles"),wSt=Qn("InspectorControlsEffects"),L_={default:xee,advanced:bSt,background:mSt,bindings:hSt,border:gSt,color:MSt,dimensions:OSt,effects:wSt,filter:zSt,list:vSt,position:ySt,settings:xee,styles:xSt,typography:ASt};function Tge({children:e,group:t="default",__experimentalGroup:n,resetAllFilter:o}){n&&(Ke("`__experimentalGroup` property in `InspectorControlsFill`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=n);const r=j0(),s=L_[t]?.Fill;return s?r[J5]?a.jsx(Jf,{document,children:a.jsx(s,{children:i=>a.jsx(kSt,{fillProps:i,children:e,resetAllFilter:o})})}):null:(globalThis.SCRIPT_DEBUG===!0&&zn(`Unknown InspectorControls group "${t}" provided.`),null)}function _St({resetAllFilter:e,children:t}){const{registerResetAllFilter:n,deregisterResetAllFilter:o}=x.useContext(Ez);return x.useEffect(()=>{if(e&&n&&o)return n(e),()=>{o(e)}},[e,n,o]),t}function kSt({children:e,resetAllFilter:t,fillProps:n}){const{forwardedContext:o=[]}=n,r=a.jsx(_St,{resetAllFilter:t,children:e});return o.reduce((s,[i,c])=>a.jsx(i,{...c,children:s}),r)}function SSt(e){if(!e)return{};if(typeof e=="object")return e;let t;switch(e){case"normal":t=We("Regular","font style");break;case"italic":t=We("Italic","font style");break;case"oblique":t=We("Oblique","font style");break;default:t=e;break}return{name:t,value:e}}function wee(e){if(!e)return{};if(typeof e=="object")return e;let t;switch(e){case"normal":case"400":t=We("Regular","font weight");break;case"bold":case"700":t=We("Bold","font weight");break;case"100":t=We("Thin","font weight");break;case"200":t=We("Extra Light","font weight");break;case"300":t=We("Light","font weight");break;case"500":t=We("Medium","font weight");break;case"600":t=We("Semi Bold","font weight");break;case"800":t=We("Extra Bold","font weight");break;case"900":t=We("Black","font weight");break;case"1000":t=We("Extra Black","font weight");break;default:t=e;break}return{name:t,value:e}}const _ee=[{name:We("Regular","font style"),value:"normal"},{name:We("Italic","font style"),value:"italic"}],kee=[{name:We("Thin","font weight"),value:"100"},{name:We("Extra Light","font weight"),value:"200"},{name:We("Light","font weight"),value:"300"},{name:We("Regular","font weight"),value:"400"},{name:We("Medium","font weight"),value:"500"},{name:We("Semi Bold","font weight"),value:"600"},{name:We("Bold","font weight"),value:"700"},{name:We("Extra Bold","font weight"),value:"800"},{name:We("Black","font weight"),value:"900"},{name:We("Extra Black","font weight"),value:"1000"}];function Ege(e){let t=[],n=[];const o=[],r=!e||e?.length===0;let s=!1;return e?.forEach(i=>{if(typeof i.fontWeight=="string"&&/\s/.test(i.fontWeight.trim())){s=!0;let[u,d]=i.fontWeight.split(" ");u=parseInt(u.slice(0,1)),d==="1000"?d=10:d=parseInt(d.slice(0,1));for(let p=u;p<=d;p++){const f=`${p.toString()}00`;n.some(b=>b.value===f)||n.push(wee(f))}}const c=wee(typeof i.fontWeight=="number"?i.fontWeight.toString():i.fontWeight),l=SSt(i.fontStyle);l&&Object.keys(l).length&&(t.some(u=>u.value===l.value)||t.push(l)),c&&Object.keys(c).length&&(n.some(u=>u.value===c.value)||s||n.push(c))}),n.some(i=>i.value>="600")||n.push({name:We("Bold","font weight"),value:"700"}),t.some(i=>i.value==="italic")||t.push({name:We("Italic","font style"),value:"italic"}),r&&(t=_ee,n=kee),t=t.length===0?_ee:t,n=n.length===0?kee:n,t.forEach(({name:i,value:c})=>{n.forEach(({name:l,value:u})=>{const d=c==="normal"?l:xe(We("%1$s %2$s","font"),l,i);o.push({key:`${c}-${u}`,name:d,style:{fontStyle:c,fontWeight:u}})})}),{fontStyles:t,fontWeights:n,combinedStyleAndWeightOptions:o,isSystemFont:r,isVariableFont:s}}function P_(e,t){const{size:n}=e;if(!n||n==="0"||e?.fluid===!1||!PW(t?.typography)&&!PW(e))return n;let o=CSt(t);o=typeof o?.fluid=="object"?o?.fluid:{};const r=qyt({minimumFontSize:e?.fluid?.min,maximumFontSize:e?.fluid?.max,fontSize:n,minimumFontSizeLimit:o?.minFontSize,maximumViewportWidth:o?.maxViewportWidth,minimumViewportWidth:o?.minViewportWidth});return r||n}function PW(e){const t=e?.fluid;return t===!0||t&&typeof t=="object"&&Object.keys(t).length>0}function CSt(e){const t=e?.typography,n=e?.layout,o=sl(n?.wideSize)?n?.wideSize:null;return PW(t)&&o?{fluid:{maxViewportWidth:o,...t.fluid}}:{fluid:t?.fluid}}function qSt(e,t){var n;const o=e?.typography?.fontFamilies,r=["default","theme","custom"].flatMap(i=>{var c;return(c=o?.[i])!==null&&c!==void 0?c:[]}),s=(n=r.find(i=>i.fontFamily===t)?.fontFace)!==null&&n!==void 0?n:[];return{fontFamilies:r,fontFamilyFaces:s}}function See(e,t){return t=typeof t=="number"?t.toString():t,!t||typeof t!="string"?"":!e||e.length===0?t:e?.reduce((o,{value:r})=>{const s=Math.abs(parseInt(r)-parseInt(t)),i=Math.abs(parseInt(o)-parseInt(t));return so.value===t)?t:t==="oblique"&&!e.find(o=>o.value==="oblique")?"italic":""}function TSt(e,t,n){let o=t,r=n;const{fontStyles:s,fontWeights:i,combinedStyleAndWeightOptions:c}=Ege(e),l=s?.some(({value:d})=>d===t),u=i?.some(({value:d})=>d?.toString()===n?.toString());return l||(o=t?RSt(s,t):c?.find(d=>d.style.fontWeight===See(i,n))?.style?.fontStyle),u||(r=n?See(i,n):c?.find(d=>d.style.fontStyle===(o||t))?.style?.fontWeight),{nearestFontStyle:o,nearestFontWeight:r}}const ll="body",Hx=":root",_m=[{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)=>P_(e,t),valueKey:"size",cssVarInfix:"font-size",classes:[{classSuffix:"font-size",propertyName:"font-size"}]},{path:["typography","fontFamilies"],valueKey:"fontFamily",cssVarInfix:"font-family",classes:[{classSuffix:"font-family",propertyName:"font-family"}]},{path:["spacing","spacingSizes"],valueKey:"size",cssVarInfix:"spacing",valueFunc:({size:e})=>e,classes:[]}],ESt={"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 dp(){return Yn("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}}}function K7(e,t,n,o,r){const s=[fo(e,["blocks",t,...n]),fo(e,n)];for(const i of s)if(i){const c=["custom","theme","default"];for(const l of c){const u=i[l];if(u){const d=u.find(p=>p[o]===r);if(d)return o==="slug"||K7(e,t,n,"slug",d.slug)[o]===d[o]?d:void 0}}}}function WSt(e,t,n,o){if(!o)return o;const r=ESt[n],s=_m.find(u=>u.cssVarInfix===r);if(!s)return o;const{valueKey:i,path:c}=s,l=K7(e,t,c,i,o);return l?`var:preset|${r}|${l.slug}`:o}function NSt(e,t,n,[o,r]){const s=_m.find(c=>c.cssVarInfix===o);if(!s)return n;const i=K7(e.settings,t,s.path,"slug",r);if(i){const{valueKey:c}=s,l=i[c];return ua(e,t,l)}return n}function BSt(e,t,n,o){var r;const s=(r=fo(e.settings,["blocks",t,"custom",...o]))!==null&&r!==void 0?r:fo(e.settings,["custom",...o]);return s?ua(e,t,s):n}function ua(e,t,n){if(!n||typeof n!="string")if(typeof n?.ref=="string"){if(n=fo(e,n.ref),!n||n?.ref)return n}else return n;const o="var:",r="var(--wp--",s=")";let i;if(n.startsWith(o))i=n.slice(o.length).split("|");else if(n.startsWith(r)&&n.endsWith(s))i=n.slice(r.length,-s.length).split("--");else return n;const[c,...l]=i;return c==="preset"?NSt(e,t,n,l):c==="custom"?BSt(e,t,n,l):n}function Ws(e,t){if(!e||!t)return t;const n=e.split(","),o=t.split(","),r=[];return n.forEach(s=>{o.forEach(i=>{r.push(`${s.trim()} ${i.trim()}`)})}),r.join(", ")}function LSt(e,t){if(!e||!t)return;const n={};return Object.entries(t).forEach(([o,r])=>{typeof r=="string"&&(n[o]=Ws(e,r)),typeof r=="object"&&(n[o]={},Object.entries(r).forEach(([s,i])=>{n[o][s]=Ws(e,i)}))}),n}function PSt(e,t){return e.includes(",")?e.split(",").map(r=>r+t).join(","):e+t}function jSt(e,t){return typeof e!="object"||typeof t!="object"?e===t:N0(e?.styles,t?.styles)&&N0(e?.settings,t?.settings)}function ISt(e,t){const n=`.is-style-${e}`;if(!t)return n;const o=/((?::\([^)]+\))?\s*)([^\s:]+)/,r=(i,c,l)=>c+l+n;return t.split(",").map(i=>i.replace(o,r)).join(",")}function DSt(e,t){if(!e||!t||!Array.isArray(t))return e;const n=t.find(o=>o?.name===e);return n?.href?n?.href:e}function FSt(e,t){if(!e||!t)return e;if(typeof e!="string"&&e?.ref){const n=Dz(fo(t,e.ref));return n?.ref?void 0:n===void 0?e:n}return e}function jW(e,t){if(!e||!t)return e;const n=FSt(e,t);return n?.url&&(n.url=DSt(n.url,t?._links?.["wp:theme-file"])),n}function $St({children:e,group:t,label:n}){const{updateBlockAttributes:o}=Oe(J),{getBlockAttributes:r,getMultiSelectedBlockClientIds:s,getSelectedBlockClientId:i,hasMultiSelection:c}=G(J),l=dp(),u=i(),d=x.useCallback((p=[])=>{const f={},b=c()?s():[u];b.forEach(h=>{const{style:g}=r(h);let z={style:g};p.forEach(A=>{z={...z,...A(z)}}),z={...z,style:Ii(z.style)},f[h]=z}),o(b,f,!0)},[r,s,c,u,o]);return a.jsx(En,{className:`${t}-block-support-panel`,label:n,resetAll:d,panelId:u,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:l,children:e},u)}function VSt({Slot:e,fillProps:t,...n}){const o=x.useContext(Ez),r=x.useMemo(()=>{var s;return{...t??{},forwardedContext:[...(s=t?.forwardedContext)!==null&&s!==void 0?s:[],[Ez.Provider,{value:o}]]}},[o,t]);return a.jsx(e,{...n,fillProps:r,bubblesVirtually:!0})}function Wge({__experimentalGroup:e,group:t="default",label:n,fillProps:o,...r}){e&&(Ke("`__experimentalGroup` property in `InspectorControlsSlot`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=e);const s=L_[t],i=H0(s?.name);if(!s)return globalThis.SCRIPT_DEBUG===!0&&zn(`Unknown InspectorControls group "${t}" provided.`),null;if(!i?.length)return null;const{Slot:c}=s;return n?a.jsx($St,{group:t,label:n,children:a.jsx(VSt,{...r,fillProps:o,Slot:c})}):a.jsx(c,{...r,fillProps:o,bubblesVirtually:!0})}const et=Tge;et.Slot=Wge;const j_=e=>a.jsx(Tge,{...e,group:"advanced"});j_.Slot=e=>a.jsx(Wge,{...e,group:"advanced"});j_.slotName="InspectorAdvancedControls";function HSt(e){const t=e?.style?.position?.type;return t==="sticky"?m("Sticky"):t==="fixed"?m("Fixed"):null}function ji(e){return G(t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(J),{getBlockType:r,getActiveBlockVariation:s}=t(kt),i=n(e),c=r(i);if(!c)return null;const l=o(e),u=s(i,l),d=Qd(c)||Hh(c),f=(d?iie(c,l):void 0)||c.title,b=HSt(l),h={isSynced:d,title:f,icon:c.icon,description:c.description,anchor:l?.anchor,positionLabel:b,positionType:l?.style?.position?.type,name:l?.metadata?.name};return u?{isSynced:d,title:u.title||c.title,icon:u.icon||c.icon,description:u.description||c.description,anchor:l?.anchor,positionLabel:b,positionType:l?.style?.position?.type,name:l?.metadata?.name}:h},[e])}const qO="position",$R={key:"default",value:"",name:m("Default")},VR={key:"sticky",value:"sticky",name:We("Sticky","Name for the value of the CSS position property"),hint:m("The block will stick to the top of the window instead of scrolling.")},Cee={key:"fixed",value:"fixed",name:We("Fixed","Name for the value of the CSS position property"),hint:m("The block will not move when the page is scrolled.")},USt=["top","right","bottom","left"],XSt=["sticky","fixed"];function GSt({selector:e,style:t}){let n="";const{type:o}=t?.position||{};return XSt.includes(o)&&(n+=`${e} {`,n+=`position: ${o};`,USt.forEach(r=>{t?.position?.[r]!==void 0&&(n+=`${r}: ${t.position[r]};`)}),(o==="sticky"||o==="fixed")&&(n+="z-index: 10"),n+="}"),n}function KSt(e){const t=An(e,qO);return!!(t===!0||t?.sticky)}function YSt(e){const t=An(e,qO);return!!(t===!0||t?.fixed)}function ZSt(e){return!!An(e,qO)}function QSt(e){const t=e?.style?.position?.type;return t==="sticky"||t==="fixed"}function Nge({name:e}={}){const[t,n]=Un("position.fixed","position.sticky"),o=!t&&!n;return!ZSt(e)||o}function JSt({style:e={},clientId:t,name:n,setAttributes:o}){const r=YSt(n),s=KSt(n),i=e?.position?.type,{firstParentClientId:c}=G(b=>{const{getBlockParents:h}=b(J),g=h(t);return{firstParentClientId:g[g.length-1]}},[t]),l=ji(c),u=s&&i===VR.value&&l?xe(m("The block will stick to the scrollable area of the parent %s block."),l.title):null,d=x.useMemo(()=>{const b=[$R];return(s||i===VR.value)&&b.push(VR),(r||i===Cee.value)&&b.push(Cee),b},[r,s,i]),p=b=>{const g={...e,position:{...e?.position,type:b,top:b==="sticky"||b==="fixed"?"0px":void 0}};o({style:Ii(g)})},f=i&&d.find(b=>b.value===i)||$R;return f0.select({web:d.length>1?a.jsx(et,{group:"position",children:a.jsx(no,{__nextHasNoMarginBottom:!0,help:u,children:a.jsx(ob,{__next40pxDefaultSize:!0,label:m("Position"),hideLabelFromVision:!0,describedBy:xe(m("Currently selected position: %s"),f.name),options:d,value:f,onChange:({selectedItem:b})=>{p(b.value)},size:"__unstable-large"})})}):null,native:null})}const Bge={edit:function(t){return Nge(t)?null:a.jsx(JSt,{...t})},useBlockProps:tCt,attributeKeys:["style"],hasSupport(e){return Et(e,qO)}},eCt={};function tCt({name:e,style:t}){const n=Et(e,qO),o=Nge({name:e}),r=n&&!o,s=vt(eCt),i=`.wp-container-${s}.wp-container-${s}`;let c;r&&(c=GSt({selector:i,style:t})||"");const l=oe({[`wp-container-${s}`]:r&&!!c,[`is-position-${t?.position?.type}`]:r&&!!c&&!!t?.position?.type});return EO({css:c}),{className:l}}const Lge={placement:"top-start"},qee={...Lge,flip:!1,shift:!0},nCt={...Lge,flip:!0,shift:!1};function Ree(e,t,n,o,r){if(!e||!t)return qee;const s=n?.scrollTop||0,i=h4(t),c=e.getBoundingClientRect(),l=s+c.top,u=e.ownerDocument.documentElement.clientHeight,d=l+o,p=i.top>d,f=i.height>u-o;return!r&&(p||f)?qee:nCt}function Pge({contentElement:e,clientId:t}){const n=Wi(t),[o,r]=x.useState(0),{blockIndex:s,isSticky:i}=G(f=>{const{getBlockIndex:b,getBlockAttributes:h}=f(J);return{blockIndex:b(t),isSticky:QSt(h(t))}},[t]),c=x.useMemo(()=>{if(e)return ps(e)},[e]),[l,u]=x.useState(()=>Ree(e,n,c,o,i)),d=Mn(f=>{r(f.offsetHeight)},[]),p=x.useCallback(()=>u(Ree(e,n,c,o,i)),[e,n,c,o]);return x.useLayoutEffect(p,[s,p]),x.useLayoutEffect(()=>{if(!e||!n)return;const f=e?.ownerDocument?.defaultView;f?.addEventHandler?.("resize",p);let b;const h=n?.ownerDocument?.defaultView;return h.ResizeObserver&&(b=new h.ResizeObserver(p),b.observe(n)),()=>{f?.removeEventHandler?.("resize",p),b&&b.disconnect()}},[p,e,n]),{...l,ref:d}}function jge(e){return G(n=>{const{getBlockRootClientId:o,getBlockParents:r,__experimentalGetBlockListSettingsForBlocks:s,isBlockInsertionPointVisible:i,getBlockInsertionPoint:c,getBlockOrder:l,hasMultiSelection:u,getLastMultiSelectedBlockClientId:d}=n(J),p=r(e),f=s(p),b=p.find(g=>f[g]?.__experimentalCaptureToolbars);let h=!1;if(i()){const g=c();h=l(g.rootClientId)[g.index]===e}return{capturingClientId:b,isInsertionPointVisible:h,lastClientId:u()?d():null,rootClientId:o(e)}},[e])}function oCt({clientId:e,__unstableContentRef:t}){const{capturingClientId:n,isInsertionPointVisible:o,lastClientId:r,rootClientId:s}=jge(e),i=Pge({contentElement:t?.current,clientId:e});return a.jsx(wm,{clientId:n||e,bottomClientId:r,className:oe("block-editor-block-list__block-side-inserter-popover",{"is-insertion-point-visible":o}),__unstableContentRef:t,...i,children:a.jsx("div",{className:"block-editor-block-list__empty-block-inserter",children:a.jsx(xm,{position:"bottom right",rootClientId:s,clientId:e,__experimentalIsQuick:!0})})})}const cv=50,Ige=25,rCt=1e3,Tee=rCt*(Ige/1e3);function sCt(){const e=x.useRef(null),t=x.useRef(null),n=x.useRef(null),o=x.useRef(null);x.useEffect(()=>()=>{o.current&&(clearInterval(o.current),o.current=null)},[]);const r=x.useCallback(c=>{e.current=c.clientY,n.current=ps(c.target),o.current=setInterval(()=>{if(n.current&&t.current){const l=n.current.scrollTop+t.current;n.current.scroll({top:l})}},Ige)},[]),s=x.useCallback(c=>{if(!n.current)return;const l=n.current.offsetHeight,u=e.current-n.current.offsetTop,d=c.clientY-n.current.offsetTop;if(c.clientY>u){const p=Math.max(l-u-cv,0),f=Math.max(d-u-cv,0),b=p===0||f===0?0:f/p;t.current=Tee*b}else if(c.clientY{e.current=null,n.current=null,o.current&&(clearInterval(o.current),o.current=null)}]}const Dge=({appendToOwnerDocument:e,children:t,clientIds:n,cloneClassname:o,elementId:r,onDragStart:s,onDragEnd:i,fadeWhenDisabled:c=!1,dragComponent:l})=>{const{srcRootClientId:u,isDraggable:d,icon:p,visibleInserter:f,getBlockType:b}=G(T=>{const{canMoveBlocks:E,getBlockRootClientId:B,getBlockName:N,getBlockAttributes:j,isBlockInsertionPointVisible:I}=T(J),{getBlockType:P,getActiveBlockVariation:$}=T(kt),F=B(n[0]),X=N(n[0]),Z=$(X,j(n[0]));return{srcRootClientId:F,isDraggable:E(n),icon:Z?.icon||P(X)?.icon,visibleInserter:I(),getBlockType:P}},[n]),h=x.useRef(!1),[g,z,A]=sCt(),{getAllowedBlocks:_,getBlockNamesByClientId:v,getBlockRootClientId:M}=G(J),{startDraggingBlocks:y,stopDraggingBlocks:k}=Oe(J);x.useEffect(()=>()=>{h.current&&k()},[]);const C=Wi(n[0])?.closest("body");if(x.useEffect(()=>{if(!C||!c)return;const E=BN(B=>{if(!B.target.closest("[data-block]"))return;const N=v(n),j=B.target.closest("[data-block]").getAttribute("data-block"),I=_(j),P=v([j])[0];let $;if(I?.length===0){const F=M(j),X=v([F])[0],Z=_(F);$=LW(b,Z,N,X)}else $=LW(b,I,N,P);!$&&!f?window?.document?.body?.classList?.add("block-draggable-invalid-drag-token"):window?.document?.body?.classList?.remove("block-draggable-invalid-drag-token")},200);return C.addEventListener("dragover",E),()=>{C.removeEventListener("dragover",E)}},[n,C,c,_,v,M,b,f]),!d)return t({draggable:!1});const R={type:"block",srcClientIds:n,srcRootClientId:u};return a.jsx(Hbe,{appendToOwnerDocument:e,cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:R,onDragStart:T=>{window.requestAnimationFrame(()=>{y(n),h.current=!0,g(T),s&&s()})},onDragOver:z,onDragEnd:()=>{k(),h.current=!1,A(),i&&i()},__experimentalDragComponent:l!==void 0?l:a.jsx(k7,{count:n.length,icon:p,fadeWhenDisabled:!0}),elementId:r,children:({onDraggableStart:T,onDraggableEnd:E})=>t({draggable:!0,onDragStart:T,onDragEnd:E})})},rd=(e,t)=>e==="up"?t==="horizontal"?jt()?"right":"left":"up":e==="down"?t==="horizontal"?jt()?"left":"right":"down":null;function iCt(e,t,n,o,r,s,i){const c=n+1;if(e>1)return aCt(e,n,o,r,s,i);if(o&&r)return xe(m("Block %s is the only block, and cannot be moved"),t);if(s>0&&!r){const l=rd("down",i);if(l==="down")return xe(m("Move %1$s block from position %2$d down to position %3$d"),t,c,c+1);if(l==="left")return xe(m("Move %1$s block from position %2$d left to position %3$d"),t,c,c+1);if(l==="right")return xe(m("Move %1$s block from position %2$d right to position %3$d"),t,c,c+1)}if(s>0&&r){const l=rd("down",i);if(l==="down")return xe(m("Block %1$s is at the end of the content and can’t be moved down"),t);if(l==="left")return xe(m("Block %1$s is at the end of the content and can’t be moved left"),t);if(l==="right")return xe(m("Block %1$s is at the end of the content and can’t be moved right"),t)}if(s<0&&!o){const l=rd("up",i);if(l==="up")return xe(m("Move %1$s block from position %2$d up to position %3$d"),t,c,c-1);if(l==="left")return xe(m("Move %1$s block from position %2$d left to position %3$d"),t,c,c-1);if(l==="right")return xe(m("Move %1$s block from position %2$d right to position %3$d"),t,c,c-1)}if(s<0&&o){const l=rd("up",i);if(l==="up")return xe(m("Block %1$s is at the beginning of the content and can’t be moved up"),t);if(l==="left")return xe(m("Block %1$s is at the beginning of the content and can’t be moved left"),t);if(l==="right")return xe(m("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}function aCt(e,t,n,o,r,s){const i=t+1;if(n&&o)return m("All blocks are selected, and cannot be moved");if(r>0&&!o){const c=rd("down",s);if(c==="down")return xe(m("Move %1$d blocks from position %2$d down by one place"),e,i);if(c==="left")return xe(m("Move %1$d blocks from position %2$d left by one place"),e,i);if(c==="right")return xe(m("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r>0&&o){const c=rd("down",s);if(c==="down")return m("Blocks cannot be moved down as they are already at the bottom");if(c==="left")return m("Blocks cannot be moved left as they are already are at the leftmost position");if(c==="right")return m("Blocks cannot be moved right as they are already are at the rightmost position")}if(r<0&&!n){const c=rd("up",s);if(c==="up")return xe(m("Move %1$d blocks from position %2$d up by one place"),e,i);if(c==="left")return xe(m("Move %1$d blocks from position %2$d left by one place"),e,i);if(c==="right")return xe(m("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r<0&&n){const c=rd("up",s);if(c==="up")return m("Blocks cannot be moved up as they are already at the top");if(c==="left")return m("Blocks cannot be moved left as they are already are at the leftmost position");if(c==="right")return m("Blocks cannot be moved right as they are already are at the rightmost position")}}const cCt=(e,t)=>e==="up"?t==="horizontal"?jt()?ma:Ll:Rw:e==="down"?t==="horizontal"?jt()?Ll:ma:tu:null,lCt=(e,t)=>e==="up"?t==="horizontal"?jt()?m("Move right"):m("Move left"):m("Move up"):e==="down"?t==="horizontal"?jt()?m("Move left"):m("Move right"):m("Move down"):null,Y7=x.forwardRef(({clientIds:e,direction:t,orientation:n,...o},r)=>{const s=vt(Y7),i=Array.isArray(e)?e:[e],c=i.length,{disabled:l}=o,{blockType:u,isDisabled:d,rootClientId:p,isFirst:f,isLast:b,firstIndex:h,orientation:g="vertical"}=G(y=>{const{getBlockIndex:k,getBlockRootClientId:S,getBlockOrder:C,getBlock:R,getBlockListSettings:T}=y(J),E=i[0],B=S(E),N=k(E),j=k(i[i.length-1]),I=C(B),P=R(E),$=N===0,F=j===I.length-1,{orientation:X}=T(B)||{};return{blockType:P?on(P.name):null,isDisabled:l||(t==="up"?$:F),rootClientId:B,firstIndex:N,isFirst:$,isLast:F,orientation:n||X}},[e,t]),{moveBlocksDown:z,moveBlocksUp:A}=Oe(J),_=t==="up"?A:z,v=y=>{_(e,p),o.onClick&&o.onClick(y)},M=`block-editor-block-mover-button__description-${s}`;return a.jsxs(a.Fragment,{children:[a.jsx(Ce,{__next40pxDefaultSize:!0,ref:r,className:oe("block-editor-block-mover-button",`is-${t}-button`),icon:cCt(t,g),label:lCt(t,g),"aria-describedby":M,...o,onClick:d?null:v,disabled:d,accessibleWhenDisabled:!0}),a.jsx(qn,{id:M,children:iCt(c,u&&u.title,h,f,b,t==="up"?-1:1,g)})]})}),Fge=x.forwardRef((e,t)=>a.jsx(Y7,{direction:"up",ref:t,...e})),$ge=x.forwardRef((e,t)=>a.jsx(Y7,{direction:"down",ref:t,...e}));function uCt({clientIds:e,hideDragHandle:t,isBlockMoverUpButtonDisabled:n,isBlockMoverDownButtonDisabled:o}){const{canMove:r,rootClientId:s,isFirst:i,isLast:c,orientation:l,isManualGrid:u}=G(d=>{var p;const{getBlockIndex:f,getBlockListSettings:b,canMoveBlocks:h,getBlockOrder:g,getBlockRootClientId:z,getBlockAttributes:A}=d(J),_=Array.isArray(e)?e:[e],v=_[0],M=z(v),y=f(v),k=f(_[_.length-1]),S=g(M),{layout:C={}}=(p=A(M))!==null&&p!==void 0?p:{};return{canMove:h(e),rootClientId:M,isFirst:y===0,isLast:k===S.length-1,orientation:b(M)?.orientation,isManualGrid:C.type==="grid"&&C.isManualPlacement&&window.__experimentalEnableGridInteractivity}},[e]);return!r||i&&c&&!s||t&&u?null:a.jsxs(Wn,{className:oe("block-editor-block-mover",{"is-horizontal":l==="horizontal"}),children:[!t&&a.jsx(Dge,{clientIds:e,fadeWhenDisabled:!0,children:d=>a.jsx(Ce,{__next40pxDefaultSize:!0,icon:Jue,className:"block-editor-block-mover__drag-handle",label:m("Drag"),tabIndex:"-1",...d})}),!u&&a.jsxs("div",{className:"block-editor-block-mover__move-button-container",children:[a.jsx(bs,{children:d=>a.jsx(Fge,{disabled:n,clientIds:e,...d})}),a.jsx(bs,{children:d=>a.jsx($ge,{disabled:o,clientIds:e,...d})})]})]})}const{clearTimeout:Eee,setTimeout:dCt}=window,Vge=200;function pCt({ref:e,isFocused:t,highlightParent:n,debounceTimeout:o=Vge}){const{getSelectedBlockClientId:r,getBlockRootClientId:s}=G(J),{toggleBlockHighlight:i}=Oe(J),c=x.useRef(),l=G(g=>g(J).getSettings().isDistractionFree,[]),u=g=>{if(g&&l)return;const z=r(),A=n?s(z):z;i(A,g)},d=()=>e?.current&&e.current.matches(":hover"),p=()=>{const g=d();return!t&&!g},f=()=>{const g=c.current;g&&Eee&&Eee(g)},b=g=>{g&&g.stopPropagation(),f(),u(!0)},h=g=>{g&&g.stopPropagation(),f(),c.current=dCt(()=>{p()&&u(!1)},o)};return x.useEffect(()=>()=>{u(!1),f()},[]),{debouncedShowGestures:b,debouncedHideGestures:h}}function Z7({ref:e,highlightParent:t=!1,debounceTimeout:n=Vge}){const[o,r]=x.useState(!1),{debouncedShowGestures:s,debouncedHideGestures:i}=pCt({ref:e,debounceTimeout:n,isFocused:o,highlightParent:t}),c=x.useRef(!1),l=()=>e?.current&&e.current.contains(e.current.ownerDocument.activeElement);return x.useEffect(()=>{const u=e.current,d=()=>{l()&&(r(!0),s())},p=()=>{l()||(r(!1),i())};return u&&!c.current&&(u.addEventListener("focus",d,!0),u.addEventListener("blur",p,!0),c.current=!0),()=>{u&&(u.removeEventListener("focus",d),u.removeEventListener("blur",p))}},[e,c,r,s,i]),{onMouseMove:s,onMouseLeave:i}}function fCt(){const{selectBlock:e}=Oe(J),{parentClientId:t}=G(s=>{const{getBlockParents:i,getSelectedBlockClientId:c,getParentSectionBlock:l}=ct(s(J)),u=c(),d=l(u),p=i(u);return{parentClientId:d??p[p.length-1]}},[]),n=ji(t),o=x.useRef(),r=Z7({ref:o,highlightParent:!0});return a.jsx("div",{className:"block-editor-block-parent-selector",ref:o,...r,children:a.jsx(Vt,{className:"block-editor-block-parent-selector__button",onClick:()=>e(t),label:xe(m("Select parent block: %s"),n?.title),showTooltip:!0,icon:a.jsx(Zn,{icon:n?.icon})})},t)}function Hge({blocks:e}){return Yn("medium","<")?null:a.jsx("div",{className:"block-editor-block-switcher__popover-preview-container",children:a.jsx(Io,{className:"block-editor-block-switcher__popover-preview",placement:"right-start",focusOnMount:!1,offset:16,children:a.jsxs("div",{className:"block-editor-block-switcher__preview",children:[a.jsx("div",{className:"block-editor-block-switcher__preview-title",children:m("Preview")}),a.jsx(Vd,{viewportWidth:500,blocks:e})]})})})}const bCt={};function hCt({clientIds:e,blocks:t}){const{activeBlockVariation:n,blockVariationTransformations:o}=G(s=>{const{getBlockAttributes:i,canRemoveBlocks:c}=s(J),{getActiveBlockVariation:l,getBlockVariations:u}=s(kt),d=c(e);if(t.length!==1||!d)return bCt;const[p]=t;return{blockVariationTransformations:u(p.name,"transform"),activeBlockVariation:l(p.name,i(p.clientId))}},[e,t]);return x.useMemo(()=>o?.filter(({name:s})=>s!==n?.name),[o,n])}const mCt=({transformations:e,onSelect:t,blocks:n})=>{const[o,r]=x.useState();return a.jsxs(a.Fragment,{children:[o&&a.jsx(Hge,{blocks:jo(n[0],e.find(({name:s})=>s===o).attributes)}),e?.map(s=>a.jsx(gCt,{item:s,onSelect:t,setHoveredTransformItemName:r},s.name))]})};function gCt({item:e,onSelect:t,setHoveredTransformItemName:n}){const{name:o,icon:r,title:s}=e;return a.jsxs(Ct,{className:jB(o),onClick:i=>{i.preventDefault(),t(o)},onMouseLeave:()=>n(null),onMouseEnter:()=>n(o),children:[a.jsx(Zn,{icon:r,showColors:!0}),s]})}function MCt(e){const t={"core/paragraph":1,"core/heading":2,"core/list":3,"core/quote":4},n=x.useMemo(()=>{const o=Object.keys(t),r=e.reduce((s,i)=>{const{name:c}=i;return o.includes(c)?s.priorityTextTransformations.push(i):s.restTransformations.push(i),s},{priorityTextTransformations:[],restTransformations:[]});if(r.priorityTextTransformations.length===1&&r.priorityTextTransformations[0].name==="core/quote"){const s=r.priorityTextTransformations.pop();r.restTransformations.push(s)}return r},[e]);return n.priorityTextTransformations.sort(({name:o},{name:r})=>t[o]{const[i,c]=x.useState(),{priorityTextTransformations:l,restTransformations:u}=MCt(t),d=l.length&&u.length,p=!!u.length&&a.jsx(OCt,{restTransformations:u,onSelect:o,setHoveredTransformItemName:c});return a.jsxs(a.Fragment,{children:[a.jsxs(Cn,{label:m("Transform to"),className:e,children:[i&&a.jsx(Hge,{blocks:Kr(s,i)}),!!n?.length&&a.jsx(mCt,{transformations:n,blocks:s,onSelect:r}),l.map(f=>a.jsx(Uge,{item:f,onSelect:o,setHoveredTransformItemName:c},f.name)),!d&&p]}),!!d&&a.jsx(Cn,{className:e,children:p})]})};function OCt({restTransformations:e,onSelect:t,setHoveredTransformItemName:n}){return e.map(o=>a.jsx(Uge,{item:o,onSelect:t,setHoveredTransformItemName:n},o.name))}function Uge({item:e,onSelect:t,setHoveredTransformItemName:n}){const{name:o,icon:r,title:s,isDisabled:i}=e;return a.jsxs(Ct,{className:jB(o),onClick:c=>{c.preventDefault(),t(o)},disabled:i,onMouseLeave:()=>n(null),onMouseEnter:()=>n(o),children:[a.jsx(Zn,{icon:r,showColors:!0}),s]})}class I_{constructor(t=""){this._currentValue="",this._valueAsArray=[],this.value=t}entries(...t){return this._valueAsArray.entries(...t)}forEach(...t){return this._valueAsArray.forEach(...t)}keys(...t){return this._valueAsArray.keys(...t)}values(...t){return this._valueAsArray.values(...t)}get value(){return this._currentValue}set value(t){t=String(t),this._valueAsArray=[...new Set(t.split(/\s+/g).filter(Boolean))],this._currentValue=this._valueAsArray.join(" ")}get length(){return this._valueAsArray.length}toString(){return this.value}*[Symbol.iterator](){return yield*this._valueAsArray}item(t){return this._valueAsArray[t]}contains(t){return this._valueAsArray.indexOf(t)!==-1}add(...t){this.value+=" "+t.join(" ")}remove(...t){this.value=this._valueAsArray.filter(n=>!t.includes(n)).join(" ")}toggle(t,n){return n===void 0&&(n=!this.contains(t)),n?this.add(t):this.remove(t),n}replace(t,n){return this.contains(t)?(this.remove(t),this.add(n),!0):!1}supports(t){return!0}}function yCt(e,t){for(const n of new I_(t).values()){if(n.indexOf("is-style-")===-1)continue;const o=n.substring(9),r=e?.find(({name:s})=>s===o);if(r)return r}return Xge(e)}function Q7(e,t,n){const o=new I_(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function ACt(e){return!e||e.length===0?[]:Xge(e)?e:[{name:"default",label:We("Default","block style"),isDefault:!0},...e]}function Xge(e){return e?.find(t=>t.isDefault)}function vCt(e,t){return x.useMemo(()=>{const n=t?.example,o=t?.name;if(n&&o)return LB(o,{attributes:n.attributes,innerBlocks:n.innerBlocks});if(e)return jo(e)},[t?.example?e?.name:e,t])}function J7({clientId:e,onSwitch:t}){const n=f=>{const{getBlock:b}=f(J),h=b(e);if(!h)return{};const g=on(h.name),{getBlockStyles:z}=f(kt);return{block:h,blockType:g,styles:z(h.name),className:h.attributes.className||""}},{styles:o,block:r,blockType:s,className:i}=G(n,[e]),{updateBlockAttributes:c}=Oe(J),l=ACt(o),u=yCt(l,i),d=vCt(r,s);return{onSelect:f=>{const b=Q7(i,u,f);c(e,{className:b}),t()},stylesToRender:l,activeStyle:u,genericPreviewBlock:d,className:i}}const xCt=()=>{};function wCt({clientId:e,onSwitch:t=xCt}){const{onSelect:n,stylesToRender:o,activeStyle:r}=J7({clientId:e,onSwitch:t});return!o||o.length===0?null:a.jsx(a.Fragment,{children:o.map(s=>{const i=s.label||s.name;return a.jsx(Ct,{icon:r.name===s.name?M0:null,onClick:()=>n(s),children:a.jsx(Sn,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0,children:i})},s.name)})})}function _Ct({hoveredBlock:e,onSwitch:t}){const{clientId:n}=e;return a.jsx(Cn,{label:m("Styles"),className:"block-editor-block-switcher__styles__menugroup",children:a.jsx(wCt,{clientId:n,onSwitch:t})})}const Gge=(e,t,n=new Set)=>{const{clientId:o,name:r,innerBlocks:s=[]}=e;if(!n.has(o)){if(r===t)return e;for(const i of s){const c=Gge(i,t,n);if(c)return c}}},kCt=(e,t)=>{const n=gLe(e,"content");return n?.length?n.reduce((o,r)=>(t[r]&&(o[r]=t[r]),o),{}):t},SCt=(e,t)=>{const n=kCt(t.name,t.attributes);e.attributes={...e.attributes,...n}},CCt=(e,t)=>{const n=t.map(r=>jo(r)),o=new Set;for(const r of e){let s=!1;for(const i of n){const c=Gge(i,r.name,o);if(c){s=!0,o.add(c.clientId),SCt(c,r);break}}if(!s)return}return n},qCt=(e,t)=>x.useMemo(()=>e.reduce((n,o)=>{const r=CCt(t,o.blocks);return r&&n.push({...o,transformedBlocks:r}),n},[]),[e,t]);function RCt({blocks:e,patterns:t,onSelect:n}){const[o,r]=x.useState(!1),s=qCt(t,e);return s.length?a.jsxs(Cn,{className:"block-editor-block-switcher__pattern__transforms__menugroup",children:[o&&a.jsx(TCt,{patterns:s,onSelect:n}),a.jsx(Ct,{onClick:i=>{i.preventDefault(),r(!o)},icon:ma,children:m("Patterns")})]}):null}function TCt({patterns:e,onSelect:t}){const n=Yn("medium","<");return a.jsx("div",{className:"block-editor-block-switcher__popover-preview-container",children:a.jsx(Io,{className:"block-editor-block-switcher__popover-preview",placement:n?"bottom":"right-start",offset:16,children:a.jsx("div",{className:"block-editor-block-switcher__preview is-pattern-list-preview",children:a.jsx(ECt,{patterns:e,onSelect:t})})})})}function ECt({patterns:e,onSelect:t}){return a.jsx(C1,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":m("Patterns list"),children:e.map(n=>a.jsx(Kge,{pattern:n,onSelect:t},n.name))})}function Kge({pattern:e,onSelect:t}){const n="block-editor-block-switcher__preview-patterns-container",o=vt(Kge,`${n}-list__item-description`);return a.jsxs("div",{className:`${n}-list__list-item`,children:[a.jsxs(C1.Item,{render:a.jsx("div",{role:"option","aria-label":e.title,"aria-describedby":e.description?o:void 0,className:`${n}-list__item`}),onClick:()=>t(e.transformedBlocks),children:[a.jsx(Vd,{blocks:e.transformedBlocks,viewportWidth:e.viewportWidth||500}),a.jsx("div",{className:`${n}-list__item-title`,children:e.title})]}),!!e.description&&a.jsx(qn,{id:o,children:e.description})]})}function WCt({onClose:e,clientIds:t,hasBlockStyles:n,canRemove:o}){const{replaceBlocks:r,multiSelect:s,updateBlockAttributes:i}=Oe(J),{possibleBlockTransformations:c,patterns:l,blocks:u,isUsingBindings:d}=G(C=>{const{getBlockAttributes:R,getBlocksByClientId:T,getBlockRootClientId:E,getBlockTransformItems:B,__experimentalGetPatternTransformItems:N}=C(J),j=E(t[0]),I=T(t);return{blocks:I,possibleBlockTransformations:B(I,j),patterns:N(I,j),isUsingBindings:t.every(P=>!!R(P)?.metadata?.bindings)}},[t]),p=hCt({clientIds:t,blocks:u});function f(C){C.length>1&&s(C[0].clientId,C[C.length-1].clientId)}function b(C){const R=Kr(u,C);r(t,R),f(R)}function h(C){i(u[0].clientId,{...p.find(({name:R})=>R===C).attributes})}function g(C){r(t,C),f(C)}const z=u.length===1,A=z&&Hh(u[0]),_=!!c.length&&o&&!A,v=!!p?.length,M=!!l?.length&&o,y=_||v;if(!(n||y||M))return a.jsx("p",{className:"block-editor-block-switcher__no-transforms",children:m("No transforms.")});const S=We(z?"This block is connected.":"These blocks are connected.","block toolbar button label and description");return a.jsxs("div",{className:"block-editor-block-switcher__container",children:[M&&a.jsx(RCt,{blocks:u,patterns:l,onSelect:C=>{g(C),e()}}),y&&a.jsx(zCt,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:c,possibleBlockVariationTransformations:p,blocks:u,onSelect:C=>{b(C),e()},onSelectVariation:C=>{h(C),e()}}),n&&a.jsx(_Ct,{hoveredBlock:u[0],onSwitch:e}),d&&a.jsx(Cn,{children:a.jsx(Sn,{className:"block-editor-block-switcher__binding-indicator",children:S})})]})}const NCt=({clientIds:e})=>{const{hasContentOnlyLocking:t,canRemove:n,hasBlockStyles:o,icon:r,invalidBlocks:s,isReusable:i,isTemplate:c,isDisabled:l}=G(z=>{const{getTemplateLock:A,getBlocksByClientId:_,getBlockAttributes:v,canRemoveBlocks:M,getBlockEditingMode:y}=z(J),{getBlockStyles:k,getBlockType:S,getActiveBlockVariation:C}=z(kt),R=_(e);if(!R.length||R.some(P=>!P))return{invalidBlocks:!0};const[{name:T}]=R,E=R.length===1,B=S(T),N=y(e[0]);let j,I;if(E)j=C(T,v(e[0]))?.icon||B.icon,I=A(e[0])==="contentOnly";else{const P=new Set(R.map(({name:$})=>$)).size===1;I=e.some($=>A($)==="contentOnly"),j=P?B.icon:H3}return{canRemove:M(e),hasBlockStyles:E&&!!k(T)?.length,icon:j,isReusable:E&&Qd(R[0]),isTemplate:E&&Hh(R[0]),hasContentOnlyLocking:I,isDisabled:N!=="default"}},[e]),u=Fd({clientId:e?.[0],maximumLength:35}),d=G(z=>z(ht).get("core","showIconLabels"),[]);if(s)return null;const p=e.length===1,f=p?u:m("Multiple blocks selected"),b=(i||c)&&!d&&u?u:void 0;if(l||!o&&!n||t)return a.jsx(Wn,{children:a.jsx(Vt,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:f,icon:a.jsx(Zn,{className:"block-editor-block-switcher__toggle",icon:r,showColors:!0}),text:b})});const g=p?m("Change block type or style"):xe(Dn("Change type of %d block","Change type of %d blocks",e.length),e.length);return a.jsx(Wn,{children:a.jsx(bs,{children:z=>a.jsx(c0,{className:"block-editor-block-switcher",label:f,popoverProps:{placement:"bottom-start",className:"block-editor-block-switcher__popover"},icon:a.jsx(Zn,{className:"block-editor-block-switcher__toggle",icon:r,showColors:!0}),text:b,toggleProps:{description:g,...z},menuProps:{orientation:"both"},children:({onClose:A})=>a.jsx(WCt,{onClose:A,clientIds:e,hasBlockStyles:o,canRemove:n})})})})},BCt=Qn("BlockControls"),LCt=Qn("BlockControlsBlock"),PCt=Qn("BlockFormatControls"),jCt=Qn("BlockControlsOther"),ICt=Qn("BlockControlsParent"),IW={default:BCt,block:LCt,inline:PCt,other:jCt,parent:ICt};function DCt(e,t){const n=j0();return n[J5]?IW[e]?.Fill:n[GB]&&t?IW.parent.Fill:null}function FCt({group:e="default",controls:t,children:n,__experimentalShareWithChildBlocks:o=!1}){const r=DCt(e,o);if(!r)return null;const s=a.jsxs(a.Fragment,{children:[e==="default"&&a.jsx(Wn,{controls:t}),n]});return a.jsx(Jf,{document,children:a.jsx(r,{children:i=>{const{forwardedContext:c=[]}=i;return c.reduce((l,[u,d])=>a.jsx(u,{...d,children:l}),s)}})})}const{ComponentsContext:Wee}=ct(tr);function $Ct({group:e="default",...t}){const n=x.useContext(jd),o=x.useContext(Wee),r=x.useMemo(()=>({forwardedContext:[[jd.Provider,{value:n}],[Wee.Provider,{value:o}]]}),[n,o]),s=IW[e],i=H0(s.name);if(!s)return globalThis.SCRIPT_DEBUG===!0&&zn(`Unknown BlockControls group "${e}" provided.`),null;if(!i?.length)return null;const{Slot:c}=s,l=a.jsx(c,{...t,bubblesVirtually:!0,fillProps:r});return e==="default"?l:a.jsx(Wn,{children:l})}const bt=FCt;bt.Slot=$Ct;const{Fill:eI,Slot:VCt}=Qn("__unstableBlockToolbarLastItem");eI.Slot=VCt;const HCt="align",Yge="__experimentalBorder",D_="color",UCt="customClassName",Zge="typography.__experimentalFontFamily",Qge="typography.fontSize",XCt="typography.lineHeight",GCt="typography.__experimentalFontStyle",KCt="typography.__experimentalFontWeight",Jge="typography.textAlign",YCt="typography.textColumns",ZCt="typography.__experimentalTextDecoration",QCt="typography.__experimentalWritingMode",JCt="typography.__experimentalTextTransform",eqt="typography.__experimentalLetterSpacing",tqt="layout",nqt=[XCt,Qge,GCt,KCt,Zge,Jge,YCt,ZCt,JCt,QCt,eqt],oqt=["shadow"],rqt="spacing",sqt=[...oqt,...nqt,Yge,D_,rqt],iqt=e=>Et(e,HCt);function aqt(e,t="any"){const n=An(e,Yge);return n===!0?!0:t==="any"?!!(n?.color||n?.radius||n?.width||n?.style):!!n?.[t]}const cqt=e=>{const t=An(e,D_);return t!==null&&typeof t=="object"&&!!t.gradients},lqt=e=>{const t=An(e,D_);return t&&t.background!==!1},uqt=e=>Et(e,Jge),dqt=e=>{const t=An(e,D_);return t&&t.text!==!1},pqt=e=>Et(e,UCt,!0),fqt=e=>Et(e,Zge),bqt=e=>Et(e,Qge),hqt=e=>Et(e,tqt),mqt=e=>sqt.some(t=>Et(e,t));function gqt(e){try{const t=Ko(e,{__unstableSkipMigrationLogs:!0,__unstableSkipAutop:!0});return!(t.length===1&&t[0].name==="core/freeform")}catch{return!1}}const Mqt={align:iqt,borderColor:e=>aqt(e,"color"),backgroundColor:lqt,textAlign:uqt,textColor:dqt,gradient:cqt,className:pqt,fontFamily:fqt,fontSize:bqt,layout:hqt,style:mqt};function zqt(e,t){return Object.entries(Mqt).reduce((n,[o,r])=>(r(e.name)&&r(t.name)&&(n[o]=e.attributes[o]),n),{})}function DW(e,t,n){for(let o=0;o{let i="";try{if(!window.navigator.clipboard){r(m("Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers."),{type:"snackbar"});return}i=await window.navigator.clipboard.readText()}catch{r(m("Unable to paste styles. Please allow browser clipboard permissions before continuing."),{type:"snackbar"});return}if(!i||!gqt(i)){o(m("Unable to paste styles. Block styles couldn't be found within the copied content."),{type:"snackbar"});return}const c=Ko(i);if(c.length===1?e.batch(()=>{DW(s,s.map(()=>c[0]),t)}):e.batch(()=>{DW(s,c,t)}),s.length===1){const l=on(s[0].name)?.title;n(xe(m("Pasted styles to %s."),l),{type:"snackbar"})}else n(xe(m("Pasted styles to %d blocks."),s.length),{type:"snackbar"})},[e.batch,t,n,o,r])}function yqt({clientIds:e,children:t,__experimentalUpdateSelection:n}){const{getDefaultBlockName:o,getGroupingBlockName:r}=G(kt),s=G(v=>{const{canInsertBlockType:M,getBlockRootClientId:y,getBlocksByClientId:k,getDirectInsertBlock:S,canRemoveBlocks:C}=v(J),R=k(e),T=y(e[0]),E=M(o(),T),B=T?S(T):null;return{canRemove:C(e),canInsertBlock:E||!!B,canCopyStyles:R.every(N=>!!N&&(Et(N.name,"color")||Et(N.name,"typography"))),canDuplicate:R.every(N=>!!N&&Et(N.name,"multiple",!0)&&M(N.name,T))}},[e,o]),{getBlocksByClientId:i,getBlocks:c}=G(J),{canRemove:l,canInsertBlock:u,canCopyStyles:d,canDuplicate:p}=s,{removeBlocks:f,replaceBlocks:b,duplicateBlocks:h,insertAfterBlock:g,insertBeforeBlock:z,flashBlock:A}=Oe(J),_=Oqt();return t({canCopyStyles:d,canDuplicate:p,canInsertBlock:u,canRemove:l,onDuplicate(){return h(e,n)},onRemove(){return f(e,n)},onInsertBefore(){z(e[0])},onInsertAfter(){g(e[e.length-1])},onGroup(){if(!e.length)return;const v=r(),M=Kr(i(e),v);M&&b(e,M)},onUngroup(){if(!e.length)return;const v=c(e[0]);v.length&&b(e,v)},onCopy(){e.length===1&&A(e[0])},async onPasteStyles(){await _(i(e))}})}const eMe=Qn(Symbol("CommentIconSlotFill"));function Aqt({clientId:e}){const t=G(o=>o(J).getBlock(e),[e]),{replaceBlocks:n}=Oe(J);return!t||t.name!=="core/html"?null:a.jsx(Ct,{onClick:()=>n(e,O3({HTML:Y5(t)})),children:m("Convert to Blocks")})}const{Fill:F_,Slot:vqt}=Qn("__unstableBlockSettingsMenuFirstItem");F_.Slot=vqt;function tMe(e){return G(t=>{const{getBlocksByClientId:n,getSelectedBlockClientIds:o,isUngroupable:r,isGroupable:s}=t(J),{getGroupingBlockName:i,getBlockType:c}=t(kt),l=e?.length?e:o(),u=n(l),[d]=u,p=l.length===1&&r(l[0]);return{clientIds:l,isGroupable:s(l),isUngroupable:p,blocksSelection:u,groupingBlockName:i(),onUngroup:p&&c(d.name)?.transforms?.ungroup}},[e])}const xqt={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"},grid:{type:"grid"}};function wqt(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=tMe(),{replaceBlocks:r}=Oe(J),{canRemove:s,variations:i}=G(h=>{const{canRemoveBlocks:g}=h(J),{getBlockVariations:z}=h(kt);return{canRemove:g(t),variations:z(n,"transform")}},[t,n]),c=h=>{const g=Kr(e,n);typeof h!="string"&&(h="group"),g&&g.length>0&&(g[0].attributes.layout=xqt[h],r(t,g))},l=()=>c("row"),u=()=>c("stack"),d=()=>c("grid");if(!o||!s)return null;const p=!!i.find(({name:h})=>h==="group-row"),f=!!i.find(({name:h})=>h==="group-stack"),b=!!i.find(({name:h})=>h==="group-grid");return a.jsxs(Wn,{children:[a.jsx(Vt,{icon:Zf,label:We("Group","action: convert blocks to group"),onClick:c}),p&&a.jsx(Vt,{icon:Tde,label:We("Row","action: convert blocks to row"),onClick:l}),f&&a.jsx(Vt,{icon:Pde,label:We("Stack","action: convert blocks to stack"),onClick:u}),b&&a.jsx(Vt,{icon:X3,label:We("Grid","action: convert blocks to grid"),onClick:d})]})}function _qt({clientIds:e,isGroupable:t,isUngroupable:n,onUngroup:o,blocksSelection:r,groupingBlockName:s,onClose:i=()=>{}}){const{getSelectedBlockClientIds:c}=G(J),{replaceBlocks:l}=Oe(J),u=()=>{const f=Kr(r,s);f&&l(e,f)},d=()=>{let f=r[0].innerBlocks;f.length&&(o&&(f=o(r[0].attributes,r[0].innerBlocks)),l(e,f))};if(!t&&!n)return null;const p=c();return a.jsxs(a.Fragment,{children:[t&&a.jsx(Ct,{shortcut:p.length>1?j1.primary("g"):void 0,onClick:()=>{u(),i()},children:We("Group","verb")}),n&&a.jsx(Ct,{onClick:()=>{d(),i()},children:We("Ungroup","Ungrouping blocks from within a grouping block back into individual blocks within the Editor")})]})}function km(e){return G(t=>{const{canEditBlock:n,canMoveBlock:o,canRemoveBlock:r,canLockBlockType:s,getBlockName:i,getTemplateLock:c}=t(J),l=n(e),u=o(e),d=r(e);return{canEdit:l,canMove:u,canRemove:d,canLock:s(i(e)),isContentLocked:c(e)==="contentOnly",isLocked:!l||!u||!d}},[e])}const kqt=["core/navigation"];function Sqt(e){return e.remove&&e.move?"all":e.remove&&!e.move?"insert":!1}function nMe({clientId:e,onClose:t}){const[n,o]=x.useState({move:!1,remove:!1}),{canEdit:r,canMove:s,canRemove:i}=km(e),{allowsEditLocking:c,templateLock:l,hasTemplateLock:u}=G(z=>{const{getBlockName:A,getBlockAttributes:_}=z(J),v=A(e),M=on(v);return{allowsEditLocking:kqt.includes(v),templateLock:_(e)?.templateLock,hasTemplateLock:!!M?.attributes?.templateLock}},[e]),[d,p]=x.useState(!!l),{updateBlockAttributes:f}=Oe(J),b=ji(e);x.useEffect(()=>{o({move:!s,remove:!i,...c?{edit:!r}:{}})},[r,s,i,c]);const h=Object.values(n).every(Boolean),g=Object.values(n).some(Boolean)&&!h;return a.jsx(Zo,{title:xe(m("Lock %s"),b.title),overlayClassName:"block-editor-block-lock-modal",onRequestClose:t,children:a.jsxs("form",{onSubmit:z=>{z.preventDefault(),f([e],{lock:n,templateLock:d?Sqt(n):void 0}),t()},children:[a.jsxs("fieldset",{className:"block-editor-block-lock-modal__options",children:[a.jsx("legend",{children:m("Select the features you want to lock")}),a.jsx("ul",{role:"list",className:"block-editor-block-lock-modal__checklist",children:a.jsxs("li",{children:[a.jsx(K0,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__options-all",label:m("Lock all"),checked:h,indeterminate:g,onChange:z=>o({move:z,remove:z,...c?{edit:z}:{}})}),a.jsxs("ul",{role:"list",className:"block-editor-block-lock-modal__checklist",children:[c&&a.jsxs("li",{className:"block-editor-block-lock-modal__checklist-item",children:[a.jsx(K0,{__nextHasNoMarginBottom:!0,label:m("Lock editing"),checked:!!n.edit,onChange:z=>o(A=>({...A,edit:z}))}),a.jsx(qo,{className:"block-editor-block-lock-modal__lock-icon",icon:n.edit?Qv:SM})]}),a.jsxs("li",{className:"block-editor-block-lock-modal__checklist-item",children:[a.jsx(K0,{__nextHasNoMarginBottom:!0,label:m("Lock movement"),checked:n.move,onChange:z=>o(A=>({...A,move:z}))}),a.jsx(qo,{className:"block-editor-block-lock-modal__lock-icon",icon:n.move?Qv:SM})]}),a.jsxs("li",{className:"block-editor-block-lock-modal__checklist-item",children:[a.jsx(K0,{__nextHasNoMarginBottom:!0,label:m("Lock removal"),checked:n.remove,onChange:z=>o(A=>({...A,remove:z}))}),a.jsx(qo,{className:"block-editor-block-lock-modal__lock-icon",icon:n.remove?Qv:SM})]})]})]})}),u&&a.jsx(lt,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__template-lock",label:m("Apply to all blocks inside"),checked:d,disabled:n.move&&!n.remove,onChange:()=>p(!d)})]}),a.jsxs(Yo,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1,children:[a.jsx(Tn,{children:a.jsx(Ce,{variant:"tertiary",onClick:t,__next40pxDefaultSize:!0,children:m("Cancel")})}),a.jsx(Tn,{children:a.jsx(Ce,{variant:"primary",type:"submit",__next40pxDefaultSize:!0,children:m("Apply")})})]})]})})}function Cqt({clientId:e}){const{canLock:t,isLocked:n}=km(e),[o,r]=x.useReducer(i=>!i,!1);if(!t)return null;const s=m(n?"Unlock":"Lock");return a.jsxs(a.Fragment,{children:[a.jsx(Ct,{icon:n?SM:bQe,onClick:r,"aria-expanded":o,"aria-haspopup":"dialog",children:s}),o&&a.jsx(nMe,{clientId:e,onClose:r})]})}function qqt({clientId:e}){const{canLock:t,isLocked:n}=km(e),[o,r]=x.useReducer(c=>!c,!1),s=x.useRef(!1);if(x.useEffect(()=>{n&&(s.current=!0)},[n]),!n&&!s.current)return null;let i=m(n?"Unlock":"Lock");return!t&&n&&(i=m("Locked")),a.jsxs(a.Fragment,{children:[a.jsx(Wn,{className:"block-editor-block-lock-toolbar",children:a.jsx(Vt,{disabled:!t,icon:n?Qv:SM,label:i,onClick:r,"aria-expanded":o,"aria-haspopup":"dialog"})}),o&&a.jsx(nMe,{clientId:e,onClose:r})]})}const Rqt=()=>{};function Tqt({clientId:e,onToggle:t=Rqt}){const{blockType:n,mode:o,isCodeEditingEnabled:r}=G(c=>{const{getBlock:l,getBlockMode:u,getSettings:d}=c(J),p=l(e);return{mode:u(e),blockType:p?on(p.name):null,isCodeEditingEnabled:d().codeEditingEnabled}},[e]),{toggleBlockMode:s}=Oe(J);if(!n||!Et(n,"html",!0)||!r)return null;const i=m(o==="visual"?"Edit as HTML":"Edit visually");return a.jsx(Ct,{onClick:()=>{s(e),t()},children:i})}function Eqt({clientId:e,onClose:t}){const{templateLock:n,isLockedByParent:o,isEditingAsBlocks:r}=G(u=>{const{getContentLockingParent:d,getTemplateLock:p,getTemporarilyEditingAsBlocks:f}=ct(u(J));return{templateLock:p(e),isLockedByParent:!!d(e),isEditingAsBlocks:f()===e}},[e]),s=Oe(J),i=!o&&n==="contentOnly";if(!i&&!r)return null;const{modifyContentLockBlock:c}=ct(s);return!r&&i&&a.jsx(Ct,{onClick:()=>{c(e),t()},children:We("Modify","Unlock content locked blocks")})}function Wqt(e){return e?.trim()?.length===0}function Nqt({clientId:e,onClose:t}){const[n,o]=x.useState(),r=ji(e),{metadata:s}=G(z=>{const{getBlockAttributes:A}=z(J);return{metadata:A(e)?.metadata}},[e]),{updateBlockAttributes:i}=Oe(J),c=s?.name||"",l=r?.title,u=!!c&&!!s?.bindings&&Object.values(s.bindings).some(z=>z.source==="core/pattern-overrides"),d=n!==void 0&&n!==c,p=n===l,f=Wqt(n),b=d||p,h=z=>z.target.select(),g=()=>{const z=p||f?void 0:n,A=xe(m(p||f?'Block name reset to: "%s".':'Block name changed to: "%s".'),n);Yt(A,"assertive"),i([e],{metadata:{...s,name:z}}),t()};return a.jsx(Zo,{title:m("Rename"),onRequestClose:t,overlayClassName:"block-editor-block-rename-modal",focusOnMount:"firstContentElement",size:"small",children:a.jsx("form",{onSubmit:z=>{z.preventDefault(),b&&g()},children:a.jsxs(dt,{spacing:"3",children:[a.jsx(dn,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:n??c,label:m("Name"),help:u?m("This block allows overrides. Changing the name can cause problems with content entered into instances of this pattern."):void 0,placeholder:l,onChange:o,onFocus:h}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,children:m("Cancel")}),a.jsx(Ce,{__next40pxDefaultSize:!0,accessibleWhenDisabled:!0,disabled:!b,variant:"primary",type:"submit",children:m("Save")})]})]})})})}function Bqt({clientId:e}){const[t,n]=x.useState(!1);return a.jsxs(a.Fragment,{children:[a.jsx(Ct,{onClick:()=>{n(!0)},"aria-expanded":t,"aria-haspopup":"dialog",children:m("Rename")}),t&&a.jsx(Nqt,{clientId:e,onClose:()=>n(!1)})]})}function Lqt(e){return{canRename:An(e,"renaming",!0)}}const{Fill:Pqt,Slot:jqt}=Qn("BlockSettingsMenuControls"),Iqt=({fillProps:e,clientIds:t=null})=>{const{selectedBlocks:n,selectedClientIds:o,isContentOnly:r}=G(b=>{const{getBlockNamesByClientId:h,getSelectedBlockClientIds:g,getBlockEditingMode:z}=b(J),A=t!==null?t:g();return{selectedBlocks:h(A),selectedClientIds:A,isContentOnly:z(A[0])==="contentOnly"}},[t]),{canLock:s}=km(o[0]),{canRename:i}=Lqt(n[0]),c=o.length===1&&s&&!r,l=o.length===1&&i&&!r,u=tMe(o),{isGroupable:d,isUngroupable:p}=u,f=(d||p)&&!r;return a.jsx(jqt,{fillProps:{...e,selectedBlocks:n,selectedClientIds:o},children:b=>!b?.length>0&&!f&&!c?null:a.jsxs(Cn,{children:[f&&a.jsx(_qt,{...u,onClose:e?.onClose}),c&&a.jsx(Cqt,{clientId:o[0]}),l&&a.jsx(Bqt,{clientId:o[0]}),b,o.length===1&&a.jsx(Eqt,{clientId:o[0],onClose:e?.onClose}),e?.count===1&&!r&&a.jsx(Tqt,{clientId:e?.firstBlockClientId,onToggle:e?.onClose})]})})};function cb({...e}){return a.jsx(Jf,{document,children:a.jsx(Pqt,{...e})})}cb.Slot=Iqt;function Dqt({parentClientId:e,parentBlockType:t}){const n=Yn("medium","<"),{selectBlock:o}=Oe(J),r=x.useRef(),s=Z7({ref:r,highlightParent:!0});return n?a.jsx(Ct,{...s,ref:r,icon:a.jsx(Zn,{icon:t.icon}),onClick:()=>o(e),children:xe(m("Select parent block (%s)"),t.title)}):null}const Fqt={className:"block-editor-block-settings-menu__popover",placement:"bottom-start"};function Nee({clientIds:e,onCopy:t,label:n,shortcut:o,eventType:r="copy"}){const{getBlocksByClientId:s}=G(J),i=R7(),c=Hl(()=>Ks(s(e)),()=>{t&&r==="copy"&&t(),i(r,e)}),l=n||m("Copy");return a.jsx(Ct,{ref:c,shortcut:o,children:l})}function oMe({block:e,clientIds:t,children:n,__experimentalSelectBlock:o,...r}){const s=e?.clientId,i=t.length,c=t[0],{firstParentClientId:l,parentBlockType:u,previousBlockClientId:d,selectedBlockClientIds:p,openedBlockSettingsMenu:f,isContentOnly:b}=G(R=>{const{getBlockName:T,getBlockRootClientId:E,getPreviousBlockClientId:B,getSelectedBlockClientIds:N,getBlockAttributes:j,getOpenedBlockSettingsMenu:I,getBlockEditingMode:P}=ct(R(J)),{getActiveBlockVariation:$}=R(kt),F=E(c),X=F&&T(F);return{firstParentClientId:F,parentBlockType:F&&($(X,j(F))||on(X)),previousBlockClientId:B(c),selectedBlockClientIds:N(),openedBlockSettingsMenu:I(),isContentOnly:P(c)==="contentOnly"}},[c]),{getBlockOrder:h,getSelectedBlockClientIds:g}=G(J),{setOpenedBlockSettingsMenu:z}=ct(Oe(J)),A=G(R=>{const{getShortcutRepresentation:T}=R(Pi);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")}},[]),_=p.length>0;async function v(R){if(!o)return;const T=await R;T&&T[0]&&o(T[0],!1)}function M(){if(!o)return;let R=d||l;R||(R=h()[0]);const T=_&&g().length===0;o(R,T)}const y=p?.includes(l),k=s?f===s||!1:void 0;function S(R){R&&f!==s?z(s):!R&&f&&f===s&&z(void 0)}const C=!y&&!!l;return a.jsx(yqt,{clientIds:t,__experimentalUpdateSelection:!o,children:({canCopyStyles:R,canDuplicate:T,canInsertBlock:E,canRemove:B,onDuplicate:N,onInsertAfter:j,onInsertBefore:I,onRemove:P,onCopy:$,onPasteStyles:F})=>!B&&!T&&!E&&b?null:a.jsx(c0,{icon:Wc,label:m("Options"),className:"block-editor-block-settings-menu",popoverProps:Fqt,open:k,onToggle:S,noIcons:!0,...r,children:({onClose:Z})=>a.jsxs(a.Fragment,{children:[a.jsxs(Cn,{children:[a.jsx(F_.Slot,{fillProps:{onClose:Z}}),C&&a.jsx(Dqt,{parentClientId:l,parentBlockType:u}),i===1&&a.jsx(Aqt,{clientId:c}),a.jsx(Nee,{clientIds:t,onCopy:$,shortcut:j1.primary("c")}),T&&a.jsx(Ct,{onClick:Ku(Z,N,v),shortcut:A.duplicate,children:m("Duplicate")}),E&&!b&&a.jsxs(a.Fragment,{children:[a.jsx(Ct,{onClick:Ku(Z,I),shortcut:A.insertBefore,children:m("Add before")}),a.jsx(Ct,{onClick:Ku(Z,j),shortcut:A.insertAfter,children:m("Add after")})]}),a.jsx(eMe.Slot,{fillProps:{onClose:Z}})]}),R&&!b&&a.jsxs(Cn,{children:[a.jsx(Nee,{clientIds:t,onCopy:$,label:m("Copy styles"),eventType:"copyStyles"}),a.jsx(Ct,{onClick:F,children:m("Paste styles")})]}),!b&&a.jsx(cb.Slot,{fillProps:{onClose:Z,count:i,firstBlockClientId:c},clientIds:t}),typeof n=="function"?n({onClose:Z}):x.Children.map(V=>x.cloneElement(V,{onClose:Z})),B&&a.jsx(Cn,{children:a.jsx(Ct,{onClick:Ku(Z,P,M),shortcut:A.remove,children:m("Delete")})})]})})})}const rMe=Qn(Symbol("CommentIconToolbarSlotFill"));function $qt({clientIds:e,...t}){return a.jsxs(Wn,{children:[a.jsx(rMe.Slot,{}),a.jsx(bs,{children:n=>a.jsx(oMe,{clientIds:e,toggleProps:n,...t})})]})}function Vqt({clientIds:e}){const t=e.length===1?e[0]:void 0,n=G(r=>!!t&&r(J).getBlockMode(t)==="html",[t]),{toggleBlockMode:o}=Oe(J);return n?a.jsx(Wn,{children:a.jsx(Vt,{onClick:()=>{o(t)},children:m("Edit visually")})}):null}const Hqt=x.createContext("");function Uqt(e){const t="toolbarItem";return!e.some(n=>!(t in n.dataset))}function Bee(e){return Array.from(e.querySelectorAll("[data-toolbar-item]:not([disabled])"))}function Lee(e){return e.contains(e.ownerDocument.activeElement)}function Xqt(e){const[t]=Xr.tabbable.find(e);t&&t.focus({preventScroll:!0})}function Gqt(e){const[n,o]=x.useState(!0),r=x.useCallback(()=>{const s=Xr.tabbable.find(e.current),i=Uqt(s);i||Ke("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"}),o(i)},[e]);return x.useLayoutEffect(()=>{const s=new window.MutationObserver(r);return s.observe(e.current,{childList:!0,subtree:!0}),()=>s.disconnect()},[r,n,e]),n}function Kqt({toolbarRef:e,focusOnMount:t,isAccessibleToolbar:n,defaultIndex:o,onIndexChange:r,shouldUseKeyboardFocusShortcut:s,focusEditorOnEscape:i}){const[c]=x.useState(t),[l]=x.useState(o),u=x.useCallback(()=>{Xqt(e.current)},[e]);p0("core/block-editor/focus-toolbar",()=>{s&&u()}),x.useEffect(()=>{c&&u()},[n,c,u]),x.useEffect(()=>{const f=e.current;let b=0;return!c&&!Lee(f)&&(b=window.requestAnimationFrame(()=>{const h=Bee(f),g=l||0;h[g]&&Lee(f)&&h[g].focus({preventScroll:!0})})),()=>{if(window.cancelAnimationFrame(b),!r||!f)return;const g=Bee(f).findIndex(z=>z.tabIndex===0);r(g)}},[l,c,r,e]);const{getLastFocus:p}=ct(G(J));x.useEffect(()=>{const f=e.current;if(i){const b=h=>{const g=p();h.keyCode===gd&&g?.current&&(h.preventDefault(),g.current.focus())};return f.addEventListener("keydown",b),()=>{f.removeEventListener("keydown",b)}}},[i,p,e])}function tI({children:e,focusOnMount:t,focusEditorOnEscape:n=!1,shouldUseKeyboardFocusShortcut:o=!0,__experimentalInitialIndex:r,__experimentalOnIndexChange:s,orientation:i="horizontal",...c}){const l=x.useRef(),u=Gqt(l);return Kqt({toolbarRef:l,focusOnMount:t,defaultIndex:r,onIndexChange:s,isAccessibleToolbar:u,shouldUseKeyboardFocusShortcut:o,focusEditorOnEscape:n}),u?a.jsx(p2e,{label:c["aria-label"],ref:l,orientation:i,...c,children:e}):a.jsx(pm,{orientation:i,role:"toolbar",ref:l,...c,children:e})}function sMe(){const{isToolbarEnabled:e,isBlockDisabled:t}=G(n=>{const{getBlockEditingMode:o,getBlockName:r,getBlockSelectionStart:s}=n(J),i=s(),c=i&&on(r(i));return{isToolbarEnabled:c&&Et(c,"__experimentalToolbar",!0),isBlockDisabled:o(i)==="disabled"}},[]);return!(!e||t)}const HR=[],Yqt=6,Zqt={placement:"bottom-start"};function Qqt({clientId:e}){const{categories:t,currentPatternName:n,patterns:o}=G(c=>{const{getBlockAttributes:l,getBlockRootClientId:u,__experimentalGetAllowedPatterns:d}=c(J),p=l(e),f=p?.metadata?.categories||HR,b=u(e),h=f.length>0?d(b):HR;return{categories:f,currentPatternName:p?.metadata?.patternName,patterns:h}},[e]),{replaceBlocks:r}=Oe(J),s=x.useMemo(()=>t.length===0||!o||o.length===0?HR:o.filter(c=>{const l=c.source==="core"||c.source?.startsWith("pattern-directory")&&c.source!=="pattern-directory/theme";return c.blocks.length===1&&!l&&n!==c.name&&c.categories?.some(u=>t.includes(u))&&(c.syncStatus==="unsynced"||!c.id)}).slice(0,Yqt),[t,n,o]);if(s.length<2)return null;const i=c=>{var l;const u=((l=c.blocks)!==null&&l!==void 0?l:[]).map(d=>jo(d));u[0].attributes.metadata={...u[0].attributes.metadata,categories:t},r(e,u)};return a.jsx(so,{popoverProps:Zqt,renderToggle:({onToggle:c,isOpen:l})=>a.jsx(Wn,{children:a.jsx(Vt,{onClick:()=>c(!l),"aria-expanded":l,children:m("Change design")})}),renderContent:()=>a.jsx($s,{className:"block-editor-block-toolbar-change-design-content-wrapper",paddingSize:"none",children:a.jsx(qa,{blockPatterns:s,onClickPattern:i,showTitlesAsTooltip:!0})})})}const Jqt={user:{},base:{},merged:{},setUserConfig:()=>{}},lb=x.createContext(Jqt),Pee={settings:{},styles:{}},eRt=["appearanceTools","useRootPaddingAwareAlignments","background.backgroundImage","background.backgroundRepeat","background.backgroundSize","background.backgroundPosition","border.color","border.radius","border.style","border.width","shadow.presets","shadow.defaultPresets","color.background","color.button","color.caption","color.custom","color.customDuotone","color.customGradient","color.defaultDuotone","color.defaultGradients","color.defaultPalette","color.duotone","color.gradients","color.heading","color.link","color.palette","color.text","custom","dimensions.aspectRatio","dimensions.minHeight","layout.contentSize","layout.definitions","layout.wideSize","lightbox.enabled","lightbox.allowEditing","position.fixed","position.sticky","spacing.customSpacingSize","spacing.defaultSpacingSizes","spacing.spacingSizes","spacing.spacingScale","spacing.blockGap","spacing.margin","spacing.padding","spacing.units","typography.fluid","typography.customFontSize","typography.defaultFontSizes","typography.dropCap","typography.fontFamilies","typography.fontSizes","typography.fontStyle","typography.fontWeight","typography.letterSpacing","typography.lineHeight","typography.textAlign","typography.textColumns","typography.textDecoration","typography.textTransform","typography.writingMode"],tRt=()=>{const{user:e,setUserConfig:t}=x.useContext(lb),n={settings:e.settings,styles:e.styles};return[!!n&&!N0(n,Pee),x.useCallback(()=>t(Pee),[t])]};function iMe(e,t,n="all"){const{setUserConfig:o,...r}=x.useContext(lb),s=t?".blocks."+t:"",i=e?"."+e:"",c=`settings${s}${i}`,l=`settings${i}`,u=n==="all"?"merged":n;return[x.useMemo(()=>{const f=r[u];if(!f)throw"Unsupported source";if(e){var b;return(b=fo(f,c))!==null&&b!==void 0?b:fo(f,l)}let h={};return eRt.forEach(g=>{var z;const A=(z=fo(f,`settings${s}.${g}`))!==null&&z!==void 0?z:fo(f,`settings.${g}`);A!==void 0&&(h=gn(h,g.split("."),A))}),h},[r,u,e,c,l,s]),f=>{o(b=>gn(b,c.split("."),f))}]}function nRt(e,t,n="all",{shouldDecodeEncode:o=!0}={}){const{merged:r,base:s,user:i,setUserConfig:c}=x.useContext(lb),l=e?"."+e:"",u=t?`styles.blocks.${t}${l}`:`styles${l}`,d=b=>{c(h=>gn(h,u.split("."),o?WSt(r.settings,t,e,b):b))};let p,f;switch(n){case"all":p=fo(r,u),f=o?ua(r,t,p):p;break;case"user":p=fo(i,u),f=o?ua(r,t,p):p;break;case"base":p=fo(s,u),f=o?ua(s,t,p):p;break;default:throw"Unsupported source"}return[f,d]}function aMe(e,t,n){const{supportedStyles:o,supports:r}=G(s=>({supportedStyles:ct(s(kt)).getSupportedStyles(t,n),supports:s(kt).getBlockType(t)?.supports}),[t,n]);return x.useMemo(()=>{const s={...e};return o.includes("fontSize")||(s.typography={...s.typography,fontSizes:{},customFontSize:!1,defaultFontSizes:!1}),o.includes("fontFamily")||(s.typography={...s.typography,fontFamilies:{}}),s.color={...s.color,text:s.color?.text&&o.includes("color"),background:s.color?.background&&(o.includes("background")||o.includes("backgroundColor")),button:s.color?.button&&o.includes("buttonColor"),heading:s.color?.heading&&o.includes("headingColor"),link:s.color?.link&&o.includes("linkColor"),caption:s.color?.caption&&o.includes("captionColor")},o.includes("background")||(s.color.gradients=[],s.color.customGradient=!1),o.includes("filter")||(s.color.defaultDuotone=!1,s.color.customDuotone=!1),["lineHeight","fontStyle","fontWeight","letterSpacing","textAlign","textTransform","textDecoration","writingMode"].forEach(i=>{o.includes(i)||(s.typography={...s.typography,[i]:!1})}),o.includes("columnCount")||(s.typography={...s.typography,textColumns:!1}),["contentSize","wideSize"].forEach(i=>{o.includes(i)||(s.layout={...s.layout,[i]:!1})}),["padding","margin","blockGap"].forEach(i=>{o.includes(i)||(s.spacing={...s.spacing,[i]:!1});const c=Array.isArray(r?.spacing?.[i])?r?.spacing?.[i]:r?.spacing?.[i]?.sides;c?.length&&s.spacing?.[i]&&(s.spacing={...s.spacing,[i]:{...s.spacing?.[i],sides:c}})}),["aspectRatio","minHeight"].forEach(i=>{o.includes(i)||(s.dimensions={...s.dimensions,[i]:!1})}),["radius","color","style","width"].forEach(i=>{o.includes("border"+i.charAt(0).toUpperCase()+i.slice(1))||(s.border={...s.border,[i]:!1})}),["backgroundImage","backgroundSize"].forEach(i=>{o.includes(i)||(s.background={...s.background,[i]:!1})}),s.shadow=o.includes("shadow")?s.shadow:!1,n&&(s.typography.textAlign=!1),s},[e,o,r,n])}function pp(e){const t=e?.color?.palette?.custom,n=e?.color?.palette?.theme,o=e?.color?.palette?.default,r=e?.color?.defaultPalette;return x.useMemo(()=>{const s=[];return n&&n.length&&s.push({name:We("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&s.push({name:We("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&s.push({name:We("Custom","Indicates this palette is created by the user."),colors:t}),s},[t,n,o,r])}function $_(e){const t=e?.color?.gradients?.custom,n=e?.color?.gradients?.theme,o=e?.color?.gradients?.default,r=e?.color?.defaultGradients;return x.useMemo(()=>{const s=[];return n&&n.length&&s.push({name:We("Theme","Indicates this palette comes from the theme."),gradients:n}),r&&o&&o.length&&s.push({name:We("Default","Indicates this palette comes from WordPress."),gradients:o}),t&&t.length&&s.push({name:We("Custom","Indicates this palette is created by the user."),gradients:t}),s},[t,n,o,r])}function pd(e,t="root",n={}){if(!t)return null;const{fallback:o=!1}=n,{name:r,selectors:s,supports:i}=e,c=s&&Object.keys(s).length>0,l=Array.isArray(t)?t.join("."):t;let u=null;if(c&&s.root?u=s?.root:i?.__experimentalSelector?u=i.__experimentalSelector:u=".wp-block-"+r.replace("core/","").replace("/","-"),l==="root")return u;const d=Array.isArray(t)?t:t.split(".");if(d.length===1){const f=o?u:null;if(c)return fo(s,`${l}.root`,null)||fo(s,l,null)||f;const b=fo(i,`${l}.__experimentalSelector`,null);return b?Ws(u,b):f}let p;return c&&(p=fo(s,l,null)),p||(o?pd(e,d[0],n):null)}function oRt(e=[]){const t={r:[],g:[],b:[],a:[]};return e.forEach(n=>{const o=an(n).toRgb();t.r.push(o.r/255),t.g.push(o.g/255),t.b.push(o.b/255),t.a.push(o.a)}),t}function rRt(e){return`${e}{filter:none}`}function sRt(e,t){return`${e}{filter:url(#${t})}`}function nI(e,t){const n=oRt(t);return` + `}]})}):a.jsx("div",{className:"block-editor-inserter__preview-content-missing",children:m("No preview available.")})}),!l&&a.jsx(hme,{title:o,icon:r,description:s})]})}function _kt(e,t){const[n,o]=x.useState(!1);return x.useEffect(()=>{n&&Yt(m("Use left and right arrow keys to move through blocks"))},[n]),a.jsx("div",{ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{o(!0)},onBlur:r=>{!r.currentTarget.contains(r.relatedTarget)&&o(!1)},...e})}const kkt=x.forwardRef(_kt);function Skt(e,t){return a.jsx(C1.Group,{role:"presentation",ref:t,...e})}const Ckt=x.forwardRef(Skt);function qkt({isFirst:e,as:t,children:n,...o},r){return a.jsx(C1.Item,{ref:r,role:"option",accessibleWhenDisabled:!0,...o,render:s=>{const i={...s,tabIndex:e?0:s.tabIndex};return t?a.jsx(t,{...i,children:n}):typeof n=="function"?n(i):a.jsx(Ce,{__next40pxDefaultSize:!0,...i,children:n})}})}const Rkt=x.forwardRef(qkt);function $7({children:e}){return a.jsx(C1,{focusShift:!0,focusWrap:"horizontal",render:a.jsx(a.Fragment,{}),children:e})}const V7=({isEnabled:e,blocks:t,icon:n,children:o,pattern:r})=>{const s=G(d=>{const{getBlockType:p}=d(kt);return t.length===1&&p(t[0].name)?.icon},[t]),{startDragging:i,stopDragging:c}=ct(Oe(J)),l=x.useMemo(()=>r?.type===g1.user&&r?.syncStatus!=="unsynced"?[Ee("core/block",{ref:r.id})]:void 0,[r?.type,r?.syncStatus,r?.id]);if(!e)return o({draggable:!1,onDragStart:void 0,onDragEnd:void 0});const u=l??t;return a.jsx(Hbe,{__experimentalTransferDataType:"wp-blocks",transferData:{type:"inserter",blocks:u},onDragStart:d=>{i();for(const p of u){const f=`wp-block:${p.name}`;d.dataTransfer.items.add("",f)}},onDragEnd:()=>{c()},__experimentalDragComponent:a.jsx(k7,{count:t.length,icon:n||!r&&s,isPattern:!!r}),children:({onDraggableStart:d,onDraggableEnd:p})=>o({draggable:!0,onDragStart:d,onDragEnd:p})})};function Tkt({className:e,isFirst:t,item:n,onSelect:o,onHover:r,isDraggable:s,...i}){const c=x.useRef(!1),l=n.icon?{backgroundColor:n.icon.background,color:n.icon.foreground}:{},u=x.useMemo(()=>[Ee(n.name,n.initialAttributes,Ad(n.innerBlocks))],[n.name,n.initialAttributes,n.innerBlocks]),d=Qd(n)&&n.syncStatus!=="unsynced"||Hh(n);return a.jsx(V7,{isEnabled:s&&!n.isDisabled,blocks:u,icon:n.icon,children:({draggable:p,onDragStart:f,onDragEnd:b})=>a.jsx("div",{className:oe("block-editor-block-types-list__list-item",{"is-synced":d}),draggable:p,onDragStart:h=>{c.current=!0,f&&(r(null),f(h))},onDragEnd:h=>{c.current=!1,b&&b(h)},children:a.jsxs(Rkt,{isFirst:t,className:oe("block-editor-block-types-list__item",e),disabled:n.isDisabled,onClick:h=>{h.preventDefault(),o(n,da()?h.metaKey:h.ctrlKey),r(null)},onKeyDown:h=>{const{keyCode:g}=h;g===Gr&&(h.preventDefault(),o(n,da()?h.metaKey:h.ctrlKey),r(null))},onMouseEnter:()=>{c.current||r(n)},onMouseLeave:()=>r(null),...i,children:[a.jsx("span",{className:"block-editor-block-types-list__item-icon",style:l,children:a.jsx(Zn,{icon:n.icon,showColors:!0})}),a.jsx("span",{className:"block-editor-block-types-list__item-title",children:a.jsx(zs,{numberOfLines:3,children:n.title})})]})})})}const Ekt=x.memo(Tkt);function Wkt(e,t){const n=[];for(let o=0,r=e.length;o{},children:o,label:r,isDraggable:s=!0}){const i="block-editor-block-types-list",c=vt(O2,i);return a.jsxs(kkt,{className:i,"aria-label":r,children:[Wkt(e,3).map((l,u)=>a.jsx(Ckt,{children:l.map((d,p)=>a.jsx(Ekt,{item:d,className:jB(d.id),onSelect:t,onHover:n,isDraggable:s&&!d.isDisabled,isFirst:u===0&&p===0,rowId:`${c}-${u}`},d.id))},u)),o]})}function y2({title:e,icon:t,children:n}){return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"block-editor-inserter__panel-header",children:[a.jsx("h2",{className:"block-editor-inserter__panel-title",children:e}),a.jsx(qo,{icon:t})]}),a.jsx("div",{className:"block-editor-inserter__panel-content",children:n})]})}function kh(){return a.jsxs("div",{className:"block-editor-inserter__no-results",children:[a.jsx(wn,{className:"block-editor-inserter__no-results-icon",icon:Cw}),a.jsx("p",{children:m("No results found.")})]})}const Nkt=e=>e.name.split("/")[0],Bkt=6,Lkt=[];function gee({items:e,collections:t,categories:n,onSelectItem:o,onHover:r,showMostUsedBlocks:s,className:i}){const c=x.useMemo(()=>hO(e,"frecency","desc").slice(0,Bkt),[e]),l=x.useMemo(()=>e.filter(h=>!h.category),[e]),u=x.useMemo(()=>{const h={...t};return Object.keys(t).forEach(g=>{h[g]=e.filter(z=>Nkt(z)===g),h[g].length===0&&delete h[g]}),h},[e,t]);x.useEffect(()=>()=>r(null),[]);const d=q4(n),p=n.length===d.length,f=x.useMemo(()=>Object.entries(t),[t]),b=q4(p?f:Lkt);return a.jsxs("div",{className:i,children:[s&&e.length>3&&!!c.length&&a.jsx(y2,{title:We("Most used","blocks"),children:a.jsx(O2,{items:c,onSelect:o,onHover:r,label:We("Most used","blocks")})}),d.map(h=>{const g=e.filter(z=>z.category===h.slug);return!g||!g.length?null:a.jsx(y2,{title:h.title,icon:h.icon,children:a.jsx(O2,{items:g,onSelect:o,onHover:r,label:h.title})},h.slug)}),p&&l.length>0&&a.jsx(y2,{className:"block-editor-inserter__uncategorized-blocks-panel",title:m("Uncategorized"),children:a.jsx(O2,{items:l,onSelect:o,onHover:r,label:m("Uncategorized")})}),b.map(([h,g])=>{const z=u[h];return!z||!z.length?null:a.jsx(y2,{title:g.title,icon:g.icon,children:a.jsx(O2,{items:z,onSelect:o,onHover:r,label:g.title})},h)})]})}function Pkt({rootClientId:e,onInsert:t,onHover:n,showMostUsedBlocks:o},r){const[s,i,c,l]=h_(e,t);if(!s.length)return a.jsx(kh,{});const u=[],d=[];for(const p of s)p.category!=="reusable"&&(p.isAllowedInCurrentRoot?u.push(p):d.push(p));return a.jsx($7,{children:a.jsxs("div",{ref:r,children:[!!u.length&&a.jsx(a.Fragment,{children:a.jsx(gee,{items:u,categories:i,collections:c,onSelectItem:l,onHover:n,showMostUsedBlocks:o,className:"block-editor-inserter__insertable-blocks-at-selection"})}),a.jsx(gee,{items:d,categories:i,collections:c,onSelectItem:l,onHover:n,showMostUsedBlocks:o,className:"block-editor-inserter__all-blocks"})]})})}const jkt=x.forwardRef(Pkt);function Ikt({selectedCategory:e,patternCategories:t,onClickCategory:n}){const o="block-editor-block-patterns-explorer__sidebar";return a.jsx("div",{className:`${o}__categories-list`,children:t.map(({name:r,label:s})=>a.jsx(Ce,{__next40pxDefaultSize:!0,label:s,className:`${o}__categories-list__item`,isPressed:e===r,onClick:()=>{n(r)},children:s},r))})}function Dkt({searchValue:e,setSearchValue:t}){return a.jsx("div",{className:"block-editor-block-patterns-explorer__search",children:a.jsx(su,{__nextHasNoMarginBottom:!0,onChange:t,value:e,label:m("Search"),placeholder:m("Search")})})}function Fkt({selectedCategory:e,patternCategories:t,onClickCategory:n,searchValue:o,setSearchValue:r}){return a.jsxs("div",{className:"block-editor-block-patterns-explorer__sidebar",children:[a.jsx(Dkt,{searchValue:o,setSearchValue:r}),!o&&a.jsx(Ikt,{selectedCategory:e,patternCategories:t,onClickCategory:n})]})}function cge({currentPage:e,numPages:t,changePage:n,totalItems:o}){return a.jsxs(dt,{className:"block-editor-patterns__grid-pagination-wrapper",children:[a.jsx(Sn,{variant:"muted",children:xe(Dn("%s item","%s items",o),o)}),t>1&&a.jsxs(Ot,{expanded:!1,spacing:3,justify:"flex-start",className:"block-editor-patterns__grid-pagination",children:[a.jsxs(Ot,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-previous",children:[a.jsx(Ce,{variant:"tertiary",onClick:()=>n(1),disabled:e===1,"aria-label":m("First page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:a.jsx("span",{children:"«"})}),a.jsx(Ce,{variant:"tertiary",onClick:()=>n(e-1),disabled:e===1,"aria-label":m("Previous page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:a.jsx("span",{children:"‹"})})]}),a.jsx(Sn,{variant:"muted",children:xe(We("%1$s of %2$s","paging"),e,t)}),a.jsxs(Ot,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-next",children:[a.jsx(Ce,{variant:"tertiary",onClick:()=>n(e+1),disabled:e===t,"aria-label":m("Next page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:a.jsx("span",{children:"›"})}),a.jsx(Ce,{variant:"tertiary",onClick:()=>n(t),disabled:e===t,"aria-label":m("Last page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:a.jsx("span",{children:"»"})})]})]})]})}const $kt=({showTooltip:e,title:t,children:n})=>e?a.jsx(B0,{text:t,children:n}):a.jsx(a.Fragment,{children:n});function lge({id:e,isDraggable:t,pattern:n,onClick:o,onHover:r,showTitlesAsTooltip:s,category:i,isSelected:c}){const[l,u]=x.useState(!1),{blocks:d,viewportWidth:p}=n,b=`block-editor-block-patterns-list__item-description-${vt(lge)}`,h=n.type===g1.user,g=x.useMemo(()=>!i||!t?d:(d??[]).map(z=>{const A=jo(z);return A.attributes.metadata?.categories?.includes(i)&&(A.attributes.metadata.categories=[i]),A}),[d,t,i]);return a.jsx(V7,{isEnabled:t,blocks:g,pattern:n,children:({draggable:z,onDragStart:A,onDragEnd:_})=>a.jsx("div",{className:"block-editor-block-patterns-list__list-item",draggable:z,onDragStart:v=>{u(!0),A&&(r?.(null),A(v))},onDragEnd:v=>{u(!1),_&&_(v)},children:a.jsx($kt,{showTooltip:s&&!h,title:n.title,children:a.jsxs(C1.Item,{render:a.jsx("div",{role:"option","aria-label":n.title,"aria-describedby":n.description?b:void 0,className:oe("block-editor-block-patterns-list__item",{"block-editor-block-patterns-list__list-item-synced":n.type===g1.user&&!n.syncStatus,"is-selected":c})}),id:e,onClick:()=>{o(n,d),r?.(null)},onMouseEnter:()=>{l||r?.(n)},onMouseLeave:()=>r?.(null),children:[a.jsx(Vd.Async,{placeholder:a.jsx(Vkt,{}),children:a.jsx(Vd,{blocks:d,viewportWidth:p})}),(!s||h)&&a.jsxs(Ot,{className:"block-editor-patterns__pattern-details",spacing:2,children:[h&&!n.syncStatus&&a.jsx("div",{className:"block-editor-patterns__pattern-icon-wrapper",children:a.jsx(wn,{className:"block-editor-patterns__pattern-icon",icon:Bd})}),a.jsx("div",{className:"block-editor-block-patterns-list__item-title",children:n.title})]}),!!n.description&&a.jsx(qn,{id:b,children:n.description})]})})})})}function Vkt(){return a.jsx("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}function Hkt({isDraggable:e,blockPatterns:t,onHover:n,onClickPattern:o,orientation:r,label:s=m("Block patterns"),category:i,showTitlesAsTooltip:c,pagingProps:l},u){const[d,p]=x.useState(void 0),[f,b]=x.useState(null);x.useEffect(()=>{const g=t[0]?.name;p(g)},[t]);const h=(g,z)=>{b(g.name),o(g,z)};return a.jsxs(C1,{orientation:r,activeId:d,setActiveId:p,role:"listbox",className:"block-editor-block-patterns-list","aria-label":s,ref:u,children:[t.map(g=>a.jsx(lge,{id:g.name,pattern:g,onClick:h,onHover:n,isDraggable:e,showTitlesAsTooltip:c,category:i,isSelected:!!f&&f===g.name},g.name)),l&&a.jsx(cge,{...l})]})}const qa=x.forwardRef(Hkt);function Mee({destinationRootClientId:e,destinationIndex:t,rootClientId:n,registry:o}){if(n===e)return t;const r=["",...o.select(J).getBlockParents(e),e],s=r.indexOf(n);return s!==-1?o.select(J).getBlockIndex(r[s+1])+1:o.select(J).getBlockOrder(n).length}function E_({rootClientId:e="",insertionIndex:t,clientId:n,isAppender:o,onSelect:r,shouldFocusBlock:s=!0,selectBlockOnInsert:i=!0}){const c=Fn(),{getSelectedBlock:l,getClosestAllowedInsertionPoint:u,isBlockInsertionPointVisible:d}=ct(G(J)),{destinationRootClientId:p,destinationIndex:f}=G(M=>{const{getSelectedBlockClientId:y,getBlockRootClientId:k,getBlockIndex:S,getBlockOrder:C,getInsertionPoint:R}=ct(M(J)),T=y();let E=e,B;const N=R();return t!==void 0?B=t:N&&N.hasOwnProperty("index")?(E=N?.rootClientId?N.rootClientId:e,B=N.index):n?B=S(n):!o&&T?(E=k(T),B=S(T)+1):B=C(E).length,{destinationRootClientId:E,destinationIndex:B}},[e,t,n,o]),{replaceBlocks:b,insertBlocks:h,showInsertionPoint:g,hideInsertionPoint:z,setLastFocus:A}=ct(Oe(J)),_=x.useCallback((M,y,k=!1,S)=>{(k||s||i)&&A(null);const C=l();!o&&C&&El(C)?b(C.clientId,M,null,s||k?0:null,y):h(M,o||S===void 0?f:Mee({destinationRootClientId:p,destinationIndex:f,rootClientId:S,registry:c}),o||S===void 0?p:S,i,s||k?0:null,y);const R=Array.isArray(M)?M.length:1,T=xe(Dn("%d block added.","%d blocks added.",R),R);Yt(T),r&&r(M)},[o,l,b,h,p,f,r,s,i]),v=x.useCallback(M=>{if(M&&!d()){const y=u(M.name,p);y!==null&&g(y,Mee({destinationRootClientId:p,destinationIndex:f,rootClientId:y,registry:c}))}else z()},[u,d,g,z,p,f]);return[p,_,v]}const W_=(e,t,n,o)=>{const r=x.useMemo(()=>({[bO]:!!o}),[o]),{patternCategories:s,patterns:i,userPatternCategories:c}=G(f=>{const{getSettings:b,__experimentalGetAllowedPatterns:h}=ct(f(J)),{__experimentalUserPatternCategories:g,__experimentalBlockPatternCategories:z}=b();return{patterns:h(t,r),userPatternCategories:g,patternCategories:z}},[t,r]),{getClosestAllowedInsertionPointForPattern:l}=ct(G(J)),u=x.useMemo(()=>{const f=[...s];return c?.forEach(b=>{f.find(h=>h.name===b.name)||f.push(b)}),f},[s,c]),{createSuccessNotice:d}=Oe(mt),p=x.useCallback((f,b)=>{const h=l(f,t);if(h===null)return;const g=f.type===g1.user&&f.syncStatus!=="unsynced"?[Ee("core/block",{ref:f.id})]:b;e((g??[]).map(z=>{const A=jo(z);return A.attributes.metadata?.categories?.includes(n)&&(A.attributes.metadata.categories=[n]),A}),f.name,!1,h),d(xe(m('Block pattern "%s" inserted.'),f.title),{type:"snackbar",id:"inserter-notice"})},[d,e,n,t,l,o]);return[i,u,p]},rv=20;function uge(e,t,n,o=""){const[r,s]=x.useState(1),i=Fr(t),c=Fr(o);(i!==t||c!==o)&&r!==1&&s(1);const l=e.length,u=r-1,d=x.useMemo(()=>e.slice(u*rv,u*rv+rv),[u,e]),p=Math.ceil(e.length/rv),f=b=>{ps(n?.current)?.scrollTo(0,0),s(b)};return x.useEffect(function(){ps(n?.current)?.scrollTo(0,0)},[t,n]),{totalItems:l,categoryPatterns:d,numPages:p,changePage:f,currentPage:r}}function Ukt({filterValue:e,filteredBlockPatternsLength:t}){return e?a.jsx(_a,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count",children:xe(Dn("%d pattern found","%d patterns found",t),t)}):null}function Xkt({searchValue:e,selectedCategory:t,patternCategories:n,rootClientId:o}){const r=x.useRef(),s=q1(Yt,500),[i,c]=E_({rootClientId:o,shouldFocusBlock:!0}),[l,,u]=W_(c,i,t),d=x.useMemo(()=>n.map(z=>z.name),[n]),p=x.useMemo(()=>{const z=l.filter(A=>{if(t===qx.name||t===pO.name&&A.type===g1.user)return!0;if(t==="uncategorized"){var _;const v=(_=A.categories?.some(M=>d.includes(M)))!==null&&_!==void 0?_:!1;return!A.categories?.length||!v}return A.categories?.includes(t)});return e?l7(z,e):z},[e,l,t,d]);x.useEffect(()=>{if(!e)return;const z=p.length,A=xe(Dn("%d result found.","%d results found.",z),z);s(A)},[e,s,p.length]);const f=uge(p,t,r),[b,h]=x.useState(e);e!==b&&(h(e),f.changePage(1));const g=!!p?.length;return a.jsxs("div",{className:"block-editor-block-patterns-explorer__list",ref:r,children:[a.jsx(Ukt,{filterValue:e,filteredBlockPatternsLength:p.length}),a.jsx($7,{children:g&&a.jsxs(a.Fragment,{children:[a.jsx(qa,{blockPatterns:f.categoryPatterns,onClickPattern:u,isDraggable:!1}),a.jsx(cge,{...f})]})})]})}function Gkt(e,t){return!e.categories||!e.categories.length?!1:e.categories.some(n=>t.some(o=>o.name===n))}function H7(e,t="all"){const[n,o]=W_(void 0,e),r=x.useMemo(()=>t==="all"?n:n.filter(i=>!q2e(i,t)),[t,n]);return x.useMemo(()=>{const i=o.filter(c=>r.some(l=>l.categories?.includes(c.name))).sort((c,l)=>c.label.localeCompare(l.label));return r.some(c=>!Gkt(c,o))&&!i.find(c=>c.name==="uncategorized")&&i.push({name:"uncategorized",label:We("Uncategorized")}),r.some(c=>c.blockTypes?.includes("core/post-content"))&&i.unshift(C2e),r.some(c=>c.type===g1.user)&&i.unshift(pO),r.length>0&&i.unshift({name:qx.name,label:qx.label}),Yt(xe(Dn("%d category button displayed.","%d category buttons displayed.",i.length),i.length)),i},[o,r])}function Kkt({initialCategory:e,rootClientId:t}){const[n,o]=x.useState(""),[r,s]=x.useState(e),i=H7(t);return a.jsxs("div",{className:"block-editor-block-patterns-explorer",children:[a.jsx(Fkt,{selectedCategory:r,patternCategories:i,onClickCategory:s,searchValue:n,setSearchValue:o}),a.jsx(Xkt,{searchValue:n,selectedCategory:r,patternCategories:i,rootClientId:t})]})}function Ykt({onModalClose:e,...t}){return a.jsx(Zo,{title:m("Patterns"),onRequestClose:e,isFullScreen:!0,children:a.jsx(Kkt,{...t})})}function Zkt({title:e}){return a.jsx(dt,{spacing:0,children:a.jsx(mo,{children:a.jsx(t1,{marginBottom:0,paddingX:4,paddingY:3,children:a.jsxs(Ot,{spacing:2,children:[a.jsx(ic.BackButton,{style:{minWidth:24,padding:0},icon:jt()?ma:Ll,size:"small",label:m("Back")}),a.jsx(t1,{children:a.jsx(_a,{level:5,children:e})})]})})})})}function dge({categories:e,children:t}){return a.jsxs(ic,{initialPath:"/",className:"block-editor-inserter__mobile-tab-navigation",children:[a.jsx(ic.Screen,{path:"/",children:a.jsx(tb,{children:e.map(n=>a.jsx(ic.Button,{path:`/category/${n.name}`,as:oO,isAction:!0,children:a.jsxs(Ot,{children:[a.jsx(eu,{children:n.label}),a.jsx(wn,{icon:jt()?Ll:ma})]})},n.name))})}),e.map(n=>a.jsxs(ic.Screen,{path:`/category/${n.name}`,children:[a.jsx(Zkt,{title:m("Back")}),t(n)]},n.name))]})}const zee=e=>e!=="all"&&e!=="user",Qkt=e=>e?.name===pO.name,Jkt=[{value:"all",label:We("All","patterns")},{value:g1.directory,label:m("Pattern Directory")},{value:g1.theme,label:m("Theme & Plugins")},{value:g1.user,label:m("User")}];function e6t({setPatternSyncFilter:e,setPatternSourceFilter:t,patternSyncFilter:n,patternSourceFilter:o,scrollContainerRef:r,category:s}){const i=s?.name===pO.name?g1.user:o,c=zee(i),l=Qkt(s),u=x.useMemo(()=>[{value:"all",label:We("All","patterns")},{value:Cx.full,label:We("Synced","patterns"),disabled:c},{value:Cx.unsynced,label:We("Not synced","patterns"),disabled:c}],[c]);function d(p){t(p),zee(p)&&e("all")}return a.jsx(a.Fragment,{children:a.jsx(c0,{popoverProps:{placement:"right-end"},label:m("Filter patterns"),toggleProps:{size:"compact"},icon:a.jsx(wn,{icon:a.jsx(ge,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:a.jsx(he,{d:"M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z",fill:"currentColor"})})}),children:()=>a.jsxs(a.Fragment,{children:[!l&&a.jsx(Cn,{label:m("Source"),children:a.jsx(kf,{choices:Jkt,onSelect:p=>{d(p),r.current?.scrollTo(0,0)},value:i})}),a.jsx(Cn,{label:m("Type"),children:a.jsx(kf,{choices:u,onSelect:p=>{e(p),r.current?.scrollTo(0,0)},value:n})}),a.jsx("div",{className:"block-editor-inserter__patterns-filter-help",children:cr(m("Patterns are available from the WordPress.org Pattern Directory, bundled in the active theme, or created by users on this site. Only patterns created on this site can be synced."),{Link:a.jsx(hr,{href:m("https://wordpress.org/patterns/")})})})]})})})}const t6t=()=>{};function pge({rootClientId:e,onInsert:t,onHover:n=t6t,category:o,showTitlesAsTooltip:r}){const[s,,i]=W_(t,e,o?.name),[c,l]=x.useState("all"),[u,d]=x.useState("all"),p=H7(e,u),f=x.useRef(),b=x.useMemo(()=>s.filter(_=>q2e(_,u,c)?!1:o.name===qx?.name||o.name===pO?.name&&_.type===g1.user||o.name===C2e?.name&&_.blockTypes?.includes("core/post-content")?!0:o.name==="uncategorized"?_.categories?!_.categories.some(v=>p.some(M=>M.name===v)):!0:_.categories?.includes(o.name)),[s,p,o.name,u,c]),h=uge(b,o,f),{changePage:g}=h;x.useEffect(()=>()=>n(null),[]);const z=x.useCallback(_=>{l(_),g(1)},[l,g]),A=x.useCallback(_=>{d(_),g(1)},[d,g]);return a.jsxs(a.Fragment,{children:[a.jsxs(dt,{spacing:2,className:"block-editor-inserter__patterns-category-panel-header",children:[a.jsxs(Ot,{children:[a.jsx(eu,{children:a.jsx(_a,{className:"block-editor-inserter__patterns-category-panel-title",size:13,level:4,as:"div",children:o?.label})}),a.jsx(e6t,{patternSyncFilter:c,patternSourceFilter:u,setPatternSyncFilter:z,setPatternSourceFilter:A,scrollContainerRef:f,category:o})]}),!b.length&&a.jsx(Sn,{variant:"muted",className:"block-editor-inserter__patterns-category-no-results",children:m("No results found")})]}),b.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(Sn,{size:"12",as:"p",className:"block-editor-inserter__help-text",children:m("Drag and drop patterns into the canvas.")}),a.jsx(qa,{ref:f,blockPatterns:h.categoryPatterns,onClickPattern:i,onHover:n,label:o.label,orientation:"vertical",category:o.name,isDraggable:!0,showTitlesAsTooltip:r,patternFilter:u,pagingProps:h})]})]})}const{Tabs:sv}=ct(tr);function fge({categories:e,selectedCategory:t,onSelectCategory:n,children:o}){const i={type:"tween",duration:$1()?0:.25,ease:[.6,0,.4,1]},c=Fr(t),l=t?t.name:null,[u,d]=x.useState(),p=e?.[0]?.name;return l===null&&!u&&p&&d(p),a.jsxs(sv,{selectOnMove:!1,selectedTabId:l,orientation:"vertical",onSelect:f=>{n(e.find(b=>b.name===f))},activeTabId:u,onActiveTabIdChange:d,children:[a.jsx(sv.TabList,{className:"block-editor-inserter__category-tablist",children:e.map(f=>a.jsx(sv.Tab,{tabId:f.name,"aria-current":f.name===t?.name?"true":void 0,children:f.label},f.name))}),e.map(f=>a.jsx(sv.TabPanel,{tabId:f.name,focusable:!1,children:a.jsx(qr.div,{className:"block-editor-inserter__category-panel",initial:c?"open":"closed",animate:"open",variants:{open:{transform:"translateX( 0 )",transitionEnd:{zIndex:"1"}},closed:{transform:"translateX( -100% )",zIndex:"-1"}},transition:i,children:o})},f.name))]})}function n6t({onSelectCategory:e,selectedCategory:t,onInsert:n,rootClientId:o,children:r}){const[s,i]=x.useState(!1),c=H7(o),l=Yn("medium","<");return c.length?a.jsxs(a.Fragment,{children:[!l&&a.jsxs("div",{className:"block-editor-inserter__block-patterns-tabs-container",children:[a.jsx(fge,{categories:c,selectedCategory:t,onSelectCategory:e,children:r}),a.jsx(Ce,{__next40pxDefaultSize:!0,className:"block-editor-inserter__patterns-explore-button",onClick:()=>i(!0),variant:"secondary",children:m("Explore all patterns")})]}),l&&a.jsx(dge,{categories:c,children:u=>a.jsx("div",{className:"block-editor-inserter__category-panel",children:a.jsx(pge,{onInsert:n,rootClientId:o,category:u},u.name)})}),s&&a.jsx(Ykt,{initialCategory:t?.name||c[0]?.name,patternCategories:c,onModalClose:()=>i(!1),rootClientId:o})]}):a.jsx(kh,{})}const o6t={image:"img",video:"video",audio:"audio"};function bge(e,t){const n={id:e.id||void 0,caption:e.caption||void 0},o=e.url,r=e.alt||void 0;t==="image"?(n.url=o,n.alt=r):["video","audio"].includes(t)&&(n.src=o);const s=o6t[t],i=a.jsx(s,{src:e.previewUrl||o,alt:r,controls:t==="audio"?!0:void 0,inert:"true",onError:({currentTarget:c})=>{c.src===e.previewUrl&&(c.src=o)}});return[Ee(`core/${t}`,n),i]}const r6t=["image"],Oee=25,s6t={position:"bottom left",className:"block-editor-inserter__media-list__item-preview-options__popover"};function i6t({category:e,media:t}){if(!e.getReportUrl)return null;const n=e.getReportUrl(t);return a.jsx(c0,{className:"block-editor-inserter__media-list__item-preview-options",label:m("Options"),popoverProps:s6t,icon:Wc,children:()=>a.jsx(Cn,{children:a.jsx(Ct,{onClick:()=>window.open(n,"_blank").focus(),icon:vf,children:xe(m("Report %s"),e.mediaType)})})})}function a6t({onClose:e,onSubmit:t}){return a.jsxs(Zo,{title:m("Insert external image"),onRequestClose:e,className:"block-editor-inserter-media-tab-media-preview-inserter-external-image-modal",children:[a.jsxs(dt,{spacing:3,children:[a.jsx("p",{children:m("This image cannot be uploaded to your Media Library, but it can still be inserted as an external image.")}),a.jsx("p",{children:m("External images can be removed by the external provider without warning and could even have legal compliance issues related to privacy legislation.")})]}),a.jsxs(Yo,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1,children:[a.jsx(Tn,{children:a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:e,children:m("Cancel")})}),a.jsx(Tn,{children:a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"primary",onClick:t,children:m("Insert")})})]})]})}function c6t({media:e,onClick:t,category:n}){const[o,r]=x.useState(!1),[s,i]=x.useState(!1),[c,l]=x.useState(!1),[u,d]=x.useMemo(()=>bge(e,n.mediaType),[e,n.mediaType]),{createErrorNotice:p,createSuccessNotice:f}=Oe(mt),{getSettings:b,getBlock:h}=G(J),{updateBlockAttributes:g}=Oe(J),z=x.useCallback(y=>{if(c)return;const k=b(),S=jo(y),{id:C,url:R,caption:T}=S.attributes;if(!C&&!k.mediaUpload){r(!0);return}if(C){t(S);return}l(!0),window.fetch(R).then(E=>E.blob()).then(E=>{const B=Ff(R)||"image.jpg",N=new File([E],B,{type:E.type});k.mediaUpload({filesList:[N],additionalData:{caption:T},onFileChange([j]){Wr(j.url)||(h(S.clientId)?g(S.clientId,{...S.attributes,id:j.id,url:j.url}):(t({...S,attributes:{...S.attributes,id:j.id,url:j.url}}),f(m("Image uploaded and inserted."),{type:"snackbar",id:"inserter-notice"})),l(!1))},allowedTypes:r6t,onError(j){p(j,{type:"snackbar",id:"inserter-notice"}),l(!1)}})}).catch(()=>{r(!0),l(!1)})},[c,b,t,f,g,p,h]),A=typeof e.title=="string"?e.title:e.title?.rendered||m("no title");let _;if(A.length>Oee){const y="...";_=A.slice(0,Oee-y.length)+y}const v=x.useCallback(()=>i(!0),[]),M=x.useCallback(()=>i(!1),[]);return a.jsxs(a.Fragment,{children:[a.jsx(V7,{isEnabled:!0,blocks:[u],children:({draggable:y,onDragStart:k,onDragEnd:S})=>a.jsx("div",{className:oe("block-editor-inserter__media-list__list-item",{"is-hovered":s}),draggable:y,onDragStart:k,onDragEnd:S,children:a.jsxs("div",{onMouseEnter:v,onMouseLeave:M,children:[a.jsx(B0,{text:_||A,children:a.jsx(C1.Item,{render:a.jsx("div",{"aria-label":A,role:"option",className:"block-editor-inserter__media-list__item"}),onClick:()=>z(u),children:a.jsxs("div",{className:"block-editor-inserter__media-list__item-preview",children:[d,c&&a.jsx("div",{className:"block-editor-inserter__media-list__item-preview-spinner",children:a.jsx(Xn,{})})]})})}),!c&&a.jsx(i6t,{category:n,media:e})]})})}),o&&a.jsx(a6t,{onClose:()=>r(!1),onSubmit:()=>{t(jo(u)),f(m("Image inserted."),{type:"snackbar",id:"inserter-notice"}),r(!1)}})]})}function l6t({mediaList:e,category:t,onClick:n,label:o=m("Media List")}){return a.jsx(C1,{role:"listbox",className:"block-editor-inserter__media-list","aria-label":o,children:e.map((r,s)=>a.jsx(c6t,{media:r,category:t,onClick:n},r.id||r.sourceId||s))})}function u6t(e,t={}){const[n,o]=x.useState(),[r,s]=x.useState(!1),i=x.useRef();return x.useEffect(()=>{(async()=>{const c=JSON.stringify({category:e.name,...t});i.current=c,s(!0),o([]);const l=await e.fetch?.(t);c===i.current&&(o(l),s(!1))})()},[e.name,...Object.values(t)]),{mediaList:n,isLoading:r}}function d6t(e){const[t,n]=x.useState([]),o=G(c=>ct(c(J)).getInserterMediaCategories(),[]),{canInsertImage:r,canInsertVideo:s,canInsertAudio:i}=G(c=>{const{canInsertBlockType:l}=c(J);return{canInsertImage:l("core/image",e),canInsertVideo:l("core/video",e),canInsertAudio:l("core/audio",e)}},[e]);return x.useEffect(()=>{(async()=>{const c=[];if(!o)return;const l=new Map(await Promise.all(o.map(async d=>{if(d.isExternalResource)return[d.name,!0];let p=[];try{p=await d.fetch({per_page:1})}catch{}return[d.name,!!p.length]}))),u={image:r,video:s,audio:i};o.forEach(d=>{u[d.mediaType]&&l.get(d.name)&&c.push(d)}),c.length&&n(c)})()},[r,s,i,o]),t}const p6t=10;function hge({rootClientId:e,onInsert:t,category:n}){const[o,r,s]=M0e(),{mediaList:i,isLoading:c}=u6t(n,{per_page:s?20:p6t,search:s}),l="block-editor-inserter__media-panel",u=n.labels.search_items||m("Search");return a.jsxs("div",{className:l,children:[a.jsx(su,{__nextHasNoMarginBottom:!0,className:`${l}-search`,onChange:r,value:o,label:u,placeholder:u}),c&&a.jsx("div",{className:`${l}-spinner`,children:a.jsx(Xn,{})}),!c&&!i?.length&&a.jsx(kh,{}),!c&&!!i?.length&&a.jsx(l6t,{rootClientId:e,onClick:t,mediaList:i,category:n})]})}function Hd({fallback:e=null,children:t}){return G(o=>{const{getSettings:r}=o(J);return!!r().mediaUpload},[])?t:e}const f6t=()=>null,ab=ap("editor.MediaUpload")(f6t),b6t=["image","video","audio"];function h6t({rootClientId:e,selectedCategory:t,onSelectCategory:n,onInsert:o,children:r}){const s=d6t(e),i=Yn("medium","<"),c="block-editor-inserter__media-tabs",l=x.useCallback(d=>{if(!d?.url)return;const[p]=bge(d,d.type);o(p)},[o]),u=x.useMemo(()=>s.map(d=>({...d,label:d.labels.name})),[s]);return u.length?a.jsxs(a.Fragment,{children:[!i&&a.jsxs("div",{className:`${c}-container`,children:[a.jsx(fge,{categories:u,selectedCategory:t,onSelectCategory:n,children:r}),a.jsx(Hd,{children:a.jsx(ab,{multiple:!1,onSelect:l,allowedTypes:b6t,render:({open:d})=>a.jsx(Ce,{__next40pxDefaultSize:!0,onClick:p=>{p.target.focus(),d()},className:"block-editor-inserter__media-library-button",variant:"secondary","data-unstable-ignore-focus-outside-for-relatedtarget":".media-modal",children:m("Open Media Library")})})})]}),i&&a.jsx(dge,{categories:u,children:d=>a.jsx(hge,{onInsert:o,rootClientId:e,category:d})})]}):a.jsx(kh,{})}const{Fill:mge,Slot:m6t}=Qn("__unstableInserterMenuExtension");mge.Slot=m6t;const g6t=9,M6t=[];function gge({filterValue:e,onSelect:t,onHover:n,onHoverPattern:o,rootClientId:r,clientId:s,isAppender:i,__experimentalInsertionIndex:c,maxBlockPatterns:l,maxBlockTypes:u,showBlockDirectory:d=!1,isDraggable:p=!0,shouldFocusBlock:f=!0,prioritizePatterns:b,selectBlockOnInsert:h,isQuick:g}){const z=q1(Yt,500),{prioritizedBlocks:A}=G($=>({prioritizedBlocks:$(J).getBlockListSettings(r)?.prioritizedInserterBlocks||M6t}),[r]),[_,v]=E_({onSelect:t,rootClientId:r,clientId:s,isAppender:i,insertionIndex:c,shouldFocusBlock:f,selectBlockOnInsert:h}),[M,y,k,S]=h_(_,v,g),[C,,R]=W_(v,_),T=x.useMemo(()=>{if(l===0)return[];const $=l7(C,e);return l!==void 0?$.slice(0,l):$},[e,C,l]);let E=u;b&&T.length>2&&(E=0);const B=x.useMemo(()=>{if(E===0)return[];const $=M.filter(Z=>Z.name!=="core/block");let F=hO($,"frecency","desc");!e&&A.length&&(F=Ahe(F,A));const X=yhe(F,y,k,e);return E!==void 0?X.slice(0,E):X},[e,M,y,k,E,A]);x.useEffect(()=>{if(!e)return;const $=B.length+T.length,F=xe(Dn("%d result found.","%d results found.",$),$);z(F)},[e,z,B,T]);const N=q4(B,{step:g6t}),j=B.length>0||T.length>0,I=!!B.length&&a.jsx(y2,{title:a.jsx(qn,{children:m("Blocks")}),children:a.jsx(O2,{items:N,onSelect:S,onHover:n,label:m("Blocks"),isDraggable:p})}),P=!!T.length&&a.jsx(y2,{title:a.jsx(qn,{children:m("Block patterns")}),children:a.jsx("div",{className:"block-editor-inserter__quick-inserter-patterns",children:a.jsx(qa,{blockPatterns:T,onClickPattern:R,onHover:o,isDraggable:p})})});return a.jsxs($7,{children:[!d&&!j&&a.jsx(kh,{}),b?P:I,!!B.length&&!!T.length&&a.jsx("div",{className:"block-editor-inserter__quick-inserter-separator"}),b?I:P,d&&a.jsx(mge.Slot,{fillProps:{onSelect:S,onHover:n,filterValue:e,hasItems:j,rootClientId:_},children:$=>$.length?$:j?null:a.jsx(kh,{})})]})}const{Tabs:iv}=ct(tr);function z6t({defaultTabId:e,onClose:t,onSelect:n,selectedTab:o,tabs:r,closeButtonLabel:s},i){return a.jsx("div",{className:"block-editor-tabbed-sidebar",children:a.jsxs(iv,{selectOnMove:!1,defaultTabId:e,onSelect:n,selectedTabId:o,children:[a.jsxs("div",{className:"block-editor-tabbed-sidebar__tablist-and-close-button",children:[a.jsx(Ce,{className:"block-editor-tabbed-sidebar__close-button",icon:rp,label:s,onClick:()=>t(),size:"compact"}),a.jsx(iv.TabList,{className:"block-editor-tabbed-sidebar__tablist",ref:i,children:r.map(c=>a.jsx(iv.Tab,{tabId:c.name,className:"block-editor-tabbed-sidebar__tab",children:c.title},c.name))})]}),r.map(c=>a.jsx(iv.TabPanel,{tabId:c.name,focusable:!1,className:"block-editor-tabbed-sidebar__tabpanel",ref:c.panelRef,children:c.panel},c.name))]})})}const Mge=x.forwardRef(z6t);function zge(e=!0){const{postId:t}=x.useContext(Cf),{setZoomLevel:n,resetZoomLevel:o}=ct(Oe(J)),{isZoomedOut:r,isZoomOut:s}=G(u=>{const{isZoomOut:d}=ct(u(J));return{isZoomedOut:d(),isZoomOut:d}},[]),i=x.useRef(!1),c=x.useRef(e),l=x.useRef(t);x.useEffect(()=>{r!==c.current&&(i.current=!1)},[r]),x.useEffect(()=>(c.current=e,l.current!==t&&(i.current=!0),e!==s()&&(i.current=!0,e?n("auto-scaled"):o()),()=>{i.current&&s()&&o()}),[e,s,t,o,n])}const O6t=()=>{};function y6t({rootClientId:e,clientId:t,isAppender:n,__experimentalInsertionIndex:o,onSelect:r,showInserterHelpPanel:s,showMostUsedBlocks:i,__experimentalFilterValue:c="",shouldFocusBlock:l=!0,onPatternCategorySelection:u,onClose:d,__experimentalInitialTab:p,__experimentalInitialCategory:f},b){const h=G(je=>ct(je(J)).isZoomOut(),[]),g=G(je=>!!ct(je(J)).getSectionRootClientId(),[]),[z,A,_]=M0e(c),[v,M]=x.useState(null),[y,k]=x.useState(f),[S,C]=x.useState("all"),[R,T]=x.useState(null),E=Yn("large");function B(){return p||(h?"patterns":"blocks")}const[N,j]=x.useState(B());zge(g&&(N==="patterns"||N==="media")&&E);const[P,$,F]=E_({rootClientId:e,clientId:t,isAppender:n,insertionIndex:o,shouldFocusBlock:l}),X=x.useRef(),Z=x.useCallback((je,ie,we,re)=>{$(je,ie,we,re),r(je),window.requestAnimationFrame(()=>{!l&&!X.current?.contains(b.current.ownerDocument.activeElement)&&X.current?.querySelector("button").focus()})},[$,r,l]),V=x.useCallback((je,ie,...we)=>{F(!1),$(je,{patternName:ie},...we),r()},[$,r]),Q=x.useCallback(je=>{F(je),M(je)},[F,M]),te=x.useCallback((je,ie)=>{k(je),C(ie),u?.()},[k,u]),ee=N==="patterns"&&!_&&!!y,ue=N==="media"&&!!R,ce=x.useMemo(()=>N==="media"?null:a.jsxs(a.Fragment,{children:[a.jsx(su,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",onChange:je=>{v&&M(null),A(je)},value:z,label:m("Search"),placeholder:m("Search")}),!!_&&a.jsx(gge,{filterValue:_,onSelect:r,onHover:Q,rootClientId:e,clientId:t,isAppender:n,__experimentalInsertionIndex:o,showBlockDirectory:!0,shouldFocusBlock:l,prioritizePatterns:N==="patterns"})]}),[N,v,M,A,z,_,r,Q,l,t,e,o,n]),me=x.useMemo(()=>a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"block-editor-inserter__block-list",children:a.jsx(jkt,{ref:X,rootClientId:P,onInsert:Z,onHover:Q,showMostUsedBlocks:i})}),s&&a.jsxs("div",{className:"block-editor-inserter__tips",children:[a.jsx(qn,{as:"h2",children:m("A tip for using the block editor")}),a.jsx(Wxt,{})]})]}),[P,Z,Q,i,s]),de=x.useMemo(()=>a.jsx(n6t,{rootClientId:P,onInsert:V,onSelectCategory:te,selectedCategory:y,children:ee&&a.jsx(pge,{rootClientId:P,onInsert:V,category:y,patternFilter:S,showTitlesAsTooltip:!0})}),[P,V,te,S,y,ee]),Ae=x.useMemo(()=>a.jsx(h6t,{rootClientId:P,selectedCategory:R,onSelectCategory:T,onInsert:Z,children:ue&&a.jsx(hge,{rootClientId:P,onInsert:Z,category:R})}),[P,Z,R,T,ue]),ye=je=>{je!=="patterns"&&k(null),j(je)},Ne=x.useRef();return x.useLayoutEffect(()=>{Ne.current&&window.requestAnimationFrame(()=>{Ne.current.querySelector('[role="tab"][aria-selected="true"]')?.focus()})},[]),a.jsxs("div",{className:oe("block-editor-inserter__menu",{"show-panel":ee||ue,"is-zoom-out":h}),ref:b,children:[a.jsx("div",{className:"block-editor-inserter__main-area",children:a.jsx(Mge,{ref:Ne,onSelect:ye,onClose:d,selectedTab:N,closeButtonLabel:m("Close Block Inserter"),tabs:[{name:"blocks",title:m("Blocks"),panel:a.jsxs(a.Fragment,{children:[ce,N==="blocks"&&!_&&me]})},{name:"patterns",title:m("Patterns"),panel:a.jsxs(a.Fragment,{children:[ce,N==="patterns"&&!_&&de]})},{name:"media",title:m("Media"),panel:a.jsxs(a.Fragment,{children:[ce,Ae]})}]})}),s&&v&&a.jsx(Io,{className:"block-editor-inserter__preview-container__popover",placement:"right-start",offset:16,focusOnMount:!1,animate:!1,children:a.jsx(age,{item:v})})]})}const Oge=x.forwardRef(y6t);function A6t(e,t){return a.jsx(Oge,{...e,onPatternCategorySelection:O6t,ref:t})}const v6t=x.forwardRef(A6t),x6t=6,w6t=6;function yge({onSelect:e,rootClientId:t,clientId:n,isAppender:o,selectBlockOnInsert:r,hasSearch:s=!0}){const[i,c]=x.useState(""),[l,u]=E_({onSelect:e,rootClientId:t,clientId:n,isAppender:o,selectBlockOnInsert:r}),[d]=h_(l,u,!0),{setInserterIsOpened:p,insertionIndex:f}=G(g=>{const{getSettings:z,getBlockIndex:A,getBlockCount:_}=g(J),v=z(),M=A(n),y=_();return{setInserterIsOpened:v.__experimentalSetIsInserterOpened,insertionIndex:M===-1?y:M}},[n]),b=s&&d.length>x6t;x.useEffect(()=>{p&&p(!1)},[p]);const h=()=>{p({filterValue:i,onSelect:e,rootClientId:t,insertionIndex:f})};return a.jsxs("div",{className:oe("block-editor-inserter__quick-inserter",{"has-search":b,"has-expand":p}),children:[b&&a.jsx(su,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",value:i,onChange:g=>{c(g)},label:m("Search"),placeholder:m("Search")}),a.jsx("div",{className:"block-editor-inserter__quick-inserter-results",children:a.jsx(gge,{filterValue:i,onSelect:e,rootClientId:t,clientId:n,isAppender:o,maxBlockPatterns:0,maxBlockTypes:w6t,isDraggable:!1,selectBlockOnInsert:r,isQuick:!0})}),p&&a.jsx(Ce,{__next40pxDefaultSize:!0,className:"block-editor-inserter__quick-inserter-expand",onClick:h,"aria-label":m("Browse all. This will open the main inserter panel in the editor toolbar."),children:m("Browse all")})]})}const _6t=({onToggle:e,disabled:t,isOpen:n,blockTitle:o,hasSingleBlockType:r,toggleProps:s={}})=>{const{as:i=Ce,label:c,onClick:l,...u}=s;let d=c;!d&&r?d=xe(We("Add %s","directly add the only allowed block"),o):d||(d=We("Add block","Generic label for block inserter button"));function p(f){e&&e(f),l&&l(f)}return a.jsx(i,{__next40pxDefaultSize:s.as?void 0:!0,icon:Fs,label:d,tooltipPosition:"bottom",onClick:p,className:"block-editor-inserter__toggle","aria-haspopup":r?!1:"true","aria-expanded":r?!1:n,disabled:t,...u})};class k6t extends x.Component{constructor(){super(...arguments),this.onToggle=this.onToggle.bind(this),this.renderToggle=this.renderToggle.bind(this),this.renderContent=this.renderContent.bind(this)}onToggle(t){const{onToggle:n}=this.props;n&&n(t)}renderToggle({onToggle:t,isOpen:n}){const{disabled:o,blockTitle:r,hasSingleBlockType:s,directInsertBlock:i,toggleProps:c,hasItems:l,renderToggle:u=_6t}=this.props;return u({onToggle:t,isOpen:n,disabled:o||!l,blockTitle:r,hasSingleBlockType:s,directInsertBlock:i,toggleProps:c})}renderContent({onClose:t}){const{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:s,__experimentalIsQuick:i,onSelectOrClose:c,selectBlockOnInsert:l}=this.props;return i?a.jsx(yge,{onSelect:u=>{const d=Array.isArray(u)&&u?.length?u[0]:u;c&&typeof c=="function"&&c(d),t()},rootClientId:n,clientId:o,isAppender:r,selectBlockOnInsert:l}):a.jsx(v6t,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:s})}render(){const{position:t,hasSingleBlockType:n,directInsertBlock:o,insertOnlyAllowedBlock:r,__experimentalIsQuick:s,onSelectOrClose:i}=this.props;return n||o?this.renderToggle({onToggle:r}):a.jsx(so,{className:"block-editor-inserter",contentClassName:oe("block-editor-inserter__popover",{"is-quick":s}),popoverProps:{position:t,shift:!0},onToggle:this.onToggle,open:this.props.open,expandOnMobile:!0,headerTitle:m("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:i})}}const xm=Co([Ul((e,{clientId:t,rootClientId:n,shouldDirectInsert:o=!0})=>{const{getBlockRootClientId:r,hasInserterItems:s,getAllowedBlocks:i,getDirectInsertBlock:c}=e(J),{getBlockVariations:l}=e(kt);n=n||r(t)||void 0;const u=i(n),d=o&&c(n),p=u?.length===1&&l(u[0].name,"inserter")?.length===0;let f=!1;return p&&(f=u[0]),{hasItems:s(n),hasSingleBlockType:p,blockTitle:f?f.title:"",allowedBlockType:f,directInsertBlock:d,rootClientId:n}}),jf((e,t,{select:n})=>({insertOnlyAllowedBlock(){const{rootClientId:o,clientId:r,isAppender:s,hasSingleBlockType:i,allowedBlockType:c,directInsertBlock:l,onSelectOrClose:u,selectBlockOnInsert:d}=t;if(!i&&!l)return;function p(z){const{getBlock:A,getPreviousBlockClientId:_}=n(J);if(!z||!r&&!o)return{};const v={};let M={};if(r){const y=A(r),k=A(_(r));y?.name===k?.name&&(M=k?.attributes||{})}else{const y=A(o);if(y?.innerBlocks?.length){const k=y.innerBlocks[y.innerBlocks.length-1];l&&l?.name===k.name&&(M=k.attributes)}}return z.forEach(y=>{M.hasOwnProperty(y)&&(v[y]=M[y])}),v}function f(){const{getBlockIndex:z,getBlockSelectionEnd:A,getBlockOrder:_,getBlockRootClientId:v}=n(J);if(r)return z(r);const M=A();return!s&&M&&v(M)===o?z(M)+1:_(o).length}const{insertBlock:b}=e(J);let h;if(l){const z=p(l.attributesToCopy);h=Ee(l.name,{...l.attributes||{},...z})}else h=Ee(c.name);b(h,f(),o,d),u&&u({clientId:h?.clientId});const g=xe(m("%s block added"),c.title);Yt(g)}})),d6e(({hasItems:e,isAppender:t,rootClientId:n,clientId:o})=>e||!t&&!n&&!o)])(k6t),S6t="\uFEFF";function Age({rootClientId:e}){const{showPrompt:t,isLocked:n,placeholder:o,isManualGrid:r}=G(u=>{const{getBlockCount:d,getSettings:p,getTemplateLock:f,getBlockAttributes:b}=u(J),h=!d(e),{bodyPlaceholder:g}=p();return{showPrompt:h,isLocked:!!f(e),placeholder:g,isManualGrid:b(e)?.layout?.isManualPlacement}},[e]),{insertDefaultBlock:s,startTyping:i}=Oe(J);if(n||r)return null;const c=Lt(o)||m("Type / to choose a block"),l=()=>{s(void 0,e),i()};return a.jsxs("div",{"data-root-client-id":e||"",className:oe("block-editor-default-block-appender",{"has-visible-prompt":t}),children:[a.jsx("p",{tabIndex:"0",role:"button","aria-label":m("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:u=>{(Gr===u.keyCode||LN===u.keyCode)&&l()},onClick:()=>l(),onFocus:()=>{t&&l()},children:t?c:S6t}),a.jsx(xm,{rootClientId:e,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0})]})}function vge({rootClientId:e,className:t,onFocus:n,tabIndex:o,onSelect:r},s){return a.jsx(xm,{position:"bottom center",rootClientId:e,__experimentalIsQuick:!0,onSelectOrClose:(...i)=>{r&&typeof r=="function"&&r(...i)},renderToggle:({onToggle:i,disabled:c,isOpen:l,blockTitle:u,hasSingleBlockType:d})=>{const p=!d,f=d?xe(We("Add %s","directly add the only allowed block"),u):We("Add block","Generic label for block inserter button");return a.jsx(Ce,{__next40pxDefaultSize:!0,ref:s,onFocus:n,tabIndex:o,className:oe(t,"block-editor-button-block-appender"),onClick:i,"aria-haspopup":p?"true":void 0,"aria-expanded":p?l:void 0,disabled:c,label:f,showTooltip:!0,children:a.jsx(wn,{icon:Fs})})},isAppender:!0})}x.forwardRef((e,t)=>(Ke("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),vge(e,t)));const N_=x.forwardRef(vge);function C6t({rootClientId:e}){return G(n=>n(J).canInsertBlockType(Mr(),e))?a.jsx(Age,{rootClientId:e}):a.jsx(N_,{rootClientId:e,className:"block-list-appender__toggle"})}function q6t({rootClientId:e,CustomAppender:t,className:n,tagName:o="div"}){const r=G(s=>{const{getBlockInsertionPoint:i,isBlockInsertionPointVisible:c,getBlockCount:l}=s(J),u=i();return c()&&e===u?.rootClientId&&l(e)===0},[e]);return a.jsx(o,{tabIndex:-1,className:oe("block-list-appender wp-block",n,{"is-drag-over":r}),contentEditable:!1,"data-block":!0,children:t?a.jsx(t,{}):a.jsx(C6t,{rootClientId:e})})}function Vx(e){return Mn(t=>{if(!e)return;function n(r){const{deltaX:s,deltaY:i}=r;e.current.scrollBy(s,i)}const o={passive:!0};return t.addEventListener("wheel",n,o),()=>{t.removeEventListener("wheel",n,o)}},[e])}const R6t=Number.MAX_SAFE_INTEGER;x.createContext();function xge({previousClientId:e,nextClientId:t,children:n,__unstablePopoverSlot:o,__unstableContentRef:r,operation:s="insert",nearestSide:i="right",...c}){const[l,u]=x.useReducer(_=>(_+1)%R6t,0),{orientation:d,rootClientId:p,isVisible:f}=G(_=>{const{getBlockListSettings:v,getBlockRootClientId:M,isBlockVisible:y}=_(J),k=M(e??t);return{orientation:v(k)?.orientation||"vertical",rootClientId:k,isVisible:y(e)&&y(t)}},[e,t]),b=Wi(e),h=Wi(t),g=d==="vertical",z=x.useMemo(()=>l<0||!b&&!h||!f?void 0:{contextElement:s==="group"?h||b:b||h,getBoundingClientRect(){const v=b?b.getBoundingClientRect():null,M=h?h.getBoundingClientRect():null;let y=0,k=0,S=0,C=0;if(s==="group"){const R=M||v;k=R.top,S=0,C=R.bottom-R.top,y=i==="left"?R.left-2:R.right-2}else g?(k=v?v.bottom:M.top,S=v?v.width:M.width,C=M&&v?M.top-v.bottom:0,y=v?v.left:M.left):(k=v?v.top:M.top,C=v?v.height:M.height,jt()?(y=M?M.right:v.left,S=v&&M?v.left-M.right:0):(y=v?v.right:M.left,S=v&&M?M.left-v.right:0),S=Math.max(S,0));return new window.DOMRect(y,k,S,C)}},[b,h,l,g,f,s,i]),A=Vx(r);return x.useLayoutEffect(()=>{if(!b)return;const _=new window.MutationObserver(u);return _.observe(b,{attributes:!0}),()=>{_.disconnect()}},[b]),x.useLayoutEffect(()=>{if(!h)return;const _=new window.MutationObserver(u);return _.observe(h,{attributes:!0}),()=>{_.disconnect()}},[h]),x.useLayoutEffect(()=>{if(b)return b.ownerDocument.defaultView.addEventListener("resize",u),()=>{b.ownerDocument.defaultView?.removeEventListener("resize",u)}},[b]),!b&&!h||!f?null:a.jsx(Io,{ref:A,animate:!1,anchor:z,focusOnMount:!1,__unstableSlotName:o,inline:!o,...c,className:oe("block-editor-block-popover","block-editor-block-popover__inbetween",c.className),resize:!1,flip:!1,placement:"overlay",variant:"unstyled",children:a.jsx("div",{className:"block-editor-block-popover__inbetween-container",children:n})},t+"--"+p)}const T6t=Number.MAX_SAFE_INTEGER;function E6t({clientId:e,bottomClientId:t,children:n,__unstablePopoverSlot:o,__unstableContentRef:r,shift:s=!0,...i},c){const l=Wi(e),u=Wi(t??e),d=xn([c,Vx(r)]),[p,f]=x.useReducer(h=>(h+1)%T6t,0);x.useLayoutEffect(()=>{if(!l)return;const h=new window.MutationObserver(f);return h.observe(l,{attributes:!0}),()=>{h.disconnect()}},[l]);const b=x.useMemo(()=>{if(!(p<0||!l||t&&!u))return{getBoundingClientRect(){return u?dme(h4(l),h4(u)):h4(l)},contextElement:l}},[p,l,t,u]);return!l||t&&!u?null:a.jsx(Io,{ref:d,animate:!1,focusOnMount:!1,anchor:b,__unstableSlotName:o,inline:!o,placement:"top-start",resize:!1,flip:!1,shift:s,...i,className:oe("block-editor-block-popover",i.className),variant:"unstyled",children:n})}const U7=x.forwardRef(E6t),W6t=({clientId:e,bottomClientId:t,children:n,...o},r)=>a.jsx(U7,{...o,bottomClientId:t,clientId:e,__unstableContentRef:void 0,__unstablePopoverSlot:void 0,ref:r,children:n}),N6t=x.forwardRef(W6t);function B6t({clientId:e,bottomClientId:t,children:n,shift:o=!1,additionalStyles:r,...s},i){var c;(c=t)!==null&&c!==void 0||(t=e);const l=Wi(e);return a.jsx(U7,{ref:i,clientId:e,bottomClientId:t,shift:o,...s,children:l&&e===t?a.jsx(L6t,{selectedElement:l,additionalStyles:r,children:n}):n})}function L6t({selectedElement:e,additionalStyles:t={},children:n}){const[o,r]=x.useState(e.offsetWidth),[s,i]=x.useState(e.offsetHeight);x.useEffect(()=>{const l=new window.ResizeObserver(()=>{r(e.offsetWidth),i(e.offsetHeight)});return l.observe(e,{box:"border-box"}),()=>l.disconnect()},[e]);const c=x.useMemo(()=>({position:"absolute",width:o,height:s,...t}),[o,s,t]);return a.jsx("div",{style:c,children:n})}const wm=x.forwardRef(B6t),Dg={hide:{opacity:0,scaleY:.75},show:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:.9}};function P6t({__unstablePopoverSlot:e,__unstableContentRef:t}){const{clientId:n}=G(r=>{const{getBlockOrder:s,getBlockInsertionPoint:i}=r(J),c=i(),l=s(c.rootClientId);return l.length?{clientId:l[c.index]}:{}},[]),o=$1();return a.jsx(wm,{clientId:n,__unstablePopoverSlot:e,__unstableContentRef:t,className:"block-editor-block-popover__drop-zone",children:a.jsx(qr.div,{"data-testid":"block-popover-drop-zone",initial:o?Dg.show:Dg.hide,animate:Dg.show,exit:o?Dg.show:Dg.exit,className:"block-editor-block-popover__drop-zone-foreground"})})}const X7=x.createContext();function j6t({__unstablePopoverSlot:e,__unstableContentRef:t,operation:n="insert",nearestSide:o="right"}){const{selectBlock:r,hideInsertionPoint:s}=Oe(J),i=x.useContext(X7),c=x.useRef(),{orientation:l,previousClientId:u,nextClientId:d,rootClientId:p,isInserterShown:f,isDistractionFree:b,isZoomOutMode:h}=G(C=>{const{getBlockOrder:R,getBlockListSettings:T,getBlockInsertionPoint:E,isBlockBeingDragged:B,getPreviousBlockClientId:N,getNextBlockClientId:j,getSettings:I,isZoomOut:P}=ct(C(J)),$=E(),F=R($.rootClientId);if(!F.length)return{};let X=F[$.index-1],Z=F[$.index];for(;B(X);)X=N(X);for(;B(Z);)Z=j(Z);const V=I();return{previousClientId:X,nextClientId:Z,orientation:T($.rootClientId)?.orientation||"vertical",rootClientId:$.rootClientId,isDistractionFree:V.isDistractionFree,isInserterShown:$?.__unstableWithInserter,isZoomOutMode:P()}},[]),{getBlockEditingMode:g}=G(J),z=$1();function A(C){C.target===c.current&&d&&g(d)!=="disabled"&&r(d,-1)}function _(C){C.target===c.current&&!i.current&&s()}function v(C){C.target!==c.current&&(i.current=!0)}const M={start:{opacity:0,scale:0},rest:{opacity:1,scale:1,transition:{delay:f?.5:0,type:"tween"}},hover:{opacity:1,scale:1,transition:{delay:.5,type:"tween"}}},y={start:{scale:z?1:0},rest:{scale:1,transition:{delay:.4,type:"tween"}}};if(b||h&&n!=="insert")return null;const S=oe("block-editor-block-list__insertion-point",l==="horizontal"||n==="group"?"is-horizontal":"is-vertical");return a.jsx(xge,{previousClientId:u,nextClientId:d,__unstablePopoverSlot:e,__unstableContentRef:t,operation:n,nearestSide:o,children:a.jsxs(qr.div,{layout:!z,initial:z?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:c,tabIndex:-1,onClick:A,onFocus:v,className:oe(S,{"is-with-inserter":f}),onHoverEnd:_,children:[a.jsx(qr.div,{variants:M,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),f&&a.jsx(qr.div,{variants:y,className:oe("block-editor-block-list__insertion-point-inserter"),children:a.jsx(xm,{position:"bottom center",clientId:d,rootClientId:p,__experimentalIsQuick:!0,onToggle:C=>{i.current=C},onSelectOrClose:()=>{i.current=!1}})})]})})}function I6t(e){const{insertionPoint:t,isVisible:n,isBlockListEmpty:o}=G(r=>{const{getBlockInsertionPoint:s,isBlockInsertionPointVisible:i,getBlockCount:c}=r(J),l=s();return{insertionPoint:l,isVisible:i(),isBlockListEmpty:c(l?.rootClientId)===0}},[]);return!n||o?null:t.operation==="replace"?a.jsx(P6t,{...e},`${t.rootClientId}-${t.index}`):a.jsx(j6t,{operation:t.operation,nearestSide:t.nearestSide,...e})}function D6t(){const e=x.useContext(X7),t=G(g=>g(J).getSettings().isDistractionFree||ct(g(J)).isZoomOut(),[]),{getBlockListSettings:n,getBlockIndex:o,isMultiSelecting:r,getSelectedBlockClientIds:s,getSettings:i,getTemplateLock:c,__unstableIsWithinBlockOverlay:l,getBlockEditingMode:u,getBlockName:d,getBlockAttributes:p,getParentSectionBlock:f}=ct(G(J)),{showInsertionPoint:b,hideInsertionPoint:h}=Oe(J);return Mn(g=>{if(t)return;function z(A){if(e===void 0||e.current||A.target.nodeType===A.target.TEXT_NODE||r())return;if(!A.target.classList.contains("block-editor-block-list__layout")){h();return}let _;if(A.target.classList.contains("is-root-container")||(_=(A.target.getAttribute("data-block")?A.target:A.target.closest("[data-block]")).getAttribute("data-block")),c(_)||u(_)==="disabled"||d(_)==="core/block"||_&&p(_).layout?.isManualPlacement)return;const v=n(_),M=v?.orientation||"vertical",y=!!v?.__experimentalCaptureToolbars,k=A.clientY,S=A.clientX;let R=Array.from(A.target.children).find(N=>{const j=N.getBoundingClientRect();return N.classList.contains("wp-block")&&M==="vertical"&&j.top>k||N.classList.contains("wp-block")&&M==="horizontal"&&(jt()?j.rightS)});if(!R){h();return}if(!R.id&&(R=R.firstElementChild,!R)){h();return}const T=R.id.slice(6);if(!T||l(T)||f(T)||s().includes(T)&&M==="vertical"&&!y&&!i().hasFixedToolbar)return;const E=R.getBoundingClientRect();if(M==="horizontal"&&(A.clientY>E.bottom||A.clientYE.right||A.clientX{g.removeEventListener("mousemove",z)}},[e,n,o,r,b,h,s,t])}function F6t({showSeparator:e,isFloating:t,onAddBlock:n,isToggle:o}){const{clientId:r}=j0();return a.jsx(N_,{className:oe({"block-list-appender__toggle":o}),rootClientId:r,showSeparator:e,isFloating:t,onAddBlock:n})}function $6t(){const{clientId:e}=j0();return a.jsx(Age,{rootClientId:e})}const Fg=new WeakMap;function V6t(){let e;return t=>((e===void 0||!ds(e,t))&&(e=t),e)}function yee(e){const[t]=x.useState(V6t);return t(e)}function H6t(e,t,n,o,r,s,i,c,l,u,d,p){const f=Fn(),b=yee(n),h=yee(o),g=l===void 0||t==="contentOnly"?t:l;x.useLayoutEffect(()=>{const z={allowedBlocks:b,prioritizedInserterBlocks:h,templateLock:g};if(u!==void 0&&(z.__experimentalCaptureToolbars=u),d!==void 0)z.orientation=d;else{const A=Rf(p?.type);z.orientation=A.getOrientation(p)}i!==void 0&&(Ke("__experimentalDefaultBlock",{alternative:"defaultBlock",since:"6.3",version:"6.4"}),z.defaultBlock=i),r!==void 0&&(z.defaultBlock=r),c!==void 0&&(Ke("__experimentalDirectInsert",{alternative:"directInsert",since:"6.3",version:"6.4"}),z.directInsert=c),s!==void 0&&(z.directInsert=s),z.directInsert!==void 0&&typeof z.directInsert!="boolean"&&Ke("Using `Function` as a `directInsert` argument",{alternative:"`boolean` values",since:"6.5"}),Fg.get(f)||Fg.set(f,{}),Fg.get(f)[e]=z,window.queueMicrotask(()=>{const A=Fg.get(f);if(Object.keys(A).length){const{updateBlockListSettings:_}=f.dispatch(J);_(A),Fg.set(f,{})}})},[e,b,h,g,r,s,i,c,u,d,p,f])}function U6t(e,t,n,o){const r=Fn(),s=x.useRef(null);x.useLayoutEffect(()=>{let i=!1;const{getBlocks:c,getSelectedBlocksInitialCaretPosition:l,isBlockSelected:u}=r.select(J),{replaceInnerBlocks:d,__unstableMarkNextChangeAsNotPersistent:p}=r.dispatch(J);return window.queueMicrotask(()=>{if(i)return;const f=c(e),b=f.length===0||n==="all"||n==="contentOnly",h=!N0(t,s.current);if(!b||!h)return;s.current=t;const g=oz(f,t);N0(g,f)||(p(),d(e,g,f.length===0&&o&&g.length!==0&&u(e),l()))}),()=>{i=!0}},[t,n,e,r,o])}function X6t(e){return G(t=>{const n=t(J).getBlock(e);if(!n)return;const o=t(kt).getBlockType(n.name);if(o&&Object.keys(o.providesContext).length!==0)return Object.fromEntries(Object.entries(o.providesContext).map(([r,s])=>[r,n.attributes[s]]))},[e])}function wge(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{return t}return t}function G6t(e,t,n,o,r,s,i,c,l){return u=>{const{srcRootClientId:d,srcClientIds:p,type:f,blocks:b}=wge(u);if(f==="inserter"){i();const h=b.map(g=>jo(g));s(h,!0,null)}if(f==="block"){const h=n(p[0]);if(d===e&&h===t||p.includes(e)||o(p).some(_=>_===e))return;if(c==="group"){const _=p.map(v=>l(v));s(_,!0,null,p);return}const g=d===e,z=p.length,A=g&&h{if(!t().mediaUpload)return;const i=xc(Ei("from"),c=>c.type==="files"&&o(c.blockName,e)&&c.isMatch(s));if(i){const c=i.transform(s,n);r(c)}}}function Y6t(e){return t=>{const n=Xh({HTML:t,mode:"BLOCKS"});n.length&&e(n)}}function _ge(e,t,n={}){const{operation:o="insert",nearestSide:r="right"}=n,{canInsertBlockType:s,getBlockIndex:i,getClientIdsOfDescendants:c,getBlockOrder:l,getBlocksByClientId:u,getSettings:d,getBlock:p}=G(J),{getGroupingBlockName:f}=G(kt),{insertBlocks:b,moveBlocksToPosition:h,updateBlockAttributes:g,clearSelectedBlock:z,replaceBlocks:A,removeBlocks:_}=Oe(J),v=Fn(),M=x.useCallback((R,T=!0,E=0,B=[])=>{Array.isArray(R)||(R=[R]);const j=l(e)[t];if(o==="replace")A(j,R,void 0,E);else if(o==="group"){const I=p(j);r==="left"?R.push(I):R.unshift(I);const P=R.map(Z=>Ee(Z.name,Z.attributes,Z.innerBlocks)),$=R.every(Z=>Z.name==="core/image"),F=s("core/gallery",e),X=Ee($&&F?"core/gallery":f(),{layout:{type:"flex",flexWrap:$&&F?null:"nowrap"}},P);A([j,...B],X,void 0,E)}else b(R,t,e,T,E)},[l,e,t,o,A,p,r,s,f,b]),y=x.useCallback((R,T,E)=>{if(o==="replace"){const B=u(R),j=l(e)[t];v.batch(()=>{_(R,!1),A(j,B,void 0,0)})}else h(R,T,e,E)},[o,l,u,h,v,_,A,t,e]),k=G6t(e,t,i,c,y,M,z,o,p),S=K6t(e,d,g,s,M),C=Y6t(M);return R=>{const T=C4(R.dataTransfer),E=R.dataTransfer.getData("text/html");E?C(E):T.length?S(T):k(R)}}function Z6t(e,t,n){const o=n==="top"||n==="bottom",{x:r,y:s}=e,i=o?r:s,c=o?s:r,l=o?t.left:t.top,u=o?t.right:t.bottom,d=t[n];let p;return i>=l&&i<=u?p=i:i{const i=Z6t(e,t,s);(o===void 0||i=e.x&&t.top<=e.y&&t.bottom>=e.y}function Q6t(e,t){return t.top<=e.y&&t.bottom>=e.y}const FR=30,J6t=120,eSt=120;function tSt(e,t,n="vertical",o={}){const r=n==="horizontal"?["left","right"]:["top","bottom"];let s=0,i="before",c=1/0,l=null,u="right";const{dropZoneElement:d,parentBlockOrientation:p,rootBlockIndex:f=0}=o;if(d&&p!=="horizontal"){const A=d.getBoundingClientRect(),[_,v]=pM(t,A,["top","bottom"]);if(A.height>J6t&&_eSt&&_{const y=_();let[k,S]=pM(t,y,r);const[C,R]=pM(t,y,["left","right"]),T=kge(t,y);A&&T?k=0:n==="vertical"&&M!=="horizontal"&&(T&&Cl);r=n.every(l=>c?.includes(l))}const i=n.map(c=>e(c)).every(c=>{const[l]=c?.parent||[];return l?l===o:!0});return r&&i}function Aee(e,t){const{defaultView:n}=t;return!!(n&&e instanceof n.HTMLElement&&e.closest("[data-is-insertion-point]"))}function nSt({dropZoneElement:e,rootClientId:t="",parentClientId:n="",isDisabled:o=!1}={}){const r=Fn(),[s,i]=x.useState({index:null,operation:"insert"}),{getBlockType:c,getBlockVariations:l,getGroupingBlockName:u}=G(kt),{canInsertBlockType:d,getBlockListSettings:p,getBlocks:f,getBlockIndex:b,getDraggedBlockClientIds:h,getBlockNamesByClientId:g,getAllowedBlocks:z,isDragging:A,isGroupable:_,isZoomOut:v,getSectionRootClientId:M,getBlockParents:y}=ct(G(J)),{showInsertionPoint:k,hideInsertionPoint:S,startDragging:C,stopDragging:R}=ct(Oe(J)),T=_ge(s.operation==="before"||s.operation==="after"?n:t,s.index,{operation:s.operation,nearestSide:s.nearestSide}),E=yE(x.useCallback((B,N)=>{A()||C();const j=h(),I=[t,...y(t,!0)];if(j.some(Ae=>I.includes(Ae)))return;const $=z(t),F=g([t])[0],X=g(j);if(!LW(c,$,X,F))return;const V=M();if(v()&&V!==t)return;const Q=f(t);if(Q.length===0){r.batch(()=>{i({index:0,operation:"insert"}),k(t,0,{operation:"insert"})});return}const te=Q.map(Ae=>{const ye=Ae.clientId;return{isUnmodifiedDefaultBlock:El(Ae),getBoundingClientRect:()=>N.getElementById(`block-${ye}`).getBoundingClientRect(),blockIndex:b(ye),blockOrientation:p(ye)?.orientation}}),ee=tSt(te,{x:B.clientX,y:B.clientY},p(t)?.orientation,{dropZoneElement:e,parentBlockClientId:n,parentBlockOrientation:n?p(n)?.orientation:void 0,rootBlockIndex:b(t)}),[ue,ce,me]=ee,de=te[ue]?.isUnmodifiedDefaultBlock;if(!(v()&&!de&&ce!=="insert")){if(ce==="group"){const Ae=Q[ue],ye=[Ae.name,...X].every(re=>re==="core/image"),Ne=d("core/gallery",t),je=_([Ae.clientId,h()]),ie=l(u(),"block"),we=ie&&ie.find(({name:re})=>re==="group-row");if(ye&&!Ne&&(!je||!we)||!ye&&(!je||!we))return}r.batch(()=>{i({index:ue,operation:ce,nearestSide:me});const Ae=["before","after"].includes(ce)?n:t;k(Ae,ue,{operation:ce,nearestSide:me})})}},[A,z,t,g,h,c,M,v,f,p,e,n,b,r,C,k,d,_,l,u]),200);return k5({dropZoneElement:e,isDisabled:o,onDrop:T,onDragOver(B){E(B,B.currentTarget.ownerDocument)},onDragLeave(B){const{ownerDocument:N}=B.currentTarget;Aee(B.relatedTarget,N)||Aee(B.target,N)||(E.cancel(),S())},onDragEnd(){E.cancel(),R(),S()}})}const oSt={};function rSt({children:e,clientId:t}){const n=X6t(t);return a.jsx(uO,{value:n,children:e})}const sSt=x.memo(G7);function Sge(e){const{clientId:t,allowedBlocks:n,prioritizedInserterBlocks:o,defaultBlock:r,directInsert:s,__experimentalDefaultBlock:i,__experimentalDirectInsert:c,template:l,templateLock:u,wrapperRef:d,templateInsertUpdatesSelection:p,__experimentalCaptureToolbars:f,__experimentalAppenderTagName:b,renderAppender:h,orientation:g,placeholder:z,layout:A,name:_,blockType:v,parentLock:M,defaultLayout:y}=e;H6t(t,M,n,o,r,s,i,c,u,f,g,A),U6t(t,l,u,p);const k=An(_,"layout")||An(_,"__experimentalLayout")||oSt,{allowSizingOnChildren:S=!1}=k,C=A||k,R=x.useMemo(()=>({...y,...C,...S&&{allowSizingOnChildren:!0}}),[y,C,S]),T=a.jsx(sSt,{rootClientId:t,renderAppender:h,__experimentalAppenderTagName:b,layout:R,wrapperRef:d,placeholder:z});return!v?.providesContext||Object.keys(v.providesContext).length===0?T:a.jsx(rSt,{clientId:t,children:T})}function iSt(e){return yme(e),a.jsx(Sge,{...e})}const Ht=x.forwardRef((e,t)=>{const n=Nt({ref:t},e);return a.jsx("div",{className:"block-editor-inner-blocks",children:a.jsx("div",{...n})})});function Nt(e={},t={}){const{__unstableDisableLayoutClassNames:n,__unstableDisableDropZone:o,dropZoneElement:r}=t,{clientId:s,layout:i=null,__unstableLayoutClassNames:c=""}=j0(),l=G(M=>{const{getBlockName:y,isZoomOut:k,getTemplateLock:S,getBlockRootClientId:C,getBlockEditingMode:R,getBlockSettings:T,getSectionRootClientId:E}=ct(M(J));if(!s){const X=E();return{isDropZoneDisabled:k()&&X!==""}}const{hasBlockSupport:B,getBlockType:N}=M(kt),j=y(s),I=R(s),P=C(s),[$]=T(s,"layout");let F=I==="disabled";if(k()){const X=E();F=s!==X}return{__experimentalCaptureToolbars:B(j,"__experimentalExposeControlsToChildren",!1),name:j,blockType:N(j),parentLock:S(P),parentClientId:P,isDropZoneDisabled:F,defaultLayout:$}},[s]),{__experimentalCaptureToolbars:u,name:d,blockType:p,parentLock:f,parentClientId:b,isDropZoneDisabled:h,defaultLayout:g}=l,z=nSt({dropZoneElement:r,rootClientId:s,parentClientId:b}),A=xn([e.ref,o||h||i?.isManualPlacement&&window.__experimentalEnableGridInteractivity?null:z]),_={__experimentalCaptureToolbars:u,layout:i,name:d,blockType:p,parentLock:f,defaultLayout:g,...t},v=_.value&&_.onChange?iSt:Sge;return{...e,ref:A,className:oe(e.className,"block-editor-block-list__layout",n?"":c),children:s?a.jsx(v,{..._,clientId:s}):a.jsx(G7,{...t})}}Nt.save=BPe;Ht.DefaultBlockAppender=$6t;Ht.ButtonBlockAppender=F6t;Ht.Content=()=>Nt.save().children;const aSt=new Set([cc,_i,Ps,wi,Gr,Mc]);function cSt(e){const{keyCode:t,shiftKey:n}=e;return!n&&aSt.has(t)}function Cge(){const e=G(n=>n(J).isTyping(),[]),{stopTyping:t}=Oe(J);return Mn(n=>{if(!e)return;const{ownerDocument:o}=n;let r,s;function i(c){const{clientX:l,clientY:u}=c;r&&s&&(r!==l||s!==u)&&t(),r=l,s=u}return o.addEventListener("mousemove",i),()=>{o.removeEventListener("mousemove",i)}},[e,t])}function qge(){const{isTyping:e}=G(s=>{const{isTyping:i}=s(J);return{isTyping:i()}},[]),{startTyping:t,stopTyping:n}=Oe(J),o=Cge(),r=Mn(s=>{const{ownerDocument:i}=s,{defaultView:c}=i,l=c.getSelection();if(e){let p=function(h){const{target:g}=h;d=c.setTimeout(()=>{md(g)||n()})},f=function(h){const{keyCode:g}=h;(g===gd||g===Y2)&&n()},b=function(){l.isCollapsed||n()},d;return s.addEventListener("focus",p),s.addEventListener("keydown",f),i.addEventListener("selectionchange",b),()=>{c.clearTimeout(d),s.removeEventListener("focus",p),s.removeEventListener("keydown",f),i.removeEventListener("selectionchange",b)}}function u(d){const{type:p,target:f}=d;!md(f)||!s.contains(f)||p==="keydown"&&!cSt(d)||t()}return s.addEventListener("keypress",u),s.addEventListener("keydown",u),()=>{s.removeEventListener("keypress",u),s.removeEventListener("keydown",u)}},[e,t,n]);return xn([o,r])}function vee({clientId:e,rootClientId:t="",position:n="top"}){const[o,r]=x.useState(!1),{sectionRootClientId:s,sectionClientIds:i,insertionPoint:c,blockInsertionPointVisible:l,blockInsertionPoint:u,blocksBeingDragged:d}=G(y=>{const{getInsertionPoint:k,getBlockOrder:S,getSectionRootClientId:C,isBlockInsertionPointVisible:R,getBlockInsertionPoint:T,getDraggedBlockClientIds:E}=ct(y(J)),B=C(),N=S(B);return{sectionRootClientId:B,sectionClientIds:N,blockOrder:S(B),insertionPoint:k(),blockInsertionPoint:T(),blockInsertionPointVisible:R(),blocksBeingDragged:E()}},[]),p=$1();if(!e)return;let f=!1;if(!(t===s&&i&&i.includes(e)))return null;const h=c?.index===0&&e===i[c.index],g=c&&c.hasOwnProperty("index")&&e===i[c.index-1];n==="top"&&(f=h||l&&u.index===0&&e===i[u.index]),n==="bottom"&&(f=g||l&&e===i[u.index-1]);const z=d[0],A=d.includes(e),_=i.indexOf(z),M=(_>0?i[_-1]:null)===e;return(A||M)&&(f=!1),a.jsx(Wd,{children:f&&a.jsx(qr.div,{initial:{height:0},animate:{height:"calc(1 * var(--wp-block-editor-iframe-zoom-out-frame-size) / var(--wp-block-editor-iframe-zoom-out-scale)"},exit:{height:0},transition:{type:"tween",duration:p?0:.2,ease:[.6,0,.4,1]},className:oe("block-editor-block-list__zoom-out-separator",{"is-dragged-over":o}),"data-is-insertion-point":"true",onDragOver:()=>r(!0),onDragLeave:()=>r(!1),children:a.jsx(qr.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{delay:-.125}},transition:{ease:"linear",duration:.1,delay:.125},children:m("Drop pattern.")})})})}const Rge=x.createContext(),av=new WeakMap;function lSt({className:e,...t}){const{isOutlineMode:n,isFocusMode:o,temporarilyEditingAsBlocks:r}=G(d=>{const{getSettings:p,getTemporarilyEditingAsBlocks:f,isTyping:b}=ct(d(J)),{outlineMode:h,focusMode:g}=p();return{isOutlineMode:h&&!b(),isFocusMode:g,temporarilyEditingAsBlocks:f()}},[]),s=Fn(),{setBlockVisibility:i}=Oe(J),c=q1(x.useCallback(()=>{const d={};av.get(s).forEach(([p,f])=>{d[p]=f}),i(d)},[s]),300,{trailing:!0}),l=x.useMemo(()=>{const{IntersectionObserver:d}=window;if(d)return new d(p=>{av.get(s)||av.set(s,[]);for(const f of p){const b=f.target.getAttribute("data-block");av.get(s).push([b,f.isIntersecting])}c()})},[]),u=Nt({ref:xn([q7(),D6t(),qge()]),className:oe("is-root-container",e,{"is-outline-mode":n,"is-focus-mode":o})},t);return a.jsxs(Rge.Provider,{value:l,children:[a.jsx("div",{...u}),!!r&&a.jsx(uSt,{clientId:r})]})}function uSt({clientId:e}){const{stopEditingAsBlocks:t}=ct(Oe(J)),n=G(o=>{const{isBlockSelected:r,hasSelectedInnerBlock:s}=o(J);return r(e)||s(e,!0)},[e]);return x.useEffect(()=>{n||t(e)},[n,e,t]),null}function B_(e){return a.jsx(iae,{value:rae,children:a.jsx(lSt,{...e})})}const dSt=[],pSt=new Set;function fSt({placeholder:e,rootClientId:t,renderAppender:n,__experimentalAppenderTagName:o,layout:r=qhe}){const s=n!==!1,i=!!n,{order:c,isZoomOut:l,selectedBlocks:u,visibleBlocks:d,shouldRenderAppender:p}=G(f=>{const{getSettings:b,getBlockOrder:h,getSelectedBlockClientId:g,getSelectedBlockClientIds:z,__unstableGetVisibleBlocks:A,getTemplateLock:_,getBlockEditingMode:v,isSectionBlock:M,isZoomOut:y}=ct(f(J)),k=h(t);if(b().isPreviewMode)return{order:k,selectedBlocks:dSt,visibleBlocks:pSt};const S=g();return{order:k,selectedBlocks:z(),visibleBlocks:A(),isZoomOut:y(),shouldRenderAppender:!M(t)&&v(t)!=="disabled"&&!_(t)&&s&&!y()&&(i||t===S||!t&&!S&&!k.length)}},[t,s,i]);return a.jsxs(gvt,{value:r,children:[c.map(f=>a.jsxs(C5,{value:!d.has(f)&&!u.includes(f),children:[l&&a.jsx(vee,{clientId:f,rootClientId:t,position:"top"}),a.jsx(Ext,{rootClientId:t,clientId:f}),l&&a.jsx(vee,{clientId:f,rootClientId:t,position:"bottom"})]},f)),c.length<1&&e,p&&a.jsx(q6t,{tagName:o,rootClientId:t,CustomAppender:n})]})}function G7(e){return a.jsx(C5,{value:!1,children:a.jsx(fSt,{...e})})}const xee=Qn("InspectorControls"),bSt=Qn("InspectorAdvancedControls"),hSt=Qn("InspectorControlsBindings"),mSt=Qn("InspectorControlsBackground"),gSt=Qn("InspectorControlsBorder"),MSt=Qn("InspectorControlsColor"),zSt=Qn("InspectorControlsFilter"),OSt=Qn("InspectorControlsDimensions"),ySt=Qn("InspectorControlsPosition"),ASt=Qn("InspectorControlsTypography"),vSt=Qn("InspectorControlsListView"),xSt=Qn("InspectorControlsStyles"),wSt=Qn("InspectorControlsEffects"),L_={default:xee,advanced:bSt,background:mSt,bindings:hSt,border:gSt,color:MSt,dimensions:OSt,effects:wSt,filter:zSt,list:vSt,position:ySt,settings:xee,styles:xSt,typography:ASt};function Tge({children:e,group:t="default",__experimentalGroup:n,resetAllFilter:o}){n&&(Ke("`__experimentalGroup` property in `InspectorControlsFill`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=n);const r=j0(),s=L_[t]?.Fill;return s?r[J5]?a.jsx(Jf,{document,children:a.jsx(s,{children:i=>a.jsx(kSt,{fillProps:i,children:e,resetAllFilter:o})})}):null:(globalThis.SCRIPT_DEBUG===!0&&zn(`Unknown InspectorControls group "${t}" provided.`),null)}function _St({resetAllFilter:e,children:t}){const{registerResetAllFilter:n,deregisterResetAllFilter:o}=x.useContext(Ez);return x.useEffect(()=>{if(e&&n&&o)return n(e),()=>{o(e)}},[e,n,o]),t}function kSt({children:e,resetAllFilter:t,fillProps:n}){const{forwardedContext:o=[]}=n,r=a.jsx(_St,{resetAllFilter:t,children:e});return o.reduce((s,[i,c])=>a.jsx(i,{...c,children:s}),r)}function SSt(e){if(!e)return{};if(typeof e=="object")return e;let t;switch(e){case"normal":t=We("Regular","font style");break;case"italic":t=We("Italic","font style");break;case"oblique":t=We("Oblique","font style");break;default:t=e;break}return{name:t,value:e}}function wee(e){if(!e)return{};if(typeof e=="object")return e;let t;switch(e){case"normal":case"400":t=We("Regular","font weight");break;case"bold":case"700":t=We("Bold","font weight");break;case"100":t=We("Thin","font weight");break;case"200":t=We("Extra Light","font weight");break;case"300":t=We("Light","font weight");break;case"500":t=We("Medium","font weight");break;case"600":t=We("Semi Bold","font weight");break;case"800":t=We("Extra Bold","font weight");break;case"900":t=We("Black","font weight");break;case"1000":t=We("Extra Black","font weight");break;default:t=e;break}return{name:t,value:e}}const _ee=[{name:We("Regular","font style"),value:"normal"},{name:We("Italic","font style"),value:"italic"}],kee=[{name:We("Thin","font weight"),value:"100"},{name:We("Extra Light","font weight"),value:"200"},{name:We("Light","font weight"),value:"300"},{name:We("Regular","font weight"),value:"400"},{name:We("Medium","font weight"),value:"500"},{name:We("Semi Bold","font weight"),value:"600"},{name:We("Bold","font weight"),value:"700"},{name:We("Extra Bold","font weight"),value:"800"},{name:We("Black","font weight"),value:"900"},{name:We("Extra Black","font weight"),value:"1000"}];function Ege(e){let t=[],n=[];const o=[],r=!e||e?.length===0;let s=!1;return e?.forEach(i=>{if(typeof i.fontWeight=="string"&&/\s/.test(i.fontWeight.trim())){s=!0;let[u,d]=i.fontWeight.split(" ");u=parseInt(u.slice(0,1)),d==="1000"?d=10:d=parseInt(d.slice(0,1));for(let p=u;p<=d;p++){const f=`${p.toString()}00`;n.some(b=>b.value===f)||n.push(wee(f))}}const c=wee(typeof i.fontWeight=="number"?i.fontWeight.toString():i.fontWeight),l=SSt(i.fontStyle);l&&Object.keys(l).length&&(t.some(u=>u.value===l.value)||t.push(l)),c&&Object.keys(c).length&&(n.some(u=>u.value===c.value)||s||n.push(c))}),n.some(i=>i.value>="600")||n.push({name:We("Bold","font weight"),value:"700"}),t.some(i=>i.value==="italic")||t.push({name:We("Italic","font style"),value:"italic"}),r&&(t=_ee,n=kee),t=t.length===0?_ee:t,n=n.length===0?kee:n,t.forEach(({name:i,value:c})=>{n.forEach(({name:l,value:u})=>{const d=c==="normal"?l:xe(We("%1$s %2$s","font"),l,i);o.push({key:`${c}-${u}`,name:d,style:{fontStyle:c,fontWeight:u}})})}),{fontStyles:t,fontWeights:n,combinedStyleAndWeightOptions:o,isSystemFont:r,isVariableFont:s}}function P_(e,t){const{size:n}=e;if(!n||n==="0"||e?.fluid===!1||!PW(t?.typography)&&!PW(e))return n;let o=CSt(t);o=typeof o?.fluid=="object"?o?.fluid:{};const r=qyt({minimumFontSize:e?.fluid?.min,maximumFontSize:e?.fluid?.max,fontSize:n,minimumFontSizeLimit:o?.minFontSize,maximumViewportWidth:o?.maxViewportWidth,minimumViewportWidth:o?.minViewportWidth});return r||n}function PW(e){const t=e?.fluid;return t===!0||t&&typeof t=="object"&&Object.keys(t).length>0}function CSt(e){const t=e?.typography,n=e?.layout,o=sl(n?.wideSize)?n?.wideSize:null;return PW(t)&&o?{fluid:{maxViewportWidth:o,...t.fluid}}:{fluid:t?.fluid}}function qSt(e,t){var n;const o=e?.typography?.fontFamilies,r=["default","theme","custom"].flatMap(i=>{var c;return(c=o?.[i])!==null&&c!==void 0?c:[]}),s=(n=r.find(i=>i.fontFamily===t)?.fontFace)!==null&&n!==void 0?n:[];return{fontFamilies:r,fontFamilyFaces:s}}function See(e,t){return t=typeof t=="number"?t.toString():t,!t||typeof t!="string"?"":!e||e.length===0?t:e?.reduce((o,{value:r})=>{const s=Math.abs(parseInt(r)-parseInt(t)),i=Math.abs(parseInt(o)-parseInt(t));return so.value===t)?t:t==="oblique"&&!e.find(o=>o.value==="oblique")?"italic":""}function TSt(e,t,n){let o=t,r=n;const{fontStyles:s,fontWeights:i,combinedStyleAndWeightOptions:c}=Ege(e),l=s?.some(({value:d})=>d===t),u=i?.some(({value:d})=>d?.toString()===n?.toString());return l||(o=t?RSt(s,t):c?.find(d=>d.style.fontWeight===See(i,n))?.style?.fontStyle),u||(r=n?See(i,n):c?.find(d=>d.style.fontStyle===(o||t))?.style?.fontWeight),{nearestFontStyle:o,nearestFontWeight:r}}const ll="body",Hx=":root",_m=[{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)=>P_(e,t),valueKey:"size",cssVarInfix:"font-size",classes:[{classSuffix:"font-size",propertyName:"font-size"}]},{path:["typography","fontFamilies"],valueKey:"fontFamily",cssVarInfix:"font-family",classes:[{classSuffix:"font-family",propertyName:"font-family"}]},{path:["spacing","spacingSizes"],valueKey:"size",cssVarInfix:"spacing",valueFunc:({size:e})=>e,classes:[]}],ESt={"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 dp(){return Yn("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}}}function K7(e,t,n,o,r){const s=[fo(e,["blocks",t,...n]),fo(e,n)];for(const i of s)if(i){const c=["custom","theme","default"];for(const l of c){const u=i[l];if(u){const d=u.find(p=>p[o]===r);if(d)return o==="slug"||K7(e,t,n,"slug",d.slug)[o]===d[o]?d:void 0}}}}function WSt(e,t,n,o){if(!o)return o;const r=ESt[n],s=_m.find(u=>u.cssVarInfix===r);if(!s)return o;const{valueKey:i,path:c}=s,l=K7(e,t,c,i,o);return l?`var:preset|${r}|${l.slug}`:o}function NSt(e,t,n,[o,r]){const s=_m.find(c=>c.cssVarInfix===o);if(!s)return n;const i=K7(e.settings,t,s.path,"slug",r);if(i){const{valueKey:c}=s,l=i[c];return ua(e,t,l)}return n}function BSt(e,t,n,o){var r;const s=(r=fo(e.settings,["blocks",t,"custom",...o]))!==null&&r!==void 0?r:fo(e.settings,["custom",...o]);return s?ua(e,t,s):n}function ua(e,t,n){if(!n||typeof n!="string")if(typeof n?.ref=="string"){if(n=fo(e,n.ref),!n||n?.ref)return n}else return n;const o="var:",r="var(--wp--",s=")";let i;if(n.startsWith(o))i=n.slice(o.length).split("|");else if(n.startsWith(r)&&n.endsWith(s))i=n.slice(r.length,-s.length).split("--");else return n;const[c,...l]=i;return c==="preset"?NSt(e,t,n,l):c==="custom"?BSt(e,t,n,l):n}function Ws(e,t){if(!e||!t)return t;const n=e.split(","),o=t.split(","),r=[];return n.forEach(s=>{o.forEach(i=>{r.push(`${s.trim()} ${i.trim()}`)})}),r.join(", ")}function LSt(e,t){if(!e||!t)return;const n={};return Object.entries(t).forEach(([o,r])=>{typeof r=="string"&&(n[o]=Ws(e,r)),typeof r=="object"&&(n[o]={},Object.entries(r).forEach(([s,i])=>{n[o][s]=Ws(e,i)}))}),n}function PSt(e,t){return e.includes(",")?e.split(",").map(r=>r+t).join(","):e+t}function jSt(e,t){return typeof e!="object"||typeof t!="object"?e===t:N0(e?.styles,t?.styles)&&N0(e?.settings,t?.settings)}function ISt(e,t){const n=`.is-style-${e}`;if(!t)return n;const o=/((?::\([^)]+\))?\s*)([^\s:]+)/,r=(i,c,l)=>c+l+n;return t.split(",").map(i=>i.replace(o,r)).join(",")}function DSt(e,t){if(!e||!t||!Array.isArray(t))return e;const n=t.find(o=>o?.name===e);return n?.href?n?.href:e}function FSt(e,t){if(!e||!t)return e;if(typeof e!="string"&&e?.ref){const n=Dz(fo(t,e.ref));return n?.ref?void 0:n===void 0?e:n}return e}function jW(e,t){if(!e||!t)return e;const n=FSt(e,t);return n?.url&&(n.url=DSt(n.url,t?._links?.["wp:theme-file"])),n}function $St({children:e,group:t,label:n}){const{updateBlockAttributes:o}=Oe(J),{getBlockAttributes:r,getMultiSelectedBlockClientIds:s,getSelectedBlockClientId:i,hasMultiSelection:c}=G(J),l=dp(),u=i(),d=x.useCallback((p=[])=>{const f={},b=c()?s():[u];b.forEach(h=>{const{style:g}=r(h);let z={style:g};p.forEach(A=>{z={...z,...A(z)}}),z={...z,style:Ii(z.style)},f[h]=z}),o(b,f,!0)},[r,s,c,u,o]);return a.jsx(En,{className:`${t}-block-support-panel`,label:n,resetAll:d,panelId:u,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:l,children:e},u)}function VSt({Slot:e,fillProps:t,...n}){const o=x.useContext(Ez),r=x.useMemo(()=>{var s;return{...t??{},forwardedContext:[...(s=t?.forwardedContext)!==null&&s!==void 0?s:[],[Ez.Provider,{value:o}]]}},[o,t]);return a.jsx(e,{...n,fillProps:r,bubblesVirtually:!0})}function Wge({__experimentalGroup:e,group:t="default",label:n,fillProps:o,...r}){e&&(Ke("`__experimentalGroup` property in `InspectorControlsSlot`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=e);const s=L_[t],i=H0(s?.name);if(!s)return globalThis.SCRIPT_DEBUG===!0&&zn(`Unknown InspectorControls group "${t}" provided.`),null;if(!i?.length)return null;const{Slot:c}=s;return n?a.jsx($St,{group:t,label:n,children:a.jsx(VSt,{...r,fillProps:o,Slot:c})}):a.jsx(c,{...r,fillProps:o,bubblesVirtually:!0})}const et=Tge;et.Slot=Wge;const j_=e=>a.jsx(Tge,{...e,group:"advanced"});j_.Slot=e=>a.jsx(Wge,{...e,group:"advanced"});j_.slotName="InspectorAdvancedControls";function HSt(e){const t=e?.style?.position?.type;return t==="sticky"?m("Sticky"):t==="fixed"?m("Fixed"):null}function ji(e){return G(t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(J),{getBlockType:r,getActiveBlockVariation:s}=t(kt),i=n(e),c=r(i);if(!c)return null;const l=o(e),u=s(i,l),d=Qd(c)||Hh(c),f=(d?iie(c,l):void 0)||c.title,b=HSt(l),h={isSynced:d,title:f,icon:c.icon,description:c.description,anchor:l?.anchor,positionLabel:b,positionType:l?.style?.position?.type,name:l?.metadata?.name};return u?{isSynced:d,title:u.title||c.title,icon:u.icon||c.icon,description:u.description||c.description,anchor:l?.anchor,positionLabel:b,positionType:l?.style?.position?.type,name:l?.metadata?.name}:h},[e])}const qO="position",$R={key:"default",value:"",name:m("Default")},VR={key:"sticky",value:"sticky",name:We("Sticky","Name for the value of the CSS position property"),hint:m("The block will stick to the top of the window instead of scrolling.")},Cee={key:"fixed",value:"fixed",name:We("Fixed","Name for the value of the CSS position property"),hint:m("The block will not move when the page is scrolled.")},USt=["top","right","bottom","left"],XSt=["sticky","fixed"];function GSt({selector:e,style:t}){let n="";const{type:o}=t?.position||{};return XSt.includes(o)&&(n+=`${e} {`,n+=`position: ${o};`,USt.forEach(r=>{t?.position?.[r]!==void 0&&(n+=`${r}: ${t.position[r]};`)}),(o==="sticky"||o==="fixed")&&(n+="z-index: 10"),n+="}"),n}function KSt(e){const t=An(e,qO);return!!(t===!0||t?.sticky)}function YSt(e){const t=An(e,qO);return!!(t===!0||t?.fixed)}function ZSt(e){return!!An(e,qO)}function QSt(e){const t=e?.style?.position?.type;return t==="sticky"||t==="fixed"}function Nge({name:e}={}){const[t,n]=Un("position.fixed","position.sticky"),o=!t&&!n;return!ZSt(e)||o}function JSt({style:e={},clientId:t,name:n,setAttributes:o}){const r=YSt(n),s=KSt(n),i=e?.position?.type,{firstParentClientId:c}=G(b=>{const{getBlockParents:h}=b(J),g=h(t);return{firstParentClientId:g[g.length-1]}},[t]),l=ji(c),u=s&&i===VR.value&&l?xe(m("The block will stick to the scrollable area of the parent %s block."),l.title):null,d=x.useMemo(()=>{const b=[$R];return(s||i===VR.value)&&b.push(VR),(r||i===Cee.value)&&b.push(Cee),b},[r,s,i]),p=b=>{const g={...e,position:{...e?.position,type:b,top:b==="sticky"||b==="fixed"?"0px":void 0}};o({style:Ii(g)})},f=i&&d.find(b=>b.value===i)||$R;return f0.select({web:d.length>1?a.jsx(et,{group:"position",children:a.jsx(no,{__nextHasNoMarginBottom:!0,help:u,children:a.jsx(ob,{__next40pxDefaultSize:!0,label:m("Position"),hideLabelFromVision:!0,describedBy:xe(m("Currently selected position: %s"),f.name),options:d,value:f,onChange:({selectedItem:b})=>{p(b.value)},size:"__unstable-large"})})}):null,native:null})}const Bge={edit:function(t){return Nge(t)?null:a.jsx(JSt,{...t})},useBlockProps:tCt,attributeKeys:["style"],hasSupport(e){return Tt(e,qO)}},eCt={};function tCt({name:e,style:t}){const n=Tt(e,qO),o=Nge({name:e}),r=n&&!o,s=vt(eCt),i=`.wp-container-${s}.wp-container-${s}`;let c;r&&(c=GSt({selector:i,style:t})||"");const l=oe({[`wp-container-${s}`]:r&&!!c,[`is-position-${t?.position?.type}`]:r&&!!c&&!!t?.position?.type});return EO({css:c}),{className:l}}const Lge={placement:"top-start"},qee={...Lge,flip:!1,shift:!0},nCt={...Lge,flip:!0,shift:!1};function Ree(e,t,n,o,r){if(!e||!t)return qee;const s=n?.scrollTop||0,i=h4(t),c=e.getBoundingClientRect(),l=s+c.top,u=e.ownerDocument.documentElement.clientHeight,d=l+o,p=i.top>d,f=i.height>u-o;return!r&&(p||f)?qee:nCt}function Pge({contentElement:e,clientId:t}){const n=Wi(t),[o,r]=x.useState(0),{blockIndex:s,isSticky:i}=G(f=>{const{getBlockIndex:b,getBlockAttributes:h}=f(J);return{blockIndex:b(t),isSticky:QSt(h(t))}},[t]),c=x.useMemo(()=>{if(e)return ps(e)},[e]),[l,u]=x.useState(()=>Ree(e,n,c,o,i)),d=Mn(f=>{r(f.offsetHeight)},[]),p=x.useCallback(()=>u(Ree(e,n,c,o,i)),[e,n,c,o]);return x.useLayoutEffect(p,[s,p]),x.useLayoutEffect(()=>{if(!e||!n)return;const f=e?.ownerDocument?.defaultView;f?.addEventHandler?.("resize",p);let b;const h=n?.ownerDocument?.defaultView;return h.ResizeObserver&&(b=new h.ResizeObserver(p),b.observe(n)),()=>{f?.removeEventHandler?.("resize",p),b&&b.disconnect()}},[p,e,n]),{...l,ref:d}}function jge(e){return G(n=>{const{getBlockRootClientId:o,getBlockParents:r,__experimentalGetBlockListSettingsForBlocks:s,isBlockInsertionPointVisible:i,getBlockInsertionPoint:c,getBlockOrder:l,hasMultiSelection:u,getLastMultiSelectedBlockClientId:d}=n(J),p=r(e),f=s(p),b=p.find(g=>f[g]?.__experimentalCaptureToolbars);let h=!1;if(i()){const g=c();h=l(g.rootClientId)[g.index]===e}return{capturingClientId:b,isInsertionPointVisible:h,lastClientId:u()?d():null,rootClientId:o(e)}},[e])}function oCt({clientId:e,__unstableContentRef:t}){const{capturingClientId:n,isInsertionPointVisible:o,lastClientId:r,rootClientId:s}=jge(e),i=Pge({contentElement:t?.current,clientId:e});return a.jsx(wm,{clientId:n||e,bottomClientId:r,className:oe("block-editor-block-list__block-side-inserter-popover",{"is-insertion-point-visible":o}),__unstableContentRef:t,...i,children:a.jsx("div",{className:"block-editor-block-list__empty-block-inserter",children:a.jsx(xm,{position:"bottom right",rootClientId:s,clientId:e,__experimentalIsQuick:!0})})})}const cv=50,Ige=25,rCt=1e3,Tee=rCt*(Ige/1e3);function sCt(){const e=x.useRef(null),t=x.useRef(null),n=x.useRef(null),o=x.useRef(null);x.useEffect(()=>()=>{o.current&&(clearInterval(o.current),o.current=null)},[]);const r=x.useCallback(c=>{e.current=c.clientY,n.current=ps(c.target),o.current=setInterval(()=>{if(n.current&&t.current){const l=n.current.scrollTop+t.current;n.current.scroll({top:l})}},Ige)},[]),s=x.useCallback(c=>{if(!n.current)return;const l=n.current.offsetHeight,u=e.current-n.current.offsetTop,d=c.clientY-n.current.offsetTop;if(c.clientY>u){const p=Math.max(l-u-cv,0),f=Math.max(d-u-cv,0),b=p===0||f===0?0:f/p;t.current=Tee*b}else if(c.clientY{e.current=null,n.current=null,o.current&&(clearInterval(o.current),o.current=null)}]}const Dge=({appendToOwnerDocument:e,children:t,clientIds:n,cloneClassname:o,elementId:r,onDragStart:s,onDragEnd:i,fadeWhenDisabled:c=!1,dragComponent:l})=>{const{srcRootClientId:u,isDraggable:d,icon:p,visibleInserter:f,getBlockType:b}=G(T=>{const{canMoveBlocks:E,getBlockRootClientId:B,getBlockName:N,getBlockAttributes:j,isBlockInsertionPointVisible:I}=T(J),{getBlockType:P,getActiveBlockVariation:$}=T(kt),F=B(n[0]),X=N(n[0]),Z=$(X,j(n[0]));return{srcRootClientId:F,isDraggable:E(n),icon:Z?.icon||P(X)?.icon,visibleInserter:I(),getBlockType:P}},[n]),h=x.useRef(!1),[g,z,A]=sCt(),{getAllowedBlocks:_,getBlockNamesByClientId:v,getBlockRootClientId:M}=G(J),{startDraggingBlocks:y,stopDraggingBlocks:k}=Oe(J);x.useEffect(()=>()=>{h.current&&k()},[]);const C=Wi(n[0])?.closest("body");if(x.useEffect(()=>{if(!C||!c)return;const E=RN(B=>{if(!B.target.closest("[data-block]"))return;const N=v(n),j=B.target.closest("[data-block]").getAttribute("data-block"),I=_(j),P=v([j])[0];let $;if(I?.length===0){const F=M(j),X=v([F])[0],Z=_(F);$=LW(b,Z,N,X)}else $=LW(b,I,N,P);!$&&!f?window?.document?.body?.classList?.add("block-draggable-invalid-drag-token"):window?.document?.body?.classList?.remove("block-draggable-invalid-drag-token")},200);return C.addEventListener("dragover",E),()=>{C.removeEventListener("dragover",E)}},[n,C,c,_,v,M,b,f]),!d)return t({draggable:!1});const R={type:"block",srcClientIds:n,srcRootClientId:u};return a.jsx(Hbe,{appendToOwnerDocument:e,cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:R,onDragStart:T=>{window.requestAnimationFrame(()=>{y(n),h.current=!0,g(T),s&&s()})},onDragOver:z,onDragEnd:()=>{k(),h.current=!1,A(),i&&i()},__experimentalDragComponent:l!==void 0?l:a.jsx(k7,{count:n.length,icon:p,fadeWhenDisabled:!0}),elementId:r,children:({onDraggableStart:T,onDraggableEnd:E})=>t({draggable:!0,onDragStart:T,onDragEnd:E})})},rd=(e,t)=>e==="up"?t==="horizontal"?jt()?"right":"left":"up":e==="down"?t==="horizontal"?jt()?"left":"right":"down":null;function iCt(e,t,n,o,r,s,i){const c=n+1;if(e>1)return aCt(e,n,o,r,s,i);if(o&&r)return xe(m("Block %s is the only block, and cannot be moved"),t);if(s>0&&!r){const l=rd("down",i);if(l==="down")return xe(m("Move %1$s block from position %2$d down to position %3$d"),t,c,c+1);if(l==="left")return xe(m("Move %1$s block from position %2$d left to position %3$d"),t,c,c+1);if(l==="right")return xe(m("Move %1$s block from position %2$d right to position %3$d"),t,c,c+1)}if(s>0&&r){const l=rd("down",i);if(l==="down")return xe(m("Block %1$s is at the end of the content and can’t be moved down"),t);if(l==="left")return xe(m("Block %1$s is at the end of the content and can’t be moved left"),t);if(l==="right")return xe(m("Block %1$s is at the end of the content and can’t be moved right"),t)}if(s<0&&!o){const l=rd("up",i);if(l==="up")return xe(m("Move %1$s block from position %2$d up to position %3$d"),t,c,c-1);if(l==="left")return xe(m("Move %1$s block from position %2$d left to position %3$d"),t,c,c-1);if(l==="right")return xe(m("Move %1$s block from position %2$d right to position %3$d"),t,c,c-1)}if(s<0&&o){const l=rd("up",i);if(l==="up")return xe(m("Block %1$s is at the beginning of the content and can’t be moved up"),t);if(l==="left")return xe(m("Block %1$s is at the beginning of the content and can’t be moved left"),t);if(l==="right")return xe(m("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}function aCt(e,t,n,o,r,s){const i=t+1;if(n&&o)return m("All blocks are selected, and cannot be moved");if(r>0&&!o){const c=rd("down",s);if(c==="down")return xe(m("Move %1$d blocks from position %2$d down by one place"),e,i);if(c==="left")return xe(m("Move %1$d blocks from position %2$d left by one place"),e,i);if(c==="right")return xe(m("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r>0&&o){const c=rd("down",s);if(c==="down")return m("Blocks cannot be moved down as they are already at the bottom");if(c==="left")return m("Blocks cannot be moved left as they are already are at the leftmost position");if(c==="right")return m("Blocks cannot be moved right as they are already are at the rightmost position")}if(r<0&&!n){const c=rd("up",s);if(c==="up")return xe(m("Move %1$d blocks from position %2$d up by one place"),e,i);if(c==="left")return xe(m("Move %1$d blocks from position %2$d left by one place"),e,i);if(c==="right")return xe(m("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r<0&&n){const c=rd("up",s);if(c==="up")return m("Blocks cannot be moved up as they are already at the top");if(c==="left")return m("Blocks cannot be moved left as they are already are at the leftmost position");if(c==="right")return m("Blocks cannot be moved right as they are already are at the rightmost position")}}const cCt=(e,t)=>e==="up"?t==="horizontal"?jt()?ma:Ll:Rw:e==="down"?t==="horizontal"?jt()?Ll:ma:tu:null,lCt=(e,t)=>e==="up"?t==="horizontal"?jt()?m("Move right"):m("Move left"):m("Move up"):e==="down"?t==="horizontal"?jt()?m("Move left"):m("Move right"):m("Move down"):null,Y7=x.forwardRef(({clientIds:e,direction:t,orientation:n,...o},r)=>{const s=vt(Y7),i=Array.isArray(e)?e:[e],c=i.length,{disabled:l}=o,{blockType:u,isDisabled:d,rootClientId:p,isFirst:f,isLast:b,firstIndex:h,orientation:g="vertical"}=G(y=>{const{getBlockIndex:k,getBlockRootClientId:S,getBlockOrder:C,getBlock:R,getBlockListSettings:T}=y(J),E=i[0],B=S(E),N=k(E),j=k(i[i.length-1]),I=C(B),P=R(E),$=N===0,F=j===I.length-1,{orientation:X}=T(B)||{};return{blockType:P?on(P.name):null,isDisabled:l||(t==="up"?$:F),rootClientId:B,firstIndex:N,isFirst:$,isLast:F,orientation:n||X}},[e,t]),{moveBlocksDown:z,moveBlocksUp:A}=Oe(J),_=t==="up"?A:z,v=y=>{_(e,p),o.onClick&&o.onClick(y)},M=`block-editor-block-mover-button__description-${s}`;return a.jsxs(a.Fragment,{children:[a.jsx(Ce,{__next40pxDefaultSize:!0,ref:r,className:oe("block-editor-block-mover-button",`is-${t}-button`),icon:cCt(t,g),label:lCt(t,g),"aria-describedby":M,...o,onClick:d?null:v,disabled:d,accessibleWhenDisabled:!0}),a.jsx(qn,{id:M,children:iCt(c,u&&u.title,h,f,b,t==="up"?-1:1,g)})]})}),Fge=x.forwardRef((e,t)=>a.jsx(Y7,{direction:"up",ref:t,...e})),$ge=x.forwardRef((e,t)=>a.jsx(Y7,{direction:"down",ref:t,...e}));function uCt({clientIds:e,hideDragHandle:t,isBlockMoverUpButtonDisabled:n,isBlockMoverDownButtonDisabled:o}){const{canMove:r,rootClientId:s,isFirst:i,isLast:c,orientation:l,isManualGrid:u}=G(d=>{var p;const{getBlockIndex:f,getBlockListSettings:b,canMoveBlocks:h,getBlockOrder:g,getBlockRootClientId:z,getBlockAttributes:A}=d(J),_=Array.isArray(e)?e:[e],v=_[0],M=z(v),y=f(v),k=f(_[_.length-1]),S=g(M),{layout:C={}}=(p=A(M))!==null&&p!==void 0?p:{};return{canMove:h(e),rootClientId:M,isFirst:y===0,isLast:k===S.length-1,orientation:b(M)?.orientation,isManualGrid:C.type==="grid"&&C.isManualPlacement&&window.__experimentalEnableGridInteractivity}},[e]);return!r||i&&c&&!s||t&&u?null:a.jsxs(Wn,{className:oe("block-editor-block-mover",{"is-horizontal":l==="horizontal"}),children:[!t&&a.jsx(Dge,{clientIds:e,fadeWhenDisabled:!0,children:d=>a.jsx(Ce,{__next40pxDefaultSize:!0,icon:Jue,className:"block-editor-block-mover__drag-handle",label:m("Drag"),tabIndex:"-1",...d})}),!u&&a.jsxs("div",{className:"block-editor-block-mover__move-button-container",children:[a.jsx(bs,{children:d=>a.jsx(Fge,{disabled:n,clientIds:e,...d})}),a.jsx(bs,{children:d=>a.jsx($ge,{disabled:o,clientIds:e,...d})})]})]})}const{clearTimeout:Eee,setTimeout:dCt}=window,Vge=200;function pCt({ref:e,isFocused:t,highlightParent:n,debounceTimeout:o=Vge}){const{getSelectedBlockClientId:r,getBlockRootClientId:s}=G(J),{toggleBlockHighlight:i}=Oe(J),c=x.useRef(),l=G(g=>g(J).getSettings().isDistractionFree,[]),u=g=>{if(g&&l)return;const z=r(),A=n?s(z):z;i(A,g)},d=()=>e?.current&&e.current.matches(":hover"),p=()=>{const g=d();return!t&&!g},f=()=>{const g=c.current;g&&Eee&&Eee(g)},b=g=>{g&&g.stopPropagation(),f(),u(!0)},h=g=>{g&&g.stopPropagation(),f(),c.current=dCt(()=>{p()&&u(!1)},o)};return x.useEffect(()=>()=>{u(!1),f()},[]),{debouncedShowGestures:b,debouncedHideGestures:h}}function Z7({ref:e,highlightParent:t=!1,debounceTimeout:n=Vge}){const[o,r]=x.useState(!1),{debouncedShowGestures:s,debouncedHideGestures:i}=pCt({ref:e,debounceTimeout:n,isFocused:o,highlightParent:t}),c=x.useRef(!1),l=()=>e?.current&&e.current.contains(e.current.ownerDocument.activeElement);return x.useEffect(()=>{const u=e.current,d=()=>{l()&&(r(!0),s())},p=()=>{l()||(r(!1),i())};return u&&!c.current&&(u.addEventListener("focus",d,!0),u.addEventListener("blur",p,!0),c.current=!0),()=>{u&&(u.removeEventListener("focus",d),u.removeEventListener("blur",p))}},[e,c,r,s,i]),{onMouseMove:s,onMouseLeave:i}}function fCt(){const{selectBlock:e}=Oe(J),{parentClientId:t}=G(s=>{const{getBlockParents:i,getSelectedBlockClientId:c,getParentSectionBlock:l}=ct(s(J)),u=c(),d=l(u),p=i(u);return{parentClientId:d??p[p.length-1]}},[]),n=ji(t),o=x.useRef(),r=Z7({ref:o,highlightParent:!0});return a.jsx("div",{className:"block-editor-block-parent-selector",ref:o,...r,children:a.jsx(Vt,{className:"block-editor-block-parent-selector__button",onClick:()=>e(t),label:xe(m("Select parent block: %s"),n?.title),showTooltip:!0,icon:a.jsx(Zn,{icon:n?.icon})})},t)}function Hge({blocks:e}){return Yn("medium","<")?null:a.jsx("div",{className:"block-editor-block-switcher__popover-preview-container",children:a.jsx(Io,{className:"block-editor-block-switcher__popover-preview",placement:"right-start",focusOnMount:!1,offset:16,children:a.jsxs("div",{className:"block-editor-block-switcher__preview",children:[a.jsx("div",{className:"block-editor-block-switcher__preview-title",children:m("Preview")}),a.jsx(Vd,{viewportWidth:500,blocks:e})]})})})}const bCt={};function hCt({clientIds:e,blocks:t}){const{activeBlockVariation:n,blockVariationTransformations:o}=G(s=>{const{getBlockAttributes:i,canRemoveBlocks:c}=s(J),{getActiveBlockVariation:l,getBlockVariations:u}=s(kt),d=c(e);if(t.length!==1||!d)return bCt;const[p]=t;return{blockVariationTransformations:u(p.name,"transform"),activeBlockVariation:l(p.name,i(p.clientId))}},[e,t]);return x.useMemo(()=>o?.filter(({name:s})=>s!==n?.name),[o,n])}const mCt=({transformations:e,onSelect:t,blocks:n})=>{const[o,r]=x.useState();return a.jsxs(a.Fragment,{children:[o&&a.jsx(Hge,{blocks:jo(n[0],e.find(({name:s})=>s===o).attributes)}),e?.map(s=>a.jsx(gCt,{item:s,onSelect:t,setHoveredTransformItemName:r},s.name))]})};function gCt({item:e,onSelect:t,setHoveredTransformItemName:n}){const{name:o,icon:r,title:s}=e;return a.jsxs(Ct,{className:jB(o),onClick:i=>{i.preventDefault(),t(o)},onMouseLeave:()=>n(null),onMouseEnter:()=>n(o),children:[a.jsx(Zn,{icon:r,showColors:!0}),s]})}function MCt(e){const t={"core/paragraph":1,"core/heading":2,"core/list":3,"core/quote":4},n=x.useMemo(()=>{const o=Object.keys(t),r=e.reduce((s,i)=>{const{name:c}=i;return o.includes(c)?s.priorityTextTransformations.push(i):s.restTransformations.push(i),s},{priorityTextTransformations:[],restTransformations:[]});if(r.priorityTextTransformations.length===1&&r.priorityTextTransformations[0].name==="core/quote"){const s=r.priorityTextTransformations.pop();r.restTransformations.push(s)}return r},[e]);return n.priorityTextTransformations.sort(({name:o},{name:r})=>t[o]{const[i,c]=x.useState(),{priorityTextTransformations:l,restTransformations:u}=MCt(t),d=l.length&&u.length,p=!!u.length&&a.jsx(OCt,{restTransformations:u,onSelect:o,setHoveredTransformItemName:c});return a.jsxs(a.Fragment,{children:[a.jsxs(Cn,{label:m("Transform to"),className:e,children:[i&&a.jsx(Hge,{blocks:Kr(s,i)}),!!n?.length&&a.jsx(mCt,{transformations:n,blocks:s,onSelect:r}),l.map(f=>a.jsx(Uge,{item:f,onSelect:o,setHoveredTransformItemName:c},f.name)),!d&&p]}),!!d&&a.jsx(Cn,{className:e,children:p})]})};function OCt({restTransformations:e,onSelect:t,setHoveredTransformItemName:n}){return e.map(o=>a.jsx(Uge,{item:o,onSelect:t,setHoveredTransformItemName:n},o.name))}function Uge({item:e,onSelect:t,setHoveredTransformItemName:n}){const{name:o,icon:r,title:s,isDisabled:i}=e;return a.jsxs(Ct,{className:jB(o),onClick:c=>{c.preventDefault(),t(o)},disabled:i,onMouseLeave:()=>n(null),onMouseEnter:()=>n(o),children:[a.jsx(Zn,{icon:r,showColors:!0}),s]})}class I_{constructor(t=""){this._currentValue="",this._valueAsArray=[],this.value=t}entries(...t){return this._valueAsArray.entries(...t)}forEach(...t){return this._valueAsArray.forEach(...t)}keys(...t){return this._valueAsArray.keys(...t)}values(...t){return this._valueAsArray.values(...t)}get value(){return this._currentValue}set value(t){t=String(t),this._valueAsArray=[...new Set(t.split(/\s+/g).filter(Boolean))],this._currentValue=this._valueAsArray.join(" ")}get length(){return this._valueAsArray.length}toString(){return this.value}*[Symbol.iterator](){return yield*this._valueAsArray}item(t){return this._valueAsArray[t]}contains(t){return this._valueAsArray.indexOf(t)!==-1}add(...t){this.value+=" "+t.join(" ")}remove(...t){this.value=this._valueAsArray.filter(n=>!t.includes(n)).join(" ")}toggle(t,n){return n===void 0&&(n=!this.contains(t)),n?this.add(t):this.remove(t),n}replace(t,n){return this.contains(t)?(this.remove(t),this.add(n),!0):!1}supports(t){return!0}}function yCt(e,t){for(const n of new I_(t).values()){if(n.indexOf("is-style-")===-1)continue;const o=n.substring(9),r=e?.find(({name:s})=>s===o);if(r)return r}return Xge(e)}function Q7(e,t,n){const o=new I_(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function ACt(e){return!e||e.length===0?[]:Xge(e)?e:[{name:"default",label:We("Default","block style"),isDefault:!0},...e]}function Xge(e){return e?.find(t=>t.isDefault)}function vCt(e,t){return x.useMemo(()=>{const n=t?.example,o=t?.name;if(n&&o)return LB(o,{attributes:n.attributes,innerBlocks:n.innerBlocks});if(e)return jo(e)},[t?.example?e?.name:e,t])}function J7({clientId:e,onSwitch:t}){const n=f=>{const{getBlock:b}=f(J),h=b(e);if(!h)return{};const g=on(h.name),{getBlockStyles:z}=f(kt);return{block:h,blockType:g,styles:z(h.name),className:h.attributes.className||""}},{styles:o,block:r,blockType:s,className:i}=G(n,[e]),{updateBlockAttributes:c}=Oe(J),l=ACt(o),u=yCt(l,i),d=vCt(r,s);return{onSelect:f=>{const b=Q7(i,u,f);c(e,{className:b}),t()},stylesToRender:l,activeStyle:u,genericPreviewBlock:d,className:i}}const xCt=()=>{};function wCt({clientId:e,onSwitch:t=xCt}){const{onSelect:n,stylesToRender:o,activeStyle:r}=J7({clientId:e,onSwitch:t});return!o||o.length===0?null:a.jsx(a.Fragment,{children:o.map(s=>{const i=s.label||s.name;return a.jsx(Ct,{icon:r.name===s.name?M0:null,onClick:()=>n(s),children:a.jsx(Sn,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0,children:i})},s.name)})})}function _Ct({hoveredBlock:e,onSwitch:t}){const{clientId:n}=e;return a.jsx(Cn,{label:m("Styles"),className:"block-editor-block-switcher__styles__menugroup",children:a.jsx(wCt,{clientId:n,onSwitch:t})})}const Gge=(e,t,n=new Set)=>{const{clientId:o,name:r,innerBlocks:s=[]}=e;if(!n.has(o)){if(r===t)return e;for(const i of s){const c=Gge(i,t,n);if(c)return c}}},kCt=(e,t)=>{const n=gLe(e,"content");return n?.length?n.reduce((o,r)=>(t[r]&&(o[r]=t[r]),o),{}):t},SCt=(e,t)=>{const n=kCt(t.name,t.attributes);e.attributes={...e.attributes,...n}},CCt=(e,t)=>{const n=t.map(r=>jo(r)),o=new Set;for(const r of e){let s=!1;for(const i of n){const c=Gge(i,r.name,o);if(c){s=!0,o.add(c.clientId),SCt(c,r);break}}if(!s)return}return n},qCt=(e,t)=>x.useMemo(()=>e.reduce((n,o)=>{const r=CCt(t,o.blocks);return r&&n.push({...o,transformedBlocks:r}),n},[]),[e,t]);function RCt({blocks:e,patterns:t,onSelect:n}){const[o,r]=x.useState(!1),s=qCt(t,e);return s.length?a.jsxs(Cn,{className:"block-editor-block-switcher__pattern__transforms__menugroup",children:[o&&a.jsx(TCt,{patterns:s,onSelect:n}),a.jsx(Ct,{onClick:i=>{i.preventDefault(),r(!o)},icon:ma,children:m("Patterns")})]}):null}function TCt({patterns:e,onSelect:t}){const n=Yn("medium","<");return a.jsx("div",{className:"block-editor-block-switcher__popover-preview-container",children:a.jsx(Io,{className:"block-editor-block-switcher__popover-preview",placement:n?"bottom":"right-start",offset:16,children:a.jsx("div",{className:"block-editor-block-switcher__preview is-pattern-list-preview",children:a.jsx(ECt,{patterns:e,onSelect:t})})})})}function ECt({patterns:e,onSelect:t}){return a.jsx(C1,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":m("Patterns list"),children:e.map(n=>a.jsx(Kge,{pattern:n,onSelect:t},n.name))})}function Kge({pattern:e,onSelect:t}){const n="block-editor-block-switcher__preview-patterns-container",o=vt(Kge,`${n}-list__item-description`);return a.jsxs("div",{className:`${n}-list__list-item`,children:[a.jsxs(C1.Item,{render:a.jsx("div",{role:"option","aria-label":e.title,"aria-describedby":e.description?o:void 0,className:`${n}-list__item`}),onClick:()=>t(e.transformedBlocks),children:[a.jsx(Vd,{blocks:e.transformedBlocks,viewportWidth:e.viewportWidth||500}),a.jsx("div",{className:`${n}-list__item-title`,children:e.title})]}),!!e.description&&a.jsx(qn,{id:o,children:e.description})]})}function WCt({onClose:e,clientIds:t,hasBlockStyles:n,canRemove:o}){const{replaceBlocks:r,multiSelect:s,updateBlockAttributes:i}=Oe(J),{possibleBlockTransformations:c,patterns:l,blocks:u,isUsingBindings:d}=G(C=>{const{getBlockAttributes:R,getBlocksByClientId:T,getBlockRootClientId:E,getBlockTransformItems:B,__experimentalGetPatternTransformItems:N}=C(J),j=E(t[0]),I=T(t);return{blocks:I,possibleBlockTransformations:B(I,j),patterns:N(I,j),isUsingBindings:t.every(P=>!!R(P)?.metadata?.bindings)}},[t]),p=hCt({clientIds:t,blocks:u});function f(C){C.length>1&&s(C[0].clientId,C[C.length-1].clientId)}function b(C){const R=Kr(u,C);r(t,R),f(R)}function h(C){i(u[0].clientId,{...p.find(({name:R})=>R===C).attributes})}function g(C){r(t,C),f(C)}const z=u.length===1,A=z&&Hh(u[0]),_=!!c.length&&o&&!A,v=!!p?.length,M=!!l?.length&&o,y=_||v;if(!(n||y||M))return a.jsx("p",{className:"block-editor-block-switcher__no-transforms",children:m("No transforms.")});const S=We(z?"This block is connected.":"These blocks are connected.","block toolbar button label and description");return a.jsxs("div",{className:"block-editor-block-switcher__container",children:[M&&a.jsx(RCt,{blocks:u,patterns:l,onSelect:C=>{g(C),e()}}),y&&a.jsx(zCt,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:c,possibleBlockVariationTransformations:p,blocks:u,onSelect:C=>{b(C),e()},onSelectVariation:C=>{h(C),e()}}),n&&a.jsx(_Ct,{hoveredBlock:u[0],onSwitch:e}),d&&a.jsx(Cn,{children:a.jsx(Sn,{className:"block-editor-block-switcher__binding-indicator",children:S})})]})}const NCt=({clientIds:e})=>{const{hasContentOnlyLocking:t,canRemove:n,hasBlockStyles:o,icon:r,invalidBlocks:s,isReusable:i,isTemplate:c,isDisabled:l}=G(z=>{const{getTemplateLock:A,getBlocksByClientId:_,getBlockAttributes:v,canRemoveBlocks:M,getBlockEditingMode:y}=z(J),{getBlockStyles:k,getBlockType:S,getActiveBlockVariation:C}=z(kt),R=_(e);if(!R.length||R.some(P=>!P))return{invalidBlocks:!0};const[{name:T}]=R,E=R.length===1,B=S(T),N=y(e[0]);let j,I;if(E)j=C(T,v(e[0]))?.icon||B.icon,I=A(e[0])==="contentOnly";else{const P=new Set(R.map(({name:$})=>$)).size===1;I=e.some($=>A($)==="contentOnly"),j=P?B.icon:H3}return{canRemove:M(e),hasBlockStyles:E&&!!k(T)?.length,icon:j,isReusable:E&&Qd(R[0]),isTemplate:E&&Hh(R[0]),hasContentOnlyLocking:I,isDisabled:N!=="default"}},[e]),u=Fd({clientId:e?.[0],maximumLength:35}),d=G(z=>z(ht).get("core","showIconLabels"),[]);if(s)return null;const p=e.length===1,f=p?u:m("Multiple blocks selected"),b=(i||c)&&!d&&u?u:void 0;if(l||!o&&!n||t)return a.jsx(Wn,{children:a.jsx(Vt,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:f,icon:a.jsx(Zn,{className:"block-editor-block-switcher__toggle",icon:r,showColors:!0}),text:b})});const g=p?m("Change block type or style"):xe(Dn("Change type of %d block","Change type of %d blocks",e.length),e.length);return a.jsx(Wn,{children:a.jsx(bs,{children:z=>a.jsx(c0,{className:"block-editor-block-switcher",label:f,popoverProps:{placement:"bottom-start",className:"block-editor-block-switcher__popover"},icon:a.jsx(Zn,{className:"block-editor-block-switcher__toggle",icon:r,showColors:!0}),text:b,toggleProps:{description:g,...z},menuProps:{orientation:"both"},children:({onClose:A})=>a.jsx(WCt,{onClose:A,clientIds:e,hasBlockStyles:o,canRemove:n})})})})},BCt=Qn("BlockControls"),LCt=Qn("BlockControlsBlock"),PCt=Qn("BlockFormatControls"),jCt=Qn("BlockControlsOther"),ICt=Qn("BlockControlsParent"),IW={default:BCt,block:LCt,inline:PCt,other:jCt,parent:ICt};function DCt(e,t){const n=j0();return n[J5]?IW[e]?.Fill:n[GB]&&t?IW.parent.Fill:null}function FCt({group:e="default",controls:t,children:n,__experimentalShareWithChildBlocks:o=!1}){const r=DCt(e,o);if(!r)return null;const s=a.jsxs(a.Fragment,{children:[e==="default"&&a.jsx(Wn,{controls:t}),n]});return a.jsx(Jf,{document,children:a.jsx(r,{children:i=>{const{forwardedContext:c=[]}=i;return c.reduce((l,[u,d])=>a.jsx(u,{...d,children:l}),s)}})})}const{ComponentsContext:Wee}=ct(tr);function $Ct({group:e="default",...t}){const n=x.useContext(jd),o=x.useContext(Wee),r=x.useMemo(()=>({forwardedContext:[[jd.Provider,{value:n}],[Wee.Provider,{value:o}]]}),[n,o]),s=IW[e],i=H0(s.name);if(!s)return globalThis.SCRIPT_DEBUG===!0&&zn(`Unknown BlockControls group "${e}" provided.`),null;if(!i?.length)return null;const{Slot:c}=s,l=a.jsx(c,{...t,bubblesVirtually:!0,fillProps:r});return e==="default"?l:a.jsx(Wn,{children:l})}const bt=FCt;bt.Slot=$Ct;const{Fill:eI,Slot:VCt}=Qn("__unstableBlockToolbarLastItem");eI.Slot=VCt;const HCt="align",Yge="__experimentalBorder",D_="color",UCt="customClassName",Zge="typography.__experimentalFontFamily",Qge="typography.fontSize",XCt="typography.lineHeight",GCt="typography.__experimentalFontStyle",KCt="typography.__experimentalFontWeight",Jge="typography.textAlign",YCt="typography.textColumns",ZCt="typography.__experimentalTextDecoration",QCt="typography.__experimentalWritingMode",JCt="typography.__experimentalTextTransform",eqt="typography.__experimentalLetterSpacing",tqt="layout",nqt=[XCt,Qge,GCt,KCt,Zge,Jge,YCt,ZCt,JCt,QCt,eqt],oqt=["shadow"],rqt="spacing",sqt=[...oqt,...nqt,Yge,D_,rqt],iqt=e=>Tt(e,HCt);function aqt(e,t="any"){const n=An(e,Yge);return n===!0?!0:t==="any"?!!(n?.color||n?.radius||n?.width||n?.style):!!n?.[t]}const cqt=e=>{const t=An(e,D_);return t!==null&&typeof t=="object"&&!!t.gradients},lqt=e=>{const t=An(e,D_);return t&&t.background!==!1},uqt=e=>Tt(e,Jge),dqt=e=>{const t=An(e,D_);return t&&t.text!==!1},pqt=e=>Tt(e,UCt,!0),fqt=e=>Tt(e,Zge),bqt=e=>Tt(e,Qge),hqt=e=>Tt(e,tqt),mqt=e=>sqt.some(t=>Tt(e,t));function gqt(e){try{const t=Ko(e,{__unstableSkipMigrationLogs:!0,__unstableSkipAutop:!0});return!(t.length===1&&t[0].name==="core/freeform")}catch{return!1}}const Mqt={align:iqt,borderColor:e=>aqt(e,"color"),backgroundColor:lqt,textAlign:uqt,textColor:dqt,gradient:cqt,className:pqt,fontFamily:fqt,fontSize:bqt,layout:hqt,style:mqt};function zqt(e,t){return Object.entries(Mqt).reduce((n,[o,r])=>(r(e.name)&&r(t.name)&&(n[o]=e.attributes[o]),n),{})}function DW(e,t,n){for(let o=0;o{let i="";try{if(!window.navigator.clipboard){r(m("Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers."),{type:"snackbar"});return}i=await window.navigator.clipboard.readText()}catch{r(m("Unable to paste styles. Please allow browser clipboard permissions before continuing."),{type:"snackbar"});return}if(!i||!gqt(i)){o(m("Unable to paste styles. Block styles couldn't be found within the copied content."),{type:"snackbar"});return}const c=Ko(i);if(c.length===1?e.batch(()=>{DW(s,s.map(()=>c[0]),t)}):e.batch(()=>{DW(s,c,t)}),s.length===1){const l=on(s[0].name)?.title;n(xe(m("Pasted styles to %s."),l),{type:"snackbar"})}else n(xe(m("Pasted styles to %d blocks."),s.length),{type:"snackbar"})},[e.batch,t,n,o,r])}function yqt({clientIds:e,children:t,__experimentalUpdateSelection:n}){const{getDefaultBlockName:o,getGroupingBlockName:r}=G(kt),s=G(v=>{const{canInsertBlockType:M,getBlockRootClientId:y,getBlocksByClientId:k,getDirectInsertBlock:S,canRemoveBlocks:C}=v(J),R=k(e),T=y(e[0]),E=M(o(),T),B=T?S(T):null;return{canRemove:C(e),canInsertBlock:E||!!B,canCopyStyles:R.every(N=>!!N&&(Tt(N.name,"color")||Tt(N.name,"typography"))),canDuplicate:R.every(N=>!!N&&Tt(N.name,"multiple",!0)&&M(N.name,T))}},[e,o]),{getBlocksByClientId:i,getBlocks:c}=G(J),{canRemove:l,canInsertBlock:u,canCopyStyles:d,canDuplicate:p}=s,{removeBlocks:f,replaceBlocks:b,duplicateBlocks:h,insertAfterBlock:g,insertBeforeBlock:z,flashBlock:A}=Oe(J),_=Oqt();return t({canCopyStyles:d,canDuplicate:p,canInsertBlock:u,canRemove:l,onDuplicate(){return h(e,n)},onRemove(){return f(e,n)},onInsertBefore(){z(e[0])},onInsertAfter(){g(e[e.length-1])},onGroup(){if(!e.length)return;const v=r(),M=Kr(i(e),v);M&&b(e,M)},onUngroup(){if(!e.length)return;const v=c(e[0]);v.length&&b(e,v)},onCopy(){e.length===1&&A(e[0])},async onPasteStyles(){await _(i(e))}})}const eMe=Qn(Symbol("CommentIconSlotFill"));function Aqt({clientId:e}){const t=G(o=>o(J).getBlock(e),[e]),{replaceBlocks:n}=Oe(J);return!t||t.name!=="core/html"?null:a.jsx(Ct,{onClick:()=>n(e,O3({HTML:Y5(t)})),children:m("Convert to Blocks")})}const{Fill:F_,Slot:vqt}=Qn("__unstableBlockSettingsMenuFirstItem");F_.Slot=vqt;function tMe(e){return G(t=>{const{getBlocksByClientId:n,getSelectedBlockClientIds:o,isUngroupable:r,isGroupable:s}=t(J),{getGroupingBlockName:i,getBlockType:c}=t(kt),l=e?.length?e:o(),u=n(l),[d]=u,p=l.length===1&&r(l[0]);return{clientIds:l,isGroupable:s(l),isUngroupable:p,blocksSelection:u,groupingBlockName:i(),onUngroup:p&&c(d.name)?.transforms?.ungroup}},[e])}const xqt={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"},grid:{type:"grid"}};function wqt(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=tMe(),{replaceBlocks:r}=Oe(J),{canRemove:s,variations:i}=G(h=>{const{canRemoveBlocks:g}=h(J),{getBlockVariations:z}=h(kt);return{canRemove:g(t),variations:z(n,"transform")}},[t,n]),c=h=>{const g=Kr(e,n);typeof h!="string"&&(h="group"),g&&g.length>0&&(g[0].attributes.layout=xqt[h],r(t,g))},l=()=>c("row"),u=()=>c("stack"),d=()=>c("grid");if(!o||!s)return null;const p=!!i.find(({name:h})=>h==="group-row"),f=!!i.find(({name:h})=>h==="group-stack"),b=!!i.find(({name:h})=>h==="group-grid");return a.jsxs(Wn,{children:[a.jsx(Vt,{icon:Zf,label:We("Group","action: convert blocks to group"),onClick:c}),p&&a.jsx(Vt,{icon:Tde,label:We("Row","action: convert blocks to row"),onClick:l}),f&&a.jsx(Vt,{icon:Pde,label:We("Stack","action: convert blocks to stack"),onClick:u}),b&&a.jsx(Vt,{icon:X3,label:We("Grid","action: convert blocks to grid"),onClick:d})]})}function _qt({clientIds:e,isGroupable:t,isUngroupable:n,onUngroup:o,blocksSelection:r,groupingBlockName:s,onClose:i=()=>{}}){const{getSelectedBlockClientIds:c}=G(J),{replaceBlocks:l}=Oe(J),u=()=>{const f=Kr(r,s);f&&l(e,f)},d=()=>{let f=r[0].innerBlocks;f.length&&(o&&(f=o(r[0].attributes,r[0].innerBlocks)),l(e,f))};if(!t&&!n)return null;const p=c();return a.jsxs(a.Fragment,{children:[t&&a.jsx(Ct,{shortcut:p.length>1?j1.primary("g"):void 0,onClick:()=>{u(),i()},children:We("Group","verb")}),n&&a.jsx(Ct,{onClick:()=>{d(),i()},children:We("Ungroup","Ungrouping blocks from within a grouping block back into individual blocks within the Editor")})]})}function km(e){return G(t=>{const{canEditBlock:n,canMoveBlock:o,canRemoveBlock:r,canLockBlockType:s,getBlockName:i,getTemplateLock:c}=t(J),l=n(e),u=o(e),d=r(e);return{canEdit:l,canMove:u,canRemove:d,canLock:s(i(e)),isContentLocked:c(e)==="contentOnly",isLocked:!l||!u||!d}},[e])}const kqt=["core/navigation"];function Sqt(e){return e.remove&&e.move?"all":e.remove&&!e.move?"insert":!1}function nMe({clientId:e,onClose:t}){const[n,o]=x.useState({move:!1,remove:!1}),{canEdit:r,canMove:s,canRemove:i}=km(e),{allowsEditLocking:c,templateLock:l,hasTemplateLock:u}=G(z=>{const{getBlockName:A,getBlockAttributes:_}=z(J),v=A(e),M=on(v);return{allowsEditLocking:kqt.includes(v),templateLock:_(e)?.templateLock,hasTemplateLock:!!M?.attributes?.templateLock}},[e]),[d,p]=x.useState(!!l),{updateBlockAttributes:f}=Oe(J),b=ji(e);x.useEffect(()=>{o({move:!s,remove:!i,...c?{edit:!r}:{}})},[r,s,i,c]);const h=Object.values(n).every(Boolean),g=Object.values(n).some(Boolean)&&!h;return a.jsx(Zo,{title:xe(m("Lock %s"),b.title),overlayClassName:"block-editor-block-lock-modal",onRequestClose:t,children:a.jsxs("form",{onSubmit:z=>{z.preventDefault(),f([e],{lock:n,templateLock:d?Sqt(n):void 0}),t()},children:[a.jsxs("fieldset",{className:"block-editor-block-lock-modal__options",children:[a.jsx("legend",{children:m("Select the features you want to lock")}),a.jsx("ul",{role:"list",className:"block-editor-block-lock-modal__checklist",children:a.jsxs("li",{children:[a.jsx(K0,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__options-all",label:m("Lock all"),checked:h,indeterminate:g,onChange:z=>o({move:z,remove:z,...c?{edit:z}:{}})}),a.jsxs("ul",{role:"list",className:"block-editor-block-lock-modal__checklist",children:[c&&a.jsxs("li",{className:"block-editor-block-lock-modal__checklist-item",children:[a.jsx(K0,{__nextHasNoMarginBottom:!0,label:m("Lock editing"),checked:!!n.edit,onChange:z=>o(A=>({...A,edit:z}))}),a.jsx(qo,{className:"block-editor-block-lock-modal__lock-icon",icon:n.edit?Qv:SM})]}),a.jsxs("li",{className:"block-editor-block-lock-modal__checklist-item",children:[a.jsx(K0,{__nextHasNoMarginBottom:!0,label:m("Lock movement"),checked:n.move,onChange:z=>o(A=>({...A,move:z}))}),a.jsx(qo,{className:"block-editor-block-lock-modal__lock-icon",icon:n.move?Qv:SM})]}),a.jsxs("li",{className:"block-editor-block-lock-modal__checklist-item",children:[a.jsx(K0,{__nextHasNoMarginBottom:!0,label:m("Lock removal"),checked:n.remove,onChange:z=>o(A=>({...A,remove:z}))}),a.jsx(qo,{className:"block-editor-block-lock-modal__lock-icon",icon:n.remove?Qv:SM})]})]})]})}),u&&a.jsx(lt,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__template-lock",label:m("Apply to all blocks inside"),checked:d,disabled:n.move&&!n.remove,onChange:()=>p(!d)})]}),a.jsxs(Yo,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1,children:[a.jsx(Tn,{children:a.jsx(Ce,{variant:"tertiary",onClick:t,__next40pxDefaultSize:!0,children:m("Cancel")})}),a.jsx(Tn,{children:a.jsx(Ce,{variant:"primary",type:"submit",__next40pxDefaultSize:!0,children:m("Apply")})})]})]})})}function Cqt({clientId:e}){const{canLock:t,isLocked:n}=km(e),[o,r]=x.useReducer(i=>!i,!1);if(!t)return null;const s=m(n?"Unlock":"Lock");return a.jsxs(a.Fragment,{children:[a.jsx(Ct,{icon:n?SM:bQe,onClick:r,"aria-expanded":o,"aria-haspopup":"dialog",children:s}),o&&a.jsx(nMe,{clientId:e,onClose:r})]})}function qqt({clientId:e}){const{canLock:t,isLocked:n}=km(e),[o,r]=x.useReducer(c=>!c,!1),s=x.useRef(!1);if(x.useEffect(()=>{n&&(s.current=!0)},[n]),!n&&!s.current)return null;let i=m(n?"Unlock":"Lock");return!t&&n&&(i=m("Locked")),a.jsxs(a.Fragment,{children:[a.jsx(Wn,{className:"block-editor-block-lock-toolbar",children:a.jsx(Vt,{disabled:!t,icon:n?Qv:SM,label:i,onClick:r,"aria-expanded":o,"aria-haspopup":"dialog"})}),o&&a.jsx(nMe,{clientId:e,onClose:r})]})}const Rqt=()=>{};function Tqt({clientId:e,onToggle:t=Rqt}){const{blockType:n,mode:o,isCodeEditingEnabled:r}=G(c=>{const{getBlock:l,getBlockMode:u,getSettings:d}=c(J),p=l(e);return{mode:u(e),blockType:p?on(p.name):null,isCodeEditingEnabled:d().codeEditingEnabled}},[e]),{toggleBlockMode:s}=Oe(J);if(!n||!Tt(n,"html",!0)||!r)return null;const i=m(o==="visual"?"Edit as HTML":"Edit visually");return a.jsx(Ct,{onClick:()=>{s(e),t()},children:i})}function Eqt({clientId:e,onClose:t}){const{templateLock:n,isLockedByParent:o,isEditingAsBlocks:r}=G(u=>{const{getContentLockingParent:d,getTemplateLock:p,getTemporarilyEditingAsBlocks:f}=ct(u(J));return{templateLock:p(e),isLockedByParent:!!d(e),isEditingAsBlocks:f()===e}},[e]),s=Oe(J),i=!o&&n==="contentOnly";if(!i&&!r)return null;const{modifyContentLockBlock:c}=ct(s);return!r&&i&&a.jsx(Ct,{onClick:()=>{c(e),t()},children:We("Modify","Unlock content locked blocks")})}function Wqt(e){return e?.trim()?.length===0}function Nqt({clientId:e,onClose:t}){const[n,o]=x.useState(),r=ji(e),{metadata:s}=G(z=>{const{getBlockAttributes:A}=z(J);return{metadata:A(e)?.metadata}},[e]),{updateBlockAttributes:i}=Oe(J),c=s?.name||"",l=r?.title,u=!!c&&!!s?.bindings&&Object.values(s.bindings).some(z=>z.source==="core/pattern-overrides"),d=n!==void 0&&n!==c,p=n===l,f=Wqt(n),b=d||p,h=z=>z.target.select(),g=()=>{const z=p||f?void 0:n,A=xe(m(p||f?'Block name reset to: "%s".':'Block name changed to: "%s".'),n);Yt(A,"assertive"),i([e],{metadata:{...s,name:z}}),t()};return a.jsx(Zo,{title:m("Rename"),onRequestClose:t,overlayClassName:"block-editor-block-rename-modal",focusOnMount:"firstContentElement",size:"small",children:a.jsx("form",{onSubmit:z=>{z.preventDefault(),b&&g()},children:a.jsxs(dt,{spacing:"3",children:[a.jsx(dn,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:n??c,label:m("Name"),help:u?m("This block allows overrides. Changing the name can cause problems with content entered into instances of this pattern."):void 0,placeholder:l,onChange:o,onFocus:h}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,children:m("Cancel")}),a.jsx(Ce,{__next40pxDefaultSize:!0,accessibleWhenDisabled:!0,disabled:!b,variant:"primary",type:"submit",children:m("Save")})]})]})})})}function Bqt({clientId:e}){const[t,n]=x.useState(!1);return a.jsxs(a.Fragment,{children:[a.jsx(Ct,{onClick:()=>{n(!0)},"aria-expanded":t,"aria-haspopup":"dialog",children:m("Rename")}),t&&a.jsx(Nqt,{clientId:e,onClose:()=>n(!1)})]})}function Lqt(e){return{canRename:An(e,"renaming",!0)}}const{Fill:Pqt,Slot:jqt}=Qn("BlockSettingsMenuControls"),Iqt=({fillProps:e,clientIds:t=null})=>{const{selectedBlocks:n,selectedClientIds:o,isContentOnly:r}=G(b=>{const{getBlockNamesByClientId:h,getSelectedBlockClientIds:g,getBlockEditingMode:z}=b(J),A=t!==null?t:g();return{selectedBlocks:h(A),selectedClientIds:A,isContentOnly:z(A[0])==="contentOnly"}},[t]),{canLock:s}=km(o[0]),{canRename:i}=Lqt(n[0]),c=o.length===1&&s&&!r,l=o.length===1&&i&&!r,u=tMe(o),{isGroupable:d,isUngroupable:p}=u,f=(d||p)&&!r;return a.jsx(jqt,{fillProps:{...e,selectedBlocks:n,selectedClientIds:o},children:b=>!b?.length>0&&!f&&!c?null:a.jsxs(Cn,{children:[f&&a.jsx(_qt,{...u,onClose:e?.onClose}),c&&a.jsx(Cqt,{clientId:o[0]}),l&&a.jsx(Bqt,{clientId:o[0]}),b,o.length===1&&a.jsx(Eqt,{clientId:o[0],onClose:e?.onClose}),e?.count===1&&!r&&a.jsx(Tqt,{clientId:e?.firstBlockClientId,onToggle:e?.onClose})]})})};function cb({...e}){return a.jsx(Jf,{document,children:a.jsx(Pqt,{...e})})}cb.Slot=Iqt;function Dqt({parentClientId:e,parentBlockType:t}){const n=Yn("medium","<"),{selectBlock:o}=Oe(J),r=x.useRef(),s=Z7({ref:r,highlightParent:!0});return n?a.jsx(Ct,{...s,ref:r,icon:a.jsx(Zn,{icon:t.icon}),onClick:()=>o(e),children:xe(m("Select parent block (%s)"),t.title)}):null}const Fqt={className:"block-editor-block-settings-menu__popover",placement:"bottom-start"};function Nee({clientIds:e,onCopy:t,label:n,shortcut:o,eventType:r="copy"}){const{getBlocksByClientId:s}=G(J),i=R7(),c=Hl(()=>Ks(s(e)),()=>{t&&r==="copy"&&t(),i(r,e)}),l=n||m("Copy");return a.jsx(Ct,{ref:c,shortcut:o,children:l})}function oMe({block:e,clientIds:t,children:n,__experimentalSelectBlock:o,...r}){const s=e?.clientId,i=t.length,c=t[0],{firstParentClientId:l,parentBlockType:u,previousBlockClientId:d,selectedBlockClientIds:p,openedBlockSettingsMenu:f,isContentOnly:b}=G(R=>{const{getBlockName:T,getBlockRootClientId:E,getPreviousBlockClientId:B,getSelectedBlockClientIds:N,getBlockAttributes:j,getOpenedBlockSettingsMenu:I,getBlockEditingMode:P}=ct(R(J)),{getActiveBlockVariation:$}=R(kt),F=E(c),X=F&&T(F);return{firstParentClientId:F,parentBlockType:F&&($(X,j(F))||on(X)),previousBlockClientId:B(c),selectedBlockClientIds:N(),openedBlockSettingsMenu:I(),isContentOnly:P(c)==="contentOnly"}},[c]),{getBlockOrder:h,getSelectedBlockClientIds:g}=G(J),{setOpenedBlockSettingsMenu:z}=ct(Oe(J)),A=G(R=>{const{getShortcutRepresentation:T}=R(Pi);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")}},[]),_=p.length>0;async function v(R){if(!o)return;const T=await R;T&&T[0]&&o(T[0],!1)}function M(){if(!o)return;let R=d||l;R||(R=h()[0]);const T=_&&g().length===0;o(R,T)}const y=p?.includes(l),k=s?f===s||!1:void 0;function S(R){R&&f!==s?z(s):!R&&f&&f===s&&z(void 0)}const C=!y&&!!l;return a.jsx(yqt,{clientIds:t,__experimentalUpdateSelection:!o,children:({canCopyStyles:R,canDuplicate:T,canInsertBlock:E,canRemove:B,onDuplicate:N,onInsertAfter:j,onInsertBefore:I,onRemove:P,onCopy:$,onPasteStyles:F})=>!B&&!T&&!E&&b?null:a.jsx(c0,{icon:Wc,label:m("Options"),className:"block-editor-block-settings-menu",popoverProps:Fqt,open:k,onToggle:S,noIcons:!0,...r,children:({onClose:Z})=>a.jsxs(a.Fragment,{children:[a.jsxs(Cn,{children:[a.jsx(F_.Slot,{fillProps:{onClose:Z}}),C&&a.jsx(Dqt,{parentClientId:l,parentBlockType:u}),i===1&&a.jsx(Aqt,{clientId:c}),a.jsx(Nee,{clientIds:t,onCopy:$,shortcut:j1.primary("c")}),T&&a.jsx(Ct,{onClick:Ku(Z,N,v),shortcut:A.duplicate,children:m("Duplicate")}),E&&!b&&a.jsxs(a.Fragment,{children:[a.jsx(Ct,{onClick:Ku(Z,I),shortcut:A.insertBefore,children:m("Add before")}),a.jsx(Ct,{onClick:Ku(Z,j),shortcut:A.insertAfter,children:m("Add after")})]}),a.jsx(eMe.Slot,{fillProps:{onClose:Z}})]}),R&&!b&&a.jsxs(Cn,{children:[a.jsx(Nee,{clientIds:t,onCopy:$,label:m("Copy styles"),eventType:"copyStyles"}),a.jsx(Ct,{onClick:F,children:m("Paste styles")})]}),!b&&a.jsx(cb.Slot,{fillProps:{onClose:Z,count:i,firstBlockClientId:c},clientIds:t}),typeof n=="function"?n({onClose:Z}):x.Children.map(V=>x.cloneElement(V,{onClose:Z})),B&&a.jsx(Cn,{children:a.jsx(Ct,{onClick:Ku(Z,P,M),shortcut:A.remove,children:m("Delete")})})]})})})}const rMe=Qn(Symbol("CommentIconToolbarSlotFill"));function $qt({clientIds:e,...t}){return a.jsxs(Wn,{children:[a.jsx(rMe.Slot,{}),a.jsx(bs,{children:n=>a.jsx(oMe,{clientIds:e,toggleProps:n,...t})})]})}function Vqt({clientIds:e}){const t=e.length===1?e[0]:void 0,n=G(r=>!!t&&r(J).getBlockMode(t)==="html",[t]),{toggleBlockMode:o}=Oe(J);return n?a.jsx(Wn,{children:a.jsx(Vt,{onClick:()=>{o(t)},children:m("Edit visually")})}):null}const Hqt=x.createContext("");function Uqt(e){const t="toolbarItem";return!e.some(n=>!(t in n.dataset))}function Bee(e){return Array.from(e.querySelectorAll("[data-toolbar-item]:not([disabled])"))}function Lee(e){return e.contains(e.ownerDocument.activeElement)}function Xqt(e){const[t]=Xr.tabbable.find(e);t&&t.focus({preventScroll:!0})}function Gqt(e){const[n,o]=x.useState(!0),r=x.useCallback(()=>{const s=Xr.tabbable.find(e.current),i=Uqt(s);i||Ke("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"}),o(i)},[e]);return x.useLayoutEffect(()=>{const s=new window.MutationObserver(r);return s.observe(e.current,{childList:!0,subtree:!0}),()=>s.disconnect()},[r,n,e]),n}function Kqt({toolbarRef:e,focusOnMount:t,isAccessibleToolbar:n,defaultIndex:o,onIndexChange:r,shouldUseKeyboardFocusShortcut:s,focusEditorOnEscape:i}){const[c]=x.useState(t),[l]=x.useState(o),u=x.useCallback(()=>{Xqt(e.current)},[e]);p0("core/block-editor/focus-toolbar",()=>{s&&u()}),x.useEffect(()=>{c&&u()},[n,c,u]),x.useEffect(()=>{const f=e.current;let b=0;return!c&&!Lee(f)&&(b=window.requestAnimationFrame(()=>{const h=Bee(f),g=l||0;h[g]&&Lee(f)&&h[g].focus({preventScroll:!0})})),()=>{if(window.cancelAnimationFrame(b),!r||!f)return;const g=Bee(f).findIndex(z=>z.tabIndex===0);r(g)}},[l,c,r,e]);const{getLastFocus:p}=ct(G(J));x.useEffect(()=>{const f=e.current;if(i){const b=h=>{const g=p();h.keyCode===gd&&g?.current&&(h.preventDefault(),g.current.focus())};return f.addEventListener("keydown",b),()=>{f.removeEventListener("keydown",b)}}},[i,p,e])}function tI({children:e,focusOnMount:t,focusEditorOnEscape:n=!1,shouldUseKeyboardFocusShortcut:o=!0,__experimentalInitialIndex:r,__experimentalOnIndexChange:s,orientation:i="horizontal",...c}){const l=x.useRef(),u=Gqt(l);return Kqt({toolbarRef:l,focusOnMount:t,defaultIndex:r,onIndexChange:s,isAccessibleToolbar:u,shouldUseKeyboardFocusShortcut:o,focusEditorOnEscape:n}),u?a.jsx(p2e,{label:c["aria-label"],ref:l,orientation:i,...c,children:e}):a.jsx(pm,{orientation:i,role:"toolbar",ref:l,...c,children:e})}function sMe(){const{isToolbarEnabled:e,isBlockDisabled:t}=G(n=>{const{getBlockEditingMode:o,getBlockName:r,getBlockSelectionStart:s}=n(J),i=s(),c=i&&on(r(i));return{isToolbarEnabled:c&&Tt(c,"__experimentalToolbar",!0),isBlockDisabled:o(i)==="disabled"}},[]);return!(!e||t)}const HR=[],Yqt=6,Zqt={placement:"bottom-start"};function Qqt({clientId:e}){const{categories:t,currentPatternName:n,patterns:o}=G(c=>{const{getBlockAttributes:l,getBlockRootClientId:u,__experimentalGetAllowedPatterns:d}=c(J),p=l(e),f=p?.metadata?.categories||HR,b=u(e),h=f.length>0?d(b):HR;return{categories:f,currentPatternName:p?.metadata?.patternName,patterns:h}},[e]),{replaceBlocks:r}=Oe(J),s=x.useMemo(()=>t.length===0||!o||o.length===0?HR:o.filter(c=>{const l=c.source==="core"||c.source?.startsWith("pattern-directory")&&c.source!=="pattern-directory/theme";return c.blocks.length===1&&!l&&n!==c.name&&c.categories?.some(u=>t.includes(u))&&(c.syncStatus==="unsynced"||!c.id)}).slice(0,Yqt),[t,n,o]);if(s.length<2)return null;const i=c=>{var l;const u=((l=c.blocks)!==null&&l!==void 0?l:[]).map(d=>jo(d));u[0].attributes.metadata={...u[0].attributes.metadata,categories:t},r(e,u)};return a.jsx(so,{popoverProps:Zqt,renderToggle:({onToggle:c,isOpen:l})=>a.jsx(Wn,{children:a.jsx(Vt,{onClick:()=>c(!l),"aria-expanded":l,children:m("Change design")})}),renderContent:()=>a.jsx($s,{className:"block-editor-block-toolbar-change-design-content-wrapper",paddingSize:"none",children:a.jsx(qa,{blockPatterns:s,onClickPattern:i,showTitlesAsTooltip:!0})})})}const Jqt={user:{},base:{},merged:{},setUserConfig:()=>{}},lb=x.createContext(Jqt),Pee={settings:{},styles:{}},eRt=["appearanceTools","useRootPaddingAwareAlignments","background.backgroundImage","background.backgroundRepeat","background.backgroundSize","background.backgroundPosition","border.color","border.radius","border.style","border.width","shadow.presets","shadow.defaultPresets","color.background","color.button","color.caption","color.custom","color.customDuotone","color.customGradient","color.defaultDuotone","color.defaultGradients","color.defaultPalette","color.duotone","color.gradients","color.heading","color.link","color.palette","color.text","custom","dimensions.aspectRatio","dimensions.minHeight","layout.contentSize","layout.definitions","layout.wideSize","lightbox.enabled","lightbox.allowEditing","position.fixed","position.sticky","spacing.customSpacingSize","spacing.defaultSpacingSizes","spacing.spacingSizes","spacing.spacingScale","spacing.blockGap","spacing.margin","spacing.padding","spacing.units","typography.fluid","typography.customFontSize","typography.defaultFontSizes","typography.dropCap","typography.fontFamilies","typography.fontSizes","typography.fontStyle","typography.fontWeight","typography.letterSpacing","typography.lineHeight","typography.textAlign","typography.textColumns","typography.textDecoration","typography.textTransform","typography.writingMode"],tRt=()=>{const{user:e,setUserConfig:t}=x.useContext(lb),n={settings:e.settings,styles:e.styles};return[!!n&&!N0(n,Pee),x.useCallback(()=>t(Pee),[t])]};function iMe(e,t,n="all"){const{setUserConfig:o,...r}=x.useContext(lb),s=t?".blocks."+t:"",i=e?"."+e:"",c=`settings${s}${i}`,l=`settings${i}`,u=n==="all"?"merged":n;return[x.useMemo(()=>{const f=r[u];if(!f)throw"Unsupported source";if(e){var b;return(b=fo(f,c))!==null&&b!==void 0?b:fo(f,l)}let h={};return eRt.forEach(g=>{var z;const A=(z=fo(f,`settings${s}.${g}`))!==null&&z!==void 0?z:fo(f,`settings.${g}`);A!==void 0&&(h=gn(h,g.split("."),A))}),h},[r,u,e,c,l,s]),f=>{o(b=>gn(b,c.split("."),f))}]}function nRt(e,t,n="all",{shouldDecodeEncode:o=!0}={}){const{merged:r,base:s,user:i,setUserConfig:c}=x.useContext(lb),l=e?"."+e:"",u=t?`styles.blocks.${t}${l}`:`styles${l}`,d=b=>{c(h=>gn(h,u.split("."),o?WSt(r.settings,t,e,b):b))};let p,f;switch(n){case"all":p=fo(r,u),f=o?ua(r,t,p):p;break;case"user":p=fo(i,u),f=o?ua(r,t,p):p;break;case"base":p=fo(s,u),f=o?ua(s,t,p):p;break;default:throw"Unsupported source"}return[f,d]}function aMe(e,t,n){const{supportedStyles:o,supports:r}=G(s=>({supportedStyles:ct(s(kt)).getSupportedStyles(t,n),supports:s(kt).getBlockType(t)?.supports}),[t,n]);return x.useMemo(()=>{const s={...e};return o.includes("fontSize")||(s.typography={...s.typography,fontSizes:{},customFontSize:!1,defaultFontSizes:!1}),o.includes("fontFamily")||(s.typography={...s.typography,fontFamilies:{}}),s.color={...s.color,text:s.color?.text&&o.includes("color"),background:s.color?.background&&(o.includes("background")||o.includes("backgroundColor")),button:s.color?.button&&o.includes("buttonColor"),heading:s.color?.heading&&o.includes("headingColor"),link:s.color?.link&&o.includes("linkColor"),caption:s.color?.caption&&o.includes("captionColor")},o.includes("background")||(s.color.gradients=[],s.color.customGradient=!1),o.includes("filter")||(s.color.defaultDuotone=!1,s.color.customDuotone=!1),["lineHeight","fontStyle","fontWeight","letterSpacing","textAlign","textTransform","textDecoration","writingMode"].forEach(i=>{o.includes(i)||(s.typography={...s.typography,[i]:!1})}),o.includes("columnCount")||(s.typography={...s.typography,textColumns:!1}),["contentSize","wideSize"].forEach(i=>{o.includes(i)||(s.layout={...s.layout,[i]:!1})}),["padding","margin","blockGap"].forEach(i=>{o.includes(i)||(s.spacing={...s.spacing,[i]:!1});const c=Array.isArray(r?.spacing?.[i])?r?.spacing?.[i]:r?.spacing?.[i]?.sides;c?.length&&s.spacing?.[i]&&(s.spacing={...s.spacing,[i]:{...s.spacing?.[i],sides:c}})}),["aspectRatio","minHeight"].forEach(i=>{o.includes(i)||(s.dimensions={...s.dimensions,[i]:!1})}),["radius","color","style","width"].forEach(i=>{o.includes("border"+i.charAt(0).toUpperCase()+i.slice(1))||(s.border={...s.border,[i]:!1})}),["backgroundImage","backgroundSize"].forEach(i=>{o.includes(i)||(s.background={...s.background,[i]:!1})}),s.shadow=o.includes("shadow")?s.shadow:!1,n&&(s.typography.textAlign=!1),s},[e,o,r,n])}function pp(e){const t=e?.color?.palette?.custom,n=e?.color?.palette?.theme,o=e?.color?.palette?.default,r=e?.color?.defaultPalette;return x.useMemo(()=>{const s=[];return n&&n.length&&s.push({name:We("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&s.push({name:We("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&s.push({name:We("Custom","Indicates this palette is created by the user."),colors:t}),s},[t,n,o,r])}function $_(e){const t=e?.color?.gradients?.custom,n=e?.color?.gradients?.theme,o=e?.color?.gradients?.default,r=e?.color?.defaultGradients;return x.useMemo(()=>{const s=[];return n&&n.length&&s.push({name:We("Theme","Indicates this palette comes from the theme."),gradients:n}),r&&o&&o.length&&s.push({name:We("Default","Indicates this palette comes from WordPress."),gradients:o}),t&&t.length&&s.push({name:We("Custom","Indicates this palette is created by the user."),gradients:t}),s},[t,n,o,r])}function pd(e,t="root",n={}){if(!t)return null;const{fallback:o=!1}=n,{name:r,selectors:s,supports:i}=e,c=s&&Object.keys(s).length>0,l=Array.isArray(t)?t.join("."):t;let u=null;if(c&&s.root?u=s?.root:i?.__experimentalSelector?u=i.__experimentalSelector:u=".wp-block-"+r.replace("core/","").replace("/","-"),l==="root")return u;const d=Array.isArray(t)?t:t.split(".");if(d.length===1){const f=o?u:null;if(c)return fo(s,`${l}.root`,null)||fo(s,l,null)||f;const b=fo(i,`${l}.__experimentalSelector`,null);return b?Ws(u,b):f}let p;return c&&(p=fo(s,l,null)),p||(o?pd(e,d[0],n):null)}function oRt(e=[]){const t={r:[],g:[],b:[],a:[]};return e.forEach(n=>{const o=an(n).toRgb();t.r.push(o.r/255),t.g.push(o.g/255),t.b.push(o.b/255),t.a.push(o.a)}),t}function rRt(e){return`${e}{filter:none}`}function sRt(e,t){return`${e}{filter:url(#${t})}`}function nI(e,t){const n=oRt(t);return` -`}function cMe({children:e,settingsOpen:t,setSettingsOpen:n}){const o=$1(),r=o?x.Fragment:Wd,s=o?"div":Rr.div,c=`link-control-settings-drawer-${vt(cMe)}`;return a.jsxs(a.Fragment,{children:[a.jsx(Ce,{__next40pxDefaultSize:!0,className:"block-editor-link-control__drawer-toggle","aria-expanded":t,onClick:()=>n(!t),icon:jt()?qw:Af,"aria-controls":c,children:We("Advanced","Additional link settings")}),a.jsx(r,{children:t&&a.jsx(s,{className:"block-editor-link-control__drawer",hidden:!t,id:c,initial:"collapsed",animate:"open",exit:"collapsed",variants:{open:{opacity:1,height:"auto"},collapsed:{opacity:0,height:0}},transition:{duration:.1},children:a.jsx("div",{className:"block-editor-link-control__drawer-inner",children:e})})})]})}const iRt=({searchTerm:e,onClick:t,itemProps:n,buttonText:o})=>{if(!e)return null;let r;return o?r=typeof o=="function"?o(e):o:r=cr(xe(m("Create: %s"),e),{mark:a.jsx("mark",{})}),a.jsx(Ct,{...n,iconPosition:"left",icon:Fs,className:"block-editor-link-control__search-item",onClick:t,children:r})},jee={post:FP,page:wa,post_tag:HP,category:gz,attachment:WP};function aRt({isURL:e,suggestion:t}){let n=null;return e?n=ade:t.type in jee&&(n=jee[t.type],t.type==="page"&&(t.isFrontPage&&(n=cde),t.isBlogHome&&(n=jw))),n?a.jsx(wn,{className:"block-editor-link-control__search-item-icon",icon:n}):null}function cRt(e){return e?.trim()?.length?e?.replace(/^\/?/,"/"):e}function lRt(e){return e?.trim()?.length?e?.replace(/\/$/,""):e}const uRt=(e,...t)=>(...n)=>e(...n,...t),dRt=e=>t=>t==null||t!==t?e:t;function pRt(e){return e&&Ku(c3,Aa,dRt(""),uRt(Ph,24),lRt,cRt)(e)}const fRt=({itemProps:e,suggestion:t,searchTerm:n,onClick:o,isURL:r=!1,shouldShowType:s=!1})=>{const i=r?m("Press ENTER to add this link"):pRt(t.url);return a.jsx(Ct,{...e,info:i,iconPosition:"left",icon:a.jsx(aRt,{suggestion:t,isURL:r}),onClick:o,shortcut:s&&bRt(t),className:"block-editor-link-control__search-item",children:a.jsx(sht,{text:x1(t.title),highlight:n})})};function bRt(e){return e.isFrontPage?"front page":e.isBlogHome?"blog home":e.type==="post_tag"?"tag":e.type}const Ux="__CREATE__",lMe="tel",uMe="link",dMe="mailto",pMe="internal",Iee=[uMe,dMe,lMe,pMe],fMe=[{id:"opensInNewTab",title:m("Open in new tab")}];function hRt({withCreateSuggestion:e,currentInputValue:t,handleSuggestionClick:n,suggestionsListProps:o,buildSuggestionItemProps:r,suggestions:s,selectedSuggestion:i,isLoading:c,isInitialSuggestions:l,createSuggestionButtonText:u,suggestionsQuery:d}){const p=oe("block-editor-link-control__search-results",{"is-loading":c}),f=s.length===1&&Iee.includes(s[0].type),b=e&&!f&&!l,h=!d?.type,g=l?m("Suggestions"):xe(m('Search results for "%s"'),t);return a.jsx("div",{className:"block-editor-link-control__search-results-wrapper",children:a.jsx("div",{...o,className:p,"aria-label":g,children:a.jsx(Cn,{children:s.map((z,A)=>b&&Ux===z.type?a.jsx(iRt,{searchTerm:t,buttonText:u,onClick:()=>n(z),itemProps:r(z,A),isSelected:A===i},z.type):Ux===z.type?null:a.jsx(fRt,{itemProps:r(z,A),suggestion:z,index:A,onClick:()=>{n(z)},isSelected:A===i,isURL:Iee.includes(z.type),searchTerm:t,shouldShowType:h,isFrontPage:z?.isFrontPage,isBlogHome:z?.isBlogHome},`${z.id}-${z.type}`))})})})}const mRt=()=>Promise.resolve([]),gRt=e=>{let t=uMe;const n=O5(e)||"";return n.includes("mailto")&&(t=dMe),n.includes("tel")&&(t=lMe),e?.startsWith("#")&&(t=pMe),Promise.resolve([{id:e,title:e,url:t==="URL"?jf(e):e,type:t}])},MRt=async(e,t,n,o,r,s)=>{const{isInitialSuggestions:i}=t,c=await n(e,t);return c.map(l=>Number(l.id)===r?(l.isFrontPage=!0,l):(Number(l.id)===s&&(l.isBlogHome=!0),l)),i||Uj(e)||!o?c:c.concat({title:e,url:e,type:Ux})};function zRt(e,t,n){const{fetchSearchSuggestions:o,pageOnFront:r,pageForPosts:s}=G(c=>{const{getSettings:l}=c(J);return{pageOnFront:l().pageOnFront,pageForPosts:l().pageForPosts,fetchSearchSuggestions:l().__experimentalFetchLinkSuggestions}},[]),i=t?gRt:mRt;return x.useCallback((c,{isInitialSuggestions:l})=>Uj(c)?i(c):MRt(c,{...e,isInitialSuggestions:l},o,n,r,s),[i,o,r,s,e,n])}const ORt=()=>Promise.resolve([]),UR=()=>{},yRt=x.forwardRef(({value:e,children:t,currentLink:n={},className:o=null,placeholder:r=null,withCreateSuggestion:s=!1,onCreateSuggestion:i=UR,onChange:c=UR,onSelect:l=UR,showSuggestions:u=!0,renderSuggestions:d=M=>a.jsx(hRt,{...M}),fetchSuggestions:p=null,allowDirectEntry:f=!0,showInitialSuggestions:b=!1,suggestionsQuery:h={},withURLSuggestion:g=!0,createSuggestionButtonText:z,hideLabelFromVision:A=!1,suffix:_},v)=>{const M=zRt(h,f,s),y=u?p||M:ORt,[k,S]=x.useState(),C=(B,N)=>{c(B),S(N)},R=B=>d({...B,withCreateSuggestion:s,createSuggestionButtonText:z,suggestionsQuery:h,handleSuggestionClick:N=>{B.handleSuggestionClick&&B.handleSuggestionClick(N),T(N)}}),T=async B=>{let N=B;if(Ux===B.type){try{N=await i(B.title),N?.url&&l(N)}catch{}return}if(f||N&&Object.keys(N).length>=1){const{id:j,url:I,...P}=n??{};l({...P,...N},N)}},E=r??m("Search or type URL");return a.jsxs("div",{className:"block-editor-link-control__search-input-container",children:[a.jsx(dI,{disableSuggestions:n?.url===e,label:E,hideLabelFromVision:A,className:o,value:e,onChange:C,placeholder:E,__experimentalRenderSuggestions:u?R:null,__experimentalFetchLinkSuggestions:y,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:b,onSubmit:(B,N)=>{const j=B||k;!j&&!e?.trim()?.length?N.preventDefault():T(j||{url:e})},ref:v,suffix:_}),t]})}),{Slot:ARt,Fill:vRt}=Qn("BlockEditorLinkControlViewer");function xRt(e,t){switch(t.type){case"RESOLVED":return{...e,isFetching:!1,richData:t.richData};case"ERROR":return{...e,isFetching:!1,richData:null};case"LOADING":return{...e,isFetching:!0};default:throw new Error(`Unexpected action type ${t.type}`)}}function wRt(e){const[t,n]=x.useReducer(xRt,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=G(r=>{const{getSettings:s}=r(J);return{fetchRichUrlData:s().__experimentalFetchRichUrlData}},[]);return x.useEffect(()=>{if(e?.length&&o&&typeof AbortController<"u"){n({type:"LOADING"});const r=new window.AbortController,s=r.signal;return o(e,{signal:s}).then(i=>{n({type:"RESOLVED",richData:i})}).catch(()=>{s.aborted||n({type:"ERROR"})}),()=>{r.abort()}}},[e]),t}function _Rt(e){return e.replace(/^[a-z\-.\+]+[0-9]*:(\/\/)?/i,"").replace(/^www\./i,"")}function kRt({value:e,onEditClick:t,hasRichPreviews:n=!1,hasUnlinkControl:o=!1,onRemove:r}){const s=G(A=>A(ht).get("core","showIconLabels"),[]),i=n?e?.url:null,{richData:c,isFetching:l}=wRt(i),u=c&&Object.keys(c).length,d=e&&Ph(c3(e.url),24)||"",p=!e?.url?.length,f=!p&&x1(c?.title||e?.title||d),b=!e?.url||_Rt(f)===d;let h;c?.icon?h=a.jsx("img",{src:c?.icon,alt:""}):p?h=a.jsx(wn,{icon:lde,size:32}):h=a.jsx(wn,{icon:ade});const{createNotice:g}=Oe(mt),z=Hl(e.url,()=>{g("info",m("Link copied to clipboard."),{isDismissible:!0,type:"snackbar"})});return a.jsx("div",{role:"group","aria-label":m("Manage link"),className:oe("block-editor-link-control__search-item",{"is-current":!0,"is-rich":u,"is-fetching":!!l,"is-preview":!0,"is-error":p,"is-url-title":f===d}),children:a.jsxs("div",{className:"block-editor-link-control__search-item-top",children:[a.jsxs("span",{className:"block-editor-link-control__search-item-header",role:"figure","aria-label":m("Link information"),children:[a.jsx("span",{className:oe("block-editor-link-control__search-item-icon",{"is-image":c?.icon}),children:h}),a.jsx("span",{className:"block-editor-link-control__search-item-details",children:p?a.jsx("span",{className:"block-editor-link-control__search-item-error-notice",children:m("Link is empty")}):a.jsxs(a.Fragment,{children:[a.jsx(hr,{className:"block-editor-link-control__search-item-title",href:e.url,children:a.jsx(zs,{numberOfLines:1,children:f})}),!b&&a.jsx("span",{className:"block-editor-link-control__search-item-info",children:a.jsx(zs,{numberOfLines:1,children:d})})]})})]}),a.jsx(Ce,{icon:Nd,label:m("Edit link"),onClick:t,size:"compact",showTooltip:!s}),o&&a.jsx(Ce,{icon:Pl,label:m("Remove link"),onClick:r,size:"compact",showTooltip:!s}),a.jsx(Ce,{icon:RP,label:m("Copy link"),ref:z,accessibleWhenDisabled:!0,disabled:p,size:"compact",showTooltip:!s}),a.jsx(ARt,{fillProps:e})]})})}const SRt=()=>{},CRt=({value:e,onChange:t=SRt,settings:n})=>{if(!n||!n.length)return null;const o=s=>i=>{t({...e,[s.id]:i})},r=n.map(s=>a.jsx(K0,{__nextHasNoMarginBottom:!0,className:"block-editor-link-control__setting",label:s.title,onChange:o(s),checked:e?!!e[s.id]:!1,help:s?.help},s.id));return a.jsxs("fieldset",{className:"block-editor-link-control__settings",children:[a.jsx(qn,{as:"legend",children:m("Currently selected link settings")}),r]})};function qRt(e){const t=x.useRef(),[n,o]=x.useState(!1),[r,s]=x.useState(null),i=async function(c){o(!0),s(null);try{return t.current=RRt(Promise.resolve(e(c))),await t.current.promise}catch(l){if(l&&l.isCanceled)return;throw s(l.message||m("An unknown error occurred during creation. Please try again.")),l}finally{o(!1)}};return x.useEffect(()=>()=>{t.current&&t.current.cancel()},[]),{createPage:i,isCreatingPage:n,errorMessage:r}}const RRt=e=>{let t=!1;return{promise:new Promise((o,r)=>{e.then(s=>t?r({isCanceled:!0}):o(s),s=>r(t?{isCanceled:!0}:s))}),cancel(){t=!0}}};var XR,Dee;function TRt(){return Dee||(Dee=1,XR=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var o,r,s;if(Array.isArray(t)){if(o=t.length,o!=n.length)return!1;for(r=o;r--!==0;)if(!e(t[r],n[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),o=s.length,o!==Object.keys(n).length)return!1;for(r=o;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[r]))return!1;for(r=o;r--!==0;){var i=s[r];if(!e(t[i],n[i]))return!1}return!0}return t!==t&&n!==n}),XR}var ERt=TRt();const bMe=Zr(ERt);function WRt(e){const[t,n]=x.useState(e||{}),[o,r]=x.useState(e);return bMe(e,o)||(r(e),n(e)),[t,n,l=>{n({...t,url:l})},l=>{n({...t,title:l})},l=>u=>{const d=Object.keys(u).reduce((p,f)=>(l.includes(f)&&(p[f]=u[f]),p),{});n({...t,...d})}]}const GR=()=>{},Fee="core/block-editor",$ee="linkControlSettingsDrawer";function kc({searchInputPlaceholder:e,value:t,settings:n=fMe,onChange:o=GR,onRemove:r,onCancel:s,noDirectEntry:i=!1,showSuggestions:c=!0,showInitialSuggestions:l,forceIsEditingLink:u,createSuggestion:d,withCreateSuggestion:p,inputValue:f="",suggestionsQuery:b={},noURLSuggestion:h=!1,createSuggestionButtonText:g,hasRichPreviews:z=!1,hasTextControl:A=!1,renderControlBottom:_=null}){p===void 0&&d&&(p=!0);const[v,M]=x.useState(!1),{advancedSettingsPreference:y}=G(L=>{var U;return{advancedSettingsPreference:(U=L(ht).get(Fee,$ee))!==null&&U!==void 0?U:!1}},[]),{set:k}=Oe(ht),S=L=>{k&&k(Fee,$ee,L),M(L)},C=y||v,R=x.useRef(!0),T=x.useRef(),E=x.useRef(),B=x.useRef(!1),N=n.map(({id:L})=>L),[j,I,P,$,F]=WRt(t),X=t&&!o0e(j,t),[Z,V]=x.useState(u!==void 0?u:!t||!t.url),{createPage:Q,isCreatingPage:te,errorMessage:ee}=qRt(d);x.useEffect(()=>{u!==void 0&&V(u)},[u]),x.useEffect(()=>{if(R.current)return;(Xr.focusable.find(T.current)[0]||T.current).focus(),B.current=!1},[Z,te]),x.useEffect(()=>(R.current=!1,()=>{R.current=!0}),[]);const ue=t?.url?.trim()?.length>0,ce=()=>{B.current=!!T.current?.contains(T.current.ownerDocument.activeElement),V(!1)},me=L=>{const U=Object.keys(L).reduce((ne,ve)=>(N.includes(ve)||(ne[ve]=L[ve]),ne),{});o({...j,...U,title:j?.title||L?.title}),ce()},de=()=>{X&&o({...t,...j,url:je}),ce()},Ae=L=>{const{keyCode:U}=L;U===Gr&&!ie&&(L.preventDefault(),de())},ye=()=>{I(t)},Ne=L=>{L.preventDefault(),L.stopPropagation(),ye(),ue?ce():r?.(),s?.()},je=f||j?.url||"",ie=!je?.trim()?.length,we=r&&t&&!Z&&!te,re=Z&&ue,pe=ue&&A,ke=(Z||!t)&&!te,Se=!X||ie,se=!!n?.length&&Z&&ue;return a.jsxs("div",{tabIndex:-1,ref:T,className:"block-editor-link-control",children:[te&&a.jsxs("div",{className:"block-editor-link-control__loading",children:[a.jsx(Xn,{})," ",m("Creating"),"…"]}),ke&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:oe({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":pe,"has-actions":re}),children:[pe&&a.jsx(dn,{__nextHasNoMarginBottom:!0,ref:E,className:"block-editor-link-control__field block-editor-link-control__text-content",label:m("Text"),value:j?.title,onChange:$,onKeyDown:Ae,__next40pxDefaultSize:!0}),a.jsx(yRt,{currentLink:t,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:e,value:je,withCreateSuggestion:p,onCreateSuggestion:Q,onChange:P,onSelect:me,showInitialSuggestions:l,allowDirectEntry:!i,showSuggestions:c,suggestionsQuery:b,withURLSuggestion:!h,createSuggestionButtonText:g,hideLabelFromVision:!pe,suffix:re?void 0:a.jsx(eO,{variant:"control",children:a.jsx(Ce,{onClick:Se?GR:de,label:m("Submit"),icon:Nw,className:"block-editor-link-control__search-submit","aria-disabled":Se,size:"small"})})})]}),ee&&a.jsx(A1,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1,children:ee})]}),t&&!Z&&!te&&a.jsx(kRt,{value:t,onEditClick:()=>V(!0),hasRichPreviews:z,hasUnlinkControl:we,onRemove:()=>{r(),V(!0)}},t?.url),se&&a.jsx("div",{className:"block-editor-link-control__tools",children:!ie&&a.jsx(cMe,{settingsOpen:C,setSettingsOpen:S,children:a.jsx(CRt,{value:j,settings:n,onChange:F(N)})})}),re&&a.jsxs(Ot,{justify:"right",className:"block-editor-link-control__search-actions",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:Ne,children:m("Cancel")}),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"primary",onClick:Se?GR:de,className:"block-editor-link-control__search-submit","aria-disabled":Se,children:m("Save")})]}),!te&&_&&_()]})}kc.ViewerFill=vRt;kc.DEFAULT_LINK_SETTINGS=fMe;const NRt=()=>{};let BRt=0;const LRt=({mediaURL:e,mediaId:t,mediaIds:n,allowedTypes:o,accept:r,onError:s,onSelect:i,onSelectURL:c,onReset:l,onToggleFeaturedImage:u,useFeaturedImage:d,onFilesUpload:p=NRt,name:f=m("Replace"),createNotice:b,removeNotice:h,children:g,multiple:z=!1,addToGallery:A,handleUpload:_=!0,popoverProps:v,renderToggle:M})=>{const{getSettings:y}=G(J),k=`block-editor/media-replace-flow/error-notice/${++BRt}`,S=N=>{const j=x1(N);if(s){s(j);return}setTimeout(()=>{b("error",j,{speak:!0,id:k,isDismissible:!0})},1e3)},C=(N,j)=>{d&&u&&u(),j(),i(N),Yt(m("The media file has been replaced")),h(k)},R=(N,j)=>{const I=N.target.files;if(!_)return j(),i(I);p(I),y().mediaUpload({allowedTypes:o,filesList:I,onFileChange:([P])=>{C(P,j)},onError:S})},T=N=>{N.keyCode===Ps&&(N.preventDefault(),N.target.click())},B=z&&(!o||o.length===0?!1:o.every(N=>N==="image"||N.startsWith("image/")));return a.jsx(so,{popoverProps:v,contentClassName:"block-editor-media-replace-flow__options",renderToggle:({isOpen:N,onToggle:j})=>M?M({"aria-expanded":N,"aria-haspopup":"true",onClick:j,onKeyDown:T,children:f}):a.jsx(Vt,{"aria-expanded":N,"aria-haspopup":"true",onClick:j,onKeyDown:T,children:f}),renderContent:({onClose:N})=>a.jsxs(a.Fragment,{children:[a.jsxs(pm,{className:"block-editor-media-replace-flow__media-upload-menu",children:[a.jsxs(Hd,{children:[a.jsx(ab,{gallery:B,addToGallery:A,multiple:z,value:z?n:t,onSelect:j=>C(j,N),allowedTypes:o,render:({open:j})=>a.jsx(Ct,{icon:PP,onClick:j,children:m("Open Media Library")})}),a.jsx(kx,{onChange:j=>{R(j,N)},accept:r,multiple:!!z,render:({openFileDialog:j})=>a.jsx(Ct,{icon:cm,onClick:()=>{j()},children:We("Upload","verb")})})]}),u&&a.jsx(Ct,{icon:xde,onClick:u,isPressed:d,children:m("Use featured image")}),e&&l&&a.jsx(Ct,{onClick:()=>{l(),N()},children:m("Reset")}),typeof g=="function"?g({onClose:N}):g]}),c&&a.jsxs("form",{className:"block-editor-media-flow__url-input",children:[a.jsx("span",{className:"block-editor-media-replace-flow__image-url-label",children:m("Current media URL:")}),a.jsx(kc,{value:{url:e},settings:[],showSuggestions:!1,onChange:({url:j})=>{c(j)}})]})]})})},Pc=Co([Ff(e=>{const{createNotice:t,removeNotice:n}=e(mt);return{createNotice:t,removeNotice:n}}),ap("editor.MediaReplaceFlow")])(LRt),lv="image",PRt={placement:"left-start",offset:36,shift:!0,className:"block-editor-global-styles-background-panel__popover"},Xx=()=>{};function jRt(e){return m(e==="cover"||e===void 0?"Image covers the space evenly.":e==="contain"?"Image is contained without distortion.":"Image has a fixed width.")}const IRt=e=>{if(!e||isNaN(e.x)&&isNaN(e.y))return;const t=isNaN(e.x)?.5:e.x,n=isNaN(e.y)?.5:e.y;return`${t*100}% ${n*100}%`},DRt=e=>{if(!e)return{x:void 0,y:void 0};let[t,n]=e.split(" ").map(o=>parseFloat(o)/100);return t=isNaN(t)?void 0:t,n=isNaN(n)?t:n,{x:t,y:n}};function hMe({as:e="span",imgUrl:t,toggleProps:n={},filename:o,label:r,className:s,onToggleCallback:i=Xx}){return x.useEffect(()=>{typeof n?.isOpen<"u"&&i(n?.isOpen)},[n?.isOpen,i]),a.jsx(tb,{as:e,className:s,...n,children:a.jsxs(Ot,{justify:"flex-start",as:"span",className:"block-editor-global-styles-background-panel__inspector-preview-inner",children:[t&&a.jsx("span",{className:"block-editor-global-styles-background-panel__inspector-image-indicator-wrapper","aria-hidden":!0,children:a.jsx("span",{className:"block-editor-global-styles-background-panel__inspector-image-indicator",style:{backgroundImage:`url(${t})`}})}),a.jsxs(Tn,{as:"span",style:t?{}:{flexGrow:1},children:[a.jsx(zs,{numberOfLines:1,className:"block-editor-global-styles-background-panel__inspector-media-replace-title",children:r}),a.jsx(qn,{as:"span",children:t?xe(m("Background image: %s"),o||r):m("No background image selected")})]})]})})}function FRt({label:e,filename:t,url:n,children:o,onToggle:r=Xx,hasImageValue:s}){if(!s)return;const i=e||If(n)||m("Add background image");return a.jsx(so,{popoverProps:PRt,renderToggle:({onToggle:c,isOpen:l})=>{const u={onClick:c,className:"block-editor-global-styles-background-panel__dropdown-toggle","aria-expanded":l,"aria-label":m("Background size, position and repeat options."),isOpen:l};return a.jsx(hMe,{imgUrl:n,filename:t,label:i,toggleProps:u,as:"button",onToggleCallback:r})},renderContent:()=>a.jsx($s,{className:"block-editor-global-styles-background-panel__dropdown-content-wrapper",paddingSize:"medium",children:o})})}function $Rt(){return a.jsx(vo,{className:"block-editor-global-styles-background-panel__loading",children:a.jsx(Xn,{})})}function Vee({onChange:e,style:t,inheritedValue:n,onRemoveImage:o=Xx,onResetImage:r=Xx,displayInPanel:s,defaultValues:i}){const[c,l]=x.useState(!1),{getSettings:u}=G(J),{id:d,title:p,url:f}=t?.background?.backgroundImage||{...n?.background?.backgroundImage},b=x.useRef(),{createErrorNotice:h}=Oe(mt),g=C=>{h(C,{type:"snackbar"}),l(!1)},z=()=>e(gn(t,["background","backgroundImage"],void 0)),A=C=>{if(!C||!C.url){z(),l(!1);return}if(Nr(C.url)){l(!0);return}if(C.media_type&&C.media_type!==lv||!C.media_type&&C.type&&C.type!==lv){g(m("Only images can be used as a background image."));return}const R=t?.background?.backgroundSize||i?.backgroundSize,T=t?.background?.backgroundPosition;e(gn(t,["background"],{...t?.background,backgroundImage:{url:C.url,id:C.id,source:"file",title:C.title||void 0},backgroundPosition:!T&&(R==="auto"||!R)?"50% 0":T,backgroundSize:R})),l(!1)},_=C=>{if(C?.length>1){g(m("Only one image can be used as a background image."));return}u().mediaUpload({allowedTypes:[lv],filesList:C,onFileChange([R]){A(R)},onError:g})},v=Qz(t),M=()=>{const[C]=Xr.tabbable.find(b.current);C?.focus(),C?.click()},y=()=>e(gn(t,["background"],{backgroundImage:"none"})),k=!v&&Qz(n),S=p||If(f)||m("Add background image");return a.jsxs("div",{ref:b,className:"block-editor-global-styles-background-panel__image-tools-panel-item",children:[c&&a.jsx($Rt,{}),a.jsx(Pc,{mediaId:d,mediaURL:f,allowedTypes:[lv],accept:"image/*",onSelect:A,popoverProps:{className:oe({"block-editor-global-styles-background-panel__media-replace-popover":s})},name:a.jsx(hMe,{className:"block-editor-global-styles-background-panel__image-preview",imgUrl:f,filename:p,label:S}),renderToggle:C=>a.jsx(Ce,{...C,__next40pxDefaultSize:!0}),onError:g,onReset:()=>{M(),r()},children:k&&a.jsx(Ct,{onClick:()=>{M(),y(),o()},children:m("Remove")})}),a.jsx(Tz,{onFilesDrop:_,label:m("Drop to upload")})]})}function VRt({onChange:e,style:t,inheritedValue:n,defaultValues:o}){const r=t?.background?.backgroundSize||n?.background?.backgroundSize,s=t?.background?.backgroundRepeat||n?.background?.backgroundRepeat,i=t?.background?.backgroundImage?.url||n?.background?.backgroundImage?.url,c=t?.background?.backgroundImage?.id,l=t?.background?.backgroundPosition||n?.background?.backgroundPosition,u=t?.background?.backgroundAttachment||n?.background?.backgroundAttachment;let d=!r&&c?o?.backgroundSize:r||"auto";d=["cover","contain","auto"].includes(d)?d:"auto";const p=!(s==="no-repeat"||d==="cover"&&s===void 0),f=A=>{let _=s,v=l;A==="contain"&&(_="no-repeat",v=void 0),A==="cover"&&(_=void 0,v=void 0),(d==="cover"||d==="contain")&&A==="auto"&&(_=void 0,t?.background?.backgroundImage?.id&&(v="50% 0")),!A&&d==="auto"&&(A="auto"),e(gn(t,["background"],{...t?.background,backgroundPosition:v,backgroundRepeat:_,backgroundSize:A}))},b=A=>{e(gn(t,["background","backgroundPosition"],IRt(A)))},h=()=>e(gn(t,["background","backgroundRepeat"],p===!0?"no-repeat":"repeat")),g=()=>e(gn(t,["background","backgroundAttachment"],u==="fixed"?"scroll":"fixed")),z=!l&&c&&r==="contain"?o?.backgroundPosition:l;return a.jsxs(dt,{spacing:3,className:"single-column",children:[a.jsx(i_,{__nextHasNoMarginBottom:!0,label:m("Focal point"),url:i,value:DRt(z),onChange:b}),a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Fixed background"),checked:u==="fixed",onChange:g}),a.jsxs(Do,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:m("Size"),value:d,onChange:f,isBlock:!0,help:jRt(r||o?.backgroundSize),children:[a.jsx(Kn,{value:"cover",label:We("Cover","Size option for background image control")},"cover"),a.jsx(Kn,{value:"contain",label:We("Contain","Size option for background image control")},"contain"),a.jsx(Kn,{value:"auto",label:We("Tile","Size option for background image control")},"tile")]}),a.jsxs(Ot,{justify:"flex-start",spacing:2,as:"span",children:[a.jsx(Ro,{"aria-label":m("Background image width"),onChange:f,value:r,size:"__unstable-large",__unstableInputWidth:"100px",min:0,placeholder:m("Auto"),disabled:d!=="auto"||d===void 0}),a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Repeat"),checked:p,onChange:h,disabled:d==="cover"})]})]})}function HRt({value:e,onChange:t,inheritedValue:n=e,settings:o,defaultValues:r={}}){const{globalStyles:s,_links:i}=G(z=>{const{getSettings:A}=z(J),_=A();return{globalStyles:_[dO],_links:_[x2e]}},[]),c=x.useMemo(()=>{const z={background:{}};return n?.background?(Object.entries(n?.background).forEach(([A,_])=>{z.background[A]=jW(_,{styles:s,_links:i})}),z):n},[s,i,n]),l=()=>t(gn(e,["background"],{})),{title:u,url:d}=e?.background?.backgroundImage||{...c?.background?.backgroundImage},p=Qz(e)||Qz(c),f=e?.background?.backgroundImage||n?.background?.backgroundImage,b=p&&f!=="none"&&(o?.background?.backgroundSize||o?.background?.backgroundPosition||o?.background?.backgroundRepeat),[h,g]=x.useState(!1);return a.jsx("div",{className:oe("block-editor-global-styles-background-panel__inspector-media-replace-container",{"is-open":h}),children:b?a.jsx(FRt,{label:u,filename:u,url:d,onToggle:g,hasImageValue:p,children:a.jsxs(dt,{spacing:3,className:"single-column",children:[a.jsx(Vee,{onChange:t,style:e,inheritedValue:c,displayInPanel:!0,onResetImage:()=>{g(!1),l()},onRemoveImage:()=>g(!1),defaultValues:r}),a.jsx(VRt,{onChange:t,style:e,defaultValues:r,inheritedValue:c})]})}):a.jsx(Vee,{onChange:t,style:e,inheritedValue:c,defaultValues:r,onResetImage:()=>{g(!1),l()},onRemoveImage:()=>g(!1)})})}const URt={backgroundImage:!0};function oI(e){return e?.background?.backgroundImage}function Qz(e){return!!e?.background?.backgroundImage?.id||typeof e?.background?.backgroundImage=="string"||!!e?.background?.backgroundImage?.url}function XRt({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r,headerLabel:s}){const i=dp(),c=()=>{const l=e(n);t(l)};return a.jsx(En,{label:s,resetAll:c,panelId:o,dropdownMenuProps:i,children:r})}function mMe({as:e=XRt,value:t,onChange:n,inheritedValue:o,settings:r,panelId:s,defaultControls:i=URt,defaultValues:c={},headerLabel:l=m("Background image")}){const u=oI(r),d=()=>n(gn(t,["background"],{})),p=x.useCallback(f=>({...f,background:{}}),[]);return a.jsx(e,{resetAllFilter:p,value:t,onChange:n,panelId:s,headerLabel:l,children:u&&a.jsx(tt,{hasValue:()=>!!t?.background,label:m("Image"),onDeselect:d,isShownByDefault:i.backgroundImage,panelId:s,children:a.jsx(HRt,{value:t,onChange:n,settings:r,inheritedValue:o,defaultControls:i,defaultValues:c})})})}const Sh="background",FW={backgroundSize:"cover",backgroundPosition:"50% 50%"};function Gx(e,t="any"){const n=An(e,Sh);return n===!0?!0:t==="any"?!!n?.backgroundImage||!!n?.backgroundSize||!!n?.backgroundRepeat:!!n?.[t]}function rI(e){if(!e||!e?.backgroundImage?.url)return;let t;return e?.backgroundSize||(t={backgroundSize:FW.backgroundSize}),e?.backgroundSize==="contain"&&!e?.backgroundPosition&&(t={backgroundPosition:FW.backgroundPosition}),t}function GRt({name:e,style:t}){if(!Gx(e)||!t?.background?.backgroundImage)return;const n=rI(t?.background);if(n)return{style:{...n}}}function KRt(e){return Qz(e)?"has-background":""}function YRt({children:e}){const t=x.useCallback(n=>({...n,style:{...n.style,background:void 0}}),[]);return a.jsx(et,{group:"background",resetAllFilter:t,children:e})}function ZRt({clientId:e,name:t,setAttributes:n,settings:o}){const{style:r,inheritedValue:s}=G(u=>{const{getBlockAttributes:d,getSettings:p}=u(J),f=p();return{style:d(e)?.style,inheritedValue:f[dO]?.blocks?.[t]}},[e,t]);if(!oI(o)||!Gx(t,"backgroundImage"))return null;const i=u=>{n({style:Ii(u)})},c={...o,background:{...o.background,backgroundSize:o?.background?.backgroundSize&&Gx(t,"backgroundSize")}},l=An(t,[Sh,"defaultControls"]);return a.jsx(mMe,{inheritedValue:s,as:YRt,panelId:e,defaultValues:FW,settings:c,onChange:i,defaultControls:l,value:r})}const QRt={useBlockProps:GRt,attributeKeys:["style"],hasSupport:Gx},JRt={button:"wp-element-button",caption:"wp-element-caption"},eTt={__experimentalBorder:"border",color:"color",spacing:"spacing",typography:"typography"},{kebabCase:fd}=ct(tr);function tTt(e={},t){return _m.reduce((n,{path:o,valueKey:r,valueFunc:s,cssVarInfix:i})=>{const c=fo(e,o,[]);return["default","theme","custom"].forEach(l=>{c[l]&&c[l].forEach(u=>{r&&!s?n.push(`--wp--preset--${i}--${fd(u.slug)}: ${u[r]}`):s&&typeof s=="function"&&n.push(`--wp--preset--${i}--${fd(u.slug)}: ${s(u,t)}`)})}),n},[])}function nTt(e="*",t={}){return _m.reduce((n,{path:o,cssVarInfix:r,classes:s})=>{if(!s)return n;const i=fo(t,o,[]);return["default","theme","custom"].forEach(c=>{i[c]&&i[c].forEach(({slug:l})=>{s.forEach(({classSuffix:u,propertyName:d})=>{const p=`.has-${fd(l)}-${u}`,f=e.split(",").map(h=>`${h}${p}`).join(","),b=`var(--wp--preset--${r}--${fd(l)})`;n+=`${f}{${d}: ${b} !important;}`})})}),n},"")}function oTt(e={}){return _m.filter(t=>t.path.at(-1)==="duotone").flatMap(t=>{const n=fo(e,t.path,{});return["default","theme"].filter(o=>n[o]).flatMap(o=>n[o].map(r=>nI(`wp-duotone-${r.slug}`,r.colors))).join("")})}function gMe(e={},t,n){let o=[];return Object.keys(e).forEach(r=>{const s=t+fd(r.replace("/","-")),i=e[r];if(i instanceof Object){const c=s+n;o=[...o,...gMe(i,c,n)]}else o.push(`${s}: ${i}`)}),o}function rTt(e,t){const n=e.split(","),o=[];return n.forEach(r=>{o.push(`${t.trim()}${r.trim()}`)}),o.join(", ")}const Hee=(e,t)=>{const n={};return Object.entries(e).forEach(([o,r])=>{if(o==="root"||!t?.[o])return;const s=typeof r=="string";if(s||Object.entries(r).forEach(([i,c])=>{if(i==="root"||!t?.[o][i])return;const l={[o]:{[i]:t[o][i]}},u=A2(l);n[c]=[...n[c]||[],...u],delete t[o][i]}),s||r.root){const i=s?r:r.root,c={[o]:t[o]},l=A2(c);n[i]=[...n[i]||[],...l],delete t[o]}}),n};function A2(e={},t="",n,o={},r=!1){const s=ll===t,i=Object.entries(Pp).reduce((l,[u,{value:d,properties:p,useEngine:f,rootOnly:b}])=>{if(b&&!s)return l;const h=d;if(h[0]==="elements"||f)return l;const g=fo(e,h);if(u==="--wp--style--root--padding"&&(typeof g=="string"||!n))return l;if(p&&typeof g!="string")Object.entries(p).forEach(z=>{const[A,_]=z;if(!fo(g,[_],!1))return;const v=A.startsWith("--")?A:fd(A);l.push(`${v}: ${Dz(fo(g,[_]))}`)});else if(fo(e,h,!1)){const z=u.startsWith("--")?u:fd(u);l.push(`${z}: ${Dz(fo(e,h))}`)}return l},[]);return e.background&&(e.background?.backgroundImage&&(e.background.backgroundImage=jW(e.background.backgroundImage,o)),!s&&e.background?.backgroundImage?.id&&(e={...e,background:{...e.background,...rI(e.background)}})),O_(e).forEach(l=>{if(s&&(n||r)&&l.key.startsWith("padding"))return;const u=l.key.startsWith("--")?l.key:fd(l.key);let d=jW(l.value,o);u==="font-size"&&(d=P_({size:d},o?.settings)),u==="aspect-ratio"&&i.push("min-height: unset"),i.push(`${u}: ${d}`)}),i}function MMe({layoutDefinitions:e=Dd,style:t,selector:n,hasBlockGapSupport:o,hasFallbackGapSupport:r,fallbackGapValue:s}){let i="",c=o?us(t?.spacing?.blockGap):"";if(r&&(n===ll?c=c||"0.5em":!o&&s&&(c=s)),c&&e&&(Object.values(e).forEach(({className:l,name:u,spacingStyles:d})=>{!o&&u!=="flex"&&u!=="grid"||d?.length&&d.forEach(p=>{const f=[];if(p.rules&&Object.entries(p.rules).forEach(([b,h])=>{f.push(`${b}: ${h||c}`)}),f.length){let b="";o?b=n===ll?`:root :where(.${l})${p?.selector||""}`:`:root :where(${n}-${l})${p?.selector||""}`:b=n===ll?`:where(.${l}${p?.selector||""})`:`:where(${n}.${l}${p?.selector||""})`,i+=`${b} { ${f.join("; ")}; }`}})}),n===ll&&o&&(i+=`${Hx} { --wp--style--block-gap: ${c}; }`)),n===ll&&e){const l=["block","flex","grid"];Object.values(e).forEach(({className:u,displayMode:d,baseStyles:p})=>{d&&l.includes(d)&&(i+=`${n} .${u} { display:${d}; }`),p?.length&&p.forEach(f=>{const b=[];if(f.rules&&Object.entries(f.rules).forEach(([h,g])=>{b.push(`${h}: ${g}`)}),b.length){const h=`.${u}${f?.selector||""}`;i+=`${h} { ${b.join("; ")}; }`}})})}return i}const sTt=["border","color","dimensions","spacing","typography","filter","outline","shadow","background"];function uv(e){if(!e)return{};const o=Object.entries(e).filter(([r])=>sTt.includes(r)).map(([r,s])=>[r,JSON.parse(JSON.stringify(s))]);return Object.fromEntries(o)}const iTt=(e,t)=>{var n;const o=[];if(!e?.styles)return o;const r=uv(e.styles);return r&&o.push({styles:r,selector:ll,skipSelectorWrapper:!0}),Object.entries(Za).forEach(([s,i])=>{e.styles?.elements?.[s]&&o.push({styles:e.styles?.elements?.[s],selector:i,skipSelectorWrapper:!JRt[s]})}),Object.entries((n=e.styles?.blocks)!==null&&n!==void 0?n:{}).forEach(([s,i])=>{var c;const l=uv(i);if(i?.variations){const u={};Object.entries(i.variations).forEach(([d,p])=>{var f,b;u[d]=uv(p),p?.css&&(u[d].css=p.css);const h=t[s]?.styleVariationSelectors?.[d];Object.entries((f=p?.elements)!==null&&f!==void 0?f:{}).forEach(([g,z])=>{z&&Za[g]&&o.push({styles:z,selector:Ws(h,Za[g])})}),Object.entries((b=p?.blocks)!==null&&b!==void 0?b:{}).forEach(([g,z])=>{var A;const _=Ws(h,t[g]?.selector),v=Ws(h,t[g]?.duotoneSelector),M=LSt(h,t[g]?.featureSelectors),y=uv(z);z?.css&&(y.css=z.css),o.push({selector:_,duotoneSelector:v,featureSelectors:M,fallbackGapValue:t[g]?.fallbackGapValue,hasLayoutSupport:t[g]?.hasLayoutSupport,styles:y}),Object.entries((A=z.elements)!==null&&A!==void 0?A:{}).forEach(([k,S])=>{S&&Za[k]&&o.push({styles:S,selector:Ws(_,Za[k])})})})}),l.variations=u}t?.[s]?.selector&&o.push({duotoneSelector:t[s].duotoneSelector,fallbackGapValue:t[s].fallbackGapValue,hasLayoutSupport:t[s].hasLayoutSupport,selector:t[s].selector,styles:l,featureSelectors:t[s].featureSelectors,styleVariationSelectors:t[s].styleVariationSelectors}),Object.entries((c=i?.elements)!==null&&c!==void 0?c:{}).forEach(([u,d])=>{d&&t?.[s]&&Za[u]&&o.push({styles:d,selector:t[s]?.selector.split(",").map(p=>Za[u].split(",").map(b=>p+" "+b)).join(",")})})}),o},sI=(e,t)=>{var n;const o=[];if(!e?.settings)return o;const r=c=>{let l={};return _m.forEach(({path:u})=>{const d=fo(c,u,!1);d!==!1&&(l=gn(l,u,d))}),l},s=r(e.settings),i=e.settings?.custom;return(Object.keys(s).length>0||i)&&o.push({presets:s,custom:i,selector:Hx}),Object.entries((n=e.settings?.blocks)!==null&&n!==void 0?n:{}).forEach(([c,l])=>{const u=r(l),d=l.custom;(Object.keys(u).length>0||d)&&o.push({presets:u,custom:d,selector:t[c]?.selector})}),o},aTt=(e,t)=>{const n=sI(e,t);let o="";return n.forEach(({presets:r,custom:s,selector:i})=>{const c=tTt(r,e?.settings),l=gMe(s,"--wp--custom--","--");l.length>0&&c.push(...l),c.length>0&&(o+=`${i}{${c.join(";")};}`)}),o},V_=(e,t,n,o,r=!1,s=!1,i=void 0)=>{const c={blockGap:!0,blockStyles:!0,layoutStyles:!0,marginReset:!0,presets:!0,rootPadding:!0,variationStyles:!1,...i},l=iTt(e,t),u=sI(e,t),d=e?.settings?.useRootPaddingAwareAlignments,{contentSize:p,wideSize:f}=e?.settings?.layout||{},b=c.marginReset||c.rootPadding||c.layoutStyles;let h="";if(c.presets&&(p||f)&&(h+=`${Hx} {`,h=p?h+` --wp--style--global--content-size: ${p};`:h,h=f?h+` --wp--style--global--wide-size: ${f};`:h,h+="}"),b&&(h+=":where(body) {margin: 0;",c.rootPadding&&d&&(h+=`padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) } +`}function cMe({children:e,settingsOpen:t,setSettingsOpen:n}){const o=$1(),r=o?x.Fragment:Wd,s=o?"div":qr.div,c=`link-control-settings-drawer-${vt(cMe)}`;return a.jsxs(a.Fragment,{children:[a.jsx(Ce,{__next40pxDefaultSize:!0,className:"block-editor-link-control__drawer-toggle","aria-expanded":t,onClick:()=>n(!t),icon:jt()?qw:Af,"aria-controls":c,children:We("Advanced","Additional link settings")}),a.jsx(r,{children:t&&a.jsx(s,{className:"block-editor-link-control__drawer",hidden:!t,id:c,initial:"collapsed",animate:"open",exit:"collapsed",variants:{open:{opacity:1,height:"auto"},collapsed:{opacity:0,height:0}},transition:{duration:.1},children:a.jsx("div",{className:"block-editor-link-control__drawer-inner",children:e})})})]})}const iRt=({searchTerm:e,onClick:t,itemProps:n,buttonText:o})=>{if(!e)return null;let r;return o?r=typeof o=="function"?o(e):o:r=cr(xe(m("Create: %s"),e),{mark:a.jsx("mark",{})}),a.jsx(Ct,{...n,iconPosition:"left",icon:Fs,className:"block-editor-link-control__search-item",onClick:t,children:r})},jee={post:FP,page:wa,post_tag:HP,category:gz,attachment:WP};function aRt({isURL:e,suggestion:t}){let n=null;return e?n=ade:t.type in jee&&(n=jee[t.type],t.type==="page"&&(t.isFrontPage&&(n=cde),t.isBlogHome&&(n=jw))),n?a.jsx(wn,{className:"block-editor-link-control__search-item-icon",icon:n}):null}function cRt(e){return e?.trim()?.length?e?.replace(/^\/?/,"/"):e}function lRt(e){return e?.trim()?.length?e?.replace(/\/$/,""):e}const uRt=(e,...t)=>(...n)=>e(...n,...t),dRt=e=>t=>t==null||t!==t?e:t;function pRt(e){return e&&Ku(l3,Aa,dRt(""),uRt(Ph,24),lRt,cRt)(e)}const fRt=({itemProps:e,suggestion:t,searchTerm:n,onClick:o,isURL:r=!1,shouldShowType:s=!1})=>{const i=r?m("Press ENTER to add this link"):pRt(t.url);return a.jsx(Ct,{...e,info:i,iconPosition:"left",icon:a.jsx(aRt,{suggestion:t,isURL:r}),onClick:o,shortcut:s&&bRt(t),className:"block-editor-link-control__search-item",children:a.jsx(sht,{text:x1(t.title),highlight:n})})};function bRt(e){return e.isFrontPage?"front page":e.isBlogHome?"blog home":e.type==="post_tag"?"tag":e.type}const Ux="__CREATE__",lMe="tel",uMe="link",dMe="mailto",pMe="internal",Iee=[uMe,dMe,lMe,pMe],fMe=[{id:"opensInNewTab",title:m("Open in new tab")}];function hRt({withCreateSuggestion:e,currentInputValue:t,handleSuggestionClick:n,suggestionsListProps:o,buildSuggestionItemProps:r,suggestions:s,selectedSuggestion:i,isLoading:c,isInitialSuggestions:l,createSuggestionButtonText:u,suggestionsQuery:d}){const p=oe("block-editor-link-control__search-results",{"is-loading":c}),f=s.length===1&&Iee.includes(s[0].type),b=e&&!f&&!l,h=!d?.type,g=l?m("Suggestions"):xe(m('Search results for "%s"'),t);return a.jsx("div",{className:"block-editor-link-control__search-results-wrapper",children:a.jsx("div",{...o,className:p,"aria-label":g,children:a.jsx(Cn,{children:s.map((z,A)=>b&&Ux===z.type?a.jsx(iRt,{searchTerm:t,buttonText:u,onClick:()=>n(z),itemProps:r(z,A),isSelected:A===i},z.type):Ux===z.type?null:a.jsx(fRt,{itemProps:r(z,A),suggestion:z,index:A,onClick:()=>{n(z)},isSelected:A===i,isURL:Iee.includes(z.type),searchTerm:t,shouldShowType:h,isFrontPage:z?.isFrontPage,isBlogHome:z?.isBlogHome},`${z.id}-${z.type}`))})})})}const mRt=()=>Promise.resolve([]),gRt=e=>{let t=uMe;const n=T5(e)||"";return n.includes("mailto")&&(t=dMe),n.includes("tel")&&(t=lMe),e?.startsWith("#")&&(t=pMe),Promise.resolve([{id:e,title:e,url:t==="URL"?Df(e):e,type:t}])},MRt=async(e,t,n,o,r,s)=>{const{isInitialSuggestions:i}=t,c=await n(e,t);return c.map(l=>Number(l.id)===r?(l.isFrontPage=!0,l):(Number(l.id)===s&&(l.isBlogHome=!0),l)),i||Uj(e)||!o?c:c.concat({title:e,url:e,type:Ux})};function zRt(e,t,n){const{fetchSearchSuggestions:o,pageOnFront:r,pageForPosts:s}=G(c=>{const{getSettings:l}=c(J);return{pageOnFront:l().pageOnFront,pageForPosts:l().pageForPosts,fetchSearchSuggestions:l().__experimentalFetchLinkSuggestions}},[]),i=t?gRt:mRt;return x.useCallback((c,{isInitialSuggestions:l})=>Uj(c)?i(c):MRt(c,{...e,isInitialSuggestions:l},o,n,r,s),[i,o,r,s,e,n])}const ORt=()=>Promise.resolve([]),UR=()=>{},yRt=x.forwardRef(({value:e,children:t,currentLink:n={},className:o=null,placeholder:r=null,withCreateSuggestion:s=!1,onCreateSuggestion:i=UR,onChange:c=UR,onSelect:l=UR,showSuggestions:u=!0,renderSuggestions:d=M=>a.jsx(hRt,{...M}),fetchSuggestions:p=null,allowDirectEntry:f=!0,showInitialSuggestions:b=!1,suggestionsQuery:h={},withURLSuggestion:g=!0,createSuggestionButtonText:z,hideLabelFromVision:A=!1,suffix:_},v)=>{const M=zRt(h,f,s),y=u?p||M:ORt,[k,S]=x.useState(),C=(B,N)=>{c(B),S(N)},R=B=>d({...B,withCreateSuggestion:s,createSuggestionButtonText:z,suggestionsQuery:h,handleSuggestionClick:N=>{B.handleSuggestionClick&&B.handleSuggestionClick(N),T(N)}}),T=async B=>{let N=B;if(Ux===B.type){try{N=await i(B.title),N?.url&&l(N)}catch{}return}if(f||N&&Object.keys(N).length>=1){const{id:j,url:I,...P}=n??{};l({...P,...N},N)}},E=r??m("Search or type URL");return a.jsxs("div",{className:"block-editor-link-control__search-input-container",children:[a.jsx(dI,{disableSuggestions:n?.url===e,label:E,hideLabelFromVision:A,className:o,value:e,onChange:C,placeholder:E,__experimentalRenderSuggestions:u?R:null,__experimentalFetchLinkSuggestions:y,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:b,onSubmit:(B,N)=>{const j=B||k;!j&&!e?.trim()?.length?N.preventDefault():T(j||{url:e})},ref:v,suffix:_}),t]})}),{Slot:ARt,Fill:vRt}=Qn("BlockEditorLinkControlViewer");function xRt(e,t){switch(t.type){case"RESOLVED":return{...e,isFetching:!1,richData:t.richData};case"ERROR":return{...e,isFetching:!1,richData:null};case"LOADING":return{...e,isFetching:!0};default:throw new Error(`Unexpected action type ${t.type}`)}}function wRt(e){const[t,n]=x.useReducer(xRt,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=G(r=>{const{getSettings:s}=r(J);return{fetchRichUrlData:s().__experimentalFetchRichUrlData}},[]);return x.useEffect(()=>{if(e?.length&&o&&typeof AbortController<"u"){n({type:"LOADING"});const r=new window.AbortController,s=r.signal;return o(e,{signal:s}).then(i=>{n({type:"RESOLVED",richData:i})}).catch(()=>{s.aborted||n({type:"ERROR"})}),()=>{r.abort()}}},[e]),t}function _Rt(e){return e.replace(/^[a-z\-.\+]+[0-9]*:(\/\/)?/i,"").replace(/^www\./i,"")}function kRt({value:e,onEditClick:t,hasRichPreviews:n=!1,hasUnlinkControl:o=!1,onRemove:r}){const s=G(A=>A(ht).get("core","showIconLabels"),[]),i=n?e?.url:null,{richData:c,isFetching:l}=wRt(i),u=c&&Object.keys(c).length,d=e&&Ph(l3(e.url),24)||"",p=!e?.url?.length,f=!p&&x1(c?.title||e?.title||d),b=!e?.url||_Rt(f)===d;let h;c?.icon?h=a.jsx("img",{src:c?.icon,alt:""}):p?h=a.jsx(wn,{icon:lde,size:32}):h=a.jsx(wn,{icon:ade});const{createNotice:g}=Oe(mt),z=Hl(e.url,()=>{g("info",m("Link copied to clipboard."),{isDismissible:!0,type:"snackbar"})});return a.jsx("div",{role:"group","aria-label":m("Manage link"),className:oe("block-editor-link-control__search-item",{"is-current":!0,"is-rich":u,"is-fetching":!!l,"is-preview":!0,"is-error":p,"is-url-title":f===d}),children:a.jsxs("div",{className:"block-editor-link-control__search-item-top",children:[a.jsxs("span",{className:"block-editor-link-control__search-item-header",role:"figure","aria-label":m("Link information"),children:[a.jsx("span",{className:oe("block-editor-link-control__search-item-icon",{"is-image":c?.icon}),children:h}),a.jsx("span",{className:"block-editor-link-control__search-item-details",children:p?a.jsx("span",{className:"block-editor-link-control__search-item-error-notice",children:m("Link is empty")}):a.jsxs(a.Fragment,{children:[a.jsx(hr,{className:"block-editor-link-control__search-item-title",href:e.url,children:a.jsx(zs,{numberOfLines:1,children:f})}),!b&&a.jsx("span",{className:"block-editor-link-control__search-item-info",children:a.jsx(zs,{numberOfLines:1,children:d})})]})})]}),a.jsx(Ce,{icon:Nd,label:m("Edit link"),onClick:t,size:"compact",showTooltip:!s}),o&&a.jsx(Ce,{icon:Pl,label:m("Remove link"),onClick:r,size:"compact",showTooltip:!s}),a.jsx(Ce,{icon:RP,label:m("Copy link"),ref:z,accessibleWhenDisabled:!0,disabled:p,size:"compact",showTooltip:!s}),a.jsx(ARt,{fillProps:e})]})})}const SRt=()=>{},CRt=({value:e,onChange:t=SRt,settings:n})=>{if(!n||!n.length)return null;const o=s=>i=>{t({...e,[s.id]:i})},r=n.map(s=>a.jsx(K0,{__nextHasNoMarginBottom:!0,className:"block-editor-link-control__setting",label:s.title,onChange:o(s),checked:e?!!e[s.id]:!1,help:s?.help},s.id));return a.jsxs("fieldset",{className:"block-editor-link-control__settings",children:[a.jsx(qn,{as:"legend",children:m("Currently selected link settings")}),r]})};function qRt(e){const t=x.useRef(),[n,o]=x.useState(!1),[r,s]=x.useState(null),i=async function(c){o(!0),s(null);try{return t.current=RRt(Promise.resolve(e(c))),await t.current.promise}catch(l){if(l&&l.isCanceled)return;throw s(l.message||m("An unknown error occurred during creation. Please try again.")),l}finally{o(!1)}};return x.useEffect(()=>()=>{t.current&&t.current.cancel()},[]),{createPage:i,isCreatingPage:n,errorMessage:r}}const RRt=e=>{let t=!1;return{promise:new Promise((o,r)=>{e.then(s=>t?r({isCanceled:!0}):o(s),s=>r(t?{isCanceled:!0}:s))}),cancel(){t=!0}}};var XR,Dee;function TRt(){return Dee||(Dee=1,XR=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var o,r,s;if(Array.isArray(t)){if(o=t.length,o!=n.length)return!1;for(r=o;r--!==0;)if(!e(t[r],n[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),o=s.length,o!==Object.keys(n).length)return!1;for(r=o;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[r]))return!1;for(r=o;r--!==0;){var i=s[r];if(!e(t[i],n[i]))return!1}return!0}return t!==t&&n!==n}),XR}var ERt=TRt();const bMe=Zr(ERt);function WRt(e){const[t,n]=x.useState(e||{}),[o,r]=x.useState(e);return bMe(e,o)||(r(e),n(e)),[t,n,l=>{n({...t,url:l})},l=>{n({...t,title:l})},l=>u=>{const d=Object.keys(u).reduce((p,f)=>(l.includes(f)&&(p[f]=u[f]),p),{});n({...t,...d})}]}const GR=()=>{},Fee="core/block-editor",$ee="linkControlSettingsDrawer";function kc({searchInputPlaceholder:e,value:t,settings:n=fMe,onChange:o=GR,onRemove:r,onCancel:s,noDirectEntry:i=!1,showSuggestions:c=!0,showInitialSuggestions:l,forceIsEditingLink:u,createSuggestion:d,withCreateSuggestion:p,inputValue:f="",suggestionsQuery:b={},noURLSuggestion:h=!1,createSuggestionButtonText:g,hasRichPreviews:z=!1,hasTextControl:A=!1,renderControlBottom:_=null}){p===void 0&&d&&(p=!0);const[v,M]=x.useState(!1),{advancedSettingsPreference:y}=G(L=>{var U;return{advancedSettingsPreference:(U=L(ht).get(Fee,$ee))!==null&&U!==void 0?U:!1}},[]),{set:k}=Oe(ht),S=L=>{k&&k(Fee,$ee,L),M(L)},C=y||v,R=x.useRef(!0),T=x.useRef(),E=x.useRef(),B=x.useRef(!1),N=n.map(({id:L})=>L),[j,I,P,$,F]=WRt(t),X=t&&!Gre(j,t),[Z,V]=x.useState(u!==void 0?u:!t||!t.url),{createPage:Q,isCreatingPage:te,errorMessage:ee}=qRt(d);x.useEffect(()=>{u!==void 0&&V(u)},[u]),x.useEffect(()=>{if(R.current)return;(Xr.focusable.find(T.current)[0]||T.current).focus(),B.current=!1},[Z,te]),x.useEffect(()=>(R.current=!1,()=>{R.current=!0}),[]);const ue=t?.url?.trim()?.length>0,ce=()=>{B.current=!!T.current?.contains(T.current.ownerDocument.activeElement),V(!1)},me=L=>{const U=Object.keys(L).reduce((ne,ve)=>(N.includes(ve)||(ne[ve]=L[ve]),ne),{});o({...j,...U,title:j?.title||L?.title}),ce()},de=()=>{X&&o({...t,...j,url:je}),ce()},Ae=L=>{const{keyCode:U}=L;U===Gr&&!ie&&(L.preventDefault(),de())},ye=()=>{I(t)},Ne=L=>{L.preventDefault(),L.stopPropagation(),ye(),ue?ce():r?.(),s?.()},je=f||j?.url||"",ie=!je?.trim()?.length,we=r&&t&&!Z&&!te,re=Z&&ue,pe=ue&&A,ke=(Z||!t)&&!te,Se=!X||ie,se=!!n?.length&&Z&&ue;return a.jsxs("div",{tabIndex:-1,ref:T,className:"block-editor-link-control",children:[te&&a.jsxs("div",{className:"block-editor-link-control__loading",children:[a.jsx(Xn,{})," ",m("Creating"),"…"]}),ke&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:oe({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":pe,"has-actions":re}),children:[pe&&a.jsx(dn,{__nextHasNoMarginBottom:!0,ref:E,className:"block-editor-link-control__field block-editor-link-control__text-content",label:m("Text"),value:j?.title,onChange:$,onKeyDown:Ae,__next40pxDefaultSize:!0}),a.jsx(yRt,{currentLink:t,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:e,value:je,withCreateSuggestion:p,onCreateSuggestion:Q,onChange:P,onSelect:me,showInitialSuggestions:l,allowDirectEntry:!i,showSuggestions:c,suggestionsQuery:b,withURLSuggestion:!h,createSuggestionButtonText:g,hideLabelFromVision:!pe,suffix:re?void 0:a.jsx(eO,{variant:"control",children:a.jsx(Ce,{onClick:Se?GR:de,label:m("Submit"),icon:Nw,className:"block-editor-link-control__search-submit","aria-disabled":Se,size:"small"})})})]}),ee&&a.jsx(A1,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1,children:ee})]}),t&&!Z&&!te&&a.jsx(kRt,{value:t,onEditClick:()=>V(!0),hasRichPreviews:z,hasUnlinkControl:we,onRemove:()=>{r(),V(!0)}},t?.url),se&&a.jsx("div",{className:"block-editor-link-control__tools",children:!ie&&a.jsx(cMe,{settingsOpen:C,setSettingsOpen:S,children:a.jsx(CRt,{value:j,settings:n,onChange:F(N)})})}),re&&a.jsxs(Ot,{justify:"right",className:"block-editor-link-control__search-actions",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:Ne,children:m("Cancel")}),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"primary",onClick:Se?GR:de,className:"block-editor-link-control__search-submit","aria-disabled":Se,children:m("Save")})]}),!te&&_&&_()]})}kc.ViewerFill=vRt;kc.DEFAULT_LINK_SETTINGS=fMe;const NRt=()=>{};let BRt=0;const LRt=({mediaURL:e,mediaId:t,mediaIds:n,allowedTypes:o,accept:r,onError:s,onSelect:i,onSelectURL:c,onReset:l,onToggleFeaturedImage:u,useFeaturedImage:d,onFilesUpload:p=NRt,name:f=m("Replace"),createNotice:b,removeNotice:h,children:g,multiple:z=!1,addToGallery:A,handleUpload:_=!0,popoverProps:v,renderToggle:M})=>{const{getSettings:y}=G(J),k=`block-editor/media-replace-flow/error-notice/${++BRt}`,S=N=>{const j=x1(N);if(s){s(j);return}setTimeout(()=>{b("error",j,{speak:!0,id:k,isDismissible:!0})},1e3)},C=(N,j)=>{d&&u&&u(),j(),i(N),Yt(m("The media file has been replaced")),h(k)},R=(N,j)=>{const I=N.target.files;if(!_)return j(),i(I);p(I),y().mediaUpload({allowedTypes:o,filesList:I,onFileChange:([P])=>{C(P,j)},onError:S})},T=N=>{N.keyCode===Ps&&(N.preventDefault(),N.target.click())},B=z&&(!o||o.length===0?!1:o.every(N=>N==="image"||N.startsWith("image/")));return a.jsx(so,{popoverProps:v,contentClassName:"block-editor-media-replace-flow__options",renderToggle:({isOpen:N,onToggle:j})=>M?M({"aria-expanded":N,"aria-haspopup":"true",onClick:j,onKeyDown:T,children:f}):a.jsx(Vt,{"aria-expanded":N,"aria-haspopup":"true",onClick:j,onKeyDown:T,children:f}),renderContent:({onClose:N})=>a.jsxs(a.Fragment,{children:[a.jsxs(pm,{className:"block-editor-media-replace-flow__media-upload-menu",children:[a.jsxs(Hd,{children:[a.jsx(ab,{gallery:B,addToGallery:A,multiple:z,value:z?n:t,onSelect:j=>C(j,N),allowedTypes:o,render:({open:j})=>a.jsx(Ct,{icon:PP,onClick:j,children:m("Open Media Library")})}),a.jsx(kx,{onChange:j=>{R(j,N)},accept:r,multiple:!!z,render:({openFileDialog:j})=>a.jsx(Ct,{icon:cm,onClick:()=>{j()},children:We("Upload","verb")})})]}),u&&a.jsx(Ct,{icon:xde,onClick:u,isPressed:d,children:m("Use featured image")}),e&&l&&a.jsx(Ct,{onClick:()=>{l(),N()},children:m("Reset")}),typeof g=="function"?g({onClose:N}):g]}),c&&a.jsxs("form",{className:"block-editor-media-flow__url-input",children:[a.jsx("span",{className:"block-editor-media-replace-flow__image-url-label",children:m("Current media URL:")}),a.jsx(kc,{value:{url:e},settings:[],showSuggestions:!1,onChange:({url:j})=>{c(j)}})]})]})})},Pc=Co([jf(e=>{const{createNotice:t,removeNotice:n}=e(mt);return{createNotice:t,removeNotice:n}}),ap("editor.MediaReplaceFlow")])(LRt),lv="image",PRt={placement:"left-start",offset:36,shift:!0,className:"block-editor-global-styles-background-panel__popover"},Xx=()=>{};function jRt(e){return m(e==="cover"||e===void 0?"Image covers the space evenly.":e==="contain"?"Image is contained without distortion.":"Image has a fixed width.")}const IRt=e=>{if(!e||isNaN(e.x)&&isNaN(e.y))return;const t=isNaN(e.x)?.5:e.x,n=isNaN(e.y)?.5:e.y;return`${t*100}% ${n*100}%`},DRt=e=>{if(!e)return{x:void 0,y:void 0};let[t,n]=e.split(" ").map(o=>parseFloat(o)/100);return t=isNaN(t)?void 0:t,n=isNaN(n)?t:n,{x:t,y:n}};function hMe({as:e="span",imgUrl:t,toggleProps:n={},filename:o,label:r,className:s,onToggleCallback:i=Xx}){return x.useEffect(()=>{typeof n?.isOpen<"u"&&i(n?.isOpen)},[n?.isOpen,i]),a.jsx(tb,{as:e,className:s,...n,children:a.jsxs(Ot,{justify:"flex-start",as:"span",className:"block-editor-global-styles-background-panel__inspector-preview-inner",children:[t&&a.jsx("span",{className:"block-editor-global-styles-background-panel__inspector-image-indicator-wrapper","aria-hidden":!0,children:a.jsx("span",{className:"block-editor-global-styles-background-panel__inspector-image-indicator",style:{backgroundImage:`url(${t})`}})}),a.jsxs(Tn,{as:"span",style:t?{}:{flexGrow:1},children:[a.jsx(zs,{numberOfLines:1,className:"block-editor-global-styles-background-panel__inspector-media-replace-title",children:r}),a.jsx(qn,{as:"span",children:t?xe(m("Background image: %s"),o||r):m("No background image selected")})]})]})})}function FRt({label:e,filename:t,url:n,children:o,onToggle:r=Xx,hasImageValue:s}){if(!s)return;const i=e||Ff(n)||m("Add background image");return a.jsx(so,{popoverProps:PRt,renderToggle:({onToggle:c,isOpen:l})=>{const u={onClick:c,className:"block-editor-global-styles-background-panel__dropdown-toggle","aria-expanded":l,"aria-label":m("Background size, position and repeat options."),isOpen:l};return a.jsx(hMe,{imgUrl:n,filename:t,label:i,toggleProps:u,as:"button",onToggleCallback:r})},renderContent:()=>a.jsx($s,{className:"block-editor-global-styles-background-panel__dropdown-content-wrapper",paddingSize:"medium",children:o})})}function $Rt(){return a.jsx(vo,{className:"block-editor-global-styles-background-panel__loading",children:a.jsx(Xn,{})})}function Vee({onChange:e,style:t,inheritedValue:n,onRemoveImage:o=Xx,onResetImage:r=Xx,displayInPanel:s,defaultValues:i}){const[c,l]=x.useState(!1),{getSettings:u}=G(J),{id:d,title:p,url:f}=t?.background?.backgroundImage||{...n?.background?.backgroundImage},b=x.useRef(),{createErrorNotice:h}=Oe(mt),g=C=>{h(C,{type:"snackbar"}),l(!1)},z=()=>e(gn(t,["background","backgroundImage"],void 0)),A=C=>{if(!C||!C.url){z(),l(!1);return}if(Wr(C.url)){l(!0);return}if(C.media_type&&C.media_type!==lv||!C.media_type&&C.type&&C.type!==lv){g(m("Only images can be used as a background image."));return}const R=t?.background?.backgroundSize||i?.backgroundSize,T=t?.background?.backgroundPosition;e(gn(t,["background"],{...t?.background,backgroundImage:{url:C.url,id:C.id,source:"file",title:C.title||void 0},backgroundPosition:!T&&(R==="auto"||!R)?"50% 0":T,backgroundSize:R})),l(!1)},_=C=>{if(C?.length>1){g(m("Only one image can be used as a background image."));return}u().mediaUpload({allowedTypes:[lv],filesList:C,onFileChange([R]){A(R)},onError:g})},v=Qz(t),M=()=>{const[C]=Xr.tabbable.find(b.current);C?.focus(),C?.click()},y=()=>e(gn(t,["background"],{backgroundImage:"none"})),k=!v&&Qz(n),S=p||Ff(f)||m("Add background image");return a.jsxs("div",{ref:b,className:"block-editor-global-styles-background-panel__image-tools-panel-item",children:[c&&a.jsx($Rt,{}),a.jsx(Pc,{mediaId:d,mediaURL:f,allowedTypes:[lv],accept:"image/*",onSelect:A,popoverProps:{className:oe({"block-editor-global-styles-background-panel__media-replace-popover":s})},name:a.jsx(hMe,{className:"block-editor-global-styles-background-panel__image-preview",imgUrl:f,filename:p,label:S}),renderToggle:C=>a.jsx(Ce,{...C,__next40pxDefaultSize:!0}),onError:g,onReset:()=>{M(),r()},children:k&&a.jsx(Ct,{onClick:()=>{M(),y(),o()},children:m("Remove")})}),a.jsx(Tz,{onFilesDrop:_,label:m("Drop to upload")})]})}function VRt({onChange:e,style:t,inheritedValue:n,defaultValues:o}){const r=t?.background?.backgroundSize||n?.background?.backgroundSize,s=t?.background?.backgroundRepeat||n?.background?.backgroundRepeat,i=t?.background?.backgroundImage?.url||n?.background?.backgroundImage?.url,c=t?.background?.backgroundImage?.id,l=t?.background?.backgroundPosition||n?.background?.backgroundPosition,u=t?.background?.backgroundAttachment||n?.background?.backgroundAttachment;let d=!r&&c?o?.backgroundSize:r||"auto";d=["cover","contain","auto"].includes(d)?d:"auto";const p=!(s==="no-repeat"||d==="cover"&&s===void 0),f=A=>{let _=s,v=l;A==="contain"&&(_="no-repeat",v=void 0),A==="cover"&&(_=void 0,v=void 0),(d==="cover"||d==="contain")&&A==="auto"&&(_=void 0,t?.background?.backgroundImage?.id&&(v="50% 0")),!A&&d==="auto"&&(A="auto"),e(gn(t,["background"],{...t?.background,backgroundPosition:v,backgroundRepeat:_,backgroundSize:A}))},b=A=>{e(gn(t,["background","backgroundPosition"],IRt(A)))},h=()=>e(gn(t,["background","backgroundRepeat"],p===!0?"no-repeat":"repeat")),g=()=>e(gn(t,["background","backgroundAttachment"],u==="fixed"?"scroll":"fixed")),z=!l&&c&&r==="contain"?o?.backgroundPosition:l;return a.jsxs(dt,{spacing:3,className:"single-column",children:[a.jsx(i_,{__nextHasNoMarginBottom:!0,label:m("Focal point"),url:i,value:DRt(z),onChange:b}),a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Fixed background"),checked:u==="fixed",onChange:g}),a.jsxs(Do,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:m("Size"),value:d,onChange:f,isBlock:!0,help:jRt(r||o?.backgroundSize),children:[a.jsx(Kn,{value:"cover",label:We("Cover","Size option for background image control")},"cover"),a.jsx(Kn,{value:"contain",label:We("Contain","Size option for background image control")},"contain"),a.jsx(Kn,{value:"auto",label:We("Tile","Size option for background image control")},"tile")]}),a.jsxs(Ot,{justify:"flex-start",spacing:2,as:"span",children:[a.jsx(Ro,{"aria-label":m("Background image width"),onChange:f,value:r,size:"__unstable-large",__unstableInputWidth:"100px",min:0,placeholder:m("Auto"),disabled:d!=="auto"||d===void 0}),a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Repeat"),checked:p,onChange:h,disabled:d==="cover"})]})]})}function HRt({value:e,onChange:t,inheritedValue:n=e,settings:o,defaultValues:r={}}){const{globalStyles:s,_links:i}=G(z=>{const{getSettings:A}=z(J),_=A();return{globalStyles:_[dO],_links:_[x2e]}},[]),c=x.useMemo(()=>{const z={background:{}};return n?.background?(Object.entries(n?.background).forEach(([A,_])=>{z.background[A]=jW(_,{styles:s,_links:i})}),z):n},[s,i,n]),l=()=>t(gn(e,["background"],{})),{title:u,url:d}=e?.background?.backgroundImage||{...c?.background?.backgroundImage},p=Qz(e)||Qz(c),f=e?.background?.backgroundImage||n?.background?.backgroundImage,b=p&&f!=="none"&&(o?.background?.backgroundSize||o?.background?.backgroundPosition||o?.background?.backgroundRepeat),[h,g]=x.useState(!1);return a.jsx("div",{className:oe("block-editor-global-styles-background-panel__inspector-media-replace-container",{"is-open":h}),children:b?a.jsx(FRt,{label:u,filename:u,url:d,onToggle:g,hasImageValue:p,children:a.jsxs(dt,{spacing:3,className:"single-column",children:[a.jsx(Vee,{onChange:t,style:e,inheritedValue:c,displayInPanel:!0,onResetImage:()=>{g(!1),l()},onRemoveImage:()=>g(!1),defaultValues:r}),a.jsx(VRt,{onChange:t,style:e,defaultValues:r,inheritedValue:c})]})}):a.jsx(Vee,{onChange:t,style:e,inheritedValue:c,defaultValues:r,onResetImage:()=>{g(!1),l()},onRemoveImage:()=>g(!1)})})}const URt={backgroundImage:!0};function oI(e){return e?.background?.backgroundImage}function Qz(e){return!!e?.background?.backgroundImage?.id||typeof e?.background?.backgroundImage=="string"||!!e?.background?.backgroundImage?.url}function XRt({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r,headerLabel:s}){const i=dp(),c=()=>{const l=e(n);t(l)};return a.jsx(En,{label:s,resetAll:c,panelId:o,dropdownMenuProps:i,children:r})}function mMe({as:e=XRt,value:t,onChange:n,inheritedValue:o,settings:r,panelId:s,defaultControls:i=URt,defaultValues:c={},headerLabel:l=m("Background image")}){const u=oI(r),d=()=>n(gn(t,["background"],{})),p=x.useCallback(f=>({...f,background:{}}),[]);return a.jsx(e,{resetAllFilter:p,value:t,onChange:n,panelId:s,headerLabel:l,children:u&&a.jsx(tt,{hasValue:()=>!!t?.background,label:m("Image"),onDeselect:d,isShownByDefault:i.backgroundImage,panelId:s,children:a.jsx(HRt,{value:t,onChange:n,settings:r,inheritedValue:o,defaultControls:i,defaultValues:c})})})}const Sh="background",FW={backgroundSize:"cover",backgroundPosition:"50% 50%"};function Gx(e,t="any"){const n=An(e,Sh);return n===!0?!0:t==="any"?!!n?.backgroundImage||!!n?.backgroundSize||!!n?.backgroundRepeat:!!n?.[t]}function rI(e){if(!e||!e?.backgroundImage?.url)return;let t;return e?.backgroundSize||(t={backgroundSize:FW.backgroundSize}),e?.backgroundSize==="contain"&&!e?.backgroundPosition&&(t={backgroundPosition:FW.backgroundPosition}),t}function GRt({name:e,style:t}){if(!Gx(e)||!t?.background?.backgroundImage)return;const n=rI(t?.background);if(n)return{style:{...n}}}function KRt(e){return Qz(e)?"has-background":""}function YRt({children:e}){const t=x.useCallback(n=>({...n,style:{...n.style,background:void 0}}),[]);return a.jsx(et,{group:"background",resetAllFilter:t,children:e})}function ZRt({clientId:e,name:t,setAttributes:n,settings:o}){const{style:r,inheritedValue:s}=G(u=>{const{getBlockAttributes:d,getSettings:p}=u(J),f=p();return{style:d(e)?.style,inheritedValue:f[dO]?.blocks?.[t]}},[e,t]);if(!oI(o)||!Gx(t,"backgroundImage"))return null;const i=u=>{n({style:Ii(u)})},c={...o,background:{...o.background,backgroundSize:o?.background?.backgroundSize&&Gx(t,"backgroundSize")}},l=An(t,[Sh,"defaultControls"]);return a.jsx(mMe,{inheritedValue:s,as:YRt,panelId:e,defaultValues:FW,settings:c,onChange:i,defaultControls:l,value:r})}const QRt={useBlockProps:GRt,attributeKeys:["style"],hasSupport:Gx},JRt={button:"wp-element-button",caption:"wp-element-caption"},eTt={__experimentalBorder:"border",color:"color",spacing:"spacing",typography:"typography"},{kebabCase:fd}=ct(tr);function tTt(e={},t){return _m.reduce((n,{path:o,valueKey:r,valueFunc:s,cssVarInfix:i})=>{const c=fo(e,o,[]);return["default","theme","custom"].forEach(l=>{c[l]&&c[l].forEach(u=>{r&&!s?n.push(`--wp--preset--${i}--${fd(u.slug)}: ${u[r]}`):s&&typeof s=="function"&&n.push(`--wp--preset--${i}--${fd(u.slug)}: ${s(u,t)}`)})}),n},[])}function nTt(e="*",t={}){return _m.reduce((n,{path:o,cssVarInfix:r,classes:s})=>{if(!s)return n;const i=fo(t,o,[]);return["default","theme","custom"].forEach(c=>{i[c]&&i[c].forEach(({slug:l})=>{s.forEach(({classSuffix:u,propertyName:d})=>{const p=`.has-${fd(l)}-${u}`,f=e.split(",").map(h=>`${h}${p}`).join(","),b=`var(--wp--preset--${r}--${fd(l)})`;n+=`${f}{${d}: ${b} !important;}`})})}),n},"")}function oTt(e={}){return _m.filter(t=>t.path.at(-1)==="duotone").flatMap(t=>{const n=fo(e,t.path,{});return["default","theme"].filter(o=>n[o]).flatMap(o=>n[o].map(r=>nI(`wp-duotone-${r.slug}`,r.colors))).join("")})}function gMe(e={},t,n){let o=[];return Object.keys(e).forEach(r=>{const s=t+fd(r.replace("/","-")),i=e[r];if(i instanceof Object){const c=s+n;o=[...o,...gMe(i,c,n)]}else o.push(`${s}: ${i}`)}),o}function rTt(e,t){const n=e.split(","),o=[];return n.forEach(r=>{o.push(`${t.trim()}${r.trim()}`)}),o.join(", ")}const Hee=(e,t)=>{const n={};return Object.entries(e).forEach(([o,r])=>{if(o==="root"||!t?.[o])return;const s=typeof r=="string";if(s||Object.entries(r).forEach(([i,c])=>{if(i==="root"||!t?.[o][i])return;const l={[o]:{[i]:t[o][i]}},u=A2(l);n[c]=[...n[c]||[],...u],delete t[o][i]}),s||r.root){const i=s?r:r.root,c={[o]:t[o]},l=A2(c);n[i]=[...n[i]||[],...l],delete t[o]}}),n};function A2(e={},t="",n,o={},r=!1){const s=ll===t,i=Object.entries(Pp).reduce((l,[u,{value:d,properties:p,useEngine:f,rootOnly:b}])=>{if(b&&!s)return l;const h=d;if(h[0]==="elements"||f)return l;const g=fo(e,h);if(u==="--wp--style--root--padding"&&(typeof g=="string"||!n))return l;if(p&&typeof g!="string")Object.entries(p).forEach(z=>{const[A,_]=z;if(!fo(g,[_],!1))return;const v=A.startsWith("--")?A:fd(A);l.push(`${v}: ${Dz(fo(g,[_]))}`)});else if(fo(e,h,!1)){const z=u.startsWith("--")?u:fd(u);l.push(`${z}: ${Dz(fo(e,h))}`)}return l},[]);return e.background&&(e.background?.backgroundImage&&(e.background.backgroundImage=jW(e.background.backgroundImage,o)),!s&&e.background?.backgroundImage?.id&&(e={...e,background:{...e.background,...rI(e.background)}})),O_(e).forEach(l=>{if(s&&(n||r)&&l.key.startsWith("padding"))return;const u=l.key.startsWith("--")?l.key:fd(l.key);let d=jW(l.value,o);u==="font-size"&&(d=P_({size:d},o?.settings)),u==="aspect-ratio"&&i.push("min-height: unset"),i.push(`${u}: ${d}`)}),i}function MMe({layoutDefinitions:e=Dd,style:t,selector:n,hasBlockGapSupport:o,hasFallbackGapSupport:r,fallbackGapValue:s}){let i="",c=o?us(t?.spacing?.blockGap):"";if(r&&(n===ll?c=c||"0.5em":!o&&s&&(c=s)),c&&e&&(Object.values(e).forEach(({className:l,name:u,spacingStyles:d})=>{!o&&u!=="flex"&&u!=="grid"||d?.length&&d.forEach(p=>{const f=[];if(p.rules&&Object.entries(p.rules).forEach(([b,h])=>{f.push(`${b}: ${h||c}`)}),f.length){let b="";o?b=n===ll?`:root :where(.${l})${p?.selector||""}`:`:root :where(${n}-${l})${p?.selector||""}`:b=n===ll?`:where(.${l}${p?.selector||""})`:`:where(${n}.${l}${p?.selector||""})`,i+=`${b} { ${f.join("; ")}; }`}})}),n===ll&&o&&(i+=`${Hx} { --wp--style--block-gap: ${c}; }`)),n===ll&&e){const l=["block","flex","grid"];Object.values(e).forEach(({className:u,displayMode:d,baseStyles:p})=>{d&&l.includes(d)&&(i+=`${n} .${u} { display:${d}; }`),p?.length&&p.forEach(f=>{const b=[];if(f.rules&&Object.entries(f.rules).forEach(([h,g])=>{b.push(`${h}: ${g}`)}),b.length){const h=`.${u}${f?.selector||""}`;i+=`${h} { ${b.join("; ")}; }`}})})}return i}const sTt=["border","color","dimensions","spacing","typography","filter","outline","shadow","background"];function uv(e){if(!e)return{};const o=Object.entries(e).filter(([r])=>sTt.includes(r)).map(([r,s])=>[r,JSON.parse(JSON.stringify(s))]);return Object.fromEntries(o)}const iTt=(e,t)=>{var n;const o=[];if(!e?.styles)return o;const r=uv(e.styles);return r&&o.push({styles:r,selector:ll,skipSelectorWrapper:!0}),Object.entries(Za).forEach(([s,i])=>{e.styles?.elements?.[s]&&o.push({styles:e.styles?.elements?.[s],selector:i,skipSelectorWrapper:!JRt[s]})}),Object.entries((n=e.styles?.blocks)!==null&&n!==void 0?n:{}).forEach(([s,i])=>{var c;const l=uv(i);if(i?.variations){const u={};Object.entries(i.variations).forEach(([d,p])=>{var f,b;u[d]=uv(p),p?.css&&(u[d].css=p.css);const h=t[s]?.styleVariationSelectors?.[d];Object.entries((f=p?.elements)!==null&&f!==void 0?f:{}).forEach(([g,z])=>{z&&Za[g]&&o.push({styles:z,selector:Ws(h,Za[g])})}),Object.entries((b=p?.blocks)!==null&&b!==void 0?b:{}).forEach(([g,z])=>{var A;const _=Ws(h,t[g]?.selector),v=Ws(h,t[g]?.duotoneSelector),M=LSt(h,t[g]?.featureSelectors),y=uv(z);z?.css&&(y.css=z.css),o.push({selector:_,duotoneSelector:v,featureSelectors:M,fallbackGapValue:t[g]?.fallbackGapValue,hasLayoutSupport:t[g]?.hasLayoutSupport,styles:y}),Object.entries((A=z.elements)!==null&&A!==void 0?A:{}).forEach(([k,S])=>{S&&Za[k]&&o.push({styles:S,selector:Ws(_,Za[k])})})})}),l.variations=u}t?.[s]?.selector&&o.push({duotoneSelector:t[s].duotoneSelector,fallbackGapValue:t[s].fallbackGapValue,hasLayoutSupport:t[s].hasLayoutSupport,selector:t[s].selector,styles:l,featureSelectors:t[s].featureSelectors,styleVariationSelectors:t[s].styleVariationSelectors}),Object.entries((c=i?.elements)!==null&&c!==void 0?c:{}).forEach(([u,d])=>{d&&t?.[s]&&Za[u]&&o.push({styles:d,selector:t[s]?.selector.split(",").map(p=>Za[u].split(",").map(b=>p+" "+b)).join(",")})})}),o},sI=(e,t)=>{var n;const o=[];if(!e?.settings)return o;const r=c=>{let l={};return _m.forEach(({path:u})=>{const d=fo(c,u,!1);d!==!1&&(l=gn(l,u,d))}),l},s=r(e.settings),i=e.settings?.custom;return(Object.keys(s).length>0||i)&&o.push({presets:s,custom:i,selector:Hx}),Object.entries((n=e.settings?.blocks)!==null&&n!==void 0?n:{}).forEach(([c,l])=>{const u=r(l),d=l.custom;(Object.keys(u).length>0||d)&&o.push({presets:u,custom:d,selector:t[c]?.selector})}),o},aTt=(e,t)=>{const n=sI(e,t);let o="";return n.forEach(({presets:r,custom:s,selector:i})=>{const c=tTt(r,e?.settings),l=gMe(s,"--wp--custom--","--");l.length>0&&c.push(...l),c.length>0&&(o+=`${i}{${c.join(";")};}`)}),o},V_=(e,t,n,o,r=!1,s=!1,i=void 0)=>{const c={blockGap:!0,blockStyles:!0,layoutStyles:!0,marginReset:!0,presets:!0,rootPadding:!0,variationStyles:!1,...i},l=iTt(e,t),u=sI(e,t),d=e?.settings?.useRootPaddingAwareAlignments,{contentSize:p,wideSize:f}=e?.settings?.layout||{},b=c.marginReset||c.rootPadding||c.layoutStyles;let h="";if(c.presets&&(p||f)&&(h+=`${Hx} {`,h=p?h+` --wp--style--global--content-size: ${p};`:h,h=f?h+` --wp--style--global--wide-size: ${f};`:h,h+="}"),b&&(h+=":where(body) {margin: 0;",c.rootPadding&&d&&(h+=`padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) } .has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); } .has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); } .has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) { padding-right: 0; padding-left: 0; } .has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) > .alignfull { margin-left: 0; margin-right: 0; - `),h+="}"),c.blockStyles&&l.forEach(({selector:g,duotoneSelector:z,styles:A,fallbackGapValue:_,hasLayoutSupport:v,featureSelectors:M,styleVariationSelectors:y,skipSelectorWrapper:k})=>{if(M){const R=Hee(M,A);Object.entries(R).forEach(([T,E])=>{if(E.length){const B=E.join(";");h+=`:root :where(${T}){${B};}`}})}if(z){const R={};A?.filter&&(R.filter=A.filter,delete A.filter);const T=A2(R);T.length&&(h+=`${z}{${T.join(";")};}`)}!r&&(ll===g||v)&&(h+=MMe({style:A,selector:g,hasBlockGapSupport:n,hasFallbackGapSupport:o,fallbackGapValue:_}));const S=A2(A,g,d,e,s);if(S?.length){const R=k?g:`:root :where(${g})`;h+=`${R}{${S.join(";")};}`}A?.css&&(h+=$W(A.css,`:root :where(${g})`)),c.variationStyles&&y&&Object.entries(y).forEach(([R,T])=>{const E=A?.variations?.[R];if(E){if(M){const N=Hee(M,E);Object.entries(N).forEach(([j,I])=>{if(I.length){const P=rTt(j,T),$=I.join(";");h+=`:root :where(${P}){${$};}`}})}const B=A2(E,T,d,e);B.length&&(h+=`:root :where(${T}){${B.join(";")};}`),E?.css&&(h+=$W(E.css,`:root :where(${T})`))}});const C=Object.entries(A).filter(([R])=>R.startsWith(":"));C?.length&&C.forEach(([R,T])=>{const E=A2(T);if(!E?.length)return;const N=`:root :where(${g.split(",").map(j=>j+R).join(",")}){${E.join(";")};}`;h+=N})}),c.layoutStyles&&(h=h+".wp-site-blocks > .alignleft { float: left; margin-right: 2em; }",h=h+".wp-site-blocks > .alignright { float: right; margin-left: 2em; }",h=h+".wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }"),c.blockGap&&n){const g=us(e?.styles?.spacing?.blockGap)||"0.5em";h=h+`:root :where(.wp-site-blocks) > * { margin-block-start: ${g}; margin-block-end: 0; }`,h=h+":root :where(.wp-site-blocks) > :first-child { margin-block-start: 0; }",h=h+":root :where(.wp-site-blocks) > :last-child { margin-block-end: 0; }"}return c.presets&&u.forEach(({selector:g,presets:z})=>{(ll===g||Hx===g)&&(g="");const A=nTt(g,z);A.length>0&&(h+=A)}),h};function cTt(e,t){return sI(e,t).flatMap(({presets:o})=>oTt(o))}const lTt=(e,t)=>{if(e?.selectors&&Object.keys(e.selectors).length>0)return e.selectors;const n={root:t};return Object.entries(eTt).forEach(([o,r])=>{const s=pd(e,o);s&&(n[r]=s)}),n},H_=(e,t,n)=>{const o={};return e.forEach(r=>{const s=r.name,i=pd(r);let c=pd(r,"filter.duotone");if(!c){const b=pd(r),h=An(r,"color.__experimentalDuotone",!1);c=h&&Ws(b,h)}const l=!!r?.supports?.layout||!!r?.supports?.__experimentalLayout,u=r?.supports?.spacing?.blockGap?.__experimentalDefault,d=t(s),p={};d?.forEach(b=>{const h=n?`-${n}`:"",g=`${b.name}${h}`,z=ISt(g,i);p[g]=z});const f=lTt(r,i);o[s]={duotoneSelector:c,fallbackGapValue:u,featureSelectors:Object.keys(f).length?f:void 0,hasLayoutSupport:l,name:s,selector:i,styleVariationSelectors:d?.length?p:void 0}}),o};function uTt(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}function $W(e,t){let n="";return!e||e.trim()===""||e.split("&").forEach(r=>{if(!r||r.trim()==="")return;if(!r.includes("{"))n+=`:root :where(${t}){${r.trim()}}`;else{const i=r.replace("}","").split("{");if(i.length!==2)return;const[c,l]=i,u=c.match(/([>+~\s]*::[a-zA-Z-]+)/),d=u?u[1]:"",p=u?c.replace(d,"").trim():c.trim();let f;p===""?f=t:f=c.startsWith(" ")?Ws(t,p):PSt(t,p),n+=`:root :where(${f})${d}{${l.trim()}}`}}),n}function zMe(e={},t){const[n]=iMe("spacing.blockGap"),o=n!==null,r=!o,s=G(c=>{const{getSettings:l}=c(J);return!!l().disableLayoutStyles}),{getBlockStyles:i}=G(kt);return x.useMemo(()=>{var c;if(!e?.styles||!e?.settings)return[];const l=uTt(e),u=H_(gs(),i),d=aTt(l,u),p=V_(l,u,o,r,s,t),f=cTt(l,u),b=[{css:d,isGlobalStyles:!0},{css:p,isGlobalStyles:!0},{css:(c=l.styles.css)!==null&&c!==void 0?c:"",isGlobalStyles:!0},{assets:f,__unstableType:"svg",isGlobalStyles:!0}];return gs().forEach(h=>{if(l.styles.blocks[h.name]?.css){const g=u[h.name].selector;b.push({css:$W(l.styles.blocks[h.name]?.css,g),isGlobalStyles:!0})}}),[b,l.settings]},[o,r,e,s,t,i])}function dTt(e=!1){const{merged:t}=x.useContext(lb);return zMe(t,e)}function pTt({__next40pxDefaultSize:e=!1,__nextHasNoMarginBottom:t=!1,value:n="",onChange:o,fontFamilies:r,className:s,...i}){var c;const[l]=Un("typography.fontFamilies");if(r||(r=l),!r||r.length===0)return null;const u=[{key:"",name:m("Default")},...r.map(({fontFamily:p,name:f})=>({key:p,name:f||p,style:{fontFamily:p}}))];t||Ke("Bottom margin styles for wp.blockEditor.FontFamilyControl",{since:"6.7",version:"7.0",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"}),!e&&(i.size===void 0||i.size==="default")&&Ke("36px default size for wp.blockEditor.__experimentalFontFamilyControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."});const d=(c=u.find(p=>p.key===n))!==null&&c!==void 0?c:"";return a.jsx(ob,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,label:m("Font"),value:d,onChange:({selectedItem:p})=>o(p.key),options:u,className:oe("block-editor-font-family-control",s,{"is-next-has-no-margin-bottom":t}),...i})}const fTt=(e,t)=>m(e?t?"Appearance":"Font style":"Font weight");function bTt(e){const{__next40pxDefaultSize:t=!1,onChange:n,hasFontStyles:o=!0,hasFontWeights:r=!0,fontFamilyFaces:s,value:{fontStyle:i,fontWeight:c},...l}=e,u=o||r,d=fTt(o,r),p={key:"default",name:m("Default"),style:{fontStyle:void 0,fontWeight:void 0}},{fontStyles:f,fontWeights:b,combinedStyleAndWeightOptions:h}=Ege(s),g=()=>{const y=[p];return h&&y.push(...h),y},z=()=>{const y=[p];return f.forEach(({name:k,value:S})=>{y.push({key:S,name:k,style:{fontStyle:S,fontWeight:void 0}})}),y},A=()=>{const y=[p];return b.forEach(({name:k,value:S})=>{y.push({key:S,name:k,style:{fontStyle:void 0,fontWeight:S}})}),y},_=x.useMemo(()=>o&&r?g():o?z():A(),[e.options,f,b,h]),v=_.find(y=>y.style.fontStyle===i&&y.style.fontWeight===c)||_[0],M=()=>v?xe(m(o?r?"Currently selected font appearance: %s":"Currently selected font style: %s":"Currently selected font weight: %s"),v.name):m("No selected font appearance");return!t&&(l.size===void 0||l.size==="default")&&Ke("36px default size for wp.blockEditor.__experimentalFontAppearanceControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."}),u&&a.jsx(ob,{...l,className:"components-font-appearance-control",__next40pxDefaultSize:t,__shouldNotWarnDeprecated36pxSize:!0,label:d,describedBy:M(),options:_,value:v,onChange:({selectedItem:y})=>n(y.style)})}const dv=1.5,Uee=.01,Xee=10,OMe="";function hTt(e){return e!==void 0&&e!==OMe}const mTt=({__next40pxDefaultSize:e=!1,value:t,onChange:n,__unstableInputWidth:o="60px",...r})=>{const s=hTt(t),i=(d,p)=>{if(s)return d;const f=Uee*Xee;switch(`${d}`){case`${f}`:return dv+f;case"0":return p?d:dv-f;case"":return dv;default:return d}},c=(d,p)=>{const f=["insertText","insertFromPaste"].includes(p.payload.event.nativeEvent?.inputType),b=i(d.value,f);return{...d,value:b}},l=s?t:OMe,u=(d,{event:p})=>{if(d===""){n();return}if(p.type==="click"){n(i(`${d}`,!1));return}n(`${d}`)};return!e&&(r.size===void 0||r.size==="default")&&Ke("36px default size for wp.blockEditor.LineHeightControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."}),a.jsx("div",{className:"block-editor-line-height-control",children:a.jsx(g0,{...r,__shouldNotWarnDeprecated36pxSize:!0,__next40pxDefaultSize:e,__unstableInputWidth:o,__unstableStateReducer:c,onChange:u,label:m("Line height"),placeholder:dv,step:Uee,spinFactor:Xee,value:l,min:0,spinControls:"custom"})})};function gTt({__next40pxDefaultSize:e=!1,value:t,onChange:n,__unstableInputWidth:o="60px",...r}){const[s]=Un("spacing.units"),i=U1({availableUnits:s||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return!e&&(r.size===void 0||r.size==="default")&&Ke("36px default size for wp.blockEditor.__experimentalLetterSpacingControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."}),a.jsx(Ro,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,...r,label:m("Letter spacing"),value:t,__unstableInputWidth:o,units:i,onChange:n})}const MTt=[{label:m("Align text left"),value:"left",icon:$3},{label:m("Align text center"),value:"center",icon:kw},{label:m("Align text right"),value:"right",icon:V3},{label:m("Justify text"),value:"justify",icon:mZe}],zTt=["left","center","right"];function yMe({className:e,value:t,onChange:n,options:o=zTt}){const r=x.useMemo(()=>MTt.filter(s=>o.includes(s.value)),[o]);return r.length?a.jsx(Do,{isDeselectable:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:m("Text alignment"),className:oe("block-editor-text-alignment-control",e),value:t,onChange:s=>{n(s===t?void 0:s)},children:r.map(s=>a.jsx(ga,{value:s.value,icon:s.icon,label:s.label},s.value))}):null}const OTt=[{label:m("None"),value:"none",icon:am},{label:m("Uppercase"),value:"uppercase",icon:GZe},{label:m("Lowercase"),value:"lowercase",icon:UZe},{label:m("Capitalize"),value:"capitalize",icon:jZe}];function yTt({className:e,value:t,onChange:n}){return a.jsx(Do,{isDeselectable:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:m("Letter case"),className:oe("block-editor-text-transform-control",e),value:t,onChange:o=>{n(o===t?void 0:o)},children:OTt.map(o=>a.jsx(ga,{value:o.value,icon:o.icon,label:o.label},o.value))})}const ATt=[{label:m("None"),value:"none",icon:am},{label:m("Underline"),value:"underline",icon:XZe},{label:m("Strikethrough"),value:"line-through",icon:sde}];function vTt({value:e,onChange:t,className:n}){return a.jsx(Do,{isDeselectable:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:m("Decoration"),className:oe("block-editor-text-decoration-control",n),value:e,onChange:o=>{t(o===e?void 0:o)},children:ATt.map(o=>a.jsx(ga,{value:o.value,icon:o.icon,label:o.label},o.value))})}const xTt=[{label:m("Horizontal"),value:"horizontal-tb",icon:aJe},{label:m("Vertical"),value:jt()?"vertical-lr":"vertical-rl",icon:cJe}];function wTt({className:e,value:t,onChange:n}){return a.jsx(Do,{isDeselectable:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:m("Orientation"),className:oe("block-editor-writing-mode-control",e),value:t,onChange:o=>{n(o===t?void 0:o)},children:xTt.map(o=>a.jsx(ga,{value:o.value,icon:o.icon,label:o.label},o.value))})}const _Tt=1,kTt=6;function AMe(e){const t=xMe(e),n=wMe(e),o=_Me(e),r=kMe(e),s=CMe(e),i=SMe(e),c=qMe(e),l=RMe(e),u=TMe(e),d=vMe(e);return t||n||o||r||s||i||d||c||l||u}function vMe(e){return e?.typography?.defaultFontSizes!==!1&&e?.typography?.fontSizes?.default?.length||e?.typography?.fontSizes?.theme?.length||e?.typography?.fontSizes?.custom?.length||e?.typography?.customFontSize}function xMe(e){return["default","theme","custom"].some(t=>e?.typography?.fontFamilies?.[t]?.length)}function wMe(e){return e?.typography?.lineHeight}function _Me(e){return e?.typography?.fontStyle||e?.typography?.fontWeight}function STt(e){return e?.typography?.fontStyle?e?.typography?.fontWeight?m("Appearance"):m("Font style"):m("Font weight")}function kMe(e){return e?.typography?.letterSpacing}function SMe(e){return e?.typography?.textTransform}function CMe(e){return e?.typography?.textAlign}function qMe(e){return e?.typography?.textDecoration}function RMe(e){return e?.typography?.writingMode}function TMe(e){return e?.typography?.textColumns}function CTt(e){var t,n,o;const r=e?.typography?.fontSizes,s=!!e?.typography?.defaultFontSizes;return[...(t=r?.custom)!==null&&t!==void 0?t:[],...(n=r?.theme)!==null&&n!==void 0?n:[],...s?(o=r?.default)!==null&&o!==void 0?o:[]:[]]}function qTt({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){const s=dp(),i=()=>{const c=e(n);t(c)};return a.jsx(En,{label:m("Typography"),resetAll:i,panelId:o,dropdownMenuProps:s,children:r})}const RTt={fontFamily:!0,fontSize:!0,fontAppearance:!0,lineHeight:!0,letterSpacing:!0,textAlign:!0,textTransform:!0,textDecoration:!0,writingMode:!0,textColumns:!0};function EMe({as:e=qTt,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:s,defaultControls:i=RTt}){const c=fe=>ua({settings:r},"",fe),l=xMe(r),u=c(o?.typography?.fontFamily),{fontFamilies:d,fontFamilyFaces:p}=x.useMemo(()=>qSt(r,u),[r,u]),f=fe=>{const Re=d?.find(({fontFamily:be})=>be===fe)?.slug;n(gn(t,["typography","fontFamily"],Re?`var:preset|font-family|${Re}`:fe||void 0))},b=()=>!!t?.typography?.fontFamily,h=()=>f(void 0),g=vMe(r),z=!r?.typography?.customFontSize,A=CTt(r),_=c(o?.typography?.fontSize),v=(fe,Re)=>{const be=Re?.slug?`var:preset|font-size|${Re?.slug}`:fe;n(gn(t,["typography","fontSize"],be||void 0))},M=()=>!!t?.typography?.fontSize,y=()=>v(void 0),k=_Me(r),S=STt(r),C=r?.typography?.fontStyle,R=r?.typography?.fontWeight,T=c(o?.typography?.fontStyle),E=c(o?.typography?.fontWeight),{nearestFontStyle:B,nearestFontWeight:N}=TSt(p,T,E),j=x.useCallback(({fontStyle:fe,fontWeight:Re})=>{(fe!==T||Re!==E)&&n({...t,typography:{...t?.typography,fontStyle:fe||void 0,fontWeight:Re||void 0}})},[T,E,n,t]),I=()=>!!t?.typography?.fontStyle||!!t?.typography?.fontWeight,P=x.useCallback(()=>{j({})},[j]);x.useEffect(()=>{B&&N?j({fontStyle:B,fontWeight:N}):P()},[B,N,P,j]);const $=wMe(r),F=c(o?.typography?.lineHeight),X=fe=>{n(gn(t,["typography","lineHeight"],fe||void 0))},Z=()=>t?.typography?.lineHeight!==void 0,V=()=>X(void 0),Q=kMe(r),te=c(o?.typography?.letterSpacing),ee=fe=>{n(gn(t,["typography","letterSpacing"],fe||void 0))},ue=()=>!!t?.typography?.letterSpacing,ce=()=>ee(void 0),me=TMe(r),de=c(o?.typography?.textColumns),Ae=fe=>{n(gn(t,["typography","textColumns"],fe||void 0))},ye=()=>!!t?.typography?.textColumns,Ne=()=>Ae(void 0),je=SMe(r),ie=c(o?.typography?.textTransform),we=fe=>{n(gn(t,["typography","textTransform"],fe||void 0))},re=()=>!!t?.typography?.textTransform,pe=()=>we(void 0),ke=qMe(r),Se=c(o?.typography?.textDecoration),se=fe=>{n(gn(t,["typography","textDecoration"],fe||void 0))},L=()=>!!t?.typography?.textDecoration,U=()=>se(void 0),ne=RMe(r),ve=c(o?.typography?.writingMode),qe=fe=>{n(gn(t,["typography","writingMode"],fe||void 0))},Pe=()=>!!t?.typography?.writingMode,rt=()=>qe(void 0),qt=CMe(r),wt=c(o?.typography?.textAlign),Bt=fe=>{n(gn(t,["typography","textAlign"],fe||void 0))},ae=()=>!!t?.typography?.textAlign,H=()=>Bt(void 0),Y=x.useCallback(fe=>({...fe,typography:{}}),[]);return a.jsxs(e,{resetAllFilter:Y,value:t,onChange:n,panelId:s,children:[l&&a.jsx(tt,{label:m("Font"),hasValue:b,onDeselect:h,isShownByDefault:i.fontFamily,panelId:s,children:a.jsx(pTt,{fontFamilies:d,value:u,onChange:f,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),g&&a.jsx(tt,{label:m("Size"),hasValue:M,onDeselect:y,isShownByDefault:i.fontSize,panelId:s,children:a.jsx(rbt,{value:_,onChange:v,fontSizes:A,disableCustomFontSizes:z,withReset:!1,withSlider:!0,size:"__unstable-large"})}),k&&a.jsx(tt,{className:"single-column",label:S,hasValue:I,onDeselect:P,isShownByDefault:i.fontAppearance,panelId:s,children:a.jsx(bTt,{value:{fontStyle:T,fontWeight:E},onChange:j,hasFontStyles:C,hasFontWeights:R,fontFamilyFaces:p,size:"__unstable-large"})}),$&&a.jsx(tt,{className:"single-column",label:m("Line height"),hasValue:Z,onDeselect:V,isShownByDefault:i.lineHeight,panelId:s,children:a.jsx(mTt,{__unstableInputWidth:"auto",value:F,onChange:X,size:"__unstable-large"})}),Q&&a.jsx(tt,{className:"single-column",label:m("Letter spacing"),hasValue:ue,onDeselect:ce,isShownByDefault:i.letterSpacing,panelId:s,children:a.jsx(gTt,{value:te,onChange:ee,size:"__unstable-large",__unstableInputWidth:"auto"})}),me&&a.jsx(tt,{className:"single-column",label:m("Columns"),hasValue:ye,onDeselect:Ne,isShownByDefault:i.textColumns,panelId:s,children:a.jsx(g0,{label:m("Columns"),max:kTt,min:_Tt,onChange:Ae,size:"__unstable-large",spinControls:"custom",value:de,initialPosition:1})}),ke&&a.jsx(tt,{className:"single-column",label:m("Decoration"),hasValue:L,onDeselect:U,isShownByDefault:i.textDecoration,panelId:s,children:a.jsx(vTt,{value:Se,onChange:se,size:"__unstable-large",__unstableInputWidth:"auto"})}),ne&&a.jsx(tt,{className:"single-column",label:m("Orientation"),hasValue:Pe,onDeselect:rt,isShownByDefault:i.writingMode,panelId:s,children:a.jsx(wTt,{value:ve,onChange:qe,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),je&&a.jsx(tt,{label:m("Letter case"),hasValue:re,onDeselect:pe,isShownByDefault:i.textTransform,panelId:s,children:a.jsx(yTt,{value:ie,onChange:we,showNone:!0,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),qt&&a.jsx(tt,{label:m("Text alignment"),hasValue:ae,onDeselect:H,isShownByDefault:i.textAlign,panelId:s,children:a.jsx(yMe,{value:wt,onChange:Bt,size:"__unstable-large",__nextHasNoMarginBottom:!0})})]})}const Gee={px:{max:300,steps:1},"%":{max:100,steps:1},vw:{max:100,steps:1},vh:{max:100,steps:1},em:{max:10,steps:.1},rm:{max:10,steps:.1},svw:{max:100,steps:1},lvw:{max:100,steps:1},dvw:{max:100,steps:1},svh:{max:100,steps:1},lvh:{max:100,steps:1},dvh:{max:100,steps:1},vi:{max:100,steps:1},svi:{max:100,steps:1},lvi:{max:100,steps:1},dvi:{max:100,steps:1},vb:{max:100,steps:1},svb:{max:100,steps:1},lvb:{max:100,steps:1},dvb:{max:100,steps:1},vmin:{max:100,steps:1},svmin:{max:100,steps:1},lvmin:{max:100,steps:1},dvmin:{max:100,steps:1},vmax:{max:100,steps:1},svmax:{max:100,steps:1},lvmax:{max:100,steps:1},dvmax:{max:100,steps:1}};function iI({icon:e,isMixed:t=!1,minimumCustomValue:n,onChange:o,onMouseOut:r,onMouseOver:s,showSideInLabel:i=!0,side:c,spacingSizes:l,type:u,value:d}){var p,f;d=g_(d,l);let b=l;const h=l.length<=xhe,g=G(Q=>Q(J).getSettings()?.disableCustomSpacingSizes),[z,A]=x.useState(!g&&d!==void 0&&!Qp(d)),[_,v]=x.useState(n),M=Fr(d);d&&M!==d&&!Qp(d)&&z!==!0&&A(!0);const[y]=Un("spacing.units"),k=U1({availableUnits:y||["px","em","rem"]});let S=null;!h&&!z&&d!==void 0&&(!Qp(d)||Qp(d)&&t)?(b=[...l,{name:t?m("Mixed"):xe(m("Custom (%s)"),d),slug:"custom",size:d}],S=b.length-1):t||(S=z?aM(d,l):tAt(d,l));const R=x.useMemo(()=>yo(S),[S])[1]||k[0]?.value,T=()=>{d===void 0&&o("0")},E=Q=>d===void 0?void 0:l[Q]?.name,B=parseFloat(S,10),N=Q=>!isNaN(parseFloat(Q))?Q:void 0,j=(Q,te)=>{const ee=parseInt(Q,10);if(te==="selectList"){if(ee===0)return;if(ee===1)return"0"}else if(ee===0)return"0";return`var:preset|spacing|${l[Q]?.slug}`},I=Q=>{o([Q,R].join(""))},P=t?m("Mixed"):null,$=b.map((Q,te)=>({key:te,name:Q.name})),F=l.slice(1,l.length-1).map((Q,te)=>({value:te+1,label:void 0})),X=Iz.includes(c)&&i?vO[c]:"",Z=i?u?.toLowerCase():u,V=xe(We("%1$s %2$s","spacing"),X,Z).trim();return a.jsxs(Ot,{className:"spacing-sizes-control__wrapper",children:[e&&a.jsx(qo,{className:"spacing-sizes-control__icon",icon:e,size:24}),z&&a.jsxs(a.Fragment,{children:[a.jsx(Ro,{onMouseOver:s,onMouseOut:r,onFocus:s,onBlur:r,onChange:Q=>o(N(Q)),value:S,units:k,min:_,placeholder:P,disableUnits:t,label:V,hideLabelFromVision:!0,className:"spacing-sizes-control__custom-value-input",size:"__unstable-large",onDragStart:()=>{d?.charAt(0)==="-"&&v(0)},onDrag:()=>{d?.charAt(0)==="-"&&v(0)},onDragEnd:()=>{v(n)}}),a.jsx(bo,{__next40pxDefaultSize:!0,onMouseOver:s,onMouseOut:r,onFocus:s,onBlur:r,value:B,min:0,max:(p=Gee[R]?.max)!==null&&p!==void 0?p:10,step:(f=Gee[R]?.steps)!==null&&f!==void 0?f:.1,withInputField:!1,onChange:I,className:"spacing-sizes-control__custom-value-range",__nextHasNoMarginBottom:!0,label:V,hideLabelFromVision:!0})]}),h&&!z&&a.jsx(bo,{__next40pxDefaultSize:!0,onMouseOver:s,onMouseOut:r,className:"spacing-sizes-control__range-control",value:S,onChange:Q=>o(j(Q)),onMouseDown:Q=>{Q?.nativeEvent?.offsetX<35&&T()},withInputField:!1,"aria-valuenow":S,"aria-valuetext":l[S]?.name,renderTooltipContent:E,min:0,max:l.length-1,marks:F,label:V,hideLabelFromVision:!0,__nextHasNoMarginBottom:!0,onFocus:s,onBlur:r}),!h&&!z&&a.jsx(ob,{className:"spacing-sizes-control__custom-select-control",value:$.find(Q=>Q.key===S)||"",onChange:Q=>{o(j(Q.selectedItem.key,"selectList"))},options:$,label:V,hideLabelFromVision:!0,size:"__unstable-large",onMouseOver:s,onMouseOut:r,onFocus:s,onBlur:r}),!g&&a.jsx(Ce,{label:m(z?"Use size preset":"Set custom size"),icon:$P,onClick:()=>{A(!z)},isPressed:z,size:"small",className:"spacing-sizes-control__custom-toggle",iconSize:24})]})}const Kee=["vertical","horizontal"];function TTt({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,sides:r,spacingSizes:s,type:i,values:c}){const l=d=>p=>{if(!t)return;const f={...Object.keys(c).reduce((b,h)=>(b[h]=g_(c[h],s),b),{})};d==="vertical"&&(f.top=p,f.bottom=p),d==="horizontal"&&(f.left=p,f.right=p),t(f)},u=r?.length?Kee.filter(d=>khe(r,d)):Kee;return a.jsx(a.Fragment,{children:u.map(d=>{const p=d==="vertical"?c.top:c.left;return a.jsx(iI,{icon:whe[d],label:vO[d],minimumCustomValue:e,onChange:l(d),onMouseOut:n,onMouseOver:o,side:d,spacingSizes:s,type:i,value:p,withInputField:!1},`spacing-sizes-control-${d}`)})})}function ETt({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,sides:r,spacingSizes:s,type:i,values:c}){const l=r?.length?Iz.filter(d=>r.includes(d)):Iz,u=d=>p=>{const f={...Object.keys(c).reduce((b,h)=>(b[h]=g_(c[h],s),b),{})};f[d]=p,t(f)};return a.jsx(a.Fragment,{children:l.map(d=>a.jsx(iI,{icon:whe[d],label:vO[d],minimumCustomValue:e,onChange:u(d),onMouseOut:n,onMouseOver:o,side:d,spacingSizes:s,type:i,value:c[d],withInputField:!1},`spacing-sizes-control-${d}`))})}function WTt({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,showSideInLabel:r,side:s,spacingSizes:i,type:c,values:l}){const u=d=>p=>{const f={...Object.keys(l).reduce((b,h)=>(b[h]=g_(l[h],i),b),{})};f[d]=p,t(f)};return a.jsx(iI,{label:vO[s],minimumCustomValue:e,onChange:u(s),onMouseOut:n,onMouseOver:o,showSideInLabel:r,side:s,spacingSizes:i,type:c,value:l[s],withInputField:!1})}function NTt({isLinked:e,...t}){const n=m(e?"Unlink sides":"Link sides");return a.jsx(B0,{text:n,children:a.jsx(Ce,{...t,size:"small",icon:e?xa:Pl,iconSize:24,"aria-label":n})})}const KR=[],BTt=new Intl.Collator("und",{numeric:!0}).compare;function WMe(){const[e,t,n,o]=Un("spacing.spacingSizes.custom","spacing.spacingSizes.theme","spacing.spacingSizes.default","spacing.defaultSpacingSizes"),r=e??KR,s=t??KR,i=n&&o!==!1?n:KR;return x.useMemo(()=>{const c=[{name:m("None"),slug:"0",size:0},...r,...s,...i];return c.every(({slug:l})=>/^[0-9]/.test(l))&&c.sort((l,u)=>BTt(l.slug,u.slug)),c.length>xhe?[{name:m("Default"),slug:"default",size:void 0},...c]:c},[r,s,i])}function g4({inputProps:e,label:t,minimumCustomValue:n=0,onChange:o,onMouseOut:r,onMouseOver:s,showSideInLabel:i=!0,sides:c=Iz,useSelect:l,values:u}){const d=WMe(),p=u||eAt,f=c?.length===1,b=c?.includes("horizontal")&&c?.includes("vertical")&&c?.length===2,[h,g]=x.useState(oAt(p,c)),z=()=>{g(h===Fu.axial?Fu.custom:Fu.axial)},_={...e,minimumCustomValue:n,onChange:k=>{const S={...u,...k};o(S)},onMouseOut:r,onMouseOver:s,sides:c,spacingSizes:d,type:t,useSelect:l,values:p},v=()=>h===Fu.axial?a.jsx(TTt,{..._}):h===Fu.custom?a.jsx(ETt,{..._}):a.jsx(WTt,{side:h,..._,showSideInLabel:i}),M=Iz.includes(h)&&i?vO[h]:"",y=xe(We("%1$s %2$s","spacing"),t,M).trim();return a.jsxs("fieldset",{className:"spacing-sizes-control",children:[a.jsxs(Ot,{className:"spacing-sizes-control__header",children:[a.jsx(no.VisualLabel,{as:"legend",className:"spacing-sizes-control__label",children:y}),!f&&!b&&a.jsx(NTt,{label:t,onClick:z,isLinked:h===Fu.axial})]}),a.jsx(dt,{spacing:.5,children:v()})]})}const Yee={px:{max:1e3,step:1},"%":{max:100,step:1},vw:{max:100,step:1},vh:{max:100,step:1},em:{max:50,step:.1},rem:{max:50,step:.1},svw:{max:100,step:1},lvw:{max:100,step:1},dvw:{max:100,step:1},svh:{max:100,step:1},lvh:{max:100,step:1},dvh:{max:100,step:1},vi:{max:100,step:1},svi:{max:100,step:1},lvi:{max:100,step:1},dvi:{max:100,step:1},vb:{max:100,step:1},svb:{max:100,step:1},lvb:{max:100,step:1},dvb:{max:100,step:1},vmin:{max:100,step:1},svmin:{max:100,step:1},lvmin:{max:100,step:1},dvmin:{max:100,step:1},vmax:{max:100,step:1},svmax:{max:100,step:1},lvmax:{max:100,step:1},dvmax:{max:100,step:1}};function LTt({label:e=m("Height"),onChange:t,value:n}){var o,r;const s=parseFloat(n),[i]=Un("spacing.units"),c=U1({availableUnits:i||["%","px","em","rem","vh","vw"]}),l=x.useMemo(()=>yo(n),[n])[1]||c[0]?.value||"px",u=p=>{t([p,l].join(""))},d=p=>{const[f,b]=yo(n);["em","rem"].includes(p)&&b==="px"?t((f/16).toFixed(2)+p):["em","rem"].includes(b)&&p==="px"?t(Math.round(f*16)+p):["%","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax"].includes(p)&&f>100&&t(100+p)};return a.jsxs("fieldset",{className:"block-editor-height-control",children:[a.jsx(no.VisualLabel,{as:"legend",children:e}),a.jsxs(Yo,{children:[a.jsx(Tn,{isBlock:!0,children:a.jsx(Ro,{value:n,units:c,onChange:t,onUnitChange:d,min:0,size:"__unstable-large",label:e,hideLabelFromVision:!0})}),a.jsx(Tn,{isBlock:!0,children:a.jsx(t1,{marginX:2,marginBottom:0,children:a.jsx(bo,{__next40pxDefaultSize:!0,value:s,min:0,max:(o=Yee[l]?.max)!==null&&o!==void 0?o:100,step:(r=Yee[l]?.step)!==null&&r!==void 0?r:.1,withInputField:!1,onChange:u,__nextHasNoMarginBottom:!0,label:e,hideLabelFromVision:!0})})})]})]})}function U_(e,t){const{getBlockOrder:n,getBlockAttributes:o}=G(J);return(s,i)=>{const c=(i-1)*t+s-1;let l=0;for(const d of n(e)){var u;const{columnStart:p,rowStart:f}=(u=o(d).style?.layout)!==null&&u!==void 0?u:{};(f-1)*t+p-1!!s,u=m(c==="horizontal"?"Width":"Height"),[d]=Un("spacing.units"),p=U1({availableUnits:d||["%","px","em","rem","vh","vw"]}),f=()=>{t({selfStretch:void 0,flexSize:void 0})};return x.useEffect(()=>{s==="fixed"&&!i&&t({...e,selfStretch:"fit"})},[]),a.jsxs(dt,{as:tt,spacing:2,hasValue:l,label:u,onDeselect:f,isShownByDefault:o,panelId:r,children:[a.jsxs(Do,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:DTt(n),value:s||"fit",help:PTt(s,n),onChange:b=>{t({selfStretch:b,flexSize:b!=="fixed"?null:i})},isBlock:!0,children:[a.jsx(Kn,{value:"fit",label:We("Fit","Intrinsic block width in flex layout")},"fit"),a.jsx(Kn,{value:"fill",label:We("Grow","Block with expanding width in flex layout")},"fill"),a.jsx(Kn,{value:"fixed",label:We("Fixed","Block with fixed width in flex layout")},"fixed")]}),s==="fixed"&&a.jsx(Ro,{size:"__unstable-large",units:p,onChange:b=>{t({selfStretch:s,flexSize:b})},value:i,label:u,hideLabelFromVision:!0})]})}function DTt(e){const{orientation:t="horizontal"}=e;return m(t==="horizontal"?"Width":"Height")}function FTt({childLayout:e,onChange:t,parentLayout:n,isShownByDefault:o,panelId:r}){const{columnStart:s,rowStart:i,columnSpan:c,rowSpan:l}=e,{columnCount:u=3,rowCount:d}=n??{},p=G(v=>v(J).getBlockRootClientId(r)),{moveBlocksToPosition:f,__unstableMarkNextChangeAsNotPersistent:b}=Oe(J),h=U_(p,u),g=()=>!!s||!!i,z=()=>!!c||!!l,A=()=>{t({columnStart:void 0,rowStart:void 0})},_=()=>{t({columnSpan:void 0,rowSpan:void 0})};return a.jsxs(a.Fragment,{children:[a.jsxs(Ot,{as:tt,hasValue:z,label:m("Grid span"),onDeselect:_,isShownByDefault:o,panelId:r,children:[a.jsx(B1,{size:"__unstable-large",label:m("Column span"),type:"number",onChange:v=>{const M=v===""?1:parseInt(v,10);t({columnStart:s,rowStart:i,rowSpan:l,columnSpan:M})},value:c??1,min:1}),a.jsx(B1,{size:"__unstable-large",label:m("Row span"),type:"number",onChange:v=>{const M=v===""?1:parseInt(v,10);t({columnStart:s,rowStart:i,columnSpan:c,rowSpan:M})},value:l??1,min:1})]}),window.__experimentalEnableGridInteractivity&&u&&a.jsxs(Yo,{as:tt,hasValue:g,label:m("Grid placement"),onDeselect:A,isShownByDefault:!1,panelId:r,children:[a.jsx(Tn,{style:{width:"50%"},children:a.jsx(B1,{size:"__unstable-large",label:m("Column"),type:"number",onChange:v=>{const M=v===""?1:parseInt(v,10);t({columnStart:M,rowStart:i,columnSpan:c,rowSpan:l}),b(),f([r],p,p,h(M,i))},value:s??1,min:1,max:u?u-(c??1)+1:void 0})}),a.jsx(Tn,{style:{width:"50%"},children:a.jsx(B1,{size:"__unstable-large",label:m("Row"),type:"number",onChange:v=>{const M=v===""?1:parseInt(v,10);t({columnStart:s,rowStart:M,columnSpan:c,rowSpan:l}),b(),f([r],p,p,h(s,M))},value:i??1,min:1,max:d?d-(l??1)+1:void 0})})]})]})}function NMe({panelId:e,value:t,onChange:n=()=>{},options:o,defaultValue:r="auto",hasValue:s,isShownByDefault:i=!0}){const c=t??"auto",[l,u,d]=Un("dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios"),p=u?.map(({name:h,ratio:g})=>({label:h,value:g})),f=l?.map(({name:h,ratio:g})=>({label:h,value:g})),b=[{label:We("Original","Aspect ratio option for dimensions control"),value:"auto"},...d?f:[],...p||[],{label:We("Custom","Aspect ratio option for dimensions control"),value:"custom",disabled:!0,hidden:!0}];return a.jsx(tt,{hasValue:s||(()=>c!==r),label:m("Aspect ratio"),onDeselect:()=>n(void 0),isShownByDefault:i,panelId:e,children:a.jsx(Pn,{label:m("Aspect ratio"),value:c,options:o??b,onChange:n,size:"__unstable-large",__nextHasNoMarginBottom:!0})})}const YR=["horizontal","vertical"];function BMe(e){const t=LMe(e),n=PMe(e),o=jMe(e),r=IMe(e),s=DMe(e),i=FMe(e),c=$Me(e),l=VMe(e);return t||n||o||r||s||i||c||l}function LMe(e){return e?.layout?.contentSize}function PMe(e){return e?.layout?.wideSize}function jMe(e){return e?.spacing?.padding}function IMe(e){return e?.spacing?.margin}function DMe(e){return e?.spacing?.blockGap}function FMe(e){return e?.dimensions?.minHeight}function $Me(e){return e?.dimensions?.aspectRatio}function VMe(e){var t;const{type:n="default",default:{type:o="default"}={},allowSizingOnChildren:r=!1}=(t=e?.parentLayout)!==null&&t!==void 0?t:{},s=(o==="flex"||n==="flex"||o==="grid"||n==="grid")&&r;return!!e?.layout&&s}function $Tt(e){const{defaultSpacingSizes:t,spacingSizes:n}=e?.spacing||{};return t!==!1&&n?.default?.length>0||n?.theme?.length>0||n?.custom?.length>0}function Zee(e,t){if(!t||!e)return e;const n={};return t.forEach(o=>{o==="vertical"&&(n.top=e.top,n.bottom=e.bottom),o==="horizontal"&&(n.left=e.left,n.right=e.right),n[o]=e?.[o]}),n}function Qee(e){return e&&typeof e=="string"?{top:e,right:e,bottom:e,left:e}:e}function VTt(e,t){return e&&(typeof e=="string"?t?{top:e,right:e,bottom:e,left:e}:{top:e}:{...e,right:e?.left,bottom:e?.top})}function HTt({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){const s=dp(),i=()=>{const c=e(n);t(c)};return a.jsx(En,{label:m("Dimensions"),resetAll:i,panelId:o,dropdownMenuProps:s,children:r})}const el={contentSize:!0,wideSize:!0,padding:!0,margin:!0,blockGap:!0,minHeight:!0,aspectRatio:!0,childLayout:!0};function HMe({as:e=HTt,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:s,defaultControls:i=el,onVisualize:c=()=>{},includeLayoutControls:l=!1}){var u,d,p,f,b,h,g,z;const{dimensions:A,spacing:_}=r,v=Ue=>Ue&&typeof Ue=="object"?Object.keys(Ue).reduce((yt,fn)=>(yt[fn]=ua({settings:{dimensions:A,spacing:_}},"",Ue[fn]),yt),{}):ua({settings:{dimensions:A,spacing:_}},"",Ue),M=$Tt(r),y=U1({availableUnits:r?.spacing?.units||["%","px","em","rem","vw"]}),k=-1/0,[S,C]=x.useState(k),R=LMe(r)&&l,T=v(o?.layout?.contentSize),E=Ue=>{n(gn(t,["layout","contentSize"],Ue||void 0))},B=()=>!!t?.layout?.contentSize,N=()=>E(void 0),j=PMe(r)&&l,I=v(o?.layout?.wideSize),P=Ue=>{n(gn(t,["layout","wideSize"],Ue||void 0))},$=()=>!!t?.layout?.wideSize,F=()=>P(void 0),X=jMe(r),Z=v(o?.spacing?.padding),V=Qee(Z),Q=Array.isArray(r?.spacing?.padding)?r?.spacing?.padding:r?.spacing?.padding?.sides,te=Q&&Q.some(Ue=>YR.includes(Ue)),ee=Ue=>{const yt=Zee(Ue,Q);n(gn(t,["spacing","padding"],yt))},ue=()=>!!t?.spacing?.padding&&Object.keys(t?.spacing?.padding).length,ce=()=>ee(void 0),me=()=>c("padding"),de=IMe(r),Ae=v(o?.spacing?.margin),ye=Qee(Ae),Ne=Array.isArray(r?.spacing?.margin)?r?.spacing?.margin:r?.spacing?.margin?.sides,je=Ne&&Ne.some(Ue=>YR.includes(Ue)),ie=Ue=>{const yt=Zee(Ue,Ne);n(gn(t,["spacing","margin"],yt))},we=()=>!!t?.spacing?.margin&&Object.keys(t?.spacing?.margin).length,re=()=>ie(void 0),pe=()=>c("margin"),ke=DMe(r),Se=Array.isArray(r?.spacing?.blockGap)?r?.spacing?.blockGap:r?.spacing?.blockGap?.sides,se=Se&&Se.some(Ue=>YR.includes(Ue)),L=v(o?.spacing?.blockGap),U=VTt(L,se),ne=Ue=>{n(gn(t,["spacing","blockGap"],Ue))},ve=Ue=>{Ue||ne(null),!se&&Ue?.hasOwnProperty("top")?ne(Ue.top):ne({top:Ue?.top,left:Ue?.left})},qe=()=>ne(void 0),Pe=()=>!!t?.spacing?.blockGap,rt=FMe(r),qt=v(o?.dimensions?.minHeight),wt=Ue=>{const yt=gn(t,["dimensions","minHeight"],Ue);n(gn(yt,["dimensions","aspectRatio"],void 0))},Bt=()=>{wt(void 0)},ae=()=>!!t?.dimensions?.minHeight,H=$Me(r),Y=v(o?.dimensions?.aspectRatio),fe=Ue=>{const yt=gn(t,["dimensions","aspectRatio"],Ue);n(gn(yt,["dimensions","minHeight"],void 0))},Re=()=>!!t?.dimensions?.aspectRatio,be=VMe(r),ze=o?.layout,nt=Ue=>{n({...t,layout:{...Ue}})},Mt=x.useCallback(Ue=>({...Ue,layout:Ii({...Ue?.layout,contentSize:void 0,wideSize:void 0,selfStretch:void 0,flexSize:void 0,columnStart:void 0,rowStart:void 0,columnSpan:void 0,rowSpan:void 0}),spacing:{...Ue?.spacing,padding:void 0,margin:void 0,blockGap:void 0},dimensions:{...Ue?.dimensions,minHeight:void 0,aspectRatio:void 0}}),[]),ot=()=>c(!1);return a.jsxs(e,{resetAllFilter:Mt,value:t,onChange:n,panelId:s,children:[(R||j)&&a.jsx("span",{className:"span-columns",children:m("Set the width of the main content area.")}),R&&a.jsx(tt,{label:m("Content width"),hasValue:B,onDeselect:N,isShownByDefault:(u=i.contentSize)!==null&&u!==void 0?u:el.contentSize,panelId:s,children:a.jsx(Ro,{__next40pxDefaultSize:!0,label:m("Content width"),labelPosition:"top",value:T||"",onChange:Ue=>{E(Ue)},units:y,prefix:a.jsx(Ld,{variant:"icon",children:a.jsx(wn,{icon:Sw})})})}),j&&a.jsx(tt,{label:m("Wide width"),hasValue:$,onDeselect:F,isShownByDefault:(d=i.wideSize)!==null&&d!==void 0?d:el.wideSize,panelId:s,children:a.jsx(Ro,{__next40pxDefaultSize:!0,label:m("Wide width"),labelPosition:"top",value:I||"",onChange:Ue=>{P(Ue)},units:y,prefix:a.jsx(Ld,{variant:"icon",children:a.jsx(wn,{icon:VP})})})}),X&&a.jsxs(tt,{hasValue:ue,label:m("Padding"),onDeselect:ce,isShownByDefault:(p=i.padding)!==null&&p!==void 0?p:el.padding,className:oe({"tools-panel-item-spacing":M}),panelId:s,children:[!M&&a.jsx(o4,{__next40pxDefaultSize:!0,values:V,onChange:ee,label:m("Padding"),sides:Q,units:y,allowReset:!1,splitOnAxis:te,inputProps:{onMouseOver:me,onMouseOut:ot}}),M&&a.jsx(g4,{values:V,onChange:ee,label:m("Padding"),sides:Q,units:y,allowReset:!1,onMouseOver:me,onMouseOut:ot})]}),de&&a.jsxs(tt,{hasValue:we,label:m("Margin"),onDeselect:re,isShownByDefault:(f=i.margin)!==null&&f!==void 0?f:el.margin,className:oe({"tools-panel-item-spacing":M}),panelId:s,children:[!M&&a.jsx(o4,{__next40pxDefaultSize:!0,values:ye,onChange:ie,inputProps:{min:S,onDragStart:()=>{C(0)},onDragEnd:()=>{C(k)},onMouseOver:pe,onMouseOut:ot},label:m("Margin"),sides:Ne,units:y,allowReset:!1,splitOnAxis:je}),M&&a.jsx(g4,{values:ye,onChange:ie,minimumCustomValue:-1/0,label:m("Margin"),sides:Ne,units:y,allowReset:!1,onMouseOver:pe,onMouseOut:ot})]}),ke&&a.jsxs(tt,{hasValue:Pe,label:m("Block spacing"),onDeselect:qe,isShownByDefault:(b=i.blockGap)!==null&&b!==void 0?b:el.blockGap,className:oe({"tools-panel-item-spacing":M,"single-column":!M&&!se}),panelId:s,children:[!M&&(se?a.jsx(o4,{__next40pxDefaultSize:!0,label:m("Block spacing"),min:0,onChange:ve,units:y,sides:Se,values:U,allowReset:!1,splitOnAxis:se}):a.jsx(Ro,{__next40pxDefaultSize:!0,label:m("Block spacing"),min:0,onChange:ne,units:y,value:L})),M&&a.jsx(g4,{label:m("Block spacing"),min:0,onChange:ve,showSideInLabel:!1,sides:se?Se:["top"],values:U,allowReset:!1})]}),be&&a.jsx(jTt,{value:ze,onChange:nt,parentLayout:r?.parentLayout,panelId:s,isShownByDefault:(h=i.childLayout)!==null&&h!==void 0?h:el.childLayout}),rt&&a.jsx(tt,{hasValue:ae,label:m("Minimum height"),onDeselect:Bt,isShownByDefault:(g=i.minHeight)!==null&&g!==void 0?g:el.minHeight,panelId:s,children:a.jsx(LTt,{label:m("Minimum height"),value:qt,onChange:wt})}),H&&a.jsx(NMe,{hasValue:Re,value:Y,onChange:fe,panelId:s,isShownByDefault:(z=i.aspectRatio)!==null&&z!==void 0?z:el.aspectRatio})]})}function UMe(e){return[...e].sort((n,o)=>e.filter(r=>r===o).length-e.filter(r=>r===n).length).shift()}function XMe(e={}){const{flat:t,...n}=e;return t||UMe(Object.values(n).filter(Boolean))||"px"}function aI(e={}){if(typeof e=="string")return e;const t=Object.values(e).map(c=>yo(c)),n=t.map(c=>{var l;return(l=c[0])!==null&&l!==void 0?l:""}),o=t.map(c=>c[1]),r=n.every(c=>c===n[0])?n[0]:"",s=UMe(o);return r===0||r?`${r}${s}`:void 0}function GMe(e={}){const t=aI(e);return typeof e=="string"?!1:isNaN(parseFloat(t))}function KMe(e){return e?typeof e=="string"?!0:!!Object.values(e).filter(n=>!!n||n===0).length:!1}function UTt({onChange:e,selectedUnits:t,setSelectedUnits:n,values:o,...r}){let s=aI(o);s===void 0&&(s=XMe(t));const c=KMe(o)&&GMe(o),l=c?m("Mixed"):null,u=p=>{const b=!isNaN(parseFloat(p))?p:void 0;e(b)},d=p=>{n({topLeft:p,topRight:p,bottomLeft:p,bottomRight:p})};return a.jsx(Ro,{...r,"aria-label":m("Border radius"),disableUnits:c,isOnly:!0,value:s,onChange:u,onUnitChange:d,placeholder:l,size:"__unstable-large"})}const XTt={topLeft:m("Top left"),topRight:m("Top right"),bottomLeft:m("Bottom left"),bottomRight:m("Bottom right")};function GTt({onChange:e,selectedUnits:t,setSelectedUnits:n,values:o,...r}){const s=l=>u=>{if(!e)return;const p=!isNaN(parseFloat(u))?u:void 0;e({...c,[l]:p})},i=l=>u=>{const d={...t};d[l]=u,n(d)},c=typeof o!="string"?o:{topLeft:o,topRight:o,bottomLeft:o,bottomRight:o};return a.jsx("div",{className:"components-border-radius-control__input-controls-wrapper",children:Object.entries(XTt).map(([l,u])=>{const[d,p]=yo(c[l]),f=c[l]?p:t[l]||t.flat;return a.jsx(B0,{text:u,placement:"top",children:a.jsx("div",{className:"components-border-radius-control__tooltip-wrapper",children:a.jsx(Ro,{...r,"aria-label":u,value:[d,f].join(""),onChange:s(l),onUnitChange:i(l),size:"__unstable-large"})})},l)})})}function KTt({isLinked:e,...t}){const n=m(e?"Unlink radii":"Link radii");return a.jsx(Ce,{...t,className:"component-border-radius-control__linked-button",size:"small",icon:e?xa:Pl,iconSize:24,label:n})}const YTt={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},ZR=0,ZTt={px:100,em:20,rem:20};function QTt({onChange:e,values:t}){const[n,o]=x.useState(!KMe(t)||!GMe(t)),[r,s]=x.useState({flat:typeof t=="string"?yo(t)[1]:void 0,topLeft:yo(t?.topLeft)[1],topRight:yo(t?.topRight)[1],bottomLeft:yo(t?.bottomLeft)[1],bottomRight:yo(t?.bottomRight)[1]}),[i]=Un("spacing.units"),c=U1({availableUnits:i||["px","em","rem"]}),l=XMe(r),d=(c&&c.find(h=>h.value===l))?.step||1,[p]=yo(aI(t)),f=()=>o(!n),b=h=>{e(h!==void 0?`${h}${l}`:void 0)};return a.jsxs("fieldset",{className:"components-border-radius-control",children:[a.jsx(no.VisualLabel,{as:"legend",children:m("Radius")}),a.jsxs("div",{className:"components-border-radius-control__wrapper",children:[n?a.jsxs(a.Fragment,{children:[a.jsx(UTt,{className:"components-border-radius-control__unit-control",values:t,min:ZR,onChange:e,selectedUnits:r,setSelectedUnits:s,units:c}),a.jsx(bo,{__next40pxDefaultSize:!0,label:m("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:p??"",min:ZR,max:ZTt[l],initialPosition:0,withInputField:!1,onChange:b,step:d,__nextHasNoMarginBottom:!0})]}):a.jsx(GTt,{min:ZR,onChange:e,selectedUnits:r,setSelectedUnits:s,values:t||YTt,units:c}),a.jsx(KTt,{onClick:f,isLinked:n})]})]})}function ub(){const[e,t,n,o,r,s,i,c,l,u]=Un("color.custom","color.palette.custom","color.palette.theme","color.palette.default","color.defaultPalette","color.customGradient","color.gradients.custom","color.gradients.theme","color.gradients.default","color.defaultGradients"),d={disableCustomColors:!e,disableCustomGradients:!s};return d.colors=x.useMemo(()=>{const p=[];return n&&n.length&&p.push({name:We("Theme","Indicates this palette comes from the theme."),slug:"theme",colors:n}),r&&o&&o.length&&p.push({name:We("Default","Indicates this palette comes from WordPress."),slug:"default",colors:o}),t&&t.length&&p.push({name:We("Custom","Indicates this palette is created by the user."),slug:"custom",colors:t}),p},[t,n,o,r]),d.gradients=x.useMemo(()=>{const p=[];return c&&c.length&&p.push({name:We("Theme","Indicates this palette comes from the theme."),slug:"theme",gradients:c}),u&&l&&l.length&&p.push({name:We("Default","Indicates this palette comes from WordPress."),slug:"default",gradients:l}),i&&i.length&&p.push({name:We("Custom","Indicates this palette is created by the user."),slug:"custom",gradients:i}),p},[i,c,l,u]),d.hasColorsOrGradients=!!d.colors.length||!!d.gradients.length,d}const Sm="__experimentalBorder",Kx="shadow",Jee=(e,t,n)=>{let o;return e.some(r=>r.colors.some(s=>s[t]===n?(o=s,!0):!1)),o},a2=({colors:e,namedColor:t,customColor:n})=>{if(t){const r=Jee(e,"slug",t);if(r)return r}if(!n)return{color:void 0};const o=Jee(e,"color",n);return o||{color:n}};function pv(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function YMe(e){if(Pd(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:Ii(o),borderColor:n}}function ZMe(e){return Pd(e.style?.border)?e.style:{...e.style,border:{...e.style?.border,color:e.borderColor?"var:preset|color|"+e.borderColor:e.style?.border?.color}}}function JTt({label:e,children:t,resetAllFilter:n}){const o=x.useCallback(r=>{const s=ZMe(r),i=n(s);return{...r,...YMe(i)}},[n]);return a.jsx(et,{group:"border",resetAllFilter:o,label:e,children:t})}function eEt({clientId:e,name:t,setAttributes:n,settings:o}){const r=nze(o);function s(p){const{style:f,borderColor:b}=p(J).getBlockAttributes(e)||{};return{style:f,borderColor:b}}const{style:i,borderColor:c}=G(s,[e]),l=x.useMemo(()=>ZMe({style:i,borderColor:c}),[i,c]),u=p=>{n(YMe(p))};if(!r)return null;const d={...An(t,[Sm,"__experimentalDefaultControls"]),...An(t,[Kx,"__experimentalDefaultControls"])};return a.jsx(cze,{as:JTt,panelId:e,settings:o,value:l,onChange:u,defaultControls:d})}function X_(e,t="any"){const n=An(e,Sm);return n===!0?!0:t==="any"?!!(n?.color||n?.radius||n?.width||n?.style):!!n?.[t]}function G_({blockName:e,hasBorderControl:t,hasShadowControl:n}={}){const o=WO(e),r=cI(o);return!t&&!n&&e&&(t=r?.hasBorderColor||r?.hasBorderStyle||r?.hasBorderWidth||r?.hasBorderRadius,n=r?.hasShadow),m(t&&n?"Border & Shadow":n?"Shadow":"Border")}function tEt(e){return!X_(e,"color")||e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}}function QMe(e,t,n){if(!X_(t,"color")||W0(t,Sm,"color"))return e;const o=JMe(n),r=oe(e.className,o);return e.className=r||void 0,e}function JMe(e){const{borderColor:t,style:n}=e,o=Pt("border-color",t);return oe({"has-border-color":t||n?.border?.color,[o]:!!o})}function nEt({name:e,borderColor:t,style:n}){const{colors:o}=ub();if(!X_(e,"color")||W0(e,Sm,"color"))return{};const{color:r}=a2({colors:o,namedColor:t}),{color:s}=a2({colors:o,namedColor:pv(n?.border?.top?.color)}),{color:i}=a2({colors:o,namedColor:pv(n?.border?.right?.color)}),{color:c}=a2({colors:o,namedColor:pv(n?.border?.bottom?.color)}),{color:l}=a2({colors:o,namedColor:pv(n?.border?.left?.color)});return QMe({style:Ii({borderTopColor:s||r,borderRightColor:i||r,borderBottomColor:c||r,borderLeftColor:l||r})||{}},e,{borderColor:t,style:n})}const eze={useBlockProps:nEt,addSaveProps:QMe,attributeKeys:["borderColor","style"],hasSupport(e){return X_(e,"color")}};Bn("blocks.registerBlockType","core/border/addAttributes",tEt);const fv=[];function oEt({shadow:e,onShadowChange:t,settings:n}){const o=tze(n);return a.jsx("div",{className:"block-editor-global-styles__shadow-popover-container",children:a.jsxs(dt,{spacing:4,children:[a.jsx(_a,{level:5,children:m("Drop shadow")}),a.jsx(rEt,{presets:o,activeShadow:e,onSelect:t}),a.jsx("div",{className:"block-editor-global-styles__clear-shadow",children:a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>t(void 0),children:m("Clear")})})]})})}function rEt({presets:e,activeShadow:t,onSelect:n}){return e?a.jsx(C1,{role:"listbox",className:"block-editor-global-styles__shadow__list","aria-label":m("Drop shadows"),children:e.map(({name:o,slug:r,shadow:s})=>a.jsx(sEt,{label:o,isActive:s===t,type:r==="unset"?"unset":"preset",onSelect:()=>n(s===t?void 0:s),shadow:s},r))}):null}function sEt({type:e,label:t,isActive:n,onSelect:o,shadow:r}){return a.jsx(B0,{text:t,children:a.jsx(C1.Item,{role:"option","aria-label":t,"aria-selected":n,className:oe("block-editor-global-styles__shadow__item",{"is-active":n}),render:a.jsx("button",{className:oe("block-editor-global-styles__shadow-indicator",{unset:e==="unset"}),onClick:o,style:{boxShadow:r},"aria-label":t,children:n&&a.jsx(wn,{icon:M0})})})})}function iEt({shadow:e,onShadowChange:t,settings:n}){const o={placement:"left-start",offset:36,shift:!0};return a.jsx(so,{popoverProps:o,className:"block-editor-global-styles__shadow-dropdown",renderToggle:aEt(),renderContent:()=>a.jsx($s,{paddingSize:"medium",children:a.jsx(oEt,{shadow:e,onShadowChange:t,settings:n})})})}function aEt(){return({onToggle:e,isOpen:t})=>{const n={onClick:e,className:oe({"is-open":t}),"aria-expanded":t};return a.jsx(Ce,{__next40pxDefaultSize:!0,...n,children:a.jsxs(Ot,{justify:"flex-start",children:[a.jsx(wn,{className:"block-editor-global-styles__toggle-icon",icon:PQe,size:24}),a.jsx(Tn,{children:m("Drop shadow")})]})})}}function tze(e){return x.useMemo(()=>{var t;if(!e?.shadow)return fv;const n=e?.shadow?.defaultPresets,{default:o,theme:r,custom:s}=(t=e?.shadow?.presets)!==null&&t!==void 0?t:{},i={name:m("Unset"),slug:"unset",shadow:"none"},c=[...n&&o||fv,...r||fv,...s||fv];return c.length&&c.unshift(i),c},[e])}function nze(e){return Object.values(cI(e)).some(Boolean)}function cI(e){return{hasBorderColor:oze(e),hasBorderRadius:rze(e),hasBorderStyle:sze(e),hasBorderWidth:ize(e),hasShadow:aze(e)}}function oze(e){return e?.border?.color}function rze(e){return e?.border?.radius}function sze(e){return e?.border?.style}function ize(e){return e?.border?.width}function aze(e){const t=tze(e);return!!e?.shadow&&t.length>0}function cEt({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r,label:s}){const i=dp(),c=()=>{const l=e(n);t(l)};return a.jsx(En,{label:s,resetAll:c,panelId:o,dropdownMenuProps:i,children:r})}const lEt={radius:!0,color:!0,width:!0,shadow:!0};function cze({as:e=cEt,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:s,name:i,defaultControls:c=lEt}){var l,u,d,p;const f=pp(r),b=x.useCallback(V=>ua({settings:r},"",V),[r]),h=V=>{const te=f.flatMap(({colors:ee})=>ee).find(({color:ee})=>ee===V);return te?"var:preset|color|"+te.slug:V},g=x.useMemo(()=>{if(Pd(o?.border)){const V={...o?.border};return["top","right","bottom","left"].forEach(Q=>{V[Q]={...V[Q],color:b(V[Q]?.color)}}),V}return{...o?.border,color:o?.border?.color?b(o?.border?.color):void 0}},[o?.border,b]),z=V=>n({...t,border:V}),A=oze(r),_=sze(r),v=ize(r),M=rze(r),y=b(g?.radius),k=V=>z({...g,radius:V}),S=()=>{const V=t?.border?.radius;return typeof V=="object"?Object.entries(V).some(Boolean):!!V},C=aze(r),R=b(o?.shadow),T=(l=r?.shadow?.presets)!==null&&l!==void 0?l:{},E=(u=(d=(p=T.custom)!==null&&p!==void 0?p:T.theme)!==null&&d!==void 0?d:T.default)!==null&&u!==void 0?u:[],B=V=>{const Q=E?.find(({shadow:te})=>te===V)?.slug;n(gn(t,["shadow"],Q?`var:preset|shadow|${Q}`:V||void 0))},N=()=>!!t?.shadow,j=()=>B(void 0),I=()=>{if(S())return z({radius:t?.border?.radius});z(void 0)},P=V=>{const Q={...V};Pd(Q)?["top","right","bottom","left"].forEach(te=>{Q[te]&&(Q[te]={...Q[te],color:h(Q[te]?.color)})}):Q&&(Q.color=h(Q.color)),z({radius:g?.radius,...Q})},$=x.useCallback(V=>({...V,border:void 0,shadow:void 0}),[]),F=c?.color||c?.width,X=A||_||v||M,Z=G_({blockName:i,hasShadowControl:C,hasBorderControl:X});return a.jsxs(e,{resetAllFilter:$,value:t,onChange:n,panelId:s,label:Z,children:[(v||A)&&a.jsx(tt,{hasValue:()=>F0t(t?.border),label:m("Border"),onDeselect:()=>I(),isShownByDefault:F,panelId:s,children:a.jsx(J0t,{colors:f,enableAlpha:!0,enableStyle:_,onChange:P,popoverOffset:40,popoverPlacement:"left-start",value:g,__experimentalIsRenderedInSidebar:!0,size:"__unstable-large",hideLabelFromVision:!C,label:m("Border")})}),M&&a.jsx(tt,{hasValue:S,label:m("Radius"),onDeselect:()=>k(void 0),isShownByDefault:c.radius,panelId:s,children:a.jsx(QTt,{values:y,onChange:V=>{k(V||void 0)}})}),C&&a.jsxs(tt,{label:m("Shadow"),hasValue:N,onDeselect:j,isShownByDefault:c.shadow,panelId:s,children:[X?a.jsx(no.VisualLabel,{as:"legend",children:m("Shadow")}):null,a.jsx(tb,{isBordered:!0,isSeparated:!0,children:a.jsx(iEt,{shadow:R,onShadowChange:B,settings:r})})]})]})}const{Tabs:Zb}=ct(tr),uEt=["colors","disableCustomColors","gradients","disableCustomGradients"],Ia={color:"color",gradient:"gradient"};function lze({colors:e,gradients:t,disableCustomColors:n,disableCustomGradients:o,__experimentalIsRenderedInSidebar:r,className:s,label:i,onColorChange:c,onGradientChange:l,colorValue:u,gradientValue:d,clearable:p,showTitle:f=!0,enableAlpha:b,headingLevel:h}){const g=c&&(e&&e.length>0||!n),z=l&&(t&&t.length>0||!o);if(!g&&!z)return null;const A={[Ia.color]:a.jsx(Hw,{value:u,onChange:z?v=>{c(v),l()}:c,colors:e,disableCustomColors:n,__experimentalIsRenderedInSidebar:r,clearable:p,enableAlpha:b,headingLevel:h}),[Ia.gradient]:a.jsx(eit,{value:d,onChange:g?v=>{l(v),c()}:l,gradients:t,disableCustomGradients:o,__experimentalIsRenderedInSidebar:r,clearable:p,headingLevel:h})},_=v=>a.jsx("div",{className:"block-editor-color-gradient-control__panel",children:A[v]});return a.jsx(no,{__nextHasNoMarginBottom:!0,className:oe("block-editor-color-gradient-control",s),children:a.jsx("fieldset",{className:"block-editor-color-gradient-control__fieldset",children:a.jsxs(dt,{spacing:1,children:[f&&a.jsx("legend",{children:a.jsx("div",{className:"block-editor-color-gradient-control__color-indicator",children:a.jsx(no.VisualLabel,{children:i})})}),g&&z&&a.jsx("div",{children:a.jsxs(Zb,{defaultTabId:d?Ia.gradient:!!g&&Ia.color,children:[a.jsxs(Zb.TabList,{children:[a.jsx(Zb.Tab,{tabId:Ia.color,children:m("Color")}),a.jsx(Zb.Tab,{tabId:Ia.gradient,children:m("Gradient")})]}),a.jsx(Zb.TabPanel,{tabId:Ia.color,className:"block-editor-color-gradient-control__panel",focusable:!1,children:A.color}),a.jsx(Zb.TabPanel,{tabId:Ia.gradient,className:"block-editor-color-gradient-control__panel",focusable:!1,children:A.gradient})]})}),!z&&_(Ia.color),!g&&_(Ia.gradient)]})})})}function dEt(e){const[t,n,o,r]=Un("color.palette","color.gradients","color.custom","color.customGradient");return a.jsx(lze,{colors:t,gradients:n,disableCustomColors:!o,disableCustomGradients:!r,...e})}function uze(e){return uEt.every(t=>e.hasOwnProperty(t))?a.jsx(lze,{...e}):a.jsx(dEt,{...e})}function dze(e){const t=pze(e),n=mze(e),o=fze(e),r=Iu(e),s=hze(e),i=bze(e);return t||n||o||r||s||i}function pze(e){const t=pp(e);return e?.color?.text&&(t?.length>0||e?.color?.custom)}function fze(e){const t=pp(e);return e?.color?.link&&(t?.length>0||e?.color?.custom)}function bze(e){const t=pp(e);return e?.color?.caption&&(t?.length>0||e?.color?.custom)}function Iu(e){const t=pp(e),n=$_(e);return e?.color?.heading&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function hze(e){const t=pp(e),n=$_(e);return e?.color?.button&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function mze(e){const t=pp(e),n=$_(e);return e?.color?.background&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function pEt({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){const s=dp(),i=()=>{const c=e(n);t(c)};return a.jsx(En,{label:m("Elements"),resetAll:i,panelId:o,hasInnerWrapper:!0,headingLevel:3,className:"color-block-support-panel",__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:s,children:a.jsx("div",{className:"color-block-support-panel__inner-wrapper",children:r})})}const fEt={text:!0,background:!0,link:!0,heading:!0,button:!0,caption:!0},bEt={placement:"left-start",offset:36,shift:!0},{Tabs:bv}=ct(tr),hEt=({indicators:e,label:t})=>a.jsxs(Ot,{justify:"flex-start",children:[a.jsx(M2e,{isLayered:!1,offset:-8,children:e.map((n,o)=>a.jsx(Yo,{expanded:!1,children:a.jsx(eb,{colorValue:n})},o))}),a.jsx(Tn,{className:"block-editor-panel-color-gradient-settings__color-name",children:t})]});function ete({isGradient:e,inheritedValue:t,userValue:n,setValue:o,colorGradientControlSettings:r}){return a.jsx(uze,{...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 mEt({label:e,hasValue:t,resetValue:n,isShownByDefault:o,indicators:r,tabs:s,colorGradientControlSettings:i,panelId:c}){var l;const u=s.find(b=>b.userValue!==void 0),{key:d,...p}=(l=s[0])!==null&&l!==void 0?l:{},f=x.useRef(void 0);return a.jsx(tt,{className:"block-editor-tools-panel-color-gradient-settings__item",hasValue:t,label:e,onDeselect:n,isShownByDefault:o,panelId:c,children:a.jsx(so,{popoverProps:bEt,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:({onToggle:b,isOpen:h})=>{const g={onClick:b,className:oe("block-editor-panel-color-gradient-settings__dropdown",{"is-open":h}),"aria-expanded":h,ref:f};return a.jsxs(a.Fragment,{children:[a.jsx(Ce,{...g,__next40pxDefaultSize:!0,children:a.jsx(hEt,{indicators:r,label:e})}),t()&&a.jsx(Ce,{__next40pxDefaultSize:!0,label:m("Reset"),className:"block-editor-panel-color-gradient-settings__reset",size:"small",icon:am,onClick:()=>{n(),h&&b(),f.current?.focus()}})]})},renderContent:()=>a.jsx($s,{paddingSize:"none",children:a.jsxs("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:[s.length===1&&a.jsx(ete,{...p,colorGradientControlSettings:i},d),s.length>1&&a.jsxs(bv,{defaultTabId:u?.key,children:[a.jsx(bv.TabList,{children:s.map(b=>a.jsx(bv.Tab,{tabId:b.key,children:b.label},b.key))}),s.map(b=>{const{key:h,...g}=b;return a.jsx(bv.TabPanel,{tabId:h,focusable:!1,children:a.jsx(ete,{...g,colorGradientControlSettings:i},h)},h)})]})]})})})})}function gze({as:e=pEt,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:s,defaultControls:i=fEt,children:c}){const l=pp(r),u=$_(r),d=r?.color?.custom,p=r?.color?.customGradient,f=l.length>0||d,b=u.length>0||p,h=de=>ua({settings:r},"",de),g=de=>{const ye=l.flatMap(({colors:Ne})=>Ne).find(({color:Ne})=>Ne===de);return ye?"var:preset|color|"+ye.slug:de},z=de=>{const ye=u.flatMap(({gradients:Ne})=>Ne).find(({gradient:Ne})=>Ne===de);return ye?"var:preset|gradient|"+ye.slug:de},A=mze(r),_=h(o?.color?.background),v=h(t?.color?.background),M=h(o?.color?.gradient),y=h(t?.color?.gradient),k=()=>!!v||!!y,S=de=>{const Ae=gn(t,["color","background"],g(de));Ae.color.gradient=void 0,n(Ae)},C=de=>{const Ae=gn(t,["color","gradient"],z(de));Ae.color.background=void 0,n(Ae)},R=()=>{const de=gn(t,["color","background"],void 0);de.color.gradient=void 0,n(de)},T=fze(r),E=h(o?.elements?.link?.color?.text),B=h(t?.elements?.link?.color?.text),N=de=>{n(gn(t,["elements","link","color","text"],g(de)))},j=h(o?.elements?.link?.[":hover"]?.color?.text),I=h(t?.elements?.link?.[":hover"]?.color?.text),P=de=>{n(gn(t,["elements","link",":hover","color","text"],g(de)))},$=()=>!!B||!!I,F=()=>{let de=gn(t,["elements","link",":hover","color","text"],void 0);de=gn(de,["elements","link","color","text"],void 0),n(de)},X=pze(r),Z=h(o?.color?.text),V=h(t?.color?.text),Q=()=>!!V,te=de=>{let Ae=gn(t,["color","text"],g(de));Z===E&&(Ae=gn(Ae,["elements","link","color","text"],g(de))),n(Ae)},ee=()=>te(void 0),ue=[{name:"caption",label:m("Captions"),showPanel:bze(r)},{name:"button",label:m("Button"),showPanel:hze(r)},{name:"heading",label:m("Heading"),showPanel:Iu(r)},{name:"h1",label:m("H1"),showPanel:Iu(r)},{name:"h2",label:m("H2"),showPanel:Iu(r)},{name:"h3",label:m("H3"),showPanel:Iu(r)},{name:"h4",label:m("H4"),showPanel:Iu(r)},{name:"h5",label:m("H5"),showPanel:Iu(r)},{name:"h6",label:m("H6"),showPanel:Iu(r)}],ce=x.useCallback(de=>({...de,color:void 0,elements:{...de?.elements,link:{...de?.elements?.link,color:void 0,":hover":{color:void 0}},...ue.reduce((Ae,ye)=>({...Ae,[ye.name]:{...de?.elements?.[ye.name],color:void 0}}),{})}}),[]),me=[X&&{key:"text",label:m("Text"),hasValue:Q,resetValue:ee,isShownByDefault:i.text,indicators:[Z],tabs:[{key:"text",label:m("Text"),inheritedValue:Z,setValue:te,userValue:V}]},A&&{key:"background",label:m("Background"),hasValue:k,resetValue:R,isShownByDefault:i.background,indicators:[M??_],tabs:[f&&{key:"background",label:m("Color"),inheritedValue:_,setValue:S,userValue:v},b&&{key:"gradient",label:m("Gradient"),inheritedValue:M,setValue:C,userValue:y,isGradient:!0}].filter(Boolean)},T&&{key:"link",label:m("Link"),hasValue:$,resetValue:F,isShownByDefault:i.link,indicators:[E,j],tabs:[{key:"link",label:m("Default"),inheritedValue:E,setValue:N,userValue:B},{key:"hover",label:m("Hover"),inheritedValue:j,setValue:P,userValue:I}]}].filter(Boolean);return ue.forEach(({name:de,label:Ae,showPanel:ye})=>{if(!ye)return;const Ne=h(o?.elements?.[de]?.color?.background),je=h(o?.elements?.[de]?.color?.gradient),ie=h(o?.elements?.[de]?.color?.text),we=h(t?.elements?.[de]?.color?.background),re=h(t?.elements?.[de]?.color?.gradient),pe=h(t?.elements?.[de]?.color?.text),ke=()=>!!(pe||we||re),Se=()=>{const qe=gn(t,["elements",de,"color","background"],void 0);qe.elements[de].color.gradient=void 0,qe.elements[de].color.text=void 0,n(qe)},se=qe=>{n(gn(t,["elements",de,"color","text"],g(qe)))},L=qe=>{const Pe=gn(t,["elements",de,"color","background"],g(qe));Pe.elements[de].color.gradient=void 0,n(Pe)},U=qe=>{const Pe=gn(t,["elements",de,"color","gradient"],z(qe));Pe.elements[de].color.background=void 0,n(Pe)},ne=!0,ve=de!=="caption";me.push({key:de,label:Ae,hasValue:ke,resetValue:Se,isShownByDefault:i[de],indicators:ve?[ie,je??Ne]:[ie],tabs:[f&&ne&&{key:"text",label:m("Text"),inheritedValue:ie,setValue:se,userValue:pe},f&&ve&&{key:"background",label:m("Background"),inheritedValue:Ne,setValue:L,userValue:we},b&&ve&&{key:"gradient",label:m("Gradient"),inheritedValue:je,setValue:U,userValue:re,isGradient:!0}].filter(Boolean)})}),a.jsxs(e,{resetAllFilter:ce,value:t,onChange:n,panelId:s,children:[me.map(de=>{const{key:Ae,...ye}=de;return a.jsx(mEt,{...ye,colorGradientControlSettings:{colors:l,disableCustomColors:!d,gradients:u,disableCustomGradients:!p},panelId:s},Ae)}),c]})}const hv=[];function tte(e,{presetSetting:t,defaultSetting:n}){const o=!e?.color?.[n],r=e?.color?.[t]?.custom||hv,s=e?.color?.[t]?.theme||hv,i=e?.color?.[t]?.default||hv;return x.useMemo(()=>[...r,...s,...o?hv:i],[o,r,s,i])}function gEt(e){return Mze(e)}function Mze(e){return e.color.customDuotone||e.color.defaultDuotone||e.color.duotone.length>0}function MEt({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){const s=dp(),i=()=>{const c=e(n);t(c)};return a.jsx(En,{label:We("Filters","Name for applying graphical effects"),resetAll:i,panelId:o,dropdownMenuProps:s,children:r})}const zEt={duotone:!0},OEt={placement:"left-start",offset:36,shift:!0,className:"block-editor-duotone-control__popover",headerTitle:m("Duotone")},yEt=({indicator:e,label:t})=>a.jsxs(Ot,{justify:"flex-start",children:[a.jsx(M2e,{isLayered:!1,offset:-8,children:a.jsx(Yo,{expanded:!1,children:e==="unset"||!e?a.jsx(eb,{className:"block-editor-duotone-control__unset-indicator"}):a.jsx(Gbe,{values:e})})}),a.jsx(Tn,{title:t,children:t})]});function zze({as:e=MEt,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:s,defaultControls:i=zEt}){const c=z=>ua({settings:r},"",z),l=Mze(r),u=tte(r,{presetSetting:"duotone",defaultSetting:"defaultDuotone"}),d=tte(r,{presetSetting:"palette",defaultSetting:"defaultPalette"}),p=c(o?.filter?.duotone),f=z=>{const A=u.find(({colors:v})=>v===z),_=A?`var:preset|duotone|${A.slug}`:z;n(gn(t,["filter","duotone"],_))},b=()=>!!t?.filter?.duotone,h=()=>f(void 0),g=x.useCallback(z=>({...z,filter:{...z.filter,duotone:void 0}}),[]);return a.jsx(e,{resetAllFilter:g,value:t,onChange:n,panelId:s,children:l&&a.jsx(tt,{label:m("Duotone"),hasValue:b,onDeselect:h,isShownByDefault:i.duotone,panelId:s,children:a.jsx(so,{popoverProps:OEt,className:"block-editor-global-styles-filters-panel__dropdown",renderToggle:({onToggle:z,isOpen:A})=>{const _={onClick:z,className:oe({"is-open":A}),"aria-expanded":A};return a.jsx(tb,{isBordered:!0,isSeparated:!0,children:a.jsx(oO,{as:"button",..._,children:a.jsx(yEt,{indicator:p,label:m("Duotone")})})})},renderContent:()=>a.jsx($s,{paddingSize:"small",children:a.jsxs(Cn,{label:m("Duotone"),children:[a.jsx("p",{children:m("Create a two-tone color effect without losing your original image.")}),a.jsx(Xbe,{colorPalette:d,duotonePalette:u,disableCustomColors:!0,disableCustomDuotone:!0,value:p,onChange:f})]})})})})})}function AEt(e,t,n){return e==="core/image"&&n?.lightbox?.allowEditing||!!t?.lightbox}function vEt({onChange:e,value:t,inheritedValue:n,panelId:o}){const r=dp(),s=()=>{e(void 0)},i=l=>{e({enabled:l})};let c=!1;return n?.lightbox?.enabled&&(c=n.lightbox.enabled),a.jsx(a.Fragment,{children:a.jsx(En,{label:We("Settings","Image settings"),resetAll:s,panelId:o,dropdownMenuProps:r,children:a.jsx(tt,{hasValue:()=>!!t?.lightbox,label:m("Enlarge on click"),onDeselect:s,isShownByDefault:!0,panelId:o,children:a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Enlarge on click"),checked:c,onChange:i})})})})}function xEt({value:e,onChange:t,inheritedValue:n=e}){const[o,r]=x.useState(null),s=n?.css;function i(l){if(t({...e,css:l}),o){const[u]=Fx([{css:l}],".for-validation-only");u&&r(null)}}function c(l){if(!l?.target?.value){r(null);return}const[u]=Fx([{css:l.target.value}],".for-validation-only");r(u===null?m("There is an error with your CSS structure."):null)}return a.jsxs(dt,{spacing:3,children:[o&&a.jsx(A1,{status:"error",onRemove:()=>r(null),children:o}),a.jsx(Li,{label:m("Additional CSS"),__nextHasNoMarginBottom:!0,value:s,onChange:l=>i(l),onBlur:c,className:"block-editor-global-styles-advanced-panel__custom-css-input",spellCheck:!1})]})}const mv=new Map,VW=[],QR={caption:m("Caption"),link:m("Link"),button:m("Button"),heading:m("Heading"),h1:m("H1"),h2:m("H2"),h3:m("H3"),h4:m("H4"),h5:m("H5"),h6:m("H6"),"settings.color":m("Color"),"settings.typography":m("Typography"),"styles.color":m("Colors"),"styles.spacing":m("Spacing"),"styles.background":m("Background"),"styles.typography":m("Typography")},wEt=Hs(()=>gs().reduce((e,{name:t,title:n})=>(e[t]=n,e),{})),gv=e=>e!==null&&typeof e=="object";function _Et(e){if(QR[e])return QR[e];const t=e.split(".");if(t?.[0]==="blocks")return wEt()?.[t[1]]||t[1];if(t?.[0]==="elements")return QR[t[1]]||t[1]}function Oze(e,t,n=""){if(!gv(e)&&!gv(t))return e!==t?n.split(".").slice(0,2).join("."):void 0;e=gv(e)?e:{},t=gv(t)?t:{};const o=new Set([...Object.keys(e),...Object.keys(t)]);let r=[];for(const s of o){const i=n?n+"."+s:s,c=Oze(e[s],t[s],i);c&&(r=r.concat(c))}return r}function kEt(e,t){const n=JSON.stringify({next:e,previous:t});if(mv.has(n))return mv.get(n);const o=Oze({styles:{background:e?.styles?.background,color:e?.styles?.color,typography:e?.styles?.typography,spacing:e?.styles?.spacing},blocks:e?.styles?.blocks,elements:e?.styles?.elements,settings:e?.settings},{styles:{background:t?.styles?.background,color:t?.styles?.color,typography:t?.styles?.typography,spacing:t?.styles?.spacing},blocks:t?.styles?.blocks,elements:t?.styles?.elements,settings:t?.settings});if(!o.length)return mv.set(n,VW),VW;const r=[...new Set(o)].reduce((s,i)=>{const c=_Et(i);return c&&s.push([i.split(".")[0],c]),s},[]);return mv.set(n,r),r}function SEt(e,t,n={}){let o=kEt(e,t);const r=o.length,{maxResults:s}=n;return r?(s&&r>s&&(o=o.slice(0,s)),Object.entries(o.reduce((i,c)=>{const l=i[c[0]]||[];return l.includes(c[1])||(i[c[0]]=[...l,c[1]]),i},{})).map(([i,c])=>{const l=c.length,u=c.join(m(", "));switch(i){case"blocks":return xe(Dn("%s block.","%s blocks.",l),u);case"elements":return xe(Dn("%s element.","%s elements.",l),u);case"settings":return xe(m("%s settings."),u);case"styles":return xe(m("%s styles."),u);default:return xe(m("%s."),u)}})):VW}const CEt=Object.freeze(Object.defineProperty({__proto__:null,AdvancedPanel:xEt,BackgroundPanel:mMe,BorderPanel:cze,ColorPanel:gze,DimensionsPanel:HMe,FiltersPanel:zze,GlobalStylesContext:lb,ImageSettingsPanel:vEt,TypographyPanel:EMe,areGlobalStyleConfigsEqual:jSt,getBlockCSSSelector:pd,getBlockSelectors:H_,getGlobalStylesChanges:SEt,getLayoutStyles:MMe,toStyles:V_,useGlobalSetting:iMe,useGlobalStyle:nRt,useGlobalStylesOutput:dTt,useGlobalStylesOutputWithConfig:zMe,useGlobalStylesReset:tRt,useHasBackgroundPanel:oI,useHasBorderPanel:nze,useHasBorderPanelControls:cI,useHasColorPanel:dze,useHasDimensionsPanel:BMe,useHasFiltersPanel:gEt,useHasImageSettingsPanel:AEt,useHasTypographyPanel:AMe,useSettingsForBlockElement:aMe},Symbol.toStringTag,{value:"Module"})),HW="is-style-";function yze(e){return e?e.split(/\s+/).reduce((t,n)=>{if(n.startsWith(HW)){const o=n.slice(HW.length);o!=="default"&&t.push(o)}return t},[]):[]}function qEt(e,t=[]){const n=yze(e);if(!n)return null;for(const o of n)if(t.some(r=>r.name===o))return o;return null}function REt({override:e}){Jz(e)}function TEt({config:e}){const{getBlockStyles:t,overrides:n}=G(s=>({getBlockStyles:s(kt).getBlockStyles,overrides:ct(s(J)).getStyleOverrides()}),[]),{getBlockName:o}=G(J),r=x.useMemo(()=>{if(!n?.length)return;const s=[],i=[];for(const[,c]of n)if(c?.variation&&c?.clientId&&!i.includes(c.clientId)){const l=o(c.clientId),u=e?.styles?.blocks?.[l]?.variations?.[c.variation];if(u){const d={settings:e?.settings,styles:{blocks:{[l]:{variations:{[`${c.variation}-${c.clientId}`]:u}}}}},p=H_(gs(),t,c.clientId),z=V_(d,p,!1,!0,!0,!0,{blockGap:!1,blockStyles:!0,layoutStyles:!1,marginReset:!1,presets:!1,rootPadding:!1,variationStyles:!0});s.push({id:`${c.variation}-${c.clientId}`,css:z,__unstableType:"variation",variation:c.variation,clientId:c.clientId}),i.push(c.clientId)}}return s},[e,n,t,o]);if(!(!r||!r.length))return a.jsx(a.Fragment,{children:r.map(s=>a.jsx(REt,{override:s},s.id))})}function Aze(e,t,n){if(!e?.styles?.blocks?.[t]?.variations?.[n])return;const o=s=>{Object.keys(s).forEach(i=>{const c=s[i];if(typeof c=="object"&&c!==null)if(c.ref!==void 0)if(typeof c.ref!="string"||c.ref.trim()==="")delete s[i];else{const l=fo(e,c.ref);l?s[i]=l:delete s[i]}else o(c),Object.keys(c).length===0&&delete s[i]})},r=JSON.parse(JSON.stringify(e.styles.blocks[t].variations[n]));return o(r),r}function EEt(e,t,n){const{merged:o}=x.useContext(lb),{globalSettings:r,globalStyles:s}=G(i=>{const c=i(J).getSettings();return{globalSettings:c.__experimentalFeatures,globalStyles:c[dO]}},[]);return x.useMemo(()=>{var i,c,l;const u=Aze({settings:(i=o?.settings)!==null&&i!==void 0?i:r,styles:(c=o?.styles)!==null&&c!==void 0?c:s},e,t);return{settings:(l=o?.settings)!==null&&l!==void 0?l:r,styles:{blocks:{[e]:{variations:{[`${t}-${n}`]:u}}}}}},[o,r,s,t,n,e])}function WEt({name:e,className:t,clientId:n}){const{getBlockStyles:o}=G(kt),r=o(e),s=qEt(t,r),i=`${HW}${s}-${n}`,{settings:c,styles:l}=EEt(e,s,n),u=x.useMemo(()=>{if(!s)return;const d={settings:c,styles:l},p=H_(gs(),o,n);return V_(d,p,!1,!0,!0,!0,{blockGap:!1,blockStyles:!0,layoutStyles:!1,marginReset:!1,presets:!1,rootPadding:!1,variationStyles:!0})},[s,c,l,o,n]);return Jz({id:`variation-${n}`,css:u,__unstableType:"variation",variation:s,clientId:n}),s?{className:i}:{}}const NEt={hasSupport:()=>!0,attributeKeys:["className"],isMatch:({className:e})=>yze(e).length>0,useBlockProps:WEt},BEt=a.jsxs(ge,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24","aria-hidden":"true",focusable:"false",children:[a.jsx(he,{d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3z"}),a.jsx(he,{stroke:"currentColor",strokeWidth:"1.5",d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3z"})]});function LEt({clientId:e}){var t,n;const{stylesToRender:o,activeStyle:r,className:s}=J7({clientId:e}),{updateBlockAttributes:i}=Oe(J),{merged:c}=x.useContext(lb),{globalSettings:l,globalStyles:u,blockName:d}=G(b=>{const h=b(J).getSettings();return{globalSettings:h.__experimentalFeatures,globalStyles:h[dO],blockName:b(J).getBlockName(e)}},[e]),p=r?.name?Aze({settings:(t=c?.settings)!==null&&t!==void 0?t:l,styles:(n=c?.styles)!==null&&n!==void 0?n:u},d,r.name)?.color?.background:void 0;if(!o||o.length===0)return null;const f=()=>{const h=(o.findIndex(A=>A.name===r.name)+1)%o.length,g=o[h],z=Q7(s,r,g);i(e,{className:z})};return a.jsx(Wn,{children:a.jsx(Vt,{onClick:f,label:m("Shuffle styles"),children:a.jsx(qo,{icon:BEt,style:{fill:p||"transparent"}})})})}function vze({hideDragHandle:e,focusOnMount:t,__experimentalInitialIndex:n,__experimentalOnIndexChange:o,variant:r="unstyled"}){const{blockClientId:s,blockClientIds:i,isDefaultEditingMode:c,blockType:l,toolbarKey:u,shouldShowVisualToolbar:d,showParentSelector:p,isUsingBindings:f,hasParentPattern:b,hasContentOnlyLocking:h,showShuffleButton:g,showSlots:z,showGroupButtons:A,showLockButtons:_,showSwitchSectionStyleButton:v,hasFixedToolbar:M,isNavigationMode:y}=G(I=>{const{getBlockName:P,getBlockMode:$,getBlockParents:F,getSelectedBlockClientIds:X,isBlockValid:Z,getBlockEditingMode:V,getBlockAttributes:Q,getBlockParentsByBlockName:te,getTemplateLock:ee,getSettings:ue,getParentSectionBlock:ce,isZoomOut:me,isNavigationMode:de}=ct(I(J)),Ae=X(),ye=Ae[0],Ne=F(ye),je=ce(ye),ie=je??Ne[Ne.length-1],we=P(ie),re=on(we),pe=V(ye),ke=pe==="default",Se=P(ye),se=Ae.every(Pe=>Z(Pe)),L=Ae.every(Pe=>$(Pe)==="visual"),U=Ae.every(Pe=>!!Q(Pe)?.metadata?.bindings),ne=Ae.every(Pe=>te(Pe,"core/block",!0).length>0),ve=Ae.some(Pe=>ee(Pe)==="contentOnly"),qe=me();return{blockClientId:ye,blockClientIds:Ae,isDefaultEditingMode:ke,blockType:ye&&on(Se),shouldShowVisualToolbar:se&&L,toolbarKey:`${ye}${ie}`,showParentSelector:!qe&&re&&pe!=="contentOnly"&&V(ie)!=="disabled"&&Et(re,"__experimentalParentSelector",!0)&&Ae.length===1,isUsingBindings:U,hasParentPattern:ne,hasContentOnlyLocking:ve,showShuffleButton:qe,showSlots:!qe,showGroupButtons:!qe,showLockButtons:!qe,showSwitchSectionStyleButton:qe,hasFixedToolbar:ue().hasFixedToolbar,isNavigationMode:de()}},[]),k=x.useRef(null),S=x.useRef(),C=Z7({ref:S}),R=!Yn("medium","<");if(!sMe())return null;const E=i.length>1,B=Qd(l)||Hh(l),N=oe("block-editor-block-contextual-toolbar",{"has-parent":p,"is-inverted-toolbar":y&&!M}),j=oe("block-editor-block-toolbar",{"is-synced":B,"is-connected":f});return a.jsx(tI,{focusEditorOnEscape:!0,className:N,"aria-label":m("Block tools"),variant:r==="toolbar"?void 0:r,focusOnMount:t,__experimentalInitialIndex:n,__experimentalOnIndexChange:o,children:a.jsxs("div",{ref:k,className:j,children:[p&&!E&&R&&a.jsx(fCt,{}),(d||E)&&!b&&a.jsx("div",{ref:S,...C,children:a.jsxs(Wn,{className:"block-editor-block-toolbar__block-controls",children:[a.jsx(NCt,{clientIds:i}),!E&&c&&_&&a.jsx(qqt,{clientId:s}),a.jsx(uCt,{clientIds:i,hideDragHandle:e})]})}),!h&&d&&E&&A&&a.jsx(wqt,{}),g&&a.jsx(Qqt,{clientId:i[0]}),v&&a.jsx(LEt,{clientId:i[0]}),d&&z&&a.jsxs(a.Fragment,{children:[a.jsx(bt.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),a.jsx(bt.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),a.jsx(bt.Slot,{className:"block-editor-block-toolbar__slot"}),a.jsx(bt.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),a.jsx(bt.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),a.jsx(Hqt.Provider,{value:l?.name,children:a.jsx(eI.Slot,{})})]}),a.jsx(Vqt,{clientIds:i}),a.jsx($qt,{clientIds:i})]})},u)}function lI({hideDragHandle:e,variant:t}){return a.jsx(vze,{hideDragHandle:e,variant:t,focusOnMount:void 0,__experimentalInitialIndex:void 0,__experimentalOnIndexChange:void 0})}function PEt({clientId:e,isTyping:t,__unstableContentRef:n}){const{capturingClientId:o,isInsertionPointVisible:r,lastClientId:s}=jge(e),i=x.useRef();x.useEffect(()=>{i.current=void 0},[e]);const{stopTyping:c}=Oe(J),l=x.useRef(!1);p0("core/block-editor/focus-toolbar",()=>{l.current=!0,c(!0)}),x.useEffect(()=>{l.current=!1});const u=o||e,d=Pge({contentElement:n?.current,clientId:u});return!t&&a.jsx(N6t,{clientId:u,bottomClientId:s,className:oe("block-editor-block-list__block-popover",{"is-insertion-point-visible":r}),resize:!1,...d,children:a.jsx(vze,{focusOnMount:l.current,__experimentalInitialIndex:i.current,__experimentalOnIndexChange:p=>{i.current=p},variant:"toolbar"})})}function jEt({onClick:e}){return a.jsx(Ce,{variant:"primary",icon:Fs,size:"compact",className:oe("block-editor-button-pattern-inserter__button","block-editor-block-tools__zoom-out-mode-inserter-button"),onClick:e,label:We("Add pattern","Generic label for pattern inserter button")})}function IEt(){const[e,t]=x.useState(!1),{hasSelection:n,blockOrder:o,setInserterIsOpened:r,sectionRootClientId:s,selectedBlockClientId:i,blockInsertionPoint:c,insertionPointVisible:l}=G(h=>{const{getSettings:g,getBlockOrder:z,getSelectionStart:A,getSelectedBlockClientId:_,getSectionRootClientId:v,getBlockInsertionPoint:M,isBlockInsertionPointVisible:y}=ct(h(J)),k=v();return{hasSelection:!!A().clientId,blockOrder:z(k),sectionRootClientId:k,setInserterIsOpened:g().__experimentalSetIsInserterOpened,selectedBlockClientId:_(),blockInsertionPoint:M(),insertionPointVisible:y()}},[]),{showInsertionPoint:u}=ct(Oe(J));if(x.useEffect(()=>{const h=setTimeout(()=>{t(!0)},500);return()=>{clearTimeout(h)}},[]),!e||!n)return null;const d=i,f=o.findIndex(h=>i===h)+1,b=o[f];return l&&c?.index===f?null:a.jsx(xge,{previousClientId:d,nextClientId:b,children:a.jsx(jEt,{onClick:()=>{r({rootClientId:s,insertionIndex:f,tab:"patterns",category:"all"}),u(s,f,{operation:"insert"})}})})}function DEt(){return G(e=>{const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlock:o,getBlockMode:r,getSettings:s,__unstableGetEditorMode:i,isTyping:c}=ct(e(J)),l=t()||n(),u=o(l),d=i(),p=!!l&&!!u,f=p&&El(u)&&r(l)!=="html",b=l&&!c()&&d!=="navigation"&&f,h=!s().hasFixedToolbar&&!b&&p&&!f;return{showEmptyBlockSideInserter:b,showBlockToolbarPopover:h}},[])}function FEt(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getSettings:o,isTyping:r,isDragging:s,isZoomOut:i}=ct(e(J));return{clientId:t()||n(),hasFixedToolbar:o().hasFixedToolbar,isTyping:r(),isZoomOutMode:i(),isDragging:s()}}function nte({children:e,__unstableContentRef:t,...n}){const{clientId:o,hasFixedToolbar:r,isTyping:s,isZoomOutMode:i,isDragging:c}=G(FEt,[]),l=C_(),{getBlocksByClientId:u,getSelectedBlockClientIds:d,getBlockRootClientId:p,isGroupable:f}=G(J),{getGroupingBlockName:b}=G(kt),{showEmptyBlockSideInserter:h,showBlockToolbarPopover:g}=DEt(),{duplicateBlocks:z,removeBlocks:A,replaceBlocks:_,insertAfterBlock:v,insertBeforeBlock:M,selectBlock:y,moveBlocksUp:k,moveBlocksDown:S,expandBlock:C}=ct(Oe(J));function R(B){if(!B.defaultPrevented){if(l("core/block-editor/move-up",B)||l("core/block-editor/move-down",B)){const N=d();if(N.length){B.preventDefault();const j=p(N[0]);(l("core/block-editor/move-up",B)?"up":"down")==="up"?k(N,j):S(N,j);const P=Array.isArray(N)?N.length:1,$=xe(Dn("%d block moved.","%d blocks moved.",N.length),P);Yt($)}}else if(l("core/block-editor/duplicate",B)){const N=d();N.length&&(B.preventDefault(),z(N))}else if(l("core/block-editor/remove",B)){const N=d();N.length&&(B.preventDefault(),A(N))}else if(l("core/block-editor/insert-after",B)){const N=d();N.length&&(B.preventDefault(),v(N[N.length-1]))}else if(l("core/block-editor/insert-before",B)){const N=d();N.length&&(B.preventDefault(),M(N[0]))}else if(l("core/block-editor/unselect",B)){if(B.target.closest("[role=toolbar]"))return;const N=d();N.length>1&&(B.preventDefault(),y(N[0]))}else if(l("core/block-editor/collapse-list-view",B)){if(md(B.target)||md(B.target?.contentWindow?.document?.activeElement))return;B.preventDefault(),C(o)}else if(l("core/block-editor/group",B)){const N=d();if(N.length>1&&f(N)){B.preventDefault();const j=u(N),I=b(),P=Kr(j,I);_(N,P),Yt(m("Selected blocks are grouped."))}}}}const T=Vx(t),E=Vx(t);return a.jsx("div",{...n,onKeyDown:R,children:a.jsxs(X7.Provider,{value:x.useRef(!1),children:[!s&&!i&&a.jsx(I6t,{__unstableContentRef:t}),h&&a.jsx(oCt,{__unstableContentRef:t,clientId:o}),g&&a.jsx(PEt,{__unstableContentRef:t,clientId:o,isTyping:s}),!i&&!r&&a.jsx(Io.Slot,{name:"block-toolbar",ref:T}),e,a.jsx(Io.Slot,{name:"__unstable-block-tools-after",ref:E}),i&&!c&&a.jsx(IEt,{__unstableContentRef:t})]})})}function $Et(e={},t){switch(t.type){case"REGISTER_COMMAND":return{...e,[t.name]:{name:t.name,label:t.label,searchLabel:t.searchLabel,context:t.context,callback:t.callback,icon:t.icon}};case"UNREGISTER_COMMAND":{const{[t.name]:n,...o}=e;return o}}return e}function VEt(e={},t){switch(t.type){case"REGISTER_COMMAND_LOADER":return{...e,[t.name]:{name:t.name,context:t.context,hook:t.hook}};case"UNREGISTER_COMMAND_LOADER":{const{[t.name]:n,...o}=e;return o}}return e}function HEt(e=!1,t){switch(t.type){case"OPEN":return!0;case"CLOSE":return!1}return e}function UEt(e="root",t){switch(t.type){case"SET_CONTEXT":return t.context}return e}const XEt=J0({commands:$Et,commandLoaders:VEt,isOpen:HEt,context:UEt});function GEt(e){return{type:"REGISTER_COMMAND",...e}}function KEt(e){return{type:"UNREGISTER_COMMAND",name:e}}function YEt(e){return{type:"REGISTER_COMMAND_LOADER",...e}}function ZEt(e){return{type:"UNREGISTER_COMMAND_LOADER",name:e}}function QEt(){return{type:"OPEN"}}function JEt(){return{type:"CLOSE"}}const e8t=Object.freeze(Object.defineProperty({__proto__:null,close:JEt,open:QEt,registerCommand:GEt,registerCommandLoader:YEt,unregisterCommand:KEt,unregisterCommandLoader:ZEt},Symbol.toStringTag,{value:"Module"})),t8t=It((e,t=!1)=>Object.values(e.commands).filter(n=>{const o=n.context&&n.context===e.context;return t?o:!o}),e=>[e.commands,e.context]),n8t=It((e,t=!1)=>Object.values(e.commandLoaders).filter(n=>{const o=n.context&&n.context===e.context;return t?o:!o}),e=>[e.commandLoaders,e.context]);function o8t(e){return e.isOpen}function r8t(e){return e.context}const s8t=Object.freeze(Object.defineProperty({__proto__:null,getCommandLoaders:n8t,getCommands:t8t,getContext:r8t,isOpen:o8t},Symbol.toStringTag,{value:"Module"}));function i8t(e){return{type:"SET_CONTEXT",context:e}}const a8t=Object.freeze(Object.defineProperty({__proto__:null,setContext:i8t},Symbol.toStringTag,{value:"Module"})),{lock:c8t,unlock:xze}=P0("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/commands"),l8t="core/commands",Ef=w1(l8t,{reducer:XEt,actions:e8t,selectors:s8t});Us(Ef);xze(Ef).registerPrivateActions(a8t);m("Search commands and settings");function u8t(e){const{getContext:t}=G(Ef),n=x.useRef(t()),{setContext:o}=xze(Oe(Ef));x.useEffect(()=>{o(e)},[e,o]),x.useEffect(()=>{const r=n.current;return()=>o(r)},[o])}const wze={};c8t(wze,{useCommandContext:u8t});function d8t(e){const{registerCommand:t,unregisterCommand:n}=Oe(Ef),o=x.useRef(e.callback);x.useEffect(()=>{o.current=e.callback},[e.callback]),x.useEffect(()=>{if(!e.disabled)return t({name:e.name,context:e.context,label:e.label,searchLabel:e.searchLabel,icon:e.icon,callback:(...r)=>o.current(...r)}),()=>{n(e.name)}},[e.name,e.label,e.searchLabel,e.icon,e.context,e.disabled,t,n])}function xi(e){const{registerCommandLoader:t,unregisterCommandLoader:n}=Oe(Ef);x.useEffect(()=>{if(!e.disabled)return t({name:e.name,hook:e.hook,context:e.context}),()=>{n(e.name)}},[e.name,e.hook,e.context,e.disabled,t,n])}const p8t=()=>function(){const{replaceBlocks:t,multiSelect:n}=Oe(J),{blocks:o,clientIds:r,canRemove:s,possibleBlockTransformations:i,invalidSelection:c}=G(b=>{const{getBlockRootClientId:h,getBlockTransformItems:g,getSelectedBlockClientIds:z,getBlocksByClientId:A,canRemoveBlocks:_}=b(J),v=z(),M=A(v);if(M.filter(k=>!k).length>0)return{invalidSelection:!0};const y=h(v[0]);return{blocks:M,clientIds:v,possibleBlockTransformations:g(M,y),canRemove:_(v),invalidSelection:!1}},[]);if(c)return{isLoading:!1,commands:[]};const l=o.length===1&&Hh(o[0]);function u(b){b.length>1&&n(b[0].clientId,b[b.length-1].clientId)}function d(b){const h=Kr(o,b);t(r,h),u(h)}const p=!!i.length&&s&&!l;return!r||r.length<1||!p?{isLoading:!1,commands:[]}:{isLoading:!1,commands:i.map(b=>{const{name:h,title:g,icon:z}=b;return{name:"core/block-editor/transform-to-"+h.replace("/","-"),label:xe(m("Transform to %s"),g),icon:a.jsx(Zn,{icon:z}),callback:({close:A})=>{d(h),A()}}})}},f8t=()=>function(){const{clientIds:t,isUngroupable:n,isGroupable:o}=G(S=>{const{getSelectedBlockClientIds:C,isUngroupable:R,isGroupable:T}=S(J);return{clientIds:C(),isUngroupable:R(),isGroupable:T()}},[]),{canInsertBlockType:r,getBlockRootClientId:s,getBlocksByClientId:i,canRemoveBlocks:c}=G(J),{getDefaultBlockName:l,getGroupingBlockName:u}=G(kt),d=i(t),{removeBlocks:p,replaceBlocks:f,duplicateBlocks:b,insertAfterBlock:h,insertBeforeBlock:g}=Oe(J),z=()=>{if(!d.length)return;const S=u(),C=Kr(d,S);C&&f(t,C)},A=()=>{if(!d.length)return;const S=d[0].innerBlocks;S.length&&f(t,S)};if(!t||t.length<1)return{isLoading:!1,commands:[]};const _=s(t[0]),v=r(l(),_),M=d.every(S=>!!S&&Et(S.name,"multiple",!0)&&r(S.name,_)),y=c(t),k=[];return M&&k.push({name:"duplicate",label:m("Duplicate"),callback:()=>b(t,!0),icon:H3}),v&&k.push({name:"add-before",label:m("Add before"),callback:()=>{const S=Array.isArray(t)?t[0]:S;g(S)},icon:Fs},{name:"add-after",label:m("Add after"),callback:()=>{const S=Array.isArray(t)?t[t.length-1]:S;h(S)},icon:Fs}),o&&k.push({name:"Group",label:m("Group"),callback:z,icon:Zf}),n&&k.push({name:"ungroup",label:m("Ungroup"),callback:A,icon:uJe}),y&&k.push({name:"remove",label:m("Delete"),callback:()=>p(t,!0),icon:K3}),{isLoading:!1,commands:k.map(S=>({...S,name:"core/block-editor/action-"+S.name,callback:({close:C})=>{S.callback(),C()}}))}},b8t=()=>{xi({name:"core/block-editor/blockTransforms",hook:p8t()}),xi({name:"core/block-editor/blockQuickActions",hook:f8t(),context:"block-selection-edit"})},h8t={ignoredSelectors:[/\.editor-styles-wrapper/gi]};function m8t({shouldIframe:e=!0,height:t="300px",children:n=a.jsx(B_,{}),styles:o,contentRef:r,iframeProps:s}){b8t();const i=Yn("medium","<"),c=Cge(),l=q7(),u=x.useRef(),d=xn([r,l,u]),p=G(b=>ct(b(J)).getZoomLevel(),[]),f=p!==100&&!i?{scale:p,frameSize:"40px"}:{};return e?a.jsx(nte,{__unstableContentRef:u,className:"block-editor-block-canvas",style:{height:t,display:"flex"},children:a.jsxs(qme,{...s,...f,ref:c,contentRef:d,style:{...s?.style},name:"editor-canvas",children:[a.jsx($x,{styles:o}),n]})}):a.jsxs(nte,{__unstableContentRef:u,className:"block-editor-block-canvas",style:{height:t},children:[a.jsx($x,{styles:o,scope:":where(.editor-styles-wrapper)",transformOptions:h8t}),a.jsx(cwt,{ref:d,className:"editor-styles-wrapper",tabIndex:-1,children:n})]})}const _ze=x.createContext({}),K_=()=>x.useContext(_ze);function kze({children:e,...t}){const n=x.useRef();return x.useEffect(()=>{n.current&&(n.current.textContent=n.current.textContent)},[e]),a.jsx("div",{hidden:!0,...t,ref:n,children:e})}const Sze=x.forwardRef(({nestingLevel:e,blockCount:t,clientId:n,...o},r)=>{const{insertedBlock:s,setInsertedBlock:i}=K_(),c=vt(Sze),l=G(b=>{const{getTemplateLock:h,isZoomOut:g}=ct(b(J));return!!h(n)||g()},[n]),u=Fd({clientId:n,context:"list-view"}),d=Fd({clientId:s?.clientId,context:"list-view"});if(x.useEffect(()=>{d?.length&&Yt(xe(m("%s block inserted"),d),"assertive")},[d]),l)return null;const p=`list-view-appender__${c}`,f=xe(m("Append to %1$s block at position %2$d, Level %3$d"),u,t+1,e);return a.jsxs("div",{className:"list-view-appender",children:[a.jsx(xm,{ref:r,rootClientId:n,position:"bottom right",isAppender:!0,selectBlockOnInsert:!1,shouldDirectInsert:!1,__experimentalIsQuick:!0,...o,toggleProps:{"aria-describedby":p},onSelectOrClose:b=>{b?.clientId&&i(b)}}),a.jsx(kze,{id:p,children:f})]})}),g8t=bxt(m2e),M8t=x.forwardRef(({isDragged:e,isSelected:t,position:n,level:o,rowCount:r,children:s,className:i,path:c,...l},u)=>{const d=lme({clientId:l["data-block"],enableAnimation:!0,triggerAnimationOnChange:c}),p=xn([u,d]);return a.jsx(g8t,{ref:p,className:oe("block-editor-list-view-leaf",i),level:o,positionInSet:n,setSize:r,isExpanded:void 0,...l,children:s})});function z8t({isSelected:e,selectedClientIds:t,rowItemRef:n}){const o=t.length===1;x.useLayoutEffect(()=>{if(!e||!o||!n.current)return;const r=ps(n.current),{ownerDocument:s}=n.current;if(r===s.body||r===s.documentElement||!r)return;const c=n.current.getBoundingClientRect(),l=r.getBoundingClientRect();(c.topl.bottom)&&n.current.scrollIntoView()},[e,o,n])}function Cze({onClick:e}){return a.jsx("span",{className:"block-editor-list-view__expander",onClick:t=>e(t,{forceToggle:!0}),"aria-hidden":"true","data-testid":"list-view-expander",children:a.jsx(wn,{icon:jt()?qw:Af})})}const O8t=3;function qze(e){if(e.name==="core/image"&&e.attributes?.url)return{url:e.attributes.url,alt:e.attributes.alt,clientId:e.clientId}}function y8t(e){if(e.name!=="core/gallery"||!e.innerBlocks)return[];const t=[];for(const n of e.innerBlocks){const o=qze(n);if(o&&t.push(o),t.length>=O8t)return t}return t}function A8t(e,t){const n=qze(e);return n?[n]:t?[]:y8t(e)}function v8t({clientId:e,isExpanded:t}){const{block:n}=G(r=>({block:r(J).getBlock(e)}),[e]);return x.useMemo(()=>A8t(n,t),[n,t])}const{Badge:x8t}=ct(tr);function w8t({className:e,block:{clientId:t},onClick:n,onContextMenu:o,onMouseDown:r,onToggleExpanded:s,tabIndex:i,onFocus:c,onDragStart:l,onDragEnd:u,draggable:d,isExpanded:p,ariaDescribedBy:f},b){const h=ji(t),g=Fd({clientId:t,context:"list-view"}),{isLocked:z}=km(t),{isContentOnly:A}=G(S=>({isContentOnly:S(J).getBlockEditingMode(t)==="contentOnly"}),[t]),_=z&&!A,v=h?.positionType==="sticky",M=v8t({clientId:t,isExpanded:p}),y=S=>{S.dataTransfer.clearData(),l?.(S)};function k(S){(S.keyCode===Gr||S.keyCode===DN)&&n(S)}return a.jsxs("a",{className:oe("block-editor-list-view-block-select-button",e),onClick:n,onContextMenu:o,onKeyDown:k,onMouseDown:r,ref:b,tabIndex:i,onFocus:c,onDragStart:y,onDragEnd:u,draggable:d,href:`#block-${t}`,"aria-describedby":f,"aria-expanded":p,children:[a.jsx(Cze,{onClick:s}),a.jsx(Zn,{icon:h?.icon,showColors:!0,context:"list-view"}),a.jsxs(Ot,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1,children:[a.jsx("span",{className:"block-editor-list-view-block-select-button__title",children:a.jsx(zs,{ellipsizeMode:"auto",children:g})}),h?.anchor&&a.jsx("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper",children:a.jsx(x8t,{className:"block-editor-list-view-block-select-button__anchor",children:h.anchor})}),v&&a.jsx("span",{className:"block-editor-list-view-block-select-button__sticky",children:a.jsx(wn,{icon:AQe})}),M.length?a.jsx("span",{className:"block-editor-list-view-block-select-button__images","aria-hidden":!0,children:M.map((S,C)=>a.jsx("span",{className:"block-editor-list-view-block-select-button__image",style:{backgroundImage:`url(${S.url})`,zIndex:M.length-C}},S.clientId))}):null,_&&a.jsx("span",{className:"block-editor-list-view-block-select-button__lock",children:a.jsx(wn,{icon:dde})})]})]})}const _8t=x.forwardRef(w8t),k8t=x.forwardRef(({onClick:e,onToggleExpanded:t,block:n,isSelected:o,position:r,siblingBlockCount:s,level:i,isExpanded:c,selectedClientIds:l,...u},d)=>{const{clientId:p}=n,{AdditionalBlockContent:f,insertedBlock:b,setInsertedBlock:h}=K_(),g=l.includes(p)?l:[p];return a.jsxs(a.Fragment,{children:[f&&a.jsx(f,{block:n,insertedBlock:b,setInsertedBlock:h}),a.jsx(Dge,{appendToOwnerDocument:!0,clientIds:g,cloneClassname:"block-editor-list-view-draggable-chip",children:({draggable:z,onDragStart:A,onDragEnd:_})=>a.jsx(_8t,{ref:d,className:"block-editor-list-view-block-contents",block:n,onClick:e,onToggleExpanded:t,isSelected:o,position:r,siblingBlockCount:s,level:i,draggable:z,onDragStart:A,onDragEnd:_,isExpanded:c,...u})})]})}),S8t=(e,t,n)=>xe(m("Block %1$d of %2$d, Level %3$d."),e,t,n),C8t=(e,t)=>[e?.positionLabel?`${xe(m("Position: %s"),e.positionLabel)}.`:void 0,t?m("This block is locked."):void 0].filter(Boolean).join(" "),q8t=(e,t)=>Array.isArray(t)&&t.length?t.indexOf(e)!==-1:t===e;function R8t(e,t,n,o){const r=[...n,e],s=[...o,t],i=Math.min(r.length,s.length)-1,c=r[i],l=s[i];return{start:c,end:l}}function uI(e,t){const n=()=>{const r=t?.querySelector(`[role=row][data-block="${e}"]`);return r?Xr.focusable.find(r)[0]:null};let o=n();o?o.focus():window.requestAnimationFrame(()=>{o=n(),o&&o.focus()})}function T8t({blockIndexes:e,blockDropTargetIndex:t,blockDropPosition:n,clientId:o,firstDraggedBlockIndex:r,isDragged:s}){let i,c,l;if(!s){c=!1;const u=e[o];l=u>r,t!=null&&r!==void 0?u!==void 0&&(u>=r&&u=t?i="down":i="normal",c=typeof t=="number"&&t-1===u&&n==="inside"):t===null&&r!==void 0?u!==void 0&&u>=r?i="up":i="normal":t!=null&&r===void 0?u!==void 0&&(u{const{getBlock:Qe,getBlockName:xt,getSettings:Gt}=Rt(J);return{block:Qe(e),blockName:xt(e),allowRightClickOverrides:Gt().allowRightClickOverrides}},[e]),re=Et(ie,"__experimentalToolbar",!0),ke=`list-view-block-select-button__description-${vt(Rze)}`,{expand:Se,collapse:se,collapseAll:L,BlockSettingsMenu:U,listViewInstanceId:ne,expandedState:ve,setInsertedBlock:qe,treeGridElementRef:Pe,rootClientId:rt}=K_(),qt=C_();function wt(){const Rt=Q(),Qe=Rt.includes(e),xt=Qe?Rt[0]:e,Gt=ee(xt);return{blocksToUpdate:Qe?Rt:[e],firstBlockClientId:xt,firstBlockRootClientId:Gt,selectedBlockClientIds:Rt}}async function Bt(Rt){if(Rt.defaultPrevented||Rt.target.closest("[role=dialog]"))return;const Qe=[Mc,zl].includes(Rt.keyCode);if(qt("core/block-editor/unselect",Rt)&&g.length>0)Rt.stopPropagation(),Rt.preventDefault(),c(Rt,void 0);else if(Qe||qt("core/block-editor/remove",Rt)){var xt;const{blocksToUpdate:Gt,firstBlockClientId:On,firstBlockRootClientId:$n,selectedBlockClientIds:Jn}=wt();if(!de(Gt))return;let pr=(xt=te(On))!==null&&xt!==void 0?xt:$n;$(Gt,!1);const O0=Jn.length>0&&Q().length===0;pr||(pr=ue()[0]),fe(pr,O0)}else if(qt("core/block-editor/duplicate",Rt)){Rt.preventDefault();const{blocksToUpdate:Gt,firstBlockRootClientId:On}=wt();if(me(Gt).every(Jn=>!!Jn&&Et(Jn.name,"multiple",!0)&&V(Jn.name,On))){const Jn=await j(Gt,!1);Jn?.length&&fe(Jn[0],!1)}}else if(qt("core/block-editor/insert-before",Rt)){Rt.preventDefault();const{blocksToUpdate:Gt}=wt();await X(Gt[0]);const On=Q();Z(void 0),fe(On[0],!1)}else if(qt("core/block-editor/insert-after",Rt)){Rt.preventDefault();const{blocksToUpdate:Gt}=wt();await F(Gt.at(-1));const On=Q();Z(void 0),fe(On[0],!1)}else if(qt("core/block-editor/select-all",Rt)){Rt.preventDefault();const{firstBlockRootClientId:Gt,selectedBlockClientIds:On}=wt(),$n=ue(Gt);if(!$n.length)return;if(ds(On,$n)&&Gt&&Gt!==rt){fe(Gt,!0);return}I($n[0],$n[$n.length-1],null)}else if(qt("core/block-editor/collapse-list-view",Rt)){Rt.preventDefault();const{firstBlockClientId:Gt}=wt(),On=ce(Gt,!1);L(),Se(On)}else if(qt("core/block-editor/group",Rt)){const{blocksToUpdate:Gt}=wt();if(Gt.length>1&&Ae(Gt)){Rt.preventDefault();const On=me(Gt),$n=ye(),Jn=Kr(On,$n);P(Gt,Jn),Yt(m("Selected blocks are grouped."));const pr=Q();Z(void 0),fe(pr[0],!1)}}}const ae=x.useCallback(()=>{y(!0),N(e,!0)},[e,y,N]),H=x.useCallback(()=>{y(!1),N(e,!1)},[e,y,N]),Y=x.useCallback(Rt=>{c(Rt,e),Rt.preventDefault()},[e,c]),fe=x.useCallback((Rt,Qe)=>{Qe&&c(void 0,Rt,null,null),uI(Rt,Pe?.current)},[c,Pe]),Re=x.useCallback(Rt=>{Rt.preventDefault(),Rt.stopPropagation(),h===!0?se(e):h===!1&&Se(e)},[e,Se,se,h]),be=x.useCallback(Rt=>{re&&we&&(v.current?.click(),S(new window.DOMRect(Rt.clientX,Rt.clientY,0,0)),Rt.preventDefault())},[we,v,re]),ze=x.useCallback(Rt=>{we&&Rt.button===2&&Rt.preventDefault()},[we]),nt=x.useMemo(()=>{const{ownerDocument:Rt}=_?.current||{};if(!(!k||!Rt))return{ownerDocument:Rt,getBoundingClientRect(){return k}}},[k]),Mt=x.useCallback(()=>{S(void 0)},[S]);if(z8t({isSelected:s,rowItemRef:_,selectedClientIds:g}),!je)return null;const ot=S8t(l,p,u),Ue=C8t(Ne,C),yt=p>0,fn=f&&yt,Ln=oe("block-editor-list-view-block__mover-cell",{"is-visible":M||s}),Mo=oe("block-editor-list-view-block__menu-cell",{"is-visible":M||E});let rr;fn?rr=2:re||(rr=3);const Jo=oe({"is-selected":s,"is-first-selected":E,"is-last-selected":B,"is-branch-selected":i,"is-synced-branch":z,"is-dragging":o,"has-single-cell":!re,"is-synced":Ne?.isSynced,"is-draggable":T,"is-displacement-normal":t==="normal","is-displacement-up":t==="up","is-displacement-down":t==="down","is-after-dragged-blocks":n,"is-nesting":r}),To=g.includes(e)?g:[e],Br=s&&g.length===1;return a.jsxs(M8t,{className:Jo,isDragged:o,onKeyDown:Bt,onMouseEnter:ae,onMouseLeave:H,onFocus:ae,onBlur:H,level:u,position:l,rowCount:d,path:b,id:`list-view-${ne}-block-${e}`,"data-block":e,"data-expanded":R?h:void 0,ref:_,children:[a.jsx(d4,{className:"block-editor-list-view-block__contents-cell",colSpan:rr,ref:A,"aria-selected":!!s,children:({ref:Rt,tabIndex:Qe,onFocus:xt})=>a.jsxs("div",{className:"block-editor-list-view-block__contents-container",children:[a.jsx(k8t,{block:je,onClick:Y,onContextMenu:be,onMouseDown:ze,onToggleExpanded:Re,isSelected:s,position:l,siblingBlockCount:p,level:u,ref:Rt,tabIndex:Br?0:Qe,onFocus:xt,isExpanded:R?h:void 0,selectedClientIds:g,ariaDescribedBy:ke}),a.jsx(kze,{id:ke,children:[ot,Ue].filter(Boolean).join(" ")})]})}),fn&&a.jsx(a.Fragment,{children:a.jsxs(d4,{className:Ln,withoutGridItem:!0,children:[a.jsx(aW,{children:({ref:Rt,tabIndex:Qe,onFocus:xt})=>a.jsx(Fge,{orientation:"vertical",clientIds:[e],ref:Rt,tabIndex:Qe,onFocus:xt})}),a.jsx(aW,{children:({ref:Rt,tabIndex:Qe,onFocus:xt})=>a.jsx($ge,{orientation:"vertical",clientIds:[e],ref:Rt,tabIndex:Qe,onFocus:xt})})]})}),re&&U&&a.jsx(d4,{className:Mo,"aria-selected":!!s,ref:v,children:({ref:Rt,tabIndex:Qe,onFocus:xt})=>a.jsx(U,{clientIds:To,block:je,icon:Wc,label:m("Options"),popoverProps:{anchor:nt},toggleProps:{ref:Rt,className:"block-editor-list-view-block__menu",tabIndex:Qe,onClick:Mt,onFocus:xt},disableOpenOnArrowDown:!0,expand:Se,expandedState:ve,setInsertedBlock:qe,__experimentalSelectBlock:fe})})]})}const E8t=x.memo(Rze);function Tze(e,t,n,o){var r;return n?.includes(e.clientId)?0:((r=t[e.clientId])!==null&&r!==void 0?r:o)?1+e.innerBlocks.reduce(W8t(t,n,o),0):1}const W8t=(e,t,n)=>(o,r)=>{var s;return t?.includes(r.clientId)?o:((s=e[r.clientId])!==null&&s!==void 0?s:n)&&r.innerBlocks.length>0?o+Tze(r,e,t,n):o+1},N8t=()=>{};function Eze(e){const{blocks:t,selectBlock:n=N8t,showBlockMovers:o,selectedClientIds:r,level:s=1,path:i="",isBranchSelected:c=!1,listPosition:l=0,fixedListWindow:u,isExpanded:d,parentId:p,shouldShowInnerBlocks:f=!0,isSyncedBranch:b=!1,showAppender:h=!0}=e,g=ji(p),z=b||!!g?.isSynced,A=G(N=>p?N(J).canEditBlock(p):!0,[p]),{blockDropPosition:_,blockDropTargetIndex:v,firstDraggedBlockIndex:M,blockIndexes:y,expandedState:k,draggedClientIds:S}=K_(),C=x.useRef();if(!A)return null;const R=h&&s===1,T=t.filter(Boolean),E=T.length,B=R?E+1:E;return C.current=l,a.jsxs(a.Fragment,{children:[T.map((N,j)=>{var I;const{clientId:P,innerBlocks:$}=N;j>0&&(C.current+=Tze(T[j-1],k,S,d));const F=!!S?.includes(P),{displacement:X,isAfterDraggedBlocks:Z,isNesting:V}=T8t({blockIndexes:y,blockDropTargetIndex:v,blockDropPosition:_,clientId:P,firstDraggedBlockIndex:M,isDragged:F}),{itemInView:Q}=u,te=Q(C.current),ee=j+1,ue=i.length>0?`${i}_${ee}`:`${ee}`,ce=!!$?.length,me=ce&&f?(I=k[P])!==null&&I!==void 0?I:d:void 0,de=q8t(P,r),Ae=c||de&&ce,ye=F||te||de&&P===r[0]||j===0||j===E-1;return a.jsxs(T5,{value:!de,children:[ye&&a.jsx(E8t,{block:N,selectBlock:n,isSelected:de,isBranchSelected:Ae,isDragged:F,level:s,position:ee,rowCount:B,siblingBlockCount:E,showBlockMovers:o,path:ue,isExpanded:F?!1:me,listPosition:C.current,selectedClientIds:r,isSyncedBranch:z,displacement:X,isAfterDraggedBlocks:Z,isNesting:V}),!ye&&a.jsx("tr",{children:a.jsx("td",{className:"block-editor-list-view-placeholder"})}),ce&&me&&!F&&a.jsx(Eze,{parentId:P,blocks:$,selectBlock:n,showBlockMovers:o,level:s+1,path:ue,listPosition:C.current+1,fixedListWindow:u,isBranchSelected:Ae,selectedClientIds:r,isExpanded:d,isSyncedBranch:z})]},P)}),R&&a.jsx(m2e,{level:s,setSize:B,positionInSet:B,isExpanded:!0,children:a.jsx(d4,{children:N=>a.jsx(Sze,{clientId:p,nestingLevel:s,blockCount:E,...N})})})]})}const B8t=x.memo(Eze);function L8t({draggedBlockClientId:e,listViewRef:t,blockDropTarget:n}){const o=ji(e),r=Fd({clientId:e,context:"list-view"}),{rootClientId:s,clientId:i,dropPosition:c}=n||{},[l,u]=x.useMemo(()=>{if(!t.current)return[];const _=s?t.current.querySelector(`[data-block="${s}"]`):void 0,v=i?t.current.querySelector(`[data-block="${i}"]`):void 0;return[_,v]},[t,s,i]),d=u||l,p=jt(),f=x.useCallback((_,v)=>{if(!d)return 0;let M=d.offsetWidth;const y=ps(d,"horizontal"),k=d.ownerDocument,S=y===k.body||y===k.documentElement;if(y&&!S){const C=y.getBoundingClientRect(),R=jt()?C.right-_.right:_.left-C.left,T=y.clientWidth;if(TC.right)return M-=_.right-C.right,M}return M-v},[p,d]),b=x.useMemo(()=>{if(!d)return{};const _=d.getBoundingClientRect();return{width:f(_,0)}},[f,d]),h=x.useMemo(()=>{if(!d)return{};const _=ps(d),v=d.ownerDocument,M=_===v.body||_===v.documentElement;if(_&&!M){const y=_.getBoundingClientRect(),k=d.getBoundingClientRect(),S=p?y.right-k.right:k.left-y.left;if(!p&&y.left>k.left)return{transform:`translateX( ${S}px )`};if(p&&y.right{if(!l)return 1;const _=parseInt(l.getAttribute("aria-level"),10);return _?_+1:1},[l]),z=x.useMemo(()=>d?d.classList.contains("is-branch-selected"):!1,[d]),A=x.useMemo(()=>{if(!(!d||!(c==="top"||c==="bottom"||c==="inside")))return{contextElement:d,getBoundingClientRect(){const v=d.getBoundingClientRect();let M=v.left,y=0;const k=ps(d,"horizontal"),S=d.ownerDocument,C=k===S.body||k===S.documentElement;if(k&&!C){const E=k.getBoundingClientRect(),B=p?k.offsetWidth-k.clientWidth:0;M{}}),a.jsx(Zn,{icon:o?.icon,showColors:!0,context:"list-view"}),a.jsx(Ot,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1,children:a.jsx("span",{className:"block-editor-list-view-block-select-button__title",children:a.jsx(zs,{ellipsizeMode:"auto",children:r})})})]}),a.jsx("div",{className:"block-editor-list-view-block__menu-cell"})]})})}):null}function P8t(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=Oe(J),{getBlockName:o,getBlockParents:r,getBlockSelectionStart:s,getSelectedBlockClientIds:i,hasMultiSelection:c,hasSelectedBlock:l}=G(J),{getBlockType:u}=G(kt);return{updateBlockSelection:x.useCallback(async(p,f,b,h)=>{if(!p?.shiftKey&&p?.keyCode!==gd){n(f,h);return}p.preventDefault();const g=p.type==="keydown"&&p.keyCode===gd,z=p.type==="keydown"&&(p.keyCode===cc||p.keyCode===Ps||p.keyCode===S2||p.keyCode===FM);if(!z&&!l()&&!c()){n(f,null);return}const A=i(),_=[...r(f),f];if((g||z&&!A.some(k=>_.includes(k)))&&await e(),!g){let k=s(),S=f;z&&(!l()&&!c()&&(k=f),b&&(S=b));const C=r(k),R=r(S),{start:T,end:E}=R8t(k,S,C,R);await t(T,E,null)}const v=i();if((p.keyCode===S2||p.keyCode===FM)&&v.length>1)return;const M=A.filter(k=>!v.includes(k));let y;if(M.length===1){const k=u(o(M[0]))?.title;k&&(y=xe(m("%s deselected."),k))}else M.length>1&&(y=xe(m("%s blocks deselected."),M.length));y&&Yt(y,"assertive")},[e,o,u,r,s,i,c,l,t,n])}}function j8t(e){return x.useMemo(()=>{const n={};let o=0;const r=s=>{s.forEach(i=>{n[i.clientId]=o,o++,i.innerBlocks.length>0&&r(i.innerBlocks)})};return r(e),n},[e])}function I8t({blocks:e,rootClientId:t}){return G(n=>{const{getDraggedBlockClientIds:o,getSelectedBlockClientIds:r,getEnabledClientIdsTree:s}=ct(n(J));return{selectedClientIds:r(),draggedClientIds:o(),clientIdsTree:e??s(t)}},[e,t])}function D8t({collapseAll:e,expand:t}){const{expandedBlock:n,getBlockParents:o}=G(r=>{const{getBlockParents:s,getExpandedBlock:i}=ct(r(J));return{expandedBlock:i(),getBlockParents:s}},[]);x.useEffect(()=>{if(n){const r=o(n,!1);e(),t(r)}},[e,t,n,o])}const Ml=24;function F8t(e,t,n=1,o=!1){const r=o?t.right-n*Ml:t.left+n*Ml;return o?e.x>r:e.xr.clientId===o.rootClientId);return n}function Wze(e,t){const n=e[t+1];return n&&n.isDraggedBlock?Wze(e,t+1):n}function H8t(e,t,n=1,o=!1){const r=o?t.right-n*Ml:t.left+n*Ml;return(o?e.xr+Ml)&&e.y0&&r.isExpanded||H8t(t,i,l.length,n))){const p=r.isExpanded?0:r.innerBlockCount||0;return{rootClientId:r.clientId,clientId:r.clientId,blockIndex:p,dropPosition:"inside"}}if(u&&r.rootClientId&&F8t(t,i,l.length,n)){const p=Wze(e,c),f=r.nestingLevel,b=p?p.nestingLevel:1;if(f&&b){const h=$8t(t,i,l.length,n),g=Math.max(Math.min(h,f-b),0);if(l[g]){let z=r.blockIndex;if(l[g].nestingLevel===p?.nestingLevel)z=p?.blockIndex;else for(let A=c;A>=0;A--){const _=e[A];if(_.rootClientId===l[g].rootClientId){z=_.blockIndex+1;break}}return{rootClientId:l[g].rootClientId,clientId:r.clientId,blockIndex:z,dropPosition:o}}}}if(!r.canInsertDraggedBlocksAsSibling)return;const d=u?1:0;return{rootClientId:r.rootClientId,clientId:r.clientId,blockIndex:r.blockIndex+d,dropPosition:o}}const G8t={leading:!1,trailing:!0};function K8t({dropZoneElement:e,expandedState:t,setExpandedState:n}){const{getBlockRootClientId:o,getBlockIndex:r,getBlockCount:s,getDraggedBlockClientIds:i,canInsertBlocks:c}=G(J),[l,u]=x.useState(),{rootClientId:d,blockIndex:p}=l||{},f=_ge(d,p),b=jt(),h=Fr(d),g=x.useCallback((M,y)=>{const{rootClientId:k}=y||{};k&&y?.dropPosition==="inside"&&!M[k]&&n({type:"expand",clientIds:[k]})},[n]),z=vE(g,500,G8t);x.useEffect(()=>{if(l?.dropPosition!=="inside"||h!==l?.rootClientId){z.cancel();return}z(t,l)},[t,h,l,z]);const A=i(),_=vE(x.useCallback((M,y)=>{const k={x:M.clientX,y:M.clientY},S=!!A?.length,R=Array.from(y.querySelectorAll("[data-block]")).map(E=>{const B=E.dataset.block,N=E.dataset.expanded==="true",j=E.classList.contains("is-dragging"),I=parseInt(E.getAttribute("aria-level"),10),P=o(B);return{clientId:B,isExpanded:N,rootClientId:P,blockIndex:r(B),element:E,nestingLevel:I||void 0,isDraggedBlock:S?j:!1,innerBlockCount:s(B),canInsertDraggedBlocksAsSibling:S?c(A,P):!0,canInsertDraggedBlocksAsChild:S?c(A,B):!0}}),T=X8t(R,k,b);T&&u(T)},[c,A,s,r,o,b]),50);return{ref:q5({dropZoneElement:e,onDrop(M){_.cancel(),l&&f(M),u(void 0)},onDragLeave(){_.cancel(),u(null)},onDragOver(M){_(M,M.currentTarget)},onDragEnd(){_.cancel(),u(void 0)}}),target:l}}function Y8t({firstSelectedBlockClientId:e,setExpandedState:t}){const[n,o]=x.useState(null),{selectedBlockParentClientIds:r}=G(s=>{const{getBlockParents:i}=s(J);return{selectedBlockParentClientIds:i(e,!1)}},[e]);return x.useEffect(()=>{n!==e&&r?.length&&t({type:"expand",clientIds:r})},[e,r,n,t]),{setSelectedTreeId:o}}function Z8t({selectBlock:e}){const t=Fn(),{getBlockOrder:n,getBlockRootClientId:o,getBlocksByClientId:r,getPreviousBlockClientId:s,getSelectedBlockClientIds:i,getSettings:c,canInsertBlockType:l,canRemoveBlocks:u}=G(J),{flashBlock:d,removeBlocks:p,replaceBlocks:f,insertBlocks:b}=Oe(J),h=R7();return Mn(g=>{function z(v,M){M&&e(void 0,v,null,null),uI(v,g)}function A(v){const M=i(),y=M.includes(v),k=y?M[0]:v,S=o(k);return{blocksToUpdate:y?M:[v],firstBlockClientId:k,firstBlockRootClientId:S,originallySelectedBlockClientIds:M}}function _(v){if(v.defaultPrevented||!g.contains(v.target.ownerDocument.activeElement))return;const y=v.target.ownerDocument.activeElement?.closest("[role=row]")?.dataset?.block;if(!y)return;const{blocksToUpdate:k,firstBlockClientId:S,firstBlockRootClientId:C,originallySelectedBlockClientIds:R}=A(y);if(k.length!==0){if(v.preventDefault(),v.type==="copy"||v.type==="cut"){k.length===1&&d(k[0]),h(v.type,k);const E=r(k);kme(v,E,t)}if(v.type==="cut"){var T;if(!u(k))return;let E=(T=s(S))!==null&&T!==void 0?T:C;p(k,!1);const B=R.length>0&&i().length===0;E||(E=n()[0]),z(E,B)}else if(v.type==="paste"){const{__experimentalCanUserUseUnfilteredHTML:E}=c(),B=rwt(v,E);if(k.length===1){const[N]=k;if(B.every(j=>l(j.name,N))){b(B,void 0,N),z(B[0]?.clientId,!1);return}}f(k,B,B.length-1,-1),z(B[0]?.clientId,!1)}}}return g.ownerDocument.addEventListener("copy",_),g.ownerDocument.addEventListener("cut",_),g.ownerDocument.addEventListener("paste",_),()=>{g.ownerDocument.removeEventListener("copy",_),g.ownerDocument.removeEventListener("cut",_),g.ownerDocument.removeEventListener("paste",_)}},[])}const Q8t=(e,t)=>t.type==="clear"?{}:Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce((n,o)=>({...n,[o]:t.type==="expand"}),{})}:e,ote=32;function Nze({id:e,blocks:t,dropZoneElement:n,showBlockMovers:o=!1,isExpanded:r=!1,showAppender:s=!1,blockSettingsMenu:i=oMe,rootClientId:c,description:l,onSelect:u,additionalBlockContent:d},p){t&&Ke("`blocks` property in `wp.blockEditor.__experimentalListView`",{since:"6.3",alternative:"`rootClientId` property"});const f=vt(Nze),{clientIdsTree:b,draggedClientIds:h,selectedClientIds:g}=I8t({blocks:t,rootClientId:c}),z=j8t(b),{getBlock:A}=G(J),{visibleBlockCount:_}=G(de=>{const{getGlobalBlockCount:Ae,getClientIdsOfDescendants:ye}=de(J),Ne=h?.length>0?ye(h).length+1:0;return{visibleBlockCount:Ae()-Ne}},[h]),{updateBlockSelection:v}=P8t(),[M,y]=x.useReducer(Q8t,{}),[k,S]=x.useState(null),{setSelectedTreeId:C}=Y8t({firstSelectedBlockClientId:g[0],setExpandedState:y}),R=x.useCallback((de,Ae,ye)=>{v(de,Ae,null,ye),C(Ae),u&&u(A(Ae))},[C,v,u,A]),{ref:T,target:E}=K8t({dropZoneElement:n,expandedState:M,setExpandedState:y}),B=x.useRef(),N=Z8t({selectBlock:R}),j=xn([N,B,T,p]);x.useEffect(()=>{g?.length&&uI(g[0],B?.current)},[]);const I=x.useCallback(de=>{if(!de)return;const Ae=Array.isArray(de)?de:[de];y({type:"expand",clientIds:Ae})},[y]),P=x.useCallback(de=>{de&&y({type:"collapse",clientIds:[de]})},[y]),$=x.useCallback(()=>{y({type:"clear"})},[y]),F=x.useCallback(de=>{I(de?.dataset?.block)},[I]),X=x.useCallback(de=>{P(de?.dataset?.block)},[P]),Z=x.useCallback((de,Ae,ye)=>{de.shiftKey&&v(de,Ae?.dataset?.block,ye?.dataset?.block)},[v]);D8t({collapseAll:$,expand:I});const V=h?.[0],{blockDropTargetIndex:Q,blockDropPosition:te,firstDraggedBlockIndex:ee}=x.useMemo(()=>{let de,Ae;if(E?.clientId){const ye=z[E.clientId];de=ye===void 0||E?.dropPosition==="top"?ye:ye+1}else E===null&&(de=null);if(V){const ye=z[V];Ae=ye===void 0||E?.dropPosition==="top"?ye:ye+1}return{blockDropTargetIndex:de,blockDropPosition:E?.dropPosition,firstDraggedBlockIndex:Ae}},[E,z,V]),ue=x.useMemo(()=>({blockDropPosition:te,blockDropTargetIndex:Q,blockIndexes:z,draggedClientIds:h,expandedState:M,expand:I,firstDraggedBlockIndex:ee,collapse:P,collapseAll:$,BlockSettingsMenu:i,listViewInstanceId:f,AdditionalBlockContent:d,insertedBlock:k,setInsertedBlock:S,treeGridElementRef:B,rootClientId:c}),[te,Q,z,h,M,I,ee,P,$,i,f,d,k,S,c]),[ce]=oCe(B,ote,_,{expandedState:M,useWindowing:!0,windowOverscan:40});if(!b.length&&!s)return null;const me=l&&`block-editor-list-view-description-${f}`;return a.jsxs(T5,{value:!0,children:[a.jsx(L8t,{draggedBlockClientId:V,listViewRef:B,blockDropTarget:E}),l&&a.jsx(qn,{id:me,children:l}),a.jsx(Qht,{id:e,className:oe("block-editor-list-view-tree",{"is-dragging":h?.length>0&&Q!==void 0}),"aria-label":m("Block navigation structure"),ref:j,onCollapseRow:X,onExpandRow:F,onFocusRow:Z,applicationAriaLabel:m("Block navigation structure"),"aria-describedby":me,style:{"--wp-admin--list-view-dragged-items-height":h?.length?`${ote*(h.length-1)}px`:null},children:a.jsx(_ze.Provider,{value:ue,children:a.jsx(B8t,{blocks:b,parentId:c,selectBlock:R,showBlockMovers:o,fixedListWindow:ce,selectedClientIds:g,isExpanded:r,showAppender:s})})})]})}const Bze=x.forwardRef(Nze),J8t=x.forwardRef((e,t)=>a.jsx(Bze,{ref:t,...e,showAppender:!1,rootClientId:null,onSelect:null,additionalBlockContent:null,blockSettingsMenu:void 0}));function eWt({genericPreviewBlock:e,style:t,className:n,activeStyle:o}){const r=on(e.name)?.example,s=Q7(n,o,t),i=x.useMemo(()=>({...e,title:t.label||t.name,description:t.description,initialAttributes:{...e.attributes,className:s+" block-editor-block-styles__block-preview-container"},example:r}),[e,s]);return a.jsx(age,{item:i})}const rte=()=>{};function Lze({clientId:e,onSwitch:t=rte,onHoverClassName:n=rte}){const{onSelect:o,stylesToRender:r,activeStyle:s,genericPreviewBlock:i,className:c}=J7({clientId:e,onSwitch:t}),[l,u]=x.useState(null),d=Yn("medium","<");if(!r||r.length===0)return null;const p=F1(u,250),f=h=>{o(h),n(null),u(null),p.cancel()},b=h=>{var g;if(l===h){p.cancel();return}p(h),n((g=h?.name)!==null&&g!==void 0?g:null)};return a.jsxs("div",{className:"block-editor-block-styles",children:[a.jsx("div",{className:"block-editor-block-styles__variants",children:r.map(h=>{const g=h.label||h.name;return a.jsx(Ce,{__next40pxDefaultSize:!0,className:oe("block-editor-block-styles__item",{"is-active":s.name===h.name}),variant:"secondary",label:g,onMouseEnter:()=>b(h),onFocus:()=>b(h),onMouseLeave:()=>b(null),onBlur:()=>b(null),onClick:()=>f(h),"aria-current":s.name===h.name,children:a.jsx(zs,{numberOfLines:1,className:"block-editor-block-styles__item-text",children:g})},h.name)})}),l&&!d&&a.jsx(Io,{placement:"left-start",offset:34,focusOnMount:!1,children:a.jsx("div",{className:"block-editor-block-styles__preview-panel",onMouseLeave:()=>b(null),children:a.jsx(eWt,{activeStyle:s,className:c,genericPreviewBlock:i,style:l})})})]})}const ste={0:mde,1:KZe,2:YZe,3:ZZe,4:QZe,5:JZe,6:eQe};function ite({level:e}){return ste[e]?a.jsx(qo,{icon:ste[e]}):null}const ate=[1,2,3,4,5,6],tWt={className:"block-library-heading-level-dropdown"};function Cm({options:e=ate,value:t,onChange:n}){const o=e.filter(r=>r===0||ate.includes(r)).sort((r,s)=>r-s);return a.jsx(Lc,{popoverProps:tWt,icon:a.jsx(ite,{level:t}),label:m("Change level"),controls:o.map(r=>{const s=r===t;return{icon:a.jsx(ite,{level:r}),title:r===0?m("Paragraph"):xe(m("Heading %d"),r),isActive:s,onClick(){n(r)},role:"menuitemradio"}})})}function Pze({icon:e=nu,label:t=m("Choose variation"),instructions:n=m("Select a variation to start with:"),variations:o,onSelect:r,allowSkip:s}){const i=oe("block-editor-block-variation-picker",{"has-many-variations":o.length>4});return a.jsxs(vo,{icon:e,label:t,instructions:n,className:i,children:[a.jsx("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":m("Block variations"),children:o.map(c=>a.jsxs("li",{children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",icon:c.icon&&c.icon.src?c.icon.src:c.icon,iconSize:48,onClick:()=>r(c),className:"block-editor-block-variation-picker__variation",label:c.description||c.title}),a.jsx("span",{className:"block-editor-block-variation-picker__variation-label",children:c.title})]},c.name))}),s&&a.jsx("div",{className:"block-editor-block-variation-picker__skip",children:a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>r(),children:m("Skip")})})]})}function nWt({className:e,onSelectVariation:t,selectedValue:n,variations:o}){return a.jsxs("fieldset",{className:e,children:[a.jsx(qn,{as:"legend",children:m("Transform to variation")}),o.map(r=>a.jsx(Ce,{__next40pxDefaultSize:!0,size:"compact",icon:a.jsx(Zn,{icon:r.icon,showColors:!0}),isPressed:n===r.name,label:n===r.name?r.title:xe(m("Transform to %s"),r.title),onClick:()=>t(r.name),"aria-label":r.title,showTooltip:!0},r.name))]})}function oWt({className:e,onSelectVariation:t,selectedValue:n,variations:o}){const r=o.map(({name:s,title:i,description:c})=>({value:s,label:i,info:c}));return a.jsx(c0,{className:e,label:m("Transform to variation"),text:m("Transform to variation"),popoverProps:{position:"bottom center",className:`${e}__popover`},icon:tu,toggleProps:{iconPosition:"right"},children:()=>a.jsx("div",{className:`${e}__container`,children:a.jsx(Cn,{children:a.jsx(kf,{choices:r,value:n,onSelect:t})})})})}function rWt({className:e,onSelectVariation:t,selectedValue:n,variations:o}){return a.jsx("div",{className:e,children:a.jsx(Do,{label:m("Transform to variation"),value:n,hideLabelFromVision:!0,onChange:t,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,children:o.map(r=>a.jsx(ga,{icon:a.jsx(Zn,{icon:r.icon,showColors:!0}),value:r.name,label:n===r.name?r.title:xe(m("Transform to %s"),r.title)},r.name))})})}function sWt({blockClientId:e}){const{updateBlockAttributes:t}=Oe(J),{activeBlockVariation:n,variations:o,isContentOnly:r}=G(f=>{const{getActiveBlockVariation:b,getBlockVariations:h}=f(kt),{getBlockName:g,getBlockAttributes:z,getBlockEditingMode:A}=f(J),_=e&&g(e),{hasContentRoleAttribute:v}=ct(f(kt)),M=v(_);return{activeBlockVariation:b(_,z(e)),variations:_&&h(_,"transform"),isContentOnly:A(e)==="contentOnly"&&!M}},[e]),s=n?.name,i=x.useMemo(()=>{const f=new Set;return o?(o.forEach(b=>{b.icon&&f.add(b.icon?.src||b.icon)}),f.size===o.length):!1},[o]),c=f=>{t(e,{...o.find(({name:b})=>b===f).attributes})};if(!o?.length||r)return null;const l="block-editor-block-variation-transforms",d=o.length>5?nWt:rWt,p=i?d:oWt;return a.jsx(p,{className:l,onSelectVariation:c,selectedValue:s,variations:o})}const JR={top:{icon:cQe,title:We("Align top","Block vertical alignment setting")},center:{icon:sQe,title:We("Align middle","Block vertical alignment setting")},bottom:{icon:rQe,title:We("Align bottom","Block vertical alignment setting")},stretch:{icon:aQe,title:We("Stretch to fill","Block vertical alignment setting")},"space-between":{icon:iQe,title:We("Space between","Block vertical alignment setting")}},iWt=["top","center","bottom"],aWt="top";function jze({value:e,onChange:t,controls:n=iWt,isCollapsed:o=!0,isToolbar:r}){function s(d){return()=>t(e===d?void 0:d)}const i=JR[e],c=JR[aWt],l=r?Wn:Lc,u=r?{isCollapsed:o}:{};return a.jsx(l,{icon:i?i.icon:c.icon,label:We("Change vertical alignment","Block vertical alignment setting label"),controls:n.map(d=>({...JR[d],isActive:e===d,role:o?"menuitemradio":void 0,onClick:s(d)})),...u})}const Ize=e=>a.jsx(jze,{...e,isToolbar:!1}),Dze=e=>a.jsx(jze,{...e,isToolbar:!0}),cWt=Or(e=>t=>{const[n,o,r,s,i]=Un("color.palette.default","color.palette.theme","color.palette.custom","color.custom","color.defaultPalette"),c=i?[...o||[],...n||[],...r||[]]:[...o||[],...r||[]],{colors:l=c,disableCustomColors:u=!s}=t,d=l&&l.length>0||!u;return a.jsx(e,{...t,colors:l,disableCustomColors:u,hasColorsToChoose:d})},"withColorContext"),Fze=cWt(Hw);Xs([Gs,Uf]);function Yx({backgroundColor:e,fallbackBackgroundColor:t,fallbackTextColor:n,fallbackLinkColor:o,fontSize:r,isLargeText:s,textColor:i,linkColor:c,enableAlphaChecker:l=!1}){const u=e||t;if(!u)return null;const d=i||n,p=c||o;if(!d&&!p)return null;const f=[{color:d,description:m("text color")},{color:p,description:m("link color")}],b=an(u),h=b.alpha()<1,g=b.brightness(),z={level:"AA",size:s||s!==!1&&r>=24?"large":"small"};let A="",_="";for(const v of f){if(!v.color)continue;const M=an(v.color),y=M.isReadable(b,z),k=M.alpha()<1;if(!y){if(h||k)continue;A=gn(o?null:t)}),e&&a.jsx(lWt,{format:e,onChange:n})]})}function lWt({format:e,onChange:t}){var n;const r=[...[...new Set(["Y-m-d",We("n/j/Y","short date format"),We("n/j/Y g:i A","short date format with time"),We("M j, Y","medium date format"),We("M j, Y g:i A","medium date format with time"),We("F j, Y","long date format"),We("M j","short date format without the year")])].map((l,u)=>({key:`suggested-${u}`,name:r0(l,Ud),format:l})),{key:"human-diff",name:r_(Ud),format:"human-diff"}],s={key:"custom",name:m("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",hint:m("Enter your own date format")},[i,c]=x.useState(()=>!!e&&!r.some(l=>l.format===e));return a.jsxs(dt,{children:[a.jsx(ob,{__next40pxDefaultSize:!0,label:m("Choose a format"),options:[...r,s],value:i?s:(n=r.find(l=>l.format===e))!==null&&n!==void 0?n:s,onChange:({selectedItem:l})=>{l===s?c(!0):(c(!1),t(l.format))}}),i&&a.jsx(dn,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:m("Custom format"),hideLabelFromVision:!0,help:cr(m("Enter a date or time format string."),{Link:a.jsx(hr,{href:m("https://wordpress.org/documentation/article/customize-date-and-time-format/")})}),value:e,onChange:l=>t(l)})]})}function Vze({id:e,colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:s,onChange:i}){let c;s==="unset"?c=a.jsx(eb,{className:"block-editor-duotone-control__unset-indicator"}):s?c=a.jsx(Gbe,{values:s}):c=a.jsx(wn,{icon:LZe});const l=m("Apply duotone filter"),d=`${vt(Vze,"duotone-control",e)}__description`;return a.jsx(so,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:m("Duotone")},renderToggle:({isOpen:p,onToggle:f})=>{const b=h=>{!p&&h.keyCode===Ps&&(h.preventDefault(),f())};return a.jsx(Vt,{showTooltip:!0,onClick:f,"aria-haspopup":"true","aria-expanded":p,onKeyDown:b,label:l,icon:c})},renderContent:()=>a.jsxs(Cn,{label:m("Duotone"),children:[a.jsx("p",{children:m("Create a two-tone color effect without losing your original image.")}),a.jsx(Xbe,{"aria-label":l,"aria-describedby":d,colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:s,onChange:i})]})})}const uWt=({setting:e,children:t,panelId:n,...o})=>{const r=()=>{e.colorValue?e.onColorChange():e.gradientValue&&e.onGradientChange()};return a.jsx(tt,{hasValue:()=>!!e.colorValue||!!e.gradientValue,label:e.label,onDeselect:r,isShownByDefault:e.isShownByDefault!==void 0?e.isShownByDefault:!0,...o,className:"block-editor-tools-panel-color-gradient-settings__item",panelId:n,resetAllFilter:e.resetAllFilter,children:t})},dWt=({colorValue:e,label:t})=>a.jsxs(Ot,{justify:"flex-start",children:[a.jsx(eb,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:e}),a.jsx(Tn,{className:"block-editor-panel-color-gradient-settings__color-name",title:t,children:t})]}),pWt=e=>({onToggle:t,isOpen:n})=>{const{clearable:o,colorValue:r,gradientValue:s,onColorChange:i,onGradientChange:c,label:l}=e,u=x.useRef(void 0),d={onClick:t,className:oe("block-editor-panel-color-gradient-settings__dropdown",{"is-open":n}),"aria-expanded":n,ref:u},p=()=>{r?i():s&&c()},f=r??s;return a.jsxs(a.Fragment,{children:[a.jsx(Ce,{__next40pxDefaultSize:!0,...d,children:a.jsx(dWt,{colorValue:f,label:l})}),o&&f&&a.jsx(Ce,{__next40pxDefaultSize:!0,label:m("Reset"),className:"block-editor-panel-color-gradient-settings__reset",size:"small",icon:am,onClick:()=>{p(),n&&t(),u.current?.focus()}})]})};function Y_({colors:e,disableCustomColors:t,disableCustomGradients:n,enableAlpha:o,gradients:r,settings:s,__experimentalIsRenderedInSidebar:i,...c}){let l;return i&&(l={placement:"left-start",offset:36,shift:!0}),a.jsx(a.Fragment,{children:s.map((u,d)=>{const p={clearable:!1,colorValue:u.colorValue,colors:e,disableCustomColors:t,disableCustomGradients:n,enableAlpha:o,gradientValue:u.gradientValue,gradients:r,label:u.label,onColorChange:u.onColorChange,onGradientChange:u.onGradientChange,showTitle:!1,__experimentalIsRenderedInSidebar:i,...u},f={clearable:u.clearable,label:u.label,colorValue:u.colorValue,gradientValue:u.gradientValue,onColorChange:u.onColorChange,onGradientChange:u.onGradientChange};return u&&a.jsx(uWt,{setting:u,...c,children:a.jsx(so,{popoverProps:l,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:pWt(f),renderContent:()=>a.jsx($s,{paddingSize:"none",children:a.jsx("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:a.jsx(uze,{...p})})})})},d)})})}const Hze=100,Uze=300,Xze={placement:"bottom-start"},fWt={crop:m("Image cropped."),rotate:m("Image rotated."),cropAndRotate:m("Image cropped and rotated.")};function bWt({crop:e,rotation:t,url:n,id:o,onSaveImage:r,onFinishEditing:s}){const{createErrorNotice:i,createSuccessNotice:c}=Oe(mt),[l,u]=x.useState(!1),d=x.useCallback(()=>{u(!1),s()},[s]),p=x.useCallback(()=>{u(!0);const f=[];if(t>0&&f.push({type:"rotate",args:{angle:t}}),(e.width<99.9||e.height<99.9)&&f.push({type:"crop",args:{left:e.x,top:e.y,width:e.width,height:e.height}}),f.length===0){u(!1),s();return}const b=f.length===1?f[0].type:"cropAndRotate";Tt({path:`/wp/v2/media/${o}/edit`,method:"POST",data:{src:n,modifiers:f}}).then(h=>{r({id:h.id,url:h.source_url}),c(fWt[b],{type:"snackbar",actions:[{label:m("Undo"),onClick:()=>{r({id:o,url:n})}}]})}).catch(h=>{i(xe(m("Could not edit image. %s"),x1(h.message)),{id:"image-editing-error",type:"snackbar"})}).finally(()=>{u(!1),s()})},[e,t,o,n,r,i,c,s]);return x.useMemo(()=>({isInProgress:l,apply:p,cancel:d}),[l,p,d])}function hWt({url:e,naturalWidth:t,naturalHeight:n}){const[o,r]=x.useState(),[s,i]=x.useState(),[c,l]=x.useState({x:0,y:0}),[u,d]=x.useState(100),[p,f]=x.useState(0),b=t/n,[h,g]=x.useState(b),z=x.useCallback(()=>{const A=(p+90)%360;let _=b;if(p%180===90&&(_=1/b),A===0){r(),f(A),g(b),l(k=>({x:-(k.y*_),y:k.x*_}));return}function v(k){const S=document.createElement("canvas");let C=0,R=0;A%180?(S.width=k.target.height,S.height=k.target.width):(S.width=k.target.width,S.height=k.target.height),(A===90||A===180)&&(C=S.width),(A===270||A===180)&&(R=S.height);const T=S.getContext("2d");T.translate(C,R),T.rotate(A*Math.PI/180),T.drawImage(k.target,0,0),S.toBlob(E=>{r(URL.createObjectURL(E)),f(A),g(S.width/S.height),l(B=>({x:-(B.y*_),y:B.x*_}))})}const M=new window.Image;M.src=e,M.onload=v;const y=gr("media.crossOrigin",void 0,e);typeof y=="string"&&(M.crossOrigin=y)},[p,b,e]);return x.useMemo(()=>({editedUrl:o,setEditedUrl:r,crop:s,setCrop:i,position:c,setPosition:l,zoom:u,setZoom:d,rotation:p,setRotation:f,rotateClockwise:z,aspect:h,setAspect:g,defaultAspect:b}),[o,s,c,u,p,z,h,b])}const Gze=x.createContext({}),RO=()=>x.useContext(Gze);function mWt({id:e,url:t,naturalWidth:n,naturalHeight:o,onFinishEditing:r,onSaveImage:s,children:i}){const c=hWt({url:t,naturalWidth:n,naturalHeight:o}),l=bWt({id:e,url:t,onSaveImage:s,onFinishEditing:r,...c}),u=x.useMemo(()=>({...c,...l}),[c,l]);return a.jsx(Gze.Provider,{value:u,children:i})}function Mv({aspectRatios:e,isDisabled:t,label:n,onClick:o,value:r}){return a.jsx(Cn,{label:n,children:e.map(({name:s,slug:i,ratio:c})=>a.jsx(Ct,{disabled:t,onClick:()=>{o(c)},role:"menuitemradio",isSelected:c===r,icon:c===r?M0:void 0,children:s},i))})}function gWt(e){const[t,n,...o]=e.split("/").map(Number);return t<=0||n<=0||Number.isNaN(t)||Number.isNaN(n)||o.length?NaN:n?t/n:t}function eT({ratio:e,...t}){return{ratio:gWt(e),...t}}function MWt({toggleProps:e}){const{isInProgress:t,aspect:n,setAspect:o,defaultAspect:r}=RO(),[s,i,c]=Un("dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios");return a.jsx(c0,{icon:zZe,label:m("Aspect Ratio"),popoverProps:Xze,toggleProps:e,children:({onClose:l})=>a.jsxs(a.Fragment,{children:[a.jsx(Mv,{isDisabled:t,onClick:u=>{o(u),l()},value:n,aspectRatios:[{slug:"original",name:m("Original"),aspect:r},...c?s.map(eT).filter(({ratio:u})=>u===1):[]]}),i?.length>0&&a.jsx(Mv,{label:m("Theme"),isDisabled:t,onClick:u=>{o(u),l()},value:n,aspectRatios:i}),c&&a.jsx(Mv,{label:m("Landscape"),isDisabled:t,onClick:u=>{o(u),l()},value:n,aspectRatios:s.map(eT).filter(({ratio:u})=>u>1)}),c&&a.jsx(Mv,{label:m("Portrait"),isDisabled:t,onClick:u=>{o(u),l()},value:n,aspectRatios:s.map(eT).filter(({ratio:u})=>u<1)})]})})}var tT,cte;function zWt(){if(cte)return tT;cte=1;var e=!1,t,n,o,r,s,i,c,l,u,d,p,f,b,h,g;function z(){if(!e){e=!0;var _=navigator.userAgent,v=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(_),M=/(Mac OS X)|(Windows)|(Linux)/.exec(_);if(f=/\b(iPhone|iP[ao]d)/.exec(_),b=/\b(iP[ao]d)/.exec(_),d=/Android/i.exec(_),h=/FBAN\/\w+;/i.exec(_),g=/Mobile/i.exec(_),p=!!/Win64/.exec(_),v){t=v[1]?parseFloat(v[1]):v[5]?parseFloat(v[5]):NaN,t&&document&&document.documentMode&&(t=document.documentMode);var y=/(?:Trident\/(\d+.\d+))/.exec(_);i=y?parseFloat(y[1])+4:t,n=v[2]?parseFloat(v[2]):NaN,o=v[3]?parseFloat(v[3]):NaN,r=v[4]?parseFloat(v[4]):NaN,r?(v=/(?:Chrome\/(\d+\.\d+))/.exec(_),s=v&&v[1]?parseFloat(v[1]):NaN):s=NaN}else t=n=o=s=r=NaN;if(M){if(M[1]){var k=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(_);c=k?parseFloat(k[1].replace("_",".")):!0}else c=!1;l=!!M[2],u=!!M[3]}else c=l=u=!1}}var A={ie:function(){return z()||t},ieCompatibilityMode:function(){return z()||i>t},ie64:function(){return A.ie()&&p},firefox:function(){return z()||n},opera:function(){return z()||o},webkit:function(){return z()||r},safari:function(){return A.webkit()},chrome:function(){return z()||s},windows:function(){return z()||l},osx:function(){return z()||c},linux:function(){return z()||u},iphone:function(){return z()||f},mobile:function(){return z()||f||b||d||g},nativeApp:function(){return z()||h},android:function(){return z()||d},ipad:function(){return z()||b}};return tT=A,tT}var nT,lte;function OWt(){if(lte)return nT;lte=1;var e=!!(typeof window<"u"&&window.document&&window.document.createElement),t={canUseDOM:e,canUseWorkers:typeof Worker<"u",canUseEventListeners:e&&!!(window.addEventListener||window.attachEvent),canUseViewport:e&&!!window.screen,isInWorker:!e};return nT=t,nT}var oT,ute;function yWt(){if(ute)return oT;ute=1;var e=OWt(),t;e.canUseDOM&&(t=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0);/** + `),h+="}"),c.blockStyles&&l.forEach(({selector:g,duotoneSelector:z,styles:A,fallbackGapValue:_,hasLayoutSupport:v,featureSelectors:M,styleVariationSelectors:y,skipSelectorWrapper:k})=>{if(M){const R=Hee(M,A);Object.entries(R).forEach(([T,E])=>{if(E.length){const B=E.join(";");h+=`:root :where(${T}){${B};}`}})}if(z){const R={};A?.filter&&(R.filter=A.filter,delete A.filter);const T=A2(R);T.length&&(h+=`${z}{${T.join(";")};}`)}!r&&(ll===g||v)&&(h+=MMe({style:A,selector:g,hasBlockGapSupport:n,hasFallbackGapSupport:o,fallbackGapValue:_}));const S=A2(A,g,d,e,s);if(S?.length){const R=k?g:`:root :where(${g})`;h+=`${R}{${S.join(";")};}`}A?.css&&(h+=$W(A.css,`:root :where(${g})`)),c.variationStyles&&y&&Object.entries(y).forEach(([R,T])=>{const E=A?.variations?.[R];if(E){if(M){const N=Hee(M,E);Object.entries(N).forEach(([j,I])=>{if(I.length){const P=rTt(j,T),$=I.join(";");h+=`:root :where(${P}){${$};}`}})}const B=A2(E,T,d,e);B.length&&(h+=`:root :where(${T}){${B.join(";")};}`),E?.css&&(h+=$W(E.css,`:root :where(${T})`))}});const C=Object.entries(A).filter(([R])=>R.startsWith(":"));C?.length&&C.forEach(([R,T])=>{const E=A2(T);if(!E?.length)return;const N=`:root :where(${g.split(",").map(j=>j+R).join(",")}){${E.join(";")};}`;h+=N})}),c.layoutStyles&&(h=h+".wp-site-blocks > .alignleft { float: left; margin-right: 2em; }",h=h+".wp-site-blocks > .alignright { float: right; margin-left: 2em; }",h=h+".wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }"),c.blockGap&&n){const g=us(e?.styles?.spacing?.blockGap)||"0.5em";h=h+`:root :where(.wp-site-blocks) > * { margin-block-start: ${g}; margin-block-end: 0; }`,h=h+":root :where(.wp-site-blocks) > :first-child { margin-block-start: 0; }",h=h+":root :where(.wp-site-blocks) > :last-child { margin-block-end: 0; }"}return c.presets&&u.forEach(({selector:g,presets:z})=>{(ll===g||Hx===g)&&(g="");const A=nTt(g,z);A.length>0&&(h+=A)}),h};function cTt(e,t){return sI(e,t).flatMap(({presets:o})=>oTt(o))}const lTt=(e,t)=>{if(e?.selectors&&Object.keys(e.selectors).length>0)return e.selectors;const n={root:t};return Object.entries(eTt).forEach(([o,r])=>{const s=pd(e,o);s&&(n[r]=s)}),n},H_=(e,t,n)=>{const o={};return e.forEach(r=>{const s=r.name,i=pd(r);let c=pd(r,"filter.duotone");if(!c){const b=pd(r),h=An(r,"color.__experimentalDuotone",!1);c=h&&Ws(b,h)}const l=!!r?.supports?.layout||!!r?.supports?.__experimentalLayout,u=r?.supports?.spacing?.blockGap?.__experimentalDefault,d=t(s),p={};d?.forEach(b=>{const h=n?`-${n}`:"",g=`${b.name}${h}`,z=ISt(g,i);p[g]=z});const f=lTt(r,i);o[s]={duotoneSelector:c,fallbackGapValue:u,featureSelectors:Object.keys(f).length?f:void 0,hasLayoutSupport:l,name:s,selector:i,styleVariationSelectors:d?.length?p:void 0}}),o};function uTt(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}function $W(e,t){let n="";return!e||e.trim()===""||e.split("&").forEach(r=>{if(!r||r.trim()==="")return;if(!r.includes("{"))n+=`:root :where(${t}){${r.trim()}}`;else{const i=r.replace("}","").split("{");if(i.length!==2)return;const[c,l]=i,u=c.match(/([>+~\s]*::[a-zA-Z-]+)/),d=u?u[1]:"",p=u?c.replace(d,"").trim():c.trim();let f;p===""?f=t:f=c.startsWith(" ")?Ws(t,p):PSt(t,p),n+=`:root :where(${f})${d}{${l.trim()}}`}}),n}function zMe(e={},t){const[n]=iMe("spacing.blockGap"),o=n!==null,r=!o,s=G(c=>{const{getSettings:l}=c(J);return!!l().disableLayoutStyles}),{getBlockStyles:i}=G(kt);return x.useMemo(()=>{var c;if(!e?.styles||!e?.settings)return[];const l=uTt(e),u=H_(gs(),i),d=aTt(l,u),p=V_(l,u,o,r,s,t),f=cTt(l,u),b=[{css:d,isGlobalStyles:!0},{css:p,isGlobalStyles:!0},{css:(c=l.styles.css)!==null&&c!==void 0?c:"",isGlobalStyles:!0},{assets:f,__unstableType:"svg",isGlobalStyles:!0}];return gs().forEach(h=>{if(l.styles.blocks[h.name]?.css){const g=u[h.name].selector;b.push({css:$W(l.styles.blocks[h.name]?.css,g),isGlobalStyles:!0})}}),[b,l.settings]},[o,r,e,s,t,i])}function dTt(e=!1){const{merged:t}=x.useContext(lb);return zMe(t,e)}function pTt({__next40pxDefaultSize:e=!1,__nextHasNoMarginBottom:t=!1,value:n="",onChange:o,fontFamilies:r,className:s,...i}){var c;const[l]=Un("typography.fontFamilies");if(r||(r=l),!r||r.length===0)return null;const u=[{key:"",name:m("Default")},...r.map(({fontFamily:p,name:f})=>({key:p,name:f||p,style:{fontFamily:p}}))];t||Ke("Bottom margin styles for wp.blockEditor.FontFamilyControl",{since:"6.7",version:"7.0",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"}),!e&&(i.size===void 0||i.size==="default")&&Ke("36px default size for wp.blockEditor.__experimentalFontFamilyControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."});const d=(c=u.find(p=>p.key===n))!==null&&c!==void 0?c:"";return a.jsx(ob,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,label:m("Font"),value:d,onChange:({selectedItem:p})=>o(p.key),options:u,className:oe("block-editor-font-family-control",s,{"is-next-has-no-margin-bottom":t}),...i})}const fTt=(e,t)=>m(e?t?"Appearance":"Font style":"Font weight");function bTt(e){const{__next40pxDefaultSize:t=!1,onChange:n,hasFontStyles:o=!0,hasFontWeights:r=!0,fontFamilyFaces:s,value:{fontStyle:i,fontWeight:c},...l}=e,u=o||r,d=fTt(o,r),p={key:"default",name:m("Default"),style:{fontStyle:void 0,fontWeight:void 0}},{fontStyles:f,fontWeights:b,combinedStyleAndWeightOptions:h}=Ege(s),g=()=>{const y=[p];return h&&y.push(...h),y},z=()=>{const y=[p];return f.forEach(({name:k,value:S})=>{y.push({key:S,name:k,style:{fontStyle:S,fontWeight:void 0}})}),y},A=()=>{const y=[p];return b.forEach(({name:k,value:S})=>{y.push({key:S,name:k,style:{fontStyle:void 0,fontWeight:S}})}),y},_=x.useMemo(()=>o&&r?g():o?z():A(),[e.options,f,b,h]),v=_.find(y=>y.style.fontStyle===i&&y.style.fontWeight===c)||_[0],M=()=>v?xe(m(o?r?"Currently selected font appearance: %s":"Currently selected font style: %s":"Currently selected font weight: %s"),v.name):m("No selected font appearance");return!t&&(l.size===void 0||l.size==="default")&&Ke("36px default size for wp.blockEditor.__experimentalFontAppearanceControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."}),u&&a.jsx(ob,{...l,className:"components-font-appearance-control",__next40pxDefaultSize:t,__shouldNotWarnDeprecated36pxSize:!0,label:d,describedBy:M(),options:_,value:v,onChange:({selectedItem:y})=>n(y.style)})}const dv=1.5,Uee=.01,Xee=10,OMe="";function hTt(e){return e!==void 0&&e!==OMe}const mTt=({__next40pxDefaultSize:e=!1,value:t,onChange:n,__unstableInputWidth:o="60px",...r})=>{const s=hTt(t),i=(d,p)=>{if(s)return d;const f=Uee*Xee;switch(`${d}`){case`${f}`:return dv+f;case"0":return p?d:dv-f;case"":return dv;default:return d}},c=(d,p)=>{const f=["insertText","insertFromPaste"].includes(p.payload.event.nativeEvent?.inputType),b=i(d.value,f);return{...d,value:b}},l=s?t:OMe,u=(d,{event:p})=>{if(d===""){n();return}if(p.type==="click"){n(i(`${d}`,!1));return}n(`${d}`)};return!e&&(r.size===void 0||r.size==="default")&&Ke("36px default size for wp.blockEditor.LineHeightControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."}),a.jsx("div",{className:"block-editor-line-height-control",children:a.jsx(g0,{...r,__shouldNotWarnDeprecated36pxSize:!0,__next40pxDefaultSize:e,__unstableInputWidth:o,__unstableStateReducer:c,onChange:u,label:m("Line height"),placeholder:dv,step:Uee,spinFactor:Xee,value:l,min:0,spinControls:"custom"})})};function gTt({__next40pxDefaultSize:e=!1,value:t,onChange:n,__unstableInputWidth:o="60px",...r}){const[s]=Un("spacing.units"),i=U1({availableUnits:s||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return!e&&(r.size===void 0||r.size==="default")&&Ke("36px default size for wp.blockEditor.__experimentalLetterSpacingControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."}),a.jsx(Ro,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,...r,label:m("Letter spacing"),value:t,__unstableInputWidth:o,units:i,onChange:n})}const MTt=[{label:m("Align text left"),value:"left",icon:$3},{label:m("Align text center"),value:"center",icon:kw},{label:m("Align text right"),value:"right",icon:V3},{label:m("Justify text"),value:"justify",icon:mZe}],zTt=["left","center","right"];function yMe({className:e,value:t,onChange:n,options:o=zTt}){const r=x.useMemo(()=>MTt.filter(s=>o.includes(s.value)),[o]);return r.length?a.jsx(Do,{isDeselectable:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:m("Text alignment"),className:oe("block-editor-text-alignment-control",e),value:t,onChange:s=>{n(s===t?void 0:s)},children:r.map(s=>a.jsx(ga,{value:s.value,icon:s.icon,label:s.label},s.value))}):null}const OTt=[{label:m("None"),value:"none",icon:am},{label:m("Uppercase"),value:"uppercase",icon:GZe},{label:m("Lowercase"),value:"lowercase",icon:UZe},{label:m("Capitalize"),value:"capitalize",icon:jZe}];function yTt({className:e,value:t,onChange:n}){return a.jsx(Do,{isDeselectable:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:m("Letter case"),className:oe("block-editor-text-transform-control",e),value:t,onChange:o=>{n(o===t?void 0:o)},children:OTt.map(o=>a.jsx(ga,{value:o.value,icon:o.icon,label:o.label},o.value))})}const ATt=[{label:m("None"),value:"none",icon:am},{label:m("Underline"),value:"underline",icon:XZe},{label:m("Strikethrough"),value:"line-through",icon:sde}];function vTt({value:e,onChange:t,className:n}){return a.jsx(Do,{isDeselectable:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:m("Decoration"),className:oe("block-editor-text-decoration-control",n),value:e,onChange:o=>{t(o===e?void 0:o)},children:ATt.map(o=>a.jsx(ga,{value:o.value,icon:o.icon,label:o.label},o.value))})}const xTt=[{label:m("Horizontal"),value:"horizontal-tb",icon:aJe},{label:m("Vertical"),value:jt()?"vertical-lr":"vertical-rl",icon:cJe}];function wTt({className:e,value:t,onChange:n}){return a.jsx(Do,{isDeselectable:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:m("Orientation"),className:oe("block-editor-writing-mode-control",e),value:t,onChange:o=>{n(o===t?void 0:o)},children:xTt.map(o=>a.jsx(ga,{value:o.value,icon:o.icon,label:o.label},o.value))})}const _Tt=1,kTt=6;function AMe(e){const t=xMe(e),n=wMe(e),o=_Me(e),r=kMe(e),s=CMe(e),i=SMe(e),c=qMe(e),l=RMe(e),u=TMe(e),d=vMe(e);return t||n||o||r||s||i||d||c||l||u}function vMe(e){return e?.typography?.defaultFontSizes!==!1&&e?.typography?.fontSizes?.default?.length||e?.typography?.fontSizes?.theme?.length||e?.typography?.fontSizes?.custom?.length||e?.typography?.customFontSize}function xMe(e){return["default","theme","custom"].some(t=>e?.typography?.fontFamilies?.[t]?.length)}function wMe(e){return e?.typography?.lineHeight}function _Me(e){return e?.typography?.fontStyle||e?.typography?.fontWeight}function STt(e){return e?.typography?.fontStyle?e?.typography?.fontWeight?m("Appearance"):m("Font style"):m("Font weight")}function kMe(e){return e?.typography?.letterSpacing}function SMe(e){return e?.typography?.textTransform}function CMe(e){return e?.typography?.textAlign}function qMe(e){return e?.typography?.textDecoration}function RMe(e){return e?.typography?.writingMode}function TMe(e){return e?.typography?.textColumns}function CTt(e){var t,n,o;const r=e?.typography?.fontSizes,s=!!e?.typography?.defaultFontSizes;return[...(t=r?.custom)!==null&&t!==void 0?t:[],...(n=r?.theme)!==null&&n!==void 0?n:[],...s?(o=r?.default)!==null&&o!==void 0?o:[]:[]]}function qTt({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){const s=dp(),i=()=>{const c=e(n);t(c)};return a.jsx(En,{label:m("Typography"),resetAll:i,panelId:o,dropdownMenuProps:s,children:r})}const RTt={fontFamily:!0,fontSize:!0,fontAppearance:!0,lineHeight:!0,letterSpacing:!0,textAlign:!0,textTransform:!0,textDecoration:!0,writingMode:!0,textColumns:!0};function EMe({as:e=qTt,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:s,defaultControls:i=RTt}){const c=fe=>ua({settings:r},"",fe),l=xMe(r),u=c(o?.typography?.fontFamily),{fontFamilies:d,fontFamilyFaces:p}=x.useMemo(()=>qSt(r,u),[r,u]),f=fe=>{const Re=d?.find(({fontFamily:be})=>be===fe)?.slug;n(gn(t,["typography","fontFamily"],Re?`var:preset|font-family|${Re}`:fe||void 0))},b=()=>!!t?.typography?.fontFamily,h=()=>f(void 0),g=vMe(r),z=!r?.typography?.customFontSize,A=CTt(r),_=c(o?.typography?.fontSize),v=(fe,Re)=>{const be=Re?.slug?`var:preset|font-size|${Re?.slug}`:fe;n(gn(t,["typography","fontSize"],be||void 0))},M=()=>!!t?.typography?.fontSize,y=()=>v(void 0),k=_Me(r),S=STt(r),C=r?.typography?.fontStyle,R=r?.typography?.fontWeight,T=c(o?.typography?.fontStyle),E=c(o?.typography?.fontWeight),{nearestFontStyle:B,nearestFontWeight:N}=TSt(p,T,E),j=x.useCallback(({fontStyle:fe,fontWeight:Re})=>{(fe!==T||Re!==E)&&n({...t,typography:{...t?.typography,fontStyle:fe||void 0,fontWeight:Re||void 0}})},[T,E,n,t]),I=()=>!!t?.typography?.fontStyle||!!t?.typography?.fontWeight,P=x.useCallback(()=>{j({})},[j]);x.useEffect(()=>{B&&N?j({fontStyle:B,fontWeight:N}):P()},[B,N,P,j]);const $=wMe(r),F=c(o?.typography?.lineHeight),X=fe=>{n(gn(t,["typography","lineHeight"],fe||void 0))},Z=()=>t?.typography?.lineHeight!==void 0,V=()=>X(void 0),Q=kMe(r),te=c(o?.typography?.letterSpacing),ee=fe=>{n(gn(t,["typography","letterSpacing"],fe||void 0))},ue=()=>!!t?.typography?.letterSpacing,ce=()=>ee(void 0),me=TMe(r),de=c(o?.typography?.textColumns),Ae=fe=>{n(gn(t,["typography","textColumns"],fe||void 0))},ye=()=>!!t?.typography?.textColumns,Ne=()=>Ae(void 0),je=SMe(r),ie=c(o?.typography?.textTransform),we=fe=>{n(gn(t,["typography","textTransform"],fe||void 0))},re=()=>!!t?.typography?.textTransform,pe=()=>we(void 0),ke=qMe(r),Se=c(o?.typography?.textDecoration),se=fe=>{n(gn(t,["typography","textDecoration"],fe||void 0))},L=()=>!!t?.typography?.textDecoration,U=()=>se(void 0),ne=RMe(r),ve=c(o?.typography?.writingMode),qe=fe=>{n(gn(t,["typography","writingMode"],fe||void 0))},Pe=()=>!!t?.typography?.writingMode,rt=()=>qe(void 0),qt=CMe(r),wt=c(o?.typography?.textAlign),Bt=fe=>{n(gn(t,["typography","textAlign"],fe||void 0))},ae=()=>!!t?.typography?.textAlign,H=()=>Bt(void 0),Y=x.useCallback(fe=>({...fe,typography:{}}),[]);return a.jsxs(e,{resetAllFilter:Y,value:t,onChange:n,panelId:s,children:[l&&a.jsx(tt,{label:m("Font"),hasValue:b,onDeselect:h,isShownByDefault:i.fontFamily,panelId:s,children:a.jsx(pTt,{fontFamilies:d,value:u,onChange:f,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),g&&a.jsx(tt,{label:m("Size"),hasValue:M,onDeselect:y,isShownByDefault:i.fontSize,panelId:s,children:a.jsx(rbt,{value:_,onChange:v,fontSizes:A,disableCustomFontSizes:z,withReset:!1,withSlider:!0,size:"__unstable-large"})}),k&&a.jsx(tt,{className:"single-column",label:S,hasValue:I,onDeselect:P,isShownByDefault:i.fontAppearance,panelId:s,children:a.jsx(bTt,{value:{fontStyle:T,fontWeight:E},onChange:j,hasFontStyles:C,hasFontWeights:R,fontFamilyFaces:p,size:"__unstable-large"})}),$&&a.jsx(tt,{className:"single-column",label:m("Line height"),hasValue:Z,onDeselect:V,isShownByDefault:i.lineHeight,panelId:s,children:a.jsx(mTt,{__unstableInputWidth:"auto",value:F,onChange:X,size:"__unstable-large"})}),Q&&a.jsx(tt,{className:"single-column",label:m("Letter spacing"),hasValue:ue,onDeselect:ce,isShownByDefault:i.letterSpacing,panelId:s,children:a.jsx(gTt,{value:te,onChange:ee,size:"__unstable-large",__unstableInputWidth:"auto"})}),me&&a.jsx(tt,{className:"single-column",label:m("Columns"),hasValue:ye,onDeselect:Ne,isShownByDefault:i.textColumns,panelId:s,children:a.jsx(g0,{label:m("Columns"),max:kTt,min:_Tt,onChange:Ae,size:"__unstable-large",spinControls:"custom",value:de,initialPosition:1})}),ke&&a.jsx(tt,{className:"single-column",label:m("Decoration"),hasValue:L,onDeselect:U,isShownByDefault:i.textDecoration,panelId:s,children:a.jsx(vTt,{value:Se,onChange:se,size:"__unstable-large",__unstableInputWidth:"auto"})}),ne&&a.jsx(tt,{className:"single-column",label:m("Orientation"),hasValue:Pe,onDeselect:rt,isShownByDefault:i.writingMode,panelId:s,children:a.jsx(wTt,{value:ve,onChange:qe,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),je&&a.jsx(tt,{label:m("Letter case"),hasValue:re,onDeselect:pe,isShownByDefault:i.textTransform,panelId:s,children:a.jsx(yTt,{value:ie,onChange:we,showNone:!0,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),qt&&a.jsx(tt,{label:m("Text alignment"),hasValue:ae,onDeselect:H,isShownByDefault:i.textAlign,panelId:s,children:a.jsx(yMe,{value:wt,onChange:Bt,size:"__unstable-large",__nextHasNoMarginBottom:!0})})]})}const Gee={px:{max:300,steps:1},"%":{max:100,steps:1},vw:{max:100,steps:1},vh:{max:100,steps:1},em:{max:10,steps:.1},rm:{max:10,steps:.1},svw:{max:100,steps:1},lvw:{max:100,steps:1},dvw:{max:100,steps:1},svh:{max:100,steps:1},lvh:{max:100,steps:1},dvh:{max:100,steps:1},vi:{max:100,steps:1},svi:{max:100,steps:1},lvi:{max:100,steps:1},dvi:{max:100,steps:1},vb:{max:100,steps:1},svb:{max:100,steps:1},lvb:{max:100,steps:1},dvb:{max:100,steps:1},vmin:{max:100,steps:1},svmin:{max:100,steps:1},lvmin:{max:100,steps:1},dvmin:{max:100,steps:1},vmax:{max:100,steps:1},svmax:{max:100,steps:1},lvmax:{max:100,steps:1},dvmax:{max:100,steps:1}};function iI({icon:e,isMixed:t=!1,minimumCustomValue:n,onChange:o,onMouseOut:r,onMouseOver:s,showSideInLabel:i=!0,side:c,spacingSizes:l,type:u,value:d}){var p,f;d=g_(d,l);let b=l;const h=l.length<=xhe,g=G(Q=>Q(J).getSettings()?.disableCustomSpacingSizes),[z,A]=x.useState(!g&&d!==void 0&&!Qp(d)),[_,v]=x.useState(n),M=Fr(d);d&&M!==d&&!Qp(d)&&z!==!0&&A(!0);const[y]=Un("spacing.units"),k=U1({availableUnits:y||["px","em","rem"]});let S=null;!h&&!z&&d!==void 0&&(!Qp(d)||Qp(d)&&t)?(b=[...l,{name:t?m("Mixed"):xe(m("Custom (%s)"),d),slug:"custom",size:d}],S=b.length-1):t||(S=z?aM(d,l):tAt(d,l));const R=x.useMemo(()=>yo(S),[S])[1]||k[0]?.value,T=()=>{d===void 0&&o("0")},E=Q=>d===void 0?void 0:l[Q]?.name,B=parseFloat(S,10),N=Q=>!isNaN(parseFloat(Q))?Q:void 0,j=(Q,te)=>{const ee=parseInt(Q,10);if(te==="selectList"){if(ee===0)return;if(ee===1)return"0"}else if(ee===0)return"0";return`var:preset|spacing|${l[Q]?.slug}`},I=Q=>{o([Q,R].join(""))},P=t?m("Mixed"):null,$=b.map((Q,te)=>({key:te,name:Q.name})),F=l.slice(1,l.length-1).map((Q,te)=>({value:te+1,label:void 0})),X=Iz.includes(c)&&i?vO[c]:"",Z=i?u?.toLowerCase():u,V=xe(We("%1$s %2$s","spacing"),X,Z).trim();return a.jsxs(Ot,{className:"spacing-sizes-control__wrapper",children:[e&&a.jsx(qo,{className:"spacing-sizes-control__icon",icon:e,size:24}),z&&a.jsxs(a.Fragment,{children:[a.jsx(Ro,{onMouseOver:s,onMouseOut:r,onFocus:s,onBlur:r,onChange:Q=>o(N(Q)),value:S,units:k,min:_,placeholder:P,disableUnits:t,label:V,hideLabelFromVision:!0,className:"spacing-sizes-control__custom-value-input",size:"__unstable-large",onDragStart:()=>{d?.charAt(0)==="-"&&v(0)},onDrag:()=>{d?.charAt(0)==="-"&&v(0)},onDragEnd:()=>{v(n)}}),a.jsx(bo,{__next40pxDefaultSize:!0,onMouseOver:s,onMouseOut:r,onFocus:s,onBlur:r,value:B,min:0,max:(p=Gee[R]?.max)!==null&&p!==void 0?p:10,step:(f=Gee[R]?.steps)!==null&&f!==void 0?f:.1,withInputField:!1,onChange:I,className:"spacing-sizes-control__custom-value-range",__nextHasNoMarginBottom:!0,label:V,hideLabelFromVision:!0})]}),h&&!z&&a.jsx(bo,{__next40pxDefaultSize:!0,onMouseOver:s,onMouseOut:r,className:"spacing-sizes-control__range-control",value:S,onChange:Q=>o(j(Q)),onMouseDown:Q=>{Q?.nativeEvent?.offsetX<35&&T()},withInputField:!1,"aria-valuenow":S,"aria-valuetext":l[S]?.name,renderTooltipContent:E,min:0,max:l.length-1,marks:F,label:V,hideLabelFromVision:!0,__nextHasNoMarginBottom:!0,onFocus:s,onBlur:r}),!h&&!z&&a.jsx(ob,{className:"spacing-sizes-control__custom-select-control",value:$.find(Q=>Q.key===S)||"",onChange:Q=>{o(j(Q.selectedItem.key,"selectList"))},options:$,label:V,hideLabelFromVision:!0,size:"__unstable-large",onMouseOver:s,onMouseOut:r,onFocus:s,onBlur:r}),!g&&a.jsx(Ce,{label:m(z?"Use size preset":"Set custom size"),icon:$P,onClick:()=>{A(!z)},isPressed:z,size:"small",className:"spacing-sizes-control__custom-toggle",iconSize:24})]})}const Kee=["vertical","horizontal"];function TTt({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,sides:r,spacingSizes:s,type:i,values:c}){const l=d=>p=>{if(!t)return;const f={...Object.keys(c).reduce((b,h)=>(b[h]=g_(c[h],s),b),{})};d==="vertical"&&(f.top=p,f.bottom=p),d==="horizontal"&&(f.left=p,f.right=p),t(f)},u=r?.length?Kee.filter(d=>khe(r,d)):Kee;return a.jsx(a.Fragment,{children:u.map(d=>{const p=d==="vertical"?c.top:c.left;return a.jsx(iI,{icon:whe[d],label:vO[d],minimumCustomValue:e,onChange:l(d),onMouseOut:n,onMouseOver:o,side:d,spacingSizes:s,type:i,value:p,withInputField:!1},`spacing-sizes-control-${d}`)})})}function ETt({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,sides:r,spacingSizes:s,type:i,values:c}){const l=r?.length?Iz.filter(d=>r.includes(d)):Iz,u=d=>p=>{const f={...Object.keys(c).reduce((b,h)=>(b[h]=g_(c[h],s),b),{})};f[d]=p,t(f)};return a.jsx(a.Fragment,{children:l.map(d=>a.jsx(iI,{icon:whe[d],label:vO[d],minimumCustomValue:e,onChange:u(d),onMouseOut:n,onMouseOver:o,side:d,spacingSizes:s,type:i,value:c[d],withInputField:!1},`spacing-sizes-control-${d}`))})}function WTt({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,showSideInLabel:r,side:s,spacingSizes:i,type:c,values:l}){const u=d=>p=>{const f={...Object.keys(l).reduce((b,h)=>(b[h]=g_(l[h],i),b),{})};f[d]=p,t(f)};return a.jsx(iI,{label:vO[s],minimumCustomValue:e,onChange:u(s),onMouseOut:n,onMouseOver:o,showSideInLabel:r,side:s,spacingSizes:i,type:c,value:l[s],withInputField:!1})}function NTt({isLinked:e,...t}){const n=m(e?"Unlink sides":"Link sides");return a.jsx(B0,{text:n,children:a.jsx(Ce,{...t,size:"small",icon:e?xa:Pl,iconSize:24,"aria-label":n})})}const KR=[],BTt=new Intl.Collator("und",{numeric:!0}).compare;function WMe(){const[e,t,n,o]=Un("spacing.spacingSizes.custom","spacing.spacingSizes.theme","spacing.spacingSizes.default","spacing.defaultSpacingSizes"),r=e??KR,s=t??KR,i=n&&o!==!1?n:KR;return x.useMemo(()=>{const c=[{name:m("None"),slug:"0",size:0},...r,...s,...i];return c.every(({slug:l})=>/^[0-9]/.test(l))&&c.sort((l,u)=>BTt(l.slug,u.slug)),c.length>xhe?[{name:m("Default"),slug:"default",size:void 0},...c]:c},[r,s,i])}function g4({inputProps:e,label:t,minimumCustomValue:n=0,onChange:o,onMouseOut:r,onMouseOver:s,showSideInLabel:i=!0,sides:c=Iz,useSelect:l,values:u}){const d=WMe(),p=u||eAt,f=c?.length===1,b=c?.includes("horizontal")&&c?.includes("vertical")&&c?.length===2,[h,g]=x.useState(oAt(p,c)),z=()=>{g(h===Fu.axial?Fu.custom:Fu.axial)},_={...e,minimumCustomValue:n,onChange:k=>{const S={...u,...k};o(S)},onMouseOut:r,onMouseOver:s,sides:c,spacingSizes:d,type:t,useSelect:l,values:p},v=()=>h===Fu.axial?a.jsx(TTt,{..._}):h===Fu.custom?a.jsx(ETt,{..._}):a.jsx(WTt,{side:h,..._,showSideInLabel:i}),M=Iz.includes(h)&&i?vO[h]:"",y=xe(We("%1$s %2$s","spacing"),t,M).trim();return a.jsxs("fieldset",{className:"spacing-sizes-control",children:[a.jsxs(Ot,{className:"spacing-sizes-control__header",children:[a.jsx(no.VisualLabel,{as:"legend",className:"spacing-sizes-control__label",children:y}),!f&&!b&&a.jsx(NTt,{label:t,onClick:z,isLinked:h===Fu.axial})]}),a.jsx(dt,{spacing:.5,children:v()})]})}const Yee={px:{max:1e3,step:1},"%":{max:100,step:1},vw:{max:100,step:1},vh:{max:100,step:1},em:{max:50,step:.1},rem:{max:50,step:.1},svw:{max:100,step:1},lvw:{max:100,step:1},dvw:{max:100,step:1},svh:{max:100,step:1},lvh:{max:100,step:1},dvh:{max:100,step:1},vi:{max:100,step:1},svi:{max:100,step:1},lvi:{max:100,step:1},dvi:{max:100,step:1},vb:{max:100,step:1},svb:{max:100,step:1},lvb:{max:100,step:1},dvb:{max:100,step:1},vmin:{max:100,step:1},svmin:{max:100,step:1},lvmin:{max:100,step:1},dvmin:{max:100,step:1},vmax:{max:100,step:1},svmax:{max:100,step:1},lvmax:{max:100,step:1},dvmax:{max:100,step:1}};function LTt({label:e=m("Height"),onChange:t,value:n}){var o,r;const s=parseFloat(n),[i]=Un("spacing.units"),c=U1({availableUnits:i||["%","px","em","rem","vh","vw"]}),l=x.useMemo(()=>yo(n),[n])[1]||c[0]?.value||"px",u=p=>{t([p,l].join(""))},d=p=>{const[f,b]=yo(n);["em","rem"].includes(p)&&b==="px"?t((f/16).toFixed(2)+p):["em","rem"].includes(b)&&p==="px"?t(Math.round(f*16)+p):["%","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax"].includes(p)&&f>100&&t(100+p)};return a.jsxs("fieldset",{className:"block-editor-height-control",children:[a.jsx(no.VisualLabel,{as:"legend",children:e}),a.jsxs(Yo,{children:[a.jsx(Tn,{isBlock:!0,children:a.jsx(Ro,{value:n,units:c,onChange:t,onUnitChange:d,min:0,size:"__unstable-large",label:e,hideLabelFromVision:!0})}),a.jsx(Tn,{isBlock:!0,children:a.jsx(t1,{marginX:2,marginBottom:0,children:a.jsx(bo,{__next40pxDefaultSize:!0,value:s,min:0,max:(o=Yee[l]?.max)!==null&&o!==void 0?o:100,step:(r=Yee[l]?.step)!==null&&r!==void 0?r:.1,withInputField:!1,onChange:u,__nextHasNoMarginBottom:!0,label:e,hideLabelFromVision:!0})})})]})]})}function U_(e,t){const{getBlockOrder:n,getBlockAttributes:o}=G(J);return(s,i)=>{const c=(i-1)*t+s-1;let l=0;for(const d of n(e)){var u;const{columnStart:p,rowStart:f}=(u=o(d).style?.layout)!==null&&u!==void 0?u:{};(f-1)*t+p-1!!s,u=m(c==="horizontal"?"Width":"Height"),[d]=Un("spacing.units"),p=U1({availableUnits:d||["%","px","em","rem","vh","vw"]}),f=()=>{t({selfStretch:void 0,flexSize:void 0})};return x.useEffect(()=>{s==="fixed"&&!i&&t({...e,selfStretch:"fit"})},[]),a.jsxs(dt,{as:tt,spacing:2,hasValue:l,label:u,onDeselect:f,isShownByDefault:o,panelId:r,children:[a.jsxs(Do,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:DTt(n),value:s||"fit",help:PTt(s,n),onChange:b=>{t({selfStretch:b,flexSize:b!=="fixed"?null:i})},isBlock:!0,children:[a.jsx(Kn,{value:"fit",label:We("Fit","Intrinsic block width in flex layout")},"fit"),a.jsx(Kn,{value:"fill",label:We("Grow","Block with expanding width in flex layout")},"fill"),a.jsx(Kn,{value:"fixed",label:We("Fixed","Block with fixed width in flex layout")},"fixed")]}),s==="fixed"&&a.jsx(Ro,{size:"__unstable-large",units:p,onChange:b=>{t({selfStretch:s,flexSize:b})},value:i,label:u,hideLabelFromVision:!0})]})}function DTt(e){const{orientation:t="horizontal"}=e;return m(t==="horizontal"?"Width":"Height")}function FTt({childLayout:e,onChange:t,parentLayout:n,isShownByDefault:o,panelId:r}){const{columnStart:s,rowStart:i,columnSpan:c,rowSpan:l}=e,{columnCount:u=3,rowCount:d}=n??{},p=G(v=>v(J).getBlockRootClientId(r)),{moveBlocksToPosition:f,__unstableMarkNextChangeAsNotPersistent:b}=Oe(J),h=U_(p,u),g=()=>!!s||!!i,z=()=>!!c||!!l,A=()=>{t({columnStart:void 0,rowStart:void 0})},_=()=>{t({columnSpan:void 0,rowSpan:void 0})};return a.jsxs(a.Fragment,{children:[a.jsxs(Ot,{as:tt,hasValue:z,label:m("Grid span"),onDeselect:_,isShownByDefault:o,panelId:r,children:[a.jsx(B1,{size:"__unstable-large",label:m("Column span"),type:"number",onChange:v=>{const M=v===""?1:parseInt(v,10);t({columnStart:s,rowStart:i,rowSpan:l,columnSpan:M})},value:c??1,min:1}),a.jsx(B1,{size:"__unstable-large",label:m("Row span"),type:"number",onChange:v=>{const M=v===""?1:parseInt(v,10);t({columnStart:s,rowStart:i,columnSpan:c,rowSpan:M})},value:l??1,min:1})]}),window.__experimentalEnableGridInteractivity&&u&&a.jsxs(Yo,{as:tt,hasValue:g,label:m("Grid placement"),onDeselect:A,isShownByDefault:!1,panelId:r,children:[a.jsx(Tn,{style:{width:"50%"},children:a.jsx(B1,{size:"__unstable-large",label:m("Column"),type:"number",onChange:v=>{const M=v===""?1:parseInt(v,10);t({columnStart:M,rowStart:i,columnSpan:c,rowSpan:l}),b(),f([r],p,p,h(M,i))},value:s??1,min:1,max:u?u-(c??1)+1:void 0})}),a.jsx(Tn,{style:{width:"50%"},children:a.jsx(B1,{size:"__unstable-large",label:m("Row"),type:"number",onChange:v=>{const M=v===""?1:parseInt(v,10);t({columnStart:s,rowStart:M,columnSpan:c,rowSpan:l}),b(),f([r],p,p,h(s,M))},value:i??1,min:1,max:d?d-(l??1)+1:void 0})})]})]})}function NMe({panelId:e,value:t,onChange:n=()=>{},options:o,defaultValue:r="auto",hasValue:s,isShownByDefault:i=!0}){const c=t??"auto",[l,u,d]=Un("dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios"),p=u?.map(({name:h,ratio:g})=>({label:h,value:g})),f=l?.map(({name:h,ratio:g})=>({label:h,value:g})),b=[{label:We("Original","Aspect ratio option for dimensions control"),value:"auto"},...d?f:[],...p||[],{label:We("Custom","Aspect ratio option for dimensions control"),value:"custom",disabled:!0,hidden:!0}];return a.jsx(tt,{hasValue:s||(()=>c!==r),label:m("Aspect ratio"),onDeselect:()=>n(void 0),isShownByDefault:i,panelId:e,children:a.jsx(Pn,{label:m("Aspect ratio"),value:c,options:o??b,onChange:n,size:"__unstable-large",__nextHasNoMarginBottom:!0})})}const YR=["horizontal","vertical"];function BMe(e){const t=LMe(e),n=PMe(e),o=jMe(e),r=IMe(e),s=DMe(e),i=FMe(e),c=$Me(e),l=VMe(e);return t||n||o||r||s||i||c||l}function LMe(e){return e?.layout?.contentSize}function PMe(e){return e?.layout?.wideSize}function jMe(e){return e?.spacing?.padding}function IMe(e){return e?.spacing?.margin}function DMe(e){return e?.spacing?.blockGap}function FMe(e){return e?.dimensions?.minHeight}function $Me(e){return e?.dimensions?.aspectRatio}function VMe(e){var t;const{type:n="default",default:{type:o="default"}={},allowSizingOnChildren:r=!1}=(t=e?.parentLayout)!==null&&t!==void 0?t:{},s=(o==="flex"||n==="flex"||o==="grid"||n==="grid")&&r;return!!e?.layout&&s}function $Tt(e){const{defaultSpacingSizes:t,spacingSizes:n}=e?.spacing||{};return t!==!1&&n?.default?.length>0||n?.theme?.length>0||n?.custom?.length>0}function Zee(e,t){if(!t||!e)return e;const n={};return t.forEach(o=>{o==="vertical"&&(n.top=e.top,n.bottom=e.bottom),o==="horizontal"&&(n.left=e.left,n.right=e.right),n[o]=e?.[o]}),n}function Qee(e){return e&&typeof e=="string"?{top:e,right:e,bottom:e,left:e}:e}function VTt(e,t){return e&&(typeof e=="string"?t?{top:e,right:e,bottom:e,left:e}:{top:e}:{...e,right:e?.left,bottom:e?.top})}function HTt({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){const s=dp(),i=()=>{const c=e(n);t(c)};return a.jsx(En,{label:m("Dimensions"),resetAll:i,panelId:o,dropdownMenuProps:s,children:r})}const el={contentSize:!0,wideSize:!0,padding:!0,margin:!0,blockGap:!0,minHeight:!0,aspectRatio:!0,childLayout:!0};function HMe({as:e=HTt,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:s,defaultControls:i=el,onVisualize:c=()=>{},includeLayoutControls:l=!1}){var u,d,p,f,b,h,g,z;const{dimensions:A,spacing:_}=r,v=Ue=>Ue&&typeof Ue=="object"?Object.keys(Ue).reduce((yt,fn)=>(yt[fn]=ua({settings:{dimensions:A,spacing:_}},"",Ue[fn]),yt),{}):ua({settings:{dimensions:A,spacing:_}},"",Ue),M=$Tt(r),y=U1({availableUnits:r?.spacing?.units||["%","px","em","rem","vw"]}),k=-1/0,[S,C]=x.useState(k),R=LMe(r)&&l,T=v(o?.layout?.contentSize),E=Ue=>{n(gn(t,["layout","contentSize"],Ue||void 0))},B=()=>!!t?.layout?.contentSize,N=()=>E(void 0),j=PMe(r)&&l,I=v(o?.layout?.wideSize),P=Ue=>{n(gn(t,["layout","wideSize"],Ue||void 0))},$=()=>!!t?.layout?.wideSize,F=()=>P(void 0),X=jMe(r),Z=v(o?.spacing?.padding),V=Qee(Z),Q=Array.isArray(r?.spacing?.padding)?r?.spacing?.padding:r?.spacing?.padding?.sides,te=Q&&Q.some(Ue=>YR.includes(Ue)),ee=Ue=>{const yt=Zee(Ue,Q);n(gn(t,["spacing","padding"],yt))},ue=()=>!!t?.spacing?.padding&&Object.keys(t?.spacing?.padding).length,ce=()=>ee(void 0),me=()=>c("padding"),de=IMe(r),Ae=v(o?.spacing?.margin),ye=Qee(Ae),Ne=Array.isArray(r?.spacing?.margin)?r?.spacing?.margin:r?.spacing?.margin?.sides,je=Ne&&Ne.some(Ue=>YR.includes(Ue)),ie=Ue=>{const yt=Zee(Ue,Ne);n(gn(t,["spacing","margin"],yt))},we=()=>!!t?.spacing?.margin&&Object.keys(t?.spacing?.margin).length,re=()=>ie(void 0),pe=()=>c("margin"),ke=DMe(r),Se=Array.isArray(r?.spacing?.blockGap)?r?.spacing?.blockGap:r?.spacing?.blockGap?.sides,se=Se&&Se.some(Ue=>YR.includes(Ue)),L=v(o?.spacing?.blockGap),U=VTt(L,se),ne=Ue=>{n(gn(t,["spacing","blockGap"],Ue))},ve=Ue=>{Ue||ne(null),!se&&Ue?.hasOwnProperty("top")?ne(Ue.top):ne({top:Ue?.top,left:Ue?.left})},qe=()=>ne(void 0),Pe=()=>!!t?.spacing?.blockGap,rt=FMe(r),qt=v(o?.dimensions?.minHeight),wt=Ue=>{const yt=gn(t,["dimensions","minHeight"],Ue);n(gn(yt,["dimensions","aspectRatio"],void 0))},Bt=()=>{wt(void 0)},ae=()=>!!t?.dimensions?.minHeight,H=$Me(r),Y=v(o?.dimensions?.aspectRatio),fe=Ue=>{const yt=gn(t,["dimensions","aspectRatio"],Ue);n(gn(yt,["dimensions","minHeight"],void 0))},Re=()=>!!t?.dimensions?.aspectRatio,be=VMe(r),ze=o?.layout,nt=Ue=>{n({...t,layout:{...Ue}})},Mt=x.useCallback(Ue=>({...Ue,layout:Ii({...Ue?.layout,contentSize:void 0,wideSize:void 0,selfStretch:void 0,flexSize:void 0,columnStart:void 0,rowStart:void 0,columnSpan:void 0,rowSpan:void 0}),spacing:{...Ue?.spacing,padding:void 0,margin:void 0,blockGap:void 0},dimensions:{...Ue?.dimensions,minHeight:void 0,aspectRatio:void 0}}),[]),ot=()=>c(!1);return a.jsxs(e,{resetAllFilter:Mt,value:t,onChange:n,panelId:s,children:[(R||j)&&a.jsx("span",{className:"span-columns",children:m("Set the width of the main content area.")}),R&&a.jsx(tt,{label:m("Content width"),hasValue:B,onDeselect:N,isShownByDefault:(u=i.contentSize)!==null&&u!==void 0?u:el.contentSize,panelId:s,children:a.jsx(Ro,{__next40pxDefaultSize:!0,label:m("Content width"),labelPosition:"top",value:T||"",onChange:Ue=>{E(Ue)},units:y,prefix:a.jsx(Ld,{variant:"icon",children:a.jsx(wn,{icon:Sw})})})}),j&&a.jsx(tt,{label:m("Wide width"),hasValue:$,onDeselect:F,isShownByDefault:(d=i.wideSize)!==null&&d!==void 0?d:el.wideSize,panelId:s,children:a.jsx(Ro,{__next40pxDefaultSize:!0,label:m("Wide width"),labelPosition:"top",value:I||"",onChange:Ue=>{P(Ue)},units:y,prefix:a.jsx(Ld,{variant:"icon",children:a.jsx(wn,{icon:VP})})})}),X&&a.jsxs(tt,{hasValue:ue,label:m("Padding"),onDeselect:ce,isShownByDefault:(p=i.padding)!==null&&p!==void 0?p:el.padding,className:oe({"tools-panel-item-spacing":M}),panelId:s,children:[!M&&a.jsx(o4,{__next40pxDefaultSize:!0,values:V,onChange:ee,label:m("Padding"),sides:Q,units:y,allowReset:!1,splitOnAxis:te,inputProps:{onMouseOver:me,onMouseOut:ot}}),M&&a.jsx(g4,{values:V,onChange:ee,label:m("Padding"),sides:Q,units:y,allowReset:!1,onMouseOver:me,onMouseOut:ot})]}),de&&a.jsxs(tt,{hasValue:we,label:m("Margin"),onDeselect:re,isShownByDefault:(f=i.margin)!==null&&f!==void 0?f:el.margin,className:oe({"tools-panel-item-spacing":M}),panelId:s,children:[!M&&a.jsx(o4,{__next40pxDefaultSize:!0,values:ye,onChange:ie,inputProps:{min:S,onDragStart:()=>{C(0)},onDragEnd:()=>{C(k)},onMouseOver:pe,onMouseOut:ot},label:m("Margin"),sides:Ne,units:y,allowReset:!1,splitOnAxis:je}),M&&a.jsx(g4,{values:ye,onChange:ie,minimumCustomValue:-1/0,label:m("Margin"),sides:Ne,units:y,allowReset:!1,onMouseOver:pe,onMouseOut:ot})]}),ke&&a.jsxs(tt,{hasValue:Pe,label:m("Block spacing"),onDeselect:qe,isShownByDefault:(b=i.blockGap)!==null&&b!==void 0?b:el.blockGap,className:oe({"tools-panel-item-spacing":M,"single-column":!M&&!se}),panelId:s,children:[!M&&(se?a.jsx(o4,{__next40pxDefaultSize:!0,label:m("Block spacing"),min:0,onChange:ve,units:y,sides:Se,values:U,allowReset:!1,splitOnAxis:se}):a.jsx(Ro,{__next40pxDefaultSize:!0,label:m("Block spacing"),min:0,onChange:ne,units:y,value:L})),M&&a.jsx(g4,{label:m("Block spacing"),min:0,onChange:ve,showSideInLabel:!1,sides:se?Se:["top"],values:U,allowReset:!1})]}),be&&a.jsx(jTt,{value:ze,onChange:nt,parentLayout:r?.parentLayout,panelId:s,isShownByDefault:(h=i.childLayout)!==null&&h!==void 0?h:el.childLayout}),rt&&a.jsx(tt,{hasValue:ae,label:m("Minimum height"),onDeselect:Bt,isShownByDefault:(g=i.minHeight)!==null&&g!==void 0?g:el.minHeight,panelId:s,children:a.jsx(LTt,{label:m("Minimum height"),value:qt,onChange:wt})}),H&&a.jsx(NMe,{hasValue:Re,value:Y,onChange:fe,panelId:s,isShownByDefault:(z=i.aspectRatio)!==null&&z!==void 0?z:el.aspectRatio})]})}function UMe(e){return[...e].sort((n,o)=>e.filter(r=>r===o).length-e.filter(r=>r===n).length).shift()}function XMe(e={}){const{flat:t,...n}=e;return t||UMe(Object.values(n).filter(Boolean))||"px"}function aI(e={}){if(typeof e=="string")return e;const t=Object.values(e).map(c=>yo(c)),n=t.map(c=>{var l;return(l=c[0])!==null&&l!==void 0?l:""}),o=t.map(c=>c[1]),r=n.every(c=>c===n[0])?n[0]:"",s=UMe(o);return r===0||r?`${r}${s}`:void 0}function GMe(e={}){const t=aI(e);return typeof e=="string"?!1:isNaN(parseFloat(t))}function KMe(e){return e?typeof e=="string"?!0:!!Object.values(e).filter(n=>!!n||n===0).length:!1}function UTt({onChange:e,selectedUnits:t,setSelectedUnits:n,values:o,...r}){let s=aI(o);s===void 0&&(s=XMe(t));const c=KMe(o)&&GMe(o),l=c?m("Mixed"):null,u=p=>{const b=!isNaN(parseFloat(p))?p:void 0;e(b)},d=p=>{n({topLeft:p,topRight:p,bottomLeft:p,bottomRight:p})};return a.jsx(Ro,{...r,"aria-label":m("Border radius"),disableUnits:c,isOnly:!0,value:s,onChange:u,onUnitChange:d,placeholder:l,size:"__unstable-large"})}const XTt={topLeft:m("Top left"),topRight:m("Top right"),bottomLeft:m("Bottom left"),bottomRight:m("Bottom right")};function GTt({onChange:e,selectedUnits:t,setSelectedUnits:n,values:o,...r}){const s=l=>u=>{if(!e)return;const p=!isNaN(parseFloat(u))?u:void 0;e({...c,[l]:p})},i=l=>u=>{const d={...t};d[l]=u,n(d)},c=typeof o!="string"?o:{topLeft:o,topRight:o,bottomLeft:o,bottomRight:o};return a.jsx("div",{className:"components-border-radius-control__input-controls-wrapper",children:Object.entries(XTt).map(([l,u])=>{const[d,p]=yo(c[l]),f=c[l]?p:t[l]||t.flat;return a.jsx(B0,{text:u,placement:"top",children:a.jsx("div",{className:"components-border-radius-control__tooltip-wrapper",children:a.jsx(Ro,{...r,"aria-label":u,value:[d,f].join(""),onChange:s(l),onUnitChange:i(l),size:"__unstable-large"})})},l)})})}function KTt({isLinked:e,...t}){const n=m(e?"Unlink radii":"Link radii");return a.jsx(Ce,{...t,className:"component-border-radius-control__linked-button",size:"small",icon:e?xa:Pl,iconSize:24,label:n})}const YTt={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},ZR=0,ZTt={px:100,em:20,rem:20};function QTt({onChange:e,values:t}){const[n,o]=x.useState(!KMe(t)||!GMe(t)),[r,s]=x.useState({flat:typeof t=="string"?yo(t)[1]:void 0,topLeft:yo(t?.topLeft)[1],topRight:yo(t?.topRight)[1],bottomLeft:yo(t?.bottomLeft)[1],bottomRight:yo(t?.bottomRight)[1]}),[i]=Un("spacing.units"),c=U1({availableUnits:i||["px","em","rem"]}),l=XMe(r),d=(c&&c.find(h=>h.value===l))?.step||1,[p]=yo(aI(t)),f=()=>o(!n),b=h=>{e(h!==void 0?`${h}${l}`:void 0)};return a.jsxs("fieldset",{className:"components-border-radius-control",children:[a.jsx(no.VisualLabel,{as:"legend",children:m("Radius")}),a.jsxs("div",{className:"components-border-radius-control__wrapper",children:[n?a.jsxs(a.Fragment,{children:[a.jsx(UTt,{className:"components-border-radius-control__unit-control",values:t,min:ZR,onChange:e,selectedUnits:r,setSelectedUnits:s,units:c}),a.jsx(bo,{__next40pxDefaultSize:!0,label:m("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:p??"",min:ZR,max:ZTt[l],initialPosition:0,withInputField:!1,onChange:b,step:d,__nextHasNoMarginBottom:!0})]}):a.jsx(GTt,{min:ZR,onChange:e,selectedUnits:r,setSelectedUnits:s,values:t||YTt,units:c}),a.jsx(KTt,{onClick:f,isLinked:n})]})]})}function ub(){const[e,t,n,o,r,s,i,c,l,u]=Un("color.custom","color.palette.custom","color.palette.theme","color.palette.default","color.defaultPalette","color.customGradient","color.gradients.custom","color.gradients.theme","color.gradients.default","color.defaultGradients"),d={disableCustomColors:!e,disableCustomGradients:!s};return d.colors=x.useMemo(()=>{const p=[];return n&&n.length&&p.push({name:We("Theme","Indicates this palette comes from the theme."),slug:"theme",colors:n}),r&&o&&o.length&&p.push({name:We("Default","Indicates this palette comes from WordPress."),slug:"default",colors:o}),t&&t.length&&p.push({name:We("Custom","Indicates this palette is created by the user."),slug:"custom",colors:t}),p},[t,n,o,r]),d.gradients=x.useMemo(()=>{const p=[];return c&&c.length&&p.push({name:We("Theme","Indicates this palette comes from the theme."),slug:"theme",gradients:c}),u&&l&&l.length&&p.push({name:We("Default","Indicates this palette comes from WordPress."),slug:"default",gradients:l}),i&&i.length&&p.push({name:We("Custom","Indicates this palette is created by the user."),slug:"custom",gradients:i}),p},[i,c,l,u]),d.hasColorsOrGradients=!!d.colors.length||!!d.gradients.length,d}const Sm="__experimentalBorder",Kx="shadow",Jee=(e,t,n)=>{let o;return e.some(r=>r.colors.some(s=>s[t]===n?(o=s,!0):!1)),o},a2=({colors:e,namedColor:t,customColor:n})=>{if(t){const r=Jee(e,"slug",t);if(r)return r}if(!n)return{color:void 0};const o=Jee(e,"color",n);return o||{color:n}};function pv(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function YMe(e){if(Pd(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:Ii(o),borderColor:n}}function ZMe(e){return Pd(e.style?.border)?e.style:{...e.style,border:{...e.style?.border,color:e.borderColor?"var:preset|color|"+e.borderColor:e.style?.border?.color}}}function JTt({label:e,children:t,resetAllFilter:n}){const o=x.useCallback(r=>{const s=ZMe(r),i=n(s);return{...r,...YMe(i)}},[n]);return a.jsx(et,{group:"border",resetAllFilter:o,label:e,children:t})}function eEt({clientId:e,name:t,setAttributes:n,settings:o}){const r=nze(o);function s(p){const{style:f,borderColor:b}=p(J).getBlockAttributes(e)||{};return{style:f,borderColor:b}}const{style:i,borderColor:c}=G(s,[e]),l=x.useMemo(()=>ZMe({style:i,borderColor:c}),[i,c]),u=p=>{n(YMe(p))};if(!r)return null;const d={...An(t,[Sm,"__experimentalDefaultControls"]),...An(t,[Kx,"__experimentalDefaultControls"])};return a.jsx(cze,{as:JTt,panelId:e,settings:o,value:l,onChange:u,defaultControls:d})}function X_(e,t="any"){const n=An(e,Sm);return n===!0?!0:t==="any"?!!(n?.color||n?.radius||n?.width||n?.style):!!n?.[t]}function G_({blockName:e,hasBorderControl:t,hasShadowControl:n}={}){const o=WO(e),r=cI(o);return!t&&!n&&e&&(t=r?.hasBorderColor||r?.hasBorderStyle||r?.hasBorderWidth||r?.hasBorderRadius,n=r?.hasShadow),m(t&&n?"Border & Shadow":n?"Shadow":"Border")}function tEt(e){return!X_(e,"color")||e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}}function QMe(e,t,n){if(!X_(t,"color")||W0(t,Sm,"color"))return e;const o=JMe(n),r=oe(e.className,o);return e.className=r||void 0,e}function JMe(e){const{borderColor:t,style:n}=e,o=Pt("border-color",t);return oe({"has-border-color":t||n?.border?.color,[o]:!!o})}function nEt({name:e,borderColor:t,style:n}){const{colors:o}=ub();if(!X_(e,"color")||W0(e,Sm,"color"))return{};const{color:r}=a2({colors:o,namedColor:t}),{color:s}=a2({colors:o,namedColor:pv(n?.border?.top?.color)}),{color:i}=a2({colors:o,namedColor:pv(n?.border?.right?.color)}),{color:c}=a2({colors:o,namedColor:pv(n?.border?.bottom?.color)}),{color:l}=a2({colors:o,namedColor:pv(n?.border?.left?.color)});return QMe({style:Ii({borderTopColor:s||r,borderRightColor:i||r,borderBottomColor:c||r,borderLeftColor:l||r})||{}},e,{borderColor:t,style:n})}const eze={useBlockProps:nEt,addSaveProps:QMe,attributeKeys:["borderColor","style"],hasSupport(e){return X_(e,"color")}};Bn("blocks.registerBlockType","core/border/addAttributes",tEt);const fv=[];function oEt({shadow:e,onShadowChange:t,settings:n}){const o=tze(n);return a.jsx("div",{className:"block-editor-global-styles__shadow-popover-container",children:a.jsxs(dt,{spacing:4,children:[a.jsx(_a,{level:5,children:m("Drop shadow")}),a.jsx(rEt,{presets:o,activeShadow:e,onSelect:t}),a.jsx("div",{className:"block-editor-global-styles__clear-shadow",children:a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>t(void 0),children:m("Clear")})})]})})}function rEt({presets:e,activeShadow:t,onSelect:n}){return e?a.jsx(C1,{role:"listbox",className:"block-editor-global-styles__shadow__list","aria-label":m("Drop shadows"),children:e.map(({name:o,slug:r,shadow:s})=>a.jsx(sEt,{label:o,isActive:s===t,type:r==="unset"?"unset":"preset",onSelect:()=>n(s===t?void 0:s),shadow:s},r))}):null}function sEt({type:e,label:t,isActive:n,onSelect:o,shadow:r}){return a.jsx(B0,{text:t,children:a.jsx(C1.Item,{role:"option","aria-label":t,"aria-selected":n,className:oe("block-editor-global-styles__shadow__item",{"is-active":n}),render:a.jsx("button",{className:oe("block-editor-global-styles__shadow-indicator",{unset:e==="unset"}),onClick:o,style:{boxShadow:r},"aria-label":t,children:n&&a.jsx(wn,{icon:M0})})})})}function iEt({shadow:e,onShadowChange:t,settings:n}){const o={placement:"left-start",offset:36,shift:!0};return a.jsx(so,{popoverProps:o,className:"block-editor-global-styles__shadow-dropdown",renderToggle:aEt(),renderContent:()=>a.jsx($s,{paddingSize:"medium",children:a.jsx(oEt,{shadow:e,onShadowChange:t,settings:n})})})}function aEt(){return({onToggle:e,isOpen:t})=>{const n={onClick:e,className:oe({"is-open":t}),"aria-expanded":t};return a.jsx(Ce,{__next40pxDefaultSize:!0,...n,children:a.jsxs(Ot,{justify:"flex-start",children:[a.jsx(wn,{className:"block-editor-global-styles__toggle-icon",icon:PQe,size:24}),a.jsx(Tn,{children:m("Drop shadow")})]})})}}function tze(e){return x.useMemo(()=>{var t;if(!e?.shadow)return fv;const n=e?.shadow?.defaultPresets,{default:o,theme:r,custom:s}=(t=e?.shadow?.presets)!==null&&t!==void 0?t:{},i={name:m("Unset"),slug:"unset",shadow:"none"},c=[...n&&o||fv,...r||fv,...s||fv];return c.length&&c.unshift(i),c},[e])}function nze(e){return Object.values(cI(e)).some(Boolean)}function cI(e){return{hasBorderColor:oze(e),hasBorderRadius:rze(e),hasBorderStyle:sze(e),hasBorderWidth:ize(e),hasShadow:aze(e)}}function oze(e){return e?.border?.color}function rze(e){return e?.border?.radius}function sze(e){return e?.border?.style}function ize(e){return e?.border?.width}function aze(e){const t=tze(e);return!!e?.shadow&&t.length>0}function cEt({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r,label:s}){const i=dp(),c=()=>{const l=e(n);t(l)};return a.jsx(En,{label:s,resetAll:c,panelId:o,dropdownMenuProps:i,children:r})}const lEt={radius:!0,color:!0,width:!0,shadow:!0};function cze({as:e=cEt,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:s,name:i,defaultControls:c=lEt}){var l,u,d,p;const f=pp(r),b=x.useCallback(V=>ua({settings:r},"",V),[r]),h=V=>{const te=f.flatMap(({colors:ee})=>ee).find(({color:ee})=>ee===V);return te?"var:preset|color|"+te.slug:V},g=x.useMemo(()=>{if(Pd(o?.border)){const V={...o?.border};return["top","right","bottom","left"].forEach(Q=>{V[Q]={...V[Q],color:b(V[Q]?.color)}}),V}return{...o?.border,color:o?.border?.color?b(o?.border?.color):void 0}},[o?.border,b]),z=V=>n({...t,border:V}),A=oze(r),_=sze(r),v=ize(r),M=rze(r),y=b(g?.radius),k=V=>z({...g,radius:V}),S=()=>{const V=t?.border?.radius;return typeof V=="object"?Object.entries(V).some(Boolean):!!V},C=aze(r),R=b(o?.shadow),T=(l=r?.shadow?.presets)!==null&&l!==void 0?l:{},E=(u=(d=(p=T.custom)!==null&&p!==void 0?p:T.theme)!==null&&d!==void 0?d:T.default)!==null&&u!==void 0?u:[],B=V=>{const Q=E?.find(({shadow:te})=>te===V)?.slug;n(gn(t,["shadow"],Q?`var:preset|shadow|${Q}`:V||void 0))},N=()=>!!t?.shadow,j=()=>B(void 0),I=()=>{if(S())return z({radius:t?.border?.radius});z(void 0)},P=V=>{const Q={...V};Pd(Q)?["top","right","bottom","left"].forEach(te=>{Q[te]&&(Q[te]={...Q[te],color:h(Q[te]?.color)})}):Q&&(Q.color=h(Q.color)),z({radius:g?.radius,...Q})},$=x.useCallback(V=>({...V,border:void 0,shadow:void 0}),[]),F=c?.color||c?.width,X=A||_||v||M,Z=G_({blockName:i,hasShadowControl:C,hasBorderControl:X});return a.jsxs(e,{resetAllFilter:$,value:t,onChange:n,panelId:s,label:Z,children:[(v||A)&&a.jsx(tt,{hasValue:()=>F0t(t?.border),label:m("Border"),onDeselect:()=>I(),isShownByDefault:F,panelId:s,children:a.jsx(J0t,{colors:f,enableAlpha:!0,enableStyle:_,onChange:P,popoverOffset:40,popoverPlacement:"left-start",value:g,__experimentalIsRenderedInSidebar:!0,size:"__unstable-large",hideLabelFromVision:!C,label:m("Border")})}),M&&a.jsx(tt,{hasValue:S,label:m("Radius"),onDeselect:()=>k(void 0),isShownByDefault:c.radius,panelId:s,children:a.jsx(QTt,{values:y,onChange:V=>{k(V||void 0)}})}),C&&a.jsxs(tt,{label:m("Shadow"),hasValue:N,onDeselect:j,isShownByDefault:c.shadow,panelId:s,children:[X?a.jsx(no.VisualLabel,{as:"legend",children:m("Shadow")}):null,a.jsx(tb,{isBordered:!0,isSeparated:!0,children:a.jsx(iEt,{shadow:R,onShadowChange:B,settings:r})})]})]})}const{Tabs:Zb}=ct(tr),uEt=["colors","disableCustomColors","gradients","disableCustomGradients"],Ia={color:"color",gradient:"gradient"};function lze({colors:e,gradients:t,disableCustomColors:n,disableCustomGradients:o,__experimentalIsRenderedInSidebar:r,className:s,label:i,onColorChange:c,onGradientChange:l,colorValue:u,gradientValue:d,clearable:p,showTitle:f=!0,enableAlpha:b,headingLevel:h}){const g=c&&(e&&e.length>0||!n),z=l&&(t&&t.length>0||!o);if(!g&&!z)return null;const A={[Ia.color]:a.jsx(Hw,{value:u,onChange:z?v=>{c(v),l()}:c,colors:e,disableCustomColors:n,__experimentalIsRenderedInSidebar:r,clearable:p,enableAlpha:b,headingLevel:h}),[Ia.gradient]:a.jsx(eit,{value:d,onChange:g?v=>{l(v),c()}:l,gradients:t,disableCustomGradients:o,__experimentalIsRenderedInSidebar:r,clearable:p,headingLevel:h})},_=v=>a.jsx("div",{className:"block-editor-color-gradient-control__panel",children:A[v]});return a.jsx(no,{__nextHasNoMarginBottom:!0,className:oe("block-editor-color-gradient-control",s),children:a.jsx("fieldset",{className:"block-editor-color-gradient-control__fieldset",children:a.jsxs(dt,{spacing:1,children:[f&&a.jsx("legend",{children:a.jsx("div",{className:"block-editor-color-gradient-control__color-indicator",children:a.jsx(no.VisualLabel,{children:i})})}),g&&z&&a.jsx("div",{children:a.jsxs(Zb,{defaultTabId:d?Ia.gradient:!!g&&Ia.color,children:[a.jsxs(Zb.TabList,{children:[a.jsx(Zb.Tab,{tabId:Ia.color,children:m("Color")}),a.jsx(Zb.Tab,{tabId:Ia.gradient,children:m("Gradient")})]}),a.jsx(Zb.TabPanel,{tabId:Ia.color,className:"block-editor-color-gradient-control__panel",focusable:!1,children:A.color}),a.jsx(Zb.TabPanel,{tabId:Ia.gradient,className:"block-editor-color-gradient-control__panel",focusable:!1,children:A.gradient})]})}),!z&&_(Ia.color),!g&&_(Ia.gradient)]})})})}function dEt(e){const[t,n,o,r]=Un("color.palette","color.gradients","color.custom","color.customGradient");return a.jsx(lze,{colors:t,gradients:n,disableCustomColors:!o,disableCustomGradients:!r,...e})}function uze(e){return uEt.every(t=>e.hasOwnProperty(t))?a.jsx(lze,{...e}):a.jsx(dEt,{...e})}function dze(e){const t=pze(e),n=mze(e),o=fze(e),r=Iu(e),s=hze(e),i=bze(e);return t||n||o||r||s||i}function pze(e){const t=pp(e);return e?.color?.text&&(t?.length>0||e?.color?.custom)}function fze(e){const t=pp(e);return e?.color?.link&&(t?.length>0||e?.color?.custom)}function bze(e){const t=pp(e);return e?.color?.caption&&(t?.length>0||e?.color?.custom)}function Iu(e){const t=pp(e),n=$_(e);return e?.color?.heading&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function hze(e){const t=pp(e),n=$_(e);return e?.color?.button&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function mze(e){const t=pp(e),n=$_(e);return e?.color?.background&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function pEt({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){const s=dp(),i=()=>{const c=e(n);t(c)};return a.jsx(En,{label:m("Elements"),resetAll:i,panelId:o,hasInnerWrapper:!0,headingLevel:3,className:"color-block-support-panel",__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:s,children:a.jsx("div",{className:"color-block-support-panel__inner-wrapper",children:r})})}const fEt={text:!0,background:!0,link:!0,heading:!0,button:!0,caption:!0},bEt={placement:"left-start",offset:36,shift:!0},{Tabs:bv}=ct(tr),hEt=({indicators:e,label:t})=>a.jsxs(Ot,{justify:"flex-start",children:[a.jsx(M2e,{isLayered:!1,offset:-8,children:e.map((n,o)=>a.jsx(Yo,{expanded:!1,children:a.jsx(eb,{colorValue:n})},o))}),a.jsx(Tn,{className:"block-editor-panel-color-gradient-settings__color-name",children:t})]});function ete({isGradient:e,inheritedValue:t,userValue:n,setValue:o,colorGradientControlSettings:r}){return a.jsx(uze,{...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 mEt({label:e,hasValue:t,resetValue:n,isShownByDefault:o,indicators:r,tabs:s,colorGradientControlSettings:i,panelId:c}){var l;const u=s.find(b=>b.userValue!==void 0),{key:d,...p}=(l=s[0])!==null&&l!==void 0?l:{},f=x.useRef(void 0);return a.jsx(tt,{className:"block-editor-tools-panel-color-gradient-settings__item",hasValue:t,label:e,onDeselect:n,isShownByDefault:o,panelId:c,children:a.jsx(so,{popoverProps:bEt,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:({onToggle:b,isOpen:h})=>{const g={onClick:b,className:oe("block-editor-panel-color-gradient-settings__dropdown",{"is-open":h}),"aria-expanded":h,ref:f};return a.jsxs(a.Fragment,{children:[a.jsx(Ce,{...g,__next40pxDefaultSize:!0,children:a.jsx(hEt,{indicators:r,label:e})}),t()&&a.jsx(Ce,{__next40pxDefaultSize:!0,label:m("Reset"),className:"block-editor-panel-color-gradient-settings__reset",size:"small",icon:am,onClick:()=>{n(),h&&b(),f.current?.focus()}})]})},renderContent:()=>a.jsx($s,{paddingSize:"none",children:a.jsxs("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:[s.length===1&&a.jsx(ete,{...p,colorGradientControlSettings:i},d),s.length>1&&a.jsxs(bv,{defaultTabId:u?.key,children:[a.jsx(bv.TabList,{children:s.map(b=>a.jsx(bv.Tab,{tabId:b.key,children:b.label},b.key))}),s.map(b=>{const{key:h,...g}=b;return a.jsx(bv.TabPanel,{tabId:h,focusable:!1,children:a.jsx(ete,{...g,colorGradientControlSettings:i},h)},h)})]})]})})})})}function gze({as:e=pEt,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:s,defaultControls:i=fEt,children:c}){const l=pp(r),u=$_(r),d=r?.color?.custom,p=r?.color?.customGradient,f=l.length>0||d,b=u.length>0||p,h=de=>ua({settings:r},"",de),g=de=>{const ye=l.flatMap(({colors:Ne})=>Ne).find(({color:Ne})=>Ne===de);return ye?"var:preset|color|"+ye.slug:de},z=de=>{const ye=u.flatMap(({gradients:Ne})=>Ne).find(({gradient:Ne})=>Ne===de);return ye?"var:preset|gradient|"+ye.slug:de},A=mze(r),_=h(o?.color?.background),v=h(t?.color?.background),M=h(o?.color?.gradient),y=h(t?.color?.gradient),k=()=>!!v||!!y,S=de=>{const Ae=gn(t,["color","background"],g(de));Ae.color.gradient=void 0,n(Ae)},C=de=>{const Ae=gn(t,["color","gradient"],z(de));Ae.color.background=void 0,n(Ae)},R=()=>{const de=gn(t,["color","background"],void 0);de.color.gradient=void 0,n(de)},T=fze(r),E=h(o?.elements?.link?.color?.text),B=h(t?.elements?.link?.color?.text),N=de=>{n(gn(t,["elements","link","color","text"],g(de)))},j=h(o?.elements?.link?.[":hover"]?.color?.text),I=h(t?.elements?.link?.[":hover"]?.color?.text),P=de=>{n(gn(t,["elements","link",":hover","color","text"],g(de)))},$=()=>!!B||!!I,F=()=>{let de=gn(t,["elements","link",":hover","color","text"],void 0);de=gn(de,["elements","link","color","text"],void 0),n(de)},X=pze(r),Z=h(o?.color?.text),V=h(t?.color?.text),Q=()=>!!V,te=de=>{let Ae=gn(t,["color","text"],g(de));Z===E&&(Ae=gn(Ae,["elements","link","color","text"],g(de))),n(Ae)},ee=()=>te(void 0),ue=[{name:"caption",label:m("Captions"),showPanel:bze(r)},{name:"button",label:m("Button"),showPanel:hze(r)},{name:"heading",label:m("Heading"),showPanel:Iu(r)},{name:"h1",label:m("H1"),showPanel:Iu(r)},{name:"h2",label:m("H2"),showPanel:Iu(r)},{name:"h3",label:m("H3"),showPanel:Iu(r)},{name:"h4",label:m("H4"),showPanel:Iu(r)},{name:"h5",label:m("H5"),showPanel:Iu(r)},{name:"h6",label:m("H6"),showPanel:Iu(r)}],ce=x.useCallback(de=>({...de,color:void 0,elements:{...de?.elements,link:{...de?.elements?.link,color:void 0,":hover":{color:void 0}},...ue.reduce((Ae,ye)=>({...Ae,[ye.name]:{...de?.elements?.[ye.name],color:void 0}}),{})}}),[]),me=[X&&{key:"text",label:m("Text"),hasValue:Q,resetValue:ee,isShownByDefault:i.text,indicators:[Z],tabs:[{key:"text",label:m("Text"),inheritedValue:Z,setValue:te,userValue:V}]},A&&{key:"background",label:m("Background"),hasValue:k,resetValue:R,isShownByDefault:i.background,indicators:[M??_],tabs:[f&&{key:"background",label:m("Color"),inheritedValue:_,setValue:S,userValue:v},b&&{key:"gradient",label:m("Gradient"),inheritedValue:M,setValue:C,userValue:y,isGradient:!0}].filter(Boolean)},T&&{key:"link",label:m("Link"),hasValue:$,resetValue:F,isShownByDefault:i.link,indicators:[E,j],tabs:[{key:"link",label:m("Default"),inheritedValue:E,setValue:N,userValue:B},{key:"hover",label:m("Hover"),inheritedValue:j,setValue:P,userValue:I}]}].filter(Boolean);return ue.forEach(({name:de,label:Ae,showPanel:ye})=>{if(!ye)return;const Ne=h(o?.elements?.[de]?.color?.background),je=h(o?.elements?.[de]?.color?.gradient),ie=h(o?.elements?.[de]?.color?.text),we=h(t?.elements?.[de]?.color?.background),re=h(t?.elements?.[de]?.color?.gradient),pe=h(t?.elements?.[de]?.color?.text),ke=()=>!!(pe||we||re),Se=()=>{const qe=gn(t,["elements",de,"color","background"],void 0);qe.elements[de].color.gradient=void 0,qe.elements[de].color.text=void 0,n(qe)},se=qe=>{n(gn(t,["elements",de,"color","text"],g(qe)))},L=qe=>{const Pe=gn(t,["elements",de,"color","background"],g(qe));Pe.elements[de].color.gradient=void 0,n(Pe)},U=qe=>{const Pe=gn(t,["elements",de,"color","gradient"],z(qe));Pe.elements[de].color.background=void 0,n(Pe)},ne=!0,ve=de!=="caption";me.push({key:de,label:Ae,hasValue:ke,resetValue:Se,isShownByDefault:i[de],indicators:ve?[ie,je??Ne]:[ie],tabs:[f&&ne&&{key:"text",label:m("Text"),inheritedValue:ie,setValue:se,userValue:pe},f&&ve&&{key:"background",label:m("Background"),inheritedValue:Ne,setValue:L,userValue:we},b&&ve&&{key:"gradient",label:m("Gradient"),inheritedValue:je,setValue:U,userValue:re,isGradient:!0}].filter(Boolean)})}),a.jsxs(e,{resetAllFilter:ce,value:t,onChange:n,panelId:s,children:[me.map(de=>{const{key:Ae,...ye}=de;return a.jsx(mEt,{...ye,colorGradientControlSettings:{colors:l,disableCustomColors:!d,gradients:u,disableCustomGradients:!p},panelId:s},Ae)}),c]})}const hv=[];function tte(e,{presetSetting:t,defaultSetting:n}){const o=!e?.color?.[n],r=e?.color?.[t]?.custom||hv,s=e?.color?.[t]?.theme||hv,i=e?.color?.[t]?.default||hv;return x.useMemo(()=>[...r,...s,...o?hv:i],[o,r,s,i])}function gEt(e){return Mze(e)}function Mze(e){return e.color.customDuotone||e.color.defaultDuotone||e.color.duotone.length>0}function MEt({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){const s=dp(),i=()=>{const c=e(n);t(c)};return a.jsx(En,{label:We("Filters","Name for applying graphical effects"),resetAll:i,panelId:o,dropdownMenuProps:s,children:r})}const zEt={duotone:!0},OEt={placement:"left-start",offset:36,shift:!0,className:"block-editor-duotone-control__popover",headerTitle:m("Duotone")},yEt=({indicator:e,label:t})=>a.jsxs(Ot,{justify:"flex-start",children:[a.jsx(M2e,{isLayered:!1,offset:-8,children:a.jsx(Yo,{expanded:!1,children:e==="unset"||!e?a.jsx(eb,{className:"block-editor-duotone-control__unset-indicator"}):a.jsx(Gbe,{values:e})})}),a.jsx(Tn,{title:t,children:t})]});function zze({as:e=MEt,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:s,defaultControls:i=zEt}){const c=z=>ua({settings:r},"",z),l=Mze(r),u=tte(r,{presetSetting:"duotone",defaultSetting:"defaultDuotone"}),d=tte(r,{presetSetting:"palette",defaultSetting:"defaultPalette"}),p=c(o?.filter?.duotone),f=z=>{const A=u.find(({colors:v})=>v===z),_=A?`var:preset|duotone|${A.slug}`:z;n(gn(t,["filter","duotone"],_))},b=()=>!!t?.filter?.duotone,h=()=>f(void 0),g=x.useCallback(z=>({...z,filter:{...z.filter,duotone:void 0}}),[]);return a.jsx(e,{resetAllFilter:g,value:t,onChange:n,panelId:s,children:l&&a.jsx(tt,{label:m("Duotone"),hasValue:b,onDeselect:h,isShownByDefault:i.duotone,panelId:s,children:a.jsx(so,{popoverProps:OEt,className:"block-editor-global-styles-filters-panel__dropdown",renderToggle:({onToggle:z,isOpen:A})=>{const _={onClick:z,className:oe({"is-open":A}),"aria-expanded":A};return a.jsx(tb,{isBordered:!0,isSeparated:!0,children:a.jsx(oO,{as:"button",..._,children:a.jsx(yEt,{indicator:p,label:m("Duotone")})})})},renderContent:()=>a.jsx($s,{paddingSize:"small",children:a.jsxs(Cn,{label:m("Duotone"),children:[a.jsx("p",{children:m("Create a two-tone color effect without losing your original image.")}),a.jsx(Xbe,{colorPalette:d,duotonePalette:u,disableCustomColors:!0,disableCustomDuotone:!0,value:p,onChange:f})]})})})})})}function AEt(e,t,n){return e==="core/image"&&n?.lightbox?.allowEditing||!!t?.lightbox}function vEt({onChange:e,value:t,inheritedValue:n,panelId:o}){const r=dp(),s=()=>{e(void 0)},i=l=>{e({enabled:l})};let c=!1;return n?.lightbox?.enabled&&(c=n.lightbox.enabled),a.jsx(a.Fragment,{children:a.jsx(En,{label:We("Settings","Image settings"),resetAll:s,panelId:o,dropdownMenuProps:r,children:a.jsx(tt,{hasValue:()=>!!t?.lightbox,label:m("Enlarge on click"),onDeselect:s,isShownByDefault:!0,panelId:o,children:a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Enlarge on click"),checked:c,onChange:i})})})})}function xEt({value:e,onChange:t,inheritedValue:n=e}){const[o,r]=x.useState(null),s=n?.css;function i(l){if(t({...e,css:l}),o){const[u]=Fx([{css:l}],".for-validation-only");u&&r(null)}}function c(l){if(!l?.target?.value){r(null);return}const[u]=Fx([{css:l.target.value}],".for-validation-only");r(u===null?m("There is an error with your CSS structure."):null)}return a.jsxs(dt,{spacing:3,children:[o&&a.jsx(A1,{status:"error",onRemove:()=>r(null),children:o}),a.jsx(Li,{label:m("Additional CSS"),__nextHasNoMarginBottom:!0,value:s,onChange:l=>i(l),onBlur:c,className:"block-editor-global-styles-advanced-panel__custom-css-input",spellCheck:!1})]})}const mv=new Map,VW=[],QR={caption:m("Caption"),link:m("Link"),button:m("Button"),heading:m("Heading"),h1:m("H1"),h2:m("H2"),h3:m("H3"),h4:m("H4"),h5:m("H5"),h6:m("H6"),"settings.color":m("Color"),"settings.typography":m("Typography"),"styles.color":m("Colors"),"styles.spacing":m("Spacing"),"styles.background":m("Background"),"styles.typography":m("Typography")},wEt=Hs(()=>gs().reduce((e,{name:t,title:n})=>(e[t]=n,e),{})),gv=e=>e!==null&&typeof e=="object";function _Et(e){if(QR[e])return QR[e];const t=e.split(".");if(t?.[0]==="blocks")return wEt()?.[t[1]]||t[1];if(t?.[0]==="elements")return QR[t[1]]||t[1]}function Oze(e,t,n=""){if(!gv(e)&&!gv(t))return e!==t?n.split(".").slice(0,2).join("."):void 0;e=gv(e)?e:{},t=gv(t)?t:{};const o=new Set([...Object.keys(e),...Object.keys(t)]);let r=[];for(const s of o){const i=n?n+"."+s:s,c=Oze(e[s],t[s],i);c&&(r=r.concat(c))}return r}function kEt(e,t){const n=JSON.stringify({next:e,previous:t});if(mv.has(n))return mv.get(n);const o=Oze({styles:{background:e?.styles?.background,color:e?.styles?.color,typography:e?.styles?.typography,spacing:e?.styles?.spacing},blocks:e?.styles?.blocks,elements:e?.styles?.elements,settings:e?.settings},{styles:{background:t?.styles?.background,color:t?.styles?.color,typography:t?.styles?.typography,spacing:t?.styles?.spacing},blocks:t?.styles?.blocks,elements:t?.styles?.elements,settings:t?.settings});if(!o.length)return mv.set(n,VW),VW;const r=[...new Set(o)].reduce((s,i)=>{const c=_Et(i);return c&&s.push([i.split(".")[0],c]),s},[]);return mv.set(n,r),r}function SEt(e,t,n={}){let o=kEt(e,t);const r=o.length,{maxResults:s}=n;return r?(s&&r>s&&(o=o.slice(0,s)),Object.entries(o.reduce((i,c)=>{const l=i[c[0]]||[];return l.includes(c[1])||(i[c[0]]=[...l,c[1]]),i},{})).map(([i,c])=>{const l=c.length,u=c.join(m(", "));switch(i){case"blocks":return xe(Dn("%s block.","%s blocks.",l),u);case"elements":return xe(Dn("%s element.","%s elements.",l),u);case"settings":return xe(m("%s settings."),u);case"styles":return xe(m("%s styles."),u);default:return xe(m("%s."),u)}})):VW}const CEt=Object.freeze(Object.defineProperty({__proto__:null,AdvancedPanel:xEt,BackgroundPanel:mMe,BorderPanel:cze,ColorPanel:gze,DimensionsPanel:HMe,FiltersPanel:zze,GlobalStylesContext:lb,ImageSettingsPanel:vEt,TypographyPanel:EMe,areGlobalStyleConfigsEqual:jSt,getBlockCSSSelector:pd,getBlockSelectors:H_,getGlobalStylesChanges:SEt,getLayoutStyles:MMe,toStyles:V_,useGlobalSetting:iMe,useGlobalStyle:nRt,useGlobalStylesOutput:dTt,useGlobalStylesOutputWithConfig:zMe,useGlobalStylesReset:tRt,useHasBackgroundPanel:oI,useHasBorderPanel:nze,useHasBorderPanelControls:cI,useHasColorPanel:dze,useHasDimensionsPanel:BMe,useHasFiltersPanel:gEt,useHasImageSettingsPanel:AEt,useHasTypographyPanel:AMe,useSettingsForBlockElement:aMe},Symbol.toStringTag,{value:"Module"})),HW="is-style-";function yze(e){return e?e.split(/\s+/).reduce((t,n)=>{if(n.startsWith(HW)){const o=n.slice(HW.length);o!=="default"&&t.push(o)}return t},[]):[]}function qEt(e,t=[]){const n=yze(e);if(!n)return null;for(const o of n)if(t.some(r=>r.name===o))return o;return null}function REt({override:e}){Jz(e)}function TEt({config:e}){const{getBlockStyles:t,overrides:n}=G(s=>({getBlockStyles:s(kt).getBlockStyles,overrides:ct(s(J)).getStyleOverrides()}),[]),{getBlockName:o}=G(J),r=x.useMemo(()=>{if(!n?.length)return;const s=[],i=[];for(const[,c]of n)if(c?.variation&&c?.clientId&&!i.includes(c.clientId)){const l=o(c.clientId),u=e?.styles?.blocks?.[l]?.variations?.[c.variation];if(u){const d={settings:e?.settings,styles:{blocks:{[l]:{variations:{[`${c.variation}-${c.clientId}`]:u}}}}},p=H_(gs(),t,c.clientId),z=V_(d,p,!1,!0,!0,!0,{blockGap:!1,blockStyles:!0,layoutStyles:!1,marginReset:!1,presets:!1,rootPadding:!1,variationStyles:!0});s.push({id:`${c.variation}-${c.clientId}`,css:z,__unstableType:"variation",variation:c.variation,clientId:c.clientId}),i.push(c.clientId)}}return s},[e,n,t,o]);if(!(!r||!r.length))return a.jsx(a.Fragment,{children:r.map(s=>a.jsx(REt,{override:s},s.id))})}function Aze(e,t,n){if(!e?.styles?.blocks?.[t]?.variations?.[n])return;const o=s=>{Object.keys(s).forEach(i=>{const c=s[i];if(typeof c=="object"&&c!==null)if(c.ref!==void 0)if(typeof c.ref!="string"||c.ref.trim()==="")delete s[i];else{const l=fo(e,c.ref);l?s[i]=l:delete s[i]}else o(c),Object.keys(c).length===0&&delete s[i]})},r=JSON.parse(JSON.stringify(e.styles.blocks[t].variations[n]));return o(r),r}function EEt(e,t,n){const{merged:o}=x.useContext(lb),{globalSettings:r,globalStyles:s}=G(i=>{const c=i(J).getSettings();return{globalSettings:c.__experimentalFeatures,globalStyles:c[dO]}},[]);return x.useMemo(()=>{var i,c,l;const u=Aze({settings:(i=o?.settings)!==null&&i!==void 0?i:r,styles:(c=o?.styles)!==null&&c!==void 0?c:s},e,t);return{settings:(l=o?.settings)!==null&&l!==void 0?l:r,styles:{blocks:{[e]:{variations:{[`${t}-${n}`]:u}}}}}},[o,r,s,t,n,e])}function WEt({name:e,className:t,clientId:n}){const{getBlockStyles:o}=G(kt),r=o(e),s=qEt(t,r),i=`${HW}${s}-${n}`,{settings:c,styles:l}=EEt(e,s,n),u=x.useMemo(()=>{if(!s)return;const d={settings:c,styles:l},p=H_(gs(),o,n);return V_(d,p,!1,!0,!0,!0,{blockGap:!1,blockStyles:!0,layoutStyles:!1,marginReset:!1,presets:!1,rootPadding:!1,variationStyles:!0})},[s,c,l,o,n]);return Jz({id:`variation-${n}`,css:u,__unstableType:"variation",variation:s,clientId:n}),s?{className:i}:{}}const NEt={hasSupport:()=>!0,attributeKeys:["className"],isMatch:({className:e})=>yze(e).length>0,useBlockProps:WEt},BEt=a.jsxs(ge,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24","aria-hidden":"true",focusable:"false",children:[a.jsx(he,{d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3z"}),a.jsx(he,{stroke:"currentColor",strokeWidth:"1.5",d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3z"})]});function LEt({clientId:e}){var t,n;const{stylesToRender:o,activeStyle:r,className:s}=J7({clientId:e}),{updateBlockAttributes:i}=Oe(J),{merged:c}=x.useContext(lb),{globalSettings:l,globalStyles:u,blockName:d}=G(b=>{const h=b(J).getSettings();return{globalSettings:h.__experimentalFeatures,globalStyles:h[dO],blockName:b(J).getBlockName(e)}},[e]),p=r?.name?Aze({settings:(t=c?.settings)!==null&&t!==void 0?t:l,styles:(n=c?.styles)!==null&&n!==void 0?n:u},d,r.name)?.color?.background:void 0;if(!o||o.length===0)return null;const f=()=>{const h=(o.findIndex(A=>A.name===r.name)+1)%o.length,g=o[h],z=Q7(s,r,g);i(e,{className:z})};return a.jsx(Wn,{children:a.jsx(Vt,{onClick:f,label:m("Shuffle styles"),children:a.jsx(qo,{icon:BEt,style:{fill:p||"transparent"}})})})}function vze({hideDragHandle:e,focusOnMount:t,__experimentalInitialIndex:n,__experimentalOnIndexChange:o,variant:r="unstyled"}){const{blockClientId:s,blockClientIds:i,isDefaultEditingMode:c,blockType:l,toolbarKey:u,shouldShowVisualToolbar:d,showParentSelector:p,isUsingBindings:f,hasParentPattern:b,hasContentOnlyLocking:h,showShuffleButton:g,showSlots:z,showGroupButtons:A,showLockButtons:_,showSwitchSectionStyleButton:v,hasFixedToolbar:M,isNavigationMode:y}=G(I=>{const{getBlockName:P,getBlockMode:$,getBlockParents:F,getSelectedBlockClientIds:X,isBlockValid:Z,getBlockEditingMode:V,getBlockAttributes:Q,getBlockParentsByBlockName:te,getTemplateLock:ee,getSettings:ue,getParentSectionBlock:ce,isZoomOut:me,isNavigationMode:de}=ct(I(J)),Ae=X(),ye=Ae[0],Ne=F(ye),je=ce(ye),ie=je??Ne[Ne.length-1],we=P(ie),re=on(we),pe=V(ye),ke=pe==="default",Se=P(ye),se=Ae.every(Pe=>Z(Pe)),L=Ae.every(Pe=>$(Pe)==="visual"),U=Ae.every(Pe=>!!Q(Pe)?.metadata?.bindings),ne=Ae.every(Pe=>te(Pe,"core/block",!0).length>0),ve=Ae.some(Pe=>ee(Pe)==="contentOnly"),qe=me();return{blockClientId:ye,blockClientIds:Ae,isDefaultEditingMode:ke,blockType:ye&&on(Se),shouldShowVisualToolbar:se&&L,toolbarKey:`${ye}${ie}`,showParentSelector:!qe&&re&&pe!=="contentOnly"&&V(ie)!=="disabled"&&Tt(re,"__experimentalParentSelector",!0)&&Ae.length===1,isUsingBindings:U,hasParentPattern:ne,hasContentOnlyLocking:ve,showShuffleButton:qe,showSlots:!qe,showGroupButtons:!qe,showLockButtons:!qe,showSwitchSectionStyleButton:qe,hasFixedToolbar:ue().hasFixedToolbar,isNavigationMode:de()}},[]),k=x.useRef(null),S=x.useRef(),C=Z7({ref:S}),R=!Yn("medium","<");if(!sMe())return null;const E=i.length>1,B=Qd(l)||Hh(l),N=oe("block-editor-block-contextual-toolbar",{"has-parent":p,"is-inverted-toolbar":y&&!M}),j=oe("block-editor-block-toolbar",{"is-synced":B,"is-connected":f});return a.jsx(tI,{focusEditorOnEscape:!0,className:N,"aria-label":m("Block tools"),variant:r==="toolbar"?void 0:r,focusOnMount:t,__experimentalInitialIndex:n,__experimentalOnIndexChange:o,children:a.jsxs("div",{ref:k,className:j,children:[p&&!E&&R&&a.jsx(fCt,{}),(d||E)&&!b&&a.jsx("div",{ref:S,...C,children:a.jsxs(Wn,{className:"block-editor-block-toolbar__block-controls",children:[a.jsx(NCt,{clientIds:i}),!E&&c&&_&&a.jsx(qqt,{clientId:s}),a.jsx(uCt,{clientIds:i,hideDragHandle:e})]})}),!h&&d&&E&&A&&a.jsx(wqt,{}),g&&a.jsx(Qqt,{clientId:i[0]}),v&&a.jsx(LEt,{clientId:i[0]}),d&&z&&a.jsxs(a.Fragment,{children:[a.jsx(bt.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),a.jsx(bt.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),a.jsx(bt.Slot,{className:"block-editor-block-toolbar__slot"}),a.jsx(bt.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),a.jsx(bt.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),a.jsx(Hqt.Provider,{value:l?.name,children:a.jsx(eI.Slot,{})})]}),a.jsx(Vqt,{clientIds:i}),a.jsx($qt,{clientIds:i})]})},u)}function lI({hideDragHandle:e,variant:t}){return a.jsx(vze,{hideDragHandle:e,variant:t,focusOnMount:void 0,__experimentalInitialIndex:void 0,__experimentalOnIndexChange:void 0})}function PEt({clientId:e,isTyping:t,__unstableContentRef:n}){const{capturingClientId:o,isInsertionPointVisible:r,lastClientId:s}=jge(e),i=x.useRef();x.useEffect(()=>{i.current=void 0},[e]);const{stopTyping:c}=Oe(J),l=x.useRef(!1);p0("core/block-editor/focus-toolbar",()=>{l.current=!0,c(!0)}),x.useEffect(()=>{l.current=!1});const u=o||e,d=Pge({contentElement:n?.current,clientId:u});return!t&&a.jsx(N6t,{clientId:u,bottomClientId:s,className:oe("block-editor-block-list__block-popover",{"is-insertion-point-visible":r}),resize:!1,...d,children:a.jsx(vze,{focusOnMount:l.current,__experimentalInitialIndex:i.current,__experimentalOnIndexChange:p=>{i.current=p},variant:"toolbar"})})}function jEt({onClick:e}){return a.jsx(Ce,{variant:"primary",icon:Fs,size:"compact",className:oe("block-editor-button-pattern-inserter__button","block-editor-block-tools__zoom-out-mode-inserter-button"),onClick:e,label:We("Add pattern","Generic label for pattern inserter button")})}function IEt(){const[e,t]=x.useState(!1),{hasSelection:n,blockOrder:o,setInserterIsOpened:r,sectionRootClientId:s,selectedBlockClientId:i,blockInsertionPoint:c,insertionPointVisible:l}=G(h=>{const{getSettings:g,getBlockOrder:z,getSelectionStart:A,getSelectedBlockClientId:_,getSectionRootClientId:v,getBlockInsertionPoint:M,isBlockInsertionPointVisible:y}=ct(h(J)),k=v();return{hasSelection:!!A().clientId,blockOrder:z(k),sectionRootClientId:k,setInserterIsOpened:g().__experimentalSetIsInserterOpened,selectedBlockClientId:_(),blockInsertionPoint:M(),insertionPointVisible:y()}},[]),{showInsertionPoint:u}=ct(Oe(J));if(x.useEffect(()=>{const h=setTimeout(()=>{t(!0)},500);return()=>{clearTimeout(h)}},[]),!e||!n)return null;const d=i,f=o.findIndex(h=>i===h)+1,b=o[f];return l&&c?.index===f?null:a.jsx(xge,{previousClientId:d,nextClientId:b,children:a.jsx(jEt,{onClick:()=>{r({rootClientId:s,insertionIndex:f,tab:"patterns",category:"all"}),u(s,f,{operation:"insert"})}})})}function DEt(){return G(e=>{const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlock:o,getBlockMode:r,getSettings:s,__unstableGetEditorMode:i,isTyping:c}=ct(e(J)),l=t()||n(),u=o(l),d=i(),p=!!l&&!!u,f=p&&El(u)&&r(l)!=="html",b=l&&!c()&&d!=="navigation"&&f,h=!s().hasFixedToolbar&&!b&&p&&!f;return{showEmptyBlockSideInserter:b,showBlockToolbarPopover:h}},[])}function FEt(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getSettings:o,isTyping:r,isDragging:s,isZoomOut:i}=ct(e(J));return{clientId:t()||n(),hasFixedToolbar:o().hasFixedToolbar,isTyping:r(),isZoomOutMode:i(),isDragging:s()}}function nte({children:e,__unstableContentRef:t,...n}){const{clientId:o,hasFixedToolbar:r,isTyping:s,isZoomOutMode:i,isDragging:c}=G(FEt,[]),l=C_(),{getBlocksByClientId:u,getSelectedBlockClientIds:d,getBlockRootClientId:p,isGroupable:f}=G(J),{getGroupingBlockName:b}=G(kt),{showEmptyBlockSideInserter:h,showBlockToolbarPopover:g}=DEt(),{duplicateBlocks:z,removeBlocks:A,replaceBlocks:_,insertAfterBlock:v,insertBeforeBlock:M,selectBlock:y,moveBlocksUp:k,moveBlocksDown:S,expandBlock:C}=ct(Oe(J));function R(B){if(!B.defaultPrevented){if(l("core/block-editor/move-up",B)||l("core/block-editor/move-down",B)){const N=d();if(N.length){B.preventDefault();const j=p(N[0]);(l("core/block-editor/move-up",B)?"up":"down")==="up"?k(N,j):S(N,j);const P=Array.isArray(N)?N.length:1,$=xe(Dn("%d block moved.","%d blocks moved.",N.length),P);Yt($)}}else if(l("core/block-editor/duplicate",B)){const N=d();N.length&&(B.preventDefault(),z(N))}else if(l("core/block-editor/remove",B)){const N=d();N.length&&(B.preventDefault(),A(N))}else if(l("core/block-editor/insert-after",B)){const N=d();N.length&&(B.preventDefault(),v(N[N.length-1]))}else if(l("core/block-editor/insert-before",B)){const N=d();N.length&&(B.preventDefault(),M(N[0]))}else if(l("core/block-editor/unselect",B)){if(B.target.closest("[role=toolbar]"))return;const N=d();N.length>1&&(B.preventDefault(),y(N[0]))}else if(l("core/block-editor/collapse-list-view",B)){if(md(B.target)||md(B.target?.contentWindow?.document?.activeElement))return;B.preventDefault(),C(o)}else if(l("core/block-editor/group",B)){const N=d();if(N.length>1&&f(N)){B.preventDefault();const j=u(N),I=b(),P=Kr(j,I);_(N,P),Yt(m("Selected blocks are grouped."))}}}}const T=Vx(t),E=Vx(t);return a.jsx("div",{...n,onKeyDown:R,children:a.jsxs(X7.Provider,{value:x.useRef(!1),children:[!s&&!i&&a.jsx(I6t,{__unstableContentRef:t}),h&&a.jsx(oCt,{__unstableContentRef:t,clientId:o}),g&&a.jsx(PEt,{__unstableContentRef:t,clientId:o,isTyping:s}),!i&&!r&&a.jsx(Io.Slot,{name:"block-toolbar",ref:T}),e,a.jsx(Io.Slot,{name:"__unstable-block-tools-after",ref:E}),i&&!c&&a.jsx(IEt,{__unstableContentRef:t})]})})}function $Et(e={},t){switch(t.type){case"REGISTER_COMMAND":return{...e,[t.name]:{name:t.name,label:t.label,searchLabel:t.searchLabel,context:t.context,callback:t.callback,icon:t.icon}};case"UNREGISTER_COMMAND":{const{[t.name]:n,...o}=e;return o}}return e}function VEt(e={},t){switch(t.type){case"REGISTER_COMMAND_LOADER":return{...e,[t.name]:{name:t.name,context:t.context,hook:t.hook}};case"UNREGISTER_COMMAND_LOADER":{const{[t.name]:n,...o}=e;return o}}return e}function HEt(e=!1,t){switch(t.type){case"OPEN":return!0;case"CLOSE":return!1}return e}function UEt(e="root",t){switch(t.type){case"SET_CONTEXT":return t.context}return e}const XEt=J0({commands:$Et,commandLoaders:VEt,isOpen:HEt,context:UEt});function GEt(e){return{type:"REGISTER_COMMAND",...e}}function KEt(e){return{type:"UNREGISTER_COMMAND",name:e}}function YEt(e){return{type:"REGISTER_COMMAND_LOADER",...e}}function ZEt(e){return{type:"UNREGISTER_COMMAND_LOADER",name:e}}function QEt(){return{type:"OPEN"}}function JEt(){return{type:"CLOSE"}}const e8t=Object.freeze(Object.defineProperty({__proto__:null,close:JEt,open:QEt,registerCommand:GEt,registerCommandLoader:YEt,unregisterCommand:KEt,unregisterCommandLoader:ZEt},Symbol.toStringTag,{value:"Module"})),t8t=It((e,t=!1)=>Object.values(e.commands).filter(n=>{const o=n.context&&n.context===e.context;return t?o:!o}),e=>[e.commands,e.context]),n8t=It((e,t=!1)=>Object.values(e.commandLoaders).filter(n=>{const o=n.context&&n.context===e.context;return t?o:!o}),e=>[e.commandLoaders,e.context]);function o8t(e){return e.isOpen}function r8t(e){return e.context}const s8t=Object.freeze(Object.defineProperty({__proto__:null,getCommandLoaders:n8t,getCommands:t8t,getContext:r8t,isOpen:o8t},Symbol.toStringTag,{value:"Module"}));function i8t(e){return{type:"SET_CONTEXT",context:e}}const a8t=Object.freeze(Object.defineProperty({__proto__:null,setContext:i8t},Symbol.toStringTag,{value:"Module"})),{lock:c8t,unlock:xze}=P0("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/commands"),l8t="core/commands",Ef=w1(l8t,{reducer:XEt,actions:e8t,selectors:s8t});Us(Ef);xze(Ef).registerPrivateActions(a8t);m("Search commands and settings");function u8t(e){const{getContext:t}=G(Ef),n=x.useRef(t()),{setContext:o}=xze(Oe(Ef));x.useEffect(()=>{o(e)},[e,o]),x.useEffect(()=>{const r=n.current;return()=>o(r)},[o])}const wze={};c8t(wze,{useCommandContext:u8t});function d8t(e){const{registerCommand:t,unregisterCommand:n}=Oe(Ef),o=x.useRef(e.callback);x.useEffect(()=>{o.current=e.callback},[e.callback]),x.useEffect(()=>{if(!e.disabled)return t({name:e.name,context:e.context,label:e.label,searchLabel:e.searchLabel,icon:e.icon,callback:(...r)=>o.current(...r)}),()=>{n(e.name)}},[e.name,e.label,e.searchLabel,e.icon,e.context,e.disabled,t,n])}function xi(e){const{registerCommandLoader:t,unregisterCommandLoader:n}=Oe(Ef);x.useEffect(()=>{if(!e.disabled)return t({name:e.name,hook:e.hook,context:e.context}),()=>{n(e.name)}},[e.name,e.hook,e.context,e.disabled,t,n])}const p8t=()=>function(){const{replaceBlocks:t,multiSelect:n}=Oe(J),{blocks:o,clientIds:r,canRemove:s,possibleBlockTransformations:i,invalidSelection:c}=G(b=>{const{getBlockRootClientId:h,getBlockTransformItems:g,getSelectedBlockClientIds:z,getBlocksByClientId:A,canRemoveBlocks:_}=b(J),v=z(),M=A(v);if(M.filter(k=>!k).length>0)return{invalidSelection:!0};const y=h(v[0]);return{blocks:M,clientIds:v,possibleBlockTransformations:g(M,y),canRemove:_(v),invalidSelection:!1}},[]);if(c)return{isLoading:!1,commands:[]};const l=o.length===1&&Hh(o[0]);function u(b){b.length>1&&n(b[0].clientId,b[b.length-1].clientId)}function d(b){const h=Kr(o,b);t(r,h),u(h)}const p=!!i.length&&s&&!l;return!r||r.length<1||!p?{isLoading:!1,commands:[]}:{isLoading:!1,commands:i.map(b=>{const{name:h,title:g,icon:z}=b;return{name:"core/block-editor/transform-to-"+h.replace("/","-"),label:xe(m("Transform to %s"),g),icon:a.jsx(Zn,{icon:z}),callback:({close:A})=>{d(h),A()}}})}},f8t=()=>function(){const{clientIds:t,isUngroupable:n,isGroupable:o}=G(S=>{const{getSelectedBlockClientIds:C,isUngroupable:R,isGroupable:T}=S(J);return{clientIds:C(),isUngroupable:R(),isGroupable:T()}},[]),{canInsertBlockType:r,getBlockRootClientId:s,getBlocksByClientId:i,canRemoveBlocks:c}=G(J),{getDefaultBlockName:l,getGroupingBlockName:u}=G(kt),d=i(t),{removeBlocks:p,replaceBlocks:f,duplicateBlocks:b,insertAfterBlock:h,insertBeforeBlock:g}=Oe(J),z=()=>{if(!d.length)return;const S=u(),C=Kr(d,S);C&&f(t,C)},A=()=>{if(!d.length)return;const S=d[0].innerBlocks;S.length&&f(t,S)};if(!t||t.length<1)return{isLoading:!1,commands:[]};const _=s(t[0]),v=r(l(),_),M=d.every(S=>!!S&&Tt(S.name,"multiple",!0)&&r(S.name,_)),y=c(t),k=[];return M&&k.push({name:"duplicate",label:m("Duplicate"),callback:()=>b(t,!0),icon:H3}),v&&k.push({name:"add-before",label:m("Add before"),callback:()=>{const S=Array.isArray(t)?t[0]:S;g(S)},icon:Fs},{name:"add-after",label:m("Add after"),callback:()=>{const S=Array.isArray(t)?t[t.length-1]:S;h(S)},icon:Fs}),o&&k.push({name:"Group",label:m("Group"),callback:z,icon:Zf}),n&&k.push({name:"ungroup",label:m("Ungroup"),callback:A,icon:uJe}),y&&k.push({name:"remove",label:m("Delete"),callback:()=>p(t,!0),icon:K3}),{isLoading:!1,commands:k.map(S=>({...S,name:"core/block-editor/action-"+S.name,callback:({close:C})=>{S.callback(),C()}}))}},b8t=()=>{xi({name:"core/block-editor/blockTransforms",hook:p8t()}),xi({name:"core/block-editor/blockQuickActions",hook:f8t(),context:"block-selection-edit"})},h8t={ignoredSelectors:[/\.editor-styles-wrapper/gi]};function m8t({shouldIframe:e=!0,height:t="300px",children:n=a.jsx(B_,{}),styles:o,contentRef:r,iframeProps:s}){b8t();const i=Yn("medium","<"),c=Cge(),l=q7(),u=x.useRef(),d=xn([r,l,u]),p=G(b=>ct(b(J)).getZoomLevel(),[]),f=p!==100&&!i?{scale:p,frameSize:"40px"}:{};return e?a.jsx(nte,{__unstableContentRef:u,className:"block-editor-block-canvas",style:{height:t,display:"flex"},children:a.jsxs(qme,{...s,...f,ref:c,contentRef:d,style:{...s?.style},name:"editor-canvas",children:[a.jsx($x,{styles:o}),n]})}):a.jsxs(nte,{__unstableContentRef:u,className:"block-editor-block-canvas",style:{height:t},children:[a.jsx($x,{styles:o,scope:":where(.editor-styles-wrapper)",transformOptions:h8t}),a.jsx(cwt,{ref:d,className:"editor-styles-wrapper",tabIndex:-1,children:n})]})}const _ze=x.createContext({}),K_=()=>x.useContext(_ze);function kze({children:e,...t}){const n=x.useRef();return x.useEffect(()=>{n.current&&(n.current.textContent=n.current.textContent)},[e]),a.jsx("div",{hidden:!0,...t,ref:n,children:e})}const Sze=x.forwardRef(({nestingLevel:e,blockCount:t,clientId:n,...o},r)=>{const{insertedBlock:s,setInsertedBlock:i}=K_(),c=vt(Sze),l=G(b=>{const{getTemplateLock:h,isZoomOut:g}=ct(b(J));return!!h(n)||g()},[n]),u=Fd({clientId:n,context:"list-view"}),d=Fd({clientId:s?.clientId,context:"list-view"});if(x.useEffect(()=>{d?.length&&Yt(xe(m("%s block inserted"),d),"assertive")},[d]),l)return null;const p=`list-view-appender__${c}`,f=xe(m("Append to %1$s block at position %2$d, Level %3$d"),u,t+1,e);return a.jsxs("div",{className:"list-view-appender",children:[a.jsx(xm,{ref:r,rootClientId:n,position:"bottom right",isAppender:!0,selectBlockOnInsert:!1,shouldDirectInsert:!1,__experimentalIsQuick:!0,...o,toggleProps:{"aria-describedby":p},onSelectOrClose:b=>{b?.clientId&&i(b)}}),a.jsx(kze,{id:p,children:f})]})}),g8t=bxt(m2e),M8t=x.forwardRef(({isDragged:e,isSelected:t,position:n,level:o,rowCount:r,children:s,className:i,path:c,...l},u)=>{const d=lme({clientId:l["data-block"],enableAnimation:!0,triggerAnimationOnChange:c}),p=xn([u,d]);return a.jsx(g8t,{ref:p,className:oe("block-editor-list-view-leaf",i),level:o,positionInSet:n,setSize:r,isExpanded:void 0,...l,children:s})});function z8t({isSelected:e,selectedClientIds:t,rowItemRef:n}){const o=t.length===1;x.useLayoutEffect(()=>{if(!e||!o||!n.current)return;const r=ps(n.current),{ownerDocument:s}=n.current;if(r===s.body||r===s.documentElement||!r)return;const c=n.current.getBoundingClientRect(),l=r.getBoundingClientRect();(c.topl.bottom)&&n.current.scrollIntoView()},[e,o,n])}function Cze({onClick:e}){return a.jsx("span",{className:"block-editor-list-view__expander",onClick:t=>e(t,{forceToggle:!0}),"aria-hidden":"true","data-testid":"list-view-expander",children:a.jsx(wn,{icon:jt()?qw:Af})})}const O8t=3;function qze(e){if(e.name==="core/image"&&e.attributes?.url)return{url:e.attributes.url,alt:e.attributes.alt,clientId:e.clientId}}function y8t(e){if(e.name!=="core/gallery"||!e.innerBlocks)return[];const t=[];for(const n of e.innerBlocks){const o=qze(n);if(o&&t.push(o),t.length>=O8t)return t}return t}function A8t(e,t){const n=qze(e);return n?[n]:t?[]:y8t(e)}function v8t({clientId:e,isExpanded:t}){const{block:n}=G(r=>({block:r(J).getBlock(e)}),[e]);return x.useMemo(()=>A8t(n,t),[n,t])}const{Badge:x8t}=ct(tr);function w8t({className:e,block:{clientId:t},onClick:n,onContextMenu:o,onMouseDown:r,onToggleExpanded:s,tabIndex:i,onFocus:c,onDragStart:l,onDragEnd:u,draggable:d,isExpanded:p,ariaDescribedBy:f},b){const h=ji(t),g=Fd({clientId:t,context:"list-view"}),{isLocked:z}=km(t),{isContentOnly:A}=G(S=>({isContentOnly:S(J).getBlockEditingMode(t)==="contentOnly"}),[t]),_=z&&!A,v=h?.positionType==="sticky",M=v8t({clientId:t,isExpanded:p}),y=S=>{S.dataTransfer.clearData(),l?.(S)};function k(S){(S.keyCode===Gr||S.keyCode===LN)&&n(S)}return a.jsxs("a",{className:oe("block-editor-list-view-block-select-button",e),onClick:n,onContextMenu:o,onKeyDown:k,onMouseDown:r,ref:b,tabIndex:i,onFocus:c,onDragStart:y,onDragEnd:u,draggable:d,href:`#block-${t}`,"aria-describedby":f,"aria-expanded":p,children:[a.jsx(Cze,{onClick:s}),a.jsx(Zn,{icon:h?.icon,showColors:!0,context:"list-view"}),a.jsxs(Ot,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1,children:[a.jsx("span",{className:"block-editor-list-view-block-select-button__title",children:a.jsx(zs,{ellipsizeMode:"auto",children:g})}),h?.anchor&&a.jsx("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper",children:a.jsx(x8t,{className:"block-editor-list-view-block-select-button__anchor",children:h.anchor})}),v&&a.jsx("span",{className:"block-editor-list-view-block-select-button__sticky",children:a.jsx(wn,{icon:AQe})}),M.length?a.jsx("span",{className:"block-editor-list-view-block-select-button__images","aria-hidden":!0,children:M.map((S,C)=>a.jsx("span",{className:"block-editor-list-view-block-select-button__image",style:{backgroundImage:`url(${S.url})`,zIndex:M.length-C}},S.clientId))}):null,_&&a.jsx("span",{className:"block-editor-list-view-block-select-button__lock",children:a.jsx(wn,{icon:dde})})]})]})}const _8t=x.forwardRef(w8t),k8t=x.forwardRef(({onClick:e,onToggleExpanded:t,block:n,isSelected:o,position:r,siblingBlockCount:s,level:i,isExpanded:c,selectedClientIds:l,...u},d)=>{const{clientId:p}=n,{AdditionalBlockContent:f,insertedBlock:b,setInsertedBlock:h}=K_(),g=l.includes(p)?l:[p];return a.jsxs(a.Fragment,{children:[f&&a.jsx(f,{block:n,insertedBlock:b,setInsertedBlock:h}),a.jsx(Dge,{appendToOwnerDocument:!0,clientIds:g,cloneClassname:"block-editor-list-view-draggable-chip",children:({draggable:z,onDragStart:A,onDragEnd:_})=>a.jsx(_8t,{ref:d,className:"block-editor-list-view-block-contents",block:n,onClick:e,onToggleExpanded:t,isSelected:o,position:r,siblingBlockCount:s,level:i,draggable:z,onDragStart:A,onDragEnd:_,isExpanded:c,...u})})]})}),S8t=(e,t,n)=>xe(m("Block %1$d of %2$d, Level %3$d."),e,t,n),C8t=(e,t)=>[e?.positionLabel?`${xe(m("Position: %s"),e.positionLabel)}.`:void 0,t?m("This block is locked."):void 0].filter(Boolean).join(" "),q8t=(e,t)=>Array.isArray(t)&&t.length?t.indexOf(e)!==-1:t===e;function R8t(e,t,n,o){const r=[...n,e],s=[...o,t],i=Math.min(r.length,s.length)-1,c=r[i],l=s[i];return{start:c,end:l}}function uI(e,t){const n=()=>{const r=t?.querySelector(`[role=row][data-block="${e}"]`);return r?Xr.focusable.find(r)[0]:null};let o=n();o?o.focus():window.requestAnimationFrame(()=>{o=n(),o&&o.focus()})}function T8t({blockIndexes:e,blockDropTargetIndex:t,blockDropPosition:n,clientId:o,firstDraggedBlockIndex:r,isDragged:s}){let i,c,l;if(!s){c=!1;const u=e[o];l=u>r,t!=null&&r!==void 0?u!==void 0&&(u>=r&&u=t?i="down":i="normal",c=typeof t=="number"&&t-1===u&&n==="inside"):t===null&&r!==void 0?u!==void 0&&u>=r?i="up":i="normal":t!=null&&r===void 0?u!==void 0&&(u{const{getBlock:Qe,getBlockName:xt,getSettings:Gt}=Rt(J);return{block:Qe(e),blockName:xt(e),allowRightClickOverrides:Gt().allowRightClickOverrides}},[e]),re=Tt(ie,"__experimentalToolbar",!0),ke=`list-view-block-select-button__description-${vt(Rze)}`,{expand:Se,collapse:se,collapseAll:L,BlockSettingsMenu:U,listViewInstanceId:ne,expandedState:ve,setInsertedBlock:qe,treeGridElementRef:Pe,rootClientId:rt}=K_(),qt=C_();function wt(){const Rt=Q(),Qe=Rt.includes(e),xt=Qe?Rt[0]:e,Gt=ee(xt);return{blocksToUpdate:Qe?Rt:[e],firstBlockClientId:xt,firstBlockRootClientId:Gt,selectedBlockClientIds:Rt}}async function Bt(Rt){if(Rt.defaultPrevented||Rt.target.closest("[role=dialog]"))return;const Qe=[Mc,zl].includes(Rt.keyCode);if(qt("core/block-editor/unselect",Rt)&&g.length>0)Rt.stopPropagation(),Rt.preventDefault(),c(Rt,void 0);else if(Qe||qt("core/block-editor/remove",Rt)){var xt;const{blocksToUpdate:Gt,firstBlockClientId:On,firstBlockRootClientId:$n,selectedBlockClientIds:Jn}=wt();if(!de(Gt))return;let pr=(xt=te(On))!==null&&xt!==void 0?xt:$n;$(Gt,!1);const O0=Jn.length>0&&Q().length===0;pr||(pr=ue()[0]),fe(pr,O0)}else if(qt("core/block-editor/duplicate",Rt)){Rt.preventDefault();const{blocksToUpdate:Gt,firstBlockRootClientId:On}=wt();if(me(Gt).every(Jn=>!!Jn&&Tt(Jn.name,"multiple",!0)&&V(Jn.name,On))){const Jn=await j(Gt,!1);Jn?.length&&fe(Jn[0],!1)}}else if(qt("core/block-editor/insert-before",Rt)){Rt.preventDefault();const{blocksToUpdate:Gt}=wt();await X(Gt[0]);const On=Q();Z(void 0),fe(On[0],!1)}else if(qt("core/block-editor/insert-after",Rt)){Rt.preventDefault();const{blocksToUpdate:Gt}=wt();await F(Gt.at(-1));const On=Q();Z(void 0),fe(On[0],!1)}else if(qt("core/block-editor/select-all",Rt)){Rt.preventDefault();const{firstBlockRootClientId:Gt,selectedBlockClientIds:On}=wt(),$n=ue(Gt);if(!$n.length)return;if(ds(On,$n)&&Gt&&Gt!==rt){fe(Gt,!0);return}I($n[0],$n[$n.length-1],null)}else if(qt("core/block-editor/collapse-list-view",Rt)){Rt.preventDefault();const{firstBlockClientId:Gt}=wt(),On=ce(Gt,!1);L(),Se(On)}else if(qt("core/block-editor/group",Rt)){const{blocksToUpdate:Gt}=wt();if(Gt.length>1&&Ae(Gt)){Rt.preventDefault();const On=me(Gt),$n=ye(),Jn=Kr(On,$n);P(Gt,Jn),Yt(m("Selected blocks are grouped."));const pr=Q();Z(void 0),fe(pr[0],!1)}}}const ae=x.useCallback(()=>{y(!0),N(e,!0)},[e,y,N]),H=x.useCallback(()=>{y(!1),N(e,!1)},[e,y,N]),Y=x.useCallback(Rt=>{c(Rt,e),Rt.preventDefault()},[e,c]),fe=x.useCallback((Rt,Qe)=>{Qe&&c(void 0,Rt,null,null),uI(Rt,Pe?.current)},[c,Pe]),Re=x.useCallback(Rt=>{Rt.preventDefault(),Rt.stopPropagation(),h===!0?se(e):h===!1&&Se(e)},[e,Se,se,h]),be=x.useCallback(Rt=>{re&&we&&(v.current?.click(),S(new window.DOMRect(Rt.clientX,Rt.clientY,0,0)),Rt.preventDefault())},[we,v,re]),ze=x.useCallback(Rt=>{we&&Rt.button===2&&Rt.preventDefault()},[we]),nt=x.useMemo(()=>{const{ownerDocument:Rt}=_?.current||{};if(!(!k||!Rt))return{ownerDocument:Rt,getBoundingClientRect(){return k}}},[k]),Mt=x.useCallback(()=>{S(void 0)},[S]);if(z8t({isSelected:s,rowItemRef:_,selectedClientIds:g}),!je)return null;const ot=S8t(l,p,u),Ue=C8t(Ne,C),yt=p>0,fn=f&&yt,Ln=oe("block-editor-list-view-block__mover-cell",{"is-visible":M||s}),Mo=oe("block-editor-list-view-block__menu-cell",{"is-visible":M||E});let rr;fn?rr=2:re||(rr=3);const Jo=oe({"is-selected":s,"is-first-selected":E,"is-last-selected":B,"is-branch-selected":i,"is-synced-branch":z,"is-dragging":o,"has-single-cell":!re,"is-synced":Ne?.isSynced,"is-draggable":T,"is-displacement-normal":t==="normal","is-displacement-up":t==="up","is-displacement-down":t==="down","is-after-dragged-blocks":n,"is-nesting":r}),To=g.includes(e)?g:[e],Nr=s&&g.length===1;return a.jsxs(M8t,{className:Jo,isDragged:o,onKeyDown:Bt,onMouseEnter:ae,onMouseLeave:H,onFocus:ae,onBlur:H,level:u,position:l,rowCount:d,path:b,id:`list-view-${ne}-block-${e}`,"data-block":e,"data-expanded":R?h:void 0,ref:_,children:[a.jsx(d4,{className:"block-editor-list-view-block__contents-cell",colSpan:rr,ref:A,"aria-selected":!!s,children:({ref:Rt,tabIndex:Qe,onFocus:xt})=>a.jsxs("div",{className:"block-editor-list-view-block__contents-container",children:[a.jsx(k8t,{block:je,onClick:Y,onContextMenu:be,onMouseDown:ze,onToggleExpanded:Re,isSelected:s,position:l,siblingBlockCount:p,level:u,ref:Rt,tabIndex:Nr?0:Qe,onFocus:xt,isExpanded:R?h:void 0,selectedClientIds:g,ariaDescribedBy:ke}),a.jsx(kze,{id:ke,children:[ot,Ue].filter(Boolean).join(" ")})]})}),fn&&a.jsx(a.Fragment,{children:a.jsxs(d4,{className:Ln,withoutGridItem:!0,children:[a.jsx(aW,{children:({ref:Rt,tabIndex:Qe,onFocus:xt})=>a.jsx(Fge,{orientation:"vertical",clientIds:[e],ref:Rt,tabIndex:Qe,onFocus:xt})}),a.jsx(aW,{children:({ref:Rt,tabIndex:Qe,onFocus:xt})=>a.jsx($ge,{orientation:"vertical",clientIds:[e],ref:Rt,tabIndex:Qe,onFocus:xt})})]})}),re&&U&&a.jsx(d4,{className:Mo,"aria-selected":!!s,ref:v,children:({ref:Rt,tabIndex:Qe,onFocus:xt})=>a.jsx(U,{clientIds:To,block:je,icon:Wc,label:m("Options"),popoverProps:{anchor:nt},toggleProps:{ref:Rt,className:"block-editor-list-view-block__menu",tabIndex:Qe,onClick:Mt,onFocus:xt},disableOpenOnArrowDown:!0,expand:Se,expandedState:ve,setInsertedBlock:qe,__experimentalSelectBlock:fe})})]})}const E8t=x.memo(Rze);function Tze(e,t,n,o){var r;return n?.includes(e.clientId)?0:((r=t[e.clientId])!==null&&r!==void 0?r:o)?1+e.innerBlocks.reduce(W8t(t,n,o),0):1}const W8t=(e,t,n)=>(o,r)=>{var s;return t?.includes(r.clientId)?o:((s=e[r.clientId])!==null&&s!==void 0?s:n)&&r.innerBlocks.length>0?o+Tze(r,e,t,n):o+1},N8t=()=>{};function Eze(e){const{blocks:t,selectBlock:n=N8t,showBlockMovers:o,selectedClientIds:r,level:s=1,path:i="",isBranchSelected:c=!1,listPosition:l=0,fixedListWindow:u,isExpanded:d,parentId:p,shouldShowInnerBlocks:f=!0,isSyncedBranch:b=!1,showAppender:h=!0}=e,g=ji(p),z=b||!!g?.isSynced,A=G(N=>p?N(J).canEditBlock(p):!0,[p]),{blockDropPosition:_,blockDropTargetIndex:v,firstDraggedBlockIndex:M,blockIndexes:y,expandedState:k,draggedClientIds:S}=K_(),C=x.useRef();if(!A)return null;const R=h&&s===1,T=t.filter(Boolean),E=T.length,B=R?E+1:E;return C.current=l,a.jsxs(a.Fragment,{children:[T.map((N,j)=>{var I;const{clientId:P,innerBlocks:$}=N;j>0&&(C.current+=Tze(T[j-1],k,S,d));const F=!!S?.includes(P),{displacement:X,isAfterDraggedBlocks:Z,isNesting:V}=T8t({blockIndexes:y,blockDropTargetIndex:v,blockDropPosition:_,clientId:P,firstDraggedBlockIndex:M,isDragged:F}),{itemInView:Q}=u,te=Q(C.current),ee=j+1,ue=i.length>0?`${i}_${ee}`:`${ee}`,ce=!!$?.length,me=ce&&f?(I=k[P])!==null&&I!==void 0?I:d:void 0,de=q8t(P,r),Ae=c||de&&ce,ye=F||te||de&&P===r[0]||j===0||j===E-1;return a.jsxs(C5,{value:!de,children:[ye&&a.jsx(E8t,{block:N,selectBlock:n,isSelected:de,isBranchSelected:Ae,isDragged:F,level:s,position:ee,rowCount:B,siblingBlockCount:E,showBlockMovers:o,path:ue,isExpanded:F?!1:me,listPosition:C.current,selectedClientIds:r,isSyncedBranch:z,displacement:X,isAfterDraggedBlocks:Z,isNesting:V}),!ye&&a.jsx("tr",{children:a.jsx("td",{className:"block-editor-list-view-placeholder"})}),ce&&me&&!F&&a.jsx(Eze,{parentId:P,blocks:$,selectBlock:n,showBlockMovers:o,level:s+1,path:ue,listPosition:C.current+1,fixedListWindow:u,isBranchSelected:Ae,selectedClientIds:r,isExpanded:d,isSyncedBranch:z})]},P)}),R&&a.jsx(m2e,{level:s,setSize:B,positionInSet:B,isExpanded:!0,children:a.jsx(d4,{children:N=>a.jsx(Sze,{clientId:p,nestingLevel:s,blockCount:E,...N})})})]})}const B8t=x.memo(Eze);function L8t({draggedBlockClientId:e,listViewRef:t,blockDropTarget:n}){const o=ji(e),r=Fd({clientId:e,context:"list-view"}),{rootClientId:s,clientId:i,dropPosition:c}=n||{},[l,u]=x.useMemo(()=>{if(!t.current)return[];const _=s?t.current.querySelector(`[data-block="${s}"]`):void 0,v=i?t.current.querySelector(`[data-block="${i}"]`):void 0;return[_,v]},[t,s,i]),d=u||l,p=jt(),f=x.useCallback((_,v)=>{if(!d)return 0;let M=d.offsetWidth;const y=ps(d,"horizontal"),k=d.ownerDocument,S=y===k.body||y===k.documentElement;if(y&&!S){const C=y.getBoundingClientRect(),R=jt()?C.right-_.right:_.left-C.left,T=y.clientWidth;if(TC.right)return M-=_.right-C.right,M}return M-v},[p,d]),b=x.useMemo(()=>{if(!d)return{};const _=d.getBoundingClientRect();return{width:f(_,0)}},[f,d]),h=x.useMemo(()=>{if(!d)return{};const _=ps(d),v=d.ownerDocument,M=_===v.body||_===v.documentElement;if(_&&!M){const y=_.getBoundingClientRect(),k=d.getBoundingClientRect(),S=p?y.right-k.right:k.left-y.left;if(!p&&y.left>k.left)return{transform:`translateX( ${S}px )`};if(p&&y.right{if(!l)return 1;const _=parseInt(l.getAttribute("aria-level"),10);return _?_+1:1},[l]),z=x.useMemo(()=>d?d.classList.contains("is-branch-selected"):!1,[d]),A=x.useMemo(()=>{if(!(!d||!(c==="top"||c==="bottom"||c==="inside")))return{contextElement:d,getBoundingClientRect(){const v=d.getBoundingClientRect();let M=v.left,y=0;const k=ps(d,"horizontal"),S=d.ownerDocument,C=k===S.body||k===S.documentElement;if(k&&!C){const E=k.getBoundingClientRect(),B=p?k.offsetWidth-k.clientWidth:0;M{}}),a.jsx(Zn,{icon:o?.icon,showColors:!0,context:"list-view"}),a.jsx(Ot,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1,children:a.jsx("span",{className:"block-editor-list-view-block-select-button__title",children:a.jsx(zs,{ellipsizeMode:"auto",children:r})})})]}),a.jsx("div",{className:"block-editor-list-view-block__menu-cell"})]})})}):null}function P8t(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=Oe(J),{getBlockName:o,getBlockParents:r,getBlockSelectionStart:s,getSelectedBlockClientIds:i,hasMultiSelection:c,hasSelectedBlock:l}=G(J),{getBlockType:u}=G(kt);return{updateBlockSelection:x.useCallback(async(p,f,b,h)=>{if(!p?.shiftKey&&p?.keyCode!==gd){n(f,h);return}p.preventDefault();const g=p.type==="keydown"&&p.keyCode===gd,z=p.type==="keydown"&&(p.keyCode===cc||p.keyCode===Ps||p.keyCode===S2||p.keyCode===FM);if(!z&&!l()&&!c()){n(f,null);return}const A=i(),_=[...r(f),f];if((g||z&&!A.some(k=>_.includes(k)))&&await e(),!g){let k=s(),S=f;z&&(!l()&&!c()&&(k=f),b&&(S=b));const C=r(k),R=r(S),{start:T,end:E}=R8t(k,S,C,R);await t(T,E,null)}const v=i();if((p.keyCode===S2||p.keyCode===FM)&&v.length>1)return;const M=A.filter(k=>!v.includes(k));let y;if(M.length===1){const k=u(o(M[0]))?.title;k&&(y=xe(m("%s deselected."),k))}else M.length>1&&(y=xe(m("%s blocks deselected."),M.length));y&&Yt(y,"assertive")},[e,o,u,r,s,i,c,l,t,n])}}function j8t(e){return x.useMemo(()=>{const n={};let o=0;const r=s=>{s.forEach(i=>{n[i.clientId]=o,o++,i.innerBlocks.length>0&&r(i.innerBlocks)})};return r(e),n},[e])}function I8t({blocks:e,rootClientId:t}){return G(n=>{const{getDraggedBlockClientIds:o,getSelectedBlockClientIds:r,getEnabledClientIdsTree:s}=ct(n(J));return{selectedClientIds:r(),draggedClientIds:o(),clientIdsTree:e??s(t)}},[e,t])}function D8t({collapseAll:e,expand:t}){const{expandedBlock:n,getBlockParents:o}=G(r=>{const{getBlockParents:s,getExpandedBlock:i}=ct(r(J));return{expandedBlock:i(),getBlockParents:s}},[]);x.useEffect(()=>{if(n){const r=o(n,!1);e(),t(r)}},[e,t,n,o])}const Ml=24;function F8t(e,t,n=1,o=!1){const r=o?t.right-n*Ml:t.left+n*Ml;return o?e.x>r:e.xr.clientId===o.rootClientId);return n}function Wze(e,t){const n=e[t+1];return n&&n.isDraggedBlock?Wze(e,t+1):n}function H8t(e,t,n=1,o=!1){const r=o?t.right-n*Ml:t.left+n*Ml;return(o?e.xr+Ml)&&e.y0&&r.isExpanded||H8t(t,i,l.length,n))){const p=r.isExpanded?0:r.innerBlockCount||0;return{rootClientId:r.clientId,clientId:r.clientId,blockIndex:p,dropPosition:"inside"}}if(u&&r.rootClientId&&F8t(t,i,l.length,n)){const p=Wze(e,c),f=r.nestingLevel,b=p?p.nestingLevel:1;if(f&&b){const h=$8t(t,i,l.length,n),g=Math.max(Math.min(h,f-b),0);if(l[g]){let z=r.blockIndex;if(l[g].nestingLevel===p?.nestingLevel)z=p?.blockIndex;else for(let A=c;A>=0;A--){const _=e[A];if(_.rootClientId===l[g].rootClientId){z=_.blockIndex+1;break}}return{rootClientId:l[g].rootClientId,clientId:r.clientId,blockIndex:z,dropPosition:o}}}}if(!r.canInsertDraggedBlocksAsSibling)return;const d=u?1:0;return{rootClientId:r.rootClientId,clientId:r.clientId,blockIndex:r.blockIndex+d,dropPosition:o}}const G8t={leading:!1,trailing:!0};function K8t({dropZoneElement:e,expandedState:t,setExpandedState:n}){const{getBlockRootClientId:o,getBlockIndex:r,getBlockCount:s,getDraggedBlockClientIds:i,canInsertBlocks:c}=G(J),[l,u]=x.useState(),{rootClientId:d,blockIndex:p}=l||{},f=_ge(d,p),b=jt(),h=Fr(d),g=x.useCallback((M,y)=>{const{rootClientId:k}=y||{};k&&y?.dropPosition==="inside"&&!M[k]&&n({type:"expand",clientIds:[k]})},[n]),z=yE(g,500,G8t);x.useEffect(()=>{if(l?.dropPosition!=="inside"||h!==l?.rootClientId){z.cancel();return}z(t,l)},[t,h,l,z]);const A=i(),_=yE(x.useCallback((M,y)=>{const k={x:M.clientX,y:M.clientY},S=!!A?.length,R=Array.from(y.querySelectorAll("[data-block]")).map(E=>{const B=E.dataset.block,N=E.dataset.expanded==="true",j=E.classList.contains("is-dragging"),I=parseInt(E.getAttribute("aria-level"),10),P=o(B);return{clientId:B,isExpanded:N,rootClientId:P,blockIndex:r(B),element:E,nestingLevel:I||void 0,isDraggedBlock:S?j:!1,innerBlockCount:s(B),canInsertDraggedBlocksAsSibling:S?c(A,P):!0,canInsertDraggedBlocksAsChild:S?c(A,B):!0}}),T=X8t(R,k,b);T&&u(T)},[c,A,s,r,o,b]),50);return{ref:k5({dropZoneElement:e,onDrop(M){_.cancel(),l&&f(M),u(void 0)},onDragLeave(){_.cancel(),u(null)},onDragOver(M){_(M,M.currentTarget)},onDragEnd(){_.cancel(),u(void 0)}}),target:l}}function Y8t({firstSelectedBlockClientId:e,setExpandedState:t}){const[n,o]=x.useState(null),{selectedBlockParentClientIds:r}=G(s=>{const{getBlockParents:i}=s(J);return{selectedBlockParentClientIds:i(e,!1)}},[e]);return x.useEffect(()=>{n!==e&&r?.length&&t({type:"expand",clientIds:r})},[e,r,n,t]),{setSelectedTreeId:o}}function Z8t({selectBlock:e}){const t=Fn(),{getBlockOrder:n,getBlockRootClientId:o,getBlocksByClientId:r,getPreviousBlockClientId:s,getSelectedBlockClientIds:i,getSettings:c,canInsertBlockType:l,canRemoveBlocks:u}=G(J),{flashBlock:d,removeBlocks:p,replaceBlocks:f,insertBlocks:b}=Oe(J),h=R7();return Mn(g=>{function z(v,M){M&&e(void 0,v,null,null),uI(v,g)}function A(v){const M=i(),y=M.includes(v),k=y?M[0]:v,S=o(k);return{blocksToUpdate:y?M:[v],firstBlockClientId:k,firstBlockRootClientId:S,originallySelectedBlockClientIds:M}}function _(v){if(v.defaultPrevented||!g.contains(v.target.ownerDocument.activeElement))return;const y=v.target.ownerDocument.activeElement?.closest("[role=row]")?.dataset?.block;if(!y)return;const{blocksToUpdate:k,firstBlockClientId:S,firstBlockRootClientId:C,originallySelectedBlockClientIds:R}=A(y);if(k.length!==0){if(v.preventDefault(),v.type==="copy"||v.type==="cut"){k.length===1&&d(k[0]),h(v.type,k);const E=r(k);kme(v,E,t)}if(v.type==="cut"){var T;if(!u(k))return;let E=(T=s(S))!==null&&T!==void 0?T:C;p(k,!1);const B=R.length>0&&i().length===0;E||(E=n()[0]),z(E,B)}else if(v.type==="paste"){const{__experimentalCanUserUseUnfilteredHTML:E}=c(),B=rwt(v,E);if(k.length===1){const[N]=k;if(B.every(j=>l(j.name,N))){b(B,void 0,N),z(B[0]?.clientId,!1);return}}f(k,B,B.length-1,-1),z(B[0]?.clientId,!1)}}}return g.ownerDocument.addEventListener("copy",_),g.ownerDocument.addEventListener("cut",_),g.ownerDocument.addEventListener("paste",_),()=>{g.ownerDocument.removeEventListener("copy",_),g.ownerDocument.removeEventListener("cut",_),g.ownerDocument.removeEventListener("paste",_)}},[])}const Q8t=(e,t)=>t.type==="clear"?{}:Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce((n,o)=>({...n,[o]:t.type==="expand"}),{})}:e,ote=32;function Nze({id:e,blocks:t,dropZoneElement:n,showBlockMovers:o=!1,isExpanded:r=!1,showAppender:s=!1,blockSettingsMenu:i=oMe,rootClientId:c,description:l,onSelect:u,additionalBlockContent:d},p){t&&Ke("`blocks` property in `wp.blockEditor.__experimentalListView`",{since:"6.3",alternative:"`rootClientId` property"});const f=vt(Nze),{clientIdsTree:b,draggedClientIds:h,selectedClientIds:g}=I8t({blocks:t,rootClientId:c}),z=j8t(b),{getBlock:A}=G(J),{visibleBlockCount:_}=G(de=>{const{getGlobalBlockCount:Ae,getClientIdsOfDescendants:ye}=de(J),Ne=h?.length>0?ye(h).length+1:0;return{visibleBlockCount:Ae()-Ne}},[h]),{updateBlockSelection:v}=P8t(),[M,y]=x.useReducer(Q8t,{}),[k,S]=x.useState(null),{setSelectedTreeId:C}=Y8t({firstSelectedBlockClientId:g[0],setExpandedState:y}),R=x.useCallback((de,Ae,ye)=>{v(de,Ae,null,ye),C(Ae),u&&u(A(Ae))},[C,v,u,A]),{ref:T,target:E}=K8t({dropZoneElement:n,expandedState:M,setExpandedState:y}),B=x.useRef(),N=Z8t({selectBlock:R}),j=xn([N,B,T,p]);x.useEffect(()=>{g?.length&&uI(g[0],B?.current)},[]);const I=x.useCallback(de=>{if(!de)return;const Ae=Array.isArray(de)?de:[de];y({type:"expand",clientIds:Ae})},[y]),P=x.useCallback(de=>{de&&y({type:"collapse",clientIds:[de]})},[y]),$=x.useCallback(()=>{y({type:"clear"})},[y]),F=x.useCallback(de=>{I(de?.dataset?.block)},[I]),X=x.useCallback(de=>{P(de?.dataset?.block)},[P]),Z=x.useCallback((de,Ae,ye)=>{de.shiftKey&&v(de,Ae?.dataset?.block,ye?.dataset?.block)},[v]);D8t({collapseAll:$,expand:I});const V=h?.[0],{blockDropTargetIndex:Q,blockDropPosition:te,firstDraggedBlockIndex:ee}=x.useMemo(()=>{let de,Ae;if(E?.clientId){const ye=z[E.clientId];de=ye===void 0||E?.dropPosition==="top"?ye:ye+1}else E===null&&(de=null);if(V){const ye=z[V];Ae=ye===void 0||E?.dropPosition==="top"?ye:ye+1}return{blockDropTargetIndex:de,blockDropPosition:E?.dropPosition,firstDraggedBlockIndex:Ae}},[E,z,V]),ue=x.useMemo(()=>({blockDropPosition:te,blockDropTargetIndex:Q,blockIndexes:z,draggedClientIds:h,expandedState:M,expand:I,firstDraggedBlockIndex:ee,collapse:P,collapseAll:$,BlockSettingsMenu:i,listViewInstanceId:f,AdditionalBlockContent:d,insertedBlock:k,setInsertedBlock:S,treeGridElementRef:B,rootClientId:c}),[te,Q,z,h,M,I,ee,P,$,i,f,d,k,S,c]),[ce]=wSe(B,ote,_,{expandedState:M,useWindowing:!0,windowOverscan:40});if(!b.length&&!s)return null;const me=l&&`block-editor-list-view-description-${f}`;return a.jsxs(C5,{value:!0,children:[a.jsx(L8t,{draggedBlockClientId:V,listViewRef:B,blockDropTarget:E}),l&&a.jsx(qn,{id:me,children:l}),a.jsx(Qht,{id:e,className:oe("block-editor-list-view-tree",{"is-dragging":h?.length>0&&Q!==void 0}),"aria-label":m("Block navigation structure"),ref:j,onCollapseRow:X,onExpandRow:F,onFocusRow:Z,applicationAriaLabel:m("Block navigation structure"),"aria-describedby":me,style:{"--wp-admin--list-view-dragged-items-height":h?.length?`${ote*(h.length-1)}px`:null},children:a.jsx(_ze.Provider,{value:ue,children:a.jsx(B8t,{blocks:b,parentId:c,selectBlock:R,showBlockMovers:o,fixedListWindow:ce,selectedClientIds:g,isExpanded:r,showAppender:s})})})]})}const Bze=x.forwardRef(Nze),J8t=x.forwardRef((e,t)=>a.jsx(Bze,{ref:t,...e,showAppender:!1,rootClientId:null,onSelect:null,additionalBlockContent:null,blockSettingsMenu:void 0}));function eWt({genericPreviewBlock:e,style:t,className:n,activeStyle:o}){const r=on(e.name)?.example,s=Q7(n,o,t),i=x.useMemo(()=>({...e,title:t.label||t.name,description:t.description,initialAttributes:{...e.attributes,className:s+" block-editor-block-styles__block-preview-container"},example:r}),[e,s]);return a.jsx(age,{item:i})}const rte=()=>{};function Lze({clientId:e,onSwitch:t=rte,onHoverClassName:n=rte}){const{onSelect:o,stylesToRender:r,activeStyle:s,genericPreviewBlock:i,className:c}=J7({clientId:e,onSwitch:t}),[l,u]=x.useState(null),d=Yn("medium","<");if(!r||r.length===0)return null;const p=F1(u,250),f=h=>{o(h),n(null),u(null),p.cancel()},b=h=>{var g;if(l===h){p.cancel();return}p(h),n((g=h?.name)!==null&&g!==void 0?g:null)};return a.jsxs("div",{className:"block-editor-block-styles",children:[a.jsx("div",{className:"block-editor-block-styles__variants",children:r.map(h=>{const g=h.label||h.name;return a.jsx(Ce,{__next40pxDefaultSize:!0,className:oe("block-editor-block-styles__item",{"is-active":s.name===h.name}),variant:"secondary",label:g,onMouseEnter:()=>b(h),onFocus:()=>b(h),onMouseLeave:()=>b(null),onBlur:()=>b(null),onClick:()=>f(h),"aria-current":s.name===h.name,children:a.jsx(zs,{numberOfLines:1,className:"block-editor-block-styles__item-text",children:g})},h.name)})}),l&&!d&&a.jsx(Io,{placement:"left-start",offset:34,focusOnMount:!1,children:a.jsx("div",{className:"block-editor-block-styles__preview-panel",onMouseLeave:()=>b(null),children:a.jsx(eWt,{activeStyle:s,className:c,genericPreviewBlock:i,style:l})})})]})}const ste={0:mde,1:KZe,2:YZe,3:ZZe,4:QZe,5:JZe,6:eQe};function ite({level:e}){return ste[e]?a.jsx(qo,{icon:ste[e]}):null}const ate=[1,2,3,4,5,6],tWt={className:"block-library-heading-level-dropdown"};function Cm({options:e=ate,value:t,onChange:n}){const o=e.filter(r=>r===0||ate.includes(r)).sort((r,s)=>r-s);return a.jsx(Lc,{popoverProps:tWt,icon:a.jsx(ite,{level:t}),label:m("Change level"),controls:o.map(r=>{const s=r===t;return{icon:a.jsx(ite,{level:r}),title:r===0?m("Paragraph"):xe(m("Heading %d"),r),isActive:s,onClick(){n(r)},role:"menuitemradio"}})})}function Pze({icon:e=nu,label:t=m("Choose variation"),instructions:n=m("Select a variation to start with:"),variations:o,onSelect:r,allowSkip:s}){const i=oe("block-editor-block-variation-picker",{"has-many-variations":o.length>4});return a.jsxs(vo,{icon:e,label:t,instructions:n,className:i,children:[a.jsx("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":m("Block variations"),children:o.map(c=>a.jsxs("li",{children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",icon:c.icon&&c.icon.src?c.icon.src:c.icon,iconSize:48,onClick:()=>r(c),className:"block-editor-block-variation-picker__variation",label:c.description||c.title}),a.jsx("span",{className:"block-editor-block-variation-picker__variation-label",children:c.title})]},c.name))}),s&&a.jsx("div",{className:"block-editor-block-variation-picker__skip",children:a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>r(),children:m("Skip")})})]})}function nWt({className:e,onSelectVariation:t,selectedValue:n,variations:o}){return a.jsxs("fieldset",{className:e,children:[a.jsx(qn,{as:"legend",children:m("Transform to variation")}),o.map(r=>a.jsx(Ce,{__next40pxDefaultSize:!0,size:"compact",icon:a.jsx(Zn,{icon:r.icon,showColors:!0}),isPressed:n===r.name,label:n===r.name?r.title:xe(m("Transform to %s"),r.title),onClick:()=>t(r.name),"aria-label":r.title,showTooltip:!0},r.name))]})}function oWt({className:e,onSelectVariation:t,selectedValue:n,variations:o}){const r=o.map(({name:s,title:i,description:c})=>({value:s,label:i,info:c}));return a.jsx(c0,{className:e,label:m("Transform to variation"),text:m("Transform to variation"),popoverProps:{position:"bottom center",className:`${e}__popover`},icon:tu,toggleProps:{iconPosition:"right"},children:()=>a.jsx("div",{className:`${e}__container`,children:a.jsx(Cn,{children:a.jsx(kf,{choices:r,value:n,onSelect:t})})})})}function rWt({className:e,onSelectVariation:t,selectedValue:n,variations:o}){return a.jsx("div",{className:e,children:a.jsx(Do,{label:m("Transform to variation"),value:n,hideLabelFromVision:!0,onChange:t,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,children:o.map(r=>a.jsx(ga,{icon:a.jsx(Zn,{icon:r.icon,showColors:!0}),value:r.name,label:n===r.name?r.title:xe(m("Transform to %s"),r.title)},r.name))})})}function sWt({blockClientId:e}){const{updateBlockAttributes:t}=Oe(J),{activeBlockVariation:n,variations:o,isContentOnly:r}=G(f=>{const{getActiveBlockVariation:b,getBlockVariations:h}=f(kt),{getBlockName:g,getBlockAttributes:z,getBlockEditingMode:A}=f(J),_=e&&g(e),{hasContentRoleAttribute:v}=ct(f(kt)),M=v(_);return{activeBlockVariation:b(_,z(e)),variations:_&&h(_,"transform"),isContentOnly:A(e)==="contentOnly"&&!M}},[e]),s=n?.name,i=x.useMemo(()=>{const f=new Set;return o?(o.forEach(b=>{b.icon&&f.add(b.icon?.src||b.icon)}),f.size===o.length):!1},[o]),c=f=>{t(e,{...o.find(({name:b})=>b===f).attributes})};if(!o?.length||r)return null;const l="block-editor-block-variation-transforms",d=o.length>5?nWt:rWt,p=i?d:oWt;return a.jsx(p,{className:l,onSelectVariation:c,selectedValue:s,variations:o})}const JR={top:{icon:cQe,title:We("Align top","Block vertical alignment setting")},center:{icon:sQe,title:We("Align middle","Block vertical alignment setting")},bottom:{icon:rQe,title:We("Align bottom","Block vertical alignment setting")},stretch:{icon:aQe,title:We("Stretch to fill","Block vertical alignment setting")},"space-between":{icon:iQe,title:We("Space between","Block vertical alignment setting")}},iWt=["top","center","bottom"],aWt="top";function jze({value:e,onChange:t,controls:n=iWt,isCollapsed:o=!0,isToolbar:r}){function s(d){return()=>t(e===d?void 0:d)}const i=JR[e],c=JR[aWt],l=r?Wn:Lc,u=r?{isCollapsed:o}:{};return a.jsx(l,{icon:i?i.icon:c.icon,label:We("Change vertical alignment","Block vertical alignment setting label"),controls:n.map(d=>({...JR[d],isActive:e===d,role:o?"menuitemradio":void 0,onClick:s(d)})),...u})}const Ize=e=>a.jsx(jze,{...e,isToolbar:!1}),Dze=e=>a.jsx(jze,{...e,isToolbar:!0}),cWt=Or(e=>t=>{const[n,o,r,s,i]=Un("color.palette.default","color.palette.theme","color.palette.custom","color.custom","color.defaultPalette"),c=i?[...o||[],...n||[],...r||[]]:[...o||[],...r||[]],{colors:l=c,disableCustomColors:u=!s}=t,d=l&&l.length>0||!u;return a.jsx(e,{...t,colors:l,disableCustomColors:u,hasColorsToChoose:d})},"withColorContext"),Fze=cWt(Hw);Xs([Gs,Uf]);function Yx({backgroundColor:e,fallbackBackgroundColor:t,fallbackTextColor:n,fallbackLinkColor:o,fontSize:r,isLargeText:s,textColor:i,linkColor:c,enableAlphaChecker:l=!1}){const u=e||t;if(!u)return null;const d=i||n,p=c||o;if(!d&&!p)return null;const f=[{color:d,description:m("text color")},{color:p,description:m("link color")}],b=an(u),h=b.alpha()<1,g=b.brightness(),z={level:"AA",size:s||s!==!1&&r>=24?"large":"small"};let A="",_="";for(const v of f){if(!v.color)continue;const M=an(v.color),y=M.isReadable(b,z),k=M.alpha()<1;if(!y){if(h||k)continue;A=gn(o?null:t)}),e&&a.jsx(lWt,{format:e,onChange:n})]})}function lWt({format:e,onChange:t}){var n;const r=[...[...new Set(["Y-m-d",We("n/j/Y","short date format"),We("n/j/Y g:i A","short date format with time"),We("M j, Y","medium date format"),We("M j, Y g:i A","medium date format with time"),We("F j, Y","long date format"),We("M j","short date format without the year")])].map((l,u)=>({key:`suggested-${u}`,name:r0(l,Ud),format:l})),{key:"human-diff",name:r_(Ud),format:"human-diff"}],s={key:"custom",name:m("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",hint:m("Enter your own date format")},[i,c]=x.useState(()=>!!e&&!r.some(l=>l.format===e));return a.jsxs(dt,{children:[a.jsx(ob,{__next40pxDefaultSize:!0,label:m("Choose a format"),options:[...r,s],value:i?s:(n=r.find(l=>l.format===e))!==null&&n!==void 0?n:s,onChange:({selectedItem:l})=>{l===s?c(!0):(c(!1),t(l.format))}}),i&&a.jsx(dn,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:m("Custom format"),hideLabelFromVision:!0,help:cr(m("Enter a date or time format string."),{Link:a.jsx(hr,{href:m("https://wordpress.org/documentation/article/customize-date-and-time-format/")})}),value:e,onChange:l=>t(l)})]})}function Vze({id:e,colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:s,onChange:i}){let c;s==="unset"?c=a.jsx(eb,{className:"block-editor-duotone-control__unset-indicator"}):s?c=a.jsx(Gbe,{values:s}):c=a.jsx(wn,{icon:LZe});const l=m("Apply duotone filter"),d=`${vt(Vze,"duotone-control",e)}__description`;return a.jsx(so,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:m("Duotone")},renderToggle:({isOpen:p,onToggle:f})=>{const b=h=>{!p&&h.keyCode===Ps&&(h.preventDefault(),f())};return a.jsx(Vt,{showTooltip:!0,onClick:f,"aria-haspopup":"true","aria-expanded":p,onKeyDown:b,label:l,icon:c})},renderContent:()=>a.jsxs(Cn,{label:m("Duotone"),children:[a.jsx("p",{children:m("Create a two-tone color effect without losing your original image.")}),a.jsx(Xbe,{"aria-label":l,"aria-describedby":d,colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:s,onChange:i})]})})}const uWt=({setting:e,children:t,panelId:n,...o})=>{const r=()=>{e.colorValue?e.onColorChange():e.gradientValue&&e.onGradientChange()};return a.jsx(tt,{hasValue:()=>!!e.colorValue||!!e.gradientValue,label:e.label,onDeselect:r,isShownByDefault:e.isShownByDefault!==void 0?e.isShownByDefault:!0,...o,className:"block-editor-tools-panel-color-gradient-settings__item",panelId:n,resetAllFilter:e.resetAllFilter,children:t})},dWt=({colorValue:e,label:t})=>a.jsxs(Ot,{justify:"flex-start",children:[a.jsx(eb,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:e}),a.jsx(Tn,{className:"block-editor-panel-color-gradient-settings__color-name",title:t,children:t})]}),pWt=e=>({onToggle:t,isOpen:n})=>{const{clearable:o,colorValue:r,gradientValue:s,onColorChange:i,onGradientChange:c,label:l}=e,u=x.useRef(void 0),d={onClick:t,className:oe("block-editor-panel-color-gradient-settings__dropdown",{"is-open":n}),"aria-expanded":n,ref:u},p=()=>{r?i():s&&c()},f=r??s;return a.jsxs(a.Fragment,{children:[a.jsx(Ce,{__next40pxDefaultSize:!0,...d,children:a.jsx(dWt,{colorValue:f,label:l})}),o&&f&&a.jsx(Ce,{__next40pxDefaultSize:!0,label:m("Reset"),className:"block-editor-panel-color-gradient-settings__reset",size:"small",icon:am,onClick:()=>{p(),n&&t(),u.current?.focus()}})]})};function Y_({colors:e,disableCustomColors:t,disableCustomGradients:n,enableAlpha:o,gradients:r,settings:s,__experimentalIsRenderedInSidebar:i,...c}){let l;return i&&(l={placement:"left-start",offset:36,shift:!0}),a.jsx(a.Fragment,{children:s.map((u,d)=>{const p={clearable:!1,colorValue:u.colorValue,colors:e,disableCustomColors:t,disableCustomGradients:n,enableAlpha:o,gradientValue:u.gradientValue,gradients:r,label:u.label,onColorChange:u.onColorChange,onGradientChange:u.onGradientChange,showTitle:!1,__experimentalIsRenderedInSidebar:i,...u},f={clearable:u.clearable,label:u.label,colorValue:u.colorValue,gradientValue:u.gradientValue,onColorChange:u.onColorChange,onGradientChange:u.onGradientChange};return u&&a.jsx(uWt,{setting:u,...c,children:a.jsx(so,{popoverProps:l,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:pWt(f),renderContent:()=>a.jsx($s,{paddingSize:"none",children:a.jsx("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:a.jsx(uze,{...p})})})})},d)})})}const Hze=100,Uze=300,Xze={placement:"bottom-start"},fWt={crop:m("Image cropped."),rotate:m("Image rotated."),cropAndRotate:m("Image cropped and rotated.")};function bWt({crop:e,rotation:t,url:n,id:o,onSaveImage:r,onFinishEditing:s}){const{createErrorNotice:i,createSuccessNotice:c}=Oe(mt),[l,u]=x.useState(!1),d=x.useCallback(()=>{u(!1),s()},[s]),p=x.useCallback(()=>{u(!0);const f=[];if(t>0&&f.push({type:"rotate",args:{angle:t}}),(e.width<99.9||e.height<99.9)&&f.push({type:"crop",args:{left:e.x,top:e.y,width:e.width,height:e.height}}),f.length===0){u(!1),s();return}const b=f.length===1?f[0].type:"cropAndRotate";Wt({path:`/wp/v2/media/${o}/edit`,method:"POST",data:{src:n,modifiers:f}}).then(h=>{r({id:h.id,url:h.source_url}),c(fWt[b],{type:"snackbar",actions:[{label:m("Undo"),onClick:()=>{r({id:o,url:n})}}]})}).catch(h=>{i(xe(m("Could not edit image. %s"),x1(h.message)),{id:"image-editing-error",type:"snackbar"})}).finally(()=>{u(!1),s()})},[e,t,o,n,r,i,c,s]);return x.useMemo(()=>({isInProgress:l,apply:p,cancel:d}),[l,p,d])}function hWt({url:e,naturalWidth:t,naturalHeight:n}){const[o,r]=x.useState(),[s,i]=x.useState(),[c,l]=x.useState({x:0,y:0}),[u,d]=x.useState(100),[p,f]=x.useState(0),b=t/n,[h,g]=x.useState(b),z=x.useCallback(()=>{const A=(p+90)%360;let _=b;if(p%180===90&&(_=1/b),A===0){r(),f(A),g(b),l(k=>({x:-(k.y*_),y:k.x*_}));return}function v(k){const S=document.createElement("canvas");let C=0,R=0;A%180?(S.width=k.target.height,S.height=k.target.width):(S.width=k.target.width,S.height=k.target.height),(A===90||A===180)&&(C=S.width),(A===270||A===180)&&(R=S.height);const T=S.getContext("2d");T.translate(C,R),T.rotate(A*Math.PI/180),T.drawImage(k.target,0,0),S.toBlob(E=>{r(URL.createObjectURL(E)),f(A),g(S.width/S.height),l(B=>({x:-(B.y*_),y:B.x*_}))})}const M=new window.Image;M.src=e,M.onload=v;const y=gr("media.crossOrigin",void 0,e);typeof y=="string"&&(M.crossOrigin=y)},[p,b,e]);return x.useMemo(()=>({editedUrl:o,setEditedUrl:r,crop:s,setCrop:i,position:c,setPosition:l,zoom:u,setZoom:d,rotation:p,setRotation:f,rotateClockwise:z,aspect:h,setAspect:g,defaultAspect:b}),[o,s,c,u,p,z,h,b])}const Gze=x.createContext({}),RO=()=>x.useContext(Gze);function mWt({id:e,url:t,naturalWidth:n,naturalHeight:o,onFinishEditing:r,onSaveImage:s,children:i}){const c=hWt({url:t,naturalWidth:n,naturalHeight:o}),l=bWt({id:e,url:t,onSaveImage:s,onFinishEditing:r,...c}),u=x.useMemo(()=>({...c,...l}),[c,l]);return a.jsx(Gze.Provider,{value:u,children:i})}function Mv({aspectRatios:e,isDisabled:t,label:n,onClick:o,value:r}){return a.jsx(Cn,{label:n,children:e.map(({name:s,slug:i,ratio:c})=>a.jsx(Ct,{disabled:t,onClick:()=>{o(c)},role:"menuitemradio",isSelected:c===r,icon:c===r?M0:void 0,children:s},i))})}function gWt(e){const[t,n,...o]=e.split("/").map(Number);return t<=0||n<=0||Number.isNaN(t)||Number.isNaN(n)||o.length?NaN:n?t/n:t}function eT({ratio:e,...t}){return{ratio:gWt(e),...t}}function MWt({toggleProps:e}){const{isInProgress:t,aspect:n,setAspect:o,defaultAspect:r}=RO(),[s,i,c]=Un("dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios");return a.jsx(c0,{icon:zZe,label:m("Aspect Ratio"),popoverProps:Xze,toggleProps:e,children:({onClose:l})=>a.jsxs(a.Fragment,{children:[a.jsx(Mv,{isDisabled:t,onClick:u=>{o(u),l()},value:n,aspectRatios:[{slug:"original",name:m("Original"),aspect:r},...c?s.map(eT).filter(({ratio:u})=>u===1):[]]}),i?.length>0&&a.jsx(Mv,{label:m("Theme"),isDisabled:t,onClick:u=>{o(u),l()},value:n,aspectRatios:i}),c&&a.jsx(Mv,{label:m("Landscape"),isDisabled:t,onClick:u=>{o(u),l()},value:n,aspectRatios:s.map(eT).filter(({ratio:u})=>u>1)}),c&&a.jsx(Mv,{label:m("Portrait"),isDisabled:t,onClick:u=>{o(u),l()},value:n,aspectRatios:s.map(eT).filter(({ratio:u})=>u<1)})]})})}var tT,cte;function zWt(){if(cte)return tT;cte=1;var e=!1,t,n,o,r,s,i,c,l,u,d,p,f,b,h,g;function z(){if(!e){e=!0;var _=navigator.userAgent,v=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(_),M=/(Mac OS X)|(Windows)|(Linux)/.exec(_);if(f=/\b(iPhone|iP[ao]d)/.exec(_),b=/\b(iP[ao]d)/.exec(_),d=/Android/i.exec(_),h=/FBAN\/\w+;/i.exec(_),g=/Mobile/i.exec(_),p=!!/Win64/.exec(_),v){t=v[1]?parseFloat(v[1]):v[5]?parseFloat(v[5]):NaN,t&&document&&document.documentMode&&(t=document.documentMode);var y=/(?:Trident\/(\d+.\d+))/.exec(_);i=y?parseFloat(y[1])+4:t,n=v[2]?parseFloat(v[2]):NaN,o=v[3]?parseFloat(v[3]):NaN,r=v[4]?parseFloat(v[4]):NaN,r?(v=/(?:Chrome\/(\d+\.\d+))/.exec(_),s=v&&v[1]?parseFloat(v[1]):NaN):s=NaN}else t=n=o=s=r=NaN;if(M){if(M[1]){var k=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(_);c=k?parseFloat(k[1].replace("_",".")):!0}else c=!1;l=!!M[2],u=!!M[3]}else c=l=u=!1}}var A={ie:function(){return z()||t},ieCompatibilityMode:function(){return z()||i>t},ie64:function(){return A.ie()&&p},firefox:function(){return z()||n},opera:function(){return z()||o},webkit:function(){return z()||r},safari:function(){return A.webkit()},chrome:function(){return z()||s},windows:function(){return z()||l},osx:function(){return z()||c},linux:function(){return z()||u},iphone:function(){return z()||f},mobile:function(){return z()||f||b||d||g},nativeApp:function(){return z()||h},android:function(){return z()||d},ipad:function(){return z()||b}};return tT=A,tT}var nT,lte;function OWt(){if(lte)return nT;lte=1;var e=!!(typeof window<"u"&&window.document&&window.document.createElement),t={canUseDOM:e,canUseWorkers:typeof Worker<"u",canUseEventListeners:e&&!!(window.addEventListener||window.attachEvent),canUseViewport:e&&!!window.screen,isInWorker:!e};return nT=t,nT}var oT,ute;function yWt(){if(ute)return oT;ute=1;var e=OWt(),t;e.canUseDOM&&(t=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0);/** * Checks if an event is supported in the current execution environment. * * NOTE: This will not work correctly for non-generic events such as `change`, @@ -612,7 +612,7 @@ The screen with id ${t.id} will not be added.`),e):[...e,t]}function Bbt({screen * @return {boolean} True if the event is supported. * @internal * @license Modernizr 3.0.0pre (Custom Build) | MIT - */function n(o,r){if(!e.canUseDOM||r&&!("addEventListener"in document))return!1;var s="on"+o,i=s in document;if(!i){var c=document.createElement("div");c.setAttribute(s,"return;"),i=typeof c[s]=="function"}return!i&&t&&o==="wheel"&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}return oT=n,oT}var rT,dte;function AWt(){if(dte)return rT;dte=1;var e=zWt(),t=yWt(),n=10,o=40,r=800;function s(i){var c=0,l=0,u=0,d=0;return"detail"in i&&(l=i.detail),"wheelDelta"in i&&(l=-i.wheelDelta/120),"wheelDeltaY"in i&&(l=-i.wheelDeltaY/120),"wheelDeltaX"in i&&(c=-i.wheelDeltaX/120),"axis"in i&&i.axis===i.HORIZONTAL_AXIS&&(c=l,l=0),u=c*n,d=l*n,"deltaY"in i&&(d=i.deltaY),"deltaX"in i&&(u=i.deltaX),(u||d)&&i.deltaMode&&(i.deltaMode==1?(u*=o,d*=o):(u*=r,d*=r)),u&&!c&&(c=u<1?-1:1),d&&!l&&(l=d<1?-1:1),{spinX:c,spinY:l,pixelX:u,pixelY:d}}return s.getEventType=function(){return e.firefox()?"DOMMouseScroll":t("wheel")?"wheel":"mousewheel"},rT=s,rT}var sT,pte;function vWt(){return pte||(pte=1,sT=AWt()),sT}var xWt=vWt();const wWt=Zr(xWt);function _Wt(e,t,n,o,r,s){s===void 0&&(s=0);var i=Ch(e,t,s),c=i.width,l=i.height,u=Math.min(c,n),d=Math.min(l,o);return u>d*r?{width:d*r,height:d}:{width:u,height:u/r}}function kWt(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}function $g(e,t,n,o,r){r===void 0&&(r=0);var s=Ch(t.width,t.height,r),i=s.width,c=s.height;return{x:fte(e.x,i,n.width,o),y:fte(e.y,c,n.height,o)}}function fte(e,t,n,o){var r=t*o/2-n/2;return Z_(e,-r,r)}function bte(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function hte(e,t){return Math.atan2(t.y-e.y,t.x-e.x)*180/Math.PI}function SWt(e,t,n,o,r,s,i){s===void 0&&(s=0),i===void 0&&(i=!0);var c=i?CWt:qWt,l=Ch(t.width,t.height,s),u=Ch(t.naturalWidth,t.naturalHeight,s),d={x:c(100,((l.width-n.width/r)/2-e.x/r)/l.width*100),y:c(100,((l.height-n.height/r)/2-e.y/r)/l.height*100),width:c(100,n.width/l.width*100/r),height:c(100,n.height/l.height*100/r)},p=Math.round(c(u.width,d.width*u.width/100)),f=Math.round(c(u.height,d.height*u.height/100)),b=u.width>=u.height*o,h=b?{width:Math.round(f*o),height:f}:{width:p,height:Math.round(p/o)},g=Pr(Pr({},h),{x:Math.round(c(u.width-h.width,d.x*u.width/100)),y:Math.round(c(u.height-h.height,d.y*u.height/100))});return{croppedAreaPercentages:d,croppedAreaPixels:g}}function CWt(e,t){return Math.min(e,Math.max(0,t))}function qWt(e,t){return t}function RWt(e,t,n,o,r,s){var i=Ch(t.width,t.height,n),c=Z_(o.width/i.width*(100/e.width),r,s),l={x:c*i.width/2-o.width/2-i.width*c*(e.x/100),y:c*i.height/2-o.height/2-i.height*c*(e.y/100)};return{crop:l,zoom:c}}function TWt(e,t,n){var o=kWt(t);return n.height>n.width?n.height/(e.height*o):n.width/(e.width*o)}function EWt(e,t,n,o,r,s){n===void 0&&(n=0);var i=Ch(t.naturalWidth,t.naturalHeight,n),c=Z_(TWt(e,t,o),r,s),l=o.height>o.width?o.height/e.height:o.width/e.width,u={x:((i.width-e.width)/2-e.x)*l,y:((i.height-e.height)/2-e.y)*l};return{crop:u,zoom:c}}function mte(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function WWt(e){return e*Math.PI/180}function Ch(e,t,n){var o=WWt(n);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 Z_(e,t,n){return Math.min(Math.max(e,t),n)}function zv(){for(var e=[],t=0;t0}).join(" ").trim()}var NWt=`.reactEasyCrop_Container { + */function n(o,r){if(!e.canUseDOM||r&&!("addEventListener"in document))return!1;var s="on"+o,i=s in document;if(!i){var c=document.createElement("div");c.setAttribute(s,"return;"),i=typeof c[s]=="function"}return!i&&t&&o==="wheel"&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}return oT=n,oT}var rT,dte;function AWt(){if(dte)return rT;dte=1;var e=zWt(),t=yWt(),n=10,o=40,r=800;function s(i){var c=0,l=0,u=0,d=0;return"detail"in i&&(l=i.detail),"wheelDelta"in i&&(l=-i.wheelDelta/120),"wheelDeltaY"in i&&(l=-i.wheelDeltaY/120),"wheelDeltaX"in i&&(c=-i.wheelDeltaX/120),"axis"in i&&i.axis===i.HORIZONTAL_AXIS&&(c=l,l=0),u=c*n,d=l*n,"deltaY"in i&&(d=i.deltaY),"deltaX"in i&&(u=i.deltaX),(u||d)&&i.deltaMode&&(i.deltaMode==1?(u*=o,d*=o):(u*=r,d*=r)),u&&!c&&(c=u<1?-1:1),d&&!l&&(l=d<1?-1:1),{spinX:c,spinY:l,pixelX:u,pixelY:d}}return s.getEventType=function(){return e.firefox()?"DOMMouseScroll":t("wheel")?"wheel":"mousewheel"},rT=s,rT}var sT,pte;function vWt(){return pte||(pte=1,sT=AWt()),sT}var xWt=vWt();const wWt=Zr(xWt);function _Wt(e,t,n,o,r,s){s===void 0&&(s=0);var i=Ch(e,t,s),c=i.width,l=i.height,u=Math.min(c,n),d=Math.min(l,o);return u>d*r?{width:d*r,height:d}:{width:u,height:u/r}}function kWt(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}function $g(e,t,n,o,r){r===void 0&&(r=0);var s=Ch(t.width,t.height,r),i=s.width,c=s.height;return{x:fte(e.x,i,n.width,o),y:fte(e.y,c,n.height,o)}}function fte(e,t,n,o){var r=t*o/2-n/2;return Z_(e,-r,r)}function bte(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function hte(e,t){return Math.atan2(t.y-e.y,t.x-e.x)*180/Math.PI}function SWt(e,t,n,o,r,s,i){s===void 0&&(s=0),i===void 0&&(i=!0);var c=i?CWt:qWt,l=Ch(t.width,t.height,s),u=Ch(t.naturalWidth,t.naturalHeight,s),d={x:c(100,((l.width-n.width/r)/2-e.x/r)/l.width*100),y:c(100,((l.height-n.height/r)/2-e.y/r)/l.height*100),width:c(100,n.width/l.width*100/r),height:c(100,n.height/l.height*100/r)},p=Math.round(c(u.width,d.width*u.width/100)),f=Math.round(c(u.height,d.height*u.height/100)),b=u.width>=u.height*o,h=b?{width:Math.round(f*o),height:f}:{width:p,height:Math.round(p/o)},g=Lr(Lr({},h),{x:Math.round(c(u.width-h.width,d.x*u.width/100)),y:Math.round(c(u.height-h.height,d.y*u.height/100))});return{croppedAreaPercentages:d,croppedAreaPixels:g}}function CWt(e,t){return Math.min(e,Math.max(0,t))}function qWt(e,t){return t}function RWt(e,t,n,o,r,s){var i=Ch(t.width,t.height,n),c=Z_(o.width/i.width*(100/e.width),r,s),l={x:c*i.width/2-o.width/2-i.width*c*(e.x/100),y:c*i.height/2-o.height/2-i.height*c*(e.y/100)};return{crop:l,zoom:c}}function TWt(e,t,n){var o=kWt(t);return n.height>n.width?n.height/(e.height*o):n.width/(e.width*o)}function EWt(e,t,n,o,r,s){n===void 0&&(n=0);var i=Ch(t.naturalWidth,t.naturalHeight,n),c=Z_(TWt(e,t,o),r,s),l=o.height>o.width?o.height/e.height:o.width/e.width,u={x:((i.width-e.width)/2-e.x)*l,y:((i.height-e.height)/2-e.y)*l};return{crop:u,zoom:c}}function mte(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function WWt(e){return e*Math.PI/180}function Ch(e,t,n){var o=WWt(n);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 Z_(e,t,n){return Math.min(Math.max(e,t),n)}function zv(){for(var e=[],t=0;t0}).join(" ").trim()}var NWt=`.reactEasyCrop_Container { position: absolute; top: 0; left: 0; @@ -692,15 +692,15 @@ The screen with id ${t.id} will not be added.`),e):[...e,t]}function Bbt({screen border-left: 0; border-right: 0; } -`,BWt=1,LWt=3,PWt=1,jWt=function(e){hke(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.imageRef=x.createRef(),n.videoRef=x.createRef(),n.containerPosition={x:0,y:0},n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc=typeof document<"u"?document:null,n.currentWindow=typeof window<"u"?window:null,n.resizeObserver=null,n.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},n.initResizeObserver=function(){if(!(typeof window.ResizeObserver>"u"||!n.containerRef)){var o=!0;n.resizeObserver=new window.ResizeObserver(function(r){if(o){o=!1;return}n.computeSizes()}),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(o){return o.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd),n.currentDoc.removeEventListener("scroll",n.onScroll))},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var o=n.computeSizes();o&&(n.emitCropData(),n.setInitialCrop(o)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(o){if(n.props.initialCroppedAreaPercentages){var r=RWt(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,o,n.props.minZoom,n.props.maxZoom),s=r.crop,i=r.zoom;n.props.onCropChange(s),n.props.onZoomChange&&n.props.onZoomChange(i)}else if(n.props.initialCroppedAreaPixels){var c=EWt(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,o,n.props.minZoom,n.props.maxZoom),s=c.crop,i=c.zoom;n.props.onCropChange(s),n.props.onZoomChange&&n.props.onZoomChange(i)}},n.computeSizes=function(){var o,r,s,i,c,l,u=n.imageRef.current||n.videoRef.current;if(u&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect(),n.saveContainerPosition();var d=n.containerRect.width/n.containerRect.height,p=((o=n.imageRef.current)===null||o===void 0?void 0:o.naturalWidth)||((r=n.videoRef.current)===null||r===void 0?void 0:r.videoWidth)||0,f=((s=n.imageRef.current)===null||s===void 0?void 0:s.naturalHeight)||((i=n.videoRef.current)===null||i===void 0?void 0:i.videoHeight)||0,b=u.offsetWidthh?{width:n.containerRect.height*h,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/h};break;case"horizontal-cover":g={width:n.containerRect.width,height:n.containerRect.width/h};break;case"vertical-cover":g={width:n.containerRect.height*h,height:n.containerRect.height};break}else g={width:u.offsetWidth,height:u.offsetHeight};n.mediaSize=Pr(Pr({},g),{naturalWidth:p,naturalHeight:f}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var z=n.props.cropSize?n.props.cropSize:_Wt(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(((c=n.state.cropSize)===null||c===void 0?void 0:c.height)!==z.height||((l=n.state.cropSize)===null||l===void 0?void 0:l.width)!==z.width)&&n.props.onCropSizeChange&&n.props.onCropSizeChange(z),n.setState({cropSize:z},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(z),z}},n.saveContainerPosition=function(){if(n.containerRef){var o=n.containerRef.getBoundingClientRect();n.containerPosition={x:o.left,y:o.top}}},n.onMouseDown=function(o){n.currentDoc&&(o.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.saveContainerPosition(),n.onDragStart(t.getMousePoint(o)))},n.onMouseMove=function(o){return n.onDrag(t.getMousePoint(o))},n.onScroll=function(o){n.currentDoc&&(o.preventDefault(),n.saveContainerPosition())},n.onTouchStart=function(o){n.currentDoc&&(n.isTouching=!0,!(n.props.onTouchRequest&&!n.props.onTouchRequest(o))&&(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),n.saveContainerPosition(),o.touches.length===2?n.onPinchStart(o):o.touches.length===1&&n.onDragStart(t.getTouchPoint(o.touches[0]))))},n.onTouchMove=function(o){o.preventDefault(),o.touches.length===2?n.onPinchMove(o):o.touches.length===1&&n.onDrag(t.getTouchPoint(o.touches[0]))},n.onGestureStart=function(o){n.currentDoc&&(o.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(o){if(o.preventDefault(),!n.isTouching){var r=t.getMousePoint(o),s=n.gestureZoomStart-1+o.scale;if(n.setNewZoom(s,r,{shouldUpdatePosition:!0}),n.props.onRotationChange){var i=n.gestureRotationStart+o.rotation;n.props.onRotationChange(i)}}},n.onGestureEnd=function(o){n.cleanEvents()},n.onDragStart=function(o){var r,s,i=o.x,c=o.y;n.dragStartPosition={x:i,y:c},n.dragStartCrop=Pr({},n.props.crop),(s=(r=n.props).onInteractionStart)===null||s===void 0||s.call(r)},n.onDrag=function(o){var r=o.x,s=o.y;n.currentWindow&&(n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame(function(){if(n.state.cropSize&&!(r===void 0||s===void 0)){var i=r-n.dragStartPosition.x,c=s-n.dragStartPosition.y,l={x:n.dragStartCrop.x+i,y:n.dragStartCrop.y+c},u=n.props.restrictPosition?$g(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(u)}}))},n.onDragStopped=function(){var o,r;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),(r=(o=n.props).onInteractionEnd)===null||r===void 0||r.call(o)},n.onWheel=function(o){if(n.currentWindow&&!(n.props.onWheelRequest&&!n.props.onWheelRequest(o))){o.preventDefault();var r=t.getMousePoint(o),s=wWt(o).pixelY,i=n.props.zoom-s*n.props.zoomSpeed/200;n.setNewZoom(i,r,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},function(){var c,l;return(l=(c=n.props).onInteractionStart)===null||l===void 0?void 0:l.call(c)}),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout(function(){return n.setState({hasWheelJustStarted:!1},function(){var c,l;return(l=(c=n.props).onInteractionEnd)===null||l===void 0?void 0:l.call(c)})},250)}},n.getPointOnContainer=function(o,r){var s=o.x,i=o.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(s-r.x),y:n.containerRect.height/2-(i-r.y)}},n.getPointOnMedia=function(o){var r=o.x,s=o.y,i=n.props,c=i.crop,l=i.zoom;return{x:(r+c.x)/l,y:(s+c.y)/l}},n.setNewZoom=function(o,r,s){var i=s===void 0?{}:s,c=i.shouldUpdatePosition,l=c===void 0?!0:c;if(!(!n.state.cropSize||!n.props.onZoomChange)){var u=Z_(o,n.props.minZoom,n.props.maxZoom);if(l){var d=n.getPointOnContainer(r,n.containerPosition),p=n.getPointOnMedia(d),f={x:p.x*u-d.x,y:p.y*u-d.y},b=n.props.restrictPosition?$g(f,n.mediaSize,n.state.cropSize,u,n.props.rotation):f;n.props.onCropChange(b)}n.props.onZoomChange(u)}},n.getCropData=function(){if(!n.state.cropSize)return null;var o=n.props.restrictPosition?$g(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;return SWt(o,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition)},n.emitCropData=function(){var o=n.getCropData();if(o){var r=o.croppedAreaPercentages,s=o.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(r,s),n.props.onCropAreaChange&&n.props.onCropAreaChange(r,s)}},n.emitCropAreaChange=function(){var o=n.getCropData();if(o){var r=o.croppedAreaPercentages,s=o.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(r,s)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var o=n.props.restrictPosition?$g(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(o),n.emitCropData()}},n.onKeyDown=function(o){var r=n.props,s=r.crop,i=r.onCropChange,c=r.keyboardStep,l=r.zoom,u=r.rotation,d=c;if(n.state.cropSize){var p=Pr({},s);switch(o.key){case"ArrowUp":p.y-=d;break;case"ArrowDown":p.y+=d;break;case"ArrowLeft":p.x-=d;break;case"ArrowRight":p.x+=d;break;default:return}n.props.restrictPosition&&(p=$g(p,n.mediaSize,n.state.cropSize,l,u)),i(p)}},n}return 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(),typeof window.ResizeObserver>"u"&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=NWt,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 n,o;!this.currentDoc||!this.currentWindow||(typeof window.ResizeObserver>"u"&&this.currentWindow.removeEventListener("resize",this.computeSizes),(n=this.resizeObserver)===null||n===void 0||n.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((o=this.styleRef.parentNode)===null||o===void 0||o.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(n){var o,r,s,i,c,l,u,d,p;n.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):n.aspect!==this.props.aspect?this.computeSizes():n.objectFit!==this.props.objectFit?this.computeSizes():n.zoom!==this.props.zoom?this.recomputeCropPosition():((o=n.cropSize)===null||o===void 0?void 0:o.height)!==((r=this.props.cropSize)===null||r===void 0?void 0:r.height)||((s=n.cropSize)===null||s===void 0?void 0:s.width)!==((i=this.props.cropSize)===null||i===void 0?void 0:i.width)?this.computeSizes():(((c=n.crop)===null||c===void 0?void 0:c.x)!==((l=this.props.crop)===null||l===void 0?void 0:l.x)||((u=n.crop)===null||u===void 0?void 0:u.y)!==((d=this.props.crop)===null||d===void 0?void 0:d.y))&&this.emitCropAreaChange(),n.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),n.video!==this.props.video&&((p=this.videoRef.current)===null||p===void 0||p.load());var f=this.getObjectFit();f!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:f},this.computeSizes)},t.prototype.getAspect=function(){var n=this.props,o=n.cropSize,r=n.aspect;return o?o.width/o.height:r},t.prototype.getObjectFit=function(){var n,o,r,s;if(this.props.objectFit==="cover"){var i=this.imageRef.current||this.videoRef.current;if(i&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var c=this.containerRect.width/this.containerRect.height,l=((n=this.imageRef.current)===null||n===void 0?void 0:n.naturalWidth)||((o=this.videoRef.current)===null||o===void 0?void 0:o.videoWidth)||0,u=((r=this.imageRef.current)===null||r===void 0?void 0:r.naturalHeight)||((s=this.videoRef.current)===null||s===void 0?void 0:s.videoHeight)||0,d=l/u;return d{p(v)},onCropComplete:v=>{f(v)},onZoomChange:v=>{b(v*100)}}),i&&a.jsx(Xn,{})]});return a.jsxs(a.Fragment,{children:[g,_]})}function DWt(){const{isInProgress:e,zoom:t,setZoom:n}=RO();return a.jsx(so,{contentClassName:"wp-block-image__zoom",popoverProps:Xze,renderToggle:({isOpen:o,onToggle:r})=>a.jsx(Vt,{icon:Pw,label:m("Zoom"),onClick:r,"aria-expanded":o,disabled:e}),renderContent:()=>a.jsx($s,{paddingSize:"medium",children:a.jsx(bo,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:m("Zoom"),min:Hze,max:Uze,value:Math.round(t),onChange:n})})})}function FWt(){const{isInProgress:e,rotateClockwise:t}=RO();return a.jsx(Vt,{icon:Ede,label:m("Rotate"),onClick:t,disabled:e})}function $Wt(){const{isInProgress:e,apply:t,cancel:n}=RO();return a.jsxs(a.Fragment,{children:[a.jsx(Vt,{onClick:t,disabled:e,children:m("Apply")}),a.jsx(Vt,{onClick:n,children:m("Cancel")})]})}function Kze({id:e,url:t,width:n,height:o,naturalHeight:r,naturalWidth:s,onSaveImage:i,onFinishEditing:c,borderProps:l}){return a.jsxs(mWt,{id:e,url:t,naturalWidth:s,naturalHeight:r,onSaveImage:i,onFinishEditing:c,children:[a.jsx(IWt,{borderProps:l,url:t,width:n,height:o,naturalHeight:r,naturalWidth:s}),a.jsxs(bt,{children:[a.jsxs(Wn,{children:[a.jsx(DWt,{}),a.jsx(bs,{children:u=>a.jsx(MWt,{toggleProps:u})}),a.jsx(FWt,{})]}),a.jsx(Wn,{children:a.jsx($Wt,{})})]})]})}function VWt(e,t,n,o,r){var s,i;const[c,l]=x.useState((s=t??o)!==null&&s!==void 0?s:""),[u,d]=x.useState((i=e??n)!==null&&i!==void 0?i:"");return x.useEffect(()=>{t===void 0&&o!==void 0&&l(o),e===void 0&&n!==void 0&&d(n)},[o,n]),x.useEffect(()=>{t!==void 0&&Number.parseInt(t)!==Number.parseInt(c)&&l(t),e!==void 0&&Number.parseInt(e)!==Number.parseInt(u)&&d(e)},[t,e]),{currentHeight:u,currentWidth:c,updateDimension:(b,h)=>{const g=h===""?void 0:parseInt(h,10);b==="width"?l(g):d(g),r({[b]:g})},updateDimensions:(b,h)=>{d(b??n),l(h??o),r({height:b,width:h})}}}const gte=[25,50,75,100],HWt=()=>{};function Mte(e,t,n){const o=Math.round(t*(e/100)),r=Math.round(n*(e/100));return{scaledWidth:o,scaledHeight:r}}function UWt({imageSizeHelp:e,imageWidth:t,imageHeight:n,imageSizeOptions:o=[],isResizable:r=!0,slug:s,width:i,height:c,onChange:l,onChangeImage:u=HWt}){const{currentHeight:d,currentWidth:p,updateDimension:f,updateDimensions:b}=VWt(c,i,n,t,l),h=z=>{if(z===void 0){b();return}const{scaledWidth:A,scaledHeight:_}=Mte(z,t,n);b(_,A)},g=gte.find(z=>{const{scaledWidth:A,scaledHeight:_}=Mte(z,t,n);return p===A&&d===_});return a.jsxs(a.Fragment,{children:[o&&o.length>0&&a.jsx(Pn,{__nextHasNoMarginBottom:!0,label:m("Resolution"),value:s,options:o,onChange:u,help:e,size:"__unstable-large"}),r&&a.jsxs("div",{className:"block-editor-image-size-control",children:[a.jsxs(Ot,{align:"baseline",spacing:"3",children:[a.jsx(g0,{className:"block-editor-image-size-control__width",label:m("Width"),value:p,min:1,onChange:z=>f("width",z),size:"__unstable-large"}),a.jsx(g0,{className:"block-editor-image-size-control__height",label:m("Height"),value:d,min:1,onChange:z=>f("height",z),size:"__unstable-large"})]}),a.jsx(Do,{label:m("Image size presets"),hideLabelFromVision:!0,onChange:h,value:g,isBlock:!0,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,children:gte.map(z=>a.jsx(Kn,{value:z,label:xe(m("%d%%"),z)},z))})]})]})}const zte={left:Tw,center:Ew,right:Ww,"space-between":NP,stretch:BP};function XWt({allowedControls:e=["left","center","right","space-between"],isCollapsed:t=!0,onChange:n,value:o,popoverProps:r,isToolbar:s}){const i=p=>{n(p===o?void 0:p)},c=o?zte[o]:zte.left,l=[{name:"left",icon:Tw,title:m("Justify items left"),isActive:o==="left",onClick:()=>i("left")},{name:"center",icon:Ew,title:m("Justify items center"),isActive:o==="center",onClick:()=>i("center")},{name:"right",icon:Ww,title:m("Justify items right"),isActive:o==="right",onClick:()=>i("right")},{name:"space-between",icon:NP,title:m("Space between items"),isActive:o==="space-between",onClick:()=>i("space-between")},{name:"stretch",icon:BP,title:m("Stretch items"),isActive:o==="stretch",onClick:()=>i("stretch")}],u=s?Wn:Lc,d=s?{isCollapsed:t}:{};return a.jsx(u,{icon:c,popoverProps:r,label:m("Change items justification"),controls:l.filter(p=>e.includes(p.name)),...d})}const Yze=e=>a.jsx(XWt,{...e,isToolbar:!1});function GWt({url:e,urlLabel:t,className:n}){const o=oe(n,"block-editor-url-popover__link-viewer-url");return e?a.jsx(hr,{className:o,href:e,children:t||Ph(c3(e))}):a.jsx("span",{className:o})}function KWt({className:e,linkClassName:t,onEditLinkClick:n,url:o,urlLabel:r,...s}){return a.jsxs("div",{className:oe("block-editor-url-popover__link-viewer",e),...s,children:[a.jsx(GWt,{url:o,urlLabel:r,className:t}),n&&a.jsx(Ce,{icon:Nd,label:m("Edit"),onClick:n,size:"compact"})]})}function Zze(e){return typeof e=="function"}class YWt extends x.Component{constructor(t){super(t),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=t.autocompleteRef||x.createRef(),this.inputRef=x.createRef(),this.updateSuggestions=F1(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.suggestionsRequest=null,this.state={suggestions:[],showSuggestions:!1,suggestionsValue:null,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(t){const{showSuggestions:n,selectedSuggestion:o}=this.state,{value:r,__experimentalShowInitialSuggestions:s=!1}=this.props;n&&o!==null&&this.suggestionNodes[o]&&this.suggestionNodes[o].scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"}),t.value!==r&&!this.props.disableSuggestions&&(r?.length?this.updateSuggestions(r):s&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){this.suggestionsRequest?.cancel?.(),this.suggestionsRequest=null}bindSuggestionNode(t){return n=>{this.suggestionNodes[t]=n}}shouldShowInitialSuggestions(){const{__experimentalShowInitialSuggestions:t=!1,value:n}=this.props;return t&&!(n&&n.length)}updateSuggestions(t=""){const{__experimentalFetchLinkSuggestions:n,__experimentalHandleURLSuggestions:o}=this.props;if(!n)return;const r=!t?.length;if(t=t.trim(),!r&&(t.length<2||!o&&Pf(t))){this.suggestionsRequest?.cancel?.(),this.suggestionsRequest=null,this.setState({suggestions:[],showSuggestions:!1,suggestionsValue:t,selectedSuggestion:null,loading:!1});return}this.setState({selectedSuggestion:null,loading:!0});const s=n(t,{isInitialSuggestions:r});s.then(i=>{this.suggestionsRequest===s&&(this.setState({suggestions:i,suggestionsValue:t,loading:!1,showSuggestions:!!i.length}),i.length?this.props.debouncedSpeak(xe(Dn("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",i.length),i.length),"assertive"):this.props.debouncedSpeak(m("No results."),"assertive"))}).catch(()=>{this.suggestionsRequest===s&&this.setState({loading:!1})}).finally(()=>{this.suggestionsRequest===s&&(this.suggestionsRequest=null)}),this.suggestionsRequest=s}onChange(t){this.props.onChange(t)}onFocus(){const{suggestions:t}=this.state,{disableSuggestions:n,value:o}=this.props;o&&!n&&!(t&&t.length)&&this.suggestionsRequest===null&&this.updateSuggestions(o)}onKeyDown(t){this.props.onKeyDown?.(t);const{showSuggestions:n,selectedSuggestion:o,suggestions:r,loading:s}=this.state;if(!n||!r.length||s){switch(t.keyCode){case cc:{t.target.selectionStart!==0&&(t.preventDefault(),t.target.setSelectionRange(0,0));break}case Ps:{this.props.value.length!==t.target.selectionStart&&(t.preventDefault(),t.target.setSelectionRange(this.props.value.length,this.props.value.length));break}case Gr:{this.props.onSubmit&&(t.preventDefault(),this.props.onSubmit(null,t));break}}return}const i=this.state.suggestions[this.state.selectedSuggestion];switch(t.keyCode){case cc:{t.preventDefault();const c=o?o-1:r.length-1;this.setState({selectedSuggestion:c});break}case Ps:{t.preventDefault();const c=o===null||o===r.length-1?0:o+1;this.setState({selectedSuggestion:c});break}case Z2:{this.state.selectedSuggestion!==null&&(this.selectLink(i),this.props.speak(m("Link selected.")));break}case Gr:{t.preventDefault(),this.state.selectedSuggestion!==null?(this.selectLink(i),this.props.onSubmit&&this.props.onSubmit(i,t)):this.props.onSubmit&&this.props.onSubmit(null,t);break}}}selectLink(t){this.props.onChange(t.url,t),this.setState({selectedSuggestion:null,showSuggestions:!1})}handleOnClick(t){this.selectLink(t),this.inputRef.current.focus()}static getDerivedStateFromProps({value:t,instanceId:n,disableSuggestions:o,__experimentalShowInitialSuggestions:r=!1},{showSuggestions:s}){let i=s;const c=t&&t.length;return!r&&!c&&(i=!1),o===!0&&(i=!1),{showSuggestions:i,suggestionsListboxId:`block-editor-url-input-suggestions-${n}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${n}`}}render(){return a.jsxs(a.Fragment,{children:[this.renderControl(),this.renderSuggestions()]})}renderControl(){const{label:t=null,className:n,isFullWidth:o,instanceId:r,placeholder:s=m("Paste URL or type to search"),__experimentalRenderControl:i,value:c="",hideLabelFromVision:l=!1}=this.props,{loading:u,showSuggestions:d,selectedSuggestion:p,suggestionsListboxId:f,suggestionOptionIdPrefix:b}=this.state,h=`url-input-control-${r}`,g={id:h,label:t,className:oe("block-editor-url-input",n,{"is-full-width":o}),hideLabelFromVision:l},z={id:h,value:c,required:!0,type:"text",onChange:this.onChange,onFocus:this.onFocus,placeholder:s,onKeyDown:this.onKeyDown,role:"combobox","aria-label":t?void 0:m("URL"),"aria-expanded":d,"aria-autocomplete":"list","aria-owns":f,"aria-activedescendant":p!==null?`${b}-${p}`:void 0,ref:this.inputRef,suffix:this.props.suffix};return i?i(g,z,u):a.jsxs(no,{__nextHasNoMarginBottom:!0,...g,children:[a.jsx(B1,{...z,__next40pxDefaultSize:!0}),u&&a.jsx(Xn,{})]})}renderSuggestions(){const{className:t,__experimentalRenderSuggestions:n}=this.props,{showSuggestions:o,suggestions:r,suggestionsValue:s,selectedSuggestion:i,suggestionsListboxId:c,suggestionOptionIdPrefix:l,loading:u}=this.state;if(!o||r.length===0)return null;const d={id:c,ref:this.autocompleteRef,role:"listbox"},p=(f,b)=>({role:"option",tabIndex:"-1",id:`${l}-${b}`,ref:this.bindSuggestionNode(b),"aria-selected":b===i?!0:void 0});return Zze(n)?n({suggestions:r,selectedSuggestion:i,suggestionsListProps:d,buildSuggestionItemProps:p,isLoading:u,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:!s?.length,currentInputValue:s}):a.jsx(Io,{placement:"bottom",focusOnMount:!1,children:a.jsx("div",{...d,className:oe("block-editor-url-input__suggestions",{[`${t}__suggestions`]:t}),children:r.map((f,b)=>x.createElement(Ce,{__next40pxDefaultSize:!0,...p(f,b),key:f.id,className:oe("block-editor-url-input__suggestion",{"is-selected":b===i}),onClick:()=>this.handleOnClick(f)},f.title))})})}}const dI=Co(iSe,bbt,sSe,Ul((e,t)=>{if(Zze(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(J);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}}))(YWt);function ZWt({autocompleteRef:e,className:t,onChangeInputValue:n,value:o,...r}){return a.jsxs("form",{className:oe("block-editor-url-popover__link-editor",t),...r,children:[a.jsx(dI,{value:o,onChange:n,autocompleteRef:e}),a.jsx(Ce,{icon:Nw,label:m("Apply"),type:"submit",size:"compact"})]})}const{__experimentalPopoverLegacyPositionToPlacement:QWt}=ct(tr),JWt="bottom",lf=x.forwardRef(({additionalControls:e,children:t,renderSettings:n,placement:o,focusOnMount:r="firstElement",position:s,...i},c)=>{s!==void 0&&Ke("`position` prop in wp.blockEditor.URLPopover",{since:"6.2",alternative:"`placement` prop"});let l;o!==void 0?l=o:s!==void 0&&(l=QWt(s)),l=l||JWt;const[u,d]=x.useState(!1),p=!!n&&u,f=()=>{d(!u)};return a.jsxs(Io,{ref:c,role:"dialog","aria-modal":"true","aria-label":m("Edit URL"),className:"block-editor-url-popover",focusOnMount:r,placement:l,shift:!0,variant:"toolbar",...i,children:[a.jsx("div",{className:"block-editor-url-popover__input-container",children:a.jsxs("div",{className:"block-editor-url-popover__row",children:[t,!!n&&a.jsx(Ce,{className:"block-editor-url-popover__settings-toggle",icon:tu,label:m("Link settings"),onClick:f,"aria-expanded":u,size:"compact"})]})}),p&&a.jsx("div",{className:"block-editor-url-popover__settings",children:n()}),e&&!p&&a.jsx("div",{className:"block-editor-url-popover__additional-controls",children:e})]})});lf.LinkEditor=ZWt;lf.LinkViewer=KWt;const eNt=()=>{},tNt=({src:e,onChange:t,onSubmit:n,onClose:o,popoverAnchor:r})=>a.jsx(lf,{anchor:r,onClose:o,children:a.jsx("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:n,children:a.jsx(B1,{__next40pxDefaultSize:!0,label:m("URL"),type:"url",hideLabelFromVision:!0,placeholder:m("Paste or type URL"),onChange:t,value:e,suffix:a.jsx(eO,{variant:"control",children:a.jsx(Ce,{size:"small",icon:Nw,label:m("Apply"),type:"submit"})})})})}),nNt=({src:e,onChangeSrc:t,onSelectURL:n})=>{const[o,r]=x.useState(null),[s,i]=x.useState(!1),c=()=>{i(!0)},l=()=>{i(!1),o?.focus()},u=d=>{d.preventDefault(),e&&n&&(n(e),l())};return a.jsxs("div",{className:"block-editor-media-placeholder__url-input-container",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__button",onClick:c,isPressed:s,variant:"secondary","aria-haspopup":"dialog",ref:r,children:m("Insert from URL")}),s&&a.jsx(tNt,{src:e,onChange:t,onSubmit:u,onClose:l,popoverAnchor:o})]})};function oNt({value:e={},allowedTypes:t,className:n,icon:o,labels:r={},mediaPreview:s,notices:i,isAppender:c,accept:l,addToGallery:u,multiple:d=!1,handleUpload:p=!0,disableDropZone:f,disableMediaButtons:b,onError:h,onSelect:g,onCancel:z,onSelectURL:A,onToggleFeaturedImage:_,onDoubleClick:v,onFilesPreUpload:M=eNt,onHTMLDrop:y,children:k,mediaLibraryButton:S,placeholder:C,style:R}){y&&Ke("wp.blockEditor.MediaPlaceholder onHTMLDrop prop",{since:"6.2",version:"6.4"});const T=G(ee=>{const{getSettings:ue}=ee(J);return ue().mediaUpload},[]),[E,B]=x.useState("");x.useEffect(()=>{var ee;B((ee=e?.src)!==null&&ee!==void 0?ee:"")},[e?.src]);const N=()=>!t||t.length===0?!1:t.every(ee=>ee==="image"||ee.startsWith("image/")),j=ee=>{if(!p||typeof p=="function"&&!p(ee))return g(ee);M(ee);let ue;if(d)if(u){let ce=[];ue=me=>{const de=(e??[]).filter(Ae=>Ae.id?!ce.some(({id:ye})=>Number(ye)===Number(Ae.id)):!ce.some(({urlSlug:ye})=>Ae.url.includes(ye)));g(de.concat(me)),ce=me.map(Ae=>{const ye=Ae.url.lastIndexOf("."),Ne=Ae.url.slice(0,ye);return{id:Ae.id,urlSlug:Ne}})}}else ue=g;else ue=([ce])=>g(ce);T({allowedTypes:t,filesList:ee,onFileChange:ue,onError:h})};async function I(ee){const{blocks:ue}=wge(ee);if(!ue?.length)return;const ce=await Promise.all(ue.map(me=>{const de=me.name.split("/")[1];return me.attributes.id?(me.attributes.type=de,me.attributes):new Promise((Ae,ye)=>{window.fetch(me.attributes.url).then(Ne=>Ne.blob()).then(Ne=>T({filesList:[Ne],additionalData:{title:me.attributes.title,alt_text:me.attributes.alt,caption:me.attributes.caption,type:de},onFileChange:([je])=>{je.id&&Ae(je)},allowedTypes:t,onError:ye})).catch(()=>Ae(me.attributes.url))})})).catch(me=>h(me));g(d?ce:ce[0])}const P=ee=>{j(ee.target.files)},F=C??(ee=>{let{instructions:ue,title:ce}=r;if(!T&&!A&&(ue=m("To edit this block, you need permission to upload media.")),ue===void 0||ce===void 0){const de=t??[],[Ae]=de,ye=de.length===1,Ne=ye&&Ae==="audio",je=ye&&Ae==="image",ie=ye&&Ae==="video";ue===void 0&&T&&(ue=m("Drag and drop an image or video, upload, or choose from your library."),Ne?ue=m("Drag and drop an audio file, upload, or choose from your library."):je?ue=m("Drag and drop an image, upload, or choose from your library."):ie&&(ue=m("Drag and drop a video, upload, or choose from your library."))),ce===void 0&&(ce=m("Media"),Ne?ce=m("Audio"):je?ce=m("Image"):ie&&(ce=m("Video")))}const me=oe("block-editor-media-placeholder",n,{"is-appender":c});return a.jsxs(vo,{icon:o,label:ce,instructions:ue,className:me,notices:i,onDoubleClick:v,preview:s,style:R,children:[ee,k]})}),X=()=>f?null:a.jsx(Tz,{onFilesDrop:j,onDrop:I,isEligible:ee=>{const ue="wp-block:core/",ce=[];for(const me of ee.types)me.startsWith(ue)&&ce.push(me.slice(ue.length));return ce.every(me=>t.includes(me))&&(d?!0:ce.length===1)}}),Z=()=>z&&a.jsx(Ce,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__cancel-button",title:m("Cancel"),variant:"link",onClick:z,children:m("Cancel")}),V=()=>A&&a.jsx(nNt,{src:E,onChangeSrc:B,onSelectURL:A}),Q=()=>_&&a.jsx("div",{className:"block-editor-media-placeholder__url-input-container",children:a.jsx(Ce,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__button",onClick:_,variant:"secondary",children:m("Use featured image")})}),te=()=>{const ue=S??(({open:me})=>a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{me()},children:m("Media Library")})),ce=a.jsx(ab,{addToGallery:u,gallery:d&&N(),multiple:d,onSelect:g,allowedTypes:t,mode:"browse",value:Array.isArray(e)?e.map(({id:me})=>me):e.id,render:ue});if(T&&c)return a.jsxs(a.Fragment,{children:[X(),a.jsx(kx,{onChange:P,accept:l,multiple:!!d,render:({openFileDialog:me})=>{const de=a.jsxs(a.Fragment,{children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"primary",className:oe("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:me,children:We("Upload","verb")}),ce,V(),Q(),Z()]});return F(de)}})]});if(T){const me=a.jsxs(a.Fragment,{children:[X(),a.jsx(kx,{render:({openFileDialog:de})=>a.jsx(Ce,{__next40pxDefaultSize:!0,onClick:de,variant:"primary",className:oe("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),children:We("Upload","verb")}),onChange:P,accept:l,multiple:!!d}),ce,V(),Q(),Z()]});return F(me)}return F(ce)};return b?a.jsx(Hd,{children:X()}):a.jsx(Hd,{fallback:F(V()),children:te()})}const iu=ap("editor.MediaPlaceholder")(oNt),rNt={placement:"bottom-start"},Qze=()=>a.jsxs(a.Fragment,{children:[["bold","italic","link","unknown"].map(e=>a.jsx(xf,{name:`RichText.ToolbarControls.${e}`},e)),a.jsx(xf,{name:"RichText.ToolbarControls",children:e=>{if(!e.length)return null;const n=e.map(([{props:o}])=>o).some(({isActive:o})=>o);return a.jsx(bs,{children:o=>a.jsx(c0,{icon:tu,label:m("More"),toggleProps:{...o,className:oe(o.className,{"is-pressed":n}),description:m("Displays more block tools")},controls:hO(e.map(([{props:r}])=>r),"title"),popoverProps:rNt})})}})]});function sNt({popoverAnchor:e}){return a.jsx(Io,{placement:"top",focusOnMount:!1,anchor:e,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar",children:a.jsx(tI,{className:"block-editor-rich-text__inline-format-toolbar-group","aria-label":m("Format tools"),children:a.jsx(Wn,{children:a.jsx(Qze,{})})})})}const iNt=({inline:e,editableContentElement:t})=>e?a.jsx(sNt,{popoverAnchor:t}):a.jsx(bt,{group:"inline",children:a.jsx(Qze,{})});function aNt({html:e,value:t}){const n=x.useRef(),o=!!t.activeFormats?.length,{__unstableMarkLastChangeAsPersistent:r}=Oe(J);x.useLayoutEffect(()=>{if(!n.current){n.current=t.text;return}if(n.current!==t.text){const s=window.setTimeout(()=>{r()},1e3);return n.current=t.text,()=>{window.clearTimeout(s)}}r()},[e,o])}function cNt(e){return e(ul).getFormatTypes()}const lNt=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function uNt(e,t){return typeof e!="object"?{[t]:e}:Object.fromEntries(Object.entries(e).map(([n,o])=>[`${t}.${n}`,o]))}function Ote(e,t){return e[t]?e[t]:Object.keys(e).filter(n=>n.startsWith(t+".")).reduce((n,o)=>(n[o.slice(t.length+1)]=e[o],n),{})}function dNt({clientId:e,identifier:t,withoutInteractiveFormatting:n,allowedFormats:o}){const r=G(cNt,[]),s=x.useMemo(()=>r.filter(({name:f,interactive:b,tagName:h})=>!(o&&!o.includes(f)||n&&(b||lNt.has(h)))),[r,o,n]),i=G(f=>s.reduce((b,h)=>h.__experimentalGetPropsForEditableTreePreparation?{...b,...uNt(h.__experimentalGetPropsForEditableTreePreparation(f,{richTextIdentifier:t,blockClientId:e}),h.name)}:b,{}),[s,e,t]),c=Oe(),l=[],u=[],d=[],p=[];for(const f in i)p.push(i[f]);return s.forEach(f=>{if(f.__experimentalCreatePrepareEditableTree){const b=f.__experimentalCreatePrepareEditableTree(Ote(i,f.name),{richTextIdentifier:t,blockClientId:e});f.__experimentalCreateOnChangeEditableValue?u.push(b):l.push(b)}if(f.__experimentalCreateOnChangeEditableValue){let b={};f.__experimentalGetPropsForEditableTreeChangeHandler&&(b=f.__experimentalGetPropsForEditableTreeChangeHandler(c,{richTextIdentifier:t,blockClientId:e}));const h=Ote(i,f.name);d.push(f.__experimentalCreateOnChangeEditableValue({...typeof h=="object"?h:{},...b},{richTextIdentifier:t,blockClientId:e}))}}),{formatTypes:s,prepareHandlers:l,valueHandlers:u,changeHandlers:d,dependencies:p}}const pNt=["`",'"',"'","“”","‘’"],fNt=e=>t=>{function n(o){const{inputType:r,data:s}=o,{value:i,onChange:c,registry:l}=e.current;if(r!=="insertText"||Xl(i))return;const u=gr("blockEditor.wrapSelectionSettings",pNt).find(([y,k])=>y===s||k===s);if(!u)return;const[d,p=d]=u,f=i.start,b=i.end+d.length;let h=E0(i,d,f,f);h=E0(h,p,b,b);const{__unstableMarkLastChangeAsPersistent:g,__unstableMarkAutomaticChange:z}=l.dispatch(J);g(),c(h),z();const A={};for(const y in o)A[y]=o[y];A.data=p;const{ownerDocument:_}=t,{defaultView:v}=_,M=new v.InputEvent("input",A);window.queueMicrotask(()=>{o.target.dispatchEvent(M)}),o.preventDefault()}return t.addEventListener("beforeinput",n),()=>{t.removeEventListener("beforeinput",n)}};function bNt(e){const t="tales of gutenberg",n=" 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️",{start:o,text:r}=e;return ot=>{function n(){const{getValue:r,onReplace:s,selectionChange:i,registry:c}=e.current;if(!s)return;const l=r(),{start:u,text:d}=l;if(d.slice(u-1,u)!==" ")return;const f=d.slice(0,u).trim(),b=Ei("from").filter(({type:A})=>A==="prefix"),h=xc(b,({prefix:A})=>f===A);if(!h)return;const g=T0({value:E0(l,qf,0,u)}),z=h.transform(g);return i(...Jze([z])),s([z]),c.dispatch(J).__unstableMarkAutomaticChange(),!0}function o(r){const{inputType:s,type:i}=r,{getValue:c,onChange:l,__unstableAllowPrefixTransformations:u,formatTypes:d,registry:p}=e.current;if(s!=="insertText"&&i!=="compositionend"||u&&n())return;const f=c(),b=d.reduce((z,{__unstableInputRule:A})=>(A&&(z=A(z)),z),bNt(f)),{__unstableMarkLastChangeAsPersistent:h,__unstableMarkAutomaticChange:g}=p.dispatch(J);b!==f&&(h(),l({...b,activeFormats:f.activeFormats}),g())}return t.addEventListener("input",o),t.addEventListener("compositionend",o),()=>{t.removeEventListener("input",o),t.removeEventListener("compositionend",o)}},mNt=e=>t=>{function n(o){if(o.inputType!=="insertReplacementText")return;const{registry:r}=e.current;r.dispatch(J).__unstableMarkLastChangeAsPersistent()}return t.addEventListener("beforeinput",n),()=>{t.removeEventListener("beforeinput",n)}},gNt=()=>e=>{function t(n){(lc.primary(n,"z")||lc.primary(n,"y")||lc.primaryShift(n,"z"))&&n.preventDefault()}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}},MNt=e=>t=>{const{keyboardShortcuts:n}=e.current;function o(r){for(const s of n.current)s(r)}return t.addEventListener("keydown",o),()=>{t.removeEventListener("keydown",o)}},zNt=e=>t=>{const{inputEvents:n}=e.current;function o(r){for(const s of n.current)s(r)}return t.addEventListener("input",o),()=>{t.removeEventListener("input",o)}},ONt=e=>t=>{function n(o){const{keyCode:r}=o;if(o.defaultPrevented||r!==Mc&&r!==gd)return;const{registry:s}=e.current,{didAutomaticChange:i,getSettings:c}=s.select(J),{__experimentalUndo:l}=c();l&&i()&&(o.preventDefault(),l())}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}};function yNt(e,t){if(t?.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}function e3e(e){if(!(e!==!0&&e!=="p"&&e!=="li"))return e===!0?"p":e}function pI({allowedFormats:e,disableFormats:t}){return t?pI.EMPTY_ARRAY:e}pI.EMPTY_ARRAY=[];const ANt=e=>t=>{function n(r){const{disableFormats:s,onChange:i,value:c,formatTypes:l,tagName:u,onReplace:d,__unstableEmbedURLOnPaste:p,preserveWhiteSpace:f,pastePlainText:b}=e.current;if(!t.contains(r.target)||r.defaultPrevented)return;const{plainText:h,html:g}=T7(r);if(r.preventDefault(),window.console.log(`Received HTML: +`,BWt=1,LWt=3,PWt=1,jWt=function(e){hke(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.imageRef=x.createRef(),n.videoRef=x.createRef(),n.containerPosition={x:0,y:0},n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc=typeof document<"u"?document:null,n.currentWindow=typeof window<"u"?window:null,n.resizeObserver=null,n.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},n.initResizeObserver=function(){if(!(typeof window.ResizeObserver>"u"||!n.containerRef)){var o=!0;n.resizeObserver=new window.ResizeObserver(function(r){if(o){o=!1;return}n.computeSizes()}),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(o){return o.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd),n.currentDoc.removeEventListener("scroll",n.onScroll))},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var o=n.computeSizes();o&&(n.emitCropData(),n.setInitialCrop(o)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(o){if(n.props.initialCroppedAreaPercentages){var r=RWt(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,o,n.props.minZoom,n.props.maxZoom),s=r.crop,i=r.zoom;n.props.onCropChange(s),n.props.onZoomChange&&n.props.onZoomChange(i)}else if(n.props.initialCroppedAreaPixels){var c=EWt(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,o,n.props.minZoom,n.props.maxZoom),s=c.crop,i=c.zoom;n.props.onCropChange(s),n.props.onZoomChange&&n.props.onZoomChange(i)}},n.computeSizes=function(){var o,r,s,i,c,l,u=n.imageRef.current||n.videoRef.current;if(u&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect(),n.saveContainerPosition();var d=n.containerRect.width/n.containerRect.height,p=((o=n.imageRef.current)===null||o===void 0?void 0:o.naturalWidth)||((r=n.videoRef.current)===null||r===void 0?void 0:r.videoWidth)||0,f=((s=n.imageRef.current)===null||s===void 0?void 0:s.naturalHeight)||((i=n.videoRef.current)===null||i===void 0?void 0:i.videoHeight)||0,b=u.offsetWidthh?{width:n.containerRect.height*h,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/h};break;case"horizontal-cover":g={width:n.containerRect.width,height:n.containerRect.width/h};break;case"vertical-cover":g={width:n.containerRect.height*h,height:n.containerRect.height};break}else g={width:u.offsetWidth,height:u.offsetHeight};n.mediaSize=Lr(Lr({},g),{naturalWidth:p,naturalHeight:f}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var z=n.props.cropSize?n.props.cropSize:_Wt(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(((c=n.state.cropSize)===null||c===void 0?void 0:c.height)!==z.height||((l=n.state.cropSize)===null||l===void 0?void 0:l.width)!==z.width)&&n.props.onCropSizeChange&&n.props.onCropSizeChange(z),n.setState({cropSize:z},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(z),z}},n.saveContainerPosition=function(){if(n.containerRef){var o=n.containerRef.getBoundingClientRect();n.containerPosition={x:o.left,y:o.top}}},n.onMouseDown=function(o){n.currentDoc&&(o.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.saveContainerPosition(),n.onDragStart(t.getMousePoint(o)))},n.onMouseMove=function(o){return n.onDrag(t.getMousePoint(o))},n.onScroll=function(o){n.currentDoc&&(o.preventDefault(),n.saveContainerPosition())},n.onTouchStart=function(o){n.currentDoc&&(n.isTouching=!0,!(n.props.onTouchRequest&&!n.props.onTouchRequest(o))&&(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),n.saveContainerPosition(),o.touches.length===2?n.onPinchStart(o):o.touches.length===1&&n.onDragStart(t.getTouchPoint(o.touches[0]))))},n.onTouchMove=function(o){o.preventDefault(),o.touches.length===2?n.onPinchMove(o):o.touches.length===1&&n.onDrag(t.getTouchPoint(o.touches[0]))},n.onGestureStart=function(o){n.currentDoc&&(o.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(o){if(o.preventDefault(),!n.isTouching){var r=t.getMousePoint(o),s=n.gestureZoomStart-1+o.scale;if(n.setNewZoom(s,r,{shouldUpdatePosition:!0}),n.props.onRotationChange){var i=n.gestureRotationStart+o.rotation;n.props.onRotationChange(i)}}},n.onGestureEnd=function(o){n.cleanEvents()},n.onDragStart=function(o){var r,s,i=o.x,c=o.y;n.dragStartPosition={x:i,y:c},n.dragStartCrop=Lr({},n.props.crop),(s=(r=n.props).onInteractionStart)===null||s===void 0||s.call(r)},n.onDrag=function(o){var r=o.x,s=o.y;n.currentWindow&&(n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame(function(){if(n.state.cropSize&&!(r===void 0||s===void 0)){var i=r-n.dragStartPosition.x,c=s-n.dragStartPosition.y,l={x:n.dragStartCrop.x+i,y:n.dragStartCrop.y+c},u=n.props.restrictPosition?$g(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(u)}}))},n.onDragStopped=function(){var o,r;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),(r=(o=n.props).onInteractionEnd)===null||r===void 0||r.call(o)},n.onWheel=function(o){if(n.currentWindow&&!(n.props.onWheelRequest&&!n.props.onWheelRequest(o))){o.preventDefault();var r=t.getMousePoint(o),s=wWt(o).pixelY,i=n.props.zoom-s*n.props.zoomSpeed/200;n.setNewZoom(i,r,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},function(){var c,l;return(l=(c=n.props).onInteractionStart)===null||l===void 0?void 0:l.call(c)}),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout(function(){return n.setState({hasWheelJustStarted:!1},function(){var c,l;return(l=(c=n.props).onInteractionEnd)===null||l===void 0?void 0:l.call(c)})},250)}},n.getPointOnContainer=function(o,r){var s=o.x,i=o.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(s-r.x),y:n.containerRect.height/2-(i-r.y)}},n.getPointOnMedia=function(o){var r=o.x,s=o.y,i=n.props,c=i.crop,l=i.zoom;return{x:(r+c.x)/l,y:(s+c.y)/l}},n.setNewZoom=function(o,r,s){var i=s===void 0?{}:s,c=i.shouldUpdatePosition,l=c===void 0?!0:c;if(!(!n.state.cropSize||!n.props.onZoomChange)){var u=Z_(o,n.props.minZoom,n.props.maxZoom);if(l){var d=n.getPointOnContainer(r,n.containerPosition),p=n.getPointOnMedia(d),f={x:p.x*u-d.x,y:p.y*u-d.y},b=n.props.restrictPosition?$g(f,n.mediaSize,n.state.cropSize,u,n.props.rotation):f;n.props.onCropChange(b)}n.props.onZoomChange(u)}},n.getCropData=function(){if(!n.state.cropSize)return null;var o=n.props.restrictPosition?$g(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;return SWt(o,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition)},n.emitCropData=function(){var o=n.getCropData();if(o){var r=o.croppedAreaPercentages,s=o.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(r,s),n.props.onCropAreaChange&&n.props.onCropAreaChange(r,s)}},n.emitCropAreaChange=function(){var o=n.getCropData();if(o){var r=o.croppedAreaPercentages,s=o.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(r,s)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var o=n.props.restrictPosition?$g(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(o),n.emitCropData()}},n.onKeyDown=function(o){var r=n.props,s=r.crop,i=r.onCropChange,c=r.keyboardStep,l=r.zoom,u=r.rotation,d=c;if(n.state.cropSize){var p=Lr({},s);switch(o.key){case"ArrowUp":p.y-=d;break;case"ArrowDown":p.y+=d;break;case"ArrowLeft":p.x-=d;break;case"ArrowRight":p.x+=d;break;default:return}n.props.restrictPosition&&(p=$g(p,n.mediaSize,n.state.cropSize,l,u)),i(p)}},n}return 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(),typeof window.ResizeObserver>"u"&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=NWt,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 n,o;!this.currentDoc||!this.currentWindow||(typeof window.ResizeObserver>"u"&&this.currentWindow.removeEventListener("resize",this.computeSizes),(n=this.resizeObserver)===null||n===void 0||n.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((o=this.styleRef.parentNode)===null||o===void 0||o.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(n){var o,r,s,i,c,l,u,d,p;n.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):n.aspect!==this.props.aspect?this.computeSizes():n.objectFit!==this.props.objectFit?this.computeSizes():n.zoom!==this.props.zoom?this.recomputeCropPosition():((o=n.cropSize)===null||o===void 0?void 0:o.height)!==((r=this.props.cropSize)===null||r===void 0?void 0:r.height)||((s=n.cropSize)===null||s===void 0?void 0:s.width)!==((i=this.props.cropSize)===null||i===void 0?void 0:i.width)?this.computeSizes():(((c=n.crop)===null||c===void 0?void 0:c.x)!==((l=this.props.crop)===null||l===void 0?void 0:l.x)||((u=n.crop)===null||u===void 0?void 0:u.y)!==((d=this.props.crop)===null||d===void 0?void 0:d.y))&&this.emitCropAreaChange(),n.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),n.video!==this.props.video&&((p=this.videoRef.current)===null||p===void 0||p.load());var f=this.getObjectFit();f!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:f},this.computeSizes)},t.prototype.getAspect=function(){var n=this.props,o=n.cropSize,r=n.aspect;return o?o.width/o.height:r},t.prototype.getObjectFit=function(){var n,o,r,s;if(this.props.objectFit==="cover"){var i=this.imageRef.current||this.videoRef.current;if(i&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var c=this.containerRect.width/this.containerRect.height,l=((n=this.imageRef.current)===null||n===void 0?void 0:n.naturalWidth)||((o=this.videoRef.current)===null||o===void 0?void 0:o.videoWidth)||0,u=((r=this.imageRef.current)===null||r===void 0?void 0:r.naturalHeight)||((s=this.videoRef.current)===null||s===void 0?void 0:s.videoHeight)||0,d=l/u;return d{p(v)},onCropComplete:v=>{f(v)},onZoomChange:v=>{b(v*100)}}),i&&a.jsx(Xn,{})]});return a.jsxs(a.Fragment,{children:[g,_]})}function DWt(){const{isInProgress:e,zoom:t,setZoom:n}=RO();return a.jsx(so,{contentClassName:"wp-block-image__zoom",popoverProps:Xze,renderToggle:({isOpen:o,onToggle:r})=>a.jsx(Vt,{icon:Pw,label:m("Zoom"),onClick:r,"aria-expanded":o,disabled:e}),renderContent:()=>a.jsx($s,{paddingSize:"medium",children:a.jsx(bo,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:m("Zoom"),min:Hze,max:Uze,value:Math.round(t),onChange:n})})})}function FWt(){const{isInProgress:e,rotateClockwise:t}=RO();return a.jsx(Vt,{icon:Ede,label:m("Rotate"),onClick:t,disabled:e})}function $Wt(){const{isInProgress:e,apply:t,cancel:n}=RO();return a.jsxs(a.Fragment,{children:[a.jsx(Vt,{onClick:t,disabled:e,children:m("Apply")}),a.jsx(Vt,{onClick:n,children:m("Cancel")})]})}function Kze({id:e,url:t,width:n,height:o,naturalHeight:r,naturalWidth:s,onSaveImage:i,onFinishEditing:c,borderProps:l}){return a.jsxs(mWt,{id:e,url:t,naturalWidth:s,naturalHeight:r,onSaveImage:i,onFinishEditing:c,children:[a.jsx(IWt,{borderProps:l,url:t,width:n,height:o,naturalHeight:r,naturalWidth:s}),a.jsxs(bt,{children:[a.jsxs(Wn,{children:[a.jsx(DWt,{}),a.jsx(bs,{children:u=>a.jsx(MWt,{toggleProps:u})}),a.jsx(FWt,{})]}),a.jsx(Wn,{children:a.jsx($Wt,{})})]})]})}function VWt(e,t,n,o,r){var s,i;const[c,l]=x.useState((s=t??o)!==null&&s!==void 0?s:""),[u,d]=x.useState((i=e??n)!==null&&i!==void 0?i:"");return x.useEffect(()=>{t===void 0&&o!==void 0&&l(o),e===void 0&&n!==void 0&&d(n)},[o,n]),x.useEffect(()=>{t!==void 0&&Number.parseInt(t)!==Number.parseInt(c)&&l(t),e!==void 0&&Number.parseInt(e)!==Number.parseInt(u)&&d(e)},[t,e]),{currentHeight:u,currentWidth:c,updateDimension:(b,h)=>{const g=h===""?void 0:parseInt(h,10);b==="width"?l(g):d(g),r({[b]:g})},updateDimensions:(b,h)=>{d(b??n),l(h??o),r({height:b,width:h})}}}const gte=[25,50,75,100],HWt=()=>{};function Mte(e,t,n){const o=Math.round(t*(e/100)),r=Math.round(n*(e/100));return{scaledWidth:o,scaledHeight:r}}function UWt({imageSizeHelp:e,imageWidth:t,imageHeight:n,imageSizeOptions:o=[],isResizable:r=!0,slug:s,width:i,height:c,onChange:l,onChangeImage:u=HWt}){const{currentHeight:d,currentWidth:p,updateDimension:f,updateDimensions:b}=VWt(c,i,n,t,l),h=z=>{if(z===void 0){b();return}const{scaledWidth:A,scaledHeight:_}=Mte(z,t,n);b(_,A)},g=gte.find(z=>{const{scaledWidth:A,scaledHeight:_}=Mte(z,t,n);return p===A&&d===_});return a.jsxs(a.Fragment,{children:[o&&o.length>0&&a.jsx(Pn,{__nextHasNoMarginBottom:!0,label:m("Resolution"),value:s,options:o,onChange:u,help:e,size:"__unstable-large"}),r&&a.jsxs("div",{className:"block-editor-image-size-control",children:[a.jsxs(Ot,{align:"baseline",spacing:"3",children:[a.jsx(g0,{className:"block-editor-image-size-control__width",label:m("Width"),value:p,min:1,onChange:z=>f("width",z),size:"__unstable-large"}),a.jsx(g0,{className:"block-editor-image-size-control__height",label:m("Height"),value:d,min:1,onChange:z=>f("height",z),size:"__unstable-large"})]}),a.jsx(Do,{label:m("Image size presets"),hideLabelFromVision:!0,onChange:h,value:g,isBlock:!0,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,children:gte.map(z=>a.jsx(Kn,{value:z,label:xe(m("%d%%"),z)},z))})]})]})}const zte={left:Tw,center:Ew,right:Ww,"space-between":NP,stretch:BP};function XWt({allowedControls:e=["left","center","right","space-between"],isCollapsed:t=!0,onChange:n,value:o,popoverProps:r,isToolbar:s}){const i=p=>{n(p===o?void 0:p)},c=o?zte[o]:zte.left,l=[{name:"left",icon:Tw,title:m("Justify items left"),isActive:o==="left",onClick:()=>i("left")},{name:"center",icon:Ew,title:m("Justify items center"),isActive:o==="center",onClick:()=>i("center")},{name:"right",icon:Ww,title:m("Justify items right"),isActive:o==="right",onClick:()=>i("right")},{name:"space-between",icon:NP,title:m("Space between items"),isActive:o==="space-between",onClick:()=>i("space-between")},{name:"stretch",icon:BP,title:m("Stretch items"),isActive:o==="stretch",onClick:()=>i("stretch")}],u=s?Wn:Lc,d=s?{isCollapsed:t}:{};return a.jsx(u,{icon:c,popoverProps:r,label:m("Change items justification"),controls:l.filter(p=>e.includes(p.name)),...d})}const Yze=e=>a.jsx(XWt,{...e,isToolbar:!1});function GWt({url:e,urlLabel:t,className:n}){const o=oe(n,"block-editor-url-popover__link-viewer-url");return e?a.jsx(hr,{className:o,href:e,children:t||Ph(l3(e))}):a.jsx("span",{className:o})}function KWt({className:e,linkClassName:t,onEditLinkClick:n,url:o,urlLabel:r,...s}){return a.jsxs("div",{className:oe("block-editor-url-popover__link-viewer",e),...s,children:[a.jsx(GWt,{url:o,urlLabel:r,className:t}),n&&a.jsx(Ce,{icon:Nd,label:m("Edit"),onClick:n,size:"compact"})]})}function Zze(e){return typeof e=="function"}class YWt extends x.Component{constructor(t){super(t),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=t.autocompleteRef||x.createRef(),this.inputRef=x.createRef(),this.updateSuggestions=F1(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.suggestionsRequest=null,this.state={suggestions:[],showSuggestions:!1,suggestionsValue:null,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(t){const{showSuggestions:n,selectedSuggestion:o}=this.state,{value:r,__experimentalShowInitialSuggestions:s=!1}=this.props;n&&o!==null&&this.suggestionNodes[o]&&this.suggestionNodes[o].scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"}),t.value!==r&&!this.props.disableSuggestions&&(r?.length?this.updateSuggestions(r):s&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){this.suggestionsRequest?.cancel?.(),this.suggestionsRequest=null}bindSuggestionNode(t){return n=>{this.suggestionNodes[t]=n}}shouldShowInitialSuggestions(){const{__experimentalShowInitialSuggestions:t=!1,value:n}=this.props;return t&&!(n&&n.length)}updateSuggestions(t=""){const{__experimentalFetchLinkSuggestions:n,__experimentalHandleURLSuggestions:o}=this.props;if(!n)return;const r=!t?.length;if(t=t.trim(),!r&&(t.length<2||!o&&If(t))){this.suggestionsRequest?.cancel?.(),this.suggestionsRequest=null,this.setState({suggestions:[],showSuggestions:!1,suggestionsValue:t,selectedSuggestion:null,loading:!1});return}this.setState({selectedSuggestion:null,loading:!0});const s=n(t,{isInitialSuggestions:r});s.then(i=>{this.suggestionsRequest===s&&(this.setState({suggestions:i,suggestionsValue:t,loading:!1,showSuggestions:!!i.length}),i.length?this.props.debouncedSpeak(xe(Dn("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",i.length),i.length),"assertive"):this.props.debouncedSpeak(m("No results."),"assertive"))}).catch(()=>{this.suggestionsRequest===s&&this.setState({loading:!1})}).finally(()=>{this.suggestionsRequest===s&&(this.suggestionsRequest=null)}),this.suggestionsRequest=s}onChange(t){this.props.onChange(t)}onFocus(){const{suggestions:t}=this.state,{disableSuggestions:n,value:o}=this.props;o&&!n&&!(t&&t.length)&&this.suggestionsRequest===null&&this.updateSuggestions(o)}onKeyDown(t){this.props.onKeyDown?.(t);const{showSuggestions:n,selectedSuggestion:o,suggestions:r,loading:s}=this.state;if(!n||!r.length||s){switch(t.keyCode){case cc:{t.target.selectionStart!==0&&(t.preventDefault(),t.target.setSelectionRange(0,0));break}case Ps:{this.props.value.length!==t.target.selectionStart&&(t.preventDefault(),t.target.setSelectionRange(this.props.value.length,this.props.value.length));break}case Gr:{this.props.onSubmit&&(t.preventDefault(),this.props.onSubmit(null,t));break}}return}const i=this.state.suggestions[this.state.selectedSuggestion];switch(t.keyCode){case cc:{t.preventDefault();const c=o?o-1:r.length-1;this.setState({selectedSuggestion:c});break}case Ps:{t.preventDefault();const c=o===null||o===r.length-1?0:o+1;this.setState({selectedSuggestion:c});break}case Y2:{this.state.selectedSuggestion!==null&&(this.selectLink(i),this.props.speak(m("Link selected.")));break}case Gr:{t.preventDefault(),this.state.selectedSuggestion!==null?(this.selectLink(i),this.props.onSubmit&&this.props.onSubmit(i,t)):this.props.onSubmit&&this.props.onSubmit(null,t);break}}}selectLink(t){this.props.onChange(t.url,t),this.setState({selectedSuggestion:null,showSuggestions:!1})}handleOnClick(t){this.selectLink(t),this.inputRef.current.focus()}static getDerivedStateFromProps({value:t,instanceId:n,disableSuggestions:o,__experimentalShowInitialSuggestions:r=!1},{showSuggestions:s}){let i=s;const c=t&&t.length;return!r&&!c&&(i=!1),o===!0&&(i=!1),{showSuggestions:i,suggestionsListboxId:`block-editor-url-input-suggestions-${n}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${n}`}}render(){return a.jsxs(a.Fragment,{children:[this.renderControl(),this.renderSuggestions()]})}renderControl(){const{label:t=null,className:n,isFullWidth:o,instanceId:r,placeholder:s=m("Paste URL or type to search"),__experimentalRenderControl:i,value:c="",hideLabelFromVision:l=!1}=this.props,{loading:u,showSuggestions:d,selectedSuggestion:p,suggestionsListboxId:f,suggestionOptionIdPrefix:b}=this.state,h=`url-input-control-${r}`,g={id:h,label:t,className:oe("block-editor-url-input",n,{"is-full-width":o}),hideLabelFromVision:l},z={id:h,value:c,required:!0,type:"text",onChange:this.onChange,onFocus:this.onFocus,placeholder:s,onKeyDown:this.onKeyDown,role:"combobox","aria-label":t?void 0:m("URL"),"aria-expanded":d,"aria-autocomplete":"list","aria-owns":f,"aria-activedescendant":p!==null?`${b}-${p}`:void 0,ref:this.inputRef,suffix:this.props.suffix};return i?i(g,z,u):a.jsxs(no,{__nextHasNoMarginBottom:!0,...g,children:[a.jsx(B1,{...z,__next40pxDefaultSize:!0}),u&&a.jsx(Xn,{})]})}renderSuggestions(){const{className:t,__experimentalRenderSuggestions:n}=this.props,{showSuggestions:o,suggestions:r,suggestionsValue:s,selectedSuggestion:i,suggestionsListboxId:c,suggestionOptionIdPrefix:l,loading:u}=this.state;if(!o||r.length===0)return null;const d={id:c,ref:this.autocompleteRef,role:"listbox"},p=(f,b)=>({role:"option",tabIndex:"-1",id:`${l}-${b}`,ref:this.bindSuggestionNode(b),"aria-selected":b===i?!0:void 0});return Zze(n)?n({suggestions:r,selectedSuggestion:i,suggestionsListProps:d,buildSuggestionItemProps:p,isLoading:u,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:!s?.length,currentInputValue:s}):a.jsx(Io,{placement:"bottom",focusOnMount:!1,children:a.jsx("div",{...d,className:oe("block-editor-url-input__suggestions",{[`${t}__suggestions`]:t}),children:r.map((f,b)=>x.createElement(Ce,{__next40pxDefaultSize:!0,...p(f,b),key:f.id,className:oe("block-editor-url-input__suggestion",{"is-selected":b===i}),onClick:()=>this.handleOnClick(f)},f.title))})})}}const dI=Co(m6e,bbt,h6e,Ul((e,t)=>{if(Zze(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(J);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}}))(YWt);function ZWt({autocompleteRef:e,className:t,onChangeInputValue:n,value:o,...r}){return a.jsxs("form",{className:oe("block-editor-url-popover__link-editor",t),...r,children:[a.jsx(dI,{value:o,onChange:n,autocompleteRef:e}),a.jsx(Ce,{icon:Nw,label:m("Apply"),type:"submit",size:"compact"})]})}const{__experimentalPopoverLegacyPositionToPlacement:QWt}=ct(tr),JWt="bottom",lf=x.forwardRef(({additionalControls:e,children:t,renderSettings:n,placement:o,focusOnMount:r="firstElement",position:s,...i},c)=>{s!==void 0&&Ke("`position` prop in wp.blockEditor.URLPopover",{since:"6.2",alternative:"`placement` prop"});let l;o!==void 0?l=o:s!==void 0&&(l=QWt(s)),l=l||JWt;const[u,d]=x.useState(!1),p=!!n&&u,f=()=>{d(!u)};return a.jsxs(Io,{ref:c,role:"dialog","aria-modal":"true","aria-label":m("Edit URL"),className:"block-editor-url-popover",focusOnMount:r,placement:l,shift:!0,variant:"toolbar",...i,children:[a.jsx("div",{className:"block-editor-url-popover__input-container",children:a.jsxs("div",{className:"block-editor-url-popover__row",children:[t,!!n&&a.jsx(Ce,{className:"block-editor-url-popover__settings-toggle",icon:tu,label:m("Link settings"),onClick:f,"aria-expanded":u,size:"compact"})]})}),p&&a.jsx("div",{className:"block-editor-url-popover__settings",children:n()}),e&&!p&&a.jsx("div",{className:"block-editor-url-popover__additional-controls",children:e})]})});lf.LinkEditor=ZWt;lf.LinkViewer=KWt;const eNt=()=>{},tNt=({src:e,onChange:t,onSubmit:n,onClose:o,popoverAnchor:r})=>a.jsx(lf,{anchor:r,onClose:o,children:a.jsx("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:n,children:a.jsx(B1,{__next40pxDefaultSize:!0,label:m("URL"),type:"url",hideLabelFromVision:!0,placeholder:m("Paste or type URL"),onChange:t,value:e,suffix:a.jsx(eO,{variant:"control",children:a.jsx(Ce,{size:"small",icon:Nw,label:m("Apply"),type:"submit"})})})})}),nNt=({src:e,onChangeSrc:t,onSelectURL:n})=>{const[o,r]=x.useState(null),[s,i]=x.useState(!1),c=()=>{i(!0)},l=()=>{i(!1),o?.focus()},u=d=>{d.preventDefault(),e&&n&&(n(e),l())};return a.jsxs("div",{className:"block-editor-media-placeholder__url-input-container",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__button",onClick:c,isPressed:s,variant:"secondary","aria-haspopup":"dialog",ref:r,children:m("Insert from URL")}),s&&a.jsx(tNt,{src:e,onChange:t,onSubmit:u,onClose:l,popoverAnchor:o})]})};function oNt({value:e={},allowedTypes:t,className:n,icon:o,labels:r={},mediaPreview:s,notices:i,isAppender:c,accept:l,addToGallery:u,multiple:d=!1,handleUpload:p=!0,disableDropZone:f,disableMediaButtons:b,onError:h,onSelect:g,onCancel:z,onSelectURL:A,onToggleFeaturedImage:_,onDoubleClick:v,onFilesPreUpload:M=eNt,onHTMLDrop:y,children:k,mediaLibraryButton:S,placeholder:C,style:R}){y&&Ke("wp.blockEditor.MediaPlaceholder onHTMLDrop prop",{since:"6.2",version:"6.4"});const T=G(ee=>{const{getSettings:ue}=ee(J);return ue().mediaUpload},[]),[E,B]=x.useState("");x.useEffect(()=>{var ee;B((ee=e?.src)!==null&&ee!==void 0?ee:"")},[e?.src]);const N=()=>!t||t.length===0?!1:t.every(ee=>ee==="image"||ee.startsWith("image/")),j=ee=>{if(!p||typeof p=="function"&&!p(ee))return g(ee);M(ee);let ue;if(d)if(u){let ce=[];ue=me=>{const de=(e??[]).filter(Ae=>Ae.id?!ce.some(({id:ye})=>Number(ye)===Number(Ae.id)):!ce.some(({urlSlug:ye})=>Ae.url.includes(ye)));g(de.concat(me)),ce=me.map(Ae=>{const ye=Ae.url.lastIndexOf("."),Ne=Ae.url.slice(0,ye);return{id:Ae.id,urlSlug:Ne}})}}else ue=g;else ue=([ce])=>g(ce);T({allowedTypes:t,filesList:ee,onFileChange:ue,onError:h})};async function I(ee){const{blocks:ue}=wge(ee);if(!ue?.length)return;const ce=await Promise.all(ue.map(me=>{const de=me.name.split("/")[1];return me.attributes.id?(me.attributes.type=de,me.attributes):new Promise((Ae,ye)=>{window.fetch(me.attributes.url).then(Ne=>Ne.blob()).then(Ne=>T({filesList:[Ne],additionalData:{title:me.attributes.title,alt_text:me.attributes.alt,caption:me.attributes.caption,type:de},onFileChange:([je])=>{je.id&&Ae(je)},allowedTypes:t,onError:ye})).catch(()=>Ae(me.attributes.url))})})).catch(me=>h(me));g(d?ce:ce[0])}const P=ee=>{j(ee.target.files)},F=C??(ee=>{let{instructions:ue,title:ce}=r;if(!T&&!A&&(ue=m("To edit this block, you need permission to upload media.")),ue===void 0||ce===void 0){const de=t??[],[Ae]=de,ye=de.length===1,Ne=ye&&Ae==="audio",je=ye&&Ae==="image",ie=ye&&Ae==="video";ue===void 0&&T&&(ue=m("Drag and drop an image or video, upload, or choose from your library."),Ne?ue=m("Drag and drop an audio file, upload, or choose from your library."):je?ue=m("Drag and drop an image, upload, or choose from your library."):ie&&(ue=m("Drag and drop a video, upload, or choose from your library."))),ce===void 0&&(ce=m("Media"),Ne?ce=m("Audio"):je?ce=m("Image"):ie&&(ce=m("Video")))}const me=oe("block-editor-media-placeholder",n,{"is-appender":c});return a.jsxs(vo,{icon:o,label:ce,instructions:ue,className:me,notices:i,onDoubleClick:v,preview:s,style:R,children:[ee,k]})}),X=()=>f?null:a.jsx(Tz,{onFilesDrop:j,onDrop:I,isEligible:ee=>{const ue="wp-block:core/",ce=[];for(const me of ee.types)me.startsWith(ue)&&ce.push(me.slice(ue.length));return ce.every(me=>t.includes(me))&&(d?!0:ce.length===1)}}),Z=()=>z&&a.jsx(Ce,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__cancel-button",title:m("Cancel"),variant:"link",onClick:z,children:m("Cancel")}),V=()=>A&&a.jsx(nNt,{src:E,onChangeSrc:B,onSelectURL:A}),Q=()=>_&&a.jsx("div",{className:"block-editor-media-placeholder__url-input-container",children:a.jsx(Ce,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__button",onClick:_,variant:"secondary",children:m("Use featured image")})}),te=()=>{const ue=S??(({open:me})=>a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{me()},children:m("Media Library")})),ce=a.jsx(ab,{addToGallery:u,gallery:d&&N(),multiple:d,onSelect:g,allowedTypes:t,mode:"browse",value:Array.isArray(e)?e.map(({id:me})=>me):e.id,render:ue});if(T&&c)return a.jsxs(a.Fragment,{children:[X(),a.jsx(kx,{onChange:P,accept:l,multiple:!!d,render:({openFileDialog:me})=>{const de=a.jsxs(a.Fragment,{children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"primary",className:oe("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:me,children:We("Upload","verb")}),ce,V(),Q(),Z()]});return F(de)}})]});if(T){const me=a.jsxs(a.Fragment,{children:[X(),a.jsx(kx,{render:({openFileDialog:de})=>a.jsx(Ce,{__next40pxDefaultSize:!0,onClick:de,variant:"primary",className:oe("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),children:We("Upload","verb")}),onChange:P,accept:l,multiple:!!d}),ce,V(),Q(),Z()]});return F(me)}return F(ce)};return b?a.jsx(Hd,{children:X()}):a.jsx(Hd,{fallback:F(V()),children:te()})}const iu=ap("editor.MediaPlaceholder")(oNt),rNt={placement:"bottom-start"},Qze=()=>a.jsxs(a.Fragment,{children:[["bold","italic","link","unknown"].map(e=>a.jsx(xf,{name:`RichText.ToolbarControls.${e}`},e)),a.jsx(xf,{name:"RichText.ToolbarControls",children:e=>{if(!e.length)return null;const n=e.map(([{props:o}])=>o).some(({isActive:o})=>o);return a.jsx(bs,{children:o=>a.jsx(c0,{icon:tu,label:m("More"),toggleProps:{...o,className:oe(o.className,{"is-pressed":n}),description:m("Displays more block tools")},controls:hO(e.map(([{props:r}])=>r),"title"),popoverProps:rNt})})}})]});function sNt({popoverAnchor:e}){return a.jsx(Io,{placement:"top",focusOnMount:!1,anchor:e,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar",children:a.jsx(tI,{className:"block-editor-rich-text__inline-format-toolbar-group","aria-label":m("Format tools"),children:a.jsx(Wn,{children:a.jsx(Qze,{})})})})}const iNt=({inline:e,editableContentElement:t})=>e?a.jsx(sNt,{popoverAnchor:t}):a.jsx(bt,{group:"inline",children:a.jsx(Qze,{})});function aNt({html:e,value:t}){const n=x.useRef(),o=!!t.activeFormats?.length,{__unstableMarkLastChangeAsPersistent:r}=Oe(J);x.useLayoutEffect(()=>{if(!n.current){n.current=t.text;return}if(n.current!==t.text){const s=window.setTimeout(()=>{r()},1e3);return n.current=t.text,()=>{window.clearTimeout(s)}}r()},[e,o])}function cNt(e){return e(ul).getFormatTypes()}const lNt=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function uNt(e,t){return typeof e!="object"?{[t]:e}:Object.fromEntries(Object.entries(e).map(([n,o])=>[`${t}.${n}`,o]))}function Ote(e,t){return e[t]?e[t]:Object.keys(e).filter(n=>n.startsWith(t+".")).reduce((n,o)=>(n[o.slice(t.length+1)]=e[o],n),{})}function dNt({clientId:e,identifier:t,withoutInteractiveFormatting:n,allowedFormats:o}){const r=G(cNt,[]),s=x.useMemo(()=>r.filter(({name:f,interactive:b,tagName:h})=>!(o&&!o.includes(f)||n&&(b||lNt.has(h)))),[r,o,n]),i=G(f=>s.reduce((b,h)=>h.__experimentalGetPropsForEditableTreePreparation?{...b,...uNt(h.__experimentalGetPropsForEditableTreePreparation(f,{richTextIdentifier:t,blockClientId:e}),h.name)}:b,{}),[s,e,t]),c=Oe(),l=[],u=[],d=[],p=[];for(const f in i)p.push(i[f]);return s.forEach(f=>{if(f.__experimentalCreatePrepareEditableTree){const b=f.__experimentalCreatePrepareEditableTree(Ote(i,f.name),{richTextIdentifier:t,blockClientId:e});f.__experimentalCreateOnChangeEditableValue?u.push(b):l.push(b)}if(f.__experimentalCreateOnChangeEditableValue){let b={};f.__experimentalGetPropsForEditableTreeChangeHandler&&(b=f.__experimentalGetPropsForEditableTreeChangeHandler(c,{richTextIdentifier:t,blockClientId:e}));const h=Ote(i,f.name);d.push(f.__experimentalCreateOnChangeEditableValue({...typeof h=="object"?h:{},...b},{richTextIdentifier:t,blockClientId:e}))}}),{formatTypes:s,prepareHandlers:l,valueHandlers:u,changeHandlers:d,dependencies:p}}const pNt=["`",'"',"'","“”","‘’"],fNt=e=>t=>{function n(o){const{inputType:r,data:s}=o,{value:i,onChange:c,registry:l}=e.current;if(r!=="insertText"||Xl(i))return;const u=gr("blockEditor.wrapSelectionSettings",pNt).find(([y,k])=>y===s||k===s);if(!u)return;const[d,p=d]=u,f=i.start,b=i.end+d.length;let h=E0(i,d,f,f);h=E0(h,p,b,b);const{__unstableMarkLastChangeAsPersistent:g,__unstableMarkAutomaticChange:z}=l.dispatch(J);g(),c(h),z();const A={};for(const y in o)A[y]=o[y];A.data=p;const{ownerDocument:_}=t,{defaultView:v}=_,M=new v.InputEvent("input",A);window.queueMicrotask(()=>{o.target.dispatchEvent(M)}),o.preventDefault()}return t.addEventListener("beforeinput",n),()=>{t.removeEventListener("beforeinput",n)}};function bNt(e){const t="tales of gutenberg",n=" 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️",{start:o,text:r}=e;return ot=>{function n(){const{getValue:r,onReplace:s,selectionChange:i,registry:c}=e.current;if(!s)return;const l=r(),{start:u,text:d}=l;if(d.slice(u-1,u)!==" ")return;const f=d.slice(0,u).trim(),b=Ei("from").filter(({type:A})=>A==="prefix"),h=xc(b,({prefix:A})=>f===A);if(!h)return;const g=T0({value:E0(l,qf,0,u)}),z=h.transform(g);return i(...Jze([z])),s([z]),c.dispatch(J).__unstableMarkAutomaticChange(),!0}function o(r){const{inputType:s,type:i}=r,{getValue:c,onChange:l,__unstableAllowPrefixTransformations:u,formatTypes:d,registry:p}=e.current;if(s!=="insertText"&&i!=="compositionend"||u&&n())return;const f=c(),b=d.reduce((z,{__unstableInputRule:A})=>(A&&(z=A(z)),z),bNt(f)),{__unstableMarkLastChangeAsPersistent:h,__unstableMarkAutomaticChange:g}=p.dispatch(J);b!==f&&(h(),l({...b,activeFormats:f.activeFormats}),g())}return t.addEventListener("input",o),t.addEventListener("compositionend",o),()=>{t.removeEventListener("input",o),t.removeEventListener("compositionend",o)}},mNt=e=>t=>{function n(o){if(o.inputType!=="insertReplacementText")return;const{registry:r}=e.current;r.dispatch(J).__unstableMarkLastChangeAsPersistent()}return t.addEventListener("beforeinput",n),()=>{t.removeEventListener("beforeinput",n)}},gNt=()=>e=>{function t(n){(lc.primary(n,"z")||lc.primary(n,"y")||lc.primaryShift(n,"z"))&&n.preventDefault()}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}},MNt=e=>t=>{const{keyboardShortcuts:n}=e.current;function o(r){for(const s of n.current)s(r)}return t.addEventListener("keydown",o),()=>{t.removeEventListener("keydown",o)}},zNt=e=>t=>{const{inputEvents:n}=e.current;function o(r){for(const s of n.current)s(r)}return t.addEventListener("input",o),()=>{t.removeEventListener("input",o)}},ONt=e=>t=>{function n(o){const{keyCode:r}=o;if(o.defaultPrevented||r!==Mc&&r!==gd)return;const{registry:s}=e.current,{didAutomaticChange:i,getSettings:c}=s.select(J),{__experimentalUndo:l}=c();l&&i()&&(o.preventDefault(),l())}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}};function yNt(e,t){if(t?.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}function e3e(e){if(!(e!==!0&&e!=="p"&&e!=="li"))return e===!0?"p":e}function pI({allowedFormats:e,disableFormats:t}){return t?pI.EMPTY_ARRAY:e}pI.EMPTY_ARRAY=[];const ANt=e=>t=>{function n(r){const{disableFormats:s,onChange:i,value:c,formatTypes:l,tagName:u,onReplace:d,__unstableEmbedURLOnPaste:p,preserveWhiteSpace:f,pastePlainText:b}=e.current;if(!t.contains(r.target)||r.defaultPrevented)return;const{plainText:h,html:g}=T7(r);if(r.preventDefault(),window.console.log(`Received HTML: `,g),window.console.log(`Received plain text: -`,h),s){i(E0(c,h));return}const z=r.clipboardData.getData("rich-text")==="true";function A(y){const k=l.reduce((S,{__unstablePasteRule:C})=>(C&&S===c&&(S=C(c,{html:g,plainText:h})),S),c);if(k!==c)i(k);else{const S=eo({html:y});yNt(S,c.activeFormats),i(E0(c,S))}}if(z){A(g);return}if(b){i(E0(c,eo({text:h})));return}let _="INLINE";const v=h.trim();p&&wE(c)&&Pf(v)&&/^https?:/.test(v)&&(_="BLOCKS");const M=Xh({HTML:g,plainText:h,mode:_,tagName:u,preserveWhiteSpace:f});typeof M=="string"?A(M):M.length>0&&d&&wE(c)&&d(M,M.length-1,-1)}const{defaultView:o}=t.ownerDocument;return o.addEventListener("paste",n),()=>{o.removeEventListener("paste",n)}},vNt=e=>t=>{function n(o){const{keyCode:r,shiftKey:s}=o;if(o.defaultPrevented)return;const{value:i,onMerge:c,onRemove:l}=e.current;if(r===zl||r===Mc){const{start:u,end:d,text:p}=i,f=r===Mc,b=i.activeFormats&&!!i.activeFormats.length;if(!Xl(i)||b||f&&u!==0||!f&&d!==p.length||s)return;c?c(!f):l&&wE(i)&&f&&l(!f),o.preventDefault()}}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},xNt=e=>t=>{function n(s){if(s.keyCode!==Gr)return;const{onReplace:i,onSplit:c}=e.current;i&&c&&(s.__deprecatedOnSplit=!0)}function o(s){if(s.defaultPrevented||s.target!==t||s.keyCode!==Gr)return;const{value:i,onChange:c,disableLineBreaks:l,onSplitAtEnd:u,onSplitAtDoubleLineEnd:d,registry:p}=e.current;s.preventDefault();const{text:f,start:b,end:h}=i;s.shiftKey?l||c(E0(i,` +`,h),s){i(E0(c,h));return}const z=r.clipboardData.getData("rich-text")==="true";function A(y){const k=l.reduce((S,{__unstablePasteRule:C})=>(C&&S===c&&(S=C(c,{html:g,plainText:h})),S),c);if(k!==c)i(k);else{const S=eo({html:y});yNt(S,c.activeFormats),i(E0(c,S))}}if(z){A(g);return}if(b){i(E0(c,eo({text:h})));return}let _="INLINE";const v=h.trim();p&&wE(c)&&If(v)&&/^https?:/.test(v)&&(_="BLOCKS");const M=Xh({HTML:g,plainText:h,mode:_,tagName:u,preserveWhiteSpace:f});typeof M=="string"?A(M):M.length>0&&d&&wE(c)&&d(M,M.length-1,-1)}const{defaultView:o}=t.ownerDocument;return o.addEventListener("paste",n),()=>{o.removeEventListener("paste",n)}},vNt=e=>t=>{function n(o){const{keyCode:r,shiftKey:s}=o;if(o.defaultPrevented)return;const{value:i,onMerge:c,onRemove:l}=e.current;if(r===zl||r===Mc){const{start:u,end:d,text:p}=i,f=r===Mc,b=i.activeFormats&&!!i.activeFormats.length;if(!Xl(i)||b||f&&u!==0||!f&&d!==p.length||s)return;c?c(!f):l&&wE(i)&&f&&l(!f),o.preventDefault()}}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},xNt=e=>t=>{function n(s){if(s.keyCode!==Gr)return;const{onReplace:i,onSplit:c}=e.current;i&&c&&(s.__deprecatedOnSplit=!0)}function o(s){if(s.defaultPrevented||s.target!==t||s.keyCode!==Gr)return;const{value:i,onChange:c,disableLineBreaks:l,onSplitAtEnd:u,onSplitAtDoubleLineEnd:d,registry:p}=e.current;s.preventDefault();const{text:f,start:b,end:h}=i;s.shiftKey?l||c(E0(i,` `)):u&&b===h&&h===f.length?u():d&&b===h&&h===f.length&&f.slice(-2)===` `?p.batch(()=>{const g={...i};g.start=g.end-2,c(pa(g)),d()}):l||c(E0(i,` -`))}const{defaultView:r}=t.ownerDocument;return r.addEventListener("keydown",o),t.addEventListener("keydown",n),()=>{r.removeEventListener("keydown",o),t.removeEventListener("keydown",n)}},wNt=e=>t=>{function n(){const{registry:o}=e.current;if(!o.select(J).isMultiSelecting())return;const r=t.parentElement.closest('[contenteditable="true"]');r&&r.focus()}return t.addEventListener("focus",n),()=>{t.removeEventListener("focus",n)}},_Nt=[fNt,hNt,mNt,gNt,MNt,zNt,ONt,ANt,vNt,xNt,wNt];function kNt(e){const t=x.useRef(e);x.useInsertionEffect(()=>{t.current=e});const n=x.useMemo(()=>_Nt.map(o=>o(t)),[t]);return Mn(o=>{if(!e.isSelected)return;const r=n.map(s=>s(o));return()=>{r.forEach(s=>s())}},[n,e.isSelected])}const SNt={},t3e=Symbol("usesContext");function CNt({onChange:e,onFocus:t,value:n,forwardedRef:o,settings:r}){const{name:s,edit:i,[t3e]:c}=r,l=x.useContext(Cf),u=x.useMemo(()=>c?Object.fromEntries(Object.entries(l).filter(([h])=>c.includes(h))):SNt,[c,l]);if(!i)return null;const d=QN(n,s),p=d!==void 0,f=Pqe(n),b=f!==void 0&&f.type===s;return a.jsx(i,{isActive:p,activeAttributes:p?d.attributes||{}:{},isObjectActive:b,activeObjectAttributes:b?f.attributes||{}:{},value:n,onChange:e,onFocus:t,contentRef:o,context:u},s)}function qNt({formatTypes:e,...t}){return e.map(n=>x.createElement(CNt,{settings:n,...t,key:n.name}))}function n3e(e,t){if(Ie.isEmpty(e)){const n=e3e(t);return n?`<${n}>`:""}return Array.isArray(e)?(Ke("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/"}),QE.toHTML(e)):typeof e=="string"?e:e.toHTMLString()}function fI({value:e,tagName:t,multiline:n,format:o,...r}){return e=a.jsx(i0,{children:n3e(e,n)}),t?a.jsx(t,{...r,children:e}):e}function RNt({children:e,identifier:t,tagName:n="div",value:o="",onChange:r,multiline:s,...i},c){Ke("wp.blockEditor.RichText multiline prop",{since:"6.1",version:"6.3",alternative:"nested blocks (InnerBlocks)",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/nested-blocks-inner-blocks/"});const{clientId:l}=j0(),{getSelectionStart:u,getSelectionEnd:d}=G(J),{selectionChange:p}=Oe(J),f=e3e(s);o=o||`<${f}>`;const h=`${o}<${f}>`.split(`<${f}>`);h.shift(),h.pop();function g(z){r(`<${f}>${z.join(`<${f}>`)}`)}return a.jsx(n,{ref:c,children:h.map((z,A)=>a.jsx(hI,{identifier:`${t}-${A}`,tagName:f,value:z,onChange:_=>{const v=h.slice();v[A]=_,g(v)},isSelected:void 0,onKeyDown:_=>{if(_.keyCode!==Gr)return;_.preventDefault();const{offset:v}=u(),{offset:M}=d();if(typeof v!="number"||typeof M!="number")return;const y=eo({html:z});y.start=v,y.end=M;const k=JN(y).map(C=>T0({value:C})),S=h.slice();S.splice(A,1,...k),g(S),p(l,`${t}-${A+1}`,0,0)},onMerge:_=>{const v=h.slice();let M=0;if(_){if(!v[A+1])return;v.splice(A,2,v[A]+v[A+1]),M=v[A].length-1}else{if(!v[A-1])return;v.splice(A-1,2,v[A-1]+v[A]),M=v[A-1].length-1}g(v),p(l,`${t}-${A-(_?0:1)}`,M,M)},...i},A))})}const TNt=x.forwardRef(RNt);function ENt(e){return x.forwardRef((t,n)=>{let o=t.value,r=t.onChange;Array.isArray(o)&&(Ke("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/"}),o=QE.toHTML(t.value),r=i=>t.onChange(QE.fromDOM(dl(document,i).childNodes)));const s=t.multiline?TNt:e;return a.jsx(s,{...t,value:o,onChange:r,ref:n})})}function Xd({character:e,type:t,onUse:n}){const o=x.useContext(o3e),r=x.useRef();return r.current=n,x.useEffect(()=>{function s(i){lc[t](i,e)&&(r.current(),i.preventDefault())}return o.current.add(s),()=>{o.current.delete(s)}},[e,t]),null}function Zs({name:e,shortcutType:t,shortcutCharacter:n,...o}){let r,s="RichText.ToolbarControls";return e&&(s+=`.${e}`),t&&n&&(r=j1[t](n)),a.jsx(um,{name:s,children:a.jsx(Vt,{...o,shortcut:r})})}function bI({inputType:e,onInput:t}){const n=x.useContext(r3e),o=x.useRef();return o.current=t,x.useEffect(()=>{function r(s){s.inputType===e&&(o.current(),s.preventDefault())}return n.current.add(r),()=>{n.current.delete(r)}},[e]),null}const o3e=x.createContext(),r3e=x.createContext(),yte=Symbol("instanceId");function s3e(e){const{__unstableMobileNoFocusOnMount:t,deleteEnter:n,placeholderTextColor:o,textAlign:r,selectionColor:s,tagsToEliminate:i,disableEditingMenu:c,fontSize:l,fontFamily:u,fontWeight:d,fontStyle:p,minWidth:f,maxWidth:b,disableSuggestions:h,disableAutocorrection:g,...z}=e;return z}function hI({children:e,tagName:t="div",value:n="",onChange:o,isSelected:r,multiline:s,inlineToolbar:i,wrapperClassName:c,autocompleters:l,onReplace:u,placeholder:d,allowedFormats:p,withoutInteractiveFormatting:f,onRemove:b,onMerge:h,onSplit:g,__unstableOnSplitAtEnd:z,__unstableOnSplitAtDoubleLineEnd:A,identifier:_,preserveWhiteSpace:v,__unstablePastePlainText:M,__unstableEmbedURLOnPaste:y,__unstableDisableFormats:k,disableLineBreaks:S,__unstableAllowPrefixTransformations:C,readOnly:R,...T},E){T=s3e(T),g&&Ke("wp.blockEditor.RichText onSplit prop",{since:"6.4",alternative:'block.json support key: "splitting"'});const B=vt(hI),N=x.useRef(),j=j0(),{clientId:I,isSelected:P,name:$}=j,F=j[KB],X=x.useContext(Cf),Z=Fn(),V=fe=>{if(!P)return{isSelected:!1};const{getSelectionStart:Re,getSelectionEnd:be}=fe(J),ze=Re(),nt=be();let Mt;return r===void 0?Mt=ze.clientId===I&&nt.clientId===I&&(_?ze.attributeKey===_:ze[yte]===B):r&&(Mt=ze.clientId===I),{selectionStart:Mt?ze.offset:void 0,selectionEnd:Mt?nt.offset:void 0,isSelected:Mt}},{selectionStart:Q,selectionEnd:te,isSelected:ee}=G(V,[I,_,B,r,P]),{disableBoundBlock:ue,bindingsPlaceholder:ce,bindingsLabel:me}=G(fe=>{var Re;if(!F?.[_]||!a7($))return{};const be=F[_],ze=vl(be.source),nt={};if(ze?.usesContext?.length)for(const rr of ze.usesContext)nt[rr]=X[rr];const Mt=!ze?.canUserEditValue?.({select:fe,context:nt,args:be.args});if(n.length>0)return{disableBoundBlock:Mt,bindingsPlaceholder:null,bindingsLabel:null};const{getBlockAttributes:ot}=fe(J),Ue=ot(I),fn=(Re=ze?.getFieldsList?.({select:fe,context:nt})?.[be?.args?.key]?.label)!==null&&Re!==void 0?Re:ze?.label,Ln=Mt?fn:xe(m("Add %s"),fn),Mo=Mt?be?.args?.key||ze?.label:xe(m("Empty %s; start writing to edit its value"),be?.args?.key||ze?.label);return{disableBoundBlock:Mt,bindingsPlaceholder:Ue?.placeholder||Ln,bindingsLabel:Mo}},[F,_,$,n,I,X]),de=R||ue,{getSelectionStart:Ae,getSelectionEnd:ye,getBlockRootClientId:Ne}=G(J),{selectionChange:je}=Oe(J),ie=pI({allowedFormats:p,disableFormats:k}),we=!ie||ie.length>0,re=x.useCallback((fe,Re)=>{const be={},ze=fe===void 0&&Re===void 0,nt={clientId:I,[_?"attributeKey":yte]:_||B};if(typeof fe=="number"||ze){if(Re===void 0&&Ne(I)!==Ne(ye().clientId))return;be.start={...nt,offset:fe}}if(typeof Re=="number"||ze){if(fe===void 0&&Ne(I)!==Ne(Ae().clientId))return;be.end={...nt,offset:Re}}je(be)},[I,Ne,ye,Ae,_,B,je]),{formatTypes:pe,prepareHandlers:ke,valueHandlers:Se,changeHandlers:se,dependencies:L}=dNt({clientId:I,identifier:_,withoutInteractiveFormatting:f,allowedFormats:ie});function U(fe){return Se.reduce((Re,be)=>be(Re,fe.text),fe.formats)}function ne(fe){return pe.forEach(Re=>{Re.__experimentalCreatePrepareEditableTree&&(fe=Yd(fe,Re.name,0,fe.text.length))}),fe.formats}function ve(fe){return ke.reduce((Re,be)=>be(Re,fe.text),fe.formats)}const{value:qe,getValue:Pe,onChange:rt,ref:qt}=e1e({value:n,onChange(fe,{__unstableFormats:Re,__unstableText:be}){o(fe),Object.values(se).forEach(ze=>{ze(Re,be)})},selectionStart:Q,selectionEnd:te,onSelectionChange:re,placeholder:ce||d,__unstableIsSelected:ee,__unstableDisableFormats:k,preserveWhiteSpace:v,__unstableDependencies:[...L,t],__unstableAfterParse:U,__unstableBeforeSerialize:ne,__unstableAddInvisibleFormats:ve}),wt=Jyt({onReplace:u,completers:l,record:qe,onChange:rt});aNt({html:n,value:qe});const Bt=x.useRef(new Set),ae=x.useRef(new Set);function H(){N.current?.focus()}const Y=t;return a.jsxs(a.Fragment,{children:[ee&&a.jsx(o3e.Provider,{value:Bt,children:a.jsx(r3e.Provider,{value:ae,children:a.jsxs(Io.__unstableSlotNameProvider,{value:"__unstable-block-tools-after",children:[e&&e({value:qe,onChange:rt,onFocus:H}),a.jsx(qNt,{value:qe,onChange:rt,onFocus:H,formatTypes:pe,forwardedRef:N})]})})}),ee&&we&&a.jsx(iNt,{inline:i,editableContentElement:N.current}),a.jsx(Y,{role:"textbox","aria-multiline":!S,"aria-readonly":de,...T,draggable:void 0,"aria-label":me||T["aria-label"]||d,...wt,ref:xn([qt,E,wt.ref,T.ref,kNt({registry:Z,getValue:Pe,onChange:rt,__unstableAllowPrefixTransformations:C,formatTypes:pe,onReplace:u,selectionChange:je,isSelected:ee,disableFormats:k,value:qe,tagName:t,onSplit:g,__unstableEmbedURLOnPaste:y,pastePlainText:M,onMerge:h,onRemove:b,removeEditorOnlyFormats:ne,disableLineBreaks:S,onSplitAtEnd:z,onSplitAtDoubleLineEnd:A,keyboardShortcuts:Bt,inputEvents:ae}),N]),contentEditable:!de,suppressContentEditableWarning:!0,className:oe("block-editor-rich-text__editable",T.className,"rich-text"),tabIndex:T.tabIndex===0&&!de?null:T.tabIndex,"data-wp-block-attribute-key":_})]})}const Q_=ENt(x.forwardRef(hI));Q_.Content=fI;Q_.isEmpty=e=>!e||e.length===0;const Ie=x.forwardRef((e,t)=>{if(j0()[oae]){const{children:r,tagName:s="div",value:i,onChange:c,isSelected:l,multiline:u,inlineToolbar:d,wrapperClassName:p,autocompleters:f,onReplace:b,placeholder:h,allowedFormats:g,withoutInteractiveFormatting:z,onRemove:A,onMerge:_,onSplit:v,__unstableOnSplitAtEnd:M,__unstableOnSplitAtDoubleLineEnd:y,identifier:k,preserveWhiteSpace:S,__unstablePastePlainText:C,__unstableEmbedURLOnPaste:R,__unstableDisableFormats:T,disableLineBreaks:E,__unstableAllowPrefixTransformations:B,readOnly:N,...j}=s3e(e);return a.jsx(s,{...j,dangerouslySetInnerHTML:{__html:n3e(i,u)}})}return a.jsx(Q_,{ref:t,...e,readOnly:!1})});Ie.Content=fI;Ie.isEmpty=e=>!e||e.length===0;const i3e=x.forwardRef((e,t)=>a.jsx(Ie,{ref:t,...e,__unstableDisableFormats:!0}));i3e.Content=({value:e="",tagName:t="div",...n})=>a.jsx(t,{...n,children:e});const Gd=x.forwardRef(({__experimentalVersion:e,...t},n)=>{if(e===2)return a.jsx(i3e,{ref:n,...t});const{className:o,onChange:r,...s}=t;return a.jsx(b7,{ref:n,className:oe("block-editor-plain-text",o),onChange:i=>r(i.target.value),...s})}),Ate=a.jsx(ge,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:a.jsx(he,{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"})});function WNt(e,t){const n=G(r=>r(J).__unstableGetEditorMode(),[]),{__unstableSetEditorMode:o}=Oe(J);return a.jsx(so,{renderToggle:({isOpen:r,onToggle:s})=>a.jsx(Ce,{size:"compact",...e,ref:t,icon:n==="navigation"?Nd:Ate,"aria-expanded":r,"aria-haspopup":"true",onClick:s,label:m("Tools")}),popoverProps:{placement:"bottom-start"},renderContent:()=>a.jsxs(a.Fragment,{children:[a.jsx(pm,{className:"block-editor-tool-selector__menu",role:"menu","aria-label":m("Tools"),children:a.jsx(kf,{value:n==="navigation"?"navigation":"edit",onSelect:r=>{o(r)},choices:[{value:"navigation",label:a.jsxs(a.Fragment,{children:[a.jsx(wn,{icon:Nd}),m("Write")]}),info:m("Focus on content."),"aria-label":m("Write")},{value:"edit",label:a.jsxs(a.Fragment,{children:[Ate,m("Design")]}),info:m("Edit layout and styles."),"aria-label":m("Design")}]})}),a.jsx("div",{className:"block-editor-tool-selector__help",children:m("Tools provide different sets of interactions for blocks. Toggle between simplified content tools (Write) and advanced visual editing tools (Design).")})]})})}const NNt=x.forwardRef(WNt),iT="none",vte="custom",xte="media",wte="attachment",_te=["noreferrer","noopener"],a3e=({linkDestination:e,onChangeUrl:t,url:n,mediaType:o="image",mediaUrl:r,mediaLink:s,linkTarget:i,linkClass:c,rel:l,showLightboxSetting:u,lightboxEnabled:d,onSetLightbox:p,resetLightbox:f})=>{const[b,h]=x.useState(!1),[g,z]=x.useState(null),A=()=>{h(!0)},[_,v]=x.useState(!1),[M,y]=x.useState(null),k=x.useRef(null),S=x.useRef();x.useEffect(()=>{if(!S.current)return;(Xr.focusable.find(S.current)[0]||S.current).focus()},[_,n,d]);const C=()=>{(e===xte||e===wte)&&y(""),v(!0)},R=()=>{v(!1)},T=()=>{y(null),R(),h(!1)},E=ce=>{const me=ce?"_blank":void 0;let de;if(me){const Ae=(l??"").split(" ");_te.forEach(ye=>{Ae.includes(ye)||Ae.push(ye)}),de=Ae.join(" ")}else{const Ae=(l??"").split(" ").filter(ye=>_te.includes(ye)===!1);de=Ae.length?Ae.join(" "):void 0}return{linkTarget:me,rel:de}},B=()=>ce=>{const me=k.current;me&&me.contains(ce.target)||(h(!1),y(null),R())},N=()=>ce=>{if(M){const me=I().find(de=>de.url===M)?.linkDestination||vte;t({href:M,linkDestination:me,lightbox:{enabled:!1}})}R(),y(null),ce.preventDefault()},j=()=>{t({linkDestination:iT,href:""})},I=()=>{const ce=[{linkDestination:xte,title:m("Link to image file"),url:o==="image"?r:void 0,icon:Oz}];return o==="image"&&s&&ce.push({linkDestination:wte,title:m("Link to attachment page"),url:o==="image"?s:void 0,icon:wa}),ce},P=ce=>{const me=I();let de;ce?de=(me.find(Ae=>Ae.url===ce)||{linkDestination:vte}).linkDestination:de=iT,t({linkDestination:de,href:ce})},$=ce=>{const me=E(ce);t(me)},F=ce=>{t({rel:ce})},X=ce=>{t({linkClass:ce})},Z=a.jsxs(dt,{spacing:"3",children:[a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Open in new tab"),onChange:$,checked:i==="_blank"}),a.jsx(dn,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:m("Link rel"),value:l??"",onChange:F}),a.jsx(dn,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:m("Link CSS class"),value:c||"",onChange:X})]}),V=M!==null?M:n,Q=!d||d&&!u,te=!V&&Q,ee=(I().find(ce=>ce.linkDestination===e)||{}).title,ue=()=>{if(d&&u&&!n&&!_)return a.jsxs("div",{className:"block-editor-url-popover__expand-on-click",children:[a.jsx(wn,{icon:zz}),a.jsxs("div",{className:"text",children:[a.jsx("p",{children:m("Enlarge on click")}),a.jsx("p",{className:"description",children:m("Scales the image with a lightbox effect")})]}),a.jsx(Ce,{icon:Pl,label:m("Disable enlarge on click"),onClick:()=>{p?.(!1)},size:"compact"})]});if(!n||_)return a.jsx(lf.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:V,onChangeInputValue:y,onSubmit:N(),autocompleteRef:k});if(n&&!_)return a.jsxs(a.Fragment,{children:[a.jsx(lf.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:n,onEditLinkClick:C,urlLabel:ee}),a.jsx(Ce,{icon:Pl,label:m("Remove link"),onClick:()=>{j(),f?.()},size:"compact"})]})};return a.jsxs(a.Fragment,{children:[a.jsx(Vt,{icon:xa,className:"components-toolbar__control",label:m("Link"),"aria-expanded":b,onClick:A,ref:z,isActive:!!n||d&&u}),b&&a.jsx(lf,{ref:S,anchor:g,onFocusOutside:B(),onClose:T,renderSettings:Q?()=>Z:null,additionalControls:te&&a.jsxs(pm,{children:[I().map(ce=>a.jsx(Ct,{icon:ce.icon,iconPosition:"left",onClick:()=>{y(null),P(ce.url),R()},children:ce.title},ce.linkDestination)),u&&a.jsx(Ct,{className:"block-editor-url-popover__expand-on-click",icon:zz,info:m("Scale the image with a lightbox effect."),iconPosition:"left",onClick:()=>{y(null),t({linkDestination:iT,href:""}),p?.(!0),R()},children:m("Enlarge on click")},"expand-on-click")]}),offset:13,children:ue()})]})};function BNt(e){const[t,n]=x.useState(window.innerWidth);x.useEffect(()=>{if(e==="Desktop")return;const s=()=>n(window.innerWidth);return window.addEventListener("resize",s),()=>{window.removeEventListener("resize",s)}},[e]);const o=s=>{let i;switch(s){case"Tablet":i=780;break;case"Mobile":i=360;break;default:return null}return i{const i=s==="Mobile"?"768px":"1024px",c="40px",l="auto";switch(s){case"Tablet":case"Mobile":return{width:o(s),marginTop:c,marginBottom:c,marginLeft:l,marginRight:l,height:i,maxWidth:"100%"};default:return{marginLeft:l,marginRight:l}}})(e)}function LNt(){const e=G(o=>o(J).getBlockSelectionStart(),[]),t=x.useRef();f7(e,t);const n=()=>{t.current?.focus()};return e?a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:n,children:m("Skip to the selected block")}):null}function PNt(){const e=G(t=>t(J).getSelectedBlockCount(),[]);return a.jsxs(Ot,{justify:"flex-start",spacing:2,className:"block-editor-multi-selection-inspector__card",children:[a.jsx(Zn,{icon:H3,showColors:!0}),a.jsx("div",{className:"block-editor-multi-selection-inspector__card-title",children:xe(Dn("%d Block","%d Blocks",e),e)})]})}const c3e={name:"settings",title:m("Settings"),value:"settings",icon:Zue},l3e={name:"styles",title:m("Styles"),value:"styles",icon:jde},UW={name:"list",title:m("List View"),value:"list-view",icon:LP},u3e=()=>{const e=H0(j_.slotName);return!(e&&e.length)?null:a.jsx(Qt,{className:"block-editor-block-inspector__advanced",title:m("Advanced"),initialOpen:!1,children:a.jsx(et.Slot,{group:"advanced"})})},jNt=()=>{const[e,t]=x.useState(),{multiSelectedBlocks:n}=G(o=>{const{getBlocksByClientId:r,getSelectedBlockClientIds:s}=o(J),i=s();return{multiSelectedBlocks:r(i)}},[]);return x.useLayoutEffect(()=>{e===void 0&&t(n.some(({attributes:o})=>!!o?.style?.position?.type))},[e,n,t]),a.jsx(Qt,{className:"block-editor-block-inspector__position",title:m("Position"),initialOpen:e??!1,children:a.jsx(et.Slot,{group:"position"})})},d3e=()=>{const e=H0(L_.position.name);return!(e&&e.length)?null:a.jsx(jNt,{})},INt=({showAdvancedControls:e=!1})=>a.jsxs(a.Fragment,{children:[a.jsx(et.Slot,{}),a.jsx(d3e,{}),a.jsx(et.Slot,{group:"bindings"}),e&&a.jsx("div",{children:a.jsx(u3e,{})})]}),DNt=({blockName:e,clientId:t,hasBlockStyles:n})=>{const o=G_({blockName:e});return a.jsxs(a.Fragment,{children:[n&&a.jsx("div",{children:a.jsx(Qt,{title:m("Styles"),children:a.jsx(Lze,{clientId:t})})}),a.jsx(et.Slot,{group:"color",label:m("Color"),className:"color-block-support-panel__inner-wrapper"}),a.jsx(et.Slot,{group:"background",label:m("Background image")}),a.jsx(et.Slot,{group:"filter"}),a.jsx(et.Slot,{group:"typography",label:m("Typography")}),a.jsx(et.Slot,{group:"dimensions",label:m("Dimensions")}),a.jsx(et.Slot,{group:"border",label:o}),a.jsx(et.Slot,{group:"styles"})]})},FNt=["core/navigation"],p3e=e=>!FNt.includes(e),{Tabs:Np}=ct(tr);function f3e({blockName:e,clientId:t,hasBlockStyles:n,tabs:o}){const r=G(i=>i(ht).get("core","showIconLabels"),[]),s=p3e(e)?void 0:UW.name;return a.jsx("div",{className:"block-editor-block-inspector__tabs",children:a.jsxs(Np,{defaultTabId:s,children:[a.jsx(Np.TabList,{children:o.map(i=>r?a.jsx(Np.Tab,{tabId:i.name,children:i.title},i.name):a.jsx(B0,{text:i.title,children:a.jsx(Np.Tab,{tabId:i.name,"aria-label":i.title,children:a.jsx(qo,{icon:i.icon})})},i.name))}),a.jsx(Np.TabPanel,{tabId:c3e.name,focusable:!1,children:a.jsx(INt,{showAdvancedControls:!!e})}),a.jsx(Np.TabPanel,{tabId:l3e.name,focusable:!1,children:a.jsx(DNt,{blockName:e,clientId:t,hasBlockStyles:n})}),a.jsx(Np.TabPanel,{tabId:UW.name,focusable:!1,children:a.jsx(et.Slot,{group:"list"})})]},t)})}const $Nt=[];function VNt(e,t={}){return t[e]!==void 0?t[e]:t.default!==void 0?t.default:!0}function b3e(e){const t=[],{bindings:n,border:o,color:r,default:s,dimensions:i,list:c,position:l,styles:u,typography:d,effects:p}=L_,f=p3e(e),b=H0(c.name),h=!f&&!!b&&b.length,z=[...H0(o.name)||[],...H0(r.name)||[],...H0(i.name)||[],...H0(u.name)||[],...H0(d.name)||[],...H0(p.name)||[]].length,A=[...H0(j_.slotName)||[],...H0(n.name)||[]],_=[...H0(s.name)||[],...H0(l.name)||[],...h&&z>1?A:[]];h&&t.push(UW),_.length&&t.push(c3e),z&&t.push(l3e);const v=G(y=>y(J).getSettings().blockInspectorTabs,[]);return VNt(e,v)?t:$Nt}function HNt(e){return G(t=>{if(e){const n=t(J).getSettings().blockInspectorAnimation,o=n?.animationParent,{getSelectedBlockClientId:r,getBlockParentsByBlockName:s}=t(J),i=r();return!s(i,o,!0)[0]&&e.name!==o?null:n?.[e.name]}return null},[e])}function h3e({clientIds:e,onSelect:t}){return e.length?a.jsx(dt,{spacing:1,children:e.map(n=>a.jsx(UNt,{onSelect:t,clientId:n},n))}):null}function UNt({clientId:e,onSelect:t}){const n=ji(e),o=Fd({clientId:e,context:"list-view"}),{isSelected:r}=G(i=>{const{isBlockSelected:c,hasSelectedInnerBlock:l}=i(J);return{isSelected:c(e)||l(e,!0)}},[e]),{selectBlock:s}=Oe(J);return a.jsx(Ce,{__next40pxDefaultSize:!0,isPressed:r,onClick:async()=>{await s(e),t&&t(e)},children:a.jsxs(Yo,{children:[a.jsx(Tn,{children:a.jsx(Zn,{icon:n?.icon})}),a.jsx(eu,{style:{textAlign:"left"},children:a.jsx(zs,{children:o})})]})})}function XNt({clientId:e}){return a.jsx(Qt,{title:m("Styles"),children:a.jsx(Lze,{clientId:e})})}function m3e(){const{count:e,selectedBlockName:t,selectedBlockClientId:n,blockType:o,isSectionBlock:r}=G(d=>{const{getSelectedBlockClientId:p,getSelectedBlockCount:f,getBlockName:b,getParentSectionBlock:h,isSectionBlock:g}=ct(d(J)),z=p(),A=h(z)||p(),_=A&&b(A),v=_&&on(_);return{count:f(),selectedBlockClientId:A,selectedBlockName:_,blockType:v,isSectionBlock:g(A)}},[]),s=b3e(o?.name),i=s?.length>1,c=HNt(o),l=G_({blockName:t});if(e>1&&!r)return a.jsxs("div",{className:"block-editor-block-inspector",children:[a.jsx(PNt,{}),i?a.jsx(f3e,{tabs:s}):a.jsxs(a.Fragment,{children:[a.jsx(et.Slot,{}),a.jsx(et.Slot,{group:"color",label:m("Color"),className:"color-block-support-panel__inner-wrapper"}),a.jsx(et.Slot,{group:"background",label:m("Background image")}),a.jsx(et.Slot,{group:"typography",label:m("Typography")}),a.jsx(et.Slot,{group:"dimensions",label:m("Dimensions")}),a.jsx(et.Slot,{group:"border",label:l}),a.jsx(et.Slot,{group:"styles"})]})]});const u=t===g3();return!o||!n||u?a.jsx("span",{className:"block-editor-block-inspector__no-blocks",children:m("No block selected.")}):a.jsx(GNt,{animate:c,wrapper:d=>a.jsx(KNt,{blockInspectorAnimationSettings:c,selectedBlockClientId:n,children:d}),children:a.jsx(YNt,{clientId:n,blockName:o.name,isSectionBlock:r})})}const GNt=({animate:e,wrapper:t,children:n})=>e?t(n):n,KNt=({blockInspectorAnimationSettings:e,selectedBlockClientId:t,children:n})=>{const o=e&&e.enterDirection==="leftToRight"?-50:50;return a.jsx(Rr.div,{animate:{x:0,opacity:1,transition:{ease:"easeInOut",duration:.14}},initial:{x:o,opacity:0},children:n},t)},YNt=({clientId:e,blockName:t,isSectionBlock:n})=>{const o=b3e(t),r=!n&&o?.length>1,s=G(u=>{const{getBlockStyles:d}=u(kt),p=d(t);return p&&p.length>0},[t]),i=ji(e),c=G_({blockName:t}),l=G(u=>{if(!n)return;const{getClientIdsOfDescendants:d,getBlockName:p,getBlockEditingMode:f}=u(J);return d(e).filter(b=>p(b)!=="core/list-item"&&f(b)==="contentOnly")},[n,e]);return a.jsxs("div",{className:"block-editor-block-inspector",children:[a.jsx(hme,{...i,className:i.isSynced&&"is-synced"}),a.jsx(sWt,{blockClientId:e}),r&&a.jsx(f3e,{hasBlockStyles:s,clientId:e,blockName:t,tabs:o}),!r&&a.jsxs(a.Fragment,{children:[s&&a.jsx(XNt,{clientId:e}),l&&l?.length>0&&a.jsx(Qt,{title:m("Content"),children:a.jsx(h3e,{clientIds:l})}),!n&&a.jsxs(a.Fragment,{children:[a.jsx(et.Slot,{}),a.jsx(et.Slot,{group:"list"}),a.jsx(et.Slot,{group:"color",label:m("Color"),className:"color-block-support-panel__inner-wrapper"}),a.jsx(et.Slot,{group:"background",label:m("Background image")}),a.jsx(et.Slot,{group:"typography",label:m("Typography")}),a.jsx(et.Slot,{group:"dimensions",label:m("Dimensions")}),a.jsx(et.Slot,{group:"border",label:c}),a.jsx(et.Slot,{group:"styles"}),a.jsx(d3e,{}),a.jsx(et.Slot,{group:"bindings"}),a.jsx("div",{children:a.jsx(u3e,{})})]})]}),a.jsx(LNt,{},"back")]})},ZNt=()=>{};function QNt({rootClientId:e,clientId:t,isAppender:n,showInserterHelpPanel:o,showMostUsedBlocks:r=!1,__experimentalInsertionIndex:s,__experimentalInitialTab:i,__experimentalInitialCategory:c,__experimentalFilterValue:l,onPatternCategorySelection:u,onSelect:d=ZNt,shouldFocusBlock:p=!1,onClose:f},b){const{destinationRootClientId:h}=G(g=>{const{getBlockRootClientId:z}=g(J);return{destinationRootClientId:e||z(t)||void 0}},[t,e]);return a.jsx(Oge,{onSelect:d,rootClientId:h,clientId:t,isAppender:n,showInserterHelpPanel:o,showMostUsedBlocks:r,__experimentalInsertionIndex:s,__experimentalFilterValue:l,onPatternCategorySelection:u,__experimentalInitialTab:i,__experimentalInitialCategory:c,shouldFocusBlock:p,ref:b,onClose:f})}const g3e=x.forwardRef(QNt);function JNt(e,t){return a.jsx(g3e,{...e,onPatternCategorySelection:void 0,ref:t})}x.forwardRef(JNt);window.navigator.userAgent.indexOf("Trident");const eBt=new Set([cc,Ps,wi,_i]),tBt=.75;function nBt(){const e=G(t=>t(J).hasSelectedBlock(),[]);return Mn(t=>{if(!e)return;const{ownerDocument:n}=t,{defaultView:o}=n;let r,s,i;function c(){r||(r=o.requestAnimationFrame(()=>{f(),r=null}))}function l(g){s&&o.cancelAnimationFrame(s),s=o.requestAnimationFrame(()=>{u(g),s=null})}function u({keyCode:g}){if(!b())return;const z=yE(o);if(!z)return;if(!i){i=z;return}if(eBt.has(g)){i=z;return}const A=z.top-i.top;if(A===0)return;const _=ps(t);if(!_)return;const v=_===n.body||_===n.documentElement,M=v?o.scrollY:_.scrollTop,y=v?0:_.getBoundingClientRect().top,k=v?i.top/o.innerHeight:(i.top-y)/(o.innerHeight-y);if(M===0&&ky+S||i.top{o.removeEventListener("scroll",c,!0),o.removeEventListener("resize",c,!0),t.removeEventListener("keydown",l),t.removeEventListener("keyup",u),t.removeEventListener("mousedown",d),t.removeEventListener("touchstart",d),n.removeEventListener("selectionchange",p),o.cancelAnimationFrame(r),o.cancelAnimationFrame(s)}},[e])}const XW=x.createContext({});function oBt(e,t,n){const o={...e,[t]:e[t]?new Set(e[t]):new Set};return o[t].add(n),o}function TO({children:e,uniqueId:t,blockName:n=""}){const o=x.useContext(XW),{name:r}=j0();n=n||r;const s=x.useMemo(()=>oBt(o,n,t),[o,n,t]);return a.jsx(XW.Provider,{value:s,children:e})}function J_(e,t=""){const n=x.useContext(XW),{name:o}=j0();return t=t||o,!!n[t]?.has(e)}function Qs({title:e,help:t,actions:n=[],onClose:o}){return a.jsxs(dt,{className:"block-editor-inspector-popover-header",spacing:4,children:[a.jsxs(Ot,{alignment:"center",children:[a.jsx(_a,{className:"block-editor-inspector-popover-header__heading",level:2,size:13,children:e}),a.jsx(t1,{}),n.map(({label:r,icon:s,onClick:i})=>a.jsx(Ce,{size:"small",className:"block-editor-inspector-popover-header__action",label:r,icon:s,variant:!s&&"tertiary",onClick:i,children:!s&&r},r)),o&&a.jsx(Ce,{size:"small",className:"block-editor-inspector-popover-header__action",label:m("Close"),icon:rp,onClick:o})]}),t&&a.jsx(Sn,{children:t})]})}function rBt({onClose:e,onChange:t,showPopoverHeaderActions:n,isCompact:o,currentDate:r,...s},i){const c={startOfWeek:Sa().l10n.startOfWeek,onChange:t,currentDate:o?void 0:r,currentTime:o?r:void 0,...s},l=o?lO:dft;return a.jsxs("div",{ref:i,className:"block-editor-publish-date-time-picker",children:[a.jsx(Qs,{title:m("Publish"),actions:n?[{label:m("Now"),onClick:()=>t?.(null)}]:void 0,onClose:e}),a.jsx(l,{...c})]})}const M3e=x.forwardRef(rBt);function sBt(e,t){return a.jsx(M3e,{...e,showPopoverHeaderActions:!0,isCompact:!1,ref:t})}const iBt=x.forwardRef(sBt);function Jr(e){const t=j0(),{clientId:n=""}=t,{setBlockEditingMode:o,unsetBlockEditingMode:r}=Oe(J),s=G(i=>n?null:i(J).getBlockEditingMode(),[n]);return x.useEffect(()=>(e&&o(n,e),()=>{e&&r(n)}),[n,e,o,r]),n?t[nae]:s}const Ii=e=>{if(e===null||typeof e!="object"||Array.isArray(e))return e;const t=Object.entries(e).map(([n,o])=>[n,Ii(o)]).filter(([,n])=>n!==void 0);return t.length?Object.fromEntries(t):void 0};function z3e(e,t,n,o,r,s){if(Object.values(e??{}).every(l=>!l)||s.length===1&&n.innerBlocks.length===o.length)return n;let i=o[0]?.attributes;if(s.length>1&&o.length>1)if(o[r])i=o[r]?.attributes;else return n;let c=n;return Object.entries(e).forEach(([l,u])=>{u&&t[l].forEach(d=>{const p=fo(i,d);p&&(c={...c,attributes:gn(c.attributes,d,p)})})}),c}function W0(e,t,n){const r=An(e,t)?.__experimentalSkipSerialization;return Array.isArray(r)?r.includes(n):r}const tl=new WeakMap;function EO({id:e,css:t}){return Jz({id:e,css:t})}function Jz({id:e,css:t,assets:n,__unstableType:o,variation:r,clientId:s}={}){const{setStyleOverride:i,deleteStyleOverride:c}=ct(Oe(J)),l=Fn(),u=x.useId();x.useEffect(()=>{if(!t&&!n)return;const d=e||u,p={id:e,css:t,assets:n,__unstableType:o,variation:r,clientId:s};return tl.get(l)||tl.set(l,[]),tl.get(l).push([d,p]),window.queueMicrotask(()=>{tl.get(l)?.length&&l.batch(()=>{tl.get(l).forEach(f=>{i(...f)}),tl.set(l,[])})}),()=>{tl.get(l)?.find(([b])=>b===d)?tl.set(l,tl.get(l).filter(([b])=>b!==d)):c(d)}},[e,t,s,n,o,u,i,c,l])}function WO(e,t){const[n,o,r,s,i,c,l,u,d,p,f,b,h,g,z,A,_,v,M,y,k,S,C,R,T,E,B,N,j,I,P,$,F,X,Z,V,Q,te,ee,ue,ce,me,de,Ae,ye,Ne,je,ie,we,re,pe,ke,Se,se,L,U]=Un("background.backgroundImage","background.backgroundSize","typography.fontFamilies.custom","typography.fontFamilies.default","typography.fontFamilies.theme","typography.defaultFontSizes","typography.fontSizes.custom","typography.fontSizes.default","typography.fontSizes.theme","typography.customFontSize","typography.fontStyle","typography.fontWeight","typography.lineHeight","typography.textAlign","typography.textColumns","typography.textDecoration","typography.writingMode","typography.textTransform","typography.letterSpacing","spacing.padding","spacing.margin","spacing.blockGap","spacing.defaultSpacingSizes","spacing.customSpacingSize","spacing.spacingSizes.custom","spacing.spacingSizes.default","spacing.spacingSizes.theme","spacing.units","dimensions.aspectRatio","dimensions.minHeight","layout","border.color","border.radius","border.style","border.width","color.custom","color.palette.custom","color.customDuotone","color.palette.theme","color.palette.default","color.defaultPalette","color.defaultDuotone","color.duotone.custom","color.duotone.theme","color.duotone.default","color.gradients.custom","color.gradients.theme","color.gradients.default","color.defaultGradients","color.customGradient","color.background","color.link","color.text","color.heading","color.button","shadow"),ne=x.useMemo(()=>({background:{backgroundImage:n,backgroundSize:o},color:{palette:{custom:Q,theme:ee,default:ue},gradients:{custom:Ne,theme:je,default:ie},duotone:{custom:de,theme:Ae,default:ye},defaultGradients:we,defaultPalette:ce,defaultDuotone:me,custom:V,customGradient:re,customDuotone:te,background:pe,link:ke,heading:se,button:L,text:Se},typography:{fontFamilies:{custom:r,default:s,theme:i},fontSizes:{custom:l,default:u,theme:d},customFontSize:p,defaultFontSizes:c,fontStyle:f,fontWeight:b,lineHeight:h,textAlign:g,textColumns:z,textDecoration:A,textTransform:v,letterSpacing:M,writingMode:_},spacing:{spacingSizes:{custom:T,default:E,theme:B},customSpacingSize:R,defaultSpacingSizes:C,padding:y,margin:k,blockGap:S,units:N},border:{color:$,radius:F,style:X,width:Z},dimensions:{aspectRatio:j,minHeight:I},layout:P,parentLayout:t,shadow:U}),[n,o,r,s,i,c,l,u,d,p,f,b,h,g,z,A,v,M,_,y,k,S,C,R,T,E,B,N,j,I,P,t,$,F,X,Z,V,Q,te,ee,ue,ce,me,de,Ae,ye,Ne,je,ie,we,re,pe,ke,Se,se,L,U]);return aMe(ne,e)}function aBt(e){e=e.map(n=>({...n,Edit:x.memo(n.edit)}));const t=Or(n=>o=>{const r=j0();return[...e.map((s,i)=>{const{Edit:c,hasSupport:l,attributeKeys:u=[],shareWithChildBlocks:d}=s;if(!(r[J5]||r[GB]&&d)||!l(o.name))return null;const f={};for(const b of u)o.attributes[b]&&(f[b]=o.attributes[b]);return a.jsx(c,{name:o.name,isSelected:o.isSelected,clientId:o.clientId,setAttributes:o.setAttributes,__unstableParentLayout:o.__unstableParentLayout,...f},i)}),a.jsx(n,{...o},"edit")]},"withBlockEditHooks");Bn("editor.BlockEdit","core/editor/hooks",t)}function cBt({index:e,useBlockProps:t,setAllWrapperProps:n,...o}){const r=t(o),s=i=>n(c=>{const l=[...c];return l[e]=i,l});return x.useEffect(()=>(s(r),()=>{s(void 0)})),null}const lBt=x.memo(cBt);function uBt(e){const t=Or(n=>o=>{const[r,s]=x.useState(Array(e.length).fill(void 0));return[...e.map((i,c)=>{const{hasSupport:l,attributeKeys:u=[],useBlockProps:d,isMatch:p}=i,f={};for(const b of u)o.attributes[b]&&(f[b]=o.attributes[b]);return!Object.keys(f).length||!l(o.name)||p&&!p(f)?null:a.jsx(lBt,{index:c,useBlockProps:d,setAllWrapperProps:s,name:o.name,clientId:o.clientId,...f},c)}),a.jsx(n,{...o,wrapperProps:r.filter(Boolean).reduce((i,c)=>({...i,...c,className:oe(i.className,c.className),style:{...i.style,...c.style}}),o.wrapperProps||{})},"edit")]},"withBlockListBlockHooks");Bn("editor.BlockListBlock","core/editor/hooks",t)}function dBt(e){function t(n,o,r){return e.reduce((s,i)=>{const{hasSupport:c,attributeKeys:l=[],addSaveProps:u}=i,d={};for(const p of l)r[p]&&(d[p]=r[p]);return!Object.keys(d).length||!c(o)?s:u(s,o,d)},n)}Bn("blocks.getSaveContent.extraProps","core/editor/hooks",t,0),Bn("blocks.getSaveContent.extraProps","core/editor/hooks",n=>(n.hasOwnProperty("className")&&!n.className&&delete n.className,n))}function pBt(e){const{apiVersion:t=1}=e;return t<2&&Et(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}Bn("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",pBt);const GW=["left","center","right","wide","full"],fBt=["wide","full"];function mI(e,t=!0,n=!0){let o;return Array.isArray(e)?o=GW.filter(r=>e.includes(r)):e===!0?o=[...GW]:o=[],!n||e===!0&&!t?o.filter(r=>!fBt.includes(r)):o}function bBt(e){var t;return"type"in((t=e.attributes?.align)!==null&&t!==void 0?t:{})||Et(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...GW,""]}}),e}function hBt({name:e,align:t,setAttributes:n}){const o=mI(An(e,"align"),Et(e,"alignWide",!0)),r=d7(o).map(({name:c})=>c),s=Jr();if(!r.length||s!=="default")return null;const i=c=>{c||on(e)?.attributes?.align?.default&&(c=""),n({align:c})};return a.jsx(bt,{group:"block",__experimentalShareWithChildBlocks:!0,children:a.jsx(yvt,{value:t,onChange:i,controls:r})})}const gI={shareWithChildBlocks:!0,edit:hBt,useBlockProps:mBt,addSaveProps:gBt,attributeKeys:["align"],hasSupport(e){return Et(e,"align",!1)}};function mBt({name:e,align:t}){const n=mI(An(e,"align"),Et(e,"alignWide",!0));return d7(n).some(r=>r.name===t)?{"data-align":t}:{}}function gBt(e,t,n){const{align:o}=n,r=An(t,"align"),s=Et(t,"alignWide",!0);return mI(r,s).includes(o)&&(e.className=oe(`align${o}`,e.className)),e}Bn("blocks.registerBlockType","core/editor/align/addAttribute",bBt);function MBt(e){var t;return"type"in((t=e.attributes?.lock)!==null&&t!==void 0?t:{})||(e.attributes={...e.attributes,lock:{type:"object"}}),e}Bn("blocks.registerBlockType","core/lock/addAttribute",MBt);const zBt=/[\s#]/g,OBt={type:"string",source:"attribute",attribute:"id",selector:"*"};function yBt(e){var t;return"type"in((t=e.attributes?.anchor)!==null&&t!==void 0?t:{})||Et(e,"anchor")&&(e.attributes={...e.attributes,anchor:OBt}),e}function ABt({anchor:e,setAttributes:t}){return Jr()!=="default"?null:a.jsx(et,{group:"advanced",children:a.jsx(dn,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,className:"html-anchor-control",label:m("HTML anchor"),help:a.jsxs(a.Fragment,{children:[m("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor”. Then, you’ll be able to link directly to this section of your page."),a.jsxs(a.Fragment,{children:[" ",a.jsx(hr,{href:m("https://wordpress.org/documentation/article/page-jumps/"),children:m("Learn more about anchors")})]})]}),value:e||"",placeholder:null,onChange:o=>{o=o.replace(zBt,"-"),t({anchor:o})},autoCapitalize:"none",autoComplete:"off"})})}const O3e={addSaveProps:vBt,edit:ABt,attributeKeys:["anchor"],hasSupport(e){return Et(e,"anchor")}};function vBt(e,t,n){return Et(t,"anchor")&&(e.id=n.anchor===""?null:n.anchor),e}Bn("blocks.registerBlockType","core/anchor/attribute",yBt);const xBt={type:"string",source:"attribute",attribute:"aria-label",selector:"*"};function wBt(e){return e?.attributes?.ariaLabel?.type||Et(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:xBt}),e}function _Bt(e,t,n){return Et(t,"ariaLabel")&&(e["aria-label"]=n.ariaLabel===""?null:n.ariaLabel),e}const kBt={addSaveProps:_Bt,attributeKeys:["ariaLabel"],hasSupport(e){return Et(e,"ariaLabel")}};Bn("blocks.registerBlockType","core/ariaLabel/attribute",wBt);function SBt(e){return Et(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e}function CBt({className:e,setAttributes:t}){return Jr()!=="default"?null:a.jsx(et,{group:"advanced",children:a.jsx(dn,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,autoComplete:"off",label:m("Additional CSS class(es)"),value:e||"",onChange:o=>{t({className:o!==""?o:void 0})},help:m("Separate multiple classes with spaces.")})})}const y3e={edit:CBt,addSaveProps:qBt,attributeKeys:["className"],hasSupport(e){return Et(e,"customClassName",!0)}};function qBt(e,t,n){return Et(t,"customClassName",!0)&&n.className&&(e.className=oe(e.className,n.className)),e}function RBt(e,t,n,o){if(!Et(e.name,"customClassName",!0)||o.length===1&&e.innerBlocks.length===t.length||o.length===1&&t.length>1||o.length>1&&t.length===1)return e;if(t[n]){const r=t[n]?.attributes.className;if(r)return{...e,attributes:{...e.attributes,className:r}}}return e}Bn("blocks.registerBlockType","core/editor/custom-class-name/attribute",SBt);Bn("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",RBt);function TBt(e,t){return Et(t,"className",!0)&&(typeof e.className=="string"?e.className=[...new Set([G4(t.name),...e.className.split(" ")])].join(" ").trim():e.className=G4(t.name)),e}Bn("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",TBt);function Ov(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function EBt({clientId:e}){const[t,n]=x.useState(),[o,r]=x.useState(),[s,i]=x.useState(),c=Wi(e);return x.useEffect(()=>{if(!c)return;r(Ov(c).color);const l=c.querySelector("a");l&&l.innerText&&i(Ov(l).color);let u=c,d=Ov(u).backgroundColor;for(;d==="rgba(0, 0, 0, 0)"&&u.parentNode&&u.parentNode.nodeType===u.parentNode.ELEMENT_NODE;)u=u.parentNode,d=Ov(u).backgroundColor;n(d)},[c]),a.jsx(Yx,{backgroundColor:t,textColor:o,enableAlphaChecker:!0,linkColor:s})}const Q0="color",ek=e=>{const t=An(e,Q0);return t&&(t.link===!0||t.gradient===!0||t.background!==!1||t.text!==!1)},WBt=e=>{const t=An(e,Q0);return t!==null&&typeof t=="object"&&!!t.link},MI=e=>{const t=An(e,Q0);return t!==null&&typeof t=="object"&&!!t.gradients},NBt=e=>{const t=An(e,Q0);return t&&t.background!==!1},BBt=e=>{const t=An(e,Q0);return t&&t.text!==!1};function LBt(e){return ek(e)&&(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),MI(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}})),e}function A3e(e,t,n){if(!ek(t)||W0(t,Q0))return e;const o=MI(t),{backgroundColor:r,textColor:s,gradient:i,style:c}=n,l=g=>!W0(t,Q0,g),u=l("text")?Pt("color",s):void 0,d=l("gradients")?T1(i):void 0,p=l("background")?Pt("background-color",r):void 0,f=l("background")||l("gradients"),b=r||c?.color?.background||o&&(i||c?.color?.gradient),h=oe(e.className,u,d,{[p]:(!o||!c?.color?.gradient)&&!!p,"has-text-color":l("text")&&(s||c?.color?.text),"has-background":f&&b,"has-link-color":l("link")&&c?.elements?.link?.color});return e.className=h||void 0,e}function v3e(e){const t=e?.color?.text,n=t?.startsWith("var:preset|color|")?t.substring(17):void 0,o=e?.color?.background,r=o?.startsWith("var:preset|color|")?o.substring(17):void 0,s=e?.color?.gradient,i=s?.startsWith("var:preset|gradient|")?s.substring(20):void 0,c={...e};return c.color={...c.color,text:n?void 0:t,background:r?void 0:o,gradient:i?void 0:s},{style:Ii(c),textColor:n,backgroundColor:r,gradient:i}}function x3e(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 PBt({children:e,resetAllFilter:t}){const n=x.useCallback(o=>{const r=x3e(o),s=t(r);return{...o,...v3e(s)}},[t]);return a.jsx(et,{group:"color",resetAllFilter:n,children:e})}function jBt({clientId:e,name:t,setAttributes:n,settings:o}){const r=dze(o);function s(h){const{style:g,textColor:z,backgroundColor:A,gradient:_}=h(J).getBlockAttributes(e)||{};return{style:g,textColor:z,backgroundColor:A,gradient:_}}const{style:i,textColor:c,backgroundColor:l,gradient:u}=G(s,[e]),d=x.useMemo(()=>x3e({style:i,textColor:c,backgroundColor:l,gradient:u}),[i,c,l,u]),p=h=>{n(v3e(h))};if(!r)return null;const f=An(t,[Q0,"__experimentalDefaultControls"]),b=!d?.color?.gradient&&(o?.color?.text||o?.color?.link)&&An(t,[Q0,"enableContrastChecker"])!==!1;return a.jsx(gze,{as:PBt,panelId:e,settings:o,value:d,onChange:p,defaultControls:f,enableContrastChecker:An(t,[Q0,"enableContrastChecker"])!==!1,children:b&&a.jsx(EBt,{clientId:e})})}function IBt({name:e,backgroundColor:t,textColor:n,gradient:o,style:r}){const[s,i,c]=Un("color.palette.custom","color.palette.theme","color.palette.default"),l=x.useMemo(()=>[...s||[],...i||[],...c||[]],[s,i,c]);if(!ek(e)||W0(e,Q0))return{};const u={};n&&!W0(e,Q0,"text")&&(u.color=Sf(l,n)?.color),t&&!W0(e,Q0,"background")&&(u.backgroundColor=Sf(l,t)?.color);const d=A3e({style:u},e,{textColor:n,backgroundColor:t,gradient:o,style:r}),p=t||r?.color?.background||o||r?.color?.gradient;return{...d,className:oe(d.className,!p&&KRt(r))}}const w3e={useBlockProps:IBt,addSaveProps:A3e,attributeKeys:["backgroundColor","textColor","gradient","style"],hasSupport:ek},DBt={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};function FBt(e,t,n,o){const r=e.name,s={linkColor:WBt(r),textColor:BBt(r),backgroundColor:NBt(r),gradient:MI(r)};return z3e(s,DBt,e,t,n,o)}Bn("blocks.registerBlockType","core/color/addAttribute",LBt);Bn("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",FBt);const $Bt="typography.lineHeight",tk="typography.__experimentalFontFamily",{kebabCase:VBt}=ct(tr);function HBt(e){return Et(e,tk)&&(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}})),e}function _3e(e,t,n){if(!Et(t,tk)||W0(t,Kd,"fontFamily")||!n?.fontFamily)return e;const o=new I_(e.className);o.add(`has-${VBt(n?.fontFamily)}-font-family`);const r=o.value;return e.className=r||void 0,e}function UBt({name:e,fontFamily:t}){return _3e({},e,{fontFamily:t})}const k3e={useBlockProps:UBt,addSaveProps:_3e,attributeKeys:["fontFamily"],hasSupport(e){return Et(e,tk)}};Bn("blocks.registerBlockType","core/fontFamily/addAttribute",HBt);const qm="typography.fontSize";function XBt(e){return Et(e,qm)&&(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}})),e}function S3e(e,t,n){if(!Et(t,qm)||W0(t,Kd,"fontSize"))return e;const o=new I_(e.className);o.add(Tx(n.fontSize));const r=o.value;return e.className=r||void 0,e}function GBt({name:e,fontSize:t,style:n}){const[o,r,s]=Un("typography.fontSizes","typography.fluid","layout");if(!Et(e,qm)||W0(e,Kd,"fontSize")||!t&&!n?.typography?.fontSize)return;let i;if(n?.typography?.fontSize&&(i={style:{fontSize:P_({size:n.typography.fontSize},{typography:{fluid:r},layout:s})}}),t&&(i={style:{fontSize:vyt(o,t,n?.typography?.fontSize).size}}),!!i)return S3e(i,e,{fontSize:t})}const C3e={useBlockProps:GBt,addSaveProps:S3e,attributeKeys:["fontSize","style"],hasSupport(e){return Et(e,qm)}},KBt={fontSize:[["fontSize"],["style","typography","fontSize"]]};function YBt(e,t,n,o){const r=e.name,s={fontSize:Et(r,qm)};return z3e(s,KBt,e,t,n,o)}Bn("blocks.registerBlockType","core/font/addAttribute",XBt);Bn("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",YBt);const NO="typography.textAlign",ZBt=[{icon:$3,title:m("Align text left"),align:"left"},{icon:kw,title:m("Align text center"),align:"center"},{icon:V3,title:m("Align text right"),align:"right"}],kte=["left","center","right"],QBt=[];function zI(e){return Array.isArray(e)?kte.filter(t=>e.includes(t)):e===!0?kte:QBt}function JBt({style:e,name:t,setAttributes:n}){const r=WO(t)?.typography?.textAlign,s=Jr();if(!r||s!=="default")return null;const i=zI(An(t,NO));if(!i.length)return null;const c=ZBt.filter(u=>i.includes(u.align)),l=u=>{const d={...e,typography:{...e?.typography,textAlign:u}};n({style:Ii(d)})};return a.jsx(bt,{group:"block",children:a.jsx(nr,{value:e?.typography?.textAlign,onChange:l,alignmentControls:c})})}const OI={edit:JBt,useBlockProps:eLt,addSaveProps:tLt,attributeKeys:["style"],hasSupport(e){return Et(e,NO,!1)}};function eLt({name:e,style:t}){if(!t?.typography?.textAlign||!zI(An(e,NO)).length||W0(e,Kd,"textAlign"))return null;const o=t.typography.textAlign;return{className:oe({[`has-text-align-${o}`]:o})}}function tLt(e,t,n){if(!n?.style?.typography?.textAlign)return e;const{textAlign:o}=n.style.typography,r=An(t,NO);return zI(r).includes(o)&&!W0(t,Kd,"textAlign")&&(e.className=oe(`has-text-align-${o}`,e.className)),e}function Ste(e,t){return Object.fromEntries(Object.entries(e).filter(([n])=>!t.includes(n)))}const nLt="typography.__experimentalLetterSpacing",oLt="typography.__experimentalTextTransform",rLt="typography.__experimentalTextDecoration",sLt="typography.textColumns",iLt="typography.__experimentalFontStyle",aLt="typography.__experimentalFontWeight",cLt="typography.__experimentalWritingMode",Kd="typography",lLt=[$Bt,qm,iLt,aLt,tk,NO,sLt,rLt,cLt,oLt,nLt];function q3e(e){const t={...Ste(e,["fontFamily"])},n=e?.typography?.fontSize,o=e?.typography?.fontFamily,r=n?.startsWith("var:preset|font-size|")?n.substring(21):void 0,s=o?.startsWith("var:preset|font-family|")?o.substring(23):void 0;return t.typography={...Ste(t.typography,["fontFamily"]),fontSize:r?void 0:n},{style:Ii(t),fontFamily:s,fontSize:r}}function R3e(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 uLt({children:e,resetAllFilter:t}){const n=x.useCallback(o=>{const r=R3e(o),s=t(r);return{...o,...q3e(s)}},[t]);return a.jsx(et,{group:"typography",resetAllFilter:n,children:e})}function dLt({clientId:e,name:t,setAttributes:n,settings:o}){function r(f){const{style:b,fontFamily:h,fontSize:g}=f(J).getBlockAttributes(e)||{};return{style:b,fontFamily:h,fontSize:g}}const{style:s,fontFamily:i,fontSize:c}=G(r,[e]),l=AMe(o),u=x.useMemo(()=>R3e({style:s,fontFamily:i,fontSize:c}),[s,c,i]),d=f=>{n(q3e(f))};if(!l)return null;const p=An(t,[Kd,"__experimentalDefaultControls"]);return a.jsx(EMe,{as:uLt,panelId:e,settings:o,value:u,onChange:d,defaultControls:p})}function T3e({clientId:e,value:t,computeStyle:n,forceShow:o}){const r=Wi(e),[s,i]=x.useReducer(()=>n(r));x.useLayoutEffect(()=>{r&&window.requestAnimationFrame(()=>window.requestAnimationFrame(i))},[r,t]);const c=x.useRef(t),[l,u]=x.useState(!1);return x.useEffect(()=>{if(ds(t,c.current)||o)return;u(!0),c.current=t;const d=setTimeout(()=>{u(!1)},400);return()=>{u(!1),clearTimeout(d)}},[t,o]),!l&&!o?null:a.jsx(wm,{clientId:e,__unstablePopoverSlot:"block-toolbar",children:a.jsx("div",{className:"block-editor__spacing-visualizer",style:s})})}function sd(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function pLt({clientId:e,value:t,forceShow:n}){return a.jsx(T3e,{clientId:e,value:t?.spacing?.margin,computeStyle:o=>{const r=sd(o,"margin-top"),s=sd(o,"margin-right"),i=sd(o,"margin-bottom"),c=sd(o,"margin-left");return{borderTopWidth:r,borderRightWidth:s,borderBottomWidth:i,borderLeftWidth:c,top:r?`-${r}`:0,right:s?`-${s}`:0,bottom:i?`-${i}`:0,left:c?`-${c}`:0}},forceShow:n})}function fLt({clientId:e,value:t,forceShow:n}){return a.jsx(T3e,{clientId:e,value:t?.spacing?.padding,computeStyle:o=>({borderTopWidth:sd(o,"padding-top"),borderRightWidth:sd(o,"padding-right"),borderBottomWidth:sd(o,"padding-bottom"),borderLeftWidth:sd(o,"padding-left")}),forceShow:n})}const Fl="dimensions",Zx="spacing";function bLt(){const[e,t]=x.useState(!1),{hideBlockInterface:n,showBlockInterface:o}=ct(Oe(J));return x.useEffect(()=>{e?n():o()},[e,o,n]),[e,t]}function hLt({children:e,resetAllFilter:t}){const n=x.useCallback(o=>{const r=o.style,s=t(r);return{...o,style:s}},[t]);return a.jsx(et,{group:"dimensions",resetAllFilter:n,children:e})}function mLt({clientId:e,name:t,setAttributes:n,settings:o}){const r=BMe(o),s=G(f=>f(J).getBlockAttributes(e)?.style,[e]),[i,c]=bLt(),l=f=>{n({style:Ii(f)})};if(!r)return null;const u=An(t,[Fl,"__experimentalDefaultControls"]),d=An(t,[Zx,"__experimentalDefaultControls"]),p={...u,...d};return a.jsxs(a.Fragment,{children:[a.jsx(HMe,{as:hLt,panelId:e,settings:o,value:s,onChange:l,defaultControls:p,onVisualize:c}),!!o?.spacing?.padding&&a.jsx(fLt,{forceShow:i==="padding",clientId:e,value:s}),!!o?.spacing?.margin&&a.jsx(pLt,{forceShow:i==="margin",clientId:e,value:s})]})}function E3e(e,t="any"){const n=An(e,Fl);return n===!0?!0:t==="any"?!!(n?.aspectRatio||n?.minHeight):!!n?.[t]}const gLt={useBlockProps:MLt,attributeKeys:["minHeight","style"],hasSupport(e){return E3e(e,"aspectRatio")}};function MLt({name:e,minHeight:t,style:n}){if(!E3e(e,"aspectRatio")||W0(e,Fl,"aspectRatio"))return{};const o=oe({"has-aspect-ratio":!!n?.dimensions?.aspectRatio}),r={};return n?.dimensions?.aspectRatio?r.minHeight="unset":(t||n?.dimensions?.minHeight)&&(r.aspectRatio="unset"),{className:o,style:r}}const zLt=[...lLt,Sm,Q0,Fl,Sh,Zx,Kx],yI=e=>zLt.some(t=>Et(e,t));function Rm(e={}){const t={};return O_(e).forEach(n=>{t[n.key]=n.value}),t}function OLt(e){return yI(e)&&(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}})),e}const W3e={[`${Sm}.__experimentalSkipSerialization`]:["border"],[`${Q0}.__experimentalSkipSerialization`]:[Q0],[`${Kd}.__experimentalSkipSerialization`]:[Kd],[`${Fl}.__experimentalSkipSerialization`]:[Fl],[`${Zx}.__experimentalSkipSerialization`]:[Zx],[`${Kx}.__experimentalSkipSerialization`]:[Kx]},yLt={...W3e,[`${Fl}.aspectRatio`]:[`${Fl}.aspectRatio`],[`${Sh}`]:[Sh]},ALt={[`${Fl}.aspectRatio`]:!0,[`${Sh}`]:!0},vLt={gradients:"gradient"};function KW(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(r=>{if(Array.isArray(r)||(r=r.split(".")),r.length>1){const[s,...i]=r;KW(o[s],[i],!0)}else r.length===1&&delete o[r[0]]}),o}function N3e(e,t,n,o=yLt){if(!yI(t))return e;let{style:r}=n;return Object.entries(o).forEach(([s,i])=>{const c=ALt[s]||An(t,s);c===!0&&(r=KW(r,i)),Array.isArray(c)&&c.forEach(l=>{const u=vLt[l]||l;r=KW(r,[[...i,u]])})}),e.style={...Rm(r),...e.style},e}function xLt({clientId:e,name:t,setAttributes:n,__unstableParentLayout:o}){const r=WO(t,o),s=Jr(),i={clientId:e,name:t,setAttributes:n,settings:{...r,typography:{...r.typography,textAlign:!1}}};return s!=="default"?null:a.jsxs(a.Fragment,{children:[a.jsx(jBt,{...i}),a.jsx(ZRt,{...i}),a.jsx(dLt,{...i}),a.jsx(eEt,{...i}),a.jsx(mLt,{...i})]})}const AI={edit:xLt,hasSupport:yI,addSaveProps:N3e,attributeKeys:["style"],useBlockProps:kLt},wLt=[{elementType:"button"},{elementType:"link",pseudo:[":hover"]},{elementType:"heading",elements:["h1","h2","h3","h4","h5","h6"]}],_Lt={};function kLt({name:e,style:t}){const n=vt(_Lt,"wp-elements"),o=`.${n}`,r=t?.elements,s=x.useMemo(()=>{if(!r)return;const i=[];return wLt.forEach(({elementType:c,pseudo:l,elements:u})=>{if(W0(e,Q0,c))return;const p=r?.[c];if(p){const f=Ws(o,Za[c]);i.push(rq(p,{selector:f})),l&&l.forEach(b=>{p[b]&&i.push(rq(p[b],{selector:Ws(o,`${Za[c]}${b}`)}))})}u&&u.forEach(f=>{r[f]&&i.push(rq(r[f],{selector:Ws(o,Za[f])}))})}),i.length>0?i.join(""):void 0},[o,r,e]);return EO({css:s}),N3e({className:n},e,{style:t},W3e)}Bn("blocks.registerBlockType","core/style/addAttribute",OLt);const SLt=e=>Et(e,"__experimentalSettings",!1);function CLt(e){return SLt(e)&&(e?.attributes?.settings||(e.attributes={...e.attributes,settings:{type:"object"}})),e}Bn("blocks.registerBlockType","core/settings/addAttribute",CLt);const aT=[],qLt=window?.navigator.userAgent&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&!window.navigator.userAgent.includes("Chromium");Xs([Gs]);function YW({presetSetting:e,defaultSetting:t}){const[n,o,r,s]=Un(t,`${e}.custom`,`${e}.theme`,`${e}.default`);return x.useMemo(()=>[...o||aT,...r||aT,...n&&s||aT],[n,o,r,s])}function B3e(e,t){if(!e)return;const n=t?.find(({slug:o})=>e===`var:preset|duotone|${o}`);return n?n.colors:void 0}function RLt(e,t){if(!e||!Array.isArray(e))return;const n=t?.find(o=>o?.colors?.every((r,s)=>r===e[s]));return n?`var:preset|duotone|${n.slug}`:void 0}function TLt({style:e,setAttributes:t,name:n}){const o=e?.color?.duotone,r=WO(n),s=Jr(),i=YW({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),c=YW({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),[l,u]=Un("color.custom","color.customDuotone"),d=!l,p=!u||c?.length===0&&d;if(i?.length===0&&p||s!=="default")return null;const f=Array.isArray(o)?o:B3e(o,i);return a.jsxs(a.Fragment,{children:[a.jsx(et,{group:"filter",children:a.jsx(zze,{value:{filter:{duotone:f}},onChange:b=>{const h={...e,color:{...b?.filter}};t({style:h})},settings:r})}),a.jsx(bt,{group:"block",__experimentalShareWithChildBlocks:!0,children:a.jsx(Vze,{duotonePalette:i,colorPalette:c,disableCustomDuotone:p,disableCustomColors:d,value:f,onChange:b=>{const h=RLt(b,i),g={...e,color:{...e?.color,duotone:h??b}};t({style:g})},settings:r})})]})}const L3e={shareWithChildBlocks:!0,edit:TLt,useBlockProps:BLt,attributeKeys:["style"],hasSupport(e){return Et(e,"filter.duotone")}};function ELt(e){return Et(e,"filter.duotone")&&(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}})),e}function WLt({clientId:e,id:t,selector:n,attribute:o}){const r=YW({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),s=Array.isArray(o),i=s?void 0:B3e(o,r),c=typeof o=="string"&&i,l=typeof o=="string"&&!c;let u=null;c?u=i:(l||s)&&(u=o);const f=n.split(",").map(g=>`.${t}${g.trim()}`).join(", "),b=Array.isArray(u)||u==="unset";Jz(b?{css:u!=="unset"?sRt(f,t):rRt(f),__unstableType:"presets"}:void 0),Jz(b?{assets:u!=="unset"?nI(t,u):"",__unstableType:"svgs"}:void 0);const h=Wi(e);x.useEffect(()=>{if(b&&h&&qLt){const g=h.style.display;h.style.setProperty("display","inline-block"),h.offsetHeight,h.style.setProperty("display",g)}},[b,h,u])}const NLt={};function BLt({clientId:e,name:t,style:n}){const o=vt(NLt),r=x.useMemo(()=>{const l=on(t);if(l){if(!An(l,"filter.duotone",!1))return null;const d=An(l,"color.__experimentalDuotone",!1);if(d){const p=pd(l);return typeof d=="string"?Ws(p,d):p}return pd(l,"filter.duotone",{fallback:!0})}},[t]),s=n?.color?.duotone,i=`wp-duotone-${o}`,c=r&&s;return WLt({clientId:e,id:i,selector:r,attribute:s}),{className:c?i:""}}Bn("blocks.registerBlockType","core/editor/duotone/add-attributes",ELt);const vI="layout",{kebabCase:ZW}=ct(tr);function xI(e){return Et(e,"layout")||Et(e,"__experimentalLayout")}function P3e(e={},t=""){const{layout:n}=e,{default:o}=An(t,vI)||{},r=n?.inherit||n?.contentSize||n?.wideSize?{...n,type:"constrained"}:n||o||{},s=[];if(Dd[r?.type||"default"]?.className){const c=Dd[r?.type||"default"]?.className,l=t.split("/"),d=`wp-block-${l[0]==="core"?l.pop():l.join("-")}-${c}`;s.push(c,d)}return G(c=>(r?.inherit||r?.contentSize||r?.type==="constrained")&&c(J).getSettings().__experimentalFeatures?.useRootPaddingAwareAlignments,[r?.contentSize,r?.inherit,r?.type])&&s.push("has-global-padding"),r?.orientation&&s.push(`is-${ZW(r.orientation)}`),r?.justifyContent&&s.push(`is-content-justification-${ZW(r.justifyContent)}`),r?.flexWrap&&r.flexWrap==="nowrap"&&s.push("is-nowrap"),s}function LLt(e={},t,n){const{layout:o={},style:r={}}=e,s=o?.inherit||o?.contentSize||o?.wideSize?{...o,type:"constrained"}:o||{},i=Rf(s?.type||"default"),[c]=Un("spacing.blockGap"),l=c!==null;return i?.getLayoutStyle?.({blockName:t,selector:n,layout:o,style:r,hasBlockGapSupport:l})}function PLt({layout:e,setAttributes:t,name:n,clientId:o}){const r=WO(n),{layout:s}=r,{themeSupportsLayout:i}=G(B=>{const{getSettings:N}=B(J);return{themeSupportsLayout:N().supportsLayout}},[]);if(Jr()!=="default")return null;const l=An(n,vI,{}),u={...s,...l},{allowSwitching:d,allowEditing:p=!0,allowInheriting:f=!0,default:b}=u;if(!p)return null;const h={...l,...e},{type:g,default:{type:z="default"}={}}=h,A=g||z,_=!!(f&&(!A||A==="default"||A==="constrained"||h.inherit)),v=e||b||{},{inherit:M=!1,contentSize:y=null}=v;if((A==="default"||A==="constrained")&&!i)return null;const k=Rf(A),S=Rf("constrained"),C=!v.type&&(y||M),R=!!M||!!y,T=B=>t({layout:{type:B}}),E=B=>t({layout:B});return a.jsxs(a.Fragment,{children:[a.jsx(et,{children:a.jsxs(Qt,{title:m("Layout"),children:[_&&a.jsx(a.Fragment,{children:a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Inner blocks use content width"),checked:k?.name==="constrained"||R,onChange:()=>t({layout:{type:k?.name==="constrained"||R?"default":"constrained"}}),help:k?.name==="constrained"||R?m("Nested blocks use content width with options for full and wide widths."):m("Nested blocks will fill the width of this container. Toggle to constrain.")})}),!M&&d&&a.jsx(ILt,{type:A,onChange:T}),k&&k.name!=="default"&&a.jsx(k.inspectorControls,{layout:v,onChange:E,layoutBlockSupport:u,name:n,clientId:o}),S&&C&&a.jsx(S.inspectorControls,{layout:v,onChange:E,layoutBlockSupport:u,name:n,clientId:o})]})}),!M&&k&&a.jsx(k.toolBarControls,{layout:v,onChange:E,layoutBlockSupport:l,name:n,clientId:o})]})}const jLt={shareWithChildBlocks:!0,edit:PLt,attributeKeys:["layout"],hasSupport(e){return xI(e)}};function ILt({type:e,onChange:t}){return a.jsx(Do,{__next40pxDefaultSize:!0,isBlock:!0,label:m("Layout type"),__nextHasNoMarginBottom:!0,hideLabelFromVision:!0,isAdaptiveWidth:!0,value:e,onChange:t,children:mvt().map(({name:n,label:o})=>a.jsx(Kn,{value:n,label:o},n))})}function DLt(e){var t;return"type"in((t=e.attributes?.layout)!==null&&t!==void 0?t:{})||xI(e)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e}function FLt({block:e,props:t,blockGapSupport:n,layoutClasses:o}){const{name:r,attributes:s}=t,i=vt(e),{layout:c}=s,{default:l}=An(r,vI)||{},u=c?.inherit||c?.contentSize||c?.wideSize?{...c,type:"constrained"}:c||l||{},d=`wp-container-${ZW(r)}-is-layout-`,p=`.${d}${i}`,f=n!==null,h=Rf(u?.type||"default")?.getLayoutStyle?.({blockName:r,selector:p,layout:u,style:s?.style,hasBlockGapSupport:f}),g=oe({[`${d}${i}`]:!!h},o);return EO({css:h}),a.jsx(e,{...t,__unstableLayoutClassNames:g})}const $Lt=Or(e=>t=>{const{clientId:n,name:o,attributes:r}=t,s=xI(o),i=P3e(r,o),c=G(l=>{if(!s)return;const{getSettings:u,getBlockSettings:d}=ct(l(J)),{disableLayoutStyles:p}=u();if(p)return;const[f]=d(n,"spacing.blockGap");return{blockGapSupport:f}},[s,n]);return c?a.jsx(FLt,{block:e,props:t,layoutClasses:i,...c}):a.jsx(e,{...t,__unstableLayoutClassNames:s?i:void 0})},"withLayoutStyles");Bn("blocks.registerBlockType","core/layout/addAttribute",DLt);Bn("editor.BlockListBlock","core/editor/layout/with-layout-styles",$Lt);function Cte(e,t){return Array.from({length:t},(n,o)=>e+o)}class bd{constructor({columnStart:t,rowStart:n,columnEnd:o,rowEnd:r,columnSpan:s,rowSpan:i}={}){this.columnStart=t??1,this.rowStart=n??1,s!==void 0?this.columnEnd=this.columnStart+s-1:this.columnEnd=o??this.columnStart,i!==void 0?this.rowEnd=this.rowStart+i-1:this.rowEnd=r??this.rowStart}get columnSpan(){return this.columnEnd-this.columnStart+1}get rowSpan(){return this.rowEnd-this.rowStart+1}contains(t,n){return t>=this.columnStart&&t<=this.columnEnd&&n>=this.rowStart&&n<=this.rowEnd}containsRect(t){return this.contains(t.columnStart,t.rowStart)&&this.contains(t.columnEnd,t.rowEnd)}intersectsRect(t){return this.columnStart<=t.columnEnd&&this.columnEnd>=t.columnStart&&this.rowStart<=t.rowEnd&&this.rowEnd>=t.rowStart}}function d1(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function qte(e,t){const n=[];for(const o of e.split(" ")){const r=n[n.length-1],s=r?r.end+t:0,i=s+parseFloat(o);n.push({start:s,end:i})}return n}function yv(e,t,n="start"){return e.reduce((o,r,s)=>Math.abs(r[n]-t)i(J).getSettings().isDistractionFree,[]),r=Wi(e);if(o||!r)return null;const s=n?.isManualPlacement&&window.__experimentalEnableGridInteractivity;return a.jsx(VLt,{gridClientId:e,gridElement:r,isManualGrid:s,ref:t})}const VLt=x.forwardRef(({gridClientId:e,gridElement:t,isManualGrid:n},o)=>{const[r,s]=x.useState(()=>cT(t)),[i,c]=x.useState(!1);return x.useEffect(()=>{const l=[];for(const d of[t,...t.children]){const p=new window.ResizeObserver(()=>{s(cT(t))});p.observe(d),l.push(p)}const u=new window.MutationObserver(()=>{s(cT(t))});return u.observe(t,{attributeFilter:["style","class"],childList:!0,subtree:!0}),l.push(u),()=>{for(const d of l)d.disconnect()}},[t]),x.useEffect(()=>{function l(){c(!0)}function u(){c(!1)}return document.addEventListener("drag",l),document.addEventListener("dragend",u),()=>{document.removeEventListener("drag",l),document.removeEventListener("dragend",u)}},[]),a.jsx(wm,{className:oe("block-editor-grid-visualizer",{"is-dropping-allowed":i}),clientId:e,__unstablePopoverSlot:"__unstable-block-tools-after",children:a.jsx("div",{ref:o,className:"block-editor-grid-visualizer__grid",style:r.style,children:n?a.jsx(HLt,{gridClientId:e,gridInfo:r}):Array.from({length:r.numItems},(l,u)=>a.jsx(I3e,{color:r.currentColor},u))})})});function HLt({gridClientId:e,gridInfo:t}){const[n,o]=x.useState(null),r=G(i=>{const{getBlockOrder:c,getBlockStyles:l}=ct(i(J)),u=c(e);return l(u)},[e]),s=x.useMemo(()=>{const i=[];for(const l of Object.values(r)){var c;const{columnStart:u,rowStart:d,columnSpan:p=1,rowSpan:f=1}=(c=l?.layout)!==null&&c!==void 0?c:{};!u||!d||i.push(new bd({columnStart:u,rowStart:d,columnSpan:p,rowSpan:f}))}return i},[r]);return Cte(1,t.numRows).map(i=>Cte(1,t.numColumns).map(c=>{var l;const u=s.some(p=>p.contains(c,i)),d=(l=n?.contains(c,i))!==null&&l!==void 0?l:!1;return a.jsx(I3e,{color:t.currentColor,className:d&&"is-highlighted",children:u?a.jsx(ULt,{column:c,row:i,gridClientId:e,gridInfo:t,setHighlightedRect:o}):a.jsx(XLt,{column:c,row:i,gridClientId:e,gridInfo:t,setHighlightedRect:o})},`${i}-${c}`)}))}function I3e({color:e,children:t,className:n}){return a.jsx("div",{className:oe("block-editor-grid-visualizer__cell",n),style:{boxShadow:`inset 0 0 0 1px color-mix(in srgb, ${e} 20%, #0000)`,color:e},children:t})}function D3e(e,t,n,o,r){const{getBlockAttributes:s,getBlockRootClientId:i,canInsertBlockType:c,getBlockName:l}=G(J),{updateBlockAttributes:u,moveBlocksToPosition:d,__unstableMarkNextChangeAsNotPersistent:p}=Oe(J),f=U_(n,o.numColumns);return GLt({validateDrag(b){const h=l(b);if(!c(h,n))return!1;const g=s(b),z=new bd({columnStart:e,rowStart:t,columnSpan:g.style?.layout?.columnSpan,rowSpan:g.style?.layout?.rowSpan});return new bd({columnSpan:o.numColumns,rowSpan:o.numRows}).containsRect(z)},onDragEnter(b){const h=s(b);r(new bd({columnStart:e,rowStart:t,columnSpan:h.style?.layout?.columnSpan,rowSpan:h.style?.layout?.rowSpan}))},onDragLeave(){r(b=>b?.columnStart===e&&b?.rowStart===t?null:b)},onDrop(b){r(null);const h=s(b);u(b,{style:{...h.style,layout:{...h.style?.layout,columnStart:e,rowStart:t}}}),p(),d([b],i(b),n,f(e,t))}})}function ULt({column:e,row:t,gridClientId:n,gridInfo:o,setHighlightedRect:r}){return a.jsx("div",{className:"block-editor-grid-visualizer__drop-zone",ref:D3e(e,t,n,o,r)})}function XLt({column:e,row:t,gridClientId:n,gridInfo:o,setHighlightedRect:r}){const{updateBlockAttributes:s,moveBlocksToPosition:i,__unstableMarkNextChangeAsNotPersistent:c}=Oe(J),l=U_(n,o.numColumns);return a.jsx(N_,{rootClientId:n,className:"block-editor-grid-visualizer__appender",ref:D3e(e,t,n,o,r),style:{color:o.currentColor},onSelect:u=>{u&&(s(u.clientId,{style:{layout:{columnStart:e,rowStart:t}}}),c(),i([u.clientId],n,n,l(e,t)))}})}function GLt({validateDrag:e,onDragEnter:t,onDragLeave:n,onDrop:o}){const{getDraggedBlockClientIds:r}=G(J);return q5({onDragEnter(){const[s]=r();s&&e(s)&&t(s)},onDragLeave(){n()},onDrop(){const[s]=r();s&&e(s)&&o(s)}})}function KLt({clientId:e,bounds:t,onChange:n,parentLayout:o}){const r=Wi(e),s=r?.parentElement,{isManualPlacement:i}=o;return!r||!s?null:a.jsx(YLt,{clientId:e,bounds:t,blockElement:r,rootBlockElement:s,onChange:n,isManualGrid:i&&window.__experimentalEnableGridInteractivity})}function YLt({clientId:e,bounds:t,blockElement:n,rootBlockElement:o,onChange:r,isManualGrid:s}){const[i,c]=x.useState(null),[l,u]=x.useState({top:!1,bottom:!1,left:!1,right:!1});x.useEffect(()=>{const b=new window.ResizeObserver(()=>{const h=n.getBoundingClientRect(),g=o.getBoundingClientRect();u({top:h.top>g.top,bottom:h.bottomg.left,right:h.rightb.disconnect()},[n,o]);const d={right:"left",left:"right"},p={top:"flex-end",bottom:"flex-start"},f={display:"flex",justifyContent:"center",alignItems:"center",...d[i]&&{justifyContent:d[i]},...p[i]&&{alignItems:p[i]}};return a.jsx(wm,{className:"block-editor-grid-item-resizer",clientId:e,__unstablePopoverSlot:"__unstable-block-tools-after",additionalStyles:f,children:a.jsx(Ca,{className:"block-editor-grid-item-resizer__box",size:{width:"100%",height:"100%"},enable:{bottom:l.bottom,bottomLeft:!1,bottomRight:!1,left:l.left,right:l.right,top:l.top,topLeft:!1,topRight:!1},bounds:t,boundsByDirection:!0,onPointerDown:({target:b,pointerId:h})=>{b.setPointerCapture(h)},onResizeStart:(b,h)=>{c(h)},onResizeStop:(b,h,g)=>{const z=parseFloat(d1(o,"column-gap")),A=parseFloat(d1(o,"row-gap")),_=qte(d1(o,"grid-template-columns"),z),v=qte(d1(o,"grid-template-rows"),A),M=new window.DOMRect(n.offsetLeft+g.offsetLeft,n.offsetTop+g.offsetTop,g.offsetWidth,g.offsetHeight),y=yv(_,M.left)+1,k=yv(v,M.top)+1,S=yv(_,M.right,"end")+1,C=yv(v,M.bottom,"end")+1;r({columnSpan:S-y+1,rowSpan:C-k+1,columnStart:s?y:void 0,rowStart:s?k:void 0})}})})}function ZLt({layout:e,parentLayout:t,onChange:n,gridClientId:o,blockClientId:r}){var s,i,c,l;const{moveBlocksToPosition:u,__unstableMarkNextChangeAsNotPersistent:d}=Oe(J),p=(s=e?.columnStart)!==null&&s!==void 0?s:1,f=(i=e?.rowStart)!==null&&i!==void 0?i:1,b=(c=e?.columnSpan)!==null&&c!==void 0?c:1,h=(l=e?.rowSpan)!==null&&l!==void 0?l:1,g=p+b-1,z=f+h-1,A=t?.columnCount,_=t?.rowCount,v=U_(o,A);return a.jsx(bt,{group:"parent",children:a.jsxs(Wn,{className:"block-editor-grid-item-mover__move-button-container",children:[a.jsx("div",{className:"block-editor-grid-item-mover__move-horizontal-button-container is-left",children:a.jsx(fM,{icon:jt()?ma:Ll,label:m("Move left"),description:m("Move left"),isDisabled:p<=1,onClick:()=>{n({columnStart:p-1}),d(),u([r],o,o,v(p-1,f))}})}),a.jsxs("div",{className:"block-editor-grid-item-mover__move-vertical-button-container",children:[a.jsx(fM,{className:"is-up-button",icon:Rw,label:m("Move up"),description:m("Move up"),isDisabled:f<=1,onClick:()=>{n({rowStart:f-1}),d(),u([r],o,o,v(p,f-1))}}),a.jsx(fM,{className:"is-down-button",icon:tu,label:m("Move down"),description:m("Move down"),isDisabled:_&&z>=_,onClick:()=>{n({rowStart:f+1}),d(),u([r],o,o,v(p,f+1))}})]}),a.jsx("div",{className:"block-editor-grid-item-mover__move-horizontal-button-container is-right",children:a.jsx(fM,{icon:jt()?Ll:ma,label:m("Move right"),description:m("Move right"),isDisabled:A&&g>=A,onClick:()=>{n({columnStart:p+1}),d(),u([r],o,o,v(p+1,f))}})})]})})}function fM({className:e,icon:t,label:n,isDisabled:o,onClick:r,description:s}){const c=`block-editor-grid-item-mover-button__description-${vt(fM)}`;return a.jsxs(a.Fragment,{children:[a.jsx(Vt,{className:oe("block-editor-grid-item-mover-button",e),icon:t,label:n,"aria-describedby":c,onClick:o?null:r,disabled:o,accessibleWhenDisabled:!0}),a.jsx(qn,{id:c,children:s})]})}function QLt({clientId:e}){const{gridLayout:t,blockOrder:n,selectedBlockLayout:o}=G(f=>{var b;const{getBlockAttributes:h,getBlockOrder:g}=f(J),z=f(J).getSelectedBlock();return{gridLayout:(b=h(e).layout)!==null&&b!==void 0?b:{},blockOrder:g(e),selectedBlockLayout:z?.attributes.style?.layout}},[e]),{getBlockAttributes:r,getBlockRootClientId:s}=G(J),{updateBlockAttributes:i,__unstableMarkNextChangeAsNotPersistent:c}=Oe(J),l=x.useMemo(()=>o?new bd(o):null,[o]),u=Fr(l),d=Fr(t.isManualPlacement),p=Fr(n);x.useEffect(()=>{const f={};if(t.isManualPlacement){const A=[];for(const v of n){var b;const{columnStart:M,rowStart:y,columnSpan:k=1,rowSpan:S=1}=(b=r(v).style?.layout)!==null&&b!==void 0?b:{};!M||!y||A.push(new bd({columnStart:M,rowStart:y,columnSpan:k,rowSpan:S}))}for(const v of n){var h;const M=r(v),{columnStart:y,rowStart:k,columnSpan:S=1,rowSpan:C=1}=(h=M.style?.layout)!==null&&h!==void 0?h:{};if(y&&k)continue;const[R,T]=JLt(A,t.columnCount,S,C,u?.columnEnd,u?.rowEnd);A.push(new bd({columnStart:R,rowStart:T,columnSpan:S,rowSpan:C})),f[v]={style:{...M.style,layout:{...M.style?.layout,columnStart:R,rowStart:T}}}}const _=Math.max(...A.map(v=>v.rowEnd));(!t.rowCount||t.rowCount<_)&&(f[e]={layout:{...t,rowCount:_}});for(const v of p??[])if(!n.includes(v)){var g;const M=s(v);if(M===null||r(M)?.layout?.type==="grid")continue;const k=r(v),{columnStart:S,rowStart:C,columnSpan:R,rowSpan:T,...E}=(g=k.style?.layout)!==null&&g!==void 0?g:{};if(S||C||R||T){const B=Object.keys(E).length===0;f[v]=gn(k,["style","layout"],B?void 0:E)}}}else{if(d===!0)for(const A of n){var z;const _=r(A),{columnStart:v,rowStart:M,...y}=(z=_.style?.layout)!==null&&z!==void 0?z:{};if(v||M){const k=Object.keys(y).length===0;f[A]=gn(_,["style","layout"],k?void 0:y)}}t.rowCount&&(f[e]={layout:{...t,rowCount:void 0}})}Object.keys(f).length&&(c(),i(Object.keys(f),f,!0))},[e,t,p,n,u,d,c,r,s,i])}function JLt(e,t,n,o,r=1,s=1){for(let i=s;;i++)for(let c=i===s?r:1;c<=t;c++){const l=new bd({columnStart:c,rowStart:i,columnSpan:n,rowSpan:o});if(!e.some(u=>u.intersectsRect(l)))return[c,i]}}const ePt={};function tPt({style:e}){var t;const n=G(z=>!z(J).getSettings().disableLayoutStyles),o=(t=e?.layout)!==null&&t!==void 0?t:{},{selfStretch:r,flexSize:s,columnStart:i,rowStart:c,columnSpan:l,rowSpan:u}=o,d=y_()||{},{columnCount:p,minimumColumnWidth:f}=d,b=vt(ePt),h=`.wp-container-content-${b}`;let g="";if(n&&(r==="fixed"&&s?g=`${h} { +`))}const{defaultView:r}=t.ownerDocument;return r.addEventListener("keydown",o),t.addEventListener("keydown",n),()=>{r.removeEventListener("keydown",o),t.removeEventListener("keydown",n)}},wNt=e=>t=>{function n(){const{registry:o}=e.current;if(!o.select(J).isMultiSelecting())return;const r=t.parentElement.closest('[contenteditable="true"]');r&&r.focus()}return t.addEventListener("focus",n),()=>{t.removeEventListener("focus",n)}},_Nt=[fNt,hNt,mNt,gNt,MNt,zNt,ONt,ANt,vNt,xNt,wNt];function kNt(e){const t=x.useRef(e);x.useInsertionEffect(()=>{t.current=e});const n=x.useMemo(()=>_Nt.map(o=>o(t)),[t]);return Mn(o=>{if(!e.isSelected)return;const r=n.map(s=>s(o));return()=>{r.forEach(s=>s())}},[n,e.isSelected])}const SNt={},t3e=Symbol("usesContext");function CNt({onChange:e,onFocus:t,value:n,forwardedRef:o,settings:r}){const{name:s,edit:i,[t3e]:c}=r,l=x.useContext(Cf),u=x.useMemo(()=>c?Object.fromEntries(Object.entries(l).filter(([h])=>c.includes(h))):SNt,[c,l]);if(!i)return null;const d=QN(n,s),p=d!==void 0,f=Pqe(n),b=f!==void 0&&f.type===s;return a.jsx(i,{isActive:p,activeAttributes:p?d.attributes||{}:{},isObjectActive:b,activeObjectAttributes:b?f.attributes||{}:{},value:n,onChange:e,onFocus:t,contentRef:o,context:u},s)}function qNt({formatTypes:e,...t}){return e.map(n=>x.createElement(CNt,{settings:n,...t,key:n.name}))}function n3e(e,t){if(Ie.isEmpty(e)){const n=e3e(t);return n?`<${n}>`:""}return Array.isArray(e)?(Ke("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/"}),QE.toHTML(e)):typeof e=="string"?e:e.toHTMLString()}function fI({value:e,tagName:t,multiline:n,format:o,...r}){return e=a.jsx(i0,{children:n3e(e,n)}),t?a.jsx(t,{...r,children:e}):e}function RNt({children:e,identifier:t,tagName:n="div",value:o="",onChange:r,multiline:s,...i},c){Ke("wp.blockEditor.RichText multiline prop",{since:"6.1",version:"6.3",alternative:"nested blocks (InnerBlocks)",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/nested-blocks-inner-blocks/"});const{clientId:l}=j0(),{getSelectionStart:u,getSelectionEnd:d}=G(J),{selectionChange:p}=Oe(J),f=e3e(s);o=o||`<${f}>`;const h=`${o}<${f}>`.split(`<${f}>`);h.shift(),h.pop();function g(z){r(`<${f}>${z.join(`<${f}>`)}`)}return a.jsx(n,{ref:c,children:h.map((z,A)=>a.jsx(hI,{identifier:`${t}-${A}`,tagName:f,value:z,onChange:_=>{const v=h.slice();v[A]=_,g(v)},isSelected:void 0,onKeyDown:_=>{if(_.keyCode!==Gr)return;_.preventDefault();const{offset:v}=u(),{offset:M}=d();if(typeof v!="number"||typeof M!="number")return;const y=eo({html:z});y.start=v,y.end=M;const k=JN(y).map(C=>T0({value:C})),S=h.slice();S.splice(A,1,...k),g(S),p(l,`${t}-${A+1}`,0,0)},onMerge:_=>{const v=h.slice();let M=0;if(_){if(!v[A+1])return;v.splice(A,2,v[A]+v[A+1]),M=v[A].length-1}else{if(!v[A-1])return;v.splice(A-1,2,v[A-1]+v[A]),M=v[A-1].length-1}g(v),p(l,`${t}-${A-(_?0:1)}`,M,M)},...i},A))})}const TNt=x.forwardRef(RNt);function ENt(e){return x.forwardRef((t,n)=>{let o=t.value,r=t.onChange;Array.isArray(o)&&(Ke("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/"}),o=QE.toHTML(t.value),r=i=>t.onChange(QE.fromDOM(dl(document,i).childNodes)));const s=t.multiline?TNt:e;return a.jsx(s,{...t,value:o,onChange:r,ref:n})})}function Xd({character:e,type:t,onUse:n}){const o=x.useContext(o3e),r=x.useRef();return r.current=n,x.useEffect(()=>{function s(i){lc[t](i,e)&&(r.current(),i.preventDefault())}return o.current.add(s),()=>{o.current.delete(s)}},[e,t]),null}function Zs({name:e,shortcutType:t,shortcutCharacter:n,...o}){let r,s="RichText.ToolbarControls";return e&&(s+=`.${e}`),t&&n&&(r=j1[t](n)),a.jsx(um,{name:s,children:a.jsx(Vt,{...o,shortcut:r})})}function bI({inputType:e,onInput:t}){const n=x.useContext(r3e),o=x.useRef();return o.current=t,x.useEffect(()=>{function r(s){s.inputType===e&&(o.current(),s.preventDefault())}return n.current.add(r),()=>{n.current.delete(r)}},[e]),null}const o3e=x.createContext(),r3e=x.createContext(),yte=Symbol("instanceId");function s3e(e){const{__unstableMobileNoFocusOnMount:t,deleteEnter:n,placeholderTextColor:o,textAlign:r,selectionColor:s,tagsToEliminate:i,disableEditingMenu:c,fontSize:l,fontFamily:u,fontWeight:d,fontStyle:p,minWidth:f,maxWidth:b,disableSuggestions:h,disableAutocorrection:g,...z}=e;return z}function hI({children:e,tagName:t="div",value:n="",onChange:o,isSelected:r,multiline:s,inlineToolbar:i,wrapperClassName:c,autocompleters:l,onReplace:u,placeholder:d,allowedFormats:p,withoutInteractiveFormatting:f,onRemove:b,onMerge:h,onSplit:g,__unstableOnSplitAtEnd:z,__unstableOnSplitAtDoubleLineEnd:A,identifier:_,preserveWhiteSpace:v,__unstablePastePlainText:M,__unstableEmbedURLOnPaste:y,__unstableDisableFormats:k,disableLineBreaks:S,__unstableAllowPrefixTransformations:C,readOnly:R,...T},E){T=s3e(T),g&&Ke("wp.blockEditor.RichText onSplit prop",{since:"6.4",alternative:'block.json support key: "splitting"'});const B=vt(hI),N=x.useRef(),j=j0(),{clientId:I,isSelected:P,name:$}=j,F=j[KB],X=x.useContext(Cf),Z=Fn(),V=fe=>{if(!P)return{isSelected:!1};const{getSelectionStart:Re,getSelectionEnd:be}=fe(J),ze=Re(),nt=be();let Mt;return r===void 0?Mt=ze.clientId===I&&nt.clientId===I&&(_?ze.attributeKey===_:ze[yte]===B):r&&(Mt=ze.clientId===I),{selectionStart:Mt?ze.offset:void 0,selectionEnd:Mt?nt.offset:void 0,isSelected:Mt}},{selectionStart:Q,selectionEnd:te,isSelected:ee}=G(V,[I,_,B,r,P]),{disableBoundBlock:ue,bindingsPlaceholder:ce,bindingsLabel:me}=G(fe=>{var Re;if(!F?.[_]||!a7($))return{};const be=F[_],ze=vl(be.source),nt={};if(ze?.usesContext?.length)for(const rr of ze.usesContext)nt[rr]=X[rr];const Mt=!ze?.canUserEditValue?.({select:fe,context:nt,args:be.args});if(n.length>0)return{disableBoundBlock:Mt,bindingsPlaceholder:null,bindingsLabel:null};const{getBlockAttributes:ot}=fe(J),Ue=ot(I),fn=(Re=ze?.getFieldsList?.({select:fe,context:nt})?.[be?.args?.key]?.label)!==null&&Re!==void 0?Re:ze?.label,Ln=Mt?fn:xe(m("Add %s"),fn),Mo=Mt?be?.args?.key||ze?.label:xe(m("Empty %s; start writing to edit its value"),be?.args?.key||ze?.label);return{disableBoundBlock:Mt,bindingsPlaceholder:Ue?.placeholder||Ln,bindingsLabel:Mo}},[F,_,$,n,I,X]),de=R||ue,{getSelectionStart:Ae,getSelectionEnd:ye,getBlockRootClientId:Ne}=G(J),{selectionChange:je}=Oe(J),ie=pI({allowedFormats:p,disableFormats:k}),we=!ie||ie.length>0,re=x.useCallback((fe,Re)=>{const be={},ze=fe===void 0&&Re===void 0,nt={clientId:I,[_?"attributeKey":yte]:_||B};if(typeof fe=="number"||ze){if(Re===void 0&&Ne(I)!==Ne(ye().clientId))return;be.start={...nt,offset:fe}}if(typeof Re=="number"||ze){if(fe===void 0&&Ne(I)!==Ne(Ae().clientId))return;be.end={...nt,offset:Re}}je(be)},[I,Ne,ye,Ae,_,B,je]),{formatTypes:pe,prepareHandlers:ke,valueHandlers:Se,changeHandlers:se,dependencies:L}=dNt({clientId:I,identifier:_,withoutInteractiveFormatting:f,allowedFormats:ie});function U(fe){return Se.reduce((Re,be)=>be(Re,fe.text),fe.formats)}function ne(fe){return pe.forEach(Re=>{Re.__experimentalCreatePrepareEditableTree&&(fe=Yd(fe,Re.name,0,fe.text.length))}),fe.formats}function ve(fe){return ke.reduce((Re,be)=>be(Re,fe.text),fe.formats)}const{value:qe,getValue:Pe,onChange:rt,ref:qt}=e1e({value:n,onChange(fe,{__unstableFormats:Re,__unstableText:be}){o(fe),Object.values(se).forEach(ze=>{ze(Re,be)})},selectionStart:Q,selectionEnd:te,onSelectionChange:re,placeholder:ce||d,__unstableIsSelected:ee,__unstableDisableFormats:k,preserveWhiteSpace:v,__unstableDependencies:[...L,t],__unstableAfterParse:U,__unstableBeforeSerialize:ne,__unstableAddInvisibleFormats:ve}),wt=Jyt({onReplace:u,completers:l,record:qe,onChange:rt});aNt({html:n,value:qe});const Bt=x.useRef(new Set),ae=x.useRef(new Set);function H(){N.current?.focus()}const Y=t;return a.jsxs(a.Fragment,{children:[ee&&a.jsx(o3e.Provider,{value:Bt,children:a.jsx(r3e.Provider,{value:ae,children:a.jsxs(Io.__unstableSlotNameProvider,{value:"__unstable-block-tools-after",children:[e&&e({value:qe,onChange:rt,onFocus:H}),a.jsx(qNt,{value:qe,onChange:rt,onFocus:H,formatTypes:pe,forwardedRef:N})]})})}),ee&&we&&a.jsx(iNt,{inline:i,editableContentElement:N.current}),a.jsx(Y,{role:"textbox","aria-multiline":!S,"aria-readonly":de,...T,draggable:void 0,"aria-label":me||T["aria-label"]||d,...wt,ref:xn([qt,E,wt.ref,T.ref,kNt({registry:Z,getValue:Pe,onChange:rt,__unstableAllowPrefixTransformations:C,formatTypes:pe,onReplace:u,selectionChange:je,isSelected:ee,disableFormats:k,value:qe,tagName:t,onSplit:g,__unstableEmbedURLOnPaste:y,pastePlainText:M,onMerge:h,onRemove:b,removeEditorOnlyFormats:ne,disableLineBreaks:S,onSplitAtEnd:z,onSplitAtDoubleLineEnd:A,keyboardShortcuts:Bt,inputEvents:ae}),N]),contentEditable:!de,suppressContentEditableWarning:!0,className:oe("block-editor-rich-text__editable",T.className,"rich-text"),tabIndex:T.tabIndex===0&&!de?null:T.tabIndex,"data-wp-block-attribute-key":_})]})}const Q_=ENt(x.forwardRef(hI));Q_.Content=fI;Q_.isEmpty=e=>!e||e.length===0;const Ie=x.forwardRef((e,t)=>{if(j0()[oae]){const{children:r,tagName:s="div",value:i,onChange:c,isSelected:l,multiline:u,inlineToolbar:d,wrapperClassName:p,autocompleters:f,onReplace:b,placeholder:h,allowedFormats:g,withoutInteractiveFormatting:z,onRemove:A,onMerge:_,onSplit:v,__unstableOnSplitAtEnd:M,__unstableOnSplitAtDoubleLineEnd:y,identifier:k,preserveWhiteSpace:S,__unstablePastePlainText:C,__unstableEmbedURLOnPaste:R,__unstableDisableFormats:T,disableLineBreaks:E,__unstableAllowPrefixTransformations:B,readOnly:N,...j}=s3e(e);return a.jsx(s,{...j,dangerouslySetInnerHTML:{__html:n3e(i,u)}})}return a.jsx(Q_,{ref:t,...e,readOnly:!1})});Ie.Content=fI;Ie.isEmpty=e=>!e||e.length===0;const i3e=x.forwardRef((e,t)=>a.jsx(Ie,{ref:t,...e,__unstableDisableFormats:!0}));i3e.Content=({value:e="",tagName:t="div",...n})=>a.jsx(t,{...n,children:e});const Gd=x.forwardRef(({__experimentalVersion:e,...t},n)=>{if(e===2)return a.jsx(i3e,{ref:n,...t});const{className:o,onChange:r,...s}=t;return a.jsx(b7,{ref:n,className:oe("block-editor-plain-text",o),onChange:i=>r(i.target.value),...s})}),Ate=a.jsx(ge,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:a.jsx(he,{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"})});function WNt(e,t){const n=G(r=>r(J).__unstableGetEditorMode(),[]),{__unstableSetEditorMode:o}=Oe(J);return a.jsx(so,{renderToggle:({isOpen:r,onToggle:s})=>a.jsx(Ce,{size:"compact",...e,ref:t,icon:n==="navigation"?Nd:Ate,"aria-expanded":r,"aria-haspopup":"true",onClick:s,label:m("Tools")}),popoverProps:{placement:"bottom-start"},renderContent:()=>a.jsxs(a.Fragment,{children:[a.jsx(pm,{className:"block-editor-tool-selector__menu",role:"menu","aria-label":m("Tools"),children:a.jsx(kf,{value:n==="navigation"?"navigation":"edit",onSelect:r=>{o(r)},choices:[{value:"navigation",label:a.jsxs(a.Fragment,{children:[a.jsx(wn,{icon:Nd}),m("Write")]}),info:m("Focus on content."),"aria-label":m("Write")},{value:"edit",label:a.jsxs(a.Fragment,{children:[Ate,m("Design")]}),info:m("Edit layout and styles."),"aria-label":m("Design")}]})}),a.jsx("div",{className:"block-editor-tool-selector__help",children:m("Tools provide different sets of interactions for blocks. Toggle between simplified content tools (Write) and advanced visual editing tools (Design).")})]})})}const NNt=x.forwardRef(WNt),iT="none",vte="custom",xte="media",wte="attachment",_te=["noreferrer","noopener"],a3e=({linkDestination:e,onChangeUrl:t,url:n,mediaType:o="image",mediaUrl:r,mediaLink:s,linkTarget:i,linkClass:c,rel:l,showLightboxSetting:u,lightboxEnabled:d,onSetLightbox:p,resetLightbox:f})=>{const[b,h]=x.useState(!1),[g,z]=x.useState(null),A=()=>{h(!0)},[_,v]=x.useState(!1),[M,y]=x.useState(null),k=x.useRef(null),S=x.useRef();x.useEffect(()=>{if(!S.current)return;(Xr.focusable.find(S.current)[0]||S.current).focus()},[_,n,d]);const C=()=>{(e===xte||e===wte)&&y(""),v(!0)},R=()=>{v(!1)},T=()=>{y(null),R(),h(!1)},E=ce=>{const me=ce?"_blank":void 0;let de;if(me){const Ae=(l??"").split(" ");_te.forEach(ye=>{Ae.includes(ye)||Ae.push(ye)}),de=Ae.join(" ")}else{const Ae=(l??"").split(" ").filter(ye=>_te.includes(ye)===!1);de=Ae.length?Ae.join(" "):void 0}return{linkTarget:me,rel:de}},B=()=>ce=>{const me=k.current;me&&me.contains(ce.target)||(h(!1),y(null),R())},N=()=>ce=>{if(M){const me=I().find(de=>de.url===M)?.linkDestination||vte;t({href:M,linkDestination:me,lightbox:{enabled:!1}})}R(),y(null),ce.preventDefault()},j=()=>{t({linkDestination:iT,href:""})},I=()=>{const ce=[{linkDestination:xte,title:m("Link to image file"),url:o==="image"?r:void 0,icon:Oz}];return o==="image"&&s&&ce.push({linkDestination:wte,title:m("Link to attachment page"),url:o==="image"?s:void 0,icon:wa}),ce},P=ce=>{const me=I();let de;ce?de=(me.find(Ae=>Ae.url===ce)||{linkDestination:vte}).linkDestination:de=iT,t({linkDestination:de,href:ce})},$=ce=>{const me=E(ce);t(me)},F=ce=>{t({rel:ce})},X=ce=>{t({linkClass:ce})},Z=a.jsxs(dt,{spacing:"3",children:[a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Open in new tab"),onChange:$,checked:i==="_blank"}),a.jsx(dn,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:m("Link rel"),value:l??"",onChange:F}),a.jsx(dn,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:m("Link CSS class"),value:c||"",onChange:X})]}),V=M!==null?M:n,Q=!d||d&&!u,te=!V&&Q,ee=(I().find(ce=>ce.linkDestination===e)||{}).title,ue=()=>{if(d&&u&&!n&&!_)return a.jsxs("div",{className:"block-editor-url-popover__expand-on-click",children:[a.jsx(wn,{icon:zz}),a.jsxs("div",{className:"text",children:[a.jsx("p",{children:m("Enlarge on click")}),a.jsx("p",{className:"description",children:m("Scales the image with a lightbox effect")})]}),a.jsx(Ce,{icon:Pl,label:m("Disable enlarge on click"),onClick:()=>{p?.(!1)},size:"compact"})]});if(!n||_)return a.jsx(lf.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:V,onChangeInputValue:y,onSubmit:N(),autocompleteRef:k});if(n&&!_)return a.jsxs(a.Fragment,{children:[a.jsx(lf.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:n,onEditLinkClick:C,urlLabel:ee}),a.jsx(Ce,{icon:Pl,label:m("Remove link"),onClick:()=>{j(),f?.()},size:"compact"})]})};return a.jsxs(a.Fragment,{children:[a.jsx(Vt,{icon:xa,className:"components-toolbar__control",label:m("Link"),"aria-expanded":b,onClick:A,ref:z,isActive:!!n||d&&u}),b&&a.jsx(lf,{ref:S,anchor:g,onFocusOutside:B(),onClose:T,renderSettings:Q?()=>Z:null,additionalControls:te&&a.jsxs(pm,{children:[I().map(ce=>a.jsx(Ct,{icon:ce.icon,iconPosition:"left",onClick:()=>{y(null),P(ce.url),R()},children:ce.title},ce.linkDestination)),u&&a.jsx(Ct,{className:"block-editor-url-popover__expand-on-click",icon:zz,info:m("Scale the image with a lightbox effect."),iconPosition:"left",onClick:()=>{y(null),t({linkDestination:iT,href:""}),p?.(!0),R()},children:m("Enlarge on click")},"expand-on-click")]}),offset:13,children:ue()})]})};function BNt(e){const[t,n]=x.useState(window.innerWidth);x.useEffect(()=>{if(e==="Desktop")return;const s=()=>n(window.innerWidth);return window.addEventListener("resize",s),()=>{window.removeEventListener("resize",s)}},[e]);const o=s=>{let i;switch(s){case"Tablet":i=780;break;case"Mobile":i=360;break;default:return null}return i{const i=s==="Mobile"?"768px":"1024px",c="40px",l="auto";switch(s){case"Tablet":case"Mobile":return{width:o(s),marginTop:c,marginBottom:c,marginLeft:l,marginRight:l,height:i,maxWidth:"100%"};default:return{marginLeft:l,marginRight:l}}})(e)}function LNt(){const e=G(o=>o(J).getBlockSelectionStart(),[]),t=x.useRef();f7(e,t);const n=()=>{t.current?.focus()};return e?a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:n,children:m("Skip to the selected block")}):null}function PNt(){const e=G(t=>t(J).getSelectedBlockCount(),[]);return a.jsxs(Ot,{justify:"flex-start",spacing:2,className:"block-editor-multi-selection-inspector__card",children:[a.jsx(Zn,{icon:H3,showColors:!0}),a.jsx("div",{className:"block-editor-multi-selection-inspector__card-title",children:xe(Dn("%d Block","%d Blocks",e),e)})]})}const c3e={name:"settings",title:m("Settings"),value:"settings",icon:Zue},l3e={name:"styles",title:m("Styles"),value:"styles",icon:jde},UW={name:"list",title:m("List View"),value:"list-view",icon:LP},u3e=()=>{const e=H0(j_.slotName);return!(e&&e.length)?null:a.jsx(Qt,{className:"block-editor-block-inspector__advanced",title:m("Advanced"),initialOpen:!1,children:a.jsx(et.Slot,{group:"advanced"})})},jNt=()=>{const[e,t]=x.useState(),{multiSelectedBlocks:n}=G(o=>{const{getBlocksByClientId:r,getSelectedBlockClientIds:s}=o(J),i=s();return{multiSelectedBlocks:r(i)}},[]);return x.useLayoutEffect(()=>{e===void 0&&t(n.some(({attributes:o})=>!!o?.style?.position?.type))},[e,n,t]),a.jsx(Qt,{className:"block-editor-block-inspector__position",title:m("Position"),initialOpen:e??!1,children:a.jsx(et.Slot,{group:"position"})})},d3e=()=>{const e=H0(L_.position.name);return!(e&&e.length)?null:a.jsx(jNt,{})},INt=({showAdvancedControls:e=!1})=>a.jsxs(a.Fragment,{children:[a.jsx(et.Slot,{}),a.jsx(d3e,{}),a.jsx(et.Slot,{group:"bindings"}),e&&a.jsx("div",{children:a.jsx(u3e,{})})]}),DNt=({blockName:e,clientId:t,hasBlockStyles:n})=>{const o=G_({blockName:e});return a.jsxs(a.Fragment,{children:[n&&a.jsx("div",{children:a.jsx(Qt,{title:m("Styles"),children:a.jsx(Lze,{clientId:t})})}),a.jsx(et.Slot,{group:"color",label:m("Color"),className:"color-block-support-panel__inner-wrapper"}),a.jsx(et.Slot,{group:"background",label:m("Background image")}),a.jsx(et.Slot,{group:"filter"}),a.jsx(et.Slot,{group:"typography",label:m("Typography")}),a.jsx(et.Slot,{group:"dimensions",label:m("Dimensions")}),a.jsx(et.Slot,{group:"border",label:o}),a.jsx(et.Slot,{group:"styles"})]})},FNt=["core/navigation"],p3e=e=>!FNt.includes(e),{Tabs:Np}=ct(tr);function f3e({blockName:e,clientId:t,hasBlockStyles:n,tabs:o}){const r=G(i=>i(ht).get("core","showIconLabels"),[]),s=p3e(e)?void 0:UW.name;return a.jsx("div",{className:"block-editor-block-inspector__tabs",children:a.jsxs(Np,{defaultTabId:s,children:[a.jsx(Np.TabList,{children:o.map(i=>r?a.jsx(Np.Tab,{tabId:i.name,children:i.title},i.name):a.jsx(B0,{text:i.title,children:a.jsx(Np.Tab,{tabId:i.name,"aria-label":i.title,children:a.jsx(qo,{icon:i.icon})})},i.name))}),a.jsx(Np.TabPanel,{tabId:c3e.name,focusable:!1,children:a.jsx(INt,{showAdvancedControls:!!e})}),a.jsx(Np.TabPanel,{tabId:l3e.name,focusable:!1,children:a.jsx(DNt,{blockName:e,clientId:t,hasBlockStyles:n})}),a.jsx(Np.TabPanel,{tabId:UW.name,focusable:!1,children:a.jsx(et.Slot,{group:"list"})})]},t)})}const $Nt=[];function VNt(e,t={}){return t[e]!==void 0?t[e]:t.default!==void 0?t.default:!0}function b3e(e){const t=[],{bindings:n,border:o,color:r,default:s,dimensions:i,list:c,position:l,styles:u,typography:d,effects:p}=L_,f=p3e(e),b=H0(c.name),h=!f&&!!b&&b.length,z=[...H0(o.name)||[],...H0(r.name)||[],...H0(i.name)||[],...H0(u.name)||[],...H0(d.name)||[],...H0(p.name)||[]].length,A=[...H0(j_.slotName)||[],...H0(n.name)||[]],_=[...H0(s.name)||[],...H0(l.name)||[],...h&&z>1?A:[]];h&&t.push(UW),_.length&&t.push(c3e),z&&t.push(l3e);const v=G(y=>y(J).getSettings().blockInspectorTabs,[]);return VNt(e,v)?t:$Nt}function HNt(e){return G(t=>{if(e){const n=t(J).getSettings().blockInspectorAnimation,o=n?.animationParent,{getSelectedBlockClientId:r,getBlockParentsByBlockName:s}=t(J),i=r();return!s(i,o,!0)[0]&&e.name!==o?null:n?.[e.name]}return null},[e])}function h3e({clientIds:e,onSelect:t}){return e.length?a.jsx(dt,{spacing:1,children:e.map(n=>a.jsx(UNt,{onSelect:t,clientId:n},n))}):null}function UNt({clientId:e,onSelect:t}){const n=ji(e),o=Fd({clientId:e,context:"list-view"}),{isSelected:r}=G(i=>{const{isBlockSelected:c,hasSelectedInnerBlock:l}=i(J);return{isSelected:c(e)||l(e,!0)}},[e]),{selectBlock:s}=Oe(J);return a.jsx(Ce,{__next40pxDefaultSize:!0,isPressed:r,onClick:async()=>{await s(e),t&&t(e)},children:a.jsxs(Yo,{children:[a.jsx(Tn,{children:a.jsx(Zn,{icon:n?.icon})}),a.jsx(eu,{style:{textAlign:"left"},children:a.jsx(zs,{children:o})})]})})}function XNt({clientId:e}){return a.jsx(Qt,{title:m("Styles"),children:a.jsx(Lze,{clientId:e})})}function m3e(){const{count:e,selectedBlockName:t,selectedBlockClientId:n,blockType:o,isSectionBlock:r}=G(d=>{const{getSelectedBlockClientId:p,getSelectedBlockCount:f,getBlockName:b,getParentSectionBlock:h,isSectionBlock:g}=ct(d(J)),z=p(),A=h(z)||p(),_=A&&b(A),v=_&&on(_);return{count:f(),selectedBlockClientId:A,selectedBlockName:_,blockType:v,isSectionBlock:g(A)}},[]),s=b3e(o?.name),i=s?.length>1,c=HNt(o),l=G_({blockName:t});if(e>1&&!r)return a.jsxs("div",{className:"block-editor-block-inspector",children:[a.jsx(PNt,{}),i?a.jsx(f3e,{tabs:s}):a.jsxs(a.Fragment,{children:[a.jsx(et.Slot,{}),a.jsx(et.Slot,{group:"color",label:m("Color"),className:"color-block-support-panel__inner-wrapper"}),a.jsx(et.Slot,{group:"background",label:m("Background image")}),a.jsx(et.Slot,{group:"typography",label:m("Typography")}),a.jsx(et.Slot,{group:"dimensions",label:m("Dimensions")}),a.jsx(et.Slot,{group:"border",label:l}),a.jsx(et.Slot,{group:"styles"})]})]});const u=t===g3();return!o||!n||u?a.jsx("span",{className:"block-editor-block-inspector__no-blocks",children:m("No block selected.")}):a.jsx(GNt,{animate:c,wrapper:d=>a.jsx(KNt,{blockInspectorAnimationSettings:c,selectedBlockClientId:n,children:d}),children:a.jsx(YNt,{clientId:n,blockName:o.name,isSectionBlock:r})})}const GNt=({animate:e,wrapper:t,children:n})=>e?t(n):n,KNt=({blockInspectorAnimationSettings:e,selectedBlockClientId:t,children:n})=>{const o=e&&e.enterDirection==="leftToRight"?-50:50;return a.jsx(qr.div,{animate:{x:0,opacity:1,transition:{ease:"easeInOut",duration:.14}},initial:{x:o,opacity:0},children:n},t)},YNt=({clientId:e,blockName:t,isSectionBlock:n})=>{const o=b3e(t),r=!n&&o?.length>1,s=G(u=>{const{getBlockStyles:d}=u(kt),p=d(t);return p&&p.length>0},[t]),i=ji(e),c=G_({blockName:t}),l=G(u=>{if(!n)return;const{getClientIdsOfDescendants:d,getBlockName:p,getBlockEditingMode:f}=u(J);return d(e).filter(b=>p(b)!=="core/list-item"&&f(b)==="contentOnly")},[n,e]);return a.jsxs("div",{className:"block-editor-block-inspector",children:[a.jsx(hme,{...i,className:i.isSynced&&"is-synced"}),a.jsx(sWt,{blockClientId:e}),r&&a.jsx(f3e,{hasBlockStyles:s,clientId:e,blockName:t,tabs:o}),!r&&a.jsxs(a.Fragment,{children:[s&&a.jsx(XNt,{clientId:e}),l&&l?.length>0&&a.jsx(Qt,{title:m("Content"),children:a.jsx(h3e,{clientIds:l})}),!n&&a.jsxs(a.Fragment,{children:[a.jsx(et.Slot,{}),a.jsx(et.Slot,{group:"list"}),a.jsx(et.Slot,{group:"color",label:m("Color"),className:"color-block-support-panel__inner-wrapper"}),a.jsx(et.Slot,{group:"background",label:m("Background image")}),a.jsx(et.Slot,{group:"typography",label:m("Typography")}),a.jsx(et.Slot,{group:"dimensions",label:m("Dimensions")}),a.jsx(et.Slot,{group:"border",label:c}),a.jsx(et.Slot,{group:"styles"}),a.jsx(d3e,{}),a.jsx(et.Slot,{group:"bindings"}),a.jsx("div",{children:a.jsx(u3e,{})})]})]}),a.jsx(LNt,{},"back")]})},ZNt=()=>{};function QNt({rootClientId:e,clientId:t,isAppender:n,showInserterHelpPanel:o,showMostUsedBlocks:r=!1,__experimentalInsertionIndex:s,__experimentalInitialTab:i,__experimentalInitialCategory:c,__experimentalFilterValue:l,onPatternCategorySelection:u,onSelect:d=ZNt,shouldFocusBlock:p=!1,onClose:f},b){const{destinationRootClientId:h}=G(g=>{const{getBlockRootClientId:z}=g(J);return{destinationRootClientId:e||z(t)||void 0}},[t,e]);return a.jsx(Oge,{onSelect:d,rootClientId:h,clientId:t,isAppender:n,showInserterHelpPanel:o,showMostUsedBlocks:r,__experimentalInsertionIndex:s,__experimentalFilterValue:l,onPatternCategorySelection:u,__experimentalInitialTab:i,__experimentalInitialCategory:c,shouldFocusBlock:p,ref:b,onClose:f})}const g3e=x.forwardRef(QNt);function JNt(e,t){return a.jsx(g3e,{...e,onPatternCategorySelection:void 0,ref:t})}x.forwardRef(JNt);window.navigator.userAgent.indexOf("Trident");const eBt=new Set([cc,Ps,wi,_i]),tBt=.75;function nBt(){const e=G(t=>t(J).hasSelectedBlock(),[]);return Mn(t=>{if(!e)return;const{ownerDocument:n}=t,{defaultView:o}=n;let r,s,i;function c(){r||(r=o.requestAnimationFrame(()=>{f(),r=null}))}function l(g){s&&o.cancelAnimationFrame(s),s=o.requestAnimationFrame(()=>{u(g),s=null})}function u({keyCode:g}){if(!b())return;const z=ME(o);if(!z)return;if(!i){i=z;return}if(eBt.has(g)){i=z;return}const A=z.top-i.top;if(A===0)return;const _=ps(t);if(!_)return;const v=_===n.body||_===n.documentElement,M=v?o.scrollY:_.scrollTop,y=v?0:_.getBoundingClientRect().top,k=v?i.top/o.innerHeight:(i.top-y)/(o.innerHeight-y);if(M===0&&ky+S||i.top{o.removeEventListener("scroll",c,!0),o.removeEventListener("resize",c,!0),t.removeEventListener("keydown",l),t.removeEventListener("keyup",u),t.removeEventListener("mousedown",d),t.removeEventListener("touchstart",d),n.removeEventListener("selectionchange",p),o.cancelAnimationFrame(r),o.cancelAnimationFrame(s)}},[e])}const XW=x.createContext({});function oBt(e,t,n){const o={...e,[t]:e[t]?new Set(e[t]):new Set};return o[t].add(n),o}function TO({children:e,uniqueId:t,blockName:n=""}){const o=x.useContext(XW),{name:r}=j0();n=n||r;const s=x.useMemo(()=>oBt(o,n,t),[o,n,t]);return a.jsx(XW.Provider,{value:s,children:e})}function J_(e,t=""){const n=x.useContext(XW),{name:o}=j0();return t=t||o,!!n[t]?.has(e)}function Qs({title:e,help:t,actions:n=[],onClose:o}){return a.jsxs(dt,{className:"block-editor-inspector-popover-header",spacing:4,children:[a.jsxs(Ot,{alignment:"center",children:[a.jsx(_a,{className:"block-editor-inspector-popover-header__heading",level:2,size:13,children:e}),a.jsx(t1,{}),n.map(({label:r,icon:s,onClick:i})=>a.jsx(Ce,{size:"small",className:"block-editor-inspector-popover-header__action",label:r,icon:s,variant:!s&&"tertiary",onClick:i,children:!s&&r},r)),o&&a.jsx(Ce,{size:"small",className:"block-editor-inspector-popover-header__action",label:m("Close"),icon:rp,onClick:o})]}),t&&a.jsx(Sn,{children:t})]})}function rBt({onClose:e,onChange:t,showPopoverHeaderActions:n,isCompact:o,currentDate:r,...s},i){const c={startOfWeek:Sa().l10n.startOfWeek,onChange:t,currentDate:o?void 0:r,currentTime:o?r:void 0,...s},l=o?lO:dft;return a.jsxs("div",{ref:i,className:"block-editor-publish-date-time-picker",children:[a.jsx(Qs,{title:m("Publish"),actions:n?[{label:m("Now"),onClick:()=>t?.(null)}]:void 0,onClose:e}),a.jsx(l,{...c})]})}const M3e=x.forwardRef(rBt);function sBt(e,t){return a.jsx(M3e,{...e,showPopoverHeaderActions:!0,isCompact:!1,ref:t})}const iBt=x.forwardRef(sBt);function Jr(e){const t=j0(),{clientId:n=""}=t,{setBlockEditingMode:o,unsetBlockEditingMode:r}=Oe(J),s=G(i=>n?null:i(J).getBlockEditingMode(),[n]);return x.useEffect(()=>(e&&o(n,e),()=>{e&&r(n)}),[n,e,o,r]),n?t[nae]:s}const Ii=e=>{if(e===null||typeof e!="object"||Array.isArray(e))return e;const t=Object.entries(e).map(([n,o])=>[n,Ii(o)]).filter(([,n])=>n!==void 0);return t.length?Object.fromEntries(t):void 0};function z3e(e,t,n,o,r,s){if(Object.values(e??{}).every(l=>!l)||s.length===1&&n.innerBlocks.length===o.length)return n;let i=o[0]?.attributes;if(s.length>1&&o.length>1)if(o[r])i=o[r]?.attributes;else return n;let c=n;return Object.entries(e).forEach(([l,u])=>{u&&t[l].forEach(d=>{const p=fo(i,d);p&&(c={...c,attributes:gn(c.attributes,d,p)})})}),c}function W0(e,t,n){const r=An(e,t)?.__experimentalSkipSerialization;return Array.isArray(r)?r.includes(n):r}const tl=new WeakMap;function EO({id:e,css:t}){return Jz({id:e,css:t})}function Jz({id:e,css:t,assets:n,__unstableType:o,variation:r,clientId:s}={}){const{setStyleOverride:i,deleteStyleOverride:c}=ct(Oe(J)),l=Fn(),u=x.useId();x.useEffect(()=>{if(!t&&!n)return;const d=e||u,p={id:e,css:t,assets:n,__unstableType:o,variation:r,clientId:s};return tl.get(l)||tl.set(l,[]),tl.get(l).push([d,p]),window.queueMicrotask(()=>{tl.get(l)?.length&&l.batch(()=>{tl.get(l).forEach(f=>{i(...f)}),tl.set(l,[])})}),()=>{tl.get(l)?.find(([b])=>b===d)?tl.set(l,tl.get(l).filter(([b])=>b!==d)):c(d)}},[e,t,s,n,o,u,i,c,l])}function WO(e,t){const[n,o,r,s,i,c,l,u,d,p,f,b,h,g,z,A,_,v,M,y,k,S,C,R,T,E,B,N,j,I,P,$,F,X,Z,V,Q,te,ee,ue,ce,me,de,Ae,ye,Ne,je,ie,we,re,pe,ke,Se,se,L,U]=Un("background.backgroundImage","background.backgroundSize","typography.fontFamilies.custom","typography.fontFamilies.default","typography.fontFamilies.theme","typography.defaultFontSizes","typography.fontSizes.custom","typography.fontSizes.default","typography.fontSizes.theme","typography.customFontSize","typography.fontStyle","typography.fontWeight","typography.lineHeight","typography.textAlign","typography.textColumns","typography.textDecoration","typography.writingMode","typography.textTransform","typography.letterSpacing","spacing.padding","spacing.margin","spacing.blockGap","spacing.defaultSpacingSizes","spacing.customSpacingSize","spacing.spacingSizes.custom","spacing.spacingSizes.default","spacing.spacingSizes.theme","spacing.units","dimensions.aspectRatio","dimensions.minHeight","layout","border.color","border.radius","border.style","border.width","color.custom","color.palette.custom","color.customDuotone","color.palette.theme","color.palette.default","color.defaultPalette","color.defaultDuotone","color.duotone.custom","color.duotone.theme","color.duotone.default","color.gradients.custom","color.gradients.theme","color.gradients.default","color.defaultGradients","color.customGradient","color.background","color.link","color.text","color.heading","color.button","shadow"),ne=x.useMemo(()=>({background:{backgroundImage:n,backgroundSize:o},color:{palette:{custom:Q,theme:ee,default:ue},gradients:{custom:Ne,theme:je,default:ie},duotone:{custom:de,theme:Ae,default:ye},defaultGradients:we,defaultPalette:ce,defaultDuotone:me,custom:V,customGradient:re,customDuotone:te,background:pe,link:ke,heading:se,button:L,text:Se},typography:{fontFamilies:{custom:r,default:s,theme:i},fontSizes:{custom:l,default:u,theme:d},customFontSize:p,defaultFontSizes:c,fontStyle:f,fontWeight:b,lineHeight:h,textAlign:g,textColumns:z,textDecoration:A,textTransform:v,letterSpacing:M,writingMode:_},spacing:{spacingSizes:{custom:T,default:E,theme:B},customSpacingSize:R,defaultSpacingSizes:C,padding:y,margin:k,blockGap:S,units:N},border:{color:$,radius:F,style:X,width:Z},dimensions:{aspectRatio:j,minHeight:I},layout:P,parentLayout:t,shadow:U}),[n,o,r,s,i,c,l,u,d,p,f,b,h,g,z,A,v,M,_,y,k,S,C,R,T,E,B,N,j,I,P,t,$,F,X,Z,V,Q,te,ee,ue,ce,me,de,Ae,ye,Ne,je,ie,we,re,pe,ke,Se,se,L,U]);return aMe(ne,e)}function aBt(e){e=e.map(n=>({...n,Edit:x.memo(n.edit)}));const t=Or(n=>o=>{const r=j0();return[...e.map((s,i)=>{const{Edit:c,hasSupport:l,attributeKeys:u=[],shareWithChildBlocks:d}=s;if(!(r[J5]||r[GB]&&d)||!l(o.name))return null;const f={};for(const b of u)o.attributes[b]&&(f[b]=o.attributes[b]);return a.jsx(c,{name:o.name,isSelected:o.isSelected,clientId:o.clientId,setAttributes:o.setAttributes,__unstableParentLayout:o.__unstableParentLayout,...f},i)}),a.jsx(n,{...o},"edit")]},"withBlockEditHooks");Bn("editor.BlockEdit","core/editor/hooks",t)}function cBt({index:e,useBlockProps:t,setAllWrapperProps:n,...o}){const r=t(o),s=i=>n(c=>{const l=[...c];return l[e]=i,l});return x.useEffect(()=>(s(r),()=>{s(void 0)})),null}const lBt=x.memo(cBt);function uBt(e){const t=Or(n=>o=>{const[r,s]=x.useState(Array(e.length).fill(void 0));return[...e.map((i,c)=>{const{hasSupport:l,attributeKeys:u=[],useBlockProps:d,isMatch:p}=i,f={};for(const b of u)o.attributes[b]&&(f[b]=o.attributes[b]);return!Object.keys(f).length||!l(o.name)||p&&!p(f)?null:a.jsx(lBt,{index:c,useBlockProps:d,setAllWrapperProps:s,name:o.name,clientId:o.clientId,...f},c)}),a.jsx(n,{...o,wrapperProps:r.filter(Boolean).reduce((i,c)=>({...i,...c,className:oe(i.className,c.className),style:{...i.style,...c.style}}),o.wrapperProps||{})},"edit")]},"withBlockListBlockHooks");Bn("editor.BlockListBlock","core/editor/hooks",t)}function dBt(e){function t(n,o,r){return e.reduce((s,i)=>{const{hasSupport:c,attributeKeys:l=[],addSaveProps:u}=i,d={};for(const p of l)r[p]&&(d[p]=r[p]);return!Object.keys(d).length||!c(o)?s:u(s,o,d)},n)}Bn("blocks.getSaveContent.extraProps","core/editor/hooks",t,0),Bn("blocks.getSaveContent.extraProps","core/editor/hooks",n=>(n.hasOwnProperty("className")&&!n.className&&delete n.className,n))}function pBt(e){const{apiVersion:t=1}=e;return t<2&&Tt(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}Bn("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",pBt);const GW=["left","center","right","wide","full"],fBt=["wide","full"];function mI(e,t=!0,n=!0){let o;return Array.isArray(e)?o=GW.filter(r=>e.includes(r)):e===!0?o=[...GW]:o=[],!n||e===!0&&!t?o.filter(r=>!fBt.includes(r)):o}function bBt(e){var t;return"type"in((t=e.attributes?.align)!==null&&t!==void 0?t:{})||Tt(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...GW,""]}}),e}function hBt({name:e,align:t,setAttributes:n}){const o=mI(An(e,"align"),Tt(e,"alignWide",!0)),r=d7(o).map(({name:c})=>c),s=Jr();if(!r.length||s!=="default")return null;const i=c=>{c||on(e)?.attributes?.align?.default&&(c=""),n({align:c})};return a.jsx(bt,{group:"block",__experimentalShareWithChildBlocks:!0,children:a.jsx(yvt,{value:t,onChange:i,controls:r})})}const gI={shareWithChildBlocks:!0,edit:hBt,useBlockProps:mBt,addSaveProps:gBt,attributeKeys:["align"],hasSupport(e){return Tt(e,"align",!1)}};function mBt({name:e,align:t}){const n=mI(An(e,"align"),Tt(e,"alignWide",!0));return d7(n).some(r=>r.name===t)?{"data-align":t}:{}}function gBt(e,t,n){const{align:o}=n,r=An(t,"align"),s=Tt(t,"alignWide",!0);return mI(r,s).includes(o)&&(e.className=oe(`align${o}`,e.className)),e}Bn("blocks.registerBlockType","core/editor/align/addAttribute",bBt);function MBt(e){var t;return"type"in((t=e.attributes?.lock)!==null&&t!==void 0?t:{})||(e.attributes={...e.attributes,lock:{type:"object"}}),e}Bn("blocks.registerBlockType","core/lock/addAttribute",MBt);const zBt=/[\s#]/g,OBt={type:"string",source:"attribute",attribute:"id",selector:"*"};function yBt(e){var t;return"type"in((t=e.attributes?.anchor)!==null&&t!==void 0?t:{})||Tt(e,"anchor")&&(e.attributes={...e.attributes,anchor:OBt}),e}function ABt({anchor:e,setAttributes:t}){return Jr()!=="default"?null:a.jsx(et,{group:"advanced",children:a.jsx(dn,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,className:"html-anchor-control",label:m("HTML anchor"),help:a.jsxs(a.Fragment,{children:[m("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor”. Then, you’ll be able to link directly to this section of your page."),a.jsxs(a.Fragment,{children:[" ",a.jsx(hr,{href:m("https://wordpress.org/documentation/article/page-jumps/"),children:m("Learn more about anchors")})]})]}),value:e||"",placeholder:null,onChange:o=>{o=o.replace(zBt,"-"),t({anchor:o})},autoCapitalize:"none",autoComplete:"off"})})}const O3e={addSaveProps:vBt,edit:ABt,attributeKeys:["anchor"],hasSupport(e){return Tt(e,"anchor")}};function vBt(e,t,n){return Tt(t,"anchor")&&(e.id=n.anchor===""?null:n.anchor),e}Bn("blocks.registerBlockType","core/anchor/attribute",yBt);const xBt={type:"string",source:"attribute",attribute:"aria-label",selector:"*"};function wBt(e){return e?.attributes?.ariaLabel?.type||Tt(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:xBt}),e}function _Bt(e,t,n){return Tt(t,"ariaLabel")&&(e["aria-label"]=n.ariaLabel===""?null:n.ariaLabel),e}const kBt={addSaveProps:_Bt,attributeKeys:["ariaLabel"],hasSupport(e){return Tt(e,"ariaLabel")}};Bn("blocks.registerBlockType","core/ariaLabel/attribute",wBt);function SBt(e){return Tt(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e}function CBt({className:e,setAttributes:t}){return Jr()!=="default"?null:a.jsx(et,{group:"advanced",children:a.jsx(dn,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,autoComplete:"off",label:m("Additional CSS class(es)"),value:e||"",onChange:o=>{t({className:o!==""?o:void 0})},help:m("Separate multiple classes with spaces.")})})}const y3e={edit:CBt,addSaveProps:qBt,attributeKeys:["className"],hasSupport(e){return Tt(e,"customClassName",!0)}};function qBt(e,t,n){return Tt(t,"customClassName",!0)&&n.className&&(e.className=oe(e.className,n.className)),e}function RBt(e,t,n,o){if(!Tt(e.name,"customClassName",!0)||o.length===1&&e.innerBlocks.length===t.length||o.length===1&&t.length>1||o.length>1&&t.length===1)return e;if(t[n]){const r=t[n]?.attributes.className;if(r)return{...e,attributes:{...e.attributes,className:r}}}return e}Bn("blocks.registerBlockType","core/editor/custom-class-name/attribute",SBt);Bn("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",RBt);function TBt(e,t){return Tt(t,"className",!0)&&(typeof e.className=="string"?e.className=[...new Set([G4(t.name),...e.className.split(" ")])].join(" ").trim():e.className=G4(t.name)),e}Bn("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",TBt);function Ov(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function EBt({clientId:e}){const[t,n]=x.useState(),[o,r]=x.useState(),[s,i]=x.useState(),c=Wi(e);return x.useEffect(()=>{if(!c)return;r(Ov(c).color);const l=c.querySelector("a");l&&l.innerText&&i(Ov(l).color);let u=c,d=Ov(u).backgroundColor;for(;d==="rgba(0, 0, 0, 0)"&&u.parentNode&&u.parentNode.nodeType===u.parentNode.ELEMENT_NODE;)u=u.parentNode,d=Ov(u).backgroundColor;n(d)},[c]),a.jsx(Yx,{backgroundColor:t,textColor:o,enableAlphaChecker:!0,linkColor:s})}const Q0="color",ek=e=>{const t=An(e,Q0);return t&&(t.link===!0||t.gradient===!0||t.background!==!1||t.text!==!1)},WBt=e=>{const t=An(e,Q0);return t!==null&&typeof t=="object"&&!!t.link},MI=e=>{const t=An(e,Q0);return t!==null&&typeof t=="object"&&!!t.gradients},NBt=e=>{const t=An(e,Q0);return t&&t.background!==!1},BBt=e=>{const t=An(e,Q0);return t&&t.text!==!1};function LBt(e){return ek(e)&&(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),MI(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}})),e}function A3e(e,t,n){if(!ek(t)||W0(t,Q0))return e;const o=MI(t),{backgroundColor:r,textColor:s,gradient:i,style:c}=n,l=g=>!W0(t,Q0,g),u=l("text")?Pt("color",s):void 0,d=l("gradients")?T1(i):void 0,p=l("background")?Pt("background-color",r):void 0,f=l("background")||l("gradients"),b=r||c?.color?.background||o&&(i||c?.color?.gradient),h=oe(e.className,u,d,{[p]:(!o||!c?.color?.gradient)&&!!p,"has-text-color":l("text")&&(s||c?.color?.text),"has-background":f&&b,"has-link-color":l("link")&&c?.elements?.link?.color});return e.className=h||void 0,e}function v3e(e){const t=e?.color?.text,n=t?.startsWith("var:preset|color|")?t.substring(17):void 0,o=e?.color?.background,r=o?.startsWith("var:preset|color|")?o.substring(17):void 0,s=e?.color?.gradient,i=s?.startsWith("var:preset|gradient|")?s.substring(20):void 0,c={...e};return c.color={...c.color,text:n?void 0:t,background:r?void 0:o,gradient:i?void 0:s},{style:Ii(c),textColor:n,backgroundColor:r,gradient:i}}function x3e(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 PBt({children:e,resetAllFilter:t}){const n=x.useCallback(o=>{const r=x3e(o),s=t(r);return{...o,...v3e(s)}},[t]);return a.jsx(et,{group:"color",resetAllFilter:n,children:e})}function jBt({clientId:e,name:t,setAttributes:n,settings:o}){const r=dze(o);function s(h){const{style:g,textColor:z,backgroundColor:A,gradient:_}=h(J).getBlockAttributes(e)||{};return{style:g,textColor:z,backgroundColor:A,gradient:_}}const{style:i,textColor:c,backgroundColor:l,gradient:u}=G(s,[e]),d=x.useMemo(()=>x3e({style:i,textColor:c,backgroundColor:l,gradient:u}),[i,c,l,u]),p=h=>{n(v3e(h))};if(!r)return null;const f=An(t,[Q0,"__experimentalDefaultControls"]),b=!d?.color?.gradient&&(o?.color?.text||o?.color?.link)&&An(t,[Q0,"enableContrastChecker"])!==!1;return a.jsx(gze,{as:PBt,panelId:e,settings:o,value:d,onChange:p,defaultControls:f,enableContrastChecker:An(t,[Q0,"enableContrastChecker"])!==!1,children:b&&a.jsx(EBt,{clientId:e})})}function IBt({name:e,backgroundColor:t,textColor:n,gradient:o,style:r}){const[s,i,c]=Un("color.palette.custom","color.palette.theme","color.palette.default"),l=x.useMemo(()=>[...s||[],...i||[],...c||[]],[s,i,c]);if(!ek(e)||W0(e,Q0))return{};const u={};n&&!W0(e,Q0,"text")&&(u.color=Sf(l,n)?.color),t&&!W0(e,Q0,"background")&&(u.backgroundColor=Sf(l,t)?.color);const d=A3e({style:u},e,{textColor:n,backgroundColor:t,gradient:o,style:r}),p=t||r?.color?.background||o||r?.color?.gradient;return{...d,className:oe(d.className,!p&&KRt(r))}}const w3e={useBlockProps:IBt,addSaveProps:A3e,attributeKeys:["backgroundColor","textColor","gradient","style"],hasSupport:ek},DBt={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};function FBt(e,t,n,o){const r=e.name,s={linkColor:WBt(r),textColor:BBt(r),backgroundColor:NBt(r),gradient:MI(r)};return z3e(s,DBt,e,t,n,o)}Bn("blocks.registerBlockType","core/color/addAttribute",LBt);Bn("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",FBt);const $Bt="typography.lineHeight",tk="typography.__experimentalFontFamily",{kebabCase:VBt}=ct(tr);function HBt(e){return Tt(e,tk)&&(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}})),e}function _3e(e,t,n){if(!Tt(t,tk)||W0(t,Kd,"fontFamily")||!n?.fontFamily)return e;const o=new I_(e.className);o.add(`has-${VBt(n?.fontFamily)}-font-family`);const r=o.value;return e.className=r||void 0,e}function UBt({name:e,fontFamily:t}){return _3e({},e,{fontFamily:t})}const k3e={useBlockProps:UBt,addSaveProps:_3e,attributeKeys:["fontFamily"],hasSupport(e){return Tt(e,tk)}};Bn("blocks.registerBlockType","core/fontFamily/addAttribute",HBt);const qm="typography.fontSize";function XBt(e){return Tt(e,qm)&&(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}})),e}function S3e(e,t,n){if(!Tt(t,qm)||W0(t,Kd,"fontSize"))return e;const o=new I_(e.className);o.add(Tx(n.fontSize));const r=o.value;return e.className=r||void 0,e}function GBt({name:e,fontSize:t,style:n}){const[o,r,s]=Un("typography.fontSizes","typography.fluid","layout");if(!Tt(e,qm)||W0(e,Kd,"fontSize")||!t&&!n?.typography?.fontSize)return;let i;if(n?.typography?.fontSize&&(i={style:{fontSize:P_({size:n.typography.fontSize},{typography:{fluid:r},layout:s})}}),t&&(i={style:{fontSize:vyt(o,t,n?.typography?.fontSize).size}}),!!i)return S3e(i,e,{fontSize:t})}const C3e={useBlockProps:GBt,addSaveProps:S3e,attributeKeys:["fontSize","style"],hasSupport(e){return Tt(e,qm)}},KBt={fontSize:[["fontSize"],["style","typography","fontSize"]]};function YBt(e,t,n,o){const r=e.name,s={fontSize:Tt(r,qm)};return z3e(s,KBt,e,t,n,o)}Bn("blocks.registerBlockType","core/font/addAttribute",XBt);Bn("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",YBt);const NO="typography.textAlign",ZBt=[{icon:$3,title:m("Align text left"),align:"left"},{icon:kw,title:m("Align text center"),align:"center"},{icon:V3,title:m("Align text right"),align:"right"}],kte=["left","center","right"],QBt=[];function zI(e){return Array.isArray(e)?kte.filter(t=>e.includes(t)):e===!0?kte:QBt}function JBt({style:e,name:t,setAttributes:n}){const r=WO(t)?.typography?.textAlign,s=Jr();if(!r||s!=="default")return null;const i=zI(An(t,NO));if(!i.length)return null;const c=ZBt.filter(u=>i.includes(u.align)),l=u=>{const d={...e,typography:{...e?.typography,textAlign:u}};n({style:Ii(d)})};return a.jsx(bt,{group:"block",children:a.jsx(nr,{value:e?.typography?.textAlign,onChange:l,alignmentControls:c})})}const OI={edit:JBt,useBlockProps:eLt,addSaveProps:tLt,attributeKeys:["style"],hasSupport(e){return Tt(e,NO,!1)}};function eLt({name:e,style:t}){if(!t?.typography?.textAlign||!zI(An(e,NO)).length||W0(e,Kd,"textAlign"))return null;const o=t.typography.textAlign;return{className:oe({[`has-text-align-${o}`]:o})}}function tLt(e,t,n){if(!n?.style?.typography?.textAlign)return e;const{textAlign:o}=n.style.typography,r=An(t,NO);return zI(r).includes(o)&&!W0(t,Kd,"textAlign")&&(e.className=oe(`has-text-align-${o}`,e.className)),e}function Ste(e,t){return Object.fromEntries(Object.entries(e).filter(([n])=>!t.includes(n)))}const nLt="typography.__experimentalLetterSpacing",oLt="typography.__experimentalTextTransform",rLt="typography.__experimentalTextDecoration",sLt="typography.textColumns",iLt="typography.__experimentalFontStyle",aLt="typography.__experimentalFontWeight",cLt="typography.__experimentalWritingMode",Kd="typography",lLt=[$Bt,qm,iLt,aLt,tk,NO,sLt,rLt,cLt,oLt,nLt];function q3e(e){const t={...Ste(e,["fontFamily"])},n=e?.typography?.fontSize,o=e?.typography?.fontFamily,r=n?.startsWith("var:preset|font-size|")?n.substring(21):void 0,s=o?.startsWith("var:preset|font-family|")?o.substring(23):void 0;return t.typography={...Ste(t.typography,["fontFamily"]),fontSize:r?void 0:n},{style:Ii(t),fontFamily:s,fontSize:r}}function R3e(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 uLt({children:e,resetAllFilter:t}){const n=x.useCallback(o=>{const r=R3e(o),s=t(r);return{...o,...q3e(s)}},[t]);return a.jsx(et,{group:"typography",resetAllFilter:n,children:e})}function dLt({clientId:e,name:t,setAttributes:n,settings:o}){function r(f){const{style:b,fontFamily:h,fontSize:g}=f(J).getBlockAttributes(e)||{};return{style:b,fontFamily:h,fontSize:g}}const{style:s,fontFamily:i,fontSize:c}=G(r,[e]),l=AMe(o),u=x.useMemo(()=>R3e({style:s,fontFamily:i,fontSize:c}),[s,c,i]),d=f=>{n(q3e(f))};if(!l)return null;const p=An(t,[Kd,"__experimentalDefaultControls"]);return a.jsx(EMe,{as:uLt,panelId:e,settings:o,value:u,onChange:d,defaultControls:p})}function T3e({clientId:e,value:t,computeStyle:n,forceShow:o}){const r=Wi(e),[s,i]=x.useReducer(()=>n(r));x.useLayoutEffect(()=>{r&&window.requestAnimationFrame(()=>window.requestAnimationFrame(i))},[r,t]);const c=x.useRef(t),[l,u]=x.useState(!1);return x.useEffect(()=>{if(ds(t,c.current)||o)return;u(!0),c.current=t;const d=setTimeout(()=>{u(!1)},400);return()=>{u(!1),clearTimeout(d)}},[t,o]),!l&&!o?null:a.jsx(wm,{clientId:e,__unstablePopoverSlot:"block-toolbar",children:a.jsx("div",{className:"block-editor__spacing-visualizer",style:s})})}function sd(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function pLt({clientId:e,value:t,forceShow:n}){return a.jsx(T3e,{clientId:e,value:t?.spacing?.margin,computeStyle:o=>{const r=sd(o,"margin-top"),s=sd(o,"margin-right"),i=sd(o,"margin-bottom"),c=sd(o,"margin-left");return{borderTopWidth:r,borderRightWidth:s,borderBottomWidth:i,borderLeftWidth:c,top:r?`-${r}`:0,right:s?`-${s}`:0,bottom:i?`-${i}`:0,left:c?`-${c}`:0}},forceShow:n})}function fLt({clientId:e,value:t,forceShow:n}){return a.jsx(T3e,{clientId:e,value:t?.spacing?.padding,computeStyle:o=>({borderTopWidth:sd(o,"padding-top"),borderRightWidth:sd(o,"padding-right"),borderBottomWidth:sd(o,"padding-bottom"),borderLeftWidth:sd(o,"padding-left")}),forceShow:n})}const Fl="dimensions",Zx="spacing";function bLt(){const[e,t]=x.useState(!1),{hideBlockInterface:n,showBlockInterface:o}=ct(Oe(J));return x.useEffect(()=>{e?n():o()},[e,o,n]),[e,t]}function hLt({children:e,resetAllFilter:t}){const n=x.useCallback(o=>{const r=o.style,s=t(r);return{...o,style:s}},[t]);return a.jsx(et,{group:"dimensions",resetAllFilter:n,children:e})}function mLt({clientId:e,name:t,setAttributes:n,settings:o}){const r=BMe(o),s=G(f=>f(J).getBlockAttributes(e)?.style,[e]),[i,c]=bLt(),l=f=>{n({style:Ii(f)})};if(!r)return null;const u=An(t,[Fl,"__experimentalDefaultControls"]),d=An(t,[Zx,"__experimentalDefaultControls"]),p={...u,...d};return a.jsxs(a.Fragment,{children:[a.jsx(HMe,{as:hLt,panelId:e,settings:o,value:s,onChange:l,defaultControls:p,onVisualize:c}),!!o?.spacing?.padding&&a.jsx(fLt,{forceShow:i==="padding",clientId:e,value:s}),!!o?.spacing?.margin&&a.jsx(pLt,{forceShow:i==="margin",clientId:e,value:s})]})}function E3e(e,t="any"){const n=An(e,Fl);return n===!0?!0:t==="any"?!!(n?.aspectRatio||n?.minHeight):!!n?.[t]}const gLt={useBlockProps:MLt,attributeKeys:["minHeight","style"],hasSupport(e){return E3e(e,"aspectRatio")}};function MLt({name:e,minHeight:t,style:n}){if(!E3e(e,"aspectRatio")||W0(e,Fl,"aspectRatio"))return{};const o=oe({"has-aspect-ratio":!!n?.dimensions?.aspectRatio}),r={};return n?.dimensions?.aspectRatio?r.minHeight="unset":(t||n?.dimensions?.minHeight)&&(r.aspectRatio="unset"),{className:o,style:r}}const zLt=[...lLt,Sm,Q0,Fl,Sh,Zx,Kx],yI=e=>zLt.some(t=>Tt(e,t));function Rm(e={}){const t={};return O_(e).forEach(n=>{t[n.key]=n.value}),t}function OLt(e){return yI(e)&&(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}})),e}const W3e={[`${Sm}.__experimentalSkipSerialization`]:["border"],[`${Q0}.__experimentalSkipSerialization`]:[Q0],[`${Kd}.__experimentalSkipSerialization`]:[Kd],[`${Fl}.__experimentalSkipSerialization`]:[Fl],[`${Zx}.__experimentalSkipSerialization`]:[Zx],[`${Kx}.__experimentalSkipSerialization`]:[Kx]},yLt={...W3e,[`${Fl}.aspectRatio`]:[`${Fl}.aspectRatio`],[`${Sh}`]:[Sh]},ALt={[`${Fl}.aspectRatio`]:!0,[`${Sh}`]:!0},vLt={gradients:"gradient"};function KW(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(r=>{if(Array.isArray(r)||(r=r.split(".")),r.length>1){const[s,...i]=r;KW(o[s],[i],!0)}else r.length===1&&delete o[r[0]]}),o}function N3e(e,t,n,o=yLt){if(!yI(t))return e;let{style:r}=n;return Object.entries(o).forEach(([s,i])=>{const c=ALt[s]||An(t,s);c===!0&&(r=KW(r,i)),Array.isArray(c)&&c.forEach(l=>{const u=vLt[l]||l;r=KW(r,[[...i,u]])})}),e.style={...Rm(r),...e.style},e}function xLt({clientId:e,name:t,setAttributes:n,__unstableParentLayout:o}){const r=WO(t,o),s=Jr(),i={clientId:e,name:t,setAttributes:n,settings:{...r,typography:{...r.typography,textAlign:!1}}};return s!=="default"?null:a.jsxs(a.Fragment,{children:[a.jsx(jBt,{...i}),a.jsx(ZRt,{...i}),a.jsx(dLt,{...i}),a.jsx(eEt,{...i}),a.jsx(mLt,{...i})]})}const AI={edit:xLt,hasSupport:yI,addSaveProps:N3e,attributeKeys:["style"],useBlockProps:kLt},wLt=[{elementType:"button"},{elementType:"link",pseudo:[":hover"]},{elementType:"heading",elements:["h1","h2","h3","h4","h5","h6"]}],_Lt={};function kLt({name:e,style:t}){const n=vt(_Lt,"wp-elements"),o=`.${n}`,r=t?.elements,s=x.useMemo(()=>{if(!r)return;const i=[];return wLt.forEach(({elementType:c,pseudo:l,elements:u})=>{if(W0(e,Q0,c))return;const p=r?.[c];if(p){const f=Ws(o,Za[c]);i.push(rq(p,{selector:f})),l&&l.forEach(b=>{p[b]&&i.push(rq(p[b],{selector:Ws(o,`${Za[c]}${b}`)}))})}u&&u.forEach(f=>{r[f]&&i.push(rq(r[f],{selector:Ws(o,Za[f])}))})}),i.length>0?i.join(""):void 0},[o,r,e]);return EO({css:s}),N3e({className:n},e,{style:t},W3e)}Bn("blocks.registerBlockType","core/style/addAttribute",OLt);const SLt=e=>Tt(e,"__experimentalSettings",!1);function CLt(e){return SLt(e)&&(e?.attributes?.settings||(e.attributes={...e.attributes,settings:{type:"object"}})),e}Bn("blocks.registerBlockType","core/settings/addAttribute",CLt);const aT=[],qLt=window?.navigator.userAgent&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&!window.navigator.userAgent.includes("Chromium");Xs([Gs]);function YW({presetSetting:e,defaultSetting:t}){const[n,o,r,s]=Un(t,`${e}.custom`,`${e}.theme`,`${e}.default`);return x.useMemo(()=>[...o||aT,...r||aT,...n&&s||aT],[n,o,r,s])}function B3e(e,t){if(!e)return;const n=t?.find(({slug:o})=>e===`var:preset|duotone|${o}`);return n?n.colors:void 0}function RLt(e,t){if(!e||!Array.isArray(e))return;const n=t?.find(o=>o?.colors?.every((r,s)=>r===e[s]));return n?`var:preset|duotone|${n.slug}`:void 0}function TLt({style:e,setAttributes:t,name:n}){const o=e?.color?.duotone,r=WO(n),s=Jr(),i=YW({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),c=YW({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),[l,u]=Un("color.custom","color.customDuotone"),d=!l,p=!u||c?.length===0&&d;if(i?.length===0&&p||s!=="default")return null;const f=Array.isArray(o)?o:B3e(o,i);return a.jsxs(a.Fragment,{children:[a.jsx(et,{group:"filter",children:a.jsx(zze,{value:{filter:{duotone:f}},onChange:b=>{const h={...e,color:{...b?.filter}};t({style:h})},settings:r})}),a.jsx(bt,{group:"block",__experimentalShareWithChildBlocks:!0,children:a.jsx(Vze,{duotonePalette:i,colorPalette:c,disableCustomDuotone:p,disableCustomColors:d,value:f,onChange:b=>{const h=RLt(b,i),g={...e,color:{...e?.color,duotone:h??b}};t({style:g})},settings:r})})]})}const L3e={shareWithChildBlocks:!0,edit:TLt,useBlockProps:BLt,attributeKeys:["style"],hasSupport(e){return Tt(e,"filter.duotone")}};function ELt(e){return Tt(e,"filter.duotone")&&(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}})),e}function WLt({clientId:e,id:t,selector:n,attribute:o}){const r=YW({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),s=Array.isArray(o),i=s?void 0:B3e(o,r),c=typeof o=="string"&&i,l=typeof o=="string"&&!c;let u=null;c?u=i:(l||s)&&(u=o);const f=n.split(",").map(g=>`.${t}${g.trim()}`).join(", "),b=Array.isArray(u)||u==="unset";Jz(b?{css:u!=="unset"?sRt(f,t):rRt(f),__unstableType:"presets"}:void 0),Jz(b?{assets:u!=="unset"?nI(t,u):"",__unstableType:"svgs"}:void 0);const h=Wi(e);x.useEffect(()=>{if(b&&h&&qLt){const g=h.style.display;h.style.setProperty("display","inline-block"),h.offsetHeight,h.style.setProperty("display",g)}},[b,h,u])}const NLt={};function BLt({clientId:e,name:t,style:n}){const o=vt(NLt),r=x.useMemo(()=>{const l=on(t);if(l){if(!An(l,"filter.duotone",!1))return null;const d=An(l,"color.__experimentalDuotone",!1);if(d){const p=pd(l);return typeof d=="string"?Ws(p,d):p}return pd(l,"filter.duotone",{fallback:!0})}},[t]),s=n?.color?.duotone,i=`wp-duotone-${o}`,c=r&&s;return WLt({clientId:e,id:i,selector:r,attribute:s}),{className:c?i:""}}Bn("blocks.registerBlockType","core/editor/duotone/add-attributes",ELt);const vI="layout",{kebabCase:ZW}=ct(tr);function xI(e){return Tt(e,"layout")||Tt(e,"__experimentalLayout")}function P3e(e={},t=""){const{layout:n}=e,{default:o}=An(t,vI)||{},r=n?.inherit||n?.contentSize||n?.wideSize?{...n,type:"constrained"}:n||o||{},s=[];if(Dd[r?.type||"default"]?.className){const c=Dd[r?.type||"default"]?.className,l=t.split("/"),d=`wp-block-${l[0]==="core"?l.pop():l.join("-")}-${c}`;s.push(c,d)}return G(c=>(r?.inherit||r?.contentSize||r?.type==="constrained")&&c(J).getSettings().__experimentalFeatures?.useRootPaddingAwareAlignments,[r?.contentSize,r?.inherit,r?.type])&&s.push("has-global-padding"),r?.orientation&&s.push(`is-${ZW(r.orientation)}`),r?.justifyContent&&s.push(`is-content-justification-${ZW(r.justifyContent)}`),r?.flexWrap&&r.flexWrap==="nowrap"&&s.push("is-nowrap"),s}function LLt(e={},t,n){const{layout:o={},style:r={}}=e,s=o?.inherit||o?.contentSize||o?.wideSize?{...o,type:"constrained"}:o||{},i=Rf(s?.type||"default"),[c]=Un("spacing.blockGap"),l=c!==null;return i?.getLayoutStyle?.({blockName:t,selector:n,layout:o,style:r,hasBlockGapSupport:l})}function PLt({layout:e,setAttributes:t,name:n,clientId:o}){const r=WO(n),{layout:s}=r,{themeSupportsLayout:i}=G(B=>{const{getSettings:N}=B(J);return{themeSupportsLayout:N().supportsLayout}},[]);if(Jr()!=="default")return null;const l=An(n,vI,{}),u={...s,...l},{allowSwitching:d,allowEditing:p=!0,allowInheriting:f=!0,default:b}=u;if(!p)return null;const h={...l,...e},{type:g,default:{type:z="default"}={}}=h,A=g||z,_=!!(f&&(!A||A==="default"||A==="constrained"||h.inherit)),v=e||b||{},{inherit:M=!1,contentSize:y=null}=v;if((A==="default"||A==="constrained")&&!i)return null;const k=Rf(A),S=Rf("constrained"),C=!v.type&&(y||M),R=!!M||!!y,T=B=>t({layout:{type:B}}),E=B=>t({layout:B});return a.jsxs(a.Fragment,{children:[a.jsx(et,{children:a.jsxs(Qt,{title:m("Layout"),children:[_&&a.jsx(a.Fragment,{children:a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Inner blocks use content width"),checked:k?.name==="constrained"||R,onChange:()=>t({layout:{type:k?.name==="constrained"||R?"default":"constrained"}}),help:k?.name==="constrained"||R?m("Nested blocks use content width with options for full and wide widths."):m("Nested blocks will fill the width of this container. Toggle to constrain.")})}),!M&&d&&a.jsx(ILt,{type:A,onChange:T}),k&&k.name!=="default"&&a.jsx(k.inspectorControls,{layout:v,onChange:E,layoutBlockSupport:u,name:n,clientId:o}),S&&C&&a.jsx(S.inspectorControls,{layout:v,onChange:E,layoutBlockSupport:u,name:n,clientId:o})]})}),!M&&k&&a.jsx(k.toolBarControls,{layout:v,onChange:E,layoutBlockSupport:l,name:n,clientId:o})]})}const jLt={shareWithChildBlocks:!0,edit:PLt,attributeKeys:["layout"],hasSupport(e){return xI(e)}};function ILt({type:e,onChange:t}){return a.jsx(Do,{__next40pxDefaultSize:!0,isBlock:!0,label:m("Layout type"),__nextHasNoMarginBottom:!0,hideLabelFromVision:!0,isAdaptiveWidth:!0,value:e,onChange:t,children:mvt().map(({name:n,label:o})=>a.jsx(Kn,{value:n,label:o},n))})}function DLt(e){var t;return"type"in((t=e.attributes?.layout)!==null&&t!==void 0?t:{})||xI(e)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e}function FLt({block:e,props:t,blockGapSupport:n,layoutClasses:o}){const{name:r,attributes:s}=t,i=vt(e),{layout:c}=s,{default:l}=An(r,vI)||{},u=c?.inherit||c?.contentSize||c?.wideSize?{...c,type:"constrained"}:c||l||{},d=`wp-container-${ZW(r)}-is-layout-`,p=`.${d}${i}`,f=n!==null,h=Rf(u?.type||"default")?.getLayoutStyle?.({blockName:r,selector:p,layout:u,style:s?.style,hasBlockGapSupport:f}),g=oe({[`${d}${i}`]:!!h},o);return EO({css:h}),a.jsx(e,{...t,__unstableLayoutClassNames:g})}const $Lt=Or(e=>t=>{const{clientId:n,name:o,attributes:r}=t,s=xI(o),i=P3e(r,o),c=G(l=>{if(!s)return;const{getSettings:u,getBlockSettings:d}=ct(l(J)),{disableLayoutStyles:p}=u();if(p)return;const[f]=d(n,"spacing.blockGap");return{blockGapSupport:f}},[s,n]);return c?a.jsx(FLt,{block:e,props:t,layoutClasses:i,...c}):a.jsx(e,{...t,__unstableLayoutClassNames:s?i:void 0})},"withLayoutStyles");Bn("blocks.registerBlockType","core/layout/addAttribute",DLt);Bn("editor.BlockListBlock","core/editor/layout/with-layout-styles",$Lt);function Cte(e,t){return Array.from({length:t},(n,o)=>e+o)}class bd{constructor({columnStart:t,rowStart:n,columnEnd:o,rowEnd:r,columnSpan:s,rowSpan:i}={}){this.columnStart=t??1,this.rowStart=n??1,s!==void 0?this.columnEnd=this.columnStart+s-1:this.columnEnd=o??this.columnStart,i!==void 0?this.rowEnd=this.rowStart+i-1:this.rowEnd=r??this.rowStart}get columnSpan(){return this.columnEnd-this.columnStart+1}get rowSpan(){return this.rowEnd-this.rowStart+1}contains(t,n){return t>=this.columnStart&&t<=this.columnEnd&&n>=this.rowStart&&n<=this.rowEnd}containsRect(t){return this.contains(t.columnStart,t.rowStart)&&this.contains(t.columnEnd,t.rowEnd)}intersectsRect(t){return this.columnStart<=t.columnEnd&&this.columnEnd>=t.columnStart&&this.rowStart<=t.rowEnd&&this.rowEnd>=t.rowStart}}function d1(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function qte(e,t){const n=[];for(const o of e.split(" ")){const r=n[n.length-1],s=r?r.end+t:0,i=s+parseFloat(o);n.push({start:s,end:i})}return n}function yv(e,t,n="start"){return e.reduce((o,r,s)=>Math.abs(r[n]-t)i(J).getSettings().isDistractionFree,[]),r=Wi(e);if(o||!r)return null;const s=n?.isManualPlacement&&window.__experimentalEnableGridInteractivity;return a.jsx(VLt,{gridClientId:e,gridElement:r,isManualGrid:s,ref:t})}const VLt=x.forwardRef(({gridClientId:e,gridElement:t,isManualGrid:n},o)=>{const[r,s]=x.useState(()=>cT(t)),[i,c]=x.useState(!1);return x.useEffect(()=>{const l=[];for(const d of[t,...t.children]){const p=new window.ResizeObserver(()=>{s(cT(t))});p.observe(d),l.push(p)}const u=new window.MutationObserver(()=>{s(cT(t))});return u.observe(t,{attributeFilter:["style","class"],childList:!0,subtree:!0}),l.push(u),()=>{for(const d of l)d.disconnect()}},[t]),x.useEffect(()=>{function l(){c(!0)}function u(){c(!1)}return document.addEventListener("drag",l),document.addEventListener("dragend",u),()=>{document.removeEventListener("drag",l),document.removeEventListener("dragend",u)}},[]),a.jsx(wm,{className:oe("block-editor-grid-visualizer",{"is-dropping-allowed":i}),clientId:e,__unstablePopoverSlot:"__unstable-block-tools-after",children:a.jsx("div",{ref:o,className:"block-editor-grid-visualizer__grid",style:r.style,children:n?a.jsx(HLt,{gridClientId:e,gridInfo:r}):Array.from({length:r.numItems},(l,u)=>a.jsx(I3e,{color:r.currentColor},u))})})});function HLt({gridClientId:e,gridInfo:t}){const[n,o]=x.useState(null),r=G(i=>{const{getBlockOrder:c,getBlockStyles:l}=ct(i(J)),u=c(e);return l(u)},[e]),s=x.useMemo(()=>{const i=[];for(const l of Object.values(r)){var c;const{columnStart:u,rowStart:d,columnSpan:p=1,rowSpan:f=1}=(c=l?.layout)!==null&&c!==void 0?c:{};!u||!d||i.push(new bd({columnStart:u,rowStart:d,columnSpan:p,rowSpan:f}))}return i},[r]);return Cte(1,t.numRows).map(i=>Cte(1,t.numColumns).map(c=>{var l;const u=s.some(p=>p.contains(c,i)),d=(l=n?.contains(c,i))!==null&&l!==void 0?l:!1;return a.jsx(I3e,{color:t.currentColor,className:d&&"is-highlighted",children:u?a.jsx(ULt,{column:c,row:i,gridClientId:e,gridInfo:t,setHighlightedRect:o}):a.jsx(XLt,{column:c,row:i,gridClientId:e,gridInfo:t,setHighlightedRect:o})},`${i}-${c}`)}))}function I3e({color:e,children:t,className:n}){return a.jsx("div",{className:oe("block-editor-grid-visualizer__cell",n),style:{boxShadow:`inset 0 0 0 1px color-mix(in srgb, ${e} 20%, #0000)`,color:e},children:t})}function D3e(e,t,n,o,r){const{getBlockAttributes:s,getBlockRootClientId:i,canInsertBlockType:c,getBlockName:l}=G(J),{updateBlockAttributes:u,moveBlocksToPosition:d,__unstableMarkNextChangeAsNotPersistent:p}=Oe(J),f=U_(n,o.numColumns);return GLt({validateDrag(b){const h=l(b);if(!c(h,n))return!1;const g=s(b),z=new bd({columnStart:e,rowStart:t,columnSpan:g.style?.layout?.columnSpan,rowSpan:g.style?.layout?.rowSpan});return new bd({columnSpan:o.numColumns,rowSpan:o.numRows}).containsRect(z)},onDragEnter(b){const h=s(b);r(new bd({columnStart:e,rowStart:t,columnSpan:h.style?.layout?.columnSpan,rowSpan:h.style?.layout?.rowSpan}))},onDragLeave(){r(b=>b?.columnStart===e&&b?.rowStart===t?null:b)},onDrop(b){r(null);const h=s(b);u(b,{style:{...h.style,layout:{...h.style?.layout,columnStart:e,rowStart:t}}}),p(),d([b],i(b),n,f(e,t))}})}function ULt({column:e,row:t,gridClientId:n,gridInfo:o,setHighlightedRect:r}){return a.jsx("div",{className:"block-editor-grid-visualizer__drop-zone",ref:D3e(e,t,n,o,r)})}function XLt({column:e,row:t,gridClientId:n,gridInfo:o,setHighlightedRect:r}){const{updateBlockAttributes:s,moveBlocksToPosition:i,__unstableMarkNextChangeAsNotPersistent:c}=Oe(J),l=U_(n,o.numColumns);return a.jsx(N_,{rootClientId:n,className:"block-editor-grid-visualizer__appender",ref:D3e(e,t,n,o,r),style:{color:o.currentColor},onSelect:u=>{u&&(s(u.clientId,{style:{layout:{columnStart:e,rowStart:t}}}),c(),i([u.clientId],n,n,l(e,t)))}})}function GLt({validateDrag:e,onDragEnter:t,onDragLeave:n,onDrop:o}){const{getDraggedBlockClientIds:r}=G(J);return k5({onDragEnter(){const[s]=r();s&&e(s)&&t(s)},onDragLeave(){n()},onDrop(){const[s]=r();s&&e(s)&&o(s)}})}function KLt({clientId:e,bounds:t,onChange:n,parentLayout:o}){const r=Wi(e),s=r?.parentElement,{isManualPlacement:i}=o;return!r||!s?null:a.jsx(YLt,{clientId:e,bounds:t,blockElement:r,rootBlockElement:s,onChange:n,isManualGrid:i&&window.__experimentalEnableGridInteractivity})}function YLt({clientId:e,bounds:t,blockElement:n,rootBlockElement:o,onChange:r,isManualGrid:s}){const[i,c]=x.useState(null),[l,u]=x.useState({top:!1,bottom:!1,left:!1,right:!1});x.useEffect(()=>{const b=new window.ResizeObserver(()=>{const h=n.getBoundingClientRect(),g=o.getBoundingClientRect();u({top:h.top>g.top,bottom:h.bottomg.left,right:h.rightb.disconnect()},[n,o]);const d={right:"left",left:"right"},p={top:"flex-end",bottom:"flex-start"},f={display:"flex",justifyContent:"center",alignItems:"center",...d[i]&&{justifyContent:d[i]},...p[i]&&{alignItems:p[i]}};return a.jsx(wm,{className:"block-editor-grid-item-resizer",clientId:e,__unstablePopoverSlot:"__unstable-block-tools-after",additionalStyles:f,children:a.jsx(Ca,{className:"block-editor-grid-item-resizer__box",size:{width:"100%",height:"100%"},enable:{bottom:l.bottom,bottomLeft:!1,bottomRight:!1,left:l.left,right:l.right,top:l.top,topLeft:!1,topRight:!1},bounds:t,boundsByDirection:!0,onPointerDown:({target:b,pointerId:h})=>{b.setPointerCapture(h)},onResizeStart:(b,h)=>{c(h)},onResizeStop:(b,h,g)=>{const z=parseFloat(d1(o,"column-gap")),A=parseFloat(d1(o,"row-gap")),_=qte(d1(o,"grid-template-columns"),z),v=qte(d1(o,"grid-template-rows"),A),M=new window.DOMRect(n.offsetLeft+g.offsetLeft,n.offsetTop+g.offsetTop,g.offsetWidth,g.offsetHeight),y=yv(_,M.left)+1,k=yv(v,M.top)+1,S=yv(_,M.right,"end")+1,C=yv(v,M.bottom,"end")+1;r({columnSpan:S-y+1,rowSpan:C-k+1,columnStart:s?y:void 0,rowStart:s?k:void 0})}})})}function ZLt({layout:e,parentLayout:t,onChange:n,gridClientId:o,blockClientId:r}){var s,i,c,l;const{moveBlocksToPosition:u,__unstableMarkNextChangeAsNotPersistent:d}=Oe(J),p=(s=e?.columnStart)!==null&&s!==void 0?s:1,f=(i=e?.rowStart)!==null&&i!==void 0?i:1,b=(c=e?.columnSpan)!==null&&c!==void 0?c:1,h=(l=e?.rowSpan)!==null&&l!==void 0?l:1,g=p+b-1,z=f+h-1,A=t?.columnCount,_=t?.rowCount,v=U_(o,A);return a.jsx(bt,{group:"parent",children:a.jsxs(Wn,{className:"block-editor-grid-item-mover__move-button-container",children:[a.jsx("div",{className:"block-editor-grid-item-mover__move-horizontal-button-container is-left",children:a.jsx(fM,{icon:jt()?ma:Ll,label:m("Move left"),description:m("Move left"),isDisabled:p<=1,onClick:()=>{n({columnStart:p-1}),d(),u([r],o,o,v(p-1,f))}})}),a.jsxs("div",{className:"block-editor-grid-item-mover__move-vertical-button-container",children:[a.jsx(fM,{className:"is-up-button",icon:Rw,label:m("Move up"),description:m("Move up"),isDisabled:f<=1,onClick:()=>{n({rowStart:f-1}),d(),u([r],o,o,v(p,f-1))}}),a.jsx(fM,{className:"is-down-button",icon:tu,label:m("Move down"),description:m("Move down"),isDisabled:_&&z>=_,onClick:()=>{n({rowStart:f+1}),d(),u([r],o,o,v(p,f+1))}})]}),a.jsx("div",{className:"block-editor-grid-item-mover__move-horizontal-button-container is-right",children:a.jsx(fM,{icon:jt()?Ll:ma,label:m("Move right"),description:m("Move right"),isDisabled:A&&g>=A,onClick:()=>{n({columnStart:p+1}),d(),u([r],o,o,v(p+1,f))}})})]})})}function fM({className:e,icon:t,label:n,isDisabled:o,onClick:r,description:s}){const c=`block-editor-grid-item-mover-button__description-${vt(fM)}`;return a.jsxs(a.Fragment,{children:[a.jsx(Vt,{className:oe("block-editor-grid-item-mover-button",e),icon:t,label:n,"aria-describedby":c,onClick:o?null:r,disabled:o,accessibleWhenDisabled:!0}),a.jsx(qn,{id:c,children:s})]})}function QLt({clientId:e}){const{gridLayout:t,blockOrder:n,selectedBlockLayout:o}=G(f=>{var b;const{getBlockAttributes:h,getBlockOrder:g}=f(J),z=f(J).getSelectedBlock();return{gridLayout:(b=h(e).layout)!==null&&b!==void 0?b:{},blockOrder:g(e),selectedBlockLayout:z?.attributes.style?.layout}},[e]),{getBlockAttributes:r,getBlockRootClientId:s}=G(J),{updateBlockAttributes:i,__unstableMarkNextChangeAsNotPersistent:c}=Oe(J),l=x.useMemo(()=>o?new bd(o):null,[o]),u=Fr(l),d=Fr(t.isManualPlacement),p=Fr(n);x.useEffect(()=>{const f={};if(t.isManualPlacement){const A=[];for(const v of n){var b;const{columnStart:M,rowStart:y,columnSpan:k=1,rowSpan:S=1}=(b=r(v).style?.layout)!==null&&b!==void 0?b:{};!M||!y||A.push(new bd({columnStart:M,rowStart:y,columnSpan:k,rowSpan:S}))}for(const v of n){var h;const M=r(v),{columnStart:y,rowStart:k,columnSpan:S=1,rowSpan:C=1}=(h=M.style?.layout)!==null&&h!==void 0?h:{};if(y&&k)continue;const[R,T]=JLt(A,t.columnCount,S,C,u?.columnEnd,u?.rowEnd);A.push(new bd({columnStart:R,rowStart:T,columnSpan:S,rowSpan:C})),f[v]={style:{...M.style,layout:{...M.style?.layout,columnStart:R,rowStart:T}}}}const _=Math.max(...A.map(v=>v.rowEnd));(!t.rowCount||t.rowCount<_)&&(f[e]={layout:{...t,rowCount:_}});for(const v of p??[])if(!n.includes(v)){var g;const M=s(v);if(M===null||r(M)?.layout?.type==="grid")continue;const k=r(v),{columnStart:S,rowStart:C,columnSpan:R,rowSpan:T,...E}=(g=k.style?.layout)!==null&&g!==void 0?g:{};if(S||C||R||T){const B=Object.keys(E).length===0;f[v]=gn(k,["style","layout"],B?void 0:E)}}}else{if(d===!0)for(const A of n){var z;const _=r(A),{columnStart:v,rowStart:M,...y}=(z=_.style?.layout)!==null&&z!==void 0?z:{};if(v||M){const k=Object.keys(y).length===0;f[A]=gn(_,["style","layout"],k?void 0:y)}}t.rowCount&&(f[e]={layout:{...t,rowCount:void 0}})}Object.keys(f).length&&(c(),i(Object.keys(f),f,!0))},[e,t,p,n,u,d,c,r,s,i])}function JLt(e,t,n,o,r=1,s=1){for(let i=s;;i++)for(let c=i===s?r:1;c<=t;c++){const l=new bd({columnStart:c,rowStart:i,columnSpan:n,rowSpan:o});if(!e.some(u=>u.intersectsRect(l)))return[c,i]}}const ePt={};function tPt({style:e}){var t;const n=G(z=>!z(J).getSettings().disableLayoutStyles),o=(t=e?.layout)!==null&&t!==void 0?t:{},{selfStretch:r,flexSize:s,columnStart:i,rowStart:c,columnSpan:l,rowSpan:u}=o,d=y_()||{},{columnCount:p,minimumColumnWidth:f}=d,b=vt(ePt),h=`.wp-container-content-${b}`;let g="";if(n&&(r==="fixed"&&s?g=`${h} { flex-basis: ${s}; box-sizing: border-box; }`:r==="fill"?g=`${h} { @@ -722,7 +722,7 @@ The screen with id ${t.id} will not be added.`),e):[...e,t]}function Bbt({screen grid-column: ${k}; grid-row: auto; } - }`}if(EO({css:g}),!!g)return{className:`wp-container-content-${b}`}}function nPt({clientId:e,style:t,setAttributes:n}){const o=y_()||{},{type:r="default",allowSizingOnChildren:s=!1,isManualPlacement:i}=o;return r!=="grid"?null:a.jsx(oPt,{clientId:e,style:t,setAttributes:n,allowSizingOnChildren:s,isManualPlacement:i,parentLayout:o})}function oPt({clientId:e,style:t,setAttributes:n,allowSizingOnChildren:o,isManualPlacement:r,parentLayout:s}){const{rootClientId:i,isVisible:c}=G(p=>{const{getBlockRootClientId:f,getBlockEditingMode:b,getTemplateLock:h}=p(J),g=f(e);return h(g)||b(g)!=="default"?{rootClientId:g,isVisible:!1}:{rootClientId:g,isVisible:!0}},[e]),[l,u]=x.useState();if(!c)return null;function d(p){n({style:{...t,layout:{...t?.layout,...p}}})}return a.jsxs(a.Fragment,{children:[a.jsx(j3e,{clientId:i,contentRef:u,parentLayout:s}),o&&a.jsx(KLt,{clientId:e,bounds:l,onChange:d,parentLayout:s}),r&&window.__experimentalEnableGridInteractivity&&a.jsx(ZLt,{layout:t?.layout,parentLayout:s,onChange:d,gridClientId:i,blockClientId:e})]})}const F3e={useBlockProps:tPt,edit:nPt,attributeKeys:["style"],hasSupport(){return!0}};function rPt({clientId:e}){const{templateLock:t,isLockedByParent:n,isEditingAsBlocks:o}=G(l=>{const{getContentLockingParent:u,getTemplateLock:d,getTemporarilyEditingAsBlocks:p}=ct(l(J));return{templateLock:d(e),isLockedByParent:!!u(e),isEditingAsBlocks:p()===e}},[e]),{stopEditingAsBlocks:r}=ct(Oe(J)),s=!n&&t==="contentOnly",i=x.useCallback(()=>{r(e)},[e,r]);return!s&&!o?null:o&&!s&&a.jsx(bt,{group:"other",children:a.jsx(Vt,{onClick:i,children:m("Done")})})}const sPt={edit:rPt,hasSupport(){return!0}},Rte="metadata";function iPt(e){return e?.attributes?.[Rte]?.type||(e.attributes={...e.attributes,[Rte]:{type:"object"}}),e}Bn("blocks.registerBlockType","core/metadata/addMetaAttribute",iPt);const aPt={};function cPt({name:e,clientId:t,metadata:{ignoredHookedBlocks:n=[]}={}}){const o=G(b=>b(kt).getBlockTypes(),[]),r=x.useMemo(()=>o?.filter(({name:b,blockHooks:h})=>h&&e in h||n.includes(b)),[o,e,n]),s=G(b=>{const{getBlocks:h,getBlockRootClientId:g,getGlobalBlockCount:z}=b(J),A=g(t),_=r.reduce((v,M)=>{if(z(M.name)===0)return v;const y=M?.blockHooks?.[e];let k;switch(y){case"before":case"after":k=h(A);break;case"first_child":case"last_child":k=h(t);break;case void 0:k=[...h(A),...h(t)];break}const S=k?.find(C=>C.name===M.name);return S?{...v,[M.name]:S.clientId}:v},{});return Object.values(_).length>0?_:aPt},[r,e,t]),{getBlockIndex:i,getBlockCount:c,getBlockRootClientId:l}=G(J),{insertBlock:u,removeBlock:d}=Oe(J);if(!r.length)return null;const p=r.reduce((b,h)=>{const[g]=h.name.split("/");return b[g]||(b[g]=[]),b[g].push(h),b},{}),f=(b,h)=>{const g=i(t),z=c(t),A=l(t);switch(h){case"before":case"after":u(b,h==="after"?g+1:g,A,!1);break;case"first_child":case"last_child":u(b,h==="first_child"?0:z,t,!1);break;case void 0:u(b,g+1,A,!1);break}};return a.jsx(et,{children:a.jsxs(Qt,{className:"block-editor-hooks__block-hooks",title:m("Plugins"),initialOpen:!0,children:[a.jsx("p",{className:"block-editor-hooks__block-hooks-helptext",children:m("Manage the inclusion of blocks added automatically by plugins.")}),Object.keys(p).map(b=>a.jsxs(x.Fragment,{children:[a.jsx("h3",{children:b}),p[b].map(h=>{const g=h.name in s;return a.jsx(lt,{__nextHasNoMarginBottom:!0,checked:g,label:h.title,onChange:()=>{if(!g){const z=h.blockHooks[e];f(Ee(h.name),z);return}d(s[h.name],!1)}},h.title)})]},b))]})})}const lPt={edit:cPt,attributeKeys:["metadata"],hasSupport(){return!0}},{Menu:cl}=ct(tr),Tte={},uPt=()=>Yn("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}};function dPt({fieldsList:e,attribute:t,binding:n}){const{clientId:o}=j0(),r=rie(),{updateBlockBindings:s}=p_(),i=n?.args?.key,c=G(l=>{const{name:u}=l(J).getBlock(o),d=on(u).attributes?.[t]?.type;return d==="rich-text"?"string":d},[o,t]);return a.jsx(a.Fragment,{children:Object.entries(e).map(([l,u],d)=>a.jsxs(x.Fragment,{children:[a.jsxs(cl.Group,{children:[Object.keys(e).length>1&&a.jsx(cl.GroupLabel,{children:r[l].label}),Object.entries(u).filter(([,p])=>p?.type===c).map(([p,f])=>a.jsxs(cl.RadioItem,{onChange:()=>s({[t]:{source:l,args:{key:p}}}),name:t+"-binding",value:p,checked:p===i,children:[a.jsx(cl.ItemLabel,{children:f?.label}),a.jsx(cl.ItemHelpText,{children:f?.value})]},p))]}),d!==Object.keys(e).length-1&&a.jsx(cl.Separator,{})]},l))})}function $3e({attribute:e,binding:t,fieldsList:n}){const{source:o,args:r}=t||{},s=vl(o),i=!s;return a.jsxs(dt,{className:"block-editor-bindings__item",spacing:0,children:[a.jsx(Sn,{truncate:!0,children:e}),!!t&&a.jsx(Sn,{truncate:!0,variant:!i&&"muted",isDestructive:i,children:i?m("Invalid source"):n?.[o]?.[r?.key]?.label||s?.label||o})]})}function pPt({bindings:e,fieldsList:t}){return a.jsx(a.Fragment,{children:Object.entries(e).map(([n,o])=>a.jsx(oO,{children:a.jsx($3e,{attribute:n,binding:o,fieldsList:t})},n))})}function fPt({attributes:e,bindings:t,fieldsList:n}){const{updateBlockBindings:o}=p_(),r=Yn("medium","<");return a.jsx(a.Fragment,{children:e.map(s=>{const i=t[s];return a.jsx(tt,{hasValue:()=>!!i,label:s,onDeselect:()=>{o({[s]:void 0})},children:a.jsxs(cl,{placement:r?"bottom-start":"left-start",children:[a.jsx(cl.TriggerButton,{render:a.jsx(oO,{}),children:a.jsx($3e,{attribute:s,binding:i,fieldsList:n})}),a.jsx(cl.Popover,{gutter:r?8:36,children:a.jsx(dPt,{fieldsList:n,attribute:s,binding:i})})]})},s)})})}const bPt=({name:e,metadata:t})=>{const n=x.useContext(Cf),{removeAllBlockBindings:o}=p_(),r=uyt(e),s=uPt(),i={},{fieldsList:c,canUpdateBlockBindings:l}=G(f=>{if(!r||r.length===0)return Tte;const b=rie();return Object.entries(b).forEach(([h,{getFieldsList:g,usesContext:z}])=>{if(g){const A={};if(z?.length)for(const v of z)A[v]=n[v];const _=g({select:f,context:A});Object.keys(_||{}).length&&(i[h]={..._})}}),{fieldsList:Object.values(i).length>0?i:Tte,canUpdateBlockBindings:f(J).getSettings().canUpdateBlockBindings}},[n,r]);if(!r||r.length===0)return null;const{bindings:u}=t||{},d={...u};Object.keys(d).forEach(f=>{(!zW(e,f)||d[f].source==="core/pattern-overrides")&&delete d[f]});const p=!l||!Object.keys(c).length;return p&&Object.keys(d).length===0?null:a.jsx(et,{group:"bindings",children:a.jsxs(En,{label:m("Attributes"),resetAll:()=>{o()},dropdownMenuProps:s,className:"block-editor-bindings__panel",children:[a.jsx(tb,{isBordered:!0,isSeparated:!0,children:p?a.jsx(pPt,{bindings:d,fieldsList:c}):a.jsx(fPt,{attributes:r,bindings:d,fieldsList:c})}),a.jsx(Sn,{as:"div",variant:"muted",children:a.jsx("p",{children:m("Attributes connected to custom fields or other dynamic data.")})})]})})},hPt={edit:bPt,attributeKeys:["metadata"],hasSupport(){return!0}};function mPt(e){return e.__experimentalLabel||Et(e,"renaming",!0)&&(e.__experimentalLabel=(n,{context:o})=>{const{metadata:r}=n;if(o==="list-view"&&r?.name)return r.name}),e}Bn("blocks.registerBlockType","core/metadata/addLabelCallback",mPt);function gPt(e){QLt(e)}function MPt({clientId:e,layout:t}){const n=G(o=>{const{isBlockSelected:r,isDraggingBlocks:s,getTemplateLock:i,getBlockEditingMode:c}=o(J);return!(!s()&&!r(e)||i(e)||c(e)!=="default")},[e]);return a.jsxs(a.Fragment,{children:[a.jsx(gPt,{clientId:e}),n&&a.jsx(j3e,{clientId:e,parentLayout:t})]})}const zPt=Or(e=>t=>t.attributes.layout?.type!=="grid"?a.jsx(e,{...t},"edit"):a.jsxs(a.Fragment,{children:[a.jsx(MPt,{clientId:t.clientId,layout:t.attributes.layout}),a.jsx(e,{...t},"edit")]}),"addGridVisualizerToBlockEdit");Bn("editor.BlockEdit","core/editor/grid-visualizer",zPt);function X1(e){const t=e.style?.border||{};return{className:JMe(e)||void 0,style:Rm({border:t})}}function au(e){const{colors:t}=ub(),n=X1(e),{borderColor:o}=e;if(o){const r=a2({colors:t,namedColor:o});n.style.borderColor=r.color}return n}function db(e){const t=e.style?.shadow||"";return{style:Rm({shadow:t})}}function P1(e){const{backgroundColor:t,textColor:n,gradient:o,style:r}=e,s=Pt("background-color",t),i=Pt("color",n),c=T1(o),l=c||r?.color?.gradient,u=oe(i,c,{[s]:!l&&!!s,"has-text-color":n||r?.color?.text,"has-background":t||r?.color?.background||o||r?.color?.gradient,"has-link-color":r?.elements?.link?.color}),d=r?.color||{},p=Rm({color:d});return{className:u||void 0,style:p}}function BO(e){const{backgroundColor:t,textColor:n,gradient:o}=e,[r,s,i,c,l,u]=Un("color.palette.custom","color.palette.theme","color.palette.default","color.gradients.custom","color.gradients.theme","color.gradients.default"),d=x.useMemo(()=>[...r||[],...s||[],...i||[]],[r,s,i]),p=x.useMemo(()=>[...c||[],...l||[],...u||[]],[c,l,u]),f=P1(e);if(t){const b=Sf(d,t);f.style.backgroundColor=b.color}if(o&&(f.style.background=zhe(p,o)),n){const b=Sf(d,n);f.style.color=b.color}return f}function Tm(e){const{style:t}=e,n=t?.spacing||{};return{style:Rm({spacing:n})}}const{kebabCase:OPt}=ct(tr);function wI(e,t){let n=e?.style?.typography||{};n={...n,fontSize:P_({size:e?.style?.typography?.fontSize},t)};const o=Rm({typography:n}),r=e?.fontFamily?`has-${OPt(e.fontFamily)}-font-family`:"",s=e?.style?.typography?.textAlign?`has-text-align-${e?.style?.typography?.textAlign}`:"";return{className:oe(r,s,Tx(e?.fontSize)),style:o}}aBt([gI,OI,O3e,y3e,AI,L3e,Bge,jLt,sPt,lPt,hPt,F3e].filter(Boolean));uBt([gI,OI,QRt,AI,w3e,gLt,L3e,k3e,C3e,eze,Bge,NEt,F3e]);dBt([gI,OI,O3e,kBt,y3e,eze,w3e,AI,k3e,C3e]);const Ete={button:"wp-element-button",caption:"wp-element-caption"},z0=e=>Ete[e]?Ete[e]:"";function _I(e,t,n){if(e==null||e===!1)return;if(Array.isArray(e))return lT(e,t,n);switch(typeof e){case"string":case"number":return}const{type:o,props:r}=e;switch(o){case x.StrictMode:case x.Fragment:return lT(r.children,t,n);case i0:return;case Ht.Content:return V3e(t,n);case fI:t.push(r.value);return}switch(typeof o){case"string":return typeof r.children<"u"?lT(r.children,t,n):void 0;case"function":const s=o.prototype&&typeof o.prototype.render=="function"?new o(r).render():o(r);return _I(s,t,n)}}function lT(e,...t){e=Array.isArray(e)?e:[e];for(let n=0;nn instanceof Xo?n:Xo.fromHTMLString(n))}function APt({clientId:e,resizableBoxProps:t,...n}){return a.jsx(wm,{clientId:e,__unstablePopoverSlot:"block-toolbar",...n,children:a.jsx(Ca,{...t})})}function vPt({blockTypes:e,value:t,onItemChange:n}){return a.jsx("ul",{className:"block-editor-block-manager__checklist",children:e.map(o=>a.jsxs("li",{className:"block-editor-block-manager__checklist-item",children:[a.jsx(K0,{__nextHasNoMarginBottom:!0,label:o.title,checked:t.includes(o.name),onChange:(...r)=>n(o,...r)}),a.jsx(Zn,{icon:o.icon})]},o.name))})}function QW({title:e,blockTypes:t,selectedBlockTypes:n,onChange:o}){const r=vt(QW),s=x.useCallback((p,f)=>{o(f?[...n,p]:n.filter(({name:b})=>b!==p.name))},[n,o]),i=x.useCallback(p=>{o(p?[...n,...t.filter(f=>!n.find(({name:b})=>b===f.name))]:n.filter(f=>!t.find(({name:b})=>b===f.name)))},[t,n,o]);if(!t.length)return null;const c=t.map(({name:p})=>p).filter(p=>(n??[]).some(f=>f.name===p)),l="block-editor-block-manager__category-title-"+r,u=c.length===t.length,d=!u&&c.length>0;return a.jsxs("div",{role:"group","aria-labelledby":l,className:"block-editor-block-manager__category",children:[a.jsx(K0,{__nextHasNoMarginBottom:!0,checked:u,onChange:i,className:"block-editor-block-manager__category-title",indeterminate:d,label:a.jsx("span",{id:l,children:e})}),a.jsx(vPt,{blockTypes:t,value:c,onItemChange:s})]})}function xPt({blockTypes:e,selectedBlockTypes:t,onChange:n}){const o=q1(Yt,500),[r,s]=x.useState(""),{categories:i,isMatchingSearchTerm:c}=G(p=>({categories:p(kt).getCategories(),isMatchingSearchTerm:p(kt).isMatchingSearchTerm}),[]);function l(){n(e)}const u=e.filter(p=>!r||c(p,r)),d=e.length-t.length;return x.useEffect(()=>{if(!r)return;const p=u.length,f=xe(Dn("%d result found.","%d results found.",p),p);o(f)},[u?.length,r,o]),a.jsxs("div",{className:"block-editor-block-manager__content",children:[!!d&&a.jsxs("div",{className:"block-editor-block-manager__disabled-blocks-count",children:[xe(Dn("%d block is hidden.","%d blocks are hidden.",d),d),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"link",onClick:l,children:m("Reset")})]}),a.jsx(su,{__nextHasNoMarginBottom:!0,label:m("Search for a block"),placeholder:m("Search for a block"),value:r,onChange:p=>s(p),className:"block-editor-block-manager__search"}),a.jsxs("div",{tabIndex:"0",role:"region","aria-label":m("Available block types"),className:"block-editor-block-manager__results",children:[u.length===0&&a.jsx("p",{className:"block-editor-block-manager__no-results",children:m("No blocks found.")}),i.map(p=>a.jsx(QW,{title:p.title,blockTypes:u.filter(f=>f.category===p.slug),selectedBlockTypes:t,onChange:n},p.slug)),a.jsx(QW,{title:m("Uncategorized"),blockTypes:u.filter(({category:p})=>!p),selectedBlockTypes:t,onChange:n})]})]})}function wPt({rules:e}){const{clientIds:t,selectPrevious:n,message:o}=G(l=>ct(l(J)).getRemovalPromptData()),{clearBlockRemovalPrompt:r,setBlockRemovalRules:s,privateRemoveBlocks:i}=ct(Oe(J));if(x.useEffect(()=>(s(e),()=>{s()}),[e,s]),!o)return;const c=()=>{i(t,n,!0),r()};return a.jsxs(Zo,{title:m("Be careful!"),onRequestClose:r,size:"medium",children:[a.jsx("p",{children:o}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{variant:"tertiary",onClick:r,__next40pxDefaultSize:!0,children:m("Cancel")}),a.jsx(Ce,{variant:"primary",onClick:c,__next40pxDefaultSize:!0,children:m("Delete")})]})]})}const Wte=[{value:"fill",label:We("Fill","Scale option for dimensions control"),help:m("Fill the space by stretching the content.")},{value:"contain",label:We("Contain","Scale option for dimensions control"),help:m("Fit the content to the space without clipping.")},{value:"cover",label:We("Cover","Scale option for dimensions control"),help:m("Fill the space by clipping what doesn't fit.")},{value:"none",label:We("None","Scale option for dimensions control"),help:m("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:We("Scale down","Scale option for dimensions control"),help:m("Scale down the content to fit the space if it is too big. Content that is too small will have additional padding.")}];function _Pt({panelId:e,value:t,onChange:n,options:o=Wte,defaultValue:r=Wte[0].value,isShownByDefault:s=!0}){const i=t??"fill",c=x.useMemo(()=>o.reduce((l,u)=>(l[u.value]=u.help,l),{}),[o]);return a.jsx(tt,{label:m("Scale"),isShownByDefault:s,hasValue:()=>i!==r,onDeselect:()=>n(r),panelId:e,children:a.jsx(Do,{__nextHasNoMarginBottom:!0,label:m("Scale"),isBlock:!0,help:c[i],value:i,onChange:n,size:"__unstable-large",children:o.map(l=>a.jsx(Kn,{...l},l.value))})})}const Nte=He(tt,{target:"ef8pe3d0"})({name:"957xgf",styles:"grid-column:span 1"});function kPt({panelId:e,value:t={},onChange:n=()=>{},units:o,isShownByDefault:r=!0}){var s,i;const c=t.width==="auto"?"":(s=t.width)!==null&&s!==void 0?s:"",l=t.height==="auto"?"":(i=t.height)!==null&&i!==void 0?i:"",u=d=>p=>{const f={...t};p?f[d]=p:delete f[d],n(f)};return a.jsxs(a.Fragment,{children:[a.jsx(Nte,{label:m("Width"),isShownByDefault:r,hasValue:()=>c!=="",onDeselect:u("width"),panelId:e,children:a.jsx(Ro,{label:m("Width"),placeholder:m("Auto"),labelPosition:"top",units:o,min:0,value:c,onChange:u("width"),size:"__unstable-large"})}),a.jsx(Nte,{label:m("Height"),isShownByDefault:r,hasValue:()=>l!=="",onDeselect:u("height"),panelId:e,children:a.jsx(Ro,{label:m("Height"),placeholder:m("Auto"),labelPosition:"top",units:o,min:0,value:l,onChange:u("height"),size:"__unstable-large"})})]})}function SPt({panelId:e,value:t={},onChange:n=()=>{},aspectRatioOptions:o,defaultAspectRatio:r="auto",scaleOptions:s,defaultScale:i="fill",unitsOptions:c,tools:l=["aspectRatio","widthHeight","scale"]}){const u=t.width===void 0||t.width==="auto"?null:t.width,d=t.height===void 0||t.height==="auto"?null:t.height,p=t.aspectRatio===void 0||t.aspectRatio==="auto"?null:t.aspectRatio,f=t.scale===void 0||t.scale==="fill"?null:t.scale,[b,h]=x.useState(f),[g,z]=x.useState(p),A=u&&d?"custom":g,_=p||u&&d;return a.jsxs(a.Fragment,{children:[l.includes("aspectRatio")&&a.jsx(NMe,{panelId:e,options:o,defaultValue:r,value:A,onChange:v=>{const M={...t};v=v==="auto"?null:v,z(v),v?M.aspectRatio=v:delete M.aspectRatio,v?b?M.scale=b:(M.scale=i,h(i)):delete M.scale,v!=="custom"&&u&&d&&delete M.height,n(M)}}),l.includes("widthHeight")&&a.jsx(kPt,{panelId:e,units:c,value:{width:u,height:d},onChange:({width:v,height:M})=>{const y={...t};v=v==="auto"?null:v,M=M==="auto"?null:M,v?y.width=v:delete y.width,M?y.height=M:delete y.height,v&&M?delete y.aspectRatio:g&&(y.aspectRatio=g),!g&&!!v!=!!M?delete y.scale:b?y.scale=b:(y.scale=i,h(i)),n(y)}}),l.includes("scale")&&_&&a.jsx(_Pt,{panelId:e,options:s,defaultValue:i,value:b,onChange:v=>{const M={...t};v=v==="fill"?null:v,h(v),v?M.scale=v:delete M.scale,n(M)}})]})}const Bte=[{label:We("Thumbnail","Image size option for resolution control"),value:"thumbnail"},{label:We("Medium","Image size option for resolution control"),value:"medium"},{label:We("Large","Image size option for resolution control"),value:"large"},{label:We("Full Size","Image size option for resolution control"),value:"full"}];function CPt({panelId:e,value:t,onChange:n,options:o=Bte,defaultValue:r=Bte[0].value,isShownByDefault:s=!0,resetAllFilter:i}){const c=t??r;return a.jsx(tt,{hasValue:()=>c!==r,label:m("Resolution"),onDeselect:()=>n(r),isShownByDefault:s,panelId:e,resetAllFilter:i,children:a.jsx(Pn,{__nextHasNoMarginBottom:!0,label:m("Resolution"),value:c,options:o,onChange:n,help:m("Select the size of the source image."),size:"__unstable-large"})})}const jn={};sgt(jn,{...CEt,ExperimentalBlockCanvas:m8t,ExperimentalBlockEditorProvider:q_,getDuotoneFilter:nI,getRichTextValues:yPt,PrivateQuickInserter:yge,extractWords:c7,getNormalizedSearchTerms:b_,normalizeString:Ex,PrivateListView:Bze,ResizableBoxPopover:APt,useHasBlockToolbar:sMe,cleanEmptyObject:Ii,BlockQuickNavigation:h3e,LayoutStyle:Mvt,BlockManager:xPt,BlockRemovalWarningModal:wPt,useLayoutClasses:P3e,useLayoutStyles:LLt,DimensionsTool:SPt,ResolutionTool:CPt,TabbedSidebar:Mge,TextAlignmentControl:yMe,usesContextKey:t3e,useFlashEditableBlocks:pme,useZoomOut:zge,globalStylesDataKey:dO,globalStylesLinksDataKey:x2e,selectBlockPatternsKey:Wz,requiresWrapperOnCopy:_me,PrivateRichText:Q_,PrivateInserterLibrary:g3e,reusableBlocksSelectKey:w2e,PrivateBlockPopover:U7,PrivatePublishDateTimePicker:M3e,useSpacingSizes:WMe,useBlockDisplayTitle:Fd,__unstableBlockStyleVariationOverridesWithConfig:TEt,setBackgroundStyleDefaults:rI,sectionRootClientIdKey:Nz,CommentIconSlotFill:eMe,CommentIconToolbarSlotFill:rMe});let uT;const dT=new WeakMap;function qPt(e){if(uT||(uT=eh(jn)),!dT.has(e)){const t=uT.getRichTextValues([e]);dT.set(e,t)}return dT.get(e)}const pT=new WeakMap;function RPt(e){if(!pT.has(e)){const t=[];for(const n of qPt(e))n&&n.replacements.forEach(({type:o,attributes:r})=>{o==="core/footnote"&&t.push(r["data-fn"])});pT.set(e,t)}return pT.get(e)}function TPt(e){return e.flatMap(RPt)}let fT={};function Lte(e,t){const n={blocks:e};if(!t||t.footnotes===void 0)return n;const o=TPt(e),r=t.footnotes?JSON.parse(t.footnotes):[];if(r.map(d=>d.id).join("")===o.join(""))return n;const i=o.map(d=>r.find(p=>p.id===d)||fT[d]||{id:d,content:""});function c(d){if(!d||Array.isArray(d)||typeof d!="object")return d;d={...d};for(const p in d){const f=d[p];if(Array.isArray(f)){d[p]=f.map(c);continue}if(typeof f!="string"&&!(f instanceof Xo))continue;const b=typeof f=="string"?Xo.fromHTMLString(f):new Xo(f);let h=!1;b.replacements.forEach(g=>{if(g.type==="core/footnote"){const z=g.attributes["data-fn"],A=o.indexOf(z),_=eo({html:g.innerHTML});_.text=String(A+1),_.formats=Array.from({length:_.text.length},()=>_.formats[0]),_.replacements=Array.from({length:_.text.length},()=>_.replacements[0]),g.innerHTML=T0({value:_}),h=!0}}),h&&(d[p]=typeof f=="string"?b.toHTMLString():b)}return d}function l(d){return d.map(p=>({...p,attributes:c(p.attributes),innerBlocks:l(p.innerBlocks)}))}const u=l(e);return fT={...fT,...r.reduce((d,p)=>(o.includes(p.id)||(d[p.id]=p),d),{})},{meta:{...t,footnotes:JSON.stringify(i)},blocks:u}}const EPt=[],Pte=new WeakMap;function ya(e,t,{id:n}={}){const o=XB(e,t),r=n??o,{getEntityRecord:s,getEntityRecordEdits:i}=G(No),{content:c,editedBlocks:l,meta:u}=G(g=>{if(!r)return{};const{getEditedEntityRecord:z}=g(No),A=z(e,t,r);return{editedBlocks:A.blocks,content:A.content,meta:A.meta}},[e,t,r]),{__unstableCreateUndoLevel:d,editEntityRecord:p}=Oe(No),f=x.useMemo(()=>{if(!r)return;if(l)return l;if(!c||typeof c!="string")return EPt;const g=i(e,t,r),A=!g||!Object.keys(g).length?s(e,t,r):g;let _=Pte.get(A);return _||(_=Ko(c),Pte.set(A,_)),_},[e,t,r,l,c,s,i]),b=x.useCallback((g,z)=>{if(f===g)return d(e,t,r);const{selection:_,...v}=z,M={selection:_,content:({blocks:y=[]})=>Jd(y),...Lte(g,u)};p(e,t,r,M,{isCached:!1,...v})},[e,t,r,f,u,d,p]),h=x.useCallback((g,z)=>{const{selection:A,..._}=z,v=Lte(g,u),M={selection:A,...v};p(e,t,r,M,{isCached:!0,..._})},[e,t,r,u,p]);return[f,h,b]}function Ao(e,t,n,o){const r=XB(e,t),s=o??r,{value:i,fullValue:c}=G(d=>{const{getEntityRecord:p,getEditedEntityRecord:f}=d(No),b=p(e,t,s),h=f(e,t,s);return b&&h?{value:h[n],fullValue:b[n]}:{}},[e,t,s,n]),{editEntityRecord:l}=Oe(No),u=x.useCallback(d=>{l(e,t,s,{[n]:d})},[l,e,t,s,n]);return[i,u,c]}const H3e={};ITe(H3e,{useEntityRecordsWithPermissions:JBe,RECEIVE_INTERMEDIATE_RESULTS:j0e});const kI=[...t1e,...n1e.filter(e=>!!e.name)],WPt=kI.reduce((e,t)=>{const{kind:n,name:o,plural:r}=t;return e[J2(n,o)]=(s,i,c)=>Zd(s,n,o,i,c),r&&(e[J2(n,r,"get")]=(s,i)=>eB(s,n,o,i)),e},{}),NPt=kI.reduce((e,t)=>{const{kind:n,name:o,plural:r}=t;if(e[J2(n,o)]=(s,i)=>Gse(n,o,s,i),r){const s=J2(n,r,"get");e[s]=(...i)=>H4(n,o,...i),e[s].shouldInvalidate=i=>H4.shouldInvalidate(i,n,o)}return e},{}),BPt=kI.reduce((e,t)=>{const{kind:n,name:o}=t;return e[J2(n,o,"save")]=(r,s)=>Use(n,o,r,s),e[J2(n,o,"delete")]=(r,s,i)=>Hse(n,o,r,s,i),e},{}),LPt=()=>({reducer:nTe,actions:{...GBe,...pBe,...BPt,...XBe()},selectors:{...KBe,...jTe,...WPt},resolvers:{...IBe,...NPt}}),Me=w1(No,LPt());eh(Me).registerPrivateSelectors(KTe);eh(Me).registerPrivateActions(bBe);Us(Me);const PPt={...pW,richEditingEnabled:!0,codeEditingEnabled:!0,fontLibraryEnabled:!0,enableCustomFields:void 0,defaultRenderingMode:"post-only"};function jPt(e={},t){switch(t.type){case"SET_IS_READY":return{...e,[t.kind]:{...e[t.kind],[t.name]:!0}}}return e}function IPt(e={},t){var n;switch(t.type){case"REGISTER_ENTITY_ACTION":return{...e,[t.kind]:{...e[t.kind],[t.name]:[...((n=e[t.kind]?.[t.name])!==null&&n!==void 0?n:[]).filter(r=>r.id!==t.config.id),t.config]}};case"UNREGISTER_ENTITY_ACTION":{var o;return{...e,[t.kind]:{...e[t.kind],[t.name]:((o=e[t.kind]?.[t.name])!==null&&o!==void 0?o:[]).filter(r=>r.id!==t.actionId)}}}}return e}function DPt(e={},t){var n,o;switch(t.type){case"REGISTER_ENTITY_FIELD":return{...e,[t.kind]:{...e[t.kind],[t.name]:[...((n=e[t.kind]?.[t.name])!==null&&n!==void 0?n:[]).filter(r=>r.id!==t.config.id),t.config]}};case"UNREGISTER_ENTITY_FIELD":return{...e,[t.kind]:{...e[t.kind],[t.name]:((o=e[t.kind]?.[t.name])!==null&&o!==void 0?o:[]).filter(r=>r.id!==t.fieldId)}}}return e}const FPt=J0({actions:IPt,fields:DPt,isReady:jPt});function SI(e){return e&&typeof e=="object"&&"raw"in e?e.raw:e}function $Pt(e=null,t){switch(t.type){case"SET_EDITED_POST":return t.postId}return e}function VPt(e=null,t){switch(t.type){case"SET_CURRENT_TEMPLATE_ID":return t.id}return e}function HPt(e=null,t){switch(t.type){case"SET_EDITED_POST":return t.postType}return e}function UPt(e={isValid:!0},t){switch(t.type){case"SET_TEMPLATE_VALIDITY":return{...e,isValid:t.isValid}}return e}function XPt(e={},t){switch(t.type){case"REQUEST_POST_UPDATE_START":case"REQUEST_POST_UPDATE_FINISH":return{pending:t.type==="REQUEST_POST_UPDATE_START",options:t.options||{}}}return e}function GPt(e={},t){switch(t.type){case"REQUEST_POST_DELETE_START":case"REQUEST_POST_DELETE_FINISH":return{pending:t.type==="REQUEST_POST_DELETE_START"}}return e}function KPt(e={isLocked:!1},t){switch(t.type){case"UPDATE_POST_LOCK":return t.lock}return e}function YPt(e={},t){switch(t.type){case"LOCK_POST_SAVING":return{...e,[t.lockName]:!0};case"UNLOCK_POST_SAVING":{const{[t.lockName]:n,...o}=e;return o}}return e}function ZPt(e={},t){switch(t.type){case"LOCK_POST_AUTOSAVING":return{...e,[t.lockName]:!0};case"UNLOCK_POST_AUTOSAVING":{const{[t.lockName]:n,...o}=e;return o}}return e}function QPt(e=PPt,t){switch(t.type){case"UPDATE_EDITOR_SETTINGS":return{...e,...t.settings}}return e}function JPt(e="post-only",t){switch(t.type){case"SET_RENDERING_MODE":return t.mode}return e}function ejt(e="Desktop",t){switch(t.type){case"SET_DEVICE_TYPE":return t.deviceType}return e}function tjt(e=[],t){switch(t.type){case"REMOVE_PANEL":if(!e.includes(t.panelName))return[...e,t.panelName]}return e}function njt(e=!1,t){switch(t.type){case"SET_IS_LIST_VIEW_OPENED":return t.isOpen?!1:e;case"SET_IS_INSERTER_OPENED":return t.value}return e}function ojt(e=!1,t){switch(t.type){case"SET_IS_INSERTER_OPENED":return t.value?!1:e;case"SET_IS_LIST_VIEW_OPENED":return t.isOpen}return e}function rjt(e={current:null}){return e}function sjt(e={current:null}){return e}function ijt(e=!1,t){switch(t.type){case"OPEN_PUBLISH_SIDEBAR":return!0;case"CLOSE_PUBLISH_SIDEBAR":return!1;case"TOGGLE_PUBLISH_SIDEBAR":return!e}return e}const ajt=J0({postId:$Pt,postType:HPt,templateId:VPt,saving:XPt,deleting:GPt,postLock:KPt,template:UPt,postSavingLock:YPt,editorSettings:QPt,postAutosavingLock:ZPt,renderingMode:JPt,deviceType:ejt,removedPanels:tjt,blockInserterPanel:njt,inserterSidebarToggleRef:sjt,listViewPanel:ojt,listViewToggleRef:rjt,publishSidebarActive:ijt,dataviews:FPt}),cjt=new Set(["meta"]),ljt="core/editor",U3e=/%(?:postname|pagename)%/,X3e=60*1e3,ujt=["title","excerpt","content"],L0="wp_template",Di="wp_template_part",$l="wp_block",Wf="wp_navigation",G3e={custom:"custom",theme:"theme",plugin:"plugin"},K3e=["wp_template","wp_template_part"],djt=[...K3e,"wp_block","wp_navigation"];function CI(e){return e==="header"?XP:e==="footer"?UP:e==="sidebar"?GP:Qf}const{lock:pjt,unlock:St}=P0("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/editor"),jte={},LO=e=>{var t;if(!e)return jte;const{templateTypes:n,templateAreas:o,template:r}=e,{description:s,slug:i,title:c,area:l}=r,{title:u,description:d}=(t=Object.values(n).find(g=>g.slug===i))!==null&&t!==void 0?t:jte,p=typeof c=="string"?c:c?.rendered,f=typeof s=="string"?s:s?.raw,h=o?.map(g=>({...g,icon:CI(g.icon)}))?.find(g=>l===g.area)?.icon||nu;return{title:p&&p!==i?p:u||i,description:f||d,icon:h}},e3={},fjt=At(e=>()=>e(Me).hasUndo()),bjt=At(e=>()=>e(Me).hasRedo());function Y3e(e){return G1(e).status==="auto-draft"}function Z3e(e){return"content"in t3(e)}const qI=At(e=>t=>{const n=Fi(t),o=$i(t);return e(Me).hasEditsForEntityRecord("postType",n,o)}),hjt=At(e=>t=>{const n=e(Me).__experimentalGetDirtyEntityRecords(),{type:o,id:r}=G1(t);return n.some(s=>s.kind!=="postType"||s.name!==o||s.key!==r)});function mjt(e){return!qI(e)&&Y3e(e)}const G1=At(e=>t=>{const n=$i(t),o=Fi(t),r=e(Me).getRawEntityRecord("postType",o,n);return r||e3});function Fi(e){return e.postType}function $i(e){return e.postId}function gjt(e){return e.templateId}function Mjt(e){var t;return(t=G1(e)._links?.["version-history"]?.[0]?.count)!==null&&t!==void 0?t:0}function zjt(e){var t;return(t=G1(e)._links?.["predecessor-version"]?.[0]?.id)!==null&&t!==void 0?t:null}const t3=At(e=>t=>{const n=Fi(t),o=$i(t);return e(Me).getEntityRecordEdits("postType",n,o)||e3});function jM(e,t){switch(t){case"type":return Fi(e);case"id":return $i(e);default:const n=G1(e);if(!n.hasOwnProperty(t))break;return SI(n[t])}}const Ojt=It((e,t)=>{const n=t3(e);return n.hasOwnProperty(t)?{...jM(e,t),...n[t]}:jM(e,t)},(e,t)=>[jM(e,t),t3(e)[t]]);function mr(e,t){switch(t){case"content":return n3(e)}const n=t3(e);return n.hasOwnProperty(t)?cjt.has(t)?Ojt(e,t):n[t]:jM(e,t)}const Q3e=At(e=>(t,n)=>{if(!ujt.includes(n)&&n!=="preview_link")return;const o=Fi(t);if(o==="wp_template")return!1;const r=$i(t),s=e(Me).getCurrentUser()?.id,i=e(Me).getAutosave(o,r,s);if(i)return SI(i[n])});function yjt(e){return mr(e,"status")==="private"?"private":mr(e,"password")?"password":"public"}function Ajt(e){return G1(e).status==="pending"}function RI(e,t){const n=t||G1(e);return["publish","private"].indexOf(n.status)!==-1||n.status==="future"&&!Dbe(new Date(Number(_f(n.date))-X3e))}function vjt(e){return G1(e).status==="future"&&!RI(e)}function xjt(e){const t=G1(e);return qI(e)||["publish","private","future"].indexOf(t.status)===-1}function J3e(e){return Em(e)?!1:!!mr(e,"title")||!!mr(e,"excerpt")||!eOe(e)||f0.OS==="native"}const eOe=At(e=>t=>{const n=$i(t),o=Fi(t),r=e(Me).getEditedEntityRecord("postType",o,n);if(typeof r.content!="function")return!r.content;const s=mr(t,"blocks");if(s.length===0)return!0;if(s.length>1)return!1;const i=s[0].name;return i!==Mr()&&i!==yd()?!1:!n3(t)}),wjt=At(e=>t=>{if(!J3e(t)||oOe(t))return!1;const n=Fi(t);if(n==="wp_template")return!1;const o=$i(t),r=e(Me).hasFetchedAutosaves(n,o),s=e(Me).getCurrentUser()?.id,i=e(Me).getAutosave(n,o,s);return r?!i||Z3e(t)?!0:["title","excerpt","meta"].some(c=>SI(i[c])!==mr(t,c)):!1});function _jt(e){const t=mr(e,"date"),n=new Date(Number(_f(t))-X3e);return Dbe(n)}function kjt(e){const t=mr(e,"date"),n=mr(e,"modified"),o=G1(e).status;return o==="draft"||o==="auto-draft"||o==="pending"?t===n||t===null:!1}function Sjt(e){return!!e.deleting.pending}function Em(e){return!!e.saving.pending}const Cjt=At(e=>t=>{const n=e(Me).__experimentalGetEntitiesBeingSaved(),{type:o,id:r}=G1(t);return n.some(s=>s.kind!=="postType"||s.name!==o||s.key!==r)}),qjt=At(e=>t=>{const n=Fi(t),o=$i(t);return!e(Me).getLastEntitySaveError("postType",n,o)}),Rjt=At(e=>t=>{const n=Fi(t),o=$i(t);return!!e(Me).getLastEntitySaveError("postType",n,o)});function Tjt(e){return Em(e)&&!!e.saving.options?.isAutosave}function Ejt(e){return Em(e)&&!!e.saving.options?.isPreview}function Wjt(e){if(e.saving.pending||Em(e))return;let t=Q3e(e,"preview_link");(!t||G1(e).status==="draft")&&(t=mr(e,"link"),t&&(t=tn(t,{preview:!0})));const n=mr(e,"featured_media");return t&&n?tn(t,{_thumbnail_id:n}):t}const Njt=At(e=>()=>{const t=e(J).getBlocks();if(t.length>2)return null;let n;if(t.length===1&&(n=t[0].name,n==="core/embed")){const o=t[0].attributes?.providerNameSlug;["youtube","vimeo"].includes(o)?n="core/video":["spotify","soundcloud"].includes(o)&&(n="core/audio")}switch(t.length===2&&t[1].name==="core/paragraph"&&(n=t[0].name),n){case"core/image":return"image";case"core/quote":case"core/pullquote":return"quote";case"core/gallery":return"gallery";case"core/video":return"video";case"core/audio":return"audio";default:return null}}),n3=At(e=>t=>{const n=$i(t),o=Fi(t),r=e(Me).getEditedEntityRecord("postType",o,n);if(r){if(typeof r.content=="function")return r.content(r);if(r.blocks)return Jd(r.blocks);if(r.content)return r.content}return""});function Bjt(e){return Em(e)&&!RI(e)&&mr(e,"status")==="publish"}function tOe(e){const t=mr(e,"permalink_template");return U3e.test(t)}function Ljt(e){const t=nOe(e);if(!t)return null;const{prefix:n,postName:o,suffix:r}=t;return tOe(e)?n+o+r:n}function Pjt(e){return mr(e,"slug")||A5(mr(e,"title"))||$i(e)}function nOe(e){const t=mr(e,"permalink_template");if(!t)return null;const n=mr(e,"slug")||mr(e,"generated_slug"),[o,r]=t.split(U3e);return{prefix:o,postName:n,suffix:r}}function jjt(e){return e.postLock.isLocked}function Ijt(e){return Object.keys(e.postSavingLock).length>0}function oOe(e){return Object.keys(e.postAutosavingLock).length>0}function Djt(e){return e.postLock.isTakeover}function Fjt(e){return e.postLock.user}function $jt(e){return e.postLock.activePostLock}function Vjt(e){return!!G1(e)._links?.hasOwnProperty("wp:action-unfiltered-html")}const Hjt=At(e=>()=>!!e(ht).get("core","isPublishSidebarEnabled")),Ujt=It(e=>mr(e,"blocks")||Ko(n3(e)),e=>[mr(e,"blocks"),n3(e)]);function rOe(e,t){return e.removedPanels.includes(t)}const Xjt=At(e=>(t,n)=>{const o=e(ht).get("core","inactivePanels");return!rOe(t,n)&&!o?.includes(n)}),Gjt=At(e=>(t,n)=>!!e(ht).get("core","openPanels")?.includes(n));function Kjt(e){return Ke("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),mr(e,"selection")?.selectionStart}function Yjt(e){return Ke("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),mr(e,"selection")?.selectionEnd}function Zjt(e){return mr(e,"selection")}function Qjt(e){return!!e.postId}function Jjt(e){return e.editorSettings}function JW(e){return e.renderingMode}const e7t=At(e=>t=>St(e(J)).isZoomOut()?"Desktop":t.deviceType);function t7t(e){return e.listViewPanel}function n7t(e){return!!e.blockInserterPanel}const o7t=At(e=>()=>{var t;return(t=e(ht).get("core","editorMode"))!==null&&t!==void 0?t:"visual"});function r7t(){return Ke("select('core/editor').getStateBeforeOptimisticTransaction",{since:"5.7",hint:"No state history is kept on this store anymore"}),null}function s7t(){return Ke("select('core/editor').inSomeHistory",{since:"5.7",hint:"No state history is kept on this store anymore"}),!1}function pn(e){return At(t=>(n,...o)=>(Ke("`wp.data.select( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.select( 'core/block-editor' )."+e+"`",version:"6.2"}),t(J)[e](...o)))}const i7t=pn("getBlockName"),a7t=pn("isBlockValid"),c7t=pn("getBlockAttributes"),l7t=pn("getBlock"),u7t=pn("getBlocks"),d7t=pn("getClientIdsOfDescendants"),p7t=pn("getClientIdsWithDescendants"),f7t=pn("getGlobalBlockCount"),b7t=pn("getBlocksByClientId"),h7t=pn("getBlockCount"),m7t=pn("getBlockSelectionStart"),g7t=pn("getBlockSelectionEnd"),M7t=pn("getSelectedBlockCount"),z7t=pn("hasSelectedBlock"),O7t=pn("getSelectedBlockClientId"),y7t=pn("getSelectedBlock"),A7t=pn("getBlockRootClientId"),v7t=pn("getBlockHierarchyRootClientId"),x7t=pn("getAdjacentBlockClientId"),w7t=pn("getPreviousBlockClientId"),_7t=pn("getNextBlockClientId"),k7t=pn("getSelectedBlocksInitialCaretPosition"),S7t=pn("getMultiSelectedBlockClientIds"),C7t=pn("getMultiSelectedBlocks"),q7t=pn("getFirstMultiSelectedBlockClientId"),R7t=pn("getLastMultiSelectedBlockClientId"),T7t=pn("isFirstMultiSelectedBlock"),E7t=pn("isBlockMultiSelected"),W7t=pn("isAncestorMultiSelected"),N7t=pn("getMultiSelectedBlocksStartClientId"),B7t=pn("getMultiSelectedBlocksEndClientId"),L7t=pn("getBlockOrder"),P7t=pn("getBlockIndex"),j7t=pn("isBlockSelected"),I7t=pn("hasSelectedInnerBlock"),D7t=pn("isBlockWithinSelection"),F7t=pn("hasMultiSelection"),$7t=pn("isMultiSelecting"),V7t=pn("isSelectionEnabled"),H7t=pn("getBlockMode"),U7t=pn("isTyping"),X7t=pn("isCaretWithinFormattedText"),G7t=pn("getBlockInsertionPoint"),K7t=pn("isBlockInsertionPointVisible"),Y7t=pn("isValidTemplate"),Z7t=pn("getTemplate"),Q7t=pn("getTemplateLock"),J7t=pn("canInsertBlockType"),eIt=pn("getInserterItems"),tIt=pn("hasInserterItems"),nIt=pn("getBlockListSettings"),oIt=At(e=>()=>(Ke("select('core/editor').__experimentalGetDefaultTemplateTypes",{since:"6.8",alternative:"select('core/core-data').getEntityRecord( 'root', '__unstableBase' )?.default_template_types"}),e(Me).getEntityRecord("root","__unstableBase")?.default_template_types)),rIt=At(e=>It(()=>(Ke("select('core/editor').__experimentalGetDefaultTemplatePartAreas",{since:"6.8",alternative:"select('core/core-data').getEntityRecord( 'root', '__unstableBase' )?.default_template_part_areas"}),(e(Me).getEntityRecord("root","__unstableBase")?.default_template_part_areas||[]).map(n=>({...n,icon:CI(n.icon)}))))),sIt=At(e=>It((t,n)=>{var o;Ke("select('core/editor').__experimentalGetDefaultTemplateType",{since:"6.8"});const r=e(Me).getEntityRecord("root","__unstableBase")?.default_template_types;return r&&(o=Object.values(r).find(s=>s.slug===n))!==null&&o!==void 0?o:e3})),iIt=At(e=>It((t,n)=>{if(Ke("select('core/editor').__experimentalGetTemplateInfo",{since:"6.8"}),!n)return e3;const o=e(Me).getEntityRecord("root","__unstableBase")?.default_template_types||[],r=e(Me).getEntityRecord("root","__unstableBase")?.default_template_part_areas||[];return LO({template:n,templateAreas:r,templateTypes:o})})),aIt=At(e=>t=>{const n=Fi(t);return e(Me).getPostType(n)?.labels?.singular_name});function cIt(e){return e.publishSidebarActive}const lIt=Object.freeze(Object.defineProperty({__proto__:null,__experimentalGetDefaultTemplatePartAreas:rIt,__experimentalGetDefaultTemplateType:sIt,__experimentalGetDefaultTemplateTypes:oIt,__experimentalGetTemplateInfo:iIt,__unstableIsEditorReady:Qjt,canInsertBlockType:J7t,canUserUseUnfilteredHTML:Vjt,didPostSaveRequestFail:Rjt,didPostSaveRequestSucceed:qjt,getActivePostLock:$jt,getAdjacentBlockClientId:x7t,getAutosaveAttribute:Q3e,getBlock:l7t,getBlockAttributes:c7t,getBlockCount:h7t,getBlockHierarchyRootClientId:v7t,getBlockIndex:P7t,getBlockInsertionPoint:G7t,getBlockListSettings:nIt,getBlockMode:H7t,getBlockName:i7t,getBlockOrder:L7t,getBlockRootClientId:A7t,getBlockSelectionEnd:g7t,getBlockSelectionStart:m7t,getBlocks:u7t,getBlocksByClientId:b7t,getClientIdsOfDescendants:d7t,getClientIdsWithDescendants:p7t,getCurrentPost:G1,getCurrentPostAttribute:jM,getCurrentPostId:$i,getCurrentPostLastRevisionId:zjt,getCurrentPostRevisionsCount:Mjt,getCurrentPostType:Fi,getCurrentTemplateId:gjt,getDeviceType:e7t,getEditedPostAttribute:mr,getEditedPostContent:n3,getEditedPostPreviewLink:Wjt,getEditedPostSlug:Pjt,getEditedPostVisibility:yjt,getEditorBlocks:Ujt,getEditorMode:o7t,getEditorSelection:Zjt,getEditorSelectionEnd:Yjt,getEditorSelectionStart:Kjt,getEditorSettings:Jjt,getFirstMultiSelectedBlockClientId:q7t,getGlobalBlockCount:f7t,getInserterItems:eIt,getLastMultiSelectedBlockClientId:R7t,getMultiSelectedBlockClientIds:S7t,getMultiSelectedBlocks:C7t,getMultiSelectedBlocksEndClientId:B7t,getMultiSelectedBlocksStartClientId:N7t,getNextBlockClientId:_7t,getPermalink:Ljt,getPermalinkParts:nOe,getPostEdits:t3,getPostLockUser:Fjt,getPostTypeLabel:aIt,getPreviousBlockClientId:w7t,getRenderingMode:JW,getSelectedBlock:y7t,getSelectedBlockClientId:O7t,getSelectedBlockCount:M7t,getSelectedBlocksInitialCaretPosition:k7t,getStateBeforeOptimisticTransaction:r7t,getSuggestedPostFormat:Njt,getTemplate:Z7t,getTemplateLock:Q7t,hasChangedContent:Z3e,hasEditorRedo:bjt,hasEditorUndo:fjt,hasInserterItems:tIt,hasMultiSelection:F7t,hasNonPostEntityChanges:hjt,hasSelectedBlock:z7t,hasSelectedInnerBlock:I7t,inSomeHistory:s7t,isAncestorMultiSelected:W7t,isAutosavingPost:Tjt,isBlockInsertionPointVisible:K7t,isBlockMultiSelected:E7t,isBlockSelected:j7t,isBlockValid:a7t,isBlockWithinSelection:D7t,isCaretWithinFormattedText:X7t,isCleanNewPost:mjt,isCurrentPostPending:Ajt,isCurrentPostPublished:RI,isCurrentPostScheduled:vjt,isDeletingPost:Sjt,isEditedPostAutosaveable:wjt,isEditedPostBeingScheduled:_jt,isEditedPostDateFloating:kjt,isEditedPostDirty:qI,isEditedPostEmpty:eOe,isEditedPostNew:Y3e,isEditedPostPublishable:xjt,isEditedPostSaveable:J3e,isEditorPanelEnabled:Xjt,isEditorPanelOpened:Gjt,isEditorPanelRemoved:rOe,isFirstMultiSelectedBlock:T7t,isInserterOpened:n7t,isListViewOpened:t7t,isMultiSelecting:$7t,isPermalinkEditable:tOe,isPostAutosavingLocked:oOe,isPostLockTakeover:Djt,isPostLocked:jjt,isPostSavingLocked:Ijt,isPreviewingPost:Ejt,isPublishSidebarEnabled:Hjt,isPublishSidebarOpened:cIt,isPublishingPost:Bjt,isSavingNonPostEntityChanges:Cjt,isSavingPost:Em,isSelectionEnabled:V7t,isTyping:U7t,isValidTemplate:Y7t},Symbol.toStringTag,{value:"Module"}));function uIt(e,t){return`wp-autosave-block-editor-post-${t?"auto-draft":e}`}function dIt(e,t,n,o,r){window.sessionStorage.setItem(uIt(e,t),JSON.stringify({post_title:n,content:o,excerpt:r}))}function pIt(e){var t;const{previousPost:n,post:o,postType:r}=e;if(e.options?.isAutosave)return[];const s=["publish","private","future"],i=s.includes(n.status),c=s.includes(o.status),l=o.status==="trash"&&n.status!=="trash";let u,d=(t=r?.viewable)!==null&&t!==void 0?t:!1,p;l?(u=r.labels.item_trashed,d=!1):!i&&!c?(u=m("Draft saved."),p=!0):i&&!c?(u=r.labels.item_reverted_to_draft,d=!1):!i&&c?u={publish:r.labels.item_published,private:r.labels.item_published_privately,future:r.labels.item_scheduled}[o.status]:u=r.labels.item_updated;const f=[];return d&&f.push({label:p?m("View Preview"):r.labels.view_item,url:o.link}),[u,{id:"editor-save",type:"snackbar",actions:f}]}function fIt(e){const{post:t,edits:n,error:o}=e;if(o&&o.code==="rest_autosave_no_changes")return[];const r=["publish","private","future"],s=r.indexOf(t.status)!==-1,i={publish:m("Publishing failed."),private:m("Publishing failed."),future:m("Scheduling failed.")};let c=!s&&r.indexOf(n.status)!==-1?i[n.status]:m("Updating failed.");return o.message&&!/<\/?[^>]*>/.test(o.message)&&(c=[c,o.message].join(" ")),[c,{id:"editor-save"}]}function bIt(e){return[e.error.message&&e.error.code!=="unknown_error"?e.error.message:m("Trashing failed"),{id:"editor-trash-fail"}]}const hIt=(e,t,n)=>({dispatch:o})=>{if(o.setEditedPost(e.type,e.id),e.status==="auto-draft"&&n){let s;"content"in t?s=t.content:s=e.content.raw;let i=Ko(s);i=oz(i,n),o.resetEditorBlocks(i,{__unstableShouldCreateUndoLevel:!1})}t&&Object.values(t).some(([s,i])=>{var c;return i!==((c=e[s]?.raw)!==null&&c!==void 0?c:e[s])})&&o.editPost(t)};function mIt(){return Ke("wp.data.dispatch( 'core/editor' ).__experimentalTearDownEditor",{since:"6.5"}),{type:"DO_NOTHING"}}function gIt(){return Ke("wp.data.dispatch( 'core/editor' ).resetPost",{since:"6.0",version:"6.3",alternative:"Initialize the editor with the setupEditorState action"}),{type:"DO_NOTHING"}}function MIt(){return Ke("wp.data.dispatch( 'core/editor' ).updatePost",{since:"5.7",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function zIt(e){return Ke("wp.data.dispatch( 'core/editor' ).setupEditorState",{since:"6.5",alternative:"wp.data.dispatch( 'core/editor' ).setEditedPost"}),sOe(e.type,e.id)}function sOe(e,t){return{type:"SET_EDITED_POST",postType:e,postId:t}}const OIt=(e,t)=>({select:n,registry:o})=>{const{id:r,type:s}=n.getCurrentPost();o.dispatch(Me).editEntityRecord("postType",s,r,e,t)},yIt=(e={})=>async({select:t,dispatch:n,registry:o})=>{if(!t.isEditedPostSaveable())return;const r=t.getEditedPostContent();e.isAutosave||n.editPost({content:r},{undoIgnore:!0});const s=t.getCurrentPost();let i={id:s.id,...o.select(Me).getEntityRecordNonTransientEdits("postType",s.type,s.id),content:r};n({type:"REQUEST_POST_UPDATE_START",options:e});let c=!1;try{i=await o6e("editor.preSavePost",i,e)}catch(l){c=l}if(!c)try{await o.dispatch(Me).saveEntityRecord("postType",s.type,i,e)}catch(l){c=l.message&&l.code!=="unknown_error"?l.message:m("An error occurred while updating.")}if(c||(c=o.select(Me).getLastEntitySaveError("postType",s.type,s.id)),!c)try{await gr("editor.__unstableSavePost",Promise.resolve(),e)}catch(l){c=l}if(!c)try{await n6e("editor.savePost",{id:s.id},e)}catch(l){c=l}if(n({type:"REQUEST_POST_UPDATE_FINISH",options:e}),c){const l=fIt({post:s,edits:i,error:c});l.length&&o.dispatch(mt).createErrorNotice(...l)}else{const l=t.getCurrentPost(),u=pIt({previousPost:s,post:l,postType:await o.resolveSelect(Me).getPostType(l.type),options:e});u.length&&o.dispatch(mt).createSuccessNotice(...u),e.isAutosave||o.dispatch(J).__unstableMarkLastChangeAsPersistent()}};function AIt(){return Ke("wp.data.dispatch( 'core/editor' ).refreshPost",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}const vIt=()=>async({select:e,dispatch:t,registry:n})=>{const o=e.getCurrentPostType(),r=await n.resolveSelect(Me).getPostType(o),{rest_base:s,rest_namespace:i="wp/v2"}=r;t({type:"REQUEST_POST_DELETE_START"});try{const c=e.getCurrentPost();await Tt({path:`/${i}/${s}/${c.id}`,method:"DELETE"}),await t.savePost()}catch(c){n.dispatch(mt).createErrorNotice(...bIt({error:c}))}t({type:"REQUEST_POST_DELETE_FINISH"})},xIt=({local:e=!1,...t}={})=>async({select:n,dispatch:o})=>{const r=n.getCurrentPost();if(r.type!=="wp_template")if(e){const s=n.isEditedPostNew(),i=n.getEditedPostAttribute("title"),c=n.getEditedPostAttribute("content"),l=n.getEditedPostAttribute("excerpt");dIt(r.id,s,i,c,l)}else await o.savePost({isAutosave:!0,...t})},wIt=({forceIsAutosaveable:e}={})=>async({select:t,dispatch:n})=>((e||t.isEditedPostAutosaveable())&&!t.isPostLocked()&&(["draft","auto-draft"].includes(t.getEditedPostAttribute("status"))?await n.savePost({isPreview:!0}):await n.autosave({isPreview:!0})),t.getEditedPostPreviewLink()),_It=()=>({registry:e})=>{e.dispatch(Me).redo()},kIt=()=>({registry:e})=>{e.dispatch(Me).undo()};function SIt(){return Ke("wp.data.dispatch( 'core/editor' ).createUndoLevel",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function CIt(e){return{type:"UPDATE_POST_LOCK",lock:e}}const qIt=()=>({registry:e})=>{e.dispatch(ht).set("core","isPublishSidebarEnabled",!0)},RIt=()=>({registry:e})=>{e.dispatch(ht).set("core","isPublishSidebarEnabled",!1)};function TIt(e){return{type:"LOCK_POST_SAVING",lockName:e}}function EIt(e){return{type:"UNLOCK_POST_SAVING",lockName:e}}function WIt(e){return{type:"LOCK_POST_AUTOSAVING",lockName:e}}function NIt(e){return{type:"UNLOCK_POST_AUTOSAVING",lockName:e}}const BIt=(e,t={})=>({select:n,dispatch:o,registry:r})=>{const{__unstableShouldCreateUndoLevel:s,selection:i}=t,c={blocks:e,selection:i};if(s!==!1){const{id:l,type:u}=n.getCurrentPost();if(r.select(Me).getEditedEntityRecord("postType",u,l).blocks===c.blocks){r.dispatch(Me).__unstableCreateUndoLevel("postType",u,l);return}c.content=({blocks:p=[]})=>Jd(p)}o.editPost(c)};function LIt(e){return{type:"UPDATE_EDITOR_SETTINGS",settings:e}}const PIt=e=>({dispatch:t,registry:n,select:o})=>{o.__unstableIsEditorReady()&&(n.dispatch(J).clearSelectedBlock(),t.editPost({selection:void 0},{undoIgnore:!0})),t({type:"SET_RENDERING_MODE",mode:e})};function jIt(e){return{type:"SET_DEVICE_TYPE",deviceType:e}}const IIt=e=>({registry:t})=>{var n;const o=(n=t.select(ht).get("core","inactivePanels"))!==null&&n!==void 0?n:[],r=!!o?.includes(e);let s;r?s=o.filter(i=>i!==e):s=[...o,e],t.dispatch(ht).set("core","inactivePanels",s)},DIt=e=>({registry:t})=>{var n;const o=(n=t.select(ht).get("core","openPanels"))!==null&&n!==void 0?n:[],r=!!o?.includes(e);let s;r?s=o.filter(i=>i!==e):s=[...o,e],t.dispatch(ht).set("core","openPanels",s)};function FIt(e){return{type:"REMOVE_PANEL",panelName:e}}const $It=e=>({dispatch:t,registry:n})=>{typeof e=="object"&&e.hasOwnProperty("rootClientId")&&e.hasOwnProperty("insertionIndex")&&St(n.dispatch(J)).setInsertionPoint({rootClientId:e.rootClientId,index:e.insertionIndex}),t({type:"SET_IS_INSERTER_OPENED",value:e})};function VIt(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}const HIt=({createNotice:e=!0}={})=>({dispatch:t,registry:n})=>{const o=n.select(ht).get("core","distractionFree");o&&n.dispatch(ht).set("core","fixedToolbar",!1),o||n.batch(()=>{n.dispatch(ht).set("core","fixedToolbar",!0),t.setIsInserterOpened(!1),t.setIsListViewOpened(!1),St(n.dispatch(J)).resetZoomLevel()}),n.batch(()=>{n.dispatch(ht).set("core","distractionFree",!o),e&&n.dispatch(mt).createInfoNotice(m(o?"Distraction free mode deactivated.":"Distraction free mode activated."),{id:"core/editor/distraction-free-mode/notice",type:"snackbar",actions:[{label:m("Undo"),onClick:()=>{n.batch(()=>{n.dispatch(ht).set("core","fixedToolbar",o),n.dispatch(ht).toggle("core","distractionFree")})}}]})})},UIt=()=>({registry:e})=>{e.dispatch(ht).toggle("core","focusMode");const t=e.select(ht).get("core","focusMode");e.dispatch(mt).createInfoNotice(m(t?"Spotlight mode activated.":"Spotlight mode deactivated."),{id:"core/editor/toggle-spotlight-mode/notice",type:"snackbar",actions:[{label:m("Undo"),onClick:()=>{e.dispatch(ht).toggle("core","focusMode")}}]})},XIt=()=>({registry:e})=>{e.dispatch(ht).toggle("core","fixedToolbar");const t=e.select(ht).get("core","fixedToolbar");e.dispatch(mt).createInfoNotice(m(t?"Top toolbar activated.":"Top toolbar deactivated."),{id:"core/editor/toggle-top-toolbar/notice",type:"snackbar",actions:[{label:m("Undo"),onClick:()=>{e.dispatch(ht).toggle("core","fixedToolbar")}}]})},GIt=e=>({dispatch:t,registry:n})=>{n.dispatch(ht).set("core","editorMode",e),e!=="visual"&&(n.dispatch(J).clearSelectedBlock(),St(n.dispatch(J)).resetZoomLevel()),e==="visual"?Yt(m("Visual editor selected"),"assertive"):e==="text"&&(n.select(ht).get("core","distractionFree")&&t.toggleDistractionFree(),Yt(m("Code editor selected"),"assertive"))};function KIt(){return{type:"OPEN_PUBLISH_SIDEBAR"}}function YIt(){return{type:"CLOSE_PUBLISH_SIDEBAR"}}function ZIt(){return{type:"TOGGLE_PUBLISH_SIDEBAR"}}const _o=e=>(...t)=>({registry:n})=>{Ke("`wp.data.dispatch( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.dispatch( 'core/block-editor' )."+e+"`",version:"6.2"}),n.dispatch(J)[e](...t)},QIt=_o("resetBlocks"),JIt=_o("receiveBlocks"),e9t=_o("updateBlock"),t9t=_o("updateBlockAttributes"),n9t=_o("selectBlock"),o9t=_o("startMultiSelect"),r9t=_o("stopMultiSelect"),s9t=_o("multiSelect"),i9t=_o("clearSelectedBlock"),a9t=_o("toggleSelection"),c9t=_o("replaceBlocks"),l9t=_o("replaceBlock"),u9t=_o("moveBlocksDown"),d9t=_o("moveBlocksUp"),p9t=_o("moveBlockToPosition"),f9t=_o("insertBlock"),b9t=_o("insertBlocks"),h9t=_o("showInsertionPoint"),m9t=_o("hideInsertionPoint"),g9t=_o("setTemplateValidity"),M9t=_o("synchronizeTemplate"),z9t=_o("mergeBlocks"),O9t=_o("removeBlocks"),y9t=_o("removeBlock"),A9t=_o("toggleBlockMode"),v9t=_o("startTyping"),x9t=_o("stopTyping"),w9t=_o("enterFormattedText"),_9t=_o("exitFormattedText"),k9t=_o("insertDefaultBlock"),S9t=_o("updateBlockListSettings"),C9t=Object.freeze(Object.defineProperty({__proto__:null,__experimentalTearDownEditor:mIt,__unstableSaveForPreview:wIt,autosave:xIt,clearSelectedBlock:i9t,closePublishSidebar:YIt,createUndoLevel:SIt,disablePublishSidebar:RIt,editPost:OIt,enablePublishSidebar:qIt,enterFormattedText:w9t,exitFormattedText:_9t,hideInsertionPoint:m9t,insertBlock:f9t,insertBlocks:b9t,insertDefaultBlock:k9t,lockPostAutosaving:WIt,lockPostSaving:TIt,mergeBlocks:z9t,moveBlockToPosition:p9t,moveBlocksDown:u9t,moveBlocksUp:d9t,multiSelect:s9t,openPublishSidebar:KIt,receiveBlocks:JIt,redo:_It,refreshPost:AIt,removeBlock:y9t,removeBlocks:O9t,removeEditorPanel:FIt,replaceBlock:l9t,replaceBlocks:c9t,resetBlocks:QIt,resetEditorBlocks:BIt,resetPost:gIt,savePost:yIt,selectBlock:n9t,setDeviceType:jIt,setEditedPost:sOe,setIsInserterOpened:$It,setIsListViewOpened:VIt,setRenderingMode:PIt,setTemplateValidity:g9t,setupEditor:hIt,setupEditorState:zIt,showInsertionPoint:h9t,startMultiSelect:o9t,startTyping:v9t,stopMultiSelect:r9t,stopTyping:x9t,switchEditorMode:GIt,synchronizeTemplate:M9t,toggleBlockMode:A9t,toggleDistractionFree:HIt,toggleEditorPanelEnabled:IIt,toggleEditorPanelOpened:DIt,togglePublishSidebar:ZIt,toggleSelection:a9t,toggleSpotlightMode:UIt,toggleTopToolbar:XIt,trashPost:vIt,undo:kIt,unlockPostAutosaving:NIt,unlockPostSaving:EIt,updateBlock:e9t,updateBlockAttributes:t9t,updateBlockListSettings:S9t,updateEditorSettings:LIt,updatePost:MIt,updatePostLock:CIt},Symbol.toStringTag,{value:"Module"}));function iOe(e){return e?e.source===G3e.custom&&(!!e?.plugin||e?.has_theme_file):!1}function q9t(e){return e.type==="wp_template"}function R9t(e){return e.type==="wp_template_part"}function qh(e){return e.type==="wp_template"||e.type==="wp_template_part"}function Wr(e){return typeof e.title=="string"?Lt(e.title):e.title&&"rendered"in e.title?Lt(e.title.rendered):e.title&&"raw"in e.title?Lt(e.title.raw):""}function aOe(e){return e?[e.source,e.source].includes("custom")&&!(e.type==="wp_template"&&e?.plugin)&&!e.has_theme_file:!1}const cOe=e=>typeof e!="object"?"":e.slug||A5(Wr(e))||e.id.toString(),lOe=({field:e,onChange:t,data:n})=>{const{id:o}=e,r=e.getValue({item:n})||cOe(n),s=n.permalink_template||"",i=/%(?:postname|pagename)%/,[c,l]=s.split(i),u=c,d=l,p=i.test(s),f=x.useRef(r),b=r||f.current,h=p?`${u}${b}${d}`:Y2(n.link||"");x.useEffect(()=>{r&&f.current===void 0&&(f.current=r)},[r]);const g=x.useCallback(v=>t({[o]:v}),[o,t]),{createNotice:z}=Oe(mt),A=Hl(h,()=>{z("info",m("Copied Permalink to clipboard."),{isDismissible:!0,type:"snackbar"})}),_="editor-post-url__slug-description-"+vt(lOe);return a.jsxs("fieldset",{className:"fields-controls__slug",children:[p&&a.jsxs(dt,{children:[a.jsxs(dt,{spacing:"0px",children:[a.jsx("span",{children:m("Customize the last part of the Permalink.")}),a.jsx(hr,{href:"https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink",children:m("Learn more")})]}),a.jsx(B1,{__next40pxDefaultSize:!0,prefix:a.jsx(Ld,{children:"/"}),suffix:a.jsx(Ce,{__next40pxDefaultSize:!0,icon:RP,ref:A,label:m("Copy")}),label:m("Link"),hideLabelFromVision:!0,value:r,autoComplete:"off",spellCheck:"false",type:"text",className:"fields-controls__slug-input",onChange:v=>{g(v)},onBlur:()=>{r===""&&g(f.current)},"aria-describedby":_}),a.jsxs("div",{className:"fields-controls__slug-help",children:[a.jsx("span",{className:"fields-controls__slug-help-visual-label",children:m("Permalink:")}),a.jsxs(hr,{className:"fields-controls__slug-help-link",href:h,children:[a.jsx("span",{className:"fields-controls__slug-help-prefix",children:u}),a.jsx("span",{className:"fields-controls__slug-help-slug",children:b}),a.jsx("span",{className:"fields-controls__slug-help-suffix",children:d})]})]})]}),!p&&a.jsx(hr,{className:"fields-controls__slug-help",href:h,children:h})]})},T9t=({item:e})=>{const t=cOe(e),n=x.useRef(t);return x.useEffect(()=>{t&&n.current===void 0&&(n.current=t)},[t]),`${t||n.current}`},E9t={id:"slug",type:"text",label:m("Slug"),Edit:lOe,render:T9t};function TI({item:e,className:t,children:n}){const o=Wr(e);return a.jsxs(Ot,{className:oe("fields-field__title",t),alignment:"center",justify:"flex-start",children:[a.jsx("span",{children:o||m("(no title)")}),n]})}function uOe({item:e}){return a.jsx(TI,{item:e})}const dOe={type:"text",id:"title",label:m("Title"),placeholder:m("No title"),getValue:({item:e})=>Wr(e),render:uOe,enableHiding:!1,enableGlobalSearch:!0},{lock:Vmn,unlock:Wm}=P0("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/fields"),{Badge:W9t}=Wm(tr);function N9t({item:e}){const{frontPageId:t,postsPageId:n}=G(o=>{const{getEntityRecord:r}=o(Me),s=r("root","site");return{frontPageId:s?.page_on_front,postsPageId:s?.page_for_posts}},[]);return a.jsx(TI,{item:e,className:"fields-field__page-title",children:[t,n].includes(e.id)&&a.jsx(W9t,{children:e.id===t?m("Homepage"):m("Posts Page")})})}const B9t={type:"text",id:"title",label:m("Title"),placeholder:m("No title"),getValue:({item:e})=>Wr(e),render:N9t,enableHiding:!1,enableGlobalSearch:!0},L9t={type:"text",label:m("Template"),placeholder:m("No title"),id:"title",getValue:({item:e})=>Wr(e),render:uOe,enableHiding:!1,enableGlobalSearch:!0};function P9t(e={},t){return t?.type==="SET_EDITING_PATTERN"?{...e,[t.clientId]:t.isEditing}:e}const j9t=J0({isEditingPattern:P9t}),nk={theme:"pattern",user:"wp_block"},pOe="all-patterns",I9t="my-patterns",D9t=["core","pattern-directory/core","pattern-directory/featured"],oa={full:"fully",unsynced:"unsynced"},fOe={"core/paragraph":["content"],"core/heading":["content"],"core/button":["text","url","linkTarget","rel"],"core/image":["id","url","title","alt"]},M4="core/pattern-overrides",F9t=(e,t,n,o)=>async({registry:r})=>{const s=t===oa.unsynced?{wp_pattern_sync_status:t}:void 0,i={title:e,content:n,status:"publish",meta:s,wp_pattern_category:o};return await r.dispatch(Me).saveEntityRecord("postType","wp_block",i)},$9t=(e,t)=>async({dispatch:n})=>{const o=await e.text();let r;try{r=JSON.parse(o)}catch{throw new Error("Invalid JSON file")}if(r.__file!=="wp_block"||!r.title||!r.content||typeof r.title!="string"||typeof r.content!="string"||r.syncStatus&&typeof r.syncStatus!="string")throw new Error("Invalid pattern JSON file");return await n.createPattern(r.title,r.syncStatus,r.content,t)},V9t=e=>({registry:t})=>{const n=t.select(J).getBlock(e),o=n.attributes?.content;function r(i){return i.map(c=>{let l=c.attributes.metadata;if(l&&(l={...l},delete l.id,delete l.bindings,o?.[l.name]))for(const[u,d]of Object.entries(o[l.name]))on(c.name)?.attributes[u]&&(c.attributes[u]=d);return jo(c,{metadata:l&&Object.keys(l).length>0?l:void 0},r(c.innerBlocks))})}const s=t.select(J).getBlocks(n.clientId);t.dispatch(J).replaceBlocks(n.clientId,r(s))};function H9t(e,t){return{type:"SET_EDITING_PATTERN",clientId:e,isEditing:t}}const U9t=Object.freeze(Object.defineProperty({__proto__:null,convertSyncedPatternToStatic:V9t,createPattern:F9t,createPatternFromFile:$9t,setEditingPattern:H9t},Symbol.toStringTag,{value:"Module"})),X9t="core/patterns";function G9t(e,t){return e.isEditingPattern[t]}const K9t=Object.freeze(Object.defineProperty({__proto__:null,isEditingPattern:G9t},Symbol.toStringTag,{value:"Module"})),{lock:Y9t,unlock:pb}=P0("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/patterns"),Z9t={reducer:j9t},Nm=w1(X9t,{...Z9t});Us(Nm);pb(Nm).registerPrivateActions(U9t);pb(Nm).registerPrivateSelectors(K9t);function EI(e){return Object.keys(fOe).includes(e.name)&&!!e.attributes.metadata?.name&&!!e.attributes.metadata?.bindings&&Object.values(e.attributes.metadata.bindings).some(t=>t.source==="core/pattern-overrides")}function bOe(e){return e.some(t=>EI(t)?!0:bOe(t.innerBlocks))}const{BlockQuickNavigation:Q9t}=pb(jn);function J9t(){const e=G(o=>o(J).getClientIdsWithDescendants(),[]),{getBlock:t}=G(J),n=x.useMemo(()=>e.filter(o=>{const r=t(o);return EI(r)}),[e,t]);return n?.length?a.jsx(Qt,{title:m("Overrides"),children:a.jsx(Q9t,{clientIds:n})}):null}const eDt=e=>Lt(e),hOe="wp_pattern_category";function tDt({categoryTerms:e,onChange:t,categoryMap:n}){const[o,r]=x.useState(""),s=q1(r,500),i=x.useMemo(()=>Array.from(n.values()).map(l=>eDt(l.label)).filter(l=>o!==""?l.toLowerCase().includes(o.toLowerCase()):!0).sort((l,u)=>l.localeCompare(u)),[o,n]);function c(l){const u=l.reduce((d,p)=>(d.some(f=>f.toLowerCase()===p.toLowerCase())||d.push(p),d),[]);t(u)}return a.jsx(ip,{className:"patterns-menu-items__convert-modal-categories",value:e,suggestions:i,onChange:c,onInputChange:s,label:m("Categories"),tokenizeOnBlur:!0,__experimentalExpandOnFocus:!0,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})}function mOe(){const{saveEntityRecord:e,invalidateResolution:t}=Oe(Me),{corePatternCategories:n,userPatternCategories:o}=G(i=>{const{getUserPatternCategories:c,getBlockPatternCategories:l}=i(Me);return{corePatternCategories:l(),userPatternCategories:c()}},[]),r=x.useMemo(()=>{const i=new Map;return o.forEach(c=>{i.set(c.label.toLowerCase(),{label:c.label,name:c.name,id:c.id})}),n.forEach(c=>{!i.has(c.label.toLowerCase())&&c.name!=="query"&&i.set(c.label.toLowerCase(),{label:c.label,name:c.name})}),i},[o,n]);async function s(i){try{const c=r.get(i.toLowerCase());if(c?.id)return c.id;const l=c?{name:c.label,slug:c.name}:{name:i},u=await e("taxonomy",hOe,l,{throwOnError:!0});return t("getUserPatternCategories"),u.id}catch(c){if(c.code!=="term_exists")throw c;return c.data.term_id}}return{categoryMap:r,findOrCreateTerm:s}}function WI({className:e="patterns-menu-items__convert-modal",modalTitle:t,...n}){const o=G(r=>r(Me).getPostType(nk.user)?.labels?.add_new_item,[]);return a.jsx(Zo,{title:t||o,onRequestClose:n.onClose,overlayClassName:e,focusOnMount:"firstContentElement",size:"small",children:a.jsx(gOe,{...n})})}function gOe({confirmLabel:e=m("Add"),defaultCategories:t=[],content:n,onClose:o,onError:r,onSuccess:s,defaultSyncType:i=oa.full,defaultTitle:c=""}){const[l,u]=x.useState(i),[d,p]=x.useState(t),[f,b]=x.useState(c),[h,g]=x.useState(!1),{createPattern:z}=pb(Oe(Nm)),{createErrorNotice:A}=Oe(mt),{categoryMap:_,findOrCreateTerm:v}=mOe();async function M(y,k){if(!(!f||h))try{g(!0);const S=await Promise.all(d.map(R=>v(R))),C=await z(y,k,typeof n=="function"?n():n,S);s({pattern:C,categoryId:pOe})}catch(S){A(S.message,{type:"snackbar",id:"pattern-create"}),r?.()}finally{g(!1),p([]),b("")}}return a.jsx("form",{onSubmit:y=>{y.preventDefault(),M(f,l)},children:a.jsxs(dt,{spacing:"5",children:[a.jsx(dn,{label:m("Name"),value:f,onChange:b,placeholder:m("My pattern"),className:"patterns-create-modal__name-input",__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),a.jsx(tDt,{categoryTerms:d,onChange:p,categoryMap:_}),a.jsx(lt,{__nextHasNoMarginBottom:!0,label:We("Synced","pattern (singular)"),help:m("Sync this pattern across multiple locations."),checked:l===oa.full,onChange:()=>{u(l===oa.full?oa.unsynced:oa.full)}}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{o(),b("")},children:m("Cancel")}),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"primary",type:"submit","aria-disabled":!f||h,isBusy:h,children:e})]})]})})}function nDt(e,t){return e.type!==nk.user?t.core?.filter(n=>e.categories?.includes(n.name)).map(n=>n.label):t.user?.filter(n=>e.wp_pattern_category?.includes(n.id)).map(n=>n.label)}function MOe({pattern:e,onSuccess:t}){const{createSuccessNotice:n}=Oe(mt),o=G(r=>{const{getUserPatternCategories:s,getBlockPatternCategories:i}=r(Me);return{core:i(),user:s()}});return e?{content:e.content,defaultCategories:nDt(e,o),defaultSyncType:e.type!==nk.user?oa.unsynced:e.wp_pattern_sync_status||oa.full,defaultTitle:xe(We("%s (Copy)","pattern"),typeof e.title=="string"?e.title:e.title.raw),onSuccess:({pattern:r})=>{n(xe(We('"%s" duplicated.',"pattern"),r.title.raw),{type:"snackbar",id:"patterns-create"}),t?.({pattern:r})}}:null}function oDt({pattern:e,onClose:t,onSuccess:n}){const o=MOe({pattern:e,onSuccess:n});return e?a.jsx(WI,{modalTitle:m("Duplicate pattern"),confirmLabel:m("Duplicate"),onClose:t,onError:t,...o}):null}function rDt({onClose:e,onError:t,onSuccess:n,pattern:o,...r}){const s=Lt(o.title),[i,c]=x.useState(s),[l,u]=x.useState(!1),{editEntityRecord:d,__experimentalSaveSpecifiedEntityEdits:p}=Oe(Me),{createSuccessNotice:f,createErrorNotice:b}=Oe(mt),h=async z=>{if(z.preventDefault(),!(!i||i===o.title||l))try{await d("postType",o.type,o.id,{title:i}),u(!0),c(""),e?.();const A=await p("postType",o.type,o.id,["title"],{throwOnError:!0});n?.(A),f(m("Pattern renamed"),{type:"snackbar",id:"pattern-update"})}catch(A){t?.();const _=A.message&&A.code!=="unknown_error"?A.message:m("An error occurred while renaming the pattern.");b(_,{type:"snackbar",id:"pattern-update"})}finally{u(!1),c("")}},g=()=>{e?.(),c("")};return a.jsx(Zo,{title:m("Rename"),...r,onRequestClose:e,focusOnMount:"firstContentElement",size:"small",children:a.jsx("form",{onSubmit:h,children:a.jsxs(dt,{spacing:"5",children:[a.jsx(dn,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:m("Name"),value:i,onChange:c,required:!0}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:g,children:m("Cancel")}),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",children:m("Save")})]})]})})})}function sDt({clientIds:e,rootClientId:t,closeBlockSettingsMenu:n}){const{createSuccessNotice:o}=Oe(mt),{replaceBlocks:r}=Oe(J),{setEditingPattern:s}=pb(Oe(Nm)),[i,c]=x.useState(!1),l=G(f=>{var b;const{canUser:h}=f(Me),{getBlocksByClientId:g,canInsertBlockType:z,getBlockRootClientId:A}=f(J),_=t||(e.length>0?A(e[0]):void 0),v=(b=g(e))!==null&&b!==void 0?b:[],M=S=>{const C=on(S),R=C&&"parent"in C;return Et(S,"reusable",!R)};return!(v.length===1&&v[0]&&Qd(v[0])&&!!f(Me).getEntityRecord("postType","wp_block",v[0].attributes.ref))&&z("core/block",_)&&v.every(S=>!!S&&S.isValid&&M(S.name))&&!!h("create",{kind:"postType",name:"wp_block"})},[e,t]),{getBlocksByClientId:u}=G(J),d=x.useCallback(()=>Ks(u(e)),[u,e]);if(!l)return null;const p=({pattern:f})=>{if(f.wp_pattern_sync_status!==oa.unsynced){const b=Ee("core/block",{ref:f.id});r(e,b),s(b.clientId,!0),n()}o(f.wp_pattern_sync_status===oa.unsynced?xe(m("Unsynced pattern created: %s"),f.title.raw):xe(m("Synced pattern created: %s"),f.title.raw),{type:"snackbar",id:"convert-to-pattern-success"}),c(!1)};return a.jsxs(a.Fragment,{children:[a.jsx(Ct,{icon:Bd,onClick:()=>c(!0),"aria-expanded":i,"aria-haspopup":"dialog",children:m("Create pattern")}),i&&a.jsx(WI,{content:d,onSuccess:f=>{p(f)},onError:()=>{c(!1)},onClose:()=>{c(!1)}})]})}function iDt({clientId:e}){const{canRemove:t,isVisible:n,managePatternsUrl:o}=G(s=>{const{getBlock:i,canRemoveBlock:c,getBlockCount:l}=s(J),{canUser:u}=s(Me),d=i(e);return{canRemove:c(e),isVisible:!!d&&Qd(d)&&!!u("update",{kind:"postType",name:"wp_block",id:d.attributes.ref}),innerBlockCount:l(e),managePatternsUrl:u("create",{kind:"postType",name:"wp_template"})?tn("site-editor.php",{path:"/patterns"}):tn("edit.php",{post_type:"wp_block"})}},[e]),{convertSyncedPatternToStatic:r}=pb(Oe(Nm));return n?a.jsxs(a.Fragment,{children:[t&&a.jsx(Ct,{onClick:()=>r(e),children:m("Detach")}),a.jsx(Ct,{href:o,children:m("Manage patterns")})]}):null}function aDt({rootClientId:e}){return a.jsx(cb,{children:({selectedClientIds:t,onClose:n})=>a.jsxs(a.Fragment,{children:[a.jsx(sDt,{clientIds:t,rootClientId:e,closeBlockSettingsMenu:n}),t.length===1&&a.jsx(iDt,{clientId:t[0]})]})})}function cDt({category:e,existingCategories:t,onClose:n,onError:o,onSuccess:r,...s}){const i=x.useId(),c=x.useRef(),[l,u]=x.useState(Lt(e.name)),[d,p]=x.useState(!1),[f,b]=x.useState(!1),h=f?`patterns-rename-pattern-category-modal__validation-message-${i}`:void 0,{saveEntityRecord:g,invalidateResolution:z}=Oe(Me),{createErrorNotice:A,createSuccessNotice:_}=Oe(mt),v=k=>{f&&b(void 0),u(k)},M=async k=>{if(k.preventDefault(),!d){if(!l||l===e.name){const S=m("Please enter a new name for this category.");Yt(S,"assertive"),b(S),c.current?.focus();return}if(t.patternCategories.find(S=>S.id!==e.id&&S.label.toLowerCase()===l.toLowerCase())){const S=m("This category already exists. Please use a different name.");Yt(S,"assertive"),b(S),c.current?.focus();return}try{p(!0);const S=await g("taxonomy",hOe,{id:e.id,slug:e.slug,name:l});z("getUserPatternCategories"),r?.(S),n(),_(m("Pattern category renamed."),{type:"snackbar",id:"pattern-category-update"})}catch(S){o?.(),A(S.message,{type:"snackbar",id:"pattern-category-update"})}finally{p(!1),u("")}}},y=()=>{n(),u("")};return a.jsx(Zo,{title:m("Rename"),onRequestClose:y,...s,children:a.jsx("form",{onSubmit:M,children:a.jsxs(dt,{spacing:"5",children:[a.jsxs(dt,{spacing:"2",children:[a.jsx(dn,{ref:c,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:m("Name"),value:l,onChange:v,"aria-describedby":h,required:!0}),f&&a.jsx("span",{className:"patterns-rename-pattern-category-modal__validation-message",id:h,children:f})]}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:y,children:m("Cancel")}),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"primary",type:"submit","aria-disabled":!l||l===e.name||d,isBusy:d,children:m("Save")})]})]})})})}function lDt({placeholder:e,initialName:t="",onClose:n,onSave:o}){const[r,s]=x.useState(t),i=x.useId(),c=!!r.trim(),l=()=>{if(r!==t){const u=xe(m('Block name changed to: "%s".'),r);Yt(u,"assertive")}o(r),n()};return a.jsx(Zo,{title:m("Enable overrides"),onRequestClose:n,focusOnMount:"firstContentElement",aria:{describedby:i},size:"small",children:a.jsx("form",{onSubmit:u=>{u.preventDefault(),c&&l()},children:a.jsxs(dt,{spacing:"6",children:[a.jsx(Sn,{id:i,children:m("Overrides are changes you make to a block within a synced pattern instance. Use overrides to customize a synced pattern instance to suit its new context. Name this block to specify an override.")}),a.jsx(dn,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:r,label:m("Name"),help:m('For example, if you are creating a recipe pattern, you use "Recipe Title", "Recipe Description", etc.'),placeholder:e,onChange:s}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:n,children:m("Cancel")}),a.jsx(Ce,{__next40pxDefaultSize:!0,"aria-disabled":!c,variant:"primary",type:"submit",children:m("Enable")})]})]})})})}function uDt({onClose:e,onSave:t}){const n=x.useId();return a.jsx(Zo,{title:m("Disable overrides"),onRequestClose:e,aria:{describedby:n},size:"small",children:a.jsx("form",{onSubmit:o=>{o.preventDefault(),t(),e()},children:a.jsxs(dt,{spacing:"6",children:[a.jsx(Sn,{id:n,children:m("Are you sure you want to disable overrides? Disabling overrides will revert all applied overrides for this block throughout instances of this pattern.")}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:e,children:m("Cancel")}),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",children:m("Disable")})]})]})})})}function dDt({attributes:e,setAttributes:t,name:n}){const o=x.useId(),[r,s]=x.useState(!1),[i,c]=x.useState(!1),l=!!e.metadata?.name,u=e.metadata?.bindings?.__default,d=l&&u?.source===M4,p=u?.source&&u.source!==M4,{updateBlockBindings:f}=p_();function b(z,A){A&&t({metadata:{...e.metadata,name:A}}),f({__default:z?{source:M4}:void 0})}if(p)return null;const h=n==="core/image"&&(!!e.caption?.length||!!e.href?.length),g=m(!d&&h?"Overrides currently don't support image captions or links. Remove the caption or link first before enabling overrides.":"Allow changes to this block throughout instances of this pattern.");return a.jsxs(a.Fragment,{children:[a.jsx(et,{group:"advanced",children:a.jsx(no,{__nextHasNoMarginBottom:!0,id:o,label:m("Overrides"),help:g,children:a.jsx(Ce,{__next40pxDefaultSize:!0,className:"pattern-overrides-control__allow-overrides-button",variant:"secondary","aria-haspopup":"dialog",onClick:()=>{d?c(!0):s(!0)},disabled:!d&&h,accessibleWhenDisabled:!0,children:m(d?"Disable overrides":"Enable overrides")})})}),r&&a.jsx(lDt,{initialName:e.metadata?.name,onClose:()=>s(!1),onSave:z=>{b(!0,z)}}),i&&a.jsx(uDt,{onClose:()=>c(!1),onSave:()=>b(!1)})]})}const bT="content";function pDt(e){const t=e.attributes.metadata?.name,n=Fn(),o=G(s=>{if(!t)return;const{getBlockAttributes:i,getBlockParentsByBlockName:c}=s(J),[l]=c(e.clientId,"core/block",!0);if(!l)return;const u=i(l)[bT];if(u)return u.hasOwnProperty(t)},[e.clientId,t]);function r(){const{getBlockAttributes:s,getBlockParentsByBlockName:i}=n.select(J),[c]=i(e.clientId,"core/block",!0);if(!c)return;const l=s(c)[bT];if(!l.hasOwnProperty(t))return;const{updateBlockAttributes:u,__unstableMarkLastChangeAsPersistent:d}=n.dispatch(J);d();let p={...l};delete p[t],Object.keys(p).length||(p=void 0),u(c,{[bT]:p})}return a.jsx(eI,{children:a.jsx(Wn,{children:a.jsx(Vt,{onClick:r,disabled:!o,children:m("Reset")})})})}const{useBlockDisplayTitle:fDt}=pb(jn);function bDt({clientIds:e}){const t=e.length===1,{icon:n,firstBlockName:o}=G(c=>{const{getBlockAttributes:l,getBlockNamesByClientId:u}=c(J),{getBlockType:d,getActiveBlockVariation:p}=c(kt),f=u(e),b=f[0],h=d(b);let g;return t?g=p(b,l(e[0]))?.icon||h.icon:g=new Set(f).size===1?h.icon:H3,{icon:g,firstBlockName:l(e[0]).metadata.name}},[e,t]),r=fDt({clientId:e[0],maximumLength:35}),s=t?xe(m('This %1$s is editable using the "%2$s" override.'),r.toLowerCase(),o):m("These blocks are editable using overrides."),i=x.useId();return a.jsx(bs,{children:c=>a.jsx(c0,{className:"patterns-pattern-overrides-toolbar-indicator",label:r,popoverProps:{placement:"bottom-start",className:"patterns-pattern-overrides-toolbar-indicator__popover"},icon:a.jsx(a.Fragment,{children:a.jsx(Zn,{icon:n,className:"patterns-pattern-overrides-toolbar-indicator-icon",showColors:!0})}),toggleProps:{description:s,...c},menuProps:{orientation:"both","aria-describedby":i},children:()=>a.jsx(Sn,{id:i,children:s})})})}function hDt(){const{clientIds:e,hasPatternOverrides:t,hasParentPattern:n}=G(o=>{const{getBlockAttributes:r,getSelectedBlockClientIds:s,getBlockParentsByBlockName:i}=o(J),c=s(),l=c.every(d=>{var p;return Object.values((p=r(d)?.metadata?.bindings)!==null&&p!==void 0?p:{}).some(f=>f?.source===M4)}),u=c.every(d=>i(d,"core/block",!0).length>0);return{clientIds:c,hasPatternOverrides:l,hasParentPattern:u}},[]);return t&&n?a.jsx(bt,{group:"parent",children:a.jsx(bDt,{clientIds:e})}):null}const Vi={};Y9t(Vi,{OverridesPanel:J9t,CreatePatternModal:WI,CreatePatternModalContents:gOe,DuplicatePatternModal:oDt,isOverridableBlock:EI,hasOverridableBlocks:bOe,useDuplicatePatternProps:MOe,RenamePatternModal:rDt,PatternsMenuItems:aDt,RenamePatternCategoryModal:cDt,PatternOverridesControls:dDt,ResetOverridesControl:pDt,PatternOverridesBlockControls:hDt,useAddPatternCategory:mOe,PATTERN_TYPES:nk,PATTERN_DEFAULT_CATEGORY:pOe,PATTERN_USER_CATEGORY:I9t,EXCLUDED_PATTERN_SOURCES:D9t,PATTERN_SYNC_TYPES:oa,PARTIAL_SYNCING_SUPPORTED_BLOCKS:fOe});const{PATTERN_TYPES:mDt}=Wm(Vi);function gDt({item:e}){return a.jsx(TI,{item:e,className:"fields-field__pattern-title",children:e.type===mDt.theme&&a.jsx(B0,{placement:"top",text:m("This pattern cannot be edited."),children:a.jsx(wn,{icon:dde,size:24})})})}const MDt={type:"text",id:"title",label:m("Title"),placeholder:m("No title"),getValue:({item:e})=>Wr(e),render:gDt,enableHiding:!1,enableGlobalSearch:!0},zDt={id:"menu_order",type:"integer",label:m("Order"),description:m("Determines the order of pages.")},ODt=[],yDt=()=>{const{wp:e}=window;return e.media.view.MediaFrame.Select.extend({featuredImageToolbar(t){this.createSelectToolbar(t,{text:e.media.view.l10n.setFeaturedImage,state:this.options.state})},editState(){const t=this.state("featured-image").get("selection"),n=new e.media.view.EditImage({model:t.single(),controller:this}).render();this.content.set(n),n.loadEditor()},createStates:function(){this.on("toolbar:create:featured-image",this.featuredImageToolbar,this),this.on("content:render:edit-image",this.editState,this),this.states.add([new e.media.controller.FeaturedImage,new e.media.controller.EditImage({model:this.options.editImage})])}})},ADt=()=>{const{wp:e}=window;return e.media.view.MediaFrame.Select.extend({createStates(){const t=this.options;this.options.states||this.states.add([new e.media.controller.Library({library:e.media.query(t.library),multiple:t.multiple,title:t.title,priority:20,filterable:"uploaded"}),new e.media.controller.EditImage({model:t.editImage})])}})},vDt=()=>{const{wp:e}=window;return e.media.view.MediaFrame.Post.extend({galleryToolbar(){const t=this.state().get("editing");this.toolbar.set(new e.media.view.Toolbar({controller:this,items:{insert:{style:"primary",text:t?e.media.view.l10n.updateGallery:e.media.view.l10n.insertGallery,priority:80,requires:{library:!0},click(){const n=this.controller,o=n.state();n.close(),o.trigger("update",o.get("library")),n.setState(n.options.state),n.reset()}}}}))},editState(){const t=this.state("gallery").get("selection"),n=new e.media.view.EditImage({model:t.single(),controller:this}).render();this.content.set(n),n.loadEditor()},createStates:function(){this.on("toolbar:create:main-gallery",this.galleryToolbar,this),this.on("content:render:edit-image",this.editState,this),this.states.add([new e.media.controller.Library({id:"gallery",title:e.media.view.l10n.createGalleryTitle,priority:40,toolbar:"main-gallery",filterable:"uploaded",multiple:"add",editable:!1,library:e.media.query({type:"image",...this.options.library})}),new e.media.controller.EditImage({model:this.options.editImage}),new e.media.controller.GalleryEdit({library:this.options.selection,editing:this.options.editing,menu:"gallery",displaySettings:!1,multiple:!0}),new e.media.controller.GalleryAdd])}})},Ite=e=>["sizes","mime","type","subtype","id","url","alt","link","caption"].reduce((n,o)=>(e?.hasOwnProperty(o)&&(n[o]=e[o]),n),{}),Av=e=>{const{wp:t}=window;return t.media.query({order:"ASC",orderby:"post__in",post__in:e,posts_per_page:-1,query:!0,type:"image"})};let zOe=class extends x.Component{constructor(){super(...arguments),this.openModal=this.openModal.bind(this),this.onOpen=this.onOpen.bind(this),this.onSelect=this.onSelect.bind(this),this.onUpdate=this.onUpdate.bind(this),this.onClose=this.onClose.bind(this)}initializeListeners(){this.frame.on("select",this.onSelect),this.frame.on("update",this.onUpdate),this.frame.on("open",this.onOpen),this.frame.on("close",this.onClose)}buildAndSetGalleryFrame(){const{addToGallery:t=!1,allowedTypes:n,multiple:o=!1,value:r=ODt}=this.props;if(r===this.lastGalleryValue)return;const{wp:s}=window;this.lastGalleryValue=r,this.frame&&this.frame.remove();let i;t?i="gallery-library":i=r&&r.length?"gallery-edit":"gallery",this.GalleryDetailsMediaFrame||(this.GalleryDetailsMediaFrame=vDt());const c=Av(r),l=new s.media.model.Selection(c.models,{props:c.props.toJSON(),multiple:o});this.frame=new this.GalleryDetailsMediaFrame({mimeType:n,state:i,multiple:o,selection:l,editing:!!r?.length}),s.media.frame=this.frame,this.initializeListeners()}buildAndSetFeatureImageFrame(){const{wp:t}=window,{value:n,multiple:o,allowedTypes:r}=this.props,s=yDt(),i=Av(n),c=new t.media.model.Selection(i.models,{props:i.props.toJSON()});this.frame=new s({mimeType:r,state:"featured-image",multiple:o,selection:c,editing:n}),t.media.frame=this.frame,t.media.view.settings.post={...t.media.view.settings.post,featuredImageId:n||-1}}buildAndSetSingleMediaFrame(){const{wp:t}=window,{allowedTypes:n,multiple:o=!1,title:r=m("Select or Upload Media"),value:s}=this.props,i={title:r,multiple:o};n&&(i.library={type:n}),this.frame&&this.frame.remove();const c=ADt(),l=Av(s),u=new t.media.model.Selection(l.models,{props:l.props.toJSON()});this.frame=new c({mimeType:n,multiple:o,selection:u,...i}),t.media.frame=this.frame}componentWillUnmount(){this.frame?.remove()}onUpdate(t){const{onSelect:n,multiple:o=!1}=this.props,r=this.frame.state(),s=t||r.get("selection");!s||!s.models.length||n(o?s.models.map(i=>Ite(i.toJSON())):Ite(s.models[0].toJSON()))}onSelect(){const{onSelect:t,multiple:n=!1}=this.props,o=this.frame.state().get("selection").toJSON();t(n?o:o[0])}onOpen(){const{wp:t}=window,{value:n}=this.props;if(this.updateCollection(),this.props.mode&&this.frame.content.mode(this.props.mode),!(Array.isArray(n)?!!n?.length:!!n))return;const r=this.props.gallery,s=this.frame.state().get("selection"),i=Array.isArray(n)?n:[n];r||i.forEach(l=>{s.add(t.media.attachment(l))});const c=Av(i);c.more().done(function(){r&&c?.models?.length&&s.add(c.models)})}onClose(){const{onClose:t}=this.props;t&&t(),this.frame.detach()}updateCollection(){const t=this.frame.content.get();if(t&&t.collection){const n=t.collection;n.toArray().forEach(o=>o.trigger("destroy",o)),n.mirroring._hasMore=!0,n.more()}}openModal(){const{gallery:t=!1,unstableFeaturedImageFlow:n=!1,modalClass:o}=this.props;t?this.buildAndSetGalleryFrame():this.buildAndSetSingleMediaFrame(),o&&this.frame.$el.addClass(o),n&&this.buildAndSetFeatureImageFrame(),this.initializeListeners(),this.frame.open()}render(){return this.props.render({open:this.openModal})}};function xDt(e){return e!==null&&typeof e=="object"&&Object.getPrototypeOf(e)===Object.prototype}function NI(e,t,n){if(xDt(n))for(const[o,r]of Object.entries(n))NI(e,`${t}[${o}]`,r);else n!==void 0&&e.append(t,String(n))}function OOe(e){var t;const{alt_text:n,source_url:o,...r}=e;return{...r,alt:e.alt_text,caption:(t=e.caption?.raw)!==null&&t!==void 0?t:"",title:e.title.raw,url:e.source_url,poster:e._embedded?.["wp:featuredmedia"]?.[0]?.source_url||void 0}}async function wDt(e,t={},n){const o=new FormData;o.append("file",e,e.name||e.type.replace("/","."));for(const[r,s]of Object.entries(t))NI(o,r,s);return OOe(await Tt({path:"/wp/v2/media?_embed=wp:featuredmedia",body:o,method:"POST",signal:n}))}class Rh extends Error{constructor({code:t,message:n,file:o,cause:r}){super(n,{cause:r}),Object.setPrototypeOf(this,new.target.prototype),this.code=t,this.file=o}}function _Dt(e,t){if(!t)return;const n=t.some(o=>o.includes("/")?o===e.type:e.type.startsWith(`${o}/`));if(e.type&&!n)throw new Rh({code:"MIME_TYPE_NOT_SUPPORTED",message:xe(m("%s: Sorry, this file type is not supported here."),e.name),file:e})}function kDt(e){return e?Object.entries(e).flatMap(([t,n])=>{const[o]=n.split("/"),r=t.split("|");return[n,...r.map(s=>`${o}/${s}`)]}):null}function SDt(e,t){const n=kDt(t);if(!n)return;const o=n.includes(e.type);if(e.type&&!o)throw new Rh({code:"MIME_TYPE_NOT_ALLOWED_FOR_USER",message:xe(m("%s: Sorry, you are not allowed to upload this file type."),e.name),file:e})}function CDt(e,t){if(e.size<=0)throw new Rh({code:"EMPTY_FILE",message:xe(m("%s: This file is empty."),e.name),file:e});if(t&&e.size>t)throw new Rh({code:"SIZE_ABOVE_LIMIT",message:xe(m("%s: This file exceeds the maximum upload size for this site."),e.name),file:e})}function qDt({wpAllowedMimeTypes:e,allowedTypes:t,additionalData:n={},filesList:o,maxUploadFileSize:r,onError:s,onFileChange:i,signal:c}){const l=[],u=[],d=(p,f)=>{window.__experimentalMediaProcessing||u[p]?.url&&J4(u[p].url),u[p]=f,i?.(u.filter(b=>b!==null))};for(const p of o){try{SDt(p,e)}catch(f){s?.(f);continue}try{_Dt(p,t)}catch(f){s?.(f);continue}try{CDt(p,r)}catch(f){s?.(f);continue}l.push(p),window.__experimentalMediaProcessing||(u.push({url:ls(p)}),i?.(u))}l.map(async(p,f)=>{try{const b=await wDt(p,n,c);d(f,b)}catch(b){d(f,null);let h;b instanceof Error?h=b.message:h=xe(m("Error while uploading file %s to the media library."),p.name),s?.(new Rh({code:"GENERAL",message:h,file:p,cause:b instanceof Error?b:void 0}))}})}async function RDt(e,t,n={},o){const r=new FormData;r.append("file",e,e.name||e.type.replace("/","."));for(const[s,i]of Object.entries(n))NI(r,s,i);return OOe(await Tt({path:`/wp/v2/media/${t}/sideload`,body:r,method:"POST",signal:o}))}const TDt=()=>{};async function EDt({file:e,attachmentId:t,additionalData:n={},signal:o,onFileChange:r,onError:s=TDt}){try{const i=await RDt(e,t,n,o);r?.([i])}catch(i){let c;i instanceof Error?c=i.message:c=xe(m("Error while sideloading file %s to the server."),e.name),s(new Rh({code:"GENERAL",message:c,file:e,cause:i instanceof Error?i:void 0}))}}const{lock:WDt,unlock:Umn}=P0("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/media-utils"),yOe={};WDt(yOe,{sideloadMedia:EDt});const NDt=({data:e,field:t,onChange:n})=>{const{id:o}=t,r=t.getValue({item:e}),s=G(d=>{const{getEntityRecord:p}=d(Me);return p("root","media",r)},[r]),i=x.useCallback(d=>n({[o]:d}),[o,n]),c=s?.source_url,l=s?.title?.rendered,u=x.useRef(null);return a.jsx("fieldset",{className:"fields-controls__featured-image",children:a.jsx("div",{className:"fields-controls__featured-image-container",children:a.jsx(zOe,{onSelect:d=>{i(d.id)},allowedTypes:["image"],render:({open:d})=>a.jsx("div",{ref:u,role:"button",tabIndex:-1,onClick:()=>{d()},onKeyDown:d,children:a.jsxs(nO,{rowGap:0,columnGap:8,templateColumns:"24px 1fr 24px",children:[c&&a.jsxs(a.Fragment,{children:[a.jsx("img",{className:"fields-controls__featured-image-image",alt:"",width:24,height:24,src:c}),a.jsx("span",{className:"fields-controls__featured-image-title",children:l})]}),!c&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"fields-controls__featured-image-placeholder",style:{width:"24px",height:"24px"}}),a.jsx("span",{className:"fields-controls__featured-image-title",children:m("Choose an image…")})]}),c&&a.jsx(a.Fragment,{children:a.jsx(Ce,{size:"small",className:"fields-controls__featured-image-remove-button",icon:ude,onClick:p=>{p.stopPropagation(),i(0)}})})]})})})})})},BDt=({item:e})=>{const t=e.featured_media,o=G(r=>{const{getEntityRecord:s}=r(Me);return t?s("root","media",t):null},[t])?.source_url;return o?a.jsx("img",{className:"fields-controls__featured-image-image",src:o,alt:""}):a.jsx("span",{className:"fields-controls__featured-image-placeholder"})},LDt={id:"featured_media",type:"media",label:m("Featured Image"),Edit:NDt,render:BDt,enableSorting:!1},PDt=({data:e,field:t,onChange:n})=>{const{id:o}=t,r=e.type,s=typeof e.id=="number"?e.id:parseInt(e.id,10),i=e.slug,{availableTemplates:c,templates:l}=G(z=>{var A;const _=(A=z(Me).getEntityRecords("postType","wp_template",{per_page:-1,post_type:r}))!==null&&A!==void 0?A:[],{getHomePage:v,getPostsPageId:M}=Wm(z(Me)),y=M()===+s,k=r==="page"&&v()?.postId===+s;return{templates:_,availableTemplates:!y&&!k?_.filter(C=>C.is_custom&&C.slug!==e.template&&!!C.content.raw):[]}},[e.template,s,r]),u=x.useMemo(()=>c.map(z=>({name:z.slug,blocks:Ko(z.content.raw),title:Lt(z.title.rendered),id:z.id})),[c]),d=R4(u),p=t.getValue({item:e}),f=G(z=>{const A=l?.find(v=>v.slug===p);if(A)return A;let _;if(i?_=r==="page"?`${r}-${i}`:`single-${r}-${i}`:_=r==="page"?"page":`single-${r}`,r){const v=z(Me).getDefaultTemplateId({slug:_});return z(Me).getEntityRecord("postType","wp_template",v)}},[r,i,l,p]),[b,h]=x.useState(!1),g=x.useCallback(z=>n({[o]:z}),[o,n]);return a.jsxs("fieldset",{className:"fields-controls__template",children:[a.jsx(so,{popoverProps:{placement:"bottom-start"},renderToggle:({onToggle:z})=>a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",size:"compact",onClick:z,children:f?Wr(f):""}),renderContent:({onToggle:z})=>a.jsxs(Cn,{children:[a.jsx(Ct,{onClick:()=>{h(!0),z()},children:m("Change template")}),p!==""&&a.jsx(Ct,{onClick:()=>{g(""),z()},children:m("Use default template")})]})}),b&&a.jsx(Zo,{title:m("Choose a template"),onRequestClose:()=>h(!1),overlayClassName:"fields-controls__template-modal",isFullScreen:!0,children:a.jsx("div",{className:"fields-controls__template-content",children:a.jsx(qa,{label:m("Templates"),blockPatterns:u,shownPatterns:d,onClickPattern:z=>{g(z.name),h(!1)}})})})]})},jDt={id:"template",type:"text",label:m("Template"),Edit:PDt,enableSorting:!1};function eN(e){return typeof e.title=="object"&&"rendered"in e.title&&e.title.rendered?Lt(e.title.rendered):`#${e?.id} (${m("no title")})`}function IDt(e){const t=e.map(r=>({children:[],...r}));if(t.some(({parent:r})=>r==null))return t;const n=t.reduce((r,s)=>{const{parent:i}=s;return r[i]||(r[i]=[]),r[i].push(s),r},{}),o=r=>r.map(s=>{const i=n[s.id];return{...s,children:i&&i.length?o(i):[]}});return o(n[0]||[])}const Dte=(e,t)=>{const n=ms(e||"").toLowerCase(),o=ms(t||"").toLowerCase();return n===o?0:n.startsWith(o)?n.length:1/0};function DDt({data:e,onChangeControl:t}){const[n,o]=x.useState(null),r=e.parent,s=e.id,i=e.type,{parentPostTitle:c,pageItems:l,isHierarchical:u}=G(b=>{const{getEntityRecord:h,getEntityRecords:g,getPostType:z}=b(Me),A=z(i),_=A?.hierarchical&&A.viewable,v=r?h("postType",i,r):null,M={per_page:100,exclude:s,parent_exclude:s,orderby:"menu_order",order:"asc",_fields:"id,title,parent",...n!==null&&{search:n}};return{isHierarchical:_,parentPostTitle:v?eN(v):"",pageItems:_?g("postType",i,M):null}},[n,r,s,i]),d=x.useMemo(()=>{const b=(A,_=0)=>A.map(y=>[{value:y.id,label:"— ".repeat(_)+Lt(y.name),rawName:y.name},...b(y.children||[],_+1)]).sort(([y],[k])=>{const S=Dte(y.rawName,n??""),C=Dte(k.rawName,n??"");return S>=C?1:-1}).flat();if(!l)return[];let h=l.map(A=>{var _;return{id:A.id,parent:(_=A.parent)!==null&&_!==void 0?_:null,name:eN(A)}});n||(h=IDt(h));const g=b(h),z=g.find(A=>A.value===r);return r&&c&&!z&&g.unshift({value:r,label:c,rawName:""}),g.map(A=>({...A,value:A.value.toString()}))},[l,n,c,r]);if(!u)return null;const p=b=>{o(b)},f=b=>{if(b){var h;return t((h=parseInt(b,10))!==null&&h!==void 0?h:0)}t(0)};return a.jsx(nb,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:m("Parent"),help:m("Choose a parent page."),value:r?.toString(),options:d,onFilterValueChange:F1(b=>p(b),300),onChange:f,hideLabelFromVision:!0})}const FDt=({data:e,field:t,onChange:n})=>{const{id:o}=t,r=G(i=>i(Me).getEntityRecord("root","__unstableBase")?.home,[]),s=x.useCallback(i=>n({[o]:i}),[o,n]);return a.jsx("fieldset",{className:"fields-controls__parent",children:a.jsxs("div",{children:[cr(xe(m('Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %1$s/services/pricing.'),Ph(r).replace(/([/.])/g,"$1")),{wbr:a.jsx("wbr",{})}),a.jsx("p",{children:cr(m("They also show up as sub-items in the default navigation menu. Learn more."),{a:a.jsx(hr,{href:m("https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes"),children:void 0})})}),a.jsx(DDt,{data:e,onChangeControl:s})]})})},$Dt=({item:e})=>{const t=G(n=>{const{getEntityRecord:o}=n(Me);return e?.parent?o("postType",e.type,e.parent):null},[e.parent,e.type]);return t?a.jsx(a.Fragment,{children:eN(t)}):a.jsx(a.Fragment,{children:m("None")})},VDt={id:"parent",type:"text",label:m("Parent"),Edit:FDt,render:$Dt,enableSorting:!0};function HDt({data:e,onChange:t,field:n}){const[o,r]=x.useState(!!n.getValue({item:e})),s=i=>{r(i),i||t({password:""})};return a.jsxs(dt,{as:"fieldset",spacing:4,className:"fields-controls__password",children:[a.jsx(K0,{__nextHasNoMarginBottom:!0,label:m("Password protected"),help:m("Only visible to those who know the password"),checked:o,onChange:s}),o&&a.jsx("div",{className:"fields-controls__password-input",children:a.jsx(dn,{label:m("Password"),onChange:i=>t({password:i}),value:n.getValue({item:e})||"",placeholder:m("Use a secure password"),type:"text",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,maxLength:255})})]})}const UDt={id:"password",type:"text",Edit:HDt,enableSorting:!1,enableHiding:!1,isVisible:e=>e.status!=="private"},AOe=[{value:"draft",label:m("Draft"),icon:E8,description:m("Not ready to publish.")},{value:"future",label:m("Scheduled"),icon:Nde,description:m("Publish automatically on a chosen date.")},{value:"pending",label:m("Pending Review"),icon:gde,description:m("Waiting for review before publishing.")},{value:"private",label:m("Private"),icon:bde,description:m("Only visible to site admins and editors.")},{value:"publish",label:m("Published"),icon:Lw,description:m("Visible to everyone.")},{value:"trash",label:m("Trash"),icon:K3}];function XDt({item:e}){const t=AOe.find(({value:r})=>r===e.status),n=t?.label||e.status,o=t?.icon;return a.jsxs(Ot,{alignment:"left",spacing:0,children:[o&&a.jsx("div",{className:"edit-site-post-list__status-icon",children:a.jsx(qo,{icon:o})}),a.jsx("span",{children:n})]})}const GDt="isAny",KDt={label:m("Status"),id:"status",type:"text",elements:AOe,render:XDt,Edit:"radio",enableSorting:!1,filterBy:{operators:[GDt]}},YDt={id:"comment_status",label:m("Discussion"),type:"text",Edit:"radio",enableSorting:!1,filterBy:{operators:[]},elements:[{value:"open",label:m("Open"),description:m("Visitors can add new comments and replies.")},{value:"closed",label:m("Closed"),description:m("Visitors cannot add new comments or replies. Existing comments remain visible.")}]},Vg=e=>r0(Sa().formats.datetimeAbbreviated,_f(e)),ZDt=({item:e})=>{var t,n,o,r;if(["draft","private"].includes((t=e.status)!==null&&t!==void 0?t:"")){var i;return cr(xe(m("Modified: "),Vg((i=e.date)!==null&&i!==void 0?i:null)),{span:a.jsx("span",{}),time:a.jsx("time",{})})}if(e.status==="future"){var l;return cr(xe(m("Scheduled: "),Vg((l=e.date)!==null&&l!==void 0?l:null)),{span:a.jsx("span",{}),time:a.jsx("time",{})})}if(e.status==="publish"){var d;return cr(xe(m("Published: "),Vg((d=e.date)!==null&&d!==void 0?d:null)),{span:a.jsx("span",{}),time:a.jsx("time",{})})}const p=_f((n=e.modified)!==null&&n!==void 0?n:null)>_f((o=e.date)!==null&&o!==void 0?o:null)?e.modified:e.date;return e.status==="pending"?cr(xe(m("Modified: "),Vg(p??null)),{span:a.jsx("span",{}),time:a.jsx("time",{})}):a.jsx("time",{children:Vg((r=e.date)!==null&&r!==void 0?r:null)})},QDt={id:"date",type:"datetime",label:m("Date"),render:ZDt};function JDt({item:e}){const{text:t,imageUrl:n}=G(s=>{const{getEntityRecord:i}=s(Me);let c;return e.author&&(c=i("root","user",e.author)),{imageUrl:c?.avatar_urls?.[48],text:c?.name}},[e]),[o,r]=x.useState(!1);return a.jsxs(Ot,{alignment:"left",spacing:0,children:[!!n&&a.jsx("div",{className:oe("page-templates-author-field__avatar",{"is-loaded":o}),children:a.jsx("img",{onLoad:()=>r(!0),alt:m("Author avatar"),src:n})}),!n&&a.jsx("div",{className:"page-templates-author-field__icon",children:a.jsx(qo,{icon:TP})}),a.jsx("span",{className:"page-templates-author-field__name",children:t})]})}const eFt={label:m("Author"),id:"author",type:"integer",elements:[],render:JDt,sort:(e,t,n)=>{const o=e._embedded?.author?.[0]?.name||"",r=t._embedded?.author?.[0]?.name||"";return n==="asc"?o.localeCompare(r):r.localeCompare(o)}},tFt={id:"view-post",label:We("View","verb"),isPrimary:!0,icon:vf,isEligible(e){return e.status!=="trash"},callback(e,{onActionPerformed:t}){const n=e[0];window.open(n?.link,"_blank"),t&&t(e)}};function nFt(e,t,n){return n==="asc"?e-t:t-e}function oFt(e,t){return!(e===""||!Number.isInteger(Number(e))||t?.elements&&!(t?.elements.map(o=>o.value)).includes(Number(e)))}const rFt={sort:nFt,isValid:oFt,Edit:"integer"};function sFt(e,t,n){return n==="asc"?e.localeCompare(t):t.localeCompare(e)}function iFt(e,t){return!(t?.elements&&!(t?.elements?.map(o=>o.value)).includes(e))}const aFt={sort:sFt,isValid:iFt,Edit:"text"};function cFt(e,t,n){const o=new Date(e).getTime(),r=new Date(t).getTime();return n==="asc"?o-r:r-o}function lFt(e,t){return!(t?.elements&&!(t?.elements.map(o=>o.value)).includes(e))}const uFt={sort:cFt,isValid:lFt,Edit:"datetime"};function dFt(e){return e==="integer"?rFt:e==="text"?aFt:e==="datetime"?uFt:{sort:(t,n,o)=>typeof t=="number"&&typeof n=="number"?o==="asc"?t-n:n-t:o==="asc"?t.localeCompare(n):n.localeCompare(t),isValid:(t,n)=>!(n?.elements&&!(n?.elements?.map(r=>r.value)).includes(t)),Edit:()=>null}}function pFt({data:e,field:t,onChange:n,hideLabelFromVision:o}){const{id:r,label:s}=t,i=t.getValue({item:e}),c=x.useCallback(l=>n({[r]:l}),[r,n]);return a.jsxs("fieldset",{className:"dataviews-controls__datetime",children:[!o&&a.jsx(no.VisualLabel,{as:"legend",children:s}),o&&a.jsx(qn,{as:"legend",children:s}),a.jsx(lO,{currentTime:i,onChange:c,hideLabelFromVision:!0})]})}function fFt({data:e,field:t,onChange:n,hideLabelFromVision:o}){var r;const{id:s,label:i,description:c}=t,l=(r=t.getValue({item:e}))!==null&&r!==void 0?r:"",u=x.useCallback(d=>n({[s]:Number(d)}),[s,n]);return a.jsx(g0,{label:i,help:c,value:l,onChange:u,__next40pxDefaultSize:!0,hideLabelFromVision:o})}function bFt({data:e,field:t,onChange:n,hideLabelFromVision:o}){const{id:r,label:s}=t,i=t.getValue({item:e}),c=x.useCallback(l=>n({[r]:l}),[r,n]);return t.elements?a.jsx(sb,{label:s,onChange:c,options:t.elements,selected:i,hideLabelFromVision:o}):null}function hFt({data:e,field:t,onChange:n,hideLabelFromVision:o}){var r,s;const{id:i,label:c}=t,l=(r=t.getValue({item:e}))!==null&&r!==void 0?r:"",u=x.useCallback(p=>n({[i]:p}),[i,n]),d=[{label:m("Select item"),value:""},...(s=t?.elements)!==null&&s!==void 0?s:[]];return a.jsx(Pn,{label:c,value:l,options:d,onChange:u,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:o})}function mFt({data:e,field:t,onChange:n,hideLabelFromVision:o}){const{id:r,label:s,placeholder:i}=t,c=t.getValue({item:e}),l=x.useCallback(u=>n({[r]:u}),[r,n]);return a.jsx(dn,{label:s,placeholder:i,value:c??"",onChange:l,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:o})}const Fte={datetime:pFt,integer:fFt,radio:bFt,select:hFt,text:mFt};function gFt(e,t){return typeof e.Edit=="function"?e.Edit:typeof e.Edit=="string"?hT(e.Edit):e.elements?hT("select"):typeof t.Edit=="string"?hT(t.Edit):t.Edit}function hT(e){if(Object.keys(Fte).includes(e))return Fte[e];throw"Control "+e+" not found"}const MFt=e=>({item:t})=>{const n=e.split(".");let o=t;for(const r of n)o.hasOwnProperty(r)?o=o[r]:o=void 0;return o};function vOe(e){return e.map(t=>{var n,o,r,s;const i=dFt(t.type),c=t.getValue||MFt(t.id),l=(n=t.sort)!==null&&n!==void 0?n:function(h,g,z){return i.sort(c({item:h}),c({item:g}),z)},u=(o=t.isValid)!==null&&o!==void 0?o:function(h,g){return i.isValid(c({item:h}),g)},d=gFt(t,i),p=({item:b})=>{const h=c({item:b});return t?.elements?.find(g=>g.value===h)?.label||c({item:b})},f=t.render||(t.elements?p:c);return{...t,label:t.label||t.id,header:t.header||t.label||t.id,getValue:c,render:f,sort:l,isValid:u,Edit:d,enableHiding:(r=t.enableHiding)!==null&&r!==void 0?r:!0,enableSorting:(s=t.enableSorting)!==null&&s!==void 0?s:!0}})}const ok=x.createContext({fields:[]});function zFt({fields:e,children:t}){return a.jsx(ok.Provider,{value:{fields:e},children:t})}function hd(e){return e.children!==void 0}function OFt({title:e}){return a.jsx(dt,{className:"dataforms-layouts-regular__header",spacing:4,children:a.jsxs(Ot,{alignment:"center",children:[a.jsx(_a,{level:2,size:13,children:e}),a.jsx(t1,{})]})})}function yFt({data:e,field:t,onChange:n,hideLabelFromVision:o}){var r;const{fields:s}=x.useContext(ok),i=x.useMemo(()=>hd(t)?{fields:t.children.map(u=>typeof u=="string"?{id:u}:u),type:"regular"}:{type:"regular",fields:[]},[t]);if(hd(t))return a.jsxs(a.Fragment,{children:[!o&&t.label&&a.jsx(OFt,{title:t.label}),a.jsx(BI,{data:e,form:i,onChange:n})]});const c=(r=t.labelPosition)!==null&&r!==void 0?r:"top",l=s.find(u=>u.id===t.id);return l?c==="side"?a.jsxs(Ot,{className:"dataforms-layouts-regular__field",children:[a.jsx("div",{className:"dataforms-layouts-regular__field-label",children:l.label}),a.jsx("div",{className:"dataforms-layouts-regular__field-control",children:a.jsx(l.Edit,{data:e,field:l,onChange:n,hideLabelFromVision:!0},l.id)})]}):a.jsx("div",{className:"dataforms-layouts-regular__field",children:a.jsx(l.Edit,{data:e,field:l,onChange:n,hideLabelFromVision:c==="none"?!0:o})}):null}function AFt({title:e,onClose:t}){return a.jsx(dt,{className:"dataforms-layouts-panel__dropdown-header",spacing:4,children:a.jsxs(Ot,{alignment:"center",children:[e&&a.jsx(_a,{level:2,size:13,children:e}),a.jsx(t1,{}),t&&a.jsx(Ce,{label:m("Close"),icon:rp,onClick:t,size:"small"})]})})}function mT({fieldDefinition:e,popoverAnchor:t,labelPosition:n="side",data:o,onChange:r,field:s}){const i=hd(s)?s.label:e?.label,c=x.useMemo(()=>hd(s)?{type:"regular",fields:s.children.map(u=>typeof u=="string"?{id:u}:u)}:{type:"regular",fields:[{id:s.id}]},[s]),l=x.useMemo(()=>({anchor:t,placement:"left-start",offset:36,shift:!0}),[t]);return a.jsx(so,{contentClassName:"dataforms-layouts-panel__field-dropdown",popoverProps:l,focusOnMount:!0,toggleProps:{size:"compact",variant:"tertiary",tooltipPosition:"middle left"},renderToggle:({isOpen:u,onToggle:d})=>a.jsx(Ce,{className:"dataforms-layouts-panel__field-control",size:"compact",variant:["none","top"].includes(n)?"link":"tertiary","aria-expanded":u,"aria-label":xe(We("Edit %s","field"),i),onClick:d,children:a.jsx(e.render,{item:o})}),renderContent:({onClose:u})=>a.jsxs(a.Fragment,{children:[a.jsx(AFt,{title:i,onClose:u}),a.jsx(BI,{data:o,form:c,onChange:r,children:(d,p)=>{var f;return a.jsx(d,{data:o,field:p,onChange:r,hideLabelFromVision:((f=c?.fields)!==null&&f!==void 0?f:[]).length<2},p.id)}})]})})}function vFt({data:e,field:t,onChange:n}){var o;const{fields:r}=x.useContext(ok),s=r.find(d=>{if(hd(t)){const p=t.children.filter(b=>typeof b=="string"||!hd(b)),f=typeof p[0]=="string"?p[0]:p[0].id;return d.id===f}return d.id===t.id}),i=(o=t.labelPosition)!==null&&o!==void 0?o:"side",[c,l]=x.useState(null);if(!s)return null;const u=hd(t)?t.label:s?.label;return i==="top"?a.jsxs(dt,{className:"dataforms-layouts-panel__field",spacing:0,children:[a.jsx("div",{className:"dataforms-layouts-panel__field-label",style:{paddingBottom:0},children:u}),a.jsx("div",{className:"dataforms-layouts-panel__field-control",children:a.jsx(mT,{field:t,popoverAnchor:c,fieldDefinition:s,data:e,onChange:n,labelPosition:i})})]}):i==="none"?a.jsx("div",{className:"dataforms-layouts-panel__field",children:a.jsx(mT,{field:t,popoverAnchor:c,fieldDefinition:s,data:e,onChange:n,labelPosition:i})}):a.jsxs(Ot,{ref:l,className:"dataforms-layouts-panel__field",children:[a.jsx("div",{className:"dataforms-layouts-panel__field-label",children:u}),a.jsx("div",{className:"dataforms-layouts-panel__field-control",children:a.jsx(mT,{field:t,popoverAnchor:c,fieldDefinition:s,data:e,onChange:n,labelPosition:i})})]})}const xFt=[{type:"regular",component:yFt},{type:"panel",component:vFt}];function wFt(e){return xFt.find(t=>t.type===e)}function _Ft(e){var t,n,o;let r="regular";["regular","panel"].includes((t=e.type)!==null&&t!==void 0?t:"")&&(r=e.type);const s=(n=e.labelPosition)!==null&&n!==void 0?n:r==="regular"?"top":"side";return((o=e.fields)!==null&&o!==void 0?o:[]).map(i=>{var c,l;if(typeof i=="string")return{id:i,layout:r,labelPosition:s};const u=(c=i.layout)!==null&&c!==void 0?c:r,d=(l=i.labelPosition)!==null&&l!==void 0?l:u==="regular"?"top":"side";return{...i,layout:u,labelPosition:d}})}function BI({data:e,form:t,onChange:n,children:o}){const{fields:r}=x.useContext(ok);function s(c){const l=typeof c=="string"?c:c.id;return r.find(u=>u.id===l)}const i=x.useMemo(()=>_Ft(t),[t]);return a.jsx(dt,{spacing:2,children:i.map(c=>{const l=wFt(c.layout)?.component;if(!l)return null;const u=hd(c)?void 0:s(c);return u&&u.isVisible&&!u.isVisible(e)?null:o?o(l,c):a.jsx(l,{data:e,field:c,onChange:n},c.id)})})}function xOe({data:e,form:t,fields:n,onChange:o}){const r=x.useMemo(()=>vOe(n),[n]);return t.fields?a.jsx(zFt,{fields:r,children:a.jsx(BI,{data:e,form:t,onChange:o})}):null}function $te(e,t,n){return vOe(t.filter(({id:r})=>!!n.fields?.includes(r))).every(r=>r.isValid(e,{elements:r.elements}))}const gT=[zDt],MT={fields:["menu_order"]};function kFt({items:e,closeModal:t,onActionPerformed:n}){const[o,r]=x.useState(e[0]),s=o.menu_order,{editEntityRecord:i,saveEditedEntityRecord:c}=Oe(Me),{createSuccessNotice:l,createErrorNotice:u}=Oe(mt);async function d(f){if(f.preventDefault(),!!$te(o,gT,MT))try{await i("postType",o.type,o.id,{menu_order:s}),t?.(),await c("postType",o.type,o.id,{throwOnError:!0}),l(m("Order updated."),{type:"snackbar"}),n?.(e)}catch(b){const h=b,g=h.message&&h.code!=="unknown_error"?h.message:m("An error occurred while updating the order");u(g,{type:"snackbar"})}}const p=!$te(o,gT,MT);return a.jsx("form",{onSubmit:d,children:a.jsxs(dt,{spacing:"5",children:[a.jsx("div",{children:m("Determines the order of pages. Pages with the same order value are sorted alphabetically. Negative order values are supported.")}),a.jsx(xOe,{data:o,fields:gT,form:MT,onChange:f=>r({...o,...f})}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},children:m("Cancel")}),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",accessibleWhenDisabled:!0,disabled:p,children:m("Save")})]})]})})}const SFt={id:"order-pages",label:m("Order"),isEligible({status:e}){return e!=="trash"},RenderModal:kFt},CFt=[dOe],qFt={fields:["title"]},RFt={id:"duplicate-post",label:We("Duplicate","action label"),isEligible({status:e}){return e!=="trash"},RenderModal:({items:e,closeModal:t,onActionPerformed:n})=>{const[o,r]=x.useState({...e[0],title:xe(We("%s (Copy)","post"),Wr(e[0]))}),[s,i]=x.useState(!1),{saveEntityRecord:c}=Oe(Me),{createSuccessNotice:l,createErrorNotice:u}=Oe(mt);async function d(p){if(p.preventDefault(),s)return;const f={status:"draft",title:o.title,slug:o.title||m("No title"),comment_status:o.comment_status,content:typeof o.content=="string"?o.content:o.content.raw,excerpt:typeof o.excerpt=="string"?o.excerpt:o.excerpt?.raw,meta:o.meta,parent:o.parent,password:o.password,template:o.template,format:o.format,featured_media:o.featured_media,menu_order:o.menu_order,ping_status:o.ping_status},b="wp:action-assign-";Object.keys(o?._links||{}).filter(g=>g.startsWith(b)).map(g=>g.slice(b.length)).forEach(g=>{o.hasOwnProperty(g)&&(f[g]=o[g])}),i(!0);try{const g=await c("postType",o.type,f,{throwOnError:!0});l(xe(m('"%s" successfully created.'),Lt(g.title?.rendered||o.title)),{id:"duplicate-post-action",type:"snackbar"}),n&&n([g])}catch(g){const z=g,A=z.message&&z.code!=="unknown_error"?z.message:m("An error occurred while duplicating the page.");u(A,{type:"snackbar"})}finally{i(!1),t?.()}}return a.jsx("form",{onSubmit:d,children:a.jsxs(dt,{spacing:3,children:[a.jsx(xOe,{data:o,fields:CFt,form:qFt,onChange:p=>r(f=>({...f,...p}))}),a.jsxs(Ot,{spacing:2,justify:"end",children:[a.jsx(Ce,{variant:"tertiary",onClick:t,__next40pxDefaultSize:!0,children:m("Cancel")}),a.jsx(Ce,{variant:"primary",type:"submit",isBusy:s,"aria-disabled":s,__next40pxDefaultSize:!0,children:We("Duplicate","action label")})]})]})})}},{PATTERN_TYPES:Vte}=Wm(Vi),TFt={id:"rename-post",label:m("Rename"),isEligible(e){return e.status==="trash"?!1:["wp_template","wp_template_part",...Object.values(Vte)].includes(e.type)?q9t(e)?aOe(e)&&e.is_custom&&e.permissions?.update:R9t(e)?e.source==="custom"&&!e?.has_theme_file&&e.permissions?.update:e.type===Vte.user&&e.permissions?.update:e.permissions?.update},RenderModal:({items:e,closeModal:t,onActionPerformed:n})=>{const[o]=e,[r,s]=x.useState(()=>Wr(o)),{editEntityRecord:i,saveEditedEntityRecord:c}=Oe(Me),{createSuccessNotice:l,createErrorNotice:u}=Oe(mt);async function d(p){p.preventDefault();try{await i("postType",o.type,o.id,{title:r}),s(""),t?.(),await c("postType",o.type,o.id,{throwOnError:!0}),l(m("Name updated"),{type:"snackbar"}),n?.(e)}catch(f){const b=f,h=b.message&&b.code!=="unknown_error"?b.message:m("An error occurred while updating the name");u(h,{type:"snackbar"})}}return a.jsx("form",{onSubmit:d,children:a.jsxs(dt,{spacing:"5",children:[a.jsx(dn,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:m("Name"),value:r,onChange:s,required:!0}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},children:m("Cancel")}),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",children:m("Save")})]})]})})}},EFt=e=>e?e.source==="custom"&&(!!e?.plugin||e?.has_theme_file):!1,WFt=async(e,{allowUndo:t=!0}={})=>{const n="edit-site-template-reverted";if(kr(mt).removeNotice(n),!EFt(e)){kr(mt).createErrorNotice(m("This template is not revertable."),{type:"snackbar"});return}try{const o=uo(Me).getEntityConfig("postType",e.type);if(!o){kr(mt).createErrorNotice(m("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});return}const r=tn(`${o.baseURL}/${e.id}`,{context:"edit",source:e.origin}),s=await Tt({path:r});if(!s){kr(mt).createErrorNotice(m("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});return}const i=({blocks:u=[]})=>Jd(u),c=uo(Me).getEditedEntityRecord("postType",e.type,e.id);kr(Me).editEntityRecord("postType",e.type,e.id,{content:i,blocks:c.blocks,source:"custom"},{undoIgnore:!0});const l=Ko(s?.content?.raw);if(kr(Me).editEntityRecord("postType",e.type,s.id,{content:i,blocks:l,source:"theme"}),t){const u=()=>{kr(Me).editEntityRecord("postType",e.type,c.id,{content:i,blocks:c.blocks,source:"custom"})};kr(mt).createSuccessNotice(m("Template reset."),{type:"snackbar",id:n,actions:[{label:m("Undo"),onClick:u}]})}}catch(o){const r=o.message&&o.code!=="unknown_error"?o.message:m("Template revert failed. Please reload.");kr(mt).createErrorNotice(r,{type:"snackbar"})}},NFt={id:"reset-post",label:m("Reset"),isEligible:e=>qh(e)&&e?.source==="custom"&&(!!(e.type==="wp_template"&&e?.plugin)||e?.has_theme_file),icon:Xue,supportsBulk:!0,hideModalHeader:!0,RenderModal:({items:e,closeModal:t,onActionPerformed:n})=>{const[o,r]=x.useState(!1),{saveEditedEntityRecord:s}=Oe(Me),{createSuccessNotice:i,createErrorNotice:c}=Oe(mt),l=async()=>{try{for(const u of e)await WFt(u,{allowUndo:!1}),await s("postType",u.type,u.id);i(e.length>1?xe(m("%s items reset."),e.length):xe(m('"%s" reset.'),Wr(e[0])),{type:"snackbar",id:"revert-template-action"})}catch(u){let d;e[0].type==="wp_template"?d=e.length===1?m("An error occurred while reverting the template."):m("An error occurred while reverting the templates."):d=e.length===1?m("An error occurred while reverting the template part."):m("An error occurred while reverting the template parts.");const p=u,f=p.message&&p.code!=="unknown_error"?p.message:d;c(f,{type:"snackbar"})}};return a.jsxs(dt,{spacing:"5",children:[a.jsx(Sn,{children:m("Reset to default and clear all customizations?")}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,disabled:o,accessibleWhenDisabled:!0,children:m("Cancel")}),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"primary",onClick:async()=>{r(!0),await l(),n?.(e),r(!1),t?.()},isBusy:o,disabled:o,accessibleWhenDisabled:!0,children:m("Reset")})]})]})}},{CreatePatternModalContents:BFt,useDuplicatePatternProps:LFt}=Wm(Vi),PFt={id:"duplicate-pattern",label:We("Duplicate","action label"),isEligible:e=>e.type!=="wp_template_part",modalHeader:We("Duplicate pattern","action label"),RenderModal:({items:e,closeModal:t})=>{const[n]=e,o=LFt({pattern:n,onSuccess:()=>t?.()});return a.jsx(BFt,{onClose:t,confirmLabel:We("Duplicate","action label"),...o})}};"stream"in Blob.prototype||Object.defineProperty(Blob.prototype,"stream",{value(){return new Response(this).body}}),"setBigUint64"in DataView.prototype||Object.defineProperty(DataView.prototype,"setBigUint64",{value(e,t,n){const o=Number(0xffffffffn&t),r=Number(t>>32n);this.setUint32(e+(n?0:4),o,n),this.setUint32(e+(n?4:0),r,n)}});var Th=e=>new DataView(new ArrayBuffer(e)),Vl=e=>new Uint8Array(e.buffer||e),v2=e=>new TextEncoder().encode(String(e)),uf=e=>Math.min(4294967295,Number(e)),Hte=e=>Math.min(65535,Number(e));function jFt(e,t){if(t===void 0||t instanceof Date||(t=new Date(t)),e instanceof File)return{isFile:1,t:t||new Date(e.lastModified),i:e.stream()};if(e instanceof Response)return{isFile:1,t:t||new Date(e.headers.get("Last-Modified")||Date.now()),i:e.body};if(t===void 0)t=new Date;else if(isNaN(t))throw new Error("Invalid modification date.");if(e===void 0)return{isFile:0,t};if(typeof e=="string")return{isFile:1,t,i:v2(e)};if(e instanceof Blob)return{isFile:1,t,i:e.stream()};if(e instanceof Uint8Array||e instanceof ReadableStream)return{isFile:1,t,i:e};if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return{isFile:1,t,i:Vl(e)};if(Symbol.asyncIterator in e)return{isFile:1,t,i:wOe(e[Symbol.asyncIterator]())};throw new TypeError("Unsupported input format.")}function wOe(e,t=e){return new ReadableStream({async pull(n){let o=0;for(;n.desiredSize>o;){const r=await e.next();if(!r.value){n.close();break}{const s=IFt(r.value);n.enqueue(s),o+=s.byteLength}}},cancel(n){t.throw?.(n)}})}function IFt(e){return typeof e=="string"?v2(e):e instanceof Uint8Array?e:Vl(e)}function _Oe(e,t,n){let[o,r]=function(s){return s?s instanceof Uint8Array?[s,1]:ArrayBuffer.isView(s)||s instanceof ArrayBuffer?[Vl(s),1]:[v2(s),0]:[void 0,0]}(t);if(e instanceof File)return{o:zT(o||v2(e.name)),u:BigInt(e.size),l:r};if(e instanceof Response){const s=e.headers.get("content-disposition"),i=s&&s.match(/;\s*filename\*?\s*=\s*(?:UTF-\d+''|)["']?([^;"'\r\n]*)["']?(?:;|$)/i),c=i&&i[1]||e.url&&new URL(e.url).pathname.split("/").findLast(Boolean),l=c&&decodeURIComponent(c),u=n||+e.headers.get("content-length");return{o:zT(o||v2(l)),u:BigInt(u),l:r}}return o=zT(o,e!==void 0||n!==void 0),typeof e=="string"?{o,u:BigInt(v2(e).length),l:r}:e instanceof Blob?{o,u:BigInt(e.size),l:r}:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?{o,u:BigInt(e.byteLength),l:r}:{o,u:DFt(e,n),l:r}}function DFt(e,t){return t>-1?BigInt(t):e?void 0:0n}function zT(e,t=1){if(!e||e.every(n=>n===47))throw new Error("The file must have a name.");if(t)for(;e[e.length-1]===47;)e=e.subarray(0,-1);else e[e.length-1]!==47&&(e=new Uint8Array([...e,47]));return e}var kOe=new Uint32Array(256);for(let e=0;e<256;++e){let t=e;for(let n=0;n<8;++n)t=t>>>1^(1&t&&3988292384);kOe[e]=t}function Ute(e,t=0){t^=-1;for(var n=0,o=e.length;n>>8^kOe[255&t^e[n]];return(-1^t)>>>0}function SOe(e,t,n=0){const o=e.getSeconds()>>1|e.getMinutes()<<5|e.getHours()<<11,r=e.getDate()|e.getMonth()+1<<5|e.getFullYear()-1980<<9;t.setUint16(n,o,1),t.setUint16(n+2,r,1)}function FFt({o:e,l:t},n){return 8*(!t||(n??function(o){try{$Ft.decode(o)}catch{return 0}return 1}(e)))}var $Ft=new TextDecoder("utf8",{fatal:1});function VFt(e,t=0){const n=Th(30);return n.setUint32(0,1347093252),n.setUint32(4,754976768|t),SOe(e.t,n,10),n.setUint16(26,e.o.length,1),Vl(n)}async function*HFt(e){let{i:t}=e;if("then"in t&&(t=await t),t instanceof Uint8Array)yield t,e.m=Ute(t,0),e.u=BigInt(t.length);else{e.u=0n;const n=t.getReader();for(;;){const{value:o,done:r}=await n.read();if(r)break;e.m=Ute(o,e.m),e.u+=BigInt(o.length),yield o}}}function UFt(e,t){const n=Th(16+(t?8:0));return n.setUint32(0,1347094280),n.setUint32(4,e.isFile?e.m:0,1),t?(n.setBigUint64(8,e.u,1),n.setBigUint64(16,e.u,1)):(n.setUint32(8,uf(e.u),1),n.setUint32(12,uf(e.u),1)),Vl(n)}function XFt(e,t,n=0,o=0){const r=Th(46);return r.setUint32(0,1347092738),r.setUint32(4,755182848),r.setUint16(8,2048|n),SOe(e.t,r,12),r.setUint32(16,e.isFile?e.m:0,1),r.setUint32(20,uf(e.u),1),r.setUint32(24,uf(e.u),1),r.setUint16(28,e.o.length,1),r.setUint16(30,o,1),r.setUint16(40,e.isFile?33204:16893,1),r.setUint32(42,uf(t),1),Vl(r)}function GFt(e,t,n){const o=Th(n);return o.setUint16(0,1,1),o.setUint16(2,n-4,1),16&n&&(o.setBigUint64(4,e.u,1),o.setBigUint64(12,e.u,1)),o.setBigUint64(n-8,t,1),Vl(o)}function COe(e){return e instanceof File||e instanceof Response?[[e],[e]]:[[e.input,e.name,e.size],[e.input,e.lastModified]]}var KFt=e=>function(t){let n=BigInt(22),o=0n,r=0;for(const s of t){if(!s.o)throw new Error("Every file must have a non-empty name.");if(s.u===void 0)throw new Error(`Missing size for file "${new TextDecoder().decode(s.o)}".`);const i=s.u>=0xffffffffn,c=o>=0xffffffffn;o+=BigInt(46+s.o.length+(i&&8))+s.u,n+=BigInt(s.o.length+46+(12*c|28*i)),r||(r=i)}return(r||o>=0xffffffffn)&&(n+=BigInt(76)),n+o}(function*(t){for(const n of t)yield _Oe(...COe(n)[0])}(e));function YFt(e,t={}){const n={"Content-Type":"application/zip","Content-Disposition":"attachment"};return(typeof t.length=="bigint"||Number.isInteger(t.length))&&t.length>0&&(n["Content-Length"]=String(t.length)),t.metadata&&(n["Content-Length"]=String(KFt(t.metadata))),new Response(ZFt(e,t),{headers:n})}function ZFt(e,t={}){const n=function(o){const r=o[Symbol.iterator in o?Symbol.iterator:Symbol.asyncIterator]();return{async next(){const s=await r.next();if(s.done)return s;const[i,c]=COe(s.value);return{done:0,value:Object.assign(jFt(...c),_Oe(...i))}},throw:r.throw?.bind(r),[Symbol.asyncIterator](){return this}}}(e);return wOe(async function*(o,r){const s=[];let i=0n,c=0n,l=0;for await(const p of o){const f=FFt(p,r.buffersAreUTF8);yield VFt(p,f),yield new Uint8Array(p.o),p.isFile&&(yield*HFt(p));const b=p.u>=0xffffffffn,h=12*(i>=0xffffffffn)|28*b;yield UFt(p,b),s.push(XFt(p,i,f,h)),s.push(p.o),h&&s.push(GFt(p,i,h)),b&&(i+=8n),c++,i+=BigInt(46+p.o.length)+p.u,l||(l=b)}let u=0n;for(const p of s)yield p,u+=BigInt(p.length);if(l||i>=0xffffffffn){const p=Th(76);p.setUint32(0,1347094022),p.setBigUint64(4,BigInt(44),1),p.setUint32(12,755182848),p.setBigUint64(24,c,1),p.setBigUint64(32,c,1),p.setBigUint64(40,u,1),p.setBigUint64(48,i,1),p.setUint32(56,1347094023),p.setBigUint64(64,i+u,1),p.setUint32(72,1,1),yield Vl(p)}const d=Th(22);d.setUint32(0,1347093766),d.setUint16(8,Hte(c),1),d.setUint16(10,Hte(c),1),d.setUint32(12,uf(u),1),d.setUint32(16,uf(i),1),yield Vl(d)}(n,t),n)}function Xte(e){return JSON.stringify({__file:e.type,title:Wr(e),content:typeof e.content=="string"?e.content:e.content?.raw,syncStatus:e.wp_pattern_sync_status},null,2)}const QFt={id:"export-pattern",label:m("Export as JSON"),icon:NZe,supportsBulk:!0,isEligible:e=>e.type==="wp_block",callback:async e=>{if(e.length===1)return MX(`${Ti(Wr(e[0])||e[0].slug)}.json`,Xte(e[0]),"application/json");const t={},n=e.map(o=>{const r=Ti(Wr(o)||o.slug);return t[r]=(t[r]||0)+1,{name:`${r+(t[r]>1?"-"+(t[r]-1):"")}.json`,lastModified:new Date,input:Xte(o)}});return MX(m("patterns-export")+".zip",await YFt(n).blob(),"application/zip")}},JFt={id:"view-post-revisions",context:"list",label(e){var t;const n=(t=e[0]._links?.["version-history"]?.[0]?.count)!==null&&t!==void 0?t:0;return xe(m("View revisions (%s)"),n)},isEligible(e){var t,n;if(e.status==="trash")return!1;const o=(t=e?._links?.["predecessor-version"]?.[0]?.id)!==null&&t!==void 0?t:null,r=(n=e?._links?.["version-history"]?.[0]?.count)!==null&&n!==void 0?n:0;return!!o&&r>1},callback(e,{onActionPerformed:t}){const n=e[0],o=tn("revision.php",{revision:n?._links?.["predecessor-version"]?.[0]?.id});document.location.href=o,t&&t(e)}},e$t={id:"permanently-delete",label:m("Permanently delete"),supportsBulk:!0,icon:K3,isEligible(e){if(qh(e)||e.type==="wp_block")return!1;const{status:t,permissions:n}=e;return t==="trash"&&n?.delete},hideModalHeader:!0,RenderModal:({items:e,closeModal:t,onActionPerformed:n})=>{const[o,r]=x.useState(!1),{createSuccessNotice:s,createErrorNotice:i}=Oe(mt),{deleteEntityRecord:c}=Oe(Me);return a.jsxs(dt,{spacing:"5",children:[a.jsx(Sn,{children:e.length>1?xe(Dn("Are you sure you want to permanently delete %d item?","Are you sure you want to permanently delete %d items?",e.length),e.length):xe(m('Are you sure you want to permanently delete "%s"?'),Lt(Wr(e[0])))}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{variant:"tertiary",onClick:t,disabled:o,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:m("Cancel")}),a.jsx(Ce,{variant:"primary",onClick:async()=>{r(!0);const l=await Promise.allSettled(e.map(u=>c("postType",u.type,u.id,{force:!0},{throwOnError:!0})));if(l.every(({status:u})=>u==="fulfilled")){let u;l.length===1?u=xe(m('"%s" permanently deleted.'),Wr(e[0])):u=m("The items were permanently deleted."),s(u,{type:"snackbar",id:"permanently-delete-post-action"}),n?.(e)}else{let u;if(l.length===1){const d=l[0];d.reason?.message?u=d.reason.message:u=m("An error occurred while permanently deleting the item.")}else{const d=new Set,p=l.filter(({status:f})=>f==="rejected");for(const f of p){const b=f;b.reason?.message&&d.add(b.reason.message)}d.size===0?u=m("An error occurred while permanently deleting the items."):d.size===1?u=xe(m("An error occurred while permanently deleting the items: %s"),[...d][0]):u=xe(m("Some errors occurred while permanently deleting the items: %s"),[...d].join(","))}i(u,{type:"snackbar"})}r(!1),t?.()},isBusy:o,disabled:o,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:m("Delete permanently")})]})]})}},t$t={id:"restore",label:m("Restore"),isPrimary:!0,icon:Xue,supportsBulk:!0,isEligible(e){return!qh(e)&&e.type!=="wp_block"&&e.status==="trash"&&e.permissions?.update},async callback(e,{registry:t,onActionPerformed:n}){const{createSuccessNotice:o,createErrorNotice:r}=t.dispatch(mt),{editEntityRecord:s,saveEditedEntityRecord:i}=t.dispatch(Me);await Promise.allSettled(e.map(l=>s("postType",l.type,l.id,{status:"draft"})));const c=await Promise.allSettled(e.map(l=>i("postType",l.type,l.id,{throwOnError:!0})));if(c.every(({status:l})=>l==="fulfilled")){let l;e.length===1?l=xe(m('"%s" has been restored.'),Wr(e[0])):e[0].type==="page"?l=xe(m("%d pages have been restored."),e.length):l=xe(m("%d posts have been restored."),e.length),o(l,{type:"snackbar",id:"restore-post-action"}),n&&n(e)}else{let l;if(c.length===1){const u=c[0];u.reason?.message?l=u.reason.message:l=m("An error occurred while restoring the post.")}else{const u=new Set,d=c.filter(({status:p})=>p==="rejected");for(const p of d){const f=p;f.reason?.message&&u.add(f.reason.message)}u.size===0?l=m("An error occurred while restoring the posts."):u.size===1?l=xe(m("An error occurred while restoring the posts: %s"),[...u][0]):l=xe(m("Some errors occurred while restoring the posts: %s"),[...u].join(","))}r(l,{type:"snackbar"})}}},n$t={id:"move-to-trash",label:m("Move to trash"),isPrimary:!0,icon:K3,isEligible(e){return qh(e)||e.type==="wp_block"?!1:!!e.status&&!["auto-draft","trash"].includes(e.status)&&e.permissions?.delete},supportsBulk:!0,hideModalHeader:!0,RenderModal:({items:e,closeModal:t,onActionPerformed:n})=>{const[o,r]=x.useState(!1),{createSuccessNotice:s,createErrorNotice:i}=Oe(mt),{deleteEntityRecord:c}=Oe(Me);return a.jsxs(dt,{spacing:"5",children:[a.jsx(Sn,{children:e.length===1?xe(m('Are you sure you want to move "%s" to the trash?'),Wr(e[0])):xe(Dn("Are you sure you want to move %d item to the trash ?","Are you sure you want to move %d items to the trash ?",e.length),e.length)}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,disabled:o,accessibleWhenDisabled:!0,children:m("Cancel")}),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"primary",onClick:async()=>{r(!0);const l=await Promise.allSettled(e.map(u=>c("postType",u.type,u.id.toString(),{},{throwOnError:!0})));if(l.every(({status:u})=>u==="fulfilled")){let u;l.length===1?u=xe(m('"%s" moved to the trash.'),Wr(e[0])):u=xe(Dn("%s item moved to the trash.","%s items moved to the trash.",e.length),e.length),s(u,{type:"snackbar",id:"move-to-trash-action"})}else{let u;if(l.length===1){const d=l[0];d.reason?.message?u=d.reason.message:u=m("An error occurred while moving the item to the trash.")}else{const d=new Set,p=l.filter(({status:f})=>f==="rejected");for(const f of p){const b=f;b.reason?.message&&d.add(b.reason.message)}d.size===0?u=m("An error occurred while moving the items to the trash."):d.size===1?u=xe(m("An error occurred while moving the item to the trash: %s"),[...d][0]):u=xe(m("Some errors occurred while moving the items to the trash: %s"),[...d].join(","))}i(u,{type:"snackbar"})}n&&n(e),r(!1),t?.()},isBusy:o,disabled:o,accessibleWhenDisabled:!0,children:We("Trash","verb")})]})]})}};function o$t(e){const t=new Set;if(e.length===1){const n=e[0];n.reason?.message&&t.add(n.reason.message)}else{const n=e.filter(({status:o})=>o==="rejected");for(const o of n){const r=o;r.reason?.message&&t.add(r.reason.message)}}return t}const r$t=async(e,t,n)=>{const{createSuccessNotice:o,createErrorNotice:r}=kr(mt),{deleteEntityRecord:s}=kr(Me),i=await Promise.allSettled(e.map(u=>s("postType",u.type,u.id,{force:!0},{throwOnError:!0})));if(i.every(({status:u})=>u==="fulfilled")){var c;let u;i.length===1?u=t.success.messages.getMessage(e[0]):u=t.success.messages.getBatchMessage(e),o(u,{type:(c=t.success.type)!==null&&c!==void 0?c:"snackbar",id:t.success.id}),n.onActionPerformed?.(e)}else{var l;const u=o$t(i);let d="";i.length===1?d=t.error.messages.getMessage(u):d=t.error.messages.getBatchMessage(u),r(d,{type:(l=t.error.type)!==null&&l!==void 0?l:"snackbar",id:t.error.id}),n.onActionError?.()}},{PATTERN_TYPES:s$t}=Wm(Vi),i$t={id:"delete-post",label:m("Delete"),isPrimary:!0,icon:K3,isEligible(e){return qh(e)?aOe(e):e.type===s$t.user},supportsBulk:!0,hideModalHeader:!0,RenderModal:({items:e,closeModal:t,onActionPerformed:n})=>{const[o,r]=x.useState(!1),s=e.every(i=>qh(i)&&i?.has_theme_file);return a.jsxs(dt,{spacing:"5",children:[a.jsx(Sn,{children:e.length>1?xe(Dn("Delete %d item?","Delete %d items?",e.length),e.length):xe(We('Delete "%s"?',"template part"),Wr(e[0]))}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{variant:"tertiary",onClick:t,disabled:o,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:m("Cancel")}),a.jsx(Ce,{variant:"primary",onClick:async()=>{r(!0),await r$t(e,{success:{messages:{getMessage:c=>xe(s?m('"%s" reset.'):We('"%s" deleted.',"template part"),Lt(Wr(c))),getBatchMessage:()=>m(s?"Items reset.":"Items deleted.")}},error:{messages:{getMessage:c=>c.size===1?[...c][0]:m(s?"An error occurred while reverting the item.":"An error occurred while deleting the item."),getBatchMessage:c=>c.size===0?m(s?"An error occurred while reverting the items.":"An error occurred while deleting the items."):c.size===1?s?xe(m("An error occurred while reverting the items: %s"),[...c][0]):xe(m("An error occurred while deleting the items: %s"),[...c][0]):s?xe(m("Some errors occurred while reverting the items: %s"),[...c].join(",")):xe(m("Some errors occurred while deleting the items: %s"),[...c].join(","))}}},{onActionPerformed:n}),r(!1),t?.()},isBusy:o,disabled:o,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:m("Delete")})]})]})}},a$t=()=>{var e;return(e=G(t=>t(Me).getEntityRecords("postType","wp_template_part",{per_page:-1}),[]))!==null&&e!==void 0?e:[]},c$t=(e,t)=>{const n=e.toLowerCase(),o=t.map(s=>s.title.rendered.toLowerCase());if(!o.includes(n))return e;let r=2;for(;o.includes(`${n} ${r}`);)r++;return`${e} ${r}`},l$t=e=>Ti(e).replace(/[^\w-]+/g,"")||"wp-custom-part";function Gte(e,t){return`fields-create-template-part-modal__area-option-${e}-${t}`}function Kte(e,t){return`fields-create-template-part-modal__area-option-description-${e}-${t}`}function LI({modalTitle:e,...t}){const n=G(o=>o(Me).getPostType("wp_template_part")?.labels?.add_new_item,[]);return a.jsx(Zo,{title:e||n,onRequestClose:t.closeModal,overlayClassName:"fields-create-template-part-modal",focusOnMount:"firstContentElement",size:"medium",children:a.jsx(qOe,{...t})})}const u$t=e=>e==="header"?XP:e==="footer"?UP:e==="sidebar"?GP:Qf;function qOe({defaultArea:e="uncategorized",blocks:t=[],confirmLabel:n=m("Add"),closeModal:o,onCreate:r,onError:s,defaultTitle:i=""}){const{createErrorNotice:c}=Oe(mt),{saveEntityRecord:l}=Oe(Me),u=a$t(),[d,p]=x.useState(i),[f,b]=x.useState(e),[h,g]=x.useState(!1),z=vt(LI),A=G(v=>v(Me).getEntityRecord("root","__unstableBase")?.default_template_part_areas,[]);async function _(){if(!(!d||h))try{g(!0);const v=c$t(d,u),M=l$t(v),y=await l("postType","wp_template_part",{slug:M,title:v,content:Ks(t),area:f},{throwOnError:!0});await r(y)}catch(v){const M=v instanceof Error&&"code"in v&&v.message&&v.code!=="unknown_error"?v.message:m("An error occurred while creating the template part.");c(M,{type:"snackbar"}),s?.()}finally{g(!1)}}return a.jsx("form",{onSubmit:async v=>{v.preventDefault(),await _()},children:a.jsxs(dt,{spacing:"4",children:[a.jsx(dn,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:m("Name"),value:d,onChange:p,required:!0}),a.jsxs("fieldset",{children:[a.jsx(no.VisualLabel,{as:"legend",children:m("Area")}),a.jsx("div",{className:"fields-create-template-part-modal__area-radio-group",children:(A??[]).map(v=>{const M=u$t(v.icon);return a.jsxs("div",{className:"fields-create-template-part-modal__area-radio-wrapper",children:[a.jsx("input",{type:"radio",id:Gte(v.area,z),name:`fields-create-template-part-modal__area-${z}`,value:v.area,checked:f===v.area,onChange:()=>{b(v.area)},"aria-describedby":Kte(v.area,z)}),a.jsx(qo,{icon:M,className:"fields-create-template-part-modal__area-radio-icon"}),a.jsx("label",{htmlFor:Gte(v.area,z),className:"fields-create-template-part-modal__area-radio-label",children:v.label}),a.jsx(qo,{icon:M0,className:"fields-create-template-part-modal__area-radio-checkmark"}),a.jsx("p",{className:"fields-create-template-part-modal__area-radio-description",id:Kte(v.area,z),children:v.description})]},v.area)})})]}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{o()},children:m("Cancel")}),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"primary",type:"submit","aria-disabled":!d||h,isBusy:h,children:n})]})]})})}const d$t={id:"duplicate-template-part",label:We("Duplicate","action label"),isEligible:e=>e.type==="wp_template_part",modalHeader:We("Duplicate template part","action label"),RenderModal:({items:e,closeModal:t})=>{const[n]=e,o=x.useMemo(()=>{var i;return(i=n.blocks)!==null&&i!==void 0?i:Ko(typeof n.content=="string"?n.content:n.content.raw,{__unstableSkipMigrationLogs:!0})},[n.content,n.blocks]),{createSuccessNotice:r}=Oe(mt);function s(i){r(xe(We('"%s" duplicated.',"template part"),Wr(i)),{type:"snackbar",id:"edit-site-patterns-success"}),t?.()}return a.jsx(qOe,{blocks:o,defaultArea:n.area,defaultTitle:xe(We("%s (Copy)","template part"),Wr(n)),onCreate:s,onError:t,confirmLabel:We("Duplicate","action label"),closeModal:t??(()=>{})})}};function p$t(e,t,n){if(!n)return t;let o=e.get(t);return o||(o=R5({"core/block-editor":u_},t),o.registerStore("core/editor",VOe),e.set(t,o)),o}const f$t=Or(e=>({useSubRegistry:t=!0,...n})=>{const o=Fn(),[r]=x.useState(()=>new WeakMap),s=p$t(r,o,t);return s===o?a.jsx(e,{registry:o,...n}):a.jsx(XN,{value:s,children:a.jsx(e,{registry:s,...n})})},"withRegistryProvider"),Bu=(e,t)=>`${t}`,tN=e=>`href="${e}" target="_blank" rel="noreferrer noopener"`,b$t=(e,t)=>{let n=e.trim();return e!=="pdm"&&(n=e.toUpperCase().replace("SAMPLING","Sampling")),t&&(n+=` ${t}`),["pdm","cc0"].includes(e)||(n=`CC ${n}`),n},h$t=e=>{const{title:t,foreign_landing_url:n,creator:o,creator_url:r,license:s,license_version:i,license_url:c}=e,l=b$t(s,i),u=Lt(o);let d;return u?d=t?xe(We('"%1$s" by %2$s/ %3$s',"caption"),Bu(n,Lt(t)),r?Bu(r,u):u,c?Bu(`${c}?ref=openverse`,l):l):xe(We("Work by %2$s/ %3$s","caption"),tN(n),r?Bu(r,u):u,c?Bu(`${c}?ref=openverse`,l):l):d=t?xe(We('"%1$s"/ %2$s',"caption"),Bu(n,Lt(t)),c?Bu(`${c}?ref=openverse`,l):l):xe(We("Work/ %2$s","caption"),tN(n),c?Bu(`${c}?ref=openverse`,l):l),d.replace(/\s{2}/g," ")},OT=async(e={})=>(await B0e(Me).getMediaItems({...e,orderBy:e?.search?"relevance":"date"})).map(n=>({...n,alt:n.alt_text,url:n.source_url,previewUrl:n.media_details?.sizes?.medium?.source_url,caption:n.caption?.raw})),m$t=[{name:"images",labels:{name:m("Images"),search_items:m("Search images")},mediaType:"image",async fetch(e={}){return OT({...e,media_type:"image"})}},{name:"videos",labels:{name:m("Videos"),search_items:m("Search videos")},mediaType:"video",async fetch(e={}){return OT({...e,media_type:"video"})}},{name:"audio",labels:{name:m("Audio"),search_items:m("Search audio")},mediaType:"audio",async fetch(e={}){return OT({...e,media_type:"audio"})}},{name:"openverse",labels:{name:m("Openverse"),search_items:m("Search Openverse")},mediaType:"image",async fetch(e={}){const n={...e,...{mature:!1,excluded_source:"flickr,inaturalist,wikimedia",license:"pdm,cc0"}},o={per_page:"page_size",search:"q"},r=new URL("https://api.openverse.org/v1/images/");return Object.entries(n).forEach(([l,u])=>{const d=o[l]||l;r.searchParams.set(d,u)}),(await(await window.fetch(r,{headers:{"User-Agent":"WordPress/inserter-media-fetch"}})).json()).results.map(l=>({...l,title:l.title?.toLowerCase().startsWith("file:")?l.title.slice(5):l.title,sourceId:l.id,id:void 0,caption:h$t(l),previewUrl:l.thumbnail}))},getReportUrl:({sourceId:e})=>`https://wordpress.org/openverse/image/${e}/report/`,isExternalResource:!0}],g$t=()=>{};function M$t({additionalData:e={},allowedTypes:t,filesList:n,maxUploadFileSize:o,onError:r=g$t,onFileChange:s,onSuccess:i}){const{getCurrentPost:c,getEditorSettings:l}=uo(_e),{lockPostAutosaving:u,unlockPostAutosaving:d,lockPostSaving:p,unlockPostSaving:f}=kr(_e),b=l().allowedMimeTypes,h=`image-upload-${Is()}`;let g=!1;o=o||l().maxUploadFileSize;const z=c(),A=typeof z?.id=="number"?z.id:z?.wp_id,_=()=>{p(h),u(h),g=!0},v=A?{post:A}:{},M=()=>{f(h),d(h),g=!1};qDt({allowedTypes:t,filesList:n,onFileChange:y=>{g?M():_(),s?.(y)},onSuccess:i,additionalData:{...v,...e},maxUploadFileSize:o,onError:({message:y})=>{M(),r(y)},wpAllowedMimeTypes:b})}const{sideloadMedia:z$t}=St(yOe),{GlobalStylesContext:O$t,cleanEmptyObject:yT}=St(jn);function ROe(e,t){return E0e(e,t,{isMergeableObject:a3,customMerge:n=>{if(n==="backgroundImage")return(o,r)=>r}})}function y$t(){const{globalStylesId:e,isReady:t,settings:n,styles:o,_links:r}=G(u=>{const{getEntityRecord:d,getEditedEntityRecord:p,hasFinishedResolution:f,canUser:b}=u(Me),h=u(Me).__experimentalGetCurrentGlobalStylesId();let g;const z=h?b("update",{kind:"root",name:"globalStyles",id:h}):null;h&&typeof z=="boolean"&&(z?g=p("root","globalStyles",h):g=d("root","globalStyles",h,{context:"view"}));let A=!1;return f("__experimentalGetCurrentGlobalStylesId")&&(h?A=z?f("getEditedEntityRecord",["root","globalStyles",h]):f("getEntityRecord",["root","globalStyles",h,{context:"view"}]):A=!0),{globalStylesId:h,isReady:A,settings:g?.settings,styles:g?.styles,_links:g?._links}},[]),{getEditedEntityRecord:s}=G(Me),{editEntityRecord:i}=Oe(Me),c=x.useMemo(()=>({settings:n??{},styles:o??{},_links:r??{}}),[n,o,r]),l=x.useCallback((u,d={})=>{var p,f,b;const h=s("root","globalStyles",e),g={styles:(p=h?.styles)!==null&&p!==void 0?p:{},settings:(f=h?.settings)!==null&&f!==void 0?f:{},_links:(b=h?._links)!==null&&b!==void 0?b:{}},z=typeof u=="function"?u(g):u;i("root","globalStyles",e,{styles:yT(z.styles)||{},settings:yT(z.settings)||{},_links:yT(z._links)||{}},d)},[e,i,s]);return[t,c,l]}function A$t(){const e=G(t=>t(Me).__experimentalGetCurrentThemeBaseGlobalStyles(),[]);return[!!e,e]}function PI(){const[e,t,n]=y$t(),[o,r]=A$t(),s=x.useMemo(()=>!r||!t?{}:ROe(r,t),[t,r]);return x.useMemo(()=>({isReady:e&&o,user:t,base:r,merged:s,setUserConfig:n}),[s,t,r,n,e,o])}function v$t({children:e}){const t=PI();return t.isReady?a.jsx(O$t.Provider,{value:t,children:e}):null}const Yte={};function x$t(e){const{RECEIVE_INTERMEDIATE_RESULTS:t}=St(H3e),{getEntityRecords:n}=e(Me);return n("postType","wp_block",{per_page:-1,[t]:!0})}const w$t=["__experimentalBlockDirectory","__experimentalDiscussionSettings","__experimentalFeatures","__experimentalGlobalStylesBaseStyles","alignWide","blockInspectorTabs","maxUploadFileSize","allowedMimeTypes","bodyPlaceholder","canLockBlocks","canUpdateBlockBindings","capabilities","clearBlockSelection","codeEditingEnabled","colors","disableCustomColors","disableCustomFontSizes","disableCustomSpacingSizes","disableCustomGradients","disableLayoutStyles","enableCustomLineHeight","enableCustomSpacing","enableCustomUnits","enableOpenverseMediaCategory","fontSizes","gradients","generateAnchors","onNavigateToEntityRecord","imageDefaultSize","imageDimensions","imageEditing","imageSizes","isPreviewMode","isRTL","locale","maxWidth","postContentAttributes","postsPerPage","readOnly","styles","titlePlaceholder","supportsLayout","widgetTypesToHideFromLegacyWidgetBlock","__unstableHasCustomAppender","__unstableResolvedAssets","__unstableIsBlockBasedTheme"],{globalStylesDataKey:_$t,globalStylesLinksDataKey:k$t,selectBlockPatternsKey:S$t,reusableBlocksSelectKey:C$t,sectionRootClientIdKey:q$t}=St(jn);function R$t(e,t,n,o){var r,s,i,c;const l=Yn("medium"),{allowRightClickOverrides:u,blockTypes:d,focusMode:p,hasFixedToolbar:f,isDistractionFree:b,keepCaretInsideBlock:h,hasUploadPermissions:g,hiddenBlockTypes:z,canUseUnfilteredHTML:A,userCanCreatePages:_,pageOnFront:v,pageForPosts:M,userPatternCategories:y,restBlockPatternCategories:k,sectionRootClientId:S}=G(V=>{var Q;const{canUser:te,getRawEntityRecord:ee,getEntityRecord:ue,getUserPatternCategories:ce,getBlockPatternCategories:me}=V(Me),{get:de}=V(ht),{getBlockTypes:Ae}=V(kt),{getBlocksByName:ye,getBlockAttributes:Ne}=V(J),je=te("read",{kind:"root",name:"site"})?ue("root","site"):void 0;function ie(){var we;if(o==="template-locked"){var re;return(re=ye("core/post-content")?.[0])!==null&&re!==void 0?re:""}return(we=ye("core/group").find(pe=>Ne(pe)?.tagName==="main"))!==null&&we!==void 0?we:""}return{allowRightClickOverrides:de("core","allowRightClickOverrides"),blockTypes:Ae(),canUseUnfilteredHTML:ee("postType",t,n)?._links?.hasOwnProperty("wp:action-unfiltered-html"),focusMode:de("core","focusMode"),hasFixedToolbar:de("core","fixedToolbar")||!l,hiddenBlockTypes:de("core","hiddenBlockTypes"),isDistractionFree:de("core","distractionFree"),keepCaretInsideBlock:de("core","keepCaretInsideBlock"),hasUploadPermissions:(Q=te("create",{kind:"root",name:"media"}))!==null&&Q!==void 0?Q:!0,userCanCreatePages:te("create",{kind:"postType",name:"page"}),pageOnFront:je?.page_on_front,pageForPosts:je?.page_for_posts,userPatternCategories:ce(),restBlockPatternCategories:me(),sectionRootClientId:ie()}},[t,n,l,o]),{merged:C}=PI(),R=(r=C.styles)!==null&&r!==void 0?r:Yte,T=(s=C._links)!==null&&s!==void 0?s:Yte,E=(i=e.__experimentalAdditionalBlockPatterns)!==null&&i!==void 0?i:e.__experimentalBlockPatterns,B=(c=e.__experimentalAdditionalBlockPatternCategories)!==null&&c!==void 0?c:e.__experimentalBlockPatternCategories,N=x.useMemo(()=>[...E||[]].filter(({postTypes:V})=>!V||Array.isArray(V)&&V.includes(t)),[E,t]),j=x.useMemo(()=>[...B||[],...k||[]].filter((V,Q,te)=>Q===te.findIndex(ee=>V.name===ee.name)),[B,k]),{undo:I,setIsInserterOpened:P}=Oe(_e),{saveEntityRecord:$}=Oe(Me),F=x.useCallback(V=>_?$("postType","page",V):Promise.reject({message:m("You do not have permission to create Pages.")}),[$,_]),X=x.useMemo(()=>z&&z.length>0?(e.allowedBlockTypes===!0?d.map(({name:Q})=>Q):e.allowedBlockTypes||[]).filter(Q=>!z.includes(Q)):e.allowedBlockTypes,[e.allowedBlockTypes,z,d]),Z=e.focusMode===!1;return x.useMemo(()=>({...Object.fromEntries(Object.entries(e).filter(([Q])=>w$t.includes(Q))),[_$t]:R,[k$t]:T,allowedBlockTypes:X,allowRightClickOverrides:u,focusMode:p&&!Z,hasFixedToolbar:f,isDistractionFree:b,keepCaretInsideBlock:h,mediaUpload:g?M$t:void 0,mediaSideload:g?z$t:void 0,__experimentalBlockPatterns:N,[S$t]:Q=>{const{hasFinishedResolution:te,getBlockPatternsForPostType:ee}=St(Q(Me)),ue=ee(t);return te("getBlockPatterns")?ue:void 0},[C$t]:x$t,__experimentalBlockPatternCategories:j,__experimentalUserPatternCategories:y,__experimentalFetchLinkSuggestions:(Q,te)=>hBe(Q,te,e),inserterMediaCategories:m$t,__experimentalFetchRichUrlData:gBe,__experimentalCanUserUseUnfilteredHTML:A,__experimentalUndo:I,outlineMode:!b&&t==="wp_template",__experimentalCreatePageEntity:F,__experimentalUserCanCreatePages:_,pageOnFront:v,pageForPosts:M,__experimentalPreferPatternsOnRoot:t==="wp_template",templateLock:t==="wp_navigation"?"insert":e.templateLock,template:t==="wp_navigation"?[["core/navigation",{},[]]]:e.template,__experimentalSetIsInserterOpened:P,[q$t]:S,editorTool:o==="post-only"&&t!=="wp_template"?"edit":void 0}),[X,u,p,Z,f,b,h,e,g,y,N,j,A,I,F,_,v,M,t,P,S,R,T,o])}const T$t=["core/post-title","core/post-featured-image","core/post-content"];function TOe(){const e=x.useMemo(()=>[...gr("editor.postContentBlockTypes",T$t)],[]);return G(n=>{const{getPostBlocksByName:o}=St(n(_e));return o(e)},[e])}function E$t(){const e=TOe(),{templateParts:t,isNavigationMode:n}=G(s=>{const{getBlocksByName:i,isNavigationMode:c}=s(J);return{templateParts:i("core/template-part"),isNavigationMode:c()}},[]),o=G(s=>{const{getBlockOrder:i}=s(J);return t.flatMap(c=>i(c))},[t]),r=Fn();return x.useEffect(()=>{const{setBlockEditingMode:s,unsetBlockEditingMode:i}=r.dispatch(J);return s("","disabled"),()=>{i("")}},[r]),x.useEffect(()=>{const{setBlockEditingMode:s,unsetBlockEditingMode:i}=r.dispatch(J);return r.batch(()=>{for(const c of e)s(c,"contentOnly")}),()=>{r.batch(()=>{for(const c of e)i(c)})}},[e,r]),x.useEffect(()=>{const{setBlockEditingMode:s,unsetBlockEditingMode:i}=r.dispatch(J);return r.batch(()=>{if(!n)for(const c of t)s(c,"contentOnly")}),()=>{r.batch(()=>{if(!n)for(const c of t)i(c)})}},[t,n,r]),x.useEffect(()=>{const{setBlockEditingMode:s,unsetBlockEditingMode:i}=r.dispatch(J);return r.batch(()=>{for(const c of o)s(c,"disabled")}),()=>{r.batch(()=>{for(const c of o)i(c)})}},[o,r]),null}function W$t(){const e=G(o=>o(J).getBlockOrder()?.[0],[]),{setBlockEditingMode:t,unsetBlockEditingMode:n}=Oe(J);x.useEffect(()=>{if(e)return t(e,"contentOnly"),()=>{n(e)}},[e,n,t])}const Zte=["wp_block","wp_template","wp_template_part"];function N$t(e,t){x.useEffect(()=>(Bn("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter",(n,o)=>!Zte.includes(e)&&o.name==="core/template-part"&&t==="post-only"?!1:n),Bn("blockEditor.__unstableCanInsertBlockType","removePostContentFromInserter",(n,o,r,{getBlockParentsByBlockName:s})=>!Zte.includes(e)&&o.name==="core/post-content"?s(r,"core/query").length>0:n),()=>{mE("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter"),mE("blockEditor.__unstableCanInsertBlockType","removePostContentFromInserter")}),[e,t])}function B$t(e={},t){switch(t.type){case"SET_IS_MATCHING":return t.values}return e}function L$t(e){return{type:"SET_IS_MATCHING",values:e}}const P$t=Object.freeze(Object.defineProperty({__proto__:null,setIsMatching:L$t},Symbol.toStringTag,{value:"Module"}));function j$t(e,t){return t.indexOf(" ")===-1&&(t=">= "+t),!!e[t]}const I$t=Object.freeze(Object.defineProperty({__proto__:null,isViewportMatch:j$t},Symbol.toStringTag,{value:"Module"})),D$t="core/viewport",Qx=w1(D$t,{reducer:B$t,actions:P$t,selectors:I$t});Us(Qx);const F$t=(e,t)=>{const n=F1(()=>{const s=Object.fromEntries(r.map(([i,c])=>[i,c.matches]));kr(Qx).setIsMatching(s)},0,{leading:!0}),o=Object.entries(t),r=Object.entries(e).flatMap(([s,i])=>o.map(([c,l])=>{const u=window.matchMedia(`(${l}: ${i}px)`);return u.addEventListener("change",n),[`${c} ${s}`,u]}));window.addEventListener("orientationchange",n),n(),n.flush()},$$t={huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480},V$t={"<":"max-width",">=":"min-width"};F$t($$t,V$t);const EOe=x.createContext({name:null,icon:null});EOe.Provider;function PO(){return x.useContext(EOe)}Hs((e,t)=>({icon:e,name:t}));function fp(e){return["core/edit-post","core/edit-site"].includes(e)?(Ke(`${e} interface scope`,{alternative:"core interface scope",hint:"core/edit-post and core/edit-site are merging.",version:"6.6"}),"core"):e}function jO(e,t){return e==="core"&&t==="edit-site/template"?(Ke("edit-site/template sidebar",{alternative:"edit-post/document",version:"6.6"}),"edit-post/document"):e==="core"&&t==="edit-site/block-inspector"?(Ke("edit-site/block-inspector sidebar",{alternative:"edit-post/block",version:"6.6"}),"edit-post/block"):t}const H$t=(e,t)=>(e=fp(e),t=jO(e,t),{type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e,area:t}),U$t=(e,t)=>({registry:n,dispatch:o})=>{if(!t)return;e=fp(e),t=jO(e,t),n.select(ht).get(e,"isComplementaryAreaVisible")||n.dispatch(ht).set(e,"isComplementaryAreaVisible",!0),o({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t})},X$t=e=>({registry:t})=>{e=fp(e),t.select(ht).get(e,"isComplementaryAreaVisible")&&t.dispatch(ht).set(e,"isComplementaryAreaVisible",!1)},G$t=(e,t)=>({registry:n})=>{if(!t)return;e=fp(e),t=jO(e,t);const o=n.select(ht).get(e,"pinnedItems");o?.[t]!==!0&&n.dispatch(ht).set(e,"pinnedItems",{...o,[t]:!0})},K$t=(e,t)=>({registry:n})=>{if(!t)return;e=fp(e),t=jO(e,t);const o=n.select(ht).get(e,"pinnedItems");n.dispatch(ht).set(e,"pinnedItems",{...o,[t]:!1})};function Y$t(e,t){return function({registry:n}){Ke("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),n.dispatch(ht).toggle(e,t)}}function Z$t(e,t,n){return function({registry:o}){Ke("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),o.dispatch(ht).set(e,t,!!n)}}function Q$t(e,t){return function({registry:n}){Ke("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),n.dispatch(ht).setDefaults(e,t)}}function J$t(e){return{type:"OPEN_MODAL",name:e}}function eVt(){return{type:"CLOSE_MODAL"}}const tVt=Object.freeze(Object.defineProperty({__proto__:null,closeModal:eVt,disableComplementaryArea:X$t,enableComplementaryArea:U$t,openModal:J$t,pinItem:G$t,setDefaultComplementaryArea:H$t,setFeatureDefaults:Q$t,setFeatureValue:Z$t,toggleFeature:Y$t,unpinItem:K$t},Symbol.toStringTag,{value:"Module"})),nVt=At(e=>(t,n)=>{n=fp(n);const o=e(ht).get(n,"isComplementaryAreaVisible");if(o!==void 0)return o===!1?null:t?.complementaryAreas?.[n]}),oVt=At(e=>(t,n)=>{n=fp(n);const o=e(ht).get(n,"isComplementaryAreaVisible"),r=t?.complementaryAreas?.[n];return o&&r===void 0}),rVt=At(e=>(t,n,o)=>{var r;return n=fp(n),o=jO(n,o),(r=e(ht).get(n,"pinnedItems")?.[o])!==null&&r!==void 0?r:!0}),sVt=At(e=>(t,n,o)=>(Ke("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(ht).get(n,o)));function iVt(e,t){return e.activeModal===t}const aVt=Object.freeze(Object.defineProperty({__proto__:null,getActiveComplementaryArea:nVt,isComplementaryAreaLoading:oVt,isFeatureActive:sVt,isItemPinned:rVt,isModalActive:iVt},Symbol.toStringTag,{value:"Module"}));function cVt(e={},t){switch(t.type){case"SET_DEFAULT_COMPLEMENTARY_AREA":{const{scope:n,area:o}=t;return e[n]?e:{...e,[n]:o}}case"ENABLE_COMPLEMENTARY_AREA":{const{scope:n,area:o}=t;return{...e,[n]:o}}}return e}function lVt(e=null,t){switch(t.type){case"OPEN_MODAL":return t.name;case"CLOSE_MODAL":return null}return e}const uVt=J0({complementaryAreas:cVt,activeModal:lVt}),dVt="core/interface",xo=w1(dVt,{reducer:uVt,actions:tVt,selectors:aVt});Us(xo);function pVt(e){return["checkbox","option","radio","switch","menuitemcheckbox","menuitemradio","treeitem"].includes(e)}function jI({as:e=Ce,scope:t,identifier:n,icon:o,selectedIcon:r,name:s,shortcut:i,...c}){const l=e,u=PO(),d=o||u.icon,p=n||`${u.name}/${s}`,f=G(g=>g(xo).getActiveComplementaryArea(t)===p,[p,t]),{enableComplementaryArea:b,disableComplementaryArea:h}=Oe(xo);return a.jsx(l,{icon:r&&f?r:d,"aria-controls":p.replace("/",":"),"aria-checked":pVt(c.role)?f:void 0,onClick:()=>{f?h(t):b(t,p)},shortcut:i,...c})}const fVt=({children:e,className:t,toggleButtonProps:n})=>{const o=a.jsx(jI,{icon:rp,...n});return a.jsxs("div",{className:oe("components-panel__header","interface-complementary-area-header",t),tabIndex:-1,children:[e,o]})},Qte=()=>{};function bVt({name:e,as:t=Cn,fillProps:n={},bubblesVirtually:o,...r}){return a.jsx(xf,{name:e,bubblesVirtually:o,fillProps:n,children:s=>{if(!x.Children.toArray(s).length)return null;const i=[];x.Children.forEach(s,({props:{__unstableExplicitMenuItem:l,__unstableTarget:u}})=>{u&&l&&i.push(u)});const c=x.Children.map(s,l=>!l.props.__unstableExplicitMenuItem&&i.includes(l.props.__unstableTarget)?null:l);return a.jsx(t,{...r,children:c})}})}function IO({name:e,as:t=Ce,onClick:n,...o}){return a.jsx(um,{name:e,children:({onClick:r})=>a.jsx(t,{onClick:n||r?(...s)=>{(n||Qte)(...s),(r||Qte)(...s)}:void 0,...o})})}IO.Slot=bVt;const hVt=({__unstableExplicitMenuItem:e,__unstableTarget:t,...n})=>a.jsx(Ct,{...n});function WOe({scope:e,target:t,__unstableExplicitMenuItem:n,...o}){return a.jsx(jI,{as:r=>a.jsx(IO,{__unstableExplicitMenuItem:n,__unstableTarget:`${e}/${t}`,as:hVt,name:`${e}/plugin-more-menu`,...r}),role:"menuitemcheckbox",selectedIcon:M0,name:t,scope:e,...o})}function rk({scope:e,...t}){return a.jsx(um,{name:`PinnedItems/${e}`,...t})}function mVt({scope:e,className:t,...n}){return a.jsx(xf,{name:`PinnedItems/${e}`,...n,children:o=>o?.length>0&&a.jsx("div",{className:oe(t,"interface-pinned-items"),children:o})})}rk.Slot=mVt;const gVt=.3;function MVt({scope:e,...t}){return a.jsx(xf,{name:`ComplementaryArea/${e}`,...t})}const NOe=280,zVt={open:{width:NOe},closed:{width:0},mobileOpen:{width:"100vw"}};function OVt({activeArea:e,isActive:t,scope:n,children:o,className:r,id:s}){const i=$1(),c=Yn("medium","<"),l=Fr(e),u=Fr(t),[,d]=x.useState({});x.useEffect(()=>{d({})},[t]);const p={type:"tween",duration:i||c||l&&e&&e!==l?0:gVt,ease:[.6,0,.4,1]};return a.jsx(um,{name:`ComplementaryArea/${n}`,children:a.jsx(Wd,{initial:!1,children:(u||t)&&a.jsx(Rr.div,{variants:zVt,initial:"closed",animate:c?"mobileOpen":"open",exit:"closed",transition:p,className:"interface-complementary-area__fill",children:a.jsx("div",{id:s,className:r,style:{width:c?"100vw":NOe},children:o})})})})}function yVt(e,t,n,o,r){const s=x.useRef(!1),i=x.useRef(!1),{enableComplementaryArea:c,disableComplementaryArea:l}=Oe(xo);x.useEffect(()=>{o&&r&&!s.current?(l(e),i.current=!0):i.current&&!r&&s.current?(i.current=!1,c(e,t)):i.current&&n&&n!==t&&(i.current=!1),r!==s.current&&(s.current=r)},[o,r,e,t,n,l,c])}function sk({children:e,className:t,closeLabel:n=m("Close plugin"),identifier:o,header:r,headerClassName:s,icon:i,isPinnable:c=!0,panelClassName:l,scope:u,name:d,title:p,toggleShortcut:f,isActiveByDefault:b}){const h=PO(),g=i||h.icon,z=o||`${h.name}/${d}`,[A,_]=x.useState(!1),{isLoading:v,isActive:M,isPinned:y,activeArea:k,isSmall:S,isLarge:C,showIconLabels:R}=G(I=>{const{getActiveComplementaryArea:P,isComplementaryAreaLoading:$,isItemPinned:F}=I(xo),{get:X}=I(ht),Z=P(u);return{isLoading:$(u),isActive:Z===z,isPinned:F(u,z),activeArea:Z,isSmall:I(Qx).isViewportMatch("< medium"),isLarge:I(Qx).isViewportMatch("large"),showIconLabels:X("core","showIconLabels")}},[z,u]),T=Yn("medium","<");yVt(u,z,k,M,S);const{enableComplementaryArea:E,disableComplementaryArea:B,pinItem:N,unpinItem:j}=Oe(xo);if(x.useEffect(()=>{b&&k===void 0&&!S?E(u,z):k===void 0&&S&&B(u,z),_(!0)},[k,b,u,z,S,E,B]),!!A)return a.jsxs(a.Fragment,{children:[c&&a.jsx(rk,{scope:u,children:y&&a.jsx(jI,{scope:u,identifier:z,isPressed:M&&(!R||C),"aria-expanded":M,"aria-disabled":v,label:p,icon:R?M0:g,showTooltip:!R,variant:R?"tertiary":void 0,size:"compact",shortcut:f})}),d&&c&&a.jsx(WOe,{target:d,scope:u,icon:g,children:p}),a.jsxs(OVt,{activeArea:k,isActive:M,className:oe("interface-complementary-area",t),scope:u,id:z.replace("/",":"),children:[a.jsx(fVt,{className:s,closeLabel:n,onClose:()=>B(u),toggleButtonProps:{label:n,size:"compact",shortcut:f,scope:u,identifier:z},children:r||a.jsxs(a.Fragment,{children:[a.jsx("h2",{className:"interface-complementary-area-header__title",children:p}),c&&!T&&a.jsx(Ce,{className:"interface-complementary-area__pin-unpin-item",icon:y?DQe:IQe,label:m(y?"Unpin from toolbar":"Pin to toolbar"),onClick:()=>(y?j:N)(u,z),isPressed:y,"aria-expanded":y,size:"compact"})]})}),a.jsx(s2t,{className:l,children:e})]})]})}sk.Slot=MVt;const AVt=({isActive:e})=>(x.useEffect(()=>{let t=!1;return document.body.classList.contains("sticky-menu")&&(t=!0,document.body.classList.remove("sticky-menu")),()=>{t&&document.body.classList.add("sticky-menu")}},[]),x.useEffect(()=>(e?document.body.classList.add("is-fullscreen-mode"):document.body.classList.remove("is-fullscreen-mode"),()=>{e&&document.body.classList.remove("is-fullscreen-mode")}),[e]),null),$u=x.forwardRef(({children:e,className:t,ariaLabel:n,as:o="div",...r},s)=>a.jsx(o,{ref:s,className:oe("interface-navigable-region",t),"aria-label":n,role:"region",tabIndex:"-1",...r,children:e}));$u.displayName="NavigableRegion";const BOe=.25,Jte={type:"tween",duration:BOe,ease:[.6,0,.4,1]};function vVt(e){x.useEffect(()=>{const t=document&&document.querySelector(`html:not(.${e})`);if(t)return t.classList.toggle(e),()=>{t.classList.toggle(e)}},[e])}const xVt={hidden:{opacity:1,marginTop:-60},visible:{opacity:1,marginTop:0},distractionFreeHover:{opacity:1,marginTop:0,transition:{...Jte,delay:.2,delayChildren:.2}},distractionFreeHidden:{opacity:0,marginTop:-60},distractionFreeDisabled:{opacity:0,marginTop:0,transition:{...Jte,delay:.8,delayChildren:.8}}};function wVt({isDistractionFree:e,footer:t,header:n,editorNotices:o,sidebar:r,secondarySidebar:s,content:i,actions:c,labels:l,className:u},d){const[p,f]=js(),b=Yn("medium","<"),g={type:"tween",duration:$1()?0:BOe,ease:[.6,0,.4,1]};vVt("interface-interface-skeleton__html-container");const A={...{header:We("Header","header landmark area"),body:m("Content"),secondarySidebar:m("Block Library"),sidebar:We("Settings","settings landmark area"),actions:m("Publish"),footer:m("Footer")},...l};return a.jsxs("div",{ref:d,className:oe(u,"interface-interface-skeleton",!!t&&"has-footer"),children:[a.jsxs("div",{className:"interface-interface-skeleton__editor",children:[a.jsx(Wd,{initial:!1,children:!!n&&a.jsx($u,{as:Rr.div,className:"interface-interface-skeleton__header","aria-label":A.header,initial:e&&!b?"distractionFreeHidden":"hidden",whileHover:e&&!b?"distractionFreeHover":"visible",animate:e&&!b?"distractionFreeDisabled":"visible",exit:e&&!b?"distractionFreeHidden":"hidden",variants:xVt,transition:g,children:n})}),e&&a.jsx("div",{className:"interface-interface-skeleton__header",children:o}),a.jsxs("div",{className:"interface-interface-skeleton__body",children:[a.jsx(Wd,{initial:!1,children:!!s&&a.jsx($u,{className:"interface-interface-skeleton__secondary-sidebar",ariaLabel:A.secondarySidebar,as:Rr.div,initial:"closed",animate:"open",exit:"closed",variants:{open:{width:f.width},closed:{width:0}},transition:g,children:a.jsxs(Rr.div,{style:{position:"absolute",width:b?"100vw":"fit-content",height:"100%",left:0},variants:{open:{x:0},closed:{x:"-100%"}},transition:g,children:[p,s]})})}),a.jsx($u,{className:"interface-interface-skeleton__content",ariaLabel:A.body,children:i}),!!r&&a.jsx($u,{className:"interface-interface-skeleton__sidebar",ariaLabel:A.sidebar,children:r}),!!c&&a.jsx($u,{className:"interface-interface-skeleton__actions",ariaLabel:A.actions,children:c})]})]}),!!t&&a.jsx($u,{className:"interface-interface-skeleton__footer",ariaLabel:A.footer,children:t})]})}const LOe=x.forwardRef(wVt),_Vt=Object.freeze(Object.defineProperty({__proto__:null,ActionItem:IO,ComplementaryArea:sk,ComplementaryAreaMoreMenuItem:WOe,FullscreenMode:AVt,InterfaceSkeleton:LOe,NavigableRegion:$u,PinnedItems:rk,store:xo},Symbol.toStringTag,{value:"Module"})),{RenamePatternModal:kVt}=St(Vi),POe="editor/pattern-rename";function SVt(){const{record:e,postType:t}=G(r=>{const{getCurrentPostType:s,getCurrentPostId:i}=r(_e),{getEditedEntityRecord:c}=r(Me),l=s();return{record:c("postType",l,i()),postType:l}},[]),{closeModal:n}=Oe(xo);return!G(r=>r(xo).isModalActive(POe))||t!==$l?null:a.jsx(kVt,{onClose:n,pattern:e})}const{DuplicatePatternModal:CVt}=St(Vi),jOe="editor/pattern-duplicate";function qVt(){const{record:e,postType:t}=G(r=>{const{getCurrentPostType:s,getCurrentPostId:i}=r(_e),{getEditedEntityRecord:c}=r(Me),l=s();return{record:c("postType",l,i()),postType:l}},[]),{closeModal:n}=Oe(xo);return!G(r=>r(xo).isModalActive(jOe))||t!==$l?null:a.jsx(CVt,{onClose:n,onSuccess:()=>n(),pattern:e})}const RVt=()=>function(){const{editorMode:t,isListViewOpen:n,showBlockBreadcrumbs:o,isDistractionFree:r,isFocusMode:s,isPreviewMode:i,isViewable:c,isCodeEditingEnabled:l,isRichEditingEnabled:u,isPublishSidebarEnabled:d}=G(B=>{var N,j;const{get:I}=B(ht),{isListViewOpened:P,getCurrentPostType:$,getEditorSettings:F}=B(_e),{getSettings:X}=B(J),{getPostType:Z}=B(Me);return{editorMode:(N=I("core","editorMode"))!==null&&N!==void 0?N:"visual",isListViewOpen:P(),showBlockBreadcrumbs:I("core","showBlockBreadcrumbs"),isDistractionFree:I("core","distractionFree"),isFocusMode:I("core","focusMode"),isPreviewMode:X().isPreviewMode,isViewable:(j=Z($())?.viewable)!==null&&j!==void 0?j:!1,isCodeEditingEnabled:F().codeEditingEnabled,isRichEditingEnabled:F().richEditingEnabled,isPublishSidebarEnabled:B(_e).isPublishSidebarEnabled()}},[]),{getActiveComplementaryArea:p}=G(xo),{toggle:f}=Oe(ht),{createInfoNotice:b}=Oe(mt),{__unstableSaveForPreview:h,setIsListViewOpened:g,switchEditorMode:z,toggleDistractionFree:A,toggleSpotlightMode:_,toggleTopToolbar:v}=Oe(_e),{openModal:M,enableComplementaryArea:y,disableComplementaryArea:k}=Oe(xo),{getCurrentPostId:S}=G(_e),{isBlockBasedTheme:C,canCreateTemplate:R}=G(B=>({isBlockBasedTheme:B(Me).getCurrentTheme()?.is_block_theme,canCreateTemplate:B(Me).canUser("create",{kind:"postType",name:"wp_template"})}),[]),T=l&&u;if(i)return{commands:[],isLoading:!1};const E=[];return E.push({name:"core/open-shortcut-help",label:m("Keyboard shortcuts"),icon:lQe,callback:({close:B})=>{B(),M("editor/keyboard-shortcut-help")}}),E.push({name:"core/toggle-distraction-free",label:m(r?"Exit Distraction free":"Enter Distraction free"),callback:({close:B})=>{A(),B()}}),E.push({name:"core/open-preferences",label:m("Editor preferences"),callback:({close:B})=>{B(),M("editor/preferences")}}),E.push({name:"core/toggle-spotlight-mode",label:m(s?"Exit Spotlight mode":"Enter Spotlight mode"),callback:({close:B})=>{_(),B()}}),E.push({name:"core/toggle-list-view",label:m(n?"Close List View":"Open List View"),icon:LP,callback:({close:B})=>{g(!n),B(),b(m(n?"List View off.":"List View on."),{id:"core/editor/toggle-list-view/notice",type:"snackbar"})}}),E.push({name:"core/toggle-top-toolbar",label:m("Top toolbar"),callback:({close:B})=>{v(),B()}}),T&&E.push({name:"core/toggle-code-editor",label:m(t==="visual"?"Open code editor":"Exit code editor"),icon:qP,callback:({close:B})=>{z(t==="visual"?"text":"visual"),B()}}),E.push({name:"core/toggle-breadcrumbs",label:m(o?"Hide block breadcrumbs":"Show block breadcrumbs"),callback:({close:B})=>{f("core","showBlockBreadcrumbs"),B(),b(m(o?"Breadcrumbs hidden.":"Breadcrumbs visible."),{id:"core/editor/toggle-breadcrumbs/notice",type:"snackbar"})}}),E.push({name:"core/open-settings-sidebar",label:m("Show or hide the Settings panel."),icon:jt()?ede:tde,callback:({close:B})=>{const N=p("core");B(),N==="edit-post/document"?k("core"):y("core","edit-post/document")}}),E.push({name:"core/open-block-inspector",label:m("Show or hide the Block settings panel"),icon:Cw,callback:({close:B})=>{const N=p("core");B(),N==="edit-post/block"?k("core"):y("core","edit-post/block")}}),E.push({name:"core/toggle-publish-sidebar",label:m(d?"Disable pre-publish checks":"Enable pre-publish checks"),icon:nde,callback:({close:B})=>{B(),f("core","isPublishSidebarEnabled"),b(m(d?"Pre-publish checks disabled.":"Pre-publish checks enabled."),{id:"core/editor/publish-sidebar/notice",type:"snackbar"})}}),c&&E.push({name:"core/preview-link",label:m("Preview in a new tab"),icon:vf,callback:async({close:B})=>{B();const N=S(),j=await h();window.open(j,`wp-preview-${N}`)}}),R&&C&&(Aa(window.location.href)?.includes("site-editor.php")||E.push({name:"core/go-to-site-editor",label:m("Open Site Editor"),callback:({close:N})=>{N(),document.location="site-editor.php"}})),{commands:E,isLoading:!1}},TVt=()=>function(){const{postType:t}=G(r=>{const{getCurrentPostType:s}=r(_e);return{postType:s()}},[]),{openModal:n}=Oe(xo),o=[];return t===$l&&(o.push({name:"core/rename-pattern",label:m("Rename pattern"),icon:Nd,callback:({close:r})=>{n(POe),r()}}),o.push({name:"core/duplicate-pattern",label:m("Duplicate pattern"),icon:Bd,callback:({close:r})=>{n(jOe),r()}})),{isLoading:!1,commands:o}},EVt=()=>function(){const{onNavigateToEntityRecord:t,goBack:n,templateId:o,isPreviewMode:r}=G(l=>{const{getRenderingMode:u,getEditorSettings:d,getCurrentTemplateId:p}=St(l(_e)),f=d();return{isTemplateHidden:u()==="post-only",onNavigateToEntityRecord:f.onNavigateToEntityRecord,getEditorSettings:d,goBack:f.onNavigateToPreviousEntityRecord,templateId:p(),isPreviewMode:f.isPreviewMode}},[]),{editedRecord:s,hasResolved:i}=X5("postType","wp_template",o);if(r)return{isLoading:!1,commands:[]};const c=[];return o&&i&&c.push({name:"core/switch-to-template-focus",label:xe(m("Edit template: %s"),Lt(s.title)),icon:nu,callback:({close:l})=>{t({postId:o,postType:"wp_template"}),l()}}),n&&c.push({name:"core/switch-to-previous-entity",label:m("Go back"),icon:wa,callback:({close:l})=>{n(),l()}}),{isLoading:!1,commands:c}},WVt=()=>function(){const{postType:t,postId:n}=G(c=>{const{getCurrentPostId:l,getCurrentPostType:u}=c(_e);return{postType:u(),postId:l()}},[]),{editedRecord:o,hasResolved:r}=X5("postType",t,n),{revertTemplate:s}=St(Oe(_e));if(!r||![Di,L0].includes(t))return{isLoading:!0,commands:[]};const i=[];if(iOe(o)){const c=o.type===L0?xe(m("Reset template: %s"),Lt(o.title)):xe(m("Reset template part: %s"),Lt(o.title));i.push({name:"core/reset-template",label:c,icon:jt()?Ede:BQe,callback:({close:l})=>{s(o),l()}})}return{isLoading:!r,commands:i}};function NVt(){xi({name:"core/editor/edit-ui",hook:RVt()}),xi({name:"core/editor/contextual-commands",hook:TVt(),context:"entity-edit"}),xi({name:"core/editor/page-content-focus",hook:EVt(),context:"entity-edit"}),xi({name:"core/edit-site/manipulate-document",hook:WVt()})}const{BlockRemovalWarningModal:ene}=St(jn),BVt=["core/post-content","core/post-template","core/query"],LVt=[{postTypes:["wp_template","wp_template_part"],callback(e){if(e.filter(({name:n})=>BVt.includes(n)).length)return Dn("Deleting this block will stop your post or page content from displaying on this template. It is not recommended.","Some of the deleted blocks will stop your post or page content from displaying on this template. It is not recommended.",e.length)}},{postTypes:["wp_block"],callback(e){if(e.filter(({attributes:n})=>n?.metadata?.bindings&&Object.values(n.metadata.bindings).some(o=>o.source==="core/pattern-overrides")).length)return Dn("The deleted block allows instance overrides. Removing it may result in content not displaying where this pattern is used. Are you sure you want to proceed?","Some of the deleted blocks allow instance overrides. Removing them may result in content not displaying where this pattern is used. Are you sure you want to proceed?",e.length)}}];function PVt(){const e=G(n=>n(_e).getCurrentPostType(),[]),t=x.useMemo(()=>LVt.filter(n=>n.postTypes.includes(e)),[e]);return!ene||!t?null:a.jsx(ene,{rules:t})}function jVt(){const{postId:e,shouldEnable:t}=G(o=>{const{isEditedPostDirty:r,isEditedPostEmpty:s,getCurrentPostId:i,getCurrentPostType:c}=o(_e),l=o(xo).isModalActive("editor/preferences"),u=o(ht).get("core","enableChoosePatternModal");return{postId:i(),shouldEnable:u&&!l&&!r()&&s()&&c()==="page"}},[]),{setIsInserterOpened:n}=Oe(_e);return x.useEffect(()=>{t&&n({tab:"patterns",category:"core/starter-content"})},[e,t,n]),null}const IVt=[{keyCombination:{modifier:"primary",character:"b"},description:m("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:m("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:m("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:m("Remove a link.")},{keyCombination:{character:"[["},description:m("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:m("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:m("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:m("Make the selected text inline code.")},{keyCombination:{modifier:"access",character:"0"},aliases:[{modifier:"access",character:"7"}],description:m("Convert the current heading to a paragraph.")},{keyCombination:{modifier:"access",character:"1-6"},description:m("Convert the current paragraph or heading to a heading of level 1 to 6.")},{keyCombination:{modifier:"primaryShift",character:"SPACE"},description:m("Add non breaking space.")}];function tne({keyCombination:e,forceAriaLabel:t}){const n=e.modifier?g0e[e.modifier](e.character):e.character,o=e.modifier?M0e[e.modifier](e.character):e.character;return a.jsx("kbd",{className:"editor-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":t||o,children:(Array.isArray(n)?n:[n]).map((r,s)=>r==="+"?a.jsx(x.Fragment,{children:r},s):a.jsx("kbd",{className:"editor-keyboard-shortcut-help-modal__shortcut-key",children:r},s))})}function IOe({description:e,keyCombination:t,aliases:n=[],ariaLabel:o}){return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"editor-keyboard-shortcut-help-modal__shortcut-description",children:e}),a.jsxs("div",{className:"editor-keyboard-shortcut-help-modal__shortcut-term",children:[a.jsx(tne,{keyCombination:t,forceAriaLabel:o}),n.map((r,s)=>a.jsx(tne,{keyCombination:r,forceAriaLabel:o},s))]})]})}function DVt({name:e}){const{keyCombination:t,description:n,aliases:o}=G(r=>{const{getShortcutKeyCombination:s,getShortcutDescription:i,getShortcutAliases:c}=r(Pi);return{keyCombination:s(e),aliases:c(e),description:i(e)}},[e]);return t?a.jsx(IOe,{keyCombination:t,description:n,aliases:o}):null}const nne="editor/keyboard-shortcut-help",FVt=({shortcuts:e})=>a.jsx("ul",{className:"editor-keyboard-shortcut-help-modal__shortcut-list",role:"list",children:e.map((t,n)=>a.jsx("li",{className:"editor-keyboard-shortcut-help-modal__shortcut",children:typeof t=="string"?a.jsx(DVt,{name:t}):a.jsx(IOe,{...t})},n))}),nN=({title:e,shortcuts:t,className:n})=>a.jsxs("section",{className:oe("editor-keyboard-shortcut-help-modal__section",n),children:[!!e&&a.jsx("h2",{className:"editor-keyboard-shortcut-help-modal__section-title",children:e}),a.jsx(FVt,{shortcuts:t})]}),vv=({title:e,categoryName:t,additionalShortcuts:n=[]})=>{const o=G(r=>r(Pi).getCategoryShortcuts(t),[t]);return a.jsx(nN,{title:e,shortcuts:o.concat(n)})};function $Vt(){const e=G(r=>r(xo).isModalActive(nne),[]),{openModal:t,closeModal:n}=Oe(xo),o=()=>{e?n():t(nne)};return p0("core/editor/keyboard-shortcuts",o),e?a.jsxs(Zo,{className:"editor-keyboard-shortcut-help-modal",title:m("Keyboard shortcuts"),closeButtonLabel:m("Close"),onRequestClose:o,children:[a.jsx(nN,{className:"editor-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/editor/keyboard-shortcuts"]}),a.jsx(vv,{title:m("Global shortcuts"),categoryName:"global"}),a.jsx(vv,{title:m("Selection shortcuts"),categoryName:"selection"}),a.jsx(vv,{title:m("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:m("Change the block type after adding a new paragraph."),ariaLabel:m("Forward-slash")}]}),a.jsx(nN,{title:m("Text formatting"),shortcuts:IVt}),a.jsx(vv,{title:m("List View shortcuts"),categoryName:"list-view"})]}):null}function VVt({clientId:e,onClose:t}){const n=TOe(),{entity:o,onNavigateToEntityRecord:r,canEditTemplates:s}=G(l=>{const{getBlockParentsByBlockName:u,getSettings:d,getBlockAttributes:p,getBlockParents:f}=l(J),{getCurrentTemplateId:b,getRenderingMode:h}=l(_e),g=u(e,"core/block",!0)[0];let z;return g?z=l(Me).getEntityRecord("postType","wp_block",p(g).ref):h()==="template-locked"&&!f(e).some(_=>n.includes(_))&&(z=l(Me).getEntityRecord("postType","wp_template",b())),z?{canEditTemplates:l(Me).canUser("create",{kind:"postType",name:"wp_template"}),entity:z,onNavigateToEntityRecord:d().onNavigateToEntityRecord}:{}},[e,n]);if(!o)return a.jsx(HVt,{clientId:e,onClose:t});const i=o.type==="wp_block";let c=m(i?"Edit the pattern to move, delete, or make further changes to this block.":"Edit the template to move, delete, or make further changes to this block.");return s||(c=m("Only users with permissions to edit the template can move or delete this block")),a.jsxs(a.Fragment,{children:[a.jsx(F_,{children:a.jsx(Ct,{onClick:()=>{r({postId:o.id,postType:o.type})},disabled:!s,children:m(i?"Edit pattern":"Edit template")})}),a.jsx(Sn,{variant:"muted",as:"p",className:"editor-content-only-settings-menu__description",children:c})]})}function HVt({clientId:e,onClose:t}){const{contentLockingParent:n}=G(i=>{const{getContentLockingParent:c}=St(i(J));return{contentLockingParent:c(e)}},[e]),o=ji(n),r=Oe(J);if(!o?.title)return null;const{modifyContentLockBlock:s}=St(r);return a.jsxs(a.Fragment,{children:[a.jsx(F_,{children:a.jsx(Ct,{onClick:()=>{s(n),t()},children:We("Unlock","Unlock content locked blocks")})}),a.jsx(Sn,{variant:"muted",as:"p",className:"editor-content-only-settings-menu__description",children:m("Temporarily unlock the parent block to edit, delete or make further changes to this block.")})]})}function UVt(){return a.jsx(cb,{children:({selectedClientIds:e,onClose:t})=>e.length===1&&a.jsx(VVt,{clientId:e[0],onClose:t})})}function XVt(e,t=!1){return G(n=>{const{getEntityRecord:o,getDefaultTemplateId:r}=n(Me),s=r({slug:e,is_custom:t,ignore_empty:!0});return s?o("postType",L0,s)?.content?.raw:void 0},[e,t])}function GVt(e){const{slug:t,patterns:n}=G(s=>{const{getCurrentPostType:i,getCurrentPostId:c}=s(_e),{getEntityRecord:l,getBlockPatterns:u}=s(Me),d=c(),p=i();return{slug:l("postType",p,d).slug,patterns:u()}},[]),o=G(s=>s(Me).getCurrentTheme().stylesheet);function r(s){return s.innerBlocks.find(i=>i.name==="core/template-part")&&(s.innerBlocks=s.innerBlocks.map(i=>(i.name==="core/template-part"&&i.attributes.theme===void 0&&(i.attributes.theme=o),i))),s.name==="core/template-part"&&s.attributes.theme===void 0&&(s.attributes.theme=o),s}return x.useMemo(()=>[{name:"fallback",blocks:Ko(e),title:m("Fallback content")},...n.filter(s=>Array.isArray(s.templateTypes)&&s.templateTypes.some(i=>t.startsWith(i))).map(s=>({...s,blocks:Ko(s.content).map(i=>r(i))}))],[e,t,n])}function KVt({fallbackContent:e,onChoosePattern:t,postType:n}){const[,,o]=ya("postType",n),r=GVt(e);return a.jsx(qa,{blockPatterns:r,onClickPattern:(s,i)=>{o(i,{selection:void 0}),t()}})}function YVt({slug:e,isCustom:t,onClose:n,postType:o}){const r=XVt(e,t);return r?a.jsxs(Zo,{className:"editor-start-template-options__modal",title:m("Choose a pattern"),closeLabel:m("Cancel"),focusOnMount:"firstElement",onRequestClose:n,isFullScreen:!0,children:[a.jsx("div",{className:"editor-start-template-options__modal-content",children:a.jsx(KVt,{fallbackContent:r,slug:e,isCustom:t,postType:o,onChoosePattern:()=>{n()}})}),a.jsx(Yo,{className:"editor-start-template-options__modal__actions",justify:"flex-end",expanded:!1,children:a.jsx(Tn,{children:a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:n,children:m("Skip")})})})]}):null}function ZVt(){const[e,t]=x.useState(!1),{shouldOpenModal:n,slug:o,isCustom:r,postType:s,postId:i}=G(c=>{const{getCurrentPostType:l,getCurrentPostId:u}=c(_e),d=l(),p=u(),{getEditedEntityRecord:f,hasEditsForEntityRecord:b}=c(Me),h=f("postType",d,p);return{shouldOpenModal:!b("postType",d,p)&&h.content===""&&L0===d,slug:h.slug,isCustom:h.is_custom,postType:d,postId:p}},[]);return x.useEffect(()=>{t(!1)},[s,i]),!n||e?null:a.jsx(YVt,{slug:o,isCustom:r,postType:s,onClose:()=>t(!0)})}function QVt(){const e=G(g=>{const{richEditingEnabled:z,codeEditingEnabled:A}=g(_e).getEditorSettings();return!z||!A},[]),{getBlockSelectionStart:t}=G(J),{getActiveComplementaryArea:n}=G(xo),{enableComplementaryArea:o,disableComplementaryArea:r}=Oe(xo),{redo:s,undo:i,savePost:c,setIsListViewOpened:l,switchEditorMode:u,toggleDistractionFree:d}=Oe(_e),{isEditedPostDirty:p,isPostSavingLocked:f,isListViewOpened:b,getEditorMode:h}=G(_e);return p0("core/editor/toggle-mode",()=>{u(h()==="visual"?"text":"visual")},{isDisabled:e}),p0("core/editor/toggle-distraction-free",()=>{d()}),p0("core/editor/undo",g=>{i(),g.preventDefault()}),p0("core/editor/redo",g=>{s(),g.preventDefault()}),p0("core/editor/save",g=>{g.preventDefault(),!f()&&p()&&c()}),p0("core/editor/toggle-list-view",g=>{b()||(g.preventDefault(),l(!0))}),p0("core/editor/toggle-sidebar",g=>{if(g.preventDefault(),["edit-post/document","edit-post/block"].includes(n("core")))r("core");else{const A=t()?"edit-post/block":"edit-post/document";o("core",A)}}),null}function JVt({clientId:e,onClose:t}){const{getBlocks:n}=G(J),{replaceBlocks:o}=Oe(J);return G(s=>s(J).canRemoveBlock(e),[e])?a.jsx(Ct,{onClick:()=>{o(e,n(e)),t()},children:m("Detach")}):null}function eHt({clientIds:e,blocks:t}){const[n,o]=x.useState(!1),{replaceBlocks:r}=Oe(J),{createSuccessNotice:s}=Oe(mt),{canCreate:i}=G(l=>({canCreate:l(J).canInsertBlockType("core/template-part")}),[]);if(!i)return null;const c=async l=>{r(e,Ee("core/template-part",{slug:l.slug,theme:l.theme})),s(m("Template part created."),{type:"snackbar"})};return a.jsxs(a.Fragment,{children:[a.jsx(Ct,{icon:Qf,onClick:()=>{o(!0)},"aria-expanded":n,"aria-haspopup":"dialog",children:m("Create template part")}),n&&a.jsx(LI,{closeModal:()=>{o(!1)},blocks:t,onCreate:c})]})}function tHt(){return a.jsx(cb,{children:({selectedClientIds:e,onClose:t})=>a.jsx(nHt,{clientIds:e,onClose:t})})}function nHt({clientIds:e,onClose:t}){const{blocks:n}=G(o=>{const{getBlocksByClientId:r}=o(J);return{blocks:r(e)}},[e]);return n.length===1&&n[0]?.name==="core/template-part"?a.jsx(JVt,{clientId:e[0],onClose:t}):a.jsx(eHt,{clientIds:e,blocks:n})}const{ExperimentalBlockEditorProvider:oHt}=St(jn),{PatternsMenuItems:rHt}=St(Vi),one=()=>{},sHt=["wp_block","wp_navigation","wp_template_part"],iHt=["post-only","template-locked"];function aHt(e,t,n){const o=n==="template-locked"?"template":"post",[r,s,i]=ya("postType",e.type,{id:e.id}),[c,l,u]=ya("postType",t?.type,{id:t?.id}),d=x.useMemo(()=>{if(e.type==="wp_navigation")return[Ee("core/navigation",{ref:e.id,templateLock:!1})]},[e.type,e.id]),p=x.useMemo(()=>d||(o==="template"?c:r),[d,o,c,r]);return!!t&&n==="template-locked"||e.type==="wp_navigation"?[p,one,one]:[p,o==="post"?s:l,o==="post"?i:u]}const DOe=f$t(({post:e,settings:t,recovery:n,initialEdits:o,children:r,BlockEditorProviderComponent:s=oHt,__unstableTemplate:i})=>{const c=!!i,{editorSettings:l,selection:u,isReady:d,mode:p,defaultMode:f,postTypeEntities:b}=G(j=>{const{getEditorSettings:I,getEditorSelection:P,getRenderingMode:$,__unstableIsEditorReady:F}=j(_e),{getEntitiesConfig:X,getPostType:Z,hasFinishedResolution:V}=j(Me),Q=Z(e.type)?.supports,te=V("getPostType",[e.type]),ee=Array.isArray(Q?.editor)?Q.editor.find(ce=>"default_mode"in ce)?.default_mode:void 0,ue=iHt.includes(ee);return{editorSettings:I(),isReady:F()&&te,mode:$(),defaultMode:c&&ue?ee:"post-only",selection:P(),postTypeEntities:e.type==="wp_template"?X("postType"):null}},[e.type,c]),h=!!i&&p!=="post-only",g=h?i:e,z=x.useMemo(()=>{const j={};if(e.type==="wp_template"){if(e.slug==="page")j.postType="page";else if(e.slug==="single")j.postType="post";else if(e.slug.split("-")[0]==="single"){const I=b?.map($=>$.name)||[],P=e.slug.match(`^single-(${I.join("|")})(?:-.+)?$`);P&&(j.postType=P[1])}}else(!sHt.includes(g.type)||h)&&(j.postId=e.id,j.postType=e.type);return{...j,templateSlug:g.type==="wp_template"?g.slug:void 0}},[h,e.id,e.type,e.slug,g.type,g.slug,b]),{id:A,type:_}=g,v=R$t(l,_,A,p),[M,y,k]=aHt(e,i,p),{updatePostLock:S,setupEditor:C,updateEditorSettings:R,setCurrentTemplateId:T,setEditedPost:E,setRenderingMode:B}=St(Oe(_e)),{createWarningNotice:N}=Oe(mt);return x.useLayoutEffect(()=>{n||(S(t.postLock),C(e,o,t.template),t.autosave&&N(m("There is an autosave of this post that is more recent than the version below."),{id:"autosave-exists",actions:[{label:m("View the autosave"),url:t.autosave.editLink}]}))},[]),x.useEffect(()=>{E(e.type,e.id)},[e.type,e.id,E]),x.useEffect(()=>{R(t)},[t,R]),x.useEffect(()=>{T(i?.id)},[i?.id,T]),x.useEffect(()=>{B(f)},[f,B]),N$t(e.type,p),NVt(),!d||!p?null:a.jsx(HE,{kind:"root",type:"site",children:a.jsx(HE,{kind:"postType",type:e.type,id:e.id,children:a.jsx(uO,{value:z,children:a.jsxs(s,{value:M,onChange:k,onInput:y,selection:u,settings:v,useSubRegistry:!1,children:[r,!t.isPreviewMode&&a.jsxs(a.Fragment,{children:[a.jsx(rHt,{}),a.jsx(tHt,{}),a.jsx(UVt,{}),p==="template-locked"&&a.jsx(E$t,{}),_==="wp_navigation"&&a.jsx(W$t,{}),a.jsx(QVt,{}),a.jsx($Vt,{}),a.jsx(PVt,{}),a.jsx(jVt,{}),a.jsx(ZVt,{}),a.jsx(SVt,{}),a.jsx(qVt,{})]})]})})})})});function FOe(e){return a.jsx(DOe,{...e,BlockEditorProviderComponent:D5t,children:e.children})}const{useGlobalStyle:cHt}=St(jn);function lHt({template:e,post:t}){const[n="white"]=cHt("color.background"),[o]=ya("postType",t.type,{id:t.id}),[r]=ya("postType",e?.type,{id:e?.id}),s=e&&r?r:o,i=!s?.length;return a.jsxs("div",{className:"editor-fields-content-preview",style:{backgroundColor:n},children:[i&&a.jsx("span",{className:"editor-fields-content-preview__empty",children:m("Empty content")}),!i&&a.jsx(Vd.Async,{children:a.jsx(Vd,{blocks:s})})]})}function uHt({item:e}){const{settings:t,template:n}=G(o=>{var r;const{canUser:s,getPostType:i,getTemplateId:c,getEntityRecord:l}=St(o(Me)),u=s("read",{kind:"postType",name:"wp_template"}),d=o(_e).getEditorSettings(),p=d.supportsTemplateMode,f=(r=i(e.type)?.viewable)!==null&&r!==void 0?r:!1,b=p&&f&&u?c(e.type,e.id):null;return{settings:d,template:b?l("postType","wp_template",b):void 0}},[e.type,e.id]);return a.jsx(FOe,{post:e,settings:t,__unstableTemplate:n,children:a.jsx(lHt,{template:n,post:e})})}const dHt={type:"media",id:"content-preview",label:m("Content preview"),render:uHt,enableSorting:!1};function pHt(e,t,n){return{type:"REGISTER_ENTITY_ACTION",kind:e,name:t,config:n}}function fHt(e,t,n){return{type:"UNREGISTER_ENTITY_ACTION",kind:e,name:t,actionId:n}}function bHt(e,t,n){return{type:"REGISTER_ENTITY_FIELD",kind:e,name:t,config:n}}function hHt(e,t,n){return{type:"UNREGISTER_ENTITY_FIELD",kind:e,name:t,fieldId:n}}function mHt(e,t){return{type:"SET_IS_READY",kind:e,name:t}}const gHt=e=>async({registry:t})=>{if(St(t.select(_e)).isEntityReady("postType",e))return;St(t.dispatch(_e)).setIsReady("postType",e);const o=await t.resolveSelect(Me).getPostType(e),r=await t.resolveSelect(Me).canUser("create",{kind:"postType",name:e}),s=await t.resolveSelect(Me).getCurrentTheme(),i=[o.viewable?tFt:void 0,o.supports?.revisions?JFt:void 0,globalThis.IS_GUTENBERG_PLUGIN?!["wp_template","wp_block","wp_template_part"].includes(o.slug)&&r&&RFt:void 0,o.slug==="wp_template_part"&&r&&s?.is_block_theme?d$t:void 0,r&&o.slug==="wp_block"?PFt:void 0,o.supports?.title?TFt:void 0,o.supports?.["page-attributes"]?SFt:void 0,o.slug==="wp_block"?QFt:void 0,t$t,NFt,i$t,n$t,e$t].filter(Boolean),c=[o.supports?.thumbnail&&s?.theme_supports?.["post-thumbnails"]&&LDt,o.supports?.author&&eFt,KDt,QDt,E9t,o.supports?.["page-attributes"]&&VDt,o.supports?.comments&&YDt,jDt,UDt,o.supports?.editor&&o.viewable&&dHt].filter(Boolean);if(o.supports?.title){let l;e==="page"?l=B9t:e==="wp_template"?l=L9t:e==="wp_block"?l=MDt:l=dOe,c.push(l)}t.batch(()=>{i.forEach(l=>{St(t.dispatch(_e)).registerEntityAction("postType",e,l)}),c.forEach(l=>{St(t.dispatch(_e)).registerEntityField("postType",e,l)})}),RN("core.registerPostTypeSchema",e)};function MHt(e){return{type:"SET_CURRENT_TEMPLATE_ID",id:e}}const zHt=e=>async({select:t,dispatch:n,registry:o})=>{const r=await o.dispatch(Me).saveEntityRecord("postType","wp_template",e);return o.dispatch(Me).editEntityRecord("postType",t.getCurrentPostType(),t.getCurrentPostId(),{template:r.slug}),o.dispatch(mt).createSuccessNotice(m("Custom template created. You're in template mode now."),{type:"snackbar",actions:[{label:m("Go back"),onClick:()=>n.setRenderingMode(t.getEditorSettings().defaultRenderingMode)}]}),r},OHt=e=>({registry:t})=>{var n;const r=((n=t.select(ht).get("core","hiddenBlockTypes"))!==null&&n!==void 0?n:[]).filter(s=>!(Array.isArray(e)?e:[e]).includes(s));t.dispatch(ht).set("core","hiddenBlockTypes",r)},yHt=e=>({registry:t})=>{var n;const o=(n=t.select(ht).get("core","hiddenBlockTypes"))!==null&&n!==void 0?n:[],r=new Set([...o,...Array.isArray(e)?e:[e]]);t.dispatch(ht).set("core","hiddenBlockTypes",[...r])},AHt=({onSave:e,dirtyEntityRecords:t=[],entitiesToSkip:n=[],close:o}={})=>({registry:r})=>{const s=[{kind:"postType",name:"wp_navigation"}],i="site-editor-save-success",c=r.select(Me).getEntityRecord("root","__unstableBase")?.home;r.dispatch(mt).removeNotice(i);const l=t.filter(({kind:p,name:f,key:b,property:h})=>!n.some(g=>g.kind===p&&g.name===f&&g.key===b&&g.property===h));o?.(l);const u=[],d=[];l.forEach(({kind:p,name:f,key:b,property:h})=>{p==="root"&&f==="site"?u.push(h):(s.some(g=>g.kind===p&&g.name===f)&&r.dispatch(Me).editEntityRecord(p,f,b,{status:"publish"}),d.push(r.dispatch(Me).saveEditedEntityRecord(p,f,b)))}),u.length&&d.push(r.dispatch(Me).__experimentalSaveSpecifiedEntityEdits("root","site",void 0,u)),r.dispatch(J).__unstableMarkLastChangeAsPersistent(),Promise.all(d).then(p=>e?e(p):p).then(p=>{p.some(f=>typeof f>"u")?r.dispatch(mt).createErrorNotice(m("Saving failed.")):r.dispatch(mt).createSuccessNotice(m("Site updated."),{type:"snackbar",id:i,actions:[{label:m("View site"),url:c}]})}).catch(p=>r.dispatch(mt).createErrorNotice(`${m("Saving failed.")} ${p}`))},vHt=(e,{allowUndo:t=!0}={})=>async({registry:n})=>{const o="edit-site-template-reverted";if(n.dispatch(mt).removeNotice(o),!iOe(e)){n.dispatch(mt).createErrorNotice(m("This template is not revertable."),{type:"snackbar"});return}try{const r=n.select(Me).getEntityConfig("postType",e.type);if(!r){n.dispatch(mt).createErrorNotice(m("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});return}const s=tn(`${r.baseURL}/${e.id}`,{context:"edit",source:e.origin}),i=await Tt({path:s});if(!i){n.dispatch(mt).createErrorNotice(m("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});return}const c=({blocks:d=[]})=>Jd(d),l=n.select(Me).getEditedEntityRecord("postType",e.type,e.id);n.dispatch(Me).editEntityRecord("postType",e.type,e.id,{content:c,blocks:l.blocks,source:"custom"},{undoIgnore:!0});const u=Ko(i?.content?.raw);if(n.dispatch(Me).editEntityRecord("postType",e.type,i.id,{content:c,blocks:u,source:"theme"}),t){const d=()=>{n.dispatch(Me).editEntityRecord("postType",e.type,l.id,{content:c,blocks:l.blocks,source:"custom"})};n.dispatch(mt).createSuccessNotice(m("Template reset."),{type:"snackbar",id:o,actions:[{label:m("Undo"),onClick:d}]})}}catch(r){const s=r.message&&r.code!=="unknown_error"?r.message:m("Template revert failed. Please reload.");n.dispatch(mt).createErrorNotice(s,{type:"snackbar"})}},xHt=e=>async({registry:t})=>{const n=e.every(r=>r?.has_theme_file),o=await Promise.allSettled(e.map(r=>t.dispatch(Me).deleteEntityRecord("postType",r.type,r.id,{force:!0},{throwOnError:!0})));if(o.every(({status:r})=>r==="fulfilled")){let r;if(e.length===1){let s;typeof e[0].title=="string"?s=e[0].title:typeof e[0].title?.rendered=="string"?s=e[0].title?.rendered:typeof e[0].title?.raw=="string"&&(s=e[0].title?.raw),r=xe(n?m('"%s" reset.'):We('"%s" deleted.',"template part"),Lt(s))}else r=m(n?"Items reset.":"Items deleted.");t.dispatch(mt).createSuccessNotice(r,{type:"snackbar",id:"editor-template-deleted-success"})}else{let r;if(o.length===1)o[0].reason?.message?r=o[0].reason.message:r=m(n?"An error occurred while reverting the item.":"An error occurred while deleting the item.");else{const s=new Set,i=o.filter(({status:c})=>c==="rejected");for(const c of i)c.reason?.message&&s.add(c.reason.message);s.size===0?r=m("An error occurred while deleting the items."):s.size===1?r=n?xe(m("An error occurred while reverting the items: %s"),[...s][0]):xe(m("An error occurred while deleting the items: %s"),[...s][0]):r=n?xe(m("Some errors occurred while reverting the items: %s"),[...s].join(",")):xe(m("Some errors occurred while deleting the items: %s"),[...s].join(","))}t.dispatch(mt).createErrorNotice(r,{type:"snackbar"})}},wHt=Object.freeze(Object.defineProperty({__proto__:null,createTemplate:zHt,hideBlockTypes:yHt,registerEntityAction:pHt,registerEntityField:bHt,registerPostTypeSchema:gHt,removeTemplates:xHt,revertTemplate:vHt,saveDirtyEntities:AHt,setCurrentTemplateId:MHt,setIsReady:mHt,showBlockTypes:OHt,unregisterEntityAction:fHt,unregisterEntityField:hHt},Symbol.toStringTag,{value:"Module"})),$Oe=[];function _Ht(e,t,n){var o;return(o=e.actions[t]?.[n])!==null&&o!==void 0?o:$Oe}function kHt(e,t,n){var o;return(o=e.fields[t]?.[n])!==null&&o!==void 0?o:$Oe}function SHt(e,t,n){return e.isReady[t]?.[n]}const CHt={rootClientId:void 0,insertionIndex:void 0,filterValue:void 0},qHt=At(e=>It(t=>{if(typeof t.blockInserterPanel=="object")return t.blockInserterPanel;if(JW(t)==="template-locked"){const[n]=e(J).getBlocksByName("core/post-content");if(n)return{rootClientId:n,insertionIndex:void 0,filterValue:void 0}}return CHt},t=>{const[n]=e(J).getBlocksByName("core/post-content");return[t.blockInserterPanel,JW(t),n]}));function RHt(e){return e.listViewToggleRef}function THt(e){return e.inserterSidebarToggleRef}const rne={wp_block:Bd,wp_navigation:G3,page:wa,post:jw},EHt=At(e=>(t,n,o)=>{{if(n==="wp_template_part"||n==="wp_template"){const i=(e(Me).getEntityRecord("root","__unstableBase")?.default_template_part_areas||[]).find(c=>o.area===c.area);return i?.icon?CI(i.icon):nu}if(rne[n])return rne[n];const r=e(Me).getPostType(n);return typeof r?.icon=="string"&&r.icon.startsWith("dashicons-")?r.icon.slice(10):wa}}),WHt=At(e=>(t,n,o)=>{const{type:r,id:s}=G1(t),i=e(Me).getEntityRecordNonTransientEdits("postType",n||r,o||s);if(!i?.meta)return!1;const c=e(Me).getEntityRecord("postType",n||r,o||s)?.meta;return!bMe({...c,footnotes:void 0},{...i.meta,footnotes:void 0})});function NHt(e,...t){return _Ht(e.dataviews,...t)}function BHt(e,...t){return SHt(e.dataviews,...t)}function LHt(e,...t){return kHt(e.dataviews,...t)}const PHt=At(e=>It((t,n)=>{n=Array.isArray(n)?n:[n];const{getBlocksByName:o,getBlockParents:r,getBlockName:s}=e(J);return o(n).filter(i=>r(i).every(c=>{const l=s(c);return l!=="core/query"&&!n.includes(l)}))},()=>[e(J).getBlocks()])),jHt=Object.freeze(Object.defineProperty({__proto__:null,getEntityActions:NHt,getEntityFields:LHt,getInserter:qHt,getInserterSidebarToggleRef:THt,getListViewToggleRef:RHt,getPostBlocksByName:PHt,getPostIcon:EHt,hasPostMetaChanges:WHt,isEntityReady:BHt},Symbol.toStringTag,{value:"Module"})),VOe={reducer:ajt,selectors:lIt,actions:C9t},_e=w1(ljt,{...VOe});Us(_e);St(_e).registerPrivateActions(wHt);St(_e).registerPrivateSelectors(jHt);const IHt=e=>Or(t=>({attributes:n,setAttributes:o,...r})=>{const s=G(u=>u(_e).getCurrentPostType(),[]),[i,c]=Ao("postType",s,"meta"),l=x.useMemo(()=>({...n,...Object.fromEntries(Object.entries(e).map(([u,d])=>[u,i[d]]))}),[n,i]);return a.jsx(t,{attributes:l,setAttributes:u=>{const d=Object.fromEntries(Object.entries(u??{}).filter(([p])=>p in e).map(([p,f])=>[e[p],f]));Object.entries(d).length&&c(d),o(u)},...r})},"withMetaAttributeSource");function DHt(e){var t;const n=Object.fromEntries(Object.entries((t=e.attributes)!==null&&t!==void 0?t:{}).filter(([,{source:o}])=>o==="meta").map(([o,{meta:r}])=>[o,r]));return Object.entries(n).length&&(e.edit=IHt(n)(e.edit)),e}Bn("blocks.registerBlockType","core/editor/custom-sources-backwards-compatibility/shim-attribute-source",DHt);function FHt(e){const t=e.avatar_urls&&e.avatar_urls[24]?a.jsx("img",{className:"editor-autocompleters__user-avatar",alt:"",src:e.avatar_urls[24]}):a.jsx("span",{className:"editor-autocompleters__no-avatar"});return a.jsxs(a.Fragment,{children:[t,a.jsx("span",{className:"editor-autocompleters__user-name",children:e.name}),a.jsx("span",{className:"editor-autocompleters__user-slug",children:e.slug})]})}const $Ht={name:"users",className:"editor-autocompleters__user",triggerPrefix:"@",useItems(e){const t=G(o=>{const{getUsers:r}=o(Me);return r({context:"view",search:encodeURIComponent(e)})},[e]);return[x.useMemo(()=>t?t.map(o=>({key:`user-${o.slug}`,value:o,label:FHt(o)})):[],[t])]},getOptionCompletion(e){return`@${e.slug}`}};class VHt extends x.Component{constructor(t){super(t),this.needsAutosave=!!(t.isDirty&&t.isAutosaveable)}componentDidMount(){this.props.disableIntervalChecks||this.setAutosaveTimer()}componentDidUpdate(t){if(this.props.disableIntervalChecks){this.props.editsReference!==t.editsReference&&this.props.autosave();return}if(this.props.interval!==t.interval&&(clearTimeout(this.timerId),this.setAutosaveTimer()),!this.props.isDirty){this.needsAutosave=!1;return}if(this.props.isAutosaving&&!t.isAutosaving){this.needsAutosave=!1;return}this.props.editsReference!==t.editsReference&&(this.needsAutosave=!0)}componentWillUnmount(){clearTimeout(this.timerId)}setAutosaveTimer(t=this.props.interval*1e3){this.timerId=setTimeout(()=>{this.autosaveTimerHandler()},t)}autosaveTimerHandler(){if(!this.props.isAutosaveable){this.setAutosaveTimer(1e3);return}this.needsAutosave&&(this.needsAutosave=!1,this.props.autosave()),this.setAutosaveTimer()}render(){return null}}const HHt=Co([Ul((e,t)=>{const{getReferenceByDistinctEdits:n}=e(Me),{isEditedPostDirty:o,isEditedPostAutosaveable:r,isAutosavingPost:s,getEditorSettings:i}=e(_e),{interval:c=i().autosaveInterval}=t;return{editsReference:n(),isDirty:o(),isAutosaveable:r(),isAutosaving:s(),interval:c}}),Ff((e,t)=>({autosave(){const{autosave:n=e(_e).autosave}=t;n()}}))])(VHt);function HOe(e){const{isFrontPage:t,isPostsPage:n}=G(o=>{const{canUser:r,getEditedEntityRecord:s}=o(Me),i=r("read",{kind:"root",name:"site"})?s("root","site"):void 0,c=parseInt(e,10);return{isFrontPage:i?.page_on_front===c,isPostsPage:i?.page_for_posts===c}});return t?m("Homepage"):n?m("Posts Page"):!1}const UHt=Rr(Ce);function XHt(e){const{postId:t,postType:n,postTypeLabel:o,documentTitle:r,isNotFound:s,templateTitle:i,onNavigateToPreviousEntityRecord:c,isTemplatePreview:l}=G(_=>{var v;const{getCurrentPostType:M,getCurrentPostId:y,getEditorSettings:k,getRenderingMode:S}=_(_e),{getEditedEntityRecord:C,getPostType:R,isResolving:T}=_(Me),E=M(),B=y(),N=C("postType",E,B),{default_template_types:j=[]}=(v=_(Me).getEntityRecord("root","__unstableBase"))!==null&&v!==void 0?v:{},I=LO({templateTypes:j,template:N}),P=R(E)?.labels?.singular_name;return{postId:B,postType:E,postTypeLabel:P,documentTitle:N.title,isNotFound:!N&&!T("getEditedEntityRecord","postType",E,B),templateTitle:I.title,onNavigateToPreviousEntityRecord:k().onNavigateToPreviousEntityRecord,isTemplatePreview:S()==="template-locked"}},[]),{open:u}=Oe(Ef),d=$1(),p=K3e.includes(n),f=!!c,b=p?i:r,h=e.title||b,g=e.icon,z=HOe(t),A=x.useRef(!1);return x.useEffect(()=>{A.current=!0},[]),a.jsxs("div",{className:oe("editor-document-bar",{"has-back-button":f}),children:[a.jsx(Wd,{children:f&&a.jsx(UHt,{className:"editor-document-bar__back",icon:jt()?Af:qw,onClick:_=>{_.stopPropagation(),c()},size:"compact",initial:A.current?{opacity:0,transform:"translateX(15%)"}:!1,animate:{opacity:1,transform:"translateX(0%)"},exit:{opacity:0,transform:"translateX(15%)"},transition:d?{duration:0}:void 0,children:m("Back")})}),!p&&l&&a.jsx(Zn,{icon:nu,className:"editor-document-bar__icon-layout"}),s?a.jsx(Sn,{children:m("Document not found")}):a.jsxs(Ce,{className:"editor-document-bar__command",onClick:()=>u(),size:"compact",children:[a.jsxs(Rr.div,{className:"editor-document-bar__title",initial:A.current?{opacity:0,transform:f?"translateX(15%)":"translateX(-15%)"}:!1,animate:{opacity:1,transform:"translateX(0%)"},transition:d?{duration:0}:void 0,children:[g&&a.jsx(Zn,{icon:g}),a.jsxs(Sn,{size:"body",as:"h1",children:[a.jsx("span",{className:"editor-document-bar__post-title",children:h?x1(h):m("No title")}),z&&a.jsx("span",{className:"editor-document-bar__post-type-label",children:`· ${z}`}),o&&!e.title&&!z&&a.jsx("span",{className:"editor-document-bar__post-type-label",children:`· ${Lt(o)}`})]})]},f),a.jsx("span",{className:"editor-document-bar__shortcut",children:j1.primary("k")})]})]})}const sne=({children:e,isValid:t,level:n,href:o,onSelect:r})=>a.jsx("li",{className:oe("document-outline__item",`is-${n.toLowerCase()}`,{"is-invalid":!t}),children:a.jsxs("a",{href:o,className:"document-outline__button",onClick:r,children:[a.jsx("span",{className:"document-outline__emdash","aria-hidden":"true"}),a.jsx("strong",{className:"document-outline__level",children:n}),a.jsx("span",{className:"document-outline__item-content",children:e})]})}),GHt=a.jsx("em",{children:m("(Empty heading)")}),KHt=[a.jsx("br",{},"incorrect-break"),a.jsx("em",{children:m("(Incorrect heading level)")},"incorrect-message")],YHt=[a.jsx("br",{},"incorrect-break-h1"),a.jsx("em",{children:m("(Your theme may already use a H1 for the post title)")},"incorrect-message-h1")],ZHt=[a.jsx("br",{},"incorrect-break-multiple-h1"),a.jsx("em",{children:m("(Multiple H1 headings are not recommended)")},"incorrect-message-multiple-h1")];function QHt(){return a.jsxs(ge,{width:"138",height:"148",viewBox:"0 0 138 148",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx(S0,{width:"138",height:"148",rx:"4",fill:"#F0F6FC"}),a.jsx(MA,{x1:"44",y1:"28",x2:"24",y2:"28",stroke:"#DDDDDD"}),a.jsx(S0,{x:"48",y:"16",width:"27",height:"23",rx:"4",fill:"#DDDDDD"}),a.jsx(he,{d:"M54.7585 32V23.2727H56.6037V26.8736H60.3494V23.2727H62.1903V32H60.3494V28.3949H56.6037V32H54.7585ZM67.4574 23.2727V32H65.6122V25.0241H65.5611L63.5625 26.277V24.6406L65.723 23.2727H67.4574Z",fill:"black"}),a.jsx(MA,{x1:"55",y1:"59",x2:"24",y2:"59",stroke:"#DDDDDD"}),a.jsx(S0,{x:"59",y:"47",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),a.jsx(he,{d:"M65.7585 63V54.2727H67.6037V57.8736H71.3494V54.2727H73.1903V63H71.3494V59.3949H67.6037V63H65.7585ZM74.6605 63V61.6705L77.767 58.794C78.0313 58.5384 78.2528 58.3082 78.4318 58.1037C78.6136 57.8991 78.7514 57.6989 78.8452 57.5028C78.9389 57.304 78.9858 57.0895 78.9858 56.8594C78.9858 56.6037 78.9276 56.3835 78.8111 56.1989C78.6946 56.0114 78.5355 55.8679 78.3338 55.7685C78.1321 55.6662 77.9034 55.6151 77.6477 55.6151C77.3807 55.6151 77.1477 55.669 76.9489 55.777C76.75 55.8849 76.5966 56.0398 76.4886 56.2415C76.3807 56.4432 76.3267 56.6832 76.3267 56.9616H74.5753C74.5753 56.3906 74.7045 55.8949 74.9631 55.4744C75.2216 55.054 75.5838 54.7287 76.0497 54.4986C76.5156 54.2685 77.0526 54.1534 77.6605 54.1534C78.2855 54.1534 78.8295 54.2642 79.2926 54.4858C79.7585 54.7045 80.1207 55.0085 80.3793 55.3977C80.6378 55.7869 80.767 56.233 80.767 56.7358C80.767 57.0653 80.7017 57.3906 80.571 57.7116C80.4432 58.0327 80.2145 58.3892 79.8849 58.7812C79.5554 59.1705 79.0909 59.6378 78.4915 60.1832L77.2173 61.4318V61.4915H80.8821V63H74.6605Z",fill:"black"}),a.jsx(MA,{x1:"80",y1:"90",x2:"24",y2:"90",stroke:"#DDDDDD"}),a.jsx(S0,{x:"84",y:"78",width:"30",height:"23",rx:"4",fill:"#F0B849"}),a.jsx(he,{d:"M90.7585 94V85.2727H92.6037V88.8736H96.3494V85.2727H98.1903V94H96.3494V90.3949H92.6037V94H90.7585ZM99.5284 92.4659V91.0128L103.172 85.2727H104.425V87.2841H103.683L101.386 90.919V90.9872H106.564V92.4659H99.5284ZM103.717 94V92.0227L103.751 91.3793V85.2727H105.482V94H103.717Z",fill:"black"}),a.jsx(MA,{x1:"66",y1:"121",x2:"24",y2:"121",stroke:"#DDDDDD"}),a.jsx(S0,{x:"70",y:"109",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),a.jsx(he,{d:"M76.7585 125V116.273H78.6037V119.874H82.3494V116.273H84.1903V125H82.3494V121.395H78.6037V125H76.7585ZM88.8864 125.119C88.25 125.119 87.6832 125.01 87.1861 124.791C86.6918 124.57 86.3011 124.266 86.0142 123.879C85.7301 123.49 85.5838 123.041 85.5753 122.533H87.4332C87.4446 122.746 87.5142 122.933 87.642 123.095C87.7727 123.254 87.946 123.378 88.1619 123.466C88.3778 123.554 88.6207 123.598 88.8906 123.598C89.1719 123.598 89.4205 123.548 89.6364 123.449C89.8523 123.349 90.0213 123.212 90.1435 123.036C90.2656 122.859 90.3267 122.656 90.3267 122.426C90.3267 122.193 90.2614 121.987 90.1307 121.808C90.0028 121.626 89.8182 121.484 89.5767 121.382C89.3381 121.28 89.054 121.229 88.7244 121.229H87.9105V119.874H88.7244C89.0028 119.874 89.2486 119.825 89.4616 119.729C89.6776 119.632 89.8452 119.499 89.9645 119.328C90.0838 119.155 90.1435 118.953 90.1435 118.723C90.1435 118.504 90.0909 118.312 89.9858 118.148C89.8835 117.98 89.7386 117.849 89.5511 117.756C89.3665 117.662 89.1506 117.615 88.9034 117.615C88.6534 117.615 88.4247 117.661 88.2173 117.751C88.0099 117.839 87.8438 117.966 87.7188 118.131C87.5938 118.295 87.527 118.489 87.5185 118.71H85.75C85.7585 118.207 85.902 117.764 86.1804 117.381C86.4588 116.997 86.8338 116.697 87.3054 116.482C87.7798 116.263 88.3153 116.153 88.9119 116.153C89.5142 116.153 90.0412 116.263 90.4929 116.482C90.9446 116.7 91.2955 116.996 91.5455 117.368C91.7983 117.737 91.9233 118.152 91.9205 118.612C91.9233 119.101 91.7713 119.509 91.4645 119.835C91.1605 120.162 90.7642 120.369 90.2756 120.457V120.526C90.9176 120.608 91.4063 120.831 91.7415 121.195C92.0795 121.555 92.2472 122.007 92.2443 122.55C92.2472 123.047 92.1037 123.489 91.8139 123.875C91.527 124.261 91.1307 124.565 90.625 124.787C90.1193 125.009 89.5398 125.119 88.8864 125.119Z",fill:"black"})]})}const UOe=(e=[])=>e.flatMap((t={})=>t.name==="core/heading"?{...t,level:t.attributes.level,isEmpty:JHt(t)}:UOe(t.innerBlocks)),JHt=e=>!e.attributes.content||e.attributes.content.trim().length===0;function eUt({onSelect:e,hasOutlineItemsDisabled:t}){const{selectBlock:n}=Oe(J),{blocks:o,title:r,isTitleSupported:s}=G(f=>{var b;const{getBlocks:h}=f(J),{getEditedPostAttribute:g}=f(_e),{getPostType:z}=f(Me),A=z(g("type"));return{title:g("title"),blocks:h(),isTitleSupported:(b=A?.supports?.title)!==null&&b!==void 0?b:!1}}),i=x.useRef(1),c=UOe(o);if(c.length<1)return a.jsxs("div",{className:"editor-document-outline has-no-headings",children:[a.jsx(QHt,{}),a.jsx("p",{children:m("Navigate the structure of your document and address issues like empty or incorrect heading levels.")})]});const l=document.querySelector(".editor-post-title__input"),u=s&&r&&l,p=c.reduce((f,b)=>({...f,[b.level]:(f[b.level]||0)+1}),{})[1]>1;return a.jsx("div",{className:"document-outline",children:a.jsxs("ul",{children:[u&&a.jsx(sne,{level:m("Title"),isValid:!0,onSelect:e,href:`#${l.id}`,isDisabled:t,children:r}),c.map(f=>{const b=f.level>i.current+1,h=!f.isEmpty&&!b&&!!f.level&&(f.level!==1||!p&&!u);return i.current=f.level,a.jsxs(sne,{level:`H${f.level}`,isValid:h,isDisabled:t,href:`#block-${f.clientId}`,onSelect:()=>{n(f.clientId),e?.()},children:[f.isEmpty?GHt:Jp(eo({html:f.attributes.content})),b&&KHt,f.level===1&&p&&ZHt,u&&f.level===1&&!p&&YHt]},f.clientId)})]})})}function tUt(e,t){const n=da()?j1.primaryShift("z"):j1.primary("y"),o=G(s=>s(_e).hasEditorRedo(),[]),{redo:r}=Oe(_e);return a.jsx(Ce,{__next40pxDefaultSize:!0,...e,ref:t,icon:jt()?Fde:Rde,label:m("Redo"),shortcut:n,"aria-disabled":!o,onClick:o?r:void 0,className:"editor-history__redo"})}const nUt=x.forwardRef(tUt);function oUt(e,t){const n=G(r=>r(_e).hasEditorUndo(),[]),{undo:o}=Oe(_e);return a.jsx(Ce,{__next40pxDefaultSize:!0,...e,ref:t,icon:jt()?Rde:Fde,label:m("Undo"),shortcut:j1.primary("z"),"aria-disabled":!n,onClick:n?o:void 0,className:"editor-history__undo"})}const rUt=x.forwardRef(oUt);function sUt(){const[e,t]=x.useState(!1),n=G(s=>s(J).isValidTemplate(),[]),{setTemplateValidity:o,synchronizeTemplate:r}=Oe(J);return n?null:a.jsxs(a.Fragment,{children:[a.jsx(A1,{className:"editor-template-validation-notice",isDismissible:!1,status:"warning",actions:[{label:m("Keep it as is"),onClick:()=>o(!0)},{label:m("Reset the template"),onClick:()=>t(!0)}],children:m("The content of your post doesn’t match the template assigned to your post type.")}),a.jsx(wf,{isOpen:e,confirmButtonText:m("Reset"),onConfirm:()=>{t(!1),r()},onCancel:()=>t(!1),size:"medium",children:m("Resetting the template may result in loss of content, do you want to continue?")})]})}function ine(){const{notices:e}=G(r=>({notices:r(mt).getNotices()}),[]),{removeNotice:t}=Oe(mt),n=e.filter(({isDismissible:r,type:s})=>r&&s==="default"),o=e.filter(({isDismissible:r,type:s})=>!r&&s==="default");return a.jsxs(a.Fragment,{children:[a.jsx(sW,{notices:o,className:"components-editor-notices__pinned"}),a.jsx(sW,{notices:n,className:"components-editor-notices__dismissible",onRemove:t,children:a.jsx(sUt,{})})]})}const iUt=-3;function aUt(){const e=G(o=>o(mt).getNotices(),[]),{removeNotice:t}=Oe(mt),n=e.filter(({type:o})=>o==="snackbar").slice(iUt);return a.jsx(J2t,{notices:n,className:"components-editor-notices__snackbar",onRemove:t})}function cUt({record:e,checked:t,onChange:n}){const{name:o,kind:r,title:s,key:i}=e,{entityRecordTitle:c,hasPostMetaChanges:l}=G(u=>{var d;if(r!=="postType"||o!=="wp_template")return{entityRecordTitle:s,hasPostMetaChanges:St(u(_e)).hasPostMetaChanges(o,i)};const p=u(Me).getEditedEntityRecord(r,o,i),{default_template_types:f=[]}=(d=u(Me).getEntityRecord("root","__unstableBase"))!==null&&d!==void 0?d:{};return{entityRecordTitle:LO({template:p,templateTypes:f}).title,hasPostMetaChanges:St(u(_e)).hasPostMetaChanges(o,i)}},[o,r,s,i]);return a.jsxs(a.Fragment,{children:[a.jsx(a_,{children:a.jsx(K0,{__nextHasNoMarginBottom:!0,label:Lt(c)||m("Untitled"),checked:t,onChange:n})}),l&&a.jsx("ul",{className:"entities-saved-states__changes",children:a.jsx("li",{children:m("Post Meta.")})})]})}const{getGlobalStylesChanges:lUt,GlobalStylesContext:uUt}=St(jn);function dUt(e,t){switch(e){case"site":return m(t===1?"This change will affect your whole site.":"These changes will affect your whole site.");case"wp_template":return m("This change will affect pages and posts that use this template.");case"page":case"post":return m("The following has been modified.")}}function pUt({record:e}){const{user:t}=x.useContext(uUt),n=G(r=>r(Me).getEntityRecord(e.kind,e.name,e.key),[e.kind,e.name,e.key]),o=lUt(t,n,{maxResults:10});return o.length?a.jsx("ul",{className:"entities-saved-states__changes",children:o.map(r=>a.jsx("li",{children:r},r))}):null}function fUt({record:e,count:t}){if(e?.name==="globalStyles")return null;const n=dUt(e?.name,t);return n?a.jsx(a_,{children:n}):null}function bUt({list:e,unselectedEntities:t,setUnselectedEntities:n}){const o=e.length,r=e[0];let i=G(c=>c(Me).getEntityConfig(r.kind,r.name),[r.kind,r.name]).label;return r?.name==="wp_template_part"&&(i=m(o===1?"Template Part":"Template Parts")),a.jsxs(Qt,{title:i,initialOpen:!0,children:[a.jsx(fUt,{record:r,count:o}),e.map(c=>a.jsx(cUt,{record:c,checked:!t.some(l=>l.kind===c.kind&&l.name===c.name&&l.key===c.key&&l.property===c.property),onChange:l=>n(c,l)},c.key||c.property)),r?.name==="globalStyles"&&a.jsx(pUt,{record:r})]})}const hUt=()=>{const{editedEntities:e,siteEdits:t,siteEntityConfig:n}=G(l=>{const{__experimentalGetDirtyEntityRecords:u,getEntityRecordEdits:d,getEntityConfig:p}=l(Me);return{editedEntities:u(),siteEdits:d("root","site"),siteEntityConfig:p("root","site")}},[]),o=x.useMemo(()=>{var l;const u=e.filter(f=>!(f.kind==="root"&&f.name==="site")),d=(l=n?.meta?.labels)!==null&&l!==void 0?l:{},p=[];for(const f in t)p.push({kind:"root",name:"site",title:d[f]||f,property:f});return[...u,...p]},[e,t,n]),[r,s]=x.useState([]),i=({kind:l,name:u,key:d,property:p},f)=>{s(f?r.filter(b=>b.kind!==l||b.name!==u||b.key!==d||b.property!==p):[...r,{kind:l,name:u,key:d,property:p}])},c=o.length-r.length>0;return{dirtyEntityRecords:o,isDirty:c,setUnselectedEntities:i,unselectedEntities:r}};function mUt(e){return e}function gUt({close:e,renderDialog:t}){const n=hUt();return a.jsx(Jx,{close:e,renderDialog:t,...n})}function Jx({additionalPrompt:e=void 0,close:t,onSave:n=mUt,saveEnabled:o=void 0,saveLabel:r=m("Save"),renderDialog:s,dirtyEntityRecords:i,isDirty:c,setUnselectedEntities:l,unselectedEntities:u}){const d=x.useRef(),{saveDirtyEntities:p}=St(Oe(_e)),f=i.reduce((R,T)=>{const{name:E}=T;return R[E]||(R[E]=[]),R[E].push(T),R},{}),{site:b,wp_template:h,wp_template_part:g,...z}=f,A=[b,h,g,...Object.values(z)].filter(Array.isArray),_=o??c,v=x.useCallback(()=>t(),[t]),[M,y]=O0e({onClose:()=>v()}),k=vt(Jx,"label"),S=vt(Jx,"description"),C=i.length?m("Select the items you want to save."):void 0;return a.jsxs("div",{ref:s?M:void 0,...s&&y,className:"entities-saved-states__panel",role:s?"dialog":void 0,"aria-labelledby":s?k:void 0,"aria-describedby":s?S:void 0,children:[a.jsxs(Yo,{className:"entities-saved-states__panel-header",gap:2,children:[a.jsx(Tn,{isBlock:!0,as:Ce,variant:"secondary",size:"compact",onClick:v,children:m("Cancel")}),a.jsx(Tn,{isBlock:!0,as:Ce,ref:d,variant:"primary",size:"compact",disabled:!_,accessibleWhenDisabled:!0,onClick:()=>p({onSave:n,dirtyEntityRecords:i,entitiesToSkip:u,close:t}),className:"editor-entities-saved-states__save-button",children:r})]}),a.jsxs("div",{className:"entities-saved-states__text-prompt",children:[a.jsxs("div",{className:"entities-saved-states__text-prompt--header-wrapper",id:s?k:void 0,children:[a.jsx("strong",{className:"entities-saved-states__text-prompt--header",children:m("Are you ready to save?")}),e]}),a.jsx("p",{id:s?S:void 0,children:c?cr(xe(Dn("There is %d site change waiting to be saved.","There are %d site changes waiting to be saved.",i.length),i.length),{strong:a.jsx("strong",{})}):C})]}),A.map(R=>a.jsx(bUt,{list:R,unselectedEntities:u,setUnselectedEntities:l},R[0].name))]})}function MUt(){try{return uo(_e).getEditedPostContent()}catch{}}function ane({text:e,children:t,variant:n="secondary"}){const o=Hl(e);return a.jsx(Ce,{__next40pxDefaultSize:!0,variant:n,ref:o,children:t})}class zUt extends x.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(t){RN("editor.ErrorBoundary.errorLogged",t)}static getDerivedStateFromError(t){return{error:t}}render(){const{error:t}=this.state,{canCopyContent:n=!1}=this.props;return t?a.jsxs(Ot,{className:"editor-error-boundary",alignment:"baseline",spacing:4,justify:"space-between",expanded:!1,wrap:!0,children:[a.jsx(Sn,{as:"p",children:m("The editor has encountered an unexpected error.")}),a.jsxs(Ot,{expanded:!1,children:[n&&a.jsx(ane,{text:MUt,children:m("Copy contents")}),a.jsx(ane,{variant:"primary",text:t?.stack,children:m("Copy error")})]})]}):this.props.children}}function XOe({children:e}){return G(n=>{const{getEditedPostAttribute:o}=n(_e),{getPostType:r}=n(Me);return!!r(o("type"))?.supports?.["page-attributes"]},[])?e:null}function Sc({children:e,supportKeys:t}){const n=G(r=>{const{getEditedPostAttribute:s}=r(_e),{getPostType:i}=r(Me);return i(s("type"))},[]);let o=!!n;return n&&(o=(Array.isArray(t)?t:[t]).some(r=>!!n.supports[r])),o?e:null}const xs=x.forwardRef(({className:e,label:t,children:n},o)=>a.jsxs(Ot,{className:oe("editor-post-panel__row",e),ref:o,children:[t&&a.jsx("div",{className:"editor-post-panel__row-label",children:t}),a.jsx("div",{className:"editor-post-panel__row-control",children:n})]}));function GOe(e){const t=e.map(r=>({children:[],parent:void 0,...r}));if(t.some(({parent:r})=>r===void 0))return t;const n=t.reduce((r,s)=>{const{parent:i}=s;return r[i]||(r[i]=[]),r[i].push(s),r},{}),o=r=>r.map(s=>{const i=n[s.id];return{...s,children:i&&i.length?o(i):[]}});return o(n[0]||[])}const o3=e=>Lt(e),KOe=e=>({...e,name:o3(e.name)}),OUt=e=>(e??[]).map(KOe);function oN(e){return e?.title?.rendered?Lt(e.title.rendered):`#${e.id} (${m("no title")})`}const cne=(e,t)=>{const n=ms(e||"").toLowerCase(),o=ms(t||"").toLowerCase();return n===o?0:n.startsWith(o)?n.length:1/0};function yUt(){const{editPost:e}=Oe(_e),[t,n]=x.useState(!1),{isHierarchical:o,parentPostId:r,parentPostTitle:s,pageItems:i}=G(d=>{var p;const{getPostType:f,getEntityRecords:b,getEntityRecord:h}=d(Me),{getCurrentPostId:g,getEditedPostAttribute:z}=d(_e),A=z("type"),_=z("parent"),v=f(A),M=g(),y=(p=v?.hierarchical)!==null&&p!==void 0?p:!1,k={per_page:100,exclude:M,parent_exclude:M,orderby:"menu_order",order:"asc",_fields:"id,title,parent"};t&&(k.search=t);const S=_?h("postType",A,_):null;return{isHierarchical:y,parentPostId:_,parentPostTitle:S?oN(S):"",pageItems:y?b("postType",A,k):null}},[t]),c=x.useMemo(()=>{const d=(h,g=0)=>h.map(_=>[{value:_.id,label:"— ".repeat(g)+Lt(_.name),rawName:_.name},...d(_.children||[],g+1)]).sort(([_],[v])=>{const M=cne(_.rawName,t),y=cne(v.rawName,t);return M>=y?1:-1}).flat();if(!i)return[];let p=i.map(h=>({id:h.id,parent:h.parent,name:oN(h)}));t||(p=GOe(p));const f=d(p),b=f.find(h=>h.value===r);return s&&!b&&f.unshift({value:r,label:s}),f},[i,t,s,r]);if(!o)return null;const l=d=>{n(d)},u=d=>{e({parent:d})};return a.jsx(nb,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,className:"editor-page-attributes__parent",label:m("Parent"),help:m("Choose a parent page."),value:r,options:c,onFilterValueChange:F1(l,300),onChange:u,hideLabelFromVision:!0})}function AUt({isOpen:e,onClick:t}){const n=G(r=>{const{getEditedPostAttribute:s}=r(_e),i=s("parent");if(!i)return null;const{getEntityRecord:c}=r(Me),l=s("type");return c("postType",l,i)},[]),o=x.useMemo(()=>n?oN(n):m("None"),[n]);return a.jsx(Ce,{size:"compact",className:"editor-post-parent__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":xe(m("Change parent: %s"),o),onClick:t,children:o})}function vUt(){const e=G(r=>r(Me).getEntityRecord("root","__unstableBase")?.home,[]),[t,n]=x.useState(null),o=x.useMemo(()=>({anchor:t,placement:"left-start",offset:36,shift:!0}),[t]);return a.jsx(xs,{label:m("Parent"),ref:n,children:a.jsx(so,{popoverProps:o,className:"editor-post-parent__panel-dropdown",contentClassName:"editor-post-parent__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:r,onToggle:s})=>a.jsx(AUt,{isOpen:r,onClick:s}),renderContent:({onClose:r})=>a.jsxs("div",{className:"editor-post-parent",children:[a.jsx(Qs,{title:m("Parent"),onClose:r}),a.jsxs("div",{children:[cr(xe(m('Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %s/services/pricing.'),Ph(e).replace(/([/.])/g,"$1")),{wbr:a.jsx("wbr",{})}),a.jsx("p",{children:cr(m("They also show up as sub-items in the default navigation menu. Learn more."),{a:a.jsx(hr,{href:m("https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes")})})})]}),a.jsx(yUt,{})]})})})}const xUt="page-attributes";function wUt(){const{isEnabled:e,postType:t}=G(n=>{const{getEditedPostAttribute:o,isEditorPanelEnabled:r}=n(_e),{getPostType:s}=n(Me);return{isEnabled:r(xUt),postType:s(o("type"))}},[]);return!e||!t?null:a.jsx(vUt,{})}function _Ut(){return a.jsx(XOe,{children:a.jsx(wUt,{})})}const AT=m("Custom Template");function YOe({onClose:e}){const{defaultBlockTemplate:t,onNavigateToEntityRecord:n}=G(d=>{const{getEditorSettings:p,getCurrentTemplateId:f}=d(_e);return{defaultBlockTemplate:p().defaultBlockTemplate,onNavigateToEntityRecord:p().onNavigateToEntityRecord,getTemplateId:f}}),{createTemplate:o}=St(Oe(_e)),[r,s]=x.useState(""),[i,c]=x.useState(!1),l=()=>{s(""),e()},u=async d=>{if(d.preventDefault(),i)return;c(!0);const p=t??Ks([Ee("core/group",{tagName:"header",layout:{inherit:!0}},[Ee("core/site-title"),Ee("core/site-tagline")]),Ee("core/separator"),Ee("core/group",{tagName:"main"},[Ee("core/group",{layout:{inherit:!0}},[Ee("core/post-title")]),Ee("core/post-content",{layout:{inherit:!0}})])]),f=await o({slug:A5(r||AT),content:p,title:r||AT});c(!1),n({postId:f.id,postType:"wp_template"}),l()};return a.jsx(Zo,{title:m("Create custom template"),onRequestClose:l,focusOnMount:"firstContentElement",size:"small",children:a.jsx("form",{className:"editor-post-template__create-form",onSubmit:u,children:a.jsxs(dt,{spacing:"3",children:[a.jsx(dn,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:m("Name"),value:r,onChange:s,placeholder:AT,disabled:i,help:m('Describe the template, e.g. "Post with sidebar". A custom template can be manually applied to any post or page.')}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:l,children:m("Cancel")}),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",isBusy:i,"aria-disabled":i,children:m("Create")})]})]})})})}function ik(){return G(e=>{const{getCurrentPostId:t,getCurrentPostType:n}=e(_e);return{postId:t(),postType:n()}},[])}function ak(){const{postType:e,postId:t}=ik();return G(n=>{const{canUser:o,getEntityRecord:r,getEntityRecords:s}=n(Me),i=o("read",{kind:"root",name:"site"})?r("root","site"):void 0,c=s("postType","wp_template",{per_page:-1}),l=+t===i?.page_for_posts,u=e==="page"&&+t===i?.page_on_front&&c?.some(({slug:d})=>d==="front-page");return!l&&!u},[t,e])}function ZOe(e){return G(t=>t(Me).getEntityRecords("postType","wp_template",{per_page:-1,post_type:e}),[e])}function QOe(e){const t=JOe(),n=ak(),o=ZOe(e);return x.useMemo(()=>n&&o?.filter(r=>r.is_custom&&r.slug!==t&&!!r.content.raw),[o,t,n])}function JOe(){const{postType:e,postId:t}=ik(),n=ZOe(e),o=G(r=>r(Me).getEditedEntityRecord("postType",e,t)?.template,[e,t]);if(o)return n?.find(r=>r.slug===o)?.slug}const kUt={className:"editor-post-template__dropdown",placement:"bottom-start"};function SUt({isOpen:e,onClick:t}){const n=G(o=>{const r=o(_e).getEditedPostAttribute("template"),{supportsTemplateMode:s,availableTemplates:i}=o(_e).getEditorSettings();if(!s&&i[r])return i[r];const c=o(Me).canUser("create",{kind:"postType",name:"wp_template"})&&o(_e).getCurrentTemplateId();return c?.title||c?.slug||i?.[r]},[]);return a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary","aria-expanded":e,"aria-label":m("Template options"),onClick:t,children:n??m("Default template")})}function CUt({onClose:e}){var t,n;const o=ak(),{availableTemplates:r,fetchedTemplates:s,selectedTemplateSlug:i,canCreate:c,canEdit:l,currentTemplateId:u,onNavigateToEntityRecord:d,getEditorSettings:p}=G(_=>{const{canUser:v,getEntityRecords:M}=_(Me),y=_(_e).getEditorSettings(),k=v("create",{kind:"postType",name:"wp_template"}),S=_(_e).getCurrentTemplateId();return{availableTemplates:y.availableTemplates,fetchedTemplates:k?M("postType","wp_template",{post_type:_(_e).getCurrentPostType(),per_page:-1}):void 0,selectedTemplateSlug:_(_e).getEditedPostAttribute("template"),canCreate:o&&k&&y.supportsTemplateMode,canEdit:o&&k&&y.supportsTemplateMode&&!!S,currentTemplateId:S,onNavigateToEntityRecord:y.onNavigateToEntityRecord,getEditorSettings:_(_e).getEditorSettings}},[o]),f=x.useMemo(()=>Object.entries({...r,...Object.fromEntries((s??[]).map(({slug:_,title:v})=>[_,v.rendered]))}).map(([_,v])=>({value:_,label:v})),[r,s]),b=(t=f.find(_=>_.value===i))!==null&&t!==void 0?t:f.find(_=>!_.value),{editPost:h}=Oe(_e),{createSuccessNotice:g}=Oe(mt),[z,A]=x.useState(!1);return a.jsxs("div",{className:"editor-post-template__classic-theme-dropdown",children:[a.jsx(Qs,{title:m("Template"),help:m("Templates define the way content is displayed when viewing your site."),actions:c?[{icon:hZe,label:m("Add template"),onClick:()=>A(!0)}]:[],onClose:e}),o?a.jsx(Pn,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:!0,label:m("Template"),value:(n=b?.value)!==null&&n!==void 0?n:"",options:f,onChange:_=>h({template:_||""})}):a.jsx(A1,{status:"warning",isDismissible:!1,children:m("The posts page template cannot be changed.")}),l&&d&&a.jsx("p",{children:a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>{d({postId:u,postType:"wp_template"}),e(),g(m("Editing template. Changes made here affect all posts and pages that use the template."),{type:"snackbar",actions:[{label:m("Go back"),onClick:()=>p().onNavigateToPreviousEntityRecord()}]})},children:m("Edit template")})}),z&&a.jsx(YOe,{onClose:()=>A(!1)})]})}function qUt(){return a.jsx(so,{popoverProps:kUt,focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>a.jsx(SUt,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>a.jsx(CUt,{onClose:e})})}const{PreferenceBaseOption:RUt}=St(cp);function c2(e){const{toggleEditorPanelEnabled:t}=Oe(_e),{isChecked:n,isRemoved:o}=G(r=>{const{isEditorPanelEnabled:s,isEditorPanelRemoved:i}=r(_e);return{isChecked:s(e.panelName),isRemoved:i(e.panelName)}},[e.panelName]);return o?null:a.jsx(RUt,{isChecked:n,onChange:()=>t(e.panelName),...e})}const{Fill:TUt,Slot:EUt}=Qn("EnablePluginDocumentSettingPanelOption"),II=({label:e,panelName:t})=>a.jsx(TUt,{children:a.jsx(c2,{label:e,panelName:t})});II.Slot=EUt;const{Fill:WUt,Slot:NUt}=Qn("PluginDocumentSettingPanel"),eye=({name:e,className:t,title:n,icon:o,children:r})=>{const{name:s}=PO(),i=`${s}/${e}`,{opened:c,isEnabled:l}=G(d=>{const{isEditorPanelOpened:p,isEditorPanelEnabled:f}=d(_e);return{opened:p(i),isEnabled:f(i)}},[i]),{toggleEditorPanelOpened:u}=Oe(_e);return e===void 0&&globalThis.SCRIPT_DEBUG===!0&&zn("PluginDocumentSettingPanel requires a name property."),a.jsxs(a.Fragment,{children:[a.jsx(II,{label:n,panelName:i}),a.jsx(WUt,{children:l&&a.jsx(Qt,{className:t,title:n,icon:o,opened:c,onToggle:()=>u(i),children:r})})]})};eye.Slot=NUt;const{Fill:BUt,Slot:LUt}=Qn("PluginPostPublishPanel"),tye=({children:e,className:t,title:n,initialOpen:o=!1,icon:r})=>{const{icon:s}=PO();return a.jsx(BUt,{children:a.jsx(Qt,{className:t,initialOpen:o||!n,title:n,icon:r??s,children:e})})};tye.Slot=LUt;const{Fill:PUt,Slot:jUt}=Qn("PluginPostStatusInfo"),nye=({children:e,className:t})=>a.jsx(PUt,{children:a.jsx(a_,{className:t,children:e})});nye.Slot=jUt;const{Fill:IUt,Slot:DUt}=Qn("PluginPrePublishPanel"),oye=({children:e,className:t,title:n,initialOpen:o=!1,icon:r})=>{const{icon:s}=PO();return a.jsx(IUt,{children:a.jsx(Qt,{className:t,initialOpen:o||!n,title:n,icon:r??s,children:e})})};oye.Slot=DUt;function rN({className:e,...t}){return a.jsx(sk,{panelClassName:e,className:"editor-sidebar",scope:"core",...t})}function FUt({onClick:e}){const[t,n]=x.useState(!1),{postType:o,postId:r}=ik(),s=QOe(o),{editEntityRecord:i}=Oe(Me);if(!s?.length)return null;const c=async l=>{i("postType",o,r,{template:l.name},{undoIgnore:!0}),n(!1),e()};return a.jsxs(a.Fragment,{children:[a.jsx(Ct,{onClick:()=>n(!0),children:m("Change template")}),t&&a.jsx(Zo,{title:m("Choose a template"),onRequestClose:()=>n(!1),overlayClassName:"editor-post-template__swap-template-modal",isFullScreen:!0,children:a.jsx("div",{className:"editor-post-template__swap-template-modal-content",children:a.jsx($Ut,{postType:o,onSelect:c})})})]})}function $Ut({postType:e,onSelect:t}){const n=QOe(e),o=x.useMemo(()=>n.map(r=>({name:r.slug,blocks:Ko(r.content.raw),title:Lt(r.title.rendered),id:r.id})),[n]);return a.jsx(qa,{label:m("Templates"),blockPatterns:o,onClickPattern:t})}function VUt({onClick:e}){const t=JOe(),n=ak(),{postType:o,postId:r}=ik(),{editEntityRecord:s}=Oe(Me);return!t||!n?null:a.jsx(Ct,{onClick:()=>{s("postType",o,r,{template:""},{undoIgnore:!0}),e()},children:m("Use default template")})}function HUt({onClick:e}){const{canCreateTemplates:t}=G(s=>{const{canUser:i}=s(Me);return{canCreateTemplates:i("create",{kind:"postType",name:"wp_template"})}},[]),[n,o]=x.useState(!1),r=ak();return!t||!r?null:a.jsxs(a.Fragment,{children:[a.jsx(Ct,{onClick:()=>{o(!0)},children:m("Create new template")}),n&&a.jsx(YOe,{onClose:()=>{o(!1),e()}})]})}const UUt={className:"editor-post-template__dropdown",placement:"bottom-start"};function XUt({id:e}){const{isTemplateHidden:t,onNavigateToEntityRecord:n,getEditorSettings:o,hasGoBack:r}=G(b=>{const{getRenderingMode:h,getEditorSettings:g}=St(b(_e)),z=g();return{isTemplateHidden:h()==="post-only",onNavigateToEntityRecord:z.onNavigateToEntityRecord,getEditorSettings:g,hasGoBack:z.hasOwnProperty("onNavigateToPreviousEntityRecord")}},[]),{get:s}=G(ht),{editedRecord:i,hasResolved:c}=X5("postType","wp_template",e),{createSuccessNotice:l}=Oe(mt),{setRenderingMode:u}=Oe(_e),d=G(b=>!!b(Me).canUser("create",{kind:"postType",name:"wp_template"}),[]);if(!c)return null;const p=r?[{label:m("Go back"),onClick:()=>o().onNavigateToPreviousEntityRecord()}]:void 0,f=()=>{s("core/edit-site","welcomeGuideTemplate")||l(m("Editing template. Changes made here affect all posts and pages that use the template."),{type:"snackbar",actions:p})};return a.jsx(c0,{popoverProps:UUt,focusOnMount:!0,toggleProps:{size:"compact",variant:"tertiary",tooltipPosition:"middle left"},label:m("Template options"),text:Lt(i.title),icon:null,children:({onClose:b})=>a.jsxs(a.Fragment,{children:[a.jsxs(Cn,{children:[d&&a.jsx(Ct,{onClick:()=>{n({postId:i.id,postType:"wp_template"}),b(),f()},children:m("Edit template")}),a.jsx(FUt,{onClick:b}),a.jsx(VUt,{onClick:b}),d&&a.jsx(HUt,{onClick:b})]}),a.jsx(Cn,{children:a.jsx(Ct,{icon:t?void 0:M0,isSelected:!t,role:"menuitemcheckbox",onClick:()=>{u(t?"template-locked":"post-only")},children:m("Show template")})})]})})}function GUt(){const{templateId:e,isBlockTheme:t}=G(r=>{const{getCurrentTemplateId:s,getEditorSettings:i}=r(_e);return{templateId:s(),isBlockTheme:i().__unstableIsBlockBasedTheme}},[]),n=G(r=>{var s;const i=r(_e).getCurrentPostType();if(!r(Me).getPostType(i)?.viewable)return!1;const l=r(_e).getEditorSettings();return!!l.availableTemplates&&Object.keys(l.availableTemplates).length>0?!0:l.supportsTemplateMode&&(s=r(Me).canUser("create",{kind:"postType",name:"wp_template"}))!==null&&s!==void 0?s:!1},[]),o=G(r=>{var s;return(s=r(Me).canUser("read",{kind:"postType",name:"wp_template"}))!==null&&s!==void 0?s:!1},[]);return(!t||!o)&&n?a.jsx(xs,{label:m("Template"),children:a.jsx(qUt,{})}):t&&e?a.jsx(xs,{label:m("Template"),children:a.jsx(XUt,{id:e})}):null}const rye={_fields:"id,name",context:"view"},DI={who:"authors",per_page:100,...rye};function FI(e){const{authorId:t,authors:n,postAuthor:o}=G(s=>{const{getUser:i,getUsers:c}=s(Me),{getEditedPostAttribute:l}=s(_e),u=l("author"),d={...DI};return e&&(d.search=e,d.search_columns=["name"]),{authorId:u,authors:c(d),postAuthor:i(u,rye)}},[e]),r=x.useMemo(()=>{const s=(n??[]).map(l=>({value:l.id,label:Lt(l.name)})),i=s.findIndex(({value:l})=>o?.id===l);let c=[];return i<0&&o?c=[{value:o.id,label:Lt(o.name)}]:i<0&&!o&&(c=[{value:0,label:m("(No author)")}]),[...c,...s]},[n,o]);return{authorId:t,authorOptions:r,postAuthor:o}}function KUt(){const[e,t]=x.useState(),{editPost:n}=Oe(_e),{authorId:o,authorOptions:r}=FI(e),s=c=>{c&&n({author:c})},i=c=>{t(c)};return a.jsx(nb,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:m("Author"),options:r,value:o,onFilterValueChange:F1(i,300),onChange:s,allowReset:!1,hideLabelFromVision:!0})}function YUt(){const{editPost:e}=Oe(_e),{authorId:t,authorOptions:n}=FI(),o=r=>{const s=Number(r);e({author:s})};return a.jsx(Pn,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"post-author-selector",label:m("Author"),options:n,onChange:o,value:t,hideLabelFromVision:!0})}const ZUt=25;function QUt(){return G(t=>t(Me).getUsers(DI)?.length>=ZUt,[])?a.jsx(KUt,{}):a.jsx(YUt,{})}function JUt({children:e}){const{hasAssignAuthorAction:t,hasAuthors:n}=G(o=>{var r;const s=o(_e).getCurrentPost(),i=o(Me).getUsers(DI);return{hasAssignAuthorAction:(r=s._links?.["wp:action-assign-author"])!==null&&r!==void 0?r:!1,hasAuthors:i?.length>=1}},[]);return!t||!n?null:a.jsx(Sc,{supportKeys:"author",children:e})}function eXt({isOpen:e,onClick:t}){const{postAuthor:n}=FI(),o=Lt(n?.name)||m("(No author)");return a.jsx(Ce,{size:"compact",className:"editor-post-author__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":xe(m("Change author: %s"),o),onClick:t,children:o})}function tXt(){const[e,t]=x.useState(null),n=x.useMemo(()=>({anchor:e,placement:"left-start",offset:36,shift:!0}),[e]);return a.jsx(JUt,{children:a.jsx(xs,{label:m("Author"),ref:t,children:a.jsx(so,{popoverProps:n,contentClassName:"editor-post-author__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:o,onToggle:r})=>a.jsx(eXt,{isOpen:o,onClick:r}),renderContent:({onClose:o})=>a.jsxs("div",{className:"editor-post-author",children:[a.jsx(Qs,{title:m("Author"),onClose:o}),a.jsx(QUt,{onClose:o})]})})})})}const nXt=[{label:We("Open",'Adjective: e.g. "Comments are open"'),value:"open",description:m("Visitors can add new comments and replies.")},{label:m("Closed"),value:"closed",description:[m("Visitors cannot add new comments or replies."),m("Existing comments remain visible.")].join(" ")}];function oXt(){const e=G(o=>{var r;return(r=o(_e).getEditedPostAttribute("comment_status"))!==null&&r!==void 0?r:"open"},[]),{editPost:t}=Oe(_e),n=o=>t({comment_status:o});return a.jsx("form",{children:a.jsx(dt,{spacing:4,children:a.jsx(sb,{className:"editor-change-status__options",hideLabelFromVision:!0,label:m("Comment status"),options:nXt,onChange:n,selected:e})})})}function rXt(){const e=G(o=>{var r;return(r=o(_e).getEditedPostAttribute("ping_status"))!==null&&r!==void 0?r:"open"},[]),{editPost:t}=Oe(_e),n=()=>t({ping_status:e==="open"?"closed":"open"});return a.jsx(K0,{__nextHasNoMarginBottom:!0,label:m("Enable pingbacks & trackbacks"),checked:e==="open",onChange:n,help:a.jsx(hr,{href:m("https://wordpress.org/documentation/article/trackbacks-and-pingbacks/"),children:m("Learn more about pingbacks & trackbacks")})})}const sXt="discussion-panel";function iXt({onClose:e}){return a.jsxs("div",{className:"editor-post-discussion",children:[a.jsx(Qs,{title:m("Discussion"),onClose:e}),a.jsxs(dt,{spacing:4,children:[a.jsx(Sc,{supportKeys:"comments",children:a.jsx(oXt,{})}),a.jsx(Sc,{supportKeys:"trackbacks",children:a.jsx(rXt,{})})]})]})}function aXt({isOpen:e,onClick:t}){const{commentStatus:n,pingStatus:o,commentsSupported:r,trackbacksSupported:s}=G(c=>{var l,u;const{getEditedPostAttribute:d}=c(_e),{getPostType:p}=c(Me),f=p(d("type"));return{commentStatus:(l=d("comment_status"))!==null&&l!==void 0?l:"open",pingStatus:(u=d("ping_status"))!==null&&u!==void 0?u:"open",commentsSupported:!!f.supports.comments,trackbacksSupported:!!f.supports.trackbacks}},[]);let i;return n==="open"?o==="open"?i=We("Open",'Adjective: e.g. "Comments are open"'):i=s?m("Comments only"):We("Open",'Adjective: e.g. "Comments are open"'):o==="open"?i=m(r?"Pings only":"Pings enabled"):i=m("Closed"),a.jsx(Ce,{size:"compact",className:"editor-post-discussion__panel-toggle",variant:"tertiary","aria-label":m("Change discussion options"),"aria-expanded":e,onClick:t,children:i})}function cXt(){const{isEnabled:e}=G(r=>{const{isEditorPanelEnabled:s}=r(_e);return{isEnabled:s(sXt)}},[]),[t,n]=x.useState(null),o=x.useMemo(()=>({anchor:t,placement:"left-start",offset:36,shift:!0}),[t]);return e?a.jsx(Sc,{supportKeys:["comments","trackbacks"],children:a.jsx(xs,{label:m("Discussion"),ref:n,children:a.jsx(so,{popoverProps:o,className:"editor-post-discussion__panel-dropdown",contentClassName:"editor-post-discussion__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:r,onToggle:s})=>a.jsx(aXt,{isOpen:r,onClick:s}),renderContent:({onClose:r})=>a.jsx(iXt,{onClose:r})})})}):null}function lXt({hideLabelFromVision:e=!1,updateOnBlur:t=!1}){const{excerpt:n,shouldUseDescriptionLabel:o,usedAttribute:r}=G(d=>{const{getCurrentPostType:p,getEditedPostAttribute:f}=d(_e),b=p(),h=["wp_template","wp_template_part"].includes(b)?"description":"excerpt";return{excerpt:f(h),shouldUseDescriptionLabel:["wp_template","wp_template_part","wp_block"].includes(b),usedAttribute:h}},[]),{editPost:s}=Oe(_e),[i,c]=x.useState(Lt(n)),l=d=>{s({[r]:d})},u=m(o?"Write a description (optional)":"Write an excerpt (optional)");return a.jsx("div",{className:"editor-post-excerpt",children:a.jsx(Li,{__nextHasNoMarginBottom:!0,label:u,hideLabelFromVision:e,className:"editor-post-excerpt__textarea",onChange:t?c:l,onBlur:t?()=>l(i):void 0,value:t?i:n,help:o?m("Write a description"):a.jsx(hr,{href:m("https://wordpress.org/documentation/article/page-post-settings-sidebar/#excerpt"),children:m("Learn more about manual excerpts")})})})}function sye({children:e}){return a.jsx(Sc,{supportKeys:"excerpt",children:e})}const{Fill:uXt,Slot:dXt}=Qn("PluginPostExcerpt"),$I=({children:e,className:t})=>a.jsx(uXt,{children:a.jsx(a_,{className:t,children:e})});$I.Slot=dXt;const pXt="post-excerpt";function fXt(){return a.jsx(sye,{children:a.jsx(bXt,{})})}function bXt(){const{shouldRender:e,excerpt:t,shouldBeUsedAsDescription:n,allowEditing:o}=G(p=>{const{getCurrentPostType:f,getCurrentPostId:b,getEditedPostAttribute:h,isEditorPanelEnabled:g}=p(_e),z=f(),A=["wp_template","wp_template_part"].includes(z),_=z==="wp_block",v=A||_,M=A?"description":"excerpt",y=A&&p(Me).getEntityRecord("postType",z,b()),k=g(pXt)||v;return{excerpt:h(M),shouldRender:k,shouldBeUsedAsDescription:v,allowEditing:k&&(!v||_||y&&y.source===G3e.custom&&!y.has_theme_file&&y.is_custom)}},[]),[r,s]=x.useState(null),i=m(n?"Description":"Excerpt"),c=x.useMemo(()=>({anchor:r,"aria-label":i,headerTitle:i,placement:"left-start",offset:36,shift:!0}),[r,i]);if(!e)return!1;const l=!!t&&a.jsx(Sn,{align:"left",numberOfLines:4,truncate:o,children:Lt(t)});if(!o)return l;const u=m(n?"Add a description…":"Add an excerpt…"),d=m(n?"Edit description":"Edit excerpt");return a.jsxs(dt,{children:[l,a.jsx(so,{className:"editor-post-excerpt__dropdown",contentClassName:"editor-post-excerpt__dropdown__content",popoverProps:c,focusOnMount:!0,ref:s,renderToggle:({onToggle:p})=>a.jsx(Ce,{__next40pxDefaultSize:!0,onClick:p,variant:"link",children:l?d:u}),renderContent:({onClose:p})=>a.jsxs(a.Fragment,{children:[a.jsx(Qs,{title:i,onClose:p}),a.jsx(dt,{spacing:4,children:a.jsx($I.Slot,{children:f=>a.jsxs(a.Fragment,{children:[a.jsx(lXt,{hideLabelFromVision:!0,updateOnBlur:!0}),f]})})})]})})]})}function hXt({children:e,supportKeys:t}){const{postType:n,themeSupports:o}=G(s=>({postType:s(_e).getEditedPostAttribute("type"),themeSupports:s(Me).getThemeSupports()}),[]);return(Array.isArray(t)?t:[t]).some(s=>{var i;const c=(i=o?.[s])!==null&&i!==void 0?i:!1;return s==="post-thumbnails"&&Array.isArray(c)?c.includes(n):c})?e:null}function e5({children:e}){return a.jsx(hXt,{supportKeys:"post-thumbnails",children:a.jsx(Sc,{supportKeys:"thumbnail",children:e})})}const lne=["image"],mXt=m("Featured image"),gXt=m("Add a featured image"),MXt=a.jsx("p",{children:m("To edit the featured image, you need permission to upload media.")});function zXt(e,t){var n,o;if(!e)return{};const r=gr("editor.PostFeaturedImage.imageSize","large",e.id,t);if(r in((n=e?.media_details?.sizes)!==null&&n!==void 0?n:{}))return{mediaWidth:e.media_details.sizes[r].width,mediaHeight:e.media_details.sizes[r].height,mediaSourceUrl:e.media_details.sizes[r].source_url};const s=gr("editor.PostFeaturedImage.imageSize","thumbnail",e.id,t);return s in((o=e?.media_details?.sizes)!==null&&o!==void 0?o:{})?{mediaWidth:e.media_details.sizes[s].width,mediaHeight:e.media_details.sizes[s].height,mediaSourceUrl:e.media_details.sizes[s].source_url}:{mediaWidth:e.media_details.width,mediaHeight:e.media_details.height,mediaSourceUrl:e.source_url}}function OXt({currentPostId:e,featuredImageId:t,onUpdateImage:n,onRemoveImage:o,media:r,postType:s,noticeUI:i,noticeOperations:c,isRequestingFeaturedImageMedia:l}){const u=x.useRef(!1),[d,p]=x.useState(!1),{getSettings:f}=G(J),{mediaSourceUrl:b}=zXt(r,e);function h(_){f().mediaUpload({allowedTypes:lne,filesList:_,onFileChange([v]){if(Nr(v?.url)){p(!0);return}v&&n(v),p(!1)},onError(v){c.removeAllNotices(),c.createErrorNotice(v)}})}function g(_){return _.alt_text?xe(m("Current image: %s"),_.alt_text):xe(m("The current image has no alternative text. The file name is: %s"),_.media_details.sizes?.full?.file||_.slug)}function z(_){u.current&&_&&(_.focus(),u.current=!1)}const A=!l&&!!t&&!r;return a.jsxs(e5,{children:[i,a.jsxs("div",{className:"editor-post-featured-image",children:[r&&a.jsx("div",{id:`editor-post-featured-image-${t}-describedby`,className:"hidden",children:g(r)}),a.jsx(Hd,{fallback:MXt,children:a.jsx(ab,{title:s?.labels?.featured_image||mXt,onSelect:n,unstableFeaturedImageFlow:!0,allowedTypes:lne,modalClass:"editor-post-featured-image__media-modal",render:({open:_})=>a.jsxs("div",{className:"editor-post-featured-image__container",children:[A?a.jsx(A1,{status:"warning",isDismissible:!1,children:m("Could not retrieve the featured image data.")}):a.jsxs(Ce,{__next40pxDefaultSize:!0,ref:z,className:t?"editor-post-featured-image__preview":"editor-post-featured-image__toggle",onClick:_,"aria-label":t?m("Edit or replace the featured image"):null,"aria-describedby":t?`editor-post-featured-image-${t}-describedby`:null,"aria-haspopup":"dialog",disabled:d,accessibleWhenDisabled:!0,children:[!!t&&r&&a.jsx("img",{className:"editor-post-featured-image__preview-image",src:b,alt:g(r)}),(d||l)&&a.jsx(Xn,{}),!t&&!d&&(s?.labels?.set_featured_image||gXt)]}),!!t&&a.jsxs(Ot,{className:oe("editor-post-featured-image__actions",{"editor-post-featured-image__actions-missing-image":A,"editor-post-featured-image__actions-is-requesting-image":l}),children:[a.jsx(Ce,{__next40pxDefaultSize:!0,className:"editor-post-featured-image__action",onClick:_,"aria-haspopup":"dialog",variant:A?"secondary":void 0,children:m("Replace")}),a.jsx(Ce,{__next40pxDefaultSize:!0,className:"editor-post-featured-image__action",onClick:()=>{o(),u.current=!0},variant:A?"secondary":void 0,isDestructive:A,children:m("Remove")})]}),a.jsx(Tz,{onFilesDrop:h})]}),value:t})})]})]})}const yXt=Ul(e=>{const{getMedia:t,getPostType:n,hasFinishedResolution:o}=e(Me),{getCurrentPostId:r,getEditedPostAttribute:s}=e(_e),i=s("featured_media");return{media:i?t(i,{context:"view"}):null,currentPostId:r(),postType:n(s("type")),featuredImageId:i,isRequestingFeaturedImageMedia:!!i&&!o("getMedia",[i,{context:"view"}])}}),AXt=Ff((e,{noticeOperations:t},{select:n})=>{const{editPost:o}=e(_e);return{onUpdateImage(r){o({featured_media:r.id})},onDropImage(r){n(J).getSettings().mediaUpload({allowedTypes:["image"],filesList:r,onFileChange([s]){o({featured_media:s.id})},onError(s){t.removeAllNotices(),t.createErrorNotice(s)}})},onRemoveImage(){o({featured_media:0})}}}),une=Co(imt,yXt,AXt,ap("editor.PostFeaturedImage"))(OXt),vT="featured-image";function vXt({withPanelBody:e=!0}){var t;const{postType:n,isEnabled:o,isOpened:r}=G(i=>{const{getEditedPostAttribute:c,isEditorPanelEnabled:l,isEditorPanelOpened:u}=i(_e),{getPostType:d}=i(Me);return{postType:d(c("type")),isEnabled:l(vT),isOpened:u(vT)}},[]),{toggleEditorPanelOpened:s}=Oe(_e);return o?e?a.jsx(e5,{children:a.jsx(Qt,{title:(t=n?.labels?.featured_image)!==null&&t!==void 0?t:m("Featured image"),opened:r,onToggle:()=>s(vT),children:a.jsx(une,{})})}):a.jsx(e5,{children:a.jsx(une,{})}):null}function iye({children:e}){return G(n=>n(_e).getEditorSettings().disablePostFormats,[])?null:a.jsx(Sc,{supportKeys:"post-formats",children:e})}const VI=[{id:"aside",caption:m("Aside")},{id:"audio",caption:m("Audio")},{id:"chat",caption:m("Chat")},{id:"gallery",caption:m("Gallery")},{id:"image",caption:m("Image")},{id:"link",caption:m("Link")},{id:"quote",caption:m("Quote")},{id:"standard",caption:m("Standard")},{id:"status",caption:m("Status")},{id:"video",caption:m("Video")}].sort((e,t)=>{const n=e.caption.toUpperCase(),o=t.caption.toUpperCase();return no?1:0});function aye(){const t=`post-format-selector-${vt(aye)}`,{postFormat:n,suggestedFormat:o,supportedFormats:r}=G(u=>{const{getEditedPostAttribute:d,getSuggestedPostFormat:p}=u(_e),f=d("format"),b=u(Me).getThemeSupports();return{postFormat:f??"standard",suggestedFormat:p(),supportedFormats:b.formats}},[]),s=VI.filter(u=>r?.includes(u.id)||n===u.id),i=s.find(u=>u.id===o),{editPost:c}=Oe(_e),l=u=>c({format:u});return a.jsx(iye,{children:a.jsxs("div",{className:"editor-post-format",children:[a.jsx(sb,{className:"editor-post-format__options",label:m("Post Format"),selected:n,onChange:u=>l(u),id:t,options:s.map(u=>({label:u.caption,value:u.id})),hideLabelFromVision:!0}),i&&i.id!==n&&a.jsx("p",{className:"editor-post-format__suggestion",children:a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>l(i.id),children:xe(m("Apply suggested format: %s"),i.caption)})})]})})}function xXt({children:e}){const{lastRevisionId:t,revisionsCount:n}=G(o=>{const{getCurrentPostLastRevisionId:r,getCurrentPostRevisionsCount:s}=o(_e);return{lastRevisionId:r(),revisionsCount:s()}},[]);return!t||n<2?null:a.jsx(Sc,{supportKeys:"revisions",children:e})}function wXt(){return G(e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:n}=e(_e);return{lastRevisionId:t(),revisionsCount:n()}},[])}function _Xt(){const{lastRevisionId:e,revisionsCount:t}=wXt();return a.jsx(xXt,{children:a.jsx(xs,{label:m("Revisions"),children:a.jsx(Ce,{href:tn("revision.php",{revision:e}),className:"editor-private-post-last-revision__button",text:t,variant:"tertiary",size:"compact"})})})}function kXt(e){let t=M1(a.jsxs("div",{className:"editor-post-preview-button__interstitial-message",children:[a.jsxs(ge,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 96 96",children:[a.jsx(he,{className:"outer",d:"M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36",fill:"none"}),a.jsx(he,{className:"inner",d:"M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z",fill:"none"})]}),a.jsx("p",{children:m("Generating preview…")})]}));t+=` + }`}if(EO({css:g}),!!g)return{className:`wp-container-content-${b}`}}function nPt({clientId:e,style:t,setAttributes:n}){const o=y_()||{},{type:r="default",allowSizingOnChildren:s=!1,isManualPlacement:i}=o;return r!=="grid"?null:a.jsx(oPt,{clientId:e,style:t,setAttributes:n,allowSizingOnChildren:s,isManualPlacement:i,parentLayout:o})}function oPt({clientId:e,style:t,setAttributes:n,allowSizingOnChildren:o,isManualPlacement:r,parentLayout:s}){const{rootClientId:i,isVisible:c}=G(p=>{const{getBlockRootClientId:f,getBlockEditingMode:b,getTemplateLock:h}=p(J),g=f(e);return h(g)||b(g)!=="default"?{rootClientId:g,isVisible:!1}:{rootClientId:g,isVisible:!0}},[e]),[l,u]=x.useState();if(!c)return null;function d(p){n({style:{...t,layout:{...t?.layout,...p}}})}return a.jsxs(a.Fragment,{children:[a.jsx(j3e,{clientId:i,contentRef:u,parentLayout:s}),o&&a.jsx(KLt,{clientId:e,bounds:l,onChange:d,parentLayout:s}),r&&window.__experimentalEnableGridInteractivity&&a.jsx(ZLt,{layout:t?.layout,parentLayout:s,onChange:d,gridClientId:i,blockClientId:e})]})}const F3e={useBlockProps:tPt,edit:nPt,attributeKeys:["style"],hasSupport(){return!0}};function rPt({clientId:e}){const{templateLock:t,isLockedByParent:n,isEditingAsBlocks:o}=G(l=>{const{getContentLockingParent:u,getTemplateLock:d,getTemporarilyEditingAsBlocks:p}=ct(l(J));return{templateLock:d(e),isLockedByParent:!!u(e),isEditingAsBlocks:p()===e}},[e]),{stopEditingAsBlocks:r}=ct(Oe(J)),s=!n&&t==="contentOnly",i=x.useCallback(()=>{r(e)},[e,r]);return!s&&!o?null:o&&!s&&a.jsx(bt,{group:"other",children:a.jsx(Vt,{onClick:i,children:m("Done")})})}const sPt={edit:rPt,hasSupport(){return!0}},Rte="metadata";function iPt(e){return e?.attributes?.[Rte]?.type||(e.attributes={...e.attributes,[Rte]:{type:"object"}}),e}Bn("blocks.registerBlockType","core/metadata/addMetaAttribute",iPt);const aPt={};function cPt({name:e,clientId:t,metadata:{ignoredHookedBlocks:n=[]}={}}){const o=G(b=>b(kt).getBlockTypes(),[]),r=x.useMemo(()=>o?.filter(({name:b,blockHooks:h})=>h&&e in h||n.includes(b)),[o,e,n]),s=G(b=>{const{getBlocks:h,getBlockRootClientId:g,getGlobalBlockCount:z}=b(J),A=g(t),_=r.reduce((v,M)=>{if(z(M.name)===0)return v;const y=M?.blockHooks?.[e];let k;switch(y){case"before":case"after":k=h(A);break;case"first_child":case"last_child":k=h(t);break;case void 0:k=[...h(A),...h(t)];break}const S=k?.find(C=>C.name===M.name);return S?{...v,[M.name]:S.clientId}:v},{});return Object.values(_).length>0?_:aPt},[r,e,t]),{getBlockIndex:i,getBlockCount:c,getBlockRootClientId:l}=G(J),{insertBlock:u,removeBlock:d}=Oe(J);if(!r.length)return null;const p=r.reduce((b,h)=>{const[g]=h.name.split("/");return b[g]||(b[g]=[]),b[g].push(h),b},{}),f=(b,h)=>{const g=i(t),z=c(t),A=l(t);switch(h){case"before":case"after":u(b,h==="after"?g+1:g,A,!1);break;case"first_child":case"last_child":u(b,h==="first_child"?0:z,t,!1);break;case void 0:u(b,g+1,A,!1);break}};return a.jsx(et,{children:a.jsxs(Qt,{className:"block-editor-hooks__block-hooks",title:m("Plugins"),initialOpen:!0,children:[a.jsx("p",{className:"block-editor-hooks__block-hooks-helptext",children:m("Manage the inclusion of blocks added automatically by plugins.")}),Object.keys(p).map(b=>a.jsxs(x.Fragment,{children:[a.jsx("h3",{children:b}),p[b].map(h=>{const g=h.name in s;return a.jsx(lt,{__nextHasNoMarginBottom:!0,checked:g,label:h.title,onChange:()=>{if(!g){const z=h.blockHooks[e];f(Ee(h.name),z);return}d(s[h.name],!1)}},h.title)})]},b))]})})}const lPt={edit:cPt,attributeKeys:["metadata"],hasSupport(){return!0}},{Menu:cl}=ct(tr),Tte={},uPt=()=>Yn("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}};function dPt({fieldsList:e,attribute:t,binding:n}){const{clientId:o}=j0(),r=rie(),{updateBlockBindings:s}=p_(),i=n?.args?.key,c=G(l=>{const{name:u}=l(J).getBlock(o),d=on(u).attributes?.[t]?.type;return d==="rich-text"?"string":d},[o,t]);return a.jsx(a.Fragment,{children:Object.entries(e).map(([l,u],d)=>a.jsxs(x.Fragment,{children:[a.jsxs(cl.Group,{children:[Object.keys(e).length>1&&a.jsx(cl.GroupLabel,{children:r[l].label}),Object.entries(u).filter(([,p])=>p?.type===c).map(([p,f])=>a.jsxs(cl.RadioItem,{onChange:()=>s({[t]:{source:l,args:{key:p}}}),name:t+"-binding",value:p,checked:p===i,children:[a.jsx(cl.ItemLabel,{children:f?.label}),a.jsx(cl.ItemHelpText,{children:f?.value})]},p))]}),d!==Object.keys(e).length-1&&a.jsx(cl.Separator,{})]},l))})}function $3e({attribute:e,binding:t,fieldsList:n}){const{source:o,args:r}=t||{},s=vl(o),i=!s;return a.jsxs(dt,{className:"block-editor-bindings__item",spacing:0,children:[a.jsx(Sn,{truncate:!0,children:e}),!!t&&a.jsx(Sn,{truncate:!0,variant:!i&&"muted",isDestructive:i,children:i?m("Invalid source"):n?.[o]?.[r?.key]?.label||s?.label||o})]})}function pPt({bindings:e,fieldsList:t}){return a.jsx(a.Fragment,{children:Object.entries(e).map(([n,o])=>a.jsx(oO,{children:a.jsx($3e,{attribute:n,binding:o,fieldsList:t})},n))})}function fPt({attributes:e,bindings:t,fieldsList:n}){const{updateBlockBindings:o}=p_(),r=Yn("medium","<");return a.jsx(a.Fragment,{children:e.map(s=>{const i=t[s];return a.jsx(tt,{hasValue:()=>!!i,label:s,onDeselect:()=>{o({[s]:void 0})},children:a.jsxs(cl,{placement:r?"bottom-start":"left-start",children:[a.jsx(cl.TriggerButton,{render:a.jsx(oO,{}),children:a.jsx($3e,{attribute:s,binding:i,fieldsList:n})}),a.jsx(cl.Popover,{gutter:r?8:36,children:a.jsx(dPt,{fieldsList:n,attribute:s,binding:i})})]})},s)})})}const bPt=({name:e,metadata:t})=>{const n=x.useContext(Cf),{removeAllBlockBindings:o}=p_(),r=uyt(e),s=uPt(),i={},{fieldsList:c,canUpdateBlockBindings:l}=G(f=>{if(!r||r.length===0)return Tte;const b=rie();return Object.entries(b).forEach(([h,{getFieldsList:g,usesContext:z}])=>{if(g){const A={};if(z?.length)for(const v of z)A[v]=n[v];const _=g({select:f,context:A});Object.keys(_||{}).length&&(i[h]={..._})}}),{fieldsList:Object.values(i).length>0?i:Tte,canUpdateBlockBindings:f(J).getSettings().canUpdateBlockBindings}},[n,r]);if(!r||r.length===0)return null;const{bindings:u}=t||{},d={...u};Object.keys(d).forEach(f=>{(!zW(e,f)||d[f].source==="core/pattern-overrides")&&delete d[f]});const p=!l||!Object.keys(c).length;return p&&Object.keys(d).length===0?null:a.jsx(et,{group:"bindings",children:a.jsxs(En,{label:m("Attributes"),resetAll:()=>{o()},dropdownMenuProps:s,className:"block-editor-bindings__panel",children:[a.jsx(tb,{isBordered:!0,isSeparated:!0,children:p?a.jsx(pPt,{bindings:d,fieldsList:c}):a.jsx(fPt,{attributes:r,bindings:d,fieldsList:c})}),a.jsx(Sn,{as:"div",variant:"muted",children:a.jsx("p",{children:m("Attributes connected to custom fields or other dynamic data.")})})]})})},hPt={edit:bPt,attributeKeys:["metadata"],hasSupport(){return!0}};function mPt(e){return e.__experimentalLabel||Tt(e,"renaming",!0)&&(e.__experimentalLabel=(n,{context:o})=>{const{metadata:r}=n;if(o==="list-view"&&r?.name)return r.name}),e}Bn("blocks.registerBlockType","core/metadata/addLabelCallback",mPt);function gPt(e){QLt(e)}function MPt({clientId:e,layout:t}){const n=G(o=>{const{isBlockSelected:r,isDraggingBlocks:s,getTemplateLock:i,getBlockEditingMode:c}=o(J);return!(!s()&&!r(e)||i(e)||c(e)!=="default")},[e]);return a.jsxs(a.Fragment,{children:[a.jsx(gPt,{clientId:e}),n&&a.jsx(j3e,{clientId:e,parentLayout:t})]})}const zPt=Or(e=>t=>t.attributes.layout?.type!=="grid"?a.jsx(e,{...t},"edit"):a.jsxs(a.Fragment,{children:[a.jsx(MPt,{clientId:t.clientId,layout:t.attributes.layout}),a.jsx(e,{...t},"edit")]}),"addGridVisualizerToBlockEdit");Bn("editor.BlockEdit","core/editor/grid-visualizer",zPt);function X1(e){const t=e.style?.border||{};return{className:JMe(e)||void 0,style:Rm({border:t})}}function au(e){const{colors:t}=ub(),n=X1(e),{borderColor:o}=e;if(o){const r=a2({colors:t,namedColor:o});n.style.borderColor=r.color}return n}function db(e){const t=e.style?.shadow||"";return{style:Rm({shadow:t})}}function P1(e){const{backgroundColor:t,textColor:n,gradient:o,style:r}=e,s=Pt("background-color",t),i=Pt("color",n),c=T1(o),l=c||r?.color?.gradient,u=oe(i,c,{[s]:!l&&!!s,"has-text-color":n||r?.color?.text,"has-background":t||r?.color?.background||o||r?.color?.gradient,"has-link-color":r?.elements?.link?.color}),d=r?.color||{},p=Rm({color:d});return{className:u||void 0,style:p}}function BO(e){const{backgroundColor:t,textColor:n,gradient:o}=e,[r,s,i,c,l,u]=Un("color.palette.custom","color.palette.theme","color.palette.default","color.gradients.custom","color.gradients.theme","color.gradients.default"),d=x.useMemo(()=>[...r||[],...s||[],...i||[]],[r,s,i]),p=x.useMemo(()=>[...c||[],...l||[],...u||[]],[c,l,u]),f=P1(e);if(t){const b=Sf(d,t);f.style.backgroundColor=b.color}if(o&&(f.style.background=zhe(p,o)),n){const b=Sf(d,n);f.style.color=b.color}return f}function Tm(e){const{style:t}=e,n=t?.spacing||{};return{style:Rm({spacing:n})}}const{kebabCase:OPt}=ct(tr);function wI(e,t){let n=e?.style?.typography||{};n={...n,fontSize:P_({size:e?.style?.typography?.fontSize},t)};const o=Rm({typography:n}),r=e?.fontFamily?`has-${OPt(e.fontFamily)}-font-family`:"",s=e?.style?.typography?.textAlign?`has-text-align-${e?.style?.typography?.textAlign}`:"";return{className:oe(r,s,Tx(e?.fontSize)),style:o}}aBt([gI,OI,O3e,y3e,AI,L3e,Bge,jLt,sPt,lPt,hPt,F3e].filter(Boolean));uBt([gI,OI,QRt,AI,w3e,gLt,L3e,k3e,C3e,eze,Bge,NEt,F3e]);dBt([gI,OI,O3e,kBt,y3e,eze,w3e,AI,k3e,C3e]);const Ete={button:"wp-element-button",caption:"wp-element-caption"},z0=e=>Ete[e]?Ete[e]:"";function _I(e,t,n){if(e==null||e===!1)return;if(Array.isArray(e))return lT(e,t,n);switch(typeof e){case"string":case"number":return}const{type:o,props:r}=e;switch(o){case x.StrictMode:case x.Fragment:return lT(r.children,t,n);case i0:return;case Ht.Content:return V3e(t,n);case fI:t.push(r.value);return}switch(typeof o){case"string":return typeof r.children<"u"?lT(r.children,t,n):void 0;case"function":const s=o.prototype&&typeof o.prototype.render=="function"?new o(r).render():o(r);return _I(s,t,n)}}function lT(e,...t){e=Array.isArray(e)?e:[e];for(let n=0;nn instanceof Xo?n:Xo.fromHTMLString(n))}function APt({clientId:e,resizableBoxProps:t,...n}){return a.jsx(wm,{clientId:e,__unstablePopoverSlot:"block-toolbar",...n,children:a.jsx(Ca,{...t})})}function vPt({blockTypes:e,value:t,onItemChange:n}){return a.jsx("ul",{className:"block-editor-block-manager__checklist",children:e.map(o=>a.jsxs("li",{className:"block-editor-block-manager__checklist-item",children:[a.jsx(K0,{__nextHasNoMarginBottom:!0,label:o.title,checked:t.includes(o.name),onChange:(...r)=>n(o,...r)}),a.jsx(Zn,{icon:o.icon})]},o.name))})}function QW({title:e,blockTypes:t,selectedBlockTypes:n,onChange:o}){const r=vt(QW),s=x.useCallback((p,f)=>{o(f?[...n,p]:n.filter(({name:b})=>b!==p.name))},[n,o]),i=x.useCallback(p=>{o(p?[...n,...t.filter(f=>!n.find(({name:b})=>b===f.name))]:n.filter(f=>!t.find(({name:b})=>b===f.name)))},[t,n,o]);if(!t.length)return null;const c=t.map(({name:p})=>p).filter(p=>(n??[]).some(f=>f.name===p)),l="block-editor-block-manager__category-title-"+r,u=c.length===t.length,d=!u&&c.length>0;return a.jsxs("div",{role:"group","aria-labelledby":l,className:"block-editor-block-manager__category",children:[a.jsx(K0,{__nextHasNoMarginBottom:!0,checked:u,onChange:i,className:"block-editor-block-manager__category-title",indeterminate:d,label:a.jsx("span",{id:l,children:e})}),a.jsx(vPt,{blockTypes:t,value:c,onItemChange:s})]})}function xPt({blockTypes:e,selectedBlockTypes:t,onChange:n}){const o=q1(Yt,500),[r,s]=x.useState(""),{categories:i,isMatchingSearchTerm:c}=G(p=>({categories:p(kt).getCategories(),isMatchingSearchTerm:p(kt).isMatchingSearchTerm}),[]);function l(){n(e)}const u=e.filter(p=>!r||c(p,r)),d=e.length-t.length;return x.useEffect(()=>{if(!r)return;const p=u.length,f=xe(Dn("%d result found.","%d results found.",p),p);o(f)},[u?.length,r,o]),a.jsxs("div",{className:"block-editor-block-manager__content",children:[!!d&&a.jsxs("div",{className:"block-editor-block-manager__disabled-blocks-count",children:[xe(Dn("%d block is hidden.","%d blocks are hidden.",d),d),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"link",onClick:l,children:m("Reset")})]}),a.jsx(su,{__nextHasNoMarginBottom:!0,label:m("Search for a block"),placeholder:m("Search for a block"),value:r,onChange:p=>s(p),className:"block-editor-block-manager__search"}),a.jsxs("div",{tabIndex:"0",role:"region","aria-label":m("Available block types"),className:"block-editor-block-manager__results",children:[u.length===0&&a.jsx("p",{className:"block-editor-block-manager__no-results",children:m("No blocks found.")}),i.map(p=>a.jsx(QW,{title:p.title,blockTypes:u.filter(f=>f.category===p.slug),selectedBlockTypes:t,onChange:n},p.slug)),a.jsx(QW,{title:m("Uncategorized"),blockTypes:u.filter(({category:p})=>!p),selectedBlockTypes:t,onChange:n})]})]})}function wPt({rules:e}){const{clientIds:t,selectPrevious:n,message:o}=G(l=>ct(l(J)).getRemovalPromptData()),{clearBlockRemovalPrompt:r,setBlockRemovalRules:s,privateRemoveBlocks:i}=ct(Oe(J));if(x.useEffect(()=>(s(e),()=>{s()}),[e,s]),!o)return;const c=()=>{i(t,n,!0),r()};return a.jsxs(Zo,{title:m("Be careful!"),onRequestClose:r,size:"medium",children:[a.jsx("p",{children:o}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{variant:"tertiary",onClick:r,__next40pxDefaultSize:!0,children:m("Cancel")}),a.jsx(Ce,{variant:"primary",onClick:c,__next40pxDefaultSize:!0,children:m("Delete")})]})]})}const Wte=[{value:"fill",label:We("Fill","Scale option for dimensions control"),help:m("Fill the space by stretching the content.")},{value:"contain",label:We("Contain","Scale option for dimensions control"),help:m("Fit the content to the space without clipping.")},{value:"cover",label:We("Cover","Scale option for dimensions control"),help:m("Fill the space by clipping what doesn't fit.")},{value:"none",label:We("None","Scale option for dimensions control"),help:m("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:We("Scale down","Scale option for dimensions control"),help:m("Scale down the content to fit the space if it is too big. Content that is too small will have additional padding.")}];function _Pt({panelId:e,value:t,onChange:n,options:o=Wte,defaultValue:r=Wte[0].value,isShownByDefault:s=!0}){const i=t??"fill",c=x.useMemo(()=>o.reduce((l,u)=>(l[u.value]=u.help,l),{}),[o]);return a.jsx(tt,{label:m("Scale"),isShownByDefault:s,hasValue:()=>i!==r,onDeselect:()=>n(r),panelId:e,children:a.jsx(Do,{__nextHasNoMarginBottom:!0,label:m("Scale"),isBlock:!0,help:c[i],value:i,onChange:n,size:"__unstable-large",children:o.map(l=>a.jsx(Kn,{...l},l.value))})})}const Nte=He(tt,{target:"ef8pe3d0"})({name:"957xgf",styles:"grid-column:span 1"});function kPt({panelId:e,value:t={},onChange:n=()=>{},units:o,isShownByDefault:r=!0}){var s,i;const c=t.width==="auto"?"":(s=t.width)!==null&&s!==void 0?s:"",l=t.height==="auto"?"":(i=t.height)!==null&&i!==void 0?i:"",u=d=>p=>{const f={...t};p?f[d]=p:delete f[d],n(f)};return a.jsxs(a.Fragment,{children:[a.jsx(Nte,{label:m("Width"),isShownByDefault:r,hasValue:()=>c!=="",onDeselect:u("width"),panelId:e,children:a.jsx(Ro,{label:m("Width"),placeholder:m("Auto"),labelPosition:"top",units:o,min:0,value:c,onChange:u("width"),size:"__unstable-large"})}),a.jsx(Nte,{label:m("Height"),isShownByDefault:r,hasValue:()=>l!=="",onDeselect:u("height"),panelId:e,children:a.jsx(Ro,{label:m("Height"),placeholder:m("Auto"),labelPosition:"top",units:o,min:0,value:l,onChange:u("height"),size:"__unstable-large"})})]})}function SPt({panelId:e,value:t={},onChange:n=()=>{},aspectRatioOptions:o,defaultAspectRatio:r="auto",scaleOptions:s,defaultScale:i="fill",unitsOptions:c,tools:l=["aspectRatio","widthHeight","scale"]}){const u=t.width===void 0||t.width==="auto"?null:t.width,d=t.height===void 0||t.height==="auto"?null:t.height,p=t.aspectRatio===void 0||t.aspectRatio==="auto"?null:t.aspectRatio,f=t.scale===void 0||t.scale==="fill"?null:t.scale,[b,h]=x.useState(f),[g,z]=x.useState(p),A=u&&d?"custom":g,_=p||u&&d;return a.jsxs(a.Fragment,{children:[l.includes("aspectRatio")&&a.jsx(NMe,{panelId:e,options:o,defaultValue:r,value:A,onChange:v=>{const M={...t};v=v==="auto"?null:v,z(v),v?M.aspectRatio=v:delete M.aspectRatio,v?b?M.scale=b:(M.scale=i,h(i)):delete M.scale,v!=="custom"&&u&&d&&delete M.height,n(M)}}),l.includes("widthHeight")&&a.jsx(kPt,{panelId:e,units:c,value:{width:u,height:d},onChange:({width:v,height:M})=>{const y={...t};v=v==="auto"?null:v,M=M==="auto"?null:M,v?y.width=v:delete y.width,M?y.height=M:delete y.height,v&&M?delete y.aspectRatio:g&&(y.aspectRatio=g),!g&&!!v!=!!M?delete y.scale:b?y.scale=b:(y.scale=i,h(i)),n(y)}}),l.includes("scale")&&_&&a.jsx(_Pt,{panelId:e,options:s,defaultValue:i,value:b,onChange:v=>{const M={...t};v=v==="fill"?null:v,h(v),v?M.scale=v:delete M.scale,n(M)}})]})}const Bte=[{label:We("Thumbnail","Image size option for resolution control"),value:"thumbnail"},{label:We("Medium","Image size option for resolution control"),value:"medium"},{label:We("Large","Image size option for resolution control"),value:"large"},{label:We("Full Size","Image size option for resolution control"),value:"full"}];function CPt({panelId:e,value:t,onChange:n,options:o=Bte,defaultValue:r=Bte[0].value,isShownByDefault:s=!0,resetAllFilter:i}){const c=t??r;return a.jsx(tt,{hasValue:()=>c!==r,label:m("Resolution"),onDeselect:()=>n(r),isShownByDefault:s,panelId:e,resetAllFilter:i,children:a.jsx(Pn,{__nextHasNoMarginBottom:!0,label:m("Resolution"),value:c,options:o,onChange:n,help:m("Select the size of the source image."),size:"__unstable-large"})})}const jn={};sgt(jn,{...CEt,ExperimentalBlockCanvas:m8t,ExperimentalBlockEditorProvider:q_,getDuotoneFilter:nI,getRichTextValues:yPt,PrivateQuickInserter:yge,extractWords:c7,getNormalizedSearchTerms:b_,normalizeString:Ex,PrivateListView:Bze,ResizableBoxPopover:APt,useHasBlockToolbar:sMe,cleanEmptyObject:Ii,BlockQuickNavigation:h3e,LayoutStyle:Mvt,BlockManager:xPt,BlockRemovalWarningModal:wPt,useLayoutClasses:P3e,useLayoutStyles:LLt,DimensionsTool:SPt,ResolutionTool:CPt,TabbedSidebar:Mge,TextAlignmentControl:yMe,usesContextKey:t3e,useFlashEditableBlocks:pme,useZoomOut:zge,globalStylesDataKey:dO,globalStylesLinksDataKey:x2e,selectBlockPatternsKey:Wz,requiresWrapperOnCopy:_me,PrivateRichText:Q_,PrivateInserterLibrary:g3e,reusableBlocksSelectKey:w2e,PrivateBlockPopover:U7,PrivatePublishDateTimePicker:M3e,useSpacingSizes:WMe,useBlockDisplayTitle:Fd,__unstableBlockStyleVariationOverridesWithConfig:TEt,setBackgroundStyleDefaults:rI,sectionRootClientIdKey:Nz,CommentIconSlotFill:eMe,CommentIconToolbarSlotFill:rMe});let uT;const dT=new WeakMap;function qPt(e){if(uT||(uT=eh(jn)),!dT.has(e)){const t=uT.getRichTextValues([e]);dT.set(e,t)}return dT.get(e)}const pT=new WeakMap;function RPt(e){if(!pT.has(e)){const t=[];for(const n of qPt(e))n&&n.replacements.forEach(({type:o,attributes:r})=>{o==="core/footnote"&&t.push(r["data-fn"])});pT.set(e,t)}return pT.get(e)}function TPt(e){return e.flatMap(RPt)}let fT={};function Lte(e,t){const n={blocks:e};if(!t||t.footnotes===void 0)return n;const o=TPt(e),r=t.footnotes?JSON.parse(t.footnotes):[];if(r.map(d=>d.id).join("")===o.join(""))return n;const i=o.map(d=>r.find(p=>p.id===d)||fT[d]||{id:d,content:""});function c(d){if(!d||Array.isArray(d)||typeof d!="object")return d;d={...d};for(const p in d){const f=d[p];if(Array.isArray(f)){d[p]=f.map(c);continue}if(typeof f!="string"&&!(f instanceof Xo))continue;const b=typeof f=="string"?Xo.fromHTMLString(f):new Xo(f);let h=!1;b.replacements.forEach(g=>{if(g.type==="core/footnote"){const z=g.attributes["data-fn"],A=o.indexOf(z),_=eo({html:g.innerHTML});_.text=String(A+1),_.formats=Array.from({length:_.text.length},()=>_.formats[0]),_.replacements=Array.from({length:_.text.length},()=>_.replacements[0]),g.innerHTML=T0({value:_}),h=!0}}),h&&(d[p]=typeof f=="string"?b.toHTMLString():b)}return d}function l(d){return d.map(p=>({...p,attributes:c(p.attributes),innerBlocks:l(p.innerBlocks)}))}const u=l(e);return fT={...fT,...r.reduce((d,p)=>(o.includes(p.id)||(d[p.id]=p),d),{})},{meta:{...t,footnotes:JSON.stringify(i)},blocks:u}}const EPt=[],Pte=new WeakMap;function ya(e,t,{id:n}={}){const o=XB(e,t),r=n??o,{getEntityRecord:s,getEntityRecordEdits:i}=G(No),{content:c,editedBlocks:l,meta:u}=G(g=>{if(!r)return{};const{getEditedEntityRecord:z}=g(No),A=z(e,t,r);return{editedBlocks:A.blocks,content:A.content,meta:A.meta}},[e,t,r]),{__unstableCreateUndoLevel:d,editEntityRecord:p}=Oe(No),f=x.useMemo(()=>{if(!r)return;if(l)return l;if(!c||typeof c!="string")return EPt;const g=i(e,t,r),A=!g||!Object.keys(g).length?s(e,t,r):g;let _=Pte.get(A);return _||(_=Ko(c),Pte.set(A,_)),_},[e,t,r,l,c,s,i]),b=x.useCallback((g,z)=>{if(f===g)return d(e,t,r);const{selection:_,...v}=z,M={selection:_,content:({blocks:y=[]})=>Jd(y),...Lte(g,u)};p(e,t,r,M,{isCached:!1,...v})},[e,t,r,f,u,d,p]),h=x.useCallback((g,z)=>{const{selection:A,..._}=z,v=Lte(g,u),M={selection:A,...v};p(e,t,r,M,{isCached:!0,..._})},[e,t,r,u,p]);return[f,h,b]}function Ao(e,t,n,o){const r=XB(e,t),s=o??r,{value:i,fullValue:c}=G(d=>{const{getEntityRecord:p,getEditedEntityRecord:f}=d(No),b=p(e,t,s),h=f(e,t,s);return b&&h?{value:h[n],fullValue:b[n]}:{}},[e,t,s,n]),{editEntityRecord:l}=Oe(No),u=x.useCallback(d=>{l(e,t,s,{[n]:d})},[l,e,t,s,n]);return[i,u,c]}const H3e={};ITe(H3e,{useEntityRecordsWithPermissions:JBe,RECEIVE_INTERMEDIATE_RESULTS:T0e});const kI=[...t1e,...n1e.filter(e=>!!e.name)],WPt=kI.reduce((e,t)=>{const{kind:n,name:o,plural:r}=t;return e[J2(n,o)]=(s,i,c)=>Zd(s,n,o,i,c),r&&(e[J2(n,r,"get")]=(s,i)=>eB(s,n,o,i)),e},{}),NPt=kI.reduce((e,t)=>{const{kind:n,name:o,plural:r}=t;if(e[J2(n,o)]=(s,i)=>Gse(n,o,s,i),r){const s=J2(n,r,"get");e[s]=(...i)=>H4(n,o,...i),e[s].shouldInvalidate=i=>H4.shouldInvalidate(i,n,o)}return e},{}),BPt=kI.reduce((e,t)=>{const{kind:n,name:o}=t;return e[J2(n,o,"save")]=(r,s)=>Use(n,o,r,s),e[J2(n,o,"delete")]=(r,s,i)=>Hse(n,o,r,s,i),e},{}),LPt=()=>({reducer:nTe,actions:{...GBe,...pBe,...BPt,...XBe()},selectors:{...KBe,...jTe,...WPt},resolvers:{...IBe,...NPt}}),Me=w1(No,LPt());eh(Me).registerPrivateSelectors(KTe);eh(Me).registerPrivateActions(bBe);Us(Me);const PPt={...pW,richEditingEnabled:!0,codeEditingEnabled:!0,fontLibraryEnabled:!0,enableCustomFields:void 0,defaultRenderingMode:"post-only"};function jPt(e={},t){switch(t.type){case"SET_IS_READY":return{...e,[t.kind]:{...e[t.kind],[t.name]:!0}}}return e}function IPt(e={},t){var n;switch(t.type){case"REGISTER_ENTITY_ACTION":return{...e,[t.kind]:{...e[t.kind],[t.name]:[...((n=e[t.kind]?.[t.name])!==null&&n!==void 0?n:[]).filter(r=>r.id!==t.config.id),t.config]}};case"UNREGISTER_ENTITY_ACTION":{var o;return{...e,[t.kind]:{...e[t.kind],[t.name]:((o=e[t.kind]?.[t.name])!==null&&o!==void 0?o:[]).filter(r=>r.id!==t.actionId)}}}}return e}function DPt(e={},t){var n,o;switch(t.type){case"REGISTER_ENTITY_FIELD":return{...e,[t.kind]:{...e[t.kind],[t.name]:[...((n=e[t.kind]?.[t.name])!==null&&n!==void 0?n:[]).filter(r=>r.id!==t.config.id),t.config]}};case"UNREGISTER_ENTITY_FIELD":return{...e,[t.kind]:{...e[t.kind],[t.name]:((o=e[t.kind]?.[t.name])!==null&&o!==void 0?o:[]).filter(r=>r.id!==t.fieldId)}}}return e}const FPt=J0({actions:IPt,fields:DPt,isReady:jPt});function SI(e){return e&&typeof e=="object"&&"raw"in e?e.raw:e}function $Pt(e=null,t){switch(t.type){case"SET_EDITED_POST":return t.postId}return e}function VPt(e=null,t){switch(t.type){case"SET_CURRENT_TEMPLATE_ID":return t.id}return e}function HPt(e=null,t){switch(t.type){case"SET_EDITED_POST":return t.postType}return e}function UPt(e={isValid:!0},t){switch(t.type){case"SET_TEMPLATE_VALIDITY":return{...e,isValid:t.isValid}}return e}function XPt(e={},t){switch(t.type){case"REQUEST_POST_UPDATE_START":case"REQUEST_POST_UPDATE_FINISH":return{pending:t.type==="REQUEST_POST_UPDATE_START",options:t.options||{}}}return e}function GPt(e={},t){switch(t.type){case"REQUEST_POST_DELETE_START":case"REQUEST_POST_DELETE_FINISH":return{pending:t.type==="REQUEST_POST_DELETE_START"}}return e}function KPt(e={isLocked:!1},t){switch(t.type){case"UPDATE_POST_LOCK":return t.lock}return e}function YPt(e={},t){switch(t.type){case"LOCK_POST_SAVING":return{...e,[t.lockName]:!0};case"UNLOCK_POST_SAVING":{const{[t.lockName]:n,...o}=e;return o}}return e}function ZPt(e={},t){switch(t.type){case"LOCK_POST_AUTOSAVING":return{...e,[t.lockName]:!0};case"UNLOCK_POST_AUTOSAVING":{const{[t.lockName]:n,...o}=e;return o}}return e}function QPt(e=PPt,t){switch(t.type){case"UPDATE_EDITOR_SETTINGS":return{...e,...t.settings}}return e}function JPt(e="post-only",t){switch(t.type){case"SET_RENDERING_MODE":return t.mode}return e}function ejt(e="Desktop",t){switch(t.type){case"SET_DEVICE_TYPE":return t.deviceType}return e}function tjt(e=[],t){switch(t.type){case"REMOVE_PANEL":if(!e.includes(t.panelName))return[...e,t.panelName]}return e}function njt(e=!1,t){switch(t.type){case"SET_IS_LIST_VIEW_OPENED":return t.isOpen?!1:e;case"SET_IS_INSERTER_OPENED":return t.value}return e}function ojt(e=!1,t){switch(t.type){case"SET_IS_INSERTER_OPENED":return t.value?!1:e;case"SET_IS_LIST_VIEW_OPENED":return t.isOpen}return e}function rjt(e={current:null}){return e}function sjt(e={current:null}){return e}function ijt(e=!1,t){switch(t.type){case"OPEN_PUBLISH_SIDEBAR":return!0;case"CLOSE_PUBLISH_SIDEBAR":return!1;case"TOGGLE_PUBLISH_SIDEBAR":return!e}return e}const ajt=J0({postId:$Pt,postType:HPt,templateId:VPt,saving:XPt,deleting:GPt,postLock:KPt,template:UPt,postSavingLock:YPt,editorSettings:QPt,postAutosavingLock:ZPt,renderingMode:JPt,deviceType:ejt,removedPanels:tjt,blockInserterPanel:njt,inserterSidebarToggleRef:sjt,listViewPanel:ojt,listViewToggleRef:rjt,publishSidebarActive:ijt,dataviews:FPt}),cjt=new Set(["meta"]),ljt="core/editor",U3e=/%(?:postname|pagename)%/,X3e=60*1e3,ujt=["title","excerpt","content"],L0="wp_template",Di="wp_template_part",$l="wp_block",Wf="wp_navigation",G3e={custom:"custom",theme:"theme",plugin:"plugin"},K3e=["wp_template","wp_template_part"],djt=[...K3e,"wp_block","wp_navigation"];function CI(e){return e==="header"?XP:e==="footer"?UP:e==="sidebar"?GP:Qf}const{lock:pjt,unlock:St}=P0("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/editor"),jte={},LO=e=>{var t;if(!e)return jte;const{templateTypes:n,templateAreas:o,template:r}=e,{description:s,slug:i,title:c,area:l}=r,{title:u,description:d}=(t=Object.values(n).find(g=>g.slug===i))!==null&&t!==void 0?t:jte,p=typeof c=="string"?c:c?.rendered,f=typeof s=="string"?s:s?.raw,h=o?.map(g=>({...g,icon:CI(g.icon)}))?.find(g=>l===g.area)?.icon||nu;return{title:p&&p!==i?p:u||i,description:f||d,icon:h}},e3={},fjt=At(e=>()=>e(Me).hasUndo()),bjt=At(e=>()=>e(Me).hasRedo());function Y3e(e){return G1(e).status==="auto-draft"}function Z3e(e){return"content"in t3(e)}const qI=At(e=>t=>{const n=Fi(t),o=$i(t);return e(Me).hasEditsForEntityRecord("postType",n,o)}),hjt=At(e=>t=>{const n=e(Me).__experimentalGetDirtyEntityRecords(),{type:o,id:r}=G1(t);return n.some(s=>s.kind!=="postType"||s.name!==o||s.key!==r)});function mjt(e){return!qI(e)&&Y3e(e)}const G1=At(e=>t=>{const n=$i(t),o=Fi(t),r=e(Me).getRawEntityRecord("postType",o,n);return r||e3});function Fi(e){return e.postType}function $i(e){return e.postId}function gjt(e){return e.templateId}function Mjt(e){var t;return(t=G1(e)._links?.["version-history"]?.[0]?.count)!==null&&t!==void 0?t:0}function zjt(e){var t;return(t=G1(e)._links?.["predecessor-version"]?.[0]?.id)!==null&&t!==void 0?t:null}const t3=At(e=>t=>{const n=Fi(t),o=$i(t);return e(Me).getEntityRecordEdits("postType",n,o)||e3});function jM(e,t){switch(t){case"type":return Fi(e);case"id":return $i(e);default:const n=G1(e);if(!n.hasOwnProperty(t))break;return SI(n[t])}}const Ojt=It((e,t)=>{const n=t3(e);return n.hasOwnProperty(t)?{...jM(e,t),...n[t]}:jM(e,t)},(e,t)=>[jM(e,t),t3(e)[t]]);function mr(e,t){switch(t){case"content":return n3(e)}const n=t3(e);return n.hasOwnProperty(t)?cjt.has(t)?Ojt(e,t):n[t]:jM(e,t)}const Q3e=At(e=>(t,n)=>{if(!ujt.includes(n)&&n!=="preview_link")return;const o=Fi(t);if(o==="wp_template")return!1;const r=$i(t),s=e(Me).getCurrentUser()?.id,i=e(Me).getAutosave(o,r,s);if(i)return SI(i[n])});function yjt(e){return mr(e,"status")==="private"?"private":mr(e,"password")?"password":"public"}function Ajt(e){return G1(e).status==="pending"}function RI(e,t){const n=t||G1(e);return["publish","private"].indexOf(n.status)!==-1||n.status==="future"&&!Dbe(new Date(Number(_f(n.date))-X3e))}function vjt(e){return G1(e).status==="future"&&!RI(e)}function xjt(e){const t=G1(e);return qI(e)||["publish","private","future"].indexOf(t.status)===-1}function J3e(e){return Em(e)?!1:!!mr(e,"title")||!!mr(e,"excerpt")||!eOe(e)||f0.OS==="native"}const eOe=At(e=>t=>{const n=$i(t),o=Fi(t),r=e(Me).getEditedEntityRecord("postType",o,n);if(typeof r.content!="function")return!r.content;const s=mr(t,"blocks");if(s.length===0)return!0;if(s.length>1)return!1;const i=s[0].name;return i!==Mr()&&i!==yd()?!1:!n3(t)}),wjt=At(e=>t=>{if(!J3e(t)||oOe(t))return!1;const n=Fi(t);if(n==="wp_template")return!1;const o=$i(t),r=e(Me).hasFetchedAutosaves(n,o),s=e(Me).getCurrentUser()?.id,i=e(Me).getAutosave(n,o,s);return r?!i||Z3e(t)?!0:["title","excerpt","meta"].some(c=>SI(i[c])!==mr(t,c)):!1});function _jt(e){const t=mr(e,"date"),n=new Date(Number(_f(t))-X3e);return Dbe(n)}function kjt(e){const t=mr(e,"date"),n=mr(e,"modified"),o=G1(e).status;return o==="draft"||o==="auto-draft"||o==="pending"?t===n||t===null:!1}function Sjt(e){return!!e.deleting.pending}function Em(e){return!!e.saving.pending}const Cjt=At(e=>t=>{const n=e(Me).__experimentalGetEntitiesBeingSaved(),{type:o,id:r}=G1(t);return n.some(s=>s.kind!=="postType"||s.name!==o||s.key!==r)}),qjt=At(e=>t=>{const n=Fi(t),o=$i(t);return!e(Me).getLastEntitySaveError("postType",n,o)}),Rjt=At(e=>t=>{const n=Fi(t),o=$i(t);return!!e(Me).getLastEntitySaveError("postType",n,o)});function Tjt(e){return Em(e)&&!!e.saving.options?.isAutosave}function Ejt(e){return Em(e)&&!!e.saving.options?.isPreview}function Wjt(e){if(e.saving.pending||Em(e))return;let t=Q3e(e,"preview_link");(!t||G1(e).status==="draft")&&(t=mr(e,"link"),t&&(t=tn(t,{preview:!0})));const n=mr(e,"featured_media");return t&&n?tn(t,{_thumbnail_id:n}):t}const Njt=At(e=>()=>{const t=e(J).getBlocks();if(t.length>2)return null;let n;if(t.length===1&&(n=t[0].name,n==="core/embed")){const o=t[0].attributes?.providerNameSlug;["youtube","vimeo"].includes(o)?n="core/video":["spotify","soundcloud"].includes(o)&&(n="core/audio")}switch(t.length===2&&t[1].name==="core/paragraph"&&(n=t[0].name),n){case"core/image":return"image";case"core/quote":case"core/pullquote":return"quote";case"core/gallery":return"gallery";case"core/video":return"video";case"core/audio":return"audio";default:return null}}),n3=At(e=>t=>{const n=$i(t),o=Fi(t),r=e(Me).getEditedEntityRecord("postType",o,n);if(r){if(typeof r.content=="function")return r.content(r);if(r.blocks)return Jd(r.blocks);if(r.content)return r.content}return""});function Bjt(e){return Em(e)&&!RI(e)&&mr(e,"status")==="publish"}function tOe(e){const t=mr(e,"permalink_template");return U3e.test(t)}function Ljt(e){const t=nOe(e);if(!t)return null;const{prefix:n,postName:o,suffix:r}=t;return tOe(e)?n+o+r:n}function Pjt(e){return mr(e,"slug")||W5(mr(e,"title"))||$i(e)}function nOe(e){const t=mr(e,"permalink_template");if(!t)return null;const n=mr(e,"slug")||mr(e,"generated_slug"),[o,r]=t.split(U3e);return{prefix:o,postName:n,suffix:r}}function jjt(e){return e.postLock.isLocked}function Ijt(e){return Object.keys(e.postSavingLock).length>0}function oOe(e){return Object.keys(e.postAutosavingLock).length>0}function Djt(e){return e.postLock.isTakeover}function Fjt(e){return e.postLock.user}function $jt(e){return e.postLock.activePostLock}function Vjt(e){return!!G1(e)._links?.hasOwnProperty("wp:action-unfiltered-html")}const Hjt=At(e=>()=>!!e(ht).get("core","isPublishSidebarEnabled")),Ujt=It(e=>mr(e,"blocks")||Ko(n3(e)),e=>[mr(e,"blocks"),n3(e)]);function rOe(e,t){return e.removedPanels.includes(t)}const Xjt=At(e=>(t,n)=>{const o=e(ht).get("core","inactivePanels");return!rOe(t,n)&&!o?.includes(n)}),Gjt=At(e=>(t,n)=>!!e(ht).get("core","openPanels")?.includes(n));function Kjt(e){return Ke("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),mr(e,"selection")?.selectionStart}function Yjt(e){return Ke("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),mr(e,"selection")?.selectionEnd}function Zjt(e){return mr(e,"selection")}function Qjt(e){return!!e.postId}function Jjt(e){return e.editorSettings}function JW(e){return e.renderingMode}const e7t=At(e=>t=>St(e(J)).isZoomOut()?"Desktop":t.deviceType);function t7t(e){return e.listViewPanel}function n7t(e){return!!e.blockInserterPanel}const o7t=At(e=>()=>{var t;return(t=e(ht).get("core","editorMode"))!==null&&t!==void 0?t:"visual"});function r7t(){return Ke("select('core/editor').getStateBeforeOptimisticTransaction",{since:"5.7",hint:"No state history is kept on this store anymore"}),null}function s7t(){return Ke("select('core/editor').inSomeHistory",{since:"5.7",hint:"No state history is kept on this store anymore"}),!1}function pn(e){return At(t=>(n,...o)=>(Ke("`wp.data.select( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.select( 'core/block-editor' )."+e+"`",version:"6.2"}),t(J)[e](...o)))}const i7t=pn("getBlockName"),a7t=pn("isBlockValid"),c7t=pn("getBlockAttributes"),l7t=pn("getBlock"),u7t=pn("getBlocks"),d7t=pn("getClientIdsOfDescendants"),p7t=pn("getClientIdsWithDescendants"),f7t=pn("getGlobalBlockCount"),b7t=pn("getBlocksByClientId"),h7t=pn("getBlockCount"),m7t=pn("getBlockSelectionStart"),g7t=pn("getBlockSelectionEnd"),M7t=pn("getSelectedBlockCount"),z7t=pn("hasSelectedBlock"),O7t=pn("getSelectedBlockClientId"),y7t=pn("getSelectedBlock"),A7t=pn("getBlockRootClientId"),v7t=pn("getBlockHierarchyRootClientId"),x7t=pn("getAdjacentBlockClientId"),w7t=pn("getPreviousBlockClientId"),_7t=pn("getNextBlockClientId"),k7t=pn("getSelectedBlocksInitialCaretPosition"),S7t=pn("getMultiSelectedBlockClientIds"),C7t=pn("getMultiSelectedBlocks"),q7t=pn("getFirstMultiSelectedBlockClientId"),R7t=pn("getLastMultiSelectedBlockClientId"),T7t=pn("isFirstMultiSelectedBlock"),E7t=pn("isBlockMultiSelected"),W7t=pn("isAncestorMultiSelected"),N7t=pn("getMultiSelectedBlocksStartClientId"),B7t=pn("getMultiSelectedBlocksEndClientId"),L7t=pn("getBlockOrder"),P7t=pn("getBlockIndex"),j7t=pn("isBlockSelected"),I7t=pn("hasSelectedInnerBlock"),D7t=pn("isBlockWithinSelection"),F7t=pn("hasMultiSelection"),$7t=pn("isMultiSelecting"),V7t=pn("isSelectionEnabled"),H7t=pn("getBlockMode"),U7t=pn("isTyping"),X7t=pn("isCaretWithinFormattedText"),G7t=pn("getBlockInsertionPoint"),K7t=pn("isBlockInsertionPointVisible"),Y7t=pn("isValidTemplate"),Z7t=pn("getTemplate"),Q7t=pn("getTemplateLock"),J7t=pn("canInsertBlockType"),eIt=pn("getInserterItems"),tIt=pn("hasInserterItems"),nIt=pn("getBlockListSettings"),oIt=At(e=>()=>(Ke("select('core/editor').__experimentalGetDefaultTemplateTypes",{since:"6.8",alternative:"select('core/core-data').getEntityRecord( 'root', '__unstableBase' )?.default_template_types"}),e(Me).getEntityRecord("root","__unstableBase")?.default_template_types)),rIt=At(e=>It(()=>(Ke("select('core/editor').__experimentalGetDefaultTemplatePartAreas",{since:"6.8",alternative:"select('core/core-data').getEntityRecord( 'root', '__unstableBase' )?.default_template_part_areas"}),(e(Me).getEntityRecord("root","__unstableBase")?.default_template_part_areas||[]).map(n=>({...n,icon:CI(n.icon)}))))),sIt=At(e=>It((t,n)=>{var o;Ke("select('core/editor').__experimentalGetDefaultTemplateType",{since:"6.8"});const r=e(Me).getEntityRecord("root","__unstableBase")?.default_template_types;return r&&(o=Object.values(r).find(s=>s.slug===n))!==null&&o!==void 0?o:e3})),iIt=At(e=>It((t,n)=>{if(Ke("select('core/editor').__experimentalGetTemplateInfo",{since:"6.8"}),!n)return e3;const o=e(Me).getEntityRecord("root","__unstableBase")?.default_template_types||[],r=e(Me).getEntityRecord("root","__unstableBase")?.default_template_part_areas||[];return LO({template:n,templateAreas:r,templateTypes:o})})),aIt=At(e=>t=>{const n=Fi(t);return e(Me).getPostType(n)?.labels?.singular_name});function cIt(e){return e.publishSidebarActive}const lIt=Object.freeze(Object.defineProperty({__proto__:null,__experimentalGetDefaultTemplatePartAreas:rIt,__experimentalGetDefaultTemplateType:sIt,__experimentalGetDefaultTemplateTypes:oIt,__experimentalGetTemplateInfo:iIt,__unstableIsEditorReady:Qjt,canInsertBlockType:J7t,canUserUseUnfilteredHTML:Vjt,didPostSaveRequestFail:Rjt,didPostSaveRequestSucceed:qjt,getActivePostLock:$jt,getAdjacentBlockClientId:x7t,getAutosaveAttribute:Q3e,getBlock:l7t,getBlockAttributes:c7t,getBlockCount:h7t,getBlockHierarchyRootClientId:v7t,getBlockIndex:P7t,getBlockInsertionPoint:G7t,getBlockListSettings:nIt,getBlockMode:H7t,getBlockName:i7t,getBlockOrder:L7t,getBlockRootClientId:A7t,getBlockSelectionEnd:g7t,getBlockSelectionStart:m7t,getBlocks:u7t,getBlocksByClientId:b7t,getClientIdsOfDescendants:d7t,getClientIdsWithDescendants:p7t,getCurrentPost:G1,getCurrentPostAttribute:jM,getCurrentPostId:$i,getCurrentPostLastRevisionId:zjt,getCurrentPostRevisionsCount:Mjt,getCurrentPostType:Fi,getCurrentTemplateId:gjt,getDeviceType:e7t,getEditedPostAttribute:mr,getEditedPostContent:n3,getEditedPostPreviewLink:Wjt,getEditedPostSlug:Pjt,getEditedPostVisibility:yjt,getEditorBlocks:Ujt,getEditorMode:o7t,getEditorSelection:Zjt,getEditorSelectionEnd:Yjt,getEditorSelectionStart:Kjt,getEditorSettings:Jjt,getFirstMultiSelectedBlockClientId:q7t,getGlobalBlockCount:f7t,getInserterItems:eIt,getLastMultiSelectedBlockClientId:R7t,getMultiSelectedBlockClientIds:S7t,getMultiSelectedBlocks:C7t,getMultiSelectedBlocksEndClientId:B7t,getMultiSelectedBlocksStartClientId:N7t,getNextBlockClientId:_7t,getPermalink:Ljt,getPermalinkParts:nOe,getPostEdits:t3,getPostLockUser:Fjt,getPostTypeLabel:aIt,getPreviousBlockClientId:w7t,getRenderingMode:JW,getSelectedBlock:y7t,getSelectedBlockClientId:O7t,getSelectedBlockCount:M7t,getSelectedBlocksInitialCaretPosition:k7t,getStateBeforeOptimisticTransaction:r7t,getSuggestedPostFormat:Njt,getTemplate:Z7t,getTemplateLock:Q7t,hasChangedContent:Z3e,hasEditorRedo:bjt,hasEditorUndo:fjt,hasInserterItems:tIt,hasMultiSelection:F7t,hasNonPostEntityChanges:hjt,hasSelectedBlock:z7t,hasSelectedInnerBlock:I7t,inSomeHistory:s7t,isAncestorMultiSelected:W7t,isAutosavingPost:Tjt,isBlockInsertionPointVisible:K7t,isBlockMultiSelected:E7t,isBlockSelected:j7t,isBlockValid:a7t,isBlockWithinSelection:D7t,isCaretWithinFormattedText:X7t,isCleanNewPost:mjt,isCurrentPostPending:Ajt,isCurrentPostPublished:RI,isCurrentPostScheduled:vjt,isDeletingPost:Sjt,isEditedPostAutosaveable:wjt,isEditedPostBeingScheduled:_jt,isEditedPostDateFloating:kjt,isEditedPostDirty:qI,isEditedPostEmpty:eOe,isEditedPostNew:Y3e,isEditedPostPublishable:xjt,isEditedPostSaveable:J3e,isEditorPanelEnabled:Xjt,isEditorPanelOpened:Gjt,isEditorPanelRemoved:rOe,isFirstMultiSelectedBlock:T7t,isInserterOpened:n7t,isListViewOpened:t7t,isMultiSelecting:$7t,isPermalinkEditable:tOe,isPostAutosavingLocked:oOe,isPostLockTakeover:Djt,isPostLocked:jjt,isPostSavingLocked:Ijt,isPreviewingPost:Ejt,isPublishSidebarEnabled:Hjt,isPublishSidebarOpened:cIt,isPublishingPost:Bjt,isSavingNonPostEntityChanges:Cjt,isSavingPost:Em,isSelectionEnabled:V7t,isTyping:U7t,isValidTemplate:Y7t},Symbol.toStringTag,{value:"Module"}));function uIt(e,t){return`wp-autosave-block-editor-post-${t?"auto-draft":e}`}function dIt(e,t,n,o,r){window.sessionStorage.setItem(uIt(e,t),JSON.stringify({post_title:n,content:o,excerpt:r}))}function pIt(e){var t;const{previousPost:n,post:o,postType:r}=e;if(e.options?.isAutosave)return[];const s=["publish","private","future"],i=s.includes(n.status),c=s.includes(o.status),l=o.status==="trash"&&n.status!=="trash";let u,d=(t=r?.viewable)!==null&&t!==void 0?t:!1,p;l?(u=r.labels.item_trashed,d=!1):!i&&!c?(u=m("Draft saved."),p=!0):i&&!c?(u=r.labels.item_reverted_to_draft,d=!1):!i&&c?u={publish:r.labels.item_published,private:r.labels.item_published_privately,future:r.labels.item_scheduled}[o.status]:u=r.labels.item_updated;const f=[];return d&&f.push({label:p?m("View Preview"):r.labels.view_item,url:o.link}),[u,{id:"editor-save",type:"snackbar",actions:f}]}function fIt(e){const{post:t,edits:n,error:o}=e;if(o&&o.code==="rest_autosave_no_changes")return[];const r=["publish","private","future"],s=r.indexOf(t.status)!==-1,i={publish:m("Publishing failed."),private:m("Publishing failed."),future:m("Scheduling failed.")};let c=!s&&r.indexOf(n.status)!==-1?i[n.status]:m("Updating failed.");return o.message&&!/<\/?[^>]*>/.test(o.message)&&(c=[c,o.message].join(" ")),[c,{id:"editor-save"}]}function bIt(e){return[e.error.message&&e.error.code!=="unknown_error"?e.error.message:m("Trashing failed"),{id:"editor-trash-fail"}]}const hIt=(e,t,n)=>({dispatch:o})=>{if(o.setEditedPost(e.type,e.id),e.status==="auto-draft"&&n){let s;"content"in t?s=t.content:s=e.content.raw;let i=Ko(s);i=oz(i,n),o.resetEditorBlocks(i,{__unstableShouldCreateUndoLevel:!1})}t&&Object.values(t).some(([s,i])=>{var c;return i!==((c=e[s]?.raw)!==null&&c!==void 0?c:e[s])})&&o.editPost(t)};function mIt(){return Ke("wp.data.dispatch( 'core/editor' ).__experimentalTearDownEditor",{since:"6.5"}),{type:"DO_NOTHING"}}function gIt(){return Ke("wp.data.dispatch( 'core/editor' ).resetPost",{since:"6.0",version:"6.3",alternative:"Initialize the editor with the setupEditorState action"}),{type:"DO_NOTHING"}}function MIt(){return Ke("wp.data.dispatch( 'core/editor' ).updatePost",{since:"5.7",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function zIt(e){return Ke("wp.data.dispatch( 'core/editor' ).setupEditorState",{since:"6.5",alternative:"wp.data.dispatch( 'core/editor' ).setEditedPost"}),sOe(e.type,e.id)}function sOe(e,t){return{type:"SET_EDITED_POST",postType:e,postId:t}}const OIt=(e,t)=>({select:n,registry:o})=>{const{id:r,type:s}=n.getCurrentPost();o.dispatch(Me).editEntityRecord("postType",s,r,e,t)},yIt=(e={})=>async({select:t,dispatch:n,registry:o})=>{if(!t.isEditedPostSaveable())return;const r=t.getEditedPostContent();e.isAutosave||n.editPost({content:r},{undoIgnore:!0});const s=t.getCurrentPost();let i={id:s.id,...o.select(Me).getEntityRecordNonTransientEdits("postType",s.type,s.id),content:r};n({type:"REQUEST_POST_UPDATE_START",options:e});let c=!1;try{i=await Hke("editor.preSavePost",i,e)}catch(l){c=l}if(!c)try{await o.dispatch(Me).saveEntityRecord("postType",s.type,i,e)}catch(l){c=l.message&&l.code!=="unknown_error"?l.message:m("An error occurred while updating.")}if(c||(c=o.select(Me).getLastEntitySaveError("postType",s.type,s.id)),!c)try{await gr("editor.__unstableSavePost",Promise.resolve(),e)}catch(l){c=l}if(!c)try{await Vke("editor.savePost",{id:s.id},e)}catch(l){c=l}if(n({type:"REQUEST_POST_UPDATE_FINISH",options:e}),c){const l=fIt({post:s,edits:i,error:c});l.length&&o.dispatch(mt).createErrorNotice(...l)}else{const l=t.getCurrentPost(),u=pIt({previousPost:s,post:l,postType:await o.resolveSelect(Me).getPostType(l.type),options:e});u.length&&o.dispatch(mt).createSuccessNotice(...u),e.isAutosave||o.dispatch(J).__unstableMarkLastChangeAsPersistent()}};function AIt(){return Ke("wp.data.dispatch( 'core/editor' ).refreshPost",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}const vIt=()=>async({select:e,dispatch:t,registry:n})=>{const o=e.getCurrentPostType(),r=await n.resolveSelect(Me).getPostType(o),{rest_base:s,rest_namespace:i="wp/v2"}=r;t({type:"REQUEST_POST_DELETE_START"});try{const c=e.getCurrentPost();await Wt({path:`/${i}/${s}/${c.id}`,method:"DELETE"}),await t.savePost()}catch(c){n.dispatch(mt).createErrorNotice(...bIt({error:c}))}t({type:"REQUEST_POST_DELETE_FINISH"})},xIt=({local:e=!1,...t}={})=>async({select:n,dispatch:o})=>{const r=n.getCurrentPost();if(r.type!=="wp_template")if(e){const s=n.isEditedPostNew(),i=n.getEditedPostAttribute("title"),c=n.getEditedPostAttribute("content"),l=n.getEditedPostAttribute("excerpt");dIt(r.id,s,i,c,l)}else await o.savePost({isAutosave:!0,...t})},wIt=({forceIsAutosaveable:e}={})=>async({select:t,dispatch:n})=>((e||t.isEditedPostAutosaveable())&&!t.isPostLocked()&&(["draft","auto-draft"].includes(t.getEditedPostAttribute("status"))?await n.savePost({isPreview:!0}):await n.autosave({isPreview:!0})),t.getEditedPostPreviewLink()),_It=()=>({registry:e})=>{e.dispatch(Me).redo()},kIt=()=>({registry:e})=>{e.dispatch(Me).undo()};function SIt(){return Ke("wp.data.dispatch( 'core/editor' ).createUndoLevel",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function CIt(e){return{type:"UPDATE_POST_LOCK",lock:e}}const qIt=()=>({registry:e})=>{e.dispatch(ht).set("core","isPublishSidebarEnabled",!0)},RIt=()=>({registry:e})=>{e.dispatch(ht).set("core","isPublishSidebarEnabled",!1)};function TIt(e){return{type:"LOCK_POST_SAVING",lockName:e}}function EIt(e){return{type:"UNLOCK_POST_SAVING",lockName:e}}function WIt(e){return{type:"LOCK_POST_AUTOSAVING",lockName:e}}function NIt(e){return{type:"UNLOCK_POST_AUTOSAVING",lockName:e}}const BIt=(e,t={})=>({select:n,dispatch:o,registry:r})=>{const{__unstableShouldCreateUndoLevel:s,selection:i}=t,c={blocks:e,selection:i};if(s!==!1){const{id:l,type:u}=n.getCurrentPost();if(r.select(Me).getEditedEntityRecord("postType",u,l).blocks===c.blocks){r.dispatch(Me).__unstableCreateUndoLevel("postType",u,l);return}c.content=({blocks:p=[]})=>Jd(p)}o.editPost(c)};function LIt(e){return{type:"UPDATE_EDITOR_SETTINGS",settings:e}}const PIt=e=>({dispatch:t,registry:n,select:o})=>{o.__unstableIsEditorReady()&&(n.dispatch(J).clearSelectedBlock(),t.editPost({selection:void 0},{undoIgnore:!0})),t({type:"SET_RENDERING_MODE",mode:e})};function jIt(e){return{type:"SET_DEVICE_TYPE",deviceType:e}}const IIt=e=>({registry:t})=>{var n;const o=(n=t.select(ht).get("core","inactivePanels"))!==null&&n!==void 0?n:[],r=!!o?.includes(e);let s;r?s=o.filter(i=>i!==e):s=[...o,e],t.dispatch(ht).set("core","inactivePanels",s)},DIt=e=>({registry:t})=>{var n;const o=(n=t.select(ht).get("core","openPanels"))!==null&&n!==void 0?n:[],r=!!o?.includes(e);let s;r?s=o.filter(i=>i!==e):s=[...o,e],t.dispatch(ht).set("core","openPanels",s)};function FIt(e){return{type:"REMOVE_PANEL",panelName:e}}const $It=e=>({dispatch:t,registry:n})=>{typeof e=="object"&&e.hasOwnProperty("rootClientId")&&e.hasOwnProperty("insertionIndex")&&St(n.dispatch(J)).setInsertionPoint({rootClientId:e.rootClientId,index:e.insertionIndex}),t({type:"SET_IS_INSERTER_OPENED",value:e})};function VIt(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}const HIt=({createNotice:e=!0}={})=>({dispatch:t,registry:n})=>{const o=n.select(ht).get("core","distractionFree");o&&n.dispatch(ht).set("core","fixedToolbar",!1),o||n.batch(()=>{n.dispatch(ht).set("core","fixedToolbar",!0),t.setIsInserterOpened(!1),t.setIsListViewOpened(!1),St(n.dispatch(J)).resetZoomLevel()}),n.batch(()=>{n.dispatch(ht).set("core","distractionFree",!o),e&&n.dispatch(mt).createInfoNotice(m(o?"Distraction free mode deactivated.":"Distraction free mode activated."),{id:"core/editor/distraction-free-mode/notice",type:"snackbar",actions:[{label:m("Undo"),onClick:()=>{n.batch(()=>{n.dispatch(ht).set("core","fixedToolbar",o),n.dispatch(ht).toggle("core","distractionFree")})}}]})})},UIt=()=>({registry:e})=>{e.dispatch(ht).toggle("core","focusMode");const t=e.select(ht).get("core","focusMode");e.dispatch(mt).createInfoNotice(m(t?"Spotlight mode activated.":"Spotlight mode deactivated."),{id:"core/editor/toggle-spotlight-mode/notice",type:"snackbar",actions:[{label:m("Undo"),onClick:()=>{e.dispatch(ht).toggle("core","focusMode")}}]})},XIt=()=>({registry:e})=>{e.dispatch(ht).toggle("core","fixedToolbar");const t=e.select(ht).get("core","fixedToolbar");e.dispatch(mt).createInfoNotice(m(t?"Top toolbar activated.":"Top toolbar deactivated."),{id:"core/editor/toggle-top-toolbar/notice",type:"snackbar",actions:[{label:m("Undo"),onClick:()=>{e.dispatch(ht).toggle("core","fixedToolbar")}}]})},GIt=e=>({dispatch:t,registry:n})=>{n.dispatch(ht).set("core","editorMode",e),e!=="visual"&&(n.dispatch(J).clearSelectedBlock(),St(n.dispatch(J)).resetZoomLevel()),e==="visual"?Yt(m("Visual editor selected"),"assertive"):e==="text"&&(n.select(ht).get("core","distractionFree")&&t.toggleDistractionFree(),Yt(m("Code editor selected"),"assertive"))};function KIt(){return{type:"OPEN_PUBLISH_SIDEBAR"}}function YIt(){return{type:"CLOSE_PUBLISH_SIDEBAR"}}function ZIt(){return{type:"TOGGLE_PUBLISH_SIDEBAR"}}const _o=e=>(...t)=>({registry:n})=>{Ke("`wp.data.dispatch( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.dispatch( 'core/block-editor' )."+e+"`",version:"6.2"}),n.dispatch(J)[e](...t)},QIt=_o("resetBlocks"),JIt=_o("receiveBlocks"),e9t=_o("updateBlock"),t9t=_o("updateBlockAttributes"),n9t=_o("selectBlock"),o9t=_o("startMultiSelect"),r9t=_o("stopMultiSelect"),s9t=_o("multiSelect"),i9t=_o("clearSelectedBlock"),a9t=_o("toggleSelection"),c9t=_o("replaceBlocks"),l9t=_o("replaceBlock"),u9t=_o("moveBlocksDown"),d9t=_o("moveBlocksUp"),p9t=_o("moveBlockToPosition"),f9t=_o("insertBlock"),b9t=_o("insertBlocks"),h9t=_o("showInsertionPoint"),m9t=_o("hideInsertionPoint"),g9t=_o("setTemplateValidity"),M9t=_o("synchronizeTemplate"),z9t=_o("mergeBlocks"),O9t=_o("removeBlocks"),y9t=_o("removeBlock"),A9t=_o("toggleBlockMode"),v9t=_o("startTyping"),x9t=_o("stopTyping"),w9t=_o("enterFormattedText"),_9t=_o("exitFormattedText"),k9t=_o("insertDefaultBlock"),S9t=_o("updateBlockListSettings"),C9t=Object.freeze(Object.defineProperty({__proto__:null,__experimentalTearDownEditor:mIt,__unstableSaveForPreview:wIt,autosave:xIt,clearSelectedBlock:i9t,closePublishSidebar:YIt,createUndoLevel:SIt,disablePublishSidebar:RIt,editPost:OIt,enablePublishSidebar:qIt,enterFormattedText:w9t,exitFormattedText:_9t,hideInsertionPoint:m9t,insertBlock:f9t,insertBlocks:b9t,insertDefaultBlock:k9t,lockPostAutosaving:WIt,lockPostSaving:TIt,mergeBlocks:z9t,moveBlockToPosition:p9t,moveBlocksDown:u9t,moveBlocksUp:d9t,multiSelect:s9t,openPublishSidebar:KIt,receiveBlocks:JIt,redo:_It,refreshPost:AIt,removeBlock:y9t,removeBlocks:O9t,removeEditorPanel:FIt,replaceBlock:l9t,replaceBlocks:c9t,resetBlocks:QIt,resetEditorBlocks:BIt,resetPost:gIt,savePost:yIt,selectBlock:n9t,setDeviceType:jIt,setEditedPost:sOe,setIsInserterOpened:$It,setIsListViewOpened:VIt,setRenderingMode:PIt,setTemplateValidity:g9t,setupEditor:hIt,setupEditorState:zIt,showInsertionPoint:h9t,startMultiSelect:o9t,startTyping:v9t,stopMultiSelect:r9t,stopTyping:x9t,switchEditorMode:GIt,synchronizeTemplate:M9t,toggleBlockMode:A9t,toggleDistractionFree:HIt,toggleEditorPanelEnabled:IIt,toggleEditorPanelOpened:DIt,togglePublishSidebar:ZIt,toggleSelection:a9t,toggleSpotlightMode:UIt,toggleTopToolbar:XIt,trashPost:vIt,undo:kIt,unlockPostAutosaving:NIt,unlockPostSaving:EIt,updateBlock:e9t,updateBlockAttributes:t9t,updateBlockListSettings:S9t,updateEditorSettings:LIt,updatePost:MIt,updatePostLock:CIt},Symbol.toStringTag,{value:"Module"}));function iOe(e){return e?e.source===G3e.custom&&(!!e?.plugin||e?.has_theme_file):!1}function q9t(e){return e.type==="wp_template"}function R9t(e){return e.type==="wp_template_part"}function qh(e){return e.type==="wp_template"||e.type==="wp_template_part"}function Er(e){return typeof e.title=="string"?Lt(e.title):e.title&&"rendered"in e.title?Lt(e.title.rendered):e.title&&"raw"in e.title?Lt(e.title.raw):""}function aOe(e){return e?[e.source,e.source].includes("custom")&&!(e.type==="wp_template"&&e?.plugin)&&!e.has_theme_file:!1}const cOe=e=>typeof e!="object"?"":e.slug||W5(Er(e))||e.id.toString(),lOe=({field:e,onChange:t,data:n})=>{const{id:o}=e,r=e.getValue({item:n})||cOe(n),s=n.permalink_template||"",i=/%(?:postname|pagename)%/,[c,l]=s.split(i),u=c,d=l,p=i.test(s),f=x.useRef(r),b=r||f.current,h=p?`${u}${b}${d}`:Z2(n.link||"");x.useEffect(()=>{r&&f.current===void 0&&(f.current=r)},[r]);const g=x.useCallback(v=>t({[o]:v}),[o,t]),{createNotice:z}=Oe(mt),A=Hl(h,()=>{z("info",m("Copied Permalink to clipboard."),{isDismissible:!0,type:"snackbar"})}),_="editor-post-url__slug-description-"+vt(lOe);return a.jsxs("fieldset",{className:"fields-controls__slug",children:[p&&a.jsxs(dt,{children:[a.jsxs(dt,{spacing:"0px",children:[a.jsx("span",{children:m("Customize the last part of the Permalink.")}),a.jsx(hr,{href:"https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink",children:m("Learn more")})]}),a.jsx(B1,{__next40pxDefaultSize:!0,prefix:a.jsx(Ld,{children:"/"}),suffix:a.jsx(Ce,{__next40pxDefaultSize:!0,icon:RP,ref:A,label:m("Copy")}),label:m("Link"),hideLabelFromVision:!0,value:r,autoComplete:"off",spellCheck:"false",type:"text",className:"fields-controls__slug-input",onChange:v=>{g(v)},onBlur:()=>{r===""&&g(f.current)},"aria-describedby":_}),a.jsxs("div",{className:"fields-controls__slug-help",children:[a.jsx("span",{className:"fields-controls__slug-help-visual-label",children:m("Permalink:")}),a.jsxs(hr,{className:"fields-controls__slug-help-link",href:h,children:[a.jsx("span",{className:"fields-controls__slug-help-prefix",children:u}),a.jsx("span",{className:"fields-controls__slug-help-slug",children:b}),a.jsx("span",{className:"fields-controls__slug-help-suffix",children:d})]})]})]}),!p&&a.jsx(hr,{className:"fields-controls__slug-help",href:h,children:h})]})},T9t=({item:e})=>{const t=cOe(e),n=x.useRef(t);return x.useEffect(()=>{t&&n.current===void 0&&(n.current=t)},[t]),`${t||n.current}`},E9t={id:"slug",type:"text",label:m("Slug"),Edit:lOe,render:T9t};function TI({item:e,className:t,children:n}){const o=Er(e);return a.jsxs(Ot,{className:oe("fields-field__title",t),alignment:"center",justify:"flex-start",children:[a.jsx("span",{children:o||m("(no title)")}),n]})}function uOe({item:e}){return a.jsx(TI,{item:e})}const dOe={type:"text",id:"title",label:m("Title"),placeholder:m("No title"),getValue:({item:e})=>Er(e),render:uOe,enableHiding:!1,enableGlobalSearch:!0},{lock:Hmn,unlock:Wm}=P0("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/fields"),{Badge:W9t}=Wm(tr);function N9t({item:e}){const{frontPageId:t,postsPageId:n}=G(o=>{const{getEntityRecord:r}=o(Me),s=r("root","site");return{frontPageId:s?.page_on_front,postsPageId:s?.page_for_posts}},[]);return a.jsx(TI,{item:e,className:"fields-field__page-title",children:[t,n].includes(e.id)&&a.jsx(W9t,{children:e.id===t?m("Homepage"):m("Posts Page")})})}const B9t={type:"text",id:"title",label:m("Title"),placeholder:m("No title"),getValue:({item:e})=>Er(e),render:N9t,enableHiding:!1,enableGlobalSearch:!0},L9t={type:"text",label:m("Template"),placeholder:m("No title"),id:"title",getValue:({item:e})=>Er(e),render:uOe,enableHiding:!1,enableGlobalSearch:!0};function P9t(e={},t){return t?.type==="SET_EDITING_PATTERN"?{...e,[t.clientId]:t.isEditing}:e}const j9t=J0({isEditingPattern:P9t}),nk={theme:"pattern",user:"wp_block"},pOe="all-patterns",I9t="my-patterns",D9t=["core","pattern-directory/core","pattern-directory/featured"],oa={full:"fully",unsynced:"unsynced"},fOe={"core/paragraph":["content"],"core/heading":["content"],"core/button":["text","url","linkTarget","rel"],"core/image":["id","url","title","alt"]},M4="core/pattern-overrides",F9t=(e,t,n,o)=>async({registry:r})=>{const s=t===oa.unsynced?{wp_pattern_sync_status:t}:void 0,i={title:e,content:n,status:"publish",meta:s,wp_pattern_category:o};return await r.dispatch(Me).saveEntityRecord("postType","wp_block",i)},$9t=(e,t)=>async({dispatch:n})=>{const o=await e.text();let r;try{r=JSON.parse(o)}catch{throw new Error("Invalid JSON file")}if(r.__file!=="wp_block"||!r.title||!r.content||typeof r.title!="string"||typeof r.content!="string"||r.syncStatus&&typeof r.syncStatus!="string")throw new Error("Invalid pattern JSON file");return await n.createPattern(r.title,r.syncStatus,r.content,t)},V9t=e=>({registry:t})=>{const n=t.select(J).getBlock(e),o=n.attributes?.content;function r(i){return i.map(c=>{let l=c.attributes.metadata;if(l&&(l={...l},delete l.id,delete l.bindings,o?.[l.name]))for(const[u,d]of Object.entries(o[l.name]))on(c.name)?.attributes[u]&&(c.attributes[u]=d);return jo(c,{metadata:l&&Object.keys(l).length>0?l:void 0},r(c.innerBlocks))})}const s=t.select(J).getBlocks(n.clientId);t.dispatch(J).replaceBlocks(n.clientId,r(s))};function H9t(e,t){return{type:"SET_EDITING_PATTERN",clientId:e,isEditing:t}}const U9t=Object.freeze(Object.defineProperty({__proto__:null,convertSyncedPatternToStatic:V9t,createPattern:F9t,createPatternFromFile:$9t,setEditingPattern:H9t},Symbol.toStringTag,{value:"Module"})),X9t="core/patterns";function G9t(e,t){return e.isEditingPattern[t]}const K9t=Object.freeze(Object.defineProperty({__proto__:null,isEditingPattern:G9t},Symbol.toStringTag,{value:"Module"})),{lock:Y9t,unlock:pb}=P0("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/patterns"),Z9t={reducer:j9t},Nm=w1(X9t,{...Z9t});Us(Nm);pb(Nm).registerPrivateActions(U9t);pb(Nm).registerPrivateSelectors(K9t);function EI(e){return Object.keys(fOe).includes(e.name)&&!!e.attributes.metadata?.name&&!!e.attributes.metadata?.bindings&&Object.values(e.attributes.metadata.bindings).some(t=>t.source==="core/pattern-overrides")}function bOe(e){return e.some(t=>EI(t)?!0:bOe(t.innerBlocks))}const{BlockQuickNavigation:Q9t}=pb(jn);function J9t(){const e=G(o=>o(J).getClientIdsWithDescendants(),[]),{getBlock:t}=G(J),n=x.useMemo(()=>e.filter(o=>{const r=t(o);return EI(r)}),[e,t]);return n?.length?a.jsx(Qt,{title:m("Overrides"),children:a.jsx(Q9t,{clientIds:n})}):null}const eDt=e=>Lt(e),hOe="wp_pattern_category";function tDt({categoryTerms:e,onChange:t,categoryMap:n}){const[o,r]=x.useState(""),s=q1(r,500),i=x.useMemo(()=>Array.from(n.values()).map(l=>eDt(l.label)).filter(l=>o!==""?l.toLowerCase().includes(o.toLowerCase()):!0).sort((l,u)=>l.localeCompare(u)),[o,n]);function c(l){const u=l.reduce((d,p)=>(d.some(f=>f.toLowerCase()===p.toLowerCase())||d.push(p),d),[]);t(u)}return a.jsx(ip,{className:"patterns-menu-items__convert-modal-categories",value:e,suggestions:i,onChange:c,onInputChange:s,label:m("Categories"),tokenizeOnBlur:!0,__experimentalExpandOnFocus:!0,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})}function mOe(){const{saveEntityRecord:e,invalidateResolution:t}=Oe(Me),{corePatternCategories:n,userPatternCategories:o}=G(i=>{const{getUserPatternCategories:c,getBlockPatternCategories:l}=i(Me);return{corePatternCategories:l(),userPatternCategories:c()}},[]),r=x.useMemo(()=>{const i=new Map;return o.forEach(c=>{i.set(c.label.toLowerCase(),{label:c.label,name:c.name,id:c.id})}),n.forEach(c=>{!i.has(c.label.toLowerCase())&&c.name!=="query"&&i.set(c.label.toLowerCase(),{label:c.label,name:c.name})}),i},[o,n]);async function s(i){try{const c=r.get(i.toLowerCase());if(c?.id)return c.id;const l=c?{name:c.label,slug:c.name}:{name:i},u=await e("taxonomy",hOe,l,{throwOnError:!0});return t("getUserPatternCategories"),u.id}catch(c){if(c.code!=="term_exists")throw c;return c.data.term_id}}return{categoryMap:r,findOrCreateTerm:s}}function WI({className:e="patterns-menu-items__convert-modal",modalTitle:t,...n}){const o=G(r=>r(Me).getPostType(nk.user)?.labels?.add_new_item,[]);return a.jsx(Zo,{title:t||o,onRequestClose:n.onClose,overlayClassName:e,focusOnMount:"firstContentElement",size:"small",children:a.jsx(gOe,{...n})})}function gOe({confirmLabel:e=m("Add"),defaultCategories:t=[],content:n,onClose:o,onError:r,onSuccess:s,defaultSyncType:i=oa.full,defaultTitle:c=""}){const[l,u]=x.useState(i),[d,p]=x.useState(t),[f,b]=x.useState(c),[h,g]=x.useState(!1),{createPattern:z}=pb(Oe(Nm)),{createErrorNotice:A}=Oe(mt),{categoryMap:_,findOrCreateTerm:v}=mOe();async function M(y,k){if(!(!f||h))try{g(!0);const S=await Promise.all(d.map(R=>v(R))),C=await z(y,k,typeof n=="function"?n():n,S);s({pattern:C,categoryId:pOe})}catch(S){A(S.message,{type:"snackbar",id:"pattern-create"}),r?.()}finally{g(!1),p([]),b("")}}return a.jsx("form",{onSubmit:y=>{y.preventDefault(),M(f,l)},children:a.jsxs(dt,{spacing:"5",children:[a.jsx(dn,{label:m("Name"),value:f,onChange:b,placeholder:m("My pattern"),className:"patterns-create-modal__name-input",__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),a.jsx(tDt,{categoryTerms:d,onChange:p,categoryMap:_}),a.jsx(lt,{__nextHasNoMarginBottom:!0,label:We("Synced","pattern (singular)"),help:m("Sync this pattern across multiple locations."),checked:l===oa.full,onChange:()=>{u(l===oa.full?oa.unsynced:oa.full)}}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{o(),b("")},children:m("Cancel")}),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"primary",type:"submit","aria-disabled":!f||h,isBusy:h,children:e})]})]})})}function nDt(e,t){return e.type!==nk.user?t.core?.filter(n=>e.categories?.includes(n.name)).map(n=>n.label):t.user?.filter(n=>e.wp_pattern_category?.includes(n.id)).map(n=>n.label)}function MOe({pattern:e,onSuccess:t}){const{createSuccessNotice:n}=Oe(mt),o=G(r=>{const{getUserPatternCategories:s,getBlockPatternCategories:i}=r(Me);return{core:i(),user:s()}});return e?{content:e.content,defaultCategories:nDt(e,o),defaultSyncType:e.type!==nk.user?oa.unsynced:e.wp_pattern_sync_status||oa.full,defaultTitle:xe(We("%s (Copy)","pattern"),typeof e.title=="string"?e.title:e.title.raw),onSuccess:({pattern:r})=>{n(xe(We('"%s" duplicated.',"pattern"),r.title.raw),{type:"snackbar",id:"patterns-create"}),t?.({pattern:r})}}:null}function oDt({pattern:e,onClose:t,onSuccess:n}){const o=MOe({pattern:e,onSuccess:n});return e?a.jsx(WI,{modalTitle:m("Duplicate pattern"),confirmLabel:m("Duplicate"),onClose:t,onError:t,...o}):null}function rDt({onClose:e,onError:t,onSuccess:n,pattern:o,...r}){const s=Lt(o.title),[i,c]=x.useState(s),[l,u]=x.useState(!1),{editEntityRecord:d,__experimentalSaveSpecifiedEntityEdits:p}=Oe(Me),{createSuccessNotice:f,createErrorNotice:b}=Oe(mt),h=async z=>{if(z.preventDefault(),!(!i||i===o.title||l))try{await d("postType",o.type,o.id,{title:i}),u(!0),c(""),e?.();const A=await p("postType",o.type,o.id,["title"],{throwOnError:!0});n?.(A),f(m("Pattern renamed"),{type:"snackbar",id:"pattern-update"})}catch(A){t?.();const _=A.message&&A.code!=="unknown_error"?A.message:m("An error occurred while renaming the pattern.");b(_,{type:"snackbar",id:"pattern-update"})}finally{u(!1),c("")}},g=()=>{e?.(),c("")};return a.jsx(Zo,{title:m("Rename"),...r,onRequestClose:e,focusOnMount:"firstContentElement",size:"small",children:a.jsx("form",{onSubmit:h,children:a.jsxs(dt,{spacing:"5",children:[a.jsx(dn,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:m("Name"),value:i,onChange:c,required:!0}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:g,children:m("Cancel")}),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",children:m("Save")})]})]})})})}function sDt({clientIds:e,rootClientId:t,closeBlockSettingsMenu:n}){const{createSuccessNotice:o}=Oe(mt),{replaceBlocks:r}=Oe(J),{setEditingPattern:s}=pb(Oe(Nm)),[i,c]=x.useState(!1),l=G(f=>{var b;const{canUser:h}=f(Me),{getBlocksByClientId:g,canInsertBlockType:z,getBlockRootClientId:A}=f(J),_=t||(e.length>0?A(e[0]):void 0),v=(b=g(e))!==null&&b!==void 0?b:[],M=S=>{const C=on(S),R=C&&"parent"in C;return Tt(S,"reusable",!R)};return!(v.length===1&&v[0]&&Qd(v[0])&&!!f(Me).getEntityRecord("postType","wp_block",v[0].attributes.ref))&&z("core/block",_)&&v.every(S=>!!S&&S.isValid&&M(S.name))&&!!h("create",{kind:"postType",name:"wp_block"})},[e,t]),{getBlocksByClientId:u}=G(J),d=x.useCallback(()=>Ks(u(e)),[u,e]);if(!l)return null;const p=({pattern:f})=>{if(f.wp_pattern_sync_status!==oa.unsynced){const b=Ee("core/block",{ref:f.id});r(e,b),s(b.clientId,!0),n()}o(f.wp_pattern_sync_status===oa.unsynced?xe(m("Unsynced pattern created: %s"),f.title.raw):xe(m("Synced pattern created: %s"),f.title.raw),{type:"snackbar",id:"convert-to-pattern-success"}),c(!1)};return a.jsxs(a.Fragment,{children:[a.jsx(Ct,{icon:Bd,onClick:()=>c(!0),"aria-expanded":i,"aria-haspopup":"dialog",children:m("Create pattern")}),i&&a.jsx(WI,{content:d,onSuccess:f=>{p(f)},onError:()=>{c(!1)},onClose:()=>{c(!1)}})]})}function iDt({clientId:e}){const{canRemove:t,isVisible:n,managePatternsUrl:o}=G(s=>{const{getBlock:i,canRemoveBlock:c,getBlockCount:l}=s(J),{canUser:u}=s(Me),d=i(e);return{canRemove:c(e),isVisible:!!d&&Qd(d)&&!!u("update",{kind:"postType",name:"wp_block",id:d.attributes.ref}),innerBlockCount:l(e),managePatternsUrl:u("create",{kind:"postType",name:"wp_template"})?tn("site-editor.php",{path:"/patterns"}):tn("edit.php",{post_type:"wp_block"})}},[e]),{convertSyncedPatternToStatic:r}=pb(Oe(Nm));return n?a.jsxs(a.Fragment,{children:[t&&a.jsx(Ct,{onClick:()=>r(e),children:m("Detach")}),a.jsx(Ct,{href:o,children:m("Manage patterns")})]}):null}function aDt({rootClientId:e}){return a.jsx(cb,{children:({selectedClientIds:t,onClose:n})=>a.jsxs(a.Fragment,{children:[a.jsx(sDt,{clientIds:t,rootClientId:e,closeBlockSettingsMenu:n}),t.length===1&&a.jsx(iDt,{clientId:t[0]})]})})}function cDt({category:e,existingCategories:t,onClose:n,onError:o,onSuccess:r,...s}){const i=x.useId(),c=x.useRef(),[l,u]=x.useState(Lt(e.name)),[d,p]=x.useState(!1),[f,b]=x.useState(!1),h=f?`patterns-rename-pattern-category-modal__validation-message-${i}`:void 0,{saveEntityRecord:g,invalidateResolution:z}=Oe(Me),{createErrorNotice:A,createSuccessNotice:_}=Oe(mt),v=k=>{f&&b(void 0),u(k)},M=async k=>{if(k.preventDefault(),!d){if(!l||l===e.name){const S=m("Please enter a new name for this category.");Yt(S,"assertive"),b(S),c.current?.focus();return}if(t.patternCategories.find(S=>S.id!==e.id&&S.label.toLowerCase()===l.toLowerCase())){const S=m("This category already exists. Please use a different name.");Yt(S,"assertive"),b(S),c.current?.focus();return}try{p(!0);const S=await g("taxonomy",hOe,{id:e.id,slug:e.slug,name:l});z("getUserPatternCategories"),r?.(S),n(),_(m("Pattern category renamed."),{type:"snackbar",id:"pattern-category-update"})}catch(S){o?.(),A(S.message,{type:"snackbar",id:"pattern-category-update"})}finally{p(!1),u("")}}},y=()=>{n(),u("")};return a.jsx(Zo,{title:m("Rename"),onRequestClose:y,...s,children:a.jsx("form",{onSubmit:M,children:a.jsxs(dt,{spacing:"5",children:[a.jsxs(dt,{spacing:"2",children:[a.jsx(dn,{ref:c,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:m("Name"),value:l,onChange:v,"aria-describedby":h,required:!0}),f&&a.jsx("span",{className:"patterns-rename-pattern-category-modal__validation-message",id:h,children:f})]}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:y,children:m("Cancel")}),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"primary",type:"submit","aria-disabled":!l||l===e.name||d,isBusy:d,children:m("Save")})]})]})})})}function lDt({placeholder:e,initialName:t="",onClose:n,onSave:o}){const[r,s]=x.useState(t),i=x.useId(),c=!!r.trim(),l=()=>{if(r!==t){const u=xe(m('Block name changed to: "%s".'),r);Yt(u,"assertive")}o(r),n()};return a.jsx(Zo,{title:m("Enable overrides"),onRequestClose:n,focusOnMount:"firstContentElement",aria:{describedby:i},size:"small",children:a.jsx("form",{onSubmit:u=>{u.preventDefault(),c&&l()},children:a.jsxs(dt,{spacing:"6",children:[a.jsx(Sn,{id:i,children:m("Overrides are changes you make to a block within a synced pattern instance. Use overrides to customize a synced pattern instance to suit its new context. Name this block to specify an override.")}),a.jsx(dn,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:r,label:m("Name"),help:m('For example, if you are creating a recipe pattern, you use "Recipe Title", "Recipe Description", etc.'),placeholder:e,onChange:s}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:n,children:m("Cancel")}),a.jsx(Ce,{__next40pxDefaultSize:!0,"aria-disabled":!c,variant:"primary",type:"submit",children:m("Enable")})]})]})})})}function uDt({onClose:e,onSave:t}){const n=x.useId();return a.jsx(Zo,{title:m("Disable overrides"),onRequestClose:e,aria:{describedby:n},size:"small",children:a.jsx("form",{onSubmit:o=>{o.preventDefault(),t(),e()},children:a.jsxs(dt,{spacing:"6",children:[a.jsx(Sn,{id:n,children:m("Are you sure you want to disable overrides? Disabling overrides will revert all applied overrides for this block throughout instances of this pattern.")}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:e,children:m("Cancel")}),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",children:m("Disable")})]})]})})})}function dDt({attributes:e,setAttributes:t,name:n}){const o=x.useId(),[r,s]=x.useState(!1),[i,c]=x.useState(!1),l=!!e.metadata?.name,u=e.metadata?.bindings?.__default,d=l&&u?.source===M4,p=u?.source&&u.source!==M4,{updateBlockBindings:f}=p_();function b(z,A){A&&t({metadata:{...e.metadata,name:A}}),f({__default:z?{source:M4}:void 0})}if(p)return null;const h=n==="core/image"&&(!!e.caption?.length||!!e.href?.length),g=m(!d&&h?"Overrides currently don't support image captions or links. Remove the caption or link first before enabling overrides.":"Allow changes to this block throughout instances of this pattern.");return a.jsxs(a.Fragment,{children:[a.jsx(et,{group:"advanced",children:a.jsx(no,{__nextHasNoMarginBottom:!0,id:o,label:m("Overrides"),help:g,children:a.jsx(Ce,{__next40pxDefaultSize:!0,className:"pattern-overrides-control__allow-overrides-button",variant:"secondary","aria-haspopup":"dialog",onClick:()=>{d?c(!0):s(!0)},disabled:!d&&h,accessibleWhenDisabled:!0,children:m(d?"Disable overrides":"Enable overrides")})})}),r&&a.jsx(lDt,{initialName:e.metadata?.name,onClose:()=>s(!1),onSave:z=>{b(!0,z)}}),i&&a.jsx(uDt,{onClose:()=>c(!1),onSave:()=>b(!1)})]})}const bT="content";function pDt(e){const t=e.attributes.metadata?.name,n=Fn(),o=G(s=>{if(!t)return;const{getBlockAttributes:i,getBlockParentsByBlockName:c}=s(J),[l]=c(e.clientId,"core/block",!0);if(!l)return;const u=i(l)[bT];if(u)return u.hasOwnProperty(t)},[e.clientId,t]);function r(){const{getBlockAttributes:s,getBlockParentsByBlockName:i}=n.select(J),[c]=i(e.clientId,"core/block",!0);if(!c)return;const l=s(c)[bT];if(!l.hasOwnProperty(t))return;const{updateBlockAttributes:u,__unstableMarkLastChangeAsPersistent:d}=n.dispatch(J);d();let p={...l};delete p[t],Object.keys(p).length||(p=void 0),u(c,{[bT]:p})}return a.jsx(eI,{children:a.jsx(Wn,{children:a.jsx(Vt,{onClick:r,disabled:!o,children:m("Reset")})})})}const{useBlockDisplayTitle:fDt}=pb(jn);function bDt({clientIds:e}){const t=e.length===1,{icon:n,firstBlockName:o}=G(c=>{const{getBlockAttributes:l,getBlockNamesByClientId:u}=c(J),{getBlockType:d,getActiveBlockVariation:p}=c(kt),f=u(e),b=f[0],h=d(b);let g;return t?g=p(b,l(e[0]))?.icon||h.icon:g=new Set(f).size===1?h.icon:H3,{icon:g,firstBlockName:l(e[0]).metadata.name}},[e,t]),r=fDt({clientId:e[0],maximumLength:35}),s=t?xe(m('This %1$s is editable using the "%2$s" override.'),r.toLowerCase(),o):m("These blocks are editable using overrides."),i=x.useId();return a.jsx(bs,{children:c=>a.jsx(c0,{className:"patterns-pattern-overrides-toolbar-indicator",label:r,popoverProps:{placement:"bottom-start",className:"patterns-pattern-overrides-toolbar-indicator__popover"},icon:a.jsx(a.Fragment,{children:a.jsx(Zn,{icon:n,className:"patterns-pattern-overrides-toolbar-indicator-icon",showColors:!0})}),toggleProps:{description:s,...c},menuProps:{orientation:"both","aria-describedby":i},children:()=>a.jsx(Sn,{id:i,children:s})})})}function hDt(){const{clientIds:e,hasPatternOverrides:t,hasParentPattern:n}=G(o=>{const{getBlockAttributes:r,getSelectedBlockClientIds:s,getBlockParentsByBlockName:i}=o(J),c=s(),l=c.every(d=>{var p;return Object.values((p=r(d)?.metadata?.bindings)!==null&&p!==void 0?p:{}).some(f=>f?.source===M4)}),u=c.every(d=>i(d,"core/block",!0).length>0);return{clientIds:c,hasPatternOverrides:l,hasParentPattern:u}},[]);return t&&n?a.jsx(bt,{group:"parent",children:a.jsx(bDt,{clientIds:e})}):null}const Vi={};Y9t(Vi,{OverridesPanel:J9t,CreatePatternModal:WI,CreatePatternModalContents:gOe,DuplicatePatternModal:oDt,isOverridableBlock:EI,hasOverridableBlocks:bOe,useDuplicatePatternProps:MOe,RenamePatternModal:rDt,PatternsMenuItems:aDt,RenamePatternCategoryModal:cDt,PatternOverridesControls:dDt,ResetOverridesControl:pDt,PatternOverridesBlockControls:hDt,useAddPatternCategory:mOe,PATTERN_TYPES:nk,PATTERN_DEFAULT_CATEGORY:pOe,PATTERN_USER_CATEGORY:I9t,EXCLUDED_PATTERN_SOURCES:D9t,PATTERN_SYNC_TYPES:oa,PARTIAL_SYNCING_SUPPORTED_BLOCKS:fOe});const{PATTERN_TYPES:mDt}=Wm(Vi);function gDt({item:e}){return a.jsx(TI,{item:e,className:"fields-field__pattern-title",children:e.type===mDt.theme&&a.jsx(B0,{placement:"top",text:m("This pattern cannot be edited."),children:a.jsx(wn,{icon:dde,size:24})})})}const MDt={type:"text",id:"title",label:m("Title"),placeholder:m("No title"),getValue:({item:e})=>Er(e),render:gDt,enableHiding:!1,enableGlobalSearch:!0},zDt={id:"menu_order",type:"integer",label:m("Order"),description:m("Determines the order of pages.")},ODt=[],yDt=()=>{const{wp:e}=window;return e.media.view.MediaFrame.Select.extend({featuredImageToolbar(t){this.createSelectToolbar(t,{text:e.media.view.l10n.setFeaturedImage,state:this.options.state})},editState(){const t=this.state("featured-image").get("selection"),n=new e.media.view.EditImage({model:t.single(),controller:this}).render();this.content.set(n),n.loadEditor()},createStates:function(){this.on("toolbar:create:featured-image",this.featuredImageToolbar,this),this.on("content:render:edit-image",this.editState,this),this.states.add([new e.media.controller.FeaturedImage,new e.media.controller.EditImage({model:this.options.editImage})])}})},ADt=()=>{const{wp:e}=window;return e.media.view.MediaFrame.Select.extend({createStates(){const t=this.options;this.options.states||this.states.add([new e.media.controller.Library({library:e.media.query(t.library),multiple:t.multiple,title:t.title,priority:20,filterable:"uploaded"}),new e.media.controller.EditImage({model:t.editImage})])}})},vDt=()=>{const{wp:e}=window;return e.media.view.MediaFrame.Post.extend({galleryToolbar(){const t=this.state().get("editing");this.toolbar.set(new e.media.view.Toolbar({controller:this,items:{insert:{style:"primary",text:t?e.media.view.l10n.updateGallery:e.media.view.l10n.insertGallery,priority:80,requires:{library:!0},click(){const n=this.controller,o=n.state();n.close(),o.trigger("update",o.get("library")),n.setState(n.options.state),n.reset()}}}}))},editState(){const t=this.state("gallery").get("selection"),n=new e.media.view.EditImage({model:t.single(),controller:this}).render();this.content.set(n),n.loadEditor()},createStates:function(){this.on("toolbar:create:main-gallery",this.galleryToolbar,this),this.on("content:render:edit-image",this.editState,this),this.states.add([new e.media.controller.Library({id:"gallery",title:e.media.view.l10n.createGalleryTitle,priority:40,toolbar:"main-gallery",filterable:"uploaded",multiple:"add",editable:!1,library:e.media.query({type:"image",...this.options.library})}),new e.media.controller.EditImage({model:this.options.editImage}),new e.media.controller.GalleryEdit({library:this.options.selection,editing:this.options.editing,menu:"gallery",displaySettings:!1,multiple:!0}),new e.media.controller.GalleryAdd])}})},Ite=e=>["sizes","mime","type","subtype","id","url","alt","link","caption"].reduce((n,o)=>(e?.hasOwnProperty(o)&&(n[o]=e[o]),n),{}),Av=e=>{const{wp:t}=window;return t.media.query({order:"ASC",orderby:"post__in",post__in:e,posts_per_page:-1,query:!0,type:"image"})};let zOe=class extends x.Component{constructor(){super(...arguments),this.openModal=this.openModal.bind(this),this.onOpen=this.onOpen.bind(this),this.onSelect=this.onSelect.bind(this),this.onUpdate=this.onUpdate.bind(this),this.onClose=this.onClose.bind(this)}initializeListeners(){this.frame.on("select",this.onSelect),this.frame.on("update",this.onUpdate),this.frame.on("open",this.onOpen),this.frame.on("close",this.onClose)}buildAndSetGalleryFrame(){const{addToGallery:t=!1,allowedTypes:n,multiple:o=!1,value:r=ODt}=this.props;if(r===this.lastGalleryValue)return;const{wp:s}=window;this.lastGalleryValue=r,this.frame&&this.frame.remove();let i;t?i="gallery-library":i=r&&r.length?"gallery-edit":"gallery",this.GalleryDetailsMediaFrame||(this.GalleryDetailsMediaFrame=vDt());const c=Av(r),l=new s.media.model.Selection(c.models,{props:c.props.toJSON(),multiple:o});this.frame=new this.GalleryDetailsMediaFrame({mimeType:n,state:i,multiple:o,selection:l,editing:!!r?.length}),s.media.frame=this.frame,this.initializeListeners()}buildAndSetFeatureImageFrame(){const{wp:t}=window,{value:n,multiple:o,allowedTypes:r}=this.props,s=yDt(),i=Av(n),c=new t.media.model.Selection(i.models,{props:i.props.toJSON()});this.frame=new s({mimeType:r,state:"featured-image",multiple:o,selection:c,editing:n}),t.media.frame=this.frame,t.media.view.settings.post={...t.media.view.settings.post,featuredImageId:n||-1}}buildAndSetSingleMediaFrame(){const{wp:t}=window,{allowedTypes:n,multiple:o=!1,title:r=m("Select or Upload Media"),value:s}=this.props,i={title:r,multiple:o};n&&(i.library={type:n}),this.frame&&this.frame.remove();const c=ADt(),l=Av(s),u=new t.media.model.Selection(l.models,{props:l.props.toJSON()});this.frame=new c({mimeType:n,multiple:o,selection:u,...i}),t.media.frame=this.frame}componentWillUnmount(){this.frame?.remove()}onUpdate(t){const{onSelect:n,multiple:o=!1}=this.props,r=this.frame.state(),s=t||r.get("selection");!s||!s.models.length||n(o?s.models.map(i=>Ite(i.toJSON())):Ite(s.models[0].toJSON()))}onSelect(){const{onSelect:t,multiple:n=!1}=this.props,o=this.frame.state().get("selection").toJSON();t(n?o:o[0])}onOpen(){const{wp:t}=window,{value:n}=this.props;if(this.updateCollection(),this.props.mode&&this.frame.content.mode(this.props.mode),!(Array.isArray(n)?!!n?.length:!!n))return;const r=this.props.gallery,s=this.frame.state().get("selection"),i=Array.isArray(n)?n:[n];r||i.forEach(l=>{s.add(t.media.attachment(l))});const c=Av(i);c.more().done(function(){r&&c?.models?.length&&s.add(c.models)})}onClose(){const{onClose:t}=this.props;t&&t(),this.frame.detach()}updateCollection(){const t=this.frame.content.get();if(t&&t.collection){const n=t.collection;n.toArray().forEach(o=>o.trigger("destroy",o)),n.mirroring._hasMore=!0,n.more()}}openModal(){const{gallery:t=!1,unstableFeaturedImageFlow:n=!1,modalClass:o}=this.props;t?this.buildAndSetGalleryFrame():this.buildAndSetSingleMediaFrame(),o&&this.frame.$el.addClass(o),n&&this.buildAndSetFeatureImageFrame(),this.initializeListeners(),this.frame.open()}render(){return this.props.render({open:this.openModal})}};function xDt(e){return e!==null&&typeof e=="object"&&Object.getPrototypeOf(e)===Object.prototype}function NI(e,t,n){if(xDt(n))for(const[o,r]of Object.entries(n))NI(e,`${t}[${o}]`,r);else n!==void 0&&e.append(t,String(n))}function OOe(e){var t;const{alt_text:n,source_url:o,...r}=e;return{...r,alt:e.alt_text,caption:(t=e.caption?.raw)!==null&&t!==void 0?t:"",title:e.title.raw,url:e.source_url,poster:e._embedded?.["wp:featuredmedia"]?.[0]?.source_url||void 0}}async function wDt(e,t={},n){const o=new FormData;o.append("file",e,e.name||e.type.replace("/","."));for(const[r,s]of Object.entries(t))NI(o,r,s);return OOe(await Wt({path:"/wp/v2/media?_embed=wp:featuredmedia",body:o,method:"POST",signal:n}))}class Rh extends Error{constructor({code:t,message:n,file:o,cause:r}){super(n,{cause:r}),Object.setPrototypeOf(this,new.target.prototype),this.code=t,this.file=o}}function _Dt(e,t){if(!t)return;const n=t.some(o=>o.includes("/")?o===e.type:e.type.startsWith(`${o}/`));if(e.type&&!n)throw new Rh({code:"MIME_TYPE_NOT_SUPPORTED",message:xe(m("%s: Sorry, this file type is not supported here."),e.name),file:e})}function kDt(e){return e?Object.entries(e).flatMap(([t,n])=>{const[o]=n.split("/"),r=t.split("|");return[n,...r.map(s=>`${o}/${s}`)]}):null}function SDt(e,t){const n=kDt(t);if(!n)return;const o=n.includes(e.type);if(e.type&&!o)throw new Rh({code:"MIME_TYPE_NOT_ALLOWED_FOR_USER",message:xe(m("%s: Sorry, you are not allowed to upload this file type."),e.name),file:e})}function CDt(e,t){if(e.size<=0)throw new Rh({code:"EMPTY_FILE",message:xe(m("%s: This file is empty."),e.name),file:e});if(t&&e.size>t)throw new Rh({code:"SIZE_ABOVE_LIMIT",message:xe(m("%s: This file exceeds the maximum upload size for this site."),e.name),file:e})}function qDt({wpAllowedMimeTypes:e,allowedTypes:t,additionalData:n={},filesList:o,maxUploadFileSize:r,onError:s,onFileChange:i,signal:c}){const l=[],u=[],d=(p,f)=>{window.__experimentalMediaProcessing||u[p]?.url&&J4(u[p].url),u[p]=f,i?.(u.filter(b=>b!==null))};for(const p of o){try{SDt(p,e)}catch(f){s?.(f);continue}try{_Dt(p,t)}catch(f){s?.(f);continue}try{CDt(p,r)}catch(f){s?.(f);continue}l.push(p),window.__experimentalMediaProcessing||(u.push({url:ls(p)}),i?.(u))}l.map(async(p,f)=>{try{const b=await wDt(p,n,c);d(f,b)}catch(b){d(f,null);let h;b instanceof Error?h=b.message:h=xe(m("Error while uploading file %s to the media library."),p.name),s?.(new Rh({code:"GENERAL",message:h,file:p,cause:b instanceof Error?b:void 0}))}})}async function RDt(e,t,n={},o){const r=new FormData;r.append("file",e,e.name||e.type.replace("/","."));for(const[s,i]of Object.entries(n))NI(r,s,i);return OOe(await Wt({path:`/wp/v2/media/${t}/sideload`,body:r,method:"POST",signal:o}))}const TDt=()=>{};async function EDt({file:e,attachmentId:t,additionalData:n={},signal:o,onFileChange:r,onError:s=TDt}){try{const i=await RDt(e,t,n,o);r?.([i])}catch(i){let c;i instanceof Error?c=i.message:c=xe(m("Error while sideloading file %s to the server."),e.name),s(new Rh({code:"GENERAL",message:c,file:e,cause:i instanceof Error?i:void 0}))}}const{lock:WDt,unlock:Xmn}=P0("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/media-utils"),yOe={};WDt(yOe,{sideloadMedia:EDt});const NDt=({data:e,field:t,onChange:n})=>{const{id:o}=t,r=t.getValue({item:e}),s=G(d=>{const{getEntityRecord:p}=d(Me);return p("root","media",r)},[r]),i=x.useCallback(d=>n({[o]:d}),[o,n]),c=s?.source_url,l=s?.title?.rendered,u=x.useRef(null);return a.jsx("fieldset",{className:"fields-controls__featured-image",children:a.jsx("div",{className:"fields-controls__featured-image-container",children:a.jsx(zOe,{onSelect:d=>{i(d.id)},allowedTypes:["image"],render:({open:d})=>a.jsx("div",{ref:u,role:"button",tabIndex:-1,onClick:()=>{d()},onKeyDown:d,children:a.jsxs(nO,{rowGap:0,columnGap:8,templateColumns:"24px 1fr 24px",children:[c&&a.jsxs(a.Fragment,{children:[a.jsx("img",{className:"fields-controls__featured-image-image",alt:"",width:24,height:24,src:c}),a.jsx("span",{className:"fields-controls__featured-image-title",children:l})]}),!c&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"fields-controls__featured-image-placeholder",style:{width:"24px",height:"24px"}}),a.jsx("span",{className:"fields-controls__featured-image-title",children:m("Choose an image…")})]}),c&&a.jsx(a.Fragment,{children:a.jsx(Ce,{size:"small",className:"fields-controls__featured-image-remove-button",icon:ude,onClick:p=>{p.stopPropagation(),i(0)}})})]})})})})})},BDt=({item:e})=>{const t=e.featured_media,o=G(r=>{const{getEntityRecord:s}=r(Me);return t?s("root","media",t):null},[t])?.source_url;return o?a.jsx("img",{className:"fields-controls__featured-image-image",src:o,alt:""}):a.jsx("span",{className:"fields-controls__featured-image-placeholder"})},LDt={id:"featured_media",type:"media",label:m("Featured Image"),Edit:NDt,render:BDt,enableSorting:!1},PDt=({data:e,field:t,onChange:n})=>{const{id:o}=t,r=e.type,s=typeof e.id=="number"?e.id:parseInt(e.id,10),i=e.slug,{availableTemplates:c,templates:l}=G(z=>{var A;const _=(A=z(Me).getEntityRecords("postType","wp_template",{per_page:-1,post_type:r}))!==null&&A!==void 0?A:[],{getHomePage:v,getPostsPageId:M}=Wm(z(Me)),y=M()===+s,k=r==="page"&&v()?.postId===+s;return{templates:_,availableTemplates:!y&&!k?_.filter(C=>C.is_custom&&C.slug!==e.template&&!!C.content.raw):[]}},[e.template,s,r]),u=x.useMemo(()=>c.map(z=>({name:z.slug,blocks:Ko(z.content.raw),title:Lt(z.title.rendered),id:z.id})),[c]),d=q4(u),p=t.getValue({item:e}),f=G(z=>{const A=l?.find(v=>v.slug===p);if(A)return A;let _;if(i?_=r==="page"?`${r}-${i}`:`single-${r}-${i}`:_=r==="page"?"page":`single-${r}`,r){const v=z(Me).getDefaultTemplateId({slug:_});return z(Me).getEntityRecord("postType","wp_template",v)}},[r,i,l,p]),[b,h]=x.useState(!1),g=x.useCallback(z=>n({[o]:z}),[o,n]);return a.jsxs("fieldset",{className:"fields-controls__template",children:[a.jsx(so,{popoverProps:{placement:"bottom-start"},renderToggle:({onToggle:z})=>a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",size:"compact",onClick:z,children:f?Er(f):""}),renderContent:({onToggle:z})=>a.jsxs(Cn,{children:[a.jsx(Ct,{onClick:()=>{h(!0),z()},children:m("Change template")}),p!==""&&a.jsx(Ct,{onClick:()=>{g(""),z()},children:m("Use default template")})]})}),b&&a.jsx(Zo,{title:m("Choose a template"),onRequestClose:()=>h(!1),overlayClassName:"fields-controls__template-modal",isFullScreen:!0,children:a.jsx("div",{className:"fields-controls__template-content",children:a.jsx(qa,{label:m("Templates"),blockPatterns:u,shownPatterns:d,onClickPattern:z=>{g(z.name),h(!1)}})})})]})},jDt={id:"template",type:"text",label:m("Template"),Edit:PDt,enableSorting:!1};function eN(e){return typeof e.title=="object"&&"rendered"in e.title&&e.title.rendered?Lt(e.title.rendered):`#${e?.id} (${m("no title")})`}function IDt(e){const t=e.map(r=>({children:[],...r}));if(t.some(({parent:r})=>r==null))return t;const n=t.reduce((r,s)=>{const{parent:i}=s;return r[i]||(r[i]=[]),r[i].push(s),r},{}),o=r=>r.map(s=>{const i=n[s.id];return{...s,children:i&&i.length?o(i):[]}});return o(n[0]||[])}const Dte=(e,t)=>{const n=ms(e||"").toLowerCase(),o=ms(t||"").toLowerCase();return n===o?0:n.startsWith(o)?n.length:1/0};function DDt({data:e,onChangeControl:t}){const[n,o]=x.useState(null),r=e.parent,s=e.id,i=e.type,{parentPostTitle:c,pageItems:l,isHierarchical:u}=G(b=>{const{getEntityRecord:h,getEntityRecords:g,getPostType:z}=b(Me),A=z(i),_=A?.hierarchical&&A.viewable,v=r?h("postType",i,r):null,M={per_page:100,exclude:s,parent_exclude:s,orderby:"menu_order",order:"asc",_fields:"id,title,parent",...n!==null&&{search:n}};return{isHierarchical:_,parentPostTitle:v?eN(v):"",pageItems:_?g("postType",i,M):null}},[n,r,s,i]),d=x.useMemo(()=>{const b=(A,_=0)=>A.map(y=>[{value:y.id,label:"— ".repeat(_)+Lt(y.name),rawName:y.name},...b(y.children||[],_+1)]).sort(([y],[k])=>{const S=Dte(y.rawName,n??""),C=Dte(k.rawName,n??"");return S>=C?1:-1}).flat();if(!l)return[];let h=l.map(A=>{var _;return{id:A.id,parent:(_=A.parent)!==null&&_!==void 0?_:null,name:eN(A)}});n||(h=IDt(h));const g=b(h),z=g.find(A=>A.value===r);return r&&c&&!z&&g.unshift({value:r,label:c,rawName:""}),g.map(A=>({...A,value:A.value.toString()}))},[l,n,c,r]);if(!u)return null;const p=b=>{o(b)},f=b=>{if(b){var h;return t((h=parseInt(b,10))!==null&&h!==void 0?h:0)}t(0)};return a.jsx(nb,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:m("Parent"),help:m("Choose a parent page."),value:r?.toString(),options:d,onFilterValueChange:F1(b=>p(b),300),onChange:f,hideLabelFromVision:!0})}const FDt=({data:e,field:t,onChange:n})=>{const{id:o}=t,r=G(i=>i(Me).getEntityRecord("root","__unstableBase")?.home,[]),s=x.useCallback(i=>n({[o]:i}),[o,n]);return a.jsx("fieldset",{className:"fields-controls__parent",children:a.jsxs("div",{children:[cr(xe(m('Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %1$s/services/pricing.'),Ph(r).replace(/([/.])/g,"$1")),{wbr:a.jsx("wbr",{})}),a.jsx("p",{children:cr(m("They also show up as sub-items in the default navigation menu. Learn more."),{a:a.jsx(hr,{href:m("https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes"),children:void 0})})}),a.jsx(DDt,{data:e,onChangeControl:s})]})})},$Dt=({item:e})=>{const t=G(n=>{const{getEntityRecord:o}=n(Me);return e?.parent?o("postType",e.type,e.parent):null},[e.parent,e.type]);return t?a.jsx(a.Fragment,{children:eN(t)}):a.jsx(a.Fragment,{children:m("None")})},VDt={id:"parent",type:"text",label:m("Parent"),Edit:FDt,render:$Dt,enableSorting:!0};function HDt({data:e,onChange:t,field:n}){const[o,r]=x.useState(!!n.getValue({item:e})),s=i=>{r(i),i||t({password:""})};return a.jsxs(dt,{as:"fieldset",spacing:4,className:"fields-controls__password",children:[a.jsx(K0,{__nextHasNoMarginBottom:!0,label:m("Password protected"),help:m("Only visible to those who know the password"),checked:o,onChange:s}),o&&a.jsx("div",{className:"fields-controls__password-input",children:a.jsx(dn,{label:m("Password"),onChange:i=>t({password:i}),value:n.getValue({item:e})||"",placeholder:m("Use a secure password"),type:"text",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,maxLength:255})})]})}const UDt={id:"password",type:"text",Edit:HDt,enableSorting:!1,enableHiding:!1,isVisible:e=>e.status!=="private"},AOe=[{value:"draft",label:m("Draft"),icon:E8,description:m("Not ready to publish.")},{value:"future",label:m("Scheduled"),icon:Nde,description:m("Publish automatically on a chosen date.")},{value:"pending",label:m("Pending Review"),icon:gde,description:m("Waiting for review before publishing.")},{value:"private",label:m("Private"),icon:bde,description:m("Only visible to site admins and editors.")},{value:"publish",label:m("Published"),icon:Lw,description:m("Visible to everyone.")},{value:"trash",label:m("Trash"),icon:K3}];function XDt({item:e}){const t=AOe.find(({value:r})=>r===e.status),n=t?.label||e.status,o=t?.icon;return a.jsxs(Ot,{alignment:"left",spacing:0,children:[o&&a.jsx("div",{className:"edit-site-post-list__status-icon",children:a.jsx(qo,{icon:o})}),a.jsx("span",{children:n})]})}const GDt="isAny",KDt={label:m("Status"),id:"status",type:"text",elements:AOe,render:XDt,Edit:"radio",enableSorting:!1,filterBy:{operators:[GDt]}},YDt={id:"comment_status",label:m("Discussion"),type:"text",Edit:"radio",enableSorting:!1,filterBy:{operators:[]},elements:[{value:"open",label:m("Open"),description:m("Visitors can add new comments and replies.")},{value:"closed",label:m("Closed"),description:m("Visitors cannot add new comments or replies. Existing comments remain visible.")}]},Vg=e=>r0(Sa().formats.datetimeAbbreviated,_f(e)),ZDt=({item:e})=>{var t,n,o,r;if(["draft","private"].includes((t=e.status)!==null&&t!==void 0?t:"")){var i;return cr(xe(m("Modified: "),Vg((i=e.date)!==null&&i!==void 0?i:null)),{span:a.jsx("span",{}),time:a.jsx("time",{})})}if(e.status==="future"){var l;return cr(xe(m("Scheduled: "),Vg((l=e.date)!==null&&l!==void 0?l:null)),{span:a.jsx("span",{}),time:a.jsx("time",{})})}if(e.status==="publish"){var d;return cr(xe(m("Published: "),Vg((d=e.date)!==null&&d!==void 0?d:null)),{span:a.jsx("span",{}),time:a.jsx("time",{})})}const p=_f((n=e.modified)!==null&&n!==void 0?n:null)>_f((o=e.date)!==null&&o!==void 0?o:null)?e.modified:e.date;return e.status==="pending"?cr(xe(m("Modified: "),Vg(p??null)),{span:a.jsx("span",{}),time:a.jsx("time",{})}):a.jsx("time",{children:Vg((r=e.date)!==null&&r!==void 0?r:null)})},QDt={id:"date",type:"datetime",label:m("Date"),render:ZDt};function JDt({item:e}){const{text:t,imageUrl:n}=G(s=>{const{getEntityRecord:i}=s(Me);let c;return e.author&&(c=i("root","user",e.author)),{imageUrl:c?.avatar_urls?.[48],text:c?.name}},[e]),[o,r]=x.useState(!1);return a.jsxs(Ot,{alignment:"left",spacing:0,children:[!!n&&a.jsx("div",{className:oe("page-templates-author-field__avatar",{"is-loaded":o}),children:a.jsx("img",{onLoad:()=>r(!0),alt:m("Author avatar"),src:n})}),!n&&a.jsx("div",{className:"page-templates-author-field__icon",children:a.jsx(qo,{icon:TP})}),a.jsx("span",{className:"page-templates-author-field__name",children:t})]})}const eFt={label:m("Author"),id:"author",type:"integer",elements:[],render:JDt,sort:(e,t,n)=>{const o=e._embedded?.author?.[0]?.name||"",r=t._embedded?.author?.[0]?.name||"";return n==="asc"?o.localeCompare(r):r.localeCompare(o)}},tFt={id:"view-post",label:We("View","verb"),isPrimary:!0,icon:vf,isEligible(e){return e.status!=="trash"},callback(e,{onActionPerformed:t}){const n=e[0];window.open(n?.link,"_blank"),t&&t(e)}};function nFt(e,t,n){return n==="asc"?e-t:t-e}function oFt(e,t){return!(e===""||!Number.isInteger(Number(e))||t?.elements&&!(t?.elements.map(o=>o.value)).includes(Number(e)))}const rFt={sort:nFt,isValid:oFt,Edit:"integer"};function sFt(e,t,n){return n==="asc"?e.localeCompare(t):t.localeCompare(e)}function iFt(e,t){return!(t?.elements&&!(t?.elements?.map(o=>o.value)).includes(e))}const aFt={sort:sFt,isValid:iFt,Edit:"text"};function cFt(e,t,n){const o=new Date(e).getTime(),r=new Date(t).getTime();return n==="asc"?o-r:r-o}function lFt(e,t){return!(t?.elements&&!(t?.elements.map(o=>o.value)).includes(e))}const uFt={sort:cFt,isValid:lFt,Edit:"datetime"};function dFt(e){return e==="integer"?rFt:e==="text"?aFt:e==="datetime"?uFt:{sort:(t,n,o)=>typeof t=="number"&&typeof n=="number"?o==="asc"?t-n:n-t:o==="asc"?t.localeCompare(n):n.localeCompare(t),isValid:(t,n)=>!(n?.elements&&!(n?.elements?.map(r=>r.value)).includes(t)),Edit:()=>null}}function pFt({data:e,field:t,onChange:n,hideLabelFromVision:o}){const{id:r,label:s}=t,i=t.getValue({item:e}),c=x.useCallback(l=>n({[r]:l}),[r,n]);return a.jsxs("fieldset",{className:"dataviews-controls__datetime",children:[!o&&a.jsx(no.VisualLabel,{as:"legend",children:s}),o&&a.jsx(qn,{as:"legend",children:s}),a.jsx(lO,{currentTime:i,onChange:c,hideLabelFromVision:!0})]})}function fFt({data:e,field:t,onChange:n,hideLabelFromVision:o}){var r;const{id:s,label:i,description:c}=t,l=(r=t.getValue({item:e}))!==null&&r!==void 0?r:"",u=x.useCallback(d=>n({[s]:Number(d)}),[s,n]);return a.jsx(g0,{label:i,help:c,value:l,onChange:u,__next40pxDefaultSize:!0,hideLabelFromVision:o})}function bFt({data:e,field:t,onChange:n,hideLabelFromVision:o}){const{id:r,label:s}=t,i=t.getValue({item:e}),c=x.useCallback(l=>n({[r]:l}),[r,n]);return t.elements?a.jsx(sb,{label:s,onChange:c,options:t.elements,selected:i,hideLabelFromVision:o}):null}function hFt({data:e,field:t,onChange:n,hideLabelFromVision:o}){var r,s;const{id:i,label:c}=t,l=(r=t.getValue({item:e}))!==null&&r!==void 0?r:"",u=x.useCallback(p=>n({[i]:p}),[i,n]),d=[{label:m("Select item"),value:""},...(s=t?.elements)!==null&&s!==void 0?s:[]];return a.jsx(Pn,{label:c,value:l,options:d,onChange:u,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:o})}function mFt({data:e,field:t,onChange:n,hideLabelFromVision:o}){const{id:r,label:s,placeholder:i}=t,c=t.getValue({item:e}),l=x.useCallback(u=>n({[r]:u}),[r,n]);return a.jsx(dn,{label:s,placeholder:i,value:c??"",onChange:l,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:o})}const Fte={datetime:pFt,integer:fFt,radio:bFt,select:hFt,text:mFt};function gFt(e,t){return typeof e.Edit=="function"?e.Edit:typeof e.Edit=="string"?hT(e.Edit):e.elements?hT("select"):typeof t.Edit=="string"?hT(t.Edit):t.Edit}function hT(e){if(Object.keys(Fte).includes(e))return Fte[e];throw"Control "+e+" not found"}const MFt=e=>({item:t})=>{const n=e.split(".");let o=t;for(const r of n)o.hasOwnProperty(r)?o=o[r]:o=void 0;return o};function vOe(e){return e.map(t=>{var n,o,r,s;const i=dFt(t.type),c=t.getValue||MFt(t.id),l=(n=t.sort)!==null&&n!==void 0?n:function(h,g,z){return i.sort(c({item:h}),c({item:g}),z)},u=(o=t.isValid)!==null&&o!==void 0?o:function(h,g){return i.isValid(c({item:h}),g)},d=gFt(t,i),p=({item:b})=>{const h=c({item:b});return t?.elements?.find(g=>g.value===h)?.label||c({item:b})},f=t.render||(t.elements?p:c);return{...t,label:t.label||t.id,header:t.header||t.label||t.id,getValue:c,render:f,sort:l,isValid:u,Edit:d,enableHiding:(r=t.enableHiding)!==null&&r!==void 0?r:!0,enableSorting:(s=t.enableSorting)!==null&&s!==void 0?s:!0}})}const ok=x.createContext({fields:[]});function zFt({fields:e,children:t}){return a.jsx(ok.Provider,{value:{fields:e},children:t})}function hd(e){return e.children!==void 0}function OFt({title:e}){return a.jsx(dt,{className:"dataforms-layouts-regular__header",spacing:4,children:a.jsxs(Ot,{alignment:"center",children:[a.jsx(_a,{level:2,size:13,children:e}),a.jsx(t1,{})]})})}function yFt({data:e,field:t,onChange:n,hideLabelFromVision:o}){var r;const{fields:s}=x.useContext(ok),i=x.useMemo(()=>hd(t)?{fields:t.children.map(u=>typeof u=="string"?{id:u}:u),type:"regular"}:{type:"regular",fields:[]},[t]);if(hd(t))return a.jsxs(a.Fragment,{children:[!o&&t.label&&a.jsx(OFt,{title:t.label}),a.jsx(BI,{data:e,form:i,onChange:n})]});const c=(r=t.labelPosition)!==null&&r!==void 0?r:"top",l=s.find(u=>u.id===t.id);return l?c==="side"?a.jsxs(Ot,{className:"dataforms-layouts-regular__field",children:[a.jsx("div",{className:"dataforms-layouts-regular__field-label",children:l.label}),a.jsx("div",{className:"dataforms-layouts-regular__field-control",children:a.jsx(l.Edit,{data:e,field:l,onChange:n,hideLabelFromVision:!0},l.id)})]}):a.jsx("div",{className:"dataforms-layouts-regular__field",children:a.jsx(l.Edit,{data:e,field:l,onChange:n,hideLabelFromVision:c==="none"?!0:o})}):null}function AFt({title:e,onClose:t}){return a.jsx(dt,{className:"dataforms-layouts-panel__dropdown-header",spacing:4,children:a.jsxs(Ot,{alignment:"center",children:[e&&a.jsx(_a,{level:2,size:13,children:e}),a.jsx(t1,{}),t&&a.jsx(Ce,{label:m("Close"),icon:rp,onClick:t,size:"small"})]})})}function mT({fieldDefinition:e,popoverAnchor:t,labelPosition:n="side",data:o,onChange:r,field:s}){const i=hd(s)?s.label:e?.label,c=x.useMemo(()=>hd(s)?{type:"regular",fields:s.children.map(u=>typeof u=="string"?{id:u}:u)}:{type:"regular",fields:[{id:s.id}]},[s]),l=x.useMemo(()=>({anchor:t,placement:"left-start",offset:36,shift:!0}),[t]);return a.jsx(so,{contentClassName:"dataforms-layouts-panel__field-dropdown",popoverProps:l,focusOnMount:!0,toggleProps:{size:"compact",variant:"tertiary",tooltipPosition:"middle left"},renderToggle:({isOpen:u,onToggle:d})=>a.jsx(Ce,{className:"dataforms-layouts-panel__field-control",size:"compact",variant:["none","top"].includes(n)?"link":"tertiary","aria-expanded":u,"aria-label":xe(We("Edit %s","field"),i),onClick:d,children:a.jsx(e.render,{item:o})}),renderContent:({onClose:u})=>a.jsxs(a.Fragment,{children:[a.jsx(AFt,{title:i,onClose:u}),a.jsx(BI,{data:o,form:c,onChange:r,children:(d,p)=>{var f;return a.jsx(d,{data:o,field:p,onChange:r,hideLabelFromVision:((f=c?.fields)!==null&&f!==void 0?f:[]).length<2},p.id)}})]})})}function vFt({data:e,field:t,onChange:n}){var o;const{fields:r}=x.useContext(ok),s=r.find(d=>{if(hd(t)){const p=t.children.filter(b=>typeof b=="string"||!hd(b)),f=typeof p[0]=="string"?p[0]:p[0].id;return d.id===f}return d.id===t.id}),i=(o=t.labelPosition)!==null&&o!==void 0?o:"side",[c,l]=x.useState(null);if(!s)return null;const u=hd(t)?t.label:s?.label;return i==="top"?a.jsxs(dt,{className:"dataforms-layouts-panel__field",spacing:0,children:[a.jsx("div",{className:"dataforms-layouts-panel__field-label",style:{paddingBottom:0},children:u}),a.jsx("div",{className:"dataforms-layouts-panel__field-control",children:a.jsx(mT,{field:t,popoverAnchor:c,fieldDefinition:s,data:e,onChange:n,labelPosition:i})})]}):i==="none"?a.jsx("div",{className:"dataforms-layouts-panel__field",children:a.jsx(mT,{field:t,popoverAnchor:c,fieldDefinition:s,data:e,onChange:n,labelPosition:i})}):a.jsxs(Ot,{ref:l,className:"dataforms-layouts-panel__field",children:[a.jsx("div",{className:"dataforms-layouts-panel__field-label",children:u}),a.jsx("div",{className:"dataforms-layouts-panel__field-control",children:a.jsx(mT,{field:t,popoverAnchor:c,fieldDefinition:s,data:e,onChange:n,labelPosition:i})})]})}const xFt=[{type:"regular",component:yFt},{type:"panel",component:vFt}];function wFt(e){return xFt.find(t=>t.type===e)}function _Ft(e){var t,n,o;let r="regular";["regular","panel"].includes((t=e.type)!==null&&t!==void 0?t:"")&&(r=e.type);const s=(n=e.labelPosition)!==null&&n!==void 0?n:r==="regular"?"top":"side";return((o=e.fields)!==null&&o!==void 0?o:[]).map(i=>{var c,l;if(typeof i=="string")return{id:i,layout:r,labelPosition:s};const u=(c=i.layout)!==null&&c!==void 0?c:r,d=(l=i.labelPosition)!==null&&l!==void 0?l:u==="regular"?"top":"side";return{...i,layout:u,labelPosition:d}})}function BI({data:e,form:t,onChange:n,children:o}){const{fields:r}=x.useContext(ok);function s(c){const l=typeof c=="string"?c:c.id;return r.find(u=>u.id===l)}const i=x.useMemo(()=>_Ft(t),[t]);return a.jsx(dt,{spacing:2,children:i.map(c=>{const l=wFt(c.layout)?.component;if(!l)return null;const u=hd(c)?void 0:s(c);return u&&u.isVisible&&!u.isVisible(e)?null:o?o(l,c):a.jsx(l,{data:e,field:c,onChange:n},c.id)})})}function xOe({data:e,form:t,fields:n,onChange:o}){const r=x.useMemo(()=>vOe(n),[n]);return t.fields?a.jsx(zFt,{fields:r,children:a.jsx(BI,{data:e,form:t,onChange:o})}):null}function $te(e,t,n){return vOe(t.filter(({id:r})=>!!n.fields?.includes(r))).every(r=>r.isValid(e,{elements:r.elements}))}const gT=[zDt],MT={fields:["menu_order"]};function kFt({items:e,closeModal:t,onActionPerformed:n}){const[o,r]=x.useState(e[0]),s=o.menu_order,{editEntityRecord:i,saveEditedEntityRecord:c}=Oe(Me),{createSuccessNotice:l,createErrorNotice:u}=Oe(mt);async function d(f){if(f.preventDefault(),!!$te(o,gT,MT))try{await i("postType",o.type,o.id,{menu_order:s}),t?.(),await c("postType",o.type,o.id,{throwOnError:!0}),l(m("Order updated."),{type:"snackbar"}),n?.(e)}catch(b){const h=b,g=h.message&&h.code!=="unknown_error"?h.message:m("An error occurred while updating the order");u(g,{type:"snackbar"})}}const p=!$te(o,gT,MT);return a.jsx("form",{onSubmit:d,children:a.jsxs(dt,{spacing:"5",children:[a.jsx("div",{children:m("Determines the order of pages. Pages with the same order value are sorted alphabetically. Negative order values are supported.")}),a.jsx(xOe,{data:o,fields:gT,form:MT,onChange:f=>r({...o,...f})}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},children:m("Cancel")}),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",accessibleWhenDisabled:!0,disabled:p,children:m("Save")})]})]})})}const SFt={id:"order-pages",label:m("Order"),isEligible({status:e}){return e!=="trash"},RenderModal:kFt},CFt=[dOe],qFt={fields:["title"]},RFt={id:"duplicate-post",label:We("Duplicate","action label"),isEligible({status:e}){return e!=="trash"},RenderModal:({items:e,closeModal:t,onActionPerformed:n})=>{const[o,r]=x.useState({...e[0],title:xe(We("%s (Copy)","post"),Er(e[0]))}),[s,i]=x.useState(!1),{saveEntityRecord:c}=Oe(Me),{createSuccessNotice:l,createErrorNotice:u}=Oe(mt);async function d(p){if(p.preventDefault(),s)return;const f={status:"draft",title:o.title,slug:o.title||m("No title"),comment_status:o.comment_status,content:typeof o.content=="string"?o.content:o.content.raw,excerpt:typeof o.excerpt=="string"?o.excerpt:o.excerpt?.raw,meta:o.meta,parent:o.parent,password:o.password,template:o.template,format:o.format,featured_media:o.featured_media,menu_order:o.menu_order,ping_status:o.ping_status},b="wp:action-assign-";Object.keys(o?._links||{}).filter(g=>g.startsWith(b)).map(g=>g.slice(b.length)).forEach(g=>{o.hasOwnProperty(g)&&(f[g]=o[g])}),i(!0);try{const g=await c("postType",o.type,f,{throwOnError:!0});l(xe(m('"%s" successfully created.'),Lt(g.title?.rendered||o.title)),{id:"duplicate-post-action",type:"snackbar"}),n&&n([g])}catch(g){const z=g,A=z.message&&z.code!=="unknown_error"?z.message:m("An error occurred while duplicating the page.");u(A,{type:"snackbar"})}finally{i(!1),t?.()}}return a.jsx("form",{onSubmit:d,children:a.jsxs(dt,{spacing:3,children:[a.jsx(xOe,{data:o,fields:CFt,form:qFt,onChange:p=>r(f=>({...f,...p}))}),a.jsxs(Ot,{spacing:2,justify:"end",children:[a.jsx(Ce,{variant:"tertiary",onClick:t,__next40pxDefaultSize:!0,children:m("Cancel")}),a.jsx(Ce,{variant:"primary",type:"submit",isBusy:s,"aria-disabled":s,__next40pxDefaultSize:!0,children:We("Duplicate","action label")})]})]})})}},{PATTERN_TYPES:Vte}=Wm(Vi),TFt={id:"rename-post",label:m("Rename"),isEligible(e){return e.status==="trash"?!1:["wp_template","wp_template_part",...Object.values(Vte)].includes(e.type)?q9t(e)?aOe(e)&&e.is_custom&&e.permissions?.update:R9t(e)?e.source==="custom"&&!e?.has_theme_file&&e.permissions?.update:e.type===Vte.user&&e.permissions?.update:e.permissions?.update},RenderModal:({items:e,closeModal:t,onActionPerformed:n})=>{const[o]=e,[r,s]=x.useState(()=>Er(o)),{editEntityRecord:i,saveEditedEntityRecord:c}=Oe(Me),{createSuccessNotice:l,createErrorNotice:u}=Oe(mt);async function d(p){p.preventDefault();try{await i("postType",o.type,o.id,{title:r}),s(""),t?.(),await c("postType",o.type,o.id,{throwOnError:!0}),l(m("Name updated"),{type:"snackbar"}),n?.(e)}catch(f){const b=f,h=b.message&&b.code!=="unknown_error"?b.message:m("An error occurred while updating the name");u(h,{type:"snackbar"})}}return a.jsx("form",{onSubmit:d,children:a.jsxs(dt,{spacing:"5",children:[a.jsx(dn,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:m("Name"),value:r,onChange:s,required:!0}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},children:m("Cancel")}),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",children:m("Save")})]})]})})}},EFt=e=>e?e.source==="custom"&&(!!e?.plugin||e?.has_theme_file):!1,WFt=async(e,{allowUndo:t=!0}={})=>{const n="edit-site-template-reverted";if(jr(mt).removeNotice(n),!EFt(e)){jr(mt).createErrorNotice(m("This template is not revertable."),{type:"snackbar"});return}try{const o=uo(Me).getEntityConfig("postType",e.type);if(!o){jr(mt).createErrorNotice(m("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});return}const r=tn(`${o.baseURL}/${e.id}`,{context:"edit",source:e.origin}),s=await Wt({path:r});if(!s){jr(mt).createErrorNotice(m("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});return}const i=({blocks:u=[]})=>Jd(u),c=uo(Me).getEditedEntityRecord("postType",e.type,e.id);jr(Me).editEntityRecord("postType",e.type,e.id,{content:i,blocks:c.blocks,source:"custom"},{undoIgnore:!0});const l=Ko(s?.content?.raw);if(jr(Me).editEntityRecord("postType",e.type,s.id,{content:i,blocks:l,source:"theme"}),t){const u=()=>{jr(Me).editEntityRecord("postType",e.type,c.id,{content:i,blocks:c.blocks,source:"custom"})};jr(mt).createSuccessNotice(m("Template reset."),{type:"snackbar",id:n,actions:[{label:m("Undo"),onClick:u}]})}}catch(o){const r=o.message&&o.code!=="unknown_error"?o.message:m("Template revert failed. Please reload.");jr(mt).createErrorNotice(r,{type:"snackbar"})}},NFt={id:"reset-post",label:m("Reset"),isEligible:e=>qh(e)&&e?.source==="custom"&&(!!(e.type==="wp_template"&&e?.plugin)||e?.has_theme_file),icon:Xue,supportsBulk:!0,hideModalHeader:!0,RenderModal:({items:e,closeModal:t,onActionPerformed:n})=>{const[o,r]=x.useState(!1),{saveEditedEntityRecord:s}=Oe(Me),{createSuccessNotice:i,createErrorNotice:c}=Oe(mt),l=async()=>{try{for(const u of e)await WFt(u,{allowUndo:!1}),await s("postType",u.type,u.id);i(e.length>1?xe(m("%s items reset."),e.length):xe(m('"%s" reset.'),Er(e[0])),{type:"snackbar",id:"revert-template-action"})}catch(u){let d;e[0].type==="wp_template"?d=e.length===1?m("An error occurred while reverting the template."):m("An error occurred while reverting the templates."):d=e.length===1?m("An error occurred while reverting the template part."):m("An error occurred while reverting the template parts.");const p=u,f=p.message&&p.code!=="unknown_error"?p.message:d;c(f,{type:"snackbar"})}};return a.jsxs(dt,{spacing:"5",children:[a.jsx(Sn,{children:m("Reset to default and clear all customizations?")}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,disabled:o,accessibleWhenDisabled:!0,children:m("Cancel")}),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"primary",onClick:async()=>{r(!0),await l(),n?.(e),r(!1),t?.()},isBusy:o,disabled:o,accessibleWhenDisabled:!0,children:m("Reset")})]})]})}},{CreatePatternModalContents:BFt,useDuplicatePatternProps:LFt}=Wm(Vi),PFt={id:"duplicate-pattern",label:We("Duplicate","action label"),isEligible:e=>e.type!=="wp_template_part",modalHeader:We("Duplicate pattern","action label"),RenderModal:({items:e,closeModal:t})=>{const[n]=e,o=LFt({pattern:n,onSuccess:()=>t?.()});return a.jsx(BFt,{onClose:t,confirmLabel:We("Duplicate","action label"),...o})}};"stream"in Blob.prototype||Object.defineProperty(Blob.prototype,"stream",{value(){return new Response(this).body}}),"setBigUint64"in DataView.prototype||Object.defineProperty(DataView.prototype,"setBigUint64",{value(e,t,n){const o=Number(0xffffffffn&t),r=Number(t>>32n);this.setUint32(e+(n?0:4),o,n),this.setUint32(e+(n?4:0),r,n)}});var Th=e=>new DataView(new ArrayBuffer(e)),Vl=e=>new Uint8Array(e.buffer||e),v2=e=>new TextEncoder().encode(String(e)),uf=e=>Math.min(4294967295,Number(e)),Hte=e=>Math.min(65535,Number(e));function jFt(e,t){if(t===void 0||t instanceof Date||(t=new Date(t)),e instanceof File)return{isFile:1,t:t||new Date(e.lastModified),i:e.stream()};if(e instanceof Response)return{isFile:1,t:t||new Date(e.headers.get("Last-Modified")||Date.now()),i:e.body};if(t===void 0)t=new Date;else if(isNaN(t))throw new Error("Invalid modification date.");if(e===void 0)return{isFile:0,t};if(typeof e=="string")return{isFile:1,t,i:v2(e)};if(e instanceof Blob)return{isFile:1,t,i:e.stream()};if(e instanceof Uint8Array||e instanceof ReadableStream)return{isFile:1,t,i:e};if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return{isFile:1,t,i:Vl(e)};if(Symbol.asyncIterator in e)return{isFile:1,t,i:wOe(e[Symbol.asyncIterator]())};throw new TypeError("Unsupported input format.")}function wOe(e,t=e){return new ReadableStream({async pull(n){let o=0;for(;n.desiredSize>o;){const r=await e.next();if(!r.value){n.close();break}{const s=IFt(r.value);n.enqueue(s),o+=s.byteLength}}},cancel(n){t.throw?.(n)}})}function IFt(e){return typeof e=="string"?v2(e):e instanceof Uint8Array?e:Vl(e)}function _Oe(e,t,n){let[o,r]=function(s){return s?s instanceof Uint8Array?[s,1]:ArrayBuffer.isView(s)||s instanceof ArrayBuffer?[Vl(s),1]:[v2(s),0]:[void 0,0]}(t);if(e instanceof File)return{o:zT(o||v2(e.name)),u:BigInt(e.size),l:r};if(e instanceof Response){const s=e.headers.get("content-disposition"),i=s&&s.match(/;\s*filename\*?\s*=\s*(?:UTF-\d+''|)["']?([^;"'\r\n]*)["']?(?:;|$)/i),c=i&&i[1]||e.url&&new URL(e.url).pathname.split("/").findLast(Boolean),l=c&&decodeURIComponent(c),u=n||+e.headers.get("content-length");return{o:zT(o||v2(l)),u:BigInt(u),l:r}}return o=zT(o,e!==void 0||n!==void 0),typeof e=="string"?{o,u:BigInt(v2(e).length),l:r}:e instanceof Blob?{o,u:BigInt(e.size),l:r}:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?{o,u:BigInt(e.byteLength),l:r}:{o,u:DFt(e,n),l:r}}function DFt(e,t){return t>-1?BigInt(t):e?void 0:0n}function zT(e,t=1){if(!e||e.every(n=>n===47))throw new Error("The file must have a name.");if(t)for(;e[e.length-1]===47;)e=e.subarray(0,-1);else e[e.length-1]!==47&&(e=new Uint8Array([...e,47]));return e}var kOe=new Uint32Array(256);for(let e=0;e<256;++e){let t=e;for(let n=0;n<8;++n)t=t>>>1^(1&t&&3988292384);kOe[e]=t}function Ute(e,t=0){t^=-1;for(var n=0,o=e.length;n>>8^kOe[255&t^e[n]];return(-1^t)>>>0}function SOe(e,t,n=0){const o=e.getSeconds()>>1|e.getMinutes()<<5|e.getHours()<<11,r=e.getDate()|e.getMonth()+1<<5|e.getFullYear()-1980<<9;t.setUint16(n,o,1),t.setUint16(n+2,r,1)}function FFt({o:e,l:t},n){return 8*(!t||(n??function(o){try{$Ft.decode(o)}catch{return 0}return 1}(e)))}var $Ft=new TextDecoder("utf8",{fatal:1});function VFt(e,t=0){const n=Th(30);return n.setUint32(0,1347093252),n.setUint32(4,754976768|t),SOe(e.t,n,10),n.setUint16(26,e.o.length,1),Vl(n)}async function*HFt(e){let{i:t}=e;if("then"in t&&(t=await t),t instanceof Uint8Array)yield t,e.m=Ute(t,0),e.u=BigInt(t.length);else{e.u=0n;const n=t.getReader();for(;;){const{value:o,done:r}=await n.read();if(r)break;e.m=Ute(o,e.m),e.u+=BigInt(o.length),yield o}}}function UFt(e,t){const n=Th(16+(t?8:0));return n.setUint32(0,1347094280),n.setUint32(4,e.isFile?e.m:0,1),t?(n.setBigUint64(8,e.u,1),n.setBigUint64(16,e.u,1)):(n.setUint32(8,uf(e.u),1),n.setUint32(12,uf(e.u),1)),Vl(n)}function XFt(e,t,n=0,o=0){const r=Th(46);return r.setUint32(0,1347092738),r.setUint32(4,755182848),r.setUint16(8,2048|n),SOe(e.t,r,12),r.setUint32(16,e.isFile?e.m:0,1),r.setUint32(20,uf(e.u),1),r.setUint32(24,uf(e.u),1),r.setUint16(28,e.o.length,1),r.setUint16(30,o,1),r.setUint16(40,e.isFile?33204:16893,1),r.setUint32(42,uf(t),1),Vl(r)}function GFt(e,t,n){const o=Th(n);return o.setUint16(0,1,1),o.setUint16(2,n-4,1),16&n&&(o.setBigUint64(4,e.u,1),o.setBigUint64(12,e.u,1)),o.setBigUint64(n-8,t,1),Vl(o)}function COe(e){return e instanceof File||e instanceof Response?[[e],[e]]:[[e.input,e.name,e.size],[e.input,e.lastModified]]}var KFt=e=>function(t){let n=BigInt(22),o=0n,r=0;for(const s of t){if(!s.o)throw new Error("Every file must have a non-empty name.");if(s.u===void 0)throw new Error(`Missing size for file "${new TextDecoder().decode(s.o)}".`);const i=s.u>=0xffffffffn,c=o>=0xffffffffn;o+=BigInt(46+s.o.length+(i&&8))+s.u,n+=BigInt(s.o.length+46+(12*c|28*i)),r||(r=i)}return(r||o>=0xffffffffn)&&(n+=BigInt(76)),n+o}(function*(t){for(const n of t)yield _Oe(...COe(n)[0])}(e));function YFt(e,t={}){const n={"Content-Type":"application/zip","Content-Disposition":"attachment"};return(typeof t.length=="bigint"||Number.isInteger(t.length))&&t.length>0&&(n["Content-Length"]=String(t.length)),t.metadata&&(n["Content-Length"]=String(KFt(t.metadata))),new Response(ZFt(e,t),{headers:n})}function ZFt(e,t={}){const n=function(o){const r=o[Symbol.iterator in o?Symbol.iterator:Symbol.asyncIterator]();return{async next(){const s=await r.next();if(s.done)return s;const[i,c]=COe(s.value);return{done:0,value:Object.assign(jFt(...c),_Oe(...i))}},throw:r.throw?.bind(r),[Symbol.asyncIterator](){return this}}}(e);return wOe(async function*(o,r){const s=[];let i=0n,c=0n,l=0;for await(const p of o){const f=FFt(p,r.buffersAreUTF8);yield VFt(p,f),yield new Uint8Array(p.o),p.isFile&&(yield*HFt(p));const b=p.u>=0xffffffffn,h=12*(i>=0xffffffffn)|28*b;yield UFt(p,b),s.push(XFt(p,i,f,h)),s.push(p.o),h&&s.push(GFt(p,i,h)),b&&(i+=8n),c++,i+=BigInt(46+p.o.length)+p.u,l||(l=b)}let u=0n;for(const p of s)yield p,u+=BigInt(p.length);if(l||i>=0xffffffffn){const p=Th(76);p.setUint32(0,1347094022),p.setBigUint64(4,BigInt(44),1),p.setUint32(12,755182848),p.setBigUint64(24,c,1),p.setBigUint64(32,c,1),p.setBigUint64(40,u,1),p.setBigUint64(48,i,1),p.setUint32(56,1347094023),p.setBigUint64(64,i+u,1),p.setUint32(72,1,1),yield Vl(p)}const d=Th(22);d.setUint32(0,1347093766),d.setUint16(8,Hte(c),1),d.setUint16(10,Hte(c),1),d.setUint32(12,uf(u),1),d.setUint32(16,uf(i),1),yield Vl(d)}(n,t),n)}function Xte(e){return JSON.stringify({__file:e.type,title:Er(e),content:typeof e.content=="string"?e.content:e.content?.raw,syncStatus:e.wp_pattern_sync_status},null,2)}const QFt={id:"export-pattern",label:m("Export as JSON"),icon:NZe,supportsBulk:!0,isEligible:e=>e.type==="wp_block",callback:async e=>{if(e.length===1)return MX(`${Ti(Er(e[0])||e[0].slug)}.json`,Xte(e[0]),"application/json");const t={},n=e.map(o=>{const r=Ti(Er(o)||o.slug);return t[r]=(t[r]||0)+1,{name:`${r+(t[r]>1?"-"+(t[r]-1):"")}.json`,lastModified:new Date,input:Xte(o)}});return MX(m("patterns-export")+".zip",await YFt(n).blob(),"application/zip")}},JFt={id:"view-post-revisions",context:"list",label(e){var t;const n=(t=e[0]._links?.["version-history"]?.[0]?.count)!==null&&t!==void 0?t:0;return xe(m("View revisions (%s)"),n)},isEligible(e){var t,n;if(e.status==="trash")return!1;const o=(t=e?._links?.["predecessor-version"]?.[0]?.id)!==null&&t!==void 0?t:null,r=(n=e?._links?.["version-history"]?.[0]?.count)!==null&&n!==void 0?n:0;return!!o&&r>1},callback(e,{onActionPerformed:t}){const n=e[0],o=tn("revision.php",{revision:n?._links?.["predecessor-version"]?.[0]?.id});document.location.href=o,t&&t(e)}},e$t={id:"permanently-delete",label:m("Permanently delete"),supportsBulk:!0,icon:K3,isEligible(e){if(qh(e)||e.type==="wp_block")return!1;const{status:t,permissions:n}=e;return t==="trash"&&n?.delete},hideModalHeader:!0,RenderModal:({items:e,closeModal:t,onActionPerformed:n})=>{const[o,r]=x.useState(!1),{createSuccessNotice:s,createErrorNotice:i}=Oe(mt),{deleteEntityRecord:c}=Oe(Me);return a.jsxs(dt,{spacing:"5",children:[a.jsx(Sn,{children:e.length>1?xe(Dn("Are you sure you want to permanently delete %d item?","Are you sure you want to permanently delete %d items?",e.length),e.length):xe(m('Are you sure you want to permanently delete "%s"?'),Lt(Er(e[0])))}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{variant:"tertiary",onClick:t,disabled:o,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:m("Cancel")}),a.jsx(Ce,{variant:"primary",onClick:async()=>{r(!0);const l=await Promise.allSettled(e.map(u=>c("postType",u.type,u.id,{force:!0},{throwOnError:!0})));if(l.every(({status:u})=>u==="fulfilled")){let u;l.length===1?u=xe(m('"%s" permanently deleted.'),Er(e[0])):u=m("The items were permanently deleted."),s(u,{type:"snackbar",id:"permanently-delete-post-action"}),n?.(e)}else{let u;if(l.length===1){const d=l[0];d.reason?.message?u=d.reason.message:u=m("An error occurred while permanently deleting the item.")}else{const d=new Set,p=l.filter(({status:f})=>f==="rejected");for(const f of p){const b=f;b.reason?.message&&d.add(b.reason.message)}d.size===0?u=m("An error occurred while permanently deleting the items."):d.size===1?u=xe(m("An error occurred while permanently deleting the items: %s"),[...d][0]):u=xe(m("Some errors occurred while permanently deleting the items: %s"),[...d].join(","))}i(u,{type:"snackbar"})}r(!1),t?.()},isBusy:o,disabled:o,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:m("Delete permanently")})]})]})}},t$t={id:"restore",label:m("Restore"),isPrimary:!0,icon:Xue,supportsBulk:!0,isEligible(e){return!qh(e)&&e.type!=="wp_block"&&e.status==="trash"&&e.permissions?.update},async callback(e,{registry:t,onActionPerformed:n}){const{createSuccessNotice:o,createErrorNotice:r}=t.dispatch(mt),{editEntityRecord:s,saveEditedEntityRecord:i}=t.dispatch(Me);await Promise.allSettled(e.map(l=>s("postType",l.type,l.id,{status:"draft"})));const c=await Promise.allSettled(e.map(l=>i("postType",l.type,l.id,{throwOnError:!0})));if(c.every(({status:l})=>l==="fulfilled")){let l;e.length===1?l=xe(m('"%s" has been restored.'),Er(e[0])):e[0].type==="page"?l=xe(m("%d pages have been restored."),e.length):l=xe(m("%d posts have been restored."),e.length),o(l,{type:"snackbar",id:"restore-post-action"}),n&&n(e)}else{let l;if(c.length===1){const u=c[0];u.reason?.message?l=u.reason.message:l=m("An error occurred while restoring the post.")}else{const u=new Set,d=c.filter(({status:p})=>p==="rejected");for(const p of d){const f=p;f.reason?.message&&u.add(f.reason.message)}u.size===0?l=m("An error occurred while restoring the posts."):u.size===1?l=xe(m("An error occurred while restoring the posts: %s"),[...u][0]):l=xe(m("Some errors occurred while restoring the posts: %s"),[...u].join(","))}r(l,{type:"snackbar"})}}},n$t={id:"move-to-trash",label:m("Move to trash"),isPrimary:!0,icon:K3,isEligible(e){return qh(e)||e.type==="wp_block"?!1:!!e.status&&!["auto-draft","trash"].includes(e.status)&&e.permissions?.delete},supportsBulk:!0,hideModalHeader:!0,RenderModal:({items:e,closeModal:t,onActionPerformed:n})=>{const[o,r]=x.useState(!1),{createSuccessNotice:s,createErrorNotice:i}=Oe(mt),{deleteEntityRecord:c}=Oe(Me);return a.jsxs(dt,{spacing:"5",children:[a.jsx(Sn,{children:e.length===1?xe(m('Are you sure you want to move "%s" to the trash?'),Er(e[0])):xe(Dn("Are you sure you want to move %d item to the trash ?","Are you sure you want to move %d items to the trash ?",e.length),e.length)}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,disabled:o,accessibleWhenDisabled:!0,children:m("Cancel")}),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"primary",onClick:async()=>{r(!0);const l=await Promise.allSettled(e.map(u=>c("postType",u.type,u.id.toString(),{},{throwOnError:!0})));if(l.every(({status:u})=>u==="fulfilled")){let u;l.length===1?u=xe(m('"%s" moved to the trash.'),Er(e[0])):u=xe(Dn("%s item moved to the trash.","%s items moved to the trash.",e.length),e.length),s(u,{type:"snackbar",id:"move-to-trash-action"})}else{let u;if(l.length===1){const d=l[0];d.reason?.message?u=d.reason.message:u=m("An error occurred while moving the item to the trash.")}else{const d=new Set,p=l.filter(({status:f})=>f==="rejected");for(const f of p){const b=f;b.reason?.message&&d.add(b.reason.message)}d.size===0?u=m("An error occurred while moving the items to the trash."):d.size===1?u=xe(m("An error occurred while moving the item to the trash: %s"),[...d][0]):u=xe(m("Some errors occurred while moving the items to the trash: %s"),[...d].join(","))}i(u,{type:"snackbar"})}n&&n(e),r(!1),t?.()},isBusy:o,disabled:o,accessibleWhenDisabled:!0,children:We("Trash","verb")})]})]})}};function o$t(e){const t=new Set;if(e.length===1){const n=e[0];n.reason?.message&&t.add(n.reason.message)}else{const n=e.filter(({status:o})=>o==="rejected");for(const o of n){const r=o;r.reason?.message&&t.add(r.reason.message)}}return t}const r$t=async(e,t,n)=>{const{createSuccessNotice:o,createErrorNotice:r}=jr(mt),{deleteEntityRecord:s}=jr(Me),i=await Promise.allSettled(e.map(u=>s("postType",u.type,u.id,{force:!0},{throwOnError:!0})));if(i.every(({status:u})=>u==="fulfilled")){var c;let u;i.length===1?u=t.success.messages.getMessage(e[0]):u=t.success.messages.getBatchMessage(e),o(u,{type:(c=t.success.type)!==null&&c!==void 0?c:"snackbar",id:t.success.id}),n.onActionPerformed?.(e)}else{var l;const u=o$t(i);let d="";i.length===1?d=t.error.messages.getMessage(u):d=t.error.messages.getBatchMessage(u),r(d,{type:(l=t.error.type)!==null&&l!==void 0?l:"snackbar",id:t.error.id}),n.onActionError?.()}},{PATTERN_TYPES:s$t}=Wm(Vi),i$t={id:"delete-post",label:m("Delete"),isPrimary:!0,icon:K3,isEligible(e){return qh(e)?aOe(e):e.type===s$t.user},supportsBulk:!0,hideModalHeader:!0,RenderModal:({items:e,closeModal:t,onActionPerformed:n})=>{const[o,r]=x.useState(!1),s=e.every(i=>qh(i)&&i?.has_theme_file);return a.jsxs(dt,{spacing:"5",children:[a.jsx(Sn,{children:e.length>1?xe(Dn("Delete %d item?","Delete %d items?",e.length),e.length):xe(We('Delete "%s"?',"template part"),Er(e[0]))}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{variant:"tertiary",onClick:t,disabled:o,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:m("Cancel")}),a.jsx(Ce,{variant:"primary",onClick:async()=>{r(!0),await r$t(e,{success:{messages:{getMessage:c=>xe(s?m('"%s" reset.'):We('"%s" deleted.',"template part"),Lt(Er(c))),getBatchMessage:()=>m(s?"Items reset.":"Items deleted.")}},error:{messages:{getMessage:c=>c.size===1?[...c][0]:m(s?"An error occurred while reverting the item.":"An error occurred while deleting the item."),getBatchMessage:c=>c.size===0?m(s?"An error occurred while reverting the items.":"An error occurred while deleting the items."):c.size===1?s?xe(m("An error occurred while reverting the items: %s"),[...c][0]):xe(m("An error occurred while deleting the items: %s"),[...c][0]):s?xe(m("Some errors occurred while reverting the items: %s"),[...c].join(",")):xe(m("Some errors occurred while deleting the items: %s"),[...c].join(","))}}},{onActionPerformed:n}),r(!1),t?.()},isBusy:o,disabled:o,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:m("Delete")})]})]})}},a$t=()=>{var e;return(e=G(t=>t(Me).getEntityRecords("postType","wp_template_part",{per_page:-1}),[]))!==null&&e!==void 0?e:[]},c$t=(e,t)=>{const n=e.toLowerCase(),o=t.map(s=>s.title.rendered.toLowerCase());if(!o.includes(n))return e;let r=2;for(;o.includes(`${n} ${r}`);)r++;return`${e} ${r}`},l$t=e=>Ti(e).replace(/[^\w-]+/g,"")||"wp-custom-part";function Gte(e,t){return`fields-create-template-part-modal__area-option-${e}-${t}`}function Kte(e,t){return`fields-create-template-part-modal__area-option-description-${e}-${t}`}function LI({modalTitle:e,...t}){const n=G(o=>o(Me).getPostType("wp_template_part")?.labels?.add_new_item,[]);return a.jsx(Zo,{title:e||n,onRequestClose:t.closeModal,overlayClassName:"fields-create-template-part-modal",focusOnMount:"firstContentElement",size:"medium",children:a.jsx(qOe,{...t})})}const u$t=e=>e==="header"?XP:e==="footer"?UP:e==="sidebar"?GP:Qf;function qOe({defaultArea:e="uncategorized",blocks:t=[],confirmLabel:n=m("Add"),closeModal:o,onCreate:r,onError:s,defaultTitle:i=""}){const{createErrorNotice:c}=Oe(mt),{saveEntityRecord:l}=Oe(Me),u=a$t(),[d,p]=x.useState(i),[f,b]=x.useState(e),[h,g]=x.useState(!1),z=vt(LI),A=G(v=>v(Me).getEntityRecord("root","__unstableBase")?.default_template_part_areas,[]);async function _(){if(!(!d||h))try{g(!0);const v=c$t(d,u),M=l$t(v),y=await l("postType","wp_template_part",{slug:M,title:v,content:Ks(t),area:f},{throwOnError:!0});await r(y)}catch(v){const M=v instanceof Error&&"code"in v&&v.message&&v.code!=="unknown_error"?v.message:m("An error occurred while creating the template part.");c(M,{type:"snackbar"}),s?.()}finally{g(!1)}}return a.jsx("form",{onSubmit:async v=>{v.preventDefault(),await _()},children:a.jsxs(dt,{spacing:"4",children:[a.jsx(dn,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:m("Name"),value:d,onChange:p,required:!0}),a.jsxs("fieldset",{children:[a.jsx(no.VisualLabel,{as:"legend",children:m("Area")}),a.jsx("div",{className:"fields-create-template-part-modal__area-radio-group",children:(A??[]).map(v=>{const M=u$t(v.icon);return a.jsxs("div",{className:"fields-create-template-part-modal__area-radio-wrapper",children:[a.jsx("input",{type:"radio",id:Gte(v.area,z),name:`fields-create-template-part-modal__area-${z}`,value:v.area,checked:f===v.area,onChange:()=>{b(v.area)},"aria-describedby":Kte(v.area,z)}),a.jsx(qo,{icon:M,className:"fields-create-template-part-modal__area-radio-icon"}),a.jsx("label",{htmlFor:Gte(v.area,z),className:"fields-create-template-part-modal__area-radio-label",children:v.label}),a.jsx(qo,{icon:M0,className:"fields-create-template-part-modal__area-radio-checkmark"}),a.jsx("p",{className:"fields-create-template-part-modal__area-radio-description",id:Kte(v.area,z),children:v.description})]},v.area)})})]}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{o()},children:m("Cancel")}),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"primary",type:"submit","aria-disabled":!d||h,isBusy:h,children:n})]})]})})}const d$t={id:"duplicate-template-part",label:We("Duplicate","action label"),isEligible:e=>e.type==="wp_template_part",modalHeader:We("Duplicate template part","action label"),RenderModal:({items:e,closeModal:t})=>{const[n]=e,o=x.useMemo(()=>{var i;return(i=n.blocks)!==null&&i!==void 0?i:Ko(typeof n.content=="string"?n.content:n.content.raw,{__unstableSkipMigrationLogs:!0})},[n.content,n.blocks]),{createSuccessNotice:r}=Oe(mt);function s(i){r(xe(We('"%s" duplicated.',"template part"),Er(i)),{type:"snackbar",id:"edit-site-patterns-success"}),t?.()}return a.jsx(qOe,{blocks:o,defaultArea:n.area,defaultTitle:xe(We("%s (Copy)","template part"),Er(n)),onCreate:s,onError:t,confirmLabel:We("Duplicate","action label"),closeModal:t??(()=>{})})}};function p$t(e,t,n){if(!n)return t;let o=e.get(t);return o||(o=S5({"core/block-editor":u_},t),o.registerStore("core/editor",VOe),e.set(t,o)),o}const f$t=Or(e=>({useSubRegistry:t=!0,...n})=>{const o=Fn(),[r]=x.useState(()=>new WeakMap),s=p$t(r,o,t);return s===o?a.jsx(e,{registry:o,...n}):a.jsx($N,{value:s,children:a.jsx(e,{registry:s,...n})})},"withRegistryProvider"),Bu=(e,t)=>`${t}`,tN=e=>`href="${e}" target="_blank" rel="noreferrer noopener"`,b$t=(e,t)=>{let n=e.trim();return e!=="pdm"&&(n=e.toUpperCase().replace("SAMPLING","Sampling")),t&&(n+=` ${t}`),["pdm","cc0"].includes(e)||(n=`CC ${n}`),n},h$t=e=>{const{title:t,foreign_landing_url:n,creator:o,creator_url:r,license:s,license_version:i,license_url:c}=e,l=b$t(s,i),u=Lt(o);let d;return u?d=t?xe(We('"%1$s" by %2$s/ %3$s',"caption"),Bu(n,Lt(t)),r?Bu(r,u):u,c?Bu(`${c}?ref=openverse`,l):l):xe(We("Work by %2$s/ %3$s","caption"),tN(n),r?Bu(r,u):u,c?Bu(`${c}?ref=openverse`,l):l):d=t?xe(We('"%1$s"/ %2$s',"caption"),Bu(n,Lt(t)),c?Bu(`${c}?ref=openverse`,l):l):xe(We("Work/ %2$s","caption"),tN(n),c?Bu(`${c}?ref=openverse`,l):l),d.replace(/\s{2}/g," ")},OT=async(e={})=>(await C0e(Me).getMediaItems({...e,orderBy:e?.search?"relevance":"date"})).map(n=>({...n,alt:n.alt_text,url:n.source_url,previewUrl:n.media_details?.sizes?.medium?.source_url,caption:n.caption?.raw})),m$t=[{name:"images",labels:{name:m("Images"),search_items:m("Search images")},mediaType:"image",async fetch(e={}){return OT({...e,media_type:"image"})}},{name:"videos",labels:{name:m("Videos"),search_items:m("Search videos")},mediaType:"video",async fetch(e={}){return OT({...e,media_type:"video"})}},{name:"audio",labels:{name:m("Audio"),search_items:m("Search audio")},mediaType:"audio",async fetch(e={}){return OT({...e,media_type:"audio"})}},{name:"openverse",labels:{name:m("Openverse"),search_items:m("Search Openverse")},mediaType:"image",async fetch(e={}){const n={...e,...{mature:!1,excluded_source:"flickr,inaturalist,wikimedia",license:"pdm,cc0"}},o={per_page:"page_size",search:"q"},r=new URL("https://api.openverse.org/v1/images/");return Object.entries(n).forEach(([l,u])=>{const d=o[l]||l;r.searchParams.set(d,u)}),(await(await window.fetch(r,{headers:{"User-Agent":"WordPress/inserter-media-fetch"}})).json()).results.map(l=>({...l,title:l.title?.toLowerCase().startsWith("file:")?l.title.slice(5):l.title,sourceId:l.id,id:void 0,caption:h$t(l),previewUrl:l.thumbnail}))},getReportUrl:({sourceId:e})=>`https://wordpress.org/openverse/image/${e}/report/`,isExternalResource:!0}],g$t=()=>{};function M$t({additionalData:e={},allowedTypes:t,filesList:n,maxUploadFileSize:o,onError:r=g$t,onFileChange:s,onSuccess:i}){const{getCurrentPost:c,getEditorSettings:l}=uo(_e),{lockPostAutosaving:u,unlockPostAutosaving:d,lockPostSaving:p,unlockPostSaving:f}=jr(_e),b=l().allowedMimeTypes,h=`image-upload-${Is()}`;let g=!1;o=o||l().maxUploadFileSize;const z=c(),A=typeof z?.id=="number"?z.id:z?.wp_id,_=()=>{p(h),u(h),g=!0},v=A?{post:A}:{},M=()=>{f(h),d(h),g=!1};qDt({allowedTypes:t,filesList:n,onFileChange:y=>{g?M():_(),s?.(y)},onSuccess:i,additionalData:{...v,...e},maxUploadFileSize:o,onError:({message:y})=>{M(),r(y)},wpAllowedMimeTypes:b})}const{sideloadMedia:z$t}=St(yOe),{GlobalStylesContext:O$t,cleanEmptyObject:yT}=St(jn);function ROe(e,t){return _0e(e,t,{isMergeableObject:a3,customMerge:n=>{if(n==="backgroundImage")return(o,r)=>r}})}function y$t(){const{globalStylesId:e,isReady:t,settings:n,styles:o,_links:r}=G(u=>{const{getEntityRecord:d,getEditedEntityRecord:p,hasFinishedResolution:f,canUser:b}=u(Me),h=u(Me).__experimentalGetCurrentGlobalStylesId();let g;const z=h?b("update",{kind:"root",name:"globalStyles",id:h}):null;h&&typeof z=="boolean"&&(z?g=p("root","globalStyles",h):g=d("root","globalStyles",h,{context:"view"}));let A=!1;return f("__experimentalGetCurrentGlobalStylesId")&&(h?A=z?f("getEditedEntityRecord",["root","globalStyles",h]):f("getEntityRecord",["root","globalStyles",h,{context:"view"}]):A=!0),{globalStylesId:h,isReady:A,settings:g?.settings,styles:g?.styles,_links:g?._links}},[]),{getEditedEntityRecord:s}=G(Me),{editEntityRecord:i}=Oe(Me),c=x.useMemo(()=>({settings:n??{},styles:o??{},_links:r??{}}),[n,o,r]),l=x.useCallback((u,d={})=>{var p,f,b;const h=s("root","globalStyles",e),g={styles:(p=h?.styles)!==null&&p!==void 0?p:{},settings:(f=h?.settings)!==null&&f!==void 0?f:{},_links:(b=h?._links)!==null&&b!==void 0?b:{}},z=typeof u=="function"?u(g):u;i("root","globalStyles",e,{styles:yT(z.styles)||{},settings:yT(z.settings)||{},_links:yT(z._links)||{}},d)},[e,i,s]);return[t,c,l]}function A$t(){const e=G(t=>t(Me).__experimentalGetCurrentThemeBaseGlobalStyles(),[]);return[!!e,e]}function PI(){const[e,t,n]=y$t(),[o,r]=A$t(),s=x.useMemo(()=>!r||!t?{}:ROe(r,t),[t,r]);return x.useMemo(()=>({isReady:e&&o,user:t,base:r,merged:s,setUserConfig:n}),[s,t,r,n,e,o])}function v$t({children:e}){const t=PI();return t.isReady?a.jsx(O$t.Provider,{value:t,children:e}):null}const Yte={};function x$t(e){const{RECEIVE_INTERMEDIATE_RESULTS:t}=St(H3e),{getEntityRecords:n}=e(Me);return n("postType","wp_block",{per_page:-1,[t]:!0})}const w$t=["__experimentalBlockDirectory","__experimentalDiscussionSettings","__experimentalFeatures","__experimentalGlobalStylesBaseStyles","alignWide","blockInspectorTabs","maxUploadFileSize","allowedMimeTypes","bodyPlaceholder","canLockBlocks","canUpdateBlockBindings","capabilities","clearBlockSelection","codeEditingEnabled","colors","disableCustomColors","disableCustomFontSizes","disableCustomSpacingSizes","disableCustomGradients","disableLayoutStyles","enableCustomLineHeight","enableCustomSpacing","enableCustomUnits","enableOpenverseMediaCategory","fontSizes","gradients","generateAnchors","onNavigateToEntityRecord","imageDefaultSize","imageDimensions","imageEditing","imageSizes","isPreviewMode","isRTL","locale","maxWidth","postContentAttributes","postsPerPage","readOnly","styles","titlePlaceholder","supportsLayout","widgetTypesToHideFromLegacyWidgetBlock","__unstableHasCustomAppender","__unstableResolvedAssets","__unstableIsBlockBasedTheme"],{globalStylesDataKey:_$t,globalStylesLinksDataKey:k$t,selectBlockPatternsKey:S$t,reusableBlocksSelectKey:C$t,sectionRootClientIdKey:q$t}=St(jn);function R$t(e,t,n,o){var r,s,i,c;const l=Yn("medium"),{allowRightClickOverrides:u,blockTypes:d,focusMode:p,hasFixedToolbar:f,isDistractionFree:b,keepCaretInsideBlock:h,hasUploadPermissions:g,hiddenBlockTypes:z,canUseUnfilteredHTML:A,userCanCreatePages:_,pageOnFront:v,pageForPosts:M,userPatternCategories:y,restBlockPatternCategories:k,sectionRootClientId:S}=G(V=>{var Q;const{canUser:te,getRawEntityRecord:ee,getEntityRecord:ue,getUserPatternCategories:ce,getBlockPatternCategories:me}=V(Me),{get:de}=V(ht),{getBlockTypes:Ae}=V(kt),{getBlocksByName:ye,getBlockAttributes:Ne}=V(J),je=te("read",{kind:"root",name:"site"})?ue("root","site"):void 0;function ie(){var we;if(o==="template-locked"){var re;return(re=ye("core/post-content")?.[0])!==null&&re!==void 0?re:""}return(we=ye("core/group").find(pe=>Ne(pe)?.tagName==="main"))!==null&&we!==void 0?we:""}return{allowRightClickOverrides:de("core","allowRightClickOverrides"),blockTypes:Ae(),canUseUnfilteredHTML:ee("postType",t,n)?._links?.hasOwnProperty("wp:action-unfiltered-html"),focusMode:de("core","focusMode"),hasFixedToolbar:de("core","fixedToolbar")||!l,hiddenBlockTypes:de("core","hiddenBlockTypes"),isDistractionFree:de("core","distractionFree"),keepCaretInsideBlock:de("core","keepCaretInsideBlock"),hasUploadPermissions:(Q=te("create",{kind:"root",name:"media"}))!==null&&Q!==void 0?Q:!0,userCanCreatePages:te("create",{kind:"postType",name:"page"}),pageOnFront:je?.page_on_front,pageForPosts:je?.page_for_posts,userPatternCategories:ce(),restBlockPatternCategories:me(),sectionRootClientId:ie()}},[t,n,l,o]),{merged:C}=PI(),R=(r=C.styles)!==null&&r!==void 0?r:Yte,T=(s=C._links)!==null&&s!==void 0?s:Yte,E=(i=e.__experimentalAdditionalBlockPatterns)!==null&&i!==void 0?i:e.__experimentalBlockPatterns,B=(c=e.__experimentalAdditionalBlockPatternCategories)!==null&&c!==void 0?c:e.__experimentalBlockPatternCategories,N=x.useMemo(()=>[...E||[]].filter(({postTypes:V})=>!V||Array.isArray(V)&&V.includes(t)),[E,t]),j=x.useMemo(()=>[...B||[],...k||[]].filter((V,Q,te)=>Q===te.findIndex(ee=>V.name===ee.name)),[B,k]),{undo:I,setIsInserterOpened:P}=Oe(_e),{saveEntityRecord:$}=Oe(Me),F=x.useCallback(V=>_?$("postType","page",V):Promise.reject({message:m("You do not have permission to create Pages.")}),[$,_]),X=x.useMemo(()=>z&&z.length>0?(e.allowedBlockTypes===!0?d.map(({name:Q})=>Q):e.allowedBlockTypes||[]).filter(Q=>!z.includes(Q)):e.allowedBlockTypes,[e.allowedBlockTypes,z,d]),Z=e.focusMode===!1;return x.useMemo(()=>({...Object.fromEntries(Object.entries(e).filter(([Q])=>w$t.includes(Q))),[_$t]:R,[k$t]:T,allowedBlockTypes:X,allowRightClickOverrides:u,focusMode:p&&!Z,hasFixedToolbar:f,isDistractionFree:b,keepCaretInsideBlock:h,mediaUpload:g?M$t:void 0,mediaSideload:g?z$t:void 0,__experimentalBlockPatterns:N,[S$t]:Q=>{const{hasFinishedResolution:te,getBlockPatternsForPostType:ee}=St(Q(Me)),ue=ee(t);return te("getBlockPatterns")?ue:void 0},[C$t]:x$t,__experimentalBlockPatternCategories:j,__experimentalUserPatternCategories:y,__experimentalFetchLinkSuggestions:(Q,te)=>hBe(Q,te,e),inserterMediaCategories:m$t,__experimentalFetchRichUrlData:gBe,__experimentalCanUserUseUnfilteredHTML:A,__experimentalUndo:I,outlineMode:!b&&t==="wp_template",__experimentalCreatePageEntity:F,__experimentalUserCanCreatePages:_,pageOnFront:v,pageForPosts:M,__experimentalPreferPatternsOnRoot:t==="wp_template",templateLock:t==="wp_navigation"?"insert":e.templateLock,template:t==="wp_navigation"?[["core/navigation",{},[]]]:e.template,__experimentalSetIsInserterOpened:P,[q$t]:S,editorTool:o==="post-only"&&t!=="wp_template"?"edit":void 0}),[X,u,p,Z,f,b,h,e,g,y,N,j,A,I,F,_,v,M,t,P,S,R,T,o])}const T$t=["core/post-title","core/post-featured-image","core/post-content"];function TOe(){const e=x.useMemo(()=>[...gr("editor.postContentBlockTypes",T$t)],[]);return G(n=>{const{getPostBlocksByName:o}=St(n(_e));return o(e)},[e])}function E$t(){const e=TOe(),{templateParts:t,isNavigationMode:n}=G(s=>{const{getBlocksByName:i,isNavigationMode:c}=s(J);return{templateParts:i("core/template-part"),isNavigationMode:c()}},[]),o=G(s=>{const{getBlockOrder:i}=s(J);return t.flatMap(c=>i(c))},[t]),r=Fn();return x.useEffect(()=>{const{setBlockEditingMode:s,unsetBlockEditingMode:i}=r.dispatch(J);return s("","disabled"),()=>{i("")}},[r]),x.useEffect(()=>{const{setBlockEditingMode:s,unsetBlockEditingMode:i}=r.dispatch(J);return r.batch(()=>{for(const c of e)s(c,"contentOnly")}),()=>{r.batch(()=>{for(const c of e)i(c)})}},[e,r]),x.useEffect(()=>{const{setBlockEditingMode:s,unsetBlockEditingMode:i}=r.dispatch(J);return r.batch(()=>{if(!n)for(const c of t)s(c,"contentOnly")}),()=>{r.batch(()=>{if(!n)for(const c of t)i(c)})}},[t,n,r]),x.useEffect(()=>{const{setBlockEditingMode:s,unsetBlockEditingMode:i}=r.dispatch(J);return r.batch(()=>{for(const c of o)s(c,"disabled")}),()=>{r.batch(()=>{for(const c of o)i(c)})}},[o,r]),null}function W$t(){const e=G(o=>o(J).getBlockOrder()?.[0],[]),{setBlockEditingMode:t,unsetBlockEditingMode:n}=Oe(J);x.useEffect(()=>{if(e)return t(e,"contentOnly"),()=>{n(e)}},[e,n,t])}const Zte=["wp_block","wp_template","wp_template_part"];function N$t(e,t){x.useEffect(()=>(Bn("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter",(n,o)=>!Zte.includes(e)&&o.name==="core/template-part"&&t==="post-only"?!1:n),Bn("blockEditor.__unstableCanInsertBlockType","removePostContentFromInserter",(n,o,r,{getBlockParentsByBlockName:s})=>!Zte.includes(e)&&o.name==="core/post-content"?s(r,"core/query").length>0:n),()=>{hE("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter"),hE("blockEditor.__unstableCanInsertBlockType","removePostContentFromInserter")}),[e,t])}function B$t(e={},t){switch(t.type){case"SET_IS_MATCHING":return t.values}return e}function L$t(e){return{type:"SET_IS_MATCHING",values:e}}const P$t=Object.freeze(Object.defineProperty({__proto__:null,setIsMatching:L$t},Symbol.toStringTag,{value:"Module"}));function j$t(e,t){return t.indexOf(" ")===-1&&(t=">= "+t),!!e[t]}const I$t=Object.freeze(Object.defineProperty({__proto__:null,isViewportMatch:j$t},Symbol.toStringTag,{value:"Module"})),D$t="core/viewport",Qx=w1(D$t,{reducer:B$t,actions:P$t,selectors:I$t});Us(Qx);const F$t=(e,t)=>{const n=F1(()=>{const s=Object.fromEntries(r.map(([i,c])=>[i,c.matches]));jr(Qx).setIsMatching(s)},0,{leading:!0}),o=Object.entries(t),r=Object.entries(e).flatMap(([s,i])=>o.map(([c,l])=>{const u=window.matchMedia(`(${l}: ${i}px)`);return u.addEventListener("change",n),[`${c} ${s}`,u]}));window.addEventListener("orientationchange",n),n(),n.flush()},$$t={huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480},V$t={"<":"max-width",">=":"min-width"};F$t($$t,V$t);const EOe=x.createContext({name:null,icon:null});EOe.Provider;function PO(){return x.useContext(EOe)}Hs((e,t)=>({icon:e,name:t}));function fp(e){return["core/edit-post","core/edit-site"].includes(e)?(Ke(`${e} interface scope`,{alternative:"core interface scope",hint:"core/edit-post and core/edit-site are merging.",version:"6.6"}),"core"):e}function jO(e,t){return e==="core"&&t==="edit-site/template"?(Ke("edit-site/template sidebar",{alternative:"edit-post/document",version:"6.6"}),"edit-post/document"):e==="core"&&t==="edit-site/block-inspector"?(Ke("edit-site/block-inspector sidebar",{alternative:"edit-post/block",version:"6.6"}),"edit-post/block"):t}const H$t=(e,t)=>(e=fp(e),t=jO(e,t),{type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e,area:t}),U$t=(e,t)=>({registry:n,dispatch:o})=>{if(!t)return;e=fp(e),t=jO(e,t),n.select(ht).get(e,"isComplementaryAreaVisible")||n.dispatch(ht).set(e,"isComplementaryAreaVisible",!0),o({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t})},X$t=e=>({registry:t})=>{e=fp(e),t.select(ht).get(e,"isComplementaryAreaVisible")&&t.dispatch(ht).set(e,"isComplementaryAreaVisible",!1)},G$t=(e,t)=>({registry:n})=>{if(!t)return;e=fp(e),t=jO(e,t);const o=n.select(ht).get(e,"pinnedItems");o?.[t]!==!0&&n.dispatch(ht).set(e,"pinnedItems",{...o,[t]:!0})},K$t=(e,t)=>({registry:n})=>{if(!t)return;e=fp(e),t=jO(e,t);const o=n.select(ht).get(e,"pinnedItems");n.dispatch(ht).set(e,"pinnedItems",{...o,[t]:!1})};function Y$t(e,t){return function({registry:n}){Ke("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),n.dispatch(ht).toggle(e,t)}}function Z$t(e,t,n){return function({registry:o}){Ke("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),o.dispatch(ht).set(e,t,!!n)}}function Q$t(e,t){return function({registry:n}){Ke("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),n.dispatch(ht).setDefaults(e,t)}}function J$t(e){return{type:"OPEN_MODAL",name:e}}function eVt(){return{type:"CLOSE_MODAL"}}const tVt=Object.freeze(Object.defineProperty({__proto__:null,closeModal:eVt,disableComplementaryArea:X$t,enableComplementaryArea:U$t,openModal:J$t,pinItem:G$t,setDefaultComplementaryArea:H$t,setFeatureDefaults:Q$t,setFeatureValue:Z$t,toggleFeature:Y$t,unpinItem:K$t},Symbol.toStringTag,{value:"Module"})),nVt=At(e=>(t,n)=>{n=fp(n);const o=e(ht).get(n,"isComplementaryAreaVisible");if(o!==void 0)return o===!1?null:t?.complementaryAreas?.[n]}),oVt=At(e=>(t,n)=>{n=fp(n);const o=e(ht).get(n,"isComplementaryAreaVisible"),r=t?.complementaryAreas?.[n];return o&&r===void 0}),rVt=At(e=>(t,n,o)=>{var r;return n=fp(n),o=jO(n,o),(r=e(ht).get(n,"pinnedItems")?.[o])!==null&&r!==void 0?r:!0}),sVt=At(e=>(t,n,o)=>(Ke("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(ht).get(n,o)));function iVt(e,t){return e.activeModal===t}const aVt=Object.freeze(Object.defineProperty({__proto__:null,getActiveComplementaryArea:nVt,isComplementaryAreaLoading:oVt,isFeatureActive:sVt,isItemPinned:rVt,isModalActive:iVt},Symbol.toStringTag,{value:"Module"}));function cVt(e={},t){switch(t.type){case"SET_DEFAULT_COMPLEMENTARY_AREA":{const{scope:n,area:o}=t;return e[n]?e:{...e,[n]:o}}case"ENABLE_COMPLEMENTARY_AREA":{const{scope:n,area:o}=t;return{...e,[n]:o}}}return e}function lVt(e=null,t){switch(t.type){case"OPEN_MODAL":return t.name;case"CLOSE_MODAL":return null}return e}const uVt=J0({complementaryAreas:cVt,activeModal:lVt}),dVt="core/interface",xo=w1(dVt,{reducer:uVt,actions:tVt,selectors:aVt});Us(xo);function pVt(e){return["checkbox","option","radio","switch","menuitemcheckbox","menuitemradio","treeitem"].includes(e)}function jI({as:e=Ce,scope:t,identifier:n,icon:o,selectedIcon:r,name:s,shortcut:i,...c}){const l=e,u=PO(),d=o||u.icon,p=n||`${u.name}/${s}`,f=G(g=>g(xo).getActiveComplementaryArea(t)===p,[p,t]),{enableComplementaryArea:b,disableComplementaryArea:h}=Oe(xo);return a.jsx(l,{icon:r&&f?r:d,"aria-controls":p.replace("/",":"),"aria-checked":pVt(c.role)?f:void 0,onClick:()=>{f?h(t):b(t,p)},shortcut:i,...c})}const fVt=({children:e,className:t,toggleButtonProps:n})=>{const o=a.jsx(jI,{icon:rp,...n});return a.jsxs("div",{className:oe("components-panel__header","interface-complementary-area-header",t),tabIndex:-1,children:[e,o]})},Qte=()=>{};function bVt({name:e,as:t=Cn,fillProps:n={},bubblesVirtually:o,...r}){return a.jsx(xf,{name:e,bubblesVirtually:o,fillProps:n,children:s=>{if(!x.Children.toArray(s).length)return null;const i=[];x.Children.forEach(s,({props:{__unstableExplicitMenuItem:l,__unstableTarget:u}})=>{u&&l&&i.push(u)});const c=x.Children.map(s,l=>!l.props.__unstableExplicitMenuItem&&i.includes(l.props.__unstableTarget)?null:l);return a.jsx(t,{...r,children:c})}})}function IO({name:e,as:t=Ce,onClick:n,...o}){return a.jsx(um,{name:e,children:({onClick:r})=>a.jsx(t,{onClick:n||r?(...s)=>{(n||Qte)(...s),(r||Qte)(...s)}:void 0,...o})})}IO.Slot=bVt;const hVt=({__unstableExplicitMenuItem:e,__unstableTarget:t,...n})=>a.jsx(Ct,{...n});function WOe({scope:e,target:t,__unstableExplicitMenuItem:n,...o}){return a.jsx(jI,{as:r=>a.jsx(IO,{__unstableExplicitMenuItem:n,__unstableTarget:`${e}/${t}`,as:hVt,name:`${e}/plugin-more-menu`,...r}),role:"menuitemcheckbox",selectedIcon:M0,name:t,scope:e,...o})}function rk({scope:e,...t}){return a.jsx(um,{name:`PinnedItems/${e}`,...t})}function mVt({scope:e,className:t,...n}){return a.jsx(xf,{name:`PinnedItems/${e}`,...n,children:o=>o?.length>0&&a.jsx("div",{className:oe(t,"interface-pinned-items"),children:o})})}rk.Slot=mVt;const gVt=.3;function MVt({scope:e,...t}){return a.jsx(xf,{name:`ComplementaryArea/${e}`,...t})}const NOe=280,zVt={open:{width:NOe},closed:{width:0},mobileOpen:{width:"100vw"}};function OVt({activeArea:e,isActive:t,scope:n,children:o,className:r,id:s}){const i=$1(),c=Yn("medium","<"),l=Fr(e),u=Fr(t),[,d]=x.useState({});x.useEffect(()=>{d({})},[t]);const p={type:"tween",duration:i||c||l&&e&&e!==l?0:gVt,ease:[.6,0,.4,1]};return a.jsx(um,{name:`ComplementaryArea/${n}`,children:a.jsx(Wd,{initial:!1,children:(u||t)&&a.jsx(qr.div,{variants:zVt,initial:"closed",animate:c?"mobileOpen":"open",exit:"closed",transition:p,className:"interface-complementary-area__fill",children:a.jsx("div",{id:s,className:r,style:{width:c?"100vw":NOe},children:o})})})})}function yVt(e,t,n,o,r){const s=x.useRef(!1),i=x.useRef(!1),{enableComplementaryArea:c,disableComplementaryArea:l}=Oe(xo);x.useEffect(()=>{o&&r&&!s.current?(l(e),i.current=!0):i.current&&!r&&s.current?(i.current=!1,c(e,t)):i.current&&n&&n!==t&&(i.current=!1),r!==s.current&&(s.current=r)},[o,r,e,t,n,l,c])}function sk({children:e,className:t,closeLabel:n=m("Close plugin"),identifier:o,header:r,headerClassName:s,icon:i,isPinnable:c=!0,panelClassName:l,scope:u,name:d,title:p,toggleShortcut:f,isActiveByDefault:b}){const h=PO(),g=i||h.icon,z=o||`${h.name}/${d}`,[A,_]=x.useState(!1),{isLoading:v,isActive:M,isPinned:y,activeArea:k,isSmall:S,isLarge:C,showIconLabels:R}=G(I=>{const{getActiveComplementaryArea:P,isComplementaryAreaLoading:$,isItemPinned:F}=I(xo),{get:X}=I(ht),Z=P(u);return{isLoading:$(u),isActive:Z===z,isPinned:F(u,z),activeArea:Z,isSmall:I(Qx).isViewportMatch("< medium"),isLarge:I(Qx).isViewportMatch("large"),showIconLabels:X("core","showIconLabels")}},[z,u]),T=Yn("medium","<");yVt(u,z,k,M,S);const{enableComplementaryArea:E,disableComplementaryArea:B,pinItem:N,unpinItem:j}=Oe(xo);if(x.useEffect(()=>{b&&k===void 0&&!S?E(u,z):k===void 0&&S&&B(u,z),_(!0)},[k,b,u,z,S,E,B]),!!A)return a.jsxs(a.Fragment,{children:[c&&a.jsx(rk,{scope:u,children:y&&a.jsx(jI,{scope:u,identifier:z,isPressed:M&&(!R||C),"aria-expanded":M,"aria-disabled":v,label:p,icon:R?M0:g,showTooltip:!R,variant:R?"tertiary":void 0,size:"compact",shortcut:f})}),d&&c&&a.jsx(WOe,{target:d,scope:u,icon:g,children:p}),a.jsxs(OVt,{activeArea:k,isActive:M,className:oe("interface-complementary-area",t),scope:u,id:z.replace("/",":"),children:[a.jsx(fVt,{className:s,closeLabel:n,onClose:()=>B(u),toggleButtonProps:{label:n,size:"compact",shortcut:f,scope:u,identifier:z},children:r||a.jsxs(a.Fragment,{children:[a.jsx("h2",{className:"interface-complementary-area-header__title",children:p}),c&&!T&&a.jsx(Ce,{className:"interface-complementary-area__pin-unpin-item",icon:y?DQe:IQe,label:m(y?"Unpin from toolbar":"Pin to toolbar"),onClick:()=>(y?j:N)(u,z),isPressed:y,"aria-expanded":y,size:"compact"})]})}),a.jsx(s2t,{className:l,children:e})]})]})}sk.Slot=MVt;const AVt=({isActive:e})=>(x.useEffect(()=>{let t=!1;return document.body.classList.contains("sticky-menu")&&(t=!0,document.body.classList.remove("sticky-menu")),()=>{t&&document.body.classList.add("sticky-menu")}},[]),x.useEffect(()=>(e?document.body.classList.add("is-fullscreen-mode"):document.body.classList.remove("is-fullscreen-mode"),()=>{e&&document.body.classList.remove("is-fullscreen-mode")}),[e]),null),$u=x.forwardRef(({children:e,className:t,ariaLabel:n,as:o="div",...r},s)=>a.jsx(o,{ref:s,className:oe("interface-navigable-region",t),"aria-label":n,role:"region",tabIndex:"-1",...r,children:e}));$u.displayName="NavigableRegion";const BOe=.25,Jte={type:"tween",duration:BOe,ease:[.6,0,.4,1]};function vVt(e){x.useEffect(()=>{const t=document&&document.querySelector(`html:not(.${e})`);if(t)return t.classList.toggle(e),()=>{t.classList.toggle(e)}},[e])}const xVt={hidden:{opacity:1,marginTop:-60},visible:{opacity:1,marginTop:0},distractionFreeHover:{opacity:1,marginTop:0,transition:{...Jte,delay:.2,delayChildren:.2}},distractionFreeHidden:{opacity:0,marginTop:-60},distractionFreeDisabled:{opacity:0,marginTop:0,transition:{...Jte,delay:.8,delayChildren:.8}}};function wVt({isDistractionFree:e,footer:t,header:n,editorNotices:o,sidebar:r,secondarySidebar:s,content:i,actions:c,labels:l,className:u},d){const[p,f]=js(),b=Yn("medium","<"),g={type:"tween",duration:$1()?0:BOe,ease:[.6,0,.4,1]};vVt("interface-interface-skeleton__html-container");const A={...{header:We("Header","header landmark area"),body:m("Content"),secondarySidebar:m("Block Library"),sidebar:We("Settings","settings landmark area"),actions:m("Publish"),footer:m("Footer")},...l};return a.jsxs("div",{ref:d,className:oe(u,"interface-interface-skeleton",!!t&&"has-footer"),children:[a.jsxs("div",{className:"interface-interface-skeleton__editor",children:[a.jsx(Wd,{initial:!1,children:!!n&&a.jsx($u,{as:qr.div,className:"interface-interface-skeleton__header","aria-label":A.header,initial:e&&!b?"distractionFreeHidden":"hidden",whileHover:e&&!b?"distractionFreeHover":"visible",animate:e&&!b?"distractionFreeDisabled":"visible",exit:e&&!b?"distractionFreeHidden":"hidden",variants:xVt,transition:g,children:n})}),e&&a.jsx("div",{className:"interface-interface-skeleton__header",children:o}),a.jsxs("div",{className:"interface-interface-skeleton__body",children:[a.jsx(Wd,{initial:!1,children:!!s&&a.jsx($u,{className:"interface-interface-skeleton__secondary-sidebar",ariaLabel:A.secondarySidebar,as:qr.div,initial:"closed",animate:"open",exit:"closed",variants:{open:{width:f.width},closed:{width:0}},transition:g,children:a.jsxs(qr.div,{style:{position:"absolute",width:b?"100vw":"fit-content",height:"100%",left:0},variants:{open:{x:0},closed:{x:"-100%"}},transition:g,children:[p,s]})})}),a.jsx($u,{className:"interface-interface-skeleton__content",ariaLabel:A.body,children:i}),!!r&&a.jsx($u,{className:"interface-interface-skeleton__sidebar",ariaLabel:A.sidebar,children:r}),!!c&&a.jsx($u,{className:"interface-interface-skeleton__actions",ariaLabel:A.actions,children:c})]})]}),!!t&&a.jsx($u,{className:"interface-interface-skeleton__footer",ariaLabel:A.footer,children:t})]})}const LOe=x.forwardRef(wVt),_Vt=Object.freeze(Object.defineProperty({__proto__:null,ActionItem:IO,ComplementaryArea:sk,ComplementaryAreaMoreMenuItem:WOe,FullscreenMode:AVt,InterfaceSkeleton:LOe,NavigableRegion:$u,PinnedItems:rk,store:xo},Symbol.toStringTag,{value:"Module"})),{RenamePatternModal:kVt}=St(Vi),POe="editor/pattern-rename";function SVt(){const{record:e,postType:t}=G(r=>{const{getCurrentPostType:s,getCurrentPostId:i}=r(_e),{getEditedEntityRecord:c}=r(Me),l=s();return{record:c("postType",l,i()),postType:l}},[]),{closeModal:n}=Oe(xo);return!G(r=>r(xo).isModalActive(POe))||t!==$l?null:a.jsx(kVt,{onClose:n,pattern:e})}const{DuplicatePatternModal:CVt}=St(Vi),jOe="editor/pattern-duplicate";function qVt(){const{record:e,postType:t}=G(r=>{const{getCurrentPostType:s,getCurrentPostId:i}=r(_e),{getEditedEntityRecord:c}=r(Me),l=s();return{record:c("postType",l,i()),postType:l}},[]),{closeModal:n}=Oe(xo);return!G(r=>r(xo).isModalActive(jOe))||t!==$l?null:a.jsx(CVt,{onClose:n,onSuccess:()=>n(),pattern:e})}const RVt=()=>function(){const{editorMode:t,isListViewOpen:n,showBlockBreadcrumbs:o,isDistractionFree:r,isFocusMode:s,isPreviewMode:i,isViewable:c,isCodeEditingEnabled:l,isRichEditingEnabled:u,isPublishSidebarEnabled:d}=G(B=>{var N,j;const{get:I}=B(ht),{isListViewOpened:P,getCurrentPostType:$,getEditorSettings:F}=B(_e),{getSettings:X}=B(J),{getPostType:Z}=B(Me);return{editorMode:(N=I("core","editorMode"))!==null&&N!==void 0?N:"visual",isListViewOpen:P(),showBlockBreadcrumbs:I("core","showBlockBreadcrumbs"),isDistractionFree:I("core","distractionFree"),isFocusMode:I("core","focusMode"),isPreviewMode:X().isPreviewMode,isViewable:(j=Z($())?.viewable)!==null&&j!==void 0?j:!1,isCodeEditingEnabled:F().codeEditingEnabled,isRichEditingEnabled:F().richEditingEnabled,isPublishSidebarEnabled:B(_e).isPublishSidebarEnabled()}},[]),{getActiveComplementaryArea:p}=G(xo),{toggle:f}=Oe(ht),{createInfoNotice:b}=Oe(mt),{__unstableSaveForPreview:h,setIsListViewOpened:g,switchEditorMode:z,toggleDistractionFree:A,toggleSpotlightMode:_,toggleTopToolbar:v}=Oe(_e),{openModal:M,enableComplementaryArea:y,disableComplementaryArea:k}=Oe(xo),{getCurrentPostId:S}=G(_e),{isBlockBasedTheme:C,canCreateTemplate:R}=G(B=>({isBlockBasedTheme:B(Me).getCurrentTheme()?.is_block_theme,canCreateTemplate:B(Me).canUser("create",{kind:"postType",name:"wp_template"})}),[]),T=l&&u;if(i)return{commands:[],isLoading:!1};const E=[];return E.push({name:"core/open-shortcut-help",label:m("Keyboard shortcuts"),icon:lQe,callback:({close:B})=>{B(),M("editor/keyboard-shortcut-help")}}),E.push({name:"core/toggle-distraction-free",label:m(r?"Exit Distraction free":"Enter Distraction free"),callback:({close:B})=>{A(),B()}}),E.push({name:"core/open-preferences",label:m("Editor preferences"),callback:({close:B})=>{B(),M("editor/preferences")}}),E.push({name:"core/toggle-spotlight-mode",label:m(s?"Exit Spotlight mode":"Enter Spotlight mode"),callback:({close:B})=>{_(),B()}}),E.push({name:"core/toggle-list-view",label:m(n?"Close List View":"Open List View"),icon:LP,callback:({close:B})=>{g(!n),B(),b(m(n?"List View off.":"List View on."),{id:"core/editor/toggle-list-view/notice",type:"snackbar"})}}),E.push({name:"core/toggle-top-toolbar",label:m("Top toolbar"),callback:({close:B})=>{v(),B()}}),T&&E.push({name:"core/toggle-code-editor",label:m(t==="visual"?"Open code editor":"Exit code editor"),icon:qP,callback:({close:B})=>{z(t==="visual"?"text":"visual"),B()}}),E.push({name:"core/toggle-breadcrumbs",label:m(o?"Hide block breadcrumbs":"Show block breadcrumbs"),callback:({close:B})=>{f("core","showBlockBreadcrumbs"),B(),b(m(o?"Breadcrumbs hidden.":"Breadcrumbs visible."),{id:"core/editor/toggle-breadcrumbs/notice",type:"snackbar"})}}),E.push({name:"core/open-settings-sidebar",label:m("Show or hide the Settings panel."),icon:jt()?ede:tde,callback:({close:B})=>{const N=p("core");B(),N==="edit-post/document"?k("core"):y("core","edit-post/document")}}),E.push({name:"core/open-block-inspector",label:m("Show or hide the Block settings panel"),icon:Cw,callback:({close:B})=>{const N=p("core");B(),N==="edit-post/block"?k("core"):y("core","edit-post/block")}}),E.push({name:"core/toggle-publish-sidebar",label:m(d?"Disable pre-publish checks":"Enable pre-publish checks"),icon:nde,callback:({close:B})=>{B(),f("core","isPublishSidebarEnabled"),b(m(d?"Pre-publish checks disabled.":"Pre-publish checks enabled."),{id:"core/editor/publish-sidebar/notice",type:"snackbar"})}}),c&&E.push({name:"core/preview-link",label:m("Preview in a new tab"),icon:vf,callback:async({close:B})=>{B();const N=S(),j=await h();window.open(j,`wp-preview-${N}`)}}),R&&C&&(Aa(window.location.href)?.includes("site-editor.php")||E.push({name:"core/go-to-site-editor",label:m("Open Site Editor"),callback:({close:N})=>{N(),document.location="site-editor.php"}})),{commands:E,isLoading:!1}},TVt=()=>function(){const{postType:t}=G(r=>{const{getCurrentPostType:s}=r(_e);return{postType:s()}},[]),{openModal:n}=Oe(xo),o=[];return t===$l&&(o.push({name:"core/rename-pattern",label:m("Rename pattern"),icon:Nd,callback:({close:r})=>{n(POe),r()}}),o.push({name:"core/duplicate-pattern",label:m("Duplicate pattern"),icon:Bd,callback:({close:r})=>{n(jOe),r()}})),{isLoading:!1,commands:o}},EVt=()=>function(){const{onNavigateToEntityRecord:t,goBack:n,templateId:o,isPreviewMode:r}=G(l=>{const{getRenderingMode:u,getEditorSettings:d,getCurrentTemplateId:p}=St(l(_e)),f=d();return{isTemplateHidden:u()==="post-only",onNavigateToEntityRecord:f.onNavigateToEntityRecord,getEditorSettings:d,goBack:f.onNavigateToPreviousEntityRecord,templateId:p(),isPreviewMode:f.isPreviewMode}},[]),{editedRecord:s,hasResolved:i}=X5("postType","wp_template",o);if(r)return{isLoading:!1,commands:[]};const c=[];return o&&i&&c.push({name:"core/switch-to-template-focus",label:xe(m("Edit template: %s"),Lt(s.title)),icon:nu,callback:({close:l})=>{t({postId:o,postType:"wp_template"}),l()}}),n&&c.push({name:"core/switch-to-previous-entity",label:m("Go back"),icon:wa,callback:({close:l})=>{n(),l()}}),{isLoading:!1,commands:c}},WVt=()=>function(){const{postType:t,postId:n}=G(c=>{const{getCurrentPostId:l,getCurrentPostType:u}=c(_e);return{postType:u(),postId:l()}},[]),{editedRecord:o,hasResolved:r}=X5("postType",t,n),{revertTemplate:s}=St(Oe(_e));if(!r||![Di,L0].includes(t))return{isLoading:!0,commands:[]};const i=[];if(iOe(o)){const c=o.type===L0?xe(m("Reset template: %s"),Lt(o.title)):xe(m("Reset template part: %s"),Lt(o.title));i.push({name:"core/reset-template",label:c,icon:jt()?Ede:BQe,callback:({close:l})=>{s(o),l()}})}return{isLoading:!r,commands:i}};function NVt(){xi({name:"core/editor/edit-ui",hook:RVt()}),xi({name:"core/editor/contextual-commands",hook:TVt(),context:"entity-edit"}),xi({name:"core/editor/page-content-focus",hook:EVt(),context:"entity-edit"}),xi({name:"core/edit-site/manipulate-document",hook:WVt()})}const{BlockRemovalWarningModal:ene}=St(jn),BVt=["core/post-content","core/post-template","core/query"],LVt=[{postTypes:["wp_template","wp_template_part"],callback(e){if(e.filter(({name:n})=>BVt.includes(n)).length)return Dn("Deleting this block will stop your post or page content from displaying on this template. It is not recommended.","Some of the deleted blocks will stop your post or page content from displaying on this template. It is not recommended.",e.length)}},{postTypes:["wp_block"],callback(e){if(e.filter(({attributes:n})=>n?.metadata?.bindings&&Object.values(n.metadata.bindings).some(o=>o.source==="core/pattern-overrides")).length)return Dn("The deleted block allows instance overrides. Removing it may result in content not displaying where this pattern is used. Are you sure you want to proceed?","Some of the deleted blocks allow instance overrides. Removing them may result in content not displaying where this pattern is used. Are you sure you want to proceed?",e.length)}}];function PVt(){const e=G(n=>n(_e).getCurrentPostType(),[]),t=x.useMemo(()=>LVt.filter(n=>n.postTypes.includes(e)),[e]);return!ene||!t?null:a.jsx(ene,{rules:t})}function jVt(){const{postId:e,shouldEnable:t}=G(o=>{const{isEditedPostDirty:r,isEditedPostEmpty:s,getCurrentPostId:i,getCurrentPostType:c}=o(_e),l=o(xo).isModalActive("editor/preferences"),u=o(ht).get("core","enableChoosePatternModal");return{postId:i(),shouldEnable:u&&!l&&!r()&&s()&&c()==="page"}},[]),{setIsInserterOpened:n}=Oe(_e);return x.useEffect(()=>{t&&n({tab:"patterns",category:"core/starter-content"})},[e,t,n]),null}const IVt=[{keyCombination:{modifier:"primary",character:"b"},description:m("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:m("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:m("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:m("Remove a link.")},{keyCombination:{character:"[["},description:m("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:m("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:m("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:m("Make the selected text inline code.")},{keyCombination:{modifier:"access",character:"0"},aliases:[{modifier:"access",character:"7"}],description:m("Convert the current heading to a paragraph.")},{keyCombination:{modifier:"access",character:"1-6"},description:m("Convert the current paragraph or heading to a heading of level 1 to 6.")},{keyCombination:{modifier:"primaryShift",character:"SPACE"},description:m("Add non breaking space.")}];function tne({keyCombination:e,forceAriaLabel:t}){const n=e.modifier?u0e[e.modifier](e.character):e.character,o=e.modifier?d0e[e.modifier](e.character):e.character;return a.jsx("kbd",{className:"editor-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":t||o,children:(Array.isArray(n)?n:[n]).map((r,s)=>r==="+"?a.jsx(x.Fragment,{children:r},s):a.jsx("kbd",{className:"editor-keyboard-shortcut-help-modal__shortcut-key",children:r},s))})}function IOe({description:e,keyCombination:t,aliases:n=[],ariaLabel:o}){return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"editor-keyboard-shortcut-help-modal__shortcut-description",children:e}),a.jsxs("div",{className:"editor-keyboard-shortcut-help-modal__shortcut-term",children:[a.jsx(tne,{keyCombination:t,forceAriaLabel:o}),n.map((r,s)=>a.jsx(tne,{keyCombination:r,forceAriaLabel:o},s))]})]})}function DVt({name:e}){const{keyCombination:t,description:n,aliases:o}=G(r=>{const{getShortcutKeyCombination:s,getShortcutDescription:i,getShortcutAliases:c}=r(Pi);return{keyCombination:s(e),aliases:c(e),description:i(e)}},[e]);return t?a.jsx(IOe,{keyCombination:t,description:n,aliases:o}):null}const nne="editor/keyboard-shortcut-help",FVt=({shortcuts:e})=>a.jsx("ul",{className:"editor-keyboard-shortcut-help-modal__shortcut-list",role:"list",children:e.map((t,n)=>a.jsx("li",{className:"editor-keyboard-shortcut-help-modal__shortcut",children:typeof t=="string"?a.jsx(DVt,{name:t}):a.jsx(IOe,{...t})},n))}),nN=({title:e,shortcuts:t,className:n})=>a.jsxs("section",{className:oe("editor-keyboard-shortcut-help-modal__section",n),children:[!!e&&a.jsx("h2",{className:"editor-keyboard-shortcut-help-modal__section-title",children:e}),a.jsx(FVt,{shortcuts:t})]}),vv=({title:e,categoryName:t,additionalShortcuts:n=[]})=>{const o=G(r=>r(Pi).getCategoryShortcuts(t),[t]);return a.jsx(nN,{title:e,shortcuts:o.concat(n)})};function $Vt(){const e=G(r=>r(xo).isModalActive(nne),[]),{openModal:t,closeModal:n}=Oe(xo),o=()=>{e?n():t(nne)};return p0("core/editor/keyboard-shortcuts",o),e?a.jsxs(Zo,{className:"editor-keyboard-shortcut-help-modal",title:m("Keyboard shortcuts"),closeButtonLabel:m("Close"),onRequestClose:o,children:[a.jsx(nN,{className:"editor-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/editor/keyboard-shortcuts"]}),a.jsx(vv,{title:m("Global shortcuts"),categoryName:"global"}),a.jsx(vv,{title:m("Selection shortcuts"),categoryName:"selection"}),a.jsx(vv,{title:m("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:m("Change the block type after adding a new paragraph."),ariaLabel:m("Forward-slash")}]}),a.jsx(nN,{title:m("Text formatting"),shortcuts:IVt}),a.jsx(vv,{title:m("List View shortcuts"),categoryName:"list-view"})]}):null}function VVt({clientId:e,onClose:t}){const n=TOe(),{entity:o,onNavigateToEntityRecord:r,canEditTemplates:s}=G(l=>{const{getBlockParentsByBlockName:u,getSettings:d,getBlockAttributes:p,getBlockParents:f}=l(J),{getCurrentTemplateId:b,getRenderingMode:h}=l(_e),g=u(e,"core/block",!0)[0];let z;return g?z=l(Me).getEntityRecord("postType","wp_block",p(g).ref):h()==="template-locked"&&!f(e).some(_=>n.includes(_))&&(z=l(Me).getEntityRecord("postType","wp_template",b())),z?{canEditTemplates:l(Me).canUser("create",{kind:"postType",name:"wp_template"}),entity:z,onNavigateToEntityRecord:d().onNavigateToEntityRecord}:{}},[e,n]);if(!o)return a.jsx(HVt,{clientId:e,onClose:t});const i=o.type==="wp_block";let c=m(i?"Edit the pattern to move, delete, or make further changes to this block.":"Edit the template to move, delete, or make further changes to this block.");return s||(c=m("Only users with permissions to edit the template can move or delete this block")),a.jsxs(a.Fragment,{children:[a.jsx(F_,{children:a.jsx(Ct,{onClick:()=>{r({postId:o.id,postType:o.type})},disabled:!s,children:m(i?"Edit pattern":"Edit template")})}),a.jsx(Sn,{variant:"muted",as:"p",className:"editor-content-only-settings-menu__description",children:c})]})}function HVt({clientId:e,onClose:t}){const{contentLockingParent:n}=G(i=>{const{getContentLockingParent:c}=St(i(J));return{contentLockingParent:c(e)}},[e]),o=ji(n),r=Oe(J);if(!o?.title)return null;const{modifyContentLockBlock:s}=St(r);return a.jsxs(a.Fragment,{children:[a.jsx(F_,{children:a.jsx(Ct,{onClick:()=>{s(n),t()},children:We("Unlock","Unlock content locked blocks")})}),a.jsx(Sn,{variant:"muted",as:"p",className:"editor-content-only-settings-menu__description",children:m("Temporarily unlock the parent block to edit, delete or make further changes to this block.")})]})}function UVt(){return a.jsx(cb,{children:({selectedClientIds:e,onClose:t})=>e.length===1&&a.jsx(VVt,{clientId:e[0],onClose:t})})}function XVt(e,t=!1){return G(n=>{const{getEntityRecord:o,getDefaultTemplateId:r}=n(Me),s=r({slug:e,is_custom:t,ignore_empty:!0});return s?o("postType",L0,s)?.content?.raw:void 0},[e,t])}function GVt(e){const{slug:t,patterns:n}=G(s=>{const{getCurrentPostType:i,getCurrentPostId:c}=s(_e),{getEntityRecord:l,getBlockPatterns:u}=s(Me),d=c(),p=i();return{slug:l("postType",p,d).slug,patterns:u()}},[]),o=G(s=>s(Me).getCurrentTheme().stylesheet);function r(s){return s.innerBlocks.find(i=>i.name==="core/template-part")&&(s.innerBlocks=s.innerBlocks.map(i=>(i.name==="core/template-part"&&i.attributes.theme===void 0&&(i.attributes.theme=o),i))),s.name==="core/template-part"&&s.attributes.theme===void 0&&(s.attributes.theme=o),s}return x.useMemo(()=>[{name:"fallback",blocks:Ko(e),title:m("Fallback content")},...n.filter(s=>Array.isArray(s.templateTypes)&&s.templateTypes.some(i=>t.startsWith(i))).map(s=>({...s,blocks:Ko(s.content).map(i=>r(i))}))],[e,t,n])}function KVt({fallbackContent:e,onChoosePattern:t,postType:n}){const[,,o]=ya("postType",n),r=GVt(e);return a.jsx(qa,{blockPatterns:r,onClickPattern:(s,i)=>{o(i,{selection:void 0}),t()}})}function YVt({slug:e,isCustom:t,onClose:n,postType:o}){const r=XVt(e,t);return r?a.jsxs(Zo,{className:"editor-start-template-options__modal",title:m("Choose a pattern"),closeLabel:m("Cancel"),focusOnMount:"firstElement",onRequestClose:n,isFullScreen:!0,children:[a.jsx("div",{className:"editor-start-template-options__modal-content",children:a.jsx(KVt,{fallbackContent:r,slug:e,isCustom:t,postType:o,onChoosePattern:()=>{n()}})}),a.jsx(Yo,{className:"editor-start-template-options__modal__actions",justify:"flex-end",expanded:!1,children:a.jsx(Tn,{children:a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:n,children:m("Skip")})})})]}):null}function ZVt(){const[e,t]=x.useState(!1),{shouldOpenModal:n,slug:o,isCustom:r,postType:s,postId:i}=G(c=>{const{getCurrentPostType:l,getCurrentPostId:u}=c(_e),d=l(),p=u(),{getEditedEntityRecord:f,hasEditsForEntityRecord:b}=c(Me),h=f("postType",d,p);return{shouldOpenModal:!b("postType",d,p)&&h.content===""&&L0===d,slug:h.slug,isCustom:h.is_custom,postType:d,postId:p}},[]);return x.useEffect(()=>{t(!1)},[s,i]),!n||e?null:a.jsx(YVt,{slug:o,isCustom:r,postType:s,onClose:()=>t(!0)})}function QVt(){const e=G(g=>{const{richEditingEnabled:z,codeEditingEnabled:A}=g(_e).getEditorSettings();return!z||!A},[]),{getBlockSelectionStart:t}=G(J),{getActiveComplementaryArea:n}=G(xo),{enableComplementaryArea:o,disableComplementaryArea:r}=Oe(xo),{redo:s,undo:i,savePost:c,setIsListViewOpened:l,switchEditorMode:u,toggleDistractionFree:d}=Oe(_e),{isEditedPostDirty:p,isPostSavingLocked:f,isListViewOpened:b,getEditorMode:h}=G(_e);return p0("core/editor/toggle-mode",()=>{u(h()==="visual"?"text":"visual")},{isDisabled:e}),p0("core/editor/toggle-distraction-free",()=>{d()}),p0("core/editor/undo",g=>{i(),g.preventDefault()}),p0("core/editor/redo",g=>{s(),g.preventDefault()}),p0("core/editor/save",g=>{g.preventDefault(),!f()&&p()&&c()}),p0("core/editor/toggle-list-view",g=>{b()||(g.preventDefault(),l(!0))}),p0("core/editor/toggle-sidebar",g=>{if(g.preventDefault(),["edit-post/document","edit-post/block"].includes(n("core")))r("core");else{const A=t()?"edit-post/block":"edit-post/document";o("core",A)}}),null}function JVt({clientId:e,onClose:t}){const{getBlocks:n}=G(J),{replaceBlocks:o}=Oe(J);return G(s=>s(J).canRemoveBlock(e),[e])?a.jsx(Ct,{onClick:()=>{o(e,n(e)),t()},children:m("Detach")}):null}function eHt({clientIds:e,blocks:t}){const[n,o]=x.useState(!1),{replaceBlocks:r}=Oe(J),{createSuccessNotice:s}=Oe(mt),{canCreate:i}=G(l=>({canCreate:l(J).canInsertBlockType("core/template-part")}),[]);if(!i)return null;const c=async l=>{r(e,Ee("core/template-part",{slug:l.slug,theme:l.theme})),s(m("Template part created."),{type:"snackbar"})};return a.jsxs(a.Fragment,{children:[a.jsx(Ct,{icon:Qf,onClick:()=>{o(!0)},"aria-expanded":n,"aria-haspopup":"dialog",children:m("Create template part")}),n&&a.jsx(LI,{closeModal:()=>{o(!1)},blocks:t,onCreate:c})]})}function tHt(){return a.jsx(cb,{children:({selectedClientIds:e,onClose:t})=>a.jsx(nHt,{clientIds:e,onClose:t})})}function nHt({clientIds:e,onClose:t}){const{blocks:n}=G(o=>{const{getBlocksByClientId:r}=o(J);return{blocks:r(e)}},[e]);return n.length===1&&n[0]?.name==="core/template-part"?a.jsx(JVt,{clientId:e[0],onClose:t}):a.jsx(eHt,{clientIds:e,blocks:n})}const{ExperimentalBlockEditorProvider:oHt}=St(jn),{PatternsMenuItems:rHt}=St(Vi),one=()=>{},sHt=["wp_block","wp_navigation","wp_template_part"],iHt=["post-only","template-locked"];function aHt(e,t,n){const o=n==="template-locked"?"template":"post",[r,s,i]=ya("postType",e.type,{id:e.id}),[c,l,u]=ya("postType",t?.type,{id:t?.id}),d=x.useMemo(()=>{if(e.type==="wp_navigation")return[Ee("core/navigation",{ref:e.id,templateLock:!1})]},[e.type,e.id]),p=x.useMemo(()=>d||(o==="template"?c:r),[d,o,c,r]);return!!t&&n==="template-locked"||e.type==="wp_navigation"?[p,one,one]:[p,o==="post"?s:l,o==="post"?i:u]}const DOe=f$t(({post:e,settings:t,recovery:n,initialEdits:o,children:r,BlockEditorProviderComponent:s=oHt,__unstableTemplate:i})=>{const c=!!i,{editorSettings:l,selection:u,isReady:d,mode:p,defaultMode:f,postTypeEntities:b}=G(j=>{const{getEditorSettings:I,getEditorSelection:P,getRenderingMode:$,__unstableIsEditorReady:F}=j(_e),{getEntitiesConfig:X,getPostType:Z,hasFinishedResolution:V}=j(Me),Q=Z(e.type)?.supports,te=V("getPostType",[e.type]),ee=Array.isArray(Q?.editor)?Q.editor.find(ce=>"default_mode"in ce)?.default_mode:void 0,ue=iHt.includes(ee);return{editorSettings:I(),isReady:F()&&te,mode:$(),defaultMode:c&&ue?ee:"post-only",selection:P(),postTypeEntities:e.type==="wp_template"?X("postType"):null}},[e.type,c]),h=!!i&&p!=="post-only",g=h?i:e,z=x.useMemo(()=>{const j={};if(e.type==="wp_template"){if(e.slug==="page")j.postType="page";else if(e.slug==="single")j.postType="post";else if(e.slug.split("-")[0]==="single"){const I=b?.map($=>$.name)||[],P=e.slug.match(`^single-(${I.join("|")})(?:-.+)?$`);P&&(j.postType=P[1])}}else(!sHt.includes(g.type)||h)&&(j.postId=e.id,j.postType=e.type);return{...j,templateSlug:g.type==="wp_template"?g.slug:void 0}},[h,e.id,e.type,e.slug,g.type,g.slug,b]),{id:A,type:_}=g,v=R$t(l,_,A,p),[M,y,k]=aHt(e,i,p),{updatePostLock:S,setupEditor:C,updateEditorSettings:R,setCurrentTemplateId:T,setEditedPost:E,setRenderingMode:B}=St(Oe(_e)),{createWarningNotice:N}=Oe(mt);return x.useLayoutEffect(()=>{n||(S(t.postLock),C(e,o,t.template),t.autosave&&N(m("There is an autosave of this post that is more recent than the version below."),{id:"autosave-exists",actions:[{label:m("View the autosave"),url:t.autosave.editLink}]}))},[]),x.useEffect(()=>{E(e.type,e.id)},[e.type,e.id,E]),x.useEffect(()=>{R(t)},[t,R]),x.useEffect(()=>{T(i?.id)},[i?.id,T]),x.useEffect(()=>{B(f)},[f,B]),N$t(e.type,p),NVt(),!d||!p?null:a.jsx(HE,{kind:"root",type:"site",children:a.jsx(HE,{kind:"postType",type:e.type,id:e.id,children:a.jsx(uO,{value:z,children:a.jsxs(s,{value:M,onChange:k,onInput:y,selection:u,settings:v,useSubRegistry:!1,children:[r,!t.isPreviewMode&&a.jsxs(a.Fragment,{children:[a.jsx(rHt,{}),a.jsx(tHt,{}),a.jsx(UVt,{}),p==="template-locked"&&a.jsx(E$t,{}),_==="wp_navigation"&&a.jsx(W$t,{}),a.jsx(QVt,{}),a.jsx($Vt,{}),a.jsx(PVt,{}),a.jsx(jVt,{}),a.jsx(ZVt,{}),a.jsx(SVt,{}),a.jsx(qVt,{})]})]})})})})});function FOe(e){return a.jsx(DOe,{...e,BlockEditorProviderComponent:D5t,children:e.children})}const{useGlobalStyle:cHt}=St(jn);function lHt({template:e,post:t}){const[n="white"]=cHt("color.background"),[o]=ya("postType",t.type,{id:t.id}),[r]=ya("postType",e?.type,{id:e?.id}),s=e&&r?r:o,i=!s?.length;return a.jsxs("div",{className:"editor-fields-content-preview",style:{backgroundColor:n},children:[i&&a.jsx("span",{className:"editor-fields-content-preview__empty",children:m("Empty content")}),!i&&a.jsx(Vd.Async,{children:a.jsx(Vd,{blocks:s})})]})}function uHt({item:e}){const{settings:t,template:n}=G(o=>{var r;const{canUser:s,getPostType:i,getTemplateId:c,getEntityRecord:l}=St(o(Me)),u=s("read",{kind:"postType",name:"wp_template"}),d=o(_e).getEditorSettings(),p=d.supportsTemplateMode,f=(r=i(e.type)?.viewable)!==null&&r!==void 0?r:!1,b=p&&f&&u?c(e.type,e.id):null;return{settings:d,template:b?l("postType","wp_template",b):void 0}},[e.type,e.id]);return a.jsx(FOe,{post:e,settings:t,__unstableTemplate:n,children:a.jsx(lHt,{template:n,post:e})})}const dHt={type:"media",id:"content-preview",label:m("Content preview"),render:uHt,enableSorting:!1};function pHt(e,t,n){return{type:"REGISTER_ENTITY_ACTION",kind:e,name:t,config:n}}function fHt(e,t,n){return{type:"UNREGISTER_ENTITY_ACTION",kind:e,name:t,actionId:n}}function bHt(e,t,n){return{type:"REGISTER_ENTITY_FIELD",kind:e,name:t,config:n}}function hHt(e,t,n){return{type:"UNREGISTER_ENTITY_FIELD",kind:e,name:t,fieldId:n}}function mHt(e,t){return{type:"SET_IS_READY",kind:e,name:t}}const gHt=e=>async({registry:t})=>{if(St(t.select(_e)).isEntityReady("postType",e))return;St(t.dispatch(_e)).setIsReady("postType",e);const o=await t.resolveSelect(Me).getPostType(e),r=await t.resolveSelect(Me).canUser("create",{kind:"postType",name:e}),s=await t.resolveSelect(Me).getCurrentTheme(),i=[o.viewable?tFt:void 0,o.supports?.revisions?JFt:void 0,globalThis.IS_GUTENBERG_PLUGIN?!["wp_template","wp_block","wp_template_part"].includes(o.slug)&&r&&RFt:void 0,o.slug==="wp_template_part"&&r&&s?.is_block_theme?d$t:void 0,r&&o.slug==="wp_block"?PFt:void 0,o.supports?.title?TFt:void 0,o.supports?.["page-attributes"]?SFt:void 0,o.slug==="wp_block"?QFt:void 0,t$t,NFt,i$t,n$t,e$t].filter(Boolean),c=[o.supports?.thumbnail&&s?.theme_supports?.["post-thumbnails"]&&LDt,o.supports?.author&&eFt,KDt,QDt,E9t,o.supports?.["page-attributes"]&&VDt,o.supports?.comments&&YDt,jDt,UDt,o.supports?.editor&&o.viewable&&dHt].filter(Boolean);if(o.supports?.title){let l;e==="page"?l=B9t:e==="wp_template"?l=L9t:e==="wp_block"?l=MDt:l=dOe,c.push(l)}t.batch(()=>{i.forEach(l=>{St(t.dispatch(_e)).registerEntityAction("postType",e,l)}),c.forEach(l=>{St(t.dispatch(_e)).registerEntityField("postType",e,l)})}),qN("core.registerPostTypeSchema",e)};function MHt(e){return{type:"SET_CURRENT_TEMPLATE_ID",id:e}}const zHt=e=>async({select:t,dispatch:n,registry:o})=>{const r=await o.dispatch(Me).saveEntityRecord("postType","wp_template",e);return o.dispatch(Me).editEntityRecord("postType",t.getCurrentPostType(),t.getCurrentPostId(),{template:r.slug}),o.dispatch(mt).createSuccessNotice(m("Custom template created. You're in template mode now."),{type:"snackbar",actions:[{label:m("Go back"),onClick:()=>n.setRenderingMode(t.getEditorSettings().defaultRenderingMode)}]}),r},OHt=e=>({registry:t})=>{var n;const r=((n=t.select(ht).get("core","hiddenBlockTypes"))!==null&&n!==void 0?n:[]).filter(s=>!(Array.isArray(e)?e:[e]).includes(s));t.dispatch(ht).set("core","hiddenBlockTypes",r)},yHt=e=>({registry:t})=>{var n;const o=(n=t.select(ht).get("core","hiddenBlockTypes"))!==null&&n!==void 0?n:[],r=new Set([...o,...Array.isArray(e)?e:[e]]);t.dispatch(ht).set("core","hiddenBlockTypes",[...r])},AHt=({onSave:e,dirtyEntityRecords:t=[],entitiesToSkip:n=[],close:o}={})=>({registry:r})=>{const s=[{kind:"postType",name:"wp_navigation"}],i="site-editor-save-success",c=r.select(Me).getEntityRecord("root","__unstableBase")?.home;r.dispatch(mt).removeNotice(i);const l=t.filter(({kind:p,name:f,key:b,property:h})=>!n.some(g=>g.kind===p&&g.name===f&&g.key===b&&g.property===h));o?.(l);const u=[],d=[];l.forEach(({kind:p,name:f,key:b,property:h})=>{p==="root"&&f==="site"?u.push(h):(s.some(g=>g.kind===p&&g.name===f)&&r.dispatch(Me).editEntityRecord(p,f,b,{status:"publish"}),d.push(r.dispatch(Me).saveEditedEntityRecord(p,f,b)))}),u.length&&d.push(r.dispatch(Me).__experimentalSaveSpecifiedEntityEdits("root","site",void 0,u)),r.dispatch(J).__unstableMarkLastChangeAsPersistent(),Promise.all(d).then(p=>e?e(p):p).then(p=>{p.some(f=>typeof f>"u")?r.dispatch(mt).createErrorNotice(m("Saving failed.")):r.dispatch(mt).createSuccessNotice(m("Site updated."),{type:"snackbar",id:i,actions:[{label:m("View site"),url:c}]})}).catch(p=>r.dispatch(mt).createErrorNotice(`${m("Saving failed.")} ${p}`))},vHt=(e,{allowUndo:t=!0}={})=>async({registry:n})=>{const o="edit-site-template-reverted";if(n.dispatch(mt).removeNotice(o),!iOe(e)){n.dispatch(mt).createErrorNotice(m("This template is not revertable."),{type:"snackbar"});return}try{const r=n.select(Me).getEntityConfig("postType",e.type);if(!r){n.dispatch(mt).createErrorNotice(m("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});return}const s=tn(`${r.baseURL}/${e.id}`,{context:"edit",source:e.origin}),i=await Wt({path:s});if(!i){n.dispatch(mt).createErrorNotice(m("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});return}const c=({blocks:d=[]})=>Jd(d),l=n.select(Me).getEditedEntityRecord("postType",e.type,e.id);n.dispatch(Me).editEntityRecord("postType",e.type,e.id,{content:c,blocks:l.blocks,source:"custom"},{undoIgnore:!0});const u=Ko(i?.content?.raw);if(n.dispatch(Me).editEntityRecord("postType",e.type,i.id,{content:c,blocks:u,source:"theme"}),t){const d=()=>{n.dispatch(Me).editEntityRecord("postType",e.type,l.id,{content:c,blocks:l.blocks,source:"custom"})};n.dispatch(mt).createSuccessNotice(m("Template reset."),{type:"snackbar",id:o,actions:[{label:m("Undo"),onClick:d}]})}}catch(r){const s=r.message&&r.code!=="unknown_error"?r.message:m("Template revert failed. Please reload.");n.dispatch(mt).createErrorNotice(s,{type:"snackbar"})}},xHt=e=>async({registry:t})=>{const n=e.every(r=>r?.has_theme_file),o=await Promise.allSettled(e.map(r=>t.dispatch(Me).deleteEntityRecord("postType",r.type,r.id,{force:!0},{throwOnError:!0})));if(o.every(({status:r})=>r==="fulfilled")){let r;if(e.length===1){let s;typeof e[0].title=="string"?s=e[0].title:typeof e[0].title?.rendered=="string"?s=e[0].title?.rendered:typeof e[0].title?.raw=="string"&&(s=e[0].title?.raw),r=xe(n?m('"%s" reset.'):We('"%s" deleted.',"template part"),Lt(s))}else r=m(n?"Items reset.":"Items deleted.");t.dispatch(mt).createSuccessNotice(r,{type:"snackbar",id:"editor-template-deleted-success"})}else{let r;if(o.length===1)o[0].reason?.message?r=o[0].reason.message:r=m(n?"An error occurred while reverting the item.":"An error occurred while deleting the item.");else{const s=new Set,i=o.filter(({status:c})=>c==="rejected");for(const c of i)c.reason?.message&&s.add(c.reason.message);s.size===0?r=m("An error occurred while deleting the items."):s.size===1?r=n?xe(m("An error occurred while reverting the items: %s"),[...s][0]):xe(m("An error occurred while deleting the items: %s"),[...s][0]):r=n?xe(m("Some errors occurred while reverting the items: %s"),[...s].join(",")):xe(m("Some errors occurred while deleting the items: %s"),[...s].join(","))}t.dispatch(mt).createErrorNotice(r,{type:"snackbar"})}},wHt=Object.freeze(Object.defineProperty({__proto__:null,createTemplate:zHt,hideBlockTypes:yHt,registerEntityAction:pHt,registerEntityField:bHt,registerPostTypeSchema:gHt,removeTemplates:xHt,revertTemplate:vHt,saveDirtyEntities:AHt,setCurrentTemplateId:MHt,setIsReady:mHt,showBlockTypes:OHt,unregisterEntityAction:fHt,unregisterEntityField:hHt},Symbol.toStringTag,{value:"Module"})),$Oe=[];function _Ht(e,t,n){var o;return(o=e.actions[t]?.[n])!==null&&o!==void 0?o:$Oe}function kHt(e,t,n){var o;return(o=e.fields[t]?.[n])!==null&&o!==void 0?o:$Oe}function SHt(e,t,n){return e.isReady[t]?.[n]}const CHt={rootClientId:void 0,insertionIndex:void 0,filterValue:void 0},qHt=At(e=>It(t=>{if(typeof t.blockInserterPanel=="object")return t.blockInserterPanel;if(JW(t)==="template-locked"){const[n]=e(J).getBlocksByName("core/post-content");if(n)return{rootClientId:n,insertionIndex:void 0,filterValue:void 0}}return CHt},t=>{const[n]=e(J).getBlocksByName("core/post-content");return[t.blockInserterPanel,JW(t),n]}));function RHt(e){return e.listViewToggleRef}function THt(e){return e.inserterSidebarToggleRef}const rne={wp_block:Bd,wp_navigation:G3,page:wa,post:jw},EHt=At(e=>(t,n,o)=>{{if(n==="wp_template_part"||n==="wp_template"){const i=(e(Me).getEntityRecord("root","__unstableBase")?.default_template_part_areas||[]).find(c=>o.area===c.area);return i?.icon?CI(i.icon):nu}if(rne[n])return rne[n];const r=e(Me).getPostType(n);return typeof r?.icon=="string"&&r.icon.startsWith("dashicons-")?r.icon.slice(10):wa}}),WHt=At(e=>(t,n,o)=>{const{type:r,id:s}=G1(t),i=e(Me).getEntityRecordNonTransientEdits("postType",n||r,o||s);if(!i?.meta)return!1;const c=e(Me).getEntityRecord("postType",n||r,o||s)?.meta;return!bMe({...c,footnotes:void 0},{...i.meta,footnotes:void 0})});function NHt(e,...t){return _Ht(e.dataviews,...t)}function BHt(e,...t){return SHt(e.dataviews,...t)}function LHt(e,...t){return kHt(e.dataviews,...t)}const PHt=At(e=>It((t,n)=>{n=Array.isArray(n)?n:[n];const{getBlocksByName:o,getBlockParents:r,getBlockName:s}=e(J);return o(n).filter(i=>r(i).every(c=>{const l=s(c);return l!=="core/query"&&!n.includes(l)}))},()=>[e(J).getBlocks()])),jHt=Object.freeze(Object.defineProperty({__proto__:null,getEntityActions:NHt,getEntityFields:LHt,getInserter:qHt,getInserterSidebarToggleRef:THt,getListViewToggleRef:RHt,getPostBlocksByName:PHt,getPostIcon:EHt,hasPostMetaChanges:WHt,isEntityReady:BHt},Symbol.toStringTag,{value:"Module"})),VOe={reducer:ajt,selectors:lIt,actions:C9t},_e=w1(ljt,{...VOe});Us(_e);St(_e).registerPrivateActions(wHt);St(_e).registerPrivateSelectors(jHt);const IHt=e=>Or(t=>({attributes:n,setAttributes:o,...r})=>{const s=G(u=>u(_e).getCurrentPostType(),[]),[i,c]=Ao("postType",s,"meta"),l=x.useMemo(()=>({...n,...Object.fromEntries(Object.entries(e).map(([u,d])=>[u,i[d]]))}),[n,i]);return a.jsx(t,{attributes:l,setAttributes:u=>{const d=Object.fromEntries(Object.entries(u??{}).filter(([p])=>p in e).map(([p,f])=>[e[p],f]));Object.entries(d).length&&c(d),o(u)},...r})},"withMetaAttributeSource");function DHt(e){var t;const n=Object.fromEntries(Object.entries((t=e.attributes)!==null&&t!==void 0?t:{}).filter(([,{source:o}])=>o==="meta").map(([o,{meta:r}])=>[o,r]));return Object.entries(n).length&&(e.edit=IHt(n)(e.edit)),e}Bn("blocks.registerBlockType","core/editor/custom-sources-backwards-compatibility/shim-attribute-source",DHt);function FHt(e){const t=e.avatar_urls&&e.avatar_urls[24]?a.jsx("img",{className:"editor-autocompleters__user-avatar",alt:"",src:e.avatar_urls[24]}):a.jsx("span",{className:"editor-autocompleters__no-avatar"});return a.jsxs(a.Fragment,{children:[t,a.jsx("span",{className:"editor-autocompleters__user-name",children:e.name}),a.jsx("span",{className:"editor-autocompleters__user-slug",children:e.slug})]})}const $Ht={name:"users",className:"editor-autocompleters__user",triggerPrefix:"@",useItems(e){const t=G(o=>{const{getUsers:r}=o(Me);return r({context:"view",search:encodeURIComponent(e)})},[e]);return[x.useMemo(()=>t?t.map(o=>({key:`user-${o.slug}`,value:o,label:FHt(o)})):[],[t])]},getOptionCompletion(e){return`@${e.slug}`}};class VHt extends x.Component{constructor(t){super(t),this.needsAutosave=!!(t.isDirty&&t.isAutosaveable)}componentDidMount(){this.props.disableIntervalChecks||this.setAutosaveTimer()}componentDidUpdate(t){if(this.props.disableIntervalChecks){this.props.editsReference!==t.editsReference&&this.props.autosave();return}if(this.props.interval!==t.interval&&(clearTimeout(this.timerId),this.setAutosaveTimer()),!this.props.isDirty){this.needsAutosave=!1;return}if(this.props.isAutosaving&&!t.isAutosaving){this.needsAutosave=!1;return}this.props.editsReference!==t.editsReference&&(this.needsAutosave=!0)}componentWillUnmount(){clearTimeout(this.timerId)}setAutosaveTimer(t=this.props.interval*1e3){this.timerId=setTimeout(()=>{this.autosaveTimerHandler()},t)}autosaveTimerHandler(){if(!this.props.isAutosaveable){this.setAutosaveTimer(1e3);return}this.needsAutosave&&(this.needsAutosave=!1,this.props.autosave()),this.setAutosaveTimer()}render(){return null}}const HHt=Co([Ul((e,t)=>{const{getReferenceByDistinctEdits:n}=e(Me),{isEditedPostDirty:o,isEditedPostAutosaveable:r,isAutosavingPost:s,getEditorSettings:i}=e(_e),{interval:c=i().autosaveInterval}=t;return{editsReference:n(),isDirty:o(),isAutosaveable:r(),isAutosaving:s(),interval:c}}),jf((e,t)=>({autosave(){const{autosave:n=e(_e).autosave}=t;n()}}))])(VHt);function HOe(e){const{isFrontPage:t,isPostsPage:n}=G(o=>{const{canUser:r,getEditedEntityRecord:s}=o(Me),i=r("read",{kind:"root",name:"site"})?s("root","site"):void 0,c=parseInt(e,10);return{isFrontPage:i?.page_on_front===c,isPostsPage:i?.page_for_posts===c}});return t?m("Homepage"):n?m("Posts Page"):!1}const UHt=qr(Ce);function XHt(e){const{postId:t,postType:n,postTypeLabel:o,documentTitle:r,isNotFound:s,templateTitle:i,onNavigateToPreviousEntityRecord:c,isTemplatePreview:l}=G(_=>{var v;const{getCurrentPostType:M,getCurrentPostId:y,getEditorSettings:k,getRenderingMode:S}=_(_e),{getEditedEntityRecord:C,getPostType:R,isResolving:T}=_(Me),E=M(),B=y(),N=C("postType",E,B),{default_template_types:j=[]}=(v=_(Me).getEntityRecord("root","__unstableBase"))!==null&&v!==void 0?v:{},I=LO({templateTypes:j,template:N}),P=R(E)?.labels?.singular_name;return{postId:B,postType:E,postTypeLabel:P,documentTitle:N.title,isNotFound:!N&&!T("getEditedEntityRecord","postType",E,B),templateTitle:I.title,onNavigateToPreviousEntityRecord:k().onNavigateToPreviousEntityRecord,isTemplatePreview:S()==="template-locked"}},[]),{open:u}=Oe(Ef),d=$1(),p=K3e.includes(n),f=!!c,b=p?i:r,h=e.title||b,g=e.icon,z=HOe(t),A=x.useRef(!1);return x.useEffect(()=>{A.current=!0},[]),a.jsxs("div",{className:oe("editor-document-bar",{"has-back-button":f}),children:[a.jsx(Wd,{children:f&&a.jsx(UHt,{className:"editor-document-bar__back",icon:jt()?Af:qw,onClick:_=>{_.stopPropagation(),c()},size:"compact",initial:A.current?{opacity:0,transform:"translateX(15%)"}:!1,animate:{opacity:1,transform:"translateX(0%)"},exit:{opacity:0,transform:"translateX(15%)"},transition:d?{duration:0}:void 0,children:m("Back")})}),!p&&l&&a.jsx(Zn,{icon:nu,className:"editor-document-bar__icon-layout"}),s?a.jsx(Sn,{children:m("Document not found")}):a.jsxs(Ce,{className:"editor-document-bar__command",onClick:()=>u(),size:"compact",children:[a.jsxs(qr.div,{className:"editor-document-bar__title",initial:A.current?{opacity:0,transform:f?"translateX(15%)":"translateX(-15%)"}:!1,animate:{opacity:1,transform:"translateX(0%)"},transition:d?{duration:0}:void 0,children:[g&&a.jsx(Zn,{icon:g}),a.jsxs(Sn,{size:"body",as:"h1",children:[a.jsx("span",{className:"editor-document-bar__post-title",children:h?x1(h):m("No title")}),z&&a.jsx("span",{className:"editor-document-bar__post-type-label",children:`· ${z}`}),o&&!e.title&&!z&&a.jsx("span",{className:"editor-document-bar__post-type-label",children:`· ${Lt(o)}`})]})]},f),a.jsx("span",{className:"editor-document-bar__shortcut",children:j1.primary("k")})]})]})}const sne=({children:e,isValid:t,level:n,href:o,onSelect:r})=>a.jsx("li",{className:oe("document-outline__item",`is-${n.toLowerCase()}`,{"is-invalid":!t}),children:a.jsxs("a",{href:o,className:"document-outline__button",onClick:r,children:[a.jsx("span",{className:"document-outline__emdash","aria-hidden":"true"}),a.jsx("strong",{className:"document-outline__level",children:n}),a.jsx("span",{className:"document-outline__item-content",children:e})]})}),GHt=a.jsx("em",{children:m("(Empty heading)")}),KHt=[a.jsx("br",{},"incorrect-break"),a.jsx("em",{children:m("(Incorrect heading level)")},"incorrect-message")],YHt=[a.jsx("br",{},"incorrect-break-h1"),a.jsx("em",{children:m("(Your theme may already use a H1 for the post title)")},"incorrect-message-h1")],ZHt=[a.jsx("br",{},"incorrect-break-multiple-h1"),a.jsx("em",{children:m("(Multiple H1 headings are not recommended)")},"incorrect-message-multiple-h1")];function QHt(){return a.jsxs(ge,{width:"138",height:"148",viewBox:"0 0 138 148",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx(S0,{width:"138",height:"148",rx:"4",fill:"#F0F6FC"}),a.jsx(MA,{x1:"44",y1:"28",x2:"24",y2:"28",stroke:"#DDDDDD"}),a.jsx(S0,{x:"48",y:"16",width:"27",height:"23",rx:"4",fill:"#DDDDDD"}),a.jsx(he,{d:"M54.7585 32V23.2727H56.6037V26.8736H60.3494V23.2727H62.1903V32H60.3494V28.3949H56.6037V32H54.7585ZM67.4574 23.2727V32H65.6122V25.0241H65.5611L63.5625 26.277V24.6406L65.723 23.2727H67.4574Z",fill:"black"}),a.jsx(MA,{x1:"55",y1:"59",x2:"24",y2:"59",stroke:"#DDDDDD"}),a.jsx(S0,{x:"59",y:"47",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),a.jsx(he,{d:"M65.7585 63V54.2727H67.6037V57.8736H71.3494V54.2727H73.1903V63H71.3494V59.3949H67.6037V63H65.7585ZM74.6605 63V61.6705L77.767 58.794C78.0313 58.5384 78.2528 58.3082 78.4318 58.1037C78.6136 57.8991 78.7514 57.6989 78.8452 57.5028C78.9389 57.304 78.9858 57.0895 78.9858 56.8594C78.9858 56.6037 78.9276 56.3835 78.8111 56.1989C78.6946 56.0114 78.5355 55.8679 78.3338 55.7685C78.1321 55.6662 77.9034 55.6151 77.6477 55.6151C77.3807 55.6151 77.1477 55.669 76.9489 55.777C76.75 55.8849 76.5966 56.0398 76.4886 56.2415C76.3807 56.4432 76.3267 56.6832 76.3267 56.9616H74.5753C74.5753 56.3906 74.7045 55.8949 74.9631 55.4744C75.2216 55.054 75.5838 54.7287 76.0497 54.4986C76.5156 54.2685 77.0526 54.1534 77.6605 54.1534C78.2855 54.1534 78.8295 54.2642 79.2926 54.4858C79.7585 54.7045 80.1207 55.0085 80.3793 55.3977C80.6378 55.7869 80.767 56.233 80.767 56.7358C80.767 57.0653 80.7017 57.3906 80.571 57.7116C80.4432 58.0327 80.2145 58.3892 79.8849 58.7812C79.5554 59.1705 79.0909 59.6378 78.4915 60.1832L77.2173 61.4318V61.4915H80.8821V63H74.6605Z",fill:"black"}),a.jsx(MA,{x1:"80",y1:"90",x2:"24",y2:"90",stroke:"#DDDDDD"}),a.jsx(S0,{x:"84",y:"78",width:"30",height:"23",rx:"4",fill:"#F0B849"}),a.jsx(he,{d:"M90.7585 94V85.2727H92.6037V88.8736H96.3494V85.2727H98.1903V94H96.3494V90.3949H92.6037V94H90.7585ZM99.5284 92.4659V91.0128L103.172 85.2727H104.425V87.2841H103.683L101.386 90.919V90.9872H106.564V92.4659H99.5284ZM103.717 94V92.0227L103.751 91.3793V85.2727H105.482V94H103.717Z",fill:"black"}),a.jsx(MA,{x1:"66",y1:"121",x2:"24",y2:"121",stroke:"#DDDDDD"}),a.jsx(S0,{x:"70",y:"109",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),a.jsx(he,{d:"M76.7585 125V116.273H78.6037V119.874H82.3494V116.273H84.1903V125H82.3494V121.395H78.6037V125H76.7585ZM88.8864 125.119C88.25 125.119 87.6832 125.01 87.1861 124.791C86.6918 124.57 86.3011 124.266 86.0142 123.879C85.7301 123.49 85.5838 123.041 85.5753 122.533H87.4332C87.4446 122.746 87.5142 122.933 87.642 123.095C87.7727 123.254 87.946 123.378 88.1619 123.466C88.3778 123.554 88.6207 123.598 88.8906 123.598C89.1719 123.598 89.4205 123.548 89.6364 123.449C89.8523 123.349 90.0213 123.212 90.1435 123.036C90.2656 122.859 90.3267 122.656 90.3267 122.426C90.3267 122.193 90.2614 121.987 90.1307 121.808C90.0028 121.626 89.8182 121.484 89.5767 121.382C89.3381 121.28 89.054 121.229 88.7244 121.229H87.9105V119.874H88.7244C89.0028 119.874 89.2486 119.825 89.4616 119.729C89.6776 119.632 89.8452 119.499 89.9645 119.328C90.0838 119.155 90.1435 118.953 90.1435 118.723C90.1435 118.504 90.0909 118.312 89.9858 118.148C89.8835 117.98 89.7386 117.849 89.5511 117.756C89.3665 117.662 89.1506 117.615 88.9034 117.615C88.6534 117.615 88.4247 117.661 88.2173 117.751C88.0099 117.839 87.8438 117.966 87.7188 118.131C87.5938 118.295 87.527 118.489 87.5185 118.71H85.75C85.7585 118.207 85.902 117.764 86.1804 117.381C86.4588 116.997 86.8338 116.697 87.3054 116.482C87.7798 116.263 88.3153 116.153 88.9119 116.153C89.5142 116.153 90.0412 116.263 90.4929 116.482C90.9446 116.7 91.2955 116.996 91.5455 117.368C91.7983 117.737 91.9233 118.152 91.9205 118.612C91.9233 119.101 91.7713 119.509 91.4645 119.835C91.1605 120.162 90.7642 120.369 90.2756 120.457V120.526C90.9176 120.608 91.4063 120.831 91.7415 121.195C92.0795 121.555 92.2472 122.007 92.2443 122.55C92.2472 123.047 92.1037 123.489 91.8139 123.875C91.527 124.261 91.1307 124.565 90.625 124.787C90.1193 125.009 89.5398 125.119 88.8864 125.119Z",fill:"black"})]})}const UOe=(e=[])=>e.flatMap((t={})=>t.name==="core/heading"?{...t,level:t.attributes.level,isEmpty:JHt(t)}:UOe(t.innerBlocks)),JHt=e=>!e.attributes.content||e.attributes.content.trim().length===0;function eUt({onSelect:e,hasOutlineItemsDisabled:t}){const{selectBlock:n}=Oe(J),{blocks:o,title:r,isTitleSupported:s}=G(f=>{var b;const{getBlocks:h}=f(J),{getEditedPostAttribute:g}=f(_e),{getPostType:z}=f(Me),A=z(g("type"));return{title:g("title"),blocks:h(),isTitleSupported:(b=A?.supports?.title)!==null&&b!==void 0?b:!1}}),i=x.useRef(1),c=UOe(o);if(c.length<1)return a.jsxs("div",{className:"editor-document-outline has-no-headings",children:[a.jsx(QHt,{}),a.jsx("p",{children:m("Navigate the structure of your document and address issues like empty or incorrect heading levels.")})]});const l=document.querySelector(".editor-post-title__input"),u=s&&r&&l,p=c.reduce((f,b)=>({...f,[b.level]:(f[b.level]||0)+1}),{})[1]>1;return a.jsx("div",{className:"document-outline",children:a.jsxs("ul",{children:[u&&a.jsx(sne,{level:m("Title"),isValid:!0,onSelect:e,href:`#${l.id}`,isDisabled:t,children:r}),c.map(f=>{const b=f.level>i.current+1,h=!f.isEmpty&&!b&&!!f.level&&(f.level!==1||!p&&!u);return i.current=f.level,a.jsxs(sne,{level:`H${f.level}`,isValid:h,isDisabled:t,href:`#block-${f.clientId}`,onSelect:()=>{n(f.clientId),e?.()},children:[f.isEmpty?GHt:Jp(eo({html:f.attributes.content})),b&&KHt,f.level===1&&p&&ZHt,u&&f.level===1&&!p&&YHt]},f.clientId)})]})})}function tUt(e,t){const n=da()?j1.primaryShift("z"):j1.primary("y"),o=G(s=>s(_e).hasEditorRedo(),[]),{redo:r}=Oe(_e);return a.jsx(Ce,{__next40pxDefaultSize:!0,...e,ref:t,icon:jt()?Fde:Rde,label:m("Redo"),shortcut:n,"aria-disabled":!o,onClick:o?r:void 0,className:"editor-history__redo"})}const nUt=x.forwardRef(tUt);function oUt(e,t){const n=G(r=>r(_e).hasEditorUndo(),[]),{undo:o}=Oe(_e);return a.jsx(Ce,{__next40pxDefaultSize:!0,...e,ref:t,icon:jt()?Rde:Fde,label:m("Undo"),shortcut:j1.primary("z"),"aria-disabled":!n,onClick:n?o:void 0,className:"editor-history__undo"})}const rUt=x.forwardRef(oUt);function sUt(){const[e,t]=x.useState(!1),n=G(s=>s(J).isValidTemplate(),[]),{setTemplateValidity:o,synchronizeTemplate:r}=Oe(J);return n?null:a.jsxs(a.Fragment,{children:[a.jsx(A1,{className:"editor-template-validation-notice",isDismissible:!1,status:"warning",actions:[{label:m("Keep it as is"),onClick:()=>o(!0)},{label:m("Reset the template"),onClick:()=>t(!0)}],children:m("The content of your post doesn’t match the template assigned to your post type.")}),a.jsx(wf,{isOpen:e,confirmButtonText:m("Reset"),onConfirm:()=>{t(!1),r()},onCancel:()=>t(!1),size:"medium",children:m("Resetting the template may result in loss of content, do you want to continue?")})]})}function ine(){const{notices:e}=G(r=>({notices:r(mt).getNotices()}),[]),{removeNotice:t}=Oe(mt),n=e.filter(({isDismissible:r,type:s})=>r&&s==="default"),o=e.filter(({isDismissible:r,type:s})=>!r&&s==="default");return a.jsxs(a.Fragment,{children:[a.jsx(sW,{notices:o,className:"components-editor-notices__pinned"}),a.jsx(sW,{notices:n,className:"components-editor-notices__dismissible",onRemove:t,children:a.jsx(sUt,{})})]})}const iUt=-3;function aUt(){const e=G(o=>o(mt).getNotices(),[]),{removeNotice:t}=Oe(mt),n=e.filter(({type:o})=>o==="snackbar").slice(iUt);return a.jsx(J2t,{notices:n,className:"components-editor-notices__snackbar",onRemove:t})}function cUt({record:e,checked:t,onChange:n}){const{name:o,kind:r,title:s,key:i}=e,{entityRecordTitle:c,hasPostMetaChanges:l}=G(u=>{var d;if(r!=="postType"||o!=="wp_template")return{entityRecordTitle:s,hasPostMetaChanges:St(u(_e)).hasPostMetaChanges(o,i)};const p=u(Me).getEditedEntityRecord(r,o,i),{default_template_types:f=[]}=(d=u(Me).getEntityRecord("root","__unstableBase"))!==null&&d!==void 0?d:{};return{entityRecordTitle:LO({template:p,templateTypes:f}).title,hasPostMetaChanges:St(u(_e)).hasPostMetaChanges(o,i)}},[o,r,s,i]);return a.jsxs(a.Fragment,{children:[a.jsx(a_,{children:a.jsx(K0,{__nextHasNoMarginBottom:!0,label:Lt(c)||m("Untitled"),checked:t,onChange:n})}),l&&a.jsx("ul",{className:"entities-saved-states__changes",children:a.jsx("li",{children:m("Post Meta.")})})]})}const{getGlobalStylesChanges:lUt,GlobalStylesContext:uUt}=St(jn);function dUt(e,t){switch(e){case"site":return m(t===1?"This change will affect your whole site.":"These changes will affect your whole site.");case"wp_template":return m("This change will affect pages and posts that use this template.");case"page":case"post":return m("The following has been modified.")}}function pUt({record:e}){const{user:t}=x.useContext(uUt),n=G(r=>r(Me).getEntityRecord(e.kind,e.name,e.key),[e.kind,e.name,e.key]),o=lUt(t,n,{maxResults:10});return o.length?a.jsx("ul",{className:"entities-saved-states__changes",children:o.map(r=>a.jsx("li",{children:r},r))}):null}function fUt({record:e,count:t}){if(e?.name==="globalStyles")return null;const n=dUt(e?.name,t);return n?a.jsx(a_,{children:n}):null}function bUt({list:e,unselectedEntities:t,setUnselectedEntities:n}){const o=e.length,r=e[0];let i=G(c=>c(Me).getEntityConfig(r.kind,r.name),[r.kind,r.name]).label;return r?.name==="wp_template_part"&&(i=m(o===1?"Template Part":"Template Parts")),a.jsxs(Qt,{title:i,initialOpen:!0,children:[a.jsx(fUt,{record:r,count:o}),e.map(c=>a.jsx(cUt,{record:c,checked:!t.some(l=>l.kind===c.kind&&l.name===c.name&&l.key===c.key&&l.property===c.property),onChange:l=>n(c,l)},c.key||c.property)),r?.name==="globalStyles"&&a.jsx(pUt,{record:r})]})}const hUt=()=>{const{editedEntities:e,siteEdits:t,siteEntityConfig:n}=G(l=>{const{__experimentalGetDirtyEntityRecords:u,getEntityRecordEdits:d,getEntityConfig:p}=l(Me);return{editedEntities:u(),siteEdits:d("root","site"),siteEntityConfig:p("root","site")}},[]),o=x.useMemo(()=>{var l;const u=e.filter(f=>!(f.kind==="root"&&f.name==="site")),d=(l=n?.meta?.labels)!==null&&l!==void 0?l:{},p=[];for(const f in t)p.push({kind:"root",name:"site",title:d[f]||f,property:f});return[...u,...p]},[e,t,n]),[r,s]=x.useState([]),i=({kind:l,name:u,key:d,property:p},f)=>{s(f?r.filter(b=>b.kind!==l||b.name!==u||b.key!==d||b.property!==p):[...r,{kind:l,name:u,key:d,property:p}])},c=o.length-r.length>0;return{dirtyEntityRecords:o,isDirty:c,setUnselectedEntities:i,unselectedEntities:r}};function mUt(e){return e}function gUt({close:e,renderDialog:t}){const n=hUt();return a.jsx(Jx,{close:e,renderDialog:t,...n})}function Jx({additionalPrompt:e=void 0,close:t,onSave:n=mUt,saveEnabled:o=void 0,saveLabel:r=m("Save"),renderDialog:s,dirtyEntityRecords:i,isDirty:c,setUnselectedEntities:l,unselectedEntities:u}){const d=x.useRef(),{saveDirtyEntities:p}=St(Oe(_e)),f=i.reduce((R,T)=>{const{name:E}=T;return R[E]||(R[E]=[]),R[E].push(T),R},{}),{site:b,wp_template:h,wp_template_part:g,...z}=f,A=[b,h,g,...Object.values(z)].filter(Array.isArray),_=o??c,v=x.useCallback(()=>t(),[t]),[M,y]=f0e({onClose:()=>v()}),k=vt(Jx,"label"),S=vt(Jx,"description"),C=i.length?m("Select the items you want to save."):void 0;return a.jsxs("div",{ref:s?M:void 0,...s&&y,className:"entities-saved-states__panel",role:s?"dialog":void 0,"aria-labelledby":s?k:void 0,"aria-describedby":s?S:void 0,children:[a.jsxs(Yo,{className:"entities-saved-states__panel-header",gap:2,children:[a.jsx(Tn,{isBlock:!0,as:Ce,variant:"secondary",size:"compact",onClick:v,children:m("Cancel")}),a.jsx(Tn,{isBlock:!0,as:Ce,ref:d,variant:"primary",size:"compact",disabled:!_,accessibleWhenDisabled:!0,onClick:()=>p({onSave:n,dirtyEntityRecords:i,entitiesToSkip:u,close:t}),className:"editor-entities-saved-states__save-button",children:r})]}),a.jsxs("div",{className:"entities-saved-states__text-prompt",children:[a.jsxs("div",{className:"entities-saved-states__text-prompt--header-wrapper",id:s?k:void 0,children:[a.jsx("strong",{className:"entities-saved-states__text-prompt--header",children:m("Are you ready to save?")}),e]}),a.jsx("p",{id:s?S:void 0,children:c?cr(xe(Dn("There is %d site change waiting to be saved.","There are %d site changes waiting to be saved.",i.length),i.length),{strong:a.jsx("strong",{})}):C})]}),A.map(R=>a.jsx(bUt,{list:R,unselectedEntities:u,setUnselectedEntities:l},R[0].name))]})}function MUt(){try{return uo(_e).getEditedPostContent()}catch{}}function ane({text:e,children:t,variant:n="secondary"}){const o=Hl(e);return a.jsx(Ce,{__next40pxDefaultSize:!0,variant:n,ref:o,children:t})}class zUt extends x.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(t){qN("editor.ErrorBoundary.errorLogged",t)}static getDerivedStateFromError(t){return{error:t}}render(){const{error:t}=this.state,{canCopyContent:n=!1}=this.props;return t?a.jsxs(Ot,{className:"editor-error-boundary",alignment:"baseline",spacing:4,justify:"space-between",expanded:!1,wrap:!0,children:[a.jsx(Sn,{as:"p",children:m("The editor has encountered an unexpected error.")}),a.jsxs(Ot,{expanded:!1,children:[n&&a.jsx(ane,{text:MUt,children:m("Copy contents")}),a.jsx(ane,{variant:"primary",text:t?.stack,children:m("Copy error")})]})]}):this.props.children}}function XOe({children:e}){return G(n=>{const{getEditedPostAttribute:o}=n(_e),{getPostType:r}=n(Me);return!!r(o("type"))?.supports?.["page-attributes"]},[])?e:null}function Sc({children:e,supportKeys:t}){const n=G(r=>{const{getEditedPostAttribute:s}=r(_e),{getPostType:i}=r(Me);return i(s("type"))},[]);let o=!!n;return n&&(o=(Array.isArray(t)?t:[t]).some(r=>!!n.supports[r])),o?e:null}const xs=x.forwardRef(({className:e,label:t,children:n},o)=>a.jsxs(Ot,{className:oe("editor-post-panel__row",e),ref:o,children:[t&&a.jsx("div",{className:"editor-post-panel__row-label",children:t}),a.jsx("div",{className:"editor-post-panel__row-control",children:n})]}));function GOe(e){const t=e.map(r=>({children:[],parent:void 0,...r}));if(t.some(({parent:r})=>r===void 0))return t;const n=t.reduce((r,s)=>{const{parent:i}=s;return r[i]||(r[i]=[]),r[i].push(s),r},{}),o=r=>r.map(s=>{const i=n[s.id];return{...s,children:i&&i.length?o(i):[]}});return o(n[0]||[])}const o3=e=>Lt(e),KOe=e=>({...e,name:o3(e.name)}),OUt=e=>(e??[]).map(KOe);function oN(e){return e?.title?.rendered?Lt(e.title.rendered):`#${e.id} (${m("no title")})`}const cne=(e,t)=>{const n=ms(e||"").toLowerCase(),o=ms(t||"").toLowerCase();return n===o?0:n.startsWith(o)?n.length:1/0};function yUt(){const{editPost:e}=Oe(_e),[t,n]=x.useState(!1),{isHierarchical:o,parentPostId:r,parentPostTitle:s,pageItems:i}=G(d=>{var p;const{getPostType:f,getEntityRecords:b,getEntityRecord:h}=d(Me),{getCurrentPostId:g,getEditedPostAttribute:z}=d(_e),A=z("type"),_=z("parent"),v=f(A),M=g(),y=(p=v?.hierarchical)!==null&&p!==void 0?p:!1,k={per_page:100,exclude:M,parent_exclude:M,orderby:"menu_order",order:"asc",_fields:"id,title,parent"};t&&(k.search=t);const S=_?h("postType",A,_):null;return{isHierarchical:y,parentPostId:_,parentPostTitle:S?oN(S):"",pageItems:y?b("postType",A,k):null}},[t]),c=x.useMemo(()=>{const d=(h,g=0)=>h.map(_=>[{value:_.id,label:"— ".repeat(g)+Lt(_.name),rawName:_.name},...d(_.children||[],g+1)]).sort(([_],[v])=>{const M=cne(_.rawName,t),y=cne(v.rawName,t);return M>=y?1:-1}).flat();if(!i)return[];let p=i.map(h=>({id:h.id,parent:h.parent,name:oN(h)}));t||(p=GOe(p));const f=d(p),b=f.find(h=>h.value===r);return s&&!b&&f.unshift({value:r,label:s}),f},[i,t,s,r]);if(!o)return null;const l=d=>{n(d)},u=d=>{e({parent:d})};return a.jsx(nb,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,className:"editor-page-attributes__parent",label:m("Parent"),help:m("Choose a parent page."),value:r,options:c,onFilterValueChange:F1(l,300),onChange:u,hideLabelFromVision:!0})}function AUt({isOpen:e,onClick:t}){const n=G(r=>{const{getEditedPostAttribute:s}=r(_e),i=s("parent");if(!i)return null;const{getEntityRecord:c}=r(Me),l=s("type");return c("postType",l,i)},[]),o=x.useMemo(()=>n?oN(n):m("None"),[n]);return a.jsx(Ce,{size:"compact",className:"editor-post-parent__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":xe(m("Change parent: %s"),o),onClick:t,children:o})}function vUt(){const e=G(r=>r(Me).getEntityRecord("root","__unstableBase")?.home,[]),[t,n]=x.useState(null),o=x.useMemo(()=>({anchor:t,placement:"left-start",offset:36,shift:!0}),[t]);return a.jsx(xs,{label:m("Parent"),ref:n,children:a.jsx(so,{popoverProps:o,className:"editor-post-parent__panel-dropdown",contentClassName:"editor-post-parent__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:r,onToggle:s})=>a.jsx(AUt,{isOpen:r,onClick:s}),renderContent:({onClose:r})=>a.jsxs("div",{className:"editor-post-parent",children:[a.jsx(Qs,{title:m("Parent"),onClose:r}),a.jsxs("div",{children:[cr(xe(m('Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %s/services/pricing.'),Ph(e).replace(/([/.])/g,"$1")),{wbr:a.jsx("wbr",{})}),a.jsx("p",{children:cr(m("They also show up as sub-items in the default navigation menu. Learn more."),{a:a.jsx(hr,{href:m("https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes")})})})]}),a.jsx(yUt,{})]})})})}const xUt="page-attributes";function wUt(){const{isEnabled:e,postType:t}=G(n=>{const{getEditedPostAttribute:o,isEditorPanelEnabled:r}=n(_e),{getPostType:s}=n(Me);return{isEnabled:r(xUt),postType:s(o("type"))}},[]);return!e||!t?null:a.jsx(vUt,{})}function _Ut(){return a.jsx(XOe,{children:a.jsx(wUt,{})})}const AT=m("Custom Template");function YOe({onClose:e}){const{defaultBlockTemplate:t,onNavigateToEntityRecord:n}=G(d=>{const{getEditorSettings:p,getCurrentTemplateId:f}=d(_e);return{defaultBlockTemplate:p().defaultBlockTemplate,onNavigateToEntityRecord:p().onNavigateToEntityRecord,getTemplateId:f}}),{createTemplate:o}=St(Oe(_e)),[r,s]=x.useState(""),[i,c]=x.useState(!1),l=()=>{s(""),e()},u=async d=>{if(d.preventDefault(),i)return;c(!0);const p=t??Ks([Ee("core/group",{tagName:"header",layout:{inherit:!0}},[Ee("core/site-title"),Ee("core/site-tagline")]),Ee("core/separator"),Ee("core/group",{tagName:"main"},[Ee("core/group",{layout:{inherit:!0}},[Ee("core/post-title")]),Ee("core/post-content",{layout:{inherit:!0}})])]),f=await o({slug:W5(r||AT),content:p,title:r||AT});c(!1),n({postId:f.id,postType:"wp_template"}),l()};return a.jsx(Zo,{title:m("Create custom template"),onRequestClose:l,focusOnMount:"firstContentElement",size:"small",children:a.jsx("form",{className:"editor-post-template__create-form",onSubmit:u,children:a.jsxs(dt,{spacing:"3",children:[a.jsx(dn,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:m("Name"),value:r,onChange:s,placeholder:AT,disabled:i,help:m('Describe the template, e.g. "Post with sidebar". A custom template can be manually applied to any post or page.')}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:l,children:m("Cancel")}),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",isBusy:i,"aria-disabled":i,children:m("Create")})]})]})})})}function ik(){return G(e=>{const{getCurrentPostId:t,getCurrentPostType:n}=e(_e);return{postId:t(),postType:n()}},[])}function ak(){const{postType:e,postId:t}=ik();return G(n=>{const{canUser:o,getEntityRecord:r,getEntityRecords:s}=n(Me),i=o("read",{kind:"root",name:"site"})?r("root","site"):void 0,c=s("postType","wp_template",{per_page:-1}),l=+t===i?.page_for_posts,u=e==="page"&&+t===i?.page_on_front&&c?.some(({slug:d})=>d==="front-page");return!l&&!u},[t,e])}function ZOe(e){return G(t=>t(Me).getEntityRecords("postType","wp_template",{per_page:-1,post_type:e}),[e])}function QOe(e){const t=JOe(),n=ak(),o=ZOe(e);return x.useMemo(()=>n&&o?.filter(r=>r.is_custom&&r.slug!==t&&!!r.content.raw),[o,t,n])}function JOe(){const{postType:e,postId:t}=ik(),n=ZOe(e),o=G(r=>r(Me).getEditedEntityRecord("postType",e,t)?.template,[e,t]);if(o)return n?.find(r=>r.slug===o)?.slug}const kUt={className:"editor-post-template__dropdown",placement:"bottom-start"};function SUt({isOpen:e,onClick:t}){const n=G(o=>{const r=o(_e).getEditedPostAttribute("template"),{supportsTemplateMode:s,availableTemplates:i}=o(_e).getEditorSettings();if(!s&&i[r])return i[r];const c=o(Me).canUser("create",{kind:"postType",name:"wp_template"})&&o(_e).getCurrentTemplateId();return c?.title||c?.slug||i?.[r]},[]);return a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary","aria-expanded":e,"aria-label":m("Template options"),onClick:t,children:n??m("Default template")})}function CUt({onClose:e}){var t,n;const o=ak(),{availableTemplates:r,fetchedTemplates:s,selectedTemplateSlug:i,canCreate:c,canEdit:l,currentTemplateId:u,onNavigateToEntityRecord:d,getEditorSettings:p}=G(_=>{const{canUser:v,getEntityRecords:M}=_(Me),y=_(_e).getEditorSettings(),k=v("create",{kind:"postType",name:"wp_template"}),S=_(_e).getCurrentTemplateId();return{availableTemplates:y.availableTemplates,fetchedTemplates:k?M("postType","wp_template",{post_type:_(_e).getCurrentPostType(),per_page:-1}):void 0,selectedTemplateSlug:_(_e).getEditedPostAttribute("template"),canCreate:o&&k&&y.supportsTemplateMode,canEdit:o&&k&&y.supportsTemplateMode&&!!S,currentTemplateId:S,onNavigateToEntityRecord:y.onNavigateToEntityRecord,getEditorSettings:_(_e).getEditorSettings}},[o]),f=x.useMemo(()=>Object.entries({...r,...Object.fromEntries((s??[]).map(({slug:_,title:v})=>[_,v.rendered]))}).map(([_,v])=>({value:_,label:v})),[r,s]),b=(t=f.find(_=>_.value===i))!==null&&t!==void 0?t:f.find(_=>!_.value),{editPost:h}=Oe(_e),{createSuccessNotice:g}=Oe(mt),[z,A]=x.useState(!1);return a.jsxs("div",{className:"editor-post-template__classic-theme-dropdown",children:[a.jsx(Qs,{title:m("Template"),help:m("Templates define the way content is displayed when viewing your site."),actions:c?[{icon:hZe,label:m("Add template"),onClick:()=>A(!0)}]:[],onClose:e}),o?a.jsx(Pn,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:!0,label:m("Template"),value:(n=b?.value)!==null&&n!==void 0?n:"",options:f,onChange:_=>h({template:_||""})}):a.jsx(A1,{status:"warning",isDismissible:!1,children:m("The posts page template cannot be changed.")}),l&&d&&a.jsx("p",{children:a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>{d({postId:u,postType:"wp_template"}),e(),g(m("Editing template. Changes made here affect all posts and pages that use the template."),{type:"snackbar",actions:[{label:m("Go back"),onClick:()=>p().onNavigateToPreviousEntityRecord()}]})},children:m("Edit template")})}),z&&a.jsx(YOe,{onClose:()=>A(!1)})]})}function qUt(){return a.jsx(so,{popoverProps:kUt,focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>a.jsx(SUt,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>a.jsx(CUt,{onClose:e})})}const{PreferenceBaseOption:RUt}=St(cp);function c2(e){const{toggleEditorPanelEnabled:t}=Oe(_e),{isChecked:n,isRemoved:o}=G(r=>{const{isEditorPanelEnabled:s,isEditorPanelRemoved:i}=r(_e);return{isChecked:s(e.panelName),isRemoved:i(e.panelName)}},[e.panelName]);return o?null:a.jsx(RUt,{isChecked:n,onChange:()=>t(e.panelName),...e})}const{Fill:TUt,Slot:EUt}=Qn("EnablePluginDocumentSettingPanelOption"),II=({label:e,panelName:t})=>a.jsx(TUt,{children:a.jsx(c2,{label:e,panelName:t})});II.Slot=EUt;const{Fill:WUt,Slot:NUt}=Qn("PluginDocumentSettingPanel"),eye=({name:e,className:t,title:n,icon:o,children:r})=>{const{name:s}=PO(),i=`${s}/${e}`,{opened:c,isEnabled:l}=G(d=>{const{isEditorPanelOpened:p,isEditorPanelEnabled:f}=d(_e);return{opened:p(i),isEnabled:f(i)}},[i]),{toggleEditorPanelOpened:u}=Oe(_e);return e===void 0&&globalThis.SCRIPT_DEBUG===!0&&zn("PluginDocumentSettingPanel requires a name property."),a.jsxs(a.Fragment,{children:[a.jsx(II,{label:n,panelName:i}),a.jsx(WUt,{children:l&&a.jsx(Qt,{className:t,title:n,icon:o,opened:c,onToggle:()=>u(i),children:r})})]})};eye.Slot=NUt;const{Fill:BUt,Slot:LUt}=Qn("PluginPostPublishPanel"),tye=({children:e,className:t,title:n,initialOpen:o=!1,icon:r})=>{const{icon:s}=PO();return a.jsx(BUt,{children:a.jsx(Qt,{className:t,initialOpen:o||!n,title:n,icon:r??s,children:e})})};tye.Slot=LUt;const{Fill:PUt,Slot:jUt}=Qn("PluginPostStatusInfo"),nye=({children:e,className:t})=>a.jsx(PUt,{children:a.jsx(a_,{className:t,children:e})});nye.Slot=jUt;const{Fill:IUt,Slot:DUt}=Qn("PluginPrePublishPanel"),oye=({children:e,className:t,title:n,initialOpen:o=!1,icon:r})=>{const{icon:s}=PO();return a.jsx(IUt,{children:a.jsx(Qt,{className:t,initialOpen:o||!n,title:n,icon:r??s,children:e})})};oye.Slot=DUt;function rN({className:e,...t}){return a.jsx(sk,{panelClassName:e,className:"editor-sidebar",scope:"core",...t})}function FUt({onClick:e}){const[t,n]=x.useState(!1),{postType:o,postId:r}=ik(),s=QOe(o),{editEntityRecord:i}=Oe(Me);if(!s?.length)return null;const c=async l=>{i("postType",o,r,{template:l.name},{undoIgnore:!0}),n(!1),e()};return a.jsxs(a.Fragment,{children:[a.jsx(Ct,{onClick:()=>n(!0),children:m("Change template")}),t&&a.jsx(Zo,{title:m("Choose a template"),onRequestClose:()=>n(!1),overlayClassName:"editor-post-template__swap-template-modal",isFullScreen:!0,children:a.jsx("div",{className:"editor-post-template__swap-template-modal-content",children:a.jsx($Ut,{postType:o,onSelect:c})})})]})}function $Ut({postType:e,onSelect:t}){const n=QOe(e),o=x.useMemo(()=>n.map(r=>({name:r.slug,blocks:Ko(r.content.raw),title:Lt(r.title.rendered),id:r.id})),[n]);return a.jsx(qa,{label:m("Templates"),blockPatterns:o,onClickPattern:t})}function VUt({onClick:e}){const t=JOe(),n=ak(),{postType:o,postId:r}=ik(),{editEntityRecord:s}=Oe(Me);return!t||!n?null:a.jsx(Ct,{onClick:()=>{s("postType",o,r,{template:""},{undoIgnore:!0}),e()},children:m("Use default template")})}function HUt({onClick:e}){const{canCreateTemplates:t}=G(s=>{const{canUser:i}=s(Me);return{canCreateTemplates:i("create",{kind:"postType",name:"wp_template"})}},[]),[n,o]=x.useState(!1),r=ak();return!t||!r?null:a.jsxs(a.Fragment,{children:[a.jsx(Ct,{onClick:()=>{o(!0)},children:m("Create new template")}),n&&a.jsx(YOe,{onClose:()=>{o(!1),e()}})]})}const UUt={className:"editor-post-template__dropdown",placement:"bottom-start"};function XUt({id:e}){const{isTemplateHidden:t,onNavigateToEntityRecord:n,getEditorSettings:o,hasGoBack:r}=G(b=>{const{getRenderingMode:h,getEditorSettings:g}=St(b(_e)),z=g();return{isTemplateHidden:h()==="post-only",onNavigateToEntityRecord:z.onNavigateToEntityRecord,getEditorSettings:g,hasGoBack:z.hasOwnProperty("onNavigateToPreviousEntityRecord")}},[]),{get:s}=G(ht),{editedRecord:i,hasResolved:c}=X5("postType","wp_template",e),{createSuccessNotice:l}=Oe(mt),{setRenderingMode:u}=Oe(_e),d=G(b=>!!b(Me).canUser("create",{kind:"postType",name:"wp_template"}),[]);if(!c)return null;const p=r?[{label:m("Go back"),onClick:()=>o().onNavigateToPreviousEntityRecord()}]:void 0,f=()=>{s("core/edit-site","welcomeGuideTemplate")||l(m("Editing template. Changes made here affect all posts and pages that use the template."),{type:"snackbar",actions:p})};return a.jsx(c0,{popoverProps:UUt,focusOnMount:!0,toggleProps:{size:"compact",variant:"tertiary",tooltipPosition:"middle left"},label:m("Template options"),text:Lt(i.title),icon:null,children:({onClose:b})=>a.jsxs(a.Fragment,{children:[a.jsxs(Cn,{children:[d&&a.jsx(Ct,{onClick:()=>{n({postId:i.id,postType:"wp_template"}),b(),f()},children:m("Edit template")}),a.jsx(FUt,{onClick:b}),a.jsx(VUt,{onClick:b}),d&&a.jsx(HUt,{onClick:b})]}),a.jsx(Cn,{children:a.jsx(Ct,{icon:t?void 0:M0,isSelected:!t,role:"menuitemcheckbox",onClick:()=>{u(t?"template-locked":"post-only")},children:m("Show template")})})]})})}function GUt(){const{templateId:e,isBlockTheme:t}=G(r=>{const{getCurrentTemplateId:s,getEditorSettings:i}=r(_e);return{templateId:s(),isBlockTheme:i().__unstableIsBlockBasedTheme}},[]),n=G(r=>{var s;const i=r(_e).getCurrentPostType();if(!r(Me).getPostType(i)?.viewable)return!1;const l=r(_e).getEditorSettings();return!!l.availableTemplates&&Object.keys(l.availableTemplates).length>0?!0:l.supportsTemplateMode&&(s=r(Me).canUser("create",{kind:"postType",name:"wp_template"}))!==null&&s!==void 0?s:!1},[]),o=G(r=>{var s;return(s=r(Me).canUser("read",{kind:"postType",name:"wp_template"}))!==null&&s!==void 0?s:!1},[]);return(!t||!o)&&n?a.jsx(xs,{label:m("Template"),children:a.jsx(qUt,{})}):t&&e?a.jsx(xs,{label:m("Template"),children:a.jsx(XUt,{id:e})}):null}const rye={_fields:"id,name",context:"view"},DI={who:"authors",per_page:100,...rye};function FI(e){const{authorId:t,authors:n,postAuthor:o}=G(s=>{const{getUser:i,getUsers:c}=s(Me),{getEditedPostAttribute:l}=s(_e),u=l("author"),d={...DI};return e&&(d.search=e,d.search_columns=["name"]),{authorId:u,authors:c(d),postAuthor:i(u,rye)}},[e]),r=x.useMemo(()=>{const s=(n??[]).map(l=>({value:l.id,label:Lt(l.name)})),i=s.findIndex(({value:l})=>o?.id===l);let c=[];return i<0&&o?c=[{value:o.id,label:Lt(o.name)}]:i<0&&!o&&(c=[{value:0,label:m("(No author)")}]),[...c,...s]},[n,o]);return{authorId:t,authorOptions:r,postAuthor:o}}function KUt(){const[e,t]=x.useState(),{editPost:n}=Oe(_e),{authorId:o,authorOptions:r}=FI(e),s=c=>{c&&n({author:c})},i=c=>{t(c)};return a.jsx(nb,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:m("Author"),options:r,value:o,onFilterValueChange:F1(i,300),onChange:s,allowReset:!1,hideLabelFromVision:!0})}function YUt(){const{editPost:e}=Oe(_e),{authorId:t,authorOptions:n}=FI(),o=r=>{const s=Number(r);e({author:s})};return a.jsx(Pn,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"post-author-selector",label:m("Author"),options:n,onChange:o,value:t,hideLabelFromVision:!0})}const ZUt=25;function QUt(){return G(t=>t(Me).getUsers(DI)?.length>=ZUt,[])?a.jsx(KUt,{}):a.jsx(YUt,{})}function JUt({children:e}){const{hasAssignAuthorAction:t,hasAuthors:n}=G(o=>{var r;const s=o(_e).getCurrentPost(),i=o(Me).getUsers(DI);return{hasAssignAuthorAction:(r=s._links?.["wp:action-assign-author"])!==null&&r!==void 0?r:!1,hasAuthors:i?.length>=1}},[]);return!t||!n?null:a.jsx(Sc,{supportKeys:"author",children:e})}function eXt({isOpen:e,onClick:t}){const{postAuthor:n}=FI(),o=Lt(n?.name)||m("(No author)");return a.jsx(Ce,{size:"compact",className:"editor-post-author__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":xe(m("Change author: %s"),o),onClick:t,children:o})}function tXt(){const[e,t]=x.useState(null),n=x.useMemo(()=>({anchor:e,placement:"left-start",offset:36,shift:!0}),[e]);return a.jsx(JUt,{children:a.jsx(xs,{label:m("Author"),ref:t,children:a.jsx(so,{popoverProps:n,contentClassName:"editor-post-author__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:o,onToggle:r})=>a.jsx(eXt,{isOpen:o,onClick:r}),renderContent:({onClose:o})=>a.jsxs("div",{className:"editor-post-author",children:[a.jsx(Qs,{title:m("Author"),onClose:o}),a.jsx(QUt,{onClose:o})]})})})})}const nXt=[{label:We("Open",'Adjective: e.g. "Comments are open"'),value:"open",description:m("Visitors can add new comments and replies.")},{label:m("Closed"),value:"closed",description:[m("Visitors cannot add new comments or replies."),m("Existing comments remain visible.")].join(" ")}];function oXt(){const e=G(o=>{var r;return(r=o(_e).getEditedPostAttribute("comment_status"))!==null&&r!==void 0?r:"open"},[]),{editPost:t}=Oe(_e),n=o=>t({comment_status:o});return a.jsx("form",{children:a.jsx(dt,{spacing:4,children:a.jsx(sb,{className:"editor-change-status__options",hideLabelFromVision:!0,label:m("Comment status"),options:nXt,onChange:n,selected:e})})})}function rXt(){const e=G(o=>{var r;return(r=o(_e).getEditedPostAttribute("ping_status"))!==null&&r!==void 0?r:"open"},[]),{editPost:t}=Oe(_e),n=()=>t({ping_status:e==="open"?"closed":"open"});return a.jsx(K0,{__nextHasNoMarginBottom:!0,label:m("Enable pingbacks & trackbacks"),checked:e==="open",onChange:n,help:a.jsx(hr,{href:m("https://wordpress.org/documentation/article/trackbacks-and-pingbacks/"),children:m("Learn more about pingbacks & trackbacks")})})}const sXt="discussion-panel";function iXt({onClose:e}){return a.jsxs("div",{className:"editor-post-discussion",children:[a.jsx(Qs,{title:m("Discussion"),onClose:e}),a.jsxs(dt,{spacing:4,children:[a.jsx(Sc,{supportKeys:"comments",children:a.jsx(oXt,{})}),a.jsx(Sc,{supportKeys:"trackbacks",children:a.jsx(rXt,{})})]})]})}function aXt({isOpen:e,onClick:t}){const{commentStatus:n,pingStatus:o,commentsSupported:r,trackbacksSupported:s}=G(c=>{var l,u;const{getEditedPostAttribute:d}=c(_e),{getPostType:p}=c(Me),f=p(d("type"));return{commentStatus:(l=d("comment_status"))!==null&&l!==void 0?l:"open",pingStatus:(u=d("ping_status"))!==null&&u!==void 0?u:"open",commentsSupported:!!f.supports.comments,trackbacksSupported:!!f.supports.trackbacks}},[]);let i;return n==="open"?o==="open"?i=We("Open",'Adjective: e.g. "Comments are open"'):i=s?m("Comments only"):We("Open",'Adjective: e.g. "Comments are open"'):o==="open"?i=m(r?"Pings only":"Pings enabled"):i=m("Closed"),a.jsx(Ce,{size:"compact",className:"editor-post-discussion__panel-toggle",variant:"tertiary","aria-label":m("Change discussion options"),"aria-expanded":e,onClick:t,children:i})}function cXt(){const{isEnabled:e}=G(r=>{const{isEditorPanelEnabled:s}=r(_e);return{isEnabled:s(sXt)}},[]),[t,n]=x.useState(null),o=x.useMemo(()=>({anchor:t,placement:"left-start",offset:36,shift:!0}),[t]);return e?a.jsx(Sc,{supportKeys:["comments","trackbacks"],children:a.jsx(xs,{label:m("Discussion"),ref:n,children:a.jsx(so,{popoverProps:o,className:"editor-post-discussion__panel-dropdown",contentClassName:"editor-post-discussion__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:r,onToggle:s})=>a.jsx(aXt,{isOpen:r,onClick:s}),renderContent:({onClose:r})=>a.jsx(iXt,{onClose:r})})})}):null}function lXt({hideLabelFromVision:e=!1,updateOnBlur:t=!1}){const{excerpt:n,shouldUseDescriptionLabel:o,usedAttribute:r}=G(d=>{const{getCurrentPostType:p,getEditedPostAttribute:f}=d(_e),b=p(),h=["wp_template","wp_template_part"].includes(b)?"description":"excerpt";return{excerpt:f(h),shouldUseDescriptionLabel:["wp_template","wp_template_part","wp_block"].includes(b),usedAttribute:h}},[]),{editPost:s}=Oe(_e),[i,c]=x.useState(Lt(n)),l=d=>{s({[r]:d})},u=m(o?"Write a description (optional)":"Write an excerpt (optional)");return a.jsx("div",{className:"editor-post-excerpt",children:a.jsx(Li,{__nextHasNoMarginBottom:!0,label:u,hideLabelFromVision:e,className:"editor-post-excerpt__textarea",onChange:t?c:l,onBlur:t?()=>l(i):void 0,value:t?i:n,help:o?m("Write a description"):a.jsx(hr,{href:m("https://wordpress.org/documentation/article/page-post-settings-sidebar/#excerpt"),children:m("Learn more about manual excerpts")})})})}function sye({children:e}){return a.jsx(Sc,{supportKeys:"excerpt",children:e})}const{Fill:uXt,Slot:dXt}=Qn("PluginPostExcerpt"),$I=({children:e,className:t})=>a.jsx(uXt,{children:a.jsx(a_,{className:t,children:e})});$I.Slot=dXt;const pXt="post-excerpt";function fXt(){return a.jsx(sye,{children:a.jsx(bXt,{})})}function bXt(){const{shouldRender:e,excerpt:t,shouldBeUsedAsDescription:n,allowEditing:o}=G(p=>{const{getCurrentPostType:f,getCurrentPostId:b,getEditedPostAttribute:h,isEditorPanelEnabled:g}=p(_e),z=f(),A=["wp_template","wp_template_part"].includes(z),_=z==="wp_block",v=A||_,M=A?"description":"excerpt",y=A&&p(Me).getEntityRecord("postType",z,b()),k=g(pXt)||v;return{excerpt:h(M),shouldRender:k,shouldBeUsedAsDescription:v,allowEditing:k&&(!v||_||y&&y.source===G3e.custom&&!y.has_theme_file&&y.is_custom)}},[]),[r,s]=x.useState(null),i=m(n?"Description":"Excerpt"),c=x.useMemo(()=>({anchor:r,"aria-label":i,headerTitle:i,placement:"left-start",offset:36,shift:!0}),[r,i]);if(!e)return!1;const l=!!t&&a.jsx(Sn,{align:"left",numberOfLines:4,truncate:o,children:Lt(t)});if(!o)return l;const u=m(n?"Add a description…":"Add an excerpt…"),d=m(n?"Edit description":"Edit excerpt");return a.jsxs(dt,{children:[l,a.jsx(so,{className:"editor-post-excerpt__dropdown",contentClassName:"editor-post-excerpt__dropdown__content",popoverProps:c,focusOnMount:!0,ref:s,renderToggle:({onToggle:p})=>a.jsx(Ce,{__next40pxDefaultSize:!0,onClick:p,variant:"link",children:l?d:u}),renderContent:({onClose:p})=>a.jsxs(a.Fragment,{children:[a.jsx(Qs,{title:i,onClose:p}),a.jsx(dt,{spacing:4,children:a.jsx($I.Slot,{children:f=>a.jsxs(a.Fragment,{children:[a.jsx(lXt,{hideLabelFromVision:!0,updateOnBlur:!0}),f]})})})]})})]})}function hXt({children:e,supportKeys:t}){const{postType:n,themeSupports:o}=G(s=>({postType:s(_e).getEditedPostAttribute("type"),themeSupports:s(Me).getThemeSupports()}),[]);return(Array.isArray(t)?t:[t]).some(s=>{var i;const c=(i=o?.[s])!==null&&i!==void 0?i:!1;return s==="post-thumbnails"&&Array.isArray(c)?c.includes(n):c})?e:null}function e5({children:e}){return a.jsx(hXt,{supportKeys:"post-thumbnails",children:a.jsx(Sc,{supportKeys:"thumbnail",children:e})})}const lne=["image"],mXt=m("Featured image"),gXt=m("Add a featured image"),MXt=a.jsx("p",{children:m("To edit the featured image, you need permission to upload media.")});function zXt(e,t){var n,o;if(!e)return{};const r=gr("editor.PostFeaturedImage.imageSize","large",e.id,t);if(r in((n=e?.media_details?.sizes)!==null&&n!==void 0?n:{}))return{mediaWidth:e.media_details.sizes[r].width,mediaHeight:e.media_details.sizes[r].height,mediaSourceUrl:e.media_details.sizes[r].source_url};const s=gr("editor.PostFeaturedImage.imageSize","thumbnail",e.id,t);return s in((o=e?.media_details?.sizes)!==null&&o!==void 0?o:{})?{mediaWidth:e.media_details.sizes[s].width,mediaHeight:e.media_details.sizes[s].height,mediaSourceUrl:e.media_details.sizes[s].source_url}:{mediaWidth:e.media_details.width,mediaHeight:e.media_details.height,mediaSourceUrl:e.source_url}}function OXt({currentPostId:e,featuredImageId:t,onUpdateImage:n,onRemoveImage:o,media:r,postType:s,noticeUI:i,noticeOperations:c,isRequestingFeaturedImageMedia:l}){const u=x.useRef(!1),[d,p]=x.useState(!1),{getSettings:f}=G(J),{mediaSourceUrl:b}=zXt(r,e);function h(_){f().mediaUpload({allowedTypes:lne,filesList:_,onFileChange([v]){if(Wr(v?.url)){p(!0);return}v&&n(v),p(!1)},onError(v){c.removeAllNotices(),c.createErrorNotice(v)}})}function g(_){return _.alt_text?xe(m("Current image: %s"),_.alt_text):xe(m("The current image has no alternative text. The file name is: %s"),_.media_details.sizes?.full?.file||_.slug)}function z(_){u.current&&_&&(_.focus(),u.current=!1)}const A=!l&&!!t&&!r;return a.jsxs(e5,{children:[i,a.jsxs("div",{className:"editor-post-featured-image",children:[r&&a.jsx("div",{id:`editor-post-featured-image-${t}-describedby`,className:"hidden",children:g(r)}),a.jsx(Hd,{fallback:MXt,children:a.jsx(ab,{title:s?.labels?.featured_image||mXt,onSelect:n,unstableFeaturedImageFlow:!0,allowedTypes:lne,modalClass:"editor-post-featured-image__media-modal",render:({open:_})=>a.jsxs("div",{className:"editor-post-featured-image__container",children:[A?a.jsx(A1,{status:"warning",isDismissible:!1,children:m("Could not retrieve the featured image data.")}):a.jsxs(Ce,{__next40pxDefaultSize:!0,ref:z,className:t?"editor-post-featured-image__preview":"editor-post-featured-image__toggle",onClick:_,"aria-label":t?m("Edit or replace the featured image"):null,"aria-describedby":t?`editor-post-featured-image-${t}-describedby`:null,"aria-haspopup":"dialog",disabled:d,accessibleWhenDisabled:!0,children:[!!t&&r&&a.jsx("img",{className:"editor-post-featured-image__preview-image",src:b,alt:g(r)}),(d||l)&&a.jsx(Xn,{}),!t&&!d&&(s?.labels?.set_featured_image||gXt)]}),!!t&&a.jsxs(Ot,{className:oe("editor-post-featured-image__actions",{"editor-post-featured-image__actions-missing-image":A,"editor-post-featured-image__actions-is-requesting-image":l}),children:[a.jsx(Ce,{__next40pxDefaultSize:!0,className:"editor-post-featured-image__action",onClick:_,"aria-haspopup":"dialog",variant:A?"secondary":void 0,children:m("Replace")}),a.jsx(Ce,{__next40pxDefaultSize:!0,className:"editor-post-featured-image__action",onClick:()=>{o(),u.current=!0},variant:A?"secondary":void 0,isDestructive:A,children:m("Remove")})]}),a.jsx(Tz,{onFilesDrop:h})]}),value:t})})]})]})}const yXt=Ul(e=>{const{getMedia:t,getPostType:n,hasFinishedResolution:o}=e(Me),{getCurrentPostId:r,getEditedPostAttribute:s}=e(_e),i=s("featured_media");return{media:i?t(i,{context:"view"}):null,currentPostId:r(),postType:n(s("type")),featuredImageId:i,isRequestingFeaturedImageMedia:!!i&&!o("getMedia",[i,{context:"view"}])}}),AXt=jf((e,{noticeOperations:t},{select:n})=>{const{editPost:o}=e(_e);return{onUpdateImage(r){o({featured_media:r.id})},onDropImage(r){n(J).getSettings().mediaUpload({allowedTypes:["image"],filesList:r,onFileChange([s]){o({featured_media:s.id})},onError(s){t.removeAllNotices(),t.createErrorNotice(s)}})},onRemoveImage(){o({featured_media:0})}}}),une=Co(imt,yXt,AXt,ap("editor.PostFeaturedImage"))(OXt),vT="featured-image";function vXt({withPanelBody:e=!0}){var t;const{postType:n,isEnabled:o,isOpened:r}=G(i=>{const{getEditedPostAttribute:c,isEditorPanelEnabled:l,isEditorPanelOpened:u}=i(_e),{getPostType:d}=i(Me);return{postType:d(c("type")),isEnabled:l(vT),isOpened:u(vT)}},[]),{toggleEditorPanelOpened:s}=Oe(_e);return o?e?a.jsx(e5,{children:a.jsx(Qt,{title:(t=n?.labels?.featured_image)!==null&&t!==void 0?t:m("Featured image"),opened:r,onToggle:()=>s(vT),children:a.jsx(une,{})})}):a.jsx(e5,{children:a.jsx(une,{})}):null}function iye({children:e}){return G(n=>n(_e).getEditorSettings().disablePostFormats,[])?null:a.jsx(Sc,{supportKeys:"post-formats",children:e})}const VI=[{id:"aside",caption:m("Aside")},{id:"audio",caption:m("Audio")},{id:"chat",caption:m("Chat")},{id:"gallery",caption:m("Gallery")},{id:"image",caption:m("Image")},{id:"link",caption:m("Link")},{id:"quote",caption:m("Quote")},{id:"standard",caption:m("Standard")},{id:"status",caption:m("Status")},{id:"video",caption:m("Video")}].sort((e,t)=>{const n=e.caption.toUpperCase(),o=t.caption.toUpperCase();return no?1:0});function aye(){const t=`post-format-selector-${vt(aye)}`,{postFormat:n,suggestedFormat:o,supportedFormats:r}=G(u=>{const{getEditedPostAttribute:d,getSuggestedPostFormat:p}=u(_e),f=d("format"),b=u(Me).getThemeSupports();return{postFormat:f??"standard",suggestedFormat:p(),supportedFormats:b.formats}},[]),s=VI.filter(u=>r?.includes(u.id)||n===u.id),i=s.find(u=>u.id===o),{editPost:c}=Oe(_e),l=u=>c({format:u});return a.jsx(iye,{children:a.jsxs("div",{className:"editor-post-format",children:[a.jsx(sb,{className:"editor-post-format__options",label:m("Post Format"),selected:n,onChange:u=>l(u),id:t,options:s.map(u=>({label:u.caption,value:u.id})),hideLabelFromVision:!0}),i&&i.id!==n&&a.jsx("p",{className:"editor-post-format__suggestion",children:a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>l(i.id),children:xe(m("Apply suggested format: %s"),i.caption)})})]})})}function xXt({children:e}){const{lastRevisionId:t,revisionsCount:n}=G(o=>{const{getCurrentPostLastRevisionId:r,getCurrentPostRevisionsCount:s}=o(_e);return{lastRevisionId:r(),revisionsCount:s()}},[]);return!t||n<2?null:a.jsx(Sc,{supportKeys:"revisions",children:e})}function wXt(){return G(e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:n}=e(_e);return{lastRevisionId:t(),revisionsCount:n()}},[])}function _Xt(){const{lastRevisionId:e,revisionsCount:t}=wXt();return a.jsx(xXt,{children:a.jsx(xs,{label:m("Revisions"),children:a.jsx(Ce,{href:tn("revision.php",{revision:e}),className:"editor-private-post-last-revision__button",text:t,variant:"tertiary",size:"compact"})})})}function kXt(e){let t=M1(a.jsxs("div",{className:"editor-post-preview-button__interstitial-message",children:[a.jsxs(ge,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 96 96",children:[a.jsx(he,{className:"outer",d:"M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36",fill:"none"}),a.jsx(he,{className:"inner",d:"M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z",fill:"none"})]}),a.jsx("p",{children:m("Generating preview…")})]}));t+=` - `,t=gr("editor.PostPreview.interstitialMarkup",t),e.write(t),e.title=m("Generating preview…"),e.close()}function cye({className:e,textContent:t,forceIsAutosaveable:n,role:o,onPreview:r}){const{postId:s,currentPostLink:i,previewLink:c,isSaveable:l,isViewable:u}=G(h=>{var g;const z=h(_e),v=(g=h(Me).getPostType(z.getCurrentPostType("type"))?.viewable)!==null&&g!==void 0?g:!1;return v?{postId:z.getCurrentPostId(),currentPostLink:z.getCurrentPostAttribute("link"),previewLink:z.getEditedPostPreviewLink(),isSaveable:z.isEditedPostSaveable(),isViewable:v}:{isViewable:v}},[]),{__unstableSaveForPreview:d}=Oe(_e);if(!u)return null;const p=`wp-preview-${s}`,f=async h=>{h.preventDefault();const g=window.open("",p);g.focus(),kXt(g.document);const z=await d({forceIsAutosaveable:n});g.location=z,r?.()},b=c||i;return a.jsx(Ce,{variant:e?void 0:"tertiary",className:e||"editor-post-preview",href:b,target:p,accessibleWhenDisabled:!0,disabled:!l,onClick:f,role:o,size:"compact",children:t||a.jsxs(a.Fragment,{children:[We("Preview","imperative verb"),a.jsx(qn,{as:"span",children:m("(opens in a new tab)")})]})})}function SXt(){const e=Yn("medium","<"),{isPublished:t,isBeingScheduled:n,isSaving:o,isPublishing:r,hasPublishAction:s,isAutosaving:i,hasNonPostEntityChanges:c,postStatusHasChanged:l,postStatus:u}=G(d=>{var p;const{isCurrentPostPublished:f,isEditedPostBeingScheduled:b,isSavingPost:h,isPublishingPost:g,getCurrentPost:z,getCurrentPostType:A,isAutosavingPost:_,getPostEdits:v,getEditedPostAttribute:M}=d(_e);return{isPublished:f(),isBeingScheduled:b(),isSaving:h(),isPublishing:g(),hasPublishAction:(p=z()._links?.["wp:action-publish"])!==null&&p!==void 0?p:!1,postType:A(),isAutosaving:_(),hasNonPostEntityChanges:d(_e).hasNonPostEntityChanges(),postStatusHasChanged:!!v()?.status,postStatus:M("status")}},[]);return r?m("Publishing…"):(t||n)&&o&&!i?m("Saving…"):s?c||t||l&&!["future","publish"].includes(u)||!l&&u==="future"?m("Save"):m(n?"Schedule":"Publish"):m(e?"Publish":"Submit for Review")}const dne=()=>{};class CXt extends x.Component{constructor(t){super(t),this.createOnClick=this.createOnClick.bind(this),this.closeEntitiesSavedStates=this.closeEntitiesSavedStates.bind(this),this.state={entitiesSavedStatesCallback:!1}}createOnClick(t){return(...n)=>{const{hasNonPostEntityChanges:o,setEntitiesSavedStatesCallback:r}=this.props;return o&&r?(this.setState({entitiesSavedStatesCallback:()=>t(...n)}),r(()=>this.closeEntitiesSavedStates),dne):t(...n)}}closeEntitiesSavedStates(t){const{postType:n,postId:o}=this.props,{entitiesSavedStatesCallback:r}=this.state;this.setState({entitiesSavedStatesCallback:!1},()=>{t&&t.some(s=>s.kind==="postType"&&s.name===n&&s.key===o)&&r()})}render(){const{forceIsDirty:t,hasPublishAction:n,isBeingScheduled:o,isOpen:r,isPostSavingLocked:s,isPublishable:i,isPublished:c,isSaveable:l,isSaving:u,isAutoSaving:d,isToggle:p,savePostStatus:f,onSubmit:b=dne,onToggle:h,visibility:g,hasNonPostEntityChanges:z,isSavingNonPostEntityChanges:A,postStatus:_,postStatusHasChanged:v}=this.props,M=(u||!l||s||!i&&!t)&&(!z||A),y=(c||u||!l||!i&&!t)&&(!z||A);let k="publish";v?k=_:n?g==="private"?k="private":o&&(k="future"):k="pending";const S=()=>{M||(b(),f(k))},C=()=>{y||h()},R={"aria-disabled":M,className:"editor-post-publish-button",isBusy:!d&&u,variant:"primary",onClick:this.createOnClick(S),"aria-haspopup":z?"dialog":void 0},T={"aria-disabled":y,"aria-expanded":r,className:"editor-post-publish-panel__toggle",isBusy:u&&c,variant:"primary",size:"compact",onClick:this.createOnClick(C),"aria-haspopup":z?"dialog":void 0},E=p?T:R;return a.jsx(a.Fragment,{children:a.jsx(Ce,{...E,className:`${E.className} editor-post-publish-button__button`,size:"compact",children:a.jsx(SXt,{})})})}}const lye=Co([Ul(e=>{var t;const{isSavingPost:n,isAutosavingPost:o,isEditedPostBeingScheduled:r,getEditedPostVisibility:s,isCurrentPostPublished:i,isEditedPostSaveable:c,isEditedPostPublishable:l,isPostSavingLocked:u,getCurrentPost:d,getCurrentPostType:p,getCurrentPostId:f,hasNonPostEntityChanges:b,isSavingNonPostEntityChanges:h,getEditedPostAttribute:g,getPostEdits:z}=e(_e);return{isSaving:n(),isAutoSaving:o(),isBeingScheduled:r(),visibility:s(),isSaveable:c(),isPostSavingLocked:u(),isPublishable:l(),isPublished:i(),hasPublishAction:(t=d()._links?.["wp:action-publish"])!==null&&t!==void 0?t:!1,postType:p(),postId:f(),postStatus:g("status"),postStatusHasChanged:z()?.status,hasNonPostEntityChanges:b(),isSavingNonPostEntityChanges:h()}}),Ff(e=>{const{editPost:t,savePost:n}=e(_e);return{savePostStatus:o=>{t({status:o},{undoIgnore:!0}),n()}}})])(CXt),Fp={public:{label:m("Public"),info:m("Visible to everyone.")},private:{label:m("Private"),info:m("Only visible to site admins and editors.")},password:{label:m("Password protected"),info:m("Only those with the password can view this post.")}};function uye({onClose:e}){const t=vt(uye),{status:n,visibility:o,password:r}=G(A=>({status:A(_e).getEditedPostAttribute("status"),visibility:A(_e).getEditedPostVisibility(),password:A(_e).getEditedPostAttribute("password")})),{editPost:s,savePost:i}=Oe(_e),[c,l]=x.useState(!!r),[u,d]=x.useState(!1),p=()=>{s({status:o==="private"?"draft":n,password:""}),l(!1)},f=()=>{d(!0)},b=()=>{s({status:"private",password:""}),l(!1),d(!1),i()},h=()=>{d(!1)},g=()=>{s({status:o==="private"?"draft":n,password:r||""}),l(!0)},z=A=>{s({password:A.target.value})};return a.jsxs("div",{className:"editor-post-visibility",children:[a.jsx(Qs,{title:m("Visibility"),help:m("Control how this post is viewed."),onClose:e}),a.jsxs("fieldset",{className:"editor-post-visibility__fieldset",children:[a.jsx(qn,{as:"legend",children:m("Visibility")}),a.jsx(xT,{instanceId:t,value:"public",label:Fp.public.label,info:Fp.public.info,checked:o==="public"&&!c,onChange:p}),a.jsx(xT,{instanceId:t,value:"private",label:Fp.private.label,info:Fp.private.info,checked:o==="private",onChange:f}),a.jsx(xT,{instanceId:t,value:"password",label:Fp.password.label,info:Fp.password.info,checked:c,onChange:g}),c&&a.jsxs("div",{className:"editor-post-visibility__password",children:[a.jsx(qn,{as:"label",htmlFor:`editor-post-visibility__password-input-${t}`,children:m("Create password")}),a.jsx("input",{className:"editor-post-visibility__password-input",id:`editor-post-visibility__password-input-${t}`,type:"text",onChange:z,value:r,placeholder:m("Use a secure password")})]})]}),a.jsx(wf,{isOpen:u,onConfirm:b,onCancel:h,confirmButtonText:m("Publish"),size:"medium",children:m("Would you like to privately publish this post now?")})]})}function xT({instanceId:e,value:t,label:n,info:o,...r}){return a.jsxs("div",{className:"editor-post-visibility__choice",children:[a.jsx("input",{type:"radio",name:`editor-post-visibility__setting-${e}`,value:t,id:`editor-post-${t}-${e}`,"aria-describedby":`editor-post-${t}-${e}-description`,className:"editor-post-visibility__radio",...r}),a.jsx("label",{htmlFor:`editor-post-${t}-${e}`,className:"editor-post-visibility__label",children:n}),a.jsx("p",{id:`editor-post-${t}-${e}-description`,className:"editor-post-visibility__info",children:o})]})}function qXt(){return RXt()}function RXt(){const e=G(t=>t(_e).getEditedPostVisibility());return Fp[e]?.label}const{PrivatePublishDateTimePicker:TXt}=St(jn);function dye(e){return a.jsx(pye,{...e,showPopoverHeaderActions:!0,isCompact:!1})}function pye({onClose:e,showPopoverHeaderActions:t,isCompact:n}){const{postDate:o,postType:r}=G(b=>({postDate:b(_e).getEditedPostAttribute("date"),postType:b(_e).getCurrentPostType()}),[]),{editPost:s}=Oe(_e),i=b=>s({date:b}),[c,l]=x.useState(Ox(new Date(o))),u=G(b=>b(Me).getEntityRecords("postType",r,{status:"publish,future",after:Ox(c).toISOString(),before:U8(c).toISOString(),exclude:[b(_e).getCurrentPostId()],per_page:100,_fields:"id,date"}),[c,r]),d=x.useMemo(()=>(u||[]).map(({date:b})=>({date:new Date(b)})),[u]),p=Sa(),f=/a(?!\\)/i.test(p.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return a.jsx(TXt,{currentDate:o,onChange:i,is12Hour:f,dateOrder:We("dmy","date order"),events:d,onMonthPreviewed:b=>l(nct(b)),onClose:e,isCompact:n,showPopoverHeaderActions:t})}function fye(e){return sN(e)}function sN({full:e=!1}={}){const{date:t,isFloating:n}=G(o=>({date:o(_e).getEditedPostAttribute("date"),isFloating:o(_e).isEditedPostDateFloating()}),[]);return e?bye(t):EXt(t,{isFloating:n})}function bye(e){const t=_f(e),n=WXt(),o=r0(We("F j, Y g:i a","post schedule full date format"),t);return jt()?`${n} ${o}`:`${o} ${n}`}function EXt(e,{isFloating:t=!1,now:n=new Date}={}){if(!e||t)return m("Immediately");if(!NXt(n))return bye(e);const o=_f(e);if(pne(o,n))return xe(m("Today at %s"),r0(We("g:i a","post schedule time format"),o));const r=new Date(n);return r.setDate(r.getDate()+1),pne(o,r)?xe(m("Tomorrow at %s"),r0(We("g:i a","post schedule time format"),o)):o.getFullYear()===n.getFullYear()?r0(We("F j g:i a","post schedule date format without year"),o):r0(We("F j, Y g:i a","post schedule full date format"),o)}function WXt(){const{timezone:e}=Sa();return e.abbr&&isNaN(Number(e.abbr))?e.abbr:`UTC${e.offset<0?"":"+"}${e.offsetFormatted}`}function NXt(e){const{timezone:t}=Sa(),n=Number(t.offset),o=-1*(e.getTimezoneOffset()/60);return n===o}function pne(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}const BXt=3,LXt={per_page:10,orderby:"count",order:"desc",hide_empty:!0,_fields:"id,name,count",context:"view"};function PXt({onSelect:e,taxonomy:t}){const{_terms:n,showTerms:o}=G(s=>{const i=s(Me).getEntityRecords("taxonomy",t.slug,LXt);return{_terms:i,showTerms:i?.length>=BXt}},[t.slug]);if(!o)return null;const r=OUt(n);return a.jsxs("div",{className:"editor-post-taxonomies__flat-term-most-used",children:[a.jsx(no.VisualLabel,{as:"h3",className:"editor-post-taxonomies__flat-term-most-used-label",children:t.labels.most_used}),a.jsx("ul",{role:"list",className:"editor-post-taxonomies__flat-term-most-used-list",children:r.map(s=>a.jsx("li",{children:a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>e(s),children:s.name})},s.id))})]})}const wT=[],hye=100,fne={per_page:hye,_fields:"id,name",context:"view"},mye=(e,t)=>o3(e).toLowerCase()===o3(t).toLowerCase(),_T=(e,t)=>e.map(n=>t.find(o=>mye(o.name,n))?.id).filter(n=>n!==void 0),jXt=({children:e,__nextHasNoMarginBottom:t})=>t?a.jsx(dt,{spacing:4,children:e}):a.jsx(x.Fragment,{children:e});function IXt({slug:e,__nextHasNoMarginBottom:t}){var n,o;const[r,s]=x.useState([]),[i,c]=x.useState(""),l=q1(c,500);t||Ke("Bottom margin styles for wp.editor.PostTaxonomiesFlatTermSelector",{since:"6.7",version:"7.0",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."});const{terms:u,termIds:d,taxonomy:p,hasAssignAction:f,hasCreateAction:b,hasResolvedTerms:h}=G(N=>{var j,I;const{getCurrentPost:P,getEditedPostAttribute:$}=N(_e),{getEntityRecords:F,getTaxonomy:X,hasFinishedResolution:Z}=N(Me),V=P(),Q=X(e),te=Q?$(Q.rest_base):wT,ee={...fne,include:te?.join(","),per_page:-1};return{hasCreateAction:Q&&(j=V._links?.["wp:action-create-"+Q.rest_base])!==null&&j!==void 0?j:!1,hasAssignAction:Q&&(I=V._links?.["wp:action-assign-"+Q.rest_base])!==null&&I!==void 0?I:!1,taxonomy:Q,termIds:te,terms:te?.length?F("taxonomy",e,ee):wT,hasResolvedTerms:Z("getEntityRecords",["taxonomy",e,ee])}},[e]),{searchResults:g}=G(N=>{const{getEntityRecords:j}=N(Me);return{searchResults:i?j("taxonomy",e,{...fne,search:i}):wT}},[i,e]);x.useEffect(()=>{if(h){const N=(u??[]).map(j=>o3(j.name));s(N)}},[u,h]);const z=x.useMemo(()=>(g??[]).map(N=>o3(N.name)),[g]),{editPost:A}=Oe(_e),{saveEntityRecord:_}=Oe(Me),{createErrorNotice:v}=Oe(mt);if(!f)return null;async function M(N){try{const j=await _("taxonomy",e,N,{throwOnError:!0});return KOe(j)}catch(j){if(j.code!=="term_exists")throw j;return{id:j.data.term_id,name:N.name}}}function y(N){A({[p.rest_base]:N})}function k(N){const j=[...u??[],...g??[]],I=N.reduce(($,F)=>($.some(X=>X.toLowerCase()===F.toLowerCase())||$.push(F),$),[]),P=I.filter($=>!j.find(F=>mye(F.name,$)));if(s(I),P.length===0){y(_T(I,j));return}b&&Promise.all(P.map($=>M({name:$}))).then($=>{const F=j.concat($);y(_T(I,F))}).catch($=>{v($.message,{type:"snackbar"}),y(_T(I,j))})}function S(N){var j;if(d.includes(N.id))return;const I=[...d,N.id],P=m(e==="post_tag"?"Tag":"Term"),$=xe(We("%s added","term"),(j=p?.labels?.singular_name)!==null&&j!==void 0?j:P);Yt($,"assertive"),y(I)}const C=(n=p?.labels?.add_new_item)!==null&&n!==void 0?n:m(e==="post_tag"?"Add new tag":"Add new Term"),R=(o=p?.labels?.singular_name)!==null&&o!==void 0?o:m(e==="post_tag"?"Tag":"Term"),T=xe(We("%s added","term"),R),E=xe(We("%s removed","term"),R),B=xe(We("Remove %s","term"),R);return a.jsxs(jXt,{__nextHasNoMarginBottom:t,children:[a.jsx(ip,{__next40pxDefaultSize:!0,value:r,suggestions:z,onChange:k,onInputChange:l,maxSuggestions:hye,label:C,messages:{added:T,removed:E,remove:B},__nextHasNoMarginBottom:t}),a.jsx(PXt,{taxonomy:p,onSelect:S})]})}const gye=ap("editor.PostTaxonomyType")(IXt),DXt=()=>{const e=[m("Suggestion:"),a.jsx("span",{className:"editor-post-publish-panel__link",children:m("Add tags")},"label")];return a.jsxs(Qt,{initialOpen:!1,title:e,children:[a.jsx("p",{children:m("Tags help users and search engines navigate your site and find your content. Add a few keywords to describe your post.")}),a.jsx(gye,{slug:"post_tag",__nextHasNoMarginBottom:!0})]})},FXt=()=>{const{hasTags:e,isPostTypeSupported:t}=G(o=>{const r=o(_e).getCurrentPostType(),s=o(Me).getTaxonomy("post_tag"),i=s?.types?.includes(r),c=s!==void 0;return{hasTags:!!(s&&o(_e).getEditedPostAttribute(s.rest_base))?.length,isPostTypeSupported:c&&i}},[]),[n]=x.useState(e);return t?n?null:a.jsx(DXt,{}):null},$Xt=(e,t)=>VI.filter(o=>e?.includes(o.id)).find(o=>o.id===t),VXt=({suggestedPostFormat:e,suggestionText:t,onUpdatePostFormat:n})=>a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>n(e),children:t});function HXt(){const{currentPostFormat:e,suggestion:t}=G(s=>{var i;const{getEditedPostAttribute:c,getSuggestedPostFormat:l}=s(_e),u=(i=s(Me).getThemeSupports().formats)!==null&&i!==void 0?i:[];return{currentPostFormat:c("format"),suggestion:$Xt(u,l())}},[]),{editPost:n}=Oe(_e),o=s=>n({format:s}),r=[m("Suggestion:"),a.jsx("span",{className:"editor-post-publish-panel__link",children:m("Use a post format")},"label")];return!t||t.id===e?null:a.jsxs(Qt,{initialOpen:!1,title:r,children:[a.jsx("p",{children:m("Your theme uses post formats to highlight different kinds of content, like images or videos. Apply a post format to see this special styling.")}),a.jsx("p",{children:a.jsx(VXt,{onUpdatePostFormat:o,suggestedPostFormat:t.id,suggestionText:xe(m('Apply the "%1$s" format.'),t.caption)})})]})}const bne={per_page:-1,orderby:"name",order:"asc",_fields:"id,name,parent",context:"view"},UXt=8,hne=[];function XXt(e,t){const n=s=>t.indexOf(s.id)!==-1?!0:s.children===void 0?!1:s.children.map(n).filter(i=>i).length>0,o=(s,i)=>{const c=n(s),l=n(i);return c===l?0:c&&!l?-1:!c&&l?1:0},r=[...e];return r.sort(o),r}function GXt(e,t,n){return e.find(o=>(!o.parent&&!t||parseInt(o.parent)===parseInt(t))&&o.name.toLowerCase()===n.toLowerCase())}function KXt(e){const t=n=>{if(e==="")return n;const o={...n};return o.children.length>0&&(o.children=o.children.map(t).filter(r=>r)),o.name.toLowerCase().indexOf(e.toLowerCase())!==-1||o.children.length>0?o:!1};return t}function YXt({slug:e}){var t,n;const[o,r]=x.useState(!1),[s,i]=x.useState(""),[c,l]=x.useState(""),[u,d]=x.useState(!1),[p,f]=x.useState(""),[b,h]=x.useState([]),g=q1(Yt,500),{hasCreateAction:z,hasAssignAction:A,terms:_,loading:v,availableTerms:M,taxonomy:y}=G(de=>{var Ae,ye;const{getCurrentPost:Ne,getEditedPostAttribute:je}=de(_e),{getTaxonomy:ie,getEntityRecords:we,isResolving:re}=de(Me),pe=ie(e),ke=Ne();return{hasCreateAction:pe&&(Ae=ke._links?.["wp:action-create-"+pe.rest_base])!==null&&Ae!==void 0?Ae:!1,hasAssignAction:pe&&(ye=ke._links?.["wp:action-assign-"+pe.rest_base])!==null&&ye!==void 0?ye:!1,terms:pe?je(pe.rest_base):hne,loading:re("getEntityRecords",["taxonomy",e,bne]),availableTerms:we("taxonomy",e,bne)||hne,taxonomy:pe}},[e]),{editPost:k}=Oe(_e),{saveEntityRecord:S}=Oe(Me),C=x.useMemo(()=>XXt(GOe(M),_),[M]),{createErrorNotice:R}=Oe(mt);if(!A)return null;const T=de=>S("taxonomy",e,de,{throwOnError:!0}),E=de=>{k({[y.rest_base]:de})},B=de=>{const ye=_.includes(de)?_.filter(Ne=>Ne!==de):[..._,de];E(ye)},N=de=>{i(de)},j=de=>{l(de)},I=()=>{d(!u)},P=async de=>{var Ae;if(de.preventDefault(),s===""||o)return;const ye=GXt(M,c,s);if(ye){_.some(we=>we===ye.id)||E([..._,ye.id]),i(""),l("");return}r(!0);let Ne;try{Ne=await T({name:s,parent:c||void 0})}catch(we){R(we.message,{type:"snackbar"});return}const je=m(e==="category"?"Category":"Term"),ie=xe(We("%s added","term"),(Ae=y?.labels?.singular_name)!==null&&Ae!==void 0?Ae:je);Yt(ie,"assertive"),r(!1),i(""),l(""),E([..._,Ne.id])},$=de=>{const Ae=C.map(KXt(de)).filter(ie=>ie),ye=ie=>{let we=0;for(let re=0;rede.map(Ae=>a.jsxs("div",{className:"editor-post-taxonomies__hierarchical-terms-choice",children:[a.jsx(K0,{__nextHasNoMarginBottom:!0,checked:_.indexOf(Ae.id)!==-1,onChange:()=>{const ye=parseInt(Ae.id,10);B(ye)},label:Lt(Ae.name)}),!!Ae.children.length&&a.jsx("div",{className:"editor-post-taxonomies__hierarchical-terms-subchoices",children:F(Ae.children)})]},Ae.id)),X=(de,Ae,ye)=>{var Ne;return(Ne=y?.labels?.[de])!==null&&Ne!==void 0?Ne:e==="category"?Ae:ye},Z=X("add_new_item",m("Add new category"),m("Add new term")),V=X("new_item_name",m("Add new category"),m("Add new term")),Q=X("parent_item",m("Parent Category"),m("Parent Term")),te=`— ${Q} —`,ee=Z,ue=(t=y?.labels?.search_items)!==null&&t!==void 0?t:m("Search Terms"),ce=(n=y?.name)!==null&&n!==void 0?n:m("Terms"),me=M.length>=UXt;return a.jsxs(Yo,{direction:"column",gap:"4",children:[me&&a.jsx(su,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:ue,placeholder:ue,value:p,onChange:$}),a.jsx("div",{className:"editor-post-taxonomies__hierarchical-terms-list",tabIndex:"0",role:"group","aria-label":ce,children:F(p!==""?b:C)}),!v&&z&&a.jsx(Tn,{children:a.jsx(Ce,{__next40pxDefaultSize:!0,onClick:I,className:"editor-post-taxonomies__hierarchical-terms-add","aria-expanded":u,variant:"link",children:Z})}),u&&a.jsx("form",{onSubmit:P,children:a.jsxs(Yo,{direction:"column",gap:"4",children:[a.jsx(dn,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"editor-post-taxonomies__hierarchical-terms-input",label:V,value:s,onChange:N,required:!0}),!!M.length&&a.jsx(Lj,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:Q,noOptionLabel:te,onChange:j,selectedId:c,tree:C}),a.jsx(Tn,{children:a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"secondary",type:"submit",className:"editor-post-taxonomies__hierarchical-terms-submit",children:ee})})]})})]})}const Mye=ap("editor.PostTaxonomyType")(YXt);function ZXt(){const e=G(r=>{const s=r(_e).getCurrentPostType(),{canUser:i,getEntityRecord:c,getTaxonomy:l}=r(Me),u=l("category"),d=i("read",{kind:"root",name:"site"})?c("root","site")?.default_category:void 0,p=d?c("taxonomy","category",d):void 0,f=u&&u.types.some(h=>h===s),b=u&&r(_e).getEditedPostAttribute(u.rest_base);return!!u&&!!p&&f&&(b?.length===0||b?.length===1&&p?.id===b[0])},[]),[t,n]=x.useState(!1);if(x.useEffect(()=>{e&&n(!0)},[e]),!t)return null;const o=[m("Suggestion:"),a.jsx("span",{className:"editor-post-publish-panel__link",children:m("Assign a category")},"label")];return a.jsxs(Qt,{initialOpen:!1,title:o,children:[a.jsx("p",{children:m("Categories provide a helpful way to group related posts together and to quickly tell readers what a post is about.")}),a.jsx(Mye,{slug:"category"})]})}function QXt(e){const t=new Set;return Object.fromEntries(e.map(n=>{const o=If(n);let r="";if(o){const s=o.split(".");s.length>1&&s.pop(),r=s.join(".")}return r||(r=Is()),t.has(r)&&(r=`${r}-${Is()}`),t.add(r),[n,r]}))}function JXt(e){return Object.fromEntries(Object.entries(QXt(e)).map(([t,n])=>{const o=window.fetch(t.includes("?")?t:t+"?").then(r=>r.blob()).then(r=>new File([r],`${n}.png`,{type:r.type}));return[t,o]}))}function zye(e){const t=[];return e.forEach(n=>{t.push(n),t.push(...zye(n.innerBlocks))}),t}function eGt(e){if(e.name==="core/image"||e.name==="core/cover")return e.attributes.url&&!e.attributes.id;if(e.name==="core/media-text")return e.attributes.mediaUrl&&!e.attributes.mediaId}function kT(e){if(e.name==="core/image"||e.name==="core/cover"){const{url:t,alt:n,id:o}=e.attributes;return{url:t,alt:n,id:o}}if(e.name==="core/media-text"){const{mediaUrl:t,mediaAlt:n,mediaId:o}=e.attributes;return{url:t,alt:n,id:o}}return{}}function tGt({clientId:e,alt:t,url:n}){const{selectBlock:o}=Oe(J);return a.jsx(Rr.img,{tabIndex:0,role:"button","aria-label":m("Select image block."),onClick:()=>{o(e)},onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(o(e),r.preventDefault())},alt:t,src:n,animate:{opacity:1},exit:{opacity:0,scale:0},style:{width:"32px",height:"32px",objectFit:"cover",borderRadius:"2px",cursor:"pointer"},whileHover:{scale:1.08}},e)}function nGt(){const[e,t]=x.useState(!1),[n,o]=x.useState(!1),[r,s]=x.useState(!1),{editorBlocks:i,mediaUpload:c}=G(b=>({editorBlocks:b(J).getBlocks(),mediaUpload:b(J).getSettings().mediaUpload}),[]),l=zye(i).filter(b=>eGt(b)),{updateBlockAttributes:u}=Oe(J);if(!c||!l.length)return null;const d=[m("Suggestion:"),a.jsx("span",{className:"editor-post-publish-panel__link",children:m("External media")},"label")];function p(b,h){(b.name==="core/image"||b.name==="core/cover")&&u(b.clientId,{id:h.id,url:h.url}),b.name==="core/media-text"&&u(b.clientId,{mediaId:h.id,mediaUrl:h.url})}function f(){t(!0),s(!1);const b=new Set(l.map(g=>{const{url:z}=kT(g);return z})),h=Object.fromEntries(Object.entries(JXt([...b])).map(([g,z])=>{const A=z.then(_=>new Promise((v,M)=>{c({filesList:[_],onFileChange:([y])=>{Nr(y.url)||v(y)},onError(){M()}})}));return[g,A]}));Promise.allSettled(l.map(g=>{const{url:z}=kT(g);return h[z].then(A=>p(g,A)).then(()=>o(!0)).catch(()=>s(!0))})).finally(()=>{t(!1)})}return a.jsxs(Qt,{initialOpen:!0,title:d,children:[a.jsx("p",{children:m("Upload external images to the Media Library. Images from different domains may load slowly, display incorrectly, or be removed unexpectedly.")}),a.jsxs("div",{style:{display:"inline-flex",flexWrap:"wrap",gap:"8px"},children:[a.jsx(Wd,{onExitComplete:()=>o(!1),children:l.map(b=>{const{url:h,alt:g}=kT(b);return a.jsx(tGt,{clientId:b.clientId,url:h,alt:g},b.clientId)})}),e||n?a.jsx(Xn,{}):a.jsx(Ce,{size:"compact",variant:"primary",onClick:f,children:We("Upload","verb")})]}),r&&a.jsx("p",{children:m("Upload failed, try again.")})]})}function oGt({children:e}){const{isBeingScheduled:t,isRequestingSiteIcon:n,hasPublishAction:o,siteIconUrl:r,siteTitle:s,siteHome:i}=G(d=>{var p;const{getCurrentPost:f,isEditedPostBeingScheduled:b}=d(_e),{getEntityRecord:h,isResolving:g}=d(Me),z=h("root","__unstableBase",void 0)||{};return{hasPublishAction:(p=f()._links?.["wp:action-publish"])!==null&&p!==void 0?p:!1,isBeingScheduled:b(),isRequestingSiteIcon:g("getEntityRecord",["root","__unstableBase",void 0]),siteIconUrl:z.site_icon_url,siteTitle:z.name,siteHome:z.home&&Ph(z.home)}},[]);let c=a.jsx(qo,{className:"components-site-icon",size:"36px",icon:dJe});r&&(c=a.jsx("img",{alt:m("Site Icon"),className:"components-site-icon",src:r})),n&&(c=null);let l,u;return o?t?(l=m("Are you ready to schedule?"),u=m("Your work will be published at the specified date and time.")):(l=m("Are you ready to publish?"),u=m("Double-check your settings before publishing.")):(l=m("Are you ready to submit for review?"),u=m("Your work will be reviewed and then approved.")),a.jsxs("div",{className:"editor-post-publish-panel__prepublish",children:[a.jsx("div",{children:a.jsx("strong",{children:l})}),a.jsx("p",{children:u}),a.jsxs("div",{className:"components-site-card",children:[c,a.jsxs("div",{className:"components-site-info",children:[a.jsx("span",{className:"components-site-name",children:Lt(s)||m("(Untitled)")}),a.jsx("span",{className:"components-site-home",children:i})]})]}),a.jsx(nGt,{}),o&&a.jsxs(a.Fragment,{children:[a.jsx(Qt,{initialOpen:!1,title:[m("Visibility:"),a.jsx("span",{className:"editor-post-publish-panel__link",children:a.jsx(qXt,{})},"label")],children:a.jsx(uye,{})}),a.jsx(Qt,{initialOpen:!1,title:[m("Publish:"),a.jsx("span",{className:"editor-post-publish-panel__link",children:a.jsx(fye,{})},"label")],children:a.jsx(dye,{})})]}),a.jsx(HXt,{}),a.jsx(FXt,{}),a.jsx(ZXt,{}),e]})}const mne="%postname%",gne="%pagename%",rGt=e=>{const{slug:t}=e;return e.permalink_template.includes(mne)?e.permalink_template.replace(mne,t):e.permalink_template.includes(gne)?e.permalink_template.replace(gne,t):e.permalink_template};function sGt({text:e}){const[t,n]=x.useState(!1),o=x.useRef(),r=Hl(e,()=>{n(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{n(!1)},4e3)});return x.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"secondary",ref:r,children:m(t?"Copied!":"Copy")})}function iGt({focusOnMount:e,children:t}){const{post:n,postType:o,isScheduled:r}=G(f=>{const{getEditedPostAttribute:b,getCurrentPost:h,isCurrentPostScheduled:g}=f(_e),{getPostType:z}=f(Me);return{post:h(),postType:z(b("type")),isScheduled:g()}},[]),s=o?.labels?.singular_name,i=o?.labels?.view_item,c=o?.labels?.add_new_item,l=n.status==="future"?rGt(n):n.link,u=tn("post-new.php",{post_type:n.type}),d=x.useCallback(f=>{e&&f&&f.focus()},[e]),p=r?a.jsxs(a.Fragment,{children:[m("is now scheduled. It will go live on")," ",a.jsx(fye,{}),"."]}):m("is now live.");return a.jsxs("div",{className:"post-publish-panel__postpublish",children:[a.jsxs(Qt,{className:"post-publish-panel__postpublish-header",children:[a.jsx("a",{ref:d,href:l,children:Lt(n.title)||m("(no title)")})," ",p]}),a.jsxs(Qt,{children:[a.jsx("p",{className:"post-publish-panel__postpublish-subheader",children:a.jsx("strong",{children:m("What’s next?")})}),a.jsxs("div",{className:"post-publish-panel__postpublish-post-address-container",children:[a.jsx(dn,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"post-publish-panel__postpublish-post-address",readOnly:!0,label:xe(m("%s address"),s),value:Y2(l),onFocus:f=>f.target.select()}),a.jsx("div",{className:"post-publish-panel__postpublish-post-address__copy-button-wrap",children:a.jsx(sGt,{text:l})})]}),a.jsxs("div",{className:"post-publish-panel__postpublish-buttons",children:[!r&&a.jsx(Ce,{variant:"primary",href:l,__next40pxDefaultSize:!0,children:i}),a.jsx(Ce,{variant:r?"primary":"secondary",__next40pxDefaultSize:!0,href:u,children:c})]})]}),t]})}class aGt extends x.Component{constructor(){super(...arguments),this.onSubmit=this.onSubmit.bind(this),this.cancelButtonNode=x.createRef()}componentDidMount(){this.timeoutID=setTimeout(()=>{this.cancelButtonNode.current.focus()},0)}componentWillUnmount(){clearTimeout(this.timeoutID)}componentDidUpdate(t){(t.isPublished&&!this.props.isSaving&&this.props.isDirty||this.props.currentPostId!==t.currentPostId)&&this.props.onClose()}onSubmit(){const{onClose:t,hasPublishAction:n,isPostTypeViewable:o}=this.props;(!n||!o)&&t()}render(){const{forceIsDirty:t,isBeingScheduled:n,isPublished:o,isPublishSidebarEnabled:r,isScheduled:s,isSaving:i,isSavingNonPostEntityChanges:c,onClose:l,onTogglePublishSidebar:u,PostPublishExtension:d,PrePublishExtension:p,currentPostId:f,...b}=this.props,{hasPublishAction:h,isDirty:g,isPostTypeViewable:z,...A}=b,_=o||s&&n,v=!_&&!i,M=_&&!i;return a.jsxs("div",{className:"editor-post-publish-panel",...A,children:[a.jsx("div",{className:"editor-post-publish-panel__header",children:M?a.jsx(Ce,{size:"compact",onClick:l,icon:rp,label:m("Close panel")}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"editor-post-publish-panel__header-cancel-button",children:a.jsx(Ce,{ref:this.cancelButtonNode,accessibleWhenDisabled:!0,disabled:c,onClick:l,variant:"secondary",size:"compact",children:m("Cancel")})}),a.jsx("div",{className:"editor-post-publish-panel__header-publish-button",children:a.jsx(lye,{onSubmit:this.onSubmit,forceIsDirty:t})})]})}),a.jsxs("div",{className:"editor-post-publish-panel__content",children:[v&&a.jsx(oGt,{children:p&&a.jsx(p,{})}),M&&a.jsx(iGt,{focusOnMount:!0,children:d&&a.jsx(d,{})}),i&&a.jsx(Xn,{})]}),a.jsx("div",{className:"editor-post-publish-panel__footer",children:a.jsx(K0,{__nextHasNoMarginBottom:!0,label:m("Always show pre-publish checks."),checked:r,onChange:u})})]})}}const cGt=Co([Ul(e=>{var t;const{getPostType:n}=e(Me),{getCurrentPost:o,getCurrentPostId:r,getEditedPostAttribute:s,isCurrentPostPublished:i,isCurrentPostScheduled:c,isEditedPostBeingScheduled:l,isEditedPostDirty:u,isAutosavingPost:d,isSavingPost:p,isSavingNonPostEntityChanges:f}=e(_e),{isPublishSidebarEnabled:b}=e(_e),h=n(s("type"));return{hasPublishAction:(t=o()._links?.["wp:action-publish"])!==null&&t!==void 0?t:!1,isPostTypeViewable:h?.viewable,isBeingScheduled:l(),isDirty:u(),isPublished:i(),isPublishSidebarEnabled:b(),isSaving:p()&&!d(),isSavingNonPostEntityChanges:f(),isScheduled:c(),currentPostId:r()}}),Ff((e,{isPublishSidebarEnabled:t})=>{const{disablePublishSidebar:n,enablePublishSidebar:o}=e(_e);return{onTogglePublishSidebar:()=>{t?n():o()}}}),smt,nmt])(aGt);function lGt({children:e}){const{hasStickyAction:t,postType:n}=G(o=>{var r;return{hasStickyAction:(r=o(_e).getCurrentPost()._links?.["wp:action-sticky"])!==null&&r!==void 0?r:!1,postType:o(_e).getCurrentPostType()}},[]);return n!=="post"||!t?null:e}function uGt(){const e=G(n=>{var o;return(o=n(_e).getEditedPostAttribute("sticky"))!==null&&o!==void 0?o:!1},[]),{editPost:t}=Oe(_e);return a.jsx(lGt,{children:a.jsx(K0,{className:"editor-post-sticky__checkbox-control",label:m("Sticky"),help:m("Pin this post to the top of the blog"),checked:e,onChange:()=>t({sticky:!e}),__nextHasNoMarginBottom:!0})})}const xv={"auto-draft":{label:m("Draft"),icon:E8},draft:{label:m("Draft"),icon:E8},pending:{label:m("Pending"),icon:gde},private:{label:m("Private"),icon:bde},future:{label:m("Scheduled"),icon:Nde},publish:{label:m("Published"),icon:Lw}},Oye=[{label:m("Draft"),value:"draft",description:m("Not ready to publish.")},{label:m("Pending"),value:"pending",description:m("Waiting for review before publishing.")},{label:m("Private"),value:"private",description:m("Only visible to site admins and editors.")},{label:m("Scheduled"),value:"future",description:m("Publish automatically on a chosen date.")},{label:m("Published"),value:"publish",description:m("Visible to everyone.")}],dGt=[L0,Di,$l,Wf];function yye(){const{status:e,date:t,password:n,postId:o,postType:r,canEdit:s}=G(z=>{var A;const{getEditedPostAttribute:_,getCurrentPostId:v,getCurrentPostType:M,getCurrentPost:y}=z(_e);return{status:_("status"),date:_("date"),password:_("password"),postId:v(),postType:M(),canEdit:(A=y()._links?.["wp:action-publish"])!==null&&A!==void 0?A:!1}},[]),[i,c]=x.useState(!!n),l=vt(yye,"editor-change-status__password-input"),{editEntityRecord:u}=Oe(Me),[d,p]=x.useState(null),f=x.useMemo(()=>({anchor:d,"aria-label":m("Status & visibility"),headerTitle:m("Status & visibility"),placement:"left-start",offset:36,shift:!0}),[d]);if(dGt.includes(r))return null;const b=({status:z=e,password:A=n,date:_=t})=>{u("postType",r,o,{status:z,date:_,password:A})},h=z=>{c(z),z||b({password:""})},g=z=>{let A=t,_=n;e==="future"&&new Date(t)>new Date&&(A=null),z==="private"&&n&&(_=""),b({status:z,date:A,password:_})};return a.jsx(xs,{label:m("Status"),ref:p,children:s?a.jsx(so,{className:"editor-post-status",contentClassName:"editor-change-status__content",popoverProps:f,focusOnMount:!0,renderToggle:({onToggle:z,isOpen:A})=>a.jsx(Ce,{className:"editor-post-status__toggle",variant:"tertiary",size:"compact",onClick:z,icon:xv[e]?.icon,"aria-label":xe(m("Change status: %s"),xv[e]?.label),"aria-expanded":A,children:xv[e]?.label}),renderContent:({onClose:z})=>a.jsxs(a.Fragment,{children:[a.jsx(Qs,{title:m("Status & visibility"),onClose:z}),a.jsx("form",{children:a.jsxs(dt,{spacing:4,children:[a.jsx(sb,{className:"editor-change-status__options",hideLabelFromVision:!0,label:m("Status"),options:Oye,onChange:g,selected:e==="auto-draft"?"draft":e}),e==="future"&&a.jsx("div",{className:"editor-change-status__publish-date-wrapper",children:a.jsx(pye,{showPopoverHeaderActions:!1,isCompact:!0})}),e!=="private"&&a.jsxs(dt,{as:"fieldset",spacing:4,className:"editor-change-status__password-fieldset",children:[a.jsx(K0,{__nextHasNoMarginBottom:!0,label:m("Password protected"),help:m("Only visible to those who know the password"),checked:i,onChange:h}),i&&a.jsx("div",{className:"editor-change-status__password-input",children:a.jsx(dn,{label:m("Password"),onChange:A=>b({password:A}),value:n,placeholder:m("Use a secure password"),type:"text",id:l,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,maxLength:255})})]}),a.jsx(uGt,{})]})})]})}):a.jsx("div",{className:"editor-post-status is-read-only",children:xv[e]?.label})})}function pGt({forceIsDirty:e}){const[t,n]=x.useState(!1),o=Yn("small"),{isAutosaving:r,isDirty:s,isNew:i,isPublished:c,isSaveable:l,isSaving:u,isScheduled:d,hasPublishAction:p,showIconLabels:f,postStatus:b,postStatusHasChanged:h}=G(R=>{var T;const{isEditedPostNew:E,isCurrentPostPublished:B,isCurrentPostScheduled:N,isEditedPostDirty:j,isSavingPost:I,isEditedPostSaveable:P,getCurrentPost:$,isAutosavingPost:F,getEditedPostAttribute:X,getPostEdits:Z}=R(_e),{get:V}=R(ht);return{isAutosaving:F(),isDirty:e||j(),isNew:E(),isPublished:B(),isSaving:I(),isSaveable:P(),isScheduled:N(),hasPublishAction:(T=$()?._links?.["wp:action-publish"])!==null&&T!==void 0?T:!1,showIconLabels:V("core","showIconLabels"),postStatus:X("status"),postStatusHasChanged:!!Z()?.status}},[e]),g=b==="pending",{savePost:z}=Oe(_e),A=Fr(u);if(x.useEffect(()=>{let R;return A&&!u&&(n(!0),R=setTimeout(()=>{n(!1)},1e3)),()=>clearTimeout(R)},[u]),!p&&g)return null;const _=!["pending","draft","auto-draft"].includes(b)&&Oye.map(({value:R})=>R).includes(b);if(c||d||_||h&&["pending","draft"].includes(b))return null;const v=m(g?"Save as pending":"Save draft"),M=m("Save"),y=t||!i&&!s,k=u||y,S=u||y||!l;let C;return u?C=m(r?"Autosaving":"Saving"):y?C=m("Saved"):o?C=v:f&&(C=M),a.jsxs(Ce,{className:l||u?oe({"editor-post-save-draft":!k,"editor-post-saved-state":k,"is-saving":u,"is-autosaving":r,"is-saved":y,[hle({type:"loading"})]:u}):void 0,onClick:S?void 0:()=>z(),shortcut:S?void 0:j1.primary("s"),variant:"tertiary",size:"compact",icon:o?void 0:xZe,label:C||v,"aria-disabled":S,children:[k&&a.jsx(wn,{icon:y?M0:wZe}),C]})}function fGt({children:e}){return G(n=>{var o;return(o=n(_e).getCurrentPost()._links?.["wp:action-publish"])!==null&&o!==void 0?o:!1},[])?e:null}const bGt=[L0,Di,$l,Wf];function hGt(){const[e,t]=x.useState(null),n=G(i=>i(_e).getCurrentPostType(),[]),o=x.useMemo(()=>({anchor:e,"aria-label":m("Change publish date"),placement:"left-start",offset:36,shift:!0}),[e]),r=sN(),s=sN({full:!0});return bGt.includes(n)?null:a.jsx(fGt,{children:a.jsx(xs,{label:m("Publish"),ref:t,children:a.jsx(so,{popoverProps:o,focusOnMount:!0,className:"editor-post-schedule__panel-dropdown",contentClassName:"editor-post-schedule__dialog",renderToggle:({onToggle:i,isOpen:c})=>a.jsx(Ce,{size:"compact",className:"editor-post-schedule__dialog-toggle",variant:"tertiary",tooltipPosition:"middle left",onClick:i,"aria-label":xe(m("Change date: %s"),r),label:s,showTooltip:r!==s,"aria-expanded":c,children:r}),renderContent:({onClose:i})=>a.jsx(dye,{onClose:i})})})})}function mGt(){const{syncStatus:e,postType:t}=G(n=>{const{getEditedPostAttribute:o}=n(_e);return{syncStatus:o("meta")?.wp_pattern_sync_status==="unsynced"?"unsynced":o("wp_pattern_sync_status"),postType:o("type")}});return t!=="wp_block"?null:a.jsx(xs,{label:m("Sync status"),children:a.jsx("div",{className:"editor-post-sync-status__value",children:We(e==="unsynced"?"Not synced":"Synced","pattern (singular)")})})}const gGt=e=>e;function Aye({taxonomyWrapper:e=gGt}){const{postType:t,taxonomies:n}=G(r=>({postType:r(_e).getCurrentPostType(),taxonomies:r(Me).getTaxonomies({per_page:-1})}),[]);return(n??[]).filter(r=>r.types.includes(t)&&r.visibility?.show_ui).map(r=>{const s=r.hierarchical?Mye:gye,i={slug:r.slug,...r.hierarchical?{}:{__nextHasNoMarginBottom:!0}};return a.jsx(x.Fragment,{children:e(a.jsx(s,{...i}),r)},`taxonomy-${r.slug}`)})}function MGt({children:e}){return G(n=>{const o=n(_e).getCurrentPostType();return n(Me).getTaxonomies({per_page:-1})?.some(s=>s.types.includes(o))},[])?e:null}function zGt({taxonomy:e,children:t}){const n=e?.slug,o=n?`taxonomy-panel-${n}`:"",{isEnabled:r,isOpened:s}=G(l=>{const{isEditorPanelEnabled:u,isEditorPanelOpened:d}=l(_e);return{isEnabled:n?u(o):!1,isOpened:n?d(o):!1}},[o,n]),{toggleEditorPanelOpened:i}=Oe(_e);if(!r)return null;const c=e?.labels?.menu_name;return c?a.jsx(Qt,{title:c,opened:s,onToggle:()=>i(o),children:t}):null}function OGt(){return a.jsx(MGt,{children:a.jsx(Aye,{taxonomyWrapper:(e,t)=>a.jsx(zGt,{taxonomy:t,children:e})})})}function HI(){const e=vt(HI),{content:t,blocks:n,type:o,id:r}=G(c=>{const{getEditedEntityRecord:l}=c(Me),{getCurrentPostType:u,getCurrentPostId:d}=c(_e),p=u(),f=d(),b=l("postType",p,f);return{content:b?.content,blocks:b?.blocks,type:p,id:f}},[]),{editEntityRecord:s}=Oe(Me),i=x.useMemo(()=>t instanceof Function?t({blocks:n}):n?Jd(n):t,[t,n]);return a.jsxs(a.Fragment,{children:[a.jsx(qn,{as:"label",htmlFor:`post-content-${e}`,children:m("Type text or HTML")}),a.jsx(b7,{autoComplete:"off",dir:"auto",value:i,onChange:c=>{s("postType",o,r,{content:c.target.value,blocks:void 0,selection:void 0})},className:"editor-post-text-editor",id:`post-content-${e}`,placeholder:m("Start writing with text or HTML")})]})}const vye="wp-block wp-block-post-title block-editor-block-list__block editor-post-title editor-post-title__input rich-text",xye=/[\r\n]+/g;function wye(e){const t=x.useRef(),{isCleanNewPost:n}=G(o=>{const{isCleanNewPost:r}=o(_e);return{isCleanNewPost:r()}},[]);return x.useImperativeHandle(e,()=>({focus:()=>{t?.current?.focus()}})),x.useEffect(()=>{if(!t.current)return;const{defaultView:o}=t.current.ownerDocument,{name:r,parent:s}=o,i=r==="editor-canvas"?s.document:o.document,{activeElement:c,body:l}=i;n&&(!c||l===c)&&t.current.focus()},[n]),{ref:t}}function _ye(){const{editPost:e}=Oe(_e),{title:t}=G(o=>{const{getEditedPostAttribute:r}=o(_e);return{title:r("title")}},[]);function n(o){e({title:o})}return{title:t,setTitle:n}}const yGt=x.forwardRef((e,t)=>{const{placeholder:n}=G(C=>{const{getSettings:R}=C(J),{titlePlaceholder:T}=R();return{placeholder:T}},[]),[o,r]=x.useState(!1),{ref:s}=wye(t),{title:i,setTitle:c}=_ye(),[l,u]=x.useState({}),{clearSelectedBlock:d,insertBlocks:p,insertDefaultBlock:f}=Oe(J),b=Lt(n)||m("Add title"),{value:h,onChange:g,ref:z}=e1e({value:i,onChange(C){c(C.replace(xye," "))},placeholder:b,selectionStart:l.start,selectionEnd:l.end,onSelectionChange(C,R){u(T=>{const{start:E,end:B}=T;return E===C&&B===R?T:{start:C,end:R}})},__unstableDisableFormats:!1});function A(C){p(C,0)}function _(){r(!0),d()}function v(){r(!1),u({})}function M(){f(void 0,void 0,0)}function y(C){C.keyCode===Gr&&(C.preventDefault(),M())}function k(C){const R=C.clipboardData;let T="",E="";try{T=R.getData("text/plain"),E=R.getData("text/html")}catch{return}window.console.log(`Received HTML: + `,t=gr("editor.PostPreview.interstitialMarkup",t),e.write(t),e.title=m("Generating preview…"),e.close()}function cye({className:e,textContent:t,forceIsAutosaveable:n,role:o,onPreview:r}){const{postId:s,currentPostLink:i,previewLink:c,isSaveable:l,isViewable:u}=G(h=>{var g;const z=h(_e),v=(g=h(Me).getPostType(z.getCurrentPostType("type"))?.viewable)!==null&&g!==void 0?g:!1;return v?{postId:z.getCurrentPostId(),currentPostLink:z.getCurrentPostAttribute("link"),previewLink:z.getEditedPostPreviewLink(),isSaveable:z.isEditedPostSaveable(),isViewable:v}:{isViewable:v}},[]),{__unstableSaveForPreview:d}=Oe(_e);if(!u)return null;const p=`wp-preview-${s}`,f=async h=>{h.preventDefault();const g=window.open("",p);g.focus(),kXt(g.document);const z=await d({forceIsAutosaveable:n});g.location=z,r?.()},b=c||i;return a.jsx(Ce,{variant:e?void 0:"tertiary",className:e||"editor-post-preview",href:b,target:p,accessibleWhenDisabled:!0,disabled:!l,onClick:f,role:o,size:"compact",children:t||a.jsxs(a.Fragment,{children:[We("Preview","imperative verb"),a.jsx(qn,{as:"span",children:m("(opens in a new tab)")})]})})}function SXt(){const e=Yn("medium","<"),{isPublished:t,isBeingScheduled:n,isSaving:o,isPublishing:r,hasPublishAction:s,isAutosaving:i,hasNonPostEntityChanges:c,postStatusHasChanged:l,postStatus:u}=G(d=>{var p;const{isCurrentPostPublished:f,isEditedPostBeingScheduled:b,isSavingPost:h,isPublishingPost:g,getCurrentPost:z,getCurrentPostType:A,isAutosavingPost:_,getPostEdits:v,getEditedPostAttribute:M}=d(_e);return{isPublished:f(),isBeingScheduled:b(),isSaving:h(),isPublishing:g(),hasPublishAction:(p=z()._links?.["wp:action-publish"])!==null&&p!==void 0?p:!1,postType:A(),isAutosaving:_(),hasNonPostEntityChanges:d(_e).hasNonPostEntityChanges(),postStatusHasChanged:!!v()?.status,postStatus:M("status")}},[]);return r?m("Publishing…"):(t||n)&&o&&!i?m("Saving…"):s?c||t||l&&!["future","publish"].includes(u)||!l&&u==="future"?m("Save"):m(n?"Schedule":"Publish"):m(e?"Publish":"Submit for Review")}const dne=()=>{};class CXt extends x.Component{constructor(t){super(t),this.createOnClick=this.createOnClick.bind(this),this.closeEntitiesSavedStates=this.closeEntitiesSavedStates.bind(this),this.state={entitiesSavedStatesCallback:!1}}createOnClick(t){return(...n)=>{const{hasNonPostEntityChanges:o,setEntitiesSavedStatesCallback:r}=this.props;return o&&r?(this.setState({entitiesSavedStatesCallback:()=>t(...n)}),r(()=>this.closeEntitiesSavedStates),dne):t(...n)}}closeEntitiesSavedStates(t){const{postType:n,postId:o}=this.props,{entitiesSavedStatesCallback:r}=this.state;this.setState({entitiesSavedStatesCallback:!1},()=>{t&&t.some(s=>s.kind==="postType"&&s.name===n&&s.key===o)&&r()})}render(){const{forceIsDirty:t,hasPublishAction:n,isBeingScheduled:o,isOpen:r,isPostSavingLocked:s,isPublishable:i,isPublished:c,isSaveable:l,isSaving:u,isAutoSaving:d,isToggle:p,savePostStatus:f,onSubmit:b=dne,onToggle:h,visibility:g,hasNonPostEntityChanges:z,isSavingNonPostEntityChanges:A,postStatus:_,postStatusHasChanged:v}=this.props,M=(u||!l||s||!i&&!t)&&(!z||A),y=(c||u||!l||!i&&!t)&&(!z||A);let k="publish";v?k=_:n?g==="private"?k="private":o&&(k="future"):k="pending";const S=()=>{M||(b(),f(k))},C=()=>{y||h()},R={"aria-disabled":M,className:"editor-post-publish-button",isBusy:!d&&u,variant:"primary",onClick:this.createOnClick(S),"aria-haspopup":z?"dialog":void 0},T={"aria-disabled":y,"aria-expanded":r,className:"editor-post-publish-panel__toggle",isBusy:u&&c,variant:"primary",size:"compact",onClick:this.createOnClick(C),"aria-haspopup":z?"dialog":void 0},E=p?T:R;return a.jsx(a.Fragment,{children:a.jsx(Ce,{...E,className:`${E.className} editor-post-publish-button__button`,size:"compact",children:a.jsx(SXt,{})})})}}const lye=Co([Ul(e=>{var t;const{isSavingPost:n,isAutosavingPost:o,isEditedPostBeingScheduled:r,getEditedPostVisibility:s,isCurrentPostPublished:i,isEditedPostSaveable:c,isEditedPostPublishable:l,isPostSavingLocked:u,getCurrentPost:d,getCurrentPostType:p,getCurrentPostId:f,hasNonPostEntityChanges:b,isSavingNonPostEntityChanges:h,getEditedPostAttribute:g,getPostEdits:z}=e(_e);return{isSaving:n(),isAutoSaving:o(),isBeingScheduled:r(),visibility:s(),isSaveable:c(),isPostSavingLocked:u(),isPublishable:l(),isPublished:i(),hasPublishAction:(t=d()._links?.["wp:action-publish"])!==null&&t!==void 0?t:!1,postType:p(),postId:f(),postStatus:g("status"),postStatusHasChanged:z()?.status,hasNonPostEntityChanges:b(),isSavingNonPostEntityChanges:h()}}),jf(e=>{const{editPost:t,savePost:n}=e(_e);return{savePostStatus:o=>{t({status:o},{undoIgnore:!0}),n()}}})])(CXt),Fp={public:{label:m("Public"),info:m("Visible to everyone.")},private:{label:m("Private"),info:m("Only visible to site admins and editors.")},password:{label:m("Password protected"),info:m("Only those with the password can view this post.")}};function uye({onClose:e}){const t=vt(uye),{status:n,visibility:o,password:r}=G(A=>({status:A(_e).getEditedPostAttribute("status"),visibility:A(_e).getEditedPostVisibility(),password:A(_e).getEditedPostAttribute("password")})),{editPost:s,savePost:i}=Oe(_e),[c,l]=x.useState(!!r),[u,d]=x.useState(!1),p=()=>{s({status:o==="private"?"draft":n,password:""}),l(!1)},f=()=>{d(!0)},b=()=>{s({status:"private",password:""}),l(!1),d(!1),i()},h=()=>{d(!1)},g=()=>{s({status:o==="private"?"draft":n,password:r||""}),l(!0)},z=A=>{s({password:A.target.value})};return a.jsxs("div",{className:"editor-post-visibility",children:[a.jsx(Qs,{title:m("Visibility"),help:m("Control how this post is viewed."),onClose:e}),a.jsxs("fieldset",{className:"editor-post-visibility__fieldset",children:[a.jsx(qn,{as:"legend",children:m("Visibility")}),a.jsx(xT,{instanceId:t,value:"public",label:Fp.public.label,info:Fp.public.info,checked:o==="public"&&!c,onChange:p}),a.jsx(xT,{instanceId:t,value:"private",label:Fp.private.label,info:Fp.private.info,checked:o==="private",onChange:f}),a.jsx(xT,{instanceId:t,value:"password",label:Fp.password.label,info:Fp.password.info,checked:c,onChange:g}),c&&a.jsxs("div",{className:"editor-post-visibility__password",children:[a.jsx(qn,{as:"label",htmlFor:`editor-post-visibility__password-input-${t}`,children:m("Create password")}),a.jsx("input",{className:"editor-post-visibility__password-input",id:`editor-post-visibility__password-input-${t}`,type:"text",onChange:z,value:r,placeholder:m("Use a secure password")})]})]}),a.jsx(wf,{isOpen:u,onConfirm:b,onCancel:h,confirmButtonText:m("Publish"),size:"medium",children:m("Would you like to privately publish this post now?")})]})}function xT({instanceId:e,value:t,label:n,info:o,...r}){return a.jsxs("div",{className:"editor-post-visibility__choice",children:[a.jsx("input",{type:"radio",name:`editor-post-visibility__setting-${e}`,value:t,id:`editor-post-${t}-${e}`,"aria-describedby":`editor-post-${t}-${e}-description`,className:"editor-post-visibility__radio",...r}),a.jsx("label",{htmlFor:`editor-post-${t}-${e}`,className:"editor-post-visibility__label",children:n}),a.jsx("p",{id:`editor-post-${t}-${e}-description`,className:"editor-post-visibility__info",children:o})]})}function qXt(){return RXt()}function RXt(){const e=G(t=>t(_e).getEditedPostVisibility());return Fp[e]?.label}const{PrivatePublishDateTimePicker:TXt}=St(jn);function dye(e){return a.jsx(pye,{...e,showPopoverHeaderActions:!0,isCompact:!1})}function pye({onClose:e,showPopoverHeaderActions:t,isCompact:n}){const{postDate:o,postType:r}=G(b=>({postDate:b(_e).getEditedPostAttribute("date"),postType:b(_e).getCurrentPostType()}),[]),{editPost:s}=Oe(_e),i=b=>s({date:b}),[c,l]=x.useState(Ox(new Date(o))),u=G(b=>b(Me).getEntityRecords("postType",r,{status:"publish,future",after:Ox(c).toISOString(),before:U8(c).toISOString(),exclude:[b(_e).getCurrentPostId()],per_page:100,_fields:"id,date"}),[c,r]),d=x.useMemo(()=>(u||[]).map(({date:b})=>({date:new Date(b)})),[u]),p=Sa(),f=/a(?!\\)/i.test(p.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return a.jsx(TXt,{currentDate:o,onChange:i,is12Hour:f,dateOrder:We("dmy","date order"),events:d,onMonthPreviewed:b=>l(nct(b)),onClose:e,isCompact:n,showPopoverHeaderActions:t})}function fye(e){return sN(e)}function sN({full:e=!1}={}){const{date:t,isFloating:n}=G(o=>({date:o(_e).getEditedPostAttribute("date"),isFloating:o(_e).isEditedPostDateFloating()}),[]);return e?bye(t):EXt(t,{isFloating:n})}function bye(e){const t=_f(e),n=WXt(),o=r0(We("F j, Y g:i a","post schedule full date format"),t);return jt()?`${n} ${o}`:`${o} ${n}`}function EXt(e,{isFloating:t=!1,now:n=new Date}={}){if(!e||t)return m("Immediately");if(!NXt(n))return bye(e);const o=_f(e);if(pne(o,n))return xe(m("Today at %s"),r0(We("g:i a","post schedule time format"),o));const r=new Date(n);return r.setDate(r.getDate()+1),pne(o,r)?xe(m("Tomorrow at %s"),r0(We("g:i a","post schedule time format"),o)):o.getFullYear()===n.getFullYear()?r0(We("F j g:i a","post schedule date format without year"),o):r0(We("F j, Y g:i a","post schedule full date format"),o)}function WXt(){const{timezone:e}=Sa();return e.abbr&&isNaN(Number(e.abbr))?e.abbr:`UTC${e.offset<0?"":"+"}${e.offsetFormatted}`}function NXt(e){const{timezone:t}=Sa(),n=Number(t.offset),o=-1*(e.getTimezoneOffset()/60);return n===o}function pne(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}const BXt=3,LXt={per_page:10,orderby:"count",order:"desc",hide_empty:!0,_fields:"id,name,count",context:"view"};function PXt({onSelect:e,taxonomy:t}){const{_terms:n,showTerms:o}=G(s=>{const i=s(Me).getEntityRecords("taxonomy",t.slug,LXt);return{_terms:i,showTerms:i?.length>=BXt}},[t.slug]);if(!o)return null;const r=OUt(n);return a.jsxs("div",{className:"editor-post-taxonomies__flat-term-most-used",children:[a.jsx(no.VisualLabel,{as:"h3",className:"editor-post-taxonomies__flat-term-most-used-label",children:t.labels.most_used}),a.jsx("ul",{role:"list",className:"editor-post-taxonomies__flat-term-most-used-list",children:r.map(s=>a.jsx("li",{children:a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>e(s),children:s.name})},s.id))})]})}const wT=[],hye=100,fne={per_page:hye,_fields:"id,name",context:"view"},mye=(e,t)=>o3(e).toLowerCase()===o3(t).toLowerCase(),_T=(e,t)=>e.map(n=>t.find(o=>mye(o.name,n))?.id).filter(n=>n!==void 0),jXt=({children:e,__nextHasNoMarginBottom:t})=>t?a.jsx(dt,{spacing:4,children:e}):a.jsx(x.Fragment,{children:e});function IXt({slug:e,__nextHasNoMarginBottom:t}){var n,o;const[r,s]=x.useState([]),[i,c]=x.useState(""),l=q1(c,500);t||Ke("Bottom margin styles for wp.editor.PostTaxonomiesFlatTermSelector",{since:"6.7",version:"7.0",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."});const{terms:u,termIds:d,taxonomy:p,hasAssignAction:f,hasCreateAction:b,hasResolvedTerms:h}=G(N=>{var j,I;const{getCurrentPost:P,getEditedPostAttribute:$}=N(_e),{getEntityRecords:F,getTaxonomy:X,hasFinishedResolution:Z}=N(Me),V=P(),Q=X(e),te=Q?$(Q.rest_base):wT,ee={...fne,include:te?.join(","),per_page:-1};return{hasCreateAction:Q&&(j=V._links?.["wp:action-create-"+Q.rest_base])!==null&&j!==void 0?j:!1,hasAssignAction:Q&&(I=V._links?.["wp:action-assign-"+Q.rest_base])!==null&&I!==void 0?I:!1,taxonomy:Q,termIds:te,terms:te?.length?F("taxonomy",e,ee):wT,hasResolvedTerms:Z("getEntityRecords",["taxonomy",e,ee])}},[e]),{searchResults:g}=G(N=>{const{getEntityRecords:j}=N(Me);return{searchResults:i?j("taxonomy",e,{...fne,search:i}):wT}},[i,e]);x.useEffect(()=>{if(h){const N=(u??[]).map(j=>o3(j.name));s(N)}},[u,h]);const z=x.useMemo(()=>(g??[]).map(N=>o3(N.name)),[g]),{editPost:A}=Oe(_e),{saveEntityRecord:_}=Oe(Me),{createErrorNotice:v}=Oe(mt);if(!f)return null;async function M(N){try{const j=await _("taxonomy",e,N,{throwOnError:!0});return KOe(j)}catch(j){if(j.code!=="term_exists")throw j;return{id:j.data.term_id,name:N.name}}}function y(N){A({[p.rest_base]:N})}function k(N){const j=[...u??[],...g??[]],I=N.reduce(($,F)=>($.some(X=>X.toLowerCase()===F.toLowerCase())||$.push(F),$),[]),P=I.filter($=>!j.find(F=>mye(F.name,$)));if(s(I),P.length===0){y(_T(I,j));return}b&&Promise.all(P.map($=>M({name:$}))).then($=>{const F=j.concat($);y(_T(I,F))}).catch($=>{v($.message,{type:"snackbar"}),y(_T(I,j))})}function S(N){var j;if(d.includes(N.id))return;const I=[...d,N.id],P=m(e==="post_tag"?"Tag":"Term"),$=xe(We("%s added","term"),(j=p?.labels?.singular_name)!==null&&j!==void 0?j:P);Yt($,"assertive"),y(I)}const C=(n=p?.labels?.add_new_item)!==null&&n!==void 0?n:m(e==="post_tag"?"Add new tag":"Add new Term"),R=(o=p?.labels?.singular_name)!==null&&o!==void 0?o:m(e==="post_tag"?"Tag":"Term"),T=xe(We("%s added","term"),R),E=xe(We("%s removed","term"),R),B=xe(We("Remove %s","term"),R);return a.jsxs(jXt,{__nextHasNoMarginBottom:t,children:[a.jsx(ip,{__next40pxDefaultSize:!0,value:r,suggestions:z,onChange:k,onInputChange:l,maxSuggestions:hye,label:C,messages:{added:T,removed:E,remove:B},__nextHasNoMarginBottom:t}),a.jsx(PXt,{taxonomy:p,onSelect:S})]})}const gye=ap("editor.PostTaxonomyType")(IXt),DXt=()=>{const e=[m("Suggestion:"),a.jsx("span",{className:"editor-post-publish-panel__link",children:m("Add tags")},"label")];return a.jsxs(Qt,{initialOpen:!1,title:e,children:[a.jsx("p",{children:m("Tags help users and search engines navigate your site and find your content. Add a few keywords to describe your post.")}),a.jsx(gye,{slug:"post_tag",__nextHasNoMarginBottom:!0})]})},FXt=()=>{const{hasTags:e,isPostTypeSupported:t}=G(o=>{const r=o(_e).getCurrentPostType(),s=o(Me).getTaxonomy("post_tag"),i=s?.types?.includes(r),c=s!==void 0;return{hasTags:!!(s&&o(_e).getEditedPostAttribute(s.rest_base))?.length,isPostTypeSupported:c&&i}},[]),[n]=x.useState(e);return t?n?null:a.jsx(DXt,{}):null},$Xt=(e,t)=>VI.filter(o=>e?.includes(o.id)).find(o=>o.id===t),VXt=({suggestedPostFormat:e,suggestionText:t,onUpdatePostFormat:n})=>a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>n(e),children:t});function HXt(){const{currentPostFormat:e,suggestion:t}=G(s=>{var i;const{getEditedPostAttribute:c,getSuggestedPostFormat:l}=s(_e),u=(i=s(Me).getThemeSupports().formats)!==null&&i!==void 0?i:[];return{currentPostFormat:c("format"),suggestion:$Xt(u,l())}},[]),{editPost:n}=Oe(_e),o=s=>n({format:s}),r=[m("Suggestion:"),a.jsx("span",{className:"editor-post-publish-panel__link",children:m("Use a post format")},"label")];return!t||t.id===e?null:a.jsxs(Qt,{initialOpen:!1,title:r,children:[a.jsx("p",{children:m("Your theme uses post formats to highlight different kinds of content, like images or videos. Apply a post format to see this special styling.")}),a.jsx("p",{children:a.jsx(VXt,{onUpdatePostFormat:o,suggestedPostFormat:t.id,suggestionText:xe(m('Apply the "%1$s" format.'),t.caption)})})]})}const bne={per_page:-1,orderby:"name",order:"asc",_fields:"id,name,parent",context:"view"},UXt=8,hne=[];function XXt(e,t){const n=s=>t.indexOf(s.id)!==-1?!0:s.children===void 0?!1:s.children.map(n).filter(i=>i).length>0,o=(s,i)=>{const c=n(s),l=n(i);return c===l?0:c&&!l?-1:!c&&l?1:0},r=[...e];return r.sort(o),r}function GXt(e,t,n){return e.find(o=>(!o.parent&&!t||parseInt(o.parent)===parseInt(t))&&o.name.toLowerCase()===n.toLowerCase())}function KXt(e){const t=n=>{if(e==="")return n;const o={...n};return o.children.length>0&&(o.children=o.children.map(t).filter(r=>r)),o.name.toLowerCase().indexOf(e.toLowerCase())!==-1||o.children.length>0?o:!1};return t}function YXt({slug:e}){var t,n;const[o,r]=x.useState(!1),[s,i]=x.useState(""),[c,l]=x.useState(""),[u,d]=x.useState(!1),[p,f]=x.useState(""),[b,h]=x.useState([]),g=q1(Yt,500),{hasCreateAction:z,hasAssignAction:A,terms:_,loading:v,availableTerms:M,taxonomy:y}=G(de=>{var Ae,ye;const{getCurrentPost:Ne,getEditedPostAttribute:je}=de(_e),{getTaxonomy:ie,getEntityRecords:we,isResolving:re}=de(Me),pe=ie(e),ke=Ne();return{hasCreateAction:pe&&(Ae=ke._links?.["wp:action-create-"+pe.rest_base])!==null&&Ae!==void 0?Ae:!1,hasAssignAction:pe&&(ye=ke._links?.["wp:action-assign-"+pe.rest_base])!==null&&ye!==void 0?ye:!1,terms:pe?je(pe.rest_base):hne,loading:re("getEntityRecords",["taxonomy",e,bne]),availableTerms:we("taxonomy",e,bne)||hne,taxonomy:pe}},[e]),{editPost:k}=Oe(_e),{saveEntityRecord:S}=Oe(Me),C=x.useMemo(()=>XXt(GOe(M),_),[M]),{createErrorNotice:R}=Oe(mt);if(!A)return null;const T=de=>S("taxonomy",e,de,{throwOnError:!0}),E=de=>{k({[y.rest_base]:de})},B=de=>{const ye=_.includes(de)?_.filter(Ne=>Ne!==de):[..._,de];E(ye)},N=de=>{i(de)},j=de=>{l(de)},I=()=>{d(!u)},P=async de=>{var Ae;if(de.preventDefault(),s===""||o)return;const ye=GXt(M,c,s);if(ye){_.some(we=>we===ye.id)||E([..._,ye.id]),i(""),l("");return}r(!0);let Ne;try{Ne=await T({name:s,parent:c||void 0})}catch(we){R(we.message,{type:"snackbar"});return}const je=m(e==="category"?"Category":"Term"),ie=xe(We("%s added","term"),(Ae=y?.labels?.singular_name)!==null&&Ae!==void 0?Ae:je);Yt(ie,"assertive"),r(!1),i(""),l(""),E([..._,Ne.id])},$=de=>{const Ae=C.map(KXt(de)).filter(ie=>ie),ye=ie=>{let we=0;for(let re=0;rede.map(Ae=>a.jsxs("div",{className:"editor-post-taxonomies__hierarchical-terms-choice",children:[a.jsx(K0,{__nextHasNoMarginBottom:!0,checked:_.indexOf(Ae.id)!==-1,onChange:()=>{const ye=parseInt(Ae.id,10);B(ye)},label:Lt(Ae.name)}),!!Ae.children.length&&a.jsx("div",{className:"editor-post-taxonomies__hierarchical-terms-subchoices",children:F(Ae.children)})]},Ae.id)),X=(de,Ae,ye)=>{var Ne;return(Ne=y?.labels?.[de])!==null&&Ne!==void 0?Ne:e==="category"?Ae:ye},Z=X("add_new_item",m("Add new category"),m("Add new term")),V=X("new_item_name",m("Add new category"),m("Add new term")),Q=X("parent_item",m("Parent Category"),m("Parent Term")),te=`— ${Q} —`,ee=Z,ue=(t=y?.labels?.search_items)!==null&&t!==void 0?t:m("Search Terms"),ce=(n=y?.name)!==null&&n!==void 0?n:m("Terms"),me=M.length>=UXt;return a.jsxs(Yo,{direction:"column",gap:"4",children:[me&&a.jsx(su,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:ue,placeholder:ue,value:p,onChange:$}),a.jsx("div",{className:"editor-post-taxonomies__hierarchical-terms-list",tabIndex:"0",role:"group","aria-label":ce,children:F(p!==""?b:C)}),!v&&z&&a.jsx(Tn,{children:a.jsx(Ce,{__next40pxDefaultSize:!0,onClick:I,className:"editor-post-taxonomies__hierarchical-terms-add","aria-expanded":u,variant:"link",children:Z})}),u&&a.jsx("form",{onSubmit:P,children:a.jsxs(Yo,{direction:"column",gap:"4",children:[a.jsx(dn,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"editor-post-taxonomies__hierarchical-terms-input",label:V,value:s,onChange:N,required:!0}),!!M.length&&a.jsx(Lj,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:Q,noOptionLabel:te,onChange:j,selectedId:c,tree:C}),a.jsx(Tn,{children:a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"secondary",type:"submit",className:"editor-post-taxonomies__hierarchical-terms-submit",children:ee})})]})})]})}const Mye=ap("editor.PostTaxonomyType")(YXt);function ZXt(){const e=G(r=>{const s=r(_e).getCurrentPostType(),{canUser:i,getEntityRecord:c,getTaxonomy:l}=r(Me),u=l("category"),d=i("read",{kind:"root",name:"site"})?c("root","site")?.default_category:void 0,p=d?c("taxonomy","category",d):void 0,f=u&&u.types.some(h=>h===s),b=u&&r(_e).getEditedPostAttribute(u.rest_base);return!!u&&!!p&&f&&(b?.length===0||b?.length===1&&p?.id===b[0])},[]),[t,n]=x.useState(!1);if(x.useEffect(()=>{e&&n(!0)},[e]),!t)return null;const o=[m("Suggestion:"),a.jsx("span",{className:"editor-post-publish-panel__link",children:m("Assign a category")},"label")];return a.jsxs(Qt,{initialOpen:!1,title:o,children:[a.jsx("p",{children:m("Categories provide a helpful way to group related posts together and to quickly tell readers what a post is about.")}),a.jsx(Mye,{slug:"category"})]})}function QXt(e){const t=new Set;return Object.fromEntries(e.map(n=>{const o=Ff(n);let r="";if(o){const s=o.split(".");s.length>1&&s.pop(),r=s.join(".")}return r||(r=Is()),t.has(r)&&(r=`${r}-${Is()}`),t.add(r),[n,r]}))}function JXt(e){return Object.fromEntries(Object.entries(QXt(e)).map(([t,n])=>{const o=window.fetch(t.includes("?")?t:t+"?").then(r=>r.blob()).then(r=>new File([r],`${n}.png`,{type:r.type}));return[t,o]}))}function zye(e){const t=[];return e.forEach(n=>{t.push(n),t.push(...zye(n.innerBlocks))}),t}function eGt(e){if(e.name==="core/image"||e.name==="core/cover")return e.attributes.url&&!e.attributes.id;if(e.name==="core/media-text")return e.attributes.mediaUrl&&!e.attributes.mediaId}function kT(e){if(e.name==="core/image"||e.name==="core/cover"){const{url:t,alt:n,id:o}=e.attributes;return{url:t,alt:n,id:o}}if(e.name==="core/media-text"){const{mediaUrl:t,mediaAlt:n,mediaId:o}=e.attributes;return{url:t,alt:n,id:o}}return{}}function tGt({clientId:e,alt:t,url:n}){const{selectBlock:o}=Oe(J);return a.jsx(qr.img,{tabIndex:0,role:"button","aria-label":m("Select image block."),onClick:()=>{o(e)},onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(o(e),r.preventDefault())},alt:t,src:n,animate:{opacity:1},exit:{opacity:0,scale:0},style:{width:"32px",height:"32px",objectFit:"cover",borderRadius:"2px",cursor:"pointer"},whileHover:{scale:1.08}},e)}function nGt(){const[e,t]=x.useState(!1),[n,o]=x.useState(!1),[r,s]=x.useState(!1),{editorBlocks:i,mediaUpload:c}=G(b=>({editorBlocks:b(J).getBlocks(),mediaUpload:b(J).getSettings().mediaUpload}),[]),l=zye(i).filter(b=>eGt(b)),{updateBlockAttributes:u}=Oe(J);if(!c||!l.length)return null;const d=[m("Suggestion:"),a.jsx("span",{className:"editor-post-publish-panel__link",children:m("External media")},"label")];function p(b,h){(b.name==="core/image"||b.name==="core/cover")&&u(b.clientId,{id:h.id,url:h.url}),b.name==="core/media-text"&&u(b.clientId,{mediaId:h.id,mediaUrl:h.url})}function f(){t(!0),s(!1);const b=new Set(l.map(g=>{const{url:z}=kT(g);return z})),h=Object.fromEntries(Object.entries(JXt([...b])).map(([g,z])=>{const A=z.then(_=>new Promise((v,M)=>{c({filesList:[_],onFileChange:([y])=>{Wr(y.url)||v(y)},onError(){M()}})}));return[g,A]}));Promise.allSettled(l.map(g=>{const{url:z}=kT(g);return h[z].then(A=>p(g,A)).then(()=>o(!0)).catch(()=>s(!0))})).finally(()=>{t(!1)})}return a.jsxs(Qt,{initialOpen:!0,title:d,children:[a.jsx("p",{children:m("Upload external images to the Media Library. Images from different domains may load slowly, display incorrectly, or be removed unexpectedly.")}),a.jsxs("div",{style:{display:"inline-flex",flexWrap:"wrap",gap:"8px"},children:[a.jsx(Wd,{onExitComplete:()=>o(!1),children:l.map(b=>{const{url:h,alt:g}=kT(b);return a.jsx(tGt,{clientId:b.clientId,url:h,alt:g},b.clientId)})}),e||n?a.jsx(Xn,{}):a.jsx(Ce,{size:"compact",variant:"primary",onClick:f,children:We("Upload","verb")})]}),r&&a.jsx("p",{children:m("Upload failed, try again.")})]})}function oGt({children:e}){const{isBeingScheduled:t,isRequestingSiteIcon:n,hasPublishAction:o,siteIconUrl:r,siteTitle:s,siteHome:i}=G(d=>{var p;const{getCurrentPost:f,isEditedPostBeingScheduled:b}=d(_e),{getEntityRecord:h,isResolving:g}=d(Me),z=h("root","__unstableBase",void 0)||{};return{hasPublishAction:(p=f()._links?.["wp:action-publish"])!==null&&p!==void 0?p:!1,isBeingScheduled:b(),isRequestingSiteIcon:g("getEntityRecord",["root","__unstableBase",void 0]),siteIconUrl:z.site_icon_url,siteTitle:z.name,siteHome:z.home&&Ph(z.home)}},[]);let c=a.jsx(qo,{className:"components-site-icon",size:"36px",icon:dJe});r&&(c=a.jsx("img",{alt:m("Site Icon"),className:"components-site-icon",src:r})),n&&(c=null);let l,u;return o?t?(l=m("Are you ready to schedule?"),u=m("Your work will be published at the specified date and time.")):(l=m("Are you ready to publish?"),u=m("Double-check your settings before publishing.")):(l=m("Are you ready to submit for review?"),u=m("Your work will be reviewed and then approved.")),a.jsxs("div",{className:"editor-post-publish-panel__prepublish",children:[a.jsx("div",{children:a.jsx("strong",{children:l})}),a.jsx("p",{children:u}),a.jsxs("div",{className:"components-site-card",children:[c,a.jsxs("div",{className:"components-site-info",children:[a.jsx("span",{className:"components-site-name",children:Lt(s)||m("(Untitled)")}),a.jsx("span",{className:"components-site-home",children:i})]})]}),a.jsx(nGt,{}),o&&a.jsxs(a.Fragment,{children:[a.jsx(Qt,{initialOpen:!1,title:[m("Visibility:"),a.jsx("span",{className:"editor-post-publish-panel__link",children:a.jsx(qXt,{})},"label")],children:a.jsx(uye,{})}),a.jsx(Qt,{initialOpen:!1,title:[m("Publish:"),a.jsx("span",{className:"editor-post-publish-panel__link",children:a.jsx(fye,{})},"label")],children:a.jsx(dye,{})})]}),a.jsx(HXt,{}),a.jsx(FXt,{}),a.jsx(ZXt,{}),e]})}const mne="%postname%",gne="%pagename%",rGt=e=>{const{slug:t}=e;return e.permalink_template.includes(mne)?e.permalink_template.replace(mne,t):e.permalink_template.includes(gne)?e.permalink_template.replace(gne,t):e.permalink_template};function sGt({text:e}){const[t,n]=x.useState(!1),o=x.useRef(),r=Hl(e,()=>{n(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{n(!1)},4e3)});return x.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"secondary",ref:r,children:m(t?"Copied!":"Copy")})}function iGt({focusOnMount:e,children:t}){const{post:n,postType:o,isScheduled:r}=G(f=>{const{getEditedPostAttribute:b,getCurrentPost:h,isCurrentPostScheduled:g}=f(_e),{getPostType:z}=f(Me);return{post:h(),postType:z(b("type")),isScheduled:g()}},[]),s=o?.labels?.singular_name,i=o?.labels?.view_item,c=o?.labels?.add_new_item,l=n.status==="future"?rGt(n):n.link,u=tn("post-new.php",{post_type:n.type}),d=x.useCallback(f=>{e&&f&&f.focus()},[e]),p=r?a.jsxs(a.Fragment,{children:[m("is now scheduled. It will go live on")," ",a.jsx(fye,{}),"."]}):m("is now live.");return a.jsxs("div",{className:"post-publish-panel__postpublish",children:[a.jsxs(Qt,{className:"post-publish-panel__postpublish-header",children:[a.jsx("a",{ref:d,href:l,children:Lt(n.title)||m("(no title)")})," ",p]}),a.jsxs(Qt,{children:[a.jsx("p",{className:"post-publish-panel__postpublish-subheader",children:a.jsx("strong",{children:m("What’s next?")})}),a.jsxs("div",{className:"post-publish-panel__postpublish-post-address-container",children:[a.jsx(dn,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"post-publish-panel__postpublish-post-address",readOnly:!0,label:xe(m("%s address"),s),value:Z2(l),onFocus:f=>f.target.select()}),a.jsx("div",{className:"post-publish-panel__postpublish-post-address__copy-button-wrap",children:a.jsx(sGt,{text:l})})]}),a.jsxs("div",{className:"post-publish-panel__postpublish-buttons",children:[!r&&a.jsx(Ce,{variant:"primary",href:l,__next40pxDefaultSize:!0,children:i}),a.jsx(Ce,{variant:r?"primary":"secondary",__next40pxDefaultSize:!0,href:u,children:c})]})]}),t]})}class aGt extends x.Component{constructor(){super(...arguments),this.onSubmit=this.onSubmit.bind(this),this.cancelButtonNode=x.createRef()}componentDidMount(){this.timeoutID=setTimeout(()=>{this.cancelButtonNode.current.focus()},0)}componentWillUnmount(){clearTimeout(this.timeoutID)}componentDidUpdate(t){(t.isPublished&&!this.props.isSaving&&this.props.isDirty||this.props.currentPostId!==t.currentPostId)&&this.props.onClose()}onSubmit(){const{onClose:t,hasPublishAction:n,isPostTypeViewable:o}=this.props;(!n||!o)&&t()}render(){const{forceIsDirty:t,isBeingScheduled:n,isPublished:o,isPublishSidebarEnabled:r,isScheduled:s,isSaving:i,isSavingNonPostEntityChanges:c,onClose:l,onTogglePublishSidebar:u,PostPublishExtension:d,PrePublishExtension:p,currentPostId:f,...b}=this.props,{hasPublishAction:h,isDirty:g,isPostTypeViewable:z,...A}=b,_=o||s&&n,v=!_&&!i,M=_&&!i;return a.jsxs("div",{className:"editor-post-publish-panel",...A,children:[a.jsx("div",{className:"editor-post-publish-panel__header",children:M?a.jsx(Ce,{size:"compact",onClick:l,icon:rp,label:m("Close panel")}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"editor-post-publish-panel__header-cancel-button",children:a.jsx(Ce,{ref:this.cancelButtonNode,accessibleWhenDisabled:!0,disabled:c,onClick:l,variant:"secondary",size:"compact",children:m("Cancel")})}),a.jsx("div",{className:"editor-post-publish-panel__header-publish-button",children:a.jsx(lye,{onSubmit:this.onSubmit,forceIsDirty:t})})]})}),a.jsxs("div",{className:"editor-post-publish-panel__content",children:[v&&a.jsx(oGt,{children:p&&a.jsx(p,{})}),M&&a.jsx(iGt,{focusOnMount:!0,children:d&&a.jsx(d,{})}),i&&a.jsx(Xn,{})]}),a.jsx("div",{className:"editor-post-publish-panel__footer",children:a.jsx(K0,{__nextHasNoMarginBottom:!0,label:m("Always show pre-publish checks."),checked:r,onChange:u})})]})}}const cGt=Co([Ul(e=>{var t;const{getPostType:n}=e(Me),{getCurrentPost:o,getCurrentPostId:r,getEditedPostAttribute:s,isCurrentPostPublished:i,isCurrentPostScheduled:c,isEditedPostBeingScheduled:l,isEditedPostDirty:u,isAutosavingPost:d,isSavingPost:p,isSavingNonPostEntityChanges:f}=e(_e),{isPublishSidebarEnabled:b}=e(_e),h=n(s("type"));return{hasPublishAction:(t=o()._links?.["wp:action-publish"])!==null&&t!==void 0?t:!1,isPostTypeViewable:h?.viewable,isBeingScheduled:l(),isDirty:u(),isPublished:i(),isPublishSidebarEnabled:b(),isSaving:p()&&!d(),isSavingNonPostEntityChanges:f(),isScheduled:c(),currentPostId:r()}}),jf((e,{isPublishSidebarEnabled:t})=>{const{disablePublishSidebar:n,enablePublishSidebar:o}=e(_e);return{onTogglePublishSidebar:()=>{t?n():o()}}}),smt,nmt])(aGt);function lGt({children:e}){const{hasStickyAction:t,postType:n}=G(o=>{var r;return{hasStickyAction:(r=o(_e).getCurrentPost()._links?.["wp:action-sticky"])!==null&&r!==void 0?r:!1,postType:o(_e).getCurrentPostType()}},[]);return n!=="post"||!t?null:e}function uGt(){const e=G(n=>{var o;return(o=n(_e).getEditedPostAttribute("sticky"))!==null&&o!==void 0?o:!1},[]),{editPost:t}=Oe(_e);return a.jsx(lGt,{children:a.jsx(K0,{className:"editor-post-sticky__checkbox-control",label:m("Sticky"),help:m("Pin this post to the top of the blog"),checked:e,onChange:()=>t({sticky:!e}),__nextHasNoMarginBottom:!0})})}const xv={"auto-draft":{label:m("Draft"),icon:E8},draft:{label:m("Draft"),icon:E8},pending:{label:m("Pending"),icon:gde},private:{label:m("Private"),icon:bde},future:{label:m("Scheduled"),icon:Nde},publish:{label:m("Published"),icon:Lw}},Oye=[{label:m("Draft"),value:"draft",description:m("Not ready to publish.")},{label:m("Pending"),value:"pending",description:m("Waiting for review before publishing.")},{label:m("Private"),value:"private",description:m("Only visible to site admins and editors.")},{label:m("Scheduled"),value:"future",description:m("Publish automatically on a chosen date.")},{label:m("Published"),value:"publish",description:m("Visible to everyone.")}],dGt=[L0,Di,$l,Wf];function yye(){const{status:e,date:t,password:n,postId:o,postType:r,canEdit:s}=G(z=>{var A;const{getEditedPostAttribute:_,getCurrentPostId:v,getCurrentPostType:M,getCurrentPost:y}=z(_e);return{status:_("status"),date:_("date"),password:_("password"),postId:v(),postType:M(),canEdit:(A=y()._links?.["wp:action-publish"])!==null&&A!==void 0?A:!1}},[]),[i,c]=x.useState(!!n),l=vt(yye,"editor-change-status__password-input"),{editEntityRecord:u}=Oe(Me),[d,p]=x.useState(null),f=x.useMemo(()=>({anchor:d,"aria-label":m("Status & visibility"),headerTitle:m("Status & visibility"),placement:"left-start",offset:36,shift:!0}),[d]);if(dGt.includes(r))return null;const b=({status:z=e,password:A=n,date:_=t})=>{u("postType",r,o,{status:z,date:_,password:A})},h=z=>{c(z),z||b({password:""})},g=z=>{let A=t,_=n;e==="future"&&new Date(t)>new Date&&(A=null),z==="private"&&n&&(_=""),b({status:z,date:A,password:_})};return a.jsx(xs,{label:m("Status"),ref:p,children:s?a.jsx(so,{className:"editor-post-status",contentClassName:"editor-change-status__content",popoverProps:f,focusOnMount:!0,renderToggle:({onToggle:z,isOpen:A})=>a.jsx(Ce,{className:"editor-post-status__toggle",variant:"tertiary",size:"compact",onClick:z,icon:xv[e]?.icon,"aria-label":xe(m("Change status: %s"),xv[e]?.label),"aria-expanded":A,children:xv[e]?.label}),renderContent:({onClose:z})=>a.jsxs(a.Fragment,{children:[a.jsx(Qs,{title:m("Status & visibility"),onClose:z}),a.jsx("form",{children:a.jsxs(dt,{spacing:4,children:[a.jsx(sb,{className:"editor-change-status__options",hideLabelFromVision:!0,label:m("Status"),options:Oye,onChange:g,selected:e==="auto-draft"?"draft":e}),e==="future"&&a.jsx("div",{className:"editor-change-status__publish-date-wrapper",children:a.jsx(pye,{showPopoverHeaderActions:!1,isCompact:!0})}),e!=="private"&&a.jsxs(dt,{as:"fieldset",spacing:4,className:"editor-change-status__password-fieldset",children:[a.jsx(K0,{__nextHasNoMarginBottom:!0,label:m("Password protected"),help:m("Only visible to those who know the password"),checked:i,onChange:h}),i&&a.jsx("div",{className:"editor-change-status__password-input",children:a.jsx(dn,{label:m("Password"),onChange:A=>b({password:A}),value:n,placeholder:m("Use a secure password"),type:"text",id:l,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,maxLength:255})})]}),a.jsx(uGt,{})]})})]})}):a.jsx("div",{className:"editor-post-status is-read-only",children:xv[e]?.label})})}function pGt({forceIsDirty:e}){const[t,n]=x.useState(!1),o=Yn("small"),{isAutosaving:r,isDirty:s,isNew:i,isPublished:c,isSaveable:l,isSaving:u,isScheduled:d,hasPublishAction:p,showIconLabels:f,postStatus:b,postStatusHasChanged:h}=G(R=>{var T;const{isEditedPostNew:E,isCurrentPostPublished:B,isCurrentPostScheduled:N,isEditedPostDirty:j,isSavingPost:I,isEditedPostSaveable:P,getCurrentPost:$,isAutosavingPost:F,getEditedPostAttribute:X,getPostEdits:Z}=R(_e),{get:V}=R(ht);return{isAutosaving:F(),isDirty:e||j(),isNew:E(),isPublished:B(),isSaving:I(),isSaveable:P(),isScheduled:N(),hasPublishAction:(T=$()?._links?.["wp:action-publish"])!==null&&T!==void 0?T:!1,showIconLabels:V("core","showIconLabels"),postStatus:X("status"),postStatusHasChanged:!!Z()?.status}},[e]),g=b==="pending",{savePost:z}=Oe(_e),A=Fr(u);if(x.useEffect(()=>{let R;return A&&!u&&(n(!0),R=setTimeout(()=>{n(!1)},1e3)),()=>clearTimeout(R)},[u]),!p&&g)return null;const _=!["pending","draft","auto-draft"].includes(b)&&Oye.map(({value:R})=>R).includes(b);if(c||d||_||h&&["pending","draft"].includes(b))return null;const v=m(g?"Save as pending":"Save draft"),M=m("Save"),y=t||!i&&!s,k=u||y,S=u||y||!l;let C;return u?C=m(r?"Autosaving":"Saving"):y?C=m("Saved"):o?C=v:f&&(C=M),a.jsxs(Ce,{className:l||u?oe({"editor-post-save-draft":!k,"editor-post-saved-state":k,"is-saving":u,"is-autosaving":r,"is-saved":y,[hle({type:"loading"})]:u}):void 0,onClick:S?void 0:()=>z(),shortcut:S?void 0:j1.primary("s"),variant:"tertiary",size:"compact",icon:o?void 0:xZe,label:C||v,"aria-disabled":S,children:[k&&a.jsx(wn,{icon:y?M0:wZe}),C]})}function fGt({children:e}){return G(n=>{var o;return(o=n(_e).getCurrentPost()._links?.["wp:action-publish"])!==null&&o!==void 0?o:!1},[])?e:null}const bGt=[L0,Di,$l,Wf];function hGt(){const[e,t]=x.useState(null),n=G(i=>i(_e).getCurrentPostType(),[]),o=x.useMemo(()=>({anchor:e,"aria-label":m("Change publish date"),placement:"left-start",offset:36,shift:!0}),[e]),r=sN(),s=sN({full:!0});return bGt.includes(n)?null:a.jsx(fGt,{children:a.jsx(xs,{label:m("Publish"),ref:t,children:a.jsx(so,{popoverProps:o,focusOnMount:!0,className:"editor-post-schedule__panel-dropdown",contentClassName:"editor-post-schedule__dialog",renderToggle:({onToggle:i,isOpen:c})=>a.jsx(Ce,{size:"compact",className:"editor-post-schedule__dialog-toggle",variant:"tertiary",tooltipPosition:"middle left",onClick:i,"aria-label":xe(m("Change date: %s"),r),label:s,showTooltip:r!==s,"aria-expanded":c,children:r}),renderContent:({onClose:i})=>a.jsx(dye,{onClose:i})})})})}function mGt(){const{syncStatus:e,postType:t}=G(n=>{const{getEditedPostAttribute:o}=n(_e);return{syncStatus:o("meta")?.wp_pattern_sync_status==="unsynced"?"unsynced":o("wp_pattern_sync_status"),postType:o("type")}});return t!=="wp_block"?null:a.jsx(xs,{label:m("Sync status"),children:a.jsx("div",{className:"editor-post-sync-status__value",children:We(e==="unsynced"?"Not synced":"Synced","pattern (singular)")})})}const gGt=e=>e;function Aye({taxonomyWrapper:e=gGt}){const{postType:t,taxonomies:n}=G(r=>({postType:r(_e).getCurrentPostType(),taxonomies:r(Me).getTaxonomies({per_page:-1})}),[]);return(n??[]).filter(r=>r.types.includes(t)&&r.visibility?.show_ui).map(r=>{const s=r.hierarchical?Mye:gye,i={slug:r.slug,...r.hierarchical?{}:{__nextHasNoMarginBottom:!0}};return a.jsx(x.Fragment,{children:e(a.jsx(s,{...i}),r)},`taxonomy-${r.slug}`)})}function MGt({children:e}){return G(n=>{const o=n(_e).getCurrentPostType();return n(Me).getTaxonomies({per_page:-1})?.some(s=>s.types.includes(o))},[])?e:null}function zGt({taxonomy:e,children:t}){const n=e?.slug,o=n?`taxonomy-panel-${n}`:"",{isEnabled:r,isOpened:s}=G(l=>{const{isEditorPanelEnabled:u,isEditorPanelOpened:d}=l(_e);return{isEnabled:n?u(o):!1,isOpened:n?d(o):!1}},[o,n]),{toggleEditorPanelOpened:i}=Oe(_e);if(!r)return null;const c=e?.labels?.menu_name;return c?a.jsx(Qt,{title:c,opened:s,onToggle:()=>i(o),children:t}):null}function OGt(){return a.jsx(MGt,{children:a.jsx(Aye,{taxonomyWrapper:(e,t)=>a.jsx(zGt,{taxonomy:t,children:e})})})}function HI(){const e=vt(HI),{content:t,blocks:n,type:o,id:r}=G(c=>{const{getEditedEntityRecord:l}=c(Me),{getCurrentPostType:u,getCurrentPostId:d}=c(_e),p=u(),f=d(),b=l("postType",p,f);return{content:b?.content,blocks:b?.blocks,type:p,id:f}},[]),{editEntityRecord:s}=Oe(Me),i=x.useMemo(()=>t instanceof Function?t({blocks:n}):n?Jd(n):t,[t,n]);return a.jsxs(a.Fragment,{children:[a.jsx(qn,{as:"label",htmlFor:`post-content-${e}`,children:m("Type text or HTML")}),a.jsx(b7,{autoComplete:"off",dir:"auto",value:i,onChange:c=>{s("postType",o,r,{content:c.target.value,blocks:void 0,selection:void 0})},className:"editor-post-text-editor",id:`post-content-${e}`,placeholder:m("Start writing with text or HTML")})]})}const vye="wp-block wp-block-post-title block-editor-block-list__block editor-post-title editor-post-title__input rich-text",xye=/[\r\n]+/g;function wye(e){const t=x.useRef(),{isCleanNewPost:n}=G(o=>{const{isCleanNewPost:r}=o(_e);return{isCleanNewPost:r()}},[]);return x.useImperativeHandle(e,()=>({focus:()=>{t?.current?.focus()}})),x.useEffect(()=>{if(!t.current)return;const{defaultView:o}=t.current.ownerDocument,{name:r,parent:s}=o,i=r==="editor-canvas"?s.document:o.document,{activeElement:c,body:l}=i;n&&(!c||l===c)&&t.current.focus()},[n]),{ref:t}}function _ye(){const{editPost:e}=Oe(_e),{title:t}=G(o=>{const{getEditedPostAttribute:r}=o(_e);return{title:r("title")}},[]);function n(o){e({title:o})}return{title:t,setTitle:n}}const yGt=x.forwardRef((e,t)=>{const{placeholder:n}=G(C=>{const{getSettings:R}=C(J),{titlePlaceholder:T}=R();return{placeholder:T}},[]),[o,r]=x.useState(!1),{ref:s}=wye(t),{title:i,setTitle:c}=_ye(),[l,u]=x.useState({}),{clearSelectedBlock:d,insertBlocks:p,insertDefaultBlock:f}=Oe(J),b=Lt(n)||m("Add title"),{value:h,onChange:g,ref:z}=e1e({value:i,onChange(C){c(C.replace(xye," "))},placeholder:b,selectionStart:l.start,selectionEnd:l.end,onSelectionChange(C,R){u(T=>{const{start:E,end:B}=T;return E===C&&B===R?T:{start:C,end:R}})},__unstableDisableFormats:!1});function A(C){p(C,0)}function _(){r(!0),d()}function v(){r(!1),u({})}function M(){f(void 0,void 0,0)}function y(C){C.keyCode===Gr&&(C.preventDefault(),M())}function k(C){const R=C.clipboardData;let T="",E="";try{T=R.getData("text/plain"),E=R.getData("text/html")}catch{return}window.console.log(`Received HTML: `,E),window.console.log(`Received plain text: -`,T);const B=Xh({HTML:E,plainText:T});if(C.preventDefault(),!!B.length)if(typeof B!="string"){const[N]=B;if(!i&&(N.name==="core/heading"||N.name==="core/paragraph")){const j=x1(N.attributes.content);c(j),A(B.slice(1))}else A(B)}else{const N=x1(B);g(E0(h,eo({html:N})))}}const S=oe(vye,{"is-selected":o});return a.jsx("h1",{ref:xn([z,s]),contentEditable:!0,className:S,"aria-label":b,role:"textbox","aria-multiline":"true",onFocus:_,onBlur:v,onKeyDown:y,onPaste:k})}),kye=x.forwardRef((e,t)=>a.jsx(Sc,{supportKeys:"title",children:a.jsx(yGt,{ref:t})}));function AGt(e,t){const{placeholder:n}=G(b=>{const{getSettings:h}=b(J),{titlePlaceholder:g}=h();return{placeholder:g}},[]),[o,r]=x.useState(!1),{title:s,setTitle:i}=_ye(),{ref:c}=wye(t);function l(b){i(b.replace(xye," "))}function u(){r(!0)}function d(){r(!1)}const p=oe(vye,{"is-selected":o,"is-raw-text":!0}),f=Lt(n)||m("Add title");return a.jsx(Li,{ref:c,value:s,onChange:l,onFocus:u,onBlur:d,label:n,className:p,placeholder:f,hideLabelFromVision:!0,autoComplete:"off",dir:"auto",rows:1,__nextHasNoMarginBottom:!0})}const Sye=x.forwardRef(AGt);function vGt({children:e}){const{canTrashPost:t}=G(n=>{const{isEditedPostNew:o,getCurrentPostId:r,getCurrentPostType:s}=n(_e),{canUser:i}=n(Me),c=s(),l=r(),u=o(),d=l?i("delete",{kind:"postType",name:c,id:l}):!1;return{canTrashPost:(!u||l)&&d&&!djt.includes(c)}},[]);return t?e:null}function xGt({onActionPerformed:e}){const t=Fn(),{isNew:n,isDeleting:o,postId:r,title:s}=G(d=>{const p=d(_e);return{isNew:p.isEditedPostNew(),isDeleting:p.isDeletingPost(),postId:p.getCurrentPostId(),title:p.getCurrentPostAttribute("title")}},[]),{trashPost:i}=Oe(_e),[c,l]=x.useState(!1);if(n||!r)return null;const u=async()=>{l(!1),await i();const d=await t.resolveSelect(_e).getCurrentPost();e?.("move-to-trash",[d])};return a.jsxs(vGt,{children:[a.jsx(Ce,{__next40pxDefaultSize:!0,className:"editor-post-trash",isDestructive:!0,variant:"secondary",isBusy:o,"aria-disabled":o,onClick:o?void 0:()=>l(!0),children:m("Move to trash")}),a.jsx(wf,{isOpen:c,onConfirm:u,onCancel:()=>l(!1),confirmButtonText:m("Move to trash"),size:"small",children:xe(m('Are you sure you want to move "%s" to the trash?'),s)})]})}function Cye({onClose:e}){const{isEditable:t,postSlug:n,postLink:o,permalinkPrefix:r,permalinkSuffix:s,permalink:i}=G(b=>{var h;const g=b(_e).getCurrentPost(),z=b(_e).getCurrentPostType(),A=b(Me).getPostType(z),_=b(_e).getPermalinkParts(),v=(h=g?._links?.["wp:action-publish"])!==null&&h!==void 0?h:!1;return{isEditable:b(_e).isPermalinkEditable()&&v,postSlug:Y2(b(_e).getEditedPostSlug()),viewPostLabel:A?.labels.view_item,postLink:g.link,permalinkPrefix:_?.prefix,permalinkSuffix:_?.suffix,permalink:Y2(b(_e).getPermalink())}},[]),{editPost:c}=Oe(_e),{createNotice:l}=Oe(mt),[u,d]=x.useState(!1),p=Hl(i,()=>{l("info",m("Copied Permalink to clipboard."),{isDismissible:!0,type:"snackbar"})}),f="editor-post-url__slug-description-"+vt(Cye);return a.jsxs("div",{className:"editor-post-url",children:[a.jsx(Qs,{title:m("Slug"),onClose:e}),a.jsxs(dt,{spacing:3,children:[t&&a.jsx("p",{className:"editor-post-url__intro",children:cr(m("Customize the last part of the Permalink. Learn more."),{span:a.jsx("span",{id:f}),a:a.jsx(hr,{href:m("https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink")})})}),a.jsxs("div",{children:[t&&a.jsxs(a.Fragment,{children:[a.jsx(B1,{__next40pxDefaultSize:!0,prefix:a.jsx(Ld,{children:"/"}),suffix:a.jsx(eO,{variant:"control",children:a.jsx(Ce,{icon:RP,ref:p,size:"small",label:"Copy"})}),label:m("Slug"),hideLabelFromVision:!0,value:u?"":n,autoComplete:"off",spellCheck:"false",type:"text",className:"editor-post-url__input",onChange:b=>{if(c({slug:b}),!b){u||d(!0);return}u&&d(!1)},onBlur:b=>{c({slug:A5(b.target.value)}),u&&d(!1)},"aria-describedby":f}),a.jsxs("p",{className:"editor-post-url__permalink",children:[a.jsx("span",{className:"editor-post-url__permalink-visual-label",children:m("Permalink:")}),a.jsxs(hr,{className:"editor-post-url__link",href:o,target:"_blank",children:[a.jsx("span",{className:"editor-post-url__link-prefix",children:r}),a.jsx("span",{className:"editor-post-url__link-slug",children:n}),a.jsx("span",{className:"editor-post-url__link-suffix",children:s})]})]})]}),!t&&a.jsx(hr,{className:"editor-post-url__link",href:o,target:"_blank",children:o})]})]})]})}function wGt({children:e}){return G(n=>{const o=n(_e).getCurrentPostType();return!(!n(Me).getPostType(o)?.viewable||!n(_e).getCurrentPost().link||!n(_e).getPermalinkParts())},[])?e:null}function _Gt(){const{isFrontPage:e}=G(s=>{const{getCurrentPostId:i}=s(_e),{getEditedEntityRecord:c,canUser:l}=s(Me),u=l("read",{kind:"root",name:"site"})?c("root","site"):void 0,d=i();return{isFrontPage:u?.page_on_front===d}},[]),[t,n]=x.useState(null),o=x.useMemo(()=>({anchor:t,placement:"left-start",offset:36,shift:!0}),[t]),r=m(e?"Link":"Slug");return a.jsx(wGt,{children:a.jsxs(xs,{label:r,ref:n,children:[!e&&a.jsx(so,{popoverProps:o,className:"editor-post-url__panel-dropdown",contentClassName:"editor-post-url__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:s,onToggle:i})=>a.jsx(kGt,{isOpen:s,onClick:i}),renderContent:({onClose:s})=>a.jsx(Cye,{onClose:s})}),e&&a.jsx(SGt,{})]})})}function kGt({isOpen:e,onClick:t}){const{slug:n}=G(r=>({slug:r(_e).getEditedPostSlug()}),[]),o=Y2(n);return a.jsx(Ce,{size:"compact",className:"editor-post-url__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":xe(m("Change link: %s"),o),onClick:t,children:a.jsx(a.Fragment,{children:o})})}function SGt(){const{postLink:e}=G(t=>{const{getCurrentPost:n}=t(_e);return{postLink:n()?.link}},[]);return a.jsx(hr,{className:"editor-post-url__front-page-link",href:e,target:"_blank",children:e})}const CGt={HTMLRegExp:/<\/?[a-z][^>]*?>/gi,HTMLcommentRegExp://g,spaceRegExp:/ | /gi,HTMLEntityRegExp:/&\S+?;/g,connectorRegExp:/--|\u2014/g,removeRegExp:new RegExp(["[","!-/:-@[-`{-~","€-¿×÷"," -⯿","⸀-⹿","]"].join(""),"g"),astralRegExp:/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,wordsRegExp:/\S\s+/g,characters_excluding_spacesRegExp:/\S/g,characters_including_spacesRegExp:/[^\f\n\r\t\v\u00AD\u2028\u2029]/g,l10n:{type:"words"}};function qye(e,t){return t.replace(e.HTMLRegExp,` +`,T);const B=Xh({HTML:E,plainText:T});if(C.preventDefault(),!!B.length)if(typeof B!="string"){const[N]=B;if(!i&&(N.name==="core/heading"||N.name==="core/paragraph")){const j=x1(N.attributes.content);c(j),A(B.slice(1))}else A(B)}else{const N=x1(B);g(E0(h,eo({html:N})))}}const S=oe(vye,{"is-selected":o});return a.jsx("h1",{ref:xn([z,s]),contentEditable:!0,className:S,"aria-label":b,role:"textbox","aria-multiline":"true",onFocus:_,onBlur:v,onKeyDown:y,onPaste:k})}),kye=x.forwardRef((e,t)=>a.jsx(Sc,{supportKeys:"title",children:a.jsx(yGt,{ref:t})}));function AGt(e,t){const{placeholder:n}=G(b=>{const{getSettings:h}=b(J),{titlePlaceholder:g}=h();return{placeholder:g}},[]),[o,r]=x.useState(!1),{title:s,setTitle:i}=_ye(),{ref:c}=wye(t);function l(b){i(b.replace(xye," "))}function u(){r(!0)}function d(){r(!1)}const p=oe(vye,{"is-selected":o,"is-raw-text":!0}),f=Lt(n)||m("Add title");return a.jsx(Li,{ref:c,value:s,onChange:l,onFocus:u,onBlur:d,label:n,className:p,placeholder:f,hideLabelFromVision:!0,autoComplete:"off",dir:"auto",rows:1,__nextHasNoMarginBottom:!0})}const Sye=x.forwardRef(AGt);function vGt({children:e}){const{canTrashPost:t}=G(n=>{const{isEditedPostNew:o,getCurrentPostId:r,getCurrentPostType:s}=n(_e),{canUser:i}=n(Me),c=s(),l=r(),u=o(),d=l?i("delete",{kind:"postType",name:c,id:l}):!1;return{canTrashPost:(!u||l)&&d&&!djt.includes(c)}},[]);return t?e:null}function xGt({onActionPerformed:e}){const t=Fn(),{isNew:n,isDeleting:o,postId:r,title:s}=G(d=>{const p=d(_e);return{isNew:p.isEditedPostNew(),isDeleting:p.isDeletingPost(),postId:p.getCurrentPostId(),title:p.getCurrentPostAttribute("title")}},[]),{trashPost:i}=Oe(_e),[c,l]=x.useState(!1);if(n||!r)return null;const u=async()=>{l(!1),await i();const d=await t.resolveSelect(_e).getCurrentPost();e?.("move-to-trash",[d])};return a.jsxs(vGt,{children:[a.jsx(Ce,{__next40pxDefaultSize:!0,className:"editor-post-trash",isDestructive:!0,variant:"secondary",isBusy:o,"aria-disabled":o,onClick:o?void 0:()=>l(!0),children:m("Move to trash")}),a.jsx(wf,{isOpen:c,onConfirm:u,onCancel:()=>l(!1),confirmButtonText:m("Move to trash"),size:"small",children:xe(m('Are you sure you want to move "%s" to the trash?'),s)})]})}function Cye({onClose:e}){const{isEditable:t,postSlug:n,postLink:o,permalinkPrefix:r,permalinkSuffix:s,permalink:i}=G(b=>{var h;const g=b(_e).getCurrentPost(),z=b(_e).getCurrentPostType(),A=b(Me).getPostType(z),_=b(_e).getPermalinkParts(),v=(h=g?._links?.["wp:action-publish"])!==null&&h!==void 0?h:!1;return{isEditable:b(_e).isPermalinkEditable()&&v,postSlug:Z2(b(_e).getEditedPostSlug()),viewPostLabel:A?.labels.view_item,postLink:g.link,permalinkPrefix:_?.prefix,permalinkSuffix:_?.suffix,permalink:Z2(b(_e).getPermalink())}},[]),{editPost:c}=Oe(_e),{createNotice:l}=Oe(mt),[u,d]=x.useState(!1),p=Hl(i,()=>{l("info",m("Copied Permalink to clipboard."),{isDismissible:!0,type:"snackbar"})}),f="editor-post-url__slug-description-"+vt(Cye);return a.jsxs("div",{className:"editor-post-url",children:[a.jsx(Qs,{title:m("Slug"),onClose:e}),a.jsxs(dt,{spacing:3,children:[t&&a.jsx("p",{className:"editor-post-url__intro",children:cr(m("Customize the last part of the Permalink. Learn more."),{span:a.jsx("span",{id:f}),a:a.jsx(hr,{href:m("https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink")})})}),a.jsxs("div",{children:[t&&a.jsxs(a.Fragment,{children:[a.jsx(B1,{__next40pxDefaultSize:!0,prefix:a.jsx(Ld,{children:"/"}),suffix:a.jsx(eO,{variant:"control",children:a.jsx(Ce,{icon:RP,ref:p,size:"small",label:"Copy"})}),label:m("Slug"),hideLabelFromVision:!0,value:u?"":n,autoComplete:"off",spellCheck:"false",type:"text",className:"editor-post-url__input",onChange:b=>{if(c({slug:b}),!b){u||d(!0);return}u&&d(!1)},onBlur:b=>{c({slug:W5(b.target.value)}),u&&d(!1)},"aria-describedby":f}),a.jsxs("p",{className:"editor-post-url__permalink",children:[a.jsx("span",{className:"editor-post-url__permalink-visual-label",children:m("Permalink:")}),a.jsxs(hr,{className:"editor-post-url__link",href:o,target:"_blank",children:[a.jsx("span",{className:"editor-post-url__link-prefix",children:r}),a.jsx("span",{className:"editor-post-url__link-slug",children:n}),a.jsx("span",{className:"editor-post-url__link-suffix",children:s})]})]})]}),!t&&a.jsx(hr,{className:"editor-post-url__link",href:o,target:"_blank",children:o})]})]})]})}function wGt({children:e}){return G(n=>{const o=n(_e).getCurrentPostType();return!(!n(Me).getPostType(o)?.viewable||!n(_e).getCurrentPost().link||!n(_e).getPermalinkParts())},[])?e:null}function _Gt(){const{isFrontPage:e}=G(s=>{const{getCurrentPostId:i}=s(_e),{getEditedEntityRecord:c,canUser:l}=s(Me),u=l("read",{kind:"root",name:"site"})?c("root","site"):void 0,d=i();return{isFrontPage:u?.page_on_front===d}},[]),[t,n]=x.useState(null),o=x.useMemo(()=>({anchor:t,placement:"left-start",offset:36,shift:!0}),[t]),r=m(e?"Link":"Slug");return a.jsx(wGt,{children:a.jsxs(xs,{label:r,ref:n,children:[!e&&a.jsx(so,{popoverProps:o,className:"editor-post-url__panel-dropdown",contentClassName:"editor-post-url__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:s,onToggle:i})=>a.jsx(kGt,{isOpen:s,onClick:i}),renderContent:({onClose:s})=>a.jsx(Cye,{onClose:s})}),e&&a.jsx(SGt,{})]})})}function kGt({isOpen:e,onClick:t}){const{slug:n}=G(r=>({slug:r(_e).getEditedPostSlug()}),[]),o=Z2(n);return a.jsx(Ce,{size:"compact",className:"editor-post-url__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":xe(m("Change link: %s"),o),onClick:t,children:a.jsx(a.Fragment,{children:o})})}function SGt(){const{postLink:e}=G(t=>{const{getCurrentPost:n}=t(_e);return{postLink:n()?.link}},[]);return a.jsx(hr,{className:"editor-post-url__front-page-link",href:e,target:"_blank",children:e})}const CGt={HTMLRegExp:/<\/?[a-z][^>]*?>/gi,HTMLcommentRegExp://g,spaceRegExp:/ | /gi,HTMLEntityRegExp:/&\S+?;/g,connectorRegExp:/--|\u2014/g,removeRegExp:new RegExp(["[","!-/:-@[-`{-~","€-¿×÷"," -⯿","⸀-⹿","]"].join(""),"g"),astralRegExp:/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,wordsRegExp:/\S\s+/g,characters_excluding_spacesRegExp:/\S/g,characters_including_spacesRegExp:/[^\f\n\r\t\v\u00AD\u2028\u2029]/g,l10n:{type:"words"}};function qye(e,t){return t.replace(e.HTMLRegExp,` `)}function qGt(e,t){return t.replace(e.astralRegExp,"a")}function RGt(e,t){return t.replace(e.HTMLEntityRegExp,"")}function TGt(e,t){return t.replace(e.connectorRegExp," ")}function EGt(e,t){return t.replace(e.removeRegExp,"")}function Rye(e,t){return t.replace(e.HTMLcommentRegExp,"")}function Tye(e,t){return e.shortcodesRegExp?t.replace(e.shortcodesRegExp,` `):t}function Eye(e,t){return t.replace(e.spaceRegExp," ")}function WGt(e,t){return t.replace(e.HTMLEntityRegExp,"a")}function NGt(e,t){var n;const o=Object.assign({},CGt,t);return o.shortcodes=(n=o.l10n?.shortcodes)!==null&&n!==void 0?n:[],o.shortcodes&&o.shortcodes.length&&(o.shortcodesRegExp=new RegExp("\\[\\/?(?:"+o.shortcodes.join("|")+")[^\\]]*?\\]","g")),o.type=e,o.type!=="characters_excluding_spaces"&&o.type!=="characters_including_spaces"&&(o.type="words"),o}function BGt(e,t,n){var o;return e=[qye.bind(null,n),Rye.bind(null,n),Tye.bind(null,n),Eye.bind(null,n),RGt.bind(null,n),TGt.bind(null,n),EGt.bind(null,n)].reduce((r,s)=>s(r),e),e=e+` `,(o=e.match(t)?.length)!==null&&o!==void 0?o:0}function Mne(e,t,n){var o;return e=[qye.bind(null,n),Rye.bind(null,n),Tye.bind(null,n),qGt.bind(null,n),Eye.bind(null,n),WGt.bind(null,n)].reduce((r,s)=>s(r),e),e=e+` -`,(o=e.match(t)?.length)!==null&&o!==void 0?o:0}function DO(e,t,n){const o=NGt(t,n);let r;switch(o.type){case"words":return r=o.wordsRegExp,BGt(e,r,o);case"characters_including_spaces":return r=o.characters_including_spacesRegExp,Mne(e,r,o);case"characters_excluding_spaces":return r=o.characters_excluding_spacesRegExp,Mne(e,r,o);default:return 0}}function LGt(){const e=G(n=>n(_e).getEditedPostAttribute("content"),[]),t=We("words","Word count type. Do not translate!");return a.jsx("span",{className:"word-count",children:DO(e,t)})}const PGt=189;function jGt(){const e=G(r=>r(_e).getEditedPostAttribute("content"),[]),t=We("words","Word count type. Do not translate!"),n=Math.round(DO(e,t)/PGt),o=n===0?cr(m("< 1 minute"),{span:a.jsx("span",{})}):cr(xe(Dn("%s minute","%s minutes",n),n),{span:a.jsx("span",{})});return a.jsx("span",{className:"time-to-read",children:o})}function IGt(){const e=G(t=>t(_e).getEditedPostAttribute("content"),[]);return DO(e,"characters_including_spaces")}const DGt={};function FGt(e,t=null,n={}){return tn(`/wp/v2/block-renderer/${e}`,{context:"edit",...t!==null?{attributes:t}:{},...n})}function $Gt(e){const{backgroundColor:t,borderColor:n,fontFamily:o,fontSize:r,gradient:s,textColor:i,className:c,...l}=e,{border:u,color:d,elements:p,spacing:f,typography:b,...h}=e?.style||DGt;return{...l,style:h}}function VGt({className:e}){return a.jsx(vo,{className:e,children:m("Block rendered as empty.")})}function HGt({response:e,className:t}){const n=xe(m("Error loading block: %s"),e.errorMsg);return a.jsx(vo,{className:t,children:n})}function UGt({children:e,showLoader:t}){return a.jsxs("div",{style:{position:"relative"},children:[t&&a.jsx("div",{style:{position:"absolute",top:"50%",left:"50%",marginTop:"-9px",marginLeft:"-9px"},children:a.jsx(Xn,{})}),a.jsx("div",{style:{opacity:t?"0.3":1},children:e})]})}function XGt(e){const{attributes:t,block:n,className:o,httpMethod:r="GET",urlQueryArgs:s,skipBlockSupportAttributes:i=!1,EmptyResponsePlaceholder:c=VGt,ErrorResponsePlaceholder:l=HGt,LoadingResponsePlaceholder:u=UGt}=e,d=x.useRef(!1),[p,f]=x.useState(!1),b=x.useRef(),[h,g]=x.useState(null),z=Fr(e),[A,_]=x.useState(!1);function v(){var C,R;if(!d.current)return;_(!0);const T=setTimeout(()=>{f(!0)},1e3);let E=t&&EB(n,t);i&&(E=$Gt(E));const B=r==="POST",N=B?null:(C=E)!==null&&C!==void 0?C:null,j=FGt(n,N,s),I=B?{attributes:(R=E)!==null&&R!==void 0?R:null}:null,P=b.current=Tt({path:j,data:I,method:B?"POST":"GET"}).then($=>{d.current&&P===b.current&&$&&g($.rendered)}).catch($=>{d.current&&P===b.current&&g({error:!0,errorMsg:$.message})}).finally(()=>{d.current&&P===b.current&&(_(!1),f(!1),clearTimeout(T))});return P}const M=q1(v,500);x.useEffect(()=>(d.current=!0,()=>{d.current=!1}),[]),x.useEffect(()=>{z===void 0?v():N0(z,e)||M()});const y=!!h,k=h==="",S=h?.error;return A?a.jsx(u,{...e,showLoader:p,children:y&&a.jsx(i0,{className:o,children:h})}):k||!y?a.jsx(c,{...e}):S?a.jsx(l,{response:h,...e}):a.jsx(i0,{className:o,children:h})}const zne={},FO=Ul(e=>{const t=e("core/editor");if(t){const n=t.getCurrentPostId();if(n&&typeof n=="number")return{currentPostId:n}}return zne})(({urlQueryArgs:e=zne,currentPostId:t,...n})=>{const o=x.useMemo(()=>t?{post_id:t,...e}:e,[t,e]);return a.jsx(XGt,{urlQueryArgs:o,...n})});function GGt(e=[]){return e.push({...$Ht}),e}Bn("editor.Autocomplete.completers","editor/autocompleters/set-default-completers",GGt);Bn("editor.MediaUpload","core/editor/components/media-upload",()=>zOe);const{PatternOverridesControls:KGt,ResetOverridesControl:YGt,PatternOverridesBlockControls:ZGt,PATTERN_TYPES:QGt,PARTIAL_SYNCING_SUPPORTED_BLOCKS:JGt,PATTERN_SYNC_TYPES:One}=St(Vi),eKt=Or(e=>t=>{const n=!!JGt[t.name];return a.jsxs(a.Fragment,{children:[a.jsx(e,{...t},"edit"),t.isSelected&&n&&a.jsx(tKt,{...t}),n&&a.jsx(ZGt,{})]})},"withPatternOverrideControls");function tKt(e){const t=Jr(),{hasPatternOverridesSource:n,isEditingSyncedPattern:o}=G(l=>{const{getCurrentPostType:u,getEditedPostAttribute:d}=l(_e);return{hasPatternOverridesSource:!!vl("core/pattern-overrides"),isEditingSyncedPattern:u()===QGt.user&&d("meta")?.wp_pattern_sync_status!==One.unsynced&&d("wp_pattern_sync_status")!==One.unsynced}},[]),r=e.attributes.metadata?.bindings,s=!!r&&Object.values(r).some(l=>l.source==="core/pattern-overrides"),i=o&&t==="default",c=!o&&!!e.attributes.metadata?.name&&t!=="disabled"&&s;return n?a.jsxs(a.Fragment,{children:[i&&a.jsx(KGt,{...e}),c&&a.jsx(YGt,{...e})]}):null}Bn("editor.BlockEdit","core/editor/with-pattern-override-controls",eKt);const Wye=Qn(Symbol("EditCanvasContainerSlot")),UI="__experimentalMainDashboardButton",nKt=()=>{const e=H0(UI);return!!(e&&e.length)},{Fill:oKt,Slot:rKt}=Qn(UI),XI=oKt,sKt=()=>{const e=H0(UI);return a.jsx(rKt,{bubblesVirtually:!0,fillProps:{length:e?e.length:0}})};XI.Slot=sKt;const iKt="edit-post/collab-history-sidebar",yne="edit-post/collab-sidebar";function GI({avatar:e,name:t,date:n}){const o=Sa(),[r=o.formats.time]=Ao("root","site","time_format"),{currentUserAvatar:s,currentUserName:i}=G(l=>{var u;const d=l(Me).getCurrentUser(),{getSettings:p}=l(J),{__experimentalDiscussionSettings:f}=p(),b=f?.avatarURL;return{currentUserAvatar:(u=d?.avatar_urls[48])!==null&&u!==void 0?u:b,currentUserName:d?.name}},[]),c=new Date;return a.jsxs(a.Fragment,{children:[a.jsx("img",{src:e??s,className:"editor-collab-sidebar-panel__user-avatar",alt:m("User avatar"),width:32,height:32}),a.jsxs(dt,{spacing:"0",children:[a.jsx("span",{className:"editor-collab-sidebar-panel__user-name",children:t??i}),a.jsx("time",{dateTime:r0("c",n??c),className:"editor-collab-sidebar-panel__user-time",children:r0(r,n??c)})]})]})}function aKt(e){return e.trim()}function cKt(e){const t=n=>n.reduce((o,r)=>{if(r.attributes&&r.attributes.blockCommentId&&!o.includes(r.attributes.blockCommentId)&&o.push(r.attributes.blockCommentId),r.innerBlocks&&r.innerBlocks.length>0){const s=t(r.innerBlocks);o.push(...s)}return o},[]);return t(e)}function KI({onSubmit:e,onCancel:t,thread:n,submitButtonText:o}){var r;const[s,i]=x.useState((r=n?.content?.raw)!==null&&r!==void 0?r:"");return a.jsxs(a.Fragment,{children:[a.jsx(Li,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:s??"",onChange:i}),a.jsxs(Ot,{alignment:"left",spacing:"3",justify:"flex-start",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,accessibleWhenDisabled:!0,variant:"primary",onClick:()=>{e(s),i("")},disabled:aKt(s).length===0,text:o}),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,text:We("Cancel","Cancel comment button")})]})]})}function lKt({threads:e,onEditComment:t,onAddReply:n,onCommentDelete:o,onCommentResolve:r,showCommentBoard:s,setShowCommentBoard:i}){const{blockCommentId:c}=G(p=>{const{getBlockAttributes:f,getSelectedBlockClientId:b}=p(J),h=b();return{blockCommentId:h?f(h)?.blockCommentId:null}},[]),[l,u]=x.useState(s&&c?c:null),d=()=>{u(null),i(!1)};return a.jsxs(a.Fragment,{children:[(!Array.isArray(e)||e.length===0)&&a.jsx(dt,{alignment:"left",className:"editor-collab-sidebar-panel__thread",justify:"flex-start",spacing:"3",children:m("No comments available")}),Array.isArray(e)&&e.length>0&&e.map(p=>a.jsx(dt,{className:oe("editor-collab-sidebar-panel__thread",{"editor-collab-sidebar-panel__active-thread":c&&c===p.id,"editor-collab-sidebar-panel__focus-thread":l&&l===p.id}),id:p.id,spacing:"3",onClick:()=>u(p.id),children:a.jsx(uKt,{thread:p,onAddReply:n,onCommentDelete:o,onCommentResolve:r,onEditComment:t,isFocused:l===p.id,clearThreadFocus:d})},p.id))]})}function uKt({thread:e,onEditComment:t,onAddReply:n,onCommentDelete:o,onCommentResolve:r,isFocused:s,clearThreadFocus:i}){return a.jsxs(a.Fragment,{children:[a.jsx(ST,{thread:e,onResolve:r,onEdit:t,onDelete:o,status:e.status}),0a.jsxs(dt,{className:"editor-collab-sidebar-panel__child-thread",id:c.id,spacing:"2",children:[e.status!=="approved"&&a.jsx(ST,{thread:c,onEdit:t,onDelete:o}),e.status==="approved"&&a.jsx(ST,{thread:c})]},c.id))]}),e.status!=="approved"&&s&&a.jsxs(dt,{className:"editor-collab-sidebar-panel__child-thread",spacing:"2",children:[a.jsx(Ot,{alignment:"left",spacing:"3",justify:"flex-start",children:a.jsx(GI,{})}),a.jsx(dt,{spacing:"3",className:"editor-collab-sidebar-panel__comment-field",children:a.jsx(KI,{onSubmit:c=>{n(c,e.id)},onCancel:c=>{c.stopPropagation(),i()},submitButtonText:We("Reply","Add reply comment")})})]})]})}const ST=({thread:e,onResolve:t,onEdit:n,onDelete:o,status:r})=>{const[s,i]=x.useState(!1),[c,l]=x.useState(!1),u=()=>{o(e.id),i(!1),l(!1)},d=()=>{t(e.id),i(!1),l(!1)},p=()=>{i(!1),l(!1)},b=[n&&{title:We("Edit","Edit comment"),onClick:()=>{i("edit")}},o&&{title:We("Delete","Delete comment"),onClick:()=>{i("delete"),l(!0)}}].filter(h=>h?.onClick);return a.jsxs(a.Fragment,{children:[a.jsxs(Ot,{alignment:"left",spacing:"3",justify:"flex-start",children:[a.jsx(GI,{avatar:e?.author_avatar_urls?.[48],name:e?.author_name,date:e?.date}),a.jsxs("span",{className:"editor-collab-sidebar-panel__comment-status",children:[r!=="approved"&&a.jsxs(Ot,{alignment:"right",justify:"flex-end",spacing:"0",children:[e?.parent===0&&t&&a.jsx(Ce,{label:We("Resolve","Mark comment as resolved"),__next40pxDefaultSize:!0,icon:Lw,onClick:()=>{i("resolve"),l(!0)},showTooltip:!0}),0{n(e.id,h),i(!1)},onCancel:()=>p(),thread:e,submitButtonText:We("Update","verb")}),s!=="edit"&&a.jsx(i0,{children:e?.content?.raw})]})}),s==="resolve"&&a.jsx(wf,{isOpen:c,onConfirm:d,onCancel:p,confirmButtonText:"Yes",cancelButtonText:"No",children:m("Are you sure you want to mark this comment as resolved?")}),s==="delete"&&a.jsx(wf,{isOpen:c,onConfirm:u,onCancel:p,confirmButtonText:"Yes",cancelButtonText:"No",children:m("Are you sure you want to delete this comment?")})]})};function dKt({onSubmit:e,showCommentBoard:t,setShowCommentBoard:n}){const{clientId:o,blockCommentId:r}=G(s=>{const{getSelectedBlock:i}=s(J),c=i();return{clientId:c?.clientId,blockCommentId:c?.attributes?.blockCommentId}});return!t||!o||r!==void 0?null:a.jsxs(dt,{spacing:"3",className:"editor-collab-sidebar-panel__thread editor-collab-sidebar-panel__active-thread editor-collab-sidebar-panel__focus-thread",children:[a.jsx(Ot,{alignment:"left",spacing:"3",children:a.jsx(GI,{})}),a.jsx(KI,{onSubmit:s=>{e(s)},onCancel:()=>{n(!1)},submitButtonText:We("Comment","Add comment button")})]})}const{CommentIconSlotFill:pKt}=St(jn),fKt=({onClick:e})=>a.jsx(pKt.Fill,{children:({onClose:t})=>a.jsx(Ct,{icon:U3,onClick:()=>{e(),t()},"aria-haspopup":"dialog",children:We("Comment","Add comment button")})}),{CommentIconToolbarSlotFill:bKt}=St(jn),hKt=({onClick:e})=>a.jsx(bKt.Fill,{children:a.jsx(Vt,{accessibleWhenDisabled:!0,icon:U3,label:We("Comment","View comment"),onClick:e})}),mKt=e=>(e.attributes.blockCommentId||(e.attributes={...e.attributes,blockCommentId:{type:"number"}}),e);Bn("blocks.registerBlockType","block-comment/modify-core-block-attributes",mKt);function Ane({showCommentBoard:e,setShowCommentBoard:t,styles:n,comments:o}){const{createNotice:r}=Oe(mt),{saveEntityRecord:s,deleteEntityRecord:i}=Oe(Me),{getEntityRecord:c}=B0e(Me),{postId:l}=G(z=>{const{getCurrentPostId:A}=z(_e);return{postId:A()}},[]),{getSelectedBlockClientId:u}=G(J),{updateBlockAttributes:d}=Oe(J),p=async(z,A)=>{const v={...{post:l,content:z,comment_type:"block_comment",comment_approved:0},...A?{parent:A}:{}},M=await s("root","comment",v);M?(A||d(u(),{blockCommentId:M?.id}),r("snackbar",m(A?"Reply added successfully.":"Comment added successfully."),{type:"snackbar",isDismissible:!0})):h()},f=async z=>{await s("root","comment",{id:z,status:"approved"})?r("snackbar",m("Comment marked as resolved."),{type:"snackbar",isDismissible:!0}):h()},b=async(z,A)=>{await s("root","comment",{id:z,content:A})?r("snackbar",m("Comment edited successfully."),{type:"snackbar",isDismissible:!0}):h()},h=()=>{r("error",m("Something went wrong. Please try publishing the post, or you may have already submitted your comment earlier."),{isDismissible:!0})},g=async z=>{const A=await c("root","comment",z);await i("root","comment",z),A&&!A.parent&&d(u(),{blockCommentId:void 0}),r("snackbar",m("Comment deleted successfully."),{type:"snackbar",isDismissible:!0})};return a.jsxs("div",{className:"editor-collab-sidebar-panel",style:n,children:[a.jsx(dKt,{onSubmit:p,showCommentBoard:e,setShowCommentBoard:t}),a.jsx(lKt,{threads:o,onEditComment:b,onAddReply:p,onCommentDelete:g,onCommentResolve:f,showCommentBoard:e,setShowCommentBoard:t},u())]})}function gKt(){const[e,t]=x.useState(!1),{enableComplementaryArea:n}=Oe(xo),{getActiveComplementaryArea:o}=G(xo),{postId:r,postType:s,postStatus:i,threads:c}=G(z=>{const{getCurrentPostId:A,getCurrentPostType:_}=z(_e),v=A(),M=v&&typeof v=="number"?z(Me).getEntityRecords("root","comment",{post:v,type:"block_comment",status:"any",per_page:100}):null;return{postId:v,postType:_(),postStatus:z(_e).getEditedPostAttribute("status"),threads:M}},[]),{blockCommentId:l}=G(z=>{const{getBlockAttributes:A,getSelectedBlockClientId:_}=z(J),v=_();return{blockCommentId:v?A(v)?.blockCommentId:null}},[]),u=()=>{t(!0),n("core","edit-post/collab-sidebar")},[d]=ya("postType",s,{id:r}),{resultComments:p,sortedThreads:f}=x.useMemo(()=>{const z={},A=[],_=(c??[]).filter(S=>S.status!=="trash");if(_.forEach(S=>{z[S.id]={...S,reply:[]}}),_.forEach(S=>{S.parent===0?A.push(z[S.id]):z[S.parent]&&z[S.parent].reply.push(z[S.id])}),A?.length===0)return{resultComments:[],sortedThreads:[]};const v=A.map(S=>({...S,reply:[...S.reply].reverse()})),M=cKt(d),y=new Map(v.map(S=>[S.id,S])),k=M.map(S=>y.get(S)).filter(S=>S!==void 0);return{resultComments:v,sortedThreads:k}},[c,d]),{merged:b}=PI(),h=b?.styles?.color?.background;if(0{o("core")||(n("core",yne),z())})}if(i==="publish")return null;const g=l?hKt:fKt;return a.jsxs(a.Fragment,{children:[a.jsx(g,{onClick:u}),a.jsx(rN,{identifier:iKt,title:m("Comments"),icon:U3,children:a.jsx(Ane,{comments:p,showCommentBoard:e,setShowCommentBoard:t})}),a.jsx(rN,{isPinnable:!1,header:!1,identifier:yne,className:"editor-collab-sidebar",headerClassName:"editor-collab-sidebar__header",children:a.jsx(Ane,{comments:f,showCommentBoard:e,setShowCommentBoard:t,styles:{backgroundColor:h}})})]})}const{useHasBlockToolbar:MKt}=St(jn);function zKt({isCollapsed:e,onToggle:t}){const{blockSelectionStart:n}=G(s=>({blockSelectionStart:s(J).getBlockSelectionStart()}),[]),o=MKt(),r=!!n;return x.useEffect(()=>{n&&t(!1)},[n,t]),o?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:oe("editor-collapsible-block-toolbar",{"is-collapsed":e||!r}),children:a.jsx(lI,{hideDragHandle:!0})}),a.jsx(Io.Slot,{name:"block-toolbar"}),a.jsx(Ce,{className:"editor-collapsible-block-toolbar__toggle",icon:e?_de:wde,onClick:()=>{t(!e)},label:m(e?"Show block tools":"Hide block tools"),size:"compact"})]}):null}function OKt({className:e,disableBlockTools:t=!1}){const{setIsInserterOpened:n,setIsListViewOpened:o}=Oe(_e),{isDistractionFree:r,isInserterOpened:s,isListViewOpen:i,listViewShortcut:c,inserterSidebarToggleRef:l,listViewToggleRef:u,showIconLabels:d,showTools:p}=G(M=>{const{get:y}=M(ht),{isListViewOpened:k,getEditorMode:S,getInserterSidebarToggleRef:C,getListViewToggleRef:R,getRenderingMode:T,getCurrentPostType:E}=St(M(_e)),{getShortcutRepresentation:B}=M(Pi);return{isInserterOpened:M(_e).isInserterOpened(),isListViewOpen:k(),listViewShortcut:B("core/editor/toggle-list-view"),inserterSidebarToggleRef:C(),listViewToggleRef:R(),showIconLabels:y("core","showIconLabels"),isDistractionFree:y("core","distractionFree"),isVisualMode:S()==="visual",showTools:!!window?.__experimentalEditorWriteMode&&(T()!=="post-only"||E()==="wp_template")}},[]),f=M=>{s&&M.preventDefault()},b=Yn("medium"),h=Yn("wide"),g=m("Document tools"),z=x.useCallback(()=>o(!i),[o,i]),A=x.useCallback(()=>n(!s),[s,n]),_=We("Block Inserter","Generic label for block inserter button"),v=m(s?"Close":"Add");return a.jsx(tI,{className:oe("editor-document-tools","edit-post-header-toolbar",e),"aria-label":g,variant:"unstyled",children:a.jsxs("div",{className:"editor-document-tools__left",children:[!r&&a.jsx(Vt,{ref:l,className:"editor-document-tools__inserter-toggle",variant:"primary",isPressed:s,onMouseDown:f,onClick:A,disabled:t,icon:Fs,label:d?v:_,showTooltip:!d,"aria-expanded":s}),(h||!d)&&a.jsxs(a.Fragment,{children:[p&&b&&a.jsx(bs,{as:NNt,showTooltip:!d,variant:d?"tertiary":void 0,disabled:t,size:"compact"}),a.jsx(bs,{as:rUt,showTooltip:!d,variant:d?"tertiary":void 0,size:"compact"}),a.jsx(bs,{as:nUt,showTooltip:!d,variant:d?"tertiary":void 0,size:"compact"}),!r&&a.jsx(Vt,{className:"editor-document-tools__document-overview-toggle",icon:LP,disabled:t,isPressed:i,label:m("Document Overview"),onClick:z,shortcut:c,showTooltip:!d,variant:d?"tertiary":void 0,"aria-expanded":i,ref:u})]})]})})}function yKt(){const{createNotice:e}=Oe(mt),{getCurrentPostId:t,getCurrentPostType:n}=G(_e),{getEditedEntityRecord:o}=G(Me);function r(){const c=o("postType",n(),t());if(!c)return"";if(typeof c.content=="function")return c.content(c);if(c.blocks)return Jd(c.blocks);if(c.content)return c.content}function s(){e("info",m("All content copied."),{isDismissible:!0,type:"snackbar"})}const i=Hl(r,s);return a.jsx(Ct,{ref:i,children:m("Copy all blocks")})}const AKt=[{value:"visual",label:m("Visual editor")},{value:"text",label:m("Code editor")}];function vKt(){const{shortcut:e,isRichEditingEnabled:t,isCodeEditingEnabled:n,mode:o}=G(c=>({shortcut:c(Pi).getShortcutRepresentation("core/editor/toggle-mode"),isRichEditingEnabled:c(_e).getEditorSettings().richEditingEnabled,isCodeEditingEnabled:c(_e).getEditorSettings().codeEditingEnabled,mode:c(_e).getEditorMode()}),[]),{switchEditorMode:r}=Oe(_e);let s=o;!t&&o==="visual"&&(s="text"),!n&&o==="text"&&(s="visual");const i=AKt.map(c=>(!n&&c.value==="text"&&(c={...c,disabled:!0}),!t&&c.value==="visual"&&(c={...c,disabled:!0,info:m("You can enable the visual editor in your profile settings.")}),c.value!==s&&!c.disabled?{...c,shortcut:e}:c));return a.jsx(Cn,{label:m("Editor"),children:a.jsx(kf,{choices:i,value:s,onSelect:r})})}const{Fill:YI,Slot:xKt}=Qn("ToolsMoreMenuGroup");YI.Slot=({fillProps:e})=>a.jsx(xKt,{fillProps:e});const{Fill:ZI,Slot:wKt}=Qn(Symbol("ViewMoreMenuGroup"));ZI.Slot=({fillProps:e})=>a.jsx(wKt,{fillProps:e});function _Kt(){const{openModal:e}=Oe(xo),{set:t}=Oe(ht),{toggleDistractionFree:n}=Oe(_e),o=G(s=>s(ht).get("core","showIconLabels"),[]),r=()=>{t("core","distractionFree",!1)};return a.jsx(a.Fragment,{children:a.jsx(c0,{icon:Wc,label:m("Options"),popoverProps:{placement:"bottom-end",className:"more-menu-dropdown__content"},toggleProps:{showTooltip:!o,...o&&{variant:"tertiary"},tooltipPosition:"bottom",size:"compact"},children:({onClose:s})=>a.jsxs(a.Fragment,{children:[a.jsxs(Cn,{label:We("View","noun"),children:[a.jsx(eq,{scope:"core",name:"fixedToolbar",onToggle:r,label:m("Top toolbar"),info:m("Access all block and document tools in a single place"),messageActivated:m("Top toolbar activated."),messageDeactivated:m("Top toolbar deactivated.")}),a.jsx(eq,{scope:"core",name:"distractionFree",label:m("Distraction free"),info:m("Write with calmness"),handleToggling:!1,onToggle:()=>n({createNotice:!1}),messageActivated:m("Distraction free mode activated."),messageDeactivated:m("Distraction free mode deactivated."),shortcut:j1.primaryShift("\\")}),a.jsx(eq,{scope:"core",name:"focusMode",label:m("Spotlight mode"),info:m("Focus on one block at a time"),messageActivated:m("Spotlight mode activated."),messageDeactivated:m("Spotlight mode deactivated.")}),a.jsx(ZI.Slot,{fillProps:{onClose:s}})]}),a.jsx(vKt,{}),a.jsx(IO.Slot,{name:"core/plugin-more-menu",label:m("Plugins"),fillProps:{onClick:s}}),a.jsxs(Cn,{label:m("Tools"),children:[a.jsx(Ct,{onClick:()=>e("editor/keyboard-shortcut-help"),shortcut:j1.access("h"),children:m("Keyboard shortcuts")}),a.jsx(yKt,{}),a.jsxs(Ct,{icon:vf,href:m("https://wordpress.org/documentation/article/wordpress-block-editor/"),target:"_blank",rel:"noopener noreferrer",children:[m("Help"),a.jsx(qn,{as:"span",children:m("(opens in a new tab)")})]}),a.jsx(YI.Slot,{fillProps:{onClose:s}})]}),a.jsx(Cn,{children:a.jsx(Ct,{onClick:()=>e("editor/preferences"),children:m("Preferences")})})]})})})}const vne="toggle",xne="button";function kKt({forceIsDirty:e,setEntitiesSavedStatesCallback:t}){let n;const o=Yn("medium","<"),{togglePublishSidebar:r}=Oe(_e),{hasPublishAction:s,isBeingScheduled:i,isPending:c,isPublished:l,isPublishSidebarEnabled:u,isPublishSidebarOpened:d,isScheduled:p,postStatus:f,postStatusHasChanged:b}=G(h=>{var g;return{hasPublishAction:(g=!!h(_e).getCurrentPost()?._links?.["wp:action-publish"])!==null&&g!==void 0?g:!1,isBeingScheduled:h(_e).isEditedPostBeingScheduled(),isPending:h(_e).isCurrentPostPending(),isPublished:h(_e).isCurrentPostPublished(),isPublishSidebarEnabled:h(_e).isPublishSidebarEnabled(),isPublishSidebarOpened:h(_e).isPublishSidebarOpened(),isScheduled:h(_e).isCurrentPostScheduled(),postStatus:h(_e).getEditedPostAttribute("status"),postStatusHasChanged:h(_e).getPostEdits()?.status}},[]);return l||b&&!["future","publish"].includes(f)||p&&i||c&&!s&&!o?n=xne:o||u?n=vne:n=xne,a.jsx(lye,{forceIsDirty:e,isOpen:d,isToggle:n===vne,onToggle:r,setEntitiesSavedStatesCallback:t})}function SKt(){const{hasLoaded:e,permalink:t,isPublished:n,label:o,showIconLabels:r}=G(s=>{const i=s(_e).getCurrentPostType(),c=s(Me).getPostType(i),{get:l}=s(ht);return{permalink:s(_e).getPermalink(),isPublished:s(_e).isCurrentPostPublished(),label:c?.labels.view_item,hasLoaded:!!c,showIconLabels:l("core","showIconLabels")}},[]);return!n||!t||!e?null:a.jsx(Ce,{icon:vf,label:o||m("View post"),href:t,target:"_blank",showTooltip:!r,size:"compact"})}function CKt({forceIsAutosaveable:e,disabled:t}){const{deviceType:n,homeUrl:o,isTemplate:r,isViewable:s,showIconLabels:i,isTemplateHidden:c,templateId:l}=G(v=>{var M;const{getDeviceType:y,getCurrentPostType:k,getCurrentTemplateId:S}=v(_e),{getRenderingMode:C}=St(v(_e)),{getEntityRecord:R,getPostType:T}=v(Me),{get:E}=v(ht),B=k();return{deviceType:y(),homeUrl:R("root","__unstableBase")?.home,isTemplate:B==="wp_template",isViewable:(M=T(B)?.viewable)!==null&&M!==void 0?M:!1,showIconLabels:E("core","showIconLabels"),isTemplateHidden:C()==="post-only",templateId:S()}},[]),{setDeviceType:u,setRenderingMode:d}=Oe(_e),{resetZoomLevel:p}=St(Oe(J)),f=v=>{u(v),p()};if(Yn("medium","<"))return null;const h={placement:"bottom-end"},g={className:"editor-preview-dropdown__toggle",iconPosition:"right",size:"compact",showTooltip:!i,disabled:t,accessibleWhenDisabled:t},z={"aria-label":m("View options")},A={desktop:XK,mobile:GK,tablet:YK},_=[{value:"Desktop",label:m("Desktop"),icon:XK},{value:"Tablet",label:m("Tablet"),icon:YK},{value:"Mobile",label:m("Mobile"),icon:GK}];return a.jsx(c0,{className:oe("editor-preview-dropdown",`editor-preview-dropdown--${n.toLowerCase()}`),popoverProps:h,toggleProps:g,menuProps:z,icon:A[n.toLowerCase()],label:m("View"),disableOpenOnArrowDown:t,children:({onClose:v})=>a.jsxs(a.Fragment,{children:[a.jsx(Cn,{children:a.jsx(kf,{choices:_,value:n,onSelect:f})}),r&&a.jsx(Cn,{children:a.jsxs(Ct,{href:o,target:"_blank",icon:vf,onClick:v,children:[m("View site"),a.jsx(qn,{as:"span",children:m("(opens in a new tab)")})]})}),!r&&!!l&&a.jsx(Cn,{children:a.jsx(Ct,{icon:c?void 0:M0,isSelected:!c,role:"menuitemcheckbox",onClick:()=>{d(c?"template-locked":"post-only")},children:m("Show template")})}),s&&a.jsx(Cn,{children:a.jsx(cye,{className:"editor-preview-dropdown__button-external",role:"menuitem",forceIsAutosaveable:e,"aria-label":m("Preview in new tab"),textContent:a.jsxs(a.Fragment,{children:[m("Preview in new tab"),a.jsx(qo,{icon:vf})]}),onPreview:v})}),a.jsx(IO.Slot,{name:"core/plugin-preview-menu",fillProps:{onClick:v}})]})})}const qKt=({disabled:e})=>{const{isZoomOut:t,showIconLabels:n,isDistractionFree:o}=G(u=>({isZoomOut:St(u(J)).isZoomOut(),showIconLabels:u(ht).get("core","showIconLabels"),isDistractionFree:u(ht).get("core","distractionFree")})),{resetZoomLevel:r,setZoomLevel:s}=St(Oe(J)),{registerShortcut:i,unregisterShortcut:c}=Oe(Pi);x.useEffect(()=>(i({name:"core/editor/zoom",category:"global",description:m("Enter or exit zoom out."),keyCombination:{modifier:da()?"primaryShift":"secondary",character:"0"}}),()=>{c("core/editor/zoom")}),[i,c]),p0("core/editor/zoom",()=>{t?r():s("auto-scaled")},{isDisabled:o});const l=()=>{t?r():s("auto-scaled")};return a.jsx(Ce,{accessibleWhenDisabled:!0,disabled:e,onClick:l,icon:$Qe,label:m("Zoom Out"),isPressed:t,size:"compact",showTooltip:!n,className:"editor-zoom-out-toggle"})},RKt=window?.__experimentalEnableBlockComment,CT={distractionFreeDisabled:{y:"-50px"},distractionFreeHover:{y:0},distractionFreeHidden:{y:"-50px"},visible:{y:0},hidden:{y:0}},TKt={distractionFreeDisabled:{x:"-100%"},distractionFreeHover:{x:0},distractionFreeHidden:{x:"-100%"},visible:{x:0},hidden:{x:0}};function EKt({customSaveButton:e,forceIsDirty:t,forceDisableBlockTools:n,setEntitiesSavedStatesCallback:o,title:r}){const s=Yn("large"),i=Yn("medium"),c=HN("(max-width: 403px)"),{postType:l,isTextEditor:u,isPublishSidebarOpened:d,showIconLabels:p,hasFixedToolbar:f,hasBlockSelection:b}=G(y=>{const{get:k}=y(ht),{getEditorMode:S,getCurrentPostType:C,isPublishSidebarOpened:R}=y(_e);return{postType:C(),isTextEditor:S()==="text",isPublishSidebarOpened:R(),showIconLabels:k("core","showIconLabels"),hasFixedToolbar:k("core","fixedToolbar"),hasBlockSelection:!!y(J).getBlockSelectionStart()}},[]),h=["post","page","wp_template"].includes(l),g=[Wf,Di,$l].includes(l),[z,A]=x.useState(!0),_=!c&&(!f||f&&(!b||z)),v=nKt(),M=G(y=>!!St(y(J)).getSectionRootClientId(),[]);return a.jsxs("div",{className:"editor-header edit-post-header",children:[v&&a.jsx(Rr.div,{className:"editor-header__back-button",variants:TKt,transition:{type:"tween"},children:a.jsx(XI.Slot,{})}),a.jsxs(Rr.div,{variants:CT,className:"editor-header__toolbar",transition:{type:"tween"},children:[a.jsx(OKt,{disableBlockTools:n||u}),f&&i&&a.jsx(zKt,{isCollapsed:z,onToggle:A})]}),_&&a.jsx(Rr.div,{className:"editor-header__center",variants:CT,transition:{type:"tween"},children:a.jsx(XHt,{title:r})}),a.jsxs(Rr.div,{variants:CT,transition:{type:"tween"},className:"editor-header__settings",children:[!e&&!d&&a.jsx(pGt,{forceIsDirty:t}),a.jsx(SKt,{}),a.jsx(CKt,{forceIsAutosaveable:t,disabled:g}),a.jsx(cye,{className:"editor-header__post-preview-button",forceIsAutosaveable:t}),h&&s&&M&&a.jsx(qKt,{disabled:n}),(s||!p)&&a.jsx(rk.Slot,{scope:"core"}),!e&&a.jsx(kKt,{forceIsDirty:t,setEntitiesSavedStatesCallback:o}),RKt?a.jsx(gKt,{}):void 0,e,a.jsx(_Kt,{})]})]})}const{PrivateInserterLibrary:WKt}=St(jn);function NKt(){const{blockSectionRootClientId:e,inserterSidebarToggleRef:t,inserter:n,showMostUsedBlocks:o,sidebarIsOpened:r}=G(f=>{const{getInserterSidebarToggleRef:b,getInserter:h,isPublishSidebarOpened:g}=St(f(_e)),{getBlockRootClientId:z,isZoomOut:A,getSectionRootClientId:_}=St(f(J)),{get:v}=f(ht),{getActiveComplementaryArea:M}=f(xo),y=()=>{if(A()){const k=_();if(k)return k}return z()};return{inserterSidebarToggleRef:b(),inserter:h(),showMostUsedBlocks:v("core","mostUsedBlocks"),blockSectionRootClientId:y(),sidebarIsOpened:!!(M("core")||g())}},[]),{setIsInserterOpened:s}=Oe(_e),{disableComplementaryArea:i}=Oe(xo),c=Yn("medium","<"),l=x.useRef(),u=x.useCallback(()=>{s(!1),t.current?.focus()},[t,s]),d=x.useCallback(f=>{f.keyCode===gd&&!f.defaultPrevented&&(f.preventDefault(),u())},[u]),p=a.jsx("div",{className:"editor-inserter-sidebar__content",children:a.jsx(WKt,{showMostUsedBlocks:o,showInserterHelpPanel:!0,shouldFocusBlock:c,rootClientId:e,onSelect:n.onSelect,__experimentalInitialTab:n.tab,__experimentalInitialCategory:n.category,__experimentalFilterValue:n.filterValue,onPatternCategorySelection:r?()=>i("core"):void 0,ref:l,onClose:u})});return a.jsx("div",{onKeyDown:d,className:"editor-inserter-sidebar",children:p})}function BKt(){return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"editor-list-view-sidebar__outline",children:[a.jsxs("div",{children:[a.jsx(Sn,{children:m("Characters:")}),a.jsx(Sn,{children:a.jsx(IGt,{})})]}),a.jsxs("div",{children:[a.jsx(Sn,{children:m("Words:")}),a.jsx(LGt,{})]}),a.jsxs("div",{children:[a.jsx(Sn,{children:m("Time to read:")}),a.jsx(jGt,{})]})]}),a.jsx(eUt,{})]})}const{TabbedSidebar:LKt}=St(jn);function PKt(){const{setIsListViewOpened:e}=Oe(_e),{getListViewToggleRef:t}=St(G(_e)),n=C5("firstElement"),o=x.useCallback(()=>{e(!1),t().current?.focus()},[t,e]),r=x.useCallback(g=>{g.keyCode===gd&&!g.defaultPrevented&&(g.preventDefault(),o())},[o]),[s,i]=x.useState(null),[c,l]=x.useState("list-view"),u=x.useRef(),d=x.useRef(),p=x.useRef(),f=xn([n,p,i]);function b(g){const z=Xr.tabbable.find(d.current)[0];if(g==="list-view"){const A=Xr.tabbable.find(p.current)[0];(u.current.contains(A)?A:z).focus()}else z.focus()}const h=x.useCallback(()=>{u.current.contains(u.current.ownerDocument.activeElement)?o():b(c)},[o,c]);return p0("core/editor/toggle-list-view",h),a.jsx("div",{className:"editor-list-view-sidebar",onKeyDown:r,ref:u,children:a.jsx(LKt,{tabs:[{name:"list-view",title:We("List View","Post overview"),panel:a.jsx("div",{className:"editor-list-view-sidebar__list-view-container",children:a.jsx("div",{className:"editor-list-view-sidebar__list-view-panel-content",children:a.jsx(J8t,{dropZoneElement:s})})}),panelRef:f},{name:"outline",title:We("Outline","Post overview"),panel:a.jsx("div",{className:"editor-list-view-sidebar__list-view-container",children:a.jsx(BKt,{})})}],onClose:o,onSelect:g=>l(g),defaultTabId:"list-view",ref:d,closeButtonLabel:m("Close")})})}const{Fill:Xmn,Slot:jKt}=Qn("ActionsPanel");function IKt({setEntitiesSavedStatesCallback:e,closeEntitiesSavedStates:t,isEntitiesSavedStatesOpen:n,forceIsDirtyPublishPanel:o}){const{closePublishSidebar:r,togglePublishSidebar:s}=Oe(_e),{publishSidebarOpened:i,isPublishable:c,isDirty:l,hasOtherEntitiesChanges:u}=G(f=>{const{isPublishSidebarOpened:b,isEditedPostPublishable:h,isCurrentPostPublished:g,isEditedPostDirty:z,hasNonPostEntityChanges:A}=f(_e),_=A();return{publishSidebarOpened:b(),isPublishable:!g()&&h(),isDirty:_||z(),hasOtherEntitiesChanges:_}},[]),d=x.useCallback(()=>e(!0),[]);let p;return i?p=a.jsx(cGt,{onClose:r,forceIsDirty:o,PrePublishExtension:oye.Slot,PostPublishExtension:tye.Slot}):c&&!u?p=a.jsx("div",{className:"editor-layout__toggle-publish-panel",children:a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"secondary",onClick:s,"aria-expanded":!1,children:m("Open publish panel")})}):p=a.jsx("div",{className:"editor-layout__toggle-entities-saved-states-panel",children:a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"secondary",onClick:d,"aria-expanded":!1,"aria-haspopup":"dialog",disabled:!l,accessibleWhenDisabled:!0,children:m("Open save panel")})}),a.jsxs(a.Fragment,{children:[n&&a.jsx(gUt,{close:t,renderDialog:!0}),a.jsx(jKt,{bubblesVirtually:!0}),!n&&p]})}function DKt({autoFocus:e=!1}){const{switchEditorMode:t}=Oe(_e),{shortcut:n,isRichEditingEnabled:o}=G(s=>{const{getEditorSettings:i}=s(_e),{getShortcutRepresentation:c}=s(Pi);return{shortcut:c("core/editor/toggle-mode"),isRichEditingEnabled:i().richEditingEnabled}},[]),r=x.useRef();return x.useEffect(()=>{e||r?.current?.focus()},[e]),a.jsxs("div",{className:"editor-text-editor",children:[o&&a.jsxs("div",{className:"editor-text-editor__toolbar",children:[a.jsx("h2",{children:m("Editing code")}),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>t("visual"),shortcut:n,children:m("Exit code editor")})]}),a.jsxs("div",{className:"editor-text-editor__body",children:[a.jsx(Sye,{ref:r}),a.jsx(HI,{})]})]})}function FKt({contentRef:e}){const{onNavigateToEntityRecord:t,templateId:n}=G(i=>{const{getEditorSettings:c,getCurrentTemplateId:l}=i(_e);return{onNavigateToEntityRecord:c().onNavigateToEntityRecord,templateId:l()}},[]),o=G(i=>!!i(Me).canUser("create",{kind:"postType",name:"wp_template"}),[]),[r,s]=x.useState(!1);return x.useEffect(()=>{const i=l=>{o&&(!l.target.classList.contains("is-root-container")||l.target.dataset?.type==="core/template-part"||l.defaultPrevented||(l.preventDefault(),s(!0)))},c=e.current;return c?.addEventListener("dblclick",i),()=>{c?.removeEventListener("dblclick",i)}},[e,o]),o?a.jsx(wf,{isOpen:r,confirmButtonText:m("Edit template"),onConfirm:()=>{s(!1),t({postId:n,postType:"wp_template"})},onCancel:()=>s(!1),size:"medium",children:m("You’ve tried to select a block that is part of a template, which may be used on other posts and pages. Would you like to edit the template?")}):null}const wne=20;function _ne({direction:e,resizeWidthBy:t}){function n(s){const{keyCode:i}=s;i!==wi&&i!==_i||(s.preventDefault(),e==="left"&&i===wi||e==="right"&&i===_i?t(wne):(e==="left"&&i===_i||e==="right"&&i===wi)&&t(-wne))}const o={active:{opacity:1,scaleY:1.3}},r=`resizable-editor__resize-help-${e}`;return a.jsxs(a.Fragment,{children:[a.jsx(B0,{text:m("Drag to resize"),children:a.jsx(Rr.button,{className:`editor-resizable-editor__resize-handle is-${e}`,"aria-label":m("Drag to resize"),"aria-describedby":r,onKeyDown:n,variants:o,whileFocus:"active",whileHover:"active",whileTap:"active",role:"separator","aria-orientation":"vertical"},"handle")}),a.jsx(qn,{id:r,children:m("Use left and right arrow keys to resize the canvas.")})]})}const kne={position:void 0,userSelect:void 0,cursor:void 0,width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0};function Nye({className:e,enableResizing:t,height:n,children:o}){const[r,s]=x.useState("100%"),i=x.useRef(),c=x.useCallback(l=>{i.current&&s(i.current.offsetWidth+l)},[]);return a.jsx(Ca,{className:oe("editor-resizable-editor",e,{"is-resizable":t}),ref:l=>{i.current=l?.resizable},size:{width:t?r:"100%",height:t&&n?n:"100%"},onResizeStop:(l,u,d)=>{s(d.style.width)},minWidth:300,maxWidth:"100%",maxHeight:"100%",enable:{left:t,right:t},showHandle:t,resizeRatio:2,handleComponent:{left:a.jsx(_ne,{direction:"left",resizeWidthBy:c}),right:a.jsx(_ne,{direction:"right",resizeWidthBy:c})},handleClasses:void 0,handleStyles:{left:kne,right:kne},children:o})}const $Kt=500;function Sne(e,t,n){return Math.min(Math.max(e,t),n)}function VKt(e,t,n){const o=e-Sne(e,n.left,n.right),r=t-Sne(t,n.top,n.bottom);return Math.sqrt(o*o+r*r)}function HKt({isEnabled:e=!0}={}){const{getEnabledClientIdsTree:t,getBlockName:n,getBlockOrder:o}=St(G(J)),{selectBlock:r}=Oe(J);return Mn(s=>{if(!e)return;const i=(l,u)=>{const d=t().flatMap(({clientId:b})=>{const h=n(b);if(h==="core/template-part")return[];if(h==="core/post-content"){const g=o(b);if(g.length)return g}return[b]});let p=1/0,f=null;for(const b of d){const h=s.querySelector(`[data-block="${b}"]`);if(!h)continue;const g=h.getBoundingClientRect(),z=VKt(l,u,g);z{(l.target===s||l.target.classList.contains("is-root-container"))&&i(l.clientX,l.clientY)};return s.addEventListener("click",c),()=>s.removeEventListener("click",c)},[e])}function UKt(){const{getSettings:e,isZoomOut:t}=St(G(J)),{resetZoomLevel:n}=St(Oe(J));return Mn(o=>{function r(s){if(t()&&!s.defaultPrevented){s.preventDefault();const{__experimentalSetIsInserterOpened:i}=e();typeof i=="function"&&i(!1),n()}}return o.addEventListener("dblclick",r),()=>{o.removeEventListener("dblclick",r)}},[e,t,n])}const{LayoutStyle:wv,useLayoutClasses:XKt,useLayoutStyles:GKt,ExperimentalBlockCanvas:KKt,useFlashEditableBlocks:YKt}=St(jn),ZKt=[$l,L0,Wf,Di];function iN(e){for(let t=0;t{c(ye.borderBoxSize[0].blockSize)}),u=Yn("small","<"),{renderingMode:d,postContentAttributes:p,editedPostTemplate:f={},wrapperBlockName:b,wrapperUniqueId:h,deviceType:g,isFocusedEntity:z,isDesignPostType:A,postType:_,isPreview:v}=G(ye=>{const{getCurrentPostId:Ne,getCurrentPostType:je,getCurrentTemplateId:ie,getEditorSettings:we,getRenderingMode:re,getDeviceType:pe}=ye(_e),{getPostType:ke,getEditedEntityRecord:Se}=ye(Me),se=je(),L=re();let U;se===$l?U="core/block":L==="post-only"&&(U="core/post-content");const ne=we(),ve=ne.supportsTemplateMode,qe=ke(se),Pe=ie(),rt=Pe?Se("postType",L0,Pe):void 0;return{renderingMode:L,postContentAttributes:ne.postContentAttributes,isDesignPostType:ZKt.includes(se),editedPostTemplate:qe?.viewable&&ve?rt:void 0,wrapperBlockName:U,wrapperUniqueId:Ne(),deviceType:pe(),isFocusedEntity:!!ne.onNavigateToPreviousEntityRecord,postType:se,isPreview:ne.isPreviewMode}},[]),{isCleanNewPost:M}=G(_e),{hasRootPaddingAwareAlignments:y,themeHasDisabledLayoutStyles:k,themeSupportsLayout:S,isZoomedOut:C}=G(ye=>{const{getSettings:Ne,isZoomOut:je}=St(ye(J)),ie=Ne();return{themeHasDisabledLayoutStyles:ie.disableLayoutStyles,themeSupportsLayout:ie.supportsLayout,hasRootPaddingAwareAlignments:ie.__experimentalFeatures?.useRootPaddingAwareAlignments,isZoomedOut:je()}},[]),R=BNt(g),[T]=Un("layout"),E=x.useMemo(()=>d!=="post-only"||A?{type:"default"}:S?{...T,type:"constrained"}:{type:"default"},[d,S,T,A]),B=x.useMemo(()=>{if(!f?.content&&!f?.blocks&&p)return p;if(f?.blocks)return iN(f?.blocks);const ye=typeof f?.content=="string"?f?.content:"";return iN(Ko(ye))||{}},[f?.content,f?.blocks,p]),N=x.useMemo(()=>{if(!f?.content&&!f?.blocks)return!1;if(f?.blocks)return Cne(f?.blocks);const ye=typeof f?.content=="string"?f?.content:"";return Cne(Ko(ye))||!1},[f?.content,f?.blocks]),{layout:j={},align:I=""}=B||{},P=XKt(B,"core/post-content"),$=oe({"is-layout-flow":!S},S&&P,I&&`align${I}`),F=GKt(B,"core/post-content",".block-editor-block-list__layout.is-root-container"),X=x.useMemo(()=>j&&(j?.type==="constrained"||j?.inherit||j?.contentSize||j?.wideSize)?{...T,...j,type:"constrained"}:{...T,...j,type:"default"},[j?.type,j?.inherit,j?.contentSize,j?.wideSize,T]),Z=p?X:E,V=Z?.type==="default"&&!N?E:Z,Q=qge(),te=x.useRef();x.useEffect(()=>{!e||!M()||te?.current?.focus()},[e,M]);const ee=`.is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;} +`,(o=e.match(t)?.length)!==null&&o!==void 0?o:0}function DO(e,t,n){const o=NGt(t,n);let r;switch(o.type){case"words":return r=o.wordsRegExp,BGt(e,r,o);case"characters_including_spaces":return r=o.characters_including_spacesRegExp,Mne(e,r,o);case"characters_excluding_spaces":return r=o.characters_excluding_spacesRegExp,Mne(e,r,o);default:return 0}}function LGt(){const e=G(n=>n(_e).getEditedPostAttribute("content"),[]),t=We("words","Word count type. Do not translate!");return a.jsx("span",{className:"word-count",children:DO(e,t)})}const PGt=189;function jGt(){const e=G(r=>r(_e).getEditedPostAttribute("content"),[]),t=We("words","Word count type. Do not translate!"),n=Math.round(DO(e,t)/PGt),o=n===0?cr(m("< 1 minute"),{span:a.jsx("span",{})}):cr(xe(Dn("%s minute","%s minutes",n),n),{span:a.jsx("span",{})});return a.jsx("span",{className:"time-to-read",children:o})}function IGt(){const e=G(t=>t(_e).getEditedPostAttribute("content"),[]);return DO(e,"characters_including_spaces")}const DGt={};function FGt(e,t=null,n={}){return tn(`/wp/v2/block-renderer/${e}`,{context:"edit",...t!==null?{attributes:t}:{},...n})}function $Gt(e){const{backgroundColor:t,borderColor:n,fontFamily:o,fontSize:r,gradient:s,textColor:i,className:c,...l}=e,{border:u,color:d,elements:p,spacing:f,typography:b,...h}=e?.style||DGt;return{...l,style:h}}function VGt({className:e}){return a.jsx(vo,{className:e,children:m("Block rendered as empty.")})}function HGt({response:e,className:t}){const n=xe(m("Error loading block: %s"),e.errorMsg);return a.jsx(vo,{className:t,children:n})}function UGt({children:e,showLoader:t}){return a.jsxs("div",{style:{position:"relative"},children:[t&&a.jsx("div",{style:{position:"absolute",top:"50%",left:"50%",marginTop:"-9px",marginLeft:"-9px"},children:a.jsx(Xn,{})}),a.jsx("div",{style:{opacity:t?"0.3":1},children:e})]})}function XGt(e){const{attributes:t,block:n,className:o,httpMethod:r="GET",urlQueryArgs:s,skipBlockSupportAttributes:i=!1,EmptyResponsePlaceholder:c=VGt,ErrorResponsePlaceholder:l=HGt,LoadingResponsePlaceholder:u=UGt}=e,d=x.useRef(!1),[p,f]=x.useState(!1),b=x.useRef(),[h,g]=x.useState(null),z=Fr(e),[A,_]=x.useState(!1);function v(){var C,R;if(!d.current)return;_(!0);const T=setTimeout(()=>{f(!0)},1e3);let E=t&&EB(n,t);i&&(E=$Gt(E));const B=r==="POST",N=B?null:(C=E)!==null&&C!==void 0?C:null,j=FGt(n,N,s),I=B?{attributes:(R=E)!==null&&R!==void 0?R:null}:null,P=b.current=Wt({path:j,data:I,method:B?"POST":"GET"}).then($=>{d.current&&P===b.current&&$&&g($.rendered)}).catch($=>{d.current&&P===b.current&&g({error:!0,errorMsg:$.message})}).finally(()=>{d.current&&P===b.current&&(_(!1),f(!1),clearTimeout(T))});return P}const M=q1(v,500);x.useEffect(()=>(d.current=!0,()=>{d.current=!1}),[]),x.useEffect(()=>{z===void 0?v():N0(z,e)||M()});const y=!!h,k=h==="",S=h?.error;return A?a.jsx(u,{...e,showLoader:p,children:y&&a.jsx(i0,{className:o,children:h})}):k||!y?a.jsx(c,{...e}):S?a.jsx(l,{response:h,...e}):a.jsx(i0,{className:o,children:h})}const zne={},FO=Ul(e=>{const t=e("core/editor");if(t){const n=t.getCurrentPostId();if(n&&typeof n=="number")return{currentPostId:n}}return zne})(({urlQueryArgs:e=zne,currentPostId:t,...n})=>{const o=x.useMemo(()=>t?{post_id:t,...e}:e,[t,e]);return a.jsx(XGt,{urlQueryArgs:o,...n})});function GGt(e=[]){return e.push({...$Ht}),e}Bn("editor.Autocomplete.completers","editor/autocompleters/set-default-completers",GGt);Bn("editor.MediaUpload","core/editor/components/media-upload",()=>zOe);const{PatternOverridesControls:KGt,ResetOverridesControl:YGt,PatternOverridesBlockControls:ZGt,PATTERN_TYPES:QGt,PARTIAL_SYNCING_SUPPORTED_BLOCKS:JGt,PATTERN_SYNC_TYPES:One}=St(Vi),eKt=Or(e=>t=>{const n=!!JGt[t.name];return a.jsxs(a.Fragment,{children:[a.jsx(e,{...t},"edit"),t.isSelected&&n&&a.jsx(tKt,{...t}),n&&a.jsx(ZGt,{})]})},"withPatternOverrideControls");function tKt(e){const t=Jr(),{hasPatternOverridesSource:n,isEditingSyncedPattern:o}=G(l=>{const{getCurrentPostType:u,getEditedPostAttribute:d}=l(_e);return{hasPatternOverridesSource:!!vl("core/pattern-overrides"),isEditingSyncedPattern:u()===QGt.user&&d("meta")?.wp_pattern_sync_status!==One.unsynced&&d("wp_pattern_sync_status")!==One.unsynced}},[]),r=e.attributes.metadata?.bindings,s=!!r&&Object.values(r).some(l=>l.source==="core/pattern-overrides"),i=o&&t==="default",c=!o&&!!e.attributes.metadata?.name&&t!=="disabled"&&s;return n?a.jsxs(a.Fragment,{children:[i&&a.jsx(KGt,{...e}),c&&a.jsx(YGt,{...e})]}):null}Bn("editor.BlockEdit","core/editor/with-pattern-override-controls",eKt);const Wye=Qn(Symbol("EditCanvasContainerSlot")),UI="__experimentalMainDashboardButton",nKt=()=>{const e=H0(UI);return!!(e&&e.length)},{Fill:oKt,Slot:rKt}=Qn(UI),XI=oKt,sKt=()=>{const e=H0(UI);return a.jsx(rKt,{bubblesVirtually:!0,fillProps:{length:e?e.length:0}})};XI.Slot=sKt;const iKt="edit-post/collab-history-sidebar",yne="edit-post/collab-sidebar";function GI({avatar:e,name:t,date:n}){const o=Sa(),[r=o.formats.time]=Ao("root","site","time_format"),{currentUserAvatar:s,currentUserName:i}=G(l=>{var u;const d=l(Me).getCurrentUser(),{getSettings:p}=l(J),{__experimentalDiscussionSettings:f}=p(),b=f?.avatarURL;return{currentUserAvatar:(u=d?.avatar_urls[48])!==null&&u!==void 0?u:b,currentUserName:d?.name}},[]),c=new Date;return a.jsxs(a.Fragment,{children:[a.jsx("img",{src:e??s,className:"editor-collab-sidebar-panel__user-avatar",alt:m("User avatar"),width:32,height:32}),a.jsxs(dt,{spacing:"0",children:[a.jsx("span",{className:"editor-collab-sidebar-panel__user-name",children:t??i}),a.jsx("time",{dateTime:r0("c",n??c),className:"editor-collab-sidebar-panel__user-time",children:r0(r,n??c)})]})]})}function aKt(e){return e.trim()}function cKt(e){const t=n=>n.reduce((o,r)=>{if(r.attributes&&r.attributes.blockCommentId&&!o.includes(r.attributes.blockCommentId)&&o.push(r.attributes.blockCommentId),r.innerBlocks&&r.innerBlocks.length>0){const s=t(r.innerBlocks);o.push(...s)}return o},[]);return t(e)}function KI({onSubmit:e,onCancel:t,thread:n,submitButtonText:o}){var r;const[s,i]=x.useState((r=n?.content?.raw)!==null&&r!==void 0?r:"");return a.jsxs(a.Fragment,{children:[a.jsx(Li,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:s??"",onChange:i}),a.jsxs(Ot,{alignment:"left",spacing:"3",justify:"flex-start",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,accessibleWhenDisabled:!0,variant:"primary",onClick:()=>{e(s),i("")},disabled:aKt(s).length===0,text:o}),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,text:We("Cancel","Cancel comment button")})]})]})}function lKt({threads:e,onEditComment:t,onAddReply:n,onCommentDelete:o,onCommentResolve:r,showCommentBoard:s,setShowCommentBoard:i}){const{blockCommentId:c}=G(p=>{const{getBlockAttributes:f,getSelectedBlockClientId:b}=p(J),h=b();return{blockCommentId:h?f(h)?.blockCommentId:null}},[]),[l,u]=x.useState(s&&c?c:null),d=()=>{u(null),i(!1)};return a.jsxs(a.Fragment,{children:[(!Array.isArray(e)||e.length===0)&&a.jsx(dt,{alignment:"left",className:"editor-collab-sidebar-panel__thread",justify:"flex-start",spacing:"3",children:m("No comments available")}),Array.isArray(e)&&e.length>0&&e.map(p=>a.jsx(dt,{className:oe("editor-collab-sidebar-panel__thread",{"editor-collab-sidebar-panel__active-thread":c&&c===p.id,"editor-collab-sidebar-panel__focus-thread":l&&l===p.id}),id:p.id,spacing:"3",onClick:()=>u(p.id),children:a.jsx(uKt,{thread:p,onAddReply:n,onCommentDelete:o,onCommentResolve:r,onEditComment:t,isFocused:l===p.id,clearThreadFocus:d})},p.id))]})}function uKt({thread:e,onEditComment:t,onAddReply:n,onCommentDelete:o,onCommentResolve:r,isFocused:s,clearThreadFocus:i}){return a.jsxs(a.Fragment,{children:[a.jsx(ST,{thread:e,onResolve:r,onEdit:t,onDelete:o,status:e.status}),0a.jsxs(dt,{className:"editor-collab-sidebar-panel__child-thread",id:c.id,spacing:"2",children:[e.status!=="approved"&&a.jsx(ST,{thread:c,onEdit:t,onDelete:o}),e.status==="approved"&&a.jsx(ST,{thread:c})]},c.id))]}),e.status!=="approved"&&s&&a.jsxs(dt,{className:"editor-collab-sidebar-panel__child-thread",spacing:"2",children:[a.jsx(Ot,{alignment:"left",spacing:"3",justify:"flex-start",children:a.jsx(GI,{})}),a.jsx(dt,{spacing:"3",className:"editor-collab-sidebar-panel__comment-field",children:a.jsx(KI,{onSubmit:c=>{n(c,e.id)},onCancel:c=>{c.stopPropagation(),i()},submitButtonText:We("Reply","Add reply comment")})})]})]})}const ST=({thread:e,onResolve:t,onEdit:n,onDelete:o,status:r})=>{const[s,i]=x.useState(!1),[c,l]=x.useState(!1),u=()=>{o(e.id),i(!1),l(!1)},d=()=>{t(e.id),i(!1),l(!1)},p=()=>{i(!1),l(!1)},b=[n&&{title:We("Edit","Edit comment"),onClick:()=>{i("edit")}},o&&{title:We("Delete","Delete comment"),onClick:()=>{i("delete"),l(!0)}}].filter(h=>h?.onClick);return a.jsxs(a.Fragment,{children:[a.jsxs(Ot,{alignment:"left",spacing:"3",justify:"flex-start",children:[a.jsx(GI,{avatar:e?.author_avatar_urls?.[48],name:e?.author_name,date:e?.date}),a.jsxs("span",{className:"editor-collab-sidebar-panel__comment-status",children:[r!=="approved"&&a.jsxs(Ot,{alignment:"right",justify:"flex-end",spacing:"0",children:[e?.parent===0&&t&&a.jsx(Ce,{label:We("Resolve","Mark comment as resolved"),__next40pxDefaultSize:!0,icon:Lw,onClick:()=>{i("resolve"),l(!0)},showTooltip:!0}),0{n(e.id,h),i(!1)},onCancel:()=>p(),thread:e,submitButtonText:We("Update","verb")}),s!=="edit"&&a.jsx(i0,{children:e?.content?.raw})]})}),s==="resolve"&&a.jsx(wf,{isOpen:c,onConfirm:d,onCancel:p,confirmButtonText:"Yes",cancelButtonText:"No",children:m("Are you sure you want to mark this comment as resolved?")}),s==="delete"&&a.jsx(wf,{isOpen:c,onConfirm:u,onCancel:p,confirmButtonText:"Yes",cancelButtonText:"No",children:m("Are you sure you want to delete this comment?")})]})};function dKt({onSubmit:e,showCommentBoard:t,setShowCommentBoard:n}){const{clientId:o,blockCommentId:r}=G(s=>{const{getSelectedBlock:i}=s(J),c=i();return{clientId:c?.clientId,blockCommentId:c?.attributes?.blockCommentId}});return!t||!o||r!==void 0?null:a.jsxs(dt,{spacing:"3",className:"editor-collab-sidebar-panel__thread editor-collab-sidebar-panel__active-thread editor-collab-sidebar-panel__focus-thread",children:[a.jsx(Ot,{alignment:"left",spacing:"3",children:a.jsx(GI,{})}),a.jsx(KI,{onSubmit:s=>{e(s)},onCancel:()=>{n(!1)},submitButtonText:We("Comment","Add comment button")})]})}const{CommentIconSlotFill:pKt}=St(jn),fKt=({onClick:e})=>a.jsx(pKt.Fill,{children:({onClose:t})=>a.jsx(Ct,{icon:U3,onClick:()=>{e(),t()},"aria-haspopup":"dialog",children:We("Comment","Add comment button")})}),{CommentIconToolbarSlotFill:bKt}=St(jn),hKt=({onClick:e})=>a.jsx(bKt.Fill,{children:a.jsx(Vt,{accessibleWhenDisabled:!0,icon:U3,label:We("Comment","View comment"),onClick:e})}),mKt=e=>(e.attributes.blockCommentId||(e.attributes={...e.attributes,blockCommentId:{type:"number"}}),e);Bn("blocks.registerBlockType","block-comment/modify-core-block-attributes",mKt);function Ane({showCommentBoard:e,setShowCommentBoard:t,styles:n,comments:o}){const{createNotice:r}=Oe(mt),{saveEntityRecord:s,deleteEntityRecord:i}=Oe(Me),{getEntityRecord:c}=C0e(Me),{postId:l}=G(z=>{const{getCurrentPostId:A}=z(_e);return{postId:A()}},[]),{getSelectedBlockClientId:u}=G(J),{updateBlockAttributes:d}=Oe(J),p=async(z,A)=>{const v={...{post:l,content:z,comment_type:"block_comment",comment_approved:0},...A?{parent:A}:{}},M=await s("root","comment",v);M?(A||d(u(),{blockCommentId:M?.id}),r("snackbar",m(A?"Reply added successfully.":"Comment added successfully."),{type:"snackbar",isDismissible:!0})):h()},f=async z=>{await s("root","comment",{id:z,status:"approved"})?r("snackbar",m("Comment marked as resolved."),{type:"snackbar",isDismissible:!0}):h()},b=async(z,A)=>{await s("root","comment",{id:z,content:A})?r("snackbar",m("Comment edited successfully."),{type:"snackbar",isDismissible:!0}):h()},h=()=>{r("error",m("Something went wrong. Please try publishing the post, or you may have already submitted your comment earlier."),{isDismissible:!0})},g=async z=>{const A=await c("root","comment",z);await i("root","comment",z),A&&!A.parent&&d(u(),{blockCommentId:void 0}),r("snackbar",m("Comment deleted successfully."),{type:"snackbar",isDismissible:!0})};return a.jsxs("div",{className:"editor-collab-sidebar-panel",style:n,children:[a.jsx(dKt,{onSubmit:p,showCommentBoard:e,setShowCommentBoard:t}),a.jsx(lKt,{threads:o,onEditComment:b,onAddReply:p,onCommentDelete:g,onCommentResolve:f,showCommentBoard:e,setShowCommentBoard:t},u())]})}function gKt(){const[e,t]=x.useState(!1),{enableComplementaryArea:n}=Oe(xo),{getActiveComplementaryArea:o}=G(xo),{postId:r,postType:s,postStatus:i,threads:c}=G(z=>{const{getCurrentPostId:A,getCurrentPostType:_}=z(_e),v=A(),M=v&&typeof v=="number"?z(Me).getEntityRecords("root","comment",{post:v,type:"block_comment",status:"any",per_page:100}):null;return{postId:v,postType:_(),postStatus:z(_e).getEditedPostAttribute("status"),threads:M}},[]),{blockCommentId:l}=G(z=>{const{getBlockAttributes:A,getSelectedBlockClientId:_}=z(J),v=_();return{blockCommentId:v?A(v)?.blockCommentId:null}},[]),u=()=>{t(!0),n("core","edit-post/collab-sidebar")},[d]=ya("postType",s,{id:r}),{resultComments:p,sortedThreads:f}=x.useMemo(()=>{const z={},A=[],_=(c??[]).filter(S=>S.status!=="trash");if(_.forEach(S=>{z[S.id]={...S,reply:[]}}),_.forEach(S=>{S.parent===0?A.push(z[S.id]):z[S.parent]&&z[S.parent].reply.push(z[S.id])}),A?.length===0)return{resultComments:[],sortedThreads:[]};const v=A.map(S=>({...S,reply:[...S.reply].reverse()})),M=cKt(d),y=new Map(v.map(S=>[S.id,S])),k=M.map(S=>y.get(S)).filter(S=>S!==void 0);return{resultComments:v,sortedThreads:k}},[c,d]),{merged:b}=PI(),h=b?.styles?.color?.background;if(0{o("core")||(n("core",yne),z())})}if(i==="publish")return null;const g=l?hKt:fKt;return a.jsxs(a.Fragment,{children:[a.jsx(g,{onClick:u}),a.jsx(rN,{identifier:iKt,title:m("Comments"),icon:U3,children:a.jsx(Ane,{comments:p,showCommentBoard:e,setShowCommentBoard:t})}),a.jsx(rN,{isPinnable:!1,header:!1,identifier:yne,className:"editor-collab-sidebar",headerClassName:"editor-collab-sidebar__header",children:a.jsx(Ane,{comments:f,showCommentBoard:e,setShowCommentBoard:t,styles:{backgroundColor:h}})})]})}const{useHasBlockToolbar:MKt}=St(jn);function zKt({isCollapsed:e,onToggle:t}){const{blockSelectionStart:n}=G(s=>({blockSelectionStart:s(J).getBlockSelectionStart()}),[]),o=MKt(),r=!!n;return x.useEffect(()=>{n&&t(!1)},[n,t]),o?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:oe("editor-collapsible-block-toolbar",{"is-collapsed":e||!r}),children:a.jsx(lI,{hideDragHandle:!0})}),a.jsx(Io.Slot,{name:"block-toolbar"}),a.jsx(Ce,{className:"editor-collapsible-block-toolbar__toggle",icon:e?_de:wde,onClick:()=>{t(!e)},label:m(e?"Show block tools":"Hide block tools"),size:"compact"})]}):null}function OKt({className:e,disableBlockTools:t=!1}){const{setIsInserterOpened:n,setIsListViewOpened:o}=Oe(_e),{isDistractionFree:r,isInserterOpened:s,isListViewOpen:i,listViewShortcut:c,inserterSidebarToggleRef:l,listViewToggleRef:u,showIconLabels:d,showTools:p}=G(M=>{const{get:y}=M(ht),{isListViewOpened:k,getEditorMode:S,getInserterSidebarToggleRef:C,getListViewToggleRef:R,getRenderingMode:T,getCurrentPostType:E}=St(M(_e)),{getShortcutRepresentation:B}=M(Pi);return{isInserterOpened:M(_e).isInserterOpened(),isListViewOpen:k(),listViewShortcut:B("core/editor/toggle-list-view"),inserterSidebarToggleRef:C(),listViewToggleRef:R(),showIconLabels:y("core","showIconLabels"),isDistractionFree:y("core","distractionFree"),isVisualMode:S()==="visual",showTools:!!window?.__experimentalEditorWriteMode&&(T()!=="post-only"||E()==="wp_template")}},[]),f=M=>{s&&M.preventDefault()},b=Yn("medium"),h=Yn("wide"),g=m("Document tools"),z=x.useCallback(()=>o(!i),[o,i]),A=x.useCallback(()=>n(!s),[s,n]),_=We("Block Inserter","Generic label for block inserter button"),v=m(s?"Close":"Add");return a.jsx(tI,{className:oe("editor-document-tools","edit-post-header-toolbar",e),"aria-label":g,variant:"unstyled",children:a.jsxs("div",{className:"editor-document-tools__left",children:[!r&&a.jsx(Vt,{ref:l,className:"editor-document-tools__inserter-toggle",variant:"primary",isPressed:s,onMouseDown:f,onClick:A,disabled:t,icon:Fs,label:d?v:_,showTooltip:!d,"aria-expanded":s}),(h||!d)&&a.jsxs(a.Fragment,{children:[p&&b&&a.jsx(bs,{as:NNt,showTooltip:!d,variant:d?"tertiary":void 0,disabled:t,size:"compact"}),a.jsx(bs,{as:rUt,showTooltip:!d,variant:d?"tertiary":void 0,size:"compact"}),a.jsx(bs,{as:nUt,showTooltip:!d,variant:d?"tertiary":void 0,size:"compact"}),!r&&a.jsx(Vt,{className:"editor-document-tools__document-overview-toggle",icon:LP,disabled:t,isPressed:i,label:m("Document Overview"),onClick:z,shortcut:c,showTooltip:!d,variant:d?"tertiary":void 0,"aria-expanded":i,ref:u})]})]})})}function yKt(){const{createNotice:e}=Oe(mt),{getCurrentPostId:t,getCurrentPostType:n}=G(_e),{getEditedEntityRecord:o}=G(Me);function r(){const c=o("postType",n(),t());if(!c)return"";if(typeof c.content=="function")return c.content(c);if(c.blocks)return Jd(c.blocks);if(c.content)return c.content}function s(){e("info",m("All content copied."),{isDismissible:!0,type:"snackbar"})}const i=Hl(r,s);return a.jsx(Ct,{ref:i,children:m("Copy all blocks")})}const AKt=[{value:"visual",label:m("Visual editor")},{value:"text",label:m("Code editor")}];function vKt(){const{shortcut:e,isRichEditingEnabled:t,isCodeEditingEnabled:n,mode:o}=G(c=>({shortcut:c(Pi).getShortcutRepresentation("core/editor/toggle-mode"),isRichEditingEnabled:c(_e).getEditorSettings().richEditingEnabled,isCodeEditingEnabled:c(_e).getEditorSettings().codeEditingEnabled,mode:c(_e).getEditorMode()}),[]),{switchEditorMode:r}=Oe(_e);let s=o;!t&&o==="visual"&&(s="text"),!n&&o==="text"&&(s="visual");const i=AKt.map(c=>(!n&&c.value==="text"&&(c={...c,disabled:!0}),!t&&c.value==="visual"&&(c={...c,disabled:!0,info:m("You can enable the visual editor in your profile settings.")}),c.value!==s&&!c.disabled?{...c,shortcut:e}:c));return a.jsx(Cn,{label:m("Editor"),children:a.jsx(kf,{choices:i,value:s,onSelect:r})})}const{Fill:YI,Slot:xKt}=Qn("ToolsMoreMenuGroup");YI.Slot=({fillProps:e})=>a.jsx(xKt,{fillProps:e});const{Fill:ZI,Slot:wKt}=Qn(Symbol("ViewMoreMenuGroup"));ZI.Slot=({fillProps:e})=>a.jsx(wKt,{fillProps:e});function _Kt(){const{openModal:e}=Oe(xo),{set:t}=Oe(ht),{toggleDistractionFree:n}=Oe(_e),o=G(s=>s(ht).get("core","showIconLabels"),[]),r=()=>{t("core","distractionFree",!1)};return a.jsx(a.Fragment,{children:a.jsx(c0,{icon:Wc,label:m("Options"),popoverProps:{placement:"bottom-end",className:"more-menu-dropdown__content"},toggleProps:{showTooltip:!o,...o&&{variant:"tertiary"},tooltipPosition:"bottom",size:"compact"},children:({onClose:s})=>a.jsxs(a.Fragment,{children:[a.jsxs(Cn,{label:We("View","noun"),children:[a.jsx(eq,{scope:"core",name:"fixedToolbar",onToggle:r,label:m("Top toolbar"),info:m("Access all block and document tools in a single place"),messageActivated:m("Top toolbar activated."),messageDeactivated:m("Top toolbar deactivated.")}),a.jsx(eq,{scope:"core",name:"distractionFree",label:m("Distraction free"),info:m("Write with calmness"),handleToggling:!1,onToggle:()=>n({createNotice:!1}),messageActivated:m("Distraction free mode activated."),messageDeactivated:m("Distraction free mode deactivated."),shortcut:j1.primaryShift("\\")}),a.jsx(eq,{scope:"core",name:"focusMode",label:m("Spotlight mode"),info:m("Focus on one block at a time"),messageActivated:m("Spotlight mode activated."),messageDeactivated:m("Spotlight mode deactivated.")}),a.jsx(ZI.Slot,{fillProps:{onClose:s}})]}),a.jsx(vKt,{}),a.jsx(IO.Slot,{name:"core/plugin-more-menu",label:m("Plugins"),fillProps:{onClick:s}}),a.jsxs(Cn,{label:m("Tools"),children:[a.jsx(Ct,{onClick:()=>e("editor/keyboard-shortcut-help"),shortcut:j1.access("h"),children:m("Keyboard shortcuts")}),a.jsx(yKt,{}),a.jsxs(Ct,{icon:vf,href:m("https://wordpress.org/documentation/article/wordpress-block-editor/"),target:"_blank",rel:"noopener noreferrer",children:[m("Help"),a.jsx(qn,{as:"span",children:m("(opens in a new tab)")})]}),a.jsx(YI.Slot,{fillProps:{onClose:s}})]}),a.jsx(Cn,{children:a.jsx(Ct,{onClick:()=>e("editor/preferences"),children:m("Preferences")})})]})})})}const vne="toggle",xne="button";function kKt({forceIsDirty:e,setEntitiesSavedStatesCallback:t}){let n;const o=Yn("medium","<"),{togglePublishSidebar:r}=Oe(_e),{hasPublishAction:s,isBeingScheduled:i,isPending:c,isPublished:l,isPublishSidebarEnabled:u,isPublishSidebarOpened:d,isScheduled:p,postStatus:f,postStatusHasChanged:b}=G(h=>{var g;return{hasPublishAction:(g=!!h(_e).getCurrentPost()?._links?.["wp:action-publish"])!==null&&g!==void 0?g:!1,isBeingScheduled:h(_e).isEditedPostBeingScheduled(),isPending:h(_e).isCurrentPostPending(),isPublished:h(_e).isCurrentPostPublished(),isPublishSidebarEnabled:h(_e).isPublishSidebarEnabled(),isPublishSidebarOpened:h(_e).isPublishSidebarOpened(),isScheduled:h(_e).isCurrentPostScheduled(),postStatus:h(_e).getEditedPostAttribute("status"),postStatusHasChanged:h(_e).getPostEdits()?.status}},[]);return l||b&&!["future","publish"].includes(f)||p&&i||c&&!s&&!o?n=xne:o||u?n=vne:n=xne,a.jsx(lye,{forceIsDirty:e,isOpen:d,isToggle:n===vne,onToggle:r,setEntitiesSavedStatesCallback:t})}function SKt(){const{hasLoaded:e,permalink:t,isPublished:n,label:o,showIconLabels:r}=G(s=>{const i=s(_e).getCurrentPostType(),c=s(Me).getPostType(i),{get:l}=s(ht);return{permalink:s(_e).getPermalink(),isPublished:s(_e).isCurrentPostPublished(),label:c?.labels.view_item,hasLoaded:!!c,showIconLabels:l("core","showIconLabels")}},[]);return!n||!t||!e?null:a.jsx(Ce,{icon:vf,label:o||m("View post"),href:t,target:"_blank",showTooltip:!r,size:"compact"})}function CKt({forceIsAutosaveable:e,disabled:t}){const{deviceType:n,homeUrl:o,isTemplate:r,isViewable:s,showIconLabels:i,isTemplateHidden:c,templateId:l}=G(v=>{var M;const{getDeviceType:y,getCurrentPostType:k,getCurrentTemplateId:S}=v(_e),{getRenderingMode:C}=St(v(_e)),{getEntityRecord:R,getPostType:T}=v(Me),{get:E}=v(ht),B=k();return{deviceType:y(),homeUrl:R("root","__unstableBase")?.home,isTemplate:B==="wp_template",isViewable:(M=T(B)?.viewable)!==null&&M!==void 0?M:!1,showIconLabels:E("core","showIconLabels"),isTemplateHidden:C()==="post-only",templateId:S()}},[]),{setDeviceType:u,setRenderingMode:d}=Oe(_e),{resetZoomLevel:p}=St(Oe(J)),f=v=>{u(v),p()};if(Yn("medium","<"))return null;const h={placement:"bottom-end"},g={className:"editor-preview-dropdown__toggle",iconPosition:"right",size:"compact",showTooltip:!i,disabled:t,accessibleWhenDisabled:t},z={"aria-label":m("View options")},A={desktop:XK,mobile:GK,tablet:YK},_=[{value:"Desktop",label:m("Desktop"),icon:XK},{value:"Tablet",label:m("Tablet"),icon:YK},{value:"Mobile",label:m("Mobile"),icon:GK}];return a.jsx(c0,{className:oe("editor-preview-dropdown",`editor-preview-dropdown--${n.toLowerCase()}`),popoverProps:h,toggleProps:g,menuProps:z,icon:A[n.toLowerCase()],label:m("View"),disableOpenOnArrowDown:t,children:({onClose:v})=>a.jsxs(a.Fragment,{children:[a.jsx(Cn,{children:a.jsx(kf,{choices:_,value:n,onSelect:f})}),r&&a.jsx(Cn,{children:a.jsxs(Ct,{href:o,target:"_blank",icon:vf,onClick:v,children:[m("View site"),a.jsx(qn,{as:"span",children:m("(opens in a new tab)")})]})}),!r&&!!l&&a.jsx(Cn,{children:a.jsx(Ct,{icon:c?void 0:M0,isSelected:!c,role:"menuitemcheckbox",onClick:()=>{d(c?"template-locked":"post-only")},children:m("Show template")})}),s&&a.jsx(Cn,{children:a.jsx(cye,{className:"editor-preview-dropdown__button-external",role:"menuitem",forceIsAutosaveable:e,"aria-label":m("Preview in new tab"),textContent:a.jsxs(a.Fragment,{children:[m("Preview in new tab"),a.jsx(qo,{icon:vf})]}),onPreview:v})}),a.jsx(IO.Slot,{name:"core/plugin-preview-menu",fillProps:{onClick:v}})]})})}const qKt=({disabled:e})=>{const{isZoomOut:t,showIconLabels:n,isDistractionFree:o}=G(u=>({isZoomOut:St(u(J)).isZoomOut(),showIconLabels:u(ht).get("core","showIconLabels"),isDistractionFree:u(ht).get("core","distractionFree")})),{resetZoomLevel:r,setZoomLevel:s}=St(Oe(J)),{registerShortcut:i,unregisterShortcut:c}=Oe(Pi);x.useEffect(()=>(i({name:"core/editor/zoom",category:"global",description:m("Enter or exit zoom out."),keyCombination:{modifier:da()?"primaryShift":"secondary",character:"0"}}),()=>{c("core/editor/zoom")}),[i,c]),p0("core/editor/zoom",()=>{t?r():s("auto-scaled")},{isDisabled:o});const l=()=>{t?r():s("auto-scaled")};return a.jsx(Ce,{accessibleWhenDisabled:!0,disabled:e,onClick:l,icon:$Qe,label:m("Zoom Out"),isPressed:t,size:"compact",showTooltip:!n,className:"editor-zoom-out-toggle"})},RKt=window?.__experimentalEnableBlockComment,CT={distractionFreeDisabled:{y:"-50px"},distractionFreeHover:{y:0},distractionFreeHidden:{y:"-50px"},visible:{y:0},hidden:{y:0}},TKt={distractionFreeDisabled:{x:"-100%"},distractionFreeHover:{x:0},distractionFreeHidden:{x:"-100%"},visible:{x:0},hidden:{x:0}};function EKt({customSaveButton:e,forceIsDirty:t,forceDisableBlockTools:n,setEntitiesSavedStatesCallback:o,title:r}){const s=Yn("large"),i=Yn("medium"),c=DN("(max-width: 403px)"),{postType:l,isTextEditor:u,isPublishSidebarOpened:d,showIconLabels:p,hasFixedToolbar:f,hasBlockSelection:b}=G(y=>{const{get:k}=y(ht),{getEditorMode:S,getCurrentPostType:C,isPublishSidebarOpened:R}=y(_e);return{postType:C(),isTextEditor:S()==="text",isPublishSidebarOpened:R(),showIconLabels:k("core","showIconLabels"),hasFixedToolbar:k("core","fixedToolbar"),hasBlockSelection:!!y(J).getBlockSelectionStart()}},[]),h=["post","page","wp_template"].includes(l),g=[Wf,Di,$l].includes(l),[z,A]=x.useState(!0),_=!c&&(!f||f&&(!b||z)),v=nKt(),M=G(y=>!!St(y(J)).getSectionRootClientId(),[]);return a.jsxs("div",{className:"editor-header edit-post-header",children:[v&&a.jsx(qr.div,{className:"editor-header__back-button",variants:TKt,transition:{type:"tween"},children:a.jsx(XI.Slot,{})}),a.jsxs(qr.div,{variants:CT,className:"editor-header__toolbar",transition:{type:"tween"},children:[a.jsx(OKt,{disableBlockTools:n||u}),f&&i&&a.jsx(zKt,{isCollapsed:z,onToggle:A})]}),_&&a.jsx(qr.div,{className:"editor-header__center",variants:CT,transition:{type:"tween"},children:a.jsx(XHt,{title:r})}),a.jsxs(qr.div,{variants:CT,transition:{type:"tween"},className:"editor-header__settings",children:[!e&&!d&&a.jsx(pGt,{forceIsDirty:t}),a.jsx(SKt,{}),a.jsx(CKt,{forceIsAutosaveable:t,disabled:g}),a.jsx(cye,{className:"editor-header__post-preview-button",forceIsAutosaveable:t}),h&&s&&M&&a.jsx(qKt,{disabled:n}),(s||!p)&&a.jsx(rk.Slot,{scope:"core"}),!e&&a.jsx(kKt,{forceIsDirty:t,setEntitiesSavedStatesCallback:o}),RKt?a.jsx(gKt,{}):void 0,e,a.jsx(_Kt,{})]})]})}const{PrivateInserterLibrary:WKt}=St(jn);function NKt(){const{blockSectionRootClientId:e,inserterSidebarToggleRef:t,inserter:n,showMostUsedBlocks:o,sidebarIsOpened:r}=G(f=>{const{getInserterSidebarToggleRef:b,getInserter:h,isPublishSidebarOpened:g}=St(f(_e)),{getBlockRootClientId:z,isZoomOut:A,getSectionRootClientId:_}=St(f(J)),{get:v}=f(ht),{getActiveComplementaryArea:M}=f(xo),y=()=>{if(A()){const k=_();if(k)return k}return z()};return{inserterSidebarToggleRef:b(),inserter:h(),showMostUsedBlocks:v("core","mostUsedBlocks"),blockSectionRootClientId:y(),sidebarIsOpened:!!(M("core")||g())}},[]),{setIsInserterOpened:s}=Oe(_e),{disableComplementaryArea:i}=Oe(xo),c=Yn("medium","<"),l=x.useRef(),u=x.useCallback(()=>{s(!1),t.current?.focus()},[t,s]),d=x.useCallback(f=>{f.keyCode===gd&&!f.defaultPrevented&&(f.preventDefault(),u())},[u]),p=a.jsx("div",{className:"editor-inserter-sidebar__content",children:a.jsx(WKt,{showMostUsedBlocks:o,showInserterHelpPanel:!0,shouldFocusBlock:c,rootClientId:e,onSelect:n.onSelect,__experimentalInitialTab:n.tab,__experimentalInitialCategory:n.category,__experimentalFilterValue:n.filterValue,onPatternCategorySelection:r?()=>i("core"):void 0,ref:l,onClose:u})});return a.jsx("div",{onKeyDown:d,className:"editor-inserter-sidebar",children:p})}function BKt(){return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"editor-list-view-sidebar__outline",children:[a.jsxs("div",{children:[a.jsx(Sn,{children:m("Characters:")}),a.jsx(Sn,{children:a.jsx(IGt,{})})]}),a.jsxs("div",{children:[a.jsx(Sn,{children:m("Words:")}),a.jsx(LGt,{})]}),a.jsxs("div",{children:[a.jsx(Sn,{children:m("Time to read:")}),a.jsx(jGt,{})]})]}),a.jsx(eUt,{})]})}const{TabbedSidebar:LKt}=St(jn);function PKt(){const{setIsListViewOpened:e}=Oe(_e),{getListViewToggleRef:t}=St(G(_e)),n=_5("firstElement"),o=x.useCallback(()=>{e(!1),t().current?.focus()},[t,e]),r=x.useCallback(g=>{g.keyCode===gd&&!g.defaultPrevented&&(g.preventDefault(),o())},[o]),[s,i]=x.useState(null),[c,l]=x.useState("list-view"),u=x.useRef(),d=x.useRef(),p=x.useRef(),f=xn([n,p,i]);function b(g){const z=Xr.tabbable.find(d.current)[0];if(g==="list-view"){const A=Xr.tabbable.find(p.current)[0];(u.current.contains(A)?A:z).focus()}else z.focus()}const h=x.useCallback(()=>{u.current.contains(u.current.ownerDocument.activeElement)?o():b(c)},[o,c]);return p0("core/editor/toggle-list-view",h),a.jsx("div",{className:"editor-list-view-sidebar",onKeyDown:r,ref:u,children:a.jsx(LKt,{tabs:[{name:"list-view",title:We("List View","Post overview"),panel:a.jsx("div",{className:"editor-list-view-sidebar__list-view-container",children:a.jsx("div",{className:"editor-list-view-sidebar__list-view-panel-content",children:a.jsx(J8t,{dropZoneElement:s})})}),panelRef:f},{name:"outline",title:We("Outline","Post overview"),panel:a.jsx("div",{className:"editor-list-view-sidebar__list-view-container",children:a.jsx(BKt,{})})}],onClose:o,onSelect:g=>l(g),defaultTabId:"list-view",ref:d,closeButtonLabel:m("Close")})})}const{Fill:Gmn,Slot:jKt}=Qn("ActionsPanel");function IKt({setEntitiesSavedStatesCallback:e,closeEntitiesSavedStates:t,isEntitiesSavedStatesOpen:n,forceIsDirtyPublishPanel:o}){const{closePublishSidebar:r,togglePublishSidebar:s}=Oe(_e),{publishSidebarOpened:i,isPublishable:c,isDirty:l,hasOtherEntitiesChanges:u}=G(f=>{const{isPublishSidebarOpened:b,isEditedPostPublishable:h,isCurrentPostPublished:g,isEditedPostDirty:z,hasNonPostEntityChanges:A}=f(_e),_=A();return{publishSidebarOpened:b(),isPublishable:!g()&&h(),isDirty:_||z(),hasOtherEntitiesChanges:_}},[]),d=x.useCallback(()=>e(!0),[]);let p;return i?p=a.jsx(cGt,{onClose:r,forceIsDirty:o,PrePublishExtension:oye.Slot,PostPublishExtension:tye.Slot}):c&&!u?p=a.jsx("div",{className:"editor-layout__toggle-publish-panel",children:a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"secondary",onClick:s,"aria-expanded":!1,children:m("Open publish panel")})}):p=a.jsx("div",{className:"editor-layout__toggle-entities-saved-states-panel",children:a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"secondary",onClick:d,"aria-expanded":!1,"aria-haspopup":"dialog",disabled:!l,accessibleWhenDisabled:!0,children:m("Open save panel")})}),a.jsxs(a.Fragment,{children:[n&&a.jsx(gUt,{close:t,renderDialog:!0}),a.jsx(jKt,{bubblesVirtually:!0}),!n&&p]})}function DKt({autoFocus:e=!1}){const{switchEditorMode:t}=Oe(_e),{shortcut:n,isRichEditingEnabled:o}=G(s=>{const{getEditorSettings:i}=s(_e),{getShortcutRepresentation:c}=s(Pi);return{shortcut:c("core/editor/toggle-mode"),isRichEditingEnabled:i().richEditingEnabled}},[]),r=x.useRef();return x.useEffect(()=>{e||r?.current?.focus()},[e]),a.jsxs("div",{className:"editor-text-editor",children:[o&&a.jsxs("div",{className:"editor-text-editor__toolbar",children:[a.jsx("h2",{children:m("Editing code")}),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>t("visual"),shortcut:n,children:m("Exit code editor")})]}),a.jsxs("div",{className:"editor-text-editor__body",children:[a.jsx(Sye,{ref:r}),a.jsx(HI,{})]})]})}function FKt({contentRef:e}){const{onNavigateToEntityRecord:t,templateId:n}=G(i=>{const{getEditorSettings:c,getCurrentTemplateId:l}=i(_e);return{onNavigateToEntityRecord:c().onNavigateToEntityRecord,templateId:l()}},[]),o=G(i=>!!i(Me).canUser("create",{kind:"postType",name:"wp_template"}),[]),[r,s]=x.useState(!1);return x.useEffect(()=>{const i=l=>{o&&(!l.target.classList.contains("is-root-container")||l.target.dataset?.type==="core/template-part"||l.defaultPrevented||(l.preventDefault(),s(!0)))},c=e.current;return c?.addEventListener("dblclick",i),()=>{c?.removeEventListener("dblclick",i)}},[e,o]),o?a.jsx(wf,{isOpen:r,confirmButtonText:m("Edit template"),onConfirm:()=>{s(!1),t({postId:n,postType:"wp_template"})},onCancel:()=>s(!1),size:"medium",children:m("You’ve tried to select a block that is part of a template, which may be used on other posts and pages. Would you like to edit the template?")}):null}const wne=20;function _ne({direction:e,resizeWidthBy:t}){function n(s){const{keyCode:i}=s;i!==wi&&i!==_i||(s.preventDefault(),e==="left"&&i===wi||e==="right"&&i===_i?t(wne):(e==="left"&&i===_i||e==="right"&&i===wi)&&t(-wne))}const o={active:{opacity:1,scaleY:1.3}},r=`resizable-editor__resize-help-${e}`;return a.jsxs(a.Fragment,{children:[a.jsx(B0,{text:m("Drag to resize"),children:a.jsx(qr.button,{className:`editor-resizable-editor__resize-handle is-${e}`,"aria-label":m("Drag to resize"),"aria-describedby":r,onKeyDown:n,variants:o,whileFocus:"active",whileHover:"active",whileTap:"active",role:"separator","aria-orientation":"vertical"},"handle")}),a.jsx(qn,{id:r,children:m("Use left and right arrow keys to resize the canvas.")})]})}const kne={position:void 0,userSelect:void 0,cursor:void 0,width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0};function Nye({className:e,enableResizing:t,height:n,children:o}){const[r,s]=x.useState("100%"),i=x.useRef(),c=x.useCallback(l=>{i.current&&s(i.current.offsetWidth+l)},[]);return a.jsx(Ca,{className:oe("editor-resizable-editor",e,{"is-resizable":t}),ref:l=>{i.current=l?.resizable},size:{width:t?r:"100%",height:t&&n?n:"100%"},onResizeStop:(l,u,d)=>{s(d.style.width)},minWidth:300,maxWidth:"100%",maxHeight:"100%",enable:{left:t,right:t},showHandle:t,resizeRatio:2,handleComponent:{left:a.jsx(_ne,{direction:"left",resizeWidthBy:c}),right:a.jsx(_ne,{direction:"right",resizeWidthBy:c})},handleClasses:void 0,handleStyles:{left:kne,right:kne},children:o})}const $Kt=500;function Sne(e,t,n){return Math.min(Math.max(e,t),n)}function VKt(e,t,n){const o=e-Sne(e,n.left,n.right),r=t-Sne(t,n.top,n.bottom);return Math.sqrt(o*o+r*r)}function HKt({isEnabled:e=!0}={}){const{getEnabledClientIdsTree:t,getBlockName:n,getBlockOrder:o}=St(G(J)),{selectBlock:r}=Oe(J);return Mn(s=>{if(!e)return;const i=(l,u)=>{const d=t().flatMap(({clientId:b})=>{const h=n(b);if(h==="core/template-part")return[];if(h==="core/post-content"){const g=o(b);if(g.length)return g}return[b]});let p=1/0,f=null;for(const b of d){const h=s.querySelector(`[data-block="${b}"]`);if(!h)continue;const g=h.getBoundingClientRect(),z=VKt(l,u,g);z{(l.target===s||l.target.classList.contains("is-root-container"))&&i(l.clientX,l.clientY)};return s.addEventListener("click",c),()=>s.removeEventListener("click",c)},[e])}function UKt(){const{getSettings:e,isZoomOut:t}=St(G(J)),{resetZoomLevel:n}=St(Oe(J));return Mn(o=>{function r(s){if(t()&&!s.defaultPrevented){s.preventDefault();const{__experimentalSetIsInserterOpened:i}=e();typeof i=="function"&&i(!1),n()}}return o.addEventListener("dblclick",r),()=>{o.removeEventListener("dblclick",r)}},[e,t,n])}const{LayoutStyle:wv,useLayoutClasses:XKt,useLayoutStyles:GKt,ExperimentalBlockCanvas:KKt,useFlashEditableBlocks:YKt}=St(jn),ZKt=[$l,L0,Wf,Di];function iN(e){for(let t=0;t{c(ye.borderBoxSize[0].blockSize)}),u=Yn("small","<"),{renderingMode:d,postContentAttributes:p,editedPostTemplate:f={},wrapperBlockName:b,wrapperUniqueId:h,deviceType:g,isFocusedEntity:z,isDesignPostType:A,postType:_,isPreview:v}=G(ye=>{const{getCurrentPostId:Ne,getCurrentPostType:je,getCurrentTemplateId:ie,getEditorSettings:we,getRenderingMode:re,getDeviceType:pe}=ye(_e),{getPostType:ke,getEditedEntityRecord:Se}=ye(Me),se=je(),L=re();let U;se===$l?U="core/block":L==="post-only"&&(U="core/post-content");const ne=we(),ve=ne.supportsTemplateMode,qe=ke(se),Pe=ie(),rt=Pe?Se("postType",L0,Pe):void 0;return{renderingMode:L,postContentAttributes:ne.postContentAttributes,isDesignPostType:ZKt.includes(se),editedPostTemplate:qe?.viewable&&ve?rt:void 0,wrapperBlockName:U,wrapperUniqueId:Ne(),deviceType:pe(),isFocusedEntity:!!ne.onNavigateToPreviousEntityRecord,postType:se,isPreview:ne.isPreviewMode}},[]),{isCleanNewPost:M}=G(_e),{hasRootPaddingAwareAlignments:y,themeHasDisabledLayoutStyles:k,themeSupportsLayout:S,isZoomedOut:C}=G(ye=>{const{getSettings:Ne,isZoomOut:je}=St(ye(J)),ie=Ne();return{themeHasDisabledLayoutStyles:ie.disableLayoutStyles,themeSupportsLayout:ie.supportsLayout,hasRootPaddingAwareAlignments:ie.__experimentalFeatures?.useRootPaddingAwareAlignments,isZoomedOut:je()}},[]),R=BNt(g),[T]=Un("layout"),E=x.useMemo(()=>d!=="post-only"||A?{type:"default"}:S?{...T,type:"constrained"}:{type:"default"},[d,S,T,A]),B=x.useMemo(()=>{if(!f?.content&&!f?.blocks&&p)return p;if(f?.blocks)return iN(f?.blocks);const ye=typeof f?.content=="string"?f?.content:"";return iN(Ko(ye))||{}},[f?.content,f?.blocks,p]),N=x.useMemo(()=>{if(!f?.content&&!f?.blocks)return!1;if(f?.blocks)return Cne(f?.blocks);const ye=typeof f?.content=="string"?f?.content:"";return Cne(Ko(ye))||!1},[f?.content,f?.blocks]),{layout:j={},align:I=""}=B||{},P=XKt(B,"core/post-content"),$=oe({"is-layout-flow":!S},S&&P,I&&`align${I}`),F=GKt(B,"core/post-content",".block-editor-block-list__layout.is-root-container"),X=x.useMemo(()=>j&&(j?.type==="constrained"||j?.inherit||j?.contentSize||j?.wideSize)?{...T,...j,type:"constrained"}:{...T,...j,type:"default"},[j?.type,j?.inherit,j?.contentSize,j?.wideSize,T]),Z=p?X:E,V=Z?.type==="default"&&!N?E:Z,Q=qge(),te=x.useRef();x.useEffect(()=>{!e||!M()||te?.current?.focus()},[e,M]);const ee=`.is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;} .is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);} .is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;} - .is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}`,ue=_===Wf,ce=[Wf,Di,$l].includes(_)&&!v&&!u&&!C,me=x.useMemo(()=>[...t??[],{css:`:where(.block-editor-iframe__body){display:flow-root;}.is-root-container{display:flow-root;${ce?"min-height:0!important;":""}}`}],[t,ce]),de=x.useRef(),Ae=nBt();return r=xn([de,r,d==="post-only"?Ae:null,YKt({isEnabled:d==="template-locked"}),HKt({isEnabled:d==="template-locked"}),UKt(),ce?l:null]),a.jsx("div",{className:oe("editor-visual-editor","edit-post-visual-editor",s,{"has-padding":z||ce,"is-resizable":ce,"is-iframed":!n,"is-scrollable":n||g!=="Desktop"}),children:a.jsx(Nye,{enableResizing:ce,height:i&&!ue?i:"100%",children:a.jsxs(KKt,{shouldIframe:!n,contentRef:r,styles:me,height:"100%",iframeProps:{...o,style:{...o?.style,...R}},children:[S&&!k&&d==="post-only"&&!A&&a.jsxs(a.Fragment,{children:[a.jsx(wv,{selector:".editor-visual-editor__post-title-wrapper",layout:E}),a.jsx(wv,{selector:".block-editor-block-list__layout.is-root-container",layout:V}),I&&a.jsx(wv,{css:ee}),F&&a.jsx(wv,{layout:X,css:F})]}),d==="post-only"&&!A&&a.jsx("div",{className:oe("editor-visual-editor__post-title-wrapper","edit-post-visual-editor__post-title-wrapper",{"has-global-padding":y}),contentEditable:!1,ref:Q,style:{marginTop:"4rem"},children:a.jsx(kye,{ref:te})}),a.jsxs(TO,{blockName:b,uniqueId:h,children:[a.jsx(B_,{className:oe("is-"+g.toLowerCase()+"-preview",d!=="post-only"||A?"wp-site-blocks":`${$} wp-block-post-content`,{"has-global-padding":d==="post-only"&&!A&&y}),layout:Z,dropZoneElement:n?de.current:de.current?.parentNode,__unstableDisableDropZone:d==="template-locked"}),d==="template-locked"&&a.jsx(FKt,{contentRef:de})]})]})})})}const JKt={header:m("Editor top bar"),body:m("Editor content"),sidebar:m("Editor settings"),actions:m("Editor publish"),footer:m("Editor footer")};function eYt({className:e,styles:t,children:n,forceIsDirty:o,contentRef:r,disableIframe:s,autoFocus:i,customSaveButton:c,customSavePanel:l,forceDisableBlockTools:u,title:d,iframeProps:p}){const{mode:f,isRichEditingEnabled:b,isInserterOpened:h,isListViewOpened:g,isDistractionFree:z,isPreviewMode:A,showBlockBreadcrumbs:_,documentLabel:v}=G(R=>{const{get:T}=R(ht),{getEditorSettings:E,getPostTypeLabel:B}=R(_e),N=E(),j=B();return{mode:R(_e).getEditorMode(),isRichEditingEnabled:N.richEditingEnabled,isInserterOpened:R(_e).isInserterOpened(),isListViewOpened:R(_e).isListViewOpened(),isDistractionFree:T("core","distractionFree"),isPreviewMode:N.isPreviewMode,showBlockBreadcrumbs:T("core","showBlockBreadcrumbs"),documentLabel:j||We("Document","noun, breadcrumb")}},[]),M=Yn("medium"),y=m(g?"Document Overview":"Block Library"),[k,S]=x.useState(!1),C=x.useCallback(R=>{typeof k=="function"&&k(R),S(!1)},[k]);return a.jsx(LOe,{isDistractionFree:z,className:oe("editor-editor-interface",e,{"is-entity-save-view-open":!!k,"is-distraction-free":z&&!A}),labels:{...JKt,secondarySidebar:y},header:!A&&a.jsx(EKt,{forceIsDirty:o,setEntitiesSavedStatesCallback:S,customSaveButton:c,forceDisableBlockTools:u,title:d}),editorNotices:a.jsx(ine,{}),secondarySidebar:!A&&f==="visual"&&(h&&a.jsx(NKt,{})||g&&a.jsx(PKt,{})),sidebar:!A&&!z&&a.jsx(sk.Slot,{scope:"core"}),content:a.jsxs(a.Fragment,{children:[!z&&!A&&a.jsx(ine,{}),a.jsx(Wye.Slot,{children:([R])=>R||a.jsxs(a.Fragment,{children:[!A&&(f==="text"||!b)&&a.jsx(DKt,{autoFocus:i}),!A&&!M&&f==="visual"&&a.jsx(lI,{hideDragHandle:!0}),(A||b&&f==="visual")&&a.jsx(QKt,{styles:t,contentRef:r,disableIframe:s,autoFocus:i,iframeProps:p}),n]})})]}),footer:!A&&!z&&M&&_&&b&&f==="visual"&&a.jsx(Cvt,{rootLabelText:v}),actions:A?void 0:l||a.jsx(IKt,{closeEntitiesSavedStates:C,isEntitiesSavedStatesOpen:k,setEntitiesSavedStatesCallback:S,forceIsDirtyPublishPanel:o})})}const{OverridesPanel:tYt}=St(Vi);function nYt(){return G(t=>t(_e).getCurrentPostType()==="wp_block",[])?a.jsx(tYt,{}):null}function t5(e){return typeof e.title=="string"?Lt(e.title):e.title&&"rendered"in e.title?Lt(e.title.rendered):e.title&&"raw"in e.title?Lt(e.title.raw):""}const oYt=({items:e,closeModal:t})=>{const[n]=e,o=t5(n),{showOnFront:r,currentHomePage:s,isSaving:i}=G(h=>{const{getEntityRecord:g,isSavingEntityRecord:z}=h(Me),A=g("root","site"),_=g("postType","page",A?.page_on_front);return{showOnFront:A?.show_on_front,currentHomePage:_,isSaving:z("root","site")}}),{saveEntityRecord:c}=Oe(Me),{createSuccessNotice:l,createErrorNotice:u}=Oe(mt);async function d(h){h.preventDefault();try{await c("root","site",{page_on_front:n.id,show_on_front:"page"}),l(m("Homepage updated."),{type:"snackbar"})}catch(g){const z=g.message&&g.code!=="unknown_error"?g.message:m("An error occurred while setting the homepage.");u(z,{type:"snackbar"})}finally{t?.()}}let p="";r==="posts"?p=m("This will replace the current homepage which is set to display latest posts."):s&&(p=xe(m('This will replace the current homepage: "%s"'),t5(s)));const f=xe(m('Set "%1$s" as the site homepage? %2$s'),o,p).trim(),b=m("Set homepage");return a.jsx("form",{onSubmit:d,children:a.jsxs(dt,{spacing:"5",children:[a.jsx(Sn,{children:f}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},disabled:i,accessibleWhenDisabled:!0,children:m("Cancel")}),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",disabled:i,accessibleWhenDisabled:!0,children:b})]})]})})},rYt=()=>{const{pageOnFront:e,pageForPosts:t}=G(n=>{const{getEntityRecord:o,canUser:r}=n(Me),s=r("read",{kind:"root",name:"site"})?o("root","site"):void 0;return{pageOnFront:s?.page_on_front,pageForPosts:s?.page_for_posts}});return x.useMemo(()=>({id:"set-as-homepage",label:m("Set as homepage"),isEligible(n){return!(n.status!=="publish"||n.type!=="page"||e===n.id||t===n.id)},RenderModal:oYt}),[t,e])},sYt=({items:e,closeModal:t})=>{const[n]=e,o=t5(n),{currentPostsPage:r,isPageForPostsSet:s,isSaving:i}=G(h=>{const{getEntityRecord:g,isSavingEntityRecord:z}=h(Me),A=g("root","site");return{currentPostsPage:g("postType","page",A?.page_for_posts),isPageForPostsSet:A?.page_for_posts!==0,isSaving:z("root","site")}}),{saveEntityRecord:c}=Oe(Me),{createSuccessNotice:l,createErrorNotice:u}=Oe(mt);async function d(h){h.preventDefault();try{await c("root","site",{page_for_posts:n.id,show_on_front:"page"}),l(m("Posts page updated."),{type:"snackbar"})}catch(g){const z=g.message&&g.code!=="unknown_error"?g.message:m("An error occurred while setting the posts page.");u(z,{type:"snackbar"})}finally{t?.()}}const p=s&&r?xe(m('This will replace the current posts page: "%s"'),t5(r)):m("This page will show the latest posts."),f=xe(m('Set "%1$s" as the posts page? %2$s'),o,p),b=m("Set posts page");return a.jsx("form",{onSubmit:d,children:a.jsxs(dt,{spacing:"5",children:[a.jsx(Sn,{children:f}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},disabled:i,accessibleWhenDisabled:!0,children:m("Cancel")}),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",disabled:i,accessibleWhenDisabled:!0,children:b})]})]})})},iYt=()=>{const{pageOnFront:e,pageForPosts:t}=G(n=>{const{getEntityRecord:o,canUser:r}=n(Me),s=r("read",{kind:"root",name:"site"})?o("root","site"):void 0;return{pageOnFront:s?.page_on_front,pageForPosts:s?.page_for_posts}});return x.useMemo(()=>({id:"set-as-posts-page",label:m("Set as posts page"),isEligible(n){return!(n.status!=="publish"||n.type!=="page"||e===n.id||t===n.id)},RenderModal:sYt}),[t,e])};function Bye({postType:e,onActionPerformed:t,context:n}){const{defaultActions:o}=G(d=>{const{getEntityActions:p}=St(d(_e));return{defaultActions:p("postType",e)}},[e]),{canManageOptions:r,hasFrontPageTemplate:s}=G(d=>{const{getEntityRecords:p}=d(Me),f=p("postType","wp_template",{per_page:-1});return{canManageOptions:d(Me).canUser("update",{kind:"root",name:"site"}),hasFrontPageTemplate:!!f?.find(b=>b?.slug==="front-page")}}),i=rYt(),c=iYt(),l=r&&!s,{registerPostTypeSchema:u}=St(Oe(_e));return x.useEffect(()=>{u(e)},[u,e]),x.useMemo(()=>{let d=[...o];if(l&&d.push(i,c),d=d.sort((p,f)=>f.id==="move-to-trash"?-1:0),d=d.filter(p=>p.context?p.context===n:!0),t)for(let p=0;p{f(b,{...h,onActionPerformed:g=>{h?.onActionPerformed&&h.onActionPerformed(g),t(d[p].id,g)}})}}}if(d[p].RenderModal){const f=d[p].RenderModal;d[p]={...d[p],RenderModal:b=>a.jsx(f,{...b,onActionPerformed:h=>{b.onActionPerformed&&b.onActionPerformed(h),t(d[p].id,h)}})}}}return d},[n,o,t,i,c,l])}const{Menu:H2,kebabCase:aYt}=St(tr);function cYt(e,t){const{items:n,permissions:o}=G(r=>{const{getEditedEntityRecord:s,getEntityRecordPermissions:i}=St(r(Me));return{items:t.map(c=>s("postType",e,c)),permissions:t.map(c=>i("postType",e,c))}},[t,e]);return x.useMemo(()=>n.map((r,s)=>({...r,permissions:o[s]})),[n,o])}function lYt({postType:e,postId:t,onActionPerformed:n}){const[o,r]=x.useState(null),s=x.useMemo(()=>Array.isArray(t)?t:t?[t]:[],[t]),i=cYt(e,s),c=Bye({postType:e,onActionPerformed:n}),l=x.useMemo(()=>c.filter(u=>(!u.isEligible||i.some(d=>u.isEligible(d)))&&(i.length<2||u.supportsBulk)),[c,i]);return a.jsxs(a.Fragment,{children:[a.jsxs(H2,{placement:"bottom-end",children:[a.jsx(H2.TriggerButton,{render:a.jsx(Ce,{size:"small",icon:Wc,label:m("Actions"),disabled:!l.length,accessibleWhenDisabled:!0,className:"editor-all-actions-button"})}),a.jsx(H2.Popover,{children:a.jsx(pYt,{actions:l,items:i,setActiveModalAction:r})})]}),!!o&&a.jsx(dYt,{action:o,items:i,closeModal:()=>r(null)})]})}function uYt({action:e,onClick:t,items:n}){const o=typeof e.label=="string"?e.label:e.label(n);return a.jsx(H2.Item,{onClick:t,children:a.jsx(H2.ItemLabel,{children:o})})}function dYt({action:e,items:t,closeModal:n}){const o=typeof e.label=="string"?e.label:e.label(t);return a.jsx(Zo,{title:e.modalHeader||o,__experimentalHideHeader:!!e.hideModalHeader,onRequestClose:n??(()=>{}),focusOnMount:"firstContentElement",size:"medium",overlayClassName:`editor-action-modal editor-action-modal__${aYt(e.id)}`,children:a.jsx(e.RenderModal,{items:t,closeModal:n})})}function pYt({actions:e,items:t,setActiveModalAction:n}){const o=Fn();return a.jsx(H2.Group,{children:e.map(r=>a.jsx(uYt,{action:r,onClick:()=>{if("RenderModal"in r){n(r);return}r.callback(t,{registry:o})},items:t},r.id))})}const{Badge:fYt}=St(tr);function Lye({postType:e,postId:t,onActionPerformed:n}){const o=x.useMemo(()=>Array.isArray(t)?t:[t],[t]),{postTitle:r,icon:s,labels:i}=G(u=>{const{getEditedEntityRecord:d,getEntityRecord:p,getPostType:f}=u(Me),{getPostIcon:b}=St(u(_e));let h="";const g=d("postType",e,o[0]);if(o.length===1){var z;const{default_template_types:A=[]}=(z=p("root","__unstableBase"))!==null&&z!==void 0?z:{};h=([L0,Di].includes(e)?LO({template:g,templateTypes:A}):{})?.title||g?.title}return{postTitle:h,icon:b(e,{area:g?.area}),labels:f(e)?.labels}},[o,e]),c=HOe(t);let l=m("No title");return i?.name&&o.length>1?l=xe(m("%i %s"),t.length,i?.name):r&&(l=x1(r)),a.jsxs(dt,{spacing:1,className:"editor-post-card-panel",children:[a.jsxs(Ot,{spacing:2,className:"editor-post-card-panel__header",align:"flex-start",children:[a.jsx(qo,{className:"editor-post-card-panel__icon",icon:s}),a.jsxs(Sn,{numberOfLines:2,truncate:!0,className:"editor-post-card-panel__title",as:"h2",children:[a.jsx("span",{className:"editor-post-card-panel__title-name",children:l}),c&&o.length===1&&a.jsx(fYt,{children:c})]}),a.jsx(lYt,{postType:e,postId:t,onActionPerformed:n})]}),o.length>1&&a.jsx(Sn,{className:"editor-post-card-panel__description",children:xe(m("Changes will be applied to all selected %s."),i?.name.toLowerCase())})]})}const bYt=189;function hYt(){const{postContent:e}=G(i=>{const{getEditedPostAttribute:c,getCurrentPostType:l,getCurrentPostId:u}=i(_e),{canUser:d}=i(Me),{getEntityRecord:p}=i(Me),f=d("read",{kind:"root",name:"site"})?p("root","site"):void 0,b=l();return{postContent:!(+u()===f?.page_for_posts)&&![L0,Di].includes(b)&&c("content")}},[]),t=We("words","Word count type. Do not translate!"),n=x.useMemo(()=>e?DO(e,t):0,[e,t]);if(!n)return null;const o=Math.round(n/bYt),r=xe(Dn("%s word","%s words",n),n.toLocaleString()),s=o<=1?m("1 minute"):xe(Dn("%s minute","%s minutes",o),o.toLocaleString());return a.jsx("div",{className:"editor-post-content-information",children:a.jsx(Sn,{children:xe(m("%1$s, %2$s read time."),r,s)})})}function mYt(){const{postFormat:e}=G(s=>{const{getEditedPostAttribute:i}=s(_e),c=i("format");return{postFormat:c??"standard"}},[]),t=VI.find(s=>s.id===e),[n,o]=x.useState(null),r=x.useMemo(()=>({anchor:n,placement:"left-start",offset:36,shift:!0}),[n]);return a.jsx(iye,{children:a.jsx(xs,{label:m("Format"),ref:o,children:a.jsx(so,{popoverProps:r,contentClassName:"editor-post-format__dialog",focusOnMount:!0,renderToggle:({isOpen:s,onToggle:i})=>a.jsx(Ce,{size:"compact",variant:"tertiary","aria-expanded":s,"aria-label":xe(m("Change format: %s"),t?.caption),onClick:i,children:t?.caption}),renderContent:({onClose:s})=>a.jsxs("div",{className:"editor-post-format__dialog-content",children:[a.jsx(Qs,{title:m("Format"),onClose:s}),a.jsx(aye,{})]})})})})}function gYt(){const e=G(n=>n(_e).getEditedPostAttribute("modified"),[]),t=e&&xe(m("Last edited %s."),r_(e));return t?a.jsx("div",{className:"editor-post-last-edited-panel",children:a.jsx(Sn,{children:t})}):null}function MYt({className:e,children:t}){return a.jsx(dt,{className:oe("editor-post-panel__section",e),children:t})}const zYt={};function OYt(){const{editEntityRecord:e}=Oe(Me),{postsPageTitle:t,postsPageId:n,isTemplate:o,postSlug:r}=G(d=>{const{getEntityRecord:p,getEditedEntityRecord:f,canUser:b}=d(Me),h=b("read",{kind:"root",name:"site"})?p("root","site"):void 0,g=h?.page_for_posts?f("postType","page",h?.page_for_posts):zYt,{getEditedPostAttribute:z,getCurrentPostType:A}=d(_e);return{postsPageId:g?.id,postsPageTitle:g?.title,isTemplate:A()===L0,postSlug:z("slug")}},[]),[s,i]=x.useState(null),c=x.useMemo(()=>({anchor:s,placement:"left-start",offset:36,shift:!0}),[s]);if(!o||!["home","index"].includes(r)||!n)return null;const l=d=>{e("postType","page",n,{title:d})},u=Lt(t);return a.jsx(xs,{label:m("Blog title"),ref:i,children:a.jsx(so,{popoverProps:c,contentClassName:"editor-blog-title-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:d,onToggle:p})=>a.jsx(Ce,{size:"compact",variant:"tertiary","aria-expanded":d,"aria-label":xe(m("Change blog title: %s"),u),onClick:p,children:u}),renderContent:({onClose:d})=>a.jsxs(a.Fragment,{children:[a.jsx(Qs,{title:m("Blog title"),onClose:d}),a.jsx(B1,{placeholder:m("No title"),size:"__unstable-large",value:t,onChange:F1(l,300),label:m("Blog title"),help:m("Set the Posts Page title. Appears in search results, and when the page is shared on social media."),hideLabelFromVision:!0})]})})})}function yYt(){const{editEntityRecord:e}=Oe(Me),{postsPerPage:t,isTemplate:n,postSlug:o}=G(l=>{const{getEditedPostAttribute:u,getCurrentPostType:d}=l(_e),{getEditedEntityRecord:p,canUser:f}=l(Me),b=f("read",{kind:"root",name:"site"})?p("root","site"):void 0;return{isTemplate:d()===L0,postSlug:u("slug"),postsPerPage:b?.posts_per_page||1}},[]),[r,s]=x.useState(null),i=x.useMemo(()=>({anchor:r,placement:"left-start",offset:36,shift:!0}),[r]);if(!n||!["home","index"].includes(o))return null;const c=l=>{e("root","site",void 0,{posts_per_page:l})};return a.jsx(xs,{label:m("Posts per page"),ref:s,children:a.jsx(so,{popoverProps:i,contentClassName:"editor-posts-per-page-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:l,onToggle:u})=>a.jsx(Ce,{size:"compact",variant:"tertiary","aria-expanded":l,"aria-label":m("Change posts per page"),onClick:u,children:t}),renderContent:({onClose:l})=>a.jsxs(a.Fragment,{children:[a.jsx(Qs,{title:m("Posts per page"),onClose:l}),a.jsx(g0,{placeholder:0,value:t,size:"__unstable-large",spinControls:"custom",step:"1",min:"1",onChange:c,label:m("Posts per page"),help:m("Set the default number of posts to display on blog pages, including categories and tags. Some templates may override this setting."),hideLabelFromVision:!0})]})})})}const AYt=[{label:We("Open",'Adjective: e.g. "Comments are open"'),value:"open",description:m("Visitors can add new comments and replies.")},{label:m("Closed"),value:"",description:[m("Visitors cannot add new comments or replies."),m("Existing comments remain visible.")].join(" ")}];function vYt(){const{editEntityRecord:e}=Oe(Me),{allowCommentsOnNewPosts:t,isTemplate:n,postSlug:o}=G(l=>{const{getEditedPostAttribute:u,getCurrentPostType:d}=l(_e),{getEditedEntityRecord:p,canUser:f}=l(Me),b=f("read",{kind:"root",name:"site"})?p("root","site"):void 0;return{isTemplate:d()===L0,postSlug:u("slug"),allowCommentsOnNewPosts:b?.default_comment_status||""}},[]),[r,s]=x.useState(null),i=x.useMemo(()=>({anchor:r,placement:"left-start",offset:36,shift:!0}),[r]);if(!n||!["home","index"].includes(o))return null;const c=l=>{e("root","site",void 0,{default_comment_status:l?"open":null})};return a.jsx(xs,{label:m("Discussion"),ref:s,children:a.jsx(so,{popoverProps:i,contentClassName:"editor-site-discussion-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:l,onToggle:u})=>a.jsx(Ce,{size:"compact",variant:"tertiary","aria-expanded":l,"aria-label":m("Change discussion settings"),onClick:u,children:m(t?"Comments open":"Comments closed")}),renderContent:({onClose:l})=>a.jsxs(a.Fragment,{children:[a.jsx(Qs,{title:m("Discussion"),onClose:l}),a.jsxs(dt,{spacing:3,children:[a.jsx(Sn,{children:m("Changes will apply to new posts only. Individual posts may override these settings.")}),a.jsx(sb,{className:"editor-site-discussion__options",hideLabelFromVision:!0,label:m("Comment status"),options:AYt,onChange:c,selected:t})]})]})})})}const xYt="post-status";function wYt({onActionPerformed:e}){const{isRemovedPostStatusPanel:t,postType:n,postId:o}=G(r=>{const{isEditorPanelRemoved:s,getCurrentPostType:i,getCurrentPostId:c}=r(_e);return{isRemovedPostStatusPanel:s(xYt),postType:i(),postId:c()}},[]);return a.jsx(MYt,{className:"editor-post-summary",children:a.jsx(nye.Slot,{children:r=>a.jsx(a.Fragment,{children:a.jsxs(dt,{spacing:4,children:[a.jsx(Lye,{postType:n,postId:o,onActionPerformed:e}),a.jsx(vXt,{withPanelBody:!1}),a.jsx(fXt,{}),a.jsxs(dt,{spacing:1,children:[a.jsx(hYt,{}),a.jsx(gYt,{})]}),!t&&a.jsxs(dt,{spacing:4,children:[a.jsxs(dt,{spacing:1,children:[a.jsx(yye,{}),a.jsx(hGt,{}),a.jsx(_Gt,{}),a.jsx(tXt,{}),a.jsx(GUt,{}),a.jsx(cXt,{}),a.jsx(_Xt,{}),a.jsx(_Ut,{}),a.jsx(mGt,{}),a.jsx(OYt,{}),a.jsx(yYt,{}),a.jsx(vYt,{}),a.jsx(mYt,{}),r]}),a.jsx(xGt,{onActionPerformed:e})]})]})})})})}const{EXCLUDED_PATTERN_SOURCES:_Yt,PATTERN_TYPES:kYt}=St(Vi);function Pye(e,t){return e.innerBlocks=e.innerBlocks.map(n=>Pye(n,t)),e.name==="core/template-part"&&e.attributes.theme===void 0&&(e.attributes.theme=t),e}function SYt(e,t){const n=(s,i,c)=>i===c.findIndex(l=>s.name===l.name),o=s=>!_Yt.includes(s.source),r=s=>s.templateTypes?.includes(t.slug)||s.blockTypes?.includes("core/template-part/"+t.area);return e.filter((s,i,c)=>n(s,i,c)&&o(s)&&r(s))}function CYt(e,t){return e.map(n=>({...n,keywords:n.keywords||[],type:kYt.theme,blocks:Ko(n.content,{__unstableSkipMigrationLogs:!0}).map(o=>Pye(o,t))}))}function qYt(e){const{blockPatterns:t,restBlockPatterns:n,currentThemeStylesheet:o}=G(r=>{var s;const{getEditorSettings:i}=r(_e),c=i();return{blockPatterns:(s=c.__experimentalAdditionalBlockPatterns)!==null&&s!==void 0?s:c.__experimentalBlockPatterns,restBlockPatterns:r(Me).getBlockPatterns(),currentThemeStylesheet:r(Me).getCurrentTheme().stylesheet}},[]);return x.useMemo(()=>{const r=[...t||[],...n||[]],s=SYt(r,e);return CYt(s,e)},[t,n,e,o])}function RYt({availableTemplates:e,onSelect:t}){return!e||e?.length===0?null:a.jsx(qa,{label:m("Templates"),blockPatterns:e,onClickPattern:t,showTitlesAsTooltip:!0})}function TYt(){const{record:e,postType:t,postId:n}=G(i=>{const{getCurrentPostType:c,getCurrentPostId:l}=i(_e),{getEditedEntityRecord:u}=i(Me),d=c(),p=l();return{postType:d,postId:p,record:u("postType",d,p)}},[]),{editEntityRecord:o}=Oe(Me),r=qYt(e),s=async i=>{await o("postType",t,n,{blocks:i.blocks,content:Ks(i.blocks)})};return r?.length?a.jsx(Qt,{title:m("Design"),initialOpen:e.type===Di,children:a.jsx(RYt,{availableTemplates:r,onSelect:s})}):null}function EYt(){const{postType:e}=G(t=>{const{getCurrentPostType:n}=t(_e);return{postType:n()}},[]);return[Di,L0].includes(e)?a.jsx(TYt,{}):null}const ac={document:"edit-post/document",block:"edit-post/block"},{Tabs:qT}=St(tr),WYt=(e,t)=>{const{documentLabel:n}=G(o=>{const{getPostTypeLabel:r}=o(_e);return{documentLabel:r()||We("Document","noun, sidebar")}},[]);return a.jsxs(qT.TabList,{ref:t,children:[a.jsx(qT.Tab,{tabId:ac.document,"data-tab-id":ac.document,children:n}),a.jsx(qT.Tab,{tabId:ac.block,"data-tab-id":ac.block,children:m("Block")})]})},NYt=x.forwardRef(WYt),{BlockQuickNavigation:BYt}=St(jn),LYt=["core/post-title","core/post-featured-image","core/post-content"],PYt="core/template-part";function jYt(){const e=x.useMemo(()=>gr("editor.postContentBlockTypes",LYt),[]),{clientIds:t,postType:n,renderingMode:o}=G(s=>{const{getCurrentPostType:i,getPostBlocksByName:c,getRenderingMode:l}=St(s(_e)),u=i();return{postType:u,clientIds:c(L0===u?PYt:e),renderingMode:l()}},[e]),{enableComplementaryArea:r}=Oe(xo);return o==="post-only"&&n!==L0||t.length===0?null:a.jsx(Qt,{title:m("Content"),children:a.jsx(BYt,{clientIds:t,onSelect:()=>{r("core","edit-post/document")}})})}const{BlockQuickNavigation:IYt}=St(jn);function DYt(){const e=G(o=>{const{getBlockTypes:r}=o(kt);return r()},[]),t=x.useMemo(()=>e.filter(o=>o.category==="theme").map(({name:o})=>o),[e]),n=G(o=>{const{getBlocksByName:r}=o(J);return r(t)},[t]);return n.length===0?null:a.jsx(Qt,{title:m("Content"),children:a.jsx(IYt,{clientIds:n})})}function FYt(){return G(t=>{const{getCurrentPostType:n}=t(_e);return n()},[])!==Di?null:a.jsx(DYt,{})}function $Yt(){const{hasBlockSelection:e}=G(r=>({hasBlockSelection:!!r(J).getBlockSelectionStart()}),[]),{getActiveComplementaryArea:t}=G(xo),{enableComplementaryArea:n}=Oe(xo),{get:o}=G(ht);x.useEffect(()=>{const r=t("core"),s=["edit-post/document","edit-post/block"].includes(r),i=o("core","distractionFree");!s||i||(e?n("core","edit-post/block"):n("core","edit-post/document"))},[e,t,n,o])}const{Tabs:l2}=St(tr),VYt=f0.select({web:!0,native:!1}),HYt=({tabName:e,keyboardShortcut:t,onActionPerformed:n,extraPanels:o})=>{const r=x.useRef(null),s=x.useContext(l2.Context);return x.useEffect(()=>{const i=Array.from(r.current?.querySelectorAll('[role="tab"]')||[]),c=i.find(d=>d.getAttribute("data-tab-id")===e),l=c?.ownerDocument.activeElement;i.some(d=>l&&l.id===d.id)&&c&&c.id!==l?.id&&c?.focus()},[e]),a.jsx(rN,{identifier:e,header:a.jsx(l2.Context.Provider,{value:s,children:a.jsx(NYt,{ref:r})}),closeLabel:m("Close Settings"),className:"editor-sidebar__panel",headerClassName:"editor-sidebar__panel-tabs",title:We("Settings","sidebar button label"),toggleShortcut:t,icon:jt()?ede:tde,isActiveByDefault:VYt,children:a.jsxs(l2.Context.Provider,{value:s,children:[a.jsxs(l2.TabPanel,{tabId:ac.document,focusable:!1,children:[a.jsx(wYt,{onActionPerformed:n}),a.jsx(eye.Slot,{}),a.jsx(jYt,{}),a.jsx(FYt,{}),a.jsx(EYt,{}),a.jsx(OGt,{}),a.jsx(nYt,{}),o]}),a.jsx(l2.TabPanel,{tabId:ac.block,focusable:!1,children:a.jsx(m3e,{})})]})})},UYt=({extraPanels:e,onActionPerformed:t})=>{$Yt();const{tabName:n,keyboardShortcut:o,showSummary:r}=G(c=>{const l=c(Pi).getShortcutRepresentation("core/editor/toggle-sidebar"),u=c(xo).getActiveComplementaryArea("core"),d=[ac.block,ac.document].includes(u);let p=u;return d||(p=c(J).getBlockSelectionStart()?ac.block:ac.document),{tabName:p,keyboardShortcut:l,showSummary:![L0,Di,Wf].includes(c(_e).getCurrentPostType())}},[]),{enableComplementaryArea:s}=Oe(xo),i=x.useCallback(c=>{c&&s("core",c)},[s]);return a.jsx(l2,{selectedTabId:n,onSelect:i,selectOnMove:!1,children:a.jsx(HYt,{tabName:n,keyboardShortcut:o,showSummary:r,onActionPerformed:t,extraPanels:e})})};function XYt({postType:e,postId:t,templateId:n,settings:o,children:r,initialEdits:s,onActionPerformed:i,extraContent:c,extraSidebarPanels:l,...u}){const{post:d,template:p,hasLoadedPost:f}=G(b=>{const{getEntityRecord:h,hasFinishedResolution:g}=b(Me);return{post:h("postType",e,t),template:n?h("postType",L0,n):void 0,hasLoadedPost:g("getEntityRecord",["postType",e,t])}},[e,t,n]);return a.jsxs(a.Fragment,{children:[f&&!d&&a.jsx(A1,{status:"warning",isDismissible:!1,children:m("You attempted to edit an item that doesn't exist. Perhaps it was deleted?")}),!!d&&a.jsxs(DOe,{post:d,__unstableTemplate:p,settings:o,initialEdits:s,useSubRegistry:!1,children:[a.jsx(eYt,{...u,children:c}),r,a.jsx(UYt,{onActionPerformed:i,extraPanels:l})]})]})}const{PreferenceBaseOption:GYt}=St(cp);function KYt(e){const t=G(r=>r(_e).isPublishSidebarEnabled(),[]),{enablePublishSidebar:n,disablePublishSidebar:o}=Oe(_e);return a.jsx(GYt,{isChecked:t,onChange:r=>r?n():o(),...e})}const{BlockManager:YYt}=St(jn);function ZYt(){const{showBlockTypes:e,hideBlockTypes:t}=St(Oe(_e)),{blockTypes:n,allowedBlockTypes:o,hiddenBlockTypes:r}=G(d=>{var p;return{blockTypes:d(kt).getBlockTypes(),allowedBlockTypes:d(_e).getEditorSettings().allowedBlockTypes,hiddenBlockTypes:(p=d(ht).get("core","hiddenBlockTypes"))!==null&&p!==void 0?p:[]}},[]),i=x.useMemo(()=>o===!0?n:n.filter(({name:d})=>o?.includes(d)),[o,n]).filter(d=>Et(d,"inserter",!0)&&(!d.parent||d.parent.includes("core/post-content"))),c=r.filter(d=>i.some(p=>p.name===d)),l=i.filter(d=>!c.includes(d.name)),u=d=>{if(l.length>d.length){const p=l.filter(f=>!d.find(({name:b})=>b===f.name));t(p.map(({name:f})=>f))}else if(l.length!l.find(({name:b})=>b===f.name));e(p.map(({name:f})=>f))}};return a.jsx(YYt,{blockTypes:i,selectedBlockTypes:l,onChange:u})}const{PreferencesModal:QYt,PreferencesModalTabs:JYt,PreferencesModalSection:nl,PreferenceToggleControl:ui}=St(cp);function eZt({extraSections:e={}}){const t=G(o=>o(xo).isModalActive("editor/preferences"),[]),{closeModal:n}=Oe(xo);return t?a.jsx(QYt,{closeModal:n,children:a.jsx(tZt,{extraSections:e})}):null}function tZt({extraSections:e={}}){const t=Yn("medium"),n=G(c=>{const{getEditorSettings:l}=c(_e),{get:u}=c(ht),d=l().richEditingEnabled;return!u("core","distractionFree")&&t&&d},[t]),{setIsListViewOpened:o,setIsInserterOpened:r}=Oe(_e),{set:s}=Oe(ht),i=x.useMemo(()=>[{name:"general",tabLabel:m("General"),content:a.jsxs(a.Fragment,{children:[a.jsxs(nl,{title:m("Interface"),children:[a.jsx(ui,{scope:"core",featureName:"showListViewByDefault",help:m("Opens the List View sidebar by default."),label:m("Always open List View")}),n&&a.jsx(ui,{scope:"core",featureName:"showBlockBreadcrumbs",help:m("Display the block hierarchy trail at the bottom of the editor."),label:m("Show block breadcrumbs")}),a.jsx(ui,{scope:"core",featureName:"allowRightClickOverrides",help:m("Allows contextual List View menus via right-click, overriding browser defaults."),label:m("Allow right-click contextual menus")}),a.jsx(ui,{scope:"core",featureName:"enableChoosePatternModal",help:m("Shows starter patterns when creating a new page."),label:m("Show starter patterns")})]}),a.jsxs(nl,{title:m("Document settings"),description:m("Select what settings are shown in the document panel."),children:[a.jsx(II.Slot,{}),a.jsx(Aye,{taxonomyWrapper:(c,l)=>a.jsx(c2,{label:l.labels.menu_name,panelName:`taxonomy-panel-${l.slug}`})}),a.jsx(e5,{children:a.jsx(c2,{label:m("Featured image"),panelName:"featured-image"})}),a.jsx(sye,{children:a.jsx(c2,{label:m("Excerpt"),panelName:"post-excerpt"})}),a.jsx(Sc,{supportKeys:["comments","trackbacks"],children:a.jsx(c2,{label:m("Discussion"),panelName:"discussion-panel"})}),a.jsx(XOe,{children:a.jsx(c2,{label:m("Page attributes"),panelName:"page-attributes"})})]}),t&&a.jsx(nl,{title:m("Publishing"),children:a.jsx(KYt,{help:m("Review settings, such as visibility and tags."),label:m("Enable pre-publish checks")})}),e?.general]})},{name:"appearance",tabLabel:m("Appearance"),content:a.jsxs(nl,{title:m("Appearance"),description:m("Customize the editor interface to suit your needs."),children:[a.jsx(ui,{scope:"core",featureName:"fixedToolbar",onToggle:()=>s("core","distractionFree",!1),help:m("Access all block and document tools in a single place."),label:m("Top toolbar")}),a.jsx(ui,{scope:"core",featureName:"distractionFree",onToggle:()=>{s("core","fixedToolbar",!0),r(!1),o(!1)},help:m("Reduce visual distractions by hiding the toolbar and other elements to focus on writing."),label:m("Distraction free")}),a.jsx(ui,{scope:"core",featureName:"focusMode",help:m("Highlights the current block and fades other content."),label:m("Spotlight mode")}),e?.appearance]})},{name:"accessibility",tabLabel:m("Accessibility"),content:a.jsxs(a.Fragment,{children:[a.jsx(nl,{title:m("Navigation"),description:m("Optimize the editing experience for enhanced control."),children:a.jsx(ui,{scope:"core",featureName:"keepCaretInsideBlock",help:m("Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block."),label:m("Contain text cursor inside block")})}),a.jsx(nl,{title:m("Interface"),children:a.jsx(ui,{scope:"core",featureName:"showIconLabels",label:m("Show button text labels"),help:m("Show text instead of icons on buttons across the interface.")})})]})},{name:"blocks",tabLabel:m("Blocks"),content:a.jsxs(a.Fragment,{children:[a.jsx(nl,{title:m("Inserter"),children:a.jsx(ui,{scope:"core",featureName:"mostUsedBlocks",help:m("Adds a category with the most frequently used blocks in the inserter."),label:m("Show most used blocks")})}),a.jsx(nl,{title:m("Manage block visibility"),description:m("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later."),children:a.jsx(ZYt,{})})]})},window.__experimentalMediaProcessing&&{name:"media",tabLabel:m("Media"),content:a.jsx(a.Fragment,{children:a.jsxs(nl,{title:m("General"),description:m("Customize options related to the media upload flow."),children:[a.jsx(ui,{scope:"core/media",featureName:"optimizeOnUpload",help:m("Compress media items before uploading to the server."),label:m("Pre-upload compression")}),a.jsx(ui,{scope:"core/media",featureName:"requireApproval",help:m("Require approval step when optimizing existing media."),label:m("Approval step")})]})})}].filter(Boolean),[n,e,r,o,s,t]);return a.jsx(JYt,{sections:i})}function nZt({postType:e}){const{registerPostTypeSchema:t}=St(Oe(_e));x.useEffect(()=>{t(e)},[t,e]);const{defaultFields:n}=G(i=>{const{getEntityFields:c}=St(i(_e));return{defaultFields:c("postType",e)}},[e]),{records:o,isResolving:r}=Al("root","user",{per_page:-1}),s=x.useMemo(()=>n.map(i=>i.id==="author"?{...i,elements:o?.map(({id:c,name:l})=>({value:c,label:l}))}:i),[o,n]);return{isLoading:r,fields:s}}const qne="content",oZt={name:"core/pattern-overrides",getValues({select:e,clientId:t,context:n,bindings:o}){const r=n["pattern/overrides"],{getBlockAttributes:s}=e(J),i=s(t),c={};for(const l of Object.keys(o)){const u=r?.[i?.metadata?.name]?.[l];if(u===void 0){c[l]=i[l];continue}else c[l]=u===""?void 0:u}return c},setValues({select:e,dispatch:t,clientId:n,bindings:o}){const{getBlockAttributes:r,getBlockParentsByBlockName:s,getBlocks:i}=e(J),l=r(n)?.metadata?.name;if(!l)return;const[u]=s(n,"core/block",!0),d=Object.entries(o).reduce((f,[b,{newValue:h}])=>(f[b]=h,f),{});if(!u){const f=b=>{for(const h of b)h.attributes?.metadata?.name===l&&t(J).updateBlockAttributes(h.clientId,d),f(h.innerBlocks)};f(i());return}const p=r(u)?.[qne];t(J).updateBlockAttributes(u,{[qne]:{...p,[l]:{...p?.[l],...Object.entries(d).reduce((f,[b,h])=>(f[b]=h===void 0?"":h,f),{})}}})},canUserEditValue:()=>!0};function RT(e,t){const{getEditedEntityRecord:n}=e(Me),{getRegisteredPostMeta:o}=St(e(Me));let r;t?.postType&&t?.postId&&(r=n("postType",t?.postType,t?.postId).meta);const s=o(t?.postType),i={};return Object.entries(s||{}).forEach(([c,l])=>{if(c!=="footnotes"&&c.charAt(0)!=="_"){var u;i[c]={label:l.title||c,value:(u=r?.[c])!==null&&u!==void 0?u:l.default||void 0,type:l.type}}}),Object.keys(i||{}).length?i:null}const rZt={name:"core/post-meta",getValues({select:e,context:t,bindings:n}){const o=RT(e,t),r={};for(const[i,c]of Object.entries(n)){var s;const l=c.args.key,{value:u,label:d}=o?.[l]||{};r[i]=(s=u??d)!==null&&s!==void 0?s:l}return r},setValues({dispatch:e,context:t,bindings:n}){const o={};Object.values(n).forEach(({args:r,newValue:s})=>{o[r.key]=s}),e(Me).editEntityRecord("postType",t?.postType,t?.postId,{meta:o})},canUserEditValue({select:e,context:t,args:n}){return!(t?.query||t?.queryId||!t?.postType||RT(e,t)?.[n.key]?.value===void 0||e(_e).getEditorSettings().enableCustomFields||!e(Me).canUser("update",{kind:"postType",name:t?.postType,id:t?.postId}))},getFieldsList({select:e,context:t}){return RT(e,t)}};function sZt(){QU(oZt),QU(rZt)}const{store:iZt,...aZt}=_Vt,cu={};pjt(cu,{CreateTemplatePartModal:LI,BackButton:XI,EntitiesSavedStatesExtensible:Jx,Editor:XYt,EditorContentSlotFill:Wye,GlobalStylesProvider:v$t,mergeBaseAndUserConfigs:ROe,PluginPostExcerpt:$I,PostCardPanel:Lye,PreferencesModal:eZt,usePostActions:Bye,usePostFields:nZt,ToolsMoreMenuGroup:YI,ViewMoreMenuGroup:ZI,ResizableEditor:Nye,registerCoreBlockBindingsSources:sZt,getTemplateInfo:LO,interfaceStore:iZt,...aZt});const cZt=":root{--wp-admin-theme-color: #007cba;--wp-admin-theme-color--rgb: 0, 124, 186;--wp-admin-theme-color-darker-10: #006ba1;--wp-admin-theme-color-darker-10--rgb: 0, 107, 161;--wp-admin-theme-color-darker-20: #005a87;--wp-admin-theme-color-darker-20--rgb: 0, 90, 135;--wp-admin-border-width-focus: 2px;--wp-block-synced-color: #7a00df;--wp-block-synced-color--rgb: 122, 0, 223;--wp-bound-block-color: var(--wp-block-synced-color)}@media (min-resolution: 192dpi){:root{--wp-admin-border-width-focus: 1.5px}}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:18px;line-height:1.5;--wp--style--block-gap: 2em}p{line-height:1.8}.editor-post-title__block{margin-top:2em;margin-bottom:1em;font-size:2.5em;font-weight:800}";function it(e){if(!e)return;const{metadata:t,settings:n,name:o}=e;return dLe({name:o,...t},n)}function jye(e,t,n){return G(o=>o(Me).canUser("update",{kind:e,name:t,id:n}),[e,t,n])}function ck(e={}){const t=x.useRef(e),n=x.useRef(!1),{getSettings:o}=G(J);x.useLayoutEffect(()=>{t.current=e}),x.useEffect(()=>{if(n.current||!t.current.url||!Nr(t.current.url))return;const r=Xie(t.current.url);if(!r)return;const{url:s,allowedTypes:i,onChange:c,onError:l}=t.current,{mediaUpload:u}=o();n.current=!0,u({filesList:[r],allowedTypes:i,onFileChange:([d])=>{Nr(d?.url)||(J4(s),c(d),n.current=!1)},onError:d=>{J4(s),l(d),n.current=!1}})},[o])}function Qo(){return Yn("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}}}function lZt({attributes:e,setAttributes:t}){const{showLabel:n,showPostCounts:o,displayAsDropdown:r,type:s}=e,i=Qo();return a.jsxs(a.Fragment,{children:[a.jsx(et,{children:a.jsxs(En,{label:m("Settings"),resetAll:()=>{t({displayAsDropdown:!1,showLabel:!1,showPostCounts:!1,type:"monthly"})},dropdownMenuProps:i,children:[a.jsx(tt,{label:m("Display as dropdown"),isShownByDefault:!0,hasValue:()=>r,onDeselect:()=>t({displayAsDropdown:!1}),children:a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Display as dropdown"),checked:r,onChange:()=>t({displayAsDropdown:!r})})}),r&&a.jsx(tt,{label:m("Show label"),isShownByDefault:!0,hasValue:()=>n,onDeselect:()=>t({showLabel:!1}),children:a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Show label"),checked:n,onChange:()=>t({showLabel:!n})})}),a.jsx(tt,{label:m("Show post counts"),isShownByDefault:!0,hasValue:()=>o,onDeselect:()=>t({showPostCounts:!1}),children:a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Show post counts"),checked:o,onChange:()=>t({showPostCounts:!o})})}),a.jsx(tt,{label:m("Group by"),isShownByDefault:!0,hasValue:()=>!!s,onDeselect:()=>t({type:"monthly"}),children:a.jsx(Pn,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:m("Group by"),options:[{label:m("Year"),value:"yearly"},{label:m("Month"),value:"monthly"},{label:m("Week"),value:"weekly"},{label:m("Day"),value:"daily"}],value:s,onChange:c=>t({type:c})})})]})}),a.jsx("div",{...Be(),children:a.jsx(I1,{children:a.jsx(FO,{block:"core/archives",skipBlockSupportAttributes:!0,attributes:e})})})]})}const QI={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/archives",title:"Archives",category:"widgets",description:"Display a date archive of your posts.",textdomain:"default",attributes:{displayAsDropdown:{type:"boolean",default:!1},showLabel:{type:"boolean",default:!0},showPostCounts:{type:"boolean",default:!1},type:{type:"string",default:"monthly"}},supports:{align:!0,__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0},html:!1,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-archives-editor"},{name:Iye}=QI,Dye={icon:gZe,example:{},edit:lZt},uZt=()=>it({name:Iye,metadata:QI,settings:Dye}),dZt=Object.freeze(Object.defineProperty({__proto__:null,init:uZt,metadata:QI,name:Iye,settings:Dye},Symbol.toStringTag,{value:"Module"}));function Fye(e){const t=e?e[0]:24,n=e?e[e.length-1]:96,o=Math.floor(n*2.5);return{minSize:t,maxSize:o}}function $ye(){const{avatarURL:e}=G(t=>{const{getSettings:n}=t(J),{__experimentalDiscussionSettings:o}=n();return o});return e}function pZt({commentId:e}){const[t]=Ao("root","comment","author_avatar_urls",e),[n]=Ao("root","comment","author_name",e),o=t?Object.values(t):null,r=t?Object.keys(t):null,{minSize:s,maxSize:i}=Fye(r),c=$ye();return{src:o?o[o.length-1]:c,minSize:s,maxSize:i,alt:n?xe(m("%s Avatar"),n):m("Default Avatar")}}function fZt({userId:e,postId:t,postType:n}){const{authorDetails:o}=G(u=>{const{getEditedEntityRecord:d,getUser:p}=u(Me);if(e)return{authorDetails:p(e)};const f=d("postType",n,t)?.author;return{authorDetails:f?p(f):null}},[n,t,e]),r=o?.avatar_urls?Object.values(o.avatar_urls):null,s=o?.avatar_urls?Object.keys(o.avatar_urls):null,{minSize:i,maxSize:c}=Fye(s),l=$ye();return{src:r?r[r.length-1]:l,minSize:i,maxSize:c,alt:o?xe(m("%s Avatar"),o?.name):m("Default Avatar")}}const bZt={who:"authors",per_page:-1,_fields:"id,name",context:"view"};function hZt({value:e,onChange:t}){const[n,o]=x.useState(),r=G(i=>{const{getUsers:c}=i(Me);return c(bZt)},[]);if(!r)return null;const s=r.map(i=>({label:i.name,value:i.id}));return a.jsx(nb,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:m("User"),help:m("Select the avatar user to display, if it is blank it will use the post/page author."),value:e,onChange:t,options:n||s,onFilterValueChange:i=>o(s.filter(c=>c.label.toLowerCase().startsWith(i.toLowerCase())))})}const Vye=({setAttributes:e,avatar:t,attributes:n,selectUser:o})=>a.jsx(et,{children:a.jsxs(Qt,{title:m("Settings"),children:[a.jsx(bo,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:m("Image size"),onChange:r=>e({size:r}),min:t.minSize,max:t.maxSize,initialPosition:n?.size,value:n?.size}),a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Link to user profile"),onChange:()=>e({isLink:!n.isLink}),checked:n.isLink}),n.isLink&&a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Open in new tab"),onChange:r=>e({linkTarget:r?"_blank":"_self"}),checked:n.linkTarget==="_blank"}),o&&a.jsx(hZt,{value:n?.userId,onChange:r=>{e({userId:r})}})]})}),n5=({setAttributes:e,attributes:t,avatar:n,blockProps:o,isSelected:r})=>{const s=au(t),i=tn(k4(n?.src,["s"]),{s:t?.size*2});return a.jsx("div",{...o,children:a.jsx(Ca,{size:{width:t.size,height:t.size},showHandle:r,onResizeStop:(c,l,u,d)=>{e({size:parseInt(t.size+(d.height||d.width),10)})},lockAspectRatio:!0,enable:{top:!1,right:!jt(),bottom:!0,left:jt()},minWidth:n.minSize,maxWidth:n.maxSize,children:a.jsx("img",{src:i,alt:n.alt,className:oe("avatar","avatar-"+t.size,"photo","wp-block-avatar__image",s.className),style:s.style})})})},mZt=({attributes:e,context:t,setAttributes:n,isSelected:o})=>{const{commentId:r}=t,s=Be(),i=pZt({commentId:r});return a.jsxs(a.Fragment,{children:[a.jsx(Vye,{avatar:i,setAttributes:n,attributes:e,selectUser:!1}),e.isLink?a.jsx("a",{href:"#avatar-pseudo-link",className:"wp-block-avatar__link",onClick:c=>c.preventDefault(),children:a.jsx(n5,{attributes:e,avatar:i,blockProps:s,isSelected:o,setAttributes:n})}):a.jsx(n5,{attributes:e,avatar:i,blockProps:s,isSelected:o,setAttributes:n})]})},gZt=({attributes:e,context:t,setAttributes:n,isSelected:o})=>{const{postId:r,postType:s}=t,i=fZt({userId:e?.userId,postId:r,postType:s}),c=Be();return a.jsxs(a.Fragment,{children:[a.jsx(Vye,{selectUser:!0,attributes:e,avatar:i,setAttributes:n}),e.isLink?a.jsx("a",{href:"#avatar-pseudo-link",className:"wp-block-avatar__link",onClick:l=>l.preventDefault(),children:a.jsx(n5,{attributes:e,avatar:i,blockProps:c,isSelected:o,setAttributes:n})}):a.jsx(n5,{attributes:e,avatar:i,blockProps:c,isSelected:o,setAttributes:n})]})};function MZt(e){return e?.context?.commentId||e?.context?.commentId===null?a.jsx(mZt,{...e}):a.jsx(gZt,{...e})}const JI={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/avatar",title:"Avatar",category:"theme",description:"Add a user’s avatar.",textdomain:"default",attributes:{userId:{type:"number"},size:{type:"number",default:96},isLink:{type:"boolean",default:!1},linkTarget:{type:"string",default:"_self"}},usesContext:["postType","postId","commentId"],supports:{html:!1,align:!0,alignWide:!1,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},__experimentalBorder:{__experimentalSkipSerialization:!0,radius:!0,width:!0,color:!0,style:!0,__experimentalDefaultControls:{radius:!0}},color:{text:!1,background:!1,__experimentalDuotone:"img"},interactivity:{clientNavigation:!0}},selectors:{border:".wp-block-avatar img"},editorStyle:"wp-block-avatar-editor",style:"wp-block-avatar"},{name:Hye}=JI,Uye={icon:TP,edit:MZt,example:{}},zZt=()=>it({name:Hye,metadata:JI,settings:Uye}),OZt=Object.freeze(Object.defineProperty({__proto__:null,init:zZt,metadata:JI,name:Hye,settings:Uye},Symbol.toStringTag,{value:"Module"})),yZt=[{attributes:{src:{type:"string",source:"attribute",selector:"audio",attribute:"src"},caption:{type:"string",source:"html",selector:"figcaption"},id:{type:"number"},autoplay:{type:"boolean",source:"attribute",selector:"audio",attribute:"autoplay"},loop:{type:"boolean",source:"attribute",selector:"audio",attribute:"loop"},preload:{type:"string",source:"attribute",selector:"audio",attribute:"preload"}},supports:{align:!0},save({attributes:e}){const{autoplay:t,caption:n,loop:o,preload:r,src:s}=e;return a.jsxs("figure",{children:[a.jsx("audio",{controls:"controls",src:s,autoPlay:t,loop:o,preload:r}),!Ie.isEmpty(n)&&a.jsx(Ie.Content,{tagName:"figcaption",value:n})]})}}],o5=[{ratio:"2.33",className:"wp-embed-aspect-21-9"},{ratio:"2.00",className:"wp-embed-aspect-18-9"},{ratio:"1.78",className:"wp-embed-aspect-16-9"},{ratio:"1.33",className:"wp-embed-aspect-4-3"},{ratio:"1.00",className:"wp-embed-aspect-1-1"},{ratio:"0.56",className:"wp-embed-aspect-9-16"},{ratio:"0.50",className:"wp-embed-aspect-1-2"}],Xye="wp-embed",{lock:AZt,unlock:e0}=P0("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/block-library"),vZt={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/embed",title:"Embed",category:"embed",description:"Add a block that displays content pulled from other sites, like Twitter or YouTube.",textdomain:"default",attributes:{url:{type:"string",role:"content"},caption:{type:"rich-text",source:"rich-text",selector:"figcaption",role:"content"},type:{type:"string",role:"content"},providerNameSlug:{type:"string",role:"content"},allowResponsive:{type:"boolean",default:!0},responsive:{type:"boolean",default:!1,role:"content"},previewable:{type:"boolean",default:!0,role:"content"}},supports:{align:!0,spacing:{margin:!0},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-embed-editor",style:"wp-block-embed"},{name:x2}=vZt,{kebabCase:xZt}=e0(tr),wZt=e=>G5(x2)?.find(({name:t})=>t===e),_Zt=(e,t=[])=>t.some(n=>e.match(n)),kZt=e=>G5(x2)?.find(({patterns:t})=>_Zt(e,t)),Gye=e=>e&&e.includes('class="wp-embedded-content"'),SZt=e=>{const t=e.url||e.thumbnail_url,n=a.jsx("p",{children:a.jsx("img",{src:t,alt:e.title,width:"100%"})});return M1(n)},lk=(e,t={})=>{const{preview:n,attributes:o={}}=e,{url:r,providerNameSlug:s,type:i,...c}=o;if(!r||!on(x2))return;const l=kZt(r),u=s==="wordpress"||i===Xye;if(!u&&l&&(l.attributes.providerNameSlug!==s||!s))return Ee(x2,{url:r,...c,...l.attributes});const p=G5(x2)?.find(({name:f})=>f==="wordpress");if(!(!p||!n||!Gye(n.html)||u))return Ee(x2,{url:r,...p.attributes,...t})},CZt=e=>e?o5.some(({className:t})=>e.includes(t)):!1,z4=e=>{if(!e)return e;const t=o5.reduce((o,{className:r})=>(o.push(r),o),["wp-has-aspect-ratio"]);let n=e;for(const o of t)n=n.replace(o,"");return n.trim()};function Kye(e,t,n=!0){if(!n)return z4(t);const o=document.implementation.createHTMLDocument("");o.body.innerHTML=e;const r=o.body.querySelector("iframe");if(r&&r.height&&r.width){const s=(r.width/r.height).toFixed(2);for(let i=0;i=c.ratio)return s-c.ratio>.1?z4(t):oe(z4(t),c.className,"wp-has-aspect-ratio")}}return t}function qZt(e,t){t(Ee("core/paragraph",{content:M1(a.jsx("a",{href:e,children:e}))}))}const RZt=Hs((e,t,n,o,r=!0)=>{if(!e)return{};const s={};let{type:i="rich"}=e;const{html:c,provider_name:l}=e,u=xZt((l||t).toLowerCase());return Gye(c)&&(i=Xye),(c||i==="photo")&&(s.type=i,s.providerNameSlug=u),CZt(n)||(s.className=Kye(c,n,o&&r)),s}),TZt=(e,t,n,o)=>{const{allowResponsive:r,className:s}=e;return{...e,...RZt(t,n,s,o,r)}};function fb({attributeKey:e="caption",attributes:t,setAttributes:n,isSelected:o,insertBlocksAfter:r,placeholder:s=m("Add caption"),label:i=m("Caption text"),showToolbarButton:c=!0,excludeElementClassName:l,className:u,readOnly:d,tagName:p="figcaption",addLabel:f=m("Add caption"),removeLabel:b=m("Remove caption"),icon:h=yZe,...g}){const z=t[e],A=Fr(z),{PrivateRichText:_}=e0(jn),v=_.isEmpty(z),M=_.isEmpty(A),[y,k]=x.useState(!v);x.useEffect(()=>{!v&&M&&k(!0)},[v,M]),x.useEffect(()=>{!o&&v&&k(!1)},[o,v]);const S=x.useCallback(C=>{C&&v&&C.focus()},[v]);return a.jsxs(a.Fragment,{children:[c&&a.jsx(bt,{group:"block",children:a.jsx(Vt,{onClick:()=>{k(!y),y&&z&&n({[e]:void 0})},icon:h,isPressed:y,label:y?b:f})}),y&&(!_.isEmpty(z)||o)&&a.jsx(_,{identifier:e,tagName:p,className:oe(u,l?"":z0("caption")),ref:S,"aria-label":i,placeholder:s,value:z,onChange:C=>n({[e]:C}),inlineToolbar:!0,__unstableOnSplitAtEnd:()=>r(Ee(Mr())),readOnly:d,...g})]})}const TT=["audio"];function EZt({attributes:e,className:t,setAttributes:n,onReplace:o,isSelected:r,insertBlocksAfter:s}){const{id:i,autoplay:c,loop:l,preload:u,src:d}=e,[p,f]=x.useState(e.blob);ck({url:p,allowedTypes:TT,onChange:_,onError:z});function b(y){return k=>{n({[y]:k})}}function h(y){if(y!==d){const k=lk({attributes:{url:y}});if(k!==void 0&&o){o(k);return}n({src:y,id:void 0,blob:void 0}),f()}}const{createErrorNotice:g}=Oe(mt);function z(y){g(y,{type:"snackbar"})}function A(y){return y?m("Autoplay may cause usability issues for some users."):null}function _(y){if(!y||!y.url){n({src:void 0,id:void 0,caption:void 0,blob:void 0}),f();return}if(Nr(y.url)){f(y.url);return}n({blob:void 0,src:y.url,id:y.id,caption:y.caption}),f()}const v=oe(t,{"is-transient":!!p}),M=Be({className:v});return!d&&!p?a.jsx("div",{...M,children:a.jsx(iu,{icon:a.jsx(Zn,{icon:Uue}),onSelect:_,onSelectURL:h,accept:"audio/*",allowedTypes:TT,value:e,onError:z})}):a.jsxs(a.Fragment,{children:[r&&a.jsx(bt,{group:"other",children:a.jsx(Pc,{mediaId:i,mediaURL:d,allowedTypes:TT,accept:"audio/*",onSelect:_,onSelectURL:h,onError:z,onReset:()=>_(void 0)})}),a.jsx(et,{children:a.jsxs(Qt,{title:m("Settings"),children:[a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Autoplay"),onChange:b("autoplay"),checked:c,help:A}),a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Loop"),onChange:b("loop"),checked:l}),a.jsx(Pn,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:We("Preload","noun; Audio block parameter"),value:u||"",onChange:y=>n({preload:y||void 0}),options:[{value:"",label:m("Browser default")},{value:"auto",label:m("Auto")},{value:"metadata",label:m("Metadata")},{value:"none",label:We("None","Preload value")}]})]})}),a.jsxs("figure",{...M,children:[a.jsx(I1,{isDisabled:!r,children:a.jsx("audio",{controls:"controls",src:d??p})}),!!p&&a.jsx(Xn,{}),a.jsx(fb,{attributes:e,setAttributes:n,isSelected:r,insertBlocksAfter:s,label:m("Audio caption text"),showToolbarButton:r})]})]})}function WZt({attributes:e}){const{autoplay:t,caption:n,loop:o,preload:r,src:s}=e;return s&&a.jsxs("figure",{...Be.save(),children:[a.jsx("audio",{controls:"controls",src:s,autoPlay:t,loop:o,preload:r}),!Ie.isEmpty(n)&&a.jsx(Ie.Content,{tagName:"figcaption",value:n,className:z0("caption")})]})}const NZt={from:[{type:"files",isMatch(e){return e.length===1&&e[0].type.indexOf("audio/")===0},transform(e){const t=e[0];return Ee("core/audio",{blob:ls(t)})}},{type:"shortcode",tag:"audio",attributes:{src:{type:"string",shortcode:({named:{src:e,mp3:t,m4a:n,ogg:o,wav:r,wma:s}})=>e||t||n||o||r||s},loop:{type:"string",shortcode:({named:{loop:e}})=>e},autoplay:{type:"string",shortcode:({named:{autoplay:e}})=>e},preload:{type:"string",shortcode:({named:{preload:e}})=>e}}}]},e9={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/audio",title:"Audio",category:"media",description:"Embed a simple audio player.",keywords:["music","sound","podcast","recording"],textdomain:"default",attributes:{blob:{type:"string",role:"local"},src:{type:"string",source:"attribute",selector:"audio",attribute:"src",role:"content"},caption:{type:"rich-text",source:"rich-text",selector:"figcaption",role:"content"},id:{type:"number",role:"content"},autoplay:{type:"boolean",source:"attribute",selector:"audio",attribute:"autoplay"},loop:{type:"boolean",source:"attribute",selector:"audio",attribute:"loop"},preload:{type:"string",source:"attribute",selector:"audio",attribute:"preload"}},supports:{anchor:!0,align:!0,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-audio-editor",style:"wp-block-audio"},{name:Yye}=e9,Zye={icon:Uue,example:{attributes:{src:"https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg"},viewportWidth:350},transforms:NZt,deprecated:yZt,edit:EZt,save:WZt},BZt=()=>it({name:Yye,metadata:e9,settings:Zye}),LZt=Object.freeze(Object.defineProperty({__proto__:null,init:BZt,metadata:e9,name:Yye,settings:Zye},Symbol.toStringTag,{value:"Module"})),{cleanEmptyObject:PZt}=e0(jn);function v1(e){if(!e?.style?.typography?.fontFamily)return e;const{fontFamily:t,...n}=e.style.typography;return{...e,style:PZt({...e.style,typography:n}),fontFamily:t.split("|").pop()}}const Qb=e=>{const{borderRadius:t,...n}=e,o=[t,n.style?.border?.radius].find(r=>typeof r=="number"&&r!==0);return o?{...n,style:{...n.style,border:{...n.style?.border,radius:`${o}px`}}}:n};function jZt(e){if(!e.align)return e;const{align:t,...n}=e;return{...n,className:oe(n.className,`align${e.align}`)}}const aN=e=>{if(!e.customTextColor&&!e.customBackgroundColor&&!e.customGradient)return e;const t={color:{}};e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor),e.customGradient&&(t.color.gradient=e.customGradient);const{customTextColor:n,customBackgroundColor:o,customGradient:r,...s}=e;return{...s,style:t}},ET=e=>{const{color:t,textColor:n,...o}={...e,customTextColor:e.textColor&&e.textColor[0]==="#"?e.textColor:void 0,customBackgroundColor:e.color&&e.color[0]==="#"?e.color:void 0};return aN(o)},ol={url:{type:"string",source:"attribute",selector:"a",attribute:"href"},title:{type:"string",source:"attribute",selector:"a",attribute:"title"},text:{type:"string",source:"html",selector:"a"}},IZt={attributes:{tagName:{type:"string",enum:["a","button"],default:"a"},type:{type:"string",default:"button"},textAlign:{type:"string"},url:{type:"string",source:"attribute",selector:"a",attribute:"href"},title:{type:"string",source:"attribute",selector:"a,button",attribute:"title",role:"content"},text:{type:"rich-text",source:"rich-text",selector:"a,button",role:"content"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target",role:"content"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel",role:"content"},placeholder:{type:"string"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},width:{type:"number"}},supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0,gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},reusable:!1,shadow:{__experimentalSkipSerialization:!0},spacing:{__experimentalSkipSerialization:!0,padding:["horizontal","vertical"],__experimentalDefaultControls:{padding:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},__experimentalSelector:".wp-block-button__link",interactivity:{clientNavigation:!0}},save({attributes:e,className:t}){const{tagName:n,type:o,textAlign:r,fontSize:s,linkTarget:i,rel:c,style:l,text:u,title:d,url:p,width:f}=e,b=n||"a",h=b==="button",g=o||"button",z=X1(e),A=P1(e),_=Tm(e),v=db(e),M=oe("wp-block-button__link",A.className,z.className,{[`has-text-align-${r}`]:r,"no-border-radius":l?.border?.radius===0},z0("button")),y={...z.style,...A.style,..._.style,...v.style},k=oe(t,{[`has-custom-width wp-block-button__width-${f}`]:f,"has-custom-font-size":s||l?.typography?.fontSize});return a.jsx("div",{...Be.save({className:k}),children:a.jsx(Ie.Content,{tagName:b,type:h?g:null,className:M,href:h?null:p,title:d,style:y,value:u,target:h?null:i,rel:h?null:c})})}},DZt={attributes:{url:{type:"string",source:"attribute",selector:"a",attribute:"href"},title:{type:"string",source:"attribute",selector:"a",attribute:"title"},text:{type:"string",source:"html",selector:"a"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},width:{type:"number"}},supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0,gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{fontSize:!0,__experimentalFontFamily:!0,__experimentalDefaultControls:{fontSize:!0}},reusable:!1,spacing:{__experimentalSkipSerialization:!0,padding:["horizontal","vertical"],__experimentalDefaultControls:{padding:!0}},__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{radius:!0}},__experimentalSelector:".wp-block-button__link"},save({attributes:e,className:t}){const{fontSize:n,linkTarget:o,rel:r,style:s,text:i,title:c,url:l,width:u}=e;if(!i)return null;const d=X1(e),p=P1(e),f=Tm(e),b=oe("wp-block-button__link",p.className,d.className,{"no-border-radius":s?.border?.radius===0}),h={...d.style,...p.style,...f.style},g=oe(t,{[`has-custom-width wp-block-button__width-${u}`]:u,"has-custom-font-size":n||s?.typography?.fontSize});return a.jsx("div",{...Be.save({className:g}),children:a.jsx(Ie.Content,{tagName:"a",className:b,href:l,title:c,style:h,value:i,target:o,rel:r})})}},FZt={attributes:{url:{type:"string",source:"attribute",selector:"a",attribute:"href"},title:{type:"string",source:"attribute",selector:"a",attribute:"title"},text:{type:"string",source:"html",selector:"a"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},width:{type:"number"}},supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0,gradients:!0},typography:{fontSize:!0,__experimentalFontFamily:!0},reusable:!1,spacing:{__experimentalSkipSerialization:!0,padding:["horizontal","vertical"],__experimentalDefaultControls:{padding:!0}},__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0},__experimentalSelector:".wp-block-button__link"},save({attributes:e,className:t}){const{fontSize:n,linkTarget:o,rel:r,style:s,text:i,title:c,url:l,width:u}=e;if(!i)return null;const d=X1(e),p=P1(e),f=Tm(e),b=oe("wp-block-button__link",p.className,d.className,{"no-border-radius":s?.border?.radius===0}),h={...d.style,...p.style,...f.style},g=oe(t,{[`has-custom-width wp-block-button__width-${u}`]:u,"has-custom-font-size":n||s?.typography?.fontSize});return a.jsx("div",{...Be.save({className:g}),children:a.jsx(Ie.Content,{tagName:"a",className:b,href:l,title:c,style:h,value:i,target:o,rel:r})})},migrate:v1,isEligible({style:e}){return e?.typography?.fontFamily}},$Zt=[IZt,DZt,FZt,{supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0,gradients:!0},typography:{fontSize:!0,__experimentalFontFamily:!0},reusable:!1,__experimentalSelector:".wp-block-button__link"},attributes:{...ol,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},width:{type:"number"}},isEligible({style:e}){return typeof e?.border?.radius=="number"},save({attributes:e,className:t}){const{fontSize:n,linkTarget:o,rel:r,style:s,text:i,title:c,url:l,width:u}=e;if(!i)return null;const d=s?.border?.radius,p=P1(e),f=oe("wp-block-button__link",p.className,{"no-border-radius":s?.border?.radius===0}),b={borderRadius:d||void 0,...p.style},h=oe(t,{[`has-custom-width wp-block-button__width-${u}`]:u,"has-custom-font-size":n||s?.typography?.fontSize});return a.jsx("div",{...Be.save({className:h}),children:a.jsx(Ie.Content,{tagName:"a",className:f,href:l,title:c,style:b,value:i,target:o,rel:r})})},migrate:Co(v1,Qb)},{supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0},reusable:!1,__experimentalSelector:".wp-block-button__link"},attributes:{...ol,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"},width:{type:"number"}},save({attributes:e,className:t}){const{borderRadius:n,linkTarget:o,rel:r,text:s,title:i,url:c,width:l}=e,u=P1(e),d=oe("wp-block-button__link",u.className,{"no-border-radius":n===0}),p={borderRadius:n?n+"px":void 0,...u.style},f=oe(t,{[`has-custom-width wp-block-button__width-${l}`]:l});return a.jsx("div",{...Be.save({className:f}),children:a.jsx(Ie.Content,{tagName:"a",className:d,href:c,title:i,style:p,value:s,target:o,rel:r})})},migrate:Co(v1,Qb)},{supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0},reusable:!1,__experimentalSelector:".wp-block-button__link"},attributes:{...ol,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"},width:{type:"number"}},save({attributes:e,className:t}){const{borderRadius:n,linkTarget:o,rel:r,text:s,title:i,url:c,width:l}=e,u=P1(e),d=oe("wp-block-button__link",u.className,{"no-border-radius":n===0}),p={borderRadius:n?n+"px":void 0,...u.style},f=oe(t,{[`has-custom-width wp-block-button__width-${l}`]:l});return a.jsx("div",{...Be.save({className:f}),children:a.jsx(Ie.Content,{tagName:"a",className:d,href:c,title:i,style:p,value:s,target:o,rel:r})})},migrate:Co(v1,Qb)},{supports:{align:!0,alignWide:!1,color:{gradients:!0}},attributes:{...ol,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"}},save({attributes:e}){const{borderRadius:t,linkTarget:n,rel:o,text:r,title:s,url:i}=e,c=oe("wp-block-button__link",{"no-border-radius":t===0}),l={borderRadius:t?t+"px":void 0};return a.jsx(Ie.Content,{tagName:"a",className:c,href:i,title:s,style:l,value:r,target:n,rel:o})},migrate:Qb},{supports:{align:!0,alignWide:!1},attributes:{...ol,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},customGradient:{type:"string"},gradient:{type:"string"}},isEligible:e=>!!e.customTextColor||!!e.customBackgroundColor||!!e.customGradient||!!e.align,migrate:Co(Qb,aN,jZt),save({attributes:e}){const{backgroundColor:t,borderRadius:n,customBackgroundColor:o,customTextColor:r,customGradient:s,linkTarget:i,gradient:c,rel:l,text:u,textColor:d,title:p,url:f}=e,b=Pt("color",d),h=!s&&Pt("background-color",t),g=T1(c),z=oe("wp-block-button__link",{"has-text-color":d||r,[b]:b,"has-background":t||o||s||c,[h]:h,"no-border-radius":n===0,[g]:g}),A={background:s||void 0,backgroundColor:h||s||c?void 0:o,color:b?void 0:r,borderRadius:n?n+"px":void 0};return a.jsx("div",{children:a.jsx(Ie.Content,{tagName:"a",className:z,href:f,title:p,style:A,value:u,target:i,rel:l})})}},{attributes:{...ol,align:{type:"string",default:"none"},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"}},isEligible(e){return e.className&&e.className.includes("is-style-squared")},migrate(e){let t=e.className;return t&&(t=t.replace(/is-style-squared[\s]?/,"").trim()),Qb(aN({...e,className:t||void 0,borderRadius:0}))},save({attributes:e}){const{backgroundColor:t,customBackgroundColor:n,customTextColor:o,linkTarget:r,rel:s,text:i,textColor:c,title:l,url:u}=e,d=Pt("color",c),p=Pt("background-color",t),f=oe("wp-block-button__link",{"has-text-color":c||o,[d]:d,"has-background":t||n,[p]:p}),b={backgroundColor:p?void 0:n,color:d?void 0:o};return a.jsx("div",{children:a.jsx(Ie.Content,{tagName:"a",className:f,href:u,title:l,style:b,value:i,target:r,rel:s})})}},{attributes:{...ol,align:{type:"string",default:"none"},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"}},migrate:ET,save({attributes:e}){const{url:t,text:n,title:o,backgroundColor:r,textColor:s,customBackgroundColor:i,customTextColor:c}=e,l=Pt("color",s),u=Pt("background-color",r),d=oe("wp-block-button__link",{"has-text-color":s||c,[l]:l,"has-background":r||i,[u]:u}),p={backgroundColor:u?void 0:i,color:l?void 0:c};return a.jsx("div",{children:a.jsx(Ie.Content,{tagName:"a",className:d,href:t,title:o,style:p,value:n})})}},{attributes:{...ol,color:{type:"string"},textColor:{type:"string"},align:{type:"string",default:"none"}},save({attributes:e}){const{url:t,text:n,title:o,align:r,color:s,textColor:i}=e,c={backgroundColor:s,color:i};return a.jsx("div",{className:`align${r}`,children:a.jsx(Ie.Content,{tagName:"a",className:"wp-block-button__link",href:t,title:o,style:c,value:n})})},migrate:ET},{attributes:{...ol,color:{type:"string"},textColor:{type:"string"},align:{type:"string",default:"none"}},save({attributes:e}){const{url:t,text:n,title:o,align:r,color:s,textColor:i}=e;return a.jsx("div",{className:`align${r}`,style:{backgroundColor:s},children:a.jsx(Ie.Content,{tagName:"a",href:t,title:o,style:{color:i},value:n})})},migrate:ET}],WT="noreferrer noopener",Qye="_blank",O4="nofollow";function VZt({rel:e="",url:t="",opensInNewTab:n,nofollow:o}){let r,s=e;if(n)r=Qye,s=s?.includes(WT)?s:s+` ${WT}`;else{const i=new RegExp(`\\b${WT}\\s*`,"g");s=s?.replace(i,"").trim()}if(o)s=s?.includes(O4)?s:(s+` ${O4}`).trim();else{const i=new RegExp(`\\b${O4}\\s*`,"g");s=s?.replace(i,"").trim()}return{url:jf(t),linkTarget:r,rel:s||void 0}}function cN(e){return e.toString().replace(/<\/?a[^>]*>/g,"")}const HZt=[...kc.DEFAULT_LINK_SETTINGS,{id:"nofollow",title:m("Mark as nofollow")}];function UZt(e){const{replaceBlocks:t,selectionChange:n}=Oe(J),{getBlock:o,getBlockRootClientId:r,getBlockIndex:s}=G(J),i=x.useRef(e);return i.current=e,Mn(c=>{function l(u){if(u.defaultPrevented||u.keyCode!==Gr)return;const{content:d,clientId:p}=i.current;if(d.length)return;u.preventDefault();const f=o(r(p)),b=s(p),h=jo({...f,innerBlocks:f.innerBlocks.slice(0,b)}),g=Ee(Mr()),z=f.innerBlocks.slice(b+1),A=z.length?[jo({...f,innerBlocks:z})]:[];t(f.clientId,[h,g,...A],1),n(g.clientId)}return c.addEventListener("keydown",l),()=>{c.removeEventListener("keydown",l)}},[])}function XZt({selectedWidth:e,setAttributes:t}){const n=Qo();return a.jsx(En,{label:m("Settings"),resetAll:()=>t({width:void 0}),dropdownMenuProps:n,children:a.jsx(tt,{label:m("Width"),isShownByDefault:!0,hasValue:()=>!!e,onDeselect:()=>t({width:void 0}),__nextHasNoMarginBottom:!0,children:a.jsx(Do,{label:m("Width"),value:e,onChange:o=>t({width:o}),isBlock:!0,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,children:[25,50,75,100].map(o=>a.jsx(Kn,{value:o,label:xe(m("%d%%"),o)},o))})})})}function GZt(e){const{attributes:t,setAttributes:n,className:o,isSelected:r,onReplace:s,mergeBlocks:i,clientId:c,context:l}=e,{tagName:u,textAlign:d,linkTarget:p,placeholder:f,rel:b,style:h,text:g,url:z,width:A,metadata:_}=t,v=u||"a";function M(ye){lc.primary(ye,"k")?V(ye):lc.primaryShift(ye,"k")&&(Q(),B.current?.focus())}const[y,k]=x.useState(null),S=au(t),C=BO(t),R=Tm(t),T=db(t),E=x.useRef(),B=x.useRef(),N=Be({ref:xn([k,E]),onKeyDown:M}),j=Jr(),[I,P]=x.useState(!1),$=!!z,F=p===Qye,X=!!b?.includes(O4),Z=v==="a";function V(ye){ye.preventDefault(),P(!0)}function Q(){n({url:void 0,linkTarget:void 0,rel:void 0}),P(!1)}x.useEffect(()=>{r||P(!1)},[r]);const te=x.useMemo(()=>({url:z,opensInNewTab:F,nofollow:X}),[z,F,X]),ee=UZt({content:g,clientId:c}),ue=xn([ee,B]),{lockUrlControls:ce=!1}=G(ye=>{if(!r)return{};const Ne=vl(_?.bindings?.url?.source);return{lockUrlControls:!!_?.bindings?.url&&!Ne?.canUserEditValue?.({select:ye,context:l,args:_?.bindings?.url?.args})}},[l,r,_?.bindings?.url]),[me,de]=Un("typography.fluid","layout"),Ae=wI(t,{typography:{fluid:me},layout:{wideSize:de?.wideSize}});return a.jsxs(a.Fragment,{children:[a.jsx("div",{...N,className:oe(N.className,{[`has-custom-width wp-block-button__width-${A}`]:A}),children:a.jsx(Ie,{ref:ue,"aria-label":m("Button text"),placeholder:f||m("Add text…"),value:g,onChange:ye=>n({text:cN(ye)}),withoutInteractiveFormatting:!0,className:oe(o,"wp-block-button__link",C.className,S.className,Ae.className,{[`has-text-align-${d}`]:d,"no-border-radius":h?.border?.radius===0,"has-custom-font-size":N.style.fontSize},z0("button")),style:{...S.style,...C.style,...R.style,...T.style,...Ae.style,writingMode:void 0},onReplace:s,onMerge:i,identifier:"text"})}),a.jsxs(bt,{group:"block",children:[j==="default"&&a.jsx(nr,{value:d,onChange:ye=>{n({textAlign:ye})}}),!$&&Z&&!ce&&a.jsx(Vt,{name:"link",icon:xa,title:m("Link"),shortcut:j1.primary("k"),onClick:V}),$&&Z&&!ce&&a.jsx(Vt,{name:"link",icon:Pl,title:m("Unlink"),shortcut:j1.primaryShift("k"),onClick:Q,isActive:!0})]}),Z&&r&&(I||$)&&!ce&&a.jsx(Io,{placement:"bottom",onClose:()=>{P(!1),B.current?.focus()},anchor:y,focusOnMount:I?"firstElement":!1,__unstableSlotName:"__unstable-block-tools-after",shift:!0,children:a.jsx(kc,{value:te,onChange:({url:ye,opensInNewTab:Ne,nofollow:je})=>n(VZt({rel:b,url:ye,opensInNewTab:Ne,nofollow:je})),onRemove:()=>{Q(),B.current?.focus()},forceIsEditingLink:I,settings:HZt})}),a.jsx(et,{children:a.jsx(XZt,{selectedWidth:A,setAttributes:n})}),a.jsx(et,{group:"advanced",children:Z&&a.jsx(dn,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:m("Link rel"),value:b||"",onChange:ye=>n({rel:ye})})})]})}function KZt({attributes:e,className:t}){const{tagName:n,type:o,textAlign:r,fontSize:s,linkTarget:i,rel:c,style:l,text:u,title:d,url:p,width:f}=e,b=n||"a",h=b==="button",g=o||"button",z=X1(e),A=P1(e),_=Tm(e),v=db(e),M=wI(e),y=oe("wp-block-button__link",A.className,z.className,M.className,{[`has-text-align-${r}`]:r,"no-border-radius":l?.border?.radius===0,"has-custom-font-size":s||l?.typography?.fontSize},z0("button")),k={...z.style,...A.style,..._.style,...v.style,...M.style,writingMode:void 0},S=oe(t,{[`has-custom-width wp-block-button__width-${f}`]:f});return a.jsx("div",{...Be.save({className:S}),children:a.jsx(Ie.Content,{tagName:b,type:h?g:null,className:y,href:h?null:p,title:d,style:k,value:u,target:h?null:i,rel:h?null:c})})}const t9={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/button",title:"Button",category:"design",parent:["core/buttons"],description:"Prompt visitors to take action with a button-style link.",keywords:["link"],textdomain:"default",attributes:{tagName:{type:"string",enum:["a","button"],default:"a"},type:{type:"string",default:"button"},textAlign:{type:"string"},url:{type:"string",source:"attribute",selector:"a",attribute:"href",role:"content"},title:{type:"string",source:"attribute",selector:"a,button",attribute:"title",role:"content"},text:{type:"rich-text",source:"rich-text",selector:"a,button",role:"content"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target",role:"content"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel",role:"content"},placeholder:{type:"string"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},width:{type:"number"}},supports:{anchor:!0,splitting:!0,align:!1,alignWide:!1,color:{__experimentalSkipSerialization:!0,gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{__experimentalSkipSerialization:["fontSize","lineHeight","fontFamily","fontWeight","fontStyle","textTransform","textDecoration","letterSpacing"],fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},reusable:!1,shadow:{__experimentalSkipSerialization:!0},spacing:{__experimentalSkipSerialization:!0,padding:["horizontal","vertical"],__experimentalDefaultControls:{padding:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},interactivity:{clientNavigation:!0}},styles:[{name:"fill",label:"Fill",isDefault:!0},{name:"outline",label:"Outline"}],editorStyle:"wp-block-button-editor",style:"wp-block-button",selectors:{root:".wp-block-button .wp-block-button__link",typography:{writingMode:".wp-block-button"}}},{name:Jye}=t9,eAe={icon:Kue,example:{attributes:{className:"is-style-fill",text:m("Call to action")}},edit:GZt,save:KZt,deprecated:$Zt,merge:(e,{text:t=""})=>({...e,text:(e.text||"")+t})},YZt=()=>it({name:Jye,metadata:t9,settings:eAe}),ZZt=Object.freeze(Object.defineProperty({__proto__:null,init:YZt,metadata:t9,name:Jye,settings:eAe},Symbol.toStringTag,{value:"Module"})),Rne=e=>{if(e.layout)return e;const{contentJustification:t,orientation:n,...o}=e;return(t||n)&&Object.assign(o,{layout:{type:"flex",...t&&{justifyContent:t},...n&&{orientation:n}}}),o},QZt=[{attributes:{contentJustification:{type:"string"},orientation:{type:"string",default:"horizontal"}},supports:{anchor:!0,align:["wide","full"],__experimentalExposeControlsToChildren:!0,spacing:{blockGap:!0,margin:["top","bottom"],__experimentalDefaultControls:{blockGap:!0}}},isEligible:({contentJustification:e,orientation:t})=>!!e||!!t,migrate:Rne,save({attributes:{contentJustification:e,orientation:t}}){return a.jsx("div",{...Be.save({className:oe({[`is-content-justification-${e}`]:e,"is-vertical":t==="vertical"})}),children:a.jsx(Ht.Content,{})})}},{supports:{align:["center","left","right"],anchor:!0},save(){return a.jsx("div",{children:a.jsx(Ht.Content,{})})},isEligible({align:e}){return e&&["center","left","right"].includes(e)},migrate(e){return Rne({...e,align:void 0,contentJustification:e.align})}}];function U2(e,t,n){if(!e)return;const{supports:o}=on(t),r=["core/paragraph","core/heading","core/image","core/button"],s=[];if(r.includes(t)&&n&&s.push("id","bindings"),o.renaming!==!1&&s.push("name"),!s.length)return;const i=Object.entries(e).reduce((c,[l,u])=>(s.includes(l)&&(c[l]=l==="bindings"?n(u):u),c),{});return Object.keys(i).length?i:void 0}const JZt={from:[{type:"block",isMultiBlock:!0,blocks:["core/button"],transform:e=>Ee("core/buttons",{},e.map(t=>Ee("core/button",t)))},{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>Ee("core/buttons",{},e.map(t=>{const{content:n,metadata:o}=t,r=dl(document,n),s=r.innerText||"",c=r.querySelector("a")?.getAttribute("href");return Ee("core/button",{text:s,url:c,metadata:U2(o,"core/button",({content:l})=>({text:l}))})})),isMatch:e=>e.every(t=>{const n=dl(document,t.content),o=n.innerText||"",r=n.querySelectorAll("a");return o.length<=30&&r.length<=1})}]},eQt={name:"core/button",attributesToCopy:["backgroundColor","border","className","fontFamily","fontSize","gradient","style","textColor","width"]};function tQt({attributes:e,className:t}){var n;const{fontSize:o,layout:r,style:s}=e,i=Be({className:oe(t,{"has-custom-font-size":o||s?.typography?.fontSize})}),{hasButtonVariations:c}=G(u=>({hasButtonVariations:u(kt).getBlockVariations("core/button","inserter").length>0}),[]),l=Nt(i,{defaultBlock:eQt,directInsert:!c,template:[["core/button"]],templateInsertUpdatesSelection:!0,orientation:(n=r?.orientation)!==null&&n!==void 0?n:"horizontal"});return a.jsx("div",{...l})}function nQt({attributes:e,className:t}){const{fontSize:n,style:o}=e,r=Be.save({className:oe(t,{"has-custom-font-size":n||o?.typography?.fontSize})}),s=Nt.save(r);return a.jsx("div",{...s})}const n9={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/buttons",title:"Buttons",category:"design",allowedBlocks:["core/button"],description:"Prompt visitors to take action with a group of button-style links.",keywords:["link"],textdomain:"default",supports:{anchor:!0,align:["wide","full"],html:!1,__experimentalExposeControlsToChildren:!0,color:{gradients:!0,text:!1,__experimentalDefaultControls:{background:!0}},spacing:{blockGap:["horizontal","vertical"],padding:!0,margin:["top","bottom"],__experimentalDefaultControls:{blockGap:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},layout:{allowSwitching:!1,allowInheriting:!1,default:{type:"flex"}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-buttons-editor",style:"wp-block-buttons"},{name:tAe}=n9,nAe={icon:OZe,example:{attributes:{layout:{type:"flex",justifyContent:"center"}},innerBlocks:[{name:"core/button",attributes:{text:m("Find out more")}},{name:"core/button",attributes:{text:m("Contact us")}}]},deprecated:QZt,transforms:JZt,edit:tQt,save:nQt},oQt=()=>it({name:tAe,metadata:n9,settings:nAe}),rQt=Object.freeze(Object.defineProperty({__proto__:null,init:oQt,metadata:n9,name:tAe,settings:nAe},Symbol.toStringTag,{value:"Module"})),sQt=Hs(e=>{if(!e)return{};const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()+1}});function iQt({attributes:e}){const t=Be(),{date:n,hasPosts:o,hasPostsResolved:r}=G(s=>{const{getEntityRecords:i,hasFinishedResolution:c}=s(Me),l={status:"publish",per_page:1},u=i("postType","post",l),d=c("getEntityRecords",["postType","post",l]);let p;const f=s("core/editor");return f&&f.getEditedPostAttribute("type")==="post"&&(p=f.getEditedPostAttribute("date")),{date:p,hasPostsResolved:d,hasPosts:d&&u?.length===1}},[]);return o?a.jsx("div",{...t,children:a.jsx(I1,{children:a.jsx(FO,{block:"core/calendar",attributes:{...e,...sQt(n)}})})}):a.jsx("div",{...t,children:a.jsx(vo,{icon:Yue,label:m("Calendar"),children:r?m("No published posts found."):a.jsx(Xn,{})})})}const aQt={from:[{type:"block",blocks:["core/archives"],transform:()=>Ee("core/calendar")}],to:[{type:"block",blocks:["core/archives"],transform:()=>Ee("core/archives")}]},o9={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/calendar",title:"Calendar",category:"widgets",description:"A calendar of your site’s posts.",keywords:["posts","archive"],textdomain:"default",attributes:{month:{type:"integer"},year:{type:"integer"}},supports:{align:!0,color:{link:!0,__experimentalSkipSerialization:["text","background"],__experimentalDefaultControls:{background:!0,text:!0},__experimentalSelector:"table, th"},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},style:"wp-block-calendar"},{name:oAe}=o9,rAe={icon:Yue,example:{},edit:iQt,transforms:aQt},cQt=()=>it({name:oAe,metadata:o9,settings:rAe}),lQt=Object.freeze(Object.defineProperty({__proto__:null,init:cQt,metadata:o9,name:oAe,settings:rAe},Symbol.toStringTag,{value:"Module"}));function sAe({attributes:{displayAsDropdown:e,showHierarchy:t,showPostCounts:n,showOnlyTopLevel:o,showEmpty:r,label:s,showLabel:i,taxonomy:c},setAttributes:l,className:u}){const d=vt(sAe,"blocks-category-select"),{records:p,isResolvingTaxonomies:f}=Al("root","taxonomy"),b=p?.filter(N=>N.visibility.public),h=b?.find(N=>N.slug===c),g=!f&&h?.hierarchical,z={per_page:-1,hide_empty:!r,context:"view"};g&&o&&(z.parent=0);const{records:A,isResolving:_}=Al("taxonomy",c,z),v=N=>A?.length?N===null?A:A.filter(({parent:j})=>j===N):[],M=N=>j=>l({[N]:j}),y=N=>N?Lt(N).trim():m("(Untitled)"),k=()=>v(g&&t?0:null).map(I=>S(I)),S=N=>{const j=v(N.id),{id:I,link:P,count:$,name:F}=N;return a.jsxs("li",{className:`cat-item cat-item-${I}`,children:[a.jsx("a",{href:P,target:"_blank",rel:"noreferrer noopener",children:y(F)}),n&&` (${$})`,g&&t&&!!j.length&&a.jsx("ul",{className:"children",children:j.map(X=>S(X))})]},I)},C=()=>{const j=v(g&&t?0:null);return a.jsxs(a.Fragment,{children:[i?a.jsx(Ie,{className:"wp-block-categories__label","aria-label":m("Label text"),placeholder:h.name,withoutInteractiveFormatting:!0,value:s,onChange:I=>l({label:I})}):a.jsx(qn,{as:"label",htmlFor:d,children:s||h.name}),a.jsxs("select",{id:d,children:[a.jsx("option",{children:xe(m("Select %s"),h.labels.singular_name)}),j.map(I=>R(I,0))]})]})},R=(N,j)=>{const{id:I,count:P,name:$}=N,F=v(I);return[a.jsxs("option",{className:`level-${j}`,children:[Array.from({length:j*3}).map(()=>" "),y($),n&&` (${P})`]},I),g&&t&&!!F.length&&F.map(X=>R(X,j+1))]},T=A?.length&&!e&&!_?"ul":"div",E=oe(u,{"wp-block-categories-list":!!A?.length&&!e&&!_,"wp-block-categories-dropdown":!!A?.length&&e&&!_}),B=Be({className:E});return a.jsxs(T,{...B,children:[a.jsx(et,{children:a.jsxs(Qt,{title:m("Settings"),children:[Array.isArray(b)&&a.jsx(Pn,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:m("Taxonomy"),options:b.map(N=>({label:N.name,value:N.slug})),value:c,onChange:N=>l({taxonomy:N})}),a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Display as dropdown"),checked:e,onChange:M("displayAsDropdown")}),e&&a.jsx(lt,{__nextHasNoMarginBottom:!0,className:"wp-block-categories__indentation",label:m("Show label"),checked:i,onChange:M("showLabel")}),a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Show post counts"),checked:n,onChange:M("showPostCounts")}),g&&a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Show only top level terms"),checked:o,onChange:M("showOnlyTopLevel")}),a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Show empty terms"),checked:r,onChange:M("showEmpty")}),g&&!o&&a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Show hierarchy"),checked:t,onChange:M("showHierarchy")})]})}),_&&a.jsx(vo,{icon:yde,label:m("Terms"),children:a.jsx(Xn,{})}),!_&&A?.length===0&&a.jsx("p",{children:h.labels.no_terms}),!_&&A?.length>0&&(e?C():k())]})}const uQt=[{name:"terms",title:m("Terms List"),icon:gz,attributes:{taxonomy:"post_tag"},isActive:e=>e.taxonomy!=="category"},{name:"categories",title:m("Categories List"),description:m("Display a list of all categories."),icon:gz,attributes:{taxonomy:"category"},isActive:["taxonomy"],isDefault:!0}],r9={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/categories",title:"Terms List",category:"widgets",description:"Display a list of all terms of a given taxonomy.",keywords:["categories"],textdomain:"default",attributes:{taxonomy:{type:"string",default:"category"},displayAsDropdown:{type:"boolean",default:!1},showHierarchy:{type:"boolean",default:!1},showPostCounts:{type:"boolean",default:!1},showOnlyTopLevel:{type:"boolean",default:!1},showEmpty:{type:"boolean",default:!1},label:{type:"string",role:"content"},showLabel:{type:"boolean",default:!0}},usesContext:["enhancedPagination"],supports:{align:!0,html:!1,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},editorStyle:"wp-block-categories-editor",style:"wp-block-categories"},{name:iAe}=r9,aAe={icon:gz,example:{},edit:sAe,variations:uQt},dQt=()=>it({name:iAe,metadata:r9,settings:aAe}),pQt=Object.freeze(Object.defineProperty({__proto__:null,init:dQt,metadata:r9,name:iAe,settings:aAe},Symbol.toStringTag,{value:"Module"})),fQt=({clientId:e})=>{const{replaceBlocks:t}=Oe(J),n=G(o=>o(J).getBlock(e),[e]);return a.jsx(Vt,{onClick:()=>t(n.clientId,O3({HTML:Ks(n)})),children:m("Convert to blocks")})};function bQt({onClick:e,isModalFullScreen:t}){return Yn("small","<")?null:a.jsx(Ce,{size:"compact",onClick:e,icon:zz,isPressed:t,label:m(t?"Exit fullscreen":"Enter fullscreen")})}function hQt(e){const t=G(n=>n(J).getSettings().styles);return x.useEffect(()=>{const{baseURL:n,suffix:o,settings:r}=window.wpEditorL10n.tinymce;return window.tinymce.EditorManager.overrideDefaults({base_url:n,suffix:o}),window.wp.oldEditor.initialize(e.id,{tinymce:{...r,setup(s){s.on("init",()=>{const i=s.getDoc();t.forEach(({css:c})=>{const l=i.createElement("style");l.innerHTML=c,i.head.appendChild(l)})})}}}),()=>{window.wp.oldEditor.remove(e.id)}},[]),a.jsx("textarea",{...e})}function mQt(e){const{clientId:t,attributes:{content:n},setAttributes:o,onReplace:r}=e,[s,i]=x.useState(!1),[c,l]=x.useState(!1),u=`editor-${t}`,d=()=>n?i(!1):r([]);return a.jsxs(a.Fragment,{children:[a.jsx(bt,{children:a.jsx(Wn,{children:a.jsx(Vt,{onClick:()=>i(!0),children:m("Edit")})})}),n&&a.jsx(i0,{children:n}),(s||!n)&&a.jsxs(Zo,{title:m("Classic Editor"),onRequestClose:d,shouldCloseOnClickOutside:!1,overlayClassName:"block-editor-freeform-modal",isFullScreen:c,className:"block-editor-freeform-modal__content",headerActions:a.jsx(bQt,{onClick:()=>l(!c),isModalFullScreen:c}),children:[a.jsx(hQt,{id:u,defaultValue:n}),a.jsxs(Yo,{className:"block-editor-freeform-modal__actions",justify:"flex-end",expanded:!1,children:[a.jsx(Tn,{children:a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:d,children:m("Cancel")})}),a.jsx(Tn,{children:a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"primary",onClick:()=>{o({content:window.wp.oldEditor.getContent(u)}),i(!1)},children:m("Save")})})]})]})]})}const{wp:Tne}=window;function gQt(e){const t=e.getBody();return t.childNodes.length>1?!1:t.childNodes.length===0?!0:t.childNodes[0].childNodes.length>1?!1:/^\n?$/.test(t.innerText||t.textContent)}function MQt(e){const{clientId:t}=e,n=G(i=>i(J).canRemoveBlock(t),[t]),[o,r]=x.useState(!1),s=Mn(i=>{r(i.ownerDocument!==document)},[]);return a.jsxs(a.Fragment,{children:[n&&a.jsx(bt,{children:a.jsx(Wn,{children:a.jsx(fQt,{clientId:t})})}),a.jsx("div",{...Be({ref:s}),children:o?a.jsx(mQt,{...e}):a.jsx(zQt,{...e})})]})}function zQt({clientId:e,attributes:{content:t},setAttributes:n,onReplace:o}){const{getMultiSelectedBlockClientIds:r}=G(J),s=x.useRef(!1);x.useEffect(()=>{if(!s.current)return;const l=window.tinymce.get(`editor-${e}`);if(!l)return;l.getContent()!==t&&l.setContent(t||"")},[e,t]),x.useEffect(()=>{const{baseURL:l,suffix:u}=window.wpEditorL10n.tinymce;s.current=!0,window.tinymce.EditorManager.overrideDefaults({base_url:l,suffix:u});function d(b){let h;t&&b.on("loadContent",()=>b.setContent(t)),b.on("blur",()=>{h=b.selection.getBookmark(2,!0);const z=document.querySelector(".interface-interface-skeleton__content"),A=z.scrollTop;return r()?.length||n({content:b.getContent()}),b.once("focus",()=>{h&&(b.selection.moveToBookmark(h),z.scrollTop!==A&&(z.scrollTop=A))}),!1}),b.on("mousedown touchstart",()=>{h=null});const g=F1(()=>{const z=b.getContent();z!==b._lastChange&&(b._lastChange=z,n({content:z}))},250);b.on("Paste Change input Undo Redo",g),b.on("remove",g.cancel),b.on("keydown",z=>{lc.primary(z,"z")&&z.stopPropagation(),(z.keyCode===Mc||z.keyCode===zl)&&gQt(b)&&(o([]),z.preventDefault(),z.stopImmediatePropagation());const{altKey:A}=z;A&&z.keyCode===LSe&&z.stopPropagation()}),b.on("init",()=>{const z=b.getBody();z.ownerDocument.activeElement===z&&(z.blur(),b.focus())})}function p(){const{settings:b}=window.wpEditorL10n.tinymce;Tne.oldEditor.initialize(`editor-${e}`,{tinymce:{...b,inline:!0,content_css:!1,fixed_toolbar_container:`#toolbar-${e}`,setup:d}})}function f(){document.readyState==="complete"&&p()}return document.readyState==="complete"?p():document.addEventListener("readystatechange",f),()=>{document.removeEventListener("readystatechange",f),Tne.oldEditor.remove(`editor-${e}`),s.current=!1}},[]);function i(){const l=window.tinymce.get(`editor-${e}`);l&&l.focus()}function c(l){l.stopPropagation(),l.nativeEvent.stopImmediatePropagation()}return a.jsxs(a.Fragment,{children:[a.jsx("div",{id:`toolbar-${e}`,className:"block-library-classic__toolbar",onClick:i,"data-placeholder":m("Classic"),onKeyDown:c},"toolbar"),a.jsx("div",{id:`editor-${e}`,className:"wp-block-freeform block-library-rich-text__tinymce"},"editor")]})}function OQt({attributes:e}){const{content:t}=e;return a.jsx(i0,{children:t})}const s9={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/freeform",title:"Classic",category:"text",description:"Use the classic WordPress editor.",textdomain:"default",attributes:{content:{type:"string",source:"raw"}},supports:{className:!1,customClassName:!1,reusable:!1},editorStyle:"wp-block-freeform-editor"},{name:r5}=s9,cAe={icon:vZe,edit:MQt,save:OQt},yQt=()=>it({name:r5,metadata:s9,settings:cAe}),AQt=Object.freeze(Object.defineProperty({__proto__:null,init:yQt,metadata:s9,name:r5,settings:cAe},Symbol.toStringTag,{value:"Module"}));function vQt({attributes:e,setAttributes:t,onRemove:n,insertBlocksAfter:o,mergeBlocks:r}){const s=Be();return a.jsx("pre",{...s,children:a.jsx(Ie,{tagName:"code",identifier:"content",value:e.content,onChange:i=>t({content:i}),onRemove:n,onMerge:r,placeholder:m("Write code…"),"aria-label":m("Code"),preserveWhiteSpace:!0,__unstablePastePlainText:!0,__unstableOnSplitAtDoubleLineEnd:()=>o(Ee(Mr()))})})}function xQt(e){return Ku(wQt,_Qt)(e||"")}function wQt(e){return e.replace(/\[/g,"[")}function _Qt(e){return e.replace(/^(\s*https?:)\/\/([^\s<>"]+\s*)$/m,"$1//$2")}function kQt({attributes:e}){return a.jsx("pre",{...Be.save(),children:a.jsx(Ie.Content,{tagName:"code",value:xQt(typeof e.content=="string"?e.content:e.content.toHTMLString({preserveWhiteSpace:!0}))})})}const SQt={from:[{type:"enter",regExp:/^```$/,transform:()=>Ee("core/code")},{type:"block",blocks:["core/paragraph"],transform:({content:e,metadata:t})=>Ee("core/code",{content:e,metadata:U2(t,"core/code")})},{type:"block",blocks:["core/html"],transform:({content:e,metadata:t})=>Ee("core/code",{content:T0({value:eo({text:e})}),metadata:U2(t,"core/code")})},{type:"raw",isMatch:e=>e.nodeName==="PRE"&&e.children.length===1&&e.firstChild.nodeName==="CODE",schema:{pre:{children:{code:{children:{"#text":{}}}}}}}],to:[{type:"block",blocks:["core/paragraph"],transform:({content:e,metadata:t})=>Ee("core/paragraph",{content:e,metadata:U2(t,"core/paragraph")})}]},i9={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/code",title:"Code",category:"text",description:"Display code snippets that respect your spacing and tabs.",textdomain:"default",attributes:{content:{type:"rich-text",source:"rich-text",selector:"code",__unstablePreserveWhiteSpace:!0}},supports:{align:["wide"],anchor:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},spacing:{margin:["top","bottom"],padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{width:!0,color:!0}},color:{text:!0,background:!0,gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},interactivity:{clientNavigation:!0}},style:"wp-block-code"},{name:lAe}=i9,uAe={icon:qP,example:{attributes:{content:m(`// A “block” is the abstract term used + .is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}`,ue=_===Wf,ce=[Wf,Di,$l].includes(_)&&!v&&!u&&!C,me=x.useMemo(()=>[...t??[],{css:`:where(.block-editor-iframe__body){display:flow-root;}.is-root-container{display:flow-root;${ce?"min-height:0!important;":""}}`}],[t,ce]),de=x.useRef(),Ae=nBt();return r=xn([de,r,d==="post-only"?Ae:null,YKt({isEnabled:d==="template-locked"}),HKt({isEnabled:d==="template-locked"}),UKt(),ce?l:null]),a.jsx("div",{className:oe("editor-visual-editor","edit-post-visual-editor",s,{"has-padding":z||ce,"is-resizable":ce,"is-iframed":!n,"is-scrollable":n||g!=="Desktop"}),children:a.jsx(Nye,{enableResizing:ce,height:i&&!ue?i:"100%",children:a.jsxs(KKt,{shouldIframe:!n,contentRef:r,styles:me,height:"100%",iframeProps:{...o,style:{...o?.style,...R}},children:[S&&!k&&d==="post-only"&&!A&&a.jsxs(a.Fragment,{children:[a.jsx(wv,{selector:".editor-visual-editor__post-title-wrapper",layout:E}),a.jsx(wv,{selector:".block-editor-block-list__layout.is-root-container",layout:V}),I&&a.jsx(wv,{css:ee}),F&&a.jsx(wv,{layout:X,css:F})]}),d==="post-only"&&!A&&a.jsx("div",{className:oe("editor-visual-editor__post-title-wrapper","edit-post-visual-editor__post-title-wrapper",{"has-global-padding":y}),contentEditable:!1,ref:Q,style:{marginTop:"4rem"},children:a.jsx(kye,{ref:te})}),a.jsxs(TO,{blockName:b,uniqueId:h,children:[a.jsx(B_,{className:oe("is-"+g.toLowerCase()+"-preview",d!=="post-only"||A?"wp-site-blocks":`${$} wp-block-post-content`,{"has-global-padding":d==="post-only"&&!A&&y}),layout:Z,dropZoneElement:n?de.current:de.current?.parentNode,__unstableDisableDropZone:d==="template-locked"}),d==="template-locked"&&a.jsx(FKt,{contentRef:de})]})]})})})}const JKt={header:m("Editor top bar"),body:m("Editor content"),sidebar:m("Editor settings"),actions:m("Editor publish"),footer:m("Editor footer")};function eYt({className:e,styles:t,children:n,forceIsDirty:o,contentRef:r,disableIframe:s,autoFocus:i,customSaveButton:c,customSavePanel:l,forceDisableBlockTools:u,title:d,iframeProps:p}){const{mode:f,isRichEditingEnabled:b,isInserterOpened:h,isListViewOpened:g,isDistractionFree:z,isPreviewMode:A,showBlockBreadcrumbs:_,documentLabel:v}=G(R=>{const{get:T}=R(ht),{getEditorSettings:E,getPostTypeLabel:B}=R(_e),N=E(),j=B();return{mode:R(_e).getEditorMode(),isRichEditingEnabled:N.richEditingEnabled,isInserterOpened:R(_e).isInserterOpened(),isListViewOpened:R(_e).isListViewOpened(),isDistractionFree:T("core","distractionFree"),isPreviewMode:N.isPreviewMode,showBlockBreadcrumbs:T("core","showBlockBreadcrumbs"),documentLabel:j||We("Document","noun, breadcrumb")}},[]),M=Yn("medium"),y=m(g?"Document Overview":"Block Library"),[k,S]=x.useState(!1),C=x.useCallback(R=>{typeof k=="function"&&k(R),S(!1)},[k]);return a.jsx(LOe,{isDistractionFree:z,className:oe("editor-editor-interface",e,{"is-entity-save-view-open":!!k,"is-distraction-free":z&&!A}),labels:{...JKt,secondarySidebar:y},header:!A&&a.jsx(EKt,{forceIsDirty:o,setEntitiesSavedStatesCallback:S,customSaveButton:c,forceDisableBlockTools:u,title:d}),editorNotices:a.jsx(ine,{}),secondarySidebar:!A&&f==="visual"&&(h&&a.jsx(NKt,{})||g&&a.jsx(PKt,{})),sidebar:!A&&!z&&a.jsx(sk.Slot,{scope:"core"}),content:a.jsxs(a.Fragment,{children:[!z&&!A&&a.jsx(ine,{}),a.jsx(Wye.Slot,{children:([R])=>R||a.jsxs(a.Fragment,{children:[!A&&(f==="text"||!b)&&a.jsx(DKt,{autoFocus:i}),!A&&!M&&f==="visual"&&a.jsx(lI,{hideDragHandle:!0}),(A||b&&f==="visual")&&a.jsx(QKt,{styles:t,contentRef:r,disableIframe:s,autoFocus:i,iframeProps:p}),n]})})]}),footer:!A&&!z&&M&&_&&b&&f==="visual"&&a.jsx(Cvt,{rootLabelText:v}),actions:A?void 0:l||a.jsx(IKt,{closeEntitiesSavedStates:C,isEntitiesSavedStatesOpen:k,setEntitiesSavedStatesCallback:S,forceIsDirtyPublishPanel:o})})}const{OverridesPanel:tYt}=St(Vi);function nYt(){return G(t=>t(_e).getCurrentPostType()==="wp_block",[])?a.jsx(tYt,{}):null}function t5(e){return typeof e.title=="string"?Lt(e.title):e.title&&"rendered"in e.title?Lt(e.title.rendered):e.title&&"raw"in e.title?Lt(e.title.raw):""}const oYt=({items:e,closeModal:t})=>{const[n]=e,o=t5(n),{showOnFront:r,currentHomePage:s,isSaving:i}=G(h=>{const{getEntityRecord:g,isSavingEntityRecord:z}=h(Me),A=g("root","site"),_=g("postType","page",A?.page_on_front);return{showOnFront:A?.show_on_front,currentHomePage:_,isSaving:z("root","site")}}),{saveEntityRecord:c}=Oe(Me),{createSuccessNotice:l,createErrorNotice:u}=Oe(mt);async function d(h){h.preventDefault();try{await c("root","site",{page_on_front:n.id,show_on_front:"page"}),l(m("Homepage updated."),{type:"snackbar"})}catch(g){const z=g.message&&g.code!=="unknown_error"?g.message:m("An error occurred while setting the homepage.");u(z,{type:"snackbar"})}finally{t?.()}}let p="";r==="posts"?p=m("This will replace the current homepage which is set to display latest posts."):s&&(p=xe(m('This will replace the current homepage: "%s"'),t5(s)));const f=xe(m('Set "%1$s" as the site homepage? %2$s'),o,p).trim(),b=m("Set homepage");return a.jsx("form",{onSubmit:d,children:a.jsxs(dt,{spacing:"5",children:[a.jsx(Sn,{children:f}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},disabled:i,accessibleWhenDisabled:!0,children:m("Cancel")}),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",disabled:i,accessibleWhenDisabled:!0,children:b})]})]})})},rYt=()=>{const{pageOnFront:e,pageForPosts:t}=G(n=>{const{getEntityRecord:o,canUser:r}=n(Me),s=r("read",{kind:"root",name:"site"})?o("root","site"):void 0;return{pageOnFront:s?.page_on_front,pageForPosts:s?.page_for_posts}});return x.useMemo(()=>({id:"set-as-homepage",label:m("Set as homepage"),isEligible(n){return!(n.status!=="publish"||n.type!=="page"||e===n.id||t===n.id)},RenderModal:oYt}),[t,e])},sYt=({items:e,closeModal:t})=>{const[n]=e,o=t5(n),{currentPostsPage:r,isPageForPostsSet:s,isSaving:i}=G(h=>{const{getEntityRecord:g,isSavingEntityRecord:z}=h(Me),A=g("root","site");return{currentPostsPage:g("postType","page",A?.page_for_posts),isPageForPostsSet:A?.page_for_posts!==0,isSaving:z("root","site")}}),{saveEntityRecord:c}=Oe(Me),{createSuccessNotice:l,createErrorNotice:u}=Oe(mt);async function d(h){h.preventDefault();try{await c("root","site",{page_for_posts:n.id,show_on_front:"page"}),l(m("Posts page updated."),{type:"snackbar"})}catch(g){const z=g.message&&g.code!=="unknown_error"?g.message:m("An error occurred while setting the posts page.");u(z,{type:"snackbar"})}finally{t?.()}}const p=s&&r?xe(m('This will replace the current posts page: "%s"'),t5(r)):m("This page will show the latest posts."),f=xe(m('Set "%1$s" as the posts page? %2$s'),o,p),b=m("Set posts page");return a.jsx("form",{onSubmit:d,children:a.jsxs(dt,{spacing:"5",children:[a.jsx(Sn,{children:f}),a.jsxs(Ot,{justify:"right",children:[a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},disabled:i,accessibleWhenDisabled:!0,children:m("Cancel")}),a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",disabled:i,accessibleWhenDisabled:!0,children:b})]})]})})},iYt=()=>{const{pageOnFront:e,pageForPosts:t}=G(n=>{const{getEntityRecord:o,canUser:r}=n(Me),s=r("read",{kind:"root",name:"site"})?o("root","site"):void 0;return{pageOnFront:s?.page_on_front,pageForPosts:s?.page_for_posts}});return x.useMemo(()=>({id:"set-as-posts-page",label:m("Set as posts page"),isEligible(n){return!(n.status!=="publish"||n.type!=="page"||e===n.id||t===n.id)},RenderModal:sYt}),[t,e])};function Bye({postType:e,onActionPerformed:t,context:n}){const{defaultActions:o}=G(d=>{const{getEntityActions:p}=St(d(_e));return{defaultActions:p("postType",e)}},[e]),{canManageOptions:r,hasFrontPageTemplate:s}=G(d=>{const{getEntityRecords:p}=d(Me),f=p("postType","wp_template",{per_page:-1});return{canManageOptions:d(Me).canUser("update",{kind:"root",name:"site"}),hasFrontPageTemplate:!!f?.find(b=>b?.slug==="front-page")}}),i=rYt(),c=iYt(),l=r&&!s,{registerPostTypeSchema:u}=St(Oe(_e));return x.useEffect(()=>{u(e)},[u,e]),x.useMemo(()=>{let d=[...o];if(l&&d.push(i,c),d=d.sort((p,f)=>f.id==="move-to-trash"?-1:0),d=d.filter(p=>p.context?p.context===n:!0),t)for(let p=0;p{f(b,{...h,onActionPerformed:g=>{h?.onActionPerformed&&h.onActionPerformed(g),t(d[p].id,g)}})}}}if(d[p].RenderModal){const f=d[p].RenderModal;d[p]={...d[p],RenderModal:b=>a.jsx(f,{...b,onActionPerformed:h=>{b.onActionPerformed&&b.onActionPerformed(h),t(d[p].id,h)}})}}}return d},[n,o,t,i,c,l])}const{Menu:H2,kebabCase:aYt}=St(tr);function cYt(e,t){const{items:n,permissions:o}=G(r=>{const{getEditedEntityRecord:s,getEntityRecordPermissions:i}=St(r(Me));return{items:t.map(c=>s("postType",e,c)),permissions:t.map(c=>i("postType",e,c))}},[t,e]);return x.useMemo(()=>n.map((r,s)=>({...r,permissions:o[s]})),[n,o])}function lYt({postType:e,postId:t,onActionPerformed:n}){const[o,r]=x.useState(null),s=x.useMemo(()=>Array.isArray(t)?t:t?[t]:[],[t]),i=cYt(e,s),c=Bye({postType:e,onActionPerformed:n}),l=x.useMemo(()=>c.filter(u=>(!u.isEligible||i.some(d=>u.isEligible(d)))&&(i.length<2||u.supportsBulk)),[c,i]);return a.jsxs(a.Fragment,{children:[a.jsxs(H2,{placement:"bottom-end",children:[a.jsx(H2.TriggerButton,{render:a.jsx(Ce,{size:"small",icon:Wc,label:m("Actions"),disabled:!l.length,accessibleWhenDisabled:!0,className:"editor-all-actions-button"})}),a.jsx(H2.Popover,{children:a.jsx(pYt,{actions:l,items:i,setActiveModalAction:r})})]}),!!o&&a.jsx(dYt,{action:o,items:i,closeModal:()=>r(null)})]})}function uYt({action:e,onClick:t,items:n}){const o=typeof e.label=="string"?e.label:e.label(n);return a.jsx(H2.Item,{onClick:t,children:a.jsx(H2.ItemLabel,{children:o})})}function dYt({action:e,items:t,closeModal:n}){const o=typeof e.label=="string"?e.label:e.label(t);return a.jsx(Zo,{title:e.modalHeader||o,__experimentalHideHeader:!!e.hideModalHeader,onRequestClose:n??(()=>{}),focusOnMount:"firstContentElement",size:"medium",overlayClassName:`editor-action-modal editor-action-modal__${aYt(e.id)}`,children:a.jsx(e.RenderModal,{items:t,closeModal:n})})}function pYt({actions:e,items:t,setActiveModalAction:n}){const o=Fn();return a.jsx(H2.Group,{children:e.map(r=>a.jsx(uYt,{action:r,onClick:()=>{if("RenderModal"in r){n(r);return}r.callback(t,{registry:o})},items:t},r.id))})}const{Badge:fYt}=St(tr);function Lye({postType:e,postId:t,onActionPerformed:n}){const o=x.useMemo(()=>Array.isArray(t)?t:[t],[t]),{postTitle:r,icon:s,labels:i}=G(u=>{const{getEditedEntityRecord:d,getEntityRecord:p,getPostType:f}=u(Me),{getPostIcon:b}=St(u(_e));let h="";const g=d("postType",e,o[0]);if(o.length===1){var z;const{default_template_types:A=[]}=(z=p("root","__unstableBase"))!==null&&z!==void 0?z:{};h=([L0,Di].includes(e)?LO({template:g,templateTypes:A}):{})?.title||g?.title}return{postTitle:h,icon:b(e,{area:g?.area}),labels:f(e)?.labels}},[o,e]),c=HOe(t);let l=m("No title");return i?.name&&o.length>1?l=xe(m("%i %s"),t.length,i?.name):r&&(l=x1(r)),a.jsxs(dt,{spacing:1,className:"editor-post-card-panel",children:[a.jsxs(Ot,{spacing:2,className:"editor-post-card-panel__header",align:"flex-start",children:[a.jsx(qo,{className:"editor-post-card-panel__icon",icon:s}),a.jsxs(Sn,{numberOfLines:2,truncate:!0,className:"editor-post-card-panel__title",as:"h2",children:[a.jsx("span",{className:"editor-post-card-panel__title-name",children:l}),c&&o.length===1&&a.jsx(fYt,{children:c})]}),a.jsx(lYt,{postType:e,postId:t,onActionPerformed:n})]}),o.length>1&&a.jsx(Sn,{className:"editor-post-card-panel__description",children:xe(m("Changes will be applied to all selected %s."),i?.name.toLowerCase())})]})}const bYt=189;function hYt(){const{postContent:e}=G(i=>{const{getEditedPostAttribute:c,getCurrentPostType:l,getCurrentPostId:u}=i(_e),{canUser:d}=i(Me),{getEntityRecord:p}=i(Me),f=d("read",{kind:"root",name:"site"})?p("root","site"):void 0,b=l();return{postContent:!(+u()===f?.page_for_posts)&&![L0,Di].includes(b)&&c("content")}},[]),t=We("words","Word count type. Do not translate!"),n=x.useMemo(()=>e?DO(e,t):0,[e,t]);if(!n)return null;const o=Math.round(n/bYt),r=xe(Dn("%s word","%s words",n),n.toLocaleString()),s=o<=1?m("1 minute"):xe(Dn("%s minute","%s minutes",o),o.toLocaleString());return a.jsx("div",{className:"editor-post-content-information",children:a.jsx(Sn,{children:xe(m("%1$s, %2$s read time."),r,s)})})}function mYt(){const{postFormat:e}=G(s=>{const{getEditedPostAttribute:i}=s(_e),c=i("format");return{postFormat:c??"standard"}},[]),t=VI.find(s=>s.id===e),[n,o]=x.useState(null),r=x.useMemo(()=>({anchor:n,placement:"left-start",offset:36,shift:!0}),[n]);return a.jsx(iye,{children:a.jsx(xs,{label:m("Format"),ref:o,children:a.jsx(so,{popoverProps:r,contentClassName:"editor-post-format__dialog",focusOnMount:!0,renderToggle:({isOpen:s,onToggle:i})=>a.jsx(Ce,{size:"compact",variant:"tertiary","aria-expanded":s,"aria-label":xe(m("Change format: %s"),t?.caption),onClick:i,children:t?.caption}),renderContent:({onClose:s})=>a.jsxs("div",{className:"editor-post-format__dialog-content",children:[a.jsx(Qs,{title:m("Format"),onClose:s}),a.jsx(aye,{})]})})})})}function gYt(){const e=G(n=>n(_e).getEditedPostAttribute("modified"),[]),t=e&&xe(m("Last edited %s."),r_(e));return t?a.jsx("div",{className:"editor-post-last-edited-panel",children:a.jsx(Sn,{children:t})}):null}function MYt({className:e,children:t}){return a.jsx(dt,{className:oe("editor-post-panel__section",e),children:t})}const zYt={};function OYt(){const{editEntityRecord:e}=Oe(Me),{postsPageTitle:t,postsPageId:n,isTemplate:o,postSlug:r}=G(d=>{const{getEntityRecord:p,getEditedEntityRecord:f,canUser:b}=d(Me),h=b("read",{kind:"root",name:"site"})?p("root","site"):void 0,g=h?.page_for_posts?f("postType","page",h?.page_for_posts):zYt,{getEditedPostAttribute:z,getCurrentPostType:A}=d(_e);return{postsPageId:g?.id,postsPageTitle:g?.title,isTemplate:A()===L0,postSlug:z("slug")}},[]),[s,i]=x.useState(null),c=x.useMemo(()=>({anchor:s,placement:"left-start",offset:36,shift:!0}),[s]);if(!o||!["home","index"].includes(r)||!n)return null;const l=d=>{e("postType","page",n,{title:d})},u=Lt(t);return a.jsx(xs,{label:m("Blog title"),ref:i,children:a.jsx(so,{popoverProps:c,contentClassName:"editor-blog-title-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:d,onToggle:p})=>a.jsx(Ce,{size:"compact",variant:"tertiary","aria-expanded":d,"aria-label":xe(m("Change blog title: %s"),u),onClick:p,children:u}),renderContent:({onClose:d})=>a.jsxs(a.Fragment,{children:[a.jsx(Qs,{title:m("Blog title"),onClose:d}),a.jsx(B1,{placeholder:m("No title"),size:"__unstable-large",value:t,onChange:F1(l,300),label:m("Blog title"),help:m("Set the Posts Page title. Appears in search results, and when the page is shared on social media."),hideLabelFromVision:!0})]})})})}function yYt(){const{editEntityRecord:e}=Oe(Me),{postsPerPage:t,isTemplate:n,postSlug:o}=G(l=>{const{getEditedPostAttribute:u,getCurrentPostType:d}=l(_e),{getEditedEntityRecord:p,canUser:f}=l(Me),b=f("read",{kind:"root",name:"site"})?p("root","site"):void 0;return{isTemplate:d()===L0,postSlug:u("slug"),postsPerPage:b?.posts_per_page||1}},[]),[r,s]=x.useState(null),i=x.useMemo(()=>({anchor:r,placement:"left-start",offset:36,shift:!0}),[r]);if(!n||!["home","index"].includes(o))return null;const c=l=>{e("root","site",void 0,{posts_per_page:l})};return a.jsx(xs,{label:m("Posts per page"),ref:s,children:a.jsx(so,{popoverProps:i,contentClassName:"editor-posts-per-page-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:l,onToggle:u})=>a.jsx(Ce,{size:"compact",variant:"tertiary","aria-expanded":l,"aria-label":m("Change posts per page"),onClick:u,children:t}),renderContent:({onClose:l})=>a.jsxs(a.Fragment,{children:[a.jsx(Qs,{title:m("Posts per page"),onClose:l}),a.jsx(g0,{placeholder:0,value:t,size:"__unstable-large",spinControls:"custom",step:"1",min:"1",onChange:c,label:m("Posts per page"),help:m("Set the default number of posts to display on blog pages, including categories and tags. Some templates may override this setting."),hideLabelFromVision:!0})]})})})}const AYt=[{label:We("Open",'Adjective: e.g. "Comments are open"'),value:"open",description:m("Visitors can add new comments and replies.")},{label:m("Closed"),value:"",description:[m("Visitors cannot add new comments or replies."),m("Existing comments remain visible.")].join(" ")}];function vYt(){const{editEntityRecord:e}=Oe(Me),{allowCommentsOnNewPosts:t,isTemplate:n,postSlug:o}=G(l=>{const{getEditedPostAttribute:u,getCurrentPostType:d}=l(_e),{getEditedEntityRecord:p,canUser:f}=l(Me),b=f("read",{kind:"root",name:"site"})?p("root","site"):void 0;return{isTemplate:d()===L0,postSlug:u("slug"),allowCommentsOnNewPosts:b?.default_comment_status||""}},[]),[r,s]=x.useState(null),i=x.useMemo(()=>({anchor:r,placement:"left-start",offset:36,shift:!0}),[r]);if(!n||!["home","index"].includes(o))return null;const c=l=>{e("root","site",void 0,{default_comment_status:l?"open":null})};return a.jsx(xs,{label:m("Discussion"),ref:s,children:a.jsx(so,{popoverProps:i,contentClassName:"editor-site-discussion-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:l,onToggle:u})=>a.jsx(Ce,{size:"compact",variant:"tertiary","aria-expanded":l,"aria-label":m("Change discussion settings"),onClick:u,children:m(t?"Comments open":"Comments closed")}),renderContent:({onClose:l})=>a.jsxs(a.Fragment,{children:[a.jsx(Qs,{title:m("Discussion"),onClose:l}),a.jsxs(dt,{spacing:3,children:[a.jsx(Sn,{children:m("Changes will apply to new posts only. Individual posts may override these settings.")}),a.jsx(sb,{className:"editor-site-discussion__options",hideLabelFromVision:!0,label:m("Comment status"),options:AYt,onChange:c,selected:t})]})]})})})}const xYt="post-status";function wYt({onActionPerformed:e}){const{isRemovedPostStatusPanel:t,postType:n,postId:o}=G(r=>{const{isEditorPanelRemoved:s,getCurrentPostType:i,getCurrentPostId:c}=r(_e);return{isRemovedPostStatusPanel:s(xYt),postType:i(),postId:c()}},[]);return a.jsx(MYt,{className:"editor-post-summary",children:a.jsx(nye.Slot,{children:r=>a.jsx(a.Fragment,{children:a.jsxs(dt,{spacing:4,children:[a.jsx(Lye,{postType:n,postId:o,onActionPerformed:e}),a.jsx(vXt,{withPanelBody:!1}),a.jsx(fXt,{}),a.jsxs(dt,{spacing:1,children:[a.jsx(hYt,{}),a.jsx(gYt,{})]}),!t&&a.jsxs(dt,{spacing:4,children:[a.jsxs(dt,{spacing:1,children:[a.jsx(yye,{}),a.jsx(hGt,{}),a.jsx(_Gt,{}),a.jsx(tXt,{}),a.jsx(GUt,{}),a.jsx(cXt,{}),a.jsx(_Xt,{}),a.jsx(_Ut,{}),a.jsx(mGt,{}),a.jsx(OYt,{}),a.jsx(yYt,{}),a.jsx(vYt,{}),a.jsx(mYt,{}),r]}),a.jsx(xGt,{onActionPerformed:e})]})]})})})})}const{EXCLUDED_PATTERN_SOURCES:_Yt,PATTERN_TYPES:kYt}=St(Vi);function Pye(e,t){return e.innerBlocks=e.innerBlocks.map(n=>Pye(n,t)),e.name==="core/template-part"&&e.attributes.theme===void 0&&(e.attributes.theme=t),e}function SYt(e,t){const n=(s,i,c)=>i===c.findIndex(l=>s.name===l.name),o=s=>!_Yt.includes(s.source),r=s=>s.templateTypes?.includes(t.slug)||s.blockTypes?.includes("core/template-part/"+t.area);return e.filter((s,i,c)=>n(s,i,c)&&o(s)&&r(s))}function CYt(e,t){return e.map(n=>({...n,keywords:n.keywords||[],type:kYt.theme,blocks:Ko(n.content,{__unstableSkipMigrationLogs:!0}).map(o=>Pye(o,t))}))}function qYt(e){const{blockPatterns:t,restBlockPatterns:n,currentThemeStylesheet:o}=G(r=>{var s;const{getEditorSettings:i}=r(_e),c=i();return{blockPatterns:(s=c.__experimentalAdditionalBlockPatterns)!==null&&s!==void 0?s:c.__experimentalBlockPatterns,restBlockPatterns:r(Me).getBlockPatterns(),currentThemeStylesheet:r(Me).getCurrentTheme().stylesheet}},[]);return x.useMemo(()=>{const r=[...t||[],...n||[]],s=SYt(r,e);return CYt(s,e)},[t,n,e,o])}function RYt({availableTemplates:e,onSelect:t}){return!e||e?.length===0?null:a.jsx(qa,{label:m("Templates"),blockPatterns:e,onClickPattern:t,showTitlesAsTooltip:!0})}function TYt(){const{record:e,postType:t,postId:n}=G(i=>{const{getCurrentPostType:c,getCurrentPostId:l}=i(_e),{getEditedEntityRecord:u}=i(Me),d=c(),p=l();return{postType:d,postId:p,record:u("postType",d,p)}},[]),{editEntityRecord:o}=Oe(Me),r=qYt(e),s=async i=>{await o("postType",t,n,{blocks:i.blocks,content:Ks(i.blocks)})};return r?.length?a.jsx(Qt,{title:m("Design"),initialOpen:e.type===Di,children:a.jsx(RYt,{availableTemplates:r,onSelect:s})}):null}function EYt(){const{postType:e}=G(t=>{const{getCurrentPostType:n}=t(_e);return{postType:n()}},[]);return[Di,L0].includes(e)?a.jsx(TYt,{}):null}const ac={document:"edit-post/document",block:"edit-post/block"},{Tabs:qT}=St(tr),WYt=(e,t)=>{const{documentLabel:n}=G(o=>{const{getPostTypeLabel:r}=o(_e);return{documentLabel:r()||We("Document","noun, sidebar")}},[]);return a.jsxs(qT.TabList,{ref:t,children:[a.jsx(qT.Tab,{tabId:ac.document,"data-tab-id":ac.document,children:n}),a.jsx(qT.Tab,{tabId:ac.block,"data-tab-id":ac.block,children:m("Block")})]})},NYt=x.forwardRef(WYt),{BlockQuickNavigation:BYt}=St(jn),LYt=["core/post-title","core/post-featured-image","core/post-content"],PYt="core/template-part";function jYt(){const e=x.useMemo(()=>gr("editor.postContentBlockTypes",LYt),[]),{clientIds:t,postType:n,renderingMode:o}=G(s=>{const{getCurrentPostType:i,getPostBlocksByName:c,getRenderingMode:l}=St(s(_e)),u=i();return{postType:u,clientIds:c(L0===u?PYt:e),renderingMode:l()}},[e]),{enableComplementaryArea:r}=Oe(xo);return o==="post-only"&&n!==L0||t.length===0?null:a.jsx(Qt,{title:m("Content"),children:a.jsx(BYt,{clientIds:t,onSelect:()=>{r("core","edit-post/document")}})})}const{BlockQuickNavigation:IYt}=St(jn);function DYt(){const e=G(o=>{const{getBlockTypes:r}=o(kt);return r()},[]),t=x.useMemo(()=>e.filter(o=>o.category==="theme").map(({name:o})=>o),[e]),n=G(o=>{const{getBlocksByName:r}=o(J);return r(t)},[t]);return n.length===0?null:a.jsx(Qt,{title:m("Content"),children:a.jsx(IYt,{clientIds:n})})}function FYt(){return G(t=>{const{getCurrentPostType:n}=t(_e);return n()},[])!==Di?null:a.jsx(DYt,{})}function $Yt(){const{hasBlockSelection:e}=G(r=>({hasBlockSelection:!!r(J).getBlockSelectionStart()}),[]),{getActiveComplementaryArea:t}=G(xo),{enableComplementaryArea:n}=Oe(xo),{get:o}=G(ht);x.useEffect(()=>{const r=t("core"),s=["edit-post/document","edit-post/block"].includes(r),i=o("core","distractionFree");!s||i||(e?n("core","edit-post/block"):n("core","edit-post/document"))},[e,t,n,o])}const{Tabs:l2}=St(tr),VYt=f0.select({web:!0,native:!1}),HYt=({tabName:e,keyboardShortcut:t,onActionPerformed:n,extraPanels:o})=>{const r=x.useRef(null),s=x.useContext(l2.Context);return x.useEffect(()=>{const i=Array.from(r.current?.querySelectorAll('[role="tab"]')||[]),c=i.find(d=>d.getAttribute("data-tab-id")===e),l=c?.ownerDocument.activeElement;i.some(d=>l&&l.id===d.id)&&c&&c.id!==l?.id&&c?.focus()},[e]),a.jsx(rN,{identifier:e,header:a.jsx(l2.Context.Provider,{value:s,children:a.jsx(NYt,{ref:r})}),closeLabel:m("Close Settings"),className:"editor-sidebar__panel",headerClassName:"editor-sidebar__panel-tabs",title:We("Settings","sidebar button label"),toggleShortcut:t,icon:jt()?ede:tde,isActiveByDefault:VYt,children:a.jsxs(l2.Context.Provider,{value:s,children:[a.jsxs(l2.TabPanel,{tabId:ac.document,focusable:!1,children:[a.jsx(wYt,{onActionPerformed:n}),a.jsx(eye.Slot,{}),a.jsx(jYt,{}),a.jsx(FYt,{}),a.jsx(EYt,{}),a.jsx(OGt,{}),a.jsx(nYt,{}),o]}),a.jsx(l2.TabPanel,{tabId:ac.block,focusable:!1,children:a.jsx(m3e,{})})]})})},UYt=({extraPanels:e,onActionPerformed:t})=>{$Yt();const{tabName:n,keyboardShortcut:o,showSummary:r}=G(c=>{const l=c(Pi).getShortcutRepresentation("core/editor/toggle-sidebar"),u=c(xo).getActiveComplementaryArea("core"),d=[ac.block,ac.document].includes(u);let p=u;return d||(p=c(J).getBlockSelectionStart()?ac.block:ac.document),{tabName:p,keyboardShortcut:l,showSummary:![L0,Di,Wf].includes(c(_e).getCurrentPostType())}},[]),{enableComplementaryArea:s}=Oe(xo),i=x.useCallback(c=>{c&&s("core",c)},[s]);return a.jsx(l2,{selectedTabId:n,onSelect:i,selectOnMove:!1,children:a.jsx(HYt,{tabName:n,keyboardShortcut:o,showSummary:r,onActionPerformed:t,extraPanels:e})})};function XYt({postType:e,postId:t,templateId:n,settings:o,children:r,initialEdits:s,onActionPerformed:i,extraContent:c,extraSidebarPanels:l,...u}){const{post:d,template:p,hasLoadedPost:f}=G(b=>{const{getEntityRecord:h,hasFinishedResolution:g}=b(Me);return{post:h("postType",e,t),template:n?h("postType",L0,n):void 0,hasLoadedPost:g("getEntityRecord",["postType",e,t])}},[e,t,n]);return a.jsxs(a.Fragment,{children:[f&&!d&&a.jsx(A1,{status:"warning",isDismissible:!1,children:m("You attempted to edit an item that doesn't exist. Perhaps it was deleted?")}),!!d&&a.jsxs(DOe,{post:d,__unstableTemplate:p,settings:o,initialEdits:s,useSubRegistry:!1,children:[a.jsx(eYt,{...u,children:c}),r,a.jsx(UYt,{onActionPerformed:i,extraPanels:l})]})]})}const{PreferenceBaseOption:GYt}=St(cp);function KYt(e){const t=G(r=>r(_e).isPublishSidebarEnabled(),[]),{enablePublishSidebar:n,disablePublishSidebar:o}=Oe(_e);return a.jsx(GYt,{isChecked:t,onChange:r=>r?n():o(),...e})}const{BlockManager:YYt}=St(jn);function ZYt(){const{showBlockTypes:e,hideBlockTypes:t}=St(Oe(_e)),{blockTypes:n,allowedBlockTypes:o,hiddenBlockTypes:r}=G(d=>{var p;return{blockTypes:d(kt).getBlockTypes(),allowedBlockTypes:d(_e).getEditorSettings().allowedBlockTypes,hiddenBlockTypes:(p=d(ht).get("core","hiddenBlockTypes"))!==null&&p!==void 0?p:[]}},[]),i=x.useMemo(()=>o===!0?n:n.filter(({name:d})=>o?.includes(d)),[o,n]).filter(d=>Tt(d,"inserter",!0)&&(!d.parent||d.parent.includes("core/post-content"))),c=r.filter(d=>i.some(p=>p.name===d)),l=i.filter(d=>!c.includes(d.name)),u=d=>{if(l.length>d.length){const p=l.filter(f=>!d.find(({name:b})=>b===f.name));t(p.map(({name:f})=>f))}else if(l.length!l.find(({name:b})=>b===f.name));e(p.map(({name:f})=>f))}};return a.jsx(YYt,{blockTypes:i,selectedBlockTypes:l,onChange:u})}const{PreferencesModal:QYt,PreferencesModalTabs:JYt,PreferencesModalSection:nl,PreferenceToggleControl:ui}=St(cp);function eZt({extraSections:e={}}){const t=G(o=>o(xo).isModalActive("editor/preferences"),[]),{closeModal:n}=Oe(xo);return t?a.jsx(QYt,{closeModal:n,children:a.jsx(tZt,{extraSections:e})}):null}function tZt({extraSections:e={}}){const t=Yn("medium"),n=G(c=>{const{getEditorSettings:l}=c(_e),{get:u}=c(ht),d=l().richEditingEnabled;return!u("core","distractionFree")&&t&&d},[t]),{setIsListViewOpened:o,setIsInserterOpened:r}=Oe(_e),{set:s}=Oe(ht),i=x.useMemo(()=>[{name:"general",tabLabel:m("General"),content:a.jsxs(a.Fragment,{children:[a.jsxs(nl,{title:m("Interface"),children:[a.jsx(ui,{scope:"core",featureName:"showListViewByDefault",help:m("Opens the List View sidebar by default."),label:m("Always open List View")}),n&&a.jsx(ui,{scope:"core",featureName:"showBlockBreadcrumbs",help:m("Display the block hierarchy trail at the bottom of the editor."),label:m("Show block breadcrumbs")}),a.jsx(ui,{scope:"core",featureName:"allowRightClickOverrides",help:m("Allows contextual List View menus via right-click, overriding browser defaults."),label:m("Allow right-click contextual menus")}),a.jsx(ui,{scope:"core",featureName:"enableChoosePatternModal",help:m("Shows starter patterns when creating a new page."),label:m("Show starter patterns")})]}),a.jsxs(nl,{title:m("Document settings"),description:m("Select what settings are shown in the document panel."),children:[a.jsx(II.Slot,{}),a.jsx(Aye,{taxonomyWrapper:(c,l)=>a.jsx(c2,{label:l.labels.menu_name,panelName:`taxonomy-panel-${l.slug}`})}),a.jsx(e5,{children:a.jsx(c2,{label:m("Featured image"),panelName:"featured-image"})}),a.jsx(sye,{children:a.jsx(c2,{label:m("Excerpt"),panelName:"post-excerpt"})}),a.jsx(Sc,{supportKeys:["comments","trackbacks"],children:a.jsx(c2,{label:m("Discussion"),panelName:"discussion-panel"})}),a.jsx(XOe,{children:a.jsx(c2,{label:m("Page attributes"),panelName:"page-attributes"})})]}),t&&a.jsx(nl,{title:m("Publishing"),children:a.jsx(KYt,{help:m("Review settings, such as visibility and tags."),label:m("Enable pre-publish checks")})}),e?.general]})},{name:"appearance",tabLabel:m("Appearance"),content:a.jsxs(nl,{title:m("Appearance"),description:m("Customize the editor interface to suit your needs."),children:[a.jsx(ui,{scope:"core",featureName:"fixedToolbar",onToggle:()=>s("core","distractionFree",!1),help:m("Access all block and document tools in a single place."),label:m("Top toolbar")}),a.jsx(ui,{scope:"core",featureName:"distractionFree",onToggle:()=>{s("core","fixedToolbar",!0),r(!1),o(!1)},help:m("Reduce visual distractions by hiding the toolbar and other elements to focus on writing."),label:m("Distraction free")}),a.jsx(ui,{scope:"core",featureName:"focusMode",help:m("Highlights the current block and fades other content."),label:m("Spotlight mode")}),e?.appearance]})},{name:"accessibility",tabLabel:m("Accessibility"),content:a.jsxs(a.Fragment,{children:[a.jsx(nl,{title:m("Navigation"),description:m("Optimize the editing experience for enhanced control."),children:a.jsx(ui,{scope:"core",featureName:"keepCaretInsideBlock",help:m("Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block."),label:m("Contain text cursor inside block")})}),a.jsx(nl,{title:m("Interface"),children:a.jsx(ui,{scope:"core",featureName:"showIconLabels",label:m("Show button text labels"),help:m("Show text instead of icons on buttons across the interface.")})})]})},{name:"blocks",tabLabel:m("Blocks"),content:a.jsxs(a.Fragment,{children:[a.jsx(nl,{title:m("Inserter"),children:a.jsx(ui,{scope:"core",featureName:"mostUsedBlocks",help:m("Adds a category with the most frequently used blocks in the inserter."),label:m("Show most used blocks")})}),a.jsx(nl,{title:m("Manage block visibility"),description:m("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later."),children:a.jsx(ZYt,{})})]})},window.__experimentalMediaProcessing&&{name:"media",tabLabel:m("Media"),content:a.jsx(a.Fragment,{children:a.jsxs(nl,{title:m("General"),description:m("Customize options related to the media upload flow."),children:[a.jsx(ui,{scope:"core/media",featureName:"optimizeOnUpload",help:m("Compress media items before uploading to the server."),label:m("Pre-upload compression")}),a.jsx(ui,{scope:"core/media",featureName:"requireApproval",help:m("Require approval step when optimizing existing media."),label:m("Approval step")})]})})}].filter(Boolean),[n,e,r,o,s,t]);return a.jsx(JYt,{sections:i})}function nZt({postType:e}){const{registerPostTypeSchema:t}=St(Oe(_e));x.useEffect(()=>{t(e)},[t,e]);const{defaultFields:n}=G(i=>{const{getEntityFields:c}=St(i(_e));return{defaultFields:c("postType",e)}},[e]),{records:o,isResolving:r}=Al("root","user",{per_page:-1}),s=x.useMemo(()=>n.map(i=>i.id==="author"?{...i,elements:o?.map(({id:c,name:l})=>({value:c,label:l}))}:i),[o,n]);return{isLoading:r,fields:s}}const qne="content",oZt={name:"core/pattern-overrides",getValues({select:e,clientId:t,context:n,bindings:o}){const r=n["pattern/overrides"],{getBlockAttributes:s}=e(J),i=s(t),c={};for(const l of Object.keys(o)){const u=r?.[i?.metadata?.name]?.[l];if(u===void 0){c[l]=i[l];continue}else c[l]=u===""?void 0:u}return c},setValues({select:e,dispatch:t,clientId:n,bindings:o}){const{getBlockAttributes:r,getBlockParentsByBlockName:s,getBlocks:i}=e(J),l=r(n)?.metadata?.name;if(!l)return;const[u]=s(n,"core/block",!0),d=Object.entries(o).reduce((f,[b,{newValue:h}])=>(f[b]=h,f),{});if(!u){const f=b=>{for(const h of b)h.attributes?.metadata?.name===l&&t(J).updateBlockAttributes(h.clientId,d),f(h.innerBlocks)};f(i());return}const p=r(u)?.[qne];t(J).updateBlockAttributes(u,{[qne]:{...p,[l]:{...p?.[l],...Object.entries(d).reduce((f,[b,h])=>(f[b]=h===void 0?"":h,f),{})}}})},canUserEditValue:()=>!0};function RT(e,t){const{getEditedEntityRecord:n}=e(Me),{getRegisteredPostMeta:o}=St(e(Me));let r;t?.postType&&t?.postId&&(r=n("postType",t?.postType,t?.postId).meta);const s=o(t?.postType),i={};return Object.entries(s||{}).forEach(([c,l])=>{if(c!=="footnotes"&&c.charAt(0)!=="_"){var u;i[c]={label:l.title||c,value:(u=r?.[c])!==null&&u!==void 0?u:l.default||void 0,type:l.type}}}),Object.keys(i||{}).length?i:null}const rZt={name:"core/post-meta",getValues({select:e,context:t,bindings:n}){const o=RT(e,t),r={};for(const[i,c]of Object.entries(n)){var s;const l=c.args.key,{value:u,label:d}=o?.[l]||{};r[i]=(s=u??d)!==null&&s!==void 0?s:l}return r},setValues({dispatch:e,context:t,bindings:n}){const o={};Object.values(n).forEach(({args:r,newValue:s})=>{o[r.key]=s}),e(Me).editEntityRecord("postType",t?.postType,t?.postId,{meta:o})},canUserEditValue({select:e,context:t,args:n}){return!(t?.query||t?.queryId||!t?.postType||RT(e,t)?.[n.key]?.value===void 0||e(_e).getEditorSettings().enableCustomFields||!e(Me).canUser("update",{kind:"postType",name:t?.postType,id:t?.postId}))},getFieldsList({select:e,context:t}){return RT(e,t)}};function sZt(){QU(oZt),QU(rZt)}const{store:iZt,...aZt}=_Vt,cu={};pjt(cu,{CreateTemplatePartModal:LI,BackButton:XI,EntitiesSavedStatesExtensible:Jx,Editor:XYt,EditorContentSlotFill:Wye,GlobalStylesProvider:v$t,mergeBaseAndUserConfigs:ROe,PluginPostExcerpt:$I,PostCardPanel:Lye,PreferencesModal:eZt,usePostActions:Bye,usePostFields:nZt,ToolsMoreMenuGroup:YI,ViewMoreMenuGroup:ZI,ResizableEditor:Nye,registerCoreBlockBindingsSources:sZt,getTemplateInfo:LO,interfaceStore:iZt,...aZt});const cZt=":root{--wp-admin-theme-color: #007cba;--wp-admin-theme-color--rgb: 0, 124, 186;--wp-admin-theme-color-darker-10: #006ba1;--wp-admin-theme-color-darker-10--rgb: 0, 107, 161;--wp-admin-theme-color-darker-20: #005a87;--wp-admin-theme-color-darker-20--rgb: 0, 90, 135;--wp-admin-border-width-focus: 2px;--wp-block-synced-color: #7a00df;--wp-block-synced-color--rgb: 122, 0, 223;--wp-bound-block-color: var(--wp-block-synced-color)}@media (min-resolution: 192dpi){:root{--wp-admin-border-width-focus: 1.5px}}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:18px;line-height:1.5;--wp--style--block-gap: 2em}p{line-height:1.8}.editor-post-title__block{margin-top:2em;margin-bottom:1em;font-size:2.5em;font-weight:800}";function it(e){if(!e)return;const{metadata:t,settings:n,name:o}=e;return dLe({name:o,...t},n)}function jye(e,t,n){return G(o=>o(Me).canUser("update",{kind:e,name:t,id:n}),[e,t,n])}function ck(e={}){const t=x.useRef(e),n=x.useRef(!1),{getSettings:o}=G(J);x.useLayoutEffect(()=>{t.current=e}),x.useEffect(()=>{if(n.current||!t.current.url||!Wr(t.current.url))return;const r=Xie(t.current.url);if(!r)return;const{url:s,allowedTypes:i,onChange:c,onError:l}=t.current,{mediaUpload:u}=o();n.current=!0,u({filesList:[r],allowedTypes:i,onFileChange:([d])=>{Wr(d?.url)||(J4(s),c(d),n.current=!1)},onError:d=>{J4(s),l(d),n.current=!1}})},[o])}function Qo(){return Yn("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}}}function lZt({attributes:e,setAttributes:t}){const{showLabel:n,showPostCounts:o,displayAsDropdown:r,type:s}=e,i=Qo();return a.jsxs(a.Fragment,{children:[a.jsx(et,{children:a.jsxs(En,{label:m("Settings"),resetAll:()=>{t({displayAsDropdown:!1,showLabel:!1,showPostCounts:!1,type:"monthly"})},dropdownMenuProps:i,children:[a.jsx(tt,{label:m("Display as dropdown"),isShownByDefault:!0,hasValue:()=>r,onDeselect:()=>t({displayAsDropdown:!1}),children:a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Display as dropdown"),checked:r,onChange:()=>t({displayAsDropdown:!r})})}),r&&a.jsx(tt,{label:m("Show label"),isShownByDefault:!0,hasValue:()=>n,onDeselect:()=>t({showLabel:!1}),children:a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Show label"),checked:n,onChange:()=>t({showLabel:!n})})}),a.jsx(tt,{label:m("Show post counts"),isShownByDefault:!0,hasValue:()=>o,onDeselect:()=>t({showPostCounts:!1}),children:a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Show post counts"),checked:o,onChange:()=>t({showPostCounts:!o})})}),a.jsx(tt,{label:m("Group by"),isShownByDefault:!0,hasValue:()=>!!s,onDeselect:()=>t({type:"monthly"}),children:a.jsx(Pn,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:m("Group by"),options:[{label:m("Year"),value:"yearly"},{label:m("Month"),value:"monthly"},{label:m("Week"),value:"weekly"},{label:m("Day"),value:"daily"}],value:s,onChange:c=>t({type:c})})})]})}),a.jsx("div",{...Be(),children:a.jsx(I1,{children:a.jsx(FO,{block:"core/archives",skipBlockSupportAttributes:!0,attributes:e})})})]})}const QI={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/archives",title:"Archives",category:"widgets",description:"Display a date archive of your posts.",textdomain:"default",attributes:{displayAsDropdown:{type:"boolean",default:!1},showLabel:{type:"boolean",default:!0},showPostCounts:{type:"boolean",default:!1},type:{type:"string",default:"monthly"}},supports:{align:!0,__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0},html:!1,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-archives-editor"},{name:Iye}=QI,Dye={icon:gZe,example:{},edit:lZt},uZt=()=>it({name:Iye,metadata:QI,settings:Dye}),dZt=Object.freeze(Object.defineProperty({__proto__:null,init:uZt,metadata:QI,name:Iye,settings:Dye},Symbol.toStringTag,{value:"Module"}));function Fye(e){const t=e?e[0]:24,n=e?e[e.length-1]:96,o=Math.floor(n*2.5);return{minSize:t,maxSize:o}}function $ye(){const{avatarURL:e}=G(t=>{const{getSettings:n}=t(J),{__experimentalDiscussionSettings:o}=n();return o});return e}function pZt({commentId:e}){const[t]=Ao("root","comment","author_avatar_urls",e),[n]=Ao("root","comment","author_name",e),o=t?Object.values(t):null,r=t?Object.keys(t):null,{minSize:s,maxSize:i}=Fye(r),c=$ye();return{src:o?o[o.length-1]:c,minSize:s,maxSize:i,alt:n?xe(m("%s Avatar"),n):m("Default Avatar")}}function fZt({userId:e,postId:t,postType:n}){const{authorDetails:o}=G(u=>{const{getEditedEntityRecord:d,getUser:p}=u(Me);if(e)return{authorDetails:p(e)};const f=d("postType",n,t)?.author;return{authorDetails:f?p(f):null}},[n,t,e]),r=o?.avatar_urls?Object.values(o.avatar_urls):null,s=o?.avatar_urls?Object.keys(o.avatar_urls):null,{minSize:i,maxSize:c}=Fye(s),l=$ye();return{src:r?r[r.length-1]:l,minSize:i,maxSize:c,alt:o?xe(m("%s Avatar"),o?.name):m("Default Avatar")}}const bZt={who:"authors",per_page:-1,_fields:"id,name",context:"view"};function hZt({value:e,onChange:t}){const[n,o]=x.useState(),r=G(i=>{const{getUsers:c}=i(Me);return c(bZt)},[]);if(!r)return null;const s=r.map(i=>({label:i.name,value:i.id}));return a.jsx(nb,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:m("User"),help:m("Select the avatar user to display, if it is blank it will use the post/page author."),value:e,onChange:t,options:n||s,onFilterValueChange:i=>o(s.filter(c=>c.label.toLowerCase().startsWith(i.toLowerCase())))})}const Vye=({setAttributes:e,avatar:t,attributes:n,selectUser:o})=>a.jsx(et,{children:a.jsxs(Qt,{title:m("Settings"),children:[a.jsx(bo,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:m("Image size"),onChange:r=>e({size:r}),min:t.minSize,max:t.maxSize,initialPosition:n?.size,value:n?.size}),a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Link to user profile"),onChange:()=>e({isLink:!n.isLink}),checked:n.isLink}),n.isLink&&a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Open in new tab"),onChange:r=>e({linkTarget:r?"_blank":"_self"}),checked:n.linkTarget==="_blank"}),o&&a.jsx(hZt,{value:n?.userId,onChange:r=>{e({userId:r})}})]})}),n5=({setAttributes:e,attributes:t,avatar:n,blockProps:o,isSelected:r})=>{const s=au(t),i=tn(R4(n?.src,["s"]),{s:t?.size*2});return a.jsx("div",{...o,children:a.jsx(Ca,{size:{width:t.size,height:t.size},showHandle:r,onResizeStop:(c,l,u,d)=>{e({size:parseInt(t.size+(d.height||d.width),10)})},lockAspectRatio:!0,enable:{top:!1,right:!jt(),bottom:!0,left:jt()},minWidth:n.minSize,maxWidth:n.maxSize,children:a.jsx("img",{src:i,alt:n.alt,className:oe("avatar","avatar-"+t.size,"photo","wp-block-avatar__image",s.className),style:s.style})})})},mZt=({attributes:e,context:t,setAttributes:n,isSelected:o})=>{const{commentId:r}=t,s=Be(),i=pZt({commentId:r});return a.jsxs(a.Fragment,{children:[a.jsx(Vye,{avatar:i,setAttributes:n,attributes:e,selectUser:!1}),e.isLink?a.jsx("a",{href:"#avatar-pseudo-link",className:"wp-block-avatar__link",onClick:c=>c.preventDefault(),children:a.jsx(n5,{attributes:e,avatar:i,blockProps:s,isSelected:o,setAttributes:n})}):a.jsx(n5,{attributes:e,avatar:i,blockProps:s,isSelected:o,setAttributes:n})]})},gZt=({attributes:e,context:t,setAttributes:n,isSelected:o})=>{const{postId:r,postType:s}=t,i=fZt({userId:e?.userId,postId:r,postType:s}),c=Be();return a.jsxs(a.Fragment,{children:[a.jsx(Vye,{selectUser:!0,attributes:e,avatar:i,setAttributes:n}),e.isLink?a.jsx("a",{href:"#avatar-pseudo-link",className:"wp-block-avatar__link",onClick:l=>l.preventDefault(),children:a.jsx(n5,{attributes:e,avatar:i,blockProps:c,isSelected:o,setAttributes:n})}):a.jsx(n5,{attributes:e,avatar:i,blockProps:c,isSelected:o,setAttributes:n})]})};function MZt(e){return e?.context?.commentId||e?.context?.commentId===null?a.jsx(mZt,{...e}):a.jsx(gZt,{...e})}const JI={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/avatar",title:"Avatar",category:"theme",description:"Add a user’s avatar.",textdomain:"default",attributes:{userId:{type:"number"},size:{type:"number",default:96},isLink:{type:"boolean",default:!1},linkTarget:{type:"string",default:"_self"}},usesContext:["postType","postId","commentId"],supports:{html:!1,align:!0,alignWide:!1,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},__experimentalBorder:{__experimentalSkipSerialization:!0,radius:!0,width:!0,color:!0,style:!0,__experimentalDefaultControls:{radius:!0}},color:{text:!1,background:!1,__experimentalDuotone:"img"},interactivity:{clientNavigation:!0}},selectors:{border:".wp-block-avatar img"},editorStyle:"wp-block-avatar-editor",style:"wp-block-avatar"},{name:Hye}=JI,Uye={icon:TP,edit:MZt,example:{}},zZt=()=>it({name:Hye,metadata:JI,settings:Uye}),OZt=Object.freeze(Object.defineProperty({__proto__:null,init:zZt,metadata:JI,name:Hye,settings:Uye},Symbol.toStringTag,{value:"Module"})),yZt=[{attributes:{src:{type:"string",source:"attribute",selector:"audio",attribute:"src"},caption:{type:"string",source:"html",selector:"figcaption"},id:{type:"number"},autoplay:{type:"boolean",source:"attribute",selector:"audio",attribute:"autoplay"},loop:{type:"boolean",source:"attribute",selector:"audio",attribute:"loop"},preload:{type:"string",source:"attribute",selector:"audio",attribute:"preload"}},supports:{align:!0},save({attributes:e}){const{autoplay:t,caption:n,loop:o,preload:r,src:s}=e;return a.jsxs("figure",{children:[a.jsx("audio",{controls:"controls",src:s,autoPlay:t,loop:o,preload:r}),!Ie.isEmpty(n)&&a.jsx(Ie.Content,{tagName:"figcaption",value:n})]})}}],o5=[{ratio:"2.33",className:"wp-embed-aspect-21-9"},{ratio:"2.00",className:"wp-embed-aspect-18-9"},{ratio:"1.78",className:"wp-embed-aspect-16-9"},{ratio:"1.33",className:"wp-embed-aspect-4-3"},{ratio:"1.00",className:"wp-embed-aspect-1-1"},{ratio:"0.56",className:"wp-embed-aspect-9-16"},{ratio:"0.50",className:"wp-embed-aspect-1-2"}],Xye="wp-embed",{lock:AZt,unlock:e0}=P0("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/block-library"),vZt={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/embed",title:"Embed",category:"embed",description:"Add a block that displays content pulled from other sites, like Twitter or YouTube.",textdomain:"default",attributes:{url:{type:"string",role:"content"},caption:{type:"rich-text",source:"rich-text",selector:"figcaption",role:"content"},type:{type:"string",role:"content"},providerNameSlug:{type:"string",role:"content"},allowResponsive:{type:"boolean",default:!0},responsive:{type:"boolean",default:!1,role:"content"},previewable:{type:"boolean",default:!0,role:"content"}},supports:{align:!0,spacing:{margin:!0},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-embed-editor",style:"wp-block-embed"},{name:x2}=vZt,{kebabCase:xZt}=e0(tr),wZt=e=>G5(x2)?.find(({name:t})=>t===e),_Zt=(e,t=[])=>t.some(n=>e.match(n)),kZt=e=>G5(x2)?.find(({patterns:t})=>_Zt(e,t)),Gye=e=>e&&e.includes('class="wp-embedded-content"'),SZt=e=>{const t=e.url||e.thumbnail_url,n=a.jsx("p",{children:a.jsx("img",{src:t,alt:e.title,width:"100%"})});return M1(n)},lk=(e,t={})=>{const{preview:n,attributes:o={}}=e,{url:r,providerNameSlug:s,type:i,...c}=o;if(!r||!on(x2))return;const l=kZt(r),u=s==="wordpress"||i===Xye;if(!u&&l&&(l.attributes.providerNameSlug!==s||!s))return Ee(x2,{url:r,...c,...l.attributes});const p=G5(x2)?.find(({name:f})=>f==="wordpress");if(!(!p||!n||!Gye(n.html)||u))return Ee(x2,{url:r,...p.attributes,...t})},CZt=e=>e?o5.some(({className:t})=>e.includes(t)):!1,z4=e=>{if(!e)return e;const t=o5.reduce((o,{className:r})=>(o.push(r),o),["wp-has-aspect-ratio"]);let n=e;for(const o of t)n=n.replace(o,"");return n.trim()};function Kye(e,t,n=!0){if(!n)return z4(t);const o=document.implementation.createHTMLDocument("");o.body.innerHTML=e;const r=o.body.querySelector("iframe");if(r&&r.height&&r.width){const s=(r.width/r.height).toFixed(2);for(let i=0;i=c.ratio)return s-c.ratio>.1?z4(t):oe(z4(t),c.className,"wp-has-aspect-ratio")}}return t}function qZt(e,t){t(Ee("core/paragraph",{content:M1(a.jsx("a",{href:e,children:e}))}))}const RZt=Hs((e,t,n,o,r=!0)=>{if(!e)return{};const s={};let{type:i="rich"}=e;const{html:c,provider_name:l}=e,u=xZt((l||t).toLowerCase());return Gye(c)&&(i=Xye),(c||i==="photo")&&(s.type=i,s.providerNameSlug=u),CZt(n)||(s.className=Kye(c,n,o&&r)),s}),TZt=(e,t,n,o)=>{const{allowResponsive:r,className:s}=e;return{...e,...RZt(t,n,s,o,r)}};function fb({attributeKey:e="caption",attributes:t,setAttributes:n,isSelected:o,insertBlocksAfter:r,placeholder:s=m("Add caption"),label:i=m("Caption text"),showToolbarButton:c=!0,excludeElementClassName:l,className:u,readOnly:d,tagName:p="figcaption",addLabel:f=m("Add caption"),removeLabel:b=m("Remove caption"),icon:h=yZe,...g}){const z=t[e],A=Fr(z),{PrivateRichText:_}=e0(jn),v=_.isEmpty(z),M=_.isEmpty(A),[y,k]=x.useState(!v);x.useEffect(()=>{!v&&M&&k(!0)},[v,M]),x.useEffect(()=>{!o&&v&&k(!1)},[o,v]);const S=x.useCallback(C=>{C&&v&&C.focus()},[v]);return a.jsxs(a.Fragment,{children:[c&&a.jsx(bt,{group:"block",children:a.jsx(Vt,{onClick:()=>{k(!y),y&&z&&n({[e]:void 0})},icon:h,isPressed:y,label:y?b:f})}),y&&(!_.isEmpty(z)||o)&&a.jsx(_,{identifier:e,tagName:p,className:oe(u,l?"":z0("caption")),ref:S,"aria-label":i,placeholder:s,value:z,onChange:C=>n({[e]:C}),inlineToolbar:!0,__unstableOnSplitAtEnd:()=>r(Ee(Mr())),readOnly:d,...g})]})}const TT=["audio"];function EZt({attributes:e,className:t,setAttributes:n,onReplace:o,isSelected:r,insertBlocksAfter:s}){const{id:i,autoplay:c,loop:l,preload:u,src:d}=e,[p,f]=x.useState(e.blob);ck({url:p,allowedTypes:TT,onChange:_,onError:z});function b(y){return k=>{n({[y]:k})}}function h(y){if(y!==d){const k=lk({attributes:{url:y}});if(k!==void 0&&o){o(k);return}n({src:y,id:void 0,blob:void 0}),f()}}const{createErrorNotice:g}=Oe(mt);function z(y){g(y,{type:"snackbar"})}function A(y){return y?m("Autoplay may cause usability issues for some users."):null}function _(y){if(!y||!y.url){n({src:void 0,id:void 0,caption:void 0,blob:void 0}),f();return}if(Wr(y.url)){f(y.url);return}n({blob:void 0,src:y.url,id:y.id,caption:y.caption}),f()}const v=oe(t,{"is-transient":!!p}),M=Be({className:v});return!d&&!p?a.jsx("div",{...M,children:a.jsx(iu,{icon:a.jsx(Zn,{icon:Uue}),onSelect:_,onSelectURL:h,accept:"audio/*",allowedTypes:TT,value:e,onError:z})}):a.jsxs(a.Fragment,{children:[r&&a.jsx(bt,{group:"other",children:a.jsx(Pc,{mediaId:i,mediaURL:d,allowedTypes:TT,accept:"audio/*",onSelect:_,onSelectURL:h,onError:z,onReset:()=>_(void 0)})}),a.jsx(et,{children:a.jsxs(Qt,{title:m("Settings"),children:[a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Autoplay"),onChange:b("autoplay"),checked:c,help:A}),a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Loop"),onChange:b("loop"),checked:l}),a.jsx(Pn,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:We("Preload","noun; Audio block parameter"),value:u||"",onChange:y=>n({preload:y||void 0}),options:[{value:"",label:m("Browser default")},{value:"auto",label:m("Auto")},{value:"metadata",label:m("Metadata")},{value:"none",label:We("None","Preload value")}]})]})}),a.jsxs("figure",{...M,children:[a.jsx(I1,{isDisabled:!r,children:a.jsx("audio",{controls:"controls",src:d??p})}),!!p&&a.jsx(Xn,{}),a.jsx(fb,{attributes:e,setAttributes:n,isSelected:r,insertBlocksAfter:s,label:m("Audio caption text"),showToolbarButton:r})]})]})}function WZt({attributes:e}){const{autoplay:t,caption:n,loop:o,preload:r,src:s}=e;return s&&a.jsxs("figure",{...Be.save(),children:[a.jsx("audio",{controls:"controls",src:s,autoPlay:t,loop:o,preload:r}),!Ie.isEmpty(n)&&a.jsx(Ie.Content,{tagName:"figcaption",value:n,className:z0("caption")})]})}const NZt={from:[{type:"files",isMatch(e){return e.length===1&&e[0].type.indexOf("audio/")===0},transform(e){const t=e[0];return Ee("core/audio",{blob:ls(t)})}},{type:"shortcode",tag:"audio",attributes:{src:{type:"string",shortcode:({named:{src:e,mp3:t,m4a:n,ogg:o,wav:r,wma:s}})=>e||t||n||o||r||s},loop:{type:"string",shortcode:({named:{loop:e}})=>e},autoplay:{type:"string",shortcode:({named:{autoplay:e}})=>e},preload:{type:"string",shortcode:({named:{preload:e}})=>e}}}]},e9={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/audio",title:"Audio",category:"media",description:"Embed a simple audio player.",keywords:["music","sound","podcast","recording"],textdomain:"default",attributes:{blob:{type:"string",role:"local"},src:{type:"string",source:"attribute",selector:"audio",attribute:"src",role:"content"},caption:{type:"rich-text",source:"rich-text",selector:"figcaption",role:"content"},id:{type:"number",role:"content"},autoplay:{type:"boolean",source:"attribute",selector:"audio",attribute:"autoplay"},loop:{type:"boolean",source:"attribute",selector:"audio",attribute:"loop"},preload:{type:"string",source:"attribute",selector:"audio",attribute:"preload"}},supports:{anchor:!0,align:!0,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-audio-editor",style:"wp-block-audio"},{name:Yye}=e9,Zye={icon:Uue,example:{attributes:{src:"https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg"},viewportWidth:350},transforms:NZt,deprecated:yZt,edit:EZt,save:WZt},BZt=()=>it({name:Yye,metadata:e9,settings:Zye}),LZt=Object.freeze(Object.defineProperty({__proto__:null,init:BZt,metadata:e9,name:Yye,settings:Zye},Symbol.toStringTag,{value:"Module"})),{cleanEmptyObject:PZt}=e0(jn);function v1(e){if(!e?.style?.typography?.fontFamily)return e;const{fontFamily:t,...n}=e.style.typography;return{...e,style:PZt({...e.style,typography:n}),fontFamily:t.split("|").pop()}}const Qb=e=>{const{borderRadius:t,...n}=e,o=[t,n.style?.border?.radius].find(r=>typeof r=="number"&&r!==0);return o?{...n,style:{...n.style,border:{...n.style?.border,radius:`${o}px`}}}:n};function jZt(e){if(!e.align)return e;const{align:t,...n}=e;return{...n,className:oe(n.className,`align${e.align}`)}}const aN=e=>{if(!e.customTextColor&&!e.customBackgroundColor&&!e.customGradient)return e;const t={color:{}};e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor),e.customGradient&&(t.color.gradient=e.customGradient);const{customTextColor:n,customBackgroundColor:o,customGradient:r,...s}=e;return{...s,style:t}},ET=e=>{const{color:t,textColor:n,...o}={...e,customTextColor:e.textColor&&e.textColor[0]==="#"?e.textColor:void 0,customBackgroundColor:e.color&&e.color[0]==="#"?e.color:void 0};return aN(o)},ol={url:{type:"string",source:"attribute",selector:"a",attribute:"href"},title:{type:"string",source:"attribute",selector:"a",attribute:"title"},text:{type:"string",source:"html",selector:"a"}},IZt={attributes:{tagName:{type:"string",enum:["a","button"],default:"a"},type:{type:"string",default:"button"},textAlign:{type:"string"},url:{type:"string",source:"attribute",selector:"a",attribute:"href"},title:{type:"string",source:"attribute",selector:"a,button",attribute:"title",role:"content"},text:{type:"rich-text",source:"rich-text",selector:"a,button",role:"content"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target",role:"content"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel",role:"content"},placeholder:{type:"string"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},width:{type:"number"}},supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0,gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},reusable:!1,shadow:{__experimentalSkipSerialization:!0},spacing:{__experimentalSkipSerialization:!0,padding:["horizontal","vertical"],__experimentalDefaultControls:{padding:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},__experimentalSelector:".wp-block-button__link",interactivity:{clientNavigation:!0}},save({attributes:e,className:t}){const{tagName:n,type:o,textAlign:r,fontSize:s,linkTarget:i,rel:c,style:l,text:u,title:d,url:p,width:f}=e,b=n||"a",h=b==="button",g=o||"button",z=X1(e),A=P1(e),_=Tm(e),v=db(e),M=oe("wp-block-button__link",A.className,z.className,{[`has-text-align-${r}`]:r,"no-border-radius":l?.border?.radius===0},z0("button")),y={...z.style,...A.style,..._.style,...v.style},k=oe(t,{[`has-custom-width wp-block-button__width-${f}`]:f,"has-custom-font-size":s||l?.typography?.fontSize});return a.jsx("div",{...Be.save({className:k}),children:a.jsx(Ie.Content,{tagName:b,type:h?g:null,className:M,href:h?null:p,title:d,style:y,value:u,target:h?null:i,rel:h?null:c})})}},DZt={attributes:{url:{type:"string",source:"attribute",selector:"a",attribute:"href"},title:{type:"string",source:"attribute",selector:"a",attribute:"title"},text:{type:"string",source:"html",selector:"a"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},width:{type:"number"}},supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0,gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{fontSize:!0,__experimentalFontFamily:!0,__experimentalDefaultControls:{fontSize:!0}},reusable:!1,spacing:{__experimentalSkipSerialization:!0,padding:["horizontal","vertical"],__experimentalDefaultControls:{padding:!0}},__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{radius:!0}},__experimentalSelector:".wp-block-button__link"},save({attributes:e,className:t}){const{fontSize:n,linkTarget:o,rel:r,style:s,text:i,title:c,url:l,width:u}=e;if(!i)return null;const d=X1(e),p=P1(e),f=Tm(e),b=oe("wp-block-button__link",p.className,d.className,{"no-border-radius":s?.border?.radius===0}),h={...d.style,...p.style,...f.style},g=oe(t,{[`has-custom-width wp-block-button__width-${u}`]:u,"has-custom-font-size":n||s?.typography?.fontSize});return a.jsx("div",{...Be.save({className:g}),children:a.jsx(Ie.Content,{tagName:"a",className:b,href:l,title:c,style:h,value:i,target:o,rel:r})})}},FZt={attributes:{url:{type:"string",source:"attribute",selector:"a",attribute:"href"},title:{type:"string",source:"attribute",selector:"a",attribute:"title"},text:{type:"string",source:"html",selector:"a"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},width:{type:"number"}},supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0,gradients:!0},typography:{fontSize:!0,__experimentalFontFamily:!0},reusable:!1,spacing:{__experimentalSkipSerialization:!0,padding:["horizontal","vertical"],__experimentalDefaultControls:{padding:!0}},__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0},__experimentalSelector:".wp-block-button__link"},save({attributes:e,className:t}){const{fontSize:n,linkTarget:o,rel:r,style:s,text:i,title:c,url:l,width:u}=e;if(!i)return null;const d=X1(e),p=P1(e),f=Tm(e),b=oe("wp-block-button__link",p.className,d.className,{"no-border-radius":s?.border?.radius===0}),h={...d.style,...p.style,...f.style},g=oe(t,{[`has-custom-width wp-block-button__width-${u}`]:u,"has-custom-font-size":n||s?.typography?.fontSize});return a.jsx("div",{...Be.save({className:g}),children:a.jsx(Ie.Content,{tagName:"a",className:b,href:l,title:c,style:h,value:i,target:o,rel:r})})},migrate:v1,isEligible({style:e}){return e?.typography?.fontFamily}},$Zt=[IZt,DZt,FZt,{supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0,gradients:!0},typography:{fontSize:!0,__experimentalFontFamily:!0},reusable:!1,__experimentalSelector:".wp-block-button__link"},attributes:{...ol,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},width:{type:"number"}},isEligible({style:e}){return typeof e?.border?.radius=="number"},save({attributes:e,className:t}){const{fontSize:n,linkTarget:o,rel:r,style:s,text:i,title:c,url:l,width:u}=e;if(!i)return null;const d=s?.border?.radius,p=P1(e),f=oe("wp-block-button__link",p.className,{"no-border-radius":s?.border?.radius===0}),b={borderRadius:d||void 0,...p.style},h=oe(t,{[`has-custom-width wp-block-button__width-${u}`]:u,"has-custom-font-size":n||s?.typography?.fontSize});return a.jsx("div",{...Be.save({className:h}),children:a.jsx(Ie.Content,{tagName:"a",className:f,href:l,title:c,style:b,value:i,target:o,rel:r})})},migrate:Co(v1,Qb)},{supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0},reusable:!1,__experimentalSelector:".wp-block-button__link"},attributes:{...ol,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"},width:{type:"number"}},save({attributes:e,className:t}){const{borderRadius:n,linkTarget:o,rel:r,text:s,title:i,url:c,width:l}=e,u=P1(e),d=oe("wp-block-button__link",u.className,{"no-border-radius":n===0}),p={borderRadius:n?n+"px":void 0,...u.style},f=oe(t,{[`has-custom-width wp-block-button__width-${l}`]:l});return a.jsx("div",{...Be.save({className:f}),children:a.jsx(Ie.Content,{tagName:"a",className:d,href:c,title:i,style:p,value:s,target:o,rel:r})})},migrate:Co(v1,Qb)},{supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0},reusable:!1,__experimentalSelector:".wp-block-button__link"},attributes:{...ol,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"},width:{type:"number"}},save({attributes:e,className:t}){const{borderRadius:n,linkTarget:o,rel:r,text:s,title:i,url:c,width:l}=e,u=P1(e),d=oe("wp-block-button__link",u.className,{"no-border-radius":n===0}),p={borderRadius:n?n+"px":void 0,...u.style},f=oe(t,{[`has-custom-width wp-block-button__width-${l}`]:l});return a.jsx("div",{...Be.save({className:f}),children:a.jsx(Ie.Content,{tagName:"a",className:d,href:c,title:i,style:p,value:s,target:o,rel:r})})},migrate:Co(v1,Qb)},{supports:{align:!0,alignWide:!1,color:{gradients:!0}},attributes:{...ol,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"}},save({attributes:e}){const{borderRadius:t,linkTarget:n,rel:o,text:r,title:s,url:i}=e,c=oe("wp-block-button__link",{"no-border-radius":t===0}),l={borderRadius:t?t+"px":void 0};return a.jsx(Ie.Content,{tagName:"a",className:c,href:i,title:s,style:l,value:r,target:n,rel:o})},migrate:Qb},{supports:{align:!0,alignWide:!1},attributes:{...ol,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},customGradient:{type:"string"},gradient:{type:"string"}},isEligible:e=>!!e.customTextColor||!!e.customBackgroundColor||!!e.customGradient||!!e.align,migrate:Co(Qb,aN,jZt),save({attributes:e}){const{backgroundColor:t,borderRadius:n,customBackgroundColor:o,customTextColor:r,customGradient:s,linkTarget:i,gradient:c,rel:l,text:u,textColor:d,title:p,url:f}=e,b=Pt("color",d),h=!s&&Pt("background-color",t),g=T1(c),z=oe("wp-block-button__link",{"has-text-color":d||r,[b]:b,"has-background":t||o||s||c,[h]:h,"no-border-radius":n===0,[g]:g}),A={background:s||void 0,backgroundColor:h||s||c?void 0:o,color:b?void 0:r,borderRadius:n?n+"px":void 0};return a.jsx("div",{children:a.jsx(Ie.Content,{tagName:"a",className:z,href:f,title:p,style:A,value:u,target:i,rel:l})})}},{attributes:{...ol,align:{type:"string",default:"none"},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"}},isEligible(e){return e.className&&e.className.includes("is-style-squared")},migrate(e){let t=e.className;return t&&(t=t.replace(/is-style-squared[\s]?/,"").trim()),Qb(aN({...e,className:t||void 0,borderRadius:0}))},save({attributes:e}){const{backgroundColor:t,customBackgroundColor:n,customTextColor:o,linkTarget:r,rel:s,text:i,textColor:c,title:l,url:u}=e,d=Pt("color",c),p=Pt("background-color",t),f=oe("wp-block-button__link",{"has-text-color":c||o,[d]:d,"has-background":t||n,[p]:p}),b={backgroundColor:p?void 0:n,color:d?void 0:o};return a.jsx("div",{children:a.jsx(Ie.Content,{tagName:"a",className:f,href:u,title:l,style:b,value:i,target:r,rel:s})})}},{attributes:{...ol,align:{type:"string",default:"none"},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"}},migrate:ET,save({attributes:e}){const{url:t,text:n,title:o,backgroundColor:r,textColor:s,customBackgroundColor:i,customTextColor:c}=e,l=Pt("color",s),u=Pt("background-color",r),d=oe("wp-block-button__link",{"has-text-color":s||c,[l]:l,"has-background":r||i,[u]:u}),p={backgroundColor:u?void 0:i,color:l?void 0:c};return a.jsx("div",{children:a.jsx(Ie.Content,{tagName:"a",className:d,href:t,title:o,style:p,value:n})})}},{attributes:{...ol,color:{type:"string"},textColor:{type:"string"},align:{type:"string",default:"none"}},save({attributes:e}){const{url:t,text:n,title:o,align:r,color:s,textColor:i}=e,c={backgroundColor:s,color:i};return a.jsx("div",{className:`align${r}`,children:a.jsx(Ie.Content,{tagName:"a",className:"wp-block-button__link",href:t,title:o,style:c,value:n})})},migrate:ET},{attributes:{...ol,color:{type:"string"},textColor:{type:"string"},align:{type:"string",default:"none"}},save({attributes:e}){const{url:t,text:n,title:o,align:r,color:s,textColor:i}=e;return a.jsx("div",{className:`align${r}`,style:{backgroundColor:s},children:a.jsx(Ie.Content,{tagName:"a",href:t,title:o,style:{color:i},value:n})})},migrate:ET}],WT="noreferrer noopener",Qye="_blank",O4="nofollow";function VZt({rel:e="",url:t="",opensInNewTab:n,nofollow:o}){let r,s=e;if(n)r=Qye,s=s?.includes(WT)?s:s+` ${WT}`;else{const i=new RegExp(`\\b${WT}\\s*`,"g");s=s?.replace(i,"").trim()}if(o)s=s?.includes(O4)?s:(s+` ${O4}`).trim();else{const i=new RegExp(`\\b${O4}\\s*`,"g");s=s?.replace(i,"").trim()}return{url:Df(t),linkTarget:r,rel:s||void 0}}function cN(e){return e.toString().replace(/<\/?a[^>]*>/g,"")}const HZt=[...kc.DEFAULT_LINK_SETTINGS,{id:"nofollow",title:m("Mark as nofollow")}];function UZt(e){const{replaceBlocks:t,selectionChange:n}=Oe(J),{getBlock:o,getBlockRootClientId:r,getBlockIndex:s}=G(J),i=x.useRef(e);return i.current=e,Mn(c=>{function l(u){if(u.defaultPrevented||u.keyCode!==Gr)return;const{content:d,clientId:p}=i.current;if(d.length)return;u.preventDefault();const f=o(r(p)),b=s(p),h=jo({...f,innerBlocks:f.innerBlocks.slice(0,b)}),g=Ee(Mr()),z=f.innerBlocks.slice(b+1),A=z.length?[jo({...f,innerBlocks:z})]:[];t(f.clientId,[h,g,...A],1),n(g.clientId)}return c.addEventListener("keydown",l),()=>{c.removeEventListener("keydown",l)}},[])}function XZt({selectedWidth:e,setAttributes:t}){const n=Qo();return a.jsx(En,{label:m("Settings"),resetAll:()=>t({width:void 0}),dropdownMenuProps:n,children:a.jsx(tt,{label:m("Width"),isShownByDefault:!0,hasValue:()=>!!e,onDeselect:()=>t({width:void 0}),__nextHasNoMarginBottom:!0,children:a.jsx(Do,{label:m("Width"),value:e,onChange:o=>t({width:o}),isBlock:!0,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,children:[25,50,75,100].map(o=>a.jsx(Kn,{value:o,label:xe(m("%d%%"),o)},o))})})})}function GZt(e){const{attributes:t,setAttributes:n,className:o,isSelected:r,onReplace:s,mergeBlocks:i,clientId:c,context:l}=e,{tagName:u,textAlign:d,linkTarget:p,placeholder:f,rel:b,style:h,text:g,url:z,width:A,metadata:_}=t,v=u||"a";function M(ye){lc.primary(ye,"k")?V(ye):lc.primaryShift(ye,"k")&&(Q(),B.current?.focus())}const[y,k]=x.useState(null),S=au(t),C=BO(t),R=Tm(t),T=db(t),E=x.useRef(),B=x.useRef(),N=Be({ref:xn([k,E]),onKeyDown:M}),j=Jr(),[I,P]=x.useState(!1),$=!!z,F=p===Qye,X=!!b?.includes(O4),Z=v==="a";function V(ye){ye.preventDefault(),P(!0)}function Q(){n({url:void 0,linkTarget:void 0,rel:void 0}),P(!1)}x.useEffect(()=>{r||P(!1)},[r]);const te=x.useMemo(()=>({url:z,opensInNewTab:F,nofollow:X}),[z,F,X]),ee=UZt({content:g,clientId:c}),ue=xn([ee,B]),{lockUrlControls:ce=!1}=G(ye=>{if(!r)return{};const Ne=vl(_?.bindings?.url?.source);return{lockUrlControls:!!_?.bindings?.url&&!Ne?.canUserEditValue?.({select:ye,context:l,args:_?.bindings?.url?.args})}},[l,r,_?.bindings?.url]),[me,de]=Un("typography.fluid","layout"),Ae=wI(t,{typography:{fluid:me},layout:{wideSize:de?.wideSize}});return a.jsxs(a.Fragment,{children:[a.jsx("div",{...N,className:oe(N.className,{[`has-custom-width wp-block-button__width-${A}`]:A}),children:a.jsx(Ie,{ref:ue,"aria-label":m("Button text"),placeholder:f||m("Add text…"),value:g,onChange:ye=>n({text:cN(ye)}),withoutInteractiveFormatting:!0,className:oe(o,"wp-block-button__link",C.className,S.className,Ae.className,{[`has-text-align-${d}`]:d,"no-border-radius":h?.border?.radius===0,"has-custom-font-size":N.style.fontSize},z0("button")),style:{...S.style,...C.style,...R.style,...T.style,...Ae.style,writingMode:void 0},onReplace:s,onMerge:i,identifier:"text"})}),a.jsxs(bt,{group:"block",children:[j==="default"&&a.jsx(nr,{value:d,onChange:ye=>{n({textAlign:ye})}}),!$&&Z&&!ce&&a.jsx(Vt,{name:"link",icon:xa,title:m("Link"),shortcut:j1.primary("k"),onClick:V}),$&&Z&&!ce&&a.jsx(Vt,{name:"link",icon:Pl,title:m("Unlink"),shortcut:j1.primaryShift("k"),onClick:Q,isActive:!0})]}),Z&&r&&(I||$)&&!ce&&a.jsx(Io,{placement:"bottom",onClose:()=>{P(!1),B.current?.focus()},anchor:y,focusOnMount:I?"firstElement":!1,__unstableSlotName:"__unstable-block-tools-after",shift:!0,children:a.jsx(kc,{value:te,onChange:({url:ye,opensInNewTab:Ne,nofollow:je})=>n(VZt({rel:b,url:ye,opensInNewTab:Ne,nofollow:je})),onRemove:()=>{Q(),B.current?.focus()},forceIsEditingLink:I,settings:HZt})}),a.jsx(et,{children:a.jsx(XZt,{selectedWidth:A,setAttributes:n})}),a.jsx(et,{group:"advanced",children:Z&&a.jsx(dn,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:m("Link rel"),value:b||"",onChange:ye=>n({rel:ye})})})]})}function KZt({attributes:e,className:t}){const{tagName:n,type:o,textAlign:r,fontSize:s,linkTarget:i,rel:c,style:l,text:u,title:d,url:p,width:f}=e,b=n||"a",h=b==="button",g=o||"button",z=X1(e),A=P1(e),_=Tm(e),v=db(e),M=wI(e),y=oe("wp-block-button__link",A.className,z.className,M.className,{[`has-text-align-${r}`]:r,"no-border-radius":l?.border?.radius===0,"has-custom-font-size":s||l?.typography?.fontSize},z0("button")),k={...z.style,...A.style,..._.style,...v.style,...M.style,writingMode:void 0},S=oe(t,{[`has-custom-width wp-block-button__width-${f}`]:f});return a.jsx("div",{...Be.save({className:S}),children:a.jsx(Ie.Content,{tagName:b,type:h?g:null,className:y,href:h?null:p,title:d,style:k,value:u,target:h?null:i,rel:h?null:c})})}const t9={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/button",title:"Button",category:"design",parent:["core/buttons"],description:"Prompt visitors to take action with a button-style link.",keywords:["link"],textdomain:"default",attributes:{tagName:{type:"string",enum:["a","button"],default:"a"},type:{type:"string",default:"button"},textAlign:{type:"string"},url:{type:"string",source:"attribute",selector:"a",attribute:"href",role:"content"},title:{type:"string",source:"attribute",selector:"a,button",attribute:"title",role:"content"},text:{type:"rich-text",source:"rich-text",selector:"a,button",role:"content"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target",role:"content"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel",role:"content"},placeholder:{type:"string"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},width:{type:"number"}},supports:{anchor:!0,splitting:!0,align:!1,alignWide:!1,color:{__experimentalSkipSerialization:!0,gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{__experimentalSkipSerialization:["fontSize","lineHeight","fontFamily","fontWeight","fontStyle","textTransform","textDecoration","letterSpacing"],fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},reusable:!1,shadow:{__experimentalSkipSerialization:!0},spacing:{__experimentalSkipSerialization:!0,padding:["horizontal","vertical"],__experimentalDefaultControls:{padding:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},interactivity:{clientNavigation:!0}},styles:[{name:"fill",label:"Fill",isDefault:!0},{name:"outline",label:"Outline"}],editorStyle:"wp-block-button-editor",style:"wp-block-button",selectors:{root:".wp-block-button .wp-block-button__link",typography:{writingMode:".wp-block-button"}}},{name:Jye}=t9,eAe={icon:Kue,example:{attributes:{className:"is-style-fill",text:m("Call to action")}},edit:GZt,save:KZt,deprecated:$Zt,merge:(e,{text:t=""})=>({...e,text:(e.text||"")+t})},YZt=()=>it({name:Jye,metadata:t9,settings:eAe}),ZZt=Object.freeze(Object.defineProperty({__proto__:null,init:YZt,metadata:t9,name:Jye,settings:eAe},Symbol.toStringTag,{value:"Module"})),Rne=e=>{if(e.layout)return e;const{contentJustification:t,orientation:n,...o}=e;return(t||n)&&Object.assign(o,{layout:{type:"flex",...t&&{justifyContent:t},...n&&{orientation:n}}}),o},QZt=[{attributes:{contentJustification:{type:"string"},orientation:{type:"string",default:"horizontal"}},supports:{anchor:!0,align:["wide","full"],__experimentalExposeControlsToChildren:!0,spacing:{blockGap:!0,margin:["top","bottom"],__experimentalDefaultControls:{blockGap:!0}}},isEligible:({contentJustification:e,orientation:t})=>!!e||!!t,migrate:Rne,save({attributes:{contentJustification:e,orientation:t}}){return a.jsx("div",{...Be.save({className:oe({[`is-content-justification-${e}`]:e,"is-vertical":t==="vertical"})}),children:a.jsx(Ht.Content,{})})}},{supports:{align:["center","left","right"],anchor:!0},save(){return a.jsx("div",{children:a.jsx(Ht.Content,{})})},isEligible({align:e}){return e&&["center","left","right"].includes(e)},migrate(e){return Rne({...e,align:void 0,contentJustification:e.align})}}];function U2(e,t,n){if(!e)return;const{supports:o}=on(t),r=["core/paragraph","core/heading","core/image","core/button"],s=[];if(r.includes(t)&&n&&s.push("id","bindings"),o.renaming!==!1&&s.push("name"),!s.length)return;const i=Object.entries(e).reduce((c,[l,u])=>(s.includes(l)&&(c[l]=l==="bindings"?n(u):u),c),{});return Object.keys(i).length?i:void 0}const JZt={from:[{type:"block",isMultiBlock:!0,blocks:["core/button"],transform:e=>Ee("core/buttons",{},e.map(t=>Ee("core/button",t)))},{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>Ee("core/buttons",{},e.map(t=>{const{content:n,metadata:o}=t,r=dl(document,n),s=r.innerText||"",c=r.querySelector("a")?.getAttribute("href");return Ee("core/button",{text:s,url:c,metadata:U2(o,"core/button",({content:l})=>({text:l}))})})),isMatch:e=>e.every(t=>{const n=dl(document,t.content),o=n.innerText||"",r=n.querySelectorAll("a");return o.length<=30&&r.length<=1})}]},eQt={name:"core/button",attributesToCopy:["backgroundColor","border","className","fontFamily","fontSize","gradient","style","textColor","width"]};function tQt({attributes:e,className:t}){var n;const{fontSize:o,layout:r,style:s}=e,i=Be({className:oe(t,{"has-custom-font-size":o||s?.typography?.fontSize})}),{hasButtonVariations:c}=G(u=>({hasButtonVariations:u(kt).getBlockVariations("core/button","inserter").length>0}),[]),l=Nt(i,{defaultBlock:eQt,directInsert:!c,template:[["core/button"]],templateInsertUpdatesSelection:!0,orientation:(n=r?.orientation)!==null&&n!==void 0?n:"horizontal"});return a.jsx("div",{...l})}function nQt({attributes:e,className:t}){const{fontSize:n,style:o}=e,r=Be.save({className:oe(t,{"has-custom-font-size":n||o?.typography?.fontSize})}),s=Nt.save(r);return a.jsx("div",{...s})}const n9={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/buttons",title:"Buttons",category:"design",allowedBlocks:["core/button"],description:"Prompt visitors to take action with a group of button-style links.",keywords:["link"],textdomain:"default",supports:{anchor:!0,align:["wide","full"],html:!1,__experimentalExposeControlsToChildren:!0,color:{gradients:!0,text:!1,__experimentalDefaultControls:{background:!0}},spacing:{blockGap:["horizontal","vertical"],padding:!0,margin:["top","bottom"],__experimentalDefaultControls:{blockGap:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},layout:{allowSwitching:!1,allowInheriting:!1,default:{type:"flex"}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-buttons-editor",style:"wp-block-buttons"},{name:tAe}=n9,nAe={icon:OZe,example:{attributes:{layout:{type:"flex",justifyContent:"center"}},innerBlocks:[{name:"core/button",attributes:{text:m("Find out more")}},{name:"core/button",attributes:{text:m("Contact us")}}]},deprecated:QZt,transforms:JZt,edit:tQt,save:nQt},oQt=()=>it({name:tAe,metadata:n9,settings:nAe}),rQt=Object.freeze(Object.defineProperty({__proto__:null,init:oQt,metadata:n9,name:tAe,settings:nAe},Symbol.toStringTag,{value:"Module"})),sQt=Hs(e=>{if(!e)return{};const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()+1}});function iQt({attributes:e}){const t=Be(),{date:n,hasPosts:o,hasPostsResolved:r}=G(s=>{const{getEntityRecords:i,hasFinishedResolution:c}=s(Me),l={status:"publish",per_page:1},u=i("postType","post",l),d=c("getEntityRecords",["postType","post",l]);let p;const f=s("core/editor");return f&&f.getEditedPostAttribute("type")==="post"&&(p=f.getEditedPostAttribute("date")),{date:p,hasPostsResolved:d,hasPosts:d&&u?.length===1}},[]);return o?a.jsx("div",{...t,children:a.jsx(I1,{children:a.jsx(FO,{block:"core/calendar",attributes:{...e,...sQt(n)}})})}):a.jsx("div",{...t,children:a.jsx(vo,{icon:Yue,label:m("Calendar"),children:r?m("No published posts found."):a.jsx(Xn,{})})})}const aQt={from:[{type:"block",blocks:["core/archives"],transform:()=>Ee("core/calendar")}],to:[{type:"block",blocks:["core/archives"],transform:()=>Ee("core/archives")}]},o9={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/calendar",title:"Calendar",category:"widgets",description:"A calendar of your site’s posts.",keywords:["posts","archive"],textdomain:"default",attributes:{month:{type:"integer"},year:{type:"integer"}},supports:{align:!0,color:{link:!0,__experimentalSkipSerialization:["text","background"],__experimentalDefaultControls:{background:!0,text:!0},__experimentalSelector:"table, th"},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},style:"wp-block-calendar"},{name:oAe}=o9,rAe={icon:Yue,example:{},edit:iQt,transforms:aQt},cQt=()=>it({name:oAe,metadata:o9,settings:rAe}),lQt=Object.freeze(Object.defineProperty({__proto__:null,init:cQt,metadata:o9,name:oAe,settings:rAe},Symbol.toStringTag,{value:"Module"}));function sAe({attributes:{displayAsDropdown:e,showHierarchy:t,showPostCounts:n,showOnlyTopLevel:o,showEmpty:r,label:s,showLabel:i,taxonomy:c},setAttributes:l,className:u}){const d=vt(sAe,"blocks-category-select"),{records:p,isResolvingTaxonomies:f}=Al("root","taxonomy"),b=p?.filter(N=>N.visibility.public),h=b?.find(N=>N.slug===c),g=!f&&h?.hierarchical,z={per_page:-1,hide_empty:!r,context:"view"};g&&o&&(z.parent=0);const{records:A,isResolving:_}=Al("taxonomy",c,z),v=N=>A?.length?N===null?A:A.filter(({parent:j})=>j===N):[],M=N=>j=>l({[N]:j}),y=N=>N?Lt(N).trim():m("(Untitled)"),k=()=>v(g&&t?0:null).map(I=>S(I)),S=N=>{const j=v(N.id),{id:I,link:P,count:$,name:F}=N;return a.jsxs("li",{className:`cat-item cat-item-${I}`,children:[a.jsx("a",{href:P,target:"_blank",rel:"noreferrer noopener",children:y(F)}),n&&` (${$})`,g&&t&&!!j.length&&a.jsx("ul",{className:"children",children:j.map(X=>S(X))})]},I)},C=()=>{const j=v(g&&t?0:null);return a.jsxs(a.Fragment,{children:[i?a.jsx(Ie,{className:"wp-block-categories__label","aria-label":m("Label text"),placeholder:h.name,withoutInteractiveFormatting:!0,value:s,onChange:I=>l({label:I})}):a.jsx(qn,{as:"label",htmlFor:d,children:s||h.name}),a.jsxs("select",{id:d,children:[a.jsx("option",{children:xe(m("Select %s"),h.labels.singular_name)}),j.map(I=>R(I,0))]})]})},R=(N,j)=>{const{id:I,count:P,name:$}=N,F=v(I);return[a.jsxs("option",{className:`level-${j}`,children:[Array.from({length:j*3}).map(()=>" "),y($),n&&` (${P})`]},I),g&&t&&!!F.length&&F.map(X=>R(X,j+1))]},T=A?.length&&!e&&!_?"ul":"div",E=oe(u,{"wp-block-categories-list":!!A?.length&&!e&&!_,"wp-block-categories-dropdown":!!A?.length&&e&&!_}),B=Be({className:E});return a.jsxs(T,{...B,children:[a.jsx(et,{children:a.jsxs(Qt,{title:m("Settings"),children:[Array.isArray(b)&&a.jsx(Pn,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:m("Taxonomy"),options:b.map(N=>({label:N.name,value:N.slug})),value:c,onChange:N=>l({taxonomy:N})}),a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Display as dropdown"),checked:e,onChange:M("displayAsDropdown")}),e&&a.jsx(lt,{__nextHasNoMarginBottom:!0,className:"wp-block-categories__indentation",label:m("Show label"),checked:i,onChange:M("showLabel")}),a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Show post counts"),checked:n,onChange:M("showPostCounts")}),g&&a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Show only top level terms"),checked:o,onChange:M("showOnlyTopLevel")}),a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Show empty terms"),checked:r,onChange:M("showEmpty")}),g&&!o&&a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Show hierarchy"),checked:t,onChange:M("showHierarchy")})]})}),_&&a.jsx(vo,{icon:yde,label:m("Terms"),children:a.jsx(Xn,{})}),!_&&A?.length===0&&a.jsx("p",{children:h.labels.no_terms}),!_&&A?.length>0&&(e?C():k())]})}const uQt=[{name:"terms",title:m("Terms List"),icon:gz,attributes:{taxonomy:"post_tag"},isActive:e=>e.taxonomy!=="category"},{name:"categories",title:m("Categories List"),description:m("Display a list of all categories."),icon:gz,attributes:{taxonomy:"category"},isActive:["taxonomy"],isDefault:!0}],r9={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/categories",title:"Terms List",category:"widgets",description:"Display a list of all terms of a given taxonomy.",keywords:["categories"],textdomain:"default",attributes:{taxonomy:{type:"string",default:"category"},displayAsDropdown:{type:"boolean",default:!1},showHierarchy:{type:"boolean",default:!1},showPostCounts:{type:"boolean",default:!1},showOnlyTopLevel:{type:"boolean",default:!1},showEmpty:{type:"boolean",default:!1},label:{type:"string",role:"content"},showLabel:{type:"boolean",default:!0}},usesContext:["enhancedPagination"],supports:{align:!0,html:!1,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},editorStyle:"wp-block-categories-editor",style:"wp-block-categories"},{name:iAe}=r9,aAe={icon:gz,example:{},edit:sAe,variations:uQt},dQt=()=>it({name:iAe,metadata:r9,settings:aAe}),pQt=Object.freeze(Object.defineProperty({__proto__:null,init:dQt,metadata:r9,name:iAe,settings:aAe},Symbol.toStringTag,{value:"Module"})),fQt=({clientId:e})=>{const{replaceBlocks:t}=Oe(J),n=G(o=>o(J).getBlock(e),[e]);return a.jsx(Vt,{onClick:()=>t(n.clientId,O3({HTML:Ks(n)})),children:m("Convert to blocks")})};function bQt({onClick:e,isModalFullScreen:t}){return Yn("small","<")?null:a.jsx(Ce,{size:"compact",onClick:e,icon:zz,isPressed:t,label:m(t?"Exit fullscreen":"Enter fullscreen")})}function hQt(e){const t=G(n=>n(J).getSettings().styles);return x.useEffect(()=>{const{baseURL:n,suffix:o,settings:r}=window.wpEditorL10n.tinymce;return window.tinymce.EditorManager.overrideDefaults({base_url:n,suffix:o}),window.wp.oldEditor.initialize(e.id,{tinymce:{...r,setup(s){s.on("init",()=>{const i=s.getDoc();t.forEach(({css:c})=>{const l=i.createElement("style");l.innerHTML=c,i.head.appendChild(l)})})}}}),()=>{window.wp.oldEditor.remove(e.id)}},[]),a.jsx("textarea",{...e})}function mQt(e){const{clientId:t,attributes:{content:n},setAttributes:o,onReplace:r}=e,[s,i]=x.useState(!1),[c,l]=x.useState(!1),u=`editor-${t}`,d=()=>n?i(!1):r([]);return a.jsxs(a.Fragment,{children:[a.jsx(bt,{children:a.jsx(Wn,{children:a.jsx(Vt,{onClick:()=>i(!0),children:m("Edit")})})}),n&&a.jsx(i0,{children:n}),(s||!n)&&a.jsxs(Zo,{title:m("Classic Editor"),onRequestClose:d,shouldCloseOnClickOutside:!1,overlayClassName:"block-editor-freeform-modal",isFullScreen:c,className:"block-editor-freeform-modal__content",headerActions:a.jsx(bQt,{onClick:()=>l(!c),isModalFullScreen:c}),children:[a.jsx(hQt,{id:u,defaultValue:n}),a.jsxs(Yo,{className:"block-editor-freeform-modal__actions",justify:"flex-end",expanded:!1,children:[a.jsx(Tn,{children:a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:d,children:m("Cancel")})}),a.jsx(Tn,{children:a.jsx(Ce,{__next40pxDefaultSize:!0,variant:"primary",onClick:()=>{o({content:window.wp.oldEditor.getContent(u)}),i(!1)},children:m("Save")})})]})]})]})}const{wp:Tne}=window;function gQt(e){const t=e.getBody();return t.childNodes.length>1?!1:t.childNodes.length===0?!0:t.childNodes[0].childNodes.length>1?!1:/^\n?$/.test(t.innerText||t.textContent)}function MQt(e){const{clientId:t}=e,n=G(i=>i(J).canRemoveBlock(t),[t]),[o,r]=x.useState(!1),s=Mn(i=>{r(i.ownerDocument!==document)},[]);return a.jsxs(a.Fragment,{children:[n&&a.jsx(bt,{children:a.jsx(Wn,{children:a.jsx(fQt,{clientId:t})})}),a.jsx("div",{...Be({ref:s}),children:o?a.jsx(mQt,{...e}):a.jsx(zQt,{...e})})]})}function zQt({clientId:e,attributes:{content:t},setAttributes:n,onReplace:o}){const{getMultiSelectedBlockClientIds:r}=G(J),s=x.useRef(!1);x.useEffect(()=>{if(!s.current)return;const l=window.tinymce.get(`editor-${e}`);if(!l)return;l.getContent()!==t&&l.setContent(t||"")},[e,t]),x.useEffect(()=>{const{baseURL:l,suffix:u}=window.wpEditorL10n.tinymce;s.current=!0,window.tinymce.EditorManager.overrideDefaults({base_url:l,suffix:u});function d(b){let h;t&&b.on("loadContent",()=>b.setContent(t)),b.on("blur",()=>{h=b.selection.getBookmark(2,!0);const z=document.querySelector(".interface-interface-skeleton__content"),A=z.scrollTop;return r()?.length||n({content:b.getContent()}),b.once("focus",()=>{h&&(b.selection.moveToBookmark(h),z.scrollTop!==A&&(z.scrollTop=A))}),!1}),b.on("mousedown touchstart",()=>{h=null});const g=F1(()=>{const z=b.getContent();z!==b._lastChange&&(b._lastChange=z,n({content:z}))},250);b.on("Paste Change input Undo Redo",g),b.on("remove",g.cancel),b.on("keydown",z=>{lc.primary(z,"z")&&z.stopPropagation(),(z.keyCode===Mc||z.keyCode===zl)&&gQt(b)&&(o([]),z.preventDefault(),z.stopImmediatePropagation());const{altKey:A}=z;A&&z.keyCode===sSe&&z.stopPropagation()}),b.on("init",()=>{const z=b.getBody();z.ownerDocument.activeElement===z&&(z.blur(),b.focus())})}function p(){const{settings:b}=window.wpEditorL10n.tinymce;Tne.oldEditor.initialize(`editor-${e}`,{tinymce:{...b,inline:!0,content_css:!1,fixed_toolbar_container:`#toolbar-${e}`,setup:d}})}function f(){document.readyState==="complete"&&p()}return document.readyState==="complete"?p():document.addEventListener("readystatechange",f),()=>{document.removeEventListener("readystatechange",f),Tne.oldEditor.remove(`editor-${e}`),s.current=!1}},[]);function i(){const l=window.tinymce.get(`editor-${e}`);l&&l.focus()}function c(l){l.stopPropagation(),l.nativeEvent.stopImmediatePropagation()}return a.jsxs(a.Fragment,{children:[a.jsx("div",{id:`toolbar-${e}`,className:"block-library-classic__toolbar",onClick:i,"data-placeholder":m("Classic"),onKeyDown:c},"toolbar"),a.jsx("div",{id:`editor-${e}`,className:"wp-block-freeform block-library-rich-text__tinymce"},"editor")]})}function OQt({attributes:e}){const{content:t}=e;return a.jsx(i0,{children:t})}const s9={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/freeform",title:"Classic",category:"text",description:"Use the classic WordPress editor.",textdomain:"default",attributes:{content:{type:"string",source:"raw"}},supports:{className:!1,customClassName:!1,reusable:!1},editorStyle:"wp-block-freeform-editor"},{name:r5}=s9,cAe={icon:vZe,edit:MQt,save:OQt},yQt=()=>it({name:r5,metadata:s9,settings:cAe}),AQt=Object.freeze(Object.defineProperty({__proto__:null,init:yQt,metadata:s9,name:r5,settings:cAe},Symbol.toStringTag,{value:"Module"}));function vQt({attributes:e,setAttributes:t,onRemove:n,insertBlocksAfter:o,mergeBlocks:r}){const s=Be();return a.jsx("pre",{...s,children:a.jsx(Ie,{tagName:"code",identifier:"content",value:e.content,onChange:i=>t({content:i}),onRemove:n,onMerge:r,placeholder:m("Write code…"),"aria-label":m("Code"),preserveWhiteSpace:!0,__unstablePastePlainText:!0,__unstableOnSplitAtDoubleLineEnd:()=>o(Ee(Mr()))})})}function xQt(e){return Ku(wQt,_Qt)(e||"")}function wQt(e){return e.replace(/\[/g,"[")}function _Qt(e){return e.replace(/^(\s*https?:)\/\/([^\s<>"]+\s*)$/m,"$1//$2")}function kQt({attributes:e}){return a.jsx("pre",{...Be.save(),children:a.jsx(Ie.Content,{tagName:"code",value:xQt(typeof e.content=="string"?e.content:e.content.toHTMLString({preserveWhiteSpace:!0}))})})}const SQt={from:[{type:"enter",regExp:/^```$/,transform:()=>Ee("core/code")},{type:"block",blocks:["core/paragraph"],transform:({content:e,metadata:t})=>Ee("core/code",{content:e,metadata:U2(t,"core/code")})},{type:"block",blocks:["core/html"],transform:({content:e,metadata:t})=>Ee("core/code",{content:T0({value:eo({text:e})}),metadata:U2(t,"core/code")})},{type:"raw",isMatch:e=>e.nodeName==="PRE"&&e.children.length===1&&e.firstChild.nodeName==="CODE",schema:{pre:{children:{code:{children:{"#text":{}}}}}}}],to:[{type:"block",blocks:["core/paragraph"],transform:({content:e,metadata:t})=>Ee("core/paragraph",{content:e,metadata:U2(t,"core/paragraph")})}]},i9={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/code",title:"Code",category:"text",description:"Display code snippets that respect your spacing and tabs.",textdomain:"default",attributes:{content:{type:"rich-text",source:"rich-text",selector:"code",__unstablePreserveWhiteSpace:!0}},supports:{align:["wide"],anchor:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},spacing:{margin:["top","bottom"],padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{width:!0,color:!0}},color:{text:!0,background:!0,gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},interactivity:{clientNavigation:!0}},style:"wp-block-code"},{name:lAe}=i9,uAe={icon:qP,example:{attributes:{content:m(`// A “block” is the abstract term used // to describe units of markup that // when composed together, form the // content or layout of a page. registerBlockType( name, settings );`)}},merge(e,t){return{content:e.content+` -`+t.content}},transforms:SQt,edit:vQt,save:kQt},CQt=()=>it({name:lAe,metadata:i9,settings:uAe}),qQt=Object.freeze(Object.defineProperty({__proto__:null,init:CQt,metadata:i9,name:lAe,settings:uAe},Symbol.toStringTag,{value:"Module"})),RQt=[{attributes:{verticalAlignment:{type:"string"},width:{type:"number",min:0,max:100}},isEligible({width:e}){return isFinite(e)},migrate(e){return{...e,width:`${e.width}%`}},save({attributes:e}){const{verticalAlignment:t,width:n}=e,o=oe({[`is-vertically-aligned-${t}`]:t}),r={flexBasis:n+"%"};return a.jsx("div",{className:o,style:r,children:a.jsx(Ht.Content,{})})}}];function TQt({width:e,setAttributes:t}){const[n]=Un("spacing.units"),o=U1({availableUnits:n||["%","px","em","rem","vw"]}),r=Qo();return a.jsx(En,{label:m("Settings"),resetAll:()=>{t({width:void 0})},dropdownMenuProps:r,children:a.jsx(tt,{hasValue:()=>e!==void 0,label:m("Width"),onDeselect:()=>t({width:void 0}),isShownByDefault:!0,children:a.jsx(Ro,{label:m("Width"),__unstableInputWidth:"calc(50% - 8px)",__next40pxDefaultSize:!0,value:e||"",onChange:s=>{s=0>parseFloat(s)?"0":s,t({width:s})},units:o})})})}function EQt({attributes:{verticalAlignment:e,width:t,templateLock:n,allowedBlocks:o},setAttributes:r,clientId:s}){const i=oe("block-core-columns",{[`is-vertically-aligned-${e}`]:e}),{columnsIds:c,hasChildBlocks:l,rootClientId:u}=G(_=>{const{getBlockOrder:v,getBlockRootClientId:M}=_(J),y=M(s);return{hasChildBlocks:v(s).length>0,rootClientId:y,columnsIds:v(y)}},[s]),{updateBlockAttributes:d}=Oe(J),p=_=>{r({verticalAlignment:_}),d(u,{verticalAlignment:null})},f=Number.isFinite(t)?t+"%":t,b=Be({className:i,style:f?{flexBasis:f}:void 0}),h=c.length,g=c.indexOf(s)+1,z=xe(m("%1$s (%2$d of %3$d)"),b["aria-label"],g,h),A=Nt({...b,"aria-label":z},{templateLock:n,allowedBlocks:o,renderAppender:l?void 0:Ht.ButtonBlockAppender});return a.jsxs(a.Fragment,{children:[a.jsx(bt,{children:a.jsx(Dze,{onChange:p,value:e,controls:["top","center","bottom","stretch"]})}),a.jsx(et,{children:a.jsx(TQt,{width:t,setAttributes:r})}),a.jsx("div",{...A})]})}function WQt({attributes:e}){const{verticalAlignment:t,width:n}=e,o=oe({[`is-vertically-aligned-${t}`]:t});let r;if(n&&/\d/.test(n)){let c=Number.isFinite(n)?n+"%":n;!Number.isFinite(n)&&n?.endsWith("%")&&(c=Math.round(Number.parseFloat(n)*1e12)/1e12+"%"),r={flexBasis:c}}const s=Be.save({className:o,style:r}),i=Nt.save(s);return a.jsx("div",{...i})}const a9={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/column",title:"Column",category:"design",parent:["core/columns"],description:"A single column within a columns block.",textdomain:"default",attributes:{verticalAlignment:{type:"string"},width:{type:"string"},allowedBlocks:{type:"array"},templateLock:{type:["string","boolean"],enum:["all","insert","contentOnly",!1]}},supports:{__experimentalOnEnter:!0,anchor:!0,reusable:!1,html:!1,color:{gradients:!0,heading:!0,button:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},shadow:!0,spacing:{blockGap:!0,padding:!0,__experimentalDefaultControls:{padding:!0,blockGap:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},layout:!0,interactivity:{clientNavigation:!0}}},{name:dAe}=a9,pAe={icon:kZe,edit:EQt,save:WQt,deprecated:RQt},NQt=()=>it({name:dAe,metadata:a9,settings:pAe}),BQt=Object.freeze(Object.defineProperty({__proto__:null,init:NQt,metadata:a9,name:dAe,settings:pAe},Symbol.toStringTag,{value:"Module"}));function s5(e){let{doc:t}=s5;t||(t=document.implementation.createHTMLDocument(""),s5.doc=t);let n;t.body.innerHTML=e;for(const o of t.body.firstChild.classList)if(n=o.match(/^layout-column-(\d+)$/))return Number(n[1])-1}const LQt=e=>{if(!e.customTextColor&&!e.customBackgroundColor)return e;const t={color:{}};e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor);const{customTextColor:n,customBackgroundColor:o,...r}=e;return{...r,style:t,isStackedOnMobile:!0}},PQt=[{attributes:{verticalAlignment:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},textColor:{type:"string"}},migrate:LQt,save({attributes:e}){const{verticalAlignment:t,backgroundColor:n,customBackgroundColor:o,textColor:r,customTextColor:s}=e,i=Pt("background-color",n),c=Pt("color",r),l=oe({"has-background":n||o,"has-text-color":r||s,[i]:i,[c]:c,[`are-vertically-aligned-${t}`]:t}),u={backgroundColor:i?void 0:o,color:c?void 0:s};return a.jsx("div",{className:l||void 0,style:u,children:a.jsx(Ht.Content,{})})}},{attributes:{columns:{type:"number",default:2}},isEligible(e,t){return t.some(o=>/layout-column-\d+/.test(o.originalContent))?t.some(o=>s5(o.originalContent)!==void 0):!1},migrate(e,t){const o=t.reduce((i,c)=>{const{originalContent:l}=c;let u=s5(l);return u===void 0&&(u=0),i[u]||(i[u]=[]),i[u].push(c),i},[]).map(i=>Ee("core/column",{},i)),{columns:r,...s}=e;return[{...s,isStackedOnMobile:!0},o]},save({attributes:e}){const{columns:t}=e;return a.jsx("div",{className:`has-${t}-columns`,children:a.jsx(Ht.Content,{})})}},{attributes:{columns:{type:"number",default:2}},migrate(e,t){const{columns:n,...o}=e;return e={...o,isStackedOnMobile:!0},[e,t]},save({attributes:e}){const{verticalAlignment:t,columns:n}=e,o=oe(`has-${n}-columns`,{[`are-vertically-aligned-${t}`]:t});return a.jsx("div",{className:o,children:a.jsx(Ht.Content,{})})}}],c9=e=>{const t=parseFloat(e);return Number.isFinite(t)?parseFloat(t.toFixed(2)):void 0};function fAe(e,t){const{width:n=100/t}=e.attributes;return c9(n)}function jQt(e,t=e.length){return e.reduce((n,o)=>n+fAe(o,t),0)}function IQt(e,t=e.length){return e.reduce((n,o)=>{const r=fAe(o,t);return Object.assign(n,{[o.clientId]:r})},{})}function Ene(e,t,n=e.length){const o=jQt(e,n);return Object.fromEntries(Object.entries(IQt(e,n)).map(([r,s])=>{const i=t*s/o;return[r,c9(i)]}))}function DQt(e){return e.every(t=>{const n=t.attributes.width;return Number.isFinite(n?.endsWith?.("%")?parseFloat(n):n)})}function Wne(e,t){return e.map(n=>({...n,attributes:{...n.attributes,width:`${t[n.clientId]}%`}}))}const FQt={name:"core/column"};function $Qt({clientId:e,setAttributes:t,isStackedOnMobile:n}){const{count:o,canInsertColumnBlock:r,minCount:s}=G(d=>{const{canInsertBlockType:p,canRemoveBlock:f,getBlockOrder:b}=d(J),h=b(e),g=h.reduce((z,A,_)=>(f(A)||z.push(_),z),[]);return{count:h.length,canInsertColumnBlock:p("core/column",e),minCount:Math.max(...g)+1}},[e]),{getBlocks:i}=G(J),{replaceInnerBlocks:c}=Oe(J);function l(d,p){let f=i(e);const b=DQt(f),h=p>d;if(h&&b){const g=c9(100/p),z=p-d,A=Ene(f,100-g*z);f=[...Wne(f,A),...Array.from({length:z}).map(()=>Ee("core/column",{width:`${g}%`}))]}else if(h)f=[...f,...Array.from({length:p-d}).map(()=>Ee("core/column"))];else if(p{l(o,s),t({isStackedOnMobile:!0})},dropdownMenuProps:u,children:[r&&a.jsx(tt,{label:m("Columns"),isShownByDefault:!0,hasValue:()=>o,onDeselect:()=>l(o,s),children:a.jsxs(dt,{spacing:4,children:[a.jsx(bo,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:m("Columns"),value:o,onChange:d=>l(o,Math.max(s,d)),min:Math.max(1,s),max:Math.max(6,o)}),o>6&&a.jsx(A1,{status:"warning",isDismissible:!1,children:m("This column count exceeds the recommended amount and may cause visual breakage.")})]})}),a.jsx(tt,{label:m("Stack on mobile"),isShownByDefault:!0,hasValue:()=>n!==!0,onDeselect:()=>t({isStackedOnMobile:!0}),children:a.jsx(lt,{__nextHasNoMarginBottom:!0,label:m("Stack on mobile"),checked:n,onChange:()=>t({isStackedOnMobile:!n})})})]})}function VQt({attributes:e,setAttributes:t,clientId:n}){const{isStackedOnMobile:o,verticalAlignment:r,templateLock:s}=e,i=Fn(),{getBlockOrder:c}=G(J),{updateBlockAttributes:l}=Oe(J),u=oe({[`are-vertically-aligned-${r}`]:r,"is-not-stacked-on-mobile":!o}),d=Be({className:u}),p=Nt(d,{defaultBlock:FQt,directInsert:!0,orientation:"horizontal",renderAppender:!1,templateLock:s});function f(b){const h=c(n);i.batch(()=>{t({verticalAlignment:b}),l(h,{verticalAlignment:b})})}return a.jsxs(a.Fragment,{children:[a.jsx(bt,{children:a.jsx(Dze,{onChange:f,value:r})}),a.jsx(et,{children:a.jsx($Qt,{clientId:n,setAttributes:t,isStackedOnMobile:o})}),a.jsx("div",{...p})]})}function HQt({clientId:e,name:t,setAttributes:n}){const{blockType:o,defaultVariation:r,variations:s}=G(l=>{const{getBlockVariations:u,getBlockType:d,getDefaultBlockVariation:p}=l(kt);return{blockType:d(t),defaultVariation:p(t,"block"),variations:u(t,"block")}},[t]),{replaceInnerBlocks:i}=Oe(J),c=Be();return a.jsx("div",{...c,children:a.jsx(Pze,{icon:o?.icon?.src,label:o?.title,variations:s,instructions:m("Divide into columns. Select a layout:"),onSelect:(l=r)=>{l.attributes&&n(l.attributes),l.innerBlocks&&i(e,Ad(l.innerBlocks),!0)},allowSkip:!0})})}const UQt=e=>{const{clientId:t}=e,o=G(r=>r(J).getBlocks(t).length>0,[t])?VQt:HQt;return a.jsx(o,{...e})};function XQt({attributes:e}){const{isStackedOnMobile:t,verticalAlignment:n}=e,o=oe({[`are-vertically-aligned-${n}`]:n,"is-not-stacked-on-mobile":!t}),r=Be.save({className:o}),s=Nt.save(r);return a.jsx("div",{...s})}const GQt=[{name:"one-column-full",title:m("100"),description:m("One column"),icon:a.jsx(ge,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:a.jsx(he,{d:"M0 10a2 2 0 0 1 2-2h44a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Z"})}),innerBlocks:[["core/column"]],scope:["block"]},{name:"two-columns-equal",title:m("50 / 50"),description:m("Two columns; equal split"),icon:a.jsx(ge,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:a.jsx(he,{d:"M0 10a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm25 0a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H27a2 2 0 0 1-2-2V10Z"})}),isDefault:!0,innerBlocks:[["core/column"],["core/column"]],scope:["block"]},{name:"two-columns-one-third-two-thirds",title:m("33 / 66"),description:m("Two columns; one-third, two-thirds split"),icon:a.jsx(ge,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:a.jsx(he,{d:"M0 10a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm17 0a2 2 0 0 1 2-2h27a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H19a2 2 0 0 1-2-2V10Z"})}),innerBlocks:[["core/column",{width:"33.33%"}],["core/column",{width:"66.66%"}]],scope:["block"]},{name:"two-columns-two-thirds-one-third",title:m("66 / 33"),description:m("Two columns; two-thirds, one-third split"),icon:a.jsx(ge,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:a.jsx(he,{d:"M0 10a2 2 0 0 1 2-2h27a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm33 0a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H35a2 2 0 0 1-2-2V10Z"})}),innerBlocks:[["core/column",{width:"66.66%"}],["core/column",{width:"33.33%"}]],scope:["block"]},{name:"three-columns-equal",title:m("33 / 33 / 33"),description:m("Three columns; equal split"),icon:a.jsx(ge,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:a.jsx(he,{d:"M0 10a2 2 0 0 1 2-2h10.531c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H2a2 2 0 0 1-2-2V10Zm16.5 0c0-1.105.864-2 1.969-2H29.53c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H18.47c-1.105 0-1.969-.895-1.969-2V10Zm17 0c0-1.105.864-2 1.969-2H46a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H35.469c-1.105 0-1.969-.895-1.969-2V10Z"})}),innerBlocks:[["core/column"],["core/column"],["core/column"]],scope:["block"]},{name:"three-columns-wider-center",title:m("25 / 50 / 25"),description:m("Three columns; wide center column"),icon:a.jsx(ge,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:a.jsx(he,{d:"M0 10a2 2 0 0 1 2-2h7.531c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H2a2 2 0 0 1-2-2V10Zm13.5 0c0-1.105.864-2 1.969-2H32.53c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H15.47c-1.105 0-1.969-.895-1.969-2V10Zm23 0c0-1.105.864-2 1.969-2H46a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2h-7.531c-1.105 0-1.969-.895-1.969-2V10Z"})}),innerBlocks:[["core/column",{width:"25%"}],["core/column",{width:"50%"}],["core/column",{width:"25%"}]],scope:["block"]}],KQt=6,YQt={from:[{type:"block",isMultiBlock:!0,blocks:["*"],__experimentalConvert:e=>{const t=+(100/e.length).toFixed(2),n=e.map(({name:o,attributes:r,innerBlocks:s})=>["core/column",{width:`${t}%`},[[o,{...r},s]]]);return Ee("core/columns",{},Ad(n))},isMatch:({length:e},t)=>t.length===1&&t[0].name==="core/columns"?!1:e&&e<=KQt},{type:"block",blocks:["core/media-text"],priority:1,transform:(e,t)=>{const{align:n,backgroundColor:o,textColor:r,style:s,mediaAlt:i,mediaId:c,mediaPosition:l,mediaSizeSlug:u,mediaType:d,mediaUrl:p,mediaWidth:f,verticalAlignment:b}=e;let h;if(d==="image"||!d){const z={id:c,alt:i,url:p,sizeSlug:u},A={href:e.href,linkClass:e.linkClass,linkDestination:e.linkDestination,linkTarget:e.linkTarget,rel:e.rel};h=["core/image",{...z,...A}]}else h=["core/video",{id:c,src:p}];const g=[["core/column",{width:`${f}%`},[h]],["core/column",{width:`${100-f}%`},t]];return l==="right"&&g.reverse(),Ee("core/columns",{align:n,backgroundColor:o,textColor:r,style:s,verticalAlignment:b},Ad(g))}}],ungroup:(e,t)=>t.flatMap(n=>n.innerBlocks)},l9={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/columns",title:"Columns",category:"design",allowedBlocks:["core/column"],description:"Display content in multiple columns, with blocks added to each column.",textdomain:"default",attributes:{verticalAlignment:{type:"string"},isStackedOnMobile:{type:"boolean",default:!0},templateLock:{type:["string","boolean"],enum:["all","insert","contentOnly",!1]}},supports:{anchor:!0,align:["wide","full"],html:!1,color:{gradients:!0,link:!0,heading:!0,button:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{blockGap:{__experimentalDefault:"2em",sides:["horizontal","vertical"]},margin:["top","bottom"],padding:!0,__experimentalDefaultControls:{padding:!0,blockGap:!0}},layout:{allowSwitching:!1,allowInheriting:!1,allowEditing:!1,default:{type:"flex",flexWrap:"nowrap"}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},shadow:!0},editorStyle:"wp-block-columns-editor",style:"wp-block-columns"},{name:bAe}=l9,hAe={icon:SZe,variations:GQt,example:{viewportWidth:782,innerBlocks:[{name:"core/column",innerBlocks:[{name:"core/paragraph",attributes:{content:m("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.")}},{name:"core/image",attributes:{url:"https://s.w.org/images/core/5.3/Windbuchencom.jpg"}},{name:"core/paragraph",attributes:{content:m("Suspendisse commodo neque lacus, a dictum orci interdum et.")}}]},{name:"core/column",innerBlocks:[{name:"core/paragraph",attributes:{content:m("Etiam et egestas lorem. Vivamus sagittis sit amet dolor quis lobortis. Integer sed fermentum arcu, id vulputate lacus. Etiam fermentum sem eu quam hendrerit.")}},{name:"core/paragraph",attributes:{content:m("Nam risus massa, ullamcorper consectetur eros fermentum, porta aliquet ligula. Sed vel mauris nec enim.")}}]}]},deprecated:PQt,edit:UQt,save:XQt,transforms:YQt},ZQt=()=>it({name:bAe,metadata:l9,settings:hAe}),QQt=Object.freeze(Object.defineProperty({__proto__:null,init:ZQt,metadata:l9,name:bAe,settings:hAe},Symbol.toStringTag,{value:"Module"})),JQt={attributes:{tagName:{type:"string",default:"div"}},apiVersion:3,supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}}},save({attributes:{tagName:e}}){const t=Be.save(),{className:n}=t,r=(n?.split(" ")||[])?.filter(i=>i!=="wp-block-comments"),s={...t,className:r.join(" ")};return a.jsx(e,{...s,children:a.jsx(Ht.Content,{})})}},eJt=[JQt];function tJt({attributes:{tagName:e},setAttributes:t}){const n={section:m("The
element should represent a standalone portion of the document that can't be better represented by another element."),aside:m("The