/*! For license information please see form_editor.js.LICENSE.txt */
(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[747],{43575:(e,t,n)=>{e=n.nmd(e),function(t){"use strict";var n,r="function"==typeof(n=t.atob)?n:"function"==typeof Buffer?function(e){return new Buffer(e,"base64").toString("binary")}:"object"==typeof t.base64js?function(e){var n=t.base64js.b64ToByteArray(e);return Array.prototype.map.call(n,(function(e){return String.fromCharCode(e)})).join("")}:function(){throw new Error("You're probably in an old browser or an iOS webworker. It might help to include beatgammit's base64-js.")};t.atob=r,e&&e.exports&&(e.exports=r)}(window)},48198:function(e,t){var n,r;n=function(e,t){"use strict";var n,r,o="function"==typeof Map?new Map:(n=[],r=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return r[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),r.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),r.splice(t,1))}}),i=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){i=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function s(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!o.has(e)){var t=null,n=null,r=null,s=function(){e.clientWidth!==n&&d()},a=function(t){window.removeEventListener("resize",s,!1),e.removeEventListener("input",d,!1),e.removeEventListener("keyup",d,!1),e.removeEventListener("autosize:destroy",a,!1),e.removeEventListener("autosize:update",d,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),o.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",a,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",d,!1),window.addEventListener("resize",s,!1),e.addEventListener("input",d,!1),e.addEventListener("autosize:update",d,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",o.set(e,{destroy:a,update:d}),"vertical"===(l=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===l.resize&&(e.style.resize="horizontal"),t="content-box"===l.boxSizing?-(parseFloat(l.paddingTop)+parseFloat(l.paddingBottom)):parseFloat(l.borderTopWidth)+parseFloat(l.borderBottomWidth),isNaN(t)&&(t=0),d()}var l;function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(){if(0!==e.scrollHeight){var r=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),o=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,r.forEach((function(e){e.node.scrollTop=e.scrollTop})),o&&(document.documentElement.scrollTop=o)}}function d(){u();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),o="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(o{"use strict";var r={};n.r(r),n.d(r,{__experimentalBatch:()=>hs,__experimentalReceiveCurrentGlobalStylesId:()=>es,__experimentalReceiveThemeBaseGlobalStyles:()=>ts,__experimentalReceiveThemeGlobalStyleVariations:()=>ns,__experimentalSaveSpecifiedEntityEdits:()=>fs,__unstableCreateUndoLevel:()=>us,addEntities:()=>Xi,deleteEntityRecord:()=>ss,editEntityRecord:()=>as,receiveAutosaves:()=>bs,receiveCurrentTheme:()=>Qi,receiveCurrentUser:()=>Ji,receiveDefaultTemplateId:()=>ys,receiveEmbedPreview:()=>is,receiveEntityRecords:()=>Zi,receiveNavigationFallbackId:()=>vs,receiveRevisions:()=>_s,receiveThemeGlobalStyleRevisions:()=>os,receiveThemeSupports:()=>rs,receiveUploadPermissions:()=>ms,receiveUserPermission:()=>gs,receiveUserQuery:()=>Yi,redo:()=>cs,saveEditedEntityRecord:()=>ps,saveEntityRecord:()=>ds,undo:()=>ls});var o={};n.r(o),n.d(o,{__experimentalGetCurrentGlobalStylesId:()=>Ea,__experimentalGetCurrentThemeBaseGlobalStyles:()=>La,__experimentalGetCurrentThemeGlobalStylesVariations:()=>Fa,__experimentalGetDirtyEntityRecords:()=>da,__experimentalGetEntitiesBeingSaved:()=>ha,__experimentalGetEntityRecordNoResolver:()=>ia,__experimentalGetTemplateForLink:()=>Oa,canUser:()=>Ba,canUserEditEntityRecord:()=>Ra,getAuthors:()=>Xs,getAutosave:()=>Da,getAutosaves:()=>Na,getBlockPatternCategories:()=>Ua,getBlockPatterns:()=>za,getCurrentTheme:()=>Aa,getCurrentThemeGlobalStylesRevisions:()=>Ha,getCurrentUser:()=>Zs,getDefaultTemplateId:()=>$a,getEditedEntityRecord:()=>ga,getEmbedPreview:()=>ja,getEntitiesByKind:()=>ea,getEntitiesConfig:()=>ta,getEntity:()=>na,getEntityConfig:()=>ra,getEntityRecord:()=>oa,getEntityRecordEdits:()=>pa,getEntityRecordNonTransientEdits:()=>fa,getEntityRecords:()=>la,getEntityRecordsTotalItems:()=>ca,getEntityRecordsTotalPages:()=>ua,getLastEntityDeleteError:()=>xa,getLastEntitySaveError:()=>_a,getRawEntityRecord:()=>sa,getRedoEdit:()=>ka,getReferenceByDistinctEdits:()=>Pa,getRevision:()=>Ga,getRevisions:()=>Wa,getThemeSupports:()=>Ia,getUndoEdit:()=>wa,getUserPatternCategories:()=>Va,getUserQueryResults:()=>Qs,hasEditsForEntityRecord:()=>ma,hasEntityRecords:()=>aa,hasFetchedAutosaves:()=>Ma,hasRedo:()=>Sa,hasUndo:()=>Ca,isAutosavingEntityRecord:()=>ba,isDeletingEntityRecord:()=>ya,isPreviewEmbedFallback:()=>Ta,isRequestingEmbedPreview:()=>Js,isSavingEntityRecord:()=>va});var i={};n.r(i),n.d(i,{getBlockPatternsForPostType:()=>Ya,getNavigationFallbackId:()=>Ka,getUndoManager:()=>qa});var s={};n.r(s),n.d(s,{__experimentalGetCurrentGlobalStylesId:()=>pl,__experimentalGetCurrentThemeBaseGlobalStyles:()=>fl,__experimentalGetCurrentThemeGlobalStylesVariations:()=>ml,__experimentalGetTemplateForLink:()=>hl,canUser:()=>ll,canUserEditEntityRecord:()=>cl,getAuthors:()=>Qa,getAutosave:()=>dl,getAutosaves:()=>ul,getBlockPatternCategories:()=>vl,getBlockPatterns:()=>bl,getCurrentTheme:()=>il,getCurrentThemeGlobalStylesRevisions:()=>gl,getCurrentUser:()=>el,getDefaultTemplateId:()=>xl,getEditedEntityRecord:()=>rl,getEmbedPreview:()=>al,getEntityRecord:()=>tl,getEntityRecords:()=>ol,getNavigationFallbackId:()=>_l,getRawEntityRecord:()=>nl,getRevision:()=>kl,getRevisions:()=>wl,getThemeSupports:()=>sl,getUserPatternCategories:()=>yl});var a={};n.r(a),n.d(a,{__experimentalHasContentRoleAttribute:()=>vu,getActiveBlockVariation:()=>ru,getBlockStyles:()=>tu,getBlockSupport:()=>hu,getBlockType:()=>eu,getBlockTypes:()=>Qc,getBlockVariations:()=>nu,getCategories:()=>iu,getChildBlockNames:()=>du,getCollections:()=>su,getDefaultBlockName:()=>au,getDefaultBlockVariation:()=>ou,getFreeformFallbackBlockName:()=>lu,getGroupingBlockName:()=>uu,getUnregisteredFallbackBlockName:()=>cu,hasBlockSupport:()=>pu,hasChildBlocks:()=>gu,hasChildBlocksWithInserterSupport:()=>bu,isMatchingSearchTerm:()=>mu});var l={};n.r(l),n.d(l,{getAllBlockBindingsSources:()=>Cu,getBlockBindingsSource:()=>Su,getBootstrappedBlockType:()=>wu,getSupportedStyles:()=>xu,getUnprocessedBlockTypes:()=>ku});var c={};n.r(c),n.d(c,{__experimentalReapplyBlockFilters:()=>Mu,addBlockCollection:()=>qu,addBlockStyles:()=>Ou,addBlockTypes:()=>Nu,addBlockVariations:()=>Fu,reapplyBlockTypeFilters:()=>Du,removeBlockCollection:()=>Ku,removeBlockStyles:()=>Lu,removeBlockTypes:()=>Pu,removeBlockVariations:()=>zu,setCategories:()=>Wu,setDefaultBlockName:()=>Uu,setFreeformFallbackBlockName:()=>Vu,setGroupingBlockName:()=>$u,setUnregisteredFallbackBlockName:()=>Hu,updateCategory:()=>Gu});var u={};n.r(u),n.d(u,{addBootstrappedBlockType:()=>Yu,addUnprocessedBlockType:()=>Ju,registerBlockBindingsSource:()=>Xu});var d={};n.r(d),n.d(d,{getAllPatterns:()=>om,getBlockRemovalRules:()=>Jf,getBlockSettings:()=>Vf,getBlockWithoutAttributes:()=>Wf,getContentLockingParent:()=>dm,getEnabledBlockParents:()=>Kf,getEnabledClientIdsTree:()=>qf,getExpandedBlock:()=>um,getInserterMediaCategories:()=>em,getLastFocus:()=>lm,getLastInsertedBlocksClientIds:()=>$f,getOpenedBlockSettingsMenu:()=>Xf,getPatternBySlug:()=>rm,getRegisteredInserterMediaCategories:()=>Qf,getRemovalPromptData:()=>Yf,getReusableBlocks:()=>am,getStyleOverrides:()=>Zf,getTemporarilyEditingAsBlocks:()=>hm,getTemporarilyEditingFocusModeToRevert:()=>pm,hasAllowedPatterns:()=>tm,isBlockInterfaceHidden:()=>Hf,isBlockSubtreeDisabled:()=>Gf,isDragging:()=>cm,isResolvingPatterns:()=>im});var h={};n.r(h),n.d(h,{__experimentalGetActiveBlockIdByBlockNames:()=>gb,__experimentalGetAllowedBlocks:()=>Kg,__experimentalGetAllowedPatterns:()=>Qg,__experimentalGetBlockListSettingsForBlocks:()=>sb,__experimentalGetDirectInsertBlock:()=>Jg,__experimentalGetGlobalBlocksByName:()=>Im,__experimentalGetLastBlockAttributeChanges:()=>cb,__experimentalGetParsedPattern:()=>Xg,__experimentalGetPatternTransformItems:()=>nb,__experimentalGetPatternsByBlockTypes:()=>tb,__experimentalGetReusableBlockTitle:()=>ab,__unstableGetBlockWithoutInnerBlocks:()=>_m,__unstableGetClientIdWithClientIdsTree:()=>wm,__unstableGetClientIdsTree:()=>km,__unstableGetContentLockingParent:()=>Sb,__unstableGetEditorMode:()=>db,__unstableGetSelectedBlocksWithPartialSelection:()=>cg,__unstableGetTemporarilyEditingAsBlocks:()=>Ab,__unstableGetTemporarilyEditingFocusModeToRevert:()=>Eb,__unstableGetVisibleBlocks:()=>yb,__unstableHasActiveBlockOverlayActive:()=>_b,__unstableIsFullySelected:()=>ig,__unstableIsLastBlockChangeIgnored:()=>lb,__unstableIsSelectionCollapsed:()=>sg,__unstableIsSelectionMergeable:()=>lg,__unstableIsWithinBlockOverlay:()=>xb,__unstableSelectionHasUnmergeableBlock:()=>ag,areInnerBlocksControlled:()=>mb,canEditBlock:()=>Lg,canInsertBlockType:()=>Rg,canInsertBlocks:()=>Ng,canLockBlockType:()=>Fg,canMoveBlock:()=>Pg,canMoveBlocks:()=>Og,canRemoveBlock:()=>Dg,canRemoveBlocks:()=>Mg,didAutomaticChange:()=>pb,getAdjacentBlockClientId:()=>Wm,getAllowedBlocks:()=>qg,getBlock:()=>ym,getBlockAttributes:()=>vm,getBlockCount:()=>Bm,getBlockEditingMode:()=>wb,getBlockHierarchyRootClientId:()=>Hm,getBlockIndex:()=>dg,getBlockInsertionPoint:()=>Ag,getBlockListSettings:()=>rb,getBlockMode:()=>yg,getBlockName:()=>gm,getBlockNamesByClientId:()=>Tm,getBlockOrder:()=>ug,getBlockParents:()=>Um,getBlockParentsByBlockName:()=>Vm,getBlockRootClientId:()=>zm,getBlockSelectionEnd:()=>Mm,getBlockSelectionStart:()=>Dm,getBlockTransformItems:()=>Wg,getBlocks:()=>xm,getBlocksByClientId:()=>jm,getBlocksByName:()=>Em,getClientIdsOfDescendants:()=>Cm,getClientIdsWithDescendants:()=>Sm,getDirectInsertBlock:()=>Yg,getDraggedBlockClientIds:()=>wg,getFirstMultiSelectedBlockClientId:()=>Zm,getGlobalBlockCount:()=>Am,getInserterItems:()=>$g,getLastMultiSelectedBlockClientId:()=>Qm,getLowestCommonAncestorWithSelectedBlock:()=>$m,getMultiSelectedBlockClientIds:()=>Jm,getMultiSelectedBlocks:()=>Xm,getMultiSelectedBlocksEndClientId:()=>og,getMultiSelectedBlocksStartClientId:()=>rg,getNextBlockClientId:()=>qm,getPatternsByBlockTypes:()=>eb,getPreviousBlockClientId:()=>Gm,getSelectedBlock:()=>Fm,getSelectedBlockClientId:()=>Lm,getSelectedBlockClientIds:()=>Ym,getSelectedBlockCount:()=>Pm,getSelectedBlocksInitialCaretPosition:()=>Km,getSelectionEnd:()=>Nm,getSelectionStart:()=>Rm,getSettings:()=>ob,getTemplate:()=>jg,getTemplateLock:()=>Tg,hasBlockMovingClientId:()=>hb,hasDraggedInnerBlock:()=>fg,hasInserterItems:()=>Gg,hasMultiSelection:()=>gg,hasSelectedBlock:()=>Om,hasSelectedInnerBlock:()=>pg,isAncestorBeingDragged:()=>Cg,isAncestorMultiSelected:()=>ng,isBlockBeingDragged:()=>kg,isBlockHighlighted:()=>fb,isBlockInsertionPointVisible:()=>Eg,isBlockMultiSelected:()=>tg,isBlockSelected:()=>hg,isBlockValid:()=>bm,isBlockVisible:()=>vb,isBlockWithinSelection:()=>mg,isCaretWithinFormattedText:()=>Sg,isDraggingBlocks:()=>xg,isFirstMultiSelectedBlock:()=>eg,isGroupable:()=>Cb,isLastBlockChangePersistent:()=>ib,isMultiSelecting:()=>bg,isNavigationMode:()=>ub,isSelectionEnabled:()=>vg,isTyping:()=>_g,isUngroupable:()=>kb,isValidTemplate:()=>Ig,wasBlockJustInserted:()=>bb});var p={};n.r(p),n.d(p,{__experimentalUpdateSettings:()=>Tb,clearBlockRemovalPrompt:()=>Pb,deleteStyleOverride:()=>zb,ensureDefaultBlock:()=>Db,expandBlock:()=>Gb,hideBlockInterface:()=>Bb,modifyContentLockBlock:()=>qb,privateRemoveBlocks:()=>Nb,setBlockRemovalRules:()=>Ob,setLastFocus:()=>Vb,setOpenedBlockSettingsMenu:()=>Lb,setStyleOverride:()=>Fb,showBlockInterface:()=>Rb,startDragging:()=>$b,stopDragging:()=>Wb,stopEditingAsBlocks:()=>Hb,syncDerivedUpdates:()=>Ub});var f={};n.r(f),n.d(f,{__unstableDeleteSelection:()=>Ev,__unstableExpandSelection:()=>jv,__unstableMarkAutomaticChange:()=>Kv,__unstableMarkLastChangeAsPersistent:()=>Gv,__unstableMarkNextChangeAsNotPersistent:()=>qv,__unstableSaveReusableBlock:()=>Wv,__unstableSetEditorMode:()=>Jv,__unstableSetTemporarilyEditingAsBlocks:()=>iy,__unstableSplitSelection:()=>Iv,clearSelectedBlock:()=>hv,duplicateBlocks:()=>Zv,enterFormattedText:()=>Fv,exitFormattedText:()=>zv,flashBlock:()=>ny,hideInsertionPoint:()=>Cv,insertAfterBlock:()=>ey,insertBeforeBlock:()=>Qv,insertBlock:()=>xv,insertBlocks:()=>wv,insertDefaultBlock:()=>Vv,mergeBlocks:()=>Tv,moveBlockToPosition:()=>_v,moveBlocksDown:()=>bv,moveBlocksToPosition:()=>yv,moveBlocksUp:()=>vv,multiSelect:()=>dv,receiveBlocks:()=>rv,registerInserterMediaCategory:()=>sy,removeBlock:()=>Rv,removeBlocks:()=>Bv,replaceBlock:()=>mv,replaceBlocks:()=>fv,replaceInnerBlocks:()=>Nv,resetBlocks:()=>ev,resetSelection:()=>nv,selectBlock:()=>sv,selectNextBlock:()=>lv,selectPreviousBlock:()=>av,selectionChange:()=>Uv,setBlockEditingMode:()=>ay,setBlockMovingClientId:()=>Xv,setBlockVisibility:()=>oy,setHasControlledInnerBlocks:()=>ry,setNavigationMode:()=>Yv,setTemplateValidity:()=>Sv,showInsertionPoint:()=>kv,startDraggingBlocks:()=>Ov,startMultiSelect:()=>cv,startTyping:()=>Mv,stopDraggingBlocks:()=>Lv,stopMultiSelect:()=>uv,stopTyping:()=>Pv,synchronizeTemplate:()=>Av,toggleBlockHighlight:()=>ty,toggleBlockMode:()=>Dv,toggleSelection:()=>pv,unsetBlockEditingMode:()=>ly,updateBlock:()=>iv,updateBlockAttributes:()=>ov,updateBlockListSettings:()=>Hv,updateSettings:()=>$v,validateBlocksToTemplate:()=>tv});var m={};n.r(m),n.d(m,{Rp:()=>jx,y0:()=>Cx,ou:()=>Bx,uG:()=>Ax,eh:()=>Sx});var g={};n.r(g),n.d(g,{AdvancedPanel:()=>S1,BackgroundPanel:()=>Ej,BorderPanel:()=>$R,ColorPanel:()=>vD,DimensionsPanel:()=>NO,FiltersPanel:()=>kL,GlobalStylesContext:()=>Ry,ImageSettingsPanel:()=>k1,TypographyPanel:()=>VM,areGlobalStyleConfigsEqual:()=>By,getBlockCSSSelector:()=>fL,getBlockSelectors:()=>eF,getGlobalStylesChanges:()=>N1,getLayoutStyles:()=>KL,toStyles:()=>QL,useGlobalSetting:()=>Py,useGlobalStyle:()=>Oy,useGlobalStyleLinks:()=>Ly,useGlobalStylesOutput:()=>rF,useGlobalStylesOutputWithConfig:()=>nF,useGlobalStylesReset:()=>My,useHasBackgroundPanel:()=>yj,useHasBorderPanel:()=>MR,useHasBorderPanelControls:()=>PR,useHasColorPanel:()=>oD,useHasDimensionsPanel:()=>_O,useHasFiltersPanel:()=>bL,useHasImageSettingsPanel:()=>w1,useHasTypographyPanel:()=>jM,useSettingsForBlockElement:()=>Fy});var b={};n.r(b),n.d(b,{close:()=>Y1,open:()=>K1,registerCommand:()=>$1,registerCommandLoader:()=>G1,unregisterCommand:()=>W1,unregisterCommandLoader:()=>q1});var v={};n.r(v),n.d(v,{getCommandLoaders:()=>X1,getCommands:()=>J1,getContext:()=>Q1,isOpen:()=>Z1});var y={};n.r(y),n.d(y,{setContext:()=>e2});var _={};n.r(_),n.d(_,{applyStylesToAllTextInputs:()=>f5,blocksChangedInBlockEditor:()=>p5,changeActiveSidebar:()=>t5,changeFormBlocks:()=>L2,changeFormName:()=>F2,changeFormSettings:()=>X2,changeFormStyles:()=>H2,changePreviewSettings:()=>n5,createCustomField:()=>d5,createCustomFieldDone:()=>K2,createCustomFieldFailed:()=>J2,createCustomFieldStarted:()=>Y2,customFieldEdited:()=>$2,deleteCustomField:()=>h5,deleteCustomFieldDone:()=>U2,deleteCustomFieldFailed:()=>V2,deleteCustomFieldStarted:()=>z2,hidePreview:()=>i5,historyRedo:()=>g5,historyUndo:()=>m5,removeNotice:()=>s5,saveCustomField:()=>u5,saveCustomFieldDone:()=>W2,saveCustomFieldFailed:()=>q2,saveCustomFieldStarted:()=>G2,saveForm:()=>c5,saveFormDone:()=>Z2,saveFormFailed:()=>e5,saveFormStarted:()=>Q2,showPlacementSettings:()=>r5,showPreview:()=>o5,switchDefaultSidebarTab:()=>a5,toggleForm:()=>P2,toggleFullscreen:()=>O2,toggleInserter:()=>D2,toggleListView:()=>M2,toggleSidebar:()=>N2,toggleSidebarPanel:()=>l5,tutorialDismissed:()=>b5});var x={};n.r(x),n.d(x,{selectCategory:()=>K_e,selectTemplate:()=>q_e});var w={};n.r(w),n.d(w,{CALL_API:()=>T5.p,TRACK_EVENT:()=>Y_e.s});var k=n(7378),C=n(79124),S=n(6997),A=n(50661),E=n(71328),I=n(3698),j=n.n(I),T=n(54132),B=n(31528),R=n(91221),N=n.n(R),D=n(69186),M=n(91646);const P=e=>t=>(n,r)=>void 0===n||e(r)?t(n,r):n,O=e=>t=>(n,r)=>t(n,e(r)),L=e=>t=>(n={},r)=>{const o=r[e];if(void 0===o)return n;const i=t(n[o],r);return i===n[o]?n:{...n,[o]:i}};var F=n(61203),z=n(85998),U=n(59437),V=n(43452),H=n(37844),$=n(82321),W=n(67195);function G(e,t,n){if(!e||"object"!=typeof e)return e;const r=Array.isArray(t)?t:t.split(".");return r.reduce(((e,t,o)=>(void 0===e[t]&&(Number.isInteger(r[o+1])?e[t]=[]:e[t]={}),o===r.length-1&&(e[t]=n),e[t])),e),e}function q(e,t,n){if(!e||"object"!=typeof e||"string"!=typeof t&&!Array.isArray(t))return e;const r=Array.isArray(t)?t:t.split(".");let o=e;return r.forEach((e=>{o=o?.[e]})),void 0!==o?o:n}function K(e,t,n){return{type:"RECEIVE_ITEMS",items:Array.isArray(e)?e:[e],persistedEdits:t,meta:n}}let Y=null;async function J(e){if(null===Y){const e=await(0,S.default)({path:"/batch/v1",method:"OPTIONS"});Y=e.endpoints[0].args.requests.maxItems}const t=[];for(const n of function(e,t){const n=[...e],r=[];for(;n.length;)r.push(n.splice(0,t));return r}(e,Y)){const e=await(0,S.default)({path:"/batch/v1",method:"POST",data:{validation:"require-all-validate",requests:n.map((e=>({path:e.path,body:e.data,method:e.method,headers:e.headers})))}});let r;r=e.failed?e.responses.map((e=>({error:e?.body}))):e.responses.map((e=>{const t={};return e.status>=200&&e.status<300?t.output=e.body:t.error=e.body,t})),t.push(...r)}return t}function X(e=J){let t=0,n=[];const r=new Z;return{add(e){const o=++t;r.add(o);const i=e=>new Promise(((t,i)=>{n.push({input:e,resolve:t,reject:i}),r.delete(o)}));return"function"==typeof e?Promise.resolve(e(i)).finally((()=>{r.delete(o)})):i(e)},async run(){let t;r.size&&await new Promise((e=>{const t=r.subscribe((()=>{r.size||(t(),e(void 0))}))}));try{if(t=await e(n.map((({input:e})=>e))),t.length!==n.length)throw new Error("run: Array returned by processor must be same size as input array.")}catch(e){for(const{reject:t}of n)t(e);throw e}let o=!0;return t.forEach(((e,t)=>{const r=n[t];var i;e?.error?(r?.reject(e.error),o=!1):r?.resolve(null!==(i=e?.output)&&void 0!==i?i:e)})),n=[],o}}}class Z{constructor(...e){this.set=new Set(...e),this.subscribers=new Set}get size(){return this.set.size}add(e){return this.set.add(e),this.subscribers.forEach((e=>e())),this}delete(e){const t=this.set.delete(e);return this.subscribers.forEach((e=>e())),t}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}}const Q="core",ee=()=>new Map,te=e=>{const t=ee();return e.forEach(((e,n)=>{t.set(n,e)})),t},ne=(e,t,n)=>{let r=e.get(t);return void 0===r&&e.set(t,r=n()),r},re=()=>new Set,oe=e=>e[e.length-1],ie=(e,t)=>{for(let n=0;n{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){const n=this._observers.get(e);void 0!==n&&(n.delete(t),0===n.size&&this._observers.delete(e))}emit(e,t){return se((this._observers.get(e)||ee()).values()).forEach((e=>e(...t)))}destroy(){this._observers=ee()}}const ce=Math.floor,ue=(Math.ceil,Math.abs),de=(Math.imul,Math.round,Math.log10),he=(Math.log2,Math.log,Math.sqrt,(e,t)=>ee>t?e:t,fe=(Number.isNaN,Math.pow,Math.sign,e=>0!==e?e<0:1/e<0),me=64,ge=128,be=127,ve=Number.MAX_SAFE_INTEGER,ye=(Number.MIN_SAFE_INTEGER,Number.isInteger||(e=>"number"==typeof e&&isFinite(e)&&ce(e)===e)),_e=(Number.isNaN,Number.parseInt,String.fromCharCode),xe=(String.fromCodePoint,_e(65535),/^\s*/g),we=/([A-Z])/g,ke=(e,t)=>(e=>e.replace(xe,""))(e.replace(we,(e=>`${t}${(e=>e.toLowerCase())(e)}`))),Ce="undefined"!=typeof TextEncoder?new TextEncoder:null,Se=Ce?e=>Ce.encode(e):e=>{const t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let e=0;enew Ee,je=e=>{const t=new Uint8Array((e=>{let t=e.cpos;for(let n=0;n{const n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(2*n),e.cpos=0),e.cbuf[e.cpos++]=t},Be=Te,Re=(e,t)=>{for(;t>be;)Te(e,ge|be&t),t=ce(t/128);Te(e,be&t)},Ne=(e,t)=>{const n=fe(t);for(n&&(t=-t),Te(e,(t>63?ge:0)|(n?me:0)|63&t),t=ce(t/64);t>0;)Te(e,(t>be?ge:0)|be&t),t=ce(t/128)},De=new Uint8Array(3e4),Me=De.length/3,Pe=Ce&&Ce.encodeInto?(e,t)=>{if(t.length{const n=unescape(encodeURIComponent(t)),r=n.length;Re(e,r);for(let t=0;t{const n=e.cbuf.length,r=e.cpos,o=he(n-r,t.length),i=t.length-o;e.cbuf.set(t.subarray(0,o),r),e.cpos+=o,i>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(pe(2*n,i)),e.cbuf.set(t.subarray(o)),e.cpos=i)},Le=(e,t)=>{Re(e,t.byteLength),Oe(e,t)},Fe=(e,t)=>{((e,t)=>{const n=e.cbuf.length;n-e.cpos{switch(typeof t){case"string":Te(e,119),Pe(e,t);break;case"number":ye(t)&&ue(t)<=2147483647?(Te(e,125),Ne(e,t)):(n=t,ze.setFloat32(0,n),ze.getFloat32(0)===n?(Te(e,124),((e,t)=>{Fe(e,4).setFloat32(0,t,!1)})(e,t)):(Te(e,123),((e,t)=>{Fe(e,8).setFloat64(0,t,!1)})(e,t)));break;case"bigint":Te(e,122),((e,t)=>{Fe(e,8).setBigInt64(0,t,!1)})(e,t);break;case"object":if(null===t)Te(e,126);else if(ae(t)){Te(e,117),Re(e,t.length);for(let n=0;n0&&Re(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const He=e=>{e.count>0&&(Ne(e.encoder,1===e.count?e.s:-e.s),e.count>1&&Re(e.encoder,e.count-2))};class $e{constructor(){this.encoder=new Ee,this.s=0,this.count=0}write(e){this.s===e?this.count++:(He(this),this.count=1,this.s=e)}toUint8Array(){return He(this),je(this.encoder)}}const We=e=>{if(e.count>0){const t=2*e.diff+(1===e.count?0:1);Ne(e.encoder,t),e.count>1&&Re(e.encoder,e.count-2)}};class Ge{constructor(){this.encoder=new Ee,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(We(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return We(this),je(this.encoder)}}class qe{constructor(){this.sarr=[],this.s="",this.lensE=new $e}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){const e=new Ee;return this.sarr.push(this.s),this.s="",Pe(e,this.sarr.join("")),Oe(e,this.lensE.toUint8Array()),je(e)}}const Ke=e=>new Error(e),Ye=()=>{throw Ke("Method unimplemented")},Je=()=>{throw Ke("Unexpected case")},Xe=Ke("Unexpected end of array"),Ze=Ke("Integer out of Range");class Qe{constructor(e){this.arr=e,this.pos=0}}const et=e=>new Qe(e),tt=e=>((e,t)=>{const n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n})(e,rt(e)),nt=e=>e.arr[e.pos++],rt=e=>{let t=0,n=1;const r=e.arr.length;for(;e.posve)throw Ze}throw Xe},ot=e=>{let t=e.arr[e.pos++],n=63&t,r=64;const o=(t&me)>0?-1:1;if(!(t&ge))return o*n;const i=e.arr.length;for(;e.posve)throw Ze}throw Xe},it=Ae?e=>Ae.decode(tt(e)):e=>{let t=rt(e);if(0===t)return"";{let n=String.fromCodePoint(nt(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(nt(e));else for(;t>0;){const r=t<1e4?t:1e4,o=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,o),t-=r}return decodeURIComponent(escape(n))}},st=(e,t)=>{const n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n},at=[e=>{},e=>null,ot,e=>st(e,4).getFloat32(0,!1),e=>st(e,8).getFloat64(0,!1),e=>st(e,8).getBigInt64(0,!1),e=>!1,e=>!0,it,e=>{const t=rt(e),n={};for(let r=0;r{const t=rt(e),n=[];for(let r=0;rat[127-nt(e)](e);class ct extends Qe{constructor(e,t){super(e),this.reader=t,this.s=null,this.count=0}read(){return 0===this.count&&(this.s=this.reader(this),(e=this).pos!==e.arr.length?this.count=rt(this)+1:this.count=-1),this.count--,this.s;var e}}class ut extends Qe{constructor(e){super(e),this.s=0,this.count=0}read(){if(0===this.count){this.s=ot(this);const e=fe(this.s);this.count=1,e&&(this.s=-this.s,this.count=rt(this)+2)}return this.count--,this.s}}class dt extends Qe{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(0===this.count){const e=ot(this),t=1&e;this.diff=ce(e/2),this.count=1,t&&(this.count=rt(this)+2)}return this.s+=this.diff,this.count--,this.s}}class ht{constructor(e){this.decoder=new ut(e),this.str=it(this.decoder),this.spos=0}read(){const e=this.spos+this.decoder.read(),t=this.str.slice(this.spos,e);return this.spos=e,t}}crypto.subtle;const pt=crypto.getRandomValues.bind(crypto),ft=Math.random,mt=()=>pt(new Uint32Array(1))[0],gt=[1e7]+-1e3+-4e3+-8e3+-1e11,bt=()=>gt.replace(/[018]/g,(e=>(e^mt()&15>>e/4).toString(16))),vt=e=>new Promise(e),yt=(Promise.all.bind(Promise),e=>Promise.resolve(e));let _t=new class{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}},xt=!0;try{"undefined"!=typeof localStorage&&localStorage&&(_t=localStorage,xt=!1)}catch(e){}const wt=_t,kt=Object.assign,Ct=Object.keys,St=e=>Ct(e).length,At=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Et=(e,t,n=0)=>{try{for(;n{},jt=e=>e,Tt=(e,t)=>{if(null==e||null==t)return((e,t)=>e===t)(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;n(()=>{if(void 0===Nt)if(Bt){Nt=ee();const e=process.argv;let t=null;for(let n=0;n{if(0!==e.length){const[t,n]=e.split("=");Nt.set(`--${ke(t,"-")}`,n),Nt.set(`-${ke(t,"-")}`,n)}}))):Nt=ee();return Nt})().has(e),Pt=e=>(e=>void 0===e?null:e)(Bt?process.env[e.toUpperCase()]:wt.getItem(e));Mt("--"+"production")||Pt("production");const Ot=Bt&&(Vt=process.env.FORCE_COLOR,["true","1","2"].includes(Vt)),Lt=!Mt("no-colors")&&(!Bt||process.stdout.isTTY||Ot)&&(!Bt||Mt("color")||Ot||null!==Pt("COLORTERM")||(Pt("TERM")||"").includes("color")),Ft=e=>new Uint8Array(e),zt=Rt?e=>{let t="";for(let n=0;nBuffer.from(e.buffer,e.byteOffset,e.byteLength).toString("base64"),Ut=Rt?e=>{const t=atob(e),n=Ft(t.length);for(let e=0;e{const t=Buffer.from(e,"base64");return n=t.buffer,r=t.byteOffset,o=t.byteLength,new Uint8Array(n,r,o);var n,r,o};var Vt;class Ht{constructor(e,t){this.left=e,this.right=t}}const $t=(e,t)=>new Ht(e,t),Wt="undefined"!=typeof document?document:{},Gt=("undefined"!=typeof DOMParser&&new DOMParser,e=>((e,t)=>{const n=[];for(const[r,o]of e)n.push(t(o,r));return n})(e,((e,t)=>`${t}:${e};`)).join("")),qt=(Wt.ELEMENT_NODE,Wt.TEXT_NODE,Wt.CDATA_SECTION_NODE,Wt.COMMENT_NODE,Wt.DOCUMENT_NODE,Wt.DOCUMENT_TYPE_NODE,Wt.DOCUMENT_FRAGMENT_NODE,Symbol),Kt=Date.now,Yt=qt(),Jt=qt(),Xt=qt(),Zt=qt(),Qt=qt(),en=qt(),tn=qt(),nn=qt(),rn=qt(),on=[Qt,tn,nn,Xt];let sn=0,an=Kt();const ln={[Yt]:$t("font-weight","bold"),[Jt]:$t("font-weight","normal"),[Xt]:$t("color","blue"),[Qt]:$t("color","green"),[Zt]:$t("color","grey"),[en]:$t("color","red"),[tn]:$t("color","purple"),[nn]:$t("color","orange"),[rn]:$t("color","black")},cn=Lt?e=>{const t=[],n=[],r=ee();let o=[],i=0;for(;i0||e.length>0?(t.push("%c"+o),n.push(e)):t.push(o)}}}for(i>0&&(o=n,o.unshift(t.join("")));i{const t=[],n=[];let r=0;for(;r{console.log(...cn(e)),dn.forEach((t=>t.print(e)))},dn=re(),hn=e=>({[Symbol.iterator](){return this},next:e}),pn=(e,t)=>hn((()=>{const{done:n,value:r}=e.next();return{done:n,value:n?void 0:t(r)}}));class fn{constructor(e,t){this.clock=e,this.len=t}}class mn{constructor(){this.clients=new Map}}const gn=(e,t,n)=>t.clients.forEach(((t,r)=>{const o=e.doc.store.clients.get(r);for(let r=0;r{const n=e.clients.get(t.client);return void 0!==n&&null!==((e,t)=>{let n=0,r=e.length-1;for(;n<=r;){const o=ce((n+r)/2),i=e[o],s=i.clock;if(s<=t){if(t{e.clients.forEach((e=>{let t,n;for(e.sort(((e,t)=>e.clock-t.clock)),t=1,n=1;t=o.clock?r.len=pe(r.len,o.clock+o.len-r.clock):(n{ne(e.clients,t,(()=>[])).push(new fn(n,r))},_n=()=>new mn,xn=(e,t)=>{Re(e.restEncoder,t.clients.size),se(t.clients.entries()).sort(((e,t)=>t[0]-e[0])).forEach((([t,n])=>{e.resetDsCurVal(),Re(e.restEncoder,t);const r=n.length;Re(e.restEncoder,r);for(let t=0;t{const t=new mn,n=rt(e.restDecoder);for(let r=0;r0){const o=ne(t.clients,n,(()=>[]));for(let t=0;t{const r=new mn,o=rt(e.restDecoder);for(let i=0;i0){const e=new Nn;return Re(e.restEncoder,0),xn(e,r),e.toUint8Array()}return null},Cn=mt;class Sn extends le{constructor({guid:e=bt(),collectionid:t=null,gc:n=!0,gcFilter:r=(()=>!0),meta:o=null,autoLoad:i=!1,shouldLoad:s=!0}={}){super(),this.gc=n,this.gcFilter=r,this.clientID=Cn(),this.guid=e,this.collectionid=t,this.share=new Map,this.store=new er,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=s,this.autoLoad=i,this.meta=o,this.isLoaded=!1,this.isSynced=!1,this.whenLoaded=vt((e=>{this.on("load",(()=>{this.isLoaded=!0,e(this)}))}));const a=()=>vt((e=>{const t=n=>{void 0!==n&&!0!==n||(this.off("sync",t),e())};this.on("sync",t)}));this.on("sync",(e=>{!1===e&&this.isSynced&&(this.whenSynced=a()),this.isSynced=void 0===e||!0===e,this.isSynced&&!this.isLoaded&&this.emit("load",[])})),this.whenSynced=a()}load(){const e=this._item;null===e||this.shouldLoad||mr(e.parent.doc,(e=>{e.subdocsLoaded.add(this)}),null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(se(this.subdocs).map((e=>e.guid)))}transact(e,t=null){return mr(this,e,t)}get(e,t=Mr){const n=ne(this.share,e,(()=>{const e=new t;return e._integrate(this,null),e})),r=n.constructor;if(t!==Mr&&r!==t){if(r===Mr){const r=new t;r._map=n._map,n._map.forEach((e=>{for(;null!==e;e=e.left)e.parent=r})),r._start=n._start;for(let e=r._start;null!==e;e=e.right)e.parent=r;return r._length=n._length,this.share.set(e,r),r._integrate(this,null),r}throw new Error(`Type with the name ${e} has already been defined with a different constructor`)}return n}getArray(e=""){return this.get(e,Qr)}getText(e=""){return this.get(e,vo)}getMap(e=""){return this.get(e,to)}getXmlElement(e=""){return this.get(e,xo)}getXmlFragment(e=""){return this.get(e,_o)}toJSON(){const e={};return this.share.forEach(((t,n)=>{e[n]=t.toJSON()})),e}destroy(){se(this.subdocs).forEach((e=>e.destroy()));const e=this._item;if(null!==e){this._item=null;const t=e.content;t.doc=new Sn({guid:this.guid,...t.opts,shouldLoad:!1}),t.doc._item=e,mr(e.parent.doc,(n=>{const r=t.doc;e.deleted||n.subdocsAdded.add(r),n.subdocsRemoved.add(this)}),null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}on(e,t){super.on(e,t)}off(e,t){super.off(e,t)}}class An{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return rt(this.restDecoder)}readDsLen(){return rt(this.restDecoder)}}class En extends An{readLeftID(){return Kn(rt(this.restDecoder),rt(this.restDecoder))}readRightID(){return Kn(rt(this.restDecoder),rt(this.restDecoder))}readClient(){return rt(this.restDecoder)}readInfo(){return nt(this.restDecoder)}readString(){return it(this.restDecoder)}readParentInfo(){return 1===rt(this.restDecoder)}readTypeRef(){return rt(this.restDecoder)}readLen(){return rt(this.restDecoder)}readAny(){return lt(this.restDecoder)}readBuf(){return(e=>{const t=Ft(e.byteLength);return t.set(e),t})(tt(this.restDecoder))}readJSON(){return JSON.parse(it(this.restDecoder))}readKey(){return it(this.restDecoder)}}class In{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=rt(this.restDecoder),this.dsCurrVal}readDsLen(){const e=rt(this.restDecoder)+1;return this.dsCurrVal+=e,e}}class jn extends In{constructor(e){super(e),this.keys=[],rt(e),this.keyClockDecoder=new dt(tt(e)),this.clientDecoder=new ut(tt(e)),this.leftClockDecoder=new dt(tt(e)),this.rightClockDecoder=new dt(tt(e)),this.infoDecoder=new ct(tt(e),nt),this.stringDecoder=new ht(tt(e)),this.parentInfoDecoder=new ct(tt(e),nt),this.typeRefDecoder=new ut(tt(e)),this.lenDecoder=new ut(tt(e))}readLeftID(){return new Gn(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new Gn(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return 1===this.parentInfoDecoder.read()}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return lt(this.restDecoder)}readBuf(){return tt(this.restDecoder)}readJSON(){return lt(this.restDecoder)}readKey(){const e=this.keyClockDecoder.read();if(e{const r=new Map;n.forEach(((e,n)=>{nr(t,n)>e&&r.set(n,e)})),tr(t).forEach(((e,t)=>{n.has(t)||r.set(t,0)})),Re(e.restEncoder,r.size),se(r.entries()).sort(((e,t)=>t[0]-e[0])).forEach((([n,r])=>{((e,t,n,r)=>{r=pe(r,t[0].id.clock);const o=or(t,r);Re(e.restEncoder,t.length-o),e.writeClient(n),Re(e.restEncoder,r);const i=t[o];i.write(e,r-i.id.clock);for(let n=o+1;n{const o=et(t);((e,t,n,r=new jn(e))=>{mr(t,(e=>{e.local=!1;let t=!1;const n=e.doc,o=n.store,i=((e,t)=>{const n=ee(),r=rt(e.restDecoder);for(let o=0;o{const r=[];let o=se(n.keys()).sort(((e,t)=>e-t));if(0===o.length)return null;const i=()=>{if(0===o.length)return null;let e=n.get(o[o.length-1]);for(;e.refs.length===e.i;){if(o.pop(),!(o.length>0))return null;e=n.get(o[o.length-1])}return e};let s=i();if(null===s)return null;const a=new er,l=new Map,c=(e,t)=>{const n=l.get(e);(null==n||n>t)&&l.set(e,t)};let u=s.refs[s.i++];const d=new Map,h=()=>{for(const e of r){const t=e.id.client,r=n.get(t);r?(r.i--,a.clients.set(t,r.refs.slice(r.i)),n.delete(t),r.i=0,r.refs=[]):a.clients.set(t,[e]),o=o.filter((e=>e!==t))}r.length=0};for(;;){if(u.constructor!==Yo){const o=ne(d,u.id.client,(()=>nr(t,u.id.client)))-u.id.clock;if(o<0)r.push(u),c(u.id.client,u.id.clock-1),h();else{const i=u.getMissing(e,t);if(null!==i){r.push(u);const e=n.get(i)||{refs:[],i:0};if(e.refs.length!==e.i){u=e.refs[e.i++];continue}c(i,nr(t,i)),h()}else(0===o||o0)u=r.pop();else if(null!==s&&s.i0){const e=new Nn;return Dn(e,a,new Map),Re(e.restEncoder,0),{missing:l,update:e.toUint8Array()}}return null})(e,o,i),a=o.pendingStructs;if(a){for(const[e,n]of a.missing)if(nt)&&a.missing.set(e,t)}a.update=_r([a.update,s.update])}}else o.pendingStructs=s;const l=kn(r,e,o);if(o.pendingDs){const t=new jn(et(o.pendingDs));rt(t.restDecoder);const n=kn(t,e,o);o.pendingDs=l&&n?_r([l,n]):l||n}else o.pendingDs=l;if(t){const t=o.pendingStructs.update;o.pendingStructs=null,Mn(e.doc,t)}}),n,!1)})(o,e,n,new r(o))},Pn=(e,t,n)=>Mn(e,t,n,En),On=(e,t=new Uint8Array([0]),n=new Nn)=>{((e,t,n=new Map)=>{Dn(e,t.store,n),xn(e,(e=>{const t=_n();return e.clients.forEach(((e,n)=>{const r=[];for(let t=0;t0&&t.clients.set(n,r)})),t})(t.store))})(n,e,Fn(t));const r=[n.toUint8Array()];if(e.store.pendingDs&&r.push(e.store.pendingDs),e.store.pendingStructs&&r.push(xr(e.store.pendingStructs.update,t)),r.length>1){if(n.constructor===Bn)return vr(r.map(((e,t)=>0===t?e:Sr(e))));if(n.constructor===Nn)return _r(r)}return r[0]},Ln=(e,t)=>On(e,t,new Bn),Fn=e=>(e=>{const t=new Map,n=rt(e.restDecoder);for(let r=0;r(Re(e.restEncoder,t.size),se(t.entries()).sort(((e,t)=>t[0]-e[0])).forEach((([t,n])=>{Re(e.restEncoder,t),Re(e.restEncoder,n)})),e);class Un{constructor(){this.l=[]}}const Vn=()=>new Un,Hn=(e,t)=>e.l.push(t),$n=(e,t)=>{const n=e.l,r=n.length;e.l=n.filter((e=>t!==e)),r===e.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},Wn=(e,t,n)=>Et(e.l,[t,n]);class Gn{constructor(e,t){this.client=e,this.clock=t}}const qn=(e,t)=>e===t||null!==e&&null!==t&&e.client===t.client&&e.clock===t.clock,Kn=(e,t)=>new Gn(e,t);class Yn{constructor(e,t){this.ds=e,this.sv=t}}const Jn=(Zn=_n(),Qn=new Map,new Yn(Zn,Qn),(e,t)=>void 0===t?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!bn(t.ds,e.id)),Xn=(e,t)=>{const n=ne(e.meta,Xn,re),r=e.doc.store;n.has(t)||(t.sv.forEach(((t,n)=>{t{})),n.add(t))};var Zn,Qn;class er{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const tr=e=>{const t=new Map;return e.clients.forEach(((e,n)=>{const r=e[e.length-1];t.set(n,r.id.clock+r.length)})),t},nr=(e,t)=>{const n=e.clients.get(t);if(void 0===n)return 0;const r=n[n.length-1];return r.id.clock+r.length},rr=(e,t)=>{let n=e.clients.get(t.id.client);if(void 0===n)n=[],e.clients.set(t.id.client,n);else{const e=n[n.length-1];if(e.id.clock+e.length!==t.id.clock)throw Je()}n.push(t)},or=(e,t)=>{let n=0,r=e.length-1,o=e[r],i=o.id.clock;if(i===t)return r;let s=ce(t/(i+o.length-1)*r);for(;n<=r;){if(o=e[s],i=o.id.clock,i<=t){if(t{const n=e.clients.get(t.client);return n[or(n,t.clock)]},sr=(e,t,n)=>{const r=or(t,n),o=t[r];return o.id.clock{const n=e.doc.store.clients.get(t.client);return n[sr(e,n,t.clock)]},lr=(e,t,n)=>{const r=t.clients.get(n.client),o=or(r,n.clock),i=r[o];return n.clock!==i.id.clock+i.length-1&&i.constructor!==Ao&&r.splice(o+1,0,Wo(e,i,n.clock-i.id.clock+1)),i},cr=(e,t,n,r,o)=>{if(0===r)return;const i=n+r;let s,a=sr(e,t,n);do{s=t[a++],i!(0===t.deleteSet.clients.size&&!((e,t)=>{for(const[n,r]of e)if(t(r,n))return!0;return!1})(t.afterState,((e,n)=>t.beforeState.get(n)!==e))||(vn(t.deleteSet),((e,t)=>{Dn(e,t.doc.store,t.beforeState)})(e,t),xn(e,t.deleteSet),0)),hr=(e,t,n)=>{const r=t._item;(null===r||r.id.clock<(e.beforeState.get(r.id.client)||0)&&!r.deleted)&&ne(e.changed,t,re).add(n)},pr=(e,t)=>{let n=e[t],r=e[t-1],o=t;for(;o>0&&r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n);n=r,r=e[--o-1])n instanceof Go&&null!==n.parentSub&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);const i=t-o;return i&&e.splice(t+1-i,i),i},fr=(e,t)=>{if(te.push((()=>{null!==r._item&&r._item.deleted||r._callObserver(n,t)})))),e.push((()=>{n.changedParentTypes.forEach(((e,t)=>{t._dEH.l.length>0&&(null===t._item||!t._item.deleted)&&((e=e.filter((e=>null===e.target._item||!e.target._item.deleted))).forEach((e=>{e.currentTarget=t,e._path=null})),e.sort(((e,t)=>e.path.length-t.path.length)),Wn(t._dEH,e,n))}))})),e.push((()=>r.emit("afterTransaction",[n,r]))),Et(e,[]),n._needFormattingCleanup&&mo(n)}finally{r.gc&&((e,t,n)=>{for(const[r,o]of e.clients.entries()){const e=t.clients.get(r);for(let r=o.length-1;r>=0;r--){const i=o[r],s=i.clock+i.len;for(let r=or(e,i.clock),o=e[r];r{e.clients.forEach(((e,n)=>{const r=t.clients.get(n);for(let t=e.length-1;t>=0;t--){const n=e[t];for(let e=he(r.length-1,1+or(r,n.clock+n.len-1)),t=r[e];e>0&&t.id.clock>=n.clock;t=r[e])e-=1+pr(r,e)}}))})(i,o),n.afterState.forEach(((e,t)=>{const r=n.beforeState.get(t)||0;if(r!==e){const e=o.clients.get(t),n=pe(or(e,r),1);for(let t=e.length-1;t>=n;)t-=1+pr(e,t)}}));for(let e=s.length-1;e>=0;e--){const{client:t,clock:n}=s[e].id,r=o.clients.get(t),i=or(r,n);i+11||i>0&&pr(r,i)}if(n.local||n.afterState.get(r.clientID)===n.beforeState.get(r.clientID)||(un(nn,Yt,"[yjs] ",Jt,en,"Changed the client-id because another client seems to be using it."),r.clientID=Cn()),r.emit("afterTransactionCleanup",[n,r]),r._observers.has("update")){const e=new Bn;dr(e,n)&&r.emit("update",[e.toUint8Array(),n.origin,r,n])}if(r._observers.has("updateV2")){const e=new Nn;dr(e,n)&&r.emit("updateV2",[e.toUint8Array(),n.origin,r,n])}const{subdocsAdded:a,subdocsLoaded:l,subdocsRemoved:c}=n;(a.size>0||c.size>0||l.size>0)&&(a.forEach((e=>{e.clientID=r.clientID,null==e.collectionid&&(e.collectionid=r.collectionid),r.subdocs.add(e)})),c.forEach((e=>r.subdocs.delete(e))),r.emit("subdocs",[{loaded:l,added:a,removed:c},r,n]),c.forEach((e=>e.destroy()))),e.length<=t+1?(r._transactionCleanups=[],r.emit("afterAllTransactions",[r,e])):fr(e,t+1)}}},mr=(e,t,n=null,r=!0)=>{const o=e._transactionCleanups;let i=!1,s=null;null===e._transaction&&(i=!0,e._transaction=new ur(e,n,r),o.push(e._transaction),1===o.length&&e.emit("beforeAllTransactions",[e]),e.emit("beforeTransaction",[e._transaction,e]));try{s=t(e._transaction)}finally{if(i){const t=e._transaction===o[0];e._transaction=null,t&&fr(o,0)}}return s};class gr{constructor(e,t){this.gen=function*(e){const t=rt(e.restDecoder);for(let n=0;n_r(e,En,Bn),yr=(e,t)=>{if(e.constructor===Ao){const{client:n,clock:r}=e.id;return new Ao(Kn(n,r+t),e.length-t)}if(e.constructor===Yo){const{client:n,clock:r}=e.id;return new Yo(Kn(n,r+t),e.length-t)}{const n=e,{client:r,clock:o}=n.id;return new Go(Kn(r,o+t),null,Kn(r,o+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},_r=(e,t=jn,n=Nn)=>{if(1===e.length)return e[0];const r=e.map((e=>new t(et(e))));let o=r.map((e=>new gr(e,!0))),i=null;const s=new n,a=new br(s);for(;o=o.filter((e=>null!==e.curr)),o.sort(((e,t)=>{if(e.curr.id.client===t.curr.id.client){const n=e.curr.id.clock-t.curr.id.clock;return 0===n?e.curr.constructor===t.curr.constructor?0:e.curr.constructor===Yo?1:-1:n}return t.curr.id.client-e.curr.id.client})),0!==o.length;){const e=o[0],t=e.curr.id.client;if(null!==i){let n=e.curr,r=!1;for(;null!==n&&n.id.clock+n.length<=i.struct.id.clock+i.struct.length&&n.id.client>=i.struct.id.client;)n=e.next(),r=!0;if(null===n||n.id.client!==t||r&&n.id.clock>i.struct.id.clock+i.struct.length)continue;if(t!==i.struct.id.client)kr(a,i.struct,i.offset),i={struct:n,offset:0},e.next();else if(i.struct.id.clock+i.struct.length0&&(i.struct.constructor===Yo?i.struct.length-=t:n=yr(n,t)),i.struct.mergeWith(n)||(kr(a,i.struct,i.offset),i={struct:n,offset:0},e.next())}}else i={struct:e.curr,offset:0},e.next();for(let n=e.curr;null!==n&&n.id.client===t&&n.id.clock===i.struct.id.clock+i.struct.length&&n.constructor!==Yo;n=e.next())kr(a,i.struct,i.offset),i={struct:n,offset:0}}null!==i&&(kr(a,i.struct,i.offset),i=null),Cr(a);const l=(e=>{const t=new mn;for(let n=0;n{if(!t.clients.has(o)){const i=r.slice();for(let t=n+1;twn(e))));return xn(s,l),s.toUint8Array()},xr=(e,t,n=jn,r=Nn)=>{const o=Fn(t),i=new r,s=new br(i),a=new n(et(e)),l=new gr(a,!1);for(;l.curr;){const e=l.curr,t=e.id.client,n=o.get(t)||0;if(l.curr.constructor!==Yo)if(e.id.clock+e.length>n)for(kr(s,e,pe(n-e.id.clock,0)),l.next();l.curr&&l.curr.id.client===t;)kr(s,l.curr,0),l.next();else for(;l.curr&&l.curr.id.client===t&&l.curr.id.clock+l.curr.length<=n;)l.next();else l.next()}Cr(s);const c=wn(a);return xn(i,c),i.toUint8Array()},wr=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:je(e.encoder.restEncoder)}),e.encoder.restEncoder=Ie(),e.written=0)},kr=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&wr(e),0===e.written&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),Re(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},Cr=e=>{wr(e);const t=e.encoder.restEncoder;Re(t,e.clientStructs.length);for(let n=0;n((e,t,n,r)=>{const o=new n(et(e)),i=new gr(o,!1),s=new r,a=new br(s);for(let e=i.curr;null!==e;e=i.next())kr(a,t(e),0);Cr(a);const l=wn(o);return xn(s,l),s.toUint8Array()})(e,jt,jn,Bn),Ar="You must not compute changes after the event-handler fired.";class Er{constructor(e,t){this.target=e,this.currentTarget=e,this.transaction=t,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=Ir(this.currentTarget,this.target))}deletes(e){return bn(this.transaction.deleteSet,e.id)}get keys(){if(null===this._keys){if(0===this.transaction.doc._transactionCleanups.length)throw Ke(Ar);const e=new Map,t=this.target;this.transaction.changed.get(t).forEach((n=>{if(null!==n){const r=t._map.get(n);let o,i;if(this.adds(r)){let e=r.left;for(;null!==e&&this.adds(e);)e=e.left;if(this.deletes(r)){if(null===e||!this.deletes(e))return;o="delete",i=oe(e.content.getContent())}else null!==e&&this.deletes(e)?(o="update",i=oe(e.content.getContent())):(o="add",i=void 0)}else{if(!this.deletes(r))return;o="delete",i=oe(r.content.getContent())}e.set(n,{action:o,oldValue:i})}})),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(null===e){if(0===this.transaction.doc._transactionCleanups.length)throw Ke(Ar);const t=this.target,n=re(),r=re(),o=[];if(e={added:n,deleted:r,delta:o,keys:this.keys},this.transaction.changed.get(t).has(null)){let e=null;const i=()=>{e&&o.push(e)};for(let o=t._start;null!==o;o=o.right)o.deleted?this.deletes(o)&&!this.adds(o)&&(null!==e&&void 0!==e.delete||(i(),e={delete:0}),e.delete+=o.length,r.add(o)):this.adds(o)?(null!==e&&void 0!==e.insert||(i(),e={insert:[]}),e.insert=e.insert.concat(o.content.getContent()),n.add(o)):(null!==e&&void 0!==e.retain||(i(),e={retain:0}),e.retain+=o.length);null!==e&&void 0===e.retain&&i()}this._changes=e}return e}}const Ir=(e,t)=>{const n=[];for(;null!==t._item&&t!==e;){if(null!==t._item.parentSub)n.unshift(t._item.parentSub);else{let e=0,r=t._item.parent._start;for(;r!==t._item&&null!==r;)r.deleted||e++,r=r.right;n.unshift(e)}t=t._item.parent}return n};let jr=0;class Tr{constructor(e,t){e.marker=!0,this.p=e,this.index=t,this.timestamp=jr++}}const Br=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=jr++},Rr=(e,t)=>{if(null===e._start||0===t||null===e._searchMarker)return null;const n=0===e._searchMarker.length?null:e._searchMarker.reduce(((e,n)=>ue(t-e.index){e.timestamp=jr++})(n));null!==r.right&&ot;)r=r.left,!r.deleted&&r.countable&&(o-=r.length);for(;null!==r.left&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(o-=r.length);return null!==n&&ue(n.index-o){if(e.length>=80){const r=e.reduce(((e,t)=>e.timestamp{for(let r=e.length-1;r>=0;r--){const o=e[r];if(n>0){let t=o.p;for(t.marker=!1;t&&(t.deleted||!t.countable);)t=t.left,t&&!t.deleted&&t.countable&&(o.index-=t.length);if(null===t||!0===t.marker){e.splice(r,1);continue}o.p=t,t.marker=!0}(t0&&t===o.index)&&(o.index=pe(t,o.index+n))}},Dr=(e,t,n)=>{const r=e,o=t.changedParentTypes;for(;ne(o,e,(()=>[])).push(n),null!==e._item;)e=e._item.parent;Wn(r._eH,n,t)};class Mr{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=Vn(),this._dEH=Vn(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,t){this.doc=e,this._item=t}_copy(){throw Ye()}clone(){throw Ye()}_write(e){}get _first(){let e=this._start;for(;null!==e&&e.deleted;)e=e.right;return e}_callObserver(e,t){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){Hn(this._eH,e)}observeDeep(e){Hn(this._dEH,e)}unobserve(e){$n(this._eH,e)}unobserveDeep(e){$n(this._dEH,e)}toJSON(){}}const Pr=(e,t,n)=>{t<0&&(t=e._length+t),n<0&&(n=e._length+n);let r=n-t;const o=[];let i=e._start;for(;null!==i&&r>0;){if(i.countable&&!i.deleted){const e=i.content.getContent();if(e.length<=t)t-=e.length;else{for(let n=t;n0;n++)o.push(e[n]),r--;t=0}}i=i.right}return o},Or=e=>{const t=[];let n=e._start;for(;null!==n;){if(n.countable&&!n.deleted){const e=n.content.getContent();for(let n=0;n{let n=0,r=e._start;for(;null!==r;){if(r.countable&&!r.deleted){const o=r.content.getContent();for(let r=0;r{const n=[];return Lr(e,((r,o)=>{n.push(t(r,o,e))})),n},zr=e=>{let t=e._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(null===n){for(;null!==t&&t.deleted;)t=t.right;if(null===t)return{done:!0,value:void 0};n=t.content.getContent(),r=0,t=t.right}const e=n[r++];return n.length<=r&&(n=null),{done:!1,value:e}}}},Ur=(e,t)=>{const n=Rr(e,t);let r=e._start;for(null!==n&&(r=n.p,t-=n.index);null!==r;r=r.right)if(!r.deleted&&r.countable){if(t{let o=n;const i=e.doc,s=i.clientID,a=i.store,l=null===n?t._start:n.right;let c=[];const u=()=>{c.length>0&&(o=new Go(Kn(s,nr(a,s)),o,o&&o.lastId,l,l&&l.id,t,null,new Do(c)),o.integrate(e,0),c=[])};r.forEach((n=>{if(null===n)c.push(n);else switch(n.constructor){case Number:case Object:case Boolean:case Array:case String:c.push(n);break;default:switch(u(),n.constructor){case Uint8Array:case ArrayBuffer:o=new Go(Kn(s,nr(a,s)),o,o&&o.lastId,l,l&&l.id,t,null,new Eo(new Uint8Array(n))),o.integrate(e,0);break;case Sn:o=new Go(Kn(s,nr(a,s)),o,o&&o.lastId,l,l&&l.id,t,null,new To(n)),o.integrate(e,0);break;default:if(!(n instanceof Mr))throw new Error("Unexpected content type in insert operation");o=new Go(Kn(s,nr(a,s)),o,o&&o.lastId,l,l&&l.id,t,null,new $o(n)),o.integrate(e,0)}}})),u()},Hr=()=>Ke("Length exceeded!"),$r=(e,t,n,r)=>{if(n>t._length)throw Hr();if(0===n)return t._searchMarker&&Nr(t._searchMarker,n,r.length),Vr(e,t,null,r);const o=n,i=Rr(t,n);let s=t._start;for(null!==i&&(s=i.p,0==(n-=i.index)&&(s=s.prev,n+=s&&s.countable&&!s.deleted?s.length:0));null!==s;s=s.right)if(!s.deleted&&s.countable){if(n<=s.length){n{if(0===r)return;const o=n,i=r,s=Rr(t,n);let a=t._start;for(null!==s&&(a=s.p,n-=s.index);null!==a&&n>0;a=a.right)!a.deleted&&a.countable&&(n0&&null!==a;)a.deleted||(r0)throw Hr();t._searchMarker&&Nr(t._searchMarker,o,-i+r)},Gr=(e,t,n)=>{const r=t._map.get(n);void 0!==r&&r.delete(e)},qr=(e,t,n,r)=>{const o=t._map.get(n)||null,i=e.doc,s=i.clientID;let a;if(null==r)a=new Do([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:a=new Do([r]);break;case Uint8Array:a=new Eo(r);break;case Sn:a=new To(r);break;default:if(!(r instanceof Mr))throw new Error("Unexpected content type");a=new $o(r)}new Go(Kn(s,nr(i.store,s)),o,o&&o.lastId,null,null,t,n,a).integrate(e,0)},Kr=(e,t)=>{const n=e._map.get(t);return void 0===n||n.deleted?void 0:n.content.getContent()[n.length-1]},Yr=e=>{const t={};return e._map.forEach(((e,n)=>{e.deleted||(t[n]=e.content.getContent()[e.length-1])})),t},Jr=(e,t)=>{const n=e._map.get(t);return void 0!==n&&!n.deleted},Xr=e=>{return t=e.entries(),hn((()=>{let e;do{e=t.next()}while(!e.done&&e.value[1].deleted);return e}));var t};class Zr extends Er{constructor(e,t){super(e,t),this._transaction=t}}class Qr extends Mr{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const t=new Qr;return t.push(e),t}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Qr}clone(){const e=new Qr;return e.insert(0,this.toArray().map((e=>e instanceof Mr?e.clone():e))),e}get length(){return null===this._prelimContent?this._length:this._prelimContent.length}_callObserver(e,t){super._callObserver(e,t),Dr(this,e,new Zr(this,e))}insert(e,t){null!==this.doc?mr(this.doc,(n=>{$r(n,this,e,t)})):this._prelimContent.splice(e,0,...t)}push(e){null!==this.doc?mr(this.doc,(t=>{((e,t,n)=>{let r=(t._searchMarker||[]).reduce(((e,t)=>t.index>e.index?t:e),{index:0,p:t._start}).p;if(r)for(;r.right;)r=r.right;Vr(e,t,r,n)})(t,this,e)})):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,t=1){null!==this.doc?mr(this.doc,(n=>{Wr(n,this,e,t)})):this._prelimContent.splice(e,t)}get(e){return Ur(this,e)}toArray(){return Or(this)}slice(e=0,t=this.length){return Pr(this,e,t)}toJSON(){return this.map((e=>e instanceof Mr?e.toJSON():e))}map(e){return Fr(this,e)}forEach(e){Lr(this,e)}[Symbol.iterator](){return zr(this)}_write(e){e.writeTypeRef(Oo)}}class eo extends Er{constructor(e,t,n){super(e,t),this.keysChanged=n}}class to extends Mr{constructor(e){super(),this._prelimContent=null,this._prelimContent=void 0===e?new Map:new Map(e)}_integrate(e,t){super._integrate(e,t),this._prelimContent.forEach(((e,t)=>{this.set(t,e)})),this._prelimContent=null}_copy(){return new to}clone(){const e=new to;return this.forEach(((t,n)=>{e.set(n,t instanceof Mr?t.clone():t)})),e}_callObserver(e,t){Dr(this,e,new eo(this,e,t))}toJSON(){const e={};return this._map.forEach(((t,n)=>{if(!t.deleted){const r=t.content.getContent()[t.length-1];e[n]=r instanceof Mr?r.toJSON():r}})),e}get size(){return[...Xr(this._map)].length}keys(){return pn(Xr(this._map),(e=>e[0]))}values(){return pn(Xr(this._map),(e=>e[1].content.getContent()[e[1].length-1]))}entries(){return pn(Xr(this._map),(e=>[e[0],e[1].content.getContent()[e[1].length-1]]))}forEach(e){this._map.forEach(((t,n)=>{t.deleted||e(t.content.getContent()[t.length-1],n,this)}))}[Symbol.iterator](){return this.entries()}delete(e){null!==this.doc?mr(this.doc,(t=>{Gr(t,this,e)})):this._prelimContent.delete(e)}set(e,t){return null!==this.doc?mr(this.doc,(n=>{qr(n,this,e,t)})):this._prelimContent.set(e,t),t}get(e){return Kr(this,e)}has(e){return Jr(this,e)}clear(){null!==this.doc?mr(this.doc,(e=>{this.forEach((function(t,n,r){Gr(e,r,n)}))})):this._prelimContent.clear()}_write(e){e.writeTypeRef(Lo)}}const no=(e,t)=>e===t||"object"==typeof e&&"object"==typeof t&&e&&t&&((e,t)=>e===t||St(e)===St(t)&&((e,t)=>{for(const n in e)if(!t(e[n],n))return!1;return!0})(e,((e,n)=>(void 0!==e||At(t,n))&&t[n]===e)))(e,t);class ro{constructor(e,t,n,r){this.left=e,this.right=t,this.index=n,this.currentAttributes=r}forward(){null===this.right&&Je(),this.right.content.constructor===Ro?this.right.deleted||ao(this.currentAttributes,this.right.content):this.right.deleted||(this.index+=this.right.length),this.left=this.right,this.right=this.right.right}}const oo=(e,t,n)=>{for(;null!==t.right&&n>0;)t.right.content.constructor===Ro?t.right.deleted||ao(t.currentAttributes,t.right.content):t.right.deleted||(n{const o=new Map,i=r?Rr(t,n):null;if(i){const t=new ro(i.p.left,i.p,i.index,o);return oo(e,t,n-i.index)}{const r=new ro(null,t._start,0,o);return oo(e,r,n)}},so=(e,t,n,r)=>{for(;null!==n.right&&(!0===n.right.deleted||n.right.content.constructor===Ro&&no(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();const o=e.doc,i=o.clientID;r.forEach(((r,s)=>{const a=n.left,l=n.right,c=new Go(Kn(i,nr(o.store,i)),a,a&&a.lastId,l,l&&l.id,t,null,new Ro(s,r));c.integrate(e,0),n.right=c,n.forward()}))},ao=(e,t)=>{const{key:n,value:r}=t;null===r?e.delete(n):e.set(n,r)},lo=(e,t)=>{for(;null!==e.right&&(e.right.deleted||e.right.content.constructor===Ro&&no(t[e.right.content.key]||null,e.right.content.value));)e.forward()},co=(e,t,n,r)=>{const o=e.doc,i=o.clientID,s=new Map;for(const a in r){const l=r[a],c=n.currentAttributes.get(a)||null;if(!no(c,l)){s.set(a,c);const{left:r,right:u}=n;n.right=new Go(Kn(i,nr(o.store,i)),r,r&&r.lastId,u,u&&u.id,t,null,new Ro(a,l)),n.right.integrate(e,0),n.forward()}}return s},uo=(e,t,n,r,o)=>{n.currentAttributes.forEach(((e,t)=>{void 0===o[t]&&(o[t]=null)}));const i=e.doc,s=i.clientID;lo(n,o);const a=co(e,t,n,o),l=r.constructor===String?new Mo(r):r instanceof Mr?new $o(r):new Bo(r);let{left:c,right:u,index:d}=n;t._searchMarker&&Nr(t._searchMarker,n.index,l.getLength()),u=new Go(Kn(s,nr(i.store,s)),c,c&&c.lastId,u,u&&u.id,t,null,l),u.integrate(e,0),n.right=u,n.index=d,n.forward(),so(e,t,n,a)},ho=(e,t,n,r,o)=>{const i=e.doc,s=i.clientID;lo(n,o);const a=co(e,t,n,o);e:for(;null!==n.right&&(r>0||a.size>0&&(n.right.deleted||n.right.content.constructor===Ro));){if(!n.right.deleted)switch(n.right.content.constructor){case Ro:{const{key:t,value:i}=n.right.content,s=o[t];if(void 0!==s){if(no(s,i))a.delete(t);else{if(0===r)break e;a.set(t,i)}n.right.delete(e)}else n.currentAttributes.set(t,i);break}default:r0){let o="";for(;r>0;r--)o+="\n";n.right=new Go(Kn(s,nr(i.store,s)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new Mo(o)),n.right.integrate(e,0),n.forward()}so(e,t,n,a)},po=(e,t,n,r,o)=>{let i=t;const s=ee();for(;i&&(!i.countable||i.deleted);){if(!i.deleted&&i.content.constructor===Ro){const e=i.content;s.set(e.key,e)}i=i.right}let a=0,l=!1;for(;t!==i;){if(n===t&&(l=!0),!t.deleted){const n=t.content;switch(n.constructor){case Ro:{const{key:i,value:c}=n,u=r.get(i)||null;s.get(i)===n&&u!==c||(t.delete(e),a++,l||(o.get(i)||null)!==c||u===c||(null===u?o.delete(i):o.set(i,u))),l||t.deleted||ao(o,n);break}}}t=t.right}return a},fo=e=>{let t=0;return mr(e.doc,(n=>{let r=e._start,o=e._start,i=ee();const s=te(i);for(;o;)!1===o.deleted&&(o.content.constructor===Ro?ao(s,o.content):(t+=po(n,r,o,i,s),i=te(s),r=o)),o=o.right})),t},mo=e=>{const t=new Set,n=e.doc;for(const[r,o]of e.afterState.entries()){const i=e.beforeState.get(r)||0;o!==i&&cr(e,n.store.clients.get(r),i,o,(e=>{e.deleted||e.content.constructor!==Ro||e.constructor===Ao||t.add(e.parent)}))}mr(n,(n=>{gn(e,e.deleteSet,(e=>{if(e instanceof Ao||!e.parent._hasFormatting||t.has(e.parent))return;const r=e.parent;e.content.constructor===Ro?t.add(r):((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===Ro){const r=t.content.key;n.has(r)?t.delete(e):n.add(r)}t=t.left}})(n,e)}));for(const e of t)fo(e)}))},go=(e,t,n)=>{const r=n,o=te(t.currentAttributes),i=t.right;for(;n>0&&null!==t.right;){if(!1===t.right.deleted)switch(t.right.content.constructor){case $o:case Bo:case Mo:n{null===e?this.childListChanged=!0:this.keysChanged.add(e)}))}get changes(){if(null===this._changes){const e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(null===this._delta){const e=this.target.doc,t=[];mr(e,(e=>{const n=new Map,r=new Map;let o=this.target._start,i=null;const s={};let a="",l=0,c=0;const u=()=>{if(null!==i){let e=null;switch(i){case"delete":c>0&&(e={delete:c}),c=0;break;case"insert":("object"==typeof a||a.length>0)&&(e={insert:a},n.size>0&&(e.attributes={},n.forEach(((t,n)=>{null!==t&&(e.attributes[n]=t)})))),a="";break;case"retain":l>0&&(e={retain:l},(e=>{for(const t in e)return!1;return!0})(s)||(e.attributes=kt({},s))),l=0}e&&t.push(e),i=null}};for(;null!==o;){switch(o.content.constructor){case $o:case Bo:this.adds(o)?this.deletes(o)||(u(),i="insert",a=o.content.getContent()[0],u()):this.deletes(o)?("delete"!==i&&(u(),i="delete"),c+=1):o.deleted||("retain"!==i&&(u(),i="retain"),l+=1);break;case Mo:this.adds(o)?this.deletes(o)||("insert"!==i&&(u(),i="insert"),a+=o.content.str):this.deletes(o)?("delete"!==i&&(u(),i="delete"),c+=o.length):o.deleted||("retain"!==i&&(u(),i="retain"),l+=o.length);break;case Ro:{const{key:t,value:a}=o.content;if(this.adds(o)){if(!this.deletes(o)){const l=n.get(t)||null;no(l,a)?null!==a&&o.delete(e):("retain"===i&&u(),no(a,r.get(t)||null)?delete s[t]:s[t]=a)}}else if(this.deletes(o)){r.set(t,a);const e=n.get(t)||null;no(e,a)||("retain"===i&&u(),s[t]=e)}else if(!o.deleted){r.set(t,a);const n=s[t];void 0!==n&&(no(n,a)?null!==n&&o.delete(e):("retain"===i&&u(),null===a?delete s[t]:s[t]=a))}o.deleted||("insert"===i&&u(),ao(n,o.content));break}}o=o.right}for(u();t.length>0;){const e=t[t.length-1];if(void 0===e.retain||void 0!==e.attributes)break;t.pop()}})),this._delta=t}return this._delta}}class vo extends Mr{constructor(e){super(),this._pending=void 0!==e?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this._length}_integrate(e,t){super._integrate(e,t);try{this._pending.forEach((e=>e()))}catch(e){console.error(e)}this._pending=null}_copy(){return new vo}clone(){const e=new vo;return e.applyDelta(this.toDelta()),e}_callObserver(e,t){super._callObserver(e,t);const n=new bo(this,e,t);Dr(this,e,n),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){let e="",t=this._start;for(;null!==t;)!t.deleted&&t.countable&&t.content.constructor===Mo&&(e+=t.content.str),t=t.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:t=!0}={}){null!==this.doc?mr(this.doc,(n=>{const r=new ro(null,this._start,0,new Map);for(let o=0;o0)&&uo(n,this,r,s,i.attributes||{})}else void 0!==i.retain?ho(n,this,r,i.retain,i.attributes||{}):void 0!==i.delete&&go(n,r,i.delete)}})):this._pending.push((()=>this.applyDelta(e)))}toDelta(e,t,n){const r=[],o=new Map,i=this.doc;let s="",a=this._start;function l(){if(s.length>0){const e={};let t=!1;o.forEach(((n,r)=>{t=!0,e[r]=n}));const n={insert:s};t&&(n.attributes=e),r.push(n),s=""}}const c=()=>{for(;null!==a;){if(Jn(a,e)||void 0!==t&&Jn(a,t))switch(a.content.constructor){case Mo:{const r=o.get("ychange");void 0===e||Jn(a,e)?void 0===t||Jn(a,t)?void 0!==r&&(l(),o.delete("ychange")):void 0!==r&&r.user===a.id.client&&"added"===r.type||(l(),o.set("ychange",n?n("added",a.id):{type:"added"})):void 0!==r&&r.user===a.id.client&&"removed"===r.type||(l(),o.set("ychange",n?n("removed",a.id):{type:"removed"})),s+=a.content.str;break}case $o:case Bo:{l();const e={insert:a.content.getContent()[0]};if(o.size>0){const t={};e.attributes=t,o.forEach(((e,n)=>{t[n]=e}))}r.push(e);break}case Ro:Jn(a,e)&&(l(),ao(o,a.content))}a=a.right}l()};return e||t?mr(i,(n=>{e&&Xn(n,e),t&&Xn(n,t),c()}),"cleanup"):c(),r}insert(e,t,n){if(t.length<=0)return;const r=this.doc;null!==r?mr(r,(r=>{const o=io(r,this,e,!n);n||(n={},o.currentAttributes.forEach(((e,t)=>{n[t]=e}))),uo(r,this,o,t,n)})):this._pending.push((()=>this.insert(e,t,n)))}insertEmbed(e,t,n){const r=this.doc;null!==r?mr(r,(r=>{const o=io(r,this,e,!n);uo(r,this,o,t,n||{})})):this._pending.push((()=>this.insertEmbed(e,t,n||{})))}delete(e,t){if(0===t)return;const n=this.doc;null!==n?mr(n,(n=>{go(n,io(n,this,e,!0),t)})):this._pending.push((()=>this.delete(e,t)))}format(e,t,n){if(0===t)return;const r=this.doc;null!==r?mr(r,(r=>{const o=io(r,this,e,!1);null!==o.right&&ho(r,this,o,t,n)})):this._pending.push((()=>this.format(e,t,n)))}removeAttribute(e){null!==this.doc?mr(this.doc,(t=>{Gr(t,this,e)})):this._pending.push((()=>this.removeAttribute(e)))}setAttribute(e,t){null!==this.doc?mr(this.doc,(n=>{qr(n,this,e,t)})):this._pending.push((()=>this.setAttribute(e,t)))}getAttribute(e){return Kr(this,e)}getAttributes(){return Yr(this)}_write(e){e.writeTypeRef(Fo)}}class yo{constructor(e,t=(()=>!0)){this._filter=t,this._root=e,this._currentNode=e._start,this._firstCall=!0}[Symbol.iterator](){return this}next(){let e=this._currentNode,t=e&&e.content&&e.content.type;if(null!==e&&(!this._firstCall||e.deleted||!this._filter(t)))do{if(t=e.content.type,e.deleted||t.constructor!==xo&&t.constructor!==_o||null===t._start)for(;null!==e;){if(null!==e.right){e=e.right;break}e=e.parent===this._root?null:e.parent._item}else e=t._start}while(null!==e&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,null===e?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}}class _o extends Mr{constructor(){super(),this._prelimContent=[]}get firstChild(){const e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new _o}clone(){const e=new _o;return e.insert(0,this.toArray().map((e=>e instanceof Mr?e.clone():e))),e}get length(){return null===this._prelimContent?this._length:this._prelimContent.length}createTreeWalker(e){return new yo(this,e)}querySelector(e){e=e.toUpperCase();const t=new yo(this,(t=>t.nodeName&&t.nodeName.toUpperCase()===e)).next();return t.done?null:t.value}querySelectorAll(e){return e=e.toUpperCase(),se(new yo(this,(t=>t.nodeName&&t.nodeName.toUpperCase()===e)))}_callObserver(e,t){Dr(this,e,new wo(this,t,e))}toString(){return Fr(this,(e=>e.toString())).join("")}toJSON(){return this.toString()}toDOM(e=document,t={},n){const r=e.createDocumentFragment();return void 0!==n&&n._createAssociation(r,this),Lr(this,(o=>{r.insertBefore(o.toDOM(e,t,n),null)})),r}insert(e,t){null!==this.doc?mr(this.doc,(n=>{$r(n,this,e,t)})):this._prelimContent.splice(e,0,...t)}insertAfter(e,t){if(null!==this.doc)mr(this.doc,(n=>{const r=e&&e instanceof Mr?e._item:e;Vr(n,this,r,t)}));else{const n=this._prelimContent,r=null===e?0:n.findIndex((t=>t===e))+1;if(0===r&&null!==e)throw Ke("Reference item not found");n.splice(r,0,...t)}}delete(e,t=1){null!==this.doc?mr(this.doc,(n=>{Wr(n,this,e,t)})):this._prelimContent.splice(e,t)}toArray(){return Or(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return Ur(this,e)}slice(e=0,t=this.length){return Pr(this,e,t)}forEach(e){Lr(this,e)}_write(e){e.writeTypeRef(Uo)}}class xo extends _o{constructor(e="UNDEFINED"){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,t){super._integrate(e,t),this._prelimAttrs.forEach(((e,t)=>{this.setAttribute(t,e)})),this._prelimAttrs=null}_copy(){return new xo(this.nodeName)}clone(){const e=new xo(this.nodeName);return((e,t)=>{for(const n in e)t(e[n],n)})(this.getAttributes(),((t,n)=>{"string"==typeof t&&e.setAttribute(n,t)})),e.insert(0,this.toArray().map((e=>e instanceof Mr?e.clone():e))),e}toString(){const e=this.getAttributes(),t=[],n=[];for(const t in e)n.push(t);n.sort();const r=n.length;for(let o=0;o0?" "+t.join(" "):""}>${super.toString()}${o}>`}removeAttribute(e){null!==this.doc?mr(this.doc,(t=>{Gr(t,this,e)})):this._prelimAttrs.delete(e)}setAttribute(e,t){null!==this.doc?mr(this.doc,(n=>{qr(n,this,e,t)})):this._prelimAttrs.set(e,t)}getAttribute(e){return Kr(this,e)}hasAttribute(e){return Jr(this,e)}getAttributes(e){return e?((e,t)=>{const n={};return this._map.forEach(((e,r)=>{let o=e;for(;null!==o&&(!t.sv.has(o.id.client)||o.id.clock>=(t.sv.get(o.id.client)||0));)o=o.left;null!==o&&Jn(o,t)&&(n[r]=o.content.getContent()[o.length-1])})),n})(0,e):Yr(this)}toDOM(e=document,t={},n){const r=e.createElement(this.nodeName),o=this.getAttributes();for(const e in o){const t=o[e];"string"==typeof t&&r.setAttribute(e,t)}return Lr(this,(o=>{r.appendChild(o.toDOM(e,t,n))})),void 0!==n&&n._createAssociation(r,this),r}_write(e){e.writeTypeRef(zo),e.writeKey(this.nodeName)}}class wo extends Er{constructor(e,t,n){super(e,n),this.childListChanged=!1,this.attributesChanged=new Set,t.forEach((e=>{null===e?this.childListChanged=!0:this.attributesChanged.add(e)}))}}class ko extends to{constructor(e){super(),this.hookName=e}_copy(){return new ko(this.hookName)}clone(){const e=new ko(this.hookName);return this.forEach(((t,n)=>{e.set(n,t)})),e}toDOM(e=document,t={},n){const r=t[this.hookName];let o;return o=void 0!==r?r.createDom(this):document.createElement(this.hookName),o.setAttribute("data-yjs-hook",this.hookName),void 0!==n&&n._createAssociation(o,this),o}_write(e){e.writeTypeRef(Vo),e.writeKey(this.hookName)}}class Co extends vo{get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new Co}clone(){const e=new Co;return e.applyDelta(this.toDelta()),e}toDOM(e=document,t,n){const r=e.createTextNode(this.toString());return void 0!==n&&n._createAssociation(r,this),r}toString(){return this.toDelta().map((e=>{const t=[];for(const n in e.attributes){const r=[];for(const t in e.attributes[n])r.push({key:t,value:e.attributes[n][t]});r.sort(((e,t)=>e.keye.nodeName"}n+=e.insert;for(let e=t.length-1;e>=0;e--)n+=`${t[e].nodeName}>`;return n})).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(Ho)}}class So{constructor(e,t){this.id=e,this.length=t}get deleted(){throw Ye()}mergeWith(e){return!1}write(e,t,n){throw Ye()}integrate(e,t){throw Ye()}}class Ao extends So{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor&&(this.length+=e.length,!0)}integrate(e,t){t>0&&(this.id.clock+=t,this.length-=t),rr(e.doc.store,this)}write(e,t){e.writeInfo(0),e.writeLen(this.length-t)}getMissing(e,t){return null}}class Eo{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new Eo(this.content)}splice(e){throw Ye()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeBuf(this.content)}getRef(){return 3}}class Io{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new Io(this.len)}splice(e){const t=new Io(this.len-e);return this.len=e,t}mergeWith(e){return this.len+=e.len,!0}integrate(e,t){yn(e.deleteSet,t.id.client,t.id.clock,this.len),t.markDeleted()}delete(e){}gc(e){}write(e,t){e.writeLen(this.len-t)}getRef(){return 1}}const jo=(e,t)=>new Sn({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1});class To{constructor(e){e._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=e;const t={};this.opts=t,e.gc||(t.gc=!1),e.autoLoad&&(t.autoLoad=!0),null!==e.meta&&(t.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new To(jo(this.doc.guid,this.opts))}splice(e){throw Ye()}mergeWith(e){return!1}integrate(e,t){this.doc._item=t,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,t){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}}class Bo{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new Bo(this.embed)}splice(e){throw Ye()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeJSON(this.embed)}getRef(){return 5}}class Ro{constructor(e,t){this.key=e,this.value=t}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new Ro(this.key,this.value)}splice(e){throw Ye()}mergeWith(e){return!1}integrate(e,t){const n=t.parent;n._searchMarker=null,n._hasFormatting=!0}delete(e){}gc(e){}write(e,t){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}}class No{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new No(this.arr)}splice(e){const t=new No(this.arr.slice(e));return this.arr=this.arr.slice(0,e),t}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){const n=this.arr.length;e.writeLen(n-t);for(let r=t;r=55296&&n<=56319&&(this.str=this.str.slice(0,e-1)+"�",t.str="�"+t.str.slice(1)),t}mergeWith(e){return this.str+=e.str,!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeString(0===t?this.str:this.str.slice(t))}getRef(){return 4}}const Po=[e=>new Qr,e=>new to,e=>new vo,e=>new xo(e.readKey()),e=>new _o,e=>new ko(e.readKey()),e=>new Co],Oo=0,Lo=1,Fo=2,zo=3,Uo=4,Vo=5,Ho=6;class $o{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new $o(this.type._copy())}splice(e){throw Ye()}mergeWith(e){return!1}integrate(e,t){this.type._integrate(e.doc,t)}delete(e){let t=this.type._start;for(;null!==t;)t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e),t=t.right;this.type._map.forEach((t=>{t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e)})),e.changed.delete(this.type)}gc(e){let t=this.type._start;for(;null!==t;)t.gc(e,!0),t=t.right;this.type._start=null,this.type._map.forEach((t=>{for(;null!==t;)t.gc(e,!0),t=t.left})),this.type._map=new Map}write(e,t){this.type._write(e)}getRef(){return 7}}const Wo=(e,t,n)=>{const{client:r,clock:o}=t.id,i=new Go(Kn(r,o+n),t,Kn(r,o+n-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(n));return t.deleted&&i.markDeleted(),t.keep&&(i.keep=!0),null!==t.redone&&(i.redone=Kn(t.redone.client,t.redone.clock+n)),t.right=i,null!==i.right&&(i.right.left=i),e._mergeStructs.push(i),null!==i.parentSub&&null===i.right&&i.parent._map.set(i.parentSub,i),t.length=n,i};class Go extends So{constructor(e,t,n,r,o,i,s,a){super(e,a.getLength()),this.origin=n,this.left=t,this.right=r,this.rightOrigin=o,this.parent=i,this.parentSub=s,this.redone=null,this.content=a,this.info=this.content.isCountable()?2:0}set marker(e){(8&this.info)>0!==e&&(this.info^=8)}get marker(){return(8&this.info)>0}get keep(){return(1&this.info)>0}set keep(e){this.keep!==e&&(this.info^=1)}get countable(){return(2&this.info)>0}get deleted(){return(4&this.info)>0}set deleted(e){this.deleted!==e&&(this.info^=4)}markDeleted(){this.info|=4}getMissing(e,t){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=nr(t,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=nr(t,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===Gn&&this.id.client!==this.parent.client&&this.parent.clock>=nr(t,this.parent.client))return this.parent.client;if(this.origin&&(this.left=lr(e,t,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=ar(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===Ao||this.right&&this.right.constructor===Ao)this.parent=null;else if(this.parent){if(this.parent.constructor===Gn){const e=ir(t,this.parent);e.constructor===Ao?this.parent=null:this.parent=e.content.type}}else this.left&&this.left.constructor===Go&&(this.parent=this.left.parent,this.parentSub=this.left.parentSub),this.right&&this.right.constructor===Go&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);return null}integrate(e,t){if(t>0&&(this.id.clock+=t,this.left=lr(e,e.doc.store,Kn(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(t),this.length-=t),this.parent){if(!this.left&&(!this.right||null!==this.right.left)||this.left&&this.left.right!==this.right){let t,n=this.left;if(null!==n)t=n.right;else if(null!==this.parentSub)for(t=this.parent._map.get(this.parentSub)||null;null!==t&&null!==t.left;)t=t.left;else t=this.parent._start;const r=new Set,o=new Set;for(;null!==t&&t!==this.right;){if(o.add(t),r.add(t),qn(this.origin,t.origin)){if(t.id.client{t.p===e&&(t.p=this,!this.deleted&&this.countable&&(t.index-=this.length))})),e.keep&&(this.keep=!0),this.right=e.right,null!==this.right&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){const t=this.parent;this.countable&&null===this.parentSub&&(t._length-=this.length),this.markDeleted(),yn(e.deleteSet,this.id.client,this.id.clock,this.length),hr(e,t,this.parentSub),this.content.delete(e)}}gc(e,t){if(!this.deleted)throw Je();this.content.gc(e),t?((e,t,n)=>{const r=e.clients.get(t.id.client);r[or(r,t.id.clock)]=n})(e,this,new Ao(this.id,this.length)):this.content=new Io(this.length)}write(e,t){const n=t>0?Kn(this.id.client,this.id.clock+t-1):this.origin,r=this.rightOrigin,o=this.parentSub,i=31&this.content.getRef()|(null===n?0:ge)|(null===r?0:me)|(null===o?0:32);if(e.writeInfo(i),null!==n&&e.writeLeftID(n),null!==r&&e.writeRightID(r),null===n&&null===r){const t=this.parent;if(void 0!==t._item){const n=t._item;if(null===n){const n=(e=>{for(const[t,n]of e.doc.share.entries())if(n===e)return t;throw Je()})(t);e.writeParentInfo(!0),e.writeString(n)}else e.writeParentInfo(!1),e.writeLeftID(n.id)}else t.constructor===String?(e.writeParentInfo(!0),e.writeString(t)):t.constructor===Gn?(e.writeParentInfo(!1),e.writeLeftID(t)):Je();null!==o&&e.writeString(o)}this.content.write(e,t)}}const qo=(e,t)=>Ko[31&t](e),Ko=[()=>{Je()},e=>new Io(e.readLen()),e=>{const t=e.readLen(),n=[];for(let r=0;rnew Eo(e.readBuf()),e=>new Mo(e.readString()),e=>new Bo(e.readJSON()),e=>new Ro(e.readKey(),e.readJSON()),e=>new $o(Po[e.readTypeRef()](e)),e=>{const t=e.readLen(),n=[];for(let r=0;rnew To(jo(e.readString(),e.readAny())),()=>{Je()}];class Yo extends So{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor&&(this.length+=e.length,!0)}integrate(e,t){Je()}write(e,t){e.writeInfo(10),Re(e.restEncoder,this.length-t)}getMissing(e,t){return null}}const Jo="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},Xo="__ $YJS$ __";!0===Jo[Xo]&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438"),Jo[Xo]=!0;const Zo=(e,t)=>{const n={},r={},o={};return{register:function(e,t){n[e]=t},bootstrap:async function(i,s,a){const l=new Sn;o[i]=o[i]||{},o[i][s]=l;const c=()=>{const e=n[i].fromCRDTDoc(l);a(e)};l.on("update",c);const u=await e(s,i,l);t&&await t(s,i,l);const d=n[i].fetch;d&&d(s).then((e=>{l.transact((()=>{n[i].applyChangesToDoc(l,e)}))})),r[i]=r[i]||{},r[i][s]=()=>{u(),l.off("update",c)}},update:async function(e,t,r){const i=o[e][t];if(!i)throw"Error doc "+e+" "+t+" not found";i.transact((()=>{n[e].applyChangesToDoc(i,r)}))},discard:async function(e,t){r?.[e]?.[t]&&r[e][t]()}}},Qo=e=>vt(((t,n)=>{e.onerror=e=>n(new Error(e.target.error)),e.onsuccess=e=>t(e.target.result)})),ei=(e,t,n="readwrite")=>{const r=e.transaction(t,n);return t.map((e=>ii(r,e)))},ti=(e,t)=>Qo(e.count(t)),ni=(e,t)=>Qo(e.delete(t)),ri=(e,t)=>Qo(e.add(t)),oi=(e,t,n,r="next")=>((e,t)=>vt(((n,r)=>{e.onerror=r,e.onsuccess=async e=>{const r=e.target.result;if(null===r||!1===await t(r))return n();r.continue()}})))(e.openKeyCursor(t,r),(e=>n(e.key))),ii=(e,t)=>e.objectStore(t),si="custom",ai="updates",li=(e,t=(()=>{}),n=(()=>{}))=>{const[r]=ei(e.db,[ai]);return((e,t,n)=>Qo(e.getAll(t,n)))(r,(o=e._dbref,IDBKeyRange.lowerBound(o,false))).then((o=>{e._destroyed||(t(r),mr(e.doc,(()=>{o.forEach((t=>Pn(e.doc,t)))}),e,!1),n(r))})).then((()=>((e,t=null)=>((e,t,n)=>{let r=null;return oi(e,t,(e=>(r=e,!1)),n).then((()=>r))})(e,t,"prev"))(r).then((t=>{e._dbref=t+1})))).then((()=>ti(r).then((t=>{e._dbsize=t})))).then((()=>r));var o};class ci extends le{constructor(e,t){super(),this.doc=t,this.name=e,this._dbref=0,this._dbsize=0,this._destroyed=!1,this.db=null,this.synced=!1,this._db=((e,t)=>vt(((t,n)=>{const r=indexedDB.open(e);r.onupgradeneeded=e=>((e,t)=>[["updates",{autoIncrement:!0}],["custom"]].forEach((t=>e.createObjectStore.apply(e,t))))(e.target.result),r.onerror=e=>n(Ke(e.target.error)),r.onsuccess=e=>{const n=e.target.result;n.onversionchange=()=>{n.close()},t(n)}})))(e),this.whenSynced=vt((e=>this.on("synced",(()=>e(this))))),this._db.then((e=>{this.db=e,li(this,(e=>ri(e,Ln(t))),(()=>{if(this._destroyed)return this;this.synced=!0,this.emit("synced",[this])}))})),this._storeTimeout=1e3,this._storeTimeoutId=null,this._storeUpdate=(e,t)=>{if(this.db&&t!==this){const[t]=ei(this.db,[ai]);ri(t,e),++this._dbsize>=500&&(null!==this._storeTimeoutId&&clearTimeout(this._storeTimeoutId),this._storeTimeoutId=setTimeout((()=>{((e,t=!0)=>{li(e).then((n=>{(t||e._dbsize>=500)&&ri(n,Ln(e.doc)).then((()=>{return ni(n,(t=e._dbref,IDBKeyRange.upperBound(t,!0)));var t})).then((()=>ti(n).then((t=>{e._dbsize=t}))))}))})(this,!1),this._storeTimeoutId=null}),this._storeTimeout))}},t.on("update",this._storeUpdate),this.destroy=this.destroy.bind(this),t.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((e=>{e.close()}))}clearData(){return this.destroy().then((()=>{(e=>{Qo(indexedDB.deleteDatabase(e))})(this.name)}))}get(e){return this._db.then((t=>{const[n]=ei(t,[si],"readonly");return((e,t)=>Qo(e.get(t)))(n,e)}))}set(e,t){return this._db.then((n=>{const[r]=ei(n,[si]);return((e,t,n)=>Qo(e.put(t,n)))(r,t,e)}))}del(e){return this._db.then((t=>{const[n]=ei(t,[si]);return ni(n,e)}))}}function ui(e,t,n){const r=new ci(`${t}-${e}`,n);return new Promise((e=>{r.on("synced",(()=>{e((()=>r.destroy()))}))}))}const di=e=>{if(e.shouldConnect&&null===e.ws){const t=new WebSocket(e.url),n=e.binaryType;let r=null;n&&(t.binaryType=n),e.ws=t,e.connecting=!0,e.connected=!1,t.onmessage=t=>{e.lastMessageReceived=Kt();const n=t.data,o="string"==typeof n?JSON.parse(n):n;o&&"pong"===o.type&&(clearTimeout(r),r=setTimeout(i,15e3)),e.emit("message",[o,e])};const o=t=>{null!==e.ws&&(e.ws=null,e.connecting=!1,e.connected?(e.connected=!1,e.emit("disconnect",[{type:"disconnect",error:t},e])):e.unsuccessfulReconnects++,setTimeout(di,he(1200*de(e.unsuccessfulReconnects+1),2500),e)),clearTimeout(r)},i=()=>{e.ws===t&&e.send({type:"ping"})};t.onclose=()=>o(null),t.onerror=e=>o(e),t.onopen=()=>{e.lastMessageReceived=Kt(),e.connecting=!1,e.connected=!0,e.unsuccessfulReconnects=0,e.emit("connect",[{type:"connect"},e]),r=setTimeout(i,15e3)}}};class hi extends le{constructor(e,{binaryType:t}={}){super(),this.url=e,this.ws=null,this.binaryType=t||null,this.connected=!1,this.connecting=!1,this.unsuccessfulReconnects=0,this.lastMessageReceived=0,this.shouldConnect=!0,this._checkInterval=setInterval((()=>{this.connected&&3e4t.key===e&&null!==this.onmessage&&this.onmessage({data:Ut(t.newValue||"")}),t=this._onChange,xt||addEventListener("storage",t)}postMessage(e){wt.setItem(this.room,zt(new Uint8Array(e)))}close(){var e;e=this._onChange,xt||removeEventListener("storage",e)}}:BroadcastChannel,mi=e=>ne(pi,e,(()=>{const t=re(),n=new fi(e);return n.onmessage=e=>t.forEach((t=>t(e.data,"broadcastchannel"))),{bc:n,subs:t}}));var gi=n(39239),bi=n.n(gi);const vi=(e,t)=>{Re(e,0);const n=(e=>((e,t=new Rn)=>(e instanceof Map?zn(t,e):((e,t)=>{zn(e,tr(t.store))})(t,e),t.toUint8Array()))(e,new Tn))(t);Le(e,n)},yi=(e,t,n)=>{Re(e,1),Le(e,Ln(t,n))},_i=(e,t,n)=>{try{Pn(t,tt(e),n)}catch(e){console.error("Caught error while handling a Yjs update",e)}},xi=_i;class wi extends le{constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval((()=>{const e=Kt();null!==this.getLocalState()&&15e3<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const t=[];this.meta.forEach(((n,r)=>{r!==this.clientID&&3e4<=e-n.lastUpdated&&this.states.has(r)&&t.push(r)})),t.length>0&&ki(this,t,"timeout")}),ce(3e3)),e.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(e){const t=this.clientID,n=this.meta.get(t),r=void 0===n?0:n.clock+1,o=this.states.get(t);null===e?this.states.delete(t):this.states.set(t,e),this.meta.set(t,{clock:r,lastUpdated:Kt()});const i=[],s=[],a=[],l=[];null===e?l.push(t):null==o?null!=e&&i.push(t):(s.push(t),Tt(o,e)||a.push(t)),(i.length>0||a.length>0||l.length>0)&&this.emit("change",[{added:i,updated:a,removed:l},"local"]),this.emit("update",[{added:i,updated:s,removed:l},"local"])}setLocalStateField(e,t){const n=this.getLocalState();null!==n&&this.setLocalState({...n,[e]:t})}getStates(){return this.states}}const ki=(e,t,n)=>{const r=[];for(let n=0;n0&&(e.emit("change",[{added:[],updated:[],removed:r},n]),e.emit("update",[{added:[],updated:[],removed:r},n]))},Ci=(e,t,n=e.states)=>{const r=t.length,o=Ie();Re(o,r);for(let i=0;i{if(!t)return yt(e);const n=crypto.getRandomValues(new Uint8Array(12));return crypto.subtle.encrypt({name:"AES-GCM",iv:n},t,e).then((e=>{const t=Ie();return Pe(t,"AES-GCM"),Le(t,n),Le(t,new Uint8Array(e)),je(t)}))},Ai=(e,t)=>{if(!t)return yt(e);const n=et(e);var r;"AES-GCM"!==it(n)&&(r=Ke("Unknown encryption algorithm"),Promise.reject(r));const o=tt(n),i=tt(n);return crypto.subtle.decrypt({name:"AES-GCM",iv:o},t,i).then((e=>new Uint8Array(e)))},Ei=(e,t)=>Ai(e,t).then((e=>lt(et(new Uint8Array(e))))),Ii=((e,t)=>{const n=on[sn],r=Pt("log"),o=null!==r&&("*"===r||"true"===r||new RegExp(r,"gi").test(t));return sn=(sn+1)%on.length,t+=": ",o?(...r)=>{const o=Kt(),i=o-an;an=o,e(n,t,rn,...r.map((e=>"string"==typeof e||"symbol"==typeof e?e:JSON.stringify(e))),n," +"+i+"ms")}:It})(un,"y-webrtc"),ji=new Map,Ti=new Map,Bi=e=>{let t=!0;e.webrtcConns.forEach((e=>{e.synced||(t=!1)})),(!t&&e.synced||t&&!e.synced)&&(e.synced=t,e.provider.emit("synced",[{synced:t}]),Ii("synced ",Yt,e.name,Jt," with all peers"))},Ri=(e,t,n)=>{const r=et(t),o=Ie(),i=rt(r);if(void 0===e)return null;const s=e.awareness,a=e.doc;let l=!1;switch(i){case 0:{Re(o,0);const t=((e,t,n,r)=>{const o=rt(e);switch(o){case 0:((e,t,n)=>{yi(t,n,tt(e))})(e,t,n);break;case 1:_i(e,n,r);break;case 2:xi(e,n,r);break;default:throw new Error("Unknown message type")}return o})(r,o,a,e);1!==t||e.synced||n(),0===t&&(l=!0);break}case 3:Re(o,1),Le(o,Ci(s,Array.from(s.getStates().keys()))),l=!0;break;case 1:((e,t,n)=>{const r=et(t),o=Kt(),i=[],s=[],a=[],l=[],c=rt(r);for(let t=0;t0||a.length>0||l.length>0)&&e.emit("change",[{added:i,updated:a,removed:l},n]),(i.length>0||s.length>0||l.length>0)&&e.emit("update",[{added:i,updated:s,removed:l},n])})(s,tt(r),e);break;case 4:{const t=1===nt(r),n=it(r);if(n!==e.peerId&&(e.bcConns.has(n)&&!t||!e.bcConns.has(n)&&t)){const r=[],o=[];t?(e.bcConns.add(n),o.push(n)):(e.bcConns.delete(n),r.push(n)),e.provider.emit("peers",[{added:o,removed:r,webrtcPeers:Array.from(e.webrtcConns.keys()),bcPeers:Array.from(e.bcConns)}]),Li(e)}break}default:return console.error("Unable to compute message"),o}return l?o:null},Ni=(e,t)=>{Ii("send message to ",Yt,e.remotePeerId,Jt,Zt," (",e.room.name,")",rn);try{e.peer.send(je(t))}catch(e){}};class Di{constructor(e,t,n,r){Ii("establishing connection to ",Yt,n),this.room=r,this.remotePeerId=n,this.glareToken=void 0,this.closed=!1,this.connected=!1,this.synced=!1,this.peer=new(bi())({initiator:t,...r.provider.peerOpts}),this.peer.on("signal",(t=>{void 0===this.glareToken&&(this.glareToken=Date.now()+Math.random()),zi(e,r,{to:n,from:r.peerId,type:"signal",token:this.glareToken,signal:t})})),this.peer.on("connect",(()=>{Ii("connected to ",Yt,n),this.connected=!0;const e=r.provider.doc,t=r.awareness,o=Ie();Re(o,0),vi(o,e),Ni(this,o);const i=t.getStates();if(i.size>0){const e=Ie();Re(e,1),Le(e,Ci(t,Array.from(i.keys()))),Ni(this,e)}})),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)}])),Bi(r),this.peer.destroy(),Ii("closed connection to ",Yt,n),Oi(r)})),this.peer.on("error",(e=>{Ii("Error in connection to ",Yt,n,": ",e),Oi(r)})),this.peer.on("data",(e=>{const t=((e,t)=>{const n=e.room;return Ii("received message from ",Yt,e.remotePeerId,Zt," (",n.name,")",Jt,rn),Ri(n,t,(()=>{e.synced=!0,Ii("synced ",Yt,n.name,Jt," with ",Yt,e.remotePeerId),Bi(n)}))})(this,e);null!==t&&Ni(this,t)}))}destroy(){this.peer.destroy()}}const Mi=(e,t)=>Si(t,e.key).then((t=>e.mux((()=>((e,t,n=null)=>{const r=mi(e);r.bc.postMessage(t),r.subs.forEach((e=>e(t,n)))})(e.name,t))))),Pi=(e,t)=>{e.bcconnected&&Mi(e,t),((e,t)=>{Ii("broadcast message in ",Yt,e.name,Jt),e.webrtcConns.forEach((e=>{try{e.peer.send(t)}catch(e){}}))})(e,t)},Oi=e=>{ji.forEach((t=>{t.connected&&(t.send({type:"subscribe",topics:[e.name]}),e.webrtcConns.size{if(e.provider.filterBcConns){const t=Ie();Re(t,4),Be(t,1),Pe(t,e.peerId),Mi(e,je(t))}};class Fi{constructor(e,t,n,r){this.peerId=bt(),this.doc=e,this.awareness=t.awareness,this.provider=t,this.synced=!1,this.name=n,this.key=r,this.webrtcConns=new Map,this.bcConns=new Set,this.mux=(()=>{let e=!0;return(t,n)=>{if(e){e=!1;try{t()}finally{e=!0}}else void 0!==n&&n()}})(),this.bcconnected=!1,this._bcSubscriber=e=>Ai(new Uint8Array(e),r).then((e=>this.mux((()=>{const t=Ri(this,e,(()=>{}));t&&Mi(this,je(t))})))),this._docUpdateHandler=(e,t)=>{const n=Ie();Re(n,0),((e,t)=>{Re(e,2),Le(e,t)})(n,e),Pi(this,je(n))},this._awarenessUpdateHandler=({added:e,updated:t,removed:n},r)=>{const o=e.concat(t).concat(n),i=Ie();Re(i,1),Le(i,Ci(this.awareness,o)),Pi(this,je(i))},this._beforeUnloadHandler=()=>{ki(this.awareness,[e.clientID],"window unload"),Ti.forEach((e=>{e.disconnect()}))},"undefined"!=typeof window?window.addEventListener("beforeunload",this._beforeUnloadHandler):"undefined"!=typeof process&&process.on("exit",this._beforeUnloadHandler)}connect(){var e,t;this.doc.on("update",this._docUpdateHandler),this.awareness.on("update",this._awarenessUpdateHandler),Oi(this),e=this.name,t=this._bcSubscriber,mi(e).subs.add(t),this.bcconnected=!0,Li(this);const n=Ie();Re(n,0),vi(n,this.doc),Mi(this,je(n));const r=Ie();Re(r,0),yi(r,this.doc),Mi(this,je(r));const o=Ie();Re(o,3),Mi(this,je(o));const i=Ie();Re(i,1),Le(i,Ci(this.awareness,[this.doc.clientID])),Mi(this,je(i))}disconnect(){ji.forEach((e=>{e.connected&&e.send({type:"unsubscribe",topics:[this.name]})})),ki(this.awareness,[this.doc.clientID],"disconnect");const e=Ie();Re(e,4),Be(e,0),Pe(e,this.peerId),Mi(this,je(e)),((e,t)=>{const n=mi(e);n.subs.delete(t)&&0===n.subs.size&&(n.bc.close(),pi.delete(e))})(this.name,this._bcSubscriber),this.bcconnected=!1,this.doc.off("update",this._docUpdateHandler),this.awareness.off("update",this._awarenessUpdateHandler),this.webrtcConns.forEach((e=>e.destroy()))}destroy(){this.disconnect(),"undefined"!=typeof window?window.removeEventListener("beforeunload",this._beforeUnloadHandler):"undefined"!=typeof process&&process.off("exit",this._beforeUnloadHandler)}}const zi=(e,t,n)=>{t.key?((e,t)=>{const n=Ie();return Ue(n,e),Si(je(n),t)})(n,t.key).then((n=>{e.send({type:"publish",topic:t.name,data:zt(n)})})):e.send({type:"publish",topic:t.name,data:n})};class Ui extends hi{constructor(e){super(e),this.providers=new Set,this.on("connect",(()=>{Ii(`connected (${e})`);const t=Array.from(Ti.keys());this.send({type:"subscribe",topics:t}),Ti.forEach((e=>zi(this,e,{type:"announce",from:e.peerId})))})),this.on("message",(e=>{if("publish"===e.type){const t=e.topic,n=Ti.get(t);if(null==n||"string"!=typeof t)return;const r=e=>{const t=n.webrtcConns,r=n.peerId;if(null==e||e.from===r||void 0!==e.to&&e.to!==r||n.bcConns.has(e.from))return;const o=t.has(e.from)?()=>{}:()=>n.provider.emit("peers",[{removed:[],added:[e.from],webrtcPeers:Array.from(n.webrtcConns.keys()),bcPeers:Array.from(n.bcConns)}]);switch(e.type){case"announce":t.sizenew Di(this,!0,e.from,n))),o());break;case"signal":if("offer"===e.signal.type){const n=t.get(e.from);if(n){const t=e.token,r=n.glareToken;if(r&&r>t)return void Ii("offer rejected: ",e.from);n.glareToken=void 0}}"answer"===e.signal.type&&(Ii("offer answered by: ",e.from),t.get(e.from).glareToken=void 0),e.to===r&&(ne(t,e.from,(()=>new Di(this,!1,e.from,n))).peer.signal(e.signal),o())}};n.key?"string"==typeof e.data&&Ei(Ut(e.data),n.key).then(r):r(e.data)}})),this.on("disconnect",(()=>Ii(`disconnect (${e})`)))}}class Vi extends le{constructor(e,t,{signaling:n=["wss://y-webrtc-eu.fly.dev"],password:r=null,awareness:o=new wi(t),maxConns:i=20+ce(15*ft()),filterBcConns:s=!0,peerOpts:a={}}={}){super(),this.roomName=e,this.doc=t,this.filterBcConns=s,this.awareness=o,this.shouldConnect=!1,this.signalingUrls=n,this.signalingConns=[],this.maxConns=i,this.peerOpts=a,this.key=r?((e,t)=>{const n=Se(e).buffer,r=Se(t).buffer;return crypto.subtle.importKey("raw",n,"PBKDF2",!1,["deriveKey"]).then((e=>crypto.subtle.deriveKey({name:"PBKDF2",salt:r,iterations:1e5,hash:"SHA-256"},e,{name:"AES-GCM",length:256},!0,["encrypt","decrypt"])))})(r,e):yt(null),this.room=null,this.key.then((n=>{this.room=((e,t,n,r)=>{if(Ti.has(n))throw Ke(`A Yjs Doc connected to room "${n}" already exists!`);const o=new Fi(e,t,n,r);return Ti.set(n,o),o})(t,this,e,n),this.shouldConnect?this.room.connect():this.room.disconnect()})),this.connect(),this.destroy=this.destroy.bind(this),t.on("destroy",this.destroy)}get connected(){return null!==this.room&&this.shouldConnect}connect(){this.shouldConnect=!0,this.signalingUrls.forEach((e=>{const t=ne(ji,e,(()=>new Ui(e)));this.signalingConns.push(t),t.providers.add(this)})),this.room&&this.room.connect()}disconnect(){this.shouldConnect=!1,this.signalingConns.forEach((e=>{e.providers.delete(this),0===e.providers.size&&(e.destroy(),ji.delete(e.url))})),this.room&&this.room.disconnect()}destroy(){this.doc.off("destroy",this.destroy),this.key.then((()=>{this.room.destroy(),Ti.delete(this.roomName)})),super.destroy()}}function Hi(e){if(e.shouldConnect&&null===e.ws){const t=Math.floor(1e5+9e5*Math.random()),n=e.url,r=new window.EventSource((0,$.F)(n,{subscriber_id:t,action:"gutenberg_signaling_server"}));let o=null;r.onmessage=t=>{e.lastMessageReceived=Date.now();const n=t.data;if(n){const e=JSON.parse(n);Array.isArray(e)&&e.forEach(i)}},e.ws=r,e.connecting=!0,e.connected=!1;const i=t=>{t&&"pong"===t.type&&(clearTimeout(o),o=setTimeout(a,$i/2)),e.emit("message",[t,e])},s=t=>{null!==e.ws&&(e.ws.close(),e.ws=null,e.connecting=!1,e.connected?(e.connected=!1,e.emit("disconnect",[{type:"disconnect",error:t},e])):e.unsuccessfulReconnects++),clearTimeout(o)},a=()=>{e.ws&&e.ws.readyState===window.EventSource.OPEN&&e.send({type:"ping"})};e.ws&&(e.ws.onclose=()=>{s(null)},e.ws.send=function(e){window.fetch(n,{body:new URLSearchParams({subscriber_id:t.toString(),action:"gutenberg_signaling_server",message:e}),method:"POST"}).catch((()=>{Ii("Error sending to server with message: "+e)}))}),r.onerror=()=>{},r.onopen=()=>{e.connected||r.readyState===window.EventSource.OPEN&&(e.lastMessageReceived=Date.now(),e.connecting=!1,e.connected=!0,e.unsuccessfulReconnects=0,e.emit("connect",[{type:"connect"},e]),o=setTimeout(a,$i/2))}}}const $i=3e4;class Wi extends le{constructor(e){super(),this.url=e,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&&$i{Ii(`connected (${t})`);const n=Array.from(Ti.keys());e.send({type:"subscribe",topics:n}),Ti.forEach((t=>zi(e,t,{type:"announce",from:t.peerId})))})),e.on("message",(t=>{if("publish"===t.type){const n=t.topic,r=Ti.get(n);if(null===r||"string"!=typeof n||void 0===r)return;const o=t=>{const n=r.webrtcConns,o=r.peerId;if(null===t||t.from===o||void 0!==t.to&&t.to!==o||r.bcConns.has(t.from))return;const i=n.has(t.from)?()=>{}:()=>r.provider.emit("peers",[{removed:[],added:[t.from],webrtcPeers:Array.from(r.webrtcConns.keys()),bcPeers:Array.from(r.bcConns)}]);switch(t.type){case"announce":n.sizenew Di(e,!0,t.from,r))),i());break;case"signal":if("offer"===t.signal.type){const e=n.get(t.from);if(e){const n=t.token,r=e.glareToken;if(r&&r>n)return void Ii("offer rejected: ",t.from);e.glareToken=void 0}}if("answer"===t.signal.type){Ii("offer answered by: ",t.from);const e=n.get(t.from);e&&(e.glareToken=void 0)}t.to===o&&(ne(n,t.from,(()=>new Di(e,!1,t.from,r))).peer.signal(t.signal),i())}};r.key?"string"==typeof t.data&&Ei(Ut(t.data),r.key).then(o):o(t.data)}})),e.on("disconnect",(()=>Ii(`disconnect (${t})`)))}(this,e)}send(e){this.ws&&this.ws.send(JSON.stringify(e))}destroy(){clearInterval(this._checkInterval),this.disconnect(),super.destroy()}disconnect(){this.shouldConnect=!1,null!==this.ws&&this.ws.close()}connect(){this.shouldConnect=!0,this.connected||null!==this.ws||Hi(this)}}class Gi extends Vi{connect(){this.shouldConnect=!0,this.signalingUrls.forEach((e=>{const t=ne(ji,e,e.startsWith("ws://")||e.startsWith("wss://")?()=>new Ui(e):()=>new Wi(e));this.signalingConns.push(t),t.providers.add(this)})),this.room&&this.room.connect()}}let qi;function Ki(){return qi||(qi=Zo(ui,function({signaling:e,password:t}){return function(n,r,o){return new Gi(`${r}-${n}`,o,{signaling:e,password:t}),Promise.resolve((()=>!0))}}({signaling:[window?.wp?.ajax?.settings?.url],password:window?.__experimentalCollaborativeEditingSecret}))),qi}function Yi(e,t){return{type:"RECEIVE_USER_QUERY",users:Array.isArray(t)?t:[t],queryID:e}}function Ji(e){return{type:"RECEIVE_CURRENT_USER",currentUser:e}}function Xi(e){return{type:"ADD_ENTITIES",entities:e}}function Zi(e,t,n,r,o=!1,i,s){let a;return"postType"===e&&(n=(Array.isArray(n)?n:[n]).map((e=>"auto-draft"===e.status?{...e,title:""}:e))),a=r?function(e,t={},n,r){return{...K(e,n,r),query:t}}(n,r,i,s):K(n,i,s),{...a,kind:e,name:t,invalidateCache:o}}function Qi(e){return{type:"RECEIVE_CURRENT_THEME",currentTheme:e}}function es(e){return{type:"RECEIVE_CURRENT_GLOBAL_STYLES_ID",id:e}}function ts(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLES",stylesheet:e,globalStyles:t}}function ns(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS",stylesheet:e,variations:t}}function rs(){return(0,W.default)("wp.data.dispatch( 'core' ).receiveThemeSupports",{since:"5.9"}),{type:"DO_NOTHING"}}function os(e,t){return(0,W.default)("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 is(e,t){return{type:"RECEIVE_EMBED_PREVIEW",url:e,preview:t}}const ss=(e,t,n,r,{__unstableFetch:o=S.default,throwOnError:i=!1}={})=>async({dispatch:s})=>{const a=(await s(Bs(e,t))).find((n=>n.kind===e&&n.name===t));let l,c=!1;if(!a||a?.__experimentalNoFetch)return;const u=await s.__unstableAcquireStoreLock(Q,["entities","records",e,t,n],{exclusive:!0});try{s({type:"DELETE_ENTITY_RECORD_START",kind:e,name:t,recordId:n});let u=!1;try{let i=`${a.baseURL}/${n}`;r&&(i=(0,$.F)(i,r)),c=await o({path:i,method:"DELETE"}),await s(function(e,t,n,r=!1){return{type:"REMOVE_ITEMS",itemIds:Array.isArray(n)?n:[n],kind:e,name:t,invalidateCache:r}}(e,t,n,!0))}catch(e){u=!0,l=e}if(s({type:"DELETE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:n,error:l}),u&&i)throw l;return c}finally{s.__unstableReleaseStoreLock(u)}},as=(e,t,n,r,o={})=>({select:i,dispatch:s})=>{const a=i.getEntityConfig(e,t);if(!a)throw new Error(`The entity being edited (${e}, ${t}) does not have a loaded config.`);const{mergedEdits:l={}}=a,c=i.getRawEntityRecord(e,t,n),u=i.getEditedEntityRecord(e,t,n),d={kind:e,name:t,recordId:n,edits:Object.keys(r).reduce(((e,t)=>{const n=c[t],o=u[t],i=l[t]?{...o,...r[t]}:r[t];return e[t]=N()(n,i)?void 0:i,e}),{})};if(window.__experimentalEnableSync&&a.syncConfig){if(globalThis.IS_GUTENBERG_PLUGIN){const e=a.getSyncObjectId(n);Ki().update(a.syncObjectType+"--edit",e,d.edits)}}else o.undoIgnore||i.getUndoManager().addRecord([{id:{kind:e,name:t,recordId:n},changes:Object.keys(r).reduce(((e,t)=>(e[t]={from:u[t],to:r[t]},e)),{})}],o.isCached),s({type:"EDIT_ENTITY_RECORD",...d})},ls=()=>({select:e,dispatch:t})=>{const n=e.getUndoManager().undo();n&&t({type:"UNDO",record:n})},cs=()=>({select:e,dispatch:t})=>{const n=e.getUndoManager().redo();n&&t({type:"REDO",record:n})},us=()=>({select:e})=>{e.getUndoManager().addRecord()},ds=(e,t,n,{isAutosave:r=!1,__unstableFetch:o=S.default,throwOnError:i=!1}={})=>async({select:s,resolveSelect:a,dispatch:l})=>{const c=(await l(Bs(e,t))).find((n=>n.kind===e&&n.name===t));if(!c||c?.__experimentalNoFetch)return;const u=c.key||xs,d=n[u],h=await l.__unstableAcquireStoreLock(Q,["entities","records",e,t,d||(0,H.A)()],{exclusive:!0});try{for(const[r,o]of Object.entries(n))if("function"==typeof o){const i=o(s.getEditedEntityRecord(e,t,d));l.editEntityRecord(e,t,d,{[r]:i},{undoIgnore:!0}),n[r]=i}let u,h;l({type:"SAVE_ENTITY_RECORD_START",kind:e,name:t,recordId:d,isAutosave:r});let p=!1;try{const i=`${c.baseURL}${d?"/"+d:""}`,h=s.getRawEntityRecord(e,t,d);if(r){const r=s.getCurrentUser(),c=r?r.id:void 0,d=await a.getAutosave(h.type,h.id,c);let p={...h,...d,...n};if(p=Object.keys(p).reduce(((e,t)=>(["title","excerpt","content","meta"].includes(t)&&(e[t]=p[t]),e)),{status:"auto-draft"===p.status?"draft":void 0}),u=await o({path:`${i}/autosaves`,method:"POST",data:p}),h.id===u.id){let n={...h,...p,...u};n=Object.keys(n).reduce(((e,t)=>(["title","excerpt","content"].includes(t)?e[t]=n[t]:e[t]="status"===t?"auto-draft"===h.status&&"draft"===n.status?n.status:h.status:h[t],e)),{}),l.receiveEntityRecords(e,t,n,void 0,!0)}else l.receiveAutosaves(h.id,u)}else{let r=n;c.__unstablePrePersist&&(r={...r,...c.__unstablePrePersist(h,r)}),u=await o({path:i,method:d?"PUT":"POST",data:r}),l.receiveEntityRecords(e,t,u,void 0,!0,r)}}catch(e){p=!0,h=e}if(l({type:"SAVE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:d,error:h,isAutosave:r}),p&&i)throw h;return u}finally{l.__unstableReleaseStoreLock(h)}},hs=e=>async({dispatch:t})=>{const n=X(),r={saveEntityRecord:(e,r,o,i)=>n.add((n=>t.saveEntityRecord(e,r,o,{...i,__unstableFetch:n}))),saveEditedEntityRecord:(e,r,o,i)=>n.add((n=>t.saveEditedEntityRecord(e,r,o,{...i,__unstableFetch:n}))),deleteEntityRecord:(e,r,o,i,s)=>n.add((n=>t.deleteEntityRecord(e,r,o,i,{...s,__unstableFetch:n})))},o=e.map((e=>e(r))),[,...i]=await Promise.all([n.run(),...o]);return i},ps=(e,t,n,r)=>async({select:o,dispatch:i})=>{if(!o.hasEditsForEntityRecord(e,t,n))return;const s=(await i(Bs(e,t))).find((n=>n.kind===e&&n.name===t));if(!s)return;const a=s.key||xs,l=o.getEntityRecordNonTransientEdits(e,t,n),c={[a]:n,...l};return await i.saveEntityRecord(e,t,c,r)},fs=(e,t,n,r,o)=>async({select:i,dispatch:s})=>{if(!i.hasEditsForEntityRecord(e,t,n))return;const a=i.getEntityRecordNonTransientEdits(e,t,n),l={};for(const e of r)G(l,e,q(a,e));const c=(await s(Bs(e,t))).find((n=>n.kind===e&&n.name===t));return n&&(l[c?.key||xs]=n),await s.saveEntityRecord(e,t,l,o)};function ms(e){return(0,W.default)("wp.data.dispatch( 'core' ).receiveUploadPermissions",{since:"5.9",alternative:"receiveUserPermission"}),gs("create/media",e)}function gs(e,t){return{type:"RECEIVE_USER_PERMISSION",key:e,isAllowed:t}}function bs(e,t){return{type:"RECEIVE_AUTOSAVES",postId:e,autosaves:Array.isArray(t)?t:[t]}}function vs(e){return{type:"RECEIVE_NAVIGATION_FALLBACK_ID",fallbackId:e}}function ys(e,t){return{type:"RECEIVE_DEFAULT_TEMPLATE",query:e,templateId:t}}const _s=(e,t,n,r,o,i=!1,s)=>async({dispatch:a})=>{const l=(await a(Bs(e,t))).find((n=>n.kind===e&&n.name===t));a({type:"RECEIVE_ITEM_REVISIONS",key:l&&l?.revisionKey?l.revisionKey:xs,items:Array.isArray(r)?r:[r],recordKey:n,meta:s,query:o,kind:e,name:t,invalidateCache:i})},xs="id",ws=["title","excerpt","content"],ks=[{label:(0,U.__)("Base"),kind:"root",name:"__unstableBase",baseURL:"/",baseURLParams:{_fields:["description","gmt_offset","home","name","site_icon","site_icon_url","site_logo","timezone_string","url"].join(",")},plural:"__unstableBases",syncConfig:{fetch:async()=>(0,S.default)({path:"/"}),applyChangesToDoc:(e,t)=>{const n=e.getMap("document");Object.entries(t).forEach((([e,t])=>{n.get(e)!==t&&n.set(e,t)}))},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"root/base",getSyncObjectId:()=>"index"},{label:(0,U.__)("Post Type"),name:"postType",kind:"root",key:"slug",baseURL:"/wp/v2/types",baseURLParams:{context:"edit"},plural:"postTypes",syncConfig:{fetch:async e=>(0,S.default)({path:`/wp/v2/types/${e}?context=edit`}),applyChangesToDoc:(e,t)=>{const n=e.getMap("document");Object.entries(t).forEach((([e,t])=>{n.get(e)!==t&&n.set(e,t)}))},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:(0,U.__)("Media"),rawAttributes:["caption","title","description"],supportsPagination:!0},{name:"taxonomy",kind:"root",key:"slug",baseURL:"/wp/v2/taxonomies",baseURLParams:{context:"edit"},plural:"taxonomies",label:(0,U.__)("Taxonomy")},{name:"sidebar",kind:"root",baseURL:"/wp/v2/sidebars",baseURLParams:{context:"edit"},plural:"sidebars",transientEdits:{blocks:!0},label:(0,U.__)("Widget areas")},{name:"widget",kind:"root",baseURL:"/wp/v2/widgets",baseURLParams:{context:"edit"},plural:"widgets",transientEdits:{blocks:!0},label:(0,U.__)("Widgets")},{name:"widgetType",kind:"root",baseURL:"/wp/v2/widget-types",baseURLParams:{context:"edit"},plural:"widgetTypes",label:(0,U.__)("Widget types")},{label:(0,U.__)("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:(0,U.__)("Comment")},{name:"menu",kind:"root",baseURL:"/wp/v2/menus",baseURLParams:{context:"edit"},plural:"menus",label:(0,U.__)("Menu")},{name:"menuItem",kind:"root",baseURL:"/wp/v2/menu-items",baseURLParams:{context:"edit"},plural:"menuItems",label:(0,U.__)("Menu Item"),rawAttributes:["title"]},{name:"menuLocation",kind:"root",baseURL:"/wp/v2/menu-locations",baseURLParams:{context:"edit"},plural:"menuLocations",label:(0,U.__)("Menu Location"),key:"name"},{label:(0,U.__)("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:(0,U.__)("Themes"),name:"theme",kind:"root",baseURL:"/wp/v2/themes",baseURLParams:{context:"edit"},plural:"themes",key:"stylesheet"},{label:(0,U.__)("Plugins"),name:"plugin",kind:"root",baseURL:"/wp/v2/plugins",baseURLParams:{context:"edit"},plural:"plugins",key:"plugin"},{label:(0,U.__)("Status"),name:"status",kind:"root",baseURL:"/wp/v2/statuses",baseURLParams:{context:"edit"},plural:"statuses",key:"slug"}],Cs=[{kind:"postType",loadEntities:async function(){const e=await(0,S.default)({path:"/wp/v2/types?context=view"});return Object.entries(null!=e?e:{}).map((([e,t])=>{var n;const r=["wp_template","wp_template_part"].includes(e),o=null!==(n=t?.rest_namespace)&&void 0!==n?n:"wp/v2";return{kind:"postType",baseURL:`/${o}/${t.rest_base}`,baseURLParams:{context:"edit"},name:e,label:t.name,transientEdits:{blocks:!0,selection:!0},mergedEdits:{meta:!0},rawAttributes:ws,getTitle:e=>{var t;return e?.title?.rendered||e?.title||(r?(0,F.D)(null!==(t=e.slug)&&void 0!==t?t:""):String(e.id))},__unstablePrePersist:r?void 0:Ss,__unstable_rest_base:t.rest_base,syncConfig:{fetch:async e=>(0,S.default)({path:`/${o}/${t.rest_base}/${e}?context=edit`}),applyChangesToDoc:(e,t)=>{const n=e.getMap("document");Object.entries(t).forEach((([e,t])=>{"function"!=typeof t&&("blocks"===e&&(As.has(t)||As.set(t,Is(t)),t=As.get(t)),n.get(e)!==t&&n.set(e,t))}))},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"postType/"+t.name,getSyncObjectId:e=>e,supportsPagination:!0,getRevisionsUrl:(e,n)=>`/${o}/${t.rest_base}/${e}/revisions${n?"/"+n:""}`,revisionKey:r?"wp_id":xs}}))}},{kind:"taxonomy",loadEntities:async function(){const e=await(0,S.default)({path:"/wp/v2/taxonomies?context=view"});return Object.entries(null!=e?e:{}).map((([e,t])=>{var n;return{kind:"taxonomy",baseURL:`/${null!==(n=t?.rest_namespace)&&void 0!==n?n:"wp/v2"}/${t.rest_base}`,baseURLParams:{context:"edit"},name:e,label:t.name}}))}},{kind:"root",name:"site",plural:"sites",loadEntities:async function(){var e;const t={label:(0,U.__)("Site"),name:"site",kind:"root",baseURL:"/wp/v2/settings",syncConfig:{fetch:async()=>(0,S.default)({path:"/wp/v2/settings"}),applyChangesToDoc:(e,t)=>{const n=e.getMap("document");Object.entries(t).forEach((([e,t])=>{n.get(e)!==t&&n.set(e,t)}))},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"root/site",getSyncObjectId:()=>"index",meta:{}},n=await(0,S.default)({path:t.baseURL,method:"OPTIONS"}),r={};return Object.entries(null!==(e=n?.schema?.properties)&&void 0!==e?e:{}).forEach((([e,t])=>{"object"==typeof t&&t.title&&(r[e]=t.title)})),[{...t,meta:{labels:r}}]}}],Ss=(e,t)=>{const n={};return"auto-draft"===e?.status&&(t.status||n.status||(n.status="draft"),t.title&&"Auto Draft"!==t.title||n.title||e?.title&&"Auto Draft"!==e?.title||(n.title="")),n},As=new WeakMap;function Es(e){const t={...e};for(const[n,r]of Object.entries(e))r instanceof V.RichTextData&&(t[n]=r.valueOf());return t}function Is(e){return e.map((e=>{const{innerBlocks:t,attributes:n,...r}=e;return{...r,attributes:Es(n),innerBlocks:Is(t)}}))}const js=(e,t,n="get")=>`${n}${"root"===e?"":(0,z.fL)(e)}${(0,z.fL)(t)}`;function Ts(e){e.forEach((({syncObjectType:e,syncConfig:t})=>{Ki().register(e,t);const n={...t};delete n.fetch,Ki().register(e+"--edit",n)}))}const Bs=(e,t)=>async({select:n,dispatch:r})=>{let o=n.getEntitiesConfig(e);const i=!!n.getEntityConfig(e,t);if(o?.length>0&&i)return window.__experimentalEnableSync&&globalThis.IS_GUTENBERG_PLUGIN&&Ts(o),o;const s=Cs.find((n=>t&&n.name?n.kind===e&&n.name===t:n.kind===e));return s?(o=await s.loadEntities(),window.__experimentalEnableSync&&globalThis.IS_GUTENBERG_PLUGIN&&Ts(o),r(Xi(o)),o):[]},Rs=function(e){return"string"==typeof e?e.split(","):Array.isArray(e)?e:null},Ns=function(e){const t=new WeakMap;return n=>{let r;return t.has(n)?r=t.get(n):(r=e(n),null!==n&&"object"==typeof n&&t.set(n,r)),r}}((function(e){const t={stableKey:"",page:1,perPage:10,fields:null,include:null,context:"default"},n=Object.keys(e).sort();for(let i=0;i=i&&n!t.some((t=>Number.isInteger(t)?t===+e:t===e)))))}const Os=(0,D.A)([P((e=>"query"in e)),O((e=>e.query?{...e,...Ns(e.query)}:e)),L("context"),L("stableKey")])(((e={},t)=>{const{type:n,page:r,perPage:o,key:i=xs}=t;return"RECEIVE_ITEMS"!==n?e:{itemIds:Ms(e?.itemIds||[],t.items.map((e=>e[i])),r,o),meta:t.meta}})),Ls=(0,B.combineReducers)({items:function(e={},t){switch(t.type){case"RECEIVE_ITEMS":{const n=Ds(t),r=t.key||xs;return{...e,[n]:{...e[n],...t.items.reduce(((t,o)=>{const i=o[r];return t[i]=function(e,t){if(!e)return t;let n=!1;const r={};for(const o in t)N()(e[o],t[o])?r[o]=e[o]:(n=!0,r[o]=t[o]);if(!n)return e;for(const t in e)r.hasOwnProperty(t)||(r[t]=e[t]);return r}(e?.[n]?.[i],o),t}),{})}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(e).map((([e,n])=>[e,Ps(n,t.itemIds)])))}return e},itemIsComplete:function(e={},t){switch(t.type){case"RECEIVE_ITEMS":{const n=Ds(t),{query:r,key:o=xs}=t,i=r?Ns(r):{},s=!r||!Array.isArray(i.fields);return{...e,[n]:{...e[n],...t.items.reduce(((t,r)=>{const i=r[o];return t[i]=e?.[n]?.[i]||s,t}),{})}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(e).map((([e,n])=>[e,Ps(n,t.itemIds)])))}return e},queries:(e={},t)=>{switch(t.type){case"RECEIVE_ITEMS":return Os(e,t);case"REMOVE_ITEMS":const n=t.itemIds.reduce(((e,t)=>(e[t]=!0,e)),{});return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,Object.fromEntries(Object.entries(t).map((([e,t])=>[e,{...t,itemIds:t.itemIds.filter((e=>!n[e]))}])))])));default:return e}}}),Fs=e=>(t,n)=>{if("UNDO"===n.type||"REDO"===n.type){const{record:r}=n;let o=t;return r.forEach((({id:{kind:t,name:r,recordId:i},changes:s})=>{o=e(o,{type:"EDIT_ENTITY_RECORD",kind:t,name:r,recordId:i,edits:Object.entries(s).reduce(((e,[t,r])=>(e[t]="UNDO"===n.type?r.from:r.to,e)),{})})})),o}return e(t,n)};function zs(e){return(0,D.A)([Fs,P((t=>t.name&&t.kind&&t.name===e.name&&t.kind===e.kind)),O((t=>({key:e.key||xs,...t})))])((0,B.combineReducers)({queriedData:Ls,edits:(e={},t)=>{var n;switch(t.type){case"RECEIVE_ITEMS":if("default"!==(null!==(n=t?.query?.context)&&void 0!==n?n:"default"))return e;const r={...e};for(const e of t.items){const n=e[t.key],o=r[n];if(!o)continue;const i=Object.keys(o).reduce(((n,r)=>{var i;return N()(o[r],null!==(i=e[r]?.raw)&&void 0!==i?i:e[r])||t.persistedEdits&&N()(o[r],t.persistedEdits[r])||(n[r]=o[r]),n}),{});Object.keys(i).length?r[n]=i:delete r[n]}return r;case"EDIT_ENTITY_RECORD":const o={...e[t.recordId],...t.edits};return Object.keys(o).forEach((e=>{void 0===o[e]&&delete o[e]})),{...e,[t.recordId]:o}}return e},saving:(e={},t)=>{switch(t.type){case"SAVE_ENTITY_RECORD_START":case"SAVE_ENTITY_RECORD_FINISH":return{...e,[t.recordId]:{pending:"SAVE_ENTITY_RECORD_START"===t.type,error:t.error,isAutosave:t.isAutosave}}}return e},deleting:(e={},t)=>{switch(t.type){case"DELETE_ENTITY_RECORD_START":case"DELETE_ENTITY_RECORD_FINISH":return{...e,[t.recordId]:{pending:"DELETE_ENTITY_RECORD_START"===t.type,error:t.error}}}return e},revisions:(e={},t)=>{if("RECEIVE_ITEM_REVISIONS"===t.type){const n=t.recordKey;delete t.recordKey;const r=Ls(e[n],{...t,type:"RECEIVE_ITEMS"});return{...e,[n]:r}}return"REMOVE_ITEMS"===t.type?Object.fromEntries(Object.entries(e).filter((([e])=>!t.itemIds.some((t=>Number.isInteger(t)?t===+e:t===e))))):e}}))}const Us=(0,B.combineReducers)({terms:function(e={},t){return"RECEIVE_TERMS"===t.type?{...e,[t.taxonomy]:t.terms}:e},users:function(e={byId:{},queries:{}},t){return"RECEIVE_USER_QUERY"===t.type?{byId:{...e.byId,...t.users.reduce(((e,t)=>({...e,[t.id]:t})),{})},queries:{...e.queries,[t.queryID]:t.users.map((e=>e.id))}}:e},currentTheme:function(e=void 0,t){return"RECEIVE_CURRENT_THEME"===t.type?t.currentTheme.stylesheet:e},currentGlobalStylesId:function(e=void 0,t){return"RECEIVE_CURRENT_GLOBAL_STYLES_ID"===t.type?t.id:e},currentUser:function(e={},t){return"RECEIVE_CURRENT_USER"===t.type?t.currentUser:e},themeGlobalStyleVariations:function(e={},t){return"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS"===t.type?{...e,[t.stylesheet]:t.variations}:e},themeBaseGlobalStyles:function(e={},t){return"RECEIVE_THEME_GLOBAL_STYLES"===t.type?{...e,[t.stylesheet]:t.globalStyles}:e},themeGlobalStyleRevisions:function(e={},t){return"RECEIVE_THEME_GLOBAL_STYLE_REVISIONS"===t.type?{...e,[t.currentId]:t.revisions}:e},taxonomies:function(e=[],t){return"RECEIVE_TAXONOMIES"===t.type?t.taxonomies:e},entities:(e={},t)=>{const n=function(e=ks,t){return"ADD_ENTITIES"===t.type?[...e,...t.entities]:e}(e.config,t);let r=e.reducer;if(!r||n!==e.config){const e=n.reduce(((e,t)=>{const{kind:n}=t;return e[n]||(e[n]=[]),e[n].push(t),e}),{});r=(0,B.combineReducers)(Object.entries(e).reduce(((e,[t,n])=>{const r=(0,B.combineReducers)(n.reduce(((e,t)=>({...e,[t.name]:zs(t)})),{}));return e[t]=r,e}),{}))}const o=r(e.records,t);return o===e.records&&n===e.config&&r===e.reducer?e:{reducer:r,records:o,config:n}},editsReference:function(e={},t){switch(t.type){case"EDIT_ENTITY_RECORD":case"UNDO":case"REDO":return{}}return e},undoManager:function(e=(0,M.u)()){return e},embedPreviews:function(e={},t){if("RECEIVE_EMBED_PREVIEW"===t.type){const{url:n,preview:r}=t;return{...e,[n]:r}}return e},userPermissions:function(e={},t){return"RECEIVE_USER_PERMISSION"===t.type?{...e,[t.key]:t.isAllowed}:e},autosaves:function(e={},t){if("RECEIVE_AUTOSAVES"===t.type){const{postId:n,autosaves:r}=t;return{...e,[n]:r}}return e},blockPatterns:function(e=[],t){return"RECEIVE_BLOCK_PATTERNS"===t.type?t.patterns:e},blockPatternCategories:function(e=[],t){return"RECEIVE_BLOCK_PATTERN_CATEGORIES"===t.type?t.categories:e},userPatternCategories:function(e=[],t){return"RECEIVE_USER_PATTERN_CATEGORIES"===t.type?t.patternCategories:e},navigationFallbackId:function(e=null,t){return"RECEIVE_NAVIGATION_FALLBACK_ID"===t.type?t.fallbackId:e},defaultTemplates:function(e={},t){return"RECEIVE_DEFAULT_TEMPLATE"===t.type?{...e,[JSON.stringify(t.query)]:t.templateId}:e}});var Vs=n(4075),Hs=n(74661),$s=n(34236),Ws=n.n($s);const Gs=new WeakMap,qs=(0,Hs.A)(((e,t={})=>{let n=Gs.get(e);if(n){const e=n.get(t);if(void 0!==e)return e}else n=new(Ws()),Gs.set(e,n);const r=function(e,t){const{stableKey:n,page:r,perPage:o,include:i,fields:s,context:a}=Ns(t);let l;if(e.queries?.[a]?.[n]&&(l=e.queries[a][n].itemIds),!l)return null;const c=-1===o?0:(r-1)*o,u=-1===o?l.length:Math.min(c+o,l.length),d=[];for(let t=c;t{n=n?.[e]})),G(o,t,n)}}else{if(!e.itemIsComplete[a]?.[n])return null;o=r}d.push(o)}return d}(e,t);return n.set(t,r),r}));function Ks(e,t={}){var n;const{stableKey:r,context:o}=Ns(t);return null!==(n=e.queries?.[o]?.[r]?.meta?.totalItems)&&void 0!==n?n:null}const Ys={},Js=(0,Vs.N)((e=>(t,n)=>e(Q).isResolving("getEmbedPreview",[n])));function Xs(e,t){(0,W.default)("select( 'core' ).getAuthors()",{since:"5.9",alternative:"select( 'core' ).getUsers({ who: 'authors' })"});const n=(0,$.F)("/wp/v2/users/?who=authors&per_page=100",t);return Qs(e,n)}function Zs(e){return e.currentUser}const Qs=(0,Hs.A)(((e,t)=>{var n;return(null!==(n=e.users.queries[t])&&void 0!==n?n:[]).map((t=>e.users.byId[t]))}),((e,t)=>[e.users.queries[t],e.users.byId]));function ea(e,t){return(0,W.default)("wp.data.select( 'core' ).getEntitiesByKind()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntitiesConfig()"}),ta(e,t)}const ta=(0,Hs.A)(((e,t)=>e.entities.config.filter((e=>e.kind===t))),((e,t)=>e.entities.config));function na(e,t,n){return(0,W.default)("wp.data.select( 'core' ).getEntity()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntityConfig()"}),ra(e,t,n)}function ra(e,t,n){return e.entities.config?.find((e=>e.kind===t&&e.name===n))}const oa=(0,Hs.A)(((e,t,n,r,o)=>{var i;const s=e.entities.records?.[t]?.[n]?.queriedData;if(!s)return;const a=null!==(i=o?.context)&&void 0!==i?i:"default";if(void 0===o){if(!s.itemIsComplete[a]?.[r])return;return s.items[a][r]}const l=s.items[a]?.[r];if(l&&o._fields){var c;const e={},t=null!==(c=Rs(o._fields))&&void 0!==c?c:[];for(let n=0;n{o=o?.[e]})),G(e,r,o)}return e}return l}),((e,t,n,r,o)=>{var i;const s=null!==(i=o?.context)&&void 0!==i?i:"default";return[e.entities.records?.[t]?.[n]?.queriedData?.items[s]?.[r],e.entities.records?.[t]?.[n]?.queriedData?.itemIsComplete[s]?.[r]]}));function ia(e,t,n,r){return oa(e,t,n,r)}oa.__unstableNormalizeArgs=e=>{const t=[...e],n=t?.[2];return t[2]=function(e){return/^\s*\d+\s*$/.test(e)}(n)?Number(n):n,t};const sa=(0,Hs.A)(((e,t,n,r)=>{const o=oa(e,t,n,r);return o&&Object.keys(o).reduce(((r,i)=>{var s;return!function(e,t){return(e.rawAttributes||[]).includes(t)}(ra(e,t,n),i)?r[i]=o[i]:r[i]=null!==(s=o[i]?.raw)&&void 0!==s?s:o[i],r}),{})}),((e,t,n,r,o)=>{var i;const s=null!==(i=o?.context)&&void 0!==i?i:"default";return[e.entities.config,e.entities.records?.[t]?.[n]?.queriedData?.items[s]?.[r],e.entities.records?.[t]?.[n]?.queriedData?.itemIsComplete[s]?.[r]]}));function aa(e,t,n,r){return Array.isArray(la(e,t,n,r))}const la=(e,t,n,r)=>{const o=e.entities.records?.[t]?.[n]?.queriedData;return o?qs(o,r):null},ca=(e,t,n,r)=>{const o=e.entities.records?.[t]?.[n]?.queriedData;return o?Ks(o,r):null},ua=(e,t,n,r)=>{const o=e.entities.records?.[t]?.[n]?.queriedData;if(!o)return null;if(-1===r.per_page)return 1;const i=Ks(o,r);return i?r.per_page?Math.ceil(i/r.per_page):function(e,t={}){var n;const{stableKey:r,context:o}=Ns(t);return null!==(n=e.queries?.[o]?.[r]?.meta?.totalPages)&&void 0!==n?n:null}(o,r):i},da=(0,Hs.A)((e=>{const{entities:{records:t}}=e,n=[];return Object.keys(t).forEach((r=>{Object.keys(t[r]).forEach((o=>{const i=Object.keys(t[r][o].edits).filter((t=>oa(e,r,o,t)&&ma(e,r,o,t)));if(i.length){const t=ra(e,r,o);i.forEach((i=>{const s=ga(e,r,o,i);n.push({key:s?s[t.key||xs]:void 0,title:t?.getTitle?.(s)||"",name:o,kind:r})}))}}))})),n}),(e=>[e.entities.records])),ha=(0,Hs.A)((e=>{const{entities:{records:t}}=e,n=[];return Object.keys(t).forEach((r=>{Object.keys(t[r]).forEach((o=>{const i=Object.keys(t[r][o].saving).filter((t=>va(e,r,o,t)));if(i.length){const t=ra(e,r,o);i.forEach((i=>{const s=ga(e,r,o,i);n.push({key:s?s[t.key||xs]:void 0,title:t?.getTitle?.(s)||"",name:o,kind:r})}))}}))})),n}),(e=>[e.entities.records]));function pa(e,t,n,r){return e.entities.records?.[t]?.[n]?.edits?.[r]}const fa=(0,Hs.A)(((e,t,n,r)=>{const{transientEdits:o}=ra(e,t,n)||{},i=pa(e,t,n,r)||{};return o?Object.keys(i).reduce(((e,t)=>(o[t]||(e[t]=i[t]),e)),{}):i}),((e,t,n,r)=>[e.entities.config,e.entities.records?.[t]?.[n]?.edits?.[r]]));function ma(e,t,n,r){return va(e,t,n,r)||Object.keys(fa(e,t,n,r)).length>0}const ga=(0,Hs.A)(((e,t,n,r)=>{const o=sa(e,t,n,r),i=pa(e,t,n,r);return!(!o&&!i)&&{...o,...i}}),((e,t,n,r,o)=>{var i;const s=null!==(i=o?.context)&&void 0!==i?i:"default";return[e.entities.config,e.entities.records?.[t]?.[n]?.queriedData.items[s]?.[r],e.entities.records?.[t]?.[n]?.queriedData.itemIsComplete[s]?.[r],e.entities.records?.[t]?.[n]?.edits?.[r]]}));function ba(e,t,n,r){var o;const{pending:i,isAutosave:s}=null!==(o=e.entities.records?.[t]?.[n]?.saving?.[r])&&void 0!==o?o:{};return Boolean(i&&s)}function va(e,t,n,r){var o;return null!==(o=e.entities.records?.[t]?.[n]?.saving?.[r]?.pending)&&void 0!==o&&o}function ya(e,t,n,r){var o;return null!==(o=e.entities.records?.[t]?.[n]?.deleting?.[r]?.pending)&&void 0!==o&&o}function _a(e,t,n,r){return e.entities.records?.[t]?.[n]?.saving?.[r]?.error}function xa(e,t,n,r){return e.entities.records?.[t]?.[n]?.deleting?.[r]?.error}function wa(e){(0,W.default)("select( 'core' ).getUndoEdit()",{since:"6.3"})}function ka(e){(0,W.default)("select( 'core' ).getRedoEdit()",{since:"6.3"})}function Ca(e){return e.undoManager.hasUndo()}function Sa(e){return e.undoManager.hasRedo()}function Aa(e){return e.currentTheme?oa(e,"root","theme",e.currentTheme):null}function Ea(e){return e.currentGlobalStylesId}function Ia(e){var t;return null!==(t=Aa(e)?.theme_supports)&&void 0!==t?t:Ys}function ja(e,t){return e.embedPreviews[t]}function Ta(e,t){const n=e.embedPreviews[t],r=''+t+"";return!!n&&n.html===r}function Ba(e,t,n,r){const o=[t,n,r].filter(Boolean).join("/");return e.userPermissions[o]}function Ra(e,t,n,r){const o=ra(e,t,n);return!!o&&Ba(e,"update",o.__unstable_rest_base,r)}function Na(e,t,n){return e.autosaves[n]}function Da(e,t,n,r){if(void 0===r)return;const o=e.autosaves[n];return o?.find((e=>e.author===r))}const Ma=(0,Vs.N)((e=>(t,n,r)=>e(Q).hasFinishedResolution("getAutosaves",[n,r])));function Pa(e){return e.editsReference}function Oa(e,t){const n=la(e,"postType","wp_template",{"find-template":t});return n?.length?ga(e,"postType","wp_template",n[0].id):null}function La(e){const t=Aa(e);return t?e.themeBaseGlobalStyles[t.stylesheet]:null}function Fa(e){const t=Aa(e);return t?e.themeGlobalStyleVariations[t.stylesheet]:null}function za(e){return e.blockPatterns}function Ua(e){return e.blockPatternCategories}function Va(e){return e.userPatternCategories}function Ha(e){(0,W.default)("select( 'core' ).getCurrentThemeGlobalStylesRevisions()",{since:"6.5.0",alternative:"select( 'core' ).getRevisions( 'root', 'globalStyles', ${ recordKey } )"});const t=Ea(e);return t?e.themeGlobalStyleRevisions[t]:null}function $a(e,t){return e.defaultTemplates[JSON.stringify(t)]}const Wa=(e,t,n,r,o)=>{const i=e.entities.records?.[t]?.[n]?.revisions?.[r];return i?qs(i,o):null},Ga=(0,Hs.A)(((e,t,n,r,o,i)=>{var s;const a=e.entities.records?.[t]?.[n]?.revisions?.[r];if(!a)return;const l=null!==(s=i?.context)&&void 0!==s?s:"default";if(void 0===i){if(!a.itemIsComplete[l]?.[o])return;return a.items[l][o]}const c=a.items[l]?.[o];if(c&&i._fields){var u;const e={},t=null!==(u=Rs(i._fields))&&void 0!==u?u:[];for(let n=0;n{o=o?.[e]})),G(e,r,o)}return e}return c}),((e,t,n,r,o,i)=>{var s;const a=null!==(s=i?.context)&&void 0!==s?s:"default";return[e.entities.records?.[t]?.[n]?.revisions?.[r]?.items?.[a]?.[o],e.entities.records?.[t]?.[n]?.revisions?.[r]?.itemIsComplete?.[a]?.[o]]}));function qa(e){return e.undoManager}function Ka(e){return e.navigationFallbackId}const Ya=(0,Vs.N)((e=>(0,Hs.A)(((t,n)=>e(Q).getBlockPatterns().filter((({postTypes:e})=>!e||Array.isArray(e)&&e.includes(n)))),(()=>[e(Q).getBlockPatterns()]))));var Ja=n(10313),Xa=n(11785);const Za=e=>(...t)=>async({resolveSelect:n})=>{await n[e](...t)},Qa=e=>async({dispatch:t})=>{const n=(0,$.F)("/wp/v2/users/?who=authors&per_page=100",e),r=await(0,S.default)({path:n});t.receiveUserQuery(n,r)},el=()=>async({dispatch:e})=>{const t=await(0,S.default)({path:"/wp/v2/users/me"});e.receiveCurrentUser(t)},tl=(e,t,n="",r)=>async({select:o,dispatch:i})=>{const s=(await i(Bs(e,t))).find((n=>n.name===t&&n.kind===e));if(!s||s?.__experimentalNoFetch)return;const a=await i.__unstableAcquireStoreLock(Q,["entities","records",e,t,n],{exclusive:!1});try{if(window.__experimentalEnableSync&&s.syncConfig&&!r){if(globalThis.IS_GUTENBERG_PLUGIN){const o=s.getSyncObjectId(n);await Ki().bootstrap(s.syncObjectType,o,(n=>{i.receiveEntityRecords(e,t,n,r)})),await Ki().bootstrap(s.syncObjectType+"--edit",o,(r=>{i({type:"EDIT_ENTITY_RECORD",kind:e,name:t,recordId:n,edits:r,meta:{undo:void 0}})}))}}else{void 0!==r&&r._fields&&(r={...r,_fields:[...new Set([...Rs(r._fields)||[],s.key||xs])].join()});const a=(0,$.F)(s.baseURL+(n?"/"+n:""),{...s.baseURLParams,...r});if(void 0!==r&&(r={...r,include:[n]},o.hasEntityRecords(e,t,r)))return;const l=await(0,S.default)({path:a});i.receiveEntityRecords(e,t,l,r)}}finally{i.__unstableReleaseStoreLock(a)}},nl=Za("getEntityRecord"),rl=Za("getEntityRecord"),ol=(e,t,n={})=>async({dispatch:r,registry:o})=>{const i=(await r(Bs(e,t))).find((n=>n.name===t&&n.kind===e));if(!i||i?.__experimentalNoFetch)return;const s=await r.__unstableAcquireStoreLock(Q,["entities","records",e,t],{exclusive:!1});try{n._fields&&(n={...n,_fields:[...new Set([...Rs(n._fields)||[],i.key||xs])].join()});const a=(0,$.F)(i.baseURL,{...i.baseURLParams,...n});let l,c;if(i.supportsPagination&&-1!==n.per_page){const e=await(0,S.default)({path:a,parse:!1});l=Object.values(await e.json()),c={totalItems:parseInt(e.headers.get("X-WP-Total")),totalPages:parseInt(e.headers.get("X-WP-TotalPages"))}}else l=Object.values(await(0,S.default)({path:a}));n._fields&&(l=l.map((e=>(n._fields.split(",").forEach((t=>{e.hasOwnProperty(t)||(e[t]=void 0)})),e)))),o.batch((()=>{if(r.receiveEntityRecords(e,t,l,n,!1,void 0,c),!n?._fields&&!n.context){const n=i.key||xs,o=l.filter((e=>e[n])).map((r=>[e,t,r[n]]));r({type:"START_RESOLUTIONS",selectorName:"getEntityRecord",args:o}),r({type:"FINISH_RESOLUTIONS",selectorName:"getEntityRecord",args:o})}r.__unstableReleaseStoreLock(s)}))}catch(e){r.__unstableReleaseStoreLock(s)}};ol.shouldInvalidate=(e,t,n)=>("RECEIVE_ITEMS"===e.type||"REMOVE_ITEMS"===e.type)&&e.invalidateCache&&t===e.kind&&n===e.name;const il=()=>async({dispatch:e,resolveSelect:t})=>{const n=await t.getEntityRecords("root","theme",{status:"active"});e.receiveCurrentTheme(n[0])},sl=Za("getCurrentTheme"),al=e=>async({dispatch:t})=>{try{const n=await(0,S.default)({path:(0,$.F)("/oembed/1.0/proxy",{url:e})});t.receiveEmbedPreview(e,n)}catch(n){t.receiveEmbedPreview(e,!1)}},ll=(e,t,n)=>async({dispatch:r,registry:o})=>{const{hasStartedResolution:i}=o.select(Q),s=n?`${t}/${n}`:t,a=["create","read","update","delete"];if(!a.includes(e))throw new Error(`'${e}' is not a valid action.`);for(const r of a)if(r!==e&&i("canUser",[r,t,n]))return;let l;try{l=await(0,S.default)({path:`/wp/v2/${s}`,method:"OPTIONS",parse:!1})}catch(e){return}const c=l.headers?.get("allow"),u=c?.allow||c||"",d={},h={create:"POST",read:"GET",update:"PUT",delete:"DELETE"};for(const[e,t]of Object.entries(h))d[e]=u.includes(t);for(const e of a)r.receiveUserPermission(`${e}/${s}`,d[e])},cl=(e,t,n)=>async({dispatch:r})=>{const o=(await r(Bs(e,t))).find((n=>n.name===t&&n.kind===e));if(!o)return;const i=o.__unstable_rest_base;await r(ll("update",i,n))},ul=(e,t)=>async({dispatch:n,resolveSelect:r})=>{const{rest_base:o,rest_namespace:i="wp/v2"}=await r.getPostType(e),s=await(0,S.default)({path:`/${i}/${o}/${t}/autosaves?context=edit`});s&&s.length&&n.receiveAutosaves(t,s)},dl=(e,t)=>async({resolveSelect:n})=>{await n.getAutosaves(e,t)},hl=e=>async({dispatch:t,resolveSelect:n})=>{let r;try{r=await(0,S.default)({url:(0,$.F)(e,{"_wp-find-template":!0})}).then((({data:e})=>e))}catch(e){}if(!r)return;const o=await n.getEntityRecord("postType","wp_template",r.id);o&&t.receiveEntityRecords("postType","wp_template",[o],{"find-template":e})};hl.shouldInvalidate=e=>("RECEIVE_ITEMS"===e.type||"REMOVE_ITEMS"===e.type)&&e.invalidateCache&&"postType"===e.kind&&"wp_template"===e.name;const pl=()=>async({dispatch:e,resolveSelect:t})=>{const n=await t.getEntityRecords("root","theme",{status:"active"}),r=n?.[0]?._links?.["wp:user-global-styles"]?.[0]?.href;if(r){const t=await(0,S.default)({url:r});e.__experimentalReceiveCurrentGlobalStylesId(t.id)}},fl=()=>async({resolveSelect:e,dispatch:t})=>{const n=await e.getCurrentTheme(),r=await(0,S.default)({path:`/wp/v2/global-styles/themes/${n.stylesheet}`});t.__experimentalReceiveThemeBaseGlobalStyles(n.stylesheet,r)},ml=()=>async({resolveSelect:e,dispatch:t})=>{const n=await e.getCurrentTheme(),r=await(0,S.default)({path:`/wp/v2/global-styles/themes/${n.stylesheet}/variations`});t.__experimentalReceiveThemeGlobalStyleVariations(n.stylesheet,r)},gl=()=>async({resolveSelect:e,dispatch:t})=>{const n=await e.__experimentalGetCurrentGlobalStylesId(),r=n?await e.getEntityRecord("root","globalStyles",n):void 0,o=r?._links?.["version-history"]?.[0]?.href;if(o){const e=await(0,S.default)({url:o}),r=e?.map((e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[(0,Ja.xQ)(e),t])))));t.receiveThemeGlobalStyleRevisions(n,r)}};gl.shouldInvalidate=e=>"SAVE_ENTITY_RECORD_FINISH"===e.type&&"root"===e.kind&&!e.error&&"globalStyles"===e.name;const bl=()=>async({dispatch:e})=>{e({type:"RECEIVE_BLOCK_PATTERNS",patterns:await async function(){const e=await(0,S.default)({path:"/wp/v2/block-patterns/patterns"});return e?e.map((e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[(0,Ja.xQ)(e),t]))))):[]}()})},vl=()=>async({dispatch:e})=>{e({type:"RECEIVE_BLOCK_PATTERN_CATEGORIES",categories:await(0,S.default)({path:"/wp/v2/block-patterns/categories"})})},yl=()=>async({dispatch:e,resolveSelect:t})=>{const n=await t.getEntityRecords("taxonomy","wp_pattern_category",{per_page:-1,_fields:"id,name,description,slug",context:"view"});e({type:"RECEIVE_USER_PATTERN_CATEGORIES",patternCategories:n?.map((e=>({...e,label:(0,Xa.decodeEntities)(e.name),name:e.slug})))||[]})},_l=()=>async({dispatch:e,select:t})=>{const n=await(0,S.default)({path:(0,$.F)("/wp-block-editor/v1/navigation-fallback",{_embed:!0})}),r=n?._embedded?.self;if(e.receiveNavigationFallbackId(n?.id),r){const o=!t.getEntityRecord("postType","wp_navigation",n.id);e.receiveEntityRecords("postType","wp_navigation",r,void 0,o),e.finishResolution("getEntityRecord",["postType","wp_navigation",n.id])}},xl=e=>async({dispatch:t})=>{const n=await(0,S.default)({path:(0,$.F)("/wp/v2/templates/lookup",e)});n?.id&&t.receiveDefaultTemplateId(e,n.id)},wl=(e,t,n,r={})=>async({dispatch:o})=>{const i=(await o(Bs(e,t))).find((n=>n.name===t&&n.kind===e));if(!i||i?.__experimentalNoFetch)return;r._fields&&(r={...r,_fields:[...new Set([...Rs(r._fields)||[],i.revisionKey||xs])].join()});const s=(0,$.F)(i.getRevisionsUrl(n),r);let a,l;const c={},u=i.supportsPagination&&-1!==r.per_page;try{l=await(0,S.default)({path:s,parse:!u})}catch(e){return}if(l&&(u?(a=Object.values(await l.json()),c.totalItems=parseInt(l.headers.get("X-WP-Total"))):a=Object.values(l),r._fields&&(a=a.map((e=>(r._fields.split(",").forEach((t=>{e.hasOwnProperty(t)||(e[t]=void 0)})),e)))),o.receiveRevisions(e,t,n,a,r,!1,c),!r?._fields&&!r.context)){const r=i.key||xs,s=a.filter((e=>e[r])).map((o=>[e,t,n,o[r]]));o({type:"START_RESOLUTIONS",selectorName:"getRevision",args:s}),o({type:"FINISH_RESOLUTIONS",selectorName:"getRevision",args:s})}};wl.shouldInvalidate=(e,t,n,r)=>"SAVE_ENTITY_RECORD_FINISH"===e.type&&n===e.name&&t===e.kind&&!e.error&&r===e.recordId;const kl=(e,t,n,r,o)=>async({dispatch:i})=>{const s=(await i(Bs(e,t))).find((n=>n.name===t&&n.kind===e));if(!s||s?.__experimentalNoFetch)return;void 0!==o&&o._fields&&(o={...o,_fields:[...new Set([...Rs(o._fields)||[],s.revisionKey||xs])].join()});const a=(0,$.F)(s.getRevisionsUrl(n,r),o);let l;try{l=await(0,S.default)({path:a})}catch(e){return}l&&i.receiveRevisions(e,t,n,l,o)};function Cl(e,t){const n={...e};let r=n;for(const e of t)r.children={...r.children,[e]:{locks:[],children:{},...r.children[e]}},r=r.children[e];return n}function Sl(e,t){let n=e;for(const e of t){const t=n.children[e];if(!t)return null;n=t}return n}function Al({exclusive:e},t){return!(!e||!t.length)||!(e||!t.filter((e=>e.exclusive)).length)}const El={requests:[],tree:{locks:[],children:{}}};function Il(e=El,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:r}=t,{store:o,path:i}=r,s=[o,...i],a=Cl(e.tree,s),l=Sl(a,s);return l.locks=[...l.locks,n],{...e,requests:e.requests.filter((e=>e!==r)),tree:a}}case"RELEASE_LOCK":{const{lock:n}=t,r=[n.store,...n.path],o=Cl(e.tree,r),i=Sl(o,r);return i.locks=i.locks.filter((e=>e!==n)),{...e,tree:o}}}return e}function jl(e,t,n,{exclusive:r}){const o=[t,...n],i=e.tree;for(const e of function*(e,t){let n=e;yield n;for(const e of t){const t=n.children[e];if(!t)break;yield t,n=t}}(i,o))if(Al({exclusive:r},e.locks))return!1;const s=Sl(i,o);if(!s)return!0;for(const e of function*(e){const t=Object.values(e.children);for(;t.length;){const e=t.pop();yield e,t.push(...Object.values(e.children))}}(s))if(Al({exclusive:r},e.locks))return!1;return!0}function Tl(){let e=Il(void 0,{type:"@@INIT"});function t(){for(const t of function(e){return e.requests}(e)){const{store:n,path:r,exclusive:o,notifyAcquired:i}=t;if(jl(e,n,r,{exclusive:o})){const s={store:n,path:r,exclusive:o};e=Il(e,{type:"GRANT_LOCK_REQUEST",lock:s,request:t}),i(s)}}}return{acquire:function(n,r,o){return new Promise((i=>{e=Il(e,{type:"ENQUEUE_LOCK_REQUEST",request:{store:n,path:r,exclusive:o,notifyAcquired:i}}),t()}))},release:function(n){e=Il(e,{type:"RELEASE_LOCK",lock:n}),t()}}}var Bl=n(87520);const{lock:Rl,unlock:Nl}=(0,Bl.yf)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/core-data"),Dl=[...ks,...Cs.filter((e=>!!e.name))],Ml=Dl.reduce(((e,t)=>{const{kind:n,name:r,plural:o}=t;return e[js(n,r)]=(e,t,o)=>oa(e,n,r,t,o),o&&(e[js(n,o,"get")]=(e,t)=>la(e,n,r,t)),e}),{}),Pl=Dl.reduce(((e,t)=>{const{kind:n,name:r,plural:o}=t;if(e[js(n,r)]=(e,t)=>tl(n,r,e,t),o){const t=js(n,o,"get");e[t]=(...e)=>ol(n,r,...e),e[t].shouldInvalidate=e=>ol.shouldInvalidate(e,n,r)}return e}),{}),Ol=Dl.reduce(((e,t)=>{const{kind:n,name:r}=t;return e[js(n,r,"save")]=(e,t)=>ds(n,r,e,t),e[js(n,r,"delete")]=(e,t,o)=>ss(n,r,e,t,o),e}),{}),Ll=(0,T.A)(Q,{reducer:Us,actions:{...r,...Ol,...function(){const e=Tl();return{__unstableAcquireStoreLock:function(t,n,{exclusive:r}){return()=>e.acquire(t,n,r)},__unstableReleaseStoreLock:function(t){return()=>e.release(t)}}}()},selectors:{...o,...Ml},resolvers:{...s,...Pl}});Nl(Ll).registerPrivateSelectors(i),(0,B.register)(Ll);var Fl=n(77906),zl=n(14687),Ul=n(16221);const Vl=[],Hl=()=>{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})])}})},$l=()=>{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 e=this.controller,t=e.state();e.close(),t.trigger("update",t.get("library")),e.setState(e.options.state),e.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])}})},Wl=e=>["sizes","mime","type","subtype","id","url","alt","link","caption"].reduce(((t,n)=>(e?.hasOwnProperty(n)&&(t[n]=e[n]),t)),{}),Gl=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"})};class ql extends k.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:e=!1,allowedTypes:t,multiple:n=!1,value:r=Vl}=this.props;if(r===this.lastGalleryValue)return;const{wp:o}=window;let i;this.lastGalleryValue=r,this.frame&&this.frame.remove(),i=e?"gallery-library":r&&r.length?"gallery-edit":"gallery",this.GalleryDetailsMediaFrame||(this.GalleryDetailsMediaFrame=$l());const s=Gl(r),a=new o.media.model.Selection(s.models,{props:s.props.toJSON(),multiple:n});this.frame=new this.GalleryDetailsMediaFrame({mimeType:t,state:i,multiple:n,selection:a,editing:!(!r||!r.length)}),o.media.frame=this.frame,this.initializeListeners()}buildAndSetFeatureImageFrame(){const{wp:e}=window,{value:t,multiple:n,allowedTypes:r}=this.props,o=Hl(),i=Gl(t),s=new e.media.model.Selection(i.models,{props:i.props.toJSON()});this.frame=new o({mimeType:r,state:"featured-image",multiple:n,selection:s,editing:t}),e.media.frame=this.frame,e.media.view.settings.post={...e.media.view.settings.post,featuredImageId:t||-1}}componentWillUnmount(){this.frame?.remove()}onUpdate(e){const{onSelect:t,multiple:n=!1}=this.props,r=this.frame.state(),o=e||r.get("selection");o&&o.models.length&&t(n?o.models.map((e=>Wl(e.toJSON()))):Wl(o.models[0].toJSON()))}onSelect(){const{onSelect:e,multiple:t=!1}=this.props,n=this.frame.state().get("selection").toJSON();e(t?n:n[0])}onOpen(){const{wp:e}=window,{value:t}=this.props;if(this.updateCollection(),this.props.mode&&this.frame.content.mode(this.props.mode),!(Array.isArray(t)?t?.length:t))return;const n=this.props.gallery,r=this.frame.state().get("selection"),o=Array.isArray(t)?t:[t];n||o.forEach((t=>{r.add(e.media.attachment(t))}));const i=Gl(o);i.more().done((function(){n&&i?.models?.length&&r.add(i.models)}))}onClose(){const{onClose:e}=this.props;e&&e()}updateCollection(){const e=this.frame.content.get();if(e&&e.collection){const t=e.collection;t.toArray().forEach((e=>e.trigger("destroy",e))),t.mirroring._hasMore=!0,t.more()}}openModal(){const{allowedTypes:e,gallery:t=!1,unstableFeaturedImageFlow:n=!1,modalClass:r,multiple:o=!1,title:i=(0,U.__)("Select or Upload Media")}=this.props,{wp:s}=window;if(t)this.buildAndSetGalleryFrame();else{const t={title:i,multiple:o};e&&(t.library={type:e}),this.frame=s.media(t)}r&&this.frame.$el.addClass(r),n&&this.buildAndSetFeatureImageFrame(),this.initializeListeners(),this.frame.open()}render(){return this.props.render({open:this.openModal})}}const Kl=ql,Yl={};function Jl(e){const t=window.URL.createObjectURL(e);return Yl[t]=e,t}function Xl(e){Yl[e]&&window.URL.revokeObjectURL(e),delete Yl[e]}function Zl(e){return!(!e||!e.indexOf)&&0===e.indexOf("blob:")}const Ql=()=>{};async function ec({allowedTypes:e,additionalData:t={},filesList:n,maxUploadFileSize:r,onError:o=Ql,onFileChange:i,wpAllowedMimeTypes:s=null}){const a=[...n],l=[],c=(e,t)=>{Xl(l[e]?.url),l[e]=t,i(l.filter(Boolean))},u=t=>!e||e.some((e=>e.includes("/")?e===t:t.startsWith(`${e}/`))),d=(h=s)?Object.entries(h).map((([e,t])=>{const[n]=t.split("/");return[t,...e.split("|").map((e=>`${n}/${e}`))]})).flat():h;var h;const p=[];for(const e of a)d&&e.type&&(f=e.type,!d.includes(f))?o({code:"MIME_TYPE_NOT_ALLOWED_FOR_USER",message:(0,U.sprintf)((0,U.__)("%s: Sorry, you are not allowed to upload this file type."),e.name),file:e}):!e.type||u(e.type)?r&&e.size>r?o({code:"SIZE_ABOVE_LIMIT",message:(0,U.sprintf)((0,U.__)("%s: This file exceeds the maximum upload size for this site."),e.name),file:e}):e.size<=0?o({code:"EMPTY_FILE",message:(0,U.sprintf)((0,U.__)("%s: This file is empty."),e.name),file:e}):(p.push(e),l.push({url:Jl(e)}),i(l)):o({code:"MIME_TYPE_NOT_SUPPORTED",message:(0,U.sprintf)((0,U.__)("%s: Sorry, this file type is not supported here."),e.name),file:e});var f;for(let e=0;en.append(e,t))),(0,S.default)({path:"/wp/v2/media",body:n,method:"POST"})}var nc=n(38245),rc=n(99940),oc=n(99532),ic=n(71848);const sc="block-default",ac=["attributes","supports","save","migrate","isEligible","apiVersion"],lc={"--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}},cc={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"},uc={"color.duotone":!0,"color.gradients":!0,"color.palette":!0,"dimensions.aspectRatios":!0,"typography.fontSizes":!0,"spacing.spacingSizes":!0};var dc=n(8301),hc=n(75379);const{lock:pc,unlock:fc}=(0,Bl.yf)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/blocks"),mc={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 gc(e){return null!==e&&"object"==typeof e}function bc({textdomain:e,...t}){const n=["apiVersion","title","category","parent","ancestor","icon","description","keywords","attributes","providesContext","usesContext","selectors","supports","styles","example","variations","blockHooks","allowedBlocks"],r=Object.fromEntries(Object.entries(t).filter((([e])=>n.includes(e))));return e&&Object.keys(mc).forEach((t=>{r[t]&&(r[t]=yc(mc[t],r[t],e))})),r}function vc(e,t){const n=gc(e)?e.name:e;if("string"!=typeof n)return void console.error("Block names must be strings.");if(!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(n))return void console.error("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");if((0,dc.L)(Zu).getBlockType(n))return void console.error('Block "'+n+'" is already registered.');const{addBootstrappedBlockType:r,addUnprocessedBlockType:o}=fc((0,hc.J)(Zu));return gc(e)&&r(n,bc(e)),o(n,t),(0,dc.L)(Zu).getBlockType(n)}function yc(e,t,n){return"string"==typeof e&&"string"==typeof t?(0,U._x)(t,e,n):Array.isArray(e)&&e.length&&Array.isArray(t)?t.map((t=>yc(e[0],t,n))):gc(e)&&Object.entries(e).length&&gc(t)?Object.keys(t).reduce(((r,o)=>e[o]?(r[o]=yc(e[o],t[o],n),r):(r[o]=t[o],r)),{}):t}function _c(){return(0,dc.L)(Zu).getFreeformFallbackBlockName()}function xc(){return(0,dc.L)(Zu).getUnregisteredFallbackBlockName()}function wc(){return(0,dc.L)(Zu).getDefaultBlockName()}function kc(e){return(0,dc.L)(Zu)?.getBlockType(e)}function Cc(){return(0,dc.L)(Zu).getBlockTypes()}function Sc(e,t,n){return(0,dc.L)(Zu).getBlockSupport(e,t,n)}function Ac(e,t,n){return(0,dc.L)(Zu).hasBlockSupport(e,t,n)}function Ec(e){return"core/block"===e?.name}function Ic(e){return"core/template-part"===e?.name}const jc=(e,t)=>(0,dc.L)(Zu).getBlockVariations(e,t);(0,nc.X$)([rc.A,oc.A]);const Tc=["#191e23","#f8f9f9"];function Bc(e){var t;return Object.entries(null!==(t=kc(e.name)?.attributes)&&void 0!==t?t:{}).every((([t,n])=>{const r=e.attributes[t];return n.hasOwnProperty("default")?r===n.default:"rich-text"===n.type?!r?.length:void 0===r}))}function Rc(e){return e.name===wc()&&Bc(e)}function Nc(e){return!!e&&("string"==typeof e||(0,k.isValidElement)(e)||"function"==typeof e||e instanceof k.Component)}function Dc(e){return"string"==typeof e?kc(e):e}function Mc(e,t,n="visual"){const{__experimentalLabel:r,title:o}=e,i=r&&r(t,{context:n});return i?i.toPlainText?i.toPlainText():(0,ic.A)(i):o}function Pc(e,t,n,r="vertical"){const o=e?.title,i=e?Mc(e,t,"accessibility"):"",s=void 0!==n,a=i&&i!==o;return s&&"vertical"===r?a?(0,U.sprintf)((0,U.__)("%1$s Block. Row %2$d. %3$s"),o,n,i):(0,U.sprintf)((0,U.__)("%1$s Block. Row %2$d"),o,n):s&&"horizontal"===r?a?(0,U.sprintf)((0,U.__)("%1$s Block. Column %2$d. %3$s"),o,n,i):(0,U.sprintf)((0,U.__)("%1$s Block. Column %2$d"),o,n):a?(0,U.sprintf)((0,U.__)("%1$s Block. %2$s"),o,i):(0,U.sprintf)((0,U.__)("%s Block"),o)}function Oc(e){return void 0!==e.default?e.default:"rich-text"===e.type?new V.RichTextData:void 0}function Lc(e,t){const n=kc(e);if(void 0===n)throw new Error(`Block type '${e}' is not registered.`);return Object.entries(n.attributes).reduce(((e,[n,r])=>{const o=t[n];if(void 0!==o)"rich-text"===r.type?o instanceof V.RichTextData?e[n]=o:"string"==typeof o&&(e[n]=V.RichTextData.fromHTMLString(o)):"string"===r.type&&o instanceof V.RichTextData?e[n]=o.toHTMLString():e[n]=o;else{const t=Oc(r);void 0!==t&&(e[n]=t)}return-1!==["node","children"].indexOf(r.source)&&("string"==typeof e[n]?e[n]=[e[n]]:Array.isArray(e[n])||(e[n]=[])),e}),{})}function Fc(e,t){return Object.fromEntries(Object.entries(e).filter((([e])=>!t.includes(e))))}const zc=[{slug:"text",title:(0,U.__)("Text")},{slug:"media",title:(0,U.__)("Media")},{slug:"design",title:(0,U.__)("Design")},{slug:"widgets",title:(0,U.__)("Widgets")},{slug:"theme",title:(0,U.__)("Theme")},{slug:"embed",title:(0,U.__)("Embeds")},{slug:"reusable",title:(0,U.__)("Reusable blocks")}];function Uc(e){return e.reduce(((e,t)=>({...e,[t.name]:t})),{})}function Vc(e){return e.reduce(((e,t)=>(e.some((e=>e.name===t.name))||e.push(t),e)),[])}function Hc(e){return(t=null,n)=>{switch(n.type){case"REMOVE_BLOCK_TYPES":return-1!==n.names.indexOf(t)?null:t;case e:return n.name||null}return t}}const $c=Hc("SET_DEFAULT_BLOCK_NAME"),Wc=Hc("SET_FREEFORM_FALLBACK_BLOCK_NAME"),Gc=Hc("SET_UNREGISTERED_FALLBACK_BLOCK_NAME"),qc=Hc("SET_GROUPING_BLOCK_NAME"),Kc=(0,B.combineReducers)({bootstrappedBlockTypes:function(e={},t){switch(t.type){case"ADD_BOOTSTRAPPED_BLOCK_TYPE":const{name:n,blockType:r}=t,o=e[n];let i;return o?(void 0===o.blockHooks&&r.blockHooks&&(i={...o,...i,blockHooks:r.blockHooks}),void 0===o.allowedBlocks&&r.allowedBlocks&&(i={...o,...i,allowedBlocks:r.allowedBlocks})):(i=Object.fromEntries(Object.entries(r).filter((([,e])=>null!=e)).map((([e,t])=>[(0,Ja.xQ)(e),t]))),i.name=n),i?{...e,[n]:i}:e;case"REMOVE_BLOCK_TYPES":return Fc(e,t.names)}return e},unprocessedBlockTypes:function(e={},t){switch(t.type){case"ADD_UNPROCESSED_BLOCK_TYPE":return{...e,[t.name]:t.blockType};case"REMOVE_BLOCK_TYPES":return Fc(e,t.names)}return e},blockTypes:function(e={},t){switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Uc(t.blockTypes)};case"REMOVE_BLOCK_TYPES":return Fc(e,t.names)}return e},blockStyles:function(e={},t){var n;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Object.fromEntries(Object.entries(Uc(t.blockTypes)).map((([t,n])=>{var r,o;return[t,Vc([...(null!==(r=n.styles)&&void 0!==r?r:[]).map((e=>({...e,source:"block"}))),...(null!==(o=e[n.name])&&void 0!==o?o:[]).filter((({source:e})=>"block"!==e))])]})))};case"ADD_BLOCK_STYLES":const r={};return t.blockNames.forEach((n=>{var o;r[n]=Vc([...null!==(o=e[n])&&void 0!==o?o:[],...t.styles])})),{...e,...r};case"REMOVE_BLOCK_STYLES":return{...e,[t.blockName]:(null!==(n=e[t.blockName])&&void 0!==n?n:[]).filter((e=>-1===t.styleNames.indexOf(e.name)))}}return e},blockVariations:function(e={},t){var n,r;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Object.fromEntries(Object.entries(Uc(t.blockTypes)).map((([t,n])=>{var r,o;return[t,Vc([...(null!==(r=n.variations)&&void 0!==r?r:[]).map((e=>({...e,source:"block"}))),...(null!==(o=e[n.name])&&void 0!==o?o:[]).filter((({source:e})=>"block"!==e))])]})))};case"ADD_BLOCK_VARIATIONS":return{...e,[t.blockName]:Vc([...null!==(n=e[t.blockName])&&void 0!==n?n:[],...t.variations])};case"REMOVE_BLOCK_VARIATIONS":return{...e,[t.blockName]:(null!==(r=e[t.blockName])&&void 0!==r?r:[]).filter((e=>-1===t.variationNames.indexOf(e.name)))}}return e},defaultBlockName:$c,freeformFallbackBlockName:Wc,unregisteredFallbackBlockName:Gc,groupingBlockName:qc,categories:function(e=zc,t){switch(t.type){case"SET_CATEGORIES":return t.categories||[];case"UPDATE_CATEGORY":if(!t.category||!Object.keys(t.category).length)return e;if(e.find((({slug:e})=>e===t.slug)))return e.map((e=>e.slug===t.slug?{...e,...t.category}:e))}return e},collections:function(e={},t){switch(t.type){case"ADD_BLOCK_COLLECTION":return{...e,[t.namespace]:{title:t.title,icon:t.icon}};case"REMOVE_BLOCK_COLLECTION":return Fc(e,t.namespace)}return e},blockBindingsSources:function(e={},t){return"REGISTER_BLOCK_BINDINGS_SOURCE"===t.type?{...e,[t.sourceName]:{label:t.sourceLabel,getValue:t.getValue,setValue:t.setValue,setValues:t.setValues,getPlaceholder:t.getPlaceholder,canUserEditValue:t.canUserEditValue||(()=>!1)}}:e}});var Yc=n(38986),Jc=n.n(Yc);const Xc=(e,t,n)=>{var r;const o=Array.isArray(t)?t:t.split(".");let i=e;return o.forEach((e=>{i=i?.[e]})),null!==(r=i)&&void 0!==r?r:n},Zc=(e,t)=>"string"==typeof t?eu(e,t):t,Qc=(0,Hs.A)((e=>Object.values(e.blockTypes)),(e=>[e.blockTypes]));function eu(e,t){return e.blockTypes[t]}function tu(e,t){return e.blockStyles[t]}const nu=(0,Hs.A)(((e,t,n)=>{const r=e.blockVariations[t];return r&&n?r.filter((e=>(e.scope||["block","inserter"]).includes(n))):r}),((e,t)=>[e.blockVariations[t]]));function ru(e,t,n,r){const o=nu(e,t,r);if(!o)return o;const i=eu(e,t),s=Object.keys(i?.attributes||{});let a,l=0;for(const e of o)if(Array.isArray(e.isActive)){const t=e.isActive.filter((e=>{const t=e.split(".")[0];return s.includes(t)})),r=t.length;if(0===r)continue;t.every((t=>{const r=Xc(n,t);return void 0!==r&&r===Xc(e.attributes,t)}))&&r>l&&(a=e,l=r)}else if(e.isActive?.(n,e.attributes))return a||e;return a}function ou(e,t,n){const r=nu(e,t,n);return[...r].reverse().find((({isDefault:e})=>!!e))||r[0]}function iu(e){return e.categories}function su(e){return e.collections}function au(e){return e.defaultBlockName}function lu(e){return e.freeformFallbackBlockName}function cu(e){return e.unregisteredFallbackBlockName}function uu(e){return e.groupingBlockName}const du=(0,Hs.A)(((e,t)=>Qc(e).filter((e=>e.parent?.includes(t))).map((({name:e})=>e))),(e=>[e.blockTypes])),hu=(e,t,n,r)=>{const o=Zc(e,t);return o?.supports?Xc(o.supports,n,r):r};function pu(e,t,n,r){return!!hu(e,t,n,r)}function fu(e){return Jc()(null!=e?e:"").toLowerCase().trim()}function mu(e,t,n=""){const r=Zc(e,t),o=fu(n),i=e=>fu(e).includes(o);return i(r.title)||r.keywords?.some(i)||i(r.category)||"string"==typeof r.description&&i(r.description)}const gu=(e,t)=>du(e,t).length>0,bu=(e,t)=>du(e,t).some((t=>pu(e,t,"inserter",!0))),vu=(0,Hs.A)(((e,t)=>{const n=eu(e,t);return!!n&&Object.entries(n.attributes).some((([,{__experimentalRole:e}])=>"content"===e))}),((e,t)=>[e.blockTypes[t]?.attributes])),yu=["background","backgroundColor","color","linkColor","captionColor","buttonColor","headingColor","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","padding","contentSize","wideSize","blockGap","textDecoration","textTransform","letterSpacing"];function _u(e,t,n){return e.filter((e=>!("fontSize"===e&&"heading"===n||"textDecoration"===e&&!t&&"link"!==n||"textTransform"===e&&!t&&!["heading","h1","h2","h3","h4","h5","h6"].includes(n)&&"button"!==n&&"caption"!==n&&"text"!==n||"letterSpacing"===e&&!t&&!["heading","h1","h2","h3","h4","h5","h6"].includes(n)&&"button"!==n&&"caption"!==n&&"text"!==n||"textColumns"===e&&!t)))}const xu=(0,Hs.A)(((e,t,n)=>{if(!t)return _u(yu,t,n);const r=eu(e,t);if(!r)return[];const o=[];return r?.supports?.spacing?.blockGap&&o.push("blockGap"),r?.supports?.shadow&&o.push("shadow"),Object.keys(lc).forEach((e=>{lc[e].support&&(lc[e].requiresOptOut&&lc[e].support[0]in r.supports&&!1!==Xc(r.supports,lc[e].support)||Xc(r.supports,lc[e].support,!1))&&o.push(e)})),_u(o,t,n)}),((e,t)=>[e.blockTypes[t]]));function wu(e,t){return e.bootstrappedBlockTypes[t]}function ku(e){return e.unprocessedBlockTypes}function Cu(e){return e.blockBindingsSources}function Su(e,t){return e.blockBindingsSources[t]}var Au=n(94260),Eu=n(74448),Iu=n(9067);const ju=(...e)=>window?.console?.error?.(...e),Tu={common:"text",formatting:"text",layout:"design"};function Bu(e=[],t=[]){const n=[...e];return t.forEach((e=>{const t=n.findIndex((t=>t.name===e.name));-1!==t?n[t]={...n[t],...e}:n.push(e)})),n}const Ru=(e,t)=>({select:n})=>{const r=n.getBootstrappedBlockType(e),o={name:e,icon:sc,keywords:[],attributes:{},providesContext:{},usesContext:[],selectors:{},supports:{},styles:[],blockHooks:{},save:()=>null,...r,...t,variations:Bu(r?.variations,t?.variations)},i=(0,Iu.applyFilters)("blocks.registerBlockType",o,e,null);if(i.description&&"string"!=typeof i.description&&(0,W.default)("Declaring non-string block descriptions",{since:"6.2"}),i.deprecated&&(i.deprecated=i.deprecated.map((e=>Object.fromEntries(Object.entries((0,Iu.applyFilters)("blocks.registerBlockType",{...Fc(o,ac),...e},o.name,e)).filter((([e])=>ac.includes(e))))))),(0,Au.Q)(i))if("function"==typeof i.save)if(!("edit"in i)||(0,Eu.isValidElementType)(i.edit))if(Tu.hasOwnProperty(i.category)&&(i.category=Tu[i.category]),"category"in i&&!n.getCategories().some((({slug:e})=>e===i.category))&&(((...e)=>{window?.console?.warn?.(...e)})('The block "'+e+'" is registered with an invalid category "'+i.category+'".'),delete i.category),"title"in i&&""!==i.title)if("string"==typeof i.title){if(i.icon=function(e){if(Nc(e=e||sc))return{src:e};if("background"in e){const t=(0,nc.Mj)(e.background),n=e=>t.contrast(e),r=Math.max(...Tc.map(n));return{...e,foreground:e.foreground?e.foreground:Tc.find((e=>n(e)===r)),shadowColor:t.alpha(.3).toRgbString()}}return e}(i.icon),Nc(i.icon.src))return i;ju("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")}else ju("Block titles must be strings.");else ju('The block "'+e+'" must have a title.');else ju('The "edit" property must be a valid component.');else ju('The "save" property must be a valid function.');else ju("Block settings must be a valid object.")};function Nu(e){return{type:"ADD_BLOCK_TYPES",blockTypes:Array.isArray(e)?e:[e]}}function Du(){return({dispatch:e,select:t})=>{const n=[];for(const[r,o]of Object.entries(t.getUnprocessedBlockTypes())){const t=e(Ru(r,o));t&&n.push(t)}n.length&&e.addBlockTypes(n)}}function Mu(){return(0,W.default)('wp.data.dispatch( "core/blocks" ).__experimentalReapplyBlockFilters',{since:"6.4",alternative:"reapplyBlockFilters"}),Du()}function Pu(e){return{type:"REMOVE_BLOCK_TYPES",names:Array.isArray(e)?e:[e]}}function Ou(e,t){return{type:"ADD_BLOCK_STYLES",styles:Array.isArray(t)?t:[t],blockNames:Array.isArray(e)?e:[e]}}function Lu(e,t){return{type:"REMOVE_BLOCK_STYLES",styleNames:Array.isArray(t)?t:[t],blockName:e}}function Fu(e,t){return{type:"ADD_BLOCK_VARIATIONS",variations:Array.isArray(t)?t:[t],blockName:e}}function zu(e,t){return{type:"REMOVE_BLOCK_VARIATIONS",variationNames:Array.isArray(t)?t:[t],blockName:e}}function Uu(e){return{type:"SET_DEFAULT_BLOCK_NAME",name:e}}function Vu(e){return{type:"SET_FREEFORM_FALLBACK_BLOCK_NAME",name:e}}function Hu(e){return{type:"SET_UNREGISTERED_FALLBACK_BLOCK_NAME",name:e}}function $u(e){return{type:"SET_GROUPING_BLOCK_NAME",name:e}}function Wu(e){return{type:"SET_CATEGORIES",categories:e}}function Gu(e,t){return{type:"UPDATE_CATEGORY",slug:e,category:t}}function qu(e,t,n){return{type:"ADD_BLOCK_COLLECTION",namespace:e,title:t,icon:n}}function Ku(e){return{type:"REMOVE_BLOCK_COLLECTION",namespace:e}}function Yu(e,t){return{type:"ADD_BOOTSTRAPPED_BLOCK_TYPE",name:e,blockType:t}}function Ju(e,t){return({dispatch:n})=>{n({type:"ADD_UNPROCESSED_BLOCK_TYPE",name:e,blockType:t});const r=n(Ru(e,t));r&&n.addBlockTypes(r)}}function Xu(e){return{type:"REGISTER_BLOCK_BINDINGS_SOURCE",sourceName:e.name,sourceLabel:e.label,getValue:e.getValue,setValue:e.setValue,setValues:e.setValues,getPlaceholder:e.getPlaceholder,canUserEditValue:e.canUserEditValue}}const Zu=(0,T.A)("core/blocks",{reducer:Kc,selectors:a,actions:c});function Qu(e,t={},n=[]){const r=Lc(e,t);return{clientId:(0,H.A)(),name:e,isValid:!0,attributes:r,innerBlocks:n}}function ed(e=[]){return e.map((e=>{const t=Array.isArray(e)?e:[e.name,e.attributes,e.innerBlocks],[n,r,o=[]]=t;return Qu(n,r,ed(o))}))}function td(e,t={},n){const r=(0,H.A)(),o=Lc(e.name,{...e.attributes,...t});return{...e,clientId:r,attributes:o,innerBlocks:n||e.innerBlocks.map((e=>td(e)))}}function nd(e,t={},n){const r=(0,H.A)();return{...e,clientId:r,attributes:{...e.attributes,...t},innerBlocks:n||e.innerBlocks.map((e=>nd(e)))}}(0,B.register)(Zu),fc(Zu).registerPrivateSelectors(l),fc(Zu).registerPrivateActions(u);const rd=(e,t,n)=>{if(!n.length)return!1;const r=n.length>1,o=n[0].name;if(!od(e)&&r&&!e.isMultiBlock)return!1;if(!od(e)&&!n.every((e=>e.name===o)))return!1;if("block"!==e.type)return!1;const i=n[0];return!("from"===t&&-1===e.blocks.indexOf(i.name)&&!od(e)||!r&&"from"===t&&id(i.name)&&id(e.blockName)||!ld(e,n))},od=e=>e&&"block"===e.type&&Array.isArray(e.blocks)&&e.blocks.includes("*"),id=e=>e===(0,dc.L)(Zu).getGroupingBlockName();function sd(e,t){const n=(0,Iu.createHooks)();for(let r=0;re||o),o.priority)}return n.applyFilters("transform",null)}function ad(e,t){if(void 0===t)return Cc().map((({name:t})=>ad(e,t))).flat();const n=Dc(t),{name:r,transforms:o}=n||{};if(!o||!Array.isArray(o[e]))return[];const i=o.supportedMobileTransforms&&Array.isArray(o.supportedMobileTransforms),s=i?o[e].filter((e=>"raw"===e.type||!(!e.blocks||!e.blocks.length)&&(!!od(e)||e.blocks.every((e=>o.supportedMobileTransforms.includes(e)))))):o[e];return s.map((e=>({...e,blockName:r,usingMobileTransformations:i})))}function ld(e,t){if("function"!=typeof e.isMatch)return!0;const n=t[0],r=e.isMultiBlock?t.map((e=>e.attributes)):n.attributes,o=e.isMultiBlock?t:n;return e.isMatch(r,o)}function cd(e,t){const n=Array.isArray(e)?e:[e],r=n.length>1,o=n[0],i=o.name,s=ad("from",t),a=sd(ad("to",i),(e=>"block"===e.type&&(od(e)||-1!==e.blocks.indexOf(t))&&(!r||e.isMultiBlock)&&ld(e,n)))||sd(s,(e=>"block"===e.type&&(od(e)||-1!==e.blocks.indexOf(i))&&(!r||e.isMultiBlock)&&ld(e,n)));if(!a)return null;let l;return l=a.isMultiBlock?"__experimentalConvert"in a?a.__experimentalConvert(n):a.transform(n.map((e=>e.attributes)),n.map((e=>e.innerBlocks))):"__experimentalConvert"in a?a.__experimentalConvert(o):a.transform(o.attributes,o.innerBlocks),null===l||"object"!=typeof l?null:(l=Array.isArray(l)?l:[l],l.some((e=>!kc(e.name)))?null:l.some((e=>e.name===t))?l.map(((t,n,r)=>(0,Iu.applyFilters)("blocks.switchToBlockType.transformedBlock",t,e,n,r))):null)}const ud=(e,t)=>{try{var n;return Qu(e,t.attributes,(null!==(n=t.innerBlocks)&&void 0!==n?n:[]).map((e=>ud(e.name,e))))}catch{return Qu("core/missing",{originalName:e,originalContent:"",originalUndelimitedContent:""})}};let dd,hd,pd,fd;const md=/)[^])*)\5|[^]*?)}\s+)?(\/)?-->/g;function gd(e,t,n,r,o){return{blockName:e,attrs:t,innerBlocks:n,innerHTML:r,innerContent:o}}function bd(e){return gd(null,{},[],e,[e])}const vd=e=>{dd=e,hd=0,pd=[],fd=[],md.lastIndex=0;do{}while(yd());return pd};function yd(){const e=fd.length,t=function(){const e=md.exec(dd);if(null===e)return["no-more-tokens","",null,0,0];const t=e.index,[n,r,o,i,s,,a]=e,l=n.length,c=!!r,u=!!a,d=(o||"core/")+i,h=!!s?function(e){try{return JSON.parse(e)}catch(e){return null}}(s):{};return u?["void-block",d,h,t,l]:c?["block-closer",d,null,t,l]:["block-opener",d,h,t,l]}(),[n,r,o,i,s]=t,a=i>hd?hd:null;switch(n){case"no-more-tokens":if(0===e)return _d(),!1;if(1===e)return wd(),!1;for(;0)[^\\-]*)*(?:--\x3e)?|!\\[CDATA\\[[^\\]]*(?:](?!]>)[^\\]]*)*?(?:]]>)?)|[^>]*>?))");var Cd=n(19799),Sd=n(49069),Ad=n(42891);function Ed(e,t={}){const{isCommentDelimited:n=!0}=t,{blockName:r,attrs:o={},innerBlocks:i=[],innerContent:s=[]}=e;let a=0;const l=s.map((e=>null!==e?e:Ed(i[a++],t))).join("\n").replace(/\n+/g,"\n").trim();return n?Od(r,o,l):l}var Id=n(86106);function jd(e){const t="wp-block-"+e.replace(/\//,"-").replace(/^core-/,"");return(0,Iu.applyFilters)("blocks.getBlockDefaultClassName",t,e)}function Td(e){const t="editor-block-list-item-"+e.replace(/\//,"-").replace(/^core-/,"");return(0,Iu.applyFilters)("blocks.getBlockMenuDefaultClassName",t,e)}const Bd={},Rd={};function Nd(e={}){const{blockType:t,attributes:n}=Bd;return Nd.skipFilters?e:(0,Iu.applyFilters)("blocks.getSaveContent.extraProps",{...e},t,n)}function Dd(e,t,n=[]){const r=Dc(e);if(!r?.save)return null;let{save:o}=r;if(o.prototype instanceof k.Component){const e=new o({attributes:t});o=e.render.bind(e)}Bd.blockType=r,Bd.attributes=t,Rd.innerBlocks=n;let i=o({attributes:t,innerBlocks:n});if(null!==i&&"object"==typeof i&&(0,Iu.hasFilter)("blocks.getSaveContent.extraProps")&&!(r.apiVersion>1)){const e=(0,Iu.applyFilters)("blocks.getSaveContent.extraProps",{...i.props},r,t);(0,Ad.default)(e,i.props)||(i=(0,k.cloneElement)(i,e))}return(0,Iu.applyFilters)("blocks.getSaveElement",i,r,t)}function Md(e,t,n){const r=Dc(e);return(0,Sd.Ay)(Dd(r,t,n))}function Pd(e){let t=e.originalContent;if(e.isValid||e.innerBlocks.length)try{t=Md(e.name,e.attributes,e.innerBlocks)}catch(e){}return t}function Od(e,t,n){const r=t&&Object.entries(t).length?function(e){return JSON.stringify(e).replace(/--/g,"\\u002d\\u002d").replace(//g,"\\u003e").replace(/&/g,"\\u0026").replace(/\\"/g,"\\u0022")}(t)+" ":"",o=e?.startsWith("core/")?e.slice(5):e;return n?`\x3c!-- wp:${o} ${r}--\x3e\n`+n+`\n\x3c!-- /wp:${o} --\x3e`:`\x3c!-- wp:${o} ${r}/--\x3e`}function Ld(e,t){return(Array.isArray(e)?e:[e]).map((e=>function(e,{isInnerBlocks:t=!1}={}){if(!e.isValid&&e.__unstableBlockSource)return Ed(e.__unstableBlockSource);const n=e.name,r=Pd(e);if(n===xc()||!t&&n===_c())return r;const o=kc(n);if(!o)return r;const i=function(e,t){var n;return Object.entries(null!==(n=e.attributes)&&void 0!==n?n:{}).reduce(((e,[n,r])=>{const o=t[n];return void 0===o||void 0!==r.source||"default"in r&&JSON.stringify(r.default)===JSON.stringify(o)||(e[n]=o),e}),{})}(o,e.attributes);return Od(n,i,r)}(e,t))).join("\n\n")}var Fd=/[\t\n\f ]/,zd=/[A-Za-z]/,Ud=/\r\n?/g;function Vd(e){return Fd.test(e)}function Hd(e){return zd.test(e)}var $d=function(){function e(e,t,n){void 0===n&&(n="precompile"),this.delegate=e,this.entityParser=t,this.mode=n,this.state="beforeData",this.line=-1,this.column=-1,this.input="",this.index=-1,this.tagNameBuffer="",this.states={beforeData:function(){var e=this.peek();if("<"!==e||this.isIgnoredEndTag()){if("precompile"===this.mode&&"\n"===e){var t=this.tagNameBuffer.toLowerCase();"pre"!==t&&"textarea"!==t||this.consume()}this.transitionTo("data"),this.delegate.beginData()}else this.transitionTo("tagOpen"),this.markTagStart(),this.consume()},data:function(){var e=this.peek(),t=this.tagNameBuffer;"<"!==e||this.isIgnoredEndTag()?"&"===e&&"script"!==t&&"style"!==t?(this.consume(),this.delegate.appendToData(this.consumeCharRef()||"&")):(this.consume(),this.delegate.appendToData(e)):(this.delegate.finishData(),this.transitionTo("tagOpen"),this.markTagStart(),this.consume())},tagOpen:function(){var e=this.consume();"!"===e?this.transitionTo("markupDeclarationOpen"):"/"===e?this.transitionTo("endTagOpen"):("@"===e||":"===e||Hd(e))&&(this.transitionTo("tagName"),this.tagNameBuffer="",this.delegate.beginStartTag(),this.appendToTagName(e))},markupDeclarationOpen:function(){var e=this.consume();"-"===e&&"-"===this.peek()?(this.consume(),this.transitionTo("commentStart"),this.delegate.beginComment()):"DOCTYPE"===e.toUpperCase()+this.input.substring(this.index,this.index+6).toUpperCase()&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.transitionTo("doctype"),this.delegate.beginDoctype&&this.delegate.beginDoctype())},doctype:function(){Vd(this.consume())&&this.transitionTo("beforeDoctypeName")},beforeDoctypeName:function(){var e=this.consume();Vd(e)||(this.transitionTo("doctypeName"),this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(e.toLowerCase()))},doctypeName:function(){var e=this.consume();Vd(e)?this.transitionTo("afterDoctypeName"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(e.toLowerCase())},afterDoctypeName:function(){var e=this.consume();if(!Vd(e))if(">"===e)this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData");else{var t=e.toUpperCase()+this.input.substring(this.index,this.index+5).toUpperCase(),n="PUBLIC"===t.toUpperCase(),r="SYSTEM"===t.toUpperCase();(n||r)&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume()),n?this.transitionTo("afterDoctypePublicKeyword"):r&&this.transitionTo("afterDoctypeSystemKeyword")}},afterDoctypePublicKeyword:function(){var e=this.peek();Vd(e)?(this.transitionTo("beforeDoctypePublicIdentifier"),this.consume()):'"'===e?(this.transitionTo("doctypePublicIdentifierDoubleQuoted"),this.consume()):"'"===e?(this.transitionTo("doctypePublicIdentifierSingleQuoted"),this.consume()):">"===e&&(this.consume(),this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},doctypePublicIdentifierDoubleQuoted:function(){var e=this.consume();'"'===e?this.transitionTo("afterDoctypePublicIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(e)},doctypePublicIdentifierSingleQuoted:function(){var e=this.consume();"'"===e?this.transitionTo("afterDoctypePublicIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(e)},afterDoctypePublicIdentifier:function(){var e=this.consume();Vd(e)?this.transitionTo("betweenDoctypePublicAndSystemIdentifiers"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):'"'===e?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):"'"===e&&this.transitionTo("doctypeSystemIdentifierSingleQuoted")},betweenDoctypePublicAndSystemIdentifiers:function(){var e=this.consume();Vd(e)||(">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):'"'===e?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):"'"===e&&this.transitionTo("doctypeSystemIdentifierSingleQuoted"))},doctypeSystemIdentifierDoubleQuoted:function(){var e=this.consume();'"'===e?this.transitionTo("afterDoctypeSystemIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(e)},doctypeSystemIdentifierSingleQuoted:function(){var e=this.consume();"'"===e?this.transitionTo("afterDoctypeSystemIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(e)},afterDoctypeSystemIdentifier:function(){var e=this.consume();Vd(e)||">"===e&&(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},commentStart:function(){var e=this.consume();"-"===e?this.transitionTo("commentStartDash"):">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData(e),this.transitionTo("comment"))},commentStartDash:function(){var e=this.consume();"-"===e?this.transitionTo("commentEnd"):">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("-"),this.transitionTo("comment"))},comment:function(){var e=this.consume();"-"===e?this.transitionTo("commentEndDash"):this.delegate.appendToCommentData(e)},commentEndDash:function(){var e=this.consume();"-"===e?this.transitionTo("commentEnd"):(this.delegate.appendToCommentData("-"+e),this.transitionTo("comment"))},commentEnd:function(){var e=this.consume();">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("--"+e),this.transitionTo("comment"))},tagName:function(){var e=this.consume();Vd(e)?this.transitionTo("beforeAttributeName"):"/"===e?this.transitionTo("selfClosingStartTag"):">"===e?(this.delegate.finishTag(),this.transitionTo("beforeData")):this.appendToTagName(e)},endTagName:function(){var e=this.consume();Vd(e)?(this.transitionTo("beforeAttributeName"),this.tagNameBuffer=""):"/"===e?(this.transitionTo("selfClosingStartTag"),this.tagNameBuffer=""):">"===e?(this.delegate.finishTag(),this.transitionTo("beforeData"),this.tagNameBuffer=""):this.appendToTagName(e)},beforeAttributeName:function(){var e=this.peek();Vd(e)?this.consume():"/"===e?(this.transitionTo("selfClosingStartTag"),this.consume()):">"===e?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):"="===e?(this.delegate.reportSyntaxError("attribute name cannot start with equals sign"),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(e)):(this.transitionTo("attributeName"),this.delegate.beginAttribute())},attributeName:function(){var e=this.peek();Vd(e)?(this.transitionTo("afterAttributeName"),this.consume()):"/"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"="===e?(this.transitionTo("beforeAttributeValue"),this.consume()):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):'"'===e||"'"===e||"<"===e?(this.delegate.reportSyntaxError(e+" is not a valid character within attribute names"),this.consume(),this.delegate.appendToAttributeName(e)):(this.consume(),this.delegate.appendToAttributeName(e))},afterAttributeName:function(){var e=this.peek();Vd(e)?this.consume():"/"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"="===e?(this.consume(),this.transitionTo("beforeAttributeValue")):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(e))},beforeAttributeValue:function(){var e=this.peek();Vd(e)?this.consume():'"'===e?(this.transitionTo("attributeValueDoubleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):"'"===e?(this.transitionTo("attributeValueSingleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.transitionTo("attributeValueUnquoted"),this.delegate.beginAttributeValue(!1),this.consume(),this.delegate.appendToAttributeValue(e))},attributeValueDoubleQuoted:function(){var e=this.consume();'"'===e?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):"&"===e?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(e)},attributeValueSingleQuoted:function(){var e=this.consume();"'"===e?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):"&"===e?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(e)},attributeValueUnquoted:function(){var e=this.peek();Vd(e)?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("beforeAttributeName")):"/"===e?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"&"===e?(this.consume(),this.delegate.appendToAttributeValue(this.consumeCharRef()||"&")):">"===e?(this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.consume(),this.delegate.appendToAttributeValue(e))},afterAttributeValueQuoted:function(){var e=this.peek();Vd(e)?(this.consume(),this.transitionTo("beforeAttributeName")):"/"===e?(this.consume(),this.transitionTo("selfClosingStartTag")):">"===e?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},selfClosingStartTag:function(){">"===this.peek()?(this.consume(),this.delegate.markTagAsSelfClosing(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},endTagOpen:function(){var e=this.consume();("@"===e||":"===e||Hd(e))&&(this.transitionTo("endTagName"),this.tagNameBuffer="",this.delegate.beginEndTag(),this.appendToTagName(e))}},this.reset()}return e.prototype.reset=function(){this.transitionTo("beforeData"),this.input="",this.tagNameBuffer="",this.index=0,this.line=1,this.column=0,this.delegate.reset()},e.prototype.transitionTo=function(e){this.state=e},e.prototype.tokenize=function(e){this.reset(),this.tokenizePart(e),this.tokenizeEOF()},e.prototype.tokenizePart=function(e){for(this.input+=function(e){return e.replace(Ud,"\n")}(e);this.index"!==this.input.substring(this.index,this.index+8)||"style"===e&&""!==this.input.substring(this.index,this.index+8)||"script"===e&&"<\/script>"!==this.input.substring(this.index,this.index+9)},e}(),Wd=function(){function e(e,t){void 0===t&&(t={}),this.options=t,this.token=null,this.startLine=1,this.startColumn=0,this.tokens=[],this.tokenizer=new $d(this,e,t.mode),this._currentAttribute=void 0}return e.prototype.tokenize=function(e){return this.tokens=[],this.tokenizer.tokenize(e),this.tokens},e.prototype.tokenizePart=function(e){return this.tokens=[],this.tokenizer.tokenizePart(e),this.tokens},e.prototype.tokenizeEOF=function(){return this.tokens=[],this.tokenizer.tokenizeEOF(),this.tokens[0]},e.prototype.reset=function(){this.token=null,this.startLine=1,this.startColumn=0},e.prototype.current=function(){var e=this.token;if(null===e)throw new Error("token was unexpectedly null");if(0===arguments.length)return e;for(var t=0;te("Block validation: "+t,...n)}return{error:e(console.error),warning:e(console.warn),getItems:()=>[]}}const qd=/[\t\n\r\v\f ]+/g,Kd=/^[\t\n\r\v\f ]*$/,Yd=/^url\s*\(['"\s]*(.*?)['"\s]*\)$/,Jd=["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"],Xd=[...Jd,"autocapitalize","autocomplete","charset","contenteditable","crossorigin","decoding","dir","draggable","enctype","formenctype","formmethod","http-equiv","inputmode","kind","method","preload","scope","shape","spellcheck","translate","type","wrap"],Zd=[e=>e,function(e){return rh(e).join(" ")}],Qd=/^[\da-z]+$/i,eh=/^#\d+$/,th=/^#x[\da-f]+$/i;class nh{parse(e){if(t=e,Qd.test(t)||eh.test(t)||th.test(t))return(0,Xa.decodeEntities)("&"+e+";");var t}}function rh(e){return e.trim().split(qd)}function oh(e){return e.attributes.filter((e=>{const[t,n]=e;return n||0===t.indexOf("data-")||Xd.includes(t)}))}function ih(e,t,n=Gd()){let r=e.chars,o=t.chars;for(let e=0;e{const[t,...n]=e.split(":"),r=n.join(":");return[t.trim(),ah(r.trim())]}));return Object.fromEntries(t)}const ch={class:(e,t)=>{const[n,r]=[e,t].map(rh),o=n.filter((e=>!r.includes(e))),i=r.filter((e=>!n.includes(e)));return 0===o.length&&0===i.length},style:(e,t)=>N()(...[e,t].map(lh)),...Object.fromEntries(Jd.map((e=>[e,()=>!0])))},uh={StartTag:(e,t,n=Gd())=>e.tagName!==t.tagName&&e.tagName.toLowerCase()!==t.tagName.toLowerCase()?(n.warning("Expected tag name `%s`, instead saw `%s`.",t.tagName,e.tagName),!1):function(e,t,n=Gd()){if(e.length!==t.length)return n.warning("Expected attributes %o, instead saw %o.",t,e),!1;const r={};for(let e=0;ee}}(),r=Dc(t);let o;try{o=Md(r,e.attributes)}catch(e){return n.error("Block validation failed because an error occurred while generating block content:\n\n%s",e.toString()),[!1,n.getItems()]}const i=function(e,t,n=Gd()){if(e===t)return!0;const[r,o]=[e,t].map((e=>function(e,t=Gd()){try{return new Wd(new nh).tokenize(e)}catch(n){t.warning("Malformed HTML detected: %s",e)}return null}(e,n)));if(!r||!o)return!1;let i,s;for(;i=dh(r);){if(s=dh(o),!s)return n.warning("Expected end of content, instead saw %o.",i),!1;if(i.type!==s.type)return n.warning("Expected token of type `%s` (%o), instead saw `%s` (%o).",s.type,s,i.type,i),!1;const e=uh[i.type];if(e&&!e(i,s,n))return!1;hh(i,o[0])?dh(o):hh(s,r[0])&&dh(r)}return!(s=dh(o))||(n.warning("Expected %o, instead saw end of content.",s),!1)}(e.originalContent,o,n);return i||n.error("Block validation failed for `%s` (%o).\n\nContent generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s",r.name,r,o,e.originalContent),[i,n.getItems()]}function fh(e,t){const n={...t};if("core/cover-image"===e&&(e="core/cover"),"core/text"!==e&&"core/cover-text"!==e||(e="core/paragraph"),e&&0===e.indexOf("core/social-link-")&&(n.service=e.substring(17),e="core/social-link"),e&&0===e.indexOf("core-embed/")){const t=e.substring(11),r={speaker:"speaker-deck",polldaddy:"crowdsignal"};n.providerNameSlug=t in r?r[t]:t,["amazon-kindle","wordpress"].includes(t)||(n.responsive=!0),e="core/embed"}if("core/post-comment-author"===e&&(e="core/comment-author-name"),"core/post-comment-content"===e&&(e="core/comment-content"),"core/post-comment-date"===e&&(e="core/comment-date"),"core/comments-query-loop"===e){e="core/comments";const{className:t=""}=n;t.includes("wp-block-comments-query-loop")||(n.className=["wp-block-comments-query-loop",t].join(" "))}if("core/post-comments"===e&&(e="core/comments",n.legacy=!0),globalThis.IS_GUTENBERG_PLUGIN&&n.metadata?.bindings&&("core/paragraph"===e||"core/heading"===e||"core/image"===e||"core/button"===e)&&"core/pattern-overrides"!==n.metadata.bindings.__default?.source){let e=!1;["content","url","title","id","alt","text","linkTarget"].forEach((t=>{"core/pattern-overrides"===n.metadata.bindings[t]?.source&&(e=!0,n.metadata={...n.metadata,bindings:{...n.metadata.bindings}},delete n.metadata.bindings[t])})),e&&(n.metadata.bindings.__default={source:"core/pattern-overrides"})}return[e,n]}var mh=function(){var e;return function(){return e||(e=document.implementation.createHTMLDocument("")),e}}();function gh(e,t){if(t){if("string"==typeof e){var n=mh();n.body.innerHTML=e,e=n.body}if("function"==typeof t)return t(e);if(Object===t.constructor)return Object.keys(t).reduce((function(n,r){var o=t[r];return n[r]=gh(e,o),n}),{})}}function bh(e,t){var n,r;return 1===arguments.length?(n=e,r=void 0):(n=t,r=e),function(e){var t=e;if(r&&(t=e.querySelector(r)),t)return function(e,t){for(var n,r=t.split(".");n=r.shift();){if(!(n in e))return;e=e[n]}return e}(t,n)}}var vh=n(60204);function yh(e){const t={};for(let n=0;n{let n=t;return e&&(n=t.querySelector(e)),n?xh(n.childNodes):[]}}const kh={concat:function(...e){(0,W.default)("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;nfunction(e,t){switch(t){case"rich-text":return e instanceof V.RichTextData;case"string":return"string"==typeof e;case"boolean":return"boolean"==typeof e;case"object":return!!e&&e.constructor===Object;case"null":return null===e;case"array":return Array.isArray(e);case"integer":case"number":return"number"==typeof e}return!0}(e,t)))}(e,Array.isArray(t)?t:[t])}(i,t.type)&&function(e,t){return!Array.isArray(t)||t.includes(e)}(i,t.enum)||(i=void 0),void 0===i&&(i=Oc(t)),i}const Sh=(0,vh.A)((e=>{switch(e.source){case"attribute":{let t=function(e,t){var n,r;return 1===arguments.length?(n=e,r=void 0):(n=t,r=e),function(e){var t=bh(r,"attributes")(e);if(t&&Object.prototype.hasOwnProperty.call(t,n))return t[n].value}}(e.selector,e.attribute);return"boolean"===e.type&&(t=(e=>t=>void 0!==e(t))(t)),t}case"html":return function(e,t){return n=>{let r=n;if(e&&(r=n.querySelector(e)),!r)return"";if(t){let e="";const n=r.children.length;for(let o=0;on=>{const r=e?n.querySelector(e):n;return r?V.RichTextData.fromHTMLElement(r,{preserveWhiteSpace:t}):V.RichTextData.empty()})(e.selector,e.__unstablePreserveWhiteSpace);case"children":return wh(e.selector);case"node":return function(e){return(0,W.default)("wp.blocks.node.matcher",{since:"6.1",version:"6.3",alternative:"html source",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),t=>{let n=t;e&&(n=t.querySelector(e));try{return _h(n)}catch(e){return null}}}(e.selector);case"query":const t=Object.fromEntries(Object.entries(e.query).map((([e,t])=>[e,Sh(t)])));return function(e,t){return function(n){var r=n.querySelectorAll(e);return[].map.call(r,(function(e){return gh(e,t)}))}}(e.selector,t);case"tag":{const t=bh(e.selector,"nodeName");return e=>t(e)?.toLowerCase()}default:console.error(`Unknown source type "${e.source}"`)}}));function Ah(e){return gh(e,(e=>e))}function Eh(e,t){return Sh(t)(Ah(e))}function Ih(e,t,n={}){var r;const o=Ah(t),i=Dc(e),s=Object.fromEntries(Object.entries(null!==(r=i.attributes)&&void 0!==r?r:{}).map((([e,r])=>[e,Ch(e,r,o,n,t)])));return(0,Iu.applyFilters)("blocks.getBlockAttributes",s,i,t,n)}const jh={type:"string",source:"attribute",selector:"[data-custom-class-name] > *",attribute:"class"};function Th(e){const t=Eh(`${e}
`,jh);return t?t.trim().split(/\s+/):[]}function Bh(e,t){const n=function(e,t,n){if(Ac(t,"customClassName",!0)){const{className:r,...o}=e,i=Md(t,o),s=Th(i),a=Th(n).filter((e=>!s.includes(e)));a.length?e.className=a.join(" "):i&&delete e.className}return e}(e.attributes,t,e.originalContent);return{...e,attributes:n}}function Rh(){return!1}function Nh(e,t){const n=_c(),r=e.blockName||_c(),o=e.attrs||{},i=e.innerBlocks||[];let s=e.innerHTML.trim();return r!==n||"core/freeform"!==r||t?.__unstableSkipAutop||(s=function(e,t=!0){const n=[];if(""===e.trim())return"";if(-1!==(e+="\n").indexOf(""),r=t.pop();e="";for(let r=0;r
";n.push([s,o.substr(i)+""]),e+=o.substr(0,i)+s}e+=r}const r="(?: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)";-1!==(e=function(e,t){const n=function(e){const t=[];let n,r=e;for(;n=r.match(kd);){const e=n.index;t.push(r.slice(0,e)),t.push(n[0]),r=r.slice(e+n[0].length)}return r.length&&t.push(r),t}(e);let r=!1;const o=Object.keys(t);for(let e=1;e\s*
/g,"\n\n")).replace(new RegExp("(<"+r+"[\\s/>])","g"),"\n\n$1")).replace(new RegExp("("+r+">)","g"),"$1\n\n")).replace(/\r\n|\r/g,"\n"),{"\n":" \x3c!-- wpnl --\x3e "})).indexOf("")),-1!==e.indexOf("")&&(e=(e=(e=e.replace(/(")).replace(/\s*(<\/?(?:param|embed)[^>]*>)\s*/g,"$1")),-1===e.indexOf("\]]*[>\]])\s*/g,"$1")).replace(/\s*([<\[]\/(?:audio|video)[>\]])/g,"$1")).replace(/\s*(<(?:source|track)[^>]*>)\s*/g,"$1")),-1!==e.indexOf("]*>)/,"$1")).replace(/<\/figcaption>\s*/,""));const o=(e=e.replace(/\n\n+/g,"\n\n")).split(/\n\s*\n/).filter(Boolean);return e="",o.forEach((t=>{e+=""+t.replace(/^\n*|\n*$/g,"")+"
\n"})),e=(e=(e=(e=(e=(e=(e=(e=e.replace(/\s*<\/p>/g,"")).replace(/
([^<]+)<\/(div|address|form)>/g,"
$1
$2>")).replace(new RegExp("\\s*(?"+r+"[^>]*>)\\s*
","g"),"$1")).replace(/(
/g,"$1")).replace(/]*)>/gi,"")).replace(/<\/blockquote><\/p>/g,"
")).replace(new RegExp("\\s*(?"+r+"[^>]*>)","g"),"$1")).replace(new RegExp("(?"+r+"[^>]*>)\\s*
","g"),"$1"),t&&(e=e.replace(/<(script|style).*?<\/\\1>/g,(e=>e[0].replace(/\n/g,""))),e=(e=e.replace(/
|
/g,"
")).replace(/(
)?\s*\n/g,((e,t)=>t?e:"
\n")),e=e.replace(//g,"\n")),e=(e=(e=e.replace(new RegExp("(?"+r+"[^>]*>)\\s*
","g"),"$1")).replace(/
(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)/g,"$1")).replace(/\n<\/p>$/g,"
"),n.forEach((t=>{const[n,r]=t;e=e.replace(n,r)})),-1!==e.indexOf("\x3c!-- wpnl --\x3e")&&(e=e.replace(/\s?\s?/g,"\n")),e}(s).trim()),{...e,blockName:r,attrs:o,innerHTML:s,innerBlocks:i}}function Dh(e,t){let n=Nh(e,t);n=function(e){const[t,n]=fh(e.blockName,e.attrs);return{...e,blockName:t,attrs:n}}(n);let r=kc(n.blockName);r||(n=function(e){const t=xc()||_c(),n=Ed(e,{isCommentDelimited:!1}),r=Ed(e,{isCommentDelimited:!0});return{blockName:t,attrs:{originalName:e.blockName,originalContent:r,originalUndelimitedContent:n},innerHTML:e.blockName?r:e.innerHTML,innerBlocks:e.innerBlocks,innerContent:e.innerContent}}(n),r=kc(n.blockName));const o=n.blockName===_c()||n.blockName===xc();if(!r||!n.innerHTML&&o)return;const i=n.innerBlocks.map((e=>Dh(e,t))).filter((e=>!!e)),s=Qu(n.blockName,Ih(r,n.innerHTML,n.attrs),i);s.originalContent=n.innerHTML;const a=function(e,t){const[n]=ph(e,t);if(n)return{...e,isValid:n,validationIssues:[]};const r=Bh(e,t),[o,i]=ph(e,t);return{...r,isValid:o,validationIssues:i}}(s,r),{validationIssues:l}=a,c=function(e,t,n){const r=t.attrs,{deprecated:o}=n;if(!o||!o.length)return e;for(let i=0;ie(...t))):(console.groupCollapsed("Updated Block: %s",r.name),console.info("Block successfully updated for `%s` (%o).\n\nNew content generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s",r.name,r,Md(r,c.attributes),c.originalContent),console.groupEnd()),c}function Mh(e,t){return vd(e).reduce(((e,n)=>{const r=Dh(n,t);return r&&e.push(r),e}),[])}var Ph=n(28636);function Oh(){return ad("from").filter((({type:e})=>"raw"===e)).map((e=>e.isMatch?e:{...e,isMatch:t=>e.selector&&t.matches(e.selector)}))}function Lh(e,t){const n=document.implementation.createHTMLDocument("");return n.body.innerHTML=e,Array.from(n.body.children).flatMap((e=>{const n=sd(Oh(),(({isMatch:t})=>t(e)));if(!n)return Ph.A.isNative?Mh(`\x3c!-- wp:html --\x3e${e.outerHTML}\x3c!-- /wp:html --\x3e`):Qu("core/html",Ih("core/html",e.outerHTML));const{transform:r,blockName:o}=n;if(r){const n=r(e,t);return e.hasAttribute("class")&&(n.attributes.className=e.getAttribute("class")),n}return Qu(o,Ih(o,e.outerHTML))}))}var Fh=n(59652),zh=n(8171);function Uh(e,t={}){const n=document.implementation.createHTMLDocument(""),r=document.implementation.createHTMLDocument(""),o=n.body,i=r.body;for(o.innerHTML=e;o.firstChild;){const e=o.firstChild;e.nodeType===e.TEXT_NODE?(0,Fh.A)(e)?o.removeChild(e):(i.lastChild&&"P"===i.lastChild.nodeName||i.appendChild(r.createElement("P")),i.lastChild.appendChild(e)):e.nodeType===e.ELEMENT_NODE?"BR"===e.nodeName?(e.nextSibling&&"BR"===e.nextSibling.nodeName&&(i.appendChild(r.createElement("P")),o.removeChild(e.nextSibling)),i.lastChild&&"P"===i.lastChild.nodeName&&i.lastChild.hasChildNodes()?i.lastChild.appendChild(e):o.removeChild(e)):"P"===e.nodeName?(0,Fh.A)(e)&&!t.raw?o.removeChild(e):i.appendChild(e):(0,zh.S)(e)?(i.lastChild&&"P"===i.lastChild.nodeName||i.appendChild(r.createElement("P")),i.lastChild.appendChild(e)):i.appendChild(e):o.removeChild(e)}return i.innerHTML}var Vh=n(52042),Hh=n(32664);function $h(e,t){if(e.nodeType!==e.COMMENT_NODE)return;if("nextpage"!==e.nodeValue&&0!==e.nodeValue.indexOf("more"))return;const n=function(e,t){if("nextpage"===e.nodeValue)return function(e){const t=e.createElement("wp-block");return t.dataset.block="core/nextpage",t}(t);const n=e.nodeValue.slice(4).trim();let r=e,o=!1;for(;r=r.nextSibling;)if(r.nodeType===r.COMMENT_NODE&&"noteaser"===r.nodeValue){o=!0,(0,Hh.A)(r);break}return function(e,t,n){const r=n.createElement("wp-block");return r.dataset.block="core/more",e&&(r.dataset.customText=e),t&&(r.dataset.noTeaser=""),r}(n,o,t)}(e,t);if(e.parentNode&&"P"===e.parentNode.nodeName){const r=Array.from(e.parentNode.childNodes),o=r.indexOf(e),i=e.parentNode.parentNode||t.body,s=(e,n)=>(e||(e=t.createElement("p")),e.appendChild(n),e);[r.slice(0,o).reduce(s,null),n,r.slice(o+1).reduce(s,null)].forEach((t=>t&&i.insertBefore(t,e.parentNode))),(0,Hh.A)(e.parentNode)}else(0,Vh.A)(e,n)}var Wh=n(58475);function Gh(e){return"OL"===e.nodeName||"UL"===e.nodeName}function qh(e){if(!Gh(e))return;const t=e,n=e.previousElementSibling;if(n&&n.nodeName===e.nodeName&&1===t.children.length){for(;t.firstChild;)n.appendChild(t.firstChild);t.parentNode.removeChild(t)}const r=e.parentNode;if(r&&"LI"===r.nodeName&&1===r.children.length&&!/\S/.test((o=r,Array.from(o.childNodes).map((({nodeValue:e=""})=>e)).join("")))){const e=r,n=e.previousElementSibling,o=e.parentNode;n?(n.appendChild(t),o.removeChild(e)):(o.parentNode.insertBefore(t,o),o.parentNode.removeChild(o))}var o;if(r&&Gh(r)){const t=e.previousElementSibling;t?t.appendChild(e):(0,Wh.A)(e)}}function Kh(e){return t=>{"BLOCKQUOTE"===t.nodeName&&(t.innerHTML=Uh(t.innerHTML,e))}}function Yh(e,t=e){const n=e.ownerDocument.createElement("figure");t.parentNode.insertBefore(n,t),n.appendChild(e)}function Jh(e,t,n){if(!function(e,t){var n;const r=e.nodeName.toLowerCase();return"figcaption"!==r&&!(0,zh.jw)(e)&&r in(null!==(n=t?.figure?.children)&&void 0!==n?n:{})}(e,n))return;let r=e;const o=e.parentNode;(function(e,t){var n;return e.nodeName.toLowerCase()in(null!==(n=t?.figure?.children?.a?.children)&&void 0!==n?n:{})})(e,n)&&"A"===o.nodeName&&1===o.childNodes.length&&(r=e.parentNode);const i=r.closest("p,div");i?e.classList?(e.classList.contains("alignright")||e.classList.contains("alignleft")||e.classList.contains("aligncenter")||!i.textContent.trim())&&Yh(r,i):Yh(r,i):"BODY"===r.parentNode.nodeName&&Yh(r)}function Xh(e,t,n=0){const r=Zh(e);r.lastIndex=n;const o=r.exec(t);if(!o)return;if("["===o[1]&&"]"===o[7])return Xh(e,t,r.lastIndex);const i={index:o.index,content:o[0],shortcode:ep(o)};return o[1]&&(i.content=i.content.slice(1),i.index++),o[7]&&(i.content=i.content.slice(0,-1)),i}function Zh(e){return new RegExp("\\[(\\[?)("+e+")(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*(?:\\[(?!\\/\\2\\])[^\\[]*)*)(\\[\\/\\2\\]))?)(\\]?)","g")}const Qh=(0,vh.A)((e=>{const t={},n=[],r=/([\w-]+)\s*=\s*"([^"]*)"(?:\s|$)|([\w-]+)\s*=\s*'([^']*)'(?:\s|$)|([\w-]+)\s*=\s*([^\s'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|'([^']*)'(?:\s|$)|(\S+)(?:\s|$)/g;let o;for(e=e.replace(/[\u00a0\u200b]/g," ");o=r.exec(e);)o[1]?t[o[1].toLowerCase()]=o[2]:o[3]?t[o[3].toLowerCase()]=o[4]:o[5]?t[o[5].toLowerCase()]=o[6]:o[7]?n.push(o[7]):o[8]?n.push(o[8]):o[9]&&n.push(o[9]);return{named:t,numeric:n}}));function ep(e){let t;return t=e[4]?"self-closing":e[6]?"closed":"single",new tp({tag:e[2],attrs:e[3],type:t,content:e[5]})}const tp=Object.assign((function(e){const{tag:t,attrs:n,type:r,content:o}=e||{};if(Object.assign(this,{tag:t,type:r,content:o}),this.attrs={named:{},numeric:[]},!n)return;const i=["named","numeric"];"string"==typeof n?this.attrs=Qh(n):n.length===i.length&&i.every(((e,t)=>e===n[t]))?this.attrs=n:Object.entries(n).forEach((([e,t])=>{this.set(e,t)}))}),{next:Xh,replace:function(e,t,n){return t.replace(Zh(e),(function(e,t,r,o,i,s,a,l){if("["===t&&"]"===l)return e;const c=n(ep(arguments));return c||""===c?t+c+l:e}))},string:function(e){return new tp(e).string()},regexp:Zh,attrs:Qh,fromMatch:ep});Object.assign(tp.prototype,{get(e){return this.attrs["number"==typeof e?"numeric":"named"][e]},set(e,t){return this.attrs["number"==typeof e?"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+'"'})),"single"===this.type?e+"]":"self-closing"===this.type?e+" /]":(e+="]",this.content&&(e+=this.content),e+"[/"+this.tag+"]")}});const np=e=>Array.isArray(e)?e:[e],rp=/(\n|)\s*$/,op=/^\s*(\n|<\/p>)/,ip=function e(t,n=0,r=[]){const o=sd(ad("from"),(e=>-1===r.indexOf(e.blockName)&&"shortcode"===e.type&&np(e.tag).some((e=>Zh(e).test(t)))));if(!o)return[t];const i=np(o.tag).find((e=>Zh(e).test(t)));let s;const a=n;if(s=Xh(i,t,n)){n=s.index+s.content.length;const i=t.substr(0,s.index),l=t.substr(n);if(!(s.shortcode.content?.includes("<")||rp.test(i)&&op.test(l)))return e(t,n);if(o.isMatch&&!o.isMatch(s.shortcode.attrs))return e(t,a,[...r,o.blockName]);let c=[];if("function"==typeof o.transform)c=[].concat(o.transform(s.shortcode.attrs,s)),c=c.map((e=>(e.originalContent=s.shortcode.content,Bh(e,kc(e.name)))));else{const e=Object.fromEntries(Object.entries(o.attributes).filter((([,e])=>e.shortcode)).map((([e,t])=>[e,t.shortcode(s.shortcode.attrs,s)]))),n=kc(o.blockName);if(!n)return[t];const r={...n,attributes:o.attributes};let i=Qu(o.blockName,Ih(r,s.shortcode.content,e));i.originalContent=s.shortcode.content,i=Bh(i,r),c=[i]}return[...e(i.replace(rp,"")),...c,...e(l.replace(op,""))]}return[t]};function sp(e){return function(e,t){const n={phrasingContentSchema:(0,zh.dA)(t),isPaste:"paste"===t},r=e.map((({isMatch:e,blockName:t,schema:r})=>{const o=Ac(t,"anchor");return r="function"==typeof r?r(n):r,o||e?r?Object.fromEntries(Object.entries(r).map((([t,n])=>{let r=n.attributes||[];return o&&(r=[...r,"id"]),[t,{...n,attributes:r,isMatch:e||void 0}]}))):{}:r}));function o(e,t,n){switch(n){case"children":return"*"===e||"*"===t?"*":{...e,...t};case"attributes":case"require":return[...e||[],...t||[]];case"isMatch":if(!e||!t)return;return(...n)=>e(...n)||t(...n)}}function i(e,t){for(const n in t)e[n]=e[n]?o(e[n],t[n],n):{...t[n]};return e}return r.reduce((function(e,t){for(const n in t)e[n]=e[n]?i(e[n],t[n]):{...t[n]};return e}),{})}(Oh(),e)}function ap(e,t,n,r){Array.from(e).forEach((e=>{ap(e.childNodes,t,n,r),t.forEach((t=>{n.contains(e)&&t(e,n,r)}))}))}function lp(e,t=[],n){const r=document.implementation.createHTMLDocument("");return r.body.innerHTML=e,ap(r.body.childNodes,t,r,n),r.body.innerHTML}function cp(e,t){const n=e[`${t}Sibling`];if(n&&(0,zh.S)(n))return n;const{parentNode:r}=e;return r&&(0,zh.S)(r)?cp(r,t):void 0}function up({HTML:e=""}){if(-1!==e.indexOf("\x3c!-- wp:"))return Mh(e);const t=ip(e),n=sp();return t.map((e=>"string"!=typeof e?e:Lh(e=Uh(e=lp(e,[qh,$h,Jh,Kh({raw:!0})],n),{raw:!0}),up))).flat().filter(Boolean)}var dp=n(75450);function hp(e){e.nodeType===e.COMMENT_NODE&&(0,Hh.A)(e)}function pp(e,t){return e.every((e=>function(e,t){if((0,zh.jw)(e))return!0;if(!t)return!1;const n=e.nodeName.toLowerCase();return[["ul","li","ol"],["h1","h2","h3","h4","h5","h6"]].some((e=>0===[n,t].filter((t=>!e.includes(t))).length))}(e,t)&&pp(Array.from(e.children),t)))}function fp(e){return"BR"===e.nodeName&&e.previousSibling&&"BR"===e.previousSibling.nodeName}var mp=n(22676),gp=n(62891);function bp(e,t){if("SPAN"===e.nodeName&&e.style){const{fontWeight:n,fontStyle:r,textDecorationLine:o,textDecoration:i,verticalAlign:s}=e.style;"bold"!==n&&"700"!==n||(0,mp.A)(t.createElement("strong"),e),"italic"===r&&(0,mp.A)(t.createElement("em"),e),("line-through"===o||i.includes("line-through"))&&(0,mp.A)(t.createElement("s"),e),"super"===s?(0,mp.A)(t.createElement("sup"),e):"sub"===s&&(0,mp.A)(t.createElement("sub"),e)}else"B"===e.nodeName?e=(0,gp.A)(e,"strong"):"I"===e.nodeName?e=(0,gp.A)(e,"em"):"A"===e.nodeName&&(e.target&&"_blank"===e.target.toLowerCase()?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 vp(e){"SCRIPT"!==e.nodeName&&"NOSCRIPT"!==e.nodeName&&"TEMPLATE"!==e.nodeName&&"STYLE"!==e.nodeName||e.parentNode.removeChild(e)}function yp(e){if(e.nodeType!==e.ELEMENT_NODE)return;const t=e.getAttribute("style");if(!t||!t.includes("mso-list"))return;const n=t.split(";").reduce(((e,t)=>{const[n,r]=t.split(":");return n&&r&&(e[n.trim().toLowerCase()]=r.trim().toLowerCase()),e}),{});"ignore"===n["mso-list"]&&e.remove()}function _p(e){return"OL"===e.nodeName||"UL"===e.nodeName}function xp(e,t){if("P"!==e.nodeName)return;const n=e.getAttribute("style");if(!n||!n.includes("mso-list"))return;const r=e.previousElementSibling;if(!r||!_p(r)){const n=e.textContent.trim().slice(0,1),r=/[1iIaA]/.test(n),o=t.createElement(r?"ol":"ul");r&&o.setAttribute("type",n),e.parentNode.insertBefore(o,e)}const o=e.previousElementSibling,i=o.nodeName,s=t.createElement("li");let a=o;s.innerHTML=lp(e.innerHTML,[yp]);const l=/mso-list\s*:[^;]+level([0-9]+)/i.exec(n);let c=l&&parseInt(l[1],10)-1||0;for(;c--;)a=a.lastChild||a,_p(a)&&(a=a.lastChild||a);_p(a)||(a=a.appendChild(t.createElement(i))),a.appendChild(s),e.parentNode.removeChild(e)}function wp(e){if("IMG"===e.nodeName){if(0===e.src.indexOf("file:")&&(e.src=""),0===e.src.indexOf("data:")){const[t,n]=e.src.split(","),[r]=t.slice(5).split(";");if(!n||!r)return void(e.src="");let o;try{o=atob(n)}catch(t){return void(e.src="")}const i=new Uint8Array(o.length);for(let e=0;ewindow?.console?.log?.(...e);function Np(e){return e=lp(e,[vp,Ep,yp,bp,hp]),e=lp(e=(0,dp.A)(e,(0,zh.dA)("paste"),{inline:!0}),[Ip,jp]),Rp("Processed inline HTML:\n\n",e),e}function Dp({HTML:e="",plainText:t="",mode:n="AUTO",tagName:r}){if(e=(e=(e=e.replace(/]+>/g,"")).replace(/^\s*]*>\s*]*>(?:\s*)?/i,"")).replace(/(?:\s*)?<\/body>\s*<\/html>\s*$/i,""),"INLINE"!==n){const n=e||t;if(-1!==n.indexOf("\x3c!-- wp:"))return Mh(n)}String.prototype.normalize&&(e=e.normalize()),e=lp(e,[Bp]);const o=t&&(!e||function(e){return!/<(?!br[ />])/i.test(e)}(e));var i;o&&(e=t,/^\s+$/.test(t)||(i=e,e=Sp.makeHtml(function(e){return e.replace(/((?:^|\n)```)([^\n`]+)(```(?:$|\n))/,((e,t,n,r)=>`${t}\n${n}\n${r}`))}(function(e){return e.replace(/(^|\n)•( +)/g,"$1*$2")}(i)))));const s=ip(e),a=s.length>1;if(o&&!a&&"AUTO"===n&&-1===t.indexOf("\n")&&0!==t.indexOf("")&&0===e.indexOf("
")&&(n="INLINE"),"INLINE"===n)return Np(e);if("AUTO"===n&&!a&&function(e,t){const n=document.implementation.createHTMLDocument("");n.body.innerHTML=e;const r=Array.from(n.body.children);return!r.some(fp)&&pp(r,t)}(e,r))return Np(e);const l=(0,zh.dA)("paste"),c=sp("paste"),u=s.map((e=>{if("string"!=typeof e)return e;const t=[Ep,xp,vp,qh,wp,bp,$h,hp,Ap,Jh,Kh(),kp],n={...c,...l};return e=lp(e,t,c),e=lp(e=Uh(e=(0,dp.A)(e,n)),[Ip,jp,Tp],c),Rp("Processed HTML piece:\n\n",e),Lh(e,Dp)})).flat().filter(Boolean);if("AUTO"===n&&1===u.length&&Ac(u[0].name,"__unstablePasteTextInline",!1)){const e=/^[\n]+|[\n]+$/g,n=t.replace(e,"");if(""!==n&&-1===n.indexOf("\n"))return(0,dp.A)(Pd(u[0]),l).replace(e,"")}return u}function Mp(e=[],t=[]){return e.length===t.length&&t.every((([t,,n],r)=>{const o=e[r];return t===o.name&&Mp(o.innerBlocks,n)}))}const Pp=e=>"html"===e?.source,Op=e=>"query"===e?.source;function Lp(e,t){return t?Object.fromEntries(Object.entries(t).map((([t,n])=>[t,Fp(e[t],n)]))):{}}function Fp(e,t){return Pp(e)&&Array.isArray(t)?(0,Sd.Ay)(t):Op(e)&&t?t.map((t=>Lp(e.query,t))):t}function zp(e=[],t){return t?t.map((([t,n,r],o)=>{var i;const s=e[o];if(s&&s.name===t){const e=zp(s.innerBlocks,r);return{...s,innerBlocks:e}}const a=kc(t),l=Lp(null!==(i=a?.attributes)&&void 0!==i?i:{},n);let[c,u]=fh(t,l);return void 0===kc(c)&&(u={originalName:t,originalContent:"",originalUndelimitedContent:""},c="core/missing"),Qu(c,u,zp([],r))})):e}var Up=n(90637),Vp=n(60457);const Hp=Symbol("mayDisplayControls"),$p=Symbol("mayDisplayParentControls"),Wp=Symbol("blockEditingMode"),Gp=Symbol("blockBindings"),qp=Symbol("isPreviewMode"),Kp={name:"",isSelected:!1},Yp=(0,k.createContext)(Kp),{Provider:Jp}=Yp;function Xp(){return(0,k.useContext)(Yp)}var Zp=n(78528);const Qp={insertUsage:{}},ef={alignWide:!1,supportsLayout:!0,colors:[{name:(0,U.__)("Black"),slug:"black",color:"#000000"},{name:(0,U.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,U.__)("White"),slug:"white",color:"#ffffff"},{name:(0,U.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,U.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,U.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,U.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,U.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,U.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,U.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,U.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,U.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,U._x)("Small","font size name"),size:13,slug:"small"},{name:(0,U._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,U._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,U._x)("Large","font size name"),size:36,slug:"large"},{name:(0,U._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,U.__)("Thumbnail")},{slug:"medium",name:(0,U.__)("Medium")},{slug:"large",name:(0,U.__)("Large")},{slug:"full",name:(0,U.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,canLockBlocks:!0,enableOpenverseMediaCategory:!0,clearBlockSelection:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__unstableGalleryWithImageBlocks:!1,__unstableIsPreviewMode:!1,blockInspectorAnimation:{animationParent:"core/navigation","core/navigation":{enterDirection:"leftToRight"},"core/navigation-submenu":{enterDirection:"rightToLeft"},"core/navigation-link":{enterDirection:"rightToLeft"},"core/search":{enterDirection:"rightToLeft"},"core/social-links":{enterDirection:"rightToLeft"},"core/page-list":{enterDirection:"rightToLeft"},"core/spacer":{enterDirection:"rightToLeft"},"core/home-link":{enterDirection:"rightToLeft"},"core/site-title":{enterDirection:"rightToLeft"},"core/site-logo":{enterDirection:"rightToLeft"}},generateAnchors:!1,gradients:[{name:(0,U.__)("Vivid cyan blue to vivid purple"),gradient:"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)",slug:"vivid-cyan-blue-to-vivid-purple"},{name:(0,U.__)("Light green cyan to vivid green cyan"),gradient:"linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)",slug:"light-green-cyan-to-vivid-green-cyan"},{name:(0,U.__)("Luminous vivid amber to luminous vivid orange"),gradient:"linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)",slug:"luminous-vivid-amber-to-luminous-vivid-orange"},{name:(0,U.__)("Luminous vivid orange to vivid red"),gradient:"linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)",slug:"luminous-vivid-orange-to-vivid-red"},{name:(0,U.__)("Very light gray to cyan bluish gray"),gradient:"linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)",slug:"very-light-gray-to-cyan-bluish-gray"},{name:(0,U.__)("Cool to warm spectrum"),gradient:"linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)",slug:"cool-to-warm-spectrum"},{name:(0,U.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,U.__)("Blush bordeaux"),gradient:"linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)",slug:"blush-bordeaux"},{name:(0,U.__)("Luminous dusk"),gradient:"linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)",slug:"luminous-dusk"},{name:(0,U.__)("Pale ocean"),gradient:"linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)",slug:"pale-ocean"},{name:(0,U.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,U.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function tf(e,t,n){return[...e.slice(0,n),...Array.isArray(t)?t:[t],...e.slice(n)]}function nf(e,t,n,r=1){const o=[...e];return o.splice(t,r),tf(o,e.slice(t,t+r),n)}const rf=e=>e;function of(e,t=""){const n=new Map,r=[];return n.set(t,r),e.forEach((e=>{const{clientId:t,innerBlocks:o}=e;r.push(t),of(o,t).forEach(((e,t)=>{n.set(t,e)}))})),n}function sf(e,t=""){const n=[],r=[[t,e]];for(;r.length;){const[e,t]=r.shift();t.forEach((({innerBlocks:t,...o})=>{n.push([o.clientId,e]),t?.length&&r.push([o.clientId,t])}))}return n}function af(e,t=rf){const n=[],r=[...e];for(;r.length;){const{innerBlocks:e,...o}=r.shift();r.push(...e),n.push([o.clientId,t(o)])}return n}function lf(e){return af(e,(e=>{const{attributes:t,...n}=e;return n}))}function cf(e){return af(e,(e=>e.attributes))}function uf(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&N()(e.clientIds,t.clientIds)&&function(e,t){return N()(Object.keys(e),Object.keys(t))}(e.attributes,t.attributes)}function df(e,t){const n=e.tree,r=[...t],o=[...t];for(;r.length;){const e=r.shift();r.push(...e.innerBlocks),o.push(...e.innerBlocks)}for(const e of o)n.set(e.clientId,{});for(const t of o)n.set(t.clientId,Object.assign(n.get(t.clientId),{...e.byClientId.get(t.clientId),attributes:e.attributes.get(t.clientId),innerBlocks:t.innerBlocks.map((e=>n.get(e.clientId)))}))}function hf(e,t,n=!1){const r=e.tree,o=new Set([]),i=new Set;for(const r of t){let t=n?r:e.parents.get(r);do{if(e.controlledInnerBlocks[t]){i.add(t);break}o.add(t),t=e.parents.get(t)}while(void 0!==t)}for(const e of o)r.set(e,{...r.get(e)});for(const t of o)r.get(t).innerBlocks=(e.order.get(t)||[]).map((e=>r.get(e)));for(const t of i)r.set("controlled||"+t,{innerBlocks:(e.order.get(t)||[]).map((e=>r.get(e)))})}const pf=(0,Zp.h)(B.combineReducers,(e=>(t,n)=>{if(t&&"SAVE_REUSABLE_BLOCK_SUCCESS"===n.type){const{id:e,updatedId:r}=n;if(e===r)return t;(t={...t}).attributes=new Map(t.attributes),t.attributes.forEach(((n,o)=>{const{name:i}=t.byClientId.get(o);"core/block"===i&&n.ref===e&&t.attributes.set(o,{...n,ref:r})}))}return e(t,n)}),(e=>(t={},n)=>{const r=e(t,n);if(r===t)return t;switch(r.tree=t.tree?t.tree:new Map,n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":r.tree=new Map(r.tree),df(r,n.blocks),hf(r,n.rootClientId?[n.rootClientId]:[""],!0);break;case"UPDATE_BLOCK":r.tree=new Map(r.tree),r.tree.set(n.clientId,{...r.tree.get(n.clientId),...r.byClientId.get(n.clientId),attributes:r.attributes.get(n.clientId)}),hf(r,[n.clientId],!1);break;case"SYNC_DERIVED_BLOCK_ATTRIBUTES":case"UPDATE_BLOCK_ATTRIBUTES":r.tree=new Map(r.tree),n.clientIds.forEach((e=>{r.tree.set(e,{...r.tree.get(e),attributes:r.attributes.get(e)})})),hf(r,n.clientIds,!1);break;case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=function(e){const t={},n=[...e];for(;n.length;){const{innerBlocks:e,...r}=n.shift();n.push(...e),t[r.clientId]=!0}return t}(n.blocks);r.tree=new Map(r.tree),n.replacedClientIds.forEach((t=>{r.tree.delete(t),e[t]||r.tree.delete("controlled||"+t)})),df(r,n.blocks),hf(r,n.blocks.map((e=>e.clientId)),!1);const o=[];for(const e of n.clientIds){const n=t.parents.get(e);void 0===n||""!==n&&!r.byClientId.get(n)||o.push(n)}hf(r,o,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const o of n.clientIds){const n=t.parents.get(o);void 0===n||""!==n&&!r.byClientId.get(n)||e.push(n)}r.tree=new Map(r.tree),n.removedClientIds.forEach((e=>{r.tree.delete(e),r.tree.delete("controlled||"+e)})),hf(r,e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId?e.push(n.fromRootClientId):e.push(""),n.toRootClientId&&e.push(n.toRootClientId),r.tree=new Map(r.tree),hf(r,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];r.tree=new Map(r.tree),hf(r,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=[];r.attributes.forEach(((t,o)=>{"core/block"===r.byClientId.get(o).name&&t.ref===n.updatedId&&e.push(o)})),r.tree=new Map(r.tree),e.forEach((e=>{r.tree.set(e,{...r.byClientId.get(e),attributes:r.attributes.get(e),innerBlocks:r.tree.get(e).innerBlocks})})),hf(r,e,!1)}}return r}),(e=>(t,n)=>{const r=e=>{let r=e;for(let o=0;o(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const r={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...o}=e.shift();e.push(...n),t.controlledInnerBlocks[o.clientId]&&(r[o.clientId]=!0)}}let o=t;t.order.get(n.rootClientId)&&(o=e(o,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:r,clientIds:t.order.get(n.rootClientId)}));let i=o;if(n.blocks.length){i=e(i,{...n,type:"INSERT_BLOCKS",index:0});const o=new Map(i.order);Object.keys(r).forEach((e=>{t.order.get(e)&&o.set(e,t.order.get(e))})),i.order=o,i.tree=new Map(i.tree),Object.keys(r).forEach((e=>{const n=`controlled||${e}`;t.tree.has(n)&&i.tree.set(n,t.tree.get(n))}))}return i}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:new Map(lf(n.blocks)),attributes:new Map(cf(n.blocks)),order:of(n.blocks),parents:new Map(sf(n.blocks)),controlledInnerBlocks:{}};return e.tree=new Map(t?.tree),df(e,n.blocks),e.tree.set("",{innerBlocks:n.blocks.map((t=>e.tree.get(t.clientId)))}),e}return e(t,n)}),(function(e){let t,n,r=!1;return(o,i)=>{let s,a=e(o,i);var l;if("SET_EXPLICIT_PERSISTENT"===i.type&&(n=i.isPersistentChange,s=null===(l=o.isPersistentChange)||void 0===l||l),void 0!==n)return s=n,s===a.isPersistentChange?a:{...a,isPersistentChange:s};const c="MARK_LAST_CHANGE_AS_PERSISTENT"===i.type||r;var u;return o!==a||c?(a={...a,isPersistentChange:c?!r:!uf(i,t)},t=i,r="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===i.type,a):(r="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===i.type,s=null===(u=o?.isPersistentChange)||void 0===u||u,o.isPersistentChange===s?o:{...a,isPersistentChange:s})}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,r)=>{const o=e(n,r);return o!==n&&(o.isIgnoredChange=t.has(r.type)),o}}),(e=>(t,n)=>{if("SET_HAS_CONTROLLED_INNER_BLOCKS"===n.type){const r=e(t,{type:"REPLACE_INNER_BLOCKS",rootClientId:n.clientId,blocks:[]});return e(r,n)}return e(t,n)}))({byClientId(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const n=new Map(e);return lf(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"UPDATE_BLOCK":{if(!e.has(t.clientId))return e;const{attributes:n,...r}=t.updates;if(0===Object.values(r).length)return e;const o=new Map(e);return o.set(t.clientId,{...e.get(t.clientId),...r}),o}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),lf(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},attributes(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const n=new Map(e);return cf(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"UPDATE_BLOCK":{if(!e.get(t.clientId)||!t.updates.attributes)return e;const n=new Map(e);return n.set(t.clientId,{...e.get(t.clientId),...t.updates.attributes}),n}case"SYNC_DERIVED_BLOCK_ATTRIBUTES":case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e.get(t))))return e;let r=!1;const o=new Map(e);for(const i of t.clientIds){var n;const s=Object.entries(t.uniqueByBlock?t.attributes[i]:null!==(n=t.attributes)&&void 0!==n?n:{});if(0===s.length)continue;let a=!1;const l=e.get(i),c={};s.forEach((([e,t])=>{l[e]!==t&&(a=!0,c[e]=t)})),r=r||a,a&&o.set(i,{...l,...c})}return r?o:e}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),cf(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},order(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":{var n;const r=of(t.blocks),o=new Map(e);return r.forEach(((e,t)=>{""!==t&&o.set(t,e)})),o.set("",(null!==(n=e.get(""))&&void 0!==n?n:[]).concat(r[""])),o}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,r=e.get(n)||[],o=of(t.blocks,n),{index:i=r.length}=t,s=new Map(e);return o.forEach(((e,t)=>{s.set(t,e)})),s.set(n,tf(r,o.get(n),i)),s}case"MOVE_BLOCKS_TO_POSITION":{var r;const{fromRootClientId:n="",toRootClientId:o="",clientIds:i}=t,{index:s=e.get(o).length}=t;if(n===o){const t=e.get(o).indexOf(i[0]),n=new Map(e);return n.set(o,nf(e.get(o),t,s,i.length)),n}const a=new Map(e);return a.set(n,null!==(r=e.get(n)?.filter((e=>!i.includes(e))))&&void 0!==r?r:[]),a.set(o,tf(e.get(o),i,s)),a}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:r=""}=t,o=n[0],i=e.get(r);if(!i.length||o===i[0])return e;const s=i.indexOf(o),a=new Map(e);return a.set(r,nf(i,s,s-1,n.length)),a}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:r=""}=t,o=n[0],i=n[n.length-1],s=e.get(r);if(!s.length||i===s[s.length-1])return e;const a=s.indexOf(o),l=new Map(e);return l.set(r,nf(s,a,a+1,n.length)),l}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const r=of(t.blocks),o=new Map(e);return t.replacedClientIds.forEach((e=>{o.delete(e)})),r.forEach(((e,t)=>{""!==t&&o.set(t,e)})),o.forEach(((e,t)=>{const i=Object.values(e).reduce(((e,t)=>t===n[0]?[...e,...r.get("")]:(-1===n.indexOf(t)&&e.push(t),e)),[]);o.set(t,i)})),o}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n.forEach(((e,r)=>{var o;const i=null!==(o=e?.filter((e=>!t.removedClientIds.includes(e))))&&void 0!==o?o:[];i.length!==e.length&&n.set(r,i)})),n}}return e},parents(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":{const n=new Map(e);return sf(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"INSERT_BLOCKS":{const n=new Map(e);return sf(t.blocks,t.rootClientId||"").forEach((([e,t])=>{n.set(e,t)})),n}case"MOVE_BLOCKS_TO_POSITION":{const n=new Map(e);return t.clientIds.forEach((e=>{n.set(e,t.toRootClientId||"")})),n}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),sf(t.blocks,e.get(t.clientIds[0])).forEach((([e,t])=>{n.set(e,t)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},controlledInnerBlocks:(e={},{type:t,clientId:n,hasControlledInnerBlocks:r})=>"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:r}:e});function ff(e={},t){switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return t.updateSelection&&t.blocks.length?{clientId:t.blocks[0].clientId}:e;case"REMOVE_BLOCKS":return t.clientIds&&t.clientIds.length&&-1!==t.clientIds.indexOf(e.clientId)?{}:e;case"REPLACE_BLOCKS":{if(-1===t.clientIds.indexOf(e.clientId))return e;const n=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return n?n.clientId===e.clientId?e:{clientId:n.clientId}:{}}}return e}const mf=(0,B.combineReducers)({blocks:pf,isDragging:function(e=!1,t){switch(t.type){case"START_DRAGGING":return!0;case"STOP_DRAGGING":return!1}return e},isTyping:function(e=!1,t){switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},isBlockInterfaceHidden:function(e=!1,t){switch(t.type){case"HIDE_BLOCK_INTERFACE":return!0;case"SHOW_BLOCK_INTERFACE":return!1}return e},draggedBlocks:function(e=[],t){switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},selection:function(e={},t){switch(t.type){case"SELECTION_CHANGE":return t.clientId?{selectionStart:{clientId:t.clientId,attributeKey:t.attributeKey,offset:t.startOffset},selectionEnd:{clientId:t.clientId,attributeKey:t.attributeKey,offset:t.endOffset}}:{selectionStart:t.start||e.selectionStart,selectionEnd:t.end||e.selectionEnd};case"RESET_SELECTION":const{selectionStart:n,selectionEnd:r}=t;return{selectionStart:n,selectionEnd:r};case"MULTI_SELECT":const{start:o,end:i}=t;return o===e.selectionStart?.clientId&&i===e.selectionEnd?.clientId?e:{selectionStart:{clientId:o},selectionEnd:{clientId:i}};case"RESET_BLOCKS":const s=e?.selectionStart?.clientId,a=e?.selectionEnd?.clientId;if(!s&&!a)return e;if(!t.blocks.some((e=>e.clientId===s)))return{selectionStart:{},selectionEnd:{}};if(!t.blocks.some((e=>e.clientId===a)))return{...e,selectionEnd:e.selectionStart}}const n=ff(e.selectionStart,t),r=ff(e.selectionEnd,t);return n===e.selectionStart&&r===e.selectionEnd?e:{selectionStart:n,selectionEnd:r}},isMultiSelecting:function(e=!1,t){switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(e=!0,t){return"TOGGLE_SELECTION"===t.type?t.isSelectionEnabled:e},initialPosition:function(e=null,t){return"REPLACE_BLOCKS"===t.type&&void 0!==t.initialPosition||["MULTI_SELECT","SELECT_BLOCK","RESET_SELECTION","INSERT_BLOCKS","REPLACE_INNER_BLOCKS"].includes(t.type)?t.initialPosition:e},blocksMode:function(e={},t){if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:(e={},t)=>{switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return Object.fromEntries(Object.entries(e).filter((([e])=>!t.clientIds.includes(e))));case"UPDATE_BLOCK_LIST_SETTINGS":{const n="string"==typeof t.clientId?{[t.clientId]:t.settings}:t.clientId;for(const t in n)n[t]?N()(e[t],n[t])&&delete n[t]:e[t]||delete n[t];if(0===Object.keys(n).length)return e;const r={...e,...n};for(const e in n)n[e]||delete r[e];return r}}return e},insertionPoint:function(e=null,t){switch(t.type){case"SHOW_INSERTION_POINT":{const{rootClientId:n,index:r,__unstableWithInserter:o,operation:i,nearestSide:s}=t,a={rootClientId:n,index:r,__unstableWithInserter:o,operation:i,nearestSide:s};return N()(e,a)?e:a}case"HIDE_INSERTION_POINT":return null}return e},template:function(e={isValid:!0},t){return"SET_TEMPLATE_VALIDITY"===t.type?{...e,isValid:t.isValid}:e},settings:function(e=ef,t){return"UPDATE_SETTINGS"===t.type?t.reset?{...ef,...t.settings}:{...e,...t.settings}:e},preferences:function(e=Qp,t){switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":{const n=t.blocks.reduce(((e,n)=>{const{attributes:r,name:o}=n;let i=o;const s=(0,dc.L)(Zu).getActiveBlockVariation(o,r);return s?.name&&(i+="/"+s.name),"core/block"===o&&(i+="/"+r.ref),{...e,[i]:{time:t.time,count:e[i]?e[i].count+1:1}}}),e.insertUsage);return{...e,insertUsage:n}}}return e},lastBlockAttributesChange:function(e=null,t){switch(t.type){case"UPDATE_BLOCK":if(!t.updates.attributes)break;return{[t.clientId]:t.updates.attributes};case"UPDATE_BLOCK_ATTRIBUTES":return t.clientIds.reduce(((e,n)=>({...e,[n]:t.uniqueByBlock?t.attributes[n]:t.attributes})),{})}return e},lastFocus:function(e=!1,t){return"LAST_FOCUS"===t.type?t.lastFocus:e},editorMode:function(e="edit",t){return"INSERT_BLOCKS"===t.type&&"navigation"===e?"edit":"SET_EDITOR_MODE"===t.type?t.mode:e},hasBlockMovingClientId:function(e=null,t){return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_EDITOR_MODE"===t.type?null:e},expandedBlock:function(e=null,t){switch(t.type){case"SET_BLOCK_EXPANDED_IN_LIST_VIEW":return t.clientId;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},highlightedBlock:function(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":const{clientId:n,isHighlighted:r}=t;return r?n:e===n?null:e;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},lastBlockInserted:function(e={},t){switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":if(!t.blocks.length)return e;const n=t.blocks.map((e=>e.clientId)),r=t.meta?.source;return{clientIds:n,source:r};case"RESET_BLOCKS":return{}}return e},temporarilyEditingAsBlocks:function(e="",t){return"SET_TEMPORARILY_EDITING_AS_BLOCKS"===t.type?t.temporarilyEditingAsBlocks:e},temporarilyEditingFocusModeRevert:function(e="",t){return"SET_TEMPORARILY_EDITING_AS_BLOCKS"===t.type?t.focusModeToRevert:e},blockVisibility:function(e={},t){return"SET_BLOCK_VISIBILITY"===t.type?{...e,...t.updates}:e},blockEditingModes:function(e=new Map,t){switch(t.type){case"SET_BLOCK_EDITING_MODE":return new Map(e).set(t.clientId,t.mode);case"UNSET_BLOCK_EDITING_MODE":{const n=new Map(e);return n.delete(t.clientId),n}case"RESET_BLOCKS":return e.has("")?(new Map).set("",e.get("")):e}return e},styleOverrides:function(e=new Map,t){switch(t.type){case"SET_STYLE_OVERRIDE":return new Map(e).set(t.id,t.style);case"DELETE_STYLE_OVERRIDE":{const n=new Map(e);return n.delete(t.id),n}}return e},removalPromptData:function(e=!1,t){switch(t.type){case"DISPLAY_BLOCK_REMOVAL_PROMPT":const{clientIds:e,selectPrevious:n,message:r}=t;return{clientIds:e,selectPrevious:n,message:r};case"CLEAR_BLOCK_REMOVAL_PROMPT":return!1}return e},blockRemovalRules:function(e=!1,t){return"SET_BLOCK_REMOVAL_RULES"===t.type?t.rules:e},openedBlockSettingsMenu:function(e=null,t){var n;return"SET_OPENED_BLOCK_SETTINGS_MENU"===t.type?null!==(n=t?.clientId)&&void 0!==n?n:null:e},registeredInserterMediaCategories:function(e=[],t){return"REGISTER_INSERTER_MEDIA_CATEGORY"===t.type?[...e,t.category]:e}}),gf=function(e){return(t,n)=>{const r=e(t,n);return t?(r.automaticChangeStatus=t.automaticChangeStatus,"MARK_AUTOMATIC_CHANGE"===n.type?{...r,automaticChangeStatus:"pending"}:"MARK_AUTOMATIC_CHANGE_FINAL"===n.type&&"pending"===t.automaticChangeStatus?{...r,automaticChangeStatus:"final"}:r.blocks===t.blocks&&r.selection===t.selection||"final"!==r.automaticChangeStatus&&r.selection!==t.selection?r:{...r,automaticChangeStatus:void 0}):r}}(mf);var bf=n(28510);const vf=Symbol("globalStylesDataKey"),yf=Symbol("selectBlockPatternsKey"),_f=Symbol("reusableBlocksSelect"),{lock:xf,unlock:wf}=(0,Bl.yf)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/block-editor"),kf="core/block-editor",Cf=Symbol("withRootClientId"),Sf=(e,t,n=null)=>"boolean"==typeof e?e:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n,Af=(e,t)=>{if("boolean"==typeof t)return t;const n=[...e];for(;n.length>0;){const e=n.shift();if(!Sf(t,e.name||e.blockName,!0))return!1;e.innerBlocks?.forEach((e=>{n.push(e)}))}return!0},Ef=e=>t=>[t.settings.__experimentalBlockPatterns,t.settings.__experimentalUserPatternCategories,t.settings.__experimentalReusableBlocks,t.settings[yf]?.(e),t.blockPatterns,wf(e(kf)).getReusableBlocks()];function If(e,t){return[e.blockListSettings[t],e.blocks.byClientId.get(t),e.settings.allowedBlockTypes,e.settings.templateLock,e.blockEditingModes]}const jf=(e,t,n)=>(r,o)=>{let i,s;if("function"==typeof e?(i=e(r),s=e(o)):(i=r[e],s=o[e]),i>s)return"asc"===n?1:-1;if(s>i)return"asc"===n?-1:1;const a=t.findIndex((e=>e===r)),l=t.findIndex((e=>e===o));return a>l?1:l>a?-1:0};function Tf(e,t,n="asc"){return e.concat().sort(jf(t,e,n))}const Bf={user:"user",theme:"theme",directory:"directory"},Rf={full:"fully",unsynced:"unsynced"},Nf={name:"allPatterns",label:(0,U._x)("All","patterns")},Df={name:"myPatterns",label:(0,U.__)("My patterns")};function Mf(e,t,n){const r=e.name.startsWith("core/block"),o="core"===e.source||e.source?.startsWith("pattern-directory");return!(t!==Bf.theme||!r&&!o)||!(t!==Bf.directory||!r&&o)||t===Bf.user&&e.type!==Bf.user||n===Rf.full&&""!==e.syncStatus||!(n!==Rf.unsynced||"unsynced"===e.syncStatus||!r)}function Pf(e,t,n){t=Array.isArray(t)?[...t]:[t],e=Array.isArray(e)?[...e]:{...e};const r=t.pop();let o=e;for(const e of t){const t=o[e];o=o[e]=Array.isArray(t)?[...t]:{...t}}return o[r]=n,e}const Of=(e,t,n)=>{var r;const o=Array.isArray(t)?t:t.split(".");let i=e;return o.forEach((e=>{i=i?.[e]})),null!==(r=i)&&void 0!==r?r:n},Lf=["color","border","dimensions","typography","spacing"],Ff={"color.palette":e=>e.colors,"color.gradients":e=>e.gradients,"color.custom":e=>void 0===e.disableCustomColors?void 0:!e.disableCustomColors,"color.customGradient":e=>void 0===e.disableCustomGradients?void 0:!e.disableCustomGradients,"typography.fontSizes":e=>e.fontSizes,"typography.customFontSize":e=>void 0===e.disableCustomFontSizes?void 0:!e.disableCustomFontSizes,"typography.lineHeight":e=>e.enableCustomLineHeight,"spacing.units":e=>{if(void 0!==e.enableCustomUnits)return!0===e.enableCustomUnits?["px","em","rem","vh","vw","%"]:e.enableCustomUnits},"spacing.padding":e=>e.enableCustomSpacing},zf={"border.customColor":"border.color","border.customStyle":"border.style","border.customWidth":"border.width","typography.customFontStyle":"typography.fontStyle","typography.customFontWeight":"typography.fontWeight","typography.customLetterSpacing":"typography.letterSpacing","typography.customTextDecorations":"typography.textDecoration","typography.customTextTransforms":"typography.textTransform","border.customRadius":"border.radius","spacing.customMargin":"spacing.margin","spacing.customPadding":"spacing.padding","typography.customLineHeight":"typography.lineHeight"},Uf=e=>zf[e]||e;function Vf(e,t,...n){const r=gm(e,t),o=[];if(t){let n=t;do{Ac(gm(e,n),"__experimentalSettings",!1)&&o.push(n)}while(n=e.blocks.parents.get(n))}return n.map((n=>{if(Lf.includes(n))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let i=(0,Iu.applyFilters)("blockEditor.useSetting.before",void 0,n,t,r);if(void 0!==i)return i;const s=Uf(n);for(const t of o){var a;const n=vm(e,t);if(i=null!==(a=Of(n.settings?.blocks?.[r],s))&&void 0!==a?a:Of(n.settings,s),void 0!==i)break}const l=ob(e);var c,u;if(void 0===i&&r&&(i=Of(l.__experimentalFeatures?.blocks?.[r],s)),void 0===i&&(i=Of(l.__experimentalFeatures,s)),void 0!==i)return uc[s]?null!==(c=null!==(u=i.custom)&&void 0!==u?u:i.theme)&&void 0!==c?c:i.default:i;const d=Ff[s]?.(l);return void 0!==d?d:"typography.dropCap"===s||void 0}))}function Hf(e){return e.isBlockInterfaceHidden}function $f(e){return e?.lastBlockInserted?.clientIds}function Wf(e,t){return e.blocks.byClientId.get(t)}const Gf=(e,t)=>{const n=t=>"disabled"===wb(e,t)&&ug(e,t).every(n);return ug(e,t).every(n)},qf=(0,Hs.A)((function e(t,n){const r=ug(t,n),o=[];for(const n of r){const r=e(t,n);"disabled"!==wb(t,n)?o.push({clientId:n,innerBlocks:r}):o.push(...r)}return o}),(e=>[e.blocks.order,e.blockEditingModes,e.settings.templateLock,e.blockListSettings])),Kf=(0,Hs.A)(((e,t,n=!1)=>Um(e,t,n).filter((t=>"disabled"!==wb(e,t)))),(e=>[e.blocks.parents,e.blockEditingModes,e.settings.templateLock,e.blockListSettings]));function Yf(e){return e.removalPromptData}function Jf(e){return e.blockRemovalRules}function Xf(e){return e.openedBlockSettingsMenu}const Zf=(0,Hs.A)((e=>{const t=Sm(e).reduce(((e,t,n)=>(e[t]=n,e)),{});return[...e.styleOverrides].sort(((e,n)=>{var r,o;const[,{clientId:i}]=e,[,{clientId:s}]=n;return(null!==(r=t[i])&&void 0!==r?r:-1)-(null!==(o=t[s])&&void 0!==o?o:-1)}))}),(e=>[e.blocks.order,e.styleOverrides]));function Qf(e){return e.registeredInserterMediaCategories}const em=(0,Hs.A)((e=>{const{settings:{inserterMediaCategories:t,allowedMimeTypes:n,enableOpenverseMediaCategory:r},registeredInserterMediaCategories:o}=e;if(!t&&!o.length||!n)return;const i=t?.map((({name:e})=>e))||[],s=[...t||[],...(o||[]).filter((({name:e})=>!i.includes(e)))];return s.filter((e=>!(!r&&"openverse"===e.name)&&Object.values(n).some((t=>t.startsWith(`${e.mediaType}/`)))))}),(e=>[e.settings.inserterMediaCategories,e.settings.allowedMimeTypes,e.settings.enableOpenverseMediaCategory,e.registeredInserterMediaCategories])),tm=(0,Vs.N)((e=>(0,Hs.A)(((t,n=null)=>{const{getAllPatterns:r,__experimentalGetParsedPattern:o}=wf(e(kf)),i=r(),{allowedBlockTypes:s}=ob(t);return i.some((({name:e,inserter:r=!0})=>{if(!r)return!1;const{blocks:i}=o(e);return Af(i,s)&&i.every((({name:e})=>Rg(t,e,n)))}))}),((t,n)=>[...Ef(e)(t),...If(t,n)]))));function nm(e,t=[]){return{name:`core/block/${e.id}`,id:e.id,type:Bf.user,title:e.title.raw,categories:e.wp_pattern_category.map((e=>{const n=t.find((({id:t})=>t===e));return n?n.slug:e})),content:e.content.raw,syncStatus:e.wp_pattern_sync_status}}const rm=(0,Vs.N)((e=>(0,Hs.A)(((t,n)=>{var r,o;if(n?.startsWith("core/block/")){const r=parseInt(n.slice(11),10),o=wf(e(kf)).getReusableBlocks().find((({id:e})=>e===r));return o?nm(o,t.settings.__experimentalUserPatternCategories):null}return[...null!==(r=t.settings.__experimentalBlockPatterns)&&void 0!==r?r:[],...null!==(o=t.settings[yf]?.(e))&&void 0!==o?o:[]].find((({name:e})=>e===n))}),((t,n)=>n?.startsWith("core/block/")?[wf(e(kf)).getReusableBlocks(),t.settings.__experimentalReusableBlocks]:[t.settings.__experimentalBlockPatterns,t.settings[yf]?.(e)])))),om=(0,Vs.N)((e=>(0,Hs.A)((t=>{var n,r;return[...wf(e(kf)).getReusableBlocks().map((e=>nm(e,t.settings.__experimentalUserPatternCategories))),...null!==(n=t.settings.__experimentalBlockPatterns)&&void 0!==n?n:[],...null!==(r=t.settings[yf]?.(e))&&void 0!==r?r:[]].filter(((e,t,n)=>t===n.findIndex((t=>e.name===t.name))))}),Ef(e)))),im=(0,Vs.N)((e=>(0,Hs.A)((t=>{const n=t.settings[yf],r=t.settings[_f];return!!n&&void 0===n(e)||!!r&&void 0===r(e)}),Ef(e)))),sm=[],am=(0,Vs.N)((e=>t=>{var n;const r=t.settings[_f];return r?r(e):null!==(n=t.settings.__experimentalReusableBlocks)&&void 0!==n?n:sm}));function lm(e){return e.lastFocus}function cm(e){return e.isDragging}function um(e){return e.expandedBlock}const dm=(0,Hs.A)(((e,t)=>{let n,r=t;for(;r=e.blocks.parents.get(r);)"core/block"!==gm(e,r)&&"contentOnly"!==Tg(e,r)||(n=r);return n}),(e=>[e.blocks.parents,e.blockListSettings]));function hm(e){return e.temporarilyEditingAsBlocks}function pm(e){return e.temporarilyEditingFocusModeRevert}const fm=[],mm=new Set;function gm(e,t){const n=e.blocks.byClientId.get(t),r="core/social-link";if("web"!==Ph.A.OS&&n?.name===r){const n=e.blocks.attributes.get(t),{service:o}=null!=n?n:{};return o?`${r}-${o}`:r}return n?n.name:null}function bm(e,t){const n=e.blocks.byClientId.get(t);return!!n&&n.isValid}function vm(e,t){return e.blocks.byClientId.get(t)?e.blocks.attributes.get(t):null}function ym(e,t){return e.blocks.byClientId.has(t)?e.blocks.tree.get(t):null}const _m=(0,Hs.A)(((e,t)=>{const n=e.blocks.byClientId.get(t);return n?{...n,attributes:vm(e,t)}:null}),((e,t)=>[e.blocks.byClientId.get(t),e.blocks.attributes.get(t)]));function xm(e,t){const n=t&&mb(e,t)?"controlled||"+t:t||"";return e.blocks.tree.get(n)?.innerBlocks||fm}const wm=(0,Hs.A)(((e,t)=>((0,W.default)("wp.data.select( 'core/block-editor' ).__unstableGetClientIdWithClientIdsTree",{since:"6.3",version:"6.5"}),{clientId:t,innerBlocks:km(e,t)})),(e=>[e.blocks.order])),km=(0,Hs.A)(((e,t="")=>((0,W.default)("wp.data.select( 'core/block-editor' ).__unstableGetClientIdsTree",{since:"6.3",version:"6.5"}),ug(e,t).map((t=>wm(e,t))))),(e=>[e.blocks.order])),Cm=(0,Hs.A)(((e,t)=>{t=Array.isArray(t)?[...t]:[t];const n=[];for(const r of t){const t=e.blocks.order.get(r);t&&n.push(...t)}let r=0;for(;r[e.blocks.order])),Sm=e=>Cm(e,""),Am=(0,Hs.A)(((e,t)=>{const n=Sm(e);if(!t)return n.length;let r=0;for(const o of n)e.blocks.byClientId.get(o).name===t&&r++;return r}),(e=>[e.blocks.order,e.blocks.byClientId])),Em=(0,Hs.A)(((e,t)=>{if(!t)return fm;const n=Array.isArray(t)?t:[t],r=Sm(e).filter((t=>{const r=e.blocks.byClientId.get(t);return n.includes(r.name)}));return r.length>0?r:fm}),(e=>[e.blocks.order,e.blocks.byClientId]));function Im(e,t){return(0,W.default)("wp.data.select( 'core/block-editor' ).__experimentalGetGlobalBlocksByName",{since:"6.5",alternative:"wp.data.select( 'core/block-editor' ).getBlocksByName"}),Em(e,t)}const jm=(0,Hs.A)(((e,t)=>(Array.isArray(t)?t:[t]).map((t=>ym(e,t)))),((e,t)=>(Array.isArray(t)?t:[t]).map((t=>e.blocks.tree.get(t))))),Tm=(0,Hs.A)(((e,t)=>jm(e,t).filter(Boolean).map((e=>e.name))),((e,t)=>jm(e,t)));function Bm(e,t){return ug(e,t).length}function Rm(e){return e.selection.selectionStart}function Nm(e){return e.selection.selectionEnd}function Dm(e){return e.selection.selectionStart.clientId}function Mm(e){return e.selection.selectionEnd.clientId}function Pm(e){return Jm(e).length||(e.selection.selectionStart.clientId?1:0)}function Om(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function Lm(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:r}=t;return r&&r===n.clientId?r:null}function Fm(e){const t=Lm(e);return t?ym(e,t):null}function zm(e,t){var n;return null!==(n=e.blocks.parents.get(t))&&void 0!==n?n:null}const Um=(0,Hs.A)(((e,t,n=!1)=>{const r=[];let o=t;for(;o=e.blocks.parents.get(o);)r.push(o);return r.length?n?r:r.reverse():fm}),(e=>[e.blocks.parents])),Vm=(0,Hs.A)(((e,t,n,r=!1)=>{const o=Um(e,t,r),i=Array.isArray(n)?e=>n.includes(e):e=>n===e;return o.filter((t=>i(gm(e,t))))}),(e=>[e.blocks.parents]));function Hm(e,t){let n,r=t;do{n=r,r=e.blocks.parents.get(r)}while(r);return n}function $m(e,t){const n=Lm(e),r=[...Um(e,t),t],o=[...Um(e,n),n];let i;const s=Math.min(r.length,o.length);for(let e=0;e{const{selectionStart:t,selectionEnd:n}=e.selection;if(!t.clientId||!n.clientId)return fm;if(t.clientId===n.clientId)return[t.clientId];const r=zm(e,t.clientId);if(null===r)return fm;const o=ug(e,r),i=o.indexOf(t.clientId),s=o.indexOf(n.clientId);return i>s?o.slice(s,i+1):o.slice(i,s+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Jm(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?fm:Ym(e)}const Xm=(0,Hs.A)((e=>{const t=Jm(e);return t.length?t.map((t=>ym(e,t))):fm}),(e=>[...Ym.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Zm(e){return Jm(e)[0]||null}function Qm(e){const t=Jm(e);return t[t.length-1]||null}function eg(e,t){return Zm(e)===t}function tg(e,t){return-1!==Jm(e).indexOf(t)}const ng=(0,Hs.A)(((e,t)=>{let n=t,r=!1;for(;n&&!r;)n=zm(e,n),r=tg(e,n);return r}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function rg(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function og(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function ig(e){const t=Rm(e),n=Nm(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function sg(e){const t=Rm(e),n=Nm(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function ag(e){return Ym(e).some((t=>!kc(gm(e,t)).merge))}function lg(e,t){const n=Rm(e),r=Nm(e);if(n.clientId===r.clientId)return!1;if(!n.attributeKey||!r.attributeKey||void 0===n.offset||void 0===r.offset)return!1;const o=zm(e,n.clientId);if(o!==zm(e,r.clientId))return!1;const i=ug(e,o);let s,a;i.indexOf(n.clientId)>i.indexOf(r.clientId)?(s=r,a=n):(s=n,a=r);const l=t?a.clientId:s.clientId,c=t?s.clientId:a.clientId,u=gm(e,l);if(!kc(u).merge)return!1;const d=ym(e,c);if(d.name===u)return!0;const h=cd(d,u);return h&&h.length}const cg=e=>{const t=Rm(e),n=Nm(e);if(t.clientId===n.clientId)return fm;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return fm;const r=zm(e,t.clientId);if(r!==zm(e,n.clientId))return fm;const o=ug(e,r),i=o.indexOf(t.clientId),s=o.indexOf(n.clientId),[a,l]=i>s?[n,t]:[t,n],c=ym(e,a.clientId),u=ym(e,l.clientId),d=c.attributes[a.attributeKey],h=u.attributes[l.attributeKey];let p=(0,V.create)({html:d}),f=(0,V.create)({html:h});return p=(0,V.remove)(p,0,a.offset),f=(0,V.remove)(f,l.offset,f.text.length),[{...c,attributes:{...c.attributes,[a.attributeKey]:(0,V.toHTMLString)({value:p})}},{...u,attributes:{...u.attributes,[l.attributeKey]:(0,V.toHTMLString)({value:f})}}]};function ug(e,t){return e.blocks.order.get(t||"")||fm}function dg(e,t){return ug(e,zm(e,t)).indexOf(t)}function hg(e,t){const{selectionStart:n,selectionEnd:r}=e.selection;return n.clientId===r.clientId&&n.clientId===t}function pg(e,t,n=!1){const r=Ym(e);return!!r.length&&(n?r.some((n=>Um(e,n,!0).includes(t))):r.some((n=>zm(e,n)===t)))}function fg(e,t,n=!1){return ug(e,t).some((t=>kg(e,t)||n&&fg(e,t,n)))}function mg(e,t){if(!t)return!1;const n=Jm(e),r=n.indexOf(t);return r>-1&&rkg(e,t)))}function Sg(){return(0,W.default)('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}const Ag=(0,Hs.A)((e=>{let t,n;const{insertionPoint:r,selection:{selectionEnd:o}}=e;if(null!==r)return r;const{clientId:i}=o;return i?(t=zm(e,i)||void 0,n=dg(e,o.clientId)+1):n=ug(e).length,{rootClientId:t,index:n}}),(e=>[e.insertionPoint,e.selection.selectionEnd.clientId,e.blocks.parents,e.blocks.order]));function Eg(e){return null!==e.insertionPoint}function Ig(e){return e.template.isValid}function jg(e){return e.settings.template}function Tg(e,t){var n,r;return t?null!==(n=rb(e,t)?.templateLock)&&void 0!==n&&n:null!==(r=e.settings.templateLock)&&void 0!==r&&r}const Bg=(e,t,n=null)=>{let r;if(t&&"object"==typeof t?(r=t,t=r.name):r=kc(t),!r)return!1;const{allowedBlockTypes:o}=ob(e);if(!Sf(o,t,!0))return!1;if(Tg(e,n))return!1;if("disabled"===wb(e,null!=n?n:""))return!1;const i=rb(e,n);if(n&&void 0===i)return!1;const s=gm(e,n),a=kc(s),l=a?.allowedBlocks;let c=Sf(l,t);if(!1!==c){const e=i?.allowedBlocks,n=Sf(e,t);null!==n&&(c=n)}const u=r.parent,d=Sf(u,s);let h=!0;const p=r.ancestor;p&&(h=[n,...Um(e,n)].some((t=>Sf(p,gm(e,t)))));const f=h&&(null===c&&null===d||!0===c||!0===d);return f?(0,Iu.applyFilters)("blockEditor.__unstableCanInsertBlockType",f,r,n,{getBlock:ym.bind(null,e),getBlockParentsByBlockName:Vm.bind(null,e)}):f},Rg=(0,Hs.A)(Bg,((e,t,n)=>If(e,n)));function Ng(e,t,n=null){return t.every((t=>Rg(e,gm(e,t),n)))}function Dg(e,t,n=null){const r=vm(e,t);return null===r||(void 0!==r.lock?.remove?!r.lock.remove:!Tg(e,n)&&"disabled"!==wb(e,n))}function Mg(e,t,n=null){return t.every((t=>Dg(e,t,n)))}function Pg(e,t,n=null){const r=vm(e,t);return null===r||(void 0!==r.lock?.move?!r.lock.move:"all"!==Tg(e,n)&&"disabled"!==wb(e,n))}function Og(e,t,n=null){return t.every((t=>Pg(e,t,n)))}function Lg(e,t){const n=vm(e,t);if(null===n)return!0;const{lock:r}=n;return!r?.edit}function Fg(e,t){return!!Ac(t,"lock",!0)&&!!e.settings?.canLockBlocks}function zg(e,t){var n;return null!==(n=e.preferences.insertUsage?.[t])&&void 0!==n?n:null}const Ug=(e,t,n)=>!!Ac(t,"inserter",!0)&&Bg(e,t.name,n),Vg=(e,t)=>{if(!e)return t;const n=Date.now()-e;switch(!0){case n<36e5:return 4*t;case n<864e5:return 2*t;case n<6048e5:return t/2;default:return t/4}},Hg=(e,{buildScope:t="inserter"})=>n=>{const r=n.name;let o=!1;Ac(n.name,"multiple",!0)||(o=jm(e,Sm(e)).some((({name:e})=>e===n.name)));const{time:i,count:s=0}=zg(e,r)||{},a={id:r,name:n.name,title:n.title,icon:n.icon,isDisabled:o,frecency:Vg(i,s)};if("transform"===t)return a;const l=jc(n.name,"inserter");return{...a,initialAttributes:{},description:n.description,category:n.category,keywords:n.keywords,variations:l,example:n.example,utility:1}},$g=(0,Vs.N)((e=>(0,Hs.A)(((t,n=null,r={})=>{const o=Bg(t,"core/block",n)?wf(e(kf)).getReusableBlocks().map((e=>{const n=e.wp_pattern_sync_status?bf.A:{src:bf.A,foreground:"var(--wp-block-synced-color)"},r=`core/block/${e.id}`,{time:o,count:i=0}=zg(t,r)||{},s=Vg(o,i);return{id:r,name:"core/block",initialAttributes:{ref:e.id},title:e.title?.raw,icon:n,category:"reusable",keywords:["reusable"],isDisabled:!1,utility:1,frecency:s,content:e.content?.raw,syncStatus:e.wp_pattern_sync_status}})):[],i=Hg(t,{buildScope:"inserter"});let s=Cc().filter((e=>Ac(e,"inserter",!0))).map(i);s=r[Cf]?s.reduce(((e,r)=>{for(r.rootClientId=null!=n?n:"";!Bg(t,r.name,r.rootClientId);){if(!r.rootClientId){let e;try{e=wf(ob(t)).sectionRootClientId}catch(e){}e&&Bg(t,r.name,e)?r.rootClientId=e:delete r.rootClientId;break}{const e=zm(t,r.rootClientId);r.rootClientId=e}}return r.hasOwnProperty("rootClientId")&&e.push(r),e}),[]):s.filter((e=>Ug(t,e,n)));const a=s.reduce(((e,n)=>{const{variations:r=[]}=n;if(r.some((({isDefault:e})=>e))||e.push(n),r.length){const o=((e,t)=>n=>{const r=`${t.id}/${n.name}`,{time:o,count:i=0}=zg(e,r)||{};return{...t,id:r,icon:n.icon||t.icon,title:n.title||t.title,description:n.description||t.description,category:n.category||t.category,example:n.hasOwnProperty("example")?n.example:t.example,initialAttributes:{...t.initialAttributes,...n.attributes},innerBlocks:n.innerBlocks,keywords:n.keywords||t.keywords,frecency:Vg(o,i)}})(t,n);e.push(...r.map(o))}return e}),[]),{core:l,noncore:c}=a.reduce(((e,t)=>{const{core:n,noncore:r}=e;return(t.name.startsWith("core/")?n:r).push(t),e}),{core:[],noncore:[]});return[...l,...c,...o]}),((t,n)=>[Cc(),wf(e(kf)).getReusableBlocks(),t.blocks.order,t.preferences.insertUsage,...If(t,n)])))),Wg=(0,Hs.A)(((e,t,n=null)=>{const r=Array.isArray(t)?t:[t],o=Hg(e,{buildScope:"transform"}),i=Cc().filter((t=>Ug(e,t,n))).map(o),s=Object.fromEntries(Object.entries(i).map((([,e])=>[e.name,e]))),a=function(e){if(!e.length)return[];const t=(e=>e.length?Cc().filter((t=>!!sd(ad("from",t.name),(t=>rd(t,"from",e))))):[])(e),n=(e=>{if(!e.length)return[];const t=kc(e[0].name);return(t?ad("to",t.name):[]).filter((t=>t&&rd(t,"to",e))).map((e=>e.blocks)).flat().map(kc)})(e);return[...new Set([...t,...n])]}(r).reduce(((e,t)=>(s[t?.name]&&e.push(s[t.name]),e)),[]);return Tf(a,(e=>s[e.name].frecency),"desc")}),((e,t,n)=>[Cc(),e.preferences.insertUsage,...If(e,n)])),Gg=(0,Vs.N)((e=>(t,n=null)=>!!Cc().some((e=>Ug(t,e,n)))||Bg(t,"core/block",n)&&wf(e(kf)).getReusableBlocks().length>0)),qg=(0,Vs.N)((e=>(0,Hs.A)(((t,n=null)=>{if(!n)return;const r=Cc().filter((e=>Ug(t,e,n)));return Bg(t,"core/block",n)&&wf(e(kf)).getReusableBlocks().length>0&&r.push("core/block"),r}),((t,n)=>[Cc(),wf(e(kf)).getReusableBlocks(),...If(t,n)])))),Kg=(0,Hs.A)(((e,t=null)=>((0,W.default)('wp.data.select( "core/block-editor" ).__experimentalGetAllowedBlocks',{alternative:'wp.data.select( "core/block-editor" ).getAllowedBlocks',since:"6.2",version:"6.4"}),qg(e,t))),((e,t)=>qg.getDependants(e,t)));function Yg(e,t=null){var n;if(!t)return;const{defaultBlock:r,directInsert:o}=null!==(n=e.blockListSettings[t])&&void 0!==n?n:{};return r&&o?r:void 0}function Jg(e,t=null){return(0,W.default)('wp.data.select( "core/block-editor" ).__experimentalGetDirectInsertBlock',{alternative:'wp.data.select( "core/block-editor" ).getDirectInsertBlock',since:"6.3",version:"6.4"}),Yg(e,t)}const Xg=(0,Vs.N)((e=>(0,Hs.A)(((t,n)=>{const r=wf(e(kf)).getPatternBySlug(n);if(!r)return null;const o=Mh(r.content,{__unstableSkipMigrationLogs:!0});return 1===o.length&&(o[0].attributes={...o[0].attributes,metadata:{...o[0].attributes.metadata||{},categories:r.categories,patternName:r.name,name:o[0].attributes.metadata?.name||r.title}}),{...r,blocks:o}}),((t,n)=>[wf(e(kf)).getPatternBySlug(n)])))),Zg=e=>(t,n)=>[...Ef(e)(t),...If(t,n)],Qg=(0,Vs.N)((e=>(0,Hs.A)(((t,n=null)=>{const{getAllPatterns:r,__experimentalGetParsedPattern:o}=wf(e(kf)),i=r(),{allowedBlockTypes:s}=ob(t),a=i.filter((({inserter:e=!0})=>!!e)).map((({name:e})=>o(e))),l=a.filter((({blocks:e})=>Af(e,s))),c=l.filter((({blocks:e})=>e.every((({name:e})=>Rg(t,e,n)))));return c}),Zg(e)))),eb=(0,Vs.N)((e=>(0,Hs.A)(((t,n,r=null)=>{if(!n)return fm;const o=e(kf).__experimentalGetAllowedPatterns(r),i=Array.isArray(n)?n:[n],s=o.filter((e=>e?.blockTypes?.some?.((e=>i.includes(e)))));return 0===s.length?fm:s}),((t,n,r)=>Zg(e)(t,r))))),tb=(0,Vs.N)((e=>((0,W.default)('wp.data.select( "core/block-editor" ).__experimentalGetPatternsByBlockTypes',{alternative:'wp.data.select( "core/block-editor" ).getPatternsByBlockTypes',since:"6.2",version:"6.4"}),e(kf).getPatternsByBlockTypes))),nb=(0,Vs.N)((e=>(0,Hs.A)(((t,n,r=null)=>{if(!n)return fm;if(n.some((({clientId:e,innerBlocks:n})=>n.length||mb(t,e))))return fm;const o=Array.from(new Set(n.map((({name:e})=>e))));return e(kf).getPatternsByBlockTypes(o,r)}),((t,n,r)=>Zg(e)(t,r)))));function rb(e,t){return e.blockListSettings[t]}function ob(e){return e.settings}function ib(e){return e.blocks.isPersistentChange}const sb=(0,Hs.A)(((e,t=[])=>t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})),(e=>[e.blockListSettings])),ab=(0,Vs.N)((e=>(0,Hs.A)(((t,n)=>{(0,W.default)("wp.data.select( 'core/block-editor' ).__experimentalGetReusableBlockTitle",{since:"6.6",version:"6.8"});const r=wf(e(kf)).getReusableBlocks().find((e=>e.id===n));return r?r.title?.raw:null}),(()=>[wf(e(kf)).getReusableBlocks()]))));function lb(e){return e.blocks.isIgnoredChange}function cb(e){return e.lastBlockAttributesChange}function ub(e){return"navigation"===e.editorMode}function db(e){return e.editorMode}function hb(e){return e.hasBlockMovingClientId}function pb(e){return!!e.automaticChangeStatus}function fb(e,t){return e.highlightedBlock===t}function mb(e,t){return!!e.blocks.controlledInnerBlocks[t]}const gb=(0,Hs.A)(((e,t)=>{if(!t.length)return null;const n=Lm(e);if(t.includes(gm(e,n)))return n;const r=Jm(e),o=Vm(e,n||r[0],t);return o?o[o.length-1]:null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function bb(e,t,n){const{lastBlockInserted:r}=e;return r.clientIds?.includes(t)&&r.source===n}function vb(e,t){var n;return null===(n=e.blockVisibility?.[t])||void 0===n||n}const yb=(0,Hs.A)((e=>{const t=new Set(Object.keys(e.blockVisibility).filter((t=>e.blockVisibility[t])));return 0===t.size?mm:t}),(e=>[e.blockVisibility]));function _b(e,t){if("default"!==wb(e,t))return!1;if(!Lg(e,t))return!0;const n=db(e);if("zoom-out"===n){const{sectionRootClientId:n}=wf(ob(e));if(n){const r=ug(e,n);if(r?.includes(t))return!0}else if(t&&!zm(e,t))return!0}const r=Ac(gm(e,t),"__experimentalDisableBlockOverlay",!1);return("navigation"===n||!r&&mb(e,t))&&!hg(e,t)&&!pg(e,t,!0)}function xb(e,t){let n=e.blocks.parents.get(t);for(;n;){if(_b(e,n))return!0;n=e.blocks.parents.get(n)}return!1}const wb=(0,Vs.N)((e=>(t,n="")=>{if(null===n&&(n=""),"zoom-out"===db(t)){const{sectionRootClientId:e}=wf(ob(t));if(""===n)return e?"disabled":"contentOnly";if(n===e)return"contentOnly";const r=ug(t,e);if(!r?.includes(n))return"disabled"}const r=t.blockEditingModes.get(n);if(r)return r;if(!n)return"default";const o=zm(t,n);if("contentOnly"===Tg(t,o)){const r=gm(t,n);return e(Zu).__experimentalHasContentRoleAttribute(r)?"contentOnly":"disabled"}const i=wb(t,o);return"contentOnly"===i?"default":i})),kb=(0,Vs.N)((e=>(t,n="")=>{const r=n||Lm(t);if(!r)return!1;const{getGroupingBlockName:o}=e(Zu),i=ym(t,r),s=o();return i&&(i.name===s||kc(i.name)?.transforms?.ungroup)&&!!i.innerBlocks.length&&Dg(t,r)})),Cb=(0,Vs.N)((e=>(t,n=fm)=>{const{getGroupingBlockName:r}=e(Zu),o=r(),i=n?.length?n:Ym(t),s=i?.length?zm(t,i[0]):void 0;return Rg(t,o,s)&&i.length&&Mg(t,i,s)})),Sb=(e,t)=>((0,W.default)("wp.data.select( 'core/block-editor' ).__unstableGetContentLockingParent",{since:"6.1",version:"6.7"}),dm(e,t));function Ab(e){return(0,W.default)("wp.data.select( 'core/block-editor' ).__unstableGetTemporarilyEditingAsBlocks",{since:"6.1",version:"6.7"}),hm(e)}function Eb(e){return(0,W.default)("wp.data.select( 'core/block-editor' ).__unstableGetTemporarilyEditingFocusModeToRevert",{since:"6.5",version:"6.7"}),pm(e)}const Ib=new WeakSet,jb=["inserterMediaCategories","blockInspectorAnimation"];function Tb(e,{stripExperimentalSettings:t=!1,reset:n=!1}={}){let r=e;if(t&&"web"===Ph.A.OS){r={};for(const t in e)jb.includes(t)||(r[t]=e[t])}return{type:"UPDATE_SETTINGS",settings:r,reset:n}}function Bb(){return{type:"HIDE_BLOCK_INTERFACE"}}function Rb(){return{type:"SHOW_BLOCK_INTERFACE"}}const Nb=(e,t=!0,n=!1)=>({select:r,dispatch:o,registry:i})=>{if(!e||!e.length)return;var s;s=e,e=Array.isArray(s)?s:[s];const a=r.getBlockRootClientId(e[0]);if(!r.canRemoveBlocks(e,a))return;const l=!n&&r.getBlockRemovalRules();if(l){function c(e){const t=[],n=[...e];for(;n.length;){const{innerBlocks:e,...r}=n.shift();n.push(...e),t.push(r)}return t}const u=c(e.map(r.getBlock));let d;for(const h of l)if(d=h.callback(u),d)return void o(Mb(e,t,d))}t&&o.selectPreviousBlock(e[0],t),i.batch((()=>{o({type:"REMOVE_BLOCKS",clientIds:e}),o(Db())}))},Db=()=>({select:e,dispatch:t})=>{if(e.getBlockCount()>0)return;const{__unstableHasCustomAppender:n}=e.getSettings();n||t.insertDefaultBlock()};function Mb(e,t,n){return{type:"DISPLAY_BLOCK_REMOVAL_PROMPT",clientIds:e,selectPrevious:t,message:n}}function Pb(){return{type:"CLEAR_BLOCK_REMOVAL_PROMPT"}}function Ob(e=!1){return{type:"SET_BLOCK_REMOVAL_RULES",rules:e}}function Lb(e){return{type:"SET_OPENED_BLOCK_SETTINGS_MENU",clientId:e}}function Fb(e,t){return{type:"SET_STYLE_OVERRIDE",id:e,style:t}}function zb(e){return{type:"DELETE_STYLE_OVERRIDE",id:e}}function Ub(e){return({dispatch:t,select:n,registry:r})=>{r.batch((()=>{t({type:"SET_EXPLICIT_PERSISTENT",isPersistentChange:!1}),e(),t({type:"SET_EXPLICIT_PERSISTENT",isPersistentChange:void 0});const r=n.getBlocks();Ib.add(r)}))}}function Vb(e=null){return{type:"LAST_FOCUS",lastFocus:e}}function Hb(e){return({select:t,dispatch:n,registry:r})=>{const o=wf(r.select(uy)).getTemporarilyEditingFocusModeToRevert();n.__unstableMarkNextChangeAsNotPersistent(),n.updateBlockAttributes(e,{templateLock:"contentOnly"}),n.updateBlockListSettings(e,{...t.getBlockListSettings(e),templateLock:"contentOnly"}),n.updateSettings({focusMode:o}),n.__unstableSetTemporarilyEditingAsBlocks()}}function $b(){return{type:"START_DRAGGING"}}function Wb(){return{type:"STOP_DRAGGING"}}function Gb(e){return{type:"SET_BLOCK_EXPANDED_IN_LIST_VIEW",clientId:e}}const qb=e=>({select:t,dispatch:n})=>{n.__unstableMarkNextChangeAsNotPersistent(),n.updateBlockAttributes(e,{templateLock:void 0}),n.updateBlockListSettings(e,{...t.getBlockListSettings(e),templateLock:!1});const r=t.getSettings().focusMode;n.updateSettings({focusMode:!0}),n.__unstableSetTemporarilyEditingAsBlocks(e,r)};var Kb=n(6012),Yb=n(74679);const Jb="";function Xb(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return("string"==typeof n||n instanceof V.RichTextData)&&-1!==n.toString().indexOf(Jb)}))}function Zb(e){for(const[t,n]of Object.entries(e.attributes))if("rich-text"===n.source||"html"===n.source)return t}const Qb=e=>Array.isArray(e)?e:[e],ev=e=>({dispatch:t})=>{t({type:"RESET_BLOCKS",blocks:e}),t(tv(e))},tv=e=>({select:t,dispatch:n})=>{const r=t.getTemplate(),o=t.getTemplateLock(),i=!r||"all"!==o||Mp(e,r);if(i!==t.isValidTemplate())return n.setTemplateValidity(i),i};function nv(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function rv(e){return(0,W.default)('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function ov(e,t,n=!1){return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:Qb(e),attributes:t,uniqueByBlock:n}}function iv(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function sv(e,t=0){return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const av=(e,t=!1)=>({select:n,dispatch:r})=>{const o=n.getPreviousBlockClientId(e);if(o)r.selectBlock(o,-1);else if(t){const t=n.getBlockRootClientId(e);t&&r.selectBlock(t,-1)}},lv=e=>({select:t,dispatch:n})=>{const r=t.getNextBlockClientId(e);r&&n.selectBlock(r)};function cv(){return{type:"START_MULTI_SELECT"}}function uv(){return{type:"STOP_MULTI_SELECT"}}const dv=(e,t,n=0)=>({select:r,dispatch:o})=>{if(r.getBlockRootClientId(e)!==r.getBlockRootClientId(t))return;o({type:"MULTI_SELECT",start:e,end:t,initialPosition:n});const i=r.getSelectedBlockCount();(0,Kb.speak)((0,U.sprintf)((0,U._n)("%s block selected.","%s blocks selected.",i),i),"assertive")};function hv(){return{type:"CLEAR_SELECTED_BLOCK"}}function pv(e=!0){return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}const fv=(e,t,n,r=0,o)=>({select:i,dispatch:s,registry:a})=>{e=Qb(e),t=Qb(t);const l=i.getBlockRootClientId(e[0]);for(let e=0;e{s({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:r,meta:o}),s.ensureDefaultBlock()}))};function mv(e,t){return fv(e,t)}const gv=e=>(t,n)=>({select:r,dispatch:o})=>{r.canMoveBlocks(t,n)&&o({type:e,clientIds:Qb(t),rootClientId:n})},bv=gv("MOVE_BLOCKS_DOWN"),vv=gv("MOVE_BLOCKS_UP"),yv=(e,t="",n="",r)=>({select:o,dispatch:i})=>{if(o.canMoveBlocks(e,t)){if(t!==n){if(!o.canRemoveBlocks(e,t))return;if(!o.canInsertBlocks(e,n))return}i({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:r})}};function _v(e,t="",n="",r){return yv([e],t,n,r)}function xv(e,t,n,r,o){return wv([e],t,n,r,0,o)}const wv=(e,t,n,r=!0,o=0,i)=>({select:s,dispatch:a})=>{null!==o&&"object"==typeof o&&(i=o,o=0,(0,W.default)("meta argument in wp.data.dispatch('core/block-editor')",{since:"5.8",hint:"The meta argument is now the 6th argument of the function"})),e=Qb(e);const l=[];for(const t of e)s.canInsertBlockType(t.name,n)&&l.push(t);l.length&&a({type:"INSERT_BLOCKS",blocks:l,index:t,rootClientId:n,time:Date.now(),updateSelection:r,initialPosition:r?o:null,meta:i})};function kv(e,t,n={}){const{__unstableWithInserter:r,operation:o,nearestSide:i}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:r,operation:o,nearestSide:i}}const Cv=()=>({select:e,dispatch:t})=>{e.isBlockInsertionPointVisible()&&t({type:"HIDE_INSERTION_POINT"})};function Sv(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const Av=()=>({select:e,dispatch:t})=>{t({type:"SYNCHRONIZE_TEMPLATE"});const n=zp(e.getBlocks(),e.getTemplate());t.resetBlocks(n)},Ev=e=>({registry:t,select:n,dispatch:r})=>{const o=n.getSelectionStart(),i=n.getSelectionEnd();if(o.clientId===i.clientId)return;if(!o.attributeKey||!i.attributeKey||void 0===o.offset||void 0===i.offset)return!1;const s=n.getBlockRootClientId(o.clientId);if(s!==n.getBlockRootClientId(i.clientId))return;const a=n.getBlockOrder(s);let l,c;a.indexOf(o.clientId)>a.indexOf(i.clientId)?(l=i,c=o):(l=o,c=i);const u=e?c:l,d=n.getBlock(u.clientId),h=kc(d.name);if(!h.merge)return;const p=l,f=c,m=n.getBlock(p.clientId),g=n.getBlock(f.clientId),b=m.attributes[p.attributeKey],v=g.attributes[f.attributeKey];let y=(0,V.create)({html:b}),_=(0,V.create)({html:v});y=(0,V.remove)(y,p.offset,y.text.length),_=(0,V.insert)(_,Jb,0,f.offset);const x=nd(m,{[p.attributeKey]:(0,V.toHTMLString)({value:y})}),w=nd(g,{[f.attributeKey]:(0,V.toHTMLString)({value:_})}),k=e?x:w,C=m.name===g.name?[k]:cd(k,h.name);if(!C||!C.length)return;let S;if(e){const e=C.pop();S=h.merge(e.attributes,w.attributes)}else{const e=C.shift();S=h.merge(x.attributes,e.attributes)}const A=Xb(S),E=S[A],I=(0,V.create)({html:E}),j=I.text.indexOf(Jb),T=(0,V.remove)(I,j,j+1),B=(0,V.toHTMLString)({value:T});S[A]=B;const R=n.getSelectedBlockClientIds(),N=[...e?C:[],{...d,attributes:{...d.attributes,...S}},...e?[]:C];t.batch((()=>{r.selectionChange(d.clientId,A,j,j),r.replaceBlocks(R,N,0,n.getSelectedBlocksInitialCaretPosition())}))},Iv=(e=[])=>({registry:t,select:n,dispatch:r})=>{const o=n.getSelectionStart(),i=n.getSelectionEnd(),s=n.getBlockRootClientId(o.clientId),a=n.getBlockRootClientId(i.clientId);if(s!==a)return;const l=n.getBlockOrder(s);let c,u;l.indexOf(o.clientId)>l.indexOf(i.clientId)?(c=i,u=o):(c=o,u=i);const d=c,h=u,p=n.getBlock(d.clientId),f=n.getBlock(h.clientId),m=kc(p.name),g=kc(f.name),b="string"==typeof d.attributeKey?d.attributeKey:Zb(m),v="string"==typeof h.attributeKey?h.attributeKey:Zb(g),y=n.getBlockAttributes(d.clientId),_=y?.metadata?.bindings;if(_?.[b]){if(e.length){const{createWarningNotice:M}=t.dispatch(Yb.store);return void M((0,U.__)("Blocks can't be inserted into other blocks with bindings"),{type:"snackbar"})}return void r.insertAfterBlock(d.clientId)}if(!b||!v||void 0===o.offset||void 0===i.offset)return;if(d.clientId===h.clientId&&b===v&&d.offset===h.offset)if(e.length){if(Rc(p))return void r.replaceBlocks([d.clientId],e,e.length-1,-1)}else if(!n.getBlockOrder(d.clientId).length){function P(){const e=wc();return n.canInsertBlockType(e,s)?Qu(e):Qu(n.getBlockName(d.clientId))}const O=y[b].length;if(0===d.offset&&O)return void r.insertBlocks([P()],n.getBlockIndex(d.clientId),s,!1);if(d.offset===O)return void r.insertBlocks([P()],n.getBlockIndex(d.clientId)+1,s)}const x=p.attributes[b],w=f.attributes[v];let k=(0,V.create)({html:x}),C=(0,V.create)({html:w});k=(0,V.remove)(k,d.offset,k.text.length),C=(0,V.remove)(C,0,h.offset);let S={...p,innerBlocks:p.clientId===f.clientId?[]:p.innerBlocks,attributes:{...p.attributes,[b]:(0,V.toHTMLString)({value:k})}};const A={...f,clientId:p.clientId===f.clientId?Qu(f.name).clientId:f.clientId,attributes:{...f.attributes,[v]:(0,V.toHTMLString)({value:C})}};if(!e.length)return void r.replaceBlocks(n.getSelectedBlockClientIds(),[S,A]);let E;const I=[],j=[...e],T=j.shift(),B=kc(S.name),R=B.merge&&T.name===B.name?[T]:cd(T,B.name);if(R?.length){const L=R.shift();S={...S,attributes:{...S.attributes,...B.merge(S.attributes,L.attributes)}},I.push(S),E={clientId:S.clientId,attributeKey:b,offset:(0,V.create)({html:S.attributes[b]}).text.length},j.unshift(...R)}else Bc(S)||I.push(S),I.push(T);const N=j.pop(),D=kc(A.name);if(j.length&&I.push(...j),N){const F=D.merge&&D.name===N.name?[N]:cd(N,D.name);if(F?.length){const z=F.pop();I.push({...A,attributes:{...A.attributes,...D.merge(z.attributes,A.attributes)}}),I.push(...F),E={clientId:A.clientId,attributeKey:v,offset:(0,V.create)({html:z.attributes[v]}).text.length}}else I.push(N),Bc(A)||I.push(A)}else Bc(A)||I.push(A);t.batch((()=>{r.replaceBlocks(n.getSelectedBlockClientIds(),I,I.length-1,0),E&&r.selectionChange(E.clientId,E.attributeKey,E.offset,E.offset)}))},jv=()=>({select:e,dispatch:t})=>{const n=e.getSelectionStart(),r=e.getSelectionEnd();t.selectionChange({start:{clientId:n.clientId},end:{clientId:r.clientId}})},Tv=(e,t)=>({registry:n,select:r,dispatch:o})=>{const i=e,s=t,a=r.getBlock(i),l=kc(a.name);if(!l)return;const c=r.getBlock(s);if(!l.merge&&Sc(a.name,"__experimentalOnMerge")){const e=cd(c,l.name);if(1!==e?.length)return void o.selectBlock(a.clientId);const[t]=e;return t.innerBlocks.length<1?void o.selectBlock(a.clientId):void n.batch((()=>{o.insertBlocks(t.innerBlocks,void 0,i),o.removeBlock(s),o.selectBlock(t.innerBlocks[0].clientId);const e=r.getNextBlockClientId(i);if(e&&r.getBlockName(i)===r.getBlockName(e)){const t=r.getBlockAttributes(i),n=r.getBlockAttributes(e);Object.keys(t).every((e=>t[e]===n[e]))&&(o.moveBlocksToPosition(r.getBlockOrder(e),e,i),o.removeBlock(e,!1))}}))}if(Rc(a))return void o.removeBlock(i,r.isBlockSelected(i));if(Rc(c))return void o.removeBlock(s,r.isBlockSelected(s));if(!l.merge)return void o.selectBlock(a.clientId);const u=kc(c.name),{clientId:d,attributeKey:h,offset:p}=r.getSelectionStart(),f=(d===i?l:u).attributes[h],m=(d===i||d===s)&&void 0!==h&&void 0!==p&&!!f;f||("number"==typeof h?window.console.error("RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was "+typeof h):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const g=nd(a),b=nd(c);if(m){const e=d===i?g:b,t=e.attributes[h],n=(0,V.insert)((0,V.create)({html:t}),Jb,p,p);e.attributes[h]=(0,V.toHTMLString)({value:n})}const v=a.name===c.name?[b]:cd(b,a.name);if(!v||!v.length)return;const y=l.merge(g.attributes,v[0].attributes);if(m){const e=Xb(y),t=y[e],n=(0,V.create)({html:t}),r=n.text.indexOf(Jb),i=(0,V.remove)(n,r,r+1),s=(0,V.toHTMLString)({value:i});y[e]=s,o.selectionChange(a.clientId,e,r,r)}o.replaceBlocks([a.clientId,c.clientId],[{...a,attributes:{...a.attributes,...y}},...v.slice(1)],0)},Bv=(e,t=!0)=>Nb(e,t);function Rv(e,t){return Bv([e],t)}function Nv(e,t,n=!1,r=0){return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?r:null,time:Date.now()}}function Dv(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function Mv(){return{type:"START_TYPING"}}function Pv(){return{type:"STOP_TYPING"}}function Ov(e=[]){return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function Lv(){return{type:"STOP_DRAGGING_BLOCKS"}}function Fv(){return(0,W.default)('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function zv(){return(0,W.default)('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Uv(e,t,n,r){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:r}:{type:"SELECTION_CHANGE",...e}}const Vv=(e,t,n)=>({dispatch:r})=>{const o=wc();if(!o)return;const i=Qu(o,e);return r.insertBlock(i,n,t)};function Hv(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function $v(e){return Tb(e,{stripExperimentalSettings:!0})}function Wv(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function Gv(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function qv(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const Kv=()=>({dispatch:e})=>{e({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:t=(e=>setTimeout(e,100))}=window;t((()=>{e({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))},Yv=(e=!0)=>({dispatch:t})=>{t.__unstableSetEditorMode(e?"navigation":"edit")},Jv=e=>({dispatch:t,select:n,registry:r})=>{if("zoom-out"===e){const e=n.getBlockSelectionStart(),{sectionRootClientId:o}=wf(r.select(kf).getSettings());if(e){let r;if(o){const t=n.getBlockOrder(o);r=n.getBlockParents(e).find((e=>t.includes(e)))}else r=n.getBlockHierarchyRootClientId(e);r?t.selectBlock(r):t.clearSelectedBlock()}}t({type:"SET_EDITOR_MODE",mode:e}),"navigation"===e?(0,Kb.speak)((0,U.__)("You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.")):"edit"===e?(0,Kb.speak)((0,U.__)("You are currently in edit mode. To return to the navigation mode, press Escape.")):"zoom-out"===e&&(0,Kb.speak)((0,U.__)("You are currently in zoom-out mode."))},Xv=(e=null)=>({dispatch:t})=>{t({type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e}),e&&(0,Kb.speak)((0,U.__)("Use the Tab key and Arrow keys to choose new block location. Use Left and Right Arrow keys to move between nesting levels. Once location is selected press Enter or Space to move the block."))},Zv=(e,t=!0)=>({select:n,dispatch:r})=>{if(!e||!e.length)return;const o=n.getBlocksByClientId(e);if(o.some((e=>!e)))return;const i=o.map((e=>e.name));if(i.some((e=>!Ac(e,"multiple",!0))))return;const s=n.getBlockRootClientId(e[0]),a=Qb(e),l=n.getBlockIndex(a[a.length-1]),c=o.map((e=>td(e)));return r.insertBlocks(c,l+1,s,t),c.length>1&&t&&r.multiSelect(c[0].clientId,c[c.length-1].clientId),c.map((e=>e.clientId))},Qv=e=>({select:t,dispatch:n})=>{if(!e)return;const r=t.getBlockRootClientId(e);if(t.getTemplateLock(r))return;const o=t.getBlockIndex(e),i=r?t.getDirectInsertBlock(r):null;if(!i)return n.insertDefaultBlock({},r,o);const s={};if(i.attributesToCopy){const n=t.getBlockAttributes(e);i.attributesToCopy.forEach((e=>{n[e]&&(s[e]=n[e])}))}const a=Qu(i.name,{...i.attributes,...s});return n.insertBlock(a,o,r)},ey=e=>({select:t,dispatch:n})=>{if(!e)return;const r=t.getBlockRootClientId(e);if(t.getTemplateLock(r))return;const o=t.getBlockIndex(e),i=r?t.getDirectInsertBlock(r):null;if(!i)return n.insertDefaultBlock({},r,o+1);const s={};if(i.attributesToCopy){const n=t.getBlockAttributes(e);i.attributesToCopy.forEach((e=>{n[e]&&(s[e]=n[e])}))}const a=Qu(i.name,{...i.attributes,...s});return n.insertBlock(a,o+1,r)};function ty(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const ny=e=>async({dispatch:t})=>{t(ty(e,!0)),await new Promise((e=>setTimeout(e,150))),t(ty(e,!1))};function ry(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function oy(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}function iy(e,t){return{type:"SET_TEMPORARILY_EDITING_AS_BLOCKS",temporarilyEditingAsBlocks:e,focusModeToRevert:t}}const sy=e=>({select:t,dispatch:n})=>{if(!e||"object"!=typeof e)return void console.error("Category should be an `InserterMediaCategory` object.");if(!e.name)return void console.error("Category should have a `name` that should be unique among all media categories.");if(!e.labels?.name)return void console.error("Category should have a `labels.name`.");if(!["image","audio","video"].includes(e.mediaType))return void console.error("Category should have `mediaType` property that is one of `image|audio|video`.");if(!e.fetch||"function"!=typeof e.fetch)return void console.error("Category should have a `fetch` function defined with the following signature `(InserterMediaRequest) => Promise`.");const r=t.getRegisteredInserterMediaCategories();r.some((({name:t})=>t===e.name))?console.error(`A category is already registered with the same name: "${e.name}".`):r.some((({labels:{name:t}={}})=>t===e.labels?.name))?console.error(`A category is already registered with the same labels.name: "${e.labels.name}".`):n({type:"REGISTER_INSERTER_MEDIA_CATEGORY",category:{...e,isExternalResource:!0}})};function ay(e="",t){return{type:"SET_BLOCK_EDITING_MODE",clientId:e,mode:t}}function ly(e=""){return{type:"UNSET_BLOCK_EDITING_MODE",clientId:e}}const cy={reducer:gf,selectors:h,actions:f},uy=(0,T.A)(kf,{...cy,persist:["preferences"]}),dy=(0,B.registerStore)(kf,{...cy,persist:["preferences"]});function hy(...e){const{clientId:t=null}=Xp();return(0,Fl.A)((n=>wf(n(uy)).getBlockSettings(t,...e)),[t,...e])}wf(dy).registerPrivateActions(p),wf(dy).registerPrivateSelectors(d),wf(uy).registerPrivateActions(p),wf(uy).registerPrivateSelectors(d);const py="1600px",fy="320px",my=1,gy=.25,by=.75,vy="14px";function yy(e,t={}){if("string"!=typeof e&&"number"!=typeof e)return null;isFinite(e)&&(e=`${e}px`);const{coerceTo:n,rootSizeValue:r,acceptableUnits:o}={coerceTo:"",rootSizeValue:16,acceptableUnits:["rem","px","em"],...t},i=o?.join("|"),s=new RegExp(`^(\\d*\\.?\\d+)(${i}){1,1}$`),a=e.match(s);if(!a||a.length<3)return null;let[,l,c]=a,u=parseFloat(l);return"px"!==n||"em"!==c&&"rem"!==c||(u*=r,c=n),"px"!==c||"em"!==n&&"rem"!==n||(u/=r,c=n),"em"!==n&&"rem"!==n||"em"!==c&&"rem"!==c||(c=n),{value:_y(u,3),unit:c}}function _y(e,t=3){const n=Math.pow(10,t);return Number.isFinite(e)?parseFloat(Math.round(e*n)/n):void 0}function xy(e,t){const{size:n}=e;if(!wy(t?.typography))return n;if(!n||"0"===n||!1===e?.fluid)return n;let r=function(e){const t=e?.typography,n=e?.layout,r=yy(n?.wideSize)?n?.wideSize:null;return wy(t)&&r?{fluid:{maxViewportWidth:r,...t.fluid}}:{fluid:t?.fluid}}(t);r="object"==typeof r?.fluid?r?.fluid:{};const o=function({minimumFontSize:e,maximumFontSize:t,fontSize:n,minimumViewportWidth:r=fy,maximumViewportWidth:o=py,scaleFactor:i=my,minimumFontSizeLimit:s}){if(s=yy(s)?s:vy,n){const r=yy(n);if(!r?.unit)return null;const o=yy(s,{coerceTo:r.unit});if(o?.value&&!e&&!t&&r?.value<=o?.value)return null;if(t||(t=`${r.value}${r.unit}`),!e){const t="px"===r.unit?r.value:16*r.value,n=Math.min(Math.max(1-.075*Math.log2(t),gy),by),i=_y(r.value*n,3);e=o?.value&&i0}const ky="body",Cy=":root",Sy=[{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)=>xy(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:[]}],Ay={"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"},Ey={popoverProps:{placement:"left-start",offset:259}};function Iy(e,t,n,r,o){const i=[Of(e,["blocks",t,...n]),Of(e,n)];for(const s of i)if(s){const i=["custom","theme","default"];for(const a of i){const i=s[a];if(i){const s=i.find((e=>e[r]===o));if(s)return"slug"===r||Iy(e,t,n,"slug",s.slug)[r]===s[r]?s:void 0}}}}function jy(e,t,n){if(!n||"string"!=typeof n){if(!n?.ref||"string"!=typeof n?.ref)return n;{const t=n.ref.split(".");if(!(n=Of(e,t))||n?.ref)return n}}let r;if(n.startsWith("var:"))r=n.slice(4).split("|");else{if(!n.startsWith("var(--wp--")||!n.endsWith(")"))return n;r=n.slice(10,-1).split("--")}const[o,...i]=r;return"preset"===o?function(e,t,n,[r,o]){const i=Sy.find((e=>e.cssVarInfix===r));if(!i)return n;const s=Iy(e.settings,t,i.path,"slug",o);if(s){const{valueKey:n}=i;return jy(e,t,s[n])}return n}(e,t,n,i):"custom"===o?function(e,t,n,r){var o;const i=null!==(o=Of(e.settings,["blocks",t,"custom",...r]))&&void 0!==o?o:Of(e.settings,["custom",...r]);return i?jy(e,t,i):n}(e,t,n,i):n}function Ty(e,t){if(!e||!t)return t;const n=e.split(","),r=t.split(","),o=[];return n.forEach((e=>{r.forEach((t=>{o.push(`${e.trim()} ${t.trim()}`)}))})),o.join(", ")}function By(e,t){return"object"!=typeof e||"object"!=typeof t?e===t:N()(e?.styles,t?.styles)&&N()(e?.settings,t?.settings)}const Ry=(0,k.createContext)({user:{},base:{},merged:{},setUserConfig:()=>{}}),Ny={settings:{},styles:{}},Dy=["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"],My=()=>{const{user:e,setUserConfig:t}=(0,k.useContext)(Ry);return[!!e&&!N()(e,Ny),(0,k.useCallback)((()=>t((()=>Ny))),[t])]};function Py(e,t,n="all"){const{setUserConfig:r,...o}=(0,k.useContext)(Ry),i=t?".blocks."+t:"",s=e?"."+e:"",a=`settings${i}${s}`,l=`settings${s}`,c="all"===n?"merged":n;return[(0,k.useMemo)((()=>{const t=o[c];if(!t)throw"Unsupported source";var n;if(e)return null!==(n=Of(t,a))&&void 0!==n?n:Of(t,l);let r={};return Dy.forEach((e=>{var n;const o=null!==(n=Of(t,`settings${i}.${e}`))&&void 0!==n?n:Of(t,`settings.${e}`);void 0!==o&&(r=Pf(r,e.split("."),o))})),r}),[o,c,e,a,l,i]),e=>{r((t=>Pf(t,a.split("."),e)))}]}function Oy(e,t,n="all",{shouldDecodeEncode:r=!0}={}){const{merged:o,base:i,user:s,setUserConfig:a}=(0,k.useContext)(Ry),l=e?"."+e:"",c=t?`styles.blocks.${t}${l}`:`styles${l}`;let u,d;switch(n){case"all":u=Of(o,c),d=r?jy(o,t,u):u;break;case"user":u=Of(s,c),d=r?jy(o,t,u):u;break;case"base":u=Of(i,c),d=r?jy(i,t,u):u;break;default:throw"Unsupported source"}return[d,n=>{a((i=>Pf(i,c.split("."),r?function(e,t,n,r){if(!r)return r;const o=Ay[n],i=Sy.find((e=>e.cssVarInfix===o));if(!i)return r;const{valueKey:s,path:a}=i,l=Iy(e,t,a,s,r);return l?`var:preset|${o}|${l.slug}`:r}(o.settings,t,e,n):n)))}]}function Ly(){const{merged:e}=(0,k.useContext)(Ry);return e?._links}function Fy(e,t,n){const{supportedStyles:r,supports:o}=(0,Fl.A)((e=>({supportedStyles:wf(e(Zu)).getSupportedStyles(t,n),supports:e(Zu).getBlockType(t)?.supports})),[t,n]);return(0,k.useMemo)((()=>{const t={...e};return r.includes("fontSize")||(t.typography={...t.typography,fontSizes:{},customFontSize:!1,defaultFontSizes:!1}),r.includes("fontFamily")||(t.typography={...t.typography,fontFamilies:{}}),t.color={...t.color,text:t.color?.text&&r.includes("color"),background:t.color?.background&&(r.includes("background")||r.includes("backgroundColor")),button:t.color?.button&&r.includes("buttonColor"),heading:t.color?.heading&&r.includes("headingColor"),link:t.color?.link&&r.includes("linkColor"),caption:t.color?.caption&&r.includes("captionColor")},r.includes("background")||(t.color.gradients=[],t.color.customGradient=!1),r.includes("filter")||(t.color.defaultDuotone=!1,t.color.customDuotone=!1),["lineHeight","fontStyle","fontWeight","letterSpacing","textTransform","textDecoration","writingMode"].forEach((e=>{r.includes(e)||(t.typography={...t.typography,[e]:!1})})),r.includes("columnCount")||(t.typography={...t.typography,textColumns:!1}),["contentSize","wideSize"].forEach((e=>{r.includes(e)||(t.layout={...t.layout,[e]:!1})})),["padding","margin","blockGap"].forEach((e=>{r.includes(e)||(t.spacing={...t.spacing,[e]:!1});const n=Array.isArray(o?.spacing?.[e])?o?.spacing?.[e]:o?.spacing?.[e]?.sides;n?.length&&t.spacing?.[e]&&(t.spacing={...t.spacing,[e]:{...t.spacing?.[e],sides:n}})})),["aspectRatio","minHeight"].forEach((e=>{r.includes(e)||(t.dimensions={...t.dimensions,[e]:!1})})),["radius","color","style","width"].forEach((e=>{r.includes("border"+e.charAt(0).toUpperCase()+e.slice(1))||(t.border={...t.border,[e]:!1})})),t.shadow=!!r.includes("shadow")&&t.shadow,n&&(t.typography.textAlign=!1),t}),[e,r,o,n])}function zy(e){const t=e?.color?.palette?.custom,n=e?.color?.palette?.theme,r=e?.color?.palette?.default,o=e?.color?.defaultPalette;return(0,k.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,U._x)("Theme","Indicates this palette comes from the theme."),colors:n}),o&&r&&r.length&&e.push({name:(0,U._x)("Default","Indicates this palette comes from WordPress."),colors:r}),t&&t.length&&e.push({name:(0,U._x)("Custom","Indicates this palette is created by the user."),colors:t}),e}),[t,n,r,o])}function Uy(e){const t=e?.color?.gradients?.custom,n=e?.color?.gradients?.theme,r=e?.color?.gradients?.default,o=e?.color?.defaultGradients;return(0,k.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,U._x)("Theme","Indicates this palette comes from the theme."),gradients:n}),o&&r&&r.length&&e.push({name:(0,U._x)("Default","Indicates this palette comes from WordPress."),gradients:r}),t&&t.length&&e.push({name:(0,U._x)("Custom","Indicates this palette is created by the user."),gradients:t}),e}),[t,n,r,o])}var Vy=n(23372);const Hy=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=Object.entries(e).map((([e,t])=>[e,Hy(t)])).filter((([,e])=>void 0!==e));return t.length?Object.fromEntries(t):void 0};function $y(e,t,n,r,o,i){if(Object.values(null!=e?e:{}).every((e=>!e)))return n;if(1===i.length&&n.innerBlocks.length===r.length)return n;let s=r[0]?.attributes;if(i.length>1&&r.length>1){if(!r[o])return n;s=r[o]?.attributes}let a=n;return Object.entries(e).forEach((([e,n])=>{n&&t[e].forEach((e=>{const t=Of(s,e);t&&(a={...a,attributes:Pf(a.attributes,e,t)})}))})),a}function Wy(e,t,n){const r=Sc(e,t),o=r?.__experimentalSkipSerialization;return Array.isArray(o)?o.includes(n):o}const Gy=new WeakMap;function qy({id:e,css:t,assets:n,__unstableType:r,clientId:o}={}){const{setStyleOverride:i,deleteStyleOverride:s}=wf((0,zl.A)(uy)),a=(0,Up.A)(),l=(0,k.useId)();(0,k.useEffect)((()=>{if(!t&&!n)return;const c=e||l,u={id:e,css:t,assets:n,__unstableType:r,clientId:o};return Gy.get(a)||Gy.set(a,[]),Gy.get(a).push([c,u]),window.queueMicrotask((()=>{Gy.get(a)?.length&&a.batch((()=>{Gy.get(a).forEach((e=>{i(...e)})),Gy.set(a,[])}))})),()=>{const e=Gy.get(a)?.find((([e])=>e===c));e?Gy.set(a,Gy.get(a).filter((([e])=>e!==c))):s(c)}}),[e,t,o,n,r,l,i,s,a])}function Ky(e,t){const[n,r,o,i,s,a,l,c,u,d,h,p,f,m,g,b,v,y,_,x,w,C,S,A,E,I,j,T,B,R,N,D,M,P,O,L,F,z,U,V,H,$,W,G,q,K,Y,J,X,Z,Q,ee,te,ne,re,oe]=hy("background.backgroundImage","background.backgroundSize","typography.fontFamilies.custom","typography.fontFamilies.default","typography.fontFamilies.theme","typography.defaultFontSizes","typography.fontSizes.custom","typography.fontSizes.default","typography.fontSizes.theme","typography.customFontSize","typography.fontStyle","typography.fontWeight","typography.lineHeight","typography.textAlign","typography.textColumns","typography.textDecoration","typography.writingMode","typography.textTransform","typography.letterSpacing","spacing.padding","spacing.margin","spacing.blockGap","spacing.defaultSpacingSizes","spacing.customSpacingSize","spacing.spacingSizes.custom","spacing.spacingSizes.default","spacing.spacingSizes.theme","spacing.units","dimensions.aspectRatio","dimensions.minHeight","layout","border.color","border.radius","border.style","border.width","color.custom","color.palette.custom","color.customDuotone","color.palette.theme","color.palette.default","color.defaultPalette","color.defaultDuotone","color.duotone.custom","color.duotone.theme","color.duotone.default","color.gradients.custom","color.gradients.theme","color.gradients.default","color.defaultGradients","color.customGradient","color.background","color.link","color.text","color.heading","color.button","shadow");return Fy((0,k.useMemo)((()=>({background:{backgroundImage:n,backgroundSize:r},color:{palette:{custom:F,theme:U,default:V},gradients:{custom:K,theme:Y,default:J},duotone:{custom:W,theme:G,default:q},defaultGradients:X,defaultPalette:H,defaultDuotone:$,custom:L,customGradient:Z,customDuotone:z,background:Q,link:ee,heading:ne,button:re,text:te},typography:{fontFamilies:{custom:o,default:i,theme:s},fontSizes:{custom:l,default:c,theme:u},customFontSize:d,defaultFontSizes:a,fontStyle:h,fontWeight:p,lineHeight:f,textAlign:m,textColumns:g,textDecoration:b,textTransform:y,letterSpacing:_,writingMode:v},spacing:{spacingSizes:{custom:E,default:I,theme:j},customSpacingSize:A,defaultSpacingSizes:S,padding:x,margin:w,blockGap:C,units:T},border:{color:D,radius:M,style:P,width:O},dimensions:{aspectRatio:B,minHeight:R},layout:N,parentLayout:t,shadow:oe})),[n,r,o,i,s,a,l,c,u,d,h,p,f,m,g,b,y,_,v,x,w,C,S,A,E,I,j,T,B,R,N,t,D,M,P,O,L,F,z,U,V,H,$,W,G,q,K,Y,J,X,Z,Q,ee,te,ne,re,oe]),e)}const Yy=(0,k.memo)((function({index:e,useBlockProps:t,setAllWrapperProps:n,...r}){const o=t(r),i=t=>n((n=>{const r=[...n];return r[e]=t,r}));return(0,k.useEffect)((()=>(i(o),()=>{i(void 0)}))),null}));(0,Iu.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&Ac(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}));var Jy=n(66248),Xy=n(20660),Zy=n(29149);const Qy=({children:e,className:t})=>(0,Id.jsx)("div",{className:t,children:e}),e_=(0,k.forwardRef)((function({children:e,className:t,containerClassName:n,extraProps:r,isActive:o,isDisabled:i,title:s,...a},l){return(0,k.useContext)(Zy.A)?(0,Id.jsx)(Xy.A,{className:(0,Vy.A)("components-toolbar-button",t),...r,...a,ref:l,children:t=>(0,Id.jsx)(Jy.Ay,{label:s,isPressed:o,disabled:i,...t,children:e})}):(0,Id.jsx)(Qy,{className:n,children:(0,Id.jsx)(Jy.Ay,{ref:l,icon:a.icon,label:s,shortcut:a.shortcut,"data-subscript":a.subscript,onClick:e=>{e.stopPropagation(),a.onClick&&a.onClick(e)},className:(0,Vy.A)("components-toolbar__control",t),isPressed:o,disabled:i,"data-toolbar-item":!0,...r,...a,children:e})})})),t_=e_,n_=({className:e,children:t,...n})=>(0,Id.jsx)("div",{className:e,...n,children:t});var r_=n(79855);const o_=function({controls:e=[],toggleProps:t,...n}){const r=t=>(0,Id.jsx)(r_.A,{controls:e,toggleProps:{...t,"data-toolbar-item":!0},...n});return(0,k.useContext)(Zy.A)?(0,Id.jsx)(Xy.A,{...t,children:r}):r(t)},i_=function({controls:e=[],children:t,className:n,isCollapsed:r,title:o,...i}){const s=(0,k.useContext)(Zy.A);if(!(e&&e.length||t))return null;const a=(0,Vy.A)(s?"components-toolbar-group":"components-toolbar",n);let l;var c;return c=e,l=Array.isArray(c)&&Array.isArray(c[0])?e:[e],r?(0,Id.jsx)(o_,{label:o,controls:l,className:a,children:t,...i}):(0,Id.jsxs)(n_,{className:a,...i,children:[l?.flatMap(((e,t)=>e.map(((e,n)=>(0,Id.jsx)(t_,{containerClassName:t>0&&0===n?"has-left-divider":void 0,...e},[t,n].join()))))),t]})};var s_=n(41657);const a_={default:(0,Ul.QJ)("BlockControls"),block:(0,Ul.QJ)("BlockControlsBlock"),inline:(0,Ul.QJ)("BlockFormatControls"),other:(0,Ul.QJ)("BlockControlsOther"),parent:(0,Ul.QJ)("BlockControlsParent")};function l_({group:e="default",controls:t,children:n,__experimentalShareWithChildBlocks:r=!1}){const o=function(e,t){const n=Xp();return n[Hp]?a_[e]?.Fill:n[$p]&&t?a_.parent.Fill:null}(e,r);if(!o)return null;const i=(0,Id.jsxs)(Id.Fragment,{children:["default"===e&&(0,Id.jsx)(i_,{controls:t}),n]});return(0,Id.jsx)(s_.A,{document,children:(0,Id.jsx)(o,{children:e=>{const{forwardedContext:t=[]}=e;return t.reduce(((e,[t,n])=>(0,Id.jsx)(t,{...n,children:e})),i)}})})}var c_=n(96606),u_=n(4134),d_=n(58595);function h_(e){const t=(0,k.useContext)(d_.A);return(0,u_.A)(t.fills,e)}var p_=n(7532);const{ComponentsContext:f_}=wf(c_.j);function m_({group:e="default",...t}){const n=(0,k.useContext)(Zy.A),r=(0,k.useContext)(f_),o=(0,k.useMemo)((()=>({forwardedContext:[[Zy.A.Provider,{value:n}],[f_.Provider,{value:r}]]})),[n,r]),i=a_[e]?.Slot,s=h_(i?.__unstableName);if(!i)return!0===globalThis.SCRIPT_DEBUG&&(0,p_.default)(`Unknown BlockControls group "${e}" provided.`),null;if(!s?.length)return null;const a=(0,Id.jsx)(i,{...t,bubblesVirtually:!0,fillProps:o});return"default"===e?a:(0,Id.jsx)(i_,{children:a})}const g_=l_;g_.Slot=m_;const b_=e=>(0,Id.jsx)(l_,{group:"inline",...e});b_.Slot=e=>(0,Id.jsx)(m_,{group:"inline",...e});const v_=g_,y_=(0,k.forwardRef)((function(e,t){return(0,k.useContext)(Zy.A)?(0,Id.jsx)(Xy.A,{ref:t,...e.toggleProps,children:t=>(0,Id.jsx)(r_.A,{...e,popoverProps:{...e.popoverProps},toggleProps:t})}):(0,Id.jsx)(r_.A,{...e})}));var __=n(17741),x_=n(32785),w_=n(5180),k_=n(67428),C_=n(70903),S_=n(39526),A_=n(47388),E_=n(87334),I_=n(7278),j_=n(28800),T_=n(9026),B_=n(13555);const R_=(0,k.createContext)(null);var N_=n(42218);const D_=e=>!e.isLayoutDirty&&e.willUpdate(!1);function M_(){const e=new Set,t=new WeakMap,n=()=>e.forEach(D_);return{add:r=>{e.add(r),t.set(r,r.addEventListener("willUpdate",n))},remove:r=>{e.delete(r);const o=t.get(r);o&&(o(),t.delete(r)),n()},dirty:n}}const P_=e=>!0===e,O_=({children:e,id:t,inherit:n=!0})=>{const r=(0,k.useContext)(B_.L),o=(0,k.useContext)(R_),[i,s]=(0,N_.C)(),a=(0,k.useRef)(null),l=r.id||o;null===a.current&&((e=>P_(!0===e)||"id"===e)(n)&&l&&(t=t?l+"-"+t:l),a.current={id:t,group:P_(n)&&r.group||M_()});const c=(0,k.useMemo)((()=>({...a.current,forceRender:i})),[s]);return(0,Id.jsx)(B_.L.Provider,{value:c,children:e})};var L_=n(80810),F_=n(76219),z_=n(36471),U_=n(74493),V_=n(73393),H_=n(54395),$_=n(35366),W_=n(34592),G_=n(73474);var q_={name:"1aqh2c7",styles:"min-height:40px;padding:3px"},K_={name:"1ndywgm",styles:"min-height:36px;padding:2px"};const Y_={name:"7whenc",styles:"display:flex;width:100%"},J_=(0,H_.default)("div",{target:"eakva830"})({name:"zjik7",styles:"display:flex"});var X_=n(38423),Z_=n(29165),Q_=n(31599),ex=n(60810),tx=n(19497),nx=n(26913);function rx(e={}){var t,n=(0,nx.YG)(e,[]);const r=null==(t=n.store)?void 0:t.getState(),o=(0,Q_.z)((0,nx.ko)((0,nx.IA)({},n),{focusLoop:(0,tx.Jh)(n.focusLoop,null==r?void 0:r.focusLoop,!0)})),i=(0,nx.ko)((0,nx.IA)({},o.getState()),{value:(0,tx.Jh)(n.value,null==r?void 0:r.value,n.defaultValue,null)}),s=(0,ex.y$)(i,o,n.store);return(0,nx.ko)((0,nx.IA)((0,nx.IA)({},o),s),{setValue:e=>s.setState("value",e)})}var ox=n(21093),ix=n(49200),sx=n(68620),ax=n(50676),lx=n(28977),cx=(0,sx.ab)((e=>{var t=e,{store:n}=t,r=(0,lx.YG)(t,["store"]);const o=(0,ox.XF)();return n=n||o,(0,tx.V1)(n,!1),r=(0,ax.w7)(r,(e=>(0,Id.jsx)(ox.aN,{value:n,children:e})),[n]),r=(0,lx.IA)({role:"radiogroup"},r),(0,ix.T)((0,lx.IA)({store:n},r))})),ux=(0,sx.a0)((e=>{const t=cx(e);return(0,sx.n)("div",t)})),dx=n(29238);const hx=(0,k.createContext)({}),px=hx;var fx=n(52718);function mx(e){const t=(0,k.useRef)(!0),n=(0,fx.A)(e),r=(0,k.useRef)(!1);(0,k.useEffect)((()=>{t.current&&(t.current=!1)}),[]);const o=r.current||!t.current&&n!==e;return(0,k.useEffect)((()=>{r.current=o}),[o]),o?{value:null!=e?e:"",defaultValue:void 0}:{value:void 0,defaultValue:e}}const gx=(0,k.forwardRef)((function({children:e,isAdaptiveWidth:t,label:n,onChange:r,size:o,value:i,id:s,...a},l){const c=(0,L_.A)(gx,"toggle-group-control-as-radio-group"),u=s||c,{value:d,defaultValue:h}=mx(i),p=r?e=>{r(null!=e?e:void 0)}:void 0,f=function(e={}){const[t,n]=(0,Z_.Pj)(rx,e);return function(e,t,n){return e=(0,X_.Y)(e,t,n),(0,Z_.Tz)(e,n,"value","setValue"),e}(t,n,e)}({defaultValue:h,value:d,setValue:p}),m=f.useState("value"),g=f.setValue,b=(0,k.useMemo)((()=>({baseId:u,isBlock:!t,size:o,value:m,setValue:g})),[u,t,o,m,g]);return(0,Id.jsx)(px.Provider,{value:b,children:(0,Id.jsx)(ux,{store:f,"aria-label":n,render:(0,Id.jsx)(dx.A,{}),...a,id:u,ref:l,children:e})})}));var bx=n(18688);const vx=(0,k.forwardRef)((function({children:e,isAdaptiveWidth:t,label:n,onChange:r,size:o,value:i,id:s,...a},l){const c=(0,L_.A)(vx,"toggle-group-control-as-button-group"),u=s||c,{value:d,defaultValue:h}=mx(i),[p,f]=(0,bx.j)({defaultValue:h,value:d,onChange:r}),m=(0,k.useMemo)((()=>({baseId:u,value:p,setValue:f,isBlock:!t,isDeselectable:!0,size:o})),[u,p,f,t,o]);return(0,Id.jsx)(px.Provider,{value:m,children:(0,Id.jsx)(dx.A,{"aria-label":n,...a,ref:l,role:"group",children:e})})})),yx=(0,z_.KZ)((function(e,t){const{__nextHasNoMarginBottom:n=!1,__next40pxDefaultSize:r=!1,className:o,isAdaptiveWidth:i=!1,isBlock:s=!1,isDeselectable:a=!1,label:l,hideLabelFromVision:c=!1,help:u,onChange:d,size:h="default",value:p,children:f,...m}=(0,F_.A)(e,"ToggleGroupControl"),g=(0,L_.A)(yx,"toggle-group-control"),b=r&&"default"===h?"__unstable-large":h,v=(0,U_.l)(),y=(0,k.useMemo)((()=>v((({isBlock:e,isDeselectable:t,size:n})=>(0,$_.css)("background:",W_.l.ui.background,";border:1px solid transparent;border-radius:",G_.A.controlBorderRadius,";display:inline-flex;min-width:0;position:relative;",(e=>({default:K_,"__unstable-large":q_}[e]))(n)," ",!t&&(e=>{const t=(0,$_.css)("border-color:",W_.l.ui.border,";","");return(0,$_.css)(e&&t," &:hover{border-color:",W_.l.ui.borderHover,";}&:focus-within{border-color:",W_.l.ui.borderFocus,";box-shadow:",G_.A.controlBoxShadowFocus,";z-index:1;outline:2px solid transparent;outline-offset:-2px;}","")})(e),";",""))({isBlock:s,isDeselectable:a,size:b}),s&&Y_,o)),[o,v,s,a,b]),_=a?vx:gx;return(0,Id.jsxs)(V_.Ay,{help:u,__nextHasNoMarginBottom:n,children:[!c&&(0,Id.jsx)(J_,{children:(0,Id.jsx)(V_.Ay.VisualLabel,{children:l})}),(0,Id.jsx)(_,{...m,className:y,isAdaptiveWidth:i,label:l,onChange:d,ref:t,size:b,value:p,children:(0,Id.jsx)(O_,{id:g,children:f})})]})}),"ToggleGroupControl"),_x=yx;var xx=n(65302),wx=n(57207),kx=n(95228);const Cx=(0,H_.default)("div",{target:"et6ln9s1"})({name:"sln1fl",styles:"display:inline-flex;max-width:100%;min-width:0;position:relative"}),Sx={name:"82a6rk",styles:"flex:1"},Ax=({isDeselectable:e,isIcon:t,isPressed:n,size:r})=>(0,$_.css)("align-items:center;appearance:none;background:transparent;border:none;border-radius:",G_.A.controlBorderRadius,";color:",W_.l.gray[700],";fill:currentColor;cursor:pointer;display:flex;font-family:inherit;height:100%;justify-content:center;line-height:100%;outline:none;padding:0 12px;position:relative;text-align:center;@media not ( prefers-reduced-motion ){transition:background ",G_.A.transitionDurationFast," linear,color ",G_.A.transitionDurationFast," linear,font-weight 60ms linear;}user-select:none;width:100%;z-index:2;&::-moz-focus-inner{border:0;}&:active{background:",G_.A.toggleGroupControlBackgroundColor,";}",e&&Ix," ",t&&Tx({size:r})," ",n&&Ex,";",""),Ex=(0,$_.css)("color:",W_.l.white,";&:active{background:transparent;}",""),Ix=(0,$_.css)("color:",W_.l.gray[900],";&:focus{box-shadow:inset 0 0 0 1px ",W_.l.white,",0 0 0 ",G_.A.borderWidthFocus," ",W_.l.theme.accent,";outline:2px solid transparent;}",""),jx=(0,H_.default)("div",{target:"et6ln9s0"})("display:flex;font-size:",G_.A.fontSize,";line-height:1;"),Tx=({size:e="default"})=>(0,$_.css)("color:",W_.l.gray[900],";height:",{default:"30px","__unstable-large":"32px"}[e],";aspect-ratio:1;padding-left:0;padding-right:0;",""),Bx=(0,$_.css)("background:",W_.l.gray[900],";border-radius:",G_.A.controlBorderRadius,";position:absolute;inset:0;z-index:1;outline:2px solid transparent;outline-offset:-3px;","");var Rx=n(95486);const{Rp:Nx,y0:Dx}=m,Mx={duration:0},Px=({showTooltip:e,text:t,children:n})=>e&&t?(0,Id.jsx)(Rx.Ay,{text:t,placement:"top",children:n}):(0,Id.jsx)(Id.Fragment,{children:n}),Ox=(0,z_.KZ)((function e(t,n){const r=(0,kx.A)(),o=(0,k.useContext)(hx),i=(0,L_.A)(e,o.baseId||"toggle-group-control-option-base"),s=(0,F_.A)({...t,id:i},"ToggleGroupControlOptionBase"),{isBlock:a=!1,isDeselectable:l=!1,size:c="default"}=o,{className:u,isIcon:d=!1,value:h,children:p,showTooltip:f=!1,onFocus:m,...g}=s,b=o.value===h,v=(0,U_.l)(),y=(0,k.useMemo)((()=>v(a&&Sx)),[v,a]),_=(0,k.useMemo)((()=>v(Ax({isDeselectable:l,isIcon:d,isPressed:b,size:c}),u)),[v,l,d,b,c,u]),x=(0,k.useMemo)((()=>v(Bx)),[v]),w={...g,className:_,"data-value":h,ref:n};return(0,Id.jsxs)(Dx,{className:y,children:[(0,Id.jsx)(Px,{showTooltip:f,text:g["aria-label"],children:l?(0,Id.jsx)("button",{...w,onFocus:m,"aria-pressed":b,type:"button",onClick:()=>{l&&b?o.setValue(void 0):o.setValue(h)},children:(0,Id.jsx)(Nx,{children:p})}):(0,Id.jsx)(xx.s,{render:(0,Id.jsx)("button",{type:"button",...w,onFocus:e=>{m?.(e),e.defaultPrevented||o.setValue(h)}}),value:h,children:(0,Id.jsx)(Nx,{children:p})})}),b?(0,Id.jsx)(wx.P.div,{layout:!0,layoutRoot:!0,children:(0,Id.jsx)(wx.P.div,{className:x,transition:r?Mx:void 0,role:"presentation",layoutId:"toggle-group-backdrop-shared-layout-id"})}):null]})}),"ToggleGroupControlOptionBase"),Lx=Ox;var Fx=n(56973);const zx=(0,k.forwardRef)((function(e,t){const{icon:n,label:r,...o}=e;return(0,Id.jsx)(Lx,{...o,isIcon:!0,"aria-label":r,showTooltip:!0,ref:t,children:(0,Id.jsx)(Fx.A,{icon:n})})}));var Ux=n(3672);const Vx={default:{name:"default",slug:"flow",className:"is-layout-flow",baseStyles:[{selector:" > .alignleft",rules:{float:"left","margin-inline-start":"0","margin-inline-end":"2em"}},{selector:" > .alignright",rules:{float:"right","margin-inline-start":"2em","margin-inline-end":"0"}},{selector:" > .aligncenter",rules:{"margin-left":"auto !important","margin-right":"auto !important"}}],spacingStyles:[{selector:" > :first-child",rules:{"margin-block-start":"0"}},{selector:" > :last-child",rules:{"margin-block-end":"0"}},{selector:" > *",rules:{"margin-block-start":null,"margin-block-end":"0"}}]},constrained:{name:"constrained",slug:"constrained",className:"is-layout-constrained",baseStyles:[{selector:" > .alignleft",rules:{float:"left","margin-inline-start":"0","margin-inline-end":"2em"}},{selector:" > .alignright",rules:{float:"right","margin-inline-start":"2em","margin-inline-end":"0"}},{selector:" > .aligncenter",rules:{"margin-left":"auto !important","margin-right":"auto !important"}},{selector:" > :where(:not(.alignleft):not(.alignright):not(.alignfull))",rules:{"max-width":"var(--wp--style--global--content-size)","margin-left":"auto !important","margin-right":"auto !important"}},{selector:" > .alignwide",rules:{"max-width":"var(--wp--style--global--wide-size)"}}],spacingStyles:[{selector:" > :first-child",rules:{"margin-block-start":"0"}},{selector:" > :last-child",rules:{"margin-block-end":"0"}},{selector:" > *",rules:{"margin-block-start":null,"margin-block-end":"0"}}]},flex:{name:"flex",slug:"flex",className:"is-layout-flex",displayMode:"flex",baseStyles:[{selector:"",rules:{"flex-wrap":"wrap","align-items":"center"}},{selector:" > :is(*, div)",rules:{margin:"0"}}],spacingStyles:[{selector:"",rules:{gap:null}}]},grid:{name:"grid",slug:"grid",className:"is-layout-grid",displayMode:"grid",baseStyles:[{selector:" > :is(*, div)",rules:{margin:"0"}}],spacingStyles:[{selector:"",rules:{gap:null}}]}};function Hx(e,t=""){return e.split(",").map((e=>`.editor-styles-wrapper ${e}${t?` ${t}`:""}`)).join(",")}function $x(e,t=Vx,n,r){let o="";return t?.[n]?.spacingStyles?.length&&r&&t[n].spacingStyles.forEach((t=>{o+=`${Hx(e,t.selector.trim())} { `,o+=Object.entries(t.rules).map((([e,t])=>`${e}: ${t||r}`)).join("; "),o+="; }"})),o}function Wx(e){const{contentSize:t,wideSize:n,type:r="default"}=e,o={},i=/^(?!0)\d+(px|em|rem|vw|vh|%|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)?$/i;return i.test(t)&&"constrained"===r&&(o.none=(0,U.sprintf)((0,U.__)("Max %s wide"),t)),i.test(n)&&(o.wide=(0,U.sprintf)((0,U.__)("Max %s wide"),n)),o}var Gx=n(80194),qx=n(19897),Kx=n(68591),Yx=n(9926),Jx=n(67119),Xx=n(91482),Zx=n(61172);const Qx=8,ew=["top","right","bottom","left"],tw={top:void 0,right:void 0,bottom:void 0,left:void 0},nw={custom:Gx.A,axial:Gx.A,horizontal:qx.A,vertical:Kx.A,top:Yx.A,right:Jx.A,bottom:Xx.A,left:Zx.A},rw={default:(0,U.__)("Spacing control"),top:(0,U.__)("Top"),bottom:(0,U.__)("Bottom"),left:(0,U.__)("Left"),right:(0,U.__)("Right"),mixed:(0,U.__)("Mixed"),vertical:(0,U.__)("Vertical"),horizontal:(0,U.__)("Horizontal"),axial:(0,U.__)("Horizontal & vertical"),custom:(0,U.__)("Custom")},ow={axial:"axial",top:"top",right:"right",bottom:"bottom",left:"left",custom:"custom"};function iw(e){return!!e?.includes&&("0"===e||e.includes("var:preset|spacing|"))}function sw(e,t){if(!e||iw(e)||"0"===e)return e;const n=t.find((t=>String(t.size)===String(e)));return n?.slug?`var:preset|spacing|${n.slug}`:e}function aw(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function lw(e){if(!e)return;if("0"===e||"default"===e)return e;const t=e.match(/var:preset\|spacing\|(.+)/);return t?t[1]:void 0}function cw(e,t){if(!e||!e.length)return!1;const n=e.includes("horizontal")||e.includes("left")&&e.includes("right"),r=e.includes("vertical")||e.includes("top")&&e.includes("bottom");return"horizontal"===t?n:"vertical"===t?r:n||r}function uw(e,t="0"){const n=function(e){if(!e)return null;const t="string"==typeof e;return{top:t?e:e?.top,left:t?e:e?.left}}(e);if(!n)return null;const r=aw(n?.top)||t,o=aw(n?.left)||t;return r===o?r:`${r} ${o}`}var dw=n(64348);const hw=(0,Id.jsx)(dw.t4,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Id.jsx)(dw.wA,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})}),pw=(0,Id.jsx)(dw.t4,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Id.jsx)(dw.wA,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})}),fw=(0,Id.jsx)(dw.t4,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Id.jsx)(dw.wA,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})}),mw=(0,Id.jsx)(dw.t4,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Id.jsx)(dw.wA,{d:"M4 4L20 4L20 5.5L4 5.5L4 4ZM10 7L14 7L14 17L10 17L10 7ZM20 18.5L4 18.5L4 20L20 20L20 18.5Z"})}),gw=(0,Id.jsx)(dw.t4,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Id.jsx)(dw.wA,{d:"M7 4H17V8L7 8V4ZM7 16L17 16V20L7 20V16ZM20 11.25H4V12.75H20V11.25Z"})}),bw={top:{icon:fw,title:(0,U._x)("Align top","Block vertical alignment setting")},center:{icon:pw,title:(0,U._x)("Align middle","Block vertical alignment setting")},bottom:{icon:hw,title:(0,U._x)("Align bottom","Block vertical alignment setting")},stretch:{icon:mw,title:(0,U._x)("Stretch to fill","Block vertical alignment setting")},"space-between":{icon:gw,title:(0,U._x)("Space between","Block vertical alignment setting")}},vw=["top","center","bottom"],yw=function({value:e,onChange:t,controls:n=vw,isCollapsed:r=!0,isToolbar:o}){function i(n){return()=>t(e===n?void 0:n)}const s=bw[e],a=bw.top,l=o?i_:y_,c=o?{isCollapsed:r}:{};return(0,Id.jsx)(l,{icon:s?s.icon:a.icon,label:(0,U._x)("Change vertical alignment","Block vertical alignment setting label"),controls:n.map((t=>({...bw[t],isActive:e===t,role:r?"menuitemradio":void 0,onClick:i(t)}))),...c})},_w=e=>(0,Id.jsx)(yw,{...e,isToolbar:!1}),xw=e=>(0,Id.jsx)(yw,{...e,isToolbar:!0}),ww={left:w_.A,center:k_.A,right:C_.A,"space-between":S_.A,stretch:A_.A},kw=function({allowedControls:e=["left","center","right","space-between"],isCollapsed:t=!0,onChange:n,value:r,popoverProps:o,isToolbar:i}){const s=e=>{n(e===r?void 0:e)},a=r?ww[r]:ww.left,l=[{name:"left",icon:w_.A,title:(0,U.__)("Justify items left"),isActive:"left"===r,onClick:()=>s("left")},{name:"center",icon:k_.A,title:(0,U.__)("Justify items center"),isActive:"center"===r,onClick:()=>s("center")},{name:"right",icon:C_.A,title:(0,U.__)("Justify items right"),isActive:"right"===r,onClick:()=>s("right")},{name:"space-between",icon:S_.A,title:(0,U.__)("Space between items"),isActive:"space-between"===r,onClick:()=>s("space-between")},{name:"stretch",icon:A_.A,title:(0,U.__)("Stretch items"),isActive:"stretch"===r,onClick:()=>s("stretch")}],c=i?i_:y_,u=i?{isCollapsed:t}:{};return(0,Id.jsx)(c,{icon:a,popoverProps:o,label:(0,U.__)("Change items justification"),controls:l.filter((t=>e.includes(t.name))),...u})},Cw=e=>(0,Id.jsx)(kw,{...e,isToolbar:!1}),Sw={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},Aw={left:"flex-start",right:"flex-end",center:"center",stretch:"stretch"},Ew={top:"flex-start",center:"center",bottom:"flex-end",stretch:"stretch","space-between":"space-between"},Iw=["wrap","nowrap"],jw={name:"flex",label:(0,U.__)("Flex"),inspectorControls:function({layout:e={},onChange:t,layoutBlockSupport:n={}}){const{allowOrientation:r=!0}=n;return(0,Id.jsxs)(Id.Fragment,{children:[(0,Id.jsxs)(j_.A,{children:[(0,Id.jsx)(T_.A,{children:(0,Id.jsx)(Rw,{layout:e,onChange:t})}),(0,Id.jsx)(T_.A,{children:r&&(0,Id.jsx)(Dw,{layout:e,onChange:t})})]}),(0,Id.jsx)(Nw,{layout:e,onChange:t})]})},toolBarControls:function({layout:e={},onChange:t,layoutBlockSupport:n}){if(n?.allowSwitching)return null;const{allowVerticalAlignment:r=!0}=n;return(0,Id.jsxs)(v_,{group:"block",__experimentalShareWithChildBlocks:!0,children:[(0,Id.jsx)(Rw,{layout:e,onChange:t,isToolbar:!0}),r&&(0,Id.jsx)(Tw,{layout:e,onChange:t,isToolbar:!0})]})},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:r,hasBlockGapSupport:o,layoutDefinitions:i=Vx}){const{orientation:s="horizontal"}=t,a=n?.spacing?.blockGap&&!Wy(r,"spacing","blockGap")?uw(n?.spacing?.blockGap,"0.5em"):void 0,l=Sw[t.justifyContent],c=Iw.includes(t.flexWrap)?t.flexWrap:"wrap",u=Ew[t.verticalAlignment],d=Aw[t.justifyContent]||Aw.left;let h="";const p=[];return c&&"wrap"!==c&&p.push(`flex-wrap: ${c}`),"horizontal"===s?(u&&p.push(`align-items: ${u}`),l&&p.push(`justify-content: ${l}`)):(u&&p.push(`justify-content: ${u}`),p.push("flex-direction: column"),p.push(`align-items: ${d}`)),p.length&&(h=`${Hx(e)} {\n\t\t\t\t${p.join("; ")};\n\t\t\t}`),o&&a&&(h+=$x(e,i,"flex",a)),h},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function Tw({layout:e,onChange:t,isToolbar:n=!1}){const{orientation:r="horizontal"}=e,o="horizontal"===r?Ew.center:Ew.top,{verticalAlignment:i=o}=e,s=n=>{t({...e,verticalAlignment:n})};if(n)return(0,Id.jsx)(_w,{onChange:s,value:i,controls:"horizontal"===r?["top","center","bottom","stretch"]:["top","center","bottom","space-between"]});const a=[{value:"flex-start",label:(0,U.__)("Align items top")},{value:"center",label:(0,U.__)("Align items center")},{value:"flex-end",label:(0,U.__)("Align items bottom")}];return(0,Id.jsxs)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control",children:[(0,Id.jsx)("legend",{children:(0,U.__)("Vertical alignment")}),(0,Id.jsx)("div",{children:a.map(((e,t,n)=>(0,Id.jsx)(Jy.Ay,{label:n,icon:t,isPressed:i===e,onClick:()=>s(e)},e)))})]})}const Bw={placement:"bottom-start"};function Rw({layout:e,onChange:t,isToolbar:n=!1}){const{justifyContent:r="left",orientation:o="horizontal"}=e,i=n=>{t({...e,justifyContent:n})},s=["left","center","right"];if("horizontal"===o?s.push("space-between"):s.push("stretch"),n)return(0,Id.jsx)(Cw,{allowedControls:s,value:r,onChange:i,popoverProps:Bw});const a=[{value:"left",icon:w_.A,label:(0,U.__)("Justify items left")},{value:"center",icon:k_.A,label:(0,U.__)("Justify items center")},{value:"right",icon:C_.A,label:(0,U.__)("Justify items right")}];return"horizontal"===o?a.push({value:"space-between",icon:S_.A,label:(0,U.__)("Space between items")}):a.push({value:"stretch",icon:A_.A,label:(0,U.__)("Stretch items")}),(0,Id.jsx)(_x,{__nextHasNoMarginBottom:!0,label:(0,U.__)("Justification"),value:r,onChange:i,className:"block-editor-hooks__flex-layout-justification-controls",children:a.map((({value:e,icon:t,label:n})=>(0,Id.jsx)(zx,{value:e,icon:t,label:n},e)))})}function Nw({layout:e,onChange:t}){const{flexWrap:n="wrap"}=e;return(0,Id.jsx)(Ux.A,{__nextHasNoMarginBottom:!0,label:(0,U.__)("Allow to wrap to multiple lines"),onChange:n=>{t({...e,flexWrap:n?"wrap":"nowrap"})},checked:"wrap"===n})}function Dw({layout:e,onChange:t}){const{orientation:n="horizontal",verticalAlignment:r,justifyContent:o}=e;return(0,Id.jsxs)(_x,{__nextHasNoMarginBottom:!0,className:"block-editor-hooks__flex-layout-orientation-controls",label:(0,U.__)("Orientation"),value:n,onChange:n=>{let i=r,s=o;return"horizontal"===n?("space-between"===r&&(i="center"),"stretch"===o&&(s="left")):("stretch"===r&&(i="top"),"space-between"===o&&(s="left")),t({...e,orientation:n,verticalAlignment:i,justifyContent:s})},children:[(0,Id.jsx)(zx,{icon:E_.A,value:"horizontal",label:(0,U.__)("Horizontal")}),(0,Id.jsx)(zx,{icon:I_.A,value:"vertical",label:(0,U.__)("Vertical")})]})}const Mw={name:"default",label:(0,U.__)("Flow"),inspectorControls:function(){return null},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,style:t,blockName:n,hasBlockGapSupport:r,layoutDefinitions:o=Vx}){const i=uw(t?.spacing?.blockGap);let s="";Wy(n,"spacing","blockGap")||(i?.top?s=uw(i?.top):"string"==typeof i&&(s=uw(i)));let a="";return r&&s&&(a+=$x(e,o,"default",s)),a},getOrientation:()=>"vertical",getAlignments(e,t){const n=Wx(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:n[e]})));const r=[{name:"left"},{name:"center"},{name:"right"}];if(!t){const{contentSize:t,wideSize:o}=e;t&&r.unshift({name:"full"}),o&&r.unshift({name:"wide",info:n.wide})}return r.unshift({name:"none",info:n.none}),r}},Pw="web"===Ph.A.OS,Ow={px:{value:"px",label:Pw?"px":(0,U.__)("Pixels (px)"),a11yLabel:(0,U.__)("Pixels (px)"),step:1},"%":{value:"%",label:Pw?"%":(0,U.__)("Percentage (%)"),a11yLabel:(0,U.__)("Percent (%)"),step:.1},em:{value:"em",label:Pw?"em":(0,U.__)("Relative to parent font size (em)"),a11yLabel:(0,U._x)("ems","Relative to parent font size (em)"),step:.01},rem:{value:"rem",label:Pw?"rem":(0,U.__)("Relative to root font size (rem)"),a11yLabel:(0,U._x)("rems","Relative to root font size (rem)"),step:.01},vw:{value:"vw",label:Pw?"vw":(0,U.__)("Viewport width (vw)"),a11yLabel:(0,U.__)("Viewport width (vw)"),step:.1},vh:{value:"vh",label:Pw?"vh":(0,U.__)("Viewport height (vh)"),a11yLabel:(0,U.__)("Viewport height (vh)"),step:.1},vmin:{value:"vmin",label:Pw?"vmin":(0,U.__)("Viewport smallest dimension (vmin)"),a11yLabel:(0,U.__)("Viewport smallest dimension (vmin)"),step:.1},vmax:{value:"vmax",label:Pw?"vmax":(0,U.__)("Viewport largest dimension (vmax)"),a11yLabel:(0,U.__)("Viewport largest dimension (vmax)"),step:.1},ch:{value:"ch",label:Pw?"ch":(0,U.__)("Width of the zero (0) character (ch)"),a11yLabel:(0,U.__)("Width of the zero (0) character (ch)"),step:.01},ex:{value:"ex",label:Pw?"ex":(0,U.__)("x-height of the font (ex)"),a11yLabel:(0,U.__)("x-height of the font (ex)"),step:.01},cm:{value:"cm",label:Pw?"cm":(0,U.__)("Centimeters (cm)"),a11yLabel:(0,U.__)("Centimeters (cm)"),step:.001},mm:{value:"mm",label:Pw?"mm":(0,U.__)("Millimeters (mm)"),a11yLabel:(0,U.__)("Millimeters (mm)"),step:.1},in:{value:"in",label:Pw?"in":(0,U.__)("Inches (in)"),a11yLabel:(0,U.__)("Inches (in)"),step:.001},pc:{value:"pc",label:Pw?"pc":(0,U.__)("Picas (pc)"),a11yLabel:(0,U.__)("Picas (pc)"),step:1},pt:{value:"pt",label:Pw?"pt":(0,U.__)("Points (pt)"),a11yLabel:(0,U.__)("Points (pt)"),step:1},svw:{value:"svw",label:Pw?"svw":(0,U.__)("Small viewport width (svw)"),a11yLabel:(0,U.__)("Small viewport width (svw)"),step:.1},svh:{value:"svh",label:Pw?"svh":(0,U.__)("Small viewport height (svh)"),a11yLabel:(0,U.__)("Small viewport height (svh)"),step:.1},svi:{value:"svi",label:Pw?"svi":(0,U.__)("Viewport smallest size in the inline direction (svi)"),a11yLabel:(0,U.__)("Small viewport width or height (svi)"),step:.1},svb:{value:"svb",label:Pw?"svb":(0,U.__)("Viewport smallest size in the block direction (svb)"),a11yLabel:(0,U.__)("Small viewport width or height (svb)"),step:.1},svmin:{value:"svmin",label:Pw?"svmin":(0,U.__)("Small viewport smallest dimension (svmin)"),a11yLabel:(0,U.__)("Small viewport smallest dimension (svmin)"),step:.1},lvw:{value:"lvw",label:Pw?"lvw":(0,U.__)("Large viewport width (lvw)"),a11yLabel:(0,U.__)("Large viewport width (lvw)"),step:.1},lvh:{value:"lvh",label:Pw?"lvh":(0,U.__)("Large viewport height (lvh)"),a11yLabel:(0,U.__)("Large viewport height (lvh)"),step:.1},lvi:{value:"lvi",label:Pw?"lvi":(0,U.__)("Large viewport width or height (lvi)"),a11yLabel:(0,U.__)("Large viewport width or height (lvi)"),step:.1},lvb:{value:"lvb",label:Pw?"lvb":(0,U.__)("Large viewport width or height (lvb)"),a11yLabel:(0,U.__)("Large viewport width or height (lvb)"),step:.1},lvmin:{value:"lvmin",label:Pw?"lvmin":(0,U.__)("Large viewport smallest dimension (lvmin)"),a11yLabel:(0,U.__)("Large viewport smallest dimension (lvmin)"),step:.1},dvw:{value:"dvw",label:Pw?"dvw":(0,U.__)("Dynamic viewport width (dvw)"),a11yLabel:(0,U.__)("Dynamic viewport width (dvw)"),step:.1},dvh:{value:"dvh",label:Pw?"dvh":(0,U.__)("Dynamic viewport height (dvh)"),a11yLabel:(0,U.__)("Dynamic viewport height (dvh)"),step:.1},dvi:{value:"dvi",label:Pw?"dvi":(0,U.__)("Dynamic viewport width or height (dvi)"),a11yLabel:(0,U.__)("Dynamic viewport width or height (dvi)"),step:.1},dvb:{value:"dvb",label:Pw?"dvb":(0,U.__)("Dynamic viewport width or height (dvb)"),a11yLabel:(0,U.__)("Dynamic viewport width or height (dvb)"),step:.1},dvmin:{value:"dvmin",label:Pw?"dvmin":(0,U.__)("Dynamic viewport smallest dimension (dvmin)"),a11yLabel:(0,U.__)("Dynamic viewport smallest dimension (dvmin)"),step:.1},dvmax:{value:"dvmax",label:Pw?"dvmax":(0,U.__)("Dynamic viewport largest dimension (dvmax)"),a11yLabel:(0,U.__)("Dynamic viewport largest dimension (dvmax)"),step:.1},svmax:{value:"svmax",label:Pw?"svmax":(0,U.__)("Small viewport largest dimension (svmax)"),a11yLabel:(0,U.__)("Small viewport largest dimension (svmax)"),step:.1},lvmax:{value:"lvmax",label:Pw?"lvmax":(0,U.__)("Large viewport largest dimension (lvmax)"),a11yLabel:(0,U.__)("Large viewport largest dimension (lvmax)"),step:.1}},Lw=Object.values(Ow),Fw=[Ow.px,Ow["%"],Ow.em,Ow.rem,Ow.vw,Ow.vh],zw=Ow.px;function Uw(e,t,n){return Hw(t?`${null!=e?e:""}${t}`:e,n)}function Vw(e){return Array.isArray(e)&&!!e.length}function Hw(e,t=Lw){let n,r;if(void 0!==e||null===e){n=`${e}`.trim();const t=parseFloat(n);r=isFinite(t)?t:void 0}const o=n?.match(/[\d.\-\+]*\s*(.*)/),i=o?.[1]?.toLowerCase();let s;if(Vw(t)){const e=t.find((e=>e.value===i));s=e?.value}else s=zw.value;return[r,s]}const $w=({units:e=Lw,availableUnits:t=[],defaultValues:n})=>{const r=function(e=[],t){return Array.isArray(t)?t.filter((t=>e.includes(t.value))):[]}(t,e);return n&&r.forEach(((e,t)=>{if(n[e.value]){const[o]=Hw(n[e.value]);r[t].default=o}})),r};var Ww=n(2711),Gw=n(28795),qw=n(31110),Kw=n(34579);const Yw=(0,H_.default)(Gw.A,{target:"e1bagdl32"})("&&&{input{display:block;width:100%;}",qw.Hr,"{transition:box-shadow 0.1s linear;}}"),Jw=({selectSize:e})=>({small:(0,$_.css)("box-sizing:border-box;padding:2px 1px;width:20px;color:",W_.l.gray[800],";font-size:8px;line-height:1;letter-spacing:-0.5px;text-transform:uppercase;text-align-last:center;",""),default:(0,$_.css)("box-sizing:border-box;min-width:24px;max-width:48px;height:24px;margin-inline-end:",(0,Kw.x)(2),";padding:",(0,Kw.x)(1),";color:",W_.l.theme.accent,";font-size:13px;line-height:1;text-align-last:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;","")}[e]),Xw=(0,H_.default)("div",{target:"e1bagdl31"})("&&&{pointer-events:none;",Jw,";color:",W_.l.gray[900],";}"),Zw=({selectSize:e="default"})=>({small:(0,$_.css)("height:100%;border:1px solid transparent;transition:box-shadow 0.1s linear,border 0.1s linear;",(0,Ww.h)({borderTopLeftRadius:0,borderBottomLeftRadius:0})()," &:not(:disabled):hover{background-color:",W_.l.gray[100],";}&:focus{border:1px solid ",W_.l.ui.borderFocus,";box-shadow:inset 0 0 0 ",G_.A.borderWidth+" "+W_.l.ui.borderFocus,";outline-offset:0;outline:2px solid transparent;z-index:1;}",""),default:(0,$_.css)("display:flex;justify-content:center;align-items:center;&:hover{color:",W_.l.ui.borderFocus,";box-shadow:inset 0 0 0 ",G_.A.borderWidth+" "+W_.l.ui.borderFocus,";outline:",G_.A.borderWidth," solid transparent;}&:focus{box-shadow:0 0 0 ",G_.A.borderWidthFocus+" "+W_.l.ui.borderFocus,";outline:",G_.A.borderWidthFocus," solid transparent;}","")}[e]),Qw=(0,H_.default)("select",{target:"e1bagdl30"})("&&&{appearance:none;background:transparent;border-radius:2px;border:none;display:block;outline:none;margin:0;min-height:auto;font-family:inherit;",Jw,";",Zw,";&:not( :disabled ){cursor:pointer;}}"),ek=(0,k.forwardRef)((function({className:e,isUnitSelectTabbable:t=!0,onChange:n,size:r="default",unit:o="px",units:i=Fw,...s},a){if(!Vw(i)||1===i?.length)return(0,Id.jsx)(Xw,{className:"components-unit-control__unit-label",selectSize:r,children:o});const l=(0,Vy.A)("components-unit-control__select",e);return(0,Id.jsx)(Qw,{ref:a,className:l,onChange:e=>{const{value:t}=e.target,r=i.find((e=>e.value===t));n?.(t,{event:e,data:r})},selectSize:r,tabIndex:t?void 0:-1,value:o,...s,children:i.map((e=>(0,Id.jsx)("option",{value:e.value,children:e.label},e.value)))})}));var tk=n(31084),nk=n(94647),rk=n(90309);const ok=(0,k.forwardRef)((function(e,t){const{__unstableStateReducer:n,autoComplete:r="off",children:o,className:i,disabled:s=!1,disableUnits:a=!1,isPressEnterToChange:l=!1,isResetValueOnUnitChange:c=!1,isUnitSelectTabbable:u=!0,label:d,onChange:h,onUnitChange:p,size:f="default",unit:m,units:g=Fw,value:b,onFocus:v,...y}=(0,rk.R)(e);"unit"in e&&(0,W.default)("UnitControl unit prop",{since:"5.6",hint:"The unit should be provided within the `value` prop.",version:"6.2"});const _=null!=b?b:void 0,[x,w]=(0,k.useMemo)((()=>{const e=function(e,t,n=Lw){const r=Array.isArray(n)?[...n]:[],[,o]=Uw(e,t,Lw);return o&&!r.some((e=>e.value===o))&&Ow[o]&&r.unshift(Ow[o]),r}(_,m,g),[{value:t=""}={},...n]=e,r=n.reduce(((e,{value:t})=>{const n=(0,nk.Nt)(t?.substring(0,1)||"");return e.includes(n)?e:`${e}|${n}`}),(0,nk.Nt)(t.substring(0,1)));return[e,new RegExp(`^(?:${r})$`,"i")]}),[_,m,g]),[C,S]=Uw(_,m,x),[A,E]=(0,tk.A)(1===x.length?x[0].value:m,{initial:S,fallback:""});(0,k.useEffect)((()=>{void 0!==S&&E(S)}),[S,E]);const I=(0,Vy.A)("components-unit-control","components-unit-control-wrapper",i);let j;!a&&u&&x.length&&(j=e=>{y.onKeyDown?.(e),!e.metaKey&&w.test(e.key)&&T.current?.focus()});const T=(0,k.useRef)(null),B=a?null:(0,Id.jsx)(ek,{ref:T,"aria-label":(0,U.__)("Select unit"),disabled:s,isUnitSelectTabbable:u,onChange:(e,t)=>{const{data:n}=t;let r=`${null!=C?C:""}${e}`;c&&void 0!==n?.default&&(r=`${n.default}${e}`),h?.(r,t),p?.(e,t),E(e)},size:["small","compact"].includes(f)||"default"===f&&!y.__next40pxDefaultSize?"small":"default",unit:A,units:x,onFocus:v,onBlur:e.onBlur});let R=y.step;if(!R&&x){var N;const e=x.find((e=>e.value===A));R=null!==(N=e?.step)&&void 0!==N?N:1}return(0,Id.jsx)(Yw,{...y,autoComplete:r,className:I,disabled:s,spinControls:"none",isPressEnterToChange:l,label:d,onKeyDown:j,onChange:(e,t)=>{if(""===e||null==e)return void h?.("",t);const n=function(e,t,n,r){const[o,i]=Hw(e,t),s=null!=o?o:n;let a=i||r;return!a&&Vw(t)&&(a=t[0].value),[s,a]}(e,x,C,A).join("");h?.(n,t)},ref:t,size:f,suffix:B,type:l?"text":"number",value:null!=C?C:"",step:R,onFocus:v,__unstableStateReducer:n})})),ik=ok;var sk=n(77780),ak=n(29791),lk=n(59473),ck=n(11789);const uk="var:",dk="|",hk="--",pk=(e,t)=>{let n=e;return t.forEach((e=>{n=n?.[e]})),n};function fk(e,t,n,r){const o=pk(e,n);return o?[{selector:t?.selector,key:r,value:gk(o)}]:[]}function mk(e,t,n,r,o=["top","right","bottom","left"]){const i=pk(e,n);if(!i)return[];const s=[];if("string"==typeof i)s.push({selector:t?.selector,key:r.default,value:i});else{const e=o.reduce(((e,n)=>{const o=gk(pk(i,[n]));return o&&e.push({selector:t?.selector,key:r?.individual.replace("%s",bk(n)),value:o}),e}),[]);s.push(...e)}return s}function gk(e){return"string"==typeof e&&e.startsWith(uk)?`var(--wp--${e.slice(uk.length).split(dk).map((e=>(0,ck.c)(e,{splitRegexp:[/([a-z0-9])([A-Z])/g,/([0-9])([a-z])/g,/([A-Za-z])([0-9])/g,/([A-Z])([A-Z][a-z])/g]}))).join(hk)})`:e}function bk(e){const[t,...n]=e;return t.toUpperCase()+n.join("")}function vk(e){try{return decodeURI(e)}catch(t){return e}}function yk(e){return(t,n)=>fk(t,n,e,function(e){const[t,...n]=e;return t.toLowerCase()+n.map(bk).join("")}(e))}function _k(e){return(t,n)=>["color","style","width"].flatMap((r=>yk(["border",e,r])(t,n)))}const xk={name:"radius",generate:(e,t)=>mk(e,t,["border","radius"],{default:"borderRadius",individual:"border%sRadius"},["topLeft","topRight","bottomLeft","bottomRight"])},wk={name:"background",generate:(e,t)=>fk(e,t,["color","background"],"backgroundColor")},kk={name:"gradient",generate:(e,t)=>fk(e,t,["color","gradient"],"background")},Ck={name:"text",generate:(e,t)=>fk(e,t,["color","text"],"color")},Sk={name:"minHeight",generate:(e,t)=>fk(e,t,["dimensions","minHeight"],"minHeight")},Ak={name:"aspectRatio",generate:(e,t)=>fk(e,t,["dimensions","aspectRatio"],"aspectRatio")},Ek={name:"backgroundImage",generate:(e,t)=>{const n=e?.background?.backgroundImage;return"object"==typeof n&&n?.url?[{selector:t.selector,key:"backgroundImage",value:`url( '${encodeURI(vk(n.url))}' )`}]:"string"==typeof n?fk(e,t,["background","backgroundImage"],"backgroundImage"):[]}},Ik={name:"backgroundPosition",generate:(e,t)=>fk(e,t,["background","backgroundPosition"],"backgroundPosition")},jk={name:"backgroundRepeat",generate:(e,t)=>fk(e,t,["background","backgroundRepeat"],"backgroundRepeat")},Tk={name:"backgroundSize",generate:(e,t)=>fk(e,t,["background","backgroundSize"],"backgroundSize")},Bk={name:"shadow",generate:(e,t)=>fk(e,t,["shadow"],"boxShadow")},Rk={name:"color",generate:(e,t,n=["outline","color"],r="outlineColor")=>fk(e,t,n,r)},Nk={name:"offset",generate:(e,t,n=["outline","offset"],r="outlineOffset")=>fk(e,t,n,r)},Dk={name:"style",generate:(e,t,n=["outline","style"],r="outlineStyle")=>fk(e,t,n,r)},Mk={name:"width",generate:(e,t,n=["outline","width"],r="outlineWidth")=>fk(e,t,n,r)},Pk={name:"padding",generate:(e,t)=>mk(e,t,["spacing","padding"],{default:"padding",individual:"padding%s"})},Ok={name:"margin",generate:(e,t)=>mk(e,t,["spacing","margin"],{default:"margin",individual:"margin%s"})},Lk={name:"fontSize",generate:(e,t)=>fk(e,t,["typography","fontSize"],"fontSize")},Fk={name:"fontStyle",generate:(e,t)=>fk(e,t,["typography","fontStyle"],"fontStyle")},zk={name:"fontWeight",generate:(e,t)=>fk(e,t,["typography","fontWeight"],"fontWeight")},Uk={name:"fontFamily",generate:(e,t)=>fk(e,t,["typography","fontFamily"],"fontFamily")},Vk={name:"letterSpacing",generate:(e,t)=>fk(e,t,["typography","letterSpacing"],"letterSpacing")},Hk={name:"lineHeight",generate:(e,t)=>fk(e,t,["typography","lineHeight"],"lineHeight")},$k={name:"textColumns",generate:(e,t)=>fk(e,t,["typography","textColumns"],"columnCount")},Wk={name:"textDecoration",generate:(e,t)=>fk(e,t,["typography","textDecoration"],"textDecoration")},Gk={name:"textTransform",generate:(e,t)=>fk(e,t,["typography","textTransform"],"textTransform")},qk={name:"writingMode",generate:(e,t)=>fk(e,t,["typography","writingMode"],"writingMode")},Kk=[{name:"color",generate:yk(["border","color"])},{name:"style",generate:yk(["border","style"])},{name:"width",generate:yk(["border","width"])},xk,{name:"borderTop",generate:_k("top")},{name:"borderRight",generate:_k("right")},{name:"borderBottom",generate:_k("bottom")},{name:"borderLeft",generate:_k("left")},Ck,kk,wk,Sk,Ak,Rk,Dk,Nk,Mk,Ok,Pk,Uk,Lk,Fk,zk,Vk,Hk,$k,Wk,Gk,qk,Bk,Ek,Ik,jk,Tk];function Yk(e,t={}){const n=Jk(e,t);if(!t?.selector){const e=[];return n.forEach((t=>{e.push(`${(0,ck.c)(t.key)}: ${t.value};`)})),e.join(" ")}const r=n.reduce(((e,t)=>{const{selector:n}=t;return n?(e[n]||(e[n]=[]),e[n].push(t),e):e}),{});return Object.keys(r).reduce(((e,t)=>(e.push(`${t} { ${r[t].map((e=>`${(0,ck.c)(e.key)}: ${e.value};`)).join(" ")} }`),e)),[]).join("\n")}function Jk(e,t={}){const n=[];return Kk.forEach((r=>{"function"==typeof r.generate&&n.push(...r.generate(e,t))})),n}const Xk={name:"constrained",label:(0,U.__)("Constrained"),inspectorControls:function({layout:e,onChange:t,layoutBlockSupport:n={}}){const{wideSize:r,contentSize:o,justifyContent:i="center"}=e,{allowJustification:s=!0,allowCustomContentAndWideSize:a=!0}=n,l=[{value:"left",icon:w_.A,label:(0,U.__)("Justify items left")},{value:"center",icon:k_.A,label:(0,U.__)("Justify items center")},{value:"right",icon:C_.A,label:(0,U.__)("Justify items right")}],[c]=hy("spacing.units"),u=$w({availableUnits:c||["%","px","em","rem","vw"]});return(0,Id.jsxs)(Id.Fragment,{children:[a&&(0,Id.jsxs)(Id.Fragment,{children:[(0,Id.jsxs)("div",{className:"block-editor-hooks__layout-controls",children:[(0,Id.jsxs)("div",{className:"block-editor-hooks__layout-controls-unit",children:[(0,Id.jsx)(ik,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,U.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,contentSize:n})},units:u}),(0,Id.jsx)(sk.A,{icon:ak.A})]}),(0,Id.jsxs)("div",{className:"block-editor-hooks__layout-controls-unit",children:[(0,Id.jsx)(ik,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,U.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,wideSize:n})},units:u}),(0,Id.jsx)(sk.A,{icon:lk.A})]})]}),(0,Id.jsx)("p",{className:"block-editor-hooks__layout-controls-helptext",children:(0,U.__)("Customize the width for all elements that are assigned to the center or wide columns.")})]}),s&&(0,Id.jsx)(_x,{__nextHasNoMarginBottom:!0,label:(0,U.__)("Justification"),value:i,onChange:n=>{t({...e,justifyContent:n})},children:l.map((({value:e,icon:t,label:n})=>(0,Id.jsx)(zx,{value:e,icon:t,label:n},e)))})]})},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,layout:t={},style:n,blockName:r,hasBlockGapSupport:o,layoutDefinitions:i=Vx}){const{contentSize:s,wideSize:a,justifyContent:l}=t,c=uw(n?.spacing?.blockGap);let u="";Wy(r,"spacing","blockGap")||(c?.top?u=uw(c?.top):"string"==typeof c&&(u=uw(c)));const d="left"===l?"0 !important":"auto !important",h="right"===l?"0 !important":"auto !important";let p=s||a?`\n\t\t\t\t\t${Hx(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} {\n\t\t\t\t\t\tmax-width: ${null!=s?s:a};\n\t\t\t\t\t\tmargin-left: ${d};\n\t\t\t\t\t\tmargin-right: ${h};\n\t\t\t\t\t}\n\t\t\t\t\t${Hx(e,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=a?a:s};\n\t\t\t\t\t}\n\t\t\t\t\t${Hx(e,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return"left"===l?p+=`${Hx(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-left: ${d}; }`:"right"===l&&(p+=`${Hx(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-right: ${h}; }`),n?.spacing?.padding&&Jk(n).forEach((t=>{"paddingRight"===t.key?p+=`\n\t\t\t\t\t${Hx(e,"> .alignfull")} {\n\t\t\t\t\t\tmargin-right: calc(${t.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`:"paddingLeft"===t.key&&(p+=`\n\t\t\t\t\t${Hx(e,"> .alignfull")} {\n\t\t\t\t\t\tmargin-left: calc(${t.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`)})),o&&u&&(p+=$x(e,i,"constrained",u)),p},getOrientation:()=>"vertical",getAlignments(e){const t=Wx(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:t[e]})));const{contentSize:n,wideSize:r}=e,o=[{name:"left"},{name:"center"},{name:"right"}];return n&&o.unshift({name:"full"}),r&&o.unshift({name:"wide",info:t.wide}),o.unshift({name:"none",info:t.none}),o}};var Zk=n(46774),Qk=n(75015);function eC(e,t,n){return"number"!=typeof e?null:parseFloat(`${(0,Qk.qE)(e,t,n)}`)}const tC=()=>(0,$_.css)({height:30,minHeight:30},"",""),nC=({__next40pxDefaultSize:e})=>!e&&(0,$_.css)({minHeight:30},"",""),rC=(0,H_.default)("div",{target:"e1epgpqk14"})("-webkit-tap-highlight-color:transparent;align-items:center;display:flex;justify-content:flex-start;padding:0;position:relative;touch-action:none;width:100%;min-height:40px;",nC,";"),oC=({color:e=W_.l.ui.borderFocus})=>(0,$_.css)({color:e},"",""),iC=({marks:e,__nextHasNoMarginBottom:t})=>t?"":(0,$_.css)({marginBottom:e?16:void 0},"",""),sC=(0,H_.default)("div",{target:"e1epgpqk13"})("display:block;flex:1;position:relative;width:100%;",oC,";",tC,";",iC,";"),aC=(0,H_.default)("span",{target:"e1epgpqk12"})("display:flex;margin-top:",4,"px;",(0,Ww.h)({marginRight:6}),";"),lC=(0,H_.default)("span",{target:"e1epgpqk11"})("display:flex;margin-top:",4,"px;",(0,Ww.h)({marginLeft:6}),";"),cC=({disabled:e,railColor:t})=>{let n=t||"";return e&&(n=W_.l.ui.backgroundDisabled),(0,$_.css)({background:n},"","")},uC=(0,H_.default)("span",{target:"e1epgpqk10"})("background-color:",W_.l.gray[300],";left:0;pointer-events:none;right:0;display:block;height:",4,"px;position:absolute;margin-top:",13,"px;top:0;border-radius:",4,"px;",cC,";"),dC=({disabled:e,trackColor:t})=>{let n=t||"currentColor";return e&&(n=W_.l.gray[400]),(0,$_.css)({background:n},"","")},hC=(0,H_.default)("span",{target:"e1epgpqk9"})("background-color:currentColor;border-radius:",4,"px;height:",4,"px;pointer-events:none;display:block;position:absolute;margin-top:",13,"px;top:0;",dC,";"),pC=(0,H_.default)("span",{target:"e1epgpqk8"})({name:"l7tjj5",styles:"display:block;pointer-events:none;position:relative;width:100%;user-select:none"}),fC=({disabled:e,isFilled:t})=>{let n=t?"currentColor":W_.l.gray[300];return e&&(n=W_.l.gray[400]),(0,$_.css)({backgroundColor:n},"","")},mC=(0,H_.default)("span",{target:"e1epgpqk7"})("height:",12,"px;left:0;position:absolute;top:-4px;width:1px;",fC,";"),gC=({isFilled:e})=>(0,$_.css)({color:e?W_.l.gray[700]:W_.l.gray[300]},"",""),bC=(0,H_.default)("span",{target:"e1epgpqk6"})("color:",W_.l.gray[300],";left:0;font-size:11px;position:absolute;top:12px;transform:translateX( -50% );white-space:nowrap;",gC,";"),vC=({disabled:e})=>e?(0,$_.css)("background-color:",W_.l.gray[400],";",""):(0,$_.css)("background-color:",W_.l.theme.accent,";",""),yC=(0,H_.default)("span",{target:"e1epgpqk5"})("align-items:center;display:flex;height:",12,"px;justify-content:center;margin-top:",9,"px;outline:0;pointer-events:none;position:absolute;top:0;user-select:none;width:",12,"px;border-radius:50%;",vC,";",(0,Ww.h)({marginLeft:-10}),";",(0,Ww.h)({transform:"translateX( 4.5px )"},{transform:"translateX( -4.5px )"}),";"),_C=({isFocused:e})=>e?(0,$_.css)("&::before{content:' ';position:absolute;background-color:",W_.l.theme.accent,";opacity:0.4;border-radius:50%;height:",20,"px;width:",20,"px;top:-4px;left:-4px;}",""):"",xC=(0,H_.default)("span",{target:"e1epgpqk4"})("align-items:center;border-radius:50%;height:100%;outline:0;position:absolute;user-select:none;width:100%;",vC,";",_C,";"),wC=(0,H_.default)("input",{target:"e1epgpqk3"})("box-sizing:border-box;cursor:pointer;display:block;height:100%;left:0;margin:0 -",6,"px;opacity:0;outline:none;position:absolute;right:0;top:0;width:calc( 100% + ",12,"px );"),kC=({show:e})=>(0,$_.css)({opacity:e?1:0},"","");var CC={name:"1cypxip",styles:"top:-80%"},SC={name:"1lr98c4",styles:"bottom:-80%"};const AC=({position:e})=>"bottom"===e?SC:CC,EC=(0,H_.default)("span",{target:"e1epgpqk2"})("background:rgba( 0, 0, 0, 0.8 );border-radius:2px;color:white;display:inline-block;font-size:12px;min-width:32px;opacity:0;padding:4px 8px;pointer-events:none;position:absolute;text-align:center;user-select:none;line-height:1.4;@media not ( prefers-reduced-motion ){transition:opacity 120ms ease;}",kC,";",AC,";",(0,Ww.h)({transform:"translateX(-50%)"},{transform:"translateX(50%)"}),";"),IC=(0,H_.default)(Gw.A,{target:"e1epgpqk1"})("display:inline-block;font-size:13px;margin-top:0;input[type='number']&{",tC,";}",(0,Ww.h)({marginLeft:`${(0,Kw.x)(4)} !important`}),";"),jC=(0,H_.default)("span",{target:"e1epgpqk0"})("display:block;margin-top:0;button,button.is-small{margin-left:0;",tC,";}",(0,Ww.h)({marginLeft:8}),";"),TC=(0,k.forwardRef)((function(e,t){const{describedBy:n,label:r,value:o,...i}=e;return(0,Id.jsx)(wC,{...i,"aria-describedby":n,"aria-label":r,"aria-hidden":!1,ref:t,tabIndex:0,type:"range",value:o})}));function BC(e){const{className:t,isFilled:n=!1,label:r,style:o={},...i}=e,s=(0,Vy.A)("components-range-control__mark",n&&"is-filled",t),a=(0,Vy.A)("components-range-control__mark-label",n&&"is-filled");return(0,Id.jsxs)(Id.Fragment,{children:[(0,Id.jsx)(mC,{...i,"aria-hidden":"true",className:s,isFilled:n,style:o}),r&&(0,Id.jsx)(bC,{"aria-hidden":"true",className:a,isFilled:n,style:o,children:r})]})}function RC(e){const{disabled:t=!1,marks:n=!1,min:r=0,max:o=100,step:i=1,value:s=0,...a}=e;return(0,Id.jsxs)(Id.Fragment,{children:[(0,Id.jsx)(uC,{disabled:t,...a}),n&&(0,Id.jsx)(NC,{disabled:t,marks:n,min:r,max:o,step:i,value:s})]})}function NC(e){const{disabled:t=!1,marks:n=!1,min:r=0,max:o=100,step:i=1,value:s=0}=e,a=function({marks:e,min:t=0,max:n=100,step:r=1,value:o=0}){if(!e)return[];const i=n-t;if(!Array.isArray(e)){e=[];const n=1+Math.round(i/r);for(;n>e.push({value:r*e.length+t}););}const s=[];return e.forEach(((e,r)=>{if(e.valuen)return;const a=`mark-${r}`,l=e.value<=o,c=(e.value-t)/i*100+"%",u={[(0,U.isRTL)()?"right":"left"]:c};s.push({...e,isFilled:l,key:a,style:u})})),s}({marks:n,min:r,max:o,step:"any"===i?1:i,value:s});return(0,Id.jsx)(pC,{"aria-hidden":"true",className:"components-range-control__marks",children:a.map((e=>(0,k.createElement)(BC,{...e,key:e.key,"aria-hidden":"true",disabled:t})))})}function DC(e){const{className:t,inputRef:n,tooltipPosition:r,show:o=!1,style:i={},value:s=0,renderTooltipContent:a=(e=>e),zIndex:l=100,...c}=e,u=function({inputRef:e,tooltipPosition:t}){const[n,r]=(0,k.useState)(),o=(0,k.useCallback)((()=>{e&&e.current&&r(t)}),[t,e]);return(0,k.useEffect)((()=>{o()}),[o]),(0,k.useEffect)((()=>(window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o)}))),n}({inputRef:n,tooltipPosition:r}),d=(0,Vy.A)("components-simple-tooltip",t),h={...i,zIndex:l};return(0,Id.jsx)(EC,{...c,"aria-hidden":o,className:d,position:u,show:o,role:"tooltip",style:h,children:a(s)})}const MC=()=>{},PC=(0,k.forwardRef)((function e(t,n){const{__nextHasNoMarginBottom:r=!1,afterIcon:o,allowReset:i=!1,beforeIcon:s,className:a,color:l=W_.l.theme.accent,currentInput:c,disabled:u=!1,help:d,hideLabelFromVision:h=!1,initialPosition:p,isShiftStepEnabled:f=!0,label:m,marks:g=!1,max:b=100,min:v=0,onBlur:y=MC,onChange:_=MC,onFocus:x=MC,onMouseLeave:w=MC,onMouseMove:C=MC,railColor:S,renderTooltipContent:A=(e=>e),resetFallbackValue:E,__next40pxDefaultSize:I=!1,shiftStep:j=10,showTooltip:T,step:B=1,trackColor:R,value:N,withInputField:D=!0,...M}=t,[P,O]=function(e){const{min:t,max:n,value:r,initial:o}=e,[i,s]=(0,tk.A)(eC(r,t,n),{initial:eC(null!=o?o:null,t,n),fallback:null});return[i,(0,k.useCallback)((e=>{s(null===e?null:eC(e,t,n))}),[t,n,s])]}({min:v,max:b,value:null!=N?N:null,initial:p}),L=(0,k.useRef)(!1);let F=T,z=D;"any"===B&&(F=!1,z=!1);const[V,H]=(0,k.useState)(F),[$,W]=(0,k.useState)(!1),G=(0,k.useRef)(),q=G.current?.matches(":focus"),K=!u&&$,Y=null===P,J=Y?"":void 0!==P?P:c,X=Y?(b-v)/2+v:P,Z=Y?50:(P-v)/(b-v)*100,Q=`${(0,Qk.qE)(Z,0,100)}%`,ee=(0,Vy.A)("components-range-control",a),te=(0,Vy.A)("components-range-control__wrapper",!!g&&"is-marked"),ne=(0,L_.A)(e,"inspector-range-control"),re=d?`${ne}__help`:void 0,oe=!1!==F&&Number.isFinite(P),ie=()=>{let e=parseFloat(`${E}`),t=e;isNaN(e)&&(e=null,t=void 0),O(e),_(t)},se={[(0,U.isRTL)()?"right":"left"]:Q};return(0,Id.jsx)(V_.Ay,{__nextHasNoMarginBottom:r,className:ee,label:m,hideLabelFromVision:h,id:`${ne}`,help:d,children:(0,Id.jsxs)(rC,{className:"components-range-control__root",__next40pxDefaultSize:I,children:[s&&(0,Id.jsx)(aC,{children:(0,Id.jsx)(Fx.A,{icon:s})}),(0,Id.jsxs)(sC,{__nextHasNoMarginBottom:r,className:te,color:l,marks:!!g,children:[(0,Id.jsx)(TC,{...M,className:"components-range-control__slider",describedBy:re,disabled:u,id:`${ne}`,label:m,max:b,min:v,onBlur:e=>{y(e),W(!1),H(!1)},onChange:e=>{const t=parseFloat(e.target.value);O(t),_(t)},onFocus:e=>{x(e),W(!0),H(!0)},onMouseMove:C,onMouseLeave:w,ref:(0,Zk.A)([G,n]),step:B,value:null!=J?J:void 0}),(0,Id.jsx)(RC,{"aria-hidden":!0,disabled:u,marks:g,max:b,min:v,railColor:S,step:B,value:X}),(0,Id.jsx)(hC,{"aria-hidden":!0,className:"components-range-control__track",disabled:u,style:{width:Q},trackColor:R}),(0,Id.jsx)(yC,{className:"components-range-control__thumb-wrapper",style:se,disabled:u,children:(0,Id.jsx)(xC,{"aria-hidden":!0,isFocused:K,disabled:u})}),oe&&(0,Id.jsx)(DC,{className:"components-range-control__tooltip",inputRef:G,tooltipPosition:"bottom",renderTooltipContent:A,show:q||V,style:se,value:P})]}),o&&(0,Id.jsx)(lC,{children:(0,Id.jsx)(Fx.A,{icon:o})}),z&&(0,Id.jsx)(IC,{"aria-label":m,className:"components-range-control__number",disabled:u,inputMode:"decimal",isShiftStepEnabled:f,max:b,min:v,onBlur:()=>{L.current&&(ie(),L.current=!1)},onChange:e=>{let t=parseFloat(e);O(t),isNaN(t)?i&&(L.current=!0):((tb)&&(t=eC(t,v,b)),_(t),L.current=!1)},shiftStep:j,size:I?"__unstable-large":"default",__unstableInputWidth:I?(0,Kw.x)(20):(0,Kw.x)(16),step:B,value:J}),i&&(0,Id.jsx)(jC,{children:(0,Id.jsx)(Jy.Ay,{className:"components-range-control__reset",disabled:u||void 0===P,variant:"secondary",size:"small",onClick:ie,children:(0,U.__)("Reset")})})]})})})),OC=PC,LC=(0,k.forwardRef)((function(e,t){const{label:n,...r}=e,o=r["aria-label"]||n;return(0,Id.jsx)(Lx,{...r,"aria-label":o,ref:t,children:n})}));var FC=n(93982),zC=n(59880);const UC=(0,k.createContext)({refsMap:(0,zC.u)()});function VC({children:e}){const t=(0,k.useMemo)((()=>({refsMap:(0,zC.u)()})),[]);return(0,Id.jsx)(UC.Provider,{value:t,children:e})}function HC(e){const{refsMap:t}=(0,k.useContext)(UC);return(0,FC.A)((n=>(t.set(e,n),()=>t.delete(e))),[e])}function $C(e){const{refsMap:t}=(0,k.useContext)(UC),n=(0,k.useRef)();return n.current=e,(0,k.useMemo)((()=>({get current(){var e;return null!==(e=t.get(n.current))&&void 0!==e?e:null}})),[t])}function WC(e){var t;const{refsMap:n}=(0,k.useContext)(UC);return null!==(t=(0,u_.A)(n,e))&&void 0!==t?t:null}var GC=n(15915);const qC=function(e){return(0,FC.A)((t=>{if(!e)return;function n(t){const{deltaX:n,deltaY:r}=t;e.current.scrollBy(n,r)}const r={passive:!0};return t.addEventListener("wheel",n,r),()=>{t.removeEventListener("wheel",n,r)}}),[e])},KC=Number.MAX_SAFE_INTEGER,YC=(0,k.forwardRef)((function({clientId:e,bottomClientId:t,children:n,__unstablePopoverSlot:r,__unstableContentRef:o,shift:i=!0,...s},a){const l=WC(e),c=WC(null!=t?t:e),u=(0,Zk.A)([a,qC(o)]),[d,h]=(0,k.useReducer)((e=>(e+1)%KC),0);(0,k.useLayoutEffect)((()=>{if(!l)return;const e=new window.MutationObserver(h);return e.observe(l,{attributes:!0}),()=>{e.disconnect()}}),[l]);const p=(0,k.useMemo)((()=>{if(!(d<0||!l||t&&!c))return{getBoundingClientRect(){var e,t,n,r;const o=l.getBoundingClientRect(),i=c?.getBoundingClientRect(),s=Math.min(o.left,null!==(e=i?.left)&&void 0!==e?e:1/0),a=Math.min(o.top,null!==(t=i?.top)&&void 0!==t?t:1/0),u=Math.max(o.right,null!==(n=i.right)&&void 0!==n?n:-1/0)-s,d=Math.max(o.bottom,null!==(r=i.bottom)&&void 0!==r?r:-1/0)-a;return new window.DOMRect(s,a,u,d)},contextElement:l}}),[t,c,l,d]);return!l||t&&!c?null:(0,Id.jsx)(GC.Ay,{ref:u,animate:!1,focusOnMount:!1,anchor:p,__unstableSlotName:r,inline:!r,placement:"top-start",resize:!1,flip:!1,shift:i,...s,className:(0,Vy.A)("block-editor-block-popover",s.className),variant:"unstyled",children:n})})),JC=(0,k.forwardRef)((({clientId:e,bottomClientId:t,children:n,...r},o)=>(0,Id.jsx)(YC,{...r,bottomClientId:t,clientId:e,__unstableContentRef:void 0,__unstablePopoverSlot:void 0,ref:o,children:n})));function XC({selectedElement:e,additionalStyles:t={},children:n}){const[r,o]=(0,k.useState)(e.offsetWidth),[i,s]=(0,k.useState)(e.offsetHeight);(0,k.useEffect)((()=>{const t=new window.ResizeObserver((()=>{o(e.offsetWidth),s(e.offsetHeight)}));return t.observe(e,{box:"border-box"}),()=>t.disconnect()}),[e]);const a=(0,k.useMemo)((()=>({position:"absolute",width:r,height:i,...t})),[r,i,t]);return(0,Id.jsx)("div",{style:a,children:n})}const ZC=(0,k.forwardRef)((function({clientId:e,bottomClientId:t,children:n,shift:r=!1,additionalStyles:o,...i},s){var a;null!==(a=t)&&void 0!==a||(t=e);const l=WC(e);return(0,Id.jsx)(YC,{ref:s,clientId:e,bottomClientId:t,shift:r,...i,children:l&&e===t?(0,Id.jsx)(XC,{selectedElement:l,additionalStyles:o,children:n}):n})}));function QC(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function eS({clientId:e,contentRef:t}){const n=(0,Fl.A)((e=>e(uy).getSettings().isDistractionFree),[]),r=WC(e);return n||!r?null:(0,Id.jsx)(ZC,{className:"block-editor-grid-visualizer",clientId:e,__unstablePopoverSlot:"block-toolbar",children:(0,Id.jsx)(tS,{ref:t,blockElement:r})})}const tS=(0,k.forwardRef)((({blockElement:e},t)=>{const[n,r]=(0,k.useState)((()=>nS(e)));return(0,k.useEffect)((()=>{const t=[];for(const n of[e,...e.children]){const o=new window.ResizeObserver((()=>{r(nS(e))}));o.observe(n),t.push(o)}return()=>{for(const e of t)e.disconnect()}}),[e]),(0,Id.jsx)("div",{ref:t,className:"block-editor-grid-visualizer__grid",style:n.style,children:Array.from({length:n.numItems},((e,t)=>(0,Id.jsx)("div",{className:"block-editor-grid-visualizer__item",style:{boxShadow:`inset 0 0 0 1px color-mix(in srgb, ${n.currentColor} 20%, #0000)`}},t)))})}));function nS(e){const t=QC(e,"grid-template-columns"),n=QC(e,"grid-template-rows");return{numItems:t.split(" ").length*n.split(" ").length,currentColor:QC(e,"color"),style:{gridTemplateColumns:t,gridTemplateRows:n,gap:QC(e,"gap"),padding:QC(e,"padding")}}}const rS={px:600,"%":100,vw:100,vh:100,em:38,rem:38,svw:100,lvw:100,dvw:100,svh:100,lvh:100,dvh:100,vi:100,svi:100,lvi:100,dvi:100,vb:100,svb:100,lvb:100,dvb:100,vmin:100,svmin:100,lvmin:100,dvmin:100,vmax:100,svmax:100,lvmax:100,dvmax:100},oS=[{value:"px",label:"px",default:0},{value:"rem",label:"rem",default:0},{value:"em",label:"em",default:0}],iS={name:"grid",label:(0,U.__)("Grid"),inspectorControls:function({layout:e={},onChange:t,layoutBlockSupport:n={}}){const{allowSizingOnChildren:r=!1}=n;return(0,Id.jsxs)(Id.Fragment,{children:[(0,Id.jsx)(lS,{layout:e,onChange:t}),e?.columnCount?(0,Id.jsx)(aS,{layout:e,onChange:t,allowSizingOnChildren:r}):(0,Id.jsx)(sS,{layout:e,onChange:t})]})},toolBarControls:function({clientId:e}){return(0,Id.jsx)(eS,{clientId:e})},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:r,hasBlockGapSupport:o,layoutDefinitions:i=Vx}){const{minimumColumnWidth:s="12rem",columnCount:a=null,rowCount:l=null}=t,c=n?.spacing?.blockGap&&!Wy(r,"spacing","blockGap")?uw(n?.spacing?.blockGap,"0.5em"):void 0;let u="";const d=[];return a?(d.push(`grid-template-columns: repeat(${a}, minmax(0, 1fr))`),l&&d.push(`grid-template-rows: repeat(${l}, minmax(0, 1fr))`)):s&&d.push(`grid-template-columns: repeat(auto-fill, minmax(min(${s}, 100%), 1fr))`,"container-type: inline-size"),d.length&&(u=`${Hx(e)} { ${d.join("; ")}; }`),o&&c&&(u+=$x(e,i,"grid",c)),u},getOrientation:()=>"horizontal",getAlignments:()=>[]};function sS({layout:e,onChange:t}){const{minimumColumnWidth:n="12rem"}=e,[r,o]=Hw(n);return(0,Id.jsxs)("fieldset",{children:[(0,Id.jsx)(V_.Ay.VisualLabel,{as:"legend",children:(0,U.__)("Minimum column width")}),(0,Id.jsxs)(j_.A,{gap:4,children:[(0,Id.jsx)(T_.A,{isBlock:!0,children:(0,Id.jsx)(ik,{size:"__unstable-large",onChange:n=>{t({...e,minimumColumnWidth:n})},onUnitChange:n=>{let i;["em","rem"].includes(n)&&"px"===o?i=(r/16).toFixed(2)+n:["em","rem"].includes(o)&&"px"===n&&(i=Math.round(16*r)+n),t({...e,minimumColumnWidth:i})},value:n,units:oS,min:0,label:(0,U.__)("Minimum column width"),hideLabelFromVision:!0})}),(0,Id.jsx)(T_.A,{isBlock:!0,children:(0,Id.jsx)(OC,{onChange:n=>{t({...e,minimumColumnWidth:[n,o].join("")})},value:r,min:0,max:rS[o]||600,withInputField:!1,label:(0,U.__)("Minimum column width"),hideLabelFromVision:!0})})]})]})}function aS({layout:e,onChange:t,allowSizingOnChildren:n}){const{columnCount:r=3,rowCount:o}=e;return(0,Id.jsxs)(Id.Fragment,{children:[(0,Id.jsxs)("fieldset",{children:[(0,Id.jsx)(V_.Ay.VisualLabel,{as:"legend",children:(0,U.__)("Columns")}),(0,Id.jsxs)(j_.A,{gap:4,children:[(0,Id.jsx)(T_.A,{isBlock:!0,children:(0,Id.jsx)(Gw.A,{size:"__unstable-large",onChange:n=>{const r=""!==n?n:"1";t({...e,columnCount:r})},value:r,min:1,label:(0,U.__)("Columns"),hideLabelFromVision:!0})}),(0,Id.jsx)(T_.A,{isBlock:!0,children:(0,Id.jsx)(OC,{value:parseInt(r,10),onChange:n=>t({...e,columnCount:n}),min:1,max:16,withInputField:!1,label:(0,U.__)("Columns"),hideLabelFromVision:!0})})]})]}),n&&window.__experimentalEnableGridInteractivity&&(0,Id.jsxs)("fieldset",{children:[(0,Id.jsx)(V_.Ay.VisualLabel,{as:"legend",children:(0,U.__)("Rows")}),(0,Id.jsxs)(j_.A,{gap:4,children:[(0,Id.jsx)(T_.A,{isBlock:!0,children:(0,Id.jsx)(Gw.A,{size:"__unstable-large",onChange:n=>{t({...e,rowCount:n})},value:o,min:1,label:(0,U.__)("Rows"),hideLabelFromVision:!0})}),(0,Id.jsx)(T_.A,{isBlock:!0,children:(0,Id.jsx)(OC,{value:parseInt(o,10),onChange:n=>t({...e,rowCount:n}),min:1,max:16,withInputField:!1,label:(0,U.__)("Rows"),hideLabelFromVision:!0})})]})]})]})}function lS({layout:e,onChange:t}){const{columnCount:n,minimumColumnWidth:r}=e,[o,i]=(0,k.useState)(n||3),[s,a]=(0,k.useState)(r||"12rem"),l=n?"manual":"auto";return(0,Id.jsxs)(_x,{__nextHasNoMarginBottom:!0,label:(0,U.__)("Type"),value:l,onChange:l=>{"manual"===l?a(r||"12rem"):i(n||3),t({...e,columnCount:"manual"===l?o:null,minimumColumnWidth:"auto"===l?s:null})},isBlock:!0,children:[(0,Id.jsx)(LC,{value:"auto",label:(0,U.__)("Auto")},"auto"),(0,Id.jsx)(LC,{value:"manual",label:(0,U.__)("Manual")},"manual")]})}const cS=[Mw,jw,Xk,iS];function uS(e="default"){return cS.find((t=>t.name===e))}const dS={type:"default"},hS=(0,k.createContext)(dS),pS=hS.Provider;function fS(){return(0,k.useContext)(hS)}const mS=[],gS=["none","left","center","right","wide","full"],bS=["wide","full"];function vS(e=gS){e.includes("none")||(e=["none",...e]);const t=1===e.length&&"none"===e[0],[n,r,o]=(0,Fl.A)((e=>{var n;if(t)return[!1,!1,!1];const r=e(uy).getSettings();return[null!==(n=r.alignWide)&&void 0!==n&&n,r.supportsLayout,r.__unstableIsBlockBasedTheme]}),[t]),i=fS();if(t)return mS;const s=uS(i?.type);if(r){const t=s.getAlignments(i,o).filter((t=>e.includes(t.name)));return 1===t.length&&"none"===t[0].name?mS:t}if("default"!==s.name&&"constrained"!==s.name)return mS;const a=e.filter((e=>i.alignments?i.alignments.includes(e):!(!n&&bS.includes(e))&&gS.includes(e))).map((e=>({name:e})));return 1===a.length&&"none"===a[0].name?mS:a}var yS=n(8336),_S=n(66867),xS=n(88282),wS=n(84122);const kS={none:{icon:yS.A,title:(0,U._x)("None","Alignment option")},left:{icon:_S.A,title:(0,U.__)("Align left")},center:{icon:ak.A,title:(0,U.__)("Align center")},right:{icon:xS.A,title:(0,U.__)("Align right")},wide:{icon:lk.A,title:(0,U.__)("Wide width")},full:{icon:wS.A,title:(0,U.__)("Full width")}},CS=function({value:e,onChange:t,controls:n,isToolbar:r,isCollapsed:o=!0}){const i=vS(n);if(!i.length)return null;function s(n){t([e,"none"].includes(n)?void 0:n)}const a=kS[e],l=kS.none,c=r?i_:y_,u={icon:a?a.icon:l.icon,label:(0,U.__)("Align")},d=r?{isCollapsed:o,controls:i.map((({name:t})=>({...kS[t],isActive:e===t||!e&&"none"===t,role:o?"menuitemradio":void 0,onClick:()=>s(t)})))}:{toggleProps:{describedBy:(0,U.__)("Change alignment")},children:({onClose:t})=>(0,Id.jsx)(Id.Fragment,{children:(0,Id.jsx)(__.A,{className:"block-editor-block-alignment-control__menu-group",children:i.map((({name:n,info:r})=>{const{icon:o,title:i}=kS[n],a=n===e||!e&&"none"===n;return(0,Id.jsx)(x_.A,{icon:o,iconPosition:"left",className:(0,Vy.A)("components-dropdown-menu__menu-item",{"is-active":a}),isSelected:a,onClick:()=>{s(n),t()},role:"menuitemradio",info:r,children:i},n)}))})})};return(0,Id.jsx)(c,{...u,...d})},SS=e=>(0,Id.jsx)(CS,{...e,isToolbar:!1});function AS(e){const t=Xp(),{clientId:n=""}=t,{setBlockEditingMode:r,unsetBlockEditingMode:o}=(0,zl.A)(uy),i=(0,Fl.A)((e=>n?null:e(uy).getBlockEditingMode()),[n]);return(0,k.useEffect)((()=>(e&&r(n,e),()=>{e&&o(n)})),[n,e,r,o]),n?t[Wp]:i}const ES=["left","center","right","wide","full"],IS=["wide","full"];function jS(e,t=!0,n=!0){let r;return r=Array.isArray(e)?ES.filter((t=>e.includes(t))):!0===e?[...ES]:[],!n||!0===e&&!t?r.filter((e=>!IS.includes(e))):r}const TS={shareWithChildBlocks:!0,edit:function({name:e,align:t,setAttributes:n}){const r=vS(jS(Sc(e,"align"),Ac(e,"alignWide",!0))).map((({name:e})=>e)),o=AS();return r.length&&"default"===o?(0,Id.jsx)(v_,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,Id.jsx)(SS,{value:t,onChange:t=>{if(!t){const n=kc(e),r=n?.attributes?.align?.default;r&&(t="")}n({align:t})},controls:r})}):null},useBlockProps:function({name:e,align:t}){return vS(jS(Sc(e,"align"),Ac(e,"alignWide",!0))).some((e=>e.name===t))?{"data-align":t}:{}},addSaveProps:function(e,t,n){const{align:r}=n;return jS(Sc(t,"align"),Ac(t,"alignWide",!0)).includes(r)&&(e.className=(0,Vy.A)(`align${r}`,e.className)),e},attributeKeys:["align"],hasSupport:e=>Ac(e,"align",!1)};(0,Iu.addFilter)("blocks.registerBlockType","core/editor/align/addAttribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.align)&&void 0!==t?t:{})||Ac(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...ES,""]}}),e}));const BS=()=>{},RS=(0,k.createContext)({menuItems:{default:{},optional:{}},hasMenuItems:!1,isResetting:!1,shouldRenderPlaceholderItems:!1,registerPanelItem:BS,deregisterPanelItem:BS,flagItemCustomization:BS,registerResetAllFilter:BS,deregisterResetAllFilter:BS,areAllOptionalControlsHidden:!0}),NS=()=>(0,k.useContext)(RS),DS=(0,Ul.QJ)("InspectorControls"),MS=(0,Ul.QJ)("InspectorAdvancedControls"),PS=(0,Ul.QJ)("InspectorControlsBackground"),OS=(0,Ul.QJ)("InspectorControlsBorder"),LS=(0,Ul.QJ)("InspectorControlsColor"),FS=(0,Ul.QJ)("InspectorControlsFilter"),zS=(0,Ul.QJ)("InspectorControlsDimensions"),US=(0,Ul.QJ)("InspectorControlsPosition"),VS=(0,Ul.QJ)("InspectorControlsTypography"),HS=(0,Ul.QJ)("InspectorControlsListView"),$S=(0,Ul.QJ)("InspectorControlsStyles"),WS={default:DS,advanced:MS,background:PS,border:OS,color:LS,dimensions:zS,effects:(0,Ul.QJ)("InspectorControlsEffects"),filter:FS,list:HS,position:US,settings:DS,styles:$S,typography:VS};function GS({children:e,group:t="default",__experimentalGroup:n,resetAllFilter:r}){n&&((0,W.default)("`__experimentalGroup` property in `InspectorControlsFill`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=n);const o=Xp(),i=WS[t]?.Fill;return i?o[Hp]?(0,Id.jsx)(s_.A,{document,children:(0,Id.jsx)(i,{children:t=>(0,Id.jsx)(KS,{fillProps:t,children:e,resetAllFilter:r})})}):null:(!0===globalThis.SCRIPT_DEBUG&&(0,p_.default)(`Unknown InspectorControls group "${t}" provided.`),null)}function qS({resetAllFilter:e,children:t}){const{registerResetAllFilter:n,deregisterResetAllFilter:r}=(0,k.useContext)(RS);return(0,k.useEffect)((()=>{if(e&&n&&r)return n(e),()=>{r(e)}}),[e,n,r]),t}function KS({children:e,resetAllFilter:t,fillProps:n}){const{forwardedContext:r=[]}=n,o=(0,Id.jsx)(qS,{resetAllFilter:t,children:e});return r.reduce(((e,[t,n])=>(0,Id.jsx)(t,{...n,children:e})),o)}var YS=n(97091),JS=n(39528),XS=n(48410),ZS=n(52710),QS=n(56886),eA=n(82021),tA=n(54894);const nA={columns:e=>(0,$_.css)("grid-template-columns:",`repeat( ${e}, minmax(0, 1fr) )`,";",""),spacing:(0,$_.css)("column-gap:",(0,Kw.x)(2),";row-gap:",(0,Kw.x)(4),";",""),item:{fullWidth:{name:"18iuzk9",styles:"grid-column:1/-1"}}},rA={name:"huufmu",styles:">div:not( :first-of-type ){display:none;}"},oA=(0,$_.css)(nA.item.fullWidth," gap:",(0,Kw.x)(2),";.components-dropdown-menu{margin:",(0,Kw.x)(-1)," 0;line-height:0;}&&&& .components-dropdown-menu__toggle{padding:0;min-width:",(0,Kw.x)(6),";}",""),iA={name:"1pmxm02",styles:"font-size:inherit;font-weight:500;line-height:normal;&&{margin:0;}"},sA=(0,$_.css)(nA.item.fullWidth,"&>div,&>fieldset{padding-bottom:0;margin-bottom:0;max-width:100%;}&& ",tA.mO,"{margin-bottom:0;",tA.mh,":last-child{margin-bottom:0;}}",tA.te,"{margin-bottom:0;}&& ",qw.cR,"{label{line-height:1.4em;}}",""),aA={name:"eivff4",styles:"display:none"},lA={name:"16gsvie",styles:"min-width:200px"},cA=(0,H_.default)("span",{target:"ews648u0"})("color:",W_.l.theme.accentDarker10,";font-size:11px;font-weight:500;line-height:1.4;",(0,Ww.h)({marginLeft:(0,Kw.x)(3)})," text-transform:uppercase;"),uA=(0,$_.css)("color:",W_.l.gray[900],";&&[aria-disabled='true']{color:",W_.l.gray[700],";opacity:1;&:hover{color:",W_.l.gray[700],";}",cA,"{opacity:0.3;}}",""),dA=({itemClassName:e,items:t,toggleItem:n})=>{if(!t.length)return null;const r=(0,Id.jsx)(cA,{"aria-hidden":!0,children:(0,U.__)("Reset")});return(0,Id.jsx)(Id.Fragment,{children:t.map((([t,o])=>o?(0,Id.jsx)(x_.A,{className:e,role:"menuitem",label:(0,U.sprintf)((0,U.__)("Reset %s"),t),onClick:()=>{n(t),(0,Kb.speak)((0,U.sprintf)((0,U.__)("%s reset to default"),t),"assertive")},suffix:r,children:t},t):(0,Id.jsx)(x_.A,{icon:JS.A,className:e,role:"menuitemcheckbox",isSelected:!0,"aria-disabled":!0,children:t},t)))})},hA=({items:e,toggleItem:t})=>e.length?(0,Id.jsx)(Id.Fragment,{children:e.map((([e,n])=>{const r=n?(0,U.sprintf)((0,U.__)("Hide and reset %s"),e):(0,U.sprintf)((0,U.__)("Show %s"),e);return(0,Id.jsx)(x_.A,{icon:n?JS.A:null,isSelected:n,label:r,onClick:()=>{n?(0,Kb.speak)((0,U.sprintf)((0,U.__)("%s hidden and reset to default"),e),"assertive"):(0,Kb.speak)((0,U.sprintf)((0,U.__)("%s is now visible"),e),"assertive"),t(e)},role:"menuitemcheckbox",children:e},e)}))}):null,pA=(0,z_.KZ)(((e,t)=>{const{areAllOptionalControlsHidden:n,defaultControlsItemClassName:r,dropdownMenuClassName:o,hasMenuItems:i,headingClassName:s,headingLevel:a=2,label:l,menuItems:c,resetAll:u,toggleItem:d,dropdownMenuProps:h,...p}=function(e){const{className:t,headingLevel:n=2,...r}=(0,F_.A)(e,"ToolsPanelHeader"),o=(0,U_.l)(),i=(0,k.useMemo)((()=>o(oA,t)),[t,o]),s=(0,k.useMemo)((()=>o(lA)),[o]),a=(0,k.useMemo)((()=>o(iA)),[o]),l=(0,k.useMemo)((()=>o(uA)),[o]),{menuItems:c,hasMenuItems:u,areAllOptionalControlsHidden:d}=NS();return{...r,areAllOptionalControlsHidden:d,defaultControlsItemClassName:l,dropdownMenuClassName:s,hasMenuItems:u,headingClassName:a,headingLevel:n,menuItems:c,className:i}}(e);if(!l)return null;const f=Object.entries(c?.default||{}),m=Object.entries(c?.optional||{}),g=n?XS.A:ZS.A,b=(0,U.sprintf)((0,U._x)("%s options","Button label to reveal tool panel options"),l),v=n?(0,U.__)("All options are currently hidden"):void 0,y=[...f,...m].some((([,e])=>e));return(0,Id.jsxs)(QS.A,{...p,ref:t,children:[(0,Id.jsx)(eA.A,{level:a,className:s,children:l}),i&&(0,Id.jsx)(r_.A,{...h,icon:g,label:b,menuProps:{className:o},toggleProps:{size:"small",describedBy:v},children:()=>(0,Id.jsxs)(Id.Fragment,{children:[(0,Id.jsxs)(__.A,{label:l,children:[(0,Id.jsx)(dA,{items:f,toggleItem:d,itemClassName:r}),(0,Id.jsx)(hA,{items:m,toggleItem:d})]}),(0,Id.jsx)(__.A,{children:(0,Id.jsx)(x_.A,{"aria-disabled":!y,variant:"tertiary",onClick:()=>{y&&(u(),(0,Kb.speak)((0,U.__)("All options reset"),"assertive"))},children:(0,U.__)("Reset all")})})]})})]})}),"ToolsPanelHeader"),fA=({panelItems:e,shouldReset:t,currentMenuItems:n,menuItemOrder:r})=>{const o={default:{},optional:{}},i={default:{},optional:{}};return e.forEach((({hasValue:e,isShownByDefault:r,label:i})=>{const s=r?"default":"optional",a=n?.[s]?.[i],l=a||e();o[s][i]=!t&&l})),r.forEach((e=>{o.default.hasOwnProperty(e)&&(i.default[e]=o.default[e]),o.optional.hasOwnProperty(e)&&(i.optional[e]=o.optional[e])})),Object.keys(o.default).forEach((e=>{i.default.hasOwnProperty(e)||(i.default[e]=o.default[e])})),Object.keys(o.optional).forEach((e=>{i.optional.hasOwnProperty(e)||(i.optional[e]=o.optional[e])})),i},mA=e=>e&&0===Object.keys(e).length;const gA={bottom:{alignItems:"flex-end",justifyContent:"center"},bottomLeft:{alignItems:"flex-start",justifyContent:"flex-end"},bottomRight:{alignItems:"flex-end",justifyContent:"flex-end"},center:{alignItems:"center",justifyContent:"center"},spaced:{alignItems:"center",justifyContent:"space-between"},left:{alignItems:"center",justifyContent:"flex-start"},right:{alignItems:"center",justifyContent:"flex-end"},stretch:{alignItems:"stretch"},top:{alignItems:"flex-start",justifyContent:"center"},topLeft:{alignItems:"flex-start",justifyContent:"flex-start"},topRight:{alignItems:"flex-start",justifyContent:"flex-end"}};var bA=n(17849);const vA=(0,z_.KZ)((function(e,t){const n=function(e){const{align:t,alignment:n,className:r,columnGap:o,columns:i=2,gap:s=3,isInline:a=!1,justify:l,rowGap:c,rows:u,templateColumns:d,templateRows:h,...p}=(0,F_.A)(e,"Grid"),f=Array.isArray(i)?i:[i],m=(0,bA.t)(f),g=Array.isArray(u)?u:[u],b=(0,bA.t)(g),v=d||!!i&&`repeat( ${m}, 1fr )`,y=h||!!u&&`repeat( ${b}, 1fr )`,_=(0,U_.l)();return{...p,className:(0,k.useMemo)((()=>{const e=function(e){return e?gA[e]:{}}(n),i=(0,$_.css)({alignItems:t,display:a?"inline-grid":"grid",gap:`calc( ${G_.A.gridBase} * ${s} )`,gridTemplateColumns:v||void 0,gridTemplateRows:y||void 0,gridRowGap:c,gridColumnGap:o,justifyContent:l,verticalAlign:a?"middle":void 0,...e},"","");return _(i,r)}),[t,n,r,o,_,s,v,y,a,l,c])}}(e);return(0,Id.jsx)(dx.A,{...n,ref:t})}),"Grid"),yA=(0,z_.KZ)(((e,t)=>{const{children:n,label:r,panelContext:o,resetAllItems:i,toggleItem:s,headingLevel:a,dropdownMenuProps:l,...c}=function(e){const{className:t,headingLevel:n=2,resetAll:r,panelId:o,hasInnerWrapper:i=!1,shouldRenderPlaceholderItems:s=!1,__experimentalFirstVisibleItemClass:a,__experimentalLastVisibleItemClass:l,...c}=(0,F_.A)(e,"ToolsPanel"),u=(0,k.useRef)(!1),d=u.current;(0,k.useEffect)((()=>{d&&(u.current=!1)}),[d]);const[h,p]=(0,k.useState)([]),[f,m]=(0,k.useState)([]),[g,b]=(0,k.useState)([]),v=(0,k.useCallback)((e=>{p((t=>{const n=[...t],r=n.findIndex((t=>t.label===e.label));return-1!==r&&n.splice(r,1),[...n,e]})),m((t=>t.includes(e.label)?t:[...t,e.label]))}),[p,m]),y=(0,k.useCallback)((e=>{p((t=>{const n=[...t],r=n.findIndex((t=>t.label===e));return-1!==r&&n.splice(r,1),n}))}),[p]),_=(0,k.useCallback)((e=>{b((t=>[...t,e]))}),[b]),x=(0,k.useCallback)((e=>{b((t=>t.filter((t=>t!==e))))}),[b]),[w,C]=(0,k.useState)({default:{},optional:{}});(0,k.useEffect)((()=>{C((e=>fA({panelItems:h,shouldReset:!1,currentMenuItems:e,menuItemOrder:f})))}),[h,C,f]);const S=(0,k.useCallback)(((e,t,n="default")=>{C((r=>({...r,[n]:{...r[n],[t]:e}})))}),[C]),[A,E]=(0,k.useState)(!1);(0,k.useEffect)((()=>{if(mA(w?.default)&&!mA(w?.optional)){const e=!Object.entries(w.optional).some((([,e])=>e));E(e)}}),[w,E]);const I=(0,U_.l)(),j=(0,k.useMemo)((()=>{const e=i&&(0,$_.css)(">div:not( :first-of-type ){display:grid;",nA.columns(2)," ",nA.spacing," ",nA.item.fullWidth,";}",""),n=mA(w?.default)&&A&&rA;return I((0,$_.css)(nA.columns(2)," ",nA.spacing," border-top:",G_.A.borderWidth," solid ",W_.l.gray[300],";margin-top:-1px;padding:",(0,Kw.x)(4),";",""),e,n,t)}),[A,t,I,i,w]),T=(0,k.useCallback)((e=>{const t=h.find((t=>t.label===e));if(!t)return;const n=t.isShownByDefault?"default":"optional",r={...w,[n]:{...w[n],[e]:!w[n][e]}};C(r)}),[w,h,C]),B=(0,k.useCallback)((()=>{"function"==typeof r&&(u.current=!0,r(g));const e=fA({panelItems:h,menuItemOrder:f,shouldReset:!0});C(e)}),[h,g,r,C,f]),R=e=>{const t=w.optional||{},n=e.find((e=>e.isShownByDefault||!!t[e.label]));return n?.label},N=R(h),D=R([...h].reverse());return{...c,headingLevel:n,panelContext:(0,k.useMemo)((()=>({areAllOptionalControlsHidden:A,deregisterPanelItem:y,deregisterResetAllFilter:x,firstDisplayedItem:N,flagItemCustomization:S,hasMenuItems:!!h.length,isResetting:u.current,lastDisplayedItem:D,menuItems:w,panelId:o,registerPanelItem:v,registerResetAllFilter:_,shouldRenderPlaceholderItems:s,__experimentalFirstVisibleItemClass:a,__experimentalLastVisibleItemClass:l})),[A,y,x,N,S,D,w,o,h,_,v,s,a,l]),resetAllItems:B,toggleItem:T,className:j}}(e);return(0,Id.jsx)(vA,{...c,columns:2,ref:t,children:(0,Id.jsxs)(RS.Provider,{value:o,children:[(0,Id.jsx)(pA,{label:r,resetAll:i,toggleItem:s,headingLevel:a,dropdownMenuProps:l}),n]})})}),"ToolsPanel"),_A=yA;function xA({children:e,group:t,label:n}){const{updateBlockAttributes:r}=(0,zl.A)(uy),{getBlockAttributes:o,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:s,hasMultiSelection:a}=(0,Fl.A)(uy),l=s(),c=(0,k.useCallback)(((e=[])=>{const t={},n=a()?i():[l];n.forEach((n=>{const{style:r}=o(n);let i={style:r};e.forEach((e=>{i={...i,...e(i)}})),i={...i,style:Hy(i.style)},t[n]=i})),r(n,t,!0)}),[o,i,a,l,r]);return(0,Id.jsx)(_A,{className:`${t}-block-support-panel`,label:n,resetAll:c,panelId:l,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:Ey,children:e},l)}function wA({Slot:e,fillProps:t,...n}){const r=(0,k.useContext)(RS),o=(0,k.useMemo)((()=>{var e;return{...null!=t?t:{},forwardedContext:[...null!==(e=t?.forwardedContext)&&void 0!==e?e:[],[RS.Provider,{value:r}]]}}),[r,t]);return(0,Id.jsx)(e,{...n,fillProps:o,bubblesVirtually:!0})}function kA({__experimentalGroup:e,group:t="default",label:n,fillProps:r,...o}){e&&((0,W.default)("`__experimentalGroup` property in `InspectorControlsSlot`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=e);const i=WS[t]?.Slot,s=h_(i?.__unstableName),a=(0,k.useContext)(YS.A),l=(0,k.useMemo)((()=>{var e;return{...null!=r?r:{},forwardedContext:[...null!==(e=r?.forwardedContext)&&void 0!==e?e:[],[YS.A.Provider,{value:a}]]}}),[a,r]);return i?s?.length?n?(0,Id.jsx)(xA,{group:t,label:n,children:(0,Id.jsx)(wA,{...o,fillProps:l,Slot:i})}):(0,Id.jsx)(i,{...o,fillProps:l,bubblesVirtually:!0}):null:(!0===globalThis.SCRIPT_DEBUG&&(0,p_.default)(`Unknown InspectorControls group "${t}" provided.`),null)}const CA=GS;CA.Slot=kA;const SA=e=>(0,Id.jsx)(GS,{...e,group:"advanced"});SA.Slot=e=>(0,Id.jsx)(kA,{...e,group:"advanced"}),SA.slotName="InspectorAdvancedControls";const AA=CA;var EA=n(34147);const IA={name:"1bcj5ek",styles:"width:100%;display:block"},jA={name:"150ruhm",styles:"box-sizing:border-box;width:100%;display:block;margin:0;color:inherit"},TA=(0,$_.css)("border:1px solid ",G_.A.surfaceBorderColor,";",""),BA=(0,$_.css)(">*:not( marquee )>*{border-bottom:1px solid ",G_.A.surfaceBorderColor,";}>*:last-of-type>*:not( :focus ){border-bottom-color:transparent;}",""),RA=G_.A.controlBorderRadius,NA=(0,$_.css)("border-radius:",RA,";",""),DA=(0,$_.css)("border-radius:",RA,";>*:first-of-type>*{border-top-left-radius:",RA,";border-top-right-radius:",RA,";}>*:last-of-type>*{border-bottom-left-radius:",RA,";border-bottom-right-radius:",RA,";}",""),MA=`calc(${G_.A.fontSize} * ${G_.A.fontLineHeightBase})`,PA=`calc((${G_.A.controlHeight} - ${MA} - 2px) / 2)`,OA=`calc((${G_.A.controlHeightSmall} - ${MA} - 2px) / 2)`,LA=`calc((${G_.A.controlHeightLarge} - ${MA} - 2px) / 2)`,FA={small:(0,$_.css)("padding:",OA," ",G_.A.controlPaddingXSmall,";",""),medium:(0,$_.css)("padding:",PA," ",G_.A.controlPaddingX,";",""),large:(0,$_.css)("padding:",LA," ",G_.A.controlPaddingXLarge,";","")},zA=(0,k.createContext)({size:"medium"}),UA=()=>(0,k.useContext)(zA),VA=(0,z_.KZ)((function(e,t){const{isBordered:n,isSeparated:r,size:o,...i}=function(e){const{className:t,isBordered:n=!1,isRounded:r=!0,isSeparated:o=!1,role:i="list",...s}=(0,F_.A)(e,"ItemGroup");return{isBordered:n,className:(0,U_.l)()(n&&TA,o&&BA,r&&DA,t),role:i,isSeparated:o,...s}}(e),{size:s}=UA(),a={spacedAround:!n&&!r,size:o||s};return(0,Id.jsx)(zA.Provider,{value:a,children:(0,Id.jsx)(dx.A,{...i,ref:t})})}),"ItemGroup");var HA=n(4545),$A=n(11508);const WA=()=>{},GA=(0,z_.KZ)(((e,t)=>{const{children:n,isShown:r,shouldRenderPlaceholder:o,...i}=function(e){const{className:t,hasValue:n,isShownByDefault:r=!1,label:o,panelId:i,resetAllFilter:s=WA,onDeselect:a,onSelect:l,...c}=(0,F_.A)(e,"ToolsPanelItem"),{panelId:u,menuItems:d,registerResetAllFilter:h,deregisterResetAllFilter:p,registerPanelItem:f,deregisterPanelItem:m,flagItemCustomization:g,isResetting:b,shouldRenderPlaceholderItems:v,firstDisplayedItem:y,lastDisplayedItem:_,__experimentalFirstVisibleItemClass:x,__experimentalLastVisibleItemClass:w}=NS(),C=(0,k.useCallback)(n,[i]),S=(0,k.useCallback)(s,[i]),A=(0,fx.A)(u),E=u===i||null===u;(0,k.useLayoutEffect)((()=>(E&&null!==A&&f({hasValue:C,isShownByDefault:r,label:o,panelId:i}),()=>{(null===A&&u||u===i)&&m(o)})),[u,E,r,o,C,i,A,f,m]),(0,k.useEffect)((()=>(E&&h(S),()=>{E&&p(S)})),[h,p,S,E]);const I=r?"default":"optional",j=d?.[I]?.[o],T=(0,fx.A)(j),B=void 0!==d?.[I]?.[o],R=n();(0,k.useEffect)((()=>{(r||R)&&g(R,o,I)}),[R,I,o,g,r]),(0,k.useEffect)((()=>{B&&!b&&E&&(!j||R||T||l?.(),!j&&R&&T&&a?.())}),[E,j,B,b,R,T,l,a]);const N=r?void 0!==d?.[I]?.[o]:j,D=(0,U_.l)(),M=(0,k.useMemo)((()=>{const e=v&&!N;return D(sA,e&&aA,!e&&t,y===o&&x,_===o&&w)}),[N,v,t,D,y,_,x,w,o]);return{...c,isShown:N,shouldRenderPlaceholder:v,className:M}}(e);return r?(0,Id.jsx)(dx.A,{...i,ref:t,children:n}):o?(0,Id.jsx)(dx.A,{...i,ref:t}):null}),"ToolsPanelItem"),qA=GA;var KA=n(37815),YA=n(95893),JA=n(65823),XA=n(44907);const ZA={hidden:{opacity:0},show:{opacity:1,transition:{type:"tween",duration:.2,delay:0,delayChildren:.1}},exit:{opacity:0,transition:{duration:.2,delayChildren:0}}},QA={hidden:{opacity:0,scale:.9},show:{opacity:1,scale:1,transition:{duration:.1}},exit:{opacity:0,scale:.9}};function eE({label:e}){const t=(0,kx.A)(),n=(0,Id.jsx)(wx.P.div,{variants:ZA,initial:t?"show":"hidden",animate:"show",exit:t?"show":"exit",className:"components-drop-zone__content",style:{pointerEvents:"none"},children:(0,Id.jsxs)(wx.P.div,{variants:QA,children:[(0,Id.jsx)(sk.A,{icon:KA.A,className:"components-drop-zone__content-icon"}),(0,Id.jsx)("span",{className:"components-drop-zone__content-text",children:e||(0,U.__)("Drop files to upload")})]})});return t?n:(0,Id.jsx)(XA.N,{children:n})}const tE=function({className:e,label:t,onFilesDrop:n,onHTMLDrop:r,onDrop:o,...i}){const[s,a]=(0,k.useState)(),[l,c]=(0,k.useState)(),[u,d]=(0,k.useState)(),h=(0,JA.A)({onDrop(e){const t=e.dataTransfer?(0,YA.$)(e.dataTransfer):[],i=e.dataTransfer?.getData("text/html");i&&r?r(i):t.length&&n?n(t):o&&o(e)},onDragStart(e){a(!0);let t="default";e.dataTransfer?.types.includes("text/html")?t="html":(e.dataTransfer?.types.includes("Files")||(e.dataTransfer?(0,YA.$)(e.dataTransfer):[]).length>0)&&(t="file"),d(t)},onDragEnd(){a(!1),d(void 0)},onDragEnter(){c(!0)},onDragLeave(){c(!1)}}),p=(0,Vy.A)("components-drop-zone",e,{"is-active":(s||l)&&("file"===u&&n||"html"===u&&r||"default"===u&&o),"is-dragging-over-document":s,"is-dragging-over-element":l,[`is-dragging-${u}`]:!!u});return(0,Id.jsx)("div",{...i,ref:h,className:p,children:l&&(0,Id.jsx)(eE,{label:t})})};var nE=n(53926),rE=n(33398),oE=n(74115);const iE={width:200,height:170},sE=["avi","mpg","mpeg","mov","mp4","m4v","ogg","ogv","webm","wmv"];function aE(e){return Math.round(100*e)}const lE=(0,H_.default)("div",{target:"eeew7dm8"})({name:"jqnsxy",styles:"background-color:transparent;display:flex;text-align:center;width:100%"}),cE=(0,H_.default)("div",{target:"eeew7dm7"})("align-items:center;border-radius:",G_.A.radiusBlockUi,";cursor:pointer;display:inline-flex;justify-content:center;margin:auto;position:relative;height:100%;&:after{border-radius:inherit;bottom:0;box-shadow:inset 0 0 0 1px rgba( 0, 0, 0, 0.1 );content:'';left:0;pointer-events:none;position:absolute;right:0;top:0;}img,video{border-radius:inherit;box-sizing:border-box;display:block;height:auto;margin:0;max-height:100%;max-width:100%;pointer-events:none;user-select:none;width:auto;}"),uE=(0,H_.default)("div",{target:"eeew7dm6"})("background:",W_.l.gray[100],";border-radius:inherit;box-sizing:border-box;height:",iE.height,"px;max-width:280px;min-width:",iE.width,"px;width:100%;"),dE=(0,H_.default)(ik,{target:"eeew7dm5"})({name:"1d3w5wq",styles:"width:100%"});var hE={name:"1mn7kwb",styles:"padding-bottom:1em"};const pE=({__nextHasNoMarginBottom:e})=>e?void 0:hE;var fE={name:"1mn7kwb",styles:"padding-bottom:1em"};const mE=({hasHelpText:e=!1})=>e?fE:void 0,gE=(0,H_.default)(j_.A,{target:"eeew7dm4"})("max-width:320px;padding-top:1em;",mE," ",pE,";"),bE=(0,H_.default)("div",{target:"eeew7dm3"})("left:50%;overflow:hidden;pointer-events:none;position:absolute;top:50%;transform:translate3d( -50%, -50%, 0 );z-index:1;@media not ( prefers-reduced-motion ){transition:opacity 100ms linear;}opacity:",(({showOverlay:e})=>e?1:0),";"),vE=(0,H_.default)("div",{target:"eeew7dm2"})({name:"1yzbo24",styles:"background:rgba( 255, 255, 255, 0.4 );backdrop-filter:blur( 16px ) saturate( 180% );position:absolute;transform:translateZ( 0 )"}),yE=(0,H_.default)(vE,{target:"eeew7dm1"})({name:"1sw8ur",styles:"height:1px;left:1px;right:1px"}),_E=(0,H_.default)(vE,{target:"eeew7dm0"})({name:"188vg4t",styles:"width:1px;top:1px;bottom:1px"}),xE=0,wE=100,kE=()=>{};function CE({__nextHasNoMarginBottom:e,__next40pxDefaultSize:t,hasHelpText:n,onChange:r=kE,point:o={x:.5,y:.5}}){const i=aE(o.x),s=aE(o.y),a=(e,t)=>{if(void 0===e)return;const n=parseInt(e,10);isNaN(n)||r({...o,[t]:n/100})};return(0,Id.jsxs)(gE,{className:"focal-point-picker__controls",__nextHasNoMarginBottom:e,hasHelpText:n,gap:4,children:[(0,Id.jsx)(SE,{__next40pxDefaultSize:t,label:(0,U.__)("Left"),"aria-label":(0,U.__)("Focal point left position"),value:[i,"%"].join(""),onChange:e=>a(e,"x"),dragDirection:"e"}),(0,Id.jsx)(SE,{__next40pxDefaultSize:t,label:(0,U.__)("Top"),"aria-label":(0,U.__)("Focal point top position"),value:[s,"%"].join(""),onChange:e=>a(e,"y"),dragDirection:"s"})]})}function SE(e){return(0,Id.jsx)(dE,{className:"focal-point-picker__controls-position-unit-control",labelPosition:"top",max:wE,min:xE,units:[{value:"%",label:"%"}],...e})}const AE=(0,H_.default)("div",{target:"e19snlhg0"})("background-color:transparent;cursor:grab;height:40px;margin:-20px 0 0 -20px;position:absolute;user-select:none;width:40px;will-change:transform;z-index:10000;background:rgba( 255, 255, 255, 0.4 );border:1px solid rgba( 255, 255, 255, 0.4 );border-radius:50%;backdrop-filter:blur( 16px ) saturate( 180% );box-shadow:rgb( 0 0 0 / 10% ) 0px 0px 8px;@media not ( prefers-reduced-motion ){transition:transform 100ms linear;}",(({isDragging:e})=>e&&"\n\t\t\tbox-shadow: rgb( 0 0 0 / 12% ) 0px 0px 10px;\n\t\t\ttransform: scale( 1.1 );\n\t\t\tcursor: grabbing;\n\t\t\t"),";");function EE({left:e="50%",top:t="50%",...n}){const r={left:e,top:t};return(0,Id.jsx)(AE,{...n,className:"components-focal-point-picker__icon_container",style:r})}function IE({bounds:e,...t}){return(0,Id.jsxs)(bE,{...t,className:"components-focal-point-picker__grid",style:{width:e.width,height:e.height},children:[(0,Id.jsx)(yE,{style:{top:"33%"}}),(0,Id.jsx)(yE,{style:{top:"66%"}}),(0,Id.jsx)(_E,{style:{left:"33%"}}),(0,Id.jsx)(_E,{style:{left:"66%"}})]})}function jE({alt:e,autoPlay:t,src:n,onLoad:r,mediaRef:o,muted:i=!0,...s}){return n?function(e=""){return!!e&&(e.startsWith("data:video/")||sE.includes(function(e=""){const t=e.split(".");return t[t.length-1]}(e)))}(n)?(0,Id.jsx)("video",{...s,autoPlay:t,className:"components-focal-point-picker__media components-focal-point-picker__media--video",loop:!0,muted:i,onLoadedData:r,ref:o,src:n}):(0,Id.jsx)("img",{...s,alt:e,className:"components-focal-point-picker__media components-focal-point-picker__media--image",onLoad:r,ref:o,src:n}):(0,Id.jsx)(uE,{className:"components-focal-point-picker__media components-focal-point-picker__media--placeholder",ref:o,...s})}var TE=n(70573);const BE=function e({__nextHasNoMarginBottom:t,__next40pxDefaultSize:n=!1,autoPlay:r=!0,className:o,help:i,label:s,onChange:a,onDrag:l,onDragEnd:c,onDragStart:u,resolvePoint:d,url:h,value:p={x:.5,y:.5},...f}){const[m,g]=(0,k.useState)(p),[b,v]=(0,k.useState)(!1),{startDrag:y,endDrag:_,isDragging:x}=(0,rE.A)({onDragStart:e=>{S.current?.focus();const t=j(e);t&&(u?.(t,e),g(t))},onDragMove:e=>{e.preventDefault();const t=j(e);t&&(l?.(t,e),g(t))},onDragEnd:()=>{c?.(),a?.(m)}}),{x:w,y:C}=x?m:p,S=(0,k.useRef)(null),[A,E]=(0,k.useState)(iE),I=(0,k.useRef)((()=>{if(!S.current)return;const{clientWidth:e,clientHeight:t}=S.current;E(e>0&&t>0?{width:e,height:t}:{...iE})}));(0,k.useEffect)((()=>{const e=I.current;if(!S.current)return;const{defaultView:t}=S.current.ownerDocument;return t?.addEventListener("resize",e),()=>t?.removeEventListener("resize",e)}),[]),(0,oE.A)((()=>{I.current()}),[]);const j=({clientX:e,clientY:t,shiftKey:n})=>{if(!S.current)return;const{top:r,left:o}=S.current.getBoundingClientRect();let i=(e-o)/A.width,s=(t-r)/A.height;return n&&(i=.1*Math.round(i/.1),s=.1*Math.round(s/.1)),T({x:i,y:s})},T=e=>{var t;const n=null!==(t=d?.(e))&&void 0!==t?t:e;n.x=Math.max(0,Math.min(n.x,1)),n.y=Math.max(0,Math.min(n.y,1));const r=e=>Math.round(100*e)/100;return{x:r(n.x),y:r(n.y)}},B={left:void 0!==w?w*A.width:.5*A.width,top:void 0!==C?C*A.height:.5*A.height},R=(0,Vy.A)("components-focal-point-picker-control",o),N=`inspector-focal-point-picker-control-${(0,L_.A)(e)}`;return(0,TE.A)((()=>{v(!0);const e=window.setTimeout((()=>{v(!1)}),600);return()=>window.clearTimeout(e)}),[w,C]),(0,Id.jsxs)(V_.Ay,{...f,__nextHasNoMarginBottom:t,label:s,id:N,help:i,className:R,children:[(0,Id.jsx)(lE,{className:"components-focal-point-picker-wrapper",children:(0,Id.jsxs)(cE,{className:"components-focal-point-picker",onKeyDown:e=>{const{code:t,shiftKey:n}=e;if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t))return;e.preventDefault();const r={x:w,y:C},o=n?.1:.01,i="ArrowUp"===t||"ArrowLeft"===t?-1*o:o,s="ArrowUp"===t||"ArrowDown"===t?"y":"x";r[s]=r[s]+i,a?.(T(r))},onMouseDown:y,onBlur:()=>{x&&_()},ref:S,role:"button",tabIndex:-1,children:[(0,Id.jsx)(IE,{bounds:A,showOverlay:b}),(0,Id.jsx)(jE,{alt:(0,U.__)("Media preview"),autoPlay:r,onLoad:I.current,src:h}),(0,Id.jsx)(EE,{...B,isDragging:x})]})}),(0,Id.jsx)(CE,{__nextHasNoMarginBottom:t,__next40pxDefaultSize:n,hasHelpText:!!i,point:{x:w,y:C},onChange:e=>{a?.(T(e))}})]})};var RE=n(21863),NE=n(70508),DE=n(92449),ME=n(47625);const PE=function({accept:e,children:t,multiple:n=!1,onChange:r,onClick:o,render:i,...s}){const a=(0,k.useRef)(null),l=()=>{a.current?.click()},c=i?i({openFileDialog:l}):(0,Id.jsx)(Jy.Ay,{onClick:l,...s,children:t});return(0,Id.jsxs)("div",{className:"components-form-file-upload",children:[c,(0,Id.jsx)("input",{type:"file",ref:a,multiple:n,style:{display:"none"},accept:e,onChange:r,onClick:o,"data-testid":"form-file-upload-input"})]})};var OE=n(44137);function LE(e){return(0,Vp.f)((t=>{const n="core/with-filters/"+e;let r;class o extends k.Component{constructor(n){super(n),void 0===r&&(r=(0,Iu.applyFilters)(e,t))}componentDidMount(){o.instances.push(this),1===o.instances.length&&((0,Iu.addAction)("hookRemoved",n,s),(0,Iu.addAction)("hookAdded",n,s))}componentWillUnmount(){o.instances=o.instances.filter((e=>e!==this)),0===o.instances.length&&((0,Iu.removeAction)("hookRemoved",n),(0,Iu.removeAction)("hookAdded",n))}render(){return(0,Id.jsx)(r,{...this.props})}}o.instances=[];const i=(0,OE.s)((()=>{r=(0,Iu.applyFilters)(e,t),o.instances.forEach((e=>{e.forceUpdate()}))}),16);function s(t){t===e&&i()}return o}),"withFilters")}var FE=n(38133),zE=n(34343),UE=n(21340),VE=n(91851);const HE=LE("editor.MediaUpload")((()=>null)),$E=function({fallback:e=null,children:t}){const n=(0,Fl.A)((e=>{const{getSettings:t}=e(uy);return!!t().mediaUpload}),[]);return n?t:e};var WE=n(83471),GE=n(57699),qE=n(78048),KE=n(35706),YE=n(97893),JE=n(95702),XE=n(89395),ZE=n(24070);const QE=function e({children:t,settingsOpen:n,setSettingsOpen:r}){const o=(0,kx.A)(),i=o?k.Fragment:XA.N,s=o?"div":wx.P.div,a=`link-control-settings-drawer-${(0,L_.A)(e)}`;return(0,Id.jsxs)(Id.Fragment,{children:[(0,Id.jsx)(Jy.Ay,{className:"block-editor-link-control__drawer-toggle","aria-expanded":n,onClick:()=>r(!n),icon:(0,U.isRTL)()?XE.A:ZE.A,"aria-controls":a,children:(0,U._x)("Advanced","Additional link settings")}),(0,Id.jsx)(i,{children:n&&(0,Id.jsx)(s,{className:"block-editor-link-control__drawer",hidden:!n,id:a,initial:"collapsed",animate:"open",exit:"collapsed",variants:{open:{opacity:1,height:"auto"},collapsed:{opacity:0,height:0}},transition:{duration:.1},children:(0,Id.jsx)("div",{className:"block-editor-link-control__drawer-inner",children:t})})})]})};var eI=n(1879),tI=n(38602),nI=n(84961),rI=n(25222),oI=n(13417);function iI(e){return"function"==typeof e}class sI extends k.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.onFocus=this.onFocus.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.selectLink=this.selectLink.bind(this),this.handleOnClick=this.handleOnClick.bind(this),this.bindSuggestionNode=this.bindSuggestionNode.bind(this),this.autocompleteRef=e.autocompleteRef||(0,k.createRef)(),this.inputRef=(0,k.createRef)(),this.updateSuggestions=(0,OE.s)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.suggestionsRequest=null,this.state={suggestions:[],showSuggestions:!1,suggestionsValue:null,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){const{showSuggestions:t,selectedSuggestion:n}=this.state,{value:r,__experimentalShowInitialSuggestions:o=!1}=this.props;t&&null!==n&&this.suggestionNodes[n]&&this.suggestionNodes[n].scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"}),e.value===r||this.props.disableSuggestions||(r?.length?this.updateSuggestions(r):o&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){this.suggestionsRequest?.cancel?.(),this.suggestionsRequest=null}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){const{__experimentalShowInitialSuggestions:e=!1,value:t}=this.props;return e&&!(t&&t.length)}updateSuggestions(e=""){const{__experimentalFetchLinkSuggestions:t,__experimentalHandleURLSuggestions:n}=this.props;if(!t)return;const r=!e?.length;if(e=e.trim(),!r&&(e.length<2||!n&&(0,oI.m)(e)))return this.suggestionsRequest?.cancel?.(),this.suggestionsRequest=null,void this.setState({suggestions:[],showSuggestions:!1,suggestionsValue:e,selectedSuggestion:null,loading:!1});this.setState({selectedSuggestion:null,loading:!0});const o=t(e,{isInitialSuggestions:r});o.then((t=>{this.suggestionsRequest===o&&(this.setState({suggestions:t,suggestionsValue:e,loading:!1,showSuggestions:!!t.length}),t.length?this.props.debouncedSpeak((0,U.sprintf)((0,U._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",t.length),t.length),"assertive"):this.props.debouncedSpeak((0,U.__)("No results."),"assertive"))})).catch((()=>{this.suggestionsRequest===o&&this.setState({loading:!1})})).finally((()=>{this.suggestionsRequest===o&&(this.suggestionsRequest=null)})),this.suggestionsRequest=o}onChange(e){this.props.onChange(e.target.value)}onFocus(){const{suggestions:e}=this.state,{disableSuggestions:t,value:n}=this.props;!n||t||e&&e.length||null!==this.suggestionsRequest||this.updateSuggestions(n)}onKeyDown(e){this.props.onKeyDown?.(e);const{showSuggestions:t,selectedSuggestion:n,suggestions:r,loading:o}=this.state;if(!t||!r.length||o){switch(e.keyCode){case zE.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case zE.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case zE.ENTER:this.props.onSubmit&&(e.preventDefault(),this.props.onSubmit(null,e))}return}const i=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case zE.UP:{e.preventDefault();const t=n?n-1:r.length-1;this.setState({selectedSuggestion:t});break}case zE.DOWN:{e.preventDefault();const t=null===n||n===r.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case zE.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(i),this.props.speak((0,U.__)("Link selected.")));break;case zE.ENTER:e.preventDefault(),null!==this.state.selectedSuggestion?(this.selectLink(i),this.props.onSubmit&&this.props.onSubmit(i,e)):this.props.onSubmit&&this.props.onSubmit(null,e)}}selectLink(e){this.props.onChange(e.url,e),this.setState({selectedSuggestion:null,showSuggestions:!1})}handleOnClick(e){this.selectLink(e),this.inputRef.current.focus()}static getDerivedStateFromProps({value:e,instanceId:t,disableSuggestions:n,__experimentalShowInitialSuggestions:r=!1},{showSuggestions:o}){let i=o;const s=e&&e.length;return r||s||(i=!1),!0===n&&(i=!1),{showSuggestions:i,suggestionsListboxId:`block-editor-url-input-suggestions-${t}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${t}`}}render(){return(0,Id.jsxs)(Id.Fragment,{children:[this.renderControl(),this.renderSuggestions()]})}renderControl(){const{__nextHasNoMarginBottom:e=!1,label:t=null,className:n,isFullWidth:r,instanceId:o,placeholder:i=(0,U.__)("Paste URL or type to search"),__experimentalRenderControl:s,value:a="",hideLabelFromVision:l=!1}=this.props,{loading:c,showSuggestions:u,selectedSuggestion:d,suggestionsListboxId:h,suggestionOptionIdPrefix:p}=this.state,f=`url-input-control-${o}`,m={id:f,label:t,className:(0,Vy.A)("block-editor-url-input",n,{"is-full-width":r}),hideLabelFromVision:l},g={id:f,value:a,required:!0,className:"block-editor-url-input__input",type:"text",onChange:this.onChange,onFocus:this.onFocus,placeholder:i,onKeyDown:this.onKeyDown,role:"combobox","aria-label":t?void 0:(0,U.__)("URL"),"aria-expanded":u,"aria-autocomplete":"list","aria-owns":h,"aria-activedescendant":null!==d?`${p}-${d}`:void 0,ref:this.inputRef};return s?s(m,g,c):(e||(0,W.default)("Bottom margin styles for wp.blockEditor.URLInput",{since:"6.2",version:"6.5",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"}),(0,Id.jsxs)(V_.Ay,{__nextHasNoMarginBottom:e,...m,children:[(0,Id.jsx)("input",{...g}),c&&(0,Id.jsx)(WE.Ay,{})]}))}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t}=this.props,{showSuggestions:n,suggestions:r,suggestionsValue:o,selectedSuggestion:i,suggestionsListboxId:s,suggestionOptionIdPrefix:a,loading:l}=this.state;if(!n||0===r.length)return null;const c={id:s,ref:this.autocompleteRef,role:"listbox"},u=(e,t)=>({role:"option",tabIndex:"-1",id:`${a}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===i||void 0});return iI(t)?t({suggestions:r,selectedSuggestion:i,suggestionsListProps:c,buildSuggestionItemProps:u,isLoading:l,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:!o?.length,currentInputValue:o}):(0,Id.jsx)(GC.Ay,{placement:"bottom",focusOnMount:!1,children:(0,Id.jsx)("div",{...c,className:(0,Vy.A)("block-editor-url-input__suggestions",`${e}__suggestions`),children:r.map(((e,t)=>(0,k.createElement)(Jy.Ay,{...u(0,t),key:e.id,className:(0,Vy.A)("block-editor-url-input__suggestion",{"is-selected":t===i}),onClick:()=>this.handleOnClick(e)},e.title)))})})}}const aI=(0,D.A)(tI.A,eI.A,nI.A,(0,rI.A)(((e,t)=>{if(iI(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(uy);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(sI);var lI=n(87948);const cI=({searchTerm:e,onClick:t,itemProps:n,buttonText:r})=>{if(!e)return null;let o;return o=r?"function"==typeof r?r(e):r:(0,lI.A)((0,U.sprintf)((0,U.__)("Create: %s"),e),{mark:(0,Id.jsx)("mark",{})}),(0,Id.jsx)(x_.A,{...n,iconPosition:"left",icon:XS.A,className:"block-editor-link-control__search-item",onClick:t,children:o})},uI=e=>{const{text:t="",highlight:n=""}=e,r=n.trim();if(!r)return(0,Id.jsx)(Id.Fragment,{children:t});const o=new RegExp(`(${(0,nk.Nt)(r)})`,"gi");return(0,lI.A)(t.replace(o,"$&"),{mark:(0,Id.jsx)("mark",{})})};var dI=n(97169),hI=n(693),pI=n(27692),fI=n(31486),mI=n(19212),gI=n(48329),bI=n(32637),vI=n(25913),yI=n(17424),_I=n(51737),xI=n(99502);const wI={post:dI.A,page:hI.A,post_tag:pI.A,category:fI.A,attachment:mI.A};function kI({isURL:e,suggestion:t}){let n=null;return e?n=gI.A:t.type in wI&&(n=wI[t.type],"page"===t.type&&(t.isFrontPage&&(n=bI.A),t.isBlogHome&&(n=vI.A))),n?(0,Id.jsx)(sk.A,{className:"block-editor-link-control__search-item-icon",icon:n}):null}function CI(e){const t=e?.trim();return t?.length?e?.replace(/^\/?/,"/"):e}function SI(e){const t=e?.trim();return t?.length?e?.replace(/\/$/,""):e}function AI(e){return e.isFrontPage?"front page":e.isBlogHome?"blog home":"post_tag"===e.type?"tag":e.type}const EI=({itemProps:e,suggestion:t,searchTerm:n,onClick:r,isURL:o=!1,shouldShowType:i=!1})=>{const s=o?(0,U.__)("Press ENTER to add this link"):(a=t.url)?(0,Zp.h)(yI.S,_I.Y,(e=>null==e||e!=e?"":e),((e,...t)=>(...n)=>e(...n,...t))(xI.r,24),SI,CI)(a):a;var a;return(0,Id.jsx)(x_.A,{...e,info:s,iconPosition:"left",icon:(0,Id.jsx)(kI,{suggestion:t,isURL:o}),onClick:r,shortcut:i&&AI(t),className:"block-editor-link-control__search-item",children:(0,Id.jsx)(uI,{text:(0,ic.A)(t.title),highlight:n})})},II="__CREATE__",jI="link",TI="mailto",BI="internal",RI=[jI,TI,"tel",BI],NI=[{id:"opensInNewTab",title:(0,U.__)("Open in new tab")}];function DI({instanceId:e,withCreateSuggestion:t,currentInputValue:n,handleSuggestionClick:r,suggestionsListProps:o,buildSuggestionItemProps:i,suggestions:s,selectedSuggestion:a,isLoading:l,isInitialSuggestions:c,createSuggestionButtonText:u,suggestionsQuery:d}){const h=(0,Vy.A)("block-editor-link-control__search-results",{"is-loading":l}),p=1===s.length&&RI.includes(s[0].type),f=t&&!p&&!c,m=!d?.type,g=`block-editor-link-control-search-results-label-${e}`,b=c?(0,U.__)("Suggestions"):(0,U.sprintf)((0,U.__)('Search results for "%s"'),n),v=(0,Id.jsx)($A.A,{id:g,children:b});return(0,Id.jsxs)("div",{className:"block-editor-link-control__search-results-wrapper",children:[v,(0,Id.jsx)("div",{...o,className:h,"aria-labelledby":g,children:(0,Id.jsx)(__.A,{children:s.map(((e,t)=>f&&II===e.type?(0,Id.jsx)(cI,{searchTerm:n,buttonText:u,onClick:()=>r(e),itemProps:i(e,t),isSelected:t===a},e.type):II===e.type?null:(0,Id.jsx)(EI,{itemProps:i(e,t),suggestion:e,index:t,onClick:()=>{r(e)},isSelected:t===a,isURL:RI.includes(e.type),searchTerm:n,shouldShowType:m,isFrontPage:e?.isFrontPage,isBlogHome:e?.isBlogHome},`${e.id}-${e.type}`)))})})]})}var MI=n(40670),PI=n(98526),OI=n(12319),LI=n(76403);function FI(e){if(e.includes(" "))return!1;const t=(0,MI.J)(e),n=(0,OI.v)(t),r=function(e,t=6){const n=e.split(/[?#]/)[0];return new RegExp(`(?<=\\S)\\.(?:[a-zA-Z_]{2,${t}})(?:\\/|$)`).test(n)}(e),o=e?.startsWith("www."),i=e?.startsWith("#")&&(0,LI.R)(e);return n||o||i||r}const zI=()=>Promise.resolve([]),UI=e=>{let t=jI;const n=(0,MI.J)(e)||"";return n.includes("mailto")&&(t=TI),n.includes("tel")&&(t="tel"),e?.startsWith("#")&&(t=BI),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,PI.N)(e):e,type:t}])};const VI=()=>Promise.resolve([]),HI=()=>{},$I=(0,k.forwardRef)((({value:e,children:t,currentLink:n={},className:r=null,placeholder:o=null,withCreateSuggestion:i=!1,onCreateSuggestion:s=HI,onChange:a=HI,onSelect:l=HI,showSuggestions:c=!0,renderSuggestions:u=(e=>(0,Id.jsx)(DI,{...e})),fetchSuggestions:d=null,allowDirectEntry:h=!0,showInitialSuggestions:p=!1,suggestionsQuery:f={},withURLSuggestion:m=!0,createSuggestionButtonText:g,hideLabelFromVision:b=!1},v)=>{const y=function(e,t,n){const{fetchSearchSuggestions:r,pageOnFront:o,pageForPosts:i}=(0,Fl.A)((e=>{const{getSettings:t}=e(uy);return{pageOnFront:t().pageOnFront,pageForPosts:t().pageForPosts,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),s=t?UI:zI;return(0,k.useCallback)(((t,{isInitialSuggestions:a})=>FI(t)?s(t,{isInitialSuggestions:a}):(async(e,t,n,r,o,i)=>{const{isInitialSuggestions:s}=t,a=await n(e,t);return a.map((e=>Number(e.id)===o?(e.isFrontPage=!0,e):Number(e.id)===i?(e.isBlogHome=!0,e):e)),s||FI(e)||!r?a:a.concat({title:e,url:e,type:II})})(t,{...e,isInitialSuggestions:a},r,n,o,i)),[s,r,o,i,e,n])}(f,h,i),_=c?d||y:VI,x=(0,L_.A)($I),[w,C]=(0,k.useState)(),S=async e=>{let t=e;if(II!==e.type){if(h||t&&Object.keys(t).length>=1){const{id:e,url:r,...o}=null!=n?n:{};l({...o,...t},t)}}else try{t=await s(e.title),t?.url&&l(t)}catch(e){}};return(0,Id.jsxs)("div",{className:"block-editor-link-control__search-input-container",children:[(0,Id.jsx)(aI,{disableSuggestions:n?.url===e,__nextHasNoMarginBottom:!0,label:(0,U.__)("Link"),hideLabelFromVision:b,className:r,value:e,onChange:(e,t)=>{a(e),C(t)},placeholder:null!=o?o:(0,U.__)("Search or type url"),__experimentalRenderSuggestions:c?e=>u({...e,instanceId:x,withCreateSuggestion:i,createSuggestionButtonText:g,suggestionsQuery:f,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),S(t)}}):null,__experimentalFetchLinkSuggestions:_,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:p,onSubmit:(t,n)=>{const r=t||w;r||e?.trim()?.length?S(r||{url:e}):n.preventDefault()},ref:v}),t]})})),WI=$I;var GI=n(79566),qI=n(34691),KI=n(74314),YI=n(50446),JI=n(42622),XI=n(6497);const{Slot:ZI,Fill:QI}=(0,Ul.QJ)("BlockEditorLinkControlViewer");function ej(e,t){switch(t.type){case"RESOLVED":return{...e,isFetching:!1,richData:t.richData};case"ERROR":return{...e,isFetching:!1,richData:null};case"LOADING":return{...e,isFetching:!0};default:throw new Error(`Unexpected action type ${t.type}`)}}const tj=function(e){const[t,n]=(0,k.useReducer)(ej,{richData:null,isFetching:!1}),{fetchRichUrlData:r}=(0,Fl.A)((e=>{const{getSettings:t}=e(uy);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}}),[]);return(0,k.useEffect)((()=>{if(e?.length&&r&&"undefined"!=typeof AbortController){n({type:"LOADING"});const t=new window.AbortController,o=t.signal;return r(e,{signal:o}).then((e=>{n({type:"RESOLVED",richData:e})})).catch((()=>{o.aborted||n({type:"ERROR"})})),()=>{t.abort()}}}),[e]),t};function nj({value:e,onEditClick:t,hasRichPreviews:n=!1,hasUnlinkControl:r=!1,onRemove:o}){const i=(0,Fl.A)((e=>e(YE.M).get("core","showIconLabels")),[]),s=n?e?.url:null,{richData:a,isFetching:l}=tj(s),c=a&&Object.keys(a).length,u=e&&(0,xI.r)((0,yI.S)(e.url),24)||"",d=!e?.url?.length,h=!d&&(0,ic.A)(a?.title||e?.title||u);let p;p=a?.icon?(0,Id.jsx)("img",{src:a?.icon,alt:""}):d?(0,Id.jsx)(sk.A,{icon:KI.A,size:32}):(0,Id.jsx)(sk.A,{icon:gI.A});const{createNotice:f}=(0,zl.A)(Yb.store),m=(0,qI.A)(e.url,(()=>{f("info",(0,U.__)("Link copied to clipboard."),{isDismissible:!0,type:"snackbar"})}));return(0,Id.jsx)("div",{"aria-label":(0,U.__)("Currently selected"),className:(0,Vy.A)("block-editor-link-control__search-item",{"is-current":!0,"is-rich":c,"is-fetching":!!l,"is-preview":!0,"is-error":d,"is-url-title":h===u}),children:(0,Id.jsxs)("div",{className:"block-editor-link-control__search-item-top",children:[(0,Id.jsxs)("span",{className:"block-editor-link-control__search-item-header",children:[(0,Id.jsx)("span",{className:(0,Vy.A)("block-editor-link-control__search-item-icon",{"is-image":a?.icon}),children:p}),(0,Id.jsx)("span",{className:"block-editor-link-control__search-item-details",children:d?(0,Id.jsx)("span",{className:"block-editor-link-control__search-item-error-notice",children:(0,U.__)("Link is empty")}):(0,Id.jsxs)(Id.Fragment,{children:[(0,Id.jsx)(GI.A,{className:"block-editor-link-control__search-item-title",href:e.url,children:(0,Id.jsx)(HA.A,{numberOfLines:1,children:h})}),e?.url&&h!==u&&(0,Id.jsx)("span",{className:"block-editor-link-control__search-item-info",children:(0,Id.jsx)(HA.A,{numberOfLines:1,children:u})})]})})]}),(0,Id.jsx)(Jy.Ay,{icon:YI.A,label:(0,U.__)("Edit link"),onClick:t,size:"compact"}),r&&(0,Id.jsx)(Jy.Ay,{icon:JI.A,label:(0,U.__)("Remove link"),onClick:o,size:"compact"}),(0,Id.jsx)(Jy.Ay,{icon:XI.A,label:(0,U.sprintf)((0,U.__)("Copy link%s"),d||i?"":": "+e.url),ref:m,disabled:d,size:"compact"}),(0,Id.jsx)(ZI,{fillProps:e})]})})}var rj=n(33973);const oj=()=>{},ij=({value:e,onChange:t=oj,settings:n})=>{if(!n||!n.length)return null;const r=n=>r=>{t({...e,[n.id]:r})},o=n.map((t=>(0,Id.jsx)(rj.A,{__nextHasNoMarginBottom:!0,className:"block-editor-link-control__setting",label:t.title,onChange:r(t),checked:!!e&&!!e[t.id],help:t?.help},t.id)));return(0,Id.jsxs)("fieldset",{className:"block-editor-link-control__settings",children:[(0,Id.jsx)($A.A,{as:"legend",children:(0,U.__)("Currently selected link settings")}),o]})};var sj=n(7040),aj=n.n(sj);const lj=()=>{},cj="core/block-editor",uj="linkControlSettingsDrawer";function dj({searchInputPlaceholder:e,value:t,settings:n=NI,onChange:r=lj,onRemove:o,onCancel:i,noDirectEntry:s=!1,showSuggestions:a=!0,showInitialSuggestions:l,forceIsEditingLink:c,createSuggestion:u,withCreateSuggestion:d,inputValue:h="",suggestionsQuery:p={},noURLSuggestion:f=!1,createSuggestionButtonText:m,hasRichPreviews:g=!1,hasTextControl:b=!1,renderControlBottom:v=null}){void 0===d&&u&&(d=!0);const[y,_]=(0,k.useState)(!1),{advancedSettingsPreference:x}=(0,Fl.A)((e=>{var t;return{advancedSettingsPreference:null!==(t=e(YE.M).get(cj,uj))&&void 0!==t&&t}}),[]),{set:w}=(0,zl.A)(YE.M),C=x||y,S=(0,k.useRef)(!0),A=(0,k.useRef)(),E=(0,k.useRef)(),I=(0,k.useRef)(!1),j=n.map((({id:e})=>e)),[T,B,R,N,D]=function(e){const[t,n]=(0,k.useState)(e||{}),[r,o]=(0,k.useState)(e);return aj()(e,r)||(o(e),n(e)),[t,n,e=>{n({...t,url:e})},e=>{n({...t,title:e})},e=>r=>{const o=Object.keys(r).reduce(((t,n)=>(e.includes(n)&&(t[n]=r[n]),t)),{});n({...t,...o})}]}(t),M=t&&!(0,KE.A)(T,t),[P,O]=(0,k.useState)(void 0!==c?c:!t||!t.url),{createPage:L,isCreatingPage:F,errorMessage:z}=function(e){const t=(0,k.useRef)(),[n,r]=(0,k.useState)(!1),[o,i]=(0,k.useState)(null);return(0,k.useEffect)((()=>()=>{t.current&&t.current.cancel()}),[]),{createPage:async function(n){r(!0),i(null);try{return t.current=(e=>{let t=!1;const n=new Promise(((n,r)=>{e.then((e=>t?r({isCanceled:!0}):n(e)),(e=>r(t?{isCanceled:!0}:e)))}));return{promise:n,cancel(){t=!0}}})(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw i(e.message||(0,U.__)("An unknown error occurred during creation. Please try again.")),e}finally{r(!1)}},isCreatingPage:n,errorMessage:o}}(u);(0,k.useEffect)((()=>{void 0!==c&&O(c)}),[c]),(0,k.useEffect)((()=>{S.current||((NE.focus.focusable.find(A.current)[0]||A.current).focus(),I.current=!1)}),[P,F]),(0,k.useEffect)((()=>(S.current=!1,()=>{S.current=!0})),[]);const V=t?.url?.trim()?.length>0,H=()=>{I.current=!!A.current?.contains(A.current.ownerDocument.activeElement),O(!1)},$=()=>{M&&r({...t,...T,url:W}),H()},W=h||T?.url||"",G=!W?.trim()?.length,q=o&&t&&!P&&!F,K=P&&V,Y=V&&b,J=(P||!t)&&!F,X=!M||G,Z=!!n?.length&&P&&V;return(0,Id.jsxs)("div",{tabIndex:-1,ref:A,className:"block-editor-link-control",children:[F&&(0,Id.jsxs)("div",{className:"block-editor-link-control__loading",children:[(0,Id.jsx)(WE.Ay,{})," ",(0,U.__)("Creating"),"…"]}),J&&(0,Id.jsxs)(Id.Fragment,{children:[(0,Id.jsxs)("div",{className:(0,Vy.A)({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":Y,"has-actions":K}),children:[Y&&(0,Id.jsx)(GE.A,{__nextHasNoMarginBottom:!0,ref:E,className:"block-editor-link-control__field block-editor-link-control__text-content",label:(0,U.__)("Text"),value:T?.title,onChange:N,onKeyDown:e=>{const{keyCode:t}=e;t!==zE.ENTER||G||(e.preventDefault(),$())},size:"__unstable-large"}),(0,Id.jsx)(WI,{currentLink:t,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:e,value:W,withCreateSuggestion:d,onCreateSuggestion:L,onChange:R,onSelect:e=>{const t=Object.keys(e).reduce(((t,n)=>(j.includes(n)||(t[n]=e[n]),t)),{});r({...T,...t,title:T?.title||e?.title}),H()},showInitialSuggestions:l,allowDirectEntry:!s,showSuggestions:a,suggestionsQuery:p,withURLSuggestion:!f,createSuggestionButtonText:m,hideLabelFromVision:!Y}),!K&&(0,Id.jsx)("div",{className:"block-editor-link-control__search-enter",children:(0,Id.jsx)(Jy.Ay,{onClick:X?lj:$,label:(0,U.__)("Submit"),icon:JE.A,className:"block-editor-link-control__search-submit","aria-disabled":X})})]}),z&&(0,Id.jsx)(qE.A,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1,children:z})]}),t&&!P&&!F&&(0,Id.jsx)(nj,{value:t,onEditClick:()=>O(!0),hasRichPreviews:g,hasUnlinkControl:q,onRemove:()=>{o(),O(!0)}},t?.url),Z&&(0,Id.jsx)("div",{className:"block-editor-link-control__tools",children:!G&&(0,Id.jsx)(QE,{settingsOpen:C,setSettingsOpen:e=>{w&&w(cj,uj,e),_(e)},children:(0,Id.jsx)(ij,{value:T,settings:n,onChange:D(j)})})}),K&&(0,Id.jsxs)(QS.A,{justify:"right",className:"block-editor-link-control__search-actions",children:[(0,Id.jsx)(Jy.Ay,{variant:"tertiary",onClick:e=>{e.preventDefault(),e.stopPropagation(),B(t),V?H():o?.(),i?.()},children:(0,U.__)("Cancel")}),(0,Id.jsx)(Jy.Ay,{variant:"primary",onClick:X?lj:$,className:"block-editor-link-control__search-submit","aria-disabled":X,children:(0,U.__)("Save")})]}),!F&&v&&v()]})}dj.ViewerFill=QI,dj.DEFAULT_LINK_SETTINGS=NI;const hj=dj,pj=()=>{};let fj=0;const mj=(0,D.A)([(0,FE.A)((e=>{const{createNotice:t,removeNotice:n}=e(Yb.store);return{createNotice:t,removeNotice:n}})),LE("editor.MediaReplaceFlow")])((({mediaURL:e,mediaId:t,mediaIds:n,allowedTypes:r,accept:o,onError:i,onSelect:s,onSelectURL:a,onToggleFeaturedImage:l,useFeaturedImage:c,onFilesUpload:u=pj,name:d=(0,U.__)("Replace"),createNotice:h,removeNotice:p,children:f,multiple:m=!1,addToGallery:g,handleUpload:b=!0,popoverProps:v})=>{const y=(0,Fl.A)((e=>e(uy).getSettings().mediaUpload),[]),_=!!y,x=(0,k.useRef)(),w="block-editor/media-replace-flow/error-notice/"+ ++fj,C=e=>{const t=(0,ic.A)(e);i?i(t):setTimeout((()=>{h("error",t,{speak:!0,id:w,isDismissible:!0})}),1e3)},S=(e,t)=>{c&&l&&l(),t(),s(e),(0,Kb.speak)((0,U.__)("The media file has been replaced")),p(w)},A=e=>{e.keyCode===zE.DOWN&&(e.preventDefault(),e.target.click())},E=m&&!(!r||0===r.length)&&r.every((e=>"image"===e||e.startsWith("image/")));return(0,Id.jsx)(DE.A,{popoverProps:v,contentClassName:"block-editor-media-replace-flow__options",renderToggle:({isOpen:e,onToggle:t})=>(0,Id.jsx)(t_,{ref:x,"aria-expanded":e,"aria-haspopup":"true",onClick:t,onKeyDown:A,children:d}),renderContent:({onClose:i})=>(0,Id.jsxs)(Id.Fragment,{children:[(0,Id.jsxs)(ME.Ay,{className:"block-editor-media-replace-flow__media-upload-menu",children:[(0,Id.jsxs)($E,{children:[(0,Id.jsx)(HE,{gallery:E,addToGallery:g,multiple:m,value:m?n:t,onSelect:e=>S(e,i),allowedTypes:r,render:({open:e})=>(0,Id.jsx)(x_.A,{icon:UE.A,onClick:e,children:(0,U.__)("Open Media Library")})}),(0,Id.jsx)(PE,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!b)return t(),s(n);u(n),y({allowedTypes:r,filesList:n,onFileChange:([e])=>{S(e,t)},onError:C})})(e,i)},accept:o,multiple:!!m,render:({openFileDialog:e})=>(0,Id.jsx)(x_.A,{icon:KA.A,onClick:()=>{e()},children:(0,U.__)("Upload")})})]}),l&&(0,Id.jsx)(x_.A,{icon:VE.A,onClick:l,isPressed:c,children:(0,U.__)("Use featured image")}),f]}),a&&(0,Id.jsxs)("form",{className:(0,Vy.A)("block-editor-media-flow__url-input",{"has-siblings":_||l}),children:[(0,Id.jsx)("span",{className:"block-editor-media-replace-flow__image-url-label",children:(0,U.__)("Current media URL:")}),(0,Id.jsx)(hj,{value:{url:e},settings:[],showSuggestions:!1,onChange:({url:e})=>{a(e),x.current.focus()}})]})]})})}));function gj(e,t=[]){const n=t.find((t=>t.name===e));return n?.href?n?.href:e}const bj="image",vj={backgroundImage:!0,backgroundSize:!1};function yj(e){return"web"===Ph.A.OS&&e?.background?.backgroundImage}function _j(e){return!!e?.background?.backgroundImage?.id||"string"==typeof e?.background?.backgroundImage||!!e?.background?.backgroundImage?.url}const xj=e=>{if(!(!e||isNaN(e.x)&&isNaN(e.y)))return`${100*(isNaN(e.x)?.5:e.x)}% ${100*(isNaN(e.y)?.5:e.y)}%`},wj=e=>{if(!e)return{x:void 0,y:void 0};let[t,n]=e.split(" ").map((e=>parseFloat(e)/100));return t=isNaN(t)?void 0:t,n=isNaN(n)?t:n,{x:t,y:n}};function kj({label:e,filename:t,url:n}){const r=e||(0,RE.e)(n)||(0,U.__)("Add background image");return(0,Id.jsx)(VA,{as:"span",children:(0,Id.jsxs)(QS.A,{justify:n?"flex-start":"center",as:"span",children:[n&&(0,Id.jsx)("span",{className:(0,Vy.A)("block-editor-global-styles-background-panel__inspector-image-indicator-wrapper",{"has-image":n}),"aria-hidden":!0,children:(0,Id.jsx)("span",{className:"block-editor-global-styles-background-panel__inspector-image-indicator",style:{backgroundImage:`url(${n})`}})}),(0,Id.jsxs)(T_.A,{as:"span",children:[(0,Id.jsx)(HA.A,{numberOfLines:1,className:"block-editor-global-styles-background-panel__inspector-media-replace-title",children:r}),(0,Id.jsx)($A.A,{as:"span",children:n?(0,U.sprintf)((0,U.__)("Background image: %s"),t||r):(0,U.__)("No background image selected")})]})]})})}function Cj({panelId:e,isShownByDefault:t,onChange:n,style:r,inheritedValue:o,themeFileURIs:i}){const s=(0,Fl.A)((e=>e(uy).getSettings().mediaUpload),[]),{id:a,title:l,url:c}=r?.background?.backgroundImage||{...o?.background?.backgroundImage},u=(0,k.useRef)(),{createErrorNotice:d}=(0,zl.A)(Yb.store),h=e=>{d(e,{type:"snackbar"})},p=()=>n(Pf(r,["background","backgroundImage"],void 0)),f=e=>{if(!e||!e.url)return void p();if(Zl(e.url))return;if(e.media_type&&e.media_type!==bj||!e.media_type&&e.type&&e.type!==bj)return void h((0,U.__)("Only images can be used as a background image."));const t=r?.background?.backgroundSize,o=r?.background?.backgroundPosition;n(Pf(r,["background"],{...r?.background,backgroundImage:{url:e.url,id:e.id,source:"file",title:e.title||void 0},backgroundPosition:o||"auto"!==t&&t?o:"50% 0"}))},m=(0,k.useCallback)((e=>({...e,style:{...e.style,background:void 0}})),[]),g=_j(r),b=()=>{const[e]=NE.focus.tabbable.find(u.current);e?.focus(),e?.click()},v=!g&&_j(o);return(0,Id.jsx)(qA,{className:"single-column",hasValue:()=>g,label:(0,U.__)("Background image"),onDeselect:p,isShownByDefault:t,resetAllFilter:m,panelId:e,children:(0,Id.jsxs)("div",{className:"block-editor-global-styles-background-panel__inspector-media-replace-container",ref:u,children:[(0,Id.jsxs)(mj,{mediaId:a,mediaURL:c,allowedTypes:[bj],accept:"image/*",onSelect:f,name:(0,Id.jsx)(kj,{label:l,filename:l,url:gj(c,i)}),variant:"secondary",children:[v&&(0,Id.jsx)(x_.A,{onClick:()=>{b(),n(Pf(r,["background","backgroundImage"],"none"))},children:(0,U.__)("Remove")}),g&&(0,Id.jsx)(x_.A,{onClick:()=>{b(),p()},children:(0,U.__)("Reset ")})]}),(0,Id.jsx)(tE,{onFilesDrop:e=>{s({allowedTypes:[bj],filesList:e,onFileChange([e]){Zl(e?.url)||f(e)},onError:h})},label:(0,U.__)("Drop to upload")})]})})}function Sj({panelId:e,isShownByDefault:t,onChange:n,style:r,inheritedValue:o,defaultValues:i,themeFileURIs:s}){const a=r?.background?.backgroundSize||o?.background?.backgroundSize,l=r?.background?.backgroundRepeat||o?.background?.backgroundRepeat,c=r?.background?.backgroundImage?.url||o?.background?.backgroundImage?.url,u=r?.background?.backgroundPosition||o?.background?.backgroundPosition,d=void 0!==a&&"cover"!==a&&"contain"!==a||""===a?"auto":a||i?.backgroundSize,h=!("no-repeat"===l||"cover"===d&&void 0===l),p=function(e){return void 0!==e?.background?.backgroundPosition||void 0!==e?.background?.backgroundSize}(r),f=(0,k.useCallback)((e=>({...e,style:{...e.style,background:{...e.style?.background,backgroundRepeat:void 0,backgroundSize:void 0}}})),[]),m=e=>{let t=l,o=u;"contain"===e&&(t="no-repeat",o=void 0),"cover"===e&&(t=void 0,o=void 0),"cover"!==d&&"contain"!==d||"auto"!==e||(t=void 0,r?.background?.backgroundImage?.id&&(o="50% 0")),e||"auto"!==d||(e="auto"),n(Pf(r,["background"],{...r?.background,backgroundPosition:o,backgroundRepeat:t,backgroundSize:e}))};return(0,Id.jsxs)(nE.A,{as:qA,spacing:2,className:"single-column",hasValue:()=>p,label:(0,U.__)("Size"),onDeselect:()=>n(Pf(r,["background"],{...r?.background,backgroundPosition:void 0,backgroundRepeat:void 0,backgroundSize:void 0})),isShownByDefault:t,resetAllFilter:f,panelId:e,children:[(0,Id.jsx)(BE,{__next40pxDefaultSize:!0,label:(0,U.__)("Position"),url:gj(c,s),value:wj(u),onChange:e=>{n(Pf(r,["background","backgroundPosition"],xj(e)))}}),(0,Id.jsxs)(_x,{size:"__unstable-large",label:(0,U.__)("Size"),value:d,onChange:m,isBlock:!0,help:(g=a||i?.backgroundSize,"cover"===g||void 0===g?(0,U.__)("Image covers the space evenly."):"contain"===g?(0,U.__)("Image is contained without distortion."):(0,U.__)("Image has a fixed width.")),children:[(0,Id.jsx)(LC,{value:"cover",label:(0,U.__)("Cover")},"cover"),(0,Id.jsx)(LC,{value:"contain",label:(0,U.__)("Contain")},"contain"),(0,Id.jsx)(LC,{value:"auto",label:(0,U.__)("Tile")},"tile")]}),(0,Id.jsxs)(QS.A,{justify:"flex-start",spacing:2,as:"span",children:[void 0!==d&&"cover"!==d&&"contain"!==d?(0,Id.jsx)(ik,{"aria-label":(0,U.__)("Background image width"),onChange:m,value:a,size:"__unstable-large",__unstableInputWidth:"100px",min:0,placeholder:(0,U.__)("Auto")}):null,"cover"!==d&&(0,Id.jsx)(Ux.A,{label:(0,U.__)("Repeat"),checked:h,onChange:()=>n(Pf(r,["background","backgroundRepeat"],!0===h?"no-repeat":"repeat"))})]})]});var g}function Aj({resetAllFilter:e,onChange:t,value:n,panelId:r,children:o,headerLabel:i}){return(0,Id.jsx)(nE.A,{as:_A,spacing:4,label:i,resetAll:()=>{const r=e(n);t(r)},panelId:r,dropdownMenuProps:Ey,children:o})}function Ej({as:e=Aj,value:t,onChange:n,inheritedValue:r=t,settings:o,panelId:i,defaultControls:s=vj,defaultValues:a={},headerLabel:l=(0,U.__)("Background image"),themeFileURIs:c}){const u=(0,k.useCallback)((e=>({...e,background:{}})),[]),d=o?.background?.backgroundSize;return(0,Id.jsxs)(e,{resetAllFilter:u,value:t,onChange:n,panelId:i,headerLabel:l,children:[(0,Id.jsx)(Cj,{onChange:n,panelId:i,isShownByDefault:s.backgroundImage,style:t,inheritedValue:r,themeFileURIs:c}),d&&(0,Id.jsx)(Sj,{onChange:n,panelId:i,isShownByDefault:s.backgroundSize,style:t,inheritedValue:r,defaultValues:a,themeFileURIs:c})]})}const Ij="background",jj={backgroundSize:"cover"};function Tj(e,t="any"){const n=Sc(e,Ij);return!!(!0===n||("any"===t?n?.backgroundImage||n?.backgroundSize||n?.backgroundRepeat:n?.[t]))}function Bj(e){return _j(e)?"has-background":""}function Rj({children:e}){const t=(0,k.useCallback)((e=>({...e,style:{...e.style,background:void 0}})),[]);return(0,Id.jsx)(AA,{group:"background",resetAllFilter:t,children:e})}function Nj({clientId:e,name:t,setAttributes:n,settings:r}){const o=(0,Fl.A)((t=>t(uy).getBlockAttributes(e)?.style),[e]);if(!yj(r)||!Tj(t,"backgroundImage"))return null;const i=Sc(t,[Ij,"__experimentalDefaultControls"]),s={...r,background:{...r.background,backgroundSize:r?.background?.backgroundSize&&Tj(t,"backgroundSize")}};return(0,Id.jsx)(Ej,{as:Rj,panelId:e,defaultControls:i,defaultValues:jj,settings:s,onChange:e=>{n({style:Hy(e)})},value:o})}const Dj={useBlockProps:function({name:e,style:t}){if(!Tj(e)||!t?.background?.backgroundImage)return;const n=function(e){if(!e)return;const t=e?.backgroundImage;let n;return t?.url&&(e?.backgroundSize||(n={backgroundSize:"cover"}),"contain"!==e?.backgroundSize||e?.backgroundPosition||(n={backgroundPosition:"center"})),n}(t?.background);return n?{style:{...n}}:void 0},attributeKeys:["style"],hasSupport:Tj};(0,Iu.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.lock)&&void 0!==t?t:{})||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));const Mj=/[\s#]/g,Pj={type:"string",source:"attribute",attribute:"id",selector:"*"},Oj={addSaveProps:function(e,t,n){return Ac(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e},edit:function({anchor:e,setAttributes:t}){if("default"!==AS())return null;const n="web"===Ph.A.OS;return(0,Id.jsx)(AA,{group:"advanced",children:(0,Id.jsx)(GE.A,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,className:"html-anchor-control",label:(0,U.__)("HTML anchor"),help:(0,Id.jsxs)(Id.Fragment,{children:[(0,U.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor”. Then, you’ll be able to link directly to this section of your page."),n&&(0,Id.jsxs)(Id.Fragment,{children:[" ",(0,Id.jsx)(GI.A,{href:(0,U.__)("https://wordpress.org/documentation/article/page-jumps/"),children:(0,U.__)("Learn more about anchors")})]})]}),value:e||"",placeholder:n?null:(0,U.__)("Add an anchor"),onChange:e=>{e=e.replace(Mj,"-"),t({anchor:e})},autoCapitalize:"none",autoComplete:"off"})})},attributeKeys:["anchor"],hasSupport:e=>Ac(e,"anchor")};(0,Iu.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.anchor)&&void 0!==t?t:{})||Ac(e,"anchor")&&(e.attributes={...e.attributes,anchor:Pj}),e}));const Lj={type:"string",source:"attribute",attribute:"aria-label",selector:"*"},Fj={addSaveProps:function(e,t,n){return Ac(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e},attributeKeys:["ariaLabel"],hasSupport:e=>Ac(e,"ariaLabel")};(0,Iu.addFilter)("blocks.registerBlockType","core/ariaLabel/attribute",(function(e){return e?.attributes?.ariaLabel?.type||Ac(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:Lj}),e}));const zj={edit:function({className:e,setAttributes:t}){return"default"!==AS()?null:(0,Id.jsx)(AA,{group:"advanced",children:(0,Id.jsx)(GE.A,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,autoComplete:"off",label:(0,U.__)("Additional CSS class(es)"),value:e||"",onChange:e=>{t({className:""!==e?e:void 0})},help:(0,U.__)("Separate multiple classes with spaces.")})})},addSaveProps:function(e,t,n){return Ac(t,"customClassName",!0)&&n.className&&(e.className=(0,Vy.A)(e.className,n.className)),e},attributeKeys:["className"],hasSupport:e=>Ac(e,"customClassName",!0)};(0,Iu.addFilter)("blocks.registerBlockType","core/editor/custom-class-name/attribute",(function(e){return Ac(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,Iu.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,r){if(!Ac(e.name,"customClassName",!0))return e;if(1===r.length&&e.innerBlocks.length===t.length)return e;if(1===r.length&&t.length>1||r.length>1&&1===t.length)return e;if(t[n]){const r=t[n]?.attributes.className;if(r)return{...e,attributes:{...e.attributes,className:r}}}return e})),(0,Iu.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return Ac(t,"className",!0)&&("string"==typeof e.className?e.className=[...new Set([jd(t.name),...e.className.split(" ")])].join(" ").trim():e.className=jd(t.name)),e}));const Uj=/^([\d.\-+]*)\s*(fr|cm|mm|Q|in|pc|pt|px|em|ex|ch|rem|lh|vw|vh|vmin|vmax|%|cap|ic|rlh|vi|vb|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx|svw|lvw|dvw|svh|lvh|dvh|svi|lvi|dvi|svb|lvb|dvb|svmin|lvmin|dvmin|svmax|lvmax|dvmax)?$/,Vj=["top","right","bottom","left"],Hj=["color","style","width"],$j=e=>!e||!Hj.some((t=>void 0!==e[t])),Wj=e=>!!e&&(Gj(e)?!Vj.every((t=>$j(e[t]))):!$j(e)),Gj=(e={})=>Object.keys(e).some((e=>-1!==Vj.indexOf(e))),qj=e=>{if(!Gj(e))return!1;const t=Vj.map((t=>Kj(e?.[t])));return!t.every((e=>e===t[0]))},Kj=(e,t)=>{if($j(e))return t;const{color:n,style:r,width:o}=t||{},{color:i=n,style:s=r,width:a=o}=e;return[a,a&&"0"!==a||i?s||"solid":s,i].filter(Boolean).join(" ")},Yj=e=>function(e){if(0===e.length)return;const t={};let n,r=0;return e.forEach((e=>{t[e]=void 0===t[e]?1:t[e]+1,t[e]>r&&(n=e,r=t[e])})),n}(e.map((e=>void 0===e?void 0:function(e){const t=e.trim().match(Uj);if(!t)return[void 0,void 0];const[,n,r]=t;let o=parseFloat(n);return o=Number.isNaN(o)?void 0:o,[o,r]}(`${e}`)[1])).filter((e=>void 0!==e)));(0,nc.X$)([rc.A,oc.A]);const{kebabCase:Jj}=wf(c_.j),Xj=(e,t,n)=>{if(t){const n=e?.find((e=>e.slug===t));if(n)return n}return{color:n}},Zj=(e,t)=>e?.find((e=>e.color===t));function Qj(e,t){if(e&&t)return`has-${Jj(t)}-${e}`}function eT(){const[e,t,n,r,o,i,s,a,l,c]=hy("color.custom","color.palette.custom","color.palette.theme","color.palette.default","color.defaultPalette","color.customGradient","color.gradients.custom","color.gradients.theme","color.gradients.default","color.defaultGradients"),u={disableCustomColors:!e,disableCustomGradients:!i};return u.colors=(0,k.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,U._x)("Theme","Indicates this palette comes from the theme."),colors:n}),o&&r&&r.length&&e.push({name:(0,U._x)("Default","Indicates this palette comes from WordPress."),colors:r}),t&&t.length&&e.push({name:(0,U._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[t,n,r,o]),u.gradients=(0,k.useMemo)((()=>{const e=[];return a&&a.length&&e.push({name:(0,U._x)("Theme","Indicates this palette comes from the theme."),gradients:a}),c&&l&&l.length&&e.push({name:(0,U._x)("Default","Indicates this palette comes from WordPress."),gradients:l}),s&&s.length&&e.push({name:(0,U._x)("Custom","Indicates this palette is created by the user."),gradients:s}),e}),[s,a,l,c]),u.hasColorsOrGradients=!!u.colors.length||!!u.gradients.length,u}var tT=n(92982);const nT=(0,$_.css)("",""),rT={name:"bjn8wh",styles:"position:relative"},oT=e=>{const{color:t=W_.l.gray[200],style:n="solid",width:r=G_.A.borderWidth}=e||{};return`${t} ${r&&"0"!==r||t?n||"solid":n} ${r!==G_.A.borderWidth?`clamp(1px, ${r}, 10px)`:r}`},iT={name:"1nwbfnf",styles:"grid-column:span 2;margin:0 auto"};const sT=(0,z_.KZ)(((e,t)=>{const{className:n,isLinked:r,...o}=function(e){const{className:t,size:n="default",...r}=(0,F_.A)(e,"BorderBoxControlLinkedButton"),o=(0,U_.l)();return{...r,className:(0,k.useMemo)((()=>o((e=>(0,$_.css)("position:absolute;top:","__unstable-large"===e?"8px":"3px",";",(0,Ww.h)({right:0})()," line-height:0;",""))(n),t)),[t,o,n])}}(e),i=r?(0,U.__)("Unlink sides"):(0,U.__)("Link sides");return(0,Id.jsx)(Rx.Ay,{text:i,children:(0,Id.jsx)(dx.A,{className:n,children:(0,Id.jsx)(Jy.Ay,{...o,size:"small",icon:r?tT.A:JI.A,iconSize:24,"aria-label":i,ref:t})})})}),"BorderBoxControlLinkedButton");const aT=(0,z_.KZ)(((e,t)=>{const{value:n,...r}=function(e){const{className:t,value:n,size:r="default",...o}=(0,F_.A)(e,"BorderBoxControlVisualizer"),i=(0,U_.l)();return{...o,className:(0,k.useMemo)((()=>i(((e,t)=>(0,$_.css)("position:absolute;top:","__unstable-large"===t?"20px":"15px",";right:","__unstable-large"===t?"39px":"29px",";bottom:","__unstable-large"===t?"20px":"15px",";left:","__unstable-large"===t?"39px":"29px",";border-top:",oT(e?.top),";border-bottom:",oT(e?.bottom),";",(0,Ww.h)({borderLeft:oT(e?.left)})()," ",(0,Ww.h)({borderRight:oT(e?.right)})(),";",""))(n,r),t)),[i,t,n,r]),value:n}}(e);return(0,Id.jsx)(dx.A,{...r,ref:t})}),"BorderBoxControlVisualizer");var lT=n(63254),cT=n(83358),uT=n(32632),dT=n(72825);const hT=[{label:(0,U.__)("Solid"),icon:cT.A,value:"solid"},{label:(0,U.__)("Dashed"),icon:uT.A,value:"dashed"},{label:(0,U.__)("Dotted"),icon:dT.A,value:"dotted"}],pT=(0,z_.KZ)((function({onChange:e,...t},n){return(0,Id.jsx)(_x,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,ref:n,isDeselectable:!0,onChange:t=>{e?.(t)},...t,children:hT.map((e=>(0,Id.jsx)(zx,{value:e.value,icon:e.icon,label:e.label},e.value)))})}),"BorderControlStylePicker"),fT=pT,mT=(0,k.forwardRef)((function(e,t){const{className:n,colorValue:r,...o}=e;return(0,Id.jsx)("span",{className:(0,Vy.A)("component-color-indicator",n),style:{background:r},ref:t,...o})}));var gT=n(16228),bT=n(64364),vT=n(71612),yT=n(22223);const _T=(0,H_.default)(Gw.A,{target:"ez9hsf47"})("width:",(0,Kw.x)(24),";"),xT=(0,H_.default)(vT.A,{target:"ez9hsf46"})("margin-left:",(0,Kw.x)(-2),";width:5em;"),wT=(0,H_.default)(OC,{target:"ez9hsf45"})("flex:1;margin-right:",(0,Kw.x)(2),";"),kT=`\n.react-colorful__interactive {\n\twidth: calc( 100% - ${(0,Kw.x)(2)} );\n\tmargin-left: ${(0,Kw.x)(1)};\n}`,CT=(0,H_.default)("div",{target:"ez9hsf44"})("padding-top:",(0,Kw.x)(2),";padding-right:0;padding-left:0;padding-bottom:0;"),ST=(0,H_.default)(QS.A,{target:"ez9hsf43"})("padding-left:",(0,Kw.x)(4),";padding-right:",(0,Kw.x)(4),";"),AT=(0,H_.default)(j_.A,{target:"ez9hsf42"})("padding-top:",(0,Kw.x)(4),";padding-left:",(0,Kw.x)(4),";padding-right:",(0,Kw.x)(3),";padding-bottom:",(0,Kw.x)(5),";"),ET=(0,H_.default)("div",{target:"ez9hsf41"})(yT.r,";width:216px;.react-colorful{display:flex;flex-direction:column;align-items:center;width:216px;height:auto;}.react-colorful__saturation{width:100%;border-radius:0;height:216px;margin-bottom:",(0,Kw.x)(4),";border-bottom:none;}.react-colorful__hue,.react-colorful__alpha{width:184px;height:16px;border-radius:16px;margin-bottom:",(0,Kw.x)(2),";}.react-colorful__pointer{height:16px;width:16px;border:none;box-shadow:0 0 2px 0 rgba( 0, 0, 0, 0.25 );outline:2px solid transparent;}.react-colorful__pointer-fill{box-shadow:inset 0 0 0 ",G_.A.borderWidthFocus," #fff;}",kT,";"),IT=(0,H_.default)(Jy.Ay,{target:"ez9hsf40"})("&&&&&{min-width:",(0,Kw.x)(6),";padding:0;>svg{margin-right:0;}}");var jT=n(11551);const TT=e=>{const{color:t,colorType:n}=e,[r,o]=(0,k.useState)(null),i=(0,k.useRef)(),s=(0,qI.A)((()=>{switch(n){case"hsl":return t.toHslString();case"rgb":return t.toRgbString();default:return t.toHex()}}),(()=>{i.current&&clearTimeout(i.current),o(t.toHex()),i.current=setTimeout((()=>{o(null),i.current=void 0}),3e3)}));return(0,k.useEffect)((()=>()=>{i.current&&clearTimeout(i.current)}),[]),(0,Id.jsx)(Rx.Ay,{delay:0,hideOnClick:!1,text:r===t.toHex()?(0,U.__)("Copied!"):(0,U.__)("Copy"),children:(0,Id.jsx)(IT,{size:"small",ref:s,icon:jT.A,showTooltip:!1})})};var BT=n(98232),RT=n(43735);const NT=({min:e,max:t,label:n,abbreviation:r,onChange:o,value:i})=>(0,Id.jsxs)(QS.A,{spacing:4,children:[(0,Id.jsx)(_T,{min:e,max:t,label:n,hideLabelFromVision:!0,value:i,onChange:e=>{o(e?"string"!=typeof e?e:parseInt(e,10):0)},prefix:(0,Id.jsx)(RT.A,{as:BT.A,paddingLeft:(0,Kw.x)(4),color:W_.l.theme.accent,lineHeight:1,children:r}),spinControls:"none",size:"__unstable-large"}),(0,Id.jsx)(wT,{__nextHasNoMarginBottom:!0,label:n,hideLabelFromVision:!0,min:e,max:t,value:i,onChange:o,withInputField:!1})]}),DT=({color:e,onChange:t,enableAlpha:n})=>{const{r,g:o,b:i,a:s}=e.toRgb();return(0,Id.jsxs)(Id.Fragment,{children:[(0,Id.jsx)(NT,{min:0,max:255,label:"Red",abbreviation:"R",value:r,onChange:e=>t((0,nc.Mj)({r:e,g:o,b:i,a:s}))}),(0,Id.jsx)(NT,{min:0,max:255,label:"Green",abbreviation:"G",value:o,onChange:e=>t((0,nc.Mj)({r,g:e,b:i,a:s}))}),(0,Id.jsx)(NT,{min:0,max:255,label:"Blue",abbreviation:"B",value:i,onChange:e=>t((0,nc.Mj)({r,g:o,b:e,a:s}))}),n&&(0,Id.jsx)(NT,{min:0,max:100,label:"Alpha",abbreviation:"A",value:Math.trunc(100*s),onChange:e=>t((0,nc.Mj)({r,g:o,b:i,a:e/100}))})]})},MT=({color:e,onChange:t,enableAlpha:n})=>{const r=(0,k.useMemo)((()=>e.toHsl()),[e]),[o,i]=(0,k.useState)({...r}),s=e.isEqual((0,nc.Mj)(o));(0,k.useEffect)((()=>{s||i(r)}),[r,s]);const a=s?o:r,l=n=>{const r=(0,nc.Mj)({...a,...n});e.isEqual(r)?i((e=>({...e,...n}))):t(r)};return(0,Id.jsxs)(Id.Fragment,{children:[(0,Id.jsx)(NT,{min:0,max:359,label:"Hue",abbreviation:"H",value:a.h,onChange:e=>{l({h:e})}}),(0,Id.jsx)(NT,{min:0,max:100,label:"Saturation",abbreviation:"S",value:a.s,onChange:e=>{l({s:e})}}),(0,Id.jsx)(NT,{min:0,max:100,label:"Lightness",abbreviation:"L",value:a.l,onChange:e=>{l({l:e})}}),n&&(0,Id.jsx)(NT,{min:0,max:100,label:"Alpha",abbreviation:"A",value:Math.trunc(100*a.a),onChange:e=>{l({a:e/100})}})]})};var PT=n(8967);const OT=({color:e,onChange:t,enableAlpha:n})=>(0,Id.jsx)(PT.ey,{prefix:(0,Id.jsx)(RT.A,{as:BT.A,marginLeft:(0,Kw.x)(4),color:W_.l.theme.accent,lineHeight:1,children:"#"}),value:e.toHex().slice(1).toUpperCase(),onChange:e=>{if(!e)return;const n=e.startsWith("#")?e:"#"+e;t((0,nc.Mj)(n))},maxLength:n?9:7,label:(0,U.__)("Hex color"),hideLabelFromVision:!0,size:"__unstable-large",__unstableStateReducer:(e,t)=>{const n=t.payload?.event?.nativeEvent;if("insertFromPaste"!==n?.inputType)return{...e};const r=e.value?.startsWith("#")?e.value.slice(1).toUpperCase():e.value?.toUpperCase();return{...e,value:r}},__unstableInputWidth:"9em"}),LT=({colorType:e,color:t,onChange:n,enableAlpha:r})=>{const o={color:t,onChange:n,enableAlpha:r};switch(e){case"hsl":return(0,Id.jsx)(MT,{...o});case"rgb":return(0,Id.jsx)(DT,{...o});default:return(0,Id.jsx)(OT,{...o})}};function FT(){return(FT=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}function UT(e){var t=(0,k.useRef)(e),n=(0,k.useRef)((function(e){t.current&&t.current(e)}));return t.current=e,n.current}var VT=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e0:e.buttons>0)&&o.current?i(WT(o.current,e,a.current)):n(!1)},t=function(){return n(!1)};function n(n){var r=l.current,i=$T(o.current),s=n?i.addEventListener:i.removeEventListener;s(r?"touchmove":"mousemove",e),s(r?"touchend":"mouseup",t)}return[function(e){var t=e.nativeEvent,r=o.current;if(r&&(GT(t),!function(e,t){return t&&!HT(e)}(t,l.current)&&r)){if(HT(t)){l.current=!0;var s=t.changedTouches||[];s.length&&(a.current=s[0].identifier)}r.focus(),i(WT(r,t,a.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),s({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},n]}),[s,i]),u=c[0],d=c[1],h=c[2];return(0,k.useEffect)((function(){return h}),[h]),k.createElement("div",FT({},r,{onTouchStart:u,onMouseDown:u,className:"react-colorful__interactive",ref:o,onKeyDown:d,tabIndex:0,role:"slider"}))})),KT=function(e){return e.filter(Boolean).join(" ")},YT=function(e){var t=e.color,n=e.left,r=e.top,o=void 0===r?.5:r,i=KT(["react-colorful__pointer",e.className]);return k.createElement("div",{className:i,style:{top:100*o+"%",left:100*n+"%"}},k.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},JT=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n},XT=(Math.PI,function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:JT(e.h),s:JT(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:JT(o/2),a:JT(r,2)}}),ZT=function(e){var t=XT(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},QT=function(e){var t=XT(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},eB=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),s=r*(1-n),a=r*(1-(t-i)*n),l=r*(1-(1-t+i)*n),c=i%6;return{r:JT(255*[r,a,s,s,l,r][c]),g:JT(255*[l,r,r,a,s,s][c]),b:JT(255*[s,s,l,r,r,a][c]),a:JT(o,2)}},tB=function(e){var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?rB({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}},nB=tB,rB=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=Math.max(t,n,r),s=i-Math.min(t,n,r),a=s?i===t?(n-r)/s:i===n?2+(r-t)/s:4+(t-n)/s:0;return{h:JT(60*(a<0?a+6:a)),s:JT(i?s/i*100:0),v:JT(i/255*100),a:o}},oB=k.memo((function(e){var t=e.hue,n=e.onChange,r=KT(["react-colorful__hue",e.className]);return k.createElement("div",{className:r},k.createElement(qT,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:VT(t+360*e.left,0,360)})},"aria-label":"Hue","aria-valuenow":JT(t),"aria-valuemax":"360","aria-valuemin":"0"},k.createElement(YT,{className:"react-colorful__hue-pointer",left:t/360,color:ZT({h:t,s:100,v:100,a:1})})))})),iB=k.memo((function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:ZT({h:t.h,s:100,v:100,a:1})};return k.createElement("div",{className:"react-colorful__saturation",style:r},k.createElement(qT,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:VT(t.s+100*e.left,0,100),v:VT(t.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+JT(t.s)+"%, Brightness "+JT(t.v)+"%"},k.createElement(YT,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:ZT(t)})))})),sB=function(e,t){return e.replace(/\s/g,"")===t.replace(/\s/g,"")};function aB(e,t,n){var r=UT(n),o=(0,k.useState)((function(){return e.toHsva(t)})),i=o[0],s=o[1],a=(0,k.useRef)({color:t,hsva:i});(0,k.useEffect)((function(){if(!e.equal(t,a.current.color)){var n=e.toHsva(t);a.current={hsva:n,color:t},s(n)}}),[t,e]),(0,k.useEffect)((function(){var t;(function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0})(i,a.current.hsva)||e.equal(t=e.fromHsva(i),a.current.color)||(a.current={hsva:i,color:t},r(t))}),[i,e,r]);var l=(0,k.useCallback)((function(e){s((function(t){return Object.assign({},t,e)}))}),[]);return[i,l]}var lB="undefined"!=typeof window?k.useLayoutEffect:k.useEffect,cB=new Map,uB=function(e){lB((function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!cB.has(t)){var r=t.createElement("style");r.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',cB.set(t,r);var o=n.nc;o&&r.setAttribute("nonce",o),t.head.appendChild(r)}}),[])},dB=function(e){var t=e.className,n=e.colorModel,r=e.color,o=void 0===r?n.defaultColor:r,i=e.onChange,s=zT(e,["className","colorModel","color","onChange"]),a=(0,k.useRef)(null);uB(a);var l=aB(n,o,i),c=l[0],u=l[1],d=KT(["react-colorful",t]);return k.createElement("div",FT({},s,{ref:a,className:d}),k.createElement(iB,{hsva:c,onChange:u}),k.createElement(oB,{hue:c.h,onChange:u,className:"react-colorful__last-control"}))},hB=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+QT(Object.assign({},n,{a:0}))+", "+QT(Object.assign({},n,{a:1}))+")"},i=KT(["react-colorful__alpha",t]),s=JT(100*n.a);return k.createElement("div",{className:i},k.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),k.createElement(qT,{onMove:function(e){r({a:e.left})},onKey:function(e){r({a:VT(n.a+e.left)})},"aria-label":"Alpha","aria-valuetext":s+"%","aria-valuenow":s,"aria-valuemin":"0","aria-valuemax":"100"},k.createElement(YT,{className:"react-colorful__alpha-pointer",left:n.a,color:QT(n)})))},pB=function(e){var t=e.className,n=e.colorModel,r=e.color,o=void 0===r?n.defaultColor:r,i=e.onChange,s=zT(e,["className","colorModel","color","onChange"]),a=(0,k.useRef)(null);uB(a);var l=aB(n,o,i),c=l[0],u=l[1],d=KT(["react-colorful",t]);return k.createElement("div",FT({},s,{ref:a,className:d}),k.createElement(iB,{hsva:c,onChange:u}),k.createElement(oB,{hue:c.h,onChange:u}),k.createElement(hB,{hsva:c,onChange:u,className:"react-colorful__last-control"}))},fB={defaultColor:"rgba(0, 0, 0, 1)",toHsva:tB,fromHsva:function(e){var t=eB(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"},equal:sB},mB=function(e){return k.createElement(pB,FT({},e,{colorModel:fB}))},gB={defaultColor:"rgb(0, 0, 0)",toHsva:nB,fromHsva:function(e){var t=eB(e);return"rgb("+t.r+", "+t.g+", "+t.b+")"},equal:sB},bB=function(e){return k.createElement(dB,FT({},e,{colorModel:gB}))};const vB=({color:e,enableAlpha:t,onChange:n})=>{const r=t?mB:bB,o=(0,k.useMemo)((()=>e.toRgbString()),[e]);return(0,Id.jsx)(r,{color:o,onChange:e=>{n((0,nc.Mj)(e))},onPointerDown:({currentTarget:e,pointerId:t})=>{e.setPointerCapture(t)},onPointerUp:({currentTarget:e,pointerId:t})=>{e.releasePointerCapture(t)}})};(0,nc.X$)([rc.A]);const yB=[{label:"RGB",value:"rgb"},{label:"HSL",value:"hsl"},{label:"Hex",value:"hex"}],_B={InputBase:{isBorderless:!0}},xB=(0,z_.KZ)(((e,t)=>{const{enableAlpha:n=!1,color:r,onChange:o,defaultValue:i="#fff",copyFormat:s,...a}=(0,F_.A)(e,"ColorPicker"),[l,c]=(0,bx.j)({onChange:o,value:r,defaultValue:i}),u=(0,k.useMemo)((()=>(0,nc.Mj)(l||"")),[l]),d=(0,gT.A)(c),h=(0,k.useCallback)((e=>{d(e.toHex())}),[d]),[p,f]=(0,k.useState)(s||"hex");return(0,Id.jsxs)(ET,{ref:t,...a,children:[(0,Id.jsx)(vB,{onChange:h,color:u,enableAlpha:n}),(0,Id.jsxs)(CT,{children:[(0,Id.jsxs)(ST,{justify:"space-between",children:[(0,Id.jsx)(bT.c7,{value:_B,children:(0,Id.jsx)(xT,{__nextHasNoMarginBottom:!0,options:yB,value:p,onChange:e=>f(e),label:(0,U.__)("Color format"),hideLabelFromVision:!0})}),(0,Id.jsx)(TT,{color:u,colorType:s||p})]}),(0,Id.jsx)(AT,{direction:"column",gap:2,children:(0,Id.jsx)(LT,{colorType:p,color:u,onChange:h,enableAlpha:n})})]})]})}),"ColorPicker");function wB(e){if(void 0!==e)return"string"==typeof e?e:e.hex?e.hex:void 0}const kB=(0,vh.A)((e=>{const t=(0,nc.Mj)(e),n=t.toHex(),r=t.toRgb(),o=t.toHsv(),i=t.toHsl();return{hex:n,rgb:r,hsv:o,hsl:i,source:"hex",oldHue:i.h}}));function CB(e){const{onChangeComplete:t}=e,n=(0,k.useCallback)((e=>{t(kB(e))}),[t]);return function(e){return void 0!==e.onChangeComplete||void 0!==e.disableAlpha||"string"==typeof e.color?.hex}(e)?{color:wB(e.color),enableAlpha:!e.disableAlpha,onChange:n}:{...e,color:e.color,enableAlpha:e.enableAlpha,onChange:e.onChange}}const SB=e=>(0,Id.jsx)(xB,{...CB(e)}),AB=(0,k.createContext)({});var EB=n(8748);const IB=(0,k.forwardRef)((function(e,t){const{isPressed:n,...r}=e;return(0,Id.jsx)(Jy.Ay,{...r,"aria-pressed":n,ref:t})})),jB=(0,k.forwardRef)((function(e,t){const{id:n,isSelected:r,compositeStore:o,...i}=e,s=o.useState("activeId");return r&&!s&&o.setActiveId(n),(0,Id.jsx)(EB.l,{render:(0,Id.jsx)(Jy.Ay,{...i,role:"option","aria-selected":!!r,ref:t}),store:o,id:n})}));function TB(e){const{actions:t,options:n,baseId:r,className:o,loop:i=!0,children:s,...a}=e,l=(0,X_.q)({focusLoop:i,rtl:(0,U.isRTL)()}),c={baseId:r,compositeStore:l};return(0,Id.jsx)("div",{className:o,children:(0,Id.jsxs)(AB.Provider,{value:c,children:[(0,Id.jsx)(ix.e,{...a,id:r,store:l,role:"listbox",children:n}),s,t]})})}function BB(e){const{actions:t,options:n,children:r,baseId:o,...i}=e;return(0,Id.jsx)("div",{...i,id:o,children:(0,Id.jsxs)(AB.Provider,{value:{baseId:o},children:[n,r,t]})})}function RB(e){const{asButtons:t,actions:n,options:r,children:o,className:i,...s}=e,a=(0,L_.A)(RB,"components-circular-option-picker",s.id),l=t?BB:TB,c=n?(0,Id.jsx)("div",{className:"components-circular-option-picker__custom-clear-wrapper",children:n}):void 0,u=(0,Id.jsx)("div",{className:"components-circular-option-picker__swatches",children:r});return(0,Id.jsx)(l,{...s,baseId:a,className:(0,Vy.A)("components-circular-option-picker",i),actions:c,options:u,children:o})}RB.Option=function e({className:t,isSelected:n,selectedIconProps:r={},tooltipText:o,...i}){const{baseId:s,compositeStore:a}=(0,k.useContext)(AB),l={id:(0,L_.A)(e,s||"components-circular-option-picker__option"),className:"components-circular-option-picker__option",...i},c=a?(0,Id.jsx)(jB,{...l,compositeStore:a,isSelected:n}):(0,Id.jsx)(IB,{...l,isPressed:n});return(0,Id.jsxs)("div",{className:(0,Vy.A)(t,"components-circular-option-picker__option-wrapper"),children:[o?(0,Id.jsx)(Rx.Ay,{text:o,children:c}):c,n&&(0,Id.jsx)(sk.A,{icon:JS.A,...r})]})},RB.OptionGroup=function({className:e,options:t,...n}){const r="aria-label"in n||"aria-labelledby"in n?"group":void 0;return(0,Id.jsx)("div",{...n,role:r,className:(0,Vy.A)("components-circular-option-picker__option-group","components-circular-option-picker__swatches",e),children:t})},RB.ButtonAction=function({className:e,children:t,...n}){return(0,Id.jsx)(Jy.Ay,{className:(0,Vy.A)("components-circular-option-picker__clear",e),variant:"tertiary",...n,children:t})},RB.DropdownLinkAction=function({buttonProps:e,className:t,dropdownProps:n,linkText:r}){return(0,Id.jsx)(DE.A,{className:(0,Vy.A)("components-circular-option-picker__dropdown-link-action",t),renderToggle:({isOpen:t,onToggle:n})=>(0,Id.jsx)(Jy.Ay,{"aria-expanded":t,"aria-haspopup":"true",onClick:n,variant:"link",...e,children:r}),...n})};const NB=RB,DB=(0,H_.default)(eA.A,{target:"ev9wop70"})({name:"13lxv2o",styles:"text-transform:uppercase;line-height:24px;font-weight:500;&&&{font-size:11px;margin-bottom:0;}"}),MB=({paddingSize:e="small"})=>{if("none"===e)return;const t={small:(0,Kw.x)(2),medium:(0,Kw.x)(4)};return(0,$_.css)("padding:",t[e]||t.small,";","")},PB=(0,H_.default)("div",{target:"eovvns30"})("margin-left:",(0,Kw.x)(-2),";margin-right:",(0,Kw.x)(-2),";&:first-of-type{margin-top:",(0,Kw.x)(-2),";}&:last-of-type{margin-bottom:",(0,Kw.x)(-2),";}",MB,";"),OB=(0,z_.KZ)((function(e,t){const{paddingSize:n="small",...r}=(0,F_.A)(e,"DropdownContentWrapper");return(0,Id.jsx)(PB,{...r,paddingSize:n,ref:t})}),"DropdownContentWrapper");(0,nc.X$)([rc.A,oc.A]);const LB=e=>e.length>0&&e.every((e=>{return t=e,Array.isArray(t.colors)&&!("color"in t);var t}));function FB({className:e,clearColor:t,colors:n,onChange:r,value:o,...i}){const s=(0,k.useMemo)((()=>n.map((({color:e,name:n},i)=>{const s=(0,nc.Mj)(e),a=o===e;return(0,Id.jsx)(NB.Option,{isSelected:a,selectedIconProps:a?{fill:s.contrast()>s.contrast("#000")?"#fff":"#000"}:{},tooltipText:n||(0,U.sprintf)((0,U.__)("Color code: %s"),e),style:{backgroundColor:e,color:e},onClick:a?t:()=>r(e,i),"aria-label":n?(0,U.sprintf)((0,U.__)("Color: %s"),n):(0,U.sprintf)((0,U.__)("Color code: %s"),e)},`${e}-${i}`)}))),[n,o,r,t]);return(0,Id.jsx)(NB.OptionGroup,{className:e,options:s,...i})}function zB({className:e,clearColor:t,colors:n,onChange:r,value:o,headingLevel:i}){const s=(0,L_.A)(zB,"color-palette");return 0===n.length?null:(0,Id.jsx)(nE.A,{spacing:3,className:e,children:n.map((({name:e,colors:n},a)=>{const l=`${s}-${a}`;return(0,Id.jsxs)(nE.A,{spacing:2,children:[(0,Id.jsx)(DB,{id:l,level:i,children:e}),(0,Id.jsx)(FB,{clearColor:t,colors:n,onChange:e=>r(e,a),value:o,"aria-labelledby":l})]},a)}))})}function UB({isRenderedInSidebar:e,popoverProps:t,...n}){const r=(0,k.useMemo)((()=>({shift:!0,resize:!1,...e?{placement:"left-start",offset:34}:{placement:"bottom",offset:8},...t})),[e,t]);return(0,Id.jsx)(DE.A,{contentClassName:"components-color-palette__custom-color-dropdown-content",popoverProps:r,...n})}(0,nc.X$)([rc.A,oc.A]);const VB=(0,k.forwardRef)((function(e,t){const{asButtons:n,loop:r,clearable:o=!0,colors:i=[],disableCustomColors:s=!1,enableAlpha:a=!1,onChange:l,value:c,__experimentalIsRenderedInSidebar:u=!1,headingLevel:d=2,"aria-label":h,"aria-labelledby":p,...f}=e,[m,g]=(0,k.useState)(c),b=(0,k.useCallback)((()=>l(void 0)),[l]),v=(0,k.useCallback)((e=>{g(((e,t)=>{if(!/^var\(/.test(null!=e?e:"")||null===t)return e;const{ownerDocument:n}=t,{defaultView:r}=n,o=r?.getComputedStyle(t).backgroundColor;return o?(0,nc.Mj)(o).toHex():e})(c,e))}),[c]),y=LB(i),_=(0,k.useMemo)((()=>((e,t=[],n=!1)=>{if(!e)return"";const r=/^var\(/.test(e),o=r?e:(0,nc.Mj)(e).toHex(),i=n?t:[{colors:t}];for(const{colors:e}of i)for(const{name:t,color:n}of e)if(o===(r?n:(0,nc.Mj)(n).toHex()))return t;return(0,U.__)("Custom")})(c,i,y)),[c,i,y]),x=c?.startsWith("#"),w=c?.replace(/^var\((.+)\)$/,"$1"),C=w?(0,U.sprintf)((0,U.__)('Custom color picker. The currently selected color is called "%1$s" and has a value of "%2$s".'),_,w):(0,U.__)("Custom color picker."),S={clearColor:b,onChange:l,value:c},A=!!o&&(0,Id.jsx)(NB.ButtonAction,{onClick:b,children:(0,U.__)("Clear")});let E;if(n)E={asButtons:!0};else{const e={asButtons:!1,loop:r};E=h?{...e,"aria-label":h}:p?{...e,"aria-labelledby":p}:{...e,"aria-label":(0,U.__)("Custom color picker.")}}return(0,Id.jsxs)(nE.A,{spacing:3,ref:t,...f,children:[!s&&(0,Id.jsx)(UB,{isRenderedInSidebar:u,renderContent:()=>(0,Id.jsx)(OB,{paddingSize:"none",children:(0,Id.jsx)(SB,{color:m,onChange:e=>l(e),enableAlpha:a})}),renderToggle:({isOpen:e,onToggle:t})=>(0,Id.jsxs)(nE.A,{className:"components-color-palette__custom-color-wrapper",spacing:0,children:[(0,Id.jsx)("button",{ref:v,className:"components-color-palette__custom-color-button","aria-expanded":e,"aria-haspopup":"true",onClick:t,"aria-label":C,style:{background:c},type:"button"}),(0,Id.jsxs)(nE.A,{className:"components-color-palette__custom-color-text-wrapper",spacing:.5,children:[(0,Id.jsx)(HA.A,{className:"components-color-palette__custom-color-name",children:c?_:(0,U.__)("No color selected")}),(0,Id.jsx)(HA.A,{className:(0,Vy.A)("components-color-palette__custom-color-value",{"components-color-palette__custom-color-value--is-hex":x}),children:w})]})]})}),(0,Id.jsx)(NB,{...E,actions:A,options:y?(0,Id.jsx)(zB,{...S,headingLevel:d,colors:i,value:c}):(0,Id.jsx)(FB,{...S,colors:i,value:c})})]})})),HB=VB,$B={name:"f3vz0n",styles:"font-weight:500"},WB=(0,$_.css)("box-shadow:inset ",G_.A.controlBoxShadowFocus,";",""),GB=(0,$_.css)("border:0;padding:0;margin:0;",yT.r,";",""),qB=(0,$_.css)(Yw,"{flex:0 0 auto;}",""),KB=(0,$_.css)("background:#fff;&&>button{aspect-ratio:1;padding:0;display:flex;align-items:center;justify-content:center;",(0,Ww.h)({borderRadius:"2px 0 0 2px"},{borderRadius:"0 2px 2px 0"})()," border:",G_.A.borderWidth," solid ",W_.l.ui.border,";&:focus,&:hover:not( :disabled ){",WB," border-color:",W_.l.ui.borderFocus,";z-index:1;position:relative;}}",""),YB=(0,$_.css)("width:",228,"px;>div:first-of-type>",tA.Gw,"{margin-bottom:0;",$B,";}&& ",tA.Gw,"+button:not( .has-text ){min-width:24px;padding:0;}",""),JB=(0,$_.css)("",""),XB=(0,$_.css)("",""),ZB=(0,$_.css)("justify-content:center;width:100%;&&{border-top:",G_.A.borderWidth," solid ",W_.l.gray[400],";border-top-left-radius:0;border-top-right-radius:0;height:40px;}",""),QB=e=>e.replace(/^var\((.+)\)$/,"$1"),eR=(0,z_.KZ)(((e,t)=>{const{__experimentalIsRenderedInSidebar:n,border:r,colors:o,disableCustomColors:i,enableAlpha:s,enableStyle:a,indicatorClassName:l,indicatorWrapperClassName:c,isStyleSettable:u,onReset:d,onColorChange:h,onStyleChange:p,popoverContentClassName:f,popoverControlsClassName:m,resetButtonClassName:g,showDropdownHeader:b,size:v,__unstablePopoverProps:y,..._}=function(e){const{border:t,className:n,colors:r=[],enableAlpha:o=!1,enableStyle:i=!0,onChange:s,previousStyleSelection:a,size:l="default",__experimentalIsRenderedInSidebar:c=!1,...u}=(0,F_.A)(e,"BorderControlDropdown"),[d]=Hw(t?.width),h=0===d,p=(0,U_.l)(),f=(0,k.useMemo)((()=>p(KB,n)),[n,p]),m=(0,k.useMemo)((()=>p(XB)),[p]),g=(0,k.useMemo)((()=>p(((e,t)=>{const{style:n}=e||{};return(0,$_.css)("border-radius:9999px;border:2px solid transparent;",n?(e=>{const{color:t,style:n}=e||{},r=n&&"none"!==n?W_.l.gray[300]:void 0;return(0,$_.css)("border-style:","none"===n?"solid":n,";border-color:",t||r,";","")})(e):void 0," width:","__unstable-large"===t?"24px":"22px",";height:","__unstable-large"===t?"24px":"22px",";padding:","__unstable-large"===t?"2px":"1px",";&>span{height:",(0,Kw.x)(4),";width:",(0,Kw.x)(4),";background:linear-gradient(\n\t\t\t\t-45deg,\n\t\t\t\ttransparent 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 52%,\n\t\t\t\ttransparent 52%\n\t\t\t);}","")})(t,l))),[t,p,l]),b=(0,k.useMemo)((()=>p(YB)),[p]),v=(0,k.useMemo)((()=>p(JB)),[p]),y=(0,k.useMemo)((()=>p(ZB)),[p]);return{...u,border:t,className:f,colors:r,enableAlpha:o,enableStyle:i,indicatorClassName:m,indicatorWrapperClassName:g,onColorChange:e=>{s({color:e,style:"none"===t?.style?a:t?.style,width:h&&e?"1px":t?.width})},onStyleChange:e=>{const n=h&&e?"1px":t?.width;s({...t,style:e,width:n})},onReset:()=>{s({...t,color:void 0,style:void 0})},popoverContentClassName:v,popoverControlsClassName:b,resetButtonClassName:y,size:l,__experimentalIsRenderedInSidebar:c}}(e),{color:x,style:w}=r||{},C=((e,t)=>{if(e&&t){if(LB(t)){let n;return t.some((t=>t.colors.some((t=>t.color===e&&(n=t,!0))))),n}return t.find((t=>t.color===e))}})(x,o),S=((e,t,n,r)=>{if(r){if(t){const e=QB(t.color);return n?(0,U.sprintf)('Border color and style picker. The currently selected color is called "%1$s" and has a value of "%2$s". The currently selected style is "%3$s".',t.name,e,n):(0,U.sprintf)('Border color and style picker. The currently selected color is called "%1$s" and has a value of "%2$s".',t.name,e)}if(e){const t=QB(e);return n?(0,U.sprintf)('Border color and style picker. The currently selected color has a value of "%1$s". The currently selected style is "%2$s".',t,n):(0,U.sprintf)('Border color and style picker. The currently selected color has a value of "%1$s".',t)}return(0,U.__)("Border color and style picker.")}return t?(0,U.sprintf)('Border color picker. The currently selected color is called "%1$s" and has a value of "%2$s".',t.name,QB(t.color)):e?(0,U.sprintf)('Border color picker. The currently selected color has a value of "%1$s".',QB(e)):(0,U.__)("Border color picker.")})(x,C,w,a),A=x||w&&"none"!==w,E=n?"bottom left":void 0;return(0,Id.jsx)(DE.A,{renderToggle:({onToggle:e})=>(0,Id.jsx)(Jy.Ay,{onClick:e,variant:"tertiary","aria-label":S,tooltipPosition:E,label:(0,U.__)("Border color and style picker"),showTooltip:!0,__next40pxDefaultSize:"__unstable-large"===v,children:(0,Id.jsx)("span",{className:c,children:(0,Id.jsx)(mT,{className:l,colorValue:x})})}),renderContent:({onClose:e})=>(0,Id.jsxs)(Id.Fragment,{children:[(0,Id.jsx)(OB,{paddingSize:"medium",children:(0,Id.jsxs)(nE.A,{className:m,spacing:6,children:[b?(0,Id.jsxs)(QS.A,{children:[(0,Id.jsx)(tA.Gw,{children:(0,U.__)("Border color")}),(0,Id.jsx)(Jy.Ay,{size:"small",label:(0,U.__)("Close border color"),icon:lT.A,onClick:e})]}):void 0,(0,Id.jsx)(HB,{className:f,value:x,onChange:h,colors:o,disableCustomColors:i,__experimentalIsRenderedInSidebar:n,clearable:!1,enableAlpha:s}),a&&u&&(0,Id.jsx)(fT,{label:(0,U.__)("Style"),value:w,onChange:p})]})}),A&&(0,Id.jsx)(OB,{paddingSize:"none",children:(0,Id.jsx)(Jy.Ay,{className:g,variant:"tertiary",onClick:()=>{d(),e()},children:(0,U.__)("Reset")})})]}),popoverProps:{...y},..._,ref:t})}),"BorderControlDropdown"),tR=eR,nR=e=>void 0!==e?.width&&""!==e.width||void 0!==e?.color;const rR=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,Id.jsx)($A.A,{as:"legend",children:t}):(0,Id.jsx)(tA.Gw,{as:"legend",children:t}):null},oR=(0,z_.KZ)(((e,t)=>{const{__next40pxDefaultSize:n=!1,colors:r,disableCustomColors:o,disableUnits:i,enableAlpha:s,enableStyle:a,hideLabelFromVision:l,innerWrapperClassName:c,inputWidth:u,isStyleSettable:d,label:h,onBorderChange:p,onSliderChange:f,onWidthChange:m,placeholder:g,__unstablePopoverProps:b,previousStyleSelection:v,showDropdownHeader:y,size:_,sliderClassName:x,value:w,widthUnit:C,widthValue:S,withSlider:A,__experimentalIsRenderedInSidebar:E,...I}=function(e){const{className:t,colors:n=[],isCompact:r,onChange:o,enableAlpha:i=!0,enableStyle:s=!0,shouldSanitizeBorder:a=!0,size:l="default",value:c,width:u,__experimentalIsRenderedInSidebar:d=!1,__next40pxDefaultSize:h,...p}=(0,F_.A)(e,"BorderControl"),f="default"===l&&h?"__unstable-large":l,[m,g]=Hw(c?.width),b=g||"px",v=0===m,[y,_]=(0,k.useState)(),[x,w]=(0,k.useState)(),C=!a||nR(c),S=(0,k.useCallback)((e=>{!a||nR(e)?o(e):o(void 0)}),[o,a]),A=(0,k.useCallback)((e=>{const t=""===e?void 0:e,[n]=Hw(e),r=0===n,o={...c,width:t};r&&!v&&(_(c?.color),w(c?.style),o.color=void 0,o.style="none"),!r&&v&&(void 0===o.color&&(o.color=y),"none"===o.style&&(o.style=x)),S(o)}),[c,v,y,x,S]),E=(0,k.useCallback)((e=>{A(`${e}${b}`)}),[A,b]),I=(0,U_.l)(),j=(0,k.useMemo)((()=>I(GB,t)),[t,I]);let T=u;r&&(T="__unstable-large"===l?"116px":"90px");const B=(0,k.useMemo)((()=>{const e=!!T&&qB,t=(e=>(0,$_.css)("height:","__unstable-large"===e?"40px":"30px",";",""))(f);return I((0,$_.css)(Yw,"{flex:1 1 40%;}&& ",Qw,"{min-height:0;}",""),e,t)}),[T,I,f]),R=(0,k.useMemo)((()=>I((0,$_.css)("flex:1 1 60%;",(0,Ww.h)({marginRight:(0,Kw.x)(3)})(),";",""))),[I]);return{...p,className:j,colors:n,enableAlpha:i,enableStyle:s,innerWrapperClassName:B,inputWidth:T,isStyleSettable:C,onBorderChange:S,onSliderChange:E,onWidthChange:A,previousStyleSelection:x,sliderClassName:R,value:c,widthUnit:b,widthValue:m,size:f,__experimentalIsRenderedInSidebar:d,__next40pxDefaultSize:h}}(e);return(0,Id.jsxs)(dx.A,{as:"fieldset",...I,ref:t,children:[(0,Id.jsx)(rR,{label:h,hideLabelFromVision:l}),(0,Id.jsxs)(QS.A,{spacing:4,className:c,children:[(0,Id.jsx)(ik,{prefix:(0,Id.jsx)(tR,{border:w,colors:r,__unstablePopoverProps:b,disableCustomColors:o,enableAlpha:s,enableStyle:a,isStyleSettable:d,onChange:p,previousStyleSelection:v,showDropdownHeader:y,__experimentalIsRenderedInSidebar:E,size:_}),label:(0,U.__)("Border width"),hideLabelFromVision:!0,min:0,onChange:m,value:w?.width||"",placeholder:g,disableUnits:i,__unstableInputWidth:u,size:_}),A&&(0,Id.jsx)(OC,{__nextHasNoMarginBottom:!0,label:(0,U.__)("Border width"),hideLabelFromVision:!0,className:x,initialPosition:0,max:100,min:0,onChange:f,step:["px","%"].includes(C)?1:.1,value:S||void 0,withInputField:!1,__next40pxDefaultSize:n})]})]})}),"BorderControl"),iR=oR;const sR=(0,z_.KZ)(((e,t)=>{const{centeredClassName:n,colors:r,disableCustomColors:o,enableAlpha:i,enableStyle:s,onChange:a,popoverPlacement:l,popoverOffset:c,rightAlignedClassName:u,size:d="default",value:h,__experimentalIsRenderedInSidebar:p,...f}=function(e){const{className:t,colors:n=[],enableAlpha:r=!1,enableStyle:o=!0,size:i="default",__experimentalIsRenderedInSidebar:s=!1,...a}=(0,F_.A)(e,"BorderBoxControlSplitControls"),l=(0,U_.l)(),c=(0,k.useMemo)((()=>l((e=>(0,$_.css)("position:relative;flex:1;width:","__unstable-large"===e?void 0:"80%",";",""))(i),t)),[l,t,i]);return{...a,centeredClassName:(0,k.useMemo)((()=>l(iT,t)),[l,t]),className:c,colors:n,enableAlpha:r,enableStyle:o,rightAlignedClassName:(0,k.useMemo)((()=>l((0,$_.css)((0,Ww.h)({marginLeft:"auto"})(),";",""),t)),[l,t]),size:i,__experimentalIsRenderedInSidebar:s}}(e),[m,g]=(0,k.useState)(null),b=(0,k.useMemo)((()=>l?{placement:l,offset:c,anchor:m,shift:!0}:void 0),[l,c,m]),v={colors:r,disableCustomColors:o,enableAlpha:i,enableStyle:s,isCompact:!0,__experimentalIsRenderedInSidebar:p,size:d},y=(0,Zk.A)([g,t]);return(0,Id.jsxs)(vA,{...f,ref:y,gap:4,children:[(0,Id.jsx)(aT,{value:h,size:d}),(0,Id.jsx)(iR,{className:n,hideLabelFromVision:!0,label:(0,U.__)("Top border"),onChange:e=>a(e,"top"),__unstablePopoverProps:b,value:h?.top,...v}),(0,Id.jsx)(iR,{hideLabelFromVision:!0,label:(0,U.__)("Left border"),onChange:e=>a(e,"left"),__unstablePopoverProps:b,value:h?.left,...v}),(0,Id.jsx)(iR,{className:u,hideLabelFromVision:!0,label:(0,U.__)("Right border"),onChange:e=>a(e,"right"),__unstablePopoverProps:b,value:h?.right,...v}),(0,Id.jsx)(iR,{className:n,hideLabelFromVision:!0,label:(0,U.__)("Bottom border"),onChange:e=>a(e,"bottom"),__unstablePopoverProps:b,value:h?.bottom,...v})]})}),"BorderBoxControlSplitControls"),aR=sR;function lR(e){const{className:t,colors:n=[],onChange:r,enableAlpha:o=!1,enableStyle:i=!0,size:s="default",value:a,__experimentalIsRenderedInSidebar:l=!1,__next40pxDefaultSize:c,...u}=(0,F_.A)(e,"BorderBoxControl"),d="default"===s&&c?"__unstable-large":s,h=qj(a),p=Gj(a),f=p?(e=>{if(!e)return;const t=[],n=[],r=[];Vj.forEach((o=>{t.push(e[o]?.color),n.push(e[o]?.style),r.push(e[o]?.width)}));const o=t.every((e=>e===t[0])),i=n.every((e=>e===n[0])),s=r.every((e=>e===r[0]));return{color:o?t[0]:void 0,style:i?n[0]:void 0,width:s?r[0]:Yj(r)}})(a):a,m=p?a:(e=>{if(e&&!$j(e))return{top:e,right:e,bottom:e,left:e}})(a),g=!isNaN(parseFloat(`${f?.width}`)),[b,v]=(0,k.useState)(!h),y=(0,U_.l)(),_=(0,k.useMemo)((()=>y(nT,t)),[y,t]),x=(0,k.useMemo)((()=>y((0,$_.css)("flex:1;",(0,Ww.h)({marginRight:"24px"})(),";",""))),[y]),w=(0,k.useMemo)((()=>y(rT)),[y]);return{...u,className:_,colors:n,disableUnits:h&&!g,enableAlpha:o,enableStyle:i,hasMixedBorders:h,isLinked:b,linkedControlClassName:x,onLinkedChange:e=>{if(!e)return r(void 0);if(!h||(t=e)&&Hj.every((e=>void 0!==t[e])))return r($j(e)?void 0:e);var t;const n=((e,t)=>{const n={};return e.color!==t.color&&(n.color=t.color),e.style!==t.style&&(n.style=t.style),e.width!==t.width&&(n.width=t.width),n})(f,e),o={top:{...a?.top,...n},right:{...a?.right,...n},bottom:{...a?.bottom,...n},left:{...a?.left,...n}};if(qj(o))return r(o);const i=$j(o.top)?void 0:o.top;r(i)},onSplitChange:(e,t)=>{const n={...m,[t]:e};qj(n)?r(n):r(e)},toggleLinked:()=>v(!b),linkedValue:f,size:d,splitValue:m,wrapperClassName:w,__experimentalIsRenderedInSidebar:l}}const cR=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,Id.jsx)($A.A,{as:"label",children:t}):(0,Id.jsx)(tA.Gw,{children:t}):null},uR=(0,z_.KZ)(((e,t)=>{const{className:n,colors:r,disableCustomColors:o,disableUnits:i,enableAlpha:s,enableStyle:a,hasMixedBorders:l,hideLabelFromVision:c,isLinked:u,label:d,linkedControlClassName:h,linkedValue:p,onLinkedChange:f,onSplitChange:m,popoverPlacement:g,popoverOffset:b,size:v,splitValue:y,toggleLinked:_,wrapperClassName:x,__experimentalIsRenderedInSidebar:w,...C}=lR(e),[S,A]=(0,k.useState)(null),E=(0,k.useMemo)((()=>g?{placement:g,offset:b,anchor:S,shift:!0}:void 0),[g,b,S]),I=(0,Zk.A)([A,t]);return(0,Id.jsxs)(dx.A,{className:n,...C,ref:I,children:[(0,Id.jsx)(cR,{label:d,hideLabelFromVision:c}),(0,Id.jsxs)(dx.A,{className:x,children:[u?(0,Id.jsx)(iR,{className:h,colors:r,disableUnits:i,disableCustomColors:o,enableAlpha:s,enableStyle:a,onChange:f,placeholder:l?(0,U.__)("Mixed"):void 0,__unstablePopoverProps:E,shouldSanitizeBorder:!1,value:p,withSlider:!0,width:"__unstable-large"===v?"116px":"110px",__experimentalIsRenderedInSidebar:w,size:v}):(0,Id.jsx)(aR,{colors:r,disableCustomColors:o,enableAlpha:s,enableStyle:a,onChange:m,popoverPlacement:g,popoverOffset:b,value:y,__experimentalIsRenderedInSidebar:w,size:v}),(0,Id.jsx)(sT,{onClick:_,isLinked:u,size:v})]})]})}),"BorderBoxControl"),dR=uR;function hR(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function pR(e={}){const{flat:t,...n}=e;return t||hR(Object.values(n).filter(Boolean))||"px"}function fR(e={}){if("string"==typeof e)return e;const t=Object.values(e).map((e=>Hw(e))),n=t.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),r=t.map((e=>e[1])),o=n.every((e=>e===n[0]))?n[0]:"",i=hR(r);return 0===o||o?`${o}${i}`:void 0}function mR(e={}){const t=fR(e);return"string"!=typeof e&&isNaN(parseFloat(t))}function gR(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function bR({onChange:e,selectedUnits:t,setSelectedUnits:n,values:r,...o}){let i=fR(r);void 0===i&&(i=pR(t));const s=gR(r)&&mR(r),a=s?(0,U.__)("Mixed"):null;return(0,Id.jsx)(ik,{...o,"aria-label":(0,U.__)("Border radius"),disableUnits:s,isOnly:!0,value:i,onChange:t=>{const n=!isNaN(parseFloat(t));e(n?t:void 0)},onUnitChange:e=>{n({topLeft:e,topRight:e,bottomLeft:e,bottomRight:e})},placeholder:a,size:"__unstable-large"})}const vR={topLeft:(0,U.__)("Top left"),topRight:(0,U.__)("Top right"),bottomLeft:(0,U.__)("Bottom left"),bottomRight:(0,U.__)("Bottom right")};function yR({onChange:e,selectedUnits:t,setSelectedUnits:n,values:r,...o}){const i=t=>n=>{if(!e)return;const r=isNaN(parseFloat(n))?void 0:n;e({...s,[t]:r})},s="string"!=typeof r?r:{topLeft:r,topRight:r,bottomLeft:r,bottomRight:r};return(0,Id.jsx)("div",{className:"components-border-radius-control__input-controls-wrapper",children:Object.entries(vR).map((([e,r])=>{const[a,l]=Hw(s[e]),c=s[e]?l:t[e]||t.flat;return(0,Id.jsx)(Rx.Ay,{text:r,placement:"top",children:(0,Id.jsx)("div",{className:"components-border-radius-control__tooltip-wrapper",children:(0,Id.jsx)(ik,{...o,"aria-label":r,value:[a,c].join(""),onChange:i(e),onUnitChange:(u=e,e=>{const r={...t};r[u]=e,n(r)}),size:"__unstable-large"})})},e);var u}))})}function _R({isLinked:e,...t}){const n=e?(0,U.__)("Unlink radii"):(0,U.__)("Link radii");return(0,Id.jsx)(Rx.Ay,{text:n,children:(0,Id.jsx)(Jy.Ay,{...t,className:"component-border-radius-control__linked-button",size:"small",icon:e?tT.A:JI.A,iconSize:24,"aria-label":n})})}const xR={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},wR=0,kR={px:100,em:20,rem:20};function CR({onChange:e,values:t}){const[n,r]=(0,k.useState)(!gR(t)||!mR(t)),[o,i]=(0,k.useState)({flat:"string"==typeof t?Hw(t)[1]:void 0,topLeft:Hw(t?.topLeft)[1],topRight:Hw(t?.topRight)[1],bottomLeft:Hw(t?.bottomLeft)[1],bottomRight:Hw(t?.bottomRight)[1]}),[s]=hy("spacing.units"),a=$w({availableUnits:s||["px","em","rem"]}),l=pR(o),c=a&&a.find((e=>e.value===l)),u=c?.step||1,[d]=Hw(fR(t));return(0,Id.jsxs)("fieldset",{className:"components-border-radius-control",children:[(0,Id.jsx)(V_.Ay.VisualLabel,{as:"legend",children:(0,U.__)("Radius")}),(0,Id.jsxs)("div",{className:"components-border-radius-control__wrapper",children:[n?(0,Id.jsxs)(Id.Fragment,{children:[(0,Id.jsx)(bR,{className:"components-border-radius-control__unit-control",values:t,min:wR,onChange:e,selectedUnits:o,setSelectedUnits:i,units:a}),(0,Id.jsx)(OC,{label:(0,U.__)("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:null!=d?d:"",min:wR,max:kR[l],initialPosition:0,withInputField:!1,onChange:t=>{e(void 0!==t?`${t}${l}`:void 0)},step:u,__nextHasNoMarginBottom:!0})]}):(0,Id.jsx)(yR,{min:wR,onChange:e,selectedUnits:o,setSelectedUnits:i,values:t||xR,units:a}),(0,Id.jsx)(_R,{onClick:()=>r(!n),isLinked:n})]})]})}var SR=n(77582);const AR=[],{CompositeItemV2:ER,CompositeV2:IR,useCompositeStoreV2:jR}=wf(c_.j);function TR({shadow:e,onShadowChange:t,settings:n}){const r=DR(n);return(0,Id.jsx)("div",{className:"block-editor-global-styles__shadow-popover-container",children:(0,Id.jsxs)(nE.A,{spacing:4,children:[(0,Id.jsx)(eA.A,{level:5,children:(0,U.__)("Drop shadow")}),(0,Id.jsx)(BR,{presets:r,activeShadow:e,onSelect:t}),(0,Id.jsx)("div",{className:"block-editor-global-styles__clear-shadow",children:(0,Id.jsx)(Jy.Ay,{variant:"tertiary",onClick:()=>t(void 0),children:(0,U.__)("Clear")})})]})})}function BR({presets:e,activeShadow:t,onSelect:n}){const r=jR();return e?(0,Id.jsx)(IR,{store:r,role:"listbox",className:"block-editor-global-styles__shadow__list","aria-label":(0,U.__)("Drop shadows"),children:e.map((({name:e,slug:r,shadow:o})=>(0,Id.jsx)(RR,{label:e,isActive:o===t,type:"unset"===r?"unset":"preset",onSelect:()=>n(o===t?void 0:o),shadow:o},r)))}):null}function RR({type:e,label:t,isActive:n,onSelect:r,shadow:o}){return(0,Id.jsx)(ER,{role:"option","aria-label":t,"aria-selected":n,className:(0,Vy.A)("block-editor-global-styles__shadow__item",{"is-active":n}),render:(0,Id.jsx)(Jy.Ay,{className:(0,Vy.A)("block-editor-global-styles__shadow-indicator",{unset:"unset"===e}),onClick:r,label:t,style:{boxShadow:o},showTooltip:!0,children:n&&(0,Id.jsx)(sk.A,{icon:JS.A})})})}function NR({shadow:e,onShadowChange:t,settings:n}){return(0,Id.jsx)(DE.A,{popoverProps:{placement:"left-start",offset:36,shift:!0},className:"block-editor-global-styles__shadow-dropdown",renderToggle:({onToggle:e,isOpen:t})=>{const n={onClick:e,className:(0,Vy.A)({"is-open":t}),"aria-expanded":t};return(0,Id.jsx)(Jy.Ay,{...n,children:(0,Id.jsxs)(QS.A,{justify:"flex-start",children:[(0,Id.jsx)(sk.A,{className:"block-editor-global-styles__toggle-icon",icon:SR.A,size:24}),(0,Id.jsx)(T_.A,{children:(0,U.__)("Drop shadow")})]})})},renderContent:()=>(0,Id.jsx)(OB,{paddingSize:"medium",children:(0,Id.jsx)(TR,{shadow:e,onShadowChange:t,settings:n})})})}function DR(e){return(0,k.useMemo)((()=>{var t;if(!e?.shadow)return AR;const n=e?.shadow?.defaultPresets,{default:r,theme:o,custom:i}=null!==(t=e?.shadow?.presets)&&void 0!==t?t:{},s={name:(0,U.__)("Unset"),slug:"unset",shadow:"none"},a=[...n&&r||AR,...o||AR,...i||AR];return a.length&&a.unshift(s),a}),[e])}function MR(e){return Object.values(PR(e)).some(Boolean)}function PR(e){return{hasBorderColor:OR(e),hasBorderRadius:LR(e),hasBorderStyle:FR(e),hasBorderWidth:zR(e),hasShadow:UR(e)}}function OR(e){return e?.border?.color}function LR(e){return e?.border?.radius}function FR(e){return e?.border?.style}function zR(e){return e?.border?.width}function UR(e){const t=DR(e);return!!e?.shadow&&t.length>0}function VR({resetAllFilter:e,onChange:t,value:n,panelId:r,children:o,label:i}){return(0,Id.jsx)(_A,{label:i,resetAll:()=>{const r=e(n);t(r)},panelId:r,dropdownMenuProps:Ey,children:o})}const HR={radius:!0,color:!0,width:!0,shadow:!0};function $R({as:e=VR,value:t,onChange:n,inheritedValue:r=t,settings:o,panelId:i,name:s,defaultControls:a=HR}){var l,c,u,d;const h=zy(o),p=(0,k.useCallback)((e=>jy({settings:o},"",e)),[o]),f=e=>{const t=h.flatMap((({colors:e})=>e)).find((({color:t})=>t===e));return t?"var:preset|color|"+t.slug:e},m=(0,k.useMemo)((()=>{if(Gj(r?.border)){const e={...r?.border};return["top","right","bottom","left"].forEach((t=>{e[t]={...e[t],color:p(e[t]?.color)}})),e}return{...r?.border,color:r?.border?.color?p(r?.border?.color):void 0}}),[r?.border,p]),g=e=>n({...t,border:e}),b=OR(o),v=FR(o),y=zR(o),_=LR(o),x=p(m?.radius),w=e=>g({...m,radius:e}),C=()=>{const e=t?.border?.radius;return"object"==typeof e?Object.entries(e).some(Boolean):!!e},S=UR(o),A=p(r?.shadow),E=null!==(l=o?.shadow?.presets)&&void 0!==l?l:{},I=null!==(c=null!==(u=null!==(d=E.custom)&&void 0!==d?d:E.theme)&&void 0!==u?u:E.default)&&void 0!==c?c:[],j=e=>{const r=I?.find((({shadow:t})=>t===e))?.slug;n(Pf(t,["shadow"],r?`var:preset|shadow|${r}`:e||void 0))},T=(0,k.useCallback)((e=>({...e,border:void 0,shadow:void 0})),[]),B=a?.color||a?.width,R=b||v||y||_,N=tN({blockName:s,hasShadowControl:S,hasBorderControl:R});return(0,Id.jsxs)(e,{resetAllFilter:T,value:t,onChange:n,panelId:i,label:N,children:[(y||b)&&(0,Id.jsx)(qA,{hasValue:()=>Wj(t?.border),label:(0,U.__)("Border"),onDeselect:()=>(()=>{if(C())return g({radius:t?.border?.radius});g(void 0)})(),isShownByDefault:B,panelId:i,children:(0,Id.jsx)(dR,{colors:h,enableAlpha:!0,enableStyle:v,onChange:e=>{const t={...e};Gj(t)?["top","right","bottom","left"].forEach((e=>{t[e]&&(t[e]={...t[e],color:f(t[e]?.color)})})):t&&(t.color=f(t.color)),g({radius:m?.radius,...t})},popoverOffset:40,popoverPlacement:"left-start",value:m,__experimentalIsRenderedInSidebar:!0,size:"__unstable-large",hideLabelFromVision:!S,label:(0,U.__)("Border")})}),_&&(0,Id.jsx)(qA,{hasValue:C,label:(0,U.__)("Radius"),onDeselect:()=>w(void 0),isShownByDefault:a.radius,panelId:i,children:(0,Id.jsx)(CR,{values:x,onChange:e=>{w(e||void 0)}})}),S&&(0,Id.jsxs)(qA,{label:(0,U.__)("Shadow"),hasValue:()=>!!t?.shadow,onDeselect:()=>j(void 0),isShownByDefault:a.shadow,panelId:i,children:[R?(0,Id.jsx)(V_.Ay.VisualLabel,{as:"legend",children:(0,U.__)("Shadow")}):null,(0,Id.jsx)(VA,{isBordered:!0,isSeparated:!0,children:(0,Id.jsx)(NR,{shadow:A,onShadowChange:j,settings:o})})]})]})}const WR="__experimentalBorder",GR="shadow",qR=(e,t,n)=>{let r;return e.some((e=>e.colors.some((e=>e[t]===n&&(r=e,!0))))),r},KR=({colors:e,namedColor:t,customColor:n})=>{if(t){const n=qR(e,"slug",t);if(n)return n}if(!n)return{color:void 0};return qR(e,"color",n)||{color:n}};function YR(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function JR(e){if(Gj(e?.border))return{style:e,borderColor:void 0};const t=e?.border?.color,n=t?.startsWith("var:preset|color|")?t.substring(17):void 0,r={...e};return r.border={...r.border,color:n?void 0:t},{style:Hy(r),borderColor:n}}function XR(e){return Gj(e.style?.border)?e.style:{...e.style,border:{...e.style?.border,color:e.borderColor?"var:preset|color|"+e.borderColor:e.style?.border?.color}}}function ZR({label:e,children:t,resetAllFilter:n}){const r=(0,k.useCallback)((e=>{const t=XR(e),r=n(t);return{...e,...JR(r)}}),[n]);return(0,Id.jsx)(AA,{group:"border",resetAllFilter:r,label:e,children:t})}function QR({clientId:e,name:t,setAttributes:n,settings:r}){const o=MR(r),{style:i,borderColor:s}=(0,Fl.A)((function(t){const{style:n,borderColor:r}=t(uy).getBlockAttributes(e)||{};return{style:n,borderColor:r}}),[e]),a=(0,k.useMemo)((()=>XR({style:i,borderColor:s})),[i,s]);if(!o)return null;const l={...Sc(t,[WR,"__experimentalDefaultControls"]),...Sc(t,[GR,"__experimentalDefaultControls"])};return(0,Id.jsx)($R,{as:ZR,panelId:e,settings:r,value:a,onChange:e=>{n(JR(e))},defaultControls:l})}function eN(e,t="any"){if("web"!==Ph.A.OS)return!1;const n=Sc(e,WR);return!0===n||("any"===t?!!(n?.color||n?.radius||n?.width||n?.style):!!n?.[t])}function tN({blockName:e,hasBorderControl:t,hasShadowControl:n}={}){const r=PR(Ky(e));return t||n||!e||(t=r?.hasBorderColor||r?.hasBorderStyle||r?.hasBorderWidth||r?.hasBorderRadius,n=r?.hasShadow),t&&n?(0,U.__)("Border & Shadow"):n?(0,U.__)("Shadow"):(0,U.__)("Border")}function nN(e,t,n){if(!eN(t,"color")||Wy(t,WR,"color"))return e;const r=rN(n),o=(0,Vy.A)(e.className,r);return e.className=o||void 0,e}function rN(e){const{borderColor:t,style:n}=e,r=Qj("border-color",t);return(0,Vy.A)({"has-border-color":t||n?.border?.color,[r]:!!r})}const oN={useBlockProps:function({name:e,borderColor:t,style:n}){const{colors:r}=eT();if(!eN(e,"color")||Wy(e,WR,"color"))return{};const{color:o}=KR({colors:r,namedColor:t}),{color:i}=KR({colors:r,namedColor:YR(n?.border?.top?.color)}),{color:s}=KR({colors:r,namedColor:YR(n?.border?.right?.color)}),{color:a}=KR({colors:r,namedColor:YR(n?.border?.bottom?.color)}),{color:l}=KR({colors:r,namedColor:YR(n?.border?.left?.color)});return nN({style:Hy({borderTopColor:i||o,borderRightColor:s||o,borderBottomColor:a||o,borderLeftColor:l||o})||{}},e,{borderColor:t,style:n})},addSaveProps:nN,attributeKeys:["borderColor","style"],hasSupport:e=>eN(e,"color")};(0,Iu.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return eN(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e}));var iN=n(7652);const sN=(0,H_.default)("div",{target:"ebn2ljm1"})("&:not( :first-of-type ){",(({offsetAmount:e})=>(0,$_.css)({marginInlineStart:e},"","")),";}",(({zIndex:e})=>(0,$_.css)({zIndex:e},"","")),";");var aN={name:"rs0gp6",styles:"grid-row-start:1;grid-column-start:1"};const lN=(0,H_.default)("div",{target:"ebn2ljm0"})("display:inline-grid;grid-auto-flow:column;position:relative;&>",sN,"{position:relative;justify-self:start;",(({isLayered:e})=>e?aN:void 0),";}"),cN=(0,z_.KZ)((function(e,t){const{children:n,className:r,isLayered:o=!0,isReversed:i=!1,offset:s=0,...a}=(0,F_.A)(e,"ZStack"),l=(0,iN.a)(n),c=l.length-1,u=l.map(((e,t)=>{const n=i?c-t:t,r=o?s*t:s,a=(0,k.isValidElement)(e)?e.key:t;return(0,Id.jsx)(sN,{offsetAmount:r,zIndex:n,children:e},a)}));return(0,Id.jsx)(lN,{...a,className:r,isLayered:o,ref:t,children:u})}),"ZStack"),uN=cN;var dN=n(78874);const hN=(0,H_.default)("div",{target:"eln3bjz3"})("border-radius:50%;border:",G_.A.borderWidth," solid ",W_.l.ui.border,";box-sizing:border-box;cursor:grab;height:",32,"px;overflow:hidden;width:",32,"px;:active{cursor:grabbing;}"),pN=(0,H_.default)("div",{target:"eln3bjz2"})({name:"1r307gh",styles:"box-sizing:border-box;position:relative;width:100%;height:100%;:focus-visible{outline:none;}"}),fN=(0,H_.default)("div",{target:"eln3bjz1"})("background:",W_.l.theme.accent,";border-radius:50%;box-sizing:border-box;display:block;left:50%;top:4px;transform:translateX( -50% );position:absolute;width:",6,"px;height:",6,"px;"),mN=(0,H_.default)(BT.A,{target:"eln3bjz0"})("color:",W_.l.theme.accent,";margin-right:",(0,Kw.x)(3),";"),gN=function({value:e,onChange:t,...n}){const r=(0,k.useRef)(null),o=(0,k.useRef)(),i=(0,k.useRef)(),s=e=>{if(void 0!==e&&(e.preventDefault(),e.target?.focus(),void 0!==o.current&&void 0!==t)){const{x:n,y:r}=o.current;t(function(e,t,n,r){const o=r-t,i=n-e,s=Math.atan2(o,i),a=Math.round(s*(180/Math.PI))+90;return a<0?360+a:a}(n,r,e.clientX,e.clientY))}},{startDrag:a,isDragging:l}=(0,rE.A)({onDragStart:e=>{(()=>{if(null===r.current)return;const e=r.current.getBoundingClientRect();o.current={x:e.x+e.width/2,y:e.y+e.height/2}})(),s(e)},onDragMove:s,onDragEnd:s});return(0,k.useEffect)((()=>{l?(void 0===i.current&&(i.current=document.body.style.cursor),document.body.style.cursor="grabbing"):(document.body.style.cursor=i.current||"",i.current=void 0)}),[l]),(0,Id.jsx)(hN,{ref:r,onMouseDown:a,className:"components-angle-picker-control__angle-circle",...n,children:(0,Id.jsx)(pN,{style:e?{transform:`rotate(${e}deg)`}:void 0,className:"components-angle-picker-control__angle-circle-indicator-wrapper",tabIndex:-1,children:(0,Id.jsx)(fN,{className:"components-angle-picker-control__angle-circle-indicator"})})})},bN=(0,k.forwardRef)((function(e,t){const{className:n,label:r=(0,U.__)("Angle"),onChange:o,value:i,...s}=e,a=(0,Vy.A)("components-angle-picker-control",n),l=(0,Id.jsx)(mN,{children:"°"}),[c,u]=(0,U.isRTL)()?[l,null]:[null,l];return(0,Id.jsxs)(j_.A,{...s,ref:t,className:a,gap:2,children:[(0,Id.jsx)(dN.A,{children:(0,Id.jsx)(Gw.A,{label:r,className:"components-angle-picker-control__input-field",max:360,min:0,onChange:e=>{if(void 0===o)return;const t=void 0!==e&&""!==e?parseInt(e,10):0;o(t)},size:"__unstable-large",step:"1",value:i,spinControls:"none",prefix:c,suffix:u})}),(0,Id.jsx)(RT.A,{marginBottom:"1",marginTop:"auto",children:(0,Id.jsx)(gN,{"aria-hidden":"true",value:i,onChange:o})})]})})),vN=bN,yN=10,_N=0,xN=yN;function wN(e){return Math.max(0,Math.min(100,e))}function kN(e,t,n){const r=e.slice();return r[t]=n,r}function CN(e,t,n){return function(e,t,n,r=_N){const o=e[t].position,i=Math.min(o,n),s=Math.max(o,n);return e.some((({position:e},o)=>o!==t&&(Math.abs(e-n)({placement:"bottom",offset:8,resize:!1})),[]),o=(0,Vy.A)("components-custom-gradient-picker__control-point-dropdown",t);return(0,Id.jsx)(UB,{isRenderedInSidebar:e,popoverProps:r,className:o,...n})}function jN({disableRemove:e,disableAlpha:t,gradientPickerDomRef:n,ignoreMarkerPosition:r,value:o,onChange:i,onStartControlPointChange:s,onStopControlPointChange:a,__experimentalIsRenderedInSidebar:l}){const c=(0,k.useRef)(),u=e=>{if(void 0===c.current||null===n.current)return;const t=AN(e.clientX,n.current),{initialPosition:r,index:s,significantMoveHappened:a}=c.current;!a&&Math.abs(r-t)>=5&&(c.current.significantMoveHappened=!0),i(CN(o,s,t))},d=()=>{window&&window.removeEventListener&&c.current&&c.current.listenersActivated&&(window.removeEventListener("mousemove",u),window.removeEventListener("mouseup",d),a(),c.current.listenersActivated=!1)},h=(0,k.useRef)();return h.current=d,(0,k.useEffect)((()=>()=>{h.current?.()}),[]),(0,Id.jsx)(Id.Fragment,{children:o.map(((n,h)=>{const p=n?.position;return r!==p&&(0,Id.jsx)(IN,{isRenderedInSidebar:l,onClose:a,renderToggle:({isOpen:e,onToggle:t})=>(0,Id.jsx)(EN,{onClick:()=>{c.current&&c.current.significantMoveHappened||(e?a():s(),t())},onMouseDown:()=>{window&&window.addEventListener&&(c.current={initialPosition:p,index:h,significantMoveHappened:!1,listenersActivated:!0},s(),window.addEventListener("mousemove",u),window.addEventListener("mouseup",d))},onKeyDown:e=>{"ArrowLeft"===e.code?(e.stopPropagation(),i(CN(o,h,wN(n.position-xN)))):"ArrowRight"===e.code&&(e.stopPropagation(),i(CN(o,h,wN(n.position+xN))))},isOpen:e,position:n.position,color:n.color},h),renderContent:({onClose:r})=>(0,Id.jsxs)(OB,{paddingSize:"none",children:[(0,Id.jsx)(SB,{enableAlpha:!t,color:n.color,onChange:e=>{i(SN(o,h,(0,nc.Mj)(e).toRgbString()))}}),!e&&o.length>2&&(0,Id.jsx)(QS.A,{className:"components-custom-gradient-picker__remove-control-point-wrapper",alignment:"center",children:(0,Id.jsx)(Jy.Ay,{onClick:()=>{i(function(e,t){return e.filter(((e,n)=>n!==t))}(o,h)),r()},variant:"link",children:(0,U.__)("Remove Control Point")})})]}),style:{left:`${n.position}%`,transform:"translateX( -50% )"}},h)}))})}jN.InsertPoint=function({value:e,onChange:t,onOpenInserter:n,onCloseInserter:r,insertPosition:o,disableAlpha:i,__experimentalIsRenderedInSidebar:s}){const[a,l]=(0,k.useState)(!1);return(0,Id.jsx)(IN,{isRenderedInSidebar:s,className:"components-custom-gradient-picker__inserter",onClose:()=>{r()},renderToggle:({isOpen:e,onToggle:t})=>(0,Id.jsx)(Jy.Ay,{"aria-expanded":e,"aria-haspopup":"true",onClick:()=>{e?r():(l(!1),n()),t()},className:"components-custom-gradient-picker__insert-point-dropdown",icon:XS.A}),renderContent:()=>(0,Id.jsx)(OB,{paddingSize:"none",children:(0,Id.jsx)(SB,{enableAlpha:!i,onChange:n=>{a?t(function(e,t,n){const r=e.findIndex((e=>e.position===t));return SN(e,r,n)}(e,o,(0,nc.Mj)(n).toRgbString())):(t(function(e,t,n){const r=e.findIndex((e=>e.position>t)),o={color:n,position:t},i=e.slice();return i.splice(r-1,0,o),i}(e,o,(0,nc.Mj)(n).toRgbString())),l(!0))}})}),style:null!==o?{left:`${o}%`,transform:"translateX( -50% )"}:void 0})};const TN=jN,BN=(e,t)=>{switch(t.type){case"MOVE_INSERTER":if("IDLE"===e.id||"MOVING_INSERTER"===e.id)return{id:"MOVING_INSERTER",insertPosition:t.insertPosition};break;case"STOP_INSERTER_MOVE":if("MOVING_INSERTER"===e.id)return{id:"IDLE"};break;case"OPEN_INSERTER":if("MOVING_INSERTER"===e.id)return{id:"INSERTING_CONTROL_POINT",insertPosition:e.insertPosition};break;case"CLOSE_INSERTER":if("INSERTING_CONTROL_POINT"===e.id)return{id:"IDLE"};break;case"START_CONTROL_CHANGE":if("IDLE"===e.id)return{id:"MOVING_CONTROL_POINT"};break;case"STOP_CONTROL_CHANGE":if("MOVING_CONTROL_POINT"===e.id)return{id:"IDLE"}}return e},RN={id:"IDLE"};function NN({background:e,hasGradient:t,value:n,onChange:r,disableInserter:o=!1,disableAlpha:i=!1,__experimentalIsRenderedInSidebar:s=!1}){const a=(0,k.useRef)(null),[l,c]=(0,k.useReducer)(BN,RN),u=e=>{if(!a.current)return;const t=AN(e.clientX,a.current);n.some((({position:e})=>Math.abs(t-e){c({type:"STOP_INSERTER_MOVE"})},children:[(0,Id.jsx)("div",{className:"components-custom-gradient-picker__gradient-bar-background",style:{background:e,opacity:t?1:.4}}),(0,Id.jsxs)("div",{ref:a,className:"components-custom-gradient-picker__markers-container",children:[!o&&(d||h)&&(0,Id.jsx)(TN.InsertPoint,{__experimentalIsRenderedInSidebar:s,disableAlpha:i,insertPosition:l.insertPosition,value:n,onChange:r,onOpenInserter:()=>{c({type:"OPEN_INSERTER"})},onCloseInserter:()=>{c({type:"CLOSE_INSERTER"})}}),(0,Id.jsx)(TN,{__experimentalIsRenderedInSidebar:s,disableAlpha:i,disableRemove:o,gradientPickerDomRef:a,ignoreMarkerPosition:h?l.insertPosition:void 0,value:n,onChange:r,onStartControlPointChange:()=>{c({type:"START_CONTROL_CHANGE"})},onStopControlPointChange:()=>{c({type:"STOP_CONTROL_CHANGE"})}})]})]})}var DN=n(37328);const MN="linear-gradient(135deg, rgba(6, 147, 227, 1) 0%, rgb(155, 81, 224) 100%)",PN={type:"angular",value:"90"},ON=[{value:"linear-gradient",label:(0,U.__)("Linear")},{value:"radial-gradient",label:(0,U.__)("Radial")}],LN={top:0,"top right":45,"right top":45,right:90,"right bottom":135,"bottom right":135,bottom:180,"bottom left":225,"left bottom":225,left:270,"top left":315,"left top":315};function FN({type:e,value:t,length:n}){return`${function({type:e,value:t}){return"literal"===e?t:"hex"===e?`#${t}`:`${e}(${t.join(",")})`}({type:e,value:t})} ${function(e){if(!e)return"";const{value:t,type:n}=e;return`${t}${n}`}(n)}`}function zN({type:e,orientation:t,colorStops:n}){const r=function(e){if(!Array.isArray(e)&&e&&"angular"===e.type)return`${e.value}deg`}(t);return`${e}(${[r,...n.sort(((e,t)=>{const n=e=>void 0===e?.length?.value?0:parseInt(e.length.value);return n(e)-n(t)})).map(FN)].filter(Boolean).join(",")})`}function UN(e){return void 0===e.length||"%"!==e.length.type}function VN(e){switch(e.type){case"hex":return`#${e.value}`;case"literal":return e.value;case"rgb":case"rgba":return`${e.type}(${e.value.join(",")})`;default:return"transparent"}}(0,nc.X$)([rc.A]);const HN=(0,H_.default)(dN.A,{target:"e10bzpgi1"})({name:"1gvx10y",styles:"flex-grow:5"}),$N=(0,H_.default)(dN.A,{target:"e10bzpgi0"})({name:"1gvx10y",styles:"flex-grow:5"}),WN=({gradientAST:e,hasGradient:t,onChange:n})=>{var r;const o=null!==(r=e?.orientation?.value)&&void 0!==r?r:180;return(0,Id.jsx)(vN,{onChange:t=>{n(zN({...e,orientation:{type:"angular",value:`${t}`}}))},value:t?o:""})},GN=({gradientAST:e,hasGradient:t,onChange:n})=>{const{type:r}=e;return(0,Id.jsx)(vT.A,{__nextHasNoMarginBottom:!0,className:"components-custom-gradient-picker__type-picker",label:(0,U.__)("Type"),labelPosition:"top",onChange:t=>{"linear-gradient"===t&&n(zN({...e,orientation:e.orientation?void 0:PN,type:"linear-gradient"})),"radial-gradient"===t&&(()=>{const{orientation:t,...r}=e;n(zN({...r,type:"radial-gradient"}))})()},options:ON,size:"__unstable-large",value:t?r:void 0})},qN=function({value:e,onChange:t,__experimentalIsRenderedInSidebar:n=!1}){const{gradientAST:r,hasGradient:o}=function(e){let t,n=!!e;const r=null!=e?e:MN;try{t=DN.parse(r)[0]}catch(e){console.warn("wp.components.CustomGradientPicker failed to parse the gradient with error",e),t=DN.parse(MN)[0],n=!1}if(Array.isArray(t.orientation)||"directional"!==t.orientation?.type||(t.orientation={type:"angular",value:LN[t.orientation.value].toString()}),t.colorStops.some(UN)){const{colorStops:e}=t,n=100/(e.length-1);e.forEach(((e,t)=>{e.length={value:""+n*t,type:"%"}}))}return{gradientAST:t,hasGradient:n}}(e),i=function(e){return zN({type:"linear-gradient",orientation:PN,colorStops:e.colorStops})}(r),s=r.colorStops.map((e=>({color:VN(e),position:parseInt(e.length.value)})));return(0,Id.jsxs)(nE.A,{spacing:4,className:"components-custom-gradient-picker",children:[(0,Id.jsx)(NN,{__experimentalIsRenderedInSidebar:n,background:i,hasGradient:o,value:s,onChange:e=>{t(zN(function(e,t){return{...e,colorStops:t.map((({position:e,color:t})=>{const{r:n,g:r,b:o,a:i}=(0,nc.Mj)(t).toRgb();return{length:{type:"%",value:e?.toString()},type:i<1?"rgba":"rgb",value:i<1?[`${n}`,`${r}`,`${o}`,`${i}`]:[`${n}`,`${r}`,`${o}`]}}))}}(r,e)))}}),(0,Id.jsxs)(j_.A,{gap:3,className:"components-custom-gradient-picker__ui-line",children:[(0,Id.jsx)(HN,{children:(0,Id.jsx)(GN,{gradientAST:r,hasGradient:o,onChange:t})}),(0,Id.jsx)($N,{children:"linear-gradient"===r.type&&(0,Id.jsx)(WN,{gradientAST:r,hasGradient:o,onChange:t})})]})]})};function KN({className:e,clearGradient:t,gradients:n,onChange:r,value:o,...i}){const s=(0,k.useMemo)((()=>n.map((({gradient:e,name:n,slug:i},s)=>(0,Id.jsx)(NB.Option,{value:e,isSelected:o===e,tooltipText:n||(0,U.sprintf)((0,U.__)("Gradient code: %s"),e),style:{color:"rgba( 0,0,0,0 )",background:e},onClick:o===e?t:()=>r(e,s),"aria-label":n?(0,U.sprintf)((0,U.__)("Gradient: %s"),n):(0,U.sprintf)((0,U.__)("Gradient code: %s"),e)},i)))),[n,o,r,t]);return(0,Id.jsx)(NB.OptionGroup,{className:e,options:s,...i})}function YN({className:e,clearGradient:t,gradients:n,onChange:r,value:o,headingLevel:i}){const s=(0,L_.A)(YN);return(0,Id.jsx)(nE.A,{spacing:3,className:e,children:n.map((({name:e,gradients:n},a)=>{const l=`color-palette-${s}-${a}`;return(0,Id.jsxs)(nE.A,{spacing:2,children:[(0,Id.jsx)(DB,{level:i,id:l,children:e}),(0,Id.jsx)(KN,{clearGradient:t,gradients:n,onChange:e=>r(e,a),value:o,"aria-labelledby":l})]},a)}))})}function JN(e){const{asButtons:t,loop:n,actions:r,headingLevel:o,"aria-label":i,"aria-labelledby":s,...a}=e,l=(c=e.gradients).length>0&&c.every((e=>{return t=e,Array.isArray(t.gradients)&&!("gradient"in t);var t}))?(0,Id.jsx)(YN,{headingLevel:o,...a}):(0,Id.jsx)(KN,{...a});var c;let u;if(t)u={asButtons:!0};else{const e={asButtons:!1,loop:n};u=i?{...e,"aria-label":i}:s?{...e,"aria-labelledby":s}:{...e,"aria-label":(0,U.__)("Custom color picker.")}}return(0,Id.jsx)(NB,{...u,actions:r,options:l})}const XN=function({className:e,gradients:t=[],onChange:n,value:r,clearable:o=!0,disableCustomGradients:i=!1,__experimentalIsRenderedInSidebar:s,headingLevel:a=2,...l}){const c=(0,k.useCallback)((()=>n(void 0)),[n]);return(0,Id.jsxs)(nE.A,{spacing:t.length?4:0,children:[!i&&(0,Id.jsx)(qN,{__experimentalIsRenderedInSidebar:s,value:r,onChange:n}),(t.length>0||o)&&(0,Id.jsx)(JN,{...l,className:e,clearGradient:c,gradients:t,onChange:n,value:r,actions:o&&!i&&(0,Id.jsx)(NB.ButtonAction,{onClick:c,children:(0,U.__)("Clear")}),headingLevel:a})]})},{Tabs:ZN}=wf(c_.j),QN=["colors","disableCustomColors","gradients","disableCustomGradients"],eD={color:"color",gradient:"gradient"};function tD({colors:e,gradients:t,disableCustomColors:n,disableCustomGradients:r,__experimentalIsRenderedInSidebar:o,className:i,label:s,onColorChange:a,onGradientChange:l,colorValue:c,gradientValue:u,clearable:d,showTitle:h=!0,enableAlpha:p,headingLevel:f}){const m=a&&(e&&e.length>0||!n),g=l&&(t&&t.length>0||!r);if(!m&&!g)return null;const b={[eD.color]:(0,Id.jsx)(HB,{value:c,onChange:g?e=>{a(e),l()}:a,colors:e,disableCustomColors:n,__experimentalIsRenderedInSidebar:o,clearable:d,enableAlpha:p,headingLevel:f}),[eD.gradient]:(0,Id.jsx)(XN,{value:u,onChange:m?e=>{l(e),a()}:l,gradients:t,disableCustomGradients:r,__experimentalIsRenderedInSidebar:o,clearable:d,headingLevel:f})},v=e=>(0,Id.jsx)("div",{className:"block-editor-color-gradient-control__panel",children:b[e]});return(0,Id.jsx)(V_.Ay,{__nextHasNoMarginBottom:!0,className:(0,Vy.A)("block-editor-color-gradient-control",i),children:(0,Id.jsx)("fieldset",{className:"block-editor-color-gradient-control__fieldset",children:(0,Id.jsxs)(nE.A,{spacing:1,children:[h&&(0,Id.jsx)("legend",{children:(0,Id.jsx)("div",{className:"block-editor-color-gradient-control__color-indicator",children:(0,Id.jsx)(V_.Ay.VisualLabel,{children:s})})}),m&&g&&(0,Id.jsx)("div",{children:(0,Id.jsxs)(ZN,{defaultTabId:u?eD.gradient:!!m&&eD.color,children:[(0,Id.jsxs)(ZN.TabList,{children:[(0,Id.jsx)(ZN.Tab,{tabId:eD.color,children:(0,U.__)("Color")}),(0,Id.jsx)(ZN.Tab,{tabId:eD.gradient,children:(0,U.__)("Gradient")})]}),(0,Id.jsx)(ZN.TabPanel,{tabId:eD.color,className:"block-editor-color-gradient-control__panel",focusable:!1,children:b.color}),(0,Id.jsx)(ZN.TabPanel,{tabId:eD.gradient,className:"block-editor-color-gradient-control__panel",focusable:!1,children:b.gradient})]})}),!g&&v(eD.color),!m&&v(eD.gradient)]})})})}function nD(e){const[t,n,r,o]=hy("color.palette","color.gradients","color.custom","color.customGradient");return(0,Id.jsx)(tD,{colors:t,gradients:n,disableCustomColors:!r,disableCustomGradients:!o,...e})}const rD=function(e){return QN.every((t=>e.hasOwnProperty(t)))?(0,Id.jsx)(tD,{...e}):(0,Id.jsx)(nD,{...e})};function oD(e){const t=iD(e),n=uD(e),r=sD(e),o=lD(e),i=cD(e),s=aD(e);return t||n||r||o||i||s}function iD(e){const t=zy(e);return e?.color?.text&&(t?.length>0||e?.color?.custom)}function sD(e){const t=zy(e);return e?.color?.link&&(t?.length>0||e?.color?.custom)}function aD(e){const t=zy(e);return e?.color?.caption&&(t?.length>0||e?.color?.custom)}function lD(e){const t=zy(e),n=Uy(e);return e?.color?.heading&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function cD(e){const t=zy(e),n=Uy(e);return e?.color?.button&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function uD(e){const t=zy(e),n=Uy(e);return e?.color?.background&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function dD({resetAllFilter:e,onChange:t,value:n,panelId:r,children:o}){return(0,Id.jsx)(_A,{label:(0,U.__)("Elements"),resetAll:()=>{const r=e(n);t(r)},panelId:r,hasInnerWrapper:!0,headingLevel:3,className:"color-block-support-panel",__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:Ey,children:(0,Id.jsx)("div",{className:"color-block-support-panel__inner-wrapper",children:o})})}const hD={text:!0,background:!0,link:!0,heading:!0,button:!0,caption:!0},pD={placement:"left-start",offset:36,shift:!0},{Tabs:fD}=wf(c_.j),mD=({indicators:e,label:t})=>(0,Id.jsxs)(QS.A,{justify:"flex-start",children:[(0,Id.jsx)(uN,{isLayered:!1,offset:-8,children:e.map(((e,t)=>(0,Id.jsx)(j_.A,{expanded:!1,children:(0,Id.jsx)(mT,{colorValue:e})},t)))}),(0,Id.jsx)(T_.A,{className:"block-editor-panel-color-gradient-settings__color-name",title:t,children:t})]});function gD({isGradient:e,inheritedValue:t,userValue:n,setValue:r,colorGradientControlSettings:o}){return(0,Id.jsx)(rD,{...o,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:e?void 0:t,gradientValue:e?t:void 0,onColorChange:e?void 0:r,onGradientChange:e?r:void 0,clearable:t===n,headingLevel:3})}function bD({label:e,hasValue:t,resetValue:n,isShownByDefault:r,indicators:o,tabs:i,colorGradientControlSettings:s,panelId:a}){var l;const c=i.find((e=>void 0!==e.userValue)),{key:u,...d}=null!==(l=i[0])&&void 0!==l?l:{};return(0,Id.jsx)(qA,{className:"block-editor-tools-panel-color-gradient-settings__item",hasValue:t,label:e,onDeselect:n,isShownByDefault:r,panelId:a,children:(0,Id.jsx)(DE.A,{popoverProps:pD,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:({onToggle:t,isOpen:n})=>{const r={onClick:t,className:(0,Vy.A)("block-editor-panel-color-gradient-settings__dropdown",{"is-open":n}),"aria-expanded":n,"aria-label":(0,U.sprintf)((0,U.__)("Color %s styles"),e)};return(0,Id.jsx)(Jy.Ay,{...r,children:(0,Id.jsx)(mD,{indicators:o,label:e})})},renderContent:()=>(0,Id.jsx)(OB,{paddingSize:"none",children:(0,Id.jsxs)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:[1===i.length&&(0,Id.jsx)(gD,{...d,colorGradientControlSettings:s},u),i.length>1&&(0,Id.jsxs)(fD,{defaultTabId:c?.key,children:[(0,Id.jsx)(fD.TabList,{children:i.map((e=>(0,Id.jsx)(fD.Tab,{tabId:e.key,children:e.label},e.key)))}),i.map((e=>{const{key:t,...n}=e;return(0,Id.jsx)(fD.TabPanel,{tabId:t,focusable:!1,children:(0,Id.jsx)(gD,{...n,colorGradientControlSettings:s},t)},t)}))]})]})})})})}function vD({as:e=dD,value:t,onChange:n,inheritedValue:r=t,settings:o,panelId:i,defaultControls:s=hD,children:a}){const l=zy(o),c=Uy(o),u=o?.color?.custom,d=o?.color?.customGradient,h=l.length>0||u,p=c.length>0||d,f=e=>jy({settings:o},"",e),m=e=>{const t=l.flatMap((({colors:e})=>e)).find((({color:t})=>t===e));return t?"var:preset|color|"+t.slug:e},g=e=>{const t=c.flatMap((({gradients:e})=>e)).find((({gradient:t})=>t===e));return t?"var:preset|gradient|"+t.slug:e},b=uD(o),v=f(r?.color?.background),y=f(t?.color?.background),_=f(r?.color?.gradient),x=f(t?.color?.gradient),w=sD(o),C=f(r?.elements?.link?.color?.text),S=f(t?.elements?.link?.color?.text),A=f(r?.elements?.link?.[":hover"]?.color?.text),E=f(t?.elements?.link?.[":hover"]?.color?.text),I=iD(o),j=f(r?.color?.text),T=f(t?.color?.text),B=e=>{let r=Pf(t,["color","text"],m(e));j===C&&(r=Pf(r,["elements","link","color","text"],m(e))),n(r)},R=[{name:"caption",label:(0,U.__)("Captions"),showPanel:aD(o)},{name:"button",label:(0,U.__)("Button"),showPanel:cD(o)},{name:"heading",label:(0,U.__)("Heading"),showPanel:lD(o)},{name:"h1",label:(0,U.__)("H1"),showPanel:lD(o)},{name:"h2",label:(0,U.__)("H2"),showPanel:lD(o)},{name:"h3",label:(0,U.__)("H3"),showPanel:lD(o)},{name:"h4",label:(0,U.__)("H4"),showPanel:lD(o)},{name:"h5",label:(0,U.__)("H5"),showPanel:lD(o)},{name:"h6",label:(0,U.__)("H6"),showPanel:lD(o)}],N=(0,k.useCallback)((e=>({...e,color:void 0,elements:{...e?.elements,link:{...e?.elements?.link,color:void 0,":hover":{color:void 0}},...R.reduce(((t,n)=>({...t,[n.name]:{...e?.elements?.[n.name],color:void 0}})),{})}})),[]),D=[I&&{key:"text",label:(0,U.__)("Text"),hasValue:()=>!!T,resetValue:()=>B(void 0),isShownByDefault:s.text,indicators:[j],tabs:[{key:"text",label:(0,U.__)("Text"),inheritedValue:j,setValue:B,userValue:T}]},b&&{key:"background",label:(0,U.__)("Background"),hasValue:()=>!!y||!!x,resetValue:()=>{const e=Pf(t,["color","background"],void 0);e.color.gradient=void 0,n(e)},isShownByDefault:s.background,indicators:[null!=_?_:v],tabs:[h&&{key:"background",label:(0,U.__)("Color"),inheritedValue:v,setValue:e=>{const r=Pf(t,["color","background"],m(e));r.color.gradient=void 0,n(r)},userValue:y},p&&{key:"gradient",label:(0,U.__)("Gradient"),inheritedValue:_,setValue:e=>{const r=Pf(t,["color","gradient"],g(e));r.color.background=void 0,n(r)},userValue:x,isGradient:!0}].filter(Boolean)},w&&{key:"link",label:(0,U.__)("Link"),hasValue:()=>!!S||!!E,resetValue:()=>{let e=Pf(t,["elements","link",":hover","color","text"],void 0);e=Pf(e,["elements","link","color","text"],void 0),n(e)},isShownByDefault:s.link,indicators:[C,A],tabs:[{key:"link",label:(0,U.__)("Default"),inheritedValue:C,setValue:e=>{n(Pf(t,["elements","link","color","text"],m(e)))},userValue:S},{key:"hover",label:(0,U.__)("Hover"),inheritedValue:A,setValue:e=>{n(Pf(t,["elements","link",":hover","color","text"],m(e)))},userValue:E}]}].filter(Boolean);return R.forEach((({name:e,label:o,showPanel:i})=>{if(!i)return;const a=f(r?.elements?.[e]?.color?.background),l=f(r?.elements?.[e]?.color?.gradient),c=f(r?.elements?.[e]?.color?.text),u=f(t?.elements?.[e]?.color?.background),d=f(t?.elements?.[e]?.color?.gradient),b=f(t?.elements?.[e]?.color?.text),v="caption"!==e;D.push({key:e,label:o,hasValue:()=>!!(b||u||d),resetValue:()=>{const r=Pf(t,["elements",e,"color","background"],void 0);r.elements[e].color.gradient=void 0,r.elements[e].color.text=void 0,n(r)},isShownByDefault:s[e],indicators:v?[c,null!=l?l:a]:[c],tabs:[h&&{key:"text",label:(0,U.__)("Text"),inheritedValue:c,setValue:r=>{n(Pf(t,["elements",e,"color","text"],m(r)))},userValue:b},h&&v&&{key:"background",label:(0,U.__)("Background"),inheritedValue:a,setValue:r=>{const o=Pf(t,["elements",e,"color","background"],m(r));o.elements[e].color.gradient=void 0,n(o)},userValue:u},p&&v&&{key:"gradient",label:(0,U.__)("Gradient"),inheritedValue:l,setValue:r=>{const o=Pf(t,["elements",e,"color","gradient"],g(r));o.elements[e].color.background=void 0,n(o)},userValue:d,isGradient:!0}].filter(Boolean)})})),(0,Id.jsxs)(e,{resetAllFilter:N,value:t,onChange:n,panelId:i,children:[D.map((e=>{const{key:t,...n}=e;return(0,Id.jsx)(bD,{...n,colorGradientControlSettings:{colors:l,disableCustomColors:!u,gradients:c,disableCustomGradients:!d},panelId:i},t)})),a]})}(0,nc.X$)([rc.A,oc.A]);const yD=function({backgroundColor:e,fallbackBackgroundColor:t,fallbackTextColor:n,fallbackLinkColor:r,fontSize:o,isLargeText:i,textColor:s,linkColor:a,enableAlphaChecker:l=!1}){const c=e||t;if(!c)return null;const u=s||n,d=a||r;if(!u&&!d)return null;const h=[{color:u,description:(0,U.__)("text color")},{color:d,description:(0,U.__)("link color")}],p=(0,nc.Mj)(c),f=p.alpha()<1,m=p.brightness(),g={level:"AA",size:i||!1!==i&&o>=24?"large":"small"};let b="",v="";for(const e of h){if(!e.color)continue;const t=(0,nc.Mj)(e.color),n=t.isReadable(p,g),r=t.alpha()<1;if(!n){if(f||r)continue;b=m{if(!a.current)return;o(_D(a.current).color);const e=a.current?.querySelector("a");e&&e.innerText&&s(_D(e).color);let t=a.current,r=_D(t).backgroundColor;for(;"rgba(0, 0, 0, 0)"===r&&t.parentNode&&t.parentNode.nodeType===t.parentNode.ELEMENT_NODE;)t=t.parentNode,r=_D(t).backgroundColor;n(r)})),(0,Id.jsx)(yD,{backgroundColor:t,textColor:r,enableAlphaChecker:!0,linkColor:i})}const wD="color",kD=e=>{const t=Sc(e,wD);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},CD=e=>{if("web"!==Ph.A.OS)return!1;const t=Sc(e,wD);return null!==t&&"object"==typeof t&&!!t.link},SD=e=>{const t=Sc(e,wD);return null!==t&&"object"==typeof t&&!!t.gradients},AD=e=>{const t=Sc(e,wD);return t&&!1!==t.background},ED=e=>{const t=Sc(e,wD);return t&&!1!==t.text};function ID(e,t,n){if(!kD(t)||Wy(t,wD))return e;const r=SD(t),{backgroundColor:o,textColor:i,gradient:s,style:a}=n,l=e=>!Wy(t,wD,e),c=l("text")?Qj("color",i):void 0,u=l("gradients")?function(e){if(e)return`has-${e}-gradient-background`}(s):void 0,d=l("background")?Qj("background-color",o):void 0,h=l("background")||l("gradients"),p=o||a?.color?.background||r&&(s||a?.color?.gradient),f=(0,Vy.A)(e.className,c,u,{[d]:!(r&&a?.color?.gradient||!d),"has-text-color":l("text")&&(i||a?.color?.text),"has-background":h&&p,"has-link-color":l("link")&&a?.elements?.link?.color});return e.className=f||void 0,e}function jD(e){const t=e?.color?.text,n=t?.startsWith("var:preset|color|")?t.substring(17):void 0,r=e?.color?.background,o=r?.startsWith("var:preset|color|")?r.substring(17):void 0,i=e?.color?.gradient,s=i?.startsWith("var:preset|gradient|")?i.substring(20):void 0,a={...e};return a.color={...a.color,text:n?void 0:t,background:o?void 0:r,gradient:s?void 0:i},{style:Hy(a),textColor:n,backgroundColor:o,gradient:s}}function TD(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 BD({children:e,resetAllFilter:t}){const n=(0,k.useCallback)((e=>{const n=TD(e),r=t(n);return{...e,...jD(r)}}),[t]);return(0,Id.jsx)(AA,{group:"color",resetAllFilter:n,children:e})}function RD({clientId:e,name:t,setAttributes:n,settings:r}){const o=oD(r),{style:i,textColor:s,backgroundColor:a,gradient:l}=(0,Fl.A)((function(t){const{style:n,textColor:r,backgroundColor:o,gradient:i}=t(uy).getBlockAttributes(e)||{};return{style:n,textColor:r,backgroundColor:o,gradient:i}}),[e]),c=(0,k.useMemo)((()=>TD({style:i,textColor:s,backgroundColor:a,gradient:l})),[i,s,a,l]);if(!o)return null;const u=Sc(t,[wD,"__experimentalDefaultControls"]),d="web"===Ph.A.OS&&!c?.color?.gradient&&(r?.color?.text||r?.color?.link)&&!1!==Sc(t,[wD,"enableContrastChecker"]);return(0,Id.jsx)(vD,{as:BD,panelId:e,settings:r,value:c,onChange:e=>{n(jD(e))},defaultControls:u,enableContrastChecker:!1!==Sc(t,[wD,"enableContrastChecker"]),children:d&&(0,Id.jsx)(xD,{clientId:e})})}const ND={useBlockProps:function({name:e,backgroundColor:t,textColor:n,gradient:r,style:o}){const[i,s,a]=hy("color.palette.custom","color.palette.theme","color.palette.default"),l=(0,k.useMemo)((()=>[...i||[],...s||[],...a||[]]),[i,s,a]);if(!kD(e)||Wy(e,wD))return{};const c={};n&&!Wy(e,wD,"text")&&(c.color=Xj(l,n)?.color),t&&!Wy(e,wD,"background")&&(c.backgroundColor=Xj(l,t)?.color);const u=ID({style:c},e,{textColor:n,backgroundColor:t,gradient:r,style:o}),d=t||o?.color?.background||r||o?.color?.gradient;return{...u,className:(0,Vy.A)(u.className,!d&&Bj(o))}},addSaveProps:ID,attributeKeys:["backgroundColor","textColor","gradient","style"],hasSupport:kD},DD={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};(0,Iu.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return kD(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),SD(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,Iu.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,r){const o=e.name;return $y({linkColor:CD(o),textColor:ED(o),backgroundColor:AD(o),gradient:SD(o)},DD,e,t,n,r)}));var MD=n(56875);function PD(e){const[t,...n]=e;if(!t)return null;const[,r]=Hw(t.size),o=n.every((e=>{const[,t]=Hw(e.size);return t===r}));return o?r:null}const OD=(0,H_.default)("fieldset",{target:"e8tqeku4"})({name:"1t1ytme",styles:"border:0;margin:0;padding:0"}),LD=(0,H_.default)(QS.A,{target:"e8tqeku3"})("height:",(0,Kw.x)(4),";"),FD=(0,H_.default)(Jy.Ay,{target:"e8tqeku2"})("margin-top:",(0,Kw.x)(-1),";"),zD=(0,H_.default)(V_.Ay.VisualLabel,{target:"e8tqeku1"})("display:flex;gap:",(0,Kw.x)(1),";justify-content:flex-start;margin-bottom:0;"),UD=(0,H_.default)("span",{target:"e8tqeku0"})("color:",W_.l.gray[700],";");var VD=n(76502);const HD={key:"default",name:(0,U.__)("Default"),value:void 0},$D={key:"custom",name:(0,U.__)("Custom")},WD=e=>{var t;const{__next40pxDefaultSize:n,fontSizes:r,value:o,disableCustomFontSizes:i,size:s,onChange:a,onSelectCustom:l}=e,c=!!PD(r),u=[HD,...r.map((e=>{let t;if(c){const[n]=Hw(e.size);void 0!==n&&(t=String(n))}else(function(e){return/^[\d\.]+(px|em|rem|vw|vh|%|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)?$/i.test(String(e))})(e.size)&&(t=String(e.size));return{key:e.slug,name:e.name||e.slug,value:e.size,__experimentalHint:t}})),...i?[]:[$D]],d=o?null!==(t=u.find((e=>e.value===o)))&&void 0!==t?t:$D:HD;return(0,Id.jsx)(VD.A,{__next40pxDefaultSize:n,className:"components-font-size-picker__select",label:(0,U.__)("Font size"),hideLabelFromVision:!0,describedBy:(0,U.sprintf)((0,U.__)("Currently selected font size: %s"),d.name),options:u,value:d,__experimentalShowSelectedHint:!0,onChange:({selectedItem:e})=>{e===$D?l():a(e.value)},size:s})},GD=[(0,U.__)("S"),(0,U.__)("M"),(0,U.__)("L"),(0,U.__)("XL"),(0,U.__)("XXL")],qD=[(0,U.__)("Small"),(0,U.__)("Medium"),(0,U.__)("Large"),(0,U.__)("Extra Large"),(0,U.__)("Extra Extra Large")],KD=e=>{const{fontSizes:t,value:n,__next40pxDefaultSize:r,size:o,onChange:i}=e;return(0,Id.jsx)(_x,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:r,label:(0,U.__)("Font size"),hideLabelFromVision:!0,value:n,onChange:i,isBlock:!0,size:o,children:t.map(((e,t)=>(0,Id.jsx)(LC,{value:e.size,label:GD[t],"aria-label":e.name||qD[t],showTooltip:!0},e.slug)))})},YD=["px","em","rem","vw","vh"],JD=(0,k.forwardRef)(((e,t)=>{const{__next40pxDefaultSize:n=!1,fallbackFontSize:r,fontSizes:o=[],disableCustomFontSizes:i=!1,onChange:s,size:a="default",units:l=YD,value:c,withSlider:u=!1,withReset:d=!0}=e,h=$w({availableUnits:l}),p=o.length>5,f=o.find((e=>e.size===c)),m=!!c&&!f,[g,b]=(0,k.useState)(!i&&m),v=(0,k.useMemo)((()=>{if(g)return(0,U.__)("Custom");if(!p)return f?f.name||qD[o.indexOf(f)]:"";const e=PD(o);return e?`(${e})`:""}),[g,p,f,o]);if(0===o.length&&i)return null;const y="string"==typeof c||"string"==typeof o[0]?.size,[_,x]=Hw(c,h),w=!!x&&["em","rem","vw","vh"].includes(x),C=void 0===c;return(0,Id.jsxs)(OD,{ref:t,className:"components-font-size-picker",children:[(0,Id.jsx)($A.A,{as:"legend",children:(0,U.__)("Font size")}),(0,Id.jsx)(RT.A,{children:(0,Id.jsxs)(LD,{className:"components-font-size-picker__header",children:[(0,Id.jsxs)(zD,{"aria-label":`${(0,U.__)("Size")} ${v||""}`,children:[(0,U.__)("Size"),v&&(0,Id.jsx)(UD,{className:"components-font-size-picker__header__hint",children:v})]}),!i&&(0,Id.jsx)(FD,{label:g?(0,U.__)("Use size preset"):(0,U.__)("Set custom size"),icon:MD.A,onClick:()=>{b(!g)},isPressed:g,size:"small"})]})}),(0,Id.jsxs)("div",{children:[!!o.length&&p&&!g&&(0,Id.jsx)(WD,{__next40pxDefaultSize:n,fontSizes:o,value:c,disableCustomFontSizes:i,size:a,onChange:e=>{void 0===e?s?.(void 0):s?.(y?e:Number(e),o.find((t=>t.size===e)))},onSelectCustom:()=>b(!0)}),!p&&!g&&(0,Id.jsx)(KD,{fontSizes:o,value:c,__next40pxDefaultSize:n,size:a,onChange:e=>{void 0===e?s?.(void 0):s?.(y?e:Number(e),o.find((t=>t.size===e)))}}),!i&&g&&(0,Id.jsxs)(j_.A,{className:"components-font-size-picker__custom-size-control",children:[(0,Id.jsx)(T_.A,{isBlock:!0,children:(0,Id.jsx)(ik,{__next40pxDefaultSize:n,label:(0,U.__)("Custom"),labelPosition:"top",hideLabelFromVision:!0,value:c,onChange:e=>{s?.(void 0===e?void 0:y?e:parseInt(e,10))},size:a,units:y?h:[],min:0})}),u&&(0,Id.jsx)(T_.A,{isBlock:!0,children:(0,Id.jsx)(RT.A,{marginX:2,marginBottom:0,children:(0,Id.jsx)(OC,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:n,className:"components-font-size-picker__custom-input",label:(0,U.__)("Custom Size"),hideLabelFromVision:!0,value:_,initialPosition:r,withInputField:!1,onChange:e=>{s?.(void 0===e?void 0:y?e+(null!=x?x:"px"):e)},min:0,max:w?10:100,step:w?.1:1})})}),d&&(0,Id.jsx)(T_.A,{children:(0,Id.jsx)(Jy.$n,{disabled:C,__experimentalIsFocusable:!0,onClick:()=>{s?.(void 0)},variant:"secondary",__next40pxDefaultSize:!0,size:"__unstable-large"===a||e.__next40pxDefaultSize?"default":"small",children:(0,U.__)("Reset")})})]})]})]})})),XD=JD;function ZD({value:e="",onChange:t,fontFamilies:n,...r}){const[o]=hy("typography.fontFamilies");if(n||(n=o),!n||0===n.length)return null;const i=[{value:"",label:(0,U.__)("Default")},...n.map((({fontFamily:e,name:t})=>({value:e,label:t||e})))];return(0,Id.jsx)(vT.A,{label:(0,U.__)("Font"),options:i,value:e,onChange:t,labelPosition:"top",...r})}const QD=[{name:(0,U._x)("Regular","font style"),value:"normal"},{name:(0,U._x)("Italic","font style"),value:"italic"}],eM=[{name:(0,U._x)("Thin","font weight"),value:"100"},{name:(0,U._x)("Extra Light","font weight"),value:"200"},{name:(0,U._x)("Light","font weight"),value:"300"},{name:(0,U._x)("Regular","font weight"),value:"400"},{name:(0,U._x)("Medium","font weight"),value:"500"},{name:(0,U._x)("Semi Bold","font weight"),value:"600"},{name:(0,U._x)("Bold","font weight"),value:"700"},{name:(0,U._x)("Extra Bold","font weight"),value:"800"},{name:(0,U._x)("Black","font weight"),value:"900"}],tM=(e,t)=>e?t?(0,U.__)("Appearance"):(0,U.__)("Font style"):(0,U.__)("Font weight");function nM(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:r=!0,value:{fontStyle:o,fontWeight:i},...s}=e,a=n||r,l=tM(n,r),c={key:"default",name:(0,U.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},u=(0,k.useMemo)((()=>n&&r?(()=>{const e=[c];return QD.forEach((({name:t,value:n})=>{eM.forEach((({name:r,value:o})=>{const i="normal"===n?r:(0,U.sprintf)((0,U.__)("%1$s %2$s"),r,t);e.push({key:`${n}-${o}`,name:i,style:{fontStyle:n,fontWeight:o}})}))})),e})():n?(()=>{const e=[c];return QD.forEach((({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:n,fontWeight:void 0}})})),e})():(()=>{const e=[c];return eM.forEach((({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:void 0,fontWeight:n}})})),e})()),[e.options]),d=u.find((e=>e.style.fontStyle===o&&e.style.fontWeight===i))||u[0];return a&&(0,Id.jsx)(VD.G,{...s,className:"components-font-appearance-control",label:l,describedBy:d?n?r?(0,U.sprintf)((0,U.__)("Currently selected font appearance: %s"),d.name):(0,U.sprintf)((0,U.__)("Currently selected font style: %s"),d.name):(0,U.sprintf)((0,U.__)("Currently selected font weight: %s"),d.name):(0,U.__)("No selected font appearance"),options:u,value:d,onChange:({selectedItem:e})=>t(e.style)})}const rM=({value:e,onChange:t,__nextHasNoMarginBottom:n=!1,__unstableInputWidth:r="60px",...o})=>{const i=function(e){return void 0!==e&&""!==e}(e),s=(e,t)=>{if(i)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return 1.5;default:return e}},a=i?e:"";n||(0,W.default)("Bottom margin styles for wp.blockEditor.LineHeightControl",{since:"6.0",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"});const l=n?void 0:{marginBottom:24};return(0,Id.jsx)("div",{className:"block-editor-line-height-control",style:l,children:(0,Id.jsx)(Gw.A,{...o,__unstableInputWidth:r,__unstableStateReducer:(e,t)=>{const n=["insertText","insertFromPaste"].includes(t.payload.event.nativeEvent?.inputType),r=s(e.value,n);return{...e,value:r}},onChange:(e,{event:n})=>{""!==e?"click"!==n.type?t(`${e}`):t(s(`${e}`,!1)):t()},label:(0,U.__)("Line height"),placeholder:1.5,step:.01,spinFactor:10,value:a,min:0,spinControls:"custom"})})};function oM({value:e,onChange:t,__unstableInputWidth:n="60px",...r}){const[o]=hy("spacing.units"),i=$w({availableUnits:o||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,Id.jsx)(ik,{...r,label:(0,U.__)("Letter spacing"),value:e,__unstableInputWidth:n,units:i,onChange:t})}var iM=n(1807),sM=n(48123),aM=n(19758),lM=n(63900);function cM({label:e,value:t,options:n,onChange:r,className:o}){return(0,Id.jsxs)("fieldset",{className:(0,Vy.A)("block-editor-segmented-text-control",o),children:[(0,Id.jsx)(V_.Ay.VisualLabel,{as:"legend",children:e}),(0,Id.jsx)("div",{className:"block-editor-segmented-text-control__buttons",children:n.map((e=>(0,Id.jsx)(Jy.Ay,{size:"compact",icon:e.icon,label:e.label,isPressed:e.value===t,onClick:()=>r(e.value)},e.value)))})]})}const uM=[{label:(0,U.__)("Align text left"),value:"left",icon:iM.A},{label:(0,U.__)("Align text center"),value:"center",icon:sM.A},{label:(0,U.__)("Align text right"),value:"right",icon:aM.A},{label:(0,U.__)("Justify text"),value:"justify",icon:lM.A}],dM=["left","center","right"];function hM({className:e,value:t,onChange:n,options:r=dM}){const o=(0,k.useMemo)((()=>uM.filter((e=>r.includes(e.value)))),[r]);return o.length?(0,Id.jsx)(cM,{label:(0,U.__)("Text alignment"),options:o,className:(0,Vy.A)("block-editor-text-alignment-control",e),value:t,onChange:e=>{n(e===t?void 0:e)}}):null}var pM=n(69267),fM=n(8732),mM=n(12941),gM=n(26868);const bM=[{label:(0,U.__)("None"),value:"none",icon:pM.A},{label:(0,U.__)("Uppercase"),value:"uppercase",icon:fM.A},{label:(0,U.__)("Lowercase"),value:"lowercase",icon:mM.A},{label:(0,U.__)("Capitalize"),value:"capitalize",icon:gM.A}];function vM({className:e,value:t,onChange:n}){return(0,Id.jsx)(cM,{label:(0,U.__)("Letter case"),options:bM,className:(0,Vy.A)("block-editor-text-transform-control",e),value:t,onChange:e=>{n(e===t?void 0:e)}})}var yM=n(73048),_M=n(11047);const xM=[{label:(0,U.__)("None"),value:"none",icon:pM.A},{label:(0,U.__)("Underline"),value:"underline",icon:yM.A},{label:(0,U.__)("Strikethrough"),value:"line-through",icon:_M.A}];function wM({value:e,onChange:t,className:n}){return(0,Id.jsx)(cM,{label:(0,U.__)("Decoration"),options:xM,className:(0,Vy.A)("block-editor-text-decoration-control",n),value:e,onChange:n=>{t(n===e?void 0:n)}})}var kM=n(33690),CM=n(12816);const SM=[{label:(0,U.__)("Horizontal"),value:"horizontal-tb",icon:kM.A},{label:(0,U.__)("Vertical"),value:(0,U.isRTL)()?"vertical-lr":"vertical-rl",icon:CM.A}];function AM({className:e,value:t,onChange:n}){return(0,Id.jsx)(cM,{label:(0,U.__)("Orientation"),options:SM,className:(0,Vy.A)("block-editor-writing-mode-control",e),value:t,onChange:e=>{n(e===t?void 0:e)}})}const EM=1,IM=6;function jM(e){const t=BM(e),n=RM(e),r=NM(e),o=DM(e),i=PM(e),s=MM(e),a=OM(e),l=LM(e),c=FM(e),u=TM(e);return t||n||r||o||i||s||u||a||l||c}function TM(e){return!1!==e?.typography?.defaultFontSizes&&e?.typography?.fontSizes?.default?.length||e?.typography?.fontSizes?.theme?.length||e?.typography?.fontSizes?.custom?.length||e?.typography?.customFontSize}function BM(e){return["default","theme","custom"].some((t=>e?.typography?.fontFamilies?.[t]?.length))}function RM(e){return e?.typography?.lineHeight}function NM(e){return e?.typography?.fontStyle||e?.typography?.fontWeight}function DM(e){return e?.typography?.letterSpacing}function MM(e){return e?.typography?.textTransform}function PM(e){return e?.typography?.textAlign}function OM(e){return e?.typography?.textDecoration}function LM(e){return e?.typography?.writingMode}function FM(e){return e?.typography?.textColumns}function zM({resetAllFilter:e,onChange:t,value:n,panelId:r,children:o}){return(0,Id.jsx)(_A,{label:(0,U.__)("Typography"),resetAll:()=>{const r=e(n);t(r)},panelId:r,dropdownMenuProps:Ey,children:o})}const UM={fontFamily:!0,fontSize:!0,fontAppearance:!0,lineHeight:!0,letterSpacing:!0,textAlign:!0,textTransform:!0,textDecoration:!0,writingMode:!0,textColumns:!0};function VM({as:e=zM,value:t,onChange:n,inheritedValue:r=t,settings:o,panelId:i,defaultControls:s=UM}){const a=e=>jy({settings:o},"",e),l=BM(o),c=o?.typography?.fontFamilies,u=(0,k.useMemo)((()=>["default","theme","custom"].flatMap((e=>{var t;return null!==(t=c?.[e])&&void 0!==t?t:[]}))),[c]),d=a(r?.typography?.fontFamily),h=e=>{const r=u?.find((({fontFamily:t})=>t===e))?.slug;n(Pf(t,["typography","fontFamily"],r?`var:preset|font-family|${r}`:e||void 0))},p=TM(o),f=!o?.typography?.customFontSize,m=function(e){var t,n,r;const o=e?.typography?.fontSizes,i=!!e?.typography?.defaultFontSizes;return[...null!==(t=o?.custom)&&void 0!==t?t:[],...null!==(n=o?.theme)&&void 0!==n?n:[],...i&&null!==(r=o?.default)&&void 0!==r?r:[]]}(o),g=a(r?.typography?.fontSize),b=(e,r)=>{n(Pf(t,["typography","fontSize"],(r?.slug?`var:preset|font-size|${r?.slug}`:e)||void 0))},v=NM(o),y=function(e){return e?.typography?.fontStyle?e?.typography?.fontWeight?(0,U.__)("Appearance"):(0,U.__)("Font style"):(0,U.__)("Font weight")}(o),_=o?.typography?.fontStyle,x=o?.typography?.fontWeight,w=a(r?.typography?.fontStyle),C=a(r?.typography?.fontWeight),S=({fontStyle:e,fontWeight:r})=>{n({...t,typography:{...t?.typography,fontStyle:e||void 0,fontWeight:r||void 0}})},A=RM(o),E=a(r?.typography?.lineHeight),I=e=>{n(Pf(t,["typography","lineHeight"],e||void 0))},j=DM(o),T=a(r?.typography?.letterSpacing),B=e=>{n(Pf(t,["typography","letterSpacing"],e||void 0))},R=FM(o),N=a(r?.typography?.textColumns),D=e=>{n(Pf(t,["typography","textColumns"],e||void 0))},M=MM(o),P=a(r?.typography?.textTransform),O=e=>{n(Pf(t,["typography","textTransform"],e||void 0))},L=OM(o),F=a(r?.typography?.textDecoration),z=e=>{n(Pf(t,["typography","textDecoration"],e||void 0))},V=LM(o),H=a(r?.typography?.writingMode),$=e=>{n(Pf(t,["typography","writingMode"],e||void 0))},W=PM(o),G=a(r?.typography?.textAlign),q=e=>{n(Pf(t,["typography","textAlign"],e||void 0))},K=(0,k.useCallback)((e=>({...e,typography:{}})),[]);return(0,Id.jsxs)(e,{resetAllFilter:K,value:t,onChange:n,panelId:i,children:[l&&(0,Id.jsx)(qA,{label:(0,U.__)("Font"),hasValue:()=>!!t?.typography?.fontFamily,onDeselect:()=>h(void 0),isShownByDefault:s.fontFamily,panelId:i,children:(0,Id.jsx)(ZD,{fontFamilies:u,value:d,onChange:h,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),p&&(0,Id.jsx)(qA,{label:(0,U.__)("Size"),hasValue:()=>!!t?.typography?.fontSize,onDeselect:()=>b(void 0),isShownByDefault:s.fontSize,panelId:i,children:(0,Id.jsx)(XD,{value:g,onChange:b,fontSizes:m,disableCustomFontSizes:f,withReset:!1,withSlider:!0,size:"__unstable-large"})}),v&&(0,Id.jsx)(qA,{className:"single-column",label:y,hasValue:()=>!!t?.typography?.fontStyle||!!t?.typography?.fontWeight,onDeselect:()=>{S({})},isShownByDefault:s.fontAppearance,panelId:i,children:(0,Id.jsx)(nM,{value:{fontStyle:w,fontWeight:C},onChange:S,hasFontStyles:_,hasFontWeights:x,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),A&&(0,Id.jsx)(qA,{className:"single-column",label:(0,U.__)("Line height"),hasValue:()=>void 0!==t?.typography?.lineHeight,onDeselect:()=>I(void 0),isShownByDefault:s.lineHeight,panelId:i,children:(0,Id.jsx)(rM,{__nextHasNoMarginBottom:!0,__unstableInputWidth:"auto",value:E,onChange:I,size:"__unstable-large"})}),j&&(0,Id.jsx)(qA,{className:"single-column",label:(0,U.__)("Letter spacing"),hasValue:()=>!!t?.typography?.letterSpacing,onDeselect:()=>B(void 0),isShownByDefault:s.letterSpacing,panelId:i,children:(0,Id.jsx)(oM,{value:T,onChange:B,size:"__unstable-large",__unstableInputWidth:"auto"})}),R&&(0,Id.jsx)(qA,{className:"single-column",label:(0,U.__)("Columns"),hasValue:()=>!!t?.typography?.textColumns,onDeselect:()=>D(void 0),isShownByDefault:s.textColumns,panelId:i,children:(0,Id.jsx)(Gw.A,{label:(0,U.__)("Columns"),max:IM,min:EM,onChange:D,size:"__unstable-large",spinControls:"custom",value:N,initialPosition:1})}),L&&(0,Id.jsx)(qA,{className:"single-column",label:(0,U.__)("Decoration"),hasValue:()=>!!t?.typography?.textDecoration,onDeselect:()=>z(void 0),isShownByDefault:s.textDecoration,panelId:i,children:(0,Id.jsx)(wM,{value:F,onChange:z,size:"__unstable-large",__unstableInputWidth:"auto"})}),V&&(0,Id.jsx)(qA,{className:"single-column",label:(0,U.__)("Orientation"),hasValue:()=>!!t?.typography?.writingMode,onDeselect:()=>$(void 0),isShownByDefault:s.writingMode,panelId:i,children:(0,Id.jsx)(AM,{value:H,onChange:$,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),M&&(0,Id.jsx)(qA,{label:(0,U.__)("Letter case"),hasValue:()=>!!t?.typography?.textTransform,onDeselect:()=>O(void 0),isShownByDefault:s.textTransform,panelId:i,children:(0,Id.jsx)(vM,{value:P,onChange:O,showNone:!0,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),W&&(0,Id.jsx)(qA,{label:(0,U.__)("Text alignment"),hasValue:()=>!!t?.typography?.textAlign,onDeselect:()=>q(void 0),isShownByDefault:s.textAlign,panelId:i,children:(0,Id.jsx)(hM,{value:G,onChange:q,size:"__unstable-large",__nextHasNoMarginBottom:!0})})]})}class HM{constructor(e=""){this.value=e,this._currentValue,this._valueAsArray}entries(...e){return this._valueAsArray.entries(...e)}forEach(...e){return this._valueAsArray.forEach(...e)}keys(...e){return this._valueAsArray.keys(...e)}values(...e){return this._valueAsArray.values(...e)}get value(){return this._currentValue}set value(e){e=String(e),this._valueAsArray=[...new Set(e.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(e){return this._valueAsArray[e]}contains(e){return-1!==this._valueAsArray.indexOf(e)}add(...e){this.value+=" "+e.join(" ")}remove(...e){this.value=this._valueAsArray.filter((t=>!e.includes(t))).join(" ")}toggle(e,t){return void 0===t&&(t=!this.contains(e)),t?this.add(e):this.remove(e),t}replace(e,t){return!!this.contains(e)&&(this.remove(e),this.add(t),!0)}supports(){return!0}}const $M="typography.__experimentalFontFamily",{kebabCase:WM}=wf(c_.j);function GM(e,t,n){if(!Ac(t,$M))return e;if(Wy(t,hP,"fontFamily"))return e;if(!n?.fontFamily)return e;const r=new HM(e.className);r.add(`has-${WM(n?.fontFamily)}-font-family`);const o=r.value;return e.className=o||void 0,e}const qM={useBlockProps:function({name:e,fontFamily:t}){return GM({},e,{fontFamily:t})},addSaveProps:GM,attributeKeys:["fontFamily"],hasSupport:e=>Ac(e,$M)};(0,Iu.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return Ac(e,$M)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e}));const{kebabCase:KM}=wf(c_.j),YM=(e,t,n)=>{if(t){const n=e?.find((({slug:e})=>e===t));if(n)return n}return{size:n}};function JM(e){if(e)return`has-${KM(e)}-font-size`}const XM="typography.fontSize";function ZM(e,t,n){if(!Ac(t,XM))return e;if(Wy(t,hP,"fontSize"))return e;const r=new HM(e.className);r.add(JM(n.fontSize));const o=r.value;return e.className=o||void 0,e}const QM={useBlockProps:function({name:e,fontSize:t,style:n}){const[r,o,i]=hy("typography.fontSizes","typography.fluid","layout");if(!Ac(e,XM)||Wy(e,hP,"fontSize")||!t&&!n?.typography?.fontSize)return;let s;return n?.typography?.fontSize&&(s={style:{fontSize:xy({size:n.typography.fontSize},{typography:{fluid:o},layout:i})}}),t&&(s={style:{fontSize:YM(r,t,n?.typography?.fontSize).size}}),s?ZM(s,e,{fontSize:t}):void 0},addSaveProps:ZM,attributeKeys:["fontSize","style"],hasSupport:e=>Ac(e,XM)},eP={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,Iu.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return Ac(e,XM)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,Iu.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,r){return $y({fontSize:Ac(e.name,XM)},eP,e,t,n,r)}));const tP=[{icon:iM.A,title:(0,U.__)("Align text left"),align:"left"},{icon:sM.A,title:(0,U.__)("Align text center"),align:"center"},{icon:aM.A,title:(0,U.__)("Align text right"),align:"right"}],nP={placement:"bottom-start"},rP=function({value:e,onChange:t,alignmentControls:n=tP,label:r=(0,U.__)("Align text"),describedBy:o=(0,U.__)("Change text alignment"),isCollapsed:i=!0,isToolbar:s}){function a(n){return()=>t(e===n?void 0:n)}const l=n.find((t=>t.align===e)),c=s?i_:y_,u=s?{isCollapsed:i}:{toggleProps:{describedBy:o},popoverProps:nP};return(0,Id.jsx)(c,{icon:l?l.icon:(0,U.isRTL)()?aM.A:iM.A,label:r,controls:n.map((t=>{const{align:n}=t,r=e===n;return{...t,isActive:r,role:i?"menuitemradio":void 0,onClick:a(n)}})),...u})},oP=e=>(0,Id.jsx)(rP,{...e,isToolbar:!1}),iP="typography.textAlign",sP=[{icon:iM.A,title:(0,U.__)("Align text left"),align:"left"},{icon:sM.A,title:(0,U.__)("Align text center"),align:"center"},{icon:aM.A,title:(0,U.__)("Align text right"),align:"right"}],aP=["left","center","right"],lP=[];function cP(e){return Array.isArray(e)?aP.filter((t=>e.includes(t))):!0===e?aP:lP}const uP={edit:function({style:e,name:t,setAttributes:n}){const r=Ky(t),o=r?.typography?.textAlign,i=AS();if(!o||"default"!==i)return null;const s=cP(Sc(t,iP));if(!s.length)return null;const a=sP.filter((e=>s.includes(e.align)));return(0,Id.jsx)(v_,{group:"block",children:(0,Id.jsx)(oP,{value:e?.typography?.textAlign,onChange:t=>{const r={...e,typography:{...e?.typography,textAlign:t}};n({style:Hy(r)})},alignmentControls:a})})},useBlockProps:function({name:e,style:t}){if(!t?.typography?.textAlign)return null;if(!cP(Sc(e,iP)).length)return null;if(Wy(e,hP,"textAlign"))return null;const n=t.typography.textAlign;return{className:(0,Vy.A)({[`has-text-align-${n}`]:n})}},addSaveProps:function(e,t,n){if(!n?.style?.typography?.textAlign)return e;const{textAlign:r}=n.style.typography;return cP(Sc(t,iP)).includes(r)&&!Wy(t,hP,"textAlign")&&(e.className=(0,Vy.A)(`has-text-align-${r}`,e.className)),e},attributeKeys:["style"],hasSupport:e=>Ac(e,iP,!1)};function dP(e,t){return Object.fromEntries(Object.entries(e).filter((([e])=>!t.includes(e))))}const hP="typography",pP=["typography.lineHeight",XM,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",$M,iP,"typography.textColumns","typography.__experimentalTextDecoration","typography.__experimentalWritingMode","typography.__experimentalTextTransform","typography.__experimentalLetterSpacing"];function fP(e){const t={...dP(e,["fontFamily"])},n=e?.typography?.fontSize,r=e?.typography?.fontFamily,o=n?.startsWith("var:preset|font-size|")?n.substring(21):void 0,i=r?.startsWith("var:preset|font-family|")?r.substring(23):void 0;return t.typography={...dP(t.typography,["fontFamily"]),fontSize:o?void 0:n},{style:Hy(t),fontFamily:i,fontSize:o}}function mP(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 gP({children:e,resetAllFilter:t}){const n=(0,k.useCallback)((e=>{const n=mP(e),r=t(n);return{...e,...fP(r)}}),[t]);return(0,Id.jsx)(AA,{group:"typography",resetAllFilter:n,children:e})}function bP({clientId:e,name:t,setAttributes:n,settings:r}){const{style:o,fontFamily:i,fontSize:s}=(0,Fl.A)((function(t){const{style:n,fontFamily:r,fontSize:o}=t(uy).getBlockAttributes(e)||{};return{style:n,fontFamily:r,fontSize:o}}),[e]),a=jM(r),l=(0,k.useMemo)((()=>mP({style:o,fontFamily:i,fontSize:s})),[o,s,i]);if(!a)return null;const c=Sc(t,[hP,"__experimentalDefaultControls"]);return(0,Id.jsx)(VM,{as:gP,panelId:e,settings:r,value:l,onChange:e=>{n(fP(e))},defaultControls:c})}const vP=(0,H_.default)("span",{target:"e1j5nr4z8"})({name:"1w884gc",styles:"box-sizing:border-box;display:block;width:24px;height:24px;position:relative;padding:4px"}),yP=(0,H_.default)("span",{target:"e1j5nr4z7"})({name:"i6vjox",styles:"box-sizing:border-box;display:block;position:relative;width:100%;height:100%"}),_P=({isFocused:e})=>(0,$_.css)({backgroundColor:"currentColor",opacity:e?1:.3},"",""),xP=(0,H_.default)("span",{target:"e1j5nr4z6"})("box-sizing:border-box;display:block;pointer-events:none;position:absolute;",_P,";"),wP=(0,H_.default)(xP,{target:"e1j5nr4z5"})({name:"1k2w39q",styles:"bottom:3px;top:3px;width:2px"}),kP=(0,H_.default)(xP,{target:"e1j5nr4z4"})({name:"1q9b07k",styles:"height:2px;left:3px;right:3px"}),CP=(0,H_.default)(kP,{target:"e1j5nr4z3"})({name:"abcix4",styles:"top:0"}),SP=(0,H_.default)(wP,{target:"e1j5nr4z2"})({name:"1wf8jf",styles:"right:0"}),AP=(0,H_.default)(kP,{target:"e1j5nr4z1"})({name:"8tapst",styles:"bottom:0"}),EP=(0,H_.default)(wP,{target:"e1j5nr4z0"})({name:"1ode3cm",styles:"left:0"});function IP({size:e=24,side:t="all",sides:n,...r}){const o=e=>!(e=>n?.length&&!n.includes(e))(e)&&("all"===t||t===e),i=o("top")||o("vertical"),s=o("right")||o("horizontal"),a=o("bottom")||o("vertical"),l=o("left")||o("horizontal"),c=e/24;return(0,Id.jsx)(vP,{style:{transform:`scale(${c})`},...r,children:(0,Id.jsxs)(yP,{children:[(0,Id.jsx)(CP,{isFocused:i}),(0,Id.jsx)(SP,{isFocused:s}),(0,Id.jsx)(AP,{isFocused:a}),(0,Id.jsx)(EP,{isFocused:l})]})})}const jP=(0,H_.default)(ik,{target:"e1jovhle5"})({name:"1ejyr19",styles:"max-width:90px"}),TP=(0,H_.default)(QS.A,{target:"e1jovhle4"})({name:"1j1lmoi",styles:"grid-column:1/span 3"}),BP=(0,H_.default)(Jy.Ay,{target:"e1jovhle3"})({name:"tkya7b",styles:"grid-area:1/2;justify-self:end"}),RP=(0,H_.default)("div",{target:"e1jovhle2"})({name:"1dfa8al",styles:"grid-area:1/3;justify-self:end"}),NP=(0,H_.default)(IP,{target:"e1jovhle1"})({name:"ou8xsw",styles:"flex:0 0 auto"}),DP=(0,H_.default)(OC,{target:"e1jovhle0"})("width:100%;margin-inline-end:",(0,Kw.x)(2),";"),MP={px:{max:300,step:1},"%":{max:100,step:1},vw:{max:100,step:1},vh:{max:100,step:1},em:{max:10,step:.1},rm:{max:10,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}},PP={all:(0,U.__)("All sides"),top:(0,U.__)("Top side"),bottom:(0,U.__)("Bottom side"),left:(0,U.__)("Left side"),right:(0,U.__)("Right side"),mixed:(0,U.__)("Mixed"),vertical:(0,U.__)("Top and bottom sides"),horizontal:(0,U.__)("Left and right sides")},OP={top:void 0,right:void 0,bottom:void 0,left:void 0},LP=["top","right","bottom","left"];function FP(e){return e.sort(((t,n)=>e.filter((e=>e===t)).length-e.filter((e=>e===n)).length)).pop()}function zP(e={},t,n=LP){const r=function(e){const t=[];if(!e?.length)return LP;if(e.includes("vertical"))t.push("top","bottom");else if(e.includes("horizontal"))t.push("left","right");else{const n=LP.filter((t=>e.includes(t)));t.push(...n)}return t}(n).map((t=>Hw(e[t]))),o=r.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),i=r.map((e=>e[1])),s=o.every((e=>e===o[0]))?o[0]:"";let a;var l;return a="number"==typeof s?FP(i):null!==(l=function(e){if(!e||"object"!=typeof e)return;return FP(Object.values(e).filter(Boolean))}(t))&&void 0!==l?l:FP(i),[s,a].join("")}function UP(e={},t,n=LP){const r=zP(e,t,n);return isNaN(parseFloat(r))}function VP(e){return void 0!==e&&Object.values(e).filter((e=>!!e&&/\d/.test(e))).length>0}function HP(e,t){let n="all";return e||(n=t?"vertical":"top"),n}function $P(e,t,n){const r={...e};return n?.length?n.forEach((e=>{"vertical"===e?(r.top=t,r.bottom=t):"horizontal"===e?(r.left=t,r.right=t):r[e]=t})):LP.forEach((e=>r[e]=t)),r}const WP=()=>{};function GP({__next40pxDefaultSize:e,onChange:t=WP,onFocus:n=WP,values:r,sides:o,selectedUnits:i,setSelectedUnits:s,...a}){var l,c;const u=(0,L_.A)(GP,"box-control-input-all"),d=zP(r,i,o),h=VP(r)&&UP(r,i,o),p=h?PP.mixed:void 0,[f,m]=Hw(d),g=e=>{const n=void 0!==e&&!isNaN(parseFloat(e)),i=$P(r,n?e:void 0,o);t(i)};return(0,Id.jsxs)(QS.A,{children:[(0,Id.jsx)(jP,{...a,__next40pxDefaultSize:e,className:"component-box-control__unit-control",disableUnits:h,id:u,isPressEnterToChange:!0,value:d,onChange:g,onUnitChange:e=>{const t=$P(i,e,o);s(t)},onFocus:e=>{n(e,{side:"all"})},placeholder:p,label:PP.all,hideLabelFromVision:!0}),(0,Id.jsx)(DP,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:e,"aria-controls":u,label:PP.all,hideLabelFromVision:!0,onChange:e=>{g(void 0!==e?[e,m].join(""):void 0)},min:0,max:null!==(l=MP[null!=m?m:"px"]?.max)&&void 0!==l?l:10,step:null!==(c=MP[null!=m?m:"px"]?.step)&&void 0!==c?c:.1,value:null!=f?f:0,withInputField:!1})]})}const qP=()=>{};function KP({__next40pxDefaultSize:e,onChange:t=qP,onFocus:n=qP,values:r,selectedUnits:o,setSelectedUnits:i,sides:s,...a}){const l=(0,L_.A)(KP,"box-control-input"),c=e=>t=>{n(t,{side:e})},u=(e,n,o)=>{const i={...r},s=void 0===n||isNaN(parseFloat(n))?void 0:n;if(i[e]=s,o?.event.altKey)switch(e){case"top":i.bottom=s;break;case"bottom":i.top=s;break;case"left":i.right=s;break;case"right":i.left=s}(e=>{t(e)})(i)},d=e=>t=>{const n={...o};n[e]=t,i(n)},h=s?.length?LP.filter((e=>s.includes(e))):LP;return(0,Id.jsx)(Id.Fragment,{children:h.map((t=>{var n,i;const[h,p]=Hw(r[t]),f=r[t]?p:o[t],m=[l,t].join("-");return(0,Id.jsxs)(TP,{expanded:!0,children:[(0,Id.jsx)(NP,{side:t,sides:s}),(0,Id.jsx)(Rx.Ay,{placement:"top-end",text:PP[t],children:(0,Id.jsx)(jP,{...a,__next40pxDefaultSize:e,className:"component-box-control__unit-control",id:m,isPressEnterToChange:!0,value:[h,f].join(""),onChange:(e,n)=>u(t,e,n),onUnitChange:d(t),onFocus:c(t),label:PP[t],hideLabelFromVision:!0})}),(0,Id.jsx)(DP,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:e,"aria-controls":m,label:PP[t],hideLabelFromVision:!0,onChange:e=>{u(t,void 0!==e?[e,f].join(""):void 0)},min:0,max:null!==(n=MP[null!=f?f:"px"]?.max)&&void 0!==n?n:10,step:null!==(i=MP[null!=f?f:"px"]?.step)&&void 0!==i?i:.1,value:null!=h?h:0,withInputField:!1})]},`box-control-${t}`)}))})}const YP=["vertical","horizontal"];function JP({__next40pxDefaultSize:e,onChange:t,onFocus:n,values:r,selectedUnits:o,setSelectedUnits:i,sides:s,...a}){const l=(0,L_.A)(JP,"box-control-input"),c=e=>t=>{n&&n(t,{side:e})},u=(e,n)=>{if(!t)return;const o={...r},i=void 0===n||isNaN(parseFloat(n))?void 0:n;"vertical"===e&&(o.top=i,o.bottom=i),"horizontal"===e&&(o.left=i,o.right=i),t(o)},d=e=>t=>{const n={...o};"vertical"===e&&(n.top=t,n.bottom=t),"horizontal"===e&&(n.left=t,n.right=t),i(n)},h=s?.length?YP.filter((e=>s.includes(e))):YP;return(0,Id.jsx)(Id.Fragment,{children:h.map((t=>{var n,i;const[h,p]=Hw("vertical"===t?r.top:r.left),f="vertical"===t?o.top:o.left,m=[l,t].join("-");return(0,Id.jsxs)(TP,{children:[(0,Id.jsx)(NP,{side:t,sides:s}),(0,Id.jsx)(Rx.Ay,{placement:"top-end",text:PP[t],children:(0,k.createElement)(jP,{...a,__next40pxDefaultSize:e,className:"component-box-control__unit-control",id:m,isPressEnterToChange:!0,value:[h,null!=f?f:p].join(""),onChange:e=>u(t,e),onUnitChange:d(t),onFocus:c(t),label:PP[t],hideLabelFromVision:!0,key:t})}),(0,Id.jsx)(DP,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:e,"aria-controls":m,label:PP[t],hideLabelFromVision:!0,onChange:e=>u(t,void 0!==e?[e,null!=f?f:p].join(""):void 0),min:0,max:null!==(n=MP[null!=f?f:"px"]?.max)&&void 0!==n?n:10,step:null!==(i=MP[null!=f?f:"px"]?.step)&&void 0!==i?i:.1,value:null!=h?h:0,withInputField:!1})]},t)}))})}function XP({isLinked:e,...t}){const n=e?(0,U.__)("Unlink sides"):(0,U.__)("Link sides");return(0,Id.jsx)(Rx.Ay,{text:n,children:(0,Id.jsx)(Jy.Ay,{...t,className:"component-box-control__linked-button",size:"small",icon:e?tT.A:JI.A,iconSize:24,"aria-label":n})})}const ZP={min:0},QP=()=>{};const eO=function e({__next40pxDefaultSize:t=!1,id:n,inputProps:r=ZP,onChange:o=QP,label:i=(0,U.__)("Box Control"),values:s,units:a,sides:l,splitOnAxis:c=!1,allowReset:u=!0,resetValues:d=OP,onMouseOver:h,onMouseOut:p}){const[f,m]=(0,tk.A)(s,{fallback:OP}),g=f||OP,b=VP(s),v=1===l?.length,[y,_]=(0,k.useState)(b),[x,w]=(0,k.useState)(!b||!UP(g)||v),[C,S]=(0,k.useState)(HP(x,c)),[A,E]=(0,k.useState)({top:Hw(s?.top)[1],right:Hw(s?.right)[1],bottom:Hw(s?.bottom)[1],left:Hw(s?.left)[1]}),I=function(t){const n=(0,L_.A)(e,"inspector-box-control");return t||n}(n),j=`${I}-heading`,T={...r,onChange:e=>{o(e),m(e),_(!0)},onFocus:(e,{side:t})=>{S(t)},isLinked:x,units:a,selectedUnits:A,setSelectedUnits:E,sides:l,values:g,onMouseOver:h,onMouseOut:p,__next40pxDefaultSize:t};return(0,Id.jsxs)(vA,{id:I,columns:3,templateColumns:"1fr min-content min-content",role:"group","aria-labelledby":j,children:[(0,Id.jsx)(V_.pu.VisualLabel,{id:j,children:i}),x&&(0,Id.jsxs)(TP,{children:[(0,Id.jsx)(NP,{side:C,sides:l}),(0,Id.jsx)(GP,{...T})]}),!v&&(0,Id.jsx)(RP,{children:(0,Id.jsx)(XP,{onClick:()=>{w(!x),S(HP(!x,c))},isLinked:x})}),!x&&c&&(0,Id.jsx)(JP,{...T}),!x&&!c&&(0,Id.jsx)(KP,{...T}),u&&(0,Id.jsx)(BP,{className:"component-box-control__reset-button",variant:"secondary",size:"small",onClick:()=>{o(d),m(d),E(d),_(!1)},disabled:!y,children:(0,U.__)("Reset")})]})},tO={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 nO({icon:e,isMixed:t=!1,minimumCustomValue:n,onChange:r,onMouseOut:o,onMouseOver:i,showSideInLabel:s=!0,side:a,spacingSizes:l,type:c,value:u}){var d,h;u=sw(u,l);let p=l;const f=l.length<=Qx,m=(0,Fl.A)((e=>{const t=e(uy).getSettings();return t?.disableCustomSpacingSizes})),[g,b]=(0,k.useState)(!m&&void 0!==u&&!iw(u)),[v,y]=(0,k.useState)(n),_=(0,fx.A)(u);u&&_!==u&&!iw(u)&&!0!==g&&b(!0);const[x]=hy("spacing.units"),w=$w({availableUnits:x||["px","em","rem"]});let C=null;f||g||void 0===u||!(!iw(u)||iw(u)&&t)?t||(C=g?function(e,t){if(!iw(e))return e;const n=lw(e),r=t.find((e=>String(e.slug)===n));return r?.size}(u,l):function(e,t){if(void 0===e)return 0;const n=0===parseFloat(e,10)?"0":lw(e),r=t.findIndex((e=>String(e.slug)===n));return-1!==r?r:NaN}(u,l)):(p=[...l,{name:t?(0,U.__)("Mixed"):(0,U.sprintf)((0,U.__)("Custom (%s)"),u),slug:"custom",size:u}],C=p.length-1);const S=(0,k.useMemo)((()=>Hw(C)),[C])[1]||w[0]?.value,A=parseFloat(C,10),E=(e,t)=>{const n=parseInt(e,10);if("selectList"===t){if(0===n)return;if(1===n)return"0"}else if(0===n)return"0";return`var:preset|spacing|${l[e]?.slug}`},I=t?(0,U.__)("Mixed"):null,j=p.map(((e,t)=>({key:t,name:e.name}))),T=l.map(((e,t)=>({value:t,label:void 0}))),B=ew.includes(a)&&s?rw[a]:"",R=s?c?.toLowerCase():c,N=(0,U.sprintf)((0,U.__)("%1$s %2$s"),B,R).trim();return(0,Id.jsxs)(QS.A,{className:"spacing-sizes-control__wrapper",children:[e&&(0,Id.jsx)(Fx.A,{className:"spacing-sizes-control__icon",icon:e,size:24}),g&&(0,Id.jsxs)(Id.Fragment,{children:[(0,Id.jsx)(ik,{onMouseOver:i,onMouseOut:o,onFocus:i,onBlur:o,onChange:e=>r((e=>isNaN(parseFloat(e))?void 0:e)(e)),value:C,units:w,min:v,placeholder:I,disableUnits:t,label:N,hideLabelFromVision:!0,className:"spacing-sizes-control__custom-value-input",size:"__unstable-large",onDragStart:()=>{"-"===u?.charAt(0)&&y(0)},onDrag:()=>{"-"===u?.charAt(0)&&y(0)},onDragEnd:()=>{y(n)}}),(0,Id.jsx)(OC,{onMouseOver:i,onMouseOut:o,onFocus:i,onBlur:o,value:A,min:0,max:null!==(d=tO[S]?.max)&&void 0!==d?d:10,step:null!==(h=tO[S]?.steps)&&void 0!==h?h:.1,withInputField:!1,onChange:e=>{r([e,S].join(""))},className:"spacing-sizes-control__custom-value-range",__nextHasNoMarginBottom:!0})]}),f&&!g&&(0,Id.jsx)(OC,{onMouseOver:i,onMouseOut:o,className:"spacing-sizes-control__range-control",value:C,onChange:e=>r(E(e)),onMouseDown:e=>{e?.nativeEvent?.offsetX<35&&void 0===u&&r("0")},withInputField:!1,"aria-valuenow":C,"aria-valuetext":l[C]?.name,renderTooltipContent:e=>void 0===u?void 0:l[e]?.name,min:0,max:l.length-1,marks:T,label:N,hideLabelFromVision:!0,__nextHasNoMarginBottom:!0,onFocus:i,onBlur:o}),!f&&!g&&(0,Id.jsx)(VD.G,{className:"spacing-sizes-control__custom-select-control",value:j.find((e=>e.key===C))||"",onChange:e=>{r(E(e.selectedItem.key,"selectList"))},options:j,label:N,hideLabelFromVision:!0,size:"__unstable-large",onMouseOver:i,onMouseOut:o,onFocus:i,onBlur:o}),!m&&(0,Id.jsx)(Jy.Ay,{label:g?(0,U.__)("Use size preset"):(0,U.__)("Set custom size"),icon:MD.A,onClick:()=>{b(!g)},isPressed:g,size:"small",className:"spacing-sizes-control__custom-toggle",iconSize:24})]})}const rO=["vertical","horizontal"];function oO({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:r,sides:o,spacingSizes:i,type:s,values:a}){const l=e=>n=>{if(!t)return;const r={...Object.keys(a).reduce(((e,t)=>(e[t]=sw(a[t],i),e)),{})};"vertical"===e&&(r.top=n,r.bottom=n),"horizontal"===e&&(r.left=n,r.right=n),t(r)},c=o?.length?rO.filter((e=>cw(o,e))):rO;return(0,Id.jsx)(Id.Fragment,{children:c.map((t=>{const o="vertical"===t?a.top:a.left;return(0,Id.jsx)(nO,{icon:nw[t],label:rw[t],minimumCustomValue:e,onChange:l(t),onMouseOut:n,onMouseOver:r,side:t,spacingSizes:i,type:s,value:o,withInputField:!1},`spacing-sizes-control-${t}`)}))})}function iO({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:r,sides:o,spacingSizes:i,type:s,values:a}){const l=o?.length?ew.filter((e=>o.includes(e))):ew,c=e=>n=>{const r={...Object.keys(a).reduce(((e,t)=>(e[t]=sw(a[t],i),e)),{})};r[e]=n,t(r)};return(0,Id.jsx)(Id.Fragment,{children:l.map((t=>(0,Id.jsx)(nO,{icon:nw[t],label:rw[t],minimumCustomValue:e,onChange:c(t),onMouseOut:n,onMouseOver:r,side:t,spacingSizes:i,type:s,value:a[t],withInputField:!1},`spacing-sizes-control-${t}`)))})}function sO({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:r,showSideInLabel:o,side:i,spacingSizes:s,type:a,values:l}){return(0,Id.jsx)(nO,{label:rw[i],minimumCustomValue:e,onChange:(c=i,e=>{const n={...Object.keys(l).reduce(((e,t)=>(e[t]=sw(l[t],s),e)),{})};n[c]=e,t(n)}),onMouseOut:n,onMouseOver:r,showSideInLabel:o,side:i,spacingSizes:s,type:a,value:l[i],withInputField:!1});var c}const aO=(0,Id.jsx)(Fx.A,{icon:JS.A,size:24});function lO({label:e,onChange:t,sides:n,value:r}){if(!n||!n.length)return;const o=function(e){if(!e||!e.length)return{};const t={},n=cw(e,"horizontal"),r=cw(e,"vertical");n&&r?t.axial={label:rw.axial,icon:nw.axial}:n?t.axial={label:rw.horizontal,icon:nw.horizontal}:r&&(t.axial={label:rw.vertical,icon:nw.vertical});let o=0;return ew.forEach((n=>{e.includes(n)&&(o+=1,t[n]={label:rw[n],icon:nw[n]})})),o>1&&(t.custom={label:rw.custom,icon:nw.custom}),t}(n),i=o[r].icon,{custom:s,...a}=o;return(0,Id.jsx)(r_.A,{icon:i,label:e,className:"spacing-sizes-control__dropdown",toggleProps:{size:"small"},children:({onClose:e})=>(0,Id.jsxs)(Id.Fragment,{children:[(0,Id.jsx)(__.A,{children:Object.entries(a).map((([n,{label:o,icon:i}])=>{const s=r===n;return(0,Id.jsx)(x_.A,{icon:i,iconPosition:"left",isSelected:s,role:"menuitemradio",onClick:()=>{t(n),e()},suffix:s?aO:void 0,children:o},n)}))}),!!s&&(0,Id.jsx)(__.A,{children:(0,Id.jsx)(x_.A,{icon:s.icon,iconPosition:"left",isSelected:r===ow.custom,role:"menuitemradio",onClick:()=>{t(ow.custom),e()},suffix:r===ow.custom?aO:void 0,children:s.label})})]})})}const cO=[],uO=new Intl.Collator("und",{numeric:!0}).compare;function dO(){const[e,t,n,r]=hy("spacing.spacingSizes.custom","spacing.spacingSizes.theme","spacing.spacingSizes.default","spacing.defaultSpacingSizes"),o=null!=e?e:cO,i=null!=t?t:cO,s=n&&!1!==r?n:cO;return(0,k.useMemo)((()=>{const e=[{name:(0,U.__)("None"),slug:"0",size:0},...o,...i,...s].sort(((e,t)=>uO(e.slug,t.slug)));return e.length>Qx?[{name:(0,U.__)("Default"),slug:"default",size:void 0},...e]:e.map((({slug:e,size:t},n)=>({name:n,slug:e,size:t})))}),[o,i,s])}function hO({inputProps:e,label:t,minimumCustomValue:n=0,onChange:r,onMouseOut:o,onMouseOver:i,showSideInLabel:s=!0,sides:a=ew,useSelect:l,values:c}){const u=dO(),d=c||tw,h=1===a?.length,p=a?.includes("horizontal")&&a?.includes("vertical")&&2===a?.length,[f,m]=(0,k.useState)(function(e={},t){const{top:n,right:r,bottom:o,left:i}=e,s=[n,r,o,i].filter(Boolean),a=!(n!==o||i!==r||!n&&!i),l=!s.length&&function(e=[]){const t={top:0,right:0,bottom:0,left:0};return e.forEach((e=>t[e]+=1)),(t.top+t.bottom)%2==0&&(t.left+t.right)%2==0}(t);if(cw(t)&&(a||l))return ow.axial;if(1===s.length){let t;return Object.entries(e).some((([e,n])=>(t=e,void 0!==n))),t}return 1!==t?.length||s.length?ow.custom:t[0]}(d,a)),g={...e,minimumCustomValue:n,onChange:e=>{const t={...c,...e};r(t)},onMouseOut:o,onMouseOver:i,sides:a,spacingSizes:u,type:t,useSelect:l,values:d},b=ew.includes(f)&&s?rw[f]:"",v=(0,U.sprintf)((0,U.__)("%1$s %2$s"),t,b).trim(),y=(0,U.sprintf)((0,U._x)("%s options","Button label to reveal side configuration options"),t);return(0,Id.jsxs)("fieldset",{className:"spacing-sizes-control",children:[(0,Id.jsxs)(QS.A,{className:"spacing-sizes-control__header",children:[(0,Id.jsx)(V_.Ay.VisualLabel,{as:"legend",className:"spacing-sizes-control__label",children:v}),!h&&!p&&(0,Id.jsx)(lO,{label:y,onChange:m,sides:a,value:f})]}),(0,Id.jsx)(nE.A,{spacing:.5,children:f===ow.axial?(0,Id.jsx)(oO,{...g}):f===ow.custom?(0,Id.jsx)(iO,{...g}):(0,Id.jsx)(sO,{side:f,...g,showSideInLabel:s})})]})}const pO={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 fO({label:e=(0,U.__)("Height"),onChange:t,value:n}){var r,o;const i=parseFloat(n),[s]=hy("spacing.units"),a=$w({availableUnits:s||["%","px","em","rem","vh","vw"]}),l=(0,k.useMemo)((()=>Hw(n)),[n])[1]||a[0]?.value||"px";return(0,Id.jsxs)("fieldset",{className:"block-editor-height-control",children:[(0,Id.jsx)(V_.Ay.VisualLabel,{as:"legend",children:e}),(0,Id.jsxs)(j_.A,{children:[(0,Id.jsx)(T_.A,{isBlock:!0,children:(0,Id.jsx)(ik,{value:n,units:a,onChange:t,onUnitChange:e=>{const[r,o]=Hw(n);["em","rem"].includes(e)&&"px"===o?t((r/16).toFixed(2)+e):["em","rem"].includes(o)&&"px"===e?t(Math.round(16*r)+e):["%","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax"].includes(e)&&r>100&&t(100+e)},min:0,size:"__unstable-large",label:e,hideLabelFromVision:!0})}),(0,Id.jsx)(T_.A,{isBlock:!0,children:(0,Id.jsx)(RT.A,{marginX:2,marginBottom:0,children:(0,Id.jsx)(OC,{value:i,min:0,max:null!==(r=pO[l]?.max)&&void 0!==r?r:100,step:null!==(o=pO[l]?.step)&&void 0!==o?o:.1,withInputField:!1,onChange:e=>{t([e,l].join(""))},__nextHasNoMarginBottom:!0,label:e,hideLabelFromVision:!0})})})]})]})}function mO(e,t){const{orientation:n="horizontal"}=t;return"fill"===e?(0,U.__)("Stretch to fill available space."):"fixed"===e&&"horizontal"===n?(0,U.__)("Specify a fixed width."):"fixed"===e?(0,U.__)("Specify a fixed height."):(0,U.__)("Fit contents.")}function gO({value:e={},onChange:t,parentLayout:n,isShownByDefault:r,panelId:o}){const{selfStretch:i,flexSize:s,columnStart:a,rowStart:l,columnSpan:c,rowSpan:u}=e,{type:d,default:{type:h="default"}={},orientation:p="horizontal"}=null!=n?n:{},f=d||h,m="horizontal"===p?(0,U.__)("Width"):(0,U.__)("Height");return(0,k.useEffect)((()=>{"fixed"!==i||s||t({...e,selfStretch:"fit"})}),[]),(0,Id.jsxs)(Id.Fragment,{children:["flex"===f&&(0,Id.jsxs)(nE.A,{as:qA,spacing:2,hasValue:()=>!!i,label:m,onDeselect:()=>{t({selfStretch:void 0,flexSize:void 0})},isShownByDefault:r,panelId:o,children:[(0,Id.jsxs)(_x,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:bO(n),value:i||"fit",help:mO(i,n),onChange:e=>{t({selfStretch:e,flexSize:"fixed"!==e?null:s})},isBlock:!0,children:[(0,Id.jsx)(LC,{value:"fit",label:(0,U.__)("Fit")},"fit"),(0,Id.jsx)(LC,{value:"fill",label:(0,U.__)("Fill")},"fill"),(0,Id.jsx)(LC,{value:"fixed",label:(0,U.__)("Fixed")},"fixed")]}),"fixed"===i&&(0,Id.jsx)(ik,{size:"__unstable-large",onChange:e=>{t({selfStretch:i,flexSize:e})},value:s})]}),"grid"===f&&(0,Id.jsxs)(Id.Fragment,{children:[(0,Id.jsxs)(QS.A,{as:qA,hasValue:()=>!!c||!!u,label:(0,U.__)("Grid span"),onDeselect:()=>{t({columnSpan:void 0,rowSpan:void 0})},isShownByDefault:r,panelId:o,children:[(0,Id.jsx)(PT.Ay,{size:"__unstable-large",label:(0,U.__)("Column span"),type:"number",onChange:e=>{t({columnStart:a,rowStart:l,rowSpan:u,columnSpan:e})},value:c,min:1}),(0,Id.jsx)(PT.Ay,{size:"__unstable-large",label:(0,U.__)("Row span"),type:"number",onChange:e=>{t({columnStart:a,rowStart:l,columnSpan:c,rowSpan:e})},value:u,min:1})]}),window.__experimentalEnableGridInteractivity&&(0,Id.jsxs)(j_.A,{as:qA,hasValue:()=>!!a||!!l,label:(0,U.__)("Grid placement"),onDeselect:()=>{t({columnStart:void 0,rowStart:void 0})},isShownByDefault:!1,panelId:o,children:[(0,Id.jsx)(T_.A,{style:{width:"50%"},children:(0,Id.jsx)(PT.Ay,{size:"__unstable-large",label:(0,U.__)("Column"),type:"number",onChange:e=>{t({columnStart:e,rowStart:l,columnSpan:c,rowSpan:u})},value:a,min:1,max:n?.columnCount?n.columnCount-(null!=c?c:1)+1:void 0})}),(0,Id.jsx)(T_.A,{style:{width:"50%"},children:(0,Id.jsx)(PT.Ay,{size:"__unstable-large",label:(0,U.__)("Row"),type:"number",onChange:e=>{t({columnStart:a,rowStart:e,columnSpan:c,rowSpan:u})},value:l,min:1,max:n?.rowCount?n.rowCount-(null!=u?u:1)+1:void 0})})]})]})]})}function bO(e){const{orientation:t="horizontal"}=e;return"horizontal"===t?(0,U.__)("Width"):(0,U.__)("Height")}function vO({panelId:e,value:t,onChange:n=(()=>{}),options:r,defaultValue:o="auto",hasValue:i,isShownByDefault:s=!0}){const a=null!=t?t:"auto",[l,c,u]=hy("dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios"),d=c?.map((({name:e,ratio:t})=>({label:e,value:t}))),h=l?.map((({name:e,ratio:t})=>({label:e,value:t}))),p=[{label:(0,U._x)("Original","Aspect ratio option for dimensions control"),value:"auto"},...u?h:[],...d||[],{label:(0,U._x)("Custom","Aspect ratio option for dimensions control"),value:"custom",disabled:!0,hidden:!0}];return(0,Id.jsx)(qA,{hasValue:i||(()=>a!==o),label:(0,U.__)("Aspect ratio"),onDeselect:()=>n(void 0),isShownByDefault:s,panelId:e,children:(0,Id.jsx)(vT.A,{label:(0,U.__)("Aspect ratio"),value:a,options:null!=r?r:p,onChange:n,size:"__unstable-large",__nextHasNoMarginBottom:!0})})}const yO=["horizontal","vertical"];function _O(e){const t=xO(e),n=wO(e),r=kO(e),o=CO(e),i=SO(e),s=AO(e),a=EO(e),l=IO(e);return"web"===Ph.A.OS&&(t||n||r||o||i||s||a||l)}function xO(e){return e?.layout?.contentSize}function wO(e){return e?.layout?.wideSize}function kO(e){return e?.spacing?.padding}function CO(e){return e?.spacing?.margin}function SO(e){return e?.spacing?.blockGap}function AO(e){return e?.dimensions?.minHeight}function EO(e){return e?.dimensions?.aspectRatio}function IO(e){var t;const{type:n="default",default:{type:r="default"}={},allowSizingOnChildren:o=!1}=null!==(t=e?.parentLayout)&&void 0!==t?t:{},i=("flex"===r||"flex"===n||"grid"===r||"grid"===n)&&o;return!!e?.layout&&i}function jO(e,t){if(!t||!e)return e;const n={};return t.forEach((t=>{"vertical"===t&&(n.top=e.top,n.bottom=e.bottom),"horizontal"===t&&(n.left=e.left,n.right=e.right),n[t]=e?.[t]})),n}function TO(e){return e&&"string"==typeof e?{top:e,right:e,bottom:e,left:e}:e}function BO({resetAllFilter:e,onChange:t,value:n,panelId:r,children:o}){return(0,Id.jsx)(_A,{label:(0,U.__)("Dimensions"),resetAll:()=>{const r=e(n);t(r)},panelId:r,dropdownMenuProps:Ey,children:o})}const RO={contentSize:!0,wideSize:!0,padding:!0,margin:!0,blockGap:!0,minHeight:!0,aspectRatio:!0,childLayout:!0};function NO({as:e=BO,value:t,onChange:n,inheritedValue:r=t,settings:o,panelId:i,defaultControls:s=RO,onVisualize:a=(()=>{}),includeLayoutControls:l=!1}){var c,u,d,h,p,f,m,g;const{dimensions:b,spacing:v}=o,y=e=>e&&"object"==typeof e?Object.keys(e).reduce(((t,n)=>(t[n]=jy({settings:{dimensions:b,spacing:v}},"",e[n]),t)),{}):jy({settings:{dimensions:b,spacing:v}},"",e),_=function(e){const{defaultSpacingSizes:t,spacingSizes:n}=e?.spacing||{};return!1!==t&&n?.default?.length>0||n?.theme?.length>0||n?.custom?.length>0}(o),x=$w({availableUnits:o?.spacing?.units||["%","px","em","rem","vw"]}),w=-1/0,[C,S]=(0,k.useState)(w),A=xO(o)&&l,E=y(r?.layout?.contentSize),I=e=>{n(Pf(t,["layout","contentSize"],e||void 0))},j=wO(o)&&l,T=y(r?.layout?.wideSize),B=e=>{n(Pf(t,["layout","wideSize"],e||void 0))},R=kO(o),N=TO(y(r?.spacing?.padding)),D=Array.isArray(o?.spacing?.padding)?o?.spacing?.padding:o?.spacing?.padding?.sides,M=D&&D.some((e=>yO.includes(e))),P=e=>{const r=jO(e,D);n(Pf(t,["spacing","padding"],r))},O=()=>a("padding"),L=CO(o),F=TO(y(r?.spacing?.margin)),z=Array.isArray(o?.spacing?.margin)?o?.spacing?.margin:o?.spacing?.margin?.sides,V=z&&z.some((e=>yO.includes(e))),H=e=>{const r=jO(e,z);n(Pf(t,["spacing","margin"],r))},$=()=>a("margin"),W=SO(o),G=y(r?.spacing?.blockGap),q=function(e){return e&&"string"==typeof e?{top:e}:e?{...e,right:e?.left,bottom:e?.top}:e}(G),K=Array.isArray(o?.spacing?.blockGap)?o?.spacing?.blockGap:o?.spacing?.blockGap?.sides,Y=K&&K.some((e=>yO.includes(e))),J=e=>{n(Pf(t,["spacing","blockGap"],e))},X=e=>{e||J(null),!Y&&e?.hasOwnProperty("top")?J(e.top):J({top:e?.top,left:e?.left})},Z=AO(o),Q=y(r?.dimensions?.minHeight),ee=e=>{const r=Pf(t,["dimensions","minHeight"],e);n(Pf(r,["dimensions","aspectRatio"],void 0))},te=EO(o),ne=y(r?.dimensions?.aspectRatio),re=IO(o),oe=r?.layout,ie=(0,k.useCallback)((e=>({...e,layout:Hy({...e?.layout,contentSize:void 0,wideSize:void 0,selfStretch:void 0,flexSize:void 0,columnStart:void 0,rowStart:void 0,columnSpan:void 0,rowSpan:void 0}),spacing:{...e?.spacing,padding:void 0,margin:void 0,blockGap:void 0},dimensions:{...e?.dimensions,minHeight:void 0,aspectRatio:void 0}})),[]),se=()=>a(!1),ae={min:C,onDragStart:()=>{S(0)},onDragEnd:()=>{S(w)}};return(0,Id.jsxs)(e,{resetAllFilter:ie,value:t,onChange:n,panelId:i,children:[(A||j)&&(0,Id.jsx)("span",{className:"span-columns",children:(0,U.__)("Set the width of the main content area.")}),A&&(0,Id.jsx)(qA,{className:"single-column",label:(0,U.__)("Content size"),hasValue:()=>!!t?.layout?.contentSize,onDeselect:()=>I(void 0),isShownByDefault:null!==(c=s.contentSize)&&void 0!==c?c:RO.contentSize,panelId:i,children:(0,Id.jsxs)(QS.A,{alignment:"flex-end",justify:"flex-start",children:[(0,Id.jsx)(ik,{label:(0,U.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:E||"",onChange:e=>{I(e)},units:x}),(0,Id.jsx)(dx.A,{children:(0,Id.jsx)(sk.A,{icon:ak.A})})]})}),j&&(0,Id.jsx)(qA,{className:"single-column",label:(0,U.__)("Wide size"),hasValue:()=>!!t?.layout?.wideSize,onDeselect:()=>B(void 0),isShownByDefault:null!==(u=s.wideSize)&&void 0!==u?u:RO.wideSize,panelId:i,children:(0,Id.jsxs)(QS.A,{alignment:"flex-end",justify:"flex-start",children:[(0,Id.jsx)(ik,{label:(0,U.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:T||"",onChange:e=>{B(e)},units:x}),(0,Id.jsx)(dx.A,{children:(0,Id.jsx)(sk.A,{icon:lk.A})})]})}),R&&(0,Id.jsxs)(qA,{hasValue:()=>!!t?.spacing?.padding&&Object.keys(t?.spacing?.padding).length,label:(0,U.__)("Padding"),onDeselect:()=>P(void 0),isShownByDefault:null!==(d=s.padding)&&void 0!==d?d:RO.padding,className:(0,Vy.A)({"tools-panel-item-spacing":_}),panelId:i,children:[!_&&(0,Id.jsx)(eO,{values:N,onChange:P,label:(0,U.__)("Padding"),sides:D,units:x,allowReset:!1,splitOnAxis:M,onMouseOver:O,onMouseOut:se}),_&&(0,Id.jsx)(hO,{values:N,onChange:P,label:(0,U.__)("Padding"),sides:D,units:x,allowReset:!1,onMouseOver:O,onMouseOut:se})]}),L&&(0,Id.jsxs)(qA,{hasValue:()=>!!t?.spacing?.margin&&Object.keys(t?.spacing?.margin).length,label:(0,U.__)("Margin"),onDeselect:()=>H(void 0),isShownByDefault:null!==(h=s.margin)&&void 0!==h?h:RO.margin,className:(0,Vy.A)({"tools-panel-item-spacing":_}),panelId:i,children:[!_&&(0,Id.jsx)(eO,{values:F,onChange:H,inputProps:ae,label:(0,U.__)("Margin"),sides:z,units:x,allowReset:!1,splitOnAxis:V,onMouseOver:$,onMouseOut:se}),_&&(0,Id.jsx)(hO,{values:F,onChange:H,minimumCustomValue:-1/0,label:(0,U.__)("Margin"),sides:z,units:x,allowReset:!1,onMouseOver:$,onMouseOut:se})]}),W&&(0,Id.jsxs)(qA,{hasValue:()=>!!t?.spacing?.blockGap,label:(0,U.__)("Block spacing"),onDeselect:()=>J(void 0),isShownByDefault:null!==(p=s.blockGap)&&void 0!==p?p:RO.blockGap,className:(0,Vy.A)({"tools-panel-item-spacing":_}),panelId:i,children:[!_&&(Y?(0,Id.jsx)(eO,{label:(0,U.__)("Block spacing"),min:0,onChange:X,units:x,sides:K,values:q,allowReset:!1,splitOnAxis:Y}):(0,Id.jsx)(ik,{label:(0,U.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:J,units:x,value:G})),_&&(0,Id.jsx)(hO,{label:(0,U.__)("Block spacing"),min:0,onChange:X,showSideInLabel:!1,sides:Y?K:["top"],values:q,allowReset:!1})]}),re&&(0,Id.jsx)(gO,{value:oe,onChange:e=>{n({...t,layout:{...e}})},parentLayout:o?.parentLayout,panelId:i,isShownByDefault:null!==(f=s.childLayout)&&void 0!==f?f:RO.childLayout}),Z&&(0,Id.jsx)(qA,{hasValue:()=>!!t?.dimensions?.minHeight,label:(0,U.__)("Minimum height"),onDeselect:()=>{ee(void 0)},isShownByDefault:null!==(m=s.minHeight)&&void 0!==m?m:RO.minHeight,panelId:i,children:(0,Id.jsx)(fO,{label:(0,U.__)("Minimum height"),value:Q,onChange:ee})}),te&&(0,Id.jsx)(vO,{hasValue:()=>!!t?.dimensions?.aspectRatio,value:ne,onChange:e=>{const r=Pf(t,["dimensions","aspectRatio"],e);n(Pf(r,["dimensions","minHeight"],void 0))},panelId:i,isShownByDefault:null!==(g=s.aspectRatio)&&void 0!==g?g:RO.aspectRatio})]})}function DO({clientId:e,value:t,computeStyle:n,forceShow:r}){const o=WC(e),[i,s]=(0,k.useReducer)((()=>n(o)));(0,k.useLayoutEffect)((()=>{o&&window.requestAnimationFrame((()=>window.requestAnimationFrame(s)))}),[o,t]);const a=(0,k.useRef)(t),[l,c]=(0,k.useState)(!1);return(0,k.useEffect)((()=>{if((0,Ad.default)(t,a.current)||r)return;c(!0),a.current=t;const e=setTimeout((()=>{c(!1)}),400);return()=>{c(!1),clearTimeout(e)}}),[t,r]),l||r?(0,Id.jsx)(ZC,{clientId:e,__unstablePopoverSlot:"block-toolbar",children:(0,Id.jsx)("div",{className:"block-editor__spacing-visualizer",style:i})}):null}function MO(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function PO({clientId:e,value:t,forceShow:n}){return(0,Id.jsx)(DO,{clientId:e,value:t?.spacing?.margin,computeStyle:e=>{const t=MO(e,"margin-top"),n=MO(e,"margin-right"),r=MO(e,"margin-bottom"),o=MO(e,"margin-left");return{borderTopWidth:t,borderRightWidth:n,borderBottomWidth:r,borderLeftWidth:o,top:t?`-${t}`:0,right:n?`-${n}`:0,bottom:r?`-${r}`:0,left:o?`-${o}`:0}},forceShow:n})}function OO({clientId:e,value:t,forceShow:n}){return(0,Id.jsx)(DO,{clientId:e,value:t?.spacing?.padding,computeStyle:e=>({borderTopWidth:MO(e,"padding-top"),borderRightWidth:MO(e,"padding-right"),borderBottomWidth:MO(e,"padding-bottom"),borderLeftWidth:MO(e,"padding-left")}),forceShow:n})}const LO="dimensions",FO="spacing";function zO({children:e,resetAllFilter:t}){const n=(0,k.useCallback)((e=>{const n=e.style,r=t(n);return{...e,style:r}}),[t]);return(0,Id.jsx)(AA,{group:"dimensions",resetAllFilter:n,children:e})}function UO({clientId:e,name:t,setAttributes:n,settings:r}){const o=_O(r),i=(0,Fl.A)((t=>t(uy).getBlockAttributes(e)?.style),[e]),[s,a]=function(){const[e,t]=(0,k.useState)(!1),{hideBlockInterface:n,showBlockInterface:r}=wf((0,zl.A)(uy));return(0,k.useEffect)((()=>{e?n():r()}),[e,r,n]),[e,t]}();if(!o)return null;const l={...Sc(t,[LO,"__experimentalDefaultControls"]),...Sc(t,[FO,"__experimentalDefaultControls"])};return(0,Id.jsxs)(Id.Fragment,{children:[(0,Id.jsx)(NO,{as:zO,panelId:e,settings:r,value:i,onChange:e=>{n({style:Hy(e)})},defaultControls:l,onVisualize:a}),!!r?.spacing?.padding&&(0,Id.jsx)(OO,{forceShow:"padding"===s,clientId:e,value:i}),!!r?.spacing?.margin&&(0,Id.jsx)(PO,{forceShow:"margin"===s,clientId:e,value:i})]})}function VO(e,t="any"){if("web"!==Ph.A.OS)return!1;const n=Sc(e,LO);return!(!0!==n&&("any"===t?!n?.aspectRatio&&!n?.minHeight:!n?.[t]))}const HO={useBlockProps:function({name:e,minHeight:t,style:n}){if(!VO(e,"aspectRatio")||Wy(e,LO,"aspectRatio"))return{};const r=(0,Vy.A)({"has-aspect-ratio":!!n?.dimensions?.aspectRatio}),o={};return n?.dimensions?.aspectRatio?o.minHeight="unset":(t||n?.dimensions?.minHeight)&&(o.aspectRatio="unset"),{className:r,style:o}},attributeKeys:["minHeight","style"],hasSupport:e=>VO(e,"aspectRatio")},$O=[...pP,WR,wD,LO,Ij,FO,GR],WO=e=>$O.some((t=>Ac(e,t)));function GO(e={}){const t={};return Jk(e).forEach((e=>{t[e.key]=e.value})),t}const qO={[`${WR}.__experimentalSkipSerialization`]:["border"],[`${wD}.__experimentalSkipSerialization`]:[wD],[`${hP}.__experimentalSkipSerialization`]:[hP],[`${LO}.__experimentalSkipSerialization`]:[LO],[`${FO}.__experimentalSkipSerialization`]:[FO],[`${GR}.__experimentalSkipSerialization`]:[GR]},KO={...qO,[`${LO}.aspectRatio`]:[`${LO}.aspectRatio`],[`${Ij}`]:[Ij]},YO={[`${LO}.aspectRatio`]:!0,[`${Ij}`]:!0},JO={gradients:"gradient"};function XO(e,t,n=!1){if(!e)return e;let r=e;return n||(r=JSON.parse(JSON.stringify(e))),Array.isArray(t)||(t=[t]),t.forEach((e=>{if(Array.isArray(e)||(e=e.split(".")),e.length>1){const[t,...n]=e;XO(r[t],[n],!0)}else 1===e.length&&delete r[e[0]]})),r}function ZO(e,t,n,r=KO){if(!WO(t))return e;let{style:o}=n;return Object.entries(r).forEach((([e,n])=>{const r=YO[e]||Sc(t,e);!0===r&&(o=XO(o,n)),Array.isArray(r)&&r.forEach((e=>{const t=JO[e]||e;o=XO(o,[[...n,t]])}))})),e.style={...GO(o),...e.style},e}const QO={edit:function({clientId:e,name:t,setAttributes:n,__unstableParentLayout:r}){const o=Ky(t,r),i=AS(),s={clientId:e,name:t,setAttributes:n,settings:{...o,typography:{...o.typography,textAlign:!1}}};return"default"!==i?null:(0,Id.jsxs)(Id.Fragment,{children:[(0,Id.jsx)(RD,{...s}),(0,Id.jsx)(Nj,{...s}),(0,Id.jsx)(bP,{...s}),(0,Id.jsx)(QR,{...s}),(0,Id.jsx)(UO,{...s})]})},hasSupport:WO,addSaveProps:ZO,attributeKeys:["style"],useBlockProps:function e({name:t,style:n}){const r=`wp-elements-${(0,L_.A)(e)}`,o=`.editor-styles-wrapper .${r}`,i=n?.elements,s=(0,k.useMemo)((()=>{if(!i)return;const e=[];return eL.forEach((({elementType:n,pseudo:r,elements:s})=>{if(Wy(t,wD,n))return;const a=i?.[n];if(a){const t=Ty(o,cc[n]);e.push(Yk(a,{selector:t})),r&&r.forEach((t=>{a[t]&&e.push(Yk(a[t],{selector:Ty(o,`${cc[n]}${t}`)}))}))}s&&s.forEach((t=>{i[t]&&e.push(Yk(i[t],{selector:Ty(o,cc[t])}))}))})),e.length>0?e.join(""):void 0}),[o,i,t]);return qy({css:s}),ZO({className:r},t,{style:n},qO)}},eL=[{elementType:"button"},{elementType:"link",pseudo:[":hover"]},{elementType:"heading",elements:["h1","h2","h3","h4","h5","h6"]}];(0,Iu.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return WO(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,Iu.addFilter)("blocks.registerBlockType","core/settings/addAttribute",(function(e){return Ac(e,"__experimentalSettings",!1)?(e?.attributes?.settings||(e.attributes={...e.attributes,settings:{type:"object"}}),e):e}));var tL=n(10854);function nL(e=[],t="90deg"){const n=100/e.length,r=e.map(((e,t)=>`${e} ${t*n}%, ${e} ${(t+1)*n}%`)).join(", ");return`linear-gradient( ${t}, ${r} )`}(0,nc.X$)([rc.A]);const rL=function({values:e}){return e?(0,Id.jsx)(mT,{colorValue:nL(e,"135deg")}):(0,Id.jsx)(Fx.A,{icon:tL.A})};function oL({label:e,value:t,colors:n,disableCustomColors:r,enableAlpha:o,onChange:i}){const[s,a]=(0,k.useState)(!1),l=(0,L_.A)(oL,"color-list-picker-option"),c=`${l}__label`,u=`${l}__content`;return(0,Id.jsxs)(Id.Fragment,{children:[(0,Id.jsx)(Jy.Ay,{className:"components-color-list-picker__swatch-button",onClick:()=>a((e=>!e)),"aria-expanded":s,"aria-controls":u,children:(0,Id.jsxs)(QS.A,{justify:"flex-start",spacing:2,children:[t?(0,Id.jsx)(mT,{colorValue:t,className:"components-color-list-picker__swatch-color"}):(0,Id.jsx)(Fx.A,{icon:tL.A}),(0,Id.jsx)("span",{id:c,children:e})]})}),(0,Id.jsx)("div",{role:"group",id:u,"aria-labelledby":c,"aria-hidden":!s,children:s&&(0,Id.jsx)(HB,{"aria-label":(0,U.__)("Color options"),className:"components-color-list-picker__color-picker",colors:n,value:t,clearable:!1,onChange:i,disableCustomColors:r,enableAlpha:o})})]})}const iL=function({colors:e,labels:t,value:n=[],disableCustomColors:r,enableAlpha:o,onChange:i}){return(0,Id.jsx)("div",{className:"components-color-list-picker",children:t.map(((t,s)=>(0,Id.jsx)(oL,{label:t,value:n[s],colors:e,disableCustomColors:r,enableAlpha:o,onChange:e=>{const t=n.slice();t[s]=e,i(t)}},s)))})},sL=["#333","#CCC"];function aL({value:e,onChange:t}){const n=!!e,r=n?e:sL,o=nL(r),i=(s=r).map(((e,t)=>({position:100*t/(s.length-1),color:e})));var s;return(0,Id.jsx)(NN,{disableInserter:!0,background:o,hasGradient:n,value:i,onChange:e=>{const n=function(e=[]){return e.map((({color:e})=>e))}(e);t(n)}})}const lL=function({asButtons:e,loop:t,clearable:n=!0,unsetable:r=!0,colorPalette:o,duotonePalette:i,disableCustomColors:s,disableCustomDuotone:a,value:l,onChange:c,"aria-label":u,"aria-labelledby":d,...h}){const[p,f]=(0,k.useMemo)((()=>{return!(e=o)||e.length<2?["#000","#fff"]:e.map((({color:e})=>({color:e,brightness:(0,nc.Mj)(e).brightness()}))).reduce((([e,t],n)=>[n.brightness<=e.brightness?n:e,n.brightness>=t.brightness?n:t]),[{brightness:1,color:""},{brightness:0,color:""}]).map((({color:e})=>e));var e}),[o]),m="unset"===l,g=(0,U.__)("Unset"),b=(0,Id.jsx)(NB.Option,{value:"unset",isSelected:m,tooltipText:g,"aria-label":g,className:"components-duotone-picker__color-indicator",onClick:()=>{c(m?void 0:"unset")}},"unset"),v=i.map((({colors:e,slug:t,name:n})=>{const r={background:nL(e,"135deg"),color:"transparent"},o=null!=n?n:(0,U.sprintf)((0,U.__)("Duotone code: %s"),t),i=n?(0,U.sprintf)((0,U.__)("Duotone: %s"),n):o,s=N()(e,l);return(0,Id.jsx)(NB.Option,{value:e,isSelected:s,"aria-label":i,tooltipText:o,style:r,onClick:()=>{c(s?void 0:e)}},t)}));let y;if(e)y={asButtons:!0};else{const e={asButtons:!1,loop:t};y=u?{...e,"aria-label":u}:d?{...e,"aria-labelledby":d}:{...e,"aria-label":(0,U.__)("Custom color picker.")}}const _=r?[b,...v]:v;return(0,Id.jsx)(NB,{...h,...y,options:_,actions:!!n&&(0,Id.jsx)(NB.ButtonAction,{onClick:()=>c(void 0),children:(0,U.__)("Clear")}),children:(0,Id.jsx)(RT.A,{paddingTop:0===_.length?0:4,children:(0,Id.jsxs)(nE.A,{spacing:3,children:[!s&&!a&&(0,Id.jsx)(aL,{value:m?void 0:l,onChange:c}),!a&&(0,Id.jsx)(iL,{labels:[(0,U.__)("Shadows"),(0,U.__)("Highlights")],colors:o,value:m?void 0:l,disableCustomColors:s,enableAlpha:!0,onChange:e=>{e[0]||(e[0]=p),e[1]||(e[1]=f);const t=e.length>=2?e:void 0;c(t)}})]})})})};var cL=n(96360);const uL=function e({id:t,colorPalette:n,duotonePalette:r,disableCustomColors:o,disableCustomDuotone:i,value:s,onChange:a}){let l;l="unset"===s?(0,Id.jsx)(mT,{className:"block-editor-duotone-control__unset-indicator"}):s?(0,Id.jsx)(rL,{values:s}):(0,Id.jsx)(sk.A,{icon:cL.A});const c=(0,U.__)("Apply duotone filter"),u=`${(0,L_.A)(e,"duotone-control",t)}__description`;return(0,Id.jsx)(DE.A,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,U.__)("Duotone")},renderToggle:({isOpen:e,onToggle:t})=>(0,Id.jsx)(t_,{showTooltip:!0,onClick:t,"aria-haspopup":"true","aria-expanded":e,onKeyDown:n=>{e||n.keyCode!==zE.DOWN||(n.preventDefault(),t())},label:c,icon:l}),renderContent:()=>(0,Id.jsxs)(__.A,{label:(0,U.__)("Duotone"),children:[(0,Id.jsx)("p",{children:(0,U.__)("Create a two-tone color effect without losing your original image.")}),(0,Id.jsx)(lL,{"aria-label":c,"aria-describedby":u,colorPalette:n,duotonePalette:r,disableCustomColors:o,disableCustomDuotone:i,value:s,onChange:a})]})})};function dL(e){return`${e}{filter:none}`}function hL(e,t){return`${e}{filter:url(#${t})}`}function pL(e,t){const n=function(e=[]){const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=(0,nc.Mj)(e).toRgb();t.r.push(n.r/255),t.g.push(n.g/255),t.b.push(n.b/255),t.a.push(n.a)})),t}(t);return`\n`}function fL(e,t="root",n={}){if(!t)return null;const{fallback:r=!1}=n,{name:o,selectors:i,supports:s}=e,a=i&&Object.keys(i).length>0,l=Array.isArray(t)?t.join("."):t;let c=null;if(c=a&&i.root?i?.root:s?.__experimentalSelector?s.__experimentalSelector:".wp-block-"+o.replace("core/","").replace("/","-"),"root"===l)return c;const u=Array.isArray(t)?t:t.split(".");if(1===u.length){const e=r?c:null;if(a)return Of(i,`${l}.root`,null)||Of(i,l,null)||e;const t=Of(s,`${l}.__experimentalSelector`,null);return t?Ty(c,t):e}let d;return a&&(d=Of(i,l,null)),d||(r?fL(e,u[0],n):null)}const mL=[];function gL(e,{presetSetting:t,defaultSetting:n}){const r=!e?.color?.[n],o=e?.color?.[t]?.custom||mL,i=e?.color?.[t]?.theme||mL,s=e?.color?.[t]?.default||mL;return(0,k.useMemo)((()=>[...o,...i,...r?mL:s]),[r,o,i,s])}function bL(e){return vL(e)}function vL(e){return e.color.customDuotone||e.color.defaultDuotone||e.color.duotone.length>0}function yL({resetAllFilter:e,onChange:t,value:n,panelId:r,children:o}){return(0,Id.jsx)(_A,{label:(0,U._x)("Filters","Name for applying graphical effects"),resetAll:()=>{const r=e(n);t(r)},panelId:r,dropdownMenuProps:Ey,children:o})}const _L={duotone:!0},xL={placement:"left-start",offset:36,shift:!0,className:"block-editor-duotone-control__popover",headerTitle:(0,U.__)("Duotone")},wL=({indicator:e,label:t})=>(0,Id.jsxs)(QS.A,{justify:"flex-start",children:[(0,Id.jsx)(uN,{isLayered:!1,offset:-8,children:(0,Id.jsx)(j_.A,{expanded:!1,children:"unset"!==e&&e?(0,Id.jsx)(rL,{values:e}):(0,Id.jsx)(mT,{className:"block-editor-duotone-control__unset-indicator"})})}),(0,Id.jsx)(T_.A,{title:t,children:t})]});function kL({as:e=yL,value:t,onChange:n,inheritedValue:r=t,settings:o,panelId:i,defaultControls:s=_L}){const a=vL(o),l=gL(o,{presetSetting:"duotone",defaultSetting:"defaultDuotone"}),c=gL(o,{presetSetting:"palette",defaultSetting:"defaultPalette"}),u=(d=r?.filter?.duotone,jy({settings:o},"",d));var d;const h=e=>{const r=l.find((({colors:t})=>t===e)),o=r?`var:preset|duotone|${r.slug}`:e;n(Pf(t,["filter","duotone"],o))},p=(0,k.useCallback)((e=>({...e,filter:{...e.filter,duotone:void 0}})),[]);return(0,Id.jsx)(e,{resetAllFilter:p,value:t,onChange:n,panelId:i,children:a&&(0,Id.jsx)(qA,{label:(0,U.__)("Duotone"),hasValue:()=>!!t?.filter?.duotone,onDeselect:()=>h(void 0),isShownByDefault:s.duotone,panelId:i,children:(0,Id.jsx)(DE.A,{popoverProps:xL,className:"block-editor-global-styles-filters-panel__dropdown",renderToggle:({onToggle:e,isOpen:t})=>{const n={onClick:e,className:(0,Vy.A)({"is-open":t}),"aria-expanded":t};return(0,Id.jsx)(VA,{isBordered:!0,isSeparated:!0,children:(0,Id.jsx)(Jy.Ay,{...n,children:(0,Id.jsx)(wL,{indicator:u,label:(0,U.__)("Duotone")})})})},renderContent:()=>(0,Id.jsx)(OB,{paddingSize:"small",children:(0,Id.jsxs)(__.A,{label:(0,U.__)("Duotone"),children:[(0,Id.jsx)("p",{children:(0,U.__)("Create a two-tone color effect without losing your original image.")}),(0,Id.jsx)(lL,{colorPalette:c,duotonePalette:l,disableCustomColors:!0,disableCustomDuotone:!0,value:u,onChange:h})]})})})})})}const CL=[],SL=window?.navigator.userAgent&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&!window.navigator.userAgent.includes("Chromium");function AL({presetSetting:e,defaultSetting:t}){const[n,r,o,i]=hy(t,`${e}.custom`,`${e}.theme`,`${e}.default`);return(0,k.useMemo)((()=>[...r||CL,...o||CL,...n&&i||CL]),[n,r,o,i])}function EL(e,t){if(!e)return;const n=t?.find((({slug:t})=>e===`var:preset|duotone|${t}`));return n?n.colors:void 0}(0,nc.X$)([rc.A]);const IL={shareWithChildBlocks:!0,edit:function({style:e,setAttributes:t,name:n}){const r=e?.color?.duotone,o=Ky(n),i=AS(),s=AL({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=AL({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),[l,c]=hy("color.custom","color.customDuotone"),u=!l,d=!c||0===a?.length&&u;if(0===s?.length&&d)return null;if("default"!==i)return null;const h=Array.isArray(r)?r:EL(r,s);return(0,Id.jsxs)(Id.Fragment,{children:[(0,Id.jsx)(AA,{group:"filter",children:(0,Id.jsx)(kL,{value:{filter:{duotone:h}},onChange:n=>{const r={...e,color:{...n?.filter}};t({style:r})},settings:o})}),(0,Id.jsx)(v_,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,Id.jsx)(uL,{duotonePalette:s,colorPalette:a,disableCustomDuotone:d,disableCustomColors:u,value:h,onChange:n=>{const r=function(e,t){if(!e||!Array.isArray(e))return;const n=t?.find((t=>t?.colors?.every(((t,n)=>t===e[n]))));return n?`var:preset|duotone|${n.slug}`:void 0}(n,s),o={...e,color:{...e?.color,duotone:null!=r?r:n}};t({style:o})},settings:o})})]})},useBlockProps:function e({name:t,style:n}){const r=(0,L_.A)(e),o=(0,k.useMemo)((()=>{const e=kc(t);if(e){if(!Sc(e,"filter.duotone",!1))return null;const t=Sc(e,"color.__experimentalDuotone",!1);if(t){const n=fL(e);return"string"==typeof t?Ty(n,t):n}return fL(e,"filter.duotone",{fallback:!0})}}),[t]),i=n?.color?.duotone,s=`wp-duotone-${r}`,a=o&&i;return function({clientId:e,id:t,selector:n,attribute:r}){const o=AL({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),i=Array.isArray(r),s=i?void 0:EL(r,o),a="string"==typeof r&&s;let l=null;a?l=s:("string"==typeof r&&!a||i)&&(l=r);const c=n.split(",").map((e=>`.${t}${e.trim()}`)).join(", "),u=Array.isArray(l)||"unset"===l;qy(u?{css:"unset"!==l?hL(c,t):dL(c),__unstableType:"presets"}:void 0),qy(u?{assets:"unset"!==l?pL(t,l):"",__unstableType:"svgs"}:void 0);const d=WC(e);(0,k.useEffect)((()=>{if(u&&d&&SL){const e=d.style.display;d.style.display="inline-block",d.offsetHeight,d.style.display=e}}),[u,d])}({clientId:r,id:s,selector:o,attribute:i}),{className:a?s:""}},attributeKeys:["style"],hasSupport:e=>Ac(e,"filter.duotone")};function jL(e){return(0,Fl.A)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:r}=t(uy),{getBlockType:o,getActiveBlockVariation:i}=t(Zu),s=n(e),a=o(s);if(!a)return null;const l=r(e),c=i(s,l),u=Ec(a)||Ic(a),d=(u?Mc(a,l):void 0)||a.title,h=function(e){const t=e?.style?.position?.type;return"sticky"===t?(0,U.__)("Sticky"):"fixed"===t?(0,U.__)("Fixed"):null}(l),p={isSynced:u,title:d,icon:a.icon,description:a.description,anchor:l?.anchor,positionLabel:h,positionType:l?.style?.position?.type,name:l?.metadata?.name};return c?{isSynced:u,title:c.title||a.title,icon:c.icon||a.icon,description:c.description||a.description,anchor:l?.anchor,positionLabel:h,positionType:l?.style?.position?.type,name:l?.metadata?.name}:p}),[e])}(0,Iu.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return Ac(e,"filter.duotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e}));const{CustomSelectControl:TL}=wf(c_.j),BL="position",RL="block-editor-hooks__position-selection__select-control__option",NL={key:"default",value:"",name:(0,U.__)("Default"),className:RL},DL={key:"sticky",value:"sticky",name:(0,U._x)("Sticky","Name for the value of the CSS position property"),className:RL,__experimentalHint:(0,U.__)("The block will stick to the top of the window instead of scrolling.")},ML={key:"fixed",value:"fixed",name:(0,U._x)("Fixed","Name for the value of the CSS position property"),className:RL,__experimentalHint:(0,U.__)("The block will not move when the page is scrolled.")},PL=["top","right","bottom","left"],OL=["sticky","fixed"];function LL(e){const t=e?.style?.position?.type;return"sticky"===t||"fixed"===t}function FL({name:e}={}){const[t,n]=hy("position.fixed","position.sticky"),r=!t&&!n;return!Sc(e,BL)||r}function zL({style:e={},clientId:t,name:n,setAttributes:r}){const o=function(e){const t=Sc(e,BL);return!(!0!==t&&!t?.fixed)}(n),i=function(e){const t=Sc(e,BL);return!(!0!==t&&!t?.sticky)}(n),s=e?.position?.type,{firstParentClientId:a}=(0,Fl.A)((e=>{const{getBlockParents:n}=e(uy),r=n(t);return{firstParentClientId:r[r.length-1]}}),[t]),l=jL(a),c=i&&s===DL.value&&l?(0,U.sprintf)((0,U.__)("The block will stick to the scrollable area of the parent %s block."),l.title):null,u=(0,k.useMemo)((()=>{const e=[NL];return(i||s===DL.value)&&e.push(DL),(o||s===ML.value)&&e.push(ML),e}),[o,i,s]),d=s&&u.find((e=>e.value===s))||NL;return Ph.A.select({web:u.length>1?(0,Id.jsx)(AA,{group:"position",children:(0,Id.jsx)(V_.Ay,{className:"block-editor-hooks__position-selection",__nextHasNoMarginBottom:!0,help:c,children:(0,Id.jsx)(TL,{__next40pxDefaultSize:!0,className:"block-editor-hooks__position-selection__select-control",label:(0,U.__)("Position"),hideLabelFromVision:!0,describedBy:(0,U.sprintf)((0,U.__)("Currently selected position: %s"),d.name),options:u,value:d,__experimentalShowSelectedHint:!0,onChange:({selectedItem:t})=>{(t=>{const n={...e,position:{...e?.position,type:t,top:"sticky"===t||"fixed"===t?"0px":void 0}};r({style:Hy(n)})})(t.value)},size:"__unstable-large"})})}):null,native:null})}const UL={edit:function(e){return FL(e)?null:(0,Id.jsx)(zL,{...e})},useBlockProps:function e({name:t,style:n}){const r=Ac(t,BL),o=FL({name:t}),i=r&&!o,s=(0,L_.A)(e);let a;i&&(a=function({selector:e,style:t}){let n="";const{type:r}=t?.position||{};return OL.includes(r)?(n+=`${e} {`,n+=`position: ${r};`,PL.forEach((e=>{void 0!==t?.position?.[e]&&(n+=`${e}: ${t.position[e]};`)})),"sticky"!==r&&"fixed"!==r||(n+="z-index: 10"),n+="}",n):n}({selector:`.wp-container-${s}.wp-container-${s}`,style:n})||"");const l=(0,Vy.A)({[`wp-container-${s}`]:i&&!!a,[`is-position-${n?.position?.type}`]:i&&!!a&&!!n?.position?.type});return qy({css:a}),{className:l}},attributeKeys:["style"],hasSupport:e=>Ac(e,BL)},VL={__experimentalBorder:"border",color:"color",spacing:"spacing",typography:"typography"},{kebabCase:HL}=wf(c_.j);function $L(e){return e?.startsWith?.("var:")?`var(--wp--${e.slice(4).split("|").join("--")})`:e}function WL(e={},t,n){let r=[];return Object.keys(e).forEach((o=>{const i=t+HL(o.replace("/","-")),s=e[o];if(s instanceof Object){const e=i+n;r=[...r,...WL(s,e,n)]}else r.push(`${i}: ${s}`)})),r}const GL=(e,t)=>{const n={};return Object.entries(e).forEach((([e,r])=>{if("root"===e||!t?.[e])return;const o="string"==typeof r;if(o||Object.entries(r).forEach((([r,o])=>{if("root"===r||!t?.[e][r])return;const i=qL({[e]:{[r]:t[e][r]}});n[o]=[...n[o]||[],...i],delete t[e][r]})),o||r.root){const i=o?r:r.root,s=qL({[e]:t[e]});n[i]=[...n[i]||[],...s],delete t[e]}})),n};function qL(e={},t="",n,r={},o=!1){const i=ky===t,s=Object.entries(lc).reduce(((t,[r,{value:o,properties:s,useEngine:a,rootOnly:l}])=>{if(l&&!i)return t;const c=o;if("elements"===c[0]||a)return t;const u=Of(e,c);if("--wp--style--root--padding"===r&&("string"==typeof u||!n))return t;if(s&&"string"!=typeof u)Object.entries(s).forEach((e=>{const[n,r]=e;if(!Of(u,[r],!1))return;const o=n.startsWith("--")?n:HL(n);t.push(`${o}: ${$L(Of(u,[r]))}`)}));else if(Of(e,c,!1)){const n=r.startsWith("--")?r:HL(r);t.push(`${n}: ${$L(Of(e,c))}`)}return t}),[]);return Jk(e).forEach((e=>{if(i&&(n||o)&&e.key.startsWith("padding"))return;const t=e.key.startsWith("--")?e.key:HL(e.key);let a=e.value;if("string"!=typeof a&&a?.ref){const e=a.ref.split(".");if(a=$L(Of(r,e)),!a||a?.ref)return}"font-size"===t&&(a=xy({size:a},r?.settings)),"aspect-ratio"===t&&s.push("min-height: unset"),s.push(`${t}: ${a}`)})),s}function KL({layoutDefinitions:e=Vx,style:t,selector:n,hasBlockGapSupport:r,hasFallbackGapSupport:o,fallbackGapValue:i}){let s="",a=r?uw(t?.spacing?.blockGap):"";if(o&&(n===ky?a=a||"0.5em":!r&&i&&(a=i)),a&&e&&(Object.values(e).forEach((({className:e,name:t,spacingStyles:o})=>{(r||"flex"===t||"grid"===t)&&o?.length&&o.forEach((t=>{const o=[];if(t.rules&&Object.entries(t.rules).forEach((([e,t])=>{o.push(`${e}: ${t||a}`)})),o.length){let i="";i=r?n===ky?`.${e}${t?.selector||""}`:`${n}-${e}${t?.selector||""}`:n===ky?`:where(.${e}${t?.selector||""})`:`:where(${n}.${e}${t?.selector||""})`,s+=`${i} { ${o.join("; ")}; }`}}))})),n===ky&&r&&(s+=`${Cy} { --wp--style--block-gap: ${a}; }`)),n===ky&&e){const t=["block","flex","grid"];Object.values(e).forEach((({className:e,displayMode:r,baseStyles:o})=>{r&&t.includes(r)&&(s+=`${n} .${e} { display:${r}; }`),o?.length&&o.forEach((t=>{const n=[];t.rules&&Object.entries(t.rules).forEach((([e,t])=>{n.push(`${e}: ${t}`)})),n.length&&(s+=`.${e}${t?.selector||""} { ${n.join("; ")}; }`)}))}))}return s}const YL=["border","color","dimensions","spacing","typography","filter","outline","shadow","background"];function JL(e){if(!e)return{};const t=Object.entries(e).filter((([e])=>YL.includes(e))).map((([e,t])=>[e,JSON.parse(JSON.stringify(t))]));return Object.fromEntries(t)}const XL=(e,t)=>{var n;const r=[];if(!e?.settings)return r;const o=e=>{let t={};return Sy.forEach((({path:n})=>{const r=Of(e,n,!1);!1!==r&&(t=Pf(t,n,r))})),t},i=o(e.settings),s=e.settings?.custom;return(Object.keys(i).length>0||s)&&r.push({presets:i,custom:s,selector:Cy}),Object.entries(null!==(n=e.settings?.blocks)&&void 0!==n?n:{}).forEach((([e,n])=>{const i=o(n),s=n.custom;(Object.keys(i).length>0||s)&&r.push({presets:i,custom:s,selector:t[e]?.selector})})),r},ZL=(e,t)=>{const n=XL(e,t);let r="";return n.forEach((({presets:t,custom:n,selector:o})=>{const i=function(e={},t){return Sy.reduce(((n,{path:r,valueKey:o,valueFunc:i,cssVarInfix:s})=>{const a=Of(e,r,[]);return["default","theme","custom"].forEach((e=>{a[e]&&a[e].forEach((e=>{o&&!i?n.push(`--wp--preset--${s}--${HL(e.slug)}: ${e[o]}`):i&&"function"==typeof i&&n.push(`--wp--preset--${s}--${HL(e.slug)}: ${i(e,t)}`)}))})),n}),[])}(t,e?.settings),s=WL(n,"--wp--custom--","--");s.length>0&&i.push(...s),i.length>0&&(r+=`${o}{${i.join(";")};}`)})),r},QL=(e,t,n,r,o=!1,i=!1,s=void 0)=>{const a={blockGap:!0,blockStyles:!0,layoutStyles:!0,marginReset:!0,presets:!0,rootPadding:!0,...s},l=((e,t)=>{var n;const r=[];if(!e?.styles)return r;const o=JL(e.styles);return o&&r.push({styles:o,selector:ky}),Object.entries(cc).forEach((([t,n])=>{e.styles?.elements?.[t]&&r.push({styles:e.styles?.elements?.[t],selector:n})})),Object.entries(null!==(n=e.styles?.blocks)&&void 0!==n?n:{}).forEach((([e,n])=>{var o;const i=JL(n);if(n?.variations){const o={};Object.entries(n.variations).forEach((([n,i])=>{var s,a;o[n]=JL(i);const l=t[e].styleVariationSelectors?.[n];Object.entries(null!==(s=i?.elements)&&void 0!==s?s:{}).forEach((([e,t])=>{t&&cc[e]&&r.push({styles:t,selector:Ty(l,cc[e])})})),Object.entries(null!==(a=i?.blocks)&&void 0!==a?a:{}).forEach((([e,n])=>{var o;const i=Ty(l,t[e].selector),s=Ty(l,t[e].duotoneSelector),a=function(e,t){if(!e||!t)return;const n={};return Object.entries(t).forEach((([t,r])=>{"string"==typeof r&&(n[t]=Ty(e,r)),"object"==typeof r&&(n[t]={},Object.entries(r).forEach((([r,o])=>{n[t][r]=Ty(e,o)})))})),n}(l,t[e].featureSelectors);r.push({selector:i,duotoneSelector:s,featureSelectors:a,fallbackGapValue:t[e].fallbackGapValue,hasLayoutSupport:t[e].hasLayoutSupport,styles:JL(n)}),Object.entries(null!==(o=n.elements)&&void 0!==o?o:{}).forEach((([e,t])=>{t&&cc[e]&&r.push({styles:t,selector:Ty(i,cc[e])})}))}))})),i.variations=o}t?.[e]?.selector&&r.push({duotoneSelector:t[e].duotoneSelector,fallbackGapValue:t[e].fallbackGapValue,hasLayoutSupport:t[e].hasLayoutSupport,selector:t[e].selector,styles:i,featureSelectors:t[e].featureSelectors,styleVariationSelectors:t[e].styleVariationSelectors}),Object.entries(null!==(o=n?.elements)&&void 0!==o?o:{}).forEach((([n,o])=>{o&&t?.[e]&&cc[n]&&r.push({styles:o,selector:t[e]?.selector.split(",").map((e=>cc[n].split(",").map((t=>e+" "+t)))).join(",")})}))})),r})(e,t),c=XL(e,t),u=e?.settings?.useRootPaddingAwareAlignments,{contentSize:d,wideSize:h}=e?.settings?.layout||{},p=a.marginReset||a.rootPadding||a.layoutStyles;let f="";if(a.presets&&(d||h)&&(f+=`${Cy} {`,f=d?f+` --wp--style--global--content-size: ${d};`:f,f=h?f+` --wp--style--global--wide-size: ${h};`:f,f+="}"),p&&(f+=":where(body) {margin: 0;",a.rootPadding&&u&&(f+="padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) }\n\t\t\t\t.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t\t.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); }\n\t\t\t\t.has-global-padding :where(.has-global-padding:not(.wp-block-block, .alignfull, .alignwide)) { padding-right: 0; padding-left: 0; }\n\t\t\t\t.has-global-padding :where(.has-global-padding:not(.wp-block-block, .alignfull, .alignwide)) > .alignfull { margin-left: 0; margin-right: 0;\n\t\t\t\t"),f+="}"),a.blockStyles&&l.forEach((({selector:t,duotoneSelector:s,styles:a,fallbackGapValue:l,hasLayoutSupport:c,featureSelectors:d,styleVariationSelectors:h})=>{if(d){const e=GL(d,a);Object.entries(e).forEach((([e,t])=>{if(t.length){const n=t.join(";");f+=`:root :where(${e}){${n};}`}}))}if(s){const e={};a?.filter&&(e.filter=a.filter,delete a.filter);const t=qL(e);t.length&&(f+=`${s}{${t.join(";")};}`)}o||ky!==t&&!c||(f+=KL({style:a,selector:t,hasBlockGapSupport:n,hasFallbackGapSupport:r,fallbackGapValue:l}));const p=qL(a,t,u,e,i);p?.length&&(f+=`:root :where(${t}){${p.join(";")};}`),h&&Object.entries(h).forEach((([t,n])=>{const r=a?.variations?.[t];if(r){if(d){const e=GL(d,r);Object.entries(e).forEach((([e,t])=>{if(t.length){const r=function(e,t){const n=e.split(","),r=[];return n.forEach((e=>{r.push(`${t.trim()}${e.trim()}`)})),r.join(", ")}(e,n),o=t.join(";");f+=`:root :where(${r}){${o};}`}}))}const t=qL(r,n,u,e);t.length&&(f+=`:root :where(${n}){${t.join(";")};}`)}}));const m=Object.entries(a).filter((([e])=>e.startsWith(":")));m?.length&&m.forEach((([e,n])=>{const r=qL(n);if(!r?.length)return;const o=`${t.split(",").map((t=>t+e)).join(",")}{${r.join(";")};}`;f+=o}))})),a.layoutStyles&&(f+=".wp-site-blocks > .alignleft { float: left; margin-right: 2em; }",f+=".wp-site-blocks > .alignright { float: right; margin-left: 2em; }",f+=".wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }"),a.blockGap&&n){const t=uw(e?.styles?.spacing?.blockGap)||"0.5em";f+=`:root :where(.wp-site-blocks) > * { margin-block-start: ${t}; margin-block-end: 0; }`,f+=":root :where(.wp-site-blocks) > :first-child { margin-block-start: 0; }",f+=":root :where(.wp-site-blocks) > :last-child { margin-block-end: 0; }"}return a.presets&&c.forEach((({selector:e,presets:t})=>{ky!==e&&Cy!==e||(e="");const n=function(e="*",t={}){return Sy.reduce(((n,{path:r,cssVarInfix:o,classes:i})=>{if(!i)return n;const s=Of(t,r,[]);return["default","theme","custom"].forEach((t=>{s[t]&&s[t].forEach((({slug:t})=>{i.forEach((({classSuffix:r,propertyName:i})=>{const s=`.has-${HL(t)}-${r}`,a=e.split(",").map((e=>`${e}${s}`)).join(","),l=`var(--wp--preset--${o}--${HL(t)})`;n+=`${a}{${i}: ${l} !important;}`}))}))})),n}),"")}(e,t);n.length>0&&(f+=n)})),f};const eF=(e,t,n)=>{const r={};return e.forEach((e=>{const o=e.name,i=fL(e);let s=fL(e,"filter.duotone");if(!s){const t=fL(e),n=Sc(e,"color.__experimentalDuotone",!1);s=n&&Ty(t,n)}const a=!!e?.supports?.layout||!!e?.supports?.__experimentalLayout,l=e?.supports?.spacing?.blockGap?.__experimentalDefault,c=t(o),u={};c?.forEach((e=>{const t=n?`-${n}`:"",r=`${e.name}${t}`,o=function(e,t){const n=`.is-style-${e}`;if(!t)return n;const r=/((?::\([^)]+\))?\s*)([^\s:]+)/,o=(e,t,r)=>t+r+n;return t.split(",").map((e=>e.replace(r,o))).join(",")}(r,i);u[r]=o}));const d=((e,t)=>{if(e?.selectors&&Object.keys(e.selectors).length>0)return e.selectors;const n={root:t};return Object.entries(VL).forEach((([t,r])=>{const o=fL(e,t);o&&(n[r]=o)})),n})(e,i);r[o]={duotoneSelector:s,fallbackGapValue:l,featureSelectors:Object.keys(d).length?d:void 0,hasLayoutSupport:a,name:o,selector:i,styleVariationSelectors:c?.length?u:void 0}})),r};function tF(e,t){let n="";return e.split("&").forEach((e=>{if(e.includes("{")){const r=e.replace("}","").split("{");if(2!==r.length)return;const[o,i]=r,s=o.startsWith(" ")?Ty(t,o):function(e,t){return e.includes(",")?e.split(",").map((e=>e+t)).join(","):e+t}(t,o);n+=`:root :where(${s}){${i.trim()}}`}else n+=`:root :where(${t}){${e.trim()}}`})),n}function nF(e={},t){const[n]=Py("spacing.blockGap");var r,o;r=e,o=e?._links?.["wp:theme-file"],e=r?.styles&&o?(o.forEach((({name:e,href:t,target:n})=>{Of(r,n)===e&&(r=function(e,t,n){const r=(t=t.split(".")).pop();let o=e;for(const e of t)o=o[e];return o[r]=n,e}(r,n,t))})),r):r;const i=null!==n,s=!i,a=(0,Fl.A)((e=>{const{getSettings:t}=e(uy);return!!t().disableLayoutStyles})),{getBlockStyles:l}=(0,Fl.A)(Zu);return(0,k.useMemo)((()=>{var n;if(!e?.styles||!e?.settings)return[];const r=(p=e,p.styles?.blocks?.["core/separator"]&&p.styles?.blocks?.["core/separator"].color?.background&&!p.styles?.blocks?.["core/separator"].color?.text&&!p.styles?.blocks?.["core/separator"].border?.color?{...p,styles:{...p.styles,blocks:{...p.styles.blocks,"core/separator":{...p.styles.blocks["core/separator"],color:{...p.styles.blocks["core/separator"].color,text:p.styles?.blocks["core/separator"].color.background}}}}}:p),o=eF(Cc(),l),c=ZL(r,o),u=QL(r,o,i,s,a,t),d=function(e,t){return XL(e,t).flatMap((({presets:e})=>function(e={}){return Sy.filter((e=>"duotone"===e.path.at(-1))).flatMap((t=>{const n=Of(e,t.path,{});return["default","theme"].filter((e=>n[e])).flatMap((e=>n[e].map((e=>pL(`wp-duotone-${e.slug}`,e.colors))))).join("")}))}(e)))}(r,o),h=[{css:c,isGlobalStyles:!0},{css:u,isGlobalStyles:!0},{css:null!==(n=r.styles.css)&&void 0!==n?n:"",isGlobalStyles:!0},{assets:d,__unstableType:"svg",isGlobalStyles:!0}];var p;return Cc().forEach((e=>{if(r.styles.blocks[e.name]?.css){const t=o[e.name].selector;h.push({css:tF(r.styles.blocks[e.name]?.css,t),isGlobalStyles:!0})}})),[h,r.settings]}),[i,s,e,a,t,l])}function rF(e=!1){const{merged:t}=(0,k.useContext)(Ry);return nF(t,e)}const oF={hasSupport:()=>!0,attributeKeys:["className"],useBlockProps:function({name:e,className:t,clientId:n}){const{getBlockStyles:r}=(0,Fl.A)(Zu),o=function(e,t=[]){const n=e?.match(/\bis-style-(?!default)(\S+)\b/g);if(!n)return null;for(const e of n){const n=e.substring(9);if(t.some((e=>e.name===n)))return n}return null}(t,r(e)),i=`is-style-${o}-${n}`,{settings:s,styles:a}=function(e,t,n){const{merged:r}=(0,k.useContext)(Ry),{globalSettings:o,globalStyles:i}=(0,Fl.A)((e=>{const t=e(uy).getSettings();return{globalSettings:t.__experimentalFeatures,globalStyles:t[vf]}}),[]);return(0,k.useMemo)((()=>{var s,a;const l=null!==(s=r?.styles)&&void 0!==s?s:i,c=l?.blocks?.[e]?.variations?.[t];return{settings:null!==(a=r?.settings)&&void 0!==a?a:o,styles:{blocks:{[e]:{variations:{[`${t}-${n}`]:c}}}}}}),[r,o,i,t,n,e])}(e,o,n),l=(0,k.useMemo)((()=>{if(!o)return;const e={settings:s,styles:a},t=eF(Cc(),r,n);return QL(e,t,!1,!0,!0,!0,{blockGap:!1,blockStyles:!0,layoutStyles:!1,marginReset:!1,presets:!1,rootPadding:!1})}),[o,s,a,r,n]);return qy({id:`variation-${n}`,css:l,__unstableType:"variation",clientId:n}),o?{className:i}:{}}};var iF=n(99252),sF=n(48194);const aF="layout",{kebabCase:lF}=wf(c_.j);function cF(e){return Ac(e,"layout")||Ac(e,"__experimentalLayout")}function uF(e={},t=""){const{layout:n}=e,{default:r}=Sc(t,aF)||{},o=n?.inherit||n?.contentSize||n?.wideSize?{...n,type:"constrained"}:n||r||{},i=[];if(Vx[o?.type||"default"]?.className){const e=Vx[o?.type||"default"]?.className,n=t.split("/"),r=`wp-block-${"core"===n[0]?n.pop():n.join("-")}-${e}`;i.push(e,r)}return(0,Fl.A)((e=>(o?.inherit||o?.contentSize||"constrained"===o?.type)&&e(uy).getSettings().__experimentalFeatures?.useRootPaddingAwareAlignments),[o?.contentSize,o?.inherit,o?.type])&&i.push("has-global-padding"),o?.orientation&&i.push(`is-${lF(o.orientation)}`),o?.justifyContent&&i.push(`is-content-justification-${lF(o.justifyContent)}`),o?.flexWrap&&"nowrap"===o.flexWrap&&i.push("is-nowrap"),i}const dF={shareWithChildBlocks:!0,edit:function({layout:e,setAttributes:t,name:n,clientId:r}){const o=Ky(n),{layout:i}=o,{themeSupportsLayout:s}=(0,Fl.A)((e=>{const{getSettings:t}=e(uy);return{themeSupportsLayout:t().supportsLayout}}),[]);if("default"!==AS())return null;const a=Sc(n,aF,{}),l={...i,...a},{allowSwitching:c,allowEditing:u=!0,allowInheriting:d=!0,default:h}=l;if(!u)return null;const p={...a,...e},{type:f,default:{type:m="default"}={}}=p,g=f||m,b=!(!d||g&&"default"!==g&&"constrained"!==g&&!p.inherit),v=e||h||{},{inherit:y=!1,contentSize:_=null}=v;if(("default"===g||"constrained"===g)&&!s)return null;const x=uS(g),w=uS("constrained"),k=!v.type&&(_||y),C=!!y||!!_,S=e=>t({layout:e});return(0,Id.jsxs)(Id.Fragment,{children:[(0,Id.jsx)(AA,{children:(0,Id.jsxs)(iF.Ay,{title:(0,U.__)("Layout"),children:[b&&(0,Id.jsx)(Id.Fragment,{children:(0,Id.jsx)(Ux.A,{__nextHasNoMarginBottom:!0,className:"block-editor-hooks__toggle-control",label:(0,U.__)("Inner blocks use content width"),checked:"constrained"===x?.name||C,onChange:()=>t({layout:{type:"constrained"===x?.name||C?"default":"constrained"}}),help:"constrained"===x?.name||C?(0,U.__)("Nested blocks use content width with options for full and wide widths."):(0,U.__)("Nested blocks will fill the width of this container. Toggle to constrain.")})}),!y&&c&&(0,Id.jsx)(hF,{type:g,onChange:e=>t({layout:{type:e}})}),x&&"default"!==x.name&&(0,Id.jsx)(x.inspectorControls,{layout:v,onChange:S,layoutBlockSupport:l,name:n,clientId:r}),w&&k&&(0,Id.jsx)(w.inspectorControls,{layout:v,onChange:S,layoutBlockSupport:l,name:n,clientId:r})]})}),!y&&x&&(0,Id.jsx)(x.toolBarControls,{layout:v,onChange:S,layoutBlockSupport:a,name:n,clientId:r})]})},attributeKeys:["layout"],hasSupport:e=>cF(e)};function hF({type:e,onChange:t}){return(0,Id.jsx)(sF.A,{children:cS.map((({name:n,label:r})=>(0,Id.jsx)(Jy.Ay,{isPressed:e===n,onClick:()=>t(n),children:r},n)))})}function pF({block:e,props:t,blockGapSupport:n,layoutClasses:r}){const{name:o,attributes:i}=t,s=(0,L_.A)(e),{layout:a}=i,{default:l}=Sc(o,aF)||{},c=a?.inherit||a?.contentSize||a?.wideSize?{...a,type:"constrained"}:a||l||{},u=`wp-container-${lF(o)}-is-layout-`,d=`.${u}${s}`,h=null!==n,p=uS(c?.type||"default"),f=p?.getLayoutStyle?.({blockName:o,selector:d,layout:c,style:i?.style,hasBlockGapSupport:h}),m=(0,Vy.A)({[`${u}${s}`]:!!f},r);return qy({css:f}),(0,Id.jsx)(e,{...t,__unstableLayoutClassNames:m})}const fF=(0,Vp.f)((e=>t=>{const{clientId:n,name:r,attributes:o}=t,i=cF(r),s=uF(o,r),a=(0,Fl.A)((e=>{if(!i)return;const{getSettings:t,getBlockSettings:r}=wf(e(uy)),{disableLayoutStyles:o}=t();if(o)return;const[s]=r(n,"spacing.blockGap");return{blockGapSupport:s}}),[i,n]);return a?(0,Id.jsx)(pF,{block:e,props:t,layoutClasses:s,...a}):(0,Id.jsx)(e,{...t,__unstableLayoutClassNames:i?s:void 0})}),"withLayoutStyles");(0,Iu.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.layout)&&void 0!==t?t:{})||cF(e)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,Iu.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",fF);var mF=n(54652),gF=n(50088);const bF=()=>{},vF="bottom",yF="corner";const _F=(0,H_.default)("div",{target:"e1wq7y4k3"})({name:"1cd7zoc",styles:"bottom:0;box-sizing:border-box;left:0;pointer-events:none;position:absolute;right:0;top:0"}),xF=(0,H_.default)("div",{target:"e1wq7y4k2"})({name:"ajymcs",styles:"align-items:center;box-sizing:border-box;display:inline-flex;justify-content:center;opacity:0;pointer-events:none;transition:opacity 120ms linear"}),wF=(0,H_.default)("div",{target:"e1wq7y4k1"})("background:",W_.l.theme.foreground,";border-radius:2px;box-sizing:border-box;font-family:",(0,EA.g)("default.fontFamily"),";font-size:12px;color:",W_.l.theme.foregroundInverted,";padding:4px 8px;position:relative;"),kF=(0,H_.default)(BT.A,{target:"e1wq7y4k0"})("&&&{color:",W_.l.theme.foregroundInverted,";display:block;font-size:13px;line-height:1.4;white-space:nowrap;}"),CF=(0,k.forwardRef)((function({label:e,position:t=yF,zIndex:n=1e3,...r},o){const i=!!e,s=t===yF;if(!i)return null;let a={opacity:i?1:void 0,zIndex:n},l={};return t===vF&&(a={...a,position:"absolute",bottom:-10,left:"50%",transform:"translate(-50%, 0)"},l={transform:"translate(0, 100%)"}),s&&(a={...a,position:"absolute",top:4,right:(0,U.isRTL)()?void 0:4,left:(0,U.isRTL)()?4:void 0}),(0,Id.jsx)(xF,{"aria-hidden":"true",className:"components-resizable-tooltip__tooltip-wrapper",ref:o,style:a,...r,children:(0,Id.jsx)(wF,{className:"components-resizable-tooltip__tooltip",style:l,children:(0,Id.jsx)(kF,{as:"span",children:e})})})})),SF=CF,AF=()=>{},EF=(0,k.forwardRef)((function({axis:e,className:t,fadeTimeout:n=180,isVisible:r=!0,labelRef:o,onResize:i=AF,position:s=vF,showPx:a=!0,zIndex:l=1e3,...c},u){const{label:d,resizeListener:h}=function({axis:e,fadeTimeout:t=180,onResize:n=bF,position:r=vF,showPx:o=!1}){const[i,s]=(0,gF.A)(),a=!!e,[l,c]=(0,k.useState)(!1),[u,d]=(0,k.useState)(!1),{width:h,height:p}=s,f=(0,k.useRef)(p),m=(0,k.useRef)(h),g=(0,k.useRef)(),b=(0,k.useCallback)((()=>{g.current&&window.clearTimeout(g.current),g.current=window.setTimeout((()=>{a||(c(!1),d(!1))}),t)}),[t,a]);(0,k.useEffect)((()=>{if(null===h&&null===p)return;const e=h!==m.current,t=p!==f.current;if(e||t){if(h&&!m.current&&p&&!f.current)return m.current=h,void(f.current=p);e&&(c(!0),m.current=h),t&&(d(!0),f.current=p),n({width:h,height:p}),b()}}),[h,p,n,b]);const v=function({axis:e,height:t,moveX:n=!1,moveY:r=!1,position:o=vF,showPx:i=!1,width:s}){if(!n&&!r)return;if(o===yF)return`${s} x ${t}`;const a=i?" px":"";if(e){if("x"===e&&n)return`${s}${a}`;if("y"===e&&r)return`${t}${a}`}return n&&r?`${s} x ${t}`:n?`${s}${a}`:r?`${t}${a}`:void 0}({axis:e,height:p,moveX:l,moveY:u,position:r,showPx:o,width:h});return{label:v,resizeListener:i}}({axis:e,fadeTimeout:n,onResize:i,showPx:a,position:s});if(!r)return null;const p=(0,Vy.A)("components-resize-tooltip",t);return(0,Id.jsxs)(_F,{"aria-hidden":"true",className:p,ref:u,...c,children:[h,(0,Id.jsx)(SF,{"aria-hidden":c["aria-hidden"],label:d,position:s,ref:o,zIndex:l})]})})),IF=EF,jF="components-resizable-box__handle",TF="components-resizable-box__side-handle",BF="components-resizable-box__corner-handle",RF={top:(0,Vy.A)(jF,TF,"components-resizable-box__handle-top"),right:(0,Vy.A)(jF,TF,"components-resizable-box__handle-right"),bottom:(0,Vy.A)(jF,TF,"components-resizable-box__handle-bottom"),left:(0,Vy.A)(jF,TF,"components-resizable-box__handle-left"),topLeft:(0,Vy.A)(jF,BF,"components-resizable-box__handle-top","components-resizable-box__handle-left"),topRight:(0,Vy.A)(jF,BF,"components-resizable-box__handle-top","components-resizable-box__handle-right"),bottomRight:(0,Vy.A)(jF,BF,"components-resizable-box__handle-bottom","components-resizable-box__handle-right"),bottomLeft:(0,Vy.A)(jF,BF,"components-resizable-box__handle-bottom","components-resizable-box__handle-left")},NF={width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0},DF={top:NF,right:NF,bottom:NF,left:NF,topLeft:NF,topRight:NF,bottomRight:NF,bottomLeft:NF},MF=(0,k.forwardRef)((function({className:e,children:t,showHandle:n=!0,__experimentalShowTooltip:r=!1,__experimentalTooltipProps:o={},...i},s){return(0,Id.jsxs)(mF.Resizable,{className:(0,Vy.A)("components-resizable-box__container",n&&"has-show-handle",e),handleClasses:RF,handleStyles:DF,ref:s,...i,children:[t,r&&(0,Id.jsx)(IF,{...o})]})})),PF=MF;function OF({clientId:e,bounds:t,onChange:n}){const r=WC(e),o=r?.parentElement;return r&&o?(0,Id.jsx)(LF,{clientId:e,bounds:t,blockElement:r,rootBlockElement:o,onChange:n}):null}function LF({clientId:e,bounds:t,blockElement:n,rootBlockElement:r,onChange:o}){const[i,s]=(0,k.useState)(null),[a,l]=(0,k.useState)({top:!1,bottom:!1,left:!1,right:!1});(0,k.useEffect)((()=>{const e=new window.ResizeObserver((()=>{const e=n.getBoundingClientRect(),t=r.getBoundingClientRect();l({top:e.top>t.top,bottom:e.bottomt.left,right:e.righte.disconnect()}),[n,r]);const c={right:"flex-start",left:"flex-end"},u={top:"flex-end",bottom:"flex-start"},d={display:"flex",justifyContent:"center",alignItems:"center",...c[i]&&{justifyContent:c[i]},...u[i]&&{alignItems:u[i]}};return(0,Id.jsx)(ZC,{className:"block-editor-grid-item-resizer",clientId:e,__unstablePopoverSlot:"block-toolbar",additionalStyles:d,children:(0,Id.jsx)(PF,{className:"block-editor-grid-item-resizer__box",size:{width:"100%",height:"100%"},enable:{bottom:a.bottom,bottomLeft:!1,bottomRight:!1,left:a.left,right:a.right,top:a.top,topLeft:!1,topRight:!1},bounds:t,boundsByDirection:!0,onResizeStart:(e,t)=>{s(t),n.ownerDocument.addEventListener("mouseup",(()=>{e.target.dispatchEvent(new Event("mouseup",{bubbles:!0}))}),{once:!0})},onResizeStop:(e,t,i)=>{const s=parseFloat(QC(r,"column-gap")),a=parseFloat(QC(r,"row-gap")),l=FF(QC(r,"grid-template-columns"),s),c=FF(QC(r,"grid-template-rows"),a),u=new window.DOMRect(n.offsetLeft+i.offsetLeft,n.offsetTop+i.offsetTop,i.offsetWidth,i.offsetHeight),d=zF(l,u.left)+1,h=zF(c,u.top)+1,p=zF(l,u.right,"end")+1,f=zF(c,u.bottom,"end")+1;o({columnSpan:p-d+1,rowSpan:f-h+1})}})})}function FF(e,t){const n=[];for(const r of e.split(" ")){const e=n[n.length-1],o=e?e.end+t:0,i=o+parseFloat(r);n.push({start:o,end:i})}return n}function zF(e,t,n="start"){return e.reduce(((r,o,i)=>Math.abs(o[n]-t)!e(uy).getSettings().disableLayoutStyles)),o=null!==(n=t?.layout)&&void 0!==n?n:{},{selfStretch:i,flexSize:s,columnStart:a,rowStart:l,columnSpan:c,rowSpan:u}=o,d=fS()||{},{columnCount:h,minimumColumnWidth:p}=d,f=(0,L_.A)(e),m=`.wp-container-content-${f}`;let g="";if(r){if("fixed"===i&&s?g=`${m} {\n\t\t\t\tflex-basis: ${s};\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}`:"fill"===i?g=`${m} {\n\t\t\t\tflex-grow: 1;\n\t\t\t}`:a&&c?g=`${m} {\n\t\t\t\tgrid-column: ${a} / span ${c};\n\t\t\t}`:a?g=`${m} {\n\t\t\t\tgrid-column: ${a};\n\t\t\t}`:c&&(g=`${m} {\n\t\t\t\tgrid-column: span ${c};\n\t\t\t}`),(c||a)&&(p||!h)){const e=c?parseInt(c):null,t=a?parseInt(a):null,n=Math.max(e,t);let r=parseFloat(p);isNaN(r)&&(r=12);let o=p?.replace(r,"");["px","rem","em"].includes(o)||(o="rem"),g+=`@container (max-width: ${n*r+(n-1)*("px"===o?24:1.5)}${o}) {\n\t\t\t\t${m} {\n\t\t\t\t\tgrid-column: ${c?"1/-1":"auto"};\n\t\t\t\t}\n\t\t\t}`}l&&u?g+=`${m} {\n\t\t\t\tgrid-row: ${l} / span ${u};\n\t\t\t}`:l?g+=`${m} {\n\t\t\t\tgrid-row: ${l};\n\t\t\t}`:u&&(g+=`${m} {\n\t\t\t\tgrid-row: span ${u};\n\t\t\t}`)}if(qy({css:g}),g)return{className:`wp-container-content-${f}`}},edit:function({clientId:e,style:t,setAttributes:n}){const{type:r="default",allowSizingOnChildren:o=!1}=fS()||{},i=(0,Fl.A)((t=>t(uy).getBlockRootClientId(e)),[e]),[s,a]=(0,k.useState)();return"grid"!==r?null:(0,Id.jsxs)(Id.Fragment,{children:[(0,Id.jsx)(eS,{clientId:i,contentRef:a}),o&&(0,Id.jsx)(OF,{clientId:e,bounds:s,onChange:({columnSpan:e,rowSpan:r})=>{n({style:{...t,layout:{...t?.layout,columnSpan:e,rowSpan:r}}})}})]})},attributeKeys:["style"],hasSupport:()=>!0};function VF(e){return(0,Fl.A)((t=>{const{getBlocksByClientId:n,getSelectedBlockClientIds:r,isUngroupable:o,isGroupable:i}=t(uy),{getGroupingBlockName:s,getBlockType:a}=t(Zu),l=e?.length?e:r(),c=n(l),[u]=c,d=1===l.length&&o(l[0]);return{clientIds:l,isGroupable:i(l),isUngroupable:d,blocksSelection:c,groupingBlockName:s(),onUngroup:d&&a(u.name)?.transforms?.ungroup}}),[e])}function HF({clientIds:e,isGroupable:t,isUngroupable:n,onUngroup:r,blocksSelection:o,groupingBlockName:i,onClose:s=(()=>{})}){const{getSelectedBlockClientIds:a}=(0,Fl.A)(uy),{replaceBlocks:l}=(0,zl.A)(uy);if(!t&&!n)return null;const c=a();return(0,Id.jsxs)(Id.Fragment,{children:[t&&(0,Id.jsx)(x_.A,{shortcut:c.length>1?zE.displayShortcut.primary("g"):void 0,onClick:()=>{(()=>{const t=cd(o,i);t&&l(e,t)})(),s()},children:(0,U._x)("Group","verb")}),n&&(0,Id.jsx)(x_.A,{onClick:()=>{(()=>{let t=o[0].innerBlocks;t.length&&(r&&(t=r(o[0].attributes,o[0].innerBlocks)),l(e,t))})(),s()},children:(0,U._x)("Ungroup","Ungrouping blocks from within a grouping block back into individual blocks within the Editor ")})]})}function $F(e){return(0,Fl.A)((t=>{const{canEditBlock:n,canMoveBlock:r,canRemoveBlock:o,canLockBlockType:i,getBlockName:s,getBlockRootClientId:a,getTemplateLock:l}=t(uy),c=a(e),u=n(e),d=r(e,c),h=o(e,c);return{canEdit:u,canMove:d,canRemove:h,canLock:i(s(e)),isContentLocked:"contentOnly"===l(e),isLocked:!u||!d||!h}}),[e])}var WF=n(23690),GF=n(51994),qF=n(98968),KF=n(54441);const YF=["core/block","core/navigation"];function JF(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function XF({clientId:e,onClose:t}){const[n,r]=(0,k.useState)({move:!1,remove:!1}),{canEdit:o,canMove:i,canRemove:s}=$F(e),{allowsEditLocking:a,templateLock:l,hasTemplateLock:c}=(0,Fl.A)((t=>{const{getBlockName:n,getBlockAttributes:r}=t(uy),o=n(e),i=kc(o);return{allowsEditLocking:YF.includes(o),templateLock:r(e)?.templateLock,hasTemplateLock:!!i?.attributes?.templateLock}}),[e]),[u,d]=(0,k.useState)(!!l),{updateBlockAttributes:h}=(0,zl.A)(uy),p=jL(e),f=(0,L_.A)(XF,"block-editor-block-lock-modal__options-title");(0,k.useEffect)((()=>{r({move:!i,remove:!s,...a?{edit:!o}:{}})}),[o,i,s,a]);const m=Object.values(n).every(Boolean),g=Object.values(n).some(Boolean)&&!m;return(0,Id.jsxs)(qF.A,{title:(0,U.sprintf)((0,U.__)("Lock %s"),p.title),overlayClassName:"block-editor-block-lock-modal",onRequestClose:t,children:[(0,Id.jsx)("p",{children:(0,U.__)("Choose specific attributes to restrict or lock all available options.")}),(0,Id.jsxs)("form",{onSubmit:r=>{r.preventDefault(),h([e],{lock:n,templateLock:u?JF(n):void 0}),t()},children:[(0,Id.jsxs)("div",{role:"group","aria-labelledby":f,className:"block-editor-block-lock-modal__options",children:[(0,Id.jsx)(rj.A,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__options-title",label:(0,Id.jsx)("span",{id:f,children:(0,U.__)("Lock all")}),checked:m,indeterminate:g,onChange:e=>r({move:e,remove:e,...a?{edit:e}:{}})}),(0,Id.jsxs)("ul",{className:"block-editor-block-lock-modal__checklist",children:[a&&(0,Id.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,Id.jsx)(rj.A,{__nextHasNoMarginBottom:!0,label:(0,U.__)("Restrict editing"),checked:!!n.edit,onChange:e=>r((t=>({...t,edit:e})))}),(0,Id.jsx)(Fx.A,{className:"block-editor-block-lock-modal__lock-icon",icon:n.edit?KF.A:WF.A})]}),(0,Id.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,Id.jsx)(rj.A,{__nextHasNoMarginBottom:!0,label:(0,U.__)("Disable movement"),checked:n.move,onChange:e=>r((t=>({...t,move:e})))}),(0,Id.jsx)(Fx.A,{className:"block-editor-block-lock-modal__lock-icon",icon:n.move?KF.A:WF.A})]}),(0,Id.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,Id.jsx)(rj.A,{__nextHasNoMarginBottom:!0,label:(0,U.__)("Prevent removal"),checked:n.remove,onChange:e=>r((t=>({...t,remove:e})))}),(0,Id.jsx)(Fx.A,{className:"block-editor-block-lock-modal__lock-icon",icon:n.remove?KF.A:WF.A})]})]}),c&&(0,Id.jsx)(Ux.A,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__template-lock",label:(0,U.__)("Apply to all blocks inside"),checked:u,disabled:n.move&&!n.remove,onChange:()=>d(!u)})]}),(0,Id.jsxs)(j_.A,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1,children:[(0,Id.jsx)(T_.A,{children:(0,Id.jsx)(Jy.Ay,{variant:"tertiary",onClick:t,children:(0,U.__)("Cancel")})}),(0,Id.jsx)(T_.A,{children:(0,Id.jsx)(Jy.Ay,{variant:"primary",type:"submit",children:(0,U.__)("Apply")})})]})]})]})}function ZF({clientId:e}){const{canLock:t,isLocked:n}=$F(e),[r,o]=(0,k.useReducer)((e=>!e),!1);if(!t)return null;const i=n?(0,U.__)("Unlock"):(0,U.__)("Lock");return(0,Id.jsxs)(Id.Fragment,{children:[(0,Id.jsx)(x_.A,{icon:n?WF.A:GF.A,onClick:o,"aria-expanded":r,"aria-haspopup":"dialog",children:i}),r&&(0,Id.jsx)(XF,{clientId:e,onClose:o})]})}const QF=()=>{},ez=(0,D.A)([(0,rI.A)(((e,{clientId:t})=>{const{getBlock:n,getBlockMode:r,getSettings:o}=e(uy),i=n(t),s=o().codeEditingEnabled;return{mode:r(t),blockType:i?kc(i.name):null,isCodeEditingEnabled:s}})),(0,FE.A)(((e,{onToggle:t=QF,clientId:n})=>({onToggleMode(){e(uy).toggleBlockMode(n),t()}})))])((function({blockType:e,mode:t,onToggleMode:n,small:r=!1,isCodeEditingEnabled:o=!0}){if(!e||!Ac(e,"html",!0)||!o)return null;const i="visual"===t?(0,U.__)("Edit as HTML"):(0,U.__)("Edit visually");return(0,Id.jsx)(x_.A,{onClick:n,children:!r&&i})}));function tz(e){return 0===e?.trim()?.length}function nz({blockName:e,originalBlockName:t,onClose:n,onSave:r,hasOverridesWarning:o}){const[i,s]=(0,k.useState)(e),a=(0,k.useId)(),l=i!==e,c=i===t,u=tz(i),d=l||c;return(0,Id.jsx)(qF.A,{title:(0,U.__)("Rename"),onRequestClose:n,overlayClassName:"block-editor-block-rename-modal",focusOnMount:"firstContentElement",aria:{describedby:a},size:"small",children:(0,Id.jsxs)("form",{onSubmit:e=>{e.preventDefault(),d&&(()=>{const e=c||u?(0,U.sprintf)((0,U.__)('Block name reset to: "%s".'),i):(0,U.sprintf)((0,U.__)('Block name changed to: "%s".'),i);(0,Kb.speak)(e,"assertive"),r(i),n()})()},children:[(0,Id.jsx)("p",{id:a,children:(0,U.__)("Enter a custom name for this block.")}),(0,Id.jsxs)(nE.A,{spacing:"3",children:[(0,Id.jsx)(GE.A,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:i,label:(0,U.__)("Block name"),hideLabelFromVision:!0,help:o?(0,U.__)("This block allows overrides. Changing the name can cause problems with content entered into instances of this pattern."):void 0,placeholder:t,onChange:s,onFocus:e=>e.target.select()}),(0,Id.jsxs)(QS.A,{justify:"right",children:[(0,Id.jsx)(Jy.Ay,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:n,children:(0,U.__)("Cancel")}),(0,Id.jsx)(Jy.Ay,{__next40pxDefaultSize:!0,"aria-disabled":!d,variant:"primary",type:"submit",children:(0,U.__)("Save")})]})]})]})})}function rz({clientId:e}){const[t,n]=(0,k.useState)(!1),{metadata:r}=(0,Fl.A)((t=>{const{getBlockAttributes:n}=t(uy),r=n(e)?.metadata;return{metadata:r}}),[e]),{updateBlockAttributes:o}=(0,zl.A)(uy),i=r?.name,s=!!i&&!!r?.bindings&&Object.values(r.bindings).some((e=>"core/pattern-overrides"===e.source)),a=jL(e);return(0,Id.jsxs)(Id.Fragment,{children:[(0,Id.jsx)(x_.A,{onClick:()=>{n(!0)},"aria-expanded":t,"aria-haspopup":"dialog",children:(0,U.__)("Rename")}),t&&(0,Id.jsx)(nz,{blockName:i||"",originalBlockName:a?.title,hasOverridesWarning:s,onClose:()=>n(!1),onSave:t=>{(t===a?.title||tz(t))&&(t=void 0),function(t){o([e],{metadata:{...r,name:t}})}(t)}})]})}const{Fill:oz,Slot:iz}=(0,Ul.QJ)("BlockSettingsMenuControls");function sz({...e}){return(0,Id.jsx)(s_.A,{document,children:(0,Id.jsx)(oz,{...e})})}sz.Slot=({fillProps:e,clientIds:t=null})=>{const{selectedBlocks:n,selectedClientIds:r,isContentOnly:o}=(0,Fl.A)((e=>{const{getBlockNamesByClientId:n,getSelectedBlockClientIds:r,getBlockEditingMode:o}=e(uy),i=null!==t?t:r();return{selectedBlocks:n(i),selectedClientIds:i,isContentOnly:"contentOnly"===o(i[0])}}),[t]),{canLock:i}=$F(r[0]),{canRename:s}=function(e){return{canRename:Sc(e,"renaming",!0)}}(n[0]),a=1===r.length&&i&&!o,l=1===r.length&&s&&!o,c=VF(r),{isGroupable:u,isUngroupable:d}=c,h=u||d;return(0,Id.jsx)(iz,{fillProps:{...e,selectedBlocks:n,selectedClientIds:r},children:t=>!t?.length>0&&!h&&!a?null:(0,Id.jsxs)(__.A,{children:[h&&(0,Id.jsx)(HF,{...c,onClose:e?.onClose}),a&&(0,Id.jsx)(ZF,{clientId:r[0]}),l&&(0,Id.jsx)(rz,{clientId:r[0]}),t,e?.canMove&&!e?.onlyBlock&&!o&&(0,Id.jsx)(x_.A,{onClick:(0,Zp.h)(e?.onClose,e?.onMoveTo),children:(0,U.__)("Move to")}),1===e?.count&&!o&&(0,Id.jsx)(ez,{clientId:e?.firstBlockClientId,onToggle:e?.onClose})]})})};const az=sz,lz={edit:function({clientId:e,isSelected:t}){const{templateLock:n,isLockedByParent:r,isEditingAsBlocks:o}=(0,Fl.A)((t=>{const{getContentLockingParent:n,getTemplateLock:r,getTemporarilyEditingAsBlocks:o}=wf(t(uy));return{templateLock:r(e),isLockedByParent:!!n(e),isEditingAsBlocks:o()===e}}),[e]),{stopEditingAsBlocks:i,modifyContentLockBlock:s}=wf((0,zl.A)(uy)),a=!r&&"contentOnly"===n,l=(0,k.useCallback)((()=>{i(e)}),[e,i]);if(!a&&!o)return null;const c=o&&!a,u=!o&&a&&t;return(0,Id.jsxs)(Id.Fragment,{children:[c&&(0,Id.jsx)(Id.Fragment,{children:(0,Id.jsx)(v_,{group:"other",children:(0,Id.jsx)(t_,{onClick:l,children:(0,U.__)("Done")})})}),u&&(0,Id.jsx)(az,{children:({selectedClientIds:t,onClose:n})=>1===t.length&&t[0]===e&&(0,Id.jsx)(x_.A,{onClick:()=>{s(e),n()},children:(0,U.__)("Modify")})})]})},hasSupport:()=>!0},cz="metadata";(0,Iu.addFilter)("blocks.registerBlockType","core/metadata/addMetaAttribute",(function(e){return e?.attributes?.[cz]?.type||(e.attributes={...e.attributes,[cz]:{type:"object"}}),e}));var uz=n(3445);const dz=(0,k.memo)((function({icon:e,showColors:t=!1,className:n,context:r}){"block-default"===e?.src&&(e={src:uz.A});const o=(0,Id.jsx)(Fx.A,{icon:e&&e.src?e.src:e,context:r}),i=t?{backgroundColor:e&&e.background,color:e&&e.foreground}:{};return(0,Id.jsx)("span",{style:i,className:(0,Vy.A)("block-editor-block-icon",n,{"has-colors":t}),children:o})})),hz={},pz={edit:function({name:e,clientId:t,metadata:{ignoredHookedBlocks:n=[]}={}}){const r=(0,Fl.A)((e=>e(Zu).getBlockTypes()),[]),o=(0,k.useMemo)((()=>r?.filter((({name:t,blockHooks:r})=>r&&e in r||n.includes(t)))),[r,e,n]),{blockIndex:i,rootClientId:s,innerBlocksLength:a}=(0,Fl.A)((e=>{const{getBlocks:n,getBlockIndex:r,getBlockRootClientId:o}=e(uy);return{blockIndex:r(t),innerBlocksLength:n(t)?.length,rootClientId:o(t)}}),[t]),l=(0,Fl.A)((n=>{const{getBlocks:r,getGlobalBlockCount:i}=n(uy),a=o.reduce(((n,o)=>{if(0===i(o.name))return n;const a=o?.blockHooks?.[e];let l;switch(a){case"before":case"after":l=r(s);break;case"first_child":case"last_child":l=r(t);break;case void 0:l=[...r(s),...r(t)]}const c=l?.find((e=>e.name===o.name));return c?{...n,[o.name]:c.clientId}:n}),{});return Object.values(a).length>0?a:hz}),[o,e,t,s]),{insertBlock:c,removeBlock:u}=(0,zl.A)(uy);if(!o.length)return null;const d=o.reduce(((e,t)=>{const[n]=t.name.split("/");return e[n]||(e[n]=[]),e[n].push(t),e}),{});return(0,Id.jsx)(AA,{children:(0,Id.jsxs)(iF.Ay,{className:"block-editor-hooks__block-hooks",title:(0,U.__)("Plugins"),initialOpen:!0,children:[(0,Id.jsx)("p",{className:"block-editor-hooks__block-hooks-helptext",children:(0,U.__)("Manage the inclusion of blocks added automatically by plugins.")}),Object.keys(d).map((n=>(0,Id.jsxs)(k.Fragment,{children:[(0,Id.jsx)("h3",{children:n}),d[n].map((n=>{const r=n.name in l;return(0,Id.jsx)(Ux.A,{checked:r,label:(0,Id.jsxs)(QS.A,{justify:"flex-start",children:[(0,Id.jsx)(dz,{icon:n.icon}),(0,Id.jsx)("span",{children:n.title})]}),onChange:()=>{if(r)u(l[n.name],!1);else{const r=n.blockHooks[e];((e,n)=>{switch(n){case"before":case"after":c(e,"after"===n?i+1:i,s,!1);break;case"first_child":case"last_child":c(e,"first_child"===n?0:a,t,!1);break;case void 0:c(e,i+1,s,!1)}})(Qu(n.name),r)}}},n.title)}))]},n)))]})})},attributeKeys:["metadata"],hasSupport:()=>!0},fz=(0,z_.KZ)((function(e,t){const{role:n,wrapperClassName:r,...o}=function(e){const{as:t,className:n,onClick:r,role:o="listitem",size:i,...s}=(0,F_.A)(e,"Item"),{spacedAround:a,size:l}=UA(),c=i||l,u=t||(void 0!==r?"button":"div"),d=(0,U_.l)(),h=(0,k.useMemo)((()=>d(("button"===u||"a"===u)&&(e=>(0,$_.css)("font-size:",(0,EA.g)("default.fontSize"),";font-family:inherit;appearance:none;border:1px solid transparent;cursor:pointer;background:none;text-align:start;text-decoration:","a"===e?"none":void 0,";svg,path{fill:currentColor;}&:hover{color:",W_.l.theme.accent,";}&:focus{box-shadow:none;outline:none;}&:focus-visible{box-shadow:0 0 0 var( --wp-admin-border-width-focus ) ",W_.l.theme.accent,";outline:2px solid transparent;outline-offset:0;}",""))(u),FA[c]||FA.medium,jA,a&&NA,n)),[u,n,d,c,a]),p=d(IA);return{as:u,className:h,onClick:r,wrapperClassName:p,role:o,...s}}(e);return(0,Id.jsx)("div",{role:n,className:r,children:(0,Id.jsx)(dx.A,{...o,ref:t})})}),"Item"),mz={"core/paragraph":["content"],"core/heading":["content"],"core/image":["id","url","title","alt"],"core/button":["url","text","linkTarget","rel"]};function gz(e){return e in mz}function bz(e,t){return gz(e)&&mz[e].includes(t)}const vz=(0,Vp.f)((e=>t=>{const n=(0,Up.A)(),r=(0,Fl.A)((e=>wf(e(Zu)).getAllBlockBindingsSources())),{name:o,clientId:i,context:s}=t,a=(0,k.useMemo)((()=>function(e,t){if("core/pattern-overrides"===t?.__default?.source){const n=mz[e],r={};for(const e of n){const n=t[e]?t[e]:{source:"core/pattern-overrides"};r[e]=n}return r}return t}(o,t.attributes.metadata?.bindings)),[t.attributes.metadata?.bindings,o]),l=(0,Fl.A)((()=>{if(!a)return;const e={};for(const[t,l]of Object.entries(a)){const a=r[l.source];if(!a?.getValue||!bz(o,t))continue;const c={registry:n,context:s,clientId:i,attributeName:t,args:l.args};e[t]=a.getValue(c),void 0===e[t]&&(e[t]="url"===t?null:a.getPlaceholder?.(c))}return e}),[a,o,i,s,n,r]),{setAttributes:c}=t,u=(0,k.useCallback)((e=>{n.batch((()=>{if(!a)return void c(e);const t={...e},l=new Map;for(const[e,n]of Object.entries(t)){if(!a[e]||!bz(o,e))continue;const i=a[e],s=r[i?.source];(s?.setValue||s?.setValues)&&(l.set(s,{...l.get(s),[e]:n}),delete t[e])}if(l.size)for(const[e,t]of l)if(e.setValues)e.setValues({registry:n,context:s,clientId:i,attributes:t});else for(const[r,o]of Object.entries(t)){const t=a[r];e.setValue({registry:n,context:s,clientId:i,attributeName:r,args:t.args,value:o})}Object.keys(t).length&&c(t)}))}),[n,a,o,i,s,c,r]);return(0,Id.jsx)(Id.Fragment,{children:(0,Id.jsx)(e,{...t,attributes:{...t.attributes,...l},setAttributes:u})})}),"withBlockBindingSupport");(0,Iu.addFilter)("blocks.registerBlockType","core/editor/custom-sources-backwards-compatibility/shim-attribute-source",(function(e,t){return gz(t)?{...e,edit:vz(e.edit)}:e}));const yz={edit:({name:e,metadata:t})=>{const{bindings:n}=t||{},{sources:r}=(0,Fl.A)((e=>({sources:wf(e(Zu)).getAllBlockBindingsSources()})),[]);if(!n)return null;const o={...n};return Object.keys(o).forEach((t=>{bz(e,t)&&"core/pattern-overrides"!==o[t].source||delete o[t]})),0===Object.keys(o).length?null:(0,Id.jsx)(AA,{children:(0,Id.jsx)(iF.Ay,{title:(0,U.__)("Bindings"),className:"components-panel__block-bindings-panel",children:(0,Id.jsx)(VA,{isBordered:!0,isSeparated:!0,size:"large",children:Object.keys(o).map((e=>(0,Id.jsx)(fz,{children:(0,Id.jsxs)(QS.A,{children:[(0,Id.jsx)("span",{children:e}),(0,Id.jsx)("span",{className:"components-item__block-bindings-source",children:r[o[e].source]?r[o[e].source].label:o[e].source})]})},e)))})})})},attributeKeys:["metadata"],hasSupport:()=>!0};function _z(e){const t=e.style?.border||{};return{className:rN(e)||void 0,style:GO({border:t})}}function xz(e){const{colors:t}=eT(),n=_z(e),{borderColor:r}=e;if(r){const e=KR({colors:t,namedColor:r});n.style.borderColor=e.color}return n}function wz(e){return{style:GO({shadow:e.style?.shadow||""})}}(0,Iu.addFilter)("blocks.registerBlockType","core/metadata/addLabelCallback",(function(e){return e.__experimentalLabel||Ac(e,"renaming",!0)&&(e.__experimentalLabel=(e,{context:t})=>{const{metadata:n}=e;if("list-view"===t&&n?.name)return n.name}),e}));const{kebabCase:kz}=wf(c_.j);var Cz;!function(e){e=e.map((e=>({...e,Edit:(0,k.memo)(e.edit)})));const t=(0,Vp.f)((t=>n=>{const r=Xp();return[...e.map(((e,t)=>{const{Edit:o,hasSupport:i,attributeKeys:s=[],shareWithChildBlocks:a}=e;if(!(r[Hp]||r[$p]&&a)||!i(n.name))return null;const l={};for(const e of s)n.attributes[e]&&(l[e]=n.attributes[e]);return(0,Id.jsx)(o,{name:n.name,isSelected:n.isSelected,clientId:n.clientId,setAttributes:n.setAttributes,__unstableParentLayout:n.__unstableParentLayout,...l},t)})),(0,Id.jsx)(t,{...n},"edit")]}),"withBlockEditHooks");(0,Iu.addFilter)("editor.BlockEdit","core/editor/hooks",t)}([yz,TS,uP,Oj,zj,QO,IL,UL,dF,lz,pz,UF].filter(Boolean)),function(e){const t=(0,Vp.f)((t=>n=>{const[r,o]=(0,k.useState)(Array(e.length).fill(void 0));return[...e.map(((e,t)=>{const{hasSupport:r,attributeKeys:i=[],useBlockProps:s}=e,a={};for(const e of i)n.attributes[e]&&(a[e]=n.attributes[e]);return Object.keys(a).length&&r(n.name)?(0,Id.jsx)(Yy,{index:t,useBlockProps:s,setAllWrapperProps:o,name:n.name,clientId:n.clientId,...a},t):null})),(0,Id.jsx)(t,{...n,wrapperProps:r.filter(Boolean).reduce(((e,t)=>({...e,...t,className:(0,Vy.A)(e.className,t.className),style:{...e.style,...t.style}})),n.wrapperProps||{})},"edit")]}),"withBlockListBlockHooks");(0,Iu.addFilter)("editor.BlockListBlock","core/editor/hooks",t)}([TS,uP,Dj,QO,ND,HO,IL,qM,QM,oN,UL,oF,UF]),Cz=[TS,uP,Oj,Fj,zj,oN,ND,QO,qM,QM],(0,Iu.addFilter)("blocks.getSaveContent.extraProps","core/editor/hooks",(function(e,t,n){return Cz.reduce(((e,r)=>{const{hasSupport:o,attributeKeys:i=[],addSaveProps:s}=r,a={};for(const e of i)n[e]&&(a[e]=n[e]);return Object.keys(a).length&&o(t)?s(e,t,a):e}),e)}),0),(0,Iu.addFilter)("blocks.getSaveContent.extraProps","core/editor/hooks",(e=>(e.hasOwnProperty("className")&&!e.className&&delete e.className,e)));var Sz=n(28998),Az=n(9899),Ez=n(8686),Iz=n(18861),jz=n(78008),Tz=n(12367),Bz=n(50114);const Rz={0:Sz.A,1:Az.A,2:Ez.A,3:Iz.A,4:jz.A,5:Tz.A,6:Bz.A};function Nz({level:e}){return Rz[e]?(0,Id.jsx)(Fx.A,{icon:Rz[e]}):null}const Dz=[1,2,3,4,5,6],Mz={className:"block-library-heading-level-dropdown"};function Pz({options:e=Dz,value:t,onChange:n}){return(0,Id.jsx)(y_,{popoverProps:Mz,icon:(0,Id.jsx)(Nz,{level:t}),label:(0,U.__)("Change level"),controls:e.map((e=>{const r=e===t;return{icon:(0,Id.jsx)(Nz,{level:e}),title:0===e?(0,U.__)("Paragraph"):(0,U.sprintf)((0,U.__)("Heading %d"),e),isActive:r,onClick(){n(e)},role:"menuitemradio"}}))})}const Oz=(0,Id.jsx)(dw.t4,{className:"components-placeholder__illustration",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 60 60",preserveAspectRatio:"none",children:(0,Id.jsx)(dw.wA,{vectorEffect:"non-scaling-stroke",d:"M60 60 0 0"})}),Lz=function(e){const{icon:t,children:n,label:r,instructions:o,className:i,notices:s,preview:a,isColumnLayout:l,withIllustration:c,...u}=e,[d,{width:h}]=(0,gF.A)();let p;"number"==typeof h&&(p={"is-large":h>=480,"is-medium":h>=160&&h<480,"is-small":h<160});const f=(0,Vy.A)("components-placeholder",i,p,c?"has-illustration":null),m=(0,Vy.A)("components-placeholder__fieldset",{"is-column-layout":l});return(0,k.useEffect)((()=>{o&&(0,Kb.speak)(o)}),[o]),(0,Id.jsxs)("div",{...u,className:f,children:[c?Oz:null,d,s,a&&(0,Id.jsx)("div",{className:"components-placeholder__preview",children:a}),(0,Id.jsxs)("div",{className:"components-placeholder__label",children:[(0,Id.jsx)(Fx.A,{icon:t}),r]}),!!o&&(0,Id.jsx)("div",{className:"components-placeholder__instructions",children:o}),(0,Id.jsx)("div",{className:m,children:n})]})};var Fz=n(82432);const zz=function({icon:e=Fz.A,label:t=(0,U.__)("Choose variation"),instructions:n=(0,U.__)("Select a variation to start with:"),variations:r,onSelect:o,allowSkip:i}){const s=(0,Vy.A)("block-editor-block-variation-picker",{"has-many-variations":r.length>4});return(0,Id.jsxs)(Lz,{icon:e,label:t,instructions:n,className:s,children:[(0,Id.jsx)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,U.__)("Block variations"),children:r.map((e=>(0,Id.jsxs)("li",{children:[(0,Id.jsx)(Jy.Ay,{__next40pxDefaultSize:!0,variant:"tertiary",icon:e.icon&&e.icon.src?e.icon.src:e.icon,iconSize:48,onClick:()=>o(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,Id.jsx)("span",{className:"block-editor-block-variation-picker__variation-label",children:e.title})]},e.name)))}),i&&(0,Id.jsx)("div",{className:"block-editor-block-variation-picker__skip",children:(0,Id.jsx)(Jy.Ay,{variant:"link",onClick:()=>o(),children:(0,U.__)("Skip")})})]})},Uz=(0,Vp.f)((e=>t=>{const[n,r]=hy("color.palette","color.custom"),{colors:o=n,disableCustomColors:i=!r}=t,s=o&&o.length>0||!i;return(0,Id.jsx)(e,{...t,colors:o,disableCustomColors:i,hasColorsToChoose:s})}),"withColorContext")(HB);var Vz=n(48768);const Hz=100,$z=300,Wz={placement:"bottom-start"},Gz=(0,k.createContext)({}),qz=()=>(0,k.useContext)(Gz);function Kz({id:e,url:t,naturalWidth:n,naturalHeight:r,onFinishEditing:o,onSaveImage:i,children:s}){const a=function({url:e,naturalWidth:t,naturalHeight:n}){const[r,o]=(0,k.useState)(),[i,s]=(0,k.useState)(),[a,l]=(0,k.useState)({x:0,y:0}),[c,u]=(0,k.useState)(100),[d,h]=(0,k.useState)(0),p=t/n,[f,m]=(0,k.useState)(p),g=(0,k.useCallback)((()=>{const t=(d+90)%360;let n=p;if(d%180==90&&(n=1/p),0===t)return o(),h(t),m(p),void l((e=>({x:-e.y*n,y:e.x*n})));const r=new window.Image;r.src=e,r.onload=function(e){const r=document.createElement("canvas");let i=0,s=0;t%180?(r.width=e.target.height,r.height=e.target.width):(r.width=e.target.width,r.height=e.target.height),90!==t&&180!==t||(i=r.width),270!==t&&180!==t||(s=r.height);const a=r.getContext("2d");a.translate(i,s),a.rotate(t*Math.PI/180),a.drawImage(e.target,0,0),r.toBlob((e=>{o(URL.createObjectURL(e)),h(t),m(r.width/r.height),l((e=>({x:-e.y*n,y:e.x*n})))}))};const i=(0,Iu.applyFilters)("media.crossOrigin",void 0,e);"string"==typeof i&&(r.crossOrigin=i)}),[d,p,e]);return(0,k.useMemo)((()=>({editedUrl:r,setEditedUrl:o,crop:i,setCrop:s,position:a,setPosition:l,zoom:c,setZoom:u,rotation:d,setRotation:h,rotateClockwise:g,aspect:f,setAspect:m,defaultAspect:p})),[r,i,a,c,d,g,f,p])}({url:t,naturalWidth:n,naturalHeight:r}),l=function({crop:e,rotation:t,url:n,id:r,onSaveImage:o,onFinishEditing:i}){const{createErrorNotice:s}=(0,zl.A)(Yb.store),[a,l]=(0,k.useState)(!1),c=(0,k.useCallback)((()=>{l(!1),i()}),[i]),u=(0,k.useCallback)((()=>{l(!0);const a=[];t>0&&a.push({type:"rotate",args:{angle:t}}),(e.width<99.9||e.height<99.9)&&a.push({type:"crop",args:{left:e.x,top:e.y,width:e.width,height:e.height}}),(0,S.default)({path:`/wp/v2/media/${r}/edit`,method:"POST",data:{src:n,modifiers:a}}).then((e=>{o({id:e.id,url:e.source_url})})).catch((e=>{s((0,U.sprintf)((0,U.__)("Could not edit image. %s"),(0,ic.A)(e.message)),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{l(!1),i()}))}),[e,t,r,n,o,s,i]);return(0,k.useMemo)((()=>({isInProgress:a,apply:u,cancel:c})),[a,u,c])}({id:e,url:t,onSaveImage:i,onFinishEditing:o,...a}),c=(0,k.useMemo)((()=>({...a,...l})),[a,l]);return(0,Id.jsx)(Gz.Provider,{value:c,children:s})}function Yz({aspectRatios:e,isDisabled:t,label:n,onClick:r,value:o}){return(0,Id.jsx)(__.A,{label:n,children:e.map((({name:e,slug:n,ratio:i})=>(0,Id.jsx)(x_.A,{disabled:t,onClick:()=>{r(i)},role:"menuitemradio",isSelected:i===o,icon:i===o?JS.A:void 0,children:e},n)))})}function Jz(e){const[t,n,...r]=e.split("/").map(Number);return t<=0||n<=0||Number.isNaN(t)||Number.isNaN(n)||r.length?NaN:n?t/n:t}function Xz({ratio:e,...t}){return{ratio:Jz(e),...t}}function Zz({toggleProps:e}){const{isInProgress:t,aspect:n,setAspect:r,defaultAspect:o}=qz(),[i,s,a]=hy("dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios");return(0,Id.jsx)(r_.A,{icon:Vz.A,label:(0,U.__)("Aspect Ratio"),popoverProps:Wz,toggleProps:e,className:"wp-block-image__aspect-ratio",children:({onClose:e})=>(0,Id.jsxs)(Id.Fragment,{children:[(0,Id.jsx)(Yz,{isDisabled:t,onClick:t=>{r(t),e()},value:n,aspectRatios:[{slug:"original",name:(0,U.__)("Original"),aspect:o},...a?i.map(Xz).filter((({ratio:e})=>1===e)):[]]}),s?.length>0&&(0,Id.jsx)(Yz,{label:(0,U.__)("Theme"),isDisabled:t,onClick:t=>{r(t),e()},value:n,aspectRatios:s}),a&&(0,Id.jsx)(Yz,{label:(0,U.__)("Landscape"),isDisabled:t,onClick:t=>{r(t),e()},value:n,aspectRatios:i.map(Xz).filter((({ratio:e})=>e>1))}),a&&(0,Id.jsx)(Yz,{label:(0,U.__)("Portrait"),isDisabled:t,onClick:t=>{r(t),e()},value:n,aspectRatios:i.map(Xz).filter((({ratio:e})=>e<1))})]})})}var Qz=n(7728),eU=n(75187),tU=n.n(eU);function nU(e,t,n,r,o){void 0===o&&(o=0);var i=cU(t.width,t.height,o),s=i.width,a=i.height;return{x:rU(e.x,s,n.width,r),y:rU(e.y,a,n.height,r)}}function rU(e,t,n,r){var o=t*r/2-n/2;return uU(e,-o,o)}function oU(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function iU(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function sU(e,t){return Math.min(e,Math.max(0,t))}function aU(e,t){return t}function lU(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function cU(e,t,n){var r=n*Math.PI/180;return{width:Math.abs(Math.cos(r)*e)+Math.abs(Math.sin(r)*t),height:Math.abs(Math.sin(r)*e)+Math.abs(Math.cos(r)*t)}}function uU(e,t,n){return Math.min(Math.max(e,t),n)}function dU(){for(var e=[],t=0;t0})).join(" ").trim()}var hU=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=k.createRef(),n.videoRef=k.createRef(),n.containerPosition={x:0,y:0},n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc="undefined"!=typeof document?document:null,n.currentWindow="undefined"!=typeof window?window:null,n.resizeObserver=null,n.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},n.initResizeObserver=function(){if(void 0!==window.ResizeObserver&&n.containerRef){var e=!0;n.resizeObserver=new window.ResizeObserver((function(t){e?e=!1:n.computeSizes()})),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd),n.currentDoc.removeEventListener("scroll",n.onScroll))},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var e=n.computeSizes();e&&(n.emitCropData(),n.setInitialCrop(e)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(e){if(n.props.initialCroppedAreaPercentages){var t=function(e,t,n,r,o,i){var s=cU(t.width,t.height,n),a=uU(r.width/s.width*(100/e.width),o,i);return{crop:{x:a*s.width/2-r.width/2-s.width*a*(e.x/100),y:a*s.height/2-r.height/2-s.height*a*(e.y/100)},zoom:a}}(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom),r=t.crop,o=t.zoom;n.props.onCropChange(r),n.props.onZoomChange&&n.props.onZoomChange(o)}else if(n.props.initialCroppedAreaPixels){var i=function(e,t,n,r,o,i){void 0===n&&(n=0);var s=cU(t.naturalWidth,t.naturalHeight,n),a=uU(function(e,t,n){var r=function(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}(t);return n.height>n.width?n.height/(e.height*r):n.width/(e.width*r)}(e,t,r),o,i),l=r.height>r.width?r.height/e.height:r.width/e.width;return{crop:{x:((s.width-e.width)/2-e.x)*l,y:((s.height-e.height)/2-e.y)*l},zoom:a}}(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom);r=i.crop,o=i.zoom,n.props.onCropChange(r),n.props.onZoomChange&&n.props.onZoomChange(o)}},n.computeSizes=function(){var e,t,r,o,i,s,a=n.imageRef.current||n.videoRef.current;if(a&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect(),n.saveContainerPosition();var l=n.containerRect.width/n.containerRect.height,c=(null===(e=n.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef.current)||void 0===t?void 0:t.videoWidth)||0,u=(null===(r=n.imageRef.current)||void 0===r?void 0:r.naturalHeight)||(null===(o=n.videoRef.current)||void 0===o?void 0:o.videoHeight)||0,d=c/u,h=void 0;if(a.offsetWidthd?{width:n.containerRect.height*d,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/d};break;case"horizontal-cover":h={width:n.containerRect.width,height:n.containerRect.width/d};break;case"vertical-cover":h={width:n.containerRect.height*d,height:n.containerRect.height}}else h={width:a.offsetWidth,height:a.offsetHeight};n.mediaSize=(0,Qz.Cl)((0,Qz.Cl)({},h),{naturalWidth:c,naturalHeight:u}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var p=n.props.cropSize?n.props.cropSize:function(e,t,n,r,o,i){void 0===i&&(i=0);var s=cU(e,t,i),a=s.width,l=s.height,c=Math.min(a,n),u=Math.min(l,r);return c>u*o?{width:u*o,height:u}:{width:c,height:c/o}}(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(null===(i=n.state.cropSize)||void 0===i?void 0:i.height)===p.height&&(null===(s=n.state.cropSize)||void 0===s?void 0:s.width)===p.width||n.props.onCropSizeChange&&n.props.onCropSizeChange(p),n.setState({cropSize:p},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(p),p}},n.saveContainerPosition=function(){if(n.containerRef){var e=n.containerRef.getBoundingClientRect();n.containerPosition={x:e.left,y:e.top}}},n.onMouseDown=function(e){n.currentDoc&&(e.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.saveContainerPosition(),n.onDragStart(t.getMousePoint(e)))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onScroll=function(e){n.currentDoc&&(e.preventDefault(),n.saveContainerPosition())},n.onTouchStart=function(e){n.currentDoc&&(n.isTouching=!0,n.props.onTouchRequest&&!n.props.onTouchRequest(e)||(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),n.saveContainerPosition(),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onGestureStart=function(e){n.currentDoc&&(e.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureMove),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureMove=function(e){if(e.preventDefault(),!n.isTouching){var r=t.getMousePoint(e),o=n.gestureZoomStart-1+e.scale;if(n.setNewZoom(o,r,{shouldUpdatePosition:!0}),n.props.onRotationChange){var i=n.gestureRotationStart+e.rotation;n.props.onRotationChange(i)}}},n.onGestureEnd=function(e){n.cleanEvents()},n.onDragStart=function(e){var t,r,o=e.x,i=e.y;n.dragStartPosition={x:o,y:i},n.dragStartCrop=(0,Qz.Cl)({},n.props.crop),null===(r=(t=n.props).onInteractionStart)||void 0===r||r.call(t)},n.onDrag=function(e){var t=e.x,r=e.y;n.currentWindow&&(n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==r){var e=t-n.dragStartPosition.x,o=r-n.dragStartPosition.y,i={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+o},s=n.props.restrictPosition?nU(i,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):i;n.props.onCropChange(s)}})))},n.onDragStopped=function(){var e,t;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){if(n.currentWindow&&(!n.props.onWheelRequest||n.props.onWheelRequest(e))){e.preventDefault();var r=t.getMousePoint(e),o=tU()(e).pixelY,i=n.props.zoom-o*n.props.zoomSpeed/200;n.setNewZoom(i,r,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)}},n.getPointOnContainer=function(e,t){var r=e.x,o=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(r-t.x),y:n.containerRect.height/2-(o-t.y)}},n.getPointOnMedia=function(e){var t=e.x,r=e.y,o=n.props,i=o.crop,s=o.zoom;return{x:(t+i.x)/s,y:(r+i.y)/s}},n.setNewZoom=function(e,t,r){var o=(void 0===r?{}:r).shouldUpdatePosition,i=void 0===o||o;if(n.state.cropSize&&n.props.onZoomChange){var s=uU(e,n.props.minZoom,n.props.maxZoom);if(i){var a=n.getPointOnContainer(t,n.containerPosition),l=n.getPointOnMedia(a),c={x:l.x*s-a.x,y:l.y*s-a.y},u=n.props.restrictPosition?nU(c,n.mediaSize,n.state.cropSize,s,n.props.rotation):c;n.props.onCropChange(u)}n.props.onZoomChange(s)}},n.getCropData=function(){return n.state.cropSize?function(e,t,n,r,o,i,s){void 0===i&&(i=0),void 0===s&&(s=!0);var a=s?sU:aU,l=cU(t.width,t.height,i),c=cU(t.naturalWidth,t.naturalHeight,i),u={x:a(100,((l.width-n.width/o)/2-e.x/o)/l.width*100),y:a(100,((l.height-n.height/o)/2-e.y/o)/l.height*100),width:a(100,n.width/l.width*100/o),height:a(100,n.height/l.height*100/o)},d=Math.round(a(c.width,u.width*c.width/100)),h=Math.round(a(c.height,u.height*c.height/100)),p=c.width>=c.height*r?{width:Math.round(h*r),height:h}:{width:d,height:Math.round(d/r)};return{croppedAreaPercentages:u,croppedAreaPixels:(0,Qz.Cl)((0,Qz.Cl)({},p),{x:Math.round(a(c.width-p.width,u.x*c.width/100)),y:Math.round(a(c.height-p.height,u.y*c.height/100))})}}(n.props.restrictPosition?nU(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition):null},n.emitCropData=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,r=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,r),n.props.onCropAreaChange&&n.props.onCropAreaChange(t,r)}},n.emitCropAreaChange=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,r=e.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(t,r)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?nU(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(e),n.emitCropData()}},n}return(0,Qz.C6)(t,e),t.prototype.componentDidMount=function(){this.currentDoc&&this.currentWindow&&(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),void 0===window.ResizeObserver&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef))},t.prototype.componentWillUnmount=function(){var e,t;this.currentDoc&&this.currentWindow&&(void 0===window.ResizeObserver&&this.currentWindow.removeEventListener("resize",this.computeSizes),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&(null===(t=this.styleRef.parentNode)||void 0===t||t.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(e){var t,n,r,o,i,s,a,l,c;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect||e.objectFit!==this.props.objectFit?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():(null===(t=e.cropSize)||void 0===t?void 0:t.height)!==(null===(n=this.props.cropSize)||void 0===n?void 0:n.height)||(null===(r=e.cropSize)||void 0===r?void 0:r.width)!==(null===(o=this.props.cropSize)||void 0===o?void 0:o.width)?this.computeSizes():(null===(i=e.crop)||void 0===i?void 0:i.x)===(null===(s=this.props.crop)||void 0===s?void 0:s.x)&&(null===(a=e.crop)||void 0===a?void 0:a.y)===(null===(l=this.props.crop)||void 0===l?void 0:l.y)||this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&(null===(c=this.videoRef.current)||void 0===c||c.load());var u=this.getObjectFit();u!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:u},this.computeSizes)},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.getObjectFit=function(){var e,t,n,r;if("cover"===this.props.objectFit){if((this.imageRef.current||this.videoRef.current)&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var o=this.containerRect.width/this.containerRect.height;return((null===(e=this.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=this.videoRef.current)||void 0===t?void 0:t.videoWidth)||0)/((null===(n=this.imageRef.current)||void 0===n?void 0:n.naturalHeight)||(null===(r=this.videoRef.current)||void 0===r?void 0:r.videoHeight)||0){d(e)},onCropComplete:e=>{h(e)},onZoomChange:e=>{p(100*e)}}),s&&(0,Id.jsx)(WE.Ay,{})]});return(0,Id.jsxs)(Id.Fragment,{children:[m,v]})}var fU=n(86662);function mU(){const{isInProgress:e,zoom:t,setZoom:n}=qz();return(0,Id.jsx)(DE.A,{contentClassName:"wp-block-image__zoom",popoverProps:Wz,renderToggle:({isOpen:t,onToggle:n})=>(0,Id.jsx)(t_,{icon:fU.A,label:(0,U.__)("Zoom"),onClick:n,"aria-expanded":t,disabled:e}),renderContent:()=>(0,Id.jsx)(OC,{__nextHasNoMarginBottom:!0,label:(0,U.__)("Zoom"),min:Hz,max:$z,value:Math.round(t),onChange:n})})}var gU=n(65754);function bU(){const{isInProgress:e,rotateClockwise:t}=qz();return(0,Id.jsx)(t_,{icon:gU.A,label:(0,U.__)("Rotate"),onClick:t,disabled:e})}function vU(){const{isInProgress:e,apply:t,cancel:n}=qz();return(0,Id.jsxs)(Id.Fragment,{children:[(0,Id.jsx)(t_,{onClick:t,disabled:e,children:(0,U.__)("Apply")}),(0,Id.jsx)(t_,{onClick:n,children:(0,U.__)("Cancel")})]})}function yU({id:e,url:t,width:n,height:r,naturalHeight:o,naturalWidth:i,onSaveImage:s,onFinishEditing:a,borderProps:l}){return(0,Id.jsxs)(Kz,{id:e,url:t,naturalWidth:i,naturalHeight:o,onSaveImage:s,onFinishEditing:a,children:[(0,Id.jsx)(pU,{borderProps:l,url:t,width:n,height:r,naturalHeight:o,naturalWidth:i}),(0,Id.jsxs)(v_,{children:[(0,Id.jsxs)(i_,{children:[(0,Id.jsx)(mU,{}),(0,Id.jsx)(Xy.A,{children:e=>(0,Id.jsx)(Zz,{toggleProps:e})}),(0,Id.jsx)(bU,{})]}),(0,Id.jsx)(i_,{children:(0,Id.jsx)(vU,{})})]})]})}var _U=n(69892),xU=n(39116),wU=n(54629),kU=n(62145);const CU=function(e){const{children:t}=e;return(0,Id.jsxs)("div",{className:"components-tip",children:[(0,Id.jsx)(sk.A,{icon:kU.A}),(0,Id.jsx)("p",{children:t})]})},SU=[(0,lI.A)((0,U.__)("While writing, you can press / to quickly insert new blocks."),{kbd:(0,Id.jsx)("kbd",{})}),(0,lI.A)((0,U.__)("Indent a list by pressing space at the beginning of a line."),{kbd:(0,Id.jsx)("kbd",{})}),(0,lI.A)((0,U.__)("Outdent a list by pressing backspace at the beginning of a line."),{kbd:(0,Id.jsx)("kbd",{})}),(0,U.__)("Drag files into the editor to automatically insert media blocks."),(0,U.__)("Change a block's type by pressing the block icon on the toolbar.")],AU=function(){const[e]=(0,k.useState)(Math.floor(Math.random()*SU.length));return(0,Id.jsx)(CU,{children:SU[e]})};var EU=n(59820),IU=n(30221);const jU=function({title:e,icon:t,description:n,blockType:r,className:o}){r&&((0,W.default)("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:e,icon:t,description:n}=r));const{parentNavBlockClientId:i}=(0,Fl.A)((e=>{const{getSelectedBlockClientId:t,getBlockParentsByBlockName:n}=e(uy);return{parentNavBlockClientId:n(t(),"core/navigation",!0)[0]}}),[]),{selectBlock:s}=(0,zl.A)(uy);return(0,Id.jsxs)("div",{className:(0,Vy.A)("block-editor-block-card",o),children:[i&&(0,Id.jsx)(Jy.Ay,{onClick:()=>s(i),label:(0,U.__)("Go to parent Navigation block"),style:{minWidth:24,padding:0},icon:(0,U.isRTL)()?EU.A:IU.A,size:"small"}),(0,Id.jsx)(dz,{icon:t,showColors:!0}),(0,Id.jsxs)(nE.A,{spacing:1,children:[(0,Id.jsx)("h2",{className:"block-editor-block-card__title",children:e}),n&&(0,Id.jsx)(BT.A,{className:"block-editor-block-card__description",children:n})]})]})};var TU=n(76949),BU=n(47225);const RU=(0,Vp.f)((e=>({useSubRegistry:t=!0,...n})=>{const r=(0,Up.A)(),[o]=(0,k.useState)((()=>new WeakMap)),i=function(e,t,n){if(!n)return t;let r=e.get(t);return r||(r=(0,TU.I)({},t),r.registerStore(kf,cy),e.set(t,r)),r}(o,r,t);return i===r?(0,Id.jsx)(e,{registry:r,...n}):(0,Id.jsx)(BU.Ay,{value:i,children:(0,Id.jsx)(e,{registry:i,...n})})}),"withRegistryProvider"),NU=()=>{};function DU({clientId:e=null,value:t,selection:n,onChange:r=NU,onInput:o=NU}){const i=(0,Up.A)(),{resetBlocks:s,resetSelection:a,replaceInnerBlocks:l,setHasControlledInnerBlocks:c,__unstableMarkNextChangeAsNotPersistent:u}=i.dispatch(uy),{getBlockName:d,getBlocks:h,getSelectionStart:p,getSelectionEnd:f}=i.select(uy),m=(0,Fl.A)((t=>!e||t(uy).areInnerBlocksControlled(e)),[e]),g=(0,k.useRef)({incoming:null,outgoing:[]}),b=(0,k.useRef)(!1),v=()=>{t&&(u(),e?i.batch((()=>{c(e,!0);const n=t.map((e=>nd(e)));b.current&&(g.current.incoming=n),u(),l(e,n)})):(b.current&&(g.current.incoming=t),s(t)))},y=(0,k.useRef)(o),_=(0,k.useRef)(r);(0,k.useEffect)((()=>{y.current=o,_.current=r}),[o,r]),(0,k.useEffect)((()=>{g.current.outgoing.includes(t)?g.current.outgoing[g.current.outgoing.length-1]===t&&(g.current.outgoing=[]):h(e)!==t&&(g.current.outgoing=[],v(),n&&a(n.selectionStart,n.selectionEnd,n.initialPosition))}),[t,e]);const x=(0,k.useRef)(!1);(0,k.useEffect)((()=>{x.current?m||(g.current.outgoing=[],v()):x.current=!0}),[m]),(0,k.useEffect)((()=>{const{getSelectedBlocksInitialCaretPosition:t,isLastBlockChangePersistent:n,__unstableIsLastBlockChangeIgnored:r,areInnerBlocksControlled:o}=i.select(uy);let s=h(e),a=n(),l=!1;b.current=!0;const c=i.subscribe((()=>{if(null!==e&&null===d(e))return;if(e&&!o(e))return;const i=n(),c=h(e),u=c!==s;if(s=c,u&&(g.current.incoming||r()))return g.current.incoming=null,void(a=i);if(u||l&&!u&&i&&!a){a=i,g.current.outgoing.push(s);const e=a?_.current:y.current,n=Ib.has(s);n&&Ib.delete(s),e(s,{selection:{selectionStart:p(),selectionEnd:f(),initialPosition:t()},undoIgnore:n})}l=u}),uy);return()=>{b.current=!1,c()}}),[i,e]),(0,k.useEffect)((()=>()=>{u(),e?(c(e,!1),u(),l(e,[])):s([])}),[])}var MU=n(99671);function PU(){return null}PU.Register=function(){const{registerShortcut:e}=(0,zl.A)(MU.M_);return(0,k.useEffect)((()=>{e({name:"core/block-editor/duplicate",category:"block",description:(0,U.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,U.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,U.__)("Insert a new block before the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"t"}}),e({name:"core/block-editor/insert-after",category:"block",description:(0,U.__)("Insert a new block after the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"y"}}),e({name:"core/block-editor/delete-multi-selection",category:"block",description:(0,U.__)("Delete selection."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:(0,U.__)("Select all text when typing. Press again to select all blocks."),keyCombination:{modifier:"primary",character:"a"}}),e({name:"core/block-editor/unselect",category:"selection",description:(0,U.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/multi-text-selection",category:"selection",description:(0,U.__)("Select text across multiple blocks."),keyCombination:{modifier:"shift",character:"arrow"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,U.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,U.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,U.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}}),e({name:"core/block-editor/collapse-list-view",category:"list-view",description:(0,U.__)("Collapse all other items."),keyCombination:{modifier:"alt",character:"l"}}),e({name:"core/block-editor/group",category:"block",description:(0,U.__)("Create a group block from the selected multiple blocks."),keyCombination:{modifier:"primary",character:"g"}})}),[e]),null};const OU=PU,LU=RU((e=>{const{children:t,settings:n,stripExperimentalSettings:r=!1}=e,{__experimentalUpdateSettings:o}=wf((0,zl.A)(uy));return(0,k.useEffect)((()=>{o({...n,__internalIsInitialized:!0},{stripExperimentalSettings:r,reset:!0})}),[n,r,o]),DU(e),(0,Id.jsxs)(Ul.Kq,{passthrough:!0,children:[!n?.__unstableIsPreviewMode&&(0,Id.jsx)(OU.Register,{}),(0,Id.jsx)(VC,{children:t})]})})),FU=e=>(0,Id.jsx)(LU,{...e,stripExperimentalSettings:!0,children:e.children}),zU={name:"u2jump",styles:"position:relative;pointer-events:none;&::after{content:'';position:absolute;top:0;right:0;bottom:0;left:0;}*{pointer-events:none;}"},UU=(0,k.createContext)(!1),{Consumer:VU,Provider:HU}=UU;function $U({className:e,children:t,isDisabled:n=!0,...r}){const o=(0,U_.l)();return(0,Id.jsx)(HU,{value:n,children:(0,Id.jsx)("div",{inert:n?"true":void 0,className:n?o(zU,e,"components-disabled"):void 0,...r,children:t})})}$U.Context=UU,$U.Consumer=VU;const WU=$U;var GU=n(25720),qU=n(18193),KU=n(73247);const YU=(0,k.createContext)({});function JU({value:e,children:t}){const n=(0,k.useContext)(YU),r=(0,k.useMemo)((()=>({...n,...e})),[n,e]);return(0,Id.jsx)(YU.Provider,{value:r,children:t})}const XU=YU,ZU={},QU=LE("editor.BlockEdit")((e=>{const{name:t}=e,n=kc(t);if(!n)return null;const r=n.edit||n.save;return(0,Id.jsx)(r,{...e})})),eV=e=>{const{attributes:t={},name:n}=e,r=kc(n),o=(0,k.useContext)(XU),i=(0,k.useMemo)((()=>r&&r.usesContext?Object.fromEntries(Object.entries(o).filter((([e])=>r.usesContext.includes(e)))):ZU),[r,o]);if(!r)return null;if(r.apiVersion>1)return(0,Id.jsx)(QU,{...e,context:i});const s=Ac(r,"className",!0)?jd(n):null,a=(0,Vy.A)(s,t.className,e.className);return(0,Id.jsx)(QU,{...e,context:i,className:a})},tV=function({className:e,actions:t,children:n,secondaryActions:r}){return(0,Id.jsx)("div",{style:{display:"contents",all:"initial"},children:(0,Id.jsx)("div",{className:(0,Vy.A)(e,"block-editor-warning"),children:(0,Id.jsxs)("div",{className:"block-editor-warning__contents",children:[(0,Id.jsx)("p",{className:"block-editor-warning__message",children:n}),(k.Children.count(t)>0||r)&&(0,Id.jsxs)("div",{className:"block-editor-warning__actions",children:[k.Children.count(t)>0&&k.Children.map(t,((e,t)=>(0,Id.jsx)("span",{className:"block-editor-warning__action",children:e},t))),r&&(0,Id.jsx)(r_.A,{className:"block-editor-warning__secondary",icon:ZS.A,label:(0,U.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0,children:()=>(0,Id.jsx)(__.A,{children:r.map(((e,t)=>(0,Id.jsx)(x_.A,{onClick:e.onClick,children:e.title},t)))})})]})]})})})};function nV({originalBlockClientId:e,name:t,onReplace:n}){const{selectBlock:r}=(0,zl.A)(uy),o=kc(t);return(0,Id.jsxs)(tV,{actions:[(0,Id.jsx)(Jy.Ay,{variant:"secondary",onClick:()=>r(e),children:(0,U.__)("Find original")},"find-original"),(0,Id.jsx)(Jy.Ay,{variant:"secondary",onClick:()=>n([]),children:(0,U.__)("Remove")},"remove")],children:[(0,Id.jsxs)("strong",{children:[o?.title,": "]}),(0,U.__)("This block can only be used once.")]})}const rV=(0,k.createContext)({});function oV({mayDisplayControls:e,mayDisplayParentControls:t,blockEditingMode:n,isPreviewMode:r,...o}){const{name:i,isSelected:s,clientId:a,attributes:l={},__unstableLayoutClassNames:c}=o,{layout:u=null,metadata:d={}}=l,{bindings:h}=d,p=Ac(i,"layout",!1)||Ac(i,"__experimentalLayout",!1),{originalBlockClientId:f}=(0,k.useContext)(rV);return(0,Id.jsxs)(Jp,{value:(0,k.useMemo)((()=>({name:i,isSelected:s,clientId:a,layout:p?u:null,__unstableLayoutClassNames:c,[Hp]:e,[$p]:t,[Wp]:n,[Gp]:h,[qp]:r})),[i,s,a,p,u,c,e,t,n,h,r]),children:[(0,Id.jsx)(eV,{...o}),f&&(0,Id.jsx)(nV,{originalBlockClientId:f,name:i,onReplace:o.onReplace})]})}var iV=n(56900);function sV({title:e,rawContent:t,renderedContent:n,action:r,actionText:o,className:i}){return(0,Id.jsxs)("div",{className:i,children:[(0,Id.jsxs)("div",{className:"block-editor-block-compare__content",children:[(0,Id.jsx)("h2",{className:"block-editor-block-compare__heading",children:e}),(0,Id.jsx)("div",{className:"block-editor-block-compare__html",children:t}),(0,Id.jsx)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor",children:(0,Id.jsx)(Cd.A,{children:(0,KU.A)(n)})})]}),(0,Id.jsx)("div",{className:"block-editor-block-compare__action",children:(0,Id.jsx)(Jy.Ay,{variant:"secondary",tabIndex:"0",onClick:r,children:o})})]})}const aV=function({block:e,onKeep:t,onConvert:n,convertor:r,convertButtonText:o}){const i=function(e){const t=(Array.isArray(e)?e:[e]).map((e=>Md(e.name,e.attributes,e.innerBlocks)));return t.join("")}(r(e)),s=(a=e.originalContent,l=i,(0,iV.JJ)(a,l).map(((e,t)=>{const n=(0,Vy.A)({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,Id.jsx)("span",{className:n,children:e.value},t)})));var a,l;return(0,Id.jsxs)("div",{className:"block-editor-block-compare__wrapper",children:[(0,Id.jsx)(sV,{title:(0,U.__)("Current"),className:"block-editor-block-compare__current",action:t,actionText:(0,U.__)("Convert to HTML"),rawContent:e.originalContent,renderedContent:e.originalContent}),(0,Id.jsx)(sV,{title:(0,U.__)("After Conversion"),className:"block-editor-block-compare__converted",action:n,actionText:o,rawContent:s,renderedContent:i})]})},lV=e=>up({HTML:e.originalContent});function cV({clientId:e}){const{block:t,canInsertHTMLBlock:n,canInsertClassicBlock:r}=(0,Fl.A)((t=>{const{canInsertBlockType:n,getBlock:r,getBlockRootClientId:o}=t(uy),i=o(e);return{block:r(e),canInsertHTMLBlock:n("core/html",i),canInsertClassicBlock:n("core/freeform",i)}}),[e]),{replaceBlock:o}=(0,zl.A)(uy),[i,s]=(0,k.useState)(!1),a=(0,k.useCallback)((()=>s(!1)),[]),l=(0,k.useMemo)((()=>({toClassic(){const e=Qu("core/freeform",{content:t.originalContent});return o(t.clientId,e)},toHTML(){const e=Qu("core/html",{content:t.originalContent});return o(t.clientId,e)},toBlocks(){const e=lV(t);return o(t.clientId,e)},toRecoveredBlock(){const e=Qu(t.name,t.attributes,t.innerBlocks);return o(t.clientId,e)}})),[t,o]),c=(0,k.useMemo)((()=>[{title:(0,U._x)("Resolve","imperative verb"),onClick:()=>s(!0)},n&&{title:(0,U.__)("Convert to HTML"),onClick:l.toHTML},r&&{title:(0,U.__)("Convert to Classic Block"),onClick:l.toClassic}].filter(Boolean)),[n,r,l]);return(0,Id.jsxs)(Id.Fragment,{children:[(0,Id.jsx)(tV,{actions:[(0,Id.jsx)(Jy.Ay,{onClick:l.toRecoveredBlock,variant:"primary",children:(0,U.__)("Attempt Block Recovery")},"recover")],secondaryActions:c,children:(0,U.__)("This block contains unexpected or invalid content.")}),i&&(0,Id.jsx)(qF.A,{title:(0,U.__)("Resolve Block"),onRequestClose:a,className:"block-editor-block-compare",children:(0,Id.jsx)(aV,{block:t,onKeep:l.toHTML,onConvert:l.toBlocks,convertor:lV,convertButtonText:(0,U.__)("Convert to Blocks")})})]})}const uV=(0,Id.jsx)(tV,{className:"block-editor-block-list__block-crash-warning",children:(0,U.__)("This block has encountered an error and cannot be previewed.")}),dV=()=>uV;class hV extends k.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}}const pV=hV;var fV=n(28716);const mV=function({clientId:e}){const[t,n]=(0,k.useState)(""),r=(0,Fl.A)((t=>t(uy).getBlock(e)),[e]),{updateBlock:o}=(0,zl.A)(uy);return(0,k.useEffect)((()=>{n(Pd(r))}),[r]),(0,Id.jsx)(fV.A,{className:"block-editor-block-list__block-html-textarea",value:t,onBlur:()=>{const i=kc(r.name);if(!i)return;const s=Ih(i,t,r.attributes),a=t||Md(i,s),[l]=t?ph({...r,attributes:s,originalContent:a}):[!0];o(e,{attributes:s,originalContent:a,isValid:l}),t||n(a)},onChange:e=>n(e.target.value)})};var gV=n(88211),bV=NV(),vV=e=>jV(e,bV),yV=NV();vV.write=e=>jV(e,yV);var _V=NV();vV.onStart=e=>jV(e,_V);var xV=NV();vV.onFrame=e=>jV(e,xV);var wV=NV();vV.onFinish=e=>jV(e,wV);var kV=[];vV.setTimeout=(e,t)=>{let n=vV.now()+t,r=()=>{let e=kV.findIndex((e=>e.cancel==r));~e&&kV.splice(e,1),EV-=~e?1:0},o={time:n,handler:e,cancel:r};return kV.splice(CV(n),0,o),EV+=1,TV(),o};var CV=e=>~(~kV.findIndex((t=>t.time>e))||~kV.length);vV.cancel=e=>{_V.delete(e),xV.delete(e),wV.delete(e),bV.delete(e),yV.delete(e)},vV.sync=e=>{IV=!0,vV.batchedUpdates(e),IV=!1},vV.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function r(...e){t=e,vV.onStart(n)}return r.handler=e,r.cancel=()=>{_V.delete(n),t=null},r};var SV=typeof window<"u"?window.requestAnimationFrame:()=>{};vV.use=e=>SV=e,vV.now=typeof performance<"u"?()=>performance.now():Date.now,vV.batchedUpdates=e=>e(),vV.catch=console.error,vV.frameLoop="always",vV.advance=()=>{"demand"!==vV.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):RV()};var AV=-1,EV=0,IV=!1;function jV(e,t){IV?(t.delete(e),e(0)):(t.add(e),TV())}function TV(){AV<0&&(AV=0,"demand"!==vV.frameLoop&&SV(BV))}function BV(){~AV&&(SV(BV),vV.batchedUpdates(RV))}function RV(){let e=AV;AV=vV.now();let t=CV(AV);t&&(DV(kV.splice(0,t),(e=>e.handler())),EV-=t),EV?(_V.flush(),bV.flush(e?Math.min(64,AV-e):16.667),xV.flush(),yV.flush(),wV.flush()):AV=-1}function NV(){let e=new Set,t=e;return{add(n){EV+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(EV-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,EV-=t.size,DV(t,(t=>t(n)&&e.add(t))),EV+=e.size,t=e)}}}function DV(e,t){e.forEach((e=>{try{t(e)}catch(e){vV.catch(e)}}))}var MV=Object.defineProperty,PV={};function OV(){}((e,t)=>{for(var n in t)MV(e,n,{get:t[n],enumerable:!0})})(PV,{assign:()=>XV,colors:()=>KV,createStringInterpolator:()=>$V,skipAnimation:()=>YV,to:()=>WV,willAdvance:()=>JV});var LV={arr:Array.isArray,obj:e=>!!e&&"Object"===e.constructor.name,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e};function FV(e,t){if(LV.arr(e)){if(!LV.arr(t)||e.length!==t.length)return!1;for(let n=0;ne.forEach(t);function UV(e,t,n){if(LV.arr(e))for(let r=0;rLV.und(e)?[]:LV.arr(e)?e:[e];function HV(e,t){if(e.size){let n=Array.from(e);e.clear(),zV(n,t)}}var $V,WV,GV=(e,...t)=>HV(e,(e=>e(...t))),qV=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),KV=null,YV=!1,JV=OV,XV=e=>{e.to&&(WV=e.to),e.now&&(vV.now=e.now),void 0!==e.colors&&(KV=e.colors),null!=e.skipAnimation&&(YV=e.skipAnimation),e.createStringInterpolator&&($V=e.createStringInterpolator),e.requestAnimationFrame&&vV.use(e.requestAnimationFrame),e.batchedUpdates&&(vV.batchedUpdates=e.batchedUpdates),e.willAdvance&&(JV=e.willAdvance),e.frameLoop&&(vV.frameLoop=e.frameLoop)},ZV=new Set,QV=[],eH=[],tH=0,nH={get idle(){return!ZV.size&&!QV.length},start(e){tH>e.priority?(ZV.add(e),vV.onStart(rH)):(oH(e),vV(sH))},advance:sH,sort(e){if(tH)vV.onFrame((()=>nH.sort(e)));else{let t=QV.indexOf(e);~t&&(QV.splice(t,1),iH(e))}},clear(){QV=[],ZV.clear()}};function rH(){ZV.forEach(oH),ZV.clear(),vV(sH)}function oH(e){QV.includes(e)||iH(e)}function iH(e){QV.splice(function(e,t){let n=e.findIndex(t);return n<0?e.length:n}(QV,(t=>t.priority>e.priority)),0,e)}function sH(e){let t=eH;for(let n=0;n0}var aH="[-+]?\\d*\\.?\\d+",lH=aH+"%";function cH(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var uH=new RegExp("rgb"+cH(aH,aH,aH)),dH=new RegExp("rgba"+cH(aH,aH,aH,aH)),hH=new RegExp("hsl"+cH(aH,lH,lH)),pH=new RegExp("hsla"+cH(aH,lH,lH,aH)),fH=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,mH=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,gH=/^#([0-9a-fA-F]{6})$/,bH=/^#([0-9a-fA-F]{8})$/;function vH(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function yH(e,t,n){let r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,i=vH(o,r,e+1/3),s=vH(o,r,e),a=vH(o,r,e-1/3);return Math.round(255*i)<<24|Math.round(255*s)<<16|Math.round(255*a)<<8}function _H(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function xH(e){return(parseFloat(e)%360+360)%360/360}function wH(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function kH(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function CH(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=gH.exec(e))?parseInt(t[1]+"ff",16)>>>0:KV&&void 0!==KV[e]?KV[e]:(t=uH.exec(e))?(_H(t[1])<<24|_H(t[2])<<16|_H(t[3])<<8|255)>>>0:(t=dH.exec(e))?(_H(t[1])<<24|_H(t[2])<<16|_H(t[3])<<8|wH(t[4]))>>>0:(t=fH.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=bH.exec(e))?parseInt(t[1],16)>>>0:(t=mH.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=hH.exec(e))?(255|yH(xH(t[1]),kH(t[2]),kH(t[3])))>>>0:(t=pH.exec(e))?(yH(xH(t[1]),kH(t[2]),kH(t[3]))|wH(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}var SH=(e,t,n)=>{if(LV.fun(e))return e;if(LV.arr(e))return SH({range:e,output:t,extrapolate:n});if(LV.str(e.output[0]))return $V(e);let r=e,o=r.output,i=r.range||[0,1],s=r.extrapolateLeft||r.extrapolate||"extend",a=r.extrapolateRight||r.extrapolate||"extend",l=r.easing||(e=>e);return e=>{let t=function(e,t){for(var n=1;n=e);++n);return n-1}(e,i);return function(e,t,n,r,o,i,s,a,l){let c=l?l(e):e;if(cn){if("identity"===a)return c;"clamp"===a&&(c=n)}return r===o?r:t===n?e<=t?r:o:(t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t),c=i(c),r===-1/0?c=-c:o===1/0?c+=r:c=c*(o-r)+r,c)}(e,i[t],i[t+1],o[t],o[t+1],l,s,a,r.map)}},AH=1.70158,EH=2.5949095,IH=2.70158,jH=2*Math.PI/3,TH=2*Math.PI/4.5,BH=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,RH={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>0===e?0:Math.pow(2,10*e-10),easeOutExpo:e=>1===e?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>0===e?0:1===e?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>IH*e*e*e-AH*e*e,easeOutBack:e=>1+IH*Math.pow(e-1,3)+AH*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(7.189819*e-EH)/2:(Math.pow(2*e-2,2)*((EH+1)*(2*e-2)+EH)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*jH),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*jH)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*TH)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*TH)/2+1,easeInBounce:e=>1-BH(1-e),easeOutBounce:BH,easeInOutBounce:e=>e<.5?(1-BH(1-2*e))/2:(1+BH(2*e-1))/2,steps:(e,t="end")=>n=>{let r=(n="end"===t?Math.min(n,.999):Math.max(n,.001))*e;return((e,t,n)=>Math.min(Math.max(n,0),1))(0,0,("end"===t?Math.floor(r):Math.ceil(r))/e)}},NH=Symbol.for("FluidValue.get"),DH=Symbol.for("FluidValue.observers"),MH=e=>Boolean(e&&e[NH]),PH=e=>e&&e[NH]?e[NH]():e,OH=e=>e[DH]||null;function LH(e,t){let n=e[DH];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}var FH=class{[NH];[DH];constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");zH(this,e)}},zH=(e,t)=>$H(e,NH,t);function UH(e,t){if(e[NH]){let n=e[DH];n||$H(e,DH,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function VH(e,t){let n=e[DH];if(n&&n.has(t)){let r=n.size-1;r?n.delete(t):e[DH]=null,e.observerRemoved&&e.observerRemoved(r,t)}}var HH,$H=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),WH=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,GH=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,qH=new RegExp(`(${WH.source})(%|[a-z]+)`,"i"),KH=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,YH=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,JH=e=>{let[t,n]=XH(e);if(!t||qV())return e;let r=window.getComputedStyle(document.documentElement).getPropertyValue(t);return r?r.trim():n&&n.startsWith("--")?window.getComputedStyle(document.documentElement).getPropertyValue(n)||e:n&&YH.test(n)?JH(n):n||e},XH=e=>{let t=YH.exec(e);if(!t)return[,];let[,n,r]=t;return[n,r]},ZH=(e,t,n,r,o)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${o})`,QH=e=>{HH||(HH=KV?new RegExp(`(${Object.keys(KV).join("|")})(?!\\w)`,"g"):/^\b$/);let t=e.output.map((e=>PH(e).replace(YH,JH).replace(GH,CH).replace(HH,CH))),n=t.map((e=>e.match(WH).map(Number))),r=n[0].map(((e,t)=>n.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))).map((t=>SH({...e,output:t})));return e=>{let n=!qH.test(t[0])&&t.find((e=>qH.test(e)))?.replace(WH,""),o=0;return t[0].replace(WH,(()=>`${r[o++](e)}${n||""}`)).replace(KH,ZH)}},e$="react-spring: ",t$=e=>{let t=e,n=!1;if("function"!=typeof t)throw new TypeError(`${e$}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},n$=t$(console.warn);function r$(e){return LV.str(e)&&("#"==e[0]||/\d/.test(e)||!qV()&&YH.test(e)||e in(KV||{}))}t$(console.warn),new WeakMap,new Set,new WeakMap,new WeakMap,new WeakMap;var o$=qV()?k.useEffect:k.useLayoutEffect;var i$=[],s$=Symbol.for("Animated:node"),a$=e=>e&&e[s$],l$=(e,t)=>((e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}))(e,s$,t),c$=e=>e&&e[s$]&&e[s$].getPayload(),u$=class{payload;constructor(){l$(this,this)}getPayload(){return this.payload||[]}},d$=class extends u${constructor(e){super(),this._value=e,LV.num(this._value)&&(this.lastPosition=this._value)}done=!0;elapsedTime;lastPosition;lastVelocity;v0;durationProgress=0;static create(e){return new d$(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return LV.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}reset(){let{done:e}=this;this.done=!1,LV.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},h$=class extends d${_string=null;_toString;constructor(e){super(0),this._toString=SH({output:[e,e]})}static create(e){return new h$(e)}getValue(){return this._string??(this._string=this._toString(this._value))}setValue(e){if(LV.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else{if(!super.setValue(e))return!1;this._string=null}return!0}reset(e){e&&(this._toString=SH({output:[this.getValue(),e]})),this._value=0,super.reset()}},p$={dependencies:null},f$=class extends u${constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){let t={};return UV(this.source,((n,r)=>{var o;(o=n)&&o[s$]===o?t[r]=n.getValue(e):MH(n)?t[r]=PH(n):e||(t[r]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&zV(this.payload,(e=>e.reset()))}_makePayload(e){if(e){let t=new Set;return UV(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){p$.dependencies&&MH(e)&&p$.dependencies.add(e);let t=c$(e);t&&zV(t,(e=>this.add(e)))}},m$=class extends f${constructor(e){super(e)}static create(e){return new m$(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){let t=this.getPayload();return e.length==t.length?t.map(((t,n)=>t.setValue(e[n]))).some(Boolean):(super.setValue(e.map(g$)),!0)}};function g$(e){return(r$(e)?h$:d$).create(e)}function b$(e){let t=a$(e);return t?t.constructor:LV.arr(e)?m$:r$(e)?h$:d$}var v$=(e,t)=>{let n=!LV.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,k.forwardRef)(((r,o)=>{let i=(0,k.useRef)(null),s=n&&(0,k.useCallback)((e=>{i.current=function(e,t){return e&&(LV.fun(e)?e(t):e.current=t),t}(o,e)}),[o]),[a,l]=function(e,t){let n=new Set;return p$.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new f$(e),p$.dependencies=null,[e,n]}(r,t),c=function(){let e=(0,k.useState)()[1],t=(()=>{let e=(0,k.useRef)(!1);return o$((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}(),u=()=>{let e=i.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,a.getValue(!0)))&&c()},d=new y$(u,l),h=(0,k.useRef)();o$((()=>(h.current=d,zV(l,(e=>UH(e,d))),()=>{h.current&&(zV(h.current.deps,(e=>VH(e,h.current))),vV.cancel(h.current.update))}))),(0,k.useEffect)(u,[]),(0,k.useEffect)((()=>()=>{let e=h.current;zV(e.deps,(t=>VH(t,e)))}),i$);let p=t.getComponentProps(a.getValue());return k.createElement(e,{...p,ref:s})}))},y$=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&vV.write(this.update)}},_$=Symbol.for("AnimatedComponent"),x$=e=>LV.str(e)?e:e&&LV.str(e.displayName)?e.displayName:LV.fun(e)&&e.name||null;function w$(e,...t){return LV.fun(e)?e(...t):e}var k$=(e,t)=>!0===e||!!(t&&e&&(LV.fun(e)?e(t):VV(e).includes(t))),C$=(e,t)=>LV.obj(e)?t&&e[t]:e,S$=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,A$=e=>e,E$=(e,t=A$)=>{let n=I$;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));let r={};for(let o of n){let n=t(e[o],o);LV.und(n)||(r[o]=n)}return r},I$=["config","onProps","onStart","onChange","onPause","onResume","onRest"],j$={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function T$(e){let t=function(e){let t={},n=0;if(UV(e,((e,r)=>{j$[r]||(t[r]=e,n++)})),n)return t}(e);if(t){let n={to:t};return UV(e,((e,r)=>r in t||(n[r]=e))),n}return{...e}}function B$(e){return e=PH(e),LV.arr(e)?e.map(B$):r$(e)?PV.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function R$(e){return LV.fun(e)||LV.arr(e)&&LV.obj(e[0])}var N$={tension:170,friction:26,mass:1,damping:1,easing:RH.linear,clamp:!1},D$=class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,N$)}};function M$(e,t){if(LV.und(t.decay)){let n=!LV.und(t.tension)||!LV.und(t.friction);(n||!LV.und(t.frequency)||!LV.und(t.damping)||!LV.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}var P$=[],O$=class{changed=!1;values=P$;toValues=null;fromValues=P$;to;from;config=new D$;immediate=!1};function L$(e,{key:t,props:n,defaultProps:r,state:o,actions:i}){return new Promise(((s,a)=>{let l,c,u=k$(n.cancel??r?.cancel,t);if(u)p();else{LV.und(n.pause)||(o.paused=k$(n.pause,t));let e=r?.pause;!0!==e&&(e=o.paused||k$(e,t)),l=w$(n.delay||0,t),e?(o.resumeQueue.add(h),i.pause()):(i.resume(),h())}function d(){o.resumeQueue.add(h),o.timeouts.delete(c),c.cancel(),l=c.time-vV.now()}function h(){l>0&&!PV.skipAnimation?(o.delayed=!0,c=vV.setTimeout(p,l),o.pauseQueue.add(d),o.timeouts.add(c)):p()}function p(){o.delayed&&(o.delayed=!1),o.pauseQueue.delete(d),o.timeouts.delete(c),e<=(o.cancelId||0)&&(u=!0);try{i.start({...n,callId:e,cancel:u},s)}catch(e){a(e)}}}))}var F$=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?V$(e.get()):t.every((e=>e.noop))?z$(e.get()):U$(e.get(),t.every((e=>e.finished))),z$=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),U$=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),V$=e=>({value:e,cancelled:!0,finished:!1});function H$(e,t,n,r){let{callId:o,parentId:i,onRest:s}=t,{asyncTo:a,promise:l}=n;return i||e!==a||t.reset?n.promise=(async()=>{n.asyncId=o,n.asyncTo=e;let c,u,d,h=E$(t,((e,t)=>"onRest"===t?void 0:e)),p=new Promise(((e,t)=>(c=e,u=t))),f=e=>{let t=o<=(n.cancelId||0)&&V$(r)||o!==n.asyncId&&U$(r,!1);if(t)throw e.result=t,u(e),e},m=(e,t)=>{let i=new W$,s=new G$;return(async()=>{if(PV.skipAnimation)throw $$(n),s.result=U$(r,!1),u(s),s;f(i);let a=LV.obj(e)?{...e}:{...t,to:e};a.parentId=o,UV(h,((e,t)=>{LV.und(a[t])&&(a[t]=e)}));let l=await r.start(a);return f(i),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),l})()};if(PV.skipAnimation)return $$(n),U$(r,!1);try{let t;t=LV.arr(e)?(async e=>{for(let t of e)await m(t)})(e):Promise.resolve(e(m,r.stop.bind(r))),await Promise.all([t.then(c),p]),d=U$(r.get(),!0,!1)}catch(e){if(e instanceof W$)d=e.result;else{if(!(e instanceof G$))throw e;d=e.result}}finally{o==n.asyncId&&(n.asyncId=i,n.asyncTo=i?a:void 0,n.promise=i?l:void 0)}return LV.fun(s)&&vV.batchedUpdates((()=>{s(d,r,r.item)})),d})():l}function $$(e,t){HV(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var W$=class extends Error{result;constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},G$=class extends Error{result;constructor(){super("SkipAnimationSignal")}},q$=e=>e instanceof Y$,K$=1,Y$=class extends FH{id=K$++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=a$(this);return e&&e.getValue()}to(...e){return PV.to(this,e)}interpolate(...e){return n$(`${e$}The "interpolate" function is deprecated in v9 (use "to" instead)`),PV.to(this,e)}toJSON(){return this.get()}observerAdded(e){1==e&&this._attach()}observerRemoved(e){0==e&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){LH(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||nH.sort(this),LH(this,{type:"priority",parent:this,priority:e})}},J$=Symbol.for("SpringPhase"),X$=e=>(1&e[J$])>0,Z$=e=>(2&e[J$])>0,Q$=e=>(4&e[J$])>0,eW=(e,t)=>t?e[J$]|=3:e[J$]&=-3,tW=(e,t)=>t?e[J$]|=4:e[J$]&=-5,nW=class extends Y${key;animation=new O$;queue;defaultProps={};_state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_pendingCalls=new Set;_lastCallId=0;_lastToId=0;_memoizedDuration=0;constructor(e,t){if(super(),!LV.und(e)||!LV.und(t)){let n=LV.obj(e)?{...e}:{...t,from:e};LV.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(Z$(this)||this._state.asyncTo)||Q$(this)}get goal(){return PH(this.animation.to)}get velocity(){let e=a$(this);return e instanceof d$?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return X$(this)}get isAnimating(){return Z$(this)}get isPaused(){return Q$(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1,r=this.animation,{config:o,toValues:i}=r,s=c$(r.to);!s&&MH(r.to)&&(i=VV(PH(r.to))),r.values.forEach(((a,l)=>{if(a.done)return;let c=a.constructor==h$?1:s?s[l].lastPosition:i[l],u=r.immediate,d=c;if(!u){if(d=a.lastPosition,o.tension<=0)return void(a.done=!0);let t,n=a.elapsedTime+=e,i=r.fromValues[l],s=null!=a.v0?a.v0:a.v0=LV.arr(o.velocity)?o.velocity[l]:o.velocity,h=o.precision||(i==c?.005:Math.min(1,.001*Math.abs(c-i)));if(LV.und(o.duration))if(o.decay){let e=!0===o.decay?.998:o.decay,r=Math.exp(-(1-e)*n);d=i+s/(1-e)*(1-r),u=Math.abs(a.lastPosition-d)<=h,t=s*r}else{t=null==a.lastVelocity?s:a.lastVelocity;let n,r=o.restVelocity||h/10,l=o.clamp?0:o.bounce,p=!LV.und(l),f=i==c?a.v0>0:ir,n||(u=Math.abs(c-d)<=h,!u));++e)p&&(m=d==c||d>c==f,m&&(t=-t*l,d=c)),t+=(1e-6*-o.tension*(d-c)+.001*-o.friction*t)/o.mass*g,d+=t*g}else{let r=1;o.duration>0&&(this._memoizedDuration!==o.duration&&(this._memoizedDuration=o.duration,a.durationProgress>0&&(a.elapsedTime=o.duration*a.durationProgress,n=a.elapsedTime+=e)),r=(o.progress||0)+n/this._memoizedDuration,r=r>1?1:r<0?0:r,a.durationProgress=r),d=i+o.easing(r)*(c-i),t=(d-a.lastPosition)/e,u=1==r}a.lastVelocity=t,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}s&&!s[l].done&&(u=!1),u?a.done=!0:t=!1,a.setValue(d,o.round)&&(n=!0)}));let a=a$(this),l=a.getValue();if(t){let e=PH(r.to);l===e&&!n||o.decay?n&&o.decay&&this._onChange(l):(a.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(l)}set(e){return vV.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Z$(this)){let{to:e,config:t}=this.animation;vV.batchedUpdates((()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()}))}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return LV.und(e)?(n=this.queue||[],this.queue=[]):n=[LV.obj(e)?e:{...t,to:e}],Promise.all(n.map((e=>this._update(e)))).then((e=>F$(this,e)))}stop(e){let{to:t}=this.animation;return this._focus(this.get()),$$(this._state,e&&this._lastCallId),vV.batchedUpdates((()=>this._stop(t,e))),this}reset(){this._update({reset:!0})}eventObserved(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}_prepareNode(e){let t=this.key||"",{to:n,from:r}=e;n=LV.obj(n)?n[t]:n,(null==n||R$(n))&&(n=void 0),r=LV.obj(r)?r[t]:r,null==r&&(r=void 0);let o={to:n,from:r};return X$(this)||(e.reverse&&([n,r]=[r,n]),r=PH(r),LV.und(r)?a$(this)||this._set(n):this._set(r)),o}_update({...e},t){let{key:n,defaultProps:r}=this;e.default&&Object.assign(r,E$(e,((e,t)=>/^on/.test(t)?C$(e,n):e))),lW(this,e,"onProps"),cW(this,"onProps",e,this);let o=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let i=this._state;return L$(++this._lastCallId,{key:n,props:e,defaultProps:r,state:i,actions:{pause:()=>{Q$(this)||(tW(this,!0),GV(i.pauseQueue),cW(this,"onPause",U$(this,rW(this,this.animation.to)),this))},resume:()=>{Q$(this)&&(tW(this,!1),Z$(this)&&this._resume(),GV(i.resumeQueue),cW(this,"onResume",U$(this,rW(this,this.animation.to)),this))},start:this._merge.bind(this,o)}}).then((n=>{if(e.loop&&n.finished&&(!t||!n.noop)){let t=oW(e);if(t)return this._update(t,!0)}return n}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(V$(this));let r=!LV.und(e.to),o=!LV.und(e.from);if(r||o){if(!(t.callId>this._lastToId))return n(V$(this));this._lastToId=t.callId}let{key:i,defaultProps:s,animation:a}=this,{to:l,from:c}=a,{to:u=l,from:d=c}=e;o&&!r&&(!t.default||LV.und(u))&&(u=d),t.reverse&&([u,d]=[d,u]);let h=!FV(d,c);h&&(a.from=d),d=PH(d);let p=!FV(u,l);p&&this._focus(u);let f=R$(t.to),{config:m}=a,{decay:g,velocity:b}=m;(r||o)&&(m.velocity=0),t.config&&!f&&function(e,t,n){n&&(M$(n={...n},t),t={...n,...t}),M$(e,t),Object.assign(e,t);for(let t in N$)null==e[t]&&(e[t]=N$[t]);let{mass:r,frequency:o,damping:i}=e;LV.und(o)||(o<.01&&(o=.01),i<0&&(i=0),e.tension=Math.pow(2*Math.PI/o,2)*r,e.friction=4*Math.PI*i*r/o)}(m,w$(t.config,i),t.config!==s.config?w$(s.config,i):void 0);let v=a$(this);if(!v||LV.und(u))return n(U$(this,!0));let y=LV.und(t.reset)?o&&!t.default:!LV.und(d)&&k$(t.reset,i),_=y?d:this.get(),x=B$(u),w=LV.num(x)||LV.arr(x)||r$(x),k=!f&&(!w||k$(s.immediate||t.immediate,i));if(p){let e=b$(u);if(e!==v.constructor){if(!k)throw Error(`Cannot animate between ${v.constructor.name} and ${e.name}, as the "to" prop suggests`);v=this._set(x)}}let C=v.constructor,S=MH(u),A=!1;if(!S){let e=y||!X$(this)&&h;(p||e)&&(A=FV(B$(_),x),S=!A),(!FV(a.immediate,k)&&!k||!FV(m.decay,g)||!FV(m.velocity,b))&&(S=!0)}if(A&&Z$(this)&&(a.changed&&!y?S=!0:S||this._stop(l)),!f&&((S||MH(l))&&(a.values=v.getPayload(),a.toValues=MH(u)?null:C==h$?[1]:VV(x)),a.immediate!=k&&(a.immediate=k,!k&&!y&&this._set(l)),S)){let{onRest:e}=a;zV(aW,(e=>lW(this,t,e)));let r=U$(this,rW(this,l));GV(this._pendingCalls,r),this._pendingCalls.add(n),a.changed&&vV.batchedUpdates((()=>{a.changed=!y,e?.(r,this),y?w$(s.onRest,r):a.onStart?.(r,this)}))}y&&this._set(_),f?n(H$(t.to,t,this._state,this)):S?this._start():Z$(this)&&!p?this._pendingCalls.add(n):n(z$(_))}_focus(e){let t=this.animation;e!==t.to&&(OH(this)&&this._detach(),t.to=e,OH(this)&&this._attach())}_attach(){let e=0,{to:t}=this.animation;MH(t)&&(UH(t,this),q$(t)&&(e=t.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;MH(e)&&VH(e,this)}_set(e,t=!0){let n=PH(e);if(!LV.und(n)){let e=a$(this);if(!e||!FV(n,e.getValue())){let r=b$(n);e&&e.constructor==r?e.setValue(n):l$(this,r.create(n)),e&&vV.batchedUpdates((()=>{this._onChange(n,t)}))}}return a$(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,cW(this,"onStart",U$(this,rW(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),w$(this.animation.onChange,e,this)),w$(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){let e=this.animation;a$(this).reset(PH(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),Z$(this)||(eW(this,!0),Q$(this)||this._resume())}_resume(){PV.skipAnimation?this.finish():nH.start(this)}_stop(e,t){if(Z$(this)){eW(this,!1);let n=this.animation;zV(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),LH(this,{type:"idle",parent:this});let r=t?V$(this.get()):U$(this.get(),rW(this,e??n.to));GV(this._pendingCalls,r),n.changed&&(n.changed=!1,cW(this,"onRest",r,this))}}};function rW(e,t){let n=B$(t);return FV(B$(e.get()),n)}function oW(e,t=e.loop,n=e.to){let r=w$(t);if(r){let o=!0!==r&&T$(r),i=(o||e).reverse,s=!o||o.reset;return iW({...e,loop:t,default:!1,pause:void 0,to:!i||R$(n)?n:void 0,from:s?e.from:void 0,reset:s,...o})}}function iW(e){let{to:t,from:n}=e=T$(e),r=new Set;return LV.obj(t)&&sW(t,r),LV.obj(n)&&sW(n,r),e.keys=r.size?Array.from(r):null,e}function sW(e,t){UV(e,((e,n)=>null!=e&&t.add(n)))}var aW=["onStart","onRest","onChange","onPause","onResume"];function lW(e,t,n){e.animation[n]=t[n]!==S$(t,n)?C$(t[n],e.key):void 0}function cW(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var uW=["onStart","onChange","onRest"],dW=1,hW=class{id=dW++;springs={};queue=[];ref;_flush;_initialProps;_lastAsyncId=0;_active=new Set;_changed=new Set;_started=!1;_item;_state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_events={onStart:new Map,onChange:new Map,onRest:new Map};constructor(e,t){this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle&&!e.isDelayed&&!e.isPaused))}get item(){return this._item}set item(e){this._item=e}get(){let e={};return this.each(((t,n)=>e[n]=t.get())),e}set(e){for(let t in e){let n=e[t];LV.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(iW(e)),this}start(e){let{queue:t}=this;return e?t=VV(e).map(iW):this.queue=[],this._flush?this._flush(this,t):(fW(this,t),function(e,t){return Promise.all(t.map((t=>pW(e,t)))).then((t=>F$(e,t)))}(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){let n=this.springs;zV(VV(t),(t=>n[t].stop(!!e)))}else $$(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(LV.und(e))this.start({pause:!0});else{let t=this.springs;zV(VV(e),(e=>t[e].pause()))}return this}resume(e){if(LV.und(e))this.start({pause:!1});else{let t=this.springs;zV(VV(e),(e=>t[e].resume()))}return this}each(e){UV(this.springs,e)}_onFrame(){let{onStart:e,onChange:t,onRest:n}=this._events,r=this._active.size>0,o=this._changed.size>0;(r&&!this._started||o&&!this._started)&&(this._started=!0,HV(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));let i=!r&&this._started,s=o||i&&n.size?this.get():null;o&&t.size&&HV(t,(([e,t])=>{t.value=s,e(t,this,this._item)})),i&&(this._started=!1,HV(n,(([e,t])=>{t.value=s,e(t,this,this._item)})))}eventObserved(e){if("change"==e.type)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else{if("idle"!=e.type)return;this._active.delete(e.parent)}vV.onFrame(this._onFrame)}};async function pW(e,t,n){let{keys:r,to:o,from:i,loop:s,onRest:a,onResolve:l}=t,c=LV.obj(t.default)&&t.default;s&&(t.loop=!1),!1===o&&(t.to=null),!1===i&&(t.from=null);let u=LV.arr(o)||LV.fun(o)?o:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):zV(uW,(n=>{let r=t[n];if(LV.fun(r)){let o=e._events[n];t[n]=({finished:e,cancelled:t})=>{let n=o.get(r);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):o.set(r,{value:null,finished:e||!1,cancelled:t||!1})},c&&(c[n]=t[n])}}));let d=e._state;t.pause===!d.paused?(d.paused=t.pause,GV(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);let h=(r||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),p=!0===t.cancel||!0===S$(t,"cancel");(u||p&&d.asyncId)&&h.push(L$(++e._lastAsyncId,{props:t,state:d,actions:{pause:OV,resume:OV,start(t,n){p?($$(d,e._lastAsyncId),n(V$(e))):(t.onRest=a,n(H$(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));let f=F$(e,await Promise.all(h));if(s&&f.finished&&(!n||!f.noop)){let n=oW(t,s,o);if(n)return fW(e,[n]),pW(e,n,!0)}return l&&vV.batchedUpdates((()=>l(f,e,e.item))),f}function fW(e,t){zV(t,(t=>{!function(e,t,n){t.keys&&zV(t.keys,(r=>{(e[r]||(e[r]=n(r)))._prepareNode(t)}))}(e.springs,t,(t=>function(e,t){let n=new nW;return n.key=e,t&&UH(n,t),n}(t,e)))}))}var mW=({children:e,...t})=>{let n=(0,k.useContext)(gW),r=t.pause||!!n.pause,o=t.immediate||!!n.immediate;t=function(e,t){let[n]=(0,k.useState)((()=>({inputs:t,result:e()}))),r=(0,k.useRef)(),o=r.current,i=o;return i?Boolean(t&&i.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n{r.current=i,o==n&&(n.inputs=n.result=void 0)}),[i]),i.result}((()=>({pause:r,immediate:o})),[r,o]);let{Provider:i}=gW;return k.createElement(i,{value:t},e)},gW=function(e,t){return Object.assign(e,k.createContext({})),e.Provider._context=e,e.Consumer._context=e,e}(mW);mW.Provider=gW.Provider,mW.Consumer=gW.Consumer;var bW=class extends Y${constructor(e,t){super(),this.source=e,this.calc=SH(...t);let n=this._get(),r=b$(n);l$(this,r.create(n))}key;idle=!0;calc;_active=new Set;advance(e){let t=this._get();FV(t,this.get())||(a$(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&yW(this._active)&&_W(this)}_get(){let e=LV.arr(this.source)?this.source.map(PH):VV(PH(this.source));return this.calc(...e)}_start(){this.idle&&!yW(this._active)&&(this.idle=!1,zV(c$(this),(e=>{e.done=!1})),PV.skipAnimation?(vV.batchedUpdates((()=>this.advance())),_W(this)):nH.start(this))}_attach(){let e=1;zV(VV(this.source),(t=>{MH(t)&&UH(t,this),q$(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){zV(VV(this.source),(e=>{MH(e)&&VH(e,this)})),this._active.clear(),_W(this)}eventObserved(e){"change"==e.type?e.idle?this.advance():(this._active.add(e.parent),this._start()):"idle"==e.type?this._active.delete(e.parent):"priority"==e.type&&(this.priority=VV(this.source).reduce(((e,t)=>Math.max(e,(q$(t)?t.priority:0)+1)),0))}};function vW(e){return!1!==e.idle}function yW(e){return!e.size||Array.from(e).every(vW)}function _W(e){e.idle||(e.idle=!0,zV(c$(e),(e=>{e.done=!0})),LH(e,{type:"idle",parent:e}))}PV.assign({createStringInterpolator:QH,to:(e,t)=>new bW(e,t)}),nH.advance;var xW=n(44059),wW=/^--/;function kW(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||wW.test(e)||SW.hasOwnProperty(e)&&SW[e]?(""+t).trim():t+"px"}var CW={},SW={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},AW=["Webkit","Ms","Moz","O"];SW=Object.keys(SW).reduce(((e,t)=>(AW.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),SW);var EW=/^(matrix|translate|scale|rotate|skew)/,IW=/^(translate)/,jW=/^(rotate|skew)/,TW=(e,t)=>LV.num(e)&&0!==e?e+t:e,BW=(e,t)=>LV.arr(e)?e.every((e=>BW(e,t))):LV.num(e)?e===t:parseFloat(e)===t,RW=class extends f${constructor({x:e,y:t,z:n,...r}){let o=[],i=[];(e||t||n)&&(o.push([e||0,t||0,n||0]),i.push((e=>[`translate3d(${e.map((e=>TW(e,"px"))).join(",")})`,BW(e,0)]))),UV(r,((e,t)=>{if("transform"===t)o.push([e||""]),i.push((e=>[e,""===e]));else if(EW.test(t)){if(delete r[t],LV.und(e))return;let n=IW.test(t)?"px":jW.test(t)?"deg":"";o.push(VV(e)),i.push("rotate3d"===t?([e,t,r,o])=>[`rotate3d(${e},${t},${r},${TW(o,n)})`,BW(o,0)]:e=>[`${t}(${e.map((e=>TW(e,n))).join(",")})`,BW(e,t.startsWith("scale")?1:0)])}})),o.length&&(r.transform=new NW(o,i)),super(r)}},NW=class extends FH{constructor(e,t){super(),this.inputs=e,this.transforms=t}_value=null;get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return zV(this.inputs,((n,r)=>{let o=PH(n[0]),[i,s]=this.transforms[r](LV.arr(o)?o:n.map(PH));e+=" "+i,t=t&&s})),t?"none":e}observerAdded(e){1==e&&zV(this.inputs,(e=>zV(e,(e=>MH(e)&&UH(e,this)))))}observerRemoved(e){0==e&&zV(this.inputs,(e=>zV(e,(e=>MH(e)&&VH(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),LH(this,e)}};PV.assign({batchedUpdates:xW.unstable_batchedUpdates,createStringInterpolator:QH,colors:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199}});var DW=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new f$(e)),getComponentProps:r=(e=>e)}={})=>{let o={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:r},i=e=>{let t=x$(e)||"Anonymous";return(e=LV.str(e)?i[e]||(i[e]=v$(e,o)):e[_$]||(e[_$]=v$(e,o))).displayName=`Animated(${t})`,e};return UV(e,((t,n)=>{LV.arr(e)&&(n=x$(t)),i[n]=i(t)})),{animated:i}})(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(e,t){if(!e.nodeType||!e.setAttribute)return!1;let n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,{style:r,children:o,scrollTop:i,scrollLeft:s,viewBox:a,...l}=t,c=Object.values(l),u=Object.keys(l).map((t=>n||e.hasAttribute(t)?t:CW[t]||(CW[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==o&&(e.textContent=o);for(let t in r)if(r.hasOwnProperty(t)){let n=kW(t,r[t]);wW.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==i&&(e.scrollTop=i),void 0!==s&&(e.scrollLeft=s),void 0!==a&&e.setAttribute("viewBox",a)},createAnimatedStyle:e=>new RW(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),MW=DW.animated,PW=n(17116);function OW(e){return{top:e.offsetTop,left:e.offsetLeft}}const LW=function({triggerAnimationOnChange:e,clientId:t}){const n=(0,k.useRef)(),{isTyping:r,getGlobalBlockCount:o,isBlockSelected:i,isFirstMultiSelectedBlock:s,isBlockMultiSelected:a,isAncestorMultiSelected:l}=(0,Fl.A)(uy),{previous:c,prevRect:u}=(0,k.useMemo)((()=>({previous:n.current&&OW(n.current),prevRect:n.current&&n.current.getBoundingClientRect()})),[e]);return(0,k.useLayoutEffect)((()=>{if(!c||!n.current)return;const e=(0,PW.A)(n.current),d=i(t),h=d||s(t);function p(){if(h&&u){const t=n.current.getBoundingClientRect().top-u.top;t&&(e.scrollTop+=t)}}if(window.matchMedia("(prefers-reduced-motion: reduce)").matches||r()||o()>200)return void p();const f=d||a(t)||l(t)?"1":"",m=new hW({x:0,y:0,config:{mass:5,tension:2e3,friction:200},onChange({value:e}){if(!n.current)return;let{x:t,y:r}=e;t=Math.round(t),r=Math.round(r);const o=0===t&&0===r;n.current.style.transformOrigin="center center",n.current.style.transform=o?null:`translate3d(${t}px,${r}px,0)`,n.current.style.zIndex=f,p()}});n.current.style.transform=void 0;const g=OW(n.current),b=Math.round(c.left-g.left),v=Math.round(c.top-g.top);return m.start({x:0,y:0,from:{x:b,y:v}}),()=>{m.stop(),m.set({x:0,y:0})}}),[c,u,t,r,o,i,s,a,l]),n};var FW=n(30815),zW=n(57110),UW=n(67430);const VW=".block-editor-block-list__block",HW=".block-list-appender",$W=".block-editor-button-block-appender";function WW(e,t){return e.closest(VW)===t.closest(VW)}function GW(e,t){return t.closest([VW,HW,$W].join(","))===e}function qW(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(VW);return t?t.id.slice(6):void 0}function KW({clientId:e,initialPosition:t}){const n=(0,k.useRef)(),{isBlockSelected:r,isMultiSelecting:o,__unstableGetEditorMode:i}=(0,Fl.A)(uy);return(0,k.useEffect)((()=>{if(!r(e)||o()||"zoom-out"===i())return;if(null==t)return;if(!n.current)return;const{ownerDocument:s}=n.current;if(GW(n.current,s.activeElement))return;const a=NE.focus.tabbable.find(n.current).filter((e=>(0,FW.A)(e))),l=-1===t,c=a[l?a.length-1:0]||n.current;if(GW(n.current,c)){if(!n.current.getAttribute("contenteditable")){const e=NE.focus.tabbable.findNext(n.current);if(e&&GW(n.current,e)&&(0,zW.A)(e))return void e.focus()}(0,UW.A)(c,l)}else n.current.focus()}),[t,e]),n}function YW(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function JW(e){const{isBlockSelected:t}=(0,Fl.A)(uy),{selectBlock:n,selectionChange:r}=(0,zl.A)(uy);return(0,FC.A)((o=>{function i(i){o.parentElement.closest('[contenteditable="true"]')||(t(e)?i.target.isContentEditable||r(e):GW(o,i.target)&&n(e))}return o.addEventListener("focusin",i),()=>{o.removeEventListener("focusin",i)}}),[t,n])}function XW({clientId:e,isSelected:t}){const{getBlockRootClientId:n,getBlockIndex:r}=(0,Fl.A)(uy),{insertAfterBlock:o,removeBlock:i}=(0,zl.A)(uy);return(0,FC.A)((n=>{if(t)return n.addEventListener("keydown",r),n.addEventListener("dragstart",s),()=>{n.removeEventListener("keydown",r),n.removeEventListener("dragstart",s)};function r(t){const{keyCode:r,target:s}=t;r!==zE.ENTER&&r!==zE.BACKSPACE&&r!==zE.DELETE||s!==n||(0,FW.A)(s)||(t.preventDefault(),r===zE.ENTER?o(e):i(e))}function s(e){e.preventDefault()}}),[e,t,n,r,o,i])}function ZW(e){const{isNavigationMode:t,isBlockSelected:n}=(0,Fl.A)(uy),{setNavigationMode:r,selectBlock:o}=(0,zl.A)(uy);return(0,FC.A)((i=>{function s(i){t()&&!i.defaultPrevented&&(i.preventDefault(),n(e)?r(!1):o(e))}return i.addEventListener("mousedown",s),()=>{i.removeEventListener("mousedown",s)}}),[e,t,n,r])}function QW(){const e=(0,k.useContext)(SG);return(0,FC.A)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function eG({isSelected:e}){const t=(0,kx.A)();return(0,FC.A)((n=>{if(e){const{ownerDocument:e}=n,{defaultView:r}=e;if(!r.IntersectionObserver)return;const o=new r.IntersectionObserver((e=>{e[0].isIntersecting||n.scrollIntoView({behavior:t?"instant":"smooth"}),o.disconnect()}));return o.observe(n),()=>{o.disconnect()}}}),[e])}function tG({clientId:e="",isEnabled:t=!0}={}){const{getEnabledClientIdsTree:n}=wf((0,Fl.A)(uy));return(0,FC.A)((r=>{if(!t)return;const o=t=>{(t.target===r||t.target.classList.contains("is-root-container"))&&(t.defaultPrevented||(t.preventDefault(),n(e).forEach((({clientId:e})=>{const t=r.querySelector(`[data-block="${e}"]`);t&&(t.classList.remove("has-editable-outline"),t.offsetWidth,t.classList.add("has-editable-outline"))}))))};return r.addEventListener("click",o),()=>r.removeEventListener("click",o)}),[t])}function nG(e={},{__unstableIsHtml:t}={}){const{clientId:n,className:r,wrapperProps:o={},isAligned:i,index:s,mode:a,name:l,blockApiVersion:c,blockTitle:u,isSelected:d,isSubtreeDisabled:h,hasOverlay:p,initialPosition:f,blockEditingMode:m,isHighlighted:g,isMultiSelected:b,isPartiallySelected:v,isReusable:y,isDragging:_,hasChildSelected:x,isBlockMovingMode:w,canInsertMovingBlock:C,isEditingDisabled:S,hasEditableOutline:A,isTemporarilyEditingAsBlocks:E,defaultClassName:I,templateLock:j}=(0,k.useContext)(rV),T=(0,U.sprintf)((0,U.__)("Block: %s"),u),B="html"!==a||t?"":"-visual",R=(0,Zk.A)([e.ref,KW({clientId:n,initialPosition:f}),HC(n),JW(n),XW({clientId:n,isSelected:d}),ZW(n),(0,FC.A)((e=>(e.addEventListener("mouseout",YW),e.addEventListener("mouseover",YW),()=>{e.removeEventListener("mouseout",YW),e.removeEventListener("mouseover",YW),e.classList.remove("is-hovered")})),[]),QW(),LW({triggerAnimationOnChange:s,clientId:n}),(0,gV.A)({isDisabled:!p}),tG({clientId:n,isEnabled:"core/block"===l||"contentOnly"===j}),eG({isSelected:d})]),N=Xp(),D=N[Gp]&&gz(l)?{"--wp-admin-theme-color":"var(--wp-block-synced-color)","--wp-admin-theme-color--rgb":"var(--wp-block-synced-color--rgb)"}:{};c<2&&n===N.clientId&&!0===globalThis.SCRIPT_DEBUG&&(0,p_.default)(`Block type "${l}" must support API version 2 or higher to work correctly with "useBlockProps" method.`);let M=!1;return"-"!==o?.style?.marginTop?.charAt(0)&&"-"!==o?.style?.marginBottom?.charAt(0)&&"-"!==o?.style?.marginLeft?.charAt(0)&&"-"!==o?.style?.marginRight?.charAt(0)||(M=!0),{tabIndex:"disabled"===m?-1:0,...o,...e,ref:R,id:`block-${n}${B}`,role:"document","aria-label":T,"data-block":n,"data-type":l,"data-title":u,inert:h?"true":void 0,className:(0,Vy.A)("block-editor-block-list__block",{"wp-block":!i,"has-block-overlay":p,"is-selected":d,"is-highlighted":g,"is-multi-selected":b,"is-partially-selected":v,"is-reusable":y,"is-dragging":_,"has-child-selected":x,"is-block-moving-mode":w,"can-insert-moving-block":C,"is-editing-disabled":S,"has-editable-outline":A,"has-negative-margin":M,"is-content-locked-temporarily-editing-as-blocks":E},r,e.className,o.className,I),style:{...o.style,...e.style,...D}}}function rG({children:e,isHtml:t,...n}){return(0,Id.jsx)("div",{...nG(n,{__unstableIsHtml:t}),children:e})}function oG({block:{__unstableBlockSource:e},mode:t,isLocked:n,canRemove:r,clientId:o,isSelected:i,isSelectionEnabled:s,className:a,__unstableLayoutClassNames:l,name:c,isValid:u,attributes:d,wrapperProps:h,setAttributes:p,onReplace:f,onInsertBlocksAfter:m,onMerge:g,toggleSelection:b}){var v;const{mayDisplayControls:y,mayDisplayParentControls:_,themeSupportsLayout:x,...w}=(0,k.useContext)(rV),{removeBlock:C}=(0,zl.A)(uy),S=(0,k.useCallback)((()=>C(o)),[o,C]),A=fS()||{};let E=(0,Id.jsx)(oV,{name:c,isSelected:i,attributes:d,setAttributes:p,insertBlocksAfter:n?void 0:m,onReplace:r?f:void 0,onRemove:r?S:void 0,mergeBlocks:r?g:void 0,clientId:o,isSelectionEnabled:s,toggleSelection:b,__unstableLayoutClassNames:l,__unstableParentLayout:Object.keys(A).length?A:void 0,mayDisplayControls:y,mayDisplayParentControls:_,blockEditingMode:w.blockEditingMode,isPreviewMode:w.isPreviewMode});const I=kc(c);I?.getEditWrapperProps&&(h=function(e,t){const n={...e,...t};return e?.hasOwnProperty("className")&&t?.hasOwnProperty("className")&&(n.className=(0,Vy.A)(e.className,t.className)),e?.hasOwnProperty("style")&&t?.hasOwnProperty("style")&&(n.style={...e.style,...t.style}),n}(h,I.getEditWrapperProps(d)));const j=h&&!!h["data-align"]&&!x,T=a?.includes("is-position-sticky");let B;if(j&&(E=(0,Id.jsx)("div",{className:(0,Vy.A)("wp-block",T&&a),"data-align":h["data-align"],children:E})),u)B="html"===t?(0,Id.jsxs)(Id.Fragment,{children:[(0,Id.jsx)("div",{style:{display:"none"},children:E}),(0,Id.jsx)(rG,{isHtml:!0,children:(0,Id.jsx)(mV,{clientId:o})})]}):I?.apiVersion>1?E:(0,Id.jsx)(rG,{children:E});else{const t=e?Ed(e):Md(I,d);B=(0,Id.jsxs)(rG,{className:"has-warning",children:[(0,Id.jsx)(cV,{clientId:o}),(0,Id.jsx)(Cd.A,{children:(0,KU.A)(t)})]})}const{"data-align":R,...N}=null!==(v=h)&&void 0!==v?v:{},D={...N,className:(0,Vy.A)(N.className,R&&x&&`align${R}`,!(R&&T)&&a)};return(0,Id.jsx)(rV.Provider,{value:{wrapperProps:D,isAligned:j,...w},children:(0,Id.jsx)(pV,{fallback:(0,Id.jsx)(rG,{className:"has-warning",children:(0,Id.jsx)(dV,{})}),children:B})})}nG.save=Nd;const iG=(0,FE.A)(((e,t,n)=>{const{updateBlockAttributes:r,insertBlocks:o,mergeBlocks:i,replaceBlocks:s,toggleSelection:a,__unstableMarkLastChangeAsPersistent:l,moveBlocksToPosition:c,removeBlock:u,selectBlock:d}=e(uy);return{setAttributes(e){const{getMultiSelectedBlockClientIds:o}=n.select(uy),i=o(),{clientId:s}=t,a=i.length?i:[s];r(a,e)},onInsertBlocks(e,n){const{rootClientId:r}=t;o(e,n,r)},onInsertBlocksAfter(e){const{clientId:r,rootClientId:i}=t,{getBlockIndex:s}=n.select(uy),a=s(r);o(e,a+1,i)},onMerge(e){const{clientId:r,rootClientId:a}=t,{getPreviousBlockClientId:l,getNextBlockClientId:h,getBlock:p,getBlockAttributes:f,getBlockName:m,getBlockOrder:g,getBlockIndex:b,getBlockRootClientId:v,canInsertBlockType:y}=n.select(uy);function _(){const e=p(r),t=wc();if(m(r)!==t){const n=cd(e,t);n&&n.length&&s(r,n)}else if(Rc(e)){const e=h(r);e&&n.batch((()=>{u(r),d(e)}))}}function x(e,t=!0){const r=v(e),i=g(e),[s]=i;1===i.length&&Bc(p(s))?u(e):n.batch((()=>{if(y(m(s),r))c([s],e,r,b(e));else{const n=cd(p(s),wc());n&&n.length&&n.every((e=>y(e.name,r)))?(o(n,b(e),r,t),u(s,!1)):_()}!g(e).length&&Bc(p(e))&&u(e,!1)}))}if(e){if(a){const e=h(a);if(e){if(m(a)!==m(e))return void i(a,e);{const t=f(a),r=f(e);if(Object.keys(t).every((e=>t[e]===r[e])))return void n.batch((()=>{c(g(e),e,a),u(e,!1)}))}}}const e=h(r);if(!e)return;g(e).length?x(e,!1):i(r,e)}else{const e=l(r);if(e)i(e,r);else if(a){const e=l(a);if(e&&m(a)===m(e)){const t=f(a),r=f(e);if(Object.keys(t).every((e=>t[e]===r[e])))return void n.batch((()=>{c(g(a),a,e),u(a,!1)}))}x(a)}else _()}},onReplace(e,n,r){e.length&&!Rc(e[e.length-1])&&l();const o=1===e?.length&&Array.isArray(e[0])?e[0]:e;s([t.clientId],o,n,r)},toggleSelection(e){a(e)}}}));oG=(0,D.A)(iG,LE("editor.BlockListBlock"))(oG);const sG=(0,k.memo)((function(e){const{clientId:t,rootClientId:n}=e,r=(0,Fl.A)((e=>{const{isBlockSelected:r,getBlockMode:o,isSelectionEnabled:i,getTemplateLock:s,getBlockWithoutAttributes:a,getBlockAttributes:l,canRemoveBlock:c,canMoveBlock:u,getSettings:d,getTemporarilyEditingAsBlocks:h,getBlockEditingMode:p,getBlockName:f,isFirstMultiSelectedBlock:m,getMultiSelectedBlockClientIds:g,hasSelectedInnerBlock:b,getBlocksByName:v,getBlockIndex:y,isBlockMultiSelected:_,isBlockSubtreeDisabled:x,isBlockHighlighted:w,__unstableIsFullySelected:k,__unstableSelectionHasUnmergeableBlock:C,isBlockBeingDragged:S,isDragging:A,hasBlockMovingClientId:E,canInsertBlockType:I,__unstableHasActiveBlockOverlayActive:j,__unstableGetEditorMode:T,getSelectedBlocksInitialCaretPosition:B}=wf(e(uy)),R=a(t);if(!R)return;const{hasBlockSupport:N,getActiveBlockVariation:D}=e(Zu),M=l(t),{name:P,isValid:O}=R,L=kc(P),{supportsLayout:F,__unstableIsPreviewMode:z}=d(),U=L?.apiVersion>1,V={isPreviewMode:z,blockWithoutAttributes:R,name:P,attributes:M,isValid:O,themeSupportsLayout:F,index:y(t),isReusable:Ec(L),className:U?M.className:void 0,defaultClassName:U?jd(P):void 0,blockTitle:L?.title};if(z)return V;const H=r(t),$=c(t,n),W=u(t,n),G=D(P,M),q=_(t),K=b(t,!0),Y=E(),J=p(t),X=Ac(P,"multiple",!0)?[]:v(P),Z=X.length&&X[0]!==t;return{...V,mode:o(t),isSelectionEnabled:i(),isLocked:!!s(n),templateLock:s(t),canRemove:$,canMove:W,isSelected:H,isTemporarilyEditingAsBlocks:h()===t,blockEditingMode:J,mayDisplayControls:H||m(t)&&g().every((e=>f(e)===P)),mayDisplayParentControls:N(f(t),"__experimentalExposeControlsToChildren",!1)&&b(t),blockApiVersion:L?.apiVersion||1,blockTitle:G?.title||L?.title,isSubtreeDisabled:"disabled"===J&&x(t),hasOverlay:j(t)&&!A(),initialPosition:!H||"edit"!==T()&&"zoom-out"!==T()?void 0:B(),isHighlighted:w(t),isMultiSelected:q,isPartiallySelected:q&&!k()&&!C(),isDragging:S(t),hasChildSelected:K,isBlockMovingMode:!!Y,canInsertMovingBlock:Y&&I(f(Y),n),isEditingDisabled:"disabled"===J,hasEditableOutline:"disabled"!==J&&"disabled"===p(n),originalBlockClientId:!!Z&&X[0]}}),[t,n]),{isPreviewMode:o,mode:i="visual",isSelectionEnabled:s=!1,isLocked:a=!1,canRemove:l=!1,canMove:c=!1,blockWithoutAttributes:u,name:d,attributes:h,isValid:p,isSelected:f=!1,themeSupportsLayout:m,isTemporarilyEditingAsBlocks:g,blockEditingMode:b,mayDisplayControls:v,mayDisplayParentControls:y,index:_,blockApiVersion:x,blockTitle:w,isSubtreeDisabled:C,hasOverlay:S,initialPosition:A,isHighlighted:E,isMultiSelected:I,isPartiallySelected:j,isReusable:T,isDragging:B,hasChildSelected:R,isBlockMovingMode:N,canInsertMovingBlock:D,templateLock:M,isEditingDisabled:P,hasEditableOutline:O,className:L,defaultClassName:F,originalBlockClientId:z}=r,U=(0,k.useMemo)((()=>({...u,attributes:h})),[u,h]);if(!r)return null;const V={isPreviewMode:o,clientId:t,className:L,index:_,mode:i,name:d,blockApiVersion:x,blockTitle:w,isSelected:f,isSubtreeDisabled:C,hasOverlay:S,initialPosition:A,blockEditingMode:b,isHighlighted:E,isMultiSelected:I,isPartiallySelected:j,isReusable:T,isDragging:B,hasChildSelected:R,isBlockMovingMode:N,canInsertMovingBlock:D,templateLock:M,isEditingDisabled:P,hasEditableOutline:O,isTemporarilyEditingAsBlocks:g,defaultClassName:F,mayDisplayControls:v,mayDisplayParentControls:y,originalBlockClientId:z,themeSupportsLayout:m};return(0,Id.jsx)(rV.Provider,{value:V,children:(0,Id.jsx)(oG,{...e,mode:i,isSelectionEnabled:s,isLocked:a,canRemove:l,canMove:c,block:U,name:d,attributes:h,isValid:p,isSelected:f})})})),aG="\ufeff";function lG({rootClientId:e}){const{showPrompt:t,isLocked:n,placeholder:r}=(0,Fl.A)((t=>{const{getBlockCount:n,getSettings:r,getTemplateLock:o}=t(uy),i=!n(e),{bodyPlaceholder:s}=r();return{showPrompt:i,isLocked:!!o(e),placeholder:s}}),[e]),{insertDefaultBlock:o,startTyping:i}=(0,zl.A)(uy);if(n)return null;const s=(0,Xa.decodeEntities)(r)||(0,U.__)("Type / to choose a block"),a=()=>{o(void 0,e),i()};return(0,Id.jsxs)("div",{"data-root-client-id":e||"",className:(0,Vy.A)("block-editor-default-block-appender",{"has-visible-prompt":t}),children:[(0,Id.jsx)("p",{tabIndex:"0",role:"button","aria-label":(0,U.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{zE.ENTER!==e.keyCode&&zE.SPACE!==e.keyCode||a()},onClick:()=>a(),onFocus:()=>{t&&a()},children:t?s:aG}),(0,Id.jsx)(tJ,{rootClientId:e,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0})]})}function cG({rootClientId:e}){return(0,Fl.A)((t=>t(uy).canInsertBlockType(wc(),e)))?(0,Id.jsx)(lG,{rootClientId:e}):(0,Id.jsx)(rJ,{rootClientId:e,className:"block-list-appender__toggle"})}function uG({rootClientId:e,CustomAppender:t,className:n,tagName:r="div"}){const o=(0,Fl.A)((t=>{const{getBlockInsertionPoint:n,isBlockInsertionPointVisible:r,getBlockCount:o}=t(uy),i=n();return r()&&e===i?.rootClientId&&0===o(e)}),[e]);return(0,Id.jsx)(r,{tabIndex:-1,className:(0,Vy.A)("block-list-appender wp-block",n,{"is-drag-over":o}),contentEditable:!1,"data-block":!0,children:t?(0,Id.jsx)(t,{}):(0,Id.jsx)(cG,{rootClientId:e})})}const dG=Number.MAX_SAFE_INTEGER;(0,k.createContext)();const hG=function({previousClientId:e,nextClientId:t,children:n,__unstablePopoverSlot:r,__unstableContentRef:o,operation:i="insert",nearestSide:s="right",...a}){const[l,c]=(0,k.useReducer)((e=>(e+1)%dG),0),{orientation:u,rootClientId:d,isVisible:h}=(0,Fl.A)((n=>{const{getBlockListSettings:r,getBlockRootClientId:o,isBlockVisible:i}=n(uy),s=o(null!=e?e:t);return{orientation:r(s)?.orientation||"vertical",rootClientId:s,isVisible:i(e)&&i(t)}}),[e,t]),p=WC(e),f=WC(t),m="vertical"===u,g=(0,k.useMemo)((()=>{if(!(l<0||!p&&!f)&&h)return{contextElement:"group"===i?f||p:p||f,getBoundingClientRect(){const e=p?p.getBoundingClientRect():null,t=f?f.getBoundingClientRect():null;let n=0,r=0,o=0,a=0;if("group"===i){const i=t||e;r=i.top,o=0,a=i.bottom-i.top,n="left"===s?i.left-2:i.right-2}else m?(r=e?e.bottom:t.top,o=e?e.width:t.width,a=t&&e?t.top-e.bottom:0,n=e?e.left:t.left):(r=e?e.top:t.top,a=e?e.height:t.height,(0,U.isRTL)()?(n=t?t.right:e.left,o=e&&t?e.left-t.right:0):(n=e?e.right:t.left,o=e&&t?t.left-e.right:0));return new window.DOMRect(n,r,o,a)}}}),[p,f,l,m,h,i,s]),b=qC(o);return(0,k.useLayoutEffect)((()=>{if(!p)return;const e=new window.MutationObserver(c);return e.observe(p,{attributes:!0}),()=>{e.disconnect()}}),[p]),(0,k.useLayoutEffect)((()=>{if(!f)return;const e=new window.MutationObserver(c);return e.observe(f,{attributes:!0}),()=>{e.disconnect()}}),[f]),(0,k.useLayoutEffect)((()=>{if(p)return p.ownerDocument.defaultView.addEventListener("resize",c),()=>{p.ownerDocument.defaultView?.removeEventListener("resize",c)}}),[p]),(p||f)&&h?(0,Id.jsx)(GC.Ay,{ref:b,animate:!1,anchor:g,focusOnMount:!1,__unstableSlotName:r,inline:!r,...a,className:(0,Vy.A)("block-editor-block-popover","block-editor-block-popover__inbetween",a.className),resize:!1,flip:!1,placement:"overlay",variant:"unstyled",children:(0,Id.jsx)("div",{className:"block-editor-block-popover__inbetween-container",children:n})},t+"--"+d):null},pG={hide:{opacity:0,scaleY:.75},show:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:.9}},fG=function({__unstablePopoverSlot:e,__unstableContentRef:t}){const{clientId:n}=(0,Fl.A)((e=>{const{getBlockOrder:t,getBlockInsertionPoint:n}=e(uy),r=n(),o=t(r.rootClientId);return o.length?{clientId:o[r.index]}:{}}),[]),r=(0,kx.A)();return(0,Id.jsx)(ZC,{clientId:n,__unstablePopoverSlot:e,__unstableContentRef:t,className:"block-editor-block-popover__drop-zone",children:(0,Id.jsx)(wx.P.div,{"data-testid":"block-popover-drop-zone",initial:r?pG.show:pG.hide,animate:pG.show,exit:r?pG.show:pG.exit,className:"block-editor-block-popover__drop-zone-foreground"})})},mG=(0,k.createContext)();function gG({__unstablePopoverSlot:e,__unstableContentRef:t,operation:n="insert",nearestSide:r="right"}){const{selectBlock:o,hideInsertionPoint:i}=(0,zl.A)(uy),s=(0,k.useContext)(mG),a=(0,k.useRef)(),{orientation:l,previousClientId:c,nextClientId:u,rootClientId:d,isInserterShown:h,isDistractionFree:p,isNavigationMode:f}=(0,Fl.A)((e=>{const{getBlockOrder:t,getBlockListSettings:n,getBlockInsertionPoint:r,isBlockBeingDragged:o,getPreviousBlockClientId:i,getNextBlockClientId:s,getSettings:a,isNavigationMode:l}=e(uy),c=r(),u=t(c.rootClientId);if(!u.length)return{};let d=u[c.index-1],h=u[c.index];for(;o(d);)d=i(d);for(;o(h);)h=s(h);const p=a();return{previousClientId:d,nextClientId:h,orientation:n(c.rootClientId)?.orientation||"vertical",rootClientId:c.rootClientId,isNavigationMode:l(),isDistractionFree:p.isDistractionFree,isInserterShown:c?.__unstableWithInserter}}),[]),{getBlockEditingMode:m}=(0,Fl.A)(uy),g=(0,kx.A)(),b={start:{opacity:0,scale:0},rest:{opacity:1,scale:1,transition:{delay:h?.5:0,type:"tween"}},hover:{opacity:1,scale:1,transition:{delay:.5,type:"tween"}}},v={start:{scale:g?1:0},rest:{scale:1,transition:{delay:.4,type:"tween"}}};if(p&&!f)return null;const y="horizontal"===l||"group"===n?"is-horizontal":"is-vertical",_=(0,Vy.A)("block-editor-block-list__insertion-point",y);return(0,Id.jsx)(hG,{previousClientId:c,nextClientId:u,__unstablePopoverSlot:e,__unstableContentRef:t,operation:n,nearestSide:r,children:(0,Id.jsxs)(wx.P.div,{layout:!g,initial:g?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:a,tabIndex:-1,onClick:function(e){e.target===a.current&&u&&"disabled"!==m(u)&&o(u,-1)},onFocus:function(e){e.target!==a.current&&(s.current=!0)},className:(0,Vy.A)(_,{"is-with-inserter":h}),onHoverEnd:function(e){e.target!==a.current||s.current||i()},children:[(0,Id.jsx)(wx.P.div,{variants:b,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),h&&(0,Id.jsx)(wx.P.div,{variants:v,className:(0,Vy.A)("block-editor-block-list__insertion-point-inserter"),children:(0,Id.jsx)(tJ,{position:"bottom center",clientId:u,rootClientId:d,__experimentalIsQuick:!0,onToggle:e=>{s.current=e},onSelectOrClose:()=>{s.current=!1}})})]})})}function bG(e){const{insertionPoint:t,isVisible:n,isBlockListEmpty:r}=(0,Fl.A)((e=>{const{getBlockInsertionPoint:t,isBlockInsertionPointVisible:n,getBlockCount:r}=e(uy),o=t();return{insertionPoint:o,isVisible:n(),isBlockListEmpty:0===r(o?.rootClientId)}}),[]);return!n||r?null:"replace"===t.operation?(0,Id.jsx)(fG,{...e},`${t.rootClientId}-${t.index}`):(0,Id.jsx)(gG,{operation:t.operation,nearestSide:t.nearestSide,...e})}function vG(){const e=(0,k.useContext)(mG),t=(0,Fl.A)((e=>e(uy).getSettings().isDistractionFree||"zoom-out"===e(uy).__unstableGetEditorMode()),[]),{getBlockListSettings:n,getBlockIndex:r,isMultiSelecting:o,getSelectedBlockClientIds:i,getTemplateLock:s,__unstableIsWithinBlockOverlay:a,getBlockEditingMode:l,getBlockName:c}=(0,Fl.A)(uy),{showInsertionPoint:u,hideInsertionPoint:d}=(0,zl.A)(uy);return(0,FC.A)((h=>{if(!t)return h.addEventListener("mousemove",p),()=>{h.removeEventListener("mousemove",p)};function p(t){if(e.current)return;if(t.target.nodeType===t.target.TEXT_NODE)return;if(o())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void d();let h;if(t.target.classList.contains("is-root-container")||(h=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")),s(h)||"disabled"===l(h)||"core/block"===c(h))return;const p=n(h)?.orientation||"vertical",f=t.clientY,m=t.clientX;let g=Array.from(t.target.children).find((e=>{const t=e.getBoundingClientRect();return e.classList.contains("wp-block")&&"vertical"===p&&t.top>f||e.classList.contains("wp-block")&&"horizontal"===p&&((0,U.isRTL)()?t.rightm)}));if(!g)return void d();if(!g.id&&(g=g.firstElementChild,!g))return void d();const b=g.id.slice(6);if(!b||a(b))return;if(i().includes(b))return;const v=g.getBoundingClientRect();if("horizontal"===p&&(t.clientY>v.bottom||t.clientYv.right||t.clientX{if(o)return e.addEventListener("mousedown",i),()=>{e.removeEventListener("mousedown",i)};function i(o){(t()||n())&&o.target===e&&r()}}),[t,n,r,o])}function _G(e){return(0,Id.jsx)("div",{ref:yG(),...e})}const xG=new Set([zE.UP,zE.RIGHT,zE.DOWN,zE.LEFT,zE.ENTER,zE.BACKSPACE]);function wG(){const e=(0,Fl.A)((e=>e(uy).isTyping()),[]),{stopTyping:t}=(0,zl.A)(uy);return(0,FC.A)((n=>{if(!e)return;const{ownerDocument:r}=n;let o,i;function s(e){const{clientX:n,clientY:r}=e;o&&i&&(o!==n||i!==r)&&t(),o=n,i=r}return r.addEventListener("mousemove",s),()=>{r.removeEventListener("mousemove",s)}}),[e,t])}function kG(){const{isTyping:e}=(0,Fl.A)((e=>{const{isTyping:t}=e(uy);return{isTyping:t()}}),[]),{startTyping:t,stopTyping:n}=(0,zl.A)(uy),r=wG(),o=(0,FC.A)((r=>{const{ownerDocument:o}=r,{defaultView:i}=o,s=i.getSelection();if(e){let l;function c(e){const{target:t}=e;l=i.setTimeout((()=>{(0,FW.A)(t)||n()}))}function u(e){const{keyCode:t}=e;t!==zE.ESCAPE&&t!==zE.TAB||n()}function d(){s.isCollapsed||n()}return r.addEventListener("focus",c),r.addEventListener("keydown",u),o.addEventListener("selectionchange",d),()=>{i.clearTimeout(l),r.removeEventListener("focus",c),r.removeEventListener("keydown",u),o.removeEventListener("selectionchange",d)}}function a(e){const{type:n,target:o}=e;(0,FW.A)(o)&&r.contains(o)&&("keydown"!==n||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&xG.has(t)}(e))&&t()}return r.addEventListener("keypress",a),r.addEventListener("keydown",a),()=>{r.removeEventListener("keypress",a),r.removeEventListener("keydown",a)}}),[e,t,n]);return(0,Zk.A)([r,o])}const CG=function({children:e}){return(0,Id.jsx)("div",{ref:kG(),children:e})},SG=(0,k.createContext)(),AG=new WeakMap;function EG({className:e,...t}){const n=(0,qU.A)("medium"),{isOutlineMode:r,isFocusMode:o,editorMode:i,temporarilyEditingAsBlocks:s}=(0,Fl.A)((e=>{const{getSettings:t,__unstableGetEditorMode:n,getTemporarilyEditingAsBlocks:r,isTyping:o}=wf(e(uy)),{outlineMode:i,focusMode:s}=t();return{isOutlineMode:i&&!o(),isFocusMode:s,editorMode:n(),temporarilyEditingAsBlocks:r()}}),[]),a=(0,Up.A)(),{setBlockVisibility:l}=(0,zl.A)(uy),c=(0,gT.A)((0,k.useCallback)((()=>{const e={};AG.get(a).forEach((([t,n])=>{e[t]=n})),l(e)}),[a]),300,{trailing:!0}),u=(0,k.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{AG.get(a)||AG.set(a,[]);for(const t of e){const e=t.target.getAttribute("data-block");AG.get(a).push([e,t.isIntersecting])}c()}))}),[]),d=wJ({ref:(0,Zk.A)([yG(),vG(),kG()]),className:(0,Vy.A)("is-root-container",e,{"is-outline-mode":r,"is-focus-mode":o&&n,"is-navigate-mode":"navigation"===i})},t);return(0,Id.jsxs)(SG.Provider,{value:u,children:[(0,Id.jsx)("div",{...d}),!!s&&(0,Id.jsx)(IG,{clientId:s})]})}function IG({clientId:e}){const{stopEditingAsBlocks:t}=wf((0,zl.A)(uy)),n=(0,Fl.A)((t=>{const{isBlockSelected:n,hasSelectedInnerBlock:r}=t(uy);return n(e)||r(e,!0)}),[e]);return(0,k.useEffect)((()=>{n||t(e)}),[n,e,t]),null}function jG(e){return(0,Id.jsx)(Jp,{value:Kp,children:(0,Id.jsx)(EG,{...e})})}const TG=[],BG=new Set;function RG({placeholder:e,rootClientId:t,renderAppender:n,__experimentalAppenderTagName:r,layout:o=dS}){const i=!1!==n,s=!!n,{order:a,selectedBlocks:l,visibleBlocks:c,shouldRenderAppender:u}=(0,Fl.A)((e=>{const{getSettings:n,getBlockOrder:r,getSelectedBlockClientId:o,getSelectedBlockClientIds:a,__unstableGetVisibleBlocks:l,getTemplateLock:c,getBlockEditingMode:u,__unstableGetEditorMode:d}=e(uy),h=r(t);if(n().__unstableIsPreviewMode)return{order:h,selectedBlocks:TG,visibleBlocks:BG};const p=o();return{order:h,selectedBlocks:a(),visibleBlocks:l(),shouldRenderAppender:i&&"zoom-out"!==d()&&(s?!c(t)&&"disabled"!==u(t):t===p||!t&&!p&&!h.length)}}),[t,i,s]);return(0,Id.jsxs)(pS,{value:o,children:[a.map((e=>(0,Id.jsx)(GU.Ay,{value:!c.has(e)&&!l.includes(e),children:(0,Id.jsx)(sG,{rootClientId:t,clientId:e})},e))),a.length<1&&e,u&&(0,Id.jsx)(uG,{tagName:r,rootClientId:t,CustomAppender:n})]})}function NG(e){return(0,Id.jsx)(GU.Ay,{value:!1,children:(0,Id.jsx)(RG,{...e})})}function DG(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:r,getSelectedBlockClientId:o,getSelectedBlocksInitialCaretPosition:i,__unstableIsFullySelected:s}=e(uy);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:r(),selectedBlockClientId:o(),initialPosition:i(),isFullSelection:s()}}function MG(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:r,selectedBlockClientId:o,isFullSelection:i}=(0,Fl.A)(DG,[]);return(0,FC.A)((o=>{const{ownerDocument:s}=o,{defaultView:a}=s;if(null==e)return;if(!r||t)return;const{length:l}=n;l<2||i&&(o.contentEditable=!0,o.focus(),a.getSelection().removeAllRanges())}),[r,t,n,o,e,i])}var PG=n(13149),OG=n(24855),LG=n(91512),FG=n(30967),zG=n(53932);function UG(e,t,n,r){let o,i=NE.focus.focusable.find(n);return t&&i.reverse(),i=i.slice(i.indexOf(e)+1),r&&(o=e.getBoundingClientRect()),i.find((function(e){if(!(e.closest("[inert]")||1===e.children.length&&WW(e,e.firstElementChild)&&"true"===e.firstElementChild.getAttribute("contenteditable"))){if(!NE.focus.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(r){const t=e.getBoundingClientRect();if(t.left>=o.right||t.right<=o.left)return!1}return!0}}))}function VG(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:r,__unstableIsFullySelected:o}=(0,Fl.A)(uy),{selectBlock:i}=(0,zl.A)(uy);return(0,FC.A)((s=>{let a;function l(){a=null}function c(l){if(l.defaultPrevented)return;const{keyCode:c,target:u,shiftKey:d,ctrlKey:h,altKey:p,metaKey:f}=l,m=c===zE.UP,g=c===zE.DOWN,b=c===zE.LEFT,v=c===zE.RIGHT,y=m||b,_=b||v,x=m||g,w=_||x,k=d||h||p||f,C=x?PG.A:OG.A,{ownerDocument:S}=s,{defaultView:A}=S;if(!w)return;if(r()){if(d)return;if(!o())return;return l.preventDefault(),void(y?i(e()):i(t(),-1))}if(!function(e,t,n){const r=t===zE.UP||t===zE.DOWN,{tagName:o}=e,i=e.getAttribute("type");return r&&!n?"INPUT"!==o||!["date","datetime-local","month","number","range","time","week"].includes(i):"INPUT"===o?["button","checkbox","number","color","file","image","radio","reset","submit"].includes(i):"TEXTAREA"!==o}(u,c,k))return;x?a||(a=(0,LG.A)(A)):a=null;const E=(0,FG.A)(u)?!y:y,{keepCaretInsideBlock:I}=n();if(d)(function(e,t){const n=UG(e,t,s);return n&&qW(n)})(u,y)&&C(u,y)&&(s.contentEditable=!0,s.focus());else if(!x||!(0,PG.A)(u,y)||p&&!(0,OG.A)(u,E)||I){if(_&&A.getSelection().isCollapsed&&(0,OG.A)(u,E)&&!I){const e=UG(u,E,s);(0,UW.A)(e,y),l.preventDefault()}}else{const e=UG(u,y,s,!0);e&&((0,zG.A)(e,p?!y:y,p?void 0:a),l.preventDefault())}}return s.addEventListener("mousedown",l),s.addEventListener("keydown",c),()=>{s.removeEventListener("mousedown",l),s.removeEventListener("keydown",c)}}),[])}var HG=n(82569);function $G(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,Fl.A)(uy),{multiSelect:r,selectBlock:o}=(0,zl.A)(uy),i=(0,MU.ZK)();return(0,FC.A)((s=>{function a(a){if(!i("core/block-editor/select-all",a))return;const l=t();if(l.length<2&&!(0,HG.A)(a.target))return;a.preventDefault();const[c]=l,u=n(c),d=e(u);l.length!==d.length?r(d[0],d[d.length-1]):u&&(s.ownerDocument.defaultView.getSelection().removeAllRanges(),o(u))}return s.addEventListener("keydown",a),()=>{s.removeEventListener("keydown",a)}}),[])}function WG(e,t){e.contentEditable=t,t&&e.focus()}function GG(){const{startMultiSelect:e,stopMultiSelect:t}=(0,zl.A)(uy),{isSelectionEnabled:n,hasSelectedBlock:r,isDraggingBlocks:o,isMultiSelecting:i}=(0,Fl.A)(uy);return(0,FC.A)((s=>{const{ownerDocument:a}=s,{defaultView:l}=a;let c,u;function d(){t(),l.removeEventListener("mouseup",d),u=l.requestAnimationFrame((()=>{if(!r())return;WG(s,!1);const e=l.getSelection();if(e.rangeCount){const t=e.getRangeAt(0),{commonAncestorContainer:n}=t,r=t.cloneRange();c.contains(n)&&(c.focus(),e.removeAllRanges(),e.addRange(r))}}))}function h({buttons:t,target:r,relatedTarget:a}){r.contains(a)||o()||1===t&&(i()||s!==r&&"true"===r.getAttribute("contenteditable")&&n()&&(c=r,e(),l.addEventListener("mouseup",d),WG(s,!0)))}return s.addEventListener("mouseout",h),()=>{s.removeEventListener("mouseout",h),l.removeEventListener("mouseup",d),l.cancelAnimationFrame(u)}}),[e,t,n,r])}function qG(e,t){e.contentEditable!==String(t)&&(e.contentEditable=t,t&&e.focus())}function KG(e){const t=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;return t?.closest("[data-wp-block-attribute-key]")}function YG(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,zl.A)(uy),{getBlockParents:r,getBlockSelectionStart:o,isMultiSelecting:i}=(0,Fl.A)(uy);return(0,FC.A)((s=>{const{ownerDocument:a}=s,{defaultView:l}=a;function c(a){const c=l.getSelection();if(!c.rangeCount)return;const u=function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE||0===n?t:t.childNodes[n-1]}(c),d=function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE||n===t.childNodes.length?t:t.childNodes[n]}(c);if(!s.contains(u)||!s.contains(d))return;const h=a.shiftKey&&"mouseup"===a.type;if(c.isCollapsed&&!h){if("true"===s.contentEditable&&!i()){qG(s,!1);let e=u.nodeType===u.ELEMENT_NODE?u:u.parentElement;e=e?.closest("[contenteditable]"),e?.focus()}return}let p=qW(u),f=qW(d);if(h){const e=o(),t=qW(a.target),n=t!==f;(p===f&&c.isCollapsed||!f||n)&&(f=t),p!==e&&(p=e)}if(void 0!==p||void 0!==f)if(p===f)i()?e(p,p):t(p);else{const t=[...r(p),p],o=[...r(f),f],i=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,o);if(t[i]!==p||o[i]!==f)return void e(t[i],o[i]);const s=KG(u),a=KG(d);if(s&&a){var m,g;const e=c.getRangeAt(0),t=(0,V.create)({element:s,range:e,__unstableIsEditableTree:!0}),r=(0,V.create)({element:a,range:e,__unstableIsEditableTree:!0}),o=null!==(m=t.start)&&void 0!==m?m:t.end,i=null!==(g=r.start)&&void 0!==g?g:r.end;n({start:{clientId:p,attributeKey:s.dataset.wpBlockAttributeKey,offset:o},end:{clientId:f,attributeKey:a.dataset.wpBlockAttributeKey,offset:i}})}else e(p,f)}else qG(s,!1)}return a.addEventListener("selectionchange",c),l.addEventListener("mouseup",c),()=>{a.removeEventListener("selectionchange",c),l.removeEventListener("mouseup",c)}}),[e,t,n,r])}function JG(){const{selectBlock:e}=(0,zl.A)(uy),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:r}=(0,Fl.A)(uy);return(0,FC.A)((o=>{function i(i){if(!t()||0!==i.button)return;const s=n(),a=qW(i.target);i.shiftKey?s!==a&&(o.contentEditable=!0,o.focus()):r()&&e(a)}return o.addEventListener("mousedown",i),()=>{o.removeEventListener("mousedown",i)}}),[e,t,n,r])}function XG(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,getSelectedBlockClientId:n,__unstableIsSelectionMergeable:r,hasMultiSelection:o,getBlockName:i,canInsertBlockType:s,getBlockRootClientId:a,getSelectionStart:l,getSelectionEnd:c,getBlockAttributes:u}=(0,Fl.A)(uy),{replaceBlocks:d,__unstableSplitSelection:h,removeBlocks:p,__unstableDeleteSelection:f,__unstableExpandSelection:m,__unstableMarkAutomaticChange:g}=(0,zl.A)(uy);return(0,FC.A)((b=>{function v(e){"true"===b.contentEditable&&e.preventDefault()}function y(v){if(!v.defaultPrevented)if(o())v.keyCode===zE.ENTER?(b.contentEditable=!1,v.preventDefault(),e()?d(t(),Qu(wc())):h()):v.keyCode===zE.BACKSPACE||v.keyCode===zE.DELETE?(b.contentEditable=!1,v.preventDefault(),e()?p(t()):r()?f(v.keyCode===zE.DELETE):m()):1!==v.key.length||v.metaKey||v.ctrlKey||(b.contentEditable=!1,r()?f(v.keyCode===zE.DELETE):(v.preventDefault(),b.ownerDocument.defaultView.getSelection().removeAllRanges()));else if(v.keyCode===zE.ENTER){if(v.shiftKey||e())return;const t=n(),r=i(t),o=l(),p=c();if(o.attributeKey===p.attributeKey){const e=u(t)[o.attributeKey],n=sd(ad("from").filter((({type:e})=>"enter"===e)),(t=>t.regExp.test(e)));if(n)return d(t,n.transform({content:e})),void g()}if(!Ac(r,"splitting",!1)&&!v.__deprecatedOnSplit)return;s(r,a(t))&&(h(),v.preventDefault())}}function _(e){o()&&(b.contentEditable=!1,r()?f():(e.preventDefault(),b.ownerDocument.defaultView.getSelection().removeAllRanges()))}return b.addEventListener("beforeinput",v),b.addEventListener("keydown",y),b.addEventListener("compositionstart",_),()=>{b.removeEventListener("beforeinput",v),b.removeEventListener("keydown",y),b.removeEventListener("compositionstart",_)}}),[])}var ZG=n(55647),QG=n(46771);function eq(){const{getBlockName:e}=(0,Fl.A)(uy),{getBlockType:t}=(0,Fl.A)(Zu),{createSuccessNotice:n}=(0,zl.A)(Yb.store);return(0,k.useCallback)(((r,o)=>{let i="";if(1===o.length){const n=o[0],s=t(e(n))?.title;i="copy"===r?(0,U.sprintf)((0,U.__)('Copied "%s" to clipboard.'),s):(0,U.sprintf)((0,U.__)('Moved "%s" to clipboard.'),s)}else i="copy"===r?(0,U.sprintf)((0,U._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",o.length),o.length):(0,U.sprintf)((0,U._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",o.length),o.length);n(i,{type:"snackbar"})}),[])}function tq({clipboardData:e}){let t="",n="";try{t=e.getData("text/plain"),n=e.getData("text/html")}catch(t){try{n=e.getData("Text")}catch(e){return}}n=function(e){const t=e.indexOf("\x3c!--StartFragment--\x3e");if(!(t>-1))return e;const n=(e=e.substring(t+20)).indexOf("\x3c!--EndFragment--\x3e");return n>-1&&(e=e.substring(0,n)),e}(n),n=function(e){return e.startsWith("")?e.slice(22):e}(n);const r=(0,YA.$)(e);return r.length&&!function(e,t){if(t&&1===e?.length&&0===e[0].type.indexOf("image/")){const e=/<\s*img\b/gi;if(1!==t.match(e)?.length)return!0;const n=/<\s*img\b[^>]*\bsrc="file:\/\//i;if(t.match(n))return!0}return!1}(r,n)?{files:r}:{html:n,plainText:t,files:[]}}const nq=Symbol("requiresWrapperOnCopy");function rq(e,t,n){let r=t;const[o]=t;if(o&&n.select(Zu).getBlockType(o.name)[nq]){const{getBlockRootClientId:e,getBlockName:t,getBlockAttributes:i}=n.select(uy),s=e(o.clientId),a=t(s);a&&(r=Qu(a,i(s),r))}const i=Ld(r);e.clipboardData.setData("text/plain",function(e){e=e.replace(/
/g,"\n");return(0,ic.A)(e).trim().replace(/\n\n+/g,"\n\n")}(i)),e.clipboardData.setData("text/html",i)}function oq(){const e=(0,Up.A)(),{getBlocksByClientId:t,getSelectedBlockClientIds:n,hasMultiSelection:r,getSettings:o,getBlockName:i,__unstableIsFullySelected:s,__unstableIsSelectionCollapsed:a,__unstableIsSelectionMergeable:l,__unstableGetSelectedBlocksWithPartialSelection:c,canInsertBlockType:u,getBlockRootClientId:d}=(0,Fl.A)(uy),{flashBlock:h,removeBlocks:p,replaceBlocks:f,__unstableDeleteSelection:m,__unstableExpandSelection:g,__unstableSplitSelection:b}=(0,zl.A)(uy),v=eq();return(0,FC.A)((y=>{function _(_){if(_.defaultPrevented)return;const x=n();if(0===x.length)return;if(!r()){const{target:e}=_,{ownerDocument:t}=e;if("copy"===_.type||"cut"===_.type?(0,ZG.A)(t):(0,QG.A)(t)&&!t.activeElement.isContentEditable)return}const{activeElement:w}=_.target.ownerDocument;if(!y.contains(w))return;const k=l(),C=a()||s(),S=!C&&!k;if("copy"===_.type||"cut"===_.type)if(_.preventDefault(),1===x.length&&h(x[0]),S)g();else{let n;if(v(_.type,x),C)n=t(x);else{const[e,r]=c();n=[e,...t(x.slice(1,x.length-1)),r]}rq(_,n,e)}if("cut"===_.type)C&&!S?p(x):(_.target.ownerDocument.activeElement.contentEditable=!1,m());else if("paste"===_.type){const{__experimentalCanUserUseUnfilteredHTML:e}=o();if("true"===_.clipboardData.getData("rich-text"))return;const{plainText:t,html:n,files:a}=tq(_),l=s();let c=[];if(a.length){const e=ad("from");c=a.reduce(((t,n)=>{const r=sd(e,(e=>"files"===e.type&&e.isMatch([n])));return r&&t.push(r.transform([n])),t}),[]).flat()}else c=Dp({HTML:n,plainText:t,mode:l?"BLOCKS":"AUTO",canUserUseUnfilteredHTML:e});if("string"==typeof c)return;if(l)return f(x,c,c.length-1,-1),void _.preventDefault();if(!r()&&!Ac(i(x[0]),"splitting",!1)&&!_.__deprecatedOnSplit)return;const[h]=x,p=d(h);if(!c.every((e=>u(e.name,p))))return;b(c),_.preventDefault()}}return y.ownerDocument.addEventListener("copy",_),y.ownerDocument.addEventListener("cut",_),y.ownerDocument.addEventListener("paste",_),()=>{y.ownerDocument.removeEventListener("copy",_),y.ownerDocument.removeEventListener("cut",_),y.ownerDocument.removeEventListener("paste",_)}}),[])}function iq(){const[e,t,n]=function(){const e=(0,k.useRef)(),t=(0,k.useRef)(),n=(0,k.useRef)(),{hasMultiSelection:r,getSelectedBlockClientId:o,getBlockCount:i}=(0,Fl.A)(uy),{setNavigationMode:s,setLastFocus:a}=wf((0,zl.A)(uy)),l=(0,Fl.A)((e=>e(uy).isNavigationMode()),[]),{getLastFocus:c}=wf((0,Fl.A)(uy)),u=l?void 0:"0",d=(0,k.useRef)();function h(t){if(d.current)d.current=null;else if(r())e.current.focus();else if(o())c()?.current?c().current.focus():e.current.querySelector(`[data-block="${o()}"]`).focus();else{s(!0);const n=e.current.ownerDocument===t.target.ownerDocument?e.current:e.current.ownerDocument.defaultView.frameElement,r=t.target.compareDocumentPosition(n)&t.target.DOCUMENT_POSITION_FOLLOWING,o=NE.focus.tabbable.find(e.current);o.length&&(r?o[0]:o[o.length-1]).focus()}}const p=(0,Id.jsx)("div",{ref:t,tabIndex:u,onFocus:h}),f=(0,Id.jsx)("div",{ref:n,tabIndex:u,onFocus:h}),m=(0,FC.A)((l=>{function u(e){if(e.defaultPrevented)return;if(e.keyCode===zE.ESCAPE&&!r())return e.preventDefault(),void s(!0);if(e.keyCode!==zE.TAB)return;const i=e.shiftKey,a=i?"findPrevious":"findNext";if(!r()&&!o())return void(e.target===l&&s(!0));const c=NE.focus.tabbable[a](e.target),u=e.target.closest("[data-block]"),h=u&&c&&(WW(u,c)||GW(u,c));if((0,zW.A)(c)&&h)return;const p=i?t:n;d.current=!0,p.current.focus({preventScroll:!0})}function h(e){a({...c(),current:e.target});const{ownerDocument:t}=l;e.relatedTarget||t.activeElement!==t.body||0!==i()||l.focus()}function p(r){if(r.keyCode!==zE.TAB)return;if("region"===r.target?.getAttribute("role"))return;if(e.current===r.target)return;const o=r.shiftKey?"findPrevious":"findNext",i=NE.focus.tabbable[o](r.target);i!==t.current&&i!==n.current||(r.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:f}=l,{defaultView:m}=f;return m.addEventListener("keydown",p),l.addEventListener("keydown",u),l.addEventListener("focusout",h),()=>{m.removeEventListener("keydown",p),l.removeEventListener("keydown",u),l.removeEventListener("focusout",h)}}),[]);return[p,(0,Zk.A)([e,m]),f]}(),r=(0,Fl.A)((e=>e(uy).hasMultiSelection()),[]);return[e,(0,Zk.A)([t,oq(),XG(),GG(),YG(),JG(),MG(),$G(),VG(),(0,FC.A)((e=>{if(e.tabIndex=0,r)return e.classList.add("has-multi-selection"),e.setAttribute("aria-label",(0,U.__)("Multiple selected blocks")),()=>{e.classList.remove("has-multi-selection"),e.removeAttribute("aria-label")}}),[r])]),n]}const sq=(0,k.forwardRef)((function({children:e,...t},n){const[r,o,i]=iq();return(0,Id.jsxs)(Id.Fragment,{children:[r,(0,Id.jsx)("div",{...t,ref:(0,Zk.A)([o,n]),className:(0,Vy.A)(t.className,"block-editor-writing-flow"),children:e}),i]})}));let aq=null;function lq(e,t,n){const r={};for(const t in e)r[t]=e[t];if(e instanceof n.contentDocument.defaultView.MouseEvent){const e=n.getBoundingClientRect();r.clientX+=e.left,r.clientY+=e.top}const o=new t(e.type,r);r.defaultPrevented&&o.preventDefault(),!n.dispatchEvent(o)&&e.preventDefault()}function cq(e){return(0,FC.A)((()=>{const{defaultView:t}=e;if(!t)return;const{frameElement:n}=t,r=e.documentElement,o=["dragover","mousemove"],i={};for(const e of o)i[e]=e=>{const t=Object.getPrototypeOf(e).constructor.name;lq(e,window[t],n)},r.addEventListener(e,i[e]);return()=>{for(const e of o)r.removeEventListener(e,i[e])}}))}function uq({contentRef:e,children:t,tabIndex:n=0,scale:r=1,frameSize:o=0,readonly:i,forwardedRef:s,title:a=(0,U.__)("Editor canvas"),...l}){const{resolvedAssets:c,isPreviewMode:u}=(0,Fl.A)((e=>{const{getSettings:t}=e(uy),n=t();return{resolvedAssets:n.__unstableResolvedAssets,isPreviewMode:n.__unstableIsPreviewMode}}),[]),{styles:d="",scripts:h=""}=c,[p,f]=(0,k.useState)(),m=(0,k.useRef)(),[g,b]=(0,k.useState)([]),v=yG(),[y,_,x]=iq(),[w,{height:C}]=(0,gF.A)(),[S,{width:A}]=(0,gF.A)(),E=(0,FC.A)((e=>{let t;function n(e){e.preventDefault()}function r(){const{contentDocument:r,ownerDocument:o}=e,{documentElement:i}=r;t=r,i.classList.add("block-editor-iframe__html"),v(i),b(Array.from(o.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),r.dir=o.dir;for(const e of aq||(aq=Array.from(document.styleSheets).reduce(((e,t)=>{try{t.cssRules}catch(t){return e}const{ownerNode:n,cssRules:r}=t;if(null===n)return e;if(!r)return e;if("wp-reset-editor-styles-css"===n.id)return e;if(!n.id)return e;if(function e(t){return Array.from(t).find((({selectorText:t,conditionText:n,cssRules:r})=>n?e(r):t&&(t.includes(".editor-styles-wrapper")||t.includes(".wp-block"))))}(r)){const t="STYLE"===n.tagName;if(t){const t=n.id.replace("-inline-css","-css"),r=document.getElementById(t);r&&e.push(r.cloneNode(!0))}if(e.push(n.cloneNode(!0)),!t){const t=n.id.replace("-css","-inline-css"),r=document.getElementById(t);r&&e.push(r.cloneNode(!0))}}return e}),[]),aq))r.getElementById(e.id)||(r.head.appendChild(e.cloneNode(!0)),u||console.warn(`${e.id} was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,e));t.addEventListener("dragover",n,!1),t.addEventListener("drop",n,!1)}return e._load=()=>{f(e.contentDocument)},e.addEventListener("load",r),()=>{delete e._load,e.removeEventListener("load",r),t?.removeEventListener("dragover",n),t?.removeEventListener("drop",n)}}),[]),[I,j]=(0,k.useState)(),T=(0,FC.A)((e=>{const t=e.ownerDocument.defaultView;j(t.innerHeight);const n=()=>{j(t.innerHeight)};return t.addEventListener("resize",n),()=>{t.removeEventListener("resize",n)}}),[]),[B,R]=(0,k.useState)(),N=(0,FC.A)((e=>{const t=e.ownerDocument.defaultView;R(t.innerWidth);const n=()=>{R(t.innerWidth)};return t.addEventListener("resize",n),()=>{t.removeEventListener("resize",n)}}),[]),D=1!==r;(0,k.useEffect)((()=>{D||(m.current=A)}),[A,D]);const M=(0,gV.A)({isDisabled:!i}),P=(0,Zk.A)([cq(p),e,v,_,M,D?T:null]),O=`\n\n\t\n\t\t\n\t\t