| Server IP : 104.26.2.156 / Your IP : 216.73.216.185 Web Server : nginx/1.27.1 System : Linux us-1 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64 User : vinodai ( 3134) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /storage/v1396/themastermynd/public_html/wp-content/plugins/mailpoet/assets/dist/js/ |
Upload File : |
/*! 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,i="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=i,e&&e.exports&&(e.exports=i)}(window)},48198(e,t){var n,i;n=function(e,t){"use strict";var n,i,r="function"==typeof Map?new Map:(n=[],i=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return i[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),i.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),i.splice(t,1))}}),o=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){o=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function s(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!r.has(e)){var t=null,n=null,i=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]}),r.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",a,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",d,!1),window.addEventListener("resize",s,!1),e.addEventListener("input",d,!1),e.addEventListener("autosize:update",d,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",r.set(e,{destroy: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 i=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),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,i.forEach(function(e){e.node.scrollTop=e.scrollTop}),r&&(document.documentElement.scrollTop=r)}}function d(){u();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r<t?"hidden"===n.overflowY&&(c("scroll"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),i!==r){i=r;var s=o("autosize:resized");try{e.dispatchEvent(s)}catch(e){}}}}function a(e){var t=r.get(e);t&&t.destroy()}function l(e){var t=r.get(e);t&&t.update()}var c=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((c=function(e){return e}).destroy=function(e){return e},c.update=function(e){return e}):((c=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){return s(e)}),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],l),e}),t.default=c,e.exports=t.default},void 0===(i=n.apply(t,[e,t]))||(e.exports=i)},94325(e,t,n){"use strict";var i={};n.r(i),n.d(i,{getFormatType:()=>de,getFormatTypeForBareElement:()=>he,getFormatTypeForClassName:()=>pe,getFormatTypes:()=>ue});var r={};n.r(r),n.d(r,{addFormatTypes:()=>fe,removeFormatTypes:()=>me});var o={};n.r(o),n.d(o,{getAllBlockBindingsSources:()=>ti,getBlockBindingsSource:()=>ni,getBlockBindingsSourceFieldsList:()=>ii,getBootstrappedBlockType:()=>Qn,getSupportedStyles:()=>Zn,getUnprocessedBlockTypes:()=>ei,hasContentRoleAttribute:()=>ri});var s={};n.r(s),n.d(s,{__experimentalHasContentRoleAttribute:()=>Si,getActiveBlockVariation:()=>ui,getBlockStyles:()=>li,getBlockSupport:()=>vi,getBlockType:()=>ai,getBlockTypes:()=>si,getBlockVariations:()=>ci,getCategories:()=>hi,getChildBlockNames:()=>yi,getCollections:()=>pi,getDefaultBlockName:()=>fi,getDefaultBlockVariation:()=>di,getFreeformFallbackBlockName:()=>mi,getGroupingBlockName:()=>bi,getUnregisteredFallbackBlockName:()=>gi,hasBlockSupport:()=>_i,hasChildBlocks:()=>wi,hasChildBlocksWithInserterSupport:()=>Ci,isMatchingSearchTerm:()=>ki});var a={};n.r(a),n.d(a,{__experimentalReapplyBlockFilters:()=>Oi,addBlockCollection:()=>Gi,addBlockStyles:()=>Mi,addBlockTypes:()=>Ni,addBlockVariations:()=>Di,reapplyBlockTypeFilters:()=>Ri,removeBlockCollection:()=>qi,removeBlockStyles:()=>Pi,removeBlockTypes:()=>Li,removeBlockVariations:()=>Fi,setCategories:()=>Hi,setDefaultBlockName:()=>zi,setFreeformFallbackBlockName:()=>Vi,setGroupingBlockName:()=>$i,setUnregisteredFallbackBlockName:()=>Ui,updateCategory:()=>Wi});var l={};n.r(l),n.d(l,{addBlockBindingsSource:()=>Ji,addBootstrappedBlockType:()=>Ki,addUnprocessedBlockType:()=>Yi,removeBlockBindingsSource:()=>Xi});var c={};n.r(c),n.d(c,{getAllPatterns:()=>Up,getBlockRemovalRules:()=>Mp,getBlockSettings:()=>Sp,getBlockStyles:()=>ef,getBlockWithoutAttributes:()=>jp,getClosestAllowedInsertionPoint:()=>of,getClosestAllowedInsertionPointForPattern:()=>sf,getContentLockingParent:()=>Kp,getEditedContentOnlySection:()=>Zp,getEnabledBlockParents:()=>Op,getEnabledClientIdsTree:()=>Rp,getExpandedBlock:()=>qp,getInserterMediaCategories:()=>Fp,getInsertionPoint:()=>af,getLastFocus:()=>Wp,getLastInsertedBlocksClientIds:()=>Ep,getListViewExpandRevision:()=>_f,getParentSectionBlock:()=>Jp,getPatternBySlug:()=>Vp,getRegisteredInserterMediaCategories:()=>Dp,getRemovalPromptData:()=>Lp,getRequestedInspectorTab:()=>kf,getReusableBlocks:()=>Hp,getSectionRootClientId:()=>tf,getStyleOverrides:()=>Pp,getViewportModalClientIds:()=>xf,getZoomLevel:()=>rf,hasAllowedPatterns:()=>zp,hasBlockSpotlight:()=>pf,isBlockHiddenAnywhere:()=>lf,isBlockHiddenAtViewport:()=>df,isBlockHiddenEverywhere:()=>cf,isBlockInterfaceHidden:()=>Ip,isBlockParentHiddenAtViewport:()=>hf,isBlockParentHiddenEverywhere:()=>uf,isBlockSubtreeDisabled:()=>Tp,isContainerInsertableToInContentOnlyMode:()=>Bp,isDragging:()=>Gp,isEditLockedBlock:()=>ff,isListViewContentPanelOpen:()=>yf,isListViewPanelOpened:()=>vf,isLockedBlock:()=>bf,isMoveLockedBlock:()=>mf,isRemoveLockedBlock:()=>gf,isSectionBlock:()=>Xp,isWithinEditedContentOnlySection:()=>Qp,isZoomOut:()=>nf});var u={};n.r(u),n.d(u,{__experimentalGetActiveBlockIdByBlockNames:()=>Kg,__experimentalGetAllowedBlocks:()=>Ag,__experimentalGetAllowedPatterns:()=>Rg,__experimentalGetBlockListSettingsForBlocks:()=>zg,__experimentalGetDirectInsertBlock:()=>Eg,__experimentalGetGlobalBlocksByName:()=>om,__experimentalGetLastBlockAttributeChanges:()=>$g,__experimentalGetParsedPattern:()=>jg,__experimentalGetPatternTransformItems:()=>Mg,__experimentalGetPatternsByBlockTypes:()=>Lg,__experimentalGetReusableBlockTitle:()=>Vg,__unstableGetBlockWithoutInnerBlocks:()=>Xf,__unstableGetClientIdWithClientIdsTree:()=>Qf,__unstableGetClientIdsTree:()=>em,__unstableGetContentLockingParent:()=>rb,__unstableGetSelectedBlocksWithPartialSelection:()=>zm,__unstableGetTemporarilyEditingAsBlocks:()=>ob,__unstableGetVisibleBlocks:()=>Zg,__unstableHasActiveBlockOverlayActive:()=>Qg,__unstableIsFullySelected:()=>Mm,__unstableIsLastBlockChangeIgnored:()=>Ug,__unstableIsSelectionCollapsed:()=>Pm,__unstableIsSelectionMergeable:()=>Fm,__unstableIsWithinBlockOverlay:()=>eb,__unstableSelectionHasUnmergeableBlock:()=>Dm,areInnerBlocksControlled:()=>qg,canEditBlock:()=>gg,canInsertBlockType:()=>ug,canInsertBlocks:()=>dg,canLockBlockType:()=>bg,canMoveBlock:()=>fg,canMoveBlocks:()=>mg,canRemoveBlock:()=>hg,canRemoveBlocks:()=>pg,didAutomaticChange:()=>Wg,getAdjacentBlockClientId:()=>km,getAllowedBlocks:()=>Sg,getBlock:()=>Jf,getBlockAttributes:()=>Yf,getBlockCount:()=>lm,getBlockEditingMode:()=>tb,getBlockHierarchyRootClientId:()=>_m,getBlockIndex:()=>Um,getBlockInsertionPoint:()=>ig,getBlockListSettings:()=>Pg,getBlockMode:()=>Jm,getBlockName:()=>qf,getBlockNamesByClientId:()=>am,getBlockOrder:()=>Vm,getBlockParents:()=>ym,getBlockParentsByBlockName:()=>vm,getBlockRootClientId:()=>bm,getBlockSelectionEnd:()=>hm,getBlockSelectionStart:()=>dm,getBlockTransformItems:()=>wg,getBlocks:()=>Zf,getBlocksByClientId:()=>sm,getBlocksByName:()=>rm,getClientIdsOfDescendants:()=>tm,getClientIdsWithDescendants:()=>nm,getDirectInsertBlock:()=>Ig,getDraggedBlockClientIds:()=>Qm,getFirstMultiSelectedBlockClientId:()=>jm,getGlobalBlockCount:()=>im,getHoveredBlockClientId:()=>Xg,getInserterItems:()=>kg,getLastMultiSelectedBlockClientId:()=>Tm,getLowestCommonAncestorWithSelectedBlock:()=>xm,getMultiSelectedBlockClientIds:()=>Im,getMultiSelectedBlocks:()=>Em,getMultiSelectedBlocksEndClientId:()=>Lm,getMultiSelectedBlocksStartClientId:()=>Om,getNextBlockClientId:()=>Cm,getPatternsByBlockTypes:()=>Og,getPreviousBlockClientId:()=>wm,getSelectedBlock:()=>gm,getSelectedBlockClientId:()=>mm,getSelectedBlockClientIds:()=>Am,getSelectedBlockCount:()=>pm,getSelectedBlocksInitialCaretPosition:()=>Sm,getSelectionEnd:()=>um,getSelectionStart:()=>cm,getSettings:()=>Dg,getTemplate:()=>sg,getTemplateLock:()=>ag,hasBlockMovingClientId:()=>Hg,hasDraggedInnerBlock:()=>Wm,hasInserterItems:()=>Cg,hasMultiSelection:()=>qm,hasSelectedBlock:()=>fm,hasSelectedInnerBlock:()=>Hm,isAncestorBeingDragged:()=>tg,isAncestorMultiSelected:()=>Rm,isBlockBeingDragged:()=>eg,isBlockHighlighted:()=>Gg,isBlockInsertionPointVisible:()=>rg,isBlockMultiSelected:()=>Nm,isBlockSelected:()=>$m,isBlockValid:()=>Kf,isBlockVisible:()=>Jg,isBlockWithinSelection:()=>Gm,isCaretWithinFormattedText:()=>ng,isDraggingBlocks:()=>Zm,isFirstMultiSelectedBlock:()=>Bm,isGroupable:()=>ib,isLastBlockChangePersistent:()=>Fg,isMultiSelecting:()=>Km,isSelectionEnabled:()=>Ym,isTyping:()=>Xm,isUngroupable:()=>nb,isValidTemplate:()=>og,wasBlockJustInserted:()=>Yg});var d={};n.r(d),n.d(d,{__experimentalUpdateSettings:()=>ab,clearBlockRemovalPrompt:()=>pb,clearRequestedInspectorTab:()=>Nb,closeListViewContentPanel:()=>Eb,deleteStyleOverride:()=>gb,editContentOnlySection:()=>kb,ensureDefaultBlock:()=>db,expandBlock:()=>_b,hideBlockInterface:()=>lb,hideViewportModal:()=>Tb,openListViewContentPanel:()=>Ib,privateRemoveBlocks:()=>ub,requestInspectorTab:()=>Bb,resetZoomLevel:()=>Sb,setBlockRemovalRules:()=>fb,setInsertionPoint:()=>xb,setLastFocus:()=>bb,setStyleOverride:()=>mb,setZoomLevel:()=>Cb,showBlockInterface:()=>cb,showViewportModal:()=>jb,startDragging:()=>yb,stopDragging:()=>vb,stopEditingContentOnlySection:()=>wb,toggleBlockSpotlight:()=>Ab});var h={};n.r(h),n.d(h,{__unstableDeleteSelection:()=>py,__unstableExpandSelection:()=>my,__unstableIncrementListViewExpandRevision:()=>Xy,__unstableMarkAutomaticChange:()=>Oy,__unstableMarkLastChangeAsPersistent:()=>Ny,__unstableMarkNextChangeAsNotPersistent:()=>Ry,__unstableSaveReusableBlock:()=>By,__unstableSetAllListViewPanelsOpen:()=>Yy,__unstableSetEditorMode:()=>Ly,__unstableSetOpenListViewPanel:()=>Ky,__unstableSetTemporarilyEditingAsBlocks:()=>Hy,__unstableSplitSelection:()=>fy,__unstableToggleListViewPanel:()=>Jy,clearSelectedBlock:()=>Zb,duplicateBlocks:()=>Py,enterFormattedText:()=>Sy,exitFormattedText:()=>Ay,flashBlock:()=>Vy,hideInsertionPoint:()=>uy,hoverBlock:()=>Gb,insertAfterBlock:()=>Fy,insertBeforeBlock:()=>Dy,insertBlock:()=>ay,insertBlocks:()=>ly,insertDefaultBlock:()=>Ey,mergeBlocks:()=>gy,moveBlockToPosition:()=>sy,moveBlocksDown:()=>iy,moveBlocksToPosition:()=>oy,moveBlocksUp:()=>ry,multiSelect:()=>Xb,receiveBlocks:()=>Ub,registerInserterMediaCategory:()=>Wy,removeBlock:()=>yy,removeBlocks:()=>by,replaceBlock:()=>ty,replaceBlocks:()=>ey,replaceInnerBlocks:()=>vy,resetBlocks:()=>Fb,resetSelection:()=>Vb,selectBlock:()=>Wb,selectNextBlock:()=>Kb,selectPreviousBlock:()=>qb,selectionChange:()=>Iy,setBlockEditingMode:()=>Gy,setBlockMovingClientId:()=>My,setBlockVisibility:()=>$y,setHasControlledInnerBlocks:()=>Uy,setTemplateValidity:()=>dy,showInsertionPoint:()=>cy,startDraggingBlocks:()=>wy,startMultiSelect:()=>Yb,startTyping:()=>xy,stopDraggingBlocks:()=>Cy,stopMultiSelect:()=>Jb,stopTyping:()=>ky,synchronizeTemplate:()=>hy,toggleBlockHighlight:()=>zy,toggleBlockMode:()=>_y,toggleSelection:()=>Qb,unsetBlockEditingMode:()=>qy,updateBlock:()=>Hb,updateBlockAttributes:()=>$b,updateBlockListSettings:()=>jy,updateSettings:()=>Ty,validateBlocksToTemplate:()=>zb});var p={};n.r(p),n.d(p,{getItems:()=>Kz,getSettings:()=>Zz,isUploading:()=>Yz,isUploadingById:()=>Xz,isUploadingByUrl:()=>Jz});var f={};n.r(f),n.d(f,{getActiveImageProcessingCount:()=>lV,getActiveUploadCount:()=>sV,getAllItems:()=>Qz,getBlobUrls:()=>oV,getFailedItems:()=>uV,getItem:()=>eV,getItemProgress:()=>hV,getPausedUploadForPost:()=>iV,getPendingImageProcessing:()=>cV,getPendingUploads:()=>aV,hasPendingItemsByParentId:()=>dV,isBatchUploaded:()=>tV,isPaused:()=>rV,isUploadingToPost:()=>nV});var m={};n.r(m),n.d(m,{addItems:()=>SV,cancelItem:()=>AV,retryItem:()=>IV});var g={};n.r(g),n.d(g,{addItem:()=>TV,addSideloadItem:()=>BV,finalizeItem:()=>YV,finishOperation:()=>DV,generateThumbnails:()=>KV,getTranscodeImageOperation:()=>VV,pauseItem:()=>LV,pauseQueue:()=>RV,prepareItem:()=>UV,processItem:()=>NV,removeItem:()=>PV,resizeCropItem:()=>WV,resumeItemByPostId:()=>MV,resumeQueue:()=>OV,revokeBlobUrls:()=>JV,rotateItem:()=>GV,sideloadItem:()=>HV,transcodeImageItem:()=>qV,updateItemProgress:()=>XV,updateSettings:()=>ZV,uploadItem:()=>$V});var b={};n.r(b),n.d(b,{AdvancedPanel:()=>qF,BackgroundPanel:()=>ZE,BorderPanel:()=>lO,ColorPanel:()=>WE,DimensionsPanel:()=>ZP,FiltersPanel:()=>sF,ImageSettingsPanel:()=>E4,StateControl:()=>j4,TypographyPanel:()=>QL,useHasBackgroundPanel:()=>KE,useHasBorderPanel:()=>QR,useHasBorderPanelControls:()=>eO,useHasColorPanel:()=>BE,useHasDimensionsPanel:()=>PP,useHasFiltersPanel:()=>QD,useHasImageSettingsPanel:()=>I4,useHasTypographyPanel:()=>FL,useSettingsForBlockElement:()=>nv});var y={};n.r(y),n.d(y,{close:()=>H4,open:()=>$4,registerCommand:()=>F4,registerCommandLoader:()=>V4,unregisterCommand:()=>z4,unregisterCommandLoader:()=>U4});var v={};n.r(v),n.d(v,{getCommandLoaders:()=>G4,getCommands:()=>W4,getContext:()=>K4,isOpen:()=>q4});var _={};n.r(_),n.d(_,{setContext:()=>Y4,setLoaderLoading:()=>J4});var x={};n.r(x),n.d(x,{isLoading:()=>X4});var k={};n.r(k),n.d(k,{getBlockPatternsForPostType:()=>M6,getEditorAssets:()=>W6,getEditorSettings:()=>H6,getEntityRecordPermissions:()=>D6,getEntityRecordsPermissions:()=>P6,getHomePage:()=>V6,getNavigationFallbackId:()=>L6,getPostsPageId:()=>U6,getRegisteredPostMeta:()=>F6,getTemplateId:()=>$6,getUndoManager:()=>O6,getViewConfig:()=>q6,isCollaborationSupported:()=>G6});var w={};n.r(w),n.d(w,{__experimentalGetCurrentGlobalStylesId:()=>B9,__experimentalGetCurrentThemeBaseGlobalStyles:()=>V9,__experimentalGetCurrentThemeGlobalStylesVariations:()=>U9,__experimentalGetDirtyEntityRecords:()=>m9,__experimentalGetEntitiesBeingSaved:()=>g9,__experimentalGetEntityRecordNoResolver:()=>c9,canUser:()=>L9,canUserEditEntityRecord:()=>M9,getAuthors:()=>e9,getAutosave:()=>D9,getAutosaves:()=>P9,getBlockPatternCategories:()=>H9,getBlockPatterns:()=>$9,getCurrentTheme:()=>T9,getCurrentThemeGlobalStylesRevisions:()=>G9,getCurrentUser:()=>t9,getDefaultTemplateId:()=>q9,getEditedEntityRecord:()=>_9,getEmbedPreview:()=>R9,getEntitiesByKind:()=>i9,getEntitiesConfig:()=>r9,getEntity:()=>o9,getEntityConfig:()=>s9,getEntityRecord:()=>a9,getEntityRecordEdits:()=>b9,getEntityRecordNonTransientEdits:()=>y9,getEntityRecords:()=>h9,getEntityRecordsTotalItems:()=>p9,getEntityRecordsTotalPages:()=>f9,getLastEntityDeleteError:()=>S9,getLastEntitySaveError:()=>C9,getRawEntityRecord:()=>u9,getRedoEdit:()=>I9,getReferenceByDistinctEdits:()=>z9,getRevision:()=>J9,getRevisions:()=>K9,getSyncConnectionStatus:()=>X9,getThemeSupports:()=>N9,getUndoEdit:()=>A9,getUserPatternCategories:()=>W9,getUserQueryResults:()=>n9,hasEditsForEntityRecord:()=>v9,hasEntityRecord:()=>l9,hasEntityRecords:()=>d9,hasFetchedAutosaves:()=>F9,hasRedo:()=>j9,hasRevision:()=>Y9,hasUndo:()=>E9,isAutosavingEntityRecord:()=>x9,isDeletingEntityRecord:()=>w9,isPreviewEmbedFallback:()=>O9,isRequestingEmbedPreview:()=>Q6,isSavingEntityRecord:()=>k9});var C={};n.r(C),n.d(C,{__experimentalBatch:()=>w7,__experimentalReceiveCurrentGlobalStylesId:()=>u7,__experimentalReceiveThemeBaseGlobalStyles:()=>d7,__experimentalReceiveThemeGlobalStyleVariations:()=>h7,__experimentalSaveSpecifiedEntityEdits:()=>S7,__unstableCreateUndoLevel:()=>x7,addEntities:()=>a7,clearEntityRecordEdits:()=>y7,deleteEntityRecord:()=>g7,editEntityRecord:()=>b7,receiveAutosaves:()=>j7,receiveCurrentTheme:()=>c7,receiveCurrentUser:()=>s7,receiveDefaultTemplateId:()=>B7,receiveEmbedPreview:()=>m7,receiveEntityRecords:()=>l7,receiveNavigationFallbackId:()=>T7,receiveRevisions:()=>N7,receiveThemeGlobalStyleRevisions:()=>f7,receiveThemeSupports:()=>p7,receiveUploadPermissions:()=>A7,receiveUserPermission:()=>I7,receiveUserPermissions:()=>E7,receiveUserQuery:()=>o7,redo:()=>_7,saveEditedEntityRecord:()=>C7,saveEntityRecord:()=>k7,setSyncConnectionStatus:()=>R7,undo:()=>v7});var S={};n.r(S),n.d(S,{editMediaEntity:()=>L7,receiveEditorAssets:()=>P7,receiveEditorSettings:()=>M7,receiveRegisteredPostMeta:()=>O7,receiveViewConfig:()=>F7,setCollaborationSupported:()=>D7});var A={};n.r(A),n.d(A,{__experimentalGetCurrentGlobalStylesId:()=>ree,__experimentalGetCurrentThemeBaseGlobalStyles:()=>oee,__experimentalGetCurrentThemeGlobalStylesVariations:()=>see,canUser:()=>eee,canUserEditEntityRecord:()=>tee,getAuthors:()=>$7,getAutosave:()=>iee,getAutosaves:()=>nee,getBlockPatternCategories:()=>cee,getBlockPatterns:()=>lee,getCurrentTheme:()=>X7,getCurrentThemeGlobalStylesRevisions:()=>aee,getCurrentUser:()=>H7,getDefaultTemplateId:()=>hee,getEditedEntityRecord:()=>q7,getEditorAssets:()=>yee,getEditorSettings:()=>bee,getEmbedPreview:()=>Q7,getEntitiesConfig:()=>gee,getEntityRecord:()=>W7,getEntityRecords:()=>K7,getEntityRecordsTotalItems:()=>Y7,getEntityRecordsTotalPages:()=>J7,getNavigationFallbackId:()=>dee,getRawEntityRecord:()=>G7,getRegisteredPostMeta:()=>mee,getRevision:()=>fee,getRevisions:()=>pee,getThemeSupports:()=>Z7,getUserPatternCategories:()=>uee,getViewConfig:()=>vee});var I={};n.r(I),n.d(I,{applyStylesToAllTextInputs:()=>Mte,blocksChangedInBlockEditor:()=>Lte,changeActiveSidebar:()=>wte,changeFormBlocks:()=>ste,changeFormName:()=>ate,changeFormSettings:()=>vte,changeFormStyles:()=>dte,changePreviewSettings:()=>Cte,createCustomField:()=>Rte,createCustomFieldDone:()=>gte,createCustomFieldFailed:()=>yte,createCustomFieldStarted:()=>bte,customFieldEdited:()=>hte,deleteCustomField:()=>Ote,deleteCustomFieldDone:()=>cte,deleteCustomFieldFailed:()=>ute,deleteCustomFieldStarted:()=>lte,hidePreview:()=>Ite,historyRedo:()=>Dte,historyUndo:()=>Pte,removeNotice:()=>Ete,saveCustomField:()=>Nte,saveCustomFieldDone:()=>pte,saveCustomFieldFailed:()=>mte,saveCustomFieldStarted:()=>fte,saveForm:()=>Bte,saveFormDone:()=>_te,saveFormFailed:()=>kte,saveFormStarted:()=>xte,showPlacementSettings:()=>Ste,showPreview:()=>Ate,switchDefaultSidebarTab:()=>jte,toggleForm:()=>rte,toggleFullscreen:()=>ote,toggleInserter:()=>nte,toggleListView:()=>ite,toggleSidebar:()=>tte,toggleSidebarPanel:()=>Tte,tutorialDismissed:()=>Fte});var E={};n.r(E),n.d(E,{selectCategory:()=>NCe,selectTemplate:()=>BCe});var j={};n.r(j),n.d(j,{CALL_API:()=>Qte.p,TRACK_EVENT:()=>RCe.s});var T=n(7378),B=n(79124),N=n(80502),R=n(13722),O=n(27901),L=n(3698),M=n.n(L),P=n(89074),D=n(95924),F=n(91221),z=n(22840),V=n(43595);function U(e,t){const n={...e};return Object.entries(t).forEach(([e,t])=>{n[e]?n[e]={...n[e],to:t.to}:n[e]=t}),n}var $=(e,t)=>{const n=e?.findIndex(({id:e})=>"string"==typeof e?e===t.id:(0,V.hw)(e,t.id)),i=[...e];return-1!==n?i[n]={id:t.id,changes:U(i[n].changes,t.changes)}:i.push(t),i};var H=e=>t=>(n,i)=>void 0===n||e(i)?t(n,i):n,W=e=>t=>(n,i)=>t(n,e(i));function G(e,t){if(!e)return t;let n=!1;const i={};for(const r in t)F(e[r],t[r])?i[r]=e[r]:(n=!0,i[r]=t[r]);if(!n)return e;for(const t in e)i.hasOwnProperty(t)||(i[t]=e[t]);return i}var q=e=>t=>(n={},i)=>{const r=i[e];if(void 0===r)return n;const o=t(n[r],i);return o===n[r]?n:{...n,[r]:o}},K=n(56636),Y=n(84467);function J(e){return function(e){return e.charAt(0).toUpperCase()+e.substr(1)}(e.toLowerCase())}var X=n(85998);function Z(e,t){return 0===t?e.toLowerCase():(0,X.l3)(e,t)}function Q(e,t){return void 0===t&&(t={}),(0,X.fL)(e,(0,K.Cl)({transform:Z},t))}var ee=n(69139),te=n(38245),ne=n(99940),ie=n(99532),re=n(18994);function oe(e){(0,re.e)(e.parentNode,"node.parentNode"),e.parentNode.removeChild(e)}function se(e){const{body:t}=document.implementation.createHTMLDocument("");t.innerHTML=e;const n=t.getElementsByTagName("*");let i=n.length;for(;i--;){const e=n[i];if("SCRIPT"===e.tagName)oe(e);else{let t=e.attributes.length;for(;t--;){const{name:n}=e.attributes[t];n.startsWith("on")&&e.removeAttribute(n)}}}return t.innerHTML}function ae(e){e=se(e);const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,t.body.textContent||""}var le=(0,D.combineReducers)({formatTypes:function(e={},t){switch(t.type){case"ADD_FORMAT_TYPES":return{...e,...t.formatTypes.reduce((e,t)=>({...e,[t.name]:t}),{})};case"REMOVE_FORMAT_TYPES":return Object.fromEntries(Object.entries(e).filter(([e])=>!t.names.includes(e)))}return e}}),ce=n(74661),ue=(0,ce.A)(e=>Object.values(e.formatTypes),e=>[e.formatTypes]);function de(e,t){return e.formatTypes[t]}function he(e,t){const n=ue(e);return n.find(({className:e,tagName:n})=>null===e&&t===n)||n.find(({className:e,tagName:t})=>null===e&&"*"===t)}function pe(e,t){return ue(e).find(({className:e})=>null!==e&&` ${t} `.indexOf(` ${e} `)>=0)}function fe(e){return{type:"ADD_FORMAT_TYPES",formatTypes:Array.isArray(e)?e:[e]}}function me(e){return{type:"REMOVE_FORMAT_TYPES",names:Array.isArray(e)?e:[e]}}var ge=(0,P.A)("core/rich-text",{reducer:le,selectors:i,actions:r});function be(e,t){if(e===t)return!0;if(!e||!t)return!1;if(e.type!==t.type)return!1;const n=e.attributes,i=t.attributes;if(n===i)return!0;if(!n||!i)return!1;const r=Object.keys(n),o=Object.keys(i);if(r.length!==o.length)return!1;const s=r.length;for(let e=0;e<s;e++){const t=r[e];if(n[t]!==i[t])return!1}return!0}function ye(e){const t=e.formats.slice();return t.forEach((e,n)=>{const i=t[n-1];if(i){const r=e.slice();r.forEach((e,t)=>{const n=i[t];be(e,n)&&(r[t]=n)}),t[n]=r}}),{...e,formats:t}}function ve(e,t,n){return(e=e.slice())[t]=n,e}function _e(e,t,n=e.start,i=e.end){const{formats:r,activeFormats:o}=e,s=r.slice();if(n===i){const e=s[n]?.find(({type:e})=>e===t.type);if(e){const r=s[n].indexOf(e);for(;s[n]&&s[n][r]===e;)s[n]=ve(s[n],r,t),n--;for(i++;s[i]&&s[i][r]===e;)s[i]=ve(s[i],r,t),i++}}else{let e=1/0;for(let r=n;r<i;r++)if(s[r]){s[r]=s[r].filter(({type:e})=>e!==t.type);const n=s[r].length;n<e&&(e=n)}else s[r]=[],e=0;for(let r=n;r<i;r++)s[r].splice(e,0,t)}return ye({...e,formats:s,activeFormats:[...o?.filter(({type:e})=>e!==t.type)||[],t]})}(0,D.register)(ge);var xe=n(45003);function ke({implementation:e},t){return ke.body||(ke.body=e.createHTMLDocument("").body),ke.body.innerHTML=t,ke.body}var we="",Ce=n(35635);function Se(e,t=[]){const{formats:n,start:i,end:r,activeFormats:o}=e;if(void 0===i)return t;if(i===r){if(o)return o;const e=n[i-1]||t,r=n[i]||t;return e.length<r.length?e:r}if(!n[i])return t;const s=n.slice(i,r),a=[...s[0]];let l=s.length;for(;l--;){const e=s[l];if(!e)return t;let n=a.length;for(;n--;){const t=a[n];e.find(e=>be(t,e))||a.splice(n,1)}if(0===a.length)return t}return a||t}function Ae(e){return(0,xe.L)(ge).getFormatType(e)}function Ie(e,t){if(t)return e;const n={};for(const t in e){let i=t;t.startsWith("data-disable-rich-text-")&&(i=t.slice(23)),n[i]=e[t]}return n}function Ee({type:e,tagName:t,attributes:n,unregisteredAttributes:i,object:r,boundaryClass:o,isEditableTree:s}){const a=Ae(e);let l={};if(o&&s&&(l["data-rich-text-format-boundary"]="true"),!a)return n&&(l={...n,...l}),{type:e,attributes:Ie(l,s),object:r};l={...i,...l};for(const e in n){const t=!!a.attributes&&a.attributes[e];t?l[t]=n[e]:l[e]=n[e]}return a.className&&(l.class?l.class=`${a.className} ${l.class}`:l.class=a.className),{type:t||a.tagName,object:a.object,attributes:Ie(l,s)}}function je(e,t,n){do{if(e[n]!==t[n])return!1}while(n--);return!0}function Te({value:e,preserveWhiteSpace:t,createEmpty:n,append:i,getLastChild:r,getParent:o,isText:s,getText:a,remove:l,appendText:c,onStartIndex:u,onEndIndex:d,isEditableTree:h,placeholder:p}){const{formats:f,replacements:m,text:g,start:b,end:y}=e,v=f.length+1,_=n(),x=Se(e),k=x[x.length-1];let w,C;i(_,"");for(let e=0;e<v;e++){const n=g.charAt(e),v=h&&(!C||"\n"===C),x=f[e];let S=r(_);if(x&&x.forEach((e,t)=>{if(S&&w&&je(x,w,t))return void(S=r(S));const{type:n,tagName:c,attributes:u,unregisteredAttributes:d}=e,p=h&&e===k,f=o(S),m=i(f,Ee({type:n,tagName:c,attributes:u,unregisteredAttributes:d,boundaryClass:p,isEditableTree:h}));s(S)&&0===a(S).length&&l(S),S=i(m,"")}),0===e&&(u&&0===b&&u(_,S),d&&0===y&&d(_,S)),n===we){const t=m[e];if(!t)continue;const{type:n,attributes:r,innerHTML:s}=t,a=Ae(n);if(h&&"#comment"===n)S=i(o(S),{type:"span",attributes:{contenteditable:"false","data-rich-text-comment":r["data-rich-text-comment"]}}),i(i(S,{type:"span"}),r["data-rich-text-comment"].trim());else if(h||"script"!==n)if(!1===a?.contentEditable){if(s||h){if(S=o(S),h){const t={contenteditable:"false","data-rich-text-bogus":!0};b===e&&y===e+1&&(t["data-rich-text-format-boundary"]=!0),S=i(S,{type:"span",attributes:t}),h&&e+1===g.length&&i(o(S),"\ufeff")}S=i(S,Ee({...t,isEditableTree:h})),s&&i(S,{html:s})}}else S=i(o(S),Ee({...t,object:!0,isEditableTree:h}));else S=i(o(S),Ee({type:"script",isEditableTree:h})),i(S,{html:decodeURIComponent(r["data-rich-text-script"])});S=i(o(S),"")}else t||"\n"!==n?s(S)?c(S,n):S=i(o(S),n):(S=i(o(S),{type:"br",attributes:h?{"data-rich-text-line-break":"true"}:void 0,object:!0}),S=i(o(S),""));u&&b===e+1&&u(_,S),d&&y===e+1&&d(_,S),v&&e===g.length&&(i(o(S),"\ufeff"),p&&0===g.length&&i(o(S),{type:"span",attributes:{"data-rich-text-placeholder":p,style:"pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;"}})),w=x,C=n}return _}function Be({value:e,preserveWhiteSpace:t}){return ze(Te({value:e,preserveWhiteSpace:t,createEmpty:Ne,append:Oe,getLastChild:Re,getParent:Me,isText:Pe,getText:De,remove:Fe,appendText:Le}).children)}function Ne(){return{}}function Re({children:e}){return e&&e[e.length-1]}function Oe(e,t){return"string"==typeof t&&(t={text:t}),t.parent=e,e.children=e.children||[],e.children.push(t),t}function Le(e,t){e.text+=t}function Me({parent:e}){return e}function Pe({text:e}){return"string"==typeof e}function De({text:e}){return e}function Fe(e){const t=e.parent.children.indexOf(e);return-1!==t&&e.parent.children.splice(t,1),e}function ze(e=[]){return e.map(e=>void 0!==e.html?e.html:void 0===e.text?function({type:e,attributes:t,object:n,children:i}){if("#comment"===e)return`\x3c!--${t["data-rich-text-comment"]}--\x3e`;let r="";for(const e in t)(0,Ce.i8)(e)&&(r+=` ${e}="${(0,Ce.Gj)(t[e])}"`);return n?`<${e}${r}>`:`<${e}${r}>${ze(i)}</${e}>`}(e):(0,Ce.jG)(e.text)).join("")}function Ve({text:e}){return e.replace(we,"")}function Ue(){return{formats:[],replacements:[],text:""}}function $e({tagName:e,attributes:t}){let n;if(t&&t.class&&(n=(0,xe.L)(ge).getFormatTypeForClassName(t.class),n&&(t.class=` ${t.class} `.replace(` ${n.className} `," ").trim(),t.class||delete t.class)),n||(n=(0,xe.L)(ge).getFormatTypeForBareElement(e)),!n)return t?{type:e,attributes:t}:{type:e};if(n.__experimentalCreatePrepareEditableTree&&!n.__experimentalCreateOnChangeEditableValue)return null;if(!t)return{formatType:n,type:n.name,tagName:e};const i={},r={},o={...t};for(const e in n.attributes){const t=n.attributes[e];i[e]=o[t],delete o[t],void 0===i[e]&&delete i[e]}for(const e in o)r[e]=t[e];return!1===n.contentEditable&&delete r.contenteditable,{formatType:n,type:n.name,tagName:e,attributes:i,unregisteredAttributes:r}}var He=class e{#e;static empty(){return new e}static fromPlainText(t){return new e(We({text:t}))}static fromHTMLString(t){return new e(We({html:t}))}static fromHTMLElement(t,n={}){const{preserveWhiteSpace:i=!1}=n,r=i?t:Ke(t),o=new e(We({element:r}));return Object.defineProperty(o,"originalHTML",{value:t.innerHTML}),o}constructor(e={formats:[],replacements:[],text:""}){this.#e=e}toPlainText(){return Ve(this.#e)}toHTMLString({preserveWhiteSpace:e}={}){return this.originalHTML||Be({value:this.#e,preserveWhiteSpace:e})}valueOf(){return this.toHTMLString()}toString(){return this.toHTMLString()}toJSON(){return this.toHTMLString()}get length(){return this.text.length}get formats(){return this.#e.formats}get replacements(){return this.#e.replacements}get text(){return this.#e.text}};for(const e of Object.getOwnPropertyNames(String.prototype))He.prototype.hasOwnProperty(e)||Object.defineProperty(He.prototype,e,{value(...t){return this.toHTMLString()[e](...t)}});function We({element:e,text:t,html:n,range:i,__unstableIsEditableTree:r}={}){return n instanceof He?{text:n.text,formats:n.formats,replacements:n.replacements}:"string"==typeof t&&t.length>0?{formats:Array(t.length),replacements:Array(t.length),text:t}:("string"==typeof n&&n.length>0&&(e=ke(document,n)),"object"!=typeof e?{formats:[],replacements:[],text:""}:Je({element:e,range:i,isEditableTree:r}))}function Ge(e,t,n,i){if(!n)return;const{parentNode:r}=t,{startContainer:o,startOffset:s,endContainer:a,endOffset:l}=n,c=e.text.length;void 0!==i.start?e.start=c+i.start:t===o&&t.nodeType===t.TEXT_NODE?e.start=c+s:r===o&&t===o.childNodes[s]?e.start=c:r===o&&t===o.childNodes[s-1]?e.start=c+i.text.length:t===o&&(e.start=c),void 0!==i.end?e.end=c+i.end:t===a&&t.nodeType===t.TEXT_NODE?e.end=c+l:r===a&&t===a.childNodes[l-1]?e.end=c+i.text.length:r===a&&t===a.childNodes[l]?e.end=c:t===a&&(e.end=c+l)}function qe(e,t,n){if(!t)return;const{startContainer:i,endContainer:r}=t;let{startOffset:o,endOffset:s}=t;return e===i&&(o=n(e.nodeValue.slice(0,o)).length),e===r&&(s=n(e.nodeValue.slice(0,s)).length),{startContainer:i,startOffset:o,endContainer:r,endOffset:s}}function Ke(e,t=!0,n=!1,i=!1){const r=e.cloneNode(!0);return r.normalize(),Array.from(r.childNodes).forEach((e,r,o)=>{if(e.nodeType===e.TEXT_NODE){let s=e.nodeValue;/[\n\t\r\f]/.test(s)&&(s=s.replace(/[\n\t\r\f]+/g," ")),-1!==s.indexOf(" ")&&(s=s.replace(/ {2,}/g," ")),0===r&&s.startsWith(" ")&&(t||n)&&(s=s.slice(1)),r===o.length-1&&s.endsWith(" ")&&(t||i)&&(s=s.slice(0,-1)),e.nodeValue=s}else if(e.nodeType===e.ELEMENT_NODE){const{previousSibling:r,nextSibling:o}=e,s=r?.textContent.endsWith(" "),a=o?.textContent.startsWith(" ");e.replaceWith(Ke(e,!1,r?s:t||n,o?a:t||i))}}),r}function Ye(e){return e.replace(new RegExp(`[\ufeff${we}\r]`,"gu"),"")}function Je({element:e,range:t,isEditableTree:n}){const i={formats:[],replacements:[],text:""};if(!e)return i;if(!e.hasChildNodes())return Ge(i,e,t,{formats:[],replacements:[],text:""}),i;const r=e.childNodes.length;for(let o=0;o<r;o++){const r=e.childNodes[o],s=r.nodeName.toLowerCase();if(r.nodeType===r.TEXT_NODE){const e=Ye(r.nodeValue);Ge(i,r,t=qe(r,t,Ye),{text:e}),i.formats.length+=e.length,i.replacements.length+=e.length,i.text+=e;continue}if(r.nodeType===r.COMMENT_NODE||r.nodeType===r.ELEMENT_NODE&&"SPAN"===r.tagName&&r.hasAttribute("data-rich-text-comment")){const e={formats:[,],replacements:[{type:"#comment",attributes:{"data-rich-text-comment":r.nodeType===r.COMMENT_NODE?r.nodeValue:r.getAttribute("data-rich-text-comment")}}],text:we};Ge(i,r,t,e),Ze(i,e);continue}if(r.nodeType!==r.ELEMENT_NODE)continue;if(n&&"br"===s&&!r.getAttribute("data-rich-text-line-break")){Ge(i,r,t,Ue());continue}if("script"===s){const e={formats:[,],replacements:[{type:s,attributes:{"data-rich-text-script":r.getAttribute("data-rich-text-script")||encodeURIComponent(r.innerHTML)}}],text:we};Ge(i,r,t,e),Ze(i,e);continue}if("br"===s){Ge(i,r,t,Ue()),Ze(i,We({text:"\n"}));continue}const a=$e({tagName:s,attributes:Xe({element:r})});if(!1===a?.formatType?.contentEditable){delete a.formatType,Ge(i,r,t,Ue()),Ze(i,{formats:[,],replacements:[{...a,innerHTML:r.innerHTML}],text:we});continue}a&&delete a.formatType;const l=Je({element:r,range:t,isEditableTree:n});if(Ge(i,r,t,l),!a||r.getAttribute("data-rich-text-placeholder")||r.getAttribute("data-rich-text-bogus"))Ze(i,l);else if(0===l.text.length)a.attributes&&Ze(i,{formats:[,],replacements:[a],text:we});else{let e=function(t){if(e.formats===t)return e.newFormats;const n=t?[a,...t]:[a];return e.formats=t,e.newFormats=n,n};e.newFormats=[a],Ze(i,{...l,formats:Array.from(l.formats,e)})}}return i}function Xe({element:e}){if(!e.hasAttributes())return;const t=e.attributes.length;let n;for(let i=0;i<t;i++){const{name:t,value:r}=e.attributes[i];0!==t.indexOf("data-rich-text-")&&(n=n||{},n[/^on/i.test(t)?"data-disable-rich-text-"+t:t]=r)}return n}function Ze(e,t){return e.formats=e.formats.concat(t.formats),e.replacements=e.replacements.concat(t.replacements),e.text+=t.text,e}function Qe(e,t){return Se(e).find(({type:e})=>e===t)}function et({start:e,end:t}){if(void 0!==e&&void 0!==t)return e===t}function tt({text:e}){return 0===e.length}var nt=n(73201);function it(e,t){if("string"==typeof(t={name:e,...t}).name)if(/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(t.name))if((0,xe.L)(ge).getFormatType(t.name))window.console.error('Format "'+t.name+'" is already registered.');else if("string"==typeof t.tagName&&""!==t.tagName)if("string"==typeof t.className&&""!==t.className||null===t.className)if(/^[_a-zA-Z]+[a-zA-Z0-9_-]*$/.test(t.className)){if(null===t.className){const e=(0,xe.L)(ge).getFormatTypeForBareElement(t.tagName);if(e&&"core/unknown"!==e.name)return void window.console.error(`Format "${e.name}" is already registered to handle bare tag name "${t.tagName}".`)}else{const e=(0,xe.L)(ge).getFormatTypeForClassName(t.className);if(e)return void window.console.error(`Format "${e.name}" is already registered to handle class name "${t.className}".`)}if("title"in t&&""!==t.title)if("keywords"in t&&t.keywords.length>3)window.console.error('The format "'+t.name+'" can have a maximum of 3 keywords.');else{if("string"==typeof t.title)return(0,nt.J)(ge).addFormatTypes(t),t;window.console.error("Format titles must be strings.")}else window.console.error('The format "'+t.name+'" must have a title.')}else window.console.error("A class name must begin with a letter, followed by any number of hyphens, underscores, letters, or numbers.");else window.console.error("Format class names must be a string, or null to handle bare elements.");else window.console.error("Format tag names must be a string.");else window.console.error("Format names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-format");else window.console.error("Format names must be strings.")}function rt(e,t,n=e.start,i=e.end){const{formats:r,activeFormats:o}=e,s=r.slice();if(n===i){const e=s[n]?.find(({type:e})=>e===t);if(e){for(;s[n]?.find(t=>t===e);)ot(s,n,t),n--;for(i++;s[i]?.find(t=>t===e);)ot(s,i,t),i++}}else for(let e=n;e<i;e++)s[e]&&ot(s,e,t);return ye({...e,formats:s,activeFormats:o?.filter(({type:e})=>e!==t)||[]})}function ot(e,t,n){const i=e[t].filter(({type:e})=>e!==n);i.length?e[t]=i:delete e[t]}function st(e,t,n=e.start,i=e.end){const{formats:r,replacements:o,text:s}=e;"string"==typeof t&&(t=We({text:t}));const a=n+t.text.length;return ye({formats:r.slice(0,n).concat(t.formats,r.slice(i)),replacements:o.slice(0,n).concat(t.replacements,o.slice(i)),text:s.slice(0,n)+t.text+s.slice(i),start:a,end:a})}function at(e,t,n){return st(e,We(),t,n)}function lt(e,t,n,i){return st(e,{formats:[,],replacements:[t],text:we},n,i)}function ct(e,t=e.start,n=e.end){const{formats:i,replacements:r,text:o}=e;return void 0===t||void 0===n?{...e}:{formats:i.slice(t,n),replacements:r.slice(t,n),text:o.slice(t,n)}}function ut({formats:e,replacements:t,text:n,start:i,end:r},o){if("string"!=typeof o)return function({formats:e,replacements:t,text:n,start:i,end:r},o=i,s=r){if(void 0===i||void 0===r)return;return[{formats:e.slice(0,o),replacements:t.slice(0,o),text:n.slice(0,o)},{formats:e.slice(s),replacements:t.slice(s),text:n.slice(s),start:0,end:0}]}(...arguments);let s=0;return n.split(o).map(n=>{const a=s,l={formats:e.slice(a,a+n.length),replacements:t.slice(a,a+n.length),text:n};return s+=o.length+n.length,void 0!==i&&void 0!==r&&(i>=a&&i<s?l.start=i-a:i<a&&r>a&&(l.start=0),r>=a&&r<s?l.end=r-a:i<s&&r>s&&(l.end=n.length)),l})}var dt=n(25958);function ht(e,t){return Qe(e,t.type)?(t.title&&(0,dt.L)((0,ee.sprintf)((0,ee.__)("%s removed."),t.title),"assertive"),rt(e,t.type)):(t.title&&(0,dt.L)((0,ee.sprintf)((0,ee.__)("%s applied."),t.title),"assertive"),_e(e,t))}var pt=n(57470),{lock:ft,unlock:mt}=(0,pt.yf)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/rich-text"),gt=n(26184),bt=n(70228),yt=n(32389);function vt(e,t){return e===t||e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset}var _t="http://www.w3.org/1998/Math/MathML";function xt(e,t,n){const i=e.parentNode;let r=0;for(;e=e.previousSibling;)r++;return n=[r,...n],i!==t&&(n=xt(i,t,n)),n}function kt(e,t){for(t=[...t];e&&t.length>1;)e=e.childNodes[t.shift()];return{node:e,offset:t[0]}}function wt(e,t){if(void 0!==t.html)return e.innerHTML+=t.html;"string"==typeof t&&(t=e.ownerDocument.createTextNode(t));const{type:n,attributes:i}=t;if(n)if("#comment"===n)t=e.ownerDocument.createComment(i["data-rich-text-comment"]);else{const r=e.namespaceURI;t="math"===n?e.ownerDocument.createElementNS(_t,n):r===_t?"MTEXT"===e.tagName?e.ownerDocument.createElement(n):e.ownerDocument.createElementNS(_t,n):e.ownerDocument.createElement(n);for(const e in i)t.setAttribute(e,i[e])}return e.appendChild(t)}function Ct(e,t){e.appendData(t)}function St({lastChild:e}){return e}function At({parentNode:e}){return e}function It(e){return e.nodeType===e.TEXT_NODE}function Et({nodeValue:e}){return e}function jt(e){return e.parentNode.removeChild(e)}function Tt({value:e,current:t,prepareEditableTree:n,__unstableDomOnly:i,placeholder:r}){const{body:o,selection:s}=function({value:e,prepareEditableTree:t,isEditableTree:n=!0,placeholder:i,doc:r=document}){let o=[],s=[];t&&(e={...e,formats:t(e)});const a=Te({value:e,createEmpty:()=>ke(r,""),append:wt,getLastChild:St,getParent:At,isText:It,getText:Et,remove:jt,appendText:Ct,onStartIndex(e,t){o=xt(t,e,[t.nodeValue.length])},onEndIndex(e,t){s=xt(t,e,[t.nodeValue.length])},isEditableTree:n,placeholder:i});return{body:a,selection:{startPath:o,endPath:s}}}({value:e,prepareEditableTree:n,placeholder:r,doc:t.ownerDocument});Bt(o,t),void 0===e.start||i||function({startPath:e,endPath:t},n){const{node:i,offset:r}=kt(n,e),{node:o,offset:s}=kt(n,t),{ownerDocument:a}=n,{defaultView:l}=a,c=l.getSelection(),u=a.createRange();u.setStart(i,r),u.setEnd(o,s);const{activeElement:d}=a;if(c.rangeCount>0){if(vt(u,c.getRangeAt(0)))return;c.removeAllRanges()}c.addRange(u),d!==a.activeElement&&d instanceof l.HTMLElement&&d.focus()}(s,t)}function Bt(e,t){let n,i=0;for(;n=e.firstChild;){const r=t.childNodes[i];if(r)if(r.isEqualNode(n))e.removeChild(n);else if(r.nodeName!==n.nodeName||r.nodeType===r.TEXT_NODE&&r.data!==n.data)t.replaceChild(n,r);else{const t=r.attributes,i=n.attributes;if(t){let e=t.length;for(;e--;){const{name:i}=t[e];n.getAttribute(i)||r.removeAttribute(i)}}if(i)for(let e=0;e<i.length;e++){const{name:t,value:n}=i[e];r.getAttribute(t)!==n&&r.setAttribute(t,n)}Bt(n,r),e.removeChild(n)}else t.appendChild(n);i++}for(;t.childNodes[i];)t.removeChild(t.childNodes[i])}function Nt({record:e}){const t=(0,T.useRef)(),{activeFormats:n=[],replacements:i,start:r}=e.current,o=i[r];return(0,T.useEffect)(()=>{if(!(n&&n.length||o))return;const e="*[data-rich-text-format-boundary]",i=t.current.querySelector(e);if(!i)return;const{ownerDocument:r}=i,{defaultView:s}=r,a=s.getComputedStyle(i),l=`.rich-text:focus ${e} {background-color: ${(0,te.Mj)(a.color).alpha(.2).toRgbString()}}`,c="rich-text-boundary-style";let u=r.getElementById(c);u||(u=r.createElement("style"),u.id=c,r.head.appendChild(u)),u.innerHTML!==l&&(u.innerHTML=l)},[n,o]),t}var Rt=n(6851),Ot=[],Lt=new Set(["insertParagraph","insertOrderedList","insertUnorderedList","insertHorizontalRule","insertLink"]),Mt=[],Pt="data-rich-text-placeholder",Dt=[e=>t=>{function n(n){const{record:i}=e.current,{ownerDocument:r}=t;if(et(i.current)||!t.contains(r.activeElement))return;const o=ct(i.current),s=Ve(o),a=Be({value:o});n.clipboardData.setData("text/plain",s),n.clipboardData.setData("text/html",a),n.clipboardData.setData("rich-text","true"),n.preventDefault(),"cut"===n.type&&r.execCommand("delete")}const{defaultView:i}=t.ownerDocument;return i.addEventListener("copy",n),i.addEventListener("cut",n),()=>{i.removeEventListener("copy",n),i.removeEventListener("cut",n)}},()=>e=>{function t(t){const{target:n}=t;if(n===e||n.textContent&&n.isContentEditable)return;const{ownerDocument:i}=n,{defaultView:r}=i,o=r.getSelection();if(o.containsNode(n))return;const s=i.createRange(),a=n.isContentEditable?n:n.closest("[contenteditable]");s.selectNode(a),o.removeAllRanges(),o.addRange(s),t.preventDefault()}function n(n){n.relatedTarget&&!e.contains(n.relatedTarget)&&"A"===n.relatedTarget.tagName&&t(n)}return e.addEventListener("click",t),e.addEventListener("focusin",n),()=>{e.removeEventListener("click",t),e.removeEventListener("focusin",n)}},e=>t=>{function n(n){const{keyCode:i,shiftKey:r,altKey:o,metaKey:s,ctrlKey:a}=n;if(r||o||s||a||i!==Rt.M3&&i!==Rt.NS)return;const{record:l,applyRecord:c,forceRender:u}=e.current,{text:d,formats:h,start:p,end:f,activeFormats:m=[]}=l.current,g=et(l.current),{ownerDocument:b}=t,{defaultView:y}=b,{direction:v}=y.getComputedStyle(t),_="rtl"===v?Rt.NS:Rt.M3,x=n.keyCode===_;if(g&&0===m.length){if(0===p&&x)return;if(f===d.length&&!x)return}if(!g)return;const k=h[p-1]||Ot,w=h[p]||Ot,C=x?k:w,S=m.every((e,t)=>e===C[t]);let A=m.length;if(S?A<C.length&&A++:A--,A===m.length)return void(l.current._newActiveFormats=C);n.preventDefault();const I=(S?C:x?w:k).slice(0,A),E={...l.current,activeFormats:I};l.current=E,c(E),u()}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},e=>t=>{function n(t){const{keyCode:n}=t,{createRecord:i,handleChange:r}=e.current;if(t.defaultPrevented)return;if(n!==Rt.SJ&&n!==Rt.G_)return;const o=i(),{start:s,end:a,text:l}=o;0===s&&0!==a&&a===l.length&&(r(at(o)),t.preventDefault())}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},e=>t=>{const{ownerDocument:n}=t,{defaultView:i}=n;let r=!1;function o(t){if(r)return;let n;t&&(n=t.inputType);const{record:i,applyRecord:o,createRecord:s,handleChange:a}=e.current;if(n&&(0===n.indexOf("format")||Lt.has(n)))return void o(i.current);const l=s(),{start:c,activeFormats:u=[]}=i.current,d=!et(i.current)&&l.start<=c,h=function({value:e,start:t,end:n,formats:i}){const r=Math.min(t,n),o=Math.max(t,n),s=e.formats[r-1]||[],a=e.formats[o]||[];for(e.activeFormats=i.map((e,t)=>{if(s[t]){if(be(e,s[t]))return s[t]}else if(a[t]&&be(e,a[t]))return a[t];return e});--n>=t;)e.activeFormats.length>0?e.formats[n]=e.activeFormats:delete e.formats[n];return e}({value:l,start:c,end:l.start,formats:d?[]:u});a(h)}function s(){const{record:a,applyRecord:l,createRecord:c,onSelectionChange:u}=e.current;if("true"!==t.contentEditable)return;if(n.activeElement!==t)return void n.removeEventListener("selectionchange",s);if(r)return;const{start:d,end:h,text:p}=c(),f=a.current;if(p!==f.text)return void o();if(d===f.start&&h===f.end)return void(0===f.text.length&&0===d&&function(e){const t=e.getSelection(),{anchorNode:n,anchorOffset:i}=t;if(n.nodeType!==n.ELEMENT_NODE)return;const r=n.childNodes[i];r&&r.nodeType===r.ELEMENT_NODE&&r.hasAttribute(Pt)&&t.collapseToStart()}(i));const m={...f,start:d,end:h,activeFormats:f._newActiveFormats,_newActiveFormats:void 0},g=Se(m,Mt);m.activeFormats=g,a.current=m,l(m,{domOnly:!0}),u(d,h)}function a(){r=!0,n.removeEventListener("selectionchange",s),t.querySelector(`[${Pt}]`)?.remove()}function l(){r=!1,o({inputType:"insertText"}),n.addEventListener("selectionchange",s)}function c(){const{record:i,isSelected:r,onSelectionChange:o,applyRecord:a}=e.current;if(!t.parentElement.closest('[contenteditable="true"]')){if(r)a(i.current,{domOnly:!0});else{const e=void 0;i.current={...i.current,start:e,end:e,activeFormats:Mt}}o(i.current.start,i.current.end),window.queueMicrotask(s),n.addEventListener("selectionchange",s)}}return t.addEventListener("input",o),t.addEventListener("compositionstart",a),t.addEventListener("compositionend",l),t.addEventListener("focus",c),()=>{t.removeEventListener("input",o),t.removeEventListener("compositionstart",a),t.removeEventListener("compositionend",l),t.removeEventListener("focus",c)}},()=>e=>{const{ownerDocument:t}=e,{defaultView:n}=t,i=n?.getSelection();let r;function o(){return i.rangeCount?i.getRangeAt(0):null}function s(e){const n="keydown"===e.type?"keyup":"pointerup";function i(){t.removeEventListener(n,s),t.removeEventListener("selectionchange",i),t.removeEventListener("input",i)}function s(){i(),vt(r,o())||t.dispatchEvent(new Event("selectionchange"))}t.addEventListener(n,s),t.addEventListener("selectionchange",i),t.addEventListener("input",i),r=o()}return e.addEventListener("pointerdown",s),e.addEventListener("keydown",s),()=>{e.removeEventListener("pointerdown",s),e.removeEventListener("keydown",s)}},function(){return e=>{const{ownerDocument:t}=e,{defaultView:n}=t;let i=null;function r(t){t.defaultPrevented||t.target!==e&&t.target.contains(e)&&(i=e.getAttribute("contenteditable"),e.setAttribute("contenteditable","false"),n.getSelection().removeAllRanges())}function o(){null!==i&&(e.setAttribute("contenteditable",i),i=null)}return n.addEventListener("pointerdown",r),n.addEventListener("pointerup",o),()=>{n.removeEventListener("pointerdown",r),n.removeEventListener("pointerup",o)}}}];function Ft(e){const t=(0,T.useRef)(e);(0,T.useInsertionEffect)(()=>{t.current=e});const n=(0,T.useMemo)(()=>Dt.map(e=>e(t)),[t]);return(0,bt.A)(e=>{const t=n.map(t=>t(e));return()=>{t.forEach(e=>e())}},[n])}var zt=n(51751),Vt=n(59717);function Ut(e){return e(ge).getFormatTypes()}var $t=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function Ht(e,t){return e[t]?e[t]:Object.keys(e).filter(e=>e.startsWith(t+".")).reduce((n,i)=>(n[i.slice(t.length+1)]=e[i],n),{})}function Wt({value:e="",selectionStart:t,selectionEnd:n,placeholder:i,onSelectionChange:r,preserveWhiteSpace:o,onChange:s,__unstableDisableFormats:a,__unstableIsSelected:l,__unstableDependencies:c=[],__unstableAfterParse:u,__unstableBeforeSerialize:d,__unstableAddInvisibleFormats:h}){const p=(0,yt.A)(),[,f]=(0,T.useReducer)(()=>({})),m=(0,T.useRef)();function g(e,{domOnly:t}={}){Tt({value:e,current:m.current,prepareEditableTree:h,__unstableDomOnly:t,placeholder:i})}const b=(0,T.useRef)(e),y=(0,T.useRef)();function v(){const i=y.current?.activeFormats;b.current=e,y.current=e,e instanceof He||(y.current=e?He.fromHTMLString(e,{preserveWhiteSpace:o}):He.empty()),y.current={text:y.current.text,formats:y.current.formats,replacements:y.current.replacements,activeFormats:i},a&&(y.current.formats=Array(e.length),y.current.replacements=Array(e.length)),u&&(y.current.formats=u(y.current)),y.current.start=t,y.current.end=n}const _=(0,T.useRef)(!1);function x(t){if(y.current=t,g(t),a)b.current=t.text;else{const n=d?d(t):t.formats;t={...t,formats:n},b.current="string"==typeof e?Be({value:t,preserveWhiteSpace:o}):new He(t)}const{start:n,end:i,formats:l,text:c}=y.current;p.batch(()=>{r(n,i),s(b.current,{__unstableFormats:l,__unstableText:c})}),f()}function k(){const t=b.current;v();const n=t&&"string"==typeof t&&"string"==typeof e&&t.length!==e.length,i=m.current?.contains(m.current.ownerDocument.activeElement),r=n&&!i;g(y.current,{domOnly:r})}y.current?t===y.current.start&&n===y.current.end||(_.current=l,y.current={...y.current,start:t,end:n,activeFormats:void 0}):(_.current=l,v());const w=(0,T.useRef)(!1);(0,T.useLayoutEffect)(()=>{w.current&&e!==b.current&&(k(),f())},[e]),(0,T.useLayoutEffect)(()=>{_.current&&(m.current.ownerDocument.activeElement!==m.current&&m.current.focus(),g(y.current),_.current=!1)},[_.current]);const C=(0,gt.A)([m,(0,T.useCallback)(e=>{e&&(e.style.whiteSpace=e.style.whiteSpace||"pre-wrap")},[]),Nt({record:y}),Ft({record:y,handleChange:x,applyRecord:g,createRecord:function(){const{ownerDocument:{defaultView:e}}=m.current,t=e.getSelection(),n=t.rangeCount>0?t.getRangeAt(0):null;return We({element:m.current,range:n,__unstableIsEditableTree:!0})},isSelected:l,onSelectionChange:r,forceRender:f}),(0,bt.A)(()=>{k(),w.current=!0},[i,...c])]);return{value:y.current,getValue:()=>y.current,onChange:x,ref:C}}var Gt={};ft(Gt,{useRichText:function({allowedFormats:e,withoutInteractiveFormatting:t,onChange:n,__unstableDependencies:i=[],__unstableFormatTypeHandlerContext:r,...o}){const{formatTypes:s,prepareHandlers:a,valueHandlers:l,changeHandlers:c,dependencies:u}=function({allowedFormats:e,withoutInteractiveFormatting:t,__unstableFormatTypeHandlerContext:n}){const i=(0,zt.A)(Ut,[]),r=(0,T.useMemo)(()=>i.filter(({name:n,interactive:i,tagName:r})=>!(e&&!e.includes(n)||t&&(i||$t.has(r)))),[i,e,t]),o=(0,zt.A)(e=>r.reduce((t,i)=>{return i.__experimentalGetPropsForEditableTreePreparation&&n?{...t,...(r=i.__experimentalGetPropsForEditableTreePreparation(e,n),o=i.name,"object"!=typeof r?{[o]:r}:Object.fromEntries(Object.entries(r).map(([e,t])=>[`${o}.${e}`,t])))}:t;var r,o},{}),[r,n]),s=(0,Vt.A)(),a=[],l=[],c=[],u=[];for(const e in o)u.push(o[e]);return r.forEach(e=>{if(e.__experimentalCreatePrepareEditableTree&&n){const t=e.__experimentalCreatePrepareEditableTree(Ht(o,e.name),n);e.__experimentalCreateOnChangeEditableValue?l.push(t):a.push(t)}if(e.__experimentalCreateOnChangeEditableValue&&n){let t={};e.__experimentalGetPropsForEditableTreeChangeHandler&&(t=e.__experimentalGetPropsForEditableTreeChangeHandler(s,n));const i=Ht(o,e.name);c.push(e.__experimentalCreateOnChangeEditableValue({..."object"==typeof i?i:{},...t},n))}}),{formatTypes:r,prepareHandlers:a,valueHandlers:l,changeHandlers:c,dependencies:u}}({allowedFormats:e,withoutInteractiveFormatting:t,__unstableFormatTypeHandlerContext:r});return{...Wt({...o,onChange(e,{__unstableFormats:t,__unstableText:i}){n(e,{__unstableFormats:t,__unstableText:i}),Object.values(c).forEach(e=>{e(t,i)})},__unstableDependencies:[...u,...i],__unstableAfterParse:function(e){return l.reduce((t,n)=>n(t,e.text),e.formats)},__unstableBeforeSerialize:function(e){return s.forEach(t=>{t.__experimentalCreatePrepareEditableTree&&(e=rt(e,t.name,0,e.text.length))}),e.formats},__unstableAddInvisibleFormats:function(e){return a.reduce((t,n)=>n(t,e.text),e.formats)}}),formatTypes:s}}});var qt=n(29648);function Kt(e){if(!e.collapsed){const t=Array.from(e.getClientRects());if(1===t.length)return t[0];const n=t.filter(({width:e})=>e>1);if(0===n.length)return e.getBoundingClientRect();if(1===n.length)return n[0];let{top:i,bottom:r,left:o,right:s}=n[0];for(const{top:e,bottom:t,left:a,right:l}of n)e<i&&(i=e),t>r&&(r=t),a<o&&(o=a),l>s&&(s=l);return new window.DOMRect(o,i,s-o,r-i)}const{startContainer:t}=e,{ownerDocument:n}=t;if("BR"===t.nodeName){const{parentNode:i}=t;(0,re.e)(i,"parentNode");const r=Array.from(i.childNodes).indexOf(t);(0,re.e)(n,"ownerDocument"),(e=n.createRange()).setStart(i,r),e.setEnd(i,r)}const i=e.getClientRects();if(i.length>1)return null;let r=i[0];if(!r||0===r.height){(0,re.e)(n,"ownerDocument");const t=n.createTextNode("");(e=e.cloneRange()).insertNode(t),r=e.getClientRects()[0],(0,re.e)(t.parentNode,"padNode.parentNode"),t.parentNode.removeChild(t)}return r}function Yt(e,t){return{contextElement:t,getBoundingClientRect:()=>t.contains(e.startContainer)?Kt(e)??e.getBoundingClientRect():t.getBoundingClientRect()}}function Jt(e,t,n){if(!e)return;const{ownerDocument:i}=e,{defaultView:r}=i,o=r?.getSelection();if(!o)return;if(!o.rangeCount)return;const s=o.getRangeAt(0);return s&&s.startContainer?t||n?function(e,t,n,i){let r=e.startContainer;if(r.nodeType===r.TEXT_NODE&&r instanceof window.Text&&e.startOffset===r.length&&r.nextSibling)for(r=r.nextSibling;r.firstChild;)r=r.firstChild;if(r.nodeType!==r.ELEMENT_NODE){if(!r.parentElement)return;r=r.parentElement}if(r===t)return;if(!t.contains(r))return;const o=n+(i?"."+i:"");if(!o)return;if(!(r instanceof window.HTMLElement))return;let s=r;for(;s&&s!==t;){if(s.matches(o))return s;s=s.parentElement}}(s,e,t,n)??Yt(s,e):Yt(s,e):void 0}var Xt={tagName:"",className:""};function Zt({editableContentElement:e,settings:t}){const{tagName:n,className:i}=t??Xt,r=!!(t&&"isActive"in t&&t.isActive),[o,s]=(0,T.useState)(()=>Jt(e,n,i??"")),a=(0,qt.A)(r);return(0,T.useLayoutEffect)(()=>{if(!e)return;function t(){s(Jt(e,n,i??""))}function o(){c.addEventListener("selectionchange",t)}function l(){c.removeEventListener("selectionchange",t)}const{ownerDocument:c}=e;return(e===c.activeElement||!a&&r||a&&!r)&&(s(Jt(e,n,i??"")),o()),e.addEventListener("focusin",o),e.addEventListener("focusout",l),()=>{l(),e.removeEventListener("focusin",o),e.removeEventListener("focusout",l)}},[e,n,i,r,a]),o}var Qt=n(99843),en="block-default",tn=["attributes","supports","save","migrate","isEligible","apiVersion"],nn={"--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},backgroundGradient:{value:["background","gradient"],support:["background","gradient"],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},height:{value:["dimensions","height"],support:["dimensions","height"],useEngine:!0},width:{value:["dimensions","width"],support:["dimensions","width"],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},textIndent:{value:["typography","textIndent"],support:["typography","textIndent"],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}},rn={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",select:"select",textInput:"textarea, input:where([type=email],[type=number],[type=password],[type=search],[type=tel],[type=text],[type=url])"},on={"color.duotone":!0,"color.gradients":!0,"color.palette":!0,"dimensions.aspectRatios":!0,"typography.fontSizes":!0,"spacing.spacingSizes":!0},sn=n(52008);const an=JSON.parse('{"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"]}]}');var{lock:ln,unlock:cn}=(0,pt.yf)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/blocks");function un(e){return null!==e&&"object"==typeof e}function dn({textdomain:e,...t}){const n=["apiVersion","title","category","parent","ancestor","icon","description","keywords","attributes","providesContext","usesContext","selectors","supports","styles","example","variations","blockHooks","allowedBlocks"],i=Object.fromEntries(Object.entries(t).filter(([e])=>n.includes(e)));return e&&Object.keys(an).forEach(t=>{i[t]&&(i[t]=pn(an[t],i[t],e))}),i}function hn(e,t){const n=un(e)?e.name:e;if("string"!=typeof n)return void(0,sn.A)("Block names must be strings.");if(!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(n))return void(0,sn.A)("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,xe.L)(Zi).getBlockType(n))return void(0,sn.A)('Block "'+n+'" is already registered.');const{addBootstrappedBlockType:i,addUnprocessedBlockType:r}=cn((0,nt.J)(Zi));return un(e)&&i(n,dn(e)),r(n,t),(0,xe.L)(Zi).getBlockType(n)}function pn(e,t,n){return"string"==typeof e&&"string"==typeof t?(0,ee._x)(t,e,n):Array.isArray(e)&&e.length&&Array.isArray(t)?t.map(t=>pn(e[0],t,n)):un(e)&&Object.entries(e).length&&un(t)?Object.keys(t).reduce((i,r)=>e[r]?(i[r]=pn(e[r],t[r],n),i):(i[r]=t[r],i),{}):t}function fn(){return(0,xe.L)(Zi).getFreeformFallbackBlockName()}function mn(){return(0,xe.L)(Zi).getUnregisteredFallbackBlockName()}function gn(){return(0,xe.L)(Zi).getDefaultBlockName()}function bn(e){return(0,xe.L)(Zi)?.getBlockType(e)}function yn(){return(0,xe.L)(Zi).getBlockTypes()}function vn(e,t,n){return(0,xe.L)(Zi).getBlockSupport(e,t,n)}function _n(e,t,n){return(0,xe.L)(Zi).hasBlockSupport(e,t,n)}function xn(e){return"core/block"===e?.name}function kn(e){return"core/template-part"===e?.name}var wn=(e,t)=>(0,xe.L)(Zi).getBlockVariations(e,t);function Cn(e){return cn((0,xe.L)(Zi)).getBlockBindingsSource(e)}(0,te.X$)([ne.A,ie.A]);var Sn=["#191e23","#f8f9f9"];function An(e,t){const n=bn(e.name)?.attributes??{},i=t?Object.entries(n).filter(([n,i])=>"content"===t&&"metadata"===n?Object.keys(e.attributes[n]?.bindings??{}).length>0:i.role===t||i.__experimentalRole===t):[];return(i.length?i:Object.entries(n)).every(([t,n])=>{const i=e.attributes[t];return n.hasOwnProperty("default")?i===n.default:"rich-text"===n.type?!i?.length:void 0===i})}function In(e,t){return e.name===gn()&&An(e,t)}function En(e){return!!e&&("string"==typeof e||(0,T.isValidElement)(e)||"function"==typeof e||e instanceof T.Component)}function jn(e){return"string"==typeof e?bn(e):e}function Tn(e,t,n="visual"){const{__experimentalLabel:i,title:r}=e,o=i&&i(t,{context:n});return o?o.toPlainText?o.toPlainText():ae(o):r}function Bn(e){return void 0!==e.default?e.default:"rich-text"===e.type?new He:void 0}function Nn(e){return void 0!==bn(e)}function Rn(e,t){const n=bn(e);if(void 0===n)throw new Error(`Block type '${e}' is not registered.`);return Object.entries(n.attributes).reduce((e,[n,i])=>{const r=t[n];if(void 0!==r)"rich-text"===i.type?r instanceof He?e[n]=r:"string"==typeof r&&(e[n]=He.fromHTMLString(r)):"string"===i.type&&r instanceof He?e[n]=r.toHTMLString():e[n]=r;else{const t=Bn(i);void 0!==t&&(e[n]=t)}return-1!==["node","children"].indexOf(i.source??"")&&("string"==typeof e[n]?e[n]=[e[n]]:Array.isArray(e[n])||(e[n]=[])),e},{})}function On(e,t){const n=Array.isArray(t)?t:[t];return Object.fromEntries(Object.entries(e).filter(([e])=>!n.includes(e)))}var Ln=[{slug:"text",title:(0,ee.__)("Text")},{slug:"media",title:(0,ee.__)("Media")},{slug:"design",title:(0,ee.__)("Design")},{slug:"widgets",title:(0,ee.__)("Widgets")},{slug:"theme",title:(0,ee.__)("Theme")},{slug:"embed",title:(0,ee.__)("Embeds")},{slug:"reusable",title:(0,ee.__)("Reusable blocks")}];function Mn(e){return e.reduce((e,t)=>({...e,[t.name]:t}),{})}function Pn(e){return e.reduce((e,t)=>(e.some(e=>e.name===t.name)||e.push(t),e),[])}function Dn(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}}var Fn=Dn("SET_DEFAULT_BLOCK_NAME"),zn=Dn("SET_FREEFORM_FALLBACK_BLOCK_NAME"),Vn=Dn("SET_UNREGISTERED_FALLBACK_BLOCK_NAME"),Un=Dn("SET_GROUPING_BLOCK_NAME");function $n(e=[],t=[]){const n=Array.from(new Set(e.concat(t)));return n.length>0?n:void 0}var Hn=(0,D.combineReducers)({bootstrappedBlockTypes:function(e={},t){switch(t.type){case"ADD_BOOTSTRAPPED_BLOCK_TYPE":const{name:n,blockType:i}=t;if(e[n])return e;const r=Object.fromEntries(Object.entries(i).filter(([,e])=>null!=e).map(([e,t])=>[Q(e),t]));return r.name=n,{...e,[n]:r};case"REMOVE_BLOCK_TYPES":return On(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 On(e,t.names)}return e},blockTypes:function(e={},t){switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Mn(t.blockTypes)};case"REMOVE_BLOCK_TYPES":return On(e,t.names)}return e},blockStyles:function(e={},t){switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Object.fromEntries(Object.entries(Mn(t.blockTypes)).map(([t,n])=>[t,Pn([...(n.styles??[]).map(e=>({...e,source:"block"})),...(e[n.name]??[]).filter(({source:e})=>"block"!==e)])]))};case"ADD_BLOCK_STYLES":const n={};return t.blockNames.forEach(i=>{n[i]=Pn([...e[i]??[],...t.styles])}),{...e,...n};case"REMOVE_BLOCK_STYLES":return{...e,[t.blockName]:(e[t.blockName]??[]).filter(e=>-1===t.styleNames.indexOf(e.name))}}return e},blockVariations:function(e={},t){switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Object.fromEntries(Object.entries(Mn(t.blockTypes)).map(([t,n])=>[t,Pn([...(n.variations??[]).map(e=>({...e,source:"block"})),...(e[n.name]??[]).filter(({source:e})=>"block"!==e)])]))};case"ADD_BLOCK_VARIATIONS":return{...e,[t.blockName]:Pn([...e[t.blockName]??[],...t.variations])};case"REMOVE_BLOCK_VARIATIONS":return{...e,[t.blockName]:(e[t.blockName]??[]).filter(e=>-1===t.variationNames.indexOf(e.name))}}return e},defaultBlockName:Fn,freeformFallbackBlockName:zn,unregisteredFallbackBlockName:Vn,groupingBlockName:Un,categories:function(e=Ln,t){switch(t.type){case"SET_CATEGORIES":const n=new Map;return(t.categories||[]).forEach(e=>{n.set(e.slug,e)}),[...n.values()];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 On(e,t.namespace)}return e},blockBindingsSources:function(e={},t){switch(t.type){case"ADD_BLOCK_BINDINGS_SOURCE":return{...e,[t.name]:{label:t.label||e[t.name]?.label,usesContext:$n(e[t.name]?.usesContext,t.usesContext),getValues:t.getValues,setValues:t.setValues,canUserEditValue:t.setValues&&t.canUserEditValue,getFieldsList:t.getFieldsList}};case"REMOVE_BLOCK_BINDINGS_SOURCE":return On(e,t.name)}return e}}),Wn=n(38986),Gn=(e,t,n)=>{const i=Array.isArray(t)?t:t.split(".");let r=e;return i.forEach(e=>{r=r?.[e]}),r??n};function qn(e){return"object"==typeof e&&null!==e&&e.constructor===Object}function Kn(e,t){return qn(e)&&qn(t)?Object.entries(t).every(([t,n])=>Kn(e?.[t],n)):e===t}var Yn=n(82639),Jn=["background","backgroundColor","color","linkColor","captionColor","buttonColor","headingColor","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","padding","contentSize","wideSize","blockGap","textAlign","textDecoration","textIndent","textTransform","letterSpacing"];function Xn(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||"textIndent"===e&&!t||"textColumns"===e&&!t))}var Zn=(0,ce.A)((e,t,n)=>{if(!t)return Xn(Jn,t,n);const i=ai(e,t);if(!i)return[];const r=[],o=i?.supports;o?.spacing?.blockGap&&r.push("blockGap"),o?.shadow&&r.push("shadow");const s=nn;return Object.keys(s).forEach(e=>{s[e].support&&(s[e].requiresOptOut&&o&&s[e].support[0]in o&&!1!==Gn(o,s[e].support)||o&&Gn(o,s[e].support,!1))&&r.push(e)}),Xn(r,t,n)},(e,t)=>[e.blockTypes[t]]);function Qn(e,t){return e.bootstrappedBlockTypes[t]}function ei(e){return e.unprocessedBlockTypes}function ti(e){return e.blockBindingsSources}function ni(e,t){return e.blockBindingsSources[t]}var ii=(0,Yn.N)(e=>(0,ce.A)((t,n,i)=>{if(!n.getFieldsList)return[];const r={};if(n?.usesContext?.length)for(const e of n.usesContext)r[e]=i[e];return n.getFieldsList({select:e,context:r})},(e,t,n)=>[t.getFieldsList,t.usesContext,n])),ri=(e,t)=>{const n=ai(e,t);return!!n&&Object.values(n.attributes).some(({role:e,__experimentalRole:n})=>"content"===e||"content"===n&&((0,Qt.A)("__experimentalRole attribute",{since:"6.7",version:"6.8",alternative:"role attribute",hint:`Check the block.json of the ${t} block.`}),!0))},oi=(e,t)=>"string"==typeof t?ai(e,t):t,si=(0,ce.A)(e=>Object.values(e.blockTypes),e=>[e.blockTypes]);function ai(e,t){return e.blockTypes[t]}function li(e,t){return e.blockStyles[t]}var ci=(0,ce.A)((e,t,n)=>{const i=e.blockVariations[t];return i&&n?i.filter(e=>(e.scope||["block","inserter"]).includes(n)):i},(e,t)=>[e.blockVariations[t]]);function ui(e,t,n,i){const r=ci(e,t,i);if(!r)return r;const o=ai(e,t),s=Object.keys(o?.attributes||{});let a,l=0;for(const e of r)if(Array.isArray(e.isActive)){const t=e.isActive.filter(e=>{const t=e.split(".")[0];return s.includes(t)}),i=t.length;if(0===i)continue;t.every(t=>{const i=Gn(e.attributes,t);if(void 0===i)return!1;let r=Gn(n,t);return r instanceof He&&(r=r.toHTMLString()),Kn(r,i)})&&i>l&&(a=e,l=i)}else if(e.isActive?.(n,e.attributes))return a||e;return!a&&["block","transform"].includes(i)&&(a=r.find(e=>e?.isDefault&&!Object.hasOwn(e,"isActive"))),a}function di(e,t,n){const i=ci(e,t,n);return[...i||[]].reverse().find(({isDefault:e})=>!!e)||i?.[0]}function hi(e){return e.categories}function pi(e){return e.collections}function fi(e){return e.defaultBlockName}function mi(e){return e.freeformFallbackBlockName}function gi(e){return e.unregisteredFallbackBlockName}function bi(e){return e.groupingBlockName}var yi=(0,ce.A)((e,t)=>si(e).filter(e=>e.parent?.includes(t)).map(({name:e})=>e),e=>[e.blockTypes]),vi=(e,t,n,i)=>{const r=oi(e,t);return r?.supports?Gn(r.supports,n,i):i};function _i(e,t,n,i){return!!vi(e,t,n,i)}function xi(e){return Wn(e??"").toLowerCase().trim()}function ki(e,t,n=""){const i=oi(e,t),r=xi(n),o=e=>xi(e).includes(r);return o(i?.title)||i?.keywords?.some(o)||o(i?.category)||"string"==typeof i?.description&&o(i.description)}var wi=(e,t)=>yi(e,t).length>0,Ci=(e,t)=>yi(e,t).some(t=>_i(e,t,"inserter",!0)),Si=(...e)=>((0,Qt.A)("__experimentalHasContentRoleAttribute",{since:"6.7",version:"6.8",hint:"This is a private selector."}),ri(...e)),Ai=n(94260),Ii=n(74448),Ei=n(47523),ji={common:"text",formatting:"text",layout:"design"};function Ti(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}var Bi=(e,t)=>({select:n})=>{const i=n.getBootstrappedBlockType(e),r={apiVersion:1,name:e,icon:en,keywords:[],attributes:{},providesContext:{},usesContext:[],selectors:{},supports:{},styles:[],blockHooks:{},save:()=>null,...i,...t,variations:Ti(Array.isArray(i?.variations)?i.variations:[],Array.isArray(t?.variations)?t.variations:[])};r.attributes&&"object"==typeof r.attributes||((0,sn.A)('The block "'+e+'" is registering attributes as `null` or `undefined`. Use an empty object (`attributes: {}`) or exclude the `attributes` key.'),r.attributes={});const o=(0,Ei.W5)("blocks.registerBlockType",r,e,null);if(o.apiVersion<=2&&(0,Qt.A)("Block with API version 2 or lower",{since:"6.9",hint:`The block "${e}" is registered with API version ${o.apiVersion}. This means that the post editor may work as a non-iframe editor. Since all editors are planned to work as iframes in the future, set the \`apiVersion\` field to 3 and test the block inside the iframe editor.`,link:"https://developer.wordpress.org/block-editor/reference-guides/block-api/block-api-versions/block-migration-for-iframe-editor-compatibility/"}),o.description&&"string"!=typeof o.description&&(0,Qt.A)("Declaring non-string block descriptions",{since:"6.2"}),o.deprecated&&(o.deprecated=o.deprecated.map(e=>Object.fromEntries(Object.entries((0,Ei.W5)("blocks.registerBlockType",{...On(r,tn),...e},r.name,e)).filter(([e])=>tn.includes(e))))),(0,Ai.Q)(o))if("function"==typeof o.save)if(!("edit"in o)||(0,Ii.isValidElementType)(o.edit))if(ji.hasOwnProperty(o.category)&&(o.category=ji[o.category]),"category"in o&&!n.getCategories().some(({slug:e})=>e===o.category)&&((0,sn.A)('The block "'+e+'" is registered with an invalid category "'+o.category+'".'),delete o.category),"title"in o&&""!==o.title)if("string"==typeof o.title)if(o.icon=function(e){const t=e||en;if(En(t))return{src:t};const n=t;if("background"in n){const e=(0,te.Mj)(n.background),t=t=>e.contrast(t),i=Math.max(...Sn.map(t));return{...n,foreground:n.foreground?n.foreground:Sn.find(e=>t(e)===i),shadowColor:e.alpha(.3).toRgbString()}}return n}(o.icon),En(o.icon.src))if(("string"==typeof o?.parent||o?.parent instanceof String)&&(o.parent=[o.parent],(0,sn.A)("Parent must be undefined or an array of strings (block types), but it is a string.")),Array.isArray(o?.parent)||void 0===o?.parent){if(1!==o?.parent?.length||e!==o.parent[0])return o;(0,sn.A)('Block "'+e+'" cannot be a parent of itself. Please remove the block name from the parent list.')}else(0,sn.A)("Parent must be undefined or an array of block types, but it is "+o.parent);else(0,sn.A)("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(0,sn.A)("Block titles must be strings.");else(0,sn.A)('The block "'+e+'" must have a title.');else(0,sn.A)('The "edit" property must be a valid component.');else(0,sn.A)('The "save" property must be a valid function.');else(0,sn.A)("Block settings must be a valid object.")};function Ni(e){return{type:"ADD_BLOCK_TYPES",blockTypes:Array.isArray(e)?e:[e]}}function Ri(){return({dispatch:e,select:t})=>{const n=[];for(const[i,r]of Object.entries(t.getUnprocessedBlockTypes())){const t=e(Bi(i,r));t&&n.push(t)}n.length&&e.addBlockTypes(n)}}function Oi(){return(0,Qt.A)('wp.data.dispatch( "core/blocks" ).__experimentalReapplyBlockFilters',{since:"6.4",alternative:"reapplyBlockFilters"}),Ri()}function Li(e){return{type:"REMOVE_BLOCK_TYPES",names:Array.isArray(e)?e:[e]}}function Mi(e,t){return{type:"ADD_BLOCK_STYLES",styles:Array.isArray(t)?t:[t],blockNames:Array.isArray(e)?e:[e]}}function Pi(e,t){return{type:"REMOVE_BLOCK_STYLES",styleNames:Array.isArray(t)?t:[t],blockName:e}}function Di(e,t){return{type:"ADD_BLOCK_VARIATIONS",variations:Array.isArray(t)?t:[t],blockName:e}}function Fi(e,t){return{type:"REMOVE_BLOCK_VARIATIONS",variationNames:Array.isArray(t)?t:[t],blockName:e}}function zi(e){return{type:"SET_DEFAULT_BLOCK_NAME",name:e}}function Vi(e){return{type:"SET_FREEFORM_FALLBACK_BLOCK_NAME",name:e}}function Ui(e){return{type:"SET_UNREGISTERED_FALLBACK_BLOCK_NAME",name:e}}function $i(e){return{type:"SET_GROUPING_BLOCK_NAME",name:e}}function Hi(e){return{type:"SET_CATEGORIES",categories:e}}function Wi(e,t){return{type:"UPDATE_CATEGORY",slug:e,category:t}}function Gi(e,t,n){return{type:"ADD_BLOCK_COLLECTION",namespace:e,title:t,icon:n}}function qi(e){return{type:"REMOVE_BLOCK_COLLECTION",namespace:e}}function Ki(e,t){return{type:"ADD_BOOTSTRAPPED_BLOCK_TYPE",name:e,blockType:t}}function Yi(e,t){return({dispatch:n})=>{n({type:"ADD_UNPROCESSED_BLOCK_TYPE",name:e,blockType:t});const i=n(Bi(e,t));i&&n.addBlockTypes(i)}}function Ji(e){return{type:"ADD_BLOCK_BINDINGS_SOURCE",name:e.name,label:e.label,usesContext:e.usesContext,getValues:e.getValues,setValues:e.setValues,canUserEditValue:e.canUserEditValue,getFieldsList:e.getFieldsList}}function Xi(e){return{type:"REMOVE_BLOCK_BINDINGS_SOURCE",name:e}}var Zi=(0,P.A)("core/blocks",{reducer:Hn,selectors:s,actions:a});(0,D.register)(Zi),cn(Zi).registerPrivateSelectors(o),cn(Zi).registerPrivateActions(l);var Qi=n(32948);function er(e,t={},n=[]){if(!Nn(e))return er("core/missing",{originalName:e,originalContent:"",originalUndelimitedContent:""});const i=Rn(e,t);return{clientId:(0,Qi.A)(),name:e,isValid:!0,attributes:i,innerBlocks:n}}function tr(e=[]){return e.map(e=>{const t=Array.isArray(e)?e:[e.name,e.attributes,e.innerBlocks],[n,i,r=[]]=t;return er(n,i,tr(r))})}function nr(e,t={},n){const{name:i}=e;if(!Nn(i))return er("core/missing",{originalName:i,originalContent:"",originalUndelimitedContent:""});const r=(0,Qi.A)(),o=Rn(i,{...e.attributes,...t});return{...e,clientId:r,attributes:o,innerBlocks:n||e.innerBlocks.map(e=>nr(e))}}function ir(e,t={},n){const i=(0,Qi.A)();return{...e,clientId:i,attributes:{...e.attributes,...t},innerBlocks:n||e.innerBlocks.map(e=>ir(e))}}var rr=(e,t,n)=>{if(!n.length)return!1;const i=n.length>1,r=n[0].name;if(!or(e)&&i&&!e.isMultiBlock)return!1;if(!or(e)&&!n.every(e=>e.name===r))return!1;if("block"!==e.type)return!1;const o=n[0];return!("from"===t&&-1===e.blocks.indexOf(o.name)&&!or(e)||!i&&"from"===t&&sr(o.name)&&sr(e.blockName)||!cr(e,n))},or=e=>!!e&&"block"===e.type&&Array.isArray(e.blocks)&&e.blocks.includes("*"),sr=e=>e===(0,xe.L)(Zi).getGroupingBlockName();function ar(e,t){const n=(0,Ei.FF)();for(let i=0;i<e.length;i++){const r=e[i];t(r)&&n.addFilter("transform","transform/"+i.toString(),e=>e||r,r.priority)}return n.applyFilters("transform",null)}function lr(e,t){if(void 0===t)return yn().map(({name:t})=>lr(e,t)).flat();const n=jn(t),{name:i,transforms:r}=n||{};if(!r||!Array.isArray(r[e]))return[];const o=r.supportedMobileTransforms&&Array.isArray(r.supportedMobileTransforms),s=o?r[e].filter(e=>"raw"===e.type||"prefix"===e.type||!(!e.blocks||!e.blocks.length)&&(!!or(e)||e.blocks.every(e=>r.supportedMobileTransforms.includes(e)))):r[e];return s.map(e=>({...e,blockName:i,usingMobileTransformations:o}))}function cr(e,t){if("function"!=typeof e.isMatch)return!0;const n=t[0],i=e.isMultiBlock?t.map(e=>e.attributes):n.attributes,r=e.isMultiBlock?t:n;return e.isMatch(i,r)}function ur(e,t){const n=Array.isArray(e)?e:[e],i=n.length>1,r=n[0],o=r.name,s=lr("from",t),a=ar(lr("to",o),e=>"block"===e.type&&(or(e)||-1!==e.blocks.indexOf(t))&&(!i||!!e.isMultiBlock)&&cr(e,n))||ar(s,e=>"block"===e.type&&(or(e)||-1!==e.blocks.indexOf(o))&&(!i||!!e.isMultiBlock)&&cr(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(r):a.transform(r.attributes,r.innerBlocks),null===l||"object"!=typeof l?null:(l=Array.isArray(l)?l:[l],l.some(e=>!bn(e.name))?null:l.some(e=>e.name===t)?l.map((t,n,i)=>(0,Ei.W5)("blocks.switchToBlockType.transformedBlock",t,e,n,i)):null)}var dr,hr,pr,fr,mr=(e,t)=>er(e,t.attributes,(t.innerBlocks??[]).map(e=>mr(e.name,e))),gr=/<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/g;function br(e,t,n,i,r){return{blockName:e,attrs:t,innerBlocks:n,innerHTML:i,innerContent:r}}function yr(e){return br(null,{},[],e,[e])}var vr=e=>{dr=e,hr=0,pr=[],fr=[],gr.lastIndex=0;do{}while(_r());return pr};function _r(){const e=fr.length,t=function(){const e=gr.exec(dr);if(null===e)return["no-more-tokens","",null,0,0];const t=e.index,[n,i,r,o,s,,a]=e,l=n.length,c=!!i,u=!!a,d=(r||"core/")+o,h=!!s?function(e){try{return JSON.parse(e)}catch{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,i,r,o,s]=t,a=o>hr?hr:null;switch(n){case"no-more-tokens":if(0===e)return xr(),!1;if(1===e)return wr(),!1;for(;0<fr.length;)wr();return!1;case"void-block":return 0===e?(null!==a&&pr.push(yr(dr.substr(a,o-a))),pr.push(br(i,r,[],"",[])),hr=o+s,!0):(kr(br(i,r,[],"",[]),o,s),hr=o+s,!0);case"block-opener":return fr.push(function(e,t,n,i,r){return{block:e,tokenStart:t,tokenLength:n,prevOffset:i||t+n,leadingHtmlStart:r}}(br(i,r,[],"",[]),o,s,o+s,a)),hr=o+s,!0;case"block-closer":if(0===e)return xr(),!1;if(1===e)return wr(o),hr=o+s,!0;const t=fr.pop(),n=dr.substr(t.prevOffset,o-t.prevOffset);return t.block.innerHTML+=n,t.block.innerContent.push(n),t.prevOffset=o+s,kr(t.block,t.tokenStart,t.tokenLength,o+s),hr=o+s,!0;default:return xr(),!1}}function xr(e){const t=e||dr.length-hr;0!==t&&pr.push(yr(dr.substr(hr,t)))}function kr(e,t,n,i){const r=fr[fr.length-1];r.block.innerBlocks.push(e);const o=dr.substr(r.prevOffset,t-r.prevOffset);o&&(r.block.innerHTML+=o,r.block.innerContent.push(o)),r.block.innerContent.push(null),r.prevOffset=i||t+n}function wr(e){const{block:t,leadingHtmlStart:n,prevOffset:i,tokenStart:r}=fr.pop(),o=e?dr.substr(i,e-i):dr.substr(i);o&&(t.innerHTML+=o,t.innerContent.push(o)),null!==n&&pr.push(yr(dr.substr(n,r-n))),pr.push(t)}var Cr=new RegExp("(<((?=!--|!\\[CDATA\\[)((?=!-)!(?:-(?!->)[^\\-]*)*(?:--\x3e)?|!\\[CDATA\\[[^\\]]*(?:](?!]>)[^\\]]*)*?(?:]]>)?)|[^>]*>?))");var Sr=n(21035),Ar=n(79923);function Ir(e,t={}){const{isCommentDelimited:n=!0}=t,{blockName:i,attrs:r={},innerBlocks:o=[],innerContent:s=[]}=e;let a=0;const l=s.map(e=>null!==e?e:Ir(o[a++],t)).join("\n").replace(/\n+/g,"\n").trim();return n?Pr(i??void 0,r,l):l}var Er=n(86106);function jr(e){const t="wp-block-"+e.replace(/\//,"-").replace(/^core-/,"");return(0,Ei.W5)("blocks.getBlockDefaultClassName",t,e)}function Tr(e){const t="editor-block-list-item-"+e.replace(/\//,"-").replace(/^core-/,"");return(0,Ei.W5)("blocks.getBlockMenuDefaultClassName",t,e)}var Br={},Nr={};function Rr(e={}){const{blockType:t,attributes:n}=Br;return Rr.skipFilters?e:(0,Ei.W5)("blocks.getSaveContent.extraProps",{...e},t,n)}function Or(e,t,n=[]){const i=jn(e);if(!i?.save)return null;let r=i.save;if(r.prototype instanceof T.Component){const e=new r({attributes:t});r=e.render.bind(e)}Br.blockType=i,Br.attributes=t,Nr.innerBlocks=n;let o=r({attributes:t,innerBlocks:n});if(null!==o&&"object"==typeof o&&(0,Ei.FC)("blocks.getSaveContent.extraProps")&&!((i.apiVersion??0)>1)){const e=(0,Ei.W5)("blocks.getSaveContent.extraProps",{...o.props},i,t);(0,V.hw)(e,o.props)||(o=(0,T.cloneElement)(o,e))}return(0,Ei.W5)("blocks.getSaveElement",o,i,t)}function Lr(e,t,n){const i=jn(e);return i?(0,Ar.Ay)(Or(i,t,n)):""}function Mr(e){let t=e.originalContent??"";if(e.isValid||e.innerBlocks.length)try{t=Lr(e.name,e.attributes,e.innerBlocks)}catch{}return t}function Pr(e,t,n){const i=t&&Object.entries(t).length?function(e){return JSON.stringify(e).replaceAll("\\\\","\\u005c").replaceAll("--","\\u002d\\u002d").replaceAll("<","\\u003c").replaceAll(">","\\u003e").replaceAll("&","\\u0026").replaceAll('\\"',"\\u0022")}(t)+" ":"",r=e?.startsWith("core/")?e.slice(5):e;return n?`\x3c!-- wp:${r} ${i}--\x3e\n`+n+`\n\x3c!-- /wp:${r} --\x3e`:`\x3c!-- wp:${r} ${i}/--\x3e`}var Dr=(()=>{const e=new WeakMap;return t=>{const n=e.get(t);if(void 0!==n)return n;let i=t;1===i.length&&In(i[0])&&(i=[]);let r=Fr(i);return 1===i.length&&i[0].name===fn()&&"core/freeform"===i[0].name&&(r=function(e){const t="blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure",n=t+"|div|p",i=t+"|pre",r=[];let o=!1,s=!1;return e?(-1===e.indexOf("<script")&&-1===e.indexOf("<style")||(e=e.replace(/<(script|style)[^>]*>[\s\S]*?<\/\1>/g,e=>(r.push(e),"<wp-preserve>"))),-1!==e.indexOf("<pre")&&(o=!0,e=e.replace(/<pre[^>]*>[\s\S]+?<\/pre>/g,e=>(e=(e=e.replace(/<br ?\/?>(\r\n|\n)?/g,"<wp-line-break>")).replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g,"<wp-line-break>")).replace(/\r?\n/g,"<wp-line-break>"))),-1!==e.indexOf("[caption")&&(s=!0,e=e.replace(/\[caption[\s\S]+?\[\/caption\]/g,e=>e.replace(/<br([^>]*)>/g,"<wp-temp-br$1>").replace(/[\r\n\t]+/,""))),e=(e=(e=(e=(e=(e=(e=(e=e.replace(new RegExp("\\s*</("+n+")>\\s*","g"),"</$1>\n")).replace(new RegExp("\\s*<((?:"+n+")(?: [^>]*)?)>","g"),"\n<$1>")).replace(/(<p [^>]+>[\s\S]*?)<\/p>/g,"$1</p#>")).replace(/<div( [^>]*)?>\s*<p>/gi,"<div$1>\n\n")).replace(/\s*<p>/gi,"")).replace(/\s*<\/p>\s*/gi,"\n\n")).replace(/\n[\s\u00a0]+\n/g,"\n\n")).replace(/(\s*)<br ?\/?>\s*/gi,(e,t)=>t&&-1!==t.indexOf("\n")?"\n\n":"\n"),-1!==(e=(e=(e=(e=(e=(e=(e=e.replace(/\s*<div/g,"\n<div")).replace(/<\/div>\s*/g,"</div>\n")).replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi,"\n\n[caption$1[/caption]\n\n")).replace(/caption\]\n\n+\[caption/g,"caption]\n\n[caption")).replace(new RegExp("\\s*<((?:"+i+")(?: [^>]*)?)\\s*>","g"),"\n<$1>")).replace(new RegExp("\\s*</("+i+")>\\s*","g"),"</$1>\n")).replace(/<((li|dt|dd)[^>]*)>/g," \t<$1>")).indexOf("<option")&&(e=(e=e.replace(/\s*<option/g,"\n<option")).replace(/\s*<\/select>/g,"\n</select>")),-1!==e.indexOf("<hr")&&(e=e.replace(/\s*<hr( [^>]*)?>\s*/g,"\n\n<hr$1>\n\n")),-1!==e.indexOf("<object")&&(e=e.replace(/<object[\s\S]+?<\/object>/g,e=>e.replace(/[\r\n]+/g,""))),e=(e=(e=(e=e.replace(/<\/p#>/g,"</p>\n")).replace(/\s*(<p [^>]+>[\s\S]*?<\/p>)/g,"\n$1")).replace(/^\s+/,"")).replace(/[\s\u00a0]+$/,""),o&&(e=e.replace(/<wp-line-break>/g,"\n")),s&&(e=e.replace(/<wp-temp-br([^>]*)>/g,"<br$1>")),r.length&&(e=e.replace(/<wp-preserve>/g,()=>r.shift())),e):""}(r)),e.set(t,r),r}})();function Fr(e,t){return(Array.isArray(e)?e:[e]).map(e=>function(e,{isInnerBlocks:t=!1}={}){if(!e.isValid&&e.__unstableBlockSource)return Ir(e.__unstableBlockSource);const n=e.name,i=Mr(e);if(n===mn()||!t&&n===fn())return i;const r=bn(n);if(!r)return i;const o=function(e,t){return Object.entries(e.attributes??{}).reduce((n,[i,r])=>{const o=t[i];return void 0===o||void 0!==r.source||"local"===r.role?n:"local"===r.__experimentalRole?((0,Qt.A)("__experimentalRole attribute",{since:"6.7",version:"6.8",alternative:"role attribute",hint:`Check the block.json of the ${e?.name} block.`}),n):("default"in r&&JSON.stringify(r.default)===JSON.stringify(o)||(n[i]=o),n)},{})}(r,e.attributes);return Pr(n,o,i)}(e,t)).join("\n\n")}var zr=/[\t\n\f ]/,Vr=/[A-Za-z]/,Ur=/\r\n?/g;function $r(e){return zr.test(e)}function Hr(e){return Vr.test(e)}var Wr=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||Hr(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(){$r(this.consume())&&this.transitionTo("beforeDoctypeName")},beforeDoctypeName:function(){var e=this.consume();$r(e)||(this.transitionTo("doctypeName"),this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(e.toLowerCase()))},doctypeName:function(){var e=this.consume();$r(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(!$r(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(),i="SYSTEM"===t.toUpperCase();(n||i)&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume()),n?this.transitionTo("afterDoctypePublicKeyword"):i&&this.transitionTo("afterDoctypeSystemKeyword")}},afterDoctypePublicKeyword:function(){var e=this.peek();$r(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();$r(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();$r(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();$r(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();$r(e)?this.transitionTo("beforeAttributeName"):"/"===e?this.transitionTo("selfClosingStartTag"):">"===e?(this.delegate.finishTag(),this.transitionTo("beforeData")):this.appendToTagName(e)},endTagName:function(){var e=this.consume();$r(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();$r(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();$r(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();$r(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();$r(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();$r(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();$r(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||Hr(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(Ur,"\n")}(e);this.index<this.input.length;){var t=this.states[this.state];if(void 0===t)throw new Error("unhandled state "+this.state);t.call(this)}},e.prototype.tokenizeEOF=function(){this.flushData()},e.prototype.flushData=function(){"data"===this.state&&(this.delegate.finishData(),this.transitionTo("beforeData"))},e.prototype.peek=function(){return this.input.charAt(this.index)},e.prototype.consume=function(){var e=this.peek();return this.index++,"\n"===e?(this.line++,this.column=0):this.column++,e},e.prototype.consumeCharRef=function(){var e=this.input.indexOf(";",this.index);if(-1!==e){var t=this.input.slice(this.index,e),n=this.entityParser.parse(t);if(n){for(var i=t.length;i;)this.consume(),i--;return this.consume(),n}}},e.prototype.markTagStart=function(){this.delegate.tagOpen()},e.prototype.appendToTagName=function(e){this.tagNameBuffer+=e,this.delegate.appendToTagName(e)},e.prototype.isIgnoredEndTag=function(){var e=this.tagNameBuffer;return"title"===e&&"</title>"!==this.input.substring(this.index,this.index+8)||"style"===e&&"</style>"!==this.input.substring(this.index,this.index+8)||"script"===e&&"<\/script>"!==this.input.substring(this.index,this.index+9)},e}(),Gr=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 Wr(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;t<arguments.length;t++)if(e.type===arguments[t])return e;throw new Error("token type was unexpectedly "+e.type)},e.prototype.push=function(e){this.token=e,this.tokens.push(e)},e.prototype.currentAttribute=function(){return this._currentAttribute},e.prototype.addLocInfo=function(){this.options.loc&&(this.current().loc={start:{line:this.startLine,column:this.startColumn},end:{line:this.tokenizer.line,column:this.tokenizer.column}}),this.startLine=this.tokenizer.line,this.startColumn=this.tokenizer.column},e.prototype.beginDoctype=function(){this.push({type:"Doctype",name:""})},e.prototype.appendToDoctypeName=function(e){this.current("Doctype").name+=e},e.prototype.appendToDoctypePublicIdentifier=function(e){var t=this.current("Doctype");void 0===t.publicIdentifier?t.publicIdentifier=e:t.publicIdentifier+=e},e.prototype.appendToDoctypeSystemIdentifier=function(e){var t=this.current("Doctype");void 0===t.systemIdentifier?t.systemIdentifier=e:t.systemIdentifier+=e},e.prototype.endDoctype=function(){this.addLocInfo()},e.prototype.beginData=function(){this.push({type:"Chars",chars:""})},e.prototype.appendToData=function(e){this.current("Chars").chars+=e},e.prototype.finishData=function(){this.addLocInfo()},e.prototype.beginComment=function(){this.push({type:"Comment",chars:""})},e.prototype.appendToCommentData=function(e){this.current("Comment").chars+=e},e.prototype.finishComment=function(){this.addLocInfo()},e.prototype.tagOpen=function(){},e.prototype.beginStartTag=function(){this.push({type:"StartTag",tagName:"",attributes:[],selfClosing:!1})},e.prototype.beginEndTag=function(){this.push({type:"EndTag",tagName:""})},e.prototype.finishTag=function(){this.addLocInfo()},e.prototype.markTagAsSelfClosing=function(){this.current("StartTag").selfClosing=!0},e.prototype.appendToTagName=function(e){this.current("StartTag","EndTag").tagName+=e},e.prototype.beginAttribute=function(){this._currentAttribute=["","",!1]},e.prototype.appendToAttributeName=function(e){this.currentAttribute()[0]+=e},e.prototype.beginAttributeValue=function(e){this.currentAttribute()[2]=e},e.prototype.appendToAttributeValue=function(e){this.currentAttribute()[1]+=e},e.prototype.finishAttributeValue=function(){this.current("StartTag").attributes.push(this._currentAttribute)},e.prototype.reportSyntaxError=function(e){this.current().syntaxError=e},e}(),qr=n(72681);function Kr(){function e(e){return(t,...n)=>e("Block validation: "+t,...n)}return{error:e(console.error),warning:e(console.warn),getItems:()=>[]}}var Yr=/[\t\n\r\v\f ]+/g,Jr=/^[\t\n\r\v\f ]*$/,Xr=/^url\s*\(['"\s]*(.*?)['"\s]*\)$/,Zr=["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"],Qr=[...Zr,"autocapitalize","autocomplete","charset","contenteditable","crossorigin","decoding","dir","draggable","enctype","formenctype","formmethod","http-equiv","inputmode","kind","method","preload","scope","shape","spellcheck","translate","type","wrap"],eo=[e=>e,function(e){return oo(e).join(" ")}],to=/^[\da-z]+$/i,no=/^#\d+$/,io=/^#x[\da-f]+$/i,ro=class{parse(e){if(t=e,to.test(t)||no.test(t)||io.test(t))return(0,qr.S)("&"+e+";");var t}};function oo(e){return e.trim().split(Yr)}function so(e){return(e.attributes??[]).filter(e=>{const[t,n]=e;return n||0===t.indexOf("data-")||Qr.includes(t)})}function ao(e,t,n=Kr()){let i=e.chars,r=t.chars;for(let e=0;e<eo.length;e++){const t=eo[e];if(i=t(i),r=t(r),i===r)return!0}return n.warning("Expected text `%s`, saw `%s`.",t.chars,e.chars),!1}function lo(e){return 0===parseFloat(e)?"0":0===e.indexOf(".")?"0"+e:e}function co(e){return oo(e).map(lo).join(" ").replace(Xr,"url($1)")}function uo(e){const t=e.replace(/;?\s*$/,"").split(";").map(e=>{const[t,...n]=e.split(":"),i=n.join(":");return[t.trim(),co(i.trim())]});return Object.fromEntries(t)}var ho={class:(e,t)=>{const[n,i]=[e,t].map(oo),r=n.filter(e=>!i.includes(e)),o=i.filter(e=>!n.includes(e));return 0===r.length&&0===o.length},style:(e,t)=>F(...[e,t].map(uo)),...Object.fromEntries(Zr.map(e=>[e,()=>!0]))},po={StartTag:(e,t,n=Kr())=>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=Kr()){if(e.length!==t.length)return n.warning("Expected attributes %o, instead saw %o.",t,e),!1;const i={};for(let e=0;e<t.length;e++)i[t[e][0].toLowerCase()]=t[e][1];for(let t=0;t<e.length;t++){const[r,o]=e[t],s=r.toLowerCase();if(!i.hasOwnProperty(s))return n.warning("Encountered unexpected attribute `%s`.",r),!1;const a=i[s],l=ho[s];if(l){if(!l(o,a))return n.warning("Expected attribute `%s` of value `%s`, saw `%s`.",r,a,o),!1}else if(o!==a)return n.warning("Expected attribute `%s` of value `%s`, saw `%s`.",r,a,o),!1}return!0}(...[e,t].map(so),n),Chars:ao,Comment:ao};function fo(e){let t;for(;t=e.shift();){if("Chars"!==t.type)return t;if(!Jr.test(t.chars))return t}}function mo(e,t){return!!e.selfClosing&&!(!t||t.tagName!==e.tagName||"EndTag"!==t.type)}function go(e,t=e.name){if(e.name===fn()||e.name===mn())return[!0,[]];const n=function(){const e=[],t=Kr();return{error(...n){e.push({log:t.error,args:n})},warning(...n){e.push({log:t.warning,args:n})},getItems:()=>e}}(),i=jn(t);let r;try{r=Lr(i,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 o=function(e,t,n=Kr()){if(e===t)return!0;const[i,r]=[e,t].map(e=>function(e,t=Kr()){try{return new Gr(new ro).tokenize(e)}catch{t.warning("Malformed HTML detected: %s",e)}return null}(e,n));if(!i||!r)return!1;let o,s;for(;o=fo(i);){if(s=fo(r),!s)return n.warning("Expected end of content, instead saw %o.",o),!1;if(o.type!==s.type)return n.warning("Expected token of type `%s` (%o), instead saw `%s` (%o).",s.type,s,o.type,o),!1;const e=po[o.type];if(e&&!e(o,s,n))return!1;mo(o,r[0])?fo(r):mo(s,i[0])&&fo(i)}return!(s=fo(r))||(n.warning("Expected %o, instead saw end of content.",s),!1)}(e.originalContent,r,n);return o||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",i.name,i,r,e.originalContent),[o,n.getItems()]}function bo(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),i={speaker:"speaker-deck",polldaddy:"crowdsignal"};n.providerNameSlug=t in i?i[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 t=n.className??"";t.includes("wp-block-comments-query-loop")||(n.className=["wp-block-comments-query-loop",t].join(" "))}"core/post-comments"===e&&(e="core/comments",n.legacy=!0);const i=t.layout;"grid"===i?.type&&"string"==typeof i?.columnCount&&(n.layout={...n.layout,columnCount:parseInt(i.columnCount,10)});const r=t.style,o=r?.layout;if("string"==typeof o?.columnSpan){const e=parseInt(o.columnSpan,10);n.style={...n.style,layout:{...n.style?.layout,columnSpan:isNaN(e)?void 0:e}}}if("string"==typeof o?.rowSpan){const e=parseInt(o.rowSpan,10);n.style={...n.style,layout:{...n.style?.layout,rowSpan:isNaN(e)?void 0:e}}}return[e,n]}var yo=function(){var e;return function(){return e||(e=document.implementation.createHTMLDocument("")),e}}();function vo(e,t){if(t){if("string"==typeof e){var n=yo();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,i){var r=t[i];return n[i]=vo(e,r),n},{})}}function _o(e,t){var n,i;return 1===arguments.length?(n=e,i=void 0):(n=t,i=e),function(e){var t=e;if(i&&(t=e.querySelector(i)),t)return function(e,t){for(var n,i=t.split(".");n=i.shift();){if(!(n in e))return;e=e[n]}return e}(t,n)}}var xo=n(53981);function ko(e){const t={};for(let n=0;n<e.length;n++){const{name:i,value:r}=e[n];t[i]=r}return t}function wo(e){if((0,Qt.A)("wp.blocks.node.fromDOM",{since:"6.1",version:"6.3",alternative:"wp.richText.create",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),e.nodeType===e.TEXT_NODE)return e.nodeValue;if(e.nodeType!==e.ELEMENT_NODE)throw new TypeError("A block node can only be created from a node of type text or element.");return{type:e.nodeName.toLowerCase(),props:{...ko(e.attributes),children:Co(e.childNodes)}}}function Co(e){(0,Qt.A)("wp.blocks.children.fromDOM",{since:"6.1",version:"6.3",alternative:"wp.richText.create",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"});const t=[];for(let n=0;n<e.length;n++)try{t.push(wo(e[n]))}catch{}return t}function So(e){return(0,Qt.A)("wp.blocks.children.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;return e&&(n=t.querySelector(e)),n?Co(n.childNodes):[]}}var Ao={concat:function(...e){(0,Qt.A)("wp.blocks.children.concat",{since:"6.1",version:"6.3",alternative:"wp.richText.concat",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"});const t=[];for(let n=0;n<e.length;n++){const i=Array.isArray(e[n])?e[n]:[e[n]];for(let e=0;e<i.length;e++){const n=i[e];"string"==typeof n&&"string"==typeof t[t.length-1]?t[t.length-1]+=n:t.push(n)}}return t},getChildrenArray:function(e){return(0,Qt.A)("wp.blocks.children.getChildrenArray",{since:"6.1",version:"6.3",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),e},fromDOM:Co,toHTML:function(e){(0,Qt.A)("wp.blocks.children.toHTML",{since:"6.1",version:"6.3",alternative:"wp.richText.toHTMLString",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"});const t=e;return(0,Ar.Ay)(t)},matcher:So};function Io(e,t,n,i,r){let o;switch(t.source){case void 0:o=i?i[e]:void 0;break;case"raw":o=r;break;case"attribute":case"property":case"html":case"text":case"rich-text":case"children":case"node":case"query":case"tag":o=To(n,t)}return function(e,t){return void 0===t||function(e,t){return t.some(t=>function(e,t){switch(t){case"rich-text":return e instanceof He;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])}(o,t.type)&&function(e,t){return!Array.isArray(t)||t.includes(e)}(o,t.enum)||(o=void 0),void 0===o&&(o=Bn(t)),o}var Eo=(0,xo.A)(e=>{switch(e.source){case"attribute":{let t=function(e,t){var n,i;return 1===arguments.length?(n=e,i=void 0):(n=t,i=e),function(e){var t=_o(i,"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 i=n;if(e&&(i=n.querySelector(e)),!i)return"";if(t){let e="";const n=i.children.length;for(let r=0;r<n;r++){const n=i.children[r];n.nodeName.toLowerCase()===t&&(e+=n.outerHTML)}return e}return i.innerHTML}}(e.selector,e.multiline);case"text":return function(e){return _o(e,"textContent")}(e.selector);case"rich-text":return((e,t)=>n=>{const i=e?n.querySelector(e):n;return i?He.fromHTMLElement(i,{preserveWhiteSpace:t}):He.empty()})(e.selector,e.__unstablePreserveWhiteSpace);case"children":return So(e.selector);case"node":return function(e){return(0,Qt.A)("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 wo(n)}catch{return null}}}(e.selector);case"query":const t=Object.fromEntries(Object.entries(e.query).map(([e,t])=>[e,Eo(t)]));return function(e,t){return function(n){var i=n.querySelectorAll(e);return[].map.call(i,function(e){return vo(e,t)})}}(e.selector,t);case"tag":{const t=_o(e.selector,"nodeName");return e=>t(e)?.toLowerCase()}default:return void console.error(`Unknown source type "${e.source}"`)}});function jo(e){return vo(e,e=>e)}function To(e,t){return Eo(t)(jo(e))}function Bo(e,t,n={}){const i=jo(t),r=jn(e),o=Object.fromEntries(Object.entries(r?.attributes??{}).map(([e,r])=>[e,Io(e,r,i,n,t)]));return(0,Ei.W5)("blocks.getBlockAttributes",o,r,t,n)}var No={type:"string",source:"attribute",selector:"[data-custom-class-name] > *",attribute:"class"};function Ro(e){const t=To(`<div data-custom-class-name>${e}</div>`,No);return t?t.trim().split(/\s+/):[]}function Oo(e,t,n,i,r,o){if(!_n(t,i,!1))return e;const s={...e},a=function(e,t,n){return To(`<div ${t}>${e}</div>`,n)}(n,r,o);return a&&(s[i]=a),s}var Lo={type:"string",source:"attribute",selector:"[data-aria-label] > *",attribute:"aria-label"},Mo={type:"string",source:"attribute",selector:"[data-anchor] > *",attribute:"id"};function Po(e,t){const{attributes:n,originalContent:i}=e;let r=n;return r=function(e,t,n){if(!_n(t,"customClassName",!0))return e;const i={...e},{className:r,...o}=i,s=Lr(t,o),a=Ro(s),l=Ro(n).filter(e=>!a.includes(e));return l.length?i.className=l.join(" "):s&&delete i.className,i}(n,t,i??""),r=Oo(r,t,i??"","ariaLabel","data-aria-label",Lo),r=Oo(r,t,i??"","anchor","data-anchor",Mo),{...e,attributes:r}}function Do(){return!1}function Fo(e,t){const n=fn(),i=e.blockName||fn(),r=e.attrs||{},o=e.innerBlocks||[];let s=e.innerHTML.trim();return i!==n||"core/freeform"!==i||t?.__unstableSkipAutop||(s=function(e,t=!0){const n=[];if(""===e.trim())return"";if(-1!==(e+="\n").indexOf("<pre")){const t=e.split("</pre>"),i=t.pop();e="";for(let i=0;i<t.length;i++){const r=t[i],o=r.indexOf("<pre");if(-1===o){e+=r;continue}const s="<pre wp-pre-tag-"+i+"></pre>";n.push([s,r.substr(o)+"</pre>"]),e+=r.substr(0,o)+s}e+=i}const i="(?: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,i=e;for(;n=i.match(Cr);){const e=n.index;t.push(i.slice(0,e)),t.push(n[0]),i=i.slice(e+n[0].length)}return i.length&&t.push(i),t}(e);let i=!1;const r=Object.keys(t);for(let e=1;e<n.length;e+=2)for(let o=0;o<r.length;o++){const s=r[o];if(-1!==n[e].indexOf(s)){n[e]=n[e].replace(new RegExp(s,"g"),t[s]),i=!0;break}}return i&&(e=n.join("")),e}(e=(e=(e=(e=e.replace(/<br\s*\/?>\s*<br\s*\/?>/g,"\n\n")).replace(new RegExp("(<"+i+"[\\s/>])","g"),"\n\n$1")).replace(new RegExp("(</"+i+">)","g"),"$1\n\n")).replace(/\r\n|\r/g,"\n"),{"\n":" \x3c!-- wpnl --\x3e "})).indexOf("<option")&&(e=(e=e.replace(/\s*<option/g,"<option")).replace(/<\/option>\s*/g,"</option>")),-1!==e.indexOf("</object>")&&(e=(e=(e=e.replace(/(<object[^>]*>)\s*/g,"$1")).replace(/\s*<\/object>/g,"</object>")).replace(/\s*(<\/?(?:param|embed)[^>]*>)\s*/g,"$1")),-1===e.indexOf("<source")&&-1===e.indexOf("<track")||(e=(e=(e=e.replace(/([<\[](?:audio|video)[^>\]]*[>\]])\s*/g,"$1")).replace(/\s*([<\[]\/(?:audio|video)[>\]])/g,"$1")).replace(/\s*(<(?:source|track)[^>]*>)\s*/g,"$1")),-1!==e.indexOf("<figcaption")&&(e=(e=e.replace(/\s*(<figcaption[^>]*>)/,"$1")).replace(/<\/figcaption>\s*/,"</figcaption>"));const r=(e=e.replace(/\n\n+/g,"\n\n")).split(/\n\s*\n/).filter(Boolean);return e="",r.forEach(t=>{e+="<p>"+t.replace(/^\n*|\n*$/g,"")+"</p>\n"}),e=(e=(e=(e=(e=(e=(e=(e=e.replace(/<p>\s*<\/p>/g,"")).replace(/<p>([^<]+)<\/(div|address|form)>/g,"<p>$1</p></$2>")).replace(new RegExp("<p>\\s*(</?"+i+"[^>]*>)\\s*</p>","g"),"$1")).replace(/<p>(<li.+?)<\/p>/g,"$1")).replace(/<p><blockquote([^>]*)>/gi,"<blockquote$1><p>")).replace(/<\/blockquote><\/p>/g,"</p></blockquote>")).replace(new RegExp("<p>\\s*(</?"+i+"[^>]*>)","g"),"$1")).replace(new RegExp("(</?"+i+"[^>]*>)\\s*</p>","g"),"$1"),t&&(e=e.replace(/<(script|style).*?<\/\\1>/g,e=>e[0].replace(/\n/g,"<WPPreserveNewline />")),e=(e=e.replace(/<br>|<br\/>/g,"<br />")).replace(/(<br \/>)?\s*\n/g,(e,t)=>t?e:"<br />\n"),e=e.replace(/<WPPreserveNewline \/>/g,"\n")),e=(e=(e=e.replace(new RegExp("(</?"+i+"[^>]*>)\\s*<br />","g"),"$1")).replace(/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)/g,"$1")).replace(/\n<\/p>$/g,"</p>"),n.forEach(t=>{const[n,i]=t;e=e.replace(n,()=>i)}),-1!==e.indexOf("\x3c!-- wpnl --\x3e")&&(e=e.replace(/\s?<!-- wpnl -->\s?/g,"\n")),e}(s).trim()),{...e,blockName:i,attrs:r,innerHTML:s,innerBlocks:o}}function zo(e,t){let n=Fo(e,t);n=function(e){const[t,n]=bo(e.blockName,e.attrs??{});return{...e,blockName:t,attrs:n}}(n);let i=bn(n.blockName);i||(n=function(e){const t=mn()||fn(),n=Ir(e,{isCommentDelimited:!1}),i=Ir(e,{isCommentDelimited:!0});return{blockName:t,attrs:{originalName:e.blockName,originalContent:i,originalUndelimitedContent:n},innerHTML:e.blockName?i:e.innerHTML,innerBlocks:e.innerBlocks,innerContent:e.innerContent}}(n),i=bn(n.blockName));const r=n.blockName===fn()||n.blockName===mn();if(!i||!n.innerHTML&&r)return;const o=n.innerBlocks.map(e=>zo(e,t)).filter(e=>!!e),s=er(n.blockName,Bo(i,n.innerHTML,n.attrs),o);s.originalContent=n.innerHTML;const a=function(e,t){const[n]=go(e,t);if(n)return{...e,isValid:n,validationIssues:[]};const i=Po(e,t),[r,o]=go(i,t);return{...i,isValid:r,validationIssues:o}}(s,i),{validationIssues:l}=a,c=function(e,t,n){const i=t.attrs??{},{deprecated:r}=n;if(!r||!r.length)return e;for(let o=0;o<r.length;o++){const{isEligible:s=Do}=r[o];if(e.isValid&&!s(i,e.innerBlocks,{blockNode:t,block:e}))continue;const a=Object.assign(On(n,tn),r[o]);let l={...e,attributes:Bo(a,e.originalContent??"",i)},[c]=go(l,a);if(c||(l=Po(l,a),[c]=go(l,a)),!c)continue;let u=l.innerBlocks,d=l.attributes;const{migrate:h}=a;if(h){let t=h(d,e.innerBlocks);Array.isArray(t)||(t=[t]),[d=i,u=e.innerBlocks]=t}e={...e,attributes:d,innerBlocks:u,isValid:!0,validationIssues:[]}}return e}(a,n,i);return c.isValid||(c.__unstableBlockSource=e),a.isValid||!c.isValid||t?.__unstableSkipMigrationLogs?a.isValid||c.isValid||l.forEach(({log:e,args:t})=>e(...t)):(console.groupCollapsed("Updated Block: %s",i.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",i.name,i,Lr(i,c.attributes),c.originalContent),console.groupEnd()),c}function Vo(e,t){return vr(e).reduce((e,n)=>{const i=zo(n,t);return i&&e.push(i),e},[])}var Uo=n(67338);function $o(){return lr("from").filter(({type:e})=>"raw"===e).map(e=>e.isMatch?e:{...e,isMatch:t=>e.selector&&t.matches(e.selector)})}function Ho(e,t){const n=document.implementation.createHTMLDocument("");return n.body.innerHTML=e,Array.from(n.body.children).flatMap(e=>{const n=ar($o(),t=>t.isMatch(e));if(!n)return Uo.A.isNative?Vo(`\x3c!-- wp:html --\x3e${e.outerHTML}\x3c!-- /wp:html --\x3e`):er("core/html",Bo("core/html",e.outerHTML));const{transform:i,blockName:r}=n;if(i){const n=i(e,t);return e.hasAttribute("class")&&(n.attributes.className=e.getAttribute("class")),n}return er(r,Bo(r,e.outerHTML))})}function Wo(e){switch(e.nodeType){case e.TEXT_NODE:return/^[ \f\n\r\t\v\u00a0]*$/.test(e.nodeValue||"");case e.ELEMENT_NODE:return!e.hasAttributes()&&(!e.hasChildNodes()||Array.from(e.childNodes).every(Wo));default:return!0}}var Go={strong:{},em:{},s:{},del:{},ins:{},a:{attributes:["href","target","rel","id"]},code:{},abbr:{attributes:["title"]},sub:{},sup:{},br:{},small:{},q:{attributes:["cite"]},dfn:{attributes:["title"]},data:{attributes:["value"]},time:{attributes:["datetime"]},var:{},samp:{},kbd:{},i:{},b:{},u:{},mark:{},ruby:{},rt:{},rp:{},bdi:{attributes:["dir"]},bdo:{attributes:["dir"]},wbr:{},"#text":{}},qo=["#text","br"];Object.keys(Go).filter(e=>!qo.includes(e)).forEach(e=>{const{[e]:t,...n}=Go;Go[e].children=n});var Ko={...Go,audio:{attributes:["src","preload","autoplay","mediagroup","loop","muted"]},canvas:{attributes:["width","height"]},embed:{attributes:["src","type","width","height"]},img:{attributes:["alt","src","srcset","usemap","ismap","width","height"]},object:{attributes:["data","type","name","usemap","form","width","height"]},video:{attributes:["src","poster","preload","playsinline","autoplay","mediagroup","loop","muted","controls","width","height"]},math:{attributes:["display","xmlns"],children:"*"}};function Yo(e){if("paste"!==e)return Ko;const{u:t,abbr:n,data:i,time:r,wbr:o,bdi:s,bdo:a,...l}={...Ko,ins:{children:Ko.ins.children},del:{children:Ko.del.children}};return l}function Jo(e){const t=e.nodeName.toLowerCase();return Yo().hasOwnProperty(t)||"span"===t}function Xo(e){const t=e.nodeName.toLowerCase();return Go.hasOwnProperty(t)||"span"===t}function Zo(e,t={}){const n=document.implementation.createHTMLDocument(""),i=document.implementation.createHTMLDocument(""),r=n.body,o=i.body;for(r.innerHTML=e;r.firstChild;){const e=r.firstChild;e.nodeType===e.TEXT_NODE?Wo(e)?r.removeChild(e):(o.lastChild&&"P"===o.lastChild.nodeName||o.appendChild(i.createElement("P")),o.lastChild.appendChild(e)):e.nodeType===e.ELEMENT_NODE?"BR"===e.nodeName?(e.nextSibling&&"BR"===e.nextSibling.nodeName&&(o.appendChild(i.createElement("P")),r.removeChild(e.nextSibling)),o.lastChild&&"P"===o.lastChild.nodeName&&o.lastChild.hasChildNodes()?o.lastChild.appendChild(e):r.removeChild(e)):"P"===e.nodeName?Wo(e)&&!t.raw?r.removeChild(e):o.appendChild(e):Jo(e)?(o.lastChild&&"P"===o.lastChild.nodeName||o.appendChild(i.createElement("P")),o.lastChild.appendChild(e)):o.appendChild(e):r.removeChild(e)}return o.innerHTML}function Qo(e,t){(0,re.e)(t.parentNode,"referenceNode.parentNode"),t.parentNode.insertBefore(e,t.nextSibling)}function es(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 i=e,r=!1;for(;i=i.nextSibling;)if(i.nodeType===i.COMMENT_NODE&&"noteaser"===i.nodeValue){r=!0,oe(i);break}return function(e,t,n){const i=n.createElement("wp-block");return i.dataset.block="core/more",e&&(i.dataset.customText=e),t&&(i.dataset.noTeaser=""),i}(n,r,t)}(e,t);if(e.parentNode&&"P"===e.parentNode.nodeName){const i=Array.from(e.parentNode.childNodes),r=i.indexOf(e),o=e.parentNode.parentNode||t.body,s=(e,n)=>(e||(e=t.createElement("p")),e.appendChild(n),e);[i.slice(0,r).reduce(s,null),n,i.slice(r+1).reduce(s,null)].forEach(t=>t&&o.insertBefore(t,e.parentNode)),oe(e.parentNode)}else i=e,r=n,(0,re.e)(i.parentNode,"processedNode.parentNode"),Qo(r,i.parentNode),oe(i);var i,r}function ts(e){const t=e.parentNode;for((0,re.e)(t,"node.parentNode");e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}function ns(e){return"OL"===e.nodeName||"UL"===e.nodeName}function is(e){if(!ns(e))return;const t=e,n=t.previousElementSibling;if(n&&n.nodeName===e.nodeName&&1===t.children.length){for(;t.firstChild;)n.appendChild(t.firstChild);t.parentNode.removeChild(t)}const i=e.parentNode;if(i&&"LI"===i.nodeName&&1===i.children.length&&!/\S/.test((r=i,Array.from(r.childNodes).map(({nodeValue:e=""})=>e).join("")))){const e=i,n=e.previousElementSibling,r=e.parentNode;n&&(n.appendChild(t),r.removeChild(e))}var r;if(i&&ns(i)){const n=t.previousElementSibling;n?n.appendChild(e):ts(e)}}function rs(e={}){return t=>{if("BLOCKQUOTE"!==t.nodeName)return;const n=t;n.innerHTML=Zo(n.innerHTML,e)}}function os(e,t=e){const n=e.ownerDocument.createElement("figure");t.parentNode.insertBefore(n,t),n.appendChild(e)}function ss(e,t,n){if(!n||!function(e,t){const n=e.nodeName.toLowerCase();return"figcaption"!==n&&!Xo(e)&&n in(t?.figure?.children??{})}(e,n))return;let i=e;const r=e.parentNode;(function(e,t){return e.nodeName.toLowerCase()in(t?.figure?.children?.a?.children??{})})(e,n)&&"A"===r.nodeName&&1===r.childNodes.length&&(i=e.parentNode);const o=i.closest("p,div");if(o){const t=e;t.classList?(t.classList.contains("alignright")||t.classList.contains("alignleft")||t.classList.contains("aligncenter")||!o.textContent.trim())&&os(i,o):os(i,o)}else os(i)}function as(e,t,n=0){const i=us(e);i.lastIndex=n;const r=i.exec(t);if(!r)return;if("["===r[1]&&"]"===r[7])return as(e,t,i.lastIndex);const o={index:r.index,content:r[0],shortcode:hs(r)};return r[1]&&(o.content=o.content.slice(1),o.index++),r[7]&&(o.content=o.content.slice(0,-1)),o}function ls(e,t,n){return t.replace(us(e),(...e)=>{const t=e[0],i=e[1],r=e[7];if("["===i&&"]"===r)return t;const o=n(hs(e));return o||""===o?i+o+r:t})}function cs(e){return new ps(e).string()}function us(e){return new RegExp("\\[(\\[?)("+e+")(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*(?:\\[(?!\\/\\2\\])[^\\[]*)*)(\\[\\/\\2\\]))?)(\\]?)","g")}var ds=(0,xo.A)(e=>{const t={},n=[],i=/([\w-]+)\s*=\s*"([^"]*)"(?:\s|$)|([\w-]+)\s*=\s*'([^']*)'(?:\s|$)|([\w-]+)\s*=\s*([^\s'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|'([^']*)'(?:\s|$)|(\S+)(?:\s|$)/g;let r;for(e=e.replace(/[\u00a0\u200b]/g," ");r=i.exec(e);)r[1]?t[r[1].toLowerCase()]=r[2]:r[3]?t[r[3].toLowerCase()]=r[4]:r[5]?t[r[5].toLowerCase()]=r[6]:r[7]?n.push(r[7]):r[8]?n.push(r[8]):r[9]&&n.push(r[9]);return{named:t,numeric:n}});function hs(e){let t;return t=e[4]?"self-closing":e[6]?"closed":"single",new ps({tag:e[2],attrs:e[3],type:t,content:e[5]})}var ps=class{tag;type;content;attrs;static next=as;static replace=ls;static string=cs;static regexp=us;static attrs=ds;static fromMatch=hs;constructor(e){const{tag:t,attrs:n,type:i,content:r}=e;this.tag=t,this.type=i,this.content=r,this.attrs={named:{},numeric:[]},n&&("string"==typeof n?this.attrs=ds(n):"named"in n&&"numeric"in n&&void 0!==n.named&&void 0!==n.numeric?this.attrs=n:Object.entries(n).forEach(([e,t])=>{void 0!==t&&this.set(e,String(t))}))}get(e){return"number"==typeof e?this.attrs.numeric[e]:this.attrs.named[e]}set(e,t){return"number"==typeof e?this.attrs.numeric[e]=t:this.attrs.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+"]")}},fs=e=>Array.isArray(e)?e:[e],ms=/(\n|<p>|<br\s*\/?>)\s*$/,gs=/^\s*(\n|<\/p>|<br\s*\/?>)/,bs=function e(t,n=0,i=[]){const r=ar(lr("from"),e=>{const n=e;return-1===i.indexOf(n.blockName)&&"shortcode"===n.type&&fs(n.tag).some(e=>us(e).test(t))});if(!r)return[t];const o=fs(r.tag).find(e=>us(e).test(t));let s;const a=n;if(s=as(o,t,n)){n=s.index+s.content.length;const o=t.substr(0,s.index),l=t.substr(n);if(!(s.shortcode.content?.includes("<")||ms.test(o)&&gs.test(l)))return e(t,n);if(r.isMatch&&!r.isMatch(s.shortcode.attrs))return e(t,a,[...i,r.blockName]);let c=[];if("function"==typeof r.transform)c=[].concat(r.transform(s.shortcode.attrs,s)),c=c.map(e=>(e.originalContent=s.shortcode.content,Po(e,bn(e.name))));else{const e=Object.fromEntries(Object.entries(r.attributes).filter(([,e])=>e.shortcode).map(([e,t])=>[e,t.shortcode(s.shortcode.attrs,s)])),n=bn(r.blockName);if(!n)return[t];const i={...n,attributes:r.attributes};let o=er(r.blockName,Bo(i,s.shortcode.content,e));o.originalContent=s.shortcode.content,o=Po(o,i),c=[o]}return[...e(o.replace(ms,"")),...c,...e(l.replace(gs,""))]}return[t]};function ys(e){return function(e,t){const n={phrasingContentSchema:Yo(t),isPaste:"paste"===t},i=e.map(({isMatch:e,blockName:t,schema:i})=>{const r=_n(t,"anchor");return i="function"==typeof i?i(n):i,r||e?i?Object.fromEntries(Object.entries(i).map(([t,n])=>{let i=n.attributes||[];return r&&(i=[...i,"id"]),[t,{...n,attributes:i,isMatch:e||void 0}]})):{}:i});function r(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 o(e,t){for(const n in t)e[n]=e[n]?r(e[n],t[n],n):{...t[n]};return e}return i.reduce(function(e,t){for(const n in t)e[n]=e[n]?o(e[n],t[n]):{...t[n]};return e},{})}($o(),e)}function vs(e,t,n,i){Array.from(e).forEach(e=>{vs(e.childNodes,t,n,i),t.forEach(t=>{n.contains(e)&&t(e,n,i)})})}function _s(e,t=[],n){const i=document.implementation.createHTMLDocument("");return i.body.innerHTML=e,vs(i.body.childNodes,t,i,n),i.body.innerHTML}function xs(e,t){const n=e[`${t}Sibling`];if(n&&Jo(n))return n;const{parentNode:i}=e;return i&&Jo(i)?xs(i,t):void 0}function ks({HTML:e=""}){if(-1!==e.indexOf("\x3c!-- wp:")){const t=Vo(e);if(1!==t.length||"core/freeform"!==t[0].name)return t}const t=bs(e),n=ys();return t.map(e=>"string"!=typeof e?e:Ho(e=Zo(e=_s(e,[is,es,ss,rs({raw:!0})],n),{raw:!0}),ks)).flat().filter(Boolean)}var ws=()=>{};function Cs(e,t,n,i){Array.from(e).forEach(e=>{const r=e.nodeName.toLowerCase();if(!n.hasOwnProperty(r)||n[r].isMatch&&!n[r].isMatch?.(e))Cs(e.childNodes,t,n,i),i&&!Jo(e)&&e.nextElementSibling&&Qo(t.createElement("br"),e),ts(e);else if(function(e){return!!e&&e.nodeType===e.ELEMENT_NODE}(e)){const{attributes:o=[],classes:s=[],children:a,require:l=[],allowEmpty:c}=n[r];if(a&&!c&&Wo(e))return void oe(e);if(e.hasAttributes()&&(Array.from(e.attributes).forEach(({name:t})=>{"class"===t||o.includes(t)||e.removeAttribute(t)}),e.classList&&e.classList.length)){const t=s.map(e=>"*"===e?()=>!0:"string"==typeof e?t=>t===e:e instanceof RegExp?t=>e.test(t):ws);Array.from(e.classList).forEach(n=>{t.some(e=>e(n))||e.classList.remove(n)}),e.classList.length||e.removeAttribute("class")}if(e.hasChildNodes()){if("*"===a)return;if(a)l.length&&!e.querySelector(l.join(","))?(Cs(e.childNodes,t,n,i),ts(e)):e.parentNode&&"BODY"===e.parentNode.nodeName&&Jo(e)?(Cs(e.childNodes,t,n,i),Array.from(e.childNodes).some(e=>!Jo(e))&&ts(e)):Cs(e.childNodes,t,a,i);else for(;e.firstChild;)oe(e.firstChild)}}})}function Ss(e,t,n){const i=document.implementation.createHTMLDocument("");return i.body.innerHTML=e,Cs(i.body.childNodes,i,t,n),i.body.innerHTML}function As(e){e.nodeType===e.COMMENT_NODE&&oe(e)}function Is(e,t){return e.every(e=>function(e,t){if(Xo(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)&&Is(Array.from(e.children),t))}function Es(e){return"BR"===e.nodeName&&!!e.previousSibling&&"BR"===e.previousSibling.nodeName}function js(e,t){(0,re.e)(t.parentNode,"referenceNode.parentNode"),t.parentNode.insertBefore(e,t),e.appendChild(t)}function Ts(e,t){const n=e.ownerDocument.createElement(t);for(;e.firstChild;)n.appendChild(e.firstChild);return(0,re.e)(e.parentNode,"node.parentNode"),e.parentNode.replaceChild(n,e),n}function Bs(e,t){if("SPAN"===e.nodeName&&e.style){const{fontWeight:n,fontStyle:i,textDecorationLine:r,textDecoration:o,verticalAlign:s}=e.style,a=e;"bold"!==n&&"700"!==n||js(t.createElement("strong"),a),"italic"===i&&js(t.createElement("em"),a),("line-through"===r||o.includes("line-through"))&&js(t.createElement("s"),a),"super"===s?js(t.createElement("sup"),a):"sub"===s&&js(t.createElement("sub"),a)}else if("B"===e.nodeName)Ts(e,"strong");else if("I"===e.nodeName)Ts(e,"em");else if("A"===e.nodeName){const t=e;t.target&&"_blank"===t.target.toLowerCase()?t.rel="noreferrer noopener":(t.removeAttribute("target"),t.removeAttribute("rel")),t.name&&!t.id&&(t.id=t.name),t.id&&!t.ownerDocument.querySelector(`[href="#${t.id}"]`)&&t.removeAttribute("id")}}function Ns(e){"SCRIPT"!==e.nodeName&&"NOSCRIPT"!==e.nodeName&&"TEMPLATE"!==e.nodeName&&"STYLE"!==e.nodeName||e.parentNode.removeChild(e)}function Rs(e){if(e.nodeType!==e.ELEMENT_NODE)return;const t=e,n=t.getAttribute("style");n&&n.includes("mso-list")&&"ignore"===n.split(";").reduce((e,t)=>{const[n,i]=t.split(":");return n&&i&&(e[n.trim().toLowerCase()]=i.trim().toLowerCase()),e},{})["mso-list"]&&t.remove()}function Os(e){return"OL"===e.nodeName||"UL"===e.nodeName}function Ls(e,t){if("P"!==e.nodeName)return;const n=e,i=n.getAttribute("style");if(!i||!i.includes("mso-list"))return;const r=n.previousElementSibling;if(!r||!Os(r)){const e=n.textContent.trim().slice(0,1),i=/[1iIaA]/.test(e),r=t.createElement(i?"ol":"ul");i&&r.setAttribute("type",e),n.parentNode.insertBefore(r,n)}const o=n.previousElementSibling,s=o.nodeName,a=t.createElement("li");let l=o;a.innerHTML=_s(n.innerHTML,[Rs]);const c=/mso-list\s*:[^;]+level([0-9]+)/i.exec(i);let u=c&&parseInt(c[1],10)-1||0;for(;u--;)l=l.lastChild||l,Os(l)&&(l=l.lastChild||l);Os(l)||(l=l.appendChild(t.createElement(s))),l.appendChild(a),n.parentNode.removeChild(n)}var Ms={};function Ps(e){const t=window.URL.createObjectURL(e);return Ms[t]=e,t}function Ds(e){Ms[e]&&window.URL.revokeObjectURL(e),delete Ms[e]}function Fs(e){return!(!e||!e.indexOf)&&0===e.indexOf("blob:")}function zs(e){if("IMG"!==e.nodeName)return;const t=e;if(0===t.src.indexOf("file:")&&(t.src=""),0===t.src.indexOf("data:")){const[e,n]=t.src.split(","),[i]=e.slice(5).split(";");if(!n||!i)return void(t.src="");let r;try{r=atob(n)}catch{return void(t.src="")}const o=new Uint8Array(r.length);for(let e=0;e<o.length;e++)o[e]=r.charCodeAt(e);const s=i.replace("/","."),a=new window.File([o],s,{type:i});t.src=Ps(a)}1!==t.height&&1!==t.width||t.parentNode.removeChild(t)}function Vs(e){if("DIV"!==e.nodeName)return;const t=e;t.innerHTML=Zo(t.innerHTML)}var Us=new(n(49482).Converter)({noHeaderId:!0,tables:!0,literalMidWordUnderscores:!0,omitExtraWLInCodeBlocks:!0,simpleLineBreaks:!0,strikethrough:!0});function $s(e){if("IFRAME"===e.nodeName){const t=e,n=t.ownerDocument.createTextNode(t.src);t.parentNode.replaceChild(n,t)}}function Hs(e){const t=e;t.id&&0===t.id.indexOf("docs-internal-guid-")&&("B"===t.tagName?ts(e):t.removeAttribute("id"))}function Ws(e){if(e.nodeType!==e.TEXT_NODE)return;let t=e;for(;t=t.parentNode;)if(t.nodeType===t.ELEMENT_NODE&&"PRE"===t.nodeName)return;const n=e;let i=n.data.replace(/[ \r\n\t]+/g," ");if(" "===i[0]){const t=xs(e,"previous");t&&"BR"!==t.nodeName&&" "!==t.textContent.slice(-1)||(i=i.slice(1))}if(" "===i[i.length-1]){const t=xs(e,"next");(!t||"BR"===t.nodeName||t.nodeType===t.TEXT_NODE&&function(e){return" "===e||"\r"===e||"\n"===e||"\t"===e}(t.textContent[0]))&&(i=i.slice(0,-1))}i?n.data=i:e.parentNode.removeChild(e)}function Gs(e){"BR"===e.nodeName&&(xs(e,"next")||e.parentNode.removeChild(e))}function qs(e){"P"===e.nodeName&&(e.hasChildNodes()||e.parentNode.removeChild(e))}function Ks(e){if("SPAN"!==e.nodeName)return;if("paragraph-break"!==e.getAttribute("data-stringify-type"))return;const t=e.parentNode;t.insertBefore(e.ownerDocument.createElement("br"),e),t.insertBefore(e.ownerDocument.createElement("br"),e),t.removeChild(e)}function Ys(e){if(e.nodeType!==e.ELEMENT_NODE)return;const t=e;if("P"===t.tagName&&"heading"===t.getAttribute("role")&&t.hasAttribute("aria-level")){const e=parseInt(t.getAttribute("aria-level"),10);if(e>=1&&e<=6){const n=`H${e}`,i=t.ownerDocument.createElement(n);for(Array.from(t.attributes).forEach(e=>{"role"!==e.name&&"aria-level"!==e.name&&i.setAttribute(e.name,e.value)});t.firstChild;)i.appendChild(t.firstChild);t.parentNode.replaceChild(i,t)}}}var Js=(...e)=>window?.console?.log?.(...e);function Xs(e){return e=_s(e,[Ns,Hs,Rs,Bs,As]),e=_s(e=Ss(e,Yo("paste"),!0),[Ws,Gs]),Js("Processed inline HTML:\n\n",e),e}function Zs({HTML:e="",plainText:t="",mode:n="AUTO",tagName:i}){if(Js("Received HTML (pasteHandler):\n\n",e),Js("Received plain text (pasteHandler):\n\n",t),e=(e=(e=e.replace(/<meta[^>]+>/g,"")).replace(/^\s*<html[^>]*>\s*<body[^>]*>(?:\s*<!--\s*StartFragment\s*-->)?/i,"")).replace(/(?:<!--\s*EndFragment\s*-->\s*)?<\/body>\s*<\/html>\s*$/i,""),"INLINE"!==n){const n=e||t;if(-1!==n.indexOf("\x3c!-- wp:")){const e=Vo(n);if(1!==e.length||"core/freeform"!==e[0].name)return e}}e=_s(e=e.normalize(),[Ks]);const r=t&&(!e||function(e){if(!/<(?!br[ />])/i.test(e))return!0;const t=document.implementation.createHTMLDocument("");if(t.body.innerHTML=e,1!==t.body.children.length)return!1;const n=t.body.children.item(0),i=n.getElementsByTagName("*");for(let e=0;e<i.length;e++)if("BR"!==i.item(e).tagName)return!1;return"SPAN"===n.tagName}(e));if(r&&function(e){const t=/[\p{L}\s]+/gu;let n;for(;n=t.exec(e);){if("{"===e[n.index-1])continue;let t=n[0];if("\\"===e[n.index-1]&&(t=t.replace(/^[a-zA-Z]+/,"")),!(t.length<6))return!1}return!!/\\[a-zA-Z]+\s*\{/g.test(e)||[e=>e.includes("^")&&!e.startsWith("^"),e=>["=","+","-","/","*"].some(t=>e.includes(t)),e=>/\\[a-zA-Z]+/g.test(e)].filter(t=>t(e)).length>=2}(t))return[er("core/math",{latex:t})];var o;r&&(e=t,/^\s+$/.test(t)||(o=e,e=Us.makeHtml(function(e){return e.replace(/((?:^|\n)```)([^\n`]+)(```(?:$|\n))/,(e,t,n,i)=>`${t}\n${n}\n${i}`)}(function(e){return e.replace(/(^|\n)•( +)/g,"$1*$2")}(o)))));const s=bs(e),a=s.length>1;if(r&&!a&&"AUTO"===n&&-1===t.indexOf("\n")&&0!==t.indexOf("<p>")&&0===e.indexOf("<p>")&&(n="INLINE"),"INLINE"===n)return Xs(e);if("AUTO"===n&&!a&&function(e,t){const n=document.implementation.createHTMLDocument("");n.body.innerHTML=e;const i=Array.from(n.body.children);return!i.some(Es)&&Is(i,t)}(e,i))return Xs(e);const l=Yo("paste"),c=ys("paste"),u=s.map(e=>{if("string"!=typeof e)return e;const t=[Hs,Ls,Ns,is,zs,Bs,es,As,$s,ss,rs(),Vs,Ys],n={...c,...l};return e=_s(e,t,c),e=_s(e=Zo(e=Ss(e,n,!1)),[Ws,Gs,qs],c),Js("Processed HTML piece:\n\n",e),Ho(e,Zs)}).flat().filter(Boolean);if("AUTO"===n&&1===u.length&&_n(u[0].name,"__unstablePasteTextInline",!1)){const e=/^[\n]+|[\n]+$/g,n=t.replace(e,"");if(""!==n&&-1===n.indexOf("\n"))return Ss(Mr(u[0]),l,!1).replace(e,"")}return u}function Qs(e=[],t=[]){return e.length===t.length&&t.every(([t,,n],i)=>{const r=e[i];return t===r.name&&Qs(r.innerBlocks,n)})}function ea(e,t){return t?Object.fromEntries(Object.entries(t).map(([t,n])=>[t,ta(e[t],n)])):{}}function ta(e,t){return n=e,"html"===n?.source&&Array.isArray(t)?(0,Ar.Ay)(t):(e=>"query"===e?.source)(e)&&t?t.map(t=>ea(e.query,t)):t;var n}function na(e=[],t){return t?t.map(([t,n,i],r)=>{const o=e[r];if(o&&o.name===t){const e=na(o.innerBlocks,i);return{...o,innerBlocks:e}}const s=bn(t),a=ea(s?.attributes??{},n),[l,c]=bo(t,a);return er(l,c,na([],i))}):e}var ia={};ln(ia,{isContentBlock:function(e){const t=bn(e),n=t?.attributes,i=t?.supports?.contentRole;return!!i||!!n&&!!Object.keys(n)?.some(e=>{const t=n[e];return"content"===t?.role||"content"===t?.__experimentalRole})},fieldsKey:Symbol("fields"),formKey:Symbol("form"),parseRawBlock:zo});const ra=()=>new Map,oa=e=>{const t=ra();return e.forEach((e,n)=>{t.set(n,e)}),t},sa=(e,t,n)=>{let i=e.get(t);return void 0===i&&e.set(t,i=n()),i},aa=()=>new Set,la=e=>e[e.length-1],ca=(e,t)=>{for(let n=0;n<t.length;n++)e.push(t[n])},ua=Array.from,da=Array.isArray;class ha{constructor(){this._observers=ra()}on(e,t){return sa(this._observers,e,aa).add(t),t}once(e,t){const n=(...i)=>{this.off(e,n),t(...i)};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 ua((this._observers.get(e)||ra()).values()).forEach(e=>e(...t))}destroy(){this._observers=ra()}}class pa{constructor(){this._observers=ra()}on(e,t){sa(this._observers,e,aa).add(t)}once(e,t){const n=(...i)=>{this.off(e,n),t(...i)};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 ua((this._observers.get(e)||ra()).values()).forEach(e=>e(...t))}destroy(){this._observers=ra()}}const fa=Math.floor,ma=(Math.ceil,Math.abs),ga=(Math.imul,Math.round,Math.log10,Math.log2,Math.log,Math.sqrt,(e,t)=>e<t?e:t),ba=(e,t)=>e>t?e:t,ya=(Number.isNaN,Math.pow,Math.sign,e=>0!==e?e<0:1/e<0),va=64,_a=128,xa=127,ka=Number.MAX_SAFE_INTEGER,wa=(Number.MIN_SAFE_INTEGER,Number.isInteger||(e=>"number"==typeof e&&isFinite(e)&&fa(e)===e));Number.isNaN,Number.parseInt;const Ca=String.fromCharCode,Sa=(String.fromCodePoint,Ca(65535),/^\s*/g),Aa=/([A-Z])/g,Ia=(e,t)=>(e=>e.replace(Sa,""))(e.replace(Aa,e=>`${t}${(e=>e.toLowerCase())(e)}`)),Ea="undefined"!=typeof TextEncoder?new TextEncoder:null,ja=Ea?e=>Ea.encode(e):e=>{const t=unescape(encodeURIComponent(e)),n=t.length,i=new Uint8Array(n);for(let e=0;e<n;e++)i[e]=t.codePointAt(e);return i};let Ta="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});Ta&&1===Ta.decode(new Uint8Array).length&&(Ta=null);class Ba{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const Na=()=>new Ba,Ra=e=>{const t=new Uint8Array((e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t})(e));let n=0;for(let i=0;i<e.bufs.length;i++){const r=e.bufs[i];t.set(r,n),n+=r.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),n),t},Oa=(e,t)=>{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},La=Oa,Ma=(e,t)=>{for(;t>xa;)Oa(e,_a|xa&t),t=fa(t/128);Oa(e,xa&t)},Pa=(e,t)=>{const n=ya(t);for(n&&(t=-t),Oa(e,(t>63?_a:0)|(n?va:0)|63&t),t=fa(t/64);t>0;)Oa(e,(t>xa?_a:0)|xa&t),t=fa(t/128)},Da=new Uint8Array(3e4),Fa=Da.length/3,za=Ea&&Ea.encodeInto?(e,t)=>{if(t.length<Fa){const n=Ea.encodeInto(t,Da).written||0;Ma(e,n);for(let t=0;t<n;t++)Oa(e,Da[t])}else Ua(e,ja(t))}:(e,t)=>{const n=unescape(encodeURIComponent(t)),i=n.length;Ma(e,i);for(let t=0;t<i;t++)Oa(e,n.codePointAt(t))},Va=(e,t)=>{const n=e.cbuf.length,i=e.cpos,r=ga(n-i,t.length),o=t.length-r;e.cbuf.set(t.subarray(0,r),i),e.cpos+=r,o>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(ba(2*n,o)),e.cbuf.set(t.subarray(r)),e.cpos=o)},Ua=(e,t)=>{Ma(e,t.byteLength),Va(e,t)},$a=(e,t)=>{((e,t)=>{const n=e.cbuf.length;n-e.cpos<t&&(e.bufs.push(new Uint8Array(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(2*ba(n,t)),e.cpos=0)})(e,t);const n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},Ha=new DataView(new ArrayBuffer(4)),Wa=(e,t)=>{switch(typeof t){case"string":Oa(e,119),za(e,t);break;case"number":wa(t)&&ma(t)<=2147483647?(Oa(e,125),Pa(e,t)):(n=t,Ha.setFloat32(0,n),Ha.getFloat32(0)===n?(Oa(e,124),((e,t)=>{$a(e,4).setFloat32(0,t,!1)})(e,t)):(Oa(e,123),((e,t)=>{$a(e,8).setFloat64(0,t,!1)})(e,t)));break;case"bigint":Oa(e,122),((e,t)=>{$a(e,8).setBigInt64(0,t,!1)})(e,t);break;case"object":if(null===t)Oa(e,126);else if(da(t)){Oa(e,117),Ma(e,t.length);for(let n=0;n<t.length;n++)Wa(e,t[n])}else if(t instanceof Uint8Array)Oa(e,116),Ua(e,t);else{Oa(e,118);const n=Object.keys(t);Ma(e,n.length);for(let i=0;i<n.length;i++){const r=n[i];za(e,r),Wa(e,t[r])}}break;case"boolean":Oa(e,t?120:121);break;default:Oa(e,127)}var n};class Ga extends Ba{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&Ma(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const qa=e=>{e.count>0&&(Pa(e.encoder,1===e.count?e.s:-e.s),e.count>1&&Ma(e.encoder,e.count-2))};class Ka{constructor(){this.encoder=new Ba,this.s=0,this.count=0}write(e){this.s===e?this.count++:(qa(this),this.count=1,this.s=e)}toUint8Array(){return qa(this),Ra(this.encoder)}}const Ya=e=>{if(e.count>0){const t=2*e.diff+(1===e.count?0:1);Pa(e.encoder,t),e.count>1&&Ma(e.encoder,e.count-2)}};class Ja{constructor(){this.encoder=new Ba,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(Ya(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return Ya(this),Ra(this.encoder)}}class Xa{constructor(){this.sarr=[],this.s="",this.lensE=new Ka}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 Ba;return this.sarr.push(this.s),this.s="",za(e,this.sarr.join("")),Va(e,this.lensE.toUint8Array()),Ra(e)}}const Za=e=>new Error(e),Qa=()=>{throw Za("Method unimplemented")},el=()=>{throw Za("Unexpected case")},tl=Za("Unexpected end of array"),nl=Za("Integer out of Range");class il{constructor(e){this.arr=e,this.pos=0}}const rl=e=>new il(e),ol=e=>((e,t)=>{const n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n})(e,al(e)),sl=e=>e.arr[e.pos++],al=e=>{let t=0,n=1;const i=e.arr.length;for(;e.pos<i;){const i=e.arr[e.pos++];if(t+=(i&xa)*n,n*=128,i<_a)return t;if(t>ka)throw nl}throw tl},ll=e=>{let t=e.arr[e.pos++],n=63&t,i=64;const r=(t&va)>0?-1:1;if(0===(t&_a))return r*n;const o=e.arr.length;for(;e.pos<o;){if(t=e.arr[e.pos++],n+=(t&xa)*i,i*=128,t<_a)return r*n;if(n>ka)throw nl}throw tl},cl=Ta?e=>Ta.decode(ol(e)):e=>{let t=al(e);if(0===t)return"";{let n=String.fromCodePoint(sl(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(sl(e));else for(;t>0;){const i=t<1e4?t:1e4,r=e.arr.subarray(e.pos,e.pos+i);e.pos+=i,n+=String.fromCodePoint.apply(null,r),t-=i}return decodeURIComponent(escape(n))}},ul=(e,t)=>{const n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n},dl=[e=>{},e=>null,ll,e=>ul(e,4).getFloat32(0,!1),e=>ul(e,8).getFloat64(0,!1),e=>ul(e,8).getBigInt64(0,!1),e=>!1,e=>!0,cl,e=>{const t=al(e),n={};for(let i=0;i<t;i++)n[cl(e)]=hl(e);return n},e=>{const t=al(e),n=[];for(let i=0;i<t;i++)n.push(hl(e));return n},ol],hl=e=>dl[127-sl(e)](e);class pl extends il{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=al(this)+1:this.count=-1),this.count--,this.s;var e}}class fl extends il{constructor(e){super(e),this.s=0,this.count=0}read(){if(0===this.count){this.s=ll(this);const e=ya(this.s);this.count=1,e&&(this.s=-this.s,this.count=al(this)+2)}return this.count--,this.s}}class ml extends il{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(0===this.count){const e=ll(this),t=1&e;this.diff=fa(e/2),this.count=1,t&&(this.count=al(this)+2)}return this.s+=this.diff,this.count--,this.s}}class gl{constructor(e){this.decoder=new fl(e),this.str=cl(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 bl=crypto.getRandomValues.bind(crypto);Math.random;const yl=()=>bl(new Uint32Array(1))[0],vl=[1e7]+-1e3+-4e3+-8e3+-1e11,_l=()=>vl.replace(/[018]/g,e=>(e^yl()&15>>e/4).toString(16)),xl=e=>new Promise(e),kl=(Promise.all.bind(Promise),e=>void 0===e?null:e);let wl=new class{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}},Cl=!0;try{"undefined"!=typeof localStorage&&localStorage&&(wl=localStorage,Cl=!1)}catch(e){}const Sl=wl,Al=Object.assign,Il=Object.keys,El=e=>Il(e).length,jl=e=>Il(e).length,Tl=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Bl=Object.freeze,Nl=e=>{for(const t in e){const n=e[t];"object"!=typeof n&&"function"!=typeof n||Nl(e[t])}return Bl(e)},Rl=(e,t,n=0)=>{try{for(;n<e.length;n++)e[n](...t)}finally{n<e.length&&Rl(e,t,n+1)}},Ol=e=>e,Ll=(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<e.length;n++)if(e[n]!==t[n])return!1;break;case Set:if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;break;case Map:if(e.size!==t.size)return!1;for(const n of e.keys())if(!t.has(n)||!Ll(e.get(n),t.get(n)))return!1;break;case Object:if(El(e)!==El(t))return!1;for(const n in e)if(!Tl(e,n)||!Ll(e[n],t[n]))return!1;break;case Array:if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Ll(e[n],t[n]))return!1;break;default:return!1}return!0},Ml="undefined"!=typeof process&&process.release&&/node|io\.js/.test(process.release.name)&&"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0),Pl="undefined"!=typeof window&&"undefined"!=typeof document&&!Ml;let Dl;"undefined"!=typeof navigator&&/Mac/.test(navigator.platform);const Fl=[],zl=e=>(()=>{if(void 0===Dl)if(Ml){Dl=ra();const e=process.argv;let t=null;for(let n=0;n<e.length;n++){const i=e[n];"-"===i[0]?(null!==t&&Dl.set(t,""),t=i):null!==t?(Dl.set(t,i),t=null):Fl.push(i)}null!==t&&Dl.set(t,"")}else"object"==typeof location?(Dl=ra(),(location.search||"?").slice(1).split("&").forEach(e=>{if(0!==e.length){const[t,n]=e.split("=");Dl.set(`--${Ia(t,"-")}`,n),Dl.set(`-${Ia(t,"-")}`,n)}})):Dl=ra();return Dl})().has(e),Vl=e=>kl(Ml?process.env[e.toUpperCase().replaceAll("-","_")]:Sl.getItem(e)),Ul=e=>zl("--"+e)||null!==Vl(e);var $l;Ul("production");const Hl=Ml&&($l=process.env.FORCE_COLOR,["true","1","2"].includes($l))||!zl("--no-colors")&&!Ul("no-color")&&(!Ml||process.stdout.isTTY)&&(!Ml||zl("--color")||null!==Vl("COLORTERM")||(Vl("TERM")||"").includes("color")),Wl=e=>new Uint8Array(e),Gl=Pl?e=>{let t="";for(let n=0;n<e.byteLength;n++)t+=Ca(e[n]);return btoa(t)}:e=>Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("base64"),ql=Pl?e=>{const t=atob(e),n=Wl(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}:e=>{const t=Buffer.from(e,"base64");return n=t.buffer,i=t.byteOffset,r=t.byteLength,new Uint8Array(n,i,r);var n,i,r};class Kl{constructor(e,t){this.left=e,this.right=t}}const Yl=(e,t)=>new Kl(e,t),Jl="undefined"!=typeof document?document:{},Xl=("undefined"!=typeof DOMParser&&new DOMParser,e=>((e,t)=>{const n=[];for(const[i,r]of e)n.push(t(r,i));return n})(e,(e,t)=>`${t}:${e};`).join("")),Zl=(Jl.ELEMENT_NODE,Jl.TEXT_NODE,Jl.CDATA_SECTION_NODE,Jl.COMMENT_NODE,Jl.DOCUMENT_NODE,Jl.DOCUMENT_TYPE_NODE,Jl.DOCUMENT_FRAGMENT_NODE,Symbol),Ql=Date.now,ec=Zl(),tc=Zl(),nc=Zl(),ic=Zl(),rc=Zl(),oc=Zl(),sc=Zl(),ac=Zl(),lc=Zl();Ql();const cc={[ec]:Yl("font-weight","bold"),[tc]:Yl("font-weight","normal"),[nc]:Yl("color","blue"),[rc]:Yl("color","green"),[ic]:Yl("color","grey"),[oc]:Yl("color","red"),[sc]:Yl("color","purple"),[ac]:Yl("color","orange"),[lc]:Yl("color","black")},uc=Hl?e=>{1===e.length&&e[0]?.constructor===Function&&(e=e[0]());const t=[],n=[],i=ra();let r=[],o=0;for(;o<e.length;o++){const r=e[o],s=cc[r];if(void 0!==s)i.set(s.left,s.right);else{if(void 0===r)break;if(r.constructor!==String&&r.constructor!==Number)break;{const e=Xl(i);o>0||e.length>0?(t.push("%c"+r),n.push(e)):t.push(r)}}}for(o>0&&(r=n,r.unshift(t.join("")));o<e.length;o++){const t=e[o];t instanceof Symbol||r.push(t)}return r}:e=>{1===e.length&&e[0]?.constructor===Function&&(e=e[0]());const t=[],n=[];let i=0;for(;i<e.length;i++){const n=e[i];if(void 0===n)break;if(n.constructor===String||n.constructor===Number)t.push(n);else if(n.constructor===Object)break}for(i>0&&n.push(t.join(""));i<e.length;i++){const t=e[i];t instanceof Symbol||n.push(t)}return n},dc=(...e)=>{console.warn(...uc(e)),e.unshift(ac),hc.forEach(t=>t.print(e))},hc=aa(),pc=e=>({[Symbol.iterator](){return this},next:e}),fc=(e,t)=>pc(()=>{const{done:n,value:i}=e.next();return{done:n,value:n?void 0:t(i)}});class mc{constructor(e,t){this.clock=e,this.len=t}}class gc{constructor(){this.clients=new Map}}const bc=(e,t,n)=>t.clients.forEach((t,i)=>{const r=e.doc.store.clients.get(i);if(null!=r){const i=r[r.length-1],o=i.id.clock+i.length;for(let i=0,s=t[i];i<t.length&&s.clock<o;s=t[++i])bu(e,r,s.clock,s.len,n)}}),yc=(e,t)=>{const n=e.clients.get(t.client);return void 0!==n&&null!==((e,t)=>{let n=0,i=e.length-1;for(;n<=i;){const r=fa((n+i)/2),o=e[r],s=o.clock;if(s<=t){if(t<s+o.len)return r;n=r+1}else i=r-1}return null})(n,t.clock)},vc=e=>{e.clients.forEach(e=>{let t,n;for(e.sort((e,t)=>e.clock-t.clock),t=1,n=1;t<e.length;t++){const i=e[n-1],r=e[t];i.clock+i.len>=r.clock?i.len=ba(i.len,r.clock+r.len-i.clock):(n<t&&(e[n]=r),n++)}e.length=n})},_c=e=>{const t=new gc;for(let n=0;n<e.length;n++)e[n].clients.forEach((i,r)=>{if(!t.clients.has(r)){const o=i.slice();for(let t=n+1;t<e.length;t++)ca(o,e[t].clients.get(r)||[]);t.clients.set(r,o)}});return vc(t),t},xc=(e,t,n,i)=>{sa(e.clients,t,()=>[]).push(new mc(n,i))},kc=()=>new gc,wc=(e,t)=>{Ma(e.restEncoder,t.clients.size),ua(t.clients.entries()).sort((e,t)=>t[0]-e[0]).forEach(([t,n])=>{e.resetDsCurVal(),Ma(e.restEncoder,t);const i=n.length;Ma(e.restEncoder,i);for(let t=0;t<i;t++){const i=n[t];e.writeDsClock(i.clock),e.writeDsLen(i.len)}})},Cc=e=>{const t=new gc,n=al(e.restDecoder);for(let i=0;i<n;i++){e.resetDsCurVal();const n=al(e.restDecoder),i=al(e.restDecoder);if(i>0){const r=sa(t.clients,n,()=>[]);for(let t=0;t<i;t++)r.push(new mc(e.readDsClock(),e.readDsLen()))}}return t},Sc=(e,t,n)=>{const i=new gc,r=al(e.restDecoder);for(let o=0;o<r;o++){e.resetDsCurVal();const r=al(e.restDecoder),o=al(e.restDecoder),s=n.clients.get(r)||[],a=uu(n,r);for(let n=0;n<o;n++){const n=e.readDsClock(),o=n+e.readDsLen();if(n<a){a<o&&xc(i,r,a,o-a);let e=hu(s,n),l=s[e];for(!l.deleted&&l.id.clock<n&&(s.splice(e+1,0,sh(t,l,n-l.id.clock)),e++);e<s.length&&(l=s[e++],l.id.clock<o);)l.deleted||(o<l.id.clock+l.length&&s.splice(e,0,sh(t,l,o-l.id.clock)),l.delete(t))}else xc(i,r,n,o-n)}}if(i.clients.size>0){const e=new Lc;return Ma(e.restEncoder,0),wc(e,i),e.toUint8Array()}return null},Ac=yl;class Ic extends ha{constructor({guid:e=_l(),collectionid:t=null,gc:n=!0,gcFilter:i=()=>!0,meta:r=null,autoLoad:o=!1,shouldLoad:s=!0}={}){super(),this.gc=n,this.gcFilter=i,this.clientID=Ac(),this.guid=e,this.collectionid=t,this.share=new Map,this.store=new lu,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=s,this.autoLoad=o,this.meta=r,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=xl(e=>{this.on("load",()=>{this.isLoaded=!0,e(this)})});const a=()=>xl(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])}),this.whenSynced=a()}load(){const e=this._item;null===e||this.shouldLoad||wu(e.parent.doc,e=>{e.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(ua(this.subdocs).map(e=>e.guid))}transact(e,t=null){return wu(this,e,t)}get(e,t=Ku){const n=sa(this.share,e,()=>{const e=new t;return e._integrate(this,null),e}),i=n.constructor;if(t!==Ku&&i!==t){if(i===Ku){const i=new t;i._map=n._map,n._map.forEach(e=>{for(;null!==e;e=e.left)e.parent=i}),i._start=n._start;for(let e=i._start;null!==e;e=e.right)e.parent=i;return i._length=n._length,this.share.set(e,i),i._integrate(this,null),i}throw new Error(`Type with the name ${e} has already been defined with a different constructor`)}return n}getArray(e=""){return this.get(e,hd)}getText(e=""){return this.get(e,Td)}getMap(e=""){return this.get(e,fd)}getXmlElement(e=""){return this.get(e,Rd)}getXmlFragment(e=""){return this.get(e,Nd)}toJSON(){const e={};return this.share.forEach((t,n)=>{e[n]=t.toJSON()}),e}destroy(){this.isDestroyed=!0,ua(this.subdocs).forEach(e=>e.destroy());const e=this._item;if(null!==e){this._item=null;const t=e.content;t.doc=new Ic({guid:this.guid,...t.opts,shouldLoad:!1}),t.doc._item=e,wu(e.parent.doc,n=>{const i=t.doc;e.deleted||n.subdocsAdded.add(i),n.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class Ec{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return al(this.restDecoder)}readDsLen(){return al(this.restDecoder)}}class jc extends Ec{readLeftID(){return Kc(al(this.restDecoder),al(this.restDecoder))}readRightID(){return Kc(al(this.restDecoder),al(this.restDecoder))}readClient(){return al(this.restDecoder)}readInfo(){return sl(this.restDecoder)}readString(){return cl(this.restDecoder)}readParentInfo(){return 1===al(this.restDecoder)}readTypeRef(){return al(this.restDecoder)}readLen(){return al(this.restDecoder)}readAny(){return hl(this.restDecoder)}readBuf(){return(e=>{const t=Wl(e.byteLength);return t.set(e),t})(ol(this.restDecoder))}readJSON(){return JSON.parse(cl(this.restDecoder))}readKey(){return cl(this.restDecoder)}}class Tc{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=al(this.restDecoder),this.dsCurrVal}readDsLen(){const e=al(this.restDecoder)+1;return this.dsCurrVal+=e,e}}class Bc extends Tc{constructor(e){super(e),this.keys=[],al(e),this.keyClockDecoder=new ml(ol(e)),this.clientDecoder=new fl(ol(e)),this.leftClockDecoder=new ml(ol(e)),this.rightClockDecoder=new ml(ol(e)),this.infoDecoder=new pl(ol(e),sl),this.stringDecoder=new gl(ol(e)),this.parentInfoDecoder=new pl(ol(e),sl),this.typeRefDecoder=new fl(ol(e)),this.lenDecoder=new fl(ol(e))}readLeftID(){return new Gc(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new Gc(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 hl(this.restDecoder)}readBuf(){return ol(this.restDecoder)}readJSON(){return hl(this.restDecoder)}readKey(){const e=this.keyClockDecoder.read();if(e<this.keys.length)return this.keys[e];{const e=this.stringDecoder.read();return this.keys.push(e),e}}}class Nc{constructor(){this.restEncoder=Na()}toUint8Array(){return Ra(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){Ma(this.restEncoder,e)}writeDsLen(e){Ma(this.restEncoder,e)}}class Rc extends Nc{writeLeftID(e){Ma(this.restEncoder,e.client),Ma(this.restEncoder,e.clock)}writeRightID(e){Ma(this.restEncoder,e.client),Ma(this.restEncoder,e.clock)}writeClient(e){Ma(this.restEncoder,e)}writeInfo(e){La(this.restEncoder,e)}writeString(e){za(this.restEncoder,e)}writeParentInfo(e){Ma(this.restEncoder,e?1:0)}writeTypeRef(e){Ma(this.restEncoder,e)}writeLen(e){Ma(this.restEncoder,e)}writeAny(e){Wa(this.restEncoder,e)}writeBuf(e){Ua(this.restEncoder,e)}writeJSON(e){za(this.restEncoder,JSON.stringify(e))}writeKey(e){za(this.restEncoder,e)}}class Oc{constructor(){this.restEncoder=Na(),this.dsCurrVal=0}toUint8Array(){return Ra(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){const t=e-this.dsCurrVal;this.dsCurrVal=e,Ma(this.restEncoder,t)}writeDsLen(e){0===e&&el(),Ma(this.restEncoder,e-1),this.dsCurrVal+=e}}class Lc extends Oc{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new Ja,this.clientEncoder=new Ka,this.leftClockEncoder=new Ja,this.rightClockEncoder=new Ja,this.infoEncoder=new Ga(La),this.stringEncoder=new Xa,this.parentInfoEncoder=new Ga(La),this.typeRefEncoder=new Ka,this.lenEncoder=new Ka}toUint8Array(){const e=Na();return Ma(e,0),Ua(e,this.keyClockEncoder.toUint8Array()),Ua(e,this.clientEncoder.toUint8Array()),Ua(e,this.leftClockEncoder.toUint8Array()),Ua(e,this.rightClockEncoder.toUint8Array()),Ua(e,Ra(this.infoEncoder)),Ua(e,this.stringEncoder.toUint8Array()),Ua(e,Ra(this.parentInfoEncoder)),Ua(e,this.typeRefEncoder.toUint8Array()),Ua(e,this.lenEncoder.toUint8Array()),Va(e,Ra(this.restEncoder)),Ra(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(e?1:0)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){Wa(this.restEncoder,e)}writeBuf(e){Ua(this.restEncoder,e)}writeJSON(e){Wa(this.restEncoder,e)}writeKey(e){const t=this.keyMap.get(e);void 0===t?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(t)}}const Mc=(e,t,n)=>{const i=new Map;n.forEach((e,n)=>{uu(t,n)>e&&i.set(n,e)}),cu(t).forEach((e,t)=>{n.has(t)||i.set(t,0)}),Ma(e.restEncoder,i.size),ua(i.entries()).sort((e,t)=>t[0]-e[0]).forEach(([n,i])=>{((e,t,n,i)=>{i=ba(i,t[0].id.clock);const r=hu(t,i);Ma(e.restEncoder,t.length-r),e.writeClient(n),Ma(e.restEncoder,i);const o=t[r];o.write(e,i-o.id.clock);for(let n=r+1;n<t.length;n++)t[n].write(e,0)})(e,t.clients.get(n),n,i)})},Pc=(e,t,n,i=Bc)=>{const r=rl(t);((e,t,n,i=new Bc(e))=>{wu(t,e=>{e.local=!1;let t=!1;const n=e.doc,r=n.store,o=((e,t)=>{const n=ra(),i=al(e.restDecoder);for(let r=0;r<i;r++){const i=al(e.restDecoder),r=new Array(i),o=e.readClient();let s=al(e.restDecoder);n.set(o,{i:0,refs:r});for(let n=0;n<i;n++){const i=e.readInfo();switch(31&i){case 0:{const t=e.readLen();r[n]=new Dd(Kc(o,s),t),s+=t;break}case 10:{const t=al(e.restDecoder);r[n]=new hh(Kc(o,s),t),s+=t;break}default:{const a=!(192&i),l=new ch(Kc(o,s),null,(i&_a)===_a?e.readLeftID():null,null,(i&va)===va?e.readRightID():null,a?e.readParentInfo()?t.get(e.readString()):e.readLeftID():null,!a||32&~i?null:e.readString(),uh(e,i));r[n]=l,s+=l.length}}}}return n})(i,n),s=((e,t,n)=>{const i=[];let r=ua(n.keys()).sort((e,t)=>e-t);if(0===r.length)return null;const o=()=>{if(0===r.length)return null;let e=n.get(r[r.length-1]);for(;e.refs.length===e.i;){if(r.pop(),!(r.length>0))return null;e=n.get(r[r.length-1])}return e};let s=o();if(null===s)return null;const a=new lu,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 i){const t=e.id.client,i=n.get(t);i?(i.i--,a.clients.set(t,i.refs.slice(i.i)),n.delete(t),i.i=0,i.refs=[]):a.clients.set(t,[e]),r=r.filter(e=>e!==t)}i.length=0};for(;;){if(u.constructor!==hh){const r=sa(d,u.id.client,()=>uu(t,u.id.client))-u.id.clock;if(r<0)i.push(u),c(u.id.client,u.id.clock-1),h();else{const o=u.getMissing(e,t);if(null!==o){i.push(u);const e=n.get(o)||{refs:[],i:0};if(e.refs.length!==e.i){u=e.refs[e.i++];continue}c(o,uu(t,o)),h()}else(0===r||r<u.length)&&(u.integrate(e,r),d.set(u.id.client,u.id.clock+u.length))}}if(i.length>0)u=i.pop();else if(null!==s&&s.i<s.refs.length)u=s.refs[s.i++];else{if(s=o(),null===s)break;u=s.refs[s.i++]}}if(a.clients.size>0){const e=new Lc;return Mc(e,a,new Map),Ma(e.restEncoder,0),{missing:l,update:e.toUint8Array()}}return null})(e,r,o),a=r.pendingStructs;if(a){for(const[e,n]of a.missing)if(n<uu(r,e)){t=!0;break}if(s){for(const[e,t]of s.missing){const n=a.missing.get(e);(null==n||n>t)&&a.missing.set(e,t)}a.update=Nu([a.update,s.update])}}else r.pendingStructs=s;const l=Sc(i,e,r);if(r.pendingDs){const t=new Bc(rl(r.pendingDs));al(t.restDecoder);const n=Sc(t,e,r);r.pendingDs=l&&n?Nu([l,n]):l||n}else r.pendingDs=l;if(t){const t=r.pendingStructs.update;r.pendingStructs=null,Pc(e.doc,t)}},n,!1)})(r,e,n,new i(r))},Dc=(e,t=new Uint8Array([0]),n=new Lc)=>{((e,t,n=new Map)=>{Mc(e,t.store,n),wc(e,(e=>{const t=kc();return e.clients.forEach((e,n)=>{const i=[];for(let t=0;t<e.length;t++){const n=e[t];if(n.deleted){const r=n.id.clock;let o=n.length;if(t+1<e.length)for(let n=e[t+1];t+1<e.length&&n.deleted;n=e[1+ ++t])o+=n.length;i.push(new mc(r,o))}}i.length>0&&t.clients.set(n,i)}),t})(t.store))})(n,e,Fc(t));const i=[n.toUint8Array()];if(e.store.pendingDs&&i.push(e.store.pendingDs),e.store.pendingStructs&&i.push(Ru(e.store.pendingStructs.update,t)),i.length>1){if(n.constructor===Rc)return Tu(i.map((e,t)=>0===t?e:Pu(e)));if(n.constructor===Lc)return Nu(i)}return i[0]},Fc=e=>(e=>{const t=new Map,n=al(e.restDecoder);for(let i=0;i<n;i++){const n=al(e.restDecoder),i=al(e.restDecoder);t.set(n,i)}return t})(new Ec(rl(e))),zc=(e,t)=>(Ma(e.restEncoder,t.size),ua(t.entries()).sort((e,t)=>t[0]-e[0]).forEach(([t,n])=>{Ma(e.restEncoder,t),Ma(e.restEncoder,n)}),e);class Vc{constructor(){this.l=[]}}const Uc=()=>new Vc,$c=(e,t)=>e.l.push(t),Hc=(e,t)=>{const n=e.l,i=n.length;e.l=n.filter(e=>t!==e),i===e.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},Wc=(e,t,n)=>Rl(e.l,[t,n]);class Gc{constructor(e,t){this.client=e,this.clock=t}}const qc=(e,t)=>e===t||null!==e&&null!==t&&e.client===t.client&&e.clock===t.clock,Kc=(e,t)=>new Gc(e,t),Yc=e=>{for(const[t,n]of e.doc.share.entries())if(n===e)return t;throw el()},Jc=(e,t)=>{for(;null!==t;){if(t.parent===e)return!0;t=t.parent._item}return!1};class Xc{constructor(e,t,n,i=0){this.type=e,this.tname=t,this.item=n,this.assoc=i}}class Zc{constructor(e,t,n=0){this.type=e,this.index=t,this.assoc=n}}const Qc=(e,t,n)=>{let i=null,r=null;return null===e._item?r=Yc(e):i=Kc(e._item.id.client,e._item.id.clock),new Xc(i,r,t,n)},eu=(e,t,n=0)=>{let i=e._start;if(n<0){if(0===t)return Qc(e,null,n);t--}for(;null!==i;){if(!i.deleted&&i.countable){if(i.length>t)return Qc(e,Kc(i.id.client,i.id.clock+t),n);t-=i.length}if(null===i.right&&n<0)return Qc(e,i.lastId,n);i=i.right}return Qc(e,null,n)},tu=(e,t,n=!0)=>{const i=t.store,r=e.item,o=e.type,s=e.tname,a=e.assoc;let l=null,c=0;if(null!==r){if(uu(i,r.client)<=r.clock)return null;const e=n?rh(i,r):((e,t)=>{const n=pu(e,t);return{item:n,diff:t.clock-n.id.clock}})(i,r),t=e.item;if(!(t instanceof ch))return null;if(l=t.parent,null===l._item||!l._item.deleted){c=t.deleted||!t.countable?0:e.diff+(a>=0?0:1);let n=t.left;for(;null!==n;)!n.deleted&&n.countable&&(c+=n.length),n=n.left}}else{if(null!==s)l=t.get(s);else{if(null===o)throw el();{if(uu(i,o.client)<=o.clock)return null;const{item:e}=n?rh(i,o):{item:pu(i,o)};if(!(e instanceof ch&&e.content instanceof ih))return null;l=e.content.type}}c=a>=0?l._length:0}return((e,t,n=0)=>new Zc(e,t,n))(l,c,e.assoc)},nu=(e,t)=>e===t||null!==e&&null!==t&&e.tname===t.tname&&qc(e.item,t.item)&&qc(e.type,t.type)&&e.assoc===t.assoc;class iu{constructor(e,t){this.ds=e,this.sv=t}}const ru=(su=kc(),au=new Map,new iu(su,au),(e,t)=>void 0===t?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!yc(t.ds,e.id)),ou=(e,t)=>{const n=sa(e.meta,ou,aa),i=e.doc.store;n.has(t)||(t.sv.forEach((t,n)=>{t<uu(i,n)&&mu(e,Kc(n,t))}),bc(e,t.ds,e=>{}),n.add(t))};var su,au;class lu{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const cu=e=>{const t=new Map;return e.clients.forEach((e,n)=>{const i=e[e.length-1];t.set(n,i.id.clock+i.length)}),t},uu=(e,t)=>{const n=e.clients.get(t);if(void 0===n)return 0;const i=n[n.length-1];return i.id.clock+i.length},du=(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 el()}n.push(t)},hu=(e,t)=>{let n=0,i=e.length-1,r=e[i],o=r.id.clock;if(o===t)return i;let s=fa(t/(o+r.length-1)*i);for(;n<=i;){if(r=e[s],o=r.id.clock,o<=t){if(t<o+r.length)return s;n=s+1}else i=s-1;s=fa((n+i)/2)}throw el()},pu=(e,t)=>{const n=e.clients.get(t.client);return n[hu(n,t.clock)]},fu=(e,t,n)=>{const i=hu(t,n),r=t[i];return r.id.clock<n&&r instanceof ch?(t.splice(i+1,0,sh(e,r,n-r.id.clock)),i+1):i},mu=(e,t)=>{const n=e.doc.store.clients.get(t.client);return n[fu(e,n,t.clock)]},gu=(e,t,n)=>{const i=t.clients.get(n.client),r=hu(i,n.clock),o=i[r];return n.clock!==o.id.clock+o.length-1&&o.constructor!==Dd&&i.splice(r+1,0,sh(e,o,n.clock-o.id.clock+1)),o},bu=(e,t,n,i,r)=>{if(0===i)return;const o=n+i;let s,a=fu(e,t,n);do{s=t[a++],o<s.id.clock+s.length&&fu(e,t,o),r(s)}while(a<t.length&&t[a].id.clock<o)};class yu{constructor(e,t,n){this.doc=e,this.deleteSet=new gc,this.beforeState=cu(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=t,this.meta=new Map,this.local=n,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const vu=(e,t)=>!(0===t.deleteSet.clients.size&&!((e,t)=>{for(const[n,i]of e)if(t(i,n))return!0;return!1})(t.afterState,(e,n)=>t.beforeState.get(n)!==e)||(vc(t.deleteSet),((e,t)=>{Mc(e,t.doc.store,t.beforeState)})(e,t),wc(e,t.deleteSet),0)),_u=(e,t,n)=>{const i=t._item;(null===i||i.id.clock<(e.beforeState.get(i.id.client)||0)&&!i.deleted)&&sa(e.changed,t,aa).add(n)},xu=(e,t)=>{let n=e[t],i=e[t-1],r=t;for(;r>0&&i.deleted===n.deleted&&i.constructor===n.constructor&&i.mergeWith(n);n=i,i=e[--r-1])n instanceof ch&&null!==n.parentSub&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,i);const o=t-r;return o&&e.splice(t+1-o,o),o},ku=(e,t)=>{if(t<e.length){const n=e[t],i=n.doc,r=i.store,o=n.deleteSet,s=n._mergeStructs;try{vc(o),n.afterState=cu(n.doc.store),i.emit("beforeObserverCalls",[n,i]);const e=[];n.changed.forEach((t,i)=>e.push(()=>{null!==i._item&&i._item.deleted||i._callObserver(n,t)})),e.push(()=>{n.changedParentTypes.forEach((t,i)=>{i._dEH.l.length>0&&(null===i._item||!i._item.deleted)&&((t=t.filter(e=>null===e.target._item||!e.target._item.deleted)).forEach(e=>{e.currentTarget=i,e._path=null}),t.sort((e,t)=>e.path.length-t.path.length),e.push(()=>{Wc(i._dEH,t,n)}))}),e.push(()=>i.emit("afterTransaction",[n,i])),e.push(()=>{n._needFormattingCleanup&&Id(n)})}),Rl(e,[])}finally{i.gc&&((e,t,n)=>{for(const[i,r]of e.clients.entries()){const e=t.clients.get(i);for(let i=r.length-1;i>=0;i--){const o=r[i],s=o.clock+o.len;for(let i=hu(e,o.clock),r=e[i];i<e.length&&r.id.clock<s;r=e[++i]){const r=e[i];if(o.clock+o.len<=r.id.clock)break;r instanceof ch&&r.deleted&&!r.keep&&n(r)&&r.gc(t,!1)}}}})(o,r,i.gcFilter),((e,t)=>{e.clients.forEach((e,n)=>{const i=t.clients.get(n);for(let t=e.length-1;t>=0;t--){const n=e[t];for(let e=ga(i.length-1,1+hu(i,n.clock+n.len-1)),t=i[e];e>0&&t.id.clock>=n.clock;t=i[e])e-=1+xu(i,e)}})})(o,r),n.afterState.forEach((e,t)=>{const i=n.beforeState.get(t)||0;if(i!==e){const e=r.clients.get(t),n=ba(hu(e,i),1);for(let t=e.length-1;t>=n;)t-=1+xu(e,t)}});for(let e=s.length-1;e>=0;e--){const{client:t,clock:n}=s[e].id,i=r.clients.get(t),o=hu(i,n);o+1<i.length&&xu(i,o+1)>1||o>0&&xu(i,o)}if(n.local||n.afterState.get(i.clientID)===n.beforeState.get(i.clientID)||(((...e)=>{console.log(...uc(e)),hc.forEach(t=>t.print(e))})(ac,ec,"[yjs] ",tc,oc,"Changed the client-id because another client seems to be using it."),i.clientID=Ac()),i.emit("afterTransactionCleanup",[n,i]),i._observers.has("update")){const e=new Rc;vu(e,n)&&i.emit("update",[e.toUint8Array(),n.origin,i,n])}if(i._observers.has("updateV2")){const e=new Lc;vu(e,n)&&i.emit("updateV2",[e.toUint8Array(),n.origin,i,n])}const{subdocsAdded:a,subdocsLoaded:l,subdocsRemoved:c}=n;(a.size>0||c.size>0||l.size>0)&&(a.forEach(e=>{e.clientID=i.clientID,null==e.collectionid&&(e.collectionid=i.collectionid),i.subdocs.add(e)}),c.forEach(e=>i.subdocs.delete(e)),i.emit("subdocs",[{loaded:l,added:a,removed:c},i,n]),c.forEach(e=>e.destroy())),e.length<=t+1?(i._transactionCleanups=[],i.emit("afterAllTransactions",[i,e])):ku(e,t+1)}}},wu=(e,t,n=null,i=!0)=>{const r=e._transactionCleanups;let o=!1,s=null;null===e._transaction&&(o=!0,e._transaction=new yu(e,n,i),r.push(e._transaction),1===r.length&&e.emit("beforeAllTransactions",[e]),e.emit("beforeTransaction",[e._transaction,e]));try{s=t(e._transaction)}finally{if(o){const t=e._transaction===r[0];e._transaction=null,t&&ku(r,0)}}return s};class Cu{constructor(e,t){this.insertions=t,this.deletions=e,this.meta=new Map}}const Su=(e,t,n)=>{bc(e,n.deletions,n=>{n instanceof ch&&t.scope.some(t=>t===e.doc||Jc(t,n))&&oh(n,!1)})},Au=(e,t,n)=>{let i=null;const r=e.doc,o=e.scope;wu(r,n=>{for(;t.length>0&&null===e.currStackItem;){const i=r.store,s=t.pop(),a=new Set,l=[];let c=!1;bc(n,s.insertions,e=>{if(e instanceof ch){if(null!==e.redone){let{item:t,diff:r}=rh(i,e.id);r>0&&(t=mu(n,Kc(t.id.client,t.id.clock+r))),e=t}!e.deleted&&o.some(t=>t===n.doc||Jc(t,e))&&l.push(e)}}),bc(n,s.deletions,e=>{e instanceof ch&&o.some(t=>t===n.doc||Jc(t,e))&&!yc(s.insertions,e.id)&&a.add(e)}),a.forEach(t=>{c=null!==lh(n,t,a,s.insertions,e.ignoreRemoteMapChanges,e)||c});for(let t=l.length-1;t>=0;t--){const i=l[t];e.deleteFilter(i)&&(i.delete(n),c=!0)}e.currStackItem=c?s:null}n.changed.forEach((e,t)=>{e.has(null)&&t._searchMarker&&(t._searchMarker.length=0)}),i=n},e);const s=e.currStackItem;if(null!=s){const t=i.changedParentTypes;e.emit("stack-item-popped",[{stackItem:s,type:n,changedParentTypes:t,origin:e},e]),e.currStackItem=null}return s};class Iu extends ha{constructor(e,{captureTimeout:t=500,captureTransaction:n=e=>!0,deleteFilter:i=()=>!0,trackedOrigins:r=new Set([null]),ignoreRemoteMapChanges:o=!1,doc:s=(da(e)?e[0].doc:e instanceof Ic?e:e.doc)}={}){super(),this.scope=[],this.doc=s,this.addToScope(e),this.deleteFilter=i,r.add(this),this.trackedOrigins=r,this.captureTransaction=n,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.currStackItem=null,this.lastChange=0,this.ignoreRemoteMapChanges=o,this.captureTimeout=t,this.afterTransactionHandler=e=>{if(!(this.captureTransaction(e)&&this.scope.some(t=>e.changedParentTypes.has(t)||t===this.doc)&&(this.trackedOrigins.has(e.origin)||e.origin&&this.trackedOrigins.has(e.origin.constructor))))return;const t=this.undoing,n=this.redoing,i=t?this.redoStack:this.undoStack;t?this.stopCapturing():n||this.clear(!1,!0);const r=new gc;e.afterState.forEach((t,n)=>{const i=e.beforeState.get(n)||0,o=t-i;o>0&&xc(r,n,i,o)});const o=Ql();let s=!1;if(this.lastChange>0&&o-this.lastChange<this.captureTimeout&&i.length>0&&!t&&!n){const t=i[i.length-1];t.deletions=_c([t.deletions,e.deleteSet]),t.insertions=_c([t.insertions,r])}else i.push(new Cu(e.deleteSet,r)),s=!0;t||n||(this.lastChange=o),bc(e,e.deleteSet,t=>{t instanceof ch&&this.scope.some(n=>n===e.doc||Jc(n,t))&&oh(t,!0)});const a=[{stackItem:i[i.length-1],origin:e.origin,type:t?"redo":"undo",changedParentTypes:e.changedParentTypes},this];s?this.emit("stack-item-added",a):this.emit("stack-item-updated",a)},this.doc.on("afterTransaction",this.afterTransactionHandler),this.doc.on("destroy",()=>{this.destroy()})}addToScope(e){const t=new Set(this.scope);(e=da(e)?e:[e]).forEach(e=>{t.has(e)||(t.add(e),(e instanceof Ku?e.doc!==this.doc:e!==this.doc)&&dc("[yjs#509] Not same Y.Doc"),this.scope.push(e))})}addTrackedOrigin(e){this.trackedOrigins.add(e)}removeTrackedOrigin(e){this.trackedOrigins.delete(e)}clear(e=!0,t=!0){(e&&this.canUndo()||t&&this.canRedo())&&this.doc.transact(n=>{e&&(this.undoStack.forEach(e=>Su(n,this,e)),this.undoStack=[]),t&&(this.redoStack.forEach(e=>Su(n,this,e)),this.redoStack=[]),this.emit("stack-cleared",[{undoStackCleared:e,redoStackCleared:t}])})}stopCapturing(){this.lastChange=0}undo(){let e;this.undoing=!0;try{e=Au(this,this.undoStack,"undo")}finally{this.undoing=!1}return e}redo(){let e;this.redoing=!0;try{e=Au(this,this.redoStack,"redo")}finally{this.redoing=!1}return e}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this),this.doc.off("afterTransaction",this.afterTransactionHandler),super.destroy()}}class Eu{constructor(e,t){this.gen=function*(e){const t=al(e.restDecoder);for(let n=0;n<t;n++){const t=al(e.restDecoder),n=e.readClient();let i=al(e.restDecoder);for(let r=0;r<t;r++){const t=e.readInfo();if(10===t){const t=al(e.restDecoder);yield new hh(Kc(n,i),t),i+=t}else if(31&t){const r=!(192&t),o=new ch(Kc(n,i),null,(t&_a)===_a?e.readLeftID():null,null,(t&va)===va?e.readRightID():null,r?e.readParentInfo()?e.readString():e.readLeftID():null,!r||32&~t?null:e.readString(),uh(e,t));yield o,i+=o.length}else{const t=e.readLen();yield new Dd(Kc(n,i),t),i+=t}}}}(e),this.curr=null,this.done=!1,this.filterSkips=t,this.next()}next(){do{this.curr=this.gen.next().value||null}while(this.filterSkips&&null!==this.curr&&this.curr.constructor===hh);return this.curr}}class ju{constructor(e){this.currClient=0,this.startClock=0,this.written=0,this.encoder=e,this.clientStructs=[]}}const Tu=e=>Nu(e,jc,Rc),Bu=(e,t)=>{if(e.constructor===Dd){const{client:n,clock:i}=e.id;return new Dd(Kc(n,i+t),e.length-t)}if(e.constructor===hh){const{client:n,clock:i}=e.id;return new hh(Kc(n,i+t),e.length-t)}{const n=e,{client:i,clock:r}=n.id;return new ch(Kc(i,r+t),null,Kc(i,r+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},Nu=(e,t=Bc,n=Lc)=>{if(1===e.length)return e[0];const i=e.map(e=>new t(rl(e)));let r=i.map(e=>new Eu(e,!0)),o=null;const s=new n,a=new ju(s);for(;r=r.filter(e=>null!==e.curr),r.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===hh?1:-1:n}return t.curr.id.client-e.curr.id.client}),0!==r.length;){const e=r[0],t=e.curr.id.client;if(null!==o){let n=e.curr,i=!1;for(;null!==n&&n.id.clock+n.length<=o.struct.id.clock+o.struct.length&&n.id.client>=o.struct.id.client;)n=e.next(),i=!0;if(null===n||n.id.client!==t||i&&n.id.clock>o.struct.id.clock+o.struct.length)continue;if(t!==o.struct.id.client)Lu(a,o.struct,o.offset),o={struct:n,offset:0},e.next();else if(o.struct.id.clock+o.struct.length<n.id.clock)if(o.struct.constructor===hh)o.struct.length=n.id.clock+n.length-o.struct.id.clock;else{Lu(a,o.struct,o.offset);const e=n.id.clock-o.struct.id.clock-o.struct.length;o={struct:new hh(Kc(t,o.struct.id.clock+o.struct.length),e),offset:0}}else{const t=o.struct.id.clock+o.struct.length-n.id.clock;t>0&&(o.struct.constructor===hh?o.struct.length-=t:n=Bu(n,t)),o.struct.mergeWith(n)||(Lu(a,o.struct,o.offset),o={struct:n,offset:0},e.next())}}else o={struct:e.curr,offset:0},e.next();for(let n=e.curr;null!==n&&n.id.client===t&&n.id.clock===o.struct.id.clock+o.struct.length&&n.constructor!==hh;n=e.next())Lu(a,o.struct,o.offset),o={struct:n,offset:0}}null!==o&&(Lu(a,o.struct,o.offset),o=null),Mu(a);const l=i.map(e=>Cc(e)),c=_c(l);return wc(s,c),s.toUint8Array()},Ru=(e,t,n=Bc,i=Lc)=>{const r=Fc(t),o=new i,s=new ju(o),a=new n(rl(e)),l=new Eu(a,!1);for(;l.curr;){const e=l.curr,t=e.id.client,n=r.get(t)||0;if(l.curr.constructor!==hh)if(e.id.clock+e.length>n)for(Lu(s,e,ba(n-e.id.clock,0)),l.next();l.curr&&l.curr.id.client===t;)Lu(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()}Mu(s);const c=Cc(a);return wc(o,c),o.toUint8Array()},Ou=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:Ra(e.encoder.restEncoder)}),e.encoder.restEncoder=Na(),e.written=0)},Lu=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&Ou(e),0===e.written&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),Ma(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},Mu=e=>{Ou(e);const t=e.encoder.restEncoder;Ma(t,e.clientStructs.length);for(let n=0;n<e.clientStructs.length;n++){const i=e.clientStructs[n];Ma(t,i.written),Va(t,i.restEncoder)}},Pu=e=>((e,t,n,i)=>{const r=new n(rl(e)),o=new Eu(r,!1),s=new i,a=new ju(s);for(let e=o.curr;null!==e;e=o.next())Lu(a,t(e),0);Mu(a);const l=Cc(r);return wc(s,l),s.toUint8Array()})(e,Ol,Bc,Rc),Du="You must not compute changes after the event-handler fired.";class Fu{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=zu(this.currentTarget,this.target))}deletes(e){return yc(this.transaction.deleteSet,e.id)}get keys(){if(null===this._keys){if(0===this.transaction.doc._transactionCleanups.length)throw Za(Du);const e=new Map,t=this.target;this.transaction.changed.get(t).forEach(n=>{if(null!==n){const i=t._map.get(n);let r,o;if(this.adds(i)){let e=i.left;for(;null!==e&&this.adds(e);)e=e.left;if(this.deletes(i)){if(null===e||!this.deletes(e))return;r="delete",o=la(e.content.getContent())}else null!==e&&this.deletes(e)?(r="update",o=la(e.content.getContent())):(r="add",o=void 0)}else{if(!this.deletes(i))return;r="delete",o=la(i.content.getContent())}e.set(n,{action:r,oldValue:o})}}),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 Za(Du);const t=this.target,n=aa(),i=aa(),r=[];if(e={added:n,deleted:i,delta:r,keys:this.keys},this.transaction.changed.get(t).has(null)){let e=null;const o=()=>{e&&r.push(e)};for(let r=t._start;null!==r;r=r.right)r.deleted?this.deletes(r)&&!this.adds(r)&&(null!==e&&void 0!==e.delete||(o(),e={delete:0}),e.delete+=r.length,i.add(r)):this.adds(r)?(null!==e&&void 0!==e.insert||(o(),e={insert:[]}),e.insert=e.insert.concat(r.content.getContent()),n.add(r)):(null!==e&&void 0!==e.retain||(o(),e={retain:0}),e.retain+=r.length);null!==e&&void 0===e.retain&&o()}this._changes=e}return e}}const zu=(e,t)=>{const n=[];for(;null!==t._item&&t!==e;){if(null!==t._item.parentSub)n.unshift(t._item.parentSub);else{let e=0,i=t._item.parent._start;for(;i!==t._item&&null!==i;)!i.deleted&&i.countable&&(e+=i.length),i=i.right;n.unshift(e)}t=t._item.parent}return n},Vu=()=>{dc("Invalid access: Add Yjs type to a document before reading data.")};let Uu=0;class $u{constructor(e,t){e.marker=!0,this.p=e,this.index=t,this.timestamp=Uu++}}const Hu=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=Uu++},Wu=(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)=>ma(t-e.index)<ma(t-n.index)?e:n);let i=e._start,r=0;for(null!==n&&(i=n.p,r=n.index,(e=>{e.timestamp=Uu++})(n));null!==i.right&&r<t;){if(!i.deleted&&i.countable){if(t<r+i.length)break;r+=i.length}i=i.right}for(;null!==i.left&&r>t;)i=i.left,!i.deleted&&i.countable&&(r-=i.length);for(;null!==i.left&&i.left.id.client===i.id.client&&i.left.id.clock+i.left.length===i.id.clock;)i=i.left,!i.deleted&&i.countable&&(r-=i.length);return null!==n&&ma(n.index-r)<i.parent.length/80?(Hu(n,i,r),n):((e,t,n)=>{if(e.length>=80){const i=e.reduce((e,t)=>e.timestamp<t.timestamp?e:t);return Hu(i,t,n),i}{const i=new $u(t,n);return e.push(i),i}})(e._searchMarker,i,r)},Gu=(e,t,n)=>{for(let i=e.length-1;i>=0;i--){const r=e[i];if(n>0){let t=r.p;for(t.marker=!1;t&&(t.deleted||!t.countable);)t=t.left,t&&!t.deleted&&t.countable&&(r.index-=t.length);if(null===t||!0===t.marker){e.splice(i,1);continue}r.p=t,t.marker=!0}(t<r.index||n>0&&t===r.index)&&(r.index=ba(t,r.index+n))}},qu=(e,t,n)=>{const i=e,r=t.changedParentTypes;for(;sa(r,e,()=>[]).push(n),null!==e._item;)e=e._item.parent;Wc(i._eH,n,t)};class Ku{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=Uc(),this._dEH=Uc(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,t){this.doc=e,this._item=t}_copy(){throw Qa()}clone(){throw Qa()}_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){$c(this._eH,e)}observeDeep(e){$c(this._dEH,e)}unobserve(e){Hc(this._eH,e)}unobserveDeep(e){Hc(this._dEH,e)}toJSON(){}}const Yu=(e,t,n)=>{e.doc??Vu(),t<0&&(t=e._length+t),n<0&&(n=e._length+n);let i=n-t;const r=[];let o=e._start;for(;null!==o&&i>0;){if(o.countable&&!o.deleted){const e=o.content.getContent();if(e.length<=t)t-=e.length;else{for(let n=t;n<e.length&&i>0;n++)r.push(e[n]),i--;t=0}}o=o.right}return r},Ju=e=>{e.doc??Vu();const t=[];let n=e._start;for(;null!==n;){if(n.countable&&!n.deleted){const e=n.content.getContent();for(let n=0;n<e.length;n++)t.push(e[n])}n=n.right}return t},Xu=(e,t)=>{let n=0,i=e._start;for(e.doc??Vu();null!==i;){if(i.countable&&!i.deleted){const r=i.content.getContent();for(let i=0;i<r.length;i++)t(r[i],n++,e)}i=i.right}},Zu=(e,t)=>{const n=[];return Xu(e,(i,r)=>{n.push(t(i,r,e))}),n},Qu=e=>{let t=e._start,n=null,i=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(),i=0,t=t.right}const e=n[i++];return n.length<=i&&(n=null),{done:!1,value:e}}}},ed=(e,t)=>{e.doc??Vu();const n=Wu(e,t);let i=e._start;for(null!==n&&(i=n.p,t-=n.index);null!==i;i=i.right)if(!i.deleted&&i.countable){if(t<i.length)return i.content.getContent()[t];t-=i.length}},td=(e,t,n,i)=>{let r=n;const o=e.doc,s=o.clientID,a=o.store,l=null===n?t._start:n.right;let c=[];const u=()=>{c.length>0&&(r=new ch(Kc(s,uu(a,s)),r,r&&r.lastId,l,l&&l.id,t,null,new qd(c)),r.integrate(e,0),c=[])};i.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:r=new ch(Kc(s,uu(a,s)),r,r&&r.lastId,l,l&&l.id,t,null,new Fd(new Uint8Array(n))),r.integrate(e,0);break;case Ic:r=new ch(Kc(s,uu(a,s)),r,r&&r.lastId,l,l&&l.id,t,null,new Ud(n)),r.integrate(e,0);break;default:if(!(n instanceof Ku))throw new Error("Unexpected content type in insert operation");r=new ch(Kc(s,uu(a,s)),r,r&&r.lastId,l,l&&l.id,t,null,new ih(n)),r.integrate(e,0)}}}),u()},nd=()=>Za("Length exceeded!"),id=(e,t,n,i)=>{if(n>t._length)throw nd();if(0===n)return t._searchMarker&&Gu(t._searchMarker,n,i.length),td(e,t,null,i);const r=n,o=Wu(t,n);let s=t._start;for(null!==o&&(s=o.p,0===(n-=o.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<s.length&&mu(e,Kc(s.id.client,s.id.clock+n));break}n-=s.length}return t._searchMarker&&Gu(t._searchMarker,r,i.length),td(e,t,s,i)},rd=(e,t,n,i)=>{if(0===i)return;const r=n,o=i,s=Wu(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&&(n<a.length&&mu(e,Kc(a.id.client,a.id.clock+n)),n-=a.length);for(;i>0&&null!==a;)a.deleted||(i<a.length&&mu(e,Kc(a.id.client,a.id.clock+i)),a.delete(e),i-=a.length),a=a.right;if(i>0)throw nd();t._searchMarker&&Gu(t._searchMarker,r,-o+i)},od=(e,t,n)=>{const i=t._map.get(n);void 0!==i&&i.delete(e)},sd=(e,t,n,i)=>{const r=t._map.get(n)||null,o=e.doc,s=o.clientID;let a;if(null==i)a=new qd([i]);else switch(i.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:a=new qd([i]);break;case Uint8Array:a=new Fd(i);break;case Ic:a=new Ud(i);break;default:if(!(i instanceof Ku))throw new Error("Unexpected content type");a=new ih(i)}new ch(Kc(s,uu(o.store,s)),r,r&&r.lastId,null,null,t,n,a).integrate(e,0)},ad=(e,t)=>{e.doc??Vu();const n=e._map.get(t);return void 0===n||n.deleted?void 0:n.content.getContent()[n.length-1]},ld=e=>{const t={};return e.doc??Vu(),e._map.forEach((e,n)=>{e.deleted||(t[n]=e.content.getContent()[e.length-1])}),t},cd=(e,t)=>{e.doc??Vu();const n=e._map.get(t);return void 0!==n&&!n.deleted},ud=e=>(e.doc??Vu(),((e,t)=>pc(()=>{let n;do{n=e.next()}while(!n.done&&!t(n.value));return n}))(e._map.entries(),e=>!e[1].deleted));class dd extends Fu{}class hd extends Ku{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const t=new hd;return t.push(e),t}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new hd}clone(){const e=new hd;return e.insert(0,this.toArray().map(e=>e instanceof Ku?e.clone():e)),e}get length(){return this.doc??Vu(),this._length}_callObserver(e,t){super._callObserver(e,t),qu(this,e,new dd(this,e))}insert(e,t){null!==this.doc?wu(this.doc,n=>{id(n,this,e,t)}):this._prelimContent.splice(e,0,...t)}push(e){null!==this.doc?wu(this.doc,t=>{((e,t,n)=>{let i=(t._searchMarker||[]).reduce((e,t)=>t.index>e.index?t:e,{index:0,p:t._start}).p;if(i)for(;i.right;)i=i.right;td(e,t,i,n)})(t,this,e)}):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,t=1){null!==this.doc?wu(this.doc,n=>{rd(n,this,e,t)}):this._prelimContent.splice(e,t)}get(e){return ed(this,e)}toArray(){return Ju(this)}slice(e=0,t=this.length){return Yu(this,e,t)}toJSON(){return this.map(e=>e instanceof Ku?e.toJSON():e)}map(e){return Zu(this,e)}forEach(e){Xu(this,e)}[Symbol.iterator](){return Qu(this)}_write(e){e.writeTypeRef(Jd)}}class pd extends Fu{constructor(e,t,n){super(e,t),this.keysChanged=n}}class fd extends Ku{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 fd}clone(){const e=new fd;return this.forEach((t,n)=>{e.set(n,t instanceof Ku?t.clone():t)}),e}_callObserver(e,t){qu(this,e,new pd(this,e,t))}toJSON(){this.doc??Vu();const e={};return this._map.forEach((t,n)=>{if(!t.deleted){const i=t.content.getContent()[t.length-1];e[n]=i instanceof Ku?i.toJSON():i}}),e}get size(){return[...ud(this)].length}keys(){return fc(ud(this),e=>e[0])}values(){return fc(ud(this),e=>e[1].content.getContent()[e[1].length-1])}entries(){return fc(ud(this),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this.doc??Vu(),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?wu(this.doc,t=>{od(t,this,e)}):this._prelimContent.delete(e)}set(e,t){return null!==this.doc?wu(this.doc,n=>{sd(n,this,e,t)}):this._prelimContent.set(e,t),t}get(e){return ad(this,e)}has(e){return cd(this,e)}clear(){null!==this.doc?wu(this.doc,e=>{this.forEach(function(t,n,i){od(e,i,n)})}):this._prelimContent.clear()}_write(e){e.writeTypeRef(Xd)}}const md=(e,t)=>e===t||"object"==typeof e&&"object"==typeof t&&e&&t&&((e,t)=>e===t||jl(e)===jl(t)&&((e,t)=>{for(const n in e)if(!t(e[n],n))return!1;return!0})(e,(e,n)=>(void 0!==e||Tl(t,n))&&t[n]===e))(e,t);class gd{constructor(e,t,n,i){this.left=e,this.right=t,this.index=n,this.currentAttributes=i}forward(){null===this.right&&el(),this.right.content.constructor===Hd?this.right.deleted||_d(this.currentAttributes,this.right.content):this.right.deleted||(this.index+=this.right.length),this.left=this.right,this.right=this.right.right}}const bd=(e,t,n)=>{for(;null!==t.right&&n>0;)t.right.content.constructor===Hd?t.right.deleted||_d(t.currentAttributes,t.right.content):t.right.deleted||(n<t.right.length&&mu(e,Kc(t.right.id.client,t.right.id.clock+n)),t.index+=t.right.length,n-=t.right.length),t.left=t.right,t.right=t.right.right;return t},yd=(e,t,n,i)=>{const r=new Map,o=i?Wu(t,n):null;if(o){const t=new gd(o.p.left,o.p,o.index,r);return bd(e,t,n-o.index)}{const i=new gd(null,t._start,0,r);return bd(e,i,n)}},vd=(e,t,n,i)=>{for(;null!==n.right&&(!0===n.right.deleted||n.right.content.constructor===Hd&&md(i.get(n.right.content.key),n.right.content.value));)n.right.deleted||i.delete(n.right.content.key),n.forward();const r=e.doc,o=r.clientID;i.forEach((i,s)=>{const a=n.left,l=n.right,c=new ch(Kc(o,uu(r.store,o)),a,a&&a.lastId,l,l&&l.id,t,null,new Hd(s,i));c.integrate(e,0),n.right=c,n.forward()})},_d=(e,t)=>{const{key:n,value:i}=t;null===i?e.delete(n):e.set(n,i)},xd=(e,t)=>{for(;null!==e.right&&(e.right.deleted||e.right.content.constructor===Hd&&md(t[e.right.content.key]??null,e.right.content.value));)e.forward()},kd=(e,t,n,i)=>{const r=e.doc,o=r.clientID,s=new Map;for(const a in i){const l=i[a],c=n.currentAttributes.get(a)??null;if(!md(c,l)){s.set(a,c);const{left:i,right:u}=n;n.right=new ch(Kc(o,uu(r.store,o)),i,i&&i.lastId,u,u&&u.id,t,null,new Hd(a,l)),n.right.integrate(e,0),n.forward()}}return s},wd=(e,t,n,i,r)=>{n.currentAttributes.forEach((e,t)=>{void 0===r[t]&&(r[t]=null)});const o=e.doc,s=o.clientID;xd(n,r);const a=kd(e,t,n,r),l=i.constructor===String?new Kd(i):i instanceof Ku?new ih(i):new $d(i);let{left:c,right:u,index:d}=n;t._searchMarker&&Gu(t._searchMarker,n.index,l.getLength()),u=new ch(Kc(s,uu(o.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(),vd(e,t,n,a)},Cd=(e,t,n,i,r)=>{const o=e.doc,s=o.clientID;xd(n,r);const a=kd(e,t,n,r);e:for(;null!==n.right&&(i>0||a.size>0&&(n.right.deleted||n.right.content.constructor===Hd));){if(!n.right.deleted)switch(n.right.content.constructor){case Hd:{const{key:t,value:o}=n.right.content,s=r[t];if(void 0!==s){if(md(s,o))a.delete(t);else{if(0===i)break e;a.set(t,o)}n.right.delete(e)}else n.currentAttributes.set(t,o);break}default:i<n.right.length&&mu(e,Kc(n.right.id.client,n.right.id.clock+i)),i-=n.right.length}n.forward()}if(i>0){let r="";for(;i>0;i--)r+="\n";n.right=new ch(Kc(s,uu(o.store,s)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new Kd(r)),n.right.integrate(e,0),n.forward()}vd(e,t,n,a)},Sd=(e,t,n,i,r)=>{let o=t;const s=ra();for(;o&&(!o.countable||o.deleted);){if(!o.deleted&&o.content.constructor===Hd){const e=o.content;s.set(e.key,e)}o=o.right}let a=0,l=!1;for(;t!==o;){if(n===t&&(l=!0),!t.deleted){const n=t.content;switch(n.constructor){case Hd:{const{key:o,value:c}=n,u=i.get(o)??null;s.get(o)===n&&u!==c||(t.delete(e),a++,l||(r.get(o)??null)!==c||u===c||(null===u?r.delete(o):r.set(o,u))),l||t.deleted||_d(r,n);break}}}t=t.right}return a},Ad=e=>{let t=0;return wu(e.doc,n=>{let i=e._start,r=e._start,o=ra();const s=oa(o);for(;r;)!1===r.deleted&&(r.content.constructor===Hd?_d(s,r.content):(t+=Sd(n,i,r,o,s),o=oa(s),i=r)),r=r.right}),t},Id=e=>{const t=new Set,n=e.doc;for(const[i,r]of e.afterState.entries()){const o=e.beforeState.get(i)||0;r!==o&&bu(e,n.store.clients.get(i),o,r,e=>{e.deleted||e.content.constructor!==Hd||e.constructor===Dd||t.add(e.parent)})}wu(n,n=>{bc(e,e.deleteSet,e=>{if(e instanceof Dd||!e.parent._hasFormatting||t.has(e.parent))return;const i=e.parent;e.content.constructor===Hd?t.add(i):((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===Hd){const i=t.content.key;n.has(i)?t.delete(e):n.add(i)}t=t.left}})(n,e)});for(const e of t)Ad(e)})},Ed=(e,t,n)=>{const i=n,r=oa(t.currentAttributes),o=t.right;for(;n>0&&null!==t.right;){if(!1===t.right.deleted)switch(t.right.content.constructor){case ih:case $d:case Kd:n<t.right.length&&mu(e,Kc(t.right.id.client,t.right.id.clock+n)),n-=t.right.length,t.right.delete(e)}t.forward()}o&&Sd(e,o,t.right,r,t.currentAttributes);const s=(t.left||t.right).parent;return s._searchMarker&&Gu(s._searchMarker,t.index,-i+n),t};class jd extends Fu{constructor(e,t,n){super(e,t),this.childListChanged=!1,this.keysChanged=new Set,n.forEach(e=>{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=[];wu(e,e=>{const n=new Map,i=new Map;let r=this.target._start,o=null;const s={};let a="",l=0,c=0;const u=()=>{if(null!==o){let e=null;switch(o){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=Al({},s))),l=0}e&&t.push(e),o=null}};for(;null!==r;){switch(r.content.constructor){case ih:case $d:this.adds(r)?this.deletes(r)||(u(),o="insert",a=r.content.getContent()[0],u()):this.deletes(r)?("delete"!==o&&(u(),o="delete"),c+=1):r.deleted||("retain"!==o&&(u(),o="retain"),l+=1);break;case Kd:this.adds(r)?this.deletes(r)||("insert"!==o&&(u(),o="insert"),a+=r.content.str):this.deletes(r)?("delete"!==o&&(u(),o="delete"),c+=r.length):r.deleted||("retain"!==o&&(u(),o="retain"),l+=r.length);break;case Hd:{const{key:t,value:a}=r.content;if(this.adds(r)){if(!this.deletes(r)){const l=n.get(t)??null;md(l,a)?null!==a&&r.delete(e):("retain"===o&&u(),md(a,i.get(t)??null)?delete s[t]:s[t]=a)}}else if(this.deletes(r)){i.set(t,a);const e=n.get(t)??null;md(e,a)||("retain"===o&&u(),s[t]=e)}else if(!r.deleted){i.set(t,a);const n=s[t];void 0!==n&&(md(n,a)?null!==n&&r.delete(e):("retain"===o&&u(),null===a?delete s[t]:s[t]=a))}r.deleted||("insert"===o&&u(),_d(n,r.content));break}}r=r.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 Td extends Ku{constructor(e){super(),this._pending=void 0!==e?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??Vu(),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 Td}clone(){const e=new Td;return e.applyDelta(this.toDelta()),e}_callObserver(e,t){super._callObserver(e,t);const n=new jd(this,e,t);qu(this,e,n),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){this.doc??Vu();let e="",t=this._start;for(;null!==t;)!t.deleted&&t.countable&&t.content.constructor===Kd&&(e+=t.content.str),t=t.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:t=!0}={}){null!==this.doc?wu(this.doc,n=>{const i=new gd(null,this._start,0,new Map);for(let r=0;r<e.length;r++){const o=e[r];if(void 0!==o.insert){const s=t||"string"!=typeof o.insert||r!==e.length-1||null!==i.right||"\n"!==o.insert.slice(-1)?o.insert:o.insert.slice(0,-1);("string"!=typeof s||s.length>0)&&wd(n,this,i,s,o.attributes||{})}else void 0!==o.retain?Cd(n,this,i,o.retain,o.attributes||{}):void 0!==o.delete&&Ed(n,i,o.delete)}}):this._pending.push(()=>this.applyDelta(e))}toDelta(e,t,n){this.doc??Vu();const i=[],r=new Map,o=this.doc;let s="",a=this._start;function l(){if(s.length>0){const e={};let t=!1;r.forEach((n,i)=>{t=!0,e[i]=n});const n={insert:s};t&&(n.attributes=e),i.push(n),s=""}}const c=()=>{for(;null!==a;){if(ru(a,e)||void 0!==t&&ru(a,t))switch(a.content.constructor){case Kd:{const i=r.get("ychange");void 0===e||ru(a,e)?void 0===t||ru(a,t)?void 0!==i&&(l(),r.delete("ychange")):void 0!==i&&i.user===a.id.client&&"added"===i.type||(l(),r.set("ychange",n?n("added",a.id):{type:"added"})):void 0!==i&&i.user===a.id.client&&"removed"===i.type||(l(),r.set("ychange",n?n("removed",a.id):{type:"removed"})),s+=a.content.str;break}case ih:case $d:{l();const e={insert:a.content.getContent()[0]};if(r.size>0){const t={};e.attributes=t,r.forEach((e,n)=>{t[n]=e})}i.push(e);break}case Hd:ru(a,e)&&(l(),_d(r,a.content))}a=a.right}l()};return e||t?wu(o,n=>{e&&ou(n,e),t&&ou(n,t),c()},"cleanup"):c(),i}insert(e,t,n){if(t.length<=0)return;const i=this.doc;null!==i?wu(i,i=>{const r=yd(i,this,e,!n);n||(n={},r.currentAttributes.forEach((e,t)=>{n[t]=e})),wd(i,this,r,t,n)}):this._pending.push(()=>this.insert(e,t,n))}insertEmbed(e,t,n){const i=this.doc;null!==i?wu(i,i=>{const r=yd(i,this,e,!n);wd(i,this,r,t,n||{})}):this._pending.push(()=>this.insertEmbed(e,t,n||{}))}delete(e,t){if(0===t)return;const n=this.doc;null!==n?wu(n,n=>{Ed(n,yd(n,this,e,!0),t)}):this._pending.push(()=>this.delete(e,t))}format(e,t,n){if(0===t)return;const i=this.doc;null!==i?wu(i,i=>{const r=yd(i,this,e,!1);null!==r.right&&Cd(i,this,r,t,n)}):this._pending.push(()=>this.format(e,t,n))}removeAttribute(e){null!==this.doc?wu(this.doc,t=>{od(t,this,e)}):this._pending.push(()=>this.removeAttribute(e))}setAttribute(e,t){null!==this.doc?wu(this.doc,n=>{sd(n,this,e,t)}):this._pending.push(()=>this.setAttribute(e,t))}getAttribute(e){return ad(this,e)}getAttributes(){return ld(this)}_write(e){e.writeTypeRef(Zd)}}class Bd{constructor(e,t=()=>!0){this._filter=t,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??Vu()}[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!==Rd&&t.constructor!==Nd||null===t._start)for(;null!==e;){const t=e.next;if(null!==t){e=t;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 Nd extends Ku{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 Nd}clone(){const e=new Nd;return e.insert(0,this.toArray().map(e=>e instanceof Ku?e.clone():e)),e}get length(){return this.doc??Vu(),null===this._prelimContent?this._length:this._prelimContent.length}createTreeWalker(e){return new Bd(this,e)}querySelector(e){e=e.toUpperCase();const t=new Bd(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e).next();return t.done?null:t.value}querySelectorAll(e){return e=e.toUpperCase(),ua(new Bd(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e))}_callObserver(e,t){qu(this,e,new Od(this,t,e))}toString(){return Zu(this,e=>e.toString()).join("")}toJSON(){return this.toString()}toDOM(e=document,t={},n){const i=e.createDocumentFragment();return void 0!==n&&n._createAssociation(i,this),Xu(this,r=>{i.insertBefore(r.toDOM(e,t,n),null)}),i}insert(e,t){null!==this.doc?wu(this.doc,n=>{id(n,this,e,t)}):this._prelimContent.splice(e,0,...t)}insertAfter(e,t){if(null!==this.doc)wu(this.doc,n=>{const i=e&&e instanceof Ku?e._item:e;td(n,this,i,t)});else{const n=this._prelimContent,i=null===e?0:n.findIndex(t=>t===e)+1;if(0===i&&null!==e)throw Za("Reference item not found");n.splice(i,0,...t)}}delete(e,t=1){null!==this.doc?wu(this.doc,n=>{rd(n,this,e,t)}):this._prelimContent.splice(e,t)}toArray(){return Ju(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return ed(this,e)}slice(e=0,t=this.length){return Yu(this,e,t)}forEach(e){Xu(this,e)}_write(e){e.writeTypeRef(eh)}}class Rd extends Nd{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 Rd(this.nodeName)}clone(){const e=new Rd(this.nodeName);return((e,t)=>{for(const n in e)t(e[n],n)})(this.getAttributes(),(t,n)=>{e.setAttribute(n,t)}),e.insert(0,this.toArray().map(e=>e instanceof Ku?e.clone():e)),e}toString(){const e=this.getAttributes(),t=[],n=[];for(const t in e)n.push(t);n.sort();const i=n.length;for(let r=0;r<i;r++){const i=n[r];t.push(i+'="'+e[i]+'"')}const r=this.nodeName.toLocaleLowerCase();return`<${r}${t.length>0?" "+t.join(" "):""}>${super.toString()}</${r}>`}removeAttribute(e){null!==this.doc?wu(this.doc,t=>{od(t,this,e)}):this._prelimAttrs.delete(e)}setAttribute(e,t){null!==this.doc?wu(this.doc,n=>{sd(n,this,e,t)}):this._prelimAttrs.set(e,t)}getAttribute(e){return ad(this,e)}hasAttribute(e){return cd(this,e)}getAttributes(e){return e?((e,t)=>{const n={};return this._map.forEach((e,i)=>{let r=e;for(;null!==r&&(!t.sv.has(r.id.client)||r.id.clock>=(t.sv.get(r.id.client)||0));)r=r.left;null!==r&&ru(r,t)&&(n[i]=r.content.getContent()[r.length-1])}),n})(0,e):ld(this)}toDOM(e=document,t={},n){const i=e.createElement(this.nodeName),r=this.getAttributes();for(const e in r){const t=r[e];"string"==typeof t&&i.setAttribute(e,t)}return Xu(this,r=>{i.appendChild(r.toDOM(e,t,n))}),void 0!==n&&n._createAssociation(i,this),i}_write(e){e.writeTypeRef(Qd),e.writeKey(this.nodeName)}}class Od extends Fu{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 Ld extends fd{constructor(e){super(),this.hookName=e}_copy(){return new Ld(this.hookName)}clone(){const e=new Ld(this.hookName);return this.forEach((t,n)=>{e.set(n,t)}),e}toDOM(e=document,t={},n){const i=t[this.hookName];let r;return r=void 0!==i?i.createDom(this):document.createElement(this.hookName),r.setAttribute("data-yjs-hook",this.hookName),void 0!==n&&n._createAssociation(r,this),r}_write(e){e.writeTypeRef(th),e.writeKey(this.hookName)}}class Md extends Td{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 Md}clone(){const e=new Md;return e.applyDelta(this.toDelta()),e}toDOM(e=document,t,n){const i=e.createTextNode(this.toString());return void 0!==n&&n._createAssociation(i,this),i}toString(){return this.toDelta().map(e=>{const t=[];for(const n in e.attributes){const i=[];for(const t in e.attributes[n])i.push({key:t,value:e.attributes[n][t]});i.sort((e,t)=>e.key<t.key?-1:1),t.push({nodeName:n,attrs:i})}t.sort((e,t)=>e.nodeName<t.nodeName?-1:1);let n="";for(let e=0;e<t.length;e++){const i=t[e];n+=`<${i.nodeName}`;for(let e=0;e<i.attrs.length;e++){const t=i.attrs[e];n+=` ${t.key}="${t.value}"`}n+=">"}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(nh)}}class Pd{constructor(e,t){this.id=e,this.length=t}get deleted(){throw Qa()}mergeWith(e){return!1}write(e,t,n){throw Qa()}integrate(e,t){throw Qa()}}class Dd extends Pd{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),du(e.doc.store,this)}write(e,t){e.writeInfo(0),e.writeLen(this.length-t)}getMissing(e,t){return null}}class Fd{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new Fd(this.content)}splice(e){throw Qa()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeBuf(this.content)}getRef(){return 3}}class zd{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new zd(this.len)}splice(e){const t=new zd(this.len-e);return this.len=e,t}mergeWith(e){return this.len+=e.len,!0}integrate(e,t){xc(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 Vd=(e,t)=>new Ic({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1});class Ud{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 Ud(Vd(this.doc.guid,this.opts))}splice(e){throw Qa()}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 $d{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new $d(this.embed)}splice(e){throw Qa()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeJSON(this.embed)}getRef(){return 5}}class Hd{constructor(e,t){this.key=e,this.value=t}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new Hd(this.key,this.value)}splice(e){throw Qa()}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 Wd{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Wd(this.arr)}splice(e){const t=new Wd(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 i=t;i<n;i++){const t=this.arr[i];e.writeString(void 0===t?"undefined":JSON.stringify(t))}}getRef(){return 2}}const Gd="development"===Vl("node_env");class qd{constructor(e){this.arr=e,Gd&&Nl(e)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new qd(this.arr)}splice(e){const t=new qd(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 i=t;i<n;i++){const t=this.arr[i];e.writeAny(t)}}getRef(){return 8}}class Kd{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new Kd(this.str)}splice(e){const t=new Kd(this.str.slice(e));this.str=this.str.slice(0,e);const n=this.str.charCodeAt(e-1);return n>=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 Yd=[e=>new hd,e=>new fd,e=>new Td,e=>new Rd(e.readKey()),e=>new Nd,e=>new Ld(e.readKey()),e=>new Md],Jd=0,Xd=1,Zd=2,Qd=3,eh=4,th=5,nh=6;class ih{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new ih(this.type._copy())}splice(e){throw Qa()}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 rh=(e,t)=>{let n,i=t,r=0;do{r>0&&(i=Kc(i.client,i.clock+r)),n=pu(e,i),r=i.clock-n.id.clock,i=n.redone}while(null!==i&&n instanceof ch);return{item:n,diff:r}},oh=(e,t)=>{for(;null!==e&&e.keep!==t;)e.keep=t,e=e.parent._item},sh=(e,t,n)=>{const{client:i,clock:r}=t.id,o=new ch(Kc(i,r+n),t,Kc(i,r+n-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(n));return t.deleted&&o.markDeleted(),t.keep&&(o.keep=!0),null!==t.redone&&(o.redone=Kc(t.redone.client,t.redone.clock+n)),t.right=o,null!==o.right&&(o.right.left=o),e._mergeStructs.push(o),null!==o.parentSub&&null===o.right&&o.parent._map.set(o.parentSub,o),t.length=n,o},ah=(e,t)=>((e,t)=>{for(let n=0;n<e.length;n++)if(t(e[n]))return!0;return!1})(e,e=>yc(e.deletions,t)),lh=(e,t,n,i,r,o)=>{const s=e.doc,a=s.store,l=s.clientID,c=t.redone;if(null!==c)return mu(e,c);let u,d=t.parent._item,h=null;if(null!==d&&!0===d.deleted){if(null===d.redone&&(!n.has(d)||null===lh(e,d,n,i,r,o)))return null;for(;null!==d.redone;)d=mu(e,d.redone)}const p=null===d?t.parent:d.content.type;if(null===t.parentSub){for(h=t.left,u=t;null!==h;){let t=h;for(;null!==t&&t.parent._item!==d;)t=null===t.redone?null:mu(e,t.redone);if(null!==t&&t.parent._item===d){h=t;break}h=h.left}for(;null!==u;){let t=u;for(;null!==t&&t.parent._item!==d;)t=null===t.redone?null:mu(e,t.redone);if(null!==t&&t.parent._item===d){u=t;break}u=u.right}}else if(u=null,t.right&&!r){for(h=t;null!==h&&null!==h.right&&(h.right.redone||yc(i,h.right.id)||ah(o.undoStack,h.right.id)||ah(o.redoStack,h.right.id));)for(h=h.right;h.redone;)h=mu(e,h.redone);if(h&&null!==h.right)return null}else h=p._map.get(t.parentSub)||null;const f=uu(a,l),m=Kc(l,f),g=new ch(m,h,h&&h.lastId,u,u&&u.id,p,t.parentSub,t.content.copy());return t.redone=m,oh(g,!0),g.integrate(e,0),g};class ch extends Pd{constructor(e,t,n,i,r,o,s,a){super(e,a.getLength()),this.origin=n,this.left=t,this.right=i,this.rightOrigin=r,this.parent=o,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>=uu(t,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=uu(t,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===Gc&&this.id.client!==this.parent.client&&this.parent.clock>=uu(t,this.parent.client))return this.parent.client;if(this.origin&&(this.left=gu(e,t,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=mu(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===Dd||this.right&&this.right.constructor===Dd)this.parent=null;else if(this.parent){if(this.parent.constructor===Gc){const e=pu(t,this.parent);e.constructor===Dd?this.parent=null:this.parent=e.content.type}}else this.left&&this.left.constructor===ch?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===ch&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);return null}integrate(e,t){if(t>0&&(this.id.clock+=t,this.left=gu(e,e.doc.store,Kc(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 i=new Set,r=new Set;for(;null!==t&&t!==this.right;){if(r.add(t),i.add(t),qc(this.origin,t.origin)){if(t.id.client<this.id.client)n=t,i.clear();else if(qc(this.rightOrigin,t.rightOrigin))break}else{if(null===t.origin||!r.has(pu(e.doc.store,t.origin)))break;i.has(pu(e.doc.store,t.origin))||(n=t,i.clear())}t=t.right}this.left=n}if(null!==this.left){const e=this.left.right;this.right=e,this.left.right=this}else{let e;if(null!==this.parentSub)for(e=this.parent._map.get(this.parentSub)||null;null!==e&&null!==e.left;)e=e.left;else e=this.parent._start,this.parent._start=this;this.right=e}null!==this.right?this.right.left=this:null!==this.parentSub&&(this.parent._map.set(this.parentSub,this),null!==this.left&&this.left.delete(e)),null===this.parentSub&&this.countable&&!this.deleted&&(this.parent._length+=this.length),du(e.doc.store,this),this.content.integrate(e,this),_u(e,this.parent,this.parentSub),(null!==this.parent._item&&this.parent._item.deleted||null!==this.parentSub&&null!==this.right)&&this.delete(e)}else new Dd(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;null!==e&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;null!==e&&e.deleted;)e=e.left;return e}get lastId(){return 1===this.length?this.id:Kc(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&qc(e.origin,this.lastId)&&this.right===e&&qc(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&null===this.redone&&null===e.redone&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){const t=this.parent._searchMarker;return t&&t.forEach(t=>{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(),xc(e.deleteSet,this.id.client,this.id.clock,this.length),_u(e,t,this.parentSub),this.content.delete(e)}}gc(e,t){if(!this.deleted)throw el();this.content.gc(e),t?((e,t,n)=>{const i=e.clients.get(t.id.client);i[hu(i,t.id.clock)]=n})(e,this,new Dd(this.id,this.length)):this.content=new zd(this.length)}write(e,t){const n=t>0?Kc(this.id.client,this.id.clock+t-1):this.origin,i=this.rightOrigin,r=this.parentSub,o=31&this.content.getRef()|(null===n?0:_a)|(null===i?0:va)|(null===r?0:32);if(e.writeInfo(o),null!==n&&e.writeLeftID(n),null!==i&&e.writeRightID(i),null===n&&null===i){const t=this.parent;if(void 0!==t._item){const n=t._item;if(null===n){const n=Yc(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===Gc?(e.writeParentInfo(!1),e.writeLeftID(t)):el();null!==r&&e.writeString(r)}this.content.write(e,t)}}const uh=(e,t)=>dh[31&t](e),dh=[()=>{el()},e=>new zd(e.readLen()),e=>{const t=e.readLen(),n=[];for(let i=0;i<t;i++){const t=e.readString();"undefined"===t?n.push(void 0):n.push(JSON.parse(t))}return new Wd(n)},e=>new Fd(e.readBuf()),e=>new Kd(e.readString()),e=>new $d(e.readJSON()),e=>new Hd(e.readKey(),e.readJSON()),e=>new ih(Yd[e.readTypeRef()](e)),e=>{const t=e.readLen(),n=[];for(let i=0;i<t;i++)n.push(e.readAny());return new qd(n)},e=>new Ud(Vd(e.readString(),e.readAny())),()=>{el()}];class hh extends Pd{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor&&(this.length+=e.length,!0)}integrate(e,t){el()}write(e,t){e.writeInfo(10),Ma(e.restEncoder,this.length-t)}getMissing(e,t){return null}}const ph="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:{},fh="__ $YJS$ __";!0===ph[fh]&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438"),ph[fh]=!0;var mh=n(23372),gh=n(52983),bh=Symbol("mayDisplayControls"),yh=Symbol("mayDisplayParentControls"),vh=Symbol("mayDisplayPatternEditingControls"),_h=Symbol("blockEditingMode"),xh=Symbol("blockBindings"),kh=Symbol("isPreviewMode"),wh=Symbol("isInListViewBlockSupportTree"),Ch={name:"",isSelected:!1},Sh=(0,T.createContext)(Ch);Sh.displayName="BlockEditContext";var{Provider:Ah}=Sh;function Ih(){return(0,T.useContext)(Sh)}var Eh=n(45020),jh={insertUsage:{}},Th={alignWide:!1,supportsLayout:!0,colors:[{name:(0,ee.__)("Black"),slug:"black",color:"#000000"},{name:(0,ee.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,ee.__)("White"),slug:"white",color:"#ffffff"},{name:(0,ee.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,ee.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,ee.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,ee.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,ee.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,ee.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,ee.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,ee.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,ee.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,ee._x)("Small","font size name"),size:13,slug:"small"},{name:(0,ee._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,ee._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,ee._x)("Large","font size name"),size:36,slug:"large"},{name:(0,ee._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,ee.__)("Thumbnail")},{slug:"medium",name:(0,ee.__)("Medium")},{slug:"large",name:(0,ee.__)("Large")},{slug:"full",name:(0,ee.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,canLockBlocks:!0,canEditCSS:!1,enableOpenverseMediaCategory:!0,clearBlockSelection:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],isPreviewMode:!1,blockInspectorAnimation:{animationParent:"core/navigation","core/navigation":{enterDirection:"leftToRight"},"core/navigation-submenu":{enterDirection:"rightToLeft"},"core/navigation-link":{enterDirection:"rightToLeft"},"core/search":{enterDirection:"rightToLeft"},"core/social-links":{enterDirection:"rightToLeft"},"core/page-list":{enterDirection:"rightToLeft"},"core/spacer":{enterDirection:"rightToLeft"},"core/home-link":{enterDirection:"rightToLeft"},"core/site-title":{enterDirection:"rightToLeft"},"core/site-logo":{enterDirection:"rightToLeft"}},generateAnchors:!1,gradients:[{name:(0,ee.__)("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,ee.__)("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,ee.__)("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,ee.__)("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,ee.__)("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,ee.__)("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,ee.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,ee.__)("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,ee.__)("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,ee.__)("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,ee.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,ee.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function Bh(e,t,n){return[...e.slice(0,n),...Array.isArray(t)?t:[t],...e.slice(n)]}function Nh(e,t,n,i=1){const r=[...e];return r.splice(t,i),Bh(r,e.slice(t,t+i),n)}var Rh=Symbol("globalStylesDataKey"),Oh=Symbol("globalStylesLinks"),Lh=Symbol("selectBlockPatternsKey"),Mh=Symbol("reusableBlocksSelect"),Ph=Symbol("sectionRootClientIdKey"),Dh=Symbol("mediaEditKey"),Fh=Symbol("getMediaSelect"),zh=Symbol("isIsolatedEditor"),Vh=Symbol("deviceTypeKey"),Uh=Symbol("isNavigationOverlayContext"),$h=Symbol("isNavigationPostEditor"),Hh=Symbol("mediaUploadOnSuccess"),{lock:Wh,unlock:Gh}=(0,pt.yf)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/block-editor"),{isContentBlock:qh}=Gh(ia),Kh=e=>e;function Yh(e,t=""){const n=new Map,i=[];return n.set(t,i),e.forEach(e=>{const{clientId:t,innerBlocks:r}=e;i.push(t),Yh(r,t).forEach((e,t)=>{n.set(t,e)})}),n}function Jh(e,t=""){const n=[],i=[[t,e]];for(;i.length;){const[e,t]=i.shift();t.forEach(({innerBlocks:t,...r})=>{n.push([r.clientId,e]),t?.length&&i.push([r.clientId,t])})}return n}function Xh(e,t=Kh){const n=[],i=[...e];for(;i.length;){const{innerBlocks:e,...r}=i.shift();i.push(...e),n.push([r.clientId,t(r)])}return n}function Zh(e){const t={},n=[...e];for(;n.length;){const{innerBlocks:e,...i}=n.shift();n.push(...e),t[i.clientId]=!0}return t}function Qh(e){return Xh(e,e=>{const{attributes:t,...n}=e;return n})}function ep(e){return Xh(e,e=>e.attributes)}function tp(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&F(e.clientIds,t.clientIds)&&function(e,t){return F(Object.keys(e),Object.keys(t))}(e.attributes,t.attributes)}function np(e,t){const n=e.tree,i=[...t],r=[...t];for(;i.length;){const e=i.shift();i.push(...e.innerBlocks),r.push(...e.innerBlocks)}for(const e of r)n.set(e.clientId,{});for(const t of r)n.set(t.clientId,Object.assign(n.get(t.clientId),{...e.byClientId.get(t.clientId),attributes:e.attributes.get(t.clientId),innerBlocks:t.innerBlocks.map(e=>n.get(e.clientId))}))}function ip(e,t,n=!1){const i=e.tree,r=new Set([]),o=new Set;for(const i of t){let t=n?i:e.parents.get(i);do{if(e.controlledInnerBlocks.has(t)){o.add(t);break}r.add(t),t=e.parents.get(t)}while(void 0!==t)}for(const e of r)i.set(e,{...i.get(e)});for(const t of r)i.get(t).innerBlocks=(e.order.get(t)||[]).map(e=>i.get(e));for(const t of o)i.set("controlled||"+t,{innerBlocks:(e.order.get(t)||[]).map(e=>i.get(e))})}var rp=(0,Eh.h)(D.combineReducers,e=>(t={},n)=>{const i=e(t,n);if(i===t)return t;switch(i.tree=t.tree?t.tree:new Map,n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":i.tree=new Map(i.tree),np(i,n.blocks),ip(i,n.rootClientId?[n.rootClientId]:[""],!0);break;case"UPDATE_BLOCK":i.tree=new Map(i.tree),i.tree.set(n.clientId,{...i.tree.get(n.clientId),...i.byClientId.get(n.clientId),attributes:i.attributes.get(n.clientId)}),ip(i,[n.clientId],!1);break;case"SYNC_DERIVED_BLOCK_ATTRIBUTES":case"UPDATE_BLOCK_ATTRIBUTES":i.tree=new Map(i.tree),n.clientIds.forEach(e=>{i.tree.set(e,{...i.tree.get(e),attributes:i.attributes.get(e)})}),ip(i,n.clientIds,!1);break;case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=Zh(n.blocks);i.tree=new Map(i.tree),n.replacedClientIds.forEach(t=>{i.tree.delete(t),e[t]||i.tree.delete("controlled||"+t)}),np(i,n.blocks),ip(i,n.blocks.map(e=>e.clientId),!1);const r=[];for(const e of n.clientIds){const n=t.parents.get(e);void 0===n||""!==n&&!i.byClientId.get(n)||r.push(n)}ip(i,r,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const r of n.clientIds){const n=t.parents.get(r);void 0===n||""!==n&&!i.byClientId.get(n)||e.push(n)}i.tree=new Map(i.tree),n.removedClientIds.forEach(e=>{i.tree.delete(e),i.tree.delete("controlled||"+e)}),ip(i,e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId?e.push(n.fromRootClientId):e.push(""),n.toRootClientId&&e.push(n.toRootClientId),i.tree=new Map(i.tree),ip(i,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];i.tree=new Map(i.tree),ip(i,e,!0);break}}return i},e=>(t,n)=>{const i=e=>{let i=e;for(let r=0;r<i.length;r++)!t.order.get(i[r])||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[i[r]]||(i===e&&(i=[...i]),i.push(...t.order.get(i[r])));return i};if(t)switch(n.type){case"REMOVE_BLOCKS":n={...n,type:"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN",removedClientIds:i(n.clientIds)};break;case"REPLACE_BLOCKS":n={...n,type:"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN",replacedClientIds:i(n.clientIds)}}return e(t,n)},e=>(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const i={};if(t.controlledInnerBlocks.size){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...r}=e.shift();e.push(...n),t.controlledInnerBlocks.has(r.clientId)&&(i[r.clientId]=!0)}}let r=t;t.order.get(n.rootClientId)&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:i,clientIds:t.order.get(n.rootClientId)}));let o=r;if(n.blocks.length){o=e(o,{...n,type:"INSERT_BLOCKS",index:0});const r=new Map(o.order);Object.keys(i).forEach(e=>{t.order.get(e)&&r.set(e,t.order.get(e))}),o.order=r,o.tree=new Map(o.tree),Object.keys(i).forEach(e=>{const n=`controlled||${e}`;t.tree.has(n)&&o.tree.set(n,t.tree.get(n))})}return o},e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const i=e(void 0,{type:"INSERT_BLOCKS",rootClientId:"",blocks:n.blocks}),r=t?.controlledInnerBlocks??new Set;if(t?.order)for(const e of r){if(!i.byClientId.has(e))continue;i.controlledInnerBlocks.add(e);const n=t.order.get(e);if(!n?.length)continue;i.order.set(e,n);const r=(e,n)=>{const o=t.byClientId.get(e);if(!o)return;i.byClientId.set(e,o),i.attributes.set(e,t.attributes.get(e)),i.parents.set(e,n);const s=t.order.get(e)||[];i.order.set(e,s),s.forEach(t=>r(t,e))};n.forEach(t=>r(t,e))}for(const e of i.controlledInnerBlocks){const n=i.order.get(e);if(!n?.length)continue;const r=n.map(e=>t.tree.get(e)),o=i.tree.get(e);o&&(o.innerBlocks=r),i.tree.set("controlled||"+e,{innerBlocks:r});const s=e=>{const n=t.tree.get(e);n&&(i.tree.set(e,n),(i.order.get(e)||[]).forEach(s))};n.forEach(s)}const o=t?.blockEditingModes??new Map;for(const[e,t]of o)i.tree.has(e)&&i.blockEditingModes.set(e,t);return i}return e(t,n)},function(e){let t,n,i=!1;return(r,o)=>{let s,a=e(r,o);if("SET_EXPLICIT_PERSISTENT"===o.type&&(n=o.isPersistentChange,s=r.isPersistentChange??!0),void 0!==n)return s=n,s===a.isPersistentChange?a:{...a,isPersistentChange:s};const l="MARK_LAST_CHANGE_AS_PERSISTENT"===o.type||i;return r!==a||l?(a={...a,isPersistentChange:l?!i:!tp(o,t)},t=o,i="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===o.type,a):(i="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===o.type,s=r?.isPersistentChange??!0,r.isPersistentChange===s?r:{...a,isPersistentChange:s})}},function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,i)=>{const r=e(n,i);return r!==n&&(r.isIgnoredChange=t.has(i.type)),r}},e=>(t,n)=>{if("SET_HAS_CONTROLLED_INNER_BLOCKS"===n.type){const i=t.order.get(n.clientId);if(i?.length){const i=e(t,{type:"REPLACE_INNER_BLOCKS",rootClientId:n.clientId,blocks:[]});return e(i,n)}return e(t,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 Qh(t.blocks).forEach(([e,t])=>{n.set(e,t)}),n}case"UPDATE_BLOCK":{if(!e.has(t.clientId))return e;const{attributes:n,...i}=t.updates;if(0===Object.values(i).length)return e;const r=new Map(e);return r.set(t.clientId,{...e.get(t.clientId),...i}),r}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach(e=>{n.delete(e)}),Qh(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 ep(t.blocks).forEach(([e,t])=>{n.set(e,t)}),n}case"UPDATE_BLOCK":{if(!e.get(t.clientId)||!t.updates.attributes)return e;const n=new Map(e);return n.set(t.clientId,{...e.get(t.clientId),...t.updates.attributes}),n}case"SYNC_DERIVED_BLOCK_ATTRIBUTES":case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every(t=>!e.get(t)))return e;let n=!1;const i=new Map(e);for(const r of t.clientIds){const o=Object.entries(t.options?.uniqueByBlock?t.attributes[r]:t.attributes??{});if(0===o.length)continue;let s=!1;const a=e.get(r),l={};o.forEach(([e,t])=>{a[e]!==t&&(s=!0,l[e]=t)}),n=n||s,s&&i.set(r,{...a,...l})}return n?i: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)}),ep(t.blocks).forEach(([e,t])=>{n.set(e,t)}),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach(e=>{n.delete(e)}),n}}return e},order(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":{const n=Yh(t.blocks),i=new Map(e);return n.forEach((e,t)=>{""!==t&&i.set(t,e)}),i.set("",(e.get("")??[]).concat(n[""])),i}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,i=e.get(n)||[],r=Yh(t.blocks,n),{index:o=i.length}=t,s=new Map(e);return r.forEach((e,t)=>{s.set(t,e)}),s.set(n,Bh(i,r.get(n),o)),s}case"MOVE_BLOCKS_TO_POSITION":{const{fromRootClientId:n="",toRootClientId:i="",clientIds:r}=t,{index:o=e.get(i).length}=t;if(n===i){const t=e.get(i).indexOf(r[0]);if(-1===t)return e;const n=new Map(e);return n.set(i,Nh(e.get(i),t,o,r.length)),n}const s=new Map(e);return s.set(n,e.get(n)?.filter(e=>!r.includes(e))??[]),s.set(i,Bh(e.get(i),r,o)),s}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:i=""}=t,r=n[0],o=e.get(i);if(!o.length||r===o[0])return e;const s=o.indexOf(r),a=new Map(e);return a.set(i,Nh(o,s,s-1,n.length)),a}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:i=""}=t,r=n[0],o=n[n.length-1],s=e.get(i);if(!s.length||o===s[s.length-1])return e;const a=s.indexOf(r),l=new Map(e);return l.set(i,Nh(s,a,a+1,n.length)),l}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const i=Yh(t.blocks),r=new Map(e);return t.replacedClientIds.forEach(e=>{r.delete(e)}),i.forEach((e,t)=>{""!==t&&r.set(t,e)}),r.forEach((e,t)=>{const o=Object.values(e).reduce((e,t)=>t===n[0]?[...e,...i.get("")]:(-1===n.indexOf(t)&&e.push(t),e),[]);r.set(t,o)}),r}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach(e=>{n.delete(e)}),n.forEach((e,i)=>{const r=e?.filter(e=>!t.removedClientIds.includes(e))??[];r.length!==e.length&&n.set(i,r)}),n}}return e},parents(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":{const n=new Map(e);return Jh(t.blocks).forEach(([e,t])=>{n.set(e,t)}),n}case"INSERT_BLOCKS":{const n=new Map(e);return Jh(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)}),Jh(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=new Set,{type:t,clientId:n,hasControlledInnerBlocks:i}){if("SET_HAS_CONTROLLED_INNER_BLOCKS"===t){if(i)return e.has(n)?e:new Set(e).add(n);if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t}return e},blockEditingModes(e=new Map,t){switch(t.type){case"SET_BLOCK_EDITING_MODE":return e.get(t.clientId)===t.mode?e:new Map(e).set(t.clientId,t.mode);case"UNSET_BLOCK_EDITING_MODE":{if(!e.has(t.clientId))return e;const n=new Map(e);return n.delete(t.clientId),n}}return e}});function op(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}var sp=(0,D.combineReducers)({blocks:rp,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:i}=t;return{selectionStart:n,selectionEnd:i};case"MULTI_SELECT":const{start:r,end:o}=t;return r===e.selectionStart?.clientId&&o===e.selectionEnd?.clientId?e:{selectionStart:{clientId:r},selectionEnd:{clientId:o}};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=op(e.selectionStart,t),i=op(e.selectionEnd,t);return n===e.selectionStart&&i===e.selectionEnd?e:{selectionStart:n,selectionEnd:i}},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=new Map,t)=>{switch(t.type){case"REPLACE_BLOCKS":{const n=new Set,i=[...t.blocks];for(;i.length;){const e=i.shift();n.add(e.clientId),i.push(...e.innerBlocks)}const r=new Map(e);for(const e of t.clientIds)n.has(e)||r.delete(e);return r}case"REMOVE_BLOCKS":{const n=new Map(e);for(const e of t.clientIds)n.delete(e);return n}case"UPDATE_BLOCK_LIST_SETTINGS":{const n=("string"==typeof t.clientId?[[t.clientId,t.settings]]:Object.entries(t.clientId)).filter(([t,n])=>n?!F(e.get(t),n):e.has(t));if(!n.length)return e;const i=new Map(e);for(const[e,t]of n)t?i.set(e,t):i.delete(e);return i}}return e},insertionPoint:function(e=null,t){switch(t.type){case"SET_INSERTION_POINT":return t.value;case"SELECT_BLOCK":return null}return e},insertionCue:function(e=null,t){switch(t.type){case"SHOW_INSERTION_POINT":{const{rootClientId:n,index:i,__unstableWithInserter:r,operation:o,nearestSide:s}=t,a={rootClientId:n,index:i,__unstableWithInserter:r,operation:o,nearestSide:s};return F(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=Th,t){if("UPDATE_SETTINGS"===t.type){const n=t.reset?{...Th,...t.settings}:{...e,...t.settings};return Object.defineProperty(n,"__unstableIsPreviewMode",{get(){return(0,Qt.A)("__unstableIsPreviewMode",{since:"6.8",alternative:"isPreviewMode"}),this.isPreviewMode}}),n}return e},preferences:function(e=jh,t){switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":{const n=t.blocks.reduce((e,n)=>{const{attributes:i,name:r}=n;let o=r;const s=(0,xe.L)(Zi).getActiveBlockVariation(r,i);return s?.name&&(o+="/"+s.name),"core/block"===r&&(o+="/"+i.ref),{...e,[o]:{time:t.time,count:e[o]?e[o].count+1:1}}},e.insertUsage);return{...e,insertUsage:n}}}return e},lastBlockAttributesChange:function(e=null,t){switch(t.type){case"UPDATE_BLOCK":if(!t.updates.attributes)break;return{[t.clientId]:t.updates.attributes};case"UPDATE_BLOCK_ATTRIBUTES":return t.clientIds.reduce((e,n)=>({...e,[n]:t.options?.uniqueByBlock?t.attributes[n]:t.attributes}),{})}return e},lastFocus:function(e=!1,t){return"LAST_FOCUS"===t.type?t.lastFocus:e},expandedBlock:function(e=null,t){switch(t.type){case"SET_BLOCK_EXPANDED_IN_LIST_VIEW":return t.clientId;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},highlightedBlock:function(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":const{clientId:n,isHighlighted:i}=t;return i?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),i=t.meta?.source;return{clientIds:n,source:i};case"RESET_BLOCKS":return{}}return e},editedContentOnlySection:function(e,t){if("EDIT_CONTENT_ONLY_SECTION"===t.type)return t.clientId;if(!e)return e;switch(t.type){case"REMOVE_BLOCKS":case"REPLACE_BLOCKS":if(t.clientIds.includes(e))return;break;case"RESET_BLOCKS":if(!Zh(t.blocks)[e])return}return e},blockVisibility:function(e={},t){return"SET_BLOCK_VISIBILITY"===t.type?{...e,...t.updates}:e},viewportModalClientIds:function(e=null,t){switch(t.type){case"SHOW_VIEWPORT_MODAL":return t.clientIds;case"HIDE_VIEWPORT_MODAL":return null}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:i}=t;return{clientIds:e,selectPrevious:n,message:i};case"CLEAR_BLOCK_REMOVAL_PROMPT":return!1}return e},blockRemovalRules:function(e=!1,t){return"SET_BLOCK_REMOVAL_RULES"===t.type?t.rules:e},registeredInserterMediaCategories:function(e=[],t){return"REGISTER_INSERTER_MEDIA_CATEGORY"===t.type?[...e,t.category]:e},zoomLevel:function(e=100,t){switch(t.type){case"SET_ZOOM_LEVEL":return t.zoom;case"RESET_ZOOM_LEVEL":return 100}return e},hasBlockSpotlight:function(e,t){switch(t.type){case"TOGGLE_BLOCK_SPOTLIGHT":const{clientId:n,hasBlockSpotlight:i}=t;return i?n:e===n?null:e;case"SELECT_BLOCK":return t.clientId!==e?null:e;case"SELECTION_CHANGE":return t.start?.clientId!==e||t.end?.clientId!==e?null:e;case"CLEAR_SELECTED_BLOCK":return null}return e},openedListViewPanels:function(e={allOpen:!1,panels:{}},t){switch(t.type){case"SET_OPEN_LIST_VIEW_PANEL":return{allOpen:!1,panels:t.clientId?{[t.clientId]:!0}:{}};case"SET_ALL_LIST_VIEW_PANELS_OPEN":return{allOpen:!0,panels:{}};case"TOGGLE_LIST_VIEW_PANEL":return{allOpen:!1,panels:{...e.panels,[t.clientId]:t.isOpen}};case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":{if(!t.clientIds||0===t.clientIds.length)return e;const n={...e.panels};let i=!1;return t.clientIds.forEach(e=>{e in n&&(delete n[e],i=!0)}),i?{...e,panels:n}:e}}return e},listViewExpandRevision:function(e=0,t){return"INCREMENT_LIST_VIEW_EXPAND_REVISION"===t.type?e+1:e},listViewContentPanelOpen:function(e=!1,t){switch(t.type){case"OPEN_LIST_VIEW_CONTENT_PANEL":return!0;case"CLOSE_LIST_VIEW_CONTENT_PANEL":case"CLEAR_SELECTED_BLOCK":return!1}return e},requestedInspectorTab:function(e=null,t){switch(t.type){case"REQUEST_INSPECTOR_TAB":return{tabName:t.tabName,options:t.options};case"CLEAR_REQUESTED_INSPECTOR_TAB":return null}return e}});function ap(e,t){if(""===t){const n=e.blocks.tree.get(t);if(!n)return;return{clientId:"",...n}}if(!e.blocks.controlledInnerBlocks.has(t))return e.blocks.tree.get(t);const n=e.blocks.tree.get(`controlled||${t}`);return{...e.blocks.tree.get(t),innerBlocks:n?.innerBlocks}}function lp(e,t,n){const i=ap(e,t);if(i&&(n(i),i?.innerBlocks?.length))for(const t of i?.innerBlocks)lp(e,t.clientId,n)}function cp(e,t,n){if(!n.length)return;let i=e.blocks.parents.get(t);for(;void 0!==i;){if(n.includes(i))return i;i=e.blocks.parents.get(i)}}function up(e,t=""){const n=e?.zoomLevel<100||"auto-scaled"===e?.zoomLevel,i=new Map,r=e.settings?.[Ph],o=e.blocks.order.get(r),s=Array.from(e.blocks.blockEditingModes).some(([,e])=>"disabled"===e),a=[],l=[];e.blocks.controlledInnerBlocks.forEach(t=>{const n=e.blocks.byClientId?.get(t);"core/template-part"===n?.name&&a.push(t),"core/block"===n?.name&&l.push(t)});const c=Array.from(e.blockListSettings).flatMap(([e,t])=>"contentOnly"===t?.templateLock?[e]:[]),u=e.settings?.[zh],d=e.settings?.disableContentOnlyForUnsyncedPatterns,h=u||d?[]:Array.from(e.blocks.attributes.keys()).filter(t=>e.blocks.attributes.get(t)?.metadata?.patternName),p=e.settings?.disableContentOnlyForTemplateParts,f=[...c,...h,...u||p?[]:a];return lp(e,t,t=>{const{clientId:a,name:c}=t,u=!!e.editedContentOnlySection;let d=!1;if(!u||(d=a===e.editedContentOnlySection||!!cp(e,a,[e.editedContentOnlySection]),d)){if(!e.blocks.blockEditingModes.has(a)){if(s){let t,n=e.blocks.parents.get(a);for(;void 0!==n&&(e.blocks.blockEditingModes.has(n)&&(t=e.blocks.blockEditingModes.get(n)),!t);)n=e.blocks.parents.get(n);if("disabled"===t)return void i.set(a,"disabled")}if(n)return a===r||o?.length&&o.includes(a)?void i.set(a,"contentOnly"):void i.set(a,"disabled");if(l.length){if(l.includes(a))return cp(e,a,l)?void i.set(a,"disabled"):void 0;const n=cp(e,a,l);if(n)return cp(e,n,l)?void i.set(a,"disabled"):function(e){return e?.attributes?.metadata?.bindings&&Object.keys(e?.attributes?.metadata?.bindings).length}(t)?void i.set(a,"contentOnly"):void i.set(a,"disabled")}u&&d?i.set(a,"default"):f.length&&cp(e,a,f)&&(qh(c)?i.set(a,"contentOnly"):i.set(a,"disabled"))}}else i.set(a,"disabled")}),i}function dp({prevState:e,nextState:t,addedBlocks:n,removedClientIds:i}){const r=e.derivedBlockEditingModes;let o;return i?.forEach(t=>{lp(e,t,e=>{r.has(e.clientId)&&(o||(o=new Map(r)),o.delete(e.clientId))})}),n?.forEach(e=>{const n=up(t,e.clientId);n.size&&(o=o?new Map([...o?.size?o:[],...n]):new Map([...r?.size?r:[],...n]))}),o}var hp=(0,Eh.h)(function(e){return(t,n)=>{const i=e(t,n);if("SET_EDITOR_MODE"!==n.type&&i===t)return t;switch(n.type){case"REMOVE_BLOCKS":{const e=dp({prevState:t,nextState:i,removedClientIds:n.clientIds});if(e)return{...i,derivedBlockEditingModes:e??t.derivedBlockEditingModes};break}case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const e=dp({prevState:t,nextState:i,addedBlocks:n.blocks});if(e)return{...i,derivedBlockEditingModes:e??t.derivedBlockEditingModes};break}case"UPDATE_BLOCK_ATTRIBUTES":{const e=i.settings?.disableContentOnlyForUnsyncedPatterns;if(e)break;const r=[],o=[];for(const e of n?.clientIds){const s=n.options?.uniqueByBlock?n.attributes[e]:n.attributes;if(!s)break;s.metadata?.patternName&&!t.blocks.attributes.get(e)?.metadata?.patternName?r.push(i.blocks.tree.get(e)):s.metadata&&!s.metadata?.patternName&&t.blocks.attributes.get(e)?.metadata?.patternName&&o.push(e)}if(!r?.length&&!o?.length)break;const s=dp({prevState:t,nextState:i,addedBlocks:r,removedClientIds:o});if(s)return{...i,derivedBlockEditingModes:s??t.derivedBlockEditingModes};break}case"UPDATE_BLOCK_LIST_SETTINGS":{const e=[],r=[],o="string"==typeof n.clientId?{[n.clientId]:n.settings}:n.clientId;for(const n in o){const o="contentOnly"!==t.blockListSettings.get(n)?.templateLock&&"contentOnly"===i.blockListSettings.get(n)?.templateLock,s="contentOnly"===t.blockListSettings.get(n)?.templateLock&&"contentOnly"!==i.blockListSettings.get(n)?.templateLock;o?e.push(i.blocks.tree.get(n)):s&&r.push(n)}if(!e.length&&!r.length)break;const s=dp({prevState:t,nextState:i,addedBlocks:e,removedClientIds:r});if(s)return{...i,derivedBlockEditingModes:s??t.derivedBlockEditingModes};break}case"SET_BLOCK_EDITING_MODE":case"UNSET_BLOCK_EDITING_MODE":case"SET_HAS_CONTROLLED_INNER_BLOCKS":{const e=ap(i,n.clientId);if(!e)break;const r=dp({prevState:t,nextState:i,removedClientIds:[n.clientId],addedBlocks:[e]});if(r)return{...i,derivedBlockEditingModes:r??t.derivedBlockEditingModes};break}case"REPLACE_BLOCKS":{const e=dp({prevState:t,nextState:i,addedBlocks:n.blocks,removedClientIds:n.clientIds});if(e)return{...i,derivedBlockEditingModes:e??t.derivedBlockEditingModes};break}case"REPLACE_INNER_BLOCKS":{const e=t.blocks.order.get(n.rootClientId),r=dp({prevState:t,nextState:i,addedBlocks:n.blocks,removedClientIds:e});if(r)return{...i,derivedBlockEditingModes:r??t.derivedBlockEditingModes};break}case"MOVE_BLOCKS_TO_POSITION":{const e=n.clientIds.map(e=>i.blocks.byClientId.get(e)),r=dp({prevState:t,nextState:i,addedBlocks:e,removedClientIds:n.clientIds});if(r)return{...i,derivedBlockEditingModes:r??t.derivedBlockEditingModes};break}case"UPDATE_SETTINGS":if(t?.settings?.[Ph]!==i?.settings?.[Ph]||!!t?.settings?.disableContentOnlyForUnsyncedPatterns!=!!i?.settings?.disableContentOnlyForUnsyncedPatterns||!!t?.settings?.[zh]!=!!i?.settings?.[zh]||!!t?.settings?.disableContentOnlyForTemplateParts!=!!i?.settings?.disableContentOnlyForTemplateParts)return{...i,derivedBlockEditingModes:up(i)};break;case"RESET_BLOCKS":case"EDIT_CONTENT_ONLY_SECTION":case"SET_EDITOR_MODE":case"RESET_ZOOM_LEVEL":case"SET_ZOOM_LEVEL":return{...i,derivedBlockEditingModes:up(i)}}return i.derivedBlockEditingModes=t?.derivedBlockEditingModes??new Map,i}},function(e){return(t,n)=>{const i=e(t,n);return t?(i.automaticChangeStatus=t.automaticChangeStatus,"MARK_AUTOMATIC_CHANGE"===n.type?{...i,automaticChangeStatus:"pending"}:"MARK_AUTOMATIC_CHANGE_FINAL"===n.type&&"pending"===t.automaticChangeStatus?{...i,automaticChangeStatus:"final"}:i.blocks===t.blocks&&i.selection===t.selection||"final"!==i.automaticChangeStatus&&i.selection!==t.selection?i:{...i,automaticChangeStatus:void 0}):i}})(sp),pp=n(65853),fp="core/block-editor",mp=n(56671),gp=n(32461),bp=n(80619),yp={desktop:{label:(0,ee.__)("Desktop"),icon:mp.A,key:"desktop"},tablet:{label:(0,ee.__)("Tablet"),icon:gp.A,key:"tablet"},mobile:{label:(0,ee.__)("Mobile"),icon:bp.A,key:"mobile"}},vp=Object.entries(yp);function _p(e,t,n){t=Array.isArray(t)?[...t]:[t],e=Array.isArray(e)?[...e]:{...e};const i=t.pop();let r=e;for(const e of t){const t=r[e];r=r[e]=Array.isArray(t)?[...t]:{...t}}return r[i]=n,e}var xp=(e,t,n)=>{const i=Array.isArray(t)?t:t.split(".");let r=e;return i.forEach(e=>{r=r?.[e]}),r??n},kp=["color","border","dimensions","typography","spacing"],wp={"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},Cp={"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"};function Sp(e,t,...n){const i=qf(e,t),r=[];if(t){let n=t;do{_n(qf(e,n),"__experimentalSettings",!1)&&r.push(n)}while(n=e.blocks.parents.get(n))}return n.map(n=>{if(kp.includes(n))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let o=(0,Ei.W5)("blockEditor.useSetting.before",void 0,n,t,i);if(void 0!==o)return o;const s=(e=>Cp[e]||e)(n);for(const t of r){const n=Yf(e,t);if(o=xp(n.settings?.blocks?.[i],s)??xp(n.settings,s),void 0!==o)break}const a=Dg(e);if(void 0===o&&i&&(o=xp(a.__experimentalFeatures?.blocks?.[i],s)),void 0===o&&(o=xp(a.__experimentalFeatures,s)),void 0!==o)return on[s]?o.custom??o.theme??o.default:o;const l=wp[s]?.(a);return void 0!==l?l:"typography.dropCap"===s||void 0})}var{isContentBlock:Ap}=Gh(ia);function Ip(e){return e.isBlockInterfaceHidden}function Ep(e){return e?.lastBlockInserted?.clientIds}function jp(e,t){return e.blocks.byClientId.get(t)}var Tp=(e,t)=>{const n=t=>"disabled"===tb(e,t)&&Vm(e,t).every(n);return Vm(e,t).every(n)};function Bp(e,t,n){const i=Ap(t),r=qf(e,n),o=Ap(r);return tf(e)===n||o&&i}function Np(e,t){const n=Vm(e,t),i=[];for(const t of n){const n=Np(e,t);"disabled"!==tb(e,t)?i.push({clientId:t,innerBlocks:n}):i.push(...n)}return i}var Rp=(0,Yn.N)(()=>(0,ce.A)(Np,e=>[e.blocks.order,e.derivedBlockEditingModes,e.blocks.blockEditingModes])),Op=(0,ce.A)((e,t,n=!1)=>ym(e,t,n).filter(t=>"disabled"!==tb(e,t)),e=>[e.blocks.parents,e.blocks.blockEditingModes,e.settings.templateLock,e.blockListSettings]);function Lp(e){return e.removalPromptData}function Mp(e){return e.blockRemovalRules}var Pp=(0,ce.A)(e=>{const t=nm(e).reduce((e,t,n)=>(e[t]=n,e),{});return[...e.styleOverrides].sort((e,n)=>{const[,{clientId:i}]=e,[,{clientId:r}]=n;return(t[i]??-1)-(t[r]??-1)})},e=>[e.blocks.order,e.styleOverrides]);function Dp(e){return e.registeredInserterMediaCategories}var Fp=(0,ce.A)(e=>{const{settings:{inserterMediaCategories:t,allowedMimeTypes:n,enableOpenverseMediaCategory:i},registeredInserterMediaCategories:r}=e;if(!t&&!r.length||!n)return;const o=t?.map(({name:e})=>e)||[];return[...t||[],...(r||[]).filter(({name:e})=>!o.includes(e))].filter(e=>!(!i&&"openverse"===e.name)&&Object.values(n).some(t=>t.startsWith(`${e.mediaType}/`)))},e=>[e.settings.inserterMediaCategories,e.settings.allowedMimeTypes,e.settings.enableOpenverseMediaCategory,e.registeredInserterMediaCategories]),zp=(0,Yn.N)(e=>(0,ce.A)((t,n=null)=>{const{getAllPatterns:i}=Gh(e(fp)),r=i(),{allowedBlockTypes:o}=Dg(t);return r.some(e=>{const{inserter:i=!0}=e;if(!i)return!1;const r=Pf(e);return Ff(r,o)&&r.every(({name:e})=>ug(t,e,n))})},(t,n)=>[...zf(e)(t),...Vf(e)(t,n)])),Vp=(0,Yn.N)(e=>(0,ce.A)((t,n)=>{if(n?.startsWith("core/block/")){const i=parseInt(n.slice(11),10),r=Gh(e(fp)).getReusableBlocks().find(({id:e})=>e===i);return r?Lf(r,t.settings.__experimentalUserPatternCategories):null}return[...t.settings.__experimentalBlockPatterns??[],...t.settings[Lh]?.(e)??[]].find(({name:e})=>e===n)},(t,n)=>n?.startsWith("core/block/")?[Gh(e(fp)).getReusableBlocks(),t.settings.__experimentalReusableBlocks]:[t.settings.__experimentalBlockPatterns,t.settings[Lh]?.(e)])),Up=(0,Yn.N)(e=>(0,ce.A)(t=>[...Gh(e(fp)).getReusableBlocks().map(e=>Lf(e,t.settings.__experimentalUserPatternCategories)),...t.settings.__experimentalBlockPatterns??[],...t.settings[Lh]?.(e)??[]].filter((e,t,n)=>t===n.findIndex(t=>e.name===t.name)),zf(e))),$p=[],Hp=(0,Yn.N)(e=>t=>{const n=t.settings[Mh];return(n?n(e):t.settings.__experimentalReusableBlocks)??$p});function Wp(e){return e.lastFocus}function Gp(e){return e.isDragging}function qp(e){return e.expandedBlock}var Kp=(e,t)=>{let n,i=t;for(;!n&&(i=e.blocks.parents.get(i));)"contentOnly"===ag(e,i)&&(n=i);return n};function Yp(e,t){const n=qf(e,t);if("core/block"===n)return!0;const i=Yf(e,t),r="core/template-part"===n,o=e.settings?.[zh],s=e.settings?.disableContentOnlyForUnsyncedPatterns,a=e.settings?.disableContentOnlyForTemplateParts;if((!s&&i?.metadata?.patternName||r&&!a)&&!o)return!0;const l="contentOnly"===ag(e,t),c="contentOnly"===ag(e,bm(e,t));return!(!l||c)}var Jp=(e,t)=>{if(Qp(e,t))return;let n,i=t;for(;i=e.blocks.parents.get(i);)Yp(e,i)&&(n=i);return n};function Xp(e,t){return!Qp(e,t)&&!Jp(e,t)&&Yp(e,t)}function Zp(e){return e.editedContentOnlySection}function Qp(e,t){if(!e.editedContentOnlySection)return!1;if(e.editedContentOnlySection===t)return!0;let n=t;for(;n=e.blocks.parents.get(n);)if(e.editedContentOnlySection===n)return!0;return!1}var ef=(0,ce.A)((e,t)=>t.reduce((t,n)=>(t[n]=e.blocks.attributes.get(n)?.style,t),{}),(e,t)=>[...t.map(t=>e.blocks.attributes.get(t)?.style)]);function tf(e){return e.settings?.[Ph]}function nf(e){return"auto-scaled"===e.zoomLevel||e.zoomLevel<100}function rf(e){return e.zoomLevel}function of(e,t,n=""){const i=Array.isArray(t)?t:[t],r=t=>i.every(n=>ug(e,n,t));if(!n){if(r(n))return n;const t=tf(e);return t&&r(t)?t:null}let o=n;for(;null!==o&&!r(o);)o=bm(e,o);return o}function sf(e,t,n){const{allowedBlockTypes:i}=Dg(e);return Ff(Pf(t),i)?of(e,Pf(t).map(({blockName:e})=>e),n):null}function af(e){return e.insertionPoint}var lf=(e,t)=>{if(!_n(qf(e,t),"visibility",!0))return!1;const n=e.blocks.attributes.get(t),i=n?.metadata?.blockVisibility;return!1===i||"object"==typeof i?.viewport&&null!==i?.viewport&&Object.values(yp).some(e=>!1===i?.viewport?.[e.key])},cf=(e,t)=>{if(!_n(qf(e,t),"visibility",!0))return!1;const n=e.blocks.attributes.get(t),i=n?.metadata?.blockVisibility;return!1===i},uf=(e,t)=>ym(e,t).some(t=>cf(e,t)),df=(e,t,n)=>{if(cf(e,t))return!0;const i=e.blocks.attributes.get(t),r=i?.metadata?.blockVisibility?.viewport;return"object"==typeof r&&null!==r&&"string"==typeof n&&!1===r?.[n.toLowerCase()]},hf=(e,t,n)=>ym(e,t).some(t=>df(e,t,n));function pf(e){return!!e.hasBlockSpotlight||!!e.editedContentOnlySection}function ff(e,t){const n=Yf(e,t);return!!n?.lock?.edit}function mf(e,t){const n=Yf(e,t);return void 0!==n?.lock?.move?!!n?.lock?.move:"all"===ag(e,bm(e,t))}function gf(e,t){const n=Yf(e,t);if(void 0!==n?.lock?.remove)return!!n?.lock?.remove;const i=ag(e,bm(e,t));return"all"===i||"insert"===i}function bf(e,t){return ff(e,t)||mf(e,t)||gf(e,t)}function yf(e){return e.listViewContentPanelOpen}function vf(e,t){return!!e.openedListViewPanels?.allOpen||!0===e.openedListViewPanels?.panels?.[t]}function _f(e){return e.listViewExpandRevision||0}function xf(e){return e.viewportModalClientIds}function kf(e){return e.requestedInspectorTab}var wf="user",Cf="theme",Sf="directory",Af="fully",If="unsynced",Ef={name:"allPatterns",label:(0,ee._x)("All","patterns")},jf={name:"myPatterns",label:(0,ee.__)("My patterns")},Tf={name:"core/starter-content",label:(0,ee.__)("Starter content")};function Bf(e,t,n){const i=e.name.startsWith("core/block"),r="core"===e.source||e.source?.startsWith("pattern-directory");return!(t!==Cf||!i&&!r)||!(t!==Sf||!i&&r)||t===wf&&e.type!==wf||n===Af&&""!==e.syncStatus||!(n!==If||"unsynced"===e.syncStatus||!i)}var Nf=Symbol("isFiltered"),Rf=new WeakMap,Of=new WeakMap;function Lf(e,t=[]){return{name:`core/block/${e.id}`,id:e.id,type:wf,title:e.title?.raw,categories:e.wp_pattern_category?.map(e=>{const n=t.find(({id:t})=>t===e);return n?n.slug:e}),content:e.content?.raw,syncStatus:e.wp_pattern_sync_status}}function Mf(e){let t=Rf.get(e);return t||(t=function(e){const t=Vo(e.content,{__unstableSkipMigrationLogs:!0});return 1===t.length&&(t[0].attributes={...t[0].attributes,metadata:{...t[0].attributes.metadata||{},categories:e.categories,patternName:e.name,name:t[0].attributes.metadata?.name||e.title}}),{...e,blocks:t}}(e),Rf.set(e,t)),t}function Pf(e){let t=Of.get(e);return t||(t=vr(e.content),t=t.filter(e=>null!==e.blockName),Of.set(e,t)),t}var Df=(e,t,n=null)=>"boolean"==typeof e?e:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n,Ff=(e,t)=>{if("boolean"==typeof t)return t;const n=[...e];for(;n.length>0;){const e=n.shift();if(!Df(t,e.name||e.blockName,!0))return!1;e.innerBlocks?.forEach(e=>{n.push(e)})}return!0},zf=e=>t=>[t.settings.__experimentalBlockPatterns,t.settings.__experimentalUserPatternCategories,t.settings.__experimentalReusableBlocks,t.settings[Lh]?.(e),t.blockPatterns,Gh(e(fp)).getReusableBlocks()],Vf=()=>(e,t)=>[e.blockListSettings.get(t),e.blocks.byClientId.get(t),e.blocks.order.get(t||""),e.settings.allowedBlockTypes,e.settings.templateLock,tb(e,t),tf(e),Xp(e,t),Jp(e,t)];function Uf(e,t,n="asc"){return e.concat().sort(((e,t,n)=>(i,r)=>{let o,s;if("function"==typeof e?(o=e(i),s=e(r)):(o=i[e],s=r[e]),o>s)return"asc"===n?1:-1;if(s>o)return"asc"===n?-1:1;const a=t.findIndex(e=>e===i),l=t.findIndex(e=>e===r);return a>l?1:l>a?-1:0})(t,e,n))}var{isContentBlock:$f}=Gh(ia),Hf=[],Wf=new Set,Gf={[Nf]:!0};function qf(e,t){const n=e.blocks.byClientId.get(t),i="core/social-link";if("web"!==Uo.A.OS&&n?.name===i){const n=e.blocks.attributes.get(t),{service:r}=n??{};return r?`${i}-${r}`:i}return n?n.name:null}function Kf(e,t){const n=e.blocks.byClientId.get(t);return!!n&&n.isValid}function Yf(e,t){return e.blocks.byClientId.get(t)?e.blocks.attributes.get(t):null}function Jf(e,t){return e.blocks.byClientId.has(t)?e.blocks.tree.get(t):null}var Xf=(0,ce.A)((e,t)=>{const n=e.blocks.byClientId.get(t);return n?{...n,attributes:Yf(e,t)}:null},(e,t)=>[e.blocks.byClientId.get(t),e.blocks.attributes.get(t)]);function Zf(e,t){const n=t&&qg(e,t)?"controlled||"+t:t||"";return e.blocks.tree.get(n)?.innerBlocks||Hf}var Qf=(0,ce.A)((e,t)=>((0,Qt.A)("wp.data.select( 'core/block-editor' ).__unstableGetClientIdWithClientIdsTree",{since:"6.3",version:"6.5"}),{clientId:t,innerBlocks:em(e,t)}),e=>[e.blocks.order]),em=(0,ce.A)((e,t="")=>((0,Qt.A)("wp.data.select( 'core/block-editor' ).__unstableGetClientIdsTree",{since:"6.3",version:"6.5"}),Vm(e,t).map(t=>Qf(e,t))),e=>[e.blocks.order]),tm=(0,ce.A)((e,t)=>{t=Array.isArray(t)?[...t]:[t];const n=[];for(const i of t){const t=e.blocks.order.get(i);t&&n.push(...t)}let i=0;for(;i<n.length;){const t=n[i],r=e.blocks.order.get(t);r&&n.splice(i+1,0,...r),i++}return n},e=>[e.blocks.order]),nm=e=>tm(e,""),im=(0,ce.A)((e,t)=>{const n=nm(e);if(!t)return n.length;let i=0;for(const r of n)e.blocks.byClientId.get(r).name===t&&i++;return i},e=>[e.blocks.order,e.blocks.byClientId]),rm=(0,ce.A)((e,t)=>{if(!t)return Hf;const n=Array.isArray(t)?t:[t],i=nm(e).filter(t=>{const i=e.blocks.byClientId.get(t);return n.includes(i.name)});return i.length>0?i:Hf},e=>[e.blocks.order,e.blocks.byClientId]);function om(e,t){return(0,Qt.A)("wp.data.select( 'core/block-editor' ).__experimentalGetGlobalBlocksByName",{since:"6.5",alternative:"wp.data.select( 'core/block-editor' ).getBlocksByName"}),rm(e,t)}var sm=(0,ce.A)((e,t)=>(Array.isArray(t)?t:[t]).map(t=>Jf(e,t)),(e,t)=>(Array.isArray(t)?t:[t]).map(t=>e.blocks.tree.get(t))),am=(0,ce.A)((e,t)=>sm(e,t).filter(Boolean).map(e=>e.name),(e,t)=>sm(e,t));function lm(e,t){return Vm(e,t).length}function cm(e){return e.selection.selectionStart}function um(e){return e.selection.selectionEnd}function dm(e){return e.selection.selectionStart.clientId}function hm(e){return e.selection.selectionEnd.clientId}function pm(e){return Im(e).length||(e.selection.selectionStart.clientId?1:0)}function fm(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function mm(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:i}=t;return i&&i===n.clientId?i:null}function gm(e){const t=mm(e);return t?Jf(e,t):null}function bm(e,t){return e.blocks.parents.get(t)??null}var ym=(0,ce.A)((e,t,n=!1)=>{const i=[];let r=t;for(;r=e.blocks.parents.get(r);)i.push(r);return i.length?n?i:i.reverse():Hf},e=>[e.blocks.parents]),vm=(0,ce.A)((e,t,n,i=!1)=>{const r=ym(e,t,i),o=Array.isArray(n)?e=>n.includes(e):e=>n===e;return r.filter(t=>o(qf(e,t)))},e=>[e.blocks.parents]);function _m(e,t){let n,i=t;do{n=i,i=e.blocks.parents.get(i)}while(i);return n}function xm(e,t){const n=mm(e),i=[...ym(e,t),t],r=[...ym(e,n),n];let o;const s=Math.min(i.length,r.length);for(let e=0;e<s&&i[e]===r[e];e++)o=i[e];return o}function km(e,t,n=1){if(void 0===t&&(t=mm(e)),void 0===t&&(t=n<0?jm(e):Tm(e)),!t)return null;const i=bm(e,t);if(null===i)return null;const{order:r}=e.blocks,o=r.get(i),s=o.indexOf(t)+1*n;return s<0||s===o.length?null:o[s]}function wm(e,t){return km(e,t,-1)}function Cm(e,t){return km(e,t,1)}function Sm(e){return e.initialPosition}var Am=(0,ce.A)(e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(!t.clientId||!n.clientId)return Hf;if(t.clientId===n.clientId)return[t.clientId];const i=bm(e,t.clientId);if(null===i)return Hf;const r=Vm(e,i),o=r.indexOf(t.clientId),s=r.indexOf(n.clientId);return o>s?r.slice(s,o+1):r.slice(o,s+1)},e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]);function Im(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?Hf:Am(e)}var Em=(0,ce.A)(e=>{const t=Im(e);return t.length?t.map(t=>Jf(e,t)):Hf},e=>[...Am.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]);function jm(e){return Im(e)[0]||null}function Tm(e){const t=Im(e);return t[t.length-1]||null}function Bm(e,t){return jm(e)===t}function Nm(e,t){return-1!==Im(e).indexOf(t)}var Rm=(0,ce.A)((e,t)=>{let n=t,i=!1;for(;n&&!i;)n=bm(e,n),i=Nm(e,n);return i},e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]);function Om(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function Lm(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Mm(e){const t=cm(e),n=um(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Pm(e){const t=cm(e),n=um(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function Dm(e){return Am(e).some(t=>!bn(qf(e,t)).merge)}function Fm(e,t){const n=cm(e),i=um(e);if(n.clientId===i.clientId)return!1;if(!n.attributeKey||!i.attributeKey||void 0===n.offset||void 0===i.offset)return!1;const r=bm(e,n.clientId);if(r!==bm(e,i.clientId))return!1;const o=Vm(e,r);let s,a;o.indexOf(n.clientId)>o.indexOf(i.clientId)?(s=i,a=n):(s=n,a=i);const l=t?a.clientId:s.clientId,c=t?s.clientId:a.clientId,u=qf(e,l);if(!bn(u).merge)return!1;const d=Jf(e,c);if(d.name===u)return!0;const h=ur(d,u);return h&&h.length}var zm=e=>{const t=cm(e),n=um(e);if(t.clientId===n.clientId)return Hf;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return Hf;const i=bm(e,t.clientId);if(i!==bm(e,n.clientId))return Hf;const r=Vm(e,i),o=r.indexOf(t.clientId),s=r.indexOf(n.clientId),[a,l]=o>s?[n,t]:[t,n],c=Jf(e,a.clientId),u=Jf(e,l.clientId),d=c.attributes[a.attributeKey],h=u.attributes[l.attributeKey];let p=We({html:d}),f=We({html:h});return p=at(p,0,a.offset),f=at(f,l.offset,f.text.length),[{...c,attributes:{...c.attributes,[a.attributeKey]:Be({value:p})}},{...u,attributes:{...u.attributes,[l.attributeKey]:Be({value:f})}}]};function Vm(e,t){return e.blocks.order.get(t||"")||Hf}function Um(e,t){return Vm(e,bm(e,t)).indexOf(t)}function $m(e,t){const{selectionStart:n,selectionEnd:i}=e.selection;return n.clientId===i.clientId&&n.clientId===t}function Hm(e,t,n=!1){const i=Am(e);return!!i.length&&(n?i.some(n=>ym(e,n,!0).includes(t)):i.some(n=>bm(e,n)===t))}function Wm(e,t,n=!1){return Vm(e,t).some(t=>eg(e,t)||n&&Wm(e,t,n))}function Gm(e,t){if(!t)return!1;const n=Im(e),i=n.indexOf(t);return i>-1&&i<n.length-1}function qm(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function Km(e){return e.isMultiSelecting}function Ym(e){return e.isSelectionEnabled}function Jm(e,t){return e.blocksMode[t]||"visual"}function Xm(e){return e.isTyping}function Zm(e){return!!e.draggedBlocks.length}function Qm(e){return e.draggedBlocks}function eg(e,t){return e.draggedBlocks.includes(t)}function tg(e,t){return!!Zm(e)&&ym(e,t).some(t=>eg(e,t))}function ng(){return(0,Qt.A)('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}var ig=(0,ce.A)(e=>{let t,n;const{insertionCue:i,selection:{selectionEnd:r}}=e;if(null!==i)return i;const{clientId:o}=r;return o?(t=bm(e,o)||void 0,n=Um(e,r.clientId)+1):n=Vm(e).length,{rootClientId:t,index:n}},e=>[e.insertionCue,e.selection.selectionEnd.clientId,e.blocks.parents,e.blocks.order]);function rg(e){return null!==e.insertionCue}function og(e){return e.template.isValid}function sg(e){return e.settings.template}function ag(e,t){if(!t)return e.settings.templateLock??!1;const n=Pg(e,t)?.templateLock;return("contentOnly"!==n||e.editedContentOnlySection!==t)&&(n??!1)}var lg=(e,t,n=null)=>{let i,r;if(t&&"object"==typeof t?(i=t,r=t.name):(i=bn(t),r=t),!i)return!1;const{allowedBlockTypes:o}=Dg(e);if(!Df(o,r,!0))return!1;const s=(Array.isArray(i.parent)?i.parent:[]).concat(Array.isArray(i.ancestor)?i.ancestor:[]);if(s.length>0){if(s.includes("core/post-content"))return!0;let t=n,i=!1;do{if(s.includes(qf(e,t))){i=!0;break}t=e.blocks.parents.get(t)}while(t);return i}return!0},cg=(e,t,n=null)=>{if(e.settings.isPreviewMode)return!1;if(!lg(e,t,n))return!1;let i;t&&"object"==typeof t?(i=t,t=i.name):i=bn(t);const r=ag(e,n);if(r&&"contentOnly"!==r)return!1;const o=tb(e,n??""),s=!!Xp(e,n),a=s?n:Jp(e,n),l=!!a;if("disabled"===o&&(!l||t!==gn()))return!1;const c=Pg(e,n);if(n&&void 0===c)return!1;const u=$f(t);if(l&&!u)return!1;if(l&&"core/block"===qf(e,a))return!1;if(l&&(s||"contentOnly"===o||"disabled"===o)&&!Bp(e,t,n)){const i=gn();if(t!==i)return!1;if(!Vm(e,n).some(t=>qf(e,t)===i))return!1}const d=qf(e,n),h=bn(d),p=h?.allowedBlocks;let f=Df(p,t);if(!1!==f){const e=c?.allowedBlocks,n=Df(e,t);null!==n&&(f=n)}const m=i.parent,g=Df(m,d);let b=!0;const y=i.ancestor;y&&(b=[n,...ym(e,n)].some(t=>Df(y,qf(e,t))));const v=b&&(null===f&&null===g||!0===f||!0===g);return v?(0,Ei.W5)("blockEditor.__unstableCanInsertBlockType",v,i,n,{getBlock:Jf.bind(null,e),getBlockParentsByBlockName:vm.bind(null,e)}):v},ug=(0,Yn.N)(e=>(0,ce.A)(cg,(t,n,i)=>Vf(e)(t,i)));function dg(e,t,n=null){return t.every(t=>ug(e,qf(e,t),n))}function hg(e,t){if(e.settings.isPreviewMode)return!1;const n=Yf(e,t);if(null===n)return!0;if(void 0!==n.lock?.remove)return!n.lock.remove;const i=bm(e,t),r=ag(e,i);if(r&&"contentOnly"!==r)return!1;const o=!!Xp(e,i),s=o?i:Jp(e,i),a=!!s,l=$f(qf(e,t));if(a&&!l)return!1;if(a&&"core/block"===qf(e,s))return!1;const c=tb(e,i),u=qf(e,t),d=gn();if(a&&(o||u===d||"contentOnly"===c)&&!Bp(e,qf(e,t),i)){if(u===d){const t=Vm(e,i).filter(t=>qf(e,t)===d);return t.length>1}return!1}return"disabled"!==c}function pg(e,t){return t.every(t=>hg(e,t))}function fg(e,t){if(e.settings.isPreviewMode)return!1;const n=Yf(e,t);if(null===n)return!0;if(void 0!==n.lock?.move)return!n.lock.move;const i=bm(e,t);if("all"===ag(e,i))return!1;const r=!!Jp(e,t),o=$f(qf(e,t));if(r&&!o)return!1;const s=!!Xp(e,i),a=tb(e,i);return!(r&&(s||"contentOnly"===a)&&!Bp(e,qf(e,t),i))&&"disabled"!==tb(e,i)}function mg(e,t){return t.every(t=>fg(e,t))}function gg(e,t){if(e.settings.isPreviewMode)return!1;const n=Yf(e,t);if(null===n)return!0;const{lock:i}=n;return!i?.edit}function bg(e,t){return!e.settings.isPreviewMode&&!!_n(t,"lock",!0)&&!!e.settings?.canLockBlocks}function yg(e,t){return e.preferences.insertUsage?.[t]??null}var vg=(e,t,n)=>!!_n(t,"inserter",!0)&&cg(e,t.name,n),_g=(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}},xg=(e,{buildScope:t="inserter"})=>n=>{const i=n.name;let r=!1;_n(n.name,"multiple",!0)||(r=sm(e,nm(e)).some(({name:e})=>e===n.name));const{time:o,count:s=0}=yg(e,i)||{},a={id:i,name:n.name,title:n.title,icon:n.icon,isDisabled:r,frecency:_g(o,s)};if("transform"===t)return a;const l=[...wn(n.name,"inserter"),...wn(n.name,"block").filter(e=>"core/heading"===n.name&&["h1","h2","h3","h4","h5","h6"].includes(e.name)).map(e=>({...e,isSearchOnly:!0}))];return{...a,initialAttributes:{},description:n.description,category:n.category,keywords:n.keywords,parent:n.parent,ancestor:n.ancestor,variations:l,example:n.example,utility:1}},kg=(0,Yn.N)(e=>(0,ce.A)((t,n=null,i=Gf)=>{const r=cg(t,"core/block",n)?Gh(e(fp)).getReusableBlocks().map(e=>{const n=e.wp_pattern_sync_status?pp.A:{src:pp.A,foreground:"var(--wp-block-synced-color)"},i=Lf(e),{time:r,count:o=0}=yg(t,i.name)||{},s=_g(r,o);return{id:i.name,name:"core/block",initialAttributes:{ref:e.id},title:i.title,icon:n,category:"reusable",keywords:["reusable"],isDisabled:!1,utility:1,frecency:s,content:i.content,get blocks(){return Mf(i).blocks},syncStatus:i.syncStatus}}):[],o=xg(t,{buildScope:"inserter"});let s=yn().filter(e=>_n(e,"inserter",!0)).map(o);if(!1!==i[Nf])s=s.filter(e=>vg(t,e,n));else{const{getClosestAllowedInsertionPoint:i}=Gh(e(fp));s=s.filter(e=>lg(t,e,n)&&null!==i(e.name,n)).map(e=>({...e,isAllowedInCurrentRoot:vg(t,e,n)}))}const a=s.reduce((e,n)=>{const{variations:i=[]}=n;if(i.some(({isDefault:e})=>e)||e.push(n),i.length){const r=((e,t)=>n=>{const i=`${t.id}/${n.name}`,{time:r,count:o=0}=yg(e,i)||{};return{...t,id:i,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:_g(r,o),isSearchOnly:n.isSearchOnly}})(t,n);e.push(...i.map(r))}return e},[]),{core:l,noncore:c}=a.reduce((e,t)=>{const{core:n,noncore:i}=e;return(t.name.startsWith("core/")?n:i).push(t),e},{core:[],noncore:[]});return[...l,...c,...r]},(t,n)=>[yn(),Gh(e(fp)).getReusableBlocks(),t.blocks.order,t.preferences.insertUsage,...Vf(e)(t,n)])),wg=(0,Yn.N)(e=>(0,ce.A)((e,t,n=null)=>{const i=Array.isArray(t)?t:[t],r=xg(e,{buildScope:"transform"}),o=yn().filter(t=>vg(e,t,n)).map(r),s=Object.fromEntries(Object.entries(o).map(([,e])=>[e.name,e]));return Uf(function(e){if(!e.length)return[];const t=(e=>e.length?yn().filter(t=>!!ar(lr("from",t.name),t=>rr(t,"from",e))):[])(e),n=(e=>{if(!e.length)return[];const t=bn(e[0].name);return(t?lr("to",t.name):[]).filter(t=>t&&rr(t,"to",e)).map(e=>e.blocks).flat().filter(e=>!!e).map(bn).filter(e=>!!e)})(e);return[...new Set([...t,...n])]}(i).reduce((e,t)=>(s[t?.name]&&e.push(s[t.name]),e),[]),e=>s[e.name].frecency,"desc")},(t,n,i)=>[yn(),t.preferences.insertUsage,...Vf(e)(t,i)])),Cg=(e,t=null)=>!!yn().some(n=>vg(e,n,t))||cg(e,"core/block",t),Sg=(0,Yn.N)(e=>(0,ce.A)((e,t=null)=>{if(!t)return;const n=yn().filter(n=>vg(e,n,t));return cg(e,"core/block",t)&&n.push("core/block"),n},(t,n)=>[yn(),...Vf(e)(t,n)])),Ag=(0,ce.A)((e,t=null)=>((0,Qt.A)('wp.data.select( "core/block-editor" ).__experimentalGetAllowedBlocks',{alternative:'wp.data.select( "core/block-editor" ).getAllowedBlocks',since:"6.2",version:"6.4"}),Sg(e,t)),(e,t)=>Sg.getDependants(e,t));function Ig(e,t=null){if(!t)return;const{defaultBlock:n,directInsert:i}=e.blockListSettings.get(t)??{};return n&&i?n:void 0}function Eg(e,t=null){return(0,Qt.A)('wp.data.select( "core/block-editor" ).__experimentalGetDirectInsertBlock',{alternative:'wp.data.select( "core/block-editor" ).getDirectInsertBlock',since:"6.3",version:"6.4"}),Ig(e,t)}var jg=(0,Yn.N)(e=>(t,n)=>{const i=Gh(e(fp)).getPatternBySlug(n);return i?Mf(i):null}),Tg=e=>(t,n)=>[...zf(e)(t),...Vf(e)(t,n)],Bg=new WeakMap;function Ng(e){let t=Bg.get(e);return t||(t={...e,get blocks(){return Mf(e).blocks}},Bg.set(e,t)),t}var Rg=(0,Yn.N)(e=>(0,ce.A)((t,n=null,i=Gf)=>{const{getAllPatterns:r}=Gh(e(fp)),o=r(),{allowedBlockTypes:s}=Dg(t);return o.filter(({inserter:e=!0})=>!!e).map(Ng).filter(e=>Ff(Pf(e),s)).filter(e=>Pf(e).every(({blockName:e})=>!1!==i[Nf]?ug(t,e,n):lg(t,e,n)))},Tg(e))),Og=(0,Yn.N)(e=>(0,ce.A)((t,n,i=null)=>{if(!n)return Hf;const r=e(fp).__experimentalGetAllowedPatterns(i),o=Array.isArray(n)?n:[n],s=r.filter(e=>e?.blockTypes?.some?.(e=>o.includes(e)));return 0===s.length?Hf:s},(t,n,i)=>Tg(e)(t,i))),Lg=(0,Yn.N)(e=>((0,Qt.A)('wp.data.select( "core/block-editor" ).__experimentalGetPatternsByBlockTypes',{alternative:'wp.data.select( "core/block-editor" ).getPatternsByBlockTypes',since:"6.2",version:"6.4"}),e(fp).getPatternsByBlockTypes)),Mg=(0,Yn.N)(e=>(0,ce.A)((t,n,i=null)=>{if(!n)return Hf;if(n.some(({clientId:e,innerBlocks:n})=>n.length||qg(t,e)))return Hf;const r=Array.from(new Set(n.map(({name:e})=>e)));return e(fp).getPatternsByBlockTypes(r,i)},(t,n,i)=>Tg(e)(t,i)));function Pg(e,t){return e.blockListSettings.get(t)}function Dg(e){return e.settings}function Fg(e){return e.blocks.isPersistentChange}var zg=(0,ce.A)((e,t=[])=>{const n={};for(const i of t){const t=Pg(e,i);t&&(n[i]=t)}return n},e=>[e.blockListSettings]),Vg=(0,Yn.N)(e=>(0,ce.A)((t,n)=>{(0,Qt.A)("wp.data.select( 'core/block-editor' ).__experimentalGetReusableBlockTitle",{since:"6.6",version:"6.8"});const i=Gh(e(fp)).getReusableBlocks().find(e=>e.id===n);return i?i.title?.raw:null},()=>[Gh(e(fp)).getReusableBlocks()]));function Ug(e){return e.blocks.isIgnoredChange}function $g(e){return e.lastBlockAttributesChange}function Hg(){return(0,Qt.A)('wp.data.select( "core/block-editor" ).hasBlockMovingClientId',{since:"6.7",hint:"Block moving mode feature has been removed"}),!1}function Wg(e){return!!e.automaticChangeStatus}function Gg(e,t){return e.highlightedBlock===t}function qg(e,t){return e.blocks.controlledInnerBlocks.has(t)}var Kg=(0,ce.A)((e,t)=>{if(!t.length)return null;const n=mm(e);if(t.includes(qf(e,n)))return n;const i=Im(e),r=vm(e,n||i[0],t);return r?r[r.length-1]:null},(e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]);function Yg(e,t,n){const{lastBlockInserted:i}=e;return i.clientIds?.includes(t)&&i.source===n}function Jg(e,t){return e.blockVisibility?.[t]??!0}function Xg(){(0,Qt.A)("wp.data.select( 'core/block-editor' ).getHoveredBlockClientId",{since:"6.9",version:"7.1"})}var Zg=(0,ce.A)(e=>{const t=new Set(Object.keys(e.blockVisibility).filter(t=>e.blockVisibility[t]));return 0===t.size?Wf:t},e=>[e.blockVisibility]);function Qg(e,t){if("default"!==tb(e,t))return!1;if(!gg(e,t))return!0;if(nf(e)){const n=tf(e);if(n){const i=Vm(e,n);if(i?.includes(t))return!0}else if(t&&!bm(e,t))return!0}return!_n(qf(e,t),"__experimentalDisableBlockOverlay",!1)&&qg(e,t)&&!$m(e,t)&&!Hm(e,t,!0)}function eb(e,t){let n=e.blocks.parents.get(t);for(;n;){if(Qg(e,n))return!0;n=e.blocks.parents.get(n)}return!1}function tb(e,t=""){return null===t&&(t=""),e.derivedBlockEditingModes?.has(t)?e.derivedBlockEditingModes.get(t):e.blocks.blockEditingModes.has(t)?e.blocks.blockEditingModes.get(t):"default"}var nb=(0,Yn.N)(e=>(t,n="")=>{const i=n||mm(t);if(!i)return!1;if(Xp(t,i))return!1;const{getGroupingBlockName:r}=e(Zi),o=Jf(t,i),s=r();return o&&(o.name===s||bn(o.name)?.transforms?.ungroup)&&!!o.innerBlocks.length&&hg(t,i)}),ib=(0,Yn.N)(e=>(t,n=Hf)=>{const{getGroupingBlockName:i}=e(Zi),r=i(),o=n?.length?n:Am(t),s=o?.length?bm(t,o[0]):void 0;return ug(t,r,s)&&o.length&&pg(t,o)}),rb=(e,t)=>((0,Qt.A)("wp.data.select( 'core/block-editor' ).__unstableGetContentLockingParent",{since:"6.1",version:"6.7"}),Kp(e,t));function ob(e){return(0,Qt.A)("wp.data.select( 'core/block-editor' ).__unstableGetTemporarilyEditingAsBlocks",{since:"6.1",version:"6.7"}),Zp(e)}var sb=["inserterMediaCategories","blockInspectorAnimation","mediaSideload"];function ab(e,{stripExperimentalSettings:t=!1,reset:n=!1}={}){let i=e;Object.hasOwn(i,"__unstableIsPreviewMode")&&((0,Qt.A)("__unstableIsPreviewMode argument in wp.data.dispatch('core/block-editor').updateSettings",{since:"6.8",alternative:"isPreviewMode"}),i={...i},i.isPreviewMode=i.__unstableIsPreviewMode,delete i.__unstableIsPreviewMode);let r=i;if(t&&"web"===Uo.A.OS){r={};for(const e in i)sb.includes(e)||(r[e]=i[e])}return{type:"UPDATE_SETTINGS",settings:r,reset:n}}function lb(){return{type:"HIDE_BLOCK_INTERFACE"}}function cb(){return{type:"SHOW_BLOCK_INTERFACE"}}var ub=(e,t=!0,n=!1)=>({select:i,dispatch:r,registry:o})=>{if(!e||!e.length)return;var s;if(s=e,e=Array.isArray(s)?s:[s],!i.canRemoveBlocks(e))return;const a=!n&&i.getBlockRemovalRules();if(a){let n=function(e){const t=[],n=[...e];for(;n.length;){const{innerBlocks:e,...i}=n.shift();n.push(...e),t.push(i)}return t};const o=n(e.map(i.getBlock));let s;for(const n of a)if(s=n.callback(o),s)return void r(hb(e,t,s))}t&&r.selectPreviousBlock(e[0],t),o.batch(()=>{r({type:"REMOVE_BLOCKS",clientIds:e}),r(db())})},db=()=>({select:e,dispatch:t})=>{if(e.getBlockCount()>0)return;const{__unstableHasCustomAppender:n}=e.getSettings();n||t.insertDefaultBlock()};function hb(e,t,n){return{type:"DISPLAY_BLOCK_REMOVAL_PROMPT",clientIds:e,selectPrevious:t,message:n}}function pb(){return{type:"CLEAR_BLOCK_REMOVAL_PROMPT"}}function fb(e=!1){return{type:"SET_BLOCK_REMOVAL_RULES",rules:e}}function mb(e,t){return{type:"SET_STYLE_OVERRIDE",id:e,style:t}}function gb(e){return{type:"DELETE_STYLE_OVERRIDE",id:e}}function bb(e=null){return{type:"LAST_FOCUS",lastFocus:e}}function yb(){return{type:"START_DRAGGING"}}function vb(){return{type:"STOP_DRAGGING"}}function _b(e){return{type:"SET_BLOCK_EXPANDED_IN_LIST_VIEW",clientId:e}}function xb(e){return{type:"SET_INSERTION_POINT",value:e}}function kb(e){return{type:"EDIT_CONTENT_ONLY_SECTION",clientId:e}}function wb(){return{type:"EDIT_CONTENT_ONLY_SECTION"}}var Cb=(e=100)=>({select:t,dispatch:n})=>{if(100!==e){const e=t.getBlockSelectionStart(),i=t.getSectionRootClientId();if(e){let r;if(i){const n=t.getBlockOrder(i);r=n?.includes(e)?e:t.getBlockParents(e).find(e=>n.includes(e))}else r=t.getBlockHierarchyRootClientId(e);r?n.selectBlock(r):n.clearSelectedBlock(),(0,dt.L)((0,ee.__)("You are currently in zoom-out mode."))}}n({type:"SET_ZOOM_LEVEL",zoom:e})};function Sb(){return{type:"RESET_ZOOM_LEVEL"}}function Ab(e,t){return{type:"TOGGLE_BLOCK_SPOTLIGHT",clientId:e,hasBlockSpotlight:t}}function Ib(){return{type:"OPEN_LIST_VIEW_CONTENT_PANEL"}}function Eb(){return{type:"CLOSE_LIST_VIEW_CONTENT_PANEL"}}function jb(e){return{type:"SHOW_VIEWPORT_MODAL",clientIds:e}}function Tb(){return{type:"HIDE_VIEWPORT_MODAL"}}function Bb(e,t={}){return{type:"REQUEST_INSPECTOR_TAB",tabName:e,options:t}}function Nb(){return{type:"CLEAR_REQUESTED_INSPECTOR_TAB"}}var Rb=n(62623),Ob=n(8878),Lb="";function Mb(e){if(e)return Object.keys(e).find(t=>{const n=e[t];return("string"==typeof n||n instanceof He)&&-1!==n.toString().indexOf(Lb)})}function Pb(e){for(const[t,n]of Object.entries(e.attributes))if("rich-text"===n.source||"html"===n.source)return t}var Db=e=>Array.isArray(e)?e:[e],Fb=e=>({dispatch:t})=>{t({type:"RESET_BLOCKS",blocks:e}),t(zb(e))},zb=e=>({select:t,dispatch:n})=>{const i=t.getTemplate(),r=t.getTemplateLock(),o=!i||"all"!==r||Qs(e,i);if(o!==t.isValidTemplate())return n.setTemplateValidity(o),o};function Vb(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function Ub(e){return(0,Qt.A)('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function $b(e,t,n={uniqueByBlock:!1}){return"boolean"==typeof n&&(n={uniqueByBlock:n}),{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:Db(e),attributes:t,options:n}}function Hb(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function Wb(e,t=0){return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}function Gb(){return(0,Qt.A)('wp.data.dispatch( "core/block-editor" ).hoverBlock',{since:"6.9",version:"7.1"}),{type:"DO_NOTHING"}}var qb=(e,t=!1)=>({select:n,dispatch:i})=>{const r=n.getPreviousBlockClientId(e);if(r)i.selectBlock(r,-1);else if(t){const t=n.getBlockRootClientId(e);if(t)i.selectBlock(t,-1);else{const t=n.getNextBlockClientId(e);t&&i.selectBlock(t,0)}}},Kb=e=>({select:t,dispatch:n})=>{const i=t.getNextBlockClientId(e);i&&n.selectBlock(i)};function Yb(){return{type:"START_MULTI_SELECT"}}function Jb(){return{type:"STOP_MULTI_SELECT"}}var Xb=(e,t,n=0)=>({select:i,dispatch:r})=>{if(i.getBlockRootClientId(e)!==i.getBlockRootClientId(t))return;r({type:"MULTI_SELECT",start:e,end:t,initialPosition:n});const o=i.getSelectedBlockCount();(0,dt.L)((0,ee.sprintf)((0,ee._n)("%s block selected.","%s blocks selected.",o),o),"assertive")};function Zb(){return{type:"CLEAR_SELECTED_BLOCK"}}function Qb(e=!0){return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}var ey=(e,t,n,i=0,r)=>({select:o,dispatch:s,registry:a})=>{e=Db(e),t=Db(t);const l=o.getBlockRootClientId(e[0]);for(let e=0;e<t.length;e++){const n=t[e];if(!o.canInsertBlockType(n.name,l))return}a.batch(()=>{s({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:i,meta:r}),s.ensureDefaultBlock()})};function ty(e,t){return ey(e,t)}var ny=e=>(t,n)=>({select:i,dispatch:r})=>{i.canMoveBlocks(t)&&r({type:e,clientIds:Db(t),rootClientId:n})},iy=ny("MOVE_BLOCKS_DOWN"),ry=ny("MOVE_BLOCKS_UP"),oy=(e,t="",n="",i)=>({select:r,dispatch:o})=>{if(r.canMoveBlocks(e)){if(t!==n){if(!r.canRemoveBlocks(e))return;if(!r.canInsertBlocks(e,n))return}o({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:i})}};function sy(e,t="",n="",i){return oy([e],t,n,i)}function ay(e,t,n,i,r,o){return ly([e],t,n,i,r,o)}var ly=(e,t,n,i=!0,r=0,o)=>({select:s,dispatch:a})=>{null!==r&&"object"==typeof r&&(o=r,r=0,(0,Qt.A)("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=Db(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:i,initialPosition:i?r:null,meta:o})};function cy(e,t,n={}){const{__unstableWithInserter:i,operation:r,nearestSide:o}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:i,operation:r,nearestSide:o}}var uy=()=>({select:e,dispatch:t})=>{e.isBlockInsertionPointVisible()&&t({type:"HIDE_INSERTION_POINT"})};function dy(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}var hy=()=>({select:e,dispatch:t})=>{t({type:"SYNCHRONIZE_TEMPLATE"});const n=na(e.getBlocks(),e.getTemplate());t.resetBlocks(n)},py=e=>({registry:t,select:n,dispatch:i})=>{const r=n.getSelectionStart(),o=n.getSelectionEnd();if(r.clientId===o.clientId)return;if(!r.attributeKey||!o.attributeKey||void 0===r.offset||void 0===o.offset)return!1;const s=n.getBlockRootClientId(r.clientId);if(s!==n.getBlockRootClientId(o.clientId))return;const a=n.getBlockOrder(s);let l,c;a.indexOf(r.clientId)>a.indexOf(o.clientId)?(l=o,c=r):(l=r,c=o);const u=e?c:l,d=n.getBlock(u.clientId),h=bn(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],y=g.attributes[f.attributeKey];let v=We({html:b}),_=We({html:y});v=at(v,p.offset,v.text.length),_=st(_,Lb,0,f.offset);const x=ir(m,{[p.attributeKey]:Be({value:v})}),k=ir(g,{[f.attributeKey]:Be({value:_})}),w=e?x:k,C=m.name===g.name?[w]:ur(w,h.name);if(!C||!C.length)return;let S;if(e){const e=C.pop();S=h.merge(e.attributes,k.attributes)}else{const e=C.shift();S=h.merge(x.attributes,e.attributes)}const A=Mb(S),I=We({html:S[A]}),E=I.text.indexOf(Lb),j=Be({value:at(I,E,E+1)});S[A]=j;const T=n.getSelectedBlockClientIds(),B=[...e?C:[],{...d,attributes:{...d.attributes,...S}},...e?[]:C];t.batch(()=>{i.selectionChange(d.clientId,A,E,E),i.replaceBlocks(T,B,0,n.getSelectedBlocksInitialCaretPosition())})},fy=(e=[])=>({registry:t,select:n,dispatch:i})=>{const r=n.getSelectionStart(),o=n.getSelectionEnd(),s=n.getBlockRootClientId(r.clientId),a=n.getBlockRootClientId(o.clientId);if(s!==a)return;const l=n.getBlockOrder(s);let c,u;l.indexOf(r.clientId)>l.indexOf(o.clientId)?(c=o,u=r):(c=r,u=o);const d=c,h=u,p=n.getBlock(d.clientId),f=n.getBlock(h.clientId),m=bn(p.name),g=bn(f.name),b="string"==typeof d.attributeKey?d.attributeKey:Pb(m),y="string"==typeof h.attributeKey?h.attributeKey:Pb(g),v=n.getBlockAttributes(d.clientId),_=v?.metadata?.bindings;if(_?.[b]){if(e.length){const{createWarningNotice:e}=t.dispatch(Rb.store);return void e((0,ee.__)("Blocks can't be inserted into other blocks with bindings"),{type:"snackbar"})}return void i.insertAfterBlock(d.clientId)}if(!b||!y||void 0===r.offset||void 0===o.offset)return;if(d.clientId===h.clientId&&b===y&&d.offset===h.offset)if(e.length){if(In(p,"content"))return void i.replaceBlocks([d.clientId],e,e.length-1,-1)}else if(!n.getBlockOrder(d.clientId).length){let e=function(){const e=gn();return n.canInsertBlockType(e,s)?er(e):er(n.getBlockName(d.clientId))};const t=v[b].length;if(0===d.offset&&t)return void i.insertBlocks([e()],n.getBlockIndex(d.clientId),s,!1);if(d.offset===t)return void i.insertBlocks([e()],n.getBlockIndex(d.clientId)+1,s)}const x=p.attributes[b],k=f.attributes[y];let w=We({html:x}),C=We({html:k});w=at(w,d.offset,w.text.length),C=at(C,0,h.offset);let S={...p,innerBlocks:p.clientId===f.clientId?[]:p.innerBlocks,attributes:{...p.attributes,[b]:Be({value:w})}},A={...f,clientId:p.clientId===f.clientId?er(f.name).clientId:f.clientId,attributes:{...f.attributes,[y]:Be({value:C})}};const I=gn();if(p.clientId===f.clientId&&I&&A.name!==I&&n.canInsertBlockType(I,s)){const e=ur(A,I);1===e?.length&&(A=e[0])}if(!e.length)return void i.replaceBlocks(n.getSelectedBlockClientIds(),[S,A]);let E;const j=[],T=[...e],B=T.shift(),N=bn(S.name),R=N.merge&&B.name===N.name?[B]:ur(B,N.name);if(R?.length){const e=R.shift();S={...S,attributes:{...S.attributes,...N.merge(S.attributes,e.attributes)}},j.push(S),E={clientId:S.clientId,attributeKey:b,offset:We({html:S.attributes[b]}).text.length},T.unshift(...R)}else An(S)||j.push(S),j.push(B);const O=T.pop(),L=bn(A.name);if(T.length&&j.push(...T),O){const e=L.merge&&L.name===O.name?[O]:ur(O,L.name);if(e?.length){const t=e.pop();j.push({...A,attributes:{...A.attributes,...L.merge(t.attributes,A.attributes)}}),j.push(...e),E={clientId:A.clientId,attributeKey:y,offset:We({html:t.attributes[y]}).text.length}}else j.push(O),An(A)||j.push(A)}else An(A)||j.push(A);t.batch(()=>{i.replaceBlocks(n.getSelectedBlockClientIds(),j,j.length-1,0),E&&i.selectionChange(E.clientId,E.attributeKey,E.offset,E.offset)})},my=()=>({select:e,dispatch:t})=>{const n=e.getSelectionStart(),i=e.getSelectionEnd();t.selectionChange({start:{clientId:n.clientId},end:{clientId:i.clientId}})},gy=(e,t)=>({registry:n,select:i,dispatch:r})=>{const o=e,s=t,a=i.getBlock(o),l=bn(a.name);if(!l||"disabled"===i.getBlockEditingMode(o)||"disabled"===i.getBlockEditingMode(s))return;const c=i.getBlock(s);if(!l.merge&&vn(a.name,"__experimentalOnMerge")){const e=ur(c,l.name);if(1!==e?.length)return void r.selectBlock(a.clientId);const[t]=e;return t.innerBlocks.length<1?void r.selectBlock(a.clientId):void n.batch(()=>{r.insertBlocks(t.innerBlocks,void 0,o),r.removeBlock(s),r.selectBlock(t.innerBlocks[0].clientId);const e=i.getNextBlockClientId(o);if(e&&i.getBlockName(o)===i.getBlockName(e)){const t=i.getBlockAttributes(o),n=i.getBlockAttributes(e);Object.keys(t).every(e=>t[e]===n[e])&&(r.moveBlocksToPosition(i.getBlockOrder(e),e,o),r.removeBlock(e,!1))}})}if(In(a))return void r.removeBlock(o,i.isBlockSelected(o));if(In(c))return void r.removeBlock(s,i.isBlockSelected(s));if(!l.merge)return void(An(c,"content")?r.removeBlock(s,i.isBlockSelected(s)):r.selectBlock(a.clientId));const u=bn(c.name),{clientId:d,attributeKey:h,offset:p}=i.getSelectionStart(),f=(d===o?l:u).attributes[h],m=(d===o||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=ir(a),b=ir(c);if(m){const e=d===o?g:b,t=st(We({html:e.attributes[h]}),Lb,p,p);e.attributes[h]=Be({value:t})}const y=a.name===c.name?[b]:ur(b,a.name);if(!y||!y.length)return;const v=l.merge(g.attributes,y[0].attributes);if(m){const e=Mb(v),t=We({html:v[e]}),n=t.text.indexOf(Lb),i=Be({value:at(t,n,n+1)});v[e]=i,r.selectionChange(a.clientId,e,n,n)}r.replaceBlocks([a.clientId,c.clientId],[{...a,attributes:{...a.attributes,...v}},...y.slice(1)],0)},by=(e,t=!0)=>ub(e,t);function yy(e,t){return by([e],t)}function vy(e,t,n=!1,i=0){return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?i:null,time:Date.now()}}function _y(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function xy(){return{type:"START_TYPING"}}function ky(){return{type:"STOP_TYPING"}}function wy(e=[]){return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function Cy(){return{type:"STOP_DRAGGING_BLOCKS"}}function Sy(){return(0,Qt.A)('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Ay(){return(0,Qt.A)('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Iy(e,t,n,i){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:i}:{type:"SELECTION_CHANGE",...e}}var Ey=(e,t,n)=>({dispatch:i})=>{const r=gn();if(!r)return;const o=er(r,e);return i.insertBlock(o,n,t)};function jy(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function Ty(e){return ab(e,{stripExperimentalSettings:!0})}function By(){return(0,Qt.A)('wp.data.dispatch( "core/block-editor" ).__unstableSaveReusableBlock',{since:"7.1"}),{type:"DO_NOTHING"}}function Ny(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function Ry(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}var Oy=()=>({dispatch:e})=>{e({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:t=e=>setTimeout(e,100)}=window;t(()=>{e({type:"MARK_AUTOMATIC_CHANGE_FINAL"})})},Ly=e=>({registry:t})=>{t.dispatch(Ob.M).set("core","editorTool",e),"navigation"===e?(0,dt.L)((0,ee.__)("You are currently in Write mode.")):"edit"===e&&(0,dt.L)((0,ee.__)("You are currently in Design mode."))};function My(){return(0,Qt.A)('wp.data.dispatch( "core/block-editor" ).setBlockMovingClientId',{since:"6.7",hint:"Block moving mode feature has been removed"}),{type:"DO_NOTHING"}}var Py=(e,t=!0)=>({select:n,dispatch:i})=>{if(!e||!e.length)return;const r=n.getBlocksByClientId(e);if(r.some(e=>!e))return;if(r.map(e=>e.name).some(e=>!_n(e,"multiple",!0)))return;const o=n.getBlockRootClientId(e[0]),s=Db(e),a=n.getBlockIndex(s[s.length-1]),l=r.map(e=>nr(e));return i.insertBlocks(l,a+1,o,t),l.length>1&&t&&i.multiSelect(l[0].clientId,l[l.length-1].clientId),l.map(e=>e.clientId)},Dy=e=>({select:t,dispatch:n})=>{if(!e)return;const i=t.getBlockRootClientId(e),r=t.getBlockIndex(e),o=i?t.getDirectInsertBlock(i):null;if(!o)return n.insertDefaultBlock({},i,r);const s={};if(o.attributesToCopy){const n=t.getBlockAttributes(e);o.attributesToCopy.forEach(e=>{n[e]&&(s[e]=n[e])})}const a=er(o.name,{...o.attributes,...s});return n.insertBlock(a,r,i)},Fy=e=>({select:t,dispatch:n})=>{if(!e)return;const i=t.getBlockRootClientId(e),r=t.getBlockIndex(e),o=i?t.getDirectInsertBlock(i):null;if(!o)return n.insertDefaultBlock({},i,r+1);const s={};if(o.attributesToCopy){const n=t.getBlockAttributes(e);o.attributesToCopy.forEach(e=>{n[e]&&(s[e]=n[e])})}const a=er(o.name,{...o.attributes,...s});return n.insertBlock(a,r+1,i)};function zy(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}var Vy=(e,t=150)=>async({dispatch:n})=>{n(zy(e,!0)),await new Promise(e=>setTimeout(e,t)),n(zy(e,!1))};function Uy(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function $y(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}function Hy(e){return(0,Qt.A)("wp.data.dispatch( 'core/block-editor' ).__unstableSetTemporarilyEditingAsBlocks",{since:"7.0"}),kb(e)}var Wy=e=>({select:t,dispatch:n})=>{if(!e||"object"!=typeof e)return void console.error("Category should be an `InserterMediaCategory` object.");if(!e.name)return void console.error("Category should have a `name` that should be unique among all media categories.");if(!e.labels?.name)return void console.error("Category should have a `labels.name`.");if(!["image","audio","video"].includes(e.mediaType))return void console.error("Category should have `mediaType` property that is one of `image|audio|video`.");if(!e.fetch||"function"!=typeof e.fetch)return void console.error("Category should have a `fetch` function defined with the following signature `(InserterMediaRequest) => Promise<InserterMediaItem[]>`.");const i=t.getRegisteredInserterMediaCategories();i.some(({name:t})=>t===e.name)?console.error(`A category is already registered with the same name: "${e.name}".`):i.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 Gy(e="",t){return{type:"SET_BLOCK_EDITING_MODE",clientId:e,mode:t}}function qy(e=""){return{type:"UNSET_BLOCK_EDITING_MODE",clientId:e}}function Ky(e){return{type:"SET_OPEN_LIST_VIEW_PANEL",clientId:e}}function Yy(){return{type:"SET_ALL_LIST_VIEW_PANELS_OPEN"}}function Jy(e,t){return{type:"TOGGLE_LIST_VIEW_PANEL",clientId:e,isOpen:t}}function Xy(){return{type:"INCREMENT_LIST_VIEW_EXPAND_REVISION"}}var Zy={reducer:hp,selectors:u,actions:h},Qy=(0,P.A)(fp,{...Zy,persist:["preferences"]}),ev=(0,D.registerStore)(fp,{...Zy,persist:["preferences"]});function tv(...e){const{clientId:t=null}=Ih();return(0,zt.A)(n=>Gh(n(Qy)).getBlockSettings(t,...e),[t,...e])}function nv(e,t,n){const{supportedStyles:i,supports:r}=(0,zt.A)(e=>({supportedStyles:Gh(e(Zi)).getSupportedStyles(t,n),supports:e(Zi).getBlockType(t)?.supports}),[t,n]);return(0,T.useMemo)(()=>{const t={...e};return i.includes("fontSize")||(t.typography={...t.typography,fontSizes:{},customFontSize:!1,defaultFontSizes:!1}),i.includes("fontFamily")||(t.typography={...t.typography,fontFamilies:{}}),t.color={...t.color,text:t.color?.text&&i.includes("color"),background:t.color?.background&&(i.includes("background")||i.includes("backgroundColor")),button:t.color?.button&&i.includes("buttonColor"),heading:t.color?.heading&&i.includes("headingColor"),link:t.color?.link&&i.includes("linkColor"),caption:t.color?.caption&&i.includes("captionColor")},i.includes("background")||i.includes("backgroundGradient")||(t.color.gradients=[],t.color.customGradient=!1),i.includes("filter")||(t.color.defaultDuotone=!1,t.color.customDuotone=!1),["lineHeight","fontStyle","fontWeight","letterSpacing","textAlign","textTransform","textDecoration","textIndent","writingMode"].forEach(e=>{i.includes(e)||(t.typography={...t.typography,[e]:!1})}),i.includes("textIndent")&&(t.typography={...t.typography,textIndent:t.typography?.textIndent??"subsequent"}),i.includes("columnCount")||(t.typography={...t.typography,textColumns:!1}),["contentSize","wideSize"].forEach(e=>{i.includes(e)||(t.layout={...t.layout,[e]:!1})}),["padding","margin","blockGap"].forEach(e=>{i.includes(e)||(t.spacing={...t.spacing,[e]:!1});const n=Array.isArray(r?.spacing?.[e])?r?.spacing?.[e]:r?.spacing?.[e]?.sides;n?.length&&t.spacing?.[e]&&(t.spacing={...t.spacing,[e]:{...t.spacing?.[e],sides:n}})}),["aspectRatio","height","minHeight","width"].forEach(e=>{i.includes(e)||(t.dimensions={...t.dimensions,[e]:!1})}),["radius","color","style","width"].forEach(e=>{i.includes("border"+e.charAt(0).toUpperCase()+e.slice(1))||(t.border={...t.border,[e]:!1})}),[["backgroundImage","backgroundImage"],["backgroundSize","backgroundSize"],["backgroundGradient","gradient"]].forEach(([e,n])=>{i.includes(e)||(t.background={...t.background,[n]:!1})}),t.shadow=!!i.includes("shadow")&&t.shadow,t},[e,i,r])}function iv(e){const t=e?.color?.palette?.custom,n=e?.color?.palette?.theme,i=e?.color?.palette?.default,r=e?.color?.defaultPalette;return(0,T.useMemo)(()=>{const e=[];return n&&n.length&&e.push({name:(0,ee._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&i&&i.length&&e.push({name:(0,ee._x)("Default","Indicates this palette comes from WordPress."),colors:i}),t&&t.length&&e.push({name:(0,ee._x)("Custom","Indicates this palette is created by the user."),colors:t}),e},[t,n,i,r])}function rv(e){const t=e?.color?.gradients?.custom,n=e?.color?.gradients?.theme,i=e?.color?.gradients?.default,r=e?.color?.defaultGradients;return(0,T.useMemo)(()=>{const e=[];return n&&n.length&&e.push({name:(0,ee._x)("Theme","Indicates this palette comes from the theme."),gradients:n}),r&&i&&i.length&&e.push({name:(0,ee._x)("Default","Indicates this palette comes from WordPress."),gradients:i}),t&&t.length&&e.push({name:(0,ee._x)("Custom","Indicates this palette is created by the user."),gradients:t}),e},[t,n,i,r])}Gh(ev).registerPrivateActions(d),Gh(ev).registerPrivateSelectors(c),Gh(Qy).registerPrivateActions(d),Gh(Qy).registerPrivateSelectors(c);var ov=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=Object.entries(e).map(([e,t])=>[e,ov(t)]).filter(([,e])=>void 0!==e);return t.length?Object.fromEntries(t):void 0};function sv(e,t,n,i,r,o){if(Object.values(e??{}).every(e=>!e))return n;if(1===o.length&&n.innerBlocks.length===i.length)return n;let s=i[0]?.attributes;if(o.length>1&&i.length>1){if(!i[r])return n;s=i[r]?.attributes}let a=n;return Object.entries(e).forEach(([e,n])=>{n&&t[e].forEach(e=>{const t=xp(s,e);t&&(a={...a,attributes:_p(a.attributes,e,t)})})}),a}function av(e,t,n){const i=vn(e,t),r=i?.__experimentalSkipSerialization;return Array.isArray(r)?r.includes(n):r}var lv=new WeakMap;function cv({id:e,css:t}){return uv({id:e,css:t})}function uv({id:e,css:t,assets:n,__unstableType:i,variation:r,clientId:o}={}){const{setStyleOverride:s,deleteStyleOverride:a}=Gh((0,Vt.A)(Qy)),l=(0,yt.A)(),c=(0,T.useId)();(0,T.useEffect)(()=>{if(!t&&!n)return;const u=e||c,d={id:e,css:t,assets:n,__unstableType:i,variation:r,clientId:o};return lv.get(l)||lv.set(l,[]),lv.get(l).push([u,d]),window.queueMicrotask(()=>{lv.get(l)?.length&&l.batch(()=>{lv.get(l).forEach(e=>{s(...e)}),lv.set(l,[])})}),()=>{const e=lv.get(l)?.find(([e])=>e===u);e?lv.set(l,lv.get(l).filter(([e])=>e!==u)):a(u)}},[e,t,o,n,i,c,s,a,l,r])}function dv(e,t){const[n,i,r,o,s,a,l,c,u,d,h,p,f,m,g,b,y,v,_,x,k,w,C,S,A,I,E,j,B,N,R,O,L,M,P,D,F,z,V,U,$,H,W,G,q,K,Y,J,X,Z,Q,ee,te,ne,ie,re,oe,se,ae,le,ce,ue]=tv("background.backgroundImage","background.backgroundSize","background.gradient","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.textIndent","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.height","dimensions.minHeight","dimensions.width","dimensions.dimensionSizes","layout","border.color","border.radius","border.style","border.width","border.radiusSizes","color.custom","color.palette.custom","color.customDuotone","color.palette.theme","color.palette.default","color.defaultPalette","color.defaultDuotone","color.duotone.custom","color.duotone.theme","color.duotone.default","color.gradients.custom","color.gradients.theme","color.gradients.default","color.defaultGradients","color.customGradient","color.background","color.link","color.text","color.heading","color.button","shadow");return nv((0,T.useMemo)(()=>({background:{backgroundImage:n,backgroundSize:i,gradient:r},color:{palette:{custom:W,theme:q,default:K},gradients:{custom:ee,theme:te,default:ne},duotone:{custom:X,theme:Z,default:Q},defaultGradients:ie,defaultPalette:Y,defaultDuotone:J,custom:H,customGradient:re,customDuotone:G,background:oe,link:se,heading:le,button:ce,text:ae},typography:{fontFamilies:{custom:o,default:s,theme:a},fontSizes:{custom:c,default:u,theme:d},customFontSize:h,defaultFontSizes:l,fontStyle:p,fontWeight:f,lineHeight:m,textAlign:g,textColumns:b,textDecoration:y,textIndent:v,textTransform:x,letterSpacing:k,writingMode:_},spacing:{spacingSizes:{custom:E,default:j,theme:B},customSpacingSize:I,defaultSpacingSizes:A,padding:w,margin:C,blockGap:S,units:N},border:{color:F,radius:z,style:V,width:U,radiusSizes:$},dimensions:{aspectRatio:R,height:O,minHeight:L,width:M,dimensionSizes:P},layout:D,parentLayout:t,shadow:ue}),[n,i,r,o,s,a,l,c,u,d,h,p,f,m,g,b,y,v,x,k,_,w,C,S,A,I,E,j,B,N,R,O,L,M,P,D,t,F,z,V,U,$,H,W,G,q,K,Y,J,X,Z,Q,ee,te,ne,ie,re,oe,se,ae,le,ce,ue]),e)}var hv=(0,T.memo)(function({index:e,useBlockProps:t,setAllWrapperProps:n,...i}){const r=t(i),o=t=>n(n=>{const i=[...n];return i[e]=t,i});return(0,T.useEffect)(()=>(o(r),()=>{o(void 0)})),null});function pv(e){e.hasAttribute("crossorigin")||e.setAttribute("crossorigin","anonymous")}if((0,Ei.U2)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",function(e){const{apiVersion:t=1}=e;return t<2&&_n(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}),window.crossOriginIsolated){let e=function(){document.body?t.observe(document.body,{childList:!0,attributes:!0,subtree:!0}):"loading"===document.readyState&&document.addEventListener("DOMContentLoaded",()=>{document.body&&t.observe(document.body,{childList:!0,attributes:!0,subtree:!0})})};const t=new window.MutationObserver(e=>{e.forEach(e=>{[e.addedNodes,e.target].forEach(e=>{(e instanceof window.NodeList?e:[e]).forEach(e=>{const t=e;t.querySelectorAll&&(t.querySelectorAll("source,script,video,link").forEach(e=>{pv(e)}),["SOURCE","SCRIPT","VIDEO","LINK"].includes(t.nodeName)&&pv(t))})})})});e()}var fv=n(69611),mv=n(60728),gv=n(7020),bv=({children:e,className:t})=>(0,Er.jsx)("div",{className:t,children:e}),yv=(0,T.forwardRef)(function(e,t){const{children:n,className:i,containerClassName:r,extraProps:o,isActive:s,title:a,...l}=function({isDisabled:e,...t}){return{disabled:e,...t}}(e);return(0,T.useContext)(gv.A)?(0,Er.jsx)(mv.A,{className:(0,mh.A)("components-toolbar-button",i),...o,...l,ref:t,children:e=>(0,Er.jsx)(fv.Ay,{size:"compact",label:a,isPressed:s,...e,children:n})}):(0,Er.jsx)(bv,{className:r,children:(0,Er.jsx)(fv.Ay,{ref:t,icon:l.icon,size:"compact",label:a,shortcut:l.shortcut,"data-subscript":l.subscript,onClick:e=>{e.stopPropagation(),l.onClick&&l.onClick(e)},className:(0,mh.A)("components-toolbar__control",i),isPressed:s,accessibleWhenDisabled:!0,"data-toolbar-item":!0,...o,...l,children:n})})});yv.displayName="ToolbarButton";var vv=yv,_v=({className:e,children:t,...n})=>(0,Er.jsx)("div",{className:e,...n,children:t}),xv=n(90194),kv=function({controls:e=[],toggleProps:t,...n}){const i=t=>(0,Er.jsx)(xv.A,{controls:e,toggleProps:{...t,"data-toolbar-item":!0},...n});return(0,T.useContext)(gv.A)?(0,Er.jsx)(mv.A,{...t,children:i}):i(t)},wv=function({controls:e=[],children:t,className:n,isCollapsed:i,title:r,...o}){const s=(0,T.useContext)(gv.A);if(!(e&&e.length||t))return null;const a=(0,mh.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],i?(0,Er.jsx)(kv,{label:r,controls:l,className:a,children:t,...o}):(0,Er.jsxs)(_v,{className:a,...o,children:[l?.flatMap((e,t)=>e.map((e,n)=>(0,Er.jsx)(vv,{containerClassName:t>0&&0===n?"has-left-divider":void 0,...e},[t,n].join()))),t]})},Cv=n(97800),Sv=n(91923),Av={default:(0,Sv.QJ)("BlockControls"),block:(0,Sv.QJ)("BlockControlsBlock"),inline:(0,Sv.QJ)("BlockFormatControls"),other:(0,Sv.QJ)("BlockControlsOther"),parent:(0,Sv.QJ)("BlockControlsParent")};function Iv({group:e="default",controls:t,children:n,__experimentalShareWithChildBlocks:i=!1}){const r=function(e,t){const n=Ih();return n[bh]?Av[e]?.Fill:n[yh]&&t?Av.parent.Fill:null}(e,i);if(!r)return null;const o=(0,Er.jsxs)(Er.Fragment,{children:["default"===e&&(0,Er.jsx)(wv,{controls:t}),n]});return(0,Er.jsx)(Cv.A,{document,children:(0,Er.jsx)(r,{children:e=>{const{forwardedContext:t=[]}=e;return t.reduce((e,[t,n])=>(0,Er.jsx)(t,{...n,children:e}),o)}})})}var Ev=n(50744),jv=n(18204);function Tv(e){return e?.length}function Bv(e){const t=function(e,t,n){const i=(0,T.useMemo)(()=>n=>e.subscribe(t,n),[e,t]),r=()=>n(e.get(t));return(0,T.useSyncExternalStore)(i,r,r)}((0,T.useContext)(jv.A).fills,e,Tv);return(0,T.useMemo)(()=>void 0!==t?Array.from({length:t}):void 0,[t])}var{ComponentsContext:Nv}=Gh(Ev.j);function Rv({group:e="default",...t}){const n=(0,T.useContext)(gv.A),i=(0,T.useContext)(Nv),r=(0,T.useMemo)(()=>({forwardedContext:[[gv.A.Provider,{value:n}],[Nv.Provider,{value:i}]]}),[n,i]),o=Av[e],s=Bv(o.name);if(!o)return(0,sn.A)(`Unknown BlockControls group "${e}" provided.`),null;if(!s?.length)return null;const{Slot:a}=o,l=(0,Er.jsx)(a,{...t,bubblesVirtually:!0,fillProps:r});return"default"===e?l:(0,Er.jsx)(wv,{children:l})}var Ov=Iv;Ov.Slot=Rv;var Lv=e=>(0,Er.jsx)(Iv,{group:"inline",...e});Lv.Slot=function(e){return(0,Er.jsx)(Rv,{group:"inline",...e})};var Mv=Ov,Pv=(0,T.forwardRef)(function(e,t){return(0,T.useContext)(gv.A)?(0,Er.jsx)(mv.A,{ref:t,...e.toggleProps,children:t=>(0,Er.jsx)(xv.A,{...e,popoverProps:{...e.popoverProps},toggleProps:t})}):(0,Er.jsx)(xv.A,{...e})});Pv.displayName="ToolbarDropdownMenu";var Dv=Pv,Fv=n(81692),zv=n(95776),Vv=n(67471),Uv=n(11447),$v=n(11866),Hv=n(65541),Wv=n(31311),Gv=n(75013),qv=n(47853),Kv=n(37059),Yv=n(64929),Jv=n(80577),Xv=n(82557),Zv=n(46683),Qv={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 e_(e,t=""){return e.split(",").map(e=>`${e}${t?` ${t}`:""}`).join(",")}function t_(e,t=Qv,n,i){let r="";return t?.[n]?.spacingStyles?.length&&i&&t[n].spacingStyles.forEach(t=>{r+=`${e_(e,t.selector.trim())} { `,r+=Object.entries(t.rules).map(([e,t])=>`${e}: ${t||i}`).join("; "),r+="; }"}),r}function n_(e){const{contentSize:t,wideSize:n,type:i="default"}=e,r={},o=/^(?!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 o.test(t)&&"constrained"===i&&(r.none=(0,ee.sprintf)((0,ee.__)("Max %s wide"),t)),o.test(n)&&(r.wide=(0,ee.sprintf)((0,ee.__)("Max %s wide"),n)),r}var i_=n(3713),r_=n(35656),o_=n(27346),s_=n(16645),a_=n(87090),l_=n(28473),c_=n(28199),u_=["top","bottom","left","right"],d_={top:void 0,right:void 0,bottom:void 0,left:void 0},h_={custom:i_.A,axial:i_.A,horizontal:r_.A,vertical:o_.A,top:s_.A,right:a_.A,bottom:l_.A,left:c_.A},p_={default:(0,ee.__)("Spacing control"),top:(0,ee.__)("Top"),bottom:(0,ee.__)("Bottom"),left:(0,ee.__)("Left"),right:(0,ee.__)("Right"),mixed:(0,ee.__)("Mixed"),vertical:(0,ee.__)("Vertical"),horizontal:(0,ee.__)("Horizontal"),axial:(0,ee.__)("Horizontal & vertical"),custom:(0,ee.__)("Custom")},f_="axial",m_="custom";function g_(e,t){if(!e||function(e){return!!e?.includes&&("0"===e||e.includes("var:preset|spacing|"))}(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 b_(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function y_(e,t){if(!e||!e.length)return!1;const n=e.includes("horizontal")||e.includes("left")&&e.includes("right"),i=e.includes("vertical")||e.includes("top")&&e.includes("bottom");return"horizontal"===t?n:"vertical"===t?i:n||i}function v_(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 i=b_(n?.top)||t,r=b_(n?.left)||t;return i===r?i:`${i} ${r}`}var __=n(27837),x_=n(86350),k_=n(4353),w_=n(21670),C_=n(73636),S_={top:{icon:__.A,title:(0,ee._x)("Align top","Block vertical alignment setting")},center:{icon:x_.A,title:(0,ee._x)("Align middle","Block vertical alignment setting")},bottom:{icon:k_.A,title:(0,ee._x)("Align bottom","Block vertical alignment setting")},stretch:{icon:w_.A,title:(0,ee._x)("Stretch to fill","Block vertical alignment setting")},"space-between":{icon:C_.A,title:(0,ee._x)("Space between","Block vertical alignment setting")}},A_=["top","center","bottom"],I_=function({value:e,onChange:t,controls:n=A_,isCollapsed:i=!0,isToolbar:r}){const o=S_[e],s=S_.top,a=r?wv:Dv,l=r?{isCollapsed:i}:{};return(0,Er.jsx)(a,{icon:o?o.icon:s.icon,label:(0,ee._x)("Change vertical alignment","Block vertical alignment setting label"),controls:n.map(n=>{return{...S_[n],isActive:e===n,role:i?"menuitemradio":void 0,onClick:(r=n,()=>t(e===r?void 0:r))};var r}),...l})},E_=e=>(0,Er.jsx)(I_,{...e,isToolbar:!1}),j_=e=>(0,Er.jsx)(I_,{...e,isToolbar:!0}),T_={left:Vv.A,center:Uv.A,right:$v.A,"space-between":Hv.A,stretch:Wv.A},B_=function({allowedControls:e=["left","center","right","space-between"],isCollapsed:t=!0,onChange:n,value:i,popoverProps:r,isToolbar:o}){const s=e=>{n(e===i?void 0:e)},a=i?T_[i]:T_.left,l=[{name:"left",icon:Vv.A,title:(0,ee.__)("Justify items left"),isActive:"left"===i,onClick:()=>s("left")},{name:"center",icon:Uv.A,title:(0,ee.__)("Justify items center"),isActive:"center"===i,onClick:()=>s("center")},{name:"right",icon:$v.A,title:(0,ee.__)("Justify items right"),isActive:"right"===i,onClick:()=>s("right")},{name:"space-between",icon:Hv.A,title:(0,ee.__)("Space between items"),isActive:"space-between"===i,onClick:()=>s("space-between")},{name:"stretch",icon:Wv.A,title:(0,ee.__)("Stretch items"),isActive:"stretch"===i,onClick:()=>s("stretch")}],c=o?wv:Dv,u=o?{isCollapsed:t}:{};return(0,Er.jsx)(c,{icon:a,popoverProps:r,label:(0,ee.__)("Change items justification"),controls:l.filter(t=>e.includes(t.name)),...u})},N_=e=>(0,Er.jsx)(B_,{...e,isToolbar:!1}),R_={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},O_={left:"flex-start",right:"flex-end",center:"center",stretch:"stretch"},L_={top:"flex-start",center:"center",bottom:"flex-end",stretch:"stretch","space-between":"space-between"},M_=["wrap","nowrap"],P_={name:"flex",label:(0,ee.__)("Flex"),inspectorControls:function({layout:e={},onChange:t,layoutBlockSupport:n={}}){const{allowOrientation:i=!0,allowJustification:r=!0,allowWrap:o=!0}=n;return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsxs)(Kv.A,{children:[r&&(0,Er.jsx)(Yv.A,{children:(0,Er.jsx)(z_,{layout:e,onChange:t})}),i&&(0,Er.jsx)(Yv.A,{children:(0,Er.jsx)(U_,{layout:e,onChange:t})})]}),o&&(0,Er.jsx)(V_,{layout:e,onChange:t})]})},toolBarControls:function({layout:e={},onChange:t,layoutBlockSupport:n}){const{allowVerticalAlignment:i=!0,allowJustification:r=!0}=n;return r||i?(0,Er.jsxs)(Mv,{group:"block",__experimentalShareWithChildBlocks:!0,children:[r&&(0,Er.jsx)(z_,{layout:e,onChange:t,isToolbar:!0}),i&&(0,Er.jsx)(D_,{layout:e,onChange:t})]}):null},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:i,hasBlockGapSupport:r,globalBlockGapValue:o,layoutDefinitions:s=Qv}){const{orientation:a="horizontal"}=t;let l="0.5em";if(o){const e=v_(o,"0.5em").split(" ");l=e.length>1?e[1]:e[0]}const c=n?.spacing?.blockGap&&!av(i,"spacing","blockGap")?v_(n?.spacing?.blockGap,l):void 0,u=R_[t.justifyContent],d=M_.includes(t.flexWrap)?t.flexWrap:"wrap",h=L_[t.verticalAlignment],p=O_[t.justifyContent]||O_.left;let f="";const m=[];return d&&"wrap"!==d&&m.push(`flex-wrap: ${d}`),"horizontal"===a?(h&&m.push(`align-items: ${h}`),u&&m.push(`justify-content: ${u}`)):(h&&m.push(`justify-content: ${h}`),m.push("flex-direction: column"),m.push(`align-items: ${p}`)),m.length&&(f=`${e_(e)} {\n\t\t\t\t${m.join("; ")};\n\t\t\t}`),r&&c&&(f+=t_(e,s,"flex",c)),f},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function D_({layout:e,onChange:t}){const{orientation:n="horizontal"}=e,i="horizontal"===n?"center":"top",{verticalAlignment:r=i}=e;return(0,Er.jsx)(E_,{onChange:n=>{t({...e,verticalAlignment:n})},value:r,controls:"horizontal"===n?["top","center","bottom","stretch"]:["top","center","bottom","space-between"]})}var F_={placement:"bottom-start"};function z_({layout:e,onChange:t,isToolbar:n=!1}){const{justifyContent:i="left",orientation:r="horizontal"}=e,o=n=>{t({...e,justifyContent:n})},s=["left","center","right"];if("horizontal"===r?s.push("space-between"):s.push("stretch"),n)return(0,Er.jsx)(N_,{allowedControls:s,value:i,onChange:o,popoverProps:F_});const a=[{value:"left",icon:Vv.A,label:(0,ee.__)("Justify items left")},{value:"center",icon:Uv.A,label:(0,ee.__)("Justify items center")},{value:"right",icon:$v.A,label:(0,ee.__)("Justify items right")}];return"horizontal"===r?a.push({value:"space-between",icon:Hv.A,label:(0,ee.__)("Space between items")}):a.push({value:"stretch",icon:Wv.A,label:(0,ee.__)("Stretch items")}),(0,Er.jsx)(Jv.A,{__next40pxDefaultSize:!0,label:(0,ee.__)("Justification"),value:i,onChange:o,className:"block-editor-hooks__flex-layout-justification-controls",children:a.map(({value:e,icon:t,label:n})=>(0,Er.jsx)(Xv.A,{value:e,icon:t,label:n},e))})}function V_({layout:e,onChange:t}){const{flexWrap:n="wrap"}=e;return(0,Er.jsx)(Zv.A,{label:(0,ee.__)("Allow to wrap to multiple lines"),onChange:n=>{t({...e,flexWrap:n?"wrap":"nowrap"})},checked:"wrap"===n})}function U_({layout:e,onChange:t}){const{orientation:n="horizontal",verticalAlignment:i,justifyContent:r}=e;return(0,Er.jsxs)(Jv.A,{__next40pxDefaultSize:!0,className:"block-editor-hooks__flex-layout-orientation-controls",label:(0,ee.__)("Orientation"),value:n,onChange:n=>{let o=i,s=r;return"horizontal"===n?("space-between"===i&&(o="center"),"stretch"===r&&(s="left")):("stretch"===i&&(o="top"),"space-between"===r&&(s="left")),t({...e,orientation:n,verticalAlignment:o,justifyContent:s})},children:[(0,Er.jsx)(Xv.A,{icon:Gv.A,value:"horizontal",label:(0,ee.__)("Horizontal")}),(0,Er.jsx)(Xv.A,{icon:qv.A,value:"vertical",label:(0,ee.__)("Vertical")})]})}var $_={name:"default",label:(0,ee.__)("Flow"),inspectorControls:function(){return null},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,style:t,blockName:n,hasBlockGapSupport:i,layoutDefinitions:r=Qv}){const o=v_(t?.spacing?.blockGap);let s="";av(n,"spacing","blockGap")||(o?.top?s=v_(o?.top):"string"==typeof o&&(s=v_(o)));let a="";return i&&s&&(a+=t_(e,r,"default",s)),a},getOrientation:()=>"vertical",getAlignments(e,t){const n=n_(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 i=[{name:"left"},{name:"center"},{name:"right"}];if(!t){const{contentSize:t,wideSize:r}=e;t&&i.unshift({name:"full"}),r&&i.unshift({name:"wide",info:n.wide})}return i.unshift({name:"none",info:n.none}),i}},H_="web"===Uo.A.OS,W_={px:{value:"px",label:H_?"px":(0,ee.__)("Pixels (px)"),a11yLabel:(0,ee.__)("Pixels (px)"),step:1},"%":{value:"%",label:H_?"%":(0,ee.__)("Percentage (%)"),a11yLabel:(0,ee.__)("Percent (%)"),step:.1},em:{value:"em",label:H_?"em":(0,ee.__)("Relative to parent font size (em)"),a11yLabel:(0,ee._x)("ems","Relative to parent font size (em)"),step:.01},rem:{value:"rem",label:H_?"rem":(0,ee.__)("Relative to root font size (rem)"),a11yLabel:(0,ee._x)("rems","Relative to root font size (rem)"),step:.01},vw:{value:"vw",label:H_?"vw":(0,ee.__)("Viewport width (vw)"),a11yLabel:(0,ee.__)("Viewport width (vw)"),step:.1},vh:{value:"vh",label:H_?"vh":(0,ee.__)("Viewport height (vh)"),a11yLabel:(0,ee.__)("Viewport height (vh)"),step:.1},vmin:{value:"vmin",label:H_?"vmin":(0,ee.__)("Viewport smallest dimension (vmin)"),a11yLabel:(0,ee.__)("Viewport smallest dimension (vmin)"),step:.1},vmax:{value:"vmax",label:H_?"vmax":(0,ee.__)("Viewport largest dimension (vmax)"),a11yLabel:(0,ee.__)("Viewport largest dimension (vmax)"),step:.1},ch:{value:"ch",label:H_?"ch":(0,ee.__)("Width of the zero (0) character (ch)"),a11yLabel:(0,ee.__)("Width of the zero (0) character (ch)"),step:.01},ex:{value:"ex",label:H_?"ex":(0,ee.__)("x-height of the font (ex)"),a11yLabel:(0,ee.__)("x-height of the font (ex)"),step:.01},cm:{value:"cm",label:H_?"cm":(0,ee.__)("Centimeters (cm)"),a11yLabel:(0,ee.__)("Centimeters (cm)"),step:.001},mm:{value:"mm",label:H_?"mm":(0,ee.__)("Millimeters (mm)"),a11yLabel:(0,ee.__)("Millimeters (mm)"),step:.1},in:{value:"in",label:H_?"in":(0,ee.__)("Inches (in)"),a11yLabel:(0,ee.__)("Inches (in)"),step:.001},pc:{value:"pc",label:H_?"pc":(0,ee.__)("Picas (pc)"),a11yLabel:(0,ee.__)("Picas (pc)"),step:1},pt:{value:"pt",label:H_?"pt":(0,ee.__)("Points (pt)"),a11yLabel:(0,ee.__)("Points (pt)"),step:1},svw:{value:"svw",label:H_?"svw":(0,ee.__)("Small viewport width (svw)"),a11yLabel:(0,ee.__)("Small viewport width (svw)"),step:.1},svh:{value:"svh",label:H_?"svh":(0,ee.__)("Small viewport height (svh)"),a11yLabel:(0,ee.__)("Small viewport height (svh)"),step:.1},svi:{value:"svi",label:H_?"svi":(0,ee.__)("Viewport smallest size in the inline direction (svi)"),a11yLabel:(0,ee.__)("Small viewport width or height (svi)"),step:.1},svb:{value:"svb",label:H_?"svb":(0,ee.__)("Viewport smallest size in the block direction (svb)"),a11yLabel:(0,ee.__)("Small viewport width or height (svb)"),step:.1},svmin:{value:"svmin",label:H_?"svmin":(0,ee.__)("Small viewport smallest dimension (svmin)"),a11yLabel:(0,ee.__)("Small viewport smallest dimension (svmin)"),step:.1},lvw:{value:"lvw",label:H_?"lvw":(0,ee.__)("Large viewport width (lvw)"),a11yLabel:(0,ee.__)("Large viewport width (lvw)"),step:.1},lvh:{value:"lvh",label:H_?"lvh":(0,ee.__)("Large viewport height (lvh)"),a11yLabel:(0,ee.__)("Large viewport height (lvh)"),step:.1},lvi:{value:"lvi",label:H_?"lvi":(0,ee.__)("Large viewport width or height (lvi)"),a11yLabel:(0,ee.__)("Large viewport width or height (lvi)"),step:.1},lvb:{value:"lvb",label:H_?"lvb":(0,ee.__)("Large viewport width or height (lvb)"),a11yLabel:(0,ee.__)("Large viewport width or height (lvb)"),step:.1},lvmin:{value:"lvmin",label:H_?"lvmin":(0,ee.__)("Large viewport smallest dimension (lvmin)"),a11yLabel:(0,ee.__)("Large viewport smallest dimension (lvmin)"),step:.1},dvw:{value:"dvw",label:H_?"dvw":(0,ee.__)("Dynamic viewport width (dvw)"),a11yLabel:(0,ee.__)("Dynamic viewport width (dvw)"),step:.1},dvh:{value:"dvh",label:H_?"dvh":(0,ee.__)("Dynamic viewport height (dvh)"),a11yLabel:(0,ee.__)("Dynamic viewport height (dvh)"),step:.1},dvi:{value:"dvi",label:H_?"dvi":(0,ee.__)("Dynamic viewport width or height (dvi)"),a11yLabel:(0,ee.__)("Dynamic viewport width or height (dvi)"),step:.1},dvb:{value:"dvb",label:H_?"dvb":(0,ee.__)("Dynamic viewport width or height (dvb)"),a11yLabel:(0,ee.__)("Dynamic viewport width or height (dvb)"),step:.1},dvmin:{value:"dvmin",label:H_?"dvmin":(0,ee.__)("Dynamic viewport smallest dimension (dvmin)"),a11yLabel:(0,ee.__)("Dynamic viewport smallest dimension (dvmin)"),step:.1},dvmax:{value:"dvmax",label:H_?"dvmax":(0,ee.__)("Dynamic viewport largest dimension (dvmax)"),a11yLabel:(0,ee.__)("Dynamic viewport largest dimension (dvmax)"),step:.1},svmax:{value:"svmax",label:H_?"svmax":(0,ee.__)("Small viewport largest dimension (svmax)"),a11yLabel:(0,ee.__)("Small viewport largest dimension (svmax)"),step:.1},lvmax:{value:"lvmax",label:H_?"lvmax":(0,ee.__)("Large viewport largest dimension (lvmax)"),a11yLabel:(0,ee.__)("Large viewport largest dimension (lvmax)"),step:.1}},G_=Object.values(W_),q_=[W_.px,W_["%"],W_.em,W_.rem,W_.vw,W_.vh],K_=W_.px;function Y_(e,t,n){return X_(t?`${e??""}${t}`:e,n)}function J_(e){return Array.isArray(e)&&!!e.length}function X_(e,t=G_){let n,i;if(void 0!==e||null===e){n=`${e}`.trim();const t=parseFloat(n);i=isFinite(t)?t:void 0}const r=n?.match(/[\d.\-\+]*\s*(.*)/),o=r?.[1]?.toLowerCase();let s;if(J_(t)){const e=t.find(e=>e.value===o);s=e?.value}else s=K_.value;return[i,s]}var Z_=({units:e=G_,availableUnits:t=[],defaultValues:n})=>{const i=function(e=[],t){return Array.isArray(t)?t.filter(t=>e.includes(t.value)):[]}(t,e);return n?i.map(e=>{const[t]=n[e.value]?X_(n[e.value]):[];return{...e,default:t}}):i},Q_=n(54312),ex=n(41910),tx=n(17892),nx=n(84899),ix=n(59482),rx=n(82913),ox=n(87280),sx=n(85125),ax=n(3350),lx=(0,ex.A)(ox.A,{target:"e1bagdl32"})("&&&{input{display:block;width:100%;}",sx.Hr,"{transition:box-shadow 0.1s linear;}}"),cx=({selectSize:e})=>({small:(0,tx.AH)("box-sizing:border-box;padding:2px 1px;width:20px;font-size:8px;line-height:1;letter-spacing:-0.5px;text-transform:uppercase;text-align-last:center;&:not( :disabled ){color:",nx.l.gray[800],";}",""),default:(0,tx.AH)("box-sizing:border-box;min-width:24px;max-width:48px;height:24px;margin-inline-end:",(0,ax.x)(2),";padding:",(0,ax.x)(1),";font-size:13px;line-height:1;text-align-last:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;field-sizing:content;&:not( :disabled ){color:",nx.l.theme.accent,";}","")}[e]),ux=(0,ex.A)("div",{target:"e1bagdl31"})("&&&{pointer-events:none;",cx,";color:",nx.l.gray[900],";}"),dx=({selectSize:e="default"})=>({small:(0,tx.AH)("height:100%;border:1px solid transparent;transition:box-shadow 0.1s linear,border 0.1s linear;",(0,ix.h)({borderTopLeftRadius:0,borderBottomLeftRadius:0})()," &:not(:disabled):hover{background-color:",nx.l.gray[100],";}&:focus{border:1px solid ",nx.l.ui.borderFocus,";box-shadow:inset 0 0 0 ",rx.A.borderWidth+" "+nx.l.ui.borderFocus,";outline-offset:0;outline:2px solid transparent;z-index:1;}",""),default:(0,tx.AH)("display:flex;justify-content:center;align-items:center;&:where( :not( :disabled ) ):hover{box-shadow:0 0 0 ",rx.A.borderWidth+" "+nx.l.ui.borderFocus,";outline:",rx.A.borderWidth," solid transparent;}&:focus{box-shadow:0 0 0 ",rx.A.borderWidthFocus+" "+nx.l.ui.borderFocus,";outline:",rx.A.borderWidthFocus," solid transparent;}","")}[e]),hx=(0,ex.A)("select",{target:"e1bagdl30"})("&&&{appearance:none;background:transparent;border-radius:",rx.A.radiusXSmall,";border:none;display:block;outline:none;margin:0;min-height:auto;font-family:inherit;",cx,";",dx,";&:not( :disabled ){cursor:pointer;}}"),px=(0,T.forwardRef)(function({className:e,isUnitSelectTabbable:t=!0,onChange:n,size:i="default",unit:r="px",units:o=q_,...s},a){if(!J_(o)||1===o?.length)return(0,Er.jsx)(ux,{className:"components-unit-control__unit-label",selectSize:i,children:r});const l=(0,mh.A)("components-unit-control__select",e);return(0,Er.jsx)(hx,{ref:a,className:l,onChange:e=>{const{value:t}=e.target,i=o.find(e=>e.value===t);n?.(t,{event:e,data:i})},selectSize:i,tabIndex:t?void 0:-1,value:r,...s,children:o.map(e=>(0,Er.jsx)("option",{value:e.value,children:e.label},e.value))})}),fx=n(70623),mx=n(70362),gx=n(92916),bx=n(21351),yx=(0,T.forwardRef)(function(e,t){const{__unstableStateReducer:n,autoComplete:i="off",children:r,className:o,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=q_,value:b,onFocus:y,__shouldNotWarnDeprecated36pxSize:v,..._}=(0,gx.R)(e);(0,bx.M)({componentName:"UnitControl",__next40pxDefaultSize:_.__next40pxDefaultSize,size:f,__shouldNotWarnDeprecated36pxSize:v}),"unit"in e&&(0,Qt.A)("UnitControl unit prop",{since:"5.6",hint:"The unit should be provided within the `value` prop.",version:"6.2"});const x=b??void 0,[k,w]=(0,T.useMemo)(()=>{const e=function(e,t,n=G_){const i=Array.isArray(n)?[...n]:[],[,r]=Y_(e,t,G_);return r&&!i.some(e=>e.value===r)&&W_[r]&&i.unshift(W_[r]),i}(x,m,g),[{value:t=""}={},...n]=e,i=n.reduce((e,{value:t})=>{const n=(0,mx.Nt)(t?.substring(0,1)||"");return e.includes(n)?e:`${e}|${n}`},(0,mx.Nt)(t.substring(0,1)));return[e,new RegExp(`^(?:${i})$`,"i")]},[x,m,g]),[C,S]=Y_(x,m,k),[A,I]=(0,fx.A)(1===k.length?k[0].value:m,{initial:S,fallback:""});(0,T.useEffect)(()=>{void 0!==S&&I(S)},[S,I]);const E=(0,mh.A)("components-unit-control","components-unit-control-wrapper",o);let j;!a&&u&&k.length&&(j=e=>{_.onKeyDown?.(e),e.metaKey||e.ctrlKey||!w.test(e.key)||B.current?.focus()});const B=(0,T.useRef)(null),N=a?null:(0,Er.jsx)(px,{ref:B,"aria-label":(0,ee.__)("Select unit"),disabled:s,isUnitSelectTabbable:u,onChange:(e,t)=>{const{data:n}=t;let i=`${C??""}${e}`;c&&void 0!==n?.default&&(i=`${n.default}${e}`),h?.(i,t),p?.(e,t),I(e)},size:["small","compact"].includes(f)||"default"===f&&!_.__next40pxDefaultSize?"small":"default",unit:A,units:k,onFocus:y,onBlur:e.onBlur});let R=_.step;if(!R&&k){const e=k.find(e=>e.value===A);R=e?.step??1}return(0,Er.jsx)(lx,{..._,__shouldNotWarnDeprecated36pxSize:!0,autoComplete:i,className:E,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,i){const[r,o]=X_(e,t),s=r??n;let a=o||i;return!a&&J_(t)&&(a=t[0].value),[s,a]}(e,k,C,A).join("");h?.(n,t)},ref:t,size:f,suffix:N,type:l?"text":"number",value:C??"",step:R,onFocus:y,__unstableStateReducer:n})});yx.displayName="UnitControl";var vx=yx,_x=n(17522),xx=n(75847),kx=n(97395),wx=n(10720),Cx=n(88472),Sx=(e,t)=>{let n=e;return t.forEach(e=>{n=n?.[e]}),n};function Ax(e,t,n,i){const r=Sx(e,n);return r?[{selector:t?.selector,key:i,value:Ex(r)}]:[]}function Ix(e,t,n,i,r=["top","right","bottom","left"]){const o=Sx(e,n);if(!o)return[];const s=[];if("string"==typeof o)s.push({selector:t?.selector,key:i.default,value:Ex(o)});else{const e=r.reduce((e,n)=>{const r=Ex(Sx(o,[n]));return r&&e.push({selector:t?.selector,key:i?.individual.replace("%s",jx(n)),value:r}),e},[]);s.push(...e)}return s}function Ex(e){return"string"==typeof e&&e.startsWith("var:")?`var(--wp--${e.slice(4).split("|").map(e=>(0,Cx.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("--")})`:e}function jx(e){const[t,...n]=e;return t.toUpperCase()+n.join("")}function Tx(e){return(t,n)=>Ax(t,n,e,function(e){const[t,...n]=e;return t.toLowerCase()+n.map(jx).join("")}(e))}function Bx(e){return(t,n)=>["color","style","width"].flatMap(i=>Tx(["border",e,i])(t,n))}var Nx={name:"radius",generate:(e,t)=>Ix(e,t,["border","radius"],{default:"borderRadius",individual:"border%sRadius"},["topLeft","topRight","bottomLeft","bottomRight"])},Rx={name:"background",generate:(e,t)=>Ax(e,t,["color","background"],"backgroundColor")},Ox={name:"gradient",generate:(e,t)=>Ax(e,t,["color","gradient"],"background")},Lx={name:"text",generate:(e,t)=>Ax(e,t,["color","text"],"color")},Mx={name:"height",generate:(e,t)=>Ax(e,t,["dimensions","height"],"height")},Px={name:"minHeight",generate:(e,t)=>Ax(e,t,["dimensions","minHeight"],"minHeight")},Dx={name:"aspectRatio",generate:(e,t)=>Ax(e,t,["dimensions","aspectRatio"],"aspectRatio")},Fx={name:"width",generate:(e,t)=>Ax(e,t,["dimensions","width"],"width")},zx={name:"backgroundImage",generate:(e,t)=>{const n=e?.background?.backgroundImage,i=Ex(e?.background?.gradient)||"";if(!n&&!i)return[];const r=[i,"object"==typeof n&&n?.url?`url( '${encodeURI(function(e){try{return decodeURI(e)}catch{return e}}(n.url))}' )`:Ex(n)].filter(Boolean).join(", ");return r?[{selector:t.selector,key:"backgroundImage",value:r}]:[]}},Vx={name:"backgroundPosition",generate:(e,t)=>Ax(e,t,["background","backgroundPosition"],"backgroundPosition")},Ux={name:"backgroundRepeat",generate:(e,t)=>Ax(e,t,["background","backgroundRepeat"],"backgroundRepeat")},$x={name:"backgroundSize",generate:(e,t)=>Ax(e,t,["background","backgroundSize"],"backgroundSize")},Hx={name:"backgroundAttachment",generate:(e,t)=>Ax(e,t,["background","backgroundAttachment"],"backgroundAttachment")},Wx={name:"shadow",generate:(e,t)=>Ax(e,t,["shadow"],"boxShadow")},Gx={name:"color",generate:(e,t,n=["outline","color"],i="outlineColor")=>Ax(e,t,n,i)},qx={name:"offset",generate:(e,t,n=["outline","offset"],i="outlineOffset")=>Ax(e,t,n,i)},Kx={name:"style",generate:(e,t,n=["outline","style"],i="outlineStyle")=>Ax(e,t,n,i)},Yx={name:"width",generate:(e,t,n=["outline","width"],i="outlineWidth")=>Ax(e,t,n,i)},Jx={name:"padding",generate:(e,t)=>Ix(e,t,["spacing","padding"],{default:"padding",individual:"padding%s"})},Xx={name:"margin",generate:(e,t)=>Ix(e,t,["spacing","margin"],{default:"margin",individual:"margin%s"})},Zx={name:"fontSize",generate:(e,t)=>Ax(e,t,["typography","fontSize"],"fontSize")},Qx={name:"fontStyle",generate:(e,t)=>Ax(e,t,["typography","fontStyle"],"fontStyle")},ek={name:"fontWeight",generate:(e,t)=>Ax(e,t,["typography","fontWeight"],"fontWeight")},tk={name:"fontFamily",generate:(e,t)=>Ax(e,t,["typography","fontFamily"],"fontFamily")},nk={name:"letterSpacing",generate:(e,t)=>Ax(e,t,["typography","letterSpacing"],"letterSpacing")},ik={name:"lineHeight",generate:(e,t)=>Ax(e,t,["typography","lineHeight"],"lineHeight")},rk={name:"textColumns",generate:(e,t)=>Ax(e,t,["typography","textColumns"],"columnCount")},ok={name:"textDecoration",generate:(e,t)=>Ax(e,t,["typography","textDecoration"],"textDecoration")},sk={name:"textIndent",generate:(e,t)=>Ax(e,t,["typography","textIndent"],"textIndent")},ak={name:"textTransform",generate:(e,t)=>Ax(e,t,["typography","textTransform"],"textTransform")},lk={name:"writingMode",generate:(e,t)=>Ax(e,t,["typography","writingMode"],"writingMode")},ck=[{name:"color",generate:Tx(["border","color"])},{name:"style",generate:Tx(["border","style"])},{name:"width",generate:Tx(["border","width"])},Nx,{name:"borderTop",generate:Bx("top")},{name:"borderRight",generate:Bx("right")},{name:"borderBottom",generate:Bx("bottom")},{name:"borderLeft",generate:Bx("left")},Lx,Ox,Rx,Mx,Px,Dx,Fx,Gx,Kx,qx,Yx,Xx,Jx,tk,Zx,Qx,ek,nk,ik,rk,ok,sk,ak,lk,Wx,zx,Vx,Ux,$x,Hx];function uk(e,t={}){const n=dk(e,t);if(!t?.selector){const e=[];return n.forEach(t=>{e.push(`${(0,Cx.c)(t.key)}: ${t.value};`)}),e.join(" ")}const i=n.reduce((e,t)=>{const{selector:n}=t;return n?(e[n]||(e[n]=[]),e[n].push(t),e):e},{});return Object.keys(i).reduce((e,t)=>(e.push(`${t} { ${i[t].map(e=>`${(0,Cx.c)(e.key)}: ${e.value};`).join(" ")} }`),e),[]).join("\n")}function dk(e,t={}){const n=[];return ck.forEach(i=>{"function"==typeof i.generate&&n.push(...i.generate(e,t))}),n}var hk={name:"constrained",label:(0,ee.__)("Constrained"),inspectorControls:function({layout:e,onChange:t,layoutBlockSupport:n={}}){const{wideSize:i,contentSize:r,justifyContent:o="center"}=e,{allowJustification:s=!0,allowCustomContentAndWideSize:a=!0}=n,l=[{value:"left",icon:Vv.A,label:(0,ee.__)("Justify items left")},{value:"center",icon:Uv.A,label:(0,ee.__)("Justify items center")},{value:"right",icon:$v.A,label:(0,ee.__)("Justify items right")}],[c]=tv("spacing.units"),u=Z_({availableUnits:c||["%","px","em","rem","vw"]});return(0,Er.jsxs)(Q_.A,{spacing:4,className:"block-editor-hooks__layout-constrained",children:[a&&(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(vx,{__next40pxDefaultSize:!0,label:(0,ee.__)("Content width"),labelPosition:"top",value:r||i||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,contentSize:""!==n?n:void 0})},units:u,prefix:(0,Er.jsx)(_x.A,{variant:"icon",children:(0,Er.jsx)(xx.A,{icon:kx.A})})}),(0,Er.jsx)(vx,{__next40pxDefaultSize:!0,label:(0,ee.__)("Wide width"),labelPosition:"top",value:i||r||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,wideSize:""!==n?n:void 0})},units:u,prefix:(0,Er.jsx)(_x.A,{variant:"icon",children:(0,Er.jsx)(xx.A,{icon:wx.A})})}),(0,Er.jsx)("p",{className:"block-editor-hooks__layout-constrained-helptext",children:(0,ee.__)("Customize the width for all elements that are assigned to the center or wide columns.")})]}),s&&(0,Er.jsx)(Jv.A,{__next40pxDefaultSize:!0,label:(0,ee.__)("Justification"),value:o,onChange:n=>{t({...e,justifyContent:n})},children:l.map(({value:e,icon:t,label:n})=>(0,Er.jsx)(Xv.A,{value:e,icon:t,label:n},e))})]})},toolBarControls:function({layout:e={},onChange:t,layoutBlockSupport:n}){const{allowJustification:i=!0}=n;return i?(0,Er.jsx)(Mv,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,Er.jsx)(fk,{layout:e,onChange:t})}):null},getLayoutStyle:function({selector:e,layout:t={},style:n,blockName:i,hasBlockGapSupport:r,layoutDefinitions:o=Qv}){const{contentSize:s,wideSize:a,justifyContent:l}=t,c=v_(n?.spacing?.blockGap);let u="";av(i,"spacing","blockGap")||(c?.top?u=v_(c?.top):"string"==typeof c&&(u=v_(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${e_(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} {\n\t\t\t\t\t\tmax-width: ${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${e_(e,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${a??s};\n\t\t\t\t\t}\n\t\t\t\t\t${e_(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+=`${e_(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-left: ${d}; }`:"right"===l&&(p+=`${e_(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-right: ${h}; }`),n?.spacing?.padding&&dk(n).forEach(t=>{if("paddingRight"===t.key){const n="0"===t.value?"0px":t.value;p+=`\n\t\t\t\t\t${e_(e,"> .alignfull")} {\n\t\t\t\t\t\tmargin-right: calc(${n} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`}else if("paddingLeft"===t.key){const n="0"===t.value?"0px":t.value;p+=`\n\t\t\t\t\t${e_(e,"> .alignfull")} {\n\t\t\t\t\t\tmargin-left: calc(${n} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`}}),r&&u&&(p+=t_(e,o,"constrained",u)),p},getOrientation:()=>"vertical",getAlignments(e){const t=n_(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:i}=e,r=[{name:"left"},{name:"center"},{name:"right"}];return n&&r.unshift({name:"full"}),i&&r.unshift({name:"wide",info:t.wide}),r.unshift({name:"none",info:t.none}),r}},pk={placement:"bottom-start"};function fk({layout:e,onChange:t}){const{justifyContent:n="center"}=e;return(0,Er.jsx)(N_,{allowedControls:["left","center","right"],value:n,onChange:n=>{t({...e,justifyContent:n})},popoverProps:pk})}var mk=n(95104),gk=n(36223),bk=n(89137),yk={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},vk=[{value:"px",label:"px",default:0},{value:"rem",label:"rem",default:0},{value:"em",label:"em",default:0}],_k={name:"grid",label:(0,ee.__)("Grid"),inspectorControls:function({layout:e={},onChange:t,layoutBlockSupport:n={}}){const{allowSizingOnChildren:i=!1}=n,r=!e?.isManualPlacement||window.__experimentalEnableGridInteractivity;return(0,Er.jsxs)(Er.Fragment,{children:[window.__experimentalEnableGridInteractivity&&(0,Er.jsx)(wk,{layout:e,onChange:t}),(0,Er.jsxs)(Q_.A,{spacing:4,children:[(0,Er.jsx)(kk,{layout:e,onChange:t,allowSizingOnChildren:i}),r&&(0,Er.jsx)(xk,{layout:e,onChange:t})]})]})},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:i,hasBlockGapSupport:r,globalBlockGapValue:o,layoutDefinitions:s=Qv}){const{minimumColumnWidth:a=null,columnCount:l=null,rowCount:c=null}=t;let u="1.2rem";if(o){const e=v_(o,"0.5em").split(" ");u=e.length>1?e[1]:e[0]}const d=n?.spacing?.blockGap&&!av(i,"spacing","blockGap")?v_(n?.spacing?.blockGap,u):void 0;let h="";const p=[];if(a&&l>0){let e=d||u;"0"!==e&&0!==e||(e="0px");const t=`max(min( ${a}, 100%), ( 100% - (${e}*${l-1}) ) / ${l})`;p.push(`grid-template-columns: repeat(auto-fill, minmax(${t}, 1fr))`,"container-type: inline-size"),c&&p.push(`grid-template-rows: repeat(${c}, minmax(1rem, auto))`)}else l?(p.push(`grid-template-columns: repeat(${l}, minmax(0, 1fr))`),c&&p.push(`grid-template-rows: repeat(${c}, minmax(1rem, auto))`)):p.push(`grid-template-columns: repeat(auto-fill, minmax(min(${a||"12rem"}, 100%), 1fr))`,"container-type: inline-size");return p.length&&(h=`${e_(e)} { ${p.join("; ")}; }`),r&&d&&(h+=t_(e,s,"grid",d)),h},getOrientation:()=>"horizontal",getAlignments:()=>[]};function xk({layout:e,onChange:t}){const{minimumColumnWidth:n,columnCount:i,isManualPlacement:r}=e,o=n||(r||i?null:"12rem"),[s,a="rem"]=X_(o);return(0,Er.jsxs)("fieldset",{className:"block-editor-hooks__grid-layout-minimum-width-control",children:[(0,Er.jsx)(mk.Ay.VisualLabel,{as:"legend",children:(0,ee.__)("Min. column width")}),(0,Er.jsxs)(Kv.A,{gap:4,children:[(0,Er.jsx)(Yv.A,{isBlock:!0,children:(0,Er.jsx)(vx,{size:"__unstable-large",onChange:n=>{t({...e,minimumColumnWidth:""===n?void 0:n})},onUnitChange:n=>{let i;["em","rem"].includes(n)&&"px"===a?i=(s/16).toFixed(2)+n:["em","rem"].includes(a)&&"px"===n&&(i=Math.round(16*s)+n),t({...e,minimumColumnWidth:i})},value:o,units:vk,min:0,label:(0,ee.__)("Minimum column width"),hideLabelFromVision:!0})}),(0,Er.jsx)(Yv.A,{isBlock:!0,children:(0,Er.jsx)(gk.A,{__next40pxDefaultSize:!0,onChange:n=>{t({...e,minimumColumnWidth:[n,a].join("")})},value:s||0,min:0,max:yk[a]||600,withInputField:!1,label:(0,ee.__)("Minimum column width"),hideLabelFromVision:!0})})]}),(0,Er.jsx)("p",{className:"components-base-control__help",children:(0,ee.__)("Columns will wrap to fewer per row when they can no longer maintain the minimum width.")})]})}function kk({layout:e,onChange:t,allowSizingOnChildren:n}){const i=void 0,{columnCount:r=i,rowCount:o,isManualPlacement:s}=e;return(0,Er.jsx)(Er.Fragment,{children:(0,Er.jsxs)("fieldset",{className:"block-editor-hooks__grid-layout-columns-and-rows-controls",children:[!s&&(0,Er.jsx)(mk.Ay.VisualLabel,{as:"legend",children:(0,ee.__)("Max. columns")}),(0,Er.jsxs)(Kv.A,{gap:4,children:[(0,Er.jsx)(Yv.A,{isBlock:!0,children:(0,Er.jsx)(ox.A,{size:"__unstable-large",onChange:n=>{const i=""===n||"0"===n?s?1:void 0:parseInt(n,10);t({...e,columnCount:i})},value:r,min:1,label:(0,ee.__)("Columns"),hideLabelFromVision:!s})}),(0,Er.jsx)(Yv.A,{isBlock:!0,children:n&&s?(0,Er.jsx)(ox.A,{size:"__unstable-large",onChange:n=>{const i=""===n||"0"===n?1:parseInt(n,10);t({...e,rowCount:i})},value:o,min:1,label:(0,ee.__)("Rows")}):(0,Er.jsx)(gk.A,{__next40pxDefaultSize:!0,value:r??1,onChange:n=>t({...e,columnCount:""===n||"0"===n?1:n}),min:1,max:16,withInputField:!1,label:(0,ee.__)("Columns"),hideLabelFromVision:!0})})]})]})})}function wk({layout:e,onChange:t}){const{columnCount:n,rowCount:i,minimumColumnWidth:r,isManualPlacement:o}=e,[s,a]=(0,T.useState)(n||3),[l,c]=(0,T.useState)(i),[u,d]=(0,T.useState)(r||"12rem"),h=o?"manual":"auto",p="manual"===h?(0,ee.__)("Grid items can be manually placed in any position on the grid."):(0,ee.__)("Grid items are placed automatically depending on their order.");return(0,Er.jsxs)(Jv.A,{__next40pxDefaultSize:!0,label:(0,ee.__)("Grid item position"),value:h,onChange:o=>{"manual"===o?d(r||"12rem"):(a(n||3),c(i)),t({...e,columnCount:s,rowCount:"manual"===o?l:void 0,isManualPlacement:"manual"===o||void 0,minimumColumnWidth:"auto"===o?u:null})},isBlock:!0,help:p,children:[(0,Er.jsx)(bk.A,{value:"auto",label:(0,ee.__)("Auto")},"auto"),(0,Er.jsx)(bk.A,{value:"manual",label:(0,ee.__)("Manual")},"manual")]})}var Ck=[$_,P_,hk,_k];function Sk(e="default"){return Ck.find(t=>t.name===e)}var Ak={type:"default"},Ik=(0,T.createContext)(Ak);Ik.displayName="BlockLayoutContext";var Ek=Ik.Provider;function jk(){return(0,T.useContext)(Ik)}var Tk=[],Bk=["none","left","center","right","wide","full"],Nk=["wide","full"];function Rk(e=Bk){e.includes("none")||(e=["none",...e]);const t=1===e.length&&"none"===e[0],[n,i,r]=(0,zt.A)(e=>{if(t)return[!1,!1,!1];const n=e(Qy).getSettings();return[n.alignWide??!1,n.supportsLayout,n.__unstableIsBlockBasedTheme]},[t]),o=jk();if(t)return Tk;const s=Sk(o?.type);if(i){const t=s.getAlignments(o,r).filter(t=>e.includes(t.name));return 1===t.length&&"none"===t[0].name?Tk:t}if("default"!==s.name&&"constrained"!==s.name)return Tk;const a=e.filter(e=>o.alignments?o.alignments.includes(e):!(!n&&Nk.includes(e))&&Bk.includes(e)).map(e=>({name:e}));return 1===a.length&&"none"===a[0].name?Tk:a}var Ok=n(22230),Lk=n(61218),Mk=n(281),Pk=n(88057),Dk={none:{icon:kx.A,title:(0,ee._x)("None","Alignment option")},left:{icon:Ok.A,title:(0,ee.__)("Align left")},center:{icon:Lk.A,title:(0,ee.__)("Align center")},right:{icon:Mk.A,title:(0,ee.__)("Align right")},wide:{icon:wx.A,title:(0,ee.__)("Wide width")},full:{icon:Pk.A,title:(0,ee.__)("Full width")}},Fk=function({value:e,onChange:t,controls:n,isToolbar:i,isCollapsed:r=!0}){const o=Rk(n);if(!o.length)return null;function s(n){t([e,"none"].includes(n)?void 0:n)}const a=Dk[e],l=Dk.none,c=i?wv:Dv,u={icon:a?a.icon:l.icon,label:(0,ee.__)("Align")},d=i?{isCollapsed:r,controls:o.map(({name:t})=>({...Dk[t],isActive:e===t||!e&&"none"===t,role:r?"menuitemradio":void 0,onClick:()=>s(t)}))}:{toggleProps:{description:(0,ee.__)("Change alignment")},children:({onClose:t})=>(0,Er.jsx)(Er.Fragment,{children:(0,Er.jsx)(Fv.A,{className:"block-editor-block-alignment-control__menu-group",children:o.map(({name:n,info:i})=>{const{icon:r,title:o}=Dk[n],a=n===e||!e&&"none"===n;return(0,Er.jsx)(zv.A,{icon:r,iconPosition:"left",className:(0,mh.A)("components-dropdown-menu__menu-item",{"is-active":a}),isSelected:a,onClick:()=>{s(n),t()},role:"menuitemradio",info:i,children:o},n)})})})};return(0,Er.jsx)(c,{...u,...d})},zk=e=>(0,Er.jsx)(Fk,{...e,isToolbar:!1});function Vk(e){const t=Ih(),{clientId:n=""}=t,{setBlockEditingMode:i,unsetBlockEditingMode:r}=(0,Vt.A)(Qy),o=(0,zt.A)(e=>n?null:e(Qy).getBlockEditingMode(),[n]);return(0,T.useEffect)(()=>(e&&i(n,e),()=>{e&&r(n)}),[n,e,i,r]),n?t[_h]:o}var Uk=["left","center","right","wide","full"],$k=["wide","full"];function Hk(e,t=!0,n=!0){let i;return i=Array.isArray(e)?Uk.filter(t=>e.includes(t)):!0===e?[...Uk]:[],!n||!0===e&&!t?i.filter(e=>!$k.includes(e)):i}var Wk={shareWithChildBlocks:!0,edit:function({name:e,align:t,setAttributes:n}){const i=Rk(Hk(vn(e,"align"),_n(e,"alignWide",!0))).map(({name:e})=>e),r=Vk();return i.length&&"default"===r?(0,Er.jsx)(Mv,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,Er.jsx)(zk,{value:t,onChange:t=>{if(!t){const n=bn(e),i=n?.attributes?.align?.default;i&&(t="")}n({align:t})},controls:i})}):null},useBlockProps:function({name:e,align:t}){return Rk(Hk(vn(e,"align"),_n(e,"alignWide",!0))).some(e=>e.name===t)?{"data-align":t}:{}},addSaveProps:function(e,t,n){const{align:i}=n;return Hk(vn(t,"align"),_n(t,"alignWide",!0)).includes(i)&&(e.className=(0,mh.A)(`align${i}`,e.className)),e},attributeKeys:["align"],hasSupport:e=>_n(e,"align",!1)};(0,Ei.U2)("blocks.registerBlockType","core/editor/align/addAttribute",function(e){return"type"in(e.attributes?.align??{})||_n(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...Uk,""]}}),e});var Gk=()=>{},qk=(0,T.createContext)({menuItems:{default:{},optional:{}},hasMenuItems:!1,isResetting:!1,shouldRenderPlaceholderItems:!1,registerPanelItem:Gk,deregisterPanelItem:Gk,flagItemCustomization:Gk,registerResetAllFilter:Gk,deregisterResetAllFilter:Gk,areAllOptionalControlsHidden:!0});qk.displayName="ToolsPanelContext";var Kk=()=>(0,T.useContext)(qk),Yk=(0,Sv.QJ)("InspectorControls"),Jk=(0,Sv.QJ)("InspectorAdvancedControls"),Xk=(0,Sv.QJ)("InspectorControlsBindings"),Zk=(0,Sv.QJ)("InspectorControlsBackground"),Qk=(0,Sv.QJ)("InspectorControlsBorder"),ew=(0,Sv.QJ)("InspectorControlsColor"),tw=(0,Sv.QJ)("InspectorControlsFilter"),nw=(0,Sv.QJ)("InspectorControlsDimensions"),iw=(0,Sv.QJ)("InspectorControlsPosition"),rw=(0,Sv.QJ)("InspectorControlsTypography"),ow=(0,Sv.QJ)("InspectorControlsListView"),sw=(0,Sv.QJ)("InspectorControlsStyles"),aw=(0,Sv.QJ)("InspectorControlsEffects"),lw={default:Yk,advanced:Jk,background:Zk,bindings:Xk,border:Qk,color:ew,content:(0,Sv.QJ)("InspectorControlsContent"),dimensions:nw,effects:aw,filter:tw,list:ow,position:iw,settings:Yk,styles:sw,typography:rw},cw=(0,Sv.QJ)(Symbol("PrivateInspectorControlsAllowedBlocks")),uw=n(81975),dw=n(28029),hw=Symbol("ListViewContentPopover"),{Fill:pw,Slot:fw}=(0,Sv.QJ)(hw);function mw({listViewRef:e}){const{popoverProps:t}=(0,dw.A)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:35,resize:!1}},n=Bv(hw),i=Boolean(n&&n.length),{selectedClientId:r,isOpen:o}=(0,zt.A)(e=>{const{getSelectedBlockClientId:t}=e(Qy),n=Gh(e(Qy));return{selectedClientId:t(),isOpen:n.isListViewContentPanelOpen()}},[]),[s,a]=(0,T.useState)(null);(0,T.useLayoutEffect)(()=>{if(!r||!e?.current)return void a(null);const t=e.current.querySelector(`[data-block="${r}"]`);a(t)},[r,e]);const{closeListViewContentPanel:l}=Gh((0,Vt.A)(Qy));return o&&i&&s?(0,Er.jsx)(uw.Ay,{...t??{},className:"block-editor-inspector-list-view-content-popover",anchor:s,onClose:l,children:(0,Er.jsx)("div",{style:{width:"280px"},children:(0,Er.jsx)(fw,{})})}):null}var gw=["content","list"],bw=["default","settings","advanced"];function yw({children:e,group:t="default",__experimentalGroup:n,resetAllFilter:i}){n&&((0,Qt.A)("`__experimentalGroup` property in `InspectorControlsFill`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=n);const r=Ih(),o=lw[t]?.Fill;if(!o)return(0,sn.A)(`Unknown InspectorControls group "${t}" provided.`),null;if(r[vh]){const e="core/template-part"===r.name,n=bw.includes(t),i=gw.includes(t);if(!(e&&n||i))return null}return r[vh]||r[bh]?"content"===t&&r[wh]&&r[vh]?r[bh]?(0,Er.jsx)(Cv.A,{document,children:(0,Er.jsx)(pw,{children:e})}):null:(0,Er.jsx)(Cv.A,{document,children:(0,Er.jsx)(o,{children:t=>(0,Er.jsx)(_w,{fillProps:t,children:e,resetAllFilter:i})})}):null}function vw({resetAllFilter:e,children:t}){const{registerResetAllFilter:n,deregisterResetAllFilter:i}=(0,T.useContext)(qk);return(0,T.useEffect)(()=>{if(e&&n&&i)return n(e),()=>{i(e)}},[e,n,i]),t}function _w({children:e,resetAllFilter:t,fillProps:n}){const{forwardedContext:i=[]}=n,r=(0,Er.jsx)(vw,{resetAllFilter:t,children:e});return i.reduce((e,[t,n])=>(0,Er.jsx)(t,{...n,children:e}),r)}var xw=n(13387),kw=n(83641),ww=n(39173),Cw=n(83733),Sw=n(33133),Aw=n(27373),Iw={columns:e=>(0,tx.AH)("grid-template-columns:",`repeat( ${e}, minmax(0, 1fr) )`,";",""),spacing:(0,tx.AH)("column-gap:",(0,ax.x)(4),";row-gap:",(0,ax.x)(4),";",""),item:{fullWidth:{name:"18iuzk9",styles:"grid-column:1/-1"}}},Ew={name:"huufmu",styles:">div:not( :first-of-type ){display:none;}"},jw=(0,tx.AH)(Iw.item.fullWidth," gap:",(0,ax.x)(2),";.components-dropdown-menu{margin:",(0,ax.x)(-1)," 0;line-height:0;}&&&& .components-dropdown-menu__toggle{padding:0;min-width:",(0,ax.x)(6),";}",""),Tw=(0,tx.AH)("font-size:inherit;font-weight:",rx.A.fontWeightMedium,";line-height:normal;&&{margin:0;}",""),Bw=(0,tx.AH)(Iw.item.fullWidth,"&>div,&>fieldset{padding-bottom:0;margin-bottom:0;max-width:100%;}&& ",Aw.mO,"{margin-bottom:0;",Aw.mh,":last-child{margin-bottom:0;}}",Aw.te,"{margin-bottom:0;}",""),Nw={name:"eivff4",styles:"display:none"},Rw={name:"16gsvie",styles:"min-width:200px"},Ow=(0,ex.A)("span",{target:"ews648u0"})("color:",nx.l.theme.accentDarker10,";font-size:11px;font-weight:",rx.A.fontWeightMedium,";line-height:1.4;",(0,ix.h)({marginLeft:(0,ax.x)(3)})," text-transform:uppercase;"),Lw=(0,tx.AH)("color:",nx.l.gray[900],";&&[aria-disabled='true']{color:",nx.l.gray[700],";opacity:1;&:hover{color:",nx.l.gray[700],";}",Ow,"{opacity:0.3;}}",""),Mw=n(82604),Pw=n(93451),Dw=n(96410),Fw=({itemClassName:e,items:t,toggleItem:n})=>{if(!t.length)return null;const i=(0,Er.jsx)(Ow,{"aria-hidden":!0,children:(0,ee.__)("Reset")});return(0,Er.jsx)(Er.Fragment,{children:t.map(([t,r])=>r?(0,Er.jsx)(zv.A,{className:e,role:"menuitem",label:(0,ee.sprintf)((0,ee.__)("Reset %s"),t),onClick:()=>{n(t),(0,dt.L)((0,ee.sprintf)((0,ee.__)("%s reset to default"),t),"assertive")},suffix:i,children:t},t):(0,Er.jsx)(zv.A,{icon:xw.A,className:e,role:"menuitemcheckbox",isSelected:!0,"aria-disabled":!0,children:t},t))})},zw=({items:e,toggleItem:t})=>e.length?(0,Er.jsx)(Er.Fragment,{children:e.map(([e,n])=>{const i=n?(0,ee.sprintf)((0,ee.__)("Hide and reset %s"),e):(0,ee.sprintf)((0,ee._x)("Show %s","input control"),e);return(0,Er.jsx)(zv.A,{icon:n?xw.A:null,isSelected:n,label:i,onClick:()=>{n?(0,dt.L)((0,ee.sprintf)((0,ee.__)("%s hidden and reset to default"),e),"assertive"):(0,dt.L)((0,ee.sprintf)((0,ee.__)("%s is now visible"),e),"assertive"),t(e)},role:"menuitemcheckbox",children:e},e)})}):null,Vw=(0,Dw.KZ)((e,t)=>{const{areAllOptionalControlsHidden:n,defaultControlsItemClassName:i,dropdownMenuClassName:r,hasMenuItems:o,headingClassName:s,headingLevel:a=2,label:l,menuItems:c,resetAll:u,toggleItem:d,dropdownMenuProps:h,...p}=function(e){const{className:t,headingLevel:n=2,...i}=(0,Mw.A)(e,"ToolsPanelHeader"),r=(0,Pw.l)(),o=(0,T.useMemo)(()=>r(jw,t),[t,r]),s=(0,T.useMemo)(()=>r(Rw),[r]),a=(0,T.useMemo)(()=>r(Tw),[r]),l=(0,T.useMemo)(()=>r(Lw),[r]),{menuItems:c,hasMenuItems:u,areAllOptionalControlsHidden:d}=Kk();return{...i,areAllOptionalControlsHidden:d,defaultControlsItemClassName:l,dropdownMenuClassName:s,hasMenuItems:u,headingClassName:a,headingLevel:n,menuItems:c,className:o}}(e);if(!l)return null;const f=Object.entries(c?.default||{}),m=Object.entries(c?.optional||{}),g=n?kw.A:ww.A,b=(0,ee.sprintf)((0,ee._x)("%s options","Button label to reveal tool panel options"),l),y=n?(0,ee.__)("All options are currently hidden"):void 0,v=[...f,...m].some(([,e])=>e);return(0,Er.jsxs)(Cw.A,{...p,ref:t,children:[(0,Er.jsx)(Sw.A,{level:a,className:s,children:l}),o&&(0,Er.jsx)(xv.A,{...h,icon:g,label:b,menuProps:{className:r},toggleProps:{size:"small",description:y},children:()=>(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsxs)(Fv.A,{label:l,children:[(0,Er.jsx)(Fw,{items:f,toggleItem:d,itemClassName:i}),(0,Er.jsx)(zw,{items:m,toggleItem:d})]}),(0,Er.jsx)(Fv.A,{children:(0,Er.jsx)(zv.A,{"aria-disabled":!v,variant:"tertiary",onClick:()=>{v&&(u(),(0,dt.L)((0,ee.__)("All options reset"),"assertive"))},children:(0,ee.__)("Reset all")})})]})})]})},"ToolsPanelHeader");function Uw(){return{panelItems:[],menuItemOrder:[],menuItems:{default:{},optional:{}}}}var $w=({panelItems:e,shouldReset:t,currentMenuItems:n,menuItemOrder:i})=>{const r={default:{},optional:{}},o={default:{},optional:{}};return e.forEach(({hasValue:e,isShownByDefault:i,label:o})=>{const s=i?"default":"optional",a=n?.[s]?.[o],l=a||e();r[s][o]=!t&&l}),i.forEach(e=>{r.default.hasOwnProperty(e)&&(o.default[e]=r.default[e]),r.optional.hasOwnProperty(e)&&(o.optional[e]=r.optional[e])}),Object.keys(r.default).forEach(e=>{o.default.hasOwnProperty(e)||(o.default[e]=r.default[e])}),Object.keys(r.optional).forEach(e=>{o.optional.hasOwnProperty(e)||(o.optional[e]=r.optional[e])}),o};function Hw(e,t){const n=function(e,t){switch(t.type){case"REGISTER_PANEL":{const n=[...e],i=n.findIndex(e=>e.label===t.item.label);return-1!==i&&n.splice(i,1),n.push(t.item),n}case"UNREGISTER_PANEL":{const n=e.findIndex(e=>e.label===t.label);if(-1!==n){const t=[...e];return t.splice(n,1),t}return e}default:return e}}(e.panelItems,t),i=function(e,t){return"REGISTER_PANEL"===t.type?e.includes(t.item.label)?e:[...e,t.item.label]:e}(e.menuItemOrder,t),r=function(e,t){switch(t.type){case"REGISTER_PANEL":case"UNREGISTER_PANEL":return $w({currentMenuItems:e.menuItems,panelItems:e.panelItems,menuItemOrder:e.menuItemOrder,shouldReset:!1});case"RESET_ALL":return $w({panelItems:e.panelItems,menuItemOrder:e.menuItemOrder,shouldReset:!0});case"UPDATE_VALUE":{const n=e.menuItems[t.group][t.label];return t.value===n?e.menuItems:{...e.menuItems,[t.group]:{...e.menuItems[t.group],[t.label]:t.value}}}case"TOGGLE_VALUE":{const n=e.panelItems.find(e=>e.label===t.label);if(!n)return e.menuItems;const i=n.isShownByDefault?"default":"optional";return{...e.menuItems,[i]:{...e.menuItems[i],[t.label]:!e.menuItems[i][t.label]}}}default:return e.menuItems}}({panelItems:n,menuItemOrder:i,menuItems:e.menuItems},t);return{panelItems:n,menuItemOrder:i,menuItems:r}}function Ww(e,t){switch(t.type){case"REGISTER":return[...e,t.filter];case"UNREGISTER":return e.filter(e=>e!==t.filter);default:return e}}var Gw=e=>0===Object.keys(e).length;var qw=n(72181),Kw={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"}},Yw=n(79624);var Jw=(0,Dw.KZ)(function(e,t){const n=function(e){const{align:t,alignment:n,className:i,columnGap:r,columns:o=2,gap:s=3,isInline:a=!1,justify:l,rowGap:c,rows:u,templateColumns:d,templateRows:h,...p}=(0,Mw.A)(e,"Grid"),f=Array.isArray(o)?o:[o],m=(0,Yw.t)(f),g=Array.isArray(u)?u:[u],b=(0,Yw.t)(g),y=d||!!o&&`repeat( ${m}, 1fr )`,v=h||!!u&&`repeat( ${b}, 1fr )`,_=(0,Pw.l)();return{...p,className:(0,T.useMemo)(()=>{const e=function(e){return e?Kw[e]:{}}(n),o=(0,tx.AH)({alignItems:t,display:a?"inline-grid":"grid",gap:`calc( ${rx.A.gridBase} * ${s} )`,gridTemplateColumns:y||void 0,gridTemplateRows:v||void 0,gridRowGap:c,gridColumnGap:r,justifyContent:l,verticalAlign:a?"middle":void 0,...e},"","");return _(o,i)},[t,n,i,r,_,s,y,v,a,l,c])}}(e);return(0,Er.jsx)(qw.A,{...n,ref:t})},"Grid"),Xw=(0,Dw.KZ)((e,t)=>{const{children:n,label:i,panelContext:r,resetAllItems:o,toggleItem:s,headingLevel:a,dropdownMenuProps:l,...c}=function(e){const{className:t,headingLevel:n=2,resetAll:i,panelId:r,hasInnerWrapper:o=!1,shouldRenderPlaceholderItems:s=!1,__experimentalFirstVisibleItemClass:a,__experimentalLastVisibleItemClass:l,...c}=(0,Mw.A)(e,"ToolsPanel"),u=(0,T.useRef)(!1),d=u.current;(0,T.useEffect)(()=>{d&&(u.current=!1)},[d]);const[{panelItems:h,menuItems:p},f]=(0,T.useReducer)(Hw,void 0,Uw),[m,g]=(0,T.useReducer)(Ww,[]),b=(0,T.useCallback)(e=>{f({type:"REGISTER_PANEL",item:e})},[]),y=(0,T.useCallback)(e=>{f({type:"UNREGISTER_PANEL",label:e})},[]),v=(0,T.useCallback)(e=>{g({type:"REGISTER",filter:e})},[]),_=(0,T.useCallback)(e=>{g({type:"UNREGISTER",filter:e})},[]),x=(0,T.useCallback)((e,t,n="default")=>{f({type:"UPDATE_VALUE",group:n,label:t,value:e})},[]),k=(0,T.useMemo)(()=>Gw(p.default)&&!Gw(p.optional)&&Object.values(p.optional).every(e=>!e),[p]),w=(0,Pw.l)(),C=(0,T.useMemo)(()=>{const e=o&&(0,tx.AH)(">div:not( :first-of-type ){display:grid;",Iw.columns(2)," ",Iw.spacing," ",Iw.item.fullWidth,";}",""),n=k&&Ew;return w((0,tx.AH)(Iw.columns(2)," ",Iw.spacing," border-top:",rx.A.borderWidth," solid ",nx.l.gray[300],";margin-top:-1px;padding:",(0,ax.x)(4),";",""),e,n,t)},[k,t,w,o]),S=(0,T.useCallback)(e=>{f({type:"TOGGLE_VALUE",label:e})},[]),A=(0,T.useCallback)(()=>{"function"==typeof i&&(u.current=!0,i(m)),f({type:"RESET_ALL"})},[m,i]),I=e=>{const t=p.optional||{},n=e.find(e=>e.isShownByDefault||t[e.label]);return n?.label},E=I(h),j=I([...h].reverse()),B=h.length>0;return{...c,headingLevel:n,panelContext:(0,T.useMemo)(()=>({areAllOptionalControlsHidden:k,deregisterPanelItem:y,deregisterResetAllFilter:_,firstDisplayedItem:E,flagItemCustomization:x,hasMenuItems:B,isResetting:u.current,lastDisplayedItem:j,menuItems:p,panelId:r,registerPanelItem:b,registerResetAllFilter:v,shouldRenderPlaceholderItems:s,__experimentalFirstVisibleItemClass:a,__experimentalLastVisibleItemClass:l}),[k,y,_,E,x,j,p,r,B,v,b,s,a,l]),resetAllItems:A,toggleItem:S,className:C}}(e);return(0,Er.jsx)(Jw,{...c,columns:2,ref:t,children:(0,Er.jsxs)(qk.Provider,{value:r,children:[(0,Er.jsx)(Vw,{label:i,resetAll:o,toggleItem:s,headingLevel:a,dropdownMenuProps:l}),n]})})},"ToolsPanel");function Zw(){return(0,dw.A)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}}}function Qw(e,t){if(!e||!t)return t;const n=e.split(","),i=t.split(","),r=[];return n.forEach(e=>{i.forEach(t=>{r.push(`${e.trim()} ${t.trim()}`)})}),r.join(", ")}function eC({children:e,group:t,label:n}){const{updateBlockAttributes:i}=(0,Vt.A)(Qy),{getBlockAttributes:r,getMultiSelectedBlockClientIds:o,getSelectedBlockClientId:s,hasMultiSelection:a}=(0,zt.A)(Qy),l=Zw(),c=s(),u=(0,T.useCallback)((e=[])=>{const t={},n=a()?o():[c];n.forEach(n=>{const{style:i}=r(n);let o={style:i};e.forEach(e=>{o={...o,...e(o)}}),o={...o,style:ov(o.style)},t[n]=o}),i(n,t,!0)},[r,o,a,c,i]);return(0,Er.jsx)(Xw,{className:`${t}-block-support-panel`,label:n,resetAll:u,panelId:c,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:l,children:e},c)}function tC({Slot:e,fillProps:t,...n}){const i=(0,T.useContext)(qk),r=(0,T.useMemo)(()=>({...t??{},forwardedContext:[...t?.forwardedContext??[],[qk.Provider,{value:i}]]}),[i,t]);return(0,Er.jsx)(e,{...n,fillProps:r,bubblesVirtually:!0})}var nC=(0,T.forwardRef)(function({__experimentalGroup:e,group:t="default",label:n,fillProps:i,...r},o){e&&((0,Qt.A)("`__experimentalGroup` property in `InspectorControlsSlot`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=e);const s=lw[t],a=Bv(s?.name);if(!s)return(0,sn.A)(`Unknown InspectorControls group "${t}" provided.`),null;if(!a?.length)return null;const{Slot:l}=s;return n?(0,Er.jsx)(eC,{group:t,label:n,children:(0,Er.jsx)(tC,{...r,fillProps:i,Slot:l})}):(0,Er.jsx)(l,{...r,ref:o,fillProps:i,bubblesVirtually:!0})}),iC=yw;iC.Slot=nC;var rC=e=>(0,Er.jsx)(yw,{...e,group:"advanced"});rC.Slot=function(e){return(0,Er.jsx)(nC,{...e,group:"advanced"})},rC.slotName="InspectorAdvancedControls";var oC=iC,sC=()=>{},aC=(0,Dw.KZ)((e,t)=>{const{children:n,isShown:i,shouldRenderPlaceholder:r,...o}=function(e){const{className:t,hasValue:n,isShownByDefault:i=!1,label:r,panelId:o,resetAllFilter:s=sC,onDeselect:a,onSelect:l,...c}=(0,Mw.A)(e,"ToolsPanelItem"),{panelId:u,menuItems:d,registerResetAllFilter:h,deregisterResetAllFilter:p,registerPanelItem:f,deregisterPanelItem:m,flagItemCustomization:g,isResetting:b,shouldRenderPlaceholderItems:y,firstDisplayedItem:v,lastDisplayedItem:_,__experimentalFirstVisibleItemClass:x,__experimentalLastVisibleItemClass:k}=Kk(),w=(0,T.useCallback)(n,[o]),C=(0,T.useCallback)(s,[o]),S=(0,qt.A)(u),A=u===o||null===u;(0,T.useLayoutEffect)(()=>(A&&null!==S&&f({hasValue:w,isShownByDefault:i,label:r,panelId:o}),()=>{(null===S&&u||u===o)&&m(r)}),[u,A,i,r,w,o,S,f,m]),(0,T.useEffect)(()=>(A&&h(C),()=>{A&&p(C)}),[h,p,C,A]);const I=i?"default":"optional",E=d?.[I]?.[r],j=(0,qt.A)(E),B=void 0!==d?.[I]?.[r],N=n();(0,T.useEffect)(()=>{(i||N)&&g(N,r,I)},[N,I,r,g,i]),(0,T.useEffect)(()=>{B&&!b&&A&&(!E||N||j||l?.(),!E&&N&&j&&a?.())},[A,E,B,b,N,j,l,a]);const R=i?void 0!==d?.[I]?.[r]:E,O=(0,Pw.l)(),L=(0,T.useMemo)(()=>{const e=y&&!R;return O(Bw,e&&Nw,!e&&t,v===r&&x,_===r&&k)},[R,y,t,O,v,_,x,k,r]);return{...c,isShown:R,shouldRenderPlaceholder:y,className:L}}(e);return i?(0,Er.jsx)(qw.A,{...o,ref:t,children:n}):r?(0,Er.jsx)(qw.A,{...o,ref:t}):null},"ToolsPanelItem");function lC(e,t={}){if("string"!=typeof e&&"number"!=typeof e)return null;isFinite(e)&&(e=`${e}px`);const{coerceTo:n,rootSizeValue:i,acceptableUnits:r}={coerceTo:"",rootSizeValue:16,acceptableUnits:["rem","px","em"],...t},o=r?.join("|"),s=new RegExp(`^(\\d*\\.?\\d+)(${o}){1,1}$`),a=e.toString().match(s);if(!a||a.length<3)return null;let[,l,c]=a,u=parseFloat(l);return"px"!==n||"em"!==c&&"rem"!==c||(u*=i,c=n),"px"!==c||"em"!==n&&"rem"!==n||(u/=i,c=n),"em"!==n&&"rem"!==n||"em"!==c&&"rem"!==c||(c=n),c?{value:cC(u,3),unit:c}:null}function cC(e,t=3){const n=Math.pow(10,t);return Math.round(e*n)/n}function uC(e){const t=e?.fluid;return!0===t||t&&"object"==typeof t&&Object.keys(t).length>0}function dC(e,t){const{size:n}=e;if(!n||"0"===n||!1===e?.fluid)return n;if(!uC(t?.typography)&&!uC(e))return n;const i=function(e){const t=e?.typography??{},n=e?.layout,i=lC(n?.wideSize)?n?.wideSize:null;return uC(t)&&i?{fluid:{maxViewportWidth:i,..."object"==typeof t.fluid?t.fluid:{}}}:{fluid:t?.fluid}}(t)?.fluid??{},r=function({minimumFontSize:e,maximumFontSize:t,fontSize:n,minimumViewportWidth:i="320px",maximumViewportWidth:r="1600px",scaleFactor:o=1,minimumFontSizeLimit:s}){if(s=lC(s)?s:"14px",n){const i=lC(n);if(!i?.unit||!i?.value)return null;const r=lC(s,{coerceTo:i.unit});if(r?.value&&!e&&!t&&i?.value<=r?.value)return null;if(t||(t=`${i.value}${i.unit}`),!e){const t="px"===i.unit?i.value:16*i.value,n=Math.min(Math.max(1-.075*Math.log2(t),.25),.75),o=cC(i.value*n,3);e=r?.value&&o<r?.value?`${r.value}${r.unit}`:`${o}${i.unit}`}}const a=lC(e),l=a?.unit||"rem",c=lC(t,{coerceTo:l});if(!a||!c)return null;const u=lC(e,{coerceTo:"rem"}),d=lC(r,{coerceTo:l}),h=lC(i,{coerceTo:l});if(!d||!h||!u)return null;const p=d.value-h.value;if(!p)return null;const f=cC(h.value/100,3),m=cC(f,3)+l,g=cC(((c.value-a.value)/p*100||1)*o,3);return`clamp(${e}, ${u.value}${u.unit} + ((1vw - ${m}) * ${g}), ${t})`}({minimumFontSize:"boolean"==typeof e?.fluid?void 0:e?.fluid?.min,maximumFontSize:"boolean"==typeof e?.fluid?void 0:e?.fluid?.max,fontSize:n,minimumFontSizeLimit:"object"==typeof i?i?.minFontSize:void 0,maximumViewportWidth:"object"==typeof i?i?.maxViewportWidth:void 0,minimumViewportWidth:"object"==typeof i?i?.minViewportWidth:void 0});return r||n}var hC=(e,t,n)=>{const i=Array.isArray(t)?t:t.split(".");let r=e;return i.forEach(e=>{r=r?.[e]}),r??n},pC="body",fC=":root",mC=[{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)=>dC(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:[]},{path:["border","radiusSizes"],valueKey:"size",cssVarInfix:"border-radius",classes:[]},{path:["dimensions","dimensionSizes"],valueKey:"size",cssVarInfix:"dimension",classes:[]}];function gC(e,t){if(!e||!t)return t;const n=e.split(","),i=t.split(","),r=[];return n.forEach(e=>{i.forEach(t=>{r.push(`${e.trim()} ${t.trim()}`)})}),r.join(", ")}function bC(e,t){if(!e||!t)return e;const n=function(e,t){if(!e||!t)return e;if("object"==typeof e&&"ref"in e&&e?.ref){const n=Ex(hC(t,e.ref));if("object"==typeof n&&null!==n&&"ref"in n&&n?.ref)return;return void 0===n?e:n}return e}(e,t);return"object"==typeof n&&null!==n&&"url"in n&&n?.url&&(n.url=function(e,t){if(!e||!t||!Array.isArray(t))return e;const n=t.find(t=>t?.name===e);return n?.href?n?.href:e}(n.url,t?._links?.["wp:theme-file"])),n}function yC(e,t,n=[],i="slug",r){const o=[t?hC(e,["blocks",t,...n]):void 0,hC(e,n)].filter(Boolean);for(const s of o)if(s){const o=["custom","theme","default"];for(const a of o){const o=s[a];if(o){const s=o.find(e=>e[i]===r);if(s)return"slug"===i||yC(e,t,n,"slug",s.slug)[i]===s[i]?s:void 0}}}}function vC(e,t,n){if(!n||"string"!=typeof n){if("object"!=typeof n||null===n||!("ref"in n)||"string"!=typeof n.ref)return n;{const t=hC(e,n.ref);if(!t||"object"==typeof t&&"ref"in t)return t;n=t}}let i;if(n.startsWith("var:"))i=n.slice(4).split("|");else{if(!n.startsWith("var(--wp--")||!n.endsWith(")"))return n;i=n.slice(10,-1).split("--")}const[r,...o]=i;return"preset"===r?function(e,t,n,[i,r]=[]){const o=mC.find(e=>e.cssVarInfix===i);if(!o||!e.settings)return n;const s=yC(e.settings,t,o.path,"slug",r);if(s){const{valueKey:n}=o;return vC(e,t,s[n])}return n}(e,t,n,o):"custom"===r?function(e,t,n,i=[]){const r=(t?hC(e?.settings??{},["blocks",t,"custom",...i]):void 0)??hC(e?.settings??{},["custom",...i]);return r?vC(e,t,r):n}(e,t,n,o):n}var _C=n(1452),xC=n(44208),kC=n(39632),wC=n(5296),CC=n(51620),SC=n(25638),AC=n(13121),IC=n(87452),EC=(0,Er.jsx)(AC.t4,{className:"components-placeholder__illustration",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 60 60",preserveAspectRatio:"none",children:(0,Er.jsx)(AC.wA,{vectorEffect:"non-scaling-stroke",d:"M60 60 0 0"})}),jC=function(e){const{icon:t,children:n,label:i,instructions:r,className:o,notices:s,preview:a,isColumnLayout:l,withIllustration:c,...u}=e,[d,{width:h}]=(0,SC.A)();let p;"number"==typeof h&&(p={"is-large":h>=480,"is-medium":h>=160&&h<480,"is-small":h<160});const f=(0,mh.A)("components-placeholder",o,p,c?"has-illustration":null),m=(0,mh.A)("components-placeholder__fieldset",{"is-column-layout":l});return(0,T.useEffect)(()=>{r&&(0,dt.L)(r)},[r]),(0,Er.jsxs)("div",{...u,className:f,children:[c?EC:null,d,s,a&&(0,Er.jsx)("div",{className:"components-placeholder__preview",children:a}),(0,Er.jsxs)("div",{className:"components-placeholder__label",children:[(0,Er.jsx)(IC.A,{icon:t}),i]}),!!r&&(0,Er.jsx)("div",{className:"components-placeholder__instructions",children:r}),(0,Er.jsx)("div",{className:m,children:n})]})},TC=n(58270),BC=n(7962);function NC(e){const t=Array.from(e.files);return Array.from(e.items).forEach(e=>{const n=e.getAsFile();n&&!t.find(({name:e,type:t,size:i})=>e===n.name&&t===n.type&&i===n.size)&&t.push(n)}),t}var RC=n(14735);function OC({dropZoneElement:e,isDisabled:t,onDrop:n,onDragStart:i,onDragEnter:r,onDragLeave:o,onDragEnd:s,onDragOver:a}){const l=(0,RC.A)(n),c=(0,RC.A)(i),u=(0,RC.A)(r),d=(0,RC.A)(o),h=(0,RC.A)(s),p=(0,RC.A)(a);return(0,bt.A)(f=>{if(t)return;const m=e??f;let g=!1;const{ownerDocument:b}=m;function y(e){g||(g=!0,b.addEventListener("dragend",w),b.addEventListener("mousemove",w),i&&c(e))}function v(e){e.preventDefault(),m.contains(e.relatedTarget)||r&&u(e)}function _(e){!e.defaultPrevented&&a&&p(e),e.preventDefault()}function x(e){(function(e){const{defaultView:t}=b;if(!(e&&t&&e instanceof t.HTMLElement&&m.contains(e)))return!1;let n=e;do{if(n.dataset.isDropZone)return n===m}while(n=n.parentElement);return!1})(e.relatedTarget)||o&&d(e)}function k(e){e.defaultPrevented||(e.preventDefault(),e.dataTransfer&&e.dataTransfer.files.length,n&&l(e),w(e))}function w(e){g&&(g=!1,b.removeEventListener("dragend",w),b.removeEventListener("mousemove",w),s&&h(e))}return m.setAttribute("data-is-drop-zone","true"),m.addEventListener("drop",k),m.addEventListener("dragenter",v),m.addEventListener("dragover",_),m.addEventListener("dragleave",x),b.addEventListener("dragenter",y),()=>{m.removeAttribute("data-is-drop-zone"),m.removeEventListener("drop",k),m.removeEventListener("dragenter",v),m.removeEventListener("dragover",_),m.removeEventListener("dragleave",x),b.removeEventListener("dragend",w),b.removeEventListener("mousemove",w),b.removeEventListener("dragenter",y)}},[t,e])}var LC=function({className:e,icon:t=BC.A,label:n,onFilesDrop:i,onHTMLDrop:r,onDrop:o,isEligible:s=()=>!0,...a}){const[l,c]=(0,T.useState)(),[u,d]=(0,T.useState)(),[h,p]=(0,T.useState)(),f=OC({onDrop(e){if(!e.dataTransfer)return;const t=NC(e.dataTransfer),n=e.dataTransfer.getData("text/html");n&&r?r(n):t.length&&i?i(t):o&&o(e)},onDragStart(e){c(!0),e.dataTransfer&&(e.dataTransfer.types.includes("text/html")?p(!!r):e.dataTransfer.types.includes("Files")||NC(e.dataTransfer).length>0?p(!!i):p(!!o&&s(e.dataTransfer)))},onDragEnd(){d(!1),c(!1),p(void 0)},onDragEnter(){d(!0)},onDragLeave(){d(!1)}}),m=(0,mh.A)("components-drop-zone",e,{"is-active":h,"is-dragging-over-document":l,"is-dragging-over-element":u});return(0,Er.jsx)("div",{...a,ref:f,className:m,children:(0,Er.jsx)("div",{className:"components-drop-zone__content",children:(0,Er.jsxs)("div",{className:"components-drop-zone__content-inner",children:[(0,Er.jsx)(xx.A,{icon:t,className:"components-drop-zone__content-icon"}),(0,Er.jsx)("span",{className:"components-drop-zone__content-text",children:n||(0,ee.__)("Drop files to upload")})]})})})},MC=n(73047);function PC({onDragStart:e,onDragMove:t,onDragEnd:n}){const[i,r]=(0,T.useState)(!1),o=(0,T.useRef)({onDragStart:e,onDragMove:t,onDragEnd:n});(0,MC.A)(()=>{o.current.onDragStart=e,o.current.onDragMove=t,o.current.onDragEnd=n},[e,t,n]);const s=(0,T.useCallback)(e=>o.current.onDragMove&&o.current.onDragMove(e),[]),a=(0,T.useCallback)(e=>{o.current.onDragEnd&&o.current.onDragEnd(e),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",a),r(!1)},[]),l=(0,T.useCallback)(e=>{o.current.onDragStart&&o.current.onDragStart(e),document.addEventListener("mousemove",s),document.addEventListener("mouseup",a),r(!0)},[]);return(0,T.useEffect)(()=>()=>{i&&(document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",a))},[i]),{startDrag:l,endDrag:a,isDragging:i}}var DC=n(36629),FC=n(24626),zC={width:200,height:170},VC=["avi","mpg","mpeg","mov","mp4","m4v","ogg","ogv","webm","wmv"];function UC(e){return Math.round(100*e)}var $C=(0,ex.A)(qw.A,{target:"eeew7dm9"})("border:0;padding:0;margin:0;font-family:",(0,DC.g)("default.fontFamily"),";font-size:",(0,DC.g)("default.fontSize"),";",FC.r,";"),HC=(0,ex.A)("div",{target:"eeew7dm8"})({name:"jqnsxy",styles:"background-color:transparent;display:flex;text-align:center;width:100%"}),WC=(0,ex.A)("div",{target:"eeew7dm7"})("align-items:center;border-radius:",rx.A.radiusSmall,";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:100%;}"),GC=(0,ex.A)("div",{target:"eeew7dm6"})("background:",nx.l.gray[100],";border-radius:inherit;box-sizing:border-box;height:",zC.height,"px;max-width:280px;min-width:",zC.width,"px;width:100%;"),qC=(0,ex.A)(vx,{target:"eeew7dm5"})({name:"1d3w5wq",styles:"width:100%"}),KC={name:"1mn7kwb",styles:"padding-bottom:1em"},YC=({hasHelpText:e=!1})=>e?KC:void 0,JC=(0,ex.A)(Kv.A,{target:"eeew7dm4"})("max-width:320px;padding-top:1em;",YC,";"),XC=(0,ex.A)("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,";"),ZC=(0,ex.A)("div",{target:"eeew7dm2"})({name:"1yzbo24",styles:"background:rgba( 255, 255, 255, 0.4 );backdrop-filter:blur( 16px ) saturate( 180% );position:absolute;transform:translateZ( 0 )"}),QC=(0,ex.A)(ZC,{target:"eeew7dm1"})({name:"1sw8ur",styles:"height:1px;left:1px;right:1px"}),eS=(0,ex.A)(ZC,{target:"eeew7dm0"})({name:"188vg4t",styles:"width:1px;top:1px;bottom:1px"}),tS=()=>{};function nS({hasHelpText:e,onChange:t=tS,point:n={x:.5,y:.5}}){const i=UC(n.x),r=UC(n.y),o=(e,i)=>{if(void 0===e)return;const r=parseInt(e,10);isNaN(r)||t({...n,[i]:r/100})};return(0,Er.jsxs)(JC,{className:"focal-point-picker__controls",hasHelpText:e,gap:4,children:[(0,Er.jsx)(iS,{label:(0,ee.__)("Left"),"aria-label":(0,ee.__)("Focal point left position"),value:[i,"%"].join(""),onChange:e=>o(e,"x"),dragDirection:"e"}),(0,Er.jsx)(iS,{label:(0,ee.__)("Top"),"aria-label":(0,ee.__)("Focal point top position"),value:[r,"%"].join(""),onChange:e=>o(e,"y"),dragDirection:"s"})]})}function iS(e){return(0,Er.jsx)(qC,{__next40pxDefaultSize:!0,className:"focal-point-picker__controls-position-unit-control",labelPosition:"top",max:100,min:0,units:[{value:"%",label:"%"}],...e})}var rS=(0,ex.A)("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:",rx.A.radiusRound,";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 oS({left:e="50%",top:t="50%",...n}){const i={left:e,top:t};return(0,Er.jsx)(rS,{...n,className:"components-focal-point-picker__icon_container",style:i})}function sS({bounds:e,...t}){return(0,Er.jsxs)(XC,{...t,className:"components-focal-point-picker__grid",style:{width:e.width,height:e.height},children:[(0,Er.jsx)(QC,{style:{top:"33%"}}),(0,Er.jsx)(QC,{style:{top:"66%"}}),(0,Er.jsx)(eS,{style:{left:"33%"}}),(0,Er.jsx)(eS,{style:{left:"66%"}})]})}function aS({alt:e,autoPlay:t,src:n,onLoad:i,mediaRef:r,muted:o=!0,...s}){return n?function(e=""){return!!e&&(e.startsWith("data:video/")||VC.includes(function(e=""){const t=e.split(".");return t[t.length-1]}(e)))}(n)?(0,Er.jsx)("video",{...s,autoPlay:t,className:"components-focal-point-picker__media components-focal-point-picker__media--video",loop:!0,muted:o,onLoadedData:i,ref:r,src:n}):(0,Er.jsx)("img",{...s,alt:e,className:"components-focal-point-picker__media components-focal-point-picker__media--image",onLoad:i,ref:r,src:n}):(0,Er.jsx)(GC,{className:"components-focal-point-picker__media components-focal-point-picker__media--placeholder",ref:r,...s})}var lS=n(28316),cS=function({__nextHasNoMarginBottom:e,autoPlay:t=!0,className:n,help:i,hideLabelFromVision:r,label:o,onChange:s,onDrag:a,onDragEnd:l,onDragStart:c,resolvePoint:u,url:d,value:h={x:.5,y:.5},...p}){const[f,m]=(0,T.useState)(h),[g,b]=(0,T.useState)(!1),{startDrag:y,endDrag:v,isDragging:_}=PC({onDragStart:e=>{w.current?.focus();const t=I(e);t&&(c?.(t,e),m(t))},onDragMove:e=>{e.preventDefault();const t=I(e);t&&(a?.(t,e),m(t))},onDragEnd:()=>{l?.(),s?.(f)}}),{x,y:k}=_?f:h,w=(0,T.useRef)(null),[C,S]=(0,T.useState)(zC),A=(0,T.useRef)(()=>{if(!w.current)return;const{clientWidth:e,clientHeight:t}=w.current;S(e>0&&t>0?{width:e,height:t}:{...zC})});(0,T.useEffect)(()=>{const e=A.current;if(!w.current)return;const{defaultView:t}=w.current.ownerDocument;return t?.addEventListener("resize",e),()=>t?.removeEventListener("resize",e)},[]),(0,MC.A)(()=>{A.current()},[]);const I=({clientX:e,clientY:t,shiftKey:n})=>{if(!w.current)return;const{top:i,left:r}=w.current.getBoundingClientRect();let o=(e-r)/C.width,s=(t-i)/C.height;return n&&(o=.1*Math.round(o/.1),s=.1*Math.round(s/.1)),E({x:o,y:s})},E=e=>{const t=u?.(e)??e;t.x=Math.max(0,Math.min(t.x,1)),t.y=Math.max(0,Math.min(t.y,1));const n=e=>Math.round(100*e)/100;return{x:n(t.x),y:n(t.y)}},j={left:void 0!==x?x*C.width:.5*C.width,top:void 0!==k?k*C.height:.5*C.height},B=(0,mh.A)("components-focal-point-picker-control",n),N=r?kC.A:Aw.Gw;return(0,lS.A)(()=>{b(!0);const e=window.setTimeout(()=>{b(!1)},600);return()=>window.clearTimeout(e)},[x,k]),(0,Er.jsxs)($C,{...p,as:"fieldset",className:B,children:[!!o&&(0,Er.jsx)(N,{as:"legend",children:o}),(0,Er.jsx)(HC,{className:"components-focal-point-picker-wrapper",children:(0,Er.jsxs)(WC,{className:"components-focal-point-picker",onKeyDown:e=>{const{code:t,shiftKey:n}=e;if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t))return;e.preventDefault();const i={x,y:k},r=n?.1:.01,o="ArrowUp"===t||"ArrowLeft"===t?-1*r:r,a="ArrowUp"===t||"ArrowDown"===t?"y":"x";i[a]=i[a]+o,s?.(E(i))},onMouseDown:y,onBlur:()=>{_&&v()},ref:w,role:"button",tabIndex:-1,children:[(0,Er.jsx)(sS,{bounds:C,showOverlay:g}),(0,Er.jsx)(aS,{alt:(0,ee.__)("Media preview"),autoPlay:t,onLoad:A.current,src:d}),(0,Er.jsx)(oS,{...j,isDragging:_})]})}),(0,Er.jsx)(nS,{hasHelpText:!!i,point:{x,y:k},onChange:e=>{s?.(E(e))}}),!!i&&(0,Er.jsx)(Aw.te,{children:i})]})},uS=n(26678),dS=n(14401),hS=n(10488),pS=n(32455),fS=function({accept:e,children:t,multiple:n=!1,onChange:i,onClick:r,render:o,...s}){const a=(0,T.useRef)(null),l=()=>{a.current?.click()};o||(0,bx.M)({componentName:"FormFileUpload",__next40pxDefaultSize:s.__next40pxDefaultSize,size:s.size});const c=o?o({openFileDialog:l}):(0,Er.jsx)(fv.Ay,{onClick:l,...s,children:t}),u=e?.includes("audio/*")?`${e}, audio/mp3, audio/x-m4a, audio/x-m4b, audio/x-m4p, audio/x-wav, audio/webm`:e;return(0,Er.jsxs)("div",{className:"components-form-file-upload",children:[c,(0,Er.jsx)("input",{type:"file",ref:a,multiple:n,style:{display:"none"},accept:u,onChange:i,onClick:r,"data-testid":"form-file-upload-input"})]})},mS=n(90025);function gS(e){return(0,gh.f)(t=>{const n="core/with-filters/"+e;let i;class r extends T.Component{constructor(n){super(n),void 0===i&&(i=(0,Ei.W5)(e,t))}componentDidMount(){r.instances.push(this),1===r.instances.length&&((0,Ei.ip)("hookRemoved",n,s),(0,Ei.ip)("hookAdded",n,s))}componentWillUnmount(){r.instances=r.instances.filter(e=>e!==this),0===r.instances.length&&((0,Ei.V5)("hookRemoved",n),(0,Ei.V5)("hookAdded",n))}render(){return(0,Er.jsx)(i,{...this.props})}}r.instances=[];const o=(0,mS.s)(()=>{i=(0,Ei.W5)(e,t),r.instances.forEach(e=>{e.forceUpdate()})},16);function s(t){t===e&&o()}return r},"withFilters")}var bS=n(75390),yS=n(6575),vS=n(39662),_S=gS("editor.MediaUpload")(()=>null),xS=function({fallback:e=null,children:t}){const n=(0,zt.A)(e=>{const{getSettings:t}=e(Qy);return!!t().mediaUpload},[]);return n?t:e},kS=n(19718),wS=n(14755),CS=n(93697),SS=n(72738),AS=n(64764),IS=n(52573),ES=n(35861),jS=n(68665),TS=n(18603),BS=n(95408),NS=n(320),RS=n(50006),OS=n(44645),LS=n(94750),MS=function e({children:t,settingsOpen:n,setSettingsOpen:i}){const r=(0,LS.A)(),o=r?T.Fragment:BS.N,s=r?"div":NS.P.div,a=`link-control-settings-drawer-${(0,SS.A)(e)}`;return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,className:"block-editor-link-control__drawer-toggle","aria-expanded":n,onClick:()=>i(!n),icon:(0,ee.isRTL)()?RS.A:OS.A,"aria-controls":a,children:(0,ee._x)("Advanced","Additional link settings")}),(0,Er.jsx)(o,{children:n&&(0,Er.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,Er.jsx)("div",{className:"block-editor-link-control__drawer-inner",children:t})})})]})},PS=n(9936),DS=n(48538),FS=(0,gh.f)(e=>class extends T.Component{timeouts;constructor(e){super(e),this.timeouts=[],this.setTimeout=this.setTimeout.bind(this),this.clearTimeout=this.clearTimeout.bind(this)}componentWillUnmount(){this.timeouts.forEach(clearTimeout)}setTimeout(e,t){const n=setTimeout(()=>{e(),this.clearTimeout(n)},t);return this.timeouts.push(n),n}clearTimeout(e){clearTimeout(e),this.timeouts=this.timeouts.filter(t=>t!==e)}render(){return(0,Er.jsx)(e,{...this.props,setTimeout:this.setTimeout,clearTimeout:this.clearTimeout})}},"withSafeTimeout"),zS=FS,VS=n(11011),US=n(42134),{ValidatedInputControl:$S}=Gh(Ev.j);function HS(e){return"function"==typeof e}var WS=class extends T.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,T.createRef)(),this.inputRef=e.inputRef||(0,T.createRef)(),this.hasRenderedValidation={current:!1},this.updateSuggestions=(0,mS.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:i,__experimentalShowInitialSuggestions:r=!1}=this.props;t&&null!==n&&this.suggestionNodes[n]&&this.suggestionNodes[n].scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"}),e.value===i||this.props.disableSuggestions||(i?.length?this.updateSuggestions(i):r&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){this.suggestionsRequest?.cancel?.(),this.suggestionsRequest=null}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){const{__experimentalShowInitialSuggestions:e=!1,value:t}=this.props;return e&&!(t&&t.length)}updateSuggestions(e=""){const{__experimentalFetchLinkSuggestions:t,__experimentalHandleURLSuggestions:n}=this.props;if(!t)return;const i=!e?.length;if(e=e.trim(),!i&&(e.length<2||!n&&(0,TS.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 r=t(e,{isInitialSuggestions:i});r.then(t=>{this.suggestionsRequest===r&&(this.setState({suggestions:t,suggestionsValue:e,loading:!1,showSuggestions:!!t.length}),t.length?this.props.debouncedSpeak((0,ee.sprintf)((0,ee._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,ee.__)("No results."),"assertive"))}).catch(()=>{this.suggestionsRequest===r&&this.setState({loading:!1})}).finally(()=>{this.suggestionsRequest===r&&(this.suggestionsRequest=null)}),this.suggestionsRequest=r}onChange(e){this.props.onChange(e)}onFocus(){const{suggestions:e}=this.state,{disableSuggestions:t,value:n}=this.props;!n||t||e&&e.length||null!==this.suggestionsRequest||this.updateSuggestions(n)}onKeyDown(e){this.props.onKeyDown?.(e);const{showSuggestions:t,selectedSuggestion:n,suggestions:i,loading:r}=this.state;if(!t||!i.length||r){switch(e.keyCode){case Rt.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case Rt.PX:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case Rt.Fm:this.props.onSubmit&&(e.preventDefault(),this.props.onSubmit(null,e))}return}const o=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case Rt.UP:{e.preventDefault();const t=n?n-1:i.length-1;this.setState({selectedSuggestion:t});break}case Rt.PX:{e.preventDefault();const t=null===n||n===i.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case Rt.wn:null!==this.state.selectedSuggestion&&(this.selectLink(o),this.props.speak((0,ee.__)("Link selected.")));break;case Rt.Fm:e.preventDefault(),null!==this.state.selectedSuggestion?(this.selectLink(o),this.props.onSubmit&&this.props.onSubmit(o,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:i=!1},{showSuggestions:r}){let o=r;const s=e&&e.length;return i||s||(o=!1),!0===n&&(o=!1),{showSuggestions:o,suggestionsListboxId:`block-editor-url-input-suggestions-${t}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${t}`}}render(){return(0,Er.jsxs)(Er.Fragment,{children:[this.renderControl(),this.renderSuggestions()]})}renderControl(){const{label:e=null,className:t,isFullWidth:n,instanceId:i,placeholder:r=(0,ee.__)("Paste URL or type to search"),__experimentalRenderControl:o,value:s="",hideLabelFromVision:a=!1,help:l=null,disabled:c=!1,customValidity:u,markWhenOptional:d}=this.props,{loading:h,showSuggestions:p,selectedSuggestion:f,suggestionsListboxId:m,suggestionOptionIdPrefix:g}=this.state,b=`url-input-control-${i}`,y={id:b,label:e,className:(0,mh.A)("block-editor-url-input",t,{"is-full-width":n}),hideLabelFromVision:a},v={id:b,value:s,required:this.props.required??!0,type:"text",name:b,autoComplete:"off",onChange:c?()=>{}:this.onChange,onFocus:c?()=>{}:this.onFocus,placeholder:r,onKeyDown:c?()=>{}:this.onKeyDown,role:"combobox","aria-label":e?void 0:(0,ee.__)("URL"),"aria-expanded":p,"aria-autocomplete":"list","aria-owns":m,"aria-activedescendant":null!==f?`${g}-${f}`:void 0,ref:this.inputRef,disabled:c,suffix:this.props.suffix,help:l},_={customValidity:u,...void 0!==d&&{markWhenOptional:d}};if(o)return o(y,v,h);void 0!==u&&(this.hasRenderedValidation.current=!0);const x=this.hasRenderedValidation.current?$S:PS.Ay;return(0,Er.jsxs)(mk.Ay,{...y,children:[(0,Er.jsx)(x,{...v,...this.hasRenderedValidation.current?_:{},__next40pxDefaultSize:!0}),h&&(0,Er.jsx)(TC.Ay,{})]})}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t}=this.props,{showSuggestions:n,suggestions:i,suggestionsValue:r,selectedSuggestion:o,suggestionsListboxId:s,suggestionOptionIdPrefix:a,loading:l}=this.state;if(!n||0===i.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===o||void 0});return HS(t)?t({suggestions:i,selectedSuggestion:o,suggestionsListProps:c,buildSuggestionItemProps:u,isLoading:l,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:!r?.length,currentInputValue:r}):(0,Er.jsx)(uw.Ay,{placement:"bottom",focusOnMount:!1,children:(0,Er.jsx)("div",{...c,className:(0,mh.A)("block-editor-url-input__suggestions",{[`${e}__suggestions`]:e}),children:i.map((e,t)=>(0,T.createElement)(fv.Ay,{__next40pxDefaultSize:!0,...u(0,t),key:e.id,className:(0,mh.A)("block-editor-url-input__suggestion",{"is-selected":t===o}),onClick:()=>this.handleOnClick(e)},e.title))})})}},GS=(0,z.A)(zS,DS.A,VS.A,(0,US.A)((e,t)=>{if(HS(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(Qy);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}}))(WS),qS=n(27314),KS=({searchTerm:e,onClick:t,itemProps:n,buttonText:i})=>{if(!e)return null;let r;return r=i?"function"==typeof i?i(e):i:(0,qS.A)((0,ee.sprintf)((0,ee.__)("Create: <mark>%s</mark>"),e),{mark:(0,Er.jsx)("mark",{})}),(0,Er.jsx)(zv.A,{...n,iconPosition:"left",icon:kw.A,className:"block-editor-link-control__search-item",onClick:t,children:r})},YS=e=>{const{text:t="",highlight:n=""}=e,i=n.trim();if(!i)return(0,Er.jsx)(Er.Fragment,{children:t});const r=new RegExp(`(${(0,mx.Nt)(i)})`,"gi");return(0,qS.A)(t.replace(r,"<mark>$&</mark>"),{mark:(0,Er.jsx)("mark",{})})};YS.displayName="TextHighlight";var JS=YS,XS=n(89120),ZS=n(83364),QS=n(51615),eA=n(94333),tA=n(6943),nA=n(16376),iA=n(14220),rA=n(83368),oA=n(24698),sA=n(13683),aA=n(75414),lA={post:{icon:XS.A,label:(0,ee.__)("Post")},page:{icon:ZS.A,label:(0,ee.__)("Page")},post_tag:{icon:QS.A,label:(0,ee.__)("Tag")},category:{icon:eA.A,label:(0,ee.__)("Category")},attachment:{icon:tA.A,label:(0,ee.__)("Attachment")}};function cA({isURL:e,suggestion:t}){let n=null;return e?n=nA.A:t.type in lA&&(n=lA[t.type].icon,"page"===t.type&&(t.isFrontPage&&(n=iA.A),t.isBlogHome&&(n=rA.A))),n?(0,Er.jsx)(xx.A,{className:"block-editor-link-control__search-item-icon",icon:n}):null}function uA(e){const t=e?.trim();return t?.length?e?.replace(/^\/?/,"/"):e}function dA(e){const t=e?.trim();return t?.length?e?.replace(/\/$/,""):e}function hA(e){return e.isFrontPage?(0,ee.__)("Front page"):e.isBlogHome?(0,ee.__)("Blog home"):e.type in lA?lA[e.type].label:e.type}var pA=({itemProps:e,suggestion:t,searchTerm:n,onClick:i,isURL:r=!1,shouldShowType:o=!1})=>{const s=r?(0,ee.__)("Press ENTER to add this link"):(a=t.url)?(0,Eh.h)(oA.S,sA.Y,e=>null==e||e!=e?"":e,((e,...t)=>(...n)=>e(...n,...t))(aA.r,24),dA,uA)(a):a;var a;return(0,Er.jsx)(zv.A,{...e,info:s,iconPosition:"left",icon:(0,Er.jsx)(cA,{suggestion:t,isURL:r}),onClick:i,shortcut:o&&hA(t),className:"block-editor-link-control__search-item",children:(0,Er.jsx)(JS,{text:ae(t.title),highlight:n})})},fA="__CREATE__",mA="link",gA="mailto",bA="internal",yA=[mA,gA,"tel",bA],vA=[{id:"opensInNewTab",title:(0,ee.__)("Open in new tab")}];var _A=function({withCreateSuggestion:e,currentInputValue:t,handleSuggestionClick:n,suggestionsListProps:i,buildSuggestionItemProps:r,suggestions:o,selectedSuggestion:s,isLoading:a,isInitialSuggestions:l,createSuggestionButtonText:c,suggestionsQuery:u}){const d=(0,mh.A)("block-editor-link-control__search-results",{"is-loading":a}),h=1===o.length&&yA.includes(o[0].type),p=e&&!h&&!l,f=!u?.type,m=l?(0,ee.__)("Suggestions"):(0,ee.sprintf)((0,ee.__)('Search results for "%s"'),t);return(0,Er.jsx)("div",{className:"block-editor-link-control__search-results-wrapper",children:(0,Er.jsx)("div",{...i,className:d,"aria-label":m,children:(0,Er.jsx)(Fv.A,{children:o.map((e,i)=>p&&fA===e.type?(0,Er.jsx)(KS,{searchTerm:t,buttonText:c,onClick:()=>n(e),itemProps:r(e,i),isSelected:i===s},e.type):fA===e.type?null:(0,Er.jsx)(pA,{itemProps:r(e,i),suggestion:e,index:i,onClick:()=>{n(e)},isSelected:i===s,isURL:yA.includes(e.type),searchTerm:t,shouldShowType:f,isFrontPage:e?.isFrontPage,isBlogHome:e?.isBlogHome},`${e.id}-${e.type}`))})})})},xA=n(13219),kA=n(45834),wA=n(49959);function CA(e){return e?.startsWith("#")&&(0,xA.R)(e)}function SA(e){return e?.startsWith("/")||e?.startsWith("./")||e?.startsWith("../")}function AA(e){if(e.includes(" "))return!1;const t=(0,kA.J)(e),n=(0,wA.v)(t),i=function(e,t=6){const n=e.split(/[?#]/)[0];return new RegExp(`(?<=\\S)\\.(?:[a-zA-Z_]{2,${t}})(?:\\/|$)`).test(n)}(e),r=e?.startsWith("www.");return n||r||CA(e)||i||SA(e)}function IA(e){const t=e?.trim();if(!t)return{url:t,type:mA};let n=mA;const i=(0,kA.J)(t)||"";return i.includes("mailto")?n=gA:i.includes("tel")?n="tel":t?.startsWith("#")&&(n=bA),CA(t)||SA(t)||t.startsWith("?")||i?{url:t,type:n}:{url:(0,jS.i)(t),type:n}}var EA=()=>Promise.resolve([]),jA=e=>{const{url:t,type:n}=IA(e);return Promise.resolve([{id:e,title:e,url:t,type:n}])};var TA=()=>Promise.resolve([]),BA=()=>{},NA=(0,T.forwardRef)(({value:e,children:t,currentLink:n={},className:i=null,placeholder:r=null,withCreateSuggestion:o=!1,onCreateSuggestion:s=BA,onChange:a=BA,onSelect:l=BA,showSuggestions:c=!0,renderSuggestions:u=e=>(0,Er.jsx)(_A,{...e}),fetchSuggestions:d=null,allowDirectEntry:h=!0,showInitialSuggestions:p=!1,suggestionsQuery:f={},withURLSuggestion:m=!0,createSuggestionButtonText:g,hideLabelFromVision:b=!1,suffix:y,isEntity:v=!1,customValidity:_},x)=>{const k=function(e,t,n){const{fetchSearchSuggestions:i,pageOnFront:r,pageForPosts:o}=(0,zt.A)(e=>{const{getSettings:t}=e(Qy);return{pageOnFront:t().pageOnFront,pageForPosts:t().pageForPosts,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}},[]),s=t?jA:EA;return(0,T.useCallback)((t,{isInitialSuggestions:a})=>AA(t)?s(t,{isInitialSuggestions:a}):(async(e,t,n,i,r,o)=>{const{isInitialSuggestions:s}=t,a=await n(e,t);return a.map(e=>Number(e.id)===r?(e.isFrontPage=!0,e):Number(e.id)===o?(e.isBlogHome=!0,e):e),s||AA(e)||!i?a:a.concat({title:e,url:e,type:fA})})(t,{...e,isInitialSuggestions:a},i,n,r,o),[s,i,r,o,e,n])}(f,h,o),w=c?d||k:TA,[C,S]=(0,T.useState)(),A=async e=>{let t=e;if(fA!==e.type){if(h||t&&Object.keys(t).length>=1){const{id:e,url:i,kind:r,type:o,...s}=n??{};l({...s,...t},t)}}else try{t=await s(e.title),t?.url&&l(t)}catch{}},I=r??(0,ee.__)("Search or type URL"),E=b&&""!==r?I:(0,ee.__)("Link");return(0,Er.jsxs)("div",{className:"block-editor-link-control__search-input-container",children:[(0,Er.jsx)(GS,{disableSuggestions:n?.url===e,label:E,hideLabelFromVision:b,className:i,value:e,onChange:(e,t)=>{a(e),S(t)},placeholder:I,__experimentalRenderSuggestions:c?e=>u({...e,withCreateSuggestion:o,createSuggestionButtonText:g,suggestionsQuery:f,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),A(t)}}):null,__experimentalFetchLinkSuggestions:w,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:p,customValidity:_,required:!1,onSubmit:(t,n)=>{const i=t||C;i||e?.trim()?.length?A(i||{url:e}):n.preventDefault()},inputRef:x,suffix:y,disabled:v}),t]})}),RA=NA,OA=n(17741),LA=n(50065),MA=n(60713),PA=n(19730),DA=n(63344),{Slot:FA,Fill:zA}=(0,Sv.QJ)("BlockEditorLinkControlViewer");function VA(e,t){switch(t.type){case"RESOLVED":return{...e,isFetching:!1,richData:t.richData};case"ERROR":return{...e,isFetching:!1,richData:null};case"LOADING":return{...e,isFetching:!0};default:throw new Error(`Unexpected action type ${t.type}`)}}var UA=function(e){const[t,n]=(0,T.useReducer)(VA,{richData:null,isFetching:!1}),{fetchRichUrlData:i}=(0,zt.A)(e=>{const{getSettings:t}=e(Qy);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}},[]);return(0,T.useEffect)(()=>{if(e?.length&&i&&"undefined"!=typeof AbortController){n({type:"LOADING"});const t=new window.AbortController,r=t.signal;return i(e,{signal:r}).then(e=>{n({type:"RESOLVED",richData:e})}).catch(()=>{r.aborted||n({type:"ERROR"})}),()=>{t.abort()}}},[e]),t},{Badge:$A}=Gh(Ev.j);function HA({value:e,onEditClick:t,hasRichPreviews:n=!1,hasUnlinkControl:i=!1,onRemove:r}){const o=(0,zt.A)(e=>e(Ob.M).get("core","showIconLabels"),[]),s=n?e?.url:null,{richData:a,isFetching:l}=UA(s),c=a&&Object.keys(a).length,u=e&&(0,aA.r)((0,oA.S)(e.url),24)||"",d=!e?.url?.length,h=!d&&ae(e?.entityTitle||a?.title||e?.title||u);let p;p=a?.icon?(0,Er.jsx)("img",{src:a?.icon,alt:""}):d?(0,Er.jsx)(xx.A,{icon:MA.A,size:32}):(0,Er.jsx)(xx.A,{icon:nA.A});const{createNotice:f}=(0,Vt.A)(Rb.store),m=(0,LA.Ay)(e.url,()=>{f("info",(0,ee.__)("Link copied to clipboard."),{isDismissible:!0,type:"snackbar"})});return(0,Er.jsx)(Kv.A,{role:"group","aria-label":(0,ee.__)("Manage link"),className:(0,mh.A)("block-editor-link-control__preview",{"is-current":!0,"is-rich":c,"is-fetching":!!l,"is-preview":!0,"is-error":d,"is-url-title":h===u}),children:(0,Er.jsxs)(Kv.A,{gap:0,align:"flex-start",children:[(0,Er.jsxs)(Kv.A,{className:"block-editor-link-control__link-information",role:"figure","aria-label":(0,ee.__)("Link information"),justify:"start",align:"flex-start",children:[e?.image?(0,Er.jsx)(Kv.A,{className:"block-editor-link-control__preview-image",justify:"center",children:(0,Er.jsx)("img",{src:e?.image,alt:""})}):(0,Er.jsx)(Kv.A,{className:(0,mh.A)("block-editor-link-control__preview-icon",{"is-image":a?.icon}),justify:"center",children:p}),(0,Er.jsx)(Kv.A,{className:"block-editor-link-control__preview-details",direction:"column",gap:2,children:d?(0,Er.jsx)("span",{className:"block-editor-link-control__preview-error-notice",children:(0,ee.__)("Link is empty")}):(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(OA.A,{className:"block-editor-link-control__preview-title",href:e.url,children:(0,Er.jsx)(xC.A,{numberOfLines:1,children:h})}),(0,Er.jsx)("span",{className:"block-editor-link-control__preview-info",children:(0,Er.jsx)(xC.A,{numberOfLines:1,children:u})}),e?.badges?.length>0&&(0,Er.jsx)(Cw.A,{className:"block-editor-link-control__preview-badges",alignment:"left",gap:1,children:e.badges.map((e,t)=>(0,Er.jsx)($A,{intent:e.intent,children:e.label},`${e.label}|${e.intent}|${t}`))})]})})]}),(0,Er.jsx)(fv.Ay,{icon:PA.A,label:(0,ee.__)("Edit link"),onClick:t,size:"compact",showTooltip:!o}),i&&(0,Er.jsx)(fv.Ay,{icon:IS.A,label:(0,ee.__)("Remove link"),onClick:r,size:"compact",showTooltip:!o}),(0,Er.jsx)(fv.Ay,{icon:DA.A,label:(0,ee.__)("Copy link"),ref:m,accessibleWhenDisabled:!0,disabled:d,size:"compact",showTooltip:!o}),(0,Er.jsx)(FA,{fillProps:e})]})})}var WA=n(15172),GA=()=>{},qA=({value:e,onChange:t=GA,settings:n})=>{if(!n||!n.length)return null;const i=n=>i=>{t({...e,[n.id]:i})},r=n.map(n=>{if("render"in n){if("function"==typeof n.render){const i=n.render(n,e,t);return(0,Er.jsx)("div",{className:"block-editor-link-control__setting",children:i},n.id)}return null}return(0,Er.jsx)(WA.A,{className:"block-editor-link-control__setting",label:n.title,onChange:i(n),checked:!!e&&!!e[n.id],help:n?.help},n.id)}).filter(Boolean);return(0,Er.jsxs)("fieldset",{className:"block-editor-link-control__settings",children:[(0,Er.jsx)(kC.A,{as:"legend",children:(0,ee.__)("Currently selected link settings")}),r]})},KA=n(7040),YA=()=>{},JA="core/block-editor",XA="linkControlSettingsDrawer";function ZA({searchInputPlaceholder:e,value:t,settings:n=vA,onChange:i=YA,onInputChange:r,onRemove:o,onCancel:s,noDirectEntry:a=!1,showSuggestions:l=!0,showInitialSuggestions:c,forceIsEditingLink:u,createSuggestion:d,withCreateSuggestion:h,inputValue:p="",suggestionsQuery:f={},noURLSuggestion:m=!1,createSuggestionButtonText:g,hasRichPreviews:b=!1,hasTextControl:y=!1,renderControlBottom:v=null,handleEntities:_=!1}){void 0===h&&d&&(h=!0);const[x,k]=(0,T.useState)(!1),[w,C]=(0,T.useState)(void 0),{advancedSettingsPreference:S}=(0,zt.A)(e=>({advancedSettingsPreference:e(Ob.M).get(JA,XA)??!1}),[]),{set:A}=(0,Vt.A)(Ob.M),I=S||x,E=(0,T.useRef)(!0),j=(0,T.useRef)(),B=(0,T.useRef)(),N=(0,T.useRef)(),R=(0,T.useRef)(),O=n.map(({id:e})=>e),[L,M,P,D,F]=function(e){const[t,n]=(0,T.useState)(e||{}),[i,r]=(0,T.useState)(e);return KA(e,i)||(r(e),n(e)),[t,n,e=>{n({...t,url:e})},e=>{n({...t,title:e})},e=>i=>{const r=Object.keys(i).reduce((t,n)=>(e.includes(n)&&(t[n]=i[n]),t),{});n({...t,...r})}]}(t),z=_&&!!L?.id,V=(0,SS.A)(ZA,"link-control"),U=z?`${V}__help`:null,$=t&&!(0,AS.A)(L,t),[H,W]=(0,T.useState)(void 0!==u?u:!t||!t.url),{createPage:G,isCreatingPage:q,errorMessage:K}=function(e){const t=(0,T.useRef)(),[n,i]=(0,T.useState)(!1),[r,o]=(0,T.useState)(null);return(0,T.useEffect)(()=>()=>{t.current&&t.current.cancel()},[]),{createPage:async function(n){i(!0),o(null);try{return t.current=(e=>{let t=!1;return{promise:new Promise((n,i)=>{e.then(e=>t?i({isCanceled:!0}):n(e),e=>i(t?{isCanceled:!0}:e))}),cancel(){t=!0}}})(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw o(e.message||(0,ee.__)("An unknown error occurred during creation. Please try again.")),e}finally{i(!1)}},isCreatingPage:n,errorMessage:r}}(d);(0,T.useEffect)(()=>{void 0!==u&&W(u)},[u]),(0,T.useEffect)(()=>{E.current||(hS.XC.focusable.find(j.current)[0]||j.current).focus()},[H,q]),(0,T.useEffect)(()=>(E.current=!1,()=>{E.current=!0}),[]);const Y=(0,T.useRef)();(0,T.useEffect)(()=>{void 0!==Y.current?Y.current!==p&&(console.warn("LinkControl: The inputValue prop is uncontrolled and only sets the initial value. onInputChange is an observer for the input value. Changes to inputValue from the parent will not update the search input."),Y.current=p):Y.current=p},[p]),(0,T.useEffect)(()=>{if("invalid"===w?.type){const e=N.current;e&&"function"==typeof e.reportValidity&&e.reportValidity()}},[w]);const J=t?.url?.trim()?.length>0,X=()=>{W(!1)},Z=e=>{const t={type:"invalid",message:(0,ee.__)("Please enter a valid URL.")},n={type:"valid"},i=e?.trim();if(!i?.length||!AA(i))return t;if(CA(i)||SA(i))return n;const r=(0,jS.i)(i);return(0,TS.m)(r)?n:t},Q=()=>{(()=>{if(re)return!1;const e=ie.trim();if(L&&L.id&&L.type&&!yA.includes(L.type)&&t?.url===e)return C(void 0),!0;const n=Z(ie);return"invalid"===n.type?(C(n),!1):(C(void 0),!0)})()&&($&&i({...t,...L,url:IA(ie).url}),X(),C(void 0))},[te,ne]=(0,T.useState)(!1);(0,T.useEffect)(()=>{te&&(N.current?.focus(),ne(!1))},[te]);const ie=void 0!==L?.url?L.url:p||"",re=!ie?.trim()?.length;(0,T.useEffect)(()=>{C(void 0)},[ie]);const oe=o&&t&&!H&&!q,se=H&&J,ae=J&&y,le=(H||!t)&&!q,ce=re||!!w||t&&!$,ue=!!n?.length&&H&&J,de=(0,T.useMemo)(()=>"taxonomy"===t?.kind&&!t?.url&&R.current?{...t,url:R.current}:t,[t]);return(0,Er.jsxs)("div",{tabIndex:-1,ref:j,className:"block-editor-link-control",children:[q&&(0,Er.jsxs)("div",{className:"block-editor-link-control__loading",children:[(0,Er.jsx)(TC.Ay,{})," ",(0,ee.__)("Creating"),"…"]}),le&&(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsxs)("div",{className:(0,mh.A)({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":ae,"has-actions":se}),children:[ae&&(0,Er.jsx)(kS.A,{ref:B,className:"block-editor-link-control__field block-editor-link-control__text-content",label:(0,ee.__)("Text"),value:L?.title,onChange:D,onKeyDown:e=>{const{keyCode:t}=e;t!==Rt.Fm||re||(e.preventDefault(),Q())},__next40pxDefaultSize:!0}),(0,Er.jsx)(RA,{ref:N,currentLink:t,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:e,value:ie,withCreateSuggestion:h,onCreateSuggestion:G,onChange:e=>{P(e),r?.(e)},onSelect:e=>{if(!(e&&e.id&&e.type)||yA.includes(e.type)){const t=e?.url||ie,n=Z(t);if("invalid"===n.type)return void C(n);const{url:i}=IA(t);e={...e,url:i}}"taxonomy"===e?.kind&&e?.url&&(R.current=e.url);const t=Object.keys(e).reduce((t,n)=>(O.includes(n)||(t[n]=e[n]),t),{});i({...L,...t,title:L?.title||e?.title}),C(void 0),X()},showInitialSuggestions:c,allowDirectEntry:!a,showSuggestions:l,suggestionsQuery:f,withURLSuggestion:!m,createSuggestionButtonText:g,hideLabelFromVision:!ae,isEntity:z,customValidity:w,suffix:(0,Er.jsx)(QA,{isEntity:z,showActions:se,isDisabled:ce,onUnlink:()=>{const{id:e,kind:t,type:n,...i}=L;M({...i,id:void 0,kind:void 0,type:void 0,url:void 0}),ne(!0)},onSubmit:Q,helpTextId:U})}),z&&U&&(0,Er.jsx)("p",{id:U,className:"block-editor-link-control__help",children:(0,ee.sprintf)((0,ee.__)("Synced with the selected %s."),L?.type||"item")})]}),K&&(0,Er.jsx)(wS.A,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1,children:K})]}),t&&!H&&!q&&(0,Er.jsx)(HA,{value:de,onEditClick:()=>W(!0),hasRichPreviews:b,hasUnlinkControl:oe,onRemove:()=>{o(),W(!0)}},de?.url),ue&&(0,Er.jsx)("div",{className:"block-editor-link-control__tools",children:!re&&(0,Er.jsx)(MS,{settingsOpen:I,setSettingsOpen:e=>{A&&A(JA,XA,e),k(e)},children:(0,Er.jsx)(qA,{value:L,settings:n,onChange:F(O)})})}),se&&(0,Er.jsxs)(Cw.A,{justify:"right",className:"block-editor-link-control__search-actions",children:[(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:e=>{e.preventDefault(),e.stopPropagation(),M(t),C(void 0),J?X():o?.(),s?.()},children:(0,ee.__)("Cancel")}),(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,variant:"primary",onClick:ce?YA:Q,className:"block-editor-link-control__search-submit","aria-disabled":ce,children:(0,ee.__)("Apply")})]}),!q&&v&&v()]})}function QA({isEntity:e,showActions:t,isDisabled:n,onUnlink:i,onSubmit:r,helpTextId:o}){return e?(0,Er.jsx)(fv.Ay,{icon:IS.A,onClick:i,"aria-describedby":o,showTooltip:!0,label:(0,ee.__)("Unsync and edit"),__next40pxDefaultSize:!0}):t?void 0:(0,Er.jsx)(CS.A,{variant:"control",children:(0,Er.jsx)(fv.Ay,{onClick:n?YA:r,label:(0,ee.__)("Submit"),icon:ES.A,className:"block-editor-link-control__search-submit","aria-disabled":n,size:"small"})})}ZA.ViewerFill=zA,ZA.DEFAULT_LINK_SETTINGS=vA;var eI=e=>((0,Qt.A)("wp.blockEditor.__experimentalLinkControl",{since:"6.8",alternative:"wp.blockEditor.LinkControl"}),(0,Er.jsx)(ZA,{...e}));eI.ViewerFill=ZA.ViewerFill,eI.DEFAULT_LINK_SETTINGS=ZA.DEFAULT_LINK_SETTINGS;var tI=ZA;function nI(e,t,n){if(n)return n;if(!t||"object"!=typeof t||0===Object.keys(t).length)return e&&e.length>0?e.map(e=>`${e}/*`).join(","):void 0;if(!e||0===e.length)return;const i=[];for(const[,n]of Object.entries(t))e.some(e=>e.includes("/")?n===e:n.startsWith(`${e}/`))&&i.push(n);return i.length>0?i.join(","):e.map(e=>`${e}/*`).join(",")}var iI=()=>{},rI=0,oI=(0,z.A)([(0,bS.A)(e=>{const{createNotice:t,removeNotice:n}=e(Rb.store);return{createNotice:t,removeNotice:n}}),gS("editor.MediaReplaceFlow")])(({mediaURL:e,mediaId:t,mediaIds:n,allowedTypes:i,accept:r,onError:o,onSelect:s,onSelectURL:a,onReset:l,onToggleFeaturedImage:c,useFeaturedImage:u,onFilesUpload:d=iI,name:h=(0,ee.__)("Replace"),createNotice:p,removeNotice:f,children:m,multiple:g=!1,addToGallery:b,handleUpload:y=!0,variant:v,popoverProps:_,renderToggle:x,className:k})=>{const{mediaUpload:w,allowedMimeTypes:C}=(0,zt.A)(e=>{const{getSettings:t}=e(Qy),n=t();return{mediaUpload:n.mediaUpload,allowedMimeTypes:n.allowedMimeTypes}},[]),S="block-editor/media-replace-flow/error-notice/"+ ++rI,A=(0,T.useMemo)(()=>nI(i,C,r),[i,C,r]),I=e=>{const t=ae(e);o?o(t):setTimeout(()=>{p("error",t,{speak:!0,id:S,isDismissible:!0})},1e3)},E=(e,t)=>{u&&c&&c(),t(),s(e),(0,dt.L)((0,ee.__)("The media file has been replaced")),f(S)},j=e=>{e.keyCode===Rt.PX&&(e.preventDefault(),e.target.click())},B=g&&!(!i||0===i.length)&&i.every(e=>"image"===e||e.startsWith("image/")),N={..._,variant:v};return(0,Er.jsx)(wC.A,{popoverProps:N,className:k,contentClassName:(0,mh.A)("block-editor-media-replace-flow__options",v&&`is-variant-${v}`),renderToggle:({isOpen:e,onToggle:t})=>x?x({"aria-expanded":e,"aria-haspopup":"true",onClick:t,onKeyDown:j,children:h}):(0,Er.jsx)(vv,{"aria-expanded":e,"aria-haspopup":"true",onClick:t,onKeyDown:j,children:h}),renderContent:({onClose:r})=>(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsxs)(pS.Ay,{className:"block-editor-media-replace-flow__media-upload-menu",children:[(0,Er.jsxs)(xS,{children:[(0,Er.jsx)(_S,{gallery:B,addToGallery:b,multiple:g,value:g?n:t,onSelect:e=>E(e,r),allowedTypes:i,render:({open:e})=>(0,Er.jsx)(zv.A,{icon:yS.A,onClick:e,children:(0,ee.__)("Open Media Library")})}),(0,Er.jsx)(fS,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!y)return t(),s(n);d(n),w({allowedTypes:i,filesList:n,onFileChange:([e])=>{E(e,t)},onError:I})})(e,r)},accept:A,multiple:!!g,render:({openFileDialog:e})=>(0,Er.jsx)(zv.A,{icon:BC.A,onClick:()=>{e()},children:(0,ee._x)("Upload","verb")})})]}),c&&(0,Er.jsx)(zv.A,{icon:vS.A,onClick:c,isPressed:u,children:(0,ee.__)("Use featured image")}),"function"==typeof m?m({onClose:r}):m,e&&l&&(0,Er.jsx)(zv.A,{onClick:()=>{l(),r()},children:(0,ee.__)("Reset")})]}),a&&(0,Er.jsxs)("form",{className:"block-editor-media-flow__url-input",children:[(0,Er.jsx)("span",{className:"block-editor-media-replace-flow__image-url-label",children:(0,ee.__)("Current media URL:")}),(0,Er.jsx)(tI,{value:{url:e},settings:[],showSuggestions:!1,onChange:({url:e})=>{a(e)},searchInputPlaceholder:(0,ee.__)("Paste or type URL")})]})]})})}),sI="image",aI={placement:"left-start",offset:36,shift:!0,className:"block-editor-global-styles-background-panel__popover"},lI=()=>{},cI=e=>{window.requestAnimationFrame(()=>{const[t]=hS.XC.tabbable.find(e?.current);t&&t.focus()})};function uI(e){return"cover"===e||void 0===e?(0,ee.__)("Image covers the space evenly."):"contain"===e?(0,ee.__)("Image is contained without distortion."):(0,ee.__)("Image has a fixed width.")}var dI=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 hI({as:e="span",imgUrl:t,toggleProps:n={},filename:i,label:r,onToggleCallback:o=lI}){const{isOpen:s,...a}=n;(0,T.useEffect)(()=>{void 0!==s&&o(s)},[s,o]);const l=()=>(0,Er.jsxs)(Cw.A,{className:"block-editor-global-styles-background-panel__inspector-preview-inner",children:[(0,Er.jsx)("span",{className:"block-editor-global-styles-background-panel__inspector-image-indicator",style:{backgroundImage:t?`url(${t})`:void 0}}),(0,Er.jsxs)(_C.A,{children:[(0,Er.jsx)(xC.A,{numberOfLines:1,className:"block-editor-global-styles-background-panel__inspector-media-replace-title",children:r}),(0,Er.jsx)(kC.A,{as:"span",children:t?(0,ee.sprintf)((0,ee.__)("Background image: %s"),i||r):(0,ee.__)("No background image selected")})]})]});return"button"===e?(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,...a,children:l()}):l()}function pI({label:e,filename:t,url:n,children:i,onToggle:r=lI,hasImageValue:o,onReset:s,containerRef:a}){if(!o)return;const l=e||(0,dS.e)(n)||(0,ee.__)("Image");return(0,Er.jsx)(wC.A,{popoverProps:aI,renderToggle:({onToggle:e,isOpen:i})=>{const o={onClick:e,className:"block-editor-global-styles-background-panel__dropdown-toggle","aria-expanded":i,"aria-label":(0,ee.__)("Background size, position and repeat options."),isOpen:i};return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(hI,{imgUrl:n,filename:t,label:l,toggleProps:o,as:"button",onToggleCallback:r}),s&&(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,label:(0,ee.__)("Reset"),className:"block-editor-global-styles-background-panel__reset",size:"small",icon:uS.A,onClick:()=>{s(),i&&e(),cI(a)}})]})},renderContent:()=>(0,Er.jsx)(CC.A,{className:"block-editor-global-styles-background-panel__dropdown-content-wrapper",paddingSize:"medium",children:i})})}function fI(){return(0,Er.jsx)(jC,{className:"block-editor-global-styles-background-panel__loading",children:(0,Er.jsx)(TC.Ay,{})})}function mI({onChange:e,style:t,inheritedValue:n,onRemoveImage:i=lI,onResetImage:r=lI,displayInPanel:o,defaultValues:s,containerRef:a}){const[l,c]=(0,T.useState)(!1),{getSettings:u}=(0,zt.A)(Qy),{id:d,title:h,url:p}=t?.background?.backgroundImage||{...n?.background?.backgroundImage},{createErrorNotice:f}=(0,Vt.A)(Rb.store),m=e=>{f(e,{type:"snackbar"}),c(!1)},g=n=>{if(!n||!n.url)return e(_p(t,["background","backgroundImage"],void 0)),void c(!1);if(Fs(n.url))return void c(!0);if(n.media_type&&n.media_type!==sI||!n.media_type&&n.type&&n.type!==sI)return void m((0,ee.__)("Only images can be used as a background image."));const i=t?.background?.backgroundSize||s?.backgroundSize,r=t?.background?.backgroundPosition;e(_p(t,["background"],{...t?.background,backgroundImage:{url:n.url,id:n.id,source:"file",title:n.title||void 0},backgroundPosition:r||"auto"!==i&&i?r:"50% 0",backgroundSize:i})),c(!1),cI(a)},b=!YE(t)&&YE(n),y=h||(0,dS.e)(p)||(0,ee.__)("Image");return(0,Er.jsxs)("div",{className:"block-editor-global-styles-background-panel__image-tools-panel-item",children:[l&&(0,Er.jsx)(fI,{}),(0,Er.jsx)(oI,{mediaId:d,mediaURL:p,allowedTypes:[sI],accept:"image/*",onSelect:g,popoverProps:{className:(0,mh.A)({"block-editor-global-styles-background-panel__media-replace-popover":o})},name:(0,Er.jsx)(hI,{imgUrl:p,filename:h,label:y}),renderToggle:e=>(0,Er.jsx)(fv.Ay,{...e,__next40pxDefaultSize:!0}),onError:m,onReset:()=>{cI(a),r()},children:b&&(0,Er.jsx)(zv.A,{onClick:()=>{cI(a),e(_p(t,["background"],{backgroundImage:"none"})),i()},children:(0,ee.__)("Remove")})}),(0,Er.jsx)(LC,{onFilesDrop:e=>{u().mediaUpload({allowedTypes:[sI],filesList:e,onFileChange([e]){g(e)},onError:m,multiple:!1})},label:(0,ee.__)("Drop to upload")})]})}function gI({onChange:e,style:t,inheritedValue:n,defaultValues:i}){const r=t?.background?.backgroundSize||n?.background?.backgroundSize,o=t?.background?.backgroundRepeat||n?.background?.backgroundRepeat,s=t?.background?.backgroundImage?.url||n?.background?.backgroundImage?.url,a=t?.background?.backgroundImage?.id,l=t?.background?.backgroundPosition||n?.background?.backgroundPosition,c=t?.background?.backgroundAttachment||n?.background?.backgroundAttachment;let u=!r&&a?i?.backgroundSize:r||"auto";u=["cover","contain","auto"].includes(u)?u:"auto";const d=!("no-repeat"===o||"cover"===u&&void 0===o),h=n=>{let i=o,r=l;"contain"===n&&(i="no-repeat",r=void 0),"cover"===n&&(i=void 0,r=void 0),"cover"!==u&&"contain"!==u||"auto"!==n||(i=void 0,t?.background?.backgroundImage?.id&&(r="50% 0")),n||"auto"!==u||(n="auto"),e(_p(t,["background"],{...t?.background,backgroundPosition:r,backgroundRepeat:i,backgroundSize:n}))},p=!l&&a&&"contain"===r?i?.backgroundPosition:l;return(0,Er.jsxs)(Q_.A,{spacing:3,className:"single-column",children:[(0,Er.jsx)(cS,{label:(0,ee.__)("Focal point"),url:s,value:dI(p),onChange:n=>{e(_p(t,["background","backgroundPosition"],(e=>{if(!(!e||isNaN(e.x)&&isNaN(e.y)))return`${100*(isNaN(e.x)?.5:e.x)}% ${100*(isNaN(e.y)?.5:e.y)}%`})(n)))}}),(0,Er.jsx)(Zv.A,{label:(0,ee.__)("Fixed background"),checked:"fixed"===c,onChange:()=>e(_p(t,["background","backgroundAttachment"],"fixed"===c?"scroll":"fixed"))}),(0,Er.jsxs)(Jv.A,{size:"__unstable-large",label:(0,ee.__)("Size"),value:u,onChange:h,isBlock:!0,help:uI(r||i?.backgroundSize),children:[(0,Er.jsx)(bk.A,{value:"cover",label:(0,ee._x)("Cover","Size option for background image control")},"cover"),(0,Er.jsx)(bk.A,{value:"contain",label:(0,ee._x)("Contain","Size option for background image control")},"contain"),(0,Er.jsx)(bk.A,{value:"auto",label:(0,ee._x)("Tile","Size option for background image control")},"tile")]}),(0,Er.jsxs)(Cw.A,{justify:"flex-start",spacing:2,as:"span",children:[(0,Er.jsx)(vx,{"aria-label":(0,ee.__)("Background image width"),onChange:h,value:r,size:"__unstable-large",__unstableInputWidth:"100px",min:0,placeholder:(0,ee.__)("Auto"),disabled:"auto"!==u||void 0===u}),(0,Er.jsx)(Zv.A,{label:(0,ee.__)("Repeat"),checked:d,onChange:()=>e(_p(t,["background","backgroundRepeat"],!0===d?"no-repeat":"repeat")),disabled:"cover"===u})]})]})}function bI({value:e,onChange:t,inheritedValue:n=e,settings:i,defaultValues:r={}}){const{globalStyles:o,_links:s}=(0,zt.A)(e=>{const{getSettings:t}=e(Qy),n=t();return{globalStyles:n[Rh],_links:n[Oh]}},[]),a=(0,T.useMemo)(()=>{const e={background:{}};return n?.background?(Object.entries(n?.background).forEach(([t,n])=>{e.background[t]=bC(n,{styles:o,_links:s})}),e):n},[o,s,n]),l=()=>t(_p(e,["background"],{})),{title:c,url:u}=e?.background?.backgroundImage||{...a?.background?.backgroundImage},d=YE(e)||YE(a),h=d&&"none"!==(e?.background?.backgroundImage||n?.background?.backgroundImage)&&(i?.background?.backgroundSize||i?.background?.backgroundPosition||i?.background?.backgroundRepeat),[p,f]=(0,T.useState)(!1),m=(0,T.useRef)();return(0,Er.jsx)("div",{ref:m,className:(0,mh.A)("block-editor-global-styles-background-panel__inspector-media-replace-container",{"is-open":p}),children:h?(0,Er.jsx)(pI,{label:c,filename:c,url:u,onToggle:f,hasImageValue:d,onReset:l,containerRef:m,children:(0,Er.jsxs)(Q_.A,{spacing:3,className:"single-column",children:[(0,Er.jsx)(mI,{onChange:t,style:e,inheritedValue:a,displayInPanel:!0,onResetImage:()=>{f(!1),l()},onRemoveImage:()=>f(!1),defaultValues:r,containerRef:m}),(0,Er.jsx)(gI,{onChange:t,style:e,defaultValues:r,inheritedValue:a})]})}):(0,Er.jsx)(mI,{onChange:t,style:e,inheritedValue:a,defaultValues:r,onResetImage:()=>{f(!1),l()},onRemoveImage:()=>f(!1),containerRef:m})})}var yI=n(90679),vI=(0,ex.A)("div",{target:"ebn2ljm1"})("&:not( :first-of-type ){",({offsetAmount:e})=>(0,tx.AH)({marginInlineStart:e},"",""),";}",({zIndex:e})=>(0,tx.AH)({zIndex:e},"",""),";"),_I={name:"rs0gp6",styles:"grid-row-start:1;grid-column-start:1"},xI=(0,ex.A)("div",{target:"ebn2ljm0"})("display:inline-grid;grid-auto-flow:column;position:relative;&>",vI,"{position:relative;justify-self:start;",({isLayered:e})=>e?_I:void 0,";}"),kI=(0,Dw.KZ)(function(e,t){const{children:n,className:i,isLayered:r=!0,isReversed:o=!1,offset:s=0,...a}=(0,Mw.A)(e,"ZStack"),l=(0,yI.a)(n),c=l.length-1,u=l.map((e,t)=>{const n=o?c-t:t,i=r?s*t:s,a=(0,T.isValidElement)(e)?e.key:t;return(0,Er.jsx)(vI,{offsetAmount:i,zIndex:n,children:e},a)});return(0,Er.jsx)(xI,{...a,className:i,isLayered:r,ref:t,children:u})},"ZStack"),wI=kI,CI=n(34942),SI=n(85386),AI=(0,T.createContext)({});AI.displayName="CircularOptionPickerContext";var II=n(11056),EI=(0,T.forwardRef)(function(e,t){const{isPressed:n,label:i,...r}=e;return(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,...r,"aria-pressed":n,ref:t,label:i})}),jI=(0,T.forwardRef)(function(e,t){const{id:n,isSelected:i,label:r,...o}=e,{setActiveId:s,activeId:a}=(0,T.useContext)(AI);return(0,T.useEffect)(()=>{i&&!a&&window.setTimeout(()=>s?.(n),0)},[i,s,a,n]),(0,Er.jsx)(II.e.Item,{render:(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,...o,role:"option","aria-selected":!!i,ref:t,label:r}),id:n})});function TI(e){const{actions:t,options:n,baseId:i,className:r,loop:o=!0,children:s,...a}=e,[l,c]=(0,T.useState)(void 0),u=(0,T.useMemo)(()=>({baseId:i,activeId:l,setActiveId:c}),[i,l,c]);return(0,Er.jsx)("div",{className:r,children:(0,Er.jsxs)(AI.Provider,{value:u,children:[(0,Er.jsx)(II.e,{...a,id:i,focusLoop:o,rtl:(0,ee.isRTL)(),role:"listbox",activeId:l,setActiveId:c,children:n}),s,t]})})}function BI(e){const{actions:t,options:n,children:i,baseId:r,...o}=e,s=(0,T.useMemo)(()=>({baseId:r}),[r]);return(0,Er.jsx)("div",{...o,role:"group",id:r,children:(0,Er.jsxs)(AI.Provider,{value:s,children:[n,i,t]})})}function NI(e){const{asButtons:t,actions:n,options:i,children:r,className:o,...s}=e,a=(0,SS.A)(NI,"components-circular-option-picker",s.id),l=t?BI:TI,c=n?(0,Er.jsx)("div",{className:"components-circular-option-picker__custom-clear-wrapper",children:n}):void 0,u=(0,Er.jsx)("div",{className:"components-circular-option-picker__swatches",children:i});return(0,Er.jsx)(l,{...s,baseId:a,className:(0,mh.A)("components-circular-option-picker",o),actions:c,options:u,children:r})}NI.Option=function e({className:t,isSelected:n,selectedIconProps:i={},tooltipText:r,...o}){const{baseId:s,setActiveId:a}=(0,T.useContext)(AI),l={id:(0,SS.A)(e,s||"components-circular-option-picker__option"),className:"components-circular-option-picker__option",...o},c=void 0!==a?(0,Er.jsx)(jI,{...l,label:r,isSelected:n}):(0,Er.jsx)(EI,{...l,label:r,isPressed:n});return(0,Er.jsxs)("div",{className:(0,mh.A)(t,"components-circular-option-picker__option-wrapper"),children:[c,n&&(0,Er.jsx)(xx.A,{icon:xw.A,...i})]})},NI.OptionGroup=function({className:e,options:t,...n}){const i="aria-label"in n||"aria-labelledby"in n?"group":void 0;return(0,Er.jsx)("div",{...n,role:i,className:(0,mh.A)("components-circular-option-picker__option-group","components-circular-option-picker__swatches",e),children:t})},NI.ButtonAction=function({className:e,children:t,...n}){return(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,className:(0,mh.A)("components-circular-option-picker__clear",e),variant:"tertiary",...n,children:t})},NI.DropdownLinkAction=function({buttonProps:e,className:t,dropdownProps:n,linkText:i}){return(0,Er.jsx)(wC.A,{className:(0,mh.A)("components-circular-option-picker__dropdown-link-action",t),renderToggle:({isOpen:t,onToggle:n})=>(0,Er.jsx)(fv.Ay,{"aria-expanded":t,"aria-haspopup":"true",onClick:n,variant:"link",...e,children:i}),...n})},NI.displayName="CircularOptionPicker";var RI=NI;function OI(e,t,n,i){return{metaProps:e?{asButtons:!0}:{asButtons:!1,loop:t},labelProps:{"aria-labelledby":i,"aria-label":i?void 0:n||(0,ee.__)("Custom color picker")}}}var LI=(0,ex.A)(Sw.A,{target:"ev9wop70"})("text-transform:uppercase;line-height:24px;font-weight:",rx.A.fontWeightMedium,";&&&{font-size:11px;margin-bottom:0;}");(0,te.X$)([ne.A,ie.A]);var MI=e=>{const t=/var\(/.test(e??""),n=/color-mix\(/.test(e??"");return!t&&!n},PI=e=>e.length>0&&e.every(e=>{return t=e,Array.isArray(t.colors)&&!("color"in t);var t});function DI({className:e,clearColor:t,colors:n,onChange:i,value:r,...o}){const s=(0,T.useMemo)(()=>n.map(({color:e,name:n},o)=>{const s=(0,te.Mj)(e),a=r===e;return(0,Er.jsx)(RI.Option,{isSelected:a,selectedIconProps:a?{fill:s.contrast()>s.contrast("#000")?"#fff":"#000"}:{},tooltipText:n||(0,ee.sprintf)((0,ee.__)("Color code: %s"),e),style:{backgroundColor:e,color:e},onClick:a?t:()=>i(e,o)},`${e}-${o}`)}),[n,r,i,t]);return(0,Er.jsx)(RI.OptionGroup,{className:e,options:s,...o})}function FI({className:e,clearColor:t,colors:n,onChange:i,value:r,headingLevel:o}){const s=(0,SS.A)(FI,"color-palette");return 0===n.length?null:(0,Er.jsx)(Q_.A,{spacing:3,className:e,children:n.map(({name:e,colors:n},a)=>{const l=`${s}-${a}`;return(0,Er.jsxs)(Q_.A,{spacing:2,children:[(0,Er.jsx)(LI,{id:l,level:o,children:e}),(0,Er.jsx)(DI,{clearColor:t,colors:n,onChange:e=>i(e,a),value:r,"aria-labelledby":l})]},a)})})}function zI({isRenderedInSidebar:e,popoverProps:t,...n}){const i=(0,T.useMemo)(()=>({shift:!0,resize:!1,...e?{placement:"left-start",offset:34}:{placement:"bottom",offset:8},...t}),[e,t]);return(0,Er.jsx)(wC.A,{contentClassName:"components-color-palette__custom-color-dropdown-content",popoverProps:i,...n})}(0,te.X$)([ne.A,ie.A]);var VI=(0,T.forwardRef)(function(e,t){const{asButtons:n,loop:i,clearable:r=!0,colors:o=[],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,T.useState)(c),b=(0,T.useCallback)(()=>l(void 0),[l]),y=(0,T.useCallback)(e=>{g(((e,t)=>{if(!e||!t||MI(e))return e;const{ownerDocument:n}=t,{defaultView:i}=n,r=i?.getComputedStyle(t).backgroundColor;return r?(0,te.Mj)(r).toHex():e})(c,e))},[c]),v=PI(o),_=(0,T.useMemo)(()=>((e,t=[],n=!1)=>{if(!e)return"";const i=!!e&&MI(e),r=i?(0,te.Mj)(e).toHex():e,o=n?t:[{colors:t}];for(const{colors:e}of o)for(const{name:t,color:n}of e)if(r===(i?(0,te.Mj)(n).toHex():n))return t;return(0,ee.__)("Custom")})(c,o,v),[c,o,v]),x=c?.startsWith("#"),k=c?.replace(/^var\((.+)\)$/,"$1"),w=k?(0,ee.sprintf)((0,ee.__)('Custom color picker. The currently selected color is called "%1$s" and has a value of "%2$s".'),_,k):(0,ee.__)("Custom color picker"),C={clearColor:b,onChange:l,value:c},S=!!r&&(0,Er.jsx)(RI.ButtonAction,{onClick:b,accessibleWhenDisabled:!0,disabled:!c,children:(0,ee.__)("Clear")}),{metaProps:A,labelProps:I}=OI(n,i,h,p);return(0,Er.jsxs)(Q_.A,{spacing:3,ref:t,...f,children:[!s&&(0,Er.jsx)(zI,{isRenderedInSidebar:u,renderContent:()=>(0,Er.jsx)(CC.A,{paddingSize:"none",children:(0,Er.jsx)(SI.V,{color:m,onChange:e=>l(e),enableAlpha:a})}),renderToggle:({isOpen:e,onToggle:t})=>(0,Er.jsxs)(Q_.A,{className:"components-color-palette__custom-color-wrapper",spacing:0,children:[(0,Er.jsx)("button",{ref:y,className:"components-color-palette__custom-color-button","aria-expanded":e,"aria-haspopup":"true",onClick:t,"aria-label":w,style:{background:c},type:"button"}),(0,Er.jsxs)(Q_.A,{className:"components-color-palette__custom-color-text-wrapper",spacing:.5,children:[(0,Er.jsx)(xC.A,{className:"components-color-palette__custom-color-name",children:c?_:(0,ee.__)("No color selected")}),(0,Er.jsx)(xC.A,{className:(0,mh.A)("components-color-palette__custom-color-value",{"components-color-palette__custom-color-value--is-hex":x}),children:k})]})]})}),(o.length>0||S)&&(0,Er.jsx)(RI,{...A,...I,actions:S,options:v?(0,Er.jsx)(FI,{...C,headingLevel:d,colors:o,value:c}):(0,Er.jsx)(DI,{...C,colors:o,value:c})})]})});VI.displayName="ColorPalette";var UI=VI,$I=n(13911);if("undefined"!=typeof document&&!document.head.querySelector("style[data-wp-hash='e91ec3f005']")){const e=document.createElement("style");e.setAttribute("data-wp-hash","e91ec3f005"),e.appendChild(document.createTextNode("._8f57b8d483c51fbe__circle-root{border:1px solid var(--wp-components-color-gray-600,#949494);border-radius:50%;box-sizing:border-box;cursor:grab;height:32px;overflow:hidden;width:32px}._8f57b8d483c51fbe__circle-root:active{cursor:grabbing}.b1bae984ac10fcc3__circle-indicator-wrapper{box-sizing:border-box;height:100%;position:relative;width:100%}.b1bae984ac10fcc3__circle-indicator-wrapper:focus-visible{outline:none}._6d2fe0a2cbb31bf0__circle-indicator{background:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));border-radius:50%;box-sizing:border-box;display:block;height:6px;left:50%;position:absolute;top:4px;transform:translateX(-50%);width:6px}")),document.head.appendChild(e)}var HI=function({value:e,onChange:t,className:n,...i}){const r=(0,T.useRef)(null),o=(0,T.useRef)(void 0),s=(0,T.useRef)(void 0),a=e=>{if(void 0!==e&&(e.preventDefault(),e.target?.focus(),void 0!==o.current&&void 0!==t)){const{x:n,y:i}=o.current;t(function(e,t,n,i){const r=i-t,o=n-e,s=Math.atan2(r,o),a=Math.round(s*(180/Math.PI))+90;return a<0?360+a:a}(n,i,e.clientX,e.clientY))}},{startDrag:l,isDragging:c}=PC({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}})(),a(e)},onDragMove:a,onDragEnd:a});return(0,T.useEffect)(()=>{c?(void 0===s.current&&(s.current=document.body.style.cursor),document.body.style.cursor="grabbing"):(document.body.style.cursor=s.current||"",s.current=void 0)},[c]),(0,Er.jsx)("div",{ref:r,onMouseDown:l,className:(0,mh.A)("components-angle-picker-control__angle-circle","_8f57b8d483c51fbe__circle-root",n),...i,children:(0,Er.jsx)("div",{style:e?{transform:`rotate(${e}deg)`}:void 0,className:(0,mh.A)("components-angle-picker-control__angle-circle-indicator-wrapper","b1bae984ac10fcc3__circle-indicator-wrapper"),tabIndex:-1,children:(0,Er.jsx)("div",{className:(0,mh.A)("components-angle-picker-control__angle-circle-indicator","_6d2fe0a2cbb31bf0__circle-indicator")})})})},WI=(0,T.forwardRef)(function(e,t){const{className:n,label:i=(0,ee.__)("Angle"),onChange:r,value:o,...s}=e,a=(0,mh.A)("components-angle-picker-control",n),l=(0,ee.isRTL)()?{prefix:(0,Er.jsx)(_x.A,{children:"°"})}:{suffix:(0,Er.jsx)(CS.A,{children:"°"})};return(0,Er.jsxs)(Kv.A,{...s,ref:t,className:a,gap:2,children:[(0,Er.jsx)(_C.A,{children:(0,Er.jsx)(ox.A,{__next40pxDefaultSize:!0,label:i,className:"components-angle-picker-control__input-field",max:360,min:0,onChange:e=>{if(void 0===r)return;const t=void 0!==e&&""!==e?parseInt(e,10):0;r(t)},step:"1",value:o,spinControls:"none",...l})}),(0,Er.jsx)($I.A,{marginBottom:"1",marginTop:"auto",children:(0,Er.jsx)(HI,{"aria-hidden":"true",value:o,onChange:r})})]})});WI.displayName="AnglePickerControl";var GI=WI;function qI(e){return Math.max(0,Math.min(100,e))}function KI(e,t,n){const i=e.slice();return i[t]=n,i}function YI(e,t,n){return function(e,t,n,i=0){const r=e[t].position,o=Math.min(r,n),s=Math.max(r,n);return e.some(({position:e},r)=>r!==t&&(Math.abs(e-n)<i||o<e&&e<s))}(e,t,n)?e:KI(e,t,{...e[t],position:n})}function JI(e,t,n){return KI(e,t,{...e[t],color:n})}function XI(e,t){if(!t)return;const{x:n,width:i}=t.getBoundingClientRect(),r=e-n;return Math.round(qI(100*r/i))}function ZI({isOpen:e,position:t,color:n,...i}){const r=`components-custom-gradient-picker__control-point-button-description-${(0,SS.A)(ZI)}`;return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(fv.Ay,{"aria-label":(0,ee.sprintf)((0,ee.__)("Gradient control point at position %1$d%% with color code %2$s."),t,n),"aria-describedby":r,"aria-haspopup":"true","aria-expanded":e,__next40pxDefaultSize:!0,className:(0,mh.A)("components-custom-gradient-picker__control-point-button",{"is-active":e}),...i}),(0,Er.jsx)(kC.A,{id:r,children:(0,ee.__)("Use your left or right arrow keys or drag and drop with the mouse to change the gradient position. Press the button to change the color or remove the control point.")})]})}function QI({isRenderedInSidebar:e,className:t,...n}){const i=(0,T.useMemo)(()=>({placement:"bottom",offset:8,resize:!1}),[]),r=(0,mh.A)("components-custom-gradient-picker__control-point-dropdown",t);return(0,Er.jsx)(zI,{isRenderedInSidebar:e,popoverProps:i,className:r,...n})}function eE({disableRemove:e,disableAlpha:t,gradientPickerDomRef:n,ignoreMarkerPosition:i,value:r,onChange:o,onStartControlPointChange:s,onStopControlPointChange:a,__experimentalIsRenderedInSidebar:l}){const c=(0,T.useRef)(void 0),u=e=>{if(void 0===c.current||null===n.current)return;const t=XI(e.clientX,n.current),{initialPosition:i,index:s,significantMoveHappened:a}=c.current;!a&&Math.abs(i-t)>=5&&(c.current.significantMoveHappened=!0),o(YI(r,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,T.useRef)(void 0);return h.current=d,(0,T.useEffect)(()=>()=>{h.current?.()},[]),(0,Er.jsx)(Er.Fragment,{children:r.map((n,h)=>{const p=n?.position;return i!==p&&(0,Er.jsx)(QI,{isRenderedInSidebar:l,onClose:a,renderToggle:({isOpen:e,onToggle:t})=>(0,Er.jsx)(ZI,{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(),o(YI(r,h,qI(n.position-10)))):"ArrowRight"===e.code&&(e.stopPropagation(),o(YI(r,h,qI(n.position+10))))},isOpen:e,position:n.position,color:n.color},h),renderContent:({onClose:i})=>(0,Er.jsxs)(CC.A,{paddingSize:"none",children:[(0,Er.jsx)(SI.V,{enableAlpha:!t,color:n.color,onChange:e=>{o(JI(r,h,(0,te.Mj)(e).toRgbString()))}}),!e&&r.length>2&&(0,Er.jsx)(Cw.A,{className:"components-custom-gradient-picker__remove-control-point-wrapper",alignment:"center",children:(0,Er.jsx)(fv.Ay,{onClick:()=>{o(function(e,t){return e.filter((e,n)=>n!==t)}(r,h)),i()},variant:"link",children:(0,ee.__)("Remove Control Point")})})]}),style:{left:`${n.position}%`,transform:"translateX( -50% )"}},h)})})}eE.InsertPoint=function({value:e,onChange:t,onOpenInserter:n,onCloseInserter:i,insertPosition:r,disableAlpha:o,__experimentalIsRenderedInSidebar:s}){const[a,l]=(0,T.useState)(!1);return(0,Er.jsx)(QI,{isRenderedInSidebar:s,className:"components-custom-gradient-picker__inserter",onClose:()=>{i()},renderToggle:({isOpen:e,onToggle:t})=>(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,"aria-expanded":e,"aria-haspopup":"true",onClick:()=>{e?i():(l(!1),n()),t()},className:"components-custom-gradient-picker__insert-point-dropdown",icon:kw.A}),renderContent:()=>(0,Er.jsx)(CC.A,{paddingSize:"none",children:(0,Er.jsx)(SI.V,{enableAlpha:!o,onChange:n=>{a?t(function(e,t,n){const i=e.findIndex(e=>e.position===t);return JI(e,i,n)}(e,r,(0,te.Mj)(n).toRgbString())):(t(function(e,t,n){const i=e.findIndex(e=>e.position>t),r={color:n,position:t},o=e.slice();return o.splice(i-1,0,r),o}(e,r,(0,te.Mj)(n).toRgbString())),l(!0))}})}),style:null!==r?{left:`${r}%`,transform:"translateX( -50% )"}:void 0})};var tE=eE,nE=(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},iE={id:"IDLE"};function rE({background:e,hasGradient:t,value:n,onChange:i,disableInserter:r=!1,disableAlpha:o=!1,__experimentalIsRenderedInSidebar:s=!1}){const a=(0,T.useRef)(null),[l,c]=(0,T.useReducer)(nE,iE),u=e=>{if(!a.current)return;const t=XI(e.clientX,a.current);n.some(({position:e})=>Math.abs(t-e)<10)?"MOVING_INSERTER"===l.id&&c({type:"STOP_INSERTER_MOVE"}):c({type:"MOVE_INSERTER",insertPosition:t})},d="MOVING_INSERTER"===l.id,h="INSERTING_CONTROL_POINT"===l.id;return(0,Er.jsxs)("div",{className:(0,mh.A)("components-custom-gradient-picker__gradient-bar",{"has-gradient":t}),onMouseEnter:u,onMouseMove:u,onMouseLeave:()=>{c({type:"STOP_INSERTER_MOVE"})},children:[(0,Er.jsx)("div",{className:"components-custom-gradient-picker__gradient-bar-background",style:{background:e,opacity:t?1:.4}}),(0,Er.jsxs)("div",{ref:a,className:"components-custom-gradient-picker__markers-container",children:[!r&&(d||h)&&(0,Er.jsx)(tE.InsertPoint,{__experimentalIsRenderedInSidebar:s,disableAlpha:o,insertPosition:l.insertPosition,value:n,onChange:i,onOpenInserter:()=>{c({type:"OPEN_INSERTER"})},onCloseInserter:()=>{c({type:"CLOSE_INSERTER"})}}),(0,Er.jsx)(tE,{__experimentalIsRenderedInSidebar:s,disableAlpha:o,disableRemove:r,gradientPickerDomRef:a,ignoreMarkerPosition:h?l.insertPosition:void 0,value:n,onChange:i,onStartControlPointChange:()=>{c({type:"START_CONTROL_CHANGE"})},onStopControlPointChange:()=>{c({type:"STOP_CONTROL_CHANGE"})}})]})]})}var oE=n(58319),sE=n(88863),aE="linear-gradient(135deg, rgba(6, 147, 227, 1) 0%, rgb(155, 81, 224) 100%)",lE={type:"angular",value:"90"},cE=[{value:"linear-gradient",label:(0,ee.__)("Linear")},{value:"radial-gradient",label:(0,ee.__)("Radial")}],uE={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 dE({type:e,value:t,length:n}){return`${function({type:e,value:t}){if("literal"===e)return t;if("hex"===e)return`#${t}`;if("var"===e)return`var(${t})`;if("hsl"===e){const[e,n,i]=t;return`hsl(${e},${n}%,${i}%)`}if("hsla"===e){const[e,n,i,r]=t;return`hsla(${e},${n}%,${i}%,${r})`}return`${e}(${t.join(",")})`}({type:e,value:t})} ${function(e){if(!e)return"";const{value:t,type:n}=e;return"calc"===n?`calc(${t})`:`${t}${n}`}(n)}`}function hE({type:e,orientation:t,colorStops:n}){const i=function(e){if(!Array.isArray(e)&&e&&"angular"===e.type)return`${e.value}deg`}(t);return`${e}(${[i,...n.sort((e,t)=>{const n=e=>void 0===e?.length?.value?0:parseInt(e.length.value);return n(e)-n(t)}).map(dE)].filter(Boolean).join(",")})`}function pE(e){return void 0===e.length||"%"!==e.length.type}function fE(e){switch(e.type){case"hex":return`#${e.value}`;case"literal":return e.value;case"var":return`${e.type}(${e.value})`;case"rgb":case"rgba":return`${e.type}(${e.value.join(",")})`;case"hsl":{const[t,n,i]=e.value;return`hsl(${t},${n}%,${i}%)`}case"hsla":{const[t,n,i,r]=e.value;return`hsla(${t},${n}%,${i}%,${r})`}default:return"transparent"}}(0,te.X$)([ne.A]);var mE=(0,ex.A)(_C.A,{target:"e10bzpgi1"})({name:"1gvx10y",styles:"flex-grow:5"}),gE=(0,ex.A)(_C.A,{target:"e10bzpgi0"})({name:"1gvx10y",styles:"flex-grow:5"}),bE=({gradientAST:e,hasGradient:t,onChange:n})=>{const i=e?.orientation?.value??180;return(0,Er.jsx)(GI,{onChange:t=>{n(hE({...e,orientation:{type:"angular",value:`${t}`}}))},value:t?i:""})},yE=({gradientAST:e,hasGradient:t,onChange:n})=>{const{type:i}=e,r=(0,T.useRef)(Number(lE.value));return"linear-gradient"===i&&e.orientation&&(r.current=Number(e.orientation.value)),(0,Er.jsx)(oE.A,{className:"components-custom-gradient-picker__type-picker",label:(0,ee.__)("Type"),labelPosition:"top",onChange:t=>{"linear-gradient"===t&&n(hE({...e,orientation:{type:"angular",value:`${r.current}`},type:"linear-gradient"})),"radial-gradient"===t&&(()=>{const{orientation:t,...i}=e;n(hE({...i,type:"radial-gradient"}))})()},options:cE,size:"__unstable-large",value:t?i:void 0})},vE=function({value:e,onChange:t,enableAlpha:n=!0,__experimentalIsRenderedInSidebar:i=!1}){const{gradientAST:r,hasGradient:o}=function(e){let t,n=!!e;const i=e??aE;try{t=sE.parse(i)[0]}catch(e){console.warn("wp.components.CustomGradientPicker failed to parse the gradient with error",e),t=sE.parse(aE)[0],n=!1}if(Array.isArray(t.orientation)||"directional"!==t.orientation?.type||(t.orientation={type:"angular",value:uE[t.orientation.value].toString()}),t.colorStops.some(pE)){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),s=function(e){return hE({type:"linear-gradient",orientation:lE,colorStops:e.colorStops})}(r),a=r.colorStops.map(e=>({color:fE(e),position:parseInt(e.length.value)}));return(0,Er.jsxs)(Q_.A,{spacing:4,className:"components-custom-gradient-picker",children:[(0,Er.jsx)(rE,{__experimentalIsRenderedInSidebar:i,disableAlpha:!n,background:s,hasGradient:o,value:a,onChange:e=>{t(hE(function(e,t){return{...e,colorStops:t.map(({position:e,color:t})=>{const{r:n,g:i,b:r,a:o}=(0,te.Mj)(t).toRgb();return{length:{type:"%",value:e?.toString()},type:o<1?"rgba":"rgb",value:o<1?[`${n}`,`${i}`,`${r}`,`${o}`]:[`${n}`,`${i}`,`${r}`]}})}}(r,e)))}}),(0,Er.jsxs)(Kv.A,{gap:3,className:"components-custom-gradient-picker__ui-line",children:[(0,Er.jsx)(mE,{children:(0,Er.jsx)(yE,{gradientAST:r,hasGradient:o,onChange:t})}),(0,Er.jsx)(gE,{children:"linear-gradient"===r.type&&(0,Er.jsx)(bE,{gradientAST:r,hasGradient:o,onChange:t})})]})]})};function _E({className:e,clearGradient:t,gradients:n,onChange:i,value:r,...o}){const s=(0,T.useMemo)(()=>n.map(({gradient:e,name:n,slug:o},s)=>(0,Er.jsx)(RI.Option,{value:e,isSelected:r===e,tooltipText:n||(0,ee.sprintf)((0,ee.__)("Gradient code: %s"),e),style:{color:"rgba( 0,0,0,0 )",background:e},onClick:r===e?t:()=>i(e,s),"aria-label":n?(0,ee.sprintf)((0,ee.__)("Gradient: %s"),n):(0,ee.sprintf)((0,ee.__)("Gradient code: %s"),e)},o)),[n,r,i,t]);return(0,Er.jsx)(RI.OptionGroup,{className:e,options:s,...o})}function xE({className:e,clearGradient:t,gradients:n,onChange:i,value:r,headingLevel:o}){const s=(0,SS.A)(xE);return(0,Er.jsx)(Q_.A,{spacing:3,className:e,children:n.map(({name:e,gradients:n},a)=>{const l=`color-palette-${s}-${a}`;return(0,Er.jsxs)(Q_.A,{spacing:2,children:[(0,Er.jsx)(LI,{level:o,id:l,children:e}),(0,Er.jsx)(_E,{clearGradient:t,gradients:n,onChange:e=>i(e,a),value:r,"aria-labelledby":l})]},a)})})}function kE(e){const{asButtons:t,loop:n,actions:i,headingLevel:r,"aria-label":o,"aria-labelledby":s,...a}=e,l=(d=e.gradients).length>0&&d.every(e=>{return t=e,Array.isArray(t.gradients)&&!("gradient"in t);var t})?(0,Er.jsx)(xE,{headingLevel:r,...a}):(0,Er.jsx)(_E,{...a}),{metaProps:c,labelProps:u}=OI(t,n,o,s);var d;return(0,Er.jsx)(RI,{...c,...u,actions:i,options:l})}var wE=function({className:e,gradients:t=[],onChange:n,value:i,clearable:r=!0,enableAlpha:o=!0,disableCustomGradients:s=!1,__experimentalIsRenderedInSidebar:a,headingLevel:l=2,...c}){const u=(0,T.useCallback)(()=>n(void 0),[n]);return(0,Er.jsxs)(Q_.A,{spacing:t.length?4:0,children:[!s&&(0,Er.jsx)(vE,{__experimentalIsRenderedInSidebar:a,enableAlpha:o,value:i,onChange:n}),(t.length>0||r)&&(0,Er.jsx)(kE,{...c,className:e,clearGradient:u,gradients:t,onChange:n,value:i,actions:r&&!s&&(0,Er.jsx)(RI.ButtonAction,{onClick:u,accessibleWhenDisabled:!0,disabled:!i,children:(0,ee.__)("Clear")}),headingLevel:l})]})},{Tabs:CE}=Gh(Ev.j),SE=["colors","disableCustomColors","gradients","disableCustomGradients"],AE="color",IE="gradient";function EE({colors:e,gradients:t,disableCustomColors:n,disableCustomGradients:i,__experimentalIsRenderedInSidebar:r,className:o,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||!i);if(!m&&!g)return null;const b={[AE]:(0,Er.jsx)(UI,{value:c,onChange:g?e=>{a(e),l()}:a,colors:e,disableCustomColors:n,__experimentalIsRenderedInSidebar:r,clearable:d,enableAlpha:p,headingLevel:f}),[IE]:(0,Er.jsx)(wE,{value:u,onChange:m?e=>{l(e),a()}:l,gradients:t,disableCustomGradients:i,__experimentalIsRenderedInSidebar:r,clearable:d,headingLevel:f})},y=e=>(0,Er.jsx)("div",{className:"block-editor-color-gradient-control__panel",children:b[e]});return(0,Er.jsx)(mk.Ay,{className:(0,mh.A)("block-editor-color-gradient-control",o),children:(0,Er.jsx)("fieldset",{className:"block-editor-color-gradient-control__fieldset",children:(0,Er.jsxs)(Q_.A,{spacing:1,children:[h&&(0,Er.jsx)("legend",{children:(0,Er.jsx)("div",{className:"block-editor-color-gradient-control__color-indicator",children:(0,Er.jsx)(mk.Ay.VisualLabel,{children:s})})}),m&&g&&(0,Er.jsx)("div",{children:(0,Er.jsxs)(CE,{defaultTabId:u?IE:!!m&&AE,children:[(0,Er.jsxs)(CE.TabList,{children:[(0,Er.jsx)(CE.Tab,{tabId:AE,children:(0,ee.__)("Color")}),(0,Er.jsx)(CE.Tab,{tabId:IE,children:(0,ee.__)("Gradient")})]}),(0,Er.jsx)(CE.TabPanel,{tabId:AE,className:"block-editor-color-gradient-control__panel",focusable:!1,children:b.color}),(0,Er.jsx)(CE.TabPanel,{tabId:IE,className:"block-editor-color-gradient-control__panel",focusable:!1,children:b.gradient})]})}),!g&&y(AE),!m&&y(IE)]})})})}function jE(e){const[t,n,i,r]=tv("color.palette","color.gradients","color.custom","color.customGradient");return(0,Er.jsx)(EE,{colors:t,gradients:n,disableCustomColors:!i,disableCustomGradients:!r,...e})}var TE=function(e){return SE.every(t=>e.hasOwnProperty(t))?(0,Er.jsx)(EE,{...e}):(0,Er.jsx)(jE,{...e})};function BE(e){const t=NE(e),n=PE(e),i=RE(e),r=LE(e),o=ME(e),s=OE(e);return t||n||i||r||o||s}function NE(e){const t=iv(e);return e?.color?.text&&(t?.length>0||e?.color?.custom)}function RE(e){const t=iv(e);return e?.color?.link&&(t?.length>0||e?.color?.custom)}function OE(e){const t=iv(e);return e?.color?.caption&&(t?.length>0||e?.color?.custom)}function LE(e){const t=iv(e),n=rv(e);return e?.color?.heading&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function ME(e){const t=iv(e),n=rv(e);return e?.color?.button&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function PE(e){const t=iv(e),n=rv(e);return e?.color?.background&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function DE({resetAllFilter:e,onChange:t,value:n,panelId:i,children:r,label:o}){const s=Zw();return(0,Er.jsx)(Xw,{label:o||(0,ee.__)("Elements"),resetAll:()=>{const i=e(n);t(i)},panelId:i,hasInnerWrapper:!0,headingLevel:3,className:"color-block-support-panel",__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:s,children:(0,Er.jsx)("div",{className:"color-block-support-panel__inner-wrapper",children:r})})}var FE={text:!0,background:!0,link:!0,heading:!0,button:!0,caption:!0},zE={placement:"left-start",offset:36,shift:!0},{Tabs:VE}=Gh(Ev.j),UE=({indicators:e,label:t})=>(0,Er.jsxs)(Cw.A,{justify:"flex-start",children:[(0,Er.jsx)(wI,{isLayered:!1,offset:-8,children:e.map((e,t)=>(0,Er.jsx)(Kv.A,{expanded:!1,children:(0,Er.jsx)(CI.A,{colorValue:e})},t))}),(0,Er.jsx)(Yv.A,{className:"block-editor-panel-color-gradient-settings__color-name",children:t})]});function $E({isGradient:e,inheritedValue:t,userValue:n,setValue:i,colorGradientControlSettings:r}){return(0,Er.jsx)(TE,{...r,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:e?void 0:t,gradientValue:e?t:void 0,onColorChange:e?void 0:i,onGradientChange:e?i:void 0,clearable:t===n,headingLevel:3})}function HE({label:e,hasValue:t,resetValue:n,isShownByDefault:i,indicators:r,tabs:o,colorGradientControlSettings:s,panelId:a,className:l="block-editor-tools-panel-color-gradient-settings__item"}){const c=o.find(e=>void 0!==e.userValue),{key:u,...d}=o[0]??{},h=(0,T.useRef)(void 0);return(0,Er.jsx)(aC,{className:l,hasValue:t,label:e,onDeselect:n,isShownByDefault:i,panelId:a,children:(0,Er.jsx)(wC.A,{popoverProps:zE,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:({onToggle:i,isOpen:o})=>{const s={onClick:i,className:(0,mh.A)("block-editor-panel-color-gradient-settings__dropdown",{"is-open":o}),"aria-expanded":o,ref:h};return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(fv.Ay,{...s,__next40pxDefaultSize:!0,children:(0,Er.jsx)(UE,{indicators:r,label:e})}),t()&&(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,label:(0,ee.__)("Reset"),className:"block-editor-panel-color-gradient-settings__reset",size:"small",icon:uS.A,onClick:()=>{n(),o&&i(),h.current?.focus()}})]})},renderContent:()=>(0,Er.jsx)(CC.A,{paddingSize:"none",children:(0,Er.jsxs)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:[1===o.length&&(0,Er.jsx)($E,{...d,colorGradientControlSettings:s},u),o.length>1&&(0,Er.jsxs)(VE,{defaultTabId:c?.key,children:[(0,Er.jsx)(VE.TabList,{children:o.map(e=>(0,Er.jsx)(VE.Tab,{tabId:e.key,children:e.label},e.key))}),o.map(e=>{const{key:t,...n}=e;return(0,Er.jsx)(VE.TabPanel,{tabId:t,focusable:!1,children:(0,Er.jsx)($E,{...n,colorGradientControlSettings:s},t)},t)})]})]})})})})}function WE({as:e=DE,value:t,onChange:n,inheritedValue:i=t,settings:r,panelId:o,defaultControls:s=FE,label:a,children:l}){const c=iv(r),u=rv(r),d=r?.color?.custom,h=r?.color?.customGradient,p=c.length>0||d,f=u.length>0||h,m=!!r?.background?.gradient,g=f&&!m,b=e=>vC({settings:r},"",e),y=e=>{const t=c.flatMap(({colors:e})=>e).find(({color:t})=>t===e);return t?"var:preset|color|"+t.slug:e},v=e=>{const t=u.flatMap(({gradients:e})=>e).find(({gradient:t})=>t===e);return t?"var:preset|gradient|"+t.slug:e},_=PE(r),x=b(i?.color?.background),k=b(t?.color?.background),w=b(i?.color?.gradient),C=b(t?.color?.gradient),S=RE(r),A=b(i?.elements?.link?.color?.text),I=b(t?.elements?.link?.color?.text),E=b(i?.elements?.link?.[":hover"]?.color?.text),j=b(t?.elements?.link?.[":hover"]?.color?.text),B=NE(r),N=b(i?.color?.text),R=b(t?.color?.text),O=e=>{let i=_p(t,["color","text"],y(e));N===A&&(i=_p(i,["elements","link","color","text"],y(e))),n(i)},L=[{name:"caption",label:(0,ee.__)("Captions"),showPanel:OE(r)},{name:"button",label:(0,ee.__)("Button"),showPanel:ME(r)},{name:"heading",label:(0,ee.__)("Heading"),showPanel:LE(r)},{name:"h1",label:(0,ee.__)("H1"),showPanel:LE(r)},{name:"h2",label:(0,ee.__)("H2"),showPanel:LE(r)},{name:"h3",label:(0,ee.__)("H3"),showPanel:LE(r)},{name:"h4",label:(0,ee.__)("H4"),showPanel:LE(r)},{name:"h5",label:(0,ee.__)("H5"),showPanel:LE(r)},{name:"h6",label:(0,ee.__)("H6"),showPanel:LE(r)}],M=(0,T.useCallback)(e=>({...e,color:void 0,elements:{...e?.elements,link:{...e?.elements?.link,color:void 0,":hover":{color:void 0}},...L.reduce((t,n)=>({...t,[n.name]:{...e?.elements?.[n.name],color:void 0}}),{})}}),[L]),P=[B&&{key:"text",label:(0,ee.__)("Text"),hasValue:()=>!!R,resetValue:()=>O(void 0),isShownByDefault:s.text,indicators:[N],tabs:[{key:"text",label:(0,ee.__)("Text"),inheritedValue:N,setValue:O,userValue:R}]},_&&{key:"background",label:(0,ee.__)("Background"),hasValue:()=>!!k||!m&&!!C,resetValue:()=>{const e=_p(t,["color","background"],void 0);m||(e.color.gradient=void 0),n(e)},isShownByDefault:s.background,indicators:[(g?w:void 0)??x],tabs:[p&&{key:"background",label:(0,ee.__)("Color"),inheritedValue:x,setValue:e=>{const i=_p(t,["color","background"],y(e));m||(i.color.gradient=void 0),n(i)},userValue:k},g&&{key:"gradient",label:(0,ee.__)("Gradient"),inheritedValue:w,setValue:e=>{const i=_p(t,["color","gradient"],v(e));i.color.background=void 0,n(i)},userValue:C,isGradient:!0}].filter(Boolean)},S&&{key:"link",label:(0,ee.__)("Link"),hasValue:()=>!!I||!!j,resetValue:()=>{let e=_p(t,["elements","link",":hover","color","text"],void 0);e=_p(e,["elements","link","color","text"],void 0),n(e)},isShownByDefault:s.link,indicators:[A,E],tabs:[{key:"link",label:(0,ee.__)("Default"),inheritedValue:A,setValue:e=>{n(_p(t,["elements","link","color","text"],y(e)))},userValue:I},{key:"hover",label:(0,ee.__)("Hover"),inheritedValue:E,setValue:e=>{n(_p(t,["elements","link",":hover","color","text"],y(e)))},userValue:j}]}].filter(Boolean);return L.forEach(({name:e,label:r,showPanel:o})=>{if(!o)return;const a=b(i?.elements?.[e]?.color?.background),l=b(i?.elements?.[e]?.color?.gradient),c=b(i?.elements?.[e]?.color?.text),u=b(t?.elements?.[e]?.color?.background),d=b(t?.elements?.[e]?.color?.gradient),h=b(t?.elements?.[e]?.color?.text),m="caption"!==e;P.push({key:e,label:r,hasValue:()=>!!(h||u||d),resetValue:()=>{const i=_p(t,["elements",e,"color","background"],void 0);i.elements[e].color.gradient=void 0,i.elements[e].color.text=void 0,n(i)},isShownByDefault:s[e],indicators:m?[c,l??a]:[c],tabs:[p&&{key:"text",label:(0,ee.__)("Text"),inheritedValue:c,setValue:i=>{n(_p(t,["elements",e,"color","text"],y(i)))},userValue:h},p&&m&&{key:"background",label:(0,ee.__)("Background"),inheritedValue:a,setValue:i=>{const r=_p(t,["elements",e,"color","background"],y(i));r.elements[e].color.gradient=void 0,n(r)},userValue:u},f&&m&&{key:"gradient",label:(0,ee.__)("Gradient"),inheritedValue:l,setValue:i=>{const r=_p(t,["elements",e,"color","gradient"],v(i));r.elements[e].color.background=void 0,n(r)},userValue:d,isGradient:!0}].filter(Boolean)})}),(0,Er.jsxs)(e,{resetAllFilter:M,value:t,onChange:n,panelId:o,label:a,children:[P.map(e=>{const{key:t,...n}=e;return(0,Er.jsx)(HE,{...n,colorGradientControlSettings:{colors:c,disableCustomColors:!d,gradients:u,disableCustomGradients:!h},panelId:o},t)}),l]})}var GE={backgroundImage:!0,gradient:!0};function qE(e,t){return"web"===Uo.A.OS&&e?.background?.[t]}function KE(e){const{backgroundImage:t,gradient:n}=e?.background||{};return"web"===Uo.A.OS&&(t||n)}function YE(e){return!!e?.background?.backgroundImage?.id||"string"==typeof e?.background?.backgroundImage||!!e?.background?.backgroundImage?.url}function JE(e){return"string"==typeof e?.background?.gradient&&""!==e?.background?.gradient}function XE({resetAllFilter:e,onChange:t,value:n,panelId:i,children:r,headerLabel:o}){const s=Zw();return(0,Er.jsx)(Xw,{label:o,resetAll:()=>{const i=e(n);t(i)},panelId:i,hasInnerWrapper:!0,className:"background-block-support-panel",__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:s,children:(0,Er.jsx)("div",{className:"background-block-support-panel__inner-wrapper",children:r})})}function ZE({as:e=XE,value:t,onChange:n,inheritedValue:i,settings:r,panelId:o,defaultControls:s=GE,defaultValues:a={},headerLabel:l=(0,ee.__)("Background")}){const c=rv(r),u=r?.color?.customGradient,d=c.length>0||u,h=qE(r,"gradient"),p=d&&h,f=qE(r,"backgroundImage"),m=(0,T.useCallback)(e=>({...e,background:{},color:h?{...e?.color,gradient:void 0}:e?.color}),[h]);if(!p&&!f)return null;const g=e=>vC({settings:r},"",e),b=g(t?.background?.gradient??t?.color?.gradient),y=g(i?.background?.gradient??i?.color?.gradient);return(0,Er.jsxs)(e,{resetAllFilter:m,value:t,onChange:n,panelId:o,headerLabel:l,children:[f&&(0,Er.jsx)(aC,{className:"block-editor-background-panel__item",hasValue:()=>YE(t),label:(0,ee.__)("Image"),onDeselect:()=>n(_p(t,["background","backgroundImage"],void 0)),isShownByDefault:s.backgroundImage,panelId:o,children:(0,Er.jsx)(bI,{value:t,onChange:n,settings:r,inheritedValue:i,defaultControls:s,defaultValues:a})}),p&&(0,Er.jsx)(HE,{className:"block-editor-background-panel__item",label:(0,ee.__)("Gradient"),hasValue:()=>JE(t),resetValue:()=>{let e=_p(t,["background","gradient"],void 0);e=_p(e,["color","gradient"],void 0),n(e)},isShownByDefault:s.gradient,indicators:[b],tabs:[{key:"gradient",label:(0,ee.__)("Gradient"),inheritedValue:b??y,setValue:e=>{let i=_p(t,["background","gradient"],(e=>{const t=c.flatMap(({gradients:e})=>e).find(({gradient:t})=>t===e);return t?"var:preset|gradient|"+t.slug:e})(e));i=_p(i,["color","gradient"],void 0),n(i)},userValue:b,isGradient:!0}],colorGradientControlSettings:{gradients:c,disableCustomGradients:!u},panelId:o})]})}var QE="background",ej={backgroundSize:"cover",backgroundPosition:"50% 50%"};function tj(e,t="any"){const n=vn(e,QE);return!0===n||("any"===t?!!(n?.backgroundImage||n?.backgroundSize||n?.backgroundRepeat||n?.gradient):!!n?.[t])}function nj(e){if(!e||!e?.backgroundImage?.url)return;let t;return e?.backgroundSize||(t={backgroundSize:ej.backgroundSize}),"contain"!==e?.backgroundSize||e?.backgroundPosition||(t={backgroundPosition:ej.backgroundPosition}),t}function ij(e){return YE(e)||JE(e)?"has-background":""}function rj({children:e,backgroundGradientSupported:t=!1}){const n=(0,T.useCallback)(e=>{const n=e.className?.includes("has-background")?e.className.split(" ").filter(e=>"has-background"!==e).join(" ")||void 0:e.className;return{...e,className:n,style:ov({...e.style,background:void 0,color:t?{...e.style?.color,gradient:void 0}:e.style?.color})}},[t]);return(0,Er.jsx)(oC,{group:"background",resetAllFilter:n,children:e})}function oj({clientId:e,name:t,setAttributes:n,settings:i}){const{style:r,className:o,inheritedValue:s}=(0,zt.A)(n=>{const{getBlockAttributes:i,getSettings:r}=n(Qy),o=r(),s=i(e);return{style:s?.style,className:s?.className,inheritedValue:o[Rh]?.blocks?.[t]}},[e,t]),a=tj(t,"gradient"),l=(0,T.useCallback)(({children:e})=>(0,Er.jsx)(rj,{backgroundGradientSupported:a,children:e}),[a]);if(!KE(i)||!tj(t))return null;const c=a&&!r?.background?.gradient&&r?.color?.gradient?{...r,background:{...r?.background,gradient:r?.color?.gradient}}:r,u={...i,background:{...i.background,backgroundSize:i?.background?.backgroundSize&&tj(t,"backgroundSize")}},d=vn(t,[QE,"__experimentalDefaultControls"]);return(0,Er.jsx)(ZE,{inheritedValue:s,as:l,panelId:e,defaultValues:ej,settings:u,onChange:e=>{const t=a&&!!r?.color?.gradient,i={style:ov(a?{...e,color:{...e?.color,gradient:void 0}}:e)};t&&e?.background?.gradient?i.className=(0,mh.A)(o,"has-background"):!e?.background?.gradient&&o?.includes("has-background")&&(i.className=o.split(" ").filter(e=>"has-background"!==e).join(" ")||void 0),n(i)},defaultControls:d,value:c})}var sj={useBlockProps:function({name:e,style:t}){if(!tj(e)||!t?.background?.backgroundImage)return;const n=nj(t?.background);return n?{style:{...n}}:void 0},attributeKeys:["style"],hasSupport:tj};(0,Ei.U2)("blocks.registerBlockType","core/lock/addAttribute",function(e){return"type"in(e.attributes?.lock??{})||(e.attributes={...e.attributes,lock:{type:"object"}}),e});var aj=n(77779),lj=n(93691),cj=n(87691),uj=n(67326),dj=n(36484),hj=(0,T.memo)(function({icon:e,showColors:t=!1,className:n,context:i}){"block-default"===e?.src&&(e={src:dj.A});const r=(0,Er.jsx)(IC.A,{icon:e&&e.src?e.src:e,context:i}),o=t?{backgroundColor:e&&e.background,color:e&&e.foreground}:{};return(0,Er.jsx)("span",{style:o,className:(0,mh.A)("block-editor-block-icon",n,{"has-colors":t}),children:r})}),pj=function({blockTypes:e,value:t,onItemChange:n}){return(0,Er.jsx)("ul",{className:"block-editor-block-manager__checklist",children:e.map(e=>(0,Er.jsxs)("li",{className:"block-editor-block-manager__checklist-item",children:[(0,Er.jsx)(WA.A,{label:e.title,checked:t.includes(e.name),onChange:(...t)=>n(e,...t)}),(0,Er.jsx)(hj,{icon:e.icon})]},e.name))})},fj=function e({title:t,blockTypes:n,selectedBlockTypes:i,onChange:r}){const o=(0,SS.A)(e),s=(0,T.useCallback)((e,t)=>{r(t?[...i,e]:i.filter(({name:t})=>t!==e.name))},[i,r]),a=(0,T.useCallback)(e=>{r(e?[...i,...n.filter(e=>!i.find(({name:t})=>t===e.name))]:i.filter(e=>!n.find(({name:t})=>t===e.name)))},[n,i,r]);if(!n.length)return null;const l=n.map(({name:e})=>e).filter(e=>(i??[]).some(t=>t.name===e)),c="block-editor-block-manager__category-title-"+o,u=l.length===n.length,d=!u&&l.length>0;return(0,Er.jsxs)("div",{role:"group","aria-labelledby":c,className:"block-editor-block-manager__category",children:[(0,Er.jsx)(WA.A,{checked:u,onChange:a,className:"block-editor-block-manager__category-title",indeterminate:d,label:(0,Er.jsx)("span",{id:c,children:t})}),(0,Er.jsx)(pj,{blockTypes:n,value:l,onItemChange:s})]})};function mj({blockTypes:e,selectedBlockTypes:t,onChange:n,showSelectAll:i=!0}){const r=(0,uj.A)(dt.L,500),[o,s]=(0,T.useState)(""),{categories:a,isMatchingSearchTerm:l}=(0,zt.A)(e=>({categories:e(Zi).getCategories(),isMatchingSearchTerm:e(Zi).isMatchingSearchTerm}),[]),c=e.filter(e=>!o||l(e,o)),u=t.length>0&&t.length!==e.length,d=e.length>0&&t.length===e.length;return(0,T.useEffect)(()=>{if(!o)return;const e=c.length,t=(0,ee.sprintf)((0,ee._n)("%d result found.","%d results found.",e),e);r(t)},[c?.length,o,r]),(0,Er.jsxs)(Q_.A,{className:"block-editor-block-manager__content",spacing:4,children:[(0,Er.jsx)(cj.A,{label:(0,ee.__)("Search for a block"),placeholder:(0,ee.__)("Search for a block"),value:o,onChange:e=>s(e),className:"block-editor-block-manager__search"}),i&&(0,Er.jsx)(WA.A,{className:"block-editor-block-manager__select-all",label:(0,ee.__)("Select all"),checked:d,onChange:()=>{n(d?[]:e)},indeterminate:u}),(0,Er.jsxs)("div",{tabIndex:"0",role:"region","aria-label":(0,ee.__)("Available block types"),className:"block-editor-block-manager__results",children:[0===c.length&&(0,Er.jsx)("p",{className:"block-editor-block-manager__no-results",children:(0,ee.__)("No blocks found.")}),a.map(e=>(0,Er.jsx)(fj,{title:e.title,blockTypes:c.filter(t=>t.category===e.slug),selectedBlockTypes:t,onChange:n},e.slug)),(0,Er.jsx)(fj,{title:(0,ee.__)("Uncategorized"),blockTypes:c.filter(({category:e})=>!e),selectedBlockTypes:t,onChange:n})]})]})}function gj({clientId:e,blockTypes:t,selectedBlockTypes:n,onClose:i}){const[r,o]=(0,T.useState)(n),{updateBlockAttributes:s}=(0,Vt.A)(Qy);return(0,Er.jsx)(aj.A,{title:(0,ee._x)("Manage allowed blocks","modal title"),onRequestClose:i,overlayClassName:"block-editor-block-allowed-blocks-modal",focusOnMount:"firstContentElement",size:"medium",children:(0,Er.jsxs)(Q_.A,{as:"form",onSubmit:n=>{n.preventDefault(),(()=>{const n=r.length===t.length,o=r.map(({name:e})=>e);s(e,{allowedBlocks:n?void 0:o}),i()})()},spacing:"4",children:[(0,Er.jsx)(lj.A,{children:(0,ee.__)("Select which blocks can be added inside this container.")}),(0,Er.jsx)(mj,{blockTypes:t,selectedBlockTypes:r,onChange:e=>{o(e)}}),(0,Er.jsxs)(Kv.A,{className:"block-editor-block-allowed-blocks-modal__actions",justify:"flex-end",expanded:!1,children:[(0,Er.jsx)(Yv.A,{children:(0,Er.jsx)(fv.Ay,{variant:"tertiary",onClick:i,__next40pxDefaultSize:!0,children:(0,ee.__)("Cancel")})}),(0,Er.jsx)(Yv.A,{children:(0,Er.jsx)(fv.Ay,{variant:"primary",type:"submit",__next40pxDefaultSize:!0,children:(0,ee.__)("Apply")})})]})]})})}function bj({clientId:e}){const[t,n]=(0,T.useState)(!1),{blockTypes:i,selectedBlockNames:r}=(0,zt.A)(t=>{const{getBlockAttributes:n}=t(Qy);return{blockTypes:t(Zi).getBlockTypes(),selectedBlockNames:n(e)?.allowedBlocks}},[e]),o=i.filter(e=>_n(e,"inserter",!0)&&(!e.parent||e.parent.includes("core/post-content")));if(!o)return null;const s=void 0===r?o:o.filter(e=>r.includes(e.name));return(0,Er.jsxs)("div",{className:"block-editor-block-allowed-blocks-control",children:[(0,Er.jsxs)(mk.Ay,{help:(0,ee.__)("Specify which blocks are allowed inside this container."),children:[(0,Er.jsx)(mk.Ay.VisualLabel,{children:(0,ee.__)("Allowed Blocks")}),(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{n(!0)},className:"block-editor-block-allowed-blocks-control__button",children:(0,ee.__)("Manage allowed blocks")})]}),t&&(0,Er.jsx)(gj,{clientId:e,blockTypes:o,selectedBlockTypes:s,onClose:()=>n(!1)})]})}var yj={edit:function({clientId:e}){return"contentOnly"===Vk()?null:(0,Er.jsx)(cw.Fill,{children:(0,Er.jsx)(bj,{clientId:e})})},attributeKeys:["allowedBlocks"],hasSupport:e=>_n(e,"allowedBlocks")};(0,Ei.U2)("blocks.registerBlockType","core/allowedBlocks/attribute",function(e){return e?.attributes?.allowedBlocks?.type||_n(e,"allowedBlocks")&&(e.attributes={...e.attributes,allowedBlocks:{type:"array"}}),e}),(0,Ei.U2)("blocks.switchToBlockType.transformedBlock","core/allowedBlocks/addTransforms",function(e,t,n,i){if(!_n(e.name,"allowedBlocks"))return e;if(1!==t.length&&1===i.length&&e.innerBlocks.length===t.length)return e;if(1===i.length&&t.length>1||i.length>1&&1===t.length)return e;if(i.length>1&&t.length>1&&i.length!==t.length)return e;if(e.attributes.allowedBlocks)return e;const r=t[n]?.attributes?.allowedBlocks;if(!r)return e;const o=bn(e.name),s=o?.allowedBlocks||[];if(!s.length)return{...e,attributes:{...e.attributes,allowedBlocks:r}};const a=r.filter(e=>s.includes(e));return{...e,attributes:{...e.attributes,allowedBlocks:a}}});var vj=/[\s#]/g,_j={addSaveProps:function(e,t,n){return _n(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e},edit:function({anchor:e,setAttributes:t}){if("default"!==Vk())return null;const n="web"===Uo.A.OS;return(0,Er.jsx)(oC,{group:"advanced",children:(0,Er.jsx)(kS.A,{__next40pxDefaultSize:!0,className:"html-anchor-control",label:(0,ee.__)("HTML anchor"),help:(0,Er.jsxs)(Er.Fragment,{children:[(0,ee.__)("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,Er.jsxs)(Er.Fragment,{children:[" ",(0,Er.jsx)(OA.A,{href:(0,ee.__)("https://wordpress.org/documentation/article/page-jumps/"),children:(0,ee.__)("Learn more about anchors")})]})]}),value:e||"",placeholder:n?null:(0,ee.__)("Add an anchor"),onChange:e=>{e=e.replace(vj,"-"),t({anchor:""!==e?e:void 0})},autoCapitalize:"none",autoComplete:"off"})})},attributeKeys:["anchor"],hasSupport:e=>_n(e,"anchor")};(0,Ei.U2)("blocks.registerBlockType","core/anchor/attribute",function(e){return"type"in(e.attributes?.anchor??{})||_n(e,"anchor")&&(e.attributes={...e.attributes,anchor:{type:"string"}}),e});var xj={addSaveProps:function(e,t,n){return _n(t,"ariaLabel")&&!av(t,"ariaLabel","ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e},attributeKeys:["ariaLabel"],hasSupport:e=>_n(e,"ariaLabel")};(0,Ei.U2)("blocks.registerBlockType","core/ariaLabel/attribute",function(e){return e?.attributes?.ariaLabel?.type||_n(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:{type:"string"}}),e});var kj=n(51206),wj=(0,T.createContext)({});function Cj({value:e,children:t}){const n=(0,T.useContext)(wj),i=(0,T.useMemo)(()=>({...n,...e}),[n,e]);return(0,Er.jsx)(wj.Provider,{value:i,children:t})}wj.displayName="BlockContext";var Sj=wj;function Aj({clientId:e,maximumLength:t,context:n}){const i=(0,zt.A)(t=>{if(!e)return null;const{getBlockName:i,getBlockAttributes:r}=t(Qy),{getBlockType:o,getActiveBlockVariation:s}=t(Zi),a=i(e),l=o(a);if(!l)return null;const c=r(e),u=Tn(l,c,n);if(u!==l.title)return u;const d=s(a,c);return d?.title||l.title},[e,n]);if(!i)return null;if(t&&t>0&&i.length>t){const e="...";return i.slice(0,t-e.length)+e}return i}function Ij(e){const t=e?.style?.position?.type;return"sticky"===t?(0,ee.__)("Sticky"):"fixed"===t?(0,ee.__)("Fixed"):null}function Ej(e){return(0,zt.A)(t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:i,__experimentalGetParsedPattern:r}=t(Qy),{getBlockType:o,getActiveBlockVariation:s}=t(Zi),a=n(e),l=o(a);if(!l)return null;const c=i(e),u=c?.metadata?.patternName;if(u){const e=r(u),t=Ij(c);return{isSynced:!1,title:(0,ee.__)("Pattern"),icon:pp.A,description:e?.description||(0,ee.__)("A block pattern."),anchor:c?.anchor,positionLabel:t,positionType:c?.style?.position?.type,name:e?.title||c?.metadata?.name}}const d=s(a,c),h=xn(l)||kn(l),p=(h?Tn(l,c):void 0)||l.title,f=Ij(c),m={isSynced:h,title:p,icon:l.icon,description:l.description,anchor:c?.anchor,positionLabel:f,positionType:c?.style?.position?.type,name:c?.metadata?.name};return d?{isSynced:h,title:d.title||l.title,icon:d.icon||l.icon,description:d.description||l.description,anchor:c?.anchor,positionLabel:f,positionType:c?.style?.position?.type,name:c?.metadata?.name}:m},[e])}function jj({isControl:e}={isControl:!1}){return(0,dw.A)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:e?35:259}}}function Tj({fields:e,visibleFields:t,onToggleField:n}){const{popoverProps:i}=jj();return e&&0!==e.length?(0,Er.jsx)(xv.A,{icon:ww.A,label:(0,ee.__)("Options"),popoverProps:i,toggleProps:{size:"small"},children:({onClose:i})=>(0,Er.jsx)(Fv.A,{label:(0,ee.__)("Show / Hide"),children:e.map(e=>{const r=t.includes(e.id);return(0,Er.jsx)(zv.A,{isSelected:r,onClick:()=>{n(e.id),i()},role:"menuitemcheckbox",icon:r?xw.A:null,children:e.label},e.id)})})}):null}var Bj=(0,T.createContext)({});Bj.displayName="PrivateBlockContext";var Nj=n(64132);function Rj(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function Oj({allowedFormats:e,disableFormats:t}){return t?Oj.EMPTY_ARRAY:e}Oj.EMPTY_ARRAY=[];var Lj=["`",'"',"'","“”","‘’"];function Mj(e){let t=e.length;for(;t--;){const n=Mb(e[t].attributes);if(n)return e[t].attributes[n]=e[t].attributes[n].toString().replace(Lb,""),[e[t].clientId,n,0,0];const i=Mj(e[t].innerBlocks);if(i)return i}return[]}function Pj({clipboardData:e}){let t="",n="";try{t=e.getData("text/plain"),n=e.getData("text/html")}catch{return}n=function(e){const t=e.indexOf("\x3c!--StartFragment--\x3e");if(!(t>-1))return e;const n=(e=e.substring(t+20)).indexOf("\x3c!--EndFragment--\x3e");return n>-1&&(e=e.substring(0,n)),e}(n),n=function(e){return e.startsWith("<meta charset='utf-8'>")?e.slice(22):e}(n);const i=NC(e);return i.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}(i,n)?{files:i}:{html:n,plainText:t,files:[]}}var Dj=[e=>t=>{function n(n){const{inputType:i,data:r}=n,{value:o,onChange:s,registry:a}=e.current;if("insertText"!==i)return;if(et(o))return;const l=(0,Ei.W5)("blockEditor.wrapSelectionSettings",Lj).find(([e,t])=>e===r||t===r);if(!l)return;const[c,u=c]=l,d=o.start,h=o.end+c.length;let p=st(o,c,d,d);p=st(p,u,h,h);const{__unstableMarkLastChangeAsPersistent:f,__unstableMarkAutomaticChange:m}=a.dispatch(Qy);f(),s(p),m();const g={};for(const e in n)g[e]=n[e];g.data=u;const{ownerDocument:b}=t,{defaultView:y}=b,v=new y.InputEvent("input",g);window.queueMicrotask(()=>{n.target.dispatchEvent(v)}),n.preventDefault()}return t.addEventListener("beforeinput",n),()=>{t.removeEventListener("beforeinput",n)}},e=>t=>{function n(){const{getValue:t,onReplace:n,selectionChange:i,registry:r}=e.current;if(!n)return;const o=t(),{start:s,text:a}=o;if(" "!==a.slice(s-1,s))return;const l=a.slice(0,s).trim(),c=ar(lr("from").filter(({type:e})=>"prefix"===e),({prefix:e})=>l===e);if(!c)return;const u=Be({value:st(o,Lb,0,s)}),d=c.transform(u);return i(...Mj([d])),n([d]),r.dispatch(Qy).__unstableMarkAutomaticChange(),!0}function i(t){const{inputType:i,type:r}=t,{getValue:o,onChange:s,__unstableAllowPrefixTransformations:a,formatTypes:l,registry:c,onReplace:u}=e.current;if("insertText"!==i&&"compositionend"!==r)return;if(a&&n())return;const d=o(),h=ar(lr("from").filter(e=>"input"===e.type),e=>e.regExp.test(d.text));if(h)return u(h.transform()),void c.dispatch(Qy).__unstableMarkAutomaticChange();const p=l.reduce((e,{__unstableInputRule:t})=>(t&&(e=t(e)),e),function(e){const{start:t,text:n}=e;return t<18||"tales of gutenberg"!==n.slice(t-18,t).toLowerCase()?e:st(e," 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️")}(d)),{__unstableMarkLastChangeAsPersistent:f,__unstableMarkAutomaticChange:m}=c.dispatch(Qy);p!==d&&(f(),s({...p,activeFormats:d.activeFormats}),m())}return t.addEventListener("input",i),t.addEventListener("compositionend",i),()=>{t.removeEventListener("input",i),t.removeEventListener("compositionend",i)}},e=>t=>{function n(t){if("insertReplacementText"!==t.inputType)return;const{registry:n}=e.current;n.dispatch(Qy).__unstableMarkLastChangeAsPersistent()}return t.addEventListener("beforeinput",n),()=>{t.removeEventListener("beforeinput",n)}},()=>e=>{function t(e){(Rt.kx.primary(e,"z")||Rt.kx.primary(e,"y")||Rt.kx.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}},e=>t=>{const{keyboardShortcuts:n}=e.current;function i(e){for(const t of n.current)t(e)}return t.addEventListener("keydown",i),()=>{t.removeEventListener("keydown",i)}},e=>t=>{const{inputEvents:n}=e.current;function i(e){for(const t of n.current)t(e)}return t.addEventListener("input",i),()=>{t.removeEventListener("input",i)}},e=>t=>{function n(t){const{keyCode:n}=t;if(t.defaultPrevented)return;if(n!==Rt.G_&&n!==Rt._f)return;const{registry:i}=e.current,{didAutomaticChange:r,getSettings:o}=i.select(Qy),{__experimentalUndo:s}=o();s&&r()&&(t.preventDefault(),s())}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},e=>t=>{function n(n){const{disableFormats:i,onChange:r,value:o,formatTypes:s,tagName:a,onReplace:l,__unstableEmbedURLOnPaste:c,preserveWhiteSpace:u,pastePlainText:d}=e.current;if(!t.contains(n.target))return;if(n.defaultPrevented)return;const{plainText:h,html:p}=Pj(n);if(n.preventDefault(),window.console.log("Received HTML (RichText):\n\n",p),window.console.log("Received plain text (RichText):\n\n",h),i)return void r(st(o,h));function f(e){const t=s.reduce((e,{__unstablePasteRule:t})=>(t&&e===o&&(e=t(o,{html:p,plainText:h})),e),o);if(t!==o)r(t);else{const t=We({html:e});!function(e,t){if(t?.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}(t,o.activeFormats),r(st(o,t))}}if("true"===n.clipboardData.getData("rich-text"))return void f(p);if(d)return void r(st(o,We({text:h})));let m="INLINE";const g=h.trim();c&&tt(o)&&(0,TS.m)(g)&&/^https?:/.test(g)&&(m="BLOCKS");const b=Zs({HTML:p,plainText:h,mode:m,tagName:a,preserveWhiteSpace:u});"string"==typeof b?f(b):b.length>0&&l&&tt(o)&&l(b,b.length-1,-1)}const{defaultView:i}=t.ownerDocument;return i.addEventListener("paste",n),()=>{i.removeEventListener("paste",n)}},e=>t=>{function n(t){const{keyCode:n}=t;if(t.defaultPrevented)return;const{value:i,onMerge:r,onRemove:o}=e.current;if(n===Rt.SJ||n===Rt.G_){const{start:e,end:s,text:a}=i,l=n===Rt.G_,c=i.activeFormats&&!!i.activeFormats.length;if(!et(i)||c||l&&0!==e||!l&&s!==a.length)return;r?r(!l):o&&tt(i)&&l&&o(!l),t.preventDefault()}}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},e=>t=>{function n(t){if(t.keyCode!==Rt.Fm)return;const{onReplace:n,onSplit:i}=e.current;n&&i&&(t.__deprecatedOnSplit=!0)}function i(n){if(n.defaultPrevented)return;if(n.target!==t)return;if(n.keyCode!==Rt.Fm)return;const{value:i,onChange:r,disableLineBreaks:o,onSplitAtEnd:s,onSplitAtDoubleLineEnd:a,registry:l}=e.current;n.preventDefault();const{text:c,start:u,end:d}=i;n.shiftKey?o||r(st(i,"\n")):s&&u===d&&d===c.length?s():a&&u===d&&d===c.length&&"\n\n"===c.slice(-2)?l.batch(()=>{const e={...i};e.start=e.end-2,r(at(e)),a()}):o||r(st(i,"\n"))}const{defaultView:r}=t.ownerDocument;return r.addEventListener("keydown",i),t.addEventListener("keydown",n),()=>{r.removeEventListener("keydown",i),t.removeEventListener("keydown",n)}},e=>t=>{function n(){const{registry:n}=e.current;if(!n.select(Qy).isMultiSelecting())return;const i=t.parentElement.closest('[contenteditable="true"]');i&&i.focus()}return t.addEventListener("focus",n),()=>{t.removeEventListener("focus",n)}}];function Fj(e){const t=(0,T.useRef)(e);(0,T.useInsertionEffect)(()=>{t.current=e});const n=(0,T.useMemo)(()=>Dj.map(e=>e(t)),[t]);return(0,bt.A)(t=>{if(!e.isSelected)return;const i=n.map(e=>e(t));return()=>{i.forEach(e=>e())}},[n,e.isSelected])}var zj={},Vj=Symbol("usesContext");function Uj({onChange:e,onFocus:t,value:n,forwardedRef:i,settings:r,isVisible:o}){const{name:s,edit:a,[Vj]:l}=r,c=(0,T.useContext)(Sj),u=(0,T.useMemo)(()=>l?Object.fromEntries(Object.entries(c).filter(([e])=>l.includes(e))):zj,[l,c]);if(!a)return null;const d=Qe(n,s),h=void 0!==d,p=function({start:e,end:t,replacements:n,text:i}){if(e+1===t&&i[e]===we)return n[e]}(n),f=void 0!==p&&p.type===s;return(0,Er.jsx)(a,{isActive:h,isVisible:o,activeAttributes:h&&d.attributes||{},isObjectActive:f,activeObjectAttributes:f&&p.attributes||{},value:n,onChange:e,onFocus:t,contentRef:i,context:u},s)}function $j({formatTypes:e,...t}){return e.map(e=>(0,T.createElement)(Uj,{settings:e,...t,key:e.name}))}var Hj=n(55212),Wj=n(44059);function Gj({items:e,onSelect:t,selectedIndex:n,instanceId:i,listBoxId:r,className:o,Component:s="div"}){return(0,Er.jsx)(s,{id:r,role:"listbox",className:"components-autocomplete__results",children:e.map((e,r)=>(0,Er.jsx)(fv.Ay,{id:`components-autocomplete-item-${i}-${e.key}`,role:"option",__next40pxDefaultSize:!0,"aria-selected":r===n,accessibleWhenDisabled:!0,disabled:e.isDisabled,className:(0,mh.A)("components-autocomplete__result",o,{"is-selected":r===n}),variant:r===n?"primary":void 0,onClick:()=>t(e),children:e.label},e.key))})}function qj({autocompleter:e,filterValue:t,instanceId:n,listBoxId:i,className:r,selectedIndex:o,onChangeOptions:s,onSelect:a,reset:l,contentRef:c}){const u=e.useItems??function(e){return t=>{const[n,i]=(0,T.useState)([]);return(0,T.useLayoutEffect)(()=>{const{options:n,isDebounced:r}=e,o=(0,mS.s)(()=>{const r=Promise.resolve("function"==typeof n?n(t):n).then(n=>{if(r.canceled)return;const o=n.map((t,n)=>({key:`${e.name}-${n}`,value:t,label:e.getOptionLabel(t),keywords:e.getOptionKeywords?e.getOptionKeywords(t):[],isDisabled:!!e.isOptionDisabled&&e.isOptionDisabled(t)})),s=new RegExp("(?:\\b|\\s|^)"+(0,mx.Nt)(t),"i");i(function(e,t=[],n=10){const i=[];for(let r=0;r<t.length;r++){const o=t[r];let{keywords:s=[]}=o;"string"==typeof o.label&&(s=[...s,o.label]);const a=s.some(t=>e.test(Wn(t)));if(a&&(i.push(o),i.length===n))break}return i}(s,o))});return r},r?250:0),s=o();return()=>{o.cancel(),s&&(s.canceled=!0)}},[t]),[n]}}(e),[d]=u(t),h=Zt({editableContentElement:c.current}),[p,f]=(0,T.useState)(!1),m=(0,T.useRef)(null),g=(0,gt.A)([m,(0,bt.A)(e=>{c.current&&f(e.ownerDocument!==c.current.ownerDocument)},[c])]);var b,y;b=m,y=l,(0,T.useEffect)(()=>{const e=e=>{b.current&&!b.current.contains(e.target)&&y(e)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}},[y,b]);const v=(0,uj.A)(dt.L,500);return(0,T.useLayoutEffect)(()=>{var e;s(d),e=d,v&&(e.length?v(t?(0,ee.sprintf)((0,ee._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length),e.length):(0,ee.sprintf)((0,ee._n)("Initial %d result loaded. Type to filter all available results. Use up and down arrow keys to navigate.","Initial %d results loaded. Type to filter all available results. Use up and down arrow keys to navigate.",e.length),e.length),"assertive"):v((0,ee.__)("No results."),"assertive"))},[d]),0===d.length?null:(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(uw.Ay,{offset:8,focusOnMount:!1,placement:"top-start",className:"components-autocomplete__popover",anchor:h,ref:g,children:(0,Er.jsx)(Gj,{items:d,onSelect:a,selectedIndex:o,instanceId:n,listBoxId:i,className:r})}),c.current&&p&&(0,Wj.createPortal)((0,Er.jsx)(Gj,{items:d,onSelect:a,selectedIndex:o,instanceId:n,listBoxId:i,className:r,Component:kC.A}),c.current.ownerDocument.body)]})}var Kj=n(12387),Yj=e=>{if(null===e)return"";switch(typeof e){case"string":case"number":return e.toString();case"object":return e instanceof Array?e.map(Yj).join(""):"props"in e?Yj(e.props.children):"";default:return""}},Jj=Yj,Xj={},Zj={selectedIndex:0,filteredOptions:[],filterValue:"",autocompleter:null};function Qj(e,t){switch(t.type){case"RESET":return Zj;case"SELECT":return{...e,selectedIndex:t.index};case"OPTIONS":return{...e,filteredOptions:t.options,selectedIndex:t.options.length===e.filteredOptions.length?e.selectedIndex:0};case"MATCH":return{...e,autocompleter:t.completer,filterValue:t.query}}}function eT(e){const t=(0,T.useRef)(null),n=(0,T.useRef)(void 0),{record:i}=e,r=function(e){const t=(0,T.useRef)([]),n=t.current[t.current.length-1];return n&&function(e,t){return e.text===t.text&&e.start===t.start&&e.end===t.end}(e,n)||t.current.push(e),t.current.length>2&&t.current.shift(),t.current[0]}(i),{popover:o,listBoxId:s,activeId:a,onKeyDown:l}=function({record:e,onChange:t,onReplace:n,completers:i,contentRef:r}){const o=(0,SS.A)(Xj),[s,a]=(0,T.useReducer)(Qj,Zj),{selectedIndex:l,filteredOptions:c,filterValue:u,autocompleter:d}=s,h=(0,T.useRef)(!1);function p(i){const{getOptionCompletion:o}=d||{};if(!i.isDisabled){if(o){const r=null!==(s=o(i.value,u))&&"object"==typeof s&&"action"in s&&void 0!==s.action&&"value"in s&&void 0!==s.value?s:{action:"insert-at-caret",value:s};if("replace"===r.action)return void n([r.value]);"insert-at-caret"===r.action&&function(n){if(null===d)return;const i=e.start,r=i-d.triggerPrefix.length-u.length,o=We({html:(0,Ar.Ay)(n)});t(st(e,o,r,i))}(r.value)}var s;a({type:"RESET"}),r.current?.focus()}}const f=(0,T.useMemo)(()=>et(e)?Ve(ct(e,0)):"",[e]);(0,T.useEffect)(()=>{const t=function(e,t,n,i,r){if(!e)return null;let o=null,s=-1,a=-1,l=0;for(const n of t){const t=e.lastIndexOf(n.triggerPrefix);if(t<0)continue;const i=t+n.triggerPrefix.length;(i>a||i===a&&n.triggerPrefix.length>l)&&(o=n,s=t,a=i,l=n.triggerPrefix.length)}if(!o)return null;const{allowContext:c,triggerPrefix:u}=o,d=e.slice(s+u.length);if(d.length>50)return null;const h=0===n,p=d.split(/\s/),f=1===p.length,m=i&&p.length<=3;return!h||m||f?c&&!c(e.slice(0,s),r())||/^\s/.test(d)||/\s\s+$/.test(d)?null:{completer:o,filterValue:Wn(d)}:null}(f,i,c.length,h.current,function(){return f?Ve(ct(e,void 0,Ve(e).length)):""});if(!t)return void(d&&a({type:"RESET"}));const{completer:n,filterValue:r}=t;a({type:"MATCH",completer:n,query:r})},[f]);const{key:m=""}=c[l]||{},{className:g}=d||{},b=!!d&&c.length>0,y=b?`components-autocomplete-listbox-${o}`:void 0,v=b?`components-autocomplete-item-${o}-${m}`:null,_=void 0!==e.start,x=!!f&&_&&!!d;return{listBoxId:y,activeId:v,onKeyDown:(0,Kj.n)(function(e){if(h.current="Backspace"===e.key,d&&0!==c.length&&!e.defaultPrevented){switch(e.key){case"ArrowUp":case"ArrowDown":{const t="ArrowUp"===e.key?-1:1,n=(l+t+c.length)%c.length;a({type:"SELECT",index:n}),(0,Hj.H)()&&(0,dt.L)(Jj(c[n].label),"assertive");break}case"Escape":a({type:"RESET"}),e.preventDefault();break;case"Enter":p(c[l]);break;case"ArrowLeft":case"ArrowRight":return void a({type:"RESET"});default:return}e.preventDefault()}}),popover:x&&(0,Er.jsx)(qj,{autocompleter:d,className:g,filterValue:u,instanceId:o,listBoxId:y,selectedIndex:l,onChangeOptions:function(e){a({type:"OPTIONS",options:e})},onSelect:p,contentRef:r,reset:()=>a({type:"RESET"})},d.name+d.triggerPrefix)}}({...e,contentRef:t});n.current=l;const c=(0,gt.A)([t,(0,bt.A)(e=>{function t(e){n.current?.(e)}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}},[])]);return i.text!==r?.text?{ref:c,children:o,"aria-autocomplete":s?"list":void 0,"aria-owns":s,"aria-activedescendant":a}:{ref:c}}var tT=e=>e.name||"",nT=e=>e.title,iT=e=>e.description||"",rT=e=>e.keywords||[],oT=e=>e.category,sT=()=>null,aT=[/([\p{Ll}\p{Lo}\p{N}])([\p{Lu}\p{Lt}])/gu,/([\p{Lu}\p{Lt}])([\p{Lu}\p{Lt}][\p{Ll}\p{Lo}])/gu],lT=new RegExp("(\\p{C}|\\p{P}|\\p{S})+","giu"),cT=new Map,uT=new Map;function dT(e=""){if(cT.has(e))return cT.get(e);const t=(0,Y.W)(e,{splitRegexp:aT,stripRegexp:lT}).split(" ").filter(Boolean);return cT.set(e,t),t}function hT(e=""){if(uT.has(e))return uT.get(e);let t=Wn(e);return t=t.replace(/^\//,""),t=t.toLowerCase(),uT.set(e,t),t}var pT=(e="")=>dT(hT(e)),fT=(e,t,n,i)=>0===pT(i).length?e:mT(e,i,{getCategory:e=>t.find(({slug:t})=>t===e.category)?.title,getCollection:e=>n[e.name.split("/")[0]]?.title}),mT=(e=[],t="",n={})=>{if(0===pT(t).length)return e;const i=e.map(e=>[e,gT(e,t,n)]).filter(([,e])=>e>0);return i.sort(([,e],[,t])=>t-e),i.map(([e])=>e)};function gT(e,t,n={}){const{getName:i=tT,getTitle:r=nT,getDescription:o=iT,getKeywords:s=rT,getCategory:a=oT,getCollection:l=sT}=n,c=i(e),u=r(e),d=o(e),h=s(e),p=a(e),f=l(e),m=hT(t),g=hT(u);let b=0;if(m===g)b+=30;else if(g.startsWith(m))b+=20;else{const e=[c,u,d,...h,p,f].join(" ");0===(y=dT(m),v=e,y.filter(e=>!pT(v).some(t=>t.includes(e)))).length&&(b+=10)}var y,v;return 0!==b&&c.startsWith("core/")&&(b+=c!==e.id?1:2),b}var bT=(e,t,n)=>{const i=(0,T.useMemo)(()=>({[Nf]:!!n}),[n]),[r]=(0,zt.A)(t=>[t(Qy).getInserterItems(e,i)],[e,i]),{getClosestAllowedInsertionPoint:o}=Gh((0,zt.A)(Qy)),{createErrorNotice:s}=(0,Vt.A)(Rb.store),[a,l]=(0,zt.A)(e=>{const{getCategories:t,getCollections:n}=e(Zi);return[t(),n()]},[]),c=(0,T.useCallback)(({name:n,initialAttributes:i,innerBlocks:r,syncStatus:a,content:l},c)=>{const u=o(n,e);if(null===u){const e=bn(n)?.title??n;return void s((0,ee.sprintf)((0,ee.__)('Block "%s" can\'t be inserted.'),e),{type:"snackbar",id:"inserter-notice"})}const d="unsynced"===a?Vo(l,{__unstableSkipMigrationLogs:!0}):er(n,i,tr(r));t(d,void 0,c,u)},[o,e,t,s]);return[r,a,l,c]},yT=(e,t)=>t?(e.sort(({id:e},{id:n})=>{let i=t.indexOf(e),r=t.indexOf(n);return i<0&&(i=t.length),r<0&&(r=t.length),i-r}),e):e,vT=()=>{},_T={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockId:n,prioritizedBlocks:i}=(0,zt.A)(e=>{const{getSelectedBlockClientId:t,getBlock:n,getBlockListSettings:i,getBlockRootClientId:r}=e(Qy),{getActiveBlockVariation:o}=e(Zi),s=t(),{name:a,attributes:l}=n(s),c=o(a,l),u=r(s);return{selectedBlockId:c?`${a}/${c.name}`:a,rootClientId:u,prioritizedBlocks:i(u)?.prioritizedInserterBlocks}},[]),[r,o,s]=bT(t,vT,!0),a=(0,T.useMemo)(()=>(e.trim()?fT(r,o,s,e):yT(Uf(r,"frecency","desc"),i)).filter(e=>e.id!==n).slice(0,9),[e,n,r,o,s,i]),l=(0,T.useMemo)(()=>a.map(e=>{const{title:t,icon:n,isDisabled:i}=e;return{key:`block-${e.id}`,value:e,label:(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(hj,{icon:n,showColors:!0},"icon"),t]}),isDisabled:i}}),[a]);return[l]},allowContext:(e,t)=>!(/\S/.test(e)||/\S/.test(t)),getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:i,syncStatus:r,blocks:o}=e;return{action:"replace",value:"unsynced"===r?(o??[]).map(e=>ir(e)):er(t,n,tr(i))}}},xT=[];function kT({completers:e=xT}){const{name:t}=Ih();return(0,T.useMemo)(()=>{let n=[...e];return(t===gn()||vn(t,"__experimentalSlashInserter",!1))&&(n=[...n,_T]),(0,Ei.FC)("editor.Autocomplete.completers")&&(n===e&&(n=n.map(e=>({...e}))),n=(0,Ei.W5)("editor.Autocomplete.completers",n,t)),n},[e,t])}var wT=n(45919),CT={placement:"bottom-start"},ST=()=>(0,Er.jsxs)(Er.Fragment,{children:[["bold","italic","link","unknown"].map(e=>(0,Er.jsx)(Sv.DX,{name:`RichText.ToolbarControls.${e}`},e)),(0,Er.jsx)(Sv.DX,{name:"RichText.ToolbarControls",children:e=>{if(!e.length)return null;const t=e.map(([{props:e}])=>e).some(({isActive:e})=>e);return(0,Er.jsx)(mv.A,{children:n=>(0,Er.jsx)(xv.A,{icon:wT.A,label:(0,ee.__)("More"),toggleProps:{...n,className:(0,mh.A)(n.className,{"is-pressed":t}),description:(0,ee.__)("Displays more block tools")},controls:Uf(e.map(([{props:e}])=>e),"title"),popoverProps:CT})})}})]}),AT=n(81448),IT=n(62956),ET=n(81841),jT=n(95756);function TT(e={}){var t;const n=null==(t=e.store)?void 0:t.getState();return(0,ET.z)({...e,orientation:(0,jT.Jh)(e.orientation,null==n?void 0:n.orientation,"horizontal"),focusLoop:(0,jT.Jh)(e.focusLoop,null==n?void 0:n.focusLoop,!0)})}function BT(e={}){const[t,n]=(0,IT.Pj)(TT,e);return function(e,t,n){return(0,AT.YO)(e,t,n)}(t,n,e)}var NT=n(1485),RT=n(58224),OT=n(5270),LT=n(44151),MT=(0,OT.ab)(function({store:e,orientation:t,virtualFocus:n,focusLoop:i,rtl:r,...o}){const s=(0,NT.P$)(),a=BT({store:e=e||s,orientation:t,virtualFocus:n,focusLoop:i,rtl:r}),l=(0,IT.O$)(a,e=>"both"===e.orientation?void 0:e.orientation);return o=(0,LT.w7)(o,e=>(0,Er.jsx)(NT._N,{value:a,children:e}),[a]),o={role:"toolbar","aria-orientation":l,...o},(0,RT.T)({store:a,...o})}),PT=(0,OT.Rf)(function(e){const t=MT(e);return(0,OT.n)("div",t)}),DT=(0,T.forwardRef)(function({label:e,...t},n){const i=BT({focusLoop:!0,rtl:(0,ee.isRTL)()});return(0,Er.jsx)(gv.A.Provider,{value:i,children:(0,Er.jsx)(PT,{ref:n,"aria-label":e,store:i,...t})})});DT.displayName="ToolbarContainer";var FT=DT,zT=n(93279),VT=(0,T.forwardRef)(function({className:e,label:t,variant:n,...i},r){const o=void 0!==n,s=(0,T.useMemo)(()=>o?{}:{DropdownMenu:{variant:"toolbar"},Dropdown:{variant:"toolbar"},Menu:{variant:"toolbar"}},[o]);if(!t){(0,Qt.A)("Using Toolbar without label prop",{since:"5.6",alternative:"ToolbarGroup component",link:"https://developer.wordpress.org/block-editor/components/toolbar/"});const{title:t,...n}=i;return(0,Er.jsx)(wv,{isCollapsed:!1,...n,className:e})}const a=(0,mh.A)("components-accessible-toolbar",e,n&&`is-${n}`);return(0,Er.jsx)(zT.c7,{value:s,children:(0,Er.jsx)(FT,{className:a,label:t,ref:r,...i})})});VT.displayName="Toolbar";var UT=VT,$T=n(50793);function HT(e){return Array.from(e.querySelectorAll("[data-toolbar-item]:not([disabled])"))}function WT(e){return e.contains(e.ownerDocument.activeElement)}function GT({children:e,focusOnMount:t,focusEditorOnEscape:n=!1,shouldUseKeyboardFocusShortcut:i=!0,__experimentalInitialIndex:r,__experimentalOnIndexChange:o,orientation:s="horizontal",...a}){const l=(0,T.useRef)(),c=function(e){const[t,n]=(0,T.useState)(!0),i=(0,T.useCallback)(()=>{const t=!hS.XC.tabbable.find(e.current).some(e=>!("toolbarItem"in e.dataset));t||(0,Qt.A)("Using custom components as toolbar controls",{since:"5.6",alternative:"ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",link:"https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"}),n(t)},[e]);return(0,T.useLayoutEffect)(()=>{const t=new window.MutationObserver(i);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()},[i,t,e]),t}(l);return function({toolbarRef:e,focusOnMount:t,isAccessibleToolbar:n,defaultIndex:i,onIndexChange:r,shouldUseKeyboardFocusShortcut:o,focusEditorOnEscape:s}){const[a]=(0,T.useState)(t),[l]=(0,T.useState)(i),c=(0,T.useCallback)(()=>{!function(e){const[t]=hS.XC.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)},[e]);(0,$T.wk)("core/block-editor/focus-toolbar",()=>{o&&c()}),(0,T.useEffect)(()=>{a&&c()},[n,a,c]),(0,T.useEffect)(()=>{const t=e.current;let n=0;return a||WT(t)||(n=window.requestAnimationFrame(()=>{const e=HT(t),n=l||0;e[n]&&WT(t)&&e[n].focus({preventScroll:!0})})),()=>{if(window.cancelAnimationFrame(n),!r||!t)return;const e=HT(t).findIndex(e=>0===e.tabIndex);r(e)}},[l,a,r,e]);const{getLastFocus:u}=Gh((0,zt.A)(Qy));(0,T.useEffect)(()=>{const t=e.current;if(s){const e=e=>{const t=u();e.keyCode===Rt._f&&t?.current&&(e.preventDefault(),t.current.focus())};return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}},[s,u,e])}({toolbarRef:l,focusOnMount:t,defaultIndex:r,onIndexChange:o,isAccessibleToolbar:c,shouldUseKeyboardFocusShortcut:i,focusEditorOnEscape:n}),c?(0,Er.jsx)(UT,{label:a["aria-label"],ref:l,orientation:s,...a,children:e}):(0,Er.jsx)(pS.Ay,{orientation:s,role:"toolbar",ref:l,...a,children:e})}function qT({popoverAnchor:e}){return(0,Er.jsx)(uw.Ay,{placement:"top",focusOnMount:!1,anchor:e,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar",children:(0,Er.jsx)(GT,{className:"block-editor-rich-text__inline-format-toolbar-group","aria-label":(0,ee.__)("Format tools"),children:(0,Er.jsx)(wv,{children:(0,Er.jsx)(ST,{})})})})}var KT=({inline:e,editableContentElement:t})=>e?(0,Er.jsx)(qT,{popoverAnchor:t}):(0,Er.jsx)(Mv,{group:"inline",children:(0,Er.jsx)(ST,{})});function YT(e,t){if(sB.isEmpty(e)){const e=Rj(t);return e?`<${e}></${e}>`:""}return Array.isArray(e)?((0,Qt.A)("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),Ao.toHTML(e)):"string"==typeof e?e:e.toHTMLString()}function JT({value:e,tagName:t,multiline:n,format:i,...r}){return e=(0,Er.jsx)(Sr.A,{children:YT(e,n)}),t?(0,Er.jsx)(t,{...r,children:e}):e}var XT=(0,T.forwardRef)(function({children:e,identifier:t,tagName:n="div",value:i="",onChange:r,multiline:o,...s},a){(0,Qt.A)("wp.blockEditor.RichText multiline prop",{since:"6.1",version:"6.3",alternative:"nested blocks (InnerBlocks)",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/nested-blocks-inner-blocks/"});const{clientId:l}=Ih(),{getSelectionStart:c,getSelectionEnd:u}=(0,zt.A)(Qy),{selectionChange:d}=(0,Vt.A)(Qy),h=Rj(o),p=`</${h}>${i=i||`<${h}></${h}>`}<${h}>`.split(`</${h}><${h}>`);function f(e){r(`<${h}>${e.join(`</${h}><${h}>`)}</${h}>`)}return p.shift(),p.pop(),(0,Er.jsx)(n,{ref:a,children:p.map((e,n)=>(0,Er.jsx)(iB,{identifier:`${t}-${n}`,tagName:h,value:e,onChange:e=>{const t=p.slice();t[n]=e,f(t)},isSelected:void 0,onKeyDown:i=>{if(i.keyCode!==Rt.Fm)return;i.preventDefault();const{offset:r}=c(),{offset:o}=u();if("number"!=typeof r||"number"!=typeof o)return;const s=We({html:e});s.start=r,s.end=o;const a=ut(s).map(e=>Be({value:e})),h=p.slice();h.splice(n,1,...a),f(h),d(l,`${t}-${n+1}`,0,0)},onMerge:e=>{const i=p.slice();let r=0;if(e){if(!i[n+1])return;i.splice(n,2,i[n]+i[n+1]),r=i[n].length-1}else{if(!i[n-1])return;i.splice(n-1,2,i[n-1]+i[n]),r=i[n-1].length-1}f(i),d(l,`${t}-${n-(e?0:1)}`,r,r)},...s},n))})}),{useRichText:ZT}=Gh(Gt),QT=(0,T.createContext)();QT.displayName="keyboardShortcutContext";var eB=(0,T.createContext)();eB.displayName="inputEventContext";var tB=Symbol("instanceId");function nB(e){const{__unstableMobileNoFocusOnMount:t,deleteEnter:n,placeholderTextColor:i,textAlign:r,selectionColor:o,tagsToEliminate:s,disableEditingMenu:a,fontSize:l,fontFamily:c,fontWeight:u,fontStyle:d,minWidth:h,maxWidth:p,disableSuggestions:f,disableAutocorrection:m,...g}=e;return g}function iB({children:e,tagName:t="div",value:n="",onChange:i,isSelected:r,multiline:o,inlineToolbar:s,wrapperClassName:a,autocompleters:l,onReplace:c,placeholder:u,allowedFormats:d,withoutInteractiveFormatting:h,onRemove:p,onMerge:f,onSplit:m,__unstableOnSplitAtEnd:g,__unstableOnSplitAtDoubleLineEnd:b,identifier:y,preserveWhiteSpace:v,__unstablePastePlainText:_,__unstableEmbedURLOnPaste:x,__unstableDisableFormats:k,disableLineBreaks:w,__unstableAllowPrefixTransformations:C,readOnly:S,...A},I){A=nB(A),m&&(0,Qt.A)("wp.blockEditor.RichText onSplit prop",{since:"6.4",alternative:'block.json support key: "splitting"'});const E=(0,SS.A)(iB),j=(0,T.useRef)(),[B,N]=(0,T.useState)(null),R=Ih(),{clientId:O,isSelected:L,name:M}=R,P=R[xh],D=(0,T.useContext)(Sj),z=(0,yt.A)(),{selectionStart:V,selectionEnd:U,isSelected:$}=(0,zt.A)(e=>{if(!L)return{isSelected:!1};const{getSelectionStart:t,getSelectionEnd:n}=e(Qy),i=t(),o=n();let s;return void 0===r?s=i.clientId===O&&o.clientId===O&&(y?i.attributeKey===y:i[tB]===E):r&&(s=i.clientId===O),{selectionStart:s?i.offset:void 0,selectionEnd:s?o.offset:void 0,isSelected:s}},[O,y,E,r,L]),{disableBoundBlock:H,bindingsPlaceholder:W,bindingsLabel:G}=(0,zt.A)(e=>{if(!P?.[y])return{};const{__experimentalBlockBindingsSupportedAttributes:t}=e(Qy).getSettings(),i=t?.[M];if(!i)return{};const r=P[y],o=Cn(r.source),s={};if(o?.usesContext?.length)for(const e of o.usesContext)s[e]=D[e];const a=!o?.canUserEditValue?.({select:e,context:s,args:r.args});if(n.length>0)return{disableBoundBlock:a,bindingsPlaceholder:null,bindingsLabel:null};const{getBlockAttributes:l}=e(Qy),c=l(O);let u=null;if(o?.getFieldsList){const t=o.getFieldsList({select:e,context:s});u=t?.find(e=>F(e.args,r?.args))?.label}const d=u??o?.label,h=a?d:(0,ee.sprintf)((0,ee.__)("Add %s"),d),p=a?r?.args?.key||o?.label:(0,ee.sprintf)((0,ee.__)("Empty %s; start writing to edit its value"),r?.args?.key||o?.label);return{disableBoundBlock:a,bindingsPlaceholder:c?.placeholder||h,bindingsLabel:p}},[P,y,M,n,O,D]),q=S||H||!!D?.["pattern/overrides"]&&!("core/pattern-overrides"===P?.__default?.source),{getSelectionStart:K,getSelectionEnd:Y,getBlockRootClientId:J}=(0,zt.A)(Qy),{selectionChange:X}=(0,Vt.A)(Qy),Z=Oj({allowedFormats:d,disableFormats:k}),Q=!Z||Z.length>0,te=(0,T.useCallback)((e,t)=>{const n={},i=void 0===e&&void 0===t,r={clientId:O,[y?"attributeKey":tB]:y||E};if("number"==typeof e||i){if(void 0===t&&J(O)!==J(Y().clientId))return;n.start={...r,offset:e}}if("number"==typeof t||i){if(void 0===e&&J(O)!==J(K().clientId))return;n.end={...r,offset:t}}X(n)},[O,J,Y,K,y,E,X]),{value:ne,getValue:ie,onChange:re,ref:oe,formatTypes:se}=ZT({value:n,onChange:i,selectionStart:V,selectionEnd:U,onSelectionChange:te,placeholder:W||u,__unstableIsSelected:$,__unstableDisableFormats:k,preserveWhiteSpace:v,__unstableDependencies:[t],allowedFormats:Z,withoutInteractiveFormatting:h,__unstableFormatTypeHandlerContext:(0,T.useMemo)(()=>({richTextIdentifier:y,blockClientId:O}),[y,O])}),ae=function(e){return eT({...e,completers:kT(e)})}({onReplace:c,completers:l,record:ne,onChange:re});!function({html:e,value:t}){const n=(0,T.useRef)(),i=!!t.activeFormats?.length,{__unstableMarkLastChangeAsPersistent:r}=(0,Vt.A)(Qy);(0,T.useLayoutEffect)(()=>{if(n.current){if(n.current!==t.text){const e=window.setTimeout(()=>{r()},1e3);return n.current=t.text,()=>{window.clearTimeout(e)}}r()}else n.current=t.text},[e,i])}({html:n,value:ne});const le=(0,T.useRef)(new Set),ce=(0,T.useRef)(new Set);function ue(){j.current?.focus()}const de=t;return(0,Er.jsxs)(Er.Fragment,{children:[$&&(0,Er.jsx)(QT.Provider,{value:le,children:(0,Er.jsx)(eB.Provider,{value:ce,children:(0,Er.jsxs)(uw.Ay.__unstableSlotNameProvider,{value:"__unstable-block-tools-after",children:[e&&e({value:ne,onChange:re,onFocus:ue}),(0,Er.jsx)($j,{value:ne,onChange:re,onFocus:ue,formatTypes:se,forwardedRef:j})]})})}),$&&Q&&(0,Er.jsx)(KT,{inline:s,editableContentElement:B}),(0,Er.jsx)(de,{role:"textbox","aria-multiline":!w,"aria-readonly":q,...A,draggable:void 0,"aria-label":G||A["aria-label"]||u,...ae,ref:(0,gt.A)([oe,I,ae.ref,A.ref,Fj({registry:z,getValue:ie,onChange:re,__unstableAllowPrefixTransformations:C,formatTypes:se,onReplace:c,selectionChange:X,isSelected:$,disableFormats:k,value:ne,tagName:t,onSplit:m,__unstableEmbedURLOnPaste:x,pastePlainText:_,onMerge:f,onRemove:p,disableLineBreaks:w,onSplitAtEnd:g,onSplitAtDoubleLineEnd:b,keyboardShortcuts:le,inputEvents:ce}),j,N]),contentEditable:!q,suppressContentEditableWarning:!0,className:(0,mh.A)("block-editor-rich-text__editable",A.className,"rich-text"),tabIndex:0!==A.tabIndex||q?A.tabIndex:null,"data-wp-block-attribute-key":y})]})}var rB=function(e){return(0,T.forwardRef)((t,n)=>{let i=t.value,r=t.onChange;Array.isArray(i)&&((0,Qt.A)("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),i=Ao.toHTML(t.value),r=e=>t.onChange(Ao.fromDOM(ke(document,e).childNodes)));const o=t.multiline?XT:e;return(0,Er.jsx)(o,{...t,value:i,onChange:r,ref:n})})}((0,T.forwardRef)(iB));rB.Content=JT,rB.isEmpty=e=>!e||0===e.length;var oB=(0,T.forwardRef)((e,t)=>{if(Ih()[kh]){const{children:n,tagName:i="div",value:r,onChange:o,isSelected:s,multiline:a,inlineToolbar:l,wrapperClassName:c,autocompleters:u,onReplace:d,placeholder:h,allowedFormats:p,withoutInteractiveFormatting:f,onRemove:m,onMerge:g,onSplit:b,__unstableOnSplitAtEnd:y,__unstableOnSplitAtDoubleLineEnd:v,identifier:_,preserveWhiteSpace:x,__unstablePastePlainText:k,__unstableEmbedURLOnPaste:w,__unstableDisableFormats:C,disableLineBreaks:S,__unstableAllowPrefixTransformations:A,readOnly:I,...E}=nB(e);return(0,Er.jsx)(i,{ref:t,...E,dangerouslySetInnerHTML:{__html:YT(r,a)||"<br>"}})}return(0,Er.jsx)(rB,{ref:t,...e,readOnly:!1})});oB.Content=JT,oB.isEmpty=e=>!e||0===e.length;var sB=oB,{useRichText:aB}=Gh(Gt);function lB({data:e,field:t,hideLabelFromVision:n,onChange:i,config:r={}}){const o=(0,yt.A)(),s=t.getValue({item:e}),a=t.config||{},{clientId:l}=r,[c,u]=(0,T.useState)({start:void 0,end:void 0}),[d,h]=(0,T.useState)(!1),p=(0,T.useRef)(),f=(0,T.useRef)(new Set),m=(0,T.useRef)(new Set),g=Oj({allowedFormats:a?.allowedFormats,disableFormats:a?.disableFormats}),{value:b,getValue:y,onChange:v,ref:_,formatTypes:x}=aB({value:s,onChange(n){i(t.setValue({item:e,value:n}))},selectionStart:c.start,selectionEnd:c.end,onSelectionChange:(e,t)=>u({start:e,end:t}),__unstableIsSelected:d,preserveWhiteSpace:!!a?.preserveWhiteSpace,placeholder:a?.placeholder,__unstableDisableFormats:a?.disableFormats,allowedFormats:g,withoutInteractiveFormatting:a?.withoutInteractiveFormatting,__unstableFormatTypeHandlerContext:(0,T.useMemo)(()=>({richTextIdentifier:t.id,blockClientId:l}),[t.id,l])}),{baseControlProps:k,controlProps:w}=(0,Nj.Y)({hideLabelFromVision:n??t.hideLabelFromVision,label:t.label});return(0,Er.jsxs)(Er.Fragment,{children:[d&&(0,Er.jsx)(QT.Provider,{value:m,children:(0,Er.jsx)(eB.Provider,{value:f,children:(0,Er.jsx)("div",{children:(0,Er.jsx)($j,{value:b,onChange:v,onFocus:function(){p.current?.focus()},formatTypes:x,forwardedRef:p,isVisible:!1})})})}),(0,Er.jsx)(mk.Ay,{...k,children:(0,Er.jsx)("div",{className:"block-editor-content-only-controls__rich-text",role:"textbox","aria-multiline":!a?.disableLineBreaks,ref:(0,gt.A)([_,Fj({registry:o,getValue:y,onChange:v,formatTypes:x,selectionChange:u,isSelected:d,disableFormats:a?.disableFormats,value:b,tagName:"div",disableLineBreaks:a?.disableLineBreaks,keyboardShortcuts:m,inputEvents:f}),p]),onFocus:()=>h(!0),onBlur:()=>h(!1),contentEditable:!0,...w})})]})}var cB=n(74960),uB=n(83386),dB=n(23701);function hB({data:e,field:t,attachment:n,config:i}){const{allowedTypes:r=[],multiple:o=!1}=i||{};if(o)return"todo multiple";if("image"===n?.media_type||n?.poster)return(0,Er.jsx)("div",{className:"block-editor-content-only-controls__media-thumbnail",children:(0,Er.jsx)("img",{alt:"",width:20,height:20,src:"image"===n.media_type?n.source_url:n.poster})});if(1===r.length){const n=t.getValue({item:e}),i=n?.url;if("image"===r[0]&&i)return(0,Er.jsx)("div",{className:"block-editor-content-only-controls__media-thumbnail",children:(0,Er.jsx)("img",{alt:"",width:20,height:20,src:i})});let o;if(o="image"===r[0]?cB.A:"video"===r[0]?uB.A:"audio"===r[0]?dB.A:yS.A,o)return(0,Er.jsx)(IC.A,{icon:o,size:20})}return(0,Er.jsx)(IC.A,{icon:yS.A,size:20})}function pB({data:e,field:t,onChange:n,config:i={}}){const{popoverProps:r}=jj({isControl:!0}),o=t.getValue({item:e}),{allowedTypes:s=[],multiple:a=!1,useFeaturedImage:l=!1}=i,c=o?.id,u=o?.url,d=(0,zt.A)(e=>{if(!c)return;const t=e(Qy).getSettings()[Fh];return t?t(e,c):void 0},[c]);let h;if(1===s.length){const e=s[0];h="image"===e?(0,ee.__)("Image"):"video"===e?(0,ee.__)("Video"):"application"===e?(0,ee.__)("File"):(0,ee.__)("Media")}else h=(0,ee.__)("Media");const p=(0,T.useRef)();return(0,Er.jsx)(xS,{children:(0,Er.jsxs)("div",{ref:p,className:"block-editor-content-only-controls",children:[(0,Er.jsx)(oI,{className:"block-editor-content-only-controls__media-replace-flow",allowedTypes:s,mediaId:c,mediaURL:u,multiple:a,popoverProps:r,onReset:()=>{n(t.setValue({item:e,value:{}}))},...l&&{useFeaturedImage:!!o?.featuredImage,onToggleFeaturedImage:()=>{n(t.setValue({item:e,value:{featuredImage:!o?.featuredImage}}))}},onSelect:i=>{if(i.id&&i.url){const r={...i,mediaType:i.media_type};l&&(r.featuredImage=!1),n(t.setValue({item:e,value:r}))}},renderToggle:n=>(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,className:"block-editor-content-only-controls__media",...n,children:(0,Er.jsxs)(Jw,{rowGap:0,columnGap:8,templateColumns:"20px 1fr",className:"block-editor-content-only-controls__media-row",children:[u&&(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(hB,{attachment:d,field:t,data:e,config:i}),(0,Er.jsx)("span",{className:"block-editor-content-only-controls__media-title",children:d?.title?.raw&&""!==d?.title?.raw?d?.title?.raw:u})]}),!u&&(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)("span",{className:"block-editor-content-only-controls__media-placeholder",style:{width:"20px",height:"20px"}}),(0,Er.jsx)("span",{className:"block-editor-content-only-controls__media-title",children:h})]})]})})}),u&&(0,Er.jsx)(fv.Ay,{label:(0,ee.__)("Reset"),className:"block-editor-content-only-controls__media-reset",size:"small",icon:uS.A,onClick:()=>{n(t.setValue({item:e,value:{}})),(e=>{window.requestAnimationFrame(()=>{const[t]=hS.XC.tabbable.find(e?.current);t&&t.focus()})})(p)}})]})})}var fB=n(25557),mB=n(83938),gB="noreferrer noopener",bB="_blank",yB="nofollow";function vB({data:e,field:t,onChange:n}){const[i,r]=(0,T.useState)(!1),{popoverProps:o}=jj({isControl:!0}),s=t.getValue({item:e}),a=s?.url,l=s?.rel||"",c=s?.linkTarget,u=c===bB,d=l===yB,h=(0,T.useMemo)(()=>({url:a,opensInNewTab:u,nofollow:d}),[a,u,d]);return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,className:"block-editor-content-only-controls__link",onClick:()=>{r(!0)},children:(0,Er.jsxs)(Jw,{rowGap:0,columnGap:8,templateColumns:"24px 1fr",className:"block-editor-content-only-controls__link-row",children:[a&&(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(IC.A,{icon:fB.A,size:24}),(0,Er.jsx)("span",{className:"block-editor-content-only-controls__link-title",children:a})]}),!a&&(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(IC.A,{icon:fB.A,size:24,style:{opacity:.3}}),(0,Er.jsx)("span",{className:"block-editor-content-only-controls__link-title",children:(0,ee.__)("Link")})]})]})}),i&&(0,Er.jsx)(uw.Ay,{onClose:()=>{r(!1)},...o??{},children:(0,Er.jsx)(tI,{value:h,onChange:i=>{const r=function({rel:e="",url:t="",opensInNewTab:n,nofollow:i}){let r,o=e;if(n)r=bB,o=o?.includes(gB)?o:o+` ${gB}`;else{const e=new RegExp(`\\b${gB}\\s*`,"g");o=o?.replace(e,"").trim()}if(i)o=o?.includes(yB)?o:(o+` ${yB}`).trim();else{const e=new RegExp(`\\b${yB}\\s*`,"g");o=o?.replace(e,"").trim()}return{url:(0,mB.N)(t),linkTarget:r,rel:o||void 0}}({rel:l,...i});n(t.setValue({item:e,value:r}))},onRemove:()=>{n(t.setValue({item:e,value:{}}))}})})]})}var{fieldsKey:_B,formKey:xB}=Gh(ia);function kB(e,t={}){return function(n){return(0,Er.jsx)(e,{...n,config:t})}}function wB({clientId:e,blockType:t,setAttributes:n,isMultiBlock:i=!1}){const r=Aj({clientId:e,context:"list-view"}),o=Ej(e),s=t?.[_B],a=(0,T.useContext)(Sj),l=(0,zt.A)(t=>{const n=t(Qy).getBlockAttributes(e);if(!n?.metadata?.bindings)return n;const{getBlockBindingsSource:i}=Gh(t(Zi));return Object.entries(n.metadata.bindings).reduce((e,[n,r])=>{const o=i(r.source);if(!o)return e;const s=o.getValues({select:t,context:a,bindings:{[n]:r}});return{...e,...s}},n)},[a,e]),{selectBlock:c,toggleBlockHighlight:u}=(0,Vt.A)(Qy),d=(0,uj.A)(u,50),h=(0,T.useMemo)(()=>i?{...t?.[xB],fields:[t?.[xB]?.fields?.[0]]}:t?.[xB],[t,i]),[p,f]=(0,T.useState)(h),m=(0,T.useMemo)(()=>s?.length?s.map(t=>{const n={...t};return"string"==typeof t.Edit&&"rich-text"===t.Edit?n.Edit=kB(lB,{clientId:e}):"string"==typeof t.Edit&&"link"===t.Edit?n.Edit=kB(vB):"object"==typeof t.Edit&&"media"===t.Edit.control&&(n.Edit=kB(pB,{...t.Edit})),n}):[],[s,e]);return s?.length?(0,Er.jsxs)("div",{className:"block-editor-block-fields__container",onMouseEnter:i?()=>d(e,!0):void 0,onMouseLeave:()=>i?d(e,!1):void 0,onFocus:i?()=>{c(e,null)}:void 0,children:[(0,Er.jsx)("div",{className:"block-editor-block-fields__header",children:(0,Er.jsxs)(Cw.A,{spacing:1,children:[i&&(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(hj,{className:"block-editor-block-fields__header-icon",icon:o?.icon}),(0,Er.jsx)("h2",{className:"block-editor-block-fields__header-title",children:(0,Er.jsx)(xC.A,{numberOfLines:1,children:r})}),(0,Er.jsx)(Tj,{fields:m,visibleFields:p.fields,onToggleField:e=>{f(t=>t.fields?.includes(e)?{...t,fields:t.fields.filter(t=>t!==e)}:{...t,fields:[...t.fields||[],e]})}})]}),!i&&(0,Er.jsx)("h2",{className:"block-editor-block-fields__header-title",children:(0,ee.__)("Content")})]})}),(0,Er.jsx)(kj.A,{data:l,fields:m,form:p,onChange:n})]}):null}var CB={edit:function(e){const{blockType:t,isSelectionWithinCurrentSection:n}=(0,T.useContext)(Bj);return(0,Er.jsx)(yw,{group:"content",children:(0,Er.jsx)(wB,{...e,blockType:t,isMultiBlock:n})})},hasSupport:function(e){return!(!window?.__experimentalContentOnlyInspectorFields||!bn(e)?.[_B])},attributeKeys:[],supportsPatternEditing:!0},SB={edit:function({className:e,setAttributes:t}){return"default"!==Vk()?null:(0,Er.jsx)(oC,{group:"advanced",children:(0,Er.jsx)(kS.A,{__next40pxDefaultSize:!0,autoComplete:"off",label:(0,ee.__)("Additional CSS class(es)"),value:e||"",onChange:e=>{t({className:""!==e?e:void 0})},help:(0,ee.__)("Separate multiple classes with spaces.")})})},addSaveProps:function(e,t,n){return _n(t,"customClassName",!0)&&n.className&&(e.className=(0,mh.A)(e.className,n.className)),e},attributeKeys:["className"],hasSupport:e=>_n(e,"customClassName",!0)};(0,Ei.U2)("blocks.registerBlockType","core/editor/custom-class-name/attribute",function(e){return _n(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e}),(0,Ei.U2)("blocks.switchToBlockType.transformedBlock","core/customClassName/addTransforms",function(e,t,n,i){if(!_n(e.name,"customClassName",!0))return e;if(1===i.length&&e.innerBlocks.length===t.length)return e;if(1===i.length&&t.length>1||i.length>1&&1===t.length)return e;if(t[n]){const i=t[n]?.attributes.className;if(i&&void 0===e.attributes.className)return{...e,attributes:{...e.attributes,className:i}}}return e}),(0,Ei.U2)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",function(e,t){return _n(t,"className",!0)&&("string"==typeof e.className?e.className=[...new Set([jr(t.name),...e.className.split(" ")])].join(" ").trim():e.className=jr(t.name)),e});var AB=/^([\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)?$/,IB=["top","right","bottom","left"],EB=["color","style","width"],jB=e=>!e||!EB.some(t=>void 0!==e[t]),TB=(e={})=>Object.keys(e).some(e=>-1!==IB.indexOf(e)),BB=e=>{if(!TB(e))return!1;const t=IB.map(t=>NB(e?.[t]));return!t.every(e=>e===t[0])},NB=(e,t)=>{if(jB(e))return t;const{color:n,style:i,width:r}=t||{},{color:o=n,style:s=i,width:a=r}=e;return[a,a&&"0"!==a||o?s||"solid":s,o].filter(Boolean).join(" ")},RB=e=>{const t=e.map(e=>void 0===e?void 0:function(e){const t=e.trim().match(AB);if(!t)return[void 0,void 0];const[,n,i]=t;let r=parseFloat(n);return r=Number.isNaN(r)?void 0:r,[r,i]}(`${e}`)[1]),n=t.filter(e=>void 0!==e);return function(e){if(0===e.length)return;const t={};let n,i=0;return e.forEach(e=>{t[e]=void 0===t[e]?1:t[e]+1,t[e]>i&&(n=e,i=t[e])}),n}(n)};(0,te.X$)([ne.A,ie.A]);var{kebabCase:OB}=Gh(Ev.j),LB=(e,t,n)=>{if(t){const n=e?.find(e=>e.slug===t);if(n)return n}return{color:n}};function MB(e,t){if(e&&t)return`has-${OB(t)}-${e}`}function PB(){const[e,t,n,i,r,o,s,a,l,c]=tv("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:!o};return u.colors=(0,T.useMemo)(()=>{const e=[];return n&&n.length&&e.push({name:(0,ee._x)("Theme","Indicates this palette comes from the theme."),slug:"theme",colors:n}),r&&i&&i.length&&e.push({name:(0,ee._x)("Default","Indicates this palette comes from WordPress."),slug:"default",colors:i}),t&&t.length&&e.push({name:(0,ee._x)("Custom","Indicates this palette is created by the user."),slug:"custom",colors:t}),e},[t,n,i,r]),u.gradients=(0,T.useMemo)(()=>{const e=[];return a&&a.length&&e.push({name:(0,ee._x)("Theme","Indicates this palette comes from the theme."),slug:"theme",gradients:a}),c&&l&&l.length&&e.push({name:(0,ee._x)("Default","Indicates this palette comes from WordPress."),slug:"default",gradients:l}),s&&s.length&&e.push({name:(0,ee._x)("Custom","Indicates this palette is created by the user."),slug:"custom",gradients:s}),e},[s,a,l,c]),u.hasColorsOrGradients=!!u.colors.length||!!u.gradients.length,u}var DB=(0,tx.AH)("",""),FB={name:"bjn8wh",styles:"position:relative"},zB=e=>{const{color:t=nx.l.gray[200],style:n="solid",width:i=rx.A.borderWidth}=e||{};return`${t} ${i&&"0"!==i||t?n||"solid":n} ${i!==rx.A.borderWidth?`clamp(1px, ${i}, 10px)`:i}`},VB={name:"1nwbfnf",styles:"grid-column:span 2;margin:0 auto"};var UB=(0,Dw.KZ)((e,t)=>{const{className:n,isLinked:i,...r}=function(e){const{className:t,size:n="default",...i}=(0,Mw.A)(e,"BorderBoxControlLinkedButton"),r=(0,Pw.l)();return{...i,className:(0,T.useMemo)(()=>r((e=>(0,tx.AH)("position:absolute;top:","__unstable-large"===e?"8px":"3px",";",(0,ix.h)({right:0})()," line-height:0;",""))(n),t),[t,r,n])}}(e),o=i?(0,ee.__)("Unlink sides"):(0,ee.__)("Link sides");return(0,Er.jsx)(fv.Ay,{...r,size:"small",icon:i?fB.A:IS.A,iconSize:24,label:o,ref:t,className:n})},"BorderBoxControlLinkedButton");var $B=(0,Dw.KZ)((e,t)=>{const{value:n,...i}=function(e){const{className:t,value:n,size:i="default",...r}=(0,Mw.A)(e,"BorderBoxControlVisualizer"),o=(0,Pw.l)();return{...r,className:(0,T.useMemo)(()=>o(((e,t)=>(0,tx.AH)("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:",zB(e?.top),";border-bottom:",zB(e?.bottom),";",(0,ix.h)({borderLeft:zB(e?.left)})()," ",(0,ix.h)({borderRight:zB(e?.right)})(),";",""))(n,i),t),[o,t,n,i]),value:n}}(e);return(0,Er.jsx)(qw.A,{...i,ref:t})},"BorderBoxControlVisualizer"),HB=n(20541),WB=n(40251),GB=n(90504),qB=[{label:(0,ee.__)("Solid"),icon:HB.A,value:"solid"},{label:(0,ee.__)("Dashed"),icon:WB.A,value:"dashed"},{label:(0,ee.__)("Dotted"),icon:GB.A,value:"dotted"}],KB=(0,Dw.KZ)(function({onChange:e,...t},n){return(0,Er.jsx)(Jv.A,{__next40pxDefaultSize:!0,ref:n,isDeselectable:!0,onChange:t=>{e?.(t)},...t,children:qB.map(e=>(0,Er.jsx)(Xv.A,{value:e.value,icon:e.icon,label:e.label},e.value))})},"BorderControlStylePicker"),YB=KB,JB=(0,tx.AH)("box-shadow:inset ",rx.A.controlBoxShadowFocus,";",""),XB=(0,tx.AH)("border:0;padding:0;margin:0;",FC.r,";",""),ZB=(0,tx.AH)(lx,"{flex:0 0 auto;}",""),QB=(0,tx.AH)("background:#fff;&&>button{aspect-ratio:1;padding:0;display:flex;align-items:center;justify-content:center;",(0,ix.h)({borderRadius:"2px 0 0 2px"},{borderRadius:"0 2px 2px 0"})()," border:",rx.A.borderWidth," solid ",nx.l.ui.border,";&:focus,&:hover:not( :disabled ){",JB," border-color:",nx.l.ui.borderFocus,";z-index:1;position:relative;}}",""),eN=(0,tx.AH)("width:",228,"px;>div:first-of-type>",Aw.Gw,"{margin-bottom:0;}&& ",Aw.Gw,"+button:not( .has-text ){min-width:24px;padding:0;}",""),tN=(0,tx.AH)("",""),nN=(0,tx.AH)("",""),iN={name:"1ghe26v",styles:"display:flex;justify-content:flex-end;margin-top:12px"},rN=e=>e.replace(/^var\((.+)\)$/,"$1"),oN=(0,Dw.KZ)((e,t)=>{const{__experimentalIsRenderedInSidebar:n,border:i,colors:r,disableCustomColors:o,enableAlpha:s,enableStyle:a,indicatorClassName:l,indicatorWrapperClassName:c,isStyleSettable:u,onReset:d,onColorChange:h,onStyleChange:p,popoverContentClassName:f,popoverControlsClassName:m,resetButtonWrapperClassName:g,size:b,__unstablePopoverProps:y,...v}=function(e){const{border:t,className:n,colors:i=[],enableAlpha:r=!1,enableStyle:o=!0,onChange:s,previousStyleSelection:a,size:l="default",__experimentalIsRenderedInSidebar:c=!1,...u}=(0,Mw.A)(e,"BorderControlDropdown"),[d]=X_(t?.width),h=0===d,p=(0,Pw.l)(),f=(0,T.useMemo)(()=>p(QB,n),[n,p]),m=(0,T.useMemo)(()=>p(nN),[p]),g=(0,T.useMemo)(()=>p(((e,t)=>{const{style:n}=e||{};return(0,tx.AH)("border-radius:",rx.A.radiusFull,";border:2px solid transparent;",n?(e=>{const{color:t,style:n}=e||{},i=n&&"none"!==n?nx.l.gray[300]:void 0;return(0,tx.AH)("border-style:","none"===n?"solid":n,";border-color:",t||i,";","")})(e):void 0," width:","__unstable-large"===t?"24px":"22px",";height:","__unstable-large"===t?"24px":"22px",";padding:","__unstable-large"===t?"2px":"1px",";&>span{height:",(0,ax.x)(4),";width:",(0,ax.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,T.useMemo)(()=>p(eN),[p]),y=(0,T.useMemo)(()=>p(tN),[p]),v=(0,T.useMemo)(()=>p(iN),[p]);return{...u,border:t,className:f,colors:i,enableAlpha:r,enableStyle:o,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:y,popoverControlsClassName:b,resetButtonWrapperClassName:v,size:l,__experimentalIsRenderedInSidebar:c}}(e),{color:_,style:x}=i||{},k=((e,t)=>{if(e&&t){if(PI(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)}})(_,r),w=((e,t,n,i)=>{if(i){if(t){const e=rN(t.color);return n?(0,ee.sprintf)((0,ee.__)('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,ee.sprintf)((0,ee.__)('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=rN(e);return n?(0,ee.sprintf)((0,ee.__)('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,ee.sprintf)((0,ee.__)('Border color and style picker. The currently selected color has a value of "%s".'),t)}return(0,ee.__)("Border color and style picker.")}return t?(0,ee.sprintf)((0,ee.__)('Border color picker. The currently selected color is called "%1$s" and has a value of "%2$s".'),t.name,rN(t.color)):e?(0,ee.sprintf)((0,ee.__)('Border color picker. The currently selected color has a value of "%s".'),rN(e)):(0,ee.__)("Border color picker.")})(_,k,x,a),C=_||x&&"none"!==x,S=n?"bottom left":void 0;return(0,Er.jsx)(wC.A,{renderToggle:({onToggle:e})=>(0,Er.jsx)(fv.Ay,{onClick:e,variant:"tertiary","aria-label":w,tooltipPosition:S,label:(0,ee.__)("Border color and style picker"),showTooltip:!0,__next40pxDefaultSize:"__unstable-large"===b,children:(0,Er.jsx)("span",{className:c,children:(0,Er.jsx)(CI.A,{className:l,colorValue:_})})}),renderContent:()=>(0,Er.jsx)(Er.Fragment,{children:(0,Er.jsxs)(CC.A,{paddingSize:"medium",children:[(0,Er.jsxs)(Q_.A,{className:m,spacing:6,children:[(0,Er.jsx)(UI,{className:f,value:_,onChange:h,colors:r,disableCustomColors:o,__experimentalIsRenderedInSidebar:n,clearable:!1,enableAlpha:s}),a&&u&&(0,Er.jsx)(YB,{label:(0,ee.__)("Style"),value:x,onChange:p})]}),(0,Er.jsx)("div",{className:g,children:(0,Er.jsx)(fv.Ay,{variant:"tertiary",onClick:()=>{d()},disabled:!C,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,ee.__)("Reset")})})]})}),popoverProps:{...y},...v,ref:t})},"BorderControlDropdown"),sN=oN,aN=e=>void 0!==e?.width&&""!==e.width||void 0!==e?.color;var lN=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,Er.jsx)(kC.A,{as:"legend",children:t}):(0,Er.jsx)(Aw.Gw,{as:"legend",children:t}):null},cN=(0,Dw.KZ)((e,t)=>{const{__next40pxDefaultSize:n=!1,colors:i,disableCustomColors:r,disableUnits:o,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:y,showDropdownHeader:v,size:_,sliderClassName:x,value:k,widthUnit:w,widthValue:C,withSlider:S,__experimentalIsRenderedInSidebar:A,...I}=function(e){const{className:t,colors:n=[],isCompact:i,onChange:r,enableAlpha:o=!0,enableStyle:s=!0,shouldSanitizeBorder:a=!0,size:l="default",value:c,width:u,__experimentalIsRenderedInSidebar:d=!1,__next40pxDefaultSize:h,__shouldNotWarnDeprecated36pxSize:p,...f}=(0,Mw.A)(e,"BorderControl");(0,bx.M)({componentName:"BorderControl",__next40pxDefaultSize:h,size:l,__shouldNotWarnDeprecated36pxSize:p});const m="default"===l&&h?"__unstable-large":l,[g,b]=X_(c?.width),y=b||"px",v=0===g,[_,x]=(0,T.useState)(),[k,w]=(0,T.useState)(),C=!a||aN(c),S=(0,T.useCallback)(e=>{!a||aN(e)?r(e):r(void 0)},[r,a]),A=(0,T.useCallback)(e=>{const t=""===e?void 0:e,[n]=X_(e),i=0===n,r={...c,width:t};i&&!v&&(x(c?.color),w(c?.style),r.color=void 0,r.style="none"),!i&&v&&(void 0===r.color&&(r.color=_),"none"===r.style&&(r.style=k)),S(r)},[c,v,_,k,S]),I=(0,T.useCallback)(e=>{A(`${e}${y}`)},[A,y]),E=(0,Pw.l)(),j=(0,T.useMemo)(()=>E(XB,t),[t,E]);let B=u;i&&(B="__unstable-large"===l?"116px":"90px");const N=(0,T.useMemo)(()=>{const e=!!B&&ZB,t=(e=>(0,tx.AH)("height:","__unstable-large"===e?"40px":"30px",";",""))(m);return E((0,tx.AH)(lx,"{flex:1 1 40%;}&& ",hx,"{min-height:0;}",""),e,t)},[B,E,m]),R=(0,T.useMemo)(()=>E((0,tx.AH)("flex:1 1 60%;",(0,ix.h)({marginRight:(0,ax.x)(3)})(),";","")),[E]);return{...f,className:j,colors:n,enableAlpha:o,enableStyle:s,innerWrapperClassName:N,inputWidth:B,isStyleSettable:C,onBorderChange:S,onSliderChange:I,onWidthChange:A,previousStyleSelection:k,sliderClassName:R,value:c,widthUnit:y,widthValue:g,size:m,__experimentalIsRenderedInSidebar:d,__next40pxDefaultSize:h}}(e);return(0,Er.jsxs)(qw.A,{as:"fieldset",...I,ref:t,children:[(0,Er.jsx)(lN,{label:h,hideLabelFromVision:l}),(0,Er.jsxs)(Cw.A,{spacing:4,className:c,children:[(0,Er.jsx)(vx,{__next40pxDefaultSize:n,__shouldNotWarnDeprecated36pxSize:!0,prefix:(0,Er.jsx)($I.A,{marginRight:1,marginBottom:0,children:(0,Er.jsx)(sN,{border:k,colors:i,__unstablePopoverProps:b,disableCustomColors:r,enableAlpha:s,enableStyle:a,isStyleSettable:d,onChange:p,previousStyleSelection:y,__experimentalIsRenderedInSidebar:A,size:_})}),label:(0,ee.__)("Border width"),hideLabelFromVision:!0,min:0,onChange:m,value:k?.width||"",placeholder:g,disableUnits:o,__unstableInputWidth:u,size:_}),S&&(0,Er.jsx)(gk.A,{label:(0,ee.__)("Border width"),hideLabelFromVision:!0,className:x,initialPosition:0,max:100,min:0,onChange:f,step:["px","%"].includes(w)?1:.1,value:C||void 0,withInputField:!1,__next40pxDefaultSize:n,__shouldNotWarnDeprecated36pxSize:!0})]})]})},"BorderControl"),uN=cN;var dN=(0,Dw.KZ)((e,t)=>{const{centeredClassName:n,colors:i,disableCustomColors:r,enableAlpha:o,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:i=!1,enableStyle:r=!0,size:o="default",__experimentalIsRenderedInSidebar:s=!1,...a}=(0,Mw.A)(e,"BorderBoxControlSplitControls"),l=(0,Pw.l)(),c=(0,T.useMemo)(()=>l((e=>(0,tx.AH)("position:relative;flex:1;width:","__unstable-large"===e?void 0:"80%",";",""))(o),t),[l,t,o]);return{...a,centeredClassName:(0,T.useMemo)(()=>l(VB,t),[l,t]),className:c,colors:n,enableAlpha:i,enableStyle:r,rightAlignedClassName:(0,T.useMemo)(()=>l((0,tx.AH)((0,ix.h)({marginLeft:"auto"})(),";",""),t),[l,t]),size:o,__experimentalIsRenderedInSidebar:s}}(e),[m,g]=(0,T.useState)(null),b=(0,T.useMemo)(()=>l?{placement:l,offset:c,anchor:m,shift:!0}:void 0,[l,c,m]),y={colors:i,disableCustomColors:r,enableAlpha:o,enableStyle:s,isCompact:!0,__experimentalIsRenderedInSidebar:p,size:d,__shouldNotWarnDeprecated36pxSize:!0},v=(0,gt.A)([g,t]);return(0,Er.jsxs)(Jw,{...f,ref:v,gap:3,children:[(0,Er.jsx)($B,{value:h,size:d}),(0,Er.jsx)(uN,{className:n,hideLabelFromVision:!0,label:(0,ee.__)("Top border"),onChange:e=>a(e,"top"),__unstablePopoverProps:b,value:h?.top,...y}),(0,Er.jsx)(uN,{hideLabelFromVision:!0,label:(0,ee.__)("Left border"),onChange:e=>a(e,"left"),__unstablePopoverProps:b,value:h?.left,...y}),(0,Er.jsx)(uN,{className:u,hideLabelFromVision:!0,label:(0,ee.__)("Right border"),onChange:e=>a(e,"right"),__unstablePopoverProps:b,value:h?.right,...y}),(0,Er.jsx)(uN,{className:n,hideLabelFromVision:!0,label:(0,ee.__)("Bottom border"),onChange:e=>a(e,"bottom"),__unstablePopoverProps:b,value:h?.bottom,...y})]})},"BorderBoxControlSplitControls"),hN=dN;function pN(e){const{className:t,colors:n=[],onChange:i,enableAlpha:r=!1,enableStyle:o=!0,size:s="default",value:a,__experimentalIsRenderedInSidebar:l=!1,__next40pxDefaultSize:c,...u}=(0,Mw.A)(e,"BorderBoxControl");(0,bx.M)({componentName:"BorderBoxControl",__next40pxDefaultSize:c,size:s});const d="default"===s&&c?"__unstable-large":s,h=BB(a),p=TB(a),f=p?(e=>{if(!e)return;const t=[],n=[],i=[];IB.forEach(r=>{t.push(e[r]?.color),n.push(e[r]?.style),i.push(e[r]?.width)});const r=t.every(e=>e===t[0]),o=n.every(e=>e===n[0]),s=i.every(e=>e===i[0]);return{color:r?t[0]:void 0,style:o?n[0]:void 0,width:s?i[0]:RB(i)}})(a):a,m=p?a:(e=>{if(e&&!jB(e))return{top:e,right:e,bottom:e,left:e}})(a),g=!isNaN(parseFloat(`${f?.width}`)),[b,y]=(0,T.useState)(!h),v=(0,Pw.l)(),_=(0,T.useMemo)(()=>v(DB,t),[v,t]),x=(0,T.useMemo)(()=>v((0,tx.AH)("flex:1;",(0,ix.h)({marginRight:"24px"})(),";","")),[v]),k=(0,T.useMemo)(()=>v(FB),[v]);return{...u,className:_,colors:n,disableUnits:h&&!g,enableAlpha:r,enableStyle:o,hasMixedBorders:h,isLinked:b,linkedControlClassName:x,onLinkedChange:e=>{if(!e)return i(void 0);if(!h||(t=e)&&EB.every(e=>void 0!==t[e]))return i(jB(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),r={top:{...a?.top,...n},right:{...a?.right,...n},bottom:{...a?.bottom,...n},left:{...a?.left,...n}};if(BB(r))return i(r);const o=jB(r.top)?void 0:r.top;i(o)},onSplitChange:(e,t)=>{const n={...m,[t]:e};BB(n)?i(n):i(e)},toggleLinked:()=>y(!b),linkedValue:f,size:d,splitValue:m,wrapperClassName:k,__experimentalIsRenderedInSidebar:l}}var fN=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,Er.jsx)(kC.A,{as:"label",children:t}):(0,Er.jsx)(Aw.Gw,{children:t}):null},mN=(0,Dw.KZ)((e,t)=>{const{className:n,colors:i,disableCustomColors:r,disableUnits:o,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:y,splitValue:v,toggleLinked:_,wrapperClassName:x,__experimentalIsRenderedInSidebar:k,...w}=pN(e),[C,S]=(0,T.useState)(null),A=(0,T.useMemo)(()=>g?{placement:g,offset:b,anchor:C,shift:!0}:void 0,[g,b,C]),I=(0,gt.A)([S,t]);return(0,Er.jsxs)(qw.A,{className:n,...w,ref:I,children:[(0,Er.jsx)(fN,{label:d,hideLabelFromVision:c}),(0,Er.jsxs)(qw.A,{className:x,children:[u?(0,Er.jsx)(uN,{className:h,colors:i,disableUnits:o,disableCustomColors:r,enableAlpha:s,enableStyle:a,onChange:f,placeholder:l?(0,ee.__)("Mixed"):void 0,__unstablePopoverProps:A,shouldSanitizeBorder:!1,value:p,withSlider:!0,width:"__unstable-large"===y?"116px":"110px",__experimentalIsRenderedInSidebar:k,__shouldNotWarnDeprecated36pxSize:!0,size:y}):(0,Er.jsx)(hN,{colors:i,disableCustomColors:r,enableAlpha:s,enableStyle:a,onChange:m,popoverPlacement:g,popoverOffset:b,value:v,__experimentalIsRenderedInSidebar:k,size:y}),(0,Er.jsx)(UB,{onClick:_,isLinked:u,size:y})]})]})},"BorderBoxControl"),gN=mN;function bN({isLinked:e,...t}){const n=e?(0,ee.__)("Unlink radii"):(0,ee.__)("Link radii");return(0,Er.jsx)(fv.Ay,{...t,className:"components-border-radius-control__linked-button",size:"small",icon:e?fB.A:IS.A,iconSize:24,label:n})}var yN=n(7305),vN=n(28560),_N=n(99307),xN=n(7736),kN=n(97360);function wN({combobox:e,...t}={}){const n=(0,kN.od)(t.store,(0,kN.cJ)(e,["value","items","renderedItems","baseElement","arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"]));(0,kN.UE)(t,n);const i=n.getState(),r=(0,ET.z)({...t,store:n,virtualFocus:(0,jT.Jh)(t.virtualFocus,i.virtualFocus,!0),includesBaseElement:(0,jT.Jh)(t.includesBaseElement,i.includesBaseElement,!1),activeId:(0,jT.Jh)(t.activeId,i.activeId,t.defaultActiveId,null),orientation:(0,jT.Jh)(t.orientation,i.orientation,"vertical")}),o=(0,_N.N)({...t,store:n,placement:(0,jT.Jh)(t.placement,i.placement,"bottom-start")}),s=new String(""),a={...r.getState(),...o.getState(),value:(0,jT.Jh)(t.value,i.value,t.defaultValue,s),setValueOnMove:(0,jT.Jh)(t.setValueOnMove,i.setValueOnMove,!1),labelElement:(0,jT.Jh)(i.labelElement,null),selectElement:(0,jT.Jh)(i.selectElement,null),listElement:(0,jT.Jh)(i.listElement,null)},l=(0,kN.y$)(a,r,o,n);return(0,kN.mj)(l,()=>(0,kN.OH)(l,["value","items"],e=>{if(e.value!==s)return;if(!e.items.length)return;const t=e.items.find(e=>!e.disabled&&null!=e.value);null!=(null==t?void 0:t.value)&&l.setState("value",t.value)})),(0,kN.mj)(l,()=>(0,kN.OH)(l,["mounted"],e=>{e.mounted||l.setState("activeId",a.activeId)})),(0,kN.mj)(l,()=>(0,kN.OH)(l,["mounted","items","value"],t=>{if(e)return;if(t.mounted)return;const n=(0,xN.$r)(t.value),i=n[n.length-1];if(null==i)return;const r=t.items.find(e=>!e.disabled&&e.value===i);r&&l.setState("activeId",r.id)})),(0,kN.mj)(l,()=>(0,kN.vA)(l,["setValueOnMove","moves"],e=>{const{mounted:t,value:n,activeId:i}=l.getState();if(!e.setValueOnMove&&t)return;if(Array.isArray(n))return;if(!e.moves)return;if(!i)return;const o=r.item(i);o&&!o.disabled&&null!=o.value&&l.setState("value",o.value)})),{...r,...o,...l,combobox:e,setValue:e=>l.setState("value",e),setLabelElement:e=>l.setState("labelElement",e),setSelectElement:e=>l.setState("selectElement",e),setListElement:e=>l.setState("listElement",e)}}var CN=n(86466),SN=(0,OT.ab)(function({store:e,...t}){const n=(0,CN.oZ)();e=e||n,(0,jT.V1)(e,!1);const i=(0,LT.Bi)(t.id),r=t.onClick,o=(0,LT._q)(t=>{null==r||r(t),t.defaultPrevented||queueMicrotask(()=>{const t=null==e?void 0:e.getState().selectElement;null==t||t.focus()})});return t={...t,id:i,ref:(0,LT.SV)(e.setLabelElement,t.ref),onClick:o,style:{cursor:"default",...t.style}},(0,jT.HR)(t)}),AN=(0,OT.ph)((0,OT.Rf)(function(e){const t=SN(e);return(0,OT.n)("div",t)})),IN=n(46826),EN={top:"4,10 8,6 12,10",right:"6,4 10,8 6,12",bottom:"4,6 8,10 12,6",left:"10,4 6,8 10,12"},jN=(0,OT.ab)(function({store:e,placement:t,...n}){const i=(0,IN.C_)();e=e||i,(0,jT.V1)(e,!1);const r=(0,IT.O$)(e,e=>t||e.placement).split("-")[0],o=EN[r];return n={children:(0,T.useMemo)(()=>(0,Er.jsx)("svg",{display:"block",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,viewBox:"0 0 16 16",height:"1em",width:"1em",children:(0,Er.jsx)("polyline",{points:o})}),[o]),"aria-hidden":!0,...n,style:{width:"1em",height:"1em",pointerEvents:"none",...n.style}},(0,jT.HR)(n)}),TN=((0,OT.Rf)(function(e){const t=jN(e);return(0,OT.n)("span",t)}),(0,OT.ab)(function({store:e,...t}){const n=(0,CN.hP)();return jN({store:e=e||n,...t})})),BN=(0,OT.Rf)(function(e){const t=TN(e);return(0,OT.n)("span",t)}),NN=n(28047),RN=n(84054),ON=n(82979),LN=n(81545);function MN(e,t){return()=>{const n=t();if(!n)return;let i=0,r=e.item(n);const o=r;for(;r&&null==r.value;){const n=t(++i);if(!n)return;if(r=e.item(n),r===o)break}return null==r?void 0:r.id}}var PN=(0,OT.ab)(function({store:e,name:t,form:n,required:i,showOnKeyDown:r=!0,moveOnKeyDown:o=!0,toggleOnPress:s=!0,toggleOnClick:a=s,...l}){const c=(0,CN.oZ)();e=e||c,(0,jT.V1)(e,!1);const u=l.onKeyDown,d=(0,LT.O4)(r),h=(0,LT.O4)(o),p=(0,IT.O$)(e,"placement").split("-")[0],f=(0,IT.O$)(e,"value"),m=Array.isArray(f),g=(0,LT._q)(t=>{var n;if(null==u||u(t),t.defaultPrevented)return;if(!e)return;const{orientation:i,items:r,activeId:o}=e.getState(),s="horizontal"!==i,a="vertical"!==i,l=!!(null==(n=r.find(e=>!e.disabled&&null!=e.value))?void 0:n.rowId),c={ArrowUp:(l||s)&&MN(e,e.up),ArrowRight:(l||a)&&MN(e,e.next),ArrowDown:(l||s)&&MN(e,e.down),ArrowLeft:(l||a)&&MN(e,e.previous)}[t.key];c&&h(t)&&(t.preventDefault(),e.move(c()));const f="top"===p||"bottom"===p;({ArrowDown:f,ArrowUp:f,ArrowLeft:"left"===p,ArrowRight:"right"===p})[t.key]&&d(t)&&(t.preventDefault(),e.move(o),(0,LN.nz)(t.currentTarget,"keyup",e.show))});l=(0,LT.w7)(l,t=>(0,Er.jsx)(CN.D1,{value:e,children:t}),[e]);const[b,y]=(0,T.useState)(!1),v=(0,T.useRef)(!1);(0,T.useEffect)(()=>{const e=v.current;v.current=!1,e||y(!1)},[f]);const _=(0,IT.O$)(e,e=>{var t;return null==(t=e.labelElement)?void 0:t.id}),x=l["aria-label"],k=l["aria-labelledby"]||_,w=(0,IT.O$)(e,e=>{if(t)return e.items}),C=(0,T.useMemo)(()=>[...new Set(null==w?void 0:w.map(e=>e.value).filter(e=>null!=e))],[w]);l=(0,LT.w7)(l,r=>t?(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsxs)("select",{style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},tabIndex:-1,"aria-hidden":!0,"aria-label":x,"aria-labelledby":null!=x?void 0:k,name:t,form:n,required:i,disabled:l.disabled,value:f,multiple:m,onFocus:()=>{var t;return null==(t=null==e?void 0:e.getState().selectElement)?void 0:t.focus()},onChange:t=>{var n;v.current=!0,y(!0),null==e||e.setValue(m?(n=t.target,Array.from(n.selectedOptions).map(e=>e.value)):t.target.value)},children:[(0,xN.$r)(f).map(e=>null==e||C.includes(e)?null:(0,Er.jsx)("option",{value:e,children:e},e)),C.map(e=>(0,Er.jsx)("option",{value:e,children:e},e))]}),r]}):r,[e,x,k,t,n,i,f,m,C,l.disabled]);const S=(0,Er.jsxs)(Er.Fragment,{children:[f,(0,Er.jsx)(BN,{})]}),A=(0,IT.O$)(e,"contentElement");return l={role:"combobox","aria-autocomplete":"none","aria-labelledby":null!=l["aria-label"]?void 0:_,"aria-haspopup":(0,ON.Tc)(A,"listbox"),"data-autofill":b||void 0,"data-name":t,children:S,...l,ref:(0,LT.SV)(e.setSelectElement,l.ref),onKeyDown:g},l=(0,RN.y)({store:e,toggleOnClick:a,...l}),l=(0,NN.g)({store:e,...l})}),DN=(0,OT.Rf)(function(e){const t=PN(e);return(0,OT.n)("button",t)}),FN=n(62632),zN=(0,T.createContext)(null),VN=(0,OT.ab)(function({store:e,resetOnEscape:t=!0,hideOnEnter:n=!0,focusOnMove:i=!0,composite:r,alwaysVisible:o,...s}){const a=(0,CN.hP)();e=e||a,(0,jT.V1)(e,!1);const l=(0,LT.Bi)(s.id),c=(0,IT.O$)(e,"value"),u=Array.isArray(c),[d,h]=(0,T.useState)(c),p=(0,IT.O$)(e,"mounted");(0,T.useEffect)(()=>{p||h(c)},[p,c]),t=t&&!u;const f=s.onKeyDown,m=(0,LT.O4)(t),g=(0,LT.O4)(n),b=(0,LT._q)(t=>{null==f||f(t),t.defaultPrevented||("Escape"===t.key&&m(t)&&(null==e||e.setValue(d))," "!==t.key&&"Enter"!==t.key||(0,LN.uh)(t)&&g(t)&&(t.preventDefault(),null==e||e.hide()))}),y=(0,T.useContext)(CN.Mz),v=(0,T.useState)(),[_,x]=y||v,k=(0,T.useMemo)(()=>[_,x],[_,x]),[w,C]=(0,T.useState)(null),S=(0,T.useContext)(zN);(0,T.useEffect)(()=>{if(S)return S(e),()=>S(null)},[S,e]),s=(0,LT.w7)(s,t=>(0,Er.jsx)(CN.D1,{value:e,children:(0,Er.jsx)(zN.Provider,{value:C,children:(0,Er.jsx)(CN.Mz.Provider,{value:k,children:t})})}),[e,k]);const A=!!e.combobox;r=null!=r?r:!A&&w!==e;const[I,E]=(0,LT.XB)(r?e.setListElement:null),j=(0,LT.Cy)(I,"role",s.role),B=(r||"listbox"===j||"menu"===j||"tree"===j||"grid"===j)&&u||void 0,N=(0,FN.dK)(p,s.hidden,o),R=N?{...s.style,display:"none"}:s.style;r&&(s={role:"listbox","aria-multiselectable":B,...s});const O=(0,IT.O$)(e,e=>{var t;return _||(null==(t=e.labelElement)?void 0:t.id)});return s={"aria-labelledby":null!=s["aria-label"]?void 0:O,hidden:N,...s,id:l,ref:(0,LT.SV)(E,s.ref),style:R,onKeyDown:b},s=(0,RT.T)({store:e,...s,composite:r}),(0,NN.g)({store:e,typeahead:!A,...s})}),UN=((0,OT.Rf)(function(e){const t=VN(e);return(0,OT.n)("div",t)}),n(16678)),$N=n(26645),HN=(0,OT.ab)(function({store:e,alwaysVisible:t,...n}){const i=(0,CN.oZ)();return n=VN({store:e=e||i,alwaysVisible:t,...n}),(0,UN.f)({store:e,alwaysVisible:t,...n})}),WN=(0,$N.AV)((0,OT.Rf)(function(e){const t=HN(e);return(0,OT.n)("div",t)}),CN.oZ),GN=n(21861),qN=n(81547),KN=(0,OT.ab)(function({store:e,value:t,getItem:n,hideOnClick:i,setValueOnClick:r=null!=t,preventScrollOnKeyDown:o=!0,focusOnHover:s=!0,...a}){var l;const c=(0,CN.L4)();e=e||c,(0,jT.V1)(e,!1);const u=(0,LT.Bi)(a.id),d=(0,jT.$f)(a),{listElement:h,multiSelectable:p,selected:f,autoFocus:m}=(0,IT.PX)(e,{listElement:"listElement",multiSelectable:e=>Array.isArray(e.value),selected:e=>function(e,t){if(null!=t)return null!=e&&(Array.isArray(e)?e.includes(t):e===t)}(e.value,t),autoFocus:n=>null!=t&&null!=n.value&&(n.activeId===u||!(null==e?void 0:e.item(n.activeId)))&&(Array.isArray(n.value)?n.value[n.value.length-1]===t:n.value===t)}),g=(0,IT.O$)(null==e?void 0:e.combobox,"virtualFocus"),b=(0,T.useCallback)(e=>{const i={...e,value:d?void 0:t};return n?n(i):i},[d,t,n]);i=null!=i?i:null!=t&&!p;const y=a.onClick,v=(0,LT.O4)(r),_=(0,LT.O4)(i),x=(0,LT._q)(n=>{null==y||y(n),n.defaultPrevented||(0,LN.RN)(n)||(0,LN.$b)(n)||(v(n)&&null!=t&&(null==e||e.setValue(e=>Array.isArray(e)?e.includes(t)?e.filter(e=>e!==t):[...e,t]:t)),_(n)&&(null==e||e.hide()))}),k=null!=(l=(a=(0,LT.w7)(a,e=>(0,Er.jsx)(CN.uf.Provider,{value:null!=f&&f,children:e}),[f])).autoFocus)?l:m;a={role:(0,ON.cn)(h),"aria-selected":f,children:t,...a,id:u,autoFocus:!1!==g&&k,"data-autofocus":k||void 0,onClick:x},a=(0,qN.k)({store:e,getItem:b,preventScrollOnKeyDown:o,...a});const w=(0,LT.O4)(s);return(0,GN.T)({store:e,...a,focusOnHover:t=>!!w(t)&&e.getState().open})}),YN=(0,OT.ph)((0,OT.Rf)(function(e){const t=KN(e);return(0,OT.n)("div",t)})),JN=n(8963),XN=(0,OT.ab)(function({store:e,checked:t,...n}){const i=(0,T.useContext)(CN.uf);return t=null!=t?t:i,(0,JN.H)({...n,checked:t})}),ZN=(0,OT.Rf)(function(e){const t=XN(e);return(0,OT.n)("span",t)}),QN=n(37237),eR=n(40570),tR={compact:rx.A.controlPaddingXSmall,small:rx.A.controlPaddingXSmall,default:rx.A.controlPaddingX},nR=(0,ex.A)(DN,{shouldForwardProp:e=>"hasCustomRenderProp"!==e,target:"e1p3eej77"})(({size:e,hasCustomRenderProp:t})=>(0,tx.AH)("display:block;background-color:",nx.l.theme.background,";border:none;color:",nx.l.theme.foreground,";cursor:pointer;font-family:inherit;text-align:start;user-select:none;width:100%;&[data-focus-visible]{outline:none;}",((e,t)=>{const n={compact:{[t]:32,paddingInlineStart:tR.compact,paddingInlineEnd:tR.compact+QN.qO},default:{[t]:40,paddingInlineStart:tR.default,paddingInlineEnd:tR.default+QN.qO},small:{[t]:24,paddingInlineStart:tR.small,paddingInlineEnd:tR.small+QN.qO}};return n[e]||n.default})(e,t?"minHeight":"height")," ",!t&&aR," ",(0,sx.TA)({inputSize:e}),";",""),""),iR=(0,tx.i7)({"0%":{transform:`translateY(-${eR.r.SLIDE_DISTANCE})`},"100%":{transform:"translateY(0)"}}),rR=(0,tx.i7)({"0%":{opacity:0},"100%":{opacity:1}}),oR=(0,ex.A)(WN,{target:"e1p3eej76"})("display:flex;flex-direction:column;background-color:",nx.l.theme.background,";border-radius:",rx.A.radiusSmall,";border:1px solid ",nx.l.theme.foreground,";box-shadow:",rx.A.elevationMedium,";z-index:1000000;max-height:min( var( --popover-available-height, 400px ), 400px );overflow:auto;overscroll-behavior:contain;min-width:min-content;&[data-open]{@media not ( prefers-reduced-motion ){animation-name:",iR,",",rR,";animation-duration:",eR.r.SLIDE_DURATION,",",eR.r.FADE_DURATION,";animation-timing-function:",eR.r.SLIDE_EASING,",",eR.r.FADE_EASING,";will-change:transform,opacity;}}&[data-focus-visible]{outline:none;}"),sR=(0,ex.A)(YN,{target:"e1p3eej75"})(({size:e})=>(0,tx.AH)("cursor:default;display:flex;align-items:center;justify-content:space-between;font-size:",rx.A.fontSize,";line-height:28px;padding-block:",(0,ax.x)(2),";scroll-margin:",(0,ax.x)(1),";user-select:none;&[aria-disabled='true']{cursor:not-allowed;}&[data-active-item]{background-color:",nx.l.theme.gray[300],";}",(e=>{const t={compact:{paddingInlineStart:tR.compact,paddingInlineEnd:tR.compact-6},default:{paddingInlineStart:tR.default,paddingInlineEnd:tR.default-6},small:{paddingInlineStart:tR.small,paddingInlineEnd:tR.small-6}};return t[e]||t.default})(e),";",""),""),aR={name:"1h52dri",styles:"overflow:hidden;text-overflow:ellipsis;white-space:nowrap"},lR=(0,ex.A)("div",{target:"e1p3eej74"})(aR,";"),cR=(0,ex.A)("span",{target:"e1p3eej73"})("color:",nx.l.theme.gray[600],";margin-inline-start:",(0,ax.x)(2),";"),uR=(0,ex.A)("div",{target:"e1p3eej72"})("display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;flex:1;column-gap:",(0,ax.x)(4),";"),dR=(0,ex.A)("span",{target:"e1p3eej71"})("color:",nx.l.theme.gray[600],";text-align:initial;line-height:",rx.A.fontLineHeightBase,";padding-inline-end:",(0,ax.x)(1),";margin-block:",(0,ax.x)(1),";"),hR=(0,ex.A)(ZN,{target:"e1p3eej70"})("display:flex;align-items:center;margin-inline-start:",(0,ax.x)(2),";fill:currentColor;align-self:start;margin-block-start:2px;font-size:0;",uR,"~&,&:not(:empty){font-size:24px;}"),pR=n(17617),fR=n(3591),mR=(0,T.createContext)(void 0);function gR(e){return(Array.isArray(e)?0===e.length:null==e)?(0,ee.__)("Select an item"):Array.isArray(e)?1===e.length?e[0]:(0,ee.sprintf)((0,ee._n)("%d item selected","%d items selected",e.length),e.length):e}mR.displayName="CustomSelectContext";var bR=({renderSelectedValue:e,size:t="default",store:n,...i})=>{const{value:r}=IT.O$(n),o=(0,T.useMemo)(()=>e??gR,[e]);return(0,Er.jsx)(nR,{...i,size:t,hasCustomRenderProp:!!e,store:n,children:o(r)})},yR=function(e){const{children:t,hideLabelFromVision:n=!1,label:i,size:r,store:o,className:s,isLegacy:a=!1,...l}=e,c=(0,T.useCallback)(e=>{a&&e.stopPropagation()},[a]),u=(0,T.useMemo)(()=>({store:o,size:r}),[o,r]);return(0,Er.jsxs)("div",{className:s,children:[(0,Er.jsx)(AN,{store:o,render:n?(0,Er.jsx)(kC.A,{}):(0,Er.jsx)(mk.Ay.VisualLabel,{as:"div"}),children:i}),(0,Er.jsxs)(pR.A,{__next40pxDefaultSize:!0,size:r,suffix:(0,Er.jsx)(fR.A,{}),children:[(0,Er.jsx)(bR,{...l,size:r,store:o,showOnKeyDown:!a}),(0,Er.jsx)(oR,{gutter:12,store:o,sameWidth:!0,slide:!1,onKeyDown:c,flip:!a,children:(0,Er.jsx)(mR.Provider,{value:u,children:t})})]})]})};function vR({children:e,...t}){const n=(0,T.useContext)(mR);return(0,Er.jsxs)(sR,{store:n?.store,size:n?.size??"default",...t,children:[e??t.value,(0,Er.jsx)(hR,{children:(0,Er.jsx)(xx.A,{icon:xw.A})})]})}vR.displayName="CustomSelectControlV2.Item";var _R=vR;function xR({__experimentalHint:e,...t}){return{hint:e,...t}}function kR(e,t){return t||(0,ee.sprintf)((0,ee.__)("Currently selected: %s"),e)}var wR=function e(t){const{__next40pxDefaultSize:n=!1,__shouldNotWarnDeprecated36pxSize:i,describedBy:r,options:o,onChange:s,size:a="default",value:l,className:c,showSelectedHint:u=!1,...d}=function({__experimentalShowSelectedHint:e,...t}){return{showSelectedHint:e,...t}}(t);(0,bx.M)({componentName:"CustomSelectControl",__next40pxDefaultSize:n,size:a,__shouldNotWarnDeprecated36pxSize:i});const h=(0,SS.A)(e,"custom-select-control__description"),p=function(e={}){e=function(e){const t=(0,vN.PV)();return e={...e,combobox:void 0!==e.combobox?e.combobox:t},(0,AT.YC)(e)}(e);const[t,n]=(0,IT.Pj)(wN,e);return function(e,t,n){return(0,LT.w5)(t,[n.combobox]),(0,IT.Tz)(e,n,"value","setValue"),(0,IT.Tz)(e,n,"setValueOnMove"),Object.assign((0,yN.o)((0,AT.YO)(e,t,n),t,n),{combobox:n.combobox})}(t,n,e)}({async setValue(e){const t=o.find(t=>t.key===e);if(!s||!t)return;await Promise.resolve();const n=p.getState(),i={highlightedIndex:n.renderedItems.findIndex(t=>t.value===e),inputValue:"",isOpen:n.open,selectedItem:t,type:""};s(i)},value:l?.key,defaultValue:o[0]?.key}),f=o.map(xR).map(({name:e,key:t,hint:n,style:i,className:r})=>{const o=(0,Er.jsxs)(uR,{children:[(0,Er.jsx)("span",{children:e}),(0,Er.jsx)(dR,{className:"components-custom-select-control__item-hint",children:n})]});return(0,Er.jsx)(_R,{value:t,children:n?o:e,style:i,className:(0,mh.A)(r,"components-custom-select-control__item",{"has-hint":n})},t)}),m=IT.O$(p,"value"),g=o?.map(xR)?.find(({key:e})=>m===e)??o[0],b=n&&"default"===a||"__unstable-large"===a?"default":n||"default"!==a?a:"compact";return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(yR,{"aria-describedby":h,renderSelectedValue:()=>u&&g.hint?(0,Er.jsxs)(lR,{children:[g?.name,(0,Er.jsx)(cR,{className:"components-custom-select-control__hint",children:g?.hint})]}):g?.name,size:b,store:p,className:(0,mh.A)("components-custom-select-control",c),isLegacy:!0,...d,children:f}),(0,Er.jsx)(kC.A,{children:(0,Er.jsx)("span",{id:h,children:kR(g?.name,r)})})]})},CR=n(76974),SR={px:{max:300,steps:1},"%":{max:100,steps:1},vw:{max:100,steps:1},vh:{max:100,steps:1},em:{max:10,steps:.1},rem:{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}},AR=(e,t)=>!!e?.includes&&("0"===e||e.includes(`var:preset|${t}|`));function IR(e,t){if(!e)return;if("0"===e||"default"===e)return e;const n=e.match(new RegExp(`var:preset\\|${t}\\|(.+)`));return n?n[1]:void 0}function ER(e,t,n){if(!AR(e,n))return e;const i=0===parseFloat(e,10)?"0":IR(e,n),r=t.find(e=>String(e.slug)===i);return r?.size}var jR=n(43987);function TR({allowNegativeOnDrag:e,ariaLabel:t,allPlaceholder:n,minValue:i,parsedQuantity:r,computedUnit:o,units:s,isMixed:a,step:l,max:c,showTooltip:u,value:d,minimumCustomValue:h,onCustomValueChange:p,onCustomValueSliderChange:f,onUnitChange:m,onMouseOut:g,onMouseOver:b,setMinValue:y}){const v=(0,Er.jsx)(vx,{className:"preset-input-control__unit-control",disableUnits:a,hideLabelFromVision:!0,label:t,min:i,onChange:p,onUnitChange:m,onBlur:g,onFocus:b,onMouseOut:g,onMouseOver:b,size:"__unstable-large",units:s,value:[r,o].join(""),placeholder:n,onDragStart:()=>{e&&"-"===d?.charAt(0)&&y(0)},onDrag:()=>{e&&"-"===d?.charAt(0)&&y(0)},onDragEnd:()=>{e&&y(h)}}),_=u?(0,Er.jsx)(jR.Ay,{text:t,placement:"top",children:(0,Er.jsx)("div",{className:"preset-input-control__tooltip-wrapper",children:v})}):v;return(0,Er.jsxs)(Er.Fragment,{children:[_,(0,Er.jsx)(gk.A,{className:"preset-input-control__custom-value-range",hideLabelFromVision:!0,initialPosition:0,label:t,max:c,min:0,onBlur:g,onChange:f,onFocus:b,onMouseOut:g,onMouseOver:b,step:l,value:r,withInputField:!1,__next40pxDefaultSize:!0})]})}function BR({allowNegativeOnDrag:e=!1,ariaLabel:t,className:n,customValueSettings:i=SR,disableCustomValues:r,icon:o,isMixed:s,value:a,minimumCustomValue:l,onChange:c,onMouseOut:u,onMouseOver:d,onUnitChange:h,presets:p=[],presetType:f,selectedUnit:m,showTooltip:g,units:b}){const y=(0,T.useMemo)(()=>function(e,t,n){if(!e||AR(e,n)||"0"===e)return e;const i=t.find(t=>String(t.size)===String(e));return i?.slug?`var:preset|${n}|${i.slug}`:e}(a,p,f),[a,p,f]),v=n??"preset-input-control",_=p.slice(1,p.length-1).map((e,t)=>({value:t+1,label:void 0})),x=_.length>0,k=p.length<=8,w=s?(0,ee.__)("Mixed"):null,[C,S]=(0,T.useState)(l),[A,I]=(0,T.useState)(!r&&void 0!==y&&!AR(y,f));let E=null;const j=(0,qt.A)(y);(0,T.useEffect)(()=>{y&&j!==y&&!AR(y,f)&&!0!==A&&I(!0)},[y,j,f,A]);const B=!k&&!A&&void 0!==y&&(!AR(y,f)||AR(y,f)&&s);let N=p;B?(N=[...p,{name:s?(0,ee.__)("Mixed"):(0,ee.sprintf)((0,ee.__)("Custom (%s)"),y),slug:"custom",size:y}],E=N.length-1):s||(E=A?ER(y,p,f):function(e,t,n){if(void 0===e)return 0;const i=0===parseFloat(e,10)?"0":IR(e,n),r=t.findIndex(e=>String(e.slug)===i);return-1!==r?r:NaN}(y,p,f));const R=N.map((e,t)=>({key:t,name:e.name})),O=AR(y,f)?ER(y,p,f):y,[L,M]=X_(O),P=M||m||"px",D=b?.find(e=>e.value===P),F=D?.step??i[P]?.steps??.1,z=D?.max??i[P]?.max??10,V=(e,t)=>{const n=parseInt(e,10);if("selectList"===t){if(0===n&&"0"===p[0]?.slug)return"0";if(0===n)return}else if(0===n)return"0";return`var:preset|${f}|${p[e]?.slug}`};return(0,Er.jsxs)(Cw.A,{className:`preset-input-control__wrapper ${v}__wrapper`,children:[o&&(0,Er.jsx)(IC.A,{className:"preset-input-control__icon",icon:o,size:24}),(!x||A)&&(0,Er.jsx)(TR,{allowNegativeOnDrag:e,ariaLabel:t,allPlaceholder:w,minValue:C,parsedQuantity:L,computedUnit:P,units:b,isMixed:s,step:F,max:z,showTooltip:g,value:y,minimumCustomValue:l,onCustomValueChange:e=>{void 0!==e&&""!==e?isNaN(parseFloat(e))||c(e):c(void 0)},onCustomValueSliderChange:e=>{c([e,P].join(""))},onUnitChange:h,onMouseOut:u,onMouseOver:d,setMinValue:S}),x&&k&&!A&&(0,Er.jsx)(gk.A,{"aria-valuenow":E,"aria-valuetext":p[E]?.name,className:"preset-input-control__preset-range",hideLabelFromVision:!0,initialPosition:0,label:t,max:p.length-1,marks:_,min:0,onBlur:u,onChange:e=>c(V(e)),onFocus:d,onMouseDown:e=>{e?.nativeEvent?.offsetX<35&&void 0===y&&c("0")},onMouseOut:u,onMouseOver:d,renderTooltipContent:e=>void 0===y?void 0:p[e]?.name,step:1,value:E,withInputField:!1,__next40pxDefaultSize:!0}),x&&!k&&!A&&(0,Er.jsx)(wR,{className:"preset-input-control__custom-select-control",hideLabelFromVision:!0,label:t,onBlur:u,onChange:e=>{B&&e.selectedItem.key===R.length-1?I(!0):c(V(e.selectedItem.key,"selectList"))},onFocus:d,onMouseOut:u,onMouseOver:d,options:R,size:"__unstable-large",value:R.find(e=>e.key===E)||""}),x&&!r&&(0,Er.jsx)(fv.Ay,{className:"preset-input-control__custom-toggle",icon:CR.A,iconSize:24,isPressed:A,label:A?(0,ee.__)("Use preset"):(0,ee.__)("Set custom value"),onClick:()=>{I(!A)},size:"small"})]})}var NR=n(20216),RR=n(37994),OR=n(87941),LR=n(41300),MR=n(82007),PR=[],DR={all:(0,ee.__)("Border radius"),topLeft:(0,ee.__)("Top left"),topRight:(0,ee.__)("Top right"),bottomLeft:(0,ee.__)("Bottom left"),bottomRight:(0,ee.__)("Bottom right")},FR={all:NR.A,topLeft:RR.A,topRight:OR.A,bottomLeft:LR.A,bottomRight:MR.A};function zR(e,t){return"all"===t?function(e={}){if("string"==typeof e)return e;const t=Object.values(e).map(e=>{const t=X_(e);return"string"==typeof e&&void 0===t[0]?[e,""]:t}),n=t.map(e=>e[0]??""),i=t.map(e=>e[1]),r=n.every(e=>e===n[0])?n[0]:"",o=(s=i,[...s].sort((e,t)=>s.filter(e=>e===t).length-s.filter(t=>t===e).length).shift());var s;return 0===r||r?`${r}${o||""}`:void 0}(e):"string"==typeof e?e:e?.[t]}function VR(e,t){return"all"===t?e.flat:e[t]}function UR(e,t,n){return i=>{n("all"===e?{topLeft:i,topRight:i,bottomLeft:i,bottomRight:i}:{..."string"!=typeof t?t||{}:{topLeft:t,topRight:t,bottomLeft:t,bottomRight:t},[e]:i})}}function $R(e,t,n){return i=>{const r={...t};"all"===e?(r.flat=i,r.topLeft=i,r.topRight=i,r.bottomLeft=i,r.bottomRight=i):r[e]=i,n(r)}}function HR({onChange:e,values:t,presets:n}){const[i,r]=(0,T.useState)(!function(e){if(!e)return!1;if("string"==typeof e)return!0;const t=Object.values(e).filter(e=>!!e||0===e);return!!t.length}(t)||!function(e={}){if("string"==typeof e)return!1;if(!e||"object"!=typeof e)return!1;const t=Object.values(e);if(0===t.length)return!1;const n=t[0],i=t.every(e=>e===n);return!i}(t)),o=function(e){const t=e?.default??PR,n=e?.custom??PR,i=e?.theme??PR;return(0,T.useMemo)(()=>{const e=[{name:(0,ee.__)("None"),slug:"0",size:0},...n,...i,...t];return e.length>8?[{name:(0,ee.__)("Default"),slug:"default",size:void 0},...e]:e},[n,i,t])}(n),[s,a]=(0,T.useState)({flat:"string"==typeof t?X_(t)[1]:void 0,topLeft:X_(t?.topLeft)[1],topRight:X_(t?.topRight)[1],bottomLeft:X_(t?.bottomLeft)[1],bottomRight:X_(t?.bottomRight)[1]}),[l]=tv("spacing.units"),c=Z_({availableUnits:l||["px","em","rem"]});return(0,Er.jsxs)("fieldset",{className:"components-border-radius-control",children:[(0,Er.jsxs)(Cw.A,{className:"components-border-radius-control__header",children:[(0,Er.jsx)(mk.Ay.VisualLabel,{as:"legend",children:(0,ee.__)("Radius")}),(0,Er.jsx)(bN,{onClick:()=>r(!i),isLinked:i})]}),i?(0,Er.jsx)(BR,{ariaLabel:DR.all,className:"components-border-radius-control",icon:FR.all,minimumCustomValue:0,onChange:UR("all",t,e),onUnitChange:$R("all",s,a),presets:o,presetType:"border-radius",selectedUnit:VR(s,"all"),showTooltip:!0,units:c,value:zR(t,"all")}):(0,Er.jsx)(Q_.A,{children:["topLeft","topRight","bottomLeft","bottomRight"].map(n=>(0,Er.jsx)(BR,{ariaLabel:DR[n],className:"components-border-radius-control",icon:FR[n],minimumCustomValue:0,onChange:UR(n,t,e),onUnitChange:$R(n,s,a),presets:o,presetType:"border-radius",selectedUnit:VR(s,n),showTooltip:!0,units:c,value:zR(t,n)},n))})]})}var WR=n(71213),GR=[];function qR({shadow:e,onShadowChange:t,settings:n}){const i=ZR(n);return(0,Er.jsx)("div",{className:"block-editor-global-styles__shadow-popover-container",children:(0,Er.jsxs)(Q_.A,{spacing:4,children:[(0,Er.jsx)(Sw.A,{level:5,children:(0,ee.__)("Drop shadow")}),(0,Er.jsx)(KR,{presets:i,activeShadow:e,onSelect:t}),(0,Er.jsx)("div",{className:"block-editor-global-styles__clear-shadow",children:(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>t(void 0),disabled:!e,accessibleWhenDisabled:!0,children:(0,ee.__)("Clear")})})]})})}function KR({presets:e,activeShadow:t,onSelect:n}){return e?(0,Er.jsx)(II.e,{role:"listbox",className:"block-editor-global-styles__shadow__list","aria-label":(0,ee.__)("Drop shadows"),children:e.map(({name:e,slug:i,shadow:r})=>(0,Er.jsx)(YR,{label:e,isActive:r===t,type:"unset"===i?"unset":"preset",onSelect:()=>n(r===t?void 0:r),shadow:r},i))}):null}function YR({type:e,label:t,isActive:n,onSelect:i,shadow:r}){return(0,Er.jsx)(jR.Ay,{text:t,children:(0,Er.jsx)(II.e.Item,{role:"option","aria-label":t,"aria-selected":n,className:(0,mh.A)("block-editor-global-styles__shadow__item",{"is-active":n}),render:(0,Er.jsx)("button",{className:(0,mh.A)("block-editor-global-styles__shadow-indicator",{unset:"unset"===e}),onClick:i,style:{boxShadow:r},"aria-label":t,children:n&&(0,Er.jsx)(xx.A,{icon:xw.A})})})})}function JR({shadow:e,onShadowChange:t,settings:n}){return(0,Er.jsx)(wC.A,{popoverProps:{placement:"left-start",offset:36,shift:!0},className:"block-editor-global-styles__shadow-dropdown",renderToggle:XR(e,t),renderContent:()=>(0,Er.jsx)(CC.A,{paddingSize:"medium",children:(0,Er.jsx)(qR,{shadow:e,onShadowChange:t,settings:n})})})}function XR(e,t){return function({onToggle:n,isOpen:i}){const r=(0,T.useRef)(void 0),o={onClick:n,className:(0,mh.A)("block-editor-global-styles__shadow-dropdown-toggle",{"is-open":i}),"aria-expanded":i,ref:r},s={onClick:()=>{i&&n(),t(void 0),r.current?.focus()},className:(0,mh.A)("block-editor-global-styles__shadow-editor__remove-button",{"is-open":i}),label:(0,ee.__)("Remove")};return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,...o,children:(0,Er.jsxs)(Cw.A,{justify:"flex-start",children:[(0,Er.jsx)(xx.A,{className:"block-editor-global-styles__toggle-icon",icon:WR.A,size:24}),(0,Er.jsx)(Yv.A,{children:(0,ee.__)("Drop shadow")})]})}),!!e&&(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,size:"small",icon:uS.A,...s})]})}}function ZR(e){return(0,T.useMemo)(()=>{if(!e?.shadow)return GR;const t=e?.shadow?.defaultPresets,{default:n,theme:i,custom:r}=e?.shadow?.presets??{},o={name:(0,ee.__)("Unset"),slug:"unset",shadow:"none"},s=[...t&&n||GR,...i||GR,...r||GR];return s.length&&s.unshift(o),s},[e])}function QR(e){return Object.values(eO(e)).some(Boolean)}function eO(e){return{hasBorderColor:tO(e),hasBorderRadius:nO(e),hasBorderStyle:iO(e),hasBorderWidth:rO(e),hasShadow:oO(e)}}function tO(e){return e?.border?.color}function nO(e){return e?.border?.radius}function iO(e){return e?.border?.style}function rO(e){return e?.border?.width}function oO(e){const t=ZR(e);return!!e?.shadow&&t.length>0}function sO({resetAllFilter:e,onChange:t,value:n,panelId:i,children:r,label:o}){const s=Zw();return(0,Er.jsx)(Xw,{label:o,resetAll:()=>{const i=e(n);t(i)},panelId:i,dropdownMenuProps:s,children:r})}var aO={radius:!0,color:!0,width:!0,shadow:!0};function lO({as:e=sO,value:t,onChange:n,inheritedValue:i=t,settings:r,panelId:o,name:s,defaultControls:a=aO}){const l=iv(r),c=(0,T.useCallback)(e=>vC({settings:r},"",e),[r]),u=e=>{const t=l.flatMap(({colors:e})=>e).find(({color:t})=>t===e);return t?"var:preset|color|"+t.slug:e},d=(0,T.useMemo)(()=>{if(TB(i?.border)){const e={...i?.border};return["top","right","bottom","left"].forEach(t=>{e[t]={...e[t],color:c(e[t]?.color)}}),e}return{...i?.border,color:i?.border?.color?c(i?.border?.color):void 0}},[i?.border,c]),h=e=>n({...t,border:e}),p=tO(r),f=iO(r),m=rO(r),g=nO(r),b=(0,T.useMemo)(()=>"object"!=typeof i?.border?.radius?c(i?.border?.radius):{topLeft:c(i?.border?.radius?.topLeft),topRight:c(i?.border?.radius?.topRight),bottomLeft:c(i?.border?.radius?.bottomLeft),bottomRight:c(i?.border?.radius?.bottomRight)},[i?.border?.radius,c]),y=e=>h({...d,radius:e}),v=()=>{const e=t?.border?.radius;return"object"==typeof e?Object.entries(e).some(Boolean):!!e},_=oO(r),x=c(i?.shadow),k=r?.shadow?.presets??{},w=k.custom??k.theme??k.default??[],C=e=>{const i=w?.find(({shadow:t})=>t===e)?.slug;n(_p(t,["shadow"],i?`var:preset|shadow|${i}`:e||void 0))},S=(0,T.useCallback)(e=>({...e,border:void 0,shadow:void 0}),[]),A=a?.color||a?.width,I=p||f||m||g,E=vO({blockName:s,hasShadowControl:_,hasBorderControl:I});return(0,Er.jsxs)(e,{resetAllFilter:S,value:t,onChange:n,panelId:o,label:E,children:[(m||p)&&(0,Er.jsx)(aC,{hasValue:()=>(e=>!!e&&(TB(e)?!IB.every(t=>jB(e[t])):!jB(e)))(t?.border),label:(0,ee.__)("Border"),onDeselect:()=>(()=>{if(v())return h({radius:t?.border?.radius});h(void 0)})(),isShownByDefault:A,panelId:o,children:(0,Er.jsx)(gN,{colors:l,enableAlpha:!0,enableStyle:f,onChange:e=>{const t={...e};TB(t)?["top","right","bottom","left"].forEach(e=>{t[e]&&(t[e]={...t[e],color:u(t[e]?.color)})}):t&&(t.color=u(t.color)),h({radius:d?.radius,...t})},popoverOffset:40,popoverPlacement:"left-start",value:d,__experimentalIsRenderedInSidebar:!0,size:"__unstable-large",hideLabelFromVision:!_,label:(0,ee.__)("Border")})}),g&&(0,Er.jsx)(aC,{hasValue:v,label:(0,ee.__)("Radius"),onDeselect:()=>y(void 0),isShownByDefault:a.radius,panelId:o,children:(0,Er.jsx)(HR,{presets:r?.border?.radiusSizes,values:b,onChange:e=>{y(e||void 0)}})}),_&&(0,Er.jsxs)(aC,{label:(0,ee.__)("Shadow"),hasValue:()=>!!t?.shadow,onDeselect:()=>C(void 0),isShownByDefault:a.shadow,panelId:o,children:[I?(0,Er.jsx)(mk.Ay.VisualLabel,{as:"legend",children:(0,ee.__)("Shadow")}):null,(0,Er.jsx)(JR,{shadow:x,onShadowChange:C,settings:r})]})]})}var cO="__experimentalBorder",uO="shadow",dO=(e,t,n)=>{let i;return e.some(e=>e.colors.some(e=>e[t]===n&&(i=e,!0))),i},hO=({colors:e,namedColor:t,customColor:n})=>{if(t){const n=dO(e,"slug",t);if(n)return n}if(!n)return{color:void 0};return dO(e,"color",n)||{color:n}};function pO(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function fO(e){if(TB(e?.border))return{style:e,borderColor:void 0};const t=e?.border?.color,n=t?.startsWith("var:preset|color|")?t.substring(17):void 0,i={...e};return i.border={...i.border,color:n?void 0:t},{style:ov(i),borderColor:n}}function mO(e){return TB(e.style?.border)?e.style:{...e.style,border:{...e.style?.border,color:e.borderColor?"var:preset|color|"+e.borderColor:e.style?.border?.color}}}function gO({label:e,children:t,resetAllFilter:n}){const i=(0,T.useCallback)(e=>{const t=mO(e),i=n(t);return{...e,...fO(i)}},[n]);return(0,Er.jsx)(oC,{group:"border",resetAllFilter:i,label:e,children:t})}function bO({clientId:e,name:t,setAttributes:n,settings:i}){const r=QR(i),{style:o,borderColor:s}=(0,zt.A)(t=>{if(!r)return{};const{style:n,borderColor:i}=t(Qy).getBlockAttributes(e)||{};return{style:n,borderColor:i}},[e,r]),a=(0,T.useMemo)(()=>mO({style:o,borderColor:s}),[o,s]);if(!r)return null;const l={...vn(t,[cO,"__experimentalDefaultControls"]),...vn(t,[uO,"__experimentalDefaultControls"])};return(0,Er.jsx)(lO,{as:gO,panelId:e,settings:i,value:a,onChange:e=>{n(fO(e))},defaultControls:l})}function yO(e,t="any"){if("web"!==Uo.A.OS)return!1;const n=vn(e,cO);return!0===n||("any"===t?!!(n?.color||n?.radius||n?.width||n?.style):!!n?.[t])}function vO({blockName:e,hasBorderControl:t,hasShadowControl:n}={}){const i=eO(dv(e));return t||n||!e||(t=i?.hasBorderColor||i?.hasBorderStyle||i?.hasBorderWidth||i?.hasBorderRadius,n=i?.hasShadow),t&&n?(0,ee.__)("Border & Shadow"):n?(0,ee.__)("Shadow"):(0,ee.__)("Border")}function _O(e,t,n){if(!yO(t,"color")||av(t,cO,"color"))return e;const i=xO(n),r=(0,mh.A)(e.className,i);return e.className=r||void 0,e}function xO(e){const{borderColor:t,style:n}=e,i=MB("border-color",t);return(0,mh.A)({"has-border-color":t||n?.border?.color,[i]:!!i})}var kO={useBlockProps:function({name:e,borderColor:t,style:n}){const{colors:i}=PB();if(!yO(e,"color")||av(e,cO,"color"))return{};const{color:r}=hO({colors:i,namedColor:t}),{color:o}=hO({colors:i,namedColor:pO(n?.border?.top?.color)}),{color:s}=hO({colors:i,namedColor:pO(n?.border?.right?.color)}),{color:a}=hO({colors:i,namedColor:pO(n?.border?.bottom?.color)}),{color:l}=hO({colors:i,namedColor:pO(n?.border?.left?.color)});return _O({style:ov({borderTopColor:o||r,borderRightColor:s||r,borderBottomColor:a||r,borderLeftColor:l||r})||{}},e,{borderColor:t,style:n})},addSaveProps:_O,attributeKeys:["borderColor","style"],hasSupport:e=>yO(e,"color")};function wO(e,t="root",n={}){if(!t)return null;const{fallback:i=!1}=n,{name:r,selectors:o,supports:s}=e,a=o&&Object.keys(o).length>0,l=Array.isArray(t)?t.join("."):t;let c=null;if(c=a&&o.root?o?.root:s?.__experimentalSelector?s.__experimentalSelector:".wp-block-"+r.replace("core/","").replace("/","-"),"root"===l)return c;const u=Array.isArray(t)?t:t.split(".");if(1===u.length){const e=i?c:null;if(a)return hC(o,`${l}.root`,null)||hC(o,l,null)||e;const t=s?hC(s,`${l}.__experimentalSelector`,null):void 0;return t?gC(c,t):e}let d;return a&&(d=hC(o,l,null)),d||(i?wO(e,u[0],n):null)}(0,Ei.U2)("blocks.registerBlockType","core/border/addAttributes",function(e){return yO(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e}),(0,te.X$)([ne.A,ie.A]);var CO=function({backgroundColor:e,fallbackBackgroundColor:t,fallbackTextColor:n,fallbackLinkColor:i,fontSize:r,isLargeText:o,textColor:s,linkColor:a,enableAlphaChecker:l=!1}){const c=e||t;if(!c)return null;const u=s||n,d=a||i;if(!u&&!d)return null;const h=[{color:u,description:(0,ee.__)("text color")},{color:d,description:(0,ee.__)("link color")}],p=(0,te.Mj)(c),f=p.alpha()<1,m=p.brightness(),g={level:"AA",size:o||!1!==o&&r>=24?"large":"small"};let b="",y="";for(const e of h){if(!e.color)continue;const t=(0,te.Mj)(e.color),n=t.isReadable(p,g),i=t.alpha()<1;if(!n){if(f||i)continue;b=m<t.brightness()?(0,ee.sprintf)((0,ee.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,ee.sprintf)((0,ee.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),e.description),y=(0,ee.__)("This color combination may be hard for people to read.");break}i&&l&&(b=(0,ee.__)("Transparent text may be hard for people to read."),y=(0,ee.__)("Transparent text may be hard for people to read."))}return b?((0,dt.L)(y),(0,Er.jsx)("div",{className:"block-editor-contrast-checker",children:(0,Er.jsx)(wS.A,{spokenMessage:null,status:"warning",isDismissible:!1,children:b})})):null},SO=n(73698),AO=(0,T.createContext)({refsMap:(0,SO.u)()});function IO({children:e}){const t=(0,T.useMemo)(()=>({refsMap:(0,SO.u)()}),[]);return(0,Er.jsx)(AO.Provider,{value:t,children:e})}function EO(e){const{refsMap:t}=(0,T.useContext)(AO);return(0,bt.A)(n=>(t.set(e,n),()=>t.delete(e)),[e])}function jO(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function TO(e,t){const{refsMap:n}=(0,T.useContext)(AO);(0,T.useLayoutEffect)(()=>{jO(t,n.get(e));const i=n.subscribe(e,()=>jO(t,n.get(e)));return()=>{i(),jO(t,null)}},[n,e,t])}function BO(e){const[t,n]=(0,T.useState)(null);return TO(e,n),t}function NO(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function RO(e,t){if(!e||!t)return{};const n=wO(t,"color.text",{fallback:!0}),i=wO(t,"color.background",{fallback:!0}),r=e.querySelector(n)||e,o=e.querySelector(i)||e,s=e.querySelector("a"),a=NO(r,"color"),l=s&&s.textContent?NO(s,"color"):void 0;let c=o,u=NO(c,"background-color");for(;"rgba(0, 0, 0, 0)"===u&&c.parentNode&&c.parentNode.nodeType===c.parentNode.ELEMENT_NODE;)c=c.parentNode,u=NO(c,"background-color");return{textColor:a,backgroundColor:u,linkColor:l}}function OO(e,t){return Object.keys(t).some(n=>e[n]!==t[n])?t:e}function LO({clientId:e,name:t}){const n=BO(e),[i,r]=(0,T.useReducer)(OO,{}),o=(0,zt.A)(e=>t?e(Zi).getBlockType(t):void 0,[t]);return(0,T.useLayoutEffect)(()=>{n&&o&&window.requestAnimationFrame(()=>window.requestAnimationFrame(()=>r(RO(n,o))))}),(0,T.useLayoutEffect)(()=>{if(!n||!o)return;const e=new window.MutationObserver(()=>{r(RO(n,o))});return e.observe(n,{attributes:!0,attributeFilter:["class","style"]}),()=>{e.disconnect()}},[n,o]),(0,Er.jsx)(CO,{backgroundColor:i.backgroundColor,textColor:i.textColor,linkColor:i.linkColor,enableAlphaChecker:!0})}AO.displayName="BlockRefsContext";var MO="color",PO=e=>{const t=vn(e,MO);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},DO=e=>{if("web"!==Uo.A.OS)return!1;const t=vn(e,MO);return null!==t&&"object"==typeof t&&!!t.link},FO=e=>{const t=vn(e,MO);return null!==t&&"object"==typeof t&&!!t.gradients},zO=e=>{const t=vn(e,MO);return t&&!1!==t.background},VO=e=>{const t=vn(e,MO);return t&&!1!==t.text};function UO(e,t,n){if(!PO(t)||av(t,MO))return e;const i=FO(t),{backgroundColor:r,textColor:o,gradient:s,style:a}=n,l=e=>!av(t,MO,e),c=l("text")?MB("color",o):void 0,u=l("gradients")?function(e){if(e)return`has-${e}-gradient-background`}(s):void 0,d=l("background")?MB("background-color",r):void 0,h=l("background")||l("gradients"),p=r||a?.color?.background||i&&(s||a?.color?.gradient),f=(0,mh.A)(e.className,c,u,{[d]:!(i&&a?.color?.gradient||!d),"has-text-color":l("text")&&(o||a?.color?.text),"has-background":h&&p,"has-link-color":l("link")&&a?.elements?.link?.color});return e.className=f||void 0,e}function $O(e){const t=e?.color?.text,n=t?.startsWith("var:preset|color|")?t.substring(17):void 0,i=e?.color?.background,r=i?.startsWith("var:preset|color|")?i.substring(17):void 0,o=e?.color?.gradient,s=o?.startsWith("var:preset|gradient|")?o.substring(20):void 0,a={...e};return a.color={...a.color,text:n?void 0:t,background:r?void 0:i,gradient:s?void 0:o},{style:ov(a),textColor:n,backgroundColor:r,gradient:s}}function HO(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 WO({children:e,resetAllFilter:t}){const n=(0,T.useCallback)(e=>{const n=HO(e),i=t(n);return{...e,...$O(i)}},[t]);return(0,Er.jsx)(oC,{group:"color",resetAllFilter:n,children:e})}function GO({clientId:e,name:t,setAttributes:n,settings:i,asWrapper:r,label:o,defaultControls:s}){const a=BE(i),{style:l,textColor:c,backgroundColor:u,gradient:d}=(0,zt.A)(t=>{if(!a)return{};const{style:n,textColor:i,backgroundColor:r,gradient:o}=t(Qy).getBlockAttributes(e)||{};return{style:n,textColor:i,backgroundColor:r,gradient:o}},[e,a]),h=(0,T.useMemo)(()=>HO({style:l,textColor:c,backgroundColor:u,gradient:d}),[l,c,u,d]);if(!a)return null;s=s||vn(t,[MO,"__experimentalDefaultControls"]);const p="web"===Uo.A.OS&&!h?.color?.gradient&&(i?.color?.text||i?.color?.link)&&!1!==vn(t,[MO,"enableContrastChecker"]),f=r||WO;return(0,Er.jsx)(WE,{as:f,panelId:e,settings:i,value:h,onChange:e=>{n($O(e))},defaultControls:s,label:o,enableContrastChecker:!1!==vn(t,[MO,"enableContrastChecker"]),children:p&&(0,Er.jsx)(LO,{clientId:e,name:t})})}var qO={useBlockProps:function({name:e,backgroundColor:t,textColor:n,gradient:i,style:r}){const[o,s,a]=tv("color.palette.custom","color.palette.theme","color.palette.default"),l=(0,T.useMemo)(()=>[...o||[],...s||[],...a||[]],[o,s,a]);if(!PO(e)||av(e,MO))return{};const c={};n&&!av(e,MO,"text")&&(c.color=LB(l,n)?.color),t&&!av(e,MO,"background")&&(c.backgroundColor=LB(l,t)?.color);const u=UO({style:c},e,{textColor:n,backgroundColor:t,gradient:i,style:r}),d=t||r?.color?.background||i||r?.color?.gradient;return{...u,className:(0,mh.A)(u.className,!d&&ij(r))}},addSaveProps:UO,attributeKeys:["backgroundColor","textColor","gradient","style"],hasSupport:PO},KO={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};(0,Ei.U2)("blocks.registerBlockType","core/color/addAttribute",function(e){return PO(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),FO(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e}),(0,Ei.U2)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",function(e,t,n,i){const r=e.name;return sv({linkColor:DO(r),textColor:VO(r),backgroundColor:zO(r),gradient:FO(r)},KO,e,t,n,i)});var YO=(0,ex.A)("fieldset",{target:"e8tqeku4"})({name:"k2q51s",styles:"border:0;margin:0;padding:0;display:contents"}),JO=(0,ex.A)(Cw.A,{target:"e8tqeku3"})("height:",(0,ax.x)(4),";"),XO=(0,ex.A)(fv.Ay,{target:"e8tqeku2"})("margin-top:",(0,ax.x)(-1),";"),ZO=(0,ex.A)(mk.Ay.VisualLabel,{target:"e8tqeku1"})("display:flex;gap:",(0,ax.x)(1),";justify-content:flex-start;margin-bottom:0;"),QO=(0,ex.A)(wR,{target:"e8tqeku0"})({name:"anvx77",styles:".components-custom-select-control__item .components-custom-select-control__item-hint{width:100%;}"});var eL={key:"default",name:(0,ee.__)("Default"),value:void 0},tL=e=>{const{__next40pxDefaultSize:t,fontSizes:n,value:i,size:r,valueMode:o="literal",onChange:s}=e,a=[eL,...n.map(e=>{const t=function(e){return e.hint?e.hint: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)?String(e.size):void 0}(e);return{key:e.slug,name:e.name||e.slug,value:e.size,hint:t}})],l=(0,T.useMemo)(()=>{if(void 0===i)return eL;if("slug"===o){const e=a.find(e=>e.key===i);if(e)return e}return a.find(e=>e.value===i)??eL},[i,o,a]);return(0,Er.jsx)(QO,{__next40pxDefaultSize:t,__shouldNotWarnDeprecated36pxSize:!0,className:"components-font-size-picker__select",label:(0,ee.__)("Font size"),hideLabelFromVision:!0,describedBy:(0,ee.sprintf)((0,ee.__)("Currently selected font size: %s"),l.name),options:a,value:l,showSelectedHint:!0,onChange:({selectedItem:e})=>{const t="default"===e.key?void 0:n.find(t=>t.slug===e.key);s(e.value,t)},size:r})},nL=[(0,ee.__)("S"),(0,ee.__)("M"),(0,ee.__)("L"),(0,ee.__)("XL"),(0,ee.__)("XXL")],iL=[(0,ee.__)("Small"),(0,ee.__)("Medium"),(0,ee.__)("Large"),(0,ee.__)("Extra Large"),(0,ee.__)("Extra Extra Large")],rL=e=>{const{fontSizes:t,value:n,valueMode:i="literal",__next40pxDefaultSize:r,size:o,onChange:s}=e,a=(()=>{if(!n)return;if("slug"===i)return String(n);const e=t.filter(e=>e.size===n);if(e.length>1)return;const r=t.find(e=>e.size===n);return r?.slug})();return(0,Er.jsx)(Jv.A,{__next40pxDefaultSize:r,__shouldNotWarnDeprecated36pxSize:!0,label:(0,ee.__)("Font size"),hideLabelFromVision:!0,value:a,onChange:e=>{if(void 0===e)s(void 0);else{const n=t.find(t=>t.slug===String(e));n&&s(n.size,n)}},isBlock:!0,size:o,children:t.map((e,t)=>(0,Er.jsx)(bk.A,{value:e.slug,label:nL[t],"aria-label":e.name||iL[t],showTooltip:!0},e.slug))})},oL=["px","em","rem","vw","vh"],sL=(e,t)=>{const{__next40pxDefaultSize:n=!1,fallbackFontSize:i,fontSizes:r=[],disableCustomFontSizes:o=!1,onChange:s,size:a="default",units:l=oL,value:c,valueMode:u="literal",withSlider:d=!1,withReset:h=!0}=e,p=(0,SS.A)(sL,"font-size-picker-label"),f=Z_({availableUnits:l}),m=(()=>{if(c)return"slug"===u?r.find(e=>e.slug===c):r.find(e=>e.size===c)})(),g=!!c&&!m,[b,y]=(0,T.useState)(g),v="slug"===u?m?.size:c;let _;if(_=!o&&b?"custom":r.length>5?"select":"togglegroup",0===r.length&&o)return null;const x="string"==typeof v||"string"==typeof r[0]?.size,[k,w]=X_(v,f),C=!!w&&["em","rem","vw","vh"].includes(w),S=void 0===c;return(0,bx.M)({componentName:"FontSizePicker",__next40pxDefaultSize:n,size:a}),(0,Er.jsxs)(YO,{ref:t,className:"components-font-size-picker","aria-labelledby":p,children:[(0,Er.jsx)($I.A,{children:(0,Er.jsxs)(JO,{className:"components-font-size-picker__header",children:[(0,Er.jsx)(ZO,{id:p,children:(0,ee.__)("Font size")}),!o&&(0,Er.jsx)(XO,{label:"custom"===_?(0,ee.__)("Use size preset"):(0,ee.__)("Set custom size"),icon:CR.A,onClick:()=>y(!b),isPressed:"custom"===_,size:"small"})]})}),(0,Er.jsxs)("div",{children:["select"===_&&(0,Er.jsx)(tL,{__next40pxDefaultSize:n,fontSizes:r,value:c,valueMode:u,disableCustomFontSizes:o,size:a,onChange:(e,t)=>{s?.(void 0===e?void 0:x?e:Number(e),t)},onSelectCustom:()=>y(!0)}),"togglegroup"===_&&(0,Er.jsx)(rL,{fontSizes:r,value:c,valueMode:u,__next40pxDefaultSize:n,size:a,onChange:(e,t)=>{s?.(void 0===e?void 0:x?e:Number(e),t)}}),"custom"===_&&(0,Er.jsxs)(Kv.A,{className:"components-font-size-picker__custom-size-control",children:[(0,Er.jsx)(Yv.A,{isBlock:!0,children:(0,Er.jsx)(vx,{__next40pxDefaultSize:n,__shouldNotWarnDeprecated36pxSize:!0,label:(0,ee.__)("Font size"),labelPosition:"top",hideLabelFromVision:!0,value:x?`${k??""}${w??""}`:v,onChange:e=>{y(!0),s?.(void 0===e||""===e?void 0:x?e:parseInt(e,10))},size:a,units:x?f:[],min:0})}),d&&(0,Er.jsx)(Yv.A,{isBlock:!0,children:(0,Er.jsx)($I.A,{marginX:2,marginBottom:0,children:(0,Er.jsx)(gk.A,{__next40pxDefaultSize:n,__shouldNotWarnDeprecated36pxSize:!0,className:"components-font-size-picker__custom-input",label:(0,ee.__)("Font size"),hideLabelFromVision:!0,value:k,initialPosition:i,withInputField:!1,onChange:e=>{y(!0),s?.(void 0===e?void 0:x?e+(w??"px"):e)},min:0,max:C?10:100,step:C?.1:1})})}),h&&(0,Er.jsx)(Yv.A,{children:(0,Er.jsx)(fv.$n,{disabled:S,accessibleWhenDisabled:!0,onClick:()=>{s?.(void 0)},variant:"secondary",__next40pxDefaultSize:!0,size:"__unstable-large"===a||e.__next40pxDefaultSize?"default":"small",children:(0,ee.__)("Reset")})})]})]})]})},aL=(0,T.forwardRef)(sL);aL.displayName="FontSizePicker";var lL=aL;function cL({__next40pxDefaultSize:e=!1,value:t="",onChange:n,fontFamilies:i,className:r,...o}){const[s]=tv("typography.fontFamilies");if(i||(i=s),!i||0===i.length)return null;const a=[{key:"",name:(0,ee.__)("Default")},...i.map(({fontFamily:e,name:t})=>({key:e,name:t||e,style:{fontFamily:e}}))];e||void 0!==o.size&&"default"!==o.size||(0,Qt.A)("36px default size for wp.blockEditor.__experimentalFontFamilyControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."});const l=a.find(e=>e.key===t)??"";return(0,Er.jsx)(wR,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,label:(0,ee.__)("Font"),value:l,onChange:({selectedItem:e})=>n(e.key),options:a,className:(0,mh.A)("block-editor-font-family-control",r),...o})}function uL(e){if(!e)return{};if("object"==typeof e)return e;let t;switch(e){case"normal":case"400":t=(0,ee._x)("Regular","font weight");break;case"bold":case"700":t=(0,ee._x)("Bold","font weight");break;case"100":t=(0,ee._x)("Thin","font weight");break;case"200":t=(0,ee._x)("Extra Light","font weight");break;case"300":t=(0,ee._x)("Light","font weight");break;case"500":t=(0,ee._x)("Medium","font weight");break;case"600":t=(0,ee._x)("Semi Bold","font weight");break;case"800":t=(0,ee._x)("Extra Bold","font weight");break;case"900":t=(0,ee._x)("Black","font weight");break;case"1000":t=(0,ee._x)("Extra Black","font weight");break;default:t=e}return{name:t,value:e}}var dL=[{name:(0,ee._x)("Regular","font style"),value:"normal"},{name:(0,ee._x)("Italic","font style"),value:"italic"}],hL=[{name:(0,ee._x)("Thin","font weight"),value:"100"},{name:(0,ee._x)("Extra Light","font weight"),value:"200"},{name:(0,ee._x)("Light","font weight"),value:"300"},{name:(0,ee._x)("Regular","font weight"),value:"400"},{name:(0,ee._x)("Medium","font weight"),value:"500"},{name:(0,ee._x)("Semi Bold","font weight"),value:"600"},{name:(0,ee._x)("Bold","font weight"),value:"700"},{name:(0,ee._x)("Extra Bold","font weight"),value:"800"},{name:(0,ee._x)("Black","font weight"),value:"900"},{name:(0,ee._x)("Extra Black","font weight"),value:"1000"}];function pL(e){let t=[],n=[];const i=[],r=!e||0===e?.length;let o=!1;return e?.forEach(e=>{if("string"==typeof e.fontWeight&&/\s/.test(e.fontWeight.trim())){o=!0;let[t,i]=e.fontWeight.split(" ");t=parseInt(t.slice(0,1)),i="1000"===i?10:parseInt(i.slice(0,1));for(let e=t;e<=i;e++){const t=`${e.toString()}00`;n.some(e=>e.value===t)||n.push(uL(t))}}const i=uL("number"==typeof e.fontWeight?e.fontWeight.toString():e.fontWeight),r=function(e){if(!e)return{};if("object"==typeof e)return e;let t;switch(e){case"normal":t=(0,ee._x)("Regular","font style");break;case"italic":t=(0,ee._x)("Italic","font style");break;case"oblique":t=(0,ee._x)("Oblique","font style");break;default:t=e}return{name:t,value:e}}(e.fontStyle);r&&Object.keys(r).length&&(t.some(e=>e.value===r.value)||t.push(r)),i&&Object.keys(i).length&&(n.some(e=>e.value===i.value)||o||n.push(i))}),n.some(e=>e.value>="600")||n.push({name:(0,ee._x)("Bold","font weight"),value:"700"}),t.some(e=>"italic"===e.value)||t.push({name:(0,ee._x)("Italic","font style"),value:"italic"}),r&&(t=dL,n=hL),t=0===t.length?dL:t,n=0===n.length?hL:n,t.forEach(({name:e,value:t})=>{n.forEach(({name:n,value:r})=>{const o="normal"===t?n:(0,ee.sprintf)((0,ee._x)("%1$s %2$s","font"),n,e);i.push({key:`${t}-${r}`,name:o,style:{fontStyle:t,fontWeight:r}})})}),{fontStyles:t,fontWeights:n,combinedStyleAndWeightOptions:i,isSystemFont:r,isVariableFont:o}}function fL(e){const{__next40pxDefaultSize:t=!1,onChange:n,hasFontStyles:i=!0,hasFontWeights:r=!0,fontFamilyFaces:o,value:{fontStyle:s,fontWeight:a},...l}=e,c=i||r,u=((e,t)=>e?t?(0,ee.__)("Appearance"):(0,ee.__)("Font style"):(0,ee.__)("Font weight"))(i,r),d={key:"default",name:(0,ee.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},{fontStyles:h,fontWeights:p,combinedStyleAndWeightOptions:f}=pL(o),m=(0,T.useMemo)(()=>i&&r?(()=>{const e=[d];return f&&e.push(...f),e})():i?(()=>{const e=[d];return h.forEach(({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:n,fontWeight:void 0}})}),e})():(()=>{const e=[d];return p.forEach(({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:void 0,fontWeight:n}})}),e})(),[e.options,h,p,f]),g=m.find(e=>e.style.fontStyle===s&&e.style.fontWeight===a)||m[0];return t||void 0!==l.size&&"default"!==l.size||(0,Qt.A)("36px default size for wp.blockEditor.__experimentalFontAppearanceControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."}),c&&(0,Er.jsx)(wR,{...l,className:"components-font-appearance-control",__next40pxDefaultSize:t,__shouldNotWarnDeprecated36pxSize:!0,label:u,describedBy:g?i?r?(0,ee.sprintf)((0,ee.__)("Currently selected font appearance: %s"),g.name):(0,ee.sprintf)((0,ee.__)("Currently selected font style: %s"),g.name):(0,ee.sprintf)((0,ee.__)("Currently selected font weight: %s"),g.name):(0,ee.__)("No selected font appearance"),options:m,value:g,onChange:({selectedItem:e})=>n(e.style)})}var mL=({__next40pxDefaultSize:e=!1,value:t,onChange:n,__unstableInputWidth:i="60px",...r})=>{const o=function(e){return void 0!==e&&""!==e}(t),s=(e,t)=>{if(o)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=o?t:"";return e||void 0!==r.size&&"default"!==r.size||(0,Qt.A)("36px default size for wp.blockEditor.LineHeightControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."}),(0,Er.jsx)("div",{className:"block-editor-line-height-control",children:(0,Er.jsx)(ox.A,{...r,__shouldNotWarnDeprecated36pxSize:!0,__next40pxDefaultSize:e,__unstableInputWidth:i,__unstableStateReducer:(e,t)=>{const n=["insertText","insertFromPaste"].includes(t.payload.event.nativeEvent?.inputType),i=s(e.value,n);return{...e,value:i}},onChange:(e,{event:t})=>{""!==e?"click"!==t.type?n(`${e}`):n(s(`${e}`,!1)):n()},label:(0,ee.__)("Line height"),placeholder:1.5,step:.01,spinFactor:10,value:a,min:0,spinControls:"custom"})})};function gL({__next40pxDefaultSize:e=!1,value:t,onChange:n,__unstableInputWidth:i="60px",...r}){const[o]=tv("spacing.units"),s=Z_({availableUnits:o||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return e||void 0!==r.size&&"default"!==r.size||(0,Qt.A)("36px default size for wp.blockEditor.__experimentalLetterSpacingControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."}),(0,Er.jsx)(vx,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,...r,label:(0,ee.__)("Letter spacing"),value:t,__unstableInputWidth:i,units:s,onChange:n})}var bL=n(3954),yL=n(65598),vL=n(66317),_L=n(67567),xL=[{label:(0,ee.__)("Align text left"),value:"left",icon:bL.A},{label:(0,ee.__)("Align text center"),value:"center",icon:yL.A},{label:(0,ee.__)("Align text right"),value:"right",icon:vL.A},{label:(0,ee.__)("Justify text"),value:"justify",icon:_L.A}],kL=["left","center","right"];function wL({className:e,value:t,onChange:n,options:i=kL}){const r=(0,T.useMemo)(()=>xL.filter(e=>i.includes(e.value)),[i]);return r.length?(0,Er.jsx)(Jv.A,{isDeselectable:!0,__next40pxDefaultSize:!0,label:(0,ee.__)("Text alignment"),className:(0,mh.A)("block-editor-text-alignment-control",e),value:t,onChange:e=>{n(e===t?void 0:e)},children:r.map(e=>(0,Er.jsx)(Xv.A,{value:e.value,icon:e.icon,label:e.label},e.value))}):null}var CL=n(92303),SL=n(18812),AL=n(60583),IL=[{label:(0,ee.__)("None"),value:"none",icon:uS.A},{label:(0,ee.__)("Uppercase"),value:"uppercase",icon:CL.A},{label:(0,ee.__)("Lowercase"),value:"lowercase",icon:SL.A},{label:(0,ee.__)("Capitalize"),value:"capitalize",icon:AL.A}];function EL({className:e,value:t,onChange:n}){return(0,Er.jsx)(Jv.A,{isDeselectable:!0,__next40pxDefaultSize:!0,label:(0,ee.__)("Letter case"),className:(0,mh.A)("block-editor-text-transform-control",e),value:t,onChange:e=>{n(e===t?void 0:e)},children:IL.map(e=>(0,Er.jsx)(Xv.A,{value:e.value,icon:e.icon,label:e.label},e.value))})}var jL=n(56603),TL=n(59850),BL=[{label:(0,ee.__)("None"),value:"none",icon:uS.A},{label:(0,ee.__)("Underline"),value:"underline",icon:jL.A},{label:(0,ee.__)("Strikethrough"),value:"line-through",icon:TL.A}];function NL({value:e,onChange:t,className:n}){return(0,Er.jsx)(Jv.A,{isDeselectable:!0,__next40pxDefaultSize:!0,label:(0,ee.__)("Decoration"),className:(0,mh.A)("block-editor-text-decoration-control",n),value:e,onChange:n=>{t(n===e?void 0:n)},children:BL.map(e=>(0,Er.jsx)(Xv.A,{value:e.value,icon:e.icon,label:e.label},e.value))})}function RL({__next40pxDefaultSize:e=!1,value:t,onChange:n,__unstableInputWidth:i="60px",withSlider:r=!1,hasBottomMargin:o=!1,help:s,...a}){const[l]=tv("spacing.units"),c=Z_({availableUnits:l||["px","em","rem","ch","%","vw","vh"],defaultValues:{px:16,em:2,rem:2,ch:2}}),[u,d]=X_(t,c),h=!!d&&["em","rem","%","ch","vw","vh"].includes(d);return r?(0,Er.jsxs)(qw.A,{style:o?{marginBottom:12}:void 0,children:[(0,Er.jsx)(mk.Ay.VisualLabel,{children:(0,ee.__)("Line indent")}),(0,Er.jsxs)(Kv.A,{children:[(0,Er.jsx)(Yv.A,{isBlock:!0,children:(0,Er.jsx)(vx,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,label:(0,ee.__)("Line indent"),labelPosition:"top",hideLabelFromVision:!0,value:t,onChange:n,size:a.size,units:c,__unstableInputWidth:i,min:0})}),r&&(0,Er.jsx)(Yv.A,{isBlock:!0,children:(0,Er.jsx)($I.A,{marginX:2,marginBottom:0,children:(0,Er.jsx)(gk.A,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,label:(0,ee.__)("Line indent"),hideLabelFromVision:!0,value:u,withInputField:!1,onChange:e=>{n?.(void 0===e?void 0:e+(d??"px"))},min:0,max:h?10:100,step:h?.1:1,initialPosition:0})})})]}),s&&(0,Er.jsx)("p",{className:"components-base-control__help",children:s})]}):(0,Er.jsx)(vx,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,...a,label:(0,ee.__)("Line indent"),value:t,__unstableInputWidth:i,units:c,onChange:n,help:s})}var OL=n(79897),LL=n(22931),ML=[{label:(0,ee.__)("Horizontal"),value:"horizontal-tb",icon:OL.A},{label:(0,ee.__)("Vertical"),value:(0,ee.isRTL)()?"vertical-lr":"vertical-rl",icon:LL.A}];function PL({className:e,value:t,onChange:n}){return(0,Er.jsx)(Jv.A,{isDeselectable:!0,__next40pxDefaultSize:!0,label:(0,ee.__)("Orientation"),className:(0,mh.A)("block-editor-writing-mode-control",e),value:t,onChange:e=>{n(e===t?void 0:e)},children:ML.map(e=>(0,Er.jsx)(Xv.A,{value:e.value,icon:e.icon,label:e.label},e.value))})}function DL(e,t){if(!(t="number"==typeof t?t.toString():t)||"string"!=typeof t)return"";if(!e||0===e.length)return t;const n=e?.reduce((e,{value:n})=>Math.abs(parseInt(n)-parseInt(t))<Math.abs(parseInt(e)-parseInt(t))?n:e,e[0]?.value);return n}function FL(e){const t=VL(e),n=UL(e),i=$L(e),r=HL(e),o=GL(e),s=WL(e),a=qL(e),l=JL(e),c=KL(e),u=YL(e),d=zL(e);return t||n||i||r||o||s||d||a||l||c||u}function zL(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 VL(e){return["default","theme","custom"].some(t=>e?.typography?.fontFamilies?.[t]?.length)}function UL(e){return e?.typography?.lineHeight}function $L(e){return e?.typography?.fontStyle||e?.typography?.fontWeight}function HL(e){return e?.typography?.letterSpacing}function WL(e){return e?.typography?.textTransform}function GL(e){return e?.typography?.textAlign}function qL(e){return e?.typography?.textDecoration}function KL(e){return e?.typography?.writingMode}function YL(e){return e?.typography?.textColumns}function JL(e){return e?.typography?.textIndent}function XL({resetAllFilter:e,onChange:t,value:n,panelId:i,children:r}){const o=Zw();return(0,Er.jsx)(Xw,{label:(0,ee.__)("Typography"),resetAll:()=>{const i=e(n);t(i)},panelId:i,dropdownMenuProps:o,children:r})}var ZL={fontFamily:!0,fontSize:!0,fontAppearance:!0,lineHeight:!0,letterSpacing:!0,textAlign:!0,textTransform:!0,textDecoration:!0,textIndent:!0,writingMode:!0,textColumns:!0};function QL({as:e=XL,value:t,onChange:n,inheritedValue:i=t,settings:r,panelId:o,defaultControls:s=ZL,isGlobalStyles:a=!1}){const l=e=>vC({settings:r},"",e),c=VL(r),u=l(i?.typography?.fontFamily),{fontFamilies:d,fontFamilyFaces:h}=(0,T.useMemo)(()=>function(e,t){const n=e?.typography?.fontFamilies,i=["default","theme","custom"].flatMap(e=>n?.[e]??[]),r=i.find(e=>e.fontFamily===t)?.fontFace??[];return{fontFamilies:i,fontFamilyFaces:r}}(r,u),[r,u]),p=e=>{const i=d?.find(({fontFamily:t})=>t===e)?.slug;let r=_p(t,["typography","fontFamily"],i?`var:preset|font-family|${i}`:e||void 0);const o=d?.find(({fontFamily:t})=>t===e)?.fontFace??[],{fontStyles:s,fontWeights:a}=pL(o),l=s?.some(({value:e})=>e===C),c=a?.some(({value:e})=>e?.toString()===S?.toString());if(!l||!c){const{nearestFontStyle:e,nearestFontWeight:t}=function(e,t,n){let i=t,r=n;const{fontStyles:o,fontWeights:s,combinedStyleAndWeightOptions:a}=pL(e),l=o?.some(({value:e})=>e===t),c=s?.some(({value:e})=>e?.toString()===n?.toString());var u,d;return l||(i=t?(u=o,"string"==typeof(d=t)&&d&&["normal","italic","oblique"].includes(d)?!u||0===u.length||u.find(e=>e.value===d)?d:"oblique"!==d||u.find(e=>"oblique"===e.value)?"":"italic":""):a?.find(e=>e.style.fontWeight===DL(s,n))?.style?.fontStyle),c||(r=n?DL(s,n):a?.find(e=>e.style.fontStyle===(i||t))?.style?.fontWeight),{nearestFontStyle:i,nearestFontWeight:r}}(o,C,S);e||t?r={...r,typography:{...r?.typography,fontStyle:e||void 0,fontWeight:t||void 0}}:(C||S)&&(r={...r,typography:{...r?.typography,fontStyle:void 0,fontWeight:void 0}})}n(r)},f=zL(r),m=!r?.typography?.customFontSize,g=function(e){const t=e?.typography?.fontSizes,n=!!e?.typography?.defaultFontSizes;return[...t?.custom??[],...t?.theme??[],...n?t?.default??[]:[]]}(r),b=l(i?.typography?.fontSize),y=(()=>{const e=i?.typography?.fontSize;if(!e||"string"!=typeof e)return;if(e.startsWith("var:preset|font-size|"))return e.replace("var:preset|font-size|","");const t=e.match(/^var\(--wp--preset--font-size--([^)]+)\)$/);return t?t[1]:void 0})(),v=(e,i)=>{n(_p(t,["typography","fontSize"],(i?.slug?`var:preset|font-size|${i?.slug}`:e)||void 0))},_=$L(r),x=function(e){return e?.typography?.fontStyle?e?.typography?.fontWeight?(0,ee.__)("Appearance"):(0,ee.__)("Font style"):(0,ee.__)("Font weight")}(r),k=r?.typography?.fontStyle,w=r?.typography?.fontWeight,C=l(i?.typography?.fontStyle),S=l(i?.typography?.fontWeight),A=(0,T.useCallback)(({fontStyle:e,fontWeight:i})=>{e===C&&i===S||n({...t,typography:{...t?.typography,fontStyle:e||void 0,fontWeight:i||void 0}})},[C,S,n,t]),I=(0,T.useCallback)(()=>{A({})},[A]),E=UL(r),j=l(i?.typography?.lineHeight),B=e=>{n(_p(t,["typography","lineHeight"],e||void 0))},N=HL(r),R=l(i?.typography?.letterSpacing),O=e=>{n(_p(t,["typography","letterSpacing"],e||void 0))},L=JL(r),M=l(i?.typography?.textIndent),P="all"===(r?.typography?.textIndent??"subsequent"),D=P?(0,ee.__)("Indents the first line of all paragraphs."):(0,ee.__)("Indents the first line of each paragraph after the first one."),F=YL(r),z=l(i?.typography?.textColumns),V=e=>{n(_p(t,["typography","textColumns"],e||void 0))},U=WL(r),$=l(i?.typography?.textTransform),H=e=>{n(_p(t,["typography","textTransform"],e||void 0))},W=qL(r),G=l(i?.typography?.textDecoration),q=e=>{n(_p(t,["typography","textDecoration"],e||void 0))},K=KL(r),Y=l(i?.typography?.writingMode),J=e=>{n(_p(t,["typography","writingMode"],e||void 0))},X=GL(r),Z=l(i?.typography?.textAlign),Q=e=>{n(_p(t,["typography","textAlign"],e||void 0))},te=(0,T.useCallback)(e=>({...e,typography:{}}),[]);return(0,Er.jsxs)(e,{resetAllFilter:te,value:t,onChange:n,panelId:o,children:[c&&(0,Er.jsx)(aC,{label:(0,ee.__)("Font"),hasValue:()=>!!t?.typography?.fontFamily,onDeselect:()=>p(void 0),isShownByDefault:s.fontFamily,panelId:o,children:(0,Er.jsx)(cL,{fontFamilies:d,value:u,onChange:p,size:"__unstable-large"})}),f&&(0,Er.jsx)(aC,{label:(0,ee.__)("Size"),hasValue:()=>!!t?.typography?.fontSize,onDeselect:()=>v(void 0),isShownByDefault:s.fontSize,panelId:o,children:(0,Er.jsx)(lL,{value:y||b,valueMode:y?"slug":"literal",onChange:v,fontSizes:g,disableCustomFontSizes:m,withReset:!1,withSlider:!0,size:"__unstable-large"})}),_&&(0,Er.jsx)(aC,{label:x,hasValue:()=>!!t?.typography?.fontStyle||!!t?.typography?.fontWeight,onDeselect:I,isShownByDefault:s.fontAppearance,panelId:o,children:(0,Er.jsx)(fL,{value:{fontStyle:C,fontWeight:S},onChange:A,hasFontStyles:k,hasFontWeights:w,fontFamilyFaces:h,size:"__unstable-large"})}),E&&(0,Er.jsx)(aC,{className:"single-column",label:(0,ee.__)("Line height"),hasValue:()=>void 0!==t?.typography?.lineHeight,onDeselect:()=>B(void 0),isShownByDefault:s.lineHeight,panelId:o,children:(0,Er.jsx)(mL,{__unstableInputWidth:"auto",value:j,onChange:B,size:"__unstable-large"})}),N&&(0,Er.jsx)(aC,{className:"single-column",label:(0,ee.__)("Letter spacing"),hasValue:()=>!!t?.typography?.letterSpacing,onDeselect:()=>O(void 0),isShownByDefault:s.letterSpacing,panelId:o,children:(0,Er.jsx)(gL,{value:R,onChange:O,size:"__unstable-large",__unstableInputWidth:"auto"})}),L&&(0,Er.jsxs)(aC,{label:(0,ee.__)("Line indent"),hasValue:()=>!!t?.typography?.textIndent,onDeselect:()=>{n(_p(t,["typography","textIndent"],void 0))},isShownByDefault:s.textIndent,panelId:o,children:[(0,Er.jsx)(RL,{value:M,onChange:e=>{n(_p(t,["typography","textIndent"],e||void 0))},size:"__unstable-large",__unstableInputWidth:"auto",withSlider:!0,hasBottomMargin:a}),a&&(0,Er.jsx)(Zv.A,{label:(0,ee.__)("Indent all paragraphs"),checked:P,onChange:e=>{n({...t,settings:{typography:{textIndent:e?"all":"subsequent"}}})},help:D})]}),F&&(0,Er.jsx)(aC,{className:"single-column",label:(0,ee.__)("Columns"),hasValue:()=>!!t?.typography?.textColumns,onDeselect:()=>V(void 0),isShownByDefault:s.textColumns,panelId:o,children:(0,Er.jsx)(ox.A,{label:(0,ee.__)("Columns"),max:6,min:1,onChange:V,size:"__unstable-large",spinControls:"custom",value:z,initialPosition:1})}),W&&(0,Er.jsx)(aC,{className:"single-column",label:(0,ee.__)("Decoration"),hasValue:()=>!!t?.typography?.textDecoration,onDeselect:()=>q(void 0),isShownByDefault:s.textDecoration,panelId:o,children:(0,Er.jsx)(NL,{value:G,onChange:q,size:"__unstable-large",__unstableInputWidth:"auto"})}),K&&(0,Er.jsx)(aC,{className:"single-column",label:(0,ee.__)("Orientation"),hasValue:()=>!!t?.typography?.writingMode,onDeselect:()=>J(void 0),isShownByDefault:s.writingMode,panelId:o,children:(0,Er.jsx)(PL,{value:Y,onChange:J,size:"__unstable-large"})}),U&&(0,Er.jsx)(aC,{label:(0,ee.__)("Letter case"),hasValue:()=>!!t?.typography?.textTransform,onDeselect:()=>H(void 0),isShownByDefault:s.textTransform,panelId:o,children:(0,Er.jsx)(EL,{value:$,onChange:H,showNone:!0,isBlock:!0,size:"__unstable-large"})}),X&&(0,Er.jsxs)(aC,{label:(0,ee.__)("Text alignment"),hasValue:()=>!!t?.typography?.textAlign,onDeselect:()=>Q(void 0),isShownByDefault:s.textAlign,panelId:o,children:[(0,Er.jsx)(wL,{value:Z,onChange:Q,options:["left","center","right","justify"],size:"__unstable-large"}),"justify"===Z&&(0,Er.jsx)("div",{children:(0,Er.jsx)(wS.A,{status:"warning",isDismissible:!1,children:(0,ee.__)("Justified text can reduce readability. For better accessibility, use left-aligned text instead.")})})]})]})}var eM=class{_currentValue;_valueAsArray;constructor(e=""){this._currentValue="",this._valueAsArray=[],this.value=e}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(e){return!0}},tM="typography.__experimentalFontFamily",{kebabCase:nM}=Gh(Ev.j);function iM(e,t,n){if(!_n(t,tM))return e;if(av(t,TM,"fontFamily"))return e;if(!n?.fontFamily)return e;const i=new eM(e.className);i.add(`has-${nM(n?.fontFamily)}-font-family`);const r=i.value;return e.className=r||void 0,e}var rM={useBlockProps:function({name:e,fontFamily:t}){return iM({},e,{fontFamily:t})},addSaveProps:iM,attributeKeys:["fontFamily"],hasSupport:e=>_n(e,tM)};(0,Ei.U2)("blocks.registerBlockType","core/fontFamily/addAttribute",function(e){return _n(e,tM)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e});var{kebabCase:oM}=Gh(Ev.j),sM=(e,t,n)=>{if(t){const n=e?.find(({slug:e})=>e===t);if(n)return n}return{size:n}};function aM(e){if(e)return`has-${oM(e)}-font-size`}var lM="typography.fontSize";function cM(e,t,n){if(!_n(t,lM))return e;if(av(t,TM,"fontSize"))return e;const i=new eM(e.className);i.add(aM(n.fontSize));const r=i.value;return e.className=r||void 0,e}var uM={useBlockProps:function({name:e,fontSize:t,style:n}){const[i,r,o]=tv("typography.fontSizes","typography.fluid","layout");if(!_n(e,lM)||av(e,TM,"fontSize")||!t&&!n?.typography?.fontSize)return;let s;return n?.typography?.fontSize&&(s={style:{fontSize:dC({size:n.typography.fontSize},{typography:{fluid:r},layout:o})}}),t&&(s={style:{fontSize:sM(i,t,n?.typography?.fontSize).size}}),s?cM(s,e,{fontSize:t}):void 0},addSaveProps:cM,attributeKeys:["fontSize","style"],hasSupport:e=>_n(e,lM)},dM={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,Ei.U2)("blocks.registerBlockType","core/font/addAttribute",function(e){return _n(e,lM)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e}),(0,Ei.U2)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",function(e,t,n,i){return sv({fontSize:_n(e.name,lM)},dM,e,t,n,i)});var hM=[{icon:bL.A,title:(0,ee.__)("Align text left"),align:"left"},{icon:yL.A,title:(0,ee.__)("Align text center"),align:"center"},{icon:vL.A,title:(0,ee.__)("Align text right"),align:"right"}],pM={placement:"bottom-start"},fM=function({value:e,onChange:t,alignmentControls:n=hM,label:i=(0,ee.__)("Align text"),description:r=(0,ee.__)("Change text alignment"),isCollapsed:o=!0,isToolbar:s}){function a(n){return()=>t(e===n?void 0:n)}const l=n.find(t=>t.align===e),c=s?wv:Dv,u=s?{isCollapsed:o}:{toggleProps:{description:r},popoverProps:pM};return(0,Er.jsx)(c,{icon:l?l.icon:(0,ee.isRTL)()?vL.A:bL.A,label:i,controls:n.map(t=>{const{align:n}=t,i=e===n;return{...t,isActive:i,role:o?"menuitemradio":void 0,onClick:a(n)}}),...u})},mM=e=>(0,Er.jsx)(fM,{...e,isToolbar:!1}),gM="typography.textAlign",bM=[{icon:bL.A,title:(0,ee.__)("Align text left"),align:"left"},{icon:yL.A,title:(0,ee.__)("Align text center"),align:"center"},{icon:vL.A,title:(0,ee.__)("Align text right"),align:"right"}],yM=["left","center","right"],vM=[];function _M(e){return Array.isArray(e)?yM.filter(t=>e.includes(t)):!0===e?yM:vM}var xM={edit:function({style:e,name:t,setAttributes:n}){const i=dv(t),r=i?.typography?.textAlign,o=Vk();if(!r||"default"!==o)return null;const s=_M(vn(t,gM));if(!s.length)return null;const a=bM.filter(e=>s.includes(e.align));return(0,Er.jsx)(Mv,{group:"block",children:(0,Er.jsx)(mM,{value:e?.typography?.textAlign,onChange:t=>{const i={...e,typography:{...e?.typography,textAlign:t}};n({style:ov(i)})},alignmentControls:a})})},useBlockProps:function({name:e,style:t}){if(!t?.typography?.textAlign)return null;if(!_M(vn(e,gM)).length)return null;if(av(e,TM,"textAlign"))return null;const n=t.typography.textAlign;return{className:(0,mh.A)({[`has-text-align-${n}`]:n})}},addSaveProps:function(e,t,n){if(!n?.style?.typography?.textAlign)return e;const{textAlign:i}=n.style.typography;return _M(vn(t,gM)).includes(i)&&!av(t,TM,"textAlign")&&(e.className=(0,mh.A)(`has-text-align-${i}`,e.className)),e},attributeKeys:["style"],hasSupport:e=>_n(e,gM,!1)};function kM(){const e=(0,ee.__)("The text may be too small to read. Consider using a larger container or less text.");return(0,T.useEffect)(()=>{(0,dt.L)(e)},[e]),(0,Er.jsx)("div",{className:"block-editor-fit-text-size-warning",children:(0,Er.jsx)(wS.A,{spokenMessage:null,status:"warning",isDismissible:!1,children:e})})}var wM={},CM="typography.fitText";function SM({clientId:e,fitText:t=!1,setAttributes:n,name:i,fontSize:r,style:o}){return _n(i,CM)?(0,Er.jsx)(aC,{hasValue:()=>t,label:(0,ee.__)("Fit text"),onDeselect:()=>n({fitText:void 0}),resetAllFilter:()=>({fitText:void 0}),panelId:e,children:(0,Er.jsx)(Zv.A,{label:(0,ee.__)("Fit text"),checked:t,onChange:()=>{const e=!t||void 0,i={fitText:e};e&&(r&&(i.fontSize=void 0),o?.typography?.fontSize&&(i.style={...o,typography:{...o?.typography,fontSize:void 0}})),n(i)},help:t?(0,ee.__)("Text will resize to fit its container."):(0,ee.__)("The text will resize to fit its container, resetting other font size settings.")})}):null}function AM({fitText:e,name:t,clientId:n,isSelected:i}){const{fontSize:r}=function({fitText:e,name:t,clientId:n}){const[i,r]=(0,T.useState)(null),o=_n(t,CM),s=BO(n),{blockAttributes:a,parentId:l,blockMode:c}=(0,zt.A)(t=>{if(!n||!o||!e)return wM;const i=t(Qy).getBlockMode(n);return"html"===i?{blockMode:i}:{blockAttributes:t(Qy).getBlockAttributes(n),parentId:t(Qy).getBlockRootClientId(n),blockMode:i}},[n,o,e]),u=(0,T.useCallback)(()=>{if(!s||!o||!e)return;const t=`fit-text-${n}`;let i=s.ownerDocument.getElementById(t);i||(i=s.ownerDocument.createElement("style"),i.id=t,s.ownerDocument.head.appendChild(i));const a=`#block-${n}`,l=function(e,t){if(!e)return;t(0);const n=function(e,t){const n=e.scrollHeight>e.clientHeight;let i=0,r=2400,o=i;const s=window.getComputedStyle(e);let a=parseFloat(s.paddingLeft)||0,l=parseFloat(s.paddingRight)||0;const c=document.createRange();c.selectNodeContents(e);let u=e;const d=e.parentElement;if(d){const e=window.getComputedStyle(d);"flex"===e?.display&&(u=d,a+=parseFloat(e.paddingLeft)||0,l+=parseFloat(e.paddingRight)||0)}let h=u.clientHeight;for(;i<=r;){const s=Math.floor((i+r)/2);t(s);const d=c.getBoundingClientRect().width,p=e.scrollWidth<=u.clientWidth&&d<=u.clientWidth-a-l,f=n||e.scrollHeight<=u.clientHeight||e.scrollHeight<=h;u.clientHeight>h&&(h=u.clientHeight),p&&f?(o=s,i=s+1):r=s-1}return c.detach(),o}(e,t);return t(n),n}(s,e=>{i.textContent=0===e?"":`${a} { font-size: ${e}px !important; }`});r(l)},[s,n,o,e]);return(0,T.useEffect)(()=>{if(!(e&&s&&n&&o&&"html"!==c))return;const t=s,i=t.style.visibility;let r,a=null,l=null,d=null;return a=window.requestAnimationFrame(()=>{t.style.visibility="hidden",l=window.requestAnimationFrame(()=>{u(),d=setTimeout(()=>{t.style.visibility=i},10)})}),window.ResizeObserver&&t.parentElement&&(r=new window.ResizeObserver(u),r.observe(t.parentElement),r.observe(t)),()=>{null!==a&&window.cancelAnimationFrame(a),null!==l&&window.cancelAnimationFrame(l),null!==d&&clearTimeout(d),r&&r.disconnect();const e=`fit-text-${n}`,i=t.ownerDocument.getElementById(e);i&&i.remove()}},[e,n,l,u,s,o,c]),(0,T.useEffect)(()=>{if(e&&s&&o&&"html"!==c){const e=window.requestAnimationFrame(()=>{s&&u()});return()=>window.cancelAnimationFrame(e)}},[a,e,u,s,o,c]),{fontSize:i}}({fitText:e,name:t,clientId:n});return i&&r&&r<12?(0,Er.jsx)(oC,{group:"typography",children:(0,Er.jsx)(kM,{})}):null}(0,Ei.U2)("blocks.registerBlockType","core/fit-text/addAttribute",function(e){return _n(e,CM)?e.attributes?.fitText?e:{...e,attributes:{...e.attributes,fitText:{type:"boolean"}}}:e});var IM=(0,gh.f)(e=>function(t){const{name:n,attributes:i,clientId:r,isSelected:o,setAttributes:s}=t,{fitText:a}=i;return _n(n,CM)?(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(e,{...t}),(0,Er.jsx)(oC,{group:"typography",children:(0,Er.jsx)(SM,{clientId:r,fitText:a,setAttributes:s,name:n,fontSize:i.fontSize,style:i.style})}),a&&(0,Er.jsx)(AM,{fitText:a,name:n,clientId:r,isSelected:o})]}):(0,Er.jsx)(e,{...t})},"addFitTextControl");(0,Ei.U2)("editor.BlockEdit","core/fit-text/add-fit-text-control",IM);var EM={useBlockProps:function({name:e,fitText:t}){return t&&_n(e,CM)?{className:"has-fit-text"}:{}},addSaveProps:function(e,t,n){if(!_n(t,CM))return e;const{fitText:i}=n;if(!i)return e;const r=e.className?`${e.className} has-fit-text`:"has-fit-text";return{...e,className:r}},attributeKeys:["fitText","fontSize","style"],hasSupport:e=>_n(e,CM),edit:()=>null};function jM(e,t){return Object.fromEntries(Object.entries(e).filter(([e])=>!t.includes(e)))}var TM="typography",BM=["typography.lineHeight",lM,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",tM,gM,"typography.textColumns","typography.__experimentalTextDecoration","typography.textIndent","typography.__experimentalWritingMode","typography.__experimentalTextTransform","typography.__experimentalLetterSpacing",CM];function NM(e){const t={...jM(e,["fontFamily"])},n=e?.typography?.fontSize,i=e?.typography?.fontFamily,r="string"==typeof n&&n?.startsWith("var:preset|font-size|")?n.substring(21):void 0,o=i?.startsWith("var:preset|font-family|")?i.substring(23):void 0;return t.typography={...jM(t.typography,["fontFamily"]),fontSize:r?void 0:n},{style:ov(t),fontFamily:o,fontSize:r}}function RM(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 OM({children:e,resetAllFilter:t}){const n=(0,T.useCallback)(e=>{const n=RM(e),i=t(n);return{...e,...NM(i)}},[t]);return(0,Er.jsx)(oC,{group:"typography",resetAllFilter:n,children:e})}function LM({clientId:e,name:t,setAttributes:n,settings:i}){const r=FL(i),{style:o,fontFamily:s,fontSize:a,fitText:l}=(0,zt.A)(t=>{if(!r)return{};const{style:n,fontFamily:i,fontSize:o,fitText:s}=t(Qy).getBlockAttributes(e)||{};return{style:n,fontFamily:i,fontSize:o,fitText:s}},[e,r]),c=(0,T.useMemo)(()=>RM({style:o,fontFamily:s,fontSize:a}),[o,a,s]);if(!r)return null;const u=vn(t,[TM,"__experimentalDefaultControls"]);return(0,Er.jsx)(QL,{as:OM,panelId:e,settings:i,value:c,onChange:e=>{const t=NM(e);(t.fontSize||t.style?.typography?.fontSize)&&l&&(t.fitText=void 0),n(t)},defaultControls:u})}var MM={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}},PM={all:(0,ee.__)("All sides"),top:(0,ee.__)("Top side"),bottom:(0,ee.__)("Bottom side"),left:(0,ee.__)("Left side"),right:(0,ee.__)("Right side"),vertical:(0,ee.__)("Top and bottom sides"),horizontal:(0,ee.__)("Left and right sides")},DM={top:void 0,right:void 0,bottom:void 0,left:void 0},FM=["top","right","bottom","left"];function zM(e={},t=FM){const n=UM(t);return n.some(t=>e[t]!==e[n[0]])}function VM(e){return e&&Object.values(e).filter(e=>!!e&&/\d/.test(e)).length>0}function UM(e){const t=[];if(!e?.length)return FM;if(e.includes("vertical"))t.push("top","bottom");else if(e.includes("horizontal"))t.push("left","right");else{const n=FM.filter(t=>e.includes(t));t.push(...n)}return t}function $M(e){const t=new Set(e?[]:FM);return e?.forEach(e=>{"vertical"===e?(t.add("top"),t.add("bottom")):"horizontal"===e?(t.add("right"),t.add("left")):t.add(e)}),t}function HM(e,t){return e.startsWith(`var:preset|${t}|`)}var WM=(0,ex.A)("span",{target:"e1j5nr4z8"})({name:"1w884gc",styles:"box-sizing:border-box;display:block;width:24px;height:24px;position:relative;padding:4px"}),GM=(0,ex.A)("span",{target:"e1j5nr4z7"})({name:"i6vjox",styles:"box-sizing:border-box;display:block;position:relative;width:100%;height:100%"}),qM=({isFocused:e})=>(0,tx.AH)({backgroundColor:"currentColor",opacity:e?1:.3},"",""),KM=(0,ex.A)("span",{target:"e1j5nr4z6"})("box-sizing:border-box;display:block;pointer-events:none;position:absolute;",qM,";"),YM=(0,ex.A)(KM,{target:"e1j5nr4z5"})({name:"1k2w39q",styles:"bottom:3px;top:3px;width:2px"}),JM=(0,ex.A)(KM,{target:"e1j5nr4z4"})({name:"1q9b07k",styles:"height:2px;left:3px;right:3px"}),XM=(0,ex.A)(JM,{target:"e1j5nr4z3"})({name:"abcix4",styles:"top:0"}),ZM=(0,ex.A)(YM,{target:"e1j5nr4z2"})({name:"1wf8jf",styles:"right:0"}),QM=(0,ex.A)(JM,{target:"e1j5nr4z1"})({name:"8tapst",styles:"bottom:0"}),eP=(0,ex.A)(YM,{target:"e1j5nr4z0"})({name:"1ode3cm",styles:"left:0"});function tP({size:e=24,side:t="all",sides:n,...i}){const r=e=>!(e=>n?.length&&!n.includes(e))(e)&&("all"===t||t===e),o=r("top")||r("vertical"),s=r("right")||r("horizontal"),a=r("bottom")||r("vertical"),l=r("left")||r("horizontal"),c=e/24;return(0,Er.jsx)(WM,{style:{transform:`scale(${c})`},...i,children:(0,Er.jsxs)(GM,{children:[(0,Er.jsx)(XM,{isFocused:o}),(0,Er.jsx)(ZM,{isFocused:s}),(0,Er.jsx)(QM,{isFocused:a}),(0,Er.jsx)(eP,{isFocused:l})]})})}var nP=(0,ex.A)(vx,{target:"e1jovhle5"})({name:"1ejyr19",styles:"max-width:90px"}),iP=(0,ex.A)(Cw.A,{target:"e1jovhle4"})({name:"1j1lmoi",styles:"grid-column:1/span 3"}),rP=(0,ex.A)(fv.Ay,{target:"e1jovhle3"})({name:"tkya7b",styles:"grid-area:1/2;justify-self:end"}),oP=(0,ex.A)("div",{target:"e1jovhle2"})({name:"1dfa8al",styles:"grid-area:1/3;justify-self:end"}),sP=(0,ex.A)(tP,{target:"e1jovhle1"})({name:"ou8xsw",styles:"flex:0 0 auto"}),aP=(0,ex.A)(gk.A,{target:"e1jovhle0"})("width:100%;margin-inline-end:",(0,ax.x)(2),";"),lP=()=>{};function cP(e,t,n){const i=$M(t);let r=[];switch(e){case"all":r=["top","bottom","left","right"];break;case"horizontal":r=["left","right"];break;case"vertical":r=["top","bottom"];break;default:r=[e]}if(n)switch(e){case"top":r.push("bottom");break;case"bottom":r.push("top");break;case"left":r.push("left");break;case"right":r.push("right")}return r.filter(e=>i.has(e))}function uP({__next40pxDefaultSize:e,onChange:t=lP,onFocus:n=lP,values:i,selectedUnits:r,setSelectedUnits:o,sides:s,side:a,min:l=0,presets:c,presetKey:u,...d}){const h=cP(a,s),p=e=>{t(e)},f=(e,t)=>{const n={...i},r=void 0===e||isNaN(parseFloat(e))?void 0:e;cP(a,s,!!t?.event.altKey).forEach(e=>{n[e]=r}),p(n)},m=function(e={},t=FM){const n=UM(t);if(n.every(t=>e[t]===e[n[0]]))return e[n[0]]}(i,h),g=VM(i),b=g&&h.length>1&&zM(i,h),[y,v]=X_(m),_=g?v:r[h[0]],x=[(0,SS.A)(uP,"box-control-input"),a].join("-"),k=h.length>1&&void 0===m&&h.some(e=>r[e]!==_),w=void 0===m&&_?_:m,C=b||k?(0,ee.__)("Mixed"):void 0,S=c&&c.length>0&&u,A=S&&void 0!==m&&!b&&HM(m,u),[I,E]=(0,T.useState)(!S||!A&&!b&&void 0!==m),j=A?function(e,t,n){if(!HM(e,t))return;const i=e.match(new RegExp(`^var:preset\\|${t}\\|(.+)$`));if(!i)return;const r=i[1],o=n.findIndex(e=>e.slug===r);return-1!==o?o:void 0}(m,u,c):void 0,B=S?[{value:0,label:"",tooltip:(0,ee.__)("None")},...c.map((e,t)=>({value:t+1,label:"",tooltip:e.name??e.slug}))]:[];return(0,Er.jsxs)(iP,{expanded:!0,children:[(0,Er.jsx)(sP,{side:a,sides:s}),I&&(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(jR.Ay,{placement:"top-end",text:PM[a],children:(0,Er.jsx)(nP,{...d,min:l,__shouldNotWarnDeprecated36pxSize:!0,__next40pxDefaultSize:e,className:"component-box-control__unit-control",id:x,isPressEnterToChange:!0,disableUnits:b||k,value:w,onChange:f,onUnitChange:e=>{const t={...r};h.forEach(n=>{t[n]=e}),o(t)},onFocus:e=>{n(e,{side:a})},label:PM[a],placeholder:C,hideLabelFromVision:!0})}),(0,Er.jsx)(aP,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,"aria-controls":x,label:PM[a],hideLabelFromVision:!0,onChange:e=>{f(void 0!==e?[e,_].join(""):void 0)},min:isFinite(l)?l:0,max:MM[_??"px"]?.max??10,step:MM[_??"px"]?.step??.1,value:y??0,withInputField:!1})]}),S&&!I&&(0,Er.jsx)(aP,{__next40pxDefaultSize:!0,className:"spacing-sizes-control__range-control",value:void 0!==j?j+1:0,onChange:e=>{const t=0===e||void 0===e?void 0:function(e,t,n){return`var:preset|${t}|${n[e].slug}`}(e-1,u,c);(e=>{const t={...i};h.forEach(n=>{t[n]=e}),p(t)})(t)},withInputField:!1,"aria-valuenow":void 0!==j?j+1:0,"aria-valuetext":B[void 0!==j?j+1:0].tooltip,renderTooltipContent:e=>B[e||0].tooltip,min:0,max:B.length-1,marks:B,label:PM[a],hideLabelFromVision:!0}),S&&(0,Er.jsx)(fv.Ay,{label:I?(0,ee.__)("Use size preset"):(0,ee.__)("Set custom size"),icon:CR.A,onClick:()=>{E(!I)},isPressed:I,size:"small",iconSize:24})]},`box-control-${a}`)}function dP({isLinked:e,...t}){const n=e?(0,ee.__)("Unlink sides"):(0,ee.__)("Link sides");return(0,Er.jsx)(fv.Ay,{...t,className:"component-box-control__linked-button",size:"small",icon:e?fB.A:IS.A,iconSize:24,label:n})}var hP={min:0},pP=()=>{};var fP=function e({__next40pxDefaultSize:t=!1,id:n,inputProps:i=hP,onChange:r=pP,label:o=(0,ee.__)("Box Control"),values:s,units:a,sides:l,splitOnAxis:c=!1,allowReset:u=!0,resetValues:d=DM,presets:h,presetKey:p,onMouseOver:f,onMouseOut:m}){const[g,b]=(0,fx.A)(s,{fallback:DM}),y=g||DM,v=VM(s),_=1===l?.length,[x,k]=(0,T.useState)(v),[w,C]=(0,T.useState)(!v||!zM(y)||_),[S,A]=(0,T.useState)({top:X_(s?.top)[1],right:X_(s?.right)[1],bottom:X_(s?.bottom)[1],left:X_(s?.left)[1]}),I=function(t){const n=(0,SS.A)(e,"inspector-box-control");return t||n}(n),E=`${I}-heading`,j={onMouseOver:f,onMouseOut:m,...i,onChange:e=>{r(e),b(e),k(!0)},isLinked:w,units:a,selectedUnits:S,setSelectedUnits:A,sides:l,values:y,__next40pxDefaultSize:t,presets:h,presetKey:p};(0,bx.M)({componentName:"BoxControl",__next40pxDefaultSize:t,size:void 0});const B=$M(l);if(h&&!p||!h&&p){const e=h?"presets":"presetKey",t=h?"presetKey":"presets";!0===globalThis.SCRIPT_DEBUG&&(0,sn.A)(`wp.components.BoxControl: the '${t}' prop is required when the '${e}' prop is defined.`)}return(0,Er.jsxs)(Jw,{id:I,columns:3,templateColumns:"1fr min-content min-content",role:"group","aria-labelledby":E,children:[(0,Er.jsx)(mk.pu.VisualLabel,{id:E,children:o}),w&&(0,Er.jsx)(iP,{children:(0,Er.jsx)(uP,{side:"all",...j})}),!_&&(0,Er.jsx)(oP,{children:(0,Er.jsx)(dP,{onClick:()=>{C(!w)},isLinked:w})}),!w&&c&&["vertical","horizontal"].map(e=>(0,Er.jsx)(uP,{side:e,...j},e)),!w&&!c&&Array.from(B).map(e=>(0,Er.jsx)(uP,{side:e,...j},e)),u&&(0,Er.jsx)(rP,{className:"component-box-control__reset-button",variant:"secondary",size:"small",onClick:()=>{r(d),b(d),A(d),k(!1)},disabled:!x,children:(0,ee.__)("Reset")})]})},mP=[],gP=new Intl.Collator("und",{numeric:!0}).compare;function bP(){const[e,t,n,i]=tv("spacing.spacingSizes.custom","spacing.spacingSizes.theme","spacing.spacingSizes.default","spacing.defaultSpacingSizes"),r=e??mP,o=t??mP,s=n&&!1!==i?n:mP;return(0,T.useMemo)(()=>{const e=[{name:(0,ee.__)("None"),slug:"0",size:0},...r,...o,...s];return e.every(({slug:e})=>/^[0-9]/.test(e))&&e.sort((e,t)=>gP(e.slug,t.slug)),e.length>8?[{name:(0,ee.__)("Default"),slug:"default",size:void 0},...e]:e},[r,o,s])}var yP={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 vP({icon:e,isMixed:t=!1,minimumCustomValue:n,onChange:i,onMouseOut:r,onMouseOver:o,showSideInLabel:s=!0,side:a,spacingSizes:l,type:c,value:u,...d}){const h=(0,zt.A)(e=>{const t=e(Qy).getSettings();return t?.disableCustomSpacingSizes}),[p]=tv("spacing.units"),f=Z_({availableUnits:p||["px","em","rem"]}),m=(0,T.useMemo)(()=>l?.map(e=>({name:e.name,slug:e.slug,size:e.size}))||[],[l]),g=(u_.includes(a)||["vertical","horizontal"].includes(a))&&s?p_[a]:"",b=s?c?.toLowerCase():c,y=(0,ee.sprintf)((0,ee._x)("%1$s %2$s","spacing"),g,b).trim(),v=f[0]?.value||"px";return(0,Er.jsx)(BR,{allowNegativeOnDrag:n<0,ariaLabel:y,className:"spacing-sizes-control",customValueSettings:yP,disableCustomValues:h,icon:e,isMixed:t,minimumCustomValue:n,onChange:i,onMouseOut:r,onMouseOver:o,presets:m,presetType:"spacing",selectedUnit:v,units:f,value:u,...d})}var _P=["vertical","horizontal"];function xP({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:i,sides:r,spacingSizes:o,type:s,values:a}){const l=e=>n=>{if(!t)return;const i={...Object.keys(a).reduce((e,t)=>(e[t]=g_(a[t],o),e),{})};"vertical"===e&&(i.top=n,i.bottom=n),"horizontal"===e&&(i.left=n,i.right=n),t(i)},c=r?.length?_P.filter(e=>y_(r,e)):_P;return(0,Er.jsx)(Er.Fragment,{children:c.map(t=>{const r="vertical"===t?a.top:a.left;return(0,Er.jsx)(vP,{icon:h_[t],label:p_[t],minimumCustomValue:e,onChange:l(t),onMouseOut:n,onMouseOver:i,side:t,spacingSizes:o,type:s,value:r,withInputField:!1},`spacing-sizes-control-${t}`)})})}function kP({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:i,sides:r,spacingSizes:o,type:s,values:a}){const l=r?.length?u_.filter(e=>r.includes(e)):u_,c=e=>n=>{const i={...Object.keys(a).reduce((e,t)=>(e[t]=g_(a[t],o),e),{})};i[e]=n,t(i)};return(0,Er.jsx)(Er.Fragment,{children:l.map(t=>(0,Er.jsx)(vP,{icon:h_[t],label:p_[t],minimumCustomValue:e,onChange:c(t),onMouseOut:n,onMouseOver:i,side:t,spacingSizes:o,type:s,value:a[t],withInputField:!1},`spacing-sizes-control-${t}`))})}function wP({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:i,showSideInLabel:r,side:o,spacingSizes:s,type:a,values:l}){return(0,Er.jsx)(vP,{label:p_[o],minimumCustomValue:e,onChange:(c=o,e=>{const n={...Object.keys(l).reduce((e,t)=>(e[t]=g_(l[t],s),e),{})};n[c]=e,t(n)}),onMouseOut:n,onMouseOver:i,showSideInLabel:r,side:o,spacingSizes:s,type:a,value:l[o],withInputField:!1});var c}function CP({isLinked:e,...t}){const n=e?(0,ee.__)("Unlink sides"):(0,ee.__)("Link sides");return(0,Er.jsx)(fv.Ay,{...t,size:"small",icon:e?fB.A:IS.A,iconSize:24,label:n})}function SP({inputProps:e,label:t,minimumCustomValue:n=0,onChange:i,onMouseOut:r,onMouseOver:o,showSideInLabel:s=!0,sides:a=u_,useSelect:l,values:c}){const u=bP(),d=c||d_,h=1===a?.length,p=a?.includes("horizontal")&&a?.includes("vertical")&&2===a?.length,[f,m]=(0,T.useState)(function(e={},t){const{top:n,right:i,bottom:r,left:o}=e,s=[n,i,r,o].filter(Boolean),a=!(n!==r||o!==i||!n&&!o),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),c=t?.includes("horizontal")&&t?.includes("vertical")&&2===t?.length;if(y_(t)&&(a||l))return f_;if(c&&1===s.length){let t;return Object.entries(e).some(([e,n])=>(t=e,void 0!==n)),t}return 1!==t?.length||s.length?m_:t[0]}(d,a)),g={...e,minimumCustomValue:n,onChange:e=>{const t={...c,...e};i(t)},onMouseOut:r,onMouseOver:o,sides:a,spacingSizes:u,type:t,useSelect:l,values:d},b=u_.includes(f)&&s?p_[f]:"",y=(0,ee.sprintf)((0,ee._x)("%1$s %2$s","spacing"),t,b).trim();return(0,Er.jsxs)("fieldset",{className:"spacing-sizes-control",children:[(0,Er.jsxs)(Cw.A,{className:"spacing-sizes-control__header",children:[(0,Er.jsx)(mk.Ay.VisualLabel,{as:"legend",className:"spacing-sizes-control__label",children:y}),!h&&!p&&(0,Er.jsx)(CP,{label:t,onClick:()=>{m(f===f_?m_:f_)},isLinked:f===f_})]}),(0,Er.jsx)(Q_.A,{spacing:.5,children:f===f_?(0,Er.jsx)(xP,{...g}):f===m_?(0,Er.jsx)(kP,{...g}):(0,Er.jsx)(wP,{side:f,...g,showSideInLabel:s})})]})}var AP=[],IP={...SR,px:{max:1e3,steps:1},em:{max:50,steps:.1},rem:{max:50,steps:.1}};function EP({label:e=(0,ee.__)("Dimension"),onChange:t,value:n,dimensionSizes:i}){const[r,o]=tv("dimensions.dimensionSizes","spacing.units"),s=i??r,a=Z_({availableUnits:o||["%","px","em","rem","vh","vw"]}),l=function(e){const t=e?.default??AP,n=e?.custom??AP,i=e?.theme??AP;return(0,T.useMemo)(()=>[{name:(0,ee.__)("None"),slug:"0",size:0},...n,...i,...t],[n,i,t])}(s),[c,u]=(0,T.useState)(()=>{const[,e]=X_(n);return e||a[0]?.value||"px"});return(0,Er.jsxs)("fieldset",{className:"block-editor-dimension-control",children:[(0,Er.jsx)(mk.Ay.VisualLabel,{as:"legend",children:e}),(0,Er.jsx)(BR,{ariaLabel:e,className:"block-editor-dimension-control",customValueSettings:IP,minimumCustomValue:0,onChange:t,onUnitChange:e=>{const[i,r]=X_(n);["em","rem"].includes(e)&&"px"===r?t((i/16).toFixed(2)+e):["em","rem"].includes(r)&&"px"===e?t(Math.round(16*i)+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)&&i>100&&t(100+e),u(e)},presets:l,presetType:"dimension",selectedUnit:c,showTooltip:!0,units:a,value:n})]})}function jP(e,t){const{getBlockOrder:n,getBlockAttributes:i}=(0,zt.A)(Qy);return(r,o)=>{const s=(o-1)*t+r-1;let a=0;for(const r of n(e)){const{columnStart:e,rowStart:n}=i(r).style?.layout??{};(n-1)*t+e-1<s&&a++}return a}}function TP(e,t){const{orientation:n="horizontal"}=t;return"fill"===e?(0,ee.__)("Stretch to fill available space."):"fixed"===e&&"horizontal"===n?(0,ee.__)("Specify a fixed width."):"fixed"===e?(0,ee.__)("Specify a fixed height."):(0,ee.__)("Fit contents.")}function BP({value:e={},onChange:t,parentLayout:n,isShownByDefault:i,panelId:r}){const{type:o,default:{type:s="default"}={}}=n??{},a=o||s;return"flex"===a?(0,Er.jsx)(NP,{childLayout:e,onChange:t,parentLayout:n,isShownByDefault:i,panelId:r}):"grid"===a?(0,Er.jsx)(OP,{childLayout:e,onChange:t,parentLayout:n,isShownByDefault:i,panelId:r}):null}function NP({childLayout:e,onChange:t,parentLayout:n,isShownByDefault:i,panelId:r}){const{selfStretch:o,flexSize:s}=e,{orientation:a="horizontal"}=n??{},l="horizontal"===a?(0,ee.__)("Width"):(0,ee.__)("Height"),[c]=tv("spacing.units"),u=Z_({availableUnits:c||["%","px","em","rem","vh","vw"]});return(0,T.useEffect)(()=>{"fixed"!==o||s||t({...e,selfStretch:"fit"})},[]),(0,Er.jsxs)(Q_.A,{as:aC,spacing:2,hasValue:()=>!!o,label:l,onDeselect:()=>{t({selfStretch:void 0,flexSize:void 0})},isShownByDefault:i,panelId:r,children:[(0,Er.jsxs)(Jv.A,{size:"__unstable-large",label:RP(n),value:o||"fit",help:TP(o,n),onChange:e=>{t({selfStretch:e,flexSize:"fixed"!==e?null:s})},isBlock:!0,children:[(0,Er.jsx)(bk.A,{value:"fit",label:(0,ee._x)("Fit","Intrinsic block width in flex layout")},"fit"),(0,Er.jsx)(bk.A,{value:"fill",label:(0,ee._x)("Grow","Block with expanding width in flex layout")},"fill"),(0,Er.jsx)(bk.A,{value:"fixed",label:(0,ee._x)("Fixed","Block with fixed width in flex layout")},"fixed")]}),"fixed"===o&&(0,Er.jsx)(vx,{size:"__unstable-large",units:u,onChange:e=>{t({selfStretch:o,flexSize:e})},value:s,min:0,label:l,hideLabelFromVision:!0})]})}function RP(e){const{orientation:t="horizontal"}=e;return"horizontal"===t?(0,ee.__)("Width"):(0,ee.__)("Height")}function OP({childLayout:e,onChange:t,parentLayout:n,isShownByDefault:i,panelId:r}){const{columnStart:o,rowStart:s,columnSpan:a,rowSpan:l}=e,{columnCount:c,rowCount:u}=n??{},d=(0,zt.A)(e=>e(Qy).getBlockRootClientId(r)),{moveBlocksToPosition:h,__unstableMarkNextChangeAsNotPersistent:p}=(0,Vt.A)(Qy),f=jP(d,c||3),m=c?c-(o??1)+1:void 0,g=window.__experimentalEnableGridInteractivity&&u?u-(s??1)+1:void 0;return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsxs)(Kv.A,{as:aC,hasValue:()=>!!a||!!l,label:(0,ee.__)("Grid span"),onDeselect:()=>{t({columnSpan:void 0,rowSpan:void 0})},isShownByDefault:i,panelId:r,children:[(0,Er.jsx)(Yv.A,{style:{width:"50%"},children:(0,Er.jsx)(PS.Ay,{size:"__unstable-large",label:(0,ee.__)("Column span"),type:"number",onChange:e=>{const n=""===e?1:parseInt(e,10),i=m?Math.min(n,m):n;t({columnStart:o,rowStart:s,rowSpan:l,columnSpan:i})},value:a??1,min:1,max:m})}),(0,Er.jsx)(Yv.A,{style:{width:"50%"},children:(0,Er.jsx)(PS.Ay,{size:"__unstable-large",label:(0,ee.__)("Row span"),type:"number",onChange:e=>{const n=""===e?1:parseInt(e,10),i=g?Math.min(n,g):n;t({columnStart:o,rowStart:s,columnSpan:a,rowSpan:i})},value:l??1,min:1,max:g})})]}),window.__experimentalEnableGridInteractivity&&(0,Er.jsxs)(Kv.A,{as:aC,hasValue:()=>!!o||!!s,label:(0,ee.__)("Grid placement"),onDeselect:()=>{t({columnStart:void 0,rowStart:void 0})},isShownByDefault:!1,panelId:r,children:[(0,Er.jsx)(Yv.A,{style:{width:"50%"},children:(0,Er.jsx)(PS.Ay,{size:"__unstable-large",label:(0,ee.__)("Column"),type:"number",onChange:e=>{const n=""===e?1:parseInt(e,10);t({columnStart:n,rowStart:s,columnSpan:a,rowSpan:l}),p(),h([r],d,d,f(n,s))},value:o??1,min:1,max:c?c-(a??1)+1:void 0})}),(0,Er.jsx)(Yv.A,{style:{width:"50%"},children:(0,Er.jsx)(PS.Ay,{size:"__unstable-large",label:(0,ee.__)("Row"),type:"number",onChange:e=>{const n=""===e?1:parseInt(e,10);t({columnStart:o,rowStart:n,columnSpan:a,rowSpan:l}),p(),h([r],d,d,f(o,n))},value:s??1,min:1,max:u?u-(l??1)+1:void 0})})]})]})}function LP({panelId:e,value:t,onChange:n=()=>{},options:i,defaultValue:r="auto",hasValue:o,isShownByDefault:s=!0}){const a=t??"auto",[l,c,u]=tv("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,ee._x)("Original","Aspect ratio option for dimensions control"),value:"auto"},...u?h:[],...d||[],{label:(0,ee._x)("Custom","Aspect ratio option for dimensions control"),value:"custom",disabled:!0,hidden:!0}];return(0,Er.jsx)(aC,{hasValue:o||(()=>a!==r),label:(0,ee.__)("Aspect ratio"),onDeselect:()=>n(void 0),isShownByDefault:s,panelId:e,children:(0,Er.jsx)(oE.A,{label:(0,ee.__)("Aspect ratio"),value:a,options:i??p,onChange:n,size:"__unstable-large"})})}var MP=["horizontal","vertical"];function PP(e){const t=DP(e),n=FP(e),i=zP(e),r=VP(e),o=UP(e),s=$P(e),a=HP(e),l=WP(e),c=GP(e),u=qP(e);return"web"===Uo.A.OS&&(t||n||i||r||o||s||a||l||c||u)}function DP(e){return e?.layout?.contentSize}function FP(e){return e?.layout?.wideSize}function zP(e){return e?.spacing?.padding}function VP(e){return e?.spacing?.margin}function UP(e){return e?.spacing?.blockGap}function $P(e){return e?.dimensions?.height}function HP(e){return e?.dimensions?.minHeight}function WP(e){return e?.dimensions?.width}function GP(e){return e?.dimensions?.aspectRatio}function qP(e){const{type:t="default",default:{type:n="default"}={},allowSizingOnChildren:i=!1}=e?.parentLayout??{},r=("flex"===n||"flex"===t||"grid"===n||"grid"===t)&&i;return!!e?.layout&&r}function KP(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 YP(e){return e&&"string"==typeof e?{top:e,right:e,bottom:e,left:e}:e}function JP({resetAllFilter:e,onChange:t,value:n,panelId:i,children:r}){const o=Zw();return(0,Er.jsx)(Xw,{label:(0,ee.__)("Dimensions"),resetAll:()=>{const i=e(n);t(i)},panelId:i,dropdownMenuProps:o,children:r})}var XP={contentSize:!0,wideSize:!0,padding:!0,margin:!0,blockGap:!0,height:!0,minHeight:!0,width:!0,aspectRatio:!0,childLayout:!0};function ZP({as:e=JP,value:t,onChange:n,inheritedValue:i=t,settings:r,panelId:o,defaultControls:s=XP,onVisualize:a=()=>{},includeLayoutControls:l=!1}){const{dimensions:c,spacing:u}=r,d=e=>e&&"object"==typeof e?Object.keys(e).reduce((t,n)=>(t[n]=vC({settings:{dimensions:c,spacing:u}},"",e[n]),t),{}):vC({settings:{dimensions:c,spacing:u}},"",e),h=function(e){const{defaultSpacingSizes:t,spacingSizes:n}=e?.spacing||{};return!1!==t&&n?.default?.length>0||n?.theme?.length>0||n?.custom?.length>0}(r),p=Z_({availableUnits:r?.spacing?.units||["%","px","em","rem","vw"]}),f=-1/0,[m,g]=(0,T.useState)(f),b=DP(r)&&l,y=d(i?.layout?.contentSize),v=e=>{n(_p(t,["layout","contentSize"],e||void 0))},_=FP(r)&&l,x=d(i?.layout?.wideSize),k=e=>{n(_p(t,["layout","wideSize"],e||void 0))},w=zP(r),C=YP(d(i?.spacing?.padding)),S=Array.isArray(r?.spacing?.padding)?r?.spacing?.padding:r?.spacing?.padding?.sides,A=S&&S.some(e=>MP.includes(e)),I=e=>{const i=KP(e,S);n(_p(t,["spacing","padding"],i))},E=()=>a("padding"),j=VP(r),B=YP(d(i?.spacing?.margin)),N=Array.isArray(r?.spacing?.margin)?r?.spacing?.margin:r?.spacing?.margin?.sides,R=N&&N.some(e=>MP.includes(e)),O=e=>{const i=KP(e,N);n(_p(t,["spacing","margin"],i))},L=()=>a("margin"),M=UP(r),P=Array.isArray(r?.spacing?.blockGap)?r?.spacing?.blockGap:r?.spacing?.blockGap?.sides,D=P&&P.some(e=>MP.includes(e)),F=d(i?.spacing?.blockGap),z=function(e,t){return e?"string"==typeof e?t?{top:e,right:e,bottom:e,left:e}:{top:e}:{...e,right:e?.left,bottom:e?.top}:e}(F,D),V=e=>{n(_p(t,["spacing","blockGap"],e))},U=e=>{e||V(null),!D&&e?.hasOwnProperty("top")?V(e.top):V({top:e?.top,left:e?.left})},$=HP(r),H=d(i?.dimensions?.minHeight),W=e=>{const i=_p(t,["dimensions","minHeight"],e);n(_p(i,["dimensions","aspectRatio"],void 0))},G=$P(r),q=d(i?.dimensions?.height),K=e=>{const i=_p(t,["dimensions","height"],e);n(_p(i,["dimensions","aspectRatio"],void 0))},Y=WP(r),J=d(i?.dimensions?.width),X=e=>{n(_p(t,["dimensions","width"],e))},Z=GP(r),Q=d(i?.dimensions?.aspectRatio),te=qP(r),ne=i?.layout,ie=(0,T.useCallback)(e=>({...e,layout:ov({...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,height:void 0,minHeight:void 0,aspectRatio:void 0,width:void 0}}),[]),re=()=>a(!1);return(0,Er.jsxs)(e,{resetAllFilter:ie,value:t,onChange:n,panelId:o,children:[(b||_)&&(0,Er.jsx)("span",{className:"span-columns",children:(0,ee.__)("Set the width of the main content area.")}),b&&(0,Er.jsx)(aC,{label:(0,ee.__)("Content width"),hasValue:()=>!!t?.layout?.contentSize,onDeselect:()=>v(void 0),isShownByDefault:s.contentSize??XP.contentSize,panelId:o,children:(0,Er.jsx)(vx,{__next40pxDefaultSize:!0,label:(0,ee.__)("Content width"),labelPosition:"top",value:y||"",onChange:e=>{v(e)},units:p,prefix:(0,Er.jsx)(_x.A,{variant:"icon",children:(0,Er.jsx)(xx.A,{icon:kx.A})})})}),_&&(0,Er.jsx)(aC,{label:(0,ee.__)("Wide width"),hasValue:()=>!!t?.layout?.wideSize,onDeselect:()=>k(void 0),isShownByDefault:s.wideSize??XP.wideSize,panelId:o,children:(0,Er.jsx)(vx,{__next40pxDefaultSize:!0,label:(0,ee.__)("Wide width"),labelPosition:"top",value:x||"",onChange:e=>{k(e)},units:p,prefix:(0,Er.jsx)(_x.A,{variant:"icon",children:(0,Er.jsx)(xx.A,{icon:wx.A})})})}),w&&(0,Er.jsxs)(aC,{hasValue:()=>!!t?.spacing?.padding&&Object.keys(t?.spacing?.padding).length,label:(0,ee.__)("Padding"),onDeselect:()=>I(void 0),isShownByDefault:s.padding??XP.padding,className:(0,mh.A)({"tools-panel-item-spacing":h}),panelId:o,children:[!h&&(0,Er.jsx)(fP,{__next40pxDefaultSize:!0,values:C,onChange:I,label:(0,ee.__)("Padding"),sides:S,units:p,allowReset:!1,splitOnAxis:A,inputProps:{onMouseOver:E,onMouseOut:re}}),h&&(0,Er.jsx)(SP,{values:C,onChange:I,label:(0,ee.__)("Padding"),sides:S,units:p,allowReset:!1,onMouseOver:E,onMouseOut:re})]}),j&&(0,Er.jsxs)(aC,{hasValue:()=>!!t?.spacing?.margin&&Object.keys(t?.spacing?.margin).length,label:(0,ee.__)("Margin"),onDeselect:()=>O(void 0),isShownByDefault:s.margin??XP.margin,className:(0,mh.A)({"tools-panel-item-spacing":h}),panelId:o,children:[!h&&(0,Er.jsx)(fP,{__next40pxDefaultSize:!0,values:B,onChange:O,inputProps:{min:m,onDragStart:()=>{g(0)},onDragEnd:()=>{g(f)},onMouseOver:L,onMouseOut:re},label:(0,ee.__)("Margin"),sides:N,units:p,allowReset:!1,splitOnAxis:R}),h&&(0,Er.jsx)(SP,{values:B,onChange:O,minimumCustomValue:-1/0,label:(0,ee.__)("Margin"),sides:N,units:p,allowReset:!1,onMouseOver:L,onMouseOut:re})]}),M&&(0,Er.jsxs)(aC,{hasValue:()=>!!t?.spacing?.blockGap,label:(0,ee.__)("Block spacing"),onDeselect:()=>V(void 0),isShownByDefault:s.blockGap??XP.blockGap,className:(0,mh.A)({"tools-panel-item-spacing":h,"single-column":!h&&!D}),panelId:o,children:[!h&&(D?(0,Er.jsx)(fP,{__next40pxDefaultSize:!0,label:(0,ee.__)("Block spacing"),min:0,onChange:U,units:p,sides:P,values:z,allowReset:!1,splitOnAxis:D}):(0,Er.jsx)(vx,{__next40pxDefaultSize:!0,label:(0,ee.__)("Block spacing"),min:0,onChange:V,units:p,value:F})),h&&(0,Er.jsx)(SP,{label:(0,ee.__)("Block spacing"),min:0,onChange:U,showSideInLabel:!1,sides:D?P:["top"],values:z,allowReset:!1})]}),te&&(0,Er.jsx)(BP,{value:ne,onChange:e=>{n({...t,layout:{...e}})},parentLayout:r?.parentLayout,panelId:o,isShownByDefault:s.childLayout??XP.childLayout}),$&&(0,Er.jsx)(aC,{hasValue:()=>!!t?.dimensions?.minHeight,label:(0,ee.__)("Minimum height"),onDeselect:()=>{W(void 0)},isShownByDefault:s.minHeight??XP.minHeight,panelId:o,children:(0,Er.jsx)(EP,{label:(0,ee.__)("Minimum height"),value:H,onChange:W,dimensionSizes:c?.dimensionSizes})}),G&&(0,Er.jsx)(aC,{hasValue:()=>!!t?.dimensions?.height,label:(0,ee.__)("Height"),onDeselect:()=>{K(void 0)},isShownByDefault:s.height??XP.height,panelId:o,children:(0,Er.jsx)(EP,{label:(0,ee.__)("Height"),value:q,onChange:K,dimensionSizes:c?.dimensionSizes})}),Y&&(0,Er.jsx)(aC,{hasValue:()=>!!t?.dimensions?.width,label:(0,ee.__)("Width"),onDeselect:()=>{X(void 0)},isShownByDefault:s.width??XP.width,panelId:o,children:(0,Er.jsx)(EP,{label:(0,ee.__)("Width"),value:J,onChange:X,dimensionSizes:c?.dimensionSizes})}),Z&&(0,Er.jsx)(LP,{hasValue:()=>!!t?.dimensions?.aspectRatio,value:Q,onChange:e=>{const i=_p(t,["dimensions","aspectRatio"],e);n(_p(i,["dimensions","minHeight"],void 0))},panelId:o,isShownByDefault:s.aspectRatio??XP.aspectRatio})]})}var QP=n(88502),eD=new WeakMap,tD=function(e){const t=(0,bt.A)(t=>{function n(n){const{deltaX:i,deltaY:r,target:o}=n,s=e.current;let a=eD.get(s);a||(a=(0,QP.A)(s),eD.set(s,a));const l=(0,QP.A)(o);t.contains(l)||a.scrollBy(i,r)}const i={passive:!0};return t.addEventListener("wheel",n,i),()=>{t.removeEventListener("wheel",n,i)}},[e]);return e?t:null},nD=".block-editor-block-list__block",iD=".block-list-appender",rD=".block-editor-button-block-appender";function oD(e,t){return t.closest([nD,iD,rD].join(","))===e}function sD(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(nD);return t?t.id.slice(6):void 0}function aD(e,t){const n=Math.min(e.left,t.left),i=Math.max(e.right,t.right),r=Math.max(e.bottom,t.bottom),o=Math.min(e.top,t.top);return new window.DOMRectReadOnly(n,o,i-n,r-o)}function lD(e){const t=e.ownerDocument.defaultView;if(!t)return!1;if(e.classList.contains("components-visually-hidden"))return!1;const n=e.getBoundingClientRect();if(0===n.width||0===n.height)return!1;if(e.checkVisibility)return e.checkVisibility?.({opacityProperty:!0,contentVisibilityAuto:!0,visibilityProperty:!0});const i=t.getComputedStyle(e);return"none"!==i.display&&"hidden"!==i.visibility&&"0"!==i.opacity}function cD(e){const t=window.getComputedStyle(e);return"auto"===t.overflowX||"scroll"===t.overflowX||"auto"===t.overflowY||"scroll"===t.overflowY}var uD=["core/navigation"];function dD(e){const t=e.ownerDocument.defaultView;if(!t)return new window.DOMRectReadOnly;let n=e.getBoundingClientRect();const i=e.getAttribute("data-type");if(i&&uD.includes(i)){const t=[e];let i;for(;i=t.pop();)if(!cD(i))for(const e of i.children)lD(e)&&(n=aD(n,e.getBoundingClientRect()),t.push(e))}const r=Math.max(n.left,0),o=Math.min(n.right,t.innerWidth);return n=new window.DOMRectReadOnly(r,n.top,o-r,n.height),n}var hD=Number.MAX_SAFE_INTEGER,pD=(0,T.forwardRef)(function({clientId:e,bottomClientId:t,children:n,__unstablePopoverSlot:i,__unstableContentRef:r,shift:o=!0,...s},a){const l=BO(e),c=BO(t??e),u=(0,gt.A)([a,tD(r)]),[d,h]=(0,T.useReducer)(e=>(e+1)%hD,0);(0,T.useLayoutEffect)(()=>{if(!l)return;const e=new window.MutationObserver(h);return e.observe(l,{attributes:!0}),()=>{e.disconnect()}},[l]);const p=(0,T.useMemo)(()=>{if(!(d<0||!l||t&&!c))return{getBoundingClientRect:()=>c?aD(dD(l),dD(c)):dD(l),contextElement:l}},[d,l,t,c]);return!l||t&&!c?null:(0,Er.jsx)(uw.Ay,{ref:u,animate:!1,focusOnMount:!1,anchor:p,__unstableSlotName:i,inline:!i,placement:"top-start",resize:!1,flip:!1,shift:o,...s,className:(0,mh.A)("block-editor-block-popover",s.className),variant:"unstyled",children:n})});function fD({selectedElement:e,additionalStyles:t={},children:n}){const[i,r]=(0,T.useState)(e.offsetWidth),[o,s]=(0,T.useState)(e.offsetHeight);(0,T.useEffect)(()=>{const t=new window.ResizeObserver(()=>{r(e.offsetWidth),s(e.offsetHeight)});return t.observe(e,{box:"border-box"}),()=>t.disconnect()},[e]);const a=(0,T.useMemo)(()=>({position:"absolute",width:i,height:o,...t}),[i,o,t]);return(0,Er.jsx)("div",{style:a,children:n})}(0,T.forwardRef)(({clientId:e,bottomClientId:t,children:n,...i},r)=>(0,Er.jsx)(pD,{...i,bottomClientId:t,clientId:e,__unstableContentRef:void 0,__unstablePopoverSlot:void 0,ref:r,children:n}));var mD=(0,T.forwardRef)(function({clientId:e,bottomClientId:t,children:n,shift:i=!1,additionalStyles:r,...o},s){t??=e;const a=BO(e);return(0,Er.jsx)(pD,{ref:s,clientId:e,bottomClientId:t,shift:i,...o,children:a&&e===t?(0,Er.jsx)(fD,{selectedElement:a,additionalStyles:r,children:n}):n})});function gD({clientId:e,value:t,computeStyle:n,forceShow:i}){const r=BO(e),[o,s]=(0,T.useReducer)(()=>n(r));(0,T.useEffect)(()=>{r&&i&&s()},[r,i]),(0,T.useEffect)(()=>{if(!r)return;const e=new window.MutationObserver(s);return e.observe(r,{attributes:!0,attributeFilter:["style","class"]}),()=>{e.disconnect()}},[r]);const a=(0,T.useRef)(t),[l,c]=(0,T.useState)(!1);return(0,T.useEffect)(()=>{if((0,V.hw)(t,a.current)||i)return;c(!0),a.current=t;const e=setTimeout(()=>{c(!1)},400);return()=>{c(!1),clearTimeout(e)}},[t,i]),l||i?(0,Er.jsx)(mD,{clientId:e,__unstablePopoverSlot:"block-toolbar",children:(0,Er.jsx)("div",{className:"block-editor__spacing-visualizer",style:o})}):null}function bD(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function yD({clientId:e,value:t,forceShow:n}){return(0,Er.jsx)(gD,{clientId:e,value:t?.spacing?.margin,computeStyle:e=>{const t=bD(e,"margin-top"),n=bD(e,"margin-right"),i=bD(e,"margin-bottom"),r=bD(e,"margin-left");return{borderTopWidth:t,borderRightWidth:n,borderBottomWidth:i,borderLeftWidth:r,top:t?`-${t}`:0,right:n?`-${n}`:0,bottom:i?`-${i}`:0,left:r?`-${r}`:0}},forceShow:n})}function vD({clientId:e,value:t,forceShow:n}){return(0,Er.jsx)(gD,{clientId:e,value:t?.spacing?.padding,computeStyle:e=>({borderTopWidth:bD(e,"padding-top"),borderRightWidth:bD(e,"padding-right"),borderBottomWidth:bD(e,"padding-bottom"),borderLeftWidth:bD(e,"padding-left")}),forceShow:n})}var _D="dimensions",xD="spacing";function kD({children:e,resetAllFilter:t}){const n=(0,T.useCallback)(e=>{const n=e.style,i=t(n);return{...e,style:i}},[t]);return(0,Er.jsx)(oC,{group:"dimensions",resetAllFilter:n,children:e})}function wD({clientId:e,name:t,setAttributes:n,settings:i}){const r=PP(i),o=(0,zt.A)(t=>{if(r)return t(Qy).getBlockAttributes(e)?.style},[e,r]),[s,a]=function(){const[e,t]=(0,T.useState)(!1),{hideBlockInterface:n,showBlockInterface:i}=Gh((0,Vt.A)(Qy));return(0,T.useEffect)(()=>{e?n():i()},[e,i,n]),[e,t]}();if(!r)return null;const l={...vn(t,[_D,"__experimentalDefaultControls"]),...vn(t,[xD,"__experimentalDefaultControls"])};return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(ZP,{as:kD,panelId:e,settings:i,value:o,onChange:e=>{n({style:ov(e)})},defaultControls:l,onVisualize:a}),!!i?.spacing?.padding&&"padding"===s&&(0,Er.jsx)(vD,{forceShow:"padding"===s,clientId:e,value:o}),!!i?.spacing?.margin&&"margin"===s&&(0,Er.jsx)(yD,{forceShow:"margin"===s,clientId:e,value:o})]})}function CD(e,t="any"){if("web"!==Uo.A.OS)return!1;const n=vn(e,_D);return!0===n||("any"===t?!!(n?.aspectRatio||n?.height||n?.minHeight||n?.width):!!n?.[t])}var SD={useBlockProps:function({name:e,height:t,minHeight:n,style:i}){if(!CD(e,"aspectRatio")||av(e,_D,"aspectRatio"))return{};const r=(0,mh.A)({"has-aspect-ratio":!!i?.dimensions?.aspectRatio}),o={};return i?.dimensions?.aspectRatio?(o.minHeight="unset",o.height="unset"):(n||i?.dimensions?.minHeight||t||i?.dimensions?.height)&&(o.aspectRatio="unset"),{className:r,style:o}},attributeKeys:["height","minHeight","width","style"],hasSupport:e=>CD(e)},AD=[...BM,cO,MO,_D,QE,xD,uO],ID=e=>AD.some(t=>_n(e,t));function ED(e={}){const t={};return dk(e).forEach(e=>{t[e.key]=e.value}),t}var jD={[`${cO}.__experimentalSkipSerialization`]:["border"],[`${MO}.__experimentalSkipSerialization`]:[MO],[`${TM}.__experimentalSkipSerialization`]:[TM],[`${_D}.__experimentalSkipSerialization`]:[_D],[`${xD}.__experimentalSkipSerialization`]:[xD],[`${uO}.__experimentalSkipSerialization`]:[uO]},TD={...jD,[`${_D}.aspectRatio`]:[`${_D}.aspectRatio`],[`${QE}`]:[QE]},BD={[`${_D}.aspectRatio`]:!0,[`${QE}`]:!0},ND={gradients:"gradient"};function RD(e,t,n=!1){if(!e)return e;let i=e;return n||(i=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;RD(i[t],[n],!0)}else 1===e.length&&delete i[e[0]]}),i}function OD(e,t,n,i=TD){if(!ID(t))return e;let{style:r}=n;return Object.entries(i).forEach(([e,n])=>{const i=BD[e]||vn(t,e);!0===i&&(r=RD(r,n)),Array.isArray(i)&&i.forEach(e=>{const t=ND[e]||e;r=RD(r,[[...n,t]])})}),e.style={...ED(r),...e.style},e}var LD={edit:function({clientId:e,name:t,setAttributes:n,__unstableParentLayout:i}){const r=dv(t,i),o=Vk(),s={clientId:e,name:t,setAttributes:n,settings:{...r,typography:{...r.typography,textAlign:!1}}};return"default"!==o?null:(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(GO,{...s}),(0,Er.jsx)(oj,{...s}),(0,Er.jsx)(LM,{...s}),(0,Er.jsx)(bO,{...s}),(0,Er.jsx)(wD,{...s})]})},hasSupport:ID,addSaveProps:OD,attributeKeys:["style"],useBlockProps:function({name:e,style:t}){const n=(0,SS.A)(PD,"wp-elements"),i=`.${n}`,r=t?.elements,o=(0,T.useMemo)(()=>function(e,t,n){if(!e)return;const i=[];return MD.forEach(({elementType:r,pseudo:o,elements:s})=>{if(av(t,MO,r))return;const a=e?.[r];if(a){const e=Qw(n,rn[r]);i.push(uk(a,{selector:e})),o&&o.forEach(e=>{a[e]&&i.push(uk(a[e],{selector:Qw(n,`${rn[r]}${e}`)}))})}s&&s.forEach(t=>{e[t]&&i.push(uk(e[t],{selector:Qw(n,rn[t])}))})}),i.length>0?i.join(""):void 0}(r,e,i),[i,r,e]);return cv({css:o}),OD({className:n},e,{style:t},jD)}},MD=[{elementType:"button"},{elementType:"link",pseudo:[":hover"]},{elementType:"heading",elements:["h1","h2","h3","h4","h5","h6"]}],PD={};(0,Ei.U2)("blocks.registerBlockType","core/style/addAttribute",function(e){return ID(e)||_n(e,"customCSS",!0)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e}),(0,Ei.U2)("blocks.registerBlockType","core/settings/addAttribute",function(e){return _n(e,"__experimentalSettings",!1)?(e?.attributes?.settings||(e.attributes={...e.attributes,settings:{type:"object"}}),e):e});var DD=n(709);function FD(e=[],t="90deg"){const n=100/e.length,i=e.map((e,t)=>`${e} ${t*n}%, ${e} ${(t+1)*n}%`).join(", ");return`linear-gradient( ${t}, ${i} )`}(0,te.X$)([ne.A]);var zD=function({values:e}){return e?(0,Er.jsx)(CI.A,{colorValue:FD(e,"135deg")}):(0,Er.jsx)(IC.A,{icon:DD.A})};function VD({label:e,value:t,colors:n,disableCustomColors:i,enableAlpha:r,onChange:o}){const[s,a]=(0,T.useState)(!1),l=(0,SS.A)(VD,"color-list-picker-option"),c=`${l}__label`,u=`${l}__content`;return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,className:"components-color-list-picker__swatch-button",id:c,onClick:()=>a(e=>!e),"aria-expanded":s,"aria-controls":u,icon:t?(0,Er.jsx)(CI.A,{colorValue:t,className:"components-color-list-picker__swatch-color"}):(0,Er.jsx)(IC.A,{icon:DD.A}),text:e}),(0,Er.jsx)("div",{role:"group",id:u,"aria-labelledby":c,"aria-hidden":!s,children:s&&(0,Er.jsx)(UI,{"aria-label":(0,ee.__)("Color options"),className:"components-color-list-picker__color-picker",colors:n,value:t,clearable:!1,onChange:o,disableCustomColors:i,enableAlpha:r})})]})}var UD=function({colors:e,labels:t,value:n=[],disableCustomColors:i,enableAlpha:r,onChange:o}){return(0,Er.jsx)("div",{className:"components-color-list-picker",children:t.map((t,s)=>(0,Er.jsx)(VD,{label:t,value:n[s],colors:e,disableCustomColors:i,enableAlpha:r,onChange:e=>{const t=n.slice();t[s]=e,o(t)}},s))})},$D=["#333","#CCC"];function HD({value:e,onChange:t}){const n=!!e,i=n?e:$D,r=FD(i),o=(s=i).map((e,t)=>({position:100*t/(s.length-1),color:e}));var s;return(0,Er.jsx)(rE,{disableInserter:!0,background:r,hasGradient:n,value:o,onChange:e=>{const n=function(e=[]){return e.map(({color:e})=>e)}(e);t(n)}})}var WD=function({asButtons:e,loop:t,clearable:n=!0,unsetable:i=!0,colorPalette:r,duotonePalette:o,disableCustomColors:s,disableCustomDuotone:a,value:l,onChange:c,"aria-label":u,"aria-labelledby":d,...h}){const[p,f]=(0,T.useMemo)(()=>{return!(e=r)||e.length<2?["#000","#fff"]:e.map(({color:e})=>({color:e,brightness:(0,te.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},[r]),m="unset"===l,g=(0,ee.__)("Unset"),b=(0,Er.jsx)(RI.Option,{value:"unset",isSelected:m,tooltipText:g,"aria-label":g,className:"components-duotone-picker__color-indicator",onClick:()=>{c(m?void 0:"unset")}},"unset"),y=o.map(({colors:e,slug:t,name:n})=>{const i={background:FD(e,"135deg"),color:"transparent"},r=n??(0,ee.sprintf)((0,ee.__)("Duotone code: %s"),t),o=n?(0,ee.sprintf)((0,ee.__)("Duotone: %s"),n):r,s=F(e,l);return(0,Er.jsx)(RI.Option,{value:e,isSelected:s,"aria-label":o,tooltipText:r,style:i,onClick:()=>{c(s?void 0:e)}},t)}),{metaProps:v,labelProps:_}=OI(e,t,u,d),x=i?[b,...y]:y;return(0,Er.jsx)(RI,{...h,...v,..._,options:x,actions:!!n&&(0,Er.jsx)(RI.ButtonAction,{onClick:()=>c(void 0),accessibleWhenDisabled:!0,disabled:!l,children:(0,ee.__)("Clear")}),children:(0,Er.jsx)($I.A,{paddingTop:0===x.length?0:4,children:(0,Er.jsxs)(Q_.A,{spacing:3,children:[!s&&!a&&(0,Er.jsx)(HD,{value:m?void 0:l,onChange:c}),!a&&(0,Er.jsx)(UD,{labels:[(0,ee.__)("Shadows"),(0,ee.__)("Highlights")],colors:r,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)}})]})})})},GD=n(7723),qD=function e({id:t,colorPalette:n,duotonePalette:i,disableCustomColors:r,disableCustomDuotone:o,value:s,onChange:a}){let l;l="unset"===s?(0,Er.jsx)(CI.A,{className:"block-editor-duotone-control__unset-indicator"}):s?(0,Er.jsx)(zD,{values:s}):(0,Er.jsx)(xx.A,{icon:GD.A});const c=(0,ee.__)("Apply duotone filter"),u=`${(0,SS.A)(e,"duotone-control",t)}__description`;return(0,Er.jsx)(wC.A,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,ee.__)("Duotone")},renderToggle:({isOpen:e,onToggle:t})=>(0,Er.jsx)(vv,{showTooltip:!0,onClick:t,"aria-haspopup":"true","aria-expanded":e,onKeyDown:n=>{e||n.keyCode!==Rt.PX||(n.preventDefault(),t())},label:c,icon:l}),renderContent:()=>(0,Er.jsxs)(Fv.A,{label:(0,ee.__)("Duotone"),children:[(0,Er.jsx)("p",{children:(0,ee.__)("Create a two-tone color effect without losing your original image.")}),(0,Er.jsx)(WD,{"aria-label":c,"aria-describedby":u,colorPalette:n,duotonePalette:i,disableCustomColors:r,disableCustomDuotone:o,value:s,onChange:a})]})})};function KD(e){return`${e}{filter:none}`}function YD(e,t){return`${e}{filter:url(#${t})}`}function JD(e,t){const n=function(e=[]){const t={r:[],g:[],b:[],a:[]};return e.forEach(e=>{const n=(0,te.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<svg\n\txmlns:xlink="http://www.w3.org/1999/xlink"\n\tviewBox="0 0 0 0"\n\twidth="0"\n\theight="0"\n\tfocusable="false"\n\trole="none"\n\taria-hidden="true"\n\tstyle="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;"\n>\n\t<defs>\n\t\t<filter id="${e}">\n\t\t\t\x3c!--\n\t\t\t\tUse sRGB instead of linearRGB so transparency looks correct.\n\t\t\t\tUse perceptual brightness to convert to grayscale.\n\t\t\t--\x3e\n\t\t\t<feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "></feColorMatrix>\n\t\t\t\x3c!-- Use sRGB instead of linearRGB to be consistent with how CSS gradients work. --\x3e\n\t\t\t<feComponentTransfer color-interpolation-filters="sRGB">\n\t\t\t\t<feFuncR type="table" tableValues="${n.r.join(" ")}"></feFuncR>\n\t\t\t\t<feFuncG type="table" tableValues="${n.g.join(" ")}"></feFuncG>\n\t\t\t\t<feFuncB type="table" tableValues="${n.b.join(" ")}"></feFuncB>\n\t\t\t\t<feFuncA type="table" tableValues="${n.a.join(" ")}"></feFuncA>\n\t\t\t</feComponentTransfer>\n\t\t\t\x3c!-- Re-mask the image with the original transparency since the feColorMatrix above loses that information. --\x3e\n\t\t\t<feComposite in2="SourceGraphic" operator="in"></feComposite>\n\t\t</filter>\n\t</defs>\n</svg>`}var XD=[];function ZD(e,{presetSetting:t,defaultSetting:n}){const i=!e?.color?.[n],r=e?.color?.[t]?.custom||XD,o=e?.color?.[t]?.theme||XD,s=e?.color?.[t]?.default||XD;return(0,T.useMemo)(()=>[...r,...o,...i?XD:s],[i,r,o,s])}function QD(e){return eF(e)}function eF(e){return e.color.customDuotone||e.color.defaultDuotone||e.color.duotone.length>0}function tF({resetAllFilter:e,onChange:t,value:n,panelId:i,children:r}){const o=Zw();return(0,Er.jsx)(Xw,{label:(0,ee._x)("Filters","Name for applying graphical effects"),resetAll:()=>{const i=e(n);t(i)},panelId:i,dropdownMenuProps:o,children:r})}var nF={duotone:!0},iF={placement:"left-start",offset:36,shift:!0,className:"block-editor-duotone-control__popover",headerTitle:(0,ee.__)("Duotone")},rF=({indicator:e,label:t})=>(0,Er.jsxs)(Cw.A,{justify:"flex-start",children:[(0,Er.jsx)(wI,{isLayered:!1,offset:-8,children:(0,Er.jsx)(Kv.A,{expanded:!1,children:"unset"!==e&&e?(0,Er.jsx)(zD,{values:e}):(0,Er.jsx)(CI.A,{className:"block-editor-duotone-control__unset-indicator"})})}),(0,Er.jsx)(Yv.A,{title:t,children:t})]}),oF=(e,t)=>function({onToggle:n,isOpen:i}){const r=(0,T.useRef)(void 0),o={onClick:n,className:(0,mh.A)("block-editor-global-styles-filters-panel__dropdown-toggle",{"is-open":i}),"aria-expanded":i,ref:r},s={onClick:()=>{i&&n(),t(),r.current?.focus()},className:"block-editor-panel-duotone-settings__reset",label:(0,ee.__)("Reset")};return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,...o,children:(0,Er.jsx)(rF,{indicator:e,label:(0,ee.__)("Duotone")})}),e&&(0,Er.jsx)(fv.Ay,{size:"small",icon:uS.A,...s})]})};function sF({as:e=tF,value:t,onChange:n,inheritedValue:i=t,settings:r,panelId:o,defaultControls:s=nF}){const a=eF(r),l=ZD(r,{presetSetting:"duotone",defaultSetting:"defaultDuotone"}),c=ZD(r,{presetSetting:"palette",defaultSetting:"defaultPalette"}),u=(d=i?.filter?.duotone,vC({settings:r},"",d));var d;const h=e=>{const i=l.find(({colors:t})=>t===e),r=i?`var:preset|duotone|${i.slug}`:e;n(_p(t,["filter","duotone"],r))},p=()=>h(void 0),f=(0,T.useCallback)(e=>({...e,filter:{...e.filter,duotone:void 0}}),[]);return(0,Er.jsx)(e,{resetAllFilter:f,value:t,onChange:n,panelId:o,children:a&&(0,Er.jsx)(aC,{label:(0,ee.__)("Duotone"),hasValue:()=>!!t?.filter?.duotone,onDeselect:p,isShownByDefault:s.duotone,panelId:o,children:(0,Er.jsx)(wC.A,{popoverProps:iF,className:"block-editor-global-styles-filters-panel__dropdown",renderToggle:oF(u,p),renderContent:()=>(0,Er.jsx)(CC.A,{paddingSize:"small",children:(0,Er.jsxs)(Fv.A,{label:(0,ee.__)("Duotone"),children:[(0,Er.jsx)("p",{children:(0,ee.__)("Create a two-tone color effect without losing your original image.")}),(0,Er.jsx)(WD,{colorPalette:c,duotonePalette:l,disableCustomColors:!0,disableCustomDuotone:!0,value:u,onChange:h})]})})})})})}var aF=[],lF=window?.navigator.userAgent&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&!window.navigator.userAgent.includes("Chromium");function cF({presetSetting:e,defaultSetting:t}){const[n,i,r,o]=tv(t,`${e}.custom`,`${e}.theme`,`${e}.default`);return(0,T.useMemo)(()=>[...i||aF,...r||aF,...n&&o||aF],[n,i,r,o])}function uF(e,t){if(!e)return;const n=t?.find(({slug:t})=>e===`var:preset|duotone|${t}`);return n?n.colors:void 0}(0,te.X$)([ne.A]);var dF={shareWithChildBlocks:!0,edit:function({style:e,setAttributes:t,name:n}){const i=e?.color?.duotone,r=dv(n),o=Vk(),s=cF({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=cF({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),[l,c]=tv("color.custom","color.customDuotone"),u=!l,d=!c||0===a?.length&&u;if(0===s?.length&&d)return null;if("default"!==o)return null;const h="unset"===i||Array.isArray(i)?i:uF(i,s);return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(oC,{group:"filter",children:(0,Er.jsx)(sF,{value:{filter:{duotone:h}},onChange:n=>{const i={...e,color:{...n?.filter}};t({style:ov(i)})},settings:r})}),(0,Er.jsx)(Mv,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,Er.jsx)(qD,{duotonePalette:s,colorPalette:a,disableCustomDuotone:d,disableCustomColors:u,value:h,onChange:n=>{const i=function(e,t){if(!e||!Array.isArray(e))return;const n=t?.find(t=>t?.colors?.every((t,n)=>t===e[n]));return n?`var:preset|duotone|${n.slug}`:void 0}(n,s),r={...e,color:{...e?.color,duotone:i??n}};t({style:ov(r)})},settings:r})})]})},useBlockProps:function({clientId:e,name:t,style:n}){const i=(0,SS.A)(hF),r=(0,T.useMemo)(()=>{const e=bn(t);if(e){if(!vn(e,"filter.duotone",!1))return null;const t=vn(e,"color.__experimentalDuotone",!1);if(t){const n=wO(e);return"string"==typeof t?Qw(n,t):n}return wO(e,"filter.duotone",{fallback:!0})}},[t]),o=n?.color?.duotone,s=`wp-duotone-${i}`,a=r&&o;return function({clientId:e,id:t,selector:n,attribute:i}){const r=cF({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),o=Array.isArray(i),s=o?void 0:uF(i,r),a="string"==typeof i&&s;let l=null;a?l=s:("string"==typeof i&&!a||o)&&(l=i);const c=n.split(",").map(e=>`.${t}${e.trim()}`).join(", "),u=Array.isArray(l)||"unset"===l;uv(u?{css:"unset"!==l?YD(c,t):KD(c),__unstableType:"presets"}:void 0),uv(u?{assets:"unset"!==l?JD(t,l):"",__unstableType:"svgs"}:void 0);const d=BO(e);(0,T.useEffect)(()=>{if(u&&d&&lF){const e=d.style.display;d.style.setProperty("display","inline-block"),d.offsetHeight,d.style.setProperty("display",e)}},[u,d,l])}({clientId:e,id:s,selector:r,attribute:o}),{className:a?s:""}},attributeKeys:["style"],hasSupport:e=>_n(e,"filter.duotone")};var hF={};function pF(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/([0-9])([a-zA-Z])/g,"$1-$2").replace(/([a-zA-Z])([0-9])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function fF(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function mF(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 i=fF(n?.top)||t,r=fF(n?.left)||t;return i===r?i:`${i} ${r}`}(0,Ei.U2)("blocks.registerBlockType","core/editor/duotone/add-attributes",function(e){return _n(e,"filter.duotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e});function gF(e){if(!e||!e?.backgroundImage?.url)return;let t;return e?.backgroundSize||(t={backgroundSize:"cover"}),"contain"!==e?.backgroundSize||e?.backgroundPosition||(t={backgroundPosition:"50% 50%"}),t}var bF={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}}]}},yF={button:"wp-element-button",caption:"wp-element-caption"},vF={__experimentalBorder:"border",color:"color",dimensions:"dimensions",spacing:"spacing",typography:"typography"},_F=(e,t,n)=>{if("core/paragraph"!==n)return e;const i=t?.blocks?.["core/paragraph"];if("all"!==(i?.typography?.textIndent??t?.typography?.textIndent??"subsequent"))return e;const r=".wp-block-paragraph + .wp-block-paragraph";if(r in e){const t=e[r],n={...e};return delete n[r],n[".wp-block-paragraph"]=t,n}return e},xF=(e,t)=>{const n=".wp-block-button";if(!(n in e))return e;const i={...e};return i[n]=i[n].map(e=>{const n=e.match(/^width:\s*(.+)$/);if(!n)return e;const i=n[1];let r=null;i.endsWith("%")&&(r=parseFloat(i));if(null===r&&i.startsWith("var(--wp--preset--dimension--")&&i.endsWith(")")){const e=i.slice(29,-1),n={...t?.dimensions?.dimensionSizes??{},...t?.blocks?.["core/button"]?.dimensions?.dimensionSizes??{}};for(const t of Object.values(n))if(Array.isArray(t)){for(const n of t)if(n.slug===e&&"string"==typeof n.size&&n.size.endsWith("%")){r=parseFloat(n.size);break}if(null!==r)break}}return null===r||isNaN(r)?e:`width: calc(${r} * 1% - (var(--wp--style--block-gap, 0.5em) * (1 - ${r} / 100)))`}),i},kF=(e,t)=>{const n={};return Object.entries(e).forEach(([e,i])=>{if("root"===e||!t?.[e])return;const r="string"==typeof i;if(r||"object"!=typeof i||null===i||Object.entries(i).forEach(([i,r])=>{if("root"===i||!t?.[e][i])return;const o=wF({[e]:{[i]:t[e][i]}});n[r]=[...n[r]||[],...o],delete t[e][i]}),r||"object"==typeof i&&null!==i&&"root"in i){const o=r?i:i.root,s=wF({[e]:t[e]});n[o]=[...n[o]||[],...s],delete t[e]}}),n};function wF(e={},t="",n,i={},r=!1){const o=pC===t,s=Object.entries(nn).reduce((t,[i,{value:r,properties:s,useEngine:a,rootOnly:l}])=>{if(l&&!o)return t;const c=r;if("elements"===c[0]||a)return t;const u=hC(e,c);if("--wp--style--root--padding"===i&&("string"==typeof u||!n))return t;if(s&&"string"!=typeof u)Object.entries(s).forEach(e=>{const[n,i]=e;if(!hC(u,[i],!1))return;const r=n.startsWith("--")?n:pF(n);t.push(`${r}: ${Ex(hC(u,[i]))}`)});else if(hC(e,c,!1)){const n=i.startsWith("--")?i:pF(i);t.push(`${n}: ${Ex(hC(e,c))}`)}return t},[]);return e.background&&(e.background?.backgroundImage&&(e.background.backgroundImage=bC(e.background.backgroundImage,i)),!o&&e.background?.backgroundImage?.id&&(e={...e,background:{...e.background,...gF(e.background)}})),dk(e).forEach(e=>{if(o&&(n||r)&&e.key.startsWith("padding"))return;const t=e.key.startsWith("--")?e.key:pF(e.key);let a=bC(e.value,i);"font-size"===t&&(a=dC({name:"",slug:"",size:a},i?.settings)),"aspect-ratio"===t&&s.push("min-height: unset"),s.push(`${t}: ${a}`)}),s}function CF({layoutDefinitions:e=bF,style:t,selector:n,hasBlockGapSupport:i,hasFallbackGapSupport:r,fallbackGapValue:o}){let s="",a=i?mF(t?.spacing?.blockGap):"";if(r&&(n===pC?a=a||"0.5em":!i&&o&&(a=o)),a&&e&&(Object.values(e).forEach(({className:e,name:t,spacingStyles:r})=>{(i||"flex"===t||"grid"===t)&&r?.length&&r.forEach(t=>{const r=[];if(t.rules&&Object.entries(t.rules).forEach(([e,t])=>{r.push(`${e}: ${t||a}`)}),r.length){let o="";o=i?n===pC?`:root :where(.${e})${t?.selector||""}`:`:root :where(${n}-${e})${t?.selector||""}`:n===pC?`:where(.${e}${t?.selector||""})`:`:where(${n}.${e}${t?.selector||""})`,s+=`${o} { ${r.join("; ")}; }`}})}),n===pC&&i&&(s+=`${fC} { --wp--style--block-gap: ${a}; }`)),n===pC&&e){const t=["block","flex","grid"];Object.values(e).forEach(({className:e,displayMode:i,baseStyles:r})=>{i&&t.includes(i)&&(s+=`${n} .${e} { display:${i}; }`),r?.length&&r.forEach(t=>{const n=[];t.rules&&Object.entries(t.rules).forEach(([e,t])=>{n.push(`${e}: ${t}`)}),n.length&&(s+=`.${e}${t?.selector||""} { ${n.join("; ")}; }`)})})}return s}var SF=["border","color","dimensions","spacing","typography","filter","outline","shadow","background"];function AF(e){if(!e)return{};const t=Object.entries(e).filter(([e])=>SF.includes(e)).map(([e,t])=>[e,JSON.parse(JSON.stringify(t))]);return Object.fromEntries(t)}var IF=(e,t,n,i,r=!1,o=!1,s={})=>{const a={blockGap:!0,blockStyles:!0,layoutStyles:!0,marginReset:!0,presets:!0,rootPadding:!0,variationStyles:!1,...s},l=((e,t)=>{const n=[];if(!e?.styles)return n;const i=AF(e.styles);return i&&n.push({styles:i,selector:pC,skipSelectorWrapper:!0}),Object.entries(rn).forEach(([t,i])=>{e.styles?.elements?.[t]&&n.push({styles:e.styles?.elements?.[t]??{},selector:i,skipSelectorWrapper:!yF[t]})}),Object.entries(e.styles?.blocks??{}).forEach(([e,i])=>{const r=AF(i),o=i,s=[];if(o?.variations){const n={};Object.entries(o.variations).forEach(([i,r])=>{const o=r;n[i]=AF(o),o?.css&&(n[i].css=o.css);const a="string"!=typeof t?t[e]?.styleVariationSelectors?.[i]:void 0;Object.entries(o?.elements??{}).forEach(([e,t])=>{t&&rn[e]&&s.push({styles:t,selector:gC(a,rn[e])})}),Object.entries(o?.blocks??{}).forEach(([e,n])=>{const i="string"!=typeof t?gC(a,t[e]?.selector):void 0,r="string"!=typeof t?gC(a,t[e]?.duotoneSelector):void 0,o="string"!=typeof t?function(e,t){if(!e||!t)return;const n={};return Object.entries(t).forEach(([t,i])=>{"string"==typeof i&&(n[t]=gC(e,i)),"object"==typeof i&&(n[t]={},Object.entries(i).forEach(([i,r])=>{n[t][i]=gC(e,r)}))}),n}(a,t[e]?.featureSelectors??{}):void 0,l=AF(n);n?.css&&(l.css=n.css),i&&"string"!=typeof t&&(s.push({selector:i,duotoneSelector:r,featureSelectors:o,fallbackGapValue:t[e]?.fallbackGapValue,hasLayoutSupport:t[e]?.hasLayoutSupport,styles:l}),Object.entries(n.elements??{}).forEach(([e,t])=>{t&&rn[e]&&s.push({styles:t,selector:gC(i,rn[e])})}))})}),r.variations=n}"string"!=typeof t&&t?.[e]?.selector&&n.push({duotoneSelector:t[e].duotoneSelector,fallbackGapValue:t[e].fallbackGapValue,hasLayoutSupport:t[e].hasLayoutSupport,selector:t[e].selector,styles:r,featureSelectors:t[e].featureSelectors,styleVariationSelectors:t[e].styleVariationSelectors,name:e}),Object.entries(o?.elements??{}).forEach(([i,r])=>{"string"!=typeof t&&r&&t?.[e]&&rn[i]&&n.push({styles:r,selector:t[e]?.selector.split(",").map(e=>rn[i].split(",").map(t=>e+" "+t)).join(",")})}),n.push(...s)}),n})(e,t),c=((e,t)=>{const n=[];if(!e?.settings)return n;const i=e=>{let t={};return mC.forEach(({path:n})=>{const i=hC(e,n,!1);!1!==i&&(t=function(e,t,n){t=Array.isArray(t)?[...t]:[t],e=Array.isArray(e)?[...e]:{...e};const i=t.pop();let r=e;for(const e of t){const t=r[e];r=r[e]=Array.isArray(t)?[...t]:{...t}}return r[i]=n,e}(t,n,i))}),t},r=i(e.settings),o=e.settings?.custom;return(Object.keys(r).length>0||o)&&n.push({presets:r,custom:o,selector:fC}),Object.entries(e.settings?.blocks??{}).forEach(([e,r])=>{const o=r.custom;if("string"==typeof t||!t[e])return;const s=i(r);(Object.keys(s).length>0||o)&&n.push({presets:s,custom:o,selector:t[e]?.selector,featureSelectors:t[e]?.featureSelectors})}),n})(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+=`${fC} {`,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(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) { padding-right: 0; padding-left: 0; }\n\t\t\t\t.has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) > .alignfull { margin-left: 0; margin-right: 0;\n\t\t\t\t"),f+="}"),a.blockStyles&&l.forEach(({selector:t,duotoneSelector:s,styles:l,fallbackGapValue:c,hasLayoutSupport:d,featureSelectors:h,styleVariationSelectors:p,skipSelectorWrapper:m,name:g})=>{if(h){let t=kF(h,l);t=_F(t,e.settings,g),t=xF(t,e.settings),Object.entries(t).forEach(([e,t])=>{if(t.length){const n=t.join(";");f+=`:root :where(${e}){${n};}`}})}if(s){const e={};l?.filter&&(e.filter=l.filter,delete l.filter);const t=wF(e);t.length&&(f+=`${s}{${t.join(";")};}`)}r||pC!==t&&!d||(f+=CF({style:l,selector:t,hasBlockGapSupport:n,hasFallbackGapSupport:i,fallbackGapValue:c}));const b=wF(l,t,u,e,o);b?.length&&(f+=`${m?t:`:root :where(${t})`}{${b.join(";")};}`),l?.css&&(f+=jF(l.css,`:root :where(${t})`)),a.variationStyles&&p&&Object.entries(p).forEach(([n,r])=>{const o=l?.variations?.[n];if(o){if(h){let t=kF(h,o);t=_F(t,e.settings,g),t=xF(t,e.settings),Object.entries(t).forEach(([e,t])=>{if(t.length){const n=function(e,t){const n=e.split(","),i=[];return n.forEach(e=>{i.push(`${t.trim()}${e.trim()}`)}),i.join(", ")}(e,r),i=t.join(";");f+=`:root :where(${n}){${i};}`}})}const n=wF(o,r,u,e);n.length&&(f+=`:root :where(${r}){${n.join(";")};}`),o?.css&&(f+=jF(o.css,`:root :where(${r})`)),d&&o?.spacing?.blockGap&&(f+=CF({style:o,selector:r+t,hasBlockGapSupport:!0,hasFallbackGapSupport:i,fallbackGapValue:c}))}});const y=Object.entries(l).filter(([e])=>e.startsWith(":"));y?.length&&y.forEach(([e,n])=>{const i=wF(n);if(!i?.length)return;const r=`:root :where(${t.split(",").map(t=>t+e).join(",")}){${i.join(";")};}`;f+=r})}),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=mF(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})=>{pC!==e&&fC!==e||(e="");const n=function(e="*",t={}){return mC.reduce((n,{path:i,cssVarInfix:r,classes:o})=>{if(!o)return n;const s=hC(t,i,[]);return["default","theme","custom"].forEach(t=>{s[t]&&s[t].forEach(({slug:t})=>{o.forEach(({classSuffix:i,propertyName:o})=>{const s=`.has-${pF(t)}-${i}`,a=e.split(",").map(e=>`${e}${s}`).join(","),l=`var(--wp--preset--${r}--${pF(t)})`;n+=`${a}{${o}: ${l} !important;}`})})}),n},"")}(e,t);n.length>0&&(f+=n)}),f},EF=(e,t)=>{const{getBlockStyles:n}=(0,xe.L)(Zi),i={};return e.forEach(e=>{const r=e.name,o=wO(e);if(!o)return;let s=wO(e,"filter.duotone");if(!s){const t=wO(e),n=vn(e,"color.__experimentalDuotone",!1);"string"==typeof n&&t&&(s=gC(t,n))}const a=!!e?.supports?.layout||!!e?.supports?.__experimentalLayout,l=e?.supports?.spacing?.blockGap?.__experimentalDefault,c=n(r),u={};c?.forEach(e=>{const n=t?`-${t}`:"",i=`${e.name}${n}`,r=function(e,t){const n=`.is-style-${e}`;if(!t)return n;const i=/((?::\([^)]+\))?\s*)([^\s:]+)/,r=(e,t,i)=>t+i+n;return t.split(",").map(e=>e.replace(i,r)).join(",")}(i,o);u[i]=r});const d=((e,t)=>{if(e?.selectors&&Object.keys(e.selectors).length>0)return e.selectors;const n={root:t};return Object.entries(vF).forEach(([t,i])=>{const r=wO(e,t);r&&(n[i]=r)}),n})(e,o);i[r]={duotoneSelector:s??void 0,fallbackGapValue:l,featureSelectors:Object.keys(d).length?d:void 0,hasLayoutSupport:a,name:r,selector:o,styleVariationSelectors:c?.length?u:void 0}}),i};function jF(e,t){let n="";return e&&""!==e.trim()?(e.split("&").forEach(e=>{if(e&&""!==e.trim())if(e.includes("{")){const i=e.replace("}","").split("{");if(2!==i.length)return;const[r,o]=i,s=r.match(/([>+~\s]*::[a-zA-Z-]+)/),a=s?s[1]:"",l=s?r.replace(a,"").trim():r.trim();let c;c=""===l?t:r.startsWith(" ")?gC(t,l):function(e,t){return e.includes(",")?e.split(",").map(e=>e+t).join(","):e+t}(t,l),n+=`:root :where(${c})${a}{${o.trim()}}`}else n+=`:root :where(${t}){${e.trim()}}`}),n):n}var TF=n(75828);const BF={attribute:/\[\s*(?:(?<namespace>\*|[-\w\P{ASCII}]*)\|)?(?<name>[-\w\P{ASCII}]+)\s*(?:(?<operator>\W?=)\s*(?<value>.+?)\s*(\s(?<caseSensitive>[iIsS]))?\s*)?\]/gu,id:/#(?<name>[-\w\P{ASCII}]+)/gu,class:/\.(?<name>[-\w\P{ASCII}]+)/gu,comma:/\s*,\s*/g,combinator:/\s*[\s>+~]\s*/g,"pseudo-element":/::(?<name>[-\w\P{ASCII}]+)(?:\((?<argument>¶*)\))?/gu,"pseudo-class":/:(?<name>[-\w\P{ASCII}]+)(?:\((?<argument>¶*)\))?/gu,universal:/(?:(?<namespace>\*|[-\w\P{ASCII}]*)\|)?\*/gu,type:/(?:(?<namespace>\*|[-\w\P{ASCII}]*)\|)?(?<name>[-\w\P{ASCII}]+)/gu},NF=new Set(["combinator","comma"]),RF=(new Set(["not","is","where","has","matches","-moz-any","-webkit-any","nth-child","nth-last-child"]),e=>{switch(e){case"pseudo-element":case"pseudo-class":return new RegExp(BF[e].source.replace("(?<argument>¶*)","(?<argument>.*)"),"gu");default:return BF[e]}});function OF(e,t){let n=0,i="";for(;t<e.length;t++){const r=e[t];switch(r){case"(":++n;break;case")":--n}if(i+=r,0===n)return i}return i}const LF=/(['"])([^\\\n]*?)\1/g,MF=/\\./g;function PF(e,t=BF){if(""===(e=e.trim()))return[];const n=[];e=e.replace(MF,(e,t)=>(n.push({value:e,offset:t}),"".repeat(e.length))),e=e.replace(LF,(e,t,i,r)=>(n.push({value:e,offset:r}),`${t}${"".repeat(i.length)}${t}`));{let t,i=0;for(;(t=e.indexOf("(",i))>-1;){const r=OF(e,t);n.push({value:r,offset:t}),e=`${e.substring(0,t)}(${"¶".repeat(r.length-2)})${e.substring(t+r.length)}`,i=t+r.length}}const i=function(e,t=BF){if(!e)return[];const n=[e];for(const[e,i]of Object.entries(t))for(let t=0;t<n.length;t++){const r=n[t];if("string"!=typeof r)continue;i.lastIndex=0;const o=i.exec(r);if(!o)continue;const s=o.index-1,a=[],l=o[0],c=r.slice(0,s+1);c&&a.push(c),a.push({...o.groups,type:e,content:l});const u=r.slice(s+l.length+1);u&&a.push(u),n.splice(t,1,...a)}let i=0;for(const e of n)switch(typeof e){case"string":throw new Error(`Unexpected sequence ${e} found at index ${i}`);case"object":i+=e.content.length,e.pos=[i-e.content.length,i],NF.has(e.type)&&(e.content=e.content.trim()||" ")}return n}(e,t),r=new Set;for(const e of n.reverse())for(const t of i){const{offset:n,value:i}=e;if(!(t.pos[0]<=n&&n+i.length<=t.pos[1]))continue;const{content:o}=t,s=n-t.pos[0];t.content=o.slice(0,s)+i+o.slice(s+i.length),t.content!==o&&r.add(t)}for(const e of r){const t=RF(e.type);if(!t)throw new Error(`Unknown token type: ${e.type}`);t.lastIndex=0;const n=t.exec(e.content);if(!n)throw new Error(`Unable to parse content for ${e.type}: ${e.content}`);Object.assign(e,n.groups)}return i}function DF(e){if(Array.isArray(e))return e.map(e=>e.content).join("");switch(e.type){case"list":return e.list.map(DF).join(",");case"relative":return e.combinator+DF(e.right);case"complex":return DF(e.left)+e.combinator+DF(e.right);case"compound":return e.list.map(DF).join("");default:return e.content}}var FF=n(81951),zF=n(19737),VF=n(96242),UF=n(14686),$F=new Map,HF=[{type:"type",content:"body"},{type:"type",content:"html"},{type:"pseudo-class",content:":root"},{type:"pseudo-class",content:":where(body)"},{type:"pseudo-class",content:":where(:root)"},{type:"pseudo-class",content:":where(html)"}];var WF=(e,t="",n)=>{let i=$F.get(t);return i||(i=new WeakMap,$F.set(t,i)),e.map(e=>{let r=i.get(e);return r||(r=function({css:e,ignoredSelectors:t=[],baseURL:n},i="",r){if(!i&&!n)return e;try{const o=[...t,...r?.ignoredSelectors??[],i];return new FF([i&&VF({prefix:i,transform:(e,t,n)=>o.some(e=>e instanceof RegExp?t.match(e):t.includes(e))?t:HF.some(e=>t.startsWith(e.content))?function(e,t){const n=PF(t),i=n.findLastIndex(({content:e,type:t})=>HF.some(n=>e===n.content&&t===n.type));let r=-1;for(let e=i+1;e<n.length;e++)if("combinator"===n[e].type){r=e;break}const o=PF(e);return n.splice(-1===r?n.length:r,0,{type:"combinator",content:" "},...o),DF(n)}(e,t):n}),n&&UF({rootUrl:n})].filter(Boolean)).process(e,{}).css}catch(e){return e instanceof zF?console.warn("wp.blockEditor.transformStyles Failed to transform CSS.",e.message+"\n"+e.showSourceCode(!1)):console.warn("wp.blockEditor.transformStyles Failed to transform CSS.",e),null}}(e,t,n),i.set(e,r)),r})};function GF(e){return"string"!=typeof e||!/<\/?\w/.test(e)}function qF({value:e,onChange:t,inheritedValue:n=e,help:i}){const[r,o]=(0,T.useState)(null),s=n?.css;return(0,Er.jsxs)(Q_.A,{spacing:3,children:[r&&(0,Er.jsx)(wS.A,{status:"error",onRemove:()=>o(null),children:r}),(0,Er.jsx)(TF.A,{label:(0,ee.__)("Additional CSS"),value:s,onChange:n=>function(n){t({...e,css:n}),GF(n)?r&&o(null):o((0,ee.__)("The custom CSS is invalid. Do not use <> markup."))}(n),onBlur:function(e){const t=e?.target?.value;if(!t||!GF(t))return;const[n]=WF([{css:t}],".for-validation-only");o(null===n?(0,ee.__)("There is an error with your CSS structure."):null)},className:"block-editor-global-styles-advanced-panel__custom-css-input",spellCheck:!1,help:i})]})}var KF={},YF={};function JF({blockName:e,setAttributes:t,style:n}){if("default"!==Vk())return null;const i=bn(e),r=(0,ee.sprintf)((0,ee.__)("Add your own CSS to customize the appearance of the %s block. You do not need to include a CSS selector, just add the property and value, e.g. color: red;."),i?.title);return(0,Er.jsx)(oC,{group:"advanced",children:(0,Er.jsx)(qF,{value:n,onChange:function(e){const n=e?.css?.trim()?e.css:void 0;t({style:ov({...e,css:n})})},inheritedValue:n,help:r})})}var XF={edit:function({clientId:e,name:t,setAttributes:n}){const{style:i,canEditCSS:r}=(0,zt.A)(t=>{const{getBlockAttributes:n,getSettings:i}=t(Qy);return{style:n(e)?.style||YF,canEditCSS:i().canEditCSS}},[e]);return r?(0,Er.jsx)(JF,{blockName:t,setAttributes:n,style:i}):null},useBlockProps:function({style:e}){const t=e?.css,n="string"==typeof t&&t.trim().length>0&&GF(t),i=(0,SS.A)(KF,"wp-custom-css"),r=`.${i}`;return cv({css:(0,T.useMemo)(()=>{if(n)return jF(t,r)},[t,r,n])}),n?{className:`has-custom-css ${i}`}:{}},addSaveProps:function(e,t,n){if(!_n(t,"customCSS",!0))return e;if(!n?.style?.css?.trim())return e;const i=e.className?`${e.className} has-custom-css`:"has-custom-css";return{...e,className:i}},attributeKeys:["style"],hasSupport:e=>_n(e,"customCSS",!0)},ZF="position",QF={key:"default",value:"",name:(0,ee.__)("Default")},ez={key:"sticky",value:"sticky",name:(0,ee._x)("Sticky","Name for the value of the CSS position property"),hint:(0,ee.__)("The block will stick to the top of the window instead of scrolling.")},tz={key:"fixed",value:"fixed",name:(0,ee._x)("Fixed","Name for the value of the CSS position property"),hint:(0,ee.__)("The block will not move when the page is scrolled.")},nz=["top","right","bottom","left"],iz=["sticky","fixed"];function rz(e){const t=e?.style?.position?.type;return"sticky"===t||"fixed"===t}function oz({name:e}={}){const[t,n]=tv("position.fixed","position.sticky"),i=!t&&!n;return!vn(e,ZF)||i}function sz({style:e={},clientId:t,name:n,setAttributes:i}){const r=function(e){const t=vn(e,ZF);return!(!0!==t&&!t?.fixed)}(n),o=function(e){const t=vn(e,ZF);return!(!0!==t&&!t?.sticky)}(n),s=e?.position?.type,{firstParentClientId:a}=(0,zt.A)(e=>{const{getBlockParents:n}=e(Qy),i=n(t);return{firstParentClientId:i[i.length-1]}},[t]),l=Ej(a),c=o&&s===ez.value&&l?(0,ee.sprintf)((0,ee.__)("The block will stick to the scrollable area of the parent %s block."),l.title):null,u=(0,T.useMemo)(()=>{const e=[QF];return(o||s===ez.value)&&e.push(ez),(r||s===tz.value)&&e.push(tz),e},[r,o,s]),d=s&&u.find(e=>e.value===s)||QF;return Uo.A.select({web:u.length>1?(0,Er.jsx)(oC,{group:"position",children:(0,Er.jsx)(mk.Ay,{help:c,children:(0,Er.jsx)(wR,{__next40pxDefaultSize:!0,label:(0,ee.__)("Position"),hideLabelFromVision:!0,describedBy:(0,ee.sprintf)((0,ee.__)("Currently selected position: %s"),d.name),options:u,value:d,onChange:({selectedItem:t})=>{(t=>{const n={...e,position:{...e?.position,type:t,top:"sticky"===t||"fixed"===t?"0px":void 0}};i({style:ov(n)})})(t.value)},size:"__unstable-large"})})}):null,native:null})}var az={edit:function(e){return oz(e)?null:(0,Er.jsx)(sz,{...e})},useBlockProps:function({name:e,style:t}){const n=_n(e,ZF),i=oz({name:e}),r=n&&!i,o=(0,SS.A)(lz);let s;r&&(s=function({selector:e,style:t}){let n="";const{type:i}=t?.position||{};return iz.includes(i)?(n+=`${e} {`,n+=`position: ${i};`,nz.forEach(e=>{void 0!==t?.position?.[e]&&(n+=`${e}: ${t.position[e]};`)}),"sticky"!==i&&"fixed"!==i||(n+="z-index: 10"),n+="}",n):n}({selector:`.wp-container-${o}.wp-container-${o}`,style:t})||"");const a=(0,mh.A)({[`wp-container-${o}`]:r&&!!s,[`is-position-${t?.position?.type}`]:r&&!!s&&!!t?.position?.type});return cv({css:s}),{className:a}},attributeKeys:["style"],hasSupport:e=>_n(e,ZF)},lz={},cz="is-style-";function uz(e){return e?e.split(/\s+/).reduce((e,t)=>{if(t.startsWith(cz)){const n=t.slice(9);"default"!==n&&e.push(n)}return e},[]):[]}function dz(e,t=[]){const n=uz(e);if(!n)return null;for(const e of n)if(t.some(t=>t.name===e))return e;return null}function hz({override:e}){uv(e)}function pz(e,t,n){if(!e?.styles?.blocks?.[t]?.variations?.[n])return;const i=t=>{Object.keys(t).forEach(n=>{const r=t[n];if("object"==typeof r&&null!==r)if(void 0!==r.ref)if("string"!=typeof r.ref||""===r.ref.trim())delete t[n];else{const i=xp(e,r.ref);i?t[n]=i:delete t[n]}else i(r),0===Object.keys(r).length&&delete t[n]})},r=JSON.parse(JSON.stringify(e.styles.blocks[t].variations[n]));return i(r),r}var fz={hasSupport:()=>!0,attributeKeys:["className"],isMatch:({className:e})=>uz(e).length>0,useBlockProps:function({name:e,className:t,clientId:n}){const{getBlockStyles:i}=(0,zt.A)(Zi),r=dz(t,i(e)),o=`${cz}${r}-${n}`,{settings:s,styles:a}=function(e,t,n){const{globalSettings:i,globalStyles:r}=(0,zt.A)(e=>{const t=e(Qy).getSettings();return{globalSettings:t.__experimentalFeatures,globalStyles:t[Rh]}},[]);return(0,T.useMemo)(()=>{const o=pz({settings:i,styles:r},e,t);return{settings:i,styles:{blocks:{[e]:{variations:{[`${t}-${n}`]:o}}}}}},[i,r,t,n,e])}(e,r,n),l=(0,T.useMemo)(()=>{if(!r)return;const e={settings:s,styles:a},t=EF(yn(),n);return IF(e,t,!1,!0,!0,!0,{blockGap:!1,blockStyles:!0,layoutStyles:!1,marginReset:!1,presets:!1,rootPadding:!1,variationStyles:!0})},[r,s,a,n]);return uv({id:`variation-${n}`,css:l,__unstableType:"variation",variation:r,clientId:n}),r?{className:o}:{}}},mz=n(24071),gz="layout",{kebabCase:bz}=Gh(Ev.j);function yz(e){return _n(e,"layout")||_n(e,"__experimentalLayout")}function vz(e={},t=""){const{layout:n}=e,{default:i}=vn(t,gz)||{},r=n?.inherit||n?.contentSize||n?.wideSize?{...n,type:"constrained"}:n||i||{},o=[];if(Qv[r?.type||"default"]?.className){const e=Qv[r?.type||"default"]?.className,n=t.split("/"),i=`wp-block-${"core"===n[0]?n.pop():n.join("-")}-${e}`;o.push(e,i)}return(0,zt.A)(e=>!(!r?.inherit&&!r?.contentSize&&"constrained"!==r?.type)&&e(Qy).getSettings().__experimentalFeatures?.useRootPaddingAwareAlignments,[r?.contentSize,r?.inherit,r?.type])&&o.push("has-global-padding"),r?.orientation&&o.push(`is-${bz(r.orientation)}`),r?.justifyContent&&o.push(`is-content-justification-${bz(r.justifyContent)}`),r?.flexWrap&&"nowrap"===r.flexWrap&&o.push("is-nowrap"),o}var _z={shareWithChildBlocks:!0,edit:function({layout:e,setAttributes:t,name:n,clientId:i}){const r=dv(n),{layout:o}=r,{themeSupportsLayout:s}=(0,zt.A)(e=>{const{getSettings:t}=e(Qy);return{themeSupportsLayout:t().supportsLayout}},[]);if("default"!==Vk())return null;const a=vn(n,gz,{}),l={...o,...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),y=e||h||{},{inherit:v=!1,contentSize:_=null}=y;if(("default"===g||"constrained"===g)&&!s)return null;const x=Sk(g),k=Sk("constrained"),w=!y.type&&(_||v),C=!!v||!!_,S=e=>t({layout:e});return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(oC,{children:(0,Er.jsxs)(mz.Ay,{title:(0,ee.__)("Layout"),children:[b&&(0,Er.jsx)(Er.Fragment,{children:(0,Er.jsx)(Zv.A,{label:(0,ee.__)("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,ee.__)("Nested blocks use content width with options for full and wide widths."):(0,ee.__)("Nested blocks will fill the width of this container.")})}),!v&&c&&(0,Er.jsx)(xz,{type:g,onChange:e=>t({layout:{type:e}})}),x&&"default"!==x.name&&(0,Er.jsx)(x.inspectorControls,{layout:y,onChange:S,layoutBlockSupport:l,name:n,clientId:i}),k&&w&&(0,Er.jsx)(k.inspectorControls,{layout:y,onChange:S,layoutBlockSupport:l,name:n,clientId:i})]})}),!v&&x&&(0,Er.jsx)(x.toolBarControls,{layout:y,onChange:S,layoutBlockSupport:a,name:n,clientId:i})]})},attributeKeys:["layout"],hasSupport:e=>yz(e)};function xz({type:e,onChange:t}){return(0,Er.jsx)(Jv.A,{__next40pxDefaultSize:!0,isBlock:!0,label:(0,ee.__)("Layout type"),hideLabelFromVision:!0,isAdaptiveWidth:!0,value:e,onChange:t,children:Ck.map(({name:e,label:t})=>(0,Er.jsx)(bk.A,{value:e,label:t},e))})}function kz({block:e,props:t,blockGapSupport:n,globalBlockGapValue:i,layoutClasses:r}){const{name:o,attributes:s}=t,a=(0,SS.A)(e),{layout:l}=s,{default:c}=vn(o,gz)||{},u=l?.inherit||l?.contentSize||l?.wideSize?{...l,type:"constrained"}:l||c||{},d=`wp-container-${bz(o)}-is-layout-`,h=`.${d}${a}`,p=null!==n,f=Sk(u?.type||"default"),m=f?.getLayoutStyle?.({blockName:o,selector:h,layout:u,style:s?.style,hasBlockGapSupport:p,globalBlockGapValue:i}),g=(0,mh.A)({[`${d}${a}`]:!!m},r);return cv({css:m}),(0,Er.jsx)(e,{...t,__unstableLayoutClassNames:g})}var wz=(0,gh.f)(e=>function(t){const{clientId:n,name:i,attributes:r}=t,o=yz(i),s=vz(r,i),a=(0,zt.A)(e=>{if(!o)return;const{getSettings:t,getBlockSettings:s}=Gh(e(Qy)),a=t(),{disableLayoutStyles:l}=a;if(l)return;const[c]=s(n,"spacing.blockGap"),u=a[Rh];let d;const h=r?.className;if(h?.includes("is-style-")){const{getBlockStyles:t}=e(Zi),n=dz(h,t(i));d=n?u?.blocks?.[i]?.variations?.[n]?.spacing?.blockGap:void 0}return{blockGapSupport:c,globalBlockGapValue:d??u?.blocks?.[i]?.spacing?.blockGap??u?.spacing?.blockGap}},[o,n,r?.className,i]);return a?(0,Er.jsx)(kz,{block:e,props:t,layoutClasses:s,...a}):(0,Er.jsx)(e,{...t,__unstableLayoutClassNames:o?s:void 0})},"withLayoutStyles");function Cz(e,t){return Array.from({length:t},(t,n)=>e+n)}(0,Ei.U2)("blocks.registerBlockType","core/layout/addAttribute",function(e){return"type"in(e.attributes?.layout??{})||yz(e)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e}),(0,Ei.U2)("editor.BlockListBlock","core/editor/layout/with-layout-styles",wz);var Sz=class{constructor({columnStart:e,rowStart:t,columnEnd:n,rowEnd:i,columnSpan:r,rowSpan:o}={}){this.columnStart=e??1,this.rowStart=t??1,this.columnEnd=void 0!==r?this.columnStart+r-1:n??this.columnStart,this.rowEnd=void 0!==o?this.rowStart+o-1:i??this.rowStart}get columnSpan(){return this.columnEnd-this.columnStart+1}get rowSpan(){return this.rowEnd-this.rowStart+1}contains(e,t){return e>=this.columnStart&&e<=this.columnEnd&&t>=this.rowStart&&t<=this.rowEnd}containsRect(e){return this.contains(e.columnStart,e.rowStart)&&this.contains(e.columnEnd,e.rowEnd)}intersectsRect(e){return this.columnStart<=e.columnEnd&&this.columnEnd>=e.columnStart&&this.rowStart<=e.rowEnd&&this.rowEnd>=e.rowStart}};function Az(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function Iz(e,t){const n=[];for(const i of e.split(" ")){const e=n[n.length-1],r=e?e.end+t:0,o=r+parseFloat(i);n.push({start:r,end:o})}return n}function Ez(e,t,n="start"){return e.reduce((i,r,o)=>Math.abs(r[n]-t)<Math.abs(e[i][n]-t)?o:i,0)}function jz(e){const t=Az(e,"grid-template-columns"),n=Az(e,"grid-template-rows"),i=Az(e,"border-top-width"),r=Az(e,"border-right-width"),o=Az(e,"border-bottom-width"),s=Az(e,"border-left-width"),a=Az(e,"padding-top"),l=Az(e,"padding-right"),c=Az(e,"padding-bottom"),u=Az(e,"padding-left"),d=t.split(" ").length,h=n.split(" ").length;return{numColumns:d,numRows:h,numItems:d*h,currentColor:Az(e,"color"),style:{gridTemplateColumns:t,gridTemplateRows:n,gap:Az(e,"gap"),inset:`\n\t\t\t\tcalc(${a} + ${i})\n\t\t\t\tcalc(${l} + ${r})\n\t\t\t\tcalc(${c} + ${o})\n\t\t\t\tcalc(${u} + ${s})\n\t\t\t`}}}var Tz=n(14875),Bz=n(76944),Nz=function(e){const{children:t}=e;return(0,Er.jsxs)("div",{className:"components-tip",children:[(0,Er.jsx)(xx.A,{icon:Bz.A}),(0,Er.jsx)("p",{children:t})]})},Rz=[(0,qS.A)((0,ee.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,Er.jsx)("kbd",{})}),(0,qS.A)((0,ee.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,Er.jsx)("kbd",{})}),(0,qS.A)((0,ee.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,Er.jsx)("kbd",{})}),(0,ee.__)("Drag files into the editor to automatically insert media blocks."),(0,ee.__)("Change a block's type by pressing the block icon on the toolbar.")],Oz=function(){const[e]=(0,T.useState)(Math.floor(Math.random()*Rz.length));return(0,Er.jsx)(Nz,{children:Rz[e]})},Lz=n(24671),Mz=n(56828),Pz=n(75914),{Badge:Dz}=Gh(Ev.j);function Fz({children:e,onClick:t}){return t?(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,className:"block-editor-block-card__parent-select-button",onClick:t,children:e}):e}var zz=function({title:e,icon:t,description:n,blockType:i,className:r,name:o,allowParentNavigation:s,parentClientId:a,isChild:l,children:c,clientId:u}){i&&((0,Qt.A)("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:e,icon:t,description:n}=i));const{parentBlockClientId:d,parentBlockName:h}=(0,zt.A)(e=>{if(a||l||!s)return{};const{getBlockParents:t,getBlockName:n}=e(Qy),i=t(u,!1).find(e=>{const t=n(e);return"core/navigation"===t||_n(t,"listView")});return{parentBlockClientId:i,parentBlockName:i?n(i):null}},[u,s,l,a]),{selectBlock:p}=(0,Vt.A)(Qy),f=a?"div":"h2";return(0,Er.jsx)("div",{className:(0,mh.A)("block-editor-block-card",{"is-parent":a,"is-child":l},r),children:(0,Er.jsxs)(Q_.A,{children:[(0,Er.jsxs)(Cw.A,{justify:"flex-start",spacing:0,children:[d&&(0,Er.jsx)(fv.Ay,{onClick:()=>p(d),label:h?(0,ee.sprintf)((0,ee.__)('Go to "%s" block'),bn(h)?.title):(0,ee.__)("Go to parent block"),style:{minWidth:24,padding:0},icon:(0,ee.isRTL)()?Lz.A:Mz.A,size:"small"}),l&&(0,Er.jsx)("span",{className:"block-editor-block-card__child-indicator-icon",children:(0,Er.jsx)(IC.A,{icon:(0,ee.isRTL)()?Pz.A:Gv.A})}),(0,Er.jsxs)(Fz,{onClick:a?()=>{p(a)}:void 0,children:[(0,Er.jsx)(hj,{icon:t,showColors:!0}),(0,Er.jsxs)(Q_.A,{spacing:1,children:[(0,Er.jsxs)(f,{className:"block-editor-block-card__title",children:[(0,Er.jsx)("span",{className:"block-editor-block-card__name",children:o?.length?o:e}),!a&&!l&&!!o?.length&&(0,Er.jsx)(Dz,{children:e})]}),c]})]})]}),!a&&!l&&n&&(0,Er.jsx)(lj.A,{className:"block-editor-block-card__description",children:n})]})})},Vz=(e=>(e.Unknown="REDUX_UNKNOWN",e.Add="ADD_ITEM",e.Prepare="PREPARE_ITEM",e.Cancel="CANCEL_ITEM",e.Remove="REMOVE_ITEM",e.RetryItem="RETRY_ITEM",e.PauseItem="PAUSE_ITEM",e.ResumeItem="RESUME_ITEM",e.PauseQueue="PAUSE_QUEUE",e.ResumeQueue="RESUME_QUEUE",e.OperationStart="OPERATION_START",e.OperationFinish="OPERATION_FINISH",e.AddOperations="ADD_OPERATIONS",e.CacheBlobUrl="CACHE_BLOB_URL",e.RevokeBlobUrls="REVOKE_BLOB_URLS",e.UpdateProgress="UPDATE_PROGRESS",e.UpdateSettings="UPDATE_SETTINGS",e))(Vz||{}),Uz=(e=>(e.Queued="QUEUED",e.Processing="PROCESSING",e.Paused="PAUSED",e.Uploaded="UPLOADED",e.Error="ERROR",e))(Uz||{}),$z=(e=>(e.Prepare="PREPARE",e.Upload="UPLOAD",e.ResizeCrop="RESIZE_CROP",e.Rotate="ROTATE",e.TranscodeImage="TRANSCODE_IMAGE",e.ThumbnailGeneration="THUMBNAIL_GENERATION",e.Finalize="FINALIZE",e))($z||{}),Hz="core/upload-media",Wz=["image/jpeg","image/png","image/gif","image/webp","image/avif"],Gz={queue:[],queueStatus:"active",blobUrls:{},settings:{mediaUpload:()=>{},maxConcurrentUploads:5,maxConcurrentImageProcessing:2}},qz=function(e=Gz,t={type:Vz.Unknown}){switch(t.type){case Vz.PauseQueue:return{...e,queueStatus:"paused"};case Vz.ResumeQueue:return{...e,queueStatus:"active"};case Vz.PauseItem:return{...e,queue:e.queue.map(e=>e.id===t.id?{...e,status:Uz.Paused}:e)};case Vz.ResumeItem:return{...e,queue:e.queue.map(e=>e.id===t.id?{...e,status:Uz.Processing}:e)};case Vz.Add:return{...e,queue:[...e.queue,t.item]};case Vz.Cancel:return{...e,queue:e.queue.map(e=>e.id===t.id?{...e,error:t.error}:e)};case Vz.RetryItem:return{...e,queue:e.queue.map(e=>e.id===t.id?{...e,status:Uz.Processing,error:void 0,retryCount:(e.retryCount??0)+1}:e)};case Vz.Remove:return{...e,queue:e.queue.filter(e=>e.id!==t.id)};case Vz.OperationStart:return{...e,queue:e.queue.map(e=>e.id===t.id?{...e,currentOperation:t.operation}:e)};case Vz.AddOperations:return{...e,queue:e.queue.map(e=>e.id!==t.id?e:{...e,operations:[...e.operations||[],...t.operations]})};case Vz.OperationFinish:return{...e,queue:e.queue.map(e=>{if(e.id!==t.id)return e;const n=e.operations?e.operations.slice(1):[],i=e.attachment||t.item.attachment?{...e.attachment,...t.item.attachment}:void 0;return{...e,currentOperation:void 0,operations:n,...t.item,attachment:i,additionalData:{...e.additionalData,...t.item.additionalData}}})};case Vz.CacheBlobUrl:{const n=e.blobUrls[t.id]||[];return{...e,blobUrls:{...e.blobUrls,[t.id]:[...n,t.blobUrl]}}}case Vz.RevokeBlobUrls:{const n={...e.blobUrls};return delete n[t.id],{...e,blobUrls:n}}case Vz.UpdateProgress:return{...e,queue:e.queue.map(e=>e.id===t.id?{...e,progress:t.progress}:e)};case Vz.UpdateSettings:return{...e,settings:{...e.settings,...t.settings}}}return e};function Kz(e){return e.queue}function Yz(e){return e.queue.length>=1}function Jz(e,t){return e.queue.some(e=>e.attachment?.url===t||e.sourceUrl===t)}function Xz(e,t){return e.queue.some(e=>e.attachment?.id===t||e.sourceAttachmentId===t)}function Zz(e){return e.settings}function Qz(e){return e.queue}function eV(e,t){return e.queue.find(e=>e.id===t)}function tV(e,t){return 0===e.queue.filter(e=>t===e.batchId).length}function nV(e,t){return e.queue.some(e=>e.currentOperation===$z.Upload&&e.additionalData.post===t)}function iV(e,t){return e.queue.find(e=>e.status===Uz.Paused&&e.additionalData.post===t)}function rV(e){return"paused"===e.queueStatus}function oV(e,t){return e.blobUrls[t]||[]}function sV(e){return e.queue.filter(e=>e.currentOperation===$z.Upload).length}function aV(e){return e.queue.filter(e=>(Array.isArray(e.operations?.[0])?e.operations[0][0]:e.operations?.[0])===$z.Upload&&e.currentOperation!==$z.Upload)}function lV(e){return e.queue.filter(e=>e.currentOperation===$z.ResizeCrop||e.currentOperation===$z.Rotate).length}function cV(e){return e.queue.filter(e=>{const t=Array.isArray(e.operations?.[0])?e.operations[0][0]:e.operations?.[0];return(t===$z.ResizeCrop||t===$z.Rotate)&&e.currentOperation!==$z.ResizeCrop&&e.currentOperation!==$z.Rotate})}function uV(e){return e.queue.filter(e=>void 0!==e.error)}function dV(e,t){return e.queue.some(e=>e.parentId===t)}function hV(e,t){const n=e.queue.find(e=>e.id===t);return n?.progress}var pV,fV,mV=class extends File{width=0;height=0;originalWidth=0;originalHeight=0;get wasResized(){return(this.originalWidth||0)>this.width||(this.originalHeight||0)>this.height}constructor(e,t,n,i,r){super([e],e.name,{type:e.type,lastModified:e.lastModified}),this.width=t,this.height=n,this.originalWidth=i,this.originalHeight=r}};function gV(e,t){return new File([e],t,{type:e.type,lastModified:e.lastModified})}function bV(e){return gV(e,e.name)}function yV(e){return e.includes(".")?e.split(".").slice(0,-1).join("."):e}function vV(){return pV||(pV=Promise.resolve().then(function(){var e=new Error("Cannot find module '@wordpress/vips/worker'");throw e.code="MODULE_NOT_FOUND",e}).then(e=>(fV=e,e))),pV}async function _V(e,t,n,i){if(i?.aborted)throw new Error("Operation aborted");if(1===n)return t;const{vipsRotateImage:r}=await vV(),{buffer:o,width:s,height:a}=await r(e,await t.arrayBuffer(),t.type,n),l=yV(t.name),c=t.name.replace(l,`${l}-rotated`);return new mV(new File([new Blob([o],{type:t.type})],c,{type:t.type}),s,a)}var xV=class extends Error{code;file;constructor({code:e,message:t,file:n,cause:i}){super(t,{cause:i}),Object.setPrototypeOf(this,new.target.prototype),this.code=e,this.file=n}};function kV(e,t){if(!t)return;const n=t.some(t=>t.includes("/")?t===e.type:e.type.startsWith(`${t}/`));if(e.type&&!n)throw new xV({code:"MIME_TYPE_NOT_SUPPORTED",message:(0,ee.sprintf)((0,ee.__)("%s: Sorry, this file type is not supported here."),e.name),file:e})}function wV(e,t){const n=(i=t)?Object.entries(i).flatMap(([e,t])=>{const[n]=t.split("/");return[t,...e.split("|").map(e=>`${n}/${e}`)]}):null;var i;if(!n)return;const r=n.includes(e.type);if(e.type&&!r)throw new xV({code:"MIME_TYPE_NOT_ALLOWED_FOR_USER",message:(0,ee.sprintf)((0,ee.__)("%s: Sorry, you are not allowed to upload this file type."),e.name),file:e})}function CV(e,t){if(e.size<=0)throw new xV({code:"EMPTY_FILE",message:(0,ee.sprintf)((0,ee.__)("%s: This file is empty."),e.name),file:e});if(t&&e.size>t)throw new xV({code:"SIZE_ABOVE_LIMIT",message:(0,ee.sprintf)((0,ee.__)("%s: This file exceeds the maximum upload size for this site."),e.name),file:e})}function SV({files:e,onChange:t,onSuccess:n,onError:i,onBatchSuccess:r,additionalData:o,allowedTypes:s}){return async({select:a,dispatch:l})=>{const c=(0,Qi.A)();for(const u of e){try{kV(u,s),wV(u,a.getSettings().allowedMimeTypes)}catch(e){i?.(e);continue}try{CV(u,a.getSettings().maxUploadFileSize)}catch(e){i?.(e);continue}l.addItem({file:u,batchId:c,onChange:t,onSuccess:n,onBatchSuccess:r,onError:i,additionalData:o})}}}function AV(e,t,n=!1){return async({select:i,dispatch:r})=>{const o=i.getItem(e);if(o){if(o.abortController?.abort(),await async function(e){return!!fV&&fV.vipsCancelOperations(e)}(e),!n){const{onError:e}=o;e?.(t??new Error("Upload cancelled")),!e&&t&&console.error("Upload cancelled",t)}r({type:Vz.Cancel,id:e,error:t}),r.removeItem(e),r.revokeBlobUrls(e),o.batchId&&i.isBatchUploaded(o.batchId)&&o.onBatchSuccess?.()}}}function IV(e){return async({select:t,dispatch:n})=>{const i=t.getItem(e);i&&i.error&&(n({type:Vz.RetryItem,id:e}),n.processItem(e))}}var EV=class extends File{constructor(e="stub-file"){super([],e)}},jV=.82;function TV({file:e,batchId:t,onChange:n,onSuccess:i,onBatchSuccess:r,onError:o,additionalData:s={},sourceUrl:a,sourceAttachmentId:l,abortController:c,operations:u}){return async({dispatch:d})=>{const h=(0,Qi.A)(),p=function(e){if(e instanceof File)return e;if("name"in e&&"string"==typeof e.name)return new File([e],e.name,{type:e.type,lastModified:e.lastModified});const t=e.type.split("/")[1],n="application/pdf"===e.type?"document":e.type.split("/")[0];return new File([e],`${n}.${t}`,{type:e.type})}(e);let f;p instanceof EV||(f=Ps(p),d({type:Vz.CacheBlobUrl,id:h,blobUrl:f})),d({type:Vz.Add,item:{id:h,batchId:t,status:Uz.Processing,sourceFile:bV(p),file:p,attachment:{url:f},additionalData:{convert_format:!1,generate_sub_sizes:!1,...s},onChange:n,onSuccess:i,onBatchSuccess:r,onError:o,sourceUrl:a,sourceAttachmentId:l,abortController:c||new AbortController,operations:Array.isArray(u)?u:[$z.Prepare]}}),d.processItem(h)}}function BV({file:e,onChange:t,additionalData:n,operations:i,batchId:r,parentId:o}){return({dispatch:s})=>{const a=(0,Qi.A)();s({type:Vz.Add,item:{id:a,batchId:r,status:Uz.Processing,sourceFile:bV(e),file:e,onChange:t,additionalData:{...n},parentId:o,operations:Array.isArray(i)?i:[$z.Prepare],abortController:new AbortController}}),s.processItem(a)}}function NV(e){return async({select:t,dispatch:n})=>{if(t.isPaused())return;const i=t.getItem(e);if(!i)return;const{attachment:r,onChange:o,onSuccess:s,onBatchSuccess:a,batchId:l,parentId:c}=i,u=Array.isArray(i.operations?.[0])?i.operations[0][0]:i.operations?.[0],d=Array.isArray(i.operations?.[0])?i.operations[0][1]:void 0;if(function(e,t,n){return!(t!==$z.Upload||!e.parentId||!e.additionalData.post)&&n.isUploadingToPost(e.additionalData.post)}(i,u,t))n({type:Vz.PauseItem,id:e});else{if(u===$z.Upload){const e=t.getSettings();if(t.getActiveUploadCount()>=e.maxConcurrentUploads)return}if(u===$z.ResizeCrop||u===$z.Rotate){const e=t.getSettings();if(t.getActiveImageProcessingCount()>=e.maxConcurrentImageProcessing)return}if(r&&o?.([r]),u){if(u!==$z.Finalize||!t.hasPendingItemsByParentId(e))switch(n({type:Vz.OperationStart,id:e,operation:u}),u){case $z.Prepare:n.prepareItem(i.id);break;case $z.ResizeCrop:n.resizeCropItem(i.id,d);break;case $z.Rotate:n.rotateItem(i.id,d);break;case $z.TranscodeImage:n.transcodeImageItem(i.id,d);break;case $z.Upload:i.parentId?n.sideloadItem(e):n.uploadItem(e);break;case $z.ThumbnailGeneration:n.generateThumbnails(e);break;case $z.Finalize:n.finalizeItem(e)}}else if((c||!c&&!t.hasPendingItemsByParentId(e))&&(r&&s?.([r]),n.removeItem(e),n.revokeBlobUrls(e),l&&t.isBatchUploaded(l)&&a?.()),c&&l&&t.isBatchUploaded(l)){const e=t.getItem(c);if(!e)return;if(e.operations&&e.operations.length>0)return void n.processItem(c);r&&e.onSuccess?.([r]),n.removeItem(c),n.revokeBlobUrls(c),e.batchId&&t.isBatchUploaded(e.batchId)&&e.onBatchSuccess?.()}}}}function RV(){return{type:Vz.PauseQueue}}function OV(){return async({select:e,dispatch:t})=>{t({type:Vz.ResumeQueue});for(const n of e.getAllItems())t.processItem(n.id)}}function LV(e){return async({dispatch:t})=>{t({type:Vz.PauseItem,id:e})}}function MV(e){return async({select:t,dispatch:n})=>{const i=t.getPausedUploadForPost(e);i&&(n({type:Vz.ResumeItem,id:i.id}),n.processItem(i.id))}}function PV(e){return async({select:t,dispatch:n})=>{t.getItem(e)&&(n({type:Vz.Remove,id:e}),0===t.getAllItems().length&&fV&&fV.terminateVipsWorker())}}function DV(e,t){return async({select:n,dispatch:i})=>{const r=n.getItem(e),o=r?.currentOperation;if(i({type:Vz.OperationFinish,id:e,item:t}),i.processItem(e),o===$z.Upload){const e=n.getPendingUploads();for(const t of e)i.processItem(t.id)}if(o===$z.ResizeCrop||o===$z.Rotate){const e=n.getPendingImageProcessing();for(const t of e)i.processItem(t.id)}}}var FV=["jpeg","webp","avif","png","gif"];function zV(e,t){switch(e){case"image/jpeg":return t.jpegInterlaced??!1;case"image/png":return t.pngInterlaced??!1;case"image/gif":return t.gifInterlaced??!1;default:return!1}}async function VV(e,t,n){if("image/png"===e.type&&"image/jpeg"===t){const t=Ps(e);try{if(await async function(e){const{vipsHasTransparency:t}=await vV(),n=await fetch(e);if(!n.ok)throw new Error(`Failed to fetch image: ${n.status}`);return t(await n.arrayBuffer())}(t))return null}catch{return null}finally{Ds(t)}}const i=t.split("/")[1];return r=i,FV.includes(r)?[$z.TranscodeImage,{outputFormat:i,outputQuality:jV,interlaced:zV(t,n)}]:null;var r}function UV(e){return async({select:t,dispatch:n})=>{const i=t.getItem(e);if(!i)return;const{file:r}=i,o=[],s=t.getSettings(),a=r.type.startsWith("image/"),l=Wz.includes(r.type);if(a&&l){const{imageOutputFormats:e}=s,t=e?.[r.type];if(t&&t!==r.type){const e=await VV(r,t,s);e&&o.push(e)}o.push($z.Upload,$z.ThumbnailGeneration,$z.Finalize)}else o.push($z.Upload);n({type:Vz.AddOperations,id:e,operations:o});const c=l&&a?{}:{additionalData:{...i.additionalData,generate_sub_sizes:!0,convert_format:!0}};n.finishOperation(e,c)}}function $V(e){return async({select:t,dispatch:n})=>{const i=t.getItem(e);i&&t.getSettings().mediaUpload({filesList:[i.file],additionalData:i.additionalData,signal:i.abortController?.signal,onFileChange:([t])=>{t&&!Fs(t.url)&&n.finishOperation(e,{attachment:t})},onSuccess:([t])=>{n.finishOperation(e,{attachment:t})},onError:t=>{n.cancelItem(e,t)}})}}function HV(e){return async({select:t,dispatch:n})=>{const i=t.getItem(e);if(!i)return;const{post:r,...o}=i.additionalData,s=t.getSettings().mediaSideload;s?s({file:i.file,attachmentId:r,additionalData:o,signal:i.abortController?.signal,onFileChange:([t])=>{n.finishOperation(e,{attachment:t}),n.resumeItemByPostId(r)},onError:t=>{n.cancelItem(e,t),n.resumeItemByPostId(r)}}):n.finishOperation(e,{})}}function WV(e,t){return async({select:n,dispatch:i})=>{const r=n.getItem(e);if(!r)return;if(!t?.resize)return void i.finishOperation(e,{file:r.file});const o=Boolean(r.parentId),s=Boolean(t.isThresholdResize);try{const n=await async function(e,t,n,i,r,o,s){if(o?.aborted)throw new Error("Operation aborted");const{vipsResizeImage:a}=await vV(),{buffer:l,width:c,height:u,originalWidth:d,originalHeight:h}=await a(e,await t.arrayBuffer(),t.type,n,!1,void 0);let p=t.name;if(d>c||h>u){const e=yV(t.name);s?p=t.name.replace(e,`${e}-scaled`):r&&(p=t.name.replace(e,`${e}-${c}x${u}`))}return new mV(new File([new Blob([l],{type:t.type})],p,{type:t.type}),c,u,d,h)}(r.id,r.file,t.resize,0,o,r.abortController?.signal,s),a=Ps(n);i({type:Vz.CacheBlobUrl,id:e,blobUrl:a}),i.finishOperation(e,{file:n,attachment:{url:a}})}catch(t){i.cancelItem(e,new xV({code:"IMAGE_TRANSCODING_ERROR",message:"File could not be uploaded",file:r.file,cause:t instanceof Error?t:void 0}))}}}function GV(e,t){return async({select:n,dispatch:i})=>{const r=n.getItem(e);if(r)if(t?.orientation&&1!==t.orientation)try{const n=await _V(r.id,r.file,t.orientation,r.abortController?.signal),o=Ps(n);i({type:Vz.CacheBlobUrl,id:e,blobUrl:o}),i.finishOperation(e,{file:n,attachment:{url:o}})}catch(t){i.cancelItem(e,new xV({code:"IMAGE_ROTATION_ERROR",message:"Image could not be rotated",file:r.file,cause:t instanceof Error?t:void 0}))}else i.finishOperation(e,{file:r.file})}}function qV(e,t){return async({select:n,dispatch:i})=>{const r=n.getItem(e);if(!r)return;if(!t?.outputFormat)return void i.finishOperation(e,{file:r.file});const o=`image/${t.outputFormat}`,s=t.outputQuality??jV,a=t.interlaced??!1;try{const t=await async function(e,t,n,i,r){const{vipsConvertImageFormat:o}=await vV(),s=await o(e,await t.arrayBuffer(),t.type,n,i,r),a=n.split("/")[1],l=`${yV(t.name)}.${a}`;return new File([new Blob([s])],l,{type:n})}(r.id,r.file,o,s,a),n=Ps(t);i({type:Vz.CacheBlobUrl,id:e,blobUrl:n}),i.finishOperation(e,{file:t,attachment:{url:n}})}catch(t){i.cancelItem(e,new xV({code:"MEDIA_TRANSCODING_ERROR",message:"Image could not be transcoded to the target format",file:r.file,cause:t instanceof Error?t:void 0}))}}}function KV(e){return async({select:t,dispatch:n})=>{const i=t.getItem(e);if(!i)return;if(!i.attachment)return void n.finishOperation(e,{});const r=i.attachment;if(r.exif_orientation&&1!==r.exif_orientation&&!i.file.name.includes("-scaled")&&r.id)try{const e=await _V(i.id,i.sourceFile,r.exif_orientation,i.abortController?.signal);n.addSideloadItem({file:e,batchId:(0,Qi.A)(),parentId:i.id,additionalData:{post:r.id,image_size:"original",convert_format:!1},operations:[$z.Upload]})}catch{console.warn("Failed to rotate image, continuing with thumbnails")}if(!i.parentId&&r.missing_image_sizes&&r.missing_image_sizes.length>0){const e=t.getSettings(),o=e.allImageSizes||{},s=r.missing_image_sizes,a=r.filename?gV(i.sourceFile,r.filename):i.sourceFile,l=(0,Qi.A)(),{imageOutputFormats:c}=e,u=i.sourceFile.type,d=c?.[u];let h=null;d&&d!==u&&(h=await VV(i.sourceFile,d,e));const p=h?`image/${h[1].outputFormat}`:u,f=h?h[1].outputQuality??jV:jV,m=[];for(const e of s){const t=o[e];t?m.push({name:e,resize:t,quality:f}):console.warn(`Image size "${e}" not found in configuration`)}const{bigImageSizeThreshold:g}=e;let b=!1;if(g&&r.id){const e=await createImageBitmap(i.sourceFile);b=e.width>g||e.height>g,e.close(),b&&m.push({name:"scaled",resize:{width:g,height:g},quality:f,scaledSuffix:!0})}let y=null;if(m.length>0)try{y=await async function(e,t,n,i,r=!1){const{vipsBatchResizeImage:o}=await vV(),s=i.map(e=>({resize:{...e.resize},quality:e.quality})),a=await o(e,await t.arrayBuffer(),t.type,n,s,r),l=n.split("/")[1],c=yV(t.name);return a.map((e,t)=>{const r=i[t],{width:o,height:s,originalWidth:a,originalHeight:u}=e;let d=`${c}.${l}`;return(a>o||u>s)&&(d=r.scaledSuffix?`${c}-scaled.${l}`:`${c}-${o}x${s}.${l}`),{name:r.name,file:new mV(new File([new Blob([e.buffer],{type:n})],d,{type:n}),o,s,a,u)}})}(i.id,a,p,m,!1)}catch{console.warn("Batch resize failed, falling back to per-thumbnail processing")}if(y)for(const e of y)n.addSideloadItem({file:e.file,onChange:([e])=>{Fs(e.url)||i.onChange?.([e])},batchId:l,parentId:i.id,additionalData:{post:r.id,image_size:e.name,convert_format:!1},operations:[$z.Upload]});else{for(const e of s){const t=o[e];if(!t)continue;const s=[[$z.ResizeCrop,{resize:t}]];h&&s.push(h),s.push($z.Upload),n.addSideloadItem({file:a,onChange:([e])=>{Fs(e.url)||i.onChange?.([e])},batchId:l,parentId:i.id,additionalData:{post:r.id,image_size:e,convert_format:!1},operations:s})}if(b&&g&&r.id){const e=[[$z.ResizeCrop,{resize:{width:g,height:g},isThresholdResize:!0}]];h&&e.push(h),e.push($z.Upload),n.addSideloadItem({file:a,onChange:([e])=>{Fs(e.url)||i.onChange?.([e])},batchId:l,parentId:i.id,additionalData:{post:r.id,image_size:"scaled",convert_format:!1},operations:e})}}}n.finishOperation(e,{})}}function YV(e){return async({select:t,dispatch:n})=>{const i=t.getItem(e);if(!i)return;const r=i.attachment,{mediaFinalize:o}=t.getSettings();if(r?.id&&o)try{await o(r.id)}catch(e){console.warn("Media finalization failed:",e)}n.finishOperation(e,{})}}function JV(e){return async({select:t,dispatch:n})=>{const i=t.getBlobUrls(e);for(const e of i)Ds(e);n({type:Vz.RevokeBlobUrls,id:e})}}function XV(e,t){return async({dispatch:n})=>{n({type:Vz.UpdateProgress,id:e,progress:t})}}function ZV(e){return{type:Vz.UpdateSettings,settings:e}}var{lock:QV,unlock:eU}=(0,pt.yf)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/upload-media"),tU={reducer:qz,selectors:p,actions:m},nU=(0,P.A)(Hz,{reducer:qz,selectors:p,actions:m});(0,xe.L)(nU)||(0,D.register)(nU),eU(nU).registerPrivateActions(g),eU(nU).registerPrivateSelectors(f);var iU=n(77339),rU=n(10887),oU=(0,gh.f)(e=>({useSubRegistry:t=!0,...n})=>{const i=(0,yt.A)(),[r]=(0,T.useState)(()=>new WeakMap),o=function(e,t,n){if(!n)return t;let i=e.get(t);return i||(i=(0,iU.I)({},t),i.registerStore(Hz,tU),e.set(t,i)),i}(r,i,t);return o===i?(0,Er.jsx)(e,{registry:i,...n}):(0,Er.jsx)(rU.Ay,{value:o,children:(0,Er.jsx)(e,{registry:o,...n})})},"withRegistryProvider")(e=>{const{children:t,settings:n}=e,{updateSettings:i}=eU((0,Vt.A)(nU));return(0,T.useEffect)(()=>{i(n)},[n,i]),(0,Er.jsx)(Er.Fragment,{children:t})}),sU=oU,aU=null;var lU=(0,gh.f)(e=>function({useSubRegistry:t=!0,...n}){const i=(0,yt.A)(),[r]=(0,T.useState)(()=>new WeakMap),o=function(e,t,n){if(!n)return t;let i=e.get(t);return i||(i=(0,iU.I)({},t),i.registerStore(fp,Zy),e.set(t,i)),i}(r,i,t);return o===i?(0,Er.jsx)(e,{registry:i,...n}):(0,Er.jsx)(rU.Ay,{value:o,children:(0,Er.jsx)(e,{registry:o,...n})})},"withRegistryProvider"),cU=(0,T.createContext)({getSelection:()=>{},onChangeSelection:()=>{}}),uU=()=>{};function dU(e,t){const n=ir(e);return t.externalToInternal.set(e.clientId,n.clientId),t.internalToExternal.set(n.clientId,e.clientId),e.innerBlocks?.length&&(n.innerBlocks=e.innerBlocks.map(e=>dU(e,t))),n}function hU(e,t){return e.map(e=>{const n=t.internalToExternal.get(e.clientId);return{...e,clientId:n??e.clientId,innerBlocks:hU(e.innerBlocks,t)}})}function pU(e,t){const{selectionStart:n,selectionEnd:i,initialPosition:r}=e,o=e=>{if(!e?.clientId)return e;const n=t.internalToExternal.get(e.clientId);return{...e,clientId:n??e.clientId}};return{selectionStart:o(n),selectionEnd:o(i),initialPosition:r}}function fU({clientId:e=null,value:t,onChange:n=uU,onInput:i=uU}){const r=(0,yt.A)(),{getSelection:o,onChangeSelection:s}=(0,T.useContext)(cU),{resetBlocks:a,resetSelection:l,replaceInnerBlocks:c,setHasControlledInnerBlocks:u,__unstableMarkNextChangeAsNotPersistent:d}=r.dispatch(Qy),{getBlockName:h,getBlocks:p,getSelectionStart:f,getSelectionEnd:m}=r.select(Qy),g=(0,T.useRef)({incoming:null,outgoing:[]}),b=(0,T.useRef)(!1),y=(0,T.useRef)({externalToInternal:new Map,internalToExternal:new Map}),v=(0,T.useRef)(null),_=(0,T.useRef)(!1),x=()=>{t&&(e?r.batch(()=>{y.current.externalToInternal.clear(),y.current.internalToExternal.clear();const n=t.map(e=>dU(e,y.current));u(e,!0),b.current&&(g.current.incoming=n),d(),c(e,n),v.current=null}):(b.current&&(g.current.incoming=t),d(),a(t)))},k=(0,T.useRef)(i),w=(0,T.useRef)(n);(0,T.useEffect)(()=>{k.current=i,w.current=n},[i,n]),(0,T.useEffect)(()=>{const n=g.current.outgoing.includes(t),i=p(e)===t;n?g.current.outgoing[g.current.outgoing.length-1]===t&&(g.current.outgoing=[]):i||(g.current.outgoing=[],x(),(()=>{const t=o();if(!t?.selectionStart?.clientId||t===v.current)return;const n=t.selectionStart.clientId;if(e?y.current.externalToInternal.has(n):h(n)){v.current=t;const n=t=>t?.clientId&&e?{...t,clientId:y.current.externalToInternal.get(t.clientId)??t.clientId}:t;_.current=!0,l(n(t.selectionStart),n(t.selectionEnd),t.initialPosition),_.current=!1}})())},[t,e]),(0,T.useEffect)(()=>{const{getSelectedBlocksInitialCaretPosition:t,isLastBlockChangePersistent:n,__unstableIsLastBlockChangeIgnored:i,areInnerBlocksControlled:o,getBlockParents:a}=r.select(Qy);let l=p(e),c=n(),u=!1,d=f(),v=m();b.current=!0;const x=r.subscribe(()=>{if(null!==e&&null===h(e))return;const b=n(),x=p(e),C=x!==l;if(l=x,C&&(g.current.incoming||i()))return g.current.incoming=null,void(c=b);const S=C||u&&!C&&b&&!c,A=f(),I=m(),E=A!==d||I!==v;E&&(d=A,v=I),(S||E)&&r.batch(()=>{if(S){c=b;const n=e?hU(l,y.current):l,i={selectionStart:A,selectionEnd:I,initialPosition:t()},r=e?pU(i,y.current):i;g.current.outgoing.push(n),(c?w.current:k.current)(n,{selection:r})}if(E&&!S&&A?.clientId&&!_.current&&(e?y.current.internalToExternal.has(A.clientId):!a(A.clientId).some(e=>o(e)))){const n={selectionStart:A,selectionEnd:I,initialPosition:t()};s(e?pU(n,y.current):n)}}),u=C},Qy);return()=>{b.current=!1,x()}},[r,e]),(0,T.useEffect)(()=>()=>{d(),e?(u(e,!1),d(),c(e,[])):a([])},[])}function mU(){return null}mU.Register=function(){const{registerShortcut:e}=(0,Vt.A)($T.M_);return(0,T.useEffect)(()=>{e({name:"core/block-editor/copy",category:"block",description:(0,ee.__)("Copy the selected block(s)."),keyCombination:{modifier:"primary",character:"c"}}),e({name:"core/block-editor/cut",category:"block",description:(0,ee.__)("Cut the selected block(s)."),keyCombination:{modifier:"primary",character:"x"}}),e({name:"core/block-editor/paste",category:"block",description:(0,ee.__)("Paste the selected block(s)."),keyCombination:{modifier:"primary",character:"v"}}),e({name:"core/block-editor/duplicate",category:"block",description:(0,ee.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,ee.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/paste-styles",category:"block",description:(0,ee.__)("Paste the copied style to the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"v"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,ee.__)("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,ee.__)("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,ee.__)("Delete selection."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/stop-editing-as-blocks",category:"block",description:(0,ee.__)("Finish editing a design."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/select-all",category:"selection",description:(0,ee.__)("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,ee.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/multi-text-selection",category:"selection",description:(0,ee.__)("Select text across multiple blocks."),keyCombination:{modifier:"shift",character:"arrow"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,ee.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,ee.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,ee.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}}),e({name:"core/block-editor/collapse-list-view",category:"list-view",description:(0,ee.__)("Collapse all other items."),keyCombination:{modifier:"alt",character:"l"}}),e({name:"core/block-editor/group",category:"block",description:(0,ee.__)("Create a group block from the selected multiple blocks."),keyCombination:{modifier:"primary",character:"g"}}),e({name:"core/block-editor/toggle-block-visibility",category:"block",description:(0,ee.__)("Show or hide the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"h"}}),e({name:"core/block-editor/rename",category:"block",description:(0,ee.__)("Rename the selected block."),keyCombination:{modifier:"primaryAlt",character:"r"}})},[e]),null};var gU=mU,bU=()=>{},yU=!1,vU=null;function _U(e,t,{allowedTypes:n,additionalData:i={},filesList:r,onError:o=bU,onFileChange:s,onSuccess:a,onBatchSuccess:l}){e.dispatch(nU).addItems({files:Array.from(r),onChange:s,onSuccess:e=>{t?.[Hh]?.(e),a?.(e)},onBatchSuccess:l,onError:e=>o("string"==typeof e?e:e?.message??""),additionalData:i,allowedTypes:n})}function xU(e){return fU(e),null}var kU=lU(e=>{const{settings:t,registry:n,stripExperimentalSettings:i=!1}=e,r=function(e={}){return(0,T.useMemo)(()=>({mediaUpload:e.mediaUpload,mediaSideload:e.mediaSideload,mediaFinalize:e.mediaFinalize,maxUploadFileSize:e.maxUploadFileSize,allowedMimeTypes:e.allowedMimeTypes,allImageSizes:e.allImageSizes,bigImageSizeThreshold:e.bigImageSizeThreshold}),[e])}(t),o=function(){if(null!==vU)return vU;if(!window.__clientSideMediaProcessing)return vU=!1,!1;const e=function(){if(null!==aU)return aU;if("undefined"==typeof WebAssembly)return aU={supported:!1,reason:"WebAssembly is not supported in this browser."};if("undefined"==typeof SharedArrayBuffer)return aU={supported:!1,reason:"SharedArrayBuffer is not available. This may be due to missing cross-origin isolation headers."};if("undefined"==typeof Worker)return aU={supported:!1,reason:"Web Workers are not supported in this browser."};if("undefined"!=typeof navigator&&"deviceMemory"in navigator&&navigator.deviceMemory<=2)return aU={supported:!1,reason:"Device has insufficient memory for client-side media processing."};if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency<2)return aU={supported:!1,reason:"Device has insufficient CPU cores for client-side media processing."};if("undefined"!=typeof navigator){const e=navigator.connection;if(e){if(e.saveData)return aU={supported:!1,reason:"Data saver mode is enabled."};if("slow-2g"===e.effectiveType||"2g"===e.effectiveType)return aU={supported:!1,reason:"Network connection is too slow for client-side media processing."}}}if("undefined"!=typeof window)try{const e=new Blob([""],{type:"application/javascript"}),t=URL.createObjectURL(e);try{new Worker(t).terminate()}finally{URL.revokeObjectURL(t)}}catch{return aU={supported:!1,reason:"The site's Content Security Policy (CSP) does not allow blob: workers. The worker-src directive must include blob: to enable client-side media processing."}}return aU={supported:!0}}();return e&&e.supported?(vU=!0,!0):(yU||(console.info(`Client-side media processing unavailable: ${e.reason}. Using server-side processing.`),yU=!0),vU=!1,!1)}(),s=!!t?.mediaUpload?.__isMediaUploadInterceptor,a=(0,T.useMemo)(()=>{if(o&&t?.mediaUpload&&!s){const e=_U.bind(null,n,t);return e.__isMediaUploadInterceptor=!0,{...t,mediaUpload:e}}return t},[t,n,o,s]),{__experimentalUpdateSettings:l}=Gh((0,Vt.A)(Qy));(0,T.useEffect)(()=>{l({...a,__internalIsInitialized:!0},{stripExperimentalSettings:i,reset:!0})},[a,i,l]);const c=(0,T.useRef)(e.selection);c.current=e.selection;const u=(0,T.useRef)(e.onChangeSelection??bU);u.current=e.onChangeSelection??bU;const d=(0,T.useMemo)(()=>({getSelection:()=>c.current,onChangeSelection:(...e)=>u.current(...e)}),[]),h=(0,Er.jsxs)(Sv.Kq,{passthrough:!0,children:[!a?.isPreviewMode&&(0,Er.jsx)(gU.Register,{}),(0,Er.jsx)(IO,{children:e.children})]}),p=(0,Er.jsxs)(cU.Provider,{value:d,children:[(0,Er.jsx)(xU,{clientId:e.clientId,value:e.value,onChange:e.onChange,onInput:e.onInput}),h]});return o&&!s?(0,Er.jsx)(sU,{settings:r,useSubRegistry:!1,children:p}):p}),wU=e=>(0,Er.jsx)(kU,{...e,stripExperimentalSettings:!0,children:e.children}),CU={name:"u2jump",styles:"position:relative;pointer-events:none;&::after{content:'';position:absolute;top:0;right:0;bottom:0;left:0;}*{pointer-events:none;}"},SU=(0,T.createContext)(!1);SU.displayName="DisabledContext";var AU=SU,{Consumer:IU,Provider:EU}=AU;function jU({className:e,children:t,isDisabled:n=!0,...i}){const r=(0,Pw.l)();return(0,Er.jsx)(EU,{value:n,children:(0,Er.jsx)("div",{inert:n?"true":void 0,className:n?r(CU,e,"components-disabled"):void 0,...i,children:t})})}jU.Context=AU,jU.Consumer=IU;var TU=jU,BU=n(13920),NU="core/pattern-overrides";function RU(e){return e?.__default?.source===NU}function OU(e,t){if(RU(e)){const n={};for(const i of t){const t=e[i]?e[i]:{source:NU};n[i]=t}return n}return e}var LU={},MU=gS("editor.BlockEdit")(e=>{const{name:t}=e,n=bn(t);if(!n)return null;const i=n.edit||n.save;return(0,Er.jsx)(i,{...e})}),PU=e=>{const{name:t,clientId:n,attributes:i,setAttributes:r}=e,o=(0,yt.A)(),s=bn(t),a=(0,T.useContext)(Sj),l=(0,zt.A)(e=>Gh(e(Zi)).getAllBlockBindingsSources(),[]),{bindableAttributes:c}=(0,T.useContext)(Bj),{blockBindings:u,context:d,hasPatternOverrides:h}=(0,T.useMemo)(()=>{const e=s?.usesContext?Object.fromEntries(Object.entries(a).filter(([e])=>s.usesContext.includes(e))):LU;return i?.metadata?.bindings&&Object.values(i?.metadata?.bindings||{}).forEach(t=>{l[t?.source]?.usesContext?.forEach(t=>{e[t]=a[t]})}),{blockBindings:OU(i?.metadata?.bindings,c),context:e,hasPatternOverrides:RU(i?.metadata?.bindings)}},[s?.usesContext,a,i?.metadata?.bindings,c,l]),p=(0,zt.A)(e=>{if(!u)return i;const t={},r=new Map;for(const[e,t]of Object.entries(u)){const{source:n,args:i}=t,o=l[n];o&&c?.includes(e)&&r.set(o,{...r.get(o),[e]:{args:i}})}if(r.size)for(const[i,o]of r){let r={};i.getValues?r=i.getValues({select:e,context:d,clientId:n,bindings:o}):Object.keys(o).forEach(e=>{r[e]=i.label});for(const[e,n]of Object.entries(r))"url"!==e||n&&AA(n)?t[e]=n:t[e]=null}return{...i,...t}},[i,c,u,n,d,l]),f=(0,T.useCallback)(e=>{u?o.batch(()=>{const t={...e},i=new Map;for(const[e,n]of Object.entries(t)){if(!u[e]||!c?.includes(e))continue;const r=u[e],o=l[r?.source];o?.setValues&&(i.set(o,{...i.get(o),[e]:{args:r.args,newValue:n}}),delete t[e])}if(i.size)for(const[e,t]of i)e.setValues({select:o.select,dispatch:o.dispatch,context:d,clientId:n,bindings:t});const s=!!d["pattern/overrides"];h&&s||!Object.keys(t).length||(h&&delete t.href,r(t))}):r(e)},[c,u,n,d,h,r,l,o]);if(!s)return null;if(s.apiVersion>1)return(0,Er.jsx)(MU,{...e,attributes:p,context:d,setAttributes:f});const m=_n(s,"className",!0)?jr(t):null,g=(0,mh.A)(m,i?.className,e.className);return(0,Er.jsx)(MU,{...e,attributes:p,className:g,context:d,setAttributes:f})},DU=function({className:e,actions:t,children:n,secondaryActions:i}){return(0,Er.jsx)("div",{style:{display:"contents",all:"initial"},children:(0,Er.jsx)("div",{className:(0,mh.A)(e,"block-editor-warning"),children:(0,Er.jsxs)("div",{className:"block-editor-warning__contents",children:[(0,Er.jsx)("p",{className:"block-editor-warning__message",children:n}),(t?.length>0||i)&&(0,Er.jsxs)("div",{className:"block-editor-warning__actions",children:[t?.length>0&&t.map((e,t)=>(0,Er.jsx)("span",{className:"block-editor-warning__action",children:e},t)),i&&(0,Er.jsx)(xv.A,{className:"block-editor-warning__secondary",icon:ww.A,label:(0,ee.__)("More options"),popoverProps:{placement:"bottom-end",className:"block-editor-warning__dropdown"},noIcons:!0,children:()=>(0,Er.jsx)(Fv.A,{children:i.map((e,t)=>(0,Er.jsx)(zv.A,{onClick:e.onClick,children:e.title},t))})})]})]})})})};function FU({originalBlockClientId:e,name:t,onReplace:n}){const{selectBlock:i}=(0,Vt.A)(Qy),r=bn(t);return(0,Er.jsxs)(DU,{actions:[(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>i(e),children:(0,ee.__)("Find original")},"find-original"),(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>n([]),children:(0,ee.__)("Remove")},"remove")],children:[(0,Er.jsxs)("strong",{children:[r?.title,": "]}),(0,ee.__)("This block can only be used once.")]})}function zU({mayDisplayControls:e,mayDisplayParentControls:t,mayDisplayPatternEditingControls:n,blockEditingMode:i,isPreviewMode:r,...o}){const{name:s,isSelected:a,clientId:l,attributes:c={},__unstableLayoutClassNames:u}=o,{layout:d=null,metadata:h={}}=c,{bindings:p}=h,f=_n(s,"layout",!1)||_n(s,"__experimentalLayout",!1),m=!!Ih()[wh]||_n(s,"listView")||"core/navigation"===s,{originalBlockClientId:g}=(0,T.useContext)(Bj);return(0,Er.jsxs)(Ah,{value:(0,T.useMemo)(()=>({name:s,isSelected:a,clientId:l,layout:f?d:null,__unstableLayoutClassNames:u,[bh]:e,[yh]:t,[vh]:n&&"disabled"!==i,[_h]:i,[xh]:p,[kh]:r,[wh]:m}),[s,a,l,f,d,u,e,t,n,i,p,r,m]),children:[(0,Er.jsx)(PU,{...o}),g&&(0,Er.jsx)(FU,{originalBlockClientId:g,name:s,onReplace:o.onReplace})]})}var VU=n(87786);function UU({title:e,rawContent:t,renderedContent:n,action:i,actionText:r,className:o}){return(0,Er.jsxs)("div",{className:o,children:[(0,Er.jsxs)("div",{className:"block-editor-block-compare__content",children:[(0,Er.jsx)("h2",{className:"block-editor-block-compare__heading",children:e}),(0,Er.jsx)("div",{className:"block-editor-block-compare__html",children:t}),(0,Er.jsx)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor",children:(0,Er.jsx)(Sr.A,{children:se(n)})})]}),(0,Er.jsx)("div",{className:"block-editor-block-compare__action",children:(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,variant:"secondary",tabIndex:"0",onClick:i,children:r})})]})}var $U=function({block:e,onKeep:t,onConvert:n,convertor:i,convertButtonText:r}){const o=(s=i(e),(Array.isArray(s)?s:[s]).map(e=>Lr(e.name,e.attributes,e.innerBlocks)).join(""));var s;const a=(l=e.originalContent,c=o,(0,VU.JJ)(l,c).map((e,t)=>{const n=(0,mh.A)({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,Er.jsx)("span",{className:n,children:e.value},t)}));var l,c;return(0,Er.jsxs)("div",{className:"block-editor-block-compare__wrapper",children:[(0,Er.jsx)(UU,{title:(0,ee.__)("Current"),className:"block-editor-block-compare__current",action:t,actionText:(0,ee.__)("Convert to HTML"),rawContent:e.originalContent,renderedContent:e.originalContent}),(0,Er.jsx)(UU,{title:(0,ee.__)("After Conversion"),className:"block-editor-block-compare__converted",action:n,actionText:r,rawContent:a,renderedContent:o})]})},HU=e=>ks({HTML:e.originalContent});function WU({clientId:e}){const{block:t,canInsertHTMLBlock:n,canInsertClassicBlock:i}=(0,zt.A)(t=>{const{canInsertBlockType:n,getBlock:i,getBlockRootClientId:r}=t(Qy),o=r(e);return{block:i(e),canInsertHTMLBlock:n("core/html",o),canInsertClassicBlock:n("core/freeform",o)}},[e]),{replaceBlock:r}=(0,Vt.A)(Qy),[o,s]=(0,T.useState)(!1),a=(0,T.useCallback)(()=>s(!1),[]),l=(0,T.useMemo)(()=>({toClassic(){const e=er("core/freeform",{content:t.originalContent});return r(t.clientId,e)},toHTML(){const e=er("core/html",{content:t.originalContent});return r(t.clientId,e)},toBlocks(){const e=HU(t);return r(t.clientId,e)},toRecoveredBlock(){const e=er(t.name,t.attributes,t.innerBlocks);return r(t.clientId,e)}}),[t,r]),c=(0,T.useMemo)(()=>[{title:(0,ee._x)("Resolve","imperative verb"),onClick:()=>s(!0)},n&&{title:(0,ee.__)("Convert to HTML"),onClick:l.toHTML},i&&{title:(0,ee.__)("Convert to Classic Block"),onClick:l.toClassic}].filter(Boolean),[n,i,l]);return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(DU,{actions:[(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,onClick:l.toRecoveredBlock,variant:"primary",children:(0,ee.__)("Attempt recovery")},"recover")],secondaryActions:c,children:(0,ee.__)("Block contains unexpected or invalid content.")}),o&&(0,Er.jsx)(aj.A,{title:(0,ee.__)("Resolve Block"),onRequestClose:a,className:"block-editor-block-compare",children:(0,Er.jsx)($U,{block:t,onKeep:l.toHTML,onConvert:l.toBlocks,convertor:HU,convertButtonText:(0,ee.__)("Convert to Blocks")})})]})}var GU=(0,Er.jsx)(DU,{className:"block-editor-block-list__block-crash-warning",children:(0,ee.__)("This block has encountered an error and cannot be previewed.")});function qU(){return GU}var KU=class extends T.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}},YU=KU,JU=n(90552),XU=function({clientId:e}){const[t,n]=(0,T.useState)(""),i=(0,zt.A)(t=>t(Qy).getBlock(e),[e]),{updateBlock:r}=(0,Vt.A)(Qy),o=(0,T.useMemo)(()=>i?Mr(i):"",[i]);return(0,T.useEffect)(()=>{n(o)},[o]),(0,Er.jsx)(JU,{className:"block-editor-block-list__block-html-textarea",value:t,onBlur:()=>{const o=bn(i.name);if(!o)return;const s=Bo(o,t,i.attributes),a=t||Lr(o,s),[l]=t?go({...i,attributes:s,originalContent:a}):[!0];r(e,{attributes:s,originalContent:a,isValid:l}),t||n(a)},onChange:e=>n(e.target.value)})};function ZU({isDisabled:e=!1}={}){return(0,bt.A)(t=>{if(e)return;const n=t?.ownerDocument?.defaultView;if(!n)return;const i=[],r=()=>{t.childNodes.forEach(e=>{e instanceof n.HTMLElement&&(e.getAttribute("inert")||(e.setAttribute("inert","true"),i.push(()=>{e.removeAttribute("inert")})))})},o=(0,mS.s)(r,0,{leading:!0});r();const s=new window.MutationObserver(o);return s.observe(t,{childList:!0}),()=>{s&&s.disconnect(),o.cancel(),i.forEach(e=>e())}},[e])}var QU=m$(),e$=e=>d$(e,QU),t$=m$();e$.write=e=>d$(e,t$);var n$=m$();e$.onStart=e=>d$(e,n$);var i$=m$();e$.onFrame=e=>d$(e,i$);var r$=m$();e$.onFinish=e=>d$(e,r$);var o$=[];e$.setTimeout=(e,t)=>{let n=e$.now()+t,i=()=>{let e=o$.findIndex(e=>e.cancel==i);~e&&o$.splice(e,1),c$-=~e?1:0},r={time:n,handler:e,cancel:i};return o$.splice(s$(n),0,r),c$+=1,h$(),r};var s$=e=>~(~o$.findIndex(t=>t.time>e)||~o$.length);e$.cancel=e=>{n$.delete(e),i$.delete(e),r$.delete(e),QU.delete(e),t$.delete(e)},e$.sync=e=>{u$=!0,e$.batchedUpdates(e),u$=!1},e$.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function i(...e){t=e,e$.onStart(n)}return i.handler=e,i.cancel=()=>{n$.delete(n),t=null},i};var a$=typeof window<"u"?window.requestAnimationFrame:()=>{};e$.use=e=>a$=e,e$.now=typeof performance<"u"?()=>performance.now():Date.now,e$.batchedUpdates=e=>e(),e$.catch=console.error,e$.frameLoop="always",e$.advance=()=>{"demand"!==e$.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):f$()};var l$=-1,c$=0,u$=!1;function d$(e,t){u$?(t.delete(e),e(0)):(t.add(e),h$())}function h$(){l$<0&&(l$=0,"demand"!==e$.frameLoop&&a$(p$))}function p$(){~l$&&(a$(p$),e$.batchedUpdates(f$))}function f$(){let e=l$;l$=e$.now();let t=s$(l$);t&&(g$(o$.splice(0,t),e=>e.handler()),c$-=t),c$?(n$.flush(),QU.flush(e?Math.min(64,l$-e):16.667),i$.flush(),t$.flush(),r$.flush()):l$=-1}function m$(){let e=new Set,t=e;return{add(n){c$+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(c$-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,c$-=t.size,g$(t,t=>t(n)&&e.add(t)),c$+=e.size,t=e)}}}function g$(e,t){e.forEach(e=>{try{t(e)}catch(e){e$.catch(e)}})}var b$=Object.defineProperty,y$={};function v$(){}((e,t)=>{for(var n in t)b$(e,n,{get:t[n],enumerable:!0})})(y$,{assign:()=>R$,colors:()=>T$,createStringInterpolator:()=>A$,skipAnimation:()=>B$,to:()=>I$,willAdvance:()=>N$});var _$={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 x$(e,t){if(_$.arr(e)){if(!_$.arr(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}var k$=(e,t)=>e.forEach(t);function w$(e,t,n){if(_$.arr(e))for(let i=0;i<e.length;i++)t.call(n,e[i],`${i}`);else for(let i in e)e.hasOwnProperty(i)&&t.call(n,e[i],i)}var C$=e=>_$.und(e)?[]:_$.arr(e)?e:[e];function S$(e,t){if(e.size){let n=Array.from(e);e.clear(),k$(n,t)}}var A$,I$,E$=(e,...t)=>S$(e,e=>e(...t)),j$=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),T$=null,B$=!1,N$=v$,R$=e=>{e.to&&(I$=e.to),e.now&&(e$.now=e.now),void 0!==e.colors&&(T$=e.colors),null!=e.skipAnimation&&(B$=e.skipAnimation),e.createStringInterpolator&&(A$=e.createStringInterpolator),e.requestAnimationFrame&&e$.use(e.requestAnimationFrame),e.batchedUpdates&&(e$.batchedUpdates=e.batchedUpdates),e.willAdvance&&(N$=e.willAdvance),e.frameLoop&&(e$.frameLoop=e.frameLoop)},O$=new Set,L$=[],M$=[],P$=0,D$={get idle(){return!O$.size&&!L$.length},start(e){P$>e.priority?(O$.add(e),e$.onStart(F$)):(z$(e),e$(U$))},advance:U$,sort(e){if(P$)e$.onFrame(()=>D$.sort(e));else{let t=L$.indexOf(e);~t&&(L$.splice(t,1),V$(e))}},clear(){L$=[],O$.clear()}};function F$(){O$.forEach(z$),O$.clear(),e$(U$)}function z$(e){L$.includes(e)||V$(e)}function V$(e){L$.splice(function(e,t){let n=e.findIndex(t);return n<0?e.length:n}(L$,t=>t.priority>e.priority),0,e)}function U$(e){let t=M$;for(let n=0;n<L$.length;n++){let i=L$[n];P$=i.priority,i.idle||(N$(i),i.advance(e),i.idle||t.push(i))}return P$=0,(M$=L$).length=0,(L$=t).length>0}var $$="[-+]?\\d*\\.?\\d+",H$=$$+"%";function W$(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var G$=new RegExp("rgb"+W$($$,$$,$$)),q$=new RegExp("rgba"+W$($$,$$,$$,$$)),K$=new RegExp("hsl"+W$($$,H$,H$)),Y$=new RegExp("hsla"+W$($$,H$,H$,$$)),J$=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,X$=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Z$=/^#([0-9a-fA-F]{6})$/,Q$=/^#([0-9a-fA-F]{8})$/;function eH(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 tH(e,t,n){let i=n<.5?n*(1+t):n+t-n*t,r=2*n-i,o=eH(r,i,e+1/3),s=eH(r,i,e),a=eH(r,i,e-1/3);return Math.round(255*o)<<24|Math.round(255*s)<<16|Math.round(255*a)<<8}function nH(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function iH(e){return(parseFloat(e)%360+360)%360/360}function rH(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function oH(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function sH(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Z$.exec(e))?parseInt(t[1]+"ff",16)>>>0:T$&&void 0!==T$[e]?T$[e]:(t=G$.exec(e))?(nH(t[1])<<24|nH(t[2])<<16|nH(t[3])<<8|255)>>>0:(t=q$.exec(e))?(nH(t[1])<<24|nH(t[2])<<16|nH(t[3])<<8|rH(t[4]))>>>0:(t=J$.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=Q$.exec(e))?parseInt(t[1],16)>>>0:(t=X$.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=K$.exec(e))?(255|tH(iH(t[1]),oH(t[2]),oH(t[3])))>>>0:(t=Y$.exec(e))?(tH(iH(t[1]),oH(t[2]),oH(t[3]))|rH(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 aH=(e,t,n)=>{if(_$.fun(e))return e;if(_$.arr(e))return aH({range:e,output:t,extrapolate:n});if(_$.str(e.output[0]))return A$(e);let i=e,r=i.output,o=i.range||[0,1],s=i.extrapolateLeft||i.extrapolate||"extend",a=i.extrapolateRight||i.extrapolate||"extend",l=i.easing||(e=>e);return e=>{let t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,o);return function(e,t,n,i,r,o,s,a,l){let c=l?l(e):e;if(c<t){if("identity"===s)return c;"clamp"===s&&(c=t)}if(c>n){if("identity"===a)return c;"clamp"===a&&(c=n)}return i===r?i:t===n?e<=t?i:r:(t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t),c=o(c),i===-1/0?c=-c:r===1/0?c+=i:c=c*(r-i)+i,c)}(e,o[t],o[t+1],r[t],r[t+1],l,s,a,i.map)}},lH=1.70158,cH=1.525*lH,uH=lH+1,dH=2*Math.PI/3,hH=2*Math.PI/4.5,pH=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,fH={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=>uH*e*e*e-lH*e*e,easeOutBack:e=>1+uH*Math.pow(e-1,3)+lH*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(2*(cH+1)*e-cH)/2:(Math.pow(2*e-2,2)*((cH+1)*(2*e-2)+cH)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*dH),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*dH)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*hH)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*hH)/2+1,easeInBounce:e=>1-pH(1-e),easeOutBounce:pH,easeInOutBounce:e=>e<.5?(1-pH(1-2*e))/2:(1+pH(2*e-1))/2,steps:(e,t="end")=>n=>{let i=(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(i):Math.ceil(i))/e)}},mH=Symbol.for("FluidValue.get"),gH=Symbol.for("FluidValue.observers"),bH=e=>Boolean(e&&e[mH]),yH=e=>e&&e[mH]?e[mH]():e,vH=e=>e[gH]||null;function _H(e,t){let n=e[gH];n&&n.forEach(e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)})}var xH=class{[mH];[gH];constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");kH(this,e)}},kH=(e,t)=>AH(e,mH,t);function wH(e,t){if(e[mH]){let n=e[gH];n||AH(e,gH,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function CH(e,t){let n=e[gH];if(n&&n.has(t)){let i=n.size-1;i?n.delete(t):e[gH]=null,e.observerRemoved&&e.observerRemoved(i,t)}}var SH,AH=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),IH=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,EH=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,jH=new RegExp(`(${IH.source})(%|[a-z]+)`,"i"),TH=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,BH=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,NH=e=>{let[t,n]=RH(e);if(!t||j$())return e;let i=window.getComputedStyle(document.documentElement).getPropertyValue(t);return i?i.trim():n&&n.startsWith("--")?window.getComputedStyle(document.documentElement).getPropertyValue(n)||e:n&&BH.test(n)?NH(n):n||e},RH=e=>{let t=BH.exec(e);if(!t)return[,];let[,n,i]=t;return[n,i]},OH=(e,t,n,i,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(i)}, ${r})`,LH=e=>{SH||(SH=T$?new RegExp(`(${Object.keys(T$).join("|")})(?!\\w)`,"g"):/^\b$/);let t=e.output.map(e=>yH(e).replace(BH,NH).replace(EH,sH).replace(SH,sH)),n=t.map(e=>e.match(IH).map(Number)),i=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=>aH({...e,output:t}));return e=>{let n=!jH.test(t[0])&&t.find(e=>jH.test(e))?.replace(IH,""),r=0;return t[0].replace(IH,()=>`${i[r++](e)}${n||""}`).replace(TH,OH)}},MH="react-spring: ",PH=e=>{let t=e,n=!1;if("function"!=typeof t)throw new TypeError(`${MH}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},DH=PH(console.warn);function FH(e){return _$.str(e)&&("#"==e[0]||/\d/.test(e)||!j$()&&BH.test(e)||e in(T$||{}))}PH(console.warn),new WeakMap,new Set,new WeakMap,new WeakMap,new WeakMap;var zH=j$()?T.useEffect:T.useLayoutEffect;var VH=[],UH=Symbol.for("Animated:node"),$H=e=>e&&e[UH],HH=(e,t)=>((e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}))(e,UH,t),WH=e=>e&&e[UH]&&e[UH].getPayload(),GH=class{payload;constructor(){HH(this,this)}getPayload(){return this.payload||[]}},qH=class extends GH{constructor(e){super(),this._value=e,_$.num(this._value)&&(this.lastPosition=this._value)}done=!0;elapsedTime;lastPosition;lastVelocity;v0;durationProgress=0;static create(e){return new qH(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return _$.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,_$.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},KH=class extends qH{_string=null;_toString;constructor(e){super(0),this._toString=aH({output:[e,e]})}static create(e){return new KH(e)}getValue(){return this._string??(this._string=this._toString(this._value))}setValue(e){if(_$.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=aH({output:[this.getValue(),e]})),this._value=0,super.reset()}},YH={dependencies:null},JH=class extends GH{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){let t={};return w$(this.source,(n,i)=>{var r;(r=n)&&r[UH]===r?t[i]=n.getValue(e):bH(n)?t[i]=yH(n):e||(t[i]=n)}),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&k$(this.payload,e=>e.reset())}_makePayload(e){if(e){let t=new Set;return w$(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){YH.dependencies&&bH(e)&&YH.dependencies.add(e);let t=WH(e);t&&k$(t,e=>this.add(e))}},XH=class extends JH{constructor(e){super(e)}static create(e){return new XH(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(ZH)),!0)}};function ZH(e){return(FH(e)?KH:qH).create(e)}function QH(e){let t=$H(e);return t?t.constructor:_$.arr(e)?XH:FH(e)?KH:qH}var eW=(e,t)=>{let n=!_$.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,T.forwardRef)((i,r)=>{let o=(0,T.useRef)(null),s=n&&(0,T.useCallback)(e=>{o.current=function(e,t){return e&&(_$.fun(e)?e(t):e.current=t),t}(r,e)},[r]),[a,l]=function(e,t){let n=new Set;return YH.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new JH(e),YH.dependencies=null,[e,n]}(i,t),c=function(){let e=(0,T.useState)()[1],t=(()=>{let e=(0,T.useRef)(!1);return zH(()=>(e.current=!0,()=>{e.current=!1}),[]),e})();return()=>{t.current&&e(Math.random())}}(),u=()=>{let e=o.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,a.getValue(!0)))&&c()},d=new tW(u,l),h=(0,T.useRef)();zH(()=>(h.current=d,k$(l,e=>wH(e,d)),()=>{h.current&&(k$(h.current.deps,e=>CH(e,h.current)),e$.cancel(h.current.update))})),(0,T.useEffect)(u,[]),(0,T.useEffect)(()=>()=>{let e=h.current;k$(e.deps,t=>CH(t,e))},VH);let p=t.getComponentProps(a.getValue());return T.createElement(e,{...p,ref:s})})},tW=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&e$.write(this.update)}},nW=Symbol.for("AnimatedComponent"),iW=e=>_$.str(e)?e:e&&_$.str(e.displayName)?e.displayName:_$.fun(e)&&e.name||null;function rW(e,...t){return _$.fun(e)?e(...t):e}var oW=(e,t)=>!0===e||!!(t&&e&&(_$.fun(e)?e(t):C$(e).includes(t))),sW=(e,t)=>_$.obj(e)?t&&e[t]:e,aW=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,lW=e=>e,cW=(e,t=lW)=>{let n=uW;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));let i={};for(let r of n){let n=t(e[r],r);_$.und(n)||(i[r]=n)}return i},uW=["config","onProps","onStart","onChange","onPause","onResume","onRest"],dW={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 hW(e){let t=function(e){let t={},n=0;if(w$(e,(e,i)=>{dW[i]||(t[i]=e,n++)}),n)return t}(e);if(t){let n={to:t};return w$(e,(e,i)=>i in t||(n[i]=e)),n}return{...e}}function pW(e){return e=yH(e),_$.arr(e)?e.map(pW):FH(e)?y$.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function fW(e){return _$.fun(e)||_$.arr(e)&&_$.obj(e[0])}var mW={tension:170,friction:26,mass:1,damping:1,easing:fH.linear,clamp:!1},gW=class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,mW)}};function bW(e,t){if(_$.und(t.decay)){let n=!_$.und(t.tension)||!_$.und(t.friction);(n||!_$.und(t.frequency)||!_$.und(t.damping)||!_$.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}var yW=[],vW=class{changed=!1;values=yW;toValues=null;fromValues=yW;to;from;config=new gW;immediate=!1};function _W(e,{key:t,props:n,defaultProps:i,state:r,actions:o}){return new Promise((s,a)=>{let l,c,u=oW(n.cancel??i?.cancel,t);if(u)p();else{_$.und(n.pause)||(r.paused=oW(n.pause,t));let e=i?.pause;!0!==e&&(e=r.paused||oW(e,t)),l=rW(n.delay||0,t),e?(r.resumeQueue.add(h),o.pause()):(o.resume(),h())}function d(){r.resumeQueue.add(h),r.timeouts.delete(c),c.cancel(),l=c.time-e$.now()}function h(){l>0&&!y$.skipAnimation?(r.delayed=!0,c=e$.setTimeout(p,l),r.pauseQueue.add(d),r.timeouts.add(c)):p()}function p(){r.delayed&&(r.delayed=!1),r.pauseQueue.delete(d),r.timeouts.delete(c),e<=(r.cancelId||0)&&(u=!0);try{o.start({...n,callId:e,cancel:u},s)}catch(e){a(e)}}})}var xW=(e,t)=>1==t.length?t[0]:t.some(e=>e.cancelled)?CW(e.get()):t.every(e=>e.noop)?kW(e.get()):wW(e.get(),t.every(e=>e.finished)),kW=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),wW=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),CW=e=>({value:e,cancelled:!0,finished:!1});function SW(e,t,n,i){let{callId:r,parentId:o,onRest:s}=t,{asyncTo:a,promise:l}=n;return o||e!==a||t.reset?n.promise=(async()=>{n.asyncId=r,n.asyncTo=e;let c,u,d,h=cW(t,(e,t)=>"onRest"===t?void 0:e),p=new Promise((e,t)=>(c=e,u=t)),f=e=>{let t=r<=(n.cancelId||0)&&CW(i)||r!==n.asyncId&&wW(i,!1);if(t)throw e.result=t,u(e),e},m=(e,t)=>{let o=new IW,s=new EW;return(async()=>{if(y$.skipAnimation)throw AW(n),s.result=wW(i,!1),u(s),s;f(o);let a=_$.obj(e)?{...e}:{...t,to:e};a.parentId=r,w$(h,(e,t)=>{_$.und(a[t])&&(a[t]=e)});let l=await i.start(a);return f(o),n.paused&&await new Promise(e=>{n.resumeQueue.add(e)}),l})()};if(y$.skipAnimation)return AW(n),wW(i,!1);try{let t;t=_$.arr(e)?(async e=>{for(let t of e)await m(t)})(e):Promise.resolve(e(m,i.stop.bind(i))),await Promise.all([t.then(c),p]),d=wW(i.get(),!0,!1)}catch(e){if(e instanceof IW)d=e.result;else{if(!(e instanceof EW))throw e;d=e.result}}finally{r==n.asyncId&&(n.asyncId=o,n.asyncTo=o?a:void 0,n.promise=o?l:void 0)}return _$.fun(s)&&e$.batchedUpdates(()=>{s(d,i,i.item)}),d})():l}function AW(e,t){S$(e.timeouts,e=>e.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var IW=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.")}},EW=class extends Error{result;constructor(){super("SkipAnimationSignal")}},jW=e=>e instanceof BW,TW=1,BW=class extends xH{id=TW++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=$H(this);return e&&e.getValue()}to(...e){return y$.to(this,e)}interpolate(...e){return DH(`${MH}The "interpolate" function is deprecated in v9 (use "to" instead)`),y$.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){_H(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||D$.sort(this),_H(this,{type:"priority",parent:this,priority:e})}},NW=Symbol.for("SpringPhase"),RW=e=>(1&e[NW])>0,OW=e=>(2&e[NW])>0,LW=e=>(4&e[NW])>0,MW=(e,t)=>t?e[NW]|=3:e[NW]&=-3,PW=(e,t)=>t?e[NW]|=4:e[NW]&=-5,DW=class extends BW{key;animation=new vW;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(),!_$.und(e)||!_$.und(t)){let n=_$.obj(e)?{...e}:{...t,from:e};_$.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(OW(this)||this._state.asyncTo)||LW(this)}get goal(){return yH(this.animation.to)}get velocity(){let e=$H(this);return e instanceof qH?e.lastVelocity||0:e.getPayload().map(e=>e.lastVelocity||0)}get hasAnimated(){return RW(this)}get isAnimating(){return OW(this)}get isPaused(){return LW(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1,i=this.animation,{config:r,toValues:o}=i,s=WH(i.to);!s&&bH(i.to)&&(o=C$(yH(i.to))),i.values.forEach((a,l)=>{if(a.done)return;let c=a.constructor==KH?1:s?s[l].lastPosition:o[l],u=i.immediate,d=c;if(!u){if(d=a.lastPosition,r.tension<=0)return void(a.done=!0);let t,n=a.elapsedTime+=e,o=i.fromValues[l],s=null!=a.v0?a.v0:a.v0=_$.arr(r.velocity)?r.velocity[l]:r.velocity,h=r.precision||(o==c?.005:Math.min(1,.001*Math.abs(c-o)));if(_$.und(r.duration))if(r.decay){let e=!0===r.decay?.998:r.decay,i=Math.exp(-(1-e)*n);d=o+s/(1-e)*(1-i),u=Math.abs(a.lastPosition-d)<=h,t=s*i}else{t=null==a.lastVelocity?s:a.lastVelocity;let n,i=r.restVelocity||h/10,l=r.clamp?0:r.bounce,p=!_$.und(l),f=o==c?a.v0>0:o<c,m=!1,g=1,b=Math.ceil(e/g);for(let e=0;e<b&&(n=Math.abs(t)>i,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*-r.tension*(d-c)+.001*-r.friction*t)/r.mass*g,d+=t*g}else{let i=1;r.duration>0&&(this._memoizedDuration!==r.duration&&(this._memoizedDuration=r.duration,a.durationProgress>0&&(a.elapsedTime=r.duration*a.durationProgress,n=a.elapsedTime+=e)),i=(r.progress||0)+n/this._memoizedDuration,i=i>1?1:i<0?0:i,a.durationProgress=i),d=o+r.easing(i)*(c-o),t=(d-a.lastPosition)/e,u=1==i}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,r.round)&&(n=!0)});let a=$H(this),l=a.getValue();if(t){let e=yH(i.to);l===e&&!n||r.decay?n&&r.decay&&this._onChange(l):(a.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(l)}set(e){return e$.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(OW(this)){let{to:e,config:t}=this.animation;e$.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 _$.und(e)?(n=this.queue||[],this.queue=[]):n=[_$.obj(e)?e:{...t,to:e}],Promise.all(n.map(e=>this._update(e))).then(e=>xW(this,e))}stop(e){let{to:t}=this.animation;return this._focus(this.get()),AW(this._state,e&&this._lastCallId),e$.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:i}=e;n=_$.obj(n)?n[t]:n,(null==n||fW(n))&&(n=void 0),i=_$.obj(i)?i[t]:i,null==i&&(i=void 0);let r={to:n,from:i};return RW(this)||(e.reverse&&([n,i]=[i,n]),i=yH(i),_$.und(i)?$H(this)||this._set(n):this._set(i)),r}_update({...e},t){let{key:n,defaultProps:i}=this;e.default&&Object.assign(i,cW(e,(e,t)=>/^on/.test(t)?sW(e,n):e)),HW(this,e,"onProps"),WW(this,"onProps",e,this);let r=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let o=this._state;return _W(++this._lastCallId,{key:n,props:e,defaultProps:i,state:o,actions:{pause:()=>{LW(this)||(PW(this,!0),E$(o.pauseQueue),WW(this,"onPause",wW(this,FW(this,this.animation.to)),this))},resume:()=>{LW(this)&&(PW(this,!1),OW(this)&&this._resume(),E$(o.resumeQueue),WW(this,"onResume",wW(this,FW(this,this.animation.to)),this))},start:this._merge.bind(this,r)}}).then(n=>{if(e.loop&&n.finished&&(!t||!n.noop)){let t=zW(e);if(t)return this._update(t,!0)}return n})}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(CW(this));let i=!_$.und(e.to),r=!_$.und(e.from);if(i||r){if(!(t.callId>this._lastToId))return n(CW(this));this._lastToId=t.callId}let{key:o,defaultProps:s,animation:a}=this,{to:l,from:c}=a,{to:u=l,from:d=c}=e;r&&!i&&(!t.default||_$.und(u))&&(u=d),t.reverse&&([u,d]=[d,u]);let h=!x$(d,c);h&&(a.from=d),d=yH(d);let p=!x$(u,l);p&&this._focus(u);let f=fW(t.to),{config:m}=a,{decay:g,velocity:b}=m;(i||r)&&(m.velocity=0),t.config&&!f&&function(e,t,n){n&&(bW(n={...n},t),t={...n,...t}),bW(e,t),Object.assign(e,t);for(let t in mW)null==e[t]&&(e[t]=mW[t]);let{mass:i,frequency:r,damping:o}=e;_$.und(r)||(r<.01&&(r=.01),o<0&&(o=0),e.tension=Math.pow(2*Math.PI/r,2)*i,e.friction=4*Math.PI*o*i/r)}(m,rW(t.config,o),t.config!==s.config?rW(s.config,o):void 0);let y=$H(this);if(!y||_$.und(u))return n(wW(this,!0));let v=_$.und(t.reset)?r&&!t.default:!_$.und(d)&&oW(t.reset,o),_=v?d:this.get(),x=pW(u),k=_$.num(x)||_$.arr(x)||FH(x),w=!f&&(!k||oW(s.immediate||t.immediate,o));if(p){let e=QH(u);if(e!==y.constructor){if(!w)throw Error(`Cannot animate between ${y.constructor.name} and ${e.name}, as the "to" prop suggests`);y=this._set(x)}}let C=y.constructor,S=bH(u),A=!1;if(!S){let e=v||!RW(this)&&h;(p||e)&&(A=x$(pW(_),x),S=!A),(!x$(a.immediate,w)&&!w||!x$(m.decay,g)||!x$(m.velocity,b))&&(S=!0)}if(A&&OW(this)&&(a.changed&&!v?S=!0:S||this._stop(l)),!f&&((S||bH(l))&&(a.values=y.getPayload(),a.toValues=bH(u)?null:C==KH?[1]:C$(x)),a.immediate!=w&&(a.immediate=w,!w&&!v&&this._set(l)),S)){let{onRest:e}=a;k$($W,e=>HW(this,t,e));let i=wW(this,FW(this,l));E$(this._pendingCalls,i),this._pendingCalls.add(n),a.changed&&e$.batchedUpdates(()=>{a.changed=!v,e?.(i,this),v?rW(s.onRest,i):a.onStart?.(i,this)})}v&&this._set(_),f?n(SW(t.to,t,this._state,this)):S?this._start():OW(this)&&!p?this._pendingCalls.add(n):n(kW(_))}_focus(e){let t=this.animation;e!==t.to&&(vH(this)&&this._detach(),t.to=e,vH(this)&&this._attach())}_attach(){let e=0,{to:t}=this.animation;bH(t)&&(wH(t,this),jW(t)&&(e=t.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;bH(e)&&CH(e,this)}_set(e,t=!0){let n=yH(e);if(!_$.und(n)){let e=$H(this);if(!e||!x$(n,e.getValue())){let i=QH(n);e&&e.constructor==i?e.setValue(n):HH(this,i.create(n)),e&&e$.batchedUpdates(()=>{this._onChange(n,t)})}}return $H(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,WW(this,"onStart",wW(this,FW(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),rW(this.animation.onChange,e,this)),rW(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){let e=this.animation;$H(this).reset(yH(e.to)),e.immediate||(e.fromValues=e.values.map(e=>e.lastPosition)),OW(this)||(MW(this,!0),LW(this)||this._resume())}_resume(){y$.skipAnimation?this.finish():D$.start(this)}_stop(e,t){if(OW(this)){MW(this,!1);let n=this.animation;k$(n.values,e=>{e.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),_H(this,{type:"idle",parent:this});let i=t?CW(this.get()):wW(this.get(),FW(this,e??n.to));E$(this._pendingCalls,i),n.changed&&(n.changed=!1,WW(this,"onRest",i,this))}}};function FW(e,t){let n=pW(t);return x$(pW(e.get()),n)}function zW(e,t=e.loop,n=e.to){let i=rW(t);if(i){let r=!0!==i&&hW(i),o=(r||e).reverse,s=!r||r.reset;return VW({...e,loop:t,default:!1,pause:void 0,to:!o||fW(n)?n:void 0,from:s?e.from:void 0,reset:s,...r})}}function VW(e){let{to:t,from:n}=e=hW(e),i=new Set;return _$.obj(t)&&UW(t,i),_$.obj(n)&&UW(n,i),e.keys=i.size?Array.from(i):null,e}function UW(e,t){w$(e,(e,n)=>null!=e&&t.add(n))}var $W=["onStart","onRest","onChange","onPause","onResume"];function HW(e,t,n){e.animation[n]=t[n]!==aW(t,n)?sW(t[n],e.key):void 0}function WW(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var GW=["onStart","onChange","onRest"],qW=1,KW=class{id=qW++;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];_$.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(VW(e)),this}start(e){let{queue:t}=this;return e?t=C$(e).map(VW):this.queue=[],this._flush?this._flush(this,t):(JW(this,t),function(e,t){return Promise.all(t.map(t=>YW(e,t))).then(t=>xW(e,t))}(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){let n=this.springs;k$(C$(t),t=>n[t].stop(!!e))}else AW(this._state,this._lastAsyncId),this.each(t=>t.stop(!!e));return this}pause(e){if(_$.und(e))this.start({pause:!0});else{let t=this.springs;k$(C$(e),e=>t[e].pause())}return this}resume(e){if(_$.und(e))this.start({pause:!1});else{let t=this.springs;k$(C$(e),e=>t[e].resume())}return this}each(e){w$(this.springs,e)}_onFrame(){let{onStart:e,onChange:t,onRest:n}=this._events,i=this._active.size>0,r=this._changed.size>0;(i&&!this._started||r&&!this._started)&&(this._started=!0,S$(e,([e,t])=>{t.value=this.get(),e(t,this,this._item)}));let o=!i&&this._started,s=r||o&&n.size?this.get():null;r&&t.size&&S$(t,([e,t])=>{t.value=s,e(t,this,this._item)}),o&&(this._started=!1,S$(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)}e$.onFrame(this._onFrame)}};async function YW(e,t,n){let{keys:i,to:r,from:o,loop:s,onRest:a,onResolve:l}=t,c=_$.obj(t.default)&&t.default;s&&(t.loop=!1),!1===r&&(t.to=null),!1===o&&(t.from=null);let u=_$.arr(r)||_$.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):k$(GW,n=>{let i=t[n];if(_$.fun(i)){let r=e._events[n];t[n]=({finished:e,cancelled:t})=>{let n=r.get(i);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):r.set(i,{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,E$(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);let h=(i||Object.keys(e.springs)).map(n=>e.springs[n].start(t)),p=!0===t.cancel||!0===aW(t,"cancel");(u||p&&d.asyncId)&&h.push(_W(++e._lastAsyncId,{props:t,state:d,actions:{pause:v$,resume:v$,start(t,n){p?(AW(d,e._lastAsyncId),n(CW(e))):(t.onRest=a,n(SW(u,t,d,e)))}}})),d.paused&&await new Promise(e=>{d.resumeQueue.add(e)});let f=xW(e,await Promise.all(h));if(s&&f.finished&&(!n||!f.noop)){let n=zW(t,s,r);if(n)return JW(e,[n]),YW(e,n,!0)}return l&&e$.batchedUpdates(()=>l(f,e,e.item)),f}function JW(e,t){k$(t,t=>{!function(e,t,n){t.keys&&k$(t.keys,i=>{(e[i]||(e[i]=n(i)))._prepareNode(t)})}(e.springs,t,t=>function(e,t){let n=new DW;return n.key=e,t&&wH(n,t),n}(t,e))})}var XW=({children:e,...t})=>{let n=(0,T.useContext)(ZW),i=t.pause||!!n.pause,r=t.immediate||!!n.immediate;t=function(e,t){let[n]=(0,T.useState)(()=>({inputs:t,result:e()})),i=(0,T.useRef)(),r=i.current,o=r;return o?Boolean(t&&o.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,o.inputs))||(o={inputs:t,result:e()}):o=n,(0,T.useEffect)(()=>{i.current=o,r==n&&(n.inputs=n.result=void 0)},[o]),o.result}(()=>({pause:i,immediate:r}),[i,r]);let{Provider:o}=ZW;return T.createElement(o,{value:t},e)},ZW=function(e){return Object.assign(e,T.createContext({})),e.Provider._context=e,e.Consumer._context=e,e}(XW);XW.Provider=ZW.Provider,XW.Consumer=ZW.Consumer;var QW=class extends BW{constructor(e,t){super(),this.source=e,this.calc=aH(...t);let n=this._get(),i=QH(n);HH(this,i.create(n))}key;idle=!0;calc;_active=new Set;advance(e){let t=this._get();x$(t,this.get())||($H(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&tG(this._active)&&nG(this)}_get(){let e=_$.arr(this.source)?this.source.map(yH):C$(yH(this.source));return this.calc(...e)}_start(){this.idle&&!tG(this._active)&&(this.idle=!1,k$(WH(this),e=>{e.done=!1}),y$.skipAnimation?(e$.batchedUpdates(()=>this.advance()),nG(this)):D$.start(this))}_attach(){let e=1;k$(C$(this.source),t=>{bH(t)&&wH(t,this),jW(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){k$(C$(this.source),e=>{bH(e)&&CH(e,this)}),this._active.clear(),nG(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=C$(this.source).reduce((e,t)=>Math.max(e,(jW(t)?t.priority:0)+1),0))}};function eG(e){return!1!==e.idle}function tG(e){return!e.size||Array.from(e).every(eG)}function nG(e){e.idle||(e.idle=!0,k$(WH(e),e=>{e.done=!0}),_H(e,{type:"idle",parent:e}))}y$.assign({createStringInterpolator:LH,to:(e,t)=>new QW(e,t)}),D$.advance;var iG=/^--/;function rG(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||iG.test(e)||sG.hasOwnProperty(e)&&sG[e]?(""+t).trim():t+"px"}var oG={},sG={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},aG=["Webkit","Ms","Moz","O"];sG=Object.keys(sG).reduce((e,t)=>(aG.forEach(n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t]),e),sG);var lG=/^(matrix|translate|scale|rotate|skew)/,cG=/^(translate)/,uG=/^(rotate|skew)/,dG=(e,t)=>_$.num(e)&&0!==e?e+t:e,hG=(e,t)=>_$.arr(e)?e.every(e=>hG(e,t)):_$.num(e)?e===t:parseFloat(e)===t,pG=class extends JH{constructor({x:e,y:t,z:n,...i}){let r=[],o=[];(e||t||n)&&(r.push([e||0,t||0,n||0]),o.push(e=>[`translate3d(${e.map(e=>dG(e,"px")).join(",")})`,hG(e,0)])),w$(i,(e,t)=>{if("transform"===t)r.push([e||""]),o.push(e=>[e,""===e]);else if(lG.test(t)){if(delete i[t],_$.und(e))return;let n=cG.test(t)?"px":uG.test(t)?"deg":"";r.push(C$(e)),o.push("rotate3d"===t?([e,t,i,r])=>[`rotate3d(${e},${t},${i},${dG(r,n)})`,hG(r,0)]:e=>[`${t}(${e.map(e=>dG(e,n)).join(",")})`,hG(e,t.startsWith("scale")?1:0)])}}),r.length&&(i.transform=new fG(r,o)),super(i)}},fG=class extends xH{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 k$(this.inputs,(n,i)=>{let r=yH(n[0]),[o,s]=this.transforms[i](_$.arr(r)?r:n.map(yH));e+=" "+o,t=t&&s}),t?"none":e}observerAdded(e){1==e&&k$(this.inputs,e=>k$(e,e=>bH(e)&&wH(e,this)))}observerRemoved(e){0==e&&k$(this.inputs,e=>k$(e,e=>bH(e)&&CH(e,this)))}eventObserved(e){"change"==e.type&&(this._value=null),_H(this,e)}};y$.assign({batchedUpdates:Wj.unstable_batchedUpdates,createStringInterpolator:LH,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 mG=((e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:n=e=>new JH(e),getComponentProps:i=e=>e}={})=>{let r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:i},o=e=>{let t=iW(e)||"Anonymous";return(e=_$.str(e)?o[e]||(o[e]=eW(e,r)):e[nW]||(e[nW]=eW(e,r))).displayName=`Animated(${t})`,e};return w$(e,(t,n)=>{_$.arr(e)&&(n=iW(t)),o[n]=o(t)}),{animated:o}})(["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:i,children:r,scrollTop:o,scrollLeft:s,viewBox:a,...l}=t,c=Object.values(l),u=Object.keys(l).map(t=>n||e.hasAttribute(t)?t:oG[t]||(oG[t]=t.replace(/([A-Z])/g,e=>"-"+e.toLowerCase())));void 0!==r&&(e.textContent=r);for(let t in i)if(i.hasOwnProperty(t)){let n=rG(t,i[t]);iG.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach((t,n)=>{e.setAttribute(t,c[n])}),void 0!==o&&(e.scrollTop=o),void 0!==s&&(e.scrollLeft=s),void 0!==a&&e.setAttribute("viewBox",a)},createAnimatedStyle:e=>new pG(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),gG=mG.animated;function bG(e){return{top:e.offsetTop,left:e.offsetLeft}}var yG=function({triggerAnimationOnChange:e,clientId:t}){const n=(0,T.useRef)(),{isTyping:i,getGlobalBlockCount:r,isBlockSelected:o,isFirstMultiSelectedBlock:s,isBlockMultiSelected:a,isAncestorMultiSelected:l,isDraggingBlocks:c}=(0,zt.A)(Qy),{previous:u,prevRect:d}=(0,T.useMemo)(()=>({previous:n.current&&bG(n.current),prevRect:n.current&&n.current.getBoundingClientRect()}),[e]);return(0,T.useLayoutEffect)(()=>{if(!u||!n.current)return;const e=(0,QP.A)(n.current),h=o(t),p=h||s(t),f=c();function m(){if(!f&&p&&d){const t=n.current.getBoundingClientRect().top-d.top;t&&(e.scrollTop+=t)}}if(window.matchMedia("(prefers-reduced-motion: reduce)").matches||i()||r()>200)return void m();const g=h||a(t)||l(t);if(g&&f)return;const b=g?"1":"",y=new KW({x:0,y:0,config:{mass:5,tension:2e3,friction:200},onChange({value:e}){if(!n.current)return;let{x:t,y:i}=e;t=Math.round(t),i=Math.round(i);const r=0===t&&0===i;n.current.style.transformOrigin="center center",n.current.style.transform=r?null:`translate3d(${t}px,${i}px,0)`,n.current.style.zIndex=b,m()}});n.current.style.transform=void 0;const v=bG(n.current),_=Math.round(u.left-v.left),x=Math.round(u.top-v.top);return y.start({x:0,y:0,from:{x:_,y:x}}),()=>{y.stop(),y.set({x:0,y:0})}},[u,d,t,i,r,o,s,a,l,c]),n};function vG(e){return"INPUT"===e?.nodeName}function _G(e){return vG(e)&&e.type&&!["button","checkbox","hidden","file","radio","image","range","reset","submit","number","email","time"].includes(e.type)||"TEXTAREA"===e.nodeName||"true"===e.contentEditable}function xG(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName}function kG(e){if(!e)return!1;const{tagName:t}=e;return xG(e)||"BUTTON"===t||"SELECT"===t}var wG=n(89534);function CG(e,t,n,i){const r=i.style.zIndex,o=i.style.position,s=i.style.borderRadius,{position:a="static"}=(0,wG.A)(i);"static"===a&&(i.style.position="relative"),i.style.zIndex="10000",i.style.borderRadius="0";const l=function(e,t,n){if(e.caretPositionFromPoint){const i=e.caretPositionFromPoint(t,n);if(!i)return null;const r=e.createRange();return r.setStart(i.offsetNode,i.offset),r.collapse(!0),r}return e.caretRangeFromPoint?e.caretRangeFromPoint(t,n):null}(e,t,n);return i.style.zIndex=r,i.style.position=o,i.style.borderRadius=s,l}function SG(e){return"rtl"===(0,wG.A)(e).direction}function AG(e,t,n){let i=n();return i&&i.startContainer&&e.contains(i.startContainer)||(e.scrollIntoView(t),i=n(),i&&i.startContainer&&e.contains(i.startContainer))?i:null}function IG(e,t,n){if(!e)return;if(e.focus(),xG(e)){if("number"!=typeof e.selectionStart)return;return void(t?(e.selectionStart=e.value.length,e.selectionEnd=e.value.length):(e.selectionStart=0,e.selectionEnd=0))}if(!e.isContentEditable)return;const i=AG(e,t,()=>function(e,t,n){const{ownerDocument:i}=e,r=SG(e)?!t:t,o=e.getBoundingClientRect();return void 0===n?n=t?o.right-1:o.left+1:n<=o.left?n=o.left+1:n>=o.right&&(n=o.right-1),CG(i,n,r?o.bottom-1:o.top+1,e)}(e,t,n));if(!i)return;const{ownerDocument:r}=e,{defaultView:o}=r;(0,re.e)(o,"defaultView");const s=o.getSelection();(0,re.e)(s,"selection"),s.removeAllRanges(),s.addRange(i)}function EG(e,t){return IG(e,t,void 0)}function jG({clientId:e,initialPosition:t}){const n=(0,T.useRef)(),{isBlockSelected:i,isMultiSelecting:r,isZoomOut:o}=Gh((0,zt.A)(Qy));return(0,T.useEffect)(()=>{if(!i(e)||r()||o())return;if(null==t)return;if(!n.current)return;const{ownerDocument:s}=n.current;if(oD(n.current,s.activeElement))return;const a=hS.XC.tabbable.find(n.current).filter(e=>_G(e)),l=-1===t,c=a[l?a.length-1:0]||n.current;if(oD(n.current,c)){if(!n.current.getAttribute("contenteditable")){const e=hS.XC.tabbable.findNext(n.current);if(e&&oD(n.current,e)&&kG(e))return void e.focus()}EG(c,l)}else n.current.focus()},[t,e]),n}function TG(e){e.defaultPrevented||(e.preventDefault(),e.currentTarget.classList.toggle("is-hovered","mouseover"===e.type))}function BG({isEnabled:e=!0}={}){return(0,bt.A)(t=>{if(e)return t.addEventListener("mouseout",TG),t.addEventListener("mouseover",TG),()=>{t.removeEventListener("mouseout",TG),t.removeEventListener("mouseover",TG),t.classList.remove("is-hovered")}},[e])}function NG(e){const{isBlockSelected:t}=(0,zt.A)(Qy),{selectBlock:n,selectionChange:i}=(0,Vt.A)(Qy);return(0,bt.A)(r=>{function o(o){r.parentElement.closest('[contenteditable="true"]')||(t(e)?o.target.isContentEditable||i(e):oD(r,o.target)&&n(e))}return r.addEventListener("focusin",o),()=>{r.removeEventListener("focusin",o)}},[t,n])}function RG(e){return!e||"transparent"===e||"rgba(0, 0, 0, 0)"===e}function OG({clientId:e,isSelected:t}){const{getBlockRootClientId:n,isZoomOut:i,hasMultiSelection:r,isSectionBlock:o,editedContentOnlySection:s,getBlock:a}=Gh((0,zt.A)(Qy)),{insertAfterBlock:l,removeBlock:c,resetZoomLevel:u,startDraggingBlocks:d,stopDraggingBlocks:h,editContentOnlySection:p}=Gh((0,Vt.A)(Qy));return(0,bt.A)(f=>{if(t)return f.addEventListener("keydown",m),f.addEventListener("dragstart",g),f.addEventListener("dblclick",b),()=>{f.removeEventListener("keydown",m),f.removeEventListener("dragstart",g),f.removeEventListener("dblclick",b)};function m(t){const{keyCode:n,target:r}=t;n!==Rt.Fm&&n!==Rt.G_&&n!==Rt.SJ||r!==f||_G(r)||(t.preventDefault(),n===Rt.Fm&&i()?u():n===Rt.Fm?l(e):c(e))}function g(t){if(f!==t.target||f.isContentEditable||f.ownerDocument.activeElement!==f||r())return void t.preventDefault();const i=JSON.stringify({type:"block",srcClientIds:[e],srcRootClientId:n(e)});t.dataTransfer.effectAllowed="move",t.dataTransfer.clearData(),t.dataTransfer.setData("wp-blocks",i);const{ownerDocument:o}=f,{defaultView:s}=o;s.getSelection().removeAllRanges();const a=o.createElement("div");a.style.width="1px",a.style.height="1px",a.style.position="fixed",a.style.visibility="hidden",o.body.appendChild(a),t.dataTransfer.setDragImage(a,0,0);const l=f.getBoundingClientRect(),c=f.id,u=f.cloneNode();u.style.display="none",f.id=null,f.after(u);let p=1;{let e=f;for(;e=e.parentElement;){const{scale:t}=s.getComputedStyle(e);if(t&&"none"!==t){p=parseFloat(t);break}}}const m=1/p,g={};for(const e of["transform","transformOrigin","transition","zIndex","position","top","left","pointerEvents","opacity","backgroundColor"])g[e]=f.style[e];const b=s.scrollY,y=s.scrollX,v=t.clientX,_=t.clientY;f.style.position="relative",f.style.top="0px",f.style.left="0px";const x=t.clientX-l.left,k=t.clientY-l.top,w=l.height>200?200/l.height:1;if(f.style.zIndex="1000",f.style.transformOrigin=`${x*m}px ${k*m}px`,f.style.transition="transform 0.2s ease-out",f.style.transform=`scale(${w})`,f.style.opacity="0.9",RG(s.getComputedStyle(f).backgroundColor)){let e="transparent",t=f;for(;t=t.parentElement;){const{backgroundColor:n}=s.getComputedStyle(t);if(!RG(n)){e=n;break}}f.style.backgroundColor=e}let C=!1,S=v,A=_;function I(e){e.clientX===S&&e.clientY===A||(S=e.clientX,A=e.clientY,E())}function E(){C||(C=!0,f.style.pointerEvents="none");const e=A-_,t=S-v,n=s.scrollY,i=s.scrollX,r=e+(n-b),o=t+(i-y);f.style.top=r*m+"px",f.style.left=o*m+"px"}function j(){o.removeEventListener("dragover",I),o.removeEventListener("dragend",j),o.removeEventListener("drop",j),o.removeEventListener("scroll",E);for(const[e,t]of Object.entries(g))f.style[e]=t;u.remove(),f.id=c,a.remove(),h(),document.body.classList.remove("is-dragging-components-draggable"),o.documentElement.classList.remove("is-dragging")}o.addEventListener("dragover",I),o.addEventListener("dragend",j),o.addEventListener("drop",j),o.addEventListener("scroll",E),d([e]),document.body.classList.add("is-dragging-components-draggable"),o.documentElement.classList.add("is-dragging")}function b(t){const n=o(e),i=a(e),r=xn(i),l=kn(i);!n||s===e||r||l||(t.preventDefault(),p(e))}},[e,t,n,a,xn,kn,l,c,i,u,r,d,h,o,s,p])}function LG(){const e=(0,T.useContext)(Bq);return(0,bt.A)(t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}},[e])}function MG({isSelected:e}){const t=(0,LS.A)();return(0,bt.A)(n=>{if(e){const{ownerDocument:e}=n,{defaultView:i}=e;if(!i.IntersectionObserver)return;const r=new i.IntersectionObserver(e=>{e[0].isIntersecting||n.scrollIntoView({behavior:t?"instant":"smooth"}),r.disconnect()});return r.observe(n),()=>{r.disconnect()}}},[e])}function PG({clientId:e="",isEnabled:t=!0}={}){const{getEnabledClientIdsTree:n}=Gh((0,zt.A)(Qy));return(0,bt.A)(i=>{if(!t)return;const r=t=>{(t.target===i||t.target.classList.contains("is-root-container"))&&(t.defaultPrevented||(t.preventDefault(),n(e).forEach(({clientId:e})=>{const t=i.querySelector(`[data-block="${e}"]`);t&&(t.classList.remove("has-editable-outline"),t.offsetWidth,t.classList.add("has-editable-outline"))})))};return i.addEventListener("click",r),()=>i.removeEventListener("click",r)},[t])}var DG=new Map;function FG(e){const t=e.getAttribute("data-draggable");t&&(e.removeAttribute("data-draggable"),"true"!==t||e.getAttribute("draggable")||e.setAttribute("draggable","true"))}function zG(e){const{target:t}=e,{ownerDocument:n,isContentEditable:i,tagName:r}=t,o=["INPUT","TEXTAREA"].includes(r),s=DG.get(n);if(i||o)for(const e of s)"true"===e.getAttribute("draggable")&&e.contains(t)&&(e.removeAttribute("draggable"),e.setAttribute("data-draggable","true"));else for(const e of s)FG(e)}function VG(e={}){const{blockVisibility:t,deviceType:n=yp.desktop.key,view:i=window}=e,r=(0,dw.A)("mobile",">=",i),o=(0,dw.A)("medium",">=",i);let s;return s=n===yp.mobile.key?yp.mobile.key:n===yp.tablet.key?yp.tablet.key:r?r&&!o?yp.tablet.key:yp.desktop.key:yp.mobile.key,{isBlockCurrentlyHidden:!1===t||!1===t?.viewport?.[s],currentViewport:s}}function UG(e={},{__unstableIsHtml:t}={}){const{clientId:n,className:i,wrapperProps:r={},isAligned:o,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:y,isReusable:v,isDragging:_,hasChildSelected:x,isEditingDisabled:k,hasEditableOutline:w,isEditingContentOnlySection:C,defaultClassName:S,isSectionBlock:A,isWithinSectionBlock:I,canMove:E,blockVisibility:j,deviceType:B}=(0,T.useContext)(Bj),N=(0,bt.A)(e=>{if(e){const{ownerDocument:t}=e,{defaultView:n}=t;N.current=n}},[]),R=(0,ee.sprintf)((0,ee.__)("Block: %s"),u),O="html"!==a||t?"":"-visual",L=(0,bt.A)(e=>(function(e,t){let n=DG.get(e);n||(n=new Set,DG.set(e,n),e.addEventListener("pointerdown",zG)),n.add(t)}(e.ownerDocument,e),()=>{!function(e,t){const n=DG.get(e);n&&(n.delete(t),FG(t),0===n.size&&(DG.delete(e),e.removeEventListener("pointerdown",zG)))}(e.ownerDocument,e)}),[]),M=!I,P=(0,gt.A)([e.ref,N,jG({clientId:n,initialPosition:f}),EO(n),NG(n),OG({clientId:n,isSelected:d}),BG({isEnabled:M}),LG(),yG({triggerAnimationOnChange:s,clientId:n}),ZU({isDisabled:!p}),PG({clientId:n,isEnabled:A}),MG({isSelected:d}),E?L:void 0]),D=Ih(),F=D[xh]?{"--wp-admin-theme-color":"var(--wp-block-synced-color)","--wp-admin-theme-color--rgb":"var(--wp-block-synced-color--rgb)"}:{},{isBlockCurrentlyHidden:z}=VG({blockVisibility:j,deviceType:B,view:N.current});c<2&&n===D.clientId&&(0,sn.A)(`Block type "${l}" must support API version 2 or higher to work correctly with "useBlockProps" method.`);let V=!1;return"-"!==r?.style?.marginTop?.charAt(0)&&"-"!==r?.style?.marginBottom?.charAt(0)&&"-"!==r?.style?.marginLeft?.charAt(0)&&"-"!==r?.style?.marginRight?.charAt(0)||(V=!0),{tabIndex:"disabled"===m?-1:0,draggable:!(!E||x)||void 0,...r,...e,ref:P,id:`block-${n}${O}`,role:"document","aria-label":R,"data-block":n,"data-type":l,"data-title":u,inert:h?"true":void 0,className:(0,mh.A)("block-editor-block-list__block",{"wp-block":!o,"has-block-overlay":p,"is-selected":d,"is-highlighted":g,"is-multi-selected":b,"is-partially-selected":y,"is-reusable":v,"is-dragging":_,"has-child-selected":x,"is-editing-disabled":k,"has-editable-outline":w,"has-negative-margin":V,"is-editing-content-only-section":C,"is-block-hidden":z},i,e.className,r.className,S),style:{...r.style,...e.style,...F}}}function $G({children:e,isHtml:t,...n}){return(0,Er.jsx)("div",{...UG(n,{__unstableIsHtml:t}),children:e})}function HG({block:{__unstableBlockSource:e},mode:t,isLocked:n,canRemove:i,clientId:r,isSelected:o,isSelectionEnabled:s,className:a,__unstableLayoutClassNames:l,name:c,isValid:u,attributes:d,wrapperProps:h,setAttributes:p,onReplace:f,onRemove:m,onInsertBlocksAfter:g,onMerge:b,toggleSelection:y}){const{mayDisplayControls:v,mayDisplayParentControls:_,isSelectionWithinCurrentSection:x,themeSupportsLayout:k,...w}=(0,T.useContext)(Bj),C=jk()||{};let S=(0,Er.jsx)(zU,{name:c,isSelected:o,attributes:d,setAttributes:p,insertBlocksAfter:n?void 0:g,onReplace:i?f:void 0,onRemove:i?m:void 0,mergeBlocks:i?b:void 0,clientId:r,isSelectionEnabled:s,toggleSelection:y,__unstableLayoutClassNames:l,__unstableParentLayout:Object.keys(C).length?C:void 0,mayDisplayControls:v,mayDisplayParentControls:_,mayDisplayPatternEditingControls:x,blockEditingMode:w.blockEditingMode,isPreviewMode:w.isPreviewMode});const A=bn(c);A?.getEditWrapperProps&&(h=function(e,t){const n={...e,...t};return e?.hasOwnProperty("className")&&t?.hasOwnProperty("className")&&(n.className=(0,mh.A)(e.className,t.className)),e?.hasOwnProperty("style")&&t?.hasOwnProperty("style")&&(n.style={...e.style,...t.style}),n}(h,A.getEditWrapperProps(d)));const I=h&&!!h["data-align"]&&!k,E=a?.includes("is-position-sticky");let j;if(I&&(S=(0,Er.jsx)("div",{className:(0,mh.A)("wp-block",E&&a),"data-align":h["data-align"],children:S})),u)j="html"===t?(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)("div",{style:{display:"none"},children:S}),(0,Er.jsx)($G,{isHtml:!0,children:(0,Er.jsx)(XU,{clientId:r})})]}):A?.apiVersion>1?S:(0,Er.jsx)($G,{children:S});else{const t=e?Ir(e):Lr(A,d);j=(0,Er.jsxs)($G,{className:"has-warning",children:[(0,Er.jsx)(WU,{clientId:r}),(0,Er.jsx)(Sr.A,{children:se(t)})]})}const{"data-align":B,...N}=h??{},R={...N,className:(0,mh.A)(N.className,B&&k&&`align${B}`,!(B&&E)&&a)};return(0,Er.jsx)(Bj.Provider,{value:{wrapperProps:R,isAligned:I,isSelectionWithinCurrentSection:x,...w},children:(0,Er.jsx)(YU,{fallback:(0,Er.jsx)($G,{className:"has-warning",children:(0,Er.jsx)(qU,{})}),children:j})})}UG.save=Rr;var WG=(0,bS.A)((e,t,n)=>{const{updateBlockAttributes:i,insertBlocks:r,mergeBlocks:o,replaceBlocks:s,toggleSelection:a,__unstableMarkLastChangeAsPersistent:l,moveBlocksToPosition:c,removeBlock:u,selectBlock:d}=e(Qy);return{setAttributes(e){const{getMultiSelectedBlockClientIds:r}=n.select(Qy),o=r(),{clientId:s,attributes:a}=t,l=o.length?o:[s],c="function"==typeof e?e(a):e;i(l,c)},onInsertBlocks(e,n){const{rootClientId:i}=t;r(e,n,i)},onInsertBlocksAfter(e){const{clientId:i,rootClientId:o}=t,{getBlockIndex:s}=n.select(Qy),a=s(i);r(e,a+1,o)},onMerge(e){const{clientId:i,rootClientId:a}=t,{getPreviousBlockClientId:l,getNextBlockClientId:h,getBlock:p,getBlockAttributes:f,getBlockName:m,getBlockOrder:g,getBlockIndex:b,getBlockRootClientId:y,canInsertBlockType:v}=n.select(Qy);function _(){const e=p(i),t=gn(),r=bn(t);if(m(i)!==t){const n=ur(e,t);n&&n.length&&s(i,n)}else if(In(e)){const e=h(i);e&&n.batch(()=>{u(i),d(e)})}else if(r.merge){const n=r.merge({},e.attributes);s([i],[er(t,n)])}}function x(e,t=!0){const i="text"===bn(m(e)).category,o=y(e),s=g(e),[a]=s;1===s.length&&An(p(a))?u(e):i?n.batch(()=>{if(v(m(a),o))c([a],e,o,b(e));else{const n=ur(p(a),gn());n&&n.length&&n.every(e=>v(e.name,o))?(r(n,b(e),o,t),u(a,!1)):_()}!g(e).length&&An(p(e))&&u(e,!1)}):_()}if(e){if(a){const e=h(a);if(e){if(m(a)!==m(e))return void o(a,e);{const t=f(a),i=f(e);if(Object.keys(t).every(e=>t[e]===i[e]))return void n.batch(()=>{c(g(e),e,a),u(e,!1)})}}}const e=h(i);if(!e)return;g(e).length?x(e,!1):o(i,e)}else{const e=l(i);if(e)o(e,i);else if(a){const e=l(a);if(e&&m(a)===m(e)){const t=f(a),i=f(e);if(Object.keys(t).every(e=>t[e]===i[e]))return void n.batch(()=>{c(g(a),a,e),u(a,!1)})}x(a)}else _()}},onReplace(e,n,i){e.length&&!In(e[e.length-1])&&l();const r=1===e?.length&&Array.isArray(e[0])?e[0]:e;s([t.clientId],r,n,i)},onRemove(){u(t.clientId)},toggleSelection(e){a(e)}}});HG=(0,z.A)(WG,gS("editor.BlockListBlock"))(HG);var GG=(0,T.memo)(function(e){const{clientId:t,rootClientId:n}=e,i=(0,zt.A)(e=>{const{isBlockSelected:i,getBlockMode:r,isSelectionEnabled:o,getTemplateLock:s,isSectionBlock:a,getParentSectionBlock:l,getBlockWithoutAttributes:c,getBlockAttributes:u,canRemoveBlock:d,canMoveBlock:h,getSettings:p,getEditedContentOnlySection:f,getBlockEditingMode:m,getBlockName:g,isFirstMultiSelectedBlock:b,getMultiSelectedBlockClientIds:y,hasSelectedInnerBlock:v,getBlocksByName:_,getBlockIndex:x,isBlockMultiSelected:k,isBlockSubtreeDisabled:w,isBlockHighlighted:C,__unstableIsFullySelected:S,__unstableSelectionHasUnmergeableBlock:A,isBlockBeingDragged:I,isDragging:E,__unstableHasActiveBlockOverlayActive:j,getSelectedBlocksInitialCaretPosition:T}=Gh(e(Qy)),B=c(t);if(!B)return;const{hasBlockSupport:N,getActiveBlockVariation:R}=e(Zi),O=u(t),{name:L,isValid:M}=B,P=bn(L),D=p(),{supportsLayout:F,isPreviewMode:z,__experimentalBlockBindingsSupportedAttributes:V}=D,U=V?.[L],$=O?.metadata?.blockVisibility,H=D?.[Vh]?.toLowerCase()||"desktop",W=P?.apiVersion>1,G=k(t),q=m(t),K={isPreviewMode:z,blockWithoutAttributes:B,name:L,attributes:O,isValid:M,themeSupportsLayout:F,index:x(t),isReusable:xn(P),className:W?O.className:void 0,defaultClassName:W?jr(L):void 0,blockTitle:P?.title,bindableAttributes:U,blockVisibility:$,deviceType:H,isMultiSelected:G,blockEditingMode:q,isEditingDisabled:"disabled"===q};if(z)return K;const Y=i(t),J=d(t),X=h(t),Z=R(L,O),Q=!0,ee=v(t,Q),te=a(t)?t:l(t),ne=_n(L,"multiple",!0)?[]:_(L),ie=ne.length&&ne[0]!==t;return{...K,mode:r(t),isSelectionEnabled:o(),isLocked:!!s(n),isSectionBlock:a(t),isWithinSectionBlock:!!te,isSelectionWithinCurrentSection:i(te)||v(te,Q),blockType:P,canRemove:J,canMove:X,isSelected:Y,isEditingContentOnlySection:f()===t,blockEditingMode:q,mayDisplayControls:Y||b(t)&&y().every(e=>g(e)===L),mayDisplayParentControls:N(g(t),"__experimentalExposeControlsToChildren",!1)&&v(t),blockApiVersion:P?.apiVersion||1,blockTitle:Z?.title||P?.title,isSubtreeDisabled:"disabled"===q&&w(t),hasOverlay:j(t)&&!E(),initialPosition:Y?T():void 0,isHighlighted:C(t),isMultiSelected:G,isPartiallySelected:G&&!S()&&!A(),isDragging:I(t),hasChildSelected:ee,isEditingDisabled:"disabled"===q,hasEditableOutline:"disabled"!==q&&"disabled"===m(n),originalBlockClientId:!!ie&&ne[0],blockVisibility:$,deviceType:H}},[t,n]),r=(0,bt.A)(e=>{if(e){const{ownerDocument:t}=e,{defaultView:n}=t;r.current=n}},[]),{isBlockCurrentlyHidden:o}=VG({blockVisibility:i?.blockVisibility,deviceType:i?.deviceType,view:r.current}),s=(0,T.useMemo)(()=>({...i?.blockWithoutAttributes,attributes:i?.attributes}),[i?.blockWithoutAttributes,i?.attributes]);if(!i)return null;const{isPreviewMode:a,mode:l="visual",isSelectionEnabled:c=!1,isLocked:u=!1,canRemove:d=!1,canMove:h=!1,name:p,attributes:f,isValid:m,isSelected:g=!1,themeSupportsLayout:b,isEditingContentOnlySection:y,blockEditingMode:v,mayDisplayControls:_,mayDisplayParentControls:x,index:k,blockApiVersion:w,blockType:C,blockTitle:S,isSubtreeDisabled:A,hasOverlay:I,initialPosition:E,isHighlighted:j,isMultiSelected:B,isPartiallySelected:N,isReusable:R,isDragging:O,hasChildSelected:L,isSectionBlock:M,isWithinSectionBlock:P,isSelectionWithinCurrentSection:D,isEditingDisabled:F,hasEditableOutline:z,className:V,defaultClassName:U,originalBlockClientId:$,bindableAttributes:H,blockVisibility:W,deviceType:G}=i,q={isPreviewMode:a,clientId:t,className:V,index:k,mode:l,name:p,blockApiVersion:w,blockType:C,blockTitle:S,isSelected:g,isSubtreeDisabled:A,hasOverlay:I,initialPosition:E,blockEditingMode:v,isHighlighted:j,isMultiSelected:B,isPartiallySelected:N,isReusable:R,isDragging:O,hasChildSelected:L,isSectionBlock:M,isWithinSectionBlock:P,isSelectionWithinCurrentSection:D,isEditingDisabled:F,hasEditableOutline:z,isEditingContentOnlySection:y,defaultClassName:U,mayDisplayControls:_,mayDisplayParentControls:x,originalBlockClientId:$,themeSupportsLayout:b,canMove:h,isBlockCurrentlyHidden:o,bindableAttributes:H,blockVisibility:W,deviceType:G};return!o||g||B||L?(0,Er.jsx)(Bj.Provider,{value:q,children:(0,Er.jsx)(HG,{...e,mode:l,isSelectionEnabled:c,isLocked:u,canRemove:d,canMove:h,block:s,name:p,attributes:f,isValid:m,isSelected:g})}):null});function qG({rootClientId:e}){const{showPrompt:t,isLocked:n,placeholder:i,isManualGrid:r}=(0,zt.A)(t=>{const{getBlockCount:n,getSettings:i,getTemplateLock:r,getBlockAttributes:o}=t(Qy),s=!n(e),{bodyPlaceholder:a}=i();return{showPrompt:s,isLocked:!!r(e),placeholder:a,isManualGrid:o(e)?.layout?.isManualPlacement}},[e]),{insertDefaultBlock:o,startTyping:s}=(0,Vt.A)(Qy);if(n||r)return null;const a=(0,qr.S)(i)||(0,ee.__)("Type / to choose a block"),l=()=>{o(void 0,e),s()};return(0,Er.jsxs)("div",{"data-root-client-id":e||"",className:(0,mh.A)("block-editor-default-block-appender",{"has-visible-prompt":t}),children:[(0,Er.jsx)("p",{tabIndex:"0",role:"button","aria-label":(0,ee.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{Rt.Fm!==e.keyCode&&Rt.t6!==e.keyCode||l()},onClick:()=>l(),onFocus:()=>{t&&l()},children:t?a:"\ufeff"}),(0,Er.jsx)(PJ,{rootClientId:e,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0})]})}function KG({rootClientId:e}){return(0,zt.A)(t=>t(Qy).canInsertBlockType(gn(),e))?(0,Er.jsx)(qG,{rootClientId:e}):(0,Er.jsx)(FJ,{rootClientId:e,className:"block-list-appender__toggle"})}function YG({rootClientId:e,CustomAppender:t,className:n,tagName:i="div"}){const r=(0,zt.A)(t=>{const{getBlockInsertionPoint:n,isBlockInsertionPointVisible:i,getBlockCount:r}=t(Qy),o=n();return i()&&e===o?.rootClientId&&0===r(e)},[e]);return(0,Er.jsx)(i,{tabIndex:-1,className:(0,mh.A)("block-list-appender wp-block",n,{"is-drag-over":r}),contentEditable:!1,"data-block":!0,children:t?(0,Er.jsx)(t,{}):(0,Er.jsx)(KG,{rootClientId:e})})}var JG=Number.MAX_SAFE_INTEGER,XG=function({previousClientId:e,nextClientId:t,children:n,__unstablePopoverSlot:i,__unstableContentRef:r,operation:o="insert",nearestSide:s="right",...a}){const[l,c]=(0,T.useReducer)(e=>(e+1)%JG,0),{orientation:u,rootClientId:d,isVisible:h}=(0,zt.A)(n=>{const{getBlockListSettings:i,getBlockRootClientId:r,isBlockVisible:o}=n(Qy),s=r(e??t);return{orientation:i(s)?.orientation||"vertical",rootClientId:s,isVisible:o(e)&&o(t)}},[e,t]),p=BO(e),f=BO(t),m="vertical"===u,g=(0,T.useMemo)(()=>{if(!(l<0||!p&&!f)&&h)return{contextElement:"group"===o?f||p:p||f,getBoundingClientRect(){const e=p?p.getBoundingClientRect():null,t=f?f.getBoundingClientRect():null;let n=0,i=0,r=0,a=0;if("group"===o){const o=t||e;i=o.top,r=0,a=o.bottom-o.top,n="left"===s?o.left-2:o.right-2}else m?(i=e?e.bottom:t.top,r=e?e.width:t.width,a=t&&e?t.top-e.bottom:0,n=e?e.left:t.left):(i=e?e.top:t.top,a=e?e.height:t.height,(0,ee.isRTL)()?(n=t?t.right:e.left,r=e&&t?e.left-t.right:0):(n=e?e.right:t.left,r=e&&t?t.left-e.right:0),r=Math.max(r,0));return new window.DOMRect(n,i,r,a)}}},[p,f,l,m,h,o,s]),b=tD(r);return(0,T.useLayoutEffect)(()=>{if(!p)return;const e=new window.MutationObserver(c);return e.observe(p,{attributes:!0}),()=>{e.disconnect()}},[p]),(0,T.useLayoutEffect)(()=>{if(!f)return;const e=new window.MutationObserver(c);return e.observe(f,{attributes:!0}),()=>{e.disconnect()}},[f]),(0,T.useLayoutEffect)(()=>{if(p)return p.ownerDocument.defaultView.addEventListener("resize",c),()=>{p.ownerDocument.defaultView?.removeEventListener("resize",c)}},[p]),(p||f)&&h?(0,Er.jsx)(uw.Ay,{ref:b,animate:!1,anchor:g,focusOnMount:!1,__unstableSlotName:i,inline:!i,...a,className:(0,mh.A)("block-editor-block-popover","block-editor-block-popover__inbetween",a.className),resize:!1,flip:!1,placement:"overlay",variant:"unstyled",children:(0,Er.jsx)("div",{className:"block-editor-block-popover__inbetween-container",children:n})},t+"--"+d):null},ZG={hide:{opacity:0,scaleY:.75},show:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:.9}},QG=function({__unstablePopoverSlot:e,__unstableContentRef:t}){const{clientId:n}=(0,zt.A)(e=>{const{getBlockOrder:t,getBlockInsertionPoint:n}=e(Qy),i=n(),r=t(i.rootClientId);return r.length?{clientId:r[i.index]}:{}},[]),i=(0,LS.A)();return(0,Er.jsx)(mD,{clientId:n,__unstablePopoverSlot:e,__unstableContentRef:t,className:"block-editor-block-popover__drop-zone",children:(0,Er.jsx)(NS.P.div,{"data-testid":"block-popover-drop-zone",initial:i?ZG.show:ZG.hide,animate:ZG.show,exit:i?ZG.show:ZG.exit,className:"block-editor-block-popover__drop-zone-foreground"})})},eq=(0,T.createContext)();function tq({__unstablePopoverSlot:e,__unstableContentRef:t,operation:n="insert",nearestSide:i="right"}){const{selectBlock:r,hideInsertionPoint:o}=(0,Vt.A)(Qy),s=(0,T.useContext)(eq),a=(0,T.useRef)(),{orientation:l,previousClientId:c,nextClientId:u,rootClientId:d,isInserterShown:h,isDistractionFree:p,isZoomOutMode:f}=(0,zt.A)(e=>{const{getBlockOrder:t,getBlockListSettings:n,getBlockInsertionPoint:i,isBlockBeingDragged:r,getPreviousBlockClientId:o,getNextBlockClientId:s,getSettings:a,isZoomOut:l}=Gh(e(Qy)),c=i(),u=t(c.rootClientId);if(!u.length)return{};let d=u[c.index-1],h=u[c.index];for(;r(d);)d=o(d);for(;r(h);)h=s(h);const p=a();return{previousClientId:d,nextClientId:h,orientation:n(c.rootClientId)?.orientation||"vertical",rootClientId:c.rootClientId,isDistractionFree:p.isDistractionFree,isInserterShown:c?.__unstableWithInserter,isZoomOutMode:l()}},[]),{getBlockEditingMode:m}=(0,zt.A)(Qy),g=(0,LS.A)(),b=(0,T.useCallback)(e=>{!e&&s.current&&(s.current=!1)},[s]),y={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)return null;if(f&&"insert"!==n)return null;const _="horizontal"===l||"group"===n?"is-horizontal":"is-vertical",x=(0,mh.A)("block-editor-block-list__insertion-point",_);return(0,Er.jsx)(XG,{previousClientId:c,nextClientId:u,__unstablePopoverSlot:e,__unstableContentRef:t,operation:n,nearestSide:i,children:(0,Er.jsxs)(NS.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)&&r(u,-1)},onFocus:function(e){e.target!==a.current&&(s.current=!0)},className:(0,mh.A)(x,{"is-with-inserter":h}),onHoverEnd:function(e){e.target!==a.current||s.current||o()},children:[(0,Er.jsx)(NS.P.div,{variants:y,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),h&&(0,Er.jsx)(NS.P.div,{variants:v,className:(0,mh.A)("block-editor-block-list__insertion-point-inserter"),children:(0,Er.jsx)(PJ,{ref:b,position:"bottom center",clientId:u,rootClientId:d,__experimentalIsQuick:!0,onToggle:e=>{s.current=e},onSelectOrClose:()=>{s.current=!1}})})]})})}function nq(e){const{insertionPoint:t,isVisible:n,isBlockListEmpty:i}=(0,zt.A)(e=>{const{getBlockInsertionPoint:t,isBlockInsertionPointVisible:n,getBlockCount:i}=e(Qy),r=t();return{insertionPoint:r,isVisible:n(),isBlockListEmpty:0===i(r?.rootClientId)}},[]);return!n||i?null:"replace"===t.operation?(0,Er.jsx)(QG,{...e},`${t.rootClientId}-${t.index}`):(0,Er.jsx)(tq,{operation:t.operation,nearestSide:t.nearestSide,...e})}function iq(){const e=(0,T.useContext)(eq),t=(0,zt.A)(e=>{const t=e(Qy).getSettings();return t.isDistractionFree||t.isPreviewMode||Gh(e(Qy)).isZoomOut()},[]),{getBlockListSettings:n,getBlockIndex:i,isMultiSelecting:r,getSelectedBlockClientIds:o,getSettings:s,getTemplateLock:a,__unstableIsWithinBlockOverlay:l,getBlockEditingMode:c,getBlockName:u,getBlockAttributes:d,getParentSectionBlock:h}=Gh((0,zt.A)(Qy)),{showInsertionPoint:p,hideInsertionPoint:f}=(0,Vt.A)(Qy);return(0,bt.A)(m=>{if(!t)return m.addEventListener("mousemove",g),()=>{m.removeEventListener("mousemove",g)};function g(t){if(void 0===e||e.current)return;if(t.target.nodeType===t.target.TEXT_NODE)return;if(r())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void f();let m;if(t.target.classList.contains("is-root-container")||(m=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")),a(m)||"disabled"===c(m)||"core/block"===u(m)||m&&d(m).layout?.isManualPlacement)return;const g=n(m),b=g?.orientation||"vertical",y=!!g?.__experimentalCaptureToolbars,v=t.clientY,_=t.clientX;let x=Array.from(t.target.children).find(e=>{const t=e.getBoundingClientRect();return e.classList.contains("wp-block")&&"vertical"===b&&t.top>v||e.classList.contains("wp-block")&&"horizontal"===b&&((0,ee.isRTL)()?t.right<_:t.left>_)});if(!x)return void f();if(!x.id&&(x=x.firstElementChild,!x))return void f();const k=x.id.slice(6);if(!k||l(k)||h(k))return;if(o().includes(k)&&"vertical"===b&&!y&&!s().hasFixedToolbar)return;const w=x.getBoundingClientRect();if("horizontal"===b&&(t.clientY>w.bottom||t.clientY<w.top)||"vertical"===b&&(t.clientX>w.right||t.clientX<w.left))return void f();const C=i(k);0!==C?p(m,C,{__unstableWithInserter:!0}):f()}},[e,n,i,r,p,f,o,t])}function rq(){const{getSettings:e,hasSelectedBlock:t,hasMultiSelection:n}=(0,zt.A)(Qy),{clearSelectedBlock:i}=(0,Vt.A)(Qy),{clearBlockSelection:r}=e();return(0,bt.A)(e=>{if(r)return e.addEventListener("mousedown",o),()=>{e.removeEventListener("mousedown",o)};function o(r){(t()||n())&&r.target===e&&i()}},[t,n,i,r])}function oq(e){return(0,Er.jsx)("div",{ref:rq(),...e})}eq.displayName="InsertionPointOpenRefContext";var sq=new WeakMap;function aq(){let e;return t=>(void 0!==e&&(0,V.hw)(e,t)||(e=t),e)}function lq(e){const[t]=(0,T.useState)(aq);return t(e)}var cq=n(49724),uq=n(95576);function dq(e,t,n){const i=(0,cq.MA)(()=>(0,uq.n)(e,t??0,n),[e,t,n]);return(0,T.useEffect)(()=>()=>i.cancel(),[i]),i}function hq(e){let t={srcRootClientId:null,srcClientIds:null,srcIndex:null,type:null,blocks:null};if(!e.dataTransfer)return t;try{t=Object.assign(t,JSON.parse(e.dataTransfer.getData("wp-blocks")))}catch{return t}return t}function pq(e,t,n={}){const{operation:i="insert",nearestSide:r="right"}=n,{canInsertBlockType:o,getBlockIndex:s,getClientIdsOfDescendants:a,getBlockOrder:l,getBlocksByClientId:c,getSettings:u,getBlock:d}=(0,zt.A)(Qy),{getGroupingBlockName:h}=(0,zt.A)(Zi),{insertBlocks:p,moveBlocksToPosition:f,updateBlockAttributes:m,clearSelectedBlock:g,replaceBlocks:b,removeBlocks:y}=(0,Vt.A)(Qy),v=(0,yt.A)(),_=(0,T.useCallback)((n,s=!0,a=0,c=[])=>{Array.isArray(n)||(n=[n]);const u=l(e)[t];if("replace"===i)b(u,n,void 0,a);else if("group"===i){const t=d(u);"left"===r?n.push(t):n.unshift(t);const i=n.map(e=>er(e.name,e.attributes,e.innerBlocks)),s=n.every(e=>"core/image"===e.name),l=o("core/gallery",e),p=er(s&&l?"core/gallery":h(),{layout:{type:"flex",flexWrap:s&&l?null:"nowrap"}},i);b([u,...c],p,void 0,a)}else p(n,t,e,s,a)},[l,e,t,i,b,d,r,o,h,p]),x=(0,T.useCallback)((n,r,o)=>{if("replace"===i){const i=c(n),r=l(e)[t];v.batch(()=>{y(n,!1),b(r,i,void 0,0)})}else f(n,r,e,o)},[i,l,c,f,v,y,b,t,e]),k=function(e,t,n,i,r,o,s,a,l){return c=>{const{srcRootClientId:u,srcClientIds:d,type:h,blocks:p}=hq(c);if("inserter"===h){s();const e=p.map(e=>ir(e));o(e,!0,null)}if("block"===h){const s=n(d[0]);if(u===e&&s===t)return;if(d.includes(e)||i(d).some(t=>t===e))return;if("group"===a){const e=d.map(e=>l(e));return void o(e,!0,null,d)}const c=u===e,h=d.length;r(d,u,c&&s<t?t-h:t)}}}(e,t,s,a,x,_,g,i,d),w=function(e,t,n,i,r){return o=>{if(!t().mediaUpload)return;const s=ar(lr("from"),t=>"files"===t.type&&i(t.blockName,e)&&t.isMatch(o));if(s){const e=s.transform(o,n);r(e)}}}(e,u,m,o,_),C=function(e){return t=>{const n=Zs({HTML:t,mode:"BLOCKS"});n.length&&e(n)}}(_);return e=>{const t=NC(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?C(n):t.length?w(t):k(e)}}function fq(e,t,n=["top","bottom","left","right"]){let i,r;return n.forEach(n=>{const o=function(e,t,n){const i="top"===n||"bottom"===n,{x:r,y:o}=e,s=i?r:o,a=i?o:r,l=i?t.left:t.top,c=i?t.right:t.bottom,u=t[n];let d;return d=s>=l&&s<=c?s:s<c?l:c,Math.sqrt((s-d)**2+(a-u)**2)}(e,t,n);(void 0===i||o<i)&&(i=o,r=n)}),[i,r]}function mq(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}function gq(e,t,n,i){let r=!0;if(t){const e=t?.map(({name:e})=>e);r=n.every(t=>e?.includes(t))}const o=n.map(t=>e(t)).every(e=>{const[t]=e?.parent||[];return!t||t===i});return r&&o}function bq(e,t){const{defaultView:n}=t;return!!(n&&e instanceof n.HTMLElement&&e.closest("[data-is-insertion-point]"))}var yq={};function vq({children:e,clientId:t}){const n=function(e){return(0,zt.A)(t=>{const n=t(Qy).getBlock(e);if(!n)return;const i=t(Zi).getBlockType(n.name);return i&&0!==Object.keys(i.providesContext).length?Object.fromEntries(Object.entries(i.providesContext).map(([e,t])=>[e,n.attributes[t]])):void 0},[e])}(t);return(0,Er.jsx)(Cj,{value:n,children:e})}var _q=(0,T.memo)(zq);function xq(e){const{clientId:t,allowedBlocks:n,prioritizedInserterBlocks:i,defaultBlock:r,directInsert:o,__experimentalDefaultBlock:s,__experimentalDirectInsert:a,template:l,templateLock:c,wrapperRef:u,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:h,__experimentalAppenderTagName:p,renderAppender:f,orientation:m,placeholder:g,layout:b,name:y,blockType:v,parentLock:_,defaultLayout:x}=e;!function(e,t,n,i,r,o,s,a,l,c,u,d){const h=(0,yt.A)(),p=lq(n),f=lq(i),m=void 0===l||"contentOnly"===t?t:l;(0,T.useLayoutEffect)(()=>{const t={allowedBlocks:p,prioritizedInserterBlocks:f,templateLock:m};if(void 0!==c&&(t.__experimentalCaptureToolbars=c),void 0!==u)t.orientation=u;else{const e=Sk(d?.type);t.orientation=e.getOrientation(d)}void 0!==s&&((0,Qt.A)("__experimentalDefaultBlock",{alternative:"defaultBlock",since:"6.3",version:"6.4"}),t.defaultBlock=s),void 0!==r&&(t.defaultBlock=r),void 0!==a&&((0,Qt.A)("__experimentalDirectInsert",{alternative:"directInsert",since:"6.3",version:"6.4"}),t.directInsert=a),void 0!==o&&(t.directInsert=o),void 0!==t.directInsert&&"boolean"!=typeof t.directInsert&&(0,Qt.A)("Using `Function` as a `directInsert` argument",{alternative:"`boolean` values",since:"6.5"}),sq.get(h)||sq.set(h,{}),sq.get(h)[e]=t,window.queueMicrotask(()=>{const e=sq.get(h);if(Object.keys(e).length){const{updateBlockListSettings:t}=h.dispatch(Qy);t(e),sq.set(h,{})}})},[e,p,f,m,r,o,s,a,c,u,d,h])}(t,_,n,i,r,o,s,a,c,h,m,b),function(e,t,n,i){const r=(0,yt.A)(),o=(0,T.useRef)(null);(0,T.useLayoutEffect)(()=>{let s=!1;const{getBlocks:a,getSelectedBlocksInitialCaretPosition:l,isBlockSelected:c}=r.select(Qy),{replaceInnerBlocks:u,__unstableMarkNextChangeAsNotPersistent:d}=r.dispatch(Qy);return window.queueMicrotask(()=>{if(s)return;const r=a(e),h=0===r.length||"all"===n||"contentOnly"===n,p=!F(t,o.current);if(!h||!p)return;o.current=t;const f=na(r,t);F(f,r)||(d(),u(e,f,0===r.length&&i&&0!==f.length&&c(e),l()))}),()=>{s=!0}},[t,n,e,r,i])}(t,l,c,d);const k=vn(y,"layout")||vn(y,"__experimentalLayout")||yq,{allowSizingOnChildren:w=!1}=k,C=b||k,S=(0,T.useMemo)(()=>({...x,...C,...w&&{allowSizingOnChildren:!0}}),[x,C,w]),A=(0,Er.jsx)(_q,{rootClientId:t,renderAppender:f,__experimentalAppenderTagName:p,layout:S,wrapperRef:u,placeholder:g});return v?.providesContext&&0!==Object.keys(v.providesContext).length?(0,Er.jsx)(vq,{clientId:t,children:A}):A}function kq(e){return fU(e),(0,Er.jsx)(xq,{...e})}var wq=(0,T.forwardRef)((e,t)=>{const n=Cq({ref:t},e);return(0,Er.jsx)("div",{className:"block-editor-inner-blocks",children:(0,Er.jsx)("div",{...n})})});function Cq(e={},t={}){const{__unstableDisableLayoutClassNames:n,__unstableDisableDropZone:i,dropZoneElement:r}=t,{clientId:o,layout:s=null,__unstableLayoutClassNames:a=""}=Ih(),l=(0,zt.A)(e=>{const{getBlockName:t,isZoomOut:n,getTemplateLock:i,getBlockRootClientId:r,getBlockEditingMode:s,getBlockSettings:a,getSectionRootClientId:l}=Gh(e(Qy));if(!o){const e=l();return{isDropZoneDisabled:n()&&""!==e}}const{hasBlockSupport:c,getBlockType:u}=e(Zi),d=t(o),h=s(o),p=r(o),[f]=a(o,"layout");let m="disabled"===h;if(n()){const e=l();m=o!==e}return{__experimentalCaptureToolbars:c(d,"__experimentalExposeControlsToChildren",!1),name:d,blockType:u(d),parentLock:i(p),parentClientId:p,isDropZoneDisabled:m,defaultLayout:f}},[o]),{__experimentalCaptureToolbars:c,name:u,blockType:d,parentLock:h,parentClientId:p,isDropZoneDisabled:f,defaultLayout:m}=l,g=function({dropZoneElement:e,rootClientId:t="",parentClientId:n="",isDisabled:i=!1}={}){const r=(0,yt.A)(),[o,s]=(0,T.useState)({index:null,operation:"insert"}),{getBlockType:a,getBlockVariations:l,getGroupingBlockName:c}=(0,zt.A)(Zi),{canInsertBlockType:u,getBlockListSettings:d,getBlocks:h,getBlockIndex:p,getDraggedBlockClientIds:f,getBlockNamesByClientId:m,getAllowedBlocks:g,isDragging:b,isGroupable:y,isZoomOut:v,getSectionRootClientId:_,getBlockParents:x}=Gh((0,zt.A)(Qy)),{showInsertionPoint:k,hideInsertionPoint:w,startDragging:C,stopDragging:S}=Gh((0,Vt.A)(Qy)),A=pq("before"===o.operation||"after"===o.operation?n:t,o.index,{operation:o.operation,nearestSide:o.nearestSide}),I=dq((0,T.useCallback)((i,o)=>{b()||C();const w=f(),S=[t,...x(t,!0)];if(w.some(e=>S.includes(e)))return;const A=g(t),I=m([t])[0],E=m(w);if(!gq(a,A,E,I))return;const j=_();if(v()&&j!==t)return;const T=h(t).filter(e=>!(_n(e.name,"visibility",!0)&&!1===e.attributes?.metadata?.blockVisibility));if(0===T.length)return void r.batch(()=>{s({index:0,operation:"insert"}),k(t,0,{operation:"insert"})});const B=T.map(e=>{const t=e.clientId;return{isUnmodifiedDefaultBlock:In(e),getBoundingClientRect:()=>{const e=o.getElementById(`block-${t}`);return e?e.getBoundingClientRect():null},blockIndex:p(t),blockOrientation:d(t)?.orientation}}),N=function(e,t,n="vertical",i={}){const r="horizontal"===n?["left","right"]:["top","bottom"];let o=0,s="before",a=1/0,l=null,c="right";const{dropZoneElement:u,parentBlockOrientation:d,rootBlockIndex:h=0}=i;if(u&&"horizontal"!==d){const e=u.getBoundingClientRect(),[n,i]=fq(t,e,["top","bottom"]);if(e.height>120&&n<30){if("top"===i)return[h,"before"];if("bottom"===i)return[h+1,"after"]}}const p=(0,ee.isRTL)();if(u&&"horizontal"===d){const e=u.getBoundingClientRect(),[n,i]=fq(t,e,["left","right"]);if(e.width>120&&n<30){if(p&&"right"===i||!p&&"left"===i)return[h,"before"];if(p&&"left"===i||!p&&"right"===i)return[h+1,"after"]}}e.forEach(({isUnmodifiedDefaultBlock:e,getBoundingClientRect:i,blockIndex:u,blockOrientation:d})=>{const h=i();if(!h)return;let[f,m]=fq(t,h,r);const[g,b]=fq(t,h,["left","right"]),y=mq(t,h);e&&y?f=0:"vertical"===n&&"horizontal"!==d&&(y&&g<30||!y&&function(e,t){return t.top<=e.y&&t.bottom>=e.y}(t,h))&&(l=u,c=b),f<a&&(s="bottom"===m||!p&&"right"===m||p&&"left"===m?"after":"before",a=f,o=u)});const f=o+("after"===s?1:-1),m=!!e[o]?.isUnmodifiedDefaultBlock,g=!!e[f]?.isUnmodifiedDefaultBlock;return null!==l?[l,"group",c]:m||g?[m?o:f,"replace"]:["after"===s?o+1:o,"insert"]}(B,{x:i.clientX,y:i.clientY},d(t)?.orientation,{dropZoneElement:e,parentBlockClientId:n,parentBlockOrientation:n?d(n)?.orientation:void 0,rootBlockIndex:p(t)}),[R,O,L]=N,M=B[R]?.isUnmodifiedDefaultBlock;if(!v()||M||"insert"===O){if("group"===O){const e=T[R],n=[e.name,...E].every(e=>"core/image"===e),i=u("core/gallery",t),r=y([e.clientId,f()]),o=l(c(),"block"),s=o&&o.find(({name:e})=>"group-row"===e);if(n&&!i&&(!r||!s))return;if(!(n||r&&s))return}r.batch(()=>{s({index:R,operation:O,nearestSide:L});const e=["before","after"].includes(O)?n:t;k(e,R,{operation:O,nearestSide:L})})}},[b,g,t,m,f,a,_,v,h,d,e,n,p,r,C,k,u,y,l,c]),200);return OC({dropZoneElement:e,isDisabled:i,onDrop:A,onDragOver(e){I(e,e.currentTarget.ownerDocument)},onDragLeave(e){const{ownerDocument:t}=e.currentTarget;bq(e.relatedTarget,t)||bq(e.target,t)||(I.cancel(),w())},onDragEnd(){I.cancel(),S(),w()}})}({dropZoneElement:r,rootClientId:o,parentClientId:p}),b=(0,gt.A)([e.ref,i||f||s?.isManualPlacement&&window.__experimentalEnableGridInteractivity?null:g]),y={__experimentalCaptureToolbars:c,layout:s,name:u,blockType:d,parentLock:h,defaultLayout:m,...t},v=y.value&&y.onChange?kq:xq;return{...e,ref:b,className:(0,mh.A)(e.className,"block-editor-block-list__layout",n?"":a),children:o?(0,Er.jsx)(v,{...y,clientId:o}):(0,Er.jsx)(zq,{...t})}}Cq.save=function(e={}){const{innerBlocks:t}=Nr;if(!Array.isArray(t))return{...e,children:t};const n=Fr(t,{isInnerBlocks:!0}),i=(0,Er.jsx)(Sr.A,{children:n});return{...e,children:i}},wq.DefaultBlockAppender=function(){const{clientId:e}=Ih();return(0,Er.jsx)(qG,{rootClientId:e})},wq.ButtonBlockAppender=function({showSeparator:e,isFloating:t,onAddBlock:n,isToggle:i}){const{clientId:r}=Ih();return(0,Er.jsx)(FJ,{className:(0,mh.A)({"block-list-appender__toggle":i}),rootClientId:r,showSeparator:e,isFloating:t,onAddBlock:n})},wq.Content=()=>Cq.save().children;var Sq=wq,Aq=new Set([Rt.UP,Rt.NS,Rt.PX,Rt.M3,Rt.Fm,Rt.G_]);function Iq(){const e=(0,zt.A)(e=>e(Qy).isTyping(),[]),{stopTyping:t}=(0,Vt.A)(Qy);return(0,bt.A)(n=>{if(!e)return;const{ownerDocument:i}=n;let r,o;function s(e){const{clientX:n,clientY:i}=e;r&&o&&(r!==n||o!==i)&&t(),r=n,o=i}return i.addEventListener("mousemove",s),()=>{i.removeEventListener("mousemove",s)}},[e,t])}function Eq(){const e=(0,zt.A)(e=>e(Qy).isTyping(),[]),{startTyping:t,stopTyping:n}=(0,Vt.A)(Qy),i=Iq(),r=(0,bt.A)(i=>{if(e){let e,t=function(t){const{target:r}=t;e=i.ownerDocument.defaultView.setTimeout(()=>{_G(r)||n()})},r=function(e){const{keyCode:t}=e;t!==Rt._f&&t!==Rt.wn||n()},o=function(){i.ownerDocument.defaultView.getSelection().isCollapsed||n()};return i.addEventListener("focus",t),i.addEventListener("keydown",r),i.ownerDocument.addEventListener("selectionchange",o),()=>{i.ownerDocument.defaultView.clearTimeout(e),i.removeEventListener("focus",t),i.removeEventListener("keydown",r),i.ownerDocument.removeEventListener("selectionchange",o)}}function r(e){const{type:n,target:r}=e;_G(r)&&i.contains(r)&&("keydown"!==n||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&Aq.has(t)}(e))&&t()}return i.addEventListener("keypress",r),i.addEventListener("keydown",r),()=>{i.removeEventListener("keypress",r),i.removeEventListener("keydown",r)}},[e,t,n]);return(0,gt.A)([i,r])}var jq=function({children:e}){return(0,Er.jsx)("div",{ref:Eq(),children:e})};function Tq({clientId:e,rootClientId:t="",position:n="top"}){const[i,r]=(0,T.useState)(!1),{sectionRootClientId:o,sectionClientIds:s,insertionPoint:a,blockInsertionPointVisible:l,blockInsertionPoint:c,blocksBeingDragged:u}=(0,zt.A)(e=>{const{getInsertionPoint:t,getBlockOrder:n,getSectionRootClientId:i,isBlockInsertionPointVisible:r,getBlockInsertionPoint:o,getDraggedBlockClientIds:s}=Gh(e(Qy)),a=i();return{sectionRootClientId:a,sectionClientIds:n(a),insertionPoint:t(),blockInsertionPoint:o(),blockInsertionPointVisible:r(),blocksBeingDragged:s()}},[]),d=(0,LS.A)();if(!e)return;let h=!1;if(t!==o||!s||!s.includes(e))return null;const p=0===a?.index&&e===s[a.index],f=a&&a.hasOwnProperty("index")&&e===s[a.index-1];"top"===n&&(h=p||l&&0===c.index&&e===s[c.index]),"bottom"===n&&(h=f||l&&e===s[c.index-1]);const m=u[0],g=u.includes(e),b=s.indexOf(m),y=b>0?s[b-1]:null;return(g||y===e)&&(h=!1),(0,Er.jsx)(BS.N,{children:h&&(0,Er.jsx)(NS.P.div,{initial:{height:0},animate:{height:"calc(1 * var(--wp-block-editor-iframe-zoom-out-frame-size) / var(--wp-block-editor-iframe-zoom-out-scale)"},exit:{height:0},transition:{type:"tween",duration:d?0:.2,ease:[.6,0,.4,1]},className:(0,mh.A)("block-editor-block-list__zoom-out-separator",{"is-dragged-over":i}),"data-is-insertion-point":"true",onDragOver:()=>r(!0),onDragLeave:()=>r(!1),children:(0,Er.jsx)(NS.P.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{delay:-.125}},transition:{ease:"linear",duration:.1,delay:.125},children:(0,ee.__)("Drop pattern.")})})})}var Bq=(0,T.createContext)();Bq.displayName="IntersectionObserverContext";var Nq=new WeakMap,Rq={trailing:!0};function Oq({className:e,...t}){const{isOutlineMode:n,isFocusMode:i,isPreviewMode:r,editedContentOnlySection:o}=(0,zt.A)(e=>{const{getSettings:t,isTyping:n,hasBlockSpotlight:i,getEditedContentOnlySection:r}=Gh(e(Qy)),{outlineMode:o,focusMode:s,isPreviewMode:a}=t();return{isOutlineMode:o&&!n(),isFocusMode:s||i(),isPreviewMode:a,editedContentOnlySection:r()}},[]),s=(0,yt.A)(),{setBlockVisibility:a}=(0,Vt.A)(Qy),l=(0,uj.A)((0,T.useCallback)(()=>{const e={};Nq.get(s).forEach(([t,n])=>{e[t]=n}),a(e)},[s]),300,Rq),c=(0,T.useMemo)(()=>{const{IntersectionObserver:e}=window;if(e)return new e(e=>{Nq.get(s)||Nq.set(s,[]);for(const t of e){const e=t.target.getAttribute("data-block");Nq.get(s).push([e,t.isIntersecting])}l()})},[]),u=Cq({ref:(0,gt.A)([rq(),iq(),Eq()]),className:(0,mh.A)("is-root-container",e,{"is-outline-mode":n,"is-focus-mode":i,"is-preview-mode":r})},t);return(0,Er.jsxs)(Bq.Provider,{value:c,children:[(0,Er.jsx)("div",{...u}),!!o&&(0,Er.jsx)(Lq,{clientId:o})]})}function Lq({clientId:e}){const{stopEditingContentOnlySection:t}=Gh((0,Vt.A)(Qy)),n=(0,zt.A)(t=>{const{isBlockSelected:n,hasSelectedInnerBlock:i,getBlockSelectionStart:r}=t(Qy);return!r()||n(e)||i(e,!0)},[e]);return(0,T.useEffect)(()=>{n||t()},[n,t]),null}function Mq(e){return(0,Er.jsx)(Ah,{value:Ch,children:(0,Er.jsx)(Oq,{...e})})}var Pq=[],Dq=new Set;function Fq({placeholder:e,rootClientId:t,renderAppender:n,__experimentalAppenderTagName:i,layout:r=Ak}){const o=!1!==n,s=!!n,{order:a,isZoomOut:l,selectedBlocks:c,visibleBlocks:u,shouldRenderAppender:d}=(0,zt.A)(e=>{const{getSettings:n,getBlockOrder:i,getSelectedBlockClientIds:r,__unstableGetVisibleBlocks:a,getTemplateLock:l,getBlockEditingMode:c,isSectionBlock:u,isContainerInsertableToInContentOnlyMode:d,getBlockName:h,isZoomOut:p,canInsertBlockType:f}=Gh(e(Qy)),m=i(t);if(n().isPreviewMode)return{order:m,selectedBlocks:Pq,visibleBlocks:Dq};const g=r(),b=g[0],y=!(t||b||m.length&&f(gn(),t)),v=!(!t||!b||t!==b),_=l(t);return{order:m,selectedBlocks:g,visibleBlocks:a(),isZoomOut:p(),shouldRenderAppender:(!u(t)||d(h(b),t))&&"disabled"!==c(t)&&(!_||"contentOnly"===_)&&o&&!p()&&(s||v||y)}},[t,o,s]);return(0,Er.jsxs)(Ek,{value:r,children:[a.map(e=>(0,Er.jsxs)(BU.Ay,{value:!u.has(e)&&!c.includes(e),children:[l&&(0,Er.jsx)(Tq,{clientId:e,rootClientId:t,position:"top"}),(0,Er.jsx)(GG,{rootClientId:t,clientId:e}),l&&(0,Er.jsx)(Tq,{clientId:e,rootClientId:t,position:"bottom"})]},e)),a.length<1&&e,d&&(0,Er.jsx)(YG,{tagName:i,rootClientId:t,CustomAppender:n})]})}function zq(e){return(0,Er.jsx)(BU.Ay,{value:!1,children:(0,Er.jsx)(Fq,{...e})})}function Vq(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:i,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:o,__unstableIsFullySelected:s}=e(Qy);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:i(),selectedBlockClientId:r(),initialPosition:o(),isFullSelection:s()}}function Uq(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:i,selectedBlockClientId:r,isFullSelection:o}=(0,zt.A)(Vq,[]);return(0,bt.A)(r=>{const{ownerDocument:s}=r,{defaultView:a}=s;if(null==e)return;if(!i||t)return;const{length:l}=n;l<2||o&&(r.contentEditable=!0,r.focus(),a.getSelection().removeAllRanges())},[i,t,n,r,e,o])}function $q(e){const{anchorNode:t,focusNode:n,anchorOffset:i,focusOffset:r}=e;(0,re.e)(t,"anchorNode"),(0,re.e)(n,"focusNode");const o=t.compareDocumentPosition(n);return!(o&t.DOCUMENT_POSITION_PRECEDING)&&(!!(o&t.DOCUMENT_POSITION_FOLLOWING)||0!==o||i<=r)}function Hq(e,t,n=!1){if(xG(e)&&"number"==typeof e.selectionStart)return e.selectionStart===e.selectionEnd&&(t?0===e.selectionStart:e.value.length===e.selectionStart);if(!e.isContentEditable)return!0;const{ownerDocument:i}=e,{defaultView:r}=i;(0,re.e)(r,"defaultView");const o=r.getSelection();if(!o||!o.rangeCount)return!1;const s=o.getRangeAt(0),a=s.cloneRange(),l=$q(o),c=o.isCollapsed;c||a.collapse(!l);const u=Kt(a),d=Kt(s);if(!u||!d)return!1;const h=function(e){const t=Array.from(e.getClientRects());if(!t.length)return;const n=Math.min(...t.map(({top:e})=>e));return Math.max(...t.map(({bottom:e})=>e))-n}(s);if(!c&&h&&h>u.height&&l===t)return!1;const p=SG(e)?!t:t,f=e.getBoundingClientRect(),m=p?f.left+1:f.right-1,g=t?f.top+1:f.bottom-1,b=AG(e,t,()=>CG(i,m,g,e));if(!b)return!1;const y=Kt(b);if(!y)return!1;const v=t?"top":"bottom",_=p?"left":"right",x=y[v]-d[v],k=y[_]-u[_],w=Math.abs(x)<=1,C=Math.abs(k)<=1;return n?w:w&&C}function Wq(e,t){return Hq(e,t,!0)}function Gq(e,t){return Hq(e,t)}function qq(e,t,n,i){let r,o=hS.XC.focusable.find(n);return t&&o.reverse(),o=o.slice(o.indexOf(e)+1),i&&(r=e.getBoundingClientRect()),o.find(function(e){if(sD(e)&&0!==hS.XC.focusable.find(e).filter(e=>!kG(e)).length)return!1;if(!hS.XC.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(i){const t=e.getBoundingClientRect();if(t.left>=r.right||t.right<=r.left)return!1}return!0})}function Kq(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:i,__unstableIsFullySelected:r}=(0,zt.A)(Qy),{selectBlock:o}=(0,Vt.A)(Qy);return(0,bt.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===Rt.UP,g=c===Rt.PX,b=c===Rt.M3,y=c===Rt.NS,v=m||b,_=b||y,x=m||g,k=_||x,w=d||h||p||f,C=x?Wq:Gq,{ownerDocument:S}=s,{defaultView:A}=S;if(!k)return;if(n().isPreviewMode)return;if(i()){if(d)return;if(!r())return;return l.preventDefault(),void(v?o(e()):o(t(),-1))}if(!function(e,t,n){const i=t===Rt.UP||t===Rt.PX,{tagName:r}=e,o=e.getAttribute("type");return i&&!n?"INPUT"!==r||!["date","datetime-local","month","number","range","time","week"].includes(o):"INPUT"===r?["button","checkbox","number","color","file","image","radio","reset","submit"].includes(o):"TEXTAREA"!==r}(u,c,w))return;x?a||(a=function(e){const t=e.getSelection();(0,re.e)(t,"selection");const n=t.rangeCount?t.getRangeAt(0):null;return n?Kt(n):null}(A)):a=null;const I=SG(u)?!v:v,{keepCaretInsideBlock:E}=n();if(d)(function(e,t){const n=qq(e,t,s);return n&&sD(n)})(u,v)&&C(u,v)&&(s.contentEditable=!0,s.focus());else if(!x||!Wq(u,v)||p&&!Gq(u,I)||E)_&&A.getSelection().isCollapsed&&Gq(u,I)&&!E&&(EG(qq(u,I,s),v),l.preventDefault());else{const e=qq(u,v,s,!0);e&&(function(e,t,n){IG(e,t,n?.left)}(e,p?!v:v,p?void 0:a),l.preventDefault())}}return s.addEventListener("mousedown",l),s.addEventListener("keydown",c),()=>{s.removeEventListener("mousedown",l),s.removeEventListener("keydown",c)}},[])}function Yq(){const e=(0,zt.A)(e=>e(Qy).getSettings().isPreviewMode,[]);return(0,bt.A)(t=>{if(e)return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)};function n(e){const{keyCode:n,shiftKey:i,target:r}=e,o=n===Rt.wn,s=n===Rt.UP,a=n===Rt.PX,l=n===Rt.M3,c=n===Rt.NS;if(!o&&!(s||a||l||c))return;const u=o?i:s||l,d=Array.from(t.querySelectorAll("[data-block]"));if(!d.length)return;const h=r.closest("[data-block]"),p=h?d.indexOf(h):-1;if(-1===p)return;if(o){if(u&&0===p)return;if(!u&&p===d.length-1)return}let f;f=u?p<=0?d.length-1:p-1:-1===p||p>=d.length-1?0:p+1,e.preventDefault(),d[f].focus()}},[e])}function Jq(e,t,n){let i=t;do{if(e===i)return!0;for(i=i[n];i&&i.nodeType===i.TEXT_NODE&&""===i.nodeValue;)i=i["lastChild"===n?"previousSibling":"nextSibling"]}while(i);return!1}function Xq(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,zt.A)(Qy),{multiSelect:i,selectBlock:r}=(0,Vt.A)(Qy),o=(0,$T.ZK)();return(0,bt.A)(s=>{function a(a){if(!o("core/block-editor/select-all",a))return;const l=t();if(l.length<2&&!function(e){if(xG(e))return 0===e.selectionStart&&e.value.length===e.selectionEnd;if(!e.isContentEditable)return!0;const t=e.textContent||"";if(""===t||"\ufeff"===t)return!0;const{ownerDocument:n}=e,{defaultView:i}=n;(0,re.e)(i,"defaultView");const r=i.getSelection();(0,re.e)(r,"selection");const o=r.rangeCount?r.getRangeAt(0):null;if(!o)return!0;const{startContainer:s,endContainer:a,startOffset:l,endOffset:c}=o;if(s===e&&a===e&&0===l&&c===e.childNodes.length)return!0;const u=e.lastChild;(0,re.e)(u,"lastChild");const d=a.nodeType===a.TEXT_NODE?a.data.length:a.childNodes.length;return Jq(s,e,"firstChild")&&Jq(a,e,"lastChild")&&0===l&&c===d}(a.target))return;a.preventDefault();const{ownerDocument:c}=a.target,[u]=l,d=sD(c.activeElement);if(d&&d!==u&&!oD(c.getElementById("block-"+u),c.activeElement))return void r(d);const h=n(u),p=e(h);l.length!==p.length?i(p[0],p[p.length-1]):h&&(s.ownerDocument.defaultView.getSelection().removeAllRanges(),r(h))}return s.addEventListener("keydown",a),()=>{s.removeEventListener("keydown",a)}},[])}function Zq(e,t){e.contentEditable=t,t&&e.focus()}function Qq(){const{startMultiSelect:e,stopMultiSelect:t}=(0,Vt.A)(Qy),{getSettings:n,isSelectionEnabled:i,hasSelectedBlock:r,isDraggingBlocks:o,isMultiSelecting:s}=(0,zt.A)(Qy);return(0,bt.A)(a=>{const{ownerDocument:l}=a,{defaultView:c}=l;let u,d,h;function p(){t(),c.removeEventListener("mouseup",p),d=c.requestAnimationFrame(()=>{if(!r())return;Zq(a,!1);const e=c.getSelection();if(e.rangeCount){const t=e.getRangeAt(0),{commonAncestorContainer:n}=t,i=t.cloneRange();u.contains(n)&&(u.focus(),e.removeAllRanges(),e.addRange(i))}})}function f({buttons:t,target:r,relatedTarget:l}){r.contains(h)&&(r.contains(l)||o()||1===t&&(s()||a!==r&&("true"===r.getAttribute("contenteditable")||n().isPreviewMode)&&i()&&(u=r,e(),c.addEventListener("mouseup",p),Zq(a,!0))))}return a.addEventListener("mouseout",f),a.addEventListener("mousedown",function({target:e}){h=e}),()=>{a.removeEventListener("mouseout",f),c.removeEventListener("mouseup",p),c.cancelAnimationFrame(d)}},[e,t,i,r])}function eK(e,t){e.contentEditable!==String(t)&&(e.contentEditable=t,t&&e.focus())}function tK(e){const t=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;return t?.closest("[data-wp-block-attribute-key]")}function nK(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,Vt.A)(Qy),{getBlockParents:i,getBlockSelectionStart:r,isMultiSelecting:o}=(0,zt.A)(Qy);return(0,bt.A)(s=>{const{ownerDocument:a}=s,{defaultView:l}=a;function c(c){const u=l.getSelection();if(!u.rangeCount)return;const d=function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE||0===n?t:t.childNodes[n-1]}(u),h=function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE||n===t.childNodes.length?t:0===n&&$q(e)?t.previousSibling??t.parentElement:t.childNodes[n]}(u);if(!s.contains(d)||!s.contains(h))return;const p=c.shiftKey&&"mouseup"===c.type;if(u.isCollapsed&&!p){if("true"===s.contentEditable&&!o()){eK(s,!1);let e=d.nodeType===d.ELEMENT_NODE?d:d.parentElement;e=e?.closest("[contenteditable]"),e?.focus()}return}let f=sD(d),m=sD(h);if(p){const e=r(),t=sD(c.target),n=t!==m;(f===m&&u.isCollapsed||!m||n)&&(m=t),f!==e&&(f=e)}if(void 0!==f||void 0!==m){if("mouseup"===c.type&&!c.shiftKey&&!o()&&f===m){const e=sD(c.target);if(e&&e!==f)return void u.removeAllRanges()}if(f===m)if(o())e(f,f);else{const e=!u.isCollapsed&&(tK(d)||tK(h));if(e&&a.activeElement!==e){const t=We({element:e,range:u.getRangeAt(0),__unstableIsEditableTree:!0});n({start:{clientId:f,attributeKey:e.dataset.wpBlockAttributeKey,offset:t.start??0},end:{clientId:f,attributeKey:e.dataset.wpBlockAttributeKey,offset:t.end}})}else t(f)}else{const t=[...i(f),f],r=[...i(m),m],o=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,r);if(t[o]!==f||r[o]!==m)return void e(t[o],r[o]);const s=tK(d),a=tK(h);if(s&&a){const e=u.getRangeAt(0),t=We({element:s,range:e,__unstableIsEditableTree:!0}),i=We({element:a,range:e,__unstableIsEditableTree:!0}),r=t.start??t.end,o=i.start??i.end;n({start:{clientId:f,attributeKey:s.dataset.wpBlockAttributeKey,offset:r},end:{clientId:m,attributeKey:a.dataset.wpBlockAttributeKey,offset:o}})}else e(f,m)}}else eK(s,!1)}return a.addEventListener("selectionchange",c),l.addEventListener("mouseup",c),()=>{a.removeEventListener("selectionchange",c),l.removeEventListener("mouseup",c)}},[e,t,n,i])}function iK(){const{selectBlock:e}=(0,Vt.A)(Qy),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:i}=(0,zt.A)(Qy);return(0,bt.A)(r=>{function o(o){if(!t()||0!==o.button)return;const s=n(),a=sD(o.target);o.shiftKey?s&&s!==a&&(r.contentEditable=!0,r.focus()):i()&&e(a)}return r.addEventListener("mousedown",o),()=>{r.removeEventListener("mousedown",o)}},[e,t,n,i])}function rK(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,getSelectedBlockClientId:n,__unstableIsSelectionMergeable:i,hasMultiSelection:r,getBlockName:o,canInsertBlockType:s,getBlockRootClientId:a,getSelectionStart:l,getSelectionEnd:c,getBlockAttributes:u}=(0,zt.A)(Qy),{replaceBlocks:d,__unstableSplitSelection:h,removeBlocks:p,__unstableDeleteSelection:f,__unstableExpandSelection:m,__unstableMarkAutomaticChange:g}=(0,Vt.A)(Qy);return(0,bt.A)(b=>{function y(e){"true"===b.contentEditable&&e.preventDefault()}function v(y){if(!y.defaultPrevented)if(r())y.keyCode===Rt.Fm?(b.contentEditable=!1,y.preventDefault(),e()?d(t(),er(gn())):h()):y.keyCode===Rt.G_||y.keyCode===Rt.SJ?(b.contentEditable=!1,y.preventDefault(),e()?p(t()):i()?f(y.keyCode===Rt.SJ):m()):1!==y.key.length||y.metaKey||y.ctrlKey||(b.contentEditable=!1,i()?f(y.keyCode===Rt.SJ):(y.preventDefault(),b.ownerDocument.defaultView.getSelection().removeAllRanges()));else if(y.keyCode===Rt.Fm){if(y.shiftKey||e())return;const t=n(),i=o(t),r=l(),p=c();if(r.attributeKey===p.attributeKey){const e=u(t)[r.attributeKey],n=ar(lr("from").filter(({type:e})=>"enter"===e),t=>t.regExp.test(e));if(n)return d(t,n.transform({content:e})),void g()}if(!_n(i,"splitting",!1)&&!y.__deprecatedOnSplit)return;(s(gn(),a(t))||s(i,a(t)))&&(h(),y.preventDefault())}}function _(e){r()&&(b.contentEditable=!1,i()?f():(e.preventDefault(),b.ownerDocument.defaultView.getSelection().removeAllRanges()))}return b.addEventListener("beforeinput",y),b.addEventListener("keydown",v),b.addEventListener("compositionstart",_),()=>{b.removeEventListener("beforeinput",y),b.removeEventListener("keydown",v),b.removeEventListener("compositionstart",_)}},[])}function oK(e){(0,re.e)(e.defaultView,"doc.defaultView");const t=e.defaultView.getSelection();(0,re.e)(t,"selection");const n=t.rangeCount?t.getRangeAt(0):null;return!!n&&!n.collapsed}function sK(){const{getBlockName:e}=(0,zt.A)(Qy),{getBlockType:t}=(0,zt.A)(Zi),{createSuccessNotice:n}=(0,Vt.A)(Rb.store);return(0,T.useCallback)((i,r)=>{let o="";if("copyStyles"===i)o=(0,ee.__)("Styles copied to clipboard.");else if(1===r.length){const n=r[0],s=t(e(n))?.title;o="copy"===i?(0,ee.sprintf)((0,ee.__)('Copied "%s" to clipboard.'),s):(0,ee.sprintf)((0,ee.__)('Moved "%s" to clipboard.'),s)}else o="copy"===i?(0,ee.sprintf)((0,ee._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,ee.sprintf)((0,ee._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(o,{type:"snackbar"})},[n,e,t])}var aK=Symbol("requiresWrapperOnCopy");function lK(e,t,n){let i=t;const[r]=t;if(r&&n.select(Zi).getBlockType(r.name)[aK]){const{getBlockRootClientId:e,getBlockName:t,getBlockAttributes:o}=n.select(Qy),s=e(r.clientId),a=t(s);a&&(i=er(a,o(s),i))}const o=Fr(i);e.clipboardData.setData("text/plain",ae(o.replace(/<br>/g,"\n")).trim().replace(/\n\n+/g,"\n\n")),e.clipboardData.setData("text/html",o)}function cK(){const e=(0,yt.A)(),{getBlocksByClientId:t,getSelectedBlockClientIds:n,hasMultiSelection:i,getSettings:r,getBlockName:o,__unstableIsFullySelected:s,__unstableIsSelectionCollapsed:a,__unstableIsSelectionMergeable:l,__unstableGetSelectedBlocksWithPartialSelection:c,canInsertBlockType:u,getBlockRootClientId:d}=(0,zt.A)(Qy),{flashBlock:h,removeBlocks:p,replaceBlocks:f,__unstableDeleteSelection:m,__unstableExpandSelection:g,__unstableSplitSelection:b}=(0,Vt.A)(Qy),y=sK();return(0,bt.A)(v=>{function _(_){if(_.defaultPrevented)return;const x=n();if(0===x.length)return;if(!i()){const{target:e}=_,{ownerDocument:t}=e,n="copy"===_.type||"cut"===_.type?function(e){return oK(e)||!!e.activeElement&&function(e){if(!vG(e)&&!_G(e))return!1;try{const{selectionStart:t,selectionEnd:n}=e;return null===t||t!==n}catch{return!0}}(e.activeElement)}(t):function(e){return!!e.activeElement&&(vG(e.activeElement)||_G(e.activeElement)||oK(e))}(t)&&!t.activeElement.isContentEditable;if(n)return}const{activeElement:k}=_.target.ownerDocument;if(!v.contains(k))return;const w=l(),C=a()||s(),S=!C&&!w;if("copy"===_.type||"cut"===_.type)if(_.preventDefault(),1===x.length&&h(x[0]),S)g();else{let n;if(y(_.type,x),C)n=t(x);else{const[e,i]=c();n=[e,...t(x.slice(1,x.length-1)),i]}lK(_,n,e)}if("cut"===_.type)C&&!S?p(x):(_.target.ownerDocument.activeElement.contentEditable=!1,m());else if("paste"===_.type){const{__experimentalCanUserUseUnfilteredHTML:e,mediaUpload:t}=r();if("true"===_.clipboardData.getData("rich-text"))return;const{plainText:n,html:a,files:l}=Pj(_),c=s();let h=[];if(l.length){if(!t)return void _.preventDefault();const e=lr("from");h=l.reduce((t,n)=>{const i=ar(e,e=>"files"===e.type&&e.isMatch([n]));return i&&t.push(i.transform([n])),t},[]).flat()}else h=Zs({HTML:a,plainText:n,mode:c?"BLOCKS":"AUTO",canUserUseUnfilteredHTML:e});if("string"==typeof h)return;if(c)return f(x,h,h.length-1,-1),void _.preventDefault();if(!i()&&!_n(o(x[0]),"splitting",!1)&&!_.__deprecatedOnSplit)return;const[p]=x,m=d(p),g=[];for(const e of h)if(u(e.name,m))g.push(e);else{const t=o(m),n=e.name!==t?ur(e,t):[e];if(!n)return;for(const e of n)for(const t of e.innerBlocks)g.push(t)}b(g),_.preventDefault()}}return v.ownerDocument.addEventListener("copy",_),v.ownerDocument.addEventListener("cut",_),v.ownerDocument.addEventListener("paste",_),()=>{v.ownerDocument.removeEventListener("copy",_),v.ownerDocument.removeEventListener("cut",_),v.ownerDocument.removeEventListener("paste",_)}},[])}function uK(){const[e,t,n]=function(){const e=(0,T.useRef)(),t=(0,T.useRef)(),n=(0,T.useRef)(),{hasMultiSelection:i,getSelectedBlockClientId:r,getBlockCount:o,getBlockOrder:s,getLastFocus:a,getSectionRootClientId:l,isZoomOut:c}=Gh((0,zt.A)(Qy)),{setLastFocus:u}=Gh((0,Vt.A)(Qy)),d=(0,T.useRef)();function h(t){const n=e.current.ownerDocument===t.target.ownerDocument?e.current:e.current.ownerDocument.defaultView.frameElement;if(d.current)d.current=null;else if(i())e.current.focus();else if(r())a()?.current?a().current.focus():e.current.querySelector(`[data-block="${r()}"]`).focus();else if(c()){const t=l(),i=s(t);i.length?e.current.querySelector(`[data-block="${i[0]}"]`).focus():t?e.current.querySelector(`[data-block="${t}"]`).focus():n.focus()}else{const i=t.target.compareDocumentPosition(n)&t.target.DOCUMENT_POSITION_FOLLOWING,r=hS.XC.tabbable.find(e.current);r.length&&(i?r[0]:r[r.length-1]).focus()}}const p=(0,Er.jsx)("div",{ref:t,tabIndex:"0",onFocus:h}),f=(0,Er.jsx)("div",{ref:n,tabIndex:"0",onFocus:h}),m=(0,bt.A)(i=>{function r(e){if(e.defaultPrevented)return;if(e.keyCode!==Rt.wn)return;if(!n.current||!t.current)return;const{target:i,shiftKey:r}=e,o=r?"findPrevious":"findNext",s=hS.XC.tabbable[o](i),a=i.closest("[data-block]"),l=a&&s&&(function(e,t){return e.closest(nD)===t.closest(nD)}(a,s)||oD(a,s));if(kG(s)&&l)return;const c=r?t:n;d.current=!0,c.current.focus({preventScroll:!0})}function s(e){u({...a(),current:e.target});const{ownerDocument:t}=i;!e.relatedTarget&&e.target.hasAttribute("data-block")&&t.activeElement===t.body&&0===o()&&i.focus()}function l(i){if(i.keyCode!==Rt.wn)return;if("region"===i.target?.getAttribute("role"))return;if(e.current===i.target)return;const r=i.shiftKey?"findPrevious":"findNext",o=hS.XC.tabbable[r](i.target);o!==t.current&&o!==n.current||(i.preventDefault(),o.focus({preventScroll:!0}))}const{ownerDocument:c}=i,{defaultView:h}=c;return h.addEventListener("keydown",l),i.addEventListener("keydown",r),i.addEventListener("focusout",s),()=>{h.removeEventListener("keydown",l),i.removeEventListener("keydown",r),i.removeEventListener("focusout",s)}},[]);return[p,(0,gt.A)([e,m]),f]}(),i=(0,zt.A)(e=>e(Qy).hasMultiSelection(),[]);return[e,(0,gt.A)([t,cK(),rK(),Qq(),nK(),iK(),Uq(),Xq(),Kq(),Yq(),(0,bt.A)(e=>(e.tabIndex=0,e.dataset.hasMultiSelection=i,i?(e.setAttribute("aria-label",(0,ee.__)("Multiple selected blocks")),()=>{delete e.dataset.hasMultiSelection,e.removeAttribute("aria-label")}):()=>{delete e.dataset.hasMultiSelection}),[i])]),n]}var dK=(0,T.forwardRef)(function({children:e,...t},n){const[i,r,o]=uK();return(0,Er.jsxs)(Er.Fragment,{children:[i,(0,Er.jsx)("div",{...t,ref:(0,gt.A)([r,n]),className:(0,mh.A)(t.className,"block-editor-writing-flow"),children:e}),o]})}),hK=null;function pK({frameSize:e,containerWidth:t,maxContainerWidth:n,scaleContainerWidth:i}){return(Math.min(t,n)-2*e)/i}function fK(e,t,n){const i={};for(const t in e)i[t]=e[t];if(e instanceof n.contentDocument.defaultView.MouseEvent){const e=n.getBoundingClientRect();i.clientX+=e.left,i.clientY+=e.top}const r=new t(e.type,i);i.defaultPrevented&&r.preventDefault(),!n.dispatchEvent(r)&&e.preventDefault()}function mK(e){return(0,bt.A)(()=>{const{defaultView:t}=e;if(!t)return;const{frameElement:n}=t,i=e.documentElement,r=["dragover","mousemove"],o={};for(const e of r)o[e]=e=>{const t=Object.getPrototypeOf(e).constructor.name;fK(e,window[t],n)},i.addEventListener(e,o[e]);return()=>{for(const e of r)i.removeEventListener(e,o[e])}})}var gK=new WeakMap,bK=globalThis.FinalizationRegistry?new globalThis.FinalizationRegistry(e=>URL.revokeObjectURL(e)):void 0;function yK({contentRef:e,children:t,tabIndex:n=0,scale:i=1,frameSize:r=0,readonly:o,forwardedRef:s,title:a=(0,ee.__)("Editor canvas"),...l}){const{resolvedAssets:c,isPreviewMode:u}=(0,zt.A)(e=>{const t=e(Qy).getSettings();return{resolvedAssets:t.__unstableResolvedAssets,isPreviewMode:t.isPreviewMode}},[]),[d,h]=(0,T.useState)(),[p,f]=(0,T.useState)([]),[m,g,b]=uK(),y=(0,bt.A)(e=>{let t;function n(e){e.preventDefault()}function i(e){"A"===e.target.tagName&&e.target.getAttribute("href")?.startsWith("#")&&(e.preventDefault(),t.defaultView.location.hash=e.target.getAttribute("href").slice(1))}const{ownerDocument:r}=e;function o(){const{contentDocument:o}=e,{documentElement:s}=o;t=o,h(o),s.classList.add("block-editor-iframe__html"),o.dir=r.dir;for(const e of hK||(hK=Array.from(document.styleSheets).reduce((e,t)=>{try{t.cssRules}catch{return e}const{ownerNode:n,cssRules:i}=t;if(null===n)return e;if(!i)return e;if(n.id.startsWith("wp-"))return e;if(!n.id)return e;if(function e(t){return Array.from(t).find(({selectorText:t,conditionText:n,cssRules:i})=>n?e(i):t&&(t.includes(".editor-styles-wrapper")||t.includes(".wp-block")))}(i)){const t="STYLE"===n.tagName;if(t){const t=n.id.replace("-inline-css","-css"),i=document.getElementById(t);i&&e.push(i.cloneNode(!0))}if(e.push(n.cloneNode(!0)),!t){const t=n.id.replace("-css","-inline-css"),i=document.getElementById(t);i&&e.push(i.cloneNode(!0))}}return e},[])))o.getElementById(e.id)||(o.head.appendChild(e.cloneNode(!0)),u||console.warn(`${e.id} was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,e));t.addEventListener("dragover",n,!1),t.addEventListener("drop",n,!1),t.addEventListener("click",i)}return f(Array.from(r.body.classList).filter(e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e)),e.addEventListener("load",o),()=>{h(void 0),e.removeEventListener("load",o),t?.removeEventListener("dragover",n),t?.removeEventListener("drop",n),t?.removeEventListener("click",i)}},[]),{contentResizeListener:v,containerResizeListener:_,isZoomedOut:x,scaleContainerWidth:k}=function({frameSize:e,iframeDocument:t,maxContainerWidth:n=750,scale:i}){const[r,{height:o}]=(0,SC.A)(),[s,{width:a,height:l}]=(0,SC.A)(),c=(0,T.useRef)(0),u=1!==i,d=(0,LS.A)(),h="auto-scaled"===i,p=(0,T.useRef)(!1),f=(0,T.useRef)(null);(0,T.useEffect)(()=>{u||(c.current=a)},[a,u]);const m=Math.max(c.current,a),g=h?pK({frameSize:e,containerWidth:a,maxContainerWidth:n,scaleContainerWidth:m}):i,b=(0,T.useRef)({scaleValue:g,frameSize:e,containerHeight:0,scrollTop:0,scrollHeight:0}),y=(0,T.useRef)({scaleValue:g,frameSize:e,containerHeight:0,scrollTop:0,scrollHeight:0}),v=(0,T.useCallback)(()=>{const{scrollTop:e}=b.current,{scrollTop:n}=y.current;return t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scroll-top",`${e}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scroll-top-next",`${n}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-overflow-behavior",b.current.scrollHeight===b.current.containerHeight?"auto":"scroll"),t.documentElement.classList.add("zoom-out-animation"),t.documentElement.animate(function(e,t){const{scaleValue:n,frameSize:i,scrollTop:r}=e,{scaleValue:o,frameSize:s,scrollTop:a}=t;return[{translate:"0 0",scale:n,paddingTop:i/n+"px",paddingBottom:i/n+"px"},{translate:`0 ${r-a}px`,scale:o,paddingTop:s/o+"px",paddingBottom:s/o+"px"}]}(b.current,y.current),{easing:"cubic-bezier(0.46, 0.03, 0.52, 0.96)",duration:400})},[t]),_=(0,T.useCallback)(()=>{p.current=!1,f.current=null,t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scale",y.current.scaleValue),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-frame-size",`${y.current.frameSize}px`),t.documentElement.classList.remove("zoom-out-animation"),t.documentElement.scrollTop=y.current.scrollTop,t.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-scroll-top"),t.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-scroll-top-next"),t.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-overflow-behavior"),b.current=y.current},[t]),x=(0,T.useRef)(!1);return(0,T.useEffect)(()=>{const e=t&&x.current!==u;if(x.current=u,e&&(p.current=!0,u))return t.documentElement.classList.add("is-zoomed-out"),()=>{t.documentElement.classList.remove("is-zoomed-out")}},[t,u]),(0,T.useEffect)(()=>{if(t&&(h&&1!==b.current.scaleValue&&(b.current.scaleValue=pK({frameSize:b.current.frameSize,containerWidth:a,maxContainerWidth:n,scaleContainerWidth:a})),g<1&&(p.current||(t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scale",g),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-frame-size",`${e}px`)),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-content-height",`${o}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-inner-height",`${l}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-container-width",`${a}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scale-container-width",`${m}px`)),p.current))if(p.current=!1,f.current){f.current.reverse();const e=b.current,t=y.current;b.current=t,y.current=e}else b.current.scrollTop=t.documentElement.scrollTop,b.current.scrollHeight=t.documentElement.scrollHeight,b.current.containerHeight=l,y.current={scaleValue:g,frameSize:e,containerHeight:t.documentElement.clientHeight},y.current.scrollHeight=function(e,t){const{scaleValue:n,scrollHeight:i}=e,{frameSize:r,scaleValue:o}=t;return i*(o/n)+2*r}(b.current,y.current),y.current.scrollTop=function(e,t){const{containerHeight:n,frameSize:i,scaleValue:r,scrollTop:o}=e,{containerHeight:s,frameSize:a,scaleValue:l,scrollHeight:c}=t;let u=o;u=(u+n/2-i)/r-n/2,u=(u+s/2)*l+a-s/2,u=o<=i?0:u;const d=c-s;return Math.round(Math.min(Math.max(0,u),Math.max(0,d)))}(b.current,y.current),f.current=v(),d?_():f.current.onfinish=_},[v,_,d,h,g,e,t,o,a,l,n,m]),{isZoomedOut:u,scaleContainerWidth:m,contentResizeListener:r,containerResizeListener:s}}({scale:i,frameSize:parseInt(r),iframeDocument:d}),w=ZU({isDisabled:!o}),C=(0,gt.A)([mK(d),e,g,w]),S=(0,bt.A)(e=>e.ownerDocument.defaultView?(C(e),()=>C(null)):()=>{},[C]),A=function(e){let t=gK.get(e);if(t)return t;const n=`<!doctype html>\n<html>\n\t<head>\n\t\t<meta charset="utf-8">\n\t\t<base href="${window.location.href}">\n\t\t<style>\n\t\t\thtml{\n\t\t\t\theight: auto !important;\n\t\t\t\tmin-height: 100%;\n\t\t\t}\n\t\t\t/* Lowest specificity to not override global styles */\n\t\t\t:where(body) {\n\t\t\t\tmargin: 0;\n\t\t\t\t/* Default background color in case zoom out mode background\n\t\t\t\tcolors the html element */\n\t\t\t\tbackground-color: white;\n\t\t\t}\n\t\t</style>\n\t\t${e.styles??""}\n\t\t${e.scripts??""}\n\t</head>\n\t<body>\n\t\t<script>document.currentScript.parentElement.remove()<\/script>\n\t</body>\n</html>`;return t=URL.createObjectURL(new Blob([n],{type:"text/html"})),gK.set(e,t),bK?.register(e,t),t}(c),I=n>=0&&!u,E=(0,Er.jsxs)(Er.Fragment,{children:[I&&m,(0,Er.jsx)("iframe",{...l,style:{...l.style,height:l.style?.height,border:0},ref:(0,gt.A)([s,y]),tabIndex:n,src:A,title:a,onKeyDown:e=>{if(l.onKeyDown&&l.onKeyDown(e),e.currentTarget.ownerDocument!==e.target.ownerDocument){const{stopPropagation:t}=e.nativeEvent;e.nativeEvent.stopPropagation=()=>{},e.stopPropagation(),e.nativeEvent.stopPropagation=t,fK(e,window.KeyboardEvent,e.currentTarget)}},children:d&&(0,Wj.createPortal)((0,Er.jsxs)("body",{ref:S,className:(0,mh.A)("block-editor-iframe__body","editor-styles-wrapper",...p),children:[v,(0,Er.jsx)(Cv.A,{document:d,children:t})]}),d.documentElement)}),I&&b]});return(0,Er.jsxs)("div",{className:"block-editor-iframe__container",children:[_,(0,Er.jsx)("div",{className:(0,mh.A)("block-editor-iframe__scale-container",x&&"is-zoomed-out"),style:{"--wp-block-editor-iframe-zoom-out-scale-container-width":x&&`${k}px`},children:E})]})}var vK=(0,T.forwardRef)(function(e,t){return(0,zt.A)(e=>e(Qy).getSettings().__internalIsInitialized,[])?(0,Er.jsx)(yK,{...e,forwardedRef:t}):null});function _K(e,t){return(0,T.useCallback)(e=>{if(!e)return;const{ownerDocument:n}=e,{defaultView:i,body:r}=n,o=t?n.querySelector(t):r;let s;if(o)s=i?.getComputedStyle(o,null).getPropertyValue("background-color");else{const e=n.createElement("div");e.classList.add("editor-styles-wrapper"),r.appendChild(e),s=i?.getComputedStyle(e,null).getPropertyValue("background-color"),r.removeChild(e)}const a=(0,te.Mj)(s);a.luminance()>.5||0===a.alpha()?r.classList.remove("is-dark-theme"):r.classList.add("is-dark-theme")},[e,t])}(0,te.X$)([ne.A,ie.A]);var xK=(0,T.memo)(function({styles:e,scope:t,transformOptions:n}){const i=(0,zt.A)(e=>Gh(e(Qy)).getStyleOverrides(),[]),[r,o]=(0,T.useMemo)(()=>{const r=Object.values(e??[]);for(const[e,t]of i){const n=r.findIndex(({id:t})=>e===t),i={...t,id:e};-1===n?r.push(i):r[n]=i}return[WF(r.filter(e=>e?.css),t,n),r.filter(e=>"svgs"===e.__unstableType).map(e=>e.assets).join("")]},[e,i,t,n]);return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)("style",{ref:_K(r,t)}),r.map((e,t)=>(0,Er.jsx)("style",{children:e},t)),(0,Er.jsx)(AC.t4,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 0 0",width:"0",height:"0",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"},dangerouslySetInnerHTML:{__html:o}})]})}),kK=(0,T.memo)(Mq),wK=2e3,CK=[];function SK({viewportWidth:e,containerWidth:t,minHeight:n,additionalStyles:i=CK}){e||(e=t);const[r,{height:o}]=(0,SC.A)(),{styles:s}=(0,zt.A)(e=>({styles:e(Qy).getSettings().styles}),[]),a=(0,T.useMemo)(()=>s?[...s,{css:"body{height:auto;overflow:hidden;border:none;padding:0;}",__unstableType:"presets"},...i]:s,[s,i]),l=t/e,c=o?t/(o*l):0;return(0,Er.jsx)(TU,{className:"block-editor-block-preview__content",style:{transform:`scale(${l})`,aspectRatio:c,maxHeight:o>wK?wK*l:void 0,minHeight:n},children:(0,Er.jsxs)(vK,{contentRef:(0,bt.A)(e=>{const{ownerDocument:{documentElement:t}}=e;t.classList.add("block-editor-block-preview__content-iframe"),t.style.position="absolute",t.style.width="100%",e.style.boxSizing="border-box",e.style.position="absolute",e.style.width="100%"},[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:e,height:o,pointerEvents:"none",maxHeight:wK,minHeight:0!==l&&l<1&&n?n/l:n},children:[(0,Er.jsx)(xK,{styles:a}),r,(0,Er.jsx)(kK,{renderAppender:!1})]})})}function AK(e){const[t,{width:n}]=(0,SC.A)();return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)("div",{style:{position:"relative",width:"100%",height:0},children:t}),(0,Er.jsx)("div",{className:"block-editor-block-preview__container",children:!!n&&(0,Er.jsx)(SK,{...e,containerWidth:n})})]})}var IK=n(50303),EK=(0,IK.y)(),jK=[],TK=(0,T.memo)(function({blocks:e,viewportWidth:t=1200,minHeight:n,additionalStyles:i=jK,__experimentalMinHeight:r,__experimentalPadding:o}){r&&(n=r,(0,Qt.A)("The __experimentalMinHeight prop",{since:"6.2",version:"6.4",alternative:"minHeight"})),o&&(i=[...i,{css:`body { padding: ${o}px; }`}],(0,Qt.A)("The __experimentalPadding prop of BlockPreview",{since:"6.2",version:"6.4",alternative:"additionalStyles"}));const s=(0,zt.A)(e=>e(Qy).getSettings(),[]),a=(0,T.useMemo)(()=>({...s,focusMode:!1,isPreviewMode:!0}),[s]),l=(0,T.useMemo)(()=>Array.isArray(e)?e:[e],[e]);return e&&0!==e.length?(0,Er.jsx)(kU,{value:l,settings:a,children:(0,Er.jsx)(AK,{viewportWidth:t,minHeight:n,additionalStyles:i})}):null});TK.Async=function({children:e,placeholder:t}){const[n,i]=(0,T.useState)(!1);return(0,T.useEffect)(()=>{const e={};return EK.add(e,()=>{(0,Wj.flushSync)(()=>{i(!0)})}),()=>{EK.cancel(e)}},[]),n?e:t};var BK=TK,NK=function({item:e}){const{name:t,title:n,icon:i,description:r,initialAttributes:o,example:s}=e,a=xn(e),l=(0,T.useMemo)(()=>s?mr(t,{attributes:{...s.attributes,...o},innerBlocks:s.innerBlocks}):er(t,o),[t,s,o]),c=s?.viewportWidth??500,u=280/c,d=0!==u&&u<1?144/u:144;return(0,Er.jsxs)("div",{className:"block-editor-inserter__preview-container",children:[(0,Er.jsx)("div",{className:"block-editor-inserter__preview",children:a||s?(0,Er.jsx)("div",{className:"block-editor-inserter__preview-content",children:(0,Er.jsx)(BK,{blocks:l,viewportWidth:c,minHeight:144,additionalStyles:[{css:`\n\t\t\t\t\t\t\t\t\t\tbody { \n\t\t\t\t\t\t\t\t\t\t\tpadding: 24px;\n\t\t\t\t\t\t\t\t\t\t\tmin-height:${Math.round(d)}px;\n\t\t\t\t\t\t\t\t\t\t\tdisplay:flex;\n\t\t\t\t\t\t\t\t\t\t\talign-items:center;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t.is-root-container { width: 100%; }\n\t\t\t\t\t\t\t\t\t`}]})}):(0,Er.jsx)("div",{className:"block-editor-inserter__preview-content-missing",children:(0,ee.__)("No preview available.")})}),!a&&(0,Er.jsx)(zz,{title:n,icon:i,description:r})]})},RK=function(e,t={step:1}){const{step:n=1}=t,[i,r]=(0,T.useState)([]);return(0,T.useEffect)(()=>{let t=function(e,t){const n=[];for(let i=0;i<e.length;i++){const r=e[i];if(!t.includes(r))break;n.push(r)}return n}(e,i);t.length<n&&(t=t.concat(e.slice(t.length,n))),r(t);const o=(0,IK.y)();for(let i=t.length;i<e.length;i+=n)o.add({},()=>{(0,Wj.flushSync)(()=>{r(t=>[...t,...e.slice(i,i+n)])})});return()=>o.reset()},[e]),i},OK=(0,T.forwardRef)(function({isFirst:e,as:t,children:n,...i},r){return(0,Er.jsx)(II.e.Item,{ref:r,role:"option",accessibleWhenDisabled:!0,...i,render:i=>{const r={...i,tabIndex:e?0:i.tabIndex};return t?(0,Er.jsx)(t,{...r,children:n}):"function"==typeof n?n(r):(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,...r,children:n})}})}),LK="is-dragging-components-draggable",MK=function({children:e,onDragStart:t,onDragOver:n,onDragEnd:i,appendToOwnerDocument:r=!1,cloneClassname:o,elementId:s,transferData:a,__experimentalTransferDataType:l="text",__experimentalDragComponent:c}){const u=(0,T.useRef)(null),d=(0,T.useRef)(()=>{});return(0,T.useEffect)(()=>()=>{d.current()},[]),(0,Er.jsxs)(Er.Fragment,{children:[e({onDraggableStart:function(e){const{ownerDocument:i}=e.target;e.dataTransfer.setData(l,JSON.stringify(a));const c=i.createElement("div");c.style.top="0",c.style.left="0";const h=i.createElement("div");"function"==typeof e.dataTransfer.setDragImage&&(h.classList.add("components-draggable__invisible-drag-image"),i.body.appendChild(h),e.dataTransfer.setDragImage(h,0,0)),c.classList.add("components-draggable__clone"),o&&c.classList.add(o);let p=0,f=0;if(u.current){p=e.clientX,f=e.clientY,c.style.transform=`translate( ${p}px, ${f}px )`;const t=i.createElement("div");t.innerHTML=u.current.innerHTML,c.appendChild(t),i.body.appendChild(c)}else{const e=i.getElementById(s),t=e.getBoundingClientRect(),n=e.parentNode,o=t.top,a=t.left;c.style.width=`${t.width+0}px`;const l=e.cloneNode(!0);l.id=`clone-${s}`,p=a-0,f=o-0,c.style.transform=`translate( ${p}px, ${f}px )`,Array.from(l.querySelectorAll("iframe")).forEach(e=>e.parentNode?.removeChild(e)),c.appendChild(l),r?i.body.appendChild(c):n?.appendChild(c)}let m=e.clientX,g=e.clientY;const b=(0,uq.n)(function(e){if(m===e.clientX&&g===e.clientY)return;const t=p+e.clientX-m,i=f+e.clientY-g;c.style.transform=`translate( ${t}px, ${i}px )`,m=e.clientX,g=e.clientY,p=t,f=i,n&&n(e)},16);i.addEventListener("dragover",b),i.body.classList.add(LK),t&&t(e),d.current=()=>{c&&c.parentNode&&c.parentNode.removeChild(c),h&&h.parentNode&&h.parentNode.removeChild(h),i.body.classList.remove(LK),i.removeEventListener("dragover",b)}},onDraggableEnd:function(e){e.preventDefault(),d.current(),i&&i(e)}}),c&&(0,Er.jsx)("div",{className:"components-draggable-drag-component-root",style:{display:"none"},ref:u,children:c})]})},PK=n(16418);function DK({count:e,icon:t,isPattern:n,fadeWhenDisabled:i}){const r=n&&(0,ee.__)("Pattern");return(0,Er.jsx)("div",{className:"block-editor-block-draggable-chip-wrapper",children:(0,Er.jsx)("div",{className:"block-editor-block-draggable-chip","data-testid":"block-draggable-chip",children:(0,Er.jsxs)(Kv.A,{justify:"center",className:"block-editor-block-draggable-chip__content",children:[(0,Er.jsx)(Yv.A,{children:t?(0,Er.jsx)(hj,{icon:t}):r||(0,ee.sprintf)((0,ee._n)("%d block","%d blocks",e),e)}),(0,Er.jsx)(Yv.A,{children:(0,Er.jsx)(hj,{icon:PK.A})}),i&&(0,Er.jsx)(Yv.A,{className:"block-editor-block-draggable-chip__disabled",children:(0,Er.jsx)("span",{className:"block-editor-block-draggable-chip__disabled-icon"})})]})})})}var FK=({isEnabled:e,blocks:t,icon:n,children:i,pattern:r})=>{const o=1===t.length?t[0].name:void 0,s=(0,zt.A)(e=>o&&e(Zi).getBlockType(o)?.icon,[o]),{startDragging:a,stopDragging:l}=Gh((0,Vt.A)(Qy)),c=(0,T.useMemo)(()=>r?.type===wf&&"unsynced"!==r?.syncStatus?[er("core/block",{ref:r.id})]:void 0,[r?.type,r?.syncStatus,r?.id]);if(!e)return i({draggable:!1,onDragStart:void 0,onDragEnd:void 0});const u=c??t;return(0,Er.jsx)(MK,{__experimentalTransferDataType:"wp-blocks",transferData:{type:"inserter",blocks:u},onDragStart:e=>{a();const t=new Set;for(const n of u){const i=`wp-block:${n.name}`;t.has(i)||(e.dataTransfer.items.add("",i),t.add(i))}},onDragEnd:()=>{l()},__experimentalDragComponent:(0,Er.jsx)(DK,{count:t.length,icon:n||!r&&s,isPattern:!!r}),children:({onDraggableStart:e,onDraggableEnd:t})=>i({draggable:!0,onDragStart:e,onDragEnd:t})})},zK=(0,T.memo)(function({className:e,isFirst:t,item:n,onSelect:i,onHover:r,isDraggable:o,...s}){const a=(0,T.useRef)(!1),l=n.icon?{backgroundColor:n.icon.background,color:n.icon.foreground}:{},c=(0,T.useMemo)(()=>[er(n.name,n.initialAttributes,tr(n.innerBlocks))],[n.name,n.initialAttributes,n.innerBlocks]),u=xn(n)&&"unsynced"!==n.syncStatus||kn(n);return(0,Er.jsx)(FK,{isEnabled:o&&!n.isDisabled,blocks:c,icon:n.icon,children:({draggable:o,onDragStart:c,onDragEnd:d})=>(0,Er.jsx)("div",{className:(0,mh.A)("block-editor-block-types-list__list-item",{"is-synced":u}),draggable:o,onDragStart:e=>{a.current=!0,c&&(r(null),c(e))},onDragEnd:e=>{a.current=!1,d&&d(e)},children:(0,Er.jsxs)(OK,{isFirst:t,className:(0,mh.A)("block-editor-block-types-list__item",e),disabled:n.isDisabled,onClick:e=>{e.preventDefault(),i(n,(0,Hj.H)()?e.metaKey:e.ctrlKey),r(null)},onKeyDown:e=>{const{keyCode:t}=e;t===Rt.Fm&&(e.preventDefault(),i(n,(0,Hj.H)()?e.metaKey:e.ctrlKey),r(null))},onMouseEnter:()=>{a.current||r(n)},onMouseLeave:()=>r(null),...s,children:[(0,Er.jsx)("span",{className:"block-editor-block-types-list__item-icon",style:l,children:(0,Er.jsx)(hj,{icon:n.icon,showColors:!0})}),(0,Er.jsx)("span",{className:"block-editor-block-types-list__item-title",children:(0,Er.jsx)(xC.A,{numberOfLines:3,children:n.title})})]})})})}),VK=(0,T.forwardRef)(function(e,t){const[n,i]=(0,T.useState)(!1);return(0,T.useEffect)(()=>{n&&(0,dt.L)((0,ee.__)("Use left and right arrow keys to move through blocks"))},[n]),(0,Er.jsx)("div",{ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{i(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&i(!1)},...e})}),UK=(0,T.forwardRef)(function(e,t){return(0,Er.jsx)(II.e.Group,{role:"presentation",ref:t,...e})});function $K(e,t){const n=[];for(let i=0,r=e.length;i<r;i+=t)n.push(e.slice(i,i+t));return n}var HK=function e({items:t=[],onSelect:n,onHover:i=()=>{},children:r,label:o,isDraggable:s=!0}){const a="block-editor-block-types-list",l=(0,SS.A)(e,a);return(0,Er.jsxs)(VK,{className:a,"aria-label":o,children:[$K(t,3).map((e,t)=>(0,Er.jsx)(UK,{children:e.map((e,r)=>(0,Er.jsx)(zK,{item:e,className:Tr(e.id),onSelect:n,onHover:i,isDraggable:s&&!e.isDisabled,isFirst:0===t&&0===r,rowId:`${l}-${t}`},e.id))},t)),r]})},WK=function({title:e,icon:t,children:n}){return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsxs)("div",{className:"block-editor-inserter__panel-header",children:[(0,Er.jsx)("h2",{className:"block-editor-inserter__panel-title",children:e}),(0,Er.jsx)(IC.A,{icon:t})]}),(0,Er.jsx)("div",{className:"block-editor-inserter__panel-content",children:n})]})};function GK({key:e,children:t}){return(0,Er.jsx)(T.Fragment,{children:t},e)}var qK=function({children:e}){return(0,Er.jsx)(II.e,{focusShift:!0,focusWrap:"horizontal",render:GK,children:e})},KK=function(){return(0,Er.jsx)("div",{className:"block-editor-inserter__no-results",children:(0,Er.jsx)("p",{children:(0,ee.__)("No results found.")})})},YK=[];function JK({items:e,collections:t,categories:n,onSelectItem:i,onHover:r,showMostUsedBlocks:o,className:s}){const a=(0,T.useMemo)(()=>Uf(e,"frecency","desc").slice(0,6),[e]),l=(0,T.useMemo)(()=>e.filter(e=>!e.category),[e]),c=(0,T.useMemo)(()=>{const n={...t};return Object.keys(t).forEach(t=>{n[t]=e.filter(e=>(e=>e.name.split("/")[0])(e)===t),0===n[t].length&&delete n[t]}),n},[e,t]);(0,T.useEffect)(()=>()=>r(null),[]);const u=RK(n),d=n.length===u.length,h=(0,T.useMemo)(()=>Object.entries(t),[t]),p=RK(d?h:YK);return(0,Er.jsxs)("div",{className:s,children:[o&&e.length>3&&!!a.length&&(0,Er.jsx)(WK,{title:(0,ee._x)("Most used","blocks"),children:(0,Er.jsx)(HK,{items:a,onSelect:i,onHover:r,label:(0,ee._x)("Most used","blocks")})}),u.map(t=>{const n=e.filter(e=>e.category===t.slug);return n&&n.length?(0,Er.jsx)(WK,{title:t.title,icon:t.icon,children:(0,Er.jsx)(HK,{items:n,onSelect:i,onHover:r,label:t.title})},t.slug):null}),d&&l.length>0&&(0,Er.jsx)(WK,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,ee.__)("Uncategorized"),children:(0,Er.jsx)(HK,{items:l,onSelect:i,onHover:r,label:(0,ee.__)("Uncategorized")})}),p.map(([e,t])=>{const n=c[e];return n&&n.length?(0,Er.jsx)(WK,{title:t.title,icon:t.icon,children:(0,Er.jsx)(HK,{items:n,onSelect:i,onHover:r,label:t.title})},e):null})]})}var XK=(0,T.forwardRef)(function({rootClientId:e,onInsert:t,onHover:n,showMostUsedBlocks:i},r){const[o,s,a,l]=bT(e,t);if(!o.length)return(0,Er.jsx)(KK,{});const c=[],u=[];for(const e of o)"reusable"!==e.category&&(e.isSearchOnly||(e.isAllowedInCurrentRoot?c.push(e):u.push(e)));return(0,Er.jsx)(qK,{children:(0,Er.jsxs)("div",{ref:r,children:[!!c.length&&(0,Er.jsx)(Er.Fragment,{children:(0,Er.jsx)(JK,{items:c,categories:s,collections:a,onSelectItem:l,onHover:n,showMostUsedBlocks:i,className:"block-editor-inserter__insertable-blocks-at-selection"})}),(0,Er.jsx)(JK,{items:u,categories:s,collections:a,onSelectItem:l,onHover:n,showMostUsedBlocks:i,className:"block-editor-inserter__all-blocks"})]})})});function ZK({selectedCategory:e,patternCategories:t,onClickCategory:n}){const i="block-editor-block-patterns-explorer__sidebar";return(0,Er.jsx)("div",{className:`${i}__categories-list`,children:t.map(({name:t,label:r})=>(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,label:r,className:`${i}__categories-list__item`,isPressed:e===t,onClick:()=>{n(t)},children:r},t))})}function QK({searchValue:e,setSearchValue:t}){return(0,Er.jsx)("div",{className:"block-editor-block-patterns-explorer__search",children:(0,Er.jsx)(cj.A,{onChange:t,value:e,label:(0,ee.__)("Search"),placeholder:(0,ee.__)("Search")})})}var eY=function({selectedCategory:e,patternCategories:t,onClickCategory:n,searchValue:i,setSearchValue:r}){return(0,Er.jsxs)("div",{className:"block-editor-block-patterns-explorer__sidebar",children:[(0,Er.jsx)(QK,{searchValue:i,setSearchValue:r}),!i&&(0,Er.jsx)(ZK,{selectedCategory:e,patternCategories:t,onClickCategory:n})]})};function tY({currentPage:e,numPages:t,changePage:n,totalItems:i}){return(0,Er.jsxs)(Q_.A,{className:"block-editor-patterns__grid-pagination-wrapper",children:[(0,Er.jsx)(lj.A,{variant:"muted",children:(0,ee.sprintf)((0,ee._n)("%s item","%s items",i),i)}),t>1&&(0,Er.jsxs)(Cw.A,{expanded:!1,spacing:3,justify:"flex-start",className:"block-editor-patterns__grid-pagination",children:[(0,Er.jsxs)(Cw.A,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-previous",children:[(0,Er.jsx)(fv.Ay,{variant:"tertiary",onClick:()=>n(1),disabled:1===e,"aria-label":(0,ee.__)("First page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:(0,Er.jsx)("span",{children:"«"})}),(0,Er.jsx)(fv.Ay,{variant:"tertiary",onClick:()=>n(e-1),disabled:1===e,"aria-label":(0,ee.__)("Previous page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:(0,Er.jsx)("span",{children:"‹"})})]}),(0,Er.jsx)(lj.A,{variant:"muted",children:(0,ee.sprintf)((0,ee._x)("%1$s of %2$s","paging"),e,t)}),(0,Er.jsxs)(Cw.A,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-next",children:[(0,Er.jsx)(fv.Ay,{variant:"tertiary",onClick:()=>n(e+1),disabled:e===t,"aria-label":(0,ee.__)("Next page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:(0,Er.jsx)("span",{children:"›"})}),(0,Er.jsx)(fv.Ay,{variant:"tertiary",onClick:()=>n(t),disabled:e===t,"aria-label":(0,ee.__)("Last page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:(0,Er.jsx)("span",{children:"»"})})]})]})]})}var nY=({showTooltip:e,title:t,children:n})=>e?(0,Er.jsx)(jR.Ay,{text:t,children:n}):(0,Er.jsx)(Er.Fragment,{children:n});function iY({id:e,isDraggable:t,pattern:n,onClick:i,onHover:r,showTitlesAsTooltip:o,category:s,isSelected:a}){const[l,c]=(0,T.useState)(!1),{blocks:u,viewportWidth:d}=n,h=`block-editor-block-patterns-list__item-description-${(0,SS.A)(iY)}`,p=n.type===wf,f=(0,T.useMemo)(()=>s&&t?(u??[]).map(e=>{const t=ir(e);return t.attributes.metadata?.categories?.includes(s)&&(t.attributes.metadata.categories=[s]),t}):u,[u,t,s]);return(0,Er.jsx)(FK,{isEnabled:t,blocks:f,pattern:n,children:({draggable:t,onDragStart:s,onDragEnd:f})=>(0,Er.jsx)("div",{className:"block-editor-block-patterns-list__list-item",draggable:t,onDragStart:e=>{c(!0),s&&(r?.(null),s(e))},onDragEnd:e=>{c(!1),f&&f(e)},children:(0,Er.jsx)(nY,{showTooltip:o&&!p,title:n.title,children:(0,Er.jsxs)(II.e.Item,{render:(0,Er.jsx)("div",{role:"option","aria-label":n.title,"aria-describedby":n.description?h:void 0,className:(0,mh.A)("block-editor-block-patterns-list__item",{"block-editor-block-patterns-list__list-item-synced":n.type===wf&&!n.syncStatus,"is-selected":a})}),id:e,onClick:()=>{i(n,u),r?.(null)},onMouseEnter:()=>{l||r?.(n)},onMouseLeave:()=>r?.(null),children:[(0,Er.jsx)(BK.Async,{placeholder:(0,Er.jsx)(rY,{}),children:(0,Er.jsx)(BK,{blocks:u,viewportWidth:d})}),(!o||p)&&(0,Er.jsxs)(Cw.A,{className:"block-editor-patterns__pattern-details",spacing:2,children:[p&&!n.syncStatus&&(0,Er.jsx)("div",{className:"block-editor-patterns__pattern-icon-wrapper",children:(0,Er.jsx)(xx.A,{className:"block-editor-patterns__pattern-icon",icon:pp.A})}),(0,Er.jsx)("div",{className:"block-editor-block-patterns-list__item-title",children:n.title})]}),!!n.description&&(0,Er.jsx)(kC.A,{id:h,children:n.description})]})})})})}function rY(){return(0,Er.jsx)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}var oY=(0,T.forwardRef)(function({isDraggable:e,blockPatterns:t,onHover:n,onClickPattern:i,orientation:r,label:o=(0,ee.__)("Block patterns"),category:s,showTitlesAsTooltip:a,pagingProps:l},c){const[u,d]=(0,T.useState)(void 0),[h,p]=(0,T.useState)(null);(0,T.useEffect)(()=>{const e=t[0]?.name;d(e)},[t]);const f=(e,t)=>{p(e.name),i(e,t)};return(0,Er.jsxs)(II.e,{orientation:r,activeId:u,setActiveId:d,role:"listbox",className:"block-editor-block-patterns-list","aria-label":o,ref:c,children:[t.map(t=>(0,Er.jsx)(iY,{id:t.name,pattern:t,onClick:f,onHover:n,isDraggable:e,showTitlesAsTooltip:a,category:s,isSelected:!!h&&h===t.name},t.name)),l&&(0,Er.jsx)(tY,{...l})]})});function sY({destinationRootClientId:e,destinationIndex:t,rootClientId:n,registry:i}){if(n===e)return t;const r=["",...i.select(Qy).getBlockParents(e),e],o=r.indexOf(n);return-1!==o?i.select(Qy).getBlockIndex(r[o+1])+1:i.select(Qy).getBlockOrder(n).length}var aY=function({rootClientId:e="",insertionIndex:t,clientId:n,isAppender:i,onSelect:r,shouldFocusBlock:o=!0,selectBlockOnInsert:s=!0}){const a=(0,yt.A)(),{getSelectedBlock:l,getClosestAllowedInsertionPoint:c,isBlockInsertionPointVisible:u}=Gh((0,zt.A)(Qy)),{destinationRootClientId:d,destinationIndex:h}=(0,zt.A)(r=>{const{getSelectedBlockClientId:o,getBlockRootClientId:s,getBlockIndex:a,getBlockOrder:l,getInsertionPoint:c}=Gh(r(Qy)),u=o();let d,h=e;const p=c();return void 0!==t?d=t:p&&p.hasOwnProperty("index")?(h=p?.rootClientId?p.rootClientId:e,d=p.index):n?d=a(n):!i&&u?(h=s(u),d=a(u)+1):d=l(h).length,{destinationRootClientId:h,destinationIndex:d}},[e,t,n,i]),{replaceBlocks:p,insertBlocks:f,showInsertionPoint:m,hideInsertionPoint:g,setLastFocus:b}=Gh((0,Vt.A)(Qy)),y=(0,T.useCallback)((e,t,n=!1,c)=>{(n||o||s)&&b(null);const u=l();!i&&u&&In(u,"content")?p(u.clientId,e,null,o||n?0:null,t):f(e,i||void 0===c?h:sY({destinationRootClientId:d,destinationIndex:h,rootClientId:c,registry:a}),i||void 0===c?d:c,s,o||n?0:null,t);const m=Array.isArray(e)?e.length:1,g=(0,ee.sprintf)((0,ee._n)("%d block added.","%d blocks added.",m),m);(0,dt.L)(g),r&&r(e)},[i,l,p,f,d,h,r,o,s,b,a]),v=(0,T.useCallback)(e=>{if(e&&!u()){const t=c(e.name,d);null!==t&&m(t,sY({destinationRootClientId:d,destinationIndex:h,rootClientId:t,registry:a}))}else g()},[c,u,m,g,d,h,a]);return[d,y,v]},lY=(e,t,n,i)=>{const r=(0,T.useMemo)(()=>({[Nf]:!!i}),[i]),o=(0,zt.A)(e=>{const{getSettings:t}=Gh(e(Qy));return t()[Uh]??!1},[]),{patternCategories:s,patterns:a,userPatternCategories:l}=(0,zt.A)(e=>{const{getSettings:n,__experimentalGetAllowedPatterns:i}=Gh(e(Qy)),{__experimentalUserPatternCategories:o,__experimentalBlockPatternCategories:s}=n();return{patterns:i(t,r),userPatternCategories:o,patternCategories:s}},[t,r]),c=(0,T.useMemo)(()=>a.filter(e=>{const t=e.categories?.includes("navigation");return!(t&&!o)}),[a,o]),{getClosestAllowedInsertionPointForPattern:u}=Gh((0,zt.A)(Qy)),d=(0,T.useMemo)(()=>{const e=[...s];return l?.forEach(t=>{e.find(e=>e.name===t.name)||e.push(t)}),e},[s,l]),{createSuccessNotice:h}=(0,Vt.A)(Rb.store),p=(0,T.useCallback)((r,o)=>{const s=i?t:u(r,t);if(null===s)return;const a=r.type===wf&&"unsynced"!==r.syncStatus?[er("core/block",{ref:r.id})]:o;e((a??[]).map(e=>{const t=ir(e);return t.attributes.metadata?.categories?.includes(n)&&(t.attributes.metadata.categories=[n]),t}),r.name,!1,s),h((0,ee.sprintf)((0,ee.__)('Block pattern "%s" inserted.'),r.title),{type:"snackbar",id:"inserter-notice"})},[h,e,n,t,u,i]);return[c,d,p]};function cY(e,t,n,i=""){const[r,o]=(0,T.useState)(1),s=(0,qt.A)(t),a=(0,qt.A)(i);s===t&&a===i||1===r||o(1);const l=e.length,c=r-1,u=(0,T.useMemo)(()=>e.slice(20*c,20*c+20),[c,e]),d=Math.ceil(e.length/20);return(0,T.useEffect)(function(){const e=(0,QP.A)(n?.current);e?.scrollTo(0,0)},[t,n]),{totalItems:l,categoryPatterns:u,numPages:d,changePage:e=>{const t=(0,QP.A)(n?.current);t?.scrollTo(0,0),o(e)},currentPage:r}}function uY({filterValue:e,filteredBlockPatternsLength:t}){return e?(0,Er.jsx)(Sw.A,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count",children:(0,ee.sprintf)((0,ee._n)("%d pattern found","%d patterns found",t),t)}):null}var dY=function({searchValue:e,selectedCategory:t,patternCategories:n,rootClientId:i,onModalClose:r}){const o=(0,T.useRef)(),s=(0,uj.A)(dt.L,500),[a,l]=aY({rootClientId:i,shouldFocusBlock:!0}),[c,,u]=lY(l,a,t),d=(0,T.useMemo)(()=>n.map(e=>e.name),[n]),h=(0,T.useMemo)(()=>{const n=c.filter(e=>{if(t===Ef.name)return!0;if(t===jf.name&&e.type===wf)return!0;if(t===Tf.name&&e.blockTypes?.includes("core/post-content"))return!0;if("uncategorized"===t){const t=e.categories?.some(e=>d.includes(e))??!1;return!e.categories?.length||!t}return e.categories?.includes(t)});return e?mT(n,e):n},[e,c,t,d]);(0,T.useEffect)(()=>{if(!e)return;const t=h.length,n=(0,ee.sprintf)((0,ee._n)("%d result found.","%d results found.",t),t);s(n)},[e,s,h.length]);const p=cY(h,t,o),[f,m]=(0,T.useState)(e);e!==f&&(m(e),p.changePage(1));const g=!!h?.length;return(0,Er.jsxs)("div",{className:"block-editor-block-patterns-explorer__list",ref:o,children:[(0,Er.jsx)(uY,{filterValue:e,filteredBlockPatternsLength:h.length}),(0,Er.jsx)(qK,{children:g&&(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(oY,{blockPatterns:p.categoryPatterns,onClickPattern:(e,t)=>{u(e,t),r()},isDraggable:!1}),(0,Er.jsx)(tY,{...p})]})})]})};function hY(e,t="all"){const[n,i]=lY(void 0,e),r=(0,T.useMemo)(()=>"all"===t?n:n.filter(e=>!Bf(e,t)),[t,n]),o=(0,T.useMemo)(()=>{const e=i.filter(e=>r.some(t=>t.categories?.includes(e.name))).sort((e,t)=>e.label.localeCompare(t.label));return r.some(e=>!function(e,t){return!(!e.categories||!e.categories.length)&&e.categories.some(e=>t.some(t=>t.name===e))}(e,i))&&!e.find(e=>"uncategorized"===e.name)&&e.push({name:"uncategorized",label:(0,ee._x)("Uncategorized")}),r.some(e=>e.blockTypes?.includes("core/post-content"))&&e.unshift(Tf),r.some(e=>e.type===wf)&&e.unshift(jf),r.length>0&&e.unshift({name:Ef.name,label:Ef.label}),(0,dt.L)((0,ee.sprintf)((0,ee._n)("%d category button displayed.","%d category buttons displayed.",e.length),e.length)),e},[i,r]);return o}function pY({initialCategory:e,rootClientId:t,onModalClose:n}){const[i,r]=(0,T.useState)(""),[o,s]=(0,T.useState)(e?.name),a=hY(t);return(0,Er.jsxs)("div",{className:"block-editor-block-patterns-explorer",children:[(0,Er.jsx)(eY,{selectedCategory:o,patternCategories:a,onClickCategory:s,searchValue:i,setSearchValue:r}),(0,Er.jsx)(dY,{searchValue:i,selectedCategory:o,patternCategories:a,rootClientId:t,onModalClose:n})]})}var fY=function({onModalClose:e,...t}){return(0,Er.jsx)(aj.A,{title:(0,ee.__)("Patterns"),onRequestClose:e,isFullScreen:!0,children:(0,Er.jsx)(pY,{onModalClose:e,...t})})};function mY(e,t){var n=[];return function(e,t,n){void 0===n&&(n={});var i=n.decode,r=void 0===i?function(e){return e}:i;return function(n){var i=e.exec(n);if(!i)return!1;for(var o=i[0],s=i.index,a=Object.create(null),l=function(e){if(void 0===i[e])return"continue";var n=t[e-1];"*"===n.modifier||"+"===n.modifier?a[n.name]=i[e].split(n.prefix+n.suffix).map(function(e){return r(e,n)}):a[n.name]=r(i[e],n)},c=1;c<i.length;c++)l(c);return{path:o,index:s,params:a}}}(vY(e,n,t),n,t)}function gY(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function bY(e){return e&&e.sensitive?"":"i"}function yY(e,t,n){return function(e,t,n){void 0===n&&(n={});for(var i=n.strict,r=void 0!==i&&i,o=n.start,s=void 0===o||o,a=n.end,l=void 0===a||a,c=n.encode,u=void 0===c?function(e){return e}:c,d=n.delimiter,h=void 0===d?"/#?":d,p=n.endsWith,f="[".concat(gY(void 0===p?"":p),"]|$"),m="[".concat(gY(h),"]"),g=s?"^":"",b=0,y=e;b<y.length;b++){var v=y[b];if("string"==typeof v)g+=gY(u(v));else{var _=gY(u(v.prefix)),x=gY(u(v.suffix));if(v.pattern)if(t&&t.push(v),_||x)if("+"===v.modifier||"*"===v.modifier){var k="*"===v.modifier?"?":"";g+="(?:".concat(_,"((?:").concat(v.pattern,")(?:").concat(x).concat(_,"(?:").concat(v.pattern,"))*)").concat(x,")").concat(k)}else g+="(?:".concat(_,"(").concat(v.pattern,")").concat(x,")").concat(v.modifier);else{if("+"===v.modifier||"*"===v.modifier)throw new TypeError('Can not repeat "'.concat(v.name,'" without a prefix and suffix'));g+="(".concat(v.pattern,")").concat(v.modifier)}else g+="(?:".concat(_).concat(x,")").concat(v.modifier)}}if(l)r||(g+="".concat(m,"?")),g+=n.endsWith?"(?=".concat(f,")"):"$";else{var w=e[e.length-1],C="string"==typeof w?m.indexOf(w[w.length-1])>-1:void 0===w;r||(g+="(?:".concat(m,"(?=").concat(f,"))?")),C||(g+="(?=".concat(m,"|").concat(f,")"))}return new RegExp(g,bY(n))}(function(e,t){void 0===t&&(t={});for(var n=function(e){for(var t=[],n=0;n<e.length;){var i=e[n];if("*"!==i&&"+"!==i&&"?"!==i)if("\\"!==i)if("{"!==i)if("}"!==i)if(":"!==i)if("("!==i)t.push({type:"CHAR",index:n,value:e[n++]});else{var r=1,o="";if("?"===e[a=n+1])throw new TypeError('Pattern cannot start with "?" at '.concat(a));for(;a<e.length;)if("\\"!==e[a]){if(")"===e[a]){if(0===--r){a++;break}}else if("("===e[a]&&(r++,"?"!==e[a+1]))throw new TypeError("Capturing groups are not allowed at ".concat(a));o+=e[a++]}else o+=e[a++]+e[a++];if(r)throw new TypeError("Unbalanced pattern at ".concat(n));if(!o)throw new TypeError("Missing pattern at ".concat(n));t.push({type:"PATTERN",index:n,value:o}),n=a}else{for(var s="",a=n+1;a<e.length;){var l=e.charCodeAt(a);if(!(l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||95===l))break;s+=e[a++]}if(!s)throw new TypeError("Missing parameter name at ".concat(n));t.push({type:"NAME",index:n,value:s}),n=a}else t.push({type:"CLOSE",index:n,value:e[n++]});else t.push({type:"OPEN",index:n,value:e[n++]});else t.push({type:"ESCAPED_CHAR",index:n++,value:e[n++]});else t.push({type:"MODIFIER",index:n,value:e[n++]})}return t.push({type:"END",index:n,value:""}),t}(e),i=t.prefixes,r=void 0===i?"./":i,o=t.delimiter,s=void 0===o?"/#?":o,a=[],l=0,c=0,u="",d=function(e){if(c<n.length&&n[c].type===e)return n[c++].value},h=function(e){var t=d(e);if(void 0!==t)return t;var i=n[c],r=i.type,o=i.index;throw new TypeError("Unexpected ".concat(r," at ").concat(o,", expected ").concat(e))},p=function(){for(var e,t="";e=d("CHAR")||d("ESCAPED_CHAR");)t+=e;return t},f=function(e){var t=a[a.length-1],n=e||(t&&"string"==typeof t?t:"");if(t&&!n)throw new TypeError('Must have text between two parameters, missing text after "'.concat(t.name,'"'));return!n||function(e){for(var t=0,n=s;t<n.length;t++){var i=n[t];if(e.indexOf(i)>-1)return!0}return!1}(n)?"[^".concat(gY(s),"]+?"):"(?:(?!".concat(gY(n),")[^").concat(gY(s),"])+?")};c<n.length;){var m=d("CHAR"),g=d("NAME"),b=d("PATTERN");if(g||b){var y=m||"";-1===r.indexOf(y)&&(u+=y,y=""),u&&(a.push(u),u=""),a.push({name:g||l++,prefix:y,suffix:"",pattern:b||f(y),modifier:d("MODIFIER")||""})}else{var v=m||d("ESCAPED_CHAR");if(v)u+=v;else if(u&&(a.push(u),u=""),d("OPEN")){y=p();var _=d("NAME")||"",x=d("PATTERN")||"",k=p();h("CLOSE"),a.push({name:_||(x?l++:""),pattern:_&&!x?f(y):x,prefix:y,suffix:k,modifier:d("MODIFIER")||""})}else h("END")}}return a}(e,n),t,n)}function vY(e,t,n){return e instanceof RegExp?function(e,t){if(!t)return e;for(var n=/\((?:\?<(.*?)>)?(?!\?)/g,i=0,r=n.exec(e.source);r;)t.push({name:r[1]||i++,prefix:"",suffix:"",modifier:"",pattern:""}),r=n.exec(e.source);return e}(e,t):Array.isArray(e)?function(e,t,n){var i=e.map(function(e){return vY(e,t,n).source});return new RegExp("(?:".concat(i.join("|"),")"),bY(n))}(e,t,n):yY(e,t,n)}function _Y(e,t){return mY(t,{decode:decodeURIComponent})(e)}var xY=(0,T.createContext)({location:{},goTo:()=>{},goBack:()=>{},goToParent:()=>{},addScreen:()=>{},removeScreen:()=>{},params:{}});xY.displayName="NavigatorContext";var kY={name:"1br0vvk",styles:"position:relative;overflow-x:clip;contain:layout;display:grid;grid-template-columns:1fr;grid-template-rows:1fr;align-items:start"},wY=(0,tx.i7)({from:{opacity:0}}),CY=(0,tx.i7)({to:{opacity:0}}),SY=(0,tx.i7)({from:{transform:"translateX(100px)"}}),AY=(0,tx.i7)({to:{transform:"translateX(-80px)"}}),IY=(0,tx.i7)({from:{transform:"translateX(-100px)"}}),EY=(0,tx.i7)({to:{transform:"translateX(80px)"}}),jY=70,TY="linear",BY=70,NY=40,RY=300,OY="cubic-bezier(0.33, 0, 0, 1)",LY=Math.max(jY+BY,RY),MY=Math.max(jY+NY,RY),PY={end:{in:SY.name,out:AY.name},start:{in:IY.name,out:EY.name}},DY={end:{in:(0,tx.AH)(jY,"ms ",TY," ",BY,"ms both ",wY,",",RY,"ms ",OY," both ",SY,";",""),out:(0,tx.AH)(jY,"ms ",TY," ",NY,"ms both ",CY,",",RY,"ms ",OY," both ",AY,";","")},start:{in:(0,tx.AH)(jY,"ms ",TY," ",BY,"ms both ",wY,",",RY,"ms ",OY," both ",IY,";",""),out:(0,tx.AH)(jY,"ms ",TY," ",NY,"ms both ",CY,",",RY,"ms ",OY," both ",EY,";","")}},FY=(0,tx.AH)("z-index:1;&[data-animation-type='out']{z-index:0;}@media not ( prefers-reduced-motion ){&:not( [data-skip-animation] ){",["start","end"].map(e=>["in","out"].map(t=>(0,tx.AH)("&[data-animation-direction='",e,"'][data-animation-type='",t,"']{animation:",DY[e][t],";}",""))),";}}",""),zY={name:"14di7zd",styles:"overflow-x:auto;max-height:100%;box-sizing:border-box;position:relative;grid-column:1/-1;grid-row:1/-1"};function VY(e,t,n={}){const{focusSelectors:i}=e,r={...e.currentLocation},{isBack:o=!1,skipFocus:s=!1,replace:a,focusTargetSelector:l,...c}=n;if(r.path===t)return{currentLocation:r,focusSelectors:i};let u,d;function h(){return u=u??new Map(e.focusSelectors),u}return l&&r.path&&h().set(r.path,l),i.get(t)&&(o&&(d=i.get(t)),h().delete(t)),{currentLocation:{...c,isInitial:!1,path:t,isBack:o,hasRestoredFocus:!1,focusTargetSelector:d,skipFocus:s},focusSelectors:u??i}}function UY(e,t){let{screens:n,currentLocation:i,matchedPath:r,focusSelectors:o,...s}=e;switch(t.type){case"add":n=function({screens:e},t){return e.some(e=>e.path===t.path)?(!0===globalThis.SCRIPT_DEBUG&&(0,sn.A)(`Navigator: a screen with path ${t.path} already exists.\nThe screen with id ${t.id} will not be added.`),e):[...e,t]}(e,t.screen);break;case"remove":n=function({screens:e},t){return e.filter(e=>e.id!==t.id)}(e,t.screen);break;case"goto":({currentLocation:i,focusSelectors:o}=VY(e,t.path,t.options));break;case"gotoparent":({currentLocation:i,focusSelectors:o}=function(e,t={}){const{screens:n,focusSelectors:i}=e,r={...e.currentLocation},o=r.path;if(void 0===o)return{currentLocation:r,focusSelectors:i};const s=function(e,t){if(!e.startsWith("/"))return;const n=e.split("/");let i;for(;n.length>1&&void 0===i;){n.pop();const e=""===n.join("/")?"/":n.join("/");t.find(t=>!1!==_Y(e,t.path))&&(i=e)}return i}(o,n);return void 0===s?{currentLocation:r,focusSelectors:i}:VY(e,s,{...t,isBack:!0})}(e,t.options))}if(n===e.screens&&i===e.currentLocation)return e;const a=i.path;return r=void 0!==a?function(e,t){for(const n of t){const t=_Y(e,n.path);if(t)return{params:t.params,id:n.id}}}(a,n):void 0,r&&e.matchedPath&&r.id===e.matchedPath.id&&(0,V.hw)(r.params,e.matchedPath.params)&&(r=e.matchedPath),{...s,screens:n,currentLocation:i,matchedPath:r,focusSelectors:o}}var $Y=(0,Dw.KZ)(function(e,t){const{initialPath:n,children:i,className:r,...o}=(0,Mw.A)(e,"Navigator"),[s,a]=(0,T.useReducer)(UY,n,e=>({screens:[],currentLocation:{path:e,isInitial:!0},matchedPath:void 0,focusSelectors:new Map,initialPath:n})),l=(0,T.useMemo)(()=>({goBack:e=>a({type:"gotoparent",options:e}),goTo:(e,t)=>a({type:"goto",path:e,options:t}),goToParent:e=>{(0,Qt.A)("wp.components.useNavigator().goToParent",{since:"6.7",alternative:"wp.components.useNavigator().goBack"}),a({type:"gotoparent",options:e})},addScreen:e=>a({type:"add",screen:e}),removeScreen:e=>a({type:"remove",screen:e})}),[]),{currentLocation:c,matchedPath:u}=s,d=(0,T.useMemo)(()=>({location:c,params:u?.params??{},match:u?.id,...l}),[c,u,l]),h=(0,Pw.l)(),p=(0,T.useMemo)(()=>h(kY,r),[r,h]);return(0,Er.jsx)(qw.A,{ref:t,className:p,...o,children:(0,Er.jsx)(xY.Provider,{value:d,children:i})})},"Navigator");var HY=(0,Dw.KZ)(function(e,t){/^\//.test(e.path)||!0===globalThis.SCRIPT_DEBUG&&(0,sn.A)("wp.components.Navigator.Screen: the `path` should follow a URL-like scheme; it should start with and be separated by the `/` character.");const n=(0,T.useId)(),{children:i,className:r,path:o,onAnimationEnd:s,...a}=(0,Mw.A)(e,"Navigator.Screen"),{location:l,match:c,addScreen:u,removeScreen:d}=(0,T.useContext)(xY),{isInitial:h,isBack:p,focusTargetSelector:f,skipFocus:m}=l,g=c===n,b=(0,T.useRef)(null),y=!!h&&!p;(0,T.useEffect)(()=>{const e={id:n,path:(0,Ce.Gj)(o)};return u(e),()=>d(e)},[n,o,u,d]);const{animationStyles:v,shouldRenderScreen:_,screenProps:x}=function({isMatch:e,skipAnimation:t,isBack:n,onAnimationEnd:i}){const r=(0,ee.isRTL)(),o=(0,LS.A)(),[s,a]=(0,T.useState)("INITIAL"),l="ANIMATING_IN"!==s&&"IN"!==s&&e,c="ANIMATING_OUT"!==s&&"OUT"!==s&&!e;(0,T.useLayoutEffect)(()=>{l?a(t||o?"IN":"ANIMATING_IN"):c&&a(t||o?"OUT":"ANIMATING_OUT")},[l,c,t,o]);const u=r&&n||!r&&!n?"end":"start",d="ANIMATING_IN"===s,h="ANIMATING_OUT"===s;let p;d?p="in":h&&(p="out");const f=(0,T.useCallback)(e=>{i?.(e),((e,t,n)=>"ANIMATING_OUT"===t&&n===PY[e].out)(u,s,e.animationName)?a("OUT"):((e,t,n)=>"ANIMATING_IN"===t&&n===PY[e].in)(u,s,e.animationName)&&a("IN")},[i,s,u]);return(0,T.useEffect)(()=>{let e;return h?e=window.setTimeout(()=>{a("OUT"),e=void 0},1.2*MY):d&&(e=window.setTimeout(()=>{a("IN"),e=void 0},1.2*LY)),()=>{e&&(window.clearTimeout(e),e=void 0)}},[h,d]),{animationStyles:FY,shouldRenderScreen:e||"IN"===s||"ANIMATING_OUT"===s,screenProps:{onAnimationEnd:f,"data-animation-direction":u,"data-animation-type":p,"data-skip-animation":t||void 0}}}({isMatch:g,isBack:p,onAnimationEnd:s,skipAnimation:y}),k=(0,Pw.l)(),w=(0,T.useMemo)(()=>k(zY,v,r),[r,k,v]),C=(0,T.useRef)(l);(0,T.useEffect)(()=>{C.current=l},[l]),(0,T.useEffect)(()=>{const e=b.current;if(y||!g||!e||C.current.hasRestoredFocus||m)return;const t=e.ownerDocument.activeElement;if(e.contains(t))return;let n=null;if(p&&f&&(n=e.querySelector(f)),!n){const[t]=hS.XC.tabbable.find(e);n=t??e}C.current.hasRestoredFocus=!0,n.focus()},[y,g,p,f,m]);const S=(0,gt.A)([t,b]);return _?(0,Er.jsx)(qw.A,{ref:S,className:w,...x,...a,children:i}):null},"Navigator.Screen");function WY(){const{location:e,params:t,goTo:n,goBack:i,goToParent:r}=(0,T.useContext)(xY);return{location:e,goTo:n,goBack:i,goToParent:r,params:t}}var GY=(0,Dw.KZ)(function(e,t){const n=function(e){const{path:t,onClick:n,as:i=fv.Ay,attributeName:r="id",...o}=(0,Mw.A)(e,"Navigator.Button"),s=(0,Ce.Gj)(t),{goTo:a}=WY();return{as:i,onClick:(0,T.useCallback)(e=>{var t,i;e.preventDefault(),a(s,{focusTargetSelector:(t=r,i=s,`[${t}="${i}"]`)}),n?.(e)},[a,n,r,s]),...o,[r]:s}}(e);return(0,Er.jsx)(qw.A,{ref:t,...n})},"Navigator.Button"),qY=(0,Dw.KZ)(function(e,t){const n=function(e){const{onClick:t,as:n=fv.Ay,...i}=(0,Mw.A)(e,"Navigator.BackButton"),{goBack:r}=WY();return{as:n,onClick:(0,T.useCallback)(e=>{e.preventDefault(),r(),t?.(e)},[r,t]),...i}}(e);return(0,Er.jsx)(qw.A,{ref:t,...n})},"Navigator.BackButton"),KY=Object.assign($Y,{Screen:Object.assign(HY,{displayName:"Navigator.Screen"}),Button:Object.assign(GY,{displayName:"Navigator.Button"}),BackButton:Object.assign(qY,{displayName:"Navigator.BackButton"})}),YY=n(20976),JY=n(48230);function XY({title:e}){return(0,Er.jsx)(Q_.A,{spacing:0,children:(0,Er.jsx)(qw.A,{children:(0,Er.jsx)($I.A,{marginBottom:0,paddingX:4,paddingY:3,children:(0,Er.jsxs)(Cw.A,{spacing:2,children:[(0,Er.jsx)(KY.BackButton,{style:{minWidth:24,padding:0},icon:(0,ee.isRTL)()?Lz.A:Mz.A,size:"small",label:(0,ee.__)("Back")}),(0,Er.jsx)($I.A,{children:(0,Er.jsx)(Sw.A,{level:5,children:e})})]})})})})}function ZY({categories:e,children:t}){return(0,Er.jsxs)(KY,{initialPath:"/",className:"block-editor-inserter__mobile-tab-navigation",children:[(0,Er.jsx)(KY.Screen,{path:"/",children:(0,Er.jsx)(YY.A,{children:e.map(e=>(0,Er.jsx)(KY.Button,{path:`/category/${e.name}`,as:JY.A,isAction:!0,children:(0,Er.jsxs)(Cw.A,{children:[(0,Er.jsx)(_C.A,{children:e.label}),(0,Er.jsx)(xx.A,{icon:(0,ee.isRTL)()?Mz.A:Lz.A})]})},e.name))})}),e.map(e=>(0,Er.jsxs)(KY.Screen,{path:`/category/${e.name}`,children:[(0,Er.jsx)(XY,{title:(0,ee.__)("Back")}),t(e)]},e.name))]})}var QY=()=>{},eJ=function({choices:e=[],onHover:t=QY,onSelect:n,value:i}){return(0,Er.jsx)(Er.Fragment,{children:e.map(e=>{const r=i===e.value;return(0,Er.jsx)(zv.A,{role:"menuitemradio",disabled:e.disabled,icon:r?xw.A:null,info:e.info,isSelected:r,shortcut:e.shortcut,className:"components-menu-items-choice",onClick:()=>{r||n(e.value)},onMouseEnter:()=>t(e.value),onMouseLeave:()=>t(null),"aria-label":e["aria-label"],children:e.label},e.value)})})},tJ=e=>"all"!==e&&"user"!==e,nJ=[{value:"all",label:(0,ee._x)("All","patterns")},{value:Sf,label:(0,ee.__)("Pattern Directory")},{value:Cf,label:(0,ee.__)("Theme & Plugins")},{value:wf,label:(0,ee.__)("User")}];function iJ({setPatternSyncFilter:e,setPatternSourceFilter:t,patternSyncFilter:n,patternSourceFilter:i,scrollContainerRef:r,category:o}){const s=o.name===jf.name?wf:i,a=tJ(s),l=(e=>e.name===jf.name)(o),c=(0,T.useMemo)(()=>[{value:"all",label:(0,ee._x)("All","patterns")},{value:Af,label:(0,ee._x)("Synced","patterns"),disabled:a},{value:If,label:(0,ee._x)("Not synced","patterns"),disabled:a}],[a]);return(0,Er.jsx)(Er.Fragment,{children:(0,Er.jsx)(xv.A,{popoverProps:{placement:"right-end"},label:(0,ee.__)("Filter patterns"),toggleProps:{size:"compact"},icon:(0,Er.jsx)(xx.A,{icon:(0,Er.jsx)(AC.t4,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Er.jsx)(AC.wA,{d:"M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z",fill:"currentColor"})})}),children:()=>(0,Er.jsxs)(Er.Fragment,{children:[!l&&(0,Er.jsx)(Fv.A,{label:(0,ee.__)("Source"),children:(0,Er.jsx)(eJ,{choices:nJ,onSelect:n=>{var i;t(i=n),tJ(i)&&e("all"),r.current?.scrollTo(0,0)},value:s})}),(0,Er.jsx)(Fv.A,{label:(0,ee.__)("Type"),children:(0,Er.jsx)(eJ,{choices:c,onSelect:t=>{e(t),r.current?.scrollTo(0,0)},value:n})}),(0,Er.jsx)("div",{className:"block-editor-inserter__patterns-filter-help",children:(0,qS.A)((0,ee.__)("Patterns are available from the <Link>WordPress.org Pattern Directory</Link>, bundled in the active theme, or created by users on this site. Only patterns created on this site can be synced."),{Link:(0,Er.jsx)(OA.A,{href:(0,ee.__)("https://wordpress.org/patterns/")})})})]})})})}var rJ=()=>{};function oJ({rootClientId:e,onInsert:t,onHover:n=rJ,category:i,showTitlesAsTooltip:r}){const[o,,s]=lY(t,e,i?.name),[a,l]=(0,T.useState)("all"),[c,u]=(0,T.useState)("all"),d=hY(e,c),h=(0,T.useRef)(),p=(0,T.useMemo)(()=>o.filter(e=>!Bf(e,c,a)&&(i.name===Ef.name||i.name===jf.name&&e.type===wf||!(i.name!==Tf.name||!e.blockTypes?.includes("core/post-content"))||("uncategorized"===i.name?!e.categories||!e.categories.some(e=>d.some(t=>t.name===e)):e.categories?.includes(i.name)))),[o,d,i.name,c,a]),f=cY(p,i,h),{changePage:m}=f;(0,T.useEffect)(()=>()=>n(null),[]);const g=(0,T.useCallback)(e=>{l(e),m(1)},[l,m]),b=(0,T.useCallback)(e=>{u(e),m(1)},[u,m]);return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsxs)(Q_.A,{spacing:2,className:"block-editor-inserter__patterns-category-panel-header",children:[(0,Er.jsxs)(Cw.A,{children:[(0,Er.jsx)(_C.A,{children:(0,Er.jsx)(Sw.A,{className:"block-editor-inserter__patterns-category-panel-title",size:13,level:4,as:"div",children:i.label})}),(0,Er.jsx)(iJ,{patternSyncFilter:a,patternSourceFilter:c,setPatternSyncFilter:g,setPatternSourceFilter:b,scrollContainerRef:h,category:i})]}),!p.length&&(0,Er.jsx)(lj.A,{variant:"muted",className:"block-editor-inserter__patterns-category-no-results",children:(0,ee.__)("No results found")})]}),p.length>0&&(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(lj.A,{size:"12",as:"p",className:"block-editor-inserter__help-text",children:(0,ee.__)("Drag and drop patterns into the canvas.")}),(0,Er.jsx)(oY,{ref:h,blockPatterns:f.categoryPatterns,onClickPattern:s,onHover:n,label:i.label,orientation:"vertical",category:i.name,isDraggable:!0,showTitlesAsTooltip:r,patternFilter:c,pagingProps:f})]})]})}var{Tabs:sJ}=Gh(Ev.j),aJ=function({categories:e,selectedCategory:t,onSelectCategory:n,children:i}){const r={type:"tween",duration:(0,LS.A)()?0:.25,ease:[.6,0,.4,1]},o=(0,qt.A)(t),s=t?t.name:null,[a,l]=(0,T.useState)(),c=e?.[0]?.name;return null===s&&!a&&c&&l(c),(0,Er.jsxs)(sJ,{selectOnMove:!1,selectedTabId:s,orientation:"vertical",onSelect:t=>{n(e.find(e=>e.name===t))},activeTabId:a,onActiveTabIdChange:l,children:[(0,Er.jsx)(sJ.TabList,{className:"block-editor-inserter__category-tablist",children:e.map(e=>(0,Er.jsx)(sJ.Tab,{tabId:e.name,"aria-current":e===t?"true":void 0,children:e.label},e.name))}),e.map(e=>(0,Er.jsx)(sJ.TabPanel,{tabId:e.name,focusable:!1,children:(0,Er.jsx)(NS.P.div,{className:"block-editor-inserter__category-panel",initial:o?"open":"closed",animate:"open",variants:{open:{transform:"translateX( 0 )",transitionEnd:{zIndex:"1"}},closed:{transform:"translateX( -100% )",zIndex:"-1"}},transition:r,children:i})},e.name))]})},lJ=function({onSelectCategory:e,selectedCategory:t,onInsert:n,rootClientId:i,children:r}){const[o,s]=(0,T.useState)(!1),a=hY(i),l=(0,dw.A)("medium","<");return a.length?(0,Er.jsxs)(Er.Fragment,{children:[!l&&(0,Er.jsxs)("div",{className:"block-editor-inserter__block-patterns-tabs-container",children:[(0,Er.jsx)(aJ,{categories:a,selectedCategory:t,onSelectCategory:e,children:r}),(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,className:"block-editor-inserter__patterns-explore-button",onClick:()=>s(!0),variant:"secondary",children:(0,ee.__)("Explore all patterns")})]}),l&&(0,Er.jsx)(ZY,{categories:a,children:e=>(0,Er.jsx)("div",{className:"block-editor-inserter__category-panel",children:(0,Er.jsx)(oJ,{onInsert:n,rootClientId:i,category:e},e.name)})}),o&&(0,Er.jsx)(fY,{initialCategory:t||a[0],patternCategories:a,onModalClose:()=>s(!1),rootClientId:i})]}):(0,Er.jsx)(KK,{})},cJ=n(69472),uJ={image:"img",video:"video",audio:"audio"};function dJ(e,t){const n={id:e.id||void 0,caption:e.caption||void 0},i=e.url,r=e.alt||void 0;"image"===t?(n.url=i,n.alt=r):["video","audio"].includes(t)&&(n.src=i);const o=uJ[t],s=(0,Er.jsx)(o,{src:e.previewUrl||i,alt:r,controls:"audio"===t||void 0,inert:"true",onError:({currentTarget:t})=>{t.src===e.previewUrl&&(t.src=i)}});return[er(`core/${t}`,n),s]}var hJ=["image"],pJ={placement:"bottom-end",className:"block-editor-inserter__media-list__item-preview-options__popover"};function fJ({category:e,media:t}){if(!e.getReportUrl)return null;const n=e.getReportUrl(t);return(0,Er.jsx)(xv.A,{className:"block-editor-inserter__media-list__item-preview-options",label:(0,ee.__)("Options"),popoverProps:pJ,icon:ww.A,children:()=>(0,Er.jsx)(Fv.A,{children:(0,Er.jsx)(zv.A,{onClick:()=>window.open(n,"_blank").focus(),icon:cJ.A,children:(0,ee.sprintf)((0,ee.__)("Report %s"),e.mediaType)})})})}function mJ({onClose:e,onSubmit:t}){return(0,Er.jsxs)(aj.A,{title:(0,ee.__)("Insert external image"),onRequestClose:e,className:"block-editor-inserter-media-tab-media-preview-inserter-external-image-modal",children:[(0,Er.jsxs)(Q_.A,{spacing:3,children:[(0,Er.jsx)("p",{children:(0,ee.__)("This image cannot be uploaded to your Media Library, but it can still be inserted as an external image.")}),(0,Er.jsx)("p",{children:(0,ee.__)("External images can be removed by the external provider without warning and could even have legal compliance issues related to privacy legislation.")})]}),(0,Er.jsxs)(Kv.A,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1,children:[(0,Er.jsx)(Yv.A,{children:(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:e,children:(0,ee.__)("Cancel")})}),(0,Er.jsx)(Yv.A,{children:(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,variant:"primary",onClick:t,children:(0,ee.__)("Insert")})})]})]})}function gJ({media:e,onClick:t,category:n}){const[i,r]=(0,T.useState)(!1),[o,s]=(0,T.useState)(!1),[a,l]=(0,T.useState)(!1),[c,u]=(0,T.useMemo)(()=>dJ(e,n.mediaType),[e,n.mediaType]),{createErrorNotice:d,createSuccessNotice:h}=(0,Vt.A)(Rb.store),{getSettings:p,getBlock:f}=(0,zt.A)(Qy),{updateBlockAttributes:m}=(0,Vt.A)(Qy),g=(0,T.useCallback)(e=>{if(a)return;const n=p(),i=ir(e),{id:o,url:s,caption:c}=i.attributes;o||n.mediaUpload?o?t(i):(l(!0),window.fetch(s).then(e=>e.blob()).then(e=>{const r=(0,dS.e)(s)||"image.jpg",o=new File([e],r,{type:e.type});n.mediaUpload({filesList:[o],additionalData:{caption:c},onFileChange([e]){Fs(e.url)||(f(i.clientId)?m(i.clientId,{...i.attributes,id:e.id,url:e.url}):(t({...i,attributes:{...i.attributes,id:e.id,url:e.url}}),h((0,ee.__)("Image uploaded and inserted."),{type:"snackbar",id:"inserter-notice"})),l(!1))},allowedTypes:hJ,onError(e){d(e,{type:"snackbar",id:"inserter-notice"}),l(!1)}})}).catch(()=>{r(!0),l(!1)})):r(!0)},[a,p,t,h,m,d,f]),b="string"==typeof e.title?e.title:e.title?.rendered||(0,ee.__)("no title"),y=(0,T.useCallback)(()=>s(!0),[]),v=(0,T.useCallback)(()=>s(!1),[]);return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(FK,{isEnabled:!0,blocks:[c],children:({draggable:t,onDragStart:i,onDragEnd:r})=>(0,Er.jsx)("div",{className:(0,mh.A)("block-editor-inserter__media-list__list-item",{"is-hovered":o}),draggable:t,onDragStart:i,onDragEnd:r,children:(0,Er.jsxs)("div",{onMouseEnter:y,onMouseLeave:v,children:[(0,Er.jsx)(jR.Ay,{text:b,children:(0,Er.jsx)(II.e.Item,{render:(0,Er.jsx)("div",{"aria-label":b,role:"option",className:"block-editor-inserter__media-list__item"}),onClick:()=>g(c),children:(0,Er.jsxs)("div",{className:"block-editor-inserter__media-list__item-preview",children:[u,a&&(0,Er.jsx)("div",{className:"block-editor-inserter__media-list__item-preview-spinner",children:(0,Er.jsx)(TC.Ay,{})})]})})}),!a&&(0,Er.jsx)(fJ,{category:n,media:e})]})})}),i&&(0,Er.jsx)(mJ,{onClose:()=>r(!1),onSubmit:()=>{t(ir(c)),h((0,ee.__)("Image inserted."),{type:"snackbar",id:"inserter-notice"}),r(!1)}})]})}var bJ=function({mediaList:e,category:t,onClick:n,label:i=(0,ee.__)("Media List")}){return(0,Er.jsx)(II.e,{role:"listbox",className:"block-editor-inserter__media-list","aria-label":i,children:e.map((e,i)=>(0,Er.jsx)(gJ,{media:e,category:t,onClick:n},e.id||e.sourceId||i))})};function yJ({rootClientId:e,onInsert:t,category:n}){const[i,r,o]=(0,Tz.A)(),{mediaList:s,isLoading:a}=function(e,t={}){const[n,i]=(0,T.useState)(),[r,o]=(0,T.useState)(!1),s=(0,T.useRef)();return(0,T.useEffect)(()=>{(async()=>{const n=JSON.stringify({category:e.name,...t});s.current=n,o(!0),i([]);const r=await(e.fetch?.(t));n===s.current&&(i(r),o(!1))})()},[e.name,...Object.values(t)]),{mediaList:n,isLoading:r}}(n,{per_page:o?20:10,search:o}),l="block-editor-inserter__media-panel",c=n.labels.search_items||(0,ee.__)("Search");return(0,Er.jsxs)("div",{className:l,children:[(0,Er.jsx)(cj.A,{className:`${l}-search`,onChange:r,value:i,label:c,placeholder:c}),a&&(0,Er.jsx)("div",{className:`${l}-spinner`,children:(0,Er.jsx)(TC.Ay,{})}),!a&&!s?.length&&(0,Er.jsx)(KK,{}),!a&&!!s?.length&&(0,Er.jsx)(bJ,{rootClientId:e,onClick:t,mediaList:s,category:n})]})}var vJ=["image","video","audio"],_J=function({rootClientId:e,selectedCategory:t,onSelectCategory:n,onInsert:i,children:r}){const o=function(e){const[t,n]=(0,T.useState)([]),i=(0,zt.A)(e=>Gh(e(Qy)).getInserterMediaCategories(),[]),{canInsertImage:r,canInsertVideo:o,canInsertAudio:s}=(0,zt.A)(t=>{const{canInsertBlockType:n}=t(Qy);return{canInsertImage:n("core/image",e),canInsertVideo:n("core/video",e),canInsertAudio:n("core/audio",e)}},[e]);return(0,T.useEffect)(()=>{(async()=>{const e=[];if(!i)return;const t=new Map(await Promise.all(i.map(async e=>{if(e.isExternalResource)return[e.name,!0];let t=[];try{t=await e.fetch({per_page:1})}catch{}return[e.name,!!t.length]}))),a={image:r,video:o,audio:s};i.forEach(n=>{a[n.mediaType]&&t.get(n.name)&&e.push(n)}),e.length&&n(e)})()},[r,o,s,i]),t}(e),s=(0,dw.A)("medium","<"),a=(0,T.useCallback)(e=>{if(!e?.url)return;const t=window.__experimentalDataViewsMediaModal&&e.mime_type?e.mime_type.split("/")[0]:e.type,[n]=dJ(e,t);i(n)},[i]),l=(0,T.useMemo)(()=>o.map(e=>({...e,label:e.labels.name})),[o]);return l.length?(0,Er.jsxs)(Er.Fragment,{children:[!s&&(0,Er.jsxs)("div",{className:"block-editor-inserter__media-tabs-container",children:[(0,Er.jsx)(aJ,{categories:l,selectedCategory:t,onSelectCategory:n,children:r}),(0,Er.jsx)(xS,{children:(0,Er.jsx)(_S,{multiple:!1,onSelect:a,allowedTypes:vJ,render:({open:e})=>(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,onClick:t=>{t.target.focus(),e()},className:"block-editor-inserter__media-library-button",variant:"secondary","data-unstable-ignore-focus-outside-for-relatedtarget":".media-modal",children:(0,ee.__)("Open Media Library")})})})]}),s&&(0,Er.jsx)(ZY,{categories:l,children:t=>(0,Er.jsx)(yJ,{onInsert:i,rootClientId:e,category:t})})]}):(0,Er.jsx)(KK,{})},{Fill:xJ,Slot:kJ}=(0,Sv.QJ)("__unstableInserterMenuExtension");xJ.Slot=kJ;var wJ=xJ,CJ=[],SJ=function({filterValue:e,onSelect:t,onHover:n,onHoverPattern:i,rootClientId:r,clientId:o,isAppender:s,__experimentalInsertionIndex:a,maxBlockPatterns:l,maxBlockTypes:c,showBlockDirectory:u=!1,isDraggable:d=!0,shouldFocusBlock:h=!0,prioritizePatterns:p,selectBlockOnInsert:f,isQuick:m}){const g=(0,uj.A)(dt.L,500),{prioritizedBlocks:b}=(0,zt.A)(e=>{const t=e(Qy).getBlockListSettings(r);return{prioritizedBlocks:t?.prioritizedInserterBlocks||CJ}},[r]),[y,v]=aY({onSelect:t,rootClientId:r,clientId:o,isAppender:s,insertionIndex:a,shouldFocusBlock:h,selectBlockOnInsert:f}),[_,x,k,w]=bT(y,v,m),[C,,S]=lY(v,y,void 0,m),A=(0,T.useMemo)(()=>{if(0===l)return[];const t=mT(C,e);return void 0!==l?t.slice(0,l):t},[e,C,l]);let I=c;p&&A.length>2&&(I=0);const E=(0,T.useMemo)(()=>{if(0===I)return[];let t=Uf(_.filter(e=>"core/block"!==e.name),"frecency","desc");!e&&b.length&&(t=yT(t,b));const n=fT(t,x,k,e);return void 0!==I?n.slice(0,I):n},[e,_,x,k,I,b]);(0,T.useEffect)(()=>{if(!e)return;const t=E.length+A.length,n=(0,ee.sprintf)((0,ee._n)("%d result found.","%d results found.",t),t);g(n)},[e,g,E,A]);const j=RK(E,{step:9}),B=E.length>0||A.length>0,N=!!E.length&&(0,Er.jsx)(WK,{title:(0,Er.jsx)(kC.A,{children:(0,ee.__)("Blocks")}),children:(0,Er.jsx)(HK,{items:j,onSelect:w,onHover:n,label:(0,ee.__)("Blocks"),isDraggable:d})}),R=!!A.length&&(0,Er.jsx)(WK,{title:(0,Er.jsx)(kC.A,{children:(0,ee.__)("Block patterns")}),children:(0,Er.jsx)("div",{className:"block-editor-inserter__quick-inserter-patterns",children:(0,Er.jsx)(oY,{blockPatterns:A,onClickPattern:S,onHover:i,isDraggable:d})})});return(0,Er.jsxs)(qK,{children:[!u&&!B&&(0,Er.jsx)(KK,{}),p?R:N,!!E.length&&!!A.length&&(0,Er.jsx)("div",{className:"block-editor-inserter__quick-inserter-separator"}),p?N:R,u&&(0,Er.jsx)(wJ.Slot,{fillProps:{onSelect:w,onHover:n,filterValue:e,hasItems:B,rootClientId:y},children:e=>e.length?e:B?null:(0,Er.jsx)(KK,{})})]})},AJ=n(35061),{Tabs:IJ}=Gh(Ev.j),EJ=(0,T.forwardRef)(function({defaultTabId:e,onClose:t,onSelect:n,selectedTab:i,tabs:r,closeButtonLabel:o},s){return(0,Er.jsx)("div",{className:"block-editor-tabbed-sidebar",children:(0,Er.jsxs)(IJ,{selectOnMove:!1,defaultTabId:e,onSelect:n,selectedTabId:i,children:[(0,Er.jsxs)("div",{className:"block-editor-tabbed-sidebar__tablist-and-close-button",children:[(0,Er.jsx)(fv.Ay,{className:"block-editor-tabbed-sidebar__close-button",icon:AJ.A,label:o,onClick:()=>t(),size:"compact"}),(0,Er.jsx)(IJ.TabList,{className:"block-editor-tabbed-sidebar__tablist",ref:s,children:r.map(e=>(0,Er.jsx)(IJ.Tab,{tabId:e.name,className:"block-editor-tabbed-sidebar__tab",children:e.title},e.name))})]}),r.map(e=>(0,Er.jsx)(IJ.TabPanel,{tabId:e.name,focusable:!1,className:"block-editor-tabbed-sidebar__tabpanel",ref:e.panelRef,children:e.panel},e.name))]})})});function jJ(e=!0){const{setZoomLevel:t,resetZoomLevel:n}=Gh((0,Vt.A)(Qy)),{isZoomedOut:i,isZoomOut:r}=(0,zt.A)(e=>{const{isZoomOut:t}=Gh(e(Qy));return{isZoomedOut:t(),isZoomOut:t}},[]),o=(0,T.useRef)(!1),s=(0,T.useRef)(e);(0,T.useEffect)(()=>{i!==s.current&&(o.current=!1)},[i]),(0,T.useEffect)(()=>(s.current=e,e!==r()&&(o.current=!0,e?t("auto-scaled"):n()),()=>{o.current&&r()&&n()}),[e,r,n,t])}var TJ=()=>{},BJ=(0,T.forwardRef)(function({rootClientId:e,clientId:t,isAppender:n,__experimentalInsertionIndex:i,onSelect:r,showInserterHelpPanel:o,showMostUsedBlocks:s,__experimentalFilterValue:a="",shouldFocusBlock:l=!0,onPatternCategorySelection:c,onClose:u,__experimentalInitialTab:d,__experimentalInitialCategory:h},p){const{isZoomOutMode:f,hasSectionRootClientId:m}=(0,zt.A)(e=>{const{isZoomOut:t,getSectionRootClientId:n}=Gh(e(Qy));return{isZoomOutMode:t(),hasSectionRootClientId:!!n()}},[]),[g,b,y]=(0,Tz.A)(a),[v,_]=(0,T.useState)(null),[x,k]=(0,T.useState)(h),[w,C]=(0,T.useState)("all"),[S,A]=(0,T.useState)(null),I=(0,dw.A)("large"),E=(0,dw.A)("medium","<")?u:TJ,[j,B]=(0,T.useState)(d||(f?"patterns":"blocks"));jJ(m&&("patterns"===j||"media"===j)&&I);const[N,R,O]=aY({rootClientId:e,clientId:t,isAppender:n,insertionIndex:i,shouldFocusBlock:l}),L=(0,T.useRef)(),M=(0,T.useCallback)((e,t,n,i)=>{R(e,t,n,i),r(e),E(),window.requestAnimationFrame(()=>{l||L.current?.contains(p.current.ownerDocument.activeElement)||L.current?.querySelector("button").focus()})},[R,E,r,p,l]),P=(0,T.useCallback)((e,t,...n)=>{O(!1),R(e,{patternName:t},...n),r(),E()},[R,E,r,O]),D=(0,T.useCallback)(e=>{O(e),_(e)},[O,_]),F=(0,T.useCallback)((e,t)=>{k(e),C(t),c?.()},[k,c]),z="patterns"===j&&!y&&!!x,V="media"===j&&!!S,U=(0,T.useMemo)(()=>"media"===j?null:(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(cj.A,{className:"block-editor-inserter__search",onChange:e=>{v&&_(null),b(e)},value:g,label:(0,ee.__)("Search"),placeholder:(0,ee.__)("Search")}),!!y&&(0,Er.jsx)(SJ,{filterValue:y,onSelect:r,onHover:D,rootClientId:e,clientId:t,isAppender:n,__experimentalInsertionIndex:i,showBlockDirectory:!0,shouldFocusBlock:l,prioritizePatterns:"patterns"===j})]}),[j,v,_,b,g,y,r,D,l,t,e,i,n]),$=(0,T.useMemo)(()=>(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)("div",{className:"block-editor-inserter__block-list",children:(0,Er.jsx)(XK,{ref:L,rootClientId:N,onInsert:M,onHover:D,showMostUsedBlocks:s})}),o&&(0,Er.jsxs)("div",{className:"block-editor-inserter__tips",children:[(0,Er.jsx)(kC.A,{as:"h2",children:(0,ee.__)("A tip for using the block editor")}),(0,Er.jsx)(Oz,{})]})]}),[N,M,D,s,o]),H=(0,T.useMemo)(()=>(0,Er.jsx)(lJ,{rootClientId:N,onInsert:P,onSelectCategory:F,selectedCategory:x,children:z&&(0,Er.jsx)(oJ,{rootClientId:N,onInsert:P,category:x,patternFilter:w,showTitlesAsTooltip:!0})}),[N,P,F,w,x,z]),W=(0,T.useMemo)(()=>(0,Er.jsx)(_J,{rootClientId:N,selectedCategory:S,onSelectCategory:A,onInsert:M,children:V&&(0,Er.jsx)(yJ,{rootClientId:N,onInsert:M,category:S})}),[N,M,S,A,V]),G=(0,T.useRef)();return(0,T.useLayoutEffect)(()=>{G.current&&window.requestAnimationFrame(()=>{G.current.querySelector('[role="tab"][aria-selected="true"]')?.focus()})},[]),(0,Er.jsxs)("div",{className:(0,mh.A)("block-editor-inserter__menu",{"show-panel":z||V,"is-zoom-out":f}),ref:p,children:[(0,Er.jsx)("div",{className:"block-editor-inserter__main-area",children:(0,Er.jsx)(EJ,{ref:G,onSelect:e=>{"patterns"!==e&&k(null),B(e)},onClose:u,selectedTab:j,closeButtonLabel:(0,ee.__)("Close Block Inserter"),tabs:[{name:"blocks",title:(0,ee.__)("Blocks"),panel:(0,Er.jsxs)(Er.Fragment,{children:[U,"blocks"===j&&!y&&$]})},{name:"patterns",title:(0,ee.__)("Patterns"),panel:(0,Er.jsxs)(Er.Fragment,{children:[U,"patterns"===j&&!y&&H]})},{name:"media",title:(0,ee.__)("Media"),panel:(0,Er.jsxs)(Er.Fragment,{children:[U,W]})}]})}),o&&v&&(0,Er.jsx)(uw.Ay,{className:"block-editor-inserter__preview-container__popover",placement:"right-start",offset:16,focusOnMount:!1,animate:!1,children:(0,Er.jsx)(NK,{item:v})})]})}),NJ=(0,T.forwardRef)(function(e,t){return(0,Er.jsx)(BJ,{...e,onPatternCategorySelection:TJ,ref:t})});function RJ({onSelect:e,rootClientId:t,clientId:n,isAppender:i,selectBlockOnInsert:r,hasSearch:o=!0}){const[s,a]=(0,T.useState)(""),[l,c]=aY({onSelect:e,rootClientId:t,clientId:n,isAppender:i,selectBlockOnInsert:r}),[u]=bT(l,c,!0),{setInserterIsOpened:d,insertionIndex:h}=(0,zt.A)(e=>{const{getSettings:t,getBlockIndex:i,getBlockCount:r}=e(Qy),o=t(),s=i(n),a=r();return{setInserterIsOpened:o.__experimentalSetIsInserterOpened,insertionIndex:-1===s?a:s}},[n]),p=o&&u.length>6;return(0,T.useEffect)(()=>{d&&d(!1)},[d]),(0,Er.jsxs)("div",{className:(0,mh.A)("block-editor-inserter__quick-inserter",{"has-search":p,"has-expand":d}),children:[p&&(0,Er.jsx)(cj.A,{className:"block-editor-inserter__search",value:s,onChange:e=>{a(e)},label:(0,ee.__)("Search"),placeholder:(0,ee.__)("Search")}),(0,Er.jsx)("div",{className:"block-editor-inserter__quick-inserter-results",children:(0,Er.jsx)(SJ,{filterValue:s,onSelect:e,rootClientId:t,clientId:n,isAppender:i,maxBlockPatterns:s?2:0,maxBlockTypes:6,isDraggable:!1,selectBlockOnInsert:r,isQuick:!0})}),d&&(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{d({filterValue:s,onSelect:e,rootClientId:t,insertionIndex:h})},"aria-label":(0,ee.__)("Browse all. This will open the main inserter panel in the editor toolbar."),children:(0,ee.__)("Browse all")})]})}var OJ,LJ=({onToggle:e,disabled:t,isOpen:n,blockTitle:i,hasSingleBlockType:r,appenderLabel:o,toggleProps:s={}})=>{const{as:a=fv.Ay,label:l,onClick:c,...u}=s;let d=l;return!d&&o?d=o:!d&&r?d=(0,ee.sprintf)((0,ee._x)("Add %s","directly add the only allowed block"),i.toLowerCase()):d||(d=(0,ee._x)("Add block","Generic label for block inserter button")),(0,Er.jsx)(a,{__next40pxDefaultSize:!s.as||void 0,icon:kw.A,label:d,tooltipPosition:"bottom",onClick:function(t){e&&e(t),c&&c(t)},className:"block-editor-inserter__toggle","aria-haspopup":!r&&"true","aria-expanded":!r&&n,disabled:t,...u})},MJ=class extends T.Component{constructor(){super(...arguments),this.onToggle=this.onToggle.bind(this),this.renderToggle=this.renderToggle.bind(this),this.renderContent=this.renderContent.bind(this)}onToggle(e){const{onToggle:t}=this.props;t&&t(e)}renderToggle({onToggle:e,isOpen:t}){const{disabled:n,blockTitle:i,hasSingleBlockType:r,appenderLabel:o,toggleProps:s,hasItems:a,renderToggle:l=LJ}=this.props;return l({onToggle:e,isOpen:t,disabled:n||!a,blockTitle:i,hasSingleBlockType:r,appenderLabel:o,toggleProps:s})}renderContent({onClose:e}){const{rootClientId:t,clientId:n,isAppender:i,showInserterHelpPanel:r,__experimentalIsQuick:o,onSelectOrClose:s,selectBlockOnInsert:a}=this.props;return o?(0,Er.jsx)(RJ,{onSelect:t=>{const n=Array.isArray(t)&&t?.length?t[0]:t;s&&"function"==typeof s&&s(n),e()},rootClientId:t,clientId:n,isAppender:i,selectBlockOnInsert:a}):(0,Er.jsx)(NJ,{onSelect:()=>{e()},onClose:e,rootClientId:t,clientId:n,isAppender:i,showInserterHelpPanel:r})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:i,__experimentalIsQuick:r,onSelectOrClose:o}=this.props;return t||n?this.renderToggle({onToggle:i}):(0,Er.jsx)(wC.A,{className:"block-editor-inserter",contentClassName:(0,mh.A)("block-editor-inserter__popover",{"is-quick":r}),popoverProps:{position:e,shift:!0},onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,ee.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:o})}},PJ=(0,z.A)([(0,US.A)((e,{clientId:t,rootClientId:n,shouldDirectInsert:i=!0})=>{const{getBlockRootClientId:r,hasInserterItems:o,getAllowedBlocks:s,getDirectInsertBlock:a}=e(Qy),{getBlockVariations:l,getBlockType:c}=e(Zi),u=s(n=n||r(t)||void 0),d=i&&a(n),h=1===u?.length&&0===l(u[0].name,"inserter")?.length;let p=!1;h&&(p=u[0]);const f=function(e,t){if(!e||!e.attributes||!t?.__experimentalLabel)return null;const n=t.__experimentalLabel(e.attributes,{context:"appender"});return"string"==typeof n&&n.length<50&&n.length>0?n:null}(d,d?c(d.name):null);return{hasItems:o(n),hasSingleBlockType:h,blockTitle:p?p.title:"",allowedBlockType:p,directInsertBlock:d,appenderLabel:f,rootClientId:n}}),(0,bS.A)((e,t,{select:n})=>({insertOnlyAllowedBlock(){const{rootClientId:i,clientId:r,isAppender:o,hasSingleBlockType:s,allowedBlockType:a,directInsertBlock:l,onSelectOrClose:c,selectBlockOnInsert:u}=t;if(!s&&!l)return;const{insertBlock:d}=e(Qy);let h;if(l){const e=function(e){const{getBlock:t,getPreviousBlockClientId:o}=n(Qy);if(!e||!r&&!i)return{};const s={};let a={};if(r){const e=t(r),n=t(o(r));e?.name===n?.name&&(a=n?.attributes||{})}else{const e=t(i);if(e?.innerBlocks?.length){const t=e.innerBlocks[e.innerBlocks.length-1];l&&l?.name===t.name&&(a=t.attributes)}}return e.forEach(e=>{a.hasOwnProperty(e)&&(s[e]=a[e])}),s}(l.attributesToCopy);h=er(l.name,{...l.attributes||{},...e})}else h=er(a.name);d(h,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:s,getBlockRootClientId:a}=n(Qy);if(r)return e(r);const l=t();return!o&&l&&a(l)===i?e(l)+1:s(i).length}(),i,u),c&&c(h);const p=(0,ee.sprintf)((0,ee.__)("%s block added"),a.title);(0,dt.L)(p)}})),(OJ=({hasItems:e,isAppender:t,rootClientId:n,clientId:i})=>e||!t&&!n&&!i,(0,gh.f)(e=>t=>OJ(t)?(0,Er.jsx)(e,{...t}):null,"ifCondition"))])(MJ);function DJ({rootClientId:e,className:t,onFocus:n,tabIndex:i,onSelect:r},o){return(0,Er.jsx)(PJ,{position:"bottom center",rootClientId:e,__experimentalIsQuick:!0,onSelectOrClose:(...e)=>{r&&"function"==typeof r&&r(...e)},renderToggle:({onToggle:e,disabled:r,isOpen:s,blockTitle:a,hasSingleBlockType:l,appenderLabel:c})=>{const u=!l;let d;return d=c||(l?(0,ee.sprintf)((0,ee._x)("Add %s","directly add the only allowed block"),a.toLowerCase()):(0,ee._x)("Add block","Generic label for block inserter button")),(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,ref:o,onFocus:n,tabIndex:i,className:(0,mh.A)(t,"block-editor-button-block-appender"),onClick:e,"aria-haspopup":u?"true":void 0,"aria-expanded":u?s:void 0,disabled:r,label:d,showTooltip:!0,children:(0,Er.jsx)(xx.A,{icon:kw.A})})},isAppender:!0})}(0,T.forwardRef)((e,t)=>((0,Qt.A)("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),DJ(e,t)));var FJ=(0,T.forwardRef)(DJ);function zJ({clientId:e,contentRef:t,parentLayout:n,childGridClientId:i}){const r=(0,zt.A)(e=>e(Qy).getSettings().isDistractionFree,[]),o=BO(e);if(r||!o)return null;const s=n?.isManualPlacement&&window.__experimentalEnableGridInteractivity;return(0,Er.jsx)(VJ,{gridClientId:e,gridElement:o,isManualGrid:s,ref:t,childGridClientId:i})}var VJ=(0,T.forwardRef)(({gridClientId:e,gridElement:t,isManualGrid:n,childGridClientId:i},r)=>{const[o,s]=(0,T.useState)(()=>jz(t)),[a,l]=(0,T.useState)(!1),c=BO(i),u=(0,T.useMemo)(()=>{return c?function(e,t){const n=parseFloat(Az(e,"column-gap")),i=parseFloat(Az(e,"row-gap")),r=Iz(Az(e,"grid-template-columns"),n),o=Iz(Az(e,"grid-template-rows"),i),s=Ez(r,t.left)+1,a=Ez(o,t.top)+1,l=Ez(r,t.right,"end")+1,c=Ez(o,t.bottom,"end")+1;return new Sz({columnStart:s,columnEnd:l,rowStart:a,rowEnd:c})}((e=c).parentElement,new window.DOMRect(e.offsetLeft,e.offsetTop,e.offsetWidth,e.offsetHeight)):null;var e},[c]);return(0,T.useEffect)(()=>{const e=()=>s(jz(t)),n=new window.ResizeObserver(e);n.observe(t,{box:"border-box"});const i=new window.ResizeObserver(e);i.observe(t);for(const e of t.children)i.observe(e);return()=>{n.disconnect(),i.disconnect()}},[t]),(0,T.useEffect)(()=>{function e(){l(!0)}function t(){l(!1)}return document.addEventListener("drag",e),document.addEventListener("dragend",t),()=>{document.removeEventListener("drag",e),document.removeEventListener("dragend",t)}},[]),(0,Er.jsx)(mD,{className:(0,mh.A)("block-editor-grid-visualizer",{"is-dropping-allowed":a}),clientId:e,__unstablePopoverSlot:"__unstable-block-tools-after",children:(0,Er.jsx)("div",{ref:r,className:"block-editor-grid-visualizer__grid",style:o.style,children:n?(0,Er.jsx)($J,{gridClientId:e,gridInfo:o,childGridRect:u}):(0,Er.jsx)(UJ,{gridInfo:o,childGridRect:u})})})});function UJ({gridInfo:e,childGridRect:t}){return Cz(1,e.numRows).map(n=>Cz(1,e.numColumns).map(i=>{let r=e.currentColor;return t?.contains(i,n)&&(r="transparent"),(0,Er.jsx)(HJ,{color:r},`${n}-${i}`)}))}function $J({gridClientId:e,gridInfo:t,childGridRect:n}){const[i,r]=(0,T.useState)(null),o=(0,zt.A)(t=>{const{getBlockOrder:n,getBlockStyles:i}=Gh(t(Qy));return i(n(e))},[e]),s=(0,T.useMemo)(()=>{const e=[];for(const t of Object.values(o)){const{columnStart:n,rowStart:i,columnSpan:r=1,rowSpan:o=1}=t?.layout??{};n&&i&&e.push(new Sz({columnStart:n,rowStart:i,columnSpan:r,rowSpan:o}))}return e},[o]);return Cz(1,t.numRows).map(o=>Cz(1,t.numColumns).map(a=>{const l=n?.contains(a,o);let c=t.currentColor;l&&(c="transparent");const u=s.some(e=>e.contains(a,o)),d=i?.contains(a,o)??!1;return(0,Er.jsx)(HJ,{color:c,className:d&&"is-highlighted",children:u&&!l?(0,Er.jsx)(GJ,{column:a,row:o,gridClientId:e,gridInfo:t,setHighlightedRect:r}):(0,Er.jsx)(qJ,{column:a,row:o,gridClientId:e,gridInfo:t,setHighlightedRect:r})},`${o}-${a}`)}))}function HJ({color:e,children:t,className:n}){return(0,Er.jsx)("div",{className:(0,mh.A)("block-editor-grid-visualizer__cell",n),style:{boxShadow:`inset 0 0 0 1px color-mix(in srgb, ${e} 20%, #0000)`,color:e},children:t})}function WJ(e,t,n,i,r){const{getBlockAttributes:o,getBlockRootClientId:s,canInsertBlockType:a,getBlockName:l}=(0,zt.A)(Qy),{updateBlockAttributes:c,moveBlocksToPosition:u,__unstableMarkNextChangeAsNotPersistent:d}=(0,Vt.A)(Qy),h=jP(n,i.numColumns);return function({validateDrag:e,onDragEnter:t,onDragLeave:n,onDrop:i}){const{getDraggedBlockClientIds:r}=(0,zt.A)(Qy);return OC({onDragEnter(){const[n]=r();n&&e(n)&&t(n)},onDragLeave(){n()},onDrop(){const[t]=r();t&&e(t)&&i(t)}})}({validateDrag(r){const s=l(r);if(!a(s,n))return!1;const c=o(r),u=new Sz({columnStart:e,rowStart:t,columnSpan:c.style?.layout?.columnSpan,rowSpan:c.style?.layout?.rowSpan});return new Sz({columnSpan:i.numColumns,rowSpan:i.numRows}).containsRect(u)},onDragEnter(n){const i=o(n);r(new Sz({columnStart:e,rowStart:t,columnSpan:i.style?.layout?.columnSpan,rowSpan:i.style?.layout?.rowSpan}))},onDragLeave(){r(n=>n?.columnStart===e&&n?.rowStart===t?null:n)},onDrop(i){r(null);const a=o(i);c(i,{style:{...a.style,layout:{...a.style?.layout,columnStart:e,rowStart:t}}}),d(),u([i],s(i),n,h(e,t))}})}function GJ({column:e,row:t,gridClientId:n,gridInfo:i,setHighlightedRect:r}){return(0,Er.jsx)("div",{className:"block-editor-grid-visualizer__drop-zone",ref:WJ(e,t,n,i,r)})}function qJ({column:e,row:t,gridClientId:n,gridInfo:i,setHighlightedRect:r}){const{updateBlockAttributes:o,moveBlocksToPosition:s,__unstableMarkNextChangeAsNotPersistent:a}=(0,Vt.A)(Qy),l=jP(n,i.numColumns);return(0,Er.jsx)(FJ,{rootClientId:n,className:"block-editor-grid-visualizer__appender",ref:WJ(e,t,n,i,r),style:{color:i.currentColor},onSelect:i=>{i&&(o(i.clientId,{style:{layout:{columnStart:e,rowStart:t}}}),a(),s([i.clientId],n,n,l(e,t)))}})}var KJ,YJ=function(){return YJ=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},YJ.apply(this,arguments)},JJ={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},XJ={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},ZJ={width:"20px",height:"20px",position:"absolute",zIndex:1},QJ={top:YJ(YJ({},JJ),{top:"-5px"}),right:YJ(YJ({},XJ),{left:void 0,right:"-5px"}),bottom:YJ(YJ({},JJ),{top:void 0,bottom:"-5px"}),left:YJ(YJ({},XJ),{left:"-5px"}),topRight:YJ(YJ({},ZJ),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:YJ(YJ({},ZJ),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:YJ(YJ({},ZJ),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:YJ(YJ({},ZJ),{left:"-10px",top:"-10px",cursor:"nw-resize"})},eX=(0,T.memo)(function(e){var t=e.onResizeStart,n=e.direction,i=e.children,r=e.replaceStyles,o=e.className,s=(0,T.useCallback)(function(e){t(e,n)},[t,n]),a=(0,T.useCallback)(function(e){t(e,n)},[t,n]),l=(0,T.useMemo)(function(){return YJ(YJ({position:"absolute",userSelect:"none"},QJ[n]),null!=r?r:{})},[r,n]);return(0,Er.jsx)("div",{className:o||void 0,style:l,onMouseDown:s,onTouchStart:a,children:i})}),tX=(KJ=function(e,t){return KJ=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},KJ(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}KJ(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nX=function(){return nX=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},nX.apply(this,arguments)},iX={width:"auto",height:"auto"},rX=function(e,t,n){return Math.max(Math.min(e,n),t)},oX=function(e,t,n){var i=Math.round(e/t);return i*t+n*(i-1)},sX=function(e,t){return new RegExp(e,"i").test(t)},aX=function(e){return Boolean(e.touches&&e.touches.length)},lX=function(e,t,n){void 0===n&&(n=0);var i=t.reduce(function(n,i,r){return Math.abs(i-e)<Math.abs(t[n]-e)?r:n},0),r=Math.abs(t[i]-e);return 0===n||r<n?t[i]:e},cX=function(e){return"auto"===(e=e.toString())||e.endsWith("px")||e.endsWith("%")||e.endsWith("vh")||e.endsWith("vw")||e.endsWith("vmax")||e.endsWith("vmin")?e:"".concat(e,"px")},uX=function(e,t,n,i){if(e&&"string"==typeof e){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%"))return t*(Number(e.replace("%",""))/100);if(e.endsWith("vw"))return n*(Number(e.replace("vw",""))/100);if(e.endsWith("vh"))return i*(Number(e.replace("vh",""))/100)}return e},dX=["as","ref","style","className","grid","gridGap","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],hX="__resizable_base__",pX=function(e){function t(t){var n,i,r,o,s=e.call(this,t)||this;return s.ratio=1,s.resizable=null,s.parentLeft=0,s.parentTop=0,s.resizableLeft=0,s.resizableRight=0,s.resizableTop=0,s.resizableBottom=0,s.targetLeft=0,s.targetTop=0,s.delta={width:0,height:0},s.appendBase=function(){if(!s.resizable||!s.window)return null;var e=s.parentNode;if(!e)return null;var t=s.window.document.createElement("div");return t.style.width="100%",t.style.height="100%",t.style.position="absolute",t.style.transform="scale(0, 0)",t.style.left="0",t.style.flex="0 0 100%",t.classList?t.classList.add(hX):t.className+=hX,e.appendChild(t),t},s.removeBase=function(e){var t=s.parentNode;t&&t.removeChild(e)},s.state={isResizing:!1,width:null!==(i=null===(n=s.propsSize)||void 0===n?void 0:n.width)&&void 0!==i?i:"auto",height:null!==(o=null===(r=s.propsSize)||void 0===r?void 0:r.height)&&void 0!==o?o:"auto",direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},s.onResizeStart=s.onResizeStart.bind(s),s.onMouseMove=s.onMouseMove.bind(s),s.onMouseUp=s.onMouseUp.bind(s),s}return tX(t,e),Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return this.resizable&&this.resizable.ownerDocument?this.resizable.ownerDocument.defaultView:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||iX},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var e=0,t=0;if(this.resizable&&this.window){var n=this.resizable.offsetWidth,i=this.resizable.offsetHeight,r=this.resizable.style.position;"relative"!==r&&(this.resizable.style.position="relative"),e="auto"!==this.resizable.style.width?this.resizable.offsetWidth:n,t="auto"!==this.resizable.style.height?this.resizable.offsetHeight:i,this.resizable.style.position=r}return{width:e,height:t}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var e=this,t=this.props.size,n=function(t){var n;if(void 0===e.state[t]||"auto"===e.state[t])return"auto";if(e.propsSize&&e.propsSize[t]&&(null===(n=e.propsSize[t])||void 0===n?void 0:n.toString().endsWith("%"))){if(e.state[t].toString().endsWith("%"))return e.state[t].toString();var i=e.getParentSize(),r=Number(e.state[t].toString().replace("px",""))/i[t]*100;return"".concat(r,"%")}return cX(e.state[t])};return{width:t&&void 0!==t.width&&!this.state.isResizing?cX(t.width):n("width"),height:t&&void 0!==t.height&&!this.state.isResizing?cX(t.height):n("height")}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var e=this.appendBase();if(!e)return{width:0,height:0};var t=!1,n=this.parentNode.style.flexWrap;"wrap"!==n&&(t=!0,this.parentNode.style.flexWrap="wrap"),e.style.position="relative",e.style.minWidth="100%",e.style.minHeight="100%";var i={width:e.offsetWidth,height:e.offsetHeight};return t&&(this.parentNode.style.flexWrap=n),this.removeBase(e),i},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(this.resizable&&this.window){var e=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:"auto"!==e.flexBasis?e.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(e,t){var n=this.propsSize&&this.propsSize[t];return"auto"!==this.state[t]||this.state.original[t]!==e||void 0!==n&&"auto"!==n?e:"auto"},t.prototype.calculateNewMaxFromBoundary=function(e,t){var n,i,r=this.props.boundsByDirection,o=this.state.direction,s=r&&sX("left",o),a=r&&sX("top",o);if("parent"===this.props.bounds){var l=this.parentNode;l&&(n=s?this.resizableRight-this.parentLeft:l.offsetWidth+(this.parentLeft-this.resizableLeft),i=a?this.resizableBottom-this.parentTop:l.offsetHeight+(this.parentTop-this.resizableTop))}else"window"===this.props.bounds?this.window&&(n=s?this.resizableRight:this.window.innerWidth-this.resizableLeft,i=a?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(n=s?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),i=a?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return n&&Number.isFinite(n)&&(e=e&&e<n?e:n),i&&Number.isFinite(i)&&(t=t&&t<i?t:i),{maxWidth:e,maxHeight:t}},t.prototype.calculateNewSizeFromDirection=function(e,t){var n,i=this.props.scale||1,r=(n=this.props.resizeRatio||1,Array.isArray(n)?n:[n,n]),o=r[0],s=r[1],a=this.state,l=a.direction,c=a.original,u=this.props,d=u.lockAspectRatio,h=u.lockAspectRatioExtraHeight,p=u.lockAspectRatioExtraWidth,f=c.width,m=c.height,g=h||0,b=p||0;return sX("right",l)&&(f=c.width+(e-c.x)*o/i,d&&(m=(f-b)/this.ratio+g)),sX("left",l)&&(f=c.width-(e-c.x)*o/i,d&&(m=(f-b)/this.ratio+g)),sX("bottom",l)&&(m=c.height+(t-c.y)*s/i,d&&(f=(m-g)*this.ratio+b)),sX("top",l)&&(m=c.height-(t-c.y)*s/i,d&&(f=(m-g)*this.ratio+b)),{newWidth:f,newHeight:m}},t.prototype.calculateNewSizeFromAspectRatio=function(e,t,n,i){var r=this.props,o=r.lockAspectRatio,s=r.lockAspectRatioExtraHeight,a=r.lockAspectRatioExtraWidth,l=void 0===i.width?10:i.width,c=void 0===n.width||n.width<0?e:n.width,u=void 0===i.height?10:i.height,d=void 0===n.height||n.height<0?t:n.height,h=s||0,p=a||0;if(o){var f=(u-h)*this.ratio+p,m=(d-h)*this.ratio+p,g=(l-p)/this.ratio+h,b=(c-p)/this.ratio+h,y=Math.max(l,f),v=Math.min(c,m),_=Math.max(u,g),x=Math.min(d,b);e=rX(e,y,v),t=rX(t,_,x)}else e=rX(e,l,c),t=rX(t,u,d);return{newWidth:e,newHeight:t}},t.prototype.setBoundingClientRect=function(){var e=1/(this.props.scale||1);if("parent"===this.props.bounds){var t=this.parentNode;if(t){var n=t.getBoundingClientRect();this.parentLeft=n.left*e,this.parentTop=n.top*e}}if(this.props.bounds&&"string"!=typeof this.props.bounds){var i=this.props.bounds.getBoundingClientRect();this.targetLeft=i.left*e,this.targetTop=i.top*e}if(this.resizable){var r=this.resizable.getBoundingClientRect(),o=r.left,s=r.top,a=r.right,l=r.bottom;this.resizableLeft=o*e,this.resizableRight=a*e,this.resizableTop=s*e,this.resizableBottom=l*e}},t.prototype.onResizeStart=function(e,t){if(this.resizable&&this.window){var n,i=0,r=0;if(e.nativeEvent&&function(e){return Boolean((e.clientX||0===e.clientX)&&(e.clientY||0===e.clientY))}(e.nativeEvent)?(i=e.nativeEvent.clientX,r=e.nativeEvent.clientY):e.nativeEvent&&aX(e.nativeEvent)&&(i=e.nativeEvent.touches[0].clientX,r=e.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable&&!1===this.props.onResizeStart(e,t,this.resizable))return;this.props.size&&(void 0!==this.props.size.height&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),void 0!==this.props.size.width&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio="number"==typeof this.props.lockAspectRatio?this.props.lockAspectRatio:this.size.width/this.size.height;var o=this.window.getComputedStyle(this.resizable);if("auto"!==o.flexBasis){var s=this.parentNode;if(s){var a=this.window.getComputedStyle(s).flexDirection;this.flexDir=a.startsWith("row")?"row":"column",n=o.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var l={original:{x:i,y:r,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:nX(nX({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(e.target).cursor||"auto"}),direction:t,flexBasis:n};this.setState(l)}},t.prototype.onMouseMove=function(e){var t=this;if(this.state.isResizing&&this.resizable&&this.window){if(this.window.TouchEvent&&aX(e))try{e.preventDefault(),e.stopPropagation()}catch(e){}var n=this.props,i=n.maxWidth,r=n.maxHeight,o=n.minWidth,s=n.minHeight,a=aX(e)?e.touches[0].clientX:e.clientX,l=aX(e)?e.touches[0].clientY:e.clientY,c=this.state,u=c.direction,d=c.original,h=c.width,p=c.height,f=this.getParentSize(),m=function(e,t,n,i,r,o,s){return i=uX(i,e.width,t,n),r=uX(r,e.height,t,n),o=uX(o,e.width,t,n),s=uX(s,e.height,t,n),{maxWidth:void 0===i?void 0:Number(i),maxHeight:void 0===r?void 0:Number(r),minWidth:void 0===o?void 0:Number(o),minHeight:void 0===s?void 0:Number(s)}}(f,this.window.innerWidth,this.window.innerHeight,i,r,o,s);i=m.maxWidth,r=m.maxHeight,o=m.minWidth,s=m.minHeight;var g=this.calculateNewSizeFromDirection(a,l),b=g.newHeight,y=g.newWidth,v=this.calculateNewMaxFromBoundary(i,r);this.props.snap&&this.props.snap.x&&(y=lX(y,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(b=lX(b,this.props.snap.y,this.props.snapGap));var _=this.calculateNewSizeFromAspectRatio(y,b,{width:v.maxWidth,height:v.maxHeight},{width:o,height:s});if(y=_.newWidth,b=_.newHeight,this.props.grid){var x=oX(y,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),k=oX(b,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),w=this.props.snapGap||0;y=0===w||Math.abs(x-y)<=w?x:y,b=0===w||Math.abs(k-b)<=w?k:b}var C={width:y-d.width,height:b-d.height};if(this.delta=C,h&&"string"==typeof h)if(h.endsWith("%")){var S=y/f.width*100;y="".concat(S,"%")}else if(h.endsWith("vw")){var A=y/this.window.innerWidth*100;y="".concat(A,"vw")}else if(h.endsWith("vh")){var I=y/this.window.innerHeight*100;y="".concat(I,"vh")}p&&"string"==typeof p&&(p.endsWith("%")?(S=b/f.height*100,b="".concat(S,"%")):p.endsWith("vw")?(A=b/this.window.innerWidth*100,b="".concat(A,"vw")):p.endsWith("vh")&&(I=b/this.window.innerHeight*100,b="".concat(I,"vh")));var E={width:this.createSizeForCssProperty(y,"width"),height:this.createSizeForCssProperty(b,"height")};"row"===this.flexDir?E.flexBasis=E.width:"column"===this.flexDir&&(E.flexBasis=E.height);var j=this.state.width!==E.width,T=this.state.height!==E.height,B=this.state.flexBasis!==E.flexBasis,N=j||T||B;N&&(0,Wj.flushSync)(function(){t.setState(E)}),this.props.onResize&&N&&this.props.onResize(e,u,this.resizable,C)}},t.prototype.onMouseUp=function(e){var t,n,i=this.state,r=i.isResizing,o=i.direction;i.original,r&&this.resizable&&(this.props.onResizeStop&&this.props.onResizeStop(e,o,this.resizable,this.delta),this.props.size&&this.setState({width:null!==(t=this.props.size.width)&&void 0!==t?t:"auto",height:null!==(n=this.props.size.height)&&void 0!==n?n:"auto"}),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:nX(nX({},this.state.backgroundStyle),{cursor:"auto"})}))},t.prototype.updateSize=function(e){var t,n;this.setState({width:null!==(t=e.width)&&void 0!==t?t:"auto",height:null!==(n=e.height)&&void 0!==n?n:"auto"})},t.prototype.renderResizer=function(){var e=this,t=this.props,n=t.enable,i=t.handleStyles,r=t.handleClasses,o=t.handleWrapperStyle,s=t.handleWrapperClass,a=t.handleComponent;if(!n)return null;var l=Object.keys(n).map(function(t){return!1!==n[t]?(0,Er.jsx)(eX,{direction:t,onResizeStart:e.onResizeStart,replaceStyles:i&&i[t],className:r&&r[t],children:a&&a[t]?a[t]:null},t):null});return(0,Er.jsx)("div",{className:s,style:o,children:l})},t.prototype.render=function(){var e=this,t=Object.keys(this.props).reduce(function(t,n){return-1!==dX.indexOf(n)||(t[n]=e.props[n]),t},{}),n=nX(nX(nX({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(n.flexBasis=this.state.flexBasis);var i=this.props.as||"div";return(0,Er.jsxs)(i,nX({style:n,className:this.props.className},t,{ref:function(t){t&&(e.resizable=t)},children:[this.state.isResizing&&(0,Er.jsx)("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer()]}))},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],gridGap:[0,0],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(T.PureComponent),fX=()=>{},mX="bottom",gX="corner";var bX=(0,ex.A)("div",{target:"e1wq7y4k3"})({name:"1cd7zoc",styles:"bottom:0;box-sizing:border-box;left:0;pointer-events:none;position:absolute;right:0;top:0"}),yX=(0,ex.A)("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"}),vX=(0,ex.A)("div",{target:"e1wq7y4k1"})("background:",nx.l.theme.foreground,";border-radius:",rx.A.radiusSmall,";box-sizing:border-box;font-family:",(0,DC.g)("default.fontFamily"),";font-size:12px;color:",nx.l.theme.foregroundInverted,";padding:4px 8px;position:relative;"),_X=(0,ex.A)(lj.A,{target:"e1wq7y4k0"})("&&&{color:",nx.l.theme.foregroundInverted,";display:block;font-size:13px;line-height:1.4;white-space:nowrap;}"),xX=(0,T.forwardRef)(function({label:e,position:t=gX,zIndex:n=1e3,...i},r){const o=!!e,s=t===gX;if(!o)return null;let a={opacity:o?1:void 0,zIndex:n},l={};return t===mX&&(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,ee.isRTL)()?void 0:4,left:(0,ee.isRTL)()?4:void 0}),(0,Er.jsx)(yX,{"aria-hidden":"true",className:"components-resizable-tooltip__tooltip-wrapper",ref:r,style:a,...i,children:(0,Er.jsx)(vX,{className:"components-resizable-tooltip__tooltip",style:l,children:(0,Er.jsx)(_X,{as:"span",children:e})})})}),kX=xX,wX=()=>{},CX=(0,T.forwardRef)(function({axis:e,className:t,fadeTimeout:n=180,isVisible:i=!0,labelRef:r,onResize:o=wX,position:s=mX,showPx:a=!0,zIndex:l=1e3,...c},u){const{label:d,resizeListener:h}=function({axis:e,fadeTimeout:t=180,onResize:n=fX,position:i=mX,showPx:r=!1}){const[o,s]=(0,SC.A)(),a=!!e,[l,c]=(0,T.useState)(!1),[u,d]=(0,T.useState)(!1),{width:h,height:p}=s,f=(0,T.useRef)(p),m=(0,T.useRef)(h),g=(0,T.useRef)(void 0),b=(0,T.useCallback)(()=>{g.current&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>{a||(c(!1),d(!1))},t)},[t,a]);(0,T.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 y=function({axis:e,height:t,moveX:n=!1,moveY:i=!1,position:r=mX,showPx:o=!1,width:s}){if(!n&&!i)return;if(r===gX)return`${s} x ${t}`;const a=o?" px":"";if(e){if("x"===e&&n)return`${s}${a}`;if("y"===e&&i)return`${t}${a}`}return n&&i?`${s} x ${t}`:n?`${s}${a}`:i?`${t}${a}`:void 0}({axis:e,height:p,moveX:l,moveY:u,position:i,showPx:r,width:h});return{label:y,resizeListener:o}}({axis:e,fadeTimeout:n,onResize:o,showPx:a,position:s});if(!i)return null;const p=(0,mh.A)("components-resize-tooltip",t);return(0,Er.jsxs)(bX,{"aria-hidden":"true",className:p,ref:u,...c,children:[h,(0,Er.jsx)(kX,{"aria-hidden":c["aria-hidden"],label:d,position:s,ref:r,zIndex:l})]})}),SX=CX,AX="components-resizable-box__handle",IX="components-resizable-box__side-handle",EX="components-resizable-box__corner-handle",jX={top:(0,mh.A)(AX,IX,"components-resizable-box__handle-top"),right:(0,mh.A)(AX,IX,"components-resizable-box__handle-right"),bottom:(0,mh.A)(AX,IX,"components-resizable-box__handle-bottom"),left:(0,mh.A)(AX,IX,"components-resizable-box__handle-left"),topLeft:(0,mh.A)(AX,EX,"components-resizable-box__handle-top","components-resizable-box__handle-left"),topRight:(0,mh.A)(AX,EX,"components-resizable-box__handle-top","components-resizable-box__handle-right"),bottomRight:(0,mh.A)(AX,EX,"components-resizable-box__handle-bottom","components-resizable-box__handle-right"),bottomLeft:(0,mh.A)(AX,EX,"components-resizable-box__handle-bottom","components-resizable-box__handle-left")},TX={width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0},BX={top:TX,right:TX,bottom:TX,left:TX,topLeft:TX,topRight:TX,bottomRight:TX,bottomLeft:TX},NX=(0,T.forwardRef)(function({className:e,children:t,showHandle:n=!0,__experimentalShowTooltip:i=!1,__experimentalTooltipProps:r={},...o},s){return(0,Er.jsxs)(pX,{className:(0,mh.A)("components-resizable-box__container",n&&"has-show-handle",e),handleComponent:Object.fromEntries(Object.keys(jX).map(e=>[e,(0,Er.jsx)("div",{tabIndex:-1},e)])),handleClasses:jX,handleStyles:BX,ref:s,...o,children:[t,i&&(0,Er.jsx)(SX,{...r})]})});NX.displayName="ResizableBox";var RX=NX;function OX({clientId:e,bounds:t,onChange:n,parentLayout:i}){const r=BO(e),o=r?.parentElement,{isManualPlacement:s}=i;return r&&o?(0,Er.jsx)(LX,{clientId:e,bounds:t,blockElement:r,rootBlockElement:o,onChange:n,isManualGrid:s&&window.__experimentalEnableGridInteractivity}):null}function LX({clientId:e,bounds:t,blockElement:n,rootBlockElement:i,onChange:r,isManualGrid:o}){const[s,a]=(0,T.useState)(null),[l,c]=(0,T.useState)({top:!1,bottom:!1,left:!1,right:!1});(0,T.useEffect)(()=>{const e=new window.ResizeObserver(()=>{const e=n.getBoundingClientRect(),t=i.getBoundingClientRect(),r=e.top>t.top,s=e.bottom<t.bottom,a=e.left>t.left,l=e.right<t.right;c({top:(o||!s)&&r,bottom:s,left:(o||!l)&&a,right:l})});return e.observe(n),()=>e.disconnect()},[n,i,o]);const u={right:"left",left:"right"},d={top:"flex-end",bottom:"flex-start"},h={display:"flex",justifyContent:"center",alignItems:"center",...u[s]&&{justifyContent:u[s]},...d[s]&&{alignItems:d[s]}};return(0,Er.jsx)(mD,{className:"block-editor-grid-item-resizer",clientId:e,__unstablePopoverSlot:"__unstable-block-tools-after",additionalStyles:h,children:(0,Er.jsx)(RX,{className:"block-editor-grid-item-resizer__box",size:{width:"100%",height:"100%"},enable:{bottom:l.bottom,bottomLeft:!1,bottomRight:!1,left:l.left,right:l.right,top:l.top,topLeft:!1,topRight:!1},bounds:t,boundsByDirection:!0,onPointerDown:({target:e,pointerId:t})=>{e.setPointerCapture(t)},onResizeStart:(e,t)=>{a(t)},onResizeStop:(e,t,s)=>{const a=parseFloat(Az(i,"column-gap")),l=parseFloat(Az(i,"row-gap")),c=Iz(Az(i,"grid-template-columns"),a),u=Iz(Az(i,"grid-template-rows"),l),d=new window.DOMRect(n.offsetLeft+s.offsetLeft,n.offsetTop+s.offsetTop,s.offsetWidth,s.offsetHeight),h=Ez(c,d.left)+1,p=Ez(u,d.top)+1,f=Ez(c,d.right,"end")+1,m=Ez(u,d.bottom,"end")+1;r({columnSpan:f-h+1,rowSpan:m-p+1,columnStart:o?h:void 0,rowStart:o?p:void 0})}})})}var MX=n(94824);function PX({layout:e,parentLayout:t,onChange:n,gridClientId:i,blockClientId:r}){const{moveBlocksToPosition:o,__unstableMarkNextChangeAsNotPersistent:s}=(0,Vt.A)(Qy),a=e?.columnStart??1,l=e?.rowStart??1,c=a+(e?.columnSpan??1)-1,u=l+(e?.rowSpan??1)-1,d=t?.columnCount,h=t?.rowCount,p=jP(i,d);return(0,Er.jsx)(Mv,{group:"parent",children:(0,Er.jsxs)(wv,{className:"block-editor-grid-item-mover__move-button-container",children:[(0,Er.jsx)("div",{className:"block-editor-grid-item-mover__move-horizontal-button-container is-left",children:(0,Er.jsx)(DX,{icon:(0,ee.isRTL)()?Lz.A:Mz.A,label:(0,ee.__)("Move left"),description:(0,ee.__)("Move left"),isDisabled:a<=1,onClick:()=>{n({columnStart:a-1}),s(),o([r],i,i,p(a-1,l))}})}),(0,Er.jsxs)("div",{className:"block-editor-grid-item-mover__move-vertical-button-container",children:[(0,Er.jsx)(DX,{className:"is-up-button",icon:MX.A,label:(0,ee.__)("Move up"),description:(0,ee.__)("Move up"),isDisabled:l<=1,onClick:()=>{n({rowStart:l-1}),s(),o([r],i,i,p(a,l-1))}}),(0,Er.jsx)(DX,{className:"is-down-button",icon:wT.A,label:(0,ee.__)("Move down"),description:(0,ee.__)("Move down"),isDisabled:h&&u>=h,onClick:()=>{n({rowStart:l+1}),s(),o([r],i,i,p(a,l+1))}})]}),(0,Er.jsx)("div",{className:"block-editor-grid-item-mover__move-horizontal-button-container is-right",children:(0,Er.jsx)(DX,{icon:(0,ee.isRTL)()?Mz.A:Lz.A,label:(0,ee.__)("Move right"),description:(0,ee.__)("Move right"),isDisabled:d&&c>=d,onClick:()=>{n({columnStart:a+1}),s(),o([r],i,i,p(a+1,l))}})})]})})}function DX({className:e,icon:t,label:n,isDisabled:i,onClick:r,description:o}){const s=`block-editor-grid-item-mover-button__description-${(0,SS.A)(DX)}`;return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(vv,{className:(0,mh.A)("block-editor-grid-item-mover-button",e),icon:t,label:n,"aria-describedby":s,onClick:i?null:r,disabled:i,accessibleWhenDisabled:!0}),(0,Er.jsx)(kC.A,{id:s,children:o})]})}var FX={};function zX({clientId:e,style:t,setAttributes:n,allowSizingOnChildren:i,isManualPlacement:r,parentLayout:o}){const{rootClientId:s,isVisible:a,parentBlockVisibility:l,blockBlockVisibility:c,deviceType:u,isChildBlockAGrid:d}=(0,zt.A)(t=>{const{getBlockRootClientId:n,getBlockEditingMode:i,getTemplateLock:r,getBlockAttributes:o,getSettings:s}=t(Qy),a=n(e);if(r(a)||"default"!==i(a))return{rootClientId:a,isVisible:!1};const l=o(a),c=o(e),u=s();return{rootClientId:a,isVisible:!0,parentBlockVisibility:l?.metadata?.blockVisibility,blockBlockVisibility:c?.metadata?.blockVisibility,deviceType:u?.[Vh]?.toLowerCase()||yp.desktop.value,isChildBlockAGrid:"grid"===c?.layout?.type}},[e]),{isBlockCurrentlyHidden:h}=VG({blockVisibility:l,deviceType:u}),{isBlockCurrentlyHidden:p}=VG({blockVisibility:c,deviceType:u}),[f,m]=(0,T.useState)(),g=d?e:void 0;if(!a||h)return null;const b=i&&!p;function y(e){n({style:{...t,layout:{...t?.layout,...e}}})}return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(zJ,{clientId:s,contentRef:m,parentLayout:o,childGridClientId:g}),b&&(0,Er.jsx)(OX,{clientId:e,bounds:f,onChange:y,parentLayout:o}),r&&window.__experimentalEnableGridInteractivity&&(0,Er.jsx)(PX,{layout:t?.layout,parentLayout:o,onChange:y,gridClientId:s,blockClientId:e})]})}var VX={useBlockProps:function({style:e}){const t=(0,zt.A)(e=>!e(Qy).getSettings().disableLayoutStyles),n=e?.layout??{},{selfStretch:i,flexSize:r,columnStart:o,rowStart:s,columnSpan:a,rowSpan:l}=n,c=jk()||{},{columnCount:u,minimumColumnWidth:d}=c,h=(0,SS.A)(FX),p=`.wp-container-content-${h}`;let f="";if(t&&("fixed"===i&&r?f=`${p} {\n\t\t\t\tflex-basis: ${r};\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}`:"fill"===i?f=`${p} {\n\t\t\t\tflex-grow: 1;\n\t\t\t}`:o&&a?f=`${p} {\n\t\t\t\tgrid-column: ${o} / span ${a};\n\t\t\t}`:o?f=`${p} {\n\t\t\t\tgrid-column: ${o};\n\t\t\t}`:a&&(f=`${p} {\n\t\t\t\tgrid-column: span ${a};\n\t\t\t}`),s&&l?f+=`${p} {\n\t\t\t\tgrid-row: ${s} / span ${l};\n\t\t\t}`:s?f+=`${p} {\n\t\t\t\tgrid-row: ${s};\n\t\t\t}`:l&&(f+=`${p} {\n\t\t\t\tgrid-row: span ${l};\n\t\t\t}`),(a||o)&&(d||!u))){let e=parseFloat(d);isNaN(e)&&(e=12);let t=d?.replace(e,"");["px","rem","em"].includes(t)||(t="rem");let n=2;n=a&&o?a+o-1:a||o;const i="px"===t?24:1.5,r=n*e+(n-1)*i,s=2*e+i-1,l=a&&a>1?"1/-1":"auto";f+=`@container (max-width: ${Math.max(r,s)}${t}) {\n\t\t\t\t${p} {\n\t\t\t\t\tgrid-column: ${l};\n\t\t\t\t\tgrid-row: auto;\n\t\t\t\t}\n\t\t\t}`}if(cv({css:f}),f)return{className:`wp-container-content-${h}`}},edit:function({clientId:e,style:t,setAttributes:n}){const i=jk()||{},{type:r="default",allowSizingOnChildren:o=!1,isManualPlacement:s}=i;return"grid"!==r?null:(0,Er.jsx)(zX,{clientId:e,style:t,setAttributes:n,allowSizingOnChildren:o,isManualPlacement:s,parentLayout:i})},attributeKeys:["style"],hasSupport:()=>!0},UX="metadata";(0,Ei.U2)("blocks.registerBlockType","core/metadata/addMetaAttribute",function(e){return e?.attributes?.[UX]?.type||(e.attributes={...e.attributes,[UX]:{type:"object"}}),e}),(0,Ei.U2)("blocks.switchToBlockType.transformedBlock","core/metadata/addTransforms",function(e,t,n,i){if(1===i.length&&e.innerBlocks.length===t.length)return e;if(1===i.length&&t.length>1||i.length>1&&1===t.length)return e;if(i.length>1&&t.length>1&&i.length!==t.length)return e;const r=t[n]?.attributes?.metadata;if(!r)return e;const o={};return r.noteId&&!e.attributes?.metadata?.noteId&&(o.noteId=r.noteId),r.name&&!e.attributes?.metadata?.name&&_n(e.name,"renaming",!0)&&(o.name=r.name),void 0!==r.blockVisibility&&!e.attributes?.metadata?.blockVisibility&&_n(e.name,"visibility",!0)&&(o.blockVisibility=r.blockVisibility),Object.keys(o).length>0?{...e,attributes:{...e.attributes,metadata:{...e.attributes.metadata,...o}}}:e});var $X={},HX={edit:function({name:e,clientId:t,metadata:{ignoredHookedBlocks:n=[]}={}}){const i=(0,zt.A)(e=>e(Zi).getBlockTypes(),[]),r=(0,T.useMemo)(()=>i?.filter(({name:t,blockHooks:i})=>i&&e in i||n.includes(t)),[i,e,n]),o=(0,zt.A)(n=>{const{getBlocks:i,getBlockRootClientId:o,getGlobalBlockCount:s}=n(Qy),a=o(t),l=r.reduce((n,r)=>{if(0===s(r.name))return n;const o=r?.blockHooks?.[e];let l;switch(o){case"before":case"after":l=i(a);break;case"first_child":case"last_child":l=i(t);break;case void 0:l=[...i(a),...i(t)]}const c=l?.find(e=>e.name===r.name);return c?{...n,[r.name]:c.clientId}:n},{});return Object.values(l).length>0?l:$X},[r,e,t]),{getBlockIndex:s,getBlockCount:a,getBlockRootClientId:l}=(0,zt.A)(Qy),{insertBlock:c,removeBlock:u}=(0,Vt.A)(Qy);if(!r.length)return null;const d=r.reduce((e,t)=>{const[n]=t.name.split("/");return e[n]||(e[n]=[]),e[n].push(t),e},{});return(0,Er.jsx)(oC,{children:(0,Er.jsxs)(mz.Ay,{className:"block-editor-hooks__block-hooks",title:(0,ee.__)("Plugins"),initialOpen:!0,children:[(0,Er.jsx)("p",{className:"block-editor-hooks__block-hooks-helptext",children:(0,ee.__)("Manage the inclusion of blocks added automatically by plugins.")}),Object.keys(d).map(n=>(0,Er.jsxs)(T.Fragment,{children:[(0,Er.jsx)("h3",{children:n}),d[n].map(n=>{const i=n.name in o;return(0,Er.jsx)(Zv.A,{checked:i,label:n.title,onChange:()=>{if(!i){const i=n.blockHooks[e];return void((e,n)=>{const i=s(t),r=a(t),o=l(t);switch(n){case"before":case"after":c(e,"after"===n?i+1:i,o,!1);break;case"first_child":case"last_child":c(e,"first_child"===n?0:r,t,!1);break;case void 0:c(e,i+1,o,!1)}})(er(n.name),i)}u(o[n.name],!1)}},n.title)})]},n))]})})},attributeKeys:["metadata"],hasSupport:()=>!0};function WX(e){return!e||0===Object.keys(e).length}function GX(e){const{clientId:t}=Ih(),n=e||t,{updateBlockAttributes:i}=(0,Vt.A)(Qy),{getBlockAttributes:r}=(0,yt.A)().select(Qy);return{updateBlockBindings:e=>{const{metadata:{bindings:t,...o}={}}=r(n),s={...t};Object.entries(e).forEach(([e,t])=>{t||!s[e]?s[e]=t:delete s[e]});const a={...o,bindings:s};WX(a.bindings)&&delete a.bindings,i(n,{metadata:WX(a)?void 0:a})},removeAllBlockBindings:()=>{const{metadata:{bindings:e,...t}={}}=r(n);i(n,{metadata:WX(t)?void 0:t})}}}var{Menu:qX}=Gh(Ev.j);function KX({args:e,attribute:t,field:n,source:i,sourceKey:r}){const o=(0,T.useMemo)(()=>({source:r,args:n.args||{key:n.key}}),[n.args,n.key,r]),s=(0,T.useContext)(Sj),a=(0,zt.A)(e=>i.getValues({select:e,context:s,bindings:{[t]:o}}),[t,s,o,i]),{updateBlockBindings:l}=GX();return(0,Er.jsxs)(qX.CheckboxItem,{onChange:()=>{const i=F(e,n.args)??n.key===e?.key;l(i?{[t]:void 0}:{[t]:o})},name:t+"-binding",value:a[t],checked:F(e,n.args)??n.key===e?.key,children:[(0,Er.jsx)(qX.ItemLabel,{children:n.label}),(0,Er.jsx)(qX.ItemHelpText,{children:a[t]})]})}function YX({args:e,attribute:t,sourceKey:n,fields:i}){const r=(0,dw.A)("medium","<");if(!i||0===i.length)return null;const o=Cn(n);return(0,Er.jsxs)(qX,{placement:r?"bottom-start":"left-start",children:[(0,Er.jsx)(qX.SubmenuTriggerItem,{children:(0,Er.jsx)(qX.ItemLabel,{children:o.label})}),(0,Er.jsx)(qX.Popover,{gutter:8,children:(0,Er.jsx)(qX.Group,{children:i.map(i=>(0,Er.jsx)(KX,{args:e,attribute:t,field:i,source:o,sourceKey:n},n+JSON.stringify(i.args)||i.key))})})]},n)}var{Menu:JX}=Gh(Ev.j);function XX({attribute:e,binding:t,blockName:n}){const{updateBlockBindings:i}=GX(),r=(0,dw.A)("medium","<"),o=(0,T.useContext)(Sj),s=(0,zt.A)(t=>{const{getAllBlockBindingsSources:i,getBlockBindingsSourceFieldsList:r,getBlockType:s}=Gh(t(Zi)),a=s(n).attributes?.[e];if(a?.enum)return{};const l="rich-text"===a?.type?"string":a?.type,c={};return Object.entries(i()).forEach(([e,t])=>{const n=r(t,o);if(!n?.length)return;const i=n.filter(e=>e.type===l);i.length&&(c[e]=i)}),c},[e,n,o]),{canUpdateBlockBindings:a}=(0,zt.A)(e=>({canUpdateBlockBindings:e(Qy).getSettings().canUpdateBlockBindings})),l=Object.keys(s).length>0,c=!a||!l,{source:u,args:d}=t||{},h=Cn(u);let p,f=!0;return void 0===t?(p=l?(0,ee.__)("Not connected"):(0,ee.__)("No sources available"),f=!0):h?p=s?.[u]?.find(e=>F(e.args,d))?.label||h?.label||u:(f=!1,p=(0,ee.__)("Source not registered")),(0,Er.jsx)(aC,{hasValue:()=>!!t,label:e,onDeselect:!!l&&(()=>{i({[e]:void 0})}),children:(0,Er.jsxs)(JX,{placement:r?"bottom-start":"left-start",children:[(0,Er.jsx)(JX.TriggerButton,{render:(0,Er.jsx)(JY.A,{}),disabled:!l,children:(0,Er.jsxs)(Q_.A,{className:"block-editor-bindings__item",spacing:0,children:[(0,Er.jsx)(lj.A,{truncate:!0,children:e}),(0,Er.jsx)(lj.A,{truncate:!0,variant:f?"muted":void 0,isDestructive:!f,children:p})]})}),!c&&(0,Er.jsx)(JX.Popover,{gutter:r?8:36,children:(0,Er.jsx)(JX,{placement:r?"bottom-start":"left-start",children:Object.entries(s).map(([n,i])=>(0,Er.jsx)(YX,{args:t?.args,attribute:e,sourceKey:n,fields:i},n))})})]})})}var ZX={edit:({name:e,metadata:t})=>{const n=(0,T.useContext)(Sj),{removeAllBlockBindings:i}=GX(),r=(0,dw.A)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}},{bindableAttributes:o,hasCompatibleFields:s}=(0,zt.A)(t=>{const{__experimentalBlockBindingsSupportedAttributes:i}=t(Qy).getSettings(),{getAllBlockBindingsSources:r,getBlockBindingsSourceFieldsList:o}=Gh(t(Zi));return{bindableAttributes:i?.[e],hasCompatibleFields:Object.values(r()).some(e=>o(e,n)?.length>0)}},[e,n]);if(!o||0===o.length)return null;const{bindings:a}=t||{};return void 0!==a||s?(0,Er.jsx)(oC,{group:"bindings",children:(0,Er.jsxs)(Xw,{label:(0,ee.__)("Attributes"),resetAll:()=>{i()},dropdownMenuProps:r,className:"block-editor-bindings__panel",children:[(0,Er.jsx)(YY.A,{isBordered:!0,isSeparated:!0,children:o.map(t=>(0,Er.jsx)(XX,{attribute:t,blockName:e,binding:a?.[t]},t))}),(0,Er.jsx)(lj.A,{as:"div",variant:"muted",children:(0,Er.jsx)("p",{children:(0,ee.__)("Attributes connected to custom fields or other dynamic data.")})})]})}):null},attributeKeys:["metadata"],hasSupport:e=>!["core/post-date","core/navigation-link","core/navigation-submenu"].includes(e)},QX=(0,T.createContext)(void 0);QX.displayName="RovingTabIndexContext";var eZ=QX.Provider;function tZ({children:e}){const[t,n]=(0,T.useState)(),i=(0,T.useMemo)(()=>({lastFocusedElement:t,setLastFocusedElement:n}),[t]);return(0,Er.jsx)(eZ,{value:i,children:e})}function nZ(e){return hS.XC.focusable.find(e,{sequential:!0}).filter(t=>t.closest('[role="row"]')===e)}var iZ=(0,T.forwardRef)(function({children:e,onExpandRow:t=()=>{},onCollapseRow:n=()=>{},onFocusRow:i=()=>{},applicationAriaLabel:r,...o},s){const a=(0,T.useCallback)(e=>{const{keyCode:r,metaKey:o,ctrlKey:s,altKey:a}=e;if(o||s||a||![Rt.UP,Rt.PX,Rt.M3,Rt.NS,Rt.yZ,Rt.Kp].includes(r))return;e.stopPropagation();const{activeElement:l}=document,{currentTarget:c}=e;if(!l||!c.contains(l))return;const u=l.closest('[role="row"]');if(!u)return;const d=nZ(u),h=d.indexOf(l),p=0===h,f=p&&("false"===u.getAttribute("data-expanded")||"false"===u.getAttribute("aria-expanded"))&&r===Rt.NS;if([Rt.M3,Rt.NS].includes(r)){let i;if(i=r===Rt.M3?Math.max(0,h-1):Math.min(h+1,d.length-1),p){if(r===Rt.M3){if("true"===u.getAttribute("data-expanded")||"true"===u.getAttribute("aria-expanded"))return n(u),void e.preventDefault();const t=Math.max(parseInt(u?.getAttribute("aria-level")??"1",10)-1,1),i=Array.from(c.querySelectorAll('[role="row"]'));let r=u;for(let e=i.indexOf(u);e>=0;e--){const n=i[e].getAttribute("aria-level");if(null!==n&&parseInt(n,10)===t){r=i[e];break}}nZ(r)?.[0]?.focus()}if(r===Rt.NS){if("false"===u.getAttribute("data-expanded")||"false"===u.getAttribute("aria-expanded"))return t(u),void e.preventDefault();const n=nZ(u);n.length>0&&n[i]?.focus()}return void e.preventDefault()}if(f)return;d[i].focus(),e.preventDefault()}else if([Rt.UP,Rt.PX].includes(r)){const t=Array.from(c.querySelectorAll('[role="row"]')),n=t.indexOf(u);let o;if(o=r===Rt.UP?Math.max(0,n-1):Math.min(n+1,t.length-1),o===n)return void e.preventDefault();const s=nZ(t[o]);if(!s||!s.length)return void e.preventDefault();s[Math.min(h,s.length-1)].focus(),i(e,u,t[o]),e.preventDefault()}else if([Rt.yZ,Rt.Kp].includes(r)){const t=Array.from(c.querySelectorAll('[role="row"]')),n=t.indexOf(u);let o;if(o=r===Rt.yZ?0:t.length-1,o===n)return void e.preventDefault();const s=nZ(t[o]);if(!s||!s.length)return void e.preventDefault();s[Math.min(h,s.length-1)].focus(),i(e,u,t[o]),e.preventDefault()}},[t,n,i]);return(0,Er.jsx)(tZ,{children:(0,Er.jsx)("div",{role:"application","aria-label":r,children:(0,Er.jsx)("table",{...o,role:"treegrid",onKeyDown:a,ref:s,children:(0,Er.jsx)("tbody",{children:e})})})})});iZ.displayName="TreeGrid";var rZ=iZ,oZ=(0,T.forwardRef)(function({children:e,level:t,positionInSet:n,setSize:i,isExpanded:r,...o},s){return(0,Er.jsx)("tr",{...o,ref:s,role:"row","aria-level":t,"aria-posinset":n,"aria-setsize":i,"aria-expanded":r,children:e})});oZ.displayName="TreeGridRow";var sZ=oZ,aZ=(0,T.forwardRef)(function({children:e,as:t,...n},i){const r=(0,T.useRef)(null),o=i||r,{lastFocusedElement:s,setLastFocusedElement:a}=(0,T.useContext)(QX);let l;s&&(l=s===("current"in o?o.current:void 0)?0:-1);const c={ref:o,tabIndex:l,onFocus:e=>a?.(e.target),...n};return"function"==typeof e?e(c):t?(0,Er.jsx)(t,{...c,children:e}):null});aZ.displayName="RovingTabIndexItem";var lZ=aZ,cZ=(0,T.forwardRef)(function({children:e,...t},n){return(0,Er.jsx)(lZ,{ref:n,...t,children:e})});cZ.displayName="TreeGridItem";var uZ=cZ,dZ=(0,T.forwardRef)(function({children:e,withoutGridItem:t=!1,...n},i){return(0,Er.jsx)("td",{...n,role:"gridcell",children:t?(0,Er.jsx)(Er.Fragment,{children:"function"==typeof e?e({...n,ref:i}):e}):(0,Er.jsx)(uZ,{ref:i,children:e})})});dZ.displayName="TreeGridCell";var hZ=dZ,pZ=(0,T.createContext)({});pZ.displayName="ListViewContext";var fZ=()=>(0,T.useContext)(pZ);function mZ({children:e,...t}){const n=(0,T.useRef)();return(0,T.useEffect)(()=>{n.current&&(n.current.textContent=n.current.textContent)},[e]),(0,Er.jsx)("div",{hidden:!0,...t,ref:n,children:e})}var gZ=(0,T.forwardRef)(({nestingLevel:e,blockCount:t,clientId:n,...i},r)=>{const{insertedBlock:o,setInsertedBlock:s}=fZ(),a=(0,SS.A)(gZ),{directInsert:l,hideInserter:c}=(0,zt.A)(e=>{const{getBlockListSettings:t,getTemplateLock:i,isZoomOut:r}=Gh(e(Qy)),o=t(n);return{directInsert:o?.directInsert||!1,hideInserter:!!i(n)||r()}},[n]),u=Aj({clientId:n,context:"list-view"}),d=Aj({clientId:o?.clientId,context:"list-view"});if((0,T.useEffect)(()=>{d?.length&&(0,dt.L)((0,ee.sprintf)((0,ee.__)("%s block inserted"),d),"assertive")},[d]),c)return null;const h=`list-view-appender__${a}`,p=(0,ee.sprintf)((0,ee.__)("Append to %1$s block at position %2$d, Level %3$d"),u,t+1,e);return(0,Er.jsxs)("div",{className:"list-view-appender",children:[(0,Er.jsx)(PJ,{ref:r,rootClientId:n,position:"bottom right",isAppender:!0,selectBlockOnInsert:!1,shouldDirectInsert:l,__experimentalIsQuick:!0,...i,toggleProps:{"aria-describedby":h},onSelectOrClose:e=>{e?.clientId&&s(e)}}),(0,Er.jsx)(mZ,{id:h,children:p})]})}),bZ=gG(sZ),yZ=(0,T.forwardRef)(({isDragged:e,isSelected:t,position:n,level:i,rowCount:r,children:o,className:s,path:a,...l},c)=>{const u=yG({clientId:l["data-block"],enableAnimation:!0,triggerAnimationOnChange:a}),d=(0,gt.A)([c,u]);return(0,Er.jsx)(bZ,{ref:d,className:(0,mh.A)("block-editor-list-view-leaf",s),level:i,positionInSet:n,setSize:r,isExpanded:void 0,...l,children:o})}),vZ=(e,t)=>"up"===e?"horizontal"===t?(0,ee.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,ee.isRTL)()?"left":"right":"down":null;function _Z(e,t,n,i,r,o,s){const a=n+1;if(e>1)return function(e,t,n,i,r,o){const s=t+1;if(n&&i)return(0,ee.__)("All blocks are selected, and cannot be moved");if(r>0&&!i){const t=vZ("down",o);if("down"===t)return(0,ee.sprintf)((0,ee.__)("Move %1$d blocks from position %2$d down by one place"),e,s);if("left"===t)return(0,ee.sprintf)((0,ee.__)("Move %1$d blocks from position %2$d left by one place"),e,s);if("right"===t)return(0,ee.sprintf)((0,ee.__)("Move %1$d blocks from position %2$d right by one place"),e,s)}if(r>0&&i){const e=vZ("down",o);if("down"===e)return(0,ee.__)("Blocks cannot be moved down as they are already at the bottom");if("left"===e)return(0,ee.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,ee.__)("Blocks cannot be moved right as they are already are at the rightmost position")}if(r<0&&!n){const t=vZ("up",o);if("up"===t)return(0,ee.sprintf)((0,ee.__)("Move %1$d blocks from position %2$d up by one place"),e,s);if("left"===t)return(0,ee.sprintf)((0,ee.__)("Move %1$d blocks from position %2$d left by one place"),e,s);if("right"===t)return(0,ee.sprintf)((0,ee.__)("Move %1$d blocks from position %2$d right by one place"),e,s)}if(r<0&&n){const e=vZ("up",o);if("up"===e)return(0,ee.__)("Blocks cannot be moved up as they are already at the top");if("left"===e)return(0,ee.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,ee.__)("Blocks cannot be moved right as they are already are at the rightmost position")}}(e,n,i,r,o,s);if(i&&r)return(0,ee.sprintf)((0,ee.__)("Block %s is the only block, and cannot be moved"),t);if(o>0&&!r){const e=vZ("down",s);if("down"===e)return(0,ee.sprintf)((0,ee.__)("Move %1$s block from position %2$d down to position %3$d"),t,a,a+1);if("left"===e)return(0,ee.sprintf)((0,ee.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a+1);if("right"===e)return(0,ee.sprintf)((0,ee.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a+1)}if(o>0&&r){const e=vZ("down",s);if("down"===e)return(0,ee.sprintf)((0,ee.__)("Block %1$s is at the end of the content and can’t be moved down"),t);if("left"===e)return(0,ee.sprintf)((0,ee.__)("Block %1$s is at the end of the content and can’t be moved left"),t);if("right"===e)return(0,ee.sprintf)((0,ee.__)("Block %1$s is at the end of the content and can’t be moved right"),t)}if(o<0&&!i){const e=vZ("up",s);if("up"===e)return(0,ee.sprintf)((0,ee.__)("Move %1$s block from position %2$d up to position %3$d"),t,a,a-1);if("left"===e)return(0,ee.sprintf)((0,ee.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a-1);if("right"===e)return(0,ee.sprintf)((0,ee.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a-1)}if(o<0&&i){const e=vZ("up",s);if("up"===e)return(0,ee.sprintf)((0,ee.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,ee.sprintf)((0,ee.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,ee.sprintf)((0,ee.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}var xZ=(e,t)=>"up"===e?"horizontal"===t?(0,ee.isRTL)()?Lz.A:Mz.A:MX.A:"down"===e?"horizontal"===t?(0,ee.isRTL)()?Mz.A:Lz.A:wT.A:null,kZ=(e,t)=>"up"===e?"horizontal"===t?(0,ee.isRTL)()?(0,ee.__)("Move right"):(0,ee.__)("Move left"):(0,ee.__)("Move up"):"down"===e?"horizontal"===t?(0,ee.isRTL)()?(0,ee.__)("Move left"):(0,ee.__)("Move right"):(0,ee.__)("Move down"):null,wZ=(0,T.forwardRef)(({clientIds:e,direction:t,orientation:n,...i},r)=>{const o=(0,SS.A)(wZ),s=Array.isArray(e)?e:[e],a=s.length,{blockType:l,isDisabled:c,rootClientId:u,isFirst:d,isLast:h,firstIndex:p,orientation:f="vertical"}=(0,zt.A)(e=>{const{getBlockIndex:i,getBlockRootClientId:r,getBlockOrder:o,getBlock:a,getBlockListSettings:l}=e(Qy),c=s[0],u=r(c),d=i(c),h=i(s[s.length-1]),p=o(u),f=a(c),m=0===d,g=h===p.length-1,{orientation:b}=l(u)||{};return{blockType:f?bn(f.name):null,isDisabled:"up"===t?m:g,rootClientId:u,firstIndex:d,isFirst:m,isLast:g,orientation:n||b}},[e,t]),{moveBlocksDown:m,moveBlocksUp:g}=(0,Vt.A)(Qy),b="up"===t?g:m,y=`block-editor-block-mover-button__description-${o}`;return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,ref:r,className:(0,mh.A)("block-editor-block-mover-button",`is-${t}-button`),icon:xZ(t,f),label:kZ(t,f),"aria-describedby":y,...i,onClick:c?null:t=>{b(e,u),i.onClick&&i.onClick(t)},disabled:c,accessibleWhenDisabled:!0,shortcut:"up"===t?Rt.dz.secondary("t"):Rt.dz.secondary("y")}),(0,Er.jsx)(kC.A,{id:y,children:_Z(a,l&&l.title,p,d,h,"up"===t?-1:1,f)})]})}),CZ=(0,T.forwardRef)((e,t)=>(0,Er.jsx)(wZ,{direction:"up",ref:t,...e})),SZ=(0,T.forwardRef)((e,t)=>(0,Er.jsx)(wZ,{direction:"down",ref:t,...e})),AZ=n(13776),IZ=n(19701),EZ=n(52594);function jZ({onClick:e}){return(0,Er.jsx)("span",{className:"block-editor-list-view__expander",onClick:t=>e(t,{forceToggle:!0}),"aria-hidden":"true","data-testid":"list-view-expander",children:(0,Er.jsx)(xx.A,{icon:(0,ee.isRTL)()?RS.A:OS.A})})}function TZ(e){return(0,zt.A)(t=>{const{canLockBlockType:n,getBlockName:i,isEditLockedBlock:r,isMoveLockedBlock:o,isRemoveLockedBlock:s,isLockedBlock:a}=Gh(t(Qy));return{isEditLocked:r(e),isMoveLocked:o(e),isRemoveLocked:s(e),canLock:n(i(e)),isLocked:a(e)}},[e])}var BZ={"core/image":({clientId:e,attributes:t})=>{if(t.url)return{url:t.url,alt:t.alt||"",clientId:e}},"core/cover":({clientId:e,attributes:t})=>{if("image"===t.backgroundType&&t.url)return{url:t.url,alt:t.alt||"",clientId:e}},"core/media-text":({clientId:e,attributes:t})=>{if("image"===t.mediaType&&t.mediaUrl)return{url:t.mediaUrl,alt:t.mediaAlt||"",clientId:e}},"core/gallery":({innerBlocks:e})=>{const t=[],n=e?.length?BZ[e[0].name]:void 0;if(!n)return t;for(const i of e){const e=n(i);if(e&&t.push(e),t.length>=3)return t}return t}};function NZ(e){if(!e?.length)return!1;const t=e.filter(e=>e&&!1===e.attributes?.metadata?.blockVisibility).length;return 0!==t&&(t===e.length||null)}function RZ(e){if(!e&&!1!==e)return null;if(!1===e)return(0,ee.__)("Block is hidden");if(e?.viewport){const t=vp.filter(([t])=>!1===e.viewport?.[t]).map(([,e])=>e.label);if(t.length>0)return(0,ee.sprintf)((0,ee.__)("Block is hidden on %s"),t.join(", "))}return null}var{Badge:OZ}=Gh(Ev.j),LZ=(0,T.forwardRef)(function({className:e,block:{clientId:t},onClick:n,onContextMenu:i,onMouseDown:r,onToggleExpanded:o,tabIndex:s,onFocus:a,onDragStart:l,onDragEnd:c,draggable:u,isExpanded:d,ariaDescribedBy:h},p){const f=Ej(t),m=Aj({clientId:t,context:"list-view"}),{isLocked:g}=TZ(t),{hasPatternName:b,blockVisibility:y}=(0,zt.A)(e=>{const{getBlockAttributes:n}=Gh(e(Qy)),i=n(t);return{hasPatternName:!!i?.metadata?.patternName,blockVisibility:i?.metadata?.blockVisibility}},[t]),v=g,_="sticky"===f?.positionType,x=function({clientId:e,isExpanded:t}){const{block:n}=(0,zt.A)(t=>({block:t(Qy).getBlock(e)}),[e]);return(0,T.useMemo)(()=>function(e,t){const n=BZ[e.name],i=n?n(e):void 0;return i?Array.isArray(i)?t?[]:i:[i]:[]}(n,t),[n,t])}({clientId:t,isExpanded:d}),k=RZ(y);return(0,Er.jsxs)("a",{className:(0,mh.A)("block-editor-list-view-block-select-button",e),onClick:n,onContextMenu:i,onKeyDown:function(e){e.keyCode!==Rt.Fm&&e.keyCode!==Rt.t6||n(e)},onMouseDown:r,ref:p,tabIndex:s,onFocus:a,onDragStart:e=>{e.dataTransfer.clearData(),l?.(e)},onDragEnd:c,draggable:u,href:`#block-${t}`,"aria-describedby":h,"aria-expanded":d,children:[(0,Er.jsx)(jZ,{onClick:o}),(0,Er.jsx)(hj,{icon:b?pp.A:f?.icon,showColors:!0,context:"list-view"}),(0,Er.jsxs)(Cw.A,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1,children:[(0,Er.jsx)("span",{className:"block-editor-list-view-block-select-button__title",children:(0,Er.jsx)(xC.A,{ellipsizeMode:"auto",children:m})}),f?.anchor&&(0,Er.jsx)("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper",children:(0,Er.jsx)(OZ,{className:"block-editor-list-view-block-select-button__anchor",children:f.anchor})}),_&&(0,Er.jsx)("span",{className:"block-editor-list-view-block-select-button__sticky",children:(0,Er.jsx)(xx.A,{icon:AZ.A})}),x.length?(0,Er.jsx)("span",{className:"block-editor-list-view-block-select-button__images","aria-hidden":!0,children:x.map((e,t)=>(0,Er.jsx)("span",{className:"block-editor-list-view-block-select-button__image",style:{backgroundImage:`url(${e.url})`,zIndex:x.length-t}},e.clientId))}):null,!!k&&(0,Er.jsx)(jR.Ay,{text:k,children:(0,Er.jsx)("span",{className:"block-editor-list-view-block-select-button__block-visibility","aria-hidden":"true",children:(0,Er.jsx)(xx.A,{icon:IZ.A})})}),v&&(0,Er.jsx)("span",{className:"block-editor-list-view-block-select-button__lock",children:(0,Er.jsx)(xx.A,{icon:EZ.A})})]})]})}),MZ=({appendToOwnerDocument:e,children:t,clientIds:n,cloneClassname:i,elementId:r,onDragStart:o,onDragEnd:s,fadeWhenDisabled:a=!1,dragComponent:l})=>{const{srcRootClientId:c,isDraggable:u,icon:d,visibleInserter:h,getBlockType:p}=(0,zt.A)(e=>{const{canMoveBlocks:t,getBlockRootClientId:i,getBlockName:r,getBlockAttributes:o,isBlockInsertionPointVisible:s}=e(Qy),{getBlockType:a,getActiveBlockVariation:l}=e(Zi),c=i(n[0]),u=r(n[0]),d=l(u,o(n[0]));return{srcRootClientId:c,isDraggable:t(n),icon:d?.icon||a(u)?.icon,visibleInserter:s(),getBlockType:a}},[n]),f=(0,T.useRef)(!1),[m,g,b]=function(){const e=(0,T.useRef)(null),t=(0,T.useRef)(null),n=(0,T.useRef)(null),i=(0,T.useRef)(null);return(0,T.useEffect)(()=>()=>{i.current&&(clearInterval(i.current),i.current=null)},[]),[(0,T.useCallback)(r=>{e.current=r.clientY,n.current=(0,QP.A)(r.target),i.current=setInterval(()=>{if(n.current&&t.current){const e=n.current.scrollTop+t.current;n.current.scroll({top:e})}},25)},[]),(0,T.useCallback)(i=>{if(!n.current)return;const r=n.current.offsetHeight,o=e.current-n.current.offsetTop,s=i.clientY-n.current.offsetTop;if(i.clientY>o){const e=Math.max(r-o-50,0),n=Math.max(s-o-50,0),i=0===e||0===n?0:n/e;t.current=25*i}else if(i.clientY<o){const e=Math.max(o-50,0),n=Math.max(o-s-50,0),i=0===e||0===n?0:n/e;t.current=-25*i}else t.current=0},[]),()=>{e.current=null,n.current=null,i.current&&(clearInterval(i.current),i.current=null)}]}(),{getAllowedBlocks:y,getBlockNamesByClientId:v,getBlockRootClientId:_}=(0,zt.A)(Qy),{startDraggingBlocks:x,stopDraggingBlocks:k}=(0,Vt.A)(Qy);(0,T.useEffect)(()=>()=>{f.current&&k()},[]);const w=BO(n[0]),C=w?.closest("body");if((0,T.useEffect)(()=>{if(!C||!a)return;const e=(0,uq.n)(e=>{if(!e.target.closest("[data-block]"))return;const t=v(n),i=e.target.closest("[data-block]").getAttribute("data-block"),r=y(i),o=v([i])[0];let s;if(0===r?.length){const e=_(i),n=v([e])[0],r=y(e);s=gq(p,r,t,n)}else s=gq(p,r,t,o);s||h?window?.document?.body?.classList?.remove("block-draggable-invalid-drag-token"):window?.document?.body?.classList?.add("block-draggable-invalid-drag-token")},200);return C.addEventListener("dragover",e),()=>{C.removeEventListener("dragover",e)}},[n,C,a,y,v,_,p,h]),!u)return t({draggable:!1});const S={type:"block",srcClientIds:n,srcRootClientId:c};return(0,Er.jsx)(MK,{appendToOwnerDocument:e,cloneClassname:i,__experimentalTransferDataType:"wp-blocks",transferData:S,onDragStart:e=>{window.requestAnimationFrame(()=>{x(n),f.current=!0,m(e),o&&o()})},onDragOver:g,onDragEnd:()=>{k(),f.current=!1,b(),s&&s()},__experimentalDragComponent:void 0!==l?l:(0,Er.jsx)(DK,{count:n.length,icon:d,fadeWhenDisabled:!0}),elementId:r,children:({onDraggableStart:e,onDraggableEnd:n})=>t({draggable:!0,onDragStart:e,onDragEnd:n})})},PZ=(0,T.forwardRef)(({onClick:e,onToggleExpanded:t,block:n,isSelected:i,position:r,siblingBlockCount:o,level:s,isExpanded:a,selectedClientIds:l,...c},u)=>{const{clientId:d}=n,{AdditionalBlockContent:h,insertedBlock:p,setInsertedBlock:f}=fZ(),m=l.includes(d)?l:[d];return(0,Er.jsxs)(Er.Fragment,{children:[h&&(0,Er.jsx)(h,{block:n,insertedBlock:p,setInsertedBlock:f}),(0,Er.jsx)(MZ,{appendToOwnerDocument:!0,clientIds:m,cloneClassname:"block-editor-list-view-draggable-chip",children:({draggable:l,onDragStart:d,onDragEnd:h})=>(0,Er.jsx)(LZ,{ref:u,className:"block-editor-list-view-block-contents",block:n,onClick:e,onToggleExpanded:t,isSelected:i,position:r,siblingBlockCount:o,level:s,draggable:l,onDragStart:d,onDragEnd:h,isExpanded:a,...c})})]})});function DZ(e,t){if(!t)return;const n=`[role=row][data-block="${e}"]`;return new Promise(e=>{if(t.querySelector(n))return e(t.querySelector(n));let i=null;const r=new window.MutationObserver(()=>{t.querySelector(n)&&(clearTimeout(i),r.disconnect(),e(t.querySelector(n)))});r.observe(t,{childList:!0,subtree:!0}),i=setTimeout(()=>{r.disconnect(),e(null)},3e3)}).then(e=>{e&&e.isConnected&&hS.XC.focusable.find(e)?.[0]?.focus()})}function FZ(e){return{canRename:!!e&&vn(e,"renaming",!0)}}function zZ({clientId:e,onClose:t}){const[n,i]=(0,T.useState)(),r=Ej(e),{metadata:o}=(0,zt.A)(t=>{const{getBlockAttributes:n}=t(Qy);return{metadata:n(e)?.metadata}},[e]),{updateBlockAttributes:s}=(0,Vt.A)(Qy),a=o?.name||"",l=r?.title,c=!!a&&!!o?.bindings&&Object.values(o.bindings).some(e=>"core/pattern-overrides"===e.source),u=void 0!==n&&n!==a,d=n===l,h=(p=n,0===p?.trim()?.length);var p;const f=u||d;return(0,Er.jsx)(aj.A,{title:(0,ee.__)("Rename"),onRequestClose:t,overlayClassName:"block-editor-block-rename-modal",focusOnMount:"firstContentElement",size:"small",children:(0,Er.jsx)("form",{onSubmit:i=>{i.preventDefault(),f&&(()=>{const i=d||h?void 0:n,r=d||h?(0,ee.sprintf)((0,ee.__)('Block name reset to: "%s".'),n):(0,ee.sprintf)((0,ee.__)('Block name changed to: "%s".'),n);(0,dt.L)(r,"assertive"),s([e],{metadata:ov({...o,name:i})}),t()})()},children:(0,Er.jsxs)(Q_.A,{spacing:"3",children:[(0,Er.jsx)(kS.A,{__next40pxDefaultSize:!0,value:n??a,label:(0,ee.__)("Name"),help:c?(0,ee.__)("This block allows overrides. Changing the name can cause problems with content entered into instances of this pattern."):void 0,placeholder:l,onChange:i,onFocus:e=>e.target.select()}),(0,Er.jsxs)(Cw.A,{justify:"right",children:[(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,children:(0,ee.__)("Cancel")}),(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,accessibleWhenDisabled:!0,disabled:!f,variant:"primary",type:"submit",children:(0,ee.__)("Save")})]})]})})})}var VZ="__experimentalBorder",UZ="color",$Z="typography.__experimentalFontFamily",HZ="typography.fontSize",WZ="typography.textAlign",GZ=["shadow","typography.lineHeight",HZ,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",$Z,WZ,"typography.textColumns","typography.__experimentalTextDecoration","typography.__experimentalTextTransform","typography.__experimentalWritingMode","typography.__experimentalLetterSpacing",VZ,UZ,"spacing"],qZ={align:e=>_n(e,"align"),borderColor:e=>function(e,t="any"){if("web"!==Uo.A.OS)return!1;const n=vn(e,VZ);return!0===n||("any"===t?!!(n?.color||n?.radius||n?.width||n?.style):!!n?.[t])}(e,"color"),backgroundColor:e=>{const t=vn(e,UZ);return t&&!1!==t.background},textAlign:e=>_n(e,WZ),textColor:e=>{const t=vn(e,UZ);return t&&!1!==t.text},gradient:e=>{const t=vn(e,UZ);return null!==t&&"object"==typeof t&&!!t.gradients},className:e=>_n(e,"customClassName",!0),fontFamily:e=>_n(e,$Z),fontSize:e=>_n(e,HZ),layout:e=>_n(e,"layout"),style:e=>GZ.some(t=>_n(e,t))};function KZ(e,t){return Object.entries(qZ).reduce((n,[i,r])=>(r(e.name)&&r(t.name)&&(n[i]=e.attributes[i]),n),{})}function YZ(e,t,n){for(let i=0;i<Math.min(t.length,e.length);i+=1)n(e[i].clientId,KZ(t[i],e[i])),YZ(e[i].innerBlocks,t[i].innerBlocks,n)}function JZ(){const e=(0,yt.A)(),{updateBlockAttributes:t}=(0,Vt.A)(Qy),{createSuccessNotice:n,createWarningNotice:i,createErrorNotice:r}=(0,Vt.A)(Rb.store);return(0,T.useCallback)(async o=>{let s="";try{if(!window.navigator.clipboard)return void r((0,ee.__)("Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers."),{type:"snackbar"});s=await window.navigator.clipboard.readText()}catch{return void r((0,ee.__)("Unable to paste styles. Please allow browser clipboard permissions before continuing."),{type:"snackbar"})}if(!s||!function(e){try{const t=Vo(e,{__unstableSkipMigrationLogs:!0,__unstableSkipAutop:!0});return 1!==t.length||"core/freeform"!==t[0].name}catch{return!1}}(s))return void i((0,ee.__)("Unable to paste styles. Block styles couldn't be found within the copied content."),{type:"snackbar"});const a=Vo(s);if(1===a.length?e.batch(()=>{YZ(o,o.map(()=>a[0]),t)}):e.batch(()=>{YZ(o,a,t)}),1===o.length){const e=bn(o[0].name)?.title;n((0,ee.sprintf)((0,ee.__)("Pasted styles to %s."),e),{type:"snackbar"})}else n((0,ee.sprintf)((0,ee.__)("Pasted styles to %d blocks."),o.length),{type:"snackbar"})},[e.batch,t,n,i,r])}var XZ=(0,T.memo)(function e({block:{clientId:t},displacement:n,isAfterDraggedBlocks:i,isDragged:r,isNesting:o,isSelected:s,isBranchSelected:a,selectBlock:l,position:c,level:u,rowCount:d,siblingBlockCount:h,showBlockMovers:p,path:f,isExpanded:m,selectedClientIds:g,isSyncedBranch:b}){const y=(0,T.useRef)(null),v=(0,T.useRef)(null),_=(0,T.useRef)(null),[x,k]=(0,T.useState)(!1),[w,C]=(0,T.useState)(),[S,A]=(0,T.useState)(!1),{isLocked:I}=TZ(t),E=s&&g[0]===t,j=s&&g[g.length-1]===t,{toggleBlockHighlight:B,duplicateBlocks:N,multiSelect:R,replaceBlocks:O,removeBlocks:L,insertAfterBlock:M,insertBeforeBlock:P,showViewportModal:D}=Gh((0,Vt.A)(Qy)),F=(0,uj.A)(B,50),{canInsertBlockType:z,getSelectedBlockClientIds:U,getPreviousBlockClientId:$,getBlockRootClientId:H,getBlockOrder:W,getBlockParents:G,getBlockEditingMode:q,getBlocksByClientId:K,canEditBlock:Y,canMoveBlock:J,canRemoveBlocks:X,isGroupable:Z}=(0,zt.A)(Qy),{getGroupingBlockName:Q}=(0,zt.A)(Zi),te=Ej(t),ne=JZ(),{block:ie,blockName:re,allowRightClickOverrides:oe}=(0,zt.A)(e=>{const{getBlock:n,getBlockName:i,getSettings:r}=Gh(e(Qy));return{block:n(t),blockName:i(t),allowRightClickOverrides:r().allowRightClickOverrides}},[t]),{canRename:se}=FZ(re),ae=_n(re,"__experimentalToolbar",!0),le=`list-view-block-select-button__description-${(0,SS.A)(e)}`,{expand:ce,collapse:ue,collapseAll:de,BlockSettingsMenu:he,listViewInstanceId:pe,expandedState:fe,setInsertedBlock:me,treeGridElementRef:ge,rootClientId:be}=fZ(),ye=(0,$T.ZK)();function ve(){const e=U(),n=e.includes(t),i=n?e[0]:t,r=H(i);return{blocksToUpdate:n?e:[t],firstBlockClientId:i,firstBlockRootClientId:r,selectedBlockClientIds:e}}const _e=(0,T.useCallback)(()=>{k(!0),F(t,!0)},[t,k,F]),xe=(0,T.useCallback)(()=>{k(!1),F(t,!1)},[t,k,F]),ke=(0,T.useCallback)(e=>{l(e,t),e.preventDefault()},[t,l]),we=(0,T.useCallback)((e,t)=>{t&&l(void 0,e,null,null),DZ(e,ge?.current)},[l,ge]),Ce=(0,T.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),!0===m?ue(t):!1===m&&ce(t)},[t,ce,ue,m]),Se=(0,T.useCallback)(e=>{const{ownerDocument:t}=_?.current||{};t&&t.hasFocus()&&ae&&oe&&(_.current?.click(),C(new window.DOMRect(e.clientX,e.clientY,0,0)),e.preventDefault())},[oe,_,ae]),Ae=(0,T.useCallback)(e=>{oe&&2===e.button&&e.preventDefault()},[oe]),Ie=(0,T.useMemo)(()=>{const{ownerDocument:e}=v?.current||{};if(w&&e)return{ownerDocument:e,getBoundingClientRect:()=>w}},[w]),Ee=(0,T.useCallback)(()=>{C(void 0)},[C]);if(function({isSelected:e,selectedClientIds:t,rowItemRef:n}){const i=1===t.length;(0,T.useLayoutEffect)(()=>{if(!e||!i||!n.current)return;const t=(0,QP.A)(n.current),{ownerDocument:r}=n.current;if(t===r.body||t===r.documentElement||!t)return;const o=n.current.getBoundingClientRect(),s=t.getBoundingClientRect();(o.top<s.top||o.bottom>s.bottom)&&n.current.scrollIntoView()},[e,i,n])}({isSelected:s,rowItemRef:v,selectedClientIds:g}),!ie)return null;const je=((e,t,n)=>(0,ee.sprintf)((0,ee.__)("Block %1$d of %2$d, Level %3$d."),e,t,n))(c,h,u),Te=((e,t)=>[e?.positionLabel?`${(0,ee.sprintf)((0,ee.__)("Position: %s"),e.positionLabel)}.`:void 0,t?(0,ee.__)("This block is locked."):void 0].filter(Boolean).join(" "))(te,I),Be=RZ(ie?.attributes?.metadata?.blockVisibility),Ne=p&&h>0,Re=(0,mh.A)("block-editor-list-view-block__mover-cell",{"is-visible":x||s}),Oe=(0,mh.A)("block-editor-list-view-block__menu-cell",{"is-visible":x||E});let Le;Ne?Le=2:ae||(Le=3);const Me=(0,mh.A)({"is-selected":s,"is-first-selected":E,"is-last-selected":j,"is-branch-selected":a,"is-synced-branch":b,"is-dragging":r,"has-single-cell":!ae,"is-synced":te?.isSynced,"is-draggable":J,"is-displacement-normal":"normal"===n,"is-displacement-up":"up"===n,"is-displacement-down":"down"===n,"is-after-dragged-blocks":i,"is-nesting":o}),Pe=g.includes(t)?g:[t],De=s&&1===g.length;return(0,Er.jsxs)(yZ,{className:Me,isDragged:r,onKeyDown:async function(e){if(e.defaultPrevented)return;if(e.target.closest("[role=dialog]"))return;const t=[Rt.G_,Rt.SJ].includes(e.keyCode);if(ye("core/block-editor/unselect",e)&&g.length>0)e.stopPropagation(),e.preventDefault(),l(e,void 0);else if(t||ye("core/block-editor/remove",e)){const{blocksToUpdate:e,firstBlockClientId:t,firstBlockRootClientId:n,selectedBlockClientIds:i}=ve();if(!X(e))return;let r=$(t)??n;L(e,!1);const o=i.length>0&&0===U().length;r||(r=W()[0]),we(r,o)}else if(ye("core/block-editor/paste-styles",e)){e.preventDefault();const{blocksToUpdate:t}=ve(),n=K(t);ne(n)}else if(ye("core/block-editor/duplicate",e)){e.preventDefault();const{blocksToUpdate:t,firstBlockRootClientId:n}=ve();if(K(t).every(e=>!!e&&_n(e.name,"multiple",!0)&&z(e.name,n))){const e=await N(t,!1);e?.length&&we(e[0],!1)}}else if(ye("core/block-editor/insert-before",e)){e.preventDefault();const{blocksToUpdate:t}=ve();await P(t[0]);const n=U();we(n[0],!1)}else if(ye("core/block-editor/insert-after",e)){e.preventDefault();const{blocksToUpdate:t}=ve();await M(t.at(-1));const n=U();we(n[0],!1)}else if(ye("core/block-editor/select-all",e)){e.preventDefault();const{firstBlockRootClientId:t,selectedBlockClientIds:n}=ve(),i=W(t);if(!i.length)return;if((0,V.hw)(n,i)&&t&&t!==be)return void we(t,!0);R(i[0],i[i.length-1],null)}else if(ye("core/block-editor/collapse-list-view",e)){e.preventDefault();const{firstBlockClientId:t}=ve(),n=G(t,!1);de(),ce(n)}else if(ye("core/block-editor/group",e)){const{blocksToUpdate:t}=ve();if(t.length>1&&Z(t)){e.preventDefault();const n=ur(K(t),Q());O(t,n),(0,dt.L)((0,ee.__)("Selected blocks are grouped."));const i=U();we(i[0],!1)}}else if(ye("core/block-editor/toggle-block-visibility",e)){e.preventDefault();const{blocksToUpdate:t}=ve();if(!K(t).every(e=>_n(e.name,"visibility",!0)))return;if(t.some(e=>"default"!==q(e)))return;D(t)}else if(ye("core/block-editor/rename",e)){const{blocksToUpdate:t}=ve(),n="contentOnly"===q(t[0]);1===t.length&&se&&!n&&(e.preventDefault(),A(!0))}},onMouseEnter:_e,onMouseLeave:xe,onFocus:_e,onBlur:xe,level:u,position:c,rowCount:d,path:f,id:`list-view-${pe}-block-${t}`,"data-block":t,"data-expanded":Y?m:void 0,ref:v,children:[(0,Er.jsx)(hZ,{className:"block-editor-list-view-block__contents-cell",colSpan:Le,ref:y,"aria-selected":!!s,children:({ref:e,tabIndex:t,onFocus:n})=>(0,Er.jsxs)("div",{className:"block-editor-list-view-block__contents-container",children:[(0,Er.jsx)(PZ,{block:ie,onClick:ke,onContextMenu:Se,onMouseDown:Ae,onToggleExpanded:Ce,isSelected:s,position:c,siblingBlockCount:h,level:u,ref:e,tabIndex:De?0:t,onFocus:n,isExpanded:Y?m:void 0,selectedClientIds:g,ariaDescribedBy:le}),(0,Er.jsx)(mZ,{id:le,children:[je,Te,Be].filter(Boolean).join(" ")})]})}),Ne&&(0,Er.jsx)(Er.Fragment,{children:(0,Er.jsxs)(hZ,{className:Re,withoutGridItem:!0,children:[(0,Er.jsx)(uZ,{children:({ref:e,tabIndex:n,onFocus:i})=>(0,Er.jsx)(CZ,{orientation:"vertical",clientIds:[t],ref:e,tabIndex:n,onFocus:i})}),(0,Er.jsx)(uZ,{children:({ref:e,tabIndex:n,onFocus:i})=>(0,Er.jsx)(SZ,{orientation:"vertical",clientIds:[t],ref:e,tabIndex:n,onFocus:i})})]})}),ae&&he&&(0,Er.jsx)(hZ,{className:Oe,"aria-selected":!!s,ref:_,children:({ref:e,tabIndex:t,onFocus:n})=>(0,Er.jsx)(he,{clientIds:Pe,block:ie,icon:ww.A,label:(0,ee.__)("Options"),popoverProps:{anchor:Ie},toggleProps:{ref:e,className:"block-editor-list-view-block__menu",tabIndex:t,onClick:Ee,onFocus:n,size:"small"},disableOpenOnArrowDown:!0,expand:ce,expandedState:fe,setInsertedBlock:me,__experimentalSelectBlock:we,isContentOnlyListView:!!be&&"contentOnly"===q(be)})}),S&&(0,Er.jsx)(zZ,{clientId:t,onClose:()=>A(!1)})]})});function ZZ(e,t,n,i){const r=n?.includes(e.clientId);return r?0:t[e.clientId]??i?1+e.innerBlocks.reduce(QZ(t,n,i),0):1}var QZ=(e,t,n)=>(i,r)=>{const o=t?.includes(r.clientId);return o?i:(e[r.clientId]??n)&&r.innerBlocks.length>0?i+ZZ(r,e,t,n):i+1},eQ=()=>{},tQ=(0,T.memo)(function e(t){const{blocks:n,selectBlock:i=eQ,showBlockMovers:r,selectedClientIds:o,level:s=1,path:a="",isBranchSelected:l=!1,listPosition:c=0,fixedListWindow:u,isExpanded:d,parentId:h,shouldShowInnerBlocks:p=!0,isSyncedBranch:f=!1,showAppender:m=!0}=t,g=Ej(h),b=f||!!g?.isSynced,y=(0,zt.A)(e=>!h||e(Qy).canEditBlock(h),[h]),{blockDropPosition:v,blockDropTargetIndex:_,firstDraggedBlockIndex:x,blockIndexes:k,expandedState:w,draggedClientIds:C}=fZ(),S=(0,T.useRef)();if(!y)return null;const A=m&&1===s,I=n.filter(Boolean),E=I.length,j=A?E+1:E;return S.current=c,(0,Er.jsxs)(Er.Fragment,{children:[I.map((t,n)=>{const{clientId:c,innerBlocks:h}=t;n>0&&(S.current+=ZZ(I[n-1],w,C,d));const f=!!C?.includes(c),{displacement:m,isAfterDraggedBlocks:g,isNesting:y}=function({blockIndexes:e,blockDropTargetIndex:t,blockDropPosition:n,clientId:i,firstDraggedBlockIndex:r,isDragged:o}){let s,a,l;if(!o){a=!1;const o=e[i];l=o>r,null!=t&&void 0!==r?void 0!==o&&(s=o>=r&&o<t?"up":o<r&&o>=t?"down":"normal",a="number"==typeof t&&t-1===o&&"inside"===n):null===t&&void 0!==r?s=void 0!==o&&o>=r?"up":"normal":null!=t&&void 0===r?void 0!==o&&(s=o<t?"normal":"down"):null===t&&(s="normal")}return{displacement:s,isNesting:a,isAfterDraggedBlocks:l}}({blockIndexes:k,blockDropTargetIndex:_,blockDropPosition:v,clientId:c,firstDraggedBlockIndex:x,isDragged:f}),{itemInView:A}=u,T=A(S.current),B=n+1,N=a.length>0?`${a}_${B}`:`${B}`,R=!!h?.length,O=R&&p?w[c]??d:void 0,L=((e,t)=>Array.isArray(t)&&t.length?-1!==t.indexOf(e):t===e)(c,o),M=l||L&&R,P=f||T||L&&c===o[0]||0===n||n===E-1;return(0,Er.jsxs)(BU.Ay,{value:!L,children:[P&&(0,Er.jsx)(XZ,{block:t,selectBlock:i,isSelected:L,isBranchSelected:M,isDragged:f,level:s,position:B,rowCount:j,siblingBlockCount:E,showBlockMovers:r,path:N,isExpanded:!f&&O,listPosition:S.current,selectedClientIds:o,isSyncedBranch:b,displacement:m,isAfterDraggedBlocks:g,isNesting:y}),!P&&(0,Er.jsx)("tr",{children:(0,Er.jsx)("td",{className:"block-editor-list-view-placeholder"})}),R&&O&&!f&&(0,Er.jsx)(e,{parentId:c,blocks:h,selectBlock:i,showBlockMovers:r,level:s+1,path:N,listPosition:S.current+1,fixedListWindow:u,isBranchSelected:M,selectedClientIds:o,isExpanded:d,isSyncedBranch:b})]},c)}),A&&(0,Er.jsx)(sZ,{level:s,setSize:j,positionInSet:j,isExpanded:!0,children:(0,Er.jsx)(hZ,{children:e=>(0,Er.jsx)(gZ,{clientId:h,nestingLevel:s,blockCount:E,...e})})})]})});function nQ({draggedBlockClientId:e,listViewRef:t,blockDropTarget:n}){const i=Ej(e),r=Aj({clientId:e,context:"list-view"}),{rootClientId:o,clientId:s,dropPosition:a}=n||{},[l,c]=(0,T.useMemo)(()=>t.current?[o?t.current.querySelector(`[data-block="${o}"]`):void 0,s?t.current.querySelector(`[data-block="${s}"]`):void 0]:[],[t,o,s]),u=c||l,d=(0,ee.isRTL)(),h=(0,T.useCallback)((e,t)=>{if(!u)return 0;let n=u.offsetWidth;const i=(0,QP.A)(u,"horizontal"),r=u.ownerDocument,o=i===r.body||i===r.documentElement;if(i&&!o){const r=i.getBoundingClientRect(),o=(0,ee.isRTL)()?r.right-e.right:e.left-r.left,s=i.clientWidth;if(s<n+o&&(n=s-o),!d&&e.left+t<r.left)return n-=r.left-e.left,n;if(d&&e.right-t>r.right)return n-=e.right-r.right,n}return n-t},[d,u]),p=(0,T.useMemo)(()=>{if(!u)return{};const e=u.getBoundingClientRect();return{width:h(e,0)}},[h,u]),f=(0,T.useMemo)(()=>{if(!u)return{};const e=(0,QP.A)(u),t=u.ownerDocument,n=e===t.body||e===t.documentElement;if(e&&!n){const t=e.getBoundingClientRect(),n=u.getBoundingClientRect(),i=d?t.right-n.right:n.left-t.left;if(!d&&t.left>n.left)return{transform:`translateX( ${i}px )`};if(d&&t.right<n.right)return{transform:`translateX( ${-1*i}px )`}}return{}},[d,u]),m=(0,T.useMemo)(()=>{if(!l)return 1;const e=parseInt(l.getAttribute("aria-level"),10);return e?e+1:1},[l]),g=(0,T.useMemo)(()=>!!u&&u.classList.contains("is-branch-selected"),[u]),b=(0,T.useMemo)(()=>{if(u&&("top"===a||"bottom"===a||"inside"===a))return{contextElement:u,getBoundingClientRect(){const e=u.getBoundingClientRect();let t=e.left,n=0;const i=(0,QP.A)(u,"horizontal"),r=u.ownerDocument,o=i===r.body||i===r.documentElement;if(i&&!o){const e=i.getBoundingClientRect(),n=d?i.offsetWidth-i.clientWidth:0;t<e.left+n&&(t=e.left+n)}n="top"===a?e.top-2*e.height:e.top;const s=h(e,0),l=e.height;return new window.DOMRect(t,n,s,l)}}},[u,a,h,d]);return u?(0,Er.jsx)(uw.Ay,{animate:!1,anchor:b,focusOnMount:!1,className:"block-editor-list-view-drop-indicator--preview",variant:"unstyled",flip:!1,resize:!0,children:(0,Er.jsx)("div",{style:p,className:(0,mh.A)("block-editor-list-view-drop-indicator__line",{"block-editor-list-view-drop-indicator__line--darker":g}),children:(0,Er.jsxs)("div",{className:"block-editor-list-view-leaf","aria-level":m,children:[(0,Er.jsxs)("div",{className:(0,mh.A)("block-editor-list-view-block-select-button","block-editor-list-view-block-contents"),style:f,children:[(0,Er.jsx)(jZ,{onClick:()=>{}}),(0,Er.jsx)(hj,{icon:i?.icon,showColors:!0,context:"list-view"}),(0,Er.jsx)(Cw.A,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1,children:(0,Er.jsx)("span",{className:"block-editor-list-view-block-select-button__title",children:(0,Er.jsx)(xC.A,{ellipsizeMode:"auto",children:r})})})]}),(0,Er.jsx)("div",{className:"block-editor-list-view-block__menu-cell"})]})})}):null}var iQ=24;function rQ(e,t){const n=e[t+1];return n&&n.isDraggedBlock?rQ(e,t+1):n}var oQ=["top","bottom"];function sQ(e,t,n=!1){let i,r,o,s,a;for(let n=0;n<e.length;n++){const l=e[n];if(l.isDraggedBlock)continue;const c=l.element.getBoundingClientRect(),[u,d]=fq(t,c,oQ),h=mq(t,c);if(void 0===o||u<o||h){o=u;const t=e.indexOf(l),n=e[t-1];if("top"===d&&n&&n.rootClientId===l.rootClientId&&!n.isDraggedBlock?(r=n,i="bottom",s=n.element.getBoundingClientRect(),a=t-1):(r=l,i=d,s=c,a=t),h)break}}if(!r)return;const l=function(e,t){const n=[];let i=e;for(;i;)n.push({...i}),i=t.find(e=>e.clientId===i.rootClientId);return n}(r,e),c="bottom"===i;if(c&&r.canInsertDraggedBlocksAsChild&&(r.innerBlockCount>0&&r.isExpanded||function(e,t,n=1,i=!1){const r=i?t.right-n*iQ:t.left+n*iQ;return(i?e.x<r-iQ:e.x>r+iQ)&&e.y<t.bottom}(t,s,l.length,n))){const e=r.isExpanded?0:r.innerBlockCount||0;return{rootClientId:r.clientId,clientId:r.clientId,blockIndex:e,dropPosition:"inside"}}if(c&&r.rootClientId&&function(e,t,n=1,i=!1){const r=i?t.right-n*iQ:t.left+n*iQ;return i?e.x>r:e.x<r}(t,s,l.length,n)){const o=rQ(e,a),c=r.nestingLevel,u=o?o.nestingLevel:1;if(c&&u){const d=function(e,t,n=1,i=!1){const r=i?t.right-n*iQ:t.left+n*iQ,o=i?r-e.x:e.x-r,s=Math.round(o/iQ);return Math.abs(s)}(t,s,l.length,n),h=Math.max(Math.min(d,c-u),0);if(l[h]){let t=r.blockIndex;if(l[h].nestingLevel===o?.nestingLevel)t=o?.blockIndex;else for(let n=a;n>=0;n--){const i=e[n];if(i.rootClientId===l[h].rootClientId){t=i.blockIndex+1;break}}return{rootClientId:l[h].rootClientId,clientId:r.clientId,blockIndex:t,dropPosition:i}}}}if(!r.canInsertDraggedBlocksAsSibling)return;const u=c?1:0;return{rootClientId:r.rootClientId,clientId:r.clientId,blockIndex:r.blockIndex+u,dropPosition:i}}var aQ={leading:!1,trailing:!0};function lQ({clientIds:e,children:t,__experimentalUpdateSelection:n}){const{getDefaultBlockName:i,getGroupingBlockName:r}=(0,zt.A)(Zi),o=(0,zt.A)(t=>{const{canInsertBlockType:n,getBlockRootClientId:r,getBlocksByClientId:o,getDirectInsertBlock:s,canRemoveBlocks:a}=t(Qy),l=o(e),c=r(e[0]),u=n(i(),c),d=c?s(c):null;return{canRemove:a(e),canInsertBlock:l.every(e=>(u||!!d)&&n(e.name,c)),canCopyStyles:l.every(e=>!!e&&(_n(e.name,"color")||_n(e.name,"typography"))),canDuplicate:l.every(e=>!!e&&_n(e.name,"multiple",!0)&&n(e.name,c))}},[e,i]),{getBlocksByClientId:s,getBlocks:a}=(0,zt.A)(Qy),{canRemove:l,canInsertBlock:c,canCopyStyles:u,canDuplicate:d}=o,{removeBlocks:h,replaceBlocks:p,duplicateBlocks:f,insertAfterBlock:m,insertBeforeBlock:g,flashBlock:b}=(0,Vt.A)(Qy),y=JZ();return t({canCopyStyles:u,canDuplicate:d,canInsertBlock:c,canRemove:l,onDuplicate:()=>f(e,n),onRemove:()=>h(e,n),onInsertBefore(){g(e[0])},onInsertAfter(){m(e[e.length-1])},onGroup(){if(!e.length)return;const t=r(),n=ur(s(e),t);n&&p(e,n)},onUngroup(){if(!e.length)return;const t=a(e[0]);t.length&&p(e,t)},onCopy(){1===e.length&&b(e[0])},async onPasteStyles(){await y(s(e))}})}var cQ=(0,Sv.QJ)(Symbol("CommentIconSlotFill")),uQ=function({clientId:e}){const t=(0,zt.A)(t=>t(Qy).getBlock(e),[e]),{replaceBlocks:n}=(0,Vt.A)(Qy);return t&&"core/html"===t.name?(0,Er.jsx)(zv.A,{onClick:()=>n(e,ks({HTML:Mr(t)})),children:(0,ee.__)("Convert to Blocks")}):null},{Fill:dQ,Slot:hQ}=(0,Sv.QJ)("__unstableBlockSettingsMenuFirstItem");dQ.Slot=hQ;var pQ=dQ;function fQ(e){return(0,zt.A)(t=>{const{getBlocksByClientId:n,getSelectedBlockClientIds:i,isUngroupable:r,isGroupable:o}=t(Qy),{getGroupingBlockName:s,getBlockType:a}=t(Zi),l=e?.length?e:i(),c=n(l),[u]=c,d=1===l.length&&r(l[0]);return{clientIds:l,isGroupable:o(l),isUngroupable:d,blocksSelection:c,groupingBlockName:s(),onUngroup:d&&a(u.name)?.transforms?.ungroup}},[e])}function mQ({clientIds:e,isGroupable:t,isUngroupable:n,onUngroup:i,blocksSelection:r,groupingBlockName:o,onClose:s=()=>{}}){const{getSelectedBlockClientIds:a}=(0,zt.A)(Qy),{replaceBlocks:l}=(0,Vt.A)(Qy);if(!t&&!n)return null;const c=a();return(0,Er.jsxs)(Er.Fragment,{children:[t&&(0,Er.jsx)(zv.A,{shortcut:c.length>1?Rt.dz.primary("g"):void 0,onClick:()=>{(()=>{const t=ur(r,o);t&&l(e,t)})(),s()},children:(0,ee._x)("Group","verb")}),n&&(0,Er.jsx)(zv.A,{onClick:()=>{(()=>{let t=r[0].innerBlocks;t.length&&(i&&(t=i(r[0].attributes,r[0].innerBlocks)),l(e,t))})(),s()},children:(0,ee._x)("Ungroup","Ungrouping blocks from within a grouping block back into individual blocks within the Editor")})]})}var gQ=n(79657),bQ=n(39417),yQ=n(44920),vQ=["core/navigation"];function _Q(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function xQ({clientId:e,onClose:t}){const[n,i]=(0,T.useState)({move:!1,remove:!1}),{isEditLocked:r,isMoveLocked:o,isRemoveLocked:s}=TZ(e),{allowsEditLocking:a,templateLock:l,hasTemplateLock:c}=(0,zt.A)(t=>{const{getBlockName:n,getBlockAttributes:i}=t(Qy),r=n(e),o=bn(r);return{allowsEditLocking:vQ.includes(r),templateLock:i(e)?.templateLock,hasTemplateLock:!!o?.attributes?.templateLock}},[e]),[u,d]=(0,T.useState)(!!l),{updateBlockAttributes:h}=(0,Vt.A)(Qy),p=Ej(e);(0,T.useEffect)(()=>{i({move:o,remove:s,...a?{edit:r}:{}})},[r,o,s,a]);const f=Object.values(n).every(Boolean),m=Object.values(n).some(Boolean)&&!f,g=n.move!==o||n.remove!==s||a&&n.edit!==r||c&&u!==!!l;return(0,Er.jsx)(aj.A,{title:(0,ee.sprintf)((0,ee.__)("Lock %s"),p.title),overlayClassName:"block-editor-block-lock-modal",onRequestClose:t,size:"small",children:(0,Er.jsxs)("form",{onSubmit:i=>{i.preventDefault(),g&&(h([e],{lock:n,templateLock:u?_Q(n):void 0}),t())},children:[(0,Er.jsxs)("fieldset",{className:"block-editor-block-lock-modal__options",children:[(0,Er.jsx)("legend",{children:(0,ee.__)("Select the features you want to lock")}),(0,Er.jsx)("ul",{role:"list",className:"block-editor-block-lock-modal__checklist",children:(0,Er.jsxs)("li",{children:[(0,Er.jsx)(WA.A,{className:"block-editor-block-lock-modal__options-all",label:(0,ee.__)("Lock all"),checked:f,indeterminate:m,onChange:e=>i({move:e,remove:e,...a?{edit:e}:{}})}),(0,Er.jsxs)("ul",{role:"list",className:"block-editor-block-lock-modal__checklist",children:[a&&(0,Er.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,Er.jsx)(WA.A,{label:(0,ee.__)("Lock editing"),checked:!!n.edit,onChange:e=>i(t=>({...t,edit:e}))}),(0,Er.jsx)(IC.A,{className:"block-editor-block-lock-modal__lock-icon",icon:n.edit?yQ.A:gQ.A})]}),(0,Er.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,Er.jsx)(WA.A,{label:(0,ee.__)("Lock movement"),checked:n.move,onChange:e=>i(t=>({...t,move:e}))}),(0,Er.jsx)(IC.A,{className:"block-editor-block-lock-modal__lock-icon",icon:n.move?yQ.A:gQ.A})]}),(0,Er.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,Er.jsx)(WA.A,{label:(0,ee.__)("Lock removal"),checked:n.remove,onChange:e=>i(t=>({...t,remove:e}))}),(0,Er.jsx)(IC.A,{className:"block-editor-block-lock-modal__lock-icon",icon:n.remove?yQ.A:gQ.A})]})]})]})}),c&&(0,Er.jsx)(Zv.A,{className:"block-editor-block-lock-modal__template-lock",label:(0,ee.__)("Apply to all blocks inside"),checked:u,disabled:n.move&&!n.remove,onChange:()=>d(!u)})]}),(0,Er.jsxs)(Kv.A,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1,children:[(0,Er.jsx)(Yv.A,{children:(0,Er.jsx)(fv.Ay,{variant:"tertiary",onClick:t,__next40pxDefaultSize:!0,children:(0,ee.__)("Cancel")})}),(0,Er.jsx)(Yv.A,{children:(0,Er.jsx)(fv.Ay,{variant:"primary",type:"submit",disabled:!g,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,ee.__)("Apply")})})]})]})})}function kQ({clientId:e}){const{canLock:t,isLocked:n}=TZ(e),[i,r]=(0,T.useReducer)(e=>!e,!1);if(!t)return null;const o=n?(0,ee.__)("Unlock"):(0,ee.__)("Lock");return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(zv.A,{icon:n?gQ.A:bQ.A,onClick:r,"aria-expanded":i,"aria-haspopup":"dialog",children:o}),i&&(0,Er.jsx)(xQ,{clientId:e,onClose:r})]})}var wQ=()=>{};function CQ({clientId:e,onToggle:t=wQ}){const{blockType:n,mode:i,enabled:r}=(0,zt.A)(t=>{const{getBlock:n,getBlockMode:i,getSettings:r}=t(Qy),o=n(e);return{mode:i(e),blockType:o?bn(o.name):null,enabled:r().codeEditingEnabled&&!!o?.isValid}},[e]),{toggleBlockMode:o}=(0,Vt.A)(Qy);if(!n||!_n(n,"html",!0)||!r)return null;const s="visual"===i?(0,ee.__)("Edit as HTML"):(0,ee.__)("Edit visually");return(0,Er.jsx)(zv.A,{onClick:()=>{o(e),t()},children:s})}function SQ({clientId:e}){const[t,n]=(0,T.useState)(!1),i=(0,zt.A)(e=>e($T.M_).getShortcutRepresentation("core/block-editor/rename"),[]);return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(zv.A,{onClick:()=>{n(!0)},"aria-expanded":t,"aria-haspopup":"dialog",shortcut:i,children:(0,ee.__)("Rename")}),t&&(0,Er.jsx)(zZ,{clientId:e,onClose:()=>n(!1)})]})}function AQ({clientIds:e}){const{areBlocksHiddenAnywhere:t,shortcut:n}=(0,zt.A)(t=>{const{isBlockHiddenAnywhere:n}=Gh(t(Qy));return{areBlocksHiddenAnywhere:e?.every(e=>n(e)),shortcut:t($T.M_).getShortcutRepresentation("core/block-editor/toggle-block-visibility")}},[e]),{showViewportModal:i}=Gh((0,Vt.A)(Qy));return(0,Er.jsx)(zv.A,{onClick:()=>i(e),shortcut:n,children:t?(0,ee.__)("Show"):(0,ee.__)("Hide")})}var{Fill:IQ,Slot:EQ}=(0,Sv.QJ)("BlockSettingsMenuControls");function jQ({...e}){return(0,Er.jsx)(Cv.A,{document,children:(0,Er.jsx)(IQ,{...e})})}jQ.Slot=({fillProps:e,clientIds:t=null})=>{const{selectedBlocks:n,selectedClientIds:i,isContentOnly:r,canToggleSelectedBlocksVisibility:o,canEdit:s}=(0,zt.A)(e=>{const{getBlocksByClientId:n,getBlockNamesByClientId:i,getSelectedBlockClientIds:r,getBlockEditingMode:o,canEditBlock:s}=e(Qy),a=null!==t?t:r();return{selectedBlocks:i(a),selectedClientIds:a,isContentOnly:"contentOnly"===o(a[0]),canToggleSelectedBlocksVisibility:n(a).every(e=>_n(e.name,"visibility",!0)),canEdit:s(a[0])}},[t]),{canLock:a}=TZ(i[0]),{canRename:l}=FZ(n[0]),c=1===i.length&&a&&!r,u=1===i.length&&l&&!r,d=o&&!r,h=fQ(i),{isGroupable:p,isUngroupable:f}=h,m=(p||f)&&!r;return(0,Er.jsx)(EQ,{fillProps:{...e,canEdit:s,selectedBlocks:n,selectedClientIds:i},children:t=>!t?.length>0&&!m&&!c?null:(0,Er.jsxs)(Fv.A,{children:[m&&(0,Er.jsx)(mQ,{...h,onClose:e?.onClose}),s&&c&&(0,Er.jsx)(kQ,{clientId:i[0]}),s&&u&&(0,Er.jsx)(SQ,{clientId:i[0]}),s&&d&&(0,Er.jsx)(AQ,{clientIds:i}),t,s&&1===e?.count&&!r&&(0,Er.jsx)(CQ,{clientId:e?.firstBlockClientId,onToggle:e?.onClose})]})})};var TQ=jQ,{clearTimeout:BQ,setTimeout:NQ}=window;function RQ({ref:e,isFocused:t,highlightParent:n,debounceTimeout:i=200}){const{getSelectedBlockClientId:r,getBlockRootClientId:o}=(0,zt.A)(Qy),{toggleBlockHighlight:s}=(0,Vt.A)(Qy),a=(0,T.useRef)(),l=(0,zt.A)(e=>e(Qy).getSettings().isDistractionFree,[]),c=e=>{if(e&&l)return;const t=r(),i=n?o(t):t;s(i,e)},u=()=>{const e=a.current;e&&BQ&&BQ(e)};return(0,T.useEffect)(()=>()=>{c(!1),u()},[]),{debouncedShowGestures:e=>{e&&e.stopPropagation(),u(),c(!0)},debouncedHideGestures:n=>{n&&n.stopPropagation(),u(),a.current=NQ(()=>{(()=>{const n=e?.current&&e.current.matches(":hover");return!t&&!n})()&&c(!1)},i)}}}function OQ({ref:e,highlightParent:t=!1,debounceTimeout:n=200}){const[i,r]=(0,T.useState)(!1),{debouncedShowGestures:o,debouncedHideGestures:s}=RQ({ref:e,debounceTimeout:n,isFocused:i,highlightParent:t}),a=(0,T.useRef)(!1),l=()=>e?.current&&e.current.contains(e.current.ownerDocument.activeElement);return(0,T.useEffect)(()=>{const t=e.current,n=()=>{l()&&(r(!0),o())},i=()=>{l()||(r(!1),s())};return t&&!a.current&&(t.addEventListener("focus",n,!0),t.addEventListener("blur",i,!0),a.current=!0),()=>{t&&(t.removeEventListener("focus",n),t.removeEventListener("blur",i))}},[e,a,r,o,s]),{onMouseMove:o,onMouseLeave:s}}function LQ({parentClientId:e,parentBlockType:t}){const n=(0,dw.A)("medium","<"),{selectBlock:i}=(0,Vt.A)(Qy),r=(0,T.useRef)(),o=OQ({ref:r,highlightParent:!0});return n?(0,Er.jsx)(zv.A,{...o,ref:r,icon:(0,Er.jsx)(hj,{icon:t.icon}),onClick:()=>i(e),children:(0,ee.sprintf)((0,ee.__)("Select parent block (%s)"),t.title)}):null}var MQ={className:"block-editor-block-settings-menu__popover",placement:"bottom-start"};function PQ({clientIds:e,onCopy:t,label:n,shortcut:i,eventType:r="copy",__experimentalUpdateSelection:o=!1}){const{getBlocksByClientId:s}=(0,zt.A)(Qy),{removeBlocks:a}=(0,Vt.A)(Qy),l=sK(),c=(0,LA.Ay)(()=>Fr(s(e)),()=>{switch(r){case"copy":case"copyStyles":t(),l(r,e);break;case"cut":l(r,e),a(e,o)}}),u=n||(0,ee.__)("Copy");return(0,Er.jsx)(zv.A,{ref:c,shortcut:i,children:u})}function DQ({block:e,clientIds:t,children:n,__experimentalSelectBlock:i,isContentOnlyListView:r,...o}){const s=t.length,a=t[0],{firstParentClientId:l,parentBlockType:c,previousBlockClientId:u,selectedBlockClientIds:d,isContentOnly:h,isZoomOut:p,canEdit:f,canMove:m,isFirst:g,isLast:b}=(0,zt.A)(e=>{const{getBlockName:n,getBlockRootClientId:i,getPreviousBlockClientId:r,getSelectedBlockClientIds:o,getBlockAttributes:s,getBlockEditingMode:l,isZoomOut:c,canEditBlock:u,canMoveBlocks:d,getBlockIndex:h,getBlockCount:p}=Gh(e(Qy)),{getActiveBlockVariation:f}=e(Zi),m=i(a),g=m&&n(m);return{firstParentClientId:m,parentBlockType:m&&(f(g,s(m))||bn(g)),previousBlockClientId:r(a),selectedBlockClientIds:o(),isContentOnly:"contentOnly"===l(a),isZoomOut:c(),canEdit:u(a),canMove:d(t),isFirst:0===h(a),isLast:h(a)===p(m)-1}},[a,t]),{getBlockOrder:y,getSelectedBlockClientIds:v}=(0,zt.A)(Qy),{moveBlocksDown:_,moveBlocksUp:x}=(0,Vt.A)(Qy),k=(0,zt.A)(e=>{const{getShortcutRepresentation:t}=e($T.M_);return{copy:t("core/block-editor/copy"),cut:t("core/block-editor/cut"),duplicate:t("core/block-editor/duplicate"),remove:t("core/block-editor/remove"),insertAfter:t("core/block-editor/insert-after"),insertBefore:t("core/block-editor/insert-before")}},[]),w=d.length>0;async function C(e){if(!i)return;const t=await e;t&&t[0]&&i(t[0],!1)}function S(){if(!i)return;let e=u||l;e||(e=y()[0]);const t=w&&0===v().length;i(e,t)}const A=d?.includes(l),I=!A&&!!l;return(0,Er.jsx)(lQ,{clientIds:t,__experimentalUpdateSelection:!i,children:({canCopyStyles:e,canDuplicate:u,canInsertBlock:d,canRemove:y,onDuplicate:v,onInsertAfter:w,onInsertBefore:A,onRemove:E,onCopy:j,onPasteStyles:B})=>y||u||d||!h?(0,Er.jsx)(xv.A,{icon:ww.A,label:(0,ee.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:MQ,noIcons:!0,...o,children:({onClose:o})=>(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsxs)(Fv.A,{children:[(0,Er.jsx)(pQ.Slot,{fillProps:{onClose:o}}),I&&(0,Er.jsx)(LQ,{parentClientId:l,parentBlockType:c}),m&&r&&(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(zv.A,{icon:MX.A,disabled:g,accessibleWhenDisabled:!0,onClick:(0,Eh.h)(o,()=>{x(t,l)}),children:(0,ee.__)("Move up")}),(0,Er.jsx)(zv.A,{icon:wT.A,disabled:b,accessibleWhenDisabled:!0,onClick:(0,Eh.h)(o,()=>{_(t,l)}),children:(0,ee.__)("Move down")})]}),f&&1===s&&(0,Er.jsx)(uQ,{clientId:a}),!h&&(0,Er.jsx)(PQ,{clientIds:t,onCopy:j,shortcut:k.copy}),y&&!h&&(0,Er.jsx)(PQ,{clientIds:t,label:(0,ee.__)("Cut"),eventType:"cut",shortcut:k.cut,__experimentalUpdateSelection:!i}),u&&(0,Er.jsx)(zv.A,{onClick:(0,Eh.h)(o,v,C),shortcut:k.duplicate,children:(0,ee.__)("Duplicate")}),d&&!p&&(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(zv.A,{onClick:(0,Eh.h)(o,A),shortcut:k.insertBefore,children:(0,ee.__)("Add before")}),(0,Er.jsx)(zv.A,{onClick:(0,Eh.h)(o,w),shortcut:k.insertAfter,children:(0,ee.__)("Add after")})]}),f&&1===s&&(0,Er.jsx)(cQ.Slot,{fillProps:{clientId:a,onClose:o}})]}),e&&!h&&(0,Er.jsxs)(Fv.A,{children:[(0,Er.jsx)(PQ,{clientIds:t,onCopy:j,label:(0,ee.__)("Copy styles"),eventType:"copyStyles"}),f&&(0,Er.jsx)(zv.A,{onClick:B,children:(0,ee.__)("Paste styles")})]}),!h&&(0,Er.jsx)(TQ.Slot,{fillProps:{onClose:o,count:s,firstBlockClientId:a},clientIds:t}),"function"==typeof n?n({onClose:o}):T.Children.map(e=>(0,T.cloneElement)(e,{onClose:o})),y&&(0,Er.jsx)(Fv.A,{children:(0,Er.jsx)(zv.A,{onClick:(0,Eh.h)(o,E,S),shortcut:k.remove,children:(0,ee.__)("Delete")})})]})}):null})}var FQ=DQ;var zQ=(e,t)=>"clear"===t.type?{}:Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce((e,n)=>({...e,[n]:"expand"===t.type}),{})}:e,VQ=(0,T.forwardRef)(function e({id:t,blocks:n,dropZoneElement:i,showBlockMovers:r=!1,isExpanded:o=!1,showAppender:s=!1,blockSettingsMenu:a=DQ,rootClientId:l,description:c,onSelect:u,additionalBlockContent:d},h){n&&(0,Qt.A)("`blocks` property in `wp.blockEditor.__experimentalListView`",{since:"6.3",alternative:"`rootClientId` property"});const p=(0,SS.A)(e),{clientIdsTree:f,draggedClientIds:m,selectedClientIds:g}=function({blocks:e,rootClientId:t}){return(0,zt.A)(n=>{const{getDraggedBlockClientIds:i,getSelectedBlockClientIds:r,getEnabledClientIdsTree:o}=Gh(n(Qy));return{selectedClientIds:r(),draggedClientIds:i(),clientIdsTree:e??o(t)}},[e,t])}({blocks:n,rootClientId:l}),b=function(e){return(0,T.useMemo)(()=>{const t={};let n=0;const i=e=>{e.forEach(e=>{t[e.clientId]=n,n++,e.innerBlocks.length>0&&i(e.innerBlocks)})};return i(e),t},[e])}(f),{getBlock:y,getSelectedBlockClientIds:v}=(0,zt.A)(Qy),{visibleBlockCount:_}=(0,zt.A)(e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n}=e(Qy),i=m?.length>0?n(m).length+1:0;return{visibleBlockCount:t()-i}},[m]),{updateBlockSelection:x}=function(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,Vt.A)(Qy),{getBlockName:i,getBlockParents:r,getBlockSelectionStart:o,getSelectedBlockClientIds:s,hasMultiSelection:a,hasSelectedBlock:l}=(0,zt.A)(Qy),{getBlockType:c}=(0,zt.A)(Zi),u=(0,T.useCallback)(async(u,d,h,p)=>{if(!u?.shiftKey&&u?.keyCode!==Rt._f)return void n(d,p);u.preventDefault();const f="keydown"===u.type&&u.keyCode===Rt._f,m="keydown"===u.type&&(u.keyCode===Rt.UP||u.keyCode===Rt.PX||u.keyCode===Rt.yZ||u.keyCode===Rt.Kp);if(!m&&!l()&&!a())return void n(d,null);const g=s(),b=[...r(d),d];if((f||m&&!g.some(e=>b.includes(e)))&&await e(),!f){let e=o(),n=d;m&&(l()||a()||(e=d),h&&(n=h));const i=r(e),s=r(n),{start:c,end:u}=function(e,t,n,i){const r=[...n,e],o=[...i,t],s=Math.min(r.length,o.length)-1;return{start:r[s],end:o[s]}}(e,n,i,s);await t(c,u,null)}const y=s();if((u.keyCode===Rt.yZ||u.keyCode===Rt.Kp)&&y.length>1)return;const v=g.filter(e=>!y.includes(e));let _;if(1===v.length){const e=c(i(v[0]))?.title;e&&(_=(0,ee.sprintf)((0,ee.__)("%s deselected."),e))}else v.length>1&&(_=(0,ee.sprintf)((0,ee.__)("%s blocks deselected."),v.length));_&&(0,dt.L)(_,"assertive")},[e,i,c,r,o,s,a,l,t,n]);return{updateBlockSelection:u}}(),[k,w]=(0,T.useReducer)(zQ,{}),[C,S]=(0,T.useState)(null),{setSelectedTreeId:A}=function({firstSelectedBlockClientId:e,setExpandedState:t}){const[n,i]=(0,T.useState)(null),{selectedBlockParentClientIds:r}=(0,zt.A)(t=>{const{getBlockParents:n}=t(Qy);return{selectedBlockParentClientIds:n(e,!1)}},[e]);return(0,T.useEffect)(()=>{n!==e&&r?.length&&t({type:"expand",clientIds:r})},[e,r,n,t]),{setSelectedTreeId:i}}({firstSelectedBlockClientId:g[0],setExpandedState:w}),I=(0,T.useCallback)((e,t,n)=>{x(e,t,null,n),A(t),u&&u(y(t))},[A,x,u,y]),{ref:E,target:j}=function({dropZoneElement:e,expandedState:t,setExpandedState:n}){const{getBlockRootClientId:i,getBlockIndex:r,getBlockCount:o,getDraggedBlockClientIds:s,canInsertBlocks:a}=(0,zt.A)(Qy),[l,c]=(0,T.useState)(),{rootClientId:u,blockIndex:d}=l||{},h=pq(u,d),p=(0,ee.isRTL)(),f=(0,qt.A)(u),m=dq((0,T.useCallback)((e,t)=>{const{rootClientId:i}=t||{};i&&("inside"!==t?.dropPosition||e[i]||n({type:"expand",clientIds:[i]}))},[n]),500,aQ);(0,T.useEffect)(()=>{"inside"===l?.dropPosition&&f===l?.rootClientId?m(t,l):m.cancel()},[t,f,l,m]);const g=s(),b=dq((0,T.useCallback)((e,t)=>{const n={x:e.clientX,y:e.clientY},s=!!g?.length,l=sQ(Array.from(t.querySelectorAll("[data-block]")).map(e=>{const t=e.dataset.block,n="true"===e.dataset.expanded,l=e.classList.contains("is-dragging"),c=parseInt(e.getAttribute("aria-level"),10),u=i(t);return{clientId:t,isExpanded:n,rootClientId:u,blockIndex:r(t),element:e,nestingLevel:c||void 0,isDraggedBlock:!!s&&l,innerBlockCount:o(t),canInsertDraggedBlocksAsSibling:!s||a(g,u),canInsertDraggedBlocksAsChild:!s||a(g,t)}}),n,p);l&&c(l)},[a,g,o,r,i,p]),50);return{ref:OC({dropZoneElement:e,onDrop(e){b.cancel(),l&&h(e),c(void 0)},onDragLeave(){b.cancel(),c(null)},onDragOver(e){b(e,e.currentTarget)},onDragEnd(){b.cancel(),c(void 0)}}),target:l}}({dropZoneElement:i,expandedState:k,setExpandedState:w}),B=(0,T.useRef)(),N=function({selectBlock:e}){const t=(0,yt.A)(),{getBlockOrder:n,getBlockRootClientId:i,getBlocksByClientId:r,getPreviousBlockClientId:o,getSelectedBlockClientIds:s,getSettings:a,canInsertBlockType:l,canRemoveBlocks:c}=(0,zt.A)(Qy),{flashBlock:u,removeBlocks:d,replaceBlocks:h,insertBlocks:p}=(0,Vt.A)(Qy),f=sK();return(0,bt.A)(m=>{function g(t,n){n&&e(void 0,t,null,null),DZ(t,m)}function b(e){if(e.defaultPrevented)return;if(!m.contains(e.target.ownerDocument.activeElement))return;const b=e.target.ownerDocument.activeElement?.closest("[role=row]"),y=b?.dataset?.block;if(!y)return;const{blocksToUpdate:v,firstBlockClientId:_,firstBlockRootClientId:x,originallySelectedBlockClientIds:k}=function(e){const t=s(),n=t.includes(e),r=n?t[0]:e;return{blocksToUpdate:n?t:[e],firstBlockClientId:r,firstBlockRootClientId:i(r),originallySelectedBlockClientIds:t}}(y);if(0!==v.length)if(e.preventDefault(),("copy"===e.type||"cut"===e.type)&&(1===v.length&&u(v[0]),f(e.type,v),lK(e,r(v),t)),"cut"===e.type){if(!c(v))return;let e=o(_)??x;d(v,!1);const t=k.length>0&&0===s().length;e||(e=n()[0]),g(e,t)}else if("paste"===e.type){const{__experimentalCanUserUseUnfilteredHTML:t}=a(),n=function(e,t){const{plainText:n,html:i,files:r}=Pj(e);let o=[];if(r.length){const e=lr("from");o=r.reduce((t,n)=>{const i=ar(e,e=>"files"===e.type&&e.isMatch([n]));return i&&t.push(i.transform([n])),t},[]).flat()}else o=Zs({HTML:i,plainText:n,mode:"BLOCKS",canUserUseUnfilteredHTML:t});return o}(e,t);if(1===v.length){const[e]=v;if(n.every(t=>l(t.name,e)))return p(n,void 0,e),void g(n[0]?.clientId,!1)}h(v,n,n.length-1,-1),g(n[0]?.clientId,!1)}}return m.ownerDocument.addEventListener("copy",b),m.ownerDocument.addEventListener("cut",b),m.ownerDocument.addEventListener("paste",b),()=>{m.ownerDocument.removeEventListener("copy",b),m.ownerDocument.removeEventListener("cut",b),m.ownerDocument.removeEventListener("paste",b)}},[])}({selectBlock:I}),R=(0,T.useCallback)(e=>{const[t]=v();t&&e&&DZ(t,e)},[v]),O=(0,gt.A)([N,R,B,E,h]),L=(0,T.useCallback)(e=>{if(!e)return;const t=Array.isArray(e)?e:[e];w({type:"expand",clientIds:t})},[w]),M=(0,T.useCallback)(e=>{e&&w({type:"collapse",clientIds:[e]})},[w]),P=(0,T.useCallback)(()=>{w({type:"clear"})},[w]),D=(0,T.useCallback)(e=>{L(e?.dataset?.block)},[L]),F=(0,T.useCallback)(e=>{M(e?.dataset?.block)},[M]),z=(0,T.useCallback)((e,t,n)=>{e.shiftKey&&x(e,t?.dataset?.block,n?.dataset?.block)},[x]);!function({collapseAll:e,expand:t}){const{expandedBlock:n,getBlockParents:i}=(0,zt.A)(e=>{const{getBlockParents:t,getExpandedBlock:n}=Gh(e(Qy));return{expandedBlock:n(),getBlockParents:t}},[]);(0,T.useEffect)(()=>{if(n){const r=i(n,!1);e(),t(r)}},[e,t,n,i])}({collapseAll:P,expand:L});const V=m?.[0],{blockDropTargetIndex:U,blockDropPosition:$,firstDraggedBlockIndex:H}=(0,T.useMemo)(()=>{let e,t;if(j?.clientId){const t=b[j.clientId];e=void 0===t||"top"===j?.dropPosition?t:t+1}else null===j&&(e=null);if(V){const e=b[V];t=void 0===e||"top"===j?.dropPosition?e:e+1}return{blockDropTargetIndex:e,blockDropPosition:j?.dropPosition,firstDraggedBlockIndex:t}},[j,b,V]),W=(0,T.useMemo)(()=>({blockDropPosition:$,blockDropTargetIndex:U,blockIndexes:b,draggedClientIds:m,expandedState:k,expand:L,firstDraggedBlockIndex:H,collapse:M,collapseAll:P,BlockSettingsMenu:a,listViewInstanceId:p,AdditionalBlockContent:d,insertedBlock:C,setInsertedBlock:S,treeGridElementRef:B,rootClientId:l}),[$,U,b,m,k,L,H,M,P,a,p,d,C,S,l]),[G]=function(e,t,n,i){const r=i?.initWindowSize??30,o=i?.useWindowing??!0,[s,a]=(0,T.useState)({visibleItems:r,start:0,end:r,itemInView:e=>e>=0&&e<=r});return(0,T.useLayoutEffect)(()=>{if(!o)return;const r=(0,QP.A)(e.current),s=e=>{if(!r)return;const o=Math.ceil(r.clientHeight/t),s=e?o:i?.windowOverscan??o,l=Math.floor(r.scrollTop/t),c=Math.max(0,l-s),u=Math.min(n-1,l+o+s);a(e=>{const t={visibleItems:o,start:c,end:u,itemInView:e=>c<=e&&e<=u};return e.start!==t.start||e.end!==t.end||e.visibleItems!==t.visibleItems?t:e})};s(!0);const l=(0,mS.s)(()=>{s()},16);return r?.addEventListener("scroll",l),r?.ownerDocument?.defaultView?.addEventListener("resize",l),r?.ownerDocument?.defaultView?.addEventListener("resize",l),()=>{r?.removeEventListener("scroll",l),r?.ownerDocument?.defaultView?.removeEventListener("resize",l)}},[t,e,n,i?.expandedState,i?.windowOverscan,o]),(0,T.useLayoutEffect)(()=>{if(!o)return;const i=(0,QP.A)(e.current),r=e=>{switch(e.keyCode){case Rt.yZ:return i?.scrollTo({top:0});case Rt.Kp:return i?.scrollTo({top:n*t});case Rt.Nx:return i?.scrollTo({top:i.scrollTop-s.visibleItems*t});case Rt.W3:return i?.scrollTo({top:i.scrollTop+s.visibleItems*t})}};return i?.ownerDocument?.defaultView?.addEventListener("keydown",r),()=>{i?.ownerDocument?.defaultView?.removeEventListener("keydown",r)}},[n,t,e,s.visibleItems,o,i?.expandedState]),[s,a]}(B,32,_,{expandedState:k,useWindowing:!0,windowOverscan:40});if(!f.length&&!s)return null;const q=c&&`block-editor-list-view-description-${p}`;return(0,Er.jsxs)(BU.Ay,{value:!0,children:[(0,Er.jsx)(nQ,{draggedBlockClientId:V,listViewRef:B,blockDropTarget:j}),c&&(0,Er.jsx)(kC.A,{id:q,children:c}),(0,Er.jsx)(rZ,{id:t,className:(0,mh.A)("block-editor-list-view-tree",{"is-dragging":m?.length>0&&void 0!==U}),"aria-label":(0,ee.__)("Block navigation structure"),ref:O,onCollapseRow:F,onExpandRow:D,onFocusRow:z,applicationAriaLabel:(0,ee.__)("Block navigation structure"),"aria-describedby":q,style:{"--wp-admin--list-view-dragged-items-height":m?.length?32*(m.length-1)+"px":null},children:(0,Er.jsx)(pZ.Provider,{value:W,children:(0,Er.jsx)(tQ,{blocks:f,parentId:l,selectBlock:I,showBlockMovers:r,fixedListWindow:G,selectedClientIds:g,isExpanded:o,showAppender:s})})})]})}),UQ=(0,T.forwardRef)((e,t)=>(0,Er.jsx)(VQ,{ref:t,...e,showAppender:!1,rootClientId:null,onSelect:null,additionalBlockContent:null,blockSettingsMenu:void 0}));function $Q(e){const{isOpened:t,expandRevision:n}=(0,zt.A)(t=>{const{isListViewPanelOpened:n,getListViewExpandRevision:i}=Gh(t(Qy));return{isOpened:n(e),expandRevision:i()}},[e]),{__unstableToggleListViewPanel:i}=(0,Vt.A)(Qy);return{isOpened:t,expandRevision:n,handleToggle:t=>{i(e,t)}}}function HQ(e){return _n(e,"listView")}var WQ={edit:function({clientId:e,name:t}){const{isSelectionWithinCurrentSection:n}=(0,T.useContext)(Bj),{isOpened:i,expandRevision:r,handleToggle:o}=$Q(e),{openListViewContentPanel:s}=Gh((0,Vt.A)(Qy)),a=HQ(t),{hasChildren:l,isNestedListView:c}=(0,zt.A)(t=>{const{getBlockCount:n,getBlockParents:i,getBlockName:r}=t(Qy),o=i(e,!1).find(e=>{const t=r(e);return"core/navigation"===t||_n(t,"listView")});return{hasChildren:!!n(e),isNestedListView:o}},[e]),u=bn(t),d=u?.title||t;if(!a||c)return null;const h=n;return(0,Er.jsx)(yw,{group:"list",children:(0,Er.jsxs)(mz.Ay,{title:h?d:void 0,opened:i,onToggle:o,children:[!l&&(0,Er.jsx)("p",{className:"block-editor-block-inspector__no-blocks",children:(0,ee.__)("No items yet.")}),(0,Er.jsx)(VQ,{rootClientId:e,isExpanded:!0,description:d,showAppender:!0,onSelect:s},`${e}-${r}`)]})})},hasSupport:HQ,attributeKeys:[],supportsPatternEditing:!0};function GQ(e,t,n,i,r=1,o=1){for(let s=o;;s++)for(let a=s===o?r:1;a<=t;a++){const t=new Sz({columnStart:a,rowStart:s,columnSpan:n,rowSpan:i});if(!e.some(e=>e.intersectsRect(t)))return[a,s]}}function qQ(e){!function({clientId:e}){const{gridLayout:t,blockOrder:n,selectedBlockLayout:i}=(0,zt.A)(t=>{const{getBlockAttributes:n,getBlockOrder:i}=t(Qy),r=t(Qy).getSelectedBlock();return{gridLayout:n(e).layout??{},blockOrder:i(e),selectedBlockLayout:r?.attributes.style?.layout}},[e]),{getBlockAttributes:r,getBlockRootClientId:o}=(0,zt.A)(Qy),{updateBlockAttributes:s,__unstableMarkNextChangeAsNotPersistent:a}=(0,Vt.A)(Qy),l=(0,T.useMemo)(()=>i?new Sz(i):null,[i]),c=(0,qt.A)(l),u=(0,qt.A)(t.isManualPlacement),d=(0,qt.A)(n);(0,T.useEffect)(()=>{const i={};if(t.isManualPlacement){const s=[];for(const e of n){const{columnStart:t,rowStart:n,columnSpan:i=1,rowSpan:o=1}=r(e).style?.layout??{};t&&n&&s.push(new Sz({columnStart:t,rowStart:n,columnSpan:i,rowSpan:o}))}for(const e of n){const n=r(e),{columnStart:o,rowStart:a,columnSpan:l=1,rowSpan:u=1}=n.style?.layout??{};if(o&&a)continue;const[d,h]=GQ(s,t.columnCount,l,u,c?.columnEnd,c?.rowEnd);s.push(new Sz({columnStart:d,rowStart:h,columnSpan:l,rowSpan:u})),i[e]={style:{...n.style,layout:{...n.style?.layout,columnStart:d,rowStart:h}}}}const a=Math.max(...s.map(e=>e.rowEnd));(!t.rowCount||t.rowCount<a)&&(i[e]={layout:{...t,rowCount:a}});for(const e of d??[])if(!n.includes(e)){const t=o(e);if(null===t)continue;const n=r(t);if("grid"===n?.layout?.type)continue;const s=r(e),{columnStart:a,rowStart:l,columnSpan:c,rowSpan:u,...d}=s.style?.layout??{};if(a||l||c||u){const t=0===Object.keys(d).length;i[e]=_p(s,["style","layout"],t?void 0:d)}}}else{if(!0===u)for(const e of n){const t=r(e),{columnStart:n,rowStart:o,...s}=t.style?.layout??{};if(n||o){const n=0===Object.keys(s).length;i[e]=_p(t,["style","layout"],n?void 0:s)}}t.rowCount&&(i[e]={layout:{...t,rowCount:void 0}})}Object.keys(i).length&&(a(),s(Object.keys(i),i,!0))},[e,t,d,n,c,u,a,r,o,s])}(e)}function KQ({clientId:e,layout:t}){const{isVisible:n,blockVisibility:i,deviceType:r,isAnyAncestorHidden:o}=(0,zt.A)(t=>{const{isBlockSelected:n,hasSelectedInnerBlock:i,isDraggingBlocks:r,getTemplateLock:o,getBlockEditingMode:s,getBlockAttributes:a,getSettings:l}=t(Qy);if(!r()&&!n(e)||o(e)||"default"!==s(e)||i(e))return{isVisible:!1};const{isBlockParentHiddenAtViewport:c}=Gh(t(Qy)),u=a(e),d=l(),h=d?.[Vh]?.toLowerCase()||yp.desktop.value;return{isVisible:!0,blockVisibility:u?.metadata?.blockVisibility,deviceType:h,isAnyAncestorHidden:c(e,h)}},[e]),{isBlockCurrentlyHidden:s}=VG({blockVisibility:i,deviceType:r});return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(qQ,{clientId:e}),n&&!s&&!o&&(0,Er.jsx)(zJ,{clientId:e,parentLayout:t})]})}(0,Ei.U2)("blocks.registerBlockType","core/metadata/addLabelCallback",function(e){return e.__experimentalLabel||_n(e,"renaming",!0)&&(e.__experimentalLabel=(e,{context:t})=>{const{metadata:n}=e;if(("list-view"===t||"breadcrumb"===t)&&n?.name)return n.name}),e});var YQ=(0,gh.f)(e=>function(t){return"grid"!==t.attributes.layout?.type?(0,Er.jsx)(e,{...t},"edit"):(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(KQ,{clientId:t.clientId,layout:t.attributes.layout}),(0,Er.jsx)(e,{...t},"edit")]})},"addGridVisualizerToBlockEdit");(0,Ei.U2)("editor.BlockEdit","core/editor/grid-visualizer",YQ);var JQ={edit:function({name:e,clientId:t,setAttributes:n}){const i=Vk(),r=(0,T.useContext)(Sj),o=(0,zt.A)(e=>{const n=e(Qy).getBlockAttributes(t);if(!n?.metadata?.bindings)return n;const{getBlockBindingsSource:i}=Gh(e(Zi));return Object.entries(n.metadata.bindings).reduce((t,[n,o])=>{const s=i(o.source);if(!s)return t;const a=s.getValues({select:e,context:r,bindings:{[n]:o}});return{...t,...a}},n)},[r,t]),s=bn(e),{fields:a,form:l}=(0,T.useMemo)(()=>s?.attributes?function(e){const t=[],n=[];return Object.entries(e).forEach(([e,i])=>{if(!i.autoGenerateControl)return;const r=function(e,t){const n=t.type,i={id:e,label:t.label||e,type:"string"===n?"text":n};return t.enum&&Array.isArray(t.enum)&&(i.elements=t.enum.map(e=>({value:e,label:String(e)}))),i}(e,i);r&&(t.push(r),n.push(e))}),{fields:t,form:{fields:n}}}(s.attributes):{fields:[],form:{fields:[]}},[s?.attributes]);return"default"!==i?null:a&&0!==a.length?(0,Er.jsx)(oC,{children:(0,Er.jsx)(mz.Ay,{title:(0,ee.__)("Settings"),children:(0,Er.jsx)(kj.A,{data:o,fields:a,form:l,onChange:n})})}):null},attributeKeys:[],hasSupport(e){const t=bn(e);return n=t?.attributes,!!n&&Object.values(n).some(e=>e?.autoGenerateControl);var n}};function XQ(e){const t=e.style?.border||{};return{className:xO(e)||void 0,style:ED({border:t})}}function ZQ(e){const{colors:t}=PB(),n=XQ(e),{borderColor:i}=e;if(i){const e=hO({colors:t,namedColor:i});n.style.borderColor=e.color}return n}function QQ(e){return{style:ED({shadow:e.style?.shadow||""})}}var e0,{kebabCase:t0}=Gh(Ev.j);!function(e){e=e.map(e=>({...e,Edit:(0,T.memo)(e.edit)}));const t=(0,gh.f)(t=>function(n){const i=Ih();return[...e.map((e,t)=>{const{Edit:r,hasSupport:o,attributeKeys:s=[],shareWithChildBlocks:a,supportsPatternEditing:l}=e;if(!(l&&i[vh]||i[bh]||i[yh]&&a)||!o(n.name))return null;const c={};for(const e of s)n.attributes[e]&&(c[e]=n.attributes[e]);return(0,Er.jsx)(r,{name:n.name,isSelected:n.isSelected,clientId:n.clientId,setAttributes:n.setAttributes,__unstableParentLayout:n.__unstableParentLayout,...c},t)}),(0,Er.jsx)(t,{...n},"edit")]},"withBlockEditHooks");(0,Ei.U2)("editor.BlockEdit","core/editor/hooks",t)}([Wk,xM,_j,SB,LD,XF,dF,EM,az,_z,HX,ZX,VX,yj,CB,WQ,JQ].filter(Boolean)),function(e){const t=(0,gh.f)(t=>function(n){const[i,r]=(0,T.useState)(Array(e.length).fill(void 0));return[...e.map((e,t)=>{const{hasSupport:i,attributeKeys:o=[],useBlockProps:s,isMatch:a}=e,l={};for(const e of o)n.attributes[e]&&(l[e]=n.attributes[e]);return!Object.keys(l).length||!i(n.name)||a&&!a(l)?null:(0,Er.jsx)(hv,{index:t,useBlockProps:s,setAllWrapperProps:r,name:n.name,clientId:n.clientId,...l},t)}),(0,Er.jsx)(t,{...n,wrapperProps:i.filter(Boolean).reduce((e,t)=>({...e,...t,className:(0,mh.A)(e.className,t.className),style:{...e.style,...t.style}}),n.wrapperProps||{})},"edit")]},"withBlockListBlockHooks");(0,Ei.U2)("editor.BlockListBlock","core/editor/hooks",t)}([Wk,xM,sj,LD,qO,SD,dF,rM,uM,EM,kO,XF,az,fz,VX]),e0=[Wk,xM,_j,xj,SB,kO,XF,EM,qO,LD,rM,uM],(0,Ei.U2)("blocks.getSaveContent.extraProps","core/editor/hooks",function(e,t,n){return e0.reduce((e,i)=>{const{hasSupport:r,attributeKeys:o=[],addSaveProps:s}=i,a={};for(const e of o)n[e]&&(a[e]=n[e]);return Object.keys(a).length&&r(t)?s(e,t,a):e},e)},0),(0,Ei.U2)("blocks.getSaveContent.extraProps","core/editor/hooks",e=>(e.hasOwnProperty("className")&&!e.className&&delete e.className,e));var n0=n(77571),i0=function({icon:e=n0.A,label:t=(0,ee.__)("Choose variation"),instructions:n=(0,ee.__)("Select a variation to start with:"),variations:i,onSelect:r,allowSkip:o}){const s=(0,mh.A)("block-editor-block-variation-picker",{"has-many-variations":i.length>4});return(0,Er.jsxs)(jC,{icon:e,label:t,instructions:n,className:s,children:[(0,Er.jsx)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,ee.__)("Block variations"),children:i.map(e=>(0,Er.jsxs)("li",{children:[(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,variant:"tertiary",icon:e.icon&&e.icon.src?e.icon.src:e.icon,iconSize:48,onClick:()=>r(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,Er.jsx)("span",{className:"block-editor-block-variation-picker__variation-label",children:e.title})]},e.name))}),o&&(0,Er.jsx)("div",{className:"block-editor-block-variation-picker__skip",children:(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>r(),children:(0,ee.__)("Skip")})})]})},r0=(0,gh.f)(e=>function(t){const[n,i,r,o,s]=tv("color.palette.default","color.palette.theme","color.palette.custom","color.custom","color.defaultPalette"),a=s?[...i||[],...n||[],...r||[]]:[...i||[],...r||[]],{colors:l=a,disableCustomColors:c=!o}=t,u=l&&l.length>0||!c;return(0,Er.jsx)(e,{...{...t,colors:l,disableCustomColors:c,hasColorsToChoose:u}})},"withColorContext")(UI),o0=({setting:e,children:t,panelId:n,...i})=>(0,Er.jsx)(aC,{hasValue:()=>!!e.colorValue||!!e.gradientValue,label:e.label,onDeselect:()=>{e.colorValue?e.onColorChange():e.gradientValue&&e.onGradientChange()},isShownByDefault:void 0===e.isShownByDefault||e.isShownByDefault,...i,className:"block-editor-tools-panel-color-gradient-settings__item",panelId:n,resetAllFilter:e.resetAllFilter,children:t}),s0=({colorValue:e,label:t})=>(0,Er.jsxs)(Cw.A,{justify:"flex-start",children:[(0,Er.jsx)(CI.A,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:e}),(0,Er.jsx)(Yv.A,{className:"block-editor-panel-color-gradient-settings__color-name",title:t,children:t})]}),a0=e=>function({onToggle:t,isOpen:n}){const{clearable:i,colorValue:r,gradientValue:o,onColorChange:s,onGradientChange:a,label:l}=e,c=(0,T.useRef)(void 0),u={onClick:t,className:(0,mh.A)("block-editor-panel-color-gradient-settings__dropdown",{"is-open":n}),"aria-expanded":n,ref:c},d=r??o;return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,...u,children:(0,Er.jsx)(s0,{colorValue:d,label:l})}),i&&d&&(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,label:(0,ee.__)("Reset"),className:"block-editor-panel-color-gradient-settings__reset",size:"small",icon:uS.A,onClick:()=>{r?s():o&&a(),n&&t(),c.current?.focus()}})]})};function l0({colors:e,disableCustomColors:t,disableCustomGradients:n,enableAlpha:i,gradients:r,settings:o,__experimentalIsRenderedInSidebar:s,...a}){let l;return s&&(l={placement:"left-start",offset:36,shift:!0}),(0,Er.jsx)(Er.Fragment,{children:o.map((o,c)=>{const u={clearable:!1,colorValue:o.colorValue,colors:e,disableCustomColors:t,disableCustomGradients:n,enableAlpha:i,gradientValue:o.gradientValue,gradients:r,label:o.label,onColorChange:o.onColorChange,onGradientChange:o.onGradientChange,showTitle:!1,__experimentalIsRenderedInSidebar:s,...o},d={clearable:o.clearable,label:o.label,colorValue:o.colorValue,gradientValue:o.gradientValue,onColorChange:o.onColorChange,onGradientChange:o.onGradientChange};return o&&(0,Er.jsx)(o0,{setting:o,...a,children:(0,Er.jsx)(wC.A,{popoverProps:l,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:a0(d),renderContent:()=>(0,Er.jsx)(CC.A,{paddingSize:"none",children:(0,Er.jsx)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:(0,Er.jsx)(TE,{...u})})})})},c)})})}var c0=["colors","disableCustomColors","gradients","disableCustomGradients"],u0=({className:e,colors:t,gradients:n,disableCustomColors:i,disableCustomGradients:r,children:o,settings:s,title:a,showTitle:l=!0,__experimentalIsRenderedInSidebar:c,enableAlpha:u})=>{const d=(0,SS.A)(u0),{batch:h}=(0,yt.A)();return t&&0!==t.length||n&&0!==n.length||!i||!r||!s?.every(e=>(!e.colors||0===e.colors.length)&&(!e.gradients||0===e.gradients.length)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients))?(0,Er.jsxs)(Xw,{className:(0,mh.A)("block-editor-panel-color-gradient-settings",e),label:l?a:void 0,resetAll:()=>{h(()=>{s.forEach(({colorValue:e,gradientValue:t,onColorChange:n,onGradientChange:i})=>{e?n():t&&i()})})},panelId:d,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",children:[(0,Er.jsx)(l0,{settings:s,panelId:d,colors:t,gradients:n,disableCustomColors:i,disableCustomGradients:r,__experimentalIsRenderedInSidebar:c,enableAlpha:u}),!!o&&(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)($I.A,{marginY:4})," ",o]})]}):null},d0=e=>{const t=PB();return(0,Er.jsx)(u0,{...{...t,...e}})},h0=e=>c0.every(t=>e.hasOwnProperty(t))?(0,Er.jsx)(u0,{...e}):(0,Er.jsx)(d0,{...e}),p0=Object.prototype.hasOwnProperty;function f0(e,t,n){for(n of e.keys())if(m0(n,t))return n}function m0(e,t){var n,i,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((i=e.length)===t.length)for(;i--&&m0(e[i],t[i]););return-1===i}if(n===Set){if(e.size!==t.size)return!1;for(i of e){if((r=i)&&"object"==typeof r&&!(r=f0(t,r)))return!1;if(!t.has(r))return!1}return!0}if(n===Map){if(e.size!==t.size)return!1;for(i of e){if((r=i[0])&&"object"==typeof r&&!(r=f0(t,r)))return!1;if(!m0(i[1],t.get(r)))return!1}return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((i=e.byteLength)===t.byteLength)for(;i--&&e.getInt8(i)===t.getInt8(i););return-1===i}if(ArrayBuffer.isView(e)){if((i=e.byteLength)===t.byteLength)for(;i--&&e[i]===t[i];);return-1===i}if(!n||"object"==typeof e){for(n in i=0,e){if(p0.call(e,n)&&++i&&!p0.call(t,n))return!1;if(!(n in t)||!m0(e[n],t[n]))return!1}return Object.keys(t).length===i}}return e!=e&&t!=t}var g0=e=>e>=0?e%360:(360+e%360)%360;function b0(e){return e*Math.PI/180}var y0={crop:{x:0,y:0,width:100,height:100},zoom:1,rotation:0,aspectRatio:1,flip:{horizontal:!1,vertical:!1}},v0={crop:{x:0,y:0},croppedArea:y0.crop,croppedAreaPixels:null,zoom:y0.zoom,rotation:y0.rotation,flip:y0.flip,aspectRatio:y0.aspectRatio,mediaSize:null},_0=(0,T.createContext)({cropperState:{crop:{x:0,y:0},croppedArea:{x:0,y:0,width:100,height:100},croppedAreaPixels:null,zoom:1,rotation:0,aspectRatio:1,flip:{horizontal:!1,vertical:!1},mediaSize:null},setCropperState:()=>{},resetState:null,setResetState:()=>{},isDirty:!1,reset:()=>{},getCroppedImage:()=>Promise.resolve(null)});function x0({children:e}){const t=function(){const[e,t]=(0,T.useState)(v0),[n,i]=(0,T.useState)(null),r=(0,T.useCallback)(e=>{t(t=>{const n={..."function"==typeof e?e(t):e};return"rotation"in n&&void 0!==n.rotation&&(n.rotation=g0(n.rotation)),{...t,...n}})},[]),o=(0,T.useCallback)((e=null)=>{if(!e)return i(null),void r(v0);if("object"==typeof e){const t={...y0,...e};i(t),r(t)}},[r,i]),s=(0,T.useCallback)(()=>{if(n){const e={crop:{x:0,y:0},croppedAreaPixels:null};n.crop&&(e.croppedArea=n.crop),void 0!==n.zoom&&(e.zoom=n.zoom),void 0!==n.rotation&&(e.rotation=n.rotation),void 0!==n.aspectRatio&&(e.aspectRatio=n.aspectRatio),void 0!==n.flip&&(e.flip=n.flip),r(e)}else r({...v0})},[n,r]),a=(0,T.useMemo)(()=>n?!1===m0({crop:e.croppedAreaPixels||e.croppedArea,zoom:e.zoom,rotation:g0(e.rotation),aspectRatio:e.aspectRatio,flip:e.flip},n):!1===m0({crop:e.croppedArea,zoom:e.zoom,rotation:g0(e.rotation),aspectRatio:e.aspectRatio,flip:e.flip},y0),[e,n]),l=(0,T.useCallback)(async t=>e.croppedAreaPixels?async function(e,t,n=0,i={horizontal:!1,vertical:!1}){try{const o=await(r=e,new Promise((e,t)=>{const n=new Image;n.addEventListener("load",()=>e(n)),n.addEventListener("error",e=>t(e)),n.setAttribute("crossOrigin","anonymous"),n.src=r})),s=document.createElement("canvas"),a=s.getContext("2d");if(!a)return null;const l=b0(n),{width:c,height:u}=function(e,t,n){const i=b0(n);return{width:Math.abs(Math.cos(i)*e)+Math.abs(Math.sin(i)*t),height:Math.abs(Math.sin(i)*e)+Math.abs(Math.cos(i)*t)}}(o.width,o.height,n);s.width=c,s.height=u,a.translate(c/2,u/2),a.rotate(l),a.scale(i.horizontal?-1:1,i.vertical?-1:1),a.translate(-o.width/2,-o.height/2),a.drawImage(o,0,0);const d=document.createElement("canvas"),h=d.getContext("2d");return h?(d.width=t.width,d.height=t.height,h.drawImage(s,t.x,t.y,t.width,t.height,0,0,t.width,t.height),new Promise(e=>{d.toBlob(t=>{t&&e(URL.createObjectURL(t))},"image/jpeg")})):null}catch{return null}var r}(t,e.croppedAreaPixels,e.rotation,e.flip):null,[e.croppedAreaPixels,e.rotation,e.flip]);return(0,T.useMemo)(()=>({cropperState:e,setCropperState:r,resetState:n,setResetState:o,isDirty:a,reset:s,getCroppedImage:l}),[e,r,n,o,a,s,l])}(),n=(0,T.useMemo)(()=>({...t}),[t]);return(0,Er.jsx)(_0.Provider,{value:n,children:e})}var k0=()=>{const e=(0,T.useContext)(_0);if(!e)throw new Error("Missing ImageCropperContext");return e},w0=n(8099),C0={placement:"bottom-start"},S0={crop:(0,ee.__)("Image cropped."),rotate:(0,ee.__)("Image rotated."),cropAndRotate:(0,ee.__)("Image cropped and rotated.")},A0=(0,T.createContext)({});A0.displayName="ImageEditingContext";var I0=()=>(0,T.useContext)(A0);function E0({id:e,url:t,naturalWidth:n,naturalHeight:i,onFinishEditing:r,onSaveImage:o,children:s}){const a=function({url:e,naturalWidth:t,naturalHeight:n}){const[i,r]=(0,T.useState)(),{cropperState:o,setCropperState:s}=k0(),{zoom:a,aspectRatio:l,crop:c,croppedArea:u}=o,d=(0,T.useCallback)(e=>{s({zoom:e})},[s]),h=(0,T.useCallback)(e=>{s({aspectRatio:e})},[s]),p=t/n,f=n/t;(0,T.useEffect)(()=>{h(p)},[]);const[m,g]=(0,T.useState)(0),b=(0,T.useCallback)(()=>{const t=(m+90)%360;let n=p;const i=1!==a||!(p===l||f===l);if(m%180==90&&(n=1/p),0===t)return r(),g(t),void s({aspectRatio:i?l:p,crop:{x:-c.y*n,y:c.x*n}});const o=new window.Image;o.src=e,o.onload=function(e){const o=document.createElement("canvas");let a=0,u=0;t%180?(o.width=e.target.height,o.height=e.target.width):(o.width=e.target.width,o.height=e.target.height),90!==t&&180!==t||(a=o.width),270!==t&&180!==t||(u=o.height);const d=o.getContext("2d");d.translate(a,u),d.rotate(t*Math.PI/180),d.drawImage(e.target,0,0),o.toBlob(e=>{r(URL.createObjectURL(e)),g(t);const a=i?l:o.width/o.height;s({aspectRatio:a,crop:{x:-c.y*n,y:c.x*n}})})};const u=(0,Ei.W5)("media.crossOrigin",void 0,e);"string"==typeof u&&(o.crossOrigin=u)},[m,p,e,s,c,a,l,f,g]);return(0,T.useMemo)(()=>({editedUrl:i,setEditedUrl:r,crop:u,zoom:a,setZoom:d,rotation:m,rotateClockwise:b,aspect:l,setAspect:h,defaultAspect:p}),[i,u,a,d,m,b,l,h,p])}({url:t,naturalWidth:n,naturalHeight:i}),l=function({crop:e,rotation:t,url:n,id:i,onSaveImage:r,onFinishEditing:o}){const{createErrorNotice:s,createSuccessNotice:a}=(0,Vt.A)(Rb.store),[l,c]=(0,T.useState)(!1),{editMediaEntity:u}=(0,zt.A)(e=>{const t=e(Qy).getSettings();return{editMediaEntity:t?.[Dh]}},[]),d=(0,T.useCallback)(()=>{c(!1),o()},[o]),h=(0,T.useCallback)(async()=>{if(!u)return o(),void s((0,ee.__)("Sorry, you are not allowed to edit images on this site."),{id:"image-editing-error",type:"snackbar"});c(!0);const l=[];if(t>0&&l.push({type:"rotate",args:{angle:t}}),(e.width<99.9||e.height<99.9)&&l.push({type:"crop",args:{left:e.x,top:e.y,width:e.width,height:e.height}}),0===l.length)return c(!1),void o();const d=1===l.length?l[0].type:"cropAndRotate";try{const e=await u(i,{src:n,modifiers:l},{throwOnError:!0});e&&(r({id:e.id,url:e.source_url}),a(S0[d],{type:"snackbar",actions:[{label:(0,ee.__)("Undo"),onClick:()=>{r({id:i,url:n})}}]}))}catch(e){s((0,ee.sprintf)((0,ee.__)("Could not edit image. %s"),ae(e.message)),{id:"image-editing-error",type:"snackbar"})}finally{c(!1),o()}},[e,t,i,n,r,s,a,o,u]);return(0,T.useMemo)(()=>({isInProgress:l,apply:h,cancel:d}),[l,h,d])}({id:e,url:t,onSaveImage:o,onFinishEditing:r,...a}),c=(0,T.useMemo)(()=>({...a,...l}),[a,l]);return(0,Er.jsx)(A0.Provider,{value:c,children:s})}function j0({aspectRatios:e,isDisabled:t,label:n,onClick:i,value:r}){return(0,Er.jsx)(Fv.A,{label:n,children:e.map(({name:e,slug:n,ratio:o})=>(0,Er.jsx)(zv.A,{disabled:t,onClick:()=>{i(o)},role:"menuitemradio",isSelected:o===r,icon:o===r?xw.A:void 0,children:e},n))})}function T0(e){const[t,n,...i]=e.split("/").map(Number);return t<=0||n<=0||Number.isNaN(t)||Number.isNaN(n)||i.length?NaN:n?t/n:t}function B0({ratio:e,...t}){return{ratio:T0(e),...t}}function N0({toggleProps:e}){const{isInProgress:t,aspect:n,setAspect:i,defaultAspect:r}=I0(),[o,s,a]=tv("dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios");return(0,Er.jsx)(xv.A,{icon:w0.A,label:(0,ee.__)("Aspect Ratio"),popoverProps:C0,toggleProps:e,children:({onClose:e})=>(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(j0,{isDisabled:t,onClick:t=>{i(t),e()},value:n,aspectRatios:[{slug:"original",name:(0,ee.__)("Original"),ratio:r},...a?o.map(B0).filter(({ratio:e})=>1===e):[]]}),s?.length>0&&(0,Er.jsx)(j0,{label:(0,ee.__)("Theme"),isDisabled:t,onClick:t=>{i(t),e()},value:n,aspectRatios:s}),a&&(0,Er.jsx)(j0,{label:(0,ee.__)("Landscape"),isDisabled:t,onClick:t=>{i(t),e()},value:n,aspectRatios:o.map(B0).filter(({ratio:e})=>e>1)}),a&&(0,Er.jsx)(j0,{label:(0,ee.__)("Portrait"),isDisabled:t,onClick:t=>{i(t),e()},value:n,aspectRatios:o.map(B0).filter(({ratio:e})=>e<1)})]})})}var R0=n(75187);function O0(e,t,n,i,r){void 0===r&&(r=0);var o=V0(t.width,t.height,r),s=o.width,a=o.height;return{x:L0(e.x,s,n.width,i),y:L0(e.y,a,n.height,i)}}function L0(e,t,n,i){var r=Math.abs(t*i/2-n/2);return U0(e,-r,r)}function M0(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function P0(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function D0(e,t){return Math.min(e,Math.max(0,t))}function F0(e,t){return t}function z0(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function V0(e,t,n){var i=n*Math.PI/180;return{width:Math.abs(Math.cos(i)*e)+Math.abs(Math.sin(i)*t),height:Math.abs(Math.sin(i)*e)+Math.abs(Math.cos(i)*t)}}function U0(e,t,n){return Math.min(Math.max(e,t),n)}function $0(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter(function(e){return"string"==typeof e&&e.length>0}).join(" ").trim()}var H0=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.cropperRef=T.createRef(),n.imageRef=T.createRef(),n.videoRef=T.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.previousCropSize=null,n.isInitialized=!1,n.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},n.initResizeObserver=function(){if(void 0!==window.ResizeObserver&&n.containerRef){var e=!0;n.resizeObserver=new window.ResizeObserver(function(t){e?e=!1:n.computeSizes()}),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturechange",n.onGestureChange),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd),n.currentDoc.removeEventListener("scroll",n.onScroll))},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var e=n.computeSizes();e&&(n.previousCropSize=e,n.emitCropData(),n.setInitialCrop(e),n.isInitialized=!0),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(e){if(n.props.initialCroppedAreaPercentages){var t=function(e,t,n,i,r,o){var s=V0(t.width,t.height,n),a=U0(i.width/s.width*(100/e.width),r,o);return{crop:{x:a*s.width/2-i.width/2-s.width*a*(e.x/100),y:a*s.height/2-i.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),i=t.crop,r=t.zoom;n.props.onCropChange(i),n.props.onZoomChange&&n.props.onZoomChange(r)}else if(n.props.initialCroppedAreaPixels){var o=function(e,t,n,i,r,o){void 0===n&&(n=0);var s=V0(t.naturalWidth,t.naturalHeight,n),a=U0(function(e,t,n){var i=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*i):n.width/(e.width*i)}(e,t,i),r,o),l=i.height>i.width?i.height/e.height:i.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);i=o.crop,r=o.zoom,n.props.onCropChange(i),n.props.onZoomChange&&n.props.onZoomChange(r)}},n.computeSizes=function(){var e,t,i,r,o,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===(i=n.imageRef.current)||void 0===i?void 0:i.naturalHeight)||(null===(r=n.videoRef.current)||void 0===r?void 0:r.videoHeight)||0,d=c/u,h=void 0;if(a.offsetWidth<c||a.offsetHeight<u)switch(n.state.mediaObjectFit){default:case"contain":h=l>d?{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,K.Cl)((0,K.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,i,r,o){void 0===o&&(o=0);var s=V0(e,t,o),a=s.width,l=s.height,c=Math.min(a,n),u=Math.min(l,i);return c>u*r?{width:u*r,height:u}:{width:c,height:c/r}}(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(null===(o=n.state.cropSize)||void 0===o?void 0:o.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.onGestureChange),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureChange=function(e){if(e.preventDefault(),!n.isTouching){var i=t.getMousePoint(e),r=n.gestureZoomStart-1+e.scale;if(n.setNewZoom(r,i,{shouldUpdatePosition:!0}),n.props.onRotationChange){var o=n.gestureRotationStart+e.rotation;n.props.onRotationChange(o)}}},n.onGestureEnd=function(e){n.cleanEvents()},n.onDragStart=function(e){var t,i,r=e.x,o=e.y;n.dragStartPosition={x:r,y:o},n.dragStartCrop=(0,K.Cl)({},n.props.crop),null===(i=(t=n.props).onInteractionStart)||void 0===i||i.call(t)},n.onDrag=function(e){var t=e.x,i=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!==i){var e=t-n.dragStartPosition.x,r=i-n.dragStartPosition.y,o={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+r},s=n.props.restrictPosition?O0(o,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):o;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 i=t.getMousePoint(e),r=R0(e).pixelY,o=n.props.zoom-r*n.props.zoomSpeed/200;n.setNewZoom(o,i,{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 i=e.x,r=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(i-t.x),y:n.containerRect.height/2-(r-t.y)}},n.getPointOnMedia=function(e){var t=e.x,i=e.y,r=n.props,o=r.crop,s=r.zoom;return{x:(t+o.x)/s,y:(i+o.y)/s}},n.setNewZoom=function(e,t,i){var r=(void 0===i?{}:i).shouldUpdatePosition,o=void 0===r||r;if(n.state.cropSize&&n.props.onZoomChange){var s=U0(e,n.props.minZoom,n.props.maxZoom);if(o){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?O0(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,i,r,o,s){void 0===o&&(o=0),void 0===s&&(s=!0);var a=s?D0:F0,l=V0(t.width,t.height,o),c=V0(t.naturalWidth,t.naturalHeight,o),u={x:a(100,((l.width-n.width/r)/2-e.x/r)/l.width*100),y:a(100,((l.height-n.height/r)/2-e.y/r)/l.height*100),width:a(100,n.width/l.width*100/r),height:a(100,n.height/l.height*100/r)},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*i?{width:Math.round(h*i),height:h}:{width:d,height:Math.round(d/i)};return{croppedAreaPercentages:u,croppedAreaPixels:(0,K.Cl)((0,K.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?O0(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,i=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,i),n.props.onCropAreaChange&&n.props.onCropAreaChange(t,i)}},n.emitCropAreaChange=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,i=e.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(t,i)}},n.recomputeCropPosition=function(){var e,t;if(n.state.cropSize){var i=n.props.crop;if(n.isInitialized&&(null===(e=n.previousCropSize)||void 0===e?void 0:e.width)&&(null===(t=n.previousCropSize)||void 0===t?void 0:t.height)&&(Math.abs(n.previousCropSize.width-n.state.cropSize.width)>1e-6||Math.abs(n.previousCropSize.height-n.state.cropSize.height)>1e-6)){var r=n.state.cropSize.width/n.previousCropSize.width,o=n.state.cropSize.height/n.previousCropSize.height;i={x:n.props.crop.x*r,y:n.props.crop.y*o}}var s=n.props.restrictPosition?O0(i,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):i;n.previousCropSize=n.state.cropSize,n.props.onCropChange(s),n.emitCropData()}},n.onKeyDown=function(e){var t,i,r=n.props,o=r.crop,s=r.onCropChange,a=r.keyboardStep,l=r.zoom,c=r.rotation,u=a;if(n.state.cropSize){e.shiftKey&&(u*=.2);var d=(0,K.Cl)({},o);switch(e.key){case"ArrowUp":d.y-=u,e.preventDefault();break;case"ArrowDown":d.y+=u,e.preventDefault();break;case"ArrowLeft":d.x-=u,e.preventDefault();break;case"ArrowRight":d.x+=u,e.preventDefault();break;default:return}n.props.restrictPosition&&(d=O0(d,n.mediaSize,n.state.cropSize,l,c)),e.repeat||null===(i=(t=n.props).onInteractionStart)||void 0===i||i.call(t),s(d)}},n.onKeyUp=function(e){var t,i;switch(e.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":e.preventDefault();break;default:return}n.emitCropData(),null===(i=(t=n.props).onInteractionEnd)||void 0===i||i.call(t)},n}return(0,K.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),this.props.setCropperRef&&this.props.setCropperRef(this.cropperRef))},t.prototype.componentWillUnmount=function(){var e,t;this.currentDoc&&this.currentWindow&&(void 0===window.ResizeObserver&&this.currentWindow.removeEventListener("resize",this.computeSizes),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&(null===(t=this.styleRef.parentNode)||void 0===t||t.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(e){var t,n,i,r,o,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===(i=e.cropSize)||void 0===i?void 0:i.width)!==(null===(r=this.props.cropSize)||void 0===r?void 0:r.width)?this.computeSizes():(null===(o=e.crop)||void 0===o?void 0:o.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,i;if("cover"===this.props.objectFit){if((this.imageRef.current||this.videoRef.current)&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var r=this.containerRect.width/this.containerRect.height;return((null===(e=this.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=this.videoRef.current)||void 0===t?void 0:t.videoWidth)||0)/((null===(n=this.imageRef.current)||void 0===n?void 0:n.naturalHeight)||(null===(i=this.videoRef.current)||void 0===i?void 0:i.videoHeight)||0)<r?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),i=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=M0(n,i),this.lastPinchRotation=P0(n,i),this.onDragStart(z0(n,i))},t.prototype.onPinchMove=function(e){var n=this;if(this.currentDoc&&this.currentWindow){var i=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),o=z0(i,r);this.onDrag(o),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var e=M0(i,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,o,{shouldUpdatePosition:!1}),n.lastPinchDistance=e;var s=P0(i,r),a=n.props.rotation+(s-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(a),n.lastPinchRotation=s})}},t.prototype.render=function(){var e,t=this,n=this.props,i=n.image,r=n.video,o=n.mediaProps,s=n.cropperProps,a=n.transform,l=n.crop,c=l.x,u=l.y,d=n.rotation,h=n.zoom,p=n.cropShape,f=n.showGrid,m=n.roundCropAreaPixels,g=n.style,b=g.containerStyle,y=g.cropAreaStyle,v=g.mediaStyle,_=n.classes,x=_.containerClassName,k=_.cropAreaClassName,w=_.mediaClassName,C=null!==(e=this.state.mediaObjectFit)&&void 0!==e?e:this.getObjectFit();return T.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(e){return t.containerRef=e},"data-testid":"container",style:b,className:$0("reactEasyCrop_Container",x)},i?T.createElement("img",(0,K.Cl)({alt:"",className:$0("reactEasyCrop_Image","contain"===C&&"reactEasyCrop_Contain","horizontal-cover"===C&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===C&&"reactEasyCrop_Cover_Vertical",w)},o,{src:i,ref:this.imageRef,style:(0,K.Cl)((0,K.Cl)({},v),{transform:a||"translate(".concat(c,"px, ").concat(u,"px) rotate(").concat(d,"deg) scale(").concat(h,")")}),onLoad:this.onMediaLoad})):r&&T.createElement("video",(0,K.Cl)({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:$0("reactEasyCrop_Video","contain"===C&&"reactEasyCrop_Contain","horizontal-cover"===C&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===C&&"reactEasyCrop_Cover_Vertical",w)},o,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:(0,K.Cl)((0,K.Cl)({},v),{transform:a||"translate(".concat(c,"px, ").concat(u,"px) rotate(").concat(d,"deg) scale(").concat(h,")")}),controls:!1}),(Array.isArray(r)?r:[{src:r}]).map(function(e){return T.createElement("source",(0,K.Cl)({key:e.src},e))})),this.state.cropSize&&T.createElement("div",(0,K.Cl)({ref:this.cropperRef,style:(0,K.Cl)((0,K.Cl)({},y),{width:m?Math.round(this.state.cropSize.width):this.state.cropSize.width,height:m?Math.round(this.state.cropSize.height):this.state.cropSize.height}),tabIndex:0,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,"data-testid":"cropper",className:$0("reactEasyCrop_CropArea","round"===p&&"reactEasyCrop_CropAreaRound",f&&"reactEasyCrop_CropAreaGrid",k)},s)))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},cropperProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0,keyboardStep:1},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(T.Component);function W0({src:e,onLoad:t,minZoom:n=1,maxZoom:i=5,...r}){const{cropperState:o,setCropperState:s}=k0(),{crop:a,zoom:l,rotation:c,aspectRatio:u,flip:d}=o,h=(0,T.useCallback)((e,t)=>{s({croppedArea:e,croppedAreaPixels:t})},[s]);return(0,Er.jsx)(H0,{classes:{containerClassName:"image-cropper__container",cropAreaClassName:"image-cropper__crop-area",mediaClassName:"image-cropper__image"},minZoom:n,maxZoom:i,rotation:c,image:e,setMediaSize:e=>s({mediaSize:e}),crop:a,zoom:l,aspect:u,onCropChange:e=>s({crop:e}),onZoomChange:e=>s({zoom:e}),onCropComplete:h,onMediaLoaded:e=>{t?.(e)},onRotationChange:e=>s({rotation:e}),transform:[`translate(${a.x}px, ${a.y}px)`,`rotateZ(${c}deg)`,`rotateY(${d.horizontal?180:0}deg)`,`rotateX(${d.vertical?180:0}deg)`,`scale(${l})`].join(" "),...r})}function G0({url:e,width:t,height:n,naturalHeight:i,naturalWidth:r,borderProps:o}){const{isInProgress:s,editedUrl:a,rotation:l}=I0(),[c,{width:u}]=(0,SC.A)();let d=n||u*i/r;l%180==90&&(d=u*r/i);const h=(0,Er.jsxs)("div",{className:(0,mh.A)("wp-block-image__crop-area",o?.className,{"is-applying":s}),style:{...o?.style,width:t||u,height:d},children:[(0,Er.jsx)(W0,{src:a||e}),s&&(0,Er.jsx)(TC.Ay,{})]});return(0,Er.jsxs)(Er.Fragment,{children:[c,h]})}var q0=n(12933);function K0(){const{isInProgress:e,zoom:t,setZoom:n}=I0();return(0,Er.jsx)(wC.A,{contentClassName:"wp-block-image__zoom",popoverProps:C0,renderToggle:({isOpen:t,onToggle:n})=>(0,Er.jsx)(vv,{icon:q0.A,label:(0,ee.__)("Zoom"),onClick:n,"aria-expanded":t,disabled:e}),renderContent:()=>(0,Er.jsx)(CC.A,{paddingSize:"medium",children:(0,Er.jsx)(gk.A,{__next40pxDefaultSize:!0,label:(0,ee.__)("Zoom"),min:100,max:300,value:Math.round(100*t),onChange:e=>n(e/100)})})})}var Y0=n(22681);function J0(){const{isInProgress:e,rotateClockwise:t}=I0();return(0,Er.jsx)(vv,{icon:Y0.A,label:(0,ee.__)("Rotate"),onClick:t,disabled:e})}function X0(){const{isInProgress:e,apply:t,cancel:n}=I0();return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(vv,{onClick:t,disabled:e,children:(0,ee.__)("Apply")}),(0,Er.jsx)(vv,{onClick:n,children:(0,ee.__)("Cancel")})]})}function Z0({id:e,url:t,width:n,height:i,naturalHeight:r,naturalWidth:o,onSaveImage:s,onFinishEditing:a,borderProps:l}){return(0,Er.jsx)(x0,{children:(0,Er.jsxs)(E0,{id:e,url:t,naturalWidth:o,naturalHeight:r,onSaveImage:s,onFinishEditing:a,children:[(0,Er.jsx)(G0,{borderProps:l,url:t,width:n,height:i,naturalHeight:r,naturalWidth:o}),(0,Er.jsxs)(Mv,{children:[(0,Er.jsxs)(wv,{children:[(0,Er.jsx)(K0,{}),(0,Er.jsx)(mv.A,{children:e=>(0,Er.jsx)(N0,{toggleProps:e})}),(0,Er.jsx)(J0,{})]}),(0,Er.jsx)(wv,{children:(0,Er.jsx)(X0,{})})]})]})})}function Q0({url:e,urlLabel:t,className:n}){const i=(0,mh.A)(n,"block-editor-url-popover__link-viewer-url");return e?(0,Er.jsx)(OA.A,{className:i,href:e,children:t||(0,aA.r)((0,oA.S)(e))}):(0,Er.jsx)("span",{className:i})}var{__experimentalPopoverLegacyPositionToPlacement:e1}=Gh(Ev.j),t1=(0,T.forwardRef)(({additionalControls:e,children:t,renderSettings:n,placement:i,focusOnMount:r="firstElement",position:o,...s},a)=>{let l;void 0!==o&&(0,Qt.A)("`position` prop in wp.blockEditor.URLPopover",{since:"6.2",alternative:"`placement` prop"}),void 0!==i?l=i:void 0!==o&&(l=e1(o)),l=l||"bottom";const[c,u]=(0,T.useState)(!1),d=!!n&&c;return(0,Er.jsxs)(uw.Ay,{ref:a,role:"dialog","aria-modal":"true","aria-label":(0,ee.__)("Edit URL"),className:"block-editor-url-popover",focusOnMount:r,placement:l,shift:!0,variant:"toolbar",...s,children:[(0,Er.jsx)("div",{className:"block-editor-url-popover__input-container",children:(0,Er.jsxs)("div",{className:"block-editor-url-popover__row",children:[t,!!n&&(0,Er.jsx)(fv.Ay,{className:"block-editor-url-popover__settings-toggle",icon:wT.A,label:(0,ee.__)("Link settings"),onClick:()=>{u(!c)},"aria-expanded":c,size:"compact"})]})}),d&&(0,Er.jsx)("div",{className:"block-editor-url-popover__settings",children:n()}),e&&!d&&(0,Er.jsx)("div",{className:"block-editor-url-popover__additional-controls",children:e})]})});t1.LinkEditor=function({autocompleteRef:e,className:t,onChangeInputValue:n,value:i,...r}){return(0,Er.jsxs)("form",{className:(0,mh.A)("block-editor-url-popover__link-editor",t),...r,children:[(0,Er.jsx)(GS,{value:i,onChange:n,autocompleteRef:e}),(0,Er.jsx)(fv.Ay,{icon:ES.A,label:(0,ee.__)("Apply"),type:"submit",size:"compact"})]})},t1.LinkViewer=function({className:e,linkClassName:t,onEditLinkClick:n,url:i,urlLabel:r,...o}){return(0,Er.jsxs)("div",{className:(0,mh.A)("block-editor-url-popover__link-viewer",e),...o,children:[(0,Er.jsx)(Q0,{url:i,urlLabel:r,className:t}),n&&(0,Er.jsx)(fv.Ay,{icon:PA.A,label:(0,ee.__)("Edit"),onClick:n,size:"compact"})]})};var n1=t1,i1=()=>{},r1=({src:e,onChange:t,onSubmit:n,onClose:i,popoverAnchor:r})=>(0,Er.jsx)(n1,{anchor:r,onClose:i,children:(0,Er.jsx)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:n,children:(0,Er.jsx)(PS.Ay,{__next40pxDefaultSize:!0,label:(0,ee.__)("URL"),type:"text",hideLabelFromVision:!0,placeholder:(0,ee.__)("Paste or type URL"),onChange:t,value:e,suffix:(0,Er.jsx)(CS.A,{variant:"control",children:(0,Er.jsx)(fv.Ay,{size:"small",icon:ES.A,label:(0,ee.__)("Apply"),type:"submit"})})})})}),o1=({src:e,onChangeSrc:t,onSelectURL:n})=>{const[i,r]=(0,T.useState)(null),[o,s]=(0,T.useState)(!1),a=()=>{s(!1),i?.focus()};return(0,Er.jsxs)("div",{className:"block-editor-media-placeholder__url-input-container",children:[(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__button",onClick:()=>{s(!0)},isPressed:o,variant:"secondary","aria-haspopup":"dialog",ref:r,children:(0,ee.__)("Insert from URL")}),o&&(0,Er.jsx)(r1,{src:e,onChange:t,onSubmit:t=>{t.preventDefault(),e&&n&&(n(e),a())},onClose:a,popoverAnchor:i})]})},s1=gS("editor.MediaPlaceholder")(function({value:e={},allowedTypes:t,className:n,icon:i,labels:r={},mediaPreview:o,notices:s,isAppender:a,accept:l,addToGallery:c,multiple:u=!1,handleUpload:d=!0,disableDropZone:h,disableMediaButtons:p,onError:f,onSelect:m,onCancel:g,onSelectURL:b,onToggleFeaturedImage:y,onDoubleClick:v,onFilesPreUpload:_=i1,onHTMLDrop:x,children:k,mediaLibraryButton:w,placeholder:C,style:S}){x&&(0,Qt.A)("wp.blockEditor.MediaPlaceholder onHTMLDrop prop",{since:"6.2",version:"6.4"});const{mediaUpload:A,allowedMimeTypes:I}=(0,zt.A)(e=>{const{getSettings:t}=e(Qy),n=t();return{mediaUpload:n.mediaUpload,allowedMimeTypes:n.allowedMimeTypes}},[]),[E,j]=(0,T.useState)("");(0,T.useEffect)(()=>{j(e?.src??"")},[e?.src]);const B=(0,T.useMemo)(()=>nI(t,I,l),[t,I,l]),N=n=>{if(!d||"function"==typeof d&&!d(n))return m(n);let i;if(_(n),u)if(c){let t=[];i=n=>{const i=(e??[]).filter(e=>e.id?!t.some(({id:t})=>Number(t)===Number(e.id)):!t.some(({urlSlug:t})=>e.url.includes(t)));m(i.concat(n)),t=n.map(e=>{const t=e.url.lastIndexOf("."),n=e.url.slice(0,t);return{id:e.id,urlSlug:n}})}}else i=m;else i=([e])=>m(e);A({allowedTypes:t,filesList:n,onFileChange:i,onError:f,multiple:u})};async function R(e){const{blocks:n}=hq(e);if(!n?.length)return;const i=await Promise.all(n.map(e=>{const n=e.name.split("/")[1];return e.attributes.id?(e.attributes.type=n,e.attributes):new Promise((i,r)=>{window.fetch(e.attributes.url).then(e=>e.blob()).then(o=>A({filesList:[o],additionalData:{title:e.attributes.title,alt_text:e.attributes.alt,caption:e.attributes.caption,type:n},onFileChange:([e])=>{e.id&&i(e)},allowedTypes:t,onError:r})).catch(()=>i(e.attributes.url))})})).catch(e=>f(e));i?.length&&m(u?i:i[0])}const O=e=>{N(e.target.files)},L=C??(e=>{let{instructions:l,title:c}=r;if(A||b||(l=(0,ee.__)("To edit this block, you need permission to upload media.")),void 0===l||void 0===c){const e=t??[],[n]=e,i=1===e.length,r=i&&"audio"===n,o=i&&"image"===n,s=i&&"video"===n;void 0===l&&A&&(l=(0,ee.__)("Drag and drop an image or video, upload, or choose from your library."),r?l=(0,ee.__)("Drag and drop an audio file, upload, or choose from your library."):o?l=(0,ee.__)("Drag and drop an image, upload, or choose from your library."):s&&(l=(0,ee.__)("Drag and drop a video, upload, or choose from your library."))),void 0===c&&(c=(0,ee.__)("Media"),r?c=(0,ee.__)("Audio"):o?c=(0,ee.__)("Image"):s&&(c=(0,ee.__)("Video")))}const u=(0,mh.A)("block-editor-media-placeholder",n,{"is-appender":a});return(0,Er.jsxs)(jC,{icon:i,label:c,instructions:l,className:u,notices:s,onDoubleClick:v,preview:o,style:S,children:[e,k]})}),M=()=>h?null:(0,Er.jsx)(LC,{onFilesDrop:N,onDrop:R,isEligible:e=>{const n=[];for(const t of e.types)t.startsWith("wp-block:core/")&&n.push(t.slice(14));return n.every(e=>t.includes(e))&&(!!u||1===n.length)}}),P=()=>g&&(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__cancel-button",title:(0,ee.__)("Cancel"),variant:"link",onClick:g,children:(0,ee.__)("Cancel")}),D=()=>b&&(0,Er.jsx)(o1,{src:E,onChangeSrc:j,onSelectURL:b}),F=()=>y&&(0,Er.jsx)("div",{className:"block-editor-media-placeholder__url-input-container",children:(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__button",onClick:y,variant:"secondary",children:(0,ee.__)("Use featured image")})});return p?(0,Er.jsx)(xS,{children:M()}):(0,Er.jsx)(xS,{fallback:L(D()),children:(()=>{const n=w??(({open:e})=>(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{e()},children:(0,ee.__)("Media Library")})),i=(0,Er.jsx)(_S,{addToGallery:c,gallery:u&&!(!t||0===t.length)&&t.every(e=>"image"===e||e.startsWith("image/")),multiple:u,onSelect:m,allowedTypes:t,mode:"browse",value:Array.isArray(e)?e.map(({id:e})=>e):e.id,render:n});if(A&&a)return(0,Er.jsxs)(Er.Fragment,{children:[M(),(0,Er.jsx)(fS,{onChange:O,accept:B,multiple:!!u,render:({openFileDialog:e})=>{const t=(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,variant:"primary",className:(0,mh.A)("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:e,children:(0,ee._x)("Upload","verb")}),i,D(),F(),P()]});return L(t)}})]});if(A){const e=(0,Er.jsxs)(Er.Fragment,{children:[M(),(0,Er.jsx)(fS,{render:({openFileDialog:e})=>(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,onClick:e,variant:"primary",className:(0,mh.A)("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),children:(0,ee._x)("Upload","verb")}),onChange:O,accept:B,multiple:!!u}),i,D(),F(),P()]});return L(e)}return L(i)})()})});function a1({character:e,type:t,onUse:n}){const i=(0,T.useContext)(QT),r=(0,T.useRef)();return r.current=n,(0,T.useEffect)(()=>{function n(n){Rt.kx[t](n,e)&&(r.current(),n.preventDefault())}return i.current.add(n),()=>{i.current.delete(n)}},[e,t]),null}var l1=n(90844);function c1({name:e,shortcutType:t,shortcutCharacter:n,...i}){let r,o="RichText.ToolbarControls";return e&&(o+=`.${e}`),t&&n&&(r=Rt.dz[t](n)),(0,Er.jsx)(l1.A,{name:o,children:(0,Er.jsx)(vv,{...i,shortcut:r})})}function u1({inputType:e,onInput:t}){const n=(0,T.useContext)(eB),i=(0,T.useRef)();return i.current=t,(0,T.useEffect)(()=>{function t(t){t.inputType===e&&(i.current(),t.preventDefault())}return n.current.add(t),()=>{n.current.delete(t)}},[e]),null}var d1=n(48782),h1="none",p1="custom",f1="media",m1="attachment",g1=["noreferrer","noopener"],b1=({linkDestination:e,onChangeUrl:t,url:n,mediaType:i="image",mediaUrl:r,mediaLink:o,linkTarget:s,linkClass:a,rel:l,showLightboxSetting:c,lightboxEnabled:u,onSetLightbox:d,resetLightbox:h})=>{const[p,f]=(0,T.useState)(!1),[m,g]=(0,T.useState)(null),[b,y]=(0,T.useState)(!1),[v,_]=(0,T.useState)(null),x=(0,T.useRef)(null),k=(0,T.useRef)();(0,T.useEffect)(()=>{k.current&&(hS.XC.focusable.find(k.current)[0]||k.current).focus()},[b,n,u]);const w=()=>{y(!1)},C=()=>{const e=[{linkDestination:f1,title:(0,ee.__)("Link to image file"),url:"image"===i?r:void 0,icon:cB.A}];return"image"===i&&o&&e.push({linkDestination:m1,title:(0,ee.__)("Link to attachment page"),url:"image"===i?o:void 0,icon:ZS.A}),e},S=(0,Er.jsxs)(Q_.A,{spacing:"3",children:[(0,Er.jsx)(Zv.A,{label:(0,ee.__)("Open in new tab"),onChange:e=>{const n=(e=>{const t=e?"_blank":void 0;let n;if(t){const e=(l??"").split(" ");g1.forEach(t=>{e.includes(t)||e.push(t)}),n=e.join(" ")}else{const e=(l??"").split(" ").filter(e=>!1===g1.includes(e));n=e.length?e.join(" "):void 0}return{linkTarget:t,rel:n}})(e);t(n)},checked:"_blank"===s}),(0,Er.jsx)(kS.A,{__next40pxDefaultSize:!0,label:(0,ee.__)("Link relation"),value:l??"",onChange:e=>{t({rel:e})},help:(0,qS.A)((0,ee.__)("The <a>Link Relation</a> attribute defines the relationship between a linked resource and the current document."),{a:(0,Er.jsx)(OA.A,{href:"https://developer.mozilla.org/docs/Web/HTML/Attributes/rel"})})}),(0,Er.jsx)(kS.A,{__next40pxDefaultSize:!0,label:(0,ee.__)("Link CSS class"),value:a||"",onChange:e=>{t({linkClass:e})}})]}),A=null!==v?v:n,I=!u||u&&!c,E=!A&&I,j=(C().find(t=>t.linkDestination===e)||{}).title;return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(vv,{icon:fB.A,className:"components-toolbar__control",label:(0,ee.__)("Link"),"aria-expanded":p,onClick:()=>{f(!0)},ref:g,isActive:!!n||u&&c}),p&&(0,Er.jsx)(n1,{ref:k,anchor:m,onFocusOutside:e=>{const t=x.current;t&&t.contains(e.target)||(f(!1),_(null),w())},onClose:()=>{_(null),w(),f(!1)},renderSettings:I?()=>S:null,additionalControls:E&&(0,Er.jsxs)(pS.Ay,{children:[C().map(e=>(0,Er.jsx)(zv.A,{icon:e.icon,iconPosition:"left",onClick:()=>{_(null),(e=>{const n=C();let i;i=e?(n.find(t=>t.url===e)||{linkDestination:p1}).linkDestination:h1,t({linkDestination:i,href:e})})(e.url),w()},children:e.title},e.linkDestination)),c&&(0,Er.jsx)(zv.A,{className:"block-editor-url-popover__expand-on-click",icon:d1.A,info:(0,ee.__)("Scale the image with a lightbox effect."),iconPosition:"left",onClick:()=>{_(null),t({linkDestination:h1,href:""}),d?.(!0),w()},children:(0,ee.__)("Enlarge on click")},"expand-on-click")]}),offset:13,children:u&&c&&!n&&!b?(0,Er.jsxs)("div",{className:"block-editor-url-popover__expand-on-click",children:[(0,Er.jsx)(xx.A,{icon:d1.A}),(0,Er.jsxs)("div",{className:"text",children:[(0,Er.jsx)("p",{children:(0,ee.__)("Enlarge on click")}),(0,Er.jsx)("p",{className:"description",children:(0,ee.__)("Scales the image with a lightbox effect")})]}),(0,Er.jsx)(fv.Ay,{icon:IS.A,label:(0,ee.__)("Disable enlarge on click"),onClick:()=>{d?.(!1)},size:"compact"})]}):!n||b?(0,Er.jsx)(n1.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:A,onChangeInputValue:_,onSubmit:e=>{if(v){const e=C().find(e=>e.url===v)?.linkDestination||p1;t({href:(0,jS.i)(v),linkDestination:e,lightbox:{enabled:!1}})}w(),_(null),e.preventDefault()},autocompleteRef:x}):n&&!b?(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(n1.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:n,onEditLinkClick:()=>{e!==f1&&e!==m1||_(""),y(!0)},urlLabel:j}),(0,Er.jsx)(fv.Ay,{icon:IS.A,label:(0,ee.__)("Remove link"),onClick:()=>{t({linkDestination:h1,href:""}),h?.()},size:"compact"})]}):void 0})]})};function y1(e){const{isSectionBlock:t,isWithinSection:n,isWithinEditedSection:i,isEditingContentOnlySection:r,editedContentOnlySection:o}=(0,zt.A)(t=>{const{isSectionBlock:n,getParentSectionBlock:i,getEditedContentOnlySection:r,isWithinEditedContentOnlySection:o}=Gh(t(Qy)),s=r();return{isSectionBlock:n(e),isWithinSection:n(e)||!!i(e),isWithinEditedSection:o(e),isEditingContentOnlySection:s===e,editedContentOnlySection:s}},[e]),s=(0,Vt.A)(Qy),{editContentOnlySection:a,stopEditingContentOnlySection:l}=Gh(s);return{isSectionBlock:t,isWithinSection:n,isWithinEditedSection:i,isEditingContentOnlySection:r,editedContentOnlySection:o,editContentOnlySection:a,stopEditingContentOnlySection:l}}function v1({block:e,onNavigateToEntityRecord:t,isSyncedPattern:n,isTemplatePartBlock:i}){const r=e?.attributes||{};return(0,Er.jsx)(Q_.A,{className:"block-editor-block-inspector-edit-contents",expanded:!0,children:(0,Er.jsx)(fv.Ay,{className:"block-editor-block-inspector-edit-contents__button",__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{if(n)t({postId:r.ref,postType:"wp_block"});else if(i){const{theme:e,slug:n}=r,i=e&&n?`${e}//${n}`:null;i&&t({postId:i,postType:"wp_template_part"})}},children:(0,ee.__)("Edit original")})})}function _1({clientId:e,editedContentOnlySection:t,editContentOnlySection:n,stopEditingContentOnlySection:i}){return(0,Er.jsx)(Q_.A,{className:"block-editor-block-inspector-edit-contents",expanded:!0,children:(0,Er.jsx)(fv.Ay,{className:"block-editor-block-inspector-edit-contents__button",__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{t?i():n(e)},children:t?(0,ee.__)("Exit pattern"):(0,ee.__)("Edit pattern")})})}function x1({clientId:e}){const{isWithinSection:t,isWithinEditedSection:n,editedContentOnlySection:i,editContentOnlySection:r,stopEditingContentOnlySection:o}=y1(e),{block:s,onNavigateToEntityRecord:a,canEdit:l}=(0,zt.A)(t=>{const{getBlock:n,getSettings:i,canEditBlock:r}=t(Qy);return{block:n(e),onNavigateToEntityRecord:i().onNavigateToEntityRecord,canEdit:r(e)}},[e]);if(!l||!t&&!n)return null;const c=xn(s),u=kn(s);return(c||u)&&a?(0,Er.jsx)(v1,{block:s,onNavigateToEntityRecord:a,isSyncedPattern:c,isTemplatePartBlock:u}):(0,Er.jsx)(_1,{clientId:e,editedContentOnlySection:i,editContentOnlySection:r,stopEditingContentOnlySection:o})}function k1(){const e=(0,zt.A)(e=>e(Qy).getBlockSelectionStart(),[]),t=(0,T.useRef)();return TO(e,t),e?(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{t.current?.focus()},children:(0,ee.__)("Skip to the selected block")}):null}var w1=n(16674);function C1(){const e=(0,zt.A)(e=>e(Qy).getSelectedBlockCount(),[]);return(0,Er.jsxs)(Cw.A,{justify:"flex-start",spacing:2,className:"block-editor-multi-selection-inspector__card",children:[(0,Er.jsx)(hj,{icon:w1.A,showColors:!0}),(0,Er.jsx)("div",{className:"block-editor-multi-selection-inspector__card-title",children:(0,ee.sprintf)((0,ee._n)("%d Block","%d Blocks",e),e)})]})}var{Menu:S1}=Gh(Ev.j);function A1({className:e,onSelectVariation:t,selectedValue:n,variations:i}){return(0,Er.jsxs)("fieldset",{className:e,children:[(0,Er.jsx)(kC.A,{as:"legend",children:(0,ee.__)("Transform to variation")}),i.map(e=>(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,size:"compact",icon:(0,Er.jsx)(hj,{icon:e.icon,showColors:!0}),isPressed:n===e.name,label:n===e.name?e.title:(0,ee.sprintf)((0,ee.__)("Transform to %s"),e.title),onClick:()=>t(e.name),"aria-label":e.title,showTooltip:!0},e.name))]})}function I1({className:e,onSelectVariation:t,selectedValue:n,variations:i}){return(0,Er.jsx)("div",{className:e,children:(0,Er.jsxs)(S1,{children:[(0,Er.jsx)(S1.TriggerButton,{render:(0,Er.jsx)(fv.Ay,{className:"block-editor-block-variation-transforms__button",__next40pxDefaultSize:!0,variant:"secondary",children:(0,ee.__)("Transform to variation")})}),(0,Er.jsx)(S1.Popover,{position:"bottom",children:(0,Er.jsx)(S1.Group,{children:i.map(e=>(0,Er.jsxs)(S1.RadioItem,{value:e.name,checked:n===e.name,onChange:()=>t(e.name),children:[(0,Er.jsx)(S1.ItemLabel,{children:e.title}),e.description&&(0,Er.jsx)(S1.ItemHelpText,{children:e.description})]},e.name))})})]})})}function E1({className:e,onSelectVariation:t,selectedValue:n,variations:i}){return(0,Er.jsx)("div",{className:e,children:(0,Er.jsx)(Jv.A,{label:(0,ee.__)("Transform to variation"),value:n,hideLabelFromVision:!0,onChange:t,__next40pxDefaultSize:!0,children:i.map(e=>(0,Er.jsx)(Xv.A,{icon:(0,Er.jsx)(hj,{icon:e.icon,showColors:!0}),value:e.name,label:n===e.name?e.title:(0,ee.sprintf)((0,ee.__)("Transform to %s"),e.title)},e.name))})})}var j1=function({blockClientId:e}){const{updateBlockAttributes:t}=(0,Vt.A)(Qy),{activeBlockVariation:n,variations:i,canEdit:r,isContentOnly:o,isSection:s}=(0,zt.A)(t=>{const{getActiveBlockVariation:n,getBlockVariations:i}=t(Zi),{getBlockName:r,getBlockAttributes:o,getBlockEditingMode:s,isSectionBlock:a}=Gh(t(Qy)),{canEditBlock:l}=t(Qy),c=e&&r(e),{hasContentRoleAttribute:u}=Gh(t(Zi)),d=u(c);return{activeBlockVariation:n(c,o(e),"transform"),variations:c&&i(c,"transform"),canEdit:l(e),isContentOnly:"contentOnly"===s(e)&&!d,isSection:a(e)}},[e]),a=n?.name,l=(0,T.useMemo)(()=>{const e=new Set;return!!i&&(i.forEach(t=>{t.icon&&e.add(t.icon?.src||t.icon)}),e.size===i.length)},[i]);if(!i?.length||!r||o||s)return null;const c=i.length>6,u=l?c?A1:E1:I1;return(0,Er.jsx)(u,{className:"block-editor-block-variation-transforms",onSelectVariation:n=>{t(e,{...i.find(({name:e})=>e===n).attributes})},selectedValue:a,variations:i})};function T1({blocks:e,placement:t="right-start",offset:n=16,anchor:i}){return(0,dw.A)("medium","<")?null:(0,Er.jsx)("div",{className:"block-editor-block-switcher__popover-preview-container",children:(0,Er.jsx)(uw.Ay,{className:"block-editor-block-switcher__popover-preview",placement:t,focusOnMount:!1,offset:n,anchor:i,children:(0,Er.jsx)("div",{className:"block-editor-block-switcher__preview",children:(0,Er.jsx)(BK,{viewportWidth:601,blocks:e})})})})}function B1(e,t,n){const i=new eM(e);return t&&i.remove("is-style-"+t.name),i.add("is-style-"+n.name),i.value}function N1(e){return e?.find(e=>e.isDefault)}function R1({clientId:e,onSwitch:t}){const{styles:n,block:i,blockType:r,className:o}=(0,zt.A)(t=>{const{getBlock:n}=t(Qy),i=n(e);if(!i)return{};const r=bn(i.name),{getBlockStyles:o}=t(Zi);return{block:r?.example?null:i,blockType:r,styles:o(i.name),className:i.attributes.className||""}},[e]),{updateBlockAttributes:s}=(0,Vt.A)(Qy),a=function(e){return e&&0!==e.length?N1(e)?e:[{name:"default",label:(0,ee._x)("Default","block style"),isDefault:!0},...e]:[]}(n),l=function(e,t){for(const n of new eM(t).values()){if(-1===n.indexOf("is-style-"))continue;const t=n.substring(9),i=e?.find(({name:e})=>e===t);if(i)return i}return N1(e)}(a,o),c=function(e,t){return(0,T.useMemo)(()=>{const n=t?.example,i=t?.name;return n&&i?mr(i,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?ir(e):void 0},[e,t?.example,t?.name])}(i,r);return{onSelect:n=>{const i=B1(o,l,n);s(e,{className:i}),t()},stylesToRender:a,activeStyle:l,genericPreviewBlock:c,className:o}}var O1=()=>{},L1=function({clientId:e,onSwitch:t=O1,onHoverClassName:n=O1}){const i=(0,zt.A)(t=>t(Qy).canEditBlock(e),[e]),{onSelect:r,stylesToRender:o,activeStyle:s,genericPreviewBlock:a,className:l}=R1({clientId:e,onSwitch:t}),[c,u]=(0,T.useState)(null),[d,h]=(0,T.useState)(null),p=Zw(),f=(0,T.useMemo)(()=>{if(!c||!a)return null;const e=B1(l,s,c);return[{...a,attributes:{...a.attributes||{},className:e}}]},[c,a,l,s]);if(!i||!o||0===o.length)return null;const m=(0,mS.s)(u,250),g=e=>{r(e),n(null),u(null),m.cancel()},b=e=>{c!==e?(m(e),n(e?.name??null)):m.cancel()},y=N1(o),v=()=>{g(y)};return(0,Er.jsx)(Xw,{label:(0,ee.__)("Styles"),resetAll:v,panelId:e,hasInnerWrapper:!0,dropdownMenuProps:p,children:(0,Er.jsx)(aC,{hasValue:()=>s?.name!==y?.name,label:(0,ee.__)("Variation"),onDeselect:v,isShownByDefault:!0,panelId:e,children:(0,Er.jsxs)("div",{ref:h,className:"block-editor-block-styles",children:[(0,Er.jsx)("div",{className:"block-editor-block-styles__variants",children:o.map(e=>{const t=e.label||e.name;return(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,className:(0,mh.A)("block-editor-block-styles__item",{"is-active":s.name===e.name}),variant:"secondary",label:t,onMouseEnter:()=>b(e),onFocus:()=>b(e),onMouseLeave:()=>b(null),onBlur:()=>b(null),onClick:()=>g(e),"aria-current":s.name===e.name,children:(0,Er.jsx)(xC.A,{numberOfLines:1,className:"block-editor-block-styles__item-text",children:t})},e.name)})}),f&&(0,Er.jsx)(T1,{blocks:f,placement:"left-start",offset:34,anchor:d})]})})})},M1=n(82950),P1=n(20691),D1=n(4801),F1={name:"settings",title:(0,ee.__)("Settings"),value:"settings",icon:M1.A},z1={name:"styles",title:(0,ee.__)("Styles"),value:"styles",icon:P1.A},V1={name:"content",title:(0,ee.__)("Content"),value:"content",icon:ZS.A},U1={name:"list",title:(0,ee.__)("List View"),value:"list-view",icon:D1.A},$1=({initialOpen:e=!1})=>{const t=Bv(rC.slotName),n=Bv(cw.name),i=Boolean(t&&t.length),r=Boolean(n&&n.length);return i||r?(0,Er.jsxs)(mz.Ay,{className:"block-editor-block-inspector__advanced",title:(0,ee.__)("Advanced"),initialOpen:e,children:[(0,Er.jsx)(oC.Slot,{group:"advanced"}),(0,Er.jsx)(cw.Slot,{})]}):null},H1=()=>{const{selectedClientIds:e,selectedBlocks:t,hasPositionAttribute:n}=(0,zt.A)(e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:n}=e(Qy),i=n(),r=t(i);return{selectedClientIds:i,selectedBlocks:r,hasPositionAttribute:r?.some(({attributes:e})=>!!e?.style?.position?.type)}},[]),{updateBlockAttributes:i}=(0,Vt.A)(Qy),r=Zw();function o(){if(!e?.length||!t?.length)return;const n=Object.fromEntries(t?.map(({clientId:e,attributes:t})=>[e,{style:ov({...t?.style,position:{...t?.style?.position,type:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0}})}]));i(e,n,!0)}return(0,Er.jsx)(Xw,{className:"block-editor-block-inspector__position",label:(0,ee.__)("Position"),resetAll:o,dropdownMenuProps:r,children:(0,Er.jsx)(aC,{isShownByDefault:n,label:(0,ee.__)("Position"),hasValue:()=>n,onDeselect:o,children:(0,Er.jsx)(oC.Slot,{group:"position"})})})},W1=()=>{const e=Bv(lw.position.name);return Boolean(e&&e.length)?(0,Er.jsx)(H1,{}):null},G1=({showAdvancedControls:e=!1})=>{const t=Bv(lw.default.name),n=Bv(lw.position.name),i=Bv(lw.bindings.name),r=!!t?.length||!!n?.length||!!i?.length;return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(oC.Slot,{}),(0,Er.jsx)(W1,{}),(0,Er.jsx)(oC.Slot,{group:"bindings"}),e&&(0,Er.jsx)("div",{children:(0,Er.jsx)($1,{initialOpen:!r})})]})};function q1({blockName:e,clientId:t,contentClientIds:n}){const i=dv(e),{updateBlockAttributes:r}=(0,Vt.A)(Qy),{hasButtons:o,hasHeading:s}=(0,zt.A)(e=>{const t=e(Qy).getBlockNamesByClientId(n);return{hasButtons:t.includes("core/buttons"),hasHeading:t.includes("core/heading")}},[n]);return(0,Er.jsx)(GO,{clientId:t,name:e,settings:i,setAttributes:e=>{r(t,e)},asWrapper:DE,label:(0,ee.__)("Color"),defaultControls:{text:!0,background:!0,button:o,heading:s}})}var K1=({blockName:e,clientId:t,hasBlockStyles:n,isSectionBlock:i,contentClientIds:r})=>{const o=vO({blockName:e});return(0,Er.jsxs)(Er.Fragment,{children:[n&&(0,Er.jsx)(L1,{clientId:t}),i&&(0,Er.jsx)(q1,{blockName:e,clientId:t,contentClientIds:r}),!i&&(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(oC.Slot,{group:"color",label:(0,ee.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,Er.jsx)(oC.Slot,{group:"background",label:(0,ee.__)("Background image"),className:"background-block-support-panel__inner-wrapper"}),(0,Er.jsx)(oC.Slot,{group:"filter"}),(0,Er.jsx)(oC.Slot,{group:"typography",label:(0,ee.__)("Typography")}),(0,Er.jsx)(oC.Slot,{group:"dimensions",label:(0,ee.__)("Dimensions")}),(0,Er.jsx)(oC.Slot,{group:"border",label:o}),(0,Er.jsx)(oC.Slot,{group:"styles"})]})]})};function Y1({clientIds:e,onSelect:t,onSwitchToListView:n,hasListViewTab:i}){return e.length?(0,Er.jsx)(Q_.A,{spacing:1,children:e.map(e=>(0,Er.jsx)(J1,{onSelect:t,onSwitchToListView:n,hasListViewTab:i,clientId:e},e))}):null}function J1({clientId:e,onSelect:t,onSwitchToListView:n,hasListViewTab:i}){const r=Ej(e),{isSelected:o,childBlocks:s,hasListViewSupport:a,blockName:l}=(0,zt.A)(t=>{const{isBlockSelected:n,hasSelectedInnerBlock:i,getBlockOrder:r,getBlockName:o}=t(Qy),s=o(e);return{isSelected:n(e)||i(e,!0),childBlocks:r(e),hasListViewSupport:"core/navigation"===s||_n(s,"listView"),blockName:s}},[e]),c=bn(l),u=Aj({clientId:e,context:"list-view"})||c?.title||l,{selectBlock:d}=(0,Vt.A)(Qy),h=s&&s.length>0&&i&&a;return(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,className:"block-editor-block-quick-navigation__item",isPressed:o,onClick:async()=>{await d(e),h&&n&&n(e),t&&t(e)},children:(0,Er.jsxs)(Kv.A,{children:[(0,Er.jsx)(Yv.A,{children:(0,Er.jsx)(hj,{icon:r?.icon})}),(0,Er.jsx)(_C.A,{style:{textAlign:"left"},children:(0,Er.jsx)(xC.A,{children:u})}),h&&(0,Er.jsx)(Yv.A,{children:(0,Er.jsx)(xx.A,{icon:Lz.A,size:24})})]})})}var X1=({contentClientIds:e,onSwitchToListView:t,hasListViewTab:n})=>{if(!e||0===e.length)return null;const i=window?.__experimentalContentOnlyInspectorFields;return(0,Er.jsx)(Er.Fragment,{children:!i&&(0,Er.jsx)(mz.Ay,{title:(0,ee.__)("Content"),children:(0,Er.jsx)(Y1,{clientIds:e,onSwitchToListView:t,hasListViewTab:n})})})},{Tabs:Z1}=Gh(Ev.j);function Q1({blockName:e,clientId:t,hasBlockStyles:n,tabs:i,isSectionBlock:r,contentClientIds:o}){const s=(0,T.useRef)(null),a=(0,zt.A)(e=>e(Ob.M).get("core","showIconLabels"),[]),{requestedTab:l}=(0,zt.A)(e=>({requestedTab:Gh(e(Qy)).getRequestedInspectorTab()})),[c,u]=(0,T.useState)(()=>l?.tabName??i[0]?.name),d=(0,T.useRef)(!1),h=(0,T.useRef)(!1),{__unstableSetOpenListViewPanel:p,__unstableIncrementListViewExpandRevision:f,__unstableSetAllListViewPanelsOpen:m}=(0,Vt.A)(Qy),{clearRequestedInspectorTab:g}=Gh((0,Vt.A)(Qy));(0,T.useEffect)(()=>{d.current=!1},[t]),(0,T.useEffect)(()=>{l&&(u(l.tabName),l.tabName===U1.name&&l.options?.openPanel&&(p(l.options.openPanel),f()),h.current=!0,d.current=!0,g())},[l,p,f,g]),(0,T.useEffect)(()=>{c!==U1.name||d.current||(m(),f())},[t,c,m,f]),(0,T.useEffect)(()=>{if(!i?.length||d.current&&i.some(e=>e.name===c))return;const e=i[0]?.name;c!==e&&u(e)},[i,c]);const b=e=>{u(e),d.current=!0,e!==U1.name||h.current||(m(),f()),h.current=!1},y=i.some(e=>e.name===U1.name);return(0,Er.jsx)("div",{className:"block-editor-block-inspector__tabs",children:(0,Er.jsxs)(Z1,{selectedTabId:c,onSelect:b,children:[(0,Er.jsx)(Z1.TabList,{children:i.map(e=>a?(0,Er.jsx)(Z1.Tab,{tabId:e.name,children:e.title},e.name):(0,Er.jsx)(jR.Ay,{text:e.title,children:(0,Er.jsx)(Z1.Tab,{tabId:e.name,"aria-label":e.title,children:(0,Er.jsx)(IC.A,{icon:e.icon})})},e.name))}),(0,Er.jsxs)(Z1.TabPanel,{tabId:V1.name,focusable:!1,children:[(0,Er.jsx)(X1,{contentClientIds:o,onSwitchToListView:e=>{y&&(p(e),f(),h.current=!0,b(U1.name))},hasListViewTab:y}),(0,Er.jsx)(oC.Slot,{group:"content"})]}),(0,Er.jsxs)(Z1.TabPanel,{tabId:U1.name,focusable:!1,children:[(0,Er.jsx)(oC.Slot,{group:"list",ref:s}),(0,Er.jsx)(mw,{listViewRef:s})]}),(0,Er.jsx)(Z1.TabPanel,{tabId:F1.name,focusable:!1,children:(0,Er.jsx)(G1,{showAdvancedControls:!!e})}),(0,Er.jsx)(Z1.TabPanel,{tabId:z1.name,focusable:!1,children:(0,Er.jsx)(K1,{blockName:e,clientId:t,hasBlockStyles:n,isSectionBlock:r,contentClientIds:o})})]},t)})}var e2=[],{Fill:t2,Slot:n2}=(0,Sv.QJ)(Symbol("InspectorControlsLastItem")),i2=e=>Ih()[bh]?(0,Er.jsx)(t2,{...e}):null;i2.Slot=function(e){return(0,Er.jsx)(n2,{...e})};var r2=i2,{Badge:o2}=Gh(Ev.j),s2={currentBlockVisibility:void 0,hasParentHiddenEverywhere:!1,selectedDeviceType:yp.desktop.value};function a2({clientId:e}){const{currentBlockVisibility:t,selectedDeviceType:n,hasParentHiddenEverywhere:i}=(0,zt.A)(t=>{if(!e)return s2;const{getBlockAttributes:n,isBlockParentHiddenEverywhere:i,getSettings:r}=Gh(t(Qy));return{currentBlockVisibility:n(e)?.metadata?.blockVisibility,selectedDeviceType:r()?.[Vh]?.toLowerCase()||yp.desktop.value,hasParentHiddenEverywhere:i(e)}},[e]),r=BO(e),o=r?.ownerDocument?.defaultView,s=null===o?void 0:o,{isBlockCurrentlyHidden:a,currentViewport:l}=VG({blockVisibility:t,deviceType:n,view:s}),c=(0,zt.A)(t=>!(!e||!l)&&Gh(t(Qy)).isBlockParentHiddenAtViewport(e,l),[e,l]);if(!(a||i||c))return null;let u;if(a)if(!1===t)u=(0,ee.__)("Block is hidden");else{const e=yp[l]?.label||l;u=(0,ee.sprintf)((0,ee.__)("Block is hidden on %s"),e)}if(i)u=(0,ee.__)("Parent block is hidden");else if(c){const e=yp[l]?.label||l;u=(0,ee.sprintf)((0,ee.__)("Parent block is hidden on %s"),e)}return(0,Er.jsx)(o2,{className:"block-editor-block-visibility-info",children:(0,Er.jsxs)(Cw.A,{spacing:2,justify:"start",children:[(0,Er.jsx)(IC.A,{icon:IZ.A}),(0,Er.jsx)(lj.A,{children:u})]})})}function l2({blockName:e,showAdvancedControls:t=!0,showPositionControls:n=!0,showBindingsControls:i=!0}){const r=vO({blockName:e});return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(oC.Slot,{}),(0,Er.jsx)(oC.Slot,{group:"color",label:(0,ee.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,Er.jsx)(oC.Slot,{group:"background",label:(0,ee.__)("Background image"),className:"background-block-support-panel__inner-wrapper"}),(0,Er.jsx)(oC.Slot,{group:"typography",label:(0,ee.__)("Typography")}),(0,Er.jsx)(oC.Slot,{group:"dimensions",label:(0,ee.__)("Dimensions")}),(0,Er.jsx)(oC.Slot,{group:"border",label:r}),(0,Er.jsx)(oC.Slot,{group:"styles"}),n&&(0,Er.jsx)(W1,{}),i&&(0,Er.jsx)(oC.Slot,{group:"bindings"}),t&&(0,Er.jsx)("div",{children:(0,Er.jsx)($1,{})})]})}var c2=({animate:e,wrapper:t,children:n})=>e?t(n):n,u2=({blockInspectorAnimationSettings:e,renderedBlockClientId:t,children:n})=>{const i=e&&"leftToRight"===e.enterDirection?-50:50;return(0,Er.jsx)(NS.P.div,{animate:{x:0,opacity:1,transition:{ease:"easeInOut",duration:.14}},initial:{x:i,opacity:0},children:n},t)},d2=({renderedBlockClientId:e,blockName:t,isSectionBlock:n,availableTabs:i,contentClientIds:r,hasBlockStyles:o,editedContentOnlySection:s})=>{const a=(0,T.useRef)(null),l=i?.length>1,c=s&&s!==e,u=Ej(s),d=Ej(e),h=d.isSynced;return(0,Er.jsxs)("div",{className:"block-editor-block-inspector",children:[c&&(0,Er.jsx)(zz,{...u,className:u?.isSynced&&"is-synced",parentClientId:s}),(0,Er.jsx)(zz,{...d,allowParentNavigation:!0,className:h&&"is-synced",isChild:c,clientId:e}),(0,Er.jsx)(a2,{clientId:e}),(0,Er.jsx)(x1,{clientId:e}),(0,Er.jsx)(j1,{blockClientId:e}),l&&(0,Er.jsx)(Er.Fragment,{children:(0,Er.jsx)(Q1,{hasBlockStyles:o,clientId:e,blockName:t,tabs:i,isSectionBlock:n,contentClientIds:r})}),!l&&(0,Er.jsxs)(Er.Fragment,{children:[o&&(0,Er.jsx)(L1,{clientId:e}),(0,Er.jsx)(X1,{contentClientIds:r}),(0,Er.jsx)(oC.Slot,{group:"content"}),(0,Er.jsx)(oC.Slot,{group:"list",ref:a}),(0,Er.jsx)(mw,{listViewRef:a}),!n&&(0,Er.jsx)(l2,{blockName:t})]}),(0,Er.jsx)(r2.Slot,{}),(0,Er.jsx)(k1,{},"back")]})},h2=function(){const{selectedBlockCount:e,renderedBlockName:t,renderedBlockClientId:n,blockType:i,isSectionBlock:r,isSectionBlockInSelection:o,hasBlockStyles:s,editedContentOnlySection:a}=(0,zt.A)(e=>{const{getSelectedBlockClientId:t,getSelectedBlockClientIds:n,getSelectedBlockCount:i,getBlockName:r,getParentSectionBlock:o,isSectionBlock:s,getEditedContentOnlySection:a,isWithinEditedContentOnlySection:l}=Gh(e(Qy)),{getBlockStyles:c}=e(Zi),u=t(),d=l(u)?u:o(u)||u,h=d&&r(d),p=h&&bn(h),f=n().some(e=>s(e)),m=h&&c(h),g=m&&m.length>0;return{selectedBlockCount:i(),renderedBlockClientId:d,renderedBlockName:h,blockType:p,isSectionBlockInSelection:f,isSectionBlock:s(d),hasBlockStyles:g,editedContentOnlySection:a()}},[]),l=(0,zt.A)(e=>{if(!r||!n)return[];const{getClientIdsOfDescendants:t,getBlockName:i,getBlockEditingMode:o}=Gh(e(Qy)),s=t(n),a=new Set;return s.forEach(e=>{const n=i(e);("core/navigation"===n||_n(n,"listView"))&&t(e).forEach(e=>a.add(e))}),s.filter(e=>!a.has(e)&&"contentOnly"===o(e))},[r,n]),c=function(e,t,n,i){const r=[],{bindings:o,border:s,color:a,content:l,default:c,dimensions:u,list:d,position:h,styles:p,typography:f,effects:m}=lw,g=Bv(d.name),b=!!g&&g.length,y=Bv(l.name),v=!!y&&y.length,_=[...Bv(s.name)||[],...Bv(a.name)||[],...Bv(u.name)||[],...Bv(p.name)||[],...Bv(f.name)||[],...Bv(m.name)||[]].length,x=[...Bv(rC.slotName)||[],...Bv(o.name)||[]],k=[...Bv(c.name)||[],...Bv(h.name)||[],...b&&_>1?x:[]],w=window?.__experimentalContentOnlyInspectorFields,C=v||!w&&t?.length;return C&&r.push(V1),b&&r.push(U1),(k.length||x.length&&(C||b))&&r.push(F1),(i||_)&&r.push(z1),function(e,t={}){return void 0!==t[e]?t[e]:void 0===t.default||t.default}(e,(0,zt.A)(e=>e(Qy).getSettings().blockInspectorTabs,[]))?r:e2}(i?.name,l,0,s),u=c?.length>1,d=function(e){return(0,zt.A)(t=>{if(e){const n=t(Qy).getSettings().blockInspectorAnimation,i=n?.animationParent,{getSelectedBlockClientId:r,getBlockParentsByBlockName:o}=t(Qy);return o(r(),i,!0)[0]||e.name===i?n?.[e.name]:null}return null},[e])}(i),h=e>1;if(h&&!o)return(0,Er.jsxs)("div",{className:"block-editor-block-inspector",children:[(0,Er.jsx)(C1,{}),u?(0,Er.jsx)(Q1,{tabs:c}):(0,Er.jsx)(l2,{blockName:t,showAdvancedControls:!1,showPositionControls:!1,showBindingsControls:!1})]});if(h&&o)return(0,Er.jsx)("div",{className:"block-editor-block-inspector",children:(0,Er.jsx)(C1,{})});const p=t===mn();return i&&n&&!p?(0,Er.jsx)(c2,{animate:d,wrapper:e=>(0,Er.jsx)(u2,{blockInspectorAnimationSettings:d,renderedBlockClientId:n,children:e}),children:(0,Er.jsx)(d2,{renderedBlockClientId:n,blockName:i.name,isSectionBlock:r,availableTabs:c,contentClientIds:l,hasBlockStyles:s,editedContentOnlySection:a})}):(0,Er.jsx)("span",{className:"block-editor-block-inspector__no-blocks",children:(0,ee.__)("No block selected.")})},p2={placement:"top-start"},f2={...p2,flip:!1,shift:!0},m2={...p2,flip:!0,shift:!1};function g2(e,t,n,i,r){if(!e||!t)return f2;const o=n?.scrollTop||0,s=dD(t),a=o+e.getBoundingClientRect().top,l=e.ownerDocument.documentElement.clientHeight,c=a+i,u=s.top>c,d=s.height>l-i;return r||!u&&!d?m2:f2}function b2({contentElement:e,clientId:t}){const n=BO(t),[i,r]=(0,T.useState)(0),{blockIndex:o,isSticky:s}=(0,zt.A)(e=>{const{getBlockIndex:n,getBlockAttributes:i}=e(Qy);return{blockIndex:n(t),isSticky:rz(i(t))}},[t]),a=(0,T.useMemo)(()=>{if(e)return(0,QP.A)(e)},[e]),[l,c]=(0,T.useState)(()=>g2(e,n,a,i,s)),u=(0,bt.A)(e=>{r(e.offsetHeight)},[]),d=(0,T.useCallback)(()=>c(g2(e,n,a,i,s)),[e,n,a,i]);return(0,T.useLayoutEffect)(d,[o,d]),(0,T.useLayoutEffect)(()=>{if(!e||!n)return;const t=e?.ownerDocument?.defaultView;let i;t?.addEventHandler?.("resize",d);const r=n?.ownerDocument?.defaultView;return r.ResizeObserver&&(i=new r.ResizeObserver(d),i.observe(n)),()=>{t?.removeEventHandler?.("resize",d),i&&i.disconnect()}},[d,e,n]),{...l,ref:u}}function y2(e){const t=(0,zt.A)(t=>{const{getBlockRootClientId:n,getBlockParents:i,__experimentalGetBlockListSettingsForBlocks:r,isBlockInsertionPointVisible:o,getBlockInsertionPoint:s,getBlockOrder:a,hasMultiSelection:l,getLastMultiSelectedBlockClientId:c}=t(Qy),u=i(e),d=r(u),h=u.find(e=>d[e]?.__experimentalCaptureToolbars);let p=!1;if(o()){const t=s();p=a(t.rootClientId)[t.index]===e}return{capturingClientId:h,isInsertionPointVisible:p,lastClientId:l()?c():null,rootClientId:n(e)}},[e]);return t}function v2({clientId:e,__unstableContentRef:t}){const{capturingClientId:n,isInsertionPointVisible:i,lastClientId:r,rootClientId:o}=y2(e),s=b2({contentElement:t?.current,clientId:e});return(0,Er.jsx)(mD,{clientId:n||e,bottomClientId:r,className:(0,mh.A)("block-editor-block-list__block-side-inserter-popover",{"is-insertion-point-visible":i}),__unstableContentRef:t,...s,children:(0,Er.jsx)("div",{className:"block-editor-block-list__empty-block-inserter",children:(0,Er.jsx)(PJ,{position:"bottom right",rootClientId:o,clientId:e,__experimentalIsQuick:!0})})})}var _2=function({clientIds:e,hideDragHandle:t}){const{canMove:n,rootClientId:i,isFirst:r,isLast:o,orientation:s,isManualGrid:a}=(0,zt.A)(t=>{const{getBlockIndex:n,getBlockListSettings:i,canMoveBlocks:r,getBlockOrder:o,getBlockRootClientId:s,getBlockAttributes:a}=t(Qy),l=Array.isArray(e)?e:[e],c=l[0],u=s(c),d=n(c),h=n(l[l.length-1]),p=o(u),{layout:f={}}=a(u)??{};return{canMove:r(e),rootClientId:u,isFirst:0===d,isLast:h===p.length-1,orientation:i(u)?.orientation,isManualGrid:"grid"===f.type&&f.isManualPlacement&&window.__experimentalEnableGridInteractivity}},[e]);return!n||r&&o&&!i||t&&a?null:(0,Er.jsxs)(wv,{className:(0,mh.A)("block-editor-block-mover",{"is-horizontal":"horizontal"===s}),children:[!t&&(0,Er.jsx)(MZ,{clientIds:e,fadeWhenDisabled:!0,children:e=>(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,icon:PK.A,className:"block-editor-block-mover__drag-handle",label:(0,ee.__)("Drag"),tabIndex:"-1",...e})}),!a&&(0,Er.jsxs)("div",{className:"block-editor-block-mover__move-button-container",children:[(0,Er.jsx)(mv.A,{children:t=>(0,Er.jsx)(CZ,{clientIds:e,...t})}),(0,Er.jsx)(mv.A,{children:t=>(0,Er.jsx)(SZ,{clientIds:e,...t})})]})]})};function x2(){const{selectBlock:e}=(0,Vt.A)(Qy),{parentClientId:t}=(0,zt.A)(e=>{const{getBlockParents:t,getSelectedBlockClientId:n,getParentSectionBlock:i}=Gh(e(Qy)),r=n(),o=i(r),s=t(r);return{parentClientId:o??s[s.length-1]}},[]),n=Ej(t),i=(0,T.useRef)(),r=OQ({ref:i,highlightParent:!0});return(0,Er.jsx)("div",{className:"block-editor-block-parent-selector",ref:i,...r,children:(0,Er.jsx)(vv,{className:"block-editor-block-parent-selector__button",onClick:()=>e(t),label:(0,ee.sprintf)((0,ee.__)("Select parent block: %s"),n?.title),showTooltip:!0,icon:(0,Er.jsx)(hj,{icon:n?.icon})})},t)}var{Fill:k2,Slot:w2}=(0,Sv.QJ)("__unstableBlockToolbarLastItem");k2.Slot=w2;var C2=k2,S2=(0,Sv.QJ)(Symbol("CommentIconToolbarSlotFill")),A2=function({clientIds:e,...t}){return(0,Er.jsxs)(wv,{children:[(0,Er.jsx)(S2.Slot,{}),(0,Er.jsx)(mv.A,{children:n=>(0,Er.jsx)(FQ,{clientIds:e,toggleProps:n,...t})})]})};function I2({clientId:e}){const{canLock:t,isLocked:n}=TZ(e),[i,r]=(0,T.useReducer)(e=>!e,!1),o=(0,T.useRef)(!1);if((0,T.useEffect)(()=>{n&&(o.current=!0)},[n]),!n&&!o.current)return null;let s=n?(0,ee.__)("Unlock"):(0,ee.__)("Lock");return!t&&n&&(s=(0,ee.__)("Locked")),(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(wv,{className:"block-editor-block-lock-toolbar",children:(0,Er.jsx)(vv,{disabled:!t,icon:n?yQ.A:gQ.A,label:s,onClick:r,"aria-expanded":i,"aria-haspopup":"dialog"})}),i&&(0,Er.jsx)(xQ,{clientId:e,onClose:r})]})}var E2=n(79616);function j2({clientIds:e}){const t=(0,T.useRef)(!1),{canToggleBlockVisibility:n,areBlocksHiddenAnywhere:i}=(0,zt.A)(t=>{const{getBlocksByClientId:n,getBlockName:i,isBlockHiddenAnywhere:r}=Gh(t(Qy));return{canToggleBlockVisibility:n(e).every(({clientId:e})=>_n(i(e),"visibility",!0)),areBlocksHiddenAnywhere:e?.every(e=>r(e))}},[e]),r=(0,Vt.A)(Qy);if((0,T.useEffect)(()=>{i&&(t.current=!0)},[i]),!i&&!t.current)return null;const{showViewportModal:o}=Gh(r);return(0,Er.jsx)(wv,{className:"block-editor-block-visibility-toolbar",children:(0,Er.jsx)(vv,{disabled:!n,icon:i?IZ.A:E2.A,label:i?(0,ee.__)("Hidden"):(0,ee.__)("Visible"),onClick:()=>o(e),"aria-haspopup":"dialog"})})}var T2=n(66186),B2=n(39415),N2=n(30515),R2=n(25389),O2={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"},grid:{type:"grid"}},L2=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:i}=fQ(),{replaceBlocks:r}=(0,Vt.A)(Qy),{canRemove:o,variations:s}=(0,zt.A)(e=>{const{canRemoveBlocks:i}=e(Qy),{getBlockVariations:r}=e(Zi);return{canRemove:i(t),variations:r(n,"transform")}},[t,n]),a=i=>{const o=ur(e,n);"string"!=typeof i&&(i="group"),o&&o.length>0&&(o[0].attributes.layout=O2[i],r(t,o))};if(!i||!o)return null;const l=!!s.find(({name:e})=>"group-row"===e),c=!!s.find(({name:e})=>"group-stack"===e),u=!!s.find(({name:e})=>"group-grid"===e);return(0,Er.jsxs)(wv,{children:[(0,Er.jsx)(vv,{icon:T2.A,label:(0,ee._x)("Group","action: convert blocks to group"),onClick:a}),l&&(0,Er.jsx)(vv,{icon:B2.A,label:(0,ee._x)("Row","action: convert blocks to row"),onClick:()=>a("row")}),c&&(0,Er.jsx)(vv,{icon:N2.A,label:(0,ee._x)("Stack","action: convert blocks to stack"),onClick:()=>a("stack")}),u&&(0,Er.jsx)(vv,{icon:R2.A,label:(0,ee._x)("Grid","action: convert blocks to grid"),onClick:()=>a("grid")})]})};function M2({clientIds:e}){const t=1===e.length?e[0]:void 0,n=(0,zt.A)(e=>!!t&&"html"===e(Qy).getBlockMode(t),[t]),{toggleBlockMode:i}=(0,Vt.A)(Qy);return n?(0,Er.jsx)(wv,{children:(0,Er.jsx)(vv,{onClick:()=>{i(t)},children:(0,ee.__)("Edit visually")})}):null}function P2(){const e=(0,zt.A)(e=>{const{getBlockEditingMode:t,getBlockName:n,getBlockSelectionStart:i}=e(Qy),r=i(),o=r&&bn(n(r));return o&&_n(o,"__experimentalToolbar",!0)&&"disabled"!==t(r)},[]);return e}var D2=[],F2={placement:"bottom-start"};function z2({clientId:e}){const{categories:t,currentPatternName:n,patterns:i}=(0,zt.A)(t=>{const{getBlockAttributes:n,getBlockRootClientId:i,__experimentalGetAllowedPatterns:r}=t(Qy),o=n(e),s=o?.metadata?.categories||D2,a=i(e),l=s.length>0?r(a):D2;return{categories:s,currentPatternName:o?.metadata?.patternName,patterns:l}},[e]),{replaceBlocks:r}=(0,Vt.A)(Qy),o=(0,T.useMemo)(()=>0!==t.length&&i&&0!==i.length?i.filter(e=>{const i="core"===e.source||e.source?.startsWith("pattern-directory")&&"pattern-directory/theme"!==e.source;return 1===e.blocks.length&&!i&&n!==e.name&&e.categories?.some(e=>t.includes(e))&&("unsynced"===e.syncStatus||!e.id)}).slice(0,6):D2,[t,n,i]);if(o.length<2)return null;const s=n=>{const i=(n.blocks??[]).map(e=>ir(e));i[0].attributes.metadata={...i[0].attributes.metadata,categories:t},r(e,i)};return(0,Er.jsx)(wC.A,{popoverProps:F2,renderToggle:({onToggle:e,isOpen:t})=>(0,Er.jsx)(wv,{children:(0,Er.jsx)(vv,{onClick:()=>e(!t),"aria-expanded":t,children:(0,ee.__)("Change design")})}),renderContent:()=>(0,Er.jsx)(CC.A,{className:"block-editor-block-toolbar-change-design-content-wrapper",paddingSize:"none",children:(0,Er.jsx)(oY,{blockPatterns:o,onClickPattern:s,showTitlesAsTooltip:!0})})})}var V2=(0,Er.jsxs)(AC.t4,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24","aria-hidden":"true",focusable:"false",children:[(0,Er.jsx)(AC.wA,{d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3z"}),(0,Er.jsx)(AC.wA,{stroke:"currentColor",strokeWidth:"1.5",d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3z"})]}),U2=function({clientId:e}){const{stylesToRender:t,activeStyle:n,className:i}=R1({clientId:e}),{updateBlockAttributes:r}=(0,Vt.A)(Qy),{globalSettings:o,globalStyles:s,blockName:a}=(0,zt.A)(t=>{const n=t(Qy).getSettings();return{globalSettings:n.__experimentalFeatures,globalStyles:n[Rh],blockName:t(Qy).getBlockName(e)}},[e]),l=n?.name?pz({settings:o,styles:s},a,n.name)?.color?.background:void 0;return t&&0!==t.length?(0,Er.jsx)(wv,{children:(0,Er.jsx)(vv,{onClick:()=>{const o=t.findIndex(e=>e.name===n.name),s=(o+1)%t.length,a=t[s],l=B1(i,n,a);r(e,{className:l})},label:(0,ee.__)("Shuffle styles"),children:(0,Er.jsx)(IC.A,{icon:V2,style:{fill:l||"transparent"}})})}):null};function $2({clientId:e}){const{isSectionBlock:t,isEditingContentOnlySection:n,editContentOnlySection:i,stopEditingContentOnlySection:r}=y1(e),o=(0,zt.A)(t=>{if(!e)return null;const{getBlockName:n}=t(Qy),i=n(e);return i?{name:i}:null},[e]);if(!e||!t&&!n||xn(o)||kn(o))return null;const s=n;return(0,Er.jsx)(wv,{children:(0,Er.jsx)(vv,{onClick:()=>{s?r():i(e)},children:s?(0,ee.__)("Exit pattern"):(0,ee.__)("Edit pattern")})})}var H2={};function W2({item:e,onSelect:t,setHoveredTransformItemName:n}){const{name:i,icon:r,title:o}=e;return(0,Er.jsxs)(zv.A,{className:Tr(i),onClick:e=>{e.preventDefault(),t(i)},onMouseLeave:()=>n(null),onMouseEnter:()=>n(i),onFocus:()=>n(i),onBlur:()=>n(null),children:[(0,Er.jsx)(hj,{icon:r,showColors:!0}),o]})}var G2=({transformations:e,onSelect:t,blocks:n})=>{const[i,r]=(0,T.useState)();return(0,Er.jsxs)(Er.Fragment,{children:[i&&(0,Er.jsx)(T1,{blocks:ir(n[0],e.find(({name:e})=>e===i).attributes)}),e?.map(e=>(0,Er.jsx)(W2,{item:e,onSelect:t,setHoveredTransformItemName:r},e.name))]})};function q2({restTransformations:e,onSelect:t,setHoveredTransformItemName:n}){return e.map(e=>(0,Er.jsx)(K2,{item:e,onSelect:t,setHoveredTransformItemName:n},e.name))}function K2({item:e,onSelect:t,setHoveredTransformItemName:n}){const{name:i,icon:r,title:o,isDisabled:s}=e;return(0,Er.jsxs)(zv.A,{className:Tr(i),onClick:e=>{e.preventDefault(),t(i)},disabled:s,onMouseLeave:()=>n(null),onMouseEnter:()=>n(i),onFocus:()=>n(i),onBlur:()=>n(null),children:[(0,Er.jsx)(hj,{icon:r,showColors:!0}),o]})}var Y2=({className:e,possibleBlockTransformations:t,possibleBlockVariationTransformations:n,onSelect:i,onSelectVariation:r,blocks:o})=>{const[s,a]=(0,T.useState)(),{priorityTextTransformations:l,restTransformations:c}=function(e){const t={"core/paragraph":1,"core/heading":2,"core/list":3,"core/quote":4},n=(0,T.useMemo)(()=>{const n=Object.keys(t),i=e.reduce((e,t)=>{const{name:i}=t;return n.includes(i)?e.priorityTextTransformations.push(t):e.restTransformations.push(t),e},{priorityTextTransformations:[],restTransformations:[]});if(1===i.priorityTextTransformations.length&&"core/quote"===i.priorityTextTransformations[0].name){const e=i.priorityTextTransformations.pop();i.restTransformations.push(e)}return i},[e]);return n.priorityTextTransformations.sort(({name:e},{name:n})=>t[e]<t[n]?-1:1),n}(t),u=l.length&&c.length,d=!!c.length&&(0,Er.jsx)(q2,{restTransformations:c,onSelect:i,setHoveredTransformItemName:a});return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsxs)(Fv.A,{label:(0,ee.__)("Transform to"),className:e,children:[s&&(0,Er.jsx)(T1,{blocks:ur(o,s)}),!!n?.length&&(0,Er.jsx)(G2,{transformations:n,blocks:o,onSelect:r}),l.map(e=>(0,Er.jsx)(K2,{item:e,onSelect:i,setHoveredTransformItemName:a},e.name)),!u&&d]}),!!u&&(0,Er.jsx)(Fv.A,{className:e,children:d})]})},J2=()=>{};function X2({stylesToRender:e,activeStyle:t,onSelect:n=J2,onHoverStyle:i=J2}){return e&&0!==e.length?(0,Er.jsx)(Er.Fragment,{children:e.map(e=>{const r=e.label||e.name;return(0,Er.jsx)(zv.A,{icon:t.name===e.name?xw.A:null,onClick:()=>n(e),onFocus:()=>i(e),onBlur:()=>i(null),onMouseEnter:()=>i(e),onMouseLeave:()=>i(null),children:(0,Er.jsx)(lj.A,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0,children:r})},e.name)})}):null}function Z2({hoveredBlock:e,onSwitch:t}){const{clientId:n}=e,[i,r]=(0,T.useState)(null),{onSelect:o,stylesToRender:s,activeStyle:a,genericPreviewBlock:l,className:c}=R1({clientId:n,onSwitch:t}),u=(0,T.useMemo)(()=>{if(!i||!l)return null;const e=B1(c,a,i);return[{...l,attributes:{...l.attributes||{},className:e}}]},[i,l,c,a]);return s&&0!==s.length?(0,Er.jsxs)(Fv.A,{label:(0,ee.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup",children:[u&&(0,Er.jsx)(T1,{blocks:u}),(0,Er.jsx)(X2,{stylesToRender:s,activeStyle:a,onSelect:o,onHoverStyle:r})]}):null}var Q2=(e,t,n=new Set)=>{const{clientId:i,name:r,innerBlocks:o=[]}=e;if(!n.has(i)){if(r===t)return e;for(const e of o){const i=Q2(e,t,n);if(i)return i}}},e4=(e,t)=>{const n=((e,t)=>{const n=function(e,t){const n=bn(e)?.attributes;if(!n)return[];const i=Object.keys(n);return t?i.filter(i=>{const r=n[i];return r?.role===t||r?.__experimentalRole===t&&((0,Qt.A)("__experimentalRole attribute",{since:"6.7",version:"6.8",alternative:"role attribute",hint:`Check the block.json of the ${e} block.`}),!0)}):i}(e,"content");return n?.length?n.reduce((e,n)=>(t[n]&&(e[n]=t[n]),e),{}):t})(t.name,t.attributes);e.attributes={...e.attributes,...n}};function t4({patterns:e,onSelect:t}){const n=(0,dw.A)("medium","<");return(0,Er.jsx)("div",{className:"block-editor-block-switcher__popover-preview-container",children:(0,Er.jsx)(uw.Ay,{className:"block-editor-block-switcher__popover-preview",placement:n?"bottom":"right-start",offset:16,children:(0,Er.jsx)("div",{className:"block-editor-block-switcher__preview is-pattern-list-preview",children:(0,Er.jsx)(n4,{patterns:e,onSelect:t})})})})}function n4({patterns:e,onSelect:t}){return(0,Er.jsx)(II.e,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,ee.__)("Patterns list"),children:e.map(e=>(0,Er.jsx)(i4,{pattern:e,onSelect:t},e.name))})}function i4({pattern:e,onSelect:t}){const n="block-editor-block-switcher__preview-patterns-container",i=(0,SS.A)(i4,`${n}-list__item-description`);return(0,Er.jsxs)("div",{className:`${n}-list__list-item`,children:[(0,Er.jsxs)(II.e.Item,{render:(0,Er.jsx)("div",{role:"option","aria-label":e.title,"aria-describedby":e.description?i:void 0,className:`${n}-list__item`}),onClick:()=>t(e.transformedBlocks),children:[(0,Er.jsx)(BK,{blocks:e.transformedBlocks,viewportWidth:e.viewportWidth||500}),(0,Er.jsx)("div",{className:`${n}-list__item-title`,children:e.title})]}),!!e.description&&(0,Er.jsx)(kC.A,{id:i,children:e.description})]})}var r4=function({blocks:e,patterns:t,onSelect:n}){const[i,r]=(0,T.useState)(!1),o=((e,t)=>(0,T.useMemo)(()=>e.reduce((e,n)=>{const i=((e,t)=>{const n=t.map(e=>ir(e)),i=new Set;for(const t of e){let e=!1;for(const r of n){const n=Q2(r,t.name,i);if(n){e=!0,i.add(n.clientId),e4(n,t);break}}if(!e)return}return n})(t,n.blocks);return i&&e.push({...n,transformedBlocks:i}),e},[]),[e,t]))(t,e);return o.length?(0,Er.jsxs)(Fv.A,{className:"block-editor-block-switcher__pattern__transforms__menugroup",children:[i&&(0,Er.jsx)(t4,{patterns:o,onSelect:n}),(0,Er.jsx)(zv.A,{onClick:e=>{e.preventDefault(),r(!i)},icon:Lz.A,children:(0,ee.__)("Patterns")})]}):null};function o4({onClose:e,clientIds:t}){const{replaceBlocks:n,multiSelect:i,updateBlockAttributes:r}=(0,Vt.A)(Qy),{possibleBlockTransformations:o,patterns:s,blocks:a,isUsingBindings:l,canRemove:c,hasBlockStyles:u}=(0,zt.A)(e=>{const{getBlockAttributes:n,getBlocksByClientId:i,getBlockRootClientId:r,getBlockTransformItems:o,__experimentalGetPatternTransformItems:s,canRemoveBlocks:a,getBlockName:l}=e(Qy),{getBlockStyles:c}=e(Zi),u=r(t[0]),d=i(t),h=1===t.length,p=h&&l(t[0]),f=h&&!!c(p)?.length;return{blocks:d,possibleBlockTransformations:o(d,u),patterns:s(d,u),isUsingBindings:t.every(e=>!!n(e)?.metadata?.bindings),canRemove:a(t),hasBlockStyles:f}},[t]),d=function({clientIds:e,blocks:t}){const{activeBlockVariation:n,blockVariationTransformations:i}=(0,zt.A)(n=>{const{getBlockAttributes:i,canRemoveBlocks:r}=n(Qy),{getActiveBlockVariation:o,getBlockVariations:s}=n(Zi),a=r(e);if(1!==t.length||!a)return H2;const[l]=t;return{blockVariationTransformations:s(l.name,"transform"),activeBlockVariation:o(l.name,i(l.clientId))}},[e,t]);return(0,T.useMemo)(()=>i?.filter(({name:e})=>e!==n?.name),[i,n])}({clientIds:t,blocks:a});function h(e){e.length>1&&i(e[0].clientId,e[e.length-1].clientId)}const p=1===a.length,f=p&&(kn(a[0])||xn(a[0])),m=!!o?.length&&c&&!f,g=!!d?.length,b=!!s?.length&&c,y=m||g;if(!(u||y||b))return(0,Er.jsx)("p",{className:"block-editor-block-switcher__no-transforms",children:(0,ee.__)("No transforms.")});const v=p?(0,ee._x)("This block is connected.","block toolbar button label and description"):(0,ee._x)("These blocks are connected.","block toolbar button label and description");return(0,Er.jsxs)("div",{className:"block-editor-block-switcher__container",children:[b&&(0,Er.jsx)(r4,{blocks:a,patterns:s,onSelect:i=>{!function(e){n(t,e),h(e)}(i),e()}}),y&&(0,Er.jsx)(Y2,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:o,possibleBlockVariationTransformations:d,blocks:a,onSelect:i=>{!function(e){const i=ur(a,e);n(t,i),h(i)}(i),e()},onSelectVariation:t=>{!function(e){r(a[0].clientId,{...d.find(({name:t})=>t===e).attributes})}(t),e()}}),u&&(0,Er.jsx)(Z2,{hoveredBlock:a[0],onSwitch:e}),l&&(0,Er.jsx)(Fv.A,{children:(0,Er.jsx)(lj.A,{className:"block-editor-block-switcher__binding-indicator",children:v})})]})}var s4=({children:e,clientIds:t,label:n,text:i})=>{const r=1===t.length?(0,ee.__)("Change block type or style"):(0,ee.sprintf)((0,ee._n)("Change type of %d block","Change type of %d blocks",t.length),t.length);return(0,Er.jsx)(wv,{children:(0,Er.jsx)(mv.A,{children:o=>(0,Er.jsx)(xv.A,{className:"block-editor-block-switcher",label:n,popoverProps:{placement:"bottom-start",className:"block-editor-block-switcher__popover"},icon:e,text:i,toggleProps:{description:r,...o},menuProps:{orientation:"both"},children:({onClose:e})=>(0,Er.jsx)(o4,{onClose:e,clientIds:t})})})})};function a4({clientIds:e,children:t,label:n,text:i}){return(0,Er.jsx)(wv,{children:(0,Er.jsx)(mv.A,{children:r=>(0,Er.jsx)(xv.A,{className:"block-editor-block-switcher",label:n,popoverProps:{placement:"bottom-start",className:"block-editor-block-switcher__popover"},icon:t,text:i,toggleProps:{description:(0,ee.__)("Change block style"),...r},menuProps:{orientation:"both"},children:({onClose:t})=>(0,Er.jsx)("div",{className:"block-editor-block-switcher__container",children:(0,Er.jsx)(Z2,{hoveredBlock:{clientId:e[0]},onSwitch:t})})})})})}function l4({clientIds:e,blockTitle:t}){const n=(0,zt.A)(t=>{const{getBlockAttributes:n}=t(Qy);return n(e?.[0])?.metadata?.name},[e]);let i;return i=1===e.length&&n?(0,ee.sprintf)((0,ee.__)('This %1$s is editable using the "%2$s" override.'),t.toLowerCase(),n):(0,ee.__)("These blocks are editable using overrides."),(0,Er.jsx)(lj.A,{children:i})}function c4({icon:e,clientIds:t,blockTitle:n,label:i}){const[r,o]=(0,T.useState)(!1),s=(0,T.useRef)();return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(vv,{ref:s,className:"block-editor-block-toolbar__pattern-overrides-indicator",icon:e,label:i,onClick:()=>o(!r),"aria-expanded":r}),r&&(0,Er.jsx)(uw.Ay,{anchor:s.current,onClose:()=>o(!1),placement:"bottom-start",offset:16,className:"block-editor-block-toolbar__pattern-overrides-popover",children:(0,Er.jsx)(l4,{clientIds:t,blockTitle:n})})]})}function u4({select:e,clientIds:t}){const{getBlockName:n,getBlockAttributes:i,getBlockParentsByBlockName:r,canRemoveBlocks:o,getTemplateLock:s,getBlockEditingMode:a,canEditBlock:l}=Gh(e(Qy)),{getBlockStyles:c}=e(Zi),u=t.some(e=>"contentOnly"===s(e)),d=1===t.length,h=d&&n(t[0]),p=d&&!!c(h)?.length,f=t.some(e=>!!i(e)?.metadata?.patternName),m=t.every(e=>RU(i(e)?.metadata?.bindings)),g=t.every(e=>r(e,"core/block",!0).length>0),b=o(t),y=t.every(e=>l(e)),v=a(t[0]);return f||"default"!==v||!p&&!b||u||!y?"contentOnly"===v&&p&&!m&&y?"styles-only":m&&g?"pattern-overrides":"default":"switcher"}function d4({select:e,clientIds:t}){const{getBlockName:n,getBlockAttributes:i}=Gh(e(Qy)),r=1===t.length,o=t[0],s=i(o);if(r&&s?.metadata?.patternName)return pp.A;const a=n(o),l=bn(a);if(r){const{getActiveBlockVariation:t}=e(Zi),n=t(a,s);return n?.icon||l?.icon}const c=t.map(e=>n(e));return 1===new Set(c).size?l?.icon:w1.A}function h4({clientIds:e,isSynced:t}){const{icon:n,showIconLabels:i,variant:r}=(0,zt.A)(t=>({icon:d4({select:t,clientIds:e}),showIconLabels:t(Ob.M).get("core","showIconLabels"),variant:u4({select:t,clientIds:e})}),[e]),o=Aj({clientId:e?.[0],maximumLength:35}),s=1===e.length,a=s&&t&&!i,l=s?o:(0,ee.__)("Multiple blocks selected"),c=a&&o?o:void 0,u=(0,Er.jsx)(hj,{className:"block-editor-block-toolbar__block-icon",icon:n});return"switcher"===r?(0,Er.jsx)(s4,{clientIds:e,label:l,text:c,children:u}):"styles-only"===r?(0,Er.jsx)(a4,{clientIds:e,label:l,text:c,children:u}):"pattern-overrides"===r?(0,Er.jsx)(c4,{icon:u,clientIds:e,blockTitle:o,label:l}):(0,Er.jsx)(vv,{disabled:!0,className:"block-editor-block-toolbar__block-icon-button",title:l,icon:u,text:c})}function p4({hideDragHandle:e,focusOnMount:t,__experimentalInitialIndex:n,__experimentalOnIndexChange:i,variant:r="unstyled"}){const{blockClientId:o,blockClientIds:s,isDefaultEditingMode:a,blockType:l,toolbarKey:c,shouldShowVisualToolbar:u,showParentSelector:d,isUsingBindings:h,isSectionContainer:p,hasContentOnlyLocking:f,showShuffleButton:m,showSlots:g,showGroupButtons:b,showLockButtons:y,showBlockVisibilityButton:v,showSwitchSectionStyleButton:_,areSelectedBlocksHiddenOnViewport:x,canEdit:k}=(0,zt.A)(e=>{const{canEditBlock:t}=e(Qy),{getBlockName:n,getBlockMode:i,getBlockParents:r,getSelectedBlockClientIds:o,isBlockValid:s,getBlockEditingMode:a,getBlockAttributes:l,getSettings:c,getTemplateLock:u,getParentSectionBlock:d,isZoomOut:h,isSectionBlock:p,isBlockHiddenAtViewport:f}=Gh(e(Qy)),m=o(),g=m[0],b=r(g),y=d(g)??b[b.length-1],v=bn(n(y)),_=a(g),x="default"===_,k=n(g),w=m.every(e=>s(e)),C=m.every(e=>"visual"===i(e)),S=m.every(e=>!!l(e)?.metadata?.bindings),A=m.some(e=>"contentOnly"===u(e)),I=h(),E=p(g),j=t(g),T=j&&(I||E),B=c()?.[Vh]?.toLowerCase()||"desktop",N=m.length>0&&m.every(e=>f(e,B));return{blockClientId:g,blockClientIds:m,isDefaultEditingMode:x,blockType:g&&bn(k),shouldShowVisualToolbar:w&&C,toolbarKey:`${g}${y}`,showParentSelector:!I&&v&&"contentOnly"!==_&&"disabled"!==a(y)&&_n(v,"__experimentalParentSelector",!0)&&1===m.length,isUsingBindings:S,isSectionContainer:E,hasContentOnlyLocking:A,showShuffleButton:I,showSlots:!I,showGroupButtons:!I,showLockButtons:!I,showBlockVisibilityButton:!I,showSwitchSectionStyleButton:T,areSelectedBlocksHiddenOnViewport:N,canEdit:j}},[]),w=(0,T.useRef)(null),C=(0,T.useRef)(),S=OQ({ref:C}),A=!(0,dw.A)("medium","<");if(!P2())return null;const I=s.length>1,E=xn(l)||kn(l),j=(0,mh.A)("block-editor-block-contextual-toolbar",{"has-parent":d}),B=(0,mh.A)("block-editor-block-toolbar",{"is-synced":E,"is-connected":h});return(0,Er.jsx)(GT,{focusEditorOnEscape:!0,className:j,"aria-label":(0,ee.__)("Block tools"),variant:"toolbar"===r?void 0:r,focusOnMount:t,__experimentalInitialIndex:n,__experimentalOnIndexChange:i,children:(0,Er.jsxs)("div",{ref:w,className:B,children:[d&&!I&&A&&(0,Er.jsx)(x2,{}),(u||I)&&(0,Er.jsx)("div",{ref:C,...S,children:(0,Er.jsxs)(wv,{className:"block-editor-block-toolbar__block-controls",children:[(0,Er.jsx)(h4,{clientIds:s,isSynced:E}),a&&v&&(0,Er.jsx)(j2,{clientIds:s}),!I&&a&&y&&(0,Er.jsx)(I2,{clientId:o}),(0,Er.jsx)(_2,{clientIds:s,hideDragHandle:e})]})}),!x&&!f&&u&&I&&b&&(0,Er.jsx)(L2,{}),!I&&k&&(0,Er.jsx)($2,{clientId:s[0]}),!x&&m&&(0,Er.jsx)(z2,{clientId:s[0]}),!x&&_&&(0,Er.jsx)(U2,{clientId:s[0]}),!x&&u&&g&&(0,Er.jsxs)(Er.Fragment,{children:[!p&&(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(Mv.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,Er.jsx)(Mv.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,Er.jsx)(Mv.Slot,{className:"block-editor-block-toolbar__slot"}),(0,Er.jsx)(Mv.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"})]}),(0,Er.jsx)(Mv.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,Er.jsx)(C2.Slot,{})]}),(0,Er.jsx)(M2,{clientIds:s}),(0,Er.jsx)(A2,{clientIds:s})]})},c)}function f4({clientId:e,isTyping:t,__unstableContentRef:n}){const{capturingClientId:i,isInsertionPointVisible:r,lastClientId:o}=y2(e),s=(0,T.useRef)();(0,T.useEffect)(()=>{s.current=void 0},[e]);const{stopTyping:a}=(0,Vt.A)(Qy),l=(0,T.useRef)(!1);(0,$T.wk)("core/block-editor/focus-toolbar",()=>{l.current=!0,a(!0)}),(0,T.useEffect)(()=>{l.current=!1});const c=i||e,u=b2({contentElement:n?.current,clientId:c});return!t&&(0,Er.jsx)(pD,{clientId:c,bottomClientId:o,className:(0,mh.A)("block-editor-block-list__block-popover",{"is-insertion-point-visible":r}),resize:!1,...u,__unstableContentRef:n,children:(0,Er.jsx)(p4,{focusOnMount:l.current,__experimentalInitialIndex:s.current,__experimentalOnIndexChange:e=>{s.current=e},variant:"toolbar"})})}var m4=function({onClick:e}){return(0,Er.jsx)(fv.Ay,{variant:"primary",icon:kw.A,size:"compact",className:(0,mh.A)("block-editor-button-pattern-inserter__button","block-editor-block-tools__zoom-out-mode-inserter-button"),onClick:e,label:(0,ee._x)("Add pattern","Generic label for pattern inserter button")})},g4=function(){const[e,t]=(0,T.useState)(!1),{hasSelection:n,blockOrder:i,setInserterIsOpened:r,sectionRootClientId:o,selectedBlockClientId:s,blockInsertionPoint:a,insertionPointVisible:l}=(0,zt.A)(e=>{const{getSettings:t,getBlockOrder:n,getSelectionStart:i,getSelectedBlockClientId:r,getSectionRootClientId:o,getBlockInsertionPoint:s,isBlockInsertionPointVisible:a}=Gh(e(Qy)),l=o();return{hasSelection:!!i().clientId,blockOrder:n(l),sectionRootClientId:l,setInserterIsOpened:t().__experimentalSetIsInserterOpened,selectedBlockClientId:r(),blockInsertionPoint:s(),insertionPointVisible:a()}},[]),{showInsertionPoint:c}=Gh((0,Vt.A)(Qy));if((0,T.useEffect)(()=>{const e=setTimeout(()=>{t(!0)},500);return()=>{clearTimeout(e)}},[]),!e||!n)return null;const u=s,d=i.findIndex(e=>s===e)+1,h=i[d];return l&&a?.index===d?null:(0,Er.jsx)(XG,{previousClientId:u,nextClientId:h,children:(0,Er.jsx)(m4,{onClick:()=>{r({rootClientId:o,insertionIndex:d,tab:"patterns",category:"all"}),c(o,d,{operation:"insert"})}})})};if("undefined"!=typeof document&&!document.head.querySelector("style[data-wp-hash='e252bf6889']")){const e=document.createElement("style");e.setAttribute("data-wp-hash","e252bf6889"),e.appendChild(document.createTextNode(".block-editor-block-visibility-modal{z-index:1000001}.block-editor-block-visibility-modal__options{border:0;list-style:none;margin:24px 0;padding:0}.block-editor-block-visibility-modal__options-item{align-items:center;display:flex;gap:24px;justify-content:space-between;margin:0 0 16px}.block-editor-block-visibility-modal__options-item:last-child{margin:0}.block-editor-block-visibility-modal__options-item--everywhere{align-items:start;flex-direction:column}.block-editor-block-visibility-modal__options-checkbox--everywhere{font-weight:600}.block-editor-block-visibility-modal__options-icon--checked{fill:#ddd}.block-editor-block-visibility-modal__sub-options{padding-inline-start:12px;width:100%}.block-editor-block-visibility-modal__description{color:#757575;font-size:12px}.block-editor-block-visibility-info{align-items:center;display:flex;justify-content:start;margin:0 16px 16px;padding-bottom:4px;padding-top:4px}")),document.head.appendChild(e)}var b4={[yp.mobile.key]:!1,[yp.tablet.key]:!1,[yp.desktop.key]:!1},y4=[];function v4({clientIds:e,onClose:t}){const{createSuccessNotice:n}=(0,Vt.A)(Rb.store),{updateBlockAttributes:i}=(0,Vt.A)(Qy),r=(0,zt.A)(t=>t(Qy).getBlocksByClientId(e)??y4,[e]),o=(0,zt.A)(e=>e($T.M_).getShortcutRepresentation("core/editor/toggle-list-view"),[]),s=(0,T.useMemo)(()=>{if(0===r?.length)return{hideEverywhere:!1,viewportChecked:{}};const e={};return vp.forEach(([,{key:t}])=>{e[t]=function(e,t){if(!e?.length)return!1;const n=e.filter(e=>function(e,t){if(!e)return!1;const n=e.attributes?.metadata?.blockVisibility;if(!0===n)return!1;if("object"!=typeof n)return!1;const i=n.viewport;return!(!i||"object"!=typeof i||!vp.some(([,{key:e}])=>e===t)||!1!==i[t])}(e,t)).length;return 0!==n&&(n===e.length||null)}(r,t)}),{hideEverywhere:NZ(r),viewportChecked:e}},[r]),[a,l]=(0,T.useState)(s?.viewportChecked??{}),[c,u]=(0,T.useState)(s?.hideEverywhere??!1),d=(0,T.useCallback)((e,t)=>{l({...a,[e]:t})},[a]),h=(0,T.useMemo)(()=>{if(!c)return(0,ee.sprintf)((0,ee.__)("Block visibility settings updated. You can access them via the List View (%s)."),o);const e=r?.length>1?(0,ee.__)("Blocks hidden. You can access them via the List View (%s)."):(0,ee.__)("Block hidden. You can access it via the List View (%s).");return(0,ee.sprintf)(e,o)},[c,r?.length,o]),p=(0,T.useMemo)(()=>Object.values(a).some(e=>!0===e||null===e),[a]),f=(0,T.useMemo)(()=>c!==s.hideEverywhere||vp.some(([,{key:e}])=>a[e]!==s.viewportChecked[e]),[c,a,s]),m=(0,T.useMemo)(()=>null===c||Object.values(a).some(e=>null===e),[c,a]),g=(0,T.useCallback)(o=>{o.preventDefault();const s=!c&&{viewport:vp.reduce((e,[,{key:t}])=>(a[t]&&(e[t]=!1),e),{})},l=Object.fromEntries(r.map(({clientId:e,attributes:t})=>[e,{metadata:ov({...t?.metadata,blockVisibility:s})}]));i(e,l,{uniqueByBlock:!0}),n(h,{id:c?"block-visibility-hidden":"block-visibility-viewports-updated",type:"snackbar"}),t()},[r,e,n,c,h,t,i,a]),b=r?.length>1;return(0,Er.jsx)(aj.A,{title:e?.length>1?(0,ee.__)("Hide blocks"):(0,ee.__)("Hide block"),onRequestClose:t,overlayClassName:"block-editor-block-visibility-modal",size:"small",children:(0,Er.jsxs)("form",{onSubmit:g,children:[(0,Er.jsxs)("fieldset",{children:[(0,Er.jsx)("legend",{children:b?(0,ee.__)("Select the viewport sizes for which you want to hide the blocks. Changes will apply to all selected blocks."):(0,ee.__)("Select the viewport size for which you want to hide the block.")}),(0,Er.jsx)("ul",{className:"block-editor-block-visibility-modal__options",children:(0,Er.jsxs)("li",{className:"block-editor-block-visibility-modal__options-item block-editor-block-visibility-modal__options-item--everywhere",children:[(0,Er.jsx)(WA.A,{className:"block-editor-block-visibility-modal__options-checkbox--everywhere",label:(0,ee.__)("Omit from published content"),checked:!0===c,indeterminate:null===c,onChange:e=>{u(e),l(b4)}}),!0!==c&&(0,Er.jsx)("ul",{className:"block-editor-block-visibility-modal__sub-options",children:vp.map(([,{label:e,icon:t,key:n}])=>(0,Er.jsxs)("li",{className:"block-editor-block-visibility-modal__options-item",children:[(0,Er.jsx)(WA.A,{label:(0,ee.sprintf)((0,ee.__)("Hide on %s"),e),checked:a[n]??!1,indeterminate:null===a[n],onChange:e=>d(n,e)}),(0,Er.jsx)(IC.A,{icon:t,className:(0,mh.A)({"block-editor-block-visibility-modal__options-icon--checked":a[n]})})]},n))})]})}),b&&m&&(0,Er.jsx)("p",{className:"block-editor-block-visibility-modal__description",children:(0,ee.__)("Selected blocks have different visibility settings. The checkboxes show an indeterminate state when settings differ.")}),!b&&!0===c&&(0,Er.jsx)("p",{className:"block-editor-block-visibility-modal__description",children:(0,ee.sprintf)((0,ee.__)("Block will be hidden in the editor, and omitted from the published markup on the frontend. You can configure it again by selecting it in the List View (%s)."),o)}),!b&&!c&&p&&(0,Er.jsx)("p",{className:"block-editor-block-visibility-modal__description",children:(0,qS.A)((0,ee.sprintf)((0,ee.__)("Block will be hidden according to the selected viewports. It will be <strong>included in the published markup on the frontend</strong>. You can configure it again by selecting it in the List View (%s)."),o),{strong:(0,Er.jsx)("strong",{})})})]}),(0,Er.jsxs)(Kv.A,{className:"block-editor-block-visibility-modal__actions",justify:"flex-end",expanded:!1,children:[(0,Er.jsx)(Yv.A,{children:(0,Er.jsx)(fv.Ay,{variant:"tertiary",onClick:t,__next40pxDefaultSize:!0,children:(0,ee.__)("Cancel")})}),(0,Er.jsx)(Yv.A,{children:(0,Er.jsx)(fv.Ay,{variant:"primary",type:"submit",disabled:!f,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,ee.__)("Apply")})})]})]})})}function _4(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getSettings:i,isTyping:r,isDragging:o,isZoomOut:s,getViewportModalClientIds:a}=Gh(e(Qy));return{clientId:t()||n(),hasFixedToolbar:i().hasFixedToolbar,isTyping:r(),isZoomOutMode:s(),isDragging:o(),viewportModalClientIds:a()}}function x4({children:e,__unstableContentRef:t,...n}){const{clientId:i,hasFixedToolbar:r,isTyping:o,isZoomOutMode:s,isDragging:a,viewportModalClientIds:l}=(0,zt.A)(_4,[]),c=(0,$T.ZK)(),{getBlocksByClientId:u,getSelectedBlockClientIds:d,getBlockRootClientId:h,getBlockEditingMode:p,getBlockName:f,isGroupable:m,getEditedContentOnlySection:g,canEditBlock:b}=Gh((0,zt.A)(Qy)),{getGroupingBlockName:y}=(0,zt.A)(Zi),{showEmptyBlockSideInserter:v,showBlockToolbarPopover:_}=(0,zt.A)(e=>{const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlock:i,getBlockMode:r,getSettings:o,isTyping:s,isBlockInterfaceHidden:a}=Gh(e(Qy)),l=t()||n(),c=i(l),u=!!l&&!!c,d=u&&In(c,"content")&&"html"!==r(l),h=l&&!s()&&d;return{showEmptyBlockSideInserter:h,showBlockToolbarPopover:!a()&&!o().hasFixedToolbar&&!h&&u&&!d}},[]),x=JZ(),[k,w]=(0,T.useState)(null),{canRename:C}=FZ(f(d()[0])),{duplicateBlocks:S,removeBlocks:A,replaceBlocks:I,insertAfterBlock:E,insertBeforeBlock:j,selectBlock:B,moveBlocksUp:N,moveBlocksDown:R,expandBlock:O,stopEditingContentOnlySection:L,showViewportModal:M,hideViewportModal:P}=Gh((0,Vt.A)(Qy)),D=tD(t),F=tD(t);return(0,Er.jsxs)("div",{...n,onKeyDown:function(e){if(!e.defaultPrevented){if(c("core/block-editor/move-up",e)||c("core/block-editor/move-down",e)){const t=d();if(t.length){e.preventDefault();const n=h(t[0]);"up"==(c("core/block-editor/move-up",e)?"up":"down")?N(t,n):R(t,n);const i=Array.isArray(t)?t.length:1,r=(0,ee.sprintf)((0,ee._n)("%d block moved.","%d blocks moved.",t.length),i);(0,dt.L)(r)}}else if(c("core/block-editor/duplicate",e)){const t=d();t.length&&(e.preventDefault(),S(t))}else if(c("core/block-editor/remove",e)){const t=d();t.length&&(e.preventDefault(),A(t))}else if(c("core/block-editor/paste-styles",e)){const t=d();if(t.length){e.preventDefault();const n=u(t);x(n)}}else if(c("core/block-editor/insert-after",e)){const t=d();t.length&&(e.preventDefault(),E(t[t.length-1]))}else if(c("core/block-editor/insert-before",e)){const t=d();t.length&&(e.preventDefault(),j(t[0]))}else if(c("core/block-editor/unselect",e)){if(e.target.closest("[role=toolbar]"))return;const t=d();t.length>1&&(e.preventDefault(),B(t[0]))}else if(c("core/block-editor/collapse-list-view",e)){if(_G(e.target)||_G(e.target?.contentWindow?.document?.activeElement))return;e.preventDefault(),O(i)}else if(c("core/block-editor/group",e)){const t=d();if(t.length>1&&m(t)){e.preventDefault();const n=ur(u(t),y());I(t,n),(0,dt.L)((0,ee.__)("Selected blocks are grouped."))}}else if(c("core/block-editor/rename",e)){const t=d();if(1===t.length){const n="contentOnly"===p(t[0]);C&&!n&&b(t[0])&&(e.preventDefault(),w(t[0]))}}else if(c("core/block-editor/toggle-block-visibility",e)){const t=d();if(t.length){if(e.preventDefault(),!u(t).every(e=>_n(e.name,"visibility",!0)))return;if(t.some(e=>"default"!==p(e)||!b(e)))return;M(t)}}c("core/block-editor/stop-editing-as-blocks",e)&&g()&&L()}},className:(0,mh.A)(n.className,{"block-editor-block-tools--is-dragging":a}),children:[(0,Er.jsxs)(eq.Provider,{value:(0,T.useRef)(!1),children:[!o&&!s&&(0,Er.jsx)(nq,{__unstableContentRef:t}),v&&(0,Er.jsx)(v2,{__unstableContentRef:t,clientId:i}),_&&(0,Er.jsx)(f4,{__unstableContentRef:t,clientId:i,isTyping:o}),!s&&!r&&(0,Er.jsx)(uw.Ay.Slot,{name:"block-toolbar",ref:D}),e,(0,Er.jsx)(uw.Ay.Slot,{name:"__unstable-block-tools-after",ref:F}),s&&!a&&(0,Er.jsx)(g4,{__unstableContentRef:t})]}),k&&(0,Er.jsx)(zZ,{clientId:k,onClose:()=>w(null)}),l&&(0,Er.jsx)(v4,{clientIds:l,onClose:P})]})}var k4=()=>{},w4=(0,T.forwardRef)(function({rootClientId:e,clientId:t,isAppender:n,showInserterHelpPanel:i,showMostUsedBlocks:r=!1,__experimentalInsertionIndex:o,__experimentalInitialTab:s,__experimentalInitialCategory:a,__experimentalFilterValue:l,onPatternCategorySelection:c,onSelect:u=k4,shouldFocusBlock:d=!1,onClose:h},p){const{destinationRootClientId:f}=(0,zt.A)(n=>{const{getBlockRootClientId:i}=n(Qy);return{destinationRootClientId:e||i(t)||void 0}},[t,e]);return(0,Er.jsx)(BJ,{onSelect:u,rootClientId:f,clientId:t,isAppender:n,showInserterHelpPanel:i,showMostUsedBlocks:r,__experimentalInsertionIndex:o,__experimentalFilterValue:l,onPatternCategorySelection:c,__experimentalInitialTab:s,__experimentalInitialCategory:a,shouldFocusBlock:d,ref:p,onClose:h})}),C4=(0,T.forwardRef)(function(e,t){return(0,Er.jsx)(w4,{...e,onPatternCategorySelection:void 0,ref:t})}),S4={button:"wp-element-button",caption:"wp-element-caption"},A4=e=>S4[e]?S4[e]:"";function I4(e,t,n){return"core/image"===e&&n?.lightbox?.allowEditing||!!t?.lightbox}function E4({onChange:e,value:t,inheritedValue:n,panelId:i}){const r=Zw(),o=()=>{e(void 0)};let s=!1;return n?.lightbox?.enabled&&(s=n.lightbox.enabled),(0,Er.jsx)(Er.Fragment,{children:(0,Er.jsx)(Xw,{label:(0,ee._x)("Settings","Image settings"),resetAll:o,panelId:i,dropdownMenuProps:r,children:(0,Er.jsx)(aC,{hasValue:()=>!!t?.lightbox,label:(0,ee.__)("Enlarge on click"),onDeselect:o,isShownByDefault:!0,panelId:i,children:(0,Er.jsx)(Zv.A,{label:(0,ee.__)("Enlarge on click"),checked:s,onChange:t=>{e({enabled:t})}})})})})}function j4({states:e=[],value:t="default",onChange:n}){if(!e||0===e.length)return null;const i=[{label:(0,ee.__)("Default"),value:"default"},...e.map(e=>({label:e.label,value:e.value}))],r=()=>{const e=i.find(e=>e.value===t);return e?.label||(0,ee.__)("Default")};return(0,Er.jsx)(xv.A,{icon:wT.A,label:(0,ee.sprintf)((0,ee.__)("State: %s"),r()),text:r(),toggleProps:{size:"compact",variant:"tertiary",iconPosition:"right"},children:({onClose:e})=>(0,Er.jsx)(Fv.A,{label:(0,ee.__)("State"),children:i.map(i=>(0,Er.jsx)(zv.A,{onClick:()=>{n(i.value),e()},icon:t===i.value?xw.A:null,children:i.label},i.value))})})}function T4(e,t,n){if(null==e||!1===e)return;if(Array.isArray(e))return B4(e,t,n);switch(typeof e){case"string":case"number":return}const{type:i,props:r}=e;switch(i){case T.StrictMode:case T.Fragment:return B4(r.children,t,n);case Sr.A:return;case Sq.Content:return N4(t,n);case JT:return void t.push(r.value)}switch(typeof i){case"string":return void 0!==r.children?B4(r.children,t,n):void 0;case"function":return T4(i.prototype&&"function"==typeof i.prototype.render?new i(r).render():i(r),t,n)}}function B4(e,...t){e=Array.isArray(e)?e:[e];for(let n=0;n<e.length;n++)T4(e[n],...t)}function N4(e,t){for(let n=0;n<t.length;n++){const{name:i,attributes:r,innerBlocks:o}=t[n];T4(Or(i,r,(0,Er.jsx)(Sq.Content,{})),e,o)}}var R4=[{value:"fill",label:(0,ee._x)("Fill","Scale option for dimensions control"),help:(0,ee.__)("Fill the space by stretching the content.")},{value:"contain",label:(0,ee._x)("Contain","Scale option for dimensions control"),help:(0,ee.__)("Fit the content to the space without clipping.")},{value:"cover",label:(0,ee._x)("Cover","Scale option for dimensions control"),help:(0,ee.__)("Fill the space by clipping what doesn't fit.")},{value:"none",label:(0,ee._x)("None","Scale option for dimensions control"),help:(0,ee.__)("Do not adjust the sizing of the content. Content that is too large will be clipped, and content that is too small will have additional padding.")},{value:"scale-down",label:(0,ee._x)("Scale down","Scale option for dimensions control"),help:(0,ee.__)("Scale down the content to fit the space if it is too big. Content that is too small will have additional padding.")}];function O4({panelId:e,value:t,onChange:n,options:i=R4,defaultValue:r=R4[0].value,isShownByDefault:o=!0}){const s=t??"fill",a=(0,T.useMemo)(()=>i.reduce((e,t)=>(e[t.value]=t.help,e),{}),[i]);return(0,Er.jsx)(aC,{label:(0,ee.__)("Scale"),isShownByDefault:o,hasValue:()=>s!==r,onDeselect:()=>n(r),panelId:e,children:(0,Er.jsx)(Jv.A,{label:(0,ee.__)("Scale"),isBlock:!0,help:a[s],value:s,onChange:n,size:"__unstable-large",children:i.map(e=>(0,Er.jsx)(bk.A,{...e},e.value))})})}function L4({panelId:e,value:t={},onChange:n=()=>{},units:i,isShownByDefault:r=!0}){const o="auto"===t.width?"":t.width??"",s="auto"===t.height?"":t.height??"",a=e=>i=>{const r={...t};i?r[e]=i:delete r[e],n(r)};return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(aC,{style:{gridColumn:"span 1"},label:(0,ee.__)("Width"),isShownByDefault:r,hasValue:()=>""!==o,onDeselect:a("width"),panelId:e,children:(0,Er.jsx)(vx,{label:(0,ee.__)("Width"),placeholder:(0,ee.__)("Auto"),labelPosition:"top",units:i,min:0,value:o,onChange:a("width"),size:"__unstable-large"})}),(0,Er.jsx)(aC,{style:{gridColumn:"span 1"},label:(0,ee.__)("Height"),isShownByDefault:r,hasValue:()=>""!==s,onDeselect:a("height"),panelId:e,children:(0,Er.jsx)(vx,{label:(0,ee.__)("Height"),placeholder:(0,ee.__)("Auto"),labelPosition:"top",units:i,min:0,value:s,onChange:a("height"),size:"__unstable-large"})})]})}var M4=[{label:(0,ee._x)("Thumbnail","Image size option for resolution control"),value:"thumbnail"},{label:(0,ee._x)("Medium","Image size option for resolution control"),value:"medium"},{label:(0,ee._x)("Large","Image size option for resolution control"),value:"large"},{label:(0,ee._x)("Full Size","Image size option for resolution control"),value:"full"}],P4=(0,D.combineReducers)({commands:function(e={},t){switch(t.type){case"REGISTER_COMMAND":return{...e,[t.name]:{name:t.name,label:t.label,searchLabel:t.searchLabel,context:t.context,category:t.category,callback:t.callback,icon:t.icon,keywords:t.keywords}};case"UNREGISTER_COMMAND":{const{[t.name]:n,...i}=e;return i}}return e},commandLoaders:function(e={},t){switch(t.type){case"REGISTER_COMMAND_LOADER":return{...e,[t.name]:{name:t.name,context:t.context,category:t.category,hook:t.hook}};case"UNREGISTER_COMMAND_LOADER":{const{[t.name]:n,...i}=e;return i}}return e},isOpen:function(e=!1,t){switch(t.type){case"OPEN":return!0;case"CLOSE":return!1}return e},context:function(e="root",t){return"SET_CONTEXT"===t.type?t.context:e},loaderStates:function(e={},t){return"SET_LOADER_LOADING"===t.type?{...e,[t.name]:t.isLoading}:e}}),D4=new Set(["command","view","edit","action"]);function F4(e){let{category:t}=e;return t&&D4.has(t)||(t="action"),{type:"REGISTER_COMMAND",...e,category:t}}function z4(e){return{type:"UNREGISTER_COMMAND",name:e}}function V4(e){let{category:t}=e;return t&&D4.has(t)||(t="action"),{type:"REGISTER_COMMAND_LOADER",...e,category:t}}function U4(e){return{type:"UNREGISTER_COMMAND_LOADER",name:e}}function $4(){return{type:"OPEN"}}function H4(){return{type:"CLOSE"}}var W4=(0,ce.A)((e,t=!1)=>Object.values(e.commands).filter(n=>{const i=n.context&&n.context===e.context;return t?i:!i}),e=>[e.commands,e.context]),G4=(0,ce.A)((e,t=!1)=>Object.values(e.commandLoaders).filter(n=>{const i=n.context&&n.context===e.context;return t?i:!i}),e=>[e.commandLoaders,e.context]);function q4(e){return e.isOpen}function K4(e){return e.context}function Y4(e){return{type:"SET_CONTEXT",context:e}}function J4(e,t){return{type:"SET_LOADER_LOADING",name:e,isLoading:t}}function X4(e){return Object.values(e.loaderStates).some(Boolean)}var{lock:Z4,unlock:Q4}=(0,pt.yf)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/commands"),e5=(0,P.A)("core/commands",{reducer:P4,actions:y,selectors:v});(0,D.register)(e5),Q4(e5).registerPrivateActions(_),Q4(e5).registerPrivateSelectors(x);var{withIgnoreIMEEvents:t5}=Q4(Ev.j);function n5(e){const{registerCommandLoader:t,unregisterCommandLoader:n}=(0,Vt.A)(e5);(0,T.useEffect)(()=>{if(!e.disabled)return t({name:e.name,hook:e.hook,context:e.context,category:e.category}),()=>{n(e.name)}},[e.name,e.hook,e.context,e.category,e.disabled,t,n])}(0,ee.__)("Search commands and settings"),Gv.A,(0,ee.__)("Command"),(0,ee.__)("View"),(0,ee.__)("Edit"),(0,ee.__)("Action"),(0,ee.__)("Workflow"),Z4({},{useCommandContext:function(e){const{getContext:t}=(0,zt.A)(e5),n=(0,T.useRef)(t()),{setContext:i}=Q4((0,Vt.A)(e5));(0,T.useEffect)(()=>{i(e)},[e,i]),(0,T.useEffect)(()=>{const e=n.current;return()=>i(e)},[i])}});var i5=n(82865),r5=n(35513),o5=()=>function(){const{replaceBlocks:e,multiSelect:t}=(0,Vt.A)(Qy),{blocks:n,clientIds:i,canRemove:r,possibleBlockTransformations:o,invalidSelection:s}=(0,zt.A)(e=>{const{getBlockRootClientId:t,getBlockTransformItems:n,getSelectedBlockClientIds:i,getBlocksByClientId:r,canRemoveBlocks:o}=e(Qy),s=i(),a=r(s);return a.filter(e=>!e).length>0?{invalidSelection:!0}:{blocks:a,clientIds:s,possibleBlockTransformations:n(a,t(s[0])),canRemove:o(s),invalidSelection:!1}},[]);if(s)return{isLoading:!1,commands:[]};const a=1===n.length&&kn(n[0]);const l=!!o.length&&r&&!a;if(!i||i.length<1||!l)return{isLoading:!1,commands:[]};const c=o.map(r=>{const{name:o,title:s,icon:a}=r,l=a?.src&&"block-default"!==a?.src?a:{src:dj.A};return{name:"core/block-editor/transform-to-"+o.replace("/","-"),label:(0,ee.sprintf)((0,ee.__)("Transform to %s"),s),icon:l?.src,category:"command",callback:({close:r})=>{(function(r){const o=ur(n,r);var s;e(i,o),(s=o).length>1&&t(s[0].clientId,s[s.length-1].clientId)})(o),r()}}});return{isLoading:!1,commands:c}},s5=(0,Sv.QJ)(Symbol("BlockCanvasCover"));function a5({children:e}){return(0,Er.jsx)("div",{className:"block-canvas-cover",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none"},children:e})}var l5={ignoredSelectors:[/\.editor-styles-wrapper/gi]};var c5=n(88674),u5=n(52470),d5=n(99952);function h5({title:e,help:t,actions:n=[],onClose:i}){return(0,Er.jsxs)(Q_.A,{className:"block-editor-inspector-popover-header",spacing:4,children:[(0,Er.jsxs)(Cw.A,{alignment:"center",children:[(0,Er.jsx)(Sw.A,{className:"block-editor-inspector-popover-header__heading",level:2,size:13,children:e}),(0,Er.jsx)($I.A,{}),n.map(({label:e,icon:t,onClick:n})=>(0,Er.jsx)(fv.Ay,{size:"small",className:"block-editor-inspector-popover-header__action",label:e,icon:t,variant:!t&&"tertiary",onClick:n,children:!t&&e},e)),i&&(0,Er.jsx)(fv.Ay,{size:"small",className:"block-editor-inspector-popover-header__action",label:(0,ee.__)("Close"),icon:AJ.A,onClick:i})]}),t&&(0,Er.jsx)(lj.A,{children:t})]})}var p5=(0,T.forwardRef)(function({onClose:e,onChange:t,showPopoverHeaderActions:n,isCompact:i,currentDate:r,title:o,...s},a){const l={startOfWeek:(0,d5.getSettings)().l10n.startOfWeek,onChange:t,currentDate:i?void 0:r,currentTime:i?r:void 0,...s},c=i?c5.h:u5.Ay;return(0,Er.jsxs)("div",{ref:a,className:"block-editor-publish-date-time-picker",children:[(0,Er.jsx)(h5,{title:o||(0,ee.__)("Publish"),actions:n?[{label:(0,ee.__)("Now"),onClick:()=>t?.(null)}]:void 0,onClose:e}),(0,Er.jsx)(c,{...l})]})});(0,T.forwardRef)(function(e,t){return(0,Er.jsx)(p5,{...e,showPopoverHeaderActions:!0,isCompact:!1,ref:t})});var f5={a:(0,ee.__)("The <a> element should be used for links that navigate to a different page or to a different section within the same page."),article:(0,ee.__)("The <article> element should represent a self-contained, syndicatable portion of the document."),aside:(0,ee.__)("The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."),button:(0,ee.__)("The <button> element should be used for interactive controls that perform an action on the current page, such as opening a modal or toggling content visibility."),div:(0,ee.__)("The <div> element should only be used if the block is a design element with no semantic meaning."),footer:(0,ee.__)("The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.)."),header:(0,ee.__)("The <header> element should represent introductory content, typically a group of introductory or navigational aids."),main:(0,ee.__)("The <main> element should be used for the primary content of your document only."),nav:(0,ee.__)("The <nav> element should be used to identify groups of links that are intended to be used for website or page content navigation."),section:(0,ee.__)("The <section> element should represent a standalone portion of the document that can't be better represented by another element.")},{Badge:m5}=Gh(Ev.j);function g5({title:e,url:t,image:n,badges:i}){return(0,Er.jsxs)(Cw.A,{justify:"space-between",alignment:"top",children:[(0,Er.jsx)(Yv.A,{className:"link-preview-button__content",children:(0,Er.jsxs)(Cw.A,{alignment:"top",children:[n&&(0,Er.jsx)(Yv.A,{className:"link-preview-button__image-container",children:(0,Er.jsx)("img",{className:"link-preview-button__image",src:n,alt:""})}),(0,Er.jsxs)(Q_.A,{className:"link-preview-button__details",alignment:"topLeft",children:[(0,Er.jsx)(xC.A,{numberOfLines:1,className:"link-preview-button__title",children:ae(e)}),t&&(0,Er.jsx)(xC.A,{numberOfLines:1,className:"link-preview-button__hint",children:t}),i&&i.length>0&&(0,Er.jsx)(Cw.A,{className:"link-preview-button__badges",alignment:"left",children:i.map(e=>(0,Er.jsx)(m5,{intent:e.intent,children:e.label},`${e.label}|${e.intent}`))})]})]})}),(0,Er.jsx)(xx.A,{icon:wT.A,className:"link-preview-button__icon"})]})}var b5={};Wh(b5,{...b,ExperimentalBlockCanvas:function({shouldIframe:e=!0,height:t="300px",children:n=(0,Er.jsx)(Mq,{}),styles:i,contentRef:r,iframeProps:o}){n5({name:"core/block-editor/blockTransforms",hook:o5()}),n5({name:"core/block-editor/blockQuickActions",hook:function(){const{clientIds:e,isUngroupable:t,isGroupable:n}=(0,zt.A)(e=>{const{getSelectedBlockClientIds:t,isUngroupable:n,isGroupable:i}=e(Qy);return{clientIds:t(),isUngroupable:n(),isGroupable:i()}},[]),{canInsertBlockType:i,getBlockRootClientId:r,getBlocksByClientId:o,canRemoveBlocks:s,isBlockHiddenAnywhere:a}=Gh((0,zt.A)(Qy)),{getBlockEditingMode:l}=(0,zt.A)(Qy),{getDefaultBlockName:c,getGroupingBlockName:u}=(0,zt.A)(Zi),d=o(e),h=(0,Vt.A)(Qy),{removeBlocks:p,replaceBlocks:f,duplicateBlocks:m,insertAfterBlock:g,insertBeforeBlock:b}=h;if(!e||e.length<1)return{isLoading:!1,commands:[]};const{showViewportModal:y}=Gh(h),v=r(e[0]),_=i(c(),v),x=d.every(e=>!!e&&_n(e.name,"multiple",!0)&&i(e.name,v)),k=s(e),w=[];x&&w.push({name:"duplicate",label:(0,ee.__)("Duplicate"),callback:()=>m(e,!0),icon:w1.A}),_&&w.push({name:"add-before",label:(0,ee.__)("Add before"),callback:()=>{const t=Array.isArray(e)?e[0]:t;b(t)},icon:kw.A},{name:"add-after",label:(0,ee.__)("Add after"),callback:()=>{const t=Array.isArray(e)?e[e.length-1]:t;g(t)},icon:kw.A}),n&&w.push({name:"Group",label:(0,ee.__)("Group"),callback:()=>{if(!d.length)return;const t=u(),n=ur(d,t);n&&f(e,n)},icon:T2.A}),t&&w.push({name:"ungroup",label:(0,ee.__)("Ungroup"),callback:()=>{if(!d.length)return;const t=d[0].innerBlocks;t.length&&f(e,t)},icon:i5.A}),k&&w.push({name:"remove",label:(0,ee.__)("Delete"),callback:()=>p(e,!0),icon:r5.A});const C=d.every(e=>!!e&&_n(e.name,"visibility",!0)),S=e.every(e=>"default"===l(e));if(C&&S){const t=e.some(e=>a(e));w.push({name:"toggle-visibility",label:t?(0,ee.__)("Show"):(0,ee.__)("Hide"),callback:()=>y(e),icon:t?E2.A:IZ.A})}return{isLoading:!1,commands:w.map(e=>({...e,name:"core/block-editor/action-"+e.name,category:"command",callback:({close:t})=>{e.callback(),t()}}))}},context:"block-selection-edit"});const s=(0,dw.A)("medium","<"),a=Iq(),l=rq(),c=(0,T.useRef)(),u=(0,gt.A)([r,l,c]),d=(0,zt.A)(e=>Gh(e(Qy)).getZoomLevel(),[]),h=100===d||s?{}:{scale:d,frameSize:"40px"};return e?(0,Er.jsx)(x4,{__unstableContentRef:c,style:{height:t,display:"flex"},children:(0,Er.jsxs)(vK,{...o,...h,ref:a,contentRef:u,style:{...o?.style},name:"editor-canvas",children:[(0,Er.jsx)(s5.Slot,{fillProps:{containerRef:c},children:e=>e.map((e,t)=>(0,Er.jsx)(a5,{children:e},t))}),(0,Er.jsx)(xK,{styles:i}),n]})}):(0,Er.jsxs)(x4,{__unstableContentRef:c,style:{height:t,display:"flex"},children:[(0,Er.jsx)(s5.Slot,{fillProps:{containerRef:c},children:e=>e.map((e,t)=>(0,Er.jsx)(a5,{children:e},t))}),(0,Er.jsx)(xK,{styles:i,scope:":where(.editor-styles-wrapper)",transformOptions:l5}),(0,Er.jsx)(dK,{ref:u,className:"editor-styles-wrapper",tabIndex:-1,style:{height:"100%",width:"100%",overflow:"auto"},children:n})]})},BlockCanvasCover:s5,ExperimentalBlockEditorProvider:kU,getDuotoneFilter:JD,getRichTextValues:function(e=[]){Rr.skipFilters=!0;const t=[];return N4(t,e),Rr.skipFilters=!1,t.map(e=>e instanceof He?e:He.fromHTMLString(e))},PrivateQuickInserter:RJ,extractWords:dT,getNormalizedSearchTerms:pT,normalizeString:hT,PrivateListView:VQ,ResizableBoxPopover:function({clientId:e,resizableBoxProps:t,...n}){return(0,Er.jsx)(mD,{clientId:e,__unstablePopoverSlot:"block-toolbar",...n,children:(0,Er.jsx)(RX,{...t})})},InspectorControlsLastItem:r2,useHasBlockToolbar:P2,cleanEmptyObject:ov,usePrivateStyleOverride:uv,BlockQuickNavigation:Y1,LayoutStyle:function({layout:e={},css:t,...n}){const i=Sk(e.type),[r]=tv("spacing.blockGap"),o=null!==r;if(i){if(t)return(0,Er.jsx)("style",{children:t});const r=i.getLayoutStyle?.({hasBlockGapSupport:o,layout:e,...n});if(r)return(0,Er.jsx)("style",{children:r})}return null},BlockManager:mj,BlockRemovalWarningModal:function({rules:e}){const[t,n]=(0,T.useState)(!1),{clientIds:i,selectPrevious:r,message:o}=(0,zt.A)(e=>Gh(e(Qy)).getRemovalPromptData()),{clearBlockRemovalPrompt:s,setBlockRemovalRules:a,privateRemoveBlocks:l}=Gh((0,Vt.A)(Qy));if((0,T.useEffect)(()=>(a(e),()=>{a()}),[e,a]),(0,T.useEffect)(()=>{n(!1)},[i]),!o)return;const c="object"==typeof o&&null!==o,u=c?o.description:o,d=c&&o.requireConfirmation,h=d&&!t;return(0,Er.jsx)(aj.A,{title:(0,ee.__)("Confirm deletion"),onRequestClose:s,size:"medium",children:(0,Er.jsxs)(Q_.A,{spacing:4,children:[(0,Er.jsxs)("div",{children:[(0,Er.jsx)("p",{children:u}),c&&(o.warning||o.subtext)&&(0,Er.jsxs)("p",{children:[o.warning&&(0,Er.jsx)("strong",{children:o.warning}),o.warning&&o.subtext&&" ",o.subtext]})]}),d&&(0,Er.jsx)(WA.A,{label:(0,ee.__)("I understand the consequences"),checked:t,onChange:n}),(0,Er.jsxs)(Cw.A,{justify:"right",children:[(0,Er.jsx)(fv.Ay,{variant:"tertiary",onClick:s,__next40pxDefaultSize:!0,children:(0,ee.__)("Cancel")}),(0,Er.jsx)(fv.Ay,{variant:"primary",onClick:()=>{l(i,r,!0),s()},disabled:h,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,ee.__)("Delete")})]})]})})},useLayoutClasses:vz,useLayoutStyles:function(e={},t,n){const{layout:i={},style:r={}}=e,o=i?.inherit||i?.contentSize||i?.wideSize?{...i,type:"constrained"}:i||{},s=Sk(o?.type||"default"),[a]=tv("spacing.blockGap"),l=null!==a;return s?.getLayoutStyle?.({blockName:t,selector:n,layout:i,style:r,hasBlockGapSupport:l})},DimensionsTool:function({panelId:e,value:t={},onChange:n=()=>{},aspectRatioOptions:i,defaultAspectRatio:r="auto",scaleOptions:o,defaultScale:s="fill",unitsOptions:a,tools:l=["aspectRatio","widthHeight","scale"]}){const c=void 0===t.width||"auto"===t.width?null:t.width,u=void 0===t.height||"auto"===t.height?null:t.height,d=void 0===t.aspectRatio||"auto"===t.aspectRatio?null:t.aspectRatio,h=void 0===t.scale||"fill"===t.scale?null:t.scale,[p,f]=(0,T.useState)(h),[m,g]=(0,T.useState)(d),b=c&&u?"custom":m,y=d||c&&u;return(0,Er.jsxs)(Er.Fragment,{children:[l.includes("aspectRatio")&&(0,Er.jsx)(LP,{panelId:e,options:i,defaultValue:r,value:b,onChange:e=>{const i={...t};g(e="auto"===e?null:e),e?i.aspectRatio=e:delete i.aspectRatio,e?p?i.scale=p:(i.scale=s,f(s)):delete i.scale,"custom"!==e&&c&&u&&delete i.height,n(i)}}),l.includes("widthHeight")&&(0,Er.jsx)(L4,{panelId:e,units:a,value:{width:c,height:u},onChange:({width:e,height:i})=>{const r={...t};i="auto"===i?null:i,(e="auto"===e?null:e)?r.width=e:delete r.width,i?r.height=i:delete r.height,e&&i?delete r.aspectRatio:m&&(r.aspectRatio=m),m||!!e==!!i?p?r.scale=p:(r.scale=s,f(s)):delete r.scale,n(r)}}),l.includes("scale")&&y&&(0,Er.jsx)(O4,{panelId:e,options:o,defaultValue:s,value:p,onChange:e=>{const i={...t};f(e="fill"===e?null:e),e?i.scale=e:delete i.scale,n(i)}})]})},ResolutionTool:function({panelId:e,value:t,onChange:n,options:i=M4,defaultValue:r=M4[0].value,isShownByDefault:o=!0,resetAllFilter:s}){const a=t??r;return(0,Er.jsx)(aC,{hasValue:()=>a!==r,label:(0,ee.__)("Resolution"),onDeselect:()=>n(r),isShownByDefault:o,panelId:e,resetAllFilter:s,children:(0,Er.jsx)(oE.A,{label:(0,ee.__)("Resolution"),value:a,options:i,onChange:n,help:(0,ee.__)("Select the size of the source image."),size:"__unstable-large"})})},TabbedSidebar:EJ,TextAlignmentControl:wL,usesContextKey:Vj,useFlashEditableBlocks:PG,HTMLElementControl:function({tagName:e,onChange:t,clientId:n,options:i=[{label:(0,ee.__)("Default (<div>)"),value:"div"},{label:"<header>",value:"header"},{label:"<main>",value:"main"},{label:"<section>",value:"section"},{label:"<article>",value:"article"},{label:"<aside>",value:"aside"},{label:"<footer>",value:"footer"}]}){const r=!!n&&i.some(e=>"main"===e.value),o=(0,zt.A)(e=>{if(!r)return!1;const{getClientIdsWithDescendants:t,getBlockAttributes:i}=e(Qy);return t().some(e=>e!==n&&"main"===i(e)?.tagName)},[n,r]),s=i.map(t=>"main"===t.value&&o&&"main"!==e?{...t,disabled:!0,label:(0,ee.sprintf)((0,ee.__)("%s (Already in use)"),t.label)}:t);return(0,Er.jsxs)(Q_.A,{spacing:2,className:"block-editor-html-element-control",children:[(0,Er.jsx)(oE.A,{__next40pxDefaultSize:!0,label:(0,ee.__)("HTML element"),options:s,value:e,onChange:t,help:f5[e]}),"main"===e&&o&&(0,Er.jsx)(wS.A,{status:"warning",isDismissible:!1,children:(0,ee.__)("Multiple <main> elements detected. The duplicate may be in your content or template. This is not valid HTML and may cause accessibility issues. Please change this HTML element.")})]})},useZoomOut:jJ,globalStylesDataKey:Rh,globalStylesLinksDataKey:Oh,selectBlockPatternsKey:Lh,requiresWrapperOnCopy:aK,PrivateRichText:rB,PrivateInserterLibrary:w4,reusableBlocksSelectKey:Mh,PrivateBlockPopover:pD,PrivatePublishDateTimePicker:p5,useSpacingSizes:bP,useBlockDisplayTitle:Aj,BlockStyleVariationOverridesWithConfig:function({config:e}){const{overrides:t}=(0,zt.A)(e=>({overrides:Gh(e(Qy)).getStyleOverrides()}),[]),{getBlockName:n}=(0,zt.A)(Qy),i=(0,T.useMemo)(()=>{if(!t?.length)return;const i=[],r=[];for(const[,o]of t)if(o?.variation&&o?.clientId&&!r.includes(o.clientId)){const t=n(o.clientId),s=e?.styles?.blocks?.[t]?.variations?.[o.variation];if(s){const n={settings:e?.settings,styles:{blocks:{[t]:{variations:{[`${o.variation}-${o.clientId}`]:s}}}}},a=EF(yn(),o.clientId),l=IF(n,a,!1,!0,!0,!0,{blockGap:!1,blockStyles:!0,layoutStyles:!1,marginReset:!1,presets:!1,rootPadding:!1,variationStyles:!0});i.push({id:`${o.variation}-${o.clientId}`,css:l,__unstableType:"variation",variation:o.variation,clientId:o.clientId}),r.push(o.clientId)}}return i},[e,t,n]);return i&&i.length?(0,Er.jsx)(Er.Fragment,{children:i.map(e=>(0,Er.jsx)(hz,{override:e},e.id))}):null},setBackgroundStyleDefaults:nj,sectionRootClientIdKey:Ph,CommentIconSlotFill:cQ,CommentIconToolbarSlotFill:S2,mediaEditKey:Dh,getMediaSelectKey:Fh,deviceTypeKey:Vh,isIsolatedEditorKey:zh,isNavigationOverlayContextKey:Uh,isNavigationPostEditorKey:$h,mediaUploadOnSuccessKey:Hh,useBlockElement:BO,useBlockElementRef:TO,LinkPicker:function({preview:e,onSelect:t,suggestionsQuery:n,label:i,help:r}){const[o,s]=(0,T.useState)(!1),a=(0,T.useId)(),l=`link-picker-title-${a}`,c=`link-picker-description-${a}`,u=(0,T.useRef)(null),{baseControlProps:d,controlProps:h}=(0,Nj.Y)({help:r});return(0,Er.jsxs)(mk.Ay,{...d,children:[(0,Er.jsx)(mk.Ay.VisualLabel,{children:i}),(0,Er.jsxs)(fv.Ay,{ref:u,onClick:()=>s(!o),"aria-haspopup":"dialog","aria-expanded":o,"aria-describedby":h["aria-describedby"],variant:"secondary",__next40pxDefaultSize:!0,className:"link-preview-button",children:[i&&(0,Er.jsxs)(kC.A,{children:[i,":"]}),(0,Er.jsx)(g5,{title:e.title||(0,ee.__)("Add link"),url:e.url,image:e.image,badges:e.badges})]}),o&&(0,Er.jsx)(uw.Ay,{anchor:u.current,onClose:()=>s(!1),placement:"left-start",offset:36,shift:!0,children:(0,Er.jsxs)("div",{role:"dialog","aria-labelledby":l,"aria-describedby":c,children:[(0,Er.jsxs)(kC.A,{children:[(0,Er.jsx)("h2",{id:l,children:(0,ee.__)("Select a link")}),(0,Er.jsx)("p",{id:c,children:(0,ee.__)("Search for and add a link to the navigation item.")})]}),(0,Er.jsx)(tI,{value:null,onChange:e=>{if(s(!1),e){const n={url:e.url,kind:e.kind,type:e.type,id:e.id,title:e.title};t(n)}},suggestionsQuery:n,showInitialSuggestions:!0,forceIsEditingLink:!0,settings:[]})]})})]})},useRemoteUrlData:UA,PrivateBlockContext:Bj,useListViewPanelState:$Q,isHashLink:CA,isRelativePath:SA});class y5 extends pa{constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{const e=Ql();null!==this.getLocalState()&&15e3<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const t=[];this.meta.forEach((n,i)=>{i!==this.clientID&&3e4<=e-n.lastUpdated&&this.states.has(i)&&t.push(i)}),t.length>0&&v5(this,t,"timeout")},fa(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),i=void 0===n?0:n.clock+1,r=this.states.get(t);null===e?this.states.delete(t):this.states.set(t,e),this.meta.set(t,{clock:i,lastUpdated:Ql()});const o=[],s=[],a=[],l=[];null===e?l.push(t):null==r?null!=e&&o.push(t):(s.push(t),Ll(r,e)||a.push(t)),(o.length>0||a.length>0||l.length>0)&&this.emit("change",[{added:o,updated:a,removed:l},"local"]),this.emit("update",[{added:o,updated:s,removed:l},"local"])}setLocalStateField(e,t){const n=this.getLocalState();null!==n&&this.setLocalState({...n,[e]:t})}getStates(){return this.states}}const v5=(e,t,n)=>{const i=[];for(let n=0;n<t.length;n++){const r=t[n];if(e.states.has(r)){if(e.states.delete(r),r===e.clientID){const t=e.meta.get(r);e.meta.set(r,{clock:t.clock+1,lastUpdated:Ql()})}i.push(r)}}i.length>0&&(e.emit("change",[{added:[],updated:[],removed:i},n]),e.emit("update",[{added:[],updated:[],removed:i},n]))};function _5(){const e=window.navigator.userAgent;let t="Unknown";return e.includes("Firefox")?t="Firefox":e.includes("Edg")?t="Microsoft Edge":e.includes("Chrome")&&!e.includes("Edg")?t="Chrome":e.includes("Safari")&&!e.includes("Chrome")?t="Safari":e.includes("MSIE")||e.includes("Trident")?t="Internet Explorer":(e.includes("Opera")||e.includes("OPR"))&&(t="Opera"),t}function x5(e){return Object.keys(e)}var k5=class extends y5{getStates(){return super.getStates()}getLocalStateField(e){return n=e,"object"==typeof(t=this.getLocalState())&&null!==t&&n in t?t[n]:null;var t,n}setLocalStateField(e,t){super.setLocalStateField(e,t)}},w5=class extends k5{setLocalStateField(e,t){this.isFieldEqual(e,t,this.getLocalStateField(e)??void 0)||super.setLocalStateField(e,t)}isFieldEqual(e,t,n){if(["clientId","isConnected","isMe"].includes(e))return t===n;if(e in this.equalityFieldChecks)return(0,this.equalityFieldChecks[e])(t,n);throw new Error(`No equality check implemented for awareness state field "${e.toString()}".`)}isStateEqual(e,t){return[...new Set([...x5(e),...x5(t)])].every(n=>{const i=e[n],r=t[n];return this.isFieldEqual(n,i,r)})}},C5=class extends w5{hasSetupRun=!1;disconnectedCollaborators=new Set;seenStates=new Map;previousSnapshot=new Map;stateSubscriptions=[];myThrottledState={};throttleTimeouts=new Map;setUp=()=>{this.hasSetupRun||(this.hasSetupRun=!0,this.onSetUp(),this.on("change",({added:e,removed:t,updated:n})=>{[...e,...n].forEach(e=>{this.disconnectedCollaborators.delete(e)}),t.forEach(e=>{this.disconnectedCollaborators.add(e),setTimeout(()=>{this.disconnectedCollaborators.delete(e),this.updateSubscribers(!0)},5e3)}),this.updateSubscribers()}))};getCurrentState(){return Array.from(this.previousSnapshot.values())}getSeenStates(){return this.seenStates}onStateChange(e){return this.stateSubscriptions.push(e),()=>{this.stateSubscriptions=this.stateSubscriptions.filter(t=>t!==e)}}setThrottledLocalStateField(e,t,n){this.setLocalStateField(e,t),this.throttleTimeouts.set(e,setTimeout(()=>{this.throttleTimeouts.delete(e),this.myThrottledState[e]&&(this.setLocalStateField(e,this.myThrottledState[e]),delete this.myThrottledState[e])},n))}setConnectionStatus(e){e?this.disconnectedCollaborators.delete(this.clientID):this.disconnectedCollaborators.add(this.clientID),this.updateSubscribers(!0)}updateSubscribers(e=!1){if(!this.stateSubscriptions.length)return;const t=this.getStates();this.seenStates=new Map([...this.seenStates.entries(),...t.entries()]);const n=new Map([...this.disconnectedCollaborators,...t.keys()].filter(e=>Object.keys(this.seenStates.get(e)??{}).length>0).map(e=>{const t=this.seenStates.get(e),n=!this.disconnectedCollaborators.has(e),i=e===this.clientID;return[e,{...t,...i?this.myThrottledState:{},clientId:e,isConnected:n,isMe:i}]}));!e&&function(e,t,n){if(e.size!==t.size)return!1;for(const[i,r]of e.entries()){if(!t.has(i))return!1;if(!n(r,t.get(i)))return!1}return!0}(this.previousSnapshot,n,this.isStateEqual.bind(this))||(this.previousSnapshot=n,this.stateSubscriptions.forEach(e=>{e(Array.from(n.values()))}))}},S5="core",A5=class extends C5{onSetUp(){this.setCurrentCollaboratorInfo()}async setCurrentCollaboratorInfo(){const e=function(e){const{avatar_urls:t,id:n,name:i,slug:r}=e;return{avatar_urls:t,browserType:_5(),enteredAt:Date.now(),id:n,name:i,slug:r}}(await(0,D.resolveSelect)(S5).getCurrentUser());this.setLocalStateField("collaboratorInfo",e)}},I5={collaboratorInfo:function(e,t){return e&&t?Object.keys(e).length===Object.keys(t).length&&Object.entries(e).every(([e,n])=>n===t[e]):e===t}},E5=class extends A5{equalityFieldChecks=I5};function j5(e){const t=[];let n=e;for(;n;){const e=n.parent;if(!(e&&e instanceof hd))return null;let i=-1;for(let t=0;t<e.length;t++)if(e.get(t)===n){i=t;break}if(-1===i)return null;t.unshift(i);const r=e.parent;if(!(r instanceof fd&&void 0!==r.get("clientId")))break;n=r}return t}function T5(e){if(0===e.length)return null;const{getBlocks:t}=(0,xe.L)(Qy);let n=function(e,t){const n=B5(e,"core/post-content");return n?t(n.clientId):e}(t(),t);for(let t=0;t<e.length;t++){const i=n[e[t]];if(!i)return null;if(t===e.length-1)return i.clientId;n=i.innerBlocks}return null}function B5(e,t){for(const n of e){if(n.name===t)return n;if(n.innerBlocks?.length){const e=B5(n.innerBlocks,t);if(e)return e}}return null}var N5="fromPersistence",R5="document",O5="state",L5="savedAt",M5="gutenberg",P5="syncManager",D5=(e=>(e.AUTHENTICATION_FAILED="authentication-failed",e.CONNECTION_EXPIRED="connection-expired",e.CONNECTION_LIMIT_EXCEEDED="connection-limit-exceeded",e.DOCUMENT_SIZE_LIMIT_EXCEEDED="document-size-limit-exceeded",e.UNKNOWN_ERROR="unknown-error",e))(D5||{}),F5=class extends Error{constructor(e="unknown-error",t){super(t),this.code=e,this.name="ConnectionError"}},{lock:z5,unlock:V5}=(0,pt.yf)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/sync");function U5(e){return function(...t){const n=performance.now(),i=e.apply(this,t),r=performance.now();return console.log(`[SyncManager][performance]: ${e.name} took ${(r-n).toFixed(2)} ms`),i}}function $5(e){return(...t)=>e(...t)}const H5=(e,t)=>{Ma(e,0);const n=(e=>((e,t=new Oc)=>(e instanceof Map?zc(t,e):((e,t)=>{zc(e,cu(t.store))})(t,e),t.toUint8Array()))(e,new Nc))(t);Ua(e,n)},W5=(e,t,n,i)=>{try{((e,t,n)=>{Pc(e,t,n,jc)})(t,ol(e),n)}catch(e){null!=i&&i(e),console.error("Caught error while handling a Yjs update",e)}},G5=W5,q5=(e,t,n,i,r)=>{const o=al(e);switch(o){case 0:((e,t,n)=>{((e,t,n)=>{Ma(e,1),Ua(e,((e,t)=>Dc(e,t,new Rc))(t,n))})(t,n,ol(e))})(e,t,n);break;case 1:W5(e,n,i,r);break;case 2:G5(e,n,i,r);break;default:throw new Error("Unknown message type")}return o};var K5=[2e3,4e3,8e3,12e3],Y5=[1e3,2e3,4e3,8e3],J5=1048576,X5=(0,Ei.W5)("sync.pollingManager.pollingInterval",4e3),Z5=(0,Ei.W5)("sync.pollingManager.pollingIntervalWithCollaborators",1e3),Q5=(e=>(e.COMPACTION="compaction",e.SYNC_STEP_1="sync_step1",e.SYNC_STEP_2="sync_step2",e.UPDATE="update",e))(Q5||{}),e3="/wp-sync/v1/updates";function t3(e){let t="";const n=e.byteLength;for(let i=0;i<n;i++)t+=String.fromCharCode(e[i]);return globalThis.btoa(t)}function n3(e){const t=globalThis.atob(e),n=t.length,i=new Uint8Array(n);for(let e=0;e<n;e++)i[e]=t.charCodeAt(e);return i}function i3(e,t){return{data:t3(e),type:t}}function r3(e){0!==e.rooms.length&&(0,N.default)({method:"POST",path:e3,data:e,keepalive:!0}).catch(()=>{})}var o3="polling-manager",s3=new Map;function a3(e){const t=Na();return H5(t,e),i3(Ra(t),Q5.SYNC_STEP_1)}var l3=!1,c3=0,u3=!1,d3=!1,h3=!1,p3="visible"===document.visibilityState,f3=!1,m3=!1,g3=X5,b3=null;function y3(){m3=!0}function v3(){r3({rooms:Array.from(s3.entries()).map(([e,t])=>({after:0,awareness:null,client_id:t.clientId,room:e,updates:[]}))})}function _3(){const e=p3;(p3="visible"===document.visibilityState)&&!e&&b3&&(clearTimeout(b3),b3=null,x3())}function x3(){f3=!0,b3=null,async function(){if(0===s3.size)return void(f3=!1);m3=!1,s3.forEach(e=>{e.onStatusChange({status:"connecting"})});const e={rooms:Array.from(s3.entries()).map(([e,t])=>({after:t.endCursor??0,awareness:t.localAwarenessState,client_id:t.clientId,room:e,updates:t.updateQueue.get()}))};try{const{rooms:t}=await function(e){return(0,N.default)({method:"POST",path:e3,data:e})}(e);c3=0,d3=!1,s3.forEach(e=>{e.onStatusChange({status:"connected"})}),h3=!1,t.forEach(e=>{if(!s3.has(e.room))return;const t=s3.get(e.room);if(t.endCursor=e.end_cursor,function(e,t){if(!t.isPrimaryRoom||u3)return!1;u3=!0;const n=(0,Ei.W5)("sync.pollingProvider.maxClientsPerRoom",3,t.room),i=Object.keys(e).length,r=function(e){const t=parseInt(String(e),10);return isNaN(t)?3:t}(n);return i>r&&(t.log("Connection limit exceeded",{clientCount:i,maxClientsPerRoom:r,room:t.room}),!0)}(e.awareness,t))return t.onStatusChange({status:"disconnected",error:new F5(D5.CONNECTION_LIMIT_EXCEEDED,"Connection limit exceeded")}),void k3(e.room);t.processAwarenessUpdate(e.awareness),t.isPrimaryRoom&&Object.keys(e.awareness).length>1&&(h3=!0,s3.forEach(e=>{e.updateQueue.resume()}));const n=[];for(const i of e.updates)try{const e=t.processDocUpdate(i);e&&n.push(e)}catch(e){t.log("Failed to apply sync update",{error:e,update:i},"error",!0)}t.updateQueue.addBulk(n),e.should_compact?(t.log("Server requested compaction update"),t.updateQueue.clear(),t.updateQueue.add(t.createCompactionUpdate())):e.compaction_request&&(t.log("Server requested (old) compaction update"),t.updateQueue.add(function(e){const t=e.filter(e=>[Q5.COMPACTION,Q5.UPDATE].includes(e.type)).map(e=>n3(e.data));return i3(Nu(t),Q5.COMPACTION)}(e.compaction_request)))}),g3=p3&&h3?Z5:p3?X5:25e3}catch(t){if(function(e){return 403===e?.data?.status}(t)){if(function(e,t){const n=function(e,t){const n="string"==typeof e.message?e.message:"",i=[...t].sort((e,t)=>t.length-e.length);for(const e of i)if(n.includes(e))return e;return null}(e,t.map(e=>e.room));if(n){const i=s3.get(n);i&&(i.log("Permission denied, unregistering room",{error:e},"error",!0),k3(n,{sendDisconnectSignal:!1}));for(const e of t){if(e.room===n||!s3.has(e.room))continue;const t=s3.get(e.room);e.updates.length>0&&t.updateQueue.restore(e.updates)}}else{const t=[...s3.keys()];for(const n of t){const t=s3.get(n);t&&(t.log("Permission denied, unregistering room",{error:e},"error",!0),k3(n,{sendDisconnectSignal:!1}))}}}(t,e.rooms),0===s3.size)return void(f3=!1)}else{c3++;const n=h3?Y5:K5;g3=c3<=n.length?n[c3-1]:3e4,d3&&(g3=15e3,d3=!1);for(const n of e.rooms){if(!s3.has(n.room))continue;const e=s3.get(n.room);n.updates.length>0&&e.endCursor>0?(e.updateQueue.clear(),e.updateQueue.add(e.createCompactionUpdate())):n.updates.length>0&&e.updateQueue.restore(n.updates),e.log("Error posting sync update, will retry with backoff",{error:t,nextPoll:g3},"error",!0)}if(!m3){const e=c3>n.length;s3.forEach(t=>{t.onStatusChange({status:"disconnected",canManuallyRetry:!0,consecutiveFailures:c3,backgroundRetriesFailed:e,willAutoRetryInMs:g3})})}}}b3=setTimeout(x3,g3)}()}function k3(e,{sendDisconnectSignal:t=!0}={}){const n=s3.get(e);n&&(t&&r3({rooms:[{after:0,awareness:null,client_id:n.clientId,room:e,updates:[]}]}),n.unregister(),s3.delete(e)),0===s3.size&&l3&&(window.removeEventListener("beforeunload",y3),window.removeEventListener("pagehide",v3),document.removeEventListener("visibilitychange",_3),l3=!1,u3=!1,c3=0)}var w3={registerRoom:function({room:e,doc:t,awareness:n,log:i,onSync:r,onStatusChange:o}){if(s3.has(e))return;const s=function(e=[],t=!0){let n=t;const i=[...e];return{add(e){i.push(e)},addBulk(e){0!==e.length&&i.push(...e)},clear(){i.splice(0,i.length)},get:()=>n?[]:i.splice(0,i.length),pause(){n=!0},restore(e){const t=e.filter(e=>e.type!==Q5.COMPACTION);0!==t.length&&i.unshift(...t)},resume(){n=!1},size:()=>i.length}}([a3(t)]),a=0===s3.size;function l(){u.localAwarenessState=n.getLocalState()??{}}function c(t,n){if(o3!==n){if(t.byteLength>J5){const n=s3.get(e);if(!n)return;n.log("Document size limit exceeded",{maxUpdateSizeInBytes:J5,updateSizeInBytes:t.byteLength}),n.onStatusChange({status:"disconnected",error:new F5(D5.DOCUMENT_SIZE_LIMIT_EXCEEDED,"Document size limit exceeded")}),k3(e)}s.add(i3(t,Q5.UPDATE))}}const u={clientId:t.clientID,createCompactionUpdate:()=>i3(Dc(t),Q5.COMPACTION),endCursor:0,isPrimaryRoom:a,localAwarenessState:n.getLocalState()??{},log:i,onStatusChange:o,processAwarenessUpdate:e=>function(e,t){const n=t.getStates(),i=new Set,r=new Set,o=new Set(Array.from(n.keys()).filter(t=>!e[t]));Object.entries(e).forEach(([e,s])=>{const a=Number(e);if(a===t.clientID)return;if(null===s)return n.delete(a),void o.add(a);if(!n.has(a))return n.set(a,s),void i.add(a);const l=n.get(a);JSON.stringify(l)!==JSON.stringify(s)&&(n.set(a,s),r.add(a))}),i.size+r.size>0&&t.emit("change",[{added:Array.from(i),updated:Array.from(r),removed:[]}]),o.size>0&&v5(t,Array.from(o),o3)}(e,n),processDocUpdate:e=>function(e,t,n){const i=n3(e.data);switch(e.type){case Q5.SYNC_STEP_1:return function(e,t){const n=rl(t),i=Na();return q5(n,i,e,o3),i3(Ra(i),Q5.SYNC_STEP_2)}(t,i);case Q5.SYNC_STEP_2:{const e=rl(i),r=Na();return q5(e,r,t,o3),void n()}case Q5.COMPACTION:case Q5.UPDATE:Pc(t,i,o3)}}(e,t,r),room:e,unregister:function(){t.off("updateV2",c),n.off("change",l),s.clear()},updateQueue:s};t.on("updateV2",c),n.on("change",l),s3.set(e,u),l3||(window.addEventListener("beforeunload",y3),window.addEventListener("pagehide",v3),document.addEventListener("visibilitychange",_3),l3=!0),f3||x3()},retryNow:function(){d3=!0,b3&&(clearTimeout(b3),b3=null,x3())},unregisterRoom:k3},C3=class extends ha{constructor(e){super(),this.options=e,this.log("Initializing",{room:e.room}),this.awareness=e.awareness??new y5(e.ydoc),this.connect()}awareness;status="disconnected";synced=!1;connect(){this.log("Connecting"),w3.registerRoom({room:this.options.room,doc:this.options.ydoc,awareness:this.awareness,log:this.log,onStatusChange:this.emitStatus,onSync:this.onSync})}destroy(){this.disconnect(),super.destroy()}disconnect(){this.log("Disconnecting"),w3.unregisterRoom(this.options.room),this.emitStatus({status:"disconnected"})}emitStatus=e=>{const{status:t}=e,n="disconnected"===t?e.error:void 0;(this.status!==t||n)&&("connecting"===t&&"disconnected"!==this.status||(this.log("Status change",{status:t,error:n}),this.status=t,this.emit("status",[e])))};log=(e,t={},n="log",i=!1)=>{(this.options.debug||i)&&(console[n]||console.log)(`[${this.constructor.name}]: ${e}`,{room:this.options.room,...t})};onSync=()=>{this.synced||(this.synced=!0,this.log("Synced"))}},S3=null;function A3(e){return"function"==typeof e}function I3(){if(S3)return S3;if(!window._wpCollaborationEnabled)return[];const e=(0,Ei.W5)("sync.providers",[async({awareness:e,objectType:t,objectId:n,ydoc:i})=>{const r=new C3({awareness:e,room:n?`${t}:${n}`:t,ydoc:i});return{destroy:()=>r.destroy(),on:(e,t)=>{r.on(e,t)}}}]);return S3=Array.isArray(e)?e.filter(A3):[]}var E3=(e,t)=>{const n="undo"===t?e.undoStack:e.redoStack;for(;n.length>0;){const e=n.pop(),i="undo"===t?e.undoStack:e.redoStack,r=i.pop();let o=!1;if("undo"===t?(e.undoStack=[r],o=null!==e.undo(),e.undoStack=i):(e.redoStack=[r],o=null!==e.redo(),e.redoStack=i),o)return r}return null},j3=class extends pa{constructor(e=[],t={}){super(),this.docs=new Map,this.trackedOrigins=t.trackedOrigins||new Set([null]),t.trackedOrigins=this.trackedOrigins,this._defaultOpts=t,this.undoStack=[],this.redoStack=[],this.addToScope(e)}addToScope(e){(e=da(e)?e:[e]).forEach(e=>{const t=e.doc,n=sa(this.docs,t,()=>{const n=new Iu([e],this._defaultOpts);return n.on("stack-cleared",({undoStackCleared:e,redoStackCleared:t})=>{this.clear(e,t)}),t.on("destroy",()=>{this.docs.delete(t),this.undoStack=this.undoStack.filter(e=>e.doc!==t),this.redoStack=this.redoStack.filter(e=>e.doc!==t)}),n.on("stack-item-added",e=>{("undo"===e.type?this.undoStack:this.redoStack).push(n),this.emit("stack-item-added",[{...e,ydoc:t},this])}),n.on("stack-item-updated",e=>{this.emit("stack-item-updated",[{...e,ydoc:t},this])}),n.on("stack-item-popped",e=>{this.emit("stack-item-popped",[{...e,ydoc:t},this])}),n});n.scope.every(t=>t!==e)&&n.scope.push(e)})}addTrackedOrigin(e){this.trackedOrigins.add(e)}removeTrackedOrigin(e){this.trackedOrigins.delete(e)}undo(){return E3(this,"undo")}redo(){return E3(this,"redo")}clear(e=!0,t=!0){(e&&this.canUndo()||t&&this.canRedo())&&(this.docs.forEach(n=>{e&&(this.undoStack=[]),t&&(this.redoStack=[]),n.clear(e,t)}),this.emit("stack-cleared",[{undoStackCleared:e,redoStackCleared:t}]))}stopCapturing(){this.docs.forEach(e=>{e.stopCapturing()})}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.docs.forEach(e=>e.destroy()),super.destroy()}};function T3(e={}){const t=new Map(Object.entries(e));return new Ic({meta:t})}function B3(e){e.getMap(O5).set("version",1)}function N3(e){const t=e.getMap(O5);t.set(L5,Date.now()),t.set("savedBy",e.clientID)}function R3(){return Math.floor(1e9*Math.random())}function O3(e,t){return`${e}_${t}`}class L3{diff(e,t,n={}){let i;"function"==typeof n?(i=n,n={}):"callback"in n&&(i=n.callback);const r=this.castInput(e,n),o=this.castInput(t,n),s=this.removeEmpty(this.tokenize(r,n)),a=this.removeEmpty(this.tokenize(o,n));return this.diffWithOptionsObj(s,a,n,i)}diffWithOptionsObj(e,t,n,i){var r;const o=e=>(e=this.postProcess(e,n),i?void setTimeout(function(){i(e)},0):e),s=t.length,a=e.length;let l=1,c=s+a;null!=n.maxEditLength&&(c=Math.min(c,n.maxEditLength));const u=null!==(r=n.timeout)&&void 0!==r?r:1/0,d=Date.now()+u,h=[{oldPos:-1,lastComponent:void 0}];let p=this.extractCommon(h[0],t,e,0,n);if(h[0].oldPos+1>=a&&p+1>=s)return o(this.buildValues(h[0].lastComponent,t,e));let f=-1/0,m=1/0;const g=()=>{for(let i=Math.max(f,-l);i<=Math.min(m,l);i+=2){let r;const l=h[i-1],c=h[i+1];l&&(h[i-1]=void 0);let u=!1;if(c){const e=c.oldPos-i;u=c&&0<=e&&e<s}const d=l&&l.oldPos+1<a;if(u||d){if(r=!d||u&&l.oldPos<c.oldPos?this.addToPath(c,!0,!1,0,n):this.addToPath(l,!1,!0,1,n),p=this.extractCommon(r,t,e,i,n),r.oldPos+1>=a&&p+1>=s)return o(this.buildValues(r.lastComponent,t,e))||!0;h[i]=r,r.oldPos+1>=a&&(m=Math.min(m,i-1)),p+1>=s&&(f=Math.max(f,i+1))}else h[i]=void 0}l++};if(i)!function e(){setTimeout(function(){if(l>c||Date.now()>d)return i(void 0);g()||e()},0)}();else for(;l<=c&&Date.now()<=d;){const e=g();if(e)return e}}addToPath(e,t,n,i,r){const o=e.lastComponent;return o&&!r.oneChangePerToken&&o.added===t&&o.removed===n?{oldPos:e.oldPos+i,lastComponent:{count:o.count+1,added:t,removed:n,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+i,lastComponent:{count:1,added:t,removed:n,previousComponent:o}}}extractCommon(e,t,n,i,r){const o=t.length,s=n.length;let a=e.oldPos,l=a-i,c=0;for(;l+1<o&&a+1<s&&this.equals(n[a+1],t[l+1],r);)l++,a++,c++,r.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return c&&!r.oneChangePerToken&&(e.lastComponent={count:c,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=a,l}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){const t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join("")}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){const i=[];let r;for(;e;)i.push(e),r=e.previousComponent,delete e.previousComponent,e=r;i.reverse();const o=i.length;let s=0,a=0,l=0;for(;s<o;s++){const e=i[s];if(e.removed)e.value=this.join(n.slice(l,l+e.count)),l+=e.count;else{if(!e.added&&this.useLongestToken){let i=t.slice(a,a+e.count);i=i.map(function(e,t){const i=n[l+t];return i.length>e.length?i:e}),e.value=this.join(i)}else e.value=this.join(t.slice(a,a+e.count));a+=e.count,e.added||(l+=e.count)}}return i}}const M3=new class extends L3{};function P3(e,t,n){return M3.diff(e,t,n)}const D3=new class extends L3{constructor(){super(...arguments),this.tokenize=F3}equals(e,t,n){return n.ignoreWhitespace?(n.newlineIsToken&&e.includes("\n")||(e=e.trim()),n.newlineIsToken&&t.includes("\n")||(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith("\n")&&(e=e.slice(0,-1)),t.endsWith("\n")&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function F3(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,"\n"));const n=[],i=e.split(/(\n|\r\n)/);i[i.length-1]||i.pop();for(let e=0;e<i.length;e++){const r=i[e];e%2&&!t.newlineIsToken?n[n.length-1]+=r:n.push(r)}return n}var z3,V3;(V3=z3||(z3={})).compose=function(e={},t={},n=!1){"object"!=typeof e&&(e={}),"object"!=typeof t&&(t={});let i=function(e){return JSON.parse(JSON.stringify(e))}(t);n||(i=Object.keys(i).reduce((e,t)=>(null===i[t]&&void 0===i[t]||(e[t]=i[t]),e),{}));for(const n in e)void 0!==e[n]&&void 0===t[n]&&(i[n]=e[n]);return Object.keys(i).length>0?i:void 0},V3.diff=function(e={},t={}){"object"!=typeof e&&(e={}),"object"!=typeof t&&(t={});const n=Object.keys(e).concat(Object.keys(t)).reduce((n,i)=>(F(e[i],t[i])||(n[i]=void 0===t[i]?null:t[i]),n),{});return Object.keys(n).length>0?n:void 0},V3.invert=function(e={},t={}){e=e||{};const n=Object.keys(t).reduce((n,i)=>(t[i]!==e[i]&&void 0!==e[i]&&(n[i]=t[i]),n),{});return Object.keys(e).reduce((n,i)=>(e[i]!==t[i]&&void 0===t[i]&&(n[i]=null),n),n)},V3.transform=function(e,t,n=!1){if("object"!=typeof e)return t;if("object"!=typeof t)return;if(!n)return t;const i=Object.keys(t).reduce((n,i)=>(void 0===e[i]&&(n[i]=t[i]),n),{});return Object.keys(i).length>0?i:void 0};var U3,$3=z3;(U3||(U3={})).length=function(e){return"number"==typeof e.delete?e.delete:"number"==typeof e.retain?e.retain:"object"==typeof e.retain&&null!==e.retain?1:"string"==typeof e.insert?e.insert.length:1};var H3=U3,W3=class{ops;index;offset;constructor(e){this.ops=e,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(e){e||(e=1/0);const t=this.ops[this.index];if(t){const n=this.offset,i=H3.length(t);if(e>=i-n?(e=i-n,this.index+=1,this.offset=0):this.offset+=e,"number"==typeof t.delete)return{delete:e};const r={};return t.attributes&&(r.attributes=t.attributes),"number"==typeof t.retain?r.retain=e:"object"==typeof t.retain&&null!==t.retain?r.retain=t.retain:"string"==typeof t.insert?r.insert=t.insert.substr(n,e):r.insert=t.insert,r}return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?H3.length(this.ops[this.index])-this.offset:1/0}peekType(){const e=this.ops[this.index];return e?"number"==typeof e.delete?"delete":"number"==typeof e.retain||"object"==typeof e.retain&&null!==e.retain?"retain":"insert":"retain"}rest(){if(!this.hasNext())return[];if(0===this.offset)return this.ops.slice(this.index);const e=this.offset,t=this.index,n=this.next(),i=this.ops.slice(this.index);return this.offset=e,this.index=t,[n].concat(i)}},G3=String.fromCharCode(0);function q3(e){return e.map(e=>({...e,count:e.value.length}))}var K3=(e,t)=>{if("object"!=typeof e||null===e)throw new Error("cannot retain a "+typeof e);if("object"!=typeof t||null===t)throw new Error("cannot retain a "+typeof t);const n=Object.keys(e)[0];if(!n||n!==Object.keys(t)[0])throw new Error(`embed types not matched: ${n} != ${Object.keys(t)[0]}`);return[n,e[n],t[n]]},Y3={};z5(Y3,{ConnectionErrorCode:D5,createSyncManager:function(e=!1){const t=e?U5:$5,n=new Map,i=new Map;let r;function o(t,n,i,r={}){e&&console.log(`[SyncManager][${t}]: ${n}`,{...r,entityId:i})}function s(e,t,s,a,l={}){const{isSave:c=!1,isNewUndoLevel:u=!1}=l,d=O3(e,t),h=i.get(d),p=n.get(e);if(h){const{syncConfig:e,ydoc:t}=h;u&&r&&r.stopCapturing?.(),t.transact(()=>{o("updateCRDTDoc","applying changes",d,{changedKeys:Object.keys(s)}),e.applyChangesToCRDTDoc(t,s),c&&N3(t)},a)}p&&c&&p.ydoc.transact(()=>{N3(p.ydoc)},a)}const a={applyPersistedCrdtDoc:t(function(e,t,n){const r=O3(e,t),s=i.get(r);if(!s)return void o("applyPersistedCrdtDoc","no entity state",r);const{handlers:a,syncConfig:{applyChangesToCRDTDoc:l,getChangesFromCRDTDoc:c,getPersistedCRDTDoc:u},ydoc:d}=s,h=u?.(n),p=h?function(e){try{const{document:t}=JSON.parse(e),n=T3({[N5]:!0}),i=ql(t);return Pc(n,i),n.clientID=R3(),n}catch{return null}}(h):null;if(!p)return o("applyPersistedCrdtDoc","no persisted doc",r),void d.transact(()=>{l(d,n),a.persistCRDTDoc()},P5);const f=Dc(p);Pc(d,f);const m=c(p,n),g=Object.keys(m);if(p.destroy(),0===g.length)return void o("applyPersistedCrdtDoc","valid persisted doc",r);o("applyPersistedCrdtDoc","invalidated keys",r,{invalidatedKeys:g});const b=g.reduce((e,t)=>Object.assign(e,{[t]:n[t]}),{});d.transact(()=>{l(d,b),a.persistCRDTDoc()},P5)}),updateEntityRecord:t(async function(e,t){const n=O3(e,t),r=i.get(n);if(!r)return void o("updateEntityRecord","no entity state",n);const{handlers:s,syncConfig:a,ydoc:l}=r,c=a.getChangesFromCRDTDoc(l,await s.getEditedRecord()),u=Object.keys(c);0!==u.length&&(o("updateEntityRecord","changes",n,{changedKeys:u}),s.editRecord(c))})};return{createPersistedCRDTDoc:t(async function(e,t){const n=O3(e,t),r=i.get(n);return r?.ydoc?(await new Promise(e=>setTimeout(e,0)),o=r.ydoc,JSON.stringify({document:Gl(Dc(o)),updateId:R3()})):null;var o}),getAwareness:function(e,t){const n=O3(e,t),r=i.get(n);if(r&&r.awareness)return r.awareness},load:t(async function(e,n,s,l,c){const u=I3(),d=O3(n,s);if(0===u.length)return void o("loadEntity","no providers, skipping",d);if(i.has(d))return void o("loadEntity","already loaded",d);if(!1===e.shouldSync?.(n,s))return void o("loadEntity","shouldSync false, skipping",d);o("loadEntity","loading",d),c={addUndoMeta:t(c.addUndoMeta),editRecord:t(c.editRecord),getEditedRecord:t(c.getEditedRecord),onStatusChange:t(c.onStatusChange),persistCRDTDoc:t(c.persistCRDTDoc),refetchRecord:t(c.refetchRecord),restoreUndoMeta:t(c.restoreUndoMeta)};const h=T3({objectType:n}),p=h.getMap(R5),f=h.getMap(O5),m=Date.now(),g=e.createAwareness?.(h,s),b=(e,t)=>{(!t.local||t.origin instanceof Iu)&&a.updateEntityRecord(n,s)},y=(e,t)=>{t.local||e.keysChanged.forEach(e=>{if(e===L5){const e=f.get(L5);"number"==typeof e&&e>m&&(o("loadEntity","refetching record",d),c.refetchRecord().catch(()=>{}))}})};r||(r=function(){const e=new j3([],{captureTimeout:500,trackedOrigins:new Set([M5])});return{addRecord(e,t=!1){},addToScope(t,n){if(null===t.doc)return;const i=t.doc;e.addToScope(t);const{addUndoMeta:r,restoreUndoMeta:o}=n;e.on("stack-item-added",e=>{r(i,e.stackItem.meta)}),e.on("stack-item-popped",e=>{o(i,e.stackItem.meta)})},undo(){if(e.canUndo())return e.undo(),[]},redo(){if(e.canRedo())return e.redo(),[]},hasUndo:()=>e.canUndo(),hasRedo:()=>e.canRedo(),stopCapturing(){e.stopCapturing()}}}());const{addUndoMeta:v,restoreUndoMeta:_}=c;r.addToScope(p,{addUndoMeta:v,restoreUndoMeta:_});const x={awareness:g,handlers:c,objectId:s,objectType:n,syncConfig:e,unload:()=>{o("loadEntity","unloading",d),k.forEach(e=>e.destroy()),c.onStatusChange(null),p.unobserveDeep(b),f.unobserve(y),h.destroy(),i.delete(d)},ydoc:h};i.set(d,x),o("loadEntity","connecting",d);const k=await Promise.all(u.map(async e=>{const t=await e({objectType:n,objectId:s,ydoc:h,awareness:g});return t.on("status",c.onStatusChange),t}));p.observeDeep(b),f.observe(y),B3(h),a.applyPersistedCrdtDoc(n,s,l)}),loadCollection:t(async function(e,t,i){const r=I3(),s=O3(t,null);if(0===r.length)return void o("loadCollection","no providers, skipping",s);if(n.has(t))return void o("loadCollection","already loaded",s);if(!1===e.shouldSync?.(t,null))return void o("loadCollection","shouldSync false, skipping",s);o("loadCollection","loading",s);const a=T3({collection:!0,objectType:t}),l=a.getMap(O5),c=Date.now(),u=(e,t)=>{t.local||e.keysChanged.forEach(e=>{if(e===L5){const e=l.get(L5);"number"==typeof e&&e>c&&i.refetchRecords().catch(()=>{})}})},d=e.createAwareness?.(a),h={awareness:d,handlers:i,syncConfig:e,unload:()=>{o("loadCollection","unloading",s),p.forEach(e=>e.destroy()),i.onStatusChange(null),l.unobserve(u),a.destroy(),n.delete(t)},ydoc:a};n.set(t,h),o("loadCollection","connecting",s);const p=await Promise.all(r.map(async e=>{const n=await e({awareness:d,objectType:t,objectId:null,ydoc:a});return n.on("status",i.onStatusChange),n}));l.observe(u),B3(a)}),get undoManager(){return r},unload:t(function(e,t){const n=O3(e,t);o("unloadEntity","unloading",n),i.get(n)?.unload(),s(e,null,{},origin,{isSave:!0})}),update:t((l=s,function(...e){setTimeout(()=>{l.apply(this,e)},0)}))};var l},Delta:class e{static Op=H3;static OpIterator=W3;static AttributeMap=$3;static handlers={};static registerEmbed(e,t){this.handlers[e]=t}static unregisterEmbed(e){delete this.handlers[e]}static getHandler(e){const t=this.handlers[e];if(!t)throw new Error(`no handlers for embed type "${e}"`);return t}ops;constructor(e){Array.isArray(e)?this.ops=e:null!=e&&Array.isArray(e.ops)?this.ops=e.ops:this.ops=[]}insert(e,t){const n={};return"string"==typeof e&&0===e.length?this:(n.insert=e,null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n))}delete(e){return e<=0?this:this.push({delete:e})}retain(e,t){if("number"==typeof e&&e<=0)return this;const n={retain:e};return null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n)}push(e){let t=this.ops.length,n=this.ops[t-1];if(e=function(e){return JSON.parse(JSON.stringify(e))}(e),"object"==typeof n){if("number"==typeof e.delete&&"number"==typeof n.delete)return this.ops[t-1]={delete:n.delete+e.delete},this;if("number"==typeof n.delete&&null!==e.insert&&void 0!==e.insert&&(t-=1,n=this.ops[t-1],"object"!=typeof n))return this.ops.unshift(e),this;if(F(e.attributes,n.attributes)){if("string"==typeof e.insert&&"string"==typeof n.insert)return this.ops[t-1]={insert:n.insert+e.insert},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this;if("number"==typeof e.retain&&"number"==typeof n.retain)return this.ops[t-1]={retain:n.retain+e.retain},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this}}return t===this.ops.length?this.ops.push(e):this.ops.splice(t,0,e),this}chop(){const e=this.ops[this.ops.length-1];return e&&"number"==typeof e.retain&&!e.attributes&&this.ops.pop(),this}filter(e){return this.ops.filter(e)}forEach(e){this.ops.forEach(e)}map(e){return this.ops.map(e)}partition(e){const t=[],n=[];return this.forEach(i=>{(e(i)?t:n).push(i)}),[t,n]}reduce(e,t){return this.ops.reduce(e,t)}changeLength(){return this.reduce((e,t)=>t.insert?e+H3.length(t):t.delete?e-t.delete:e,0)}length(){return this.reduce((e,t)=>e+H3.length(t),0)}slice(t=0,n=1/0){const i=[],r=new W3(this.ops);let o=0;for(;o<n&&r.hasNext();){let e;o<t?e=r.next(t-o):(e=r.next(n-o),i.push(e)),o+=H3.length(e)}return new e(i)}compose(t){const n=new W3(this.ops),i=new W3(t.ops),r=[],o=i.peek();if(null!=o&&"number"==typeof o.retain&&(null===o.attributes||void 0===o.attributes)){let e=o.retain;for(;"insert"===n.peekType()&&n.peekLength()<=e;)e-=n.peekLength(),r.push(n.next());o.retain-e>0&&i.next(o.retain-e)}const s=new e(r);for(;n.hasNext()||i.hasNext();)if("insert"===i.peekType())s.push(i.next());else if("delete"===n.peekType())s.push(n.next());else{const t=Math.min(n.peekLength(),i.peekLength()),r=n.next(t),o=i.next(t);if(o.retain){const a={};if("number"==typeof r.retain)a.retain="number"==typeof o.retain?t:o.retain;else if("number"==typeof o.retain)null===r.retain||void 0===r.retain?a.insert=r.insert:a.retain=r.retain;else{const t=null===r.retain||void 0===r.retain?"insert":"retain",[n,i,s]=K3(r[t],o.retain),l=e.getHandler(n);a[t]={[n]:l.compose(i,s,"retain"===t)}}const l=$3.compose(r.attributes,o.attributes,"number"==typeof r.retain);if(l&&(a.attributes=l),s.push(a),!i.hasNext()&&F(s.ops[s.ops.length-1],a)){const t=new e(n.rest());return s.concat(t).chop()}}else"number"==typeof o.delete&&("number"==typeof r.retain||"object"==typeof r.retain&&null!==r.retain)&&s.push(o)}return s.chop()}concat(t){const n=new e(this.ops.slice());return t.ops.length>0&&(n.push(t.ops[0]),n.ops=n.ops.concat(t.ops.slice(1))),n}diff(t){if(this.ops===t.ops)return new e;const n=this.deltasToStrings(t),i=q3(P3(n[0],n[1])),r=new W3(this.ops),o=new W3(t.ops);return this.convertChangesToDelta(i,r,o).chop()}eachLine(t,n="\n"){const i=new W3(this.ops);let r=new e,o=0;for(;i.hasNext();){if("insert"!==i.peekType())return;const s=i.peek(),a=H3.length(s)-i.peekLength(),l="string"==typeof s.insert?s.insert.indexOf(n,a)-a:-1;if(l<0)r.push(i.next());else if(l>0)r.push(i.next(l));else{if(!1===t(r,i.next(1).attributes||{},o))return;o+=1,r=new e}}r.length()>0&&t(r,{},o)}invert(t){const n=new e;return this.reduce((i,r)=>{if(r.insert)n.delete(H3.length(r));else{if("number"==typeof r.retain&&(null===r.attributes||void 0===r.attributes))return n.retain(r.retain),i+r.retain;if(r.delete||"number"==typeof r.retain){const e=r.delete||r.retain;return t.slice(i,i+e).forEach(e=>{r.delete?n.push(e):r.retain&&r.attributes&&n.retain(H3.length(e),$3.invert(r.attributes,e.attributes))}),i+e}if("object"==typeof r.retain&&null!==r.retain){const o=t.slice(i,i+1),s=new W3(o.ops).next(),[a,l,c]=K3(r.retain,s.insert),u=e.getHandler(a);return n.retain({[a]:u.invert(l,c)},$3.invert(r.attributes,s.attributes)),i+1}}return i},0),n.chop()}transform(t,n=!1){if(n=!!n,"number"==typeof t)return this.transformPosition(t,n);const i=t,r=new W3(this.ops),o=new W3(i.ops),s=new e;for(;r.hasNext()||o.hasNext();)if("insert"!==r.peekType()||!n&&"insert"===o.peekType())if("insert"===o.peekType())s.push(o.next());else{const t=Math.min(r.peekLength(),o.peekLength()),i=r.next(t),a=o.next(t);if(i.delete)continue;if(a.delete)s.push(a);else{const r=i.retain,o=a.retain;let l="object"==typeof o&&null!==o?o:t;if("object"==typeof r&&null!==r&&"object"==typeof o&&null!==o){const t=Object.keys(r)[0];if(t===Object.keys(o)[0]){const i=e.getHandler(t);i&&(l={[t]:i.transform(r[t],o[t],n)})}}s.retain(l,$3.transform(i.attributes,a.attributes,n))}}else s.retain(H3.length(r.next()));return s.chop()}transformPosition(e,t=!1){t=!!t;const n=new W3(this.ops);let i=0;for(;n.hasNext()&&i<=e;){const r=n.peekLength(),o=n.peekType();n.next(),"delete"!==o?("insert"===o&&(i<e||!t)&&(e+=r),i+=r):e-=Math.min(r,e-i)}return e}diffWithCursor(t,n){if(this.ops===t.ops)return new e;const i=this.deltasToStrings(t);if(Math.max(...i.map(e=>e.length))>1e4){const e=q3((r=i[0],o=i[1],D3.diff(r,o,void 0))),n=new W3(this.ops),s=new W3(t.ops);return this.convertChangesToDelta(e,n,s).chop()}var r,o;if(null===n)return this.diff(t);let s=q3(P3(i[0],i[1])),a=0;const l=[];for(let e=0;e<s.length;e++){const t=s[e],i=a,r=a+(t.count??0),o=n>i&&n<=r,c=!t.added&&!t.removed,u=t.removed&&!t.added,d=s[e+1],h=d&&d.added&&!d.removed;if(c&&o&&h){const o=this.tryMoveInsertionToCursor(t,d,n,i);if(o){l.push(...o),e++,a=r;continue}}if(u){const e=this.tryMoveDeletionToCursor(t,l,n,a);if(e){l.pop(),l.push(...e),a+=t.count??0;continue}}l.push(t),t.added||(a+=t.count??0)}s=l;const c=new W3(this.ops),u=new W3(t.ops);return this.convertChangesToDelta(s,c,u).chop()}tryMoveInsertionToCursor(e,t,n,i){const r=t.value,o=n-i-r.length;if(e.value.substring(o,o+r.length)!==r)return null;const s=e.value.substring(0,o),a=e.value.substring(o),l=[];return s.length>0&&l.push({value:s,count:s.length,added:!1,removed:!1}),l.push(t),a.length>0&&l.push({value:a,count:a.length,added:!1,removed:!1}),l}tryMoveDeletionToCursor(e,t,n,i){const r=t[t.length-1];if(!r||r.added||r.removed)return null;const o=i-(r.count??0);if(n<o||n>=i)return null;const s=e.value,a=n-o;if(r.value.substring(a,a+s.length)!==s)return null;const l=r.value.substring(0,a),c=r.value.substring(a),u=e.count??0,d=c.substring(u),h=[];return l.length>0&&h.push({value:l,count:l.length,added:!1,removed:!1}),h.push(e),d.length>0&&h.push({value:d,count:d.length,added:!1,removed:!1}),h}deltasToStrings(e){return[this,e].map(t=>t.map(n=>{if(null!==n.insert||void 0!==n.insert)return"string"==typeof n.insert?n.insert:G3;throw new Error("diff() called "+(t===e?"on":"with")+" non-document")}).join(""))}convertChangesToDelta(t,n,i){const r=new e;return t.forEach(e=>{let t=e.count??0;for(;t>0;){let o=0;if(e.added)o=Math.min(i.peekLength(),t),r.push(i.next(o));else if(e.removed)o=Math.min(t,n.peekLength()),n.next(o),r.delete(o);else{o=Math.min(n.peekLength(),i.peekLength(),t);const e=n.next(o),s=i.next(o);F(e.insert,s.insert)?r.retain(o,$3.diff(e.attributes,s.attributes)):r.push(s).delete(o)}t-=o}}),r}},CRDT_DOC_META_PERSISTENCE_KEY:N5,CRDT_RECORD_MAP_KEY:R5,LOCAL_EDITOR_ORIGIN:M5,LOCAL_UNDO_IGNORED_ORIGIN:"gutenberg-undo-ignored",retrySyncConnection:()=>w3.retryNow()});var J3,{lock:X3,unlock:Z3}=(0,pt.yf)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/core-data"),{ConnectionErrorCode:Q3,createSyncManager:e8,Delta:t8,CRDT_DOC_META_PERSISTENCE_KEY:n8,CRDT_RECORD_MAP_KEY:i8,LOCAL_EDITOR_ORIGIN:r8,LOCAL_UNDO_IGNORED_ORIGIN:o8,retrySyncConnection:s8}=Z3(Y3);function a8(){return J3||(J3=e8())}function l8(e,t){return e.getMap(t)}function c8(e={}){return new fd(Object.entries(e))}function u8(e,t){const n=l8(t,i8).get("blocks");return n instanceof hd?f8(e,n):null}function d8(e){for(let t=57344;t<57360;t++){const n=String.fromCharCode(t);if(!e.includes(n))return n}return null}function h8(e,t){if(!e.includes("<")&&!e.includes("&"))return t;const n=d8(e);if(!n)return t;const i=We({html:e.slice(0,t)+n+e.slice(t)}).text.indexOf(n);return-1===i?t:i}function p8(e,t){if(!e.includes("<")&&!e.includes("&"))return t;const n=d8(e);if(!n)return t;const i=We({html:e}),r=We({text:n});i.formats[t]&&(r.formats[0]=i.formats[t]);const o=Be({value:st(i,r,t,t)}).indexOf(n);return-1===o?t:o}function f8(e,t){for(const n of t){if(n.get("clientId")===e)return n;const t=n.get("innerBlocks");if(t&&t.length>0){const n=f8(e,t);if(n)return n}}return null}var m8=(e=>(e.None="none",e.Cursor="cursor",e.SelectionInOneBlock="selection-in-one-block",e.SelectionInMultipleBlocks="selection-in-multiple-blocks",e.WholeBlock="whole-block",e))(m8||{});function g8(e,t){const n=b8(e.clientId),i=n?function(e,t){let n=t;for(let t=0;t<e.length;t++){if(e[t]>=n.length)return null;const i=n.get(e[t]);if(!i)return null;if(t===e.length-1)return i;n=i.get("innerBlocks")??new hd}return null}(n,t):null;if(!i||!e.attributeKey||void 0===e.offset)return null;const r=i.get("attributes"),o=r?.get(e.attributeKey);return o instanceof Td?{relativePosition:eu(o,p8(o.toString(),e.offset)),absoluteOffset:e.offset}:null}function b8(e){const{getBlockIndex:t,getBlockRootClientId:n,getBlockName:i}=(0,xe.L)(Qy),r=[];let o=e;for(;o;){const e=t(o);if(-1===e)return null;r.unshift(e);const s=n(o);if(!s)break;if("core/post-content"===i(s))break;o=s}return r.length>0?r:null}function y8(e,t){const n=nu(e.relativePosition,t.relativePosition),i=e.absoluteOffset===t.absoluteOffset;return n&&i}var v8=(e=>(e.Forward="f",e.Backward="b",e))(v8||{}),_8=class extends A5{constructor(e,t,n,i){super(e),this.kind=t,this.name=n,this.postId=i}equalityFieldChecks={...I5,editorState:this.areEditorStatesEqual};onSetUp(){super.onSetUp(),this.subscribeToCollaboratorSelectionChanges()}subscribeToCollaboratorSelectionChanges(){const{getSelectionStart:e,getSelectionEnd:t,getSelectedBlocksInitialCaretPosition:n}=(0,xe.L)(Qy);let i=e(),r=t(),o=null,s=null;(0,D.subscribe)(()=>{const a=e(),l=t();if(a===i&&l===r)return;s||(s={start:i,end:r}),i=a,r=l;const c=n();this.updateSelectionInEntityRecord(i,r,c),o&&clearTimeout(o),o=setTimeout(()=>{const e={};s&&(e.selectionDirection=function(e,t,n,i){const r=!x8(e,n),o=!x8(t,i);return r&&!o?v8.Backward:v8.Forward}(s.start,s.end,i,r),s=null);const t=function(e,t,n,i){const{selectionDirection:r}=i??{},o=l8(n,i8).get("blocks"),s={type:"none"};if(0===Object.keys(e).length||!o)return s;const a=e.clientId===t.clientId,l=a&&e.offset===t.offset;if(a&&void 0===e.offset&&void 0===t.offset){const t=b8(e.clientId),n=t?function(e,t){let n=t;for(let t=0;t<e.length;t++){if(e[t]>=n.length)return null;if(t===e.length-1)return eu(n,e[t]);const i=n.get(e[t]);n=i?.get("innerBlocks")??new hd}return null}(t,o):null;return n?{type:"whole-block",blockPosition:n}:s}if(l){const t=g8(e,o);return t?{type:"cursor",cursorPosition:t}:s}if(a){const n=g8(e,o),i=g8(t,o);return n&&i?{type:"selection-in-one-block",cursorStartPosition:n,cursorEndPosition:i,selectionDirection:r}:s}const c=g8(e,o),u=g8(t,o);return c&&u?{type:"selection-in-multiple-blocks",cursorStartPosition:c,cursorEndPosition:u,selectionDirection:r}:s}(i,r,this.doc,e);this.setThrottledLocalStateField("editorState",{selection:t},100)},5)})}async updateSelectionInEntityRecord(e,t,n){const i={selection:{selectionStart:e,selectionEnd:t,initialPosition:n}};(0,nt.J)(S5).editEntityRecord(this.kind,this.name,this.postId,i,{undoIgnore:!0})}areEditorStatesEqual(e,t){return e&&t?e.selection&&t.selection?function(e,t){if(e.type!==t.type)return!1;switch(e.type){case"none":return!0;case"cursor":return y8(e.cursorPosition,t.cursorPosition);case"selection-in-one-block":case"selection-in-multiple-blocks":return y8(e.cursorStartPosition,t.cursorStartPosition)&&y8(e.cursorEndPosition,t.cursorEndPosition)&&e.selectionDirection===t.selectionDirection;case"whole-block":return nu(e.blockPosition,t.blockPosition);default:return!1}}(e.selection,t.selection):e.selection===t.selection:e===t}convertSelectionStateToAbsolute(e){if(e.type===m8.None)return{richTextOffset:null,localClientId:null};if(e.type===m8.WholeBlock){const t=tu(e.blockPosition,this.doc);let n=null;if(t&&t.type instanceof hd){const e=t.type.get(t.index);if(e instanceof fd){const t=j5(e);n=t?T5(t):null}}return{richTextOffset:null,localClientId:n}}const t="cursorPosition"in e?e.cursorPosition:e.cursorStartPosition,n=tu(t.relativePosition,this.doc);if(!n)return{richTextOffset:null,localClientId:null};const i=n.type.parent?.parent,r=i instanceof fd?j5(i):null,o=r?T5(r):null;return{richTextOffset:h8(n.type.toString(),n.index),localClientId:o}}isYItem(e){return"content"in e}getDebugData(){const e=this.doc,t=Object.fromEntries(Array.from(e.share,([e,t])=>[e,t.toJSON()])),n=new Map(Array.from(this.getSeenStates().entries()).map(([e,t])=>[String(e),{name:t.collaboratorInfo.name,wpUserId:t.collaboratorInfo.id}])),i={};return e.store.clients.forEach((e,t)=>{const n=e.filter(this.isYItem);i[t]=n.map(e=>{const{left:t,right:n,...i}=e;return{...i,left:t?{id:t.id,length:t.length,origin:t.origin,content:t.content}:null,right:n?{id:n.id,length:n.length,origin:n.origin,content:n.content}:null}})}),{doc:t,clients:i,collaboratorMap:Object.fromEntries(n)}}};function x8(e,t){return e.clientId===t.clientId&&e.attributeKey===t.attributeKey&&e.offset===t.offset}var k8,w8,C8=function(){const e=new Map;return function(t){const n=e.get(t);if(n)return n;const i=He.fromHTMLString(t);return e.size>=500&&e.delete(e.keys().next().value),e.set(t,i),i}}(),S8=new WeakMap;function A8(e){if(e instanceof He)return e.valueOf();if(Array.isArray(e))return e.map(A8);if(e&&"object"==typeof e){const t={};for(const[n,i]of Object.entries(e))t[n]=A8(i);return t}return e}function I8(e,t){const n={...t};for(const[i,r]of Object.entries(t))W8(e,i)?delete n[i]:n[i]=A8(r);return n}function E8(e){return e.map(e=>{const{name:t,innerBlocks:n,attributes:i,...r}=e;return delete r.validationIssues,{...r,name:t,attributes:I8(t,i),innerBlocks:E8(n)}})}function j8(e,t){if("rich-text"===e?.type&&"string"==typeof t)return C8(t);if(Array.isArray(t))return t.map(t=>j8(e,t));if(t&&"object"==typeof t){const n={};for(const[i,r]of Object.entries(t))n[i]=j8(e?.query?.[i],r);return n}return t}function T8(e){return e.map(e=>{const{name:t,innerBlocks:n,attributes:i,...r}=e,o={...i};for(const[e,n]of Object.entries(i)){const i=$8(t,e);i&&(o[e]=j8(i,n))}return{...r,name:t,attributes:o,innerBlocks:T8(n??[])}})}function B8(e,t){const n=t.toJSON(),i={innerBlocks:null,clientId:null},r=F(Object.assign({},e,i),Object.assign({},n,i)),o=e.innerBlocks||[],s=t.get("innerBlocks");return r&&o.length===s?.length&&o.every((e,t)=>B8(e,s.get(t)))}function N8(e,t){return new fd(Object.entries(t).map(([t,n])=>[t,R8(e,t,n)]))}function R8(e,t,n){return O8($8(e,t),n)}function O8(e,t){if(!e)return t;if("rich-text"===e.type)return new Td(t?.toString()??"");if("array"===e.type&&e.query&&Array.isArray(t)){const n=e.query,i=new hd;return i.insert(0,t.map(e=>M8(n,e))),i}return"object"===e.type&&e.query&&L8(t)?M8(e.query,t):t}function L8(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function M8(e,t){if(!L8(t))return new fd;const n=Object.entries(t).map(([t,n])=>[t,O8(e[t],n)]);return new fd(n)}function P8(e){return c8(Object.fromEntries(Object.entries(e).map(([t,n])=>{switch(t){case"attributes":return[t,N8(e.name,n)];case"innerBlocks":{const e=new hd;return Array.isArray(n)?(e.insert(0,n.map(e=>P8(e))),[t,e]):[t,e]}default:return[t,n]}})))}function D8(e,t,n){S8.has(t)||S8.set(t,E8(t));const i=S8.get(t)??[],r=Math.min(i.length??0,e.length);let o=0,s=0;for(;o<r&&B8(i[o],e.get(o));o++);for(;s<r-o&&B8(i[i.length-s-1],e.get(e.length-s-1));s++);const a=r-o-s,l=Math.max(0,i.length-e.length),c=Math.max(0,e.length-i.length);for(let t=0;t<a;t++,o++){const t=i[o],r=e.get(o);Object.entries(t).forEach(([e,i])=>{switch(e){case"attributes":{const o=r.get(e);if(!o){r.set(e,N8(t.name,i));break}Object.entries(i).forEach(([e,i])=>{const r=o?.get(e);(!H8(t.name,e,r)||r instanceof Ku||!F(r,i))&&U8(t.name,e,i,o,n)}),o.forEach((e,t)=>{i.hasOwnProperty(t)||o.delete(t)});break}case"innerBlocks":{let t=r.get(e);t instanceof hd||(t=new hd,r.set(e,t)),D8(t,i??[],n);break}default:F(t[e],r.get(e))||r.set(e,i)}}),r.forEach((e,n)=>{t.hasOwnProperty(n)||r.delete(n)})}e.delete(o,c);for(let t=0;t<l;t++,o++){const t=[P8(i[o])];e.insert(o,t)}const u=new Set;for(let t=0;t<e.length;t++){const n=e.get(t);let i=n.get("clientId");i&&(u.has(i)&&(i=(0,Qi.A)(),n.set("clientId",i)),u.add(i))}}function F8(e,t){return t instanceof fd&&L8(e)?F(e,t.toJSON()):F(e,t)}function z8(e,t,n,i,r){const o=n.get(i);if("rich-text"===e?.type&&"string"==typeof t&&o instanceof Td)G8(o,t,r);else if("array"===e?.type&&e.query&&Array.isArray(t)&&o instanceof hd)!function(e,t,n,i){if(!n.query)return;const r=n.query,o=Math.min(t.length,e.length);let s=0,a=0;for(;s<o&&F8(t[s],e.get(s));s++);for(;a<o-s&&F8(t[t.length-a-1],e.get(e.length-a-1));a++);const l=o-s-a;for(let n=0;n<l;n++){const o=e.get(s+n),a=t[s+n];if(!(o instanceof fd&&L8(a)))return e.delete(0,e.length),void e.insert(0,t.map(e=>M8(r,e)));V8(o,a,r,i)}const c=Math.max(0,e.length-t.length);c>0&&e.delete(s+l,c);const u=Math.max(0,t.length-e.length);if(u>0){const n=s+l,i=new Array(u);for(let e=0;e<u;e++)i[e]=M8(r,t[n+e]);e.insert(n,i)}}(o,t,e,r);else if("object"===e?.type&&e.query&&L8(t)&&o instanceof fd)V8(o,t,e.query,r);else{const r=O8(e,t);r===t&&F(o,t)||n.set(i,r)}}function V8(e,t,n,i){for(const[r,o]of Object.entries(t))z8(n[r],o,e,r,i);for(const n of e.keys())Object.hasOwn(t,n)||e.delete(n)}function U8(e,t,n,i,r){z8($8(e,t),n,i,t,r)}function $8(e,t){if(!k8){k8=new Map;for(const e of yn())k8.set(e.name,new Map(Object.entries(e.attributes??{}).map(([e,t])=>{const{role:n,type:i,query:r}=t;return[e,{role:n,type:i,query:r}]})))}return k8.get(e)?.get(t)}function H8(e,t,n){const i=$8(e,t);return"rich-text"===i?.type?n instanceof Td:"string"===i?.type?"string"==typeof n:"array"===i?.type&&i.query?n instanceof hd:"object"!==i?.type||!i.query||n instanceof fd}function W8(e,t){return"local"===$8(e,t)?.role}function G8(e,t,n=null){w8||(w8=new Ic);const i=w8.getText("temporary-text");i.delete(0,i.length),i.insert(0,t);const r=new t8(e.toDelta()),o=new t8(i.toDelta()),s=r.diffWithCursor(o,n);e.applyDelta(s.ops)}var q8=(e=>(e.RelativeSelection="RelativeSelection",e.BlockSelection="BlockSelection",e))(q8||{});function K8(e,t){const n=e.clientId,i=u8(n,t),r=i?.get("attributes"),o=e.attributeKey,s=o?r?.get(o):void 0;if(!(s instanceof Td&&o&&n))return{type:"BlockSelection",clientId:n};const a=e.offset??0;return{type:"RelativeSelection",attributeKey:o,relativePosition:eu(s,p8(s.toString(),a)),clientId:n,offset:a}}var Y8=new WeakMap;function J8(e){let t=Y8.get(e);return t||(t=function(e,t=5){let n=[];return{getSelectionHistory:()=>n.slice(0),updateSelection:i=>{if(!i?.selectionStart?.clientId||!i?.selectionEnd?.clientId)return;const{selectionStart:r,selectionEnd:o}=i;(e=>{const i=e.start.clientId,r=e.end.clientId;n=n.filter(e=>!(e.start.clientId===i&&e.end.clientId===r)),n.unshift(e),n.length>t+1&&(n=n.slice(0,t+1))})({start:K8(r,e),end:K8(o,e)})}}}(e),Y8.set(e,t)),t}function X8(e){return J8(e).getSelectionHistory()}function Z8(e,t){if(e.type===q8.RelativeSelection){const{relativePosition:n,attributeKey:i,clientId:r}=e,o=tu(n,t);if(o)return{clientId:r,attributeKey:i,offset:h8(o.type.toString(),o.index)}}else if(e.type===q8.BlockSelection)return{clientId:e.clientId,attributeKey:void 0,offset:void 0};return null}function Q8(e,t){const{start:n,end:i}=e,r=u8(n.clientId,t),o=u8(i.clientId,t);if(!r||!o)return null;const s=Z8(n,t),a=Z8(i,t);return null===s||null===a?null:{selectionStart:s,selectionEnd:a}}function e6(e,t){const n=function(e,t){for(const n of t){const t=Q8(n,e);if(null!==t)return t}return null}(t,e);if(null===n)return;const{getBlock:i}=(0,xe.L)(Qy),{resetSelection:r}=(0,nt.J)(Qy),{selectionStart:o,selectionEnd:s}=n;if(o.clientId===s.clientId){const e=i(o.clientId),t=e&&An(e);0!==o.offset||0!==s.offset||!t||o.attributeKey||s.attributeKey?r(o,s,0):r({clientId:o.clientId},{clientId:s.clientId},0)}else r(s,s,0)}var t6="_crdt_document",n6=new Set([t6]);function i6(e,t,n){const i=l8(e,i8);let r={};const o=Object.fromEntries(Object.entries(i.toJSON()).filter(([o,s])=>{if(!n.has(o))return!1;const a=t[o];switch(o){case"blocks":if(e.meta?.get(n8)&&t.content){const e=i.get("blocks")?.toJSON()??[];return Dr(e).trim()!==o6(t.content)}return!0;case"date":return!(null===a||t.modified===a)&&s6(a,s);case"meta":return r=Object.fromEntries(Object.entries(s??{}).filter(([e])=>!n6.has(e))),s6(a,{...a,...r});case"status":return"auto-draft"!==s&&s6(a,s);case"content":case"excerpt":case"title":return s6(o6(a),s);default:return s6(a,s)}}));o.blocks&&(o.blocks=T8(o.blocks)),"object"==typeof o.meta&&(o.meta={...t.meta,...r});const s=X8(e),a=function(e,t){if(0===t.length)return null;const{start:n,end:i}=t[0];if(n.type===q8.BlockSelection||i.type===q8.BlockSelection)return null;const r=Z8(n,e),o=Z8(i,e);if(!r||!o)return null;const s=r.offset!==n.offset,a=o.offset!==i.offset;return s||a?{selectionStart:r,selectionEnd:o}:null}(e,s);return a&&(o.selection={...a,initialPosition:0}),o}var r6={applyChangesToCRDTDoc:function(e,t){const n=l8(e,i8);Object.entries(t).forEach(([e,t])=>{if("function"!=typeof t){const i=n.get(e);a6(n,e,i,t)}})},createAwareness:e=>new E5(e),getChangesFromCRDTDoc:function(e){return l8(e,i8).toJSON()}};function o6(e){return"string"==typeof e?e:e&&"object"==typeof e&&"raw"in e&&"string"==typeof e.raw?e.raw:void 0}function s6(e,t){return!F(e,t)}function a6(e,t,n,i){void 0!==i?s6(n,i)&&e.set(t,i):e.delete(t)}var l6="id",c6=["title","excerpt","content"],u6={blocks:{read:e=>Vo(e.content?.raw??""),write:e=>({content:Dr(e.blocks)})}},d6=[{label:(0,ee.__)("Base"),kind:"root",key:!1,name:"__unstableBase",baseURL:"/",baseURLParams:{_fields:["description","gmt_offset","home","image_sizes","image_size_threshold","image_output_formats","jpeg_interlaced","png_interlaced","gif_interlaced","name","site_icon","site_icon_url","site_logo","timezone_string","url","page_for_posts","page_on_front","show_on_front"].join(",")},plural:"__unstableBases",supportsPagination:!1},{label:(0,ee.__)("Post Type"),name:"postType",kind:"root",key:"slug",baseURL:"/wp/v2/types",baseURLParams:{context:"edit"},plural:"postTypes",supportsPagination:!1},{name:"media",kind:"root",baseURL:"/wp/v2/media",baseURLParams:{context:"edit"},plural:"mediaItems",label:(0,ee.__)("Media"),rawAttributes:["caption","title","description"],supportsPagination:!0},{name:"taxonomy",kind:"root",key:"slug",baseURL:"/wp/v2/taxonomies",baseURLParams:{context:"edit"},plural:"taxonomies",label:(0,ee.__)("Taxonomy"),supportsPagination:!1},{name:"sidebar",kind:"root",baseURL:"/wp/v2/sidebars",baseURLParams:{context:"edit"},plural:"sidebars",transientEdits:{blocks:!0},label:(0,ee.__)("Widget areas"),supportsPagination:!1},{name:"widget",kind:"root",baseURL:"/wp/v2/widgets",baseURLParams:{context:"edit"},plural:"widgets",transientEdits:{blocks:!0},label:(0,ee.__)("Widgets"),supportsPagination:!1},{name:"widgetType",kind:"root",baseURL:"/wp/v2/widget-types",baseURLParams:{context:"edit"},plural:"widgetTypes",label:(0,ee.__)("Widget types"),supportsPagination:!1},{label:(0,ee.__)("User"),name:"user",kind:"root",baseURL:"/wp/v2/users",getTitle:e=>e?.name||e?.slug,baseURLParams:{context:"edit"},plural:"users",supportsPagination:!0},{name:"comment",kind:"root",baseURL:"/wp/v2/comments",baseURLParams:{context:"edit"},plural:"comments",label:(0,ee.__)("Comment"),supportsPagination:!0,syncConfig:{applyChangesToCRDTDoc:()=>{},getChangesFromCRDTDoc:()=>({}),shouldSync:(e,t)=>null===t}},{name:"menu",kind:"root",baseURL:"/wp/v2/menus",baseURLParams:{context:"edit"},plural:"menus",label:(0,ee.__)("Menu"),supportsPagination:!0},{name:"menuItem",kind:"root",baseURL:"/wp/v2/menu-items",baseURLParams:{context:"edit"},plural:"menuItems",label:(0,ee.__)("Menu Item"),rawAttributes:["title"],supportsPagination:!0},{name:"menuLocation",kind:"root",baseURL:"/wp/v2/menu-locations",baseURLParams:{context:"edit"},plural:"menuLocations",label:(0,ee.__)("Menu Location"),key:"name",supportsPagination:!1},{label:(0,ee.__)("Global Styles"),name:"globalStyles",kind:"root",baseURL:"/wp/v2/global-styles",baseURLParams:{context:"edit"},plural:"globalStylesVariations",getTitle:()=>(0,ee.__)("Custom Styles"),getRevisionsUrl:(e,t)=>`/wp/v2/global-styles/${e}/revisions${t?"/"+t:""}`,supportsPagination:!0},{label:(0,ee.__)("Themes"),name:"theme",kind:"root",baseURL:"/wp/v2/themes",baseURLParams:{context:"edit"},plural:"themes",key:"stylesheet",supportsPagination:!1},{label:(0,ee.__)("Plugins"),name:"plugin",kind:"root",baseURL:"/wp/v2/plugins",baseURLParams:{context:"edit"},plural:"plugins",key:"plugin",supportsPagination:!1},{label:(0,ee.__)("Status"),name:"status",kind:"root",baseURL:"/wp/v2/statuses",baseURLParams:{context:"edit"},plural:"statuses",key:"slug",supportsPagination:!1},{label:(0,ee.__)("Registered Templates"),name:"registeredTemplate",kind:"root",baseURL:"/wp/v2/registered-templates",key:"id",supportsPagination:!1},{label:(0,ee.__)("Font Collections"),name:"fontCollection",kind:"root",baseURL:"/wp/v2/font-collections",baseURLParams:{context:"view"},plural:"fontCollections",key:"slug",supportsPagination:!0},{label:(0,ee.__)("Icons"),name:"icon",kind:"root",baseURL:"/wp/v2/icons",baseURLParams:{context:"view"},plural:"icons",key:"name",supportsPagination:!1}],h6={root:{media:{since:"6.9",alternative:{kind:"postType",name:"attachment"}}}},p6=[{kind:"postType",loadEntities:async function(){const e=(0,N.default)({path:"/wp/v2/types?context=view"}),t=window._wpCollaborationEnabled?(0,N.default)({path:"/wp/v2/taxonomies?context=view"}):Promise.resolve({}),[n,i]=await Promise.all([e,t]);return Object.entries(n??{}).map(([e,t])=>{const n=["wp_template","wp_template_part"].includes(e),r=t?.rest_namespace??"wp/v2",o=new Set(["author","blocks","content","comment_status","date","excerpt","featured_media","format","meta","ping_status","slug","status","sticky","template","title",...t.taxonomies?.map(e=>i?.[e]?.rest_base)?.filter(Boolean)??[]]),s={kind:"postType",baseURL:`/${r}/${t.rest_base}`,baseURLParams:{context:"edit"},name:e,label:t.name,transientEdits:{...u6,selection:!0},mergedEdits:{meta:!0},rawAttributes:c6,getTitle:e=>{return e?.title?.rendered||e?.title||(n?(t=e.slug??"",void 0===i&&(i={}),(0,Y.W)(t,(0,K.Cl)({delimiter:" ",transform:J},i))):String(e.id));var t,i},__unstablePrePersist:(t,i)=>(async(e,t,n,i)=>{const r={};if(i||"auto-draft"!==e?.status||(t.status||r.status||(r.status="draft"),t.title&&"Auto Draft"!==t.title||r.title||e?.title&&"Auto Draft"!==e?.title||(r.title="")),e){const i=`postType/${n}`,o=e.id,s=await(a8()?.createPersistedCRDTDoc(i,o));s&&(r.meta={...t.meta,[t6]:s})}return r})(t,i,e,n),__unstable_rest_base:t.rest_base,supportsPagination:!0,getRevisionsUrl:(e,n)=>`/${r}/${t.rest_base}/${e}/revisions${n?"/"+n:""}`,revisionKey:n&&!window?.__experimentalTemplateActivate?"wp_id":l6};return s.syncConfig={applyChangesToCRDTDoc:(e,t)=>function(e,t,n){const i=l8(e,i8);if(Object.keys(t).forEach(e=>{if(!n.has(e))return;const r=t[e];if("function"!=typeof r)switch(e){case"blocks":{if(!r){i.set(e,void 0);break}let n=i.get(e);n instanceof hd||(n=new hd,i.set(e,n)),D8(n,r,t.selection?.selectionStart?.offset??null);break}case"content":case"excerpt":case"title":{const t=i.get(e);let n=o6(r);if("title"!==e||t?.toString()||"Auto Draft"!==n||(n=""),t instanceof Td)G8(t,n??"");else{const t=new Td(n??"");i.set(e,t)}break}case"meta":{let e=i.get("meta");(function(e){return e instanceof fd})(e)||(e=c8(),i.set("meta",e)),Object.entries(r??{}).forEach(([t,n])=>{n6.has(t)||a6(e,t,e.get(t),n)});break}case"slug":{if(!r)break;const t=i.get(e);a6(i,e,t,r);break}default:{const t=i.get(e);a6(i,e,t,r)}}}),t.selection){const n=t.selection;setTimeout(()=>{!function(e,t){J8(e).updateSelection(t)}(e,n)},0)}}(e,t,o),createAwareness:(t,n)=>{const i=parseInt(n,10);return new _8(t,"postType",e,i)},getChangesFromCRDTDoc:(e,t)=>i6(e,t,o),getPersistedCRDTDoc:e=>e?.meta?.[t6]||null},s})}},{kind:"taxonomy",loadEntities:async function(){const e=await(0,N.default)({path:"/wp/v2/taxonomies?context=view"});return Object.entries(e??{}).map(([e,t])=>{const n={kind:"taxonomy",baseURL:`/${t?.rest_namespace??"wp/v2"}/${t.rest_base}`,baseURLParams:{context:"edit"},name:e,label:t.name,getTitle:e=>e?.name,supportsPagination:!0};return n.syncConfig=r6,n})}},{kind:"root",name:"site",plural:"sites",loadEntities:async function(){const e={label:(0,ee.__)("Site"),name:"site",kind:"root",key:!1,baseURL:"/wp/v2/settings",supportsPagination:!1,meta:{}},t=await(0,N.default)({path:e.baseURL,method:"OPTIONS"}),n={};return Object.entries(t?.schema?.properties??{}).forEach(([e,t])=>{"object"==typeof t&&t.title&&(n[e]=t.title)}),[{...e,meta:{labels:n}}]}}],f6=(e,t,n="get")=>`${n}${"root"===e?"":(0,X.fL)(e)}${(0,X.fL)(t)}`,m6=n(85123),g6=function(e){return"string"==typeof e?e.split(","):Array.isArray(e)?e:null},b6=function(e){const t=new WeakMap;return n=>{let i;return t.has(n)?i=t.get(n):(i=e(n),null!==n&&"object"==typeof n&&t.set(n,i)),i}}(function(e){const t={stableKey:"",page:1,perPage:10,offset:null,fields:null,include:null,context:"default"},n=Object.keys(e).sort();for(let i=0;i<n.length;i++){const r=n[i];let o=e[r];switch(r){case"page":t[r]=Number(o);break;case"per_page":t.perPage=Number(o);break;case"offset":{const e=Number(o);Number.isFinite(e)&&(t.offset=e);break}case"context":t.context=o;break;default:"_fields"===r&&(t.fields=g6(o)??[],o=t.fields.join()),"include"===r&&("number"==typeof o&&(o=o.toString()),t.include=(g6(o)??[]).map(Number),o=t.include.join()),t.stableKey+=(t.stableKey?"&":"")+(0,m6.F)("",{[r]:o}).slice(1)}}return t});function y6(e){const{query:t}=e;return t?b6(t).context:"default"}function v6(e=[],t,{page:n=1,offset:i,perPage:r=10}={}){if(-1===r)return t;const o=i??(n-1)*r,s=Math.max(r,t.length),a=Math.max(e.length,o+t.length),l=new Array(a);for(let n=0;n<a;n++){const i=n>=o&&n<o+s;l[n]=i?t[n-o]:e[n]}return l}function _6(e,t){return Object.fromEntries(Object.entries(e).filter(([e])=>!t.some(t=>Number.isInteger(t)?t===+e:t===e)))}var x6=(0,z.A)([H(e=>"query"in e),W(e=>e.query?{...e,...b6(e.query)}:e),q("context"),q("stableKey")])((e={},t)=>{if("RECEIVE_ITEMS"!==t.type)return e;if(!Array.isArray(t.items))return e;const n=t.key??l6;return{itemIds:v6(e.itemIds,t.items.map(e=>e?.[n]).filter(Boolean),{page:t.page,offset:t.offset,perPage:t.perPage}),meta:t.meta}}),k6=(0,D.combineReducers)({items:function(e={},t){switch(t.type){case"RECEIVE_ITEMS":{const n=y6(t),i=t.key||l6,r=Array.isArray(t.items)?t.items:[t.items];return{...e,[n]:{...e[n],...Object.fromEntries(r.map(t=>[t?.[i],G(e?.[n]?.[t?.[i]],t)]))}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(e).map(([e,n])=>[e,_6(n,t.itemIds)]))}return e},itemIsComplete:function(e={},t){switch(t.type){case"RECEIVE_ITEMS":{const n=y6(t),{query:i,key:r=l6}=t,o=Array.isArray(t.items)?t.items:[t.items],s=i?b6(i):{},a=!i||!Array.isArray(s.fields);return{...e,[n]:{...e[n],...o.reduce((t,i)=>{const o=i?.[r];return t[o]=e?.[n]?.[o]||a,t},{})}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(e).map(([e,n])=>[e,_6(n,t.itemIds)]))}return e},queries:(e={},t)=>{switch(t.type){case"RECEIVE_ITEMS":return x6(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}}}),w6=e=>(t,n)=>{if("UNDO"===n.type||"REDO"===n.type){const{record:i}=n;let r=t;return i.forEach(({id:{kind:t,name:i,recordId:o},changes:s})=>{r=e(r,{type:"EDIT_ENTITY_RECORD",kind:t,name:i,recordId:o,edits:Object.entries(s).reduce((e,[t,i])=>(e[t]="UNDO"===n.type?i.from:i.to,e),{})})}),r}return e(t,n)};function C6(e){return(0,z.A)([w6,H(t=>t.name&&t.kind&&t.name===e.name&&t.kind===e.kind),W(t=>({key:e.key||l6,...t}))])((0,D.combineReducers)({queriedData:k6,edits:(e={},t)=>{switch(t.type){case"RECEIVE_ITEMS":if("default"!==(t?.query?.context??"default"))return e;const n={...e},i=Array.isArray(t.items)?t.items:[t.items];for(const e of i){const i=e?.[t.key],r=n[i];if(!r)continue;const o=Object.keys(r).reduce((n,i)=>(F(r[i],e[i]?.raw??e[i])||t.persistedEdits&&F(r[i],t.persistedEdits[i])||(n[i]=r[i]),n),{});Object.keys(o).length?n[i]=o:delete n[i]}return n;case"EDIT_ENTITY_RECORD":const r={...e[t.recordId],...t.edits};return Object.keys(r).forEach(e=>{void 0===r[e]&&delete r[e]}),{...e,[t.recordId]:r}}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 i=k6(e[n],{...t,type:"RECEIVE_ITEMS"});return{...e,[n]:i}}return"REMOVE_ITEMS"===t.type?Object.fromEntries(Object.entries(e).filter(([e])=>!t.itemIds.some(t=>Number.isInteger(t)?t===+e:t===e))):e}}))}var S6=(0,D.combineReducers)({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},entities:(e={},t)=>{const n=function(e=d6,t){return"ADD_ENTITIES"===t.type?[...e,...t.entities]:e}(e.config,t);let i=e.reducer;if(!i||n!==e.config){const e=n.reduce((e,t)=>{const{kind:n}=t;return e[n]||(e[n]=[]),e[n].push(t),e},{});i=(0,D.combineReducers)(Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(0,D.combineReducers)(Object.fromEntries(t.map(e=>[e.name,C6(e)])))])))}const r=i(e.records,t);return r===e.records&&n===e.config&&i===e.reducer?e:{reducer:i,records:r,config:n}},editsReference:function(e={},t){switch(t.type){case"EDIT_ENTITY_RECORD":case"UNDO":case"REDO":return{}}return e},undoManager:function(e=function(){let e=[],t=[],n=0;const i=()=>{e=e.slice(0,n||void 0),n=0},r=()=>{const n=0===e.length?0:e.length-1;let i=e[n]??[];t.forEach(e=>{i=$(i,e)}),t=[],e[n]=i};return{addRecord(n,o=!1){const s=!n||(e=>!e.filter(({changes:e})=>Object.values(e).some(({from:e,to:t})=>"function"!=typeof e&&"function"!=typeof t&&!(0,V.hw)(e,t))).length)(n);if(o){if(s)return;n.forEach(e=>{t=$(t,e)})}else{if(i(),t.length&&r(),s)return;e.push(n)}},undo(){t.length&&(i(),r());const o=e[e.length-1+n];if(o)return n-=1,o},redo(){const t=e[e.length+n];if(t)return n+=1,t},hasUndo:()=>!!e[e.length-1+n],hasRedo:()=>!!e[e.length+n]}}()){return e},embedPreviews:function(e={},t){if("RECEIVE_EMBED_PREVIEW"===t.type){const{url:n,preview:i}=t;return{...e,[n]:i}}return e},userPermissions:function(e={},t){switch(t.type){case"RECEIVE_USER_PERMISSION":return{...e,[t.key]:t.isAllowed};case"RECEIVE_USER_PERMISSIONS":return{...e,...t.permissions}}return e},autosaves:function(e={},t){if("RECEIVE_AUTOSAVES"===t.type){const{postId:n,autosaves:i}=t;return{...e,[n]:i}}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},registeredPostMeta:function(e={},t){return"RECEIVE_REGISTERED_POST_META"===t.type?{...e,[t.postType]:t.registeredPostMeta}:e},editorSettings:function(e=null,t){return"RECEIVE_EDITOR_SETTINGS"===t.type?t.settings:e},editorAssets:function(e=null,t){return"RECEIVE_EDITOR_ASSETS"===t.type?t.assets:e},syncConnectionStatuses:function(e={},t){switch(t.type){case"SET_SYNC_CONNECTION_STATUS":{const n=`${t.kind}/${t.name}:${t.key}`;return{...e,[n]:t.status}}case"CLEAR_SYNC_CONNECTION_STATUS":{const n=`${t.kind}/${t.name}:${t.key}`,{[n]:i,...r}=e;return r}}return e},collaborationSupported:function(e=!0,t){switch(t.type){case"SET_COLLABORATION_SUPPORTED":return t.supported;case"SET_SYNC_CONNECTION_STATUS":return Q3.DOCUMENT_SIZE_LIMIT_EXCEEDED!==t.status?.error?.code&&e}return e},viewConfigs:function(e={},t){return"RECEIVE_VIEW_CONFIG"===t.type?{...e,[`${t.kind}/${t.name}`]:t.config}:e}}),A6=n(34236);function I6(e,t,n){if(!e||"object"!=typeof e)return e;const i=Array.isArray(t)?t:t.split(".");return i.reduce((e,t,r)=>(void 0===e[t]&&(Number.isInteger(i[r+1])?e[t]=[]:e[t]={}),r===i.length-1&&(e[t]=n),e[t]),e),e}var E6=new WeakMap,j6=(0,ce.A)((e,t={},n={})=>{let i=E6.get(e);if(i){const e=i.get(t);if(void 0!==e)return e}else i=new A6,E6.set(e,i);const r=function(e,t,n={}){const{supportsPagination:i=!0}=n,{stableKey:r,page:o,perPage:s,offset:a,include:l,fields:c,context:u}=b6(t),d=e.queries?.[u]?.[r]?.itemIds;if(!d)return null;const h=i&&-1!==s,p=h?a??(o-1)*s:0,f=h?Math.min(p+s,d.length):d.length;if(h&&d.length<p+s){const t=e.queries[u][r].meta?.totalItems;if(Number.isFinite(t)&&d.length<t)return null}const m=[];for(let t=p;t<f;t++){const n=d[t];if(Array.isArray(l)&&!l.includes(n))continue;if(void 0===n)continue;if(!e.items[u]?.hasOwnProperty(n))return null;const i=e.items[u][n];let r;if(Array.isArray(c)){r={};for(let e=0;e<c.length;e++){const t=c[e].split(".");let n=i;t.forEach(e=>{n=n?.[e]}),I6(r,t,n)}}else{if(!e.itemIsComplete[u]?.[n])return null;r=i}m.push(r)}return m}(e,t,n);return i.set(t,r),r});function T6(e,t={}){const{stableKey:n,context:i}=b6(t);return e.queries?.[i]?.[n]?.meta?.totalItems??null}var B6=!1;function N6(e,t,n,{alternativeFunctionName:i,isShorthandSelector:r=!1}={}){const o=h6[e]?.[t];if(o){if(!B6){const{alternative:s}=o,a=r?`'${n}'`:`The '${e}', '${t}' entity (used via '${n}')`;let l=`the '${s.kind}', '${s.name}' entity`;i&&(l+=` via the '${i}' function`),(0,Qt.A)(a,{...o,alternative:l})}B6=!0,setTimeout(()=>{B6=!1},0)}}var R6={};function O6(e){return a8()?.undoManager??e.undoManager}function L6(e){return e.navigationFallbackId}var M6=(0,Yn.N)(e=>(0,ce.A)((t,n)=>e(S5).getBlockPatterns().filter(({postTypes:e})=>!e||Array.isArray(e)&&e.includes(n)),()=>[e(S5).getBlockPatterns()])),P6=(0,Yn.N)(e=>(0,ce.A)((t,n,i,r)=>(Array.isArray(r)?r:[r]).map(t=>({delete:e(S5).canUser("delete",{kind:n,name:i,id:t}),update:e(S5).canUser("update",{kind:n,name:i,id:t})})),e=>[e.userPermissions]));function D6(e,t,n,i){return N6(t,n,"getEntityRecordPermissions"),P6(e,t,n,i)[0]}function F6(e,t){return e.registeredPostMeta?.[t]??{}}function z6(e){return e&&["number","string"].includes(typeof e)?0===Number(e)?null:e.toString():null}var V6=(0,Yn.N)(e=>(0,ce.A)(()=>{const t=e(S5).getEntityRecord("root","__unstableBase");if(!t)return null;const n="page"===t?.show_on_front?z6(t.page_on_front):null;if(n)return{postType:"page",postId:n};const i=e(S5).getDefaultTemplateId({slug:"front-page"});return i?{postType:"wp_template",postId:i}:""===i?R6:null},e=>[a9(e,"root","site"),a9(e,"root","__unstableBase"),q9(e,{slug:"front-page"})])),U6=(0,Yn.N)(e=>()=>{const t=e(S5).getEntityRecord("root","__unstableBase");return"page"===t?.show_on_front?z6(t.page_for_posts):null}),$6=(0,Yn.N)(e=>(t,n,i)=>{const r=Z3(e(S5)).getHomePage();if(!r)return;if("page"===n&&n===r?.postType&&i.toString()===r?.postId){const t=e(S5).getEntityRecords("postType","wp_template",{per_page:-1});if(!t)return;const n=t.find(({slug:e})=>"front-page"===e)?.id;if(n)return n}const o=e(S5).getEditedEntityRecord("postType",n,i);if(!o)return;const s=Z3(e(S5)).getPostsPageId();if("page"===n&&s===i.toString())return e(S5).getDefaultTemplateId({slug:"home"});const a=o.template;if(a){const t=e(S5).getEntityRecords("postType","wp_template",{per_page:-1})?.find(({slug:e})=>e===a);if(t)return t.id}let l;return l=o.slug?"page"===n?`${n}-${o.slug}`:`single-${n}-${o.slug}`:"page"===n?"page":`single-${n}`,e(S5).getDefaultTemplateId({slug:l})});function H6(e){return e.editorSettings}function W6(e){return e.editorAssets}function G6(e){return e.collaborationSupported}function q6(e,t,n){return e.viewConfigs?.[`${t}/${n}`]??{default_view:void 0,default_layouts:void 0,view_list:void 0,form:void 0}}function K6(e){return/^\s*\d+\s*$/.test(e)}var Y6=["create","read","update","delete"];function J6(e){const t={},n={create:"POST",read:"GET",update:"PUT",delete:"DELETE"};for(const[i,r]of Object.entries(n))t[i]=!!e&&e.includes(r);return t}function X6(e,t,n){return("object"==typeof t?[e,t.kind,t.name,t.id]:[e,t,n]).filter(Boolean).join("/")}var Z6={},Q6=(0,Yn.N)(e=>(t,n)=>e(S5).isResolving("getEmbedPreview",[n]));function e9(e,t){(0,Qt.A)("select( 'core' ).getAuthors()",{since:"5.9",alternative:"select( 'core' ).getUsers({ who: 'authors' })"});const n=(0,m6.F)("/wp/v2/users/?who=authors&per_page=100",t);return n9(e,n)}function t9(e){return e.currentUser}var n9=(0,ce.A)((e,t)=>(e.users.queries[t]??[]).map(t=>e.users.byId[t]),(e,t)=>[e.users.queries[t],e.users.byId]);function i9(e,t){return(0,Qt.A)("wp.data.select( 'core' ).getEntitiesByKind()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntitiesConfig()"}),r9(e,t)}var r9=(0,ce.A)((e,t)=>e.entities.config.filter(e=>e.kind===t),(e,t)=>e.entities.config);function o9(e,t,n){return(0,Qt.A)("wp.data.select( 'core' ).getEntity()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntityConfig()"}),s9(e,t,n)}function s9(e,t,n){return N6(t,n,"getEntityConfig"),e.entities.config?.find(e=>e.kind===t&&e.name===n)}var a9=(0,ce.A)((e,t,n,i,r)=>{N6(t,n,"getEntityRecord");const o=e.entities.records?.[t]?.[n]?.queriedData;if(!o)return;const s=r?.context??"default";if(!r||!r._fields){if(!o.itemIsComplete[s]?.[i])return;return o.items[s][i]}const a=o.items[s]?.[i];if(!a)return a;const l={},c=g6(r._fields)??[];for(let e=0;e<c.length;e++){const t=c[e].split(".");let n=a;t.forEach(e=>{n=n?.[e]}),I6(l,t,n)}return l},(e,t,n,i,r)=>{const o=r?.context??"default",s=e.entities.records?.[t]?.[n]?.queriedData;return[s?.items[o]?.[i],s?.itemIsComplete[o]?.[i]]});function l9(e,t,n,i,r){const o=e.entities.records?.[t]?.[n]?.queriedData;if(!o)return!1;const s=r?.context??"default";if(!r||!r._fields)return!!o.itemIsComplete[s]?.[i];const a=o.items[s]?.[i];if(!a)return!1;const l=g6(r._fields)??[];for(let e=0;e<l.length;e++){const t=l[e].split(".");let n=a;for(let e=0;e<t.length;e++){const i=t[e];if(!n||!Object.hasOwn(n,i))return!1;n=n[i]}}return!0}function c9(e,t,n,i){return a9(e,t,n,i)}a9.__unstableNormalizeArgs=e=>{const t=[...e],n=t?.[2];return t[2]=K6(n)?Number(n):n,t};var u9=(0,ce.A)((e,t,n,i)=>{N6(t,n,"getRawEntityRecord");const r=a9(e,t,n,i),o=s9(e,t,n);return r&&o?.rawAttributes?.length?Object.fromEntries(Object.keys(r).map(e=>{if(o.rawAttributes.includes(e)){const t=r[e]?.raw;return[e,void 0!==t?t:r[e]]}return[e,r[e]]})):r},(e,t,n,i,r)=>{const o=r?.context??"default";return[e.entities.config,e.entities.records?.[t]?.[n]?.queriedData?.items[o]?.[i],e.entities.records?.[t]?.[n]?.queriedData?.itemIsComplete[o]?.[i]]});function d9(e,t,n,i){return N6(t,n,"hasEntityRecords"),Array.isArray(h9(e,t,n,i))}var h9=(e,t,n,i)=>{N6(t,n,"getEntityRecords");const r=e.entities.records?.[t]?.[n]?.queriedData;return r?j6(r,i,{supportsPagination:!!s9(e,t,n)?.supportsPagination}):null},p9=(e,t,n,i)=>{N6(t,n,"getEntityRecordsTotalItems");const r=e.entities.records?.[t]?.[n]?.queriedData;return r?T6(r,i):null},f9=(e,t,n,i)=>{N6(t,n,"getEntityRecordsTotalPages");const r=e.entities.records?.[t]?.[n]?.queriedData;if(!r)return null;if(!s9(e,t,n)?.supportsPagination||-1===i?.per_page)return 1;const o=T6(r,i);return o?i?.per_page?Math.ceil(o/i.per_page):function(e,t={}){const{stableKey:n,context:i}=b6(t);return e.queries?.[i]?.[n]?.meta?.totalPages??null}(r,i):o},m9=(0,ce.A)(e=>{const{entities:{records:t}}=e,n=[];return Object.keys(t).forEach(i=>{Object.keys(t[i]).forEach(r=>{const o=Object.keys(t[i][r].edits).filter(t=>a9(e,i,r,t)&&v9(e,i,r,t));if(o.length){const t=s9(e,i,r);o.forEach(o=>{const s=_9(e,i,r,o);n.push({key:s?s[t.key||l6]:void 0,title:t?.getTitle?.(s)||"",name:r,kind:i})})}})}),n},e=>[e.entities.records]),g9=(0,ce.A)(e=>{const{entities:{records:t}}=e,n=[];return Object.keys(t).forEach(i=>{Object.keys(t[i]).forEach(r=>{const o=Object.keys(t[i][r].saving).filter(t=>k9(e,i,r,t));if(o.length){const t=s9(e,i,r);o.forEach(o=>{const s=_9(e,i,r,o);n.push({key:s?s[t.key||l6]:void 0,title:t?.getTitle?.(s)||"",name:r,kind:i})})}})}),n},e=>[e.entities.records]);function b9(e,t,n,i){return N6(t,n,"getEntityRecordEdits"),e.entities.records?.[t]?.[n]?.edits?.[i]}var y9=(0,ce.A)((e,t,n,i)=>{N6(t,n,"getEntityRecordNonTransientEdits");const{transientEdits:r}=s9(e,t,n)||{},o=b9(e,t,n,i)||{};return r?Object.keys(o).reduce((e,t)=>(r[t]||(e[t]=o[t]),e),{}):o},(e,t,n,i)=>[e.entities.config,e.entities.records?.[t]?.[n]?.edits?.[i]]);function v9(e,t,n,i){return N6(t,n,"hasEditsForEntityRecord"),k9(e,t,n,i)||Object.keys(y9(e,t,n,i)).length>0}var _9=(0,ce.A)((e,t,n,i)=>{N6(t,n,"getEditedEntityRecord");const r=u9(e,t,n,i),o=b9(e,t,n,i);return!(!r&&!o)&&{...r,...o}},(e,t,n,i,r)=>{const o=r?.context??"default";return[e.entities.config,e.entities.records?.[t]?.[n]?.queriedData.items[o]?.[i],e.entities.records?.[t]?.[n]?.queriedData.itemIsComplete[o]?.[i],e.entities.records?.[t]?.[n]?.edits?.[i]]});function x9(e,t,n,i){N6(t,n,"isAutosavingEntityRecord");const{pending:r,isAutosave:o}=e.entities.records?.[t]?.[n]?.saving?.[i]??{};return Boolean(r&&o)}function k9(e,t,n,i){return N6(t,n,"isSavingEntityRecord"),e.entities.records?.[t]?.[n]?.saving?.[i]?.pending??!1}function w9(e,t,n,i){return N6(t,n,"isDeletingEntityRecord"),e.entities.records?.[t]?.[n]?.deleting?.[i]?.pending??!1}function C9(e,t,n,i){return N6(t,n,"getLastEntitySaveError"),e.entities.records?.[t]?.[n]?.saving?.[i]?.error}function S9(e,t,n,i){return N6(t,n,"getLastEntityDeleteError"),e.entities.records?.[t]?.[n]?.deleting?.[i]?.error}function A9(e){(0,Qt.A)("select( 'core' ).getUndoEdit()",{since:"6.3"})}function I9(e){(0,Qt.A)("select( 'core' ).getRedoEdit()",{since:"6.3"})}function E9(e){return O6(e).hasUndo()}function j9(e){return O6(e).hasRedo()}function T9(e){return e.currentTheme?a9(e,"root","theme",e.currentTheme):null}function B9(e){return e.currentGlobalStylesId}function N9(e){return T9(e)?.theme_supports??Z6}function R9(e,t){return e.embedPreviews[t]}function O9(e,t){const n=e.embedPreviews[t],i='<a href="'+t+'">'+t+"</a>";return!!n&&n.html===i}function L9(e,t,n,i){const r="object"==typeof n;if(r&&(!n.kind||!n.name))return!1;r&&N6(n.kind,n.name,"canUser");const o=X6(t,n,i);return e.userPermissions[o]}function M9(e,t,n,i){return(0,Qt.A)("wp.data.select( 'core' ).canUserEditEntityRecord()",{since:"6.7",alternative:"wp.data.select( 'core' ).canUser( 'update', { kind, name, id } )"}),L9(e,"update",{kind:t,name:n,id:i})}function P9(e,t,n){return e.autosaves[n]}function D9(e,t,n,i){if(void 0===i)return;const r=e.autosaves[n];return r?.find(e=>e.author===i)}var F9=(0,Yn.N)(e=>(t,n,i)=>e(S5).hasFinishedResolution("getAutosaves",[n,i]));function z9(e){return e.editsReference}function V9(e){const t=T9(e);return t?e.themeBaseGlobalStyles[t.stylesheet]:null}function U9(e){const t=T9(e);return t?e.themeGlobalStyleVariations[t.stylesheet]:null}function $9(e){return e.blockPatterns}function H9(e){return e.blockPatternCategories}function W9(e){return e.userPatternCategories}function G9(e){(0,Qt.A)("select( 'core' ).getCurrentThemeGlobalStylesRevisions()",{since:"6.5.0",alternative:"select( 'core' ).getRevisions( 'root', 'globalStyles', ${ recordKey } )"});const t=B9(e);return t?e.themeGlobalStyleRevisions[t]:null}function q9(e,t){return e.defaultTemplates[JSON.stringify(t)]}var K9=(e,t,n,i,r)=>{N6(t,n,"getRevisions");const o=e.entities.records?.[t]?.[n]?.revisions?.[i];return o?j6(o,r):null};function Y9(e,t,n,i,r,o){const s=e.entities.records?.[t]?.[n]?.revisions?.[i];if(!s)return!1;const a=o?.context??"default";if(!o||!o._fields)return!!s.itemIsComplete[a]?.[r];const l=s.items[a]?.[r];if(!l)return!1;const c=g6(o._fields)??[];for(let e=0;e<c.length;e++){const t=c[e].split(".");let n=l;for(let e=0;e<t.length;e++){const i=t[e];if(!n||!Object.hasOwn(n,i))return!1;n=n[i]}}return!0}var J9=(0,ce.A)((e,t,n,i,r,o)=>{N6(t,n,"getRevision");const s=e.entities.records?.[t]?.[n]?.revisions?.[i];if(!s)return;const a=o?.context??"default";if(!o||!o._fields){if(!s.itemIsComplete[a]?.[r])return;return s.items[a][r]}const l=s.items[a]?.[r];if(!l)return l;const c={},u=g6(o._fields)??[];for(let e=0;e<u.length;e++){const t=u[e].split(".");let n=l;t.forEach(e=>{n=n?.[e]}),I6(c,t,n)}return c},(e,t,n,i,r,o)=>{const s=o?.context??"default",a=e.entities.records?.[t]?.[n]?.revisions?.[i];return[a?.items?.[s]?.[r],a?.itemIsComplete?.[s]?.[r]]});function X9(e){if(!e.syncConnectionStatuses)return;const t=["disconnected","connecting","connected"];let n;for(const i of Object.values(e.syncConnectionStatuses))(!n||t.indexOf(i.status)<t.indexOf(n.status))&&(n=i);return n}function Z9(e,t,n){if(!e||"object"!=typeof e||"string"!=typeof t&&!Array.isArray(t))return e;const i=Array.isArray(t)?t:t.split(".");let r=e;return i.forEach(e=>{r=r?.[e]}),void 0!==r?r:n}function Q9(e,t,n){return{type:"RECEIVE_ITEMS",items:e,persistedEdits:t,meta:n}}var e7=null;async function t7(e){if(null===e7){const e=await(0,N.default)({path:"/batch/v1",method:"OPTIONS"});e7=e.endpoints[0].args.requests.maxItems}const t=[];for(const n of function(e,t){const n=[...e],i=[];for(;n.length;)i.push(n.splice(0,t));return i}(e,e7)){const e=await(0,N.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 i;i=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(...i)}return t}function n7(e=t7){let t=0,n=[];const i=new i7;return{add(e){const r=++t;i.add(r);const o=e=>new Promise((t,o)=>{n.push({input:e,resolve:t,reject:o}),i.delete(r)});return"function"==typeof e?Promise.resolve(e(o)).finally(()=>{i.delete(r)}):o(e)},async run(){let t;i.size&&await new Promise(e=>{const t=i.subscribe(()=>{i.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 r=!0;return t.forEach((e,t)=>{const i=n[t];e?.error?(i?.reject(e.error),r=!1):i?.resolve(e?.output??e)}),n=[],r}}}var i7=class{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)}}};function r7(e){return"auto-draft"===e.status?{...e,title:""}:e}function o7(e,t){return{type:"RECEIVE_USER_QUERY",users:Array.isArray(t)?t:[t],queryID:e}}function s7(e){return{type:"RECEIVE_CURRENT_USER",currentUser:e}}function a7(e){return{type:"ADD_ENTITIES",entities:e}}function l7(e,t,n,i=void 0,r=!1,o=void 0,s=void 0){let a;return"postType"===e&&(n=Array.isArray(n)?n.map(r7):r7(n)),a=i?function(e,t={},n,i){return{...Q9(e,n,i),query:t}}(n,i,o,s):Q9(n,o,s),{...a,kind:e,name:t,invalidateCache:r}}function c7(e){return{type:"RECEIVE_CURRENT_THEME",currentTheme:e}}function u7(e){return{type:"RECEIVE_CURRENT_GLOBAL_STYLES_ID",id:e}}function d7(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLES",stylesheet:e,globalStyles:t}}function h7(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS",stylesheet:e,variations:t}}function p7(){return(0,Qt.A)("wp.data.dispatch( 'core' ).receiveThemeSupports",{since:"5.9"}),{type:"DO_NOTHING"}}function f7(e,t){return(0,Qt.A)("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 m7(e,t){return{type:"RECEIVE_EMBED_PREVIEW",url:e,preview:t}}var g7=(e,t,n,i,{__unstableFetch:r=N.default,throwOnError:o=!1}={})=>async({dispatch:s,resolveSelect:a})=>{N6(e,t,"deleteEntityRecord");const l=(await a.getEntitiesConfig(e)).find(n=>n.kind===e&&n.name===t);let c,u=!1;if(!l)return;const d=await s.__unstableAcquireStoreLock(S5,["entities","records",e,t,n],{exclusive:!0});try{s({type:"DELETE_ENTITY_RECORD_START",kind:e,name:t,recordId:n});let a=!1,{baseURL:d}=l;"postType"!==e||"wp_template"!==t||(!n||"string"!=typeof n||/^\d+$/.test(n))&&window?.__experimentalTemplateActivate||(d=d.slice(0,d.lastIndexOf("/"))+"/templates");try{let o=`${d}/${n}`;if(i&&(o=(0,m6.F)(o,i)),u=await r({path:o,method:"DELETE"}),await s(function(e,t,n,i=!1){return{type:"REMOVE_ITEMS",itemIds:Array.isArray(n)?n:[n],kind:e,name:t,invalidateCache:i}}(e,t,n,!0)),l.syncConfig){const i=`${e}/${t}`,r=n;a8()?.unload(i,r)}}catch(e){a=!0,c=e}if(s({type:"DELETE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:n,error:c}),a&&o)throw c;return u}finally{s.__unstableReleaseStoreLock(d)}},b7=(e,t,n,i,r={})=>({select:o,dispatch:s})=>{N6(e,t,"editEntityRecord");const a=o.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=o.getRawEntityRecord(e,t,n),u=o.getEditedEntityRecord(e,t,n),d=Object.keys(i).reduce((e,t)=>(e[t]=l[t]?{...u[t],...i[t]}:i[t],e),{}),h={kind:e,name:t,recordId:n,edits:Object.keys(i).reduce((e,t)=>{const n=c[t],i=d[t];return e[t]=F(n,i)?void 0:i,e},{})};if(a.syncConfig){const i=`${e}/${t}`,o=n,s=!r.undoIgnore&&!r.isCached,a=r.undoIgnore?o8:r8;a8()?.update(i,o,d,a,{isNewUndoLevel:s})}r.undoIgnore||o.getUndoManager().addRecord([{id:{kind:e,name:t,recordId:n},changes:Object.keys(i).reduce((e,t)=>(e[t]={from:u[t],to:i[t]},e),{})}],r.isCached),s({type:"EDIT_ENTITY_RECORD",...h})},y7=(e,t,n)=>({select:i,dispatch:r})=>{const o=i.getEntityConfig(e,t);if(N6(e,t,"clearEntityRecordEdits"),!o)throw new Error(`The entity being edited (${e}, ${t}) does not have a loaded config.`);const s=i.getEntityRecordEdits(e,t,n);if(!s)return;const a=Object.keys(s).reduce((e,t)=>(e[t]=void 0,e),{});r({type:"EDIT_ENTITY_RECORD",kind:e,name:t,recordId:n,edits:a})},v7=()=>({select:e,dispatch:t})=>{const n=e.getUndoManager().undo();n&&t({type:"UNDO",record:n})},_7=()=>({select:e,dispatch:t})=>{const n=e.getUndoManager().redo();n&&t({type:"REDO",record:n})},x7=()=>({select:e})=>{e.getUndoManager().addRecord()},k7=(e,t,n,{isAutosave:i=!1,__unstableFetch:r=N.default,throwOnError:o=!1}={})=>async({select:s,resolveSelect:a,dispatch:l})=>{N6(e,t,"saveEntityRecord");const c=(await a.getEntitiesConfig(e)).find(n=>n.kind===e&&n.name===t);if(!c)return;const u=c.key??l6,d=n[u],h=!!u&&!d,p=await l.__unstableAcquireStoreLock(S5,["entities","records",e,t,d||(0,Qi.A)()],{exclusive:!0});try{for(const[i,r]of Object.entries(n))if("function"==typeof r){const o=r(s.getEditedEntityRecord(e,t,d));l.editEntityRecord(e,t,d,{[i]:o},{undoIgnore:!0}),n[i]=o}let a,u;l({type:"SAVE_ENTITY_RECORD_START",kind:e,name:t,recordId:d,isAutosave:i});let p=!1,{baseURL:f}=c;"postType"!==e||"wp_template"!==t||(!d||"string"!=typeof d||/^\d+$/.test(d))&&window?.__experimentalTemplateActivate||(f=f.slice(0,f.lastIndexOf("/"))+"/templates");try{const o=`${f}${d?"/"+d:""}`,u=h?{}:s.getRawEntityRecord(e,t,d);if(i){const i={...u,...n},s=["title","excerpt","content","meta"].reduce((e,t)=>(t in i&&(e[t]=i[t]),e),{status:"auto-draft"===i.status?"draft":void 0});if(a=await r({path:`${o}/autosaves`,method:"POST",data:s}),u.id===a.id){let n={...u,...s,...a};n=Object.keys(n).reduce((e,t)=>(["title","excerpt","content","meta"].includes(t)?e[t]=n[t]:e[t]="status"===t?"auto-draft"===u.status&&"draft"===n.status?n.status:u.status:u[t],e),{}),l.receiveEntityRecords(e,t,n,void 0,!0)}else l.receiveAutosaves(u.id,a)}else{let i=n;c.__unstablePrePersist&&(i={...i,...await c.__unstablePrePersist(u,i)}),a=await r({path:o,method:d?"PUT":"POST",data:i}),l.receiveEntityRecords(e,t,a,void 0,!0,i),c.syncConfig&&a8()?.update(`${e}/${t}`,d,a,o8,{isSave:!0})}}catch(e){p=!0,u=e}if(l({type:"SAVE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:d,error:u,isAutosave:i}),p&&o)throw u;return a}finally{l.__unstableReleaseStoreLock(p)}},w7=e=>async({dispatch:t})=>{const n=n7(),i={saveEntityRecord:(e,i,r,o)=>n.add(n=>t.saveEntityRecord(e,i,r,{...o,__unstableFetch:n})),saveEditedEntityRecord:(e,i,r,o)=>n.add(n=>t.saveEditedEntityRecord(e,i,r,{...o,__unstableFetch:n})),deleteEntityRecord:(e,i,r,o,s)=>n.add(n=>t.deleteEntityRecord(e,i,r,o,{...s,__unstableFetch:n}))},r=e.map(e=>e(i)),[,...o]=await Promise.all([n.run(),...r]);return o},C7=(e,t,n,i)=>async({select:r,dispatch:o,resolveSelect:s})=>{if(N6(e,t,"saveEditedEntityRecord"),!r.hasEditsForEntityRecord(e,t,n))return;const a=(await s.getEntitiesConfig(e)).find(n=>n.kind===e&&n.name===t);if(!a)return;const l=a.key||l6,c=r.getEntityRecordNonTransientEdits(e,t,n),u={[l]:n,...c};return await o.saveEntityRecord(e,t,u,i)},S7=(e,t,n,i,r)=>async({select:o,dispatch:s,resolveSelect:a})=>{if(N6(e,t,"__experimentalSaveSpecifiedEntityEdits"),!o.hasEditsForEntityRecord(e,t,n))return;const l=o.getEntityRecordNonTransientEdits(e,t,n),c={};for(const e of i)I6(c,e,Z9(l,e));const u=(await a.getEntitiesConfig(e)).find(n=>n.kind===e&&n.name===t);return n&&(c[u?.key||l6]=n),await s.saveEntityRecord(e,t,c,r)};function A7(e){return(0,Qt.A)("wp.data.dispatch( 'core' ).receiveUploadPermissions",{since:"5.9",alternative:"receiveUserPermission"}),I7("create/media",e)}function I7(e,t){return{type:"RECEIVE_USER_PERMISSION",key:e,isAllowed:t}}function E7(e){return{type:"RECEIVE_USER_PERMISSIONS",permissions:e}}function j7(e,t){return{type:"RECEIVE_AUTOSAVES",postId:e,autosaves:Array.isArray(t)?t:[t]}}function T7(e){return{type:"RECEIVE_NAVIGATION_FALLBACK_ID",fallbackId:e}}function B7(e,t){return{type:"RECEIVE_DEFAULT_TEMPLATE",query:e,templateId:t}}var N7=(e,t,n,i,r,o=!1,s)=>async({dispatch:a,resolveSelect:l})=>{N6(e,t,"receiveRevisions");const c=(await l.getEntitiesConfig(e)).find(n=>n.kind===e&&n.name===t);a({type:"RECEIVE_ITEM_REVISIONS",key:c?.revisionKey??l6,items:i,recordKey:n,meta:s,query:r,kind:e,name:t,invalidateCache:o})};function R7(e,t,n,i){return i?{type:"SET_SYNC_CONNECTION_STATUS",kind:e,name:t,key:n,status:i}:{type:"CLEAR_SYNC_CONNECTION_STATUS",kind:e,name:t,key:n}}function O7(e,t){return{type:"RECEIVE_REGISTERED_POST_META",postType:e,registeredPostMeta:t}}var L7=(e,t={},{__unstableFetch:n=N.default,throwOnError:i=!1}={})=>async({dispatch:r,resolveSelect:o})=>{if(!e)return;const s="postType",a="attachment",l=(await o.getEntitiesConfig(s)).find(e=>e.kind===s&&e.name===a);if(!l)return;const c=await r.__unstableAcquireStoreLock(S5,["entities","records",s,a,e],{exclusive:!0});let u,d,h=!1;try{r({type:"SAVE_ENTITY_RECORD_START",kind:s,name:a,recordId:e});try{const i=`${l.baseURL}/${e}/edit`,o=await n({path:i,method:"POST",data:{...t}});o&&(r.receiveEntityRecords(s,a,o,void 0,!0,void 0,void 0),u=o)}catch(e){d=e,h=!0}if(r({type:"SAVE_ENTITY_RECORD_FINISH",kind:s,name:a,recordId:e,error:d}),h&&i)throw d;return u}finally{r.__unstableReleaseStoreLock(c)}};function M7(e){return{type:"RECEIVE_EDITOR_SETTINGS",settings:e}}function P7(e){return{type:"RECEIVE_EDITOR_ASSETS",assets:e}}var D7=e=>({dispatch:t})=>{t({type:"SET_COLLABORATION_SUPPORTED",supported:e})};function F7(e,t,n){return{type:"RECEIVE_VIEW_CONFIG",kind:e,name:t,config:n}}var z7=e=>(...t)=>async({resolveSelect:n})=>{await n[e](...t)};function V7(e){if(!e)return;const t=Object.entries(e).filter(([e,t])=>("context"===e||"_fields"===e)&&null!=t);return t.length>0?Object.fromEntries(t):void 0}var U7=Symbol("RECEIVE_INTERMEDIATE_RESULTS"),$7=e=>async({dispatch:t})=>{const n=(0,m6.F)("/wp/v2/users/?who=authors&per_page=100",e),i=await(0,N.default)({path:n});t.receiveUserQuery(n,i)},H7=()=>async({dispatch:e})=>{const t=await(0,N.default)({path:"/wp/v2/users/me"});e.receiveCurrentUser(t)},W7=(e,t,n="",i)=>async({select:r,dispatch:o,registry:s,resolveSelect:a})=>{const l=(await a.getEntitiesConfig(e)).find(n=>n.name===t&&n.kind===e);if(!l)return;const c=await o.__unstableAcquireStoreLock(S5,["entities","records",e,t,n],{exclusive:!1});try{if(void 0!==i&&i._fields&&(i={...i,_fields:[...new Set([...g6(i._fields)||[],l.key||l6])].join()}),void 0!==i&&i._fields&&r.hasEntityRecord(e,t,n,i))return;let{baseURL:c}=l;"postType"!==e||"wp_template"!==t||(!n||"string"!=typeof n||/^\d+$/.test(n))&&window?.__experimentalTemplateActivate||(c=c.slice(0,c.lastIndexOf("/"))+"/templates");const u=(0,m6.F)(c+(n?"/"+n:""),{...l.baseURLParams,...i}),d=await(0,N.default)({path:u,parse:!1}),h=await d.json(),p=J6(d.headers?.get("allow")),f=[],m={};for(const i of Y6)m[X6(i,{kind:e,name:t,id:n})]=p[i],f.push([i,{kind:e,name:t,id:n}]);if(l.syncConfig&&K6(n)&&!i){const r=`${e}/${t}`,s=n,c={...h};Object.entries(l.transientEdits??{}).filter(([e,t])=>void 0===c[e]&&t&&"object"==typeof t&&"read"in t&&"function"==typeof t.read).forEach(([e,t])=>{c[e]=t.read(c)}),a8()?.load(l.syncConfig,r,s,c,{editRecord:(i,r={})=>{Object.keys(i).length&&o({type:"EDIT_ENTITY_RECORD",kind:e,name:t,recordId:n,edits:i,meta:{undo:void 0},options:r})},getEditedRecord:async()=>await a.getEditedEntityRecord(e,t,n),onStatusChange:i=>{o.setSyncConnectionStatus(e,t,n,i)},refetchRecord:async()=>{o.receiveEntityRecords(e,t,await(0,N.default)({path:u,parse:!0}),i)},persistCRDTDoc:()=>{a.getEditedEntityRecord(e,t,n).then(n=>{const{meta:i,status:r}=n;"auto-draft"!==r&&i&&o.saveEntityRecord(e,t,n)})},addUndoMeta:(e,t)=>{const n=X8(e);n&&t.set("selectionHistory",n)},restoreUndoMeta:(e,t)=>{const n=t.get("selectionHistory");n&&setTimeout(()=>{e6(n,e)},0)}})}s.batch(()=>{o.receiveEntityRecords(e,t,h,i),o.receiveUserPermissions(m),o.finishResolutions("canUser",f)})}finally{o.__unstableReleaseStoreLock(c)}};W7.shouldInvalidate=(e,t,n)=>"root"===t&&"site"===n&&("RECEIVE_ITEMS"===e.type&&e.persistedEdits&&"auto-draft"!==e.persistedEdits.status||"REMOVE_ITEMS"===e.type)&&"postType"===e.kind&&"wp_template"===e.name;var G7=z7("getEntityRecord"),q7=z7("getEntityRecord"),K7=(e,t,n={})=>async({dispatch:i,registry:r,resolveSelect:o})=>{const s=(await o.getEntitiesConfig(e)).find(n=>n.name===t&&n.kind===e);if(!s)return;const a=await i.__unstableAcquireStoreLock(S5,["entities","records",e,t],{exclusive:!1}),l={...n},c=s.key||l6;function u(n,i){const r=V7(i);return n.filter(e=>e?.[c]).map(n=>[e,t,n[c],r])}try{n._fields&&(n={...n,_fields:[...new Set([...g6(n._fields)||[],c])].join()});let{baseURL:o}=s;const{combinedTemplates:d=!0}=n;"postType"===e&&"wp_template"===t&&d&&(o=o.slice(0,o.lastIndexOf("/"))+"/templates");const h=(0,m6.F)(o,{...s.baseURLParams,...n});let p,f=[];if(s.supportsPagination&&-1!==n.per_page){const e=await(0,N.default)({path:h,parse:!1});f=Object.values(await e.json()),p={totalItems:parseInt(e.headers.get("X-WP-Total")),totalPages:parseInt(e.headers.get("X-WP-TotalPages"))}}else if(-1===n.per_page&&!0===n[U7]){let o,s=1;do{const a=await(0,N.default)({path:(0,m6.F)(h,{page:s,per_page:100}),parse:!1}),c=Object.values(await a.json());o=parseInt(a.headers.get("X-WP-TotalPages")),p||(p={totalItems:parseInt(a.headers.get("X-WP-Total")),totalPages:1}),f.push(...c),r.batch(()=>{i.receiveEntityRecords(e,t,f,n,!1,void 0,p),i.finishResolutions("getEntityRecord",u(c,l))}),s++}while(s<=o)}else f=Object.values(await(0,N.default)({path:h})),p={totalItems:f.length,totalPages:1};if(s.syncConfig&&-1===n.per_page){const r=`${e}/${t}`;a8()?.loadCollection(s.syncConfig,r,{onStatusChange:n=>{i.setSyncConnectionStatus(e,t,null,n)},refetchRecords:async()=>{i.receiveEntityRecords(e,t,await(0,N.default)({path:h,parse:!0}),n)}})}n._fields&&(f=f.map(e=>(n._fields.split(",").forEach(t=>{e.hasOwnProperty(t)||(e[t]=void 0)}),e))),r.batch(()=>{i.receiveEntityRecords(e,t,f,n,!1,void 0,p);const r=f.filter(e=>!!e?.[c]&&!!e?._links?.self?.[0]?.targetHints?.allow).map(e=>({id:e[c],permissions:J6(e._links.self[0].targetHints.allow)})),o=[],s={};for(const n of r)for(const i of Y6)o.push([i,{kind:e,name:t,id:n.id}]),s[X6(i,{kind:e,name:t,id:n.id})]=n.permissions[i];r.length>0&&(i.receiveUserPermissions(s),i.finishResolutions("canUser",o)),i.finishResolutions("getEntityRecord",u(f,l)),i.__unstableReleaseStoreLock(a)})}catch{i.__unstableReleaseStoreLock(a)}};K7.shouldInvalidate=(e,t,n)=>("RECEIVE_ITEMS"===e.type||"REMOVE_ITEMS"===e.type)&&e.invalidateCache&&t===e.kind&&n===e.name;var Y7=z7("getEntityRecords"),J7=z7("getEntityRecords"),X7=()=>async({dispatch:e,resolveSelect:t})=>{const n=await t.getEntityRecords("root","theme",{status:"active"});e.receiveCurrentTheme(n[0])},Z7=z7("getCurrentTheme"),Q7=e=>async({dispatch:t})=>{try{const n=await(0,N.default)({path:(0,m6.F)("/oembed/1.0/proxy",{url:e})});t.receiveEmbedPreview(e,n)}catch{t.receiveEmbedPreview(e,!1)}},eee=(e,t,n)=>async({dispatch:i,registry:r,resolveSelect:o})=>{if(!Y6.includes(e))throw new Error(`'${e}' is not a valid action.`);const{hasStartedResolution:s}=r.select(S5);for(const i of Y6)if(i!==e&&s("canUser",[i,t,n]))return;let a,l=null;if("object"==typeof t){if(!t.kind||!t.name)throw new Error("The entity resource object is not valid.");const e=(await o.getEntitiesConfig(t.kind)).find(e=>e.name===t.name&&e.kind===t.kind);if(!e)return;l=e.baseURL+(t.id?"/"+t.id:"")}else l=`/wp/v2/${t}`+(n?"/"+n:"");try{a=await(0,N.default)({path:l,method:"OPTIONS",parse:!1})}catch{return}const c=J6(a.headers?.get("allow")),u={},d=[];for(const i of Y6)u[X6(i,t,n)]=c[i],i!==e&&d.push([i,t,n]);r.batch(()=>{i.receiveUserPermissions(u),i.finishResolutions("canUser",d)})},tee=(e,t,n)=>async({dispatch:i})=>{await i(eee("update",{kind:e,name:t,id:n}))},nee=(e,t)=>async({dispatch:n,resolveSelect:i})=>{const{rest_base:r,rest_namespace:o="wp/v2",supports:s}=await i.getPostType(e);if(!s?.autosave)return;const a=await(0,N.default)({path:`/${o}/${r}/${t}/autosaves?context=edit`});a&&a.length&&n.receiveAutosaves(t,a)},iee=(e,t)=>async({resolveSelect:n})=>{await n.getAutosaves(e,t)},ree=()=>async({dispatch:e,resolveSelect:t})=>{const n=await t.getEntityRecords("root","theme",{status:"active"}),i=n?.[0]?._links?.["wp:user-global-styles"]?.[0]?.href;if(!i)return;const r=i.match(/\/(\d+)(?:\?|$)/),o=r?Number(r[1]):null;o&&e.__experimentalReceiveCurrentGlobalStylesId(o)},oee=()=>async({resolveSelect:e,dispatch:t})=>{const n=await e.getCurrentTheme(),i=await(0,N.default)({path:`/wp/v2/global-styles/themes/${n.stylesheet}?context=view`});t.__experimentalReceiveThemeBaseGlobalStyles(n.stylesheet,i)},see=()=>async({resolveSelect:e,dispatch:t})=>{const n=await e.getCurrentTheme(),i=await(0,N.default)({path:`/wp/v2/global-styles/themes/${n.stylesheet}/variations?context=view`});t.__experimentalReceiveThemeGlobalStyleVariations(n.stylesheet,i)},aee=()=>async({resolveSelect:e,dispatch:t})=>{const n=await e.__experimentalGetCurrentGlobalStylesId(),i=n?await e.getEntityRecord("root","globalStyles",n):void 0,r=i?._links?.["version-history"]?.[0]?.href;if(r){const e=await(0,N.default)({url:r}),i=e?.map(e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[Q(e),t])));t.receiveThemeGlobalStyleRevisions(n,i)}};aee.shouldInvalidate=e=>"SAVE_ENTITY_RECORD_FINISH"===e.type&&"root"===e.kind&&!e.error&&"globalStyles"===e.name;var lee=()=>async({dispatch:e})=>{const t=await async function(){const e=await(0,N.default)({path:"/wp/v2/block-patterns/patterns"});return e?e.map(e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[Q(e),t]))):[]}();e({type:"RECEIVE_BLOCK_PATTERNS",patterns:t})},cee=()=>async({dispatch:e})=>{e({type:"RECEIVE_BLOCK_PATTERN_CATEGORIES",categories:await(0,N.default)({path:"/wp/v2/block-patterns/categories"})})},uee=()=>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,qr.S)(e.name),name:e.slug}))||[]})},dee=()=>async({dispatch:e,select:t,registry:n})=>{const i=await(0,N.default)({path:(0,m6.F)("/wp-block-editor/v1/navigation-fallback",{_embed:!0})}),r=i?._embedded?.self;n.batch(()=>{if(e.receiveNavigationFallbackId(i?.id),!r)return;const n=!t.getEntityRecord("postType","wp_navigation",i.id);e.receiveEntityRecords("postType","wp_navigation",r,void 0,n),e.finishResolution("getEntityRecord",["postType","wp_navigation",i.id])})},hee=e=>async({dispatch:t,registry:n,resolveSelect:i})=>{const r=await(0,N.default)({path:(0,m6.F)("/wp/v2/templates/lookup",e)});await i.getEntitiesConfig("postType");const o=window?.__experimentalTemplateActivate&&r?.wp_id||r?.id;n.batch(()=>{t.receiveDefaultTemplateId(e,o||""),o&&(r.id=o,t.receiveEntityRecords("postType",r.type,r),t.finishResolution("getEntityRecord",["postType",r.type,o]))})};hee.shouldInvalidate=e=>"RECEIVE_ITEMS"===e.type&&"root"===e.kind&&"site"===e.name;var pee=(e,t,n,i={})=>async({dispatch:r,registry:o,resolveSelect:s})=>{const a=(await s.getEntitiesConfig(e)).find(n=>n.name===t&&n.kind===e);if(!a)return;const l={...i},c=await r.__unstableAcquireStoreLock(S5,["entities","records",e,t,n,"revisions"],{exclusive:!1});try{i._fields&&(i={...i,_fields:[...new Set([...g6(i._fields)||[],a.revisionKey||l6])].join()});const s=(0,m6.F)(a.getRevisionsUrl(n),i);let c,u;const d={},h=a.supportsPagination&&-1!==i.per_page;try{u=await(0,N.default)({path:s,parse:!h})}catch{return}u&&(h?(c=Object.values(await u.json()),d.totalItems=parseInt(u.headers.get("X-WP-Total"))):c=Object.values(u),i._fields&&(c=c.map(e=>(i._fields.split(",").forEach(t=>{e.hasOwnProperty(t)||(e[t]=void 0)}),e))),o.batch(()=>{r.receiveRevisions(e,t,n,c,i,!1,d);const o=a.revisionKey||l6,s=V7(l),u=c.filter(e=>e[o]).map(i=>[e,t,n,i[o],s]);r.finishResolutions("getRevision",u)}))}finally{r.__unstableReleaseStoreLock(c)}};pee.shouldInvalidate=(e,t,n,i)=>"SAVE_ENTITY_RECORD_FINISH"===e.type&&n===e.name&&t===e.kind&&!e.error&&i===e.recordId;var fee=(e,t,n,i,r)=>async({select:o,dispatch:s,resolveSelect:a})=>{const l=(await a.getEntitiesConfig(e)).find(n=>n.name===t&&n.kind===e);if(!l)return;void 0!==r&&r._fields&&(r={...r,_fields:[...new Set([...g6(r._fields)||[],l.revisionKey||l6])].join()});const c=await s.__unstableAcquireStoreLock(S5,["entities","records",e,t,n,"revisions",i],{exclusive:!1});try{if(o.hasRevision(e,t,n,i,r))return;const a=(0,m6.F)(l.getRevisionsUrl(n,i),r);let c;try{c=await(0,N.default)({path:a})}catch{return}c&&s.receiveRevisions(e,t,n,c,r)}finally{s.__unstableReleaseStoreLock(c)}},mee=e=>async({dispatch:t,resolveSelect:n})=>{let i;try{const{rest_namespace:t="wp/v2",rest_base:r}=await n.getPostType(e)||{};i=await(0,N.default)({path:`${t}/${r}/?context=edit`,method:"OPTIONS"})}catch{return}i&&t.receiveRegisteredPostMeta(e,i?.schema?.properties?.meta?.properties)},gee=e=>async({dispatch:t})=>{const n=p6.find(t=>t.kind===e);if(n)try{const e=await n.loadEntities();if(!e.length)return;t.addEntities(e)}catch{}},bee=()=>async({dispatch:e})=>{const t=await(0,N.default)({path:"/wp-block-editor/v1/settings"});e.receiveEditorSettings(t)},yee=()=>async({dispatch:e})=>{const t=await(0,N.default)({path:"/wp-block-editor/v1/assets"});e.receiveEditorAssets(t)},vee=(e,t)=>async({dispatch:n})=>{const i=await(0,N.default)({path:(0,m6.F)("/wp/v2/view-config",{kind:e,name:t})});n.receiveViewConfig(e,t,i)};function _ee(e,t){const n={...e};let i=n;for(const e of t)i.children={...i.children,[e]:{locks:[],children:{},...i.children[e]}},i=i.children[e];return n}function xee(e,t){let n=e;for(const e of t){const t=n.children[e];if(!t)return null;n=t}return n}function kee({exclusive:e},t){return!(!e||!t.length)||!(e||!t.filter(e=>e.exclusive).length)}var wee={requests:[],tree:{locks:[],children:{}}};function Cee(e=wee,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:i}=t,{store:r,path:o}=i,s=[r,...o],a=_ee(e.tree,s),l=xee(a,s);return l.locks=[...l.locks,n],{...e,requests:e.requests.filter(e=>e!==i),tree:a}}case"RELEASE_LOCK":{const{lock:n}=t,i=[n.store,...n.path],r=_ee(e.tree,i),o=xee(r,i);return o.locks=o.locks.filter(e=>e!==n),{...e,tree:r}}}return e}function See(e,t,n,{exclusive:i}){const r=[t,...n],o=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}}(o,r))if(kee({exclusive:i},e.locks))return!1;const s=xee(o,r);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(kee({exclusive:i},e.locks))return!1;return!0}function Aee(){let e=Cee(void 0,{type:"@@INIT"});function t(){for(const t of function(e){return e.requests}(e)){const{store:n,path:i,exclusive:r,notifyAcquired:o}=t;if(See(e,n,i,{exclusive:r})){const s={store:n,path:i,exclusive:r};e=Cee(e,{type:"GRANT_LOCK_REQUEST",lock:s,request:t}),o(s)}}}return{acquire:function(n,i,r){return new Promise(o=>{e=Cee(e,{type:"ENQUEUE_LOCK_REQUEST",request:{store:n,path:i,exclusive:r,notifyAcquired:o}}),t()})},release:function(n){e=Cee(e,{type:"RELEASE_LOCK",lock:n}),t()}}}var Iee=[...d6,...p6.filter(e=>!!e.name)],Eee=Iee.reduce((e,t)=>{const{kind:n,name:i,plural:r}=t,o=f6(n,i);if(e[o]=(e,t,r)=>(N6(n,i,o,{isShorthandSelector:!0,alternativeFunctionName:"getEntityRecord"}),a9(e,n,i,t,r)),r){const t=f6(n,r,"get");e[t]=(e,r)=>(N6(n,i,t,{isShorthandSelector:!0,alternativeFunctionName:"getEntityRecords"}),h9(e,n,i,r))}return e},{}),jee=Iee.reduce((e,t)=>{const{kind:n,name:i,plural:r}=t,o=f6(n,i);if(e[o]=(e,t)=>(N6(n,i,o,{isShorthandSelector:!0,alternativeFunctionName:"getEntityRecord"}),W7(n,i,e,t)),r){const t=f6(n,r,"get");e[t]=(...e)=>(N6(n,r,t,{isShorthandSelector:!0,alternativeFunctionName:"getEntityRecords"}),K7(n,i,...e)),e[t].shouldInvalidate=e=>K7.shouldInvalidate(e,n,i)}return e},{}),Tee=Iee.reduce((e,t)=>{const{kind:n,name:i}=t,r=f6(n,i,"save");e[r]=(e,t)=>(N6(n,i,r,{isShorthandSelector:!0,alternativeFunctionName:"saveEntityRecord"}),k7(n,i,e,t));const o=f6(n,i,"delete");return e[o]=(e,t,r)=>(N6(n,i,o,{isShorthandSelector:!0,alternativeFunctionName:"deleteEntityRecord"}),g7(n,i,e,t,r)),e},{}),Bee=(0,P.A)(S5,{reducer:S6,actions:{...C,...Tee,...function(){const e=Aee();return{__unstableAcquireStoreLock:function(t,n,{exclusive:i}){return()=>e.acquire(t,n,i)},__unstableReleaseStoreLock:function(t){return()=>e.release(t)}}}()},selectors:{...w,...Eee},resolvers:{...A,...jee}});function Nee(e,t,n){if(function(e){return null!==e&&"object"==typeof e&&Object.getPrototypeOf(e)===Object.prototype}(n))for(const[i,r]of Object.entries(n))Nee(e,`${t}[${i}]`,r);else void 0!==n&&e.append(t,String(n))}Z3(Bee).registerPrivateSelectors(k),Z3(Bee).registerPrivateActions(S),(0,D.register)(Bee);var Ree=class extends Error{code;file;constructor({code:e,message:t,file:n,cause:i}){super(t,{cause:i}),Object.setPrototypeOf(this,new.target.prototype),this.code=e,this.file=n}};function Oee(e,t){if(!t||t.includes("*"))return;const n=t.some(t=>t.includes("/")?t===e.type:e.type.startsWith(`${t}/`));if(e.type&&!n)throw new Ree({code:"MIME_TYPE_NOT_SUPPORTED",message:(0,ee.sprintf)((0,ee.__)("%s: Sorry, this file type is not supported here."),e.name),file:e})}function Lee(e,t){const n=(i=t)?Object.entries(i).flatMap(([e,t])=>{const[n]=t.split("/");return[t,...e.split("|").map(e=>`${n}/${e}`)]}):null;var i;if(!n)return;const r=n.includes(e.type);if(e.type&&!r)throw new Ree({code:"MIME_TYPE_NOT_ALLOWED_FOR_USER",message:(0,ee.sprintf)((0,ee.__)("%s: Sorry, you are not allowed to upload this file type."),e.name),file:e})}function Mee(e,t){if(e.size<=0)throw new Ree({code:"EMPTY_FILE",message:(0,ee.sprintf)((0,ee.__)("%s: This file is empty."),e.name),file:e});if(t&&e.size>t)throw new Ree({code:"SIZE_ABOVE_LIMIT",message:(0,ee.sprintf)((0,ee.__)("%s: This file exceeds the maximum upload size for this site."),e.name),file:e})}function Pee({wpAllowedMimeTypes:e,allowedTypes:t,additionalData:n={},filesList:i,maxUploadFileSize:r,onError:o,onFileChange:s,signal:a,multiple:l=!0}){if(!l&&i.length>1)return void o?.(new Error((0,ee.__)("Only one file can be used here.")));const c=[],u=[],d=(e,t)=>{window.__clientSideMediaProcessing||u[e]?.url&&Ds(u[e].url),u[e]=t,s?.(u.filter(e=>null!==e))};for(const n of i){try{Lee(n,e)}catch(e){o?.(e);continue}try{Oee(n,t)}catch(e){o?.(e);continue}try{Mee(n,r)}catch(e){o?.(e);continue}c.push(n),window.__clientSideMediaProcessing||(u.push({url:Ps(n)}),s?.(u))}c.map(async(e,t)=>{try{const i=await async function(e,t={},n){const i=new FormData;i.append("file",e,e.name||e.type.replace("/","."));for(const[e,n]of Object.entries(t))Nee(i,e,n);return function(e){const{alt_text:t,source_url:n,...i}=e;return{...i,alt:e.alt_text,caption:e.caption?.raw??"",title:e.title.raw,url:e.source_url,poster:e._embedded?.["wp:featuredmedia"]?.[0]?.source_url||void 0}}(await(0,N.default)({path:"/wp/v2/media?_embed=wp:featuredmedia",body:i,method:"POST",signal:n}))}(e,n,a);d(t,i)}catch(n){let i;d(t,null),i="object"==typeof n&&null!==n&&"message"in n?"string"==typeof n.message?n.message:String(n.message):(0,ee.sprintf)((0,ee.__)("Error while uploading file %s to the media library."),e.name),o?.(new Ree({code:"GENERAL",message:i,file:e,cause:n instanceof Error?n:void 0}))}})}var Dee=n(28691),Fee=n(14762);const zee=async(e,{perPage:t=20}={})=>{const n=await(0,N.default)({path:(0,m6.F)("/wp/v2/search",{search:e,per_page:t,type:"post"})});return Array.isArray(n)?n.map(e=>({id:e.id,url:e.url,title:(0,qr.S)(e.title)||`(${(0,ee.__)("no name","mailpoet")})`,type:e.subtype||e.type})):[]};var Vee=n(23108),Uee=n.n(Vee),$ee=n(92794);function Hee({isActive:e,label:t,info:n,onToggle:i}){return(0,Er.jsx)(zv.A,{icon:e&&xw.A,isSelected:e,onClick:i,role:"menuitemcheckbox",info:n,children:t})}var Wee=n(56803);const Gee="mailpoet-form-editor",qee=Th.fontSizes.map(e=>({...e,size:`${e.size}${Number.isNaN(Number(`${e.size}`||NaN))?"":"px"}`}));var Kee=n(35558);const Yee=e=>{const t={full_width:e.fullWidth?"1":"0"};return e.inheritFromTheme||(t.bold=e.bold?"1":"0",(0,Kee.has)(e,"backgroundColor")&&e.backgroundColor&&(t.background_color=e.backgroundColor),(0,Kee.has)(e,"gradient")&&e.gradient&&(t.gradient=e.gradient),(0,Kee.has)(e,"fontSize")&&void 0!==e.fontSize&&(t.font_size=e.fontSize),(0,Kee.has)(e,"fontColor")&&e.fontColor&&(t.font_color=e.fontColor),(0,Kee.has)(e,"borderSize")&&void 0!==e.borderSize&&(t.border_size=e.borderSize),(0,Kee.has)(e,"borderRadius")&&void 0!==e.borderRadius&&(t.border_radius=e.borderRadius),(0,Kee.has)(e,"borderColor")&&e.borderColor&&(t.border_color=e.borderColor),(0,Kee.has)(e,"padding")&&void 0!==e.padding&&(t.padding=e.padding),(0,Kee.has)(e,"fontFamily")&&e.fontFamily&&(t.font_family=e.fontFamily)),t},Jee=(e,t,n=null)=>{const i=e.find(e=>e.slug===t);return i?i.color:n},Xee=(e,t,n=null)=>{const i=e.find(e=>e.slug===t);return i?i.gradient:n},Zee=(e,t,n=null)=>{const i=e.find(e=>e.slug===t);return i?i.size:n},Qee=(e,t,n,i)=>{if(!Array.isArray(i))throw new Error("Mapper expects customFields to be an array.");const r=o=>{if(!Array.isArray(o))throw new Error("Mapper expects blocks to be an array.");return o.map(o=>{const s={type:"text",params:{label:o.attributes.label,class_name:o.attributes.className||null}};switch(o.attributes.mandatory&&(s.params.required="1"),o.attributes.labelWithinInput&&(s.params.label_within="1"),o.name){case"core/heading":return{type:"heading",id:"heading",params:{content:o.attributes.content?.toString(),level:o.attributes.level,align:o.attributes.textAlign||"left",font_size:Zee(e,o.attributes.fontSize,o.attributes.style?.typography?.fontSize||null),text_color:Jee(t,o.attributes.textColor,o.attributes.style?.color?.text||null),line_height:o.attributes.style?.typography?.lineHeight,background_color:Jee(t,o.attributes.backgroundColor,o.attributes.style?.color?.background||null),gradient:Xee(n,o.attributes.gradient,o.attributes.style?.color?.gradient||null),anchor:o.attributes.anchor||null,class_name:o.attributes.className||null,padding:o.attributes.style?.spacing?.padding||null}};case"core/paragraph":return{type:"paragraph",id:"paragraph",params:{content:o.attributes.content?.toString(),drop_cap:o.attributes.dropCap?"1":"0",align:o.attributes.align||"left",font_size:Zee(e,o.attributes.fontSize,o.attributes.style?.typography?.fontSize||null),line_height:o.attributes.style?.typography?.lineHeight,text_color:Jee(t,o.attributes.textColor,o.attributes.style?.color?.text||null),background_color:Jee(t,o.attributes.backgroundColor,o.attributes.style?.color?.background||null),gradient:Xee(n,o.attributes.gradient,o.attributes.style?.color?.gradient||null),class_name:o.attributes.className||null,padding:o.attributes.style?.spacing?.padding||null}};case"core/image":return{type:"image",id:"image",params:{class_name:o.attributes.className||null,align:o.attributes.align||null,url:o.attributes.url||null,alt:o.attributes.alt||null,title:o.attributes.title||null,caption:o.attributes.caption||null,link_destination:o.attributes.linkDestination||null,link:o.attributes.link||null,href:o.attributes.href||null,link_class:o.attributes.linkClass||null,rel:o.attributes.rel||null,link_target:o.attributes.linkTarget||null,id:o.attributes.id||null,size_slug:o.attributes.sizeSlug||null,width:o.attributes.width||null,height:o.attributes.height||null}};case"core/column":return{type:"column",body:r(o.innerBlocks),params:{class_name:o.attributes.className||null,vertical_alignment:o.attributes.verticalAlignment||null,width:o.attributes.width||null,padding:o.attributes.style?.spacing?.padding||null,text_color:Jee(t,o.attributes.textColor,o.attributes.style?.color?.text||null),background_color:Jee(t,o.attributes.backgroundColor,o.attributes.style?.color?.background||null),gradient:Xee(n,o.attributes.gradient,o.attributes.style?.color?.gradient||null)}};case"core/columns":return{type:"columns",body:r(o.innerBlocks),params:{vertical_alignment:o.attributes.verticalAlignment||null,is_stacked_on_mobile:o.attributes.isStackedOnMobile||void 0===o.attributes.isStackedOnMobile?"1":"0",class_name:o.attributes.className||null,padding:o.attributes.style?.spacing?.padding||null,text_color:Jee(t,o.attributes.textColor,o.attributes.style?.color?.text||null),background_color:Jee(t,o.attributes.backgroundColor,o.attributes.style?.color?.background||null),gradient:Xee(n,o.attributes.gradient,o.attributes.style?.color?.gradient||null)}};case"mailpoet-form/email-input":return{...s,id:"email",name:"Email",params:{...s.params,required:"1"},styles:Yee(o.attributes.styles)};case"mailpoet-form/first-name-input":return{...s,id:"first_name",name:"First name",styles:Yee(o.attributes.styles)};case"mailpoet-form/last-name-input":return{...s,id:"last_name",name:"Last name",styles:Yee(o.attributes.styles)};case"mailpoet-form/segment-select":return{...s,id:"segments",type:"segment",name:"List selection",params:{...s.params,values:o.attributes.values.map(e=>({id:e.id,is_checked:e.isChecked?"1":void 0}))}};case"mailpoet-form/submit-button":return{...s,id:"submit",type:"submit",name:"Submit",styles:Yee(o.attributes.styles)};case"mailpoet-form/divider":return{...s,id:"divider",type:"divider",name:"Divider",params:{class_name:o.attributes.className||null,height:o.attributes.height,type:o.attributes.type,style:o.attributes.style,divider_height:o.attributes.dividerHeight,divider_width:o.attributes.dividerWidth,color:o.attributes.color}};case"mailpoet-form/html":return{...s,id:"html",type:"html",name:"Custom text or HTML",params:{text:o.attributes&&o.attributes.content?o.attributes.content:"",nl2br:o.attributes&&o.attributes.nl2br?"1":"0",class_name:o.attributes.className||null}};default:return o.name.startsWith("mailpoet-form/custom-")?((e,t,n)=>{const i=t.find(t=>t.id===e.attributes.customFieldId);if(!i)return null;const r={...n,id:e.attributes.customFieldId.toString(),name:i.name};return e.name.startsWith("mailpoet-form/custom-date")&&(r.type="date"),e.name.startsWith("mailpoet-form/custom-text")&&(r.type="text",r.styles=Yee(e.attributes.styles)),e.name.startsWith("mailpoet-form/custom-textarea")&&(r.type="textarea",r.styles=Yee(e.attributes.styles)),e.name.startsWith("mailpoet-form/custom-radio")&&(r.type="radio"),e.name.startsWith("mailpoet-form/custom-checkbox")&&(r.type="checkbox"),e.name.startsWith("mailpoet-form/custom-select")&&(r.type="select"),(0,Kee.has)(e.attributes,"validate")&&(r.params.validate=e.attributes.validate),(0,Kee.has)(e.attributes,"hideLabel")&&e.attributes.hideLabel&&(r.params.hide_label="1"),(0,Kee.has)(e.attributes,"defaultToday")&&e.attributes.defaultToday&&(r.params.is_default_today="1"),(0,Kee.has)(e.attributes,"dateType")&&(r.params.date_type=e.attributes.dateType),(0,Kee.has)(e.attributes,"lines")&&(r.params.lines=e.attributes.lines),(0,Kee.has)(e.attributes,"dateFormat")&&(r.params.date_format=e.attributes.dateFormat),(0,Kee.has)(e.attributes,"values")&&(r.params.values=e.attributes.values.map(e=>{const t={value:e.name};return(0,Kee.has)(e,"isChecked")&&e.isChecked&&(t.is_checked="1"),t})),r})(o,i,s):null}}).filter(Boolean)};return r};function ete(e){const t={...e,settings:{...e.settings,form_placement:{popup:{enabled:!0===e.settings.formPlacement?.popup?.enabled?"1":"",trigger_mode:e.settings.formPlacement?.popup?.triggerMode,click_trigger_selector:e.settings.formPlacement?.popup?.clickTriggerSelector,exit_intent_enabled:e.settings.formPlacement?.popup?.exitIntentEnabled?"1":"",delay:e.settings.formPlacement?.popup?.delay,cookieExpiration:e.settings.formPlacement?.popup?.cookieExpiration,styles:e.settings.formPlacement?.popup?.styles,animation:e.settings.formPlacement?.popup?.animation,categories:e.settings.formPlacement?.popup?.categories??[],tags:e.settings.formPlacement?.popup?.tags??[],posts:{all:!0===e.settings.formPlacement?.popup?.posts?.all?"1":"",selected:e.settings.formPlacement?.popup?.posts?.selected},pages:{all:!0===e.settings.formPlacement?.popup?.pages?.all?"1":"",selected:e.settings.formPlacement?.popup?.pages?.selected},homepage:!0===e.settings.formPlacement?.popup?.homepage?"1":"",tagArchives:{all:!0===e.settings.formPlacement?.popup?.tagArchives?.all?"1":"",selected:e.settings.formPlacement?.popup?.tagArchives?.selected},categoryArchives:{all:!0===e.settings.formPlacement?.popup?.categoryArchives?.all?"1":"",selected:e.settings.formPlacement?.popup?.categoryArchives?.selected}},fixed_bar:{enabled:!0===e.settings.formPlacement?.fixedBar?.enabled?"1":"",delay:e.settings.formPlacement?.fixedBar?.delay,cookieExpiration:e.settings.formPlacement?.fixedBar?.cookieExpiration,styles:e.settings.formPlacement?.fixedBar?.styles,position:e.settings.formPlacement?.fixedBar?.position,animation:e.settings.formPlacement?.fixedBar?.animation,categories:e.settings.formPlacement?.fixedBar?.categories??[],tags:e.settings.formPlacement?.fixedBar?.tags??[],posts:{all:!0===e.settings.formPlacement?.fixedBar?.posts?.all?"1":"",selected:e.settings.formPlacement?.fixedBar?.posts?.selected},pages:{all:!0===e.settings.formPlacement?.fixedBar?.pages?.all?"1":"",selected:e.settings.formPlacement?.fixedBar?.pages?.selected},homepage:!0===e.settings.formPlacement?.fixedBar?.homepage?"1":"",tagArchives:{all:!0===e.settings.formPlacement?.fixedBar?.tagArchives?.all?"1":"",selected:e.settings.formPlacement?.fixedBar?.tagArchives?.selected},categoryArchives:{all:!0===e.settings.formPlacement?.fixedBar?.categoryArchives?.all?"1":"",selected:e.settings.formPlacement?.fixedBar?.categoryArchives?.selected}},below_posts:{enabled:!0===e.settings.formPlacement?.belowPosts?.enabled?"1":"",styles:e.settings.formPlacement?.belowPosts?.styles,categories:e.settings.formPlacement?.belowPosts?.categories??[],tags:e.settings.formPlacement?.belowPosts?.tags??[],posts:{all:!0===e.settings.formPlacement?.belowPosts?.posts?.all?"1":"",selected:e.settings.formPlacement?.belowPosts?.posts?.selected},pages:{all:!0===e.settings.formPlacement?.belowPosts?.pages?.all?"1":"",selected:e.settings.formPlacement?.belowPosts?.pages?.selected}},slide_in:{enabled:!0===e.settings.formPlacement?.slideIn?.enabled?"1":"",delay:e.settings.formPlacement?.slideIn?.delay,cookieExpiration:e.settings.formPlacement?.slideIn?.cookieExpiration,position:e.settings.formPlacement?.slideIn?.position,animation:e.settings.formPlacement?.slideIn?.animation,styles:e.settings.formPlacement?.slideIn?.styles,categories:e.settings.formPlacement?.slideIn?.categories??[],tags:e.settings.formPlacement?.slideIn?.tags??[],posts:{all:!0===e.settings.formPlacement?.slideIn?.posts?.all?"1":"",selected:e.settings.formPlacement?.slideIn?.posts?.selected},pages:{all:!0===e.settings.formPlacement?.slideIn?.pages?.all?"1":"",selected:e.settings.formPlacement?.slideIn?.pages?.selected},homepage:!0===e.settings.formPlacement?.slideIn?.homepage?"1":"",tagArchives:{all:!0===e.settings.formPlacement?.slideIn?.tagArchives?.all?"1":"",selected:e.settings.formPlacement?.slideIn?.tagArchives?.selected},categoryArchives:{all:!0===e.settings.formPlacement?.slideIn?.categoryArchives?.all?"1":"",selected:e.settings.formPlacement?.slideIn?.categoryArchives?.selected}},others:{styles:e.settings.formPlacement?.others?.styles}},border_radius:e.settings.borderRadius,border_size:e.settings.borderSize,form_padding:e.settings.formPadding,input_padding:e.settings.inputPadding,border_color:e.settings.borderColor,font_family:e.settings.fontFamily,success_validation_color:e.settings.successValidationColor,error_validation_color:e.settings.errorValidationColor,background_image_url:e.settings.backgroundImageUrl,background_image_display:e.settings.backgroundImageDisplay,close_button:e.settings.closeButton}};return""===t.settings.font_family&&delete t.settings.font_family,delete t.settings.formPlacement,delete t.settings.successValidationColor,delete t.settings.errorValidationColor,delete t.settings.borderRadius,delete t.settings.borderSize,delete t.settings.formPadding,delete t.settings.inputPadding,delete t.settings.borderColor,delete t.settings.backgroundImageUrl,delete t.settings.backgroundImageDisplay,delete t.settings.fontFamily,delete t.settings.closeButton,t}function tte(e){return{type:"TOGGLE_SIDEBAR",toggleTo:e}}function nte(e){return{type:"TOGGLE_INSERTER_SIDEBAR",value:e}}function ite(){return{type:"TOGGLE_LIST_VIEW"}}function rte(e){return e?{type:"ENABLE_FORM"}:{type:"DISABLE_FORM"}}function*ote(e){yield{type:"STORE_LOCALLY",key:"mailpoet_form_view_options",value:e},yield{type:"TOGGLE_FULLSCREEN",toggleTo:e}}function ste(e){return{type:"CHANGE_FORM_BLOCKS",blocks:e}}function ate(e){return{type:"CHANGE_FORM_NAME",name:e}}function lte(){return{type:"DELETE_CUSTOM_FIELD_STARTED"}}function cte(e,t){return{type:"DELETE_CUSTOM_FIELD_DONE",customFieldId:e,clientId:t}}function ute(e=void 0){return{type:"DELETE_CUSTOM_FIELD_FAILED",message:e}}function dte(e){return{type:"CHANGE_FORM_STYLES",styles:e}}function hte(){return{type:"CUSTOM_FIELD_EDITED"}}function pte(e,t){return{type:"SAVE_CUSTOM_FIELD_DONE",customFieldId:e,response:t}}function fte(){return{type:"SAVE_CUSTOM_FIELD_STARTED"}}function mte(e=void 0){return{type:"SAVE_CUSTOM_FIELD_FAILED",message:e}}function gte(e){return{type:"CREATE_CUSTOM_FIELD_DONE",response:e}}function bte(e){return{type:"CREATE_CUSTOM_FIELD_STARTED",customField:e}}function yte(e=void 0){return{type:"CREATE_CUSTOM_FIELD_FAILED",message:e}}function vte(e){return{type:"CHANGE_FORM_SETTINGS",settings:e}}function*_te(e){yield{type:"SAVE_FORM_DONE",formId:e},yield{type:"ENSURE_BROWSER_URL",formId:e}}function xte(){return{type:"SAVE_FORM_STARTED"}}function kte(e=void 0){return{type:"SAVE_FORM_FAILED",message:e}}function wte(e){return"placement_settings"===e&&(0,nt.J)(Qy).clearSelectedBlock(),{type:"CHANGE_ACTIVE_SIDEBAR",sidebar:e}}function*Cte(e){const t=(0,xe.L)(Gee).getFormData();null!==t.id&&(yield{type:"STORE_LOCALLY",key:`mailpoet_form_preview_settings${t.id}`,value:e}),yield{type:"CHANGE_PREVIEW_SETTINGS",settings:e}}function*Ste(e){const t={...(0,xe.L)(Gee).getPreviewSettings(),formType:e};return yield*Cte(t),wte("placement_settings")}function*Ate(){yield{type:"SHOW_PREVIEW"},yield wte("default");const e=(0,xe.L)(Gee).getAllAvailableCustomFields(),t=(0,xe.L)(Gee).getFormData(),n=(0,xe.L)(Qy).getBlocks(),i=Qee(qee,Th.colors,Th.gradients,e),{success:r,error:o}=yield{type:"CALL_API",endpoint:"forms",action:"previewEditor",data:{...ete(t),body:i(n)}};return r?{type:"PREVIEW_DATA_SAVED"}:{type:"PREVIEW_DATA_NOT_SAVED",error:o}}function Ite(){return{type:"HIDE_PREVIEW"}}function Ete(e){return{type:"REMOVE_NOTICE",id:e}}function jte(e){return{type:"SWITCH_DEFAULT_SIDEBAR_TAB",id:e}}function Tte(e,t=void 0){return{type:"TOGGLE_SIDEBAR_PANEL",id:e,toggleTo:t}}function*Bte(){yield{type:"SAVE_FORM"}}function*Nte(e){yield{type:"SAVE_CUSTOM_FIELD",...e}}function*Rte(e,t){yield{type:"CREATE_CUSTOM_FIELD",clientId:t,data:e}}function*Ote(e,t){yield{type:"DELETE_CUSTOM_FIELD",customFieldId:e,clientId:t}}function*Lte(e){yield{type:"BLOCKS_CHANGED_IN_BLOCK_EDITOR",blocks:e}}function*Mte(e){yield{type:"APPLY_STYLES_TO_ALL_TEXT_INPUTS",styles:e}}function Pte(){return{type:"HISTORY_UNDO"}}function Dte(){return{type:"HISTORY_REDO"}}function*Fte(){yield{type:"TUTORIAL_DISMISS"},yield{type:"TUTORIAL_DISMISSED"}}const zte=(e,t)=>e.reduce((e,n)=>e||(n.name===t?n:Array.isArray(n.innerBlocks)&&n.innerBlocks.length?zte(n.innerBlocks,t):null),null),Vte=(e,t)=>{if(!e||!e.settings||!Array.isArray(e.settings.segments))throw new Error("formData.settings.segments are expected to be an array.");if(!Array.isArray(t))throw new Error("formBlocks are expected to be an array.");const n=zte(t,"mailpoet-form/segment-select"),i=[];n&&0!==n.attributes.values.length||e.settings.segments&&0!==e.settings.segments.length||i.push("missing-lists"),n&&0===n.attributes.values.length&&i.push("missing-lists-in-custom-segments-block");const r=zte(t,"mailpoet-form/email-input"),o=zte(t,"mailpoet-form/submit-button");return r||i.push("missing-email-input"),o||i.push("missing-submit"),i},Ute=e=>{let t=e.editorHistory,n=e.editorHistoryOffset;const i=((e,t)=>{const n=e[e.length-1],i=Date.now();if(void 0!==n&&i-n.time<1e3&&e.length>1)return e.pop(),{blocks:t.formBlocks,data:t.formData,time:n.time};const r={blocks:t.formBlocks,data:t.formData,time:i};return void 0!==n&&(0,Kee.isEqual)(n.data,r.data)&&(0,Kee.isEqual)(n.blocks,r.blocks)?null:r})(t,e);if(null===i)return e;if(0!==e.editorHistoryOffset){const i=e.editorHistory.length-(e.editorHistoryOffset+1);n=0,t=t.slice(0,i)}return t.length>=100&&t.shift(),t.push(i),{...e,editorHistory:t,editorHistoryOffset:n}},$te=(e,t)=>{let n=e.editorHistoryOffset;0===n&&Ute(e),n+=t;const i=e.editorHistory.length-(n+1);let r,o;if(void 0===e.editorHistory[i])return e;{const t=e.editorHistory[i];r=t.blocks,o=t.data}return{...e,editorHistoryOffset:n,formBlocks:r,formData:o}},Hte=(Wte=$ee.U,(e,t)=>{const n=e.notices.filter(e=>"custom-field"!==e.id),i=(0,Kee.trim)(t.customField.name),r=e.customFields.find(e=>e.name===i);return r&&n.push({id:"custom-field",content:Wte.I18n.t("customFieldWithNameExists").replace("[name]",i),isDismissible:!0,status:"error"}),{...e,isCustomFieldCreating:!r,notices:n}});var Wte;const Gte=(e=>t=>{const n=t.notices.filter(e=>!["missing-lists-in-custom-segments-block","save-form","missing-lists","missing-block"].includes(e.id)),i=t.formErrors.includes("missing-lists")||t.formErrors.includes("missing-lists-in-custom-segments-block"),r=[...t.sidebar.openedPanels];i&&(n.push({id:"missing-lists",content:e.I18n.t("settingsPleaseSelectList"),isDismissible:!0,status:"error"}),r.includes("basic-settings")||r.push("basic-settings"));const o=t.formErrors.includes("missing-email-input"),s=t.formErrors.includes("missing-submit");return(o||s)&&n.push({id:"missing-block",content:e.I18n.t("missingObligatoryBlock"),isDismissible:!0,status:"error"}),{...t,isFormSaving:!i,sidebar:{...t.sidebar,activeTab:i?"form":t.sidebar.activeTab,openedPanels:r},notices:n}})($ee.U),qte=e=>(t=e,n={})=>{const i=((e,t)=>"CHANGE_FORM_BLOCKS"===t.type||"CHANGE_FORM_NAME"===t.type||"CHANGE_FORM_SETTINGS"===t.type||"CHANGE_FORM_STYLES"===t.type?Ute(e):e)(t,n);return((e,t)=>{switch(t.type){case"ENABLE_FORM":return(e=>({...e,formData:{...e.formData,hasUnsavedChanges:!0,status:"enabled"}}))(e);case"DISABLE_FORM":return(e=>({...e,formData:{...e.formData,hasUnsavedChanges:!0,status:"disabled"}}))(e);case"TOGGLE_FULLSCREEN":return((e,t)=>({...e,fullscreenStatus:t.toggleTo}))(e,t);case"CREATE_CUSTOM_FIELD_DONE":return((e,t)=>{const n=e.notices.filter(e=>"custom-field"!==e.id);n.push({id:"custom-field",content:$ee.U.I18n.t("customFieldSaved"),isDismissible:!0,status:"success"});const i=[...e.customFields];return i.push(t.response),{...e,isCustomFieldCreating:!1,notices:n,customFields:i}})(e,t);case"CREATE_CUSTOM_FIELD_FAILED":return((e,t)=>{const n=e.notices.filter(e=>"custom-field"!==e.id);return n.push({id:"custom-field",content:t.message,isDismissible:!0,status:"error"}),{...e,isCustomFieldCreating:!1,notices:n}})(e,t);case"CREATE_CUSTOM_FIELD_STARTED":return Hte(e,t);case"CHANGE_FORM_BLOCKS":return((e,t)=>{const n={...e,formBlocks:t.blocks};return{...n,hasUnsavedChanges:!0,formErrors:Vte(n.formData,n.formBlocks)}})(e,t);case"CHANGE_FORM_NAME":return((e,t)=>({...e,formData:{...e.formData,hasUnsavedChanges:!0,name:t.name}}))(e,t);case"CHANGE_FORM_SETTINGS":return((e,t)=>{const n={...e,formData:{...e.formData,settings:t.settings}};return{...n,hasUnsavedChanges:!0,formErrors:Vte(n.formData,n.formBlocks)}})(e,t);case"CHANGE_FORM_STYLES":return((e,t)=>({...e,formData:{...e.formData,styles:t.styles,hasUnsavedChanges:!0}}))(e,t);case"CHANGE_PREVIEW_SETTINGS":return((e,{settings:t})=>({...e,previewSettings:t}))(e,t);case"CUSTOM_FIELD_EDITED":return(e=>({...e,hasUnsavedChanges:!0}))(e);case"REMOVE_NOTICE":return((e,t)=>({...e,notices:[...e.notices].filter(e=>e.id!==t.id)}))(e,t);case"SHOW_PREVIEW":return(e=>({...e,isPreviewShown:!0}))(e);case"HIDE_PREVIEW":return(e=>({...e,isPreviewShown:!1,isPreviewReady:!1}))(e);case"PREVIEW_DATA_NOT_SAVED":return(e=>({...e,isPreviewReady:!1}))(e);case"PREVIEW_DATA_SAVED":return(e=>({...e,isPreviewReady:!0}))(e);case"SAVE_FORM_DONE":return((e,t)=>{const n=e.notices.filter(e=>"save-form"!==e.id);return n.push({id:"save-form",content:`${$ee.U.I18n.t("formSaved")} ${$ee.U.I18n.t("formSavedAppendix")}`,isDismissible:!0,status:"success"}),{...e,formData:{...e.formData,id:parseInt(t.formId,10)},isFormSaving:!1,hasUnsavedChanges:!1,notices:n}})(e,t);case"SAVE_FORM_FAILED":return((e,t)=>{const n=e.notices.filter(e=>"save-form"!==e.id);return n.push({id:"save-form",content:t.message,isDismissible:!0,status:"error"}),{...e,isFormSaving:!1,notices:n}})(e,t);case"SAVE_FORM_STARTED":return Gte(e);case"SAVE_CUSTOM_FIELD_DONE":return((e,t)=>{const n=e.notices.filter(e=>"custom-field"!==e.id);n.push({id:"custom-field",content:$ee.U.I18n.t("customFieldSaved"),isDismissible:!0,status:"success"});const i=e.customFields.map(e=>e.id===t.customFieldId?t.response:e);return{...e,isCustomFieldSaving:!1,notices:n,customFields:i}})(e,t);case"SAVE_CUSTOM_FIELD_FAILED":return((e,t)=>{const n=e.notices.filter(e=>"custom-field"!==e.id);return n.push({id:"custom-field",content:t.message,isDismissible:!0,status:"error"}),{...e,isCustomFieldSaving:!1,notices:n}})(e,t);case"SAVE_CUSTOM_FIELD_STARTED":return(e=>{const t=e.notices.filter(e=>"custom-field"!==e.id);return{...e,isCustomFieldSaving:!0,notices:t}})(e);case"SWITCH_DEFAULT_SIDEBAR_TAB":return((e,t)=>({...e,sidebar:{...e.sidebar,activeTab:t.id}}))(e,t);case"TOGGLE_SIDEBAR":return((e,t)=>({...e,sidebarOpened:t.toggleTo}))(e,t);case"TOGGLE_INSERTER_SIDEBAR":return((e,t)=>{let n;return n=t.value?!0===t.value?{rootClientId:void 0,insertionIndex:void 0}:t.value:null,{...e,inserterPanel:n,isListViewOpened:!1}})(e,t);case"TOGGLE_LIST_VIEW":return(e=>({...e,isListViewOpened:!e.isListViewOpened,inserterPanel:null}))(e);case"TOGGLE_SIDEBAR_PANEL":return((e,t)=>{let n;!0===t.toggleTo&&(n="opened"),!1===t.toggleTo&&(n="closed");const i=[...e.sidebar.openedPanels],r=((e,t,n)=>{const i=e.includes(t);let r=n;return void 0===r&&(r=i?"closed":"opened"),i&&"closed"===r?"close":i||"opened"!==r?null:"open"})(i,t.id,n);return"open"===r?i.push(t.id):"close"===r&&(0,Kee.remove)(i,e=>e===t.id),{...e,sidebar:{...e.sidebar,openedPanels:i}}})(e,t);case"DELETE_CUSTOM_FIELD_STARTED":return(e=>{const t=e.notices.filter(e=>"custom-field"!==e.id);return{...e,...t,isCustomFieldDeleting:!0}})(e);case"DELETE_CUSTOM_FIELD_DONE":return((e,t)=>{const n=e.customFields.filter(e=>e.id!==t.customFieldId),i=e.formBlocks.filter(e=>e.clientId!==t.clientId);return{...e,formBlocks:i,isCustomFieldDeleting:!1,customFields:n}})(e,t);case"DELETE_CUSTOM_FIELD_FAILED":return((e,t)=>{const n=e.notices.filter(e=>"custom-field"!==e.id);return n.push({id:"custom-field",content:t.message,isDismissible:!0,status:"error"}),{...e,isCustomFieldSaving:!1,notices:n}})(e,t);case"CHANGE_ACTIVE_SIDEBAR":return((e,t)=>({...e,sidebar:{...e.sidebar,activeSidebar:t.sidebar}}))(e,t);case"HISTORY_UNDO":return(e=>$te(e,1))(e);case"HISTORY_REDO":return(e=>$te(e,-1))(e);case"TUTORIAL_DISMISSED":return(e=>({...e,tutorialSeen:!0}))(e);default:return e}})(i,n)},Kte=(e,t,n=[])=>e.reduce((e,i)=>e.length?e:Array.isArray(i.innerBlocks)&&i.innerBlocks.length?(n.push(i),i.innerBlocks.find(e=>e.clientId===t)?n:Kte(i.innerBlocks,t,n)):[],[]),Yte={isFormSaved:e=>"number"==typeof e.formData.id,isFormEnabled:e=>"enabled"===e.formData.status,isFullscreenEnabled:e=>e.fullscreenStatus,isInserterOpened:e=>!!e.inserterPanel,getInserterPanelInsertPoint:e=>e.inserterPanel,isListViewOpened:e=>e.isListViewOpened,getSidebarOpened:e=>e.sidebarOpened,getFormName:e=>e.formData.name,getFormData:e=>e.formData,getFormStyles:e=>e.formData.styles,getFormExports:e=>Object.fromEntries(Object.entries(e.formExports).map(([t,n])=>[t,n.replace(":form_id:",`${e.formData.id}`)])),getFormSettings:e=>e.formData.settings,getAllAvailableSegments:e=>e.segments,getAllAvailableCustomFields:e=>e.customFields,getIsFormSaving:e=>e.isFormSaving,getIsPreviewShown:e=>e.isPreviewShown,getIsPreviewReady:e=>e.isPreviewReady,getPreviewSettings(e){if(e.previewSettings)return e.previewSettings;const t={displayType:"desktop",formType:"others"},n=e.formData.settings;return n.formPlacement.belowPosts.enabled&&(t.formType="below_posts"),n.formPlacement.popup.enabled&&(t.formType="popup"),n.formPlacement.fixedBar.enabled&&(t.formType="fixed_bar"),n.formPlacement.slideIn.enabled&&(t.formType="slide_in"),t},getFormWidth(e,t){const n=e.formData.settings;switch(t){case"below_posts":return n.formPlacement.belowPosts.styles.width;case"popup":return n.formPlacement.popup.styles.width;case"slide_in":return n.formPlacement.slideIn.styles.width;case"fixed_bar":return n.formPlacement.fixedBar.styles.width;case"others":return n.formPlacement.others.styles.width;default:throw Error(`Invalid form display type ${t}`)}},getIsCustomFieldSaving:e=>e.isCustomFieldSaving,getIsCustomFieldDeleting:e=>e.isCustomFieldDeleting,getDismissibleNotices:e=>e.notices.filter(e=>!0===e.isDismissible),getNonDismissibleNotices:e=>e.notices.filter(e=>!1===e.isDismissible),getNotice:(e,t)=>e.notices.find(e=>e.id===t),getFormErrors:e=>e.formErrors,getDefaultSidebarActiveTab:e=>e.sidebar.activeTab,getSidebarOpenedPanels:e=>e.sidebar.openedPanels,getFormBlocks:e=>e.formBlocks,getDateSettingsData:e=>e.dateSettingData,getIsCustomFieldCreating:e=>e.isCustomFieldCreating,hasUnsavedChanges:e=>e.hasUnsavedChanges,getEditorUrl:e=>e.editorUrl,getPreviewPageUrl:e=>e.previewPageUrl,getCloseIconsUrl:e=>e.closeIconsUrl,getAllCustomFonts:e=>e.customFonts,getActiveSidebar:e=>e.sidebar.activeSidebar,getAllWPPosts:e=>e.allWpPosts,getAllWPPages:e=>e.allWpPages,getAllWPCategories:e=>e.allWpCategories,getAllWPTags:e=>e.allWpTags,getAllWooCommerceProducts:e=>e.allWooCommerceProducts,getAllWooCommerceCategories:e=>e.allWooCommerceCategories,getAllWooCommerceTags:e=>e.allWooCommerceTags,getTutorialSeen:e=>e.tutorialSeen,getFormEditorUrl:e=>e.formEditorUrl,getTutorialUrl:e=>e.tutorialUrl,getClosestParentAttribute:(e,t,n)=>Kte(e.formBlocks,t).reduce((e,t)=>t.attributes&&void 0!==t.attributes[n]?t.attributes[n]:e,null),hasEditorUndo(e){let t=e.editorHistory.length;return e.editorHistory.length>1&&(t-=1),t>0&&t>e.editorHistoryOffset},hasEditorRedo:e=>e.editorHistoryOffset>0,isUserAdministrator:e=>e.user.isAdministrator,getThemeSupport:e=>e.theme};function Jte(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)"__proto__"!==i&&(e[i]=n[i])}return e}var Xte={read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},Zte=function e(t,n){function i(e,i,r){if("undefined"!=typeof document){"number"==typeof(r=Jte({},n,r)).expires&&(r.expires=new Date(Date.now()+864e5*r.expires)),r.expires&&(r.expires=r.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var s in r)r[s]&&(o+="; "+s,!0!==r[s]&&(o+="="+r[s].split(";")[0]));return document.cookie=e+"="+t.write(i,e)+o}}return Object.create({set:i,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],i={},r=0;r<n.length;r++){var o=n[r].split("="),s=o.slice(1).join("=");try{var a=decodeURIComponent(o[0]);if(a in i||(i[a]=t.read(s,a)),e===a)break}catch{}}return e?i[e]:i}},remove:function(e,t){i(e,"",Jte({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,Jte({},this.attributes,t))},withConverter:function(t){return e(Jte({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}(Xte,{path:"/"}),Qte=n(84356),ene=n(29065),tne=n.n(ene);function nne(e,t){let n=tne()(t.name,{lower:!0}).replace(/[^a-z0-9]+/g,"").replace(/-$/,"");return(!n||n.length<2)&&(n=`field${t.id}`),`${e}-${n}`}const ine=(0,Er.jsxs)(AC.t4,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,Er.jsx)(AC.wA,{d:"M0,0h24v24H0V0z",fill:"none"}),(0,Er.jsx)(AC.wA,{d:"M20,4H4C2.9,4,2,4.9,2,6v12c0,1.1,0.9,2,2,2h16c1.1,0,2-0.9,2-2V6C22,4.9,21.1,4,20,4z M20,18H4V6h16V18z"}),(0,Er.jsx)(AC.rw,{x:"6",y:"10",width:"2",height:"2"}),(0,Er.jsx)(AC.rw,{x:"6",y:"14",width:"8",height:"2"}),(0,Er.jsx)(AC.rw,{x:"16",y:"14",width:"2",height:"2"}),(0,Er.jsx)(AC.rw,{x:"10",y:"10",width:"8",height:"2"})]});var rne=n(36637),one=n.n(rne),sne=n(22979);function ane({isBusy:e=!1,onDelete:t=()=>{}}){const n=(0,T.useCallback)(()=>{window.confirm($ee.U.I18n.t("customFieldDeleteConfirm"))&&t()},[t]);return(0,Er.jsx)(fv.Ay,{isDestructive:!0,isLink:!0,isBusy:e,onClick:n,className:"button-on-top",children:$ee.U.I18n.t("customFieldDeleteCTA")})}function lne({dateSettings:e,label:t="",mandatory:n=!1,dateType:i=null,dateFormat:r=null,defaultToday:o=!1,isSaving:s=!1,onSave:a=null,isDeleting:l=!1,onCustomFieldDelete:c=null,onChange:u=null}){const[d,h]=(0,T.useState)(t),[p,f]=(0,T.useState)(n),[m,g]=(0,T.useState)(o),[b,y]=(0,T.useState)(i),[v,_]=(0,T.useState)(r),x=(0,T.useMemo)(()=>({label:d,mandatory:p,dateType:b,dateFormat:v,defaultToday:m}),[d,p,b,v,m]),k=p!==n||m!==o||b!==i||v!==r||d!==t;return(0,T.useEffect)(()=>{u&&u(x,k)},[x,u,k]),(0,Er.jsxs)("div",{className:"custom-field-settings",children:[(0,Er.jsx)(kS.A,{label:$ee.U.I18n.t("label"),value:d,"data-automation-id":"settings_custom_date_label_input",onChange:h}),(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("blockMandatory"),checked:p,onChange:f}),(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("customFieldDefaultToday"),checked:m,onChange:g}),(0,Er.jsx)(oE.A,{label:$ee.U.I18n.t("customFieldDateType"),"data-automation-id":"settings_custom_date_type",value:b,onChange:t=>{y(t);const n=e.dateFormats[t];_(n[0])},options:e.dateTypes}),(()=>{const t=e.dateFormats[b];return Array.isArray(t)&&1===t.length?null:(0,Er.jsx)(oE.A,{label:$ee.U.I18n.t("customFieldDateFormat"),"data-automation-id":"settings_custom_date_format",value:v,onChange:e=>_(e),options:t.map(e=>({value:e,label:e}))})})(),a?(0,Er.jsx)(fv.Ay,{variant:"primary",onClick:()=>a({mandatory:p,dateType:b,dateFormat:v,defaultToday:m,label:d}),isBusy:s,disabled:s||!k,className:"button-on-top","data-automation-id":"custom_field_save",children:$ee.U.I18n.t("customFieldSaveCTA")}):null,c?(0,Er.jsx)(ane,{isBusy:s||l,onDelete:c}):null]})}ane.propTypes={isBusy:Uee().bool,onDelete:Uee().func},lne.propTypes={mandatory:Uee().bool,label:Uee().string,dateType:Uee().string,dateFormat:Uee().string,defaultToday:Uee().bool,onSave:Uee().func,isSaving:Uee().bool,dateSettings:Uee().shape({dateTypes:Uee().arrayOf(Uee().shape({label:Uee().string,value:Uee().string})),dateFormats:Uee().objectOf(Uee().arrayOf(Uee().string)),months:Uee().arrayOf(Uee().string)}).isRequired,isDeleting:Uee().bool,onCustomFieldDelete:Uee().func,onChange:Uee().func};const cne=e=>{const t=e.label?e.label:"";return e.mandatory?`${t} *`:t};function une(e){const t=[];void 0!==e.placeholder&&t.push((0,Er.jsx)("option",{value:"",children:e.placeholder},0));const n=one()().year();for(let e=n;e>=n-100;e-=1)t.push((0,Er.jsx)("option",{value:e,children:e},e));return(0,Er.jsx)("select",{name:`${e.name}[year]`,value:e.year,onChange:e.onValueChange,className:M()({mailpoet_date_year:e.addDefaultClasses}),children:t})}function dne(e){const t=[];void 0!==e.placeholder&&t.push((0,Er.jsx)("option",{value:"",children:e.placeholder},0));for(let n=1;n<=12;n+=1)t.push((0,Er.jsx)("option",{value:n,children:e.monthNames[n-1]},n));return(0,Er.jsx)("select",{name:`${e.name}[month]`,value:e.month,onChange:e.onValueChange,className:M()({mailpoet_date_month:e.addDefaultClasses}),children:t})}function hne(e){const t=[];void 0!==e.placeholder&&t.push((0,Er.jsx)("option",{value:"",children:e.placeholder},0));for(let e=1;e<=31;e+=1)t.push((0,Er.jsx)("option",{value:e,children:e},e));return(0,Er.jsx)("select",{name:`${e.name}[day]`,value:e.day,onChange:e.onValueChange,className:M()({mailpoet_date_day:e.addDefaultClasses}),children:t})}une.propTypes={name:Uee().string.isRequired,placeholder:Uee().string.isRequired,onValueChange:Uee().func.isRequired,year:Uee().oneOfType([Uee().string,Uee().number]).isRequired,addDefaultClasses:Uee().bool.isRequired},dne.propTypes={name:Uee().string.isRequired,placeholder:Uee().string.isRequired,onValueChange:Uee().func.isRequired,month:Uee().oneOfType([Uee().string,Uee().number]).isRequired,monthNames:Uee().arrayOf(Uee().string).isRequired,addDefaultClasses:Uee().bool.isRequired},hne.propTypes={name:Uee().string.isRequired,placeholder:Uee().string.isRequired,onValueChange:Uee().func.isRequired,day:Uee().oneOfType([Uee().string,Uee().number]).isRequired,addDefaultClasses:Uee().bool.isRequired};class pne extends T.Component{constructor(e){super(e),this.state={year:"",month:"",day:""},this.onValueChange=this.onValueChange.bind(this)}componentDidMount(){this.extractDateParts()}componentDidUpdate(e){void 0!==this.props.item&&void 0!==e.item&&this.props.item.id!==e.item.id&&this.extractDateParts()}onValueChange(e){const t=e.target.name.match(/(.*?)\[(.*?)\]/);let n=null,i=null;if(null!==t&&3===t.length){[,n,i]=t;const r=Number(e.target.value);this.setState({[`${i}`]:r},()=>{this.props.onValueChange({target:{name:n,value:this.formatValue()}})})}}formatValue(){let e;switch(this.props.field.params.date_type){case"year_month_day":e={year:this.state.year,month:this.state.month,day:this.state.day};break;case"year_month":e={year:this.state.year,month:this.state.month};break;case"month":e={month:this.state.month};break;case"year":e={year:this.state.year};break;default:e={value:"invalid type"}}return e}extractDateParts(){const e=void 0!==this.props.item[this.props.field.name]?this.props.item[this.props.field.name].trim():"";if(""===e)return;const t=one()(e);this.setState({year:t.format("YYYY"),month:t.format("M"),day:t.format("D")})}render(){const{field:e,addDefaultClasses:t=!1}=this.props,n=window.mailpoet_month_names||[];let i=(window.mailpoet_date_formats||{})[e.params.date_type][0];e.params.date_format&&(i=e.params.date_format);const r=i.split("/").map(i=>{switch(i){case"YYYY":return(0,Er.jsx)(une,{onValueChange:this.onValueChange,name:e.name,addDefaultClasses:t,year:this.state.year,placeholder:e.year_placeholder},"year");case"MM":return(0,Er.jsx)(dne,{onValueChange:this.onValueChange,name:e.name,addDefaultClasses:t,month:this.state.month,monthNames:n,placeholder:e.month_placeholder},"month");case"DD":return(0,Er.jsx)(hne,{onValueChange:this.onValueChange,name:e.name,addDefaultClasses:t,day:this.state.day,placeholder:e.day_placeholder},"day");default:return(0,Er.jsx)("div",{children:"Invalid date type"})}});return(0,Er.jsx)("div",{children:r})}}function fne({children:e,className:t=""}){return(0,Er.jsx)("div",{className:M()("mailpoet_paragraph",t),children:e})}function mne(e,t){switch(e){case"checkbox":return{label:t.label,required:t.mandatory?"1":"",values:[{is_checked:t.isChecked?"1":"",value:t.checkboxLabel}]};case"date":return{label:t.label,required:t.mandatory?"1":"",date_type:t.dateType,date_format:t.dateFormat,is_default_today:t.defaultToday?"1":""};case"radio":case"select":return{required:t.mandatory?"1":"",label:t.label,values:t.values.map(e=>{const t={value:e.name};return e.isChecked?t.is_checked="1":t.is_checked="",t})};case"text":return{required:t.mandatory?"1":"",validate:t.validate,label:t.label};case"textarea":return{required:t.mandatory?"1":"",validate:t.validate,lines:t.lines?t.lines:"1",label:t.label};default:throw new Error(`Invalid custom field type ${e}!`)}}function gne({attributes:e,setAttributes:t,clientId:n}){const i=(0,zt.A)(e=>e(Gee).getIsCustomFieldSaving(),[]),r=(0,zt.A)(e=>e(Gee).getDateSettingsData(),[]),o=(0,zt.A)(e=>e(Gee).getIsCustomFieldDeleting(),[]),{saveCustomField:s,deleteCustomField:a,customFieldEdited:l}=(0,Vt.A)(Gee),c=(0,Er.jsx)(oC,{children:(0,Er.jsx)(sne.A,{children:(0,Er.jsx)(mz.Ay,{title:$ee.U.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,Er.jsx)(lne,{label:e.label,mandatory:e.mandatory,dateSettings:r,defaultToday:e.defaultToday,dateFormat:e.dateFormat,dateType:e.dateType,isSaving:i,onSave:n=>s({customFieldId:e.customFieldId,data:{params:mne("date",n)},onFinish:()=>t({mandatory:n.mandatory,dateType:n.dateType,dateFormat:n.dateFormat,defaultToday:n.defaultToday,label:n.label})}),onCustomFieldDelete:()=>a(e.customFieldId,n),isDeleting:o,onChange:(e,t)=>t&&l()})})})});return(0,Er.jsx)(fne,{className:e.className,children:(0,Er.jsxs)("div",{className:"mailpoet_custom_date",children:[c,(0,Er.jsx)("label",{className:"mailpoet_date_label","data-automation-id":"editor_custom_date_label",htmlFor:n,children:cne(e)}),(0,Er.jsx)(pne,{field:{name:n,day_placeholder:$ee.U.I18n.t("customFieldDay"),month_placeholder:$ee.U.I18n.t("customFieldMonth"),year_placeholder:$ee.U.I18n.t("customFieldYear"),params:{date_type:e.dateType,date_format:e.dateFormat}},item:{[n]:e.defaultToday?one()().format("YYYY-MM-DD"):""},addDefaultClasses:!0,onValueChange:()=>{}})]})})}function bne(e){return{title:e.name,description:"",icon:ine,category:"custom-fields",attributes:{label:{type:"string",default:e.name},mandatory:{type:"boolean",default:!!e.params.required&&!!e.params.required},defaultToday:{type:"boolean",default:!1},dateType:{type:"string",default:e.params.date_type},dateFormat:{type:"string",default:e.params.date_format},customFieldId:{type:"string",default:e.id}},supports:{html:!1,multiple:!1},edit:gne,save:()=>null}}pne.propTypes={item:Uee().object.isRequired,field:Uee().shape({name:Uee().string,day_placeholder:Uee().string,month_placeholder:Uee().string,year_placeholder:Uee().string,params:Uee().object}).isRequired,onValueChange:Uee().func.isRequired,addDefaultClasses:Uee().bool},fne.propTypes={children:Uee().node.isRequired,className:Uee().string},gne.propTypes={attributes:Uee().shape({label:Uee().string.isRequired,dateFormat:Uee().string.isRequired,dateType:Uee().string.isRequired,defaultToday:Uee().bool,mandatory:Uee().bool.isRequired,customFieldId:Uee().number.isRequired,className:Uee().string}).isRequired,clientId:Uee().string.isRequired,setAttributes:Uee().func.isRequired};const yne={fullWidth:!0,inheritFromTheme:!0},vne={fullWidth:!1,inheritFromTheme:!0},_ne=e=>{if(!e)return vne;const t={fullWidth:"1"===e.full_width||!0===e.full_width,inheritFromTheme:!(0,Kee.has)(e,"bold")};return t.inheritFromTheme||(t.bold="1"===e.bold||!0===e.bold,(0,Kee.has)(e,"background_color")&&e.background_color&&(t.backgroundColor=e.background_color),(0,Kee.has)(e,"gradient")&&e.gradient&&(t.gradient=e.gradient),(0,Kee.has)(e,"border_size")&&void 0!==e.border_size&&(t.borderSize=Number(e.border_size)),(0,Kee.has)(e,"font_size")&&void 0!==e.font_size&&(t.fontSize=Number.isNaN(Number(e.font_size))?e.font_size:Number(e.font_size)),(0,Kee.has)(e,"font_color")&&e.font_color&&(t.fontColor=e.font_color),(0,Kee.has)(e,"border_radius")&&void 0!==e.border_radius&&(t.borderRadius=Number(e.border_radius)),(0,Kee.has)(e,"border_color")&&e.border_color&&(t.borderColor=e.border_color),(0,Kee.has)(e,"padding")&&void 0!==e.padding&&(t.padding=Number(e.padding)),(0,Kee.has)(e,"font_family")&&e.font_family&&(t.fontFamily=e.font_family)),t},xne=(e,t)=>{const n=e.find(e=>e.color===t);return n?n.slug:void 0},kne=(e,t)=>{const n=e.find(e=>e.gradient===t);return n?n.slug:void 0};function wne({label:e="",mandatory:t=!1,validate:n="",isSaving:i=!1,onSave:r=null,isDeleting:o=!1,onCustomFieldDelete:s=null,onChange:a=null,fieldType:l=""}){const[c,u]=(0,T.useState)(e),[d,h]=(0,T.useState)(t),[p,f]=(0,T.useState)(n),m=(0,T.useMemo)(()=>({label:c,mandatory:d,validate:p}),[c,d,p]),g=d!==t||p!==n||c!==e;return(0,T.useEffect)(()=>{a&&a(m,g)},[m,a,g,l]),(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(kS.A,{label:$ee.U.I18n.t("label"),value:c,"data-automation-id":"settings_custom_text_label_input",onChange:u}),(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("blockMandatory"),checked:d,onChange:h}),(0,Er.jsx)(oE.A,{label:`${$ee.U.I18n.t("customFieldValidateFor")}:`,"data-automation-id":"settings_custom_text_input_validation_type",options:[{label:$ee.U.I18n.t("customFieldValidateNothing"),value:""},{label:$ee.U.I18n.t("customFieldValidateNumbersOnly"),value:"number"},{label:$ee.U.I18n.t("customFieldValidateAlphanumerical"),value:"alphanum"},{label:$ee.U.I18n.t("customFieldValidatePhoneNumber"),value:"phone"}],value:p,onChange:f}),r?(0,Er.jsx)(fv.Ay,{variant:"primary",onClick:()=>r(m),isBusy:i,disabled:i||o||!g,className:"button-on-top","data-automation-id":"custom_field_save",children:$ee.U.I18n.t("customFieldSaveCTA")}):null,s?(0,Er.jsx)(ane,{isBusy:i||o,onDelete:s}):null]})}function Cne({title:e,settings:t}){const[n,i]=tv("color.palette","color.gradients");return(0,Er.jsx)("div",{children:(0,Er.jsx)(h0,{title:e,colors:n,gradients:i,settings:t})})}wne.propTypes={label:Uee().string,mandatory:Uee().bool,validate:Uee().string,onSave:Uee().func,isSaving:Uee().bool,isDeleting:Uee().bool,onCustomFieldDelete:Uee().func,onChange:Uee().func,fieldType:Uee().string},Cne.displayName="ColorGradientSettings";const Sne=(0,Fee.withBoundary)(Cne);function Ane({styles:e,onChange:t}){const[n,i]=(0,T.useState)(e),r=(0,T.useRef)(n);r.current=n;const o=(0,T.useRef)(e);e!==o.current&&(o.current=e,i(e));const{applyStylesToAllTextInputs:s}=(0,Vt.A)(Gee),a=(e,n)=>{const o={...r.current,[e]:n};r.current=o,i(o),t(o)};return(0,Er.jsx)(sne.A,{className:"mailpoet-automation-input-styles-panel",children:(0,Er.jsx)(mz.Ay,{title:$ee.U.I18n.t("formSettingsStyles"),initialOpen:!1,children:(0,Er.jsxs)("div",{className:"mailpoet-styles-settings","data-automation-id":"input_styles_settings",children:[(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("formSettingsDisplayFullWidth"),checked:n.fullWidth,onChange:(0,Kee.partial)(a,"fullWidth")}),(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("formSettingsInheritStyleFromTheme"),checked:n.inheritFromTheme,onChange:e=>{if(e)return void a("inheritFromTheme",e);const n={...r.current,backgroundColor:"#ffffff",bold:!1,borderRadius:0,borderSize:1,borderColor:"#313131",inheritFromTheme:e};r.current=n,i(n),t(n)},className:"mailpoet-automation-inherit-theme-toggle"}),n.inheritFromTheme?null:(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(Sne,{title:$ee.U.I18n.t("formSettingsColor"),settings:[{label:$ee.U.I18n.t("formSettingsStylesFont"),colorValue:n.fontColor,onColorChange:(0,Kee.partial)(a,"fontColor")},{label:$ee.U.I18n.t("formSettingsStylesBackground"),colorValue:n.backgroundColor,onColorChange:(0,Kee.partial)(a,"backgroundColor")},{label:$ee.U.I18n.t("formSettingsBorder"),colorValue:n.borderColor,onColorChange:(0,Kee.partial)(a,"borderColor")}]}),(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("formSettingsBold"),checked:n.bold||!1,onChange:(0,Kee.partial)(a,"bold"),className:"mailpoet-automation-styles-bold-toggle"}),(0,Er.jsx)(gk.A,{label:$ee.U.I18n.t("formSettingsBorderSize"),value:n.borderSize??1,min:0,max:10,allowReset:!0,resetFallbackValue:1,onChange:e=>a("borderSize",e??1),className:"mailpoet-automation-styles-border-size"}),(0,Er.jsx)(gk.A,{label:$ee.U.I18n.t("formSettingsBorderRadius"),value:n.borderRadius??0,min:0,max:40,allowReset:!0,resetFallbackValue:0,onChange:e=>a("borderRadius",e??0),className:"mailpoet-automation-styles-border-radius-size"})]}),(0,Er.jsx)("div",{children:(0,Er.jsx)(fv.Ay,{variant:"primary",onClick:()=>{s(n)},"data-automation-id":"styles_apply_to_all",children:$ee.U.I18n.t("formSettingsApplyToAll")})})]})})})}const Ine=Uee().shape({fullWidth:Uee().bool.isRequired,inheritFromTheme:Uee().bool.isRequired,bold:Uee().bool,backgroundColor:Uee().string,borderSize:Uee().number,borderRadius:Uee().number,borderColor:Uee().string});let Ene=function(e){return e.Left="left",e.Center="center",e.Right="right",e}({});function jne(e){return e===Ene.Right?"0 0 0 auto":e===Ene.Center?"0 auto":"auto 0"}function Tne({label:e,labelWithinInput:t,name:n,mandatory:i,styles:r,className:o=""}){const s=(0,zt.A)(e=>e(Gee).getFormSettings(),[]),a=(0,T.useRef)(null),l=`${n}_${Math.random().toString(36).substring(2,15)}`,[c,u]=(0,T.useState)(""),d=r.inheritFromTheme?{}:{fontWeight:r.bold?"bold":"inherit"},h=r.inheritFromTheme?{}:{borderRadius:r.borderRadius?`${r.borderRadius}px`:0,borderWidth:void 0!==r.borderSize?`${r.borderSize}px`:"1px",borderColor:r.borderColor||"initial",borderStyle:"solid"};void 0!==s.inputPadding&&(h.padding=s.inputPadding),void 0!==s.inputPadding&&(h.padding=s.inputPadding),void 0!==s.alignment&&(h.textAlign=s.alignment,h.margin=jne(h.textAlign)),r.fullWidth&&(h.width="100%"),r.backgroundColor&&!r.inheritFromTheme&&(h.backgroundColor=r.backgroundColor);const p={};return r.fontColor&&!r.inheritFromTheme&&(h.color=r.fontColor,t&&(p.color=r.fontColor)),(0,Er.jsxs)(fne,{className:o,children:[t?null:(0,Er.jsx)("label",{className:"mailpoet_text_label","data-automation-id":`editor_${n}_label`,htmlFor:l,style:d,children:cne({label:e,mandatory:i})}),(e=>{let t=`#${l}::placeholder {`;return void 0!==p.color&&(t+=`color: ${p.color};`),s.fontFamily&&(t+=`font-family: ${s.fontFamily};`),t+="}",(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)("style",{children:t}),(0,Er.jsx)("input",{id:l,ref:a,className:"mailpoet_text",type:"text",name:n,value:c,onChange:()=>u(""),placeholder:e,"data-automation-id":`editor_${n}_input`,style:h,autoComplete:"off"})]})})(t?cne({label:e,mandatory:i}):"")]})}function Bne({attributes:e,setAttributes:t,clientId:n}){const i=(0,zt.A)(e=>e(Gee).getIsCustomFieldSaving(),[]),r=(0,zt.A)(e=>e(Gee).getIsCustomFieldDeleting(),[]),{saveCustomField:o,deleteCustomField:s,customFieldEdited:a}=(0,Vt.A)(Gee),l=(0,Er.jsxs)(oC,{children:[(0,Er.jsx)(sne.A,{children:(0,Er.jsx)(mz.Ay,{title:$ee.U.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,Er.jsx)(wne,{updateAttributes:e=>t(e),customFieldId:e.customFieldId,label:e.label,mandatory:e.mandatory,validate:e.validate,isSaving:i,onSave:n=>{o({customFieldId:e.customFieldId,data:{params:mne("text",n)},onFinish:()=>t({mandatory:n.mandatory,validate:n.validate,label:n.label})})},onCustomFieldDelete:()=>s(e.customFieldId,n),isDeleting:r,onChange:(e,t)=>t&&a()})})}),(0,Er.jsx)(sne.A,{children:(0,Er.jsx)(mz.Ay,{title:$ee.U.I18n.t("customFieldsFormSettings"),initialOpen:!0,children:(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("displayLabelWithinInput"),checked:e.labelWithinInput,onChange:e=>t({labelWithinInput:e})})})}),(0,Er.jsx)(Ane,{styles:e.styles,onChange:e=>t({styles:e})})]});return(0,Er.jsxs)(Er.Fragment,{children:[l,(0,Er.jsx)(Tne,{className:e.className,name:"custom_text",mandatory:e.mandatory,labelWithinInput:e.labelWithinInput,label:e.label,styles:e.styles})]})}function Nne(e){return{title:e.name,description:"",icon:ine,category:"custom-fields",attributes:{label:{type:"string",default:e.name},labelWithinInput:{type:"boolean",default:!0},mandatory:{type:"boolean",default:!!e.params.required&&!!e.params.required},validate:{type:"string",default:e.params.validate?e.params.validate:""},customFieldId:{type:"string",default:e.id},styles:{type:"object",default:yne}},supports:{html:!1,multiple:!1},edit:Bne,save:()=>null}}function Rne({name:e,attributes:t,setAttributes:n,clientId:i}){const r=`${e.replace(/[^a-zA-Z]/g,"")}_${Math.random().toString(36).substring(2,15)}`,o=(0,zt.A)(e=>e(Gee).getFormSettings(),[]),s=(0,zt.A)(e=>e(Gee).getIsCustomFieldSaving(),[]),a=(0,zt.A)(e=>e(Gee).getIsCustomFieldDeleting(),[]),[l,c]=(0,T.useState)(""),{saveCustomField:u,deleteCustomField:d,customFieldEdited:h}=(0,Vt.A)(Gee),p=(0,Er.jsxs)(oC,{children:[(0,Er.jsx)(sne.A,{children:(0,Er.jsx)(mz.Ay,{title:$ee.U.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,Er.jsx)(wne,{label:t.label,mandatory:t.mandatory,validate:t.validate,isSaving:s,onSave:e=>u({customFieldId:t.customFieldId,data:{params:mne("textarea",e)},onFinish:()=>n({mandatory:e.mandatory,validate:e.validate,lines:e.lines,label:e.label})}),onCustomFieldDelete:()=>d(t.customFieldId,i),isDeleting:a,onChange:(e,t)=>t&&h()})})}),(0,Er.jsx)(sne.A,{children:(0,Er.jsxs)(mz.Ay,{title:$ee.U.I18n.t("formSettings"),initialOpen:!0,children:[(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("displayLabelWithinInput"),checked:t.labelWithinInput,onChange:e=>n({labelWithinInput:e})}),(0,Er.jsx)(oE.A,{label:`${$ee.U.I18n.t("customFieldNumberOfLines")}:`,"data-automation-id":"settings_custom_text_area_number_of_lines",value:t.lines,options:[{label:$ee.U.I18n.t("customField1Line"),value:"1"},{label:$ee.U.I18n.t("customField2Lines"),value:"2"},{label:$ee.U.I18n.t("customField3Lines"),value:"3"},{label:$ee.U.I18n.t("customField4Lines"),value:"4"},{label:$ee.U.I18n.t("customField5Lines"),value:"5"}],onChange:e=>n({lines:e})})]})}),(0,Er.jsx)(Ane,{styles:t.styles,onChange:e=>n({styles:e})})]}),f=t.styles.inheritFromTheme?{}:{fontWeight:t.styles.bold?"bold":"inherit"},m=t.styles.inheritFromTheme?{}:{borderRadius:t.styles.borderRadius?`${t.styles.borderRadius}px`:0,borderWidth:void 0!==t.styles.borderSize?`${t.styles.borderSize}px`:"1px",borderColor:t.styles.borderColor||"initial",borderStyle:"solid"};t.styles.fullWidth&&(m.width="100%"),t.styles.backgroundColor&&!t.styles.inheritFromTheme&&(m.backgroundColor=t.styles.backgroundColor),void 0!==o.inputPadding&&(m.padding=o.inputPadding),void 0!==o.alignment&&(m.textAlign=o.alignment,m.margin=jne(m.textAlign)),m.resize="none";const g={};t.styles.fontColor&&!t.styles.inheritFromTheme&&(m.color=t.styles.fontColor,t.labelWithinInput&&(g.color=t.styles.fontColor));const b=(0,T.useRef)(null),y=e=>{let n=`#${r}::placeholder {`;return void 0!==g.color&&(n+=`color: ${g.color};`),o.fontFamily&&(n+=`font-family: ${o.fontFamily};`),n+="}",(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)("style",{children:n}),(0,Er.jsx)("textarea",{id:r,ref:b,className:"mailpoet_textarea",name:"custom_text","data-automation-id":"editor_custom_textarea_input",rows:t.lines,style:m,onChange:()=>c(""),placeholder:e,value:l})]})};return(0,Er.jsxs)(fne,{className:t.className,children:[p,t.labelWithinInput?y(cne(t)):(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)("label",{className:"mailpoet_textarea_label","data-automation-id":"editor_custom_text_label",htmlFor:r,style:f,children:cne(t)}),y("")]})]})}function One(e){return{title:e.name,description:"",icon:ine,category:"custom-fields",attributes:{label:{type:"string",default:e.name},labelWithinInput:{type:"boolean",default:!0},mandatory:{type:"boolean",default:!!e.params.required&&!!e.params.required},validate:{type:"string",default:e.params.validate?e.params.validate:""},lines:{type:"string",default:"1"},customFieldId:{type:"string",default:e.id},styles:{type:"object",default:yne}},supports:{html:!1,multiple:!1},edit:Rne,save:()=>null}}Tne.propTypes={label:Uee().string.isRequired,labelWithinInput:Uee().bool.isRequired,name:Uee().string.isRequired,mandatory:Uee().bool.isRequired,className:Uee().string,styles:Ine.isRequired},Bne.propTypes={attributes:Uee().shape({label:Uee().string.isRequired,validate:Uee().string,labelWithinInput:Uee().bool.isRequired,mandatory:Uee().bool.isRequired,customFieldId:Uee().number.isRequired,styles:Ine.isRequired,className:Uee().string}).isRequired,setAttributes:Uee().func.isRequired,clientId:Uee().string.isRequired},Rne.propTypes={attributes:Uee().shape({label:Uee().string.isRequired,customFieldId:Uee().number.isRequired,validate:Uee().string,labelWithinInput:Uee().bool.isRequired,mandatory:Uee().bool.isRequired,lines:Uee().string,styles:Ine.isRequired,className:Uee().string}).isRequired,setAttributes:Uee().func.isRequired,clientId:Uee().string.isRequired,name:Uee().string.isRequired};var Lne=n(56768),Mne=n(73631),Pne=n(65578);function Dne({value:e,remove:t,onUpdate:n,onCheck:i,index:r}){return(0,Er.jsxs)("div",{className:"mailpoet-form-segments-settings-list","data-automation-id":"custom_field_value_settings",children:[(0,Er.jsx)("input",{type:"checkbox",defaultChecked:e.isChecked||!1,onChange:t=>i(e.id,t.target.checked)},`check-${e.id}`),(0,Er.jsx)("input",{type:"text",value:e.name,"data-automation-id":"custom_field_value_settings_value",onChange:t=>n(e.id,t.target.value)}),0!==r&&(0,Er.jsx)(Lne.A,{icon:"no-alt",color:"#900",className:"mailpoet-form-segments-segment-remove",onClick:(0,Kee.partial)(t,e.id)})]},e.id)}function Fne({values:e,update:t,remove:n,onReorder:i}){const[r,o]=(0,T.useState)(e);if((0,T.useEffect)(()=>{o(e)},[e]),0===r.length)return null;const s=(e,n)=>{const i=r.find(t=>t.id===e);i.name=n,t(i)},a=(e,n)=>{const i=r.find(t=>t.id===e);if(n){const e=r.find(e=>e.isChecked);e&&(delete e.isChecked,t(e)),i.isChecked=!0}else delete i.isChecked;t(i)};return(0,Er.jsx)("div",{className:"mailpoet-dnd-items-list",children:(0,Er.jsx)(Mne.JY,{onDragEnd:e=>{const t=e.source.index,n=e.destination.index,s=[...r],[a]=s.splice(t,1);s.splice(n,0,a),o(s),i(s)},children:(0,Er.jsx)(Pne.E,{droppableId:"droppable",children:e=>(0,Er.jsxs)("div",{...e.droppableProps,ref:e.innerRef,children:[r.map((e,t)=>(0,Er.jsx)(Mne.sx,{draggableId:e.id,index:t,children:i=>(0,Er.jsx)("div",{ref:i.innerRef,...i.draggableProps,...i.dragHandleProps,children:(0,Er.jsx)(Dne,{index:t,value:e,remove:n,onCheck:a,onUpdate:s},`inner${e.id}`)})},e.id)),e.placeholder]})})})})}function zne({label:e="",mandatory:t=!1,values:n=[],isSaving:i=!1,onSave:r=null,isDeleting:o=!1,onCustomFieldDelete:s=null,onChange:a=null,useDragAndDrop:l=!0}){const[c,u]=(0,T.useState)(e),[d,h]=(0,T.useState)(t),[p,f]=(0,T.useState)(JSON.parse(JSON.stringify(n))),m=(0,T.useMemo)(()=>({label:c,mandatory:d,values:p,isValid:(0,Kee.reduce)(p,(e,t)=>!(0,Kee.isEmpty)(t.name)&&e,!0)}),[c,d,p]),g=d!==t||!(0,Kee.isEqualWith)(n,p)||c!==e;return(0,T.useEffect)(()=>{a&&a(m,g)},[m,a,g]),(0,Er.jsxs)("div",{className:"custom-field-settings","data-automation-id":"custom_field_settings",children:[(0,Er.jsx)(kS.A,{label:$ee.U.I18n.t("label"),value:c,"data-automation-id":"settings_custom_text_label_input",onChange:u}),(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("blockMandatory"),checked:d,onChange:h}),(0,Er.jsx)(Fne,{remove:e=>{f(p.filter(t=>e!==t.id))},update:e=>{f(p.map(t=>e.id!==t.id?t:e))},values:p,onReorder:f,useDragAndDrop:l}),(0,Er.jsx)(fv.Ay,{variant:"link",onClick:()=>f([...p,{id:`${1e3*Math.random()}-${Date.now()}`,name:`Option ${p.length+1}`}]),className:"button-on-top","data-automation-id":"custom_field_values_add_item",children:$ee.U.I18n.t("customFieldAddItem")}),(0,Er.jsx)("br",{}),r?(0,Er.jsx)(fv.Ay,{variant:"primary",onClick:()=>r({mandatory:d,values:p,label:c}),isBusy:i,disabled:i||!g,className:"button-on-top","data-automation-id":"custom_field_save",children:$ee.U.I18n.t("customFieldSaveCTA")}):null,s?(0,Er.jsx)(ane,{isBusy:i||o,onDelete:s}):null]})}function Vne({attributes:e,setAttributes:t,clientId:n}){const i=(0,zt.A)(e=>e(Gee).getIsCustomFieldSaving(),[]),r=(0,zt.A)(e=>e(Gee).getIsCustomFieldDeleting(),[]),{saveCustomField:o,deleteCustomField:s,customFieldEdited:a}=(0,Vt.A)(Gee),l=(0,Er.jsxs)(oC,{children:[(0,Er.jsx)(sne.A,{children:(0,Er.jsx)(mz.Ay,{title:$ee.U.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,Er.jsx)(zne,{label:e.label,mandatory:e.mandatory,values:e.values,isSaving:i,onSave:n=>o({customFieldId:e.customFieldId,data:{params:mne("radio",n)},onFinish:()=>t({mandatory:n.mandatory,values:n.values,label:n.label})}),onCustomFieldDelete:()=>s(e.customFieldId,n),isDeleting:r,onChange:(e,t)=>t&&a()})})}),(0,Er.jsx)(sne.A,{children:(0,Er.jsx)(mz.Ay,{title:$ee.U.I18n.t("formSettings"),initialOpen:!0,children:(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("displayLabel"),checked:!e.hideLabel,onChange:e=>t({hideLabel:!e})})})})]});return(0,Er.jsxs)(fne,{className:e.className,children:[l,(0,Er.jsx)("span",{className:"mailpoet_radio_label","data-automation-id":"editor_custom_field_radio_buttons_block",children:e.hideLabel?null:cne(e)}),Array.isArray(e.values)&&e.values.map(e=>(0,Er.jsx)("div",{children:(0,Er.jsxs)("label",{children:[(0,Er.jsx)("input",{type:"radio",disabled:!0,checked:e.isChecked||!1,className:"mailpoet_radio"}),e.name]})},e.id))]})}function Une(e){const t=parseInt(e,10);if(!Number.isNaN(t))return t}Dne.propTypes={value:Uee().shape({name:Uee().string.isRequired,id:Uee().string.isRequired,isChecked:Uee().bool}).isRequired,onUpdate:Uee().func.isRequired,onCheck:Uee().func.isRequired,index:Uee().number.isRequired,remove:Uee().func.isRequired},Fne.propTypes={values:Uee().arrayOf(Uee().shape({name:Uee().string.isRequired,id:Uee().string.isRequired}).isRequired).isRequired,update:Uee().func.isRequired,remove:Uee().func.isRequired,onReorder:Uee().func.isRequired},zne.propTypes={label:Uee().string,mandatory:Uee().bool,values:Uee().arrayOf(Uee().shape({name:Uee().string.isRequired,id:Uee().string.isRequired})),onSave:Uee().func,isSaving:Uee().bool,isDeleting:Uee().bool,onCustomFieldDelete:Uee().func,onChange:Uee().func,useDragAndDrop:Uee().bool},Vne.propTypes={attributes:Uee().shape({label:Uee().string.isRequired,customFieldId:Uee().number.isRequired,values:Uee().arrayOf(Uee().shape({name:Uee().string.isRequired,id:Uee().string.isRequired,isChecked:Uee().bool})),mandatory:Uee().bool.isRequired,hideLabel:Uee().bool,className:Uee().string}).isRequired,setAttributes:Uee().func.isRequired,clientId:Uee().string.isRequired};let $ne=function(e){return e.Divider="divider",e.Spacer="spacer",e}({}),Hne=function(e){return e.Solid="solid",e.Dashed="dashed",e.Dotted="dotted",e}({});const Wne={className:void 0,height:1,type:$ne.Divider,style:Hne.Solid,dividerHeight:1,dividerWidth:100,color:"black"},Gne=()=>`${Math.random().toString()}-${Date.now()}`,qne=e=>e.map(e=>{const t={name:e.value,id:Gne()};return(0,Kee.has)(e,"is_checked")&&e.is_checked&&(t.isChecked=!0),t}),Kne=(e,t,n,i=[])=>{if(!Array.isArray(i))throw new Error("Mapper expects customFields to be an array.");return r=>{if(!Array.isArray(r))throw new Error("Mapper expects form body to be an array.");return r.map(r=>{if(["column","columns"].includes(r.type))return((e,t,n,i,r=[])=>{const o=Kne(t,n,i,r),s={clientId:Gne(),name:`core/${e.type}`,isValid:!0,attributes:{style:{color:{}}},innerBlocks:o(e.body?e.body:[])},a=xne(n,e.params.text_color),l=xne(n,e.params.background_color),c=kne(i,e.params.gradient);return(0,Kee.has)(e.params,"width")&&(s.attributes.width=Number.isNaN(Number(e.params.width))?e.params.width:`${e.params.width}%`),(0,Kee.has)(e.params,"vertical_alignment")&&(s.attributes.verticalAlignment=e.params.vertical_alignment),(0,Kee.has)(e.params,"text_color")&&(s.attributes.textColor=a,s.attributes.style.color.text=a?void 0:e.params.text_color),(0,Kee.has)(e.params,"background_color")&&(s.attributes.backgroundColor=l,s.attributes.style.color.background=l?void 0:e.params.background_color),(0,Kee.has)(e.params,"gradient")&&(s.attributes.gradient=c,s.attributes.style.color.gradient=c?void 0:e.params.gradient),(0,Kee.has)(e.params,"class_name")&&e.params.class_name&&(s.attributes.className=e.params.class_name),(0,Kee.has)(e.params,"padding")&&(s.attributes.style.spacing={padding:e.params.padding}),(0,Kee.has)(e.params,"is_stacked_on_mobile")&&(s.attributes.isStackedOnMobile="1"===e.params.is_stacked_on_mobile),"columns"!==e.type||(0,Kee.has)(e.params,"is_stacked_on_mobile")||(s.attributes.isStackedOnMobile=!0),s})(r,e,t,n,i);const o={clientId:`${r.id}_${Gne()}`,isValid:!0,innerBlocks:[],attributes:{labelWithinInput:!1,mandatory:!1,className:null}};if(["heading","paragraph"].includes(r.type)&&(o.attributes.style={color:{},typography:{fontSize:void 0,lineHeight:void 0}}),r.params&&(0,Kee.has)(r.params,"class_name")&&(o.attributes.className=r.params.class_name),r.params&&(0,Kee.has)(r.params,"required")&&(o.attributes.mandatory=!!r.params.required),r.params&&(0,Kee.has)(r.params,"label_within")&&(o.attributes.labelWithinInput=!!r.params.label_within),r.params&&(o.attributes.label=r.params.label?r.params.label:""),r.params&&(0,Kee.has)(r.params,"text_color")){const e=xne(t,r.params.text_color);o.attributes.textColor=e,["heading","paragraph"].includes(r.type)&&!e?o.attributes.style.color.text=r.params.text_color:e||(o.attributes.customTextColor=r.params.text_color)}if(r.params&&(0,Kee.has)(r.params,"background_color")){const e=xne(t,r.params.background_color);o.attributes.backgroundColor=e,["heading","paragraph"].includes(r.type)&&!e?o.attributes.style.color.background=r.params.background_color:e||(o.attributes.customBackgroundColor=r.params.background_color)}if(r.params&&(0,Kee.has)(r.params,"gradient")){const e=kne(n,r.params.gradient);o.attributes.gradient=e,e||(o.attributes.style.color.gradient=r.params.gradient)}if((0,Kee.has)(r.params,"padding")&&(o.attributes.style.spacing={padding:r.params.padding}),r.params&&(0,Kee.has)(r.params,"font_size")){const t=`${r.params.font_size}${Number.isNaN(Number(`${r.params.font_size}`||NaN))?"":"px"}`,n=((e,t)=>{const n=e.find(e=>e.size===t);return n?n.slug:void 0})(e,t);o.attributes.fontSize=n,o.attributes.style.typography.fontSize=n?void 0:t}r.params&&(0,Kee.has)(r.params,"line_height")&&(o.attributes.style.typography.lineHeight=r.params.line_height);let s=2;switch(r.id){case"email":return{...o,name:"mailpoet-form/email-input",attributes:{...o.attributes,styles:_ne(r.styles)}};case"heading":return r.params&&(0,Kee.has)(r.params,"level")&&(s=Une(r.params.level),void 0===s&&(s=2)),{...o,attributes:{...o.attributes,content:r.params?.content||"",level:s,textAlign:r.params?.align,anchor:r.params?.anchor,className:r.params?.class_name},name:"core/heading"};case"paragraph":return{...o,attributes:{...o.attributes,content:r.params?.content||"",align:r.params?.align,className:r.params?.class_name,dropCap:"1"===r.params?.drop_cap},name:"core/paragraph"};case"image":return{...o,name:"core/image",attributes:{className:r.params?.class_name||"",align:r.params?.align,url:r.params?.url,alt:r.params?.alt,title:r.params?.title,caption:r.params?.caption,linkDestination:r.params?.link_destination,link:r.params?.link,href:r.params?.href,linkClass:r.params?.link_class,rel:r.params?.rel,linkTarget:r.params?.link_target,id:r.params?.id,sizeSlug:r.params?.size_slug,width:r.params?.width,height:r.params?.height}};case"first_name":return{...o,name:"mailpoet-form/first-name-input",attributes:{...o.attributes,styles:_ne(r.styles)}};case"last_name":return{...o,name:"mailpoet-form/last-name-input",attributes:{...o.attributes,styles:_ne(r.styles)}};case"segments":return r.params&&(0,Kee.has)(r.params,"values")&&Array.isArray(r.params.values)?o.attributes.values=r.params.values.map(e=>({id:e.id,isChecked:"1"===e.is_checked||void 0})):o.attributes.values=[],{...o,name:"mailpoet-form/segment-select"};case"submit":return{...o,name:"mailpoet-form/submit-button",attributes:{...o.attributes,styles:_ne(r.styles)}};case"divider":return delete o.attributes.label,{...o,name:"mailpoet-form/divider",attributes:{className:o.attributes.className,height:Une(r.params?.height??Wne.height),type:r.params?.type??Wne.type,style:r.params?.style??Wne.style,dividerHeight:Une(r.params?.divider_height??Wne.dividerHeight),dividerWidth:Une(r.params?.divider_width??Wne.dividerWidth),color:r.params?.color??Wne.color}};case"html":return{...o,name:"mailpoet-form/html",attributes:{className:o.attributes.className,content:r.params&&r.params.text?r.params.text:"",nl2br:!(!r.params||!r.params.nl2br)&&parseInt(r.params.nl2br,10)>0}};default:return Number.isInteger(parseInt(r.id,10))?((e,t,n)=>{const i=t.find(t=>t.id===parseInt(e.id,10));if(!i)return null;const r={...n,name:nne({text:"mailpoet-form/custom-text",textarea:"mailpoet-form/custom-textarea",radio:"mailpoet-form/custom-radio",checkbox:"mailpoet-form/custom-checkbox",select:"mailpoet-form/custom-select",date:"mailpoet-form/custom-date"}[i.type],i)};return r.attributes.customFieldId=i.id,e.params&&((0,Kee.has)(e.params,"validate")&&e.params.validate&&(r.attributes.validate=e.params.validate),(0,Kee.has)(e.params,"hide_label")&&(r.attributes.hideLabel=!!e.params.hide_label),(0,Kee.has)(e.params,"lines")&&(r.attributes.lines=e.params.lines),(0,Kee.has)(e.params,"date_type")&&(r.attributes.dateType=e.params.date_type),(0,Kee.has)(e.params,"date_format")&&(r.attributes.dateFormat=e.params.date_format),(0,Kee.has)(e.params,"is_default_today")&&(r.attributes.defaultToday=!!e.params.is_default_today),(0,Kee.has)(e.params,"values")&&Array.isArray(e.params.values)&&(r.attributes.values=qne(e.params.values))),"text"!==i.type&&"textarea"!==i.type||(r.attributes.styles=_ne(e.styles)),r})(r,i,o):null}}).filter(Boolean)}};function Yne(e){return{title:e.name,description:"",icon:ine,category:"custom-fields",attributes:{label:{type:"string",default:e.name},hideLabel:{type:"boolean",default:!1},mandatory:{type:"boolean",default:!!e.params.required&&!!e.params.required},values:{type:"array",default:e.params.values?qne(e.params.values):[]},customFieldId:{type:"string",default:e.id}},supports:{html:!1,multiple:!1},edit:Vne,save:()=>null}}function Jne({label:e="",mandatory:t=!1,isSaving:n=!1,onSave:i=null,isChecked:r=!1,checkboxLabel:o="",isDeleting:s=!1,onCustomFieldDelete:a=null,onChange:l=()=>{}}){const[c,u]=(0,T.useState)(e),[d,h]=(0,T.useState)(t),[p,f]=(0,T.useState)(r),[m,g]=(0,T.useState)(o),b=d!==t||p!==r||c!==e||m!==o,y=(0,T.useMemo)(()=>({mandatory:d,isChecked:p,label:c,checkboxLabel:m,isValid:!(0,Kee.isEmpty)(m)}),[c,d,p,m]);return(0,T.useEffect)(()=>{l(y,b)},[y,l,b]),(0,Er.jsxs)("div",{className:"custom-field-settings",children:[(0,Er.jsx)(kS.A,{label:$ee.U.I18n.t("label"),value:c,"data-automation-id":"settings_custom_text_label_input",onChange:u}),(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("blockMandatory"),checked:d,onChange:h}),(0,Er.jsxs)(mk.Ay,{children:[(0,Er.jsx)("input",{type:"checkbox",checked:p,onChange:e=>f(!!e.target.checked)}),(0,Er.jsx)("input",{value:m,"data-automation-id":"settings_custom_checkbox_value",type:"text",onChange:e=>g(e.target.value)})]}),i?(0,Er.jsx)(fv.Ay,{variant:"primary",onClick:()=>i(y),isBusy:n,disabled:n||!b,className:"button-on-top","data-automation-id":"custom_field_save",children:$ee.U.I18n.t("customFieldSaveCTA")}):null,a?(0,Er.jsx)(ane,{isBusy:n||s,onDelete:a}):null]})}function Xne({attributes:e,setAttributes:t,clientId:n}){const i=(0,zt.A)(e=>e(Gee).getIsCustomFieldSaving(),[]),r=(0,zt.A)(e=>e(Gee).getIsCustomFieldDeleting(),[]),{saveCustomField:o,deleteCustomField:s,customFieldEdited:a}=(0,Vt.A)(Gee),l=()=>{if(Array.isArray(e.values)){const t=e.values[0];if(t)return t.name}return""},c=()=>{let t=!1;if(Array.isArray(e.values)){const n=e.values[0];n&&n.isChecked&&(t=!0)}return t},u=(0,Er.jsxs)(oC,{children:[(0,Er.jsx)(sne.A,{children:(0,Er.jsx)(mz.Ay,{title:$ee.U.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,Er.jsx)(Jne,{label:e.label,mandatory:e.mandatory,isSaving:i,isChecked:c(),checkboxLabel:l(),onSave:n=>o({customFieldId:e.customFieldId,data:{params:mne("checkbox",n)},onFinish:()=>t({mandatory:n.mandatory,label:n.label,values:[{isChecked:n.isChecked,name:n.checkboxLabel}]})}),onCustomFieldDelete:()=>s(e.customFieldId,n),isDeleting:r,onChange:(e,t)=>t&&a()})})}),(0,Er.jsx)(sne.A,{children:(0,Er.jsx)(mz.Ay,{title:$ee.U.I18n.t("formSettings"),initialOpen:!0,children:(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("displayLabel"),checked:!e.hideLabel,onChange:e=>t({hideLabel:!e})})})})]});let d=l();return e.mandatory&&(d+=" *"),(0,Er.jsxs)(fne,{className:e.className,children:[u,(0,Er.jsx)("span",{className:"mailpoet_checkbox_label","data-automation-id":"editor_custom_field_checkbox_block",children:e.hideLabel||!e.label?null:e.label}),(0,Er.jsx)("div",{children:(0,Er.jsxs)("label",{children:[(0,Er.jsx)("input",{type:"checkbox",disabled:!0,checked:c(),className:"mailpoet_checkbox"}),(0,Er.jsx)("span",{dangerouslySetInnerHTML:{__html:d}})]})})]})}function Zne(e){return{title:e.name,description:"",icon:ine,category:"custom-fields",attributes:{label:{type:"string",default:e.name},hideLabel:{type:"boolean",default:!1},values:{type:"array",default:e.params.values?qne(e.params.values):[]},mandatory:{type:"boolean",default:!!e.params.required&&!!e.params.required},customFieldId:{type:"string",default:e.id}},supports:{html:!1,multiple:!1},edit:Xne,save:()=>null}}function Qne({attributes:e,setAttributes:t,clientId:n}){const i=(0,zt.A)(e=>e(Gee).getFormSettings(),[]),r=(0,zt.A)(e=>e(Gee).getIsCustomFieldSaving(),[]),o=(0,zt.A)(e=>e(Gee).getIsCustomFieldDeleting(),[]),{saveCustomField:s,deleteCustomField:a,customFieldEdited:l}=(0,Vt.A)(Gee),c=(0,Er.jsxs)(oC,{children:[(0,Er.jsx)(sne.A,{children:(0,Er.jsx)(mz.Ay,{title:$ee.U.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,Er.jsx)(zne,{label:e.label,mandatory:e.mandatory,values:e.values,isSaving:r,onSave:n=>s({customFieldId:e.customFieldId,data:{params:mne("select",n)},onFinish:()=>t({mandatory:n.mandatory,values:n.values,label:n.label})}),onCustomFieldDelete:()=>a(e.customFieldId,n),isDeleting:o,onChange:(e,t)=>t&&l()})})}),(0,Er.jsx)(sne.A,{children:(0,Er.jsx)(mz.Ay,{title:$ee.U.I18n.t("formSettings"),initialOpen:!0,children:(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("displayLabelWithinInput"),checked:e.labelWithinInput,onChange:e=>t({labelWithinInput:e})})})})]});return(0,Er.jsxs)(fne,{className:e.className,children:[c,(0,Er.jsxs)("div",{className:"mailpoet_custom_select","data-automation-id":"custom_select_block",children:[e.labelWithinInput?null:(0,Er.jsx)("label",{className:"mailpoet_select_label",htmlFor:n,children:cne(e)}),(()=>{let t=e.labelWithinInput?cne(e):"-";const r=[{label:t}];!Array.isArray(e.values)&&e.values.length||e.values.forEach(n=>{r.push({label:n.name}),!e.labelWithinInput&&n.isChecked&&(t=n.name)});const o={};return void 0!==i.inputPadding&&(o.padding=i.inputPadding),void 0!==i.alignment&&(o.textAlign=i.alignment,o.margin=jne(o.textAlign)),i.fontFamily&&(o.fontFamily=i.fontFamily),(0,Er.jsx)("select",{style:o,className:"mailpoet_select",id:n,value:t,readOnly:!0,children:r.map((e,t)=>(0,Er.jsx)("option",{value:e.label,disabled:0===t,children:e.label},e.label))})})()]})]})}function eie(e){return{title:e.name,description:"",icon:ine,category:"custom-fields",attributes:{label:{type:"string",default:e.name},labelWithinInput:{type:"boolean",default:!0},mandatory:{type:"boolean",default:!!e.params.required&&!!e.params.required},values:{type:"array",default:e.params.values?qne(e.params.values):[]},customFieldId:{type:"string",default:e.id}},supports:{html:!1,multiple:!1},edit:Qne,save:()=>null}}function tie(e){return{date:{name:"mailpoet-form/custom-date",settings:bne(e)},text:{name:"mailpoet-form/custom-text",settings:Nne(e)},textarea:{name:"mailpoet-form/custom-textarea",settings:One(e)},radio:{name:"mailpoet-form/custom-radio",settings:Yne(e)},checkbox:{name:"mailpoet-form/custom-checkbox",settings:Zne(e)},select:{name:"mailpoet-form/custom-select",settings:eie(e)}}}Jne.propTypes={label:Uee().string,mandatory:Uee().bool,onSave:Uee().func,isSaving:Uee().bool,isChecked:Uee().bool,checkboxLabel:Uee().string,isDeleting:Uee().bool,onCustomFieldDelete:Uee().func,onChange:Uee().func},Xne.propTypes={attributes:Uee().shape({label:Uee().string.isRequired,customFieldId:Uee().number.isRequired,mandatory:Uee().bool.isRequired,hideLabel:Uee().bool,className:Uee().string,values:Uee().arrayOf(Uee().shape({name:Uee().string.isRequired,isChecked:Uee().bool}))}).isRequired,setAttributes:Uee().func.isRequired,clientId:Uee().string.isRequired},Qne.propTypes={attributes:Uee().shape({customFieldId:Uee().number.isRequired,labelWithinInput:Uee().bool.isRequired,label:Uee().string.isRequired,values:Uee().arrayOf(Uee().shape({name:Uee().string.isRequired,isChecked:Uee().bool,id:Uee().string.isRequired})),mandatory:Uee().bool.isRequired,className:Uee().string}).isRequired,setAttributes:Uee().func.isRequired,clientId:Uee().string.isRequired};const nie=(0,Er.jsxs)(AC.t4,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,Er.jsx)(AC.wA,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,Er.jsx)(AC.wA,{d:"M19 13H5v-2h14v2z"})]}),iie={title:$ee.U.I18n.t("blockDivider"),description:null,icon:nie,category:"design",attributes:{height:{type:"number",default:Wne.height},type:{type:"string",default:Wne.type},style:{type:"string",default:Wne.style},dividerHeight:{type:"number",default:Wne.dividerHeight},dividerWidth:{type:"number",default:Wne.dividerWidth},color:{type:"string",default:Wne.color}},supports:{html:!1,multiple:!0},edit:function({attributes:e,setAttributes:t}){const n=e.dividerHeight??Wne.dividerHeight,i=e.dividerWidth??Wne.dividerWidth,r=e.height??Wne.height,o=(0,Er.jsxs)("div",{className:"mailpoet-styles-settings",children:[(0,Er.jsx)(oE.A,{label:$ee.U.I18n.t("blockDividerStyle"),"data-automation-id":"settings_divider_style",value:e.style,onChange:e=>t({style:e}),options:[{value:Hne.Solid,label:$ee.U.I18n.t("blockDividerStyleSolid")},{value:Hne.Dashed,label:$ee.U.I18n.t("blockDividerStyleDashed")},{value:Hne.Dotted,label:$ee.U.I18n.t("blockDividerStyleDotted")}]}),(0,Er.jsx)(gk.A,{label:$ee.U.I18n.t("blockDividerDividerHeight"),className:"mailpoet-automation-styles-divider-height",value:n,min:1,max:40,allowReset:!0,onChange:e=>{let n=r;void 0!==e&&(n=Math.max(e,r)),t({dividerHeight:e,height:n})}}),(0,Er.jsx)(gk.A,{label:$ee.U.I18n.t("blockDividerDividerWidth"),className:"mailpoet-automation-styles-divider-width",value:i,min:1,max:100,allowReset:!0,onChange:e=>t({dividerWidth:e})}),(0,Er.jsx)(Sne,{title:$ee.U.I18n.t("formSettingsColor"),settings:[{label:$ee.U.I18n.t("blockDividerBackground"),colorValue:e.color,onColorChange:e=>t({color:e})}]})]}),s={};return e.type===$ne.Divider&&(s.borderTopStyle=e.style,s.borderTopWidth=n,s.borderTopColor=e.color,s.height=n,s.width=`${i}%`),(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(oC,{children:(0,Er.jsx)(sne.A,{children:(0,Er.jsxs)(mz.Ay,{title:$ee.U.I18n.t("formSettingsStyles"),initialOpen:!0,children:[(0,Er.jsx)(gk.A,{label:$ee.U.I18n.t("blockSpacerHeight"),className:"mailpoet-automation-spacer-height-size",value:r,min:1,max:400,allowReset:!0,onChange:e=>{let i=n;i=void 0!==e?Math.min(e,n):1,t({height:e,dividerHeight:i})}}),(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("blockSpacerEnableDivider"),className:"mailpoet-automation-divider-togle-enable",checked:e.type===$ne.Divider,onChange:e=>t({type:e?$ne.Divider:$ne.Spacer})}),e.type===$ne.Divider&&o]})})}),(0,Er.jsx)("div",{className:M()("mailpoet_spacer",e.className),"data-automation-id":"editor_spacer_block",style:{height:r,display:"flex",flexDirection:"column",alignItems:"center",width:"100%",justifyContent:"center"},children:(0,Er.jsx)("div",{className:"mailpoet_divider","data-automation-id":"editor_divider_block",style:s})})]})},save:()=>null};function rie({attributes:e,setAttributes:t}){const n=(0,Er.jsxs)(oC,{children:[(0,Er.jsx)(sne.A,{children:(0,Er.jsxs)(mz.Ay,{title:$ee.U.I18n.t("formSettings"),initialOpen:!0,children:[(0,Er.jsx)(kS.A,{label:$ee.U.I18n.t("label"),value:e.label,"data-automation-id":"settings_email_label_input",onChange:e=>t({label:e})}),(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("displayLabelWithinInput"),checked:e.labelWithinInput,onChange:e=>t({labelWithinInput:e})})]})}),(0,Er.jsx)(Ane,{styles:e.styles,onChange:e=>t({styles:e})})]});return(0,Er.jsxs)(Er.Fragment,{children:[n,(0,Er.jsx)(Tne,{className:e.className,name:"email",label:e.label,labelWithinInput:!!e.labelWithinInput,mandatory:!0,styles:e.styles})]})}rie.propTypes={attributes:Uee().shape({label:Uee().string.isRequired,labelWithinInput:Uee().bool.isRequired,className:Uee().string,styles:Ine.isRequired}).isRequired,setAttributes:Uee().func.isRequired};const oie=(0,Er.jsxs)(AC.t4,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,Er.jsx)(AC.wA,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,Er.jsx)(AC.G,{children:(0,Er.jsx)(AC.wA,{fill:"#32373C",d:"m18.82592,6.5l-14,0c-0.8,0 -1.5,0.7 -1.5,1.5l0,8c0,0.8 0.7,1.5 1.5,1.5l14,0c0.8,0 1.5,-0.7 1.5,-1.5l0,-8c0,-0.8 -0.7,-1.5 -1.5,-1.5zm-1.2,1l-5.8,4.9l-5.8,-4.9l11.6,0zm1.7,8.5c0,0.3 -0.2,0.5 -0.5,0.5l-14,0c-0.3,0 -0.5,-0.2 -0.5,-0.5l0,-8c0,-0.2 0.1,-0.4 0.3,-0.4l6.9,5.9c0.1,0.1 0.2,0.1 0.3,0.1s0.2,0 0.3,-0.1l6.9,-5.9c0.2,0.1 0.3,0.2 0.3,0.4l0,8z"})})]}),sie={title:$ee.U.I18n.t("blockEmail"),description:$ee.U.I18n.t("blockEmailDescription"),icon:oie,category:"obligatory",attributes:{label:{type:"string",default:$ee.U.I18n.t("blockEmail")},labelWithinInput:{type:"boolean",default:!0},styles:{type:"object",default:yne}},supports:{html:!1,inserter:!1,multiple:!1},edit:rie,save:()=>null};function aie({value:e,onChange:t}){const[n]=tv("typography.fontSizes");return(0,Er.jsx)(lL,{value:e,onChange:t,fontSizes:n,__nextHasNoMarginBottom:!0})}const lie=["Arial","Comic Sans MS","Courier New","Georgia","Lucida","Tahoma","Times New Roman","Trebuchet MS","Verdana"];function cie({onChange:e,value:t,name:n,hideLabelFromVision:i=!1}){const r=(0,zt.A)(e=>e(Gee).getAllCustomFonts(),[]),o={color:"lightgray",backgroundColor:"white",cursor:"default"},s=e=>({fontFamily:e,cursor:"default",marginLeft:16}),a=[{key:$ee.U.I18n.t("formFontsDefaultTheme"),name:$ee.U.I18n.t("formFontsDefaultTheme"),selectable:!0,value:""},{key:$ee.U.I18n.t("formFontsStandard"),name:$ee.U.I18n.t("formFontsStandard"),selectable:!1,style:o},...lie.map(e=>({key:e,name:e,selectable:!0,style:s(e),value:e}))];$ee.U.libs3rdPartyEnabled&&(a.push({key:$ee.U.I18n.t("formFontsCustom"),name:$ee.U.I18n.t("formFontsCustom"),selectable:!1,style:o}),r.forEach(e=>{a.push({key:e,name:e,selectable:!0,style:s(e),value:e})}));let l=void 0!==t&&a.find(e=>e.value===t);return l||(l=a[0]),(0,Er.jsx)(wR,{options:a,onChange:t=>{const n=t.selectedItem;n.selectable&&e(n.value)},value:l,label:n,className:"mailpoet-font-family-select",hideLabelFromVision:i})}function uie(){const e=(0,zt.A)(e=>e(Gee).getAllCustomFonts(),[]);if(!$ee.U.libs3rdPartyEnabled)return null;const t=e.map(e=>e.replace(" ","+")).map(e=>e.concat(":400,400i,700,700i")).join("|");return(0,Er.jsx)("link",{rel:"stylesheet",href:`https://fonts.googleapis.com/css?family=${t}`})}function die({styles:e,onChange:t,formInputPadding:n,formFontFamily:i}){const[r,o]=(0,T.useState)(e),s=(0,T.useRef)(r);s.current=r;const a=(0,T.useRef)(e);e!==a.current&&(a.current=e,o(e));const l=(e,n)=>{const i={...s.current,[e]:n};s.current=i,o(i),t(i)};return(0,Er.jsx)(sne.A,{className:"mailpoet-automation-input-styles-panel",children:(0,Er.jsx)(mz.Ay,{title:$ee.U.I18n.t("formSettingsStyles"),initialOpen:!1,children:(0,Er.jsxs)("div",{className:"mailpoet-styles-settings","data-automation-id":"input_styles_settings",children:[(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("formSettingsDisplayFullWidth"),checked:r.fullWidth,onChange:(0,Kee.partial)(l,"fullWidth")}),(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("formSettingsInheritStyleFromTheme"),checked:r.inheritFromTheme,onChange:e=>{if(e)return void l("inheritFromTheme",e);const i={...s.current,backgroundColor:"#eeeeee",bold:!1,borderRadius:0,borderSize:1,borderColor:"#313131",fontColor:"#313131",fontSize:void 0,padding:n,inheritFromTheme:e};s.current=i,o(i),t(i)},className:"mailpoet-automation-inherit-theme-toggle"}),r.inheritFromTheme?null:(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(Sne,{title:$ee.U.I18n.t("formSettingsColor"),settings:[{label:$ee.U.I18n.t("formSettingsStylesBackground"),colorValue:e.backgroundColor,gradientValue:e.gradient,onColorChange:(0,Kee.partial)(l,"backgroundColor"),onGradientChange:(0,Kee.partial)(l,"gradient")},{label:$ee.U.I18n.t("formSettingsStylesFont"),colorValue:e.fontColor,onColorChange:(0,Kee.partial)(l,"fontColor")},{label:$ee.U.I18n.t("formSettingsBorder"),colorValue:r.borderColor,onColorChange:(0,Kee.partial)(l,"borderColor")}]}),(0,Er.jsx)(aie,{value:e.fontSize,onChange:(0,Kee.partial)(l,"fontSize")}),(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("formSettingsBold"),checked:r.bold||!1,onChange:(0,Kee.partial)(l,"bold"),className:"mailpoet-automation-styles-bold-toggle"}),(0,Er.jsx)(cie,{name:$ee.U.I18n.t("formSettingsStylesFontFamily"),value:e.fontFamily||i,onChange:(0,Kee.partial)(l,"fontFamily")}),(0,Er.jsx)(gk.A,{label:$ee.U.I18n.t("formSettingsInputPadding"),value:r.padding??n,min:0,max:30,allowReset:!0,resetFallbackValue:n,onChange:e=>l("padding",e??n)}),(0,Er.jsx)(gk.A,{label:$ee.U.I18n.t("formSettingsBorderSize"),value:r.borderSize??1,min:0,max:10,allowReset:!0,resetFallbackValue:1,onChange:e=>l("borderSize",e??1),className:"mailpoet-automation-styles-border-size"}),(0,Er.jsx)(gk.A,{label:$ee.U.I18n.t("formSettingsBorderRadius"),value:r.borderRadius??0,min:0,max:40,allowReset:!0,resetFallbackValue:0,onChange:e=>l("borderRadius",e??0)})]})]})})})}const hie=(0,Er.jsxs)(AC.t4,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,Er.jsx)(AC.wA,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,Er.jsx)(AC.G,{children:(0,Er.jsx)(AC.wA,{d:"M19 6H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 10H5V8h14v8z"})})]}),pie={title:$ee.U.I18n.t("blockSubmit"),description:$ee.U.I18n.t("blockSubmitDescription"),icon:hie,category:"obligatory",attributes:{label:{type:"string",default:$ee.U.I18n.t("blockSubmitLabel")},styles:{type:"object",default:{fullWidth:!0,inheritFromTheme:!0}}},supports:{html:!1,inserter:!1,multiple:!1},edit:function({attributes:e,setAttributes:t}){const n=(0,zt.A)(e=>e(Gee).getFormSettings(),[]),i=(0,Er.jsxs)(oC,{children:[(0,Er.jsx)(sne.A,{children:(0,Er.jsx)(mz.Ay,{title:$ee.U.I18n.t("formSettings"),initialOpen:!0,children:(0,Er.jsx)(kS.A,{label:$ee.U.I18n.t("label"),value:e.label,onChange:e=>t({label:e}),"data-automation-id":"settings_submit_label_input"})})}),(0,Er.jsx)(die,{onChange:e=>t({styles:e}),styles:e.styles,formInputPadding:n.inputPadding,formFontFamily:n.fontFamily})]}),r="number"==typeof e.styles.fontSize?`${e.styles.fontSize}px`:e.styles.fontSize,o=e.styles.inheritFromTheme?{}:{fontWeight:e.styles.bold?"bold":"inherit",borderRadius:void 0!==e.styles.borderRadius?`${e.styles.borderRadius}px`:0,borderWidth:void 0!==e.styles.borderSize?`${e.styles.borderSize}px`:"1px",borderColor:e.styles.borderColor||"transparent",borderStyle:"solid",fontSize:r||"inherit",color:e.styles.fontColor||"inherit"};e.styles.fullWidth&&(o.width="100%"),void 0===e.styles.padding||e.styles.inheritFromTheme?void 0!==n.inputPadding&&(o.padding=n.inputPadding):o.padding=e.styles.padding,e.styles.backgroundColor&&!e.styles.inheritFromTheme&&(o.backgroundColor=e.styles.backgroundColor),e.styles.backgroundColor&&!e.styles.inheritFromTheme&&(o.backgroundColor=e.styles.backgroundColor),e.styles.gradient&&!e.styles.inheritFromTheme&&(o.backgroundColor=void 0,o.background=e.styles.gradient),e.styles.fontFamily&&!e.styles.inheritFromTheme&&(o.fontFamily=e.styles.fontFamily);const s=M()("mailpoet_submit",{button:e.styles.inheritFromTheme});return(0,Er.jsxs)(fne,{className:e.className,children:[i,(0,Er.jsx)("input",{className:s,type:"submit",value:e.label,"data-automation-id":"editor_submit_input",style:o})]})},save:()=>null},fie=(0,Er.jsxs)(AC.t4,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,Er.jsx)(AC.wA,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,Er.jsx)(AC.G,{children:(0,Er.jsx)(AC.wA,{d:"M19 6H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 10H5V8h14v8z"})})]});function mie({attributes:e,setAttributes:t}){const n=(0,Er.jsxs)(oC,{children:[(0,Er.jsx)(sne.A,{children:(0,Er.jsxs)(mz.Ay,{title:$ee.U.I18n.t("formSettings"),initialOpen:!0,children:[(0,Er.jsx)(kS.A,{label:$ee.U.I18n.t("label"),value:e.label,"data-automation-id":"settings_first_name_label_input",onChange:e=>t({label:e})}),(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("displayLabelWithinInput"),checked:e.labelWithinInput,onChange:e=>t({labelWithinInput:e}),className:"mailpoet-automation-label-within-input-toggle"}),(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("blockMandatory"),checked:e.mandatory,onChange:e=>t({mandatory:e})})]})}),(0,Er.jsx)(Ane,{styles:e.styles,onChange:e=>t({styles:e})})]});return(0,Er.jsxs)(Er.Fragment,{children:[n,(0,Er.jsx)(Tne,{className:e.className,name:"first_name",mandatory:e.mandatory,labelWithinInput:e.labelWithinInput,label:e.label,styles:e.styles})]})}mie.propTypes={attributes:Uee().shape({label:Uee().string.isRequired,labelWithinInput:Uee().bool.isRequired,mandatory:Uee().bool.isRequired,className:Uee().string,styles:Ine.isRequired}).isRequired,setAttributes:Uee().func.isRequired};const gie={title:$ee.U.I18n.t("blockFirstName"),description:$ee.U.I18n.t("blockFirstNameDescription"),icon:fie,category:"fields",attributes:{label:{type:"string",default:$ee.U.I18n.t("blockFirstName")},labelWithinInput:{type:"boolean",default:!0},mandatory:{type:"boolean",default:!1},styles:{type:"object",default:yne}},supports:{html:!1,multiple:!1},edit:mie,save:()=>null},bie=(0,Er.jsxs)(AC.t4,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,Er.jsx)(AC.wA,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,Er.jsx)(AC.G,{children:(0,Er.jsx)(AC.wA,{d:"M19 6H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 10H5V8h14v8z"})})]});function yie({attributes:e,setAttributes:t}){const n=(0,Er.jsxs)(oC,{children:[(0,Er.jsx)(sne.A,{children:(0,Er.jsxs)(mz.Ay,{title:$ee.U.I18n.t("formSettings"),initialOpen:!0,children:[(0,Er.jsx)(kS.A,{label:$ee.U.I18n.t("label"),value:e.label,"data-automation-id":"settings_last_name_label_input",onChange:e=>t({label:e})}),(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("displayLabelWithinInput"),checked:e.labelWithinInput,onChange:e=>t({labelWithinInput:e})}),(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("blockMandatory"),checked:e.mandatory,onChange:e=>t({mandatory:e})})]})}),(0,Er.jsx)(Ane,{styles:e.styles,onChange:e=>t({styles:e})})]});return(0,Er.jsxs)(Er.Fragment,{children:[n,(0,Er.jsx)(Tne,{className:e.className,name:"last_name",mandatory:e.mandatory,labelWithinInput:e.labelWithinInput,label:e.label,styles:e.styles})]})}yie.propTypes={attributes:Uee().shape({label:Uee().string.isRequired,labelWithinInput:Uee().bool.isRequired,mandatory:Uee().bool.isRequired,className:Uee().string,styles:Ine.isRequired}).isRequired,setAttributes:Uee().func.isRequired};const vie={title:$ee.U.I18n.t("blockLastName"),description:$ee.U.I18n.t("blockLastNameDescription"),icon:bie,category:"fields",attributes:{label:{type:"string",default:$ee.U.I18n.t("blockLastName")},labelWithinInput:{type:"boolean",default:!0},mandatory:{type:"boolean",default:!1},styles:{type:"object",default:yne}},supports:{html:!1,multiple:!1},edit:yie,save:()=>null},_ie=(0,Er.jsx)(AC.t4,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Er.jsx)(AC.G,{children:(0,Er.jsx)(AC.wA,{d:"M9 19h12v-2H9v2zm0-6h12v-2H9v2zm0-8v2h12V5H9zm-4-.5c-.828 0-1.5.672-1.5 1.5S4.172 7.5 5 7.5 6.5 6.828 6.5 6 5.828 4.5 5 4.5zm0 6c-.828 0-1.5.672-1.5 1.5s.672 1.5 1.5 1.5 1.5-.672 1.5-1.5-.672-1.5-1.5-1.5zm0 6c-.828 0-1.5.672-1.5 1.5s.672 1.5 1.5 1.5 1.5-.672 1.5-1.5-.672-1.5-1.5-1.5z"})})});var xie=n(19253);function kie({segment:e,removeSegment:t,onCheck:n}){return(0,Er.jsxs)("div",{className:"mailpoet-form-segments-settings-list",children:[(0,Er.jsx)(WA.A,{label:e.name,defaultChecked:!!e.isChecked,onChange:(0,Kee.partial)(n,e.id)},`check-${e.id}`),(0,Er.jsx)(Lne.A,{icon:"no-alt",color:"#900",className:"mailpoet-form-segments-segment-remove",onClick:(0,Kee.partial)(t,e.id)})]},e.id)}function wie({segments:e,updateSegment:t,removeSegment:n,onSegmentsReorder:i}){const[r,o]=(0,T.useState)(e);if((0,T.useEffect)(()=>{o(e)},[e]),0===r.length)return null;const s=(e,n)=>{const i=r.find(t=>t.id===e);i.isChecked=n,t(i)};return(0,Er.jsx)(Mne.JY,{onDragEnd:e=>{const t=e.source.index,n=e.destination.index,s=[...r],[a]=s.splice(t,1);s.splice(n,0,a),o(s),i(s)},children:(0,Er.jsx)(Mne.gL,{droppableId:"droppable",children:e=>(0,Er.jsxs)("div",{...e.droppableProps,ref:e.innerRef,children:[r.map((e,t)=>(0,Er.jsx)(Mne.sx,{draggableId:e.id,index:t,children:i=>(0,Er.jsx)("div",{ref:i.innerRef,...i.draggableProps,...i.dragHandleProps,children:(0,Er.jsx)(kie,{index:t,segment:e,onCheck:s,removeSegment:n},e.id)})},e.id)),e.placeholder]})})})}kie.propTypes={segment:Uee().shape({name:Uee().string.isRequired,isChecked:Uee().bool,id:Uee().string.isRequired}).isRequired,onCheck:Uee().func.isRequired,removeSegment:Uee().func.isRequired},wie.propTypes={segments:Uee().arrayOf(Uee().shape({name:Uee().string.isRequired,isChecked:Uee().bool,id:Uee().string.isRequired}).isRequired).isRequired,updateSegment:Uee().func.isRequired,removeSegment:Uee().func.isRequired,onSegmentsReorder:Uee().func.isRequired};const Cie=(e,t)=>e.find(e=>e.id===t);function Sie({label:e,onLabelChanged:t,segmentsAddedIntoSelection:n,addSegmentIntoSelection:i,setNewSelection:r}){const o=(0,zt.A)(e=>e(Gee).getAllAvailableSegments(),[]),s=o.map(e=>({label:e.name,value:e.id})).filter(e=>!Cie(n,e.value));return(0,Er.jsx)(oC,{children:(0,Er.jsx)(sne.A,{children:(0,Er.jsxs)(mz.Ay,{title:$ee.U.I18n.t("formSettings"),initialOpen:!0,children:[(0,Er.jsx)(xie.A,{children:(0,Er.jsx)(kS.A,{label:$ee.U.I18n.t("label"),value:e,"data-automation-id":"settings_first_name_label_input",onChange:t})}),(0,Er.jsx)(xie.A,{children:s.length?(0,Er.jsx)(oE.A,{label:`${$ee.U.I18n.t("blockSegmentSelectListLabel")}:`,"data-automation-id":"select_list_selections_list",options:[{label:$ee.U.I18n.t("settingsPleaseSelectList"),value:null},...s],onChange:e=>{const t=Cie(o,e);i({name:t.name,isChecked:!1,id:e})}}):null}),(0,Er.jsx)(wie,{segments:n,updateSegment:e=>{r(n.map(t=>e.id!==t?t:e))},removeSegment:e=>{r(n.filter(t=>e!==t.id))},onSegmentsReorder:r})]})})})}function Aie({attributes:e,setAttributes:t}){const n=(0,zt.A)(e=>e(Gee).getAllAvailableSegments(),[]),i=(0,T.useMemo)(()=>e.values.map(e=>{const t={...e},i=n.find(t=>parseInt(t.id,10)===parseInt(e.id,10));return t.name=i?i.name:"",t}),[e.values,n]),r=e=>e.map(e=>{const t={...e};return delete t.name,t});return(0,Er.jsxs)(fne,{className:e.className,children:[(0,Er.jsx)(Sie,{label:e.label,onLabelChanged:e=>t({label:e}),segmentsAddedIntoSelection:i,setNewSelection:e=>t({values:r(e)}),addSegmentIntoSelection:n=>t({values:r([...e.values,n])})}),(0,Er.jsx)("span",{className:"mailpoet_segment_label","data-automation-id":"mailpoet_list_selection_block",children:e.label}),0===e.values.length?(0,Er.jsx)("p",{className:"mailpoet_error",children:$ee.U.I18n.t("blockSegmentSelectNoLists")}):i.map(e=>(0,Er.jsxs)("label",{className:"mailpoet_checkbox_label",children:[(0,Er.jsx)("input",{type:"checkbox",disabled:!0,checked:!!e.isChecked,className:"mailpoet_checkbox"},e.id),e.name]},e.id))]})}Sie.propTypes={label:Uee().string.isRequired,onLabelChanged:Uee().func.isRequired,addSegmentIntoSelection:Uee().func.isRequired,setNewSelection:Uee().func.isRequired,segmentsAddedIntoSelection:Uee().arrayOf(Uee().shape({name:Uee().string.isRequired,isChecked:Uee().bool,id:Uee().string.isRequired}).isRequired).isRequired},Aie.propTypes={attributes:Uee().shape({label:Uee().string.isRequired,className:Uee().string,values:Uee().arrayOf(Uee().shape({isChecked:Uee().bool,id:Uee().string.isRequired})).isRequired}).isRequired,setAttributes:Uee().func.isRequired};const Iie={title:$ee.U.I18n.t("blockSegmentSelect"),description:$ee.U.I18n.t("blockLastNameDescription"),icon:_ie,category:"fields",attributes:{label:{type:"string",default:$ee.U.I18n.t("blockSegmentSelectLabel")},values:{type:"array",default:[]}},supports:{html:!1,multiple:!1},edit:Aie,save:()=>null},Eie=(0,Er.jsx)(AC.t4,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Er.jsx)(AC.wA,{d:"M4.5,11h-2V9H1v6h1.5v-2.5h2V15H6V9H4.5V11z M7,10.5h1.5V15H10v-4.5h1.5V9H7V10.5z M14.5,10l-1-1H12v6h1.5v-3.9 l1,1l1-1V15H17V9h-1.5L14.5,10z M19.5,13.5V9H18v6h5v-1.5H19.5z"})});function jie(){return(0,bt.A)(e=>{const{ownerDocument:t}=e;if(!t)return;const{defaultView:n}=t;if(n)return n.addEventListener("blur",i),()=>{n.removeEventListener("blur",i)};function i(){t&&t.activeElement===e&&e.focus()}},[])}var Tie=function(){const{MutationObserver:e}=window;function t(){const e=document.body.getBoundingClientRect();window.parent.postMessage({action:"resize",width:e.width,height:e.height},"*")}function n(e){e.style&&["width","height","minHeight","maxHeight"].forEach(function(t){/^\\d+(vw|vh|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)$/.test(e.style[t])&&(e.style[t]="")})}e&&document.body&&window.parent&&(new e(t).observe(document.body,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}),window.addEventListener("load",t,!0),Array.prototype.forEach.call(document.querySelectorAll("[style]"),n),Array.prototype.forEach.call(document.styleSheets,function(e){Array.prototype.forEach.call(e.cssRules||e.rules,n)}),document.body.style.position="absolute",document.body.style.width="100%",document.body.setAttribute("data-resizable-iframe-connected",""),t(),window.addEventListener("resize",t,!0))},Bie="\n\tbody {\n\t\tmargin: 0;\n\t}\n\thtml,\n\tbody,\n\tbody > div {\n\t\twidth: 100%;\n\t}\n\thtml.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio > div,\n\tbody.wp-has-aspect-ratio > div iframe {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\toverflow: hidden; /* If it has an aspect ratio, it shouldn't scroll. */\n\t}\n\tbody > div > * {\n\t\tmargin-top: 0 !important; /* Has to have !important to override inline styles. */\n\t\tmargin-bottom: 0 !important;\n\t}\n";function Nie({html:e="",title:t="",type:n,styles:i=[],scripts:r=[],onFocus:o,tabIndex:s}){const a=(0,T.useRef)(null),[l,c]=(0,T.useState)(0),[u,d]=(0,T.useState)(0),h=(0,T.useMemo)(()=>function({html:e,title:t,type:n,styles:i,scripts:r}){const o=(0,Er.jsxs)("html",{lang:document.documentElement.lang,className:n,children:[(0,Er.jsxs)("head",{children:[(0,Er.jsx)("title",{children:t}),(0,Er.jsx)("style",{dangerouslySetInnerHTML:{__html:Bie}}),i.map((e,t)=>(0,Er.jsx)("style",{dangerouslySetInnerHTML:{__html:e}},t))]}),(0,Er.jsxs)("body",{"data-resizable-iframe-connected":"data-resizable-iframe-connected",className:n,children:[(0,Er.jsx)("div",{dangerouslySetInnerHTML:{__html:e}}),(0,Er.jsx)("script",{type:"text/javascript",dangerouslySetInnerHTML:{__html:`(${Tie.toString()})();`}}),r.map(e=>(0,Er.jsx)("script",{src:e},e))]})]});return"<!DOCTYPE html>"+(0,Ar.Ay)(o)}({html:e,title:t,type:n,styles:i,scripts:r}),[e,t,n,i,r]);return(0,T.useEffect)(()=>{const e=a.current;if(!e)return;function t(t){if(!e||e.contentWindow!==t.source)return;let n=t.data||{};if("string"==typeof n)try{n=JSON.parse(n)}catch{}"resize"===n.action&&(c(n.width),d(n.height))}let n=null;function i(){const i=e?.ownerDocument?.defaultView??null;i!==n&&(n?.removeEventListener("message",t),n=i,n?.addEventListener("message",t))}return i(),e.addEventListener("load",i),()=>{e.removeEventListener("load",i),n?.removeEventListener("message",t)}},[]),(0,Er.jsx)("iframe",{ref:(0,gt.A)([a,jie()]),title:t,tabIndex:s,className:"components-sandbox",sandbox:"allow-scripts allow-presentation",srcDoc:h,onFocus:o,width:Math.ceil(l),height:Math.ceil(u)})}function Rie({html:e="",title:t="",type:n,styles:i=[],scripts:r=[],onFocus:o,tabIndex:s}){const a=(0,T.useRef)(null),[l,c]=(0,T.useState)(0),[u,d]=(0,T.useState)(0);function h(o=!1){if(!function(){try{return!!a.current?.contentDocument?.body}catch{return!1}}())return;const{contentDocument:s,ownerDocument:l}=a.current;if(!o&&null!==s?.body.getAttribute("data-resizable-iframe-connected"))return;const c=(0,Er.jsxs)("html",{lang:l.documentElement.lang,className:n,children:[(0,Er.jsxs)("head",{children:[(0,Er.jsx)("title",{children:t}),(0,Er.jsx)("style",{dangerouslySetInnerHTML:{__html:Bie}}),i.map((e,t)=>(0,Er.jsx)("style",{dangerouslySetInnerHTML:{__html:e}},t))]}),(0,Er.jsxs)("body",{"data-resizable-iframe-connected":"data-resizable-iframe-connected",className:n,children:[(0,Er.jsx)("div",{dangerouslySetInnerHTML:{__html:e}}),(0,Er.jsx)("script",{type:"text/javascript",dangerouslySetInnerHTML:{__html:`(${Tie.toString()})();`}}),r.map(e=>(0,Er.jsx)("script",{src:e},e))]})]});s.open(),s.write("<!DOCTYPE html>"+(0,Ar.Ay)(c)),s.close()}return(0,T.useEffect)(()=>{function e(){h(!1)}function t(e){const t=a.current;if(!t||t.contentWindow!==e.source)return;let n=e.data||{};if("string"==typeof n)try{n=JSON.parse(n)}catch{}"resize"===n.action&&(c(n.width),d(n.height))}h();const n=a.current,i=n?.ownerDocument?.defaultView;return n?.addEventListener("load",e,!1),i?.addEventListener("message",t),()=>{n?.removeEventListener("load",e,!1),i?.removeEventListener("message",t)}},[]),(0,T.useEffect)(()=>{h()},[t,i,r]),(0,T.useEffect)(()=>{h(!0)},[e,n]),(0,Er.jsx)("iframe",{ref:(0,gt.A)([a,jie()]),title:t,tabIndex:s,className:"components-sandbox",sandbox:"allow-scripts allow-same-origin allow-presentation",onFocus:o,width:Math.ceil(l),height:Math.ceil(u)})}var Oie=function({allowSameOrigin:e=!1,...t}){return e?(0,Er.jsx)(Rie,{...t}):(0,Er.jsx)(Nie,{...t})};function Lie({attributes:e,setAttributes:t,clientId:n}){const i=function(){(0,Qt.A)("wp.blockEditor.useSetting",{since:"6.5",alternative:"wp.blockEditor.useSettings",note:"The new useSettings function can retrieve multiple settings at once, with better performance."});const[e]=tv("color.palette");return e}(),{fontColor:r,fontSize:o,alignment:s,fontFamily:a}=(0,zt.A)(e=>{const t=e(Gee).getFormSettings(),r=Jee(i,e(Gee).getClosestParentAttribute(n,"backgroundColor"),e(Gee).getClosestParentAttribute(n,"customBackgroundColor")),o=Jee(i,e(Gee).getClosestParentAttribute(n,"textColor"),e(Gee).getClosestParentAttribute(n,"customTextColor"));return{backgroundColor:r||t.backgroundColor,fontColor:o||t.fontColor,fontSize:t.fontSize,alignment:t.alignment,fontFamily:t.fontFamily}},[]),[l,c]=(0,T.useState)(e.content),u=(0,T.useCallback)((0,Kee.debounce)(e=>{c(e)},300),[]),d=(0,Er.jsx)(oC,{children:(0,Er.jsx)(sne.A,{children:(0,Er.jsxs)(mz.Ay,{title:$ee.U.I18n.t("formSettings"),initialOpen:!0,children:[(0,Er.jsx)(TF.A,{label:$ee.U.I18n.t("blockCustomHtmlContentLabel"),value:e.content,"data-automation-id":"settings_custom_html_content",rows:4,onChange:e=>{t({content:e}),u(e)}}),(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("blockCustomHtmlNl2br"),checked:e.nl2br,onChange:e=>t({nl2br:e})})]})})}),h=e.nl2br?["body { white-space: pre-line; }"]:[];h.push(` body {font-family: ${getComputedStyle(document.body).fontFamily};}`),r?h.push(` body {color: ${r};}`):h.push(` body {color: ${getComputedStyle(document.body).color};}`),o?h.push(` body {font-size: ${o}px }`):h.push(` body {font-size: ${getComputedStyle(document.body).fontSize};}`),s&&h.push(` body {text-align: ${s}}`),a&&h.push(` body {font-family: "${a}"}`);const p=`${l}_${h}`;return(0,Er.jsxs)(fne,{className:e.className,children:[d,(0,Er.jsx)("div",{className:"mailpoet-html-block-editor-content-wrapper",children:(0,Er.jsx)(Oie,{html:l,styles:h},p)})]})}Lie.propTypes={attributes:Uee().shape({content:Uee().string.isRequired,nl2br:Uee().bool.isRequired,className:Uee().string}).isRequired,setAttributes:Uee().func.isRequired,clientId:Uee().string.isRequired};const Mie={title:$ee.U.I18n.t("blockCustomHtml"),description:$ee.U.I18n.t("blockCustomHtmlDescription"),icon:Eie,category:"fields",attributes:{content:{type:"string",default:$ee.U.I18n.t("blockCustomHtmlDefault")},nl2br:{type:"boolean",default:!0}},supports:{html:!1,multiple:!0},edit:Lie,save:()=>null},Pie=(0,Er.jsx)(AC.t4,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 694 694",children:(0,Er.jsx)(AC.G,{children:(0,Er.jsx)(AC.wA,{d:"m 347,44.407738 c 25.64881,0 46.33333,21.800595 46.33333,47.96131 V 299.03869 h 195.26191 c 24.82143,0 45.50595,21.8006 45.50595,47.96131 0,27.03274 -20.68452,48.83333 -45.50595,48.83333 H 393.33333 v 205.79762 c 0,26.16072 -20.68452,47.96131 -46.33333,47.96131 -24.82143,0 -45.50595,-21.80059 -45.50595,-47.96131 V 395.83333 H 105.40476 c -24.821427,0 -45.50595,-21.80059 -45.50595,-48.83333 0,-26.16071 20.684523,-47.96131 45.50595,-47.96131 H 301.49405 V 92.369048 c 0,-26.160715 20.68452,-47.96131 45.50595,-47.96131 z",fillRule:"evenodd",clipRule:"evenodd"})})}),Die=[{value:"text",label:$ee.U.I18n.t("customFieldTypeText")},{value:"textarea",label:$ee.U.I18n.t("customFieldTypeTextarea")},{value:"radio",label:$ee.U.I18n.t("customFieldTypeRadio")},{value:"checkbox",label:$ee.U.I18n.t("customFieldTypeCheckbox")},{value:"select",label:$ee.U.I18n.t("customFieldTypeSelect")},{value:"date",label:$ee.U.I18n.t("customFieldTypeDate")}];function Fie({dateSettings:e,onSubmit:t}){const[n,i]=(0,T.useState)("text"),[r,o]=(0,T.useState)(null),[s,a]=(0,T.useState)({}),l=r&&!(0,Kee.isEmpty)(s)&&!1!==s.isValid,c=e.dateTypes[0].value,u=e.dateFormats[c][0];return(0,Er.jsxs)("div",{className:"mailpoet_custom_field_add_form","data-automation-id":"create_custom_field_form",children:[(0,Er.jsx)("hr",{}),(0,Er.jsx)(oE.A,{label:$ee.U.I18n.t("selectCustomFieldType"),options:Die,"data-automation-id":"create_custom_field_type_select",onChange:e=>{a({}),i(e)}}),(0,Er.jsx)(kS.A,{label:$ee.U.I18n.t("customFieldName"),onChange:o,"data-automation-id":"create_custom_field_name_input"}),(0,Er.jsx)("hr",{}),(()=>{switch(n){case"checkbox":return(0,Er.jsx)(Jne,{mandatory:!!s.mandatory&&s.mandatory,isChecked:!!s.isChecked&&s.isChecked,checkboxLabel:s.checkboxLabel?s.checkboxLabel:"",onChange:a});case"date":return(0,Er.jsx)(lne,{dateSettings:e,mandatory:!!s.mandatory&&s.mandatory,dateFormat:s.dateFormat?s.dateFormat:u,dateType:s.dateType?s.dateType:c,defaultToday:!!s.defaultToday&&s.defaultToday,onChange:a});case"radio":case"select":return(0,Er.jsx)(zne,{mandatory:!!s.mandatory&&s.mandatory,values:s.values?s.values:[{name:"",id:Math.random().toString()}],onChange:a});default:return(0,Er.jsx)(wne,{mandatory:!!s.mandatory&&s.mandatory,validate:s.validate?s.validate:"",fieldType:n,onChange:a})}})(),(0,Er.jsx)(fv.Ay,{variant:"secondary",disabled:!l,"data-automation-id":"create_custom_field_submit",onClick:()=>{const e={name:r,type:n,params:mne(n,s)};t(e)},children:$ee.U.I18n.t("blockCreateButton")})]})}function zie({clientId:e}){const{createCustomField:t}=(0,Vt.A)(Gee),n=(0,zt.A)(e=>e(Gee).getDateSettingsData(),[]),i=(0,zt.A)(e=>e(Gee).getIsCustomFieldCreating(),[]);return(0,Er.jsx)(jC,{icon:(0,Er.jsx)(hj,{icon:Pie,showColors:!0}),label:$ee.U.I18n.t("blockAddCustomFieldFormHeading"),className:"mailpoet_custom_field_add_placeholder",children:i?(0,Er.jsx)(TC.Ay,{}):(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)("p",{children:$ee.U.I18n.t("blockAddCustomFieldDescription")}),(0,Er.jsx)(Fie,{onSubmit:n=>{t(n,e)},dateSettings:n})]})})}Fie.propTypes={dateSettings:Uee().shape({dateTypes:Uee().arrayOf(Uee().shape({label:Uee().string,value:Uee().string})),dateFormats:Uee().objectOf(Uee().arrayOf(Uee().string)),months:Uee().arrayOf(Uee().string)}).isRequired,onSubmit:Uee().func.isRequired},zie.propTypes={clientId:Uee().string.isRequired};const Vie={title:$ee.U.I18n.t("blockAddCustomField"),description:$ee.U.I18n.t("blockAddCustomFieldDescription"),icon:Pie,category:"custom-fields",attributes:{},supports:{html:!1,multiple:!1},edit:zie,save:()=>null},Uie=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/columns","title":"Columns","category":"design","allowedBlocks":["core/column"],"description":"Display content in multiple columns, with blocks added to each column.","textdomain":"default","attributes":{"verticalAlignment":{"type":"string"},"isStackedOnMobile":{"type":"boolean","default":true},"templateLock":{"type":["string","boolean"],"enum":["all","insert","contentOnly",false]}},"supports":{"anchor":true,"align":["wide","full"],"html":false,"color":{"gradients":true,"link":true,"heading":true,"button":true,"__experimentalDefaultControls":{"background":true,"text":true}},"spacing":{"blockGap":{"__experimentalDefault":"2em","sides":["horizontal","vertical"]},"margin":["top","bottom"],"padding":true,"__experimentalDefaultControls":{"padding":true,"blockGap":true}},"layout":{"allowSwitching":false,"allowInheriting":false,"allowEditing":false,"default":{"type":"flex","flexWrap":"nowrap"}},"__experimentalBorder":{"color":true,"radius":true,"style":true,"width":true,"__experimentalDefaultControls":{"color":true,"radius":true,"style":true,"width":true}},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true}},"interactivity":{"clientNavigation":true},"shadow":true},"editorStyle":"wp-block-columns-editor","style":"wp-block-columns"}');var $ie=n(25962);function Hie(e){let t,{doc:n}=Hie;n||(n=document.implementation.createHTMLDocument(""),Hie.doc=n),n.body.innerHTML=e;for(const e of n.body.firstChild.classList)if(t=e.match(/^layout-column-(\d+)$/))return Number(t[1])-1}var Wie=[{attributes:{verticalAlignment:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>{if(!e.customTextColor&&!e.customBackgroundColor)return e;const t={color:{}};e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor);const{customTextColor:n,customBackgroundColor:i,...r}=e;return{...r,style:t,isStackedOnMobile:!0}},save({attributes:e}){const{verticalAlignment:t,backgroundColor:n,customBackgroundColor:i,textColor:r,customTextColor:o}=e,s=MB("background-color",n),a=MB("color",r),l=(0,mh.A)({"has-background":n||i,"has-text-color":r||o,[s]:s,[a]:a,[`are-vertically-aligned-${t}`]:t}),c={backgroundColor:s?void 0:i,color:a?void 0:o};return(0,Er.jsx)("div",{className:l||void 0,style:c,children:(0,Er.jsx)(Sq.Content,{})})}},{attributes:{columns:{type:"number",default:2}},isEligible:(e,t)=>!!t.some(e=>/layout-column-\d+/.test(e.originalContent))&&t.some(e=>void 0!==Hie(e.originalContent)),migrate(e,t){const n=t.reduce((e,t)=>{const{originalContent:n}=t;let i=Hie(n);return void 0===i&&(i=0),e[i]||(e[i]=[]),e[i].push(t),e},[]).map(e=>er("core/column",{},e)),{columns:i,...r}=e;return[{...r,isStackedOnMobile:!0},n]},save({attributes:e}){const{columns:t}=e;return(0,Er.jsx)("div",{className:`has-${t}-columns`,children:(0,Er.jsx)(Sq.Content,{})})}},{attributes:{columns:{type:"number",default:2}},migrate(e,t){const{columns:n,...i}=e;return[e={...i,isStackedOnMobile:!0},t]},save({attributes:e}){const{verticalAlignment:t,columns:n}=e,i=(0,mh.A)(`has-${n}-columns`,{[`are-vertically-aligned-${t}`]:t});return(0,Er.jsx)("div",{className:i,children:(0,Er.jsx)(Sq.Content,{})})}}],Gie=e=>{const t=parseFloat(e);return Number.isFinite(t)?parseFloat(t.toFixed(2)):void 0};function qie(e,t){const{width:n=100/t}=e.attributes;return Gie(n)}function Kie(e,t,n=e.length){const i=function(e,t=e.length){return e.reduce((e,n)=>e+qie(n,t),0)}(e,n);return Object.fromEntries(Object.entries(function(e,t=e.length){return e.reduce((e,n)=>{const i=qie(n,t);return Object.assign(e,{[n.clientId]:i})},{})}(e,n)).map(([e,n])=>[e,Gie(t*n/i)]))}function Yie(e,t){return e.map(e=>({...e,attributes:{...e.attributes,width:`${t[e.clientId]}%`}}))}function Jie(){return(0,dw.A)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}}}var Xie={name:"core/column"};function Zie({clientId:e,setAttributes:t,isStackedOnMobile:n}){const{count:i,canInsertColumnBlock:r,minCount:o}=(0,zt.A)(t=>{const{canInsertBlockType:n,canRemoveBlock:i,getBlockOrder:r}=t(Qy),o=r(e),s=o.reduce((e,t,n)=>(i(t)||e.push(n),e),[]);return{count:o.length,canInsertColumnBlock:n("core/column",e),minCount:Math.max(...s)+1}},[e]),{getBlocks:s}=(0,zt.A)(Qy),{replaceInnerBlocks:a}=(0,Vt.A)(Qy);const l=Jie();return(0,Er.jsxs)(Xw,{label:(0,ee.__)("Settings"),resetAll:()=>{t({isStackedOnMobile:!0})},dropdownMenuProps:l,children:[r&&(0,Er.jsxs)(Q_.A,{spacing:4,style:{gridColumn:"1 / -1"},children:[(0,Er.jsx)(gk.A,{__next40pxDefaultSize:!0,label:(0,ee.__)("Columns"),value:i,onChange:t=>function(t,n){let i=s(e);const r=function(e){return e.every(e=>{const t=e.attributes.width;return Number.isFinite(t?.endsWith?.("%")?parseFloat(t):t)})}(i),o=n>t;if(o&&r){const e=Gie(100/n),r=n-t;i=[...Yie(i,Kie(i,100-e*r)),...Array.from({length:r}).map(()=>er("core/column",{width:`${e}%`}))]}else o?i=[...i,...Array.from({length:n-t}).map(()=>er("core/column"))]:n<t&&(i=i.slice(0,-(t-n)),r)&&(i=Yie(i,Kie(i,100)));a(e,i)}(i,Math.max(o,t)),min:Math.max(1,o),max:Math.max(6,i)}),i>6&&(0,Er.jsx)(wS.A,{status:"warning",isDismissible:!1,children:(0,ee.__)("This column count exceeds the recommended amount and may cause visual breakage.")})]}),(0,Er.jsx)(aC,{label:(0,ee.__)("Stack on mobile"),isShownByDefault:!0,hasValue:()=>!0!==n,onDeselect:()=>t({isStackedOnMobile:!0}),children:(0,Er.jsx)(Zv.A,{label:(0,ee.__)("Stack on mobile"),checked:n,onChange:()=>t({isStackedOnMobile:!n})})})]})}function Qie({attributes:e,setAttributes:t,clientId:n}){const{isStackedOnMobile:i,verticalAlignment:r,templateLock:o}=e,s=(0,yt.A)(),{getBlockOrder:a}=(0,zt.A)(Qy),{updateBlockAttributes:l}=(0,Vt.A)(Qy),c=Cq(UG({className:(0,mh.A)({[`are-vertically-aligned-${r}`]:r,"is-not-stacked-on-mobile":!i})}),{defaultBlock:Xie,directInsert:!0,orientation:"horizontal",renderAppender:!1,templateLock:o});return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(Mv,{children:(0,Er.jsx)(j_,{onChange:function(e){const i=a(n);s.batch(()=>{t({verticalAlignment:e}),l(i,{verticalAlignment:e})})},value:r})}),(0,Er.jsx)(oC,{children:(0,Er.jsx)(Zie,{clientId:n,setAttributes:t,isStackedOnMobile:i})}),(0,Er.jsx)("div",{...c})]})}function ere({clientId:e,name:t,setAttributes:n}){const{blockType:i,defaultVariation:r,variations:o}=(0,zt.A)(e=>{const{getBlockVariations:n,getBlockType:i,getDefaultBlockVariation:r}=e(Zi);return{blockType:i(t),defaultVariation:r(t,"block"),variations:n(t,"block")}},[t]),{replaceInnerBlocks:s}=(0,Vt.A)(Qy),a=UG();return(0,Er.jsx)("div",{...a,children:(0,Er.jsx)(i0,{icon:i?.icon?.src,label:i?.title,variations:o,instructions:(0,ee.__)("Divide into columns. Select a layout:"),onSelect:(t=r)=>{t.attributes&&n(t.attributes),t.innerBlocks&&s(e,tr(t.innerBlocks),!0)},allowSkip:!0})})}var tre=[{name:"one-column-full",title:(0,ee.__)("100"),description:(0,ee.__)("One column"),icon:(0,Er.jsx)(AC.t4,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:(0,Er.jsx)(AC.wA,{d:"M0 10a2 2 0 0 1 2-2h44a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Z"})}),innerBlocks:[["core/column"]],scope:["block"]},{name:"two-columns-equal",title:(0,ee.__)("50 / 50"),description:(0,ee.__)("Two columns; equal split"),icon:(0,Er.jsx)(AC.t4,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:(0,Er.jsx)(AC.wA,{d:"M0 10a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm25 0a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H27a2 2 0 0 1-2-2V10Z"})}),isDefault:!0,innerBlocks:[["core/column"],["core/column"]],scope:["block"]},{name:"two-columns-one-third-two-thirds",title:(0,ee.__)("33 / 66"),description:(0,ee.__)("Two columns; one-third, two-thirds split"),icon:(0,Er.jsx)(AC.t4,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:(0,Er.jsx)(AC.wA,{d:"M0 10a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm17 0a2 2 0 0 1 2-2h27a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H19a2 2 0 0 1-2-2V10Z"})}),innerBlocks:[["core/column",{width:"33.33%"}],["core/column",{width:"66.66%"}]],scope:["block"]},{name:"two-columns-two-thirds-one-third",title:(0,ee.__)("66 / 33"),description:(0,ee.__)("Two columns; two-thirds, one-third split"),icon:(0,Er.jsx)(AC.t4,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:(0,Er.jsx)(AC.wA,{d:"M0 10a2 2 0 0 1 2-2h27a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm33 0a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H35a2 2 0 0 1-2-2V10Z"})}),innerBlocks:[["core/column",{width:"66.66%"}],["core/column",{width:"33.33%"}]],scope:["block"]},{name:"three-columns-equal",title:(0,ee.__)("33 / 33 / 33"),description:(0,ee.__)("Three columns; equal split"),icon:(0,Er.jsx)(AC.t4,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:(0,Er.jsx)(AC.wA,{d:"M0 10a2 2 0 0 1 2-2h10.531c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H2a2 2 0 0 1-2-2V10Zm16.5 0c0-1.105.864-2 1.969-2H29.53c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H18.47c-1.105 0-1.969-.895-1.969-2V10Zm17 0c0-1.105.864-2 1.969-2H46a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H35.469c-1.105 0-1.969-.895-1.969-2V10Z"})}),innerBlocks:[["core/column"],["core/column"],["core/column"]],scope:["block"]},{name:"three-columns-wider-center",title:(0,ee.__)("25 / 50 / 25"),description:(0,ee.__)("Three columns; wide center column"),icon:(0,Er.jsx)(AC.t4,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:(0,Er.jsx)(AC.wA,{d:"M0 10a2 2 0 0 1 2-2h7.531c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H2a2 2 0 0 1-2-2V10Zm13.5 0c0-1.105.864-2 1.969-2H32.53c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H15.47c-1.105 0-1.969-.895-1.969-2V10Zm23 0c0-1.105.864-2 1.969-2H46a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2h-7.531c-1.105 0-1.969-.895-1.969-2V10Z"})}),innerBlocks:[["core/column",{width:"25%"}],["core/column",{width:"50%"}],["core/column",{width:"25%"}]],scope:["block"]}],nre={from:[{type:"block",isMultiBlock:!0,blocks:["*"],__experimentalConvert:e=>{const t=+(100/e.length).toFixed(2);return er("core/columns",{},tr(e.map(({name:e,attributes:n,innerBlocks:i})=>["core/column",{width:`${t}%`},[[e,{...n},i]]])))},isMatch:({length:e},t)=>(1!==t.length||"core/columns"!==t[0].name)&&e&&e<=6},{type:"block",blocks:["core/media-text"],priority:1,transform:(e,t)=>{const{align:n,backgroundColor:i,textColor:r,style:o,mediaAlt:s,mediaId:a,mediaPosition:l,mediaSizeSlug:c,mediaType:u,mediaUrl:d,mediaWidth:h,verticalAlignment:p}=e;let f;f="image"!==u&&u?["core/video",{id:a,src:d}]:["core/image",{id:a,alt:s,url:d,sizeSlug:c,href:e.href,linkClass:e.linkClass,linkDestination:e.linkDestination,linkTarget:e.linkTarget,rel:e.rel}];const m=[["core/column",{width:`${h}%`},[f]],["core/column",{width:100-h+"%"},t]];return"right"===l&&m.reverse(),er("core/columns",{align:n,backgroundColor:i,textColor:r,style:o,verticalAlignment:p},tr(m))}}],ungroup:(e,t)=>t.flatMap(e=>e.innerBlocks)},ire=nre,{name:rre}=Uie,ore={icon:$ie.A,variations:tre,example:{viewportWidth:782,innerBlocks:[{name:"core/column",innerBlocks:[{name:"core/paragraph",attributes:{content:(0,ee.__)("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.")}},{name:"core/image",attributes:{url:"https://s.w.org/images/core/5.3/Windbuchencom.jpg"}},{name:"core/paragraph",attributes:{content:(0,ee.__)("Suspendisse commodo neque lacus, a dictum orci interdum et.")}}]},{name:"core/column",innerBlocks:[{name:"core/paragraph",attributes:{content:(0,ee.__)("Etiam et egestas lorem. Vivamus sagittis sit amet dolor quis lobortis. Integer sed fermentum arcu, id vulputate lacus. Etiam fermentum sem eu quam hendrerit.")}},{name:"core/paragraph",attributes:{content:(0,ee.__)("Nam risus massa, ullamcorper consectetur eros fermentum, porta aliquet ligula. Sed vel mauris nec enim.")}}]}]},deprecated:Wie,edit:e=>{const{clientId:t}=e,n=(0,zt.A)(e=>e(Qy).getBlocks(t).length>0,[t])?Qie:ere;return(0,Er.jsx)(n,{...e})},save:function({attributes:e}){const{isStackedOnMobile:t,verticalAlignment:n}=e,i=(0,mh.A)({[`are-vertically-aligned-${n}`]:n,"is-not-stacked-on-mobile":!t}),r=UG.save({className:i}),o=Cq.save(r);return(0,Er.jsx)("div",{...o})},transforms:ire};const sre="core/columns",are={name:sre,examples:null,deprecated:null,save:()=>null},lre={...Uie,...ore,...are,category:"design",supports:{...Uie.supports,anchor:!1}},cre=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/column","title":"Column","category":"design","parent":["core/columns"],"description":"A single column within a columns block.","textdomain":"default","attributes":{"verticalAlignment":{"type":"string"},"width":{"type":"string"},"templateLock":{"type":["string","boolean"],"enum":["all","insert","contentOnly",false]}},"supports":{"__experimentalOnEnter":true,"anchor":true,"reusable":false,"html":false,"color":{"gradients":true,"heading":true,"button":true,"link":true,"__experimentalDefaultControls":{"background":true,"text":true}},"shadow":true,"spacing":{"blockGap":true,"padding":true,"__experimentalDefaultControls":{"padding":true,"blockGap":true}},"__experimentalBorder":{"color":true,"radius":true,"style":true,"width":true,"__experimentalDefaultControls":{"color":true,"radius":true,"style":true,"width":true}},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true}},"layout":true,"interactivity":{"clientNavigation":true},"allowedBlocks":true}}');var ure=n(47163),dre=[{attributes:{verticalAlignment:{type:"string"},width:{type:"number",min:0,max:100}},isEligible:({width:e})=>isFinite(e),migrate:e=>({...e,width:`${e.width}%`}),save({attributes:e}){const{verticalAlignment:t,width:n}=e,i=(0,mh.A)({[`is-vertically-aligned-${t}`]:t}),r={flexBasis:n+"%"};return(0,Er.jsx)("div",{className:i,style:r,children:(0,Er.jsx)(Sq.Content,{})})}}],hre=dre;function pre({width:e,setAttributes:t}){const[n]=tv("spacing.units"),i=Z_({availableUnits:n||["%","px","em","rem","vw"]}),r=Jie();return(0,Er.jsx)(Xw,{label:(0,ee.__)("Settings"),resetAll:()=>{t({width:void 0})},dropdownMenuProps:r,children:(0,Er.jsx)(aC,{hasValue:()=>void 0!==e,label:(0,ee.__)("Width"),onDeselect:()=>t({width:void 0}),isShownByDefault:!0,children:(0,Er.jsx)(vx,{label:(0,ee.__)("Width"),__unstableInputWidth:"calc(50% - 8px)",__next40pxDefaultSize:!0,value:e||"",onChange:e=>{e=0>parseFloat(e)?"0":e,t({width:e})},units:i})})})}var{name:fre}=cre,mre={icon:ure.A,edit:function({attributes:{verticalAlignment:e,width:t,templateLock:n,allowedBlocks:i},setAttributes:r,clientId:o}){const s=(0,mh.A)("block-core-columns",{[`is-vertically-aligned-${e}`]:e}),{columnsIds:a,hasChildBlocks:l,rootClientId:c}=(0,zt.A)(e=>{const{getBlockOrder:t,getBlockRootClientId:n}=e(Qy),i=n(o);return{hasChildBlocks:t(o).length>0,rootClientId:i,columnsIds:t(i)}},[o]),{updateBlockAttributes:u}=(0,Vt.A)(Qy),d=Number.isFinite(t)?t+"%":t,h=UG({className:s,style:d?{flexBasis:d}:void 0}),p=a.length,f=a.indexOf(o)+1,m=(0,ee.sprintf)((0,ee.__)("%1$s (%2$d of %3$d)"),h["aria-label"],f,p),g=Cq({...h,"aria-label":m},{templateLock:n,allowedBlocks:i,renderAppender:l?void 0:Sq.ButtonBlockAppender});return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(Mv,{children:(0,Er.jsx)(j_,{onChange:e=>{r({verticalAlignment:e}),u(c,{verticalAlignment:null})},value:e,controls:["top","center","bottom","stretch"]})}),(0,Er.jsx)(oC,{children:(0,Er.jsx)(pre,{width:t,setAttributes:r})}),(0,Er.jsx)("div",{...g})]})},save:function({attributes:e}){const{verticalAlignment:t,width:n}=e,i=(0,mh.A)({[`is-vertically-aligned-${t}`]:t});let r;if(n&&/\d/.test(n)){let e=Number.isFinite(n)?n+"%":n;if(!Number.isFinite(n)&&n?.endsWith("%")){const t=1e12;e=Math.round(Number.parseFloat(n)*t)/t+"%"}r={flexBasis:e}}const o=UG.save({className:i,style:r}),s=Cq.save(o);return(0,Er.jsx)("div",{...s})},deprecated:hre};const gre="core/column",bre={name:gre,examples:null,deprecated:null,save:()=>null},yre={...cre,...mre,...bre,category:"design",supports:{...cre.supports,anchor:!1}},vre=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/heading","title":"Heading","category":"text","description":"Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.","keywords":["title","subtitle"],"textdomain":"default","attributes":{"content":{"type":"rich-text","source":"rich-text","selector":"h1,h2,h3,h4,h5,h6","role":"content"},"level":{"type":"number","default":2},"levelOptions":{"type":"array"},"placeholder":{"type":"string"}},"supports":{"align":["wide","full"],"anchor":true,"className":true,"splitting":true,"__experimentalBorder":{"color":true,"radius":true,"style":true,"width":true},"color":{"gradients":true,"link":true,"__experimentalDefaultControls":{"background":true,"text":true}},"spacing":{"margin":true,"padding":true,"__experimentalDefaultControls":{"margin":false,"padding":false}},"typography":{"fontSize":true,"lineHeight":true,"textAlign":true,"__experimentalFontFamily":true,"__experimentalFontStyle":true,"__experimentalFontWeight":true,"__experimentalLetterSpacing":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalWritingMode":true,"fitText":true,"__experimentalDefaultControls":{"fontSize":true}},"__unstablePasteTextInline":true,"__experimentalSlashInserter":true,"interactivity":{"clientNavigation":true}},"editorStyle":"wp-block-heading-editor","style":"wp-block-heading"}');var _re=n(53257);function xre(e){const{textAlign:t,...n}=e;return t?{...n,style:{...e.style,typography:{...e.style?.typography,textAlign:t}}}:e}var kre={className:!1,anchor:!0},wre={align:{type:"string"},content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:""},level:{type:"number",default:2},placeholder:{type:"string"}},Cre=e=>{if(!e.customTextColor)return e;const t={color:{text:e.customTextColor}},{customTextColor:n,...i}=e;return{...i,style:t}},Sre=["left","right","center"],Are=e=>{const{align:t,...n}=e;return Sre.includes(t)?{...n,textAlign:t}:e},Ire={supports:kre,attributes:{...wre,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>xre(Cre(Are(e))),save({attributes:e}){const{align:t,level:n,content:i,textColor:r,customTextColor:o}=e,s="h"+n,a=MB("color",r),l=(0,mh.A)({[a]:a});return(0,Er.jsx)(sB.Content,{className:l||void 0,tagName:s,style:{textAlign:t,color:a?void 0:o},value:i})}},Ere={attributes:{...wre,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>xre(Cre(Are(e))),save({attributes:e}){const{align:t,content:n,customTextColor:i,level:r,textColor:o}=e,s="h"+r,a=MB("color",o),l=(0,mh.A)({[a]:a,[`has-text-align-${t}`]:t});return(0,Er.jsx)(sB.Content,{className:l||void 0,tagName:s,style:{color:a?void 0:i},value:n})},supports:kre},jre={supports:kre,attributes:{...wre,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>xre(Cre(Are(e))),save({attributes:e}){const{align:t,content:n,customTextColor:i,level:r,textColor:o}=e,s="h"+r,a=MB("color",o),l=(0,mh.A)({[a]:a,"has-text-color":o||i,[`has-text-align-${t}`]:t});return(0,Er.jsx)(sB.Content,{className:l||void 0,tagName:s,style:{color:a?void 0:i},value:n})}},Tre={supports:{align:["wide","full"],anchor:!0,className:!1,color:{link:!0},fontSize:!0,lineHeight:!0,__experimentalSelector:{"core/heading/h1":"h1","core/heading/h2":"h2","core/heading/h3":"h3","core/heading/h4":"h4","core/heading/h5":"h5","core/heading/h6":"h6"},__unstablePasteTextInline:!0},attributes:wre,isEligible:({align:e})=>Sre.includes(e),migrate:e=>xre(Cre(Are(e))),save({attributes:e}){const{align:t,content:n,level:i}=e,r="h"+i,o=(0,mh.A)({[`has-text-align-${t}`]:t});return(0,Er.jsx)(r,{...UG.save({className:o}),children:(0,Er.jsx)(sB.Content,{value:n})})}},Bre={supports:{align:["wide","full"],anchor:!0,className:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0,textTransform:!0}},__experimentalSelector:"h1,h2,h3,h4,h5,h6",__unstablePasteTextInline:!0,__experimentalSlashInserter:!0},attributes:{textAlign:{type:"string"},content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:"",role:"content"},level:{type:"number",default:2},placeholder:{type:"string"}},save({attributes:e}){const{textAlign:t,content:n,level:i}=e,r="h"+i,o=(0,mh.A)({[`has-text-align-${t}`]:t});return(0,Er.jsx)(r,{...UG.save({className:o}),children:(0,Er.jsx)(sB.Content,{value:n})})},migrate:e=>xre(Cre(Are(e)))},Nre={supports:{align:["wide","full"],anchor:!0,className:!0,splitting:!0,__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalWritingMode:!0,fitText:!0,__experimentalDefaultControls:{fontSize:!0}},__unstablePasteTextInline:!0,__experimentalSlashInserter:!0,interactivity:{clientNavigation:!0}},attributes:{textAlign:{type:"string"},content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:"",role:"content"},level:{type:"number",default:2},levelOptions:{type:"array"},placeholder:{type:"string"}},save({attributes:e}){const{textAlign:t,content:n,level:i}=e,r="h"+i,o=(0,mh.A)({[`has-text-align-${t}`]:t});return(0,Er.jsx)(r,{...UG.save({className:o}),children:(0,Er.jsx)(sB.Content,{value:n})})},migrate:e=>xre(Cre(Are(e))),isEligible:e=>!!e.textAlign||!!e.className?.match(/\bhas-text-align-(left|center|right)\b/)},Rre=[Nre,Bre,Tre,jre,Ere,Ire],Ore={},Lre=(e,t)=>{const n=(e=>Wn((e=>{const t=document.createElement("div");return t.innerHTML=e,t.innerText})(e)).replace(/[^\p{L}\p{N}]+/gu,"-").toLowerCase().replace(/(^-+)|(-+$)/g,""))(t);if(""===n)return null;delete Ore[e];let i=n,r=0;for(;Object.values(Ore).includes(i);)r+=1,i=n+"-"+r;return i},Mre=(e,t)=>{Ore[e]=t};function Pre(e,t,n=null){if(!e)return;const i=bn(t);if(!i)return;const r={};if(_n(i,"anchor")&&e.anchor&&(r.anchor=e.anchor),_n(i,"ariaLabel")&&e.ariaLabel&&(r.ariaLabel=e.ariaLabel),e.metadata){const t=[];if(n&&t.push("id","bindings"),t.length>0){const i=Object.entries(e.metadata).reduce((e,[i,r])=>t.includes(i)?(e[i]="bindings"===i?n(r):r,e):e,{});Object.keys(i).length>0&&(r.metadata=i)}}return 0!==Object.keys(r).length?r:void 0}var Dre={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>e.map(e=>{const{content:t,anchor:n,style:i}=e,r=i?.typography?.textAlign;return er("core/heading",{...Pre(e,"core/heading",({content:e})=>({content:e})),content:t,anchor:n,...r&&{style:{typography:{textAlign:r}}}})})},{type:"raw",selector:"h1,h2,h3,h4,h5,h6",schema:({phrasingContentSchema:e,isPaste:t})=>{const n={children:e,attributes:t?[]:["style","id"]};return{h1:n,h2:n,h3:n,h4:n,h5:n,h6:n}},transform(e){const t=Bo("core/heading",e.outerHTML),{textAlign:n}=e.style||{};var i;return t.level=(i=e.nodeName,Number(i.substr(1))),"left"!==n&&"center"!==n&&"right"!==n||(t.style={...t.style,typography:{...t.style?.typography,textAlign:n}}),er("core/heading",t)}},...[1,2,3,4,5,6].map(e=>({type:"prefix",prefix:Array(e+1).join("#"),transform:t=>er("core/heading",{level:e,content:t})})),...[1,2,3,4,5,6].map(e=>({type:"enter",regExp:new RegExp(`^/(h|H)${e}$`),transform:()=>er("core/heading",{level:e})}))],to:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>e.map(e=>{const{content:t,style:n}=e,i=n?.typography?.textAlign;return er("core/paragraph",{...Pre(e,"core/paragraph",({content:e})=>({content:e})),content:t,...i&&{style:{typography:{textAlign:i}}}})})}]},Fre=Dre,zre=n(18830),Vre=n(28973),Ure=n(49500),$re=n(41819),Hre=n(9490),Wre=n(42593),Gre=[zre.A,Vre.A,Ure.A,$re.A,Hre.A,Wre.A],qre=[...[1,2,3,4,5,6].map(e=>({name:`h${e}`,title:(0,ee.sprintf)((0,ee.__)("Heading %d"),e),description:(0,ee.__)("Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content."),icon:Gre[e-1],attributes:{level:e},scope:["block","transform"],keywords:[`h${e}`],isActive:t=>t.level===e}))],Kre=qre,{lock:Yre,unlock:Jre}=(0,pt.yf)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/block-library"),{fieldsKey:Xre,formKey:Zre}=Jre(ia),{name:Qre}=vre,eoe={icon:_re.A,example:{attributes:{content:(0,ee.__)("Code is Poetry"),level:2,style:{typography:{textAlign:"center"}}}},__experimentalLabel(e,{context:t}){const{content:n,level:i}=e,r=e?.metadata?.name,o=n?.trim().length>0;return"list-view"===t&&(r||o)?r||n:"breadcrumb"===t&&r?r:"accessibility"===t?o?(0,ee.sprintf)((0,ee.__)("Level %1$s. %2$s"),i,n):(0,ee.sprintf)((0,ee.__)("Level %s. Empty."),i):void 0},transforms:Fre,deprecated:Rre,merge:(e,t)=>({content:(e.content||"")+(t.content||"")}),edit:function(e){const{attributes:t,setAttributes:n,mergeBlocks:i,onReplace:r,style:o,clientId:s}=e;!function(e){const{name:t,attributes:n,setAttributes:i}=e,{textAlign:r}=n,{__unstableMarkNextChangeAsNotPersistent:o}=(0,Vt.A)(Qy),s=(0,RC.A)(()=>{(0,Qt.A)(`textAlign attribute in ${t}`,{alternative:"style.typography.textAlign",since:"7.0"}),o(),i(e=>({style:{...e.style,typography:{...e.style?.typography,textAlign:r}}}))}),a=(0,T.useRef)();(0,T.useEffect)(()=>{r!==a.current&&(a.current=r,s())},[r,s])}(e);const{content:a,level:l,placeholder:c,anchor:u}=t,d="h"+l,h=UG({style:o}),{canGenerateAnchors:p}=(0,zt.A)(e=>{const{getGlobalBlockCount:t,getSettings:n}=e(Qy);return{canGenerateAnchors:!!n().generateAnchors||t("core/table-of-contents")>0}},[]),{__unstableMarkNextChangeAsNotPersistent:f}=(0,Vt.A)(Qy);return(0,T.useEffect)(()=>{if(p)return!u&&a&&(f(),n({anchor:Lre(s,a)})),Mre(s,u),()=>Mre(s,null)},[u,a,s,p]),(0,Er.jsx)(Er.Fragment,{children:(0,Er.jsx)(sB,{identifier:"content",tagName:d,value:a,onChange:e=>{const t={content:e};!p||u&&e&&Lre(s,a)!==u||(t.anchor=Lre(s,e)),n(t)},onMerge:i,onReplace:r,onRemove:()=>r([]),placeholder:c||(0,ee.__)("Heading"),...Uo.A.isNative&&{deleteEnter:!0},...h})})},save:function({attributes:e}){const{content:t,level:n}=e,i="h"+n;return(0,Er.jsx)(i,{...UG.save(),children:(0,Er.jsx)(sB.Content,{value:t})})},variations:Kre};window.__experimentalContentOnlyInspectorFields&&(eoe[Xre]=[{id:"content",label:(0,ee.__)("Content"),type:"text",Edit:"rich-text"}],eoe[Zre]={fields:["content"]});const toe="core/heading",noe={name:toe,examples:null,deprecated:null,save:()=>null},ioe={...vre,...eoe,...noe,category:"design",supports:{...vre.supports,html:!1}},roe=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/paragraph","title":"Paragraph","category":"text","description":"Start with the basic building block of all narrative.","keywords":["text"],"textdomain":"default","attributes":{"content":{"type":"rich-text","source":"rich-text","selector":"p","role":"content"},"dropCap":{"type":"boolean","default":false},"placeholder":{"type":"string"},"direction":{"type":"string","enum":["ltr","rtl"]}},"supports":{"align":["wide","full"],"splitting":true,"anchor":true,"className":false,"__experimentalBorder":{"color":true,"radius":true,"style":true,"width":true},"color":{"gradients":true,"link":true,"__experimentalDefaultControls":{"background":true,"text":true}},"spacing":{"margin":true,"padding":true,"__experimentalDefaultControls":{"margin":false,"padding":false}},"typography":{"fontSize":true,"lineHeight":true,"textAlign":true,"textColumns":true,"textIndent":true,"__experimentalFontFamily":true,"__experimentalTextDecoration":true,"__experimentalFontStyle":true,"__experimentalFontWeight":true,"__experimentalLetterSpacing":true,"__experimentalTextTransform":true,"__experimentalWritingMode":true,"fitText":true,"__experimentalDefaultControls":{"fontSize":true}},"__experimentalSelector":"p","__unstablePasteTextInline":true,"interactivity":{"clientNavigation":true}},"selectors":{"root":"p","typography":{"textIndent":".wp-block-paragraph + .wp-block-paragraph"}},"editorStyle":"wp-block-paragraph-editor","style":"wp-block-paragraph"}');var ooe=n(88453),soe={className:!1},aoe={align:{type:"string"},content:{type:"string",source:"html",selector:"p",default:""},dropCap:{type:"boolean",default:!1},placeholder:{type:"string"},textColor:{type:"string"},backgroundColor:{type:"string"},fontSize:{type:"string"},direction:{type:"string",enum:["ltr","rtl"]},style:{type:"object"}},loe=e=>{if(!e.customTextColor&&!e.customBackgroundColor&&!e.customFontSize)return e;const t={};(e.customTextColor||e.customBackgroundColor)&&(t.color={}),e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor),e.customFontSize&&(t.typography={fontSize:e.customFontSize});const{customTextColor:n,customBackgroundColor:i,customFontSize:r,...o}=e;return{...o,style:t}},coe=e=>{const{align:t,...n}=e;return t?{...n,style:{...e.style,typography:{...e.style?.typography,textAlign:t}}}:e},{style:uoe,...doe}=aoe,hoe=[{supports:{className:!1,typography:{fontSize:!0}},attributes:aoe,isEligible:e=>!!e.align||!!e.className?.match(/\bhas-text-align-(left|center|right)\b/),save({attributes:e}){const{align:t,content:n,dropCap:i,direction:r}=e,o=(0,mh.A)({"has-drop-cap":t!==((0,ee.isRTL)()?"left":"right")&&"center"!==t&&i,[`has-text-align-${t}`]:t});return(0,Er.jsx)("p",{...UG.save({className:o,dir:r}),children:(0,Er.jsx)(sB.Content,{value:n})})},migrate:coe},{supports:soe,attributes:{...doe,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},migrate:coe,save({attributes:e}){const{align:t,content:n,dropCap:i,direction:r}=e,o=(0,mh.A)({"has-drop-cap":t!==((0,ee.isRTL)()?"left":"right")&&"center"!==t&&i,[`has-text-align-${t}`]:t});return(0,Er.jsx)("p",{...UG.save({className:o,dir:r}),children:(0,Er.jsx)(sB.Content,{value:n})})}},{supports:soe,attributes:{...doe,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},migrate:e=>loe(coe(e)),save({attributes:e}){const{align:t,content:n,dropCap:i,backgroundColor:r,textColor:o,customBackgroundColor:s,customTextColor:a,fontSize:l,customFontSize:c,direction:u}=e,d=MB("color",o),h=MB("background-color",r),p=aM(l),f=(0,mh.A)({"has-text-color":o||a,"has-background":r||s,"has-drop-cap":i,[`has-text-align-${t}`]:t,[p]:p,[d]:d,[h]:h}),m={backgroundColor:h?void 0:s,color:d?void 0:a,fontSize:p?void 0:c};return(0,Er.jsx)(sB.Content,{tagName:"p",style:m,className:f||void 0,value:n,dir:u})}},{supports:soe,attributes:{...doe,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},migrate:e=>loe(coe(e)),save({attributes:e}){const{align:t,content:n,dropCap:i,backgroundColor:r,textColor:o,customBackgroundColor:s,customTextColor:a,fontSize:l,customFontSize:c,direction:u}=e,d=MB("color",o),h=MB("background-color",r),p=aM(l),f=(0,mh.A)({"has-text-color":o||a,"has-background":r||s,"has-drop-cap":i,[p]:p,[d]:d,[h]:h}),m={backgroundColor:h?void 0:s,color:d?void 0:a,fontSize:p?void 0:c,textAlign:t};return(0,Er.jsx)(sB.Content,{tagName:"p",style:m,className:f||void 0,value:n,dir:u})}},{supports:soe,attributes:{...doe,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"},width:{type:"string"}},migrate:e=>loe(coe(e)),save({attributes:e}){const{width:t,align:n,content:i,dropCap:r,backgroundColor:o,textColor:s,customBackgroundColor:a,customTextColor:l,fontSize:c,customFontSize:u}=e,d=MB("color",s),h=MB("background-color",o),p=c&&`is-${c}-text`,f=(0,mh.A)({[`align${t}`]:t,"has-background":o||a,"has-drop-cap":r,[p]:p,[d]:d,[h]:h}),m={backgroundColor:h?void 0:a,color:d?void 0:l,fontSize:p?void 0:u,textAlign:n};return(0,Er.jsx)(sB.Content,{tagName:"p",style:m,className:f||void 0,value:i})}},{supports:soe,attributes:{...doe,fontSize:{type:"number"}},save({attributes:e}){const{width:t,align:n,content:i,dropCap:r,backgroundColor:o,textColor:s,fontSize:a}=e,l=(0,mh.A)({[`align${t}`]:t,"has-background":o,"has-drop-cap":r}),c={backgroundColor:o,color:s,fontSize:a,textAlign:n};return(0,Er.jsx)("p",{style:c,className:l||void 0,children:i})},migrate:e=>loe(coe({...e,customFontSize:Number.isFinite(e.fontSize)?e.fontSize:void 0,customTextColor:e.textColor&&"#"===e.textColor[0]?e.textColor:void 0,customBackgroundColor:e.backgroundColor&&"#"===e.backgroundColor[0]?e.backgroundColor:void 0}))},{supports:soe,attributes:{...aoe,content:{type:"string",source:"html",default:""}},save:({attributes:e})=>(0,Er.jsx)(Sr.A,{children:e.content}),migrate:e=>e}],poe=hoe,foe=n(41417);function moe(e){const{batch:t}=(0,yt.A)(),{moveBlocksToPosition:n,replaceInnerBlocks:i,duplicateBlocks:r,insertBlock:o}=(0,Vt.A)(Qy),{getBlockRootClientId:s,getBlockIndex:a,getBlockOrder:l,getBlockName:c,getBlock:u,getNextBlockClientId:d,canInsertBlockType:h}=(0,zt.A)(Qy),p=(0,T.useRef)(e);return p.current=e,(0,bt.A)(e=>{function f(e){if(e.defaultPrevented)return;if(e.keyCode!==Rt.Fm)return;const{content:f,clientId:m}=p.current;if(f.length)return;const g=s(m);if(!_n(c(g),"__experimentalOnEnter",!1))return;const b=l(g),y=b.indexOf(m);if(y===b.length-1){let t=g;for(;!h(c(m),s(t));)t=s(t);return void("string"==typeof t&&(e.preventDefault(),n([m],g,s(t),a(t)+1)))}const v=gn(),_=c(g),x=s(g);if(!h(v,x)||!h(_,x))return;e.preventDefault();const k=u(g);t(()=>{r([g]);const e=a(g);i(g,k.innerBlocks.slice(0,y)),i(d(g),k.innerBlocks.slice(y+1)),o(er(v),e+1,x,!0)})}return e.addEventListener("keydown",f),()=>{e.removeEventListener("keydown",f)}},[])}function goe({direction:e,setDirection:t}){return(0,ee.isRTL)()&&(0,Er.jsx)(vv,{icon:foe.A,title:(0,ee._x)("Left to right","editor button"),isActive:"ltr"===e,onClick:()=>{t("ltr"===e?void 0:"ltr")}})}function boe(e){return e===((0,ee.isRTL)()?"left":"right")||"center"===e}function yoe({clientId:e,attributes:t,setAttributes:n,name:i}){const[r]=tv("typography.dropCap");if(!r)return null;const{style:o,dropCap:s}=t,a=o?.typography?.textAlign;let l;l=boe(a)?(0,ee.__)("Not available for aligned text."):s?(0,ee.__)("Showing large initial letter."):(0,ee.__)("Show a large initial letter.");const c=vn(i,"typography.defaultControls.dropCap",!1);return(0,Er.jsx)(oC,{group:"typography",children:(0,Er.jsx)(aC,{hasValue:()=>!!s,label:(0,ee.__)("Drop cap"),isShownByDefault:c,onDeselect:()=>n({dropCap:!1}),resetAllFilter:()=>({dropCap:!1}),panelId:e,children:(0,Er.jsx)(Zv.A,{label:(0,ee.__)("Drop cap"),checked:!!s,onChange:()=>n({dropCap:!s}),help:l,disabled:boe(a)})})})}var{name:voe}=roe,_oe={from:[{type:"raw",priority:20,selector:"p",schema:({phrasingContentSchema:e,isPaste:t})=>({p:{children:e,attributes:t?[]:["style","id"]}}),transform(e){const t=Bo(voe,e.outerHTML),{textAlign:n}=e.style||{};return"left"!==n&&"center"!==n&&"right"!==n||(t.style={...t.style,typography:{...t.style?.typography,textAlign:n}}),er(voe,t)}}]},xoe=_oe,{fieldsKey:koe,formKey:woe}=Jre(ia),{name:Coe}=roe,Soe={icon:ooe.A,example:{attributes:{content:(0,ee.__)("In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.")}},__experimentalLabel(e,{context:t}){const n=e?.metadata?.name;if(("list-view"===t||"breadcrumb"===t)&&n)return n;if("accessibility"===t){if(n)return n;const{content:t}=e;return t&&0!==t.length?t:(0,ee.__)("Empty")}},transforms:xoe,deprecated:poe,merge:(e,t)=>({content:(e.content||"")+(t.content||"")}),edit:function({attributes:e,mergeBlocks:t,onReplace:n,onRemove:i,setAttributes:r,clientId:o,isSelected:s,name:a}){const{content:l,direction:c,dropCap:u,placeholder:d,style:h}=e,p=h?.typography?.textAlign;!function(e,t,n){const{__unstableMarkNextChangeAsNotPersistent:i}=(0,Vt.A)(Qy),r=(0,RC.A)(()=>{(0,Qt.A)("align attribute in paragraph block",{alternative:"style.typography.textAlign",since:"7.0"}),i(),n({style:{...t,typography:{...t?.typography,textAlign:e}}})}),o=(0,T.useRef)();(0,T.useEffect)(()=>{"full"!==e&&"wide"!==e&&e!==o.current&&(o.current=e,r())},[e,r])}(e.align,h,r);const f=UG({ref:moe({clientId:o,content:l}),className:(0,mh.A)({"has-drop-cap":!boe(p)&&u}),style:{direction:c}}),m=Vk();return(0,Er.jsxs)(Er.Fragment,{children:["default"===m&&(0,Er.jsx)(Mv,{group:"block",children:(0,Er.jsx)(goe,{direction:c,setDirection:e=>r({direction:e})})}),s&&(0,Er.jsx)(yoe,{name:a,clientId:o,attributes:e,setAttributes:r}),(0,Er.jsx)(sB,{identifier:"content",tagName:"p",...f,value:l,onChange:e=>r({content:e}),onMerge:t,onReplace:n,onRemove:i,"aria-label":sB.isEmpty(l)?(0,ee.__)("Empty block; start writing or type forward slash to choose a block"):(0,ee.__)("Block: Paragraph"),"data-empty":sB.isEmpty(l),placeholder:d||(0,ee.__)("Type / to choose a block"),"data-custom-placeholder":!!d||void 0,__unstableEmbedURLOnPaste:!0,__unstableAllowPrefixTransformations:!0})]})},save:function({attributes:e}){const{content:t,dropCap:n,direction:i,style:r}=e,o=r?.typography?.textAlign,s=(0,mh.A)({"has-drop-cap":o!==((0,ee.isRTL)()?"left":"right")&&"center"!==o&&n});return(0,Er.jsx)("p",{...UG.save({className:s,dir:i}),children:(0,Er.jsx)(sB.Content,{value:t})})}};window.__experimentalContentOnlyInspectorFields&&(Soe[koe]=[{id:"content",label:(0,ee.__)("Content"),type:"text",Edit:"rich-text"}],Soe[woe]={fields:["content"]});const Aoe="core/paragraph",Ioe={name:Aoe,examples:null,deprecated:null,save:()=>null},Eoe={...roe,...Soe,...Ioe,category:"design",supports:{...roe.supports,html:!1,anchor:!1}},joe=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/image","title":"Image","category":"media","usesContext":["allowResize","imageCrop","fixedHeight","navigationButtonType","postId","postType","queryId","galleryId"],"description":"Insert an image to make a visual statement.","keywords":["img","photo","picture"],"textdomain":"default","attributes":{"blob":{"type":"string","role":"local"},"url":{"type":"string","source":"attribute","selector":"img","attribute":"src","role":"content"},"alt":{"type":"string","source":"attribute","selector":"img","attribute":"alt","default":"","role":"content"},"caption":{"type":"rich-text","source":"rich-text","selector":"figcaption","role":"content"},"lightbox":{"type":"object","enabled":{"type":"boolean"}},"title":{"type":"string","source":"attribute","selector":"img","attribute":"title","role":"content"},"href":{"type":"string","source":"attribute","selector":"figure > a","attribute":"href","role":"content"},"rel":{"type":"string","source":"attribute","selector":"figure > a","attribute":"rel"},"linkClass":{"type":"string","source":"attribute","selector":"figure > a","attribute":"class"},"id":{"type":"number","role":"content"},"width":{"type":"string"},"height":{"type":"string"},"aspectRatio":{"type":"string"},"scale":{"type":"string"},"focalPoint":{"type":"object"},"sizeSlug":{"type":"string"},"linkDestination":{"type":"string"},"linkTarget":{"type":"string","source":"attribute","selector":"figure > a","attribute":"target"}},"supports":{"interactivity":true,"align":["left","center","right","wide","full"],"anchor":true,"color":{"text":false,"background":false},"filter":{"duotone":true},"spacing":{"margin":true},"__experimentalBorder":{"color":true,"radius":true,"width":true,"__experimentalSkipSerialization":true,"__experimentalDefaultControls":{"color":true,"radius":true,"width":true}},"shadow":{"__experimentalSkipSerialization":true}},"selectors":{"border":".wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder","shadow":".wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder","filter":{"duotone":".wp-block-image img, .wp-block-image .components-placeholder"}},"styles":[{"name":"default","label":"Default","isDefault":true},{"name":"rounded","label":"Rounded"}],"editorStyle":"wp-block-image-editor","style":"wp-block-image"}');var Toe={attributes:{url:{type:"string",source:"attribute",selector:"img",attribute:"src"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},caption:{type:"array",source:"children",selector:"figcaption"},href:{type:"string",source:"attribute",selector:"a",attribute:"href"},id:{type:"number"},align:{type:"string"},width:{type:"number"},height:{type:"number"}},save({attributes:e}){const{url:t,alt:n,caption:i,align:r,href:o,width:s,height:a}=e,l=s||a?{width:s,height:a}:{},c=(0,Er.jsx)("img",{src:t,alt:n,...l});let u={};return s?u={width:s}:"left"!==r&&"right"!==r||(u={maxWidth:"50%"}),(0,Er.jsxs)("figure",{className:r?`align${r}`:null,style:u,children:[o?(0,Er.jsx)("a",{href:o,children:c}):c,!sB.isEmpty(i)&&(0,Er.jsx)(sB.Content,{tagName:"figcaption",value:i})]})}},Boe={attributes:{url:{type:"string",source:"attribute",selector:"img",attribute:"src"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},caption:{type:"array",source:"children",selector:"figcaption"},href:{type:"string",source:"attribute",selector:"a",attribute:"href"},id:{type:"number"},align:{type:"string"},width:{type:"number"},height:{type:"number"}},save({attributes:e}){const{url:t,alt:n,caption:i,align:r,href:o,width:s,height:a,id:l}=e,c=(0,Er.jsx)("img",{src:t,alt:n,className:l?`wp-image-${l}`:null,width:s,height:a});return(0,Er.jsxs)("figure",{className:r?`align${r}`:null,children:[o?(0,Er.jsx)("a",{href:o,children:c}):c,!sB.isEmpty(i)&&(0,Er.jsx)(sB.Content,{tagName:"figcaption",value:i})]})}},Noe={attributes:{url:{type:"string",source:"attribute",selector:"img",attribute:"src"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},caption:{type:"array",source:"children",selector:"figcaption"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href"},id:{type:"number"},align:{type:"string"},width:{type:"number"},height:{type:"number"},linkDestination:{type:"string",default:"none"}},save({attributes:e}){const{url:t,alt:n,caption:i,align:r,href:o,width:s,height:a,id:l}=e,c=(0,mh.A)({[`align${r}`]:r,"is-resized":s||a}),u=(0,Er.jsx)("img",{src:t,alt:n,className:l?`wp-image-${l}`:null,width:s,height:a});return(0,Er.jsxs)("figure",{className:c,children:[o?(0,Er.jsx)("a",{href:o,children:u}):u,!sB.isEmpty(i)&&(0,Er.jsx)(sB.Content,{tagName:"figcaption",value:i})]})}},Roe={attributes:{align:{type:"string"},url:{type:"string",source:"attribute",selector:"img",attribute:"src"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},caption:{type:"string",source:"html",selector:"figcaption"},title:{type:"string",source:"attribute",selector:"img",attribute:"title"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number"},width:{type:"number"},height:{type:"number"},sizeSlug:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},supports:{anchor:!0},save({attributes:e}){const{url:t,alt:n,caption:i,align:r,href:o,rel:s,linkClass:a,width:l,height:c,id:u,linkTarget:d,sizeSlug:h,title:p}=e,f=s||void 0,m=(0,mh.A)({[`align${r}`]:r,[`size-${h}`]:h,"is-resized":l||c}),g=(0,Er.jsx)("img",{src:t,alt:n,className:u?`wp-image-${u}`:null,width:l,height:c,title:p}),b=(0,Er.jsxs)(Er.Fragment,{children:[o?(0,Er.jsx)("a",{className:a,href:o,target:d,rel:f,children:g}):g,!sB.isEmpty(i)&&(0,Er.jsx)(sB.Content,{tagName:"figcaption",value:i})]});return"left"===r||"right"===r||"center"===r?(0,Er.jsx)("div",{...UG.save(),children:(0,Er.jsx)("figure",{className:m,children:b})}):(0,Er.jsx)("figure",{...UG.save({className:m}),children:b})}},Ooe={attributes:{align:{type:"string"},url:{type:"string",source:"attribute",selector:"img",attribute:"src"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},caption:{type:"string",source:"html",selector:"figcaption"},title:{type:"string",source:"attribute",selector:"img",attribute:"title"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number"},width:{type:"number"},height:{type:"number"},sizeSlug:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},supports:{anchor:!0,color:{__experimentalDuotone:"img",text:!1,background:!1},__experimentalBorder:{radius:!0,__experimentalDefaultControls:{radius:!0}},__experimentalStyle:{spacing:{margin:"0 0 1em 0"}}},save({attributes:e}){const{url:t,alt:n,caption:i,align:r,href:o,rel:s,linkClass:a,width:l,height:c,id:u,linkTarget:d,sizeSlug:h,title:p}=e,f=s||void 0,m=(0,mh.A)({[`align${r}`]:r,[`size-${h}`]:h,"is-resized":l||c}),g=(0,Er.jsx)("img",{src:t,alt:n,className:u?`wp-image-${u}`:null,width:l,height:c,title:p}),b=(0,Er.jsxs)(Er.Fragment,{children:[o?(0,Er.jsx)("a",{className:a,href:o,target:d,rel:f,children:g}):g,!sB.isEmpty(i)&&(0,Er.jsx)(sB.Content,{tagName:"figcaption",value:i})]});return(0,Er.jsx)("figure",{...UG.save({className:m}),children:b})}},Loe={attributes:{align:{type:"string"},url:{type:"string",source:"attribute",selector:"img",attribute:"src",role:"content"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:"",role:"content"},caption:{type:"string",source:"html",selector:"figcaption",role:"content"},title:{type:"string",source:"attribute",selector:"img",attribute:"title",role:"content"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href",role:"content"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number",role:"content"},width:{type:"number"},height:{type:"number"},aspectRatio:{type:"string"},scale:{type:"string"},sizeSlug:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},supports:{anchor:!0,color:{text:!1,background:!1},filter:{duotone:!0},__experimentalBorder:{color:!0,radius:!0,width:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,width:!0}}},migrate(e){const{height:t,width:n}=e;return{...e,width:"number"==typeof n?`${n}px`:n,height:"number"==typeof t?`${t}px`:t}},save({attributes:e}){const{url:t,alt:n,caption:i,align:r,href:o,rel:s,linkClass:a,width:l,height:c,aspectRatio:u,scale:d,id:h,linkTarget:p,sizeSlug:f,title:m}=e,g=s||void 0,b=XQ(e),y=(0,mh.A)({[`align${r}`]:r,[`size-${f}`]:f,"is-resized":l||c,"has-custom-border":!!b.className||b.style&&Object.keys(b.style).length>0}),v=(0,mh.A)(b.className,{[`wp-image-${h}`]:!!h}),_=(0,Er.jsx)("img",{src:t,alt:n,className:v||void 0,style:{...b.style,aspectRatio:u,objectFit:d},width:l,height:c,title:m}),x=(0,Er.jsxs)(Er.Fragment,{children:[o?(0,Er.jsx)("a",{className:a,href:o,target:p,rel:g,children:_}):_,!sB.isEmpty(i)&&(0,Er.jsx)(sB.Content,{className:A4("caption"),tagName:"figcaption",value:i})]});return(0,Er.jsx)("figure",{...UG.save({className:y}),children:x})}},Moe={attributes:{align:{type:"string"},url:{type:"string",source:"attribute",selector:"img",attribute:"src",role:"content"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:"",role:"content"},caption:{type:"string",source:"html",selector:"figcaption",role:"content"},title:{type:"string",source:"attribute",selector:"img",attribute:"title",role:"content"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href",role:"content"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number",role:"content"},width:{type:"number"},height:{type:"number"},aspectRatio:{type:"string"},scale:{type:"string"},sizeSlug:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},supports:{anchor:!0,color:{text:!1,background:!1},filter:{duotone:!0},__experimentalBorder:{color:!0,radius:!0,width:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,width:!0}}},migrate:({width:e,height:t,...n})=>({...n,width:`${e}px`,height:`${t}px`}),save({attributes:e}){const{url:t,alt:n,caption:i,align:r,href:o,rel:s,linkClass:a,width:l,height:c,aspectRatio:u,scale:d,id:h,linkTarget:p,sizeSlug:f,title:m}=e,g=s||void 0,b=XQ(e),y=(0,mh.A)({[`align${r}`]:r,[`size-${f}`]:f,"is-resized":l||c,"has-custom-border":!!b.className||b.style&&Object.keys(b.style).length>0}),v=(0,mh.A)(b.className,{[`wp-image-${h}`]:!!h}),_=(0,Er.jsx)("img",{src:t,alt:n,className:v||void 0,style:{...b.style,aspectRatio:u,objectFit:d,width:l,height:c},width:l,height:c,title:m}),x=(0,Er.jsxs)(Er.Fragment,{children:[o?(0,Er.jsx)("a",{className:a,href:o,target:p,rel:g,children:_}):_,!sB.isEmpty(i)&&(0,Er.jsx)(sB.Content,{className:A4("caption"),tagName:"figcaption",value:i})]});return(0,Er.jsx)("figure",{...UG.save({className:y}),children:x})}},Poe={attributes:{align:{type:"string"},behaviors:{type:"object"},url:{type:"string",source:"attribute",selector:"img",attribute:"src",role:"content"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:"",role:"content"},caption:{type:"string",source:"html",selector:"figcaption",role:"content"},title:{type:"string",source:"attribute",selector:"img",attribute:"title",role:"content"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href",role:"content"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number",role:"content"},width:{type:"string"},height:{type:"string"},aspectRatio:{type:"string"},scale:{type:"string"},sizeSlug:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},supports:{anchor:!0,color:{text:!1,background:!1},filter:{duotone:!0},__experimentalBorder:{color:!0,radius:!0,width:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,width:!0}}},migrate({width:e,height:t,...n}){if(!n.behaviors?.lightbox)return n;const{behaviors:{lightbox:{enabled:i}}}=n,r={...n,lightbox:{enabled:i}};return delete r.behaviors,r},isEligible:e=>!!e.behaviors,save({attributes:e}){const{url:t,alt:n,caption:i,align:r,href:o,rel:s,linkClass:a,width:l,height:c,aspectRatio:u,scale:d,id:h,linkTarget:p,sizeSlug:f,title:m}=e,g=s||void 0,b=XQ(e),y=(0,mh.A)({[`align${r}`]:r,[`size-${f}`]:f,"is-resized":l||c,"has-custom-border":!!b.className||b.style&&Object.keys(b.style).length>0}),v=(0,mh.A)(b.className,{[`wp-image-${h}`]:!!h}),_=(0,Er.jsx)("img",{src:t,alt:n,className:v||void 0,style:{...b.style,aspectRatio:u,objectFit:d,width:l,height:c},title:m}),x=(0,Er.jsxs)(Er.Fragment,{children:[o?(0,Er.jsx)("a",{className:a,href:o,target:p,rel:g,children:_}):_,!sB.isEmpty(i)&&(0,Er.jsx)(sB.Content,{className:A4("caption"),tagName:"figcaption",value:i})]});return(0,Er.jsx)("figure",{...UG.save({className:y}),children:x})}},Doe=[Poe,Moe,Loe,Ooe,Roe,Noe,Boe,Toe],Foe=n(72071),zoe=n(31259),Voe=n(22333),Uoe=[{ratio:"2.33",className:"wp-embed-aspect-21-9"},{ratio:"2.00",className:"wp-embed-aspect-18-9"},{ratio:"1.78",className:"wp-embed-aspect-16-9"},{ratio:"1.33",className:"wp-embed-aspect-4-3"},{ratio:"1.00",className:"wp-embed-aspect-1-1"},{ratio:"0.56",className:"wp-embed-aspect-9-16"},{ratio:"0.50",className:"wp-embed-aspect-1-2"}],$oe="wp-embed",{UU:Hoe}={UU:"core/embed"},{kebabCase:Woe}=Jre(Ev.j),Goe=e=>e&&e.includes('class="wp-embedded-content"'),qoe=e=>{if(!e)return e;const t=Uoe.reduce((e,{className:t})=>(e.push(t),e),["wp-has-aspect-ratio"]);let n=e;for(const e of t)n=n.replace(e,"");return n.trim()};(0,xo.A)((e,t,n,i,r=!0)=>{if(!e)return{};const o={};let{type:s="rich"}=e;const{html:a,provider_name:l}=e,c=Woe((l||t).toLowerCase());return Goe(a)&&(s=$oe),(a||"photo"===s)&&(o.type=s,o.providerNameSlug=c),(u=n)&&Uoe.some(({className:e})=>u.includes(e))||(o.className=function(e,t,n=!0){if(!n)return qoe(t);if(function(e){return/padding-(top|bottom)\s*:\s*[\d.]+%/i.test(e)}(e))return qoe(t);const i=document.implementation.createHTMLDocument("");i.body.innerHTML=e;const r=i.body.querySelector("iframe");if(r&&r.height&&r.width){const e=(r.width/r.height).toFixed(2);for(let n=0;n<Uoe.length;n++){const i=Uoe[n];if(e>=i.ratio)return e-i.ratio>.1?qoe(t):(0,mh.A)(qoe(t),i.className,"wp-has-aspect-ratio")}}return t}(a,n,i&&r)),o;var u});var Koe=n(97465);function Yoe({attributeKey:e="caption",attributes:t,setAttributes:n,isSelected:i,insertBlocksAfter:r,placeholder:o=(0,ee.__)("Add caption"),label:s=(0,ee.__)("Caption text"),showToolbarButton:a=!0,excludeElementClassName:l,className:c,readOnly:u,tagName:d="figcaption",addLabel:h=(0,ee.__)("Add caption"),removeLabel:p=(0,ee.__)("Remove caption"),icon:f=Koe.A,...m}){const g=t[e],b=(0,qt.A)(g),y=sB.isEmpty(g),v=sB.isEmpty(b),[_,x]=(0,T.useState)(!y);(0,T.useEffect)(()=>{!y&&v&&x(!0)},[y,v]),(0,T.useEffect)(()=>{!i&&y&&x(!1)},[i,y]);const k=(0,T.useCallback)(e=>{e&&y&&e.focus()},[y]);return(0,Er.jsxs)(Er.Fragment,{children:[a&&(0,Er.jsx)(Mv,{group:"block",children:(0,Er.jsx)(vv,{onClick:()=>{x(!_),_&&g&&n({[e]:void 0})},icon:f,isPressed:_,label:_?p:h})}),_&&(!sB.isEmpty(g)||i)&&(0,Er.jsx)(sB,{identifier:e,tagName:d,className:(0,mh.A)(c,l?"":A4("caption")),ref:k,"aria-label":s,placeholder:o,value:g,onChange:t=>n({[e]:t}),inlineToolbar:!0,__unstableOnSplitAtEnd:()=>r(er(gn())),readOnly:u,...m})]})}function Joe({url:e,filename:t,itemGroupProps:n,className:i,label:r}){return(0,Er.jsx)(YY.A,{...n,as:"span",children:(0,Er.jsxs)(Cw.A,{justify:"flex-start",children:[(0,Er.jsx)("span",{className:"block-library-utils__media-control__inspector-image-indicator",style:{backgroundImage:e?`url(${e})`:void 0}}),(0,Er.jsx)(_C.A,{children:(0,Er.jsx)(xC.A,{numberOfLines:1,className:i,children:t??r})})]})})}function Xoe({mediaId:e,mediaUrl:t,filename:n,allowedTypes:i,onSelect:r,onSelectURL:o,onError:s,onReset:a,isUploading:l=!1,emptyLabel:c=(0,ee.__)("Media")}){const{getSettings:u}=(0,zt.A)(Qy),d=(0,T.useRef)();return(0,Er.jsxs)("div",{ref:d,className:"block-library-utils__media-control",children:[(0,Er.jsx)(oI,{className:"block-library-utils__media-control__replace-flow",mediaId:e,mediaURL:t,allowedTypes:i,onSelect:r,onSelectURL:o,onError:s,name:(0,Er.jsx)(Joe,{url:t,filename:n,className:"block-library-utils__media-control__inspector-media-replace-title",label:t&&(0,dS.e)(n)||c}),renderToggle:e=>(0,Er.jsx)(fv.Ay,{...e,__next40pxDefaultSize:!0,children:l?(0,Er.jsx)(TC.Ay,{}):e.children}),onReset:a}),t&&a&&(0,Er.jsx)(fv.Ay,{label:(0,ee.__)("Reset"),className:"block-library-utils__media-control__reset",size:"small",icon:uS.A,onClick:()=>{a(),(e=>{window.requestAnimationFrame(()=>{const[t]=hS.XC.tabbable.find(e?.current);t&&t.focus()})})(d)}}),(0,Er.jsx)(LC,{onFilesDrop:e=>{const{mediaUpload:t}=u();t&&t({allowedTypes:i,filesList:e,onFileChange([e]){r(e)},onError:s,multiple:!1})}})]})}var Zoe="none",Qoe="media",ese="attachment",tse="custom",nse=["image"],ise=["flex","grid"],rse="full";function ose(e){return nse.some(t=>0===e.type.indexOf(t))}function sse({x:e,y:t}={x:.5,y:.5}){return`${Math.round(100*e)}% ${Math.round(100*t)}%`}var{DimensionsTool:ase,ResolutionTool:lse,mediaEditKey:cse}=Jre(b5),use=[{value:"cover",label:(0,ee._x)("Cover","Scale option for dimensions control"),help:(0,ee.__)("Image covers the space evenly.")},{value:"contain",label:(0,ee._x)("Contain","Scale option for dimensions control"),help:(0,ee.__)("Image is contained without distortion.")}],dse={placement:"bottom-start"},hse=({href:e,children:t})=>e?(0,Er.jsx)("a",{href:e,onClick:e=>e.preventDefault(),"aria-disabled":!0,style:{pointerEvents:"none",cursor:"default",display:"inline"},children:t}):t;function pse({attributes:e,setAttributes:t,lockAltControls:n,lockAltControlsMessage:i,lockTitleControls:r,lockTitleControlsMessage:o}){const[s,a]=(0,T.useState)(null),[l,c]=(0,T.useState)(!1),[u,d]=(0,T.useState)(!1);return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(mv.A,{ref:a,children:e=>(0,Er.jsx)(xv.A,{icon:wT.A,label:(0,ee.__)("More"),toggleProps:{...e,description:(0,ee.__)("Displays more controls.")},popoverProps:dse,children:({onClose:e})=>(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(zv.A,{onClick:()=>{c(!0),e()},"aria-haspopup":"dialog",children:(0,ee._x)("Alternative text","Alternative text for an image. Block toolbar label, a low character count is preferred.")}),(0,Er.jsx)(zv.A,{onClick:()=>{d(!0),e()},"aria-haspopup":"dialog",children:(0,ee.__)("Title text")})]})})}),l&&(0,Er.jsx)(uw.Ay,{placement:"bottom-start",anchor:s,onClose:()=>c(!1),offset:13,variant:"toolbar",children:(0,Er.jsx)("div",{className:"wp-block-image__toolbar_content_textarea__container",children:(0,Er.jsx)(TF.A,{className:"wp-block-image__toolbar_content_textarea",label:(0,ee.__)("Alternative text"),value:e.alt||"",onChange:e=>t({alt:e}),disabled:n,help:n?(0,Er.jsx)(Er.Fragment,{children:i}):(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(OA.A,{href:(0,ee.__)("https://www.w3.org/WAI/tutorials/images/decision-tree/"),children:(0,ee.__)("Describe the purpose of the image.")}),(0,Er.jsx)("br",{}),(0,ee.__)("Leave empty if decorative.")]})})})}),u&&(0,Er.jsx)(uw.Ay,{placement:"bottom-start",anchor:s,onClose:()=>d(!1),offset:13,variant:"toolbar",children:(0,Er.jsx)("div",{className:"wp-block-image__toolbar_content_textarea__container",children:(0,Er.jsx)(kS.A,{__next40pxDefaultSize:!0,className:"wp-block-image__toolbar_content_textarea",label:(0,ee.__)("Title attribute"),value:e.title||"",onChange:e=>t({title:e}),disabled:r,help:r?(0,Er.jsx)(Er.Fragment,{children:o}):(0,qS.A)((0,ee.__)("Describe the role of this image on the page. <a>(Note: many devices and browsers do not display this text.)</a>"),{a:(0,Er.jsx)(OA.A,{href:"https://www.w3.org/TR/html52/dom.html#the-title-attribute"})})})})})]})}function fse({temporaryURL:e,isSideloading:t,attributes:n,setAttributes:i,isSingleSelected:r,insertBlocksAfter:o,onReplace:s,onSelectImage:a,onSelectURL:l,onUploadError:c,context:u,clientId:d,blockEditingMode:h,parentLayoutType:p,maxContentWidth:f}){const{url:m="",alt:g,align:b,id:y,href:v,rel:_,linkClass:x,linkDestination:k,title:w,width:C,height:S,aspectRatio:A,scale:I,focalPoint:E,linkTarget:j,sizeSlug:B,lightbox:N,metadata:R}=n,[O,L]=(0,T.useState)(),[M,P]=(0,T.useState)(null),[D,F]=(0,T.useState)({}),[z,V]=(0,T.useState)(0),U=(0,SC.A)(([e])=>{if(!M){const[t]=e.borderBoxSize;F({width:t.inlineSize,height:t.blockSize})}V(e.target.offsetTop)}),$=(0,T.useCallback)(()=>{V(O?.offsetTop??0)},[O]),H=(0,gt.A)([L,U]),{allowResize:W=!0}=u,{image:G,canUserEdit:q,attachmentResolutionError:K}=(0,zt.A)(e=>{const t=y&&r?e(Bee).getEntityRecord("postType","attachment",y,{context:"view"}):null,n=y&&r?e(Bee).getResolutionError("getEntityRecord",["postType","attachment",y,{context:"view"}]):null;let i=!1;return t&&window?.__experimentalMediaEditor&&(i=!!e(Bee).canUser("update",{kind:"postType",name:"attachment",id:y})),{image:t,canUserEdit:i,attachmentResolutionError:n}},[y,r]);(0,T.useEffect)(()=>{y&&r&&404===K?.status&&i({id:void 0})},[y,r,K,i]);const{canInsertCover:Y,imageEditing:J,imageSizes:X,maxWidth:Z,editMediaEntity:Q}=(0,zt.A)(e=>{const{getBlockRootClientId:t,canInsertBlockType:n,getSettings:i}=e(Qy),r=t(d),o=i();return{imageEditing:o.imageEditing,imageSizes:o.imageSizes,maxWidth:o.maxWidth,editMediaEntity:o?.[cse],canInsertCover:n("core/cover",r)}},[d]),{getBlock:te,getSettings:ne}=(0,zt.A)(Qy),ie=ne().onNavigateToEntityRecord,{replaceBlocks:re,toggleSelection:oe}=(0,Vt.A)(Qy),{createErrorNotice:se,createSuccessNotice:ae}=(0,Vt.A)(Rb.store),{editEntityRecord:le}=(0,Vt.A)(Bee),ce=(0,dw.A)("medium"),ue=["wide","full"].includes(b),[{loadedNaturalWidth:de,loadedNaturalHeight:he},pe]=(0,T.useState)({}),[fe,me]=(0,T.useState)(!1),[ge,be]=(0,T.useState)(),[ye,ve]=(0,T.useState)(!1),_e="default"===h,xe="contentOnly"===h,ke=W&&_e,we=W&&_e&&!ue&&ce,Ce=!!e||t,Se=X.filter(({slug:e})=>G?.media_details?.sizes?.[e]?.source_url).map(({name:e,slug:t})=>({value:t,label:e}));(0,T.useEffect)(()=>{mse(y,m)&&r&&ne().mediaUpload?ge||window.fetch(m.includes("?")?m:m+"?").then(e=>e.blob()).then(e=>be(e)).catch(()=>{}):be()},[y,m,r,ge,ne]);const{naturalWidth:Ae,naturalHeight:Ie}=(0,T.useMemo)(()=>({naturalWidth:O?.naturalWidth||de||void 0,naturalHeight:O?.naturalHeight||he||void 0}),[de,he,O?.complete]),Ee=e=>{O&&O.style.setProperty("object-position",sse(e))};function je(e){const t=G?.media_details?.sizes?.[e]?.source_url;if(!t)return null;i({url:t,sizeSlug:e})}(0,T.useEffect)(()=>{r||me(!1)},[r]);const Te=y&&Ae&&Ie&&J&&!!Q,Be=r&&Te&&!fe&&!xe,Ne=Z_({availableUnits:["px"]}),[Re]=tv("lightbox"),Oe=!!N&&N?.enabled!==Re?.enabled||Re?.allowEditing,Le=!!N?.enabled||!N&&!!Re?.enabled,Me=Jie(),Pe=ke&&(ise.includes(p)?(0,Er.jsx)(ase,{panelId:d,value:{aspectRatio:A},onChange:({aspectRatio:e})=>{i({aspectRatio:e,scale:"cover"})},defaultAspectRatio:"auto",tools:["aspectRatio"]}):(0,Er.jsx)(ase,{panelId:d,value:{width:C,height:S,scale:I,aspectRatio:A},onChange:({width:e,height:t,scale:n,aspectRatio:r})=>{i({width:!e&&t?"auto":e,height:t,scale:n,aspectRatio:r})},defaultScale:"cover",defaultAspectRatio:"auto",scaleOptions:use,unitsOptions:Ne,tools:ue?["aspectRatio","scale"]:["aspectRatio","widthHeight","scale"]})),De="core/pattern-overrides"===R?.bindings?.__default?.source,{lockUrlControls:Fe=!1,lockHrefControls:ze=!1,lockAltControls:Ve=!1,lockAltControlsMessage:Ue,lockTitleControls:$e=!1,lockTitleControlsMessage:He,hideCaptionControls:We=!1}=(0,zt.A)(e=>{if(!r)return{};const{url:t,alt:n,title:i,caption:o}=R?.bindings||{},s=!!u["pattern/overrides"],a=Cn(t?.source),l=Cn(n?.source),c=Cn(i?.source);return{lockUrlControls:!!t&&!a?.canUserEditValue?.({select:e,context:u,args:t?.args}),lockHrefControls:s||De,hideCaptionControls:!!o,lockAltControls:!!n&&!l?.canUserEditValue?.({select:e,context:u,args:n?.args}),lockAltControlsMessage:l?.label?(0,ee.sprintf)((0,ee.__)("Connected to %s"),l.label):(0,ee.__)("Connected to dynamic data"),lockTitleControls:!!i&&!c?.canUserEditValue?.({select:e,context:u,args:i?.args}),lockTitleControlsMessage:c?.label?(0,ee.sprintf)((0,ee.__)("Connected to %s"),c.label):(0,ee.__)("Connected to dynamic data")}},[De,u,r,R?.bindings]),Ge=r&&!fe&&!ze&&!Fe,qe=r&&Y&&!xe,Ke=Ge||Be||qe,Ye=r&&!fe&&!Fe&&(0,Er.jsx)(Mv,{group:xe?"inline":"other",children:(0,Er.jsx)(oI,{mediaId:y,mediaURL:m,allowedTypes:nse,onSelect:a,onSelectURL:l,onError:c,name:m?(0,ee.__)("Replace"):(0,ee.__)("Add image"),onReset:()=>a(void 0),variant:"toolbar"})}),Je=window?.__experimentalContentOnlyInspectorFields,Xe=window?.__experimentalMediaEditor&&y&&r&&q&&!!Q&&!mse(y,m)&&!fe&&ie&&(0,Er.jsx)(Mv,{group:"other",children:(0,Er.jsx)(vv,{onClick:()=>{ie({postId:y,postType:"attachment"})},children:(0,ee.__)("Edit media")})}),Ze=(0,Er.jsxs)(Er.Fragment,{children:[Ke&&(0,Er.jsxs)(Mv,{group:"block",children:[Ge&&(0,Er.jsx)(b1,{url:v||"",onChangeUrl:function(e){i(e)},linkDestination:k,mediaUrl:G&&G.source_url||m,mediaLink:G&&G.link,linkTarget:j,linkClass:x,rel:_,showLightboxSetting:Oe,lightboxEnabled:Le,onSetLightbox:function(e){i(e&&!Re?.enabled?{lightbox:{enabled:!0}}:!e&&Re?.enabled?{lightbox:{enabled:!1}}:{lightbox:void 0})},resetLightbox:function(){i(Re?.enabled&&Re?.allowEditing?{lightbox:{enabled:!1}}:{lightbox:void 0})}}),Be&&(0,Er.jsx)(vv,{onClick:()=>me(!0),icon:zoe.A,label:(0,ee.__)("Crop")}),qe&&(0,Er.jsx)(vv,{icon:Voe.A,label:(0,ee.__)("Add text over image"),onClick:function(){re(d,ur(te(d),"core/cover"))}})]}),r&&ge&&(0,Er.jsx)(Mv,{children:(0,Er.jsx)(wv,{children:(0,Er.jsx)(vv,{onClick:function(){const{mediaUpload:e}=ne();if(!e)return;let t=!1;e({filesList:[ge],onFileChange([e]){a(e),Fs(e.url)||t||(t=!0,be(),ae((0,ee.__)("Image uploaded."),{type:"snackbar"}))},allowedTypes:nse,onError(e){se(e,{type:"snackbar"})}})},icon:BC.A,label:(0,ee.__)("Upload to Media Library")})})}),xe&&(0,Er.jsx)(Mv,{group:"block",children:(0,Er.jsx)(pse,{attributes:n,setAttributes:i,lockAltControls:Ve,lockAltControlsMessage:Ue,lockTitleControls:$e,lockTitleControlsMessage:He})}),!Je&&r&&(0,Er.jsx)(oC,{group:"content",children:(0,Er.jsxs)(Xw,{label:(0,ee.__)("Media"),resetAll:()=>a(void 0),dropdownMenuProps:Me,children:[!Fe&&(0,Er.jsx)(aC,{label:(0,ee.__)("Image"),hasValue:()=>!!m,onDeselect:()=>a(void 0),isShownByDefault:!0,children:(0,Er.jsx)(Xoe,{mediaId:y,mediaUrl:m,alt:g,filename:G?.media_details?.sizes?.full?.file||G?.slug||(0,dS.e)(m),allowedTypes:nse,onSelect:a,onSelectURL:l,onError:c,onReset:()=>a(void 0),isUploading:Ce,emptyLabel:(0,ee.__)("Add image")})}),(0,Er.jsx)(aC,{label:(0,ee.__)("Alternative text"),isShownByDefault:!0,hasValue:()=>!!g,onDeselect:()=>i({alt:void 0}),children:(0,Er.jsx)(TF.A,{label:(0,ee.__)("Alternative text"),value:g||"",onChange:function(e){i({alt:e})},readOnly:Ve,help:Ve?(0,Er.jsx)(Er.Fragment,{children:Ue}):(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(OA.A,{href:(0,ee.__)("https://www.w3.org/WAI/tutorials/images/decision-tree/"),children:(0,ee.__)("Describe the purpose of the image.")}),(0,Er.jsx)("br",{}),(0,ee.__)("Leave empty if decorative.")]})})})]})}),(0,Er.jsxs)(oC,{group:"dimensions",resetAllFilter:e=>({...e,aspectRatio:void 0,width:void 0,height:void 0,scale:void 0,focalPoint:void 0}),children:[Pe,m&&I&&(0,Er.jsx)(aC,{label:(0,ee.__)("Focal point"),isShownByDefault:!0,hasValue:()=>!!E,onDeselect:()=>i({focalPoint:void 0}),panelId:d,children:(0,Er.jsx)(cS,{label:(0,ee.__)("Focal point"),url:m,value:E,onDragStart:Ee,onDrag:Ee,onChange:e=>i({focalPoint:e})})})]}),!!Se.length&&(0,Er.jsx)(oC,{children:(0,Er.jsx)(Xw,{label:(0,ee.__)("Settings"),resetAll:()=>{i({lightbox:void 0}),je(rse)},dropdownMenuProps:Me,children:(0,Er.jsx)(lse,{value:B,defaultValue:rse,onChange:je,options:Se})})}),(0,Er.jsx)(oC,{group:"advanced",children:(0,Er.jsx)(kS.A,{__next40pxDefaultSize:!0,label:(0,ee.__)("Title attribute"),value:w||"",onChange:function(e){i({title:e})},readOnly:$e,help:$e?(0,Er.jsx)(Er.Fragment,{children:He}):(0,qS.A)((0,ee.__)("Describe the role of this image on the page. <a>(Note: many devices and browsers do not display this text.)</a>"),{a:(0,Er.jsx)(OA.A,{href:"https://www.w3.org/TR/html52/dom.html#the-title-attribute"})})})})]}),Qe=(0,dS.e)(m);let et;et=g||(Qe?(0,ee.sprintf)((0,ee.__)("This image has an empty alt attribute; its file name is %s"),Qe):(0,ee.__)("This image has an empty alt attribute"));const tt=ZQ(n),nt=QQ(n),it=n.className?.includes("is-style-rounded"),{postType:rt,postId:ot,queryId:st}=u,at=Number.isFinite(st);let lt,ct=e&&ye?(0,Er.jsx)(jC,{className:"wp-block-image__placeholder",withIllustration:!0,children:(0,Er.jsx)(TC.Ay,{})}):(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)("img",{src:e||m,alt:et,onError:function(){ve(!0);const e=((e,t={})=>{const{preview:n,attributes:i={}}=e,{url:r,providerNameSlug:o,type:s,...a}=i;if(!r||!bn(Hoe))return;const l=(e=>wn(Hoe)?.find(({patterns:t})=>((e,t=[])=>t.some(t=>e.match(t)))(e,t)))(r),c="wordpress"===o||s===$oe;if(!c&&l&&(l.attributes.providerNameSlug!==o||!o))return er(Hoe,{url:r,...a,...l.attributes});const u=wn(Hoe)?.find(({name:e})=>"wordpress"===e);return u&&n&&Goe(n.html)&&!c?er(Hoe,{url:r,...u.attributes,...t}):void 0})({attributes:{url:m}});void 0!==e&&s(e)},onLoad:function(e){ve(!1),pe({loadedNaturalWidth:e.target?.naturalWidth,loadedNaturalHeight:e.target?.naturalHeight})},ref:H,className:tt.className,width:Ae,height:Ie,style:{aspectRatio:A,...M?{width:D.width+M.width,height:D.height+M.height}:{width:C,height:S},objectFit:I,objectPosition:E&&I?sse(E):void 0,...tt.style,...nt.style}}),Ce&&(0,Er.jsx)(TC.Ay,{})]});if(ct=Te&&fe?(0,Er.jsx)(hse,{href:v,children:(0,Er.jsx)(Z0,{id:y,url:m,...D,naturalHeight:Ie,naturalWidth:Ae,onSaveImage:e=>i(e),onFinishEditing:()=>{me(!1)},borderProps:it?void 0:tt})}):(0,Er.jsx)(hse,{href:v,children:ct}),we&&r&&!fe&&!Ce&&!ise.includes(p)){const e=A&&function(e){const[t,n=1]=e.split("/").map(Number),i=t/n;return i===1/0||0===i?NaN:i}(A),t=D.width/D.height,n=Ae/Ie,r=e||t||n||1,o=Ae<Ie?20:20*r,s=Ie<Ae?20:20/r,a=f||2.5*Z;let l=!1,c=!1;"center"===b?(l=!0,c=!0):(0,ee.isRTL)()?"left"===b?l=!0:c=!0:"right"===b?c=!0:l=!0,lt=(0,Er.jsx)(RX,{ref:$,style:{position:"absolute",inset:`${z}px 0 0 0`},size:D,minWidth:o,maxWidth:a,minHeight:s,maxHeight:a/r,lockAspectRatio:r,enable:{top:!1,right:l,bottom:!0,left:c},onResizeStart:()=>{oe(!1)},onResize:(e,t,n,i)=>{P(i)},onResizeStop:(e,t,o,s)=>{oe(!0),P(null),F(e=>({width:e.width+s.width,height:e.height+s.height})),f&&Ae>=f&&Math.abs(o.offsetWidth-f)<10?i({width:void 0,height:void 0}):i({width:`${o.offsetWidth}px`,height:"auto",aspectRatio:r===n?void 0:String(r)})},resizeRatio:"center"===b?2:1})}if(!m&&!e)return(0,Er.jsxs)(Er.Fragment,{children:[Ye,Ze]});const ut=()=>{le("postType",rt,ot,{featured_media:y}),ae((0,ee.__)("Post featured image updated."),{type:"snackbar"})},dt=!at&&ot&&y?(0,Er.jsx)(TQ,{children:({canEdit:e,selectedClientIds:t})=>e&&1===t.length&&d===t[0]&&(0,Er.jsx)(zv.A,{onClick:ut,children:(0,ee.__)("Set as featured image")})}):null;return(0,Er.jsxs)(Er.Fragment,{children:[Xe,Ye,Ze,dt,ct,lt,(0,Er.jsx)(Yoe,{attributes:n,setAttributes:i,isSelected:r,insertBlocksAfter:o,label:(0,ee.__)("Image caption text"),showToolbarButton:r&&(_e||xe)&&!We})]})}var mse=(e,t)=>t&&!e&&!Fs(t);function gse(e,t){return"url"in(e?.sizes?.[t]??{})||"source_url"in(e?.media_details?.sizes?.[t]??{})}function bse(e,t){const{body:n}=document.implementation.createHTMLDocument("");n.innerHTML=e;const{firstElementChild:i}=n;if(i&&"A"===i.nodeName)return i.getAttribute(t)||void 0}var yse={img:{attributes:["src","alt","title"],classes:["alignleft","aligncenter","alignright","alignnone",/^wp-image-\d+$/]}},vse={from:[{type:"raw",isMatch:e=>"FIGURE"===e.nodeName&&!!e.querySelector("img"),schema:({phrasingContentSchema:e})=>({figure:{require:["img"],children:{...yse,a:{attributes:["href","rel","target"],classes:["*"],children:yse},figcaption:{children:e}}}}),transform:e=>{const t=e.className+" "+e.querySelector("img").className,n=/(?:^|\s)align(left|center|right)(?:$|\s)/.exec(t),i=""===e.id?void 0:e.id,r=n?n[1]:void 0,o=/(?:^|\s)wp-image-(\d+)(?:$|\s)/.exec(t),s=o?Number(o[1]):void 0,a=e.querySelector("a"),l=a&&a.href?"custom":void 0,c=a&&a.href?a.href:void 0,u=a&&a.rel?a.rel:void 0,d=a&&a.className?a.className:void 0,h=Bo("core/image",e.outerHTML,{align:r,id:s,linkDestination:l,href:c,rel:u,linkClass:d,anchor:i});return Fs(h.url)&&(h.blob=h.url,delete h.url),er("core/image",h)}},{type:"files",isMatch:e=>e.every(e=>0===e.type.indexOf("image/")),transform(e){const t=e.map(e=>er("core/image",{blob:Ps(e)}));return t}},{type:"shortcode",tag:"caption",attributes:{url:{type:"string",source:"attribute",attribute:"src",selector:"img"},alt:{type:"string",source:"attribute",attribute:"alt",selector:"img"},caption:{shortcode:function(e,{shortcode:t}){const{body:n}=document.implementation.createHTMLDocument("");n.innerHTML=t.content;let i=n.querySelector("img");for(;i&&i.parentNode&&i.parentNode!==n;)i=i.parentNode;return i&&i.parentNode.removeChild(i),n.innerHTML.trim()}},href:{shortcode:(e,{shortcode:t})=>bse(t.content,"href")},rel:{shortcode:(e,{shortcode:t})=>bse(t.content,"rel")},linkClass:{shortcode:(e,{shortcode:t})=>bse(t.content,"class")},id:{type:"number",shortcode:({named:{id:e}})=>{if(e)return parseInt(e.replace("attachment_",""),10)}},align:{type:"string",shortcode:({named:{align:e="alignnone"}})=>e.replace("align","")}}}]},_se=vse,{fieldsKey:xse,formKey:kse}=Jre(ia),{name:wse}=joe,Cse={icon:cB.A,example:{attributes:{sizeSlug:"large",url:"https://s.w.org/images/core/5.3/MtBlanc1.jpg",caption:(0,ee.__)("Mont Blanc appears—still, snowy, and serene.")}},__experimentalLabel(e,{context:t}){const n=e?.metadata?.name;if(("list-view"===t||"breadcrumb"===t)&&n)return n;if("accessibility"===t){const{caption:t,alt:n,url:i}=e;return i?n?n+(t?". "+t:""):t||"":(0,ee.__)("Empty")}},getEditWrapperProps:e=>({"data-align":e.align}),transforms:_se,edit:function({attributes:e,setAttributes:t,isSelected:n,className:i,insertBlocksAfter:r,onReplace:o,context:s,clientId:a,__unstableParentLayout:l}){const{url:c="",caption:u,id:d,width:h,height:p,sizeSlug:f,aspectRatio:m,scale:g,align:b,metadata:y}=e,[v,_]=(0,T.useState)(e.blob),x=(0,T.useRef)(),k=l?.type||l?.default?.type,w=!k||"flex"!==k&&"grid"!==k,[C,S]=function(){const[e,{width:t}]=(0,SC.A)(),n=(0,T.useRef)();return[(0,Er.jsx)("div",{className:"wp-block","aria-hidden":"true",style:{position:"absolute",inset:0,width:"100%",height:0,margin:0},ref:n,children:e}),t]}(),[A,{width:I}]=(0,SC.A)(),E=I&&I<160,j=(0,T.useRef)();(0,T.useEffect)(()=>{j.current=u},[u]);const{__unstableMarkNextChangeAsNotPersistent:B,replaceBlock:N}=(0,Vt.A)(Qy);(0,T.useEffect)(()=>{["wide","full"].includes(b)&&(B(),t({width:void 0,height:void 0,aspectRatio:void 0,scale:void 0}))},[B,b,t]);const{getSettings:R,getBlockRootClientId:O,getBlockName:L,canInsertBlockType:M}=(0,zt.A)(Qy),P=Vk(),{createErrorNotice:D}=(0,Vt.A)(Rb.store);function F(e){D(e,{type:"snackbar"}),_(),t({src:void 0,id:void 0,url:void 0,blob:void 0})}function z(n){if(Array.isArray(n))return void function(e){const t=x.current?.ownerDocument.defaultView;if(e.every(e=>e instanceof t.File)){const t=e,n=O(a);t.some(e=>!ose(e))&&D((0,ee.__)("If uploading to a gallery all files need to be image formats"),{id:"gallery-upload-invalid-file",type:"snackbar"});const i=t.filter(e=>ose(e)).map(e=>er("core/image",{blob:Ps(e)}));if("core/gallery"===L(n))N(a,i);else if(M("core/gallery",n)){const e=er("core/gallery",{},i);N(a,e)}}}(n);if(!n||!n.url)return t({url:void 0,alt:void 0,id:void 0,title:void 0,caption:void 0,blob:void 0}),void _();if(Fs(n.url))return void _(n.url);const{imageDefaultSize:i}=R();let r=rse;f&&gse(n,f)?r=f:gse(n,i)&&(r=i);let o,s=((e,t)=>{const n=Object.fromEntries(Object.entries(e??{}).filter(([e])=>["alt","id","link","caption"].includes(e)));return n.url=e?.sizes?.[t]?.url||e?.media_details?.sizes?.[t]?.source_url||e.url,n})(n,r);if("string"==typeof s.caption&&s.caption.includes("\n")&&(s.caption=s.caption.replace(/\n/g,"<br>")),j.current&&!s.caption){const{caption:e,...t}=s;s=t}n.id&&n.id===d||(o={sizeSlug:r});let l,c=e.linkDestination;if(!c)switch(window?.wp?.media?.view?.settings?.defaultProps?.link||Zoe){case"file":case Qoe:c=Qoe;break;case"post":case ese:c=ese;break;case tse:c=tse;break;case Zoe:c=Zoe}switch(c){case Qoe:l=n.url;break;case ese:l=n.link}s.href=l,t({blob:void 0,...s,...o,linkDestination:c}),_()}function V(e){const n=(0,kA.J)(e)?e:(0,jS.i)(e);n!==c&&(t({blob:void 0,url:n,id:void 0,sizeSlug:R().imageDefaultSize}),_())}!function(e={}){const t=(0,T.useRef)(e),n=(0,T.useRef)(!1),{getSettings:i}=(0,zt.A)(Qy);(0,T.useLayoutEffect)(()=>{t.current=e}),(0,T.useEffect)(()=>{if(n.current)return;if(!t.current.url||!Fs(t.current.url))return;const e=function(e){return Ms[e]}(t.current.url);if(!e)return;const{url:r,allowedTypes:o,onChange:s,onError:a}=t.current,{mediaUpload:l}=i();l&&(n.current=!0,l({filesList:[e],allowedTypes:o,onFileChange:([e])=>{Fs(e?.url)||(Ds(r),s(e),n.current=!1)},onError:e=>{Ds(r),a(e),n.current=!1}}))},[i])}({url:v,allowedTypes:nse,onChange:z,onError:F});const U=mse(d,c)?c:void 0,$=(0,zt.A)(e=>!(!window.__clientSideMediaProcessing||!d)&&e(nU).isUploadingById(d),[d]),H=!!c&&(0,Er.jsx)("img",{alt:(0,ee.__)("Edit image"),title:(0,ee.__)("Edit image"),className:"edit-image-preview",src:c}),W=ZQ(e),G=QQ(e),q=(0,mh.A)(i,{"is-transient":!!v||$,"is-resized":!!h||!!p,[`size-${f}`]:f,"has-custom-border":!!W.className||W.style&&Object.keys(W.style).length>0}),K=UG({ref:x,className:q}),{lockUrlControls:Y=!1,lockUrlControlsMessage:J}=(0,zt.A)(e=>{if(!n)return{};const t=Cn(y?.bindings?.url?.source);return{lockUrlControls:!!y?.bindings?.url&&!t?.canUserEditValue?.({select:e,context:s,args:y?.bindings?.url?.args}),lockUrlControlsMessage:t?.label?(0,ee.sprintf)((0,ee.__)("Connected to %s"),t.label):(0,ee.__)("Connected to dynamic data")}},[s,n,y?.bindings?.url]);return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsxs)("figure",{...K,children:[(0,Er.jsx)(fse,{temporaryURL:v,isSideloading:$,attributes:e,setAttributes:t,isSingleSelected:n,insertBlocksAfter:r,onReplace:o,onSelectImage:z,onSelectURL:V,onUploadError:F,context:s,clientId:a,blockEditingMode:P,parentLayoutType:k,maxContentWidth:S}),(0,Er.jsx)(s1,{icon:(0,Er.jsx)(hj,{icon:cB.A}),onSelect:z,onSelectURL:V,onFilesPreUpload:function(e){1===e.length&&_(Ps(e[0]))},onError:F,placeholder:e=>(0,Er.jsxs)(jC,{className:(0,mh.A)("block-editor-media-placeholder",{[W.className]:!!W.className&&!n}),icon:!E&&(Y?Foe.A:cB.A),withIllustration:!n||E,label:!E&&(0,ee.__)("Image"),instructions:!Y&&!E&&(0,ee.__)("Drag and drop an image, upload, or choose from your library."),style:{aspectRatio:h&&p||!m?void 0:m,width:p&&m?"100%":h,height:h&&m?"100%":p,objectFit:g,...W.style,...G.style},children:[Y&&!E&&J,!Y&&!E&&e,A]}),allowedTypes:nse,handleUpload:e=>1===e.length,value:{id:d,src:U},mediaPreview:H,disableMediaButtons:v||c})]}),n&&w&&C]})},save:function({attributes:e}){const{url:t,alt:n,caption:i,align:r,href:o,rel:s,linkClass:a,width:l,height:c,aspectRatio:u,scale:d,focalPoint:h,id:p,linkTarget:f,sizeSlug:m,title:g,metadata:{bindings:b={}}={}}=e,y=s||void 0,v=XQ(e),_=QQ(e),x=(0,mh.A)({alignnone:"none"===r,[`size-${m}`]:m,"is-resized":l||c,"has-custom-border":!!v.className||v.style&&Object.keys(v.style).length>0}),k=(0,mh.A)(v.className,{[`wp-image-${p}`]:!!p}),w=(0,Er.jsx)("img",{src:t,alt:n,className:k||void 0,style:{...v.style,..._.style,aspectRatio:u,objectFit:d,objectPosition:h&&d?sse(h):void 0,width:l,height:c},title:g}),C=!sB.isEmpty(i)||b.caption||"core/pattern-overrides"===b?.__default?.source,S=(0,Er.jsxs)(Er.Fragment,{children:[o?(0,Er.jsx)("a",{className:a,href:o,target:f,rel:y,children:w}):w,C&&(0,Er.jsx)(sB.Content,{className:A4("caption"),tagName:"figcaption",value:i})]});return(0,Er.jsx)("figure",{...UG.save({className:x}),children:S})},deprecated:Doe};window.__experimentalContentOnlyInspectorFields&&(Cse[xse]=[{id:"image",label:(0,ee.__)("Image"),type:"media",Edit:{control:"media",allowedTypes:["image"],multiple:!1},getValue:({item:e})=>({id:e.id,url:e.url,alt:e.alt,caption:e.caption}),setValue:({value:e})=>({id:e.id,url:e.url,alt:e.alt,caption:e.caption})},{id:"link",label:(0,ee.__)("Link"),type:"url",Edit:"link",getValue:({item:e})=>({url:e.href,rel:e.rel,linkTarget:e.linkTarget}),setValue:({value:e})=>({href:e.url,rel:e.rel,linkTarget:e.linkTarget})},{id:"caption",label:(0,ee.__)("Caption"),type:"text",Edit:"rich-text"},{id:"alt",label:(0,ee.__)("Alt text"),type:"text"}],Cse[kse]={fields:["image","link","caption","alt"]});const Sse="core/image",Ase={name:Sse,examples:null,deprecated:null,save:()=>null},Ise={...joe,...Cse,...Ase,category:"design",supports:{...joe.supports,html:!1,anchor:!1}},Ese=e=>{const t=tie(e);if(!t[e.type])return null;const n=nne(t[e.type].name,e);return hn(n,t[e.type].settings),n},jse=e=>{let t=null;return Array.isArray(e.errors)&&e.errors.length>0&&(t=e.errors.map(e=>e.message),t=t.join(", ")),t},Tse=(e,t)=>e.map(e=>{const n=t(e);return e.innerBlocks?{...n,innerBlocks:Tse(e.innerBlocks,t)}:n}),Bse={async SAVE_FORM(){if((0,xe.L)(Gee).getIsFormSaving())return;if((0,nt.J)(Gee).saveFormStarted(),(0,xe.L)(Gee).getFormErrors().length)return;const e=(0,xe.L)(Gee).getFormData(),t=(0,xe.L)(Qy).getBlocks(),n=(0,xe.L)(Gee).getAllAvailableCustomFields(),i=Qee(qee,Th.colors,Th.gradients,n),r={...ete(e),body:i(t),editor_version:2};await $ee.U.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"forms",action:"saveEditor",data:r}).done(e=>{(0,nt.J)(Gee).saveFormDone(e.data.id),Zte.remove(`popup_form_dismissed_${e.data.id}`,{path:"/"})}).fail(e=>{(0,nt.J)(Gee).saveFormFailed(jse(e))})},async SAVE_CUSTOM_FIELD(e){(0,nt.J)(Gee).saveCustomFieldStarted();const t=(0,xe.L)(Gee).getAllAvailableCustomFields().find(t=>t.id===e.customFieldId),n={};(0,Kee.merge)(n,t,e.data),await $ee.U.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"customFields",action:"save",data:n}).then(n=>{(0,nt.J)(Gee).saveCustomFieldDone(t.id,n.data),"function"==typeof e.onFinish&&e.onFinish()}).then(()=>{(0,nt.J)(Gee).saveForm()}).fail(e=>{(0,nt.J)(Gee).saveCustomFieldFailed(jse(e))})},async CREATE_CUSTOM_FIELD(e){const{clientId:t,data:n}=e;(0,xe.L)(Gee).getIsCustomFieldCreating()||((0,nt.J)(Gee).createCustomFieldStarted(e.data),(0,xe.L)(Gee).getIsCustomFieldCreating()&&await $ee.U.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"customFields",action:"save",data:n}).then(e=>{const n=e.data;$ee.U.trackEvent("Forms > Add new custom field",{"Field type":n.type});const i=er(Ese(n));(0,nt.J)(Qy).replaceBlock(t,i),(0,nt.J)(Gee).createCustomFieldDone(e.data)}).fail(e=>{(0,nt.J)(Gee).createCustomFieldFailed(jse(e))}))},async DELETE_CUSTOM_FIELD(e){const{customFieldId:t,clientId:n}=e;(0,nt.J)(Gee).deleteCustomFieldStarted();const i=(0,xe.L)(Gee).getAllAvailableCustomFields().find(e=>e.id===t),r=tie(i);await $ee.U.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"customFields",action:"delete",data:{id:t}}).then(()=>{$ee.U.trackEvent("Forms > Delete custom field",{"Field type":i.type}),(0,nt.J)(Gee).deleteCustomFieldDone(t,n);const e=nne(r[i.type].name,i);bn(e)&&function(e){const t=(0,xe.L)(Zi).getBlockType(e);if(t)return(0,nt.J)(Zi).removeBlockTypes(e),t;(0,sn.A)('Block "'+e+'" is not registered.')}(e),(0,nt.J)(Qy).removeBlock(n)}).fail(e=>{(0,nt.J)(Gee).deleteCustomFieldFailed(jse(e))})},APPLY_STYLES_TO_ALL_TEXT_INPUTS(e){const t=(0,xe.L)(Gee).getFormBlocks(),n=Tse(t,t=>{const n={...t};return["mailpoet-form/last-name-input","mailpoet-form/first-name-input","mailpoet-form/email-input"].includes(t.name)||t.name.startsWith("mailpoet-form/custom-text")?{...n,attributes:{...n.attributes,styles:e.styles}}:n});(0,nt.J)(Qy).resetBlocks(n)},async TUTORIAL_DISMISS(){await $ee.U.Ajax.post({api_version:$ee.U.apiVersion,endpoint:"user_flags",action:"set",data:{form_editor_tutorial_seen:1}})},BLOCKS_CHANGED_IN_BLOCK_EDITOR(e){const t=e.blocks,n=zte(t,"mailpoet-form/email-input"),i=zte(t,"mailpoet-form/submit-button");if(n&&i)return void(0,nt.J)(Gee).changeFormBlocks(t);const r=(0,xe.L)(Gee).getFormBlocks(),o=[...t];if(!n){let e=zte(r,"mailpoet-form/email-input");e||(e=er("mailpoet-form/email-input")),o.unshift(e)}if(!i){let e=zte(r,"mailpoet-form/submit-button");e||(e=er("mailpoet-form/submit-button")),o.push(e)}(0,nt.J)(Qy).resetBlocks(o)},STORE_LOCALLY(e){const{key:t,value:n}=e;window.localStorage.setItem(t,JSON.stringify(n))},CALL_API:Qte.p,ENSURE_BROWSER_URL(e){const{formId:t}=e;let n=(0,xe.L)(Gee).getFormEditorUrl();n=`${n}${t}`,window.location.href!==n&&window.history.replaceState(null,"",n)}},Nse={width:{unit:"percent",value:100}},Rse={formDelay:15,formCookieExpiration:7},Ose={styles:{width:{unit:"pixel",value:560}},...Rse,animation:"slideup",triggerMode:"auto",clickTriggerSelector:""},Lse={styles:{width:{unit:"percent",value:100}},position:"top",...Rse,animation:"slideup"},Mse={width:{unit:"percent",value:100}},Pse={styles:{width:{unit:"pixel",value:560}},position:"right",...Rse,animation:"slideup"},Dse={formPadding:20,inputPadding:5,borderSize:0,borderRadius:0,alignment:"left",closeButton:"round_white"};function Fse(e){const t={...e,settings:{...e.settings,formPlacement:{popup:{enabled:"1"===e.settings.form_placement?.popup?.enabled,triggerMode:void 0!==e.settings.form_placement?.popup?.trigger_mode?e.settings.form_placement?.popup?.trigger_mode:Ose.triggerMode,clickTriggerSelector:void 0!==e.settings.form_placement?.popup?.click_trigger_selector?e.settings.form_placement?.popup?.click_trigger_selector:Ose.clickTriggerSelector,exitIntentEnabled:"1"===e.settings.form_placement?.popup?.exit_intent_enabled,delay:void 0!==e.settings.form_placement?.popup?.delay?Une(e.settings.form_placement?.popup?.delay):Ose.formDelay,cookieExpiration:void 0!==e.settings.form_placement?.popup?.cookieExpiration?Une(e.settings.form_placement?.popup?.cookieExpiration):Ose.formCookieExpiration,animation:void 0!==e.settings.form_placement?.popup?.animation?e.settings.form_placement?.popup?.animation:Ose.animation,styles:{...Ose.styles,...e.settings.form_placement?.popup?.styles},categories:e.settings.form_placement?.popup?.categories??[],tags:e.settings.form_placement?.popup?.tags??[],posts:{all:"1"===e.settings.form_placement?.popup?.posts?.all,selected:Array.isArray(e.settings.form_placement?.popup?.posts?.selected)?e.settings.form_placement?.popup?.posts?.selected:[]},pages:{all:"1"===e.settings.form_placement?.popup?.pages?.all,selected:Array.isArray(e.settings.form_placement?.popup?.pages?.selected)?e.settings.form_placement?.popup?.pages?.selected:[]},homepage:"1"===e.settings.form_placement?.popup?.homepage,tagArchives:{all:"1"===e.settings.form_placement?.popup?.tagArchives?.all,selected:Array.isArray(e.settings.form_placement?.popup?.tagArchives?.selected)?e.settings.form_placement?.popup?.tagArchives?.selected:[]},categoryArchives:{all:"1"===e.settings.form_placement?.popup?.categoryArchives?.all,selected:Array.isArray(e.settings.form_placement?.popup?.categoryArchives?.selected)?e.settings.form_placement?.popup?.categoryArchives?.selected:[]}},fixedBar:{enabled:"1"===e.settings.form_placement?.fixed_bar?.enabled,delay:void 0!==e.settings.form_placement?.fixed_bar?.delay?Une(e.settings.form_placement?.fixed_bar?.delay):Lse.formDelay,cookieExpiration:void 0!==e.settings.form_placement?.fixed_bar?.cookieExpiration?Une(e.settings.form_placement?.fixed_bar?.cookieExpiration):Lse.formCookieExpiration,animation:e.settings.form_placement?.fixed_bar?.animation??Lse.animation,styles:{...Lse.styles,...e.settings.form_placement?.fixed_bar?.styles},position:e.settings.form_placement?.fixed_bar?.position??Lse.position,categories:e.settings.form_placement?.fixed_bar?.categories??[],tags:e.settings.form_placement?.fixed_bar?.tags??[],posts:{all:"1"===e.settings.form_placement?.fixed_bar?.posts?.all,selected:Array.isArray(e.settings.form_placement?.fixed_bar?.posts?.selected)?e.settings.form_placement?.fixed_bar?.posts?.selected:[]},pages:{all:"1"===e.settings.form_placement?.fixed_bar?.pages?.all,selected:Array.isArray(e.settings.form_placement?.fixed_bar?.pages?.selected)?e.settings.form_placement?.fixed_bar?.pages?.selected:[]},homepage:"1"===e.settings.form_placement?.fixed_bar?.homepage,tagArchives:{all:"1"===e.settings.form_placement?.fixed_bar?.tagArchives?.all,selected:Array.isArray(e.settings.form_placement?.fixed_bar?.tagArchives?.selected)?e.settings.form_placement?.fixed_bar?.tagArchives?.selected:[]},categoryArchives:{all:"1"===e.settings.form_placement?.fixed_bar?.categoryArchives?.all,selected:Array.isArray(e.settings.form_placement?.fixed_bar?.categoryArchives?.selected)?e.settings.form_placement?.fixed_bar?.categoryArchives?.selected:[]}},belowPosts:{enabled:"1"===e.settings.form_placement?.below_posts?.enabled,styles:{...Nse,...e.settings.form_placement?.below_posts?.styles},categories:e.settings.form_placement?.below_posts?.categories??[],tags:e.settings.form_placement?.below_posts?.tags??[],posts:{all:"1"===e.settings.form_placement?.below_posts?.posts?.all,selected:Array.isArray(e.settings.form_placement?.below_posts?.posts?.selected)?e.settings.form_placement?.below_posts?.posts?.selected:[]},pages:{all:"1"===e.settings.form_placement?.below_posts?.pages?.all,selected:Array.isArray(e.settings.form_placement?.below_posts?.pages?.selected)?e.settings.form_placement?.below_posts?.pages?.selected:[]}},slideIn:{enabled:"1"===e.settings.form_placement?.slide_in?.enabled,delay:void 0!==e.settings.form_placement?.slide_in?.delay?Une(e.settings.form_placement?.slide_in?.delay):Pse.formDelay,cookieExpiration:void 0!==e.settings.form_placement?.slide_in?.cookieExpiration?Une(e.settings.form_placement?.slide_in?.cookieExpiration):Pse.formCookieExpiration,position:e.settings.form_placement?.slide_in?.position??Pse.position,animation:e.settings.form_placement?.slide_in?.animation??Pse.animation,styles:{...Pse.styles,...e.settings.form_placement?.slide_in?.styles},categories:e.settings.form_placement?.slide_in?.categories??[],tags:e.settings.form_placement?.slide_in?.tags??[],posts:{all:"1"===e.settings.form_placement?.slide_in?.posts?.all,selected:Array.isArray(e.settings.form_placement?.slide_in?.posts?.selected)?e.settings.form_placement?.slide_in?.posts?.selected:[]},pages:{all:"1"===e.settings.form_placement?.slide_in?.pages?.all,selected:Array.isArray(e.settings.form_placement?.slide_in?.pages?.selected)?e.settings.form_placement?.slide_in?.pages?.selected:[]},homepage:"1"===e.settings.form_placement?.slide_in?.homepage,tagArchives:{all:"1"===e.settings.form_placement?.slide_in?.tagArchives?.all,selected:Array.isArray(e.settings.form_placement?.slide_in?.tagArchives?.selected)?e.settings.form_placement?.slide_in?.tagArchives?.selected:[]},categoryArchives:{all:"1"===e.settings.form_placement?.slide_in?.categoryArchives?.all,selected:Array.isArray(e.settings.form_placement?.slide_in?.categoryArchives?.selected)?e.settings.form_placement?.slide_in?.categoryArchives?.selected:[]}},others:{styles:{...Mse,...e.settings.form_placement?.others?.styles}}},alignment:e.settings.alignment??Dse.alignment,borderRadius:void 0!==e.settings.border_radius?Une(e.settings.border_radius):Dse.borderRadius,borderSize:void 0!==e.settings.border_size?Une(e.settings.border_size):Dse.borderSize,formPadding:void 0!==e.settings.form_padding?Une(e.settings.form_padding):Dse.formPadding,inputPadding:void 0!==e.settings.input_padding?Une(e.settings.input_padding):Dse.inputPadding,borderColor:e.settings.border_color,fontFamily:e.settings.font_family,fontSize:e.settings.fontSize,successValidationColor:e.settings.success_validation_color,errorValidationColor:e.settings.error_validation_color,backgroundImageUrl:e.settings.background_image_url,backgroundImageDisplay:e.settings.background_image_display,closeButton:e.settings.close_button??Dse.closeButton}};return t.settings.formPlacement.belowPosts.styles.width.value=Une(t.settings.formPlacement.belowPosts.styles.width.value),t.settings.formPlacement.slideIn.styles.width.value=Une(t.settings.formPlacement.slideIn.styles.width.value),t.settings.formPlacement.fixedBar.styles.width.value=Une(t.settings.formPlacement.fixedBar.styles.width.value),t.settings.formPlacement.popup.styles.width.value=Une(t.settings.formPlacement.popup.styles.width.value),t.settings.formPlacement.others.styles.width.value=Une(t.settings.formPlacement.others.styles.width.value),delete t.settings.border_radius,delete t.settings.border_size,delete t.settings.border_color,delete t.settings.input_padding,delete t.settings.form_padding,delete t.settings.close_button,delete t.settings.font_family,delete t.settings.background_image_display,delete t.settings.background_image_url,t}function zse(e){const t=(0,zt.A)(e=>e(Gee).hasEditorUndo(),[]),{historyUndo:n}=(0,Vt.A)(Gee),{registerShortcut:i}=(0,Vt.A)("core/keyboard-shortcuts");return(0,$T.wk)("mailpoet-form-editor/undo",e=>{n(),e.preventDefault()}),(0,T.useEffect)(()=>{i({name:"mailpoet-form-editor/undo",category:"block",description:(0,ee.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}})},[i]),(0,Er.jsx)(fv.Ay,{...e,icon:Wee.A,label:(0,ee.__)("Undo"),shortcut:Rt.dz.primary("z"),"aria-disabled":!t,onClick:t?()=>{n()}:void 0,className:"editor-history__undo"})}var Vse=n(73989);function Use(e){const t=(0,zt.A)(e=>e(Gee).hasEditorRedo(),[]),{historyRedo:n}=(0,Vt.A)(Gee),{registerShortcut:i}=(0,Vt.A)("core/keyboard-shortcuts"),r=()=>{n()};return(0,$T.wk)("mailpoet-form-editor/redo",e=>{r(),e.preventDefault()}),(0,T.useEffect)(()=>{i({name:"mailpoet-form-editor/redo",category:"block",description:(0,ee.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"}})},[i]),(0,Er.jsx)(fv.Ay,{...e,icon:Vse.A,label:(0,ee.__)("Redo"),shortcut:Rt.dz.primaryShift("z"),"aria-disabled":!t,onClick:t?r:void 0,className:"editor-history__redo"})}function $se({isInserterOpened:e,setIsInserterOpened:t}){const{sidebarOpened:n,isFormSaving:i,isPreview:r,isFullscreen:o,isListViewOpened:s}=(0,zt.A)(e=>({sidebarOpened:e(Gee).getSidebarOpened(),isFormSaving:e(Gee).getIsFormSaving(),isPreview:e(Gee).getIsPreviewShown(),isFullscreen:e(Gee).isFullscreenEnabled(),isListViewOpened:e(Gee).isListViewOpened()}),[]),{toggleListView:a,toggleSidebar:l,saveForm:c,showPreview:u,toggleFullscreen:d}=(0,Vt.A)(Gee);return(0,Er.jsxs)("div",{className:"editor-header edit-post-header",children:[(0,Er.jsx)("div",{className:"editor-header__toolbar",children:(0,Er.jsx)("div",{className:"toolbar edit-post-header-toolbar",children:(0,Er.jsxs)("div",{className:"editor-document-tools__left",children:[(0,Er.jsx)(fv.Ay,{variant:"secondary",href:"?page=mailpoet-forms#/",className:"mailpoet-editor-header-button",children:$ee.U.I18n.t("back")}),(0,Er.jsx)(mv.A,{as:fv.Ay,"data-automation-id":"form_inserter_open",className:"edit-post-header-toolbar__inserter-toggle",variant:"primary",isPressed:e,onClick:()=>t(!e),icon:kw.A,label:(0,ee._x)("Add block","Generic label for block inserter button")}),(0,Er.jsx)(zse,{"data-automation-id":"form_undo_button"}),(0,Er.jsx)(Use,{"data-automation-id":"form_redo_button"}),(0,Er.jsx)(mv.A,{as:fv.Ay,"data-automation-id":"form_listview_open",isPressed:s,onClick:()=>a(),icon:D1.A,label:(0,ee.__)("List view","mailpoet"),showTooltip:!0})]})})}),(0,Er.jsxs)("div",{className:"editor-header__settings",children:[(0,Er.jsx)(fv.Ay,{variant:"secondary",onClick:u,isPressed:r,className:"mailpoet-preview-button","data-automation-id":"form_preview_button",children:(0,ee.__)("Preview")}),(0,Er.jsx)(fv.Ay,{variant:"primary",className:"editor-post-publish-button","data-automation-id":"form_save_button",isBusy:i,onClick:c,children:i?`${(0,ee.__)("Saving")}`:(0,ee.__)("Save")}),(0,Er.jsx)(fv.Ay,{icon:"admin-generic",label:$ee.U.I18n.t("formSettings"),tooltipPosition:"down",onClick:()=>l(!n),isPressed:n,className:"mailpoet-editor-header-button"}),(0,Er.jsx)(xv.A,{icon:ww.A,label:(0,ee.__)("More tools & options"),className:"edit-post-more-menu",popoverProps:{className:"edit-post-more-menu__content"},children:()=>(0,Er.jsx)(Fv.A,{label:(0,ee._x)("View","noun"),className:"mailpoet-dropdown-menu-group",children:(0,Er.jsx)(Hee,{shortcut:"Ctrl+Shift+Alt+F",label:(0,ee.__)("Fullscreen mode"),info:(0,ee.__)("Work without distraction"),isActive:o,onToggle:()=>d(!o)})})})]})]})}$se.propTypes={isInserterOpened:Uee().bool.isRequired,setIsInserterOpened:Uee().func.isRequired},$se.displayName="FormEditorHeader";var Hse=n(51359),Wse=n(94367);function Gse(){const e=(0,zt.A)(e=>e(Gee).getTutorialUrl(),[]),t=(0,zt.A)(e=>e(Gee).getTutorialSeen(),[]),{tutorialDismissed:n}=(0,Vt.A)(Gee),i=(0,T.useCallback)(()=>{n()},[n]);return t?null:(0,Er.jsx)(Hse.a,{isDismissible:!0,onRequestClose:i,children:(0,Er.jsxs)("div",{className:"mailpoet_drag_and_drop_tutorial","data-automation-id":"form-editor-tutorial",children:[(0,Er.jsx)(Wse.D,{level:2,children:$ee.U.I18n.t("tutorialHeading")}),(0,Er.jsx)("video",{style:{height:"640px"},src:e,controls:!0,autoPlay:!0})]})})}var qse=n(85690),Kse=n(41669),Yse=n.n(Kse),Jse=n(95338);n(79537);class Xse extends T.Component{constructor(e){super(e),this.selectRef=(0,T.createRef)()}componentDidMount(){this.isSelect2Component()&&this.setupSelect2()}componentDidUpdate(e){const{field:t,item:n}=this.props;void 0!==n&&void 0!==e.item&&n.id!==e.item.id&&Yse()(`#${this.selectRef.current.id}`).val(this.getSelectedValues()).trigger("change"),void 0!==n&&void 0!==e.item&&this.allowMultipleValues()&&Jse.default.isArray(n[t.name])&&!Jse.default.isEqual(n[t.name],e.item[t.name])&&Yse()(`#${this.selectRef.current.id}`).val(this.getSelectedValues()).trigger("change"),this.isSelect2Initialized()&&this.getFieldId(this.props)!==this.getFieldId(e)&&void 0!==t.resetSelect2OnUpdate&&this.resetSelect2()}componentWillUnmount(){this.isSelect2Component()&&this.destroySelect2()}getFieldId=e=>{const t=e||this.props;return t.field.id||t.field.name};getSelectedValues=()=>{const{field:e,item:t}=this.props;if(void 0!==e.selected)return e.selected(t);if(void 0!==t&&void 0!==e.name){if(!this.allowMultipleValues())return t[e.name];if(Jse.default.isArray(t[e.name]))return t[e.name].map(e=>e.id)}return null};getItems=()=>{const{field:e}=this.props;let t;return void 0!==window[`mailpoet_${e.endpoint}`]?t=window[`mailpoet_${e.endpoint}`]:void 0!==e.values&&(t=e.values),Jse.default.isArray(t)&&void 0!==e.filter&&(t=t.filter(e.filter)),t};getLabel=e=>{const{field:t,item:n}=this.props;return void 0!==t.getLabel?t.getLabel(e,n):e.name};getSearchLabel=e=>{const{field:t,item:n}=this.props;return void 0!==t.getSearchLabel?t.getSearchLabel(e,n):null};getValue=e=>{const{field:t,item:n}=this.props;return void 0!==t.getValue?t.getValue(e,n):e.id};setupSelect2=()=>{if(this.isSelect2Initialized())return;const{field:e,disabled:t=!1,dropDownParent:n,width:i=""}=this.props;let r={disabled:t||!1,width:i||"",placeholder:{id:"",text:e.placeholder},templateResult:function(e){return e.element&&e.element.selected?null:e.title?e.title:e.text}};n&&(r.dropdownParent=Yse()(n));const o=e.remoteQuery||null;o&&(r=Object.assign(r,{ajax:{url:window.ajaxurl,type:"POST",dataType:"json",data:function(e){return{action:"mailpoet",api_version:window.mailpoet_api_version,token:window.mailpoet_token,endpoint:o.endpoint,method:o.method,data:Object.assign(o.data,{query:e.term})}},processResults:function(e){let t;return t=Jse.default.has(e,"data")?e.data.map(e=>({id:e.id||e.value,text:e.name||e.text})):[],{results:t}}},minimumInputLength:o.minimumInputLength||2})),void 0!==e.extendSelect2Options&&(r=Object.assign(r,e.extendSelect2Options));const s=Yse()(`#${this.selectRef.current.id}`).select2(r);let a=!1;s.on("select2:unselecting",()=>{a=!0}),s.on("select2:opening",e=>{!0===a&&(a=!1,e.preventDefault())}),s.on("change",this.handleChange)};resetSelect2=()=>{this.destroySelect2(),this.setupSelect2()};destroySelect2=()=>{this.isSelect2Initialized()&&(Yse()(`#${this.selectRef.current.id}`).select2("destroy"),this.cleanupAfterSelect2())};cleanupAfterSelect2=()=>{Yse()(`#${this.selectRef.current.id}`).find("option:not(.default)").remove(),Yse()(`#${this.selectRef.current.id}`).off("select2:unselecting").off("select2:opening")};allowMultipleValues=()=>!0===this.props.field.multiple;isSelect2Initialized=()=>!0===Yse()(`#${this.selectRef.current.id}`).hasClass("select2-hidden-accessible");isSelect2Component=()=>this.allowMultipleValues()||this.props.field.forceSelect2;handleChange=e=>{const{field:t,onValueChange:n}=this.props;if("function"!=typeof n)return;const i=Yse()(`#${this.selectRef.current.id}`).children(":selected").map(function(){return{id:Yse()(this).val(),text:Yse()(this).text()}}),r=t.multiple?Jse.default.pluck(i,"id"):Jse.default.pluck(i,"id").toString();n({target:{value:this.transformChangedValue(r,i),name:t.name,id:e.target.id}})};transformChangedValue=(e,t)=>{const{field:n}=this.props;return"function"==typeof n.transformChangedValue?n.transformChangedValue.call(this,e,t):e};insertEmptyOption=()=>{const{field:e}=this.props;if(!this.allowMultipleValues())return e.placeholder?(0,Er.jsx)("option",{className:"default"}):void 0};render(){const{field:e}=this.props,t=this.getItems(e),n=this.getSelectedValues(),i=t.map(e=>{const t=this.getLabel(e),n=this.getSearchLabel(e),i=this.getValue(e);return(0,Er.jsx)("option",{className:"default",value:i,title:n,children:t},`option-${e.id}`)});return(0,Er.jsxs)("select",{id:this.getFieldId(),ref:this.selectRef,disabled:e.disabled,"data-placeholder":e.placeholder,multiple:e.multiple,defaultValue:n,...e.validation,children:[this.insertEmptyOption(),i]})}}Xse.propTypes={onValueChange:Uee().func,field:Uee().shape({name:Uee().string.isRequired,values:Uee().oneOfType([Uee().object,Uee().array]),getLabel:Uee().func,resetSelect2OnUpdate:Uee().bool,selected:Uee().func,endpoint:Uee().string,filter:Uee().func,getSearchLabel:Uee().func,getValue:Uee().func,placeholder:Uee().string,remoteQuery:Uee().object,extendSelect2Options:Uee().object,multiple:Uee().bool,forceSelect2:Uee().bool,transformChangedValue:Uee().func,disabled:Uee().bool,validation:Uee().shape({"data-parsley-required":Uee().bool,"data-parsley-required-message":Uee().string,"data-parsley-type":Uee().string,"data-parsley-errors-container":Uee().string,maxLength:Uee().number})}).isRequired,item:Uee().object,disabled:Uee().bool,width:Uee().string,dropDownParent:Uee().string},Xse.displayName="FormEditorSelection";const Zse=(0,Fee.withBoundary)(Xse);function Qse(){const[e,t]=(0,T.useState)(!1),n=(0,zt.A)(e=>e(Gee).getFormName(),[]),i=M()({"is-selected":e}),{changeFormName:r}=(0,Vt.A)(Gee);return(0,Er.jsxs)("div",{className:i,children:[(0,Er.jsx)("label",{htmlFor:"post-title",className:"screen-reader-text",children:$ee.U.I18n.t("addFormName")}),(0,Er.jsx)("input",{id:"form-title",className:"form-editor-title",placeholder:$ee.U.I18n.t("addFormName"),"data-automation-id":"form_title_input",type:"text",onKeyPress:()=>t(!1),onBlur:()=>t(!1),onChange:e=>r(e.target.value),value:n})]})}function eae({onToggle:e,isOpened:t}){const{settings:n,segments:i,pages:r,missingListError:o,isFormEnabled:s}=(0,zt.A)(e=>({settings:e(Gee).getFormSettings(),segments:e(Gee).getAllAvailableSegments(),pages:e(Gee).getAllWPPages(),missingListError:e(Gee).getNotice("missing-lists"),isFormEnabled:e(Gee).isFormEnabled()}),[]),{changeFormSettings:a,toggleForm:l}=(0,Vt.A)(Gee),c=n.segments?i.filter(e=>n.segments.includes(e.id.toString())):[],u=o&&!c.length;return(0,Er.jsx)(sne.A,{children:(0,Er.jsxs)(mz.Ay,{title:$ee.U.I18n.t("formSettings"),opened:t,onToggle:e,children:[(0,Er.jsx)(Qse,{}),(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("displayForm"),checked:s,onChange:l}),(0,Er.jsxs)(mk.Ay,{label:$ee.U.I18n.t("settingsListLabel"),className:M()({"mailpoet-form-missing-lists":u}),children:[u?(0,Er.jsx)("span",{className:"mailpoet-form-lists-error",children:$ee.U.I18n.t("settingsPleaseSelectList")}):null,(0,Er.jsx)(Zse,{item:{segments:c},onValueChange:e=>{(0,Kee.isEqual)(n.segments,e.target.value)||a({...n,segments:e.target.value})},field:{id:"segments",name:"segments",values:i,multiple:!0,placeholder:$ee.U.I18n.t("settingsPleaseSelectList"),getLabel:e=>`${e.name} (${parseInt(e.subscribers,10).toLocaleString()})`,filter:e=>!(e.deleted_at||"default"!==e.type)}})]}),(0,Er.jsx)(qse.A,{className:"mailpoet-form-inline-radios__control",onChange:e=>{a({...n,on_success:e})},selected:n.on_success||"message",label:$ee.U.I18n.t("settingsAfterSubmit"),options:[{label:$ee.U.I18n.t("settingsShowMessage"),value:"message"},{label:$ee.U.I18n.t("settingsGoToPage"),value:"page"}]}),"page"===n.on_success?(0,Er.jsx)(oE.A,{value:n.success_page,options:r.map(e=>({value:e.id.toString(),label:e.name})),onChange:e=>{a({...n,success_page:e})}}):(0,Er.jsx)(TF.A,{value:n.success_message,onChange:e=>{a({...n,success_message:e})},rows:3})]})})}function tae({name:e,imageUrl:t,onImageUrlChange:n,imageDisplay:i,onImageDisplayChange:r}){return(0,Er.jsxs)("div",{className:"mailpoet-styles-settings-image-url",children:[(0,Er.jsx)(mk.Ay.VisualLabel,{children:e}),(0,Er.jsxs)("div",{className:"mailpoet-styles-settings-image-url-body",children:[(0,Er.jsx)("input",{type:"text",value:t??"",onChange:e=>n(e.target.value)}),(0,Er.jsx)(_S,{onSelect:e=>n(e.url),allowedTypes:["image"],render:({open:e})=>(0,Er.jsx)(fv.Ay,{variant:"secondary",size:"small",onClick:e,children:$ee.U.I18n.t("formSettingsStylesSelectImage")})})]}),(0,Er.jsx)("div",{className:"mailpoet-styles-settings-image-url-display",children:(0,Er.jsx)(oE.A,{value:i,options:[{label:$ee.U.I18n.t("imagePlacementScale"),value:"scale"},{label:$ee.U.I18n.t("imagePlacementFit"),value:"fit"},{label:$ee.U.I18n.t("imagePlacementTile"),value:"tile"}],onChange:r})})]})}eae.propTypes={onToggle:Uee().func.isRequired,isOpened:Uee().bool.isRequired},eae.displayName="FormEditorBasicSettingsPanel";const nae=(0,Er.jsx)(AC.t4,{width:"14px",height:"14px",viewBox:"0 0 14 14",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:(0,Er.jsx)(AC.G,{id:"Symbols",stroke:"none",strokeWidth:"1",children:(0,Er.jsx)(AC.G,{id:"icons/ic_settings",children:(0,Er.jsx)(AC.wA,{d:"M8.05,0 L8.05101528,2.11065231 C8.65254335,2.23933489 9.2139617,2.47621094 9.71391655,2.7999267 L11.2072853,1.30779041 L12.6922096,2.79271465 L11.199432,4.28509331 C11.5234762,4.78529701 11.7605802,5.34705952 11.8893477,5.94898472 L14,5.95 L14,8.05 L11.8895604,8.05002048 C11.7608414,8.65232154 11.5236547,9.21442744 11.199432,9.71490669 L12.6922096,11.2072853 L11.2072853,12.6922096 L9.71391655,11.2000733 C9.2139617,11.5237891 8.65254335,11.7606651 8.05101528,11.8893477 L8.05,14 L5.95,14 L5.94898472,11.8893477 C5.34705952,11.7605802 4.78529701,11.5234762 4.28509331,11.199432 L2.79271465,12.6922096 L1.30779041,11.2072853 L2.7999267,9.71391655 C2.4760325,9.21368611 2.23907376,8.65192438 2.11043961,8.05002048 L8.8817842e-16,8.05 L1.01676633e-15,5.95 L2.11065231,5.94898472 C2.23933489,5.34745665 2.47621094,4.7860383 2.7999267,4.28608345 L1.30779041,2.79271465 L2.79271465,1.30779041 L4.28509331,2.80056797 C4.78529701,2.47652376 5.34705952,2.23941984 5.94898472,2.11065231 L5.95,0 L8.05,0 Z M7,4 C5.34314575,4 4,5.34314575 4,7 C4,8.65685425 5.34314575,10 7,10 C8.65685425,10 10,8.65685425 10,7 C10,5.34314575 8.65685425,4 7,4 Z",id:"ic_settings"})})})}),iae=(0,Er.jsx)(AC.t4,{width:"13",height:"13",viewBox:"4 4 16 16",xmlns:"http://www.w3.org/2000/svg",children:(0,Er.jsx)(AC.G,{id:"icons/checkbox-on-small",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:(0,Er.jsx)(AC.wA,{d:"M12,4 C16.418278,4 20,7.581722 20,12 C20,16.418278 16.418278,20 12,20 C7.581722,20 4,16.418278 4,12 C4,7.581722 7.581722,4 12,4 Z M15.5939818,8.20494484 C15.1497095,7.86124495 14.5235958,7.95992422 14.1955177,8.42535116 L14.1955177,8.42535116 L11.2218999,12.6438652 L9.73479332,10.9561217 C9.36019283,10.530981 8.72753928,10.5044698 8.32172209,10.8969074 C7.91590488,11.289345 7.89059874,11.9521231 8.26519924,12.3772638 L8.26519924,12.3772638 L10.5728715,14.9962817 C10.9986562,15.4795122 11.7391892,15.4370557 12.1120948,14.9080343 L12.1120948,14.9080343 L15.8043703,9.66999857 C16.1324484,9.20457165 16.0382543,8.54864475 15.5939818,8.20494484 Z",id:"Combined-Shape",fill:"#ff5301",fillRule:"nonzero"})})});function rae({label:e,active:t,onClick:n,children:i,canBeActive:r=!0,className:o,automationId:s,displaySettingsIcon:a=!0}){const[l,c]=(0,T.useState)(!1);return(0,Er.jsxs)("div",{"data-automation-id":s,className:M()(o,"selection-item",{"selection-item-active":t&&r}),onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),onClick:n,onKeyDown:e=>{["keydown","keypress"].includes(e.type)&&["Enter"," "].includes(e.key)&&(e.preventDefault(),n())},role:"button",tabIndex:0,children:[(0,Er.jsxs)("div",{className:"selection-item-body",children:[(0,Er.jsxs)("div",{className:"selection-item-settings",children:[a?(0,Er.jsx)("div",{className:M()("selection-item-icon",{"selection-item-icon-hover":l}),children:nae}):(0,Er.jsx)("div",{}),l&&!t&&r&&(0,Er.jsx)("div",{className:"selection-item-settings-oval"}),t&&r&&(0,Er.jsx)("div",{className:"selection-item-check",children:iae})]}),i]}),l&&(0,Er.jsx)("div",{className:"selection-item-overlay"})]},e)}function oae({label:e,active:t,onClick:n,iconUrl:i}){return(0,Er.jsx)(rae,{label:e,onClick:n,active:t,canBeActive:!0,displaySettingsIcon:!1,className:"close-button-selection-item",children:(0,Er.jsx)("img",{src:i,alt:e.replace("_"," "),className:"close-button-selection-item-icon"})})}function sae({name:e,value:t,onChange:n}){const i=(0,zt.A)(e=>e(Gee).getCloseIconsUrl(),[]);return(0,Er.jsxs)("div",{children:[(0,Er.jsx)(mk.Ay.VisualLabel,{children:e}),(0,Er.jsxs)("div",{className:"close-button-selection-item-list",children:[(0,Er.jsx)(oae,{label:"round_white",active:"round_white"===t,iconUrl:i.replace("img/form_close_icon","img/form_close_icon/round_white.svg"),onClick:()=>n("round_white")}),(0,Er.jsx)(oae,{label:"round_black",active:"round_black"===t,iconUrl:i.replace("img/form_close_icon","img/form_close_icon/round_black.svg"),onClick:()=>n("round_black")}),(0,Er.jsx)(oae,{label:"square_white",active:"square_white"===t,iconUrl:i.replace("img/form_close_icon","img/form_close_icon/square_white.svg"),onClick:()=>n("square_white")}),(0,Er.jsx)(oae,{label:"square_black",active:"square_black"===t,iconUrl:i.replace("img/form_close_icon","img/form_close_icon/square_black.svg"),onClick:()=>n("square_black")}),(0,Er.jsx)(oae,{label:"classic",active:"classic"===t,iconUrl:i.replace("img/form_close_icon","img/form_close_icon/classic.svg"),onClick:()=>n("classic")}),(0,Er.jsx)(oae,{label:"classic_white",active:"classic_white"===t,iconUrl:i.replace("img/form_close_icon","img/form_close_icon/classic_white.svg"),onClick:()=>n("classic_white")})]})]})}function aae({onToggle:e,isOpened:t}){const{changeFormSettings:n}=(0,Vt.A)(Gee),i=(0,zt.A)(e=>e(Gee).getFormSettings(),[]),r=(0,T.useRef)(i);(0,T.useEffect)(()=>{r.current=i},[i]);const o=(e,t)=>{const i={...r.current};i[e]=t??Dse[e]??void 0,n(i),r.current=i};return(0,Er.jsx)(sne.A,{children:(0,Er.jsx)(mz.Ay,{title:$ee.U.I18n.t("formSettingsStyles"),opened:t,onToggle:e,children:(0,Er.jsxs)("div",{className:"mailpoet-styles-settings",children:[(0,Er.jsx)(Sne,{title:$ee.U.I18n.t("formSettingsColor"),settings:[{label:$ee.U.I18n.t("formSettingsStylesBackground"),colorValue:i.backgroundColor,gradientValue:i.gradient,onColorChange:(0,Kee.partial)(o,"backgroundColor"),onGradientChange:(0,Kee.partial)(o,"gradient")},{label:$ee.U.I18n.t("formSettingsStylesFont"),colorValue:i.fontColor,onColorChange:(0,Kee.partial)(o,"fontColor")},{label:$ee.U.I18n.t("formSettingsBorder"),colorValue:i.borderColor,onColorChange:(0,Kee.partial)(o,"borderColor")}]}),(0,Er.jsx)(tae,{name:$ee.U.I18n.t("formSettingsStylesBackgroundImage"),imageUrl:i.backgroundImageUrl,onImageUrlChange:(0,Kee.partial)(o,"backgroundImageUrl"),imageDisplay:i.backgroundImageDisplay,onImageDisplayChange:(0,Kee.partial)(o,"backgroundImageDisplay")}),(0,Er.jsx)(aie,{value:i.fontSize,onChange:(0,Kee.partial)(o,"fontSize")}),(0,Er.jsx)(cie,{name:$ee.U.I18n.t("formSettingsStylesFontFamily"),value:i.fontFamily,onChange:(0,Kee.partial)(o,"fontFamily")}),(0,Er.jsx)(gk.A,{label:$ee.U.I18n.t("formSettingsInputPadding"),value:i.inputPadding,min:0,max:30,allowReset:!0,onChange:(0,Kee.partial)(o,"inputPadding")}),(0,Er.jsx)(gk.A,{label:$ee.U.I18n.t("formSettingsBorderSize"),value:void 0!==i.borderSize?i.borderSize:0,min:0,max:10,allowReset:!0,onChange:(0,Kee.partial)(o,"borderSize"),className:"mailpoet-automation-styles-border-size"}),(0,Er.jsx)(gk.A,{label:$ee.U.I18n.t("formSettingsBorderRadius"),value:void 0!==i.borderRadius?i.borderRadius:0,min:0,max:40,allowReset:!0,onChange:(0,Kee.partial)(o,"borderRadius")}),(0,Er.jsx)(oE.A,{label:$ee.U.I18n.t("formSettingsAlignment"),onChange:(0,Kee.partial)(o,"alignment"),options:[{value:Ene.Left,label:$ee.U.I18n.t("formSettingsAlignmentLeft")},{value:Ene.Center,label:$ee.U.I18n.t("formSettingsAlignmentCenter")},{value:Ene.Right,label:$ee.U.I18n.t("formSettingsAlignmentRight")}],value:i.alignment}),(0,Er.jsx)(gk.A,{label:$ee.U.I18n.t("formSettingsFormPadding"),value:i.formPadding,min:0,max:40,allowReset:!0,onChange:(0,Kee.partial)(o,"formPadding")}),(0,Er.jsx)(Sne,{title:$ee.U.I18n.t("validationMessageColor"),settings:[{label:$ee.U.I18n.t("successValidationColorTitle"),colorValue:i.successValidationColor,onColorChange:(0,Kee.partial)(o,"successValidationColor")},{label:$ee.U.I18n.t("errorValidationColorTitle"),colorValue:i.errorValidationColor,onColorChange:(0,Kee.partial)(o,"errorValidationColor")}]}),(0,Er.jsx)(sae,{name:$ee.U.I18n.t("closeButtonHeading"),value:i.closeButton,onChange:(0,Kee.partial)(o,"closeButton")})]})})})}const lae=(0,Er.jsxs)(AC.t4,{width:"144",height:"120",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 144 120",children:[(0,Er.jsxs)("defs",{children:[(0,Er.jsx)(AC.rw,{id:"a",x:"8",y:"8",width:"128",height:"68",rx:"1"}),(0,Er.jsx)(AC.rw,{id:"b",x:"8",y:"100",width:"128",height:"12",rx:"1"})]}),(0,Er.jsxs)(AC.G,{fill:"none",fillRule:"evenodd",children:[(0,Er.jsx)(AC.wA,{d:"M4 0h136a4 4 0 0 1 4 4v112a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#FFF",fillRule:"nonzero"}),(0,Er.jsx)("use",{fill:"#FFF",xlinkHref:"#a"}),(0,Er.jsx)("use",{fillOpacity:".4",fill:"#E5E9F8",xlinkHref:"#a"}),(0,Er.jsx)("use",{fill:"#FFF",xlinkHref:"#b"}),(0,Er.jsx)("use",{fillOpacity:".4",fill:"#E5E9F8",xlinkHref:"#b"}),(0,Er.jsx)(AC.rw,{fill:"#FF5301",fillRule:"nonzero",x:"98",y:"84",width:"38",height:"8",rx:"1"}),(0,Er.jsx)(AC.rw,{fill:"#FFE0D0",fillRule:"nonzero",x:"53",y:"84",width:"38",height:"8",rx:"1"}),(0,Er.jsx)(AC.rw,{fill:"#FFE0D0",fillRule:"nonzero",x:"8",y:"84",width:"38",height:"8",rx:"1"})]})]});function cae({label:e,icon:t,active:n,canBeActive:i=!0,onClick:r}){return(0,Er.jsxs)(rae,{label:e,onClick:r,active:n,canBeActive:i,className:"form-placement-option",automationId:`form-placement-option-${e}`,children:[(0,Er.jsx)("div",{className:"form-placement-option-icon",children:t}),(0,Er.jsx)("div",{className:"form-placement-option-label",children:(0,Er.jsx)("p",{children:e})})]})}function uae(){const e=(0,zt.A)(e=>e(Gee).getFormSettings(),[]),{showPlacementSettings:t}=(0,Vt.A)(Gee);return(0,Er.jsx)(cae,{active:e.formPlacement.belowPosts.enabled,label:(0,ee.__)("Below pages","mailpoet"),icon:lae,onClick:()=>{t("below_posts")},canBeActive:!0})}const dae=(0,Er.jsxs)(AC.t4,{width:"144",height:"120",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 144 120",children:[(0,Er.jsxs)("defs",{children:[(0,Er.jsx)(AC.rw,{id:"popup_icon_a",x:"8",y:"8",width:"128",height:"104",rx:"1"}),(0,Er.jsx)(AC.wA,{d:"M49 34h46a4 4 0 0 1 4 4v40a4 4 0 0 1-4 4H49a4 4 0 0 1-4-4V38a4 4 0 0 1 4-4z",id:"popup_icon_c"}),(0,Er.jsxs)("filter",{x:"-61.1%",y:"-56.2%",width:"222.2%",height:"237.5%",filterUnits:"objectBoundingBox",id:"popup_icon_b",children:[(0,Er.jsx)("feOffset",{dy:"6",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,Er.jsx)("feGaussianBlur",{stdDeviation:"10",in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),(0,Er.jsx)("feColorMatrix",{values:"0 0 0 0 0.265158067 0 0 0 0 0.293073922 0 0 0 0 0.400749362 0 0 0 0.145352129 0",in:"shadowBlurOuter1"})]})]}),(0,Er.jsxs)(AC.G,{fill:"none",fillRule:"evenodd",children:[(0,Er.jsx)(AC.wA,{d:"M4 0h136a4 4 0 0 1 4 4v112a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#FFF",fillRule:"nonzero"}),(0,Er.jsx)("use",{fill:"#FFF",xlinkHref:"#popup_icon_a"}),(0,Er.jsx)("use",{fillOpacity:".4",fill:"#E5E9F8",xlinkHref:"#popup_icon_a"}),(0,Er.jsxs)(AC.G,{fillRule:"nonzero",children:[(0,Er.jsx)("use",{fill:"#000",filter:"url(#popup_icon_b)",xlinkHref:"#popup_icon_c"}),(0,Er.jsx)("use",{fill:"#FFF",xlinkHref:"#popup_icon_c"})]}),(0,Er.jsx)(AC.rw,{fill:"#FF5301",fillRule:"nonzero",x:"53",y:"66",width:"38",height:"8",rx:"1"}),(0,Er.jsx)(AC.rw,{fill:"#FFE0D0",fillRule:"nonzero",x:"53",y:"54",width:"38",height:"8",rx:"1"}),(0,Er.jsx)(AC.rw,{fill:"#FFE0D0",fillRule:"nonzero",x:"53",y:"42",width:"38",height:"8",rx:"1"})]})]});function hae(){const e=(0,zt.A)(e=>e(Gee).getFormSettings(),[]),{showPlacementSettings:t}=(0,Vt.A)(Gee);return(0,Er.jsx)(cae,{active:e.formPlacement.popup.enabled,label:(0,ee.__)("Pop-up","mailpoet"),icon:dae,onClick:()=>{t("popup")},canBeActive:!0})}const pae=(0,Er.jsxs)(AC.t4,{width:"144",height:"120",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 144 120",children:[(0,Er.jsx)("defs",{children:(0,Er.jsx)(AC.rw,{id:"fixed_bar_a",x:"8",y:"24",width:"128",height:"88",rx:"1"})}),(0,Er.jsxs)(AC.G,{fill:"none",fillRule:"evenodd",children:[(0,Er.jsx)(AC.wA,{d:"M4 0h136a4 4 0 0 1 4 4v112a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#FFF",fillRule:"nonzero"}),(0,Er.jsx)("use",{fill:"#FFF",xlinkHref:"#a"}),(0,Er.jsx)("use",{fillOpacity:".4",fill:"#E5E9F8",xlinkHref:"#fixed_bar_a"}),(0,Er.jsx)(AC.rw,{fill:"#FF5301",fillRule:"nonzero",x:"98",y:"8",width:"38",height:"8",rx:"1"}),(0,Er.jsx)(AC.rw,{fill:"#FFE0D0",fillRule:"nonzero",x:"53",y:"8",width:"38",height:"8",rx:"1"}),(0,Er.jsx)(AC.rw,{fill:"#FFE0D0",fillRule:"nonzero",x:"8",y:"8",width:"38",height:"8",rx:"1"})]})]});function fae(){const e=(0,zt.A)(e=>e(Gee).getFormSettings(),[]),{showPlacementSettings:t}=(0,Vt.A)(Gee);return(0,Er.jsx)(cae,{active:e.formPlacement.fixedBar.enabled,label:(0,ee.__)("Fixed bar","mailpoet"),icon:pae,onClick:()=>{t("fixed_bar")},canBeActive:!0})}const mae=(0,Er.jsxs)(AC.t4,{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"76",height:"63",viewBox:"0 0 76 63",children:[(0,Er.jsxs)("defs",{children:[(0,Er.jsxs)("filter",{id:"slide_in_prefix__a",width:"216.9%",height:"245.3%",x:"-55.8%",y:"-67.2%",filterUnits:"objectBoundingBox",children:[(0,Er.jsx)("feOffset",{dy:"4",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,Er.jsx)("feGaussianBlur",{in:"shadowOffsetOuter1",result:"shadowBlurOuter1",stdDeviation:"9"}),(0,Er.jsx)("feColorMatrix",{in:"shadowBlurOuter1",result:"shadowMatrixOuter1",values:"0 0 0 0 0.265158067 0 0 0 0 0.293073922 0 0 0 0 0.400749362 0 0 0 0.145352129 0"}),(0,Er.jsxs)("feMerge",{children:[(0,Er.jsx)("feMergeNode",{in:"shadowMatrixOuter1"}),(0,Er.jsx)("feMergeNode",{in:"SourceGraphic"})]})]}),(0,Er.jsxs)("filter",{id:"slide_in_prefix__c",width:"226.3%",height:"255.8%",x:"-73.7%",y:"-77.9%",filterUnits:"objectBoundingBox",children:[(0,Er.jsx)("feOffset",{dx:"-3",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,Er.jsx)("feGaussianBlur",{in:"shadowOffsetOuter1",result:"shadowBlurOuter1",stdDeviation:"5.5"}),(0,Er.jsx)("feColorMatrix",{in:"shadowBlurOuter1",values:"0 0 0 0 0.265158067 0 0 0 0 0.293073922 0 0 0 0 0.400749362 0 0 0 0.145352129 0"})]}),(0,Er.jsx)(AC.rw,{id:"slide_in_prefix__b",width:"67.556",height:"54.6",x:"4.222",y:"4.2",rx:".525"}),(0,Er.jsx)(AC.wA,{id:"slide_in_prefix__d",d:"M.525 0h27.45c.29 0 .525.235.525.525v22.05c0 .29-.235.525-.525.525H.525c-.29 0-.525-.235-.525-.525V.525C0 .235.235 0 .525 0z"})]}),(0,Er.jsxs)(AC.G,{fill:"none",fillRule:"evenodd",filter:"url(#slide_in_prefix__a)",children:[(0,Er.jsx)(AC.wA,{fill:"#FFF",fillRule:"nonzero",d:"M2.1 0h71.8c1.16 0 2.1.94 2.1 2.1v58.8c0 1.16-.94 2.1-2.1 2.1H2.1C.94 63 0 62.06 0 60.9V2.1C0 .94.94 0 2.1 0z"}),(0,Er.jsx)("use",{fill:"#FFF",xlinkHref:"#slide_in_prefix__b"}),(0,Er.jsx)("use",{fill:"#E5E9F8",fillOpacity:".4",xlinkHref:"#slide_in_prefix__b"}),(0,Er.jsxs)(AC.G,{fillRule:"nonzero",transform:"translate(43.278 35.7)",children:[(0,Er.jsx)("use",{fill:"#000",filter:"url(#slide_in_prefix__c)",xlinkHref:"#slide_in_prefix__d"}),(0,Er.jsx)("use",{fill:"#FFF",xlinkHref:"#slide_in_prefix__d"}),(0,Er.jsx)(AC.rw,{width:"15.833",height:"4.2",x:"6.333",y:"14.7",fill:"#FF5301",rx:".525"}),(0,Er.jsx)(AC.rw,{width:"15.833",height:"4.2",x:"6.333",y:"9.45",fill:"#FFE0D0",rx:".525"}),(0,Er.jsx)(AC.rw,{width:"15.833",height:"4.2",x:"6.333",y:"4.2",fill:"#FFE0D0",rx:".525"})]})]})]});function gae(){const e=(0,zt.A)(e=>e(Gee).getFormSettings(),[]),{showPlacementSettings:t}=(0,Vt.A)(Gee);return(0,Er.jsx)(cae,{active:e.formPlacement.slideIn.enabled,label:(0,ee.__)("Slide–in","mailpoet"),icon:mae,onClick:()=>{t("slide_in")},canBeActive:!0})}const bae=(0,Er.jsxs)(AC.t4,{xmlns:"http://www.w3.org/2000/svg",width:"144",height:"120",viewBox:"0 0 144 120",children:[(0,Er.jsxs)("defs",{children:[(0,Er.jsx)(AC.rw,{id:"sidebar_icon_prefix__b",width:"82",height:"104",x:"8",y:"8",rx:"1"}),(0,Er.jsx)(AC.rw,{id:"sidebar_icon_prefix__c",width:"38",height:"30",x:"98",y:"8",rx:"1"}),(0,Er.jsx)(AC.rw,{id:"sidebar_icon_prefix__d",width:"38",height:"30",x:"98",y:"82",rx:"1"}),(0,Er.jsxs)("filter",{id:"sidebar_icon_prefix__a",width:"212.5%",height:"235%",x:"-56.2%",y:"-67.5%",filterUnits:"objectBoundingBox",children:[(0,Er.jsx)("feOffset",{dy:"7",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,Er.jsx)("feGaussianBlur",{in:"shadowOffsetOuter1",result:"shadowBlurOuter1",stdDeviation:"17.5"}),(0,Er.jsx)("feColorMatrix",{in:"shadowBlurOuter1",result:"shadowMatrixOuter1",values:"0 0 0 0 0.265158067 0 0 0 0 0.293073922 0 0 0 0 0.400749362 0 0 0 0.145352129 0"}),(0,Er.jsxs)("feMerge",{children:[(0,Er.jsx)("feMergeNode",{in:"shadowMatrixOuter1"}),(0,Er.jsx)("feMergeNode",{in:"SourceGraphic"})]})]})]}),(0,Er.jsxs)(AC.G,{fill:"none",fillRule:"evenodd",filter:"url(#sidebar_icon_prefix__a)",children:[(0,Er.jsx)(AC.wA,{fill:"#FFF",fillRule:"nonzero",d:"M4 0h136c2.21 0 4 1.79 4 4v112c0 2.21-1.79 4-4 4H4c-2.21 0-4-1.79-4-4V4c0-2.21 1.79-4 4-4z"}),(0,Er.jsx)("use",{fill:"#FFF",xlinkHref:"#sidebar_icon_prefix__b"}),(0,Er.jsx)("use",{fill:"#E5E9F8",fillOpacity:".4",xlinkHref:"#sidebar_icon_prefix__b"}),(0,Er.jsx)("use",{fill:"#FFF",xlinkHref:"#sidebar_icon_prefix__c"}),(0,Er.jsx)("use",{fill:"#E5E9F8",fillOpacity:".4",xlinkHref:"#sidebar_icon_prefix__c"}),(0,Er.jsx)("use",{fill:"#FFF",xlinkHref:"#sidebar_icon_prefix__d"}),(0,Er.jsx)("use",{fill:"#E5E9F8",fillOpacity:".4",xlinkHref:"#sidebar_icon_prefix__d"}),(0,Er.jsx)(AC.rw,{width:"38",height:"8",x:"98",y:"66",fill:"#FF5301",fillRule:"nonzero",rx:"1"}),(0,Er.jsx)(AC.rw,{width:"38",height:"8",x:"98",y:"56",fill:"#FFE0D0",fillRule:"nonzero",rx:"1"}),(0,Er.jsx)(AC.rw,{width:"38",height:"8",x:"98",y:"46",fill:"#FFE0D0",fillRule:"nonzero",rx:"1"})]})]});function yae(){const{showPlacementSettings:e}=(0,Vt.A)(Gee);return(0,Er.jsx)(cae,{active:!1,label:(0,ee.__)("Others (widget)","mailpoet"),icon:bae,onClick:()=>{e("others")},canBeActive:!1})}function vae({onToggle:e,isOpened:t}){return(0,Er.jsx)(sne.A,{children:(0,Er.jsx)(mz.Ay,{title:$ee.U.I18n.t("formPlacement"),opened:t,onToggle:e,className:"form-sidebar-form-placement-panel",children:(0,Er.jsxs)("div",{className:"form-placement-option-list",children:[(0,Er.jsx)(uae,{}),(0,Er.jsx)(fae,{}),(0,Er.jsx)(hae,{}),(0,Er.jsx)(gae,{}),(0,Er.jsx)(yae,{})]})})})}function _ae(){return _ae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},_ae.apply(null,arguments)}vae.propTypes={onToggle:Uee().func.isRequired,isOpened:Uee().bool.isRequired};class xae{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=Tae(this,e,t);let i=[];return this.decompose(0,e,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(t,this.length,i,1),wae.from(i,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Tae(this,e,t);let n=[];return this.decompose(e,t,n,0),wae.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),i=new Aae(this),r=new Aae(e);for(let e=t,o=t;;){if(i.next(e),r.next(e),e=0,i.lineBreak!=r.lineBreak||i.done!=r.done||i.value!=r.value)return!1;if(o+=i.value.length,i.done||o>=n)return!0}}iter(e=1){return new Aae(this,e)}iterRange(e,t=this.length){return new Iae(this,e,t)}iterLines(e,t){let n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);let i=this.line(e).from;n=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Eae(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(0==e.length)throw new RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new kae(e):wae.from(kae.split(e,[])):xae.empty}}class kae extends xae{constructor(e,t=function(e){let t=-1;for(let n of e)t+=n.length+1;return t}(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,i){for(let r=0;;r++){let o=this.text[r],s=i+o.length;if((t?n:s)>=e)return new jae(i,s,n,o);i=s+1,n++}}decompose(e,t,n,i){let r=e<=0&&t>=this.length?this:new kae(Sae(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(1&i){let e=n.pop(),t=Cae(r.text,e.text.slice(),0,r.length);if(t.length<=32)n.push(new kae(t,e.length+r.length));else{let e=t.length>>1;n.push(new kae(t.slice(0,e)),new kae(t.slice(e)))}}else n.push(r)}replace(e,t,n){if(!(n instanceof kae))return super.replace(e,t,n);[e,t]=Tae(this,e,t);let i=Cae(this.text,Cae(n.text,Sae(this.text,0,e)),t),r=this.length+n.length-(t-e);return i.length<=32?new kae(i,r):wae.from(kae.split(i,[]),r)}sliceString(e,t=this.length,n="\n"){[e,t]=Tae(this,e,t);let i="";for(let r=0,o=0;r<=t&&o<this.text.length;o++){let s=this.text[o],a=r+s.length;r>e&&o&&(i+=n),e<a&&t>r&&(i+=s.slice(Math.max(0,e-r),t-r)),r=a+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],i=-1;for(let r of e)n.push(r),i+=r.length+1,32==n.length&&(t.push(new kae(n,i)),n=[],i=-1);return i>-1&&t.push(new kae(n,i)),t}}class wae extends xae{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,i){for(let r=0;;r++){let o=this.children[r],s=i+o.length,a=n+o.lines-1;if((t?a:s)>=e)return o.lineInner(e,t,n,i);i=s+1,n=a+1}}decompose(e,t,n,i){for(let r=0,o=0;o<=t&&r<this.children.length;r++){let s=this.children[r],a=o+s.length;if(e<=a&&t>=o){let r=i&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!r?n.push(s):s.decompose(e-o,t-o,n,r)}o=a+1}}replace(e,t,n){if([e,t]=Tae(this,e,t),n.lines<this.lines)for(let i=0,r=0;i<this.children.length;i++){let o=this.children[i],s=r+o.length;if(e>=r&&t<=s){let a=o.replace(e-r,t-r,n),l=this.lines-o.lines+a.lines;if(a.lines<l>>4&&a.lines>l>>6){let r=this.children.slice();return r[i]=a,new wae(r,this.length-(t-e)+n.length)}return super.replace(r,s,a)}r=s+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n="\n"){[e,t]=Tae(this,e,t);let i="";for(let r=0,o=0;r<this.children.length&&o<=t;r++){let s=this.children[r],a=o+s.length;o>e&&r&&(i+=n),e<a&&t>o&&(i+=s.sliceString(e-o,t-o,n)),o=a+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof wae))return 0;let n=0,[i,r,o,s]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,r+=t){if(i==o||r==s)return n;let a=this.children[i],l=e.children[r];if(a!=l)return n+a.scanIdentical(l,t);n+=a.length+1}}static from(e,t=e.reduce((e,t)=>e+t.length+1,-1)){let n=0;for(let t of e)n+=t.lines;if(n<32){let n=[];for(let t of e)t.flatten(n);return new kae(n,t)}let i=Math.max(32,n>>5),r=i<<1,o=i>>1,s=[],a=0,l=-1,c=[];function u(e){let t;if(e.lines>r&&e instanceof wae)for(let t of e.children)u(t);else e.lines>o&&(a>o||!a)?(d(),s.push(e)):e instanceof kae&&a&&(t=c[c.length-1])instanceof kae&&e.lines+t.lines<=32?(a+=e.lines,l+=e.length+1,c[c.length-1]=new kae(t.text.concat(e.text),t.length+1+e.length)):(a+e.lines>i&&d(),a+=e.lines,l+=e.length+1,c.push(e))}function d(){0!=a&&(s.push(1==c.length?c[0]:wae.from(c,l)),l=-1,a=c.length=0)}for(let t of e)u(t);return d(),1==s.length?s[0]:new wae(s,t)}}function Cae(e,t,n=0,i=1e9){for(let r=0,o=0,s=!0;o<e.length&&r<=i;o++){let a=e[o],l=r+a.length;l>=n&&(l>i&&(a=a.slice(0,i-r)),r<n&&(a=a.slice(n-r)),s?(t[t.length-1]+=a,s=!1):t.push(a)),r=l+1}return t}function Sae(e,t,n){return Cae(e,[""],t,n)}xae.empty=new kae([""],0);class Aae{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof kae?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],r=this.offsets[n],o=r>>1,s=i instanceof kae?i.text.length:i.children.length;if(o==(t>0?s:0)){if(0==n)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&r)==(t>0?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(i instanceof kae){let r=i.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,r.length>Math.max(0,e))return this.value=0==e?r:t>0?r.slice(e):r.slice(0,r.length-e),this;e-=r.length}else{let r=i.children[o+(t<0?-1:0)];e>r.length?(e-=r.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(r),this.offsets.push(t>0?1:(r instanceof kae?r.text.length:r.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Iae{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new Aae(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=n?i:t<0?i.slice(i.length-n):i.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class Eae{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:i}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(xae.prototype[Symbol.iterator]=function(){return this.iter()},Aae.prototype[Symbol.iterator]=Iae.prototype[Symbol.iterator]=Eae.prototype[Symbol.iterator]=function(){return this});class jae{constructor(e,t,n,i){this.from=e,this.to=t,this.number=n,this.text=i}get length(){return this.to-this.from}}function Tae(e,t,n){return[t=Math.max(0,Math.min(e.length,t)),Math.max(t,Math.min(e.length,n))]}let Bae="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=1;e<Bae.length;e++)Bae[e]+=Bae[e-1];function Nae(e){for(let t=1;t<Bae.length;t+=2)if(Bae[t]>e)return Bae[t-1]<=e;return!1}function Rae(e){return e>=127462&&e<=127487}function Oae(e,t,n=!0,i=!0){return(n?Lae:Mae)(e,t,i)}function Lae(e,t,n){if(t==e.length)return t;t&&Pae(e.charCodeAt(t))&&Dae(e.charCodeAt(t-1))&&t--;let i=Fae(e,t);for(t+=Vae(i);t<e.length;){let r=Fae(e,t);if(8205==i||8205==r||n&&Nae(r))t+=Vae(r),i=r;else{if(!Rae(r))break;{let n=0,i=t-2;for(;i>=0&&Rae(Fae(e,i));)n++,i-=2;if(n%2==0)break;t+=2}}}return t}function Mae(e,t,n){for(;t>0;){let i=Lae(e,t-2,n);if(i<t)return i;t--}return 0}function Pae(e){return e>=56320&&e<57344}function Dae(e){return e>=55296&&e<56320}function Fae(e,t){let n=e.charCodeAt(t);if(!Dae(n)||t+1==e.length)return n;let i=e.charCodeAt(t+1);return Pae(i)?i-56320+(n-55296<<10)+65536:n}function zae(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function Vae(e){return e<65536?1:2}const Uae=/\r\n?|\n/;var $ae=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}($ae||($ae={}));class Hae{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,i=0;t<this.sections.length;){let r=this.sections[t++],o=this.sections[t++];o<0?(e(n,i,r),i+=r):i+=o,n+=r}}iterChangedRanges(e,t=!1){Kae(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let n=this.sections[t++],i=this.sections[t++];i<0?e.push(n,i):e.push(i,n)}return new Hae(e)}composeDesc(e){return this.empty?e:e.empty?this:Jae(this,e)}mapDesc(e,t=!1){return e.empty?this:Yae(this,e,t)}mapPos(e,t=-1,n=$ae.Simple){let i=0,r=0;for(let o=0;o<this.sections.length;){let s=this.sections[o++],a=this.sections[o++],l=i+s;if(a<0){if(l>e)return r+(e-i);r+=s}else{if(n!=$ae.Simple&&l>=e&&(n==$ae.TrackDel&&i<e&&l>e||n==$ae.TrackBefore&&i<e||n==$ae.TrackAfter&&l>e))return null;if(l>e||l==e&&t<0&&!s)return e==i||t<0?r:r+a;r+=a}i=l}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return r}touchesRange(e,t=e){for(let n=0,i=0;n<this.sections.length&&i<=t;){let r=i+this.sections[n++];if(this.sections[n++]>=0&&i<=t&&r>=e)return!(i<e&&r>t)||"cover";i=r}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let n=this.sections[t++],i=this.sections[t++];e+=(e?" ":"")+n+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(e=>"number"!=typeof e))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Hae(e)}static create(e){return new Hae(e)}}class Wae extends Hae{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Kae(this,(t,n,i,r,o)=>e=e.replace(i,i+(n-t),o),!1),e}mapDesc(e,t=!1){return Yae(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let i=0,r=0;i<t.length;i+=2){let o=t[i],s=t[i+1];if(s>=0){t[i]=s,t[i+1]=o;let a=i>>1;for(;n.length<a;)n.push(xae.empty);n.push(o?e.slice(r,r+o):xae.empty)}r+=o}return new Wae(t,n)}compose(e){return this.empty?e:e.empty?this:Jae(this,e,!0)}map(e,t=!1){return e.empty?this:Yae(this,e,t,!0)}iterChanges(e,t=!1){Kae(this,e,t)}get desc(){return Hae.create(this.sections)}filter(e){let t=[],n=[],i=[],r=new Xae(this);e:for(let o=0,s=0;;){let a=o==e.length?1e9:e[o++];for(;s<a||s==a&&0==r.len;){if(r.done)break e;let e=Math.min(r.len,a-s);Gae(i,e,-1);let o=-1==r.ins?-1:0==r.off?r.ins:0;Gae(t,e,o),o>0&&qae(n,t,r.text),r.forward(e),s+=e}let l=e[o++];for(;s<l;){if(r.done)break e;let e=Math.min(r.len,l-s);Gae(t,e,-1),Gae(i,e,-1==r.ins?-1:0==r.off?r.ins:0),r.forward(e),s+=e}}return{changes:new Wae(t,n),filtered:Hae.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],i=this.sections[t+1];i<0?e.push(n):0==i?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,n){let i=[],r=[],o=0,s=null;function a(e=!1){if(!e&&!i.length)return;o<t&&Gae(i,t-o,-1);let n=new Wae(i,r);s=s?s.compose(n.map(s)):n,i=[],r=[],o=0}return function e(l){if(Array.isArray(l))for(let t of l)e(t);else if(l instanceof Wae){if(l.length!=t)throw new RangeError(`Mismatched change set length (got ${l.length}, expected ${t})`);a(),s=s?s.compose(l.map(s)):l}else{let{from:e,to:s=e,insert:c}=l;if(e>s||e<0||s>t)throw new RangeError(`Invalid change range ${e} to ${s} (in doc of length ${t})`);let u=c?"string"==typeof c?xae.of(c.split(n||Uae)):c:xae.empty,d=u.length;if(e==s&&0==d)return;e<o&&a(),e>o&&Gae(i,e-o,-1),Gae(i,s-e,d),qae(r,i,u),o=s}}(e),a(!s),s}static empty(e){return new Wae(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let i=0;i<e.length;i++){let r=e[i];if("number"==typeof r)t.push(r,-1);else{if(!Array.isArray(r)||"number"!=typeof r[0]||r.some((e,t)=>t&&"string"!=typeof e))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==r.length)t.push(r[0],0);else{for(;n.length<i;)n.push(xae.empty);n[i]=xae.of(r.slice(1)),t.push(r[0],n[i].length)}}}return new Wae(t,n)}static createSet(e,t){return new Wae(e,t)}}function Gae(e,t,n,i=!1){if(0==t&&n<=0)return;let r=e.length-2;r>=0&&n<=0&&n==e[r+1]?e[r]+=t:0==t&&0==e[r]?e[r+1]+=n:i?(e[r]+=t,e[r+1]+=n):e.push(t,n)}function qae(e,t,n){if(0==n.length)return;let i=t.length-2>>1;if(i<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<i;)e.push(xae.empty);e.push(n)}}function Kae(e,t,n){let i=e.inserted;for(let r=0,o=0,s=0;s<e.sections.length;){let a=e.sections[s++],l=e.sections[s++];if(l<0)r+=a,o+=a;else{let c=r,u=o,d=xae.empty;for(;c+=a,u+=l,l&&i&&(d=d.append(i[s-2>>1])),!(n||s==e.sections.length||e.sections[s+1]<0);)a=e.sections[s++],l=e.sections[s++];t(r,c,o,u,d),r=c,o=u}}}function Yae(e,t,n,i=!1){let r=[],o=i?[]:null,s=new Xae(e),a=new Xae(t);for(let e=-1;;)if(-1==s.ins&&-1==a.ins){let e=Math.min(s.len,a.len);Gae(r,e,-1),s.forward(e),a.forward(e)}else if(a.ins>=0&&(s.ins<0||e==s.i||0==s.off&&(a.len<s.len||a.len==s.len&&!n))){let t=a.len;for(Gae(r,a.ins,-1);t;){let n=Math.min(s.len,t);s.ins>=0&&e<s.i&&s.len<=n&&(Gae(r,0,s.ins),o&&qae(o,r,s.text),e=s.i),s.forward(n),t-=n}a.next()}else{if(!(s.ins>=0)){if(s.done&&a.done)return o?Wae.createSet(r,o):Hae.create(r);throw new Error("Mismatched change set lengths")}{let t=0,n=s.len;for(;n;)if(-1==a.ins){let e=Math.min(n,a.len);t+=e,n-=e,a.forward(e)}else{if(!(0==a.ins&&a.len<n))break;n-=a.len,a.next()}Gae(r,t,e<s.i?s.ins:0),o&&e<s.i&&qae(o,r,s.text),e=s.i,s.forward(s.len-n)}}}function Jae(e,t,n=!1){let i=[],r=n?[]:null,o=new Xae(e),s=new Xae(t);for(let e=!1;;){if(o.done&&s.done)return r?Wae.createSet(i,r):Hae.create(i);if(0==o.ins)Gae(i,o.len,0,e),o.next();else if(0!=s.len||s.done){if(o.done||s.done)throw new Error("Mismatched change set lengths");{let t=Math.min(o.len2,s.len),n=i.length;if(-1==o.ins){let n=-1==s.ins?-1:s.off?0:s.ins;Gae(i,t,n,e),r&&n&&qae(r,i,s.text)}else-1==s.ins?(Gae(i,o.off?0:o.len,t,e),r&&qae(r,i,o.textBit(t))):(Gae(i,o.off?0:o.len,s.off?0:s.ins,e),r&&!s.off&&qae(r,i,s.text));e=(o.ins>t||s.ins>=0&&s.len>t)&&(e||i.length>n),o.forward2(t),s.forward(t)}}else Gae(i,0,s.ins,e),r&&qae(r,i,s.text),s.next()}}class Xae{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return-2==this.ins}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?xae.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?xae.empty:t[n].slice(this.off,null==e?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Zae{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get bidiLevel(){let e=7&this.flags;return 7==e?null:e}get goalColumn(){let e=this.flags>>6;return 16777215==e?void 0:e}map(e,t=-1){let n,i;return this.empty?n=i=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),n==this.from&&i==this.to?this:new Zae(n,i,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return Qae.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return Qae.range(this.anchor,n)}eq(e,t=!1){return!(this.anchor!=e.anchor||this.head!=e.head||t&&this.empty&&this.assoc!=e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid JSON representation for SelectionRange");return Qae.range(e.anchor,e.head)}static create(e,t,n){return new Zae(e,t,n)}}class Qae{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:Qae.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return 1==this.ranges.length?this:new Qae([this.main],0)}addRange(e,t=!0){return Qae.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let n=this.ranges.slice();return n[t]=e,Qae.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||"number"!=typeof e.main||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Qae(e.ranges.map(e=>Zae.fromJSON(e)),e.main)}static single(e,t=e){return new Qae([Qae.range(e,t)],0)}static create(e,t=0){if(0==e.length)throw new RangeError("A selection needs at least one range");for(let n=0,i=0;i<e.length;i++){let r=e[i];if(r.empty?r.from<=n:r.from<n)return Qae.normalized(e.slice(),t);n=r.to}return new Qae(e,t)}static cursor(e,t=0,n,i){return Zae.create(e,e,(0==t?0:t<0?8:16)|(null==n?7:Math.min(6,n))|(null!=i?i:16777215)<<6)}static range(e,t,n,i){let r=(null!=n?n:16777215)<<6|(null==i?7:Math.min(6,i));return t<e?Zae.create(t,e,48|r):Zae.create(e,t,(t>e?8:0)|r)}static normalized(e,t=0){let n=e[t];e.sort((e,t)=>e.from-t.from),t=e.indexOf(n);for(let n=1;n<e.length;n++){let i=e[n],r=e[n-1];if(i.empty?i.from<=r.to:i.from<r.to){let o=r.from,s=Math.max(i.to,r.to);n<=t&&t--,e.splice(--n,2,i.anchor>i.head?Qae.range(s,o):Qae.range(o,s))}}return new Qae(e,t)}}function ele(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let tle=0;class nle{constructor(e,t,n,i,r){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=i,this.id=tle++,this.default=e([]),this.extensions="function"==typeof r?r(this):r}get reader(){return this}static define(e={}){return new nle(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(e.combine?(e,t)=>e===t:ile),!!e.static,e.enables)}of(e){return new rle([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new rle(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new rle(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],n=>t(n.field(e)))}}function ile(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}class rle{constructor(e,t,n,i){this.dependencies=e,this.facet=t,this.type=n,this.value=i,this.id=tle++}dynamicSlot(e){var t;let n=this.value,i=this.facet.compareInput,r=this.id,o=e[r]>>1,s=2==this.type,a=!1,l=!1,c=[];for(let n of this.dependencies)"doc"==n?a=!0:"selection"==n?l=!0:1&(null!==(t=e[n.id])&&void 0!==t?t:1)||c.push(e[n.id]);return{create:e=>(e.values[o]=n(e),1),update(e,t){if(a&&t.docChanged||l&&(t.docChanged||t.selection)||sle(e,c)){let t=n(e);if(s?!ole(t,e.values[o],i):!i(t,e.values[o]))return e.values[o]=t,1}return 0},reconfigure:(e,t)=>{let a,l=t.config.address[r];if(null!=l){let r=ble(t,l);if(this.dependencies.every(n=>n instanceof nle?t.facet(n)===e.facet(n):!(n instanceof cle)||t.field(n,!1)==e.field(n,!1))||(s?ole(a=n(e),r,i):i(a=n(e),r)))return e.values[o]=r,0}else a=n(e);return e.values[o]=a,1}}}}function ole(e,t,n){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++)if(!n(e[i],t[i]))return!1;return!0}function sle(e,t){let n=!1;for(let i of t)1&gle(e,i)&&(n=!0);return n}function ale(e,t,n){let i=n.map(t=>e[t.id]),r=n.map(e=>e.type),o=i.filter(e=>!(1&e)),s=e[t.id]>>1;function a(e){let n=[];for(let t=0;t<i.length;t++){let o=ble(e,i[t]);if(2==r[t])for(let e of o)n.push(e);else n.push(o)}return t.combine(n)}return{create(e){for(let t of i)gle(e,t);return e.values[s]=a(e),1},update(e,n){if(!sle(e,o))return 0;let i=a(e);return t.compare(i,e.values[s])?0:(e.values[s]=i,1)},reconfigure(e,r){let o=sle(e,i),l=r.config.facets[t.id],c=r.facet(t);if(l&&!o&&ile(n,l))return e.values[s]=c,0;let u=a(e);return t.compare(u,c)?(e.values[s]=c,0):(e.values[s]=u,1)}}}const lle=nle.define({static:!0});class cle{constructor(e,t,n,i,r){this.id=e,this.createF=t,this.updateF=n,this.compareF=i,this.spec=r,this.provides=void 0}static define(e){let t=new cle(tle++,e.create,e.update,e.compare||((e,t)=>e===t),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(lle).find(e=>e.field==this);return((null==t?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let i=e.values[t],r=this.updateF(i,n);return this.compareF(i,r)?0:(e.values[t]=r,1)},reconfigure:(e,n)=>null!=n.config.address[this.id]?(e.values[t]=n.field(this),0):(e.values[t]=this.create(e),1)}}init(e){return[this,lle.of({field:this,create:e})]}get extension(){return this}}function ule(e){return t=>new hle(t,e)}const dle={highest:ule(0),high:ule(1),default:ule(2),low:ule(3),lowest:ule(4)};class hle{constructor(e,t){this.inner=e,this.prec=t}}class ple{of(e){return new fle(this,e)}reconfigure(e){return ple.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class fle{constructor(e,t){this.compartment=e,this.inner=t}}class mle{constructor(e,t,n,i,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=i,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return null==t?e.default:this.staticValues[t>>1]}static resolve(e,t,n){let i=[],r=Object.create(null),o=new Map;for(let n of function(e,t,n){let i=[[],[],[],[],[]],r=new Map;return function e(o,s){let a=r.get(o);if(null!=a){if(a<=s)return;let e=i[a].indexOf(o);e>-1&&i[a].splice(e,1),o instanceof fle&&n.delete(o.compartment)}if(r.set(o,s),Array.isArray(o))for(let t of o)e(t,s);else if(o instanceof fle){if(n.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let i=t.get(o.compartment)||o.inner;n.set(o.compartment,i),e(i,s)}else if(o instanceof hle)e(o.inner,o.prec);else if(o instanceof cle)i[s].push(o),o.provides&&e(o.provides,s);else if(o instanceof rle)i[s].push(o),o.facet.extensions&&e(o.facet.extensions,2);else{let t=o.extension;if(!t)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);e(t,s)}}(e,2),i.reduce((e,t)=>e.concat(t))}(e,t,o))n instanceof cle?i.push(n):(r[n.facet.id]||(r[n.facet.id]=[])).push(n);let s=Object.create(null),a=[],l=[];for(let e of i)s[e.id]=l.length<<1,l.push(t=>e.slot(t));let c=null==n?void 0:n.config.facets;for(let e in r){let t=r[e],i=t[0].facet,o=c&&c[e]||[];if(t.every(e=>0==e.type))if(s[i.id]=a.length<<1|1,ile(o,t))a.push(n.facet(i));else{let e=i.combine(t.map(e=>e.value));a.push(n&&i.compare(e,n.facet(i))?n.facet(i):e)}else{for(let e of t)0==e.type?(s[e.id]=a.length<<1|1,a.push(e.value)):(s[e.id]=l.length<<1,l.push(t=>e.dynamicSlot(t)));s[i.id]=l.length<<1,l.push(e=>ale(e,i,t))}}let u=l.map(e=>e(s));return new mle(e,o,u,s,a,r)}}function gle(e,t){if(1&t)return 2;let n=t>>1,i=e.status[n];if(4==i)throw new Error("Cyclic dependency between fields and/or facets");if(2&i)return i;e.status[n]=4;let r=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|r}function ble(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}const yle=nle.define(),vle=nle.define({combine:e=>e.some(e=>e),static:!0}),_le=nle.define({combine:e=>e.length?e[0]:void 0,static:!0}),xle=nle.define(),kle=nle.define(),wle=nle.define(),Cle=nle.define({combine:e=>!!e.length&&e[0]});class Sle{constructor(e,t){this.type=e,this.value=t}static define(){return new Ale}}class Ale{of(e){return new Sle(this,e)}}class Ile{constructor(e){this.map=e}of(e){return new Ele(this,e)}}class Ele{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return void 0===t?void 0:t==this.value?this:new Ele(this.type,t)}is(e){return this.type==e}static define(e={}){return new Ile(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let i of e){let e=i.map(t);e&&n.push(e)}return n}}Ele.reconfigure=Ele.define(),Ele.appendConfig=Ele.define();class jle{constructor(e,t,n,i,r,o){this.startState=e,this.changes=t,this.selection=n,this.effects=i,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,n&&ele(n,t.newLength),r.some(e=>e.type==jle.time)||(this.annotations=r.concat(jle.time.of(Date.now())))}static create(e,t,n,i,r,o){return new jle(e,t,n,i,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(jle.userEvent);return!(!t||!(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function Tle(e,t){let n=[];for(let i=0,r=0;;){let o,s;if(i<e.length&&(r==t.length||t[r]>=e[i]))o=e[i++],s=e[i++];else{if(!(r<t.length))return n;o=t[r++],s=t[r++]}!n.length||n[n.length-1]<o?n.push(o,s):n[n.length-1]<s&&(n[n.length-1]=s)}}function Ble(e,t,n){var i;let r,o,s;return n?(r=t.changes,o=Wae.empty(t.changes.length),s=e.changes.compose(t.changes)):(r=t.changes.map(e.changes),o=e.changes.mapDesc(t.changes,!0),s=e.changes.compose(r)),{changes:s,selection:t.selection?t.selection.map(o):null===(i=e.selection)||void 0===i?void 0:i.map(r),effects:Ele.mapEffects(e.effects,r).concat(Ele.mapEffects(t.effects,o)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function Nle(e,t,n){let i=t.selection,r=Lle(t.annotations);return t.userEvent&&(r=r.concat(jle.userEvent.of(t.userEvent))),{changes:t.changes instanceof Wae?t.changes:Wae.of(t.changes||[],n,e.facet(_le)),selection:i&&(i instanceof Qae?i:Qae.single(i.anchor,i.head)),effects:Lle(t.effects),annotations:r,scrollIntoView:!!t.scrollIntoView}}function Rle(e,t,n){let i=Nle(e,t.length?t[0]:{},e.doc.length);t.length&&!1===t[0].filter&&(n=!1);for(let r=1;r<t.length;r++){!1===t[r].filter&&(n=!1);let o=!!t[r].sequential;i=Ble(i,Nle(e,t[r],o?i.changes.newLength:e.doc.length),o)}let r=jle.create(e,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return function(e){let t=e.startState,n=t.facet(wle),i=e;for(let r=n.length-1;r>=0;r--){let o=n[r](e);o&&Object.keys(o).length&&(i=Ble(i,Nle(t,o,e.changes.newLength),!0))}return i==e?e:jle.create(t,e.changes,e.selection,i.effects,i.annotations,i.scrollIntoView)}(n?function(e){let t=e.startState,n=!0;for(let i of t.facet(xle)){let t=i(e);if(!1===t){n=!1;break}Array.isArray(t)&&(n=!0===n?t:Tle(n,t))}if(!0!==n){let i,r;if(!1===n)r=e.changes.invertedDesc,i=Wae.empty(t.doc.length);else{let t=e.changes.filter(n);i=t.changes,r=t.filtered.mapDesc(t.changes).invertedDesc}e=jle.create(t,i,e.selection&&e.selection.map(r),Ele.mapEffects(e.effects,r),e.annotations,e.scrollIntoView)}let i=t.facet(kle);for(let n=i.length-1;n>=0;n--){let r=i[n](e);e=r instanceof jle?r:Array.isArray(r)&&1==r.length&&r[0]instanceof jle?r[0]:Rle(t,Lle(r),!1)}return e}(r):r)}jle.time=Sle.define(),jle.userEvent=Sle.define(),jle.addToHistory=Sle.define(),jle.remote=Sle.define();const Ole=[];function Lle(e){return null==e?Ole:Array.isArray(e)?e:[e]}var Mle=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(Mle||(Mle={}));const Ple=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Dle;try{Dle=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(SH){}class Fle{constructor(e,t,n,i,r,o){this.config=e,this.doc=t,this.selection=n,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)gle(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(null!=n)return gle(this,n),ble(this,n);if(t)throw new RangeError("Field is not present in this state")}update(...e){return Rle(this,e,!0)}applyTransaction(e){let t,n=this.config,{base:i,compartments:r}=n;for(let t of e.effects)t.is(ple.reconfigure)?(n&&(r=new Map,n.compartments.forEach((e,t)=>r.set(t,e)),n=null),r.set(t.value.compartment,t.value.extension)):t.is(Ele.reconfigure)?(n=null,i=t.value):t.is(Ele.appendConfig)&&(n=null,i=Lle(i).concat(t.value));n?t=e.startState.values.slice():(n=mle.resolve(i,r,this),t=new Fle(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values);let o=e.startState.facet(vle)?e.newSelection:e.newSelection.asSingle();new Fle(n,e.newDoc,o,t,(t,n)=>n.update(t,e),e)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:Qae.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),i=this.changes(n.changes),r=[n.range],o=Lle(n.effects);for(let n=1;n<t.ranges.length;n++){let s=e(t.ranges[n]),a=this.changes(s.changes),l=a.map(i);for(let e=0;e<n;e++)r[e]=r[e].map(l);let c=i.mapDesc(a,!0);r.push(s.range.map(c)),i=i.compose(l),o=Ele.mapEffects(o,l).concat(Ele.mapEffects(Lle(s.effects),c))}return{changes:i,selection:Qae.create(r,t.mainIndex),effects:o}}changes(e=[]){return e instanceof Wae?e:Wae.of(e,this.doc.length,this.facet(Fle.lineSeparator))}toText(e){return xae.of(e.split(this.facet(Fle.lineSeparator)||Uae))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return null==t?e.default:(gle(this,t),ble(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let i=e[n];i instanceof cle&&null!=this.config.address[i.id]&&(t[n]=i.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(e,t={},n){if(!e||"string"!=typeof e.doc)throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(n)for(let t in n)if(Object.prototype.hasOwnProperty.call(e,t)){let r=n[t],o=e[t];i.push(r.init(e=>r.spec.fromJSON(o,e)))}return Fle.create({doc:e.doc,selection:Qae.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=mle.resolve(e.extensions||[],new Map),n=e.doc instanceof xae?e.doc:xae.of((e.doc||"").split(t.staticFacet(Fle.lineSeparator)||Uae)),i=e.selection?e.selection instanceof Qae?e.selection:Qae.single(e.selection.anchor,e.selection.head):Qae.single(0);return ele(i,n.length),t.staticFacet(vle)||(i=i.asSingle()),new Fle(t,n,i,t.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(Fle.tabSize)}get lineBreak(){return this.facet(Fle.lineSeparator)||"\n"}get readOnly(){return this.facet(Cle)}phrase(e,...t){for(let t of this.facet(Fle.phrases))if(Object.prototype.hasOwnProperty.call(t,e)){e=t[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(e,n)=>{if("$"==n)return"$";let i=+(n||1);return!i||i>t.length?e:t[i-1]})),e}languageDataAt(e,t,n=-1){let i=[];for(let r of this.facet(yle))for(let o of r(this,t,n))Object.prototype.hasOwnProperty.call(o,e)&&i.push(o[e]);return i}charCategorizer(e){return t=this.languageDataAt("wordChars",e).join(""),e=>{if(!/\S/.test(e))return Mle.Space;if(function(e){if(Dle)return Dle.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||Ple.test(n)))return!0}return!1}(e))return Mle.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return Mle.Word;return Mle.Other};var t}wordAt(e){let{text:t,from:n,length:i}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-n,s=e-n;for(;o>0;){let e=Oae(t,o,!1);if(r(t.slice(e,o))!=Mle.Word)break;o=e}for(;s<i;){let e=Oae(t,s);if(r(t.slice(s,e))!=Mle.Word)break;s=e}return o==s?null:Qae.range(o+n,s+n)}}function zle(e,t,n={}){let i={};for(let t of e)for(let e of Object.keys(t)){let r=t[e],o=i[e];if(void 0===o)i[e]=r;else if(o===r||void 0===r);else{if(!Object.hasOwnProperty.call(n,e))throw new Error("Config merge conflict for field "+e);i[e]=n[e](o,r)}}for(let e in t)void 0===i[e]&&(i[e]=t[e]);return i}Fle.allowMultipleSelections=vle,Fle.tabSize=nle.define({combine:e=>e.length?e[0]:4}),Fle.lineSeparator=_le,Fle.readOnly=Cle,Fle.phrases=nle.define({compare(e,t){let n=Object.keys(e),i=Object.keys(t);return n.length==i.length&&n.every(n=>e[n]==t[n])}}),Fle.languageData=yle,Fle.changeFilter=xle,Fle.transactionFilter=kle,Fle.transactionExtender=wle,ple.reconfigure=Ele.define();class Vle{eq(e){return this==e}range(e,t=e){return Ule.create(e,t,this)}}Vle.prototype.startSide=Vle.prototype.endSide=0,Vle.prototype.point=!1,Vle.prototype.mapMode=$ae.TrackDel;class Ule{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new Ule(e,t,n)}}function $le(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class Hle{constructor(e,t,n,i){this.from=e,this.to=t,this.value=n,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,i=0){let r=n?this.to:this.from;for(let o=i,s=r.length;;){if(o==s)return o;let i=o+s>>1,a=r[i]-e||(n?this.value[i].endSide:this.value[i].startSide)-t;if(i==o)return a>=0?o:s;a>=0?s=i:o=i+1}}between(e,t,n,i){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,r);r<o;r++)if(!1===i(this.from[r]+e,this.to[r]+e,this.value[r]))return!1}map(e,t){let n=[],i=[],r=[],o=-1,s=-1;for(let a=0;a<this.value.length;a++){let l,c,u=this.value[a],d=this.from[a]+e,h=this.to[a]+e;if(d==h){let e=t.mapPos(d,u.startSide,u.mapMode);if(null==e)continue;if(l=c=e,u.startSide!=u.endSide&&(c=t.mapPos(d,u.endSide),c<l))continue}else if(l=t.mapPos(d,u.startSide),c=t.mapPos(h,u.endSide),l>c||l==c&&u.startSide>0&&u.endSide<=0)continue;(c-l||u.endSide-u.startSide)<0||(o<0&&(o=l),u.point&&(s=Math.max(s,c-l)),n.push(u),i.push(l-o),r.push(c-o))}return{mapped:n.length?new Hle(i,r,n,s):null,pos:o}}}class Wle{constructor(e,t,n,i){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=i}static create(e,t,n,i){return new Wle(e,t,n,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:i=0,filterTo:r=this.length}=e,o=e.filter;if(0==t.length&&!o)return this;if(n&&(t=t.slice().sort($le)),this.isEmpty)return t.length?Wle.of(t):this;let s=new Kle(this,null,-1).goto(0),a=0,l=[],c=new Gle;for(;s.value||a<t.length;)if(a<t.length&&(s.from-t[a].from||s.startSide-t[a].value.startSide)>=0){let e=t[a++];c.addInner(e.from,e.to,e.value)||l.push(e)}else 1==s.rangeIndex&&s.chunkIndex<this.chunk.length&&(a==t.length||this.chunkEnd(s.chunkIndex)<t[a].from)&&(!o||i>this.chunkEnd(s.chunkIndex)||r<this.chunkPos[s.chunkIndex])&&c.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!o||i>s.to||r<s.from||o(s.from,s.to,s.value))&&(c.addInner(s.from,s.to,s.value)||l.push(Ule.create(s.from,s.to,s.value))),s.next());return c.finishInner(this.nextLayer.isEmpty&&!l.length?Wle.empty:this.nextLayer.update({add:l,filter:o,filterFrom:i,filterTo:r}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],n=[],i=-1;for(let r=0;r<this.chunk.length;r++){let o=this.chunkPos[r],s=this.chunk[r],a=e.touchesRange(o,o+s.length);if(!1===a)i=Math.max(i,s.maxPoint),t.push(s),n.push(e.mapPos(o));else if(!0===a){let{mapped:r,pos:a}=s.map(o,e);r&&(i=Math.max(i,r.maxPoint),t.push(r),n.push(a))}}let r=this.nextLayer.map(e);return 0==t.length?r:new Wle(n,t,r||Wle.empty,i)}between(e,t,n){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let r=this.chunkPos[i],o=this.chunk[i];if(t>=r&&e<=r+o.length&&!1===o.between(r,e-r,t-r,n))return}this.nextLayer.between(e,t,n)}}iter(e=0){return Yle.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Yle.from(e).goto(t)}static compare(e,t,n,i,r=-1){let o=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r),s=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r),a=qle(o,s,n),l=new Xle(o,a,r),c=new Xle(s,a,r);n.iterGaps((e,t,n)=>Zle(l,e,c,t,n,i)),n.empty&&0==n.length&&Zle(l,0,c,0,0,i)}static eq(e,t,n=0,i){null==i&&(i=999999999);let r=e.filter(e=>!e.isEmpty&&t.indexOf(e)<0),o=t.filter(t=>!t.isEmpty&&e.indexOf(t)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let s=qle(r,o),a=new Xle(r,s,0).goto(n),l=new Xle(o,s,0).goto(n);for(;;){if(a.to!=l.to||!Qle(a.active,l.active)||a.point&&(!l.point||!a.point.eq(l.point)))return!1;if(a.to>i)return!0;a.next(),l.next()}}static spans(e,t,n,i,r=-1){let o=new Xle(e,null,r).goto(t),s=t,a=o.openStart;for(;;){let e=Math.min(o.to,n);if(o.point){let n=o.activeForPoint(o.to),r=o.pointFrom<t?n.length+1:o.point.startSide<0?n.length:Math.min(n.length,a);i.point(s,e,o.point,n,r,o.pointRank),a=Math.min(o.openEnd(e),n.length)}else e>s&&(i.span(s,e,o.active,a),a=o.openEnd(e));if(o.to>n)return a+(o.point&&o.to>n?1:0);s=o.to,o.next()}}static of(e,t=!1){let n=new Gle;for(let i of e instanceof Ule?[e]:t?function(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let i=e[n];if($le(t,i)>0)return e.slice().sort($le);t=i}return e}(e):e)n.add(i.from,i.to,i.value);return n.finish()}static join(e){if(!e.length)return Wle.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let i=e[n];i!=Wle.empty;i=i.nextLayer)t=new Wle(i.chunkPos,i.chunk,t,Math.max(i.maxPoint,t.maxPoint));return t}}Wle.empty=new Wle([],[],null,-1),Wle.empty.nextLayer=Wle.empty;class Gle{finishChunk(e){this.chunks.push(new Hle(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new Gle)).add(e,t,n)}addInner(e,t,n){let i=e-this.lastTo||n.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(i<0||(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),0))}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(Wle.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=Wle.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function qle(e,t,n){let i=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&i.set(t.chunk[e],t.chunkPos[e]);let r=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let o=i.get(e.chunk[t]);null==o||(n?n.mapPos(o):o)!=e.chunkPos[t]||(null==n?void 0:n.touchesRange(o,o+e.chunk[t].length))||r.add(e.chunk[t])}return r}class Kle{constructor(e,t,n,i=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;){if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Yle{constructor(e){this.heap=e}static from(e,t=null,n=-1){let i=[];for(let r=0;r<e.length;r++)for(let o=e[r];!o.isEmpty;o=o.nextLayer)o.maxPoint>=n&&i.push(new Kle(o,t,n,r));return 1==i.length?i[0]:new Yle(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)Jle(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)Jle(this.heap,e);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Jle(this.heap,0)}}}function Jle(e,t){for(let n=e[t];;){let i=1+(t<<1);if(i>=e.length)break;let r=e[i];if(i+1<e.length&&r.compare(e[i+1])>=0&&(r=e[i+1],i++),n.compare(r)<0)break;e[i]=n,e[t]=r,t=i}}class Xle{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Yle.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){ece(this.active,e),ece(this.activeTo,e),ece(this.activeRank,e),this.minActive=nce(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:i,rank:r}=this.cursor;for(;t<this.activeRank.length&&(r-this.activeRank[t]||i-this.activeTo[t])>0;)t++;tce(this.active,t,n),tce(this.activeTo,t,i),tce(this.activeRank,t,r),e&&tce(e,t,this.cursor.from),this.minActive=nce(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),n&&ece(n,i)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let e=this.cursor.value;if(e.point){if(!(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)){this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}this.cursor.next()}else this.addActive(n),this.cursor.next()}}}if(n){this.openStart=0;for(let t=n.length-1;t>=0&&n[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function Zle(e,t,n,i,r,o){e.goto(t),n.goto(i);let s=i+r,a=i,l=i-t;for(;;){let t=e.to+l-n.to||e.endSide-n.endSide,i=t<0?e.to+l:n.to,r=Math.min(i,s);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))&&Qle(e.activeForPoint(e.to),n.activeForPoint(n.to))||o.comparePoint(a,r,e.point,n.point):r>a&&!Qle(e.active,n.active)&&o.compareRange(a,r,e.active,n.active),i>s)break;a=i,t<=0&&e.next(),t>=0&&n.next()}}function Qle(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!e[n].eq(t[n]))return!1;return!0}function ece(e,t){for(let n=t,i=e.length-1;n<i;n++)e[n]=e[n+1];e.pop()}function tce(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function nce(e,t){let n=-1,i=1e9;for(let r=0;r<t.length;r++)(t[r]-i||e[r].endSide-e[n].endSide)<0&&(n=r,i=t[r]);return n}function ice(e,t,n=e.length){let i=0;for(let r=0;r<n;)9==e.charCodeAt(r)?(i+=t-i%t,r++):(i++,r=Oae(e,r));return i}function rce(e,t,n,i){for(let i=0,r=0;;){if(r>=t)return i;if(i==e.length)break;r+=9==e.charCodeAt(i)?n-r%n:1,i=Oae(e,i)}return!0===i?-1:e.length}const oce="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),sce="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),ace="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class lce{constructor(e,t){this.rules=[];let{finish:n}=t||{};function i(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function r(e,t,o,s){let a=[],l=/^@(\w+)\b/.exec(e[0]),c=l&&"keyframes"==l[1];if(l&&null==t)return o.push(e[0]+";");for(let n in t){let s=t[n];if(/&/.test(n))r(n.split(/,\s*/).map(t=>e.map(e=>t.replace(/&/,e))).reduce((e,t)=>e.concat(t)),s,o);else if(s&&"object"==typeof s){if(!l)throw new RangeError("The value of a property ("+n+") should be a primitive value.");r(i(n),s,a,c)}else null!=s&&a.push(n.replace(/_.*/,"").replace(/[A-Z]/g,e=>"-"+e.toLowerCase())+": "+s+";")}(a.length||c)&&o.push((!n||l||s?e:e.map(n)).join(", ")+" {"+a.join(" ")+"}")}for(let t in e)r(i(t),e[t],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=ace[oce]||1;return ace[oce]=e+1,"ͼ"+e.toString(36)}static mount(e,t,n){let i=e[sce],r=n&&n.nonce;i?r&&i.setNonce(r):i=new uce(e,r),i.mount(Array.isArray(t)?t:[t],e)}}let cce=new Map;class uce{constructor(e,t){let n=e.ownerDocument||e,i=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let t=cce.get(n);if(t)return e[sce]=t;this.sheet=new i.CSSStyleSheet,cce.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[sce]=this}mount(e,t){let n=this.sheet,i=0,r=0;for(let t=0;t<e.length;t++){let o=e[t],s=this.modules.indexOf(o);if(s<r&&s>-1&&(this.modules.splice(s,1),r--,s=-1),-1==s){if(this.modules.splice(r++,0,o),n)for(let e=0;e<o.rules.length;e++)n.insertRule(o.rules[e],i++)}else{for(;r<s;)i+=this.modules[r++].rules.length;i+=o.rules.length,r++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let e="";for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+"\n";this.styleTag.textContent=e;let n=t.head||t;this.styleTag.parentNode!=n&&n.insertBefore(this.styleTag,n.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}for(var dce={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},hce={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},pce="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),fce="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),mce=0;mce<10;mce++)dce[48+mce]=dce[96+mce]=String(mce);for(mce=1;mce<=24;mce++)dce[mce+111]="F"+mce;for(mce=65;mce<=90;mce++)dce[mce]=String.fromCharCode(mce+32),hce[mce]=String.fromCharCode(mce);for(var gce in dce)hce.hasOwnProperty(gce)||(hce[gce]=dce[gce]);function bce(e){let t;return t=11==e.nodeType?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function yce(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function vce(e,t){if(!t.anchorNode)return!1;try{return yce(e,t.anchorNode)}catch(e){return!1}}function _ce(e){return 3==e.nodeType?Rce(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function xce(e,t,n,i){return!!n&&(Cce(e,t,n,i,-1)||Cce(e,t,n,i,1))}function kce(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function wce(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function Cce(e,t,n,i,r){for(;;){if(e==n&&t==i)return!0;if(t==(r<0?0:Sce(e))){if("DIV"==e.nodeName)return!1;let n=e.parentNode;if(!n||1!=n.nodeType)return!1;t=kce(e)+(r<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if(1==(e=e.childNodes[t+(r<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=r<0?Sce(e):0}}}function Sce(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Ace(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function Ice(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function Ece(e,t){let n=t.width/e.offsetWidth,i=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(t.height-e.offsetHeight)<1)&&(i=1),{scaleX:n,scaleY:i}}class jce{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?Sce(t):0),n,Math.min(e.focusOffset,n?Sce(n):0))}set(e,t,n,i){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=i}}let Tce,Bce=null;function Nce(e){if(e.setActive)return e.setActive();if(Bce)return e.focus(Bce);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==Bce?{get preventScroll(){return Bce={preventScroll:!0},!0}}:void 0),!Bce){Bce=!1;for(let e=0;e<t.length;){let n=t[e++],i=t[e++],r=t[e++];n.scrollTop!=i&&(n.scrollTop=i),n.scrollLeft!=r&&(n.scrollLeft=r)}}}function Rce(e,t,n=t){let i=Tce||(Tce=document.createRange());return i.setEnd(e,n),i.setStart(e,t),i}function Oce(e,t,n,i){let r={key:t,code:t,keyCode:n,which:n,cancelable:!0};i&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=i);let o=new KeyboardEvent("keydown",r);o.synthetic=!0,e.dispatchEvent(o);let s=new KeyboardEvent("keyup",r);return s.synthetic=!0,e.dispatchEvent(s),o.defaultPrevented||s.defaultPrevented}function Lce(e){for(;e.attributes.length;)e.removeAttributeNode(e.attributes[0])}function Mce(e){return e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function Pce(e,t){for(let n=e,i=t;;){if(3==n.nodeType&&i>0)return{node:n,offset:i};if(1==n.nodeType&&i>0){if("false"==n.contentEditable)return null;n=n.childNodes[i-1],i=Sce(n)}else{if(!n.parentNode||wce(n))return null;i=kce(n),n=n.parentNode}}}function Dce(e,t){for(let n=e,i=t;;){if(3==n.nodeType&&i<n.nodeValue.length)return{node:n,offset:i};if(1==n.nodeType&&i<n.childNodes.length){if("false"==n.contentEditable)return null;n=n.childNodes[i],i=0}else{if(!n.parentNode||wce(n))return null;i=kce(n)+1,n=n.parentNode}}}class Fce{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new Fce(e.parentNode,kce(e),t)}static after(e,t){return new Fce(e.parentNode,kce(e)+1,t)}}const zce=[];class Vce{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let n of this.children){if(n==e)return t;t+=n.length+n.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(2&this.flags){let n,i=this.dom,r=null;for(let o of this.children){if(7&o.flags){if(!o.dom&&(n=r?r.nextSibling:i.firstChild)){let e=Vce.get(n);(!e||!e.parent&&e.canReuseDOM(o))&&o.reuseDOM(n)}o.sync(e,t),o.flags&=-8}if(n=r?r.nextSibling:i.firstChild,t&&!t.written&&t.node==i&&n!=o.dom&&(t.written=!0),o.dom.parentNode==i)for(;n&&n!=o.dom;)n=Uce(n);else i.insertBefore(o.dom,n);r=o.dom}for(n=r?r.nextSibling:i.firstChild,n&&t&&t.node==i&&(t.written=!0);n;)n=Uce(n)}else if(1&this.flags)for(let n of this.children)7&n.flags&&(n.sync(e,t),n.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let n;if(e==this.dom)n=this.dom.childNodes[t];else{let i=0==Sce(e)?0:0==t?-1:1;for(;;){let t=e.parentNode;if(t==this.dom)break;0==i&&t.firstChild!=t.lastChild&&(i=e==t.firstChild?-1:1),e=t}n=i<0?e:e.nextSibling}if(n==this.dom.firstChild)return 0;for(;n&&!Vce.get(n);)n=n.nextSibling;if(!n)return this.length;for(let e=0,t=0;;e++){let i=this.children[e];if(i.dom==n)return t;t+=i.length+i.breakAfter}}domBoundsAround(e,t,n=0){let i=-1,r=-1,o=-1,s=-1;for(let a=0,l=n,c=n;a<this.children.length;a++){let n=this.children[a],u=l+n.length;if(l<e&&u>t)return n.domBoundsAround(e,t,l);if(u>=e&&-1==i&&(i=a,r=l),l>t&&n.dom.parentNode==this.dom){o=a,s=c;break}c=u,l=u+n.breakAfter}return{from:r,to:s<0?n+this.length:s,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o<this.children.length&&o>=0?this.children[o].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),1&t.flags)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,7&this.flags&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,n=zce){this.markDirty();for(let i=e;i<t;i++){let e=this.children[i];e.parent==this&&n.indexOf(e)<0&&e.destroy()}this.children.splice(e,t-e,...n);for(let e=0;e<n.length;e++)n[e].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new $ce(this.children,e,this.children.length)}childPos(e,t=1){return this.childCursor().findPos(e,t)}toString(){let e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+("Text"==e?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(e){return e.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(e,t,n,i,r,o){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!(8&(this.flags|e.flags))}getSide(){return 0}destroy(){for(let e of this.children)e.parent==this&&e.destroy();this.parent=null}}function Uce(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}Vce.prototype.breakAfter=0;class $ce{constructor(e,t,n){this.children=e,this.pos=t,this.i=n,this.off=0}findPos(e,t=1){for(;;){if(e>this.pos||e==this.pos&&(t>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}function Hce(e,t,n,i,r,o,s,a,l){let{children:c}=e,u=c.length?c[t]:null,d=o.length?o[o.length-1]:null,h=d?d.breakAfter:s;if(!(t==i&&u&&!s&&!h&&o.length<2&&u.merge(n,r,o.length?d:null,0==n,a,l))){if(i<c.length){let e=c[i];e&&(r<e.length||e.breakAfter&&(null==d?void 0:d.breakAfter))?(t==i&&(e=e.split(r),r=0),!h&&d&&e.merge(0,r,d,!0,0,l)?o[o.length-1]=e:((r||e.children.length&&!e.children[0].length)&&e.merge(0,r,null,!1,0,l),o.push(e))):(null==e?void 0:e.breakAfter)&&(d?d.breakAfter=1:s=1),i++}for(u&&(u.breakAfter=s,n>0&&(!s&&o.length&&u.merge(n,u.length,o[0],!1,a,0)?u.breakAfter=o.shift().breakAfter:(n<u.length||u.children.length&&0==u.children[u.children.length-1].length)&&u.merge(n,u.length,null,!1,a,0),t++));t<i&&o.length;)if(c[i-1].become(o[o.length-1]))i--,o.pop(),l=o.length?0:a;else{if(!c[t].become(o[0]))break;t++,o.shift(),a=o.length?0:l}!o.length&&t&&i<c.length&&!c[t-1].breakAfter&&c[i].merge(0,0,c[t-1],!1,a,l)&&t--,(t<i||o.length)&&e.replaceChildren(t,i,o)}}function Wce(e,t,n,i,r,o){let s=e.childCursor(),{i:a,off:l}=s.findPos(n,1),{i:c,off:u}=s.findPos(t,-1),d=t-n;for(let e of i)d+=e.length;e.length+=d,Hce(e,c,u,a,l,i,0,r,o)}let Gce="undefined"!=typeof navigator?navigator:{userAgent:"",vendor:"",platform:""},qce="undefined"!=typeof document?document:{documentElement:{style:{}}};const Kce=/Edge\/(\d+)/.exec(Gce.userAgent),Yce=/MSIE \d/.test(Gce.userAgent),Jce=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Gce.userAgent),Xce=!!(Yce||Jce||Kce),Zce=!Xce&&/gecko\/(\d+)/i.test(Gce.userAgent),Qce=!Xce&&/Chrome\/(\d+)/.exec(Gce.userAgent),eue="webkitFontSmoothing"in qce.documentElement.style,tue=!Xce&&/Apple Computer/.test(Gce.vendor),nue=tue&&(/Mobile\/\w+/.test(Gce.userAgent)||Gce.maxTouchPoints>2);var iue={mac:nue||/Mac/.test(Gce.platform),windows:/Win/.test(Gce.platform),linux:/Linux|X11/.test(Gce.platform),ie:Xce,ie_version:Yce?qce.documentMode||6:Jce?+Jce[1]:Kce?+Kce[1]:0,gecko:Zce,gecko_version:Zce?+(/Firefox\/(\d+)/.exec(Gce.userAgent)||[0,0])[1]:0,chrome:!!Qce,chrome_version:Qce?+Qce[1]:0,ios:nue,android:/Android\b/.test(Gce.userAgent),webkit:eue,safari:tue,webkit_version:eue?+(/\bAppleWebKit\/(\d+)/.exec(Gce.userAgent)||[0,0])[1]:0,tabSize:null!=qce.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};class rue extends Vce{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){3==e.nodeType&&this.createDOM(e)}merge(e,t,n){return!(8&this.flags||n&&(!(n instanceof rue)||this.length-(t-e)+n.length>256||8&n.flags)||(this.text=this.text.slice(0,e)+(n?n.text:"")+this.text.slice(t),this.markDirty(),0))}split(e){let t=new rue(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=8&this.flags,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new Fce(this.dom,e)}domBoundsAround(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return function(e,t,n){let i=e.nodeValue.length;t>i&&(t=i);let r=t,o=t,s=0;0==t&&n<0||t==i&&n>=0?iue.chrome||iue.gecko||(t?(r--,s=1):o<i&&(o++,s=-1)):n<0?r--:o<i&&o++;let a=Rce(e,r,o).getClientRects();if(!a.length)return null;let l=a[(s?s<0:n>=0)?0:a.length-1];return iue.safari&&!s&&0==l.width&&(l=Array.prototype.find.call(a,e=>e.width)||l),s?Ace(l,s<0):l||null}(this.dom,e,t)}}class oue extends Vce{constructor(e,t=[],n=0){super(),this.mark=e,this.children=t,this.length=n;for(let e of t)e.setParent(this)}setAttrs(e){if(Lce(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!(8&(this.flags|e.flags))}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?4&this.flags&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,n,i,r,o){return!(n&&(!(n instanceof oue&&n.mark.eq(this.mark))||e&&r<=0||t<this.length&&o<=0)||(Wce(this,e,t,n?n.children.slice():[],r-1,o-1),this.markDirty(),0))}split(e){let t=[],n=0,i=-1,r=0;for(let o of this.children){let s=n+o.length;s>e&&t.push(n<e?o.split(e-n):o),i<0&&n>=e&&(i=r),n=s,r++}let o=this.length-e;return this.length=e,i>-1&&(this.children.length=i,this.markDirty()),new oue(this.mark,t,o)}domAtPos(e){return lue(this,e)}coordsAt(e,t){return uue(this,e,t)}}class sue extends Vce{static create(e,t,n){return new sue(e,t,n)}constructor(e,t,n){super(),this.widget=e,this.length=t,this.side=n,this.prevWidget=null}split(e){let t=sue.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){this.dom&&this.widget.updateDOM(this.dom,e)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,n,i,r,o){return!(n&&(!(n instanceof sue&&this.widget.compare(n.widget))||e>0&&r<=0||t<this.length&&o<=0)||(this.length=e+(n?n.length:0)+(this.length-t),0))}become(e){return e instanceof sue&&e.side==this.side&&this.widget.constructor==e.widget.constructor&&(this.widget.compare(e.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,!0)}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get overrideDOMText(){if(0==this.length)return xae.empty;let e=this;for(;e.parent;)e=e.parent;let{view:t}=e,n=t&&t.state.doc,i=this.posAtStart;return n?n.slice(i,i+this.length):xae.empty}domAtPos(e){return(this.length?0==e:this.side>0)?Fce.before(this.dom):Fce.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);if(n)return n;let i=this.dom.getClientRects(),r=null;if(!i.length)return null;let o=this.side?this.side<0:e>0;for(let t=o?i.length-1:0;r=i[t],!(e>0?0==t:t==i.length-1||r.top<r.bottom);t+=o?-1:1);return Ace(r,!o)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class aue extends Vce{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof aue&&e.side==this.side}split(){return new aue(this.side)}sync(){if(!this.dom){let e=document.createElement("img");e.className="cm-widgetBuffer",e.setAttribute("aria-hidden","true"),this.setDOM(e)}}getSide(){return this.side}domAtPos(e){return this.side>0?Fce.before(this.dom):Fce.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return xae.empty}get isHidden(){return!0}}function lue(e,t){let n=e.dom,{children:i}=e,r=0;for(let e=0;r<i.length;r++){let o=i[r],s=e+o.length;if(!(s==e&&o.getSide()<=0)){if(t>e&&t<s&&o.dom.parentNode==n)return o.domAtPos(t-e);if(t<=e)break;e=s}}for(let e=r;e>0;e--){let t=i[e-1];if(t.dom.parentNode==n)return t.domAtPos(t.length)}for(let e=r;e<i.length;e++){let t=i[e];if(t.dom.parentNode==n)return t.domAtPos(0)}return new Fce(n,0)}function cue(e,t,n){let i,{children:r}=e;n>0&&t instanceof oue&&r.length&&(i=r[r.length-1])instanceof oue&&i.mark.eq(t.mark)?cue(i,t.children[0],n-1):(r.push(t),t.setParent(e)),e.length+=t.length}function uue(e,t,n){let i=null,r=-1,o=null,s=-1;!function e(t,a){for(let l=0,c=0;l<t.children.length&&c<=a;l++){let u=t.children[l],d=c+u.length;d>=a&&(u.children.length?e(u,a-c):(!o||o.isHidden&&n>0)&&(d>a||c==d&&u.getSide()>0)?(o=u,s=a-c):(c<a||c==d&&u.getSide()<0&&!u.isHidden)&&(i=u,r=a-c)),c=d}}(e,t);let a=(n<0?i:o)||i||o;return a?a.coordsAt(Math.max(0,a==i?r:s),n):function(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=_ce(t);return n[n.length-1]||null}(e)}function due(e,t){for(let n in e)"class"==n&&t.class?t.class+=" "+e.class:"style"==n&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}rue.prototype.children=sue.prototype.children=aue.prototype.children=zce;const hue=Object.create(null);function pue(e,t,n){if(e==t)return!0;e||(e=hue),t||(t=hue);let i=Object.keys(e),r=Object.keys(t);if(i.length-(n&&i.indexOf(n)>-1?1:0)!=r.length-(n&&r.indexOf(n)>-1?1:0))return!1;for(let o of i)if(o!=n&&(-1==r.indexOf(o)||e[o]!==t[o]))return!1;return!0}function fue(e,t,n){let i=!1;if(t)for(let r in t)n&&r in n||(i=!0,"style"==r?e.style.cssText="":e.removeAttribute(r));if(n)for(let r in n)t&&t[r]==n[r]||(i=!0,"style"==r?e.style.cssText=n[r]:e.setAttribute(r,n[r]));return i}function mue(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let i=e.attributes[n];t[i.name]=i.value}return t}class gue extends Vce{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,n,i,r,o){if(n){if(!(n instanceof gue))return!1;this.dom||n.transferDOM(this)}return i&&this.setDeco(n?n.attrs:null),Wce(this,e,t,n?n.children.slice():[],r,o),!0}split(e){let t=new gue;if(t.breakAfter=this.breakAfter,0==this.length)return t;let{i:n,off:i}=this.childPos(e);i&&(t.append(this.children[n].split(i),0),this.children[n].merge(i,this.children[n].length,null,!1,0,0),n++);for(let e=n;e<this.children.length;e++)t.append(this.children[e],0);for(;n>0&&0==this.children[n-1].length;)this.children[--n].destroy();return this.children.length=n,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){pue(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){cue(this,e,t)}addLineDeco(e){let t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=due(t,this.attrs||{})),n&&(this.attrs=due({class:n},this.attrs||{}))}domAtPos(e){return lue(this,e)}reuseDOM(e){"DIV"==e.nodeName&&(this.setDOM(e),this.flags|=6)}sync(e,t){var n;this.dom?4&this.flags&&(Lce(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(fue(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let i=this.dom.lastChild;for(;i&&Vce.get(i)instanceof oue;)i=i.lastChild;if(!(i&&this.length&&("BR"==i.nodeName||0!=(null===(n=Vce.get(i))||void 0===n?void 0:n.isEditable)||iue.ios&&this.children.some(e=>e instanceof rue)))){let e=document.createElement("BR");e.cmIgnore=!0,this.dom.appendChild(e)}}measureTextSize(){if(0==this.children.length||this.length>20)return null;let e,t=0;for(let n of this.children){if(!(n instanceof rue)||/[^ -~]/.test(n.text))return null;let i=_ce(n.dom);if(1!=i.length)return null;t+=i[0].width,e=i[0].height}return t?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:t/this.length,textHeight:e}:null}coordsAt(e,t){let n=uue(this,e,t);if(!this.children.length&&n&&this.parent){let{heightOracle:e}=this.parent.view.viewState,t=n.bottom-n.top;if(Math.abs(t-e.lineHeight)<2&&e.textHeight<t){let i=(t-e.textHeight)/2;return{top:n.top+i,bottom:n.bottom-i,left:n.left,right:n.left}}}return n}become(e){return e instanceof gue&&0==this.children.length&&0==e.children.length&&pue(this.attrs,e.attrs)&&this.breakAfter==e.breakAfter}covers(){return!0}static find(e,t){for(let n=0,i=0;n<e.children.length;n++){let r=e.children[n],o=i+r.length;if(o>=t){if(r instanceof gue)return r;if(o>t)break}i=o+r.breakAfter}return null}}class bue extends Vce{constructor(e,t,n){super(),this.widget=e,this.length=t,this.deco=n,this.breakAfter=0,this.prevWidget=null}merge(e,t,n,i,r,o){return!(n&&(!(n instanceof bue&&this.widget.compare(n.widget))||e>0&&r<=0||t<this.length&&o<=0)||(this.length=e+(n?n.length:0)+(this.length-t),0))}domAtPos(e){return 0==e?Fce.before(this.dom):Fce.after(this.dom,e==this.length)}split(e){let t=this.length-e;this.length=e;let n=new bue(this.widget,t,this.deco);return n.breakAfter=this.breakAfter,n}get children(){return zce}sync(e){this.dom&&this.widget.updateDOM(this.dom,e)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):xae.empty}domBoundsAround(){return null}become(e){return e instanceof bue&&e.widget.constructor==this.widget.constructor&&(e.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,this.deco=e.deco,this.breakAfter=e.breakAfter,!0)}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(e,t){return this.widget.coordsAt(this.dom,e,t)}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(e){let{startSide:t,endSide:n}=this.deco;return t!=n&&(e<0?t<0:n>0)}}class yue{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var vue=function(e){return e[e.Text=0]="Text",e[e.WidgetBefore=1]="WidgetBefore",e[e.WidgetAfter=2]="WidgetAfter",e[e.WidgetRange=3]="WidgetRange",e}(vue||(vue={}));class _ue extends Vle{constructor(e,t,n,i){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=i}get heightRelevant(){return!1}static mark(e){return new xue(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new wue(e,t,t,n,e.widget||null,!1)}static replace(e){let t,n,i=!!e.block;if(e.isBlockGap)t=-5e8,n=4e8;else{let{start:r,end:o}=Cue(e,i);t=(r?i?-3e8:-1:5e8)-1,n=1+(o?i?2e8:1:-6e8)}return new wue(e,t,n,i,e.widget||null,!0)}static line(e){return new kue(e)}static set(e,t=!1){return Wle.of(e,t)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}_ue.none=Wle.empty;class xue extends _ue{constructor(e){let{start:t,end:n}=Cue(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,n;return this==e||e instanceof xue&&this.tagName==e.tagName&&(this.class||(null===(t=this.attrs)||void 0===t?void 0:t.class))==(e.class||(null===(n=e.attrs)||void 0===n?void 0:n.class))&&pue(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}xue.prototype.point=!1;class kue extends _ue{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof kue&&this.spec.class==e.spec.class&&pue(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}kue.prototype.mapMode=$ae.TrackBefore,kue.prototype.point=!0;class wue extends _ue{constructor(e,t,n,i,r,o){super(t,n,r,e),this.block=i,this.isReplace=o,this.mapMode=i?t<=0?$ae.TrackBefore:$ae.TrackAfter:$ae.TrackDel}get type(){return this.startSide!=this.endSide?vue.WidgetRange:this.startSide<=0?vue.WidgetBefore:vue.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof wue&&function(e,t){return e==t||!!(e&&t&&e.compare(t))}(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}function Cue(e,t=!1){let{inclusiveStart:n,inclusiveEnd:i}=e;return null==n&&(n=e.inclusive),null==i&&(i=e.inclusive),{start:null!=n?n:t,end:null!=i?i:t}}function Sue(e,t,n,i=0){let r=n.length-1;r>=0&&n[r]+i>=e?n[r]=Math.max(n[r],t):n.push(e,t)}wue.prototype.point=!0;class Aue{constructor(e,t,n,i){this.doc=e,this.pos=t,this.end=n,this.disallowBlockEffectsFor=i,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(0==this.content.length)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof bue&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new gue),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Iue(new aue(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,this.posCovered()||e&&this.content.length&&this.content[this.content.length-1]instanceof bue||this.getLine()}buildText(e,t,n){for(;e>0;){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:i}=this.cursor.next(this.skip);if(this.skip=0,i)throw new Error("Ran out of text content when drawing inline views");if(n){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}this.text=t,this.textOff=0}let i=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-n)),this.getLine().append(Iue(new rue(this.text.slice(this.textOff,this.textOff+i)),t),n),this.atCursorPos=!0,this.textOff+=i,e-=i,n=0}}span(e,t,n,i){this.buildText(t-e,n,i),this.pos=t,this.openStart<0&&(this.openStart=i)}point(e,t,n,i,r,o){if(this.disallowBlockEffectsFor[o]&&n instanceof wue){if(n.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let s=t-e;if(n instanceof wue)if(n.block)n.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new bue(n.widget||Eue.block,s,n));else{let o=sue.create(n.widget||Eue.inline,s,s?0:n.startSide),a=this.atCursorPos&&!o.isEditable&&r<=i.length&&(e<t||n.startSide>0),l=!o.isEditable&&(e<t||r>i.length||n.startSide<=0),c=this.getLine();2!=this.pendingBuffer||a||o.isEditable||(this.pendingBuffer=0),this.flushBuffer(i),a&&(c.append(Iue(new aue(1),i),r),r=i.length+Math.max(0,r-i.length)),c.append(Iue(o,i),r),this.atCursorPos=l,this.pendingBuffer=l?e<t||r>i.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);s&&(this.textOff+s<=this.text.length?this.textOff+=s:(this.skip+=s-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,n,i,r){let o=new Aue(e,t,n,r);return o.openEnd=Wle.spans(i,t,n,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function Iue(e,t){for(let n of t)e=new oue(n,[e],e.length);return e}class Eue extends yue{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Eue.inline=new Eue("span"),Eue.block=new Eue("div");var jue=function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e}(jue||(jue={}));const Tue=jue.LTR,Bue=jue.RTL;function Nue(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<+e[n]);return t}const Rue=Nue("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),Oue=Nue("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Lue=Object.create(null),Mue=[];for(let e of["()","[]","{}"]){let t=e.charCodeAt(0),n=e.charCodeAt(1);Lue[t]=n,Lue[n]=-t}function Pue(e){return e<=247?Rue[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?Oue[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}const Due=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Fue{get dir(){return this.level%2?Bue:Tue}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,i){let r=-1;for(let o=0;o<e.length;o++){let s=e[o];if(s.from<=t&&s.to>=t){if(s.level==n)return o;(r<0||(0!=i?i<0?s.from<t:s.to>t:e[r].level>s.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}function zue(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let i=e[n],r=t[n];if(i.from!=r.from||i.to!=r.to||i.direction!=r.direction||!zue(i.inner,r.inner))return!1}return!0}const Vue=[];function Uue(e,t,n,i,r,o,s){let a=i%2?2:1;if(i%2==r%2)for(let l=t,c=0;l<n;){let t=!0,u=!1;if(c==o.length||l<o[c].from){let e=Vue[l];e!=a&&(t=!1,u=16==e)}let d=t||1!=a?null:[],h=t?i:i+1,p=l;e:for(;;)if(c<o.length&&p==o[c].from){if(u)break e;let f=o[c];if(!t)for(let e=f.to,t=c+1;;){if(e==n)break e;if(!(t<o.length&&o[t].from==e)){if(Vue[e]==a)break e;break}e=o[t++].to}c++,d?d.push(f):(f.from>l&&s.push(new Fue(l,f.from,h)),$ue(e,f.direction==Tue!=!(h%2)?i+1:i,r,f.inner,f.from,f.to,s),l=f.to),p=f.to}else{if(p==n||(t?Vue[p]!=a:Vue[p]==a))break;p++}d?Uue(e,l,p,i+1,r,d,s):l<p&&s.push(new Fue(l,p,h)),l=p}else for(let l=n,c=o.length;l>t;){let n=!0,u=!1;if(!c||l>o[c-1].to){let e=Vue[l-1];e!=a&&(n=!1,u=16==e)}let d=n||1!=a?null:[],h=n?i:i+1,p=l;e:for(;;)if(c&&p==o[c-1].to){if(u)break e;let f=o[--c];if(!n)for(let e=f.from,n=c;;){if(e==t)break e;if(!n||o[n-1].to!=e){if(Vue[e-1]==a)break e;break}e=o[--n].from}d?d.push(f):(f.to<l&&s.push(new Fue(f.to,l,h)),$ue(e,f.direction==Tue!=!(h%2)?i+1:i,r,f.inner,f.from,f.to,s),l=f.from),p=f.from}else{if(p==t||(n?Vue[p-1]!=a:Vue[p-1]==a))break;p--}d?Uue(e,p,l,i+1,r,d,s):p<l&&s.push(new Fue(p,l,h)),l=p}}function $ue(e,t,n,i,r,o,s){let a=t%2?2:1;!function(e,t,n,i,r){for(let o=0;o<=i.length;o++){let s=o?i[o-1].to:t,a=o<i.length?i[o].from:n,l=o?256:r;for(let t=s,n=l,i=l;t<a;t++){let r=Pue(e.charCodeAt(t));512==r?r=n:8==r&&4==i&&(r=16),Vue[t]=4==r?2:r,7&r&&(i=r),n=r}for(let e=s,t=l,i=l;e<a;e++){let r=Vue[e];if(128==r)e<a-1&&t==Vue[e+1]&&24&t?r=Vue[e]=t:Vue[e]=256;else if(64==r){let r=e+1;for(;r<a&&64==Vue[r];)r++;let o=e&&8==t||r<n&&8==Vue[r]?1==i?1:8:256;for(let t=e;t<r;t++)Vue[t]=o;e=r-1}else 8==r&&1==i&&(Vue[e]=1);t=r,7&r&&(i=r)}}}(e,r,o,i,a),function(e,t,n,i,r){let o=1==r?2:1;for(let s=0,a=0,l=0;s<=i.length;s++){let c=s?i[s-1].to:t,u=s<i.length?i[s].from:n;for(let t,n,i,s=c;s<u;s++)if(n=Lue[t=e.charCodeAt(s)])if(n<0){for(let e=a-3;e>=0;e-=3)if(Mue[e+1]==-n){let t=Mue[e+2],n=2&t?r:4&t?1&t?o:r:0;n&&(Vue[s]=Vue[Mue[e]]=n),a=e;break}}else{if(189==Mue.length)break;Mue[a++]=s,Mue[a++]=t,Mue[a++]=l}else if(2==(i=Vue[s])||1==i){let e=i==r;l=e?0:1;for(let t=a-3;t>=0;t-=3){let n=Mue[t+2];if(2&n)break;if(e)Mue[t+2]|=2;else{if(4&n)break;Mue[t+2]|=4}}}}}(e,r,o,i,a),function(e,t,n,i){for(let r=0,o=i;r<=n.length;r++){let s=r?n[r-1].to:e,a=r<n.length?n[r].from:t;for(let l=s;l<a;){let s=Vue[l];if(256==s){let s=l+1;for(;;)if(s==a){if(r==n.length)break;s=n[r++].to,a=r<n.length?n[r].from:t}else{if(256!=Vue[s])break;s++}let c=1==o,u=c==(1==(s<t?Vue[s]:i))?c?1:2:i;for(let t=s,i=r,o=i?n[i-1].to:e;t>l;)t==o&&(t=n[--i].from,o=i?n[i-1].to:e),Vue[--t]=u;l=s}else o=s,l++}}}(r,o,i,a),Uue(e,r,o,t,n,i,s)}function Hue(e){return[new Fue(0,e,0)]}let Wue="";function Gue(e,t,n,i,r){var o;let s=i.head-e.from,a=Fue.find(t,s,null!==(o=i.bidiLevel)&&void 0!==o?o:-1,i.assoc),l=t[a],c=l.side(r,n);if(s==c){let e=a+=r?1:-1;if(e<0||e>=t.length)return null;l=t[a=e],s=l.side(!r,n),c=l.side(r,n)}let u=Oae(e.text,s,l.forward(r,n));(u<l.from||u>l.to)&&(u=c),Wue=e.text.slice(Math.min(s,u),Math.max(s,u));let d=a==(r?t.length-1:0)?null:t[a+(r?1:-1)];return d&&u==c&&d.level+(r?0:1)<l.level?Qae.cursor(d.side(!r,n)+e.from,d.forward(r,n)?1:-1,d.level):Qae.cursor(u+e.from,l.forward(r,n)?-1:1,l.level)}function que(e,t,n){for(let i=t;i<n;i++){let t=Pue(e.charCodeAt(i));if(1==t)return Tue;if(2==t||4==t)return Bue}return Tue}const Kue=nle.define(),Yue=nle.define(),Jue=nle.define(),Xue=nle.define(),Zue=nle.define(),Que=nle.define(),ede=nle.define(),tde=nle.define({combine:e=>e.some(e=>e)}),nde=nle.define({combine:e=>e.some(e=>e)}),ide=nle.define();class rde{constructor(e,t="nearest",n="nearest",i=5,r=5,o=!1){this.range=e,this.y=t,this.x=n,this.yMargin=i,this.xMargin=r,this.isSnapshot=o}map(e){return e.empty?this:new rde(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new rde(Qae.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const ode=Ele.define({map:(e,t)=>e.map(t)}),sde=Ele.define();function ade(e,t,n){let i=e.facet(Xue);i.length?i[0](t):window.onerror?window.onerror(String(t),n,void 0,void 0,t):n?console.error(n+":",t):console.error(t)}const lde=nle.define({combine:e=>!e.length||e[0]});let cde=0;const ude=nle.define();class dde{constructor(e,t,n,i,r){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=i,this.extension=r(this)}static define(e,t){const{eventHandlers:n,eventObservers:i,provide:r,decorations:o}=t||{};return new dde(cde++,e,n,i,e=>{let t=[ude.of(e)];return o&&t.push(mde.of(t=>{let n=t.plugin(e);return n?o(n):_ue.none})),r&&t.push(r(e)),t})}static fromClass(e,t){return dde.define(t=>new e(t),t)}}class hde{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(ade(e.state,t,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(e){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){ade(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(null===(t=this.value)||void 0===t?void 0:t.destroy)try{this.value.destroy()}catch(t){ade(e.state,t,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const pde=nle.define(),fde=nle.define(),mde=nle.define(),gde=nle.define(),bde=nle.define(),yde=nle.define();function vde(e,t){let n=e.state.facet(yde);if(!n.length)return n;let i=n.map(t=>t instanceof Function?t(e):t),r=[];return Wle.spans(i,t.from,t.to,{point(){},span(e,n,i,o){let s=e-t.from,a=n-t.from,l=r;for(let e=i.length-1;e>=0;e--,o--){let n,r=i[e].spec.bidiIsolate;if(null==r&&(r=que(t.text,s,a)),o>0&&l.length&&(n=l[l.length-1]).to==s&&n.direction==r)n.to=a,l=n.inner;else{let e={from:s,to:a,direction:r,inner:[]};l.push(e),l=e.inner}}}}),r}const _de=nle.define();function xde(e){let t=0,n=0,i=0,r=0;for(let o of e.state.facet(_de)){let s=o(e);s&&(null!=s.left&&(t=Math.max(t,s.left)),null!=s.right&&(n=Math.max(n,s.right)),null!=s.top&&(i=Math.max(i,s.top)),null!=s.bottom&&(r=Math.max(r,s.bottom)))}return{left:t,right:n,top:i,bottom:r}}const kde=nle.define();class wde{constructor(e,t,n,i){this.fromA=e,this.toA=t,this.fromB=n,this.toB=i}join(e){return new wde(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let i=e[t-1];if(!(i.fromA>n.toA)){if(i.toA<n.fromA)break;n=n.join(i),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(e,t){if(0==t.length)return e;let n=[];for(let i=0,r=0,o=0,s=0;;i++){let a=i==e.length?null:e[i],l=o-s,c=a?a.fromB:1e9;for(;r<t.length&&t[r]<c;){let e=t[r],i=t[r+1],o=Math.max(s,e),a=Math.min(c,i);if(o<=a&&new wde(o+l,a+l,o,a).addToSet(n),i>c)break;r+=2}if(!a)return n;new wde(a.fromA,a.toA,a.fromB,a.toB).addToSet(n),o=a.toA,s=a.toB}}}class Cde{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=Wae.empty(this.startState.doc.length);for(let e of n)this.changes=this.changes.compose(e.changes);let i=[];this.changes.iterChangedRanges((e,t,n,r)=>i.push(new wde(e,t,n,r))),this.changedRanges=i}static create(e,t,n){return new Cde(e,t,n)}get viewportChanged(){return(4&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(10&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return 0==this.flags&&0==this.transactions.length}}class Sde extends Vce{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=_ue.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new gue],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new wde(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:e,toA:t})=>t<this.minWidthFrom||e>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&((null===(t=this.domChanged)||void 0===t?void 0:t.newSel)?i=this.domChanged.newSel.head:function(e,t){let n=!1;return t&&e.iterChangedRanges((e,i)=>{e<t.to&&i>t.from&&(n=!0)}),n}(e.changes,this.hasComposition)||e.selectionSet||(i=e.state.selection.main.head));let r=i>-1?function(e,t,n){let i=Ide(e,n);if(!i)return null;let{node:r,from:o,to:s}=i,a=r.nodeValue;if(/[\n\r]/.test(a))return null;if(e.state.doc.sliceString(i.from,i.to)!=a)return null;let l=t.invertedDesc,c=new wde(l.mapPos(o),l.mapPos(s),o,s),u=[];for(let t=r.parentNode;;t=t.parentNode){let n=Vce.get(t);if(n instanceof oue)u.push({node:t,deco:n.mark});else{if(n instanceof gue||"DIV"==t.nodeName&&t.parentNode==e.contentDOM)return{range:c,text:r,marks:u,line:t};if(t==e.contentDOM)return null;u.push({node:t,deco:new xue({inclusive:!0,attributes:mue(t),tagName:t.tagName.toLowerCase()})})}}}(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:t,to:i}=this.hasComposition;n=new wde(t,i,e.changes.mapPos(t,-1),e.changes.mapPos(i,1)).addToSet(n.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(iue.ie||iue.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=function(e,t,n){let i=new Ede;return Wle.compare(e,t,n,i),i.changes}(this.decorations,this.updateDeco(),e.changes);return n=wde.extendWithRanges(n,o),!!(7&this.flags||0!=n.length)&&(this.updateInner(n,e.startState.doc.length,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,n){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,n);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let e=iue.chrome||iue.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,e),this.flags&=-8,e&&(e.written||i.selectionRange.focusNode!=e.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(e=>e.flags&=-9);let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.children)e instanceof bue&&e.widget instanceof Ade&&r.push(e.dom);i.updateGaps(r)}updateChildren(e,t,n){let i=n?n.range.addToSet(e.slice()):e,r=this.childCursor(t);for(let e=i.length-1;;e--){let t=e>=0?i[e]:null;if(!t)break;let o,s,a,l,{fromA:c,toA:u,fromB:d,toB:h}=t;if(n&&n.range.fromB<h&&n.range.toB>d){let e=Aue.build(this.view.state.doc,d,n.range.fromB,this.decorations,this.dynamicDecorationMap),t=Aue.build(this.view.state.doc,n.range.toB,h,this.decorations,this.dynamicDecorationMap);s=e.breakAtStart,a=e.openStart,l=t.openEnd;let i=this.compositionView(n);t.breakAtStart?i.breakAfter=1:t.content.length&&i.merge(i.length,i.length,t.content[0],!1,t.openStart,0)&&(i.breakAfter=t.content[0].breakAfter,t.content.shift()),e.content.length&&i.merge(0,0,e.content[e.content.length-1],!0,0,e.openEnd)&&e.content.pop(),o=e.content.concat(i).concat(t.content)}else({content:o,breakAtStart:s,openStart:a,openEnd:l}=Aue.build(this.view.state.doc,d,h,this.decorations,this.dynamicDecorationMap));let{i:p,off:f}=r.findPos(u,1),{i:m,off:g}=r.findPos(c,-1);Hce(this,m,g,p,f,o,s,a,l)}n&&this.fixCompositionDOM(n)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let e of t.effects)e.is(sde)&&(this.editContextFormatting=e.value)}compositionView(e){let t=new rue(e.text.nodeValue);t.flags|=8;for(let{deco:n}of e.marks)t=new oue(n,[t],t.length);let n=new gue;return n.append(t,0),n}fixCompositionDOM(e){let t=(e,t)=>{t.flags|=8|(t.children.some(e=>7&e.flags)?1:0),this.markedForComposition.add(t);let n=Vce.get(e);n&&n!=t&&(n.dom=null),t.setDOM(e)},n=this.childPos(e.range.fromB,1),i=this.children[n.i];t(e.line,i);for(let r=e.marks.length-1;r>=-1;r--)n=i.childPos(n.off,1),i=i.children[n.i],t(r>=0?e.marks[r].node:e.text,i)}updateSelection(e=!1,t=!1){!e&&this.view.observer.selectionRange.focusNode||this.view.observer.readSelectionRange();let n=this.view.root.activeElement,i=n==this.dom,r=!i&&vce(this.dom,this.view.observer.selectionRange)&&!(n&&this.dom.contains(n));if(!(i||t||r))return;let o=this.forceSelection;this.forceSelection=!1;let s=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(s.anchor)),l=s.empty?a:this.moveToLine(this.domAtPos(s.head));if(iue.gecko&&s.empty&&!this.hasComposition&&1==(c=a).node.nodeType&&c.node.firstChild&&(0==c.offset||"false"==c.node.childNodes[c.offset-1].contentEditable)&&(c.offset==c.node.childNodes.length||"false"==c.node.childNodes[c.offset].contentEditable)){let e=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(e,a.node.childNodes[a.offset]||null)),a=l=new Fce(e,0),o=!0}var c;let u=this.view.observer.selectionRange;!o&&u.focusNode&&(xce(a.node,a.offset,u.anchorNode,u.anchorOffset)&&xce(l.node,l.offset,u.focusNode,u.focusOffset)||this.suppressWidgetCursorChange(u,s))||(this.view.observer.ignore(()=>{iue.android&&iue.chrome&&this.dom.contains(u.focusNode)&&function(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(1==n.nodeType&&"false"==n.contentEditable)return!0;return!1}(u.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let e=bce(this.view.root);if(e)if(s.empty){if(iue.gecko){let e=function(e,t){return 1!=e.nodeType?0:(t&&"false"==e.childNodes[t-1].contentEditable?1:0)|(t<e.childNodes.length&&"false"==e.childNodes[t].contentEditable?2:0)}(a.node,a.offset);if(e&&3!=e){let t=(1==e?Pce:Dce)(a.node,a.offset);t&&(a=new Fce(t.node,t.offset))}}e.collapse(a.node,a.offset),null!=s.bidiLevel&&void 0!==e.caretBidiLevel&&(e.caretBidiLevel=s.bidiLevel)}else if(e.extend){e.collapse(a.node,a.offset);try{e.extend(l.node,l.offset)}catch(e){}}else{let t=document.createRange();s.anchor>s.head&&([a,l]=[l,a]),t.setEnd(l.node,l.offset),t.setStart(a.node,a.offset),e.removeAllRanges(),e.addRange(t)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),n&&n.focus())}),this.view.observer.setSelectionRange(a,l)),this.impreciseAnchor=a.precise?null:new Fce(u.anchorNode,u.anchorOffset),this.impreciseHead=l.precise?null:new Fce(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&xce(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=bce(e.root),{anchorNode:i,anchorOffset:r}=e.observer.selectionRange;if(!(n&&t.empty&&t.assoc&&n.modify))return;let o=gue.find(this,t.head);if(!o)return;let s=o.posAtStart;if(t.head==s||t.head==s+o.length)return;let a=this.coordsAt(t.head,-1),l=this.coordsAt(t.head,1);if(!a||!l||a.bottom>l.top)return;let c=this.domAtPos(t.head+t.assoc);n.collapse(c.node,c.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=t.from&&n.collapse(i,r)}moveToLine(e){let t,n=this.dom;if(e.node!=n)return e;for(let i=e.offset;!t&&i<n.childNodes.length;i++){let e=Vce.get(n.childNodes[i]);e instanceof gue&&(t=e.domAtPos(0))}for(let i=e.offset-1;!t&&i>=0;i--){let e=Vce.get(n.childNodes[i]);e instanceof gue&&(t=e.domAtPos(e.length))}return t?new Fce(t.node,t.offset,!0):e}nearest(e){for(let t=e;t;){let e=Vce.get(t);if(e&&e.rootView==this)return e;t=t.parentNode}return null}posFromDOM(e,t){let n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}domAtPos(e){let{i:t,off:n}=this.childCursor().findPos(e,-1);for(;t<this.children.length-1;){let e=this.children[t];if(n<e.length||e instanceof gue)break;t++,n=0}return this.children[t].domAtPos(n)}coordsAt(e,t){let n=null,i=0;for(let r=this.length,o=this.children.length-1;o>=0;o--){let s=this.children[o],a=r-s.breakAfter,l=a-s.length;if(a<e)break;if(l<=e&&(l<e||s.covers(-1))&&(a>e||s.covers(1))&&(!n||s instanceof gue&&!(n instanceof gue&&t>=0)))n=s,i=l;else if(n&&l==e&&a==e&&s instanceof bue&&Math.abs(t)<2){if(s.deco.startSide<0)break;o&&(n=null)}r=l}return n?n.coordsAt(e-i,t):null}coordsForChar(e){let{i:t,off:n}=this.childPos(e,1),i=this.children[t];if(!(i instanceof gue))return null;for(;i.children.length;){let{i:e,off:t}=i.childPos(n,1);for(;;e++){if(e==i.children.length)return null;if((i=i.children[e]).length)break}n=t}if(!(i instanceof rue))return null;let r=Oae(i.text,n);if(r==n)return null;let o=Rce(i.dom,n,r).getClientRects();for(let e=0;e<o.length;e++){let t=o[e];if(e==o.length-1||t.top<t.bottom&&t.left<t.right)return t}return null}measureVisibleLineHeights(e){let t=[],{from:n,to:i}=e,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,s=-1,a=this.view.textDirection==jue.LTR;for(let e=0,l=0;l<this.children.length;l++){let c=this.children[l],u=e+c.length;if(u>i)break;if(e>=n){let n=c.dom.getBoundingClientRect();if(t.push(n.height),o){let t=c.dom.lastChild,i=t?_ce(t):[];if(i.length){let t=i[i.length-1],o=a?t.right-n.left:n.right-t.left;o>s&&(s=o,this.minWidth=r,this.minWidthFrom=e,this.minWidthTo=u)}}}e=u+c.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return"rtl"==getComputedStyle(this.children[t].dom).direction?jue.RTL:jue.LTR}measureTextSize(){for(let e of this.children)if(e instanceof gue){let t=e.measureTextSize();if(t)return t}let e,t,n,i=document.createElement("div");return i.className="cm-line",i.style.width="99999px",i.style.position="absolute",i.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(i);let r=_ce(i.firstChild)[0];e=i.getBoundingClientRect().height,t=r?r.width/27:7,n=r?r.height:e,i.remove()}),{lineHeight:e,charWidth:t,textHeight:n}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new $ce(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,i=0;;i++){let r=i==t.viewports.length?null:t.viewports[i],o=r?r.from-1:this.length;if(o>n){let i=(t.lineBlockAt(o).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(_ue.replace({widget:new Ade(i),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!r)break;n=r.to+1}return _ue.set(e)}updateDeco(){let e=1,t=this.view.state.facet(mde).map(t=>(this.dynamicDecorationMap[e++]="function"==typeof t)?t(this.view):t),n=!1,i=this.view.state.facet(gde).map((e,t)=>{let i="function"==typeof e;return i&&(n=!0),i?e(this.view):e});for(i.length&&(this.dynamicDecorationMap[e++]=n,t.push(Wle.join(i))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;return this.decorations}scrollIntoView(e){if(e.isSnapshot){let t=this.view.viewState.lineBlockAt(e.range.head);return this.view.scrollDOM.scrollTop=t.top-e.yMargin,void(this.view.scrollDOM.scrollLeft=e.xMargin)}for(let t of this.view.state.facet(ide))try{if(t(this.view,e.range,e))return!0}catch(e){ade(this.view.state,e,"scroll handler")}let t,{range:n}=e,i=this.coordsAt(n.head,n.empty?n.assoc:n.head>n.anchor?-1:1);if(!i)return;!n.empty&&(t=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(i={left:Math.min(i.left,t.left),top:Math.min(i.top,t.top),right:Math.max(i.right,t.right),bottom:Math.max(i.bottom,t.bottom)});let r=xde(this.view),o={left:i.left-r.left,top:i.top-r.top,right:i.right+r.right,bottom:i.bottom+r.bottom},{offsetWidth:s,offsetHeight:a}=this.view.scrollDOM;!function(e,t,n,i,r,o,s,a){let l=e.ownerDocument,c=l.defaultView||window;for(let u=e,d=!1;u&&!d;)if(1==u.nodeType){let e,h=u==l.body,p=1,f=1;if(h)e=Ice(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let t=u.getBoundingClientRect();({scaleX:p,scaleY:f}=Ece(u,t)),e={left:t.left,right:t.left+u.clientWidth*p,top:t.top,bottom:t.top+u.clientHeight*f}}let m=0,g=0;if("nearest"==r)t.top<e.top?(g=-(e.top-t.top+s),n>0&&t.bottom>e.bottom+g&&(g=t.bottom-e.bottom+g+s)):t.bottom>e.bottom&&(g=t.bottom-e.bottom+s,n<0&&t.top-g<e.top&&(g=-(e.top+g-t.top+s)));else{let i=t.bottom-t.top,o=e.bottom-e.top;g=("center"==r&&i<=o?t.top+i/2-o/2:"start"==r||"center"==r&&n<0?t.top-s:t.bottom-o+s)-e.top}if("nearest"==i?t.left<e.left?(m=-(e.left-t.left+o),n>0&&t.right>e.right+m&&(m=t.right-e.right+m+o)):t.right>e.right&&(m=t.right-e.right+o,n<0&&t.left<e.left+m&&(m=-(e.left+m-t.left+o))):m=("center"==i?t.left+(t.right-t.left)/2-(e.right-e.left)/2:"start"==i==a?t.left-o:t.right-(e.right-e.left)+o)-e.left,m||g)if(h)c.scrollBy(m,g);else{let e=0,n=0;if(g){let e=u.scrollTop;u.scrollTop+=g/f,n=(u.scrollTop-e)*f}if(m){let t=u.scrollLeft;u.scrollLeft+=m/p,e=(u.scrollLeft-t)*p}t={left:t.left-e,top:t.top-n,right:t.right-e,bottom:t.bottom-n},e&&Math.abs(e-m)<1&&(i="nearest"),n&&Math.abs(n-g)<1&&(r="nearest")}if(h)break;u=u.assignedSlot||u.parentNode}else{if(11!=u.nodeType)break;u=u.host}}(this.view.scrollDOM,o,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,s),-s),Math.max(Math.min(e.yMargin,a),-a),this.view.textDirection==jue.LTR)}}class Ade extends yue{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function Ide(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let i=Pce(n.focusNode,n.focusOffset),r=Dce(n.focusNode,n.focusOffset),o=i||r;if(r&&i&&r.node!=i.node){let t=Vce.get(r.node);if(!t||t instanceof rue&&t.text!=r.node.nodeValue)o=r;else if(e.docView.lastCompositionAfterCursor){let e=Vce.get(i.node);!e||e instanceof rue&&e.text!=i.node.nodeValue||(o=r)}}if(e.docView.lastCompositionAfterCursor=o!=i,!o)return null;let s=t-o.offset;return{from:s,to:s+o.node.nodeValue.length,node:o.node}}let Ede=class{constructor(){this.changes=[]}compareRange(e,t){Sue(e,t,this.changes)}comparePoint(e,t){Sue(e,t,this.changes)}};function jde(e,t){return t.left>e?t.left-e:Math.max(0,e-t.right)}function Tde(e,t){return t.top>e?t.top-e:Math.max(0,e-t.bottom)}function Bde(e,t){return e.top<t.bottom-1&&e.bottom>t.top+1}function Nde(e,t){return t<e.top?{top:t,left:e.left,right:e.right,bottom:e.bottom}:e}function Rde(e,t){return t>e.bottom?{top:e.top,left:e.left,right:e.right,bottom:t}:e}function Ode(e,t,n){let i,r,o,s,a,l,c,u,d=!1;for(let h=e.firstChild;h;h=h.nextSibling){let e=_ce(h);for(let p=0;p<e.length;p++){let f=e[p];r&&Bde(r,f)&&(f=Nde(Rde(f,r.bottom),r.top));let m=jde(t,f),g=Tde(n,f);if(0==m&&0==g)return 3==h.nodeType?Lde(h,t,n):Ode(h,t,n);if(!i||s>g||s==g&&o>m){i=h,r=f,o=m,s=g;let a=g?n<f.top?-1:1:m?t<f.left?-1:1:0;d=!a||(a>0?p<e.length-1:p>0)}0==m?n>f.bottom&&(!c||c.bottom<f.bottom)?(a=h,c=f):n<f.top&&(!u||u.top>f.top)&&(l=h,u=f):c&&Bde(c,f)?c=Rde(c,f.bottom):u&&Bde(u,f)&&(u=Nde(u,f.top))}}if(c&&c.bottom>=n?(i=a,r=c):u&&u.top<=n&&(i=l,r=u),!i)return{node:e,offset:0};let h=Math.max(r.left,Math.min(r.right,t));return 3==i.nodeType?Lde(i,h,n):d&&"false"!=i.contentEditable?Ode(i,h,n):{node:e,offset:Array.prototype.indexOf.call(e.childNodes,i)+(t>=(r.left+r.right)/2?1:0)}}function Lde(e,t,n){let i=e.nodeValue.length,r=-1,o=1e9,s=0;for(let a=0;a<i;a++){let i=Rce(e,a,a+1).getClientRects();for(let l=0;l<i.length;l++){let c=i[l];if(c.top==c.bottom)continue;s||(s=t-c.left);let u=(c.top>n?c.top-n:n-c.bottom)-1;if(c.left-1<=t&&c.right+1>=t&&u<o){let n=t>=(c.left+c.right)/2,i=n;if((iue.chrome||iue.gecko)&&Rce(e,a).getBoundingClientRect().left==c.right&&(i=!n),u<=0)return{node:e,offset:a+(i?1:0)};r=a+(i?1:0),o=u}}}return{node:e,offset:r>-1?r:s>0?e.nodeValue.length:0}}function Mde(e,t,n,i=-1){var r,o;let s,a=e.contentDOM.getBoundingClientRect(),l=a.top+e.viewState.paddingTop,{docHeight:c}=e.viewState,{x:u,y:d}=t,h=d-l;if(h<0)return 0;if(h>c)return e.state.doc.length;for(let t=e.viewState.heightOracle.textHeight/2,r=!1;s=e.elementAtHeight(h),s.type!=vue.Text;)for(;h=i>0?s.bottom+t:s.top-t,!(h>=0&&h<=c);){if(r)return n?null:0;r=!0,i=-i}d=l+h;let p=s.from;if(p<e.viewport.from)return 0==e.viewport.from?0:n?null:Pde(e,a,s,u,d);if(p>e.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:n?null:Pde(e,a,s,u,d);let f=e.dom.ownerDocument,m=e.root.elementFromPoint?e.root:f,g=m.elementFromPoint(u,d);g&&!e.contentDOM.contains(g)&&(g=null),g||(u=Math.max(a.left+1,Math.min(a.right-1,u)),g=m.elementFromPoint(u,d),g&&!e.contentDOM.contains(g)&&(g=null));let b,y=-1;if(g&&0!=(null===(r=e.docView.nearest(g))||void 0===r?void 0:r.isEditable))if(f.caretPositionFromPoint){let e=f.caretPositionFromPoint(u,d);e&&({offsetNode:b,offset:y}=e)}else if(f.caretRangeFromPoint){let t=f.caretRangeFromPoint(u,d);t&&(({startContainer:b,startOffset:y}=t),(!e.contentDOM.contains(b)||iue.safari&&function(e,t,n){let i;if(3!=e.nodeType||t!=(i=e.nodeValue.length))return!1;for(let t=e.nextSibling;t;t=t.nextSibling)if(1!=t.nodeType||"BR"!=t.nodeName)return!1;return Rce(e,i-1,i).getBoundingClientRect().left>n}(b,y,u)||iue.chrome&&function(e,t,n){if(0!=t)return!1;for(let t=e;;){let e=t.parentNode;if(!e||1!=e.nodeType||e.firstChild!=t)return!1;if(e.classList.contains("cm-line"))break;t=e}return n-(1==e.nodeType?e.getBoundingClientRect():Rce(e,0,Math.max(e.nodeValue.length,1)).getBoundingClientRect()).left>5}(b,y,u))&&(b=void 0))}if(!b||!e.docView.dom.contains(b)){let t=gue.find(e.docView,p);if(!t)return h>s.top+s.height/2?s.to:s.from;({node:b,offset:y}=Ode(t.dom,u,d))}let v=e.docView.nearest(b);if(!v)return null;if(v.isWidget&&1==(null===(o=v.dom)||void 0===o?void 0:o.nodeType)){let e=v.dom.getBoundingClientRect();return t.y<e.top||t.y<=e.bottom&&t.x<=(e.left+e.right)/2?v.posAtStart:v.posAtEnd}return v.localPosFromDOM(b,y)+v.posAtStart}function Pde(e,t,n,i,r){let o=Math.round((i-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>1.5*e.defaultLineHeight){let t=e.viewState.heightOracle.textHeight;o+=Math.floor((r-n.top-.5*(e.defaultLineHeight-t))/t)*e.viewState.heightOracle.lineLength}let s=e.state.sliceDoc(n.from,n.to);return n.from+rce(s,o,e.state.tabSize)}function Dde(e,t){let n=e.lineBlockAt(t);if(Array.isArray(n.type))for(let e of n.type)if(e.to>t||e.to==t&&(e.to==n.to||e.type==vue.Text))return e;return n}function Fde(e,t,n,i){let r=e.state.doc.lineAt(t.head),o=e.bidiSpans(r),s=e.textDirectionAt(r.from);for(let a=t,l=null;;){let t=Gue(r,o,s,a,n),c=Wue;if(!t){if(r.number==(n?e.state.doc.lines:1))return a;c="\n",r=e.state.doc.line(r.number+(n?1:-1)),o=e.bidiSpans(r),t=e.visualLineSide(r,!n)}if(l){if(!l(c))return a}else{if(!i)return t;l=i(c)}a=t}}function zde(e,t,n){for(;;){let i=0;for(let r of e)r.between(t-1,t+1,(e,r,o)=>{if(t>e&&t<r){let o=i||n||(t-e<r-t?-1:1);t=o<0?e:r,i=o}});if(!i)return t}}function Vde(e,t,n){let i=zde(e.state.facet(bde).map(t=>t(e)),n.from,t.head>n.from?-1:1);return i==n.from?n:Qae.cursor(i,i<n.from?1:-1)}class Ude{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,iue.safari&&e.contentDOM.addEventListener("input",()=>null),iue.gecko&&function(e){mhe.has(e)||(mhe.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}(e.contentDOM.ownerDocument)}handleEvent(e){(function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n,i=t.target;i!=e.contentDOM;i=i.parentNode)if(!i||11==i.nodeType||(n=Vce.get(i))&&n.ignoreEvent(t))return!1;return!0})(this.view,e)&&!this.ignoreDuringComposition(e)&&("keydown"==e.type&&this.keydown(e)||this.runHandlers(e.type,e))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=Hde(e),n=this.handlers,i=this.view.contentDOM;for(let e in t)if("scroll"!=e){let r=!t[e].handlers.length,o=n[e];o&&r!=!o.handlers.length&&(i.removeEventListener(e,this.handleEvent),o=null),o||i.addEventListener(e,this.handleEvent,{passive:r})}for(let e in n)"scroll"==e||t[e]||i.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),9==e.keyCode&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&27!=e.keyCode&&qde.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),iue.android&&iue.chrome&&!e.synthetic&&(13==e.keyCode||8==e.keyCode))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return!iue.ios||e.synthetic||e.altKey||e.metaKey||!((t=Wde.find(t=>t.keyCode==e.keyCode))&&!e.ctrlKey||Gde.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(229!=e.keyCode&&this.view.observer.forceFlush(),!1):(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0)}flushIOSKey(e){let t=this.pendingIOSKey;return!!t&&!("Enter"==t.key&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString()))&&(this.pendingIOSKey=void 0,Oce(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!!/^key/.test(e.type)&&(this.composing>0||!!(iue.safari&&!iue.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function $de(e,t){return(n,i)=>{try{return t.call(e,i,n)}catch(e){ade(n.state,e)}}}function Hde(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec;if(e&&e.domEventHandlers)for(let i in e.domEventHandlers){let r=e.domEventHandlers[i];r&&n(i).handlers.push($de(t.value,r))}if(e&&e.domEventObservers)for(let i in e.domEventObservers){let r=e.domEventObservers[i];r&&n(i).observers.push($de(t.value,r))}}for(let e in Jde)n(e).handlers.push(Jde[e]);for(let e in Xde)n(e).observers.push(Xde[e]);return t}const Wde=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Gde="dthko",qde=[16,17,18,20,91,92,224,225];function Kde(e){return.7*Math.max(0,e)+8}class Yde{constructor(e,t,n,i){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=function(e){let t=e.ownerDocument;for(let n=e.parentNode;n&&n!=t.body;)if(1==n.nodeType){if(n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)return n;n=n.assignedSlot||n.parentNode}else{if(11!=n.nodeType)break;n=n.host}return null}(e.contentDOM),this.atoms=e.state.facet(bde).map(t=>t(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(Fle.allowMultipleSelections)&&function(e,t){let n=e.state.facet(Kue);return n.length?n[0](t):iue.mac?t.metaKey:t.ctrlKey}(e,t),this.dragging=!(!function(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let i=bce(e.root);if(!i||0==i.rangeCount)return!0;let r=i.getRangeAt(0).getClientRects();for(let e=0;e<r.length;e++){let n=r[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}(e,t)||1!=che(t))&&null}start(e){!1===this.dragging&&this.select(e)}move(e){var t;if(0==e.buttons)return this.destroy();if(this.dragging||null==this.dragging&&function(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,i=0,r=(null===(t=this.scrollParent)||void 0===t?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},o=xde(this.view);e.clientX-o.left<=r.left+6?n=-Kde(r.left-e.clientX):e.clientX+o.right>=r.right-6&&(n=Kde(e.clientX-r.right)),e.clientY-o.top<=r.top+6?i=-Kde(r.top-e.clientY):e.clientY+o.bottom>=r.bottom-6&&(i=Kde(e.clientY-r.bottom)),this.setScrollSpeed(n,i)}up(e){null==this.dragging&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),!1===this.dragging&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let n=0;n<e.ranges.length;n++){let i=e.ranges[n],r=null;if(i.empty){let e=zde(this.atoms,i.from,0);e!=i.from&&(r=Qae.cursor(e,-1))}else{let e=zde(this.atoms,i.from,-1),t=zde(this.atoms,i.to,1);e==i.from&&t==i.to||(r=Qae.range(i.from==i.anchor?e:t,i.from==i.head?e:t))}r&&(t||(t=e.ranges.slice()),t[n]=r)}return t?Qae.create(t,e.mainIndex):e}select(e){let{view:t}=this,n=this.skipAtoms(this.style.get(e,this.extend,this.multiple));!this.mustSelect&&n.eq(t.state.selection,!1===this.dragging)||this.view.dispatch({selection:n,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(e=>e.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}const Jde=Object.create(null),Xde=Object.create(null),Zde=iue.ie&&iue.ie_version<15||iue.ios&&iue.webkit_version<604;function Qde(e,t){let n,{state:i}=e,r=1,o=i.toText(t),s=o.lines==i.selection.ranges.length,a=null!=dhe&&i.selection.ranges.every(e=>e.empty)&&dhe==o.toString();if(a){let e=-1;n=i.changeByRange(n=>{let a=i.doc.lineAt(n.from);if(a.from==e)return{range:n};e=a.from;let l=i.toText((s?o.line(r++).text:t)+i.lineBreak);return{changes:{from:a.from,insert:l},range:Qae.cursor(n.from+l.length)}})}else n=s?i.changeByRange(e=>{let t=o.line(r++);return{changes:{from:e.from,to:e.to,insert:t.text},range:Qae.cursor(e.from+t.length)}}):i.replaceSelection(o);e.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}function ehe(e,t,n,i){if(1==i)return Qae.cursor(t,n);if(2==i)return function(e,t,n=1){let i=e.charCategorizer(t),r=e.doc.lineAt(t),o=t-r.from;if(0==r.length)return Qae.cursor(t);0==o?n=1:o==r.length&&(n=-1);let s=o,a=o;n<0?s=Oae(r.text,o,!1):a=Oae(r.text,o);let l=i(r.text.slice(s,a));for(;s>0;){let e=Oae(r.text,s,!1);if(i(r.text.slice(e,s))!=l)break;s=e}for(;a<r.length;){let e=Oae(r.text,a);if(i(r.text.slice(a,e))!=l)break;a=e}return Qae.range(s+r.from,a+r.from)}(e.state,t,n);{let n=gue.find(e.docView,t),i=e.state.doc.lineAt(n?n.posAtEnd:t),r=n?n.posAtStart:i.from,o=n?n.posAtEnd:i.to;return o<e.state.doc.length&&o==i.to&&o++,Qae.range(r,o)}}Xde.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},Jde.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),27==t.keyCode&&0!=e.inputState.tabFocusMode&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),Xde.touchstart=(e,t)=>{e.inputState.lastTouchTime=Date.now(),e.inputState.setSelectionOrigin("select.pointer")},Xde.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")},Jde.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let i of e.state.facet(Jue))if(n=i(e,t),n)break;if(n||0!=t.button||(n=function(e,t){let n=rhe(e,t),i=che(t),r=e.state.selection;return{update(e){e.docChanged&&(n.pos=e.changes.mapPos(n.pos),r=r.map(e.changes))},get(t,o,s){let a,l=rhe(e,t),c=ehe(e,l.pos,l.bias,i);if(n.pos!=l.pos&&!o){let t=ehe(e,n.pos,n.bias,i),r=Math.min(t.from,c.from),o=Math.max(t.to,c.to);c=r<c.from?Qae.range(r,o):Qae.range(o,r)}return o?r.replaceRange(r.main.extend(c.from,c.to)):s&&1==i&&r.ranges.length>1&&(a=function(e,t){for(let n=0;n<e.ranges.length;n++){let{from:i,to:r}=e.ranges[n];if(i<=t&&r>=t)return Qae.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}(r,l.pos))?a:s?r.addRange(c):Qae.create([c])}}}(e,t)),n){let i=!e.hasFocus;e.inputState.startMouseSelection(new Yde(e,t,n,i)),i&&e.observer.ignore(()=>{Nce(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()});let r=e.inputState.mouseSelection;if(r)return r.start(t),!1===r.dragging}return!1};let the=(e,t)=>e>=t.top&&e<=t.bottom,nhe=(e,t,n)=>the(t,n)&&e>=n.left&&e<=n.right;function ihe(e,t,n,i){let r=gue.find(e.docView,t);if(!r)return 1;let o=t-r.posAtStart;if(0==o)return 1;if(o==r.length)return-1;let s=r.coordsAt(o,-1);if(s&&nhe(n,i,s))return-1;let a=r.coordsAt(o,1);return a&&nhe(n,i,a)?1:s&&the(i,s)?-1:1}function rhe(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:n,bias:ihe(e,n,t.clientX,t.clientY)}}const ohe=iue.ie&&iue.ie_version<=11;let she=null,ahe=0,lhe=0;function che(e){if(!ohe)return e.detail;let t=she,n=lhe;return she=e,lhe=Date.now(),ahe=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(ahe+1)%3:1}function uhe(e,t,n,i){if(!n)return;let r=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:o}=e.inputState,s=i&&o&&function(e,t){let n=e.state.facet(Yue);return n.length?n[0](t):iue.mac?!t.altKey:!t.ctrlKey}(e,t)?{from:o.from,to:o.to}:null,a={from:r,insert:n},l=e.state.changes(s?[s,a]:a);e.focus(),e.dispatch({changes:l,selection:{anchor:l.mapPos(r,-1),head:l.mapPos(r,1)},userEvent:s?"move.drop":"input.drop"}),e.inputState.draggedContent=null}Jde.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let i=e.docView.nearest(t.target);if(i&&i.isWidget){let e=i.posAtStart,t=e+i.length;(e>=n.to||t<=n.from)&&(n=Qae.range(e,t))}}let{inputState:i}=e;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",e.state.sliceDoc(n.from,n.to)),t.dataTransfer.effectAllowed="copyMove"),!1},Jde.dragend=e=>(e.inputState.draggedContent=null,!1),Jde.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let i=Array(n.length),r=0,o=()=>{++r==n.length&&uhe(e,t,i.filter(e=>null!=e).join(e.state.lineBreak),!1)};for(let e=0;e<n.length;e++){let t=new FileReader;t.onerror=o,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(i[e]=t.result),o()},t.readAsText(n[e])}return!0}{let n=t.dataTransfer.getData("Text");if(n)return uhe(e,t,n,!0),!0}return!1},Jde.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=Zde?null:t.clipboardData;return n?(Qde(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(function(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{e.focus(),n.remove(),Qde(e,n.value)},50)}(e),!1)};let dhe=null;Jde.copy=Jde.cut=(e,t)=>{let{text:n,ranges:i,linewise:r}=function(e){let t=[],n=[],i=!1;for(let i of e.selection.ranges)i.empty||(t.push(e.sliceDoc(i.from,i.to)),n.push(i));if(!t.length){let r=-1;for(let{from:i}of e.selection.ranges){let o=e.doc.lineAt(i);o.number>r&&(t.push(o.text),n.push({from:o.from,to:Math.min(e.doc.length,o.to+1)})),r=o.number}i=!0}return{text:t.join(e.lineBreak),ranges:n,linewise:i}}(e.state);if(!n&&!r)return!1;dhe=r?n:null,"cut"!=t.type||e.state.readOnly||e.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let o=Zde?null:t.clipboardData;return o?(o.clearData(),o.setData("text/plain",n),!0):(function(e,t){let n=e.dom.parentNode;if(!n)return;let i=n.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=t,i.focus(),i.selectionEnd=t.length,i.selectionStart=0,setTimeout(()=>{i.remove(),e.focus()},50)}(e,n),!1)};const hhe=Sle.define();function phe(e,t){let n=[];for(let i of e.facet(ede)){let r=i(e,t);r&&n.push(r)}return n?e.update({effects:n,annotations:hhe.of(!0)}):null}function fhe(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=phe(e.state,t);n?e.dispatch(n):e.update([])}},10)}Xde.focus=e=>{e.inputState.lastFocusTime=Date.now(),e.scrollDOM.scrollTop||!e.inputState.lastScrollTop&&!e.inputState.lastScrollLeft||(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),fhe(e)},Xde.blur=e=>{e.observer.clearSelectionRange(),fhe(e)},Xde.compositionstart=Xde.compositionupdate=e=>{e.observer.editContext||(null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},Xde.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,iue.chrome&&iue.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},Xde.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},Jde.beforeinput=(e,t)=>{var n;let i;if(iue.chrome&&iue.android&&(i=Wde.find(e=>e.inputType==t.inputType))&&(e.observer.delayAndroidKey(i.key,i.keyCode),"Backspace"==i.key||"Delete"==i.key)){let t=(null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0;setTimeout(()=>{var n;((null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return iue.ios&&"deleteContentForward"==t.inputType&&e.observer.flushSoon(),iue.safari&&"insertText"==t.inputType&&e.inputState.composing>=0&&setTimeout(()=>Xde.compositionend(e,t),20),!1};const mhe=new Set,ghe=["pre-wrap","normal","pre-line","break-spaces"];class bhe{constructor(e){this.lineWrapping=e,this.doc=xae.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return ghe.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let i=e[n];i<0?n++:this.heightSamples[Math.floor(10*i)]||(t=!0,this.heightSamples[Math.floor(10*i)]=!0)}return t}refresh(e,t,n,i,r,o){let s=ghe.indexOf(e)>-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=s;if(this.lineWrapping=s,this.lineHeight=t,this.charWidth=n,this.textHeight=i,this.lineLength=r,a){this.heightSamples={};for(let e=0;e<o.length;e++){let t=o[e];t<0?e++:this.heightSamples[Math.floor(10*t)]=!0}}return a}}class yhe{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class vhe{constructor(e,t,n,i,r){this.from=e,this.length=t,this.top=n,this.height=i,this._content=r}get type(){return"number"==typeof this._content?vue.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof wue?this._content.widget:null}get widgetLineBreaks(){return"number"==typeof this._content?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new vhe(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var _he=function(e){return e[e.ByPos=0]="ByPos",e[e.ByHeight=1]="ByHeight",e[e.ByPosNoHeight=2]="ByPosNoHeight",e}(_he||(_he={}));const xhe=.001;class khe{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(2&this.flags)>0}set outdated(e){this.flags=(e?2:0)|-3&this.flags}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>xhe&&(e.heightChanged=!0),this.height=t)}replace(e,t,n){return khe.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,i){let r=this,o=n.doc;for(let s=i.length-1;s>=0;s--){let{fromA:a,toA:l,fromB:c,toB:u}=i[s],d=r.lineAt(a,_he.ByPosNoHeight,n.setDoc(t),0,0),h=d.to>=l?d:r.lineAt(l,_he.ByPosNoHeight,n,0,0);for(u+=h.to-l,l=h.to;s>0&&d.from<=i[s-1].toA;)a=i[s-1].fromA,c=i[s-1].fromB,s--,a<d.from&&(d=r.lineAt(a,_he.ByPosNoHeight,n,0,0));c+=d.from-a,a=d.from;let p=Ehe.build(n.setDoc(o),e,c,u);r=r.replace(a,l,p)}return r.updateHeight(n,0)}static empty(){return new Che(0,0)}static of(e){if(1==e.length)return e[0];let t=0,n=e.length,i=0,r=0;for(;;)if(t==n)if(i>2*r){let r=e[t-1];r.break?e.splice(--t,1,r.left,null,r.right):e.splice(--t,1,r.left,r.right),n+=1+r.break,i-=r.size}else{if(!(r>2*i))break;{let t=e[n];t.break?e.splice(n,1,t.left,null,t.right):e.splice(n,1,t.left,t.right),n+=2+t.break,r-=t.size}}else if(i<r){let n=e[t++];n&&(i+=n.size)}else{let t=e[--n];t&&(r+=t.size)}let o=0;return null==e[t-1]?(o=1,t--):null==e[t]&&(o=1,n++),new Ahe(khe.of(e.slice(0,t)),o,khe.of(e.slice(n)))}}khe.prototype.size=1;class whe extends khe{constructor(e,t,n){super(e,t),this.deco=n}blockAt(e,t,n,i){return new vhe(i,this.length,n,this.height,this.deco||0)}lineAt(e,t,n,i,r){return this.blockAt(0,n,i,r)}forEachLine(e,t,n,i,r,o){e<=r+this.length&&t>=r&&o(this.blockAt(0,n,i,r))}updateHeight(e,t=0,n=!1,i){return i&&i.from<=t&&i.more&&this.setHeight(e,i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Che extends whe{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,n,i){return new vhe(i,this.length,n,this.height,this.breaks)}replace(e,t,n){let i=n[0];return 1==n.length&&(i instanceof Che||i instanceof She&&4&i.flags)&&Math.abs(this.length-i.length)<10?(i instanceof She?i=new Che(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):khe.of(n)}updateHeight(e,t=0,n=!1,i){return i&&i.from<=t&&i.more?this.setHeight(e,i.heights[i.index++]):(n||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class She extends khe{constructor(e){super(e,0)}heightMetrics(e,t){let n,i=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,o=r-i+1,s=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*o);n=t/o,this.length>o+1&&(s=(this.height-t)/(this.length-o-1))}else n=this.height/o;return{firstLine:i,lastLine:r,perLine:n,perChar:s}}blockAt(e,t,n,i){let{firstLine:r,lastLine:o,perLine:s,perChar:a}=this.heightMetrics(t,i);if(t.lineWrapping){let r=i+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),o=t.doc.lineAt(r),l=s+o.length*a,c=Math.max(n,e-l/2);return new vhe(o.from,o.length,c,l,0)}{let i=Math.max(0,Math.min(o-r,Math.floor((e-n)/s))),{from:a,length:l}=t.doc.line(r+i);return new vhe(a,l,n+s*i,s,0)}}lineAt(e,t,n,i,r){if(t==_he.ByHeight)return this.blockAt(e,n,i,r);if(t==_he.ByPosNoHeight){let{from:t,to:i}=n.doc.lineAt(e);return new vhe(t,i-t,0,0,0)}let{firstLine:o,perLine:s,perChar:a}=this.heightMetrics(n,r),l=n.doc.lineAt(e),c=s+l.length*a,u=l.number-o,d=i+s*u+a*(l.from-r-u);return new vhe(l.from,l.length,Math.max(i,Math.min(d,i+this.height-c)),c,0)}forEachLine(e,t,n,i,r,o){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:s,perLine:a,perChar:l}=this.heightMetrics(n,r);for(let c=e,u=i;c<=t;){let t=n.doc.lineAt(c);if(c==e){let n=t.number-s;u+=a*n+l*(e-r-n)}let i=a+l*t.length;o(new vhe(t.from,t.length,u,i,0)),u+=i,c=t.to+1}}replace(e,t,n){let i=this.length-t;if(i>0){let e=n[n.length-1];e instanceof She?n[n.length-1]=new She(e.length+i):n.push(null,new She(i-1))}if(e>0){let t=n[0];t instanceof She?n[0]=new She(e+t.length):n.unshift(new She(e-1),null)}return khe.of(n)}decomposeLeft(e,t){t.push(new She(e-1),null)}decomposeRight(e,t){t.push(null,new She(this.length-e-1))}updateHeight(e,t=0,n=!1,i){let r=t+this.length;if(i&&i.from<=t+this.length&&i.more){let n=[],o=Math.max(t,i.from),s=-1;for(i.from>t&&n.push(new She(i.from-t-1).updateHeight(e,t));o<=r&&i.more;){let t=e.doc.lineAt(o).length;n.length&&n.push(null);let r=i.heights[i.index++];-1==s?s=r:Math.abs(r-s)>=xhe&&(s=-2);let a=new Che(t,r);a.outdated=!1,n.push(a),o+=t+1}o<=r&&n.push(null,new She(r-o).updateHeight(e,o));let a=khe.of(n);return(s<0||Math.abs(a.height-this.height)>=xhe||Math.abs(s-this.heightMetrics(e,t).perLine)>=xhe)&&(e.heightChanged=!0),a}return(n||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class Ahe extends khe{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return 1&this.flags}blockAt(e,t,n,i){let r=n+this.left.height;return e<r?this.left.blockAt(e,t,n,i):this.right.blockAt(e,t,r,i+this.left.length+this.break)}lineAt(e,t,n,i,r){let o=i+this.left.height,s=r+this.left.length+this.break,a=t==_he.ByHeight?e<o:e<s,l=a?this.left.lineAt(e,t,n,i,r):this.right.lineAt(e,t,n,o,s);if(this.break||(a?l.to<s:l.from>s))return l;let c=t==_he.ByPosNoHeight?_he.ByPosNoHeight:_he.ByPos;return a?l.join(this.right.lineAt(s,c,n,o,s)):this.left.lineAt(s,c,n,i,r).join(l)}forEachLine(e,t,n,i,r,o){let s=i+this.left.height,a=r+this.left.length+this.break;if(this.break)e<a&&this.left.forEachLine(e,t,n,i,r,o),t>=a&&this.right.forEachLine(e,t,n,s,a,o);else{let l=this.lineAt(a,_he.ByPos,n,i,r);e<l.from&&this.left.forEachLine(e,l.from-1,n,i,r,o),l.to>=e&&l.from<=t&&o(l),t>l.to&&this.right.forEachLine(l.to+1,t,n,s,a,o)}}replace(e,t,n){let i=this.left.length+this.break;if(t<i)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-i,t-i,n));let r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let e of n)r.push(e);if(e>0&&Ihe(r,o-1),t<this.length){let e=r.length;this.decomposeRight(t,r),Ihe(r,e)}return khe.of(r)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(n++,e>=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,i=n+this.break;if(e>=i)return this.right.decomposeRight(e-i,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<i&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?khe.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,i){let{left:r,right:o}=this,s=t+r.length+this.break,a=null;return i&&i.from<=t+r.length&&i.more?a=r=r.updateHeight(e,t,n,i):r.updateHeight(e,t,n),i&&i.from<=s+o.length&&i.more?a=o=o.updateHeight(e,s,n,i):o.updateHeight(e,s,n),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Ihe(e,t){let n,i;null==e[t]&&(n=e[t-1])instanceof She&&(i=e[t+1])instanceof She&&e.splice(t-1,3,new She(n.length+1+i.length))}class Ehe{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof Che?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new Che(e-this.pos,-1)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let i=n.widget?n.widget.estimatedHeight:0,r=n.widget?n.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let o=t-e;n.block?this.addBlock(new whe(o,i,n)):(o||r||i>=5)&&this.addLineDeco(i,r,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||null==this.nodes[this.nodes.length-1])&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Che(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let n=new She(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Che)return e;let t=new Che(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let i=this.ensureLine();i.length+=n,i.collapsed+=n,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof Che||this.isCovered?(this.writtenTo<this.pos||null==t)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos)):this.nodes.push(new Che(0,-1));let n=e;for(let e of this.nodes)e instanceof Che&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(e,t,n,i){let r=new Ehe(n,e);return Wle.spans(t,n,i,r,0),r.finish(n)}}class jhe{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,i){(e<t||n&&n.heightRelevant||i&&i.heightRelevant)&&Sue(e,t,this.changes,5)}}function The(e,t){let n=e.getBoundingClientRect(),i=e.ownerDocument,r=i.defaultView||window,o=Math.max(0,n.left),s=Math.min(r.innerWidth,n.right),a=Math.max(0,n.top),l=Math.min(r.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=i.body;)if(1==t.nodeType){let n=t,i=window.getComputedStyle(n);if((n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)&&"visible"!=i.overflow){let i=n.getBoundingClientRect();o=Math.max(o,i.left),s=Math.min(s,i.right),a=Math.max(a,i.top),l=t==e.parentNode?i.bottom:Math.min(l,i.bottom)}t="absolute"==i.position||"fixed"==i.position?n.offsetParent:n.parentNode}else{if(11!=t.nodeType)break;t=t.host}return{left:o-n.left,right:Math.max(o,s)-n.left,top:a-(n.top+t),bottom:Math.max(a,l)-(n.top+t)}}function Bhe(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class Nhe{constructor(e,t,n){this.from=e,this.to=t,this.size=n}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let i=e[n],r=t[n];if(i.from!=r.from||i.to!=r.to||i.size!=r.size)return!1}return!0}draw(e,t){return _ue.replace({widget:new Rhe(this.size*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class Rhe extends yue{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class Ohe{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=Dhe,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=jue.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(fde).some(e=>"function"!=typeof e&&"cm-lineWrapping"==e.class);this.heightOracle=new bhe(t),this.stateDeco=e.facet(mde).filter(e=>"function"!=typeof e),this.heightMap=khe.empty().applyChanges(this.stateDeco,xae.empty,this.heightOracle.setDoc(e.doc),[new wde(0,0,0,e.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=_ue.set(this.lineGaps.map(e=>e.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let i=n?t.head:t.anchor;if(!e.some(({from:e,to:t})=>i>=e&&i<=t)){let{from:t,to:n}=this.lineBlockAt(i);e.push(new Lhe(t,n))}}return this.viewports=e.sort((e,t)=>e.from-t.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Dhe:new Fhe(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(zhe(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet(mde).filter(e=>"function"!=typeof e);let i=e.changedRanges,r=wde.extendWithRanges(i,function(e,t,n){let i=new jhe;return Wle.compare(e,t,n,i,0),i.changes}(n,this.stateDeco,e?e.changes:Wae.empty(this.state.doc.length))),o=this.heightMap.height,s=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=o&&(e.flags|=2),s?(this.scrollAnchorPos=e.changes.mapPos(s.from,-1),this.scrollAnchorHeight=s.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<a.from||t.range.head>a.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let l=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(l||!e.changes.empty||2&e.flags)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(nde)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),i=this.heightOracle,r=n.whiteSpace;this.defaultTextDirection="rtl"==n.direction?jue.RTL:jue.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),s=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=s.height;this.contentDOMHeight=s.height,this.mustMeasureContent=!1;let l=0,c=0;if(s.width&&s.height){let{scaleX:e,scaleY:n}=Ece(t,s);(e>.005&&Math.abs(this.scaleX-e)>.005||n>.005&&Math.abs(this.scaleY-n)>.005)&&(this.scaleX=e,this.scaleY=n,l|=8,o=a=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,d=(parseInt(n.paddingBottom)||0)*this.scaleY;this.paddingTop==u&&this.paddingBottom==d||(this.paddingTop=u,this.paddingBottom=d,l|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,l|=8);let h=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=h&&(this.scrollAnchorHeight=-1,this.scrollTop=h),this.scrolledToBottom=Mce(e.scrollDOM);let p=(this.printing?Bhe:The)(t,this.paddingTop),f=p.top-this.pixelViewport.top,m=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let g=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(g!=this.inView&&(this.inView=g,g&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let b=s.width;if(this.contentDOMWidth==b&&this.editorHeight==e.scrollDOM.clientHeight||(this.contentDOMWidth=s.width,this.editorHeight=e.scrollDOM.clientHeight,l|=8),a){let t=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(t)&&(o=!0),o||i.lineWrapping&&Math.abs(b-this.contentDOMWidth)>i.charWidth){let{lineHeight:n,charWidth:s,textHeight:a}=e.docView.measureTextSize();o=n>0&&i.refresh(r,n,s,a,b/s,t),o&&(e.docView.minWidth=0,l|=8)}f>0&&m>0?c=Math.max(f,m):f<0&&m<0&&(c=Math.min(f,m)),i.heightChanged=!1;for(let n of this.viewports){let r=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(o?khe.empty().applyChanges(this.stateDeco,xae.empty,this.heightOracle,[new wde(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,o,new yhe(n.from,r))}i.heightChanged&&(l|=2)}let y=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return y&&(2&l&&(l|=this.updateScaler()),this.viewport=this.getViewport(c,this.scrollTarget),l|=this.updateForViewport()),(2&l||y)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),l|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),l}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:s}=this,a=new Lhe(i.lineAt(o-1e3*n,_he.ByHeight,r,0,0).from,i.lineAt(s+1e3*(1-n),_he.ByHeight,r,0,0).to);if(t){let{head:e}=t.range;if(e<a.from||e>a.to){let n,o=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),s=i.lineAt(e,_he.ByPos,r,0,0);n="center"==t.y?(s.top+s.bottom)/2-o/2:"start"==t.y||"nearest"==t.y&&e<a.from?s.top:s.bottom-o,a=new Lhe(i.lineAt(n-500,_he.ByHeight,r,0,0).from,i.lineAt(n+o+500,_he.ByHeight,r,0,0).to)}}return a}mapViewport(e,t){let n=t.mapPos(e.from,-1),i=t.mapPos(e.to,1);return new Lhe(this.heightMap.lineAt(n,_he.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,_he.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,_he.ByPos,this.heightOracle,0,0),{bottom:r}=this.heightMap.lineAt(t,_he.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:s}=this;return(0==e||i<=o-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||r>=s+Math.max(10,Math.min(n,250)))&&i>o-2e3&&r<s+2e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let i of e)t.touchesRange(i.from,i.to)||n.push(new Nhe(t.mapPos(i.from),t.mapPos(i.to),i.size));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,i=n?1e4:2e3,r=i>>1,o=i<<1;if(this.defaultTextDirection!=jue.LTR&&!n)return[];let s=[],a=(i,o,l,c)=>{if(o-i<r)return;let u=this.state.selection.main,d=[u.from];u.empty||d.push(u.to);for(let e of d)if(e>i&&e<o)return a(i,e-10,l,c),void a(e+10,o,l,c);let h=function(e,t){for(let n of e)if(t(n))return n}(e,e=>e.from>=l.from&&e.to<=l.to&&Math.abs(e.from-i)<r&&Math.abs(e.to-o)<r&&!d.some(t=>e.from<t&&e.to>t));if(!h){if(o<l.to&&t&&n&&t.visibleRanges.some(e=>e.from<=o&&e.to>=o)){let e=t.moveToLineBoundary(Qae.cursor(o),!1,!0).head;e>i&&(o=e)}h=new Nhe(i,o,this.gapSize(l,i,o,c))}s.push(h)},l=e=>{if(e.length<o||e.type!=vue.Text)return;let t=function(e,t,n){let i=[],r=e,o=0;return Wle.spans(n,e,t,{span(){},point(e,t){e>r&&(i.push({from:r,to:e}),o+=e-r),r=t}},20),r<t&&(i.push({from:r,to:t}),o+=t-r),{total:o,ranges:i}}(e.from,e.to,this.stateDeco);if(t.total<o)return;let r,s,l=this.scrollTarget?this.scrollTarget.range.head:null;if(n){let n,o,a=i/this.heightOracle.lineLength*this.heightOracle.lineHeight;if(null!=l){let i=Phe(t,l),r=((this.visibleBottom-this.visibleTop)/2+a)/e.height;n=i-r,o=i+r}else n=(this.visibleTop-e.top-a)/e.height,o=(this.visibleBottom-e.top+a)/e.height;r=Mhe(t,n),s=Mhe(t,o)}else{let e,n,o=t.total*this.heightOracle.charWidth,a=i*this.heightOracle.charWidth;if(null!=l){let i=Phe(t,l),r=((this.pixelViewport.right-this.pixelViewport.left)/2+a)/o;e=i-r,n=i+r}else e=(this.pixelViewport.left-a)/o,n=(this.pixelViewport.right+a)/o;r=Mhe(t,e),s=Mhe(t,n)}r>e.from&&a(e.from,r,e,t),s<e.to&&a(s,e.to,e,t)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(l):l(e);return s}gapSize(e,t,n,i){let r=Phe(i,n)-Phe(i,t);return this.heightOracle.lineWrapping?e.height*r:i.total*this.heightOracle.charWidth*r}updateLineGaps(e){Nhe.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=_ue.set(e.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];Wle.spans(e,this.viewport.from,this.viewport.to,{span(e,n){t.push({from:e,to:n})},point(){}},20);let n=t.length!=this.visibleRanges.length||this.visibleRanges.some((e,n)=>e.from!=t[n].from||e.to!=t[n].to);return this.visibleRanges=t,n?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||zhe(this.heightMap.lineAt(e,_he.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||zhe(this.heightMap.lineAt(this.scaler.fromDOM(e),_he.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return zhe(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Lhe{constructor(e,t){this.from=e,this.to=t}}function Mhe({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let i=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:r}=t[e],o=r-n;if(i<=o)return n+i;i-=o}}function Phe(e,t){let n=0;for(let{from:i,to:r}of e.ranges){if(t<=r){n+=t-i;break}n+=r-i}return n/e.total}const Dhe={toDOM:e=>e,fromDOM:e=>e,scale:1,eq(e){return e==this}};class Fhe{constructor(e,t,n){let i=0,r=0,o=0;this.viewports=n.map(({from:n,to:r})=>{let o=t.lineAt(n,_he.ByPos,e,0,0).top,s=t.lineAt(r,_he.ByPos,e,0,0).bottom;return i+=s-o,{from:n,to:r,top:o,bottom:s,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(t.height-i);for(let e of this.viewports)e.domTop=o+(e.top-r)*this.scale,o=e.domBottom=e.domTop+(e.bottom-e.top),r=e.bottom}toDOM(e){for(let t=0,n=0,i=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.top)return i+(e-n)*this.scale;if(e<=r.bottom)return r.domTop+(e-r.top);n=r.bottom,i=r.domBottom}}fromDOM(e){for(let t=0,n=0,i=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.domTop)return n+(e-i)/this.scale;if(e<=r.domBottom)return r.top+(e-r.domTop);n=r.bottom,i=r.domBottom}}eq(e){return e instanceof Fhe&&this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,n)=>t.from==e.viewports[n].from&&t.to==e.viewports[n].to)}}function zhe(e,t){if(1==t.scale)return e;let n=t.toDOM(e.top),i=t.toDOM(e.bottom);return new vhe(e.from,e.length,n,i-n,Array.isArray(e._content)?e._content.map(e=>zhe(e,t)):e._content)}const Vhe=nle.define({combine:e=>e.join(" ")}),Uhe=nle.define({combine:e=>e.indexOf(!0)>-1}),$he=lce.newName(),Hhe=lce.newName(),Whe=lce.newName(),Ghe={"&light":"."+Hhe,"&dark":"."+Whe};function qhe(e,t,n){return new lce(t,{finish:t=>/&/.test(t)?t.replace(/&\w*/,t=>{if("&"==t)return e;if(!n||!n[t])throw new RangeError(`Unsupported selector: ${t}`);return n[t]}):e+" "+t})}const Khe=qhe("."+$he,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Ghe),Yhe="";class Jhe{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(Fle.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Yhe}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let i=e;;){this.findPointBefore(n,i);let e=this.text.length;this.readNode(i);let r=i.nextSibling;if(r==t)break;let o=Vce.get(i),s=Vce.get(r);(o&&s?o.breakAfter:(o?o.breakAfter:wce(i))||wce(r)&&("BR"!=i.nodeName||i.cmIgnore)&&this.text.length>e)&&this.lineBreak(),i=r}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let r,o=-1,s=1;if(this.lineSeparator?(o=t.indexOf(this.lineSeparator,n),s=this.lineSeparator.length):(r=i.exec(t))&&(o=r.index,s=r[0].length),this.append(t.slice(n,o<0?t.length:o)),o<0)break;if(this.lineBreak(),s>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=s-1);n=o+s}}readNode(e){if(e.cmIgnore)return;let t=Vce.get(e),n=t&&t.overrideDOMText;if(null!=n){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else 3==e.nodeType?this.readTextNode(e):"BR"==e.nodeName?e.nextSibling&&this.lineBreak():1==e.nodeType&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(3==e.nodeType?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(Xhe(e,n.node,n.offset)?t:0))}}function Xhe(e,t,n){for(;;){if(!t||n<Sce(t))return!1;if(t==e)return!0;n=kce(t)+1,t=t.parentNode}}class Zhe{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class Qhe{constructor(e,t,n,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:r,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,n,0))){let t=r||o?[]:function(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:o}=e.observer.selectionRange;return n&&(t.push(new Zhe(n,i)),r==n&&o==i||t.push(new Zhe(r,o))),t}(e),n=new Jhe(t,e.state);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=function(e,t){if(0==e.length)return null;let n=e[0].pos,i=2==e.length?e[1].pos:n;return n>-1&&i>-1?Qae.single(n+t,i+t):null}(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=r&&r.node==t.focusNode&&r.offset==t.focusOffset||!yce(e.contentDOM,t.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),i=o&&o.node==t.anchorNode&&o.offset==t.anchorOffset||!yce(e.contentDOM,t.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),s=e.viewport;if((iue.ios||iue.chrome)&&e.state.selection.main.empty&&n!=i&&(s.from>0||s.to<e.state.doc.length)){let t=Math.min(n,i),r=Math.max(n,i),o=s.from-t,a=s.to-r;0!=o&&1!=o&&0!=t||0!=a&&-1!=a&&r!=e.state.doc.length||(n=0,i=e.state.doc.length)}this.newSel=Qae.single(i,n)}}}function epe(e,t){let n,{newSel:i}=t,r=e.state.selection.main,o=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:i,to:s}=t.bounds,a=r.from,l=null;(8===o||iue.android&&t.text.length<s-i)&&(a=r.to,l="end");let c=function(e,t,n,i){let r=Math.min(e.length,t.length),o=0;for(;o<r&&e.charCodeAt(o)==t.charCodeAt(o);)o++;if(o==r&&e.length==t.length)return null;let s=e.length,a=t.length;for(;s>0&&a>0&&e.charCodeAt(s-1)==t.charCodeAt(a-1);)s--,a--;return"end"==i&&(n-=s+Math.max(0,o-Math.min(s,a))-o),s<o&&e.length<t.length?(o-=n<=o&&n>=s?o-n:0,a=o+(a-s),s=o):a<o&&(o-=n<=o&&n>=a?o-n:0,s=o+(s-a),a=o),{from:o,toA:s,toB:a}}(e.state.doc.sliceString(i,s,Yhe),t.text,a-i,l);c&&(iue.chrome&&13==o&&c.toB==c.from+2&&t.text.slice(c.from,c.toB)==Yhe+Yhe&&c.toB--,n={from:i+c.from,to:i+c.toA,insert:xae.of(t.text.slice(c.from,c.toB).split(Yhe))})}else i&&(!e.hasFocus&&e.state.facet(lde)||i.main.eq(r))&&(i=null);if(!n&&!i)return!1;if(!n&&t.typeOver&&!r.empty&&i&&i.main.empty?n={from:r.from,to:r.to,insert:e.state.doc.slice(r.from,r.to)}:n&&n.from>=r.from&&n.to<=r.to&&(n.from!=r.from||n.to!=r.to)&&r.to-r.from-(n.to-n.from)<=4?n={from:r.from,to:r.to,insert:e.state.doc.slice(r.from,n.from).append(n.insert).append(e.state.doc.slice(n.to,r.to))}:(iue.mac||iue.android)&&n&&n.from==n.to&&n.from==r.head-1&&/^\. ?$/.test(n.insert.toString())&&"off"==e.contentDOM.getAttribute("autocorrect")?(i&&2==n.insert.length&&(i=Qae.single(i.main.anchor-1,i.main.head-1)),n={from:r.from,to:r.to,insert:xae.of([" "])}):iue.chrome&&n&&n.from==n.to&&n.from==r.head&&"\n "==n.insert.toString()&&e.lineWrapping&&(i&&(i=Qae.single(i.main.anchor-1,i.main.head-1)),n={from:r.from,to:r.to,insert:xae.of([" "])}),n)return tpe(e,n,i,o);if(i&&!i.main.eq(r)){let t=!1,n="select";return e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(t=!0),n=e.inputState.lastSelectionOrigin),e.dispatch({selection:i,scrollIntoView:t,userEvent:n}),!0}return!1}function tpe(e,t,n,i=-1){if(iue.ios&&e.inputState.flushIOSKey(t))return!0;let r=e.state.selection.main;if(iue.android&&(t.to==r.to&&(t.from==r.from||t.from==r.from-1&&" "==e.state.sliceDoc(t.from,r.from))&&1==t.insert.length&&2==t.insert.lines&&Oce(e.contentDOM,"Enter",13)||(t.from==r.from-1&&t.to==r.to&&0==t.insert.length||8==i&&t.insert.length<t.to-t.from&&t.to>r.head)&&Oce(e.contentDOM,"Backspace",8)||t.from==r.from&&t.to==r.to+1&&0==t.insert.length&&Oce(e.contentDOM,"Delete",46)))return!0;let o,s=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let a=()=>o||(o=function(e,t,n){let i,r=e.state,o=r.selection.main;if(t.from>=o.from&&t.to<=o.to&&t.to-t.from>=(o.to-o.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=o.from<t.from?r.sliceDoc(o.from,t.from):"",s=o.to>t.to?r.sliceDoc(t.to,o.to):"";i=r.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+s))}else{let s=r.changes(t),a=n&&n.main.to<=s.newLength?n.main:void 0;if(r.selection.ranges.length>1&&e.inputState.composing>=0&&t.to<=o.to&&t.to>=o.to-10){let l,c=e.state.sliceDoc(t.from,t.to),u=n&&Ide(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);l={from:u.from,to:u.to-e}}else l=e.state.doc.lineAt(o.head);let d=o.to-t.to,h=o.to-o.from;i=r.changeByRange(n=>{if(n.from==o.from&&n.to==o.to)return{changes:s,range:a||n.map(s)};let i=n.to-d,u=i-c.length;if(n.to-n.from!=h||e.state.sliceDoc(u,i)!=c||n.to>=l.from&&n.from<=l.to)return{range:n};let p=r.changes({from:u,to:i,insert:t.insert}),f=n.to-o.to;return{changes:p,range:a?Qae.range(Math.max(0,a.anchor+f),Math.max(0,a.head+f)):n.map(p)}})}else i={changes:s,selection:a&&r.selection.replaceRange(a)}}let s="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,s+=".compose",e.inputState.compositionFirstChange&&(s+=".start",e.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:s,scrollIntoView:!0})}(e,t,n));return e.state.facet(Que).some(n=>n(e,t.from,t.to,s,a))||e.dispatch(a()),!0}const npe={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},ipe=iue.ie&&iue.ie_version<=11;class rpe{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new jce,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let e of t)this.queue.push(e);(iue.ie&&iue.ie_version<=11||iue.ios&&e.composing)&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),!window.EditContext||!1===e.constructor.EDIT_CONTEXT||iue.chrome&&iue.chrome_version<126||(this.editContext=new ape(e),e.state.facet(lde)&&(e.contentDOM.editContext=this.editContext.editContext)),ipe&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver(()=>{var e;(null===(e=this.view.docView)||void 0===e?void 0:e.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver(e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){("change"!=e.type||e.matches)&&(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,i=this.selectionRange;if(n.state.facet(lde)?n.root.activeElement!=this.dom:!vce(n.dom,i))return;let r=i.anchorNode&&n.docView.nearest(i.anchorNode);r&&r.ignoreEvent(e)?t||(this.selectionChanged=!1):(iue.ie&&iue.ie_version<=11||iue.android&&iue.chrome)&&!n.state.selection.main.empty&&i.focusNode&&xce(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=bce(e.root);if(!t)return!1;let n=iue.safari&&11==e.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return spe(e,n)}let n=null;function i(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",i,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",i,!0),n?spe(e,n):null}(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let i=vce(this.dom,n);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&function(e,t){let n=t.focusNode,i=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=i)return!1;for(i=Math.min(i,Sce(n));;)if(i){if(1!=n.nodeType)return!1;let e=n.childNodes[i-1];"false"==e.contentEditable?i--:(n=e,i=Sce(n))}else{if(n==e)return!0;i=kce(n),n=n.parentNode}}(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),i&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(1==n.nodeType)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(n),n=n.assignedSlot||n.parentNode;else{if(11!=n.nodeType)break;n=n.host}if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener("scroll",this.onScroll);for(let e of this.scrollTargets=t)e.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,npe),ipe&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),ipe&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var n;if(!this.delayedAndroidKey){let e=()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&Oce(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}this.delayedAndroidKey&&"Enter"!=e||(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(null===(n=this.delayedAndroidKey)||void 0===n?void 0:n.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,i=!1;for(let r of e){let e=this.readMutation(r);e&&(e.typeOver&&(i=!0),-1==t?({from:t,to:n}=e):(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:i}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),i=this.selectionChanged&&vce(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new Qhe(this.view,e,t,n);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,i=epe(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),i}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty("attributes"==e.type),"attributes"==e.type&&(t.flags|=4),"childList"==e.type){let n=ope(t,e.previousSibling||e.target.previousSibling,-1),i=ope(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:i?t.posBefore(i):t.posAtEnd,typeOver:!1}}return"characterData"==e.type?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener("change",this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener("change",this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(lde)!=e.state.facet(lde)&&(e.view.contentDOM.editContext=e.state.facet(lde)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),null===(e=this.intersection)||void 0===e||e.disconnect(),null===(t=this.gapIntersection)||void 0===t||t.disconnect(),null===(n=this.resizeScroll)||void 0===n||n.disconnect();for(let e of this.scrollTargets)e.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function ope(e,t,n){for(;t;){let i=Vce.get(t);if(i&&i.parent==e)return i;let r=t.parentNode;t=r!=e.dom?r:n>0?t.nextSibling:t.previousSibling}return null}function spe(e,t){let n=t.startContainer,i=t.startOffset,r=t.endContainer,o=t.endOffset,s=e.docView.domAtPos(e.state.selection.main.anchor);return xce(s.node,s.offset,r,o)&&([n,i,r,o]=[r,o,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:o}}class ape{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});t.addEventListener("textupdate",t=>{let{anchor:n}=e.state.selection.main,i={from:this.toEditorPos(t.updateRangeStart),to:this.toEditorPos(t.updateRangeEnd),insert:xae.of(t.text.split("\n"))};i.from==this.from&&n<this.from?i.from=n:i.to==this.to&&n>this.to&&(i.to=n),(i.from!=i.to||i.insert.length)&&(this.pendingContextChange=i,tpe(e,i,Qae.single(this.toEditorPos(t.selectionStart),this.toEditorPos(t.selectionEnd))),this.pendingContextChange&&this.revertPending(e.state))}),t.addEventListener("characterboundsupdate",n=>{let i=[],r=null;for(let t=this.toEditorPos(n.rangeStart),o=this.toEditorPos(n.rangeEnd);t<o;t++){let n=e.coordsForChar(t);r=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||r||new DOMRect,i.push(r)}t.updateCharacterBounds(n.rangeStart,i)}),t.addEventListener("textformatupdate",t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,i=e.underlineThickness;if("None"!=t&&"None"!=i){let r=`text-decoration: underline ${"Dashed"==t?"dashed ":"Squiggle"==t?"wavy ":""}${"Thin"==i?1:2}px`;n.push(_ue.mark({attributes:{style:r}}).range(this.toEditorPos(e.rangeStart),this.toEditorPos(e.rangeEnd)))}}e.dispatch({effects:sde.of(_ue.set(n))})}),t.addEventListener("compositionstart",()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)}),t.addEventListener("compositionend",()=>{e.inputState.composing=-1,e.inputState.compositionFirstChange=null}),this.measureReq={read:e=>{this.editContext.updateControlBounds(e.contentDOM.getBoundingClientRect());let t=bce(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,i=this.pendingContextChange;return e.changes.iterChanges((r,o,s,a,l)=>{if(n)return;let c=l.length-(o-r);if(i&&o>=i.to){if(i.from==r&&i.to==o&&i.insert.eq(l))return i=this.pendingContextChange=null,void(t+=c);i=null,this.revertPending(e.state)}if(r+=t,(o+=t)<=this.from)this.from+=c,this.to+=c;else if(r<this.to){if(r<this.from||o>this.to||this.to-this.from+l.length>3e4)return void(n=!0);this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),l.toString()),this.to+=c}t+=c}),i&&!n&&this.revertPending(e.state),!n}update(e){this.applyEdits(e)&&this.rangeIsValid(e.state)?(e.docChanged||e.selectionSet)&&this.setSelection(e.state):(this.pendingContextChange=null,this.resetRange(e.state),this.editContext.updateText(0,this.editContext.text.length,e.state.doc.sliceString(this.from,this.to)),this.setSelection(e.state)),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.to+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),i=this.toContextPos(t.head);this.editContext.selectionStart==n&&this.editContext.selectionEnd==i||this.editContext.updateSelection(n,i)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>3e4)}toEditorPos(e){return e+this.from}toContextPos(e){return e-this.from}}class lpe{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(e=>e.forEach(e=>t(e,this)))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||function(e){for(;e;){if(e&&(9==e.nodeType||11==e.nodeType&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}(e.parent)||document,this.viewState=new Ohe(e.state||Fle.create(e)),e.scrollTo&&e.scrollTo.is(ode)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(ude).map(e=>new hde(e));for(let e of this.plugins)e.update(this);this.observer=new rpe(this),this.inputState=new Ude(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Sde(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure()}dispatch(...e){let t=1==e.length&&e[0]instanceof jle?e:1==e.length&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t,n=!1,i=!1,r=this.state;for(let t of e){if(t.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=t.state}if(this.destroyed)return void(this.viewState.state=r);let o=this.hasFocus,s=0,a=null;e.some(e=>e.annotation(hhe))?(this.inputState.notifiedFocused=o,s=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=phe(r,o),a||(s=1));let l=this.observer.delayedAndroidKey,c=null;if(l?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(c=null)):this.observer.clear(),r.facet(Fle.phrases)!=this.state.facet(Fle.phrases))return this.setState(r);t=Cde.create(this,r,e),t.flags|=s;let u=this.viewState.scrollTarget;try{this.updateState=2;for(let t of e){if(u&&(u=u.map(t.changes)),t.scrollIntoView){let{main:e}=t.state.selection;u=new rde(e.empty?e:Qae.cursor(e.head,e.head>e.anchor?-1:1))}for(let e of t.effects)e.is(ode)&&(u=e.value.clip(this.state))}this.viewState.update(t,u),this.bidiCache=dpe.update(this.bidiCache,t.changes),t.empty||(this.updatePlugins(t),this.inputState.update(t)),n=this.docView.update(t),this.state.facet(kde)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(e=>e.isUserEvent("select.pointer")))}finally{this.updateState=0}if(t.startState.facet(Vhe)!=t.state.facet(Vhe)&&(this.viewState.mustMeasureContent=!0),(n||i||u||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!t.empty)for(let e of this.state.facet(Zue))try{e(t)}catch(e){ade(this.state,e,"update listener")}(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!epe(this,c)&&l.force&&Oce(this.contentDOM,l.key,l.keyCode)})}setState(e){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=e);this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new Ohe(e),this.plugins=e.facet(ude).map(e=>new hde(e)),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new Sde(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(ude),n=e.state.facet(ude);if(t!=n){let i=[];for(let r of n){let n=t.indexOf(r);if(n<0)i.push(new hde(r));else{let t=this.plugins[n];t.mustUpdate=e,i.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){ade(this.state,e,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey)return this.measureScheduled=-1,void this.requestMeasure();this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.scrollDOM,i=n.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(o<0)if(Mce(n))r=-1,o=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(i);r=e.from,o=e.top}this.updateState=1;let s=this.viewState.measure(this);if(!s&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(e>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let a=[];4&s||([this.measureRequests,a]=[a,this.measureRequests]);let l=a.map(e=>{try{return e.read(this)}catch(e){return ade(this.state,e),upe}}),c=Cde.create(this,this.state,[]),u=!1;c.flags|=s,t?t.flags|=s:t=c,this.updateState=2,c.empty||(this.updatePlugins(c),this.inputState.update(c),this.updateAttrs(),u=this.docView.update(c),u&&this.docViewUpdate());for(let e=0;e<a.length;e++)if(l[e]!=upe)try{let t=a[e];t.write&&t.write(l[e],this)}catch(e){ade(this.state,e)}if(u&&this.docView.updateSelection(!0),!c.viewportChanged&&0==this.measureRequests.length){if(this.viewState.editorHeight){if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}{let e=(r<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(r).top)-o;if(e>1||e<-1){i+=e,n.scrollTop=i/this.scaleY,o=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(Zue))e(t)}get themeClasses(){return $he+" "+(this.state.facet(Uhe)?Whe:Hhe)+" "+this.state.facet(Vhe)}updateAttrs(){let e=hpe(this,pde,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(lde)?"true":"false",class:"cm-content",style:`${iue.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),hpe(this,fde,t);let n=this.observer.ignore(()=>{let n=fue(this.contentDOM,this.contentAttrs,t),i=fue(this.dom,this.editorAttrs,e);return n||i});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let e of n.effects)e.is(lpe.announce)&&(t&&(this.announceDOM.textContent=""),t=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=e.value)}mountStyles(){this.styleModules=this.state.facet(kde);let e=this.state.facet(lpe.cspNonce);lce.mount(this.root,this.styleModules.concat(Khe).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(null!=e.key)for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key)return void(this.measureRequests[t]=e);this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(void 0===t||t&&t.spec!=e)&&this.pluginMap.set(e,t=this.plugins.find(t=>t.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return Vde(this,e,Fde(this,e,t,n))}moveByGroup(e,t){return Vde(this,e,Fde(this,e,t,t=>function(e,t,n){let i=e.state.charCategorizer(t),r=i(n);return e=>{let t=i(e);return r==Mle.Space&&(r=t),r==t}}(this,e.head,t)))}visualLineSide(e,t){let n=this.bidiSpans(e),i=this.textDirectionAt(e.from),r=n[t?n.length-1:0];return Qae.cursor(r.side(t,i)+e.from,r.forward(!t,i)?1:-1)}moveToLineBoundary(e,t,n=!0){return function(e,t,n,i){let r=Dde(e,t.head),o=i&&r.type==vue.Text&&(e.lineWrapping||r.widgetLineBreaks)?e.coordsAtPos(t.assoc<0&&t.head>r.from?t.head-1:t.head):null;if(o){let t=e.dom.getBoundingClientRect(),i=e.textDirectionAt(r.from),s=e.posAtCoords({x:n==(i==jue.LTR)?t.right-1:t.left+1,y:(o.top+o.bottom)/2});if(null!=s)return Qae.cursor(s,n?-1:1)}return Qae.cursor(n?r.to:r.from,n?-1:1)}(this,e,t,n)}moveVertically(e,t,n){return Vde(this,e,function(e,t,n,i){let r=t.head,o=n?1:-1;if(r==(n?e.state.doc.length:0))return Qae.cursor(r,t.assoc);let s,a=t.goalColumn,l=e.contentDOM.getBoundingClientRect(),c=e.coordsAtPos(r,t.assoc||-1),u=e.documentTop;if(c)null==a&&(a=c.left-l.left),s=o<0?c.top:c.bottom;else{let t=e.viewState.lineBlockAt(r);null==a&&(a=Math.min(l.right-l.left,e.defaultCharacterWidth*(r-t.from))),s=(o<0?t.top:t.bottom)+u}let d=l.left+a,h=null!=i?i:e.viewState.heightOracle.textHeight>>1;for(let t=0;;t+=10){let n=s+(h+t)*o,i=Mde(e,{x:d,y:n},!1,o);if(n<l.top||n>l.bottom||(o<0?i<r:i>r)){let t=e.docView.coordsForChar(i),r=!t||n<t.top?-1:1;return Qae.cursor(i,r,void 0,a)}}}(this,e,t,n))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),Mde(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let i=this.state.doc.lineAt(e),r=this.bidiSpans(i);return Ace(n,r[Fue.find(r,e-i.from,-1,t)].dir==jue.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(tde)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>cpe)return Hue(e.length);let t,n=this.textDirectionAt(e.from);for(let i of this.bidiCache)if(i.from==e.from&&i.dir==n&&(i.fresh||zue(i.isolates,t=vde(this,e))))return i.order;t||(t=vde(this,e));let i=function(e,t,n){if(!e)return[new Fue(0,0,t==Bue?1:0)];if(t==Tue&&!n.length&&!Due.test(e))return Hue(e.length);if(n.length)for(;e.length>Vue.length;)Vue[Vue.length]=256;let i=[],r=t==Tue?0:1;return $ue(e,r,r,n,0,e.length,i),i}(e.text,n,t);return this.bidiCache.push(new dpe(e.from,e.to,n,t,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||iue.safari&&(null===(e=this.inputState)||void 0===e?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Nce(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((9==e.nodeType?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return ode.of(new rde("number"==typeof e?Qae.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return ode.of(new rde(Qae.cursor(n.from),"start","start",n.top-e,t,!0))}setTabFocusMode(e){null==e?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:"boolean"==typeof e?this.inputState.tabFocusMode=e?0:-1:0!=this.inputState.tabFocusMode&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return dde.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return dde.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=lce.newName(),i=[Vhe.of(n),kde.of(qhe(`.${n}`,e))];return t&&t.dark&&i.push(Uhe.of(!0)),i}static baseTheme(e){return dle.lowest(kde.of(qhe("."+$he,e,Ghe)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),i=n&&Vce.get(n)||Vce.get(e);return(null===(t=null==i?void 0:i.rootView)||void 0===t?void 0:t.view)||null}}lpe.styleModule=kde,lpe.inputHandler=Que,lpe.scrollHandler=ide,lpe.focusChangeEffect=ede,lpe.perLineTextDirection=tde,lpe.exceptionSink=Xue,lpe.updateListener=Zue,lpe.editable=lde,lpe.mouseSelectionStyle=Jue,lpe.dragMovesSelection=Yue,lpe.clickAddsSelectionRange=Kue,lpe.decorations=mde,lpe.outerDecorations=gde,lpe.atomicRanges=bde,lpe.bidiIsolatedRanges=yde,lpe.scrollMargins=_de,lpe.darkTheme=Uhe,lpe.cspNonce=nle.define({combine:e=>e.length?e[0]:""}),lpe.contentAttributes=fde,lpe.editorAttributes=pde,lpe.lineWrapping=lpe.contentAttributes.of({class:"cm-lineWrapping"}),lpe.announce=Ele.define();const cpe=4096,upe={};class dpe{constructor(e,t,n,i,r,o){this.from=e,this.to=t,this.dir=n,this.isolates=i,this.fresh=r,this.order=o}static update(e,t){if(t.empty&&!e.some(e=>e.fresh))return e;let n=[],i=e.length?e[e.length-1].dir:jue.LTR;for(let r=Math.max(0,e.length-10);r<e.length;r++){let o=e[r];o.dir!=i||t.touchesRange(o.from,o.to)||n.push(new dpe(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return n}}function hpe(e,t,n){for(let i=e.state.facet(t),r=i.length-1;r>=0;r--){let t=i[r],o="function"==typeof t?t(e):t;o&&due(o,n)}return n}const ppe=iue.mac?"mac":iue.windows?"win":iue.linux?"linux":"key";function fpe(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}const mpe=nle.define({enables:dle.default(lpe.domEventHandlers({keydown:(e,t)=>_pe(bpe(t.state),e,t,"editor")}))}),gpe=new WeakMap;function bpe(e){let t=e.facet(mpe),n=gpe.get(t);return n||gpe.set(t,n=function(e,t=ppe){let n=Object.create(null),i=Object.create(null),r=(e,t)=>{let n=i[e];if(null==n)i[e]=t;else if(n!=t)throw new Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},o=(e,i,o,s,a)=>{var l,c;let u=n[e]||(n[e]=Object.create(null)),d=i.split(/ (?!$)/).map(e=>function(e,t){const n=e.split(/-(?!$)/);let i,r,o,s,a=n[n.length-1];"Space"==a&&(a=" ");for(let e=0;e<n.length-1;++e){const a=n[e];if(/^(cmd|meta|m)$/i.test(a))s=!0;else if(/^a(lt)?$/i.test(a))i=!0;else if(/^(c|ctrl|control)$/i.test(a))r=!0;else if(/^s(hift)?$/i.test(a))o=!0;else{if(!/^mod$/i.test(a))throw new Error("Unrecognized modifier name: "+a);"mac"==t?s=!0:r=!0}}return i&&(a="Alt-"+a),r&&(a="Ctrl-"+a),s&&(a="Meta-"+a),o&&(a="Shift-"+a),a}(e,t));for(let t=1;t<d.length;t++){let n=d.slice(0,t).join(" ");r(n,!0),u[n]||(u[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let i=ype={view:t,prefix:n,scope:e};return setTimeout(()=>{ype==i&&(ype=null)},4e3),!0}]})}let h=d.join(" ");r(h,!1);let p=u[h]||(u[h]={preventDefault:!1,stopPropagation:!1,run:(null===(c=null===(l=u._any)||void 0===l?void 0:l.run)||void 0===c?void 0:c.slice())||[]});o&&p.run.push(o),s&&(p.preventDefault=!0),a&&(p.stopPropagation=!0)};for(let i of e){let e=i.scope?i.scope.split(" "):["editor"];if(i.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||(e._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:r}=i;for(let t in e)e[t].run.push(e=>r(e,vpe))}let r=i[t]||i.key;if(r)for(let t of e)o(t,r,i.run,i.preventDefault,i.stopPropagation),i.shift&&o(t,"Shift-"+r,i.shift,i.preventDefault,i.stopPropagation)}return n}(t.reduce((e,t)=>e.concat(t),[]))),n}let ype=null,vpe=null;function _pe(e,t,n,i){vpe=t;let r=function(e){var t=!(pce&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||fce&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?hce:dce)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(t),o=Vae(Fae(r,0))==r.length&&" "!=r,s="",a=!1,l=!1,c=!1;ype&&ype.view==n&&ype.scope==i&&(s=ype.prefix+" ",qde.indexOf(t.keyCode)<0&&(l=!0,ype=null));let u,d,h=new Set,p=e=>{if(e){for(let t of e.run)if(!h.has(t)&&(h.add(t),t(n)))return e.stopPropagation&&(c=!0),!0;e.preventDefault&&(e.stopPropagation&&(c=!0),l=!0)}return!1},f=e[i];return f&&(p(f[s+fpe(r,t,!o)])?a=!0:o&&(t.altKey||t.metaKey||t.ctrlKey)&&!(iue.windows&&t.ctrlKey&&t.altKey)&&(u=dce[t.keyCode])&&u!=r?(p(f[s+fpe(u,t,!0)])||t.shiftKey&&(d=hce[t.keyCode])!=r&&d!=u&&p(f[s+fpe(d,t,!1)]))&&(a=!0):o&&t.shiftKey&&p(f[s+fpe(r,t,!0)])&&(a=!0),!a&&p(f._any)&&(a=!0)),l&&(a=!0),a&&c&&t.stopPropagation(),vpe=null,a}class xpe{constructor(e,t,n,i,r){this.className=e,this.left=t,this.top=n,this.width=i,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className==this.className&&(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",null!=this.width&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,n){if(n.empty){let i=e.coordsAtPos(n.head,n.assoc||1);if(!i)return[];let r=kpe(e);return[new xpe(t,i.left-r.left,i.top-r.top,null,i.bottom-i.top)]}return function(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let i=Math.max(n.from,e.viewport.from),r=Math.min(n.to,e.viewport.to),o=e.textDirection==jue.LTR,s=e.contentDOM,a=s.getBoundingClientRect(),l=kpe(e),c=s.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),d=a.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),h=a.right-(u?parseInt(u.paddingRight):0),p=Dde(e,i),f=Dde(e,r),m=p.type==vue.Text?p:null,g=f.type==vue.Text?f:null;if(m&&(e.lineWrapping||p.widgetLineBreaks)&&(m=wpe(e,i,1,m)),g&&(e.lineWrapping||f.widgetLineBreaks)&&(g=wpe(e,r,-1,g)),m&&g&&m.from==g.from&&m.to==g.to)return y(v(n.from,n.to,m));{let t=m?v(n.from,null,m):_(p,!1),i=g?v(null,n.to,g):_(f,!0),r=[];return(m||p).to<(g||f).from-(m&&g?1:0)||p.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2<i.top?r.push(b(d,t.bottom,h,i.top)):t.bottom<i.top&&e.elementAtHeight((t.bottom+i.top)/2).type==vue.Text&&(t.bottom=i.top=(t.bottom+i.top)/2),y(t).concat(r).concat(y(i))}function b(e,n,i,r){return new xpe(t,e-l.left,n-l.top-.01,i-e,r-n+.01)}function y({top:e,bottom:t,horizontal:n}){let i=[];for(let r=0;r<n.length;r+=2)i.push(b(n[r],e,n[r+1],t));return i}function v(t,n,i){let r=1e9,s=-1e9,a=[];function l(t,n,l,c,u){let p=e.coordsAtPos(t,t==i.to?-2:2),f=e.coordsAtPos(l,l==i.from?2:-2);p&&f&&(r=Math.min(p.top,f.top,r),s=Math.max(p.bottom,f.bottom,s),u==jue.LTR?a.push(o&&n?d:p.left,o&&c?h:f.right):a.push(!o&&c?d:f.left,!o&&n?h:p.right))}let c=null!=t?t:i.from,u=null!=n?n:i.to;for(let i of e.visibleRanges)if(i.to>c&&i.from<u)for(let r=Math.max(i.from,c),o=Math.min(i.to,u);;){let i=e.state.doc.lineAt(r);for(let s of e.bidiSpans(i)){let e=s.from+i.from,a=s.to+i.from;if(e>=o)break;a>r&&l(Math.max(e,r),null==t&&e<=c,Math.min(a,o),null==n&&a>=u,s.dir)}if(r=i.to+1,r>=o)break}return 0==a.length&&l(c,null==t,u,null==n,e.textDirection),{top:r,bottom:s,horizontal:a}}function _(e,t){let n=a.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}(e,t,n)}}function kpe(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==jue.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function wpe(e,t,n,i){let r=e.coordsAtPos(t,2*n);if(!r)return i;let o=e.dom.getBoundingClientRect(),s=(r.top+r.bottom)/2,a=e.posAtCoords({x:o.left+1,y:s}),l=e.posAtCoords({x:o.right-1,y:s});return null==a||null==l?i:{from:Math.max(i.from,Math.min(a,l)),to:Math.min(i.to,Math.max(a,l))}}class Cpe{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(Spe)!=e.state.facet(Spe)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){!1!==this.layer.updateOnDocViewUpdate&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(Spe);for(;t<n.length&&n[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;e==this.scaleX&&t==this.scaleY||(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((e,t)=>!function(e,t){return e.constructor==t.constructor&&e.eq(t)}(e,this.drawn[t]))){let t=this.dom.firstChild,n=0;for(let i of e)i.update&&t&&i.constructor&&this.drawn[n].constructor&&i.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(i.draw(),t);for(;t;){let e=t.nextSibling;t.remove(),t=e}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Spe=nle.define();function Ape(e){return[dde.define(t=>new Cpe(t,e)),Spe.of(e)]}const Ipe=!iue.ios,Epe=nle.define({combine:e=>zle(e,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})});function jpe(e){return e.startState.facet(Epe)!=e.state.facet(Epe)}const Tpe=Ape({above:!0,markers(e){let{state:t}=e,n=t.facet(Epe),i=[];for(let r of t.selection.ranges){let o=r==t.selection.main;if(r.empty?!o||Ipe:n.drawRangeCursor){let t=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",n=r.empty?r:Qae.cursor(r.head,r.head>r.anchor?-1:1);for(let r of xpe.forRange(e,t,n))i.push(r)}}return i},update(e,t){e.transactions.some(e=>e.selection)&&(t.style.animationName="cm-blink"==t.style.animationName?"cm-blink2":"cm-blink");let n=jpe(e);return n&&Bpe(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){Bpe(t.state,e)},class:"cm-cursorLayer"});function Bpe(e,t){t.style.animationDuration=e.facet(Epe).cursorBlinkRate+"ms"}const Npe=Ape({above:!1,markers:e=>e.state.selection.ranges.map(t=>t.empty?[]:xpe.forRange(e,"cm-selectionBackground",t)).reduce((e,t)=>e.concat(t)),update:(e,t)=>e.docChanged||e.selectionSet||e.viewportChanged||jpe(e),class:"cm-selectionLayer"}),Rpe={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};Ipe&&(Rpe[".cm-line"].caretColor=Rpe[".cm-content"].caretColor="transparent !important");const Ope=dle.highest(lpe.theme(Rpe)),Lpe=Ele.define({map:(e,t)=>null==e?null:t.mapPos(e)}),Mpe=cle.define({create:()=>null,update:(e,t)=>(null!=e&&(e=t.changes.mapPos(e)),t.effects.reduce((e,t)=>t.is(Lpe)?t.value:e,e))}),Ppe=dde.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(Mpe);null==n?null!=this.cursor&&(null===(t=this.cursor)||void 0===t||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(Mpe)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(Mpe),n=null!=t&&e.coordsAtPos(t);if(!n)return null;let i=e.scrollDOM.getBoundingClientRect();return{left:n.left-i.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-i.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(Mpe)!=e&&this.view.dispatch({effects:Lpe.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){e.target!=this.view.contentDOM&&this.view.contentDOM.contains(e.relatedTarget)||this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Dpe(e,t,n,i,r){t.lastIndex=0;for(let o,s=e.iterRange(n,i),a=n;!s.next().done;a+=s.value.length)if(!s.lineBreak)for(;o=t.exec(s.value);)r(a+o.index,o)}class Fpe{constructor(e){const{regexp:t,decoration:n,decorate:i,boundary:r,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,i)this.addMatch=(e,t,n,r)=>i(r,n,n+e[0].length,e,t);else if("function"==typeof n)this.addMatch=(e,t,i,r)=>{let o=n(e,t,i);o&&r(i,i+e[0].length,o)};else{if(!n)throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.addMatch=(e,t,i,r)=>r(i,i+e[0].length,n)}this.boundary=r,this.maxLength=o}createDeco(e){let t=new Gle,n=t.add.bind(t);for(let{from:t,to:i}of function(e,t){let n=e.visibleRanges;if(1==n.length&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let i=[];for(let{from:r,to:o}of n)r=Math.max(e.state.doc.lineAt(r).from,r-t),o=Math.min(e.state.doc.lineAt(o).to,o+t),i.length&&i[i.length-1].to>=r?i[i.length-1].to=o:i.push({from:r,to:o});return i}(e,this.maxLength))Dpe(e.state.doc,this.regexp,t,i,(t,i)=>this.addMatch(i,e,t,n));return t.finish()}updateDeco(e,t){let n=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((t,r,o,s)=>{s>e.view.viewport.from&&o<e.view.viewport.to&&(n=Math.min(o,n),i=Math.max(s,i))}),e.viewportChanged||i-n>1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,t.map(e.changes),n,i):t}updateRange(e,t,n,i){for(let r of e.visibleRanges){let o=Math.max(r.from,n),s=Math.min(r.to,i);if(s>o){let n=e.state.doc.lineAt(o),i=n.to<s?e.state.doc.lineAt(s):n,a=Math.max(r.from,n.from),l=Math.min(r.to,i.to);if(this.boundary){for(;o>n.from;o--)if(this.boundary.test(n.text[o-1-n.from])){a=o;break}for(;s<i.to;s++)if(this.boundary.test(i.text[s-i.from])){l=s;break}}let c,u=[],d=(e,t,n)=>u.push(n.range(e,t));if(n==i)for(this.regexp.lastIndex=a-n.from;(c=this.regexp.exec(n.text))&&c.index<l-n.from;)this.addMatch(c,e,c.index+n.from,d);else Dpe(e.state.doc,this.regexp,a,l,(t,n)=>this.addMatch(n,e,t,d));t=t.update({filterFrom:a,filterTo:l,filter:(e,t)=>e<a||t>l,add:u})}}return t}}const zpe=null!=/x/.unicode?"gu":"g",Vpe=new RegExp("[\0-\b\n--\u2028\u2029\ufeff-]",zpe),Upe={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let $pe=null;const Hpe=nle.define({combine(e){let t=zle(e,{render:null,specialChars:Vpe,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==$pe&&"undefined"!=typeof document&&document.body){let t=document.body.style;$pe=null!=(null!==(e=t.tabSize)&&void 0!==e?e:t.MozTabSize)}return $pe||!1}())&&(t.specialChars=new RegExp("\t|"+t.specialChars.source,zpe)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,zpe)),t}});let Wpe=null;class Gpe extends yue{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=function(e){return e>=32?"•":10==e?"":String.fromCharCode(9216+e)}(this.code),n=e.state.phrase("Control character")+" "+(Upe[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,n,t);if(i)return i;let r=document.createElement("span");return r.textContent=t,r.title=n,r.setAttribute("aria-label",n),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class qpe extends yue{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent="\t",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}const Kpe=_ue.line({class:"cm-activeLine"}),Ype=dde.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let i of e.state.selection.ranges){let r=e.lineBlockAt(i.head);r.from>t&&(n.push(Kpe.range(r.from)),t=r.from)}return _ue.set(n)}},{decorations:e=>e.decorations});class Jpe extends yue{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild("string"==typeof this.content?document.createTextNode(this.content):this.content),"string"==typeof this.content?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}coordsAt(e){let t=e.firstChild?_ce(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),i=Ace(t[0],"rtl"!=n.direction),r=parseInt(n.lineHeight);return i.bottom-i.top>1.5*r?{left:i.left,right:i.right,top:i.top,bottom:i.top+r}:i}ignoreEvent(){return!1}}const Xpe=2e3;function Zpe(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),i=e.state.doc.lineAt(n),r=n-i.from,o=r>Xpe?-1:r==i.length?function(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}(e,t.clientX):ice(i.text,e.state.tabSize,n-i.from);return{line:i.number,col:o,off:r}}const Qpe={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},efe={style:"cursor: crosshair"},tfe="-10000px";class nfe{constructor(e,t,n,i){this.facet=t,this.createTooltipView=n,this.removeTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let r=null;this.tooltipViews=this.tooltips.map(e=>r=n(e,r))}update(e,t){var n;let i=e.state.facet(this.facet),r=i.filter(e=>e);if(i===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let o=[],s=t?[]:null;for(let n=0;n<r.length;n++){let i=r[n],a=-1;if(i){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==i.create&&(a=e)}if(a<0)o[n]=this.createTooltipView(i,n?o[n-1]:null),s&&(s[n]=!!i.above);else{let i=o[n]=this.tooltipViews[a];s&&(s[n]=t[a]),i.update&&i.update(e)}}}for(let e of this.tooltipViews)o.indexOf(e)<0&&(this.removeTooltipView(e),null===(n=e.destroy)||void 0===n||n.call(e));return t&&(s.forEach((e,n)=>t[n]=e),t.length=s.length),this.input=i,this.tooltips=r,this.tooltipViews=o,!0}}function ife(e){let{win:t}=e;return{top:0,left:0,bottom:t.innerHeight,right:t.innerWidth}}const rfe=nle.define({combine:e=>{var t,n,i;return{position:iue.ios?"absolute":(null===(t=e.find(e=>e.position))||void 0===t?void 0:t.position)||"fixed",parent:(null===(n=e.find(e=>e.parent))||void 0===n?void 0:n.parent)||null,tooltipSpace:(null===(i=e.find(e=>e.tooltipSpace))||void 0===i?void 0:i.tooltipSpace)||ife}}}),ofe=new WeakMap,sfe=dde.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(rfe);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver="function"==typeof ResizeObserver?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new nfe(e,lfe,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,i=e.state.facet(rfe);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;n=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let e of this.manager.tooltipViews)this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),i=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let e=document.createElement("div");e.className="cm-tooltip-arrow",n.dom.appendChild(e)}return n.dom.style.position=this.position,n.dom.style.top=tfe,n.dom.style.left="0px",this.container.insertBefore(n.dom,i),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),null===(e=t.destroy)||void 0===e||e.call(t);this.parent&&this.container.remove(),null===(t=this.resizeObserver)||void 0===t||t.disconnect(),null===(n=this.intersectionObserver)||void 0===n||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=this.view.dom.getBoundingClientRect(),t=1,n=1,i=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(iue.gecko)i=e.offsetParent!=this.container.ownerDocument.body;else if(e.style.top==tfe&&"0px"==e.style.left){let t=e.getBoundingClientRect();i=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}}if(i||"absolute"==this.position)if(this.parent){let e=this.parent.getBoundingClientRect();e.width&&e.height&&(t=e.width/this.parent.offsetWidth,n=e.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:n}=this.view.viewState);return{editor:e,parent:this.parent?this.container.getBoundingClientRect():e,pos:this.manager.tooltips.map((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(rfe).tooltipSpace(this.view),scaleX:t,scaleY:n,makeAbsolute:i}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let e of this.manager.tooltipViews)e.dom.style.position="absolute"}let{editor:n,space:i,scaleX:r,scaleY:o}=e,s=[];for(let a=0;a<this.manager.tooltips.length;a++){let l=this.manager.tooltips[a],c=this.manager.tooltipViews[a],{dom:u}=c,d=e.pos[a],h=e.size[a];if(!d||d.bottom<=Math.max(n.top,i.top)||d.top>=Math.min(n.bottom,i.bottom)||d.right<Math.max(n.left,i.left)-.1||d.left>Math.min(n.right,i.right)+.1){u.style.top=tfe;continue}let p=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,f=p?7:0,m=h.right-h.left,g=null!==(t=ofe.get(c))&&void 0!==t?t:h.bottom-h.top,b=c.offset||afe,y=this.view.textDirection==jue.LTR,v=h.width>i.right-i.left?y?i.left:i.right-h.width:y?Math.min(d.left-(p?14:0)+b.x,i.right-m):Math.max(i.left,d.left-m+(p?14:0)-b.x),_=this.above[a];!l.strictSide&&(_?d.top-(h.bottom-h.top)-b.y<i.top:d.bottom+(h.bottom-h.top)+b.y>i.bottom)&&_==i.bottom-d.bottom>d.top-i.top&&(_=this.above[a]=!_);let x=(_?d.top-i.top:i.bottom-d.bottom)-f;if(x<g&&!1!==c.resize){if(x<this.view.defaultLineHeight){u.style.top=tfe;continue}ofe.set(c,g),u.style.height=(g=x)/o+"px"}else u.style.height&&(u.style.height="");let k=_?d.top-g-f-b.y:d.bottom+f+b.y,w=v+m;if(!0!==c.overlap)for(let e of s)e.left<w&&e.right>v&&e.top<k+g&&e.bottom>k&&(k=_?e.top-g-2-f:e.bottom+f+2);if("absolute"==this.position?(u.style.top=(k-e.parent.top)/o+"px",u.style.left=(v-e.parent.left)/r+"px"):(u.style.top=k/o+"px",u.style.left=v/r+"px"),p){let e=d.left+(y?b.x:-b.x)-(v+14-7);p.style.left=e/r+"px"}!0!==c.overlap&&s.push({left:v,top:k,right:w,bottom:k+g}),u.classList.toggle("cm-tooltip-above",_),u.classList.toggle("cm-tooltip-below",!_),c.positioned&&c.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=tfe}},{eventObservers:{scroll(){this.maybeMeasure()}}}),afe={x:0,y:0},lfe=nle.define({enables:[sfe,lpe.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}})]}),cfe=nle.define({combine:e=>e.reduce((e,t)=>e.concat(t),[])});class ufe{static create(e){return new ufe(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new nfe(e,cfe,(e,t)=>this.createHostedView(e,t),e=>e.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)null===(e=t.destroy)||void 0===e||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let i=n[e];if(void 0!==i)if(void 0===t)t=i;else if(t!==i)return}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const dfe=lfe.compute([cfe],e=>{let t=e.facet(cfe);return 0===t.length?null:{pos:Math.min(...t.map(e=>e.pos)),end:Math.max(...t.map(e=>{var t;return null!==(t=e.end)&&void 0!==t?t:e.pos})),create:ufe.create,above:t[0].above,arrow:t.some(e=>e.arrow)}});class hfe{constructor(e,t,n,i,r){this.view=e,this.source=t,this.field=n,this.setHover=i,this.hoverTime=r,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,n=e.docView.nearest(t.target);if(!n)return;let i,r=1;if(n instanceof sue)i=n.posAtStart;else{if(i=e.posAtCoords(t),null==i)return;let n=e.coordsAtPos(i);if(!n||t.y<n.top||t.y>n.bottom||t.x<n.left-e.defaultCharacterWidth||t.x>n.right+e.defaultCharacterWidth)return;let o=e.bidiSpans(e.state.doc.lineAt(i)).find(e=>e.from<=i&&e.to>=i),s=o&&o.dir==jue.RTL?-1:1;r=t.x<n.left?-s:s}let o=this.source(e,i,r);if(null==o?void 0:o.then){let t=this.pending={pos:i};o.then(n=>{this.pending==t&&(this.pending=null,!n||Array.isArray(n)&&!n.length||e.dispatch({effects:this.setHover.of(Array.isArray(n)?n:[n])}))},t=>ade(e.state,t,"hover tooltip"))}else!o||Array.isArray(o)&&!o.length||e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(sfe),t=e?e.manager.tooltips.findIndex(e=>e.create==ufe.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,n;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:r}=this;if(i.length&&r&&!function(e,t){let n=e.getBoundingClientRect();return t.clientX>=n.left-4&&t.clientX<=n.right+4&&t.clientY>=n.top-4&&t.clientY<=n.bottom+4}(r.dom,e)||this.pending){let{pos:r}=i[0]||this.pending,o=null!==(n=null===(t=i[0])||void 0===t?void 0:t.end)&&void 0!==n?n:r;(r==o?this.view.posAtCoords(this.lastMove)==r:function(e,t,n,i,r){let o=e.scrollDOM.getBoundingClientRect(),s=e.documentTop+e.documentPadding.top+e.contentHeight;if(o.left>i||o.right<i||o.top>r||Math.min(o.bottom,s)<r)return!1;let a=e.posAtCoords({x:i,y:r},!1);return a>=t&&a<=n}(this.view,r,o,e.clientX,e.clientY))||(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function pfe(e,t={}){let n=Ele.define(),i=cle.define({create:()=>[],update(e,i){if(e.length&&(t.hideOnChange&&(i.docChanged||i.selection)?e=[]:t.hideOn&&(e=e.filter(e=>!t.hideOn(i,e))),i.docChanged)){let t=[];for(let n of e){let e=i.changes.mapPos(n.pos,-1,$ae.TrackDel);if(null!=e){let r=Object.assign(Object.create(null),n);r.pos=e,null!=r.end&&(r.end=i.changes.mapPos(r.end)),t.push(r)}}e=t}for(let t of i.effects)t.is(n)&&(e=t.value),t.is(mfe)&&(e=[]);return e},provide:e=>cfe.from(e)});return[i,dde.define(r=>new hfe(r,e,i,n,t.hoverTime||300)),dfe]}function ffe(e,t){let n=e.plugin(sfe);if(!n)return null;let i=n.manager.tooltips.indexOf(t);return i<0?null:n.manager.tooltipViews[i]}const mfe=Ele.define(),gfe=nle.define({combine(e){let t,n;for(let i of e)t=t||i.topContainer,n=n||i.bottomContainer;return{topContainer:t,bottomContainer:n}}});function bfe(e,t){let n=e.plugin(yfe),i=n?n.specs.indexOf(t):-1;return i>-1?n.panels[i]:null}const yfe=dde.fromClass(class{constructor(e){this.input=e.state.facet(xfe),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(t=>t(e));let t=e.state.facet(gfe);this.top=new vfe(e,!0,t.topContainer),this.bottom=new vfe(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top));for(let e of this.panels)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}update(e){let t=e.state.facet(gfe);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new vfe(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new vfe(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(xfe);if(n!=this.input){let t=n.filter(e=>e),i=[],r=[],o=[],s=[];for(let n of t){let t,a=this.specs.indexOf(n);a<0?(t=n(e.view),s.push(t)):(t=this.panels[a],t.update&&t.update(e)),i.push(t),(t.top?r:o).push(t)}this.specs=t,this.panels=i,this.top.sync(r),this.bottom.sync(o);for(let e of s)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>lpe.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class vfe{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=_fe(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=_fe(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function _fe(e){let t=e.nextSibling;return e.remove(),t}const xfe=nle.define({enables:yfe});class kfe extends Vle{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}kfe.prototype.elementClass="",kfe.prototype.toDOM=void 0,kfe.prototype.mapMode=$ae.TrackBefore,kfe.prototype.startSide=kfe.prototype.endSide=-1,kfe.prototype.point=!0;const wfe=nle.define(),Cfe={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Wle.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},Sfe=nle.define();function Afe(e){return[Efe(),Sfe.of(Object.assign(Object.assign({},Cfe),e))]}const Ife=nle.define({combine:e=>e.some(e=>e)});function Efe(e){let t=[jfe];return e&&!1===e.fixed&&t.push(Ife.of(!0)),t}const jfe=dde.fromClass(class{constructor(e){this.view=e,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(Sfe).map(t=>new Rfe(e,t));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!e.state.facet(Ife),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,i=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(i<.8*(n.to-n.from))}e.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(Ife)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&this.dom.remove();let n=Wle.iter(this.view.state.facet(wfe),this.view.viewport.from),i=[],r=this.gutters.map(e=>new Nfe(e,this.view.viewport,-this.view.documentPadding.top));for(let e of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(e.type)){let t=!0;for(let o of e.type)if(o.type==vue.Text&&t){Bfe(n,i,o.from);for(let e of r)e.line(this.view,o,i);t=!1}else if(o.widget)for(let e of r)e.widget(this.view,o)}else if(e.type==vue.Text){Bfe(n,i,e.from);for(let t of r)t.line(this.view,e,i)}else if(e.widget)for(let t of r)t.widget(this.view,e);for(let e of r)e.finish();e&&this.view.scrollDOM.insertBefore(this.dom,t)}updateGutters(e){let t=e.startState.facet(Sfe),n=e.state.facet(Sfe),i=e.docChanged||e.heightChanged||e.viewportChanged||!Wle.eq(e.startState.facet(wfe),e.state.facet(wfe),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let t of this.gutters)t.update(e)&&(i=!0);else{i=!0;let r=[];for(let i of n){let n=t.indexOf(i);n<0?r.push(new Rfe(this.view,i)):(this.gutters[n].update(e),r.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),r.indexOf(e)<0&&e.destroy();for(let e of r)this.dom.appendChild(e.dom);this.gutters=r}return i}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove()}},{provide:e=>lpe.scrollMargins.of(t=>{let n=t.plugin(e);return n&&0!=n.gutters.length&&n.fixed?t.textDirection==jue.LTR?{left:n.dom.offsetWidth*t.scaleX}:{right:n.dom.offsetWidth*t.scaleX}:null})});function Tfe(e){return Array.isArray(e)?e:[e]}function Bfe(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class Nfe{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=Wle.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:i}=this,r=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==i.elements.length){let t=new Ofe(e,o,r,n);i.elements.push(t),i.dom.appendChild(t.dom)}else i.elements[this.i].update(e,o,r,n);this.height=t.bottom,this.i++}line(e,t,n){let i=[];Bfe(this.cursor,i,t.from),n.length&&(i=i.concat(n));let r=this.gutter.config.lineMarker(e,t,i);r&&i.unshift(r);let o=this.gutter;(0!=i.length||o.config.renderEmptyElements)&&this.addElement(e,t,i)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t);n&&this.addElement(e,t,[n])}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class Rfe{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let n in t.domEventHandlers)this.dom.addEventListener(n,i=>{let r,o=i.target;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let e=o.getBoundingClientRect();r=(e.top+e.bottom)/2}else r=i.clientY;let s=e.lineBlockAtHeight(r-e.documentTop);t.domEventHandlers[n](e,s,i)&&i.preventDefault()});this.markers=Tfe(t.markers(e)),t.initialSpacer&&(this.spacer=new Ofe(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=Tfe(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!Wle.eq(this.markers,t,n.from,n.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(e)}destroy(){for(let e of this.elements)e.destroy()}}class Ofe{constructor(e,t,n,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,i)}update(e,t,n,i){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),function(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0}(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,t){let n="cm-gutterElement",i=this.dom.firstChild;for(let r=0,o=0;;){let s=o,a=r<t.length?t[r++]:null,l=!1;if(a){let e=a.elementClass;e&&(n+=" "+e);for(let e=o;e<this.markers.length;e++)if(this.markers[e].compare(a)){s=e,l=!0;break}}else s=this.markers.length;for(;o<s;){let e=this.markers[o++];if(e.toDOM){e.destroy(i);let t=i.nextSibling;i.remove(),i=t}}if(!a)break;a.toDOM&&(l?i=i.nextSibling:this.dom.insertBefore(a.toDOM(e),i)),l&&o++}this.dom.className=n,this.markers=t}destroy(){this.setMarkers(null,[])}}const Lfe=nle.define(),Mfe=nle.define({combine:e=>zle(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let e in t){let i=n[e],r=t[e];n[e]=i?(e,t,n)=>i(e,t,n)||r(e,t,n):r}return n}})});class Pfe extends kfe{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Dfe(e,t){return e.state.facet(Mfe).formatNumber(t,e.state)}const Ffe=Sfe.compute([Mfe],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:e=>e.state.facet(Lfe),lineMarker:(e,t,n)=>n.some(e=>e.toDOM)?null:new Pfe(Dfe(e,e.state.doc.lineAt(t.from).number)),widgetMarker:()=>null,lineMarkerChange:e=>e.startState.facet(Mfe)!=e.state.facet(Mfe),initialSpacer:e=>new Pfe(Dfe(e,zfe(e.state.doc.lines))),updateSpacer(e,t){let n=Dfe(t.view,zfe(t.view.state.doc.lines));return n==e.number?e:new Pfe(n)},domEventHandlers:e.facet(Mfe).domEventHandlers}));function zfe(e){let t=9;for(;t<e;)t=10*t+9;return t}const Vfe=new class extends kfe{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},Ufe=wfe.compute(["selection"],e=>{let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.head).from;r>n&&(n=r,t.push(Vfe.range(r)))}return Wle.of(t)}),$fe=1024;let Hfe=0;class Wfe{constructor(e,t){this.from=e,this.to=t}}class Gfe{constructor(e={}){this.id=Hfe++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=Yfe.match(e)),t=>{let n=e(t);return void 0===n?null:[this,n]}}}Gfe.closedBy=new Gfe({deserialize:e=>e.split(" ")}),Gfe.openedBy=new Gfe({deserialize:e=>e.split(" ")}),Gfe.group=new Gfe({deserialize:e=>e.split(" ")}),Gfe.isolate=new Gfe({deserialize:e=>{if(e&&"rtl"!=e&&"ltr"!=e&&"auto"!=e)throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}}),Gfe.contextHash=new Gfe({perNode:!0}),Gfe.lookAhead=new Gfe({perNode:!0}),Gfe.mounted=new Gfe({perNode:!0});class qfe{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}static get(e){return e&&e.props&&e.props[Gfe.mounted.id]}}const Kfe=Object.create(null);class Yfe{constructor(e,t,n,i=0){this.name=e,this.props=t,this.id=n,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):Kfe,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(null==e.name?8:0),i=new Yfe(e.name||"",t,e.id,n);if(e.props)for(let n of e.props)if(Array.isArray(n)||(n=n(i)),n){if(n[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[n[0].id]=n[1]}return i}prop(e){return this.props[e.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(e){if("string"==typeof e){if(this.name==e)return!0;let t=this.prop(Gfe.group);return!!t&&t.indexOf(e)>-1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let i of n.split(" "))t[i]=e[n];return e=>{for(let n=e.prop(Gfe.group),i=-1;i<(n?n.length:0);i++){let r=t[i<0?e.name:n[i]];if(r)return r}}}}Yfe.none=new Yfe("",Object.create(null),0,8);const Jfe=new WeakMap,Xfe=new WeakMap;var Zfe;!function(e){e[e.ExcludeBuffers=1]="ExcludeBuffers",e[e.IncludeAnonymous=2]="IncludeAnonymous",e[e.IgnoreMounts=4]="IgnoreMounts",e[e.IgnoreOverlays=8]="IgnoreOverlays"}(Zfe||(Zfe={}));class Qfe{constructor(e,t,n,i,r){if(this.type=e,this.children=t,this.positions=n,this.length=i,this.props=null,r&&r.length){this.props=Object.create(null);for(let[e,t]of r)this.props["number"==typeof e?e:e.id]=t}}toString(){let e=qfe.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let e of this.children){let n=e.toString();n&&(t&&(t+=","),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new hme(this.topNode,e)}cursorAt(e,t=0,n=0){let i=Jfe.get(this)||this.topNode,r=new hme(i);return r.moveTo(e,t),Jfe.set(this,r._tree),r}get topNode(){return new ome(this,0,0,null)}resolve(e,t=0){let n=ime(Jfe.get(this)||this.topNode,e,t,!1);return Jfe.set(this,n),n}resolveInner(e,t=0){let n=ime(Xfe.get(this)||this.topNode,e,t,!0);return Xfe.set(this,n),n}resolveStack(e,t=0){return function(e,t,n){let i=e.resolveInner(t,n),r=null;for(let e=i instanceof ome?i:i.context.parent;e;e=e.parent)if(e.index<0){let o=e.parent;(r||(r=[i])).push(o.resolve(t,n)),e=o}else{let o=qfe.get(e.tree);if(o&&o.overlay&&o.overlay[0].from<=t&&o.overlay[o.overlay.length-1].to>=t){let s=new ome(o.tree,o.overlay[0].from+e.from,-1,e);(r||(r=[i])).push(ime(s,t,n,!1))}}return r?ume(r):i}(this,e,t)}iterate(e){let{enter:t,leave:n,from:i=0,to:r=this.length}=e,o=e.mode||0,s=(o&Zfe.IncludeAnonymous)>0;for(let e=this.cursor(o|Zfe.IncludeAnonymous);;){let o=!1;if(e.from<=r&&e.to>=i&&(!s&&e.type.isAnonymous||!1!==t(e))){if(e.firstChild())continue;o=!0}for(;o&&n&&(s||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;o=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:gme(Yfe.none,this.children,this.positions,0,this.children.length,0,this.length,(e,t,n)=>new Qfe(this.type,e,t,n,this.propValues),e.makeTree||((e,t,n)=>new Qfe(Yfe.none,e,t,n)))}static build(e){return function(e){var t;let{buffer:n,nodeSet:i,maxBufferLength:r=$fe,reused:o=[],minRepeatType:s=i.types.length}=e,a=Array.isArray(n)?new eme(n,n.length):n,l=i.types,c=0,u=0;function d(e,t,n,g,b,y){let{id:v,start:_,end:x,size:k}=a,w=u;for(;k<0;){if(a.next(),-1==k){let t=o[v];return n.push(t),void g.push(_-e)}if(-3==k)return void(c=v);if(-4==k)return void(u=v);throw new RangeError(`Unrecognized record size: ${k}`)}let C,S,A=l[v],I=_-e;if(x-_<=r&&(S=function(e,t){let n=a.fork(),i=0,o=0,l=0,c=n.end-r,u={size:0,start:0,skip:0};e:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){u.size=i,u.start=o,u.skip=l,l+=4,i+=4,n.next();continue}let a=n.pos-e;if(e<0||a<r||n.start<c)break;let d=n.id>=s?4:0,h=n.start;for(n.next();n.pos>a;){if(n.size<0){if(-3!=n.size)break e;d+=4}else n.id>=s&&(d+=4);n.next()}o=h,i+=e,l+=d}return(t<0||i==e)&&(u.size=i,u.start=o,u.skip=l),u.size>4?u:void 0}(a.pos-t,b))){let t=new Uint16Array(S.size-S.skip),n=a.pos-S.size,r=t.length;for(;a.pos>n;)r=m(S.start,t,r);C=new tme(t,x-S.start,i),I=S.start-e}else{let e=a.pos-k;a.next();let t=[],n=[],i=v>=s?v:-1,o=0,l=x;for(;a.pos>e;)i>=0&&a.id==i&&a.size>=0?(a.end<=l-r&&(p(t,n,_,o,a.end,l,i,w),o=t.length,l=a.end),a.next()):y>2500?h(_,e,t,n):d(_,e,t,n,i,y+1);if(i>=0&&o>0&&o<t.length&&p(t,n,_,o,_,l,i,w),t.reverse(),n.reverse(),i>-1&&o>0){let e=function(e){return(t,n,i)=>{let r,o,s=0,a=t.length-1;if(a>=0&&(r=t[a])instanceof Qfe){if(!a&&r.type==e&&r.length==i)return r;(o=r.prop(Gfe.lookAhead))&&(s=n[a]+r.length+o)}return f(e,t,n,i,s)}}(A);C=gme(A,t,n,0,t.length,0,x-_,e,e)}else C=f(A,t,n,x-_,w-x)}n.push(C),g.push(I)}function h(e,t,n,o){let s=[],l=0,c=-1;for(;a.pos>t;){let{id:e,start:t,end:n,size:i}=a;if(i>4)a.next();else{if(c>-1&&t<c)break;c<0&&(c=n-r),s.push(e,t,n),l++,a.next()}}if(l){let t=new Uint16Array(4*l),r=s[s.length-2];for(let e=s.length-3,n=0;e>=0;e-=3)t[n++]=s[e],t[n++]=s[e+1]-r,t[n++]=s[e+2]-r,t[n++]=n;n.push(new tme(t,s[2]-r,i)),o.push(r-e)}}function p(e,t,n,r,o,s,a,l){let c=[],u=[];for(;e.length>r;)c.push(e.pop()),u.push(t.pop()+n-o);e.push(f(i.types[a],c,u,s-o,l-s)),t.push(o-n)}function f(e,t,n,i,r=0,o){if(c){let e=[Gfe.contextHash,c];o=o?[e].concat(o):[e]}if(r>25){let e=[Gfe.lookAhead,r];o=o?[e].concat(o):[e]}return new Qfe(e,t,n,i,o)}function m(e,t,n){let{id:i,start:r,end:o,size:l}=a;if(a.next(),l>=0&&i<s){let s=n;if(l>4){let i=a.pos-(l-4);for(;a.pos>i;)n=m(e,t,n)}t[--n]=s,t[--n]=o-e,t[--n]=r-e,t[--n]=i}else-3==l?c=i:-4==l&&(u=i);return n}let g=[],b=[];for(;a.pos>0;)d(e.start||0,e.bufferStart||0,g,b,-1,0);let y=null!==(t=e.length)&&void 0!==t?t:g.length?b[0]+g[0].length:0;return new Qfe(l[e.topID],g.reverse(),b.reverse(),y)}(e)}}Qfe.empty=new Qfe(Yfe.none,[],[],0);class eme{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new eme(this.buffer,this.index)}}class tme{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return Yfe.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],n=this.buffer[e+3],i=this.set.types[t],r=i.name;if(/\W/.test(r)&&!i.isError&&(r=JSON.stringify(r)),n==(e+=4))return r;let o=[];for(;e<n;)o.push(this.childString(e)),e=this.buffer[e+3];return r+"("+o.join(",")+")"}findChild(e,t,n,i,r){let{buffer:o}=this,s=-1;for(let a=e;a!=t&&!(nme(r,i,o[a+1],o[a+2])&&(s=a,n>0));a=o[a+3]);return s}slice(e,t,n){let i=this.buffer,r=new Uint16Array(t-e),o=0;for(let s=e,a=0;s<t;){r[a++]=i[s++],r[a++]=i[s++]-n;let t=r[a++]=i[s++]-n;r[a++]=i[s++]-e,o=Math.max(o,t)}return new tme(r,o,this.set)}}function nme(e,t,n,i){switch(e){case-2:return n<t;case-1:return i>=t&&n<t;case 0:return n<t&&i>t;case 1:return n<=t&&i>t;case 2:return i>t;case 4:return!0}}function ime(e,t,n,i){for(var r;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!i&&e instanceof ome&&e.index<0?null:e.parent;if(!t)return e;e=t}let o=i?0:Zfe.IgnoreOverlays;if(i)for(let i=e,s=i.parent;s;i=s,s=i.parent)i instanceof ome&&i.index<0&&(null===(r=s.enter(t,n,o))||void 0===r?void 0:r.from)!=i.from&&(e=s);for(;;){let i=e.enter(t,n,o);if(!i)return e;e=i}}class rme{cursor(e=0){return new hme(this,e)}getChild(e,t=null,n=null){let i=sme(this,e,t,n);return i.length?i[0]:null}getChildren(e,t=null,n=null){return sme(this,e,t,n)}resolve(e,t=0){return ime(this,e,t,!1)}resolveInner(e,t=0){return ime(this,e,t,!0)}matchContext(e){return ame(this,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}}class ome extends rme{constructor(e,t,n,i){super(),this._tree=e,this.from=t,this.index=n,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,n,i,r=0){for(let o=this;;){for(let{children:s,positions:a}=o._tree,l=t>0?s.length:-1;e!=l;e+=t){let l=s[e],c=a[e]+o.from;if(nme(i,n,c,c+l.length))if(l instanceof tme){if(r&Zfe.ExcludeBuffers)continue;let s=l.findChild(0,l.buffer.length,t,n-c,i);if(s>-1)return new cme(new lme(o,l,e,c),null,s)}else if(r&Zfe.IncludeAnonymous||!l.type.isAnonymous||pme(l)){let s;if(!(r&Zfe.IgnoreMounts)&&(s=qfe.get(l))&&!s.overlay)return new ome(s.tree,c,e,o);let a=new ome(l,c,e,o);return r&Zfe.IncludeAnonymous||!a.type.isAnonymous?a:a.nextChild(t<0?l.children.length-1:0,t,n,i)}}if(r&Zfe.IncludeAnonymous||!o.type.isAnonymous)return null;if(e=o.index>=0?o.index+t:t<0?-1:o._parent._tree.children.length,o=o._parent,!o)return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,n=0){let i;if(!(n&Zfe.IgnoreOverlays)&&(i=qfe.get(this._tree))&&i.overlay){let n=e-this.from;for(let{from:e,to:r}of i.overlay)if((t>0?e<=n:e<n)&&(t<0?r>=n:r>n))return new ome(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function sme(e,t,n,i){let r=e.cursor(),o=[];if(!r.firstChild())return o;if(null!=n)for(let e=!1;!e;)if(e=r.type.is(n),!r.nextSibling())return o;for(;;){if(null!=i&&r.type.is(i))return o;if(r.type.is(t)&&o.push(r.node),!r.nextSibling())return null==i?o:[]}}function ame(e,t,n=t.length-1){for(let i=e.parent;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(t[n]&&t[n]!=i.name)return!1;n--}}return!0}class lme{constructor(e,t,n,i){this.parent=e,this.buffer=t,this.index=n,this.start=i}}class cme extends rme{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:i}=this.context,r=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,n);return r<0?null:new cme(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,n=0){if(n&Zfe.ExcludeBuffers)return null;let{buffer:i}=this.context,r=i.findChild(this.index+4,i.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new cme(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new cme(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new cme(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,i=this.index+4,r=n.buffer[this.index+3];if(r>i){let o=n.buffer[this.index+1];e.push(n.slice(i,r,o)),t.push(0)}return new Qfe(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function ume(e){if(!e.length)return null;let t=0,n=e[0];for(let i=1;i<e.length;i++){let r=e[i];(r.from>n.from||r.to<n.to)&&(n=r,t=i)}let i=n instanceof ome&&n.index<0?null:n.parent,r=e.slice();return i?r[t]=i:r.splice(t,1),new dme(r,n)}class dme{constructor(e,t){this.heads=e,this.node=t}get next(){return ume(this.heads)}}class hme{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof ome)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return!!e&&(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0)}yieldBuf(e,t){this.index=e;let{start:n,buffer:i}=this.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=n+i.buffer[e+1],this.to=n+i.buffer[e+2],!0}yield(e){return!!e&&(e instanceof ome?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)))}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:i}=this.buffer,r=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,n);return!(r<0)&&(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?!(n&Zfe.ExcludeBuffers)&&this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Zfe.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Zfe.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode));let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(i.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=i)}else({index:t,_parent:n}=this._tree);for(;n;({index:t,_parent:n}=n))if(t>-1)for(let i=t+e,r=e<0?-1:n._tree.children.length;i!=r;i+=e){let e=n._tree.children[i];if(this.mode&Zfe.IncludeAnonymous||e instanceof tme||!e.type.isAnonymous||pme(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)e:for(let i=this.index,r=this.stack.length;r>=0;){for(let o=e;o;o=o._parent)if(o.index==i){if(i==this.index)return o;t=o,n=r+1;break e}i=this.stack[--r]}for(let e=n;e<this.stack.length;e++)t=new cme(this.buffer,t,this.stack[e]);return this.bufferNode=new cme(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let i=!1;if(this.type.isAnonymous||!1!==e(this)){if(this.firstChild()){n++;continue}this.type.isAnonymous||(i=!0)}for(;i&&t&&t(this),i=this.type.isAnonymous,!this.nextSibling();){if(!n)return;this.parent(),n--,i=!0}}}matchContext(e){if(!this.buffer)return ame(this.node,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let i=e.length-1,r=this.stack.length-1;i>=0;r--){if(r<0)return ame(this.node,e,i);let o=n[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[i]&&e[i]!=o.name)return!1;i--}}return!0}}function pme(e){return e.children.some(e=>e instanceof tme||!e.type.isAnonymous||pme(e))}const fme=new WeakMap;function mme(e,t){if(!e.isAnonymous||t instanceof tme||t.type!=e)return 1;let n=fme.get(t);if(null==n){n=1;for(let i of t.children){if(i.type!=e||!(i instanceof Qfe)){n=1;break}n+=mme(e,i)}fme.set(t,n)}return n}function gme(e,t,n,i,r,o,s,a,l){let c=0;for(let n=i;n<r;n++)c+=mme(e,t[n]);let u=Math.ceil(1.5*c/8),d=[],h=[];return function t(n,i,r,s,a){for(let c=r;c<s;){let r=c,p=i[c],f=mme(e,n[c]);for(c++;c<s;c++){let t=mme(e,n[c]);if(f+t>=u)break;f+=t}if(c==r+1){if(f>u){let e=n[r];t(e.children,e.positions,0,e.children.length,i[r]+a);continue}d.push(n[r])}else{let t=i[c-1]+n[c-1].length-p;d.push(gme(e,n,i,r,c,p,t,null,l))}h.push(p+a-o)}}(t,n,i,r,0),(a||l)(d,h,s)}class bme{constructor(e,t,n,i,r=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=i,this.open=(r?1:0)|(o?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(e,t=[],n=!1){let i=[new bme(0,e.length,e,0,!1,n)];for(let n of t)n.to>e.length&&i.push(n);return i}static applyChanges(e,t,n=128){if(!t.length)return e;let i=[],r=1,o=e.length?e[0]:null;for(let s=0,a=0,l=0;;s++){let c=s<t.length?t[s]:null,u=c?c.fromA:1e9;if(u-a>=n)for(;o&&o.from<u;){let t=o;if(a>=t.from||u<=t.to||l){let e=Math.max(t.from,a)-l,n=Math.min(t.to,u)-l;t=e>=n?null:new bme(e,n,t.tree,t.offset+l,s>0,!!c)}if(t&&i.push(t),o.to>u)break;o=r<e.length?e[r++]:null}if(!c)break;a=c.toA,l=c.toA-c.toB}return i}}class yme{startParse(e,t,n){return"string"==typeof e&&(e=new vme(e)),n=n?n.length?n.map(e=>new Wfe(e.from,e.to)):[new Wfe(0,0)]:[new Wfe(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let i=this.startParse(e,t,n);for(;;){let e=i.advance();if(e)return e}}}class vme{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new Gfe({perNode:!0});let _me=0;class xme{constructor(e,t,n){this.set=e,this.base=t,this.modified=n,this.id=_me++}static define(e){if(null==e?void 0:e.base)throw new Error("Can not derive from a modified tag");let t=new xme([],null,[]);if(t.set.push(t),e)for(let n of e.set)t.set.push(n);return t}static defineModifier(){let e=new wme;return t=>t.modified.indexOf(e)>-1?t:wme.get(t.base||t,t.modified.concat(e).sort((e,t)=>e.id-t.id))}}let kme=0;class wme{constructor(){this.instances=[],this.id=kme++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(n=>n.base==e&&function(e,t){return e.length==t.length&&e.every((e,n)=>e==t[n])}(t,n.modified));if(n)return n;let i=[],r=new xme(i,e,t);for(let e of t)e.instances.push(r);let o=function(e){let t=[[]];for(let n=0;n<e.length;n++)for(let i=0,r=t.length;i<r;i++)t.push(t[i].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}(t);for(let t of e.set)if(!t.modified.length)for(let e of o)i.push(wme.get(t,e));return r}}function Cme(e){let t=Object.create(null);for(let n in e){let i=e[n];Array.isArray(i)||(i=[i]);for(let e of n.split(" "))if(e){let n=[],r=2,o=e;for(let t=0;;){if("..."==o&&t>0&&t+3==e.length){r=1;break}let i=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!i)throw new RangeError("Invalid path: "+e);if(n.push("*"==i[0]?"":'"'==i[0][0]?JSON.parse(i[0]):i[0]),t+=i[0].length,t==e.length)break;let s=e[t++];if(t==e.length&&"!"==s){r=0;break}if("/"!=s)throw new RangeError("Invalid path: "+e);o=e.slice(t)}let s=n.length-1,a=n[s];if(!a)throw new RangeError("Invalid path: "+e);let l=new Ame(i,r,s>0?n.slice(0,s):null);t[a]=l.sort(t[a])}}return Sme.add(t)}const Sme=new Gfe;class Ame{constructor(e,t,n,i){this.tags=e,this.mode=t,this.context=n,this.next=i}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}function Ime(e,t){let n=Object.create(null);for(let t of e)if(Array.isArray(t.tag))for(let e of t.tag)n[e.id]=t.class;else n[t.tag.id]=t.class;let{scope:i,all:r=null}=t||{};return{style:e=>{let t=r;for(let i of e)for(let e of i.set){let i=n[e.id];if(i){t=t?t+" "+i:i;break}}return t},scope:i}}function Eme(e,t,n,i=0,r=e.length){let o=new jme(i,Array.isArray(t)?t:[t],n);o.highlightRange(e.cursor(),i,r,"",o.highlighters),o.flush(r)}Ame.empty=new Ame([],2,null);class jme{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,i,r){let{type:o,from:s,to:a}=e;if(s>=n||a<=t)return;o.isTop&&(r=this.highlighters.filter(e=>!e.scope||e.scope(o)));let l=i,c=function(e){let t=e.type.prop(Sme);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}(e)||Ame.empty,u=function(e,t){let n=null;for(let i of e){let e=i.style(t);e&&(n=n?n+" "+e:e)}return n}(r,c.tags);if(u&&(l&&(l+=" "),l+=u,1==c.mode&&(i+=(i?" ":"")+u)),this.startSpan(Math.max(t,s),l),c.opaque)return;let d=e.tree&&e.tree.prop(Gfe.mounted);if(d&&d.overlay){let o=e.node.enter(d.overlay[0].from+s,1),c=this.highlighters.filter(e=>!e.scope||e.scope(d.tree.type)),u=e.firstChild();for(let h=0,p=s;;h++){let f=h<d.overlay.length?d.overlay[h]:null,m=f?f.from+s:a,g=Math.max(t,p),b=Math.min(n,m);if(g<b&&u)for(;e.from<b&&(this.highlightRange(e,g,b,i,r),this.startSpan(Math.min(b,e.to),l),!(e.to>=m)&&e.nextSibling()););if(!f||m>n)break;p=f.to+s,p>t&&(this.highlightRange(o.cursor(),Math.max(t,f.from+s),Math.min(n,p),"",c),this.startSpan(Math.min(n,p),l))}u&&e.parent()}else if(e.firstChild()){d&&(i="");do{if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,i,r),this.startSpan(Math.min(n,e.to),l)}}while(e.nextSibling());e.parent()}}}const Tme=xme.define,Bme=Tme(),Nme=Tme(),Rme=Tme(Nme),Ome=Tme(Nme),Lme=Tme(),Mme=Tme(Lme),Pme=Tme(Lme),Dme=Tme(),Fme=Tme(Dme),zme=Tme(),Vme=Tme(),Ume=Tme(),$me=Tme(Ume),Hme=Tme(),Wme={comment:Bme,lineComment:Tme(Bme),blockComment:Tme(Bme),docComment:Tme(Bme),name:Nme,variableName:Tme(Nme),typeName:Rme,tagName:Tme(Rme),propertyName:Ome,attributeName:Tme(Ome),className:Tme(Nme),labelName:Tme(Nme),namespace:Tme(Nme),macroName:Tme(Nme),literal:Lme,string:Mme,docString:Tme(Mme),character:Tme(Mme),attributeValue:Tme(Mme),number:Pme,integer:Tme(Pme),float:Tme(Pme),bool:Tme(Lme),regexp:Tme(Lme),escape:Tme(Lme),color:Tme(Lme),url:Tme(Lme),keyword:zme,self:Tme(zme),null:Tme(zme),atom:Tme(zme),unit:Tme(zme),modifier:Tme(zme),operatorKeyword:Tme(zme),controlKeyword:Tme(zme),definitionKeyword:Tme(zme),moduleKeyword:Tme(zme),operator:Vme,derefOperator:Tme(Vme),arithmeticOperator:Tme(Vme),logicOperator:Tme(Vme),bitwiseOperator:Tme(Vme),compareOperator:Tme(Vme),updateOperator:Tme(Vme),definitionOperator:Tme(Vme),typeOperator:Tme(Vme),controlOperator:Tme(Vme),punctuation:Ume,separator:Tme(Ume),bracket:$me,angleBracket:Tme($me),squareBracket:Tme($me),paren:Tme($me),brace:Tme($me),content:Dme,heading:Fme,heading1:Tme(Fme),heading2:Tme(Fme),heading3:Tme(Fme),heading4:Tme(Fme),heading5:Tme(Fme),heading6:Tme(Fme),contentSeparator:Tme(Dme),list:Tme(Dme),quote:Tme(Dme),emphasis:Tme(Dme),strong:Tme(Dme),link:Tme(Dme),monospace:Tme(Dme),strikethrough:Tme(Dme),inserted:Tme(),deleted:Tme(),changed:Tme(),invalid:Tme(),meta:Hme,documentMeta:Tme(Hme),annotation:Tme(Hme),processingInstruction:Tme(Hme),definition:xme.defineModifier(),constant:xme.defineModifier(),function:xme.defineModifier(),standard:xme.defineModifier(),local:xme.defineModifier(),special:xme.defineModifier()};var Gme;Ime([{tag:Wme.link,class:"tok-link"},{tag:Wme.heading,class:"tok-heading"},{tag:Wme.emphasis,class:"tok-emphasis"},{tag:Wme.strong,class:"tok-strong"},{tag:Wme.keyword,class:"tok-keyword"},{tag:Wme.atom,class:"tok-atom"},{tag:Wme.bool,class:"tok-bool"},{tag:Wme.url,class:"tok-url"},{tag:Wme.labelName,class:"tok-labelName"},{tag:Wme.inserted,class:"tok-inserted"},{tag:Wme.deleted,class:"tok-deleted"},{tag:Wme.literal,class:"tok-literal"},{tag:Wme.string,class:"tok-string"},{tag:Wme.number,class:"tok-number"},{tag:[Wme.regexp,Wme.escape,Wme.special(Wme.string)],class:"tok-string2"},{tag:Wme.variableName,class:"tok-variableName"},{tag:Wme.local(Wme.variableName),class:"tok-variableName tok-local"},{tag:Wme.definition(Wme.variableName),class:"tok-variableName tok-definition"},{tag:Wme.special(Wme.variableName),class:"tok-variableName2"},{tag:Wme.definition(Wme.propertyName),class:"tok-propertyName tok-definition"},{tag:Wme.typeName,class:"tok-typeName"},{tag:Wme.namespace,class:"tok-namespace"},{tag:Wme.className,class:"tok-className"},{tag:Wme.macroName,class:"tok-macroName"},{tag:Wme.propertyName,class:"tok-propertyName"},{tag:Wme.operator,class:"tok-operator"},{tag:Wme.comment,class:"tok-comment"},{tag:Wme.meta,class:"tok-meta"},{tag:Wme.invalid,class:"tok-invalid"},{tag:Wme.punctuation,class:"tok-punctuation"}]);const qme=new Gfe,Kme=new Gfe;class Yme{constructor(e,t,n=[],i=""){this.data=e,this.name=i,Fle.prototype.hasOwnProperty("tree")||Object.defineProperty(Fle.prototype,"tree",{get(){return Xme(this)}}),this.parser=t,this.extension=[sge.of(this),Fle.languageData.of((e,t,n)=>{let i=Jme(e,t,n),r=i.type.prop(qme);if(!r)return[];let o=e.facet(r),s=i.type.prop(Kme);if(s){let r=i.resolve(t-i.from,n);for(let t of s)if(t.test(r,e)){let n=e.facet(t.facet);return"replace"==t.type?n:n.concat(o)}}return o})].concat(n)}isActiveAt(e,t,n=-1){return Jme(e,t,n).type.prop(qme)==this.data}findRegions(e){let t=e.facet(sge);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],i=(e,t)=>{if(e.prop(qme)==this.data)return void n.push({from:t,to:t+e.length});let r=e.prop(Gfe.mounted);if(r){if(r.tree.prop(qme)==this.data){if(r.overlay)for(let e of r.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}if(r.overlay){let e=n.length;if(i(r.tree,r.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let r=e.children[n];r instanceof Qfe&&i(r,e.positions[n]+t)}};return i(Xme(e),0),n}get allowsNesting(){return!0}}function Jme(e,t,n){let i=e.facet(sge),r=Xme(e).topNode;if(!i||i.allowsNesting)for(let e=r;e;e=e.enter(t,n,Zfe.ExcludeBuffers))e.type.isTop&&(r=e);return r}function Xme(e){let t=e.field(Yme.state,!1);return t?t.tree:Qfe.empty}Yme.setState=Ele.define();class Zme{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let Qme=null;class ege{constructor(e,t,n=[],i,r,o,s,a){this.parser=e,this.state=t,this.fragments=n,this.tree=i,this.treeLen=r,this.viewport=o,this.skipped=s,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new ege(e,t,[],Qfe.empty,0,n,[],null)}startParse(){return this.parser.startParse(new Zme(this.state.doc),this.fragments)}work(e,t){return null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=Qfe.empty&&this.isDone(null!=t?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;if("number"==typeof e){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||(this.parse=this.startParse()),null!=t&&(null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let i=this.parse.advance();if(i){if(this.fragments=this.withoutTempSkipped(bme.addTree(i,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!==(n=this.parse.stoppedAt)&&void 0!==n?n:this.state.doc.length,this.tree=i,this.parse=null,!(this.treeLen<(null!=t?t:this.state.doc.length)))return!0;this.parse=this.startParse()}if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(bme.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Qme;Qme=this;try{return e()}finally{Qme=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=tge(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:i,treeLen:r,viewport:o,skipped:s}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges((e,n,i,r)=>t.push({fromA:e,toA:n,fromB:i,toB:r})),n=bme.applyChanges(n,t),i=Qfe.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){s=[];for(let t of this.skipped){let n=e.mapPos(t.from,1),i=e.mapPos(t.to,-1);n<i&&s.push({from:n,to:i})}}}return new ege(this.parser,t,n,i,r,o,s,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:i}=this.skipped[t];n<e.to&&i>e.from&&(this.fragments=tge(this.fragments,n,i),this.skipped.splice(t--,1))}return!(this.skipped.length>=t||(this.reset(),0))}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends yme{createParse(t,n,i){let r=i[0].from,o=i[i.length-1].to,s={parsedPos:r,advance(){let t=Qme;if(t){for(let e of i)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=o,new Qfe(Yfe.none,[],[],o-r)},stoppedAt:null,stopAt(){}};return s}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}static get(){return Qme}}function tge(e,t,n){return bme.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class nge{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new nge(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=ege.create(e.facet(sge).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new nge(n)}}Yme.state=cle.define({create:nge.init,update(e,t){for(let e of t.effects)if(e.is(Yme.setState))return e.value;return t.startState.facet(sge)!=t.state.facet(sge)?nge.init(t.state):e.apply(t)}});let ige=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};"undefined"!=typeof requestIdleCallback&&(ige=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const rge="undefined"!=typeof navigator&&(null===(Gme=navigator.scheduling)||void 0===Gme?void 0:Gme.isInputPending)?()=>navigator.scheduling.isInputPending():null,oge=dde.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Yme.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Yme.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=ige(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:i}}=this.view,r=n.field(Yme.state);if(r.tree==r.context.tree&&r.context.isDone(i+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!rge?Math.max(25,e.timeRemaining()-5):1e9),s=r.context.treeLen<i&&n.doc.length>i+1e3,a=r.context.work(()=>rge&&rge()||Date.now()>o,i+(s?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Yme.setState.of(new nge(r.context))})),this.chunkBudget>0&&(!a||s)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>ade(this.view.state,e)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),sge=nle.define({combine:e=>e.length?e[0]:null,enables:e=>[Yme.state,oge,lpe.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]}),age=nle.define(),lge=nle.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function cge(e){let t=e.facet(lge);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function uge(e,t){let n="",i=e.tabSize,r=e.facet(lge)[0];if("\t"==r){for(;t>=i;)n+="\t",t-=i;r=" "}for(let e=0;e<t;e++)n+=r;return n}function dge(e,t){e instanceof Fle&&(e=new hge(e));for(let n of e.state.facet(age)){let i=n(e,t);if(void 0!==i)return i}let n=Xme(e.state);return n.length>=t?function(e,t,n){let i=t.resolveStack(n),r=i.node.enterUnfinishedNodesBefore(n);if(r!=i.node){let e=[];for(let t=r;t!=i.node;t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)i={node:e[t],next:i}}return fge(i,e,n)}(e,n,t):null}class hge{constructor(e,t={}){this.state=e,this.options=t,this.unit=cge(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:r}=this.options;return null!=i&&i>=n.from&&i<=n.to?r&&i==e?{text:"",from:e}:(t<0?i<e:i<=e)?{text:n.text.slice(i-n.from),from:i}:{text:n.text.slice(0,i-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:n,from:i}=this.lineAt(e,t);return n.slice(e-i,Math.min(n.length,e+100-i))}column(e,t=1){let{text:n,from:i}=this.lineAt(e,t),r=this.countColumn(n,e-i),o=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return o>-1&&(r+=o-this.countColumn(n,n.search(/\S|$/))),r}countColumn(e,t=e.length){return ice(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:i}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let e=r(i);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const pge=new Gfe;function fge(e,t,n){for(let i=e;i;i=i.next){let e=mge(i.node);if(e)return e(bge.create(t,n,i))}return 0}function mge(e){let t=e.type.prop(pge);if(t)return t;let n,i=e.firstChild;if(i&&(n=i.type.prop(Gfe.closedBy))){let t=e.lastChild,i=t&&n.indexOf(t.name)>-1;return e=>function(e,t,n,i,r){let o=e.textAfter,s=o.match(/^\s*/)[0].length,a=i&&o.slice(s,s+i.length)==i||r==e.pos+s,l=t?function(e){let t=e.node,n=t.childAfter(t.from),i=t.lastChild;if(!n)return null;let r=e.options.simulateBreak,o=e.state.doc.lineAt(n.from),s=null==r||r<=o.from?o.to:Math.min(o.to,r);for(let e=n.to;;){let r=t.childAfter(e);if(!r||r==i)return null;if(!r.type.isSkipped)return r.from<s?n:null;e=r.to}}(e):null;return l?a?e.column(l.from):e.column(l.to):e.baseIndent+(a?0:e.unit*n)}(e,!0,1,void 0,i&&!function(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}(e)?t.from:void 0)}return null==e.parent?gge:null}function gge(){return 0}class bge extends hge{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new bge(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(yge(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return fge(this.context.next,this.base,this.pos)}}function yge(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}const vge=nle.define(),_ge=new Gfe;function xge(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function kge(e,t,n){for(let i of e.facet(vge)){let r=i(e,t,n);if(r)return r}return function(e,t,n){let i=Xme(e);if(i.length<n)return null;let r=null;for(let o=i.resolveStack(n,1);o;o=o.next){let s=o.node;if(s.to<=n||s.from>n)continue;if(r&&s.from<t)break;let a=s.type.prop(_ge);if(a&&(s.to<i.length-50||i.length==e.doc.length||!xge(s))){let i=a(s,e);i&&i.from<=n&&i.from>=t&&i.to>n&&(r=i)}}return r}(e,t,n)}function wge(e,t){let n=t.mapPos(e.from,1),i=t.mapPos(e.to,-1);return n>=i?void 0:{from:n,to:i}}const Cge=Ele.define({map:wge}),Sge=Ele.define({map:wge});function Age(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(e=>e.from<=n&&e.to>=n)||t.push(e.lineBlockAt(n));return t}const Ige=cle.define({create:()=>_ue.none,update(e,t){e=e.map(t.changes);for(let n of t.effects)if(n.is(Cge)&&!jge(e,n.value.from,n.value.to)){let{preparePlaceholder:i}=t.state.facet(Oge),r=i?_ue.replace({widget:new Dge(i(t.state,n.value))}):Pge;e=e.update({add:[r.range(n.value.from,n.value.to)]})}else n.is(Sge)&&(e=e.update({filter:(e,t)=>n.value.from!=e||n.value.to!=t,filterFrom:n.value.from,filterTo:n.value.to}));if(t.selection){let n=!1,{head:i}=t.selection.main;e.between(i,i,(e,t)=>{e<i&&t>i&&(n=!0)}),n&&(e=e.update({filterFrom:i,filterTo:i,filter:(e,t)=>t<=i||e>=i}))}return e},provide:e=>lpe.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(e,t)=>{n.push(e,t)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n<e.length;){let i=e[n++],r=e[n++];if("number"!=typeof i||"number"!=typeof r)throw new RangeError("Invalid JSON for fold state");t.push(Pge.range(i,r))}return _ue.set(t,!0)}});function Ege(e,t,n){var i;let r=null;return null===(i=e.field(Ige,!1))||void 0===i||i.between(t,n,(e,t)=>{(!r||r.from>e)&&(r={from:e,to:t})}),r}function jge(e,t,n){let i=!1;return e.between(t,t,(e,r)=>{e==t&&r==n&&(i=!0)}),i}function Tge(e,t){return e.field(Ige,!1)?t:t.concat(Ele.appendConfig.of(Lge()))}function Bge(e,t,n=!0){let i=e.state.doc.lineAt(t.from).number,r=e.state.doc.lineAt(t.to).number;return lpe.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${i} ${e.state.phrase("to")} ${r}.`)}const Nge=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:e=>{for(let t of Age(e)){let n=kge(e.state,t.from,t.to);if(n)return e.dispatch({effects:Tge(e.state,[Cge.of(n),Bge(e,n)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:e=>{if(!e.state.field(Ige,!1))return!1;let t=[];for(let n of Age(e)){let i=Ege(e.state,n.from,n.to);i&&t.push(Sge.of(i),Bge(e,i,!1))}return t.length&&e.dispatch({effects:t}),t.length>0}},{key:"Ctrl-Alt-[",run:e=>{let{state:t}=e,n=[];for(let i=0;i<t.doc.length;){let r=e.lineBlockAt(i),o=kge(t,r.from,r.to);o&&n.push(Cge.of(o)),i=(o?e.lineBlockAt(o.to):r).to+1}return n.length&&e.dispatch({effects:Tge(e.state,n)}),!!n.length}},{key:"Ctrl-Alt-]",run:e=>{let t=e.state.field(Ige,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(e,t)=>{n.push(Sge.of({from:e,to:t}))}),e.dispatch({effects:n}),!0}}],Rge={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Oge=nle.define({combine:e=>zle(e,Rge)});function Lge(e){let t=[Ige,Vge];return e&&t.push(Oge.of(e)),t}function Mge(e,t){let{state:n}=e,i=n.facet(Oge),r=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),i=Ege(e.state,n.from,n.to);i&&e.dispatch({effects:Sge.of(i)}),t.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(e,r,t);let o=document.createElement("span");return o.textContent=i.placeholderText,o.setAttribute("aria-label",n.phrase("folded code")),o.title=n.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=r,o}const Pge=_ue.replace({widget:new class extends yue{toDOM(e){return Mge(e,null)}}});class Dge extends yue{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Mge(e,this.value)}}const Fge={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class zge extends kfe{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}const Vge=lpe.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Uge{constructor(e,t){let n;function i(e){let t=lce.newName();return(n||(n=Object.create(null)))["."+t]=e,t}this.specs=e;const r="string"==typeof t.all?t.all:t.all?i(t.all):void 0,o=t.scope;this.scope=o instanceof Yme?e=>e.prop(qme)==o.data:o?e=>e==o:void 0,this.style=Ime(e.map(e=>({tag:e.tag,class:e.class||i(Object.assign({},e,{tag:null}))})),{all:r}).style,this.module=n?new lce(n):null,this.themeType=t.themeType}static define(e,t){return new Uge(e,t||{})}}const $ge=nle.define(),Hge=nle.define({combine:e=>e.length?[e[0]]:null});function Wge(e){let t=e.facet($ge);return t.length?t:e.facet(Hge)}function Gge(e,t){let n,i=[Kge];return e instanceof Uge&&(e.module&&i.push(lpe.styleModule.of(e.module)),n=e.themeType),(null==t?void 0:t.fallback)?i.push(Hge.of(e)):n?i.push($ge.computeN([lpe.darkTheme],t=>t.facet(lpe.darkTheme)==("dark"==n)?[e]:[])):i.push($ge.of(e)),i}class qge{constructor(e){this.markCache=Object.create(null),this.tree=Xme(e.state),this.decorations=this.buildDeco(e,Wge(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=Xme(e.state),n=Wge(e.state),i=n!=Wge(e.startState),{viewport:r}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length<r.to&&!i&&t.type==this.tree.type&&o>=r.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||i)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=r.to)}buildDeco(e,t){if(!t||!this.tree.length)return _ue.none;let n=new Gle;for(let{from:i,to:r}of e.visibleRanges)Eme(this.tree,t,(e,t,i)=>{n.add(e,t,this.markCache[i]||(this.markCache[i]=_ue.mark({class:i})))},i,r);return n.finish()}}const Kge=dle.high(dde.fromClass(qge,{decorations:e=>e.decorations})),Yge=Uge.define([{tag:Wme.meta,color:"#404740"},{tag:Wme.link,textDecoration:"underline"},{tag:Wme.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Wme.emphasis,fontStyle:"italic"},{tag:Wme.strong,fontWeight:"bold"},{tag:Wme.strikethrough,textDecoration:"line-through"},{tag:Wme.keyword,color:"#708"},{tag:[Wme.atom,Wme.bool,Wme.url,Wme.contentSeparator,Wme.labelName],color:"#219"},{tag:[Wme.literal,Wme.inserted],color:"#164"},{tag:[Wme.string,Wme.deleted],color:"#a11"},{tag:[Wme.regexp,Wme.escape,Wme.special(Wme.string)],color:"#e40"},{tag:Wme.definition(Wme.variableName),color:"#00f"},{tag:Wme.local(Wme.variableName),color:"#30a"},{tag:[Wme.typeName,Wme.namespace],color:"#085"},{tag:Wme.className,color:"#167"},{tag:[Wme.special(Wme.variableName),Wme.macroName],color:"#256"},{tag:Wme.definition(Wme.propertyName),color:"#00c"},{tag:Wme.comment,color:"#940"},{tag:Wme.invalid,color:"#f00"}]),Jge=lpe.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Xge="()[]{}",Zge=nle.define({combine:e=>zle(e,{afterCursor:!0,brackets:Xge,maxScanDistance:1e4,renderMatch:tbe})}),Qge=_ue.mark({class:"cm-matchingBracket"}),ebe=_ue.mark({class:"cm-nonmatchingBracket"});function tbe(e){let t=[],n=e.matched?Qge:ebe;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}const nbe=cle.define({create:()=>_ue.none,update(e,t){if(!t.docChanged&&!t.selection)return e;let n=[],i=t.state.facet(Zge);for(let e of t.state.selection.ranges){if(!e.empty)continue;let r=abe(t.state,e.head,-1,i)||e.head>0&&abe(t.state,e.head-1,1,i)||i.afterCursor&&(abe(t.state,e.head,1,i)||e.head<t.state.doc.length&&abe(t.state,e.head+1,-1,i));r&&(n=n.concat(i.renderMatch(r,t.state)))}return _ue.set(n,!0)},provide:e=>lpe.decorations.from(e)}),ibe=[nbe,Jge],rbe=new Gfe;function obe(e,t,n){let i=e.prop(t<0?Gfe.openedBy:Gfe.closedBy);if(i)return i;if(1==e.name.length){let i=n.indexOf(e.name);if(i>-1&&i%2==(t<0?1:0))return[n[i+t]]}return null}function sbe(e){let t=e.type.prop(rbe);return t?t(e.node):e}function abe(e,t,n,i={}){let r=i.maxScanDistance||1e4,o=i.brackets||Xge,s=Xme(e),a=s.resolveInner(t,n);for(let e=a;e;e=e.parent){let i=obe(e.type,n,o);if(i&&e.from<e.to){let r=sbe(e);if(r&&(n>0?t>=r.from&&t<r.to:t>r.from&&t<=r.to))return lbe(0,0,n,e,r,i,o)}}return function(e,t,n,i,r,o,s){let a=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),l=s.indexOf(a);if(l<0||l%2==0!=n>0)return null;let c={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),d=0;for(let e=0;!u.next().done&&e<=o;){let o=u.value;n<0&&(e+=o.length);let a=t+e*n;for(let e=n>0?0:o.length-1,t=n>0?o.length:-1;e!=t;e+=n){let t=s.indexOf(o[e]);if(!(t<0||i.resolveInner(a+e,1).type!=r))if(t%2==0==n>0)d++;else{if(1==d)return{start:c,end:{from:a+e,to:a+e+1},matched:t>>1==l>>1};d--}}n>0&&(e+=o.length)}return u.done?{start:c,matched:!1}:null}(e,t,n,s,a.type,r,o)}function lbe(e,t,n,i,r,o,s){let a=i.parent,l={from:r.from,to:r.to},c=0,u=null==a?void 0:a.cursor();if(u&&(n<0?u.childBefore(i.from):u.childAfter(i.to)))do{if(n<0?u.to<=i.from:u.from>=i.to){if(0==c&&o.indexOf(u.type.name)>-1&&u.from<u.to){let e=sbe(u);return{start:l,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}if(obe(u.type,n,s))c++;else if(obe(u.type,-n,s)){if(0==c){let e=sbe(u);return{start:l,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}c--}}}while(n<0?u.prevSibling():u.nextSibling());return{start:l,matched:!1}}const cbe=Object.create(null),ube=[Yfe.none],dbe=[],hbe=Object.create(null),pbe=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])pbe[e]=mbe(cbe,t);function fbe(e,t){dbe.indexOf(e)>-1||(dbe.push(e),console.warn(t))}function mbe(e,t){let n=[];for(let i of t.split(" ")){let t=[];for(let n of i.split(".")){let i=e[n]||Wme[n];i?"function"==typeof i?t.length?t=t.map(i):fbe(n,`Modifier ${n} used at start of tag`):t.length?fbe(n,`Tag ${n} used as modifier`):t=Array.isArray(i)?i:[i]:fbe(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let i=t.replace(/ /g,"_"),r=i+" "+n.map(e=>e.id),o=hbe[r];if(o)return o.id;let s=hbe[r]=Yfe.define({id:ube.length,name:i,props:[Cme({[i]:n})]});return ube.push(s),s.id}function gbe(e,t){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let r=e(t,n);return!!r&&(i(n.update(r)),!0)}}jue.RTL,jue.LTR;const bbe=gbe(kbe,0),ybe=gbe(xbe,0),vbe=gbe((e,t)=>xbe(e,t,function(e){let t=[];for(let n of e.selection.ranges){let i=e.doc.lineAt(n.from),r=n.to<=i.to?i:e.doc.lineAt(n.to),o=t.length-1;o>=0&&t[o].to>i.from?t[o].to=r.to:t.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return t}(t)),0);function _be(e,t){let n=e.languageDataAt("commentTokens",t);return n.length?n[0]:{}}function xbe(e,t,n=t.selection.ranges){let i=n.map(e=>_be(t,e.from).block);if(!i.every(e=>e))return null;let r=n.map((e,n)=>function(e,{open:t,close:n},i,r){let o,s,a=e.sliceDoc(i-50,i),l=e.sliceDoc(r,r+50),c=/\s*$/.exec(a)[0].length,u=/^\s*/.exec(l)[0].length,d=a.length-c;if(a.slice(d-t.length,d)==t&&l.slice(u,u+n.length)==n)return{open:{pos:i-c,margin:c&&1},close:{pos:r+u,margin:u&&1}};r-i<=100?o=s=e.sliceDoc(i,r):(o=e.sliceDoc(i,i+50),s=e.sliceDoc(r-50,r));let h=/^\s*/.exec(o)[0].length,p=/\s*$/.exec(s)[0].length,f=s.length-p-n.length;return o.slice(h,h+t.length)==t&&s.slice(f,f+n.length)==n?{open:{pos:i+h+t.length,margin:/\s/.test(o.charAt(h+t.length))?1:0},close:{pos:r-p-n.length,margin:/\s/.test(s.charAt(f-1))?1:0}}:null}(t,i[n],e.from,e.to));if(2!=e&&!r.every(e=>e))return{changes:t.changes(n.map((e,t)=>r[t]?[]:[{from:e.from,insert:i[t].open+" "},{from:e.to,insert:" "+i[t].close}]))};if(1!=e&&r.some(e=>e)){let e=[];for(let t,n=0;n<r.length;n++)if(t=r[n]){let r=i[n],{open:o,close:s}=t;e.push({from:o.pos-r.open.length,to:o.pos+o.margin},{from:s.pos-s.margin,to:s.pos+r.close.length})}return{changes:e}}return null}function kbe(e,t,n=t.selection.ranges){let i=[],r=-1;for(let{from:e,to:o}of n){let n=i.length,s=1e9,a=_be(t,e).line;if(a){for(let n=e;n<=o;){let l=t.doc.lineAt(n);if(l.from>r&&(e==o||o>l.from)){r=l.from;let e=/^\s*/.exec(l.text)[0].length,t=e==l.length,n=l.text.slice(e,e+a.length)==a?e:-1;e<l.text.length&&e<s&&(s=e),i.push({line:l,comment:n,token:a,indent:e,empty:t,single:!1})}n=l.to+1}if(s<1e9)for(let e=n;e<i.length;e++)i[e].indent<i[e].line.text.length&&(i[e].indent=s);i.length==n+1&&(i[n].single=!0)}}if(2!=e&&i.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:r,empty:o,single:s}of i)!s&&o||e.push({from:t.from+r,insert:n+" "});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(1!=e&&i.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:r}of i)if(n>=0){let i=t.from+n,o=i+r.length;" "==t.text[o-t.from]&&o++,e.push({from:i,to:o})}return{changes:e}}return null}const wbe=Sle.define(),Cbe=Sle.define(),Sbe=nle.define(),Abe=nle.define({combine:e=>zle(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,i)=>e(n,i)||t(n,i)})}),Ibe=cle.define({create:()=>Ube.empty,update(e,t){let n=t.state.facet(Abe),i=t.annotation(wbe);if(i){let r=Rbe.fromTransaction(t,i.selection),o=i.side,s=0==o?e.undone:e.done;return s=r?Obe(s,s.length,n.minDepth,r):Pbe(s,t.startState.selection),new Ube(0==o?i.rest:s,0==o?s:i.rest)}let r=t.annotation(Cbe);if("full"!=r&&"before"!=r||(e=e.isolate()),!1===t.annotation(jle.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let o=Rbe.fromTransaction(t),s=t.annotation(jle.time),a=t.annotation(jle.userEvent);return o?e=e.addChanges(o,s,a,n,t):t.selection&&(e=e.addSelection(t.startState.selection,s,a,n.newGroupDelay)),"full"!=r&&"after"!=r||(e=e.isolate()),e},toJSON:e=>({done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}),fromJSON:e=>new Ube(e.done.map(Rbe.fromJSON),e.undone.map(Rbe.fromJSON))});function Ebe(e,t){return function({state:n,dispatch:i}){if(!t&&n.readOnly)return!1;let r=n.field(Ibe,!1);if(!r)return!1;let o=r.pop(e,n,t);return!!o&&(i(o),!0)}}const jbe=Ebe(0,!1),Tbe=Ebe(1,!1),Bbe=Ebe(0,!0),Nbe=Ebe(1,!0);class Rbe{constructor(e,t,n,i,r){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=i,this.selectionsAfter=r}setSelAfter(e){return new Rbe(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:null===(e=this.changes)||void 0===e?void 0:e.toJSON(),mapped:null===(t=this.mapped)||void 0===t?void 0:t.toJSON(),startSelection:null===(n=this.startSelection)||void 0===n?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(e){return new Rbe(e.changes&&Wae.fromJSON(e.changes),[],e.mapped&&Hae.fromJSON(e.mapped),e.startSelection&&Qae.fromJSON(e.startSelection),e.selectionsAfter.map(Qae.fromJSON))}static fromTransaction(e,t){let n=Mbe;for(let t of e.startState.facet(Sbe)){let i=t(e);i.length&&(n=n.concat(i))}return!n.length&&e.changes.empty?null:new Rbe(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,Mbe)}static selection(e){return new Rbe(void 0,Mbe,void 0,void 0,e)}}function Obe(e,t,n,i){let r=t+1>n+20?t-n-1:0,o=e.slice(r,t);return o.push(i),o}function Lbe(e,t){return e.length?t.length?e.concat(t):e:t}const Mbe=[];function Pbe(e,t){if(e.length){let n=e[e.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return i.length&&i[i.length-1].eq(t)?e:(i.push(t),Obe(e,e.length-1,1e9,n.setSelAfter(i)))}return[Rbe.selection([t])]}function Dbe(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function Fbe(e,t){if(!e.length)return e;let n=e.length,i=Mbe;for(;n;){let r=zbe(e[n-1],t,i);if(r.changes&&!r.changes.empty||r.effects.length){let t=e.slice(0,n);return t[n-1]=r,t}t=r.mapped,n--,i=r.selectionsAfter}return i.length?[Rbe.selection(i)]:Mbe}function zbe(e,t,n){let i=Lbe(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):Mbe,n);if(!e.changes)return Rbe.selection(i);let r=e.changes.map(t),o=t.mapDesc(e.changes,!0),s=e.mapped?e.mapped.composeDesc(o):o;return new Rbe(r,Ele.mapEffects(e.effects,t),s,e.startSelection.map(o),i)}const Vbe=/^(input\.type|delete)($|\.)/;class Ube{constructor(e,t,n=0,i=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=i}isolate(){return this.prevTime?new Ube(this.done,this.undone):this}addChanges(e,t,n,i,r){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&e.changes&&(!n||Vbe.test(n))&&(!s.selectionsAfter.length&&t-this.prevTime<i.newGroupDelay&&i.joinToEvent(r,function(e,t){let n=[],i=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,r,o)=>{for(let e=0;e<n.length;){let t=n[e++],s=n[e++];o>=t&&r<=s&&(i=!0)}}),i}(s.changes,e.changes))||"input.type.compose"==n)?Obe(o,o.length-1,i.minDepth,new Rbe(e.changes.compose(s.changes),Lbe(e.effects,s.effects),s.mapped,s.startSelection,Mbe)):Obe(o,o.length,i.minDepth,e),new Ube(o,Mbe,t,n)}addSelection(e,t,n,i){let r=this.done.length?this.done[this.done.length-1].selectionsAfter:Mbe;return r.length>0&&t-this.prevTime<i&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&function(e,t){return e.ranges.length==t.ranges.length&&0===e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length}(r[r.length-1],e)?this:new Ube(Pbe(this.done,e),this.undone,t,n)}addMapping(e){return new Ube(Fbe(this.done,e),Fbe(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let i=0==e?this.done:this.undone;if(0==i.length)return null;let r=i[i.length-1],o=r.selectionsAfter[0]||t.selection;if(n&&r.selectionsAfter.length)return t.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:wbe.of({side:e,rest:Dbe(i),selection:o}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0});if(r.changes){let n=1==i.length?Mbe:i.slice(0,i.length-1);return r.mapped&&(n=Fbe(n,r.mapped)),t.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:wbe.of({side:e,rest:n,selection:o}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}return null}}Ube.empty=new Ube(Mbe,Mbe);const $be=[{key:"Mod-z",run:jbe,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Tbe,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Tbe,preventDefault:!0},{key:"Mod-u",run:Bbe,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Nbe,preventDefault:!0}];function Hbe(e,t){return Qae.create(e.ranges.map(t),e.mainIndex)}function Wbe(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Gbe({state:e,dispatch:t},n){let i=Hbe(e.selection,n);return!i.eq(e.selection,!0)&&(t(Wbe(e,i)),!0)}function qbe(e,t){return Qae.cursor(t?e.to:e.from)}function Kbe(e,t){return Gbe(e,n=>n.empty?e.moveByChar(n,t):qbe(n,t))}function Ybe(e){return e.textDirectionAt(e.state.selection.main.head)==jue.LTR}const Jbe=e=>Kbe(e,!Ybe(e)),Xbe=e=>Kbe(e,Ybe(e));function Zbe(e,t){return Gbe(e,n=>n.empty?e.moveByGroup(n,t):qbe(n,t))}function Qbe(e,t,n){if(t.type.prop(n))return!0;let i=t.to-t.from;return i&&(i>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function eye(e,t,n){let i,r,o=Xme(e).resolveInner(t.head),s=n?Gfe.closedBy:Gfe.openedBy;for(let i=t.head;;){let t=n?o.childAfter(i):o.childBefore(i);if(!t)break;Qbe(e,t,s)?o=t:i=n?t.to:t.from}return r=o.type.prop(s)&&(i=n?abe(e,o.from,1):abe(e,o.to,-1))&&i.matched?n?i.end.to:i.end.from:n?o.to:o.from,Qae.cursor(r,n?-1:1)}function tye(e,t){return Gbe(e,n=>{if(!n.empty)return qbe(n,t);let i=e.moveVertically(n,t);return i.head!=n.head?i:e.moveToLineBoundary(n,t)})}"undefined"!=typeof Intl&&Intl.Segmenter;const nye=e=>tye(e,!1),iye=e=>tye(e,!0);function rye(e){let t,n=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,i=0,r=0;if(n){for(let t of e.state.facet(lpe.scrollMargins)){let n=t(e);(null==n?void 0:n.top)&&(i=Math.max(null==n?void 0:n.top,i)),(null==n?void 0:n.bottom)&&(r=Math.max(null==n?void 0:n.bottom,r))}t=e.scrollDOM.clientHeight-i-r}else t=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:i,marginBottom:r,selfScroll:n,height:Math.max(e.defaultLineHeight,t-5)}}function oye(e,t){let n,i=rye(e),{state:r}=e,o=Hbe(r.selection,n=>n.empty?e.moveVertically(n,t,i.height):qbe(n,t));if(o.eq(r.selection))return!1;if(i.selfScroll){let t=e.coordsAtPos(r.selection.main.head),s=e.scrollDOM.getBoundingClientRect(),a=s.top+i.marginTop,l=s.bottom-i.marginBottom;t&&t.top>a&&t.bottom<l&&(n=lpe.scrollIntoView(o.main.head,{y:"start",yMargin:t.top-a}))}return e.dispatch(Wbe(r,o),{effects:n}),!0}const sye=e=>oye(e,!1),aye=e=>oye(e,!0);function lye(e,t,n){let i=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,n);if(r.head==t.head&&r.head!=(n?i.to:i.from)&&(r=e.moveToLineBoundary(t,n,!1)),!n&&r.head==i.from&&i.length){let n=/^\s*/.exec(e.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;n&&t.head!=i.from+n&&(r=Qae.cursor(i.from+n))}return r}function cye(e,t){let n=Hbe(e.state.selection,e=>{let n=t(e);return Qae.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)});return!n.eq(e.state.selection)&&(e.dispatch(Wbe(e.state,n)),!0)}function uye(e,t){return cye(e,n=>e.moveByChar(n,t))}const dye=e=>uye(e,!Ybe(e)),hye=e=>uye(e,Ybe(e));function pye(e,t){return cye(e,n=>e.moveByGroup(n,t))}function fye(e,t){return cye(e,n=>e.moveVertically(n,t))}const mye=e=>fye(e,!1),gye=e=>fye(e,!0);function bye(e,t){return cye(e,n=>e.moveVertically(n,t,rye(e).height))}const yye=e=>bye(e,!1),vye=e=>bye(e,!0),_ye=({state:e,dispatch:t})=>(t(Wbe(e,{anchor:0})),!0),xye=({state:e,dispatch:t})=>(t(Wbe(e,{anchor:e.doc.length})),!0),kye=({state:e,dispatch:t})=>(t(Wbe(e,{anchor:e.selection.main.anchor,head:0})),!0),wye=({state:e,dispatch:t})=>(t(Wbe(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function Cye(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:i}=e,r=i.changeByRange(i=>{let{from:r,to:o}=i;if(r==o){let s=t(i);s<r?(n="delete.backward",s=Sye(e,s,!1)):s>r&&(n="delete.forward",s=Sye(e,s,!0)),r=Math.min(r,s),o=Math.max(o,s)}else r=Sye(e,r,!1),o=Sye(e,o,!0);return r==o?{range:i}:{changes:{from:r,to:o},range:Qae.cursor(r,r<i.head?-1:1)}});return!r.changes.empty&&(e.dispatch(i.update(r,{scrollIntoView:!0,userEvent:n,effects:"delete.selection"==n?lpe.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function Sye(e,t,n){if(e instanceof lpe)for(let i of e.state.facet(lpe.atomicRanges).map(t=>t(e)))i.between(t,t,(e,i)=>{e<t&&i>t&&(t=n?i:e)});return t}const Aye=(e,t,n)=>Cye(e,i=>{let r,o,s=i.from,{state:a}=e,l=a.doc.lineAt(s);if(n&&!t&&s>l.from&&s<l.from+200&&!/[^ \t]/.test(r=l.text.slice(0,s-l.from))){if("\t"==r[r.length-1])return s-1;let e=ice(r,a.tabSize)%cge(a)||cge(a);for(let t=0;t<e&&" "==r[r.length-1-t];t++)s--;o=s}else o=Oae(l.text,s-l.from,t,t)+l.from,o==s&&l.number!=(t?a.doc.lines:1)?o+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(l.text.slice(o-l.from,s-l.from))&&(o=Oae(l.text,o-l.from,!1,!1)+l.from);return o}),Iye=e=>Aye(e,!1,!0),Eye=e=>Aye(e,!0,!1),jye=(e,t)=>Cye(e,n=>{let i=n.head,{state:r}=e,o=r.doc.lineAt(i),s=r.charCategorizer(i);for(let e=null;;){if(i==(t?o.to:o.from)){i==n.head&&o.number!=(t?r.doc.lines:1)&&(i+=t?1:-1);break}let a=Oae(o.text,i-o.from,t)+o.from,l=o.text.slice(Math.min(i,a)-o.from,Math.max(i,a)-o.from),c=s(l);if(null!=e&&c!=e)break;" "==l&&i==n.head||(e=c),i=a}return i}),Tye=e=>jye(e,!1);function Bye(e){let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.from),o=e.doc.lineAt(i.to);if(i.empty||i.to!=o.from||(o=e.doc.lineAt(i.to-1)),n>=r.number){let e=t[t.length-1];e.to=o.to,e.ranges.push(i)}else t.push({from:r.from,to:o.to,ranges:[i]});n=o.number+1}return t}function Nye(e,t,n){if(e.readOnly)return!1;let i=[],r=[];for(let t of Bye(e)){if(n?t.to==e.doc.length:0==t.from)continue;let o=e.doc.lineAt(n?t.to+1:t.from-1),s=o.length+1;if(n){i.push({from:t.to,to:o.to},{from:t.from,insert:o.text+e.lineBreak});for(let n of t.ranges)r.push(Qae.range(Math.min(e.doc.length,n.anchor+s),Math.min(e.doc.length,n.head+s)))}else{i.push({from:o.from,to:t.from},{from:t.to,insert:e.lineBreak+o.text});for(let e of t.ranges)r.push(Qae.range(e.anchor-s,e.head-s))}}return!!i.length&&(t(e.update({changes:i,scrollIntoView:!0,selection:Qae.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0)}function Rye(e,t,n){if(e.readOnly)return!1;let i=[];for(let t of Bye(e))n?i.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):i.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});return t(e.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Oye=Mye(!1),Lye=Mye(!0);function Mye(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=t.changeByRange(n=>{let{from:i,to:r}=n,o=t.doc.lineAt(i),s=!e&&i==r&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n,i=Xme(e).resolveInner(t),r=i.childBefore(t),o=i.childAfter(t);return r&&o&&r.to<=t&&o.from>=t&&(n=r.type.prop(Gfe.closedBy))&&n.indexOf(o.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(o.from).from&&!/\S/.test(e.sliceDoc(r.to,o.from))?{from:r.to,to:o.from}:null}(t,i);e&&(i=r=(r<=o.to?o:t.doc.lineAt(r)).to);let a=new hge(t,{simulateBreak:i,simulateDoubleBreak:!!s}),l=dge(a,i);for(null==l&&(l=ice(/^\s*/.exec(t.doc.lineAt(i).text)[0],t.tabSize));r<o.to&&/\s/.test(o.text[r-o.from]);)r++;s?({from:i,to:r}=s):i>o.from&&i<o.from+100&&!/\S/.test(o.text.slice(0,i))&&(i=o.from);let c=["",uge(t,l)];return s&&c.push(uge(t,a.lineIndent(o.from,-1))),{changes:{from:i,to:r,insert:xae.of(c)},range:Qae.cursor(i+1+c[1].length)}});return n(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function Pye(e,t){let n=-1;return e.changeByRange(i=>{let r=[];for(let o=i.from;o<=i.to;){let s=e.doc.lineAt(o);s.number>n&&(i.empty||i.to>s.from)&&(t(s,r,i),n=s.number),o=s.to+1}let o=e.changes(r);return{changes:r,range:Qae.range(o.mapPos(i.anchor,1),o.mapPos(i.head,1))}})}const Dye=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(Pye(e,(t,n)=>{n.push({from:t.from,insert:e.facet(lge)})}),{userEvent:"input.indent"})),!0),Fye=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(Pye(e,(t,n)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let r=ice(i,e.tabSize),o=0,s=uge(e,Math.max(0,r-cge(e)));for(;o<i.length&&o<s.length&&i.charCodeAt(o)==s.charCodeAt(o);)o++;n.push({from:t.from+o,to:t.from+i.length,insert:s.slice(o)})}),{userEvent:"delete.dedent"})),!0),zye=[{key:"Ctrl-b",run:Jbe,shift:dye,preventDefault:!0},{key:"Ctrl-f",run:Xbe,shift:hye},{key:"Ctrl-p",run:nye,shift:mye},{key:"Ctrl-n",run:iye,shift:gye},{key:"Ctrl-a",run:e=>Gbe(e,t=>Qae.cursor(e.lineBlockAt(t.head).from,1)),shift:e=>cye(e,t=>Qae.cursor(e.lineBlockAt(t.head).from))},{key:"Ctrl-e",run:e=>Gbe(e,t=>Qae.cursor(e.lineBlockAt(t.head).to,-1)),shift:e=>cye(e,t=>Qae.cursor(e.lineBlockAt(t.head).to))},{key:"Ctrl-d",run:Eye},{key:"Ctrl-h",run:Iye},{key:"Ctrl-k",run:e=>Cye(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)})},{key:"Ctrl-Alt-h",run:Tye},{key:"Ctrl-o",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:xae.of(["",""])},range:Qae.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let n=t.from,i=e.doc.lineAt(n),r=n==i.from?n-1:Oae(i.text,n-i.from,!1)+i.from,o=n==i.to?n+1:Oae(i.text,n-i.from,!0)+i.from;return{changes:{from:r,to:o,insert:e.doc.slice(n,o).append(e.doc.slice(r,n))},range:Qae.cursor(o)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:aye}],Vye=[{key:"ArrowLeft",run:Jbe,shift:dye,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>Zbe(e,!Ybe(e)),shift:e=>pye(e,!Ybe(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>Gbe(e,t=>lye(e,t,!Ybe(e))),shift:e=>cye(e,t=>lye(e,t,!Ybe(e))),preventDefault:!0},{key:"ArrowRight",run:Xbe,shift:hye,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>Zbe(e,Ybe(e)),shift:e=>pye(e,Ybe(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>Gbe(e,t=>lye(e,t,Ybe(e))),shift:e=>cye(e,t=>lye(e,t,Ybe(e))),preventDefault:!0},{key:"ArrowUp",run:nye,shift:mye,preventDefault:!0},{mac:"Cmd-ArrowUp",run:_ye,shift:kye},{mac:"Ctrl-ArrowUp",run:sye,shift:yye},{key:"ArrowDown",run:iye,shift:gye,preventDefault:!0},{mac:"Cmd-ArrowDown",run:xye,shift:wye},{mac:"Ctrl-ArrowDown",run:aye,shift:vye},{key:"PageUp",run:sye,shift:yye},{key:"PageDown",run:aye,shift:vye},{key:"Home",run:e=>Gbe(e,t=>lye(e,t,!1)),shift:e=>cye(e,t=>lye(e,t,!1)),preventDefault:!0},{key:"Mod-Home",run:_ye,shift:kye},{key:"End",run:e=>Gbe(e,t=>lye(e,t,!0)),shift:e=>cye(e,t=>lye(e,t,!0)),preventDefault:!0},{key:"Mod-End",run:xye,shift:wye},{key:"Enter",run:Oye},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:Iye,shift:Iye},{key:"Delete",run:Eye},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Tye},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>jye(e,!0)},{mac:"Mod-Backspace",run:e=>Cye(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)})},{mac:"Mod-Delete",run:e=>Cye(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)})}].concat(zye.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),Uye=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e=>Gbe(e,t=>eye(e.state,t,!Ybe(e))),shift:e=>cye(e,t=>eye(e.state,t,!Ybe(e)))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>Gbe(e,t=>eye(e.state,t,Ybe(e))),shift:e=>cye(e,t=>eye(e.state,t,Ybe(e)))},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>Nye(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>Rye(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>Nye(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>Rye(e,t,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let n=e.selection,i=null;return n.ranges.length>1?i=Qae.create([n.main]):n.main.empty||(i=Qae.create([Qae.cursor(n.main.head)])),!!i&&(t(Wbe(e,i)),!0)}},{key:"Mod-Enter",run:Lye},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let n=Bye(e).map(({from:t,to:n})=>Qae.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:Qae.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let n=Hbe(e.selection,t=>{var n;for(let i=Xme(e).resolveStack(t.from,1);i;i=i.next){let{node:e}=i;if((e.from<t.from&&e.to>=t.to||e.to>t.to&&e.from<=t.from)&&(null===(n=e.parent)||void 0===n?void 0:n.parent))return Qae.range(e.to,e.from)}return t});return t(Wbe(e,n)),!0},preventDefault:!0},{key:"Mod-[",run:Fye},{key:"Mod-]",run:Dye},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),i=new hge(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),r=Pye(e,(t,r,o)=>{let s=dge(i,t.from);if(null==s)return;/\S/.test(t.text)||(s=0);let a=/^\s*/.exec(t.text)[0],l=uge(e,s);(a!=l||o.from<t.from+a.length)&&(n[t.from]=s,r.push({from:t.from,to:t.from+a.length,insert:l}))});return r.changes.empty||t(e.update(r,{userEvent:"indent"})),!0}},{key:"Shift-Mod-k",run:e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(Bye(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),i=Hbe(t.selection,t=>{let n;if(e.lineWrapping){let i=e.lineBlockAt(t.head),r=e.coordsAtPos(t.head,t.assoc||1);r&&(n=i.bottom+e.documentTop-r.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>function(e,t,n){let i=!1,r=Hbe(e.selection,t=>{let r=abe(e,t.head,-1)||abe(e,t.head,1)||t.head>0&&abe(e,t.head-1,1)||t.head<e.doc.length&&abe(e,t.head+1,-1);if(!r||!r.end)return t;i=!0;let o=r.start.from==t.head?r.end.to:r.end.from;return n?Qae.range(t.anchor,o):Qae.cursor(o)});return!!i&&(t(Wbe(e,r)),!0)}(e,t,!1)},{key:"Mod-/",run:e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),i=_be(e.state,n.from);return i.line?bbe(e):!!i.block&&vbe(e)}},{key:"Alt-A",run:ybe},{key:"Ctrl-m",mac:"Shift-Alt-m",run:e=>(e.setTabFocusMode(),!0)}].concat(Vye),$ye={key:"Tab",run:Dye,shift:Fye};function Hye(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&"object"==typeof n&&null==n.nodeType&&!Array.isArray(n)){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i];"string"==typeof r?e.setAttribute(i,r):null!=r&&(e[i]=r)}t++}for(;t<arguments.length;t++)Wye(e,arguments[t]);return e}function Wye(e,t){if("string"==typeof t)e.appendChild(document.createTextNode(t));else if(null==t);else if(null!=t.nodeType)e.appendChild(t);else{if(!Array.isArray(t))throw new RangeError("Unsupported child node: "+t);for(var n=0;n<t.length;n++)Wye(e,t[n])}}const Gye="function"==typeof String.prototype.normalize?e=>e.normalize("NFKD"):e=>e;class qye{constructor(e,t,n=0,i=e.length,r,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,i),this.bufferStart=n,this.normalize=r?e=>r(Gye(e)):Gye,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Fae(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=zae(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Vae(e);let i=this.normalize(t);for(let e=0,r=n;;e++){let o=i.charCodeAt(e),s=this.match(o,r,this.bufferPos+this.bufferStart);if(e==i.length-1){if(s)return this.value=s,this;break}r==n&&e<t.length&&t.charCodeAt(e)==o&&r++}}}match(e,t,n){let i=null;for(let t=0;t<this.matches.length;t+=2){let r=this.matches[t],o=!1;this.query.charCodeAt(r)==e&&(r==this.query.length-1?i={from:this.matches[t+1],to:n}:(this.matches[t]++,o=!0)),o||(this.matches.splice(t,2),t-=2)}return this.query.charCodeAt(0)==e&&(1==this.query.length?i={from:t,to:n}:this.matches.push(1,t)),i&&this.test&&!this.test(i.from,i.to,this.buffer,this.bufferStart)&&(i=null),i}}"undefined"!=typeof Symbol&&(qye.prototype[Symbol.iterator]=function(){return this});const Kye={from:-1,to:-1,match:/.*/.exec("")},Yye="gm"+(null==/x/.unicode?"":"u");class Jye{constructor(e,t,n,i=0,r=e.length){if(this.text=e,this.to=r,this.curLine="",this.done=!1,this.value=Kye,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new Qye(e,t,n,i,r);this.re=new RegExp(t,Yye+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.iter=e.iter();let o=e.lineAt(i);this.curLineStart=o.from,this.matchPos=eve(e,i),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,i=n+t[0].length;if(this.matchPos=eve(this.text,i+(n==i?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<i||n>this.value.to)&&(!this.test||this.test(n,i,t)))return this.value={from:n,to:i,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),e=0}}}}const Xye=new WeakMap;class Zye{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,n){let i=Xye.get(e);if(!i||i.from>=n||i.to<=t){let i=new Zye(t,e.sliceString(t,n));return Xye.set(e,i),i}if(i.from==t&&i.to==n)return i;let{text:r,from:o}=i;return o>t&&(r=e.sliceString(t,o)+r,o=t),i.to<n&&(r+=e.sliceString(i.to,n)),Xye.set(e,new Zye(o,r)),new Zye(t,r.slice(t-o,n-o))}}class Qye{constructor(e,t,n,i,r){this.text=e,this.to=r,this.done=!1,this.value=Kye,this.matchPos=eve(e,i),this.re=new RegExp(t,Yye+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.flat=Zye.get(e,i,this.chunkEnd(i+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=eve(this.text,n+(e==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Zye.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function eve(e,t){if(t>=e.length)return t;let n,i=e.lineAt(t);for(;t<i.to&&(n=i.text.charCodeAt(t-i.from))>=56320&&n<57344;)t++;return t}function tve(e){let t=Hye("input",{class:"cm-textfield",name:"line",value:String(e.state.doc.lineAt(e.state.selection.main.head).number)});function n(){let n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!n)return;let{state:i}=e,r=i.doc.lineAt(i.selection.main.head),[,o,s,a,l]=n,c=a?+a.slice(1):0,u=s?+s:r.number;if(s&&l){let e=u/100;o&&(e=e*("-"==o?-1:1)+r.number/i.doc.lines),u=Math.round(i.doc.lines*e)}else s&&o&&(u=u*("-"==o?-1:1)+r.number);let d=i.doc.line(Math.max(1,Math.min(i.doc.lines,u))),h=Qae.cursor(d.from+Math.max(0,Math.min(c,d.length)));e.dispatch({effects:[nve.of(!1),lpe.scrollIntoView(h.from,{y:"center"})],selection:h}),e.focus()}return{dom:Hye("form",{class:"cm-gotoLine",onkeydown:t=>{27==t.keyCode?(t.preventDefault(),e.dispatch({effects:nve.of(!1)}),e.focus()):13==t.keyCode&&(t.preventDefault(),n())},onsubmit:e=>{e.preventDefault(),n()}},Hye("label",e.state.phrase("Go to line"),": ",t)," ",Hye("button",{class:"cm-button",type:"submit"},e.state.phrase("go")))}}"undefined"!=typeof Symbol&&(Jye.prototype[Symbol.iterator]=Qye.prototype[Symbol.iterator]=function(){return this});const nve=Ele.define(),ive=cle.define({create:()=>!0,update(e,t){for(let n of t.effects)n.is(nve)&&(e=n.value);return e},provide:e=>xfe.from(e,e=>e?tve:null)}),rve=lpe.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),ove={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},sve=nle.define({combine:e=>zle(e,ove,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}),ave=_ue.mark({class:"cm-selectionMatch"}),lve=_ue.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function cve(e,t,n,i){return!(0!=n&&e(t.sliceDoc(n-1,n))==Mle.Word||i!=t.doc.length&&e(t.sliceDoc(i,i+1))==Mle.Word)}const uve=dde.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(sve),{state:n}=e,i=n.selection;if(i.ranges.length>1)return _ue.none;let r,o=i.main,s=null;if(o.empty){if(!t.highlightWordAroundCursor)return _ue.none;let e=n.wordAt(o.head);if(!e)return _ue.none;s=n.charCategorizer(o.head),r=n.sliceDoc(e.from,e.to)}else{let e=o.to-o.from;if(e<t.minSelectionLength||e>200)return _ue.none;if(t.wholeWords){if(r=n.sliceDoc(o.from,o.to),s=n.charCategorizer(o.head),!cve(s,n,o.from,o.to)||!function(e,t,n,i){return e(t.sliceDoc(n,n+1))==Mle.Word&&e(t.sliceDoc(i-1,i))==Mle.Word}(s,n,o.from,o.to))return _ue.none}else if(r=n.sliceDoc(o.from,o.to),!r)return _ue.none}let a=[];for(let i of e.visibleRanges){let e=new qye(n.doc,r,i.from,i.to);for(;!e.next().done;){let{from:i,to:r}=e.value;if((!s||cve(s,n,i,r))&&(o.empty&&i<=o.from&&r>=o.to?a.push(lve.range(i,r)):(i>=o.to||r<=o.from)&&a.push(ave.range(i,r)),a.length>t.maxMatches))return _ue.none}}return _ue.set(a)}},{decorations:e=>e.decorations}),dve=lpe.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),hve=nle.define({combine:e=>zle(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Vve(e),scrollToMatch:e=>lpe.scrollIntoView(e)})});class pve{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return new RegExp(e,Yye),!0}catch(e){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new _ve(this):new gve(this)}getCursor(e,t=0,n){let i=e.doc?e:Fle.create({doc:e});return null==n&&(n=i.doc.length),this.regexp?bve(this,i,t,n):mve(this,i,t,n)}}class fve{constructor(e){this.spec=e}}function mve(e,t,n,i){return new qye(t.doc,e.unquoted,n,i,e.caseSensitive?void 0:e=>e.toLowerCase(),e.wholeWord?function(e,t){return(n,i,r,o)=>((o>n||o+r.length<i)&&(o=Math.max(0,n-2),r=e.sliceString(o,Math.min(e.length,i+2))),!(t(yve(r,n-o))==Mle.Word&&t(vve(r,n-o))==Mle.Word||t(vve(r,i-o))==Mle.Word&&t(yve(r,i-o))==Mle.Word))}(t.doc,t.charCategorizer(t.selection.main.head)):void 0)}class gve extends fve{constructor(e){super(e)}nextMatch(e,t,n){let i=mve(this.spec,e,n,e.doc.length).nextOverlapping();return i.done&&(i=mve(this.spec,e,0,t).nextOverlapping()),i.done?null:i.value}prevMatchInRange(e,t,n){for(let i=n;;){let n=Math.max(t,i-1e4-this.spec.unquoted.length),r=mve(this.spec,e,n,i),o=null;for(;!r.nextOverlapping().done;)o=r.value;if(o)return o;if(n==t)return null;i-=1e4}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=mve(this.spec,e,0,e.doc.length),i=[];for(;!n.next().done;){if(i.length>=t)return null;i.push(n.value)}return i}highlight(e,t,n,i){let r=mve(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)i(r.value.from,r.value.to)}}function bve(e,t,n,i){return new Jye(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?(r=t.charCategorizer(t.selection.main.head),(e,t,n)=>!n[0].length||(r(yve(n.input,n.index))!=Mle.Word||r(vve(n.input,n.index))!=Mle.Word)&&(r(vve(n.input,n.index+n[0].length))!=Mle.Word||r(yve(n.input,n.index+n[0].length))!=Mle.Word)):void 0},n,i);var r}function yve(e,t){return e.slice(Oae(e,t,!1),t)}function vve(e,t){return e.slice(t,Oae(e,t))}class _ve extends fve{nextMatch(e,t,n){let i=bve(this.spec,e,n,e.doc.length).next();return i.done&&(i=bve(this.spec,e,0,t).next()),i.done?null:i.value}prevMatchInRange(e,t,n){for(let i=1;;i++){let r=Math.max(t,n-1e4*i),o=bve(this.spec,e,r,n),s=null;for(;!o.next().done;)s=o.value;if(s&&(r==t||s.from>r+10))return s;if(r==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(t,n)=>"$"==n?"$":"&"==n?e.match[0]:"0"!=n&&+n<e.match.length?e.match[n]:t)}matchAll(e,t){let n=bve(this.spec,e,0,e.doc.length),i=[];for(;!n.next().done;){if(i.length>=t)return null;i.push(n.value)}return i}highlight(e,t,n,i){let r=bve(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!r.next().done;)i(r.value.from,r.value.to)}}const xve=Ele.define(),kve=Ele.define(),wve=cle.define({create:e=>new Cve(Lve(e).create(),null),update(e,t){for(let n of t.effects)n.is(xve)?e=new Cve(n.value.create(),e.panel):n.is(kve)&&(e=new Cve(e.query,n.value?Ove:null));return e},provide:e=>xfe.from(e,e=>e.panel)});class Cve{constructor(e,t){this.query=e,this.panel=t}}const Sve=_ue.mark({class:"cm-searchMatch"}),Ave=_ue.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Ive=dde.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(wve))}update(e){let t=e.state.field(wve);(t!=e.startState.field(wve)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return _ue.none;let{view:n}=this,i=new Gle;for(let t=0,r=n.visibleRanges,o=r.length;t<o;t++){let{from:s,to:a}=r[t];for(;t<o-1&&a>r[t+1].from-500;)a=r[++t].to;e.highlight(n.state,s,a,(e,t)=>{let r=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);i.add(e,t,r?Ave:Sve)})}return i.finish()}},{decorations:e=>e.decorations});function Eve(e){return t=>{let n=t.state.field(wve,!1);return n&&n.query.spec.valid?e(t,n):Dve(t)}}const jve=Eve((e,{query:t})=>{let{to:n}=e.state.selection.main,i=t.nextMatch(e.state,n,n);if(!i)return!1;let r=Qae.single(i.from,i.to),o=e.state.facet(hve);return e.dispatch({selection:r,effects:[Hve(e,i),o.scrollToMatch(r.main,e)],userEvent:"select.search"}),Pve(e),!0}),Tve=Eve((e,{query:t})=>{let{state:n}=e,{from:i}=n.selection.main,r=t.prevMatch(n,i,i);if(!r)return!1;let o=Qae.single(r.from,r.to),s=e.state.facet(hve);return e.dispatch({selection:o,effects:[Hve(e,r),s.scrollToMatch(o.main,e)],userEvent:"select.search"}),Pve(e),!0}),Bve=Eve((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!(!n||!n.length||(e.dispatch({selection:Qae.create(n.map(e=>Qae.range(e.from,e.to))),userEvent:"select.search.matches"}),0))}),Nve=Eve((e,{query:t})=>{let{state:n}=e,{from:i,to:r}=n.selection.main;if(n.readOnly)return!1;let o=t.nextMatch(n,i,i);if(!o)return!1;let s,a,l=[],c=[];if(o.from==i&&o.to==r&&(a=n.toText(t.getReplacement(o)),l.push({from:o.from,to:o.to,insert:a}),o=t.nextMatch(n,o.from,o.to),c.push(lpe.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(i).number)+"."))),o){let t=0==l.length||l[0].from>=o.to?0:o.to-o.from-a.length;s=Qae.single(o.from-t,o.to-t),c.push(Hve(e,o)),c.push(n.facet(hve).scrollToMatch(s.main,e))}return e.dispatch({changes:l,selection:s,effects:c,userEvent:"input.replace"}),!0}),Rve=Eve((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(e=>{let{from:n,to:i}=e;return{from:n,to:i,insert:t.getReplacement(e)}});if(!n.length)return!1;let i=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:lpe.announce.of(i),userEvent:"input.replace.all"}),!0});function Ove(e){return e.state.facet(hve).createPanel(e)}function Lve(e,t){var n,i,r,o,s;let a=e.selection.main,l=a.empty||a.to>a.from+100?"":e.sliceDoc(a.from,a.to);if(t&&!l)return t;let c=e.facet(hve);return new pve({search:(null!==(n=null==t?void 0:t.literal)&&void 0!==n?n:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:null!==(i=null==t?void 0:t.caseSensitive)&&void 0!==i?i:c.caseSensitive,literal:null!==(r=null==t?void 0:t.literal)&&void 0!==r?r:c.literal,regexp:null!==(o=null==t?void 0:t.regexp)&&void 0!==o?o:c.regexp,wholeWord:null!==(s=null==t?void 0:t.wholeWord)&&void 0!==s?s:c.wholeWord})}function Mve(e){let t=bfe(e,Ove);return t&&t.dom.querySelector("[main-field]")}function Pve(e){let t=Mve(e);t&&t==e.root.activeElement&&t.select()}const Dve=e=>{let t=e.state.field(wve,!1);if(t&&t.panel){let n=Mve(e);if(n&&n!=e.root.activeElement){let i=Lve(e.state,t.query.spec);i.valid&&e.dispatch({effects:xve.of(i)}),n.focus(),n.select()}}else e.dispatch({effects:[kve.of(!0),t?xve.of(Lve(e.state,t.query.spec)):Ele.appendConfig.of(Gve)]});return!0},Fve=e=>{let t=e.state.field(wve,!1);if(!t||!t.panel)return!1;let n=bfe(e,Ove);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:kve.of(!1)}),!0},zve=[{key:"Mod-f",run:Dve,scope:"editor search-panel"},{key:"F3",run:jve,shift:Tve,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:jve,shift:Tve,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Fve,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:i,to:r}=n.main,o=[],s=0;for(let t=new qye(e.doc,e.sliceDoc(i,r));!t.next().done;){if(o.length>1e3)return!1;t.value.from==i&&(s=o.length),o.push(Qae.range(t.value.from,t.value.to))}return t(e.update({selection:Qae.create(o,s),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:e=>{let t=bfe(e,tve);if(!t){let n=[nve.of(!0)];null==e.state.field(ive,!1)&&n.push(Ele.appendConfig.of([ive,rve])),e.dispatch({effects:n}),t=bfe(e,tve)}return t&&t.dom.querySelector("input").select(),!0}},{key:"Mod-d",run:({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return(({state:e,dispatch:t})=>{let{selection:n}=e,i=Qae.create(n.ranges.map(t=>e.wordAt(t.head)||Qae.cursor(t.head)),n.mainIndex);return!i.eq(n)&&(t(e.update({selection:i})),!0)})({state:e,dispatch:t});let i=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=i))return!1;let r=function(e,t){let{main:n,ranges:i}=e.selection,r=e.wordAt(n.head),o=r&&r.from==n.from&&r.to==n.to;for(let n=!1,r=new qye(e.doc,t,i[i.length-1].to);;){if(r.next(),!r.done){if(n&&i.some(e=>e.from==r.value.from))continue;if(o){let t=e.wordAt(r.value.from);if(!t||t.from!=r.value.from||t.to!=r.value.to)continue}return r.value}if(n)return null;r=new qye(e.doc,t,0,Math.max(0,i[i.length-1].from-1)),n=!0}}(e,i);return!!r&&(t(e.update({selection:e.selection.addRange(Qae.range(r.from,r.to),!1),effects:lpe.scrollIntoView(r.to)})),!0)},preventDefault:!0}];class Vve{constructor(e){this.view=e;let t=this.query=e.state.field(wve).query.spec;function n(e,t,n){return Hye("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=Hye("input",{value:t.search,placeholder:Uve(e,"Find"),"aria-label":Uve(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Hye("input",{value:t.replace,placeholder:Uve(e,"Replace"),"aria-label":Uve(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Hye("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=Hye("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=Hye("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=Hye("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,n("next",()=>jve(e),[Uve(e,"next")]),n("prev",()=>Tve(e),[Uve(e,"previous")]),n("select",()=>Bve(e),[Uve(e,"all")]),Hye("label",null,[this.caseField,Uve(e,"match case")]),Hye("label",null,[this.reField,Uve(e,"regexp")]),Hye("label",null,[this.wordField,Uve(e,"by word")]),...e.state.readOnly?[]:[Hye("br"),this.replaceField,n("replace",()=>Nve(e),[Uve(e,"replace")]),n("replaceAll",()=>Rve(e),[Uve(e,"replace all")])],Hye("button",{name:"close",onclick:()=>Fve(e),"aria-label":Uve(e,"close"),type:"button"},["×"])])}commit(){let e=new pve({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:xve.of(e)}))}keydown(e){var t,n;n=e,_pe(bpe((t=this.view).state),n,t,"search-panel")?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Tve:jve)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),Nve(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(xve)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(hve).top}}function Uve(e,t){return e.state.phrase(t)}const $ve=/[\s\.,:;?!]/;function Hve(e,{from:t,to:n}){let i=e.state.doc.lineAt(t),r=e.state.doc.lineAt(n).to,o=Math.max(i.from,t-30),s=Math.min(r,n+30),a=e.state.sliceDoc(o,s);if(o!=i.from)for(let e=0;e<30;e++)if(!$ve.test(a[e+1])&&$ve.test(a[e])){a=a.slice(e);break}if(s!=r)for(let e=a.length-1;e>a.length-30;e--)if(!$ve.test(a[e-1])&&$ve.test(a[e])){a=a.slice(0,e);break}return lpe.announce.of(`${e.state.phrase("current match")}. ${a} ${e.state.phrase("on line")} ${i.number}.`)}const Wve=lpe.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Gve=[wve,dle.low(Ive),Wve];class qve{constructor(e,t,n){this.state=e,this.pos=t,this.explicit=n,this.abortListeners=[]}tokenBefore(e){let t=Xme(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),i=t.text.slice(n-t.from,this.pos-t.from),r=i.search(Xve(e,!1));return r<0?null:{from:n+r,to:this.pos,text:i.slice(r)}}get aborted(){return null==this.abortListeners}addEventListener(e,t){"abort"==e&&this.abortListeners&&this.abortListeners.push(t)}}function Kve(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}class Yve{constructor(e,t,n,i){this.completion=e,this.source=t,this.match=n,this.score=i}}function Jve(e){return e.selection.main.from}function Xve(e,t){var n;let{source:i}=e,r=t&&"^"!=i[0],o="$"!=i[i.length-1];return r||o?new RegExp(`${r?"^":""}(?:${i})${o?"$":""}`,null!==(n=e.flags)&&void 0!==n?n:e.ignoreCase?"i":""):e}const Zve=Sle.define(),Qve=new WeakMap;function e_e(e){if(!Array.isArray(e))return e;let t=Qve.get(e);return t||Qve.set(e,t=function(e){let t=e.map(e=>"string"==typeof e?{label:e}:e),[n,i]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),n=Object.create(null);for(let{label:i}of e){t[i[0]]=!0;for(let e=1;e<i.length;e++)n[i[e]]=!0}let i=Kve(t)+Kve(n)+"*$";return[new RegExp("^"+i),new RegExp(i)]}(t);return e=>{let r=e.matchBefore(i);return r||e.explicit?{from:r?r.from:e.pos,options:t,validFor:n}:null}}(e)),t}const t_e=Ele.define(),n_e=Ele.define();class i_e{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=Fae(e,t),i=Vae(n);this.chars.push(n);let r=e.slice(t,t+i),o=r.toUpperCase();this.folded.push(Fae(o==r?r.toLowerCase():o,0)),t+=i}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(0==this.pattern.length)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:i,precise:r,byWord:o}=this;if(1==t.length){let i=Fae(e,0),r=Vae(i),o=r==e.length?0:-100;if(i==t[0]);else{if(i!=n[0])return null;o+=-200}return this.ret(o,[0,r])}let s=e.indexOf(this.pattern);if(0==s)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let a=t.length,l=0;if(s<0){for(let r=0,o=Math.min(e.length,200);r<o&&l<a;){let o=Fae(e,r);o!=t[l]&&o!=n[l]||(i[l++]=r),r+=Vae(o)}if(l<a)return null}let c=0,u=0,d=!1,h=0,p=-1,f=-1,m=/[a-z]/.test(e),g=!0;for(let i=0,l=Math.min(e.length,200),b=0;i<l&&u<a;){let l=Fae(e,i);s<0&&(c<a&&l==t[c]&&(r[c++]=i),h<a&&(l==t[h]||l==n[h]?(0==h&&(p=i),f=i+1,h++):h=0));let y,v=l<255?l>=48&&l<=57||l>=97&&l<=122?2:l>=65&&l<=90?1:0:(y=zae(l))!=y.toLowerCase()?1:y!=y.toUpperCase()?2:0;(!i||1==v&&m||0==b&&0!=v)&&(t[u]==l||n[u]==l&&(d=!0)?o[u++]=i:o.length&&(g=!1)),b=v,i+=Vae(l)}return u==a&&0==o[0]&&g?this.result((d?-200:0)-100,o,e):h==a&&0==p?this.ret(-200-e.length+(f==e.length?0:-100),[0,f]):s>-1?this.ret(-700-e.length,[s,s+this.pattern.length]):h==a?this.ret(-900-e.length,[p,f]):u==a?this.result((d?-200:0)-100-700+(g?0:-1100),o,e):2==t.length?null:this.result((i[0]?-700:0)-200-1100,i,e)}result(e,t,n){let i=[],r=0;for(let e of t){let t=e+(this.astral?Vae(Fae(n,e)):1);r&&i[r-1]==e?i[r-1]=t:(i[r++]=e,i[r++]=t)}return this.ret(e-n.length,i)}}class r_e{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return null==n?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}}const o_e=nle.define({combine:e=>zle(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:a_e,filterStrict:!1,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>s_e(e(n),t(n)),optionClass:(e,t)=>n=>s_e(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})});function s_e(e,t){return e?t?e+" "+t:e:t}function a_e(e,t,n,i,r,o){let s,a,l=e.textDirection==jue.RTL,c=l,u=!1,d="top",h=t.left-r.left,p=r.right-t.right,f=i.right-i.left,m=i.bottom-i.top;if(c&&h<Math.min(f,p)?c=!1:!c&&p<Math.min(f,h)&&(c=!0),f<=(c?h:p))s=Math.max(r.top,Math.min(n.top,r.bottom-m))-t.top,a=Math.min(400,c?h:p);else{u=!0,a=Math.min(400,(l?t.right:r.right-t.left)-30);let e=r.bottom-t.bottom;e>=m||e>t.top?s=n.bottom-t.top:(d="bottom",s=t.bottom-n.top)}return{style:`${d}: ${s/((t.bottom-t.top)/o.offsetHeight)}px; max-width: ${a/((t.right-t.left)/o.offsetWidth)}px`,class:"cm-completionInfo-"+(u?l?"left-narrow":"right-narrow":c?"left":"right")}}function l_e(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let i=Math.floor((e-t)/n);return{from:e-(i+1)*n,to:e-i*n}}class c_e{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass="";let i=e.state.field(t),{options:r,selected:o}=i.open,s=e.state.facet(o_e);this.optionContent=function(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>"cm-completionIcon-"+e)),t.setAttribute("aria-hidden","true"),t},position:20}),t.push({render(e,t,n,i){let r=document.createElement("span");r.className="cm-completionLabel";let o=e.displayLabel||e.label,s=0;for(let e=0;e<i.length;){let t=i[e++],n=i[e++];t>s&&r.appendChild(document.createTextNode(o.slice(s,t)));let a=r.appendChild(document.createElement("span"));a.appendChild(document.createTextNode(o.slice(t,n))),a.className="cm-completionMatchedText",s=n}return s<o.length&&r.appendChild(document.createTextNode(o.slice(s))),r},position:50},{render(e){if(!e.detail)return null;let t=document.createElement("span");return t.className="cm-completionDetail",t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}(s),this.optionClass=s.optionClass,this.tooltipClass=s.tooltipClass,this.range=l_e(r.length,o,s.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",n=>{let{options:i}=e.state.field(t).open;for(let t,r=n.target;r&&r!=this.dom;r=r.parentNode)if("LI"==r.nodeName&&(t=/-(\d+)$/.exec(r.id))&&+t[1]<i.length)return this.applyCompletion(e,i[+t[1]]),void n.preventDefault()}),this.dom.addEventListener("focusout",t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(o_e).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:n_e.of(null)})}),this.showOptions(r,i.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let n=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=i){let{options:r,selected:o,disabled:s}=n.open;i.open&&i.open.options==r||(this.range=l_e(r.length,o,e.state.facet(o_e).maxRenderedOptions),this.showOptions(r,n.id)),this.updateSel(),s!=(null===(t=i.open)||void 0===t?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!s)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(" "))e&&this.dom.classList.remove(e);for(let e of t.split(" "))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=l_e(t.options.length,t.selected,this.view.state.facet(o_e).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:n}=t.options[t.selected],{info:i}=n;if(!i)return;let r="string"==typeof i?document.createTextNode(i):i(n);if(!r)return;"then"in r?r.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,n)}).catch(e=>ade(this.view.state,e,"completion info")):this.addInfoPane(r,n)}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",null!=e.nodeType)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:i}=e;n.appendChild(t),this.infoDestroy=i||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,i=this.range.from;n;n=n.nextSibling,i++)"LI"==n.nodeName&&n.id?i==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&n.removeAttribute("aria-selected"):i--;return t&&function(e,t){let n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),r=n.height/e.offsetHeight;i.top<n.top?e.scrollTop-=(n.top-i.top)/r:i.bottom>n.bottom&&(e.scrollTop+=(i.bottom-n.bottom)/r)}(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),r=this.space;if(!r){let e=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:e.innerWidth,bottom:e.innerHeight}}return i.top>Math.min(r.bottom,t.bottom)-10||i.bottom<Math.max(r.top,t.top)+10?null:this.view.state.facet(o_e).positionInfo(this.view,t,i,n,r,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,n){const i=document.createElement("ul");i.id=t,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions"));let r=null;for(let o=n.from;o<n.to;o++){let{completion:s,match:a}=e[o],{section:l}=s;if(l){let e="string"==typeof l?l:l.name;e!=r&&(o>n.from||0==n.from)&&(r=e,"string"!=typeof l&&l.header?i.appendChild(l.header(l)):i.appendChild(document.createElement("completion-section")).textContent=e)}const c=i.appendChild(document.createElement("li"));c.id=t+"-"+o,c.setAttribute("role","option");let u=this.optionClass(s);u&&(c.className=u);for(let e of this.optionContent){let t=e(s,this.view.state,this.view,a);t&&c.appendChild(t)}}return n.from&&i.classList.add("cm-completionListIncompleteTop"),n.to<e.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function u_e(e,t){return n=>new c_e(n,e,t)}function d_e(e){return 100*(e.boost||0)+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}class h_e{constructor(e,t,n,i,r,o){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=i,this.selected=r,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new h_e(this.options,g_e(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,i,r){let o=function(e,t){let n=[],i=null,r=e=>{n.push(e);let{section:t}=e.completion;if(t){i||(i=[]);let e="string"==typeof t?t:t.name;i.some(t=>t.name==e)||i.push("string"==typeof t?{name:e}:t)}},o=t.facet(o_e);for(let i of e)if(i.hasResult()){let e=i.result.getMatch;if(!1===i.result.filter)for(let t of i.result.options)r(new Yve(t,i.source,e?e(t):[],1e9-n.length));else{let n,s=t.sliceDoc(i.from,i.to),a=o.filterStrict?new r_e(s):new i_e(s);for(let t of i.result.options)if(n=a.match(t.label)){let o=t.displayLabel?e?e(t,n.matched):[]:n.matched;r(new Yve(t,i.source,o,n.score+(t.boost||0)))}}}if(i){let e=Object.create(null),t=0,r=(e,t)=>{var n,i;return(null!==(n=e.rank)&&void 0!==n?n:1e9)-(null!==(i=t.rank)&&void 0!==i?i:1e9)||(e.name<t.name?-1:1)};for(let n of i.sort(r))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e["string"==typeof n?n:n.name])}}let s=[],a=null,l=o.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||l(e.completion,t.completion))){let t=e.completion;!a||a.label!=t.label||a.detail!=t.detail||null!=a.type&&null!=t.type&&a.type!=t.type||a.apply!=t.apply||a.boost!=t.boost?s.push(e):d_e(e.completion)>d_e(a)&&(s[s.length-1]=e),a=e.completion}return s}(e,t);if(!o.length)return i&&e.some(e=>1==e.state)?new h_e(i.options,i.attrs,i.tooltip,i.timestamp,i.selected,!0):null;let s=t.facet(o_e).selectOnOpen?0:-1;if(i&&i.selected!=s&&-1!=i.selected){let e=i.options[i.selected].completion;for(let t=0;t<o.length;t++)if(o[t].completion==e){s=t;break}}return new h_e(o,g_e(n,s),{pos:e.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:S_e,above:r.aboveCursor},i?i.timestamp:Date.now(),s,!1)}map(e){return new h_e(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class p_e{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new p_e(b_e,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,n=t.facet(o_e),i=(n.override||t.languageDataAt("autocomplete",Jve(t)).map(e_e)).map(t=>(this.active.find(e=>e.source==t)||new v_e(t,this.active.some(e=>0!=e.state)?1:0)).update(e,n));i.length==this.active.length&&i.every((e,t)=>e==this.active[t])&&(i=this.active);let r=this.open;r&&e.docChanged&&(r=r.map(e.changes)),e.selection||i.some(t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to))||!function(e,t){if(e==t)return!0;for(let n=0,i=0;;){for(;n<e.length&&!e[n].hasResult;)n++;for(;i<t.length&&!t[i].hasResult;)i++;let r=n==e.length,o=i==t.length;if(r||o)return r==o;if(e[n++].result!=t[i++].result)return!1}}(i,this.active)?r=h_e.build(i,t,this.id,r,n):r&&r.disabled&&!i.some(e=>1==e.state)&&(r=null),!r&&i.every(e=>1!=e.state)&&i.some(e=>e.hasResult())&&(i=i.map(e=>e.hasResult()?new v_e(e.source,0):e));for(let t of e.effects)t.is(k_e)&&(r=r&&r.setSelected(t.value,this.id));return i==this.active&&r==this.open?this:new p_e(i,this.id,r)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?f_e:m_e}}const f_e={"aria-autocomplete":"list"},m_e={};function g_e(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}const b_e=[];function y_e(e,t){if(e.isUserEvent("input.complete")){let n=e.annotation(Zve);if(n&&t.activateOnCompletion(n))return"input"}return e.isUserEvent("input.type")?"input":e.isUserEvent("delete.backward")?"delete":null}class v_e{constructor(e,t,n=-1){this.source=e,this.state=t,this.explicitPos=n}hasResult(){return!1}update(e,t){let n=y_e(e,t),i=this;n?i=i.handleUserEvent(e,n,t):e.docChanged?i=i.handleChange(e):e.selection&&0!=i.state&&(i=new v_e(i.source,0));for(let t of e.effects)if(t.is(t_e))i=new v_e(i.source,1,t.value?Jve(e.state):-1);else if(t.is(n_e))i=new v_e(i.source,0);else if(t.is(x_e))for(let e of t.value)e.source==i.source&&(i=e);return i}handleUserEvent(e,t,n){return"delete"!=t&&n.activateOnTyping?new v_e(this.source,1):this.map(e.changes)}handleChange(e){return e.changes.touchesRange(Jve(e.startState))?new v_e(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new v_e(this.source,this.state,e.mapPos(this.explicitPos))}}class __e extends v_e{constructor(e,t,n,i,r){super(e,2,t),this.result=n,this.from=i,this.to=r}hasResult(){return!0}handleUserEvent(e,t,n){var i;let r=this.result;r.map&&!e.changes.empty&&(r=r.map(r,e.changes));let o=e.changes.mapPos(this.from),s=e.changes.mapPos(this.to,1),a=Jve(e.state);if((this.explicitPos<0?a<=o:a<this.from)||a>s||!r||"delete"==t&&Jve(e.startState)==this.from)return new v_e(this.source,"input"==t&&n.activateOnTyping?1:0);let l=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return function(e,t,n,i){if(!e)return!1;let r=t.sliceDoc(n,i);return"function"==typeof e?e(r,n,i,t):Xve(e,!0).test(r)}(r.validFor,e.state,o,s)?new __e(this.source,l,r,o,s):r.update&&(r=r.update(r,o,s,new qve(e.state,a,l>=0)))?new __e(this.source,l,r,r.from,null!==(i=r.to)&&void 0!==i?i:Jve(e.state)):new v_e(this.source,1,l)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new v_e(this.source,0):this.map(e.changes)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new __e(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new v_e(this.source,0)}}const x_e=Ele.define({map:(e,t)=>e.map(e=>e.map(t))}),k_e=Ele.define(),w_e=cle.define({create:()=>p_e.start(),update:(e,t)=>e.update(t),provide:e=>[lfe.from(e,e=>e.tooltip),lpe.contentAttributes.from(e,e=>e.attrs)]});function C_e(e,t){const n=t.completion.apply||t.completion.label;let i=e.state.field(w_e).active.find(e=>e.source==t.source);return i instanceof __e&&("string"==typeof n?e.dispatch(Object.assign(Object.assign({},function(e,t,n,i){let{main:r}=e.selection,o=n-r.from,s=i-r.from;return Object.assign(Object.assign({},e.changeByRange(a=>a!=r&&n!=i&&e.sliceDoc(a.from+o,a.from+s)!=e.sliceDoc(n,i)?{range:a}:{changes:{from:a.from+o,to:i==r.from?a.to:a.from+s,insert:t},range:Qae.cursor(a.from+o+t.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}(e.state,n,i.from,i.to)),{annotations:Zve.of(t.completion)})):n(e,t.completion,i.from,i.to),!0)}const S_e=u_e(w_e,C_e);function A_e(e,t="option"){return n=>{let i=n.state.field(w_e,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<n.state.facet(o_e).interactionDelay)return!1;let r,o=1;"page"==t&&(r=ffe(n,i.open.tooltip))&&(o=Math.max(2,Math.floor(r.dom.offsetHeight/r.dom.querySelector("li").offsetHeight)-1));let{length:s}=i.open.options,a=i.open.selected>-1?i.open.selected+o*(e?1:-1):e?0:s-1;return a<0?a="page"==t?0:s-1:a>=s&&(a="page"==t?s-1:0),n.dispatch({effects:k_e.of(a)}),!0}}class I_e{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const E_e=dde.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(w_e).active)1==t.state&&this.startQuery(t)}update(e){let t=e.state.field(w_e),n=e.state.facet(o_e);if(!e.selectionSet&&!e.docChanged&&e.startState.field(w_e)==t)return;let i=e.transactions.some(e=>(e.selection||e.docChanged)&&!y_e(e,n));for(let t=0;t<this.running.length;t++){let n=this.running[t];if(i||n.updates.length+e.transactions.length>50&&Date.now()-n.time>1e3){for(let e of n.context.abortListeners)try{e()}catch(e){ade(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(t_e)))&&(this.pendingStart=!0);let r=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>1==e.state&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),r):-1,0!=this.composing)for(let t of e.transactions)"input"==y_e(t,n)?this.composing=2:2==this.composing&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(w_e);for(let e of t.active)1!=e.state||this.running.some(t=>t.active.source==e.source)||this.startQuery(e)}startQuery(e){let{state:t}=this.view,n=Jve(t),i=new qve(t,n,e.explicitPos==n),r=new I_e(e,i);this.running.push(r),Promise.resolve(e.source(i)).then(e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:n_e.of(null)}),ade(this.view.state,e)})}scheduleAccept(){this.running.every(e=>void 0!==e.done)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(o_e).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(o_e);for(let i=0;i<this.running.length;i++){let r=this.running[i];if(void 0===r.done)continue;if(this.running.splice(i--,1),r.done){let i=new __e(r.active.source,r.active.explicitPos,r.done,r.done.from,null!==(e=r.done.to)&&void 0!==e?e:Jve(r.updates.length?r.updates[0].startState:this.view.state));for(let e of r.updates)i=i.update(e,n);if(i.hasResult()){t.push(i);continue}}let o=this.view.state.field(w_e).active.find(e=>e.source==r.active.source);if(o&&1==o.state)if(null==r.done){let e=new v_e(r.active.source,0);for(let t of r.updates)e=e.update(t,n);1!=e.state&&t.push(e)}else this.startQuery(o)}t.length&&this.view.dispatch({effects:x_e.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(w_e,!1);if(t&&t.tooltip&&this.view.state.facet(o_e).closeOnBlur){let n=t.open&&ffe(this.view,t.open.tooltip);n&&n.dom.contains(e.relatedTarget)||setTimeout(()=>this.view.dispatch({effects:n_e.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout(()=>this.view.dispatch({effects:t_e.of(!1)}),20),this.composing=0}}}),j_e="object"==typeof navigator&&/Win/.test(navigator.platform),T_e=dle.highest(lpe.domEventHandlers({keydown(e,t){let n=t.state.field(w_e,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&(!j_e||!e.altKey)||e.metaKey)return!1;let i=n.open.options[n.open.selected],r=n.active.find(e=>e.source==i.source),o=i.completion.commitCharacters||r.result.commitCharacters;return o&&o.indexOf(e.key)>-1&&C_e(t,i),!1}})),B_e=lpe.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),N_e={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},R_e=Ele.define({map(e,t){let n=t.mapPos(e,-1,$ae.TrackAfter);return null==n?void 0:n}}),O_e=new class extends Vle{};O_e.startSide=1,O_e.endSide=-1;const L_e=cle.define({create:()=>Wle.empty,update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(R_e)&&(e=e.update({add:[O_e.range(n.value,n.value+1)]}));return e}}),M_e="()[]{}<>";function P_e(e){for(let t=0;t<8;t+=2)if(M_e.charCodeAt(t)==e)return M_e.charAt(t+1);return zae(e<128?e:e+1)}function D_e(e,t){return e.languageDataAt("closeBrackets",t)[0]||N_e}const F_e="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),z_e=lpe.inputHandler.of((e,t,n,i)=>{if((F_e?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let r=e.state.selection.main;if(i.length>2||2==i.length&&1==Vae(Fae(i,0))||t!=r.from||n!=r.to)return!1;let o=function(e,t){let n=D_e(e,e.selection.main.head),i=n.brackets||N_e.brackets;for(let r of i){let o=P_e(Fae(r,0));if(t==r)return o==r?G_e(e,r,i.indexOf(r+r+r)>-1,n):H_e(e,r,o,n.before||N_e.before);if(t==o&&U_e(e,e.selection.main.from))return W_e(e,0,o)}return null}(e.state,i);return!!o&&(e.dispatch(o),!0)}),V_e=[{key:"Backspace",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=D_e(e,e.selection.main.head).brackets||N_e.brackets,i=null,r=e.changeByRange(t=>{if(t.empty){let i=function(e,t){let n=e.sliceString(t-2,t);return Vae(Fae(n,0))==n.length?n:n.slice(1)}(e.doc,t.head);for(let r of n)if(r==i&&$_e(e.doc,t.head)==P_e(Fae(r,0)))return{changes:{from:t.head-r.length,to:t.head+r.length},range:Qae.cursor(t.head-r.length)}}return{range:i=t}});return i||t(e.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!i}}];function U_e(e,t){let n=!1;return e.field(L_e).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function $_e(e,t){let n=e.sliceString(t,t+2);return n.slice(0,Vae(Fae(n,0)))}function H_e(e,t,n,i){let r=null,o=e.changeByRange(o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:n,from:o.to}],effects:R_e.of(o.to+t.length),range:Qae.range(o.anchor+t.length,o.head+t.length)};let s=$_e(e.doc,o.head);return!s||/\s/.test(s)||i.indexOf(s)>-1?{changes:{insert:t+n,from:o.head},effects:R_e.of(o.head+t.length),range:Qae.cursor(o.head+t.length)}:{range:r=o}});return r?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function W_e(e,t,n){let i=null,r=e.changeByRange(t=>t.empty&&$_e(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:Qae.cursor(t.head+n.length)}:i={range:t});return i?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function G_e(e,t,n,i){let r=i.stringPrefixes||N_e.stringPrefixes,o=null,s=e.changeByRange(i=>{if(!i.empty)return{changes:[{insert:t,from:i.from},{insert:t,from:i.to}],effects:R_e.of(i.to+t.length),range:Qae.range(i.anchor+t.length,i.head+t.length)};let s,a=i.head,l=$_e(e.doc,a);if(l==t){if(q_e(e,a))return{changes:{insert:t+t,from:a},effects:R_e.of(a+t.length),range:Qae.cursor(a+t.length)};if(U_e(e,a)){let i=n&&e.sliceDoc(a,a+3*t.length)==t+t+t?t+t+t:t;return{changes:{from:a,to:a+i.length,insert:i},range:Qae.cursor(a+i.length)}}}else{if(n&&e.sliceDoc(a-2*t.length,a)==t+t&&(s=K_e(e,a-2*t.length,r))>-1&&q_e(e,s))return{changes:{insert:t+t+t+t,from:a},effects:R_e.of(a+t.length),range:Qae.cursor(a+t.length)};if(e.charCategorizer(a)(l)!=Mle.Word&&K_e(e,a,r)>-1&&!function(e,t,n,i){let r=Xme(e).resolveInner(t,-1),o=i.reduce((e,t)=>Math.max(e,t.length),0);for(let s=0;s<5;s++){let s=e.sliceDoc(r.from,Math.min(r.to,r.from+n.length+o)),a=s.indexOf(n);if(!a||a>-1&&i.indexOf(s.slice(0,a))>-1){let t=r.firstChild;for(;t&&t.from==r.from&&t.to-t.from>n.length+a;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let l=r.to==t&&r.parent;if(!l)break;r=l}return!1}(e,a,t,r))return{changes:{insert:t+t,from:a},effects:R_e.of(a+t.length),range:Qae.cursor(a+t.length)}}return{range:o=i}});return o?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function q_e(e,t){let n=Xme(e).resolveInner(t+1);return n.parent&&n.from==t}function K_e(e,t,n){let i=e.charCategorizer(t);if(i(e.sliceDoc(t-1,t))!=Mle.Word)return t;for(let r of n){let n=t-r.length;if(e.sliceDoc(n,t)==r&&i(e.sliceDoc(n-1,n))!=Mle.Word)return n}return-1}const Y_e=[{key:"Ctrl-Space",run:e=>!!e.state.field(w_e,!1)&&(e.dispatch({effects:t_e.of(!0)}),!0)},{key:"Escape",run:e=>{let t=e.state.field(w_e,!1);return!(!t||!t.active.some(e=>0!=e.state)||(e.dispatch({effects:n_e.of(null)}),0))}},{key:"ArrowDown",run:A_e(!0)},{key:"ArrowUp",run:A_e(!1)},{key:"PageDown",run:A_e(!0,"page")},{key:"PageUp",run:A_e(!1,"page")},{key:"Enter",run:e=>{let t=e.state.field(w_e,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(o_e).interactionDelay)&&C_e(e,t.open.options[t.open.selected])}}],J_e=dle.highest(mpe.computeN([o_e],e=>e.facet(o_e).defaultKeymap?[Y_e]:[]));class X_e{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class Z_e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let i=e,r=n.facet(cxe).markerFilter;r&&(i=r(i,n));let o=_ue.set(i.map(e=>e.from==e.to||e.from==e.to-1&&n.doc.lineAt(e.from).to==e.from?_ue.widget({widget:new hxe(e),diagnostic:e}).range(e.from):_ue.mark({attributes:{class:"cm-lintRange cm-lintRange-"+e.severity+(e.markClass?" "+e.markClass:"")},diagnostic:e}).range(e.from,e.to)),!0);return new Z_e(o,t,Q_e(o))}}function Q_e(e,t=null,n=0){let i=null;return e.between(n,1e9,(e,n,{spec:r})=>{if(!t||r.diagnostic==t)return i=new X_e(e,n,r.diagnostic),!1}),i}const exe=Ele.define(),txe=Ele.define(),nxe=Ele.define(),ixe=cle.define({create:()=>new Z_e(_ue.none,null,null),update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),i=null,r=e.panel;if(e.selected){let r=t.changes.mapPos(e.selected.from,1);i=Q_e(n,e.selected.diagnostic,r)||Q_e(n,null,r)}!n.size&&r&&t.state.facet(cxe).autoPanel&&(r=null),e=new Z_e(n,r,i)}for(let n of t.effects)if(n.is(exe)){let i=t.state.facet(cxe).autoPanel?n.value.length?fxe.open:null:e.panel;e=Z_e.init(n.value,i,t.state)}else n.is(txe)?e=new Z_e(e.diagnostics,n.value?fxe.open:null,e.selected):n.is(nxe)&&(e=new Z_e(e.diagnostics,e.panel,n.value));return e},provide:e=>[xfe.from(e,e=>e.panel),lpe.decorations.from(e,e=>e.diagnostics)]}),rxe=_ue.mark({class:"cm-lintRange cm-lintRange-active"});function oxe(e,t,n){let{diagnostics:i}=e.state.field(ixe),r=[],o=2e8,s=0;i.between(t-(n<0?1:0),t+(n>0?1:0),(e,i,{spec:a})=>{t>=e&&t<=i&&(e==i||(t>e||n>0)&&(t<i||n<0))&&(r.push(a.diagnostic),o=Math.min(e,o),s=Math.max(i,s))});let a=e.state.facet(cxe).tooltipFilter;return a&&(r=a(r,e.state)),r.length?{pos:o,end:s,above:e.state.doc.lineAt(o).to<s,create:()=>({dom:sxe(e,r)})}:null}function sxe(e,t){return Hye("ul",{class:"cm-tooltip-lint"},t.map(t=>dxe(e,t,!1)))}const axe=e=>{let t=e.state.field(ixe,!1);return!(!t||!t.panel||(e.dispatch({effects:txe.of(!1)}),0))},lxe=[{key:"Mod-Shift-m",run:e=>{let t=e.state.field(ixe,!1);var n,i;t&&t.panel||e.dispatch({effects:(n=e.state,i=[txe.of(!0)],n.field(ixe,!1)?i:i.concat(Ele.appendConfig.of(bxe)))});let r=bfe(e,fxe.open);return r&&r.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:e=>{let t=e.state.field(ixe,!1);if(!t)return!1;let n=e.state.selection.main,i=t.diagnostics.iter(n.to+1);return!(!i.value&&(i=t.diagnostics.iter(0),!i.value||i.from==n.from&&i.to==n.to)||(e.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),0))}}],cxe=nle.define({combine:e=>Object.assign({sources:e.map(e=>e.source).filter(e=>null!=e)},zle(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t}))});function uxe(e){let t=[];if(e)e:for(let{name:n}of e){for(let e=0;e<n.length;e++){let i=n[e];if(/[a-zA-Z]/.test(i)&&!t.some(e=>e.toLowerCase()==i.toLowerCase())){t.push(i);continue e}}t.push("")}return t}function dxe(e,t,n){var i;let r=n?uxe(t.actions):[];return Hye("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Hye("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),null===(i=t.actions)||void 0===i?void 0:i.map((n,i)=>{let o=!1,s=i=>{if(i.preventDefault(),o)return;o=!0;let r=Q_e(e.state.field(ixe).diagnostics,t);r&&n.apply(e,r.from,r.to)},{name:a}=n,l=r[i]?a.indexOf(r[i]):-1,c=l<0?a:[a.slice(0,l),Hye("u",a.slice(l,l+1)),a.slice(l+1)];return Hye("button",{type:"button",class:"cm-diagnosticAction",onclick:s,onmousedown:s,"aria-label":` Action: ${a}${l<0?"":` (access key "${r[i]})"`}.`},c)}),t.source&&Hye("div",{class:"cm-diagnosticSource"},t.source))}class hxe extends yue{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return Hye("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class pxe{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=dxe(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class fxe{constructor(e){this.view=e,this.items=[],this.list=Hye("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t=>{if(27==t.keyCode)axe(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0))return;{let{diagnostic:n}=this.items[this.selectedIndex],i=uxe(n.actions);for(let r=0;r<i.length;r++)if(i[r].toUpperCase().charCodeAt(0)==t.keyCode){let t=Q_e(this.view.state.field(ixe).diagnostics,n);t&&n.actions[r].apply(e,t.from,t.to)}}}t.preventDefault()},onclick:e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)}}),this.dom=Hye("div",{class:"cm-panel-lint"},this.list,Hye("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>axe(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(ixe).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(ixe),n=0,i=!1,r=null;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{let a,l=-1;for(let e=n;e<this.items.length;e++)if(this.items[e].diagnostic==s.diagnostic){l=e;break}l<0?(a=new pxe(this.view,s.diagnostic),this.items.splice(n,0,a),i=!0):(a=this.items[l],l>n&&(this.items.splice(n,l-n),i=!0)),t&&a.diagnostic==t.diagnostic?a.dom.hasAttribute("aria-selected")||(a.dom.setAttribute("aria-selected","true"),r=a):a.dom.hasAttribute("aria-selected")&&a.dom.removeAttribute("aria-selected"),n++});n<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();0==this.items.length&&(this.items.push(new pxe(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),r?(this.list.setAttribute("aria-activedescendant",r.id),this.view.requestMeasure({key:this,read:()=>({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=Q_e(this.view.state.field(ixe).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:nxe.of(t)})}static open(e){return new fxe(e)}}function mxe(e){return function(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const gxe=lpe.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:mxe("#d11")},".cm-lintRange-warning":{backgroundImage:mxe("orange")},".cm-lintRange-info":{backgroundImage:mxe("#999")},".cm-lintRange-hint":{backgroundImage:mxe("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}}),bxe=[ixe,lpe.decorations.compute([ixe],e=>{let{selected:t,panel:n}=e.field(ixe);return t&&n&&t.from!=t.to?_ue.set([rxe.range(t.from,t.to)]):_ue.none}),pfe(oxe,{hideOn:function(e,t){let n=t.pos,i=t.end||n,r=e.state.facet(cxe).hideOn(e,n,i);if(null!=r)return r;let o=e.startState.doc.lineAt(t.pos);return!(!e.effects.some(e=>e.is(exe))&&!e.changes.touchesRange(o.from,Math.max(o.to,i)))}}),gxe];var yxe=function(e){void 0===e&&(e={});var{crosshairCursor:t=!1}=e,n=[];!1!==e.closeBracketsKeymap&&(n=n.concat(V_e)),!1!==e.defaultKeymap&&(n=n.concat(Uye)),!1!==e.searchKeymap&&(n=n.concat(zve)),!1!==e.historyKeymap&&(n=n.concat($be)),!1!==e.foldKeymap&&(n=n.concat(Nge)),!1!==e.completionKeymap&&(n=n.concat(Y_e)),!1!==e.lintKeymap&&(n=n.concat(lxe));var i=[];return!1!==e.lineNumbers&&i.push(function(e={}){return[Mfe.of(e),Efe(),Ffe]}()),!1!==e.highlightActiveLineGutter&&i.push(Ufe),!1!==e.highlightSpecialChars&&i.push(function(e={}){return[Hpe.of(e),Wpe||(Wpe=dde.fromClass(class{constructor(e){this.view=e,this.decorations=_ue.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(Hpe)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new Fpe({regexp:e.specialChars,decoration:(t,n,i)=>{let{doc:r}=n.state,o=Fae(t[0],0);if(9==o){let e=r.lineAt(i),t=n.state.tabSize,o=ice(e.text,t,i-e.from);return _ue.replace({widget:new qpe((t-o%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=_ue.replace({widget:new Gpe(e,o)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(Hpe);e.startState.facet(Hpe)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))]}()),!1!==e.history&&i.push(function(e={}){return[Ibe,Abe.of(e),lpe.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?jbe:"historyRedo"==e.inputType?Tbe:null;return!!n&&(e.preventDefault(),n(t))}})]}()),!1!==e.foldGutter&&i.push(function(e={}){let t=Object.assign(Object.assign({},Fge),e),n=new zge(t,!0),i=new zge(t,!1),r=dde.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(sge)!=e.state.facet(sge)||e.startState.field(Ige,!1)!=e.state.field(Ige,!1)||Xme(e.startState)!=Xme(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new Gle;for(let r of e.viewportLineBlocks){let o=Ege(e.state,r.from,r.to)?i:kge(e.state,r.from,r.to)?n:null;o&&t.add(r.from,r.from,o)}return t.finish()}}),{domEventHandlers:o}=t;return[r,Afe({class:"cm-foldGutter",markers(e){var t;return(null===(t=e.plugin(r))||void 0===t?void 0:t.markers)||Wle.empty},initialSpacer:()=>new zge(t,!1),domEventHandlers:Object.assign(Object.assign({},o),{click:(e,t,n)=>{if(o.click&&o.click(e,t,n))return!0;let i=Ege(e.state,t.from,t.to);if(i)return e.dispatch({effects:Sge.of(i)}),!0;let r=kge(e.state,t.from,t.to);return!!r&&(e.dispatch({effects:Cge.of(r)}),!0)}})}),Lge()]}()),!1!==e.drawSelection&&i.push(function(e={}){return[Epe.of(e),Tpe,Npe,Ope,nde.of(!0)]}()),!1!==e.dropCursor&&i.push([Mpe,Ppe]),!1!==e.allowMultipleSelections&&i.push(Fle.allowMultipleSelections.of(!0)),!1!==e.indentOnInput&&i.push(Fle.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:i}=e.newSelection.main,r=n.lineAt(i);if(i>r.from+200)return e;let o=n.sliceString(r.from,i);if(!t.some(e=>e.test(o)))return e;let{state:s}=e,a=-1,l=[];for(let{head:e}of s.selection.ranges){let t=s.doc.lineAt(e);if(t.from==a)continue;a=t.from;let n=dge(s,t.from);if(null==n)continue;let i=/^\s*/.exec(t.text)[0],r=uge(s,n);i!=r&&l.push({from:t.from,to:t.from+i.length,insert:r})}return l.length?[e,{changes:l,sequential:!0}]:e})),!1!==e.syntaxHighlighting&&i.push(Gge(Yge,{fallback:!0})),!1!==e.bracketMatching&&i.push(function(e={}){return[Zge.of(e),ibe]}()),!1!==e.closeBrackets&&i.push([z_e,L_e]),!1!==e.autocompletion&&i.push(function(e={}){return[T_e,w_e,o_e.of(e),E_e,J_e,B_e]}()),!1!==e.rectangularSelection&&i.push(function(){let e=e=>e.altKey&&0==e.button;return lpe.mouseSelectionStyle.of((t,n)=>e(n)?function(e,t){let n=Zpe(e,t),i=e.state.selection;return n?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(n.line).from),r=e.state.doc.lineAt(t);n={line:r.number,col:n.col,off:Math.min(n.off,r.length)},i=i.map(e.changes)}},get(t,r,o){let s=Zpe(e,t);if(!s)return i;let a=function(e,t,n){let i=Math.min(t.line,n.line),r=Math.max(t.line,n.line),o=[];if(t.off>Xpe||n.off>Xpe||t.col<0||n.col<0){let s=Math.min(t.off,n.off),a=Math.max(t.off,n.off);for(let t=i;t<=r;t++){let n=e.doc.line(t);n.length<=a&&o.push(Qae.range(n.from+s,n.to+a))}}else{let s=Math.min(t.col,n.col),a=Math.max(t.col,n.col);for(let t=i;t<=r;t++){let n=e.doc.line(t),i=rce(n.text,s,e.tabSize,!0);if(i<0)o.push(Qae.cursor(n.to));else{let t=rce(n.text,a,e.tabSize);o.push(Qae.range(n.from+i,n.from+t))}}}return o}(e.state,n,s);return a.length?o?Qae.create(a.concat(i.ranges)):Qae.create(a):i}}:null}(t,n):null)}()),!1!==t&&i.push(function(e={}){let[t,n]=Qpe[e.key||"Alt"],i=dde.fromClass(class{constructor(e){this.view=e,this.isDown=!1}set(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}},{eventObservers:{keydown(e){this.set(e.keyCode==t||n(e))},keyup(e){e.keyCode!=t&&n(e)||this.set(!1)},mousemove(e){this.set(n(e))}}});return[i,lpe.contentAttributes.of(e=>{var t;return(null===(t=e.plugin(i))||void 0===t?void 0:t.isDown)?efe:null})]}()),!1!==e.highlightActiveLine&&i.push(Ype),!1!==e.highlightSelectionMatches&&i.push(function(){let e=[dve,uve];return e}()),e.tabSize&&"number"==typeof e.tabSize&&i.push(lge.of(" ".repeat(e.tabSize))),i.concat([mpe.of(n.flat())]).filter(Boolean)};const vxe="#e06c75",_xe="#abb2bf",xxe="#7d8799",kxe="#d19a66",wxe="#2c313a",Cxe="#282c34",Sxe="#353a42",Axe="#528bff",Ixe=[lpe.theme({"&":{color:_xe,backgroundColor:Cxe},".cm-content":{caretColor:Axe},".cm-cursor, .cm-dropCursor":{borderLeftColor:Axe},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:_xe},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Cxe,color:xxe,border:"none"},".cm-activeLineGutter":{backgroundColor:wxe},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Sxe},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Sxe,borderBottomColor:Sxe},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:wxe,color:_xe}}},{dark:!0}),Gge(Uge.define([{tag:Wme.keyword,color:"#c678dd"},{tag:[Wme.name,Wme.deleted,Wme.character,Wme.propertyName,Wme.macroName],color:vxe},{tag:[Wme.function(Wme.variableName),Wme.labelName],color:"#61afef"},{tag:[Wme.color,Wme.constant(Wme.name),Wme.standard(Wme.name)],color:kxe},{tag:[Wme.definition(Wme.name),Wme.separator],color:_xe},{tag:[Wme.typeName,Wme.className,Wme.number,Wme.changed,Wme.annotation,Wme.modifier,Wme.self,Wme.namespace],color:"#e5c07b"},{tag:[Wme.operator,Wme.operatorKeyword,Wme.url,Wme.escape,Wme.regexp,Wme.link,Wme.special(Wme.string)],color:"#56b6c2"},{tag:[Wme.meta,Wme.comment],color:xxe},{tag:Wme.strong,fontWeight:"bold"},{tag:Wme.emphasis,fontStyle:"italic"},{tag:Wme.strikethrough,textDecoration:"line-through"},{tag:Wme.link,color:xxe,textDecoration:"underline"},{tag:Wme.heading,fontWeight:"bold",color:vxe},{tag:[Wme.atom,Wme.bool,Wme.special(Wme.variableName)],color:kxe},{tag:[Wme.processingInstruction,Wme.string,Wme.inserted],color:"#98c379"},{tag:Wme.invalid,color:"#ffffff"}]))];var Exe=lpe.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),jxe=function(e){void 0===e&&(e={});var{indentWithTab:t=!0,editable:n=!0,readOnly:i=!1,theme:r="light",placeholder:o="",basicSetup:s=!0}=e,a=[];switch(t&&a.unshift(mpe.of([$ye])),s&&("boolean"==typeof s?a.unshift(yxe()):a.unshift(yxe(s))),o&&a.unshift(function(e){return dde.fromClass(class{constructor(t){this.view=t,this.placeholder=e?_ue.set([_ue.widget({widget:new Jpe(e),side:1}).range(0)]):_ue.none}get decorations(){return this.view.state.doc.length?_ue.none:this.placeholder}},{decorations:e=>e.decorations})}(o)),r){case"light":a.push(Exe);break;case"dark":a.push(Ixe);break;case"none":break;default:a.push(r)}return!1===n&&a.push(lpe.editable.of(!1)),i&&a.push(Fle.readOnly.of(!0)),[...a]},Txe=Sle.define(),Bxe=[],Nxe=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],Rxe=(0,T.forwardRef)((e,t)=>{var{className:n,value:i="",selection:r,extensions:o=[],onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:c,autoFocus:u,theme:d="light",height:h,minHeight:p,maxHeight:f,width:m,minWidth:g,maxWidth:b,basicSetup:y,placeholder:v,indentWithTab:_,editable:x,readOnly:k,root:w,initialState:C}=e,S=function(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;n[i]=e[i]}return n}(e,Nxe),A=(0,T.useRef)(null),{state:I,view:E,container:j}=function(e){var{value:t,selection:n,onChange:i,onStatistics:r,onCreateEditor:o,onUpdate:s,extensions:a=Bxe,autoFocus:l,theme:c="light",height:u=null,minHeight:d=null,maxHeight:h=null,width:p=null,minWidth:f=null,maxWidth:m=null,placeholder:g="",editable:b=!0,readOnly:y=!1,indentWithTab:v=!0,basicSetup:_=!0,root:x,initialState:k}=e,[w,C]=(0,T.useState)(),[S,A]=(0,T.useState)(),[I,E]=(0,T.useState)(),j=lpe.theme({"&":{height:u,minHeight:d,maxHeight:h,width:p,minWidth:f,maxWidth:m},"& .cm-scroller":{height:"100% !important"}}),B=lpe.updateListener.of(e=>{if(e.docChanged&&"function"==typeof i&&!e.transactions.some(e=>e.annotation(Txe))){var t=e.state.doc.toString();i(t,e)}r&&r((e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(e=>!e.empty)}))(e))}),N=[B,j,...jxe({theme:c,editable:b,readOnly:y,placeholder:g,indentWithTab:v,basicSetup:_})];return s&&"function"==typeof s&&N.push(lpe.updateListener.of(s)),N=N.concat(a),(0,T.useEffect)(()=>{if(w&&!I){var e={doc:t,selection:n,extensions:N},i=k?Fle.fromJSON(k.json,e,k.fields):Fle.create(e);if(E(i),!S){var r=new lpe({state:i,parent:w,root:x});A(r),o&&o(r,i)}}return()=>{S&&(E(void 0),A(void 0))}},[w,I]),(0,T.useEffect)(()=>C(e.container),[e.container]),(0,T.useEffect)(()=>()=>{S&&(S.destroy(),A(void 0))},[S]),(0,T.useEffect)(()=>{l&&S&&S.focus()},[l,S]),(0,T.useEffect)(()=>{S&&S.dispatch({effects:Ele.reconfigure.of(N)})},[c,a,u,d,h,p,f,m,g,b,y,v,_,i,s]),(0,T.useEffect)(()=>{if(void 0!==t){var e=S?S.state.doc.toString():"";S&&t!==e&&S.dispatch({changes:{from:0,to:e.length,insert:t||""},annotations:[Txe.of(!0)]})}},[t,S]),{state:I,setState:E,view:S,setView:A,container:w,setContainer:C}}({container:A.current,root:w,value:i,autoFocus:u,theme:d,height:h,minHeight:p,maxHeight:f,width:m,minWidth:g,maxWidth:b,basicSetup:y,placeholder:v,indentWithTab:_,editable:x,readOnly:k,selection:r,onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:c,extensions:o,initialState:C});if((0,T.useImperativeHandle)(t,()=>({editor:A.current,state:I,view:E}),[A,j,I,E]),"string"!=typeof i)throw new Error("value must be typeof string but got "+typeof i);var B="string"==typeof d?"cm-theme-"+d:"cm-theme";return(0,Er.jsx)("div",_ae({ref:A,className:B+(n?" "+n:"")},S))});Rxe.displayName="CodeMirror";const Oxe=Rxe;function Lxe({value:e,onChange:t,options:n={lineNumbers:!0,tabMode:"indent",matchBrackets:!0}}){const i=(0,T.useCallback)(e=>{t(e)},[t]);return(0,Er.jsx)(Oxe,{value:e,onChange:i,basicSetup:{lineNumbers:n.lineNumbers,indentWithTabs:"indent"===n.tabMode,bracketMatching:n.matchBrackets}})}function Mxe({onToggle:e,isOpened:t}){const n=(0,zt.A)(e=>e(Gee).getFormStyles(),[]),{changeFormStyles:i}=(0,Vt.A)(Gee);return(0,Er.jsx)(sne.A,{children:(0,Er.jsx)(mz.Ay,{title:$ee.U.I18n.t("customCss"),opened:t,onToggle:e,children:(0,Er.jsx)(Lxe,{value:n,onChange:i})})})}Lxe.propTypes={value:Uee().string.isRequired,onChange:Uee().func.isRequired,options:Uee().shape({lineNumbers:Uee().bool,tabMode:Uee().string,matchBrackets:Uee().bool})},Mxe.propTypes={onToggle:Uee().func.isRequired,isOpened:Uee().bool.isRequired};var Pxe=n(90574);function Dxe({onToggle:e,isOpened:t}){const n=(0,zt.A)(e=>e(Gee).getFormSettings(),[]),{changeFormSettings:i}=(0,Vt.A)(Gee),r=$ee.U.tags.map(e=>e.name);return(0,Er.jsx)(sne.A,{children:(0,Er.jsx)(mz.Ay,{title:"Tags",opened:t,onToggle:e,children:(0,Er.jsx)(Pxe.g,{label:$ee.U.I18n.t("addNewTag"),onChange:e=>{(0,Kee.isEqual)(n.tags,e.value)||i({...n,tags:e.value})},suggestedValues:r,selectedValues:n.tags})})})}function Fxe(){const{toggleSidebarPanel:e}=(0,Vt.A)(Gee),t=(0,zt.A)(e=>e(Gee).getSidebarOpenedPanels(),[]);return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(Fee.ErrorBoundary,{children:(0,Er.jsx)(eae,{isOpened:t.includes("basic-settings"),onToggle:(0,Kee.partial)(e,"basic-settings")})}),(0,Er.jsx)(aae,{isOpened:t.includes("styles-settings"),onToggle:(0,Kee.partial)(e,"styles-settings")}),(0,Er.jsx)(vae,{isOpened:t.includes("form-placement"),onToggle:(0,Kee.partial)(e,"form-placement")}),(0,Er.jsx)(Dxe,{isOpened:t.includes("tags"),onToggle:(0,Kee.partial)(e,"tags")}),(0,Er.jsx)(Mxe,{isOpened:t.includes("custom-css"),onToggle:(0,Kee.partial)(e,"custom-css")})]})}function zxe(){return(0,Er.jsx)(sne.A,{children:(0,Er.jsx)(h2,{})})}function Vxe({children:e,closeSidebar:t}){return(0,Er.jsxs)("div",{className:"components-panel__header interface-complementary-area-header editor-sidebar__panel-tabs",children:[e,(0,Er.jsx)(fv.Ay,{onClick:t,icon:"no-alt",label:(0,ee.__)("Close settings","mailpoet")})]})}const{lock:Uxe,unlock:$xe}=(0,pt.yf)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/edit-post"),{Tabs:Hxe}=$xe(Ev.j);function Wxe({onClose:e}){const{activeTab:t,selectedBlockId:n}=(0,zt.A)(e=>({activeTab:e(Gee).getDefaultSidebarActiveTab(),selectedBlockId:e("core/block-editor").getSelectedBlockClientId()}),[]),{switchDefaultSidebarTab:i}=(0,Vt.A)(Gee);return(0,T.useEffect)(()=>{i(n?"block":"form")},[n,i]),(0,Er.jsxs)(Hxe,{selectedTabId:t,onSelect:i,children:[(0,Er.jsx)(Vxe,{closeSidebar:e,children:(0,Er.jsxs)(Hxe.TabList,{children:[(0,Er.jsx)(Hxe.Tab,{tabId:"form",children:$ee.U.I18n.t("form")}),(0,Er.jsx)(Hxe.Tab,{tabId:"block",children:(0,ee.__)("Block")})]})}),(0,Er.jsx)(Hxe.TabPanel,{tabId:"form",children:(0,Er.jsx)(Fxe,{})}),(0,Er.jsx)(Hxe.TabPanel,{tabId:"block",children:(0,Er.jsx)(zxe,{})})]})}var Gxe=n(39429);function qxe({label:e,minPercents:t=0,maxPercents:n=100,minPixels:i=10,maxPixels:r=1e3,value:o,defaultPercentValue:s=50,defaultPixelValue:a=200,onChange:l}){const[c,u]=(0,T.useState)(o??{unit:"pixel",value:void 0});return(0,T.useEffect)(()=>{u(o)},[o]),(0,Er.jsxs)("div",{className:"mailpoet-size-settings-control",children:[(0,Er.jsx)(mk.Ay.VisualLabel,{children:e}),(0,Er.jsx)(qse.A,{className:"mailpoet-form-inline-radios__control",selected:c.unit||"pixel",options:[{label:"px",value:"pixel"},{label:"%",value:"percent"}],onChange:e=>{const t={value:"pixel"===e?a:s,unit:e};u(t),l(t)}}),(0,Er.jsx)(gk.A,{value:c.value??("pixel"===c.unit?a:s),min:"pixel"===c.unit?i:t,max:"pixel"===c.unit?r:n,onChange:e=>{const t={unit:"pixel"===c.unit?"pixel":"percent",value:e};u(t),l(t)}})]})}qxe.displayName="FormEditorSizeSettings";const Kxe=(0,Fee.withBoundary)(qxe);function Yxe({settingsPlacementKey:e}){const t=(0,zt.A)(e=>e(Gee).getFormSettings(),[]),n=(0,zt.A)(e=>(0,Gxe.sortBy)("name",e(Gee).getAllWPTags().concat(e(Gee).getAllWooCommerceTags())),[]),i=(0,zt.A)(e=>(0,Gxe.sortBy)("name",e(Gee).getAllWPCategories().concat(e(Gee).getAllWooCommerceCategories())),[]),r=(0,zt.A)(e=>e(Gee).getAllWPPages(),[]),o=(0,zt.A)(e=>(0,Gxe.sortBy)("name",e(Gee).getAllWPPosts().concat(e(Gee).getAllWooCommerceProducts())),[]),s=(0,zt.A)(e=>e(Gee).getIsPreviewShown(),[]),{changeFormSettings:a}=(0,Vt.A)(Gee);let l="no-preview";s&&(l="preview");const c="belowPosts"!==e;return(0,Er.jsxs)(Er.Fragment,{children:[c&&(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("placeFormOnHomepage"),checked:t.formPlacement[e].homepage,onChange:n=>{(0,Gxe.compose)([a,(0,Gxe.assocPath)(`formPlacement.${e}.homepage`,n)])(t)}}),(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("placeFormOnAllPages"),checked:t.formPlacement[e].pages.all,onChange:n=>{(0,Gxe.compose)([a,(0,Gxe.assocPath)(`formPlacement.${e}.pages.all`,n),(0,Gxe.cond)([[()=>n,(0,Gxe.compose)([(0,Gxe.assocPath)(`formPlacement.${e}.pages.selected`,[]),(0,Gxe.assocPath)(`formPlacement.${e}.categories`,[]),(0,Gxe.assocPath)(`formPlacement.${e}.tags`,[])])],[()=>!n,Gxe.identity]])])(t)}}),(0,Er.jsx)("div",{"data-automation-id":"form-placement-select-page",children:(0,Er.jsx)("div",{className:"form-editor-placement-selection",children:(0,Er.jsx)(Zse,{dropDownParent:s?".mailpoet-modal-content":void 0,item:{id:`${l}${t.formPlacement[e].pages.selected.join()}`},onValueChange:n=>{const i=t.formPlacement[e].pages.selected;(0,Gxe.isEqual)(i,n.target.value)||(0,Gxe.compose)([a,(0,Gxe.assocPath)(`formPlacement.${e}.pages.selected`,n.target.value),(0,Gxe.cond)([[()=>!!n.target.value.length,(0,Gxe.assocPath)(`formPlacement.${e}.pages.all`,!1)],[()=>!n.target.value.length,Gxe.identity]])])(t)},field:{id:`${l}pages`,name:"pages",values:r,multiple:!0,placeholder:$ee.U.I18n.t("selectPage"),getLabel:e=>e.name,selected:()=>t.formPlacement[e].pages.selected}})})}),(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("placeFormOnAllPosts"),checked:t.formPlacement[e].posts.all,onChange:n=>{(0,Gxe.compose)([a,(0,Gxe.assocPath)(`formPlacement.${e}.posts.all`,n),(0,Gxe.cond)([[()=>n,(0,Gxe.compose)([(0,Gxe.assocPath)(`formPlacement.${e}.posts.selected`,[]),(0,Gxe.assocPath)(`formPlacement.${e}.categories`,[]),(0,Gxe.assocPath)(`formPlacement.${e}.tags`,[])])],[()=>!n,Gxe.identity]])])(t)}}),(0,Er.jsx)("div",{className:"form-editor-placement-selection",children:(0,Er.jsx)(Zse,{dropDownParent:s?".mailpoet-modal-content":void 0,item:{id:`${l}${t.formPlacement[e].posts.selected.join()}`},onValueChange:n=>{const i=t.formPlacement[e].posts.selected;(0,Gxe.isEqual)(i,n.target.value)||(0,Gxe.compose)([a,(0,Gxe.assocPath)(`formPlacement.${e}.posts.selected`,n.target.value),(0,Gxe.cond)([[()=>!!n.target.value.length,(0,Gxe.assocPath)(`formPlacement.${e}.posts.all`,!1)],[()=>!n.target.value.length,Gxe.identity]])])(t)},field:{id:`${l}posts`,name:"posts",values:o,multiple:!0,placeholder:$ee.U.I18n.t("selectPage"),getLabel:e=>e.name,selected:()=>t.formPlacement[e].posts.selected}})}),(0,Er.jsxs)("div",{children:[(0,Er.jsx)("p",{className:"form-editor-sidebar-heading",children:$ee.U.I18n.t("displayOnCategories")}),(0,Er.jsx)("div",{className:"form-editor-placement-selection",children:(0,Er.jsx)(Zse,{dropDownParent:s?".mailpoet-modal-content":void 0,item:{id:`${l}${t.formPlacement[e].categories.join()}`},onValueChange:n=>{const i=t.formPlacement[e].categories;(0,Gxe.isEqual)(i,n.target.value)||(0,Gxe.compose)([a,(0,Gxe.assocPath)(`formPlacement.${e}.categories`,n.target.value),(0,Gxe.cond)([[()=>!!n.target.value.length,(0,Gxe.compose)([(0,Gxe.assocPath)(`formPlacement.${e}.pages.all`,!1),(0,Gxe.assocPath)(`formPlacement.${e}.posts.all`,!1)])],[()=>!n.target.value.length,Gxe.identity]])])(t)},field:{id:`${l}categories`,name:"categories",values:i,multiple:!0,placeholder:$ee.U.I18n.t("selectPage"),getLabel:e=>e.name,selected:()=>t.formPlacement[e].categories}})})]}),(0,Er.jsxs)("div",{children:[(0,Er.jsx)("p",{className:"form-editor-sidebar-heading",children:$ee.U.I18n.t("displayOnTags")}),(0,Er.jsx)("div",{className:"form-editor-placement-selection",children:(0,Er.jsx)(Zse,{dropDownParent:s?".mailpoet-modal-content":void 0,item:{id:`${l}${t.formPlacement[e].tags.join()}`},onValueChange:n=>{const i=t.formPlacement[e].tags;(0,Gxe.isEqual)(i,n.target.value)||(0,Gxe.compose)([a,(0,Gxe.assocPath)(`formPlacement.${e}.tags`,n.target.value),(0,Gxe.cond)([[()=>!!n.target.value.length,(0,Gxe.compose)([(0,Gxe.assocPath)(`formPlacement.${e}.pages.all`,!1),(0,Gxe.assocPath)(`formPlacement.${e}.posts.all`,!1)])],[()=>!n.target.value.length,Gxe.identity]])])(t)},field:{id:`${l}tags`,name:"tags",values:n,multiple:!0,placeholder:$ee.U.I18n.t("selectPage"),getLabel:e=>e.name,selected:()=>t.formPlacement[e].tags}})})]}),c&&(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("displayOnAllTagArchives"),checked:t.formPlacement[e].tagArchives.all,onChange:n=>{(0,Gxe.compose)([a,(0,Gxe.assocPath)(`formPlacement.${e}.tagArchives.all`,n),(0,Gxe.cond)([[()=>n,(0,Gxe.compose)([(0,Gxe.assocPath)(`formPlacement.${e}.tagArchives.selected`,[])])],[()=>!n,Gxe.identity]])])(t)}}),(0,Er.jsx)("div",{"data-automation-id":"form-placement-select-archive-tags",children:(0,Er.jsx)("div",{className:"form-editor-placement-selection",children:(0,Er.jsx)(Zse,{dropDownParent:s?".mailpoet-modal-content":void 0,item:{id:`${l}${t.formPlacement[e].tagArchives.selected.join()}`},onValueChange:n=>{const i=t.formPlacement[e].tagArchives.selected;(0,Gxe.isEqual)(i,n.target.value)||(0,Gxe.compose)([a,(0,Gxe.assocPath)(`formPlacement.${e}.tagArchives.selected`,n.target.value),(0,Gxe.cond)([[()=>!!n.target.value.length,(0,Gxe.assocPath)(`formPlacement.${e}.tagArchives.all`,!1)],[()=>!n.target.value.length,Gxe.identity]])])(t)},field:{id:`${l}tagArchives`,name:"tagArchives",values:n,multiple:!0,placeholder:$ee.U.I18n.t("selectSpecificArchiveTags"),getLabel:e=>e.name,selected:()=>t.formPlacement[e].tagArchives.selected}})})}),(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("displayOnAllCategoryArchives"),checked:t.formPlacement[e].categoryArchives.all,onChange:n=>{(0,Gxe.compose)([a,(0,Gxe.assocPath)(`formPlacement.${e}.categoryArchives.all`,n),(0,Gxe.cond)([[()=>n,(0,Gxe.compose)([(0,Gxe.assocPath)(`formPlacement.${e}.categoryArchives.selected`,[])])],[()=>!n,Gxe.identity]])])(t)}}),(0,Er.jsx)("div",{"data-automation-id":"form-placement-select-archive-categories",children:(0,Er.jsx)("div",{className:"form-editor-placement-selection",children:(0,Er.jsx)(Zse,{dropDownParent:s?".mailpoet-modal-content":void 0,item:{id:`${l}${t.formPlacement[e].categoryArchives.selected.join()}`},onValueChange:n=>{const i=t.formPlacement[e].categoryArchives.selected;(0,Gxe.isEqual)(i,n.target.value)||(0,Gxe.compose)([a,(0,Gxe.assocPath)(`formPlacement.${e}.categoryArchives.selected`,n.target.value),(0,Gxe.cond)([[()=>!!n.target.value.length,(0,Gxe.assocPath)(`formPlacement.${e}.categoryArchives.all`,!1)],[()=>!n.target.value.length,Gxe.identity]])])(t)},field:{id:`${l}categoryArchives`,name:"categoryArchives",values:i,multiple:!0,placeholder:$ee.U.I18n.t("selectSpecificArchiveCategories"),getLabel:e=>e.name,selected:()=>t.formPlacement[e].categoryArchives.selected}})})})]})]})}Yxe.displayName="FormEditorPlacementSettings";const Jxe=(0,Fee.withBoundary)(Yxe);function Xxe(){const e=(0,zt.A)(e=>e(Gee).getFormSettings(),[]),{changeFormSettings:t}=(0,Vt.A)(Gee),n=e.formPlacement.belowPosts.enabled;return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)("p",{children:$ee.U.I18n.t("placeFormBellowPagesDescription")}),(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("enable"),checked:n,onChange:(0,Gxe.compose)([t,(0,Gxe.assocPath)("formPlacement.belowPosts.enabled",Gxe.__,e)])}),n&&(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(Kxe,{label:$ee.U.I18n.t("formSettingsWidth"),value:e.formPlacement.belowPosts.styles.width,minPixels:200,maxPixels:1200,minPercents:10,maxPercents:100,defaultPixelValue:560,defaultPercentValue:100,onChange:n=>{t((0,Gxe.assocPath)("formPlacement.belowPosts.styles.width",n,e))}}),(0,Er.jsx)(Jxe,{settingsPlacementKey:"belowPosts"})]})]})}function Zxe({settingsPlacementKey:e}){const t=(0,zt.A)(e=>e(Gee).getFormSettings(),[]),{changeFormSettings:n}=(0,Vt.A)(Gee);return(0,Er.jsx)(oE.A,{label:$ee.U.I18n.t("animationHeader"),value:t.formPlacement[e].animation,options:[{label:$ee.U.I18n.t("animationNone"),value:"none"},{label:"Fade In",value:"fadein"},{label:"Slide Right",value:"slideright"},{label:"Slide Left",value:"slideleft"},{label:"Slide Up",value:"slideup"},{label:"Slide Down",value:"slidedown"},{label:"Zoom Out",value:"zoomout"},{label:"Zoom In",value:"zoomin"},{label:"Flip",value:"flip"}],onChange:(0,Gxe.compose)([n,(0,Gxe.assocPath)(`formPlacement.${e}.animation`,Gxe.__,t)])})}Zxe.displayName="FormEditorAnimationSettings";const Qxe=(0,Fee.withBoundary)(Zxe);function eke({settingsPlacementKey:e}){const t=(0,zt.A)(e=>e(Gee).getFormSettings(),[]),{changeFormSettings:n}=(0,Vt.A)(Gee);return(0,Er.jsx)(oE.A,{label:$ee.U.I18n.t("formPlacementCookieExpiration"),value:t.formPlacement[e].cookieExpiration,options:[{value:"0",label:$ee.U.I18n.t("formPlacementCookieExpirationAlways")},{value:"1",label:$ee.U.I18n.t("formPlacementCookieExpirationDay")},...[3,7,14,30,60,90].map(e=>({value:`${e}`,label:$ee.U.I18n.t("formPlacementCookieExpirationDays").replace("%1s",e.toString())}))],onChange:(0,Gxe.compose)([n,(0,Gxe.assocPath)(`formPlacement.${e}.cookieExpiration`,Gxe.__,t)])})}eke.displayName="FormEditorCookieSettings";const tke=(0,Fee.withBoundary)(eke),nke=[0,2,5,10,15,30,45,60,120,180,240];function ike(){const e=(0,zt.A)(e=>e(Gee).getFormSettings(),[]),{changeFormSettings:t}=(0,Vt.A)(Gee),n=e.formPlacement.popup.enabled,i="on_click"===e.formPlacement.popup.triggerMode;return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)("p",{children:$ee.U.I18n.t("placePopupFormOnPagesDescription")}),(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("enable"),checked:n,onChange:(0,Gxe.compose)([t,(0,Gxe.assocPath)("formPlacement.popup.enabled",Gxe.__,e)])}),n&&(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)("hr",{}),(0,Er.jsx)(Kxe,{label:$ee.U.I18n.t("formSettingsWidth"),value:e.formPlacement.popup.styles.width,minPixels:200,maxPixels:1200,minPercents:10,maxPercents:100,defaultPixelValue:560,defaultPercentValue:100,onChange:n=>{t((0,Gxe.assocPath)("formPlacement.popup.styles.width",n,e))}}),(0,Er.jsx)(Jxe,{settingsPlacementKey:"popup"}),(0,Er.jsx)(Qxe,{settingsPlacementKey:"popup"}),(0,Er.jsx)(qse.A,{className:"mailpoet-form-inline-radios__control",label:$ee.U.I18n.t("popupTriggerModeLabel"),selected:e.formPlacement.popup.triggerMode,options:[{label:$ee.U.I18n.t("popupTriggerModeAuto"),value:"auto"},{label:$ee.U.I18n.t("popupTriggerModeOnClick"),value:"on_click"}],onChange:(0,Gxe.compose)([t,(0,Gxe.assocPath)("formPlacement.popup.triggerMode",Gxe.__,e)])}),i&&(0,Er.jsx)(kS.A,{label:$ee.U.I18n.t("popupClickTriggerSelectorLabel"),help:$ee.U.I18n.t("popupClickTriggerSelectorHelp"),value:e.formPlacement.popup.clickTriggerSelector,onChange:(0,Gxe.compose)([t,(0,Gxe.assocPath)("formPlacement.popup.clickTriggerSelector",Gxe.__,e)])}),i&&(0,Er.jsx)("p",{children:$ee.U.I18n.t("popupOnClickDisablesOtherTriggersNotice")}),!i&&(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(oE.A,{label:$ee.U.I18n.t("formPlacementDelay"),value:`${e.formPlacement.popup.delay}`,onChange:(0,Gxe.compose)([t,(0,Gxe.assocPath)("formPlacement.popup.delay",Gxe.__,e)]),options:nke.map(e=>({value:`${e}`,label:$ee.U.I18n.t("formPlacementDelaySeconds").replace("%1s",`${e}`)}))}),(0,Er.jsx)(tke,{settingsPlacementKey:"popup"}),(0,Er.jsxs)("div",{children:[(0,Er.jsx)("p",{children:(0,Er.jsx)("b",{children:$ee.U.I18n.t("exitIntentTitle")})}),(0,Er.jsx)("p",{children:$ee.U.I18n.t("exitIntentDescription")}),(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("exitIntentSwitch"),checked:e.formPlacement.popup.exitIntentEnabled,onChange:(0,Gxe.compose)([t,(0,Gxe.assocPath)("formPlacement.popup.exitIntentEnabled",Gxe.__,e)])})]})]})]})]})}var rke=n(2726),oke=n.n(rke);function ske(){const[e,t]=(0,T.useState)(null),n=(0,zt.A)(e=>e(Gee).getFormExports(),[]),i=(0,zt.A)(e=>e(Gee).getFormSettings(),[]),r=(0,zt.A)(e=>e(Gee).isFormSaved(),[]),{changeFormSettings:o}=(0,Vt.A)(Gee),s=(0,zt.A)(Gee).getThemeSupport(),a=oke()($ee.U.I18n.t("addFormShortcodeHint"),/\[shortcode]/g,e=>(0,Er.jsx)("code",{children:n.shortcode},e)),l=(0,Kee.curry)((e,i)=>(i.preventDefault(),$ee.U.trackEvent("Forms > Embed",{"Embed type":e}),t("php"===e?n.php:n.iframe))),c=oke()($ee.U.I18n.t("addFormPhpIframeHint"),/\[link](.*?)\[\/link]/g,e=>"PHP"===e?(0,Er.jsx)("a",{href:"#",onClick:l("php"),children:e},"exportPHP"):(0,Er.jsx)("a",{href:"#",onClick:l("iframe"),children:e},"exportIframe"));return r?(0,Er.jsxs)(Er.Fragment,{children:[(({hasWidgets:e,hasFSE:t})=>{if(!e&&!t)return null;let n;!0===e?n={href:"widgets.php",i18nKey:"addFormWidgetHint"}:!0===t&&(n={href:"site-editor.php",i18nKey:"addFormFSEHint"});const i=oke()($ee.U.I18n.t(n.i18nKey),/\[link](.*?)\[\/link]/g,e=>(0,Er.jsx)("a",{href:n.href,target:"_blank",rel:"noreferrer",children:e},"addFormWidgetHintLink"));return(0,Er.jsx)("p",{children:i})})(s),(0,Er.jsx)("p",{children:a}),(0,Er.jsx)("p",{children:c}),e?(0,Er.jsx)(TF.A,{readOnly:!0,onClick:e=>e.target.select(),rows:8,value:e,onChange:()=>{}},"copyTextArea"):null,(0,Er.jsx)("hr",{}),(0,Er.jsx)(Kxe,{label:$ee.U.I18n.t("formSettingsWidth"),value:i.formPlacement.others.styles.width,minPixels:200,maxPixels:1200,minPercents:10,maxPercents:100,defaultPixelValue:200,defaultPercentValue:100,onChange:e=>{o((0,Gxe.assocPath)("formPlacement.others.styles.width",e,i))}})]}):(0,Er.jsx)("p",{children:$ee.U.I18n.t("saveFormFirst")})}ske.displayName="FormEditorOtherSettings";const ake=[0,2,5,10,15,30,45,60,120,180,240];function lke(){const e=(0,zt.A)(e=>e(Gee).getFormSettings(),[]),{changeFormSettings:t}=(0,Vt.A)(Gee),n=e.formPlacement.fixedBar.enabled;return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)("p",{children:$ee.U.I18n.t("placeFixedBarFormOnPagesDescription")}),(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("enable"),checked:n,onChange:(0,Gxe.compose)([t,(0,Gxe.assocPath)("formPlacement.fixedBar.enabled",Gxe.__,e)])}),n&&(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)("hr",{}),(0,Er.jsx)(qse.A,{label:$ee.U.I18n.t("formPlacementPlacementPosition"),selected:e.formPlacement.fixedBar.position,options:[{label:$ee.U.I18n.t("formPlacementPlacementPositionTop"),value:"top"},{label:$ee.U.I18n.t("formPlacementPlacementPositionBottom"),value:"bottom"}],onChange:(0,Gxe.compose)([t,(0,Gxe.assocPath)("formPlacement.fixedBar.position",Gxe.__,e)])}),(0,Er.jsx)(Kxe,{label:$ee.U.I18n.t("formSettingsWidth"),value:e.formPlacement.fixedBar.styles.width,minPixels:200,maxPixels:1200,minPercents:10,maxPercents:100,defaultPixelValue:560,defaultPercentValue:100,onChange:n=>{t((0,Gxe.assocPath)("formPlacement.fixedBar.styles.width",n,e))}}),(0,Er.jsx)(Jxe,{settingsPlacementKey:"fixedBar"}),(0,Er.jsx)(Qxe,{settingsPlacementKey:"fixedBar"}),(0,Er.jsx)(oE.A,{label:$ee.U.I18n.t("formPlacementDelay"),value:`${e.formPlacement.fixedBar.delay}`,onChange:(0,Gxe.compose)([t,(0,Gxe.assocPath)("formPlacement.fixedBar.delay",Gxe.__,e)]),options:ake.map(e=>({value:`${e}`,label:$ee.U.I18n.t("formPlacementDelaySeconds").replace("%1s",`${e}`)}))}),(0,Er.jsx)(tke,{settingsPlacementKey:"fixedBar"})]})]})}lke.displayName="FormEditorFixedBarSettings";const cke=[0,2,5,10,15,30,45,60,120,180,240];function uke(){const e=(0,zt.A)(e=>e(Gee).getFormSettings(),[]),{changeFormSettings:t}=(0,Vt.A)(Gee),n=e.formPlacement.slideIn.enabled;return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)("p",{children:$ee.U.I18n.t("placeSlideInFormOnPagesDescription")}),(0,Er.jsx)(Zv.A,{label:$ee.U.I18n.t("enable"),checked:n,onChange:(0,Gxe.compose)([t,(0,Gxe.assocPath)("formPlacement.slideIn.enabled",Gxe.__,e)])}),n&&(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)("hr",{}),(0,Er.jsx)(qse.A,{label:$ee.U.I18n.t("formPlacementPlacementPosition"),selected:e.formPlacement.slideIn.position,options:[{label:$ee.U.I18n.t("formPlacementPlacementPositionLeft"),value:"left"},{label:$ee.U.I18n.t("formPlacementPlacementPositionRight"),value:"right"}],onChange:(0,Gxe.compose)([t,(0,Gxe.assocPath)("formPlacement.slideIn.position",Gxe.__,e)])}),(0,Er.jsx)(Kxe,{label:$ee.U.I18n.t("formSettingsWidth"),value:e.formPlacement.slideIn.styles.width,minPixels:200,maxPixels:1200,minPercents:10,maxPercents:100,defaultPixelValue:560,defaultPercentValue:100,onChange:n=>{t((0,Gxe.assocPath)("formPlacement.slideIn.styles.width",n,e))}}),(0,Er.jsx)(Jxe,{settingsPlacementKey:"slideIn"}),(0,Er.jsx)(Qxe,{settingsPlacementKey:"slideIn"}),(0,Er.jsx)(oE.A,{label:$ee.U.I18n.t("formPlacementDelay"),value:`${e.formPlacement.slideIn.delay}`,onChange:(0,Gxe.compose)([t,(0,Gxe.assocPath)("formPlacement.slideIn.delay",Gxe.__,e)]),options:cke.map(e=>({value:`${e}`,label:$ee.U.I18n.t("formPlacementDelaySeconds").replace("%1s",`${e}`)}))}),(0,Er.jsx)(tke,{settingsPlacementKey:"slideIn"})]})]})}function dke({activePanel:e}){return(0,Er.jsxs)("div",{className:"mailpoet-styles-settings",children:["others"===e&&(0,Er.jsx)(Fee.ErrorBoundary,{children:(0,Er.jsx)(ske,{})}),"below_posts"===e&&(0,Er.jsx)(Fee.ErrorBoundary,{children:(0,Er.jsx)(Xxe,{})}),"fixed_bar"===e&&(0,Er.jsx)(Fee.ErrorBoundary,{children:(0,Er.jsx)(lke,{})}),"popup"===e&&(0,Er.jsx)(Fee.ErrorBoundary,{children:(0,Er.jsx)(ike,{})}),"slide_in"===e&&(0,Er.jsx)(Fee.ErrorBoundary,{children:(0,Er.jsx)(uke,{})})]})}function hke({onClose:e}){const t=(0,zt.A)(e=>e(Gee).getPreviewSettings(),[]);return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(Vxe,{closeSidebar:e,children:(0,Er.jsxs)("h3",{className:"mailpoet-sidebar-header-heading",children:["others"===t.formType&&(0,ee.__)("Others (widget)","mailpoet"),"below_posts"===t.formType&&(0,ee.__)("Below pages","mailpoet"),"fixed_bar"===t.formType&&(0,ee.__)("Fixed bar","mailpoet"),"popup"===t.formType&&(0,ee.__)("Pop-up","mailpoet"),"slide_in"===t.formType&&(0,ee.__)("Slide–in","mailpoet")]})}),(0,Er.jsx)(sne.A,{children:(0,Er.jsx)(mz.Ay,{children:(0,Er.jsx)(dke,{activePanel:t.formType})})})]})}function pke(){const{toggleSidebar:e,changeActiveSidebar:t}=(0,Vt.A)(Gee),{activeSidebar:n,selectedBlockId:i}=(0,zt.A)(e=>({activeSidebar:e(Gee).getActiveSidebar(),selectedBlockId:e("core/block-editor").getSelectedBlockClientId()}),[]);return(0,T.useEffect)(()=>{i&&t("default")},[i,t]),(0,Er.jsxs)("div",{className:"edit-post-sidebar interface-complementary-area mailpoet_form_editor_sidebar",children:["default"===n&&(0,Er.jsx)(Wxe,{onClose:()=>{e(!1)}}),"placement_settings"===n&&(0,Er.jsx)(hke,{onClose:()=>{t("default")}})]})}pke.displayName="FormEditorSidebar";var fke=n(51631);function mke({setIsInserterOpened:e}){const t=(0,zt.A)(e=>e(Gee).getInserterPanelInsertPoint(),[]),n=(0,T.useRef)(null),i=(0,T.useCallback)(()=>e(!1),[e]);return(0,Er.jsxs)("div",{className:"editor-inserter-sidebar",children:[(0,Er.jsx)("div",{className:"editor-inserter-sidebar__header",children:(0,Er.jsx)(fv.Ay,{icon:fke.A,onClick:i})}),(0,Er.jsx)("div",{className:"editor-inserter-sidebar__content",children:(0,Er.jsx)(C4,{showMostUsedBlocks:!0,showInserterHelpPanel:!1,rootClientId:t.rootClientId??void 0,__experimentalInsertionIndex:t.insertionIndex??void 0,onClose:i,ref:n})})]})}function gke(){return(0,Er.jsx)("div",{className:"editor-list-view-sidebar",children:(0,Er.jsx)("div",{className:"editor-list-view-sidebar__list-view-container",children:(0,Er.jsx)("div",{className:"editor-list-view-sidebar__list-view-panel-content",children:(0,Er.jsx)("div",{className:"edit-post-editor__list-view-container",children:(0,Er.jsx)(UQ,{})})})})})}var bke=n(81465);function yke(){const e=(0,zt.A)(e=>e(Gee).getDismissibleNotices(),[]),t=(0,zt.A)(e=>e(Gee).getNonDismissibleNotices(),[]),{removeNotice:n}=(0,Vt.A)(Gee),i=(0,Kee.memoize)(e=>{setTimeout(()=>n(e),5e3)});return e.forEach(e=>i(e.id)),(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(bke.A,{notices:t,className:"components-editor-notices__pinned"}),(0,Er.jsx)(bke.A,{notices:e,className:"components-editor-notices__dismissible automation-dismissible-notices",onRemove:n})]})}yke.displayName="FormEditorNotices";var vke=n(55880);const _ke=()=>{const e=document.getElementById("mailpoet-form-editor-form-styles"),t=(0,zt.A)(e=>e(Gee).getFormStyles(),[]);try{vke.parse(t)}catch(t){return Wj.createPortal(null,e)}const n=WF([{css:t}],".editor-styles-wrapper");return Wj.createPortal(n[0],e)};function xke(){return(0,Er.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"16px",height:"24px",viewBox:"0 0 16 24",version:"1.1",children:(0,Er.jsx)("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:(0,Er.jsx)("g",{className:"mailpoet_preview_icon_fill",transform:"translate(-760.000000, -64.000000)",fillRule:"nonzero",children:(0,Er.jsx)("g",{transform:"translate(712.000000, 64.000000)",children:(0,Er.jsx)("g",{transform:"translate(48.000000, 0.000000)",children:(0,Er.jsx)("path",{d:"M16,3 C16,1.34314575 14.6568542,0 13,0 L3,0 C1.34314575,0 0,1.34314575 0,3 L0,21 C0,22.6568542 1.34314575,24 3,24 L13,24 C14.6568542,24 16,22.6568542 16,21 L16,3 Z M14,5.5 L14,17.5 C14,18.0522847 13.5522847,18.5 13,18.5 L3,18.5 C2.44771525,18.5 2,18.0522847 2,17.5 L2,5.5 C2,4.94771525 2.44771525,4.5 3,4.5 L13,4.5 C13.5522847,4.5 14,4.94771525 14,5.5 Z M7,21 C7,20.4477153 7.44771525,20 8,20 C8.55228475,20 9,20.4477153 9,21 C9,21.5522847 8.55228475,22 8,22 C7.44771525,22 7,21.5522847 7,21 Z",id:"Shape"})})})})})})}function kke(){return(0,Er.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1",children:(0,Er.jsx)("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:(0,Er.jsx)("g",{className:"mailpoet_preview_icon_fill",transform:"translate(-712.000000, -64.000000)",fillRule:"nonzero",children:(0,Er.jsx)("g",{transform:"translate(712.000000, 64.000000)",children:(0,Er.jsx)("g",{children:(0,Er.jsx)("path",{d:"M13.965,20.5 C14.1138804,20.5 14.2550143,20.5663566 14.35,20.681 L14.35,20.681 L16.449,23.213 C16.5561084,23.3657981 16.5692196,23.5655248 16.4830056,23.7310137 C16.3967915,23.8965027 16.2255996,24.0002137 16.039,24 L16.039,24 L7.96,24 C7.7734004,24.0002137 7.60220849,23.8965027 7.51599443,23.7310137 C7.42978036,23.5655248 7.44289164,23.3657981 7.55,23.213 L7.55,23.213 L9.65,20.681 C9.74498572,20.5663566 9.88611956,20.5 10.035,20.5 L10.035,20.5 Z M22.5,-4.08562073e-14 C23.3284271,-4.08562073e-14 24,0.671572875 24,1.5 L24,1.5 L24,17.5 C24,18.3284271 23.3284271,19 22.5,19 L22.5,19 L1.5,19 C0.671572875,19 0,18.3284271 0,17.5 L0,17.5 L0,1.5 C0,0.671572875 0.671572875,-4.08562073e-14 1.5,-4.08562073e-14 L1.5,-4.08562073e-14 Z M21.5,2 L2.5,2 C2.22385763,2 2,2.22385763 2,2.5 L2,2.5 L2,14.5 C2,14.7761424 2.22385763,15 2.5,15 L2.5,15 L21.5,15 C21.7761424,15 22,14.7761424 22,14.5 L22,14.5 L22,2.5 C22,2.22385763 21.7761424,2 21.5,2 L21.5,2 Z"})})})})})})}function wke({children:e,onDisplayTypeChange:t=e=>e,selectedDisplayType:n="desktop"}){const[i,r]=(0,T.useState)(n),o=e=>{r(e),t(e)};return(0,Er.jsxs)("div",{className:"mailpoet_browser_preview",children:[(0,Er.jsxs)("div",{className:"mailpoet_browser_preview_toggle",children:[(0,Er.jsx)("a",{className:M()("mailpoet_browser_preview_icon",{mailpoet_active:"desktop"===i}),onClick:e=>{e.preventDefault(),o("desktop")},title:(0,ee._x)("Desktop","Desktop browser preview mode","mailpoet"),href:"#","data-automation-id":"preview_type_desktop",children:(0,Er.jsx)(kke,{})}),(0,Er.jsx)("a",{className:M()("mailpoet_browser_preview_icon",{mailpoet_active:"mobile"===i}),onClick:e=>{e.preventDefault(),o("mobile")},title:(0,ee._x)("Mobile","Mobile browser preview mode","mailpoet"),href:"#","data-automation-id":"preview_type_mobile",children:(0,Er.jsx)(xke,{})})]}),(0,Er.jsx)("div",{className:M()("mailpoet_browser_preview_container",{mailpoet_browser_preview_container_mobile:"desktop"!==i},{mailpoet_browser_preview_container_desktop:"desktop"===i}),children:(0,Er.jsx)("div",{className:"mailpoet_browser_preview_border",children:e})}),"desktop"!==i&&(0,Er.jsx)("p",{className:"mailpoet_form_preview_disclaimer",children:(0,ee.__)("Psssst. Forms on mobile appear smaller automatically because it’s better for SEO.","mailpoet")})]})}function Cke(){const e=(0,T.useRef)(null),[t,n]=(0,T.useState)(!1),{hidePreview:i,changePreviewSettings:r}=(0,Vt.A)(Gee),o=(0,zt.A)(e=>e(Gee).getIsPreviewShown(),[]),s=(0,zt.A)(e=>e(Gee).getIsPreviewReady(),[]),a=(0,zt.A)(e=>e(Gee).getPreviewSettings(),[]),l=(0,zt.A)(e=>e(Gee).getFormSettings(),[]),c=(0,zt.A)(e=>e(Gee).getFormData().id,[]),u=(0,zt.A)(e=>e(Gee).getEditorUrl(),[]),d=(0,zt.A)(e=>e(Gee).getPreviewPageUrl(),[]);(0,T.useEffect)(()=>{n(!1);const e=document.getElementById("beacon-container");o&&e&&(e.style.display="none")},[o]),(0,T.useEffect)(()=>{if(!e.current||!t)return;const n={formType:a.formType,formSettings:l};e.current.contentWindow.postMessage(n,d)},[l,e,a,t,d]);const h=(0,T.useCallback)(()=>{const e=document.getElementById("beacon-container");e&&(e.style.display="block"),i()},[i]),p=(0,T.useCallback)(e=>{n(!1),r({...a,formType:e})},[r,a]),f=(0,T.useCallback)(e=>{r({...a,displayType:e})},[r,a]);if(!o)return null;const m={id:c,form_type:a.formType,editor_url:u};let g=`${d}&data=${btoa(JSON.stringify(m))}`;return["below_posts"].includes(a.formType)&&(g+=`#mailpoet_form_preview_${c}`),(0,Er.jsxs)(Hse.a,{onRequestClose:h,fullScreen:!0,contentClassName:"mailpoet_form_preview_modal",children:[!s&&(0,Er.jsx)("div",{className:"mailpoet_spinner_wrapper",children:(0,Er.jsx)(TC.Ay,{})}),s&&(0,Er.jsxs)("div",{className:"mailpoet_preview_content_wrapper",children:[(0,Er.jsxs)("div",{className:"mailpoet_preview_sidebar",children:[(0,Er.jsx)(oE.A,{label:$ee.U.I18n.t("formPlacementLabel"),value:a.formType,onChange:p,className:"mailpoet_preview_form_type_selection","data-automation-id":"form_type_selection",options:[{value:"others",label:(0,ee.__)("Others (widget)","mailpoet")},{value:"below_posts",label:(0,ee.__)("Below pages","mailpoet")},{value:"fixed_bar",label:(0,ee.__)("Fixed bar","mailpoet")},{value:"popup",label:(0,ee.__)("Pop-up","mailpoet")},{value:"slide_in",label:(0,ee.__)("Slide–in","mailpoet")}]}),(0,Er.jsx)(dke,{activePanel:a.formType})]}),(0,Er.jsx)(Fee.ErrorBoundary,{children:(0,Er.jsxs)(wke,{onDisplayTypeChange:f,selectedDisplayType:a.displayType,children:[!t&&(0,Er.jsx)("div",{className:"mailpoet_spinner_wrapper",children:(0,Er.jsx)(TC.Ay,{})}),(0,Er.jsx)("iframe",{ref:e,className:"mailpoet_form_preview_iframe",src:g,title:$ee.U.I18n.t("formPreview"),onLoad:()=>n(!0),"data-automation-id":"form_preview_iframe",scrolling:"others"===a.formType?"no":"yes"}),"others"===a.formType&&"desktop"===a.displayType&&(0,Er.jsx)("div",{className:"mailpoet_form_preview_disclaimer",children:$ee.U.I18n.t("formPreviewOthersDisclaimer")})]})})]})]})}function Ske({children:e}){const{fontColor:t,backgroundColor:n,gradient:i,fontSize:r,borderRadius:o,borderSize:s,borderColor:a,alignment:l,formPadding:c,backgroundImageUrl:u,backgroundImageDisplay:d,fontFamily:h}=(0,zt.A)(e=>e(Gee).getFormSettings(),[]),p=(0,zt.A)(e=>e(Gee).getPreviewSettings(),[]),f=(0,zt.A)(e=>e(Gee).getFormWidth(p.formType),[p.formType]);let m,g,b;o&&(m=Number(o)),c&&(g=Number(c)),l&&(b=l);const y=[],v={color:t,fontSize:`${r}${Number.isNaN(Number(`${r}`||NaN))?"":"px"}`,fontFamily:h,lineHeight:1.2,borderRadius:m,textAlign:b,padding:g,width:"pixel"===f.unit?f.value:`${f.value}%`,margin:"0 auto",maxWidth:"100%"};if(s&&a&&(v.borderWidth=s,v.borderColor=a,v.borderStyle="solid"),["others","below_posts"].includes(p.formType)&&"percent"===f.unit&&(v.maxWidth=600),void 0!==u&&u){let e="center",t="no-repeat",n="cover";"fit"===d&&(n="auto",e="center top"),"tile"===d&&(t="repeat",n="auto"),y.push(`url(${u}) ${e}/${n} ${t}`)}if(i&&y.push(i),n&&y.push(n),y.length&&(v.background=y.join(", ")),"fixed_bar"===p.formType){const t={width:v.width,margin:"0 auto"};return v.width="max-content",v.minWidth="100%",v.maxWidth="auto",(0,Er.jsx)("div",{className:"mailpoet-form-background",style:v,children:(0,Er.jsx)("div",{style:t,children:e})})}return(0,Er.jsx)("div",{className:"mailpoet-form-background",style:v,children:e})}function Ake(){const e=(0,zt.A)(e=>e(Gee).isFullscreenEnabled(),[]);return(0,T.useEffect)(()=>{e?document.body.classList.add("is-fullscreen-mode"):document.body.classList.remove("is-fullscreen-mode")},[e]),null}function Ike(){const{sidebarOpened:e,isInserterOpened:t,isListViewOpened:n,formBlocks:i,canUserUpload:r,selectedBlock:o}=(0,zt.A)(e=>({sidebarOpened:e(Gee).getSidebarOpened(),isInserterOpened:e(Gee).isInserterOpened(),isListViewOpened:e(Gee).isListViewOpened(),formBlocks:e(Gee).getFormBlocks(),canUserUpload:e("core").canUser("create","media"),selectedBlock:e("core/block-editor").getSelectedBlock()}),[]),s=M()("edit-post-layout interface-interface-skeleton",o?o.name.replace("/","-"):null,{"is-sidebar-opened":e}),{blocksChangedInBlockEditor:a,toggleInserter:l}=(0,Vt.A)(Gee),c=(0,T.useMemo)(()=>({mediaUpload:r?Pee:null,supportsLayout:!1,maxWidth:580,enableCustomSpacing:!0,enableCustomLineHeight:!0,disableCustomFontSizes:!1,__experimentalFetchLinkSuggestions:zee,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__experimentalSetIsInserterOpened:l,__experimentalFeatures:{spacing:{units:["px","em","rem","vh","vw","%"]},useRootPaddingAwareAlignments:!0,color:{custom:!0,text:!0,background:!0,customGradient:!0,defaultPalette:!0,palette:{default:Th.colors},gradients:{default:Th.gradients}},typography:{defaultFontSizes:!0,fontSizes:{default:qee},fontFamilies:{default:[]}}}}),[r,l]);return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(uie,{}),(0,Er.jsx)($T.Ee,{children:(0,Er.jsx)(Sv.Kq,{children:(0,Er.jsx)("div",{className:s,children:(0,Er.jsxs)("div",{className:"interface-interface-skeleton__editor",children:[(0,Er.jsx)("div",{className:"interface-interface-skeleton__header",children:(0,Er.jsx)(Fee.ErrorBoundary,{children:(0,Er.jsx)($se,{isInserterOpened:t,setIsInserterOpened:l})})}),(0,Er.jsx)("div",{className:"interface-interface-skeleton__body",children:(0,Er.jsxs)(wU,{value:i,onChange:a,settings:c,useSubRegistry:!1,children:[t&&(0,Er.jsx)("div",{className:"interface-interface-skeleton__secondary-sidebar",children:(0,Er.jsx)(mke,{setIsInserterOpened:l})}),n&&(0,Er.jsx)("div",{className:"interface-interface-skeleton__secondary-sidebar",children:(0,Er.jsx)(gke,{})}),(0,Er.jsxs)("div",{className:"interface-interface-skeleton__content",children:[(0,Er.jsx)(Fee.ErrorBoundary,{children:(0,Er.jsx)(yke,{})}),(0,Er.jsx)(Dee.O,{storeName:"mailpoet-form-editor"}),(0,Er.jsx)(oq,{className:"edit-post-visual-editor editor-styles-wrapper",children:(0,Er.jsxs)(x4,{children:[(0,Er.jsx)(gU,{}),(0,Er.jsx)(gU.Register,{}),(0,Er.jsx)("div",{className:"mailpoet_form",children:(0,Er.jsx)(dK,{children:(0,Er.jsx)(jq,{children:(0,Er.jsx)(Fee.ErrorBoundary,{children:(0,Er.jsx)(Ske,{children:(0,Er.jsx)(Mq,{renderAppender:!o&&Sq.ButtonBlockAppender})})})})})})]})})]}),e&&(0,Er.jsx)("div",{className:"interface-interface-skeleton__sidebar",children:(0,Er.jsx)(Fee.ErrorBoundary,{children:(0,Er.jsx)(pke,{})})})]})}),(0,Er.jsx)(Fee.ErrorBoundary,{children:(0,Er.jsx)(_ke,{})}),(0,Er.jsx)(Fee.ErrorBoundary,{children:(0,Er.jsx)(Ake,{})})]})})})}),(0,Er.jsx)(Fee.ErrorBoundary,{children:(0,Er.jsx)(Cke,{})}),(0,Er.jsx)(Gse,{})]})}_ke.displayName="FormStyles",wke.propTypes={children:Uee().node.isRequired,onDisplayTypeChange:Uee().func,selectedDisplayType:Uee().string},wke.displayName="FormEditorPreview",Cke.displayName="FormPreviewWrapper",Ske.propTypes={children:Uee().node.isRequired},Ske.displayName="FormStylingBackground",Ake.displayName="Fullscreen";var Eke=[],jke=()=>{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})])}})},Tke=()=>{const{wp:e}=window;return e.media.view.MediaFrame.Select.extend({createStates(){const t=this.options;this.options.states||this.states.add([new e.media.controller.Library({library:e.media.query(t.library),multiple:t.multiple,title:t.title,priority:20,filterable:"uploaded"}),new e.media.controller.EditImage({model:t.editImage})])}})},Bke=()=>{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])}})},Nke=e=>["sizes","mime","type","subtype","id","url","alt","link","caption"].reduce((t,n)=>(e?.hasOwnProperty(n)&&(t[n]=e[n]),t),{}),Rke=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"})},Oke=class extends T.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:i=Eke}=this.props;if(i===this.lastGalleryValue)return;const{wp:r}=window;let o;this.lastGalleryValue=i,this.frame&&this.frame.remove(),o=e?"gallery-library":i&&i.length?"gallery-edit":"gallery",this.GalleryDetailsMediaFrame||(this.GalleryDetailsMediaFrame=Bke());const s=Rke(i),a=new r.media.model.Selection(s.models,{props:s.props.toJSON(),multiple:n});this.frame=new this.GalleryDetailsMediaFrame({mimeType:t,state:o,multiple:n,selection:a,editing:!!i?.length}),r.media.frame=this.frame,this.initializeListeners()}buildAndSetFeatureImageFrame(){const{wp:e}=window,{value:t,multiple:n,allowedTypes:i}=this.props,r=jke(),o=Rke(t),s=new e.media.model.Selection(o.models,{props:o.props.toJSON()});this.frame=new r({mimeType:i,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}}buildAndSetSingleMediaFrame(){const{wp:e}=window,{allowedTypes:t,multiple:n=!1,title:i=(0,ee.__)("Select or Upload Media"),value:r}=this.props,o={title:i,multiple:n};t&&(o.library={type:t}),this.frame&&this.frame.remove();const s=Tke(),a=Rke(r),l=new e.media.model.Selection(a.models,{props:a.props.toJSON()});this.frame=new s({mimeType:t,multiple:n,selection:l,...o}),e.media.frame=this.frame}componentWillUnmount(){this.frame?.remove()}onUpdate(e){const{onSelect:t,multiple:n=!1}=this.props,i=this.frame.state(),r=e||i.get("selection");r&&r.models.length&&t(n?r.models.map(e=>Nke(e.toJSON())):Nke(r.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,i=this.frame.state().get("selection"),r=Array.isArray(t)?t:[t];n||r.forEach(t=>{i.add(e.media.attachment(t))});const o=Rke(r);o.more().done(function(){n&&o?.models?.length&&i.add(o.models)})}onClose(){const{onClose:e}=this.props;e&&e(),this.frame.detach()}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{gallery:e=!1,unstableFeaturedImageFlow:t=!1,modalClass:n}=this.props;e?this.buildAndSetGalleryFrame():this.buildAndSetSingleMediaFrame(),n&&this.frame.$el.addClass(n),t&&this.buildAndSetFeatureImageFrame(),this.initializeListeners(),this.frame.open()}render(){return this.props.render({open:this.openModal})}},Lke=Oke,Mke=n(76556),Pke="core/bold",Dke=(0,ee.__)("Bold"),Fke={name:Pke,title:Dke,tagName:"strong",className:null,edit({isActive:e,value:t,onChange:n,onFocus:i,isVisible:r=!0}){function o(){n(ht(t,{type:Pke,title:Dke}))}return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(a1,{type:"primary",character:"b",onUse:o}),r&&(0,Er.jsx)(c1,{name:"bold",icon:Mke.A,title:Dke,onClick:function(){n(ht(t,{type:Pke})),i()},isActive:e,shortcutType:"primary",shortcutCharacter:"b"}),(0,Er.jsx)(u1,{inputType:"formatBold",onInput:o})]})}},zke=n(93250),Vke="core/code",Uke=(0,ee.__)("Inline code"),$ke={name:Vke,title:Uke,tagName:"code",className:null,__unstableInputRule(e){const{start:t,text:n}=e;if("`"!==n[t-1])return e;if(t-2<0)return e;const i=n.lastIndexOf("`",t-2);if(-1===i)return e;const r=i,o=t-2;return r===o?e:(e=at(e,r,r+1),e=_e(e=at(e,o,o+1),{type:Vke},r,o))},edit({value:e,onChange:t,onFocus:n,isActive:i}){function r(){t(ht(e,{type:Vke,title:Uke})),n()}return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(a1,{type:"access",character:"x",onUse:r}),(0,Er.jsx)(c1,{icon:zke.A,title:Uke,onClick:r,isActive:i,role:"menuitemcheckbox"})]})}},Hke=["image"],Wke="core/image",Gke=(0,ee.__)("Inline image");function qke(e){if(!e?.className)return;const[,t]=e.className.match(/wp-image-(\d+)/)??[];return t?parseInt(t,10):void 0}var Kke={name:Wke,title:Gke,keywords:[(0,ee.__)("photo"),(0,ee.__)("media")],object:!0,tagName:"img",className:null,attributes:{className:"class",style:"style",url:"src",alt:"alt"},edit:function({value:e,onChange:t,onFocus:n,isObjectActive:i,activeObjectAttributes:r,contentRef:o}){return(0,Er.jsxs)(xS,{children:[(0,Er.jsx)(_S,{allowedTypes:Hke,value:qke(r),onSelect:({id:i,url:r,alt:o,width:s})=>{t(lt(e,{type:Wke,attributes:{className:`wp-image-${i}`,style:`width: ${Math.min(s,150)}px;`,url:r,alt:o}})),n()},render:({open:e})=>(0,Er.jsx)(c1,{icon:(0,Er.jsx)(AC.t4,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Er.jsx)(AC.wA,{d:"M4 18.5h16V17H4v1.5zM16 13v1.5h4V13h-4zM5.1 15h7.8c.6 0 1.1-.5 1.1-1.1V6.1c0-.6-.5-1.1-1.1-1.1H5.1C4.5 5 4 5.5 4 6.1v7.8c0 .6.5 1.1 1.1 1.1zm.4-8.5h7V10l-1-1c-.3-.3-.8-.3-1 0l-1.6 1.5-1.2-.7c-.3-.2-.6-.2-.9 0l-1.3 1V6.5zm0 6.1l1.8-1.3 1.3.8c.3.2.7.2.9-.1l1.5-1.4 1.5 1.4v1.5h-7v-.9z"})}),title:i?(0,ee.__)("Replace image"):Gke,onClick:e,isActive:i})}),i&&(0,Er.jsx)(Yke,{value:e,onChange:t,activeObjectAttributes:r,contentRef:o})]})}};function Yke({value:e,onChange:t,activeObjectAttributes:n,contentRef:i}){const{style:r,alt:o}=n,s=r?.replace(/\D/g,""),[a,l]=(0,T.useState)(s),[c,u]=(0,T.useState)(o),d=a!==s||c!==o,h=Zt({editableContentElement:i.current,settings:Kke});return(0,Er.jsx)(uw.Ay,{focusOnMount:!1,anchor:h,className:"block-editor-format-toolbar__image-popover",children:(0,Er.jsx)("form",{className:"block-editor-format-toolbar__image-container-content",onSubmit:i=>{const r=e.replacements.slice();r[e.start]={type:Wke,attributes:{...n,style:a?`width: ${a}px;`:"",alt:c}},t({...e,replacements:r}),i.preventDefault()},children:(0,Er.jsxs)(Q_.A,{spacing:4,children:[(0,Er.jsx)(ox.A,{__next40pxDefaultSize:!0,label:(0,ee.__)("Width"),value:a,min:1,onChange:e=>{l(e)}}),(0,Er.jsx)(TF.A,{label:(0,ee.__)("Alternative text"),value:c,onChange:e=>{u(e)},help:(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(OA.A,{href:(0,ee.__)("https://www.w3.org/WAI/tutorials/images/decision-tree/"),children:(0,ee.__)("Describe the purpose of the image.")}),(0,Er.jsx)("br",{}),(0,ee.__)("Leave empty if decorative.")]})}),(0,Er.jsx)(Cw.A,{justify:"right",children:(0,Er.jsx)(fv.Ay,{disabled:!d,accessibleWhenDisabled:!0,variant:"primary",type:"submit",size:"compact",children:(0,ee.__)("Apply")})})]})})})}var Jke=n(90345),Xke="core/italic",Zke=(0,ee.__)("Italic"),Qke={name:Xke,title:Zke,tagName:"em",className:null,edit({isActive:e,value:t,onChange:n,onFocus:i,isVisible:r=!0}){function o(){n(ht(t,{type:Xke,title:Zke}))}return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(a1,{type:"primary",character:"i",onUse:o}),r&&(0,Er.jsx)(c1,{name:"italic",icon:Jke.A,title:Zke,onClick:function(){n(ht(t,{type:Xke})),i()},isActive:e,shortcutType:"primary",shortcutCharacter:"i"}),(0,Er.jsx)(u1,{inputType:"formatItalic",onInput:o})]})}},ewe=n(4376),twe=n(86026),nwe=n(20449),iwe=n(20938),rwe=n(24478),owe=n(65300),swe=n(64765),awe=n(80350);function lwe(e){if(!e)return!1;const t=e.trim();if(!t)return!1;if(/^\S+:/.test(t)){const e=(0,kA.J)(t);if(!(0,wA.v)(e))return!1;if(e.startsWith("http")&&!/^https?:\/\/[^\/\s]/i.test(t))return!1;const n=(0,nwe.M)(t);if(!(0,iwe.W)(n))return!1;const i=(0,sA.Y)(t);if(i&&!(0,rwe.o)(i))return!1;const r=(0,owe.e)(t);if(r&&!(0,swe._)(r))return!1;const o=(0,awe.h)(t);if(o&&!(0,xA.R)(o))return!1}return!(t.startsWith("#")&&!(0,xA.R)(t))}function cwe(e,t,n=e.start,i=e.end){const r={start:void 0,end:void 0},{formats:o}=e;let s,a;if(!o?.length)return r;const l=o.slice(),c=l[n]?.find(({type:e})=>e===t.type),u=l[i]?.find(({type:e})=>e===t.type),d=l[i-1]?.find(({type:e})=>e===t.type);if(c)s=c,a=n;else if(u)s=u,a=i;else{if(!d)return r;s=d,a=i-1}const h=l[a].indexOf(s),p=[l,a,s,h];return{start:n=(n=hwe(...p))<0?0:n,end:(i=pwe(...p))+1}}function uwe(e,t,n,i,r){let o=t;const s={forwards:1,backwards:-1}[r]||1,a=-1*s;for(;e[o]&&e[o][i]===n;)o+=s;return o+=a,o}var dwe=(e,...t)=>(...n)=>e(...n,...t),hwe=dwe(uwe,"backwards"),pwe=dwe(uwe,"forwards"),fwe=({setting:e,value:t,onChange:n})=>{const i=!!t&&t?.cssClasses?.length>0,[r,o]=(0,T.useState)(i),s=`css-classes-setting-${(0,SS.A)(fwe)}`,a=i=>{const r="string"==typeof i?i.replace(/,/g," ").replace(/\s+/g," ").trim():i;n({...t,[e.id]:r})};return(0,Er.jsxs)("fieldset",{children:[(0,Er.jsx)(kC.A,{as:"legend",children:e.title}),(0,Er.jsxs)(Q_.A,{spacing:3,children:[(0,Er.jsx)(WA.A,{label:e.title,onChange:()=>{r?(i&&a(""),o(!1)):o(!0)},checked:r||i,"aria-expanded":r,"aria-controls":r?s:void 0}),r&&(0,Er.jsx)("div",{id:s,children:(0,Er.jsx)(PS.Ay,{label:(0,ee.__)("CSS classes"),value:t?.cssClasses,onChange:a,help:(0,ee.__)("Separate multiple classes with spaces."),__unstableInputWidth:"100%",__next40pxDefaultSize:!0})})]})]})},mwe=fwe,gwe=[...tI.DEFAULT_LINK_SETTINGS,{id:"nofollow",title:(0,ee.__)("Mark as nofollow")},{id:"cssClasses",title:(0,ee.__)("Additional CSS class(es)"),render:(e,t,n)=>(0,Er.jsx)(mwe,{setting:e,value:t,onChange:n})}],bwe=function({isActive:e,activeAttributes:t,value:n,onChange:i,onFocusOutside:r,stopAddingLink:o,contentRef:s,focusOnMount:a}){const l=function(e,t){let n=e.start,i=e.end;if(t){const t=cwe(e,{type:"core/link"});n=t.start,i=t.end}return ct(e,n,i)}(n,e),c=l.text,{selectionChange:u}=(0,Vt.A)(Qy),{createPageEntity:d,userCanCreatePages:h,selectionStart:p}=(0,zt.A)(e=>{const{getSettings:t,getSelectionStart:n}=e(Qy),i=t();return{createPageEntity:i.__experimentalCreatePageEntity,userCanCreatePages:i.__experimentalUserCanCreatePages,selectionStart:n()}},[]),f=(0,T.useMemo)(()=>({url:t.url,type:t.type,id:t.id,opensInNewTab:"_blank"===t.target,nofollow:t.rel?.includes("nofollow"),title:c,cssClasses:t.class}),[t.class,t.id,t.rel,t.target,t.type,t.url,c]),m=Zt({editableContentElement:s.current,settings:{..._we,isActive:e}});return(0,Er.jsx)(uw.Ay,{anchor:m,animate:!1,onClose:o,onFocusOutside:r,placement:"bottom",offset:8,shift:!0,focusOnMount:a,constrainTabbing:!0,children:(0,Er.jsx)(tI,{value:f,onChange:function(t){const r=f?.url,s=!r;t={...f,...t};const a=(0,jS.i)(t.url),l=function({url:e,type:t,id:n,opensInNewWindow:i,nofollow:r,cssClasses:o}){const s={type:"core/link",attributes:{url:e}};t&&(s.attributes.type=t),n&&(s.attributes.id=n),i&&(s.attributes.target="_blank",s.attributes.rel=s.attributes.rel?s.attributes.rel+" noreferrer noopener":"noreferrer noopener"),r&&(s.attributes.rel=s.attributes.rel?s.attributes.rel+" nofollow":"nofollow");const a=o?.trim();return a?.length&&(s.attributes.class=a),s}({url:a,type:t.type,id:void 0!==t.id&&null!==t.id?String(t.id):void 0,opensInNewWindow:t.opensInNewTab,nofollow:t.nofollow,cssClasses:t.cssClasses}),d=t.title||a;let h;if(et(n)&&!e)return h=_e(st(n,d),l,n.start,n.start+d.length),i(h),o(),void u({clientId:p.clientId,identifier:p.attributeKey,start:n.start+d.length+1});if(d===c){const e=cwe(n,{type:"core/link"});h=_e(n,l,e.start,e.end)}else{h=We({text:d}),h=_e(h,l,0,d.length);const e=cwe(n,{type:"core/link"}),[t,i]=ut(n,e.start,e.start),r=function({formats:e,replacements:t,text:n,start:i,end:r},o,s){return n=n.replace(o,(n,...o)=>{const a=o[o.length-2];let l,c,u=s;return"function"==typeof u&&(u=s(n,...o)),"object"==typeof u?(l=u.formats,c=u.replacements,u=u.text):(l=Array(u.length),c=Array(u.length),e[a]&&(l=l.fill(e[a]))),e=e.slice(0,a).concat(l,e.slice(a+n.length)),t=t.slice(0,a).concat(c,t.slice(a+n.length)),i&&(i=r=a+u.length),u}),ye({formats:e,replacements:t,text:n,start:i,end:r})}(i,c,h);h=function(...e){return ye(e.reduce(Ze,We()))}(t,r)}i(h),s||o(),lwe(a)?e?(0,dt.L)((0,ee.__)("Link edited."),"assertive"):(0,dt.L)((0,ee.__)("Link inserted."),"assertive"):(0,dt.L)((0,ee.__)("Warning: the link has been inserted but may have errors. Please test it."),"assertive")},onRemove:function(){const e=rt(n,"core/link");i(e),o(),(0,dt.L)((0,ee.__)("Link removed."),"assertive")},hasRichPreviews:!0,createSuggestion:d&&async function(e){const t=await d({title:e,status:"draft"});return{id:t.id,type:t.type,title:t.title.rendered,url:t.link,kind:"post-type"}},withCreateSuggestion:h,createSuggestionButtonText:function(e){return(0,qS.A)((0,ee.sprintf)((0,ee.__)("Create page: <mark>%s</mark>"),e),{mark:(0,Er.jsx)("mark",{})})},hasTextControl:!0,settings:gwe,showInitialSuggestions:!0,suggestionsQuery:{initialSuggestionsSearchOptions:{type:"post",subtype:"page",perPage:20}}})})},ywe="core/link",vwe=(0,ee.__)("Link"),_we={name:ywe,title:vwe,tagName:"a",className:null,attributes:{url:"href",type:"data-type",id:"data-id",_id:"id",target:"target",rel:"rel",class:"class"},__unstablePasteRule(e,{html:t,plainText:n}){const i=(t||n).replace(/<[^>]+>/g,"").trim();if(!(0,TS.m)(i)||!/^https?:/.test(i))return e;window.console.log("Created link:\n\n",i);const r={type:ywe,attributes:{url:(0,qr.S)(i)}};return et(e)?st(e,_e(We({text:n}),r,0,n.length)):_e(e,r)},edit:function({isActive:e,activeAttributes:t,value:n,onChange:i,onFocus:r,contentRef:o,isVisible:s=!0}){const[a,l]=(0,T.useState)(!1),[c,u]=(0,T.useState)(null);function d(t){const r=Ve(ct(n));!e&&r&&(0,TS.m)(r)&&lwe(r)?i(_e(n,{type:ywe,attributes:{url:r}})):!e&&r&&(0,ewe.x)(r)?i(_e(n,{type:ywe,attributes:{url:`mailto:${r}`}})):!e&&r&&(0,twe.I)(r)?i(_e(n,{type:ywe,attributes:{url:`tel:${r.replace(/\D/g,"")}`}})):(t&&u({el:t,action:null}),l(!0))}(0,T.useEffect)(()=>{e||l(!1)},[e]),(0,T.useLayoutEffect)(()=>{const t=o.current;if(t)return t.addEventListener("click",n),()=>{t.removeEventListener("click",n)};function n(t){const n=t.target.closest("[contenteditable] a");n&&e&&(l(!0),u({el:n,action:"click"}))}},[o,e]);const h=!("A"===c?.el?.tagName&&"click"===c?.action),p=!et(n);return(0,Er.jsxs)(Er.Fragment,{children:[p&&(0,Er.jsx)(a1,{type:"primary",character:"k",onUse:d}),(0,Er.jsx)(a1,{type:"primaryShift",character:"k",onUse:function(){i(rt(n,ywe)),(0,dt.L)((0,ee.__)("Link removed."),"assertive")}}),s&&(0,Er.jsx)(c1,{name:"link",icon:fB.A,title:e?(0,ee.__)("Link"):vwe,onClick:e=>{d(e.currentTarget)},isActive:e||a,shortcutType:"primary",shortcutCharacter:"k","aria-haspopup":"true","aria-expanded":a}),s&&a&&(0,Er.jsx)(bwe,{stopAddingLink:function(){l(!1),"BUTTON"===c?.el?.tagName?c.el.focus():r(),u(null)},onFocusOutside:function(){l(!1),u(null)},isActive:e,activeAttributes:t,value:n,onChange:i,contentRef:o,focusOnMount:!!h&&"firstElement"})]})}},xwe="core/strikethrough",kwe=(0,ee.__)("Strikethrough"),wwe={name:xwe,title:kwe,tagName:"s",className:null,edit({isActive:e,value:t,onChange:n,onFocus:i}){function r(){n(ht(t,{type:xwe,title:kwe})),i()}return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(a1,{type:"access",character:"d",onUse:r}),(0,Er.jsx)(c1,{icon:TL.A,title:kwe,onClick:r,isActive:e,role:"menuitemcheckbox"})]})}},Cwe="core/underline",Swe=(0,ee.__)("Underline"),Awe={name:Cwe,title:Swe,tagName:"span",className:null,attributes:{style:"style"},edit({value:e,onChange:t}){const n=()=>{t(ht(e,{type:Cwe,attributes:{style:"text-decoration: underline;"},title:Swe}))};return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(a1,{type:"primary",character:"u",onUse:n}),(0,Er.jsx)(u1,{inputType:"formatUnderline",onInput:n})]})}},Iwe=n(56666),Ewe=n(46142),{lock:jwe,unlock:Twe}=(0,pt.yf)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/format-library"),{Tabs:Bwe}=Twe(Ev.j),Nwe=[{name:"color",title:(0,ee.__)("Text")},{name:"backgroundColor",title:(0,ee.__)("Background")}];function Rwe(e=""){return e.split(";").reduce((e,t)=>{if(t){const[n,i]=t.split(":");"color"===n&&(e.color=i),"background-color"===n&&i!==Dwe&&(e.backgroundColor=i)}return e},{})}function Owe(e="",t){return e.split(" ").reduce((e,n)=>{if(n.startsWith("has-")&&n.endsWith("-color")){const i=n.replace(/^has-/,"").replace(/-color$/,""),r=LB(t,i);e.color=r.color}return e},{})}function Lwe(e,t,n){const i=Qe(e,t);return i?{...Rwe(i.attributes.style),...Owe(i.attributes.class,n)}:{}}function Mwe({name:e,property:t,value:n,onChange:i}){const r=(0,zt.A)(e=>{const{getSettings:t}=e(Qy);return t().colors??[]},[]),o=(0,T.useMemo)(()=>Lwe(n,e,r),[e,n,r]);return(0,Er.jsx)(r0,{value:o[t],onChange:o=>{i(function(e,t,n,i){const{color:r,backgroundColor:o}={...Lwe(e,t,n),...i};if(!r&&!o)return rt(e,t);const s=[],a=[],l={};if(o?s.push(["background-color",o].join(":")):s.push(["background-color",Dwe].join(":")),r){const e=((e,t)=>e?.find(e=>e.color===t))(n,r);e?a.push(MB("color",e.slug)):s.push(["color",r].join(":"))}return s.length&&(l.style=s.join(";")),a.length&&(l.class=a.join(" ")),_e(e,{type:t,attributes:l})}(n,e,r,{[t]:o}))},enableAlpha:!0,__experimentalIsRenderedInSidebar:!0})}function Pwe({name:e,value:t,onChange:n,onClose:i,contentRef:r,isActive:o}){const s=Zt({editableContentElement:r.current,settings:{...$we,isActive:o}});return(0,Er.jsx)(uw.Ay,{onClose:i,className:"format-library__inline-color-popover",anchor:s,children:(0,Er.jsxs)(Bwe,{children:[(0,Er.jsx)(Bwe.TabList,{children:Nwe.map(e=>(0,Er.jsx)(Bwe.Tab,{tabId:e.name,children:e.title},e.name))}),Nwe.map(i=>(0,Er.jsx)(Bwe.TabPanel,{tabId:i.name,focusable:!1,children:(0,Er.jsx)(Mwe,{name:e,property:i.name,value:t,onChange:n})},i.name))]})})}var Dwe="rgba(0, 0, 0, 0)",Fwe="core/text-color",zwe=(0,ee.__)("Highlight"),Vwe=[];function Uwe(e,t){const{ownerDocument:n}=e,{defaultView:i}=n,r=i.getComputedStyle(e).getPropertyValue(t);return"background-color"===t&&r===Dwe&&e.parentElement?Uwe(e.parentElement,t):r}var $we={name:Fwe,title:zwe,tagName:"mark",className:"has-inline-color",attributes:{style:"style",class:"class"},edit:function({value:e,onChange:t,isActive:n,activeAttributes:i,contentRef:r}){const[o,s=Vwe]=tv("color.custom","color.palette"),[a,l]=(0,T.useState)(!1),c=(0,T.useMemo)(()=>function(e,{color:t,backgroundColor:n}){if(t||n)return{color:t||Uwe(e,"color"),backgroundColor:n===Dwe?Uwe(e,"background-color"):n}}(r.current,Lwe(e,Fwe,s)),[r,e,s]),u=!!s.length||o;return u||n?(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(c1,{className:"format-library-text-color-button",isActive:n,icon:(0,Er.jsx)(xx.A,{icon:Object.keys(i).length?Iwe.A:Ewe.A,style:c}),title:zwe,onClick:u?()=>l(!0):()=>t(rt(e,Fwe)),role:"menuitemcheckbox"}),a&&(0,Er.jsx)(Pwe,{name:Fwe,onClose:()=>l(!1),activeAttributes:i,value:e,onChange:t,contentRef:r,isActive:n})]}):null}},Hwe=n(97248),Wwe="core/subscript",Gwe=(0,ee.__)("Subscript"),qwe={name:Wwe,title:Gwe,tagName:"sub",className:null,edit:({isActive:e,value:t,onChange:n,onFocus:i})=>(0,Er.jsx)(c1,{icon:Hwe.A,title:Gwe,onClick:function(){n(ht(t,{type:Wwe,title:Gwe})),i()},isActive:e,role:"menuitemcheckbox"})},Kwe=n(60483),Ywe="core/superscript",Jwe=(0,ee.__)("Superscript"),Xwe={name:Ywe,title:Jwe,tagName:"sup",className:null,edit:({isActive:e,value:t,onChange:n,onFocus:i})=>(0,Er.jsx)(c1,{icon:Kwe.A,title:Jwe,onClick:function(){n(ht(t,{type:Ywe,title:Jwe})),i()},isActive:e,role:"menuitemcheckbox"})},Zwe=n(89629),Qwe="core/keyboard",eCe=(0,ee.__)("Keyboard input"),tCe={name:Qwe,title:eCe,tagName:"kbd",className:null,edit:({isActive:e,value:t,onChange:n,onFocus:i})=>(0,Er.jsx)(c1,{icon:Zwe.A,title:eCe,onClick:function(){n(ht(t,{type:Qwe,title:eCe})),i()},isActive:e,role:"menuitemcheckbox"})},nCe=n(66880),iCe="core/unknown",rCe=(0,ee.__)("Clear Unknown Formatting"),oCe={name:iCe,title:rCe,tagName:"*",className:null,edit:({isActive:e,value:t,onChange:n,onFocus:i})=>e||function(e){return!et(e)&&ct(e).formats.some(e=>e.some(e=>e.type===iCe))}(t)?(0,Er.jsx)(c1,{name:"unknown",icon:nCe.A,title:rCe,onClick:function(){n(rt(t,iCe)),i()},isActive:!0}):null},sCe=n(18231),aCe="core/language",lCe=(0,ee.__)("Language"),cCe={name:aCe,title:lCe,tagName:"bdo",className:null,attributes:{lang:"lang",dir:"dir"},edit:function({isActive:e,value:t,onChange:n,contentRef:i}){const[r,o]=(0,T.useState)(!1),s=()=>{o(e=>!e)};return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(c1,{icon:sCe.A,label:lCe,title:lCe,onClick:()=>{e?n(rt(t,aCe)):s()},isActive:e,role:"menuitemcheckbox"}),r&&(0,Er.jsx)(uCe,{value:t,onChange:n,onClose:s,contentRef:i})]})}};function uCe({value:e,contentRef:t,onChange:n,onClose:i}){const r=Zt({editableContentElement:t.current,settings:cCe}),[o,s]=(0,T.useState)(""),[a,l]=(0,T.useState)("ltr");return(0,Er.jsx)(uw.Ay,{className:"block-editor-format-toolbar__language-popover",anchor:r,onClose:i,children:(0,Er.jsxs)(Q_.A,{as:"form",spacing:4,className:"block-editor-format-toolbar__language-container-content",onSubmit:t=>{t.preventDefault(),n(_e(e,{type:aCe,attributes:{lang:o,dir:a}})),i()},children:[(0,Er.jsx)(kS.A,{__next40pxDefaultSize:!0,label:lCe,value:o,onChange:e=>s(e),help:(0,ee.__)('A valid language attribute, like "en" or "fr".')}),(0,Er.jsx)(oE.A,{__next40pxDefaultSize:!0,label:(0,ee.__)("Text direction"),value:a,options:[{label:(0,ee.__)("Left to right"),value:"ltr"},{label:(0,ee.__)("Right to left"),value:"rtl"}],onChange:e=>l(e)}),(0,Er.jsx)(Cw.A,{alignment:"right",children:(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",text:(0,ee.__)("Apply")})})]})})}var dCe=n(12483),{Badge:hCe}=Twe(Ev.j),pCe="core/math",fCe=(0,ee.__)("Math");function mCe({value:e,onChange:t,activeAttributes:n,contentRef:i,latexToMathML:r}){const[o,s]=(0,T.useState)(n?.["data-latex"]||""),[a,l]=(0,T.useState)(null),c=Zt({editableContentElement:i.current,settings:gCe});return(0,Er.jsx)(uw.Ay,{placement:"bottom-start",offset:8,focusOnMount:!1,anchor:c,className:"block-editor-format-toolbar__math-popover",children:(0,Er.jsx)("div",{style:{minWidth:"300px",padding:"4px"},children:(0,Er.jsxs)(Q_.A,{spacing:1,children:[(0,Er.jsx)(kS.A,{__next40pxDefaultSize:!0,hideLabelFromVision:!0,label:(0,ee.__)("LaTeX math syntax"),value:o,onChange:n=>{let i="";if(s(n),n)try{i=r(n,{displayMode:!1}),l(null)}catch(e){return l(e.message),void(0,dt.L)((0,ee.sprintf)((0,ee.__)("Error parsing mathematical expression: %s"),e.message))}const o=e.replacements.slice();o[e.start]={type:pCe,attributes:{"data-latex":n},innerHTML:i},t({...e,replacements:o})},placeholder:(0,ee.__)("e.g., x^2, \\frac{a}{b}"),autoComplete:"off",className:"block-editor-format-toolbar__math-input"}),a&&(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(hCe,{intent:"error",className:"wp-block-math__error",children:(0,ee.sprintf)((0,ee.__)("Error: %s"),a)}),(0,Er.jsx)("style",{children:".wp-block-math__error .components-badge__content{white-space:normal}"})]})]})})})}var gCe={name:pCe,title:fCe,tagName:"math",className:null,attributes:{"data-latex":"data-latex"},contentEditable:!1,edit:function({value:e,onChange:t,onFocus:i,isObjectActive:r,activeObjectAttributes:o,contentRef:s}){const[a,l]=(0,T.useState)();return(0,T.useEffect)(()=>{n.e(223).then(n.bind(n,25456)).then(e=>{l(()=>e.default)})},[]),(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(c1,{icon:dCe.A,title:fCe,onClick:()=>{const n=lt(e,{type:pCe,attributes:{"data-latex":""},innerHTML:""});n.start=n.end-1,t(n),i()},isActive:r}),r&&(0,Er.jsx)(mCe,{value:e,onChange:t,activeAttributes:o,contentRef:s,latexToMathML:a})]})}},bCe={name:"core/non-breaking-space",title:(0,ee.__)("Non breaking space"),tagName:"nbsp",className:null,edit:({value:e,onChange:t})=>(0,Er.jsx)(a1,{type:"primaryShift",character:" ",onUse:function(){t(st(e," "))}})};[Fke,$ke,Kke,Qke,_we,wwe,Awe,$we,qwe,Xwe,tCe,oCe,cCe,gCe,bCe].forEach(({name:e,...t})=>it(e,t));const yCe="mailpoet-form/font-selection",vCe=["core/paragraph","core/heading"],_Ce={name:yCe,title:"Font Selection",tagName:"span",className:"mailpoet-has-font",interactive:!1,attributes:{style:"style",font:"data-font"},edit:function({value:e,onChange:t,activeAttributes:n}){const i=(0,zt.A)(e=>e("core/block-editor").getSelectedBlock(),[]);return vCe.includes(i.name)?(0,Er.jsx)(Lv,{children:(0,Er.jsx)("div",{className:"mailpoet_toolbar_item",children:(0,Er.jsx)(cie,{value:n.font,onChange:n=>{t(_e(e,{type:"mailpoet-form/font-selection",attributes:{style:`font-family: ${n}`,font:n}}))},name:$ee.U.I18n.t("formSettingsStylesFontFamily"),hideLabelFromVision:!0})})}):null}};var xCe=n(7352),kCe=n(8720),wCe=n(25249),CCe=n(25354),SCe=n(14442);const ACe="mailpoet-form-editor-templates";var ICe=n(4686);function ECe(){const e=[{name:"popup",label:(0,ee._x)("Pop-up","This is a text on a widget that leads to settings for form placement - form type is pop-up, it will be displayed on page in a small modal window","mailpoet")},{name:"slide_in",label:(0,ee._x)("Slide–in","This is a text on a widget that leads to settings for form placement - form type is slide in","mailpoet")},{name:"fixed_bar",label:(0,ee._x)("Fixed bar","This is a text on a widget that leads to settings for form placement - form type is fixed bar","mailpoet")},{name:"below_posts",label:(0,ee._x)("Below pages","This is a text on a widget that leads to settings for form placement","mailpoet")},{name:"others",label:(0,ee._x)("Others (widget)","Placement of the form using theme widget","mailpoet")}],t=(0,zt.A)(e=>e(ACe).getSelectedCategory(),[]),n=(0,zt.A)(e=>e(ACe).getTemplates(),[]),i=(0,zt.A)(e=>e(ACe).getLoading(),[]),r=(0,zt.A)(e=>e(ACe).getSelectTemplateFailed(),[]),{selectTemplate:o,selectCategory:s}=(0,Vt.A)(ACe);return(0,Er.jsxs)(Er.Fragment,{children:[e.map(e=>n[e.name].map((e,t)=>t<4&&(0,Er.jsx)("link",{rel:"preload",href:e.thumbnail,as:"image"},`thumbnail_prefetch_${e.id}`))),(0,Er.jsx)(CCe.x,{}),r&&(0,Er.jsx)(SCe.$,{type:"error",scroll:!0,renderInPlace:!0,children:(0,Er.jsx)("p",{children:(0,ee.__)("Sorry, there was an error, please try again later.","mailpoet")})}),(0,Er.jsx)("div",{"data-automation-id":"template_selection_list",children:(0,Er.jsxs)("div",{className:"mailpoet-form-templates",children:[(0,Er.jsx)(ICe.z,{heading:(0,ee.__)("Start with a template","mailpoet"),headingPrefix:(0,Er.jsx)(ICe.o,{href:"?page=mailpoet-forms",label:(0,ee.__)("Back to forms list","mailpoet")}),children:(0,Er.jsx)("button",{"data-automation-id":"create_blank_form",className:"page-title-action",onClick:()=>{o("initial_form","Blank template")},type:"button",children:(0,ee.__)("Or, create custom form","mailpoet")})}),(0,Er.jsx)(xCe.L,{categories:e,active:t,onSelect:s}),n[t].map(e=>(0,Er.jsx)(wCe.c,{onSelect:()=>{o(e.id,e.name)},label:e.name,automationId:`select_template_${e.id}`,className:"mailpoet-form-template",children:(0,Er.jsx)("div",{className:"mailpoet-template-thumbnail",children:(0,Er.jsx)("img",{src:e.thumbnail,alt:e.name,width:"480",height:"317",loading:"lazy"})})},e.id)),(0,Er.jsxs)("div",{className:"mailpoet-form-template-selection-footer",children:[(0,Er.jsx)("p",{children:(0,ee.__)("Can’t find a template that suits your needs?","mailpoet")}),(0,Er.jsx)(fv.Ay,{variant:"link",onClick:()=>{o("initial_form","Blank template")},children:(0,ee.__)("Start with a blank form","mailpoet")})]})]})}),i&&(0,Er.jsx)(kCe.R,{})]})}const jCe={getTemplates:e=>e.templates,getFormEditorUrl:e=>e.formEditorUrl,getSelectTemplateFailed:e=>e.selectTemplateFailed,getLoading:e=>e.loading,getSelectedCategory:e=>e.activeCategory},TCe=e=>(t=e,n)=>{switch(n.type){case"SELECT_TEMPLATE_ERROR":return(e=>({...e,selectTemplateFailed:!0,loading:!1}))(t);case"SELECT_TEMPLATE_START":return(e=>({...e,selectTemplateFailed:!1,loading:!0}))(t);case"SELECT_CATEGORY":return((e,t)=>({...e,activeCategory:t.category}))(t,n);default:return t}};function*BCe(e,t){yield{type:"SELECT_TEMPLATE_START"},yield{type:"TRACK_EVENT",name:"Forms > Template selected",data:{"Template id":e,"Template name":t},timeout:200};const n=(0,xe.L)(ACe).getFormEditorUrl();return window.location.href=`${n}${e}`,{}}function NCe(e){return{type:"SELECT_CATEGORY",category:e}}var RCe=n(27123);let OCe=function(e){return e.Popup="popup",e.SlideIn="slide_in",e.FixedBar="fixed_bar",e.BelowPosts="below_posts",e.Others="others",e}({});function LCe(){return(0,Er.jsx)(R.F.Provider,{value:(0,R.f)(window),children:(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(O.q,{}),(0,Er.jsx)(ECe,{})]})})}const MCe=document.querySelector("#mailpoet_form_edit_templates");function PCe(){return(0,Er.jsx)(R.F.Provider,{value:(0,R.f)(window),children:(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(O.q,{}),(0,Er.jsx)(Ike,{})]})})}MCe&&((0,Fee.registerTranslations)(),(()=>{const e={templates:window.mailpoet_templates,formEditorUrl:window.mailpoet_form_edit_url,selectTemplateFailed:!1,loading:!1,activeCategory:OCe.Popup},t={selectors:jCe,actions:E,controls:j,reducer:TCe(e),resolvers:{}},n=(0,P.A)(ACe,t);(0,D.register)(n)})(),(0,B.H)(MCe).render((0,Er.jsx)(T.StrictMode,{children:(0,Er.jsx)(LCe,{})}))),window.addEventListener("DOMContentLoaded",()=>{const e=document.querySelector("#mailpoet_form_edit");if(e){const t=(0,B.H)(e);N.default.use(N.default.createRootURLMiddleware(window.wpApiSettings.root)),N.default.use(N.default.createNonceMiddleware(window.wpApiSettings.nonce)),(0,Ei.U2)("editor.MediaUpload","mailpoet/form-editor/replace-media-upload",()=>Lke),(()=>{const e=window.mailpoet_custom_fields.map(e=>({...e,params:e.params||{}})),t=Kne(qee,Th.colors,Th.gradients,e),n={...window.mailpoet_form_data},i=t(n.body);delete n.body;const r={dateTypes:window.mailpoet_date_types,dateFormats:window.mailpoet_date_formats,months:window.mailpoet_month_names};n.settings.segments=n.settings.segments?n.settings.segments:[];let o,s=null;if(null!==n.id)try{s=JSON.parse(window.localStorage.getItem(`mailpoet_form_preview_settings${n.id}`)),"below_post"===s.formType&&(s.formType="below_posts")}catch(e){}try{o=JSON.parse(window.localStorage.getItem("mailpoet_form_view_options"))}catch(e){o=!1}const a={editorHistory:[],editorHistoryOffset:0,formBlocks:i,formData:Fse(n),dateSettingData:r,sidebarOpened:!0,formExports:window.mailpoet_form_exports,formErrors:Vte(n,i),segments:window.mailpoet_form_segments,customFields:e,isFormSaving:!1,isCustomFieldSaving:!1,isCustomFieldCreating:!1,isPreviewShown:!1,isPreviewReady:!1,isCustomFieldDeleting:!1,inserterPanel:null,isListViewOpened:!1,notices:[],hasUnsavedChanges:!1,sidebar:{activeSidebar:"default",activeTab:"form",openedPanels:["basic-settings"]},previewSettings:s,fullscreenStatus:o,editorUrl:window.location.href,formEditorUrl:window.mailpoet_form_edit_url,previewPageUrl:window.mailpoet_form_preview_page,closeIconsUrl:window.mailpoet_close_icons_url,customFonts:window.mailpoet_custom_fonts,allWpPosts:window.mailpoet_all_wp_posts,allWpPages:window.mailpoet_all_wp_pages,allWpCategories:window.mailpoet_all_wp_categories,allWpTags:window.mailpoet_all_wp_tags,allWooCommerceProducts:window.mailpoet_woocommerce_products,allWooCommerceCategories:window.mailpoet_woocommerce_categories,allWooCommerceTags:window.mailpoet_woocommerce_tags,tutorialSeen:"1"===window.mailpoet_tutorial_seen,tutorialUrl:window.mailpoet_tutorial_url,user:{isAdministrator:window.mailpoet_is_administrator},theme:{hasWidgets:window.mailpoet_theme_support_widgets,hasFSE:window.mailpoet_theme_support_fse}},l={reducer:qte(a),actions:I,selectors:Yte,controls:Bse,resolvers:{}},c=(0,P.A)(Gee,l);(0,D.register)(c)})(),(()=>{const e=(0,xe.L)(Gee).getAllAvailableCustomFields();Mie.supports.inserter=(0,xe.L)(Gee).isUserAdministrator();const t=[{slug:"obligatory",title:""}];t.push({slug:"design",title:$ee.U.I18n.t("layoutBlocksCategory")}),t.push({slug:"fields",title:$ee.U.I18n.t("fieldsBlocksCategory")}),t.push({slug:"custom-fields",title:$ee.U.I18n.t("customFieldsBlocksCategory")}),function(e){(0,nt.J)(Zi).setCategories(e)}(t),hn("mailpoet-form/divider",iie),hn("mailpoet-form/email-input",sie),hn("mailpoet-form/submit-button",pie),hn("mailpoet-form/first-name-input",gie),hn("mailpoet-form/last-name-input",vie),hn("mailpoet-form/segment-select",Iie),hn("mailpoet-form/html",Mie),hn("mailpoet-form/add-custom-field",Vie),hn(sre,lre),hn(gre,yre),hn(Aoe,Eoe),hn(toe,ioe),hn(Sse,Ise),Array.isArray(e)&&e.forEach(Ese)})(),it(yCe,_Ce),window.mailpoet_translations.forEach(e=>{const t=JSON.parse(e);t&&t.locale_data?.messages&&(0,ee.setLocaleData)(t.locale_data.messages)}),(0,Fee.registerTranslations)(),t.render((0,Er.jsx)(T.StrictMode,{children:(0,Er.jsx)(PCe,{})}))}})},76739(e){e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,function(e,t){return t.toUpperCase()})]}},55880(e,t,n){t.parse=n(64512),t.stringify=n(77922)},64512(e){var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function n(e){return e?e.replace(/^\s+|\s+$/g,""):""}function i(e,t){var n=e&&"string"==typeof e.type,r=n?e:t;for(var o in e){var s=e[o];Array.isArray(s)?s.forEach(function(e){i(e,r)}):s&&"object"==typeof s&&i(s,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}e.exports=function(e,r){r=r||{};var o=1,s=1;function a(e){var t=e.match(/\n/g);t&&(o+=t.length);var n=e.lastIndexOf("\n");s=~n?e.length-n:s+e.length}function l(){var e={line:o,column:s};return function(t){return t.position=new c(e),g(),t}}function c(e){this.start=e,this.end={line:o,column:s},this.source=r.source}c.prototype.content=e;var u=[];function d(t){var n=new Error(r.source+":"+o+":"+s+": "+t);if(n.reason=t,n.filename=r.source,n.line=o,n.column=s,n.source=e,!r.silent)throw n;u.push(n)}function h(){return m(/^{\s*/)}function p(){return m(/^}/)}function f(){var t,n=[];for(g(),b(n);e.length&&"}"!=e.charAt(0)&&(t=E()||j());)!1!==t&&(n.push(t),b(n));return n}function m(t){var n=t.exec(e);if(n){var i=n[0];return a(i),e=e.slice(i.length),n}}function g(){m(/^\s*/)}function b(e){var t;for(e=e||[];t=y();)!1!==t&&e.push(t);return e}function y(){var t=l();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;""!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return d("End of comment missing");var i=e.slice(2,n-2);return s+=2,a(i),e=e.slice(n),s+=2,t({type:"comment",comment:i})}}function v(){var e=m(/^([^{]+)/);if(e)return n(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(e){return e.replace(/,/g,"")}).split(/\s*(?![^(]*\)),\s*/).map(function(e){return e.replace(/\u200C/g,",")})}function _(){var e=l(),i=m(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(i){if(i=n(i[0]),!m(/^:\s*/))return d("property missing ':'");var r=m(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:i.replace(t,""),value:r?n(r[0]).replace(t,""):""});return m(/^[;\s]*/),o}}function x(){var e,t=[];if(!h())return d("missing '{'");for(b(t);e=_();)!1!==e&&(t.push(e),b(t));return p()?t:d("missing '}'")}function k(){for(var e,t=[],n=l();e=m(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),m(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:x()})}var w,C=I("import"),S=I("charset"),A=I("namespace");function I(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var n=l(),i=m(t);if(i){var r={type:e};return r[e]=i[1].trim(),n(r)}}}function E(){if("@"==e[0])return function(){var e=l();if(t=m(/^@([-\w]+)?keyframes\s*/)){var t,n=t[1];if(!(t=m(/^([-\w]+)\s*/)))return d("@keyframes missing name");var i,r=t[1];if(!h())return d("@keyframes missing '{'");for(var o=b();i=k();)o.push(i),o=o.concat(b());return p()?e({type:"keyframes",name:r,vendor:n,keyframes:o}):d("@keyframes missing '}'")}}()||function(){var e=l(),t=m(/^@media *([^{]+)/);if(t){var i=n(t[1]);if(!h())return d("@media missing '{'");var r=b().concat(f());return p()?e({type:"media",media:i,rules:r}):d("@media missing '}'")}}()||function(){var e=l(),t=m(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:n(t[1]),media:n(t[2])})}()||function(){var e=l(),t=m(/^@supports *([^{]+)/);if(t){var i=n(t[1]);if(!h())return d("@supports missing '{'");var r=b().concat(f());return p()?e({type:"supports",supports:i,rules:r}):d("@supports missing '}'")}}()||C()||S()||A()||function(){var e=l(),t=m(/^@([-\w]+)?document *([^{]+)/);if(t){var i=n(t[1]),r=n(t[2]);if(!h())return d("@document missing '{'");var o=b().concat(f());return p()?e({type:"document",document:r,vendor:i,rules:o}):d("@document missing '}'")}}()||function(){var e=l();if(m(/^@page */)){var t=v()||[];if(!h())return d("@page missing '{'");for(var n,i=b();n=_();)i.push(n),i=i.concat(b());return p()?e({type:"page",selectors:t,declarations:i}):d("@page missing '}'")}}()||function(){var e=l();if(m(/^@host\s*/)){if(!h())return d("@host missing '{'");var t=b().concat(f());return p()?e({type:"host",rules:t}):d("@host missing '}'")}}()||function(){var e=l();if(m(/^@font-face\s*/)){if(!h())return d("@font-face missing '{'");for(var t,n=b();t=_();)n.push(t),n=n.concat(b());return p()?e({type:"font-face",declarations:n}):d("@font-face missing '}'")}}()}function j(){var e=l(),t=v();return t?(b(),e({type:"rule",selectors:t,declarations:x()})):d("selector missing")}return i((w=f(),{type:"stylesheet",stylesheet:{source:r.source,rules:w,parsingErrors:u}}))}},85521(e){function t(e){this.options=e||{}}e.exports=t,t.prototype.emit=function(e){return e},t.prototype.visit=function(e){return this[e.type](e)},t.prototype.mapVisit=function(e,t){var n="";t=t||"";for(var i=0,r=e.length;i<r;i++)n+=this.visit(e[i]),t&&i<r-1&&(n+=this.emit(t));return n}},99948(e,t,n){var i=n(85521),r=n(18628);function o(e){i.call(this,e)}e.exports=o,r(o,i),o.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},o.prototype.comment=function(e){return this.emit("",e.position)},o.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},o.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},o.prototype.document=function(e){var t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},o.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},o.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},o.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},o.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},o.prototype.keyframe=function(e){var t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},o.prototype.page=function(e){var t=e.selectors.length?e.selectors.join(", "):"";return this.emit("@page "+t,e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},o.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},o.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},o.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},o.prototype.rule=function(e){var t=e.declarations;return t.length?this.emit(e.selectors.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}"):""},o.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")}},72166(e,t,n){var i=n(85521),r=n(18628);function o(e){e=e||{},i.call(this,e),this.indentation=e.indent}e.exports=o,r(o,i),o.prototype.compile=function(e){return this.stylesheet(e)},o.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},o.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},o.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},o.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},o.prototype.document=function(e){var t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},o.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},o.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},o.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},o.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.keyframes,"\n")+this.emit(this.indent(-1)+"}")},o.prototype.keyframe=function(e){var t=e.declarations;return this.emit(this.indent())+this.emit(e.values.join(", "),e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(t,"\n")+this.emit(this.indent(-1)+"\n"+this.indent()+"}\n")},o.prototype.page=function(e){var t=e.selectors.length?e.selectors.join(", ")+" ":"";return this.emit("@page "+t,e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},o.prototype["font-face"]=function(e){return this.emit("@font-face ",e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},o.prototype.host=function(e){return this.emit("@host",e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},o.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},o.prototype.rule=function(e){var t=this.indent(),n=e.declarations;return n.length?this.emit(e.selectors.map(function(e){return t+e}).join(",\n"),e.position)+this.emit(" {\n")+this.emit(this.indent(1))+this.mapVisit(n,"\n")+this.emit(this.indent(-1))+this.emit("\n"+this.indent()+"}"):""},o.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},o.prototype.indent=function(e){return this.level=this.level||1,null!=e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")}},77922(e,t,n){var i=n(99948),r=n(72166);e.exports=function(e,t){var o=(t=t||{}).compress?new i(t):new r(t);if(t.sourcemap){n(31260)(o);var s=o.compile(e);return o.applySourceMaps(),{code:s,map:"generator"===t.sourcemap?o.map:o.map.toJSON()}}return o.compile(e)}},31260(e,t,n){var i=n(56116).SourceMapGenerator,r=n(56116).SourceMapConsumer,o=n(68743),s=n(54581),a=n(14993);e.exports=function(e){for(var n in e._comment=e.comment,e.map=new i,e.position={line:1,column:1},e.files={},t)e[n]=t[n]};const l=function(e){return"\\"===a.sep?e.replace(/\\/g,"/").replace(/^[a-z]:\/?/i,"/"):e};t.updatePosition=function(e){var t=e.match(/\n/g);t&&(this.position.line+=t.length);var n=e.lastIndexOf("\n");this.position.column=~n?e.length-n:this.position.column+e.length},t.emit=function(e,t){if(t){var n=l(t.source||"source.css");this.map.addMapping({source:n,generated:{line:this.position.line,column:Math.max(this.position.column-1,0)},original:{line:t.start.line,column:t.start.column-1}}),this.addFile(n,t)}return this.updatePosition(e),e},t.addFile=function(e,t){"string"==typeof t.content&&(Object.prototype.hasOwnProperty.call(this.files,e)||(this.files[e]=t.content))},t.applySourceMaps=function(){Object.keys(this.files).forEach(function(e){var t=this.files[e];if(this.map.setSourceContent(e,t),!1!==this.options.inputSourcemaps){var n=o.resolveSync(t,e,s.readFileSync);if(n){var i=new r(n.map),c=n.sourcesRelativeTo;this.map.applySourceMap(i,e,l(a.dirname(c)))}}},this)},t.comment=function(e){return/^# sourceMappingURL=/.test(e.comment)?this.emit("",e.position):this._comment(e)}},89293(e){"use strict";var t="%[a-f0-9]{2}",n=new RegExp("("+t+")|([^%]+?)","gi"),i=new RegExp("("+t+")+","gi");function r(e,t){try{return[decodeURIComponent(e.join(""))]}catch(e){}if(1===e.length)return e;t=t||1;var n=e.slice(0,t),i=e.slice(t);return Array.prototype.concat.call([],r(n),r(i))}function o(e){try{return decodeURIComponent(e)}catch(o){for(var t=e.match(n)||[],i=1;i<t.length;i++)t=(e=r(t,i).join("")).match(n)||[];return e}}e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},n=i.exec(e);n;){try{t[n[0]]=decodeURIComponent(n[0])}catch(e){var r=o(n[0]);r!==n[0]&&(t[n[0]]=r)}n=i.exec(e)}t["%C2"]="�";for(var s=Object.keys(t),a=0;a<s.length;a++){var l=s[a];e=e.replace(new RegExp(l,"g"),t[l])}return e}(e)}}},84304(e,t){"use strict";function n(){}function i(e,t,n,i,r){for(var o=0,s=t.length,a=0,l=0;o<s;o++){var c=t[o];if(c.removed){if(c.value=e.join(i.slice(l,l+c.count)),l+=c.count,o&&t[o-1].added){var u=t[o-1];t[o-1]=t[o],t[o]=u}}else{if(!c.added&&r){var d=n.slice(a,a+c.count);d=d.map(function(e,t){var n=i[l+t];return n.length>e.length?n:e}),c.value=e.join(d)}else c.value=e.join(n.slice(a,a+c.count));a+=c.count,c.added||(l+=c.count)}}var h=t[s-1];return s>1&&"string"==typeof h.value&&(h.added||h.removed)&&e.equals("",h.value)&&(t[s-2].value+=h.value,t.pop()),t}function r(e){return{newPos:e.newPos,components:e.components.slice(0)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.callback;"function"==typeof n&&(o=n,n={}),this.options=n;var s=this;function a(e){return o?(setTimeout(function(){o(void 0,e)},0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var l=(t=this.removeEmpty(this.tokenize(t))).length,c=e.length,u=1,d=l+c,h=[{newPos:-1,components:[]}],p=this.extractCommon(h[0],t,e,0);if(h[0].newPos+1>=l&&p+1>=c)return a([{value:this.join(t),count:t.length}]);function f(){for(var n=-1*u;n<=u;n+=2){var o=void 0,d=h[n-1],p=h[n+1],f=(p?p.newPos:0)-n;d&&(h[n-1]=void 0);var m=d&&d.newPos+1<l,g=p&&0<=f&&f<c;if(m||g){if(!m||g&&d.newPos<p.newPos?(o=r(p),s.pushComponent(o.components,void 0,!0)):((o=d).newPos++,s.pushComponent(o.components,!0,void 0)),f=s.extractCommon(o,t,e,n),o.newPos+1>=l&&f+1>=c)return a(i(s,o.components,t,e,s.useLongestToken));h[n]=o}else h[n]=void 0}u++}if(o)!function e(){setTimeout(function(){if(u>d)return o();f()||e()},0)}();else for(;u<=d;){var m=f();if(m)return m}},pushComponent:function(e,t,n){var i=e[e.length-1];i&&i.added===t&&i.removed===n?e[e.length-1]={count:i.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,i){for(var r=t.length,o=n.length,s=e.newPos,a=s-i,l=0;s+1<r&&a+1<o&&this.equals(t[s+1],n[a+1]);)s++,a++,l++;return l&&e.components.push({count:l}),e.newPos=s,a},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}}},87786(e,t,n){"use strict";var i;t.JJ=function(e,t,n){return r.diff(e,t,n)};var r=new(((i=n(84304))&&i.__esModule?i:{default:i}).default)},7040(e){"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var i,r,o;if(Array.isArray(t)){if((i=t.length)!=n.length)return!1;for(r=i;0!==r--;)if(!e(t[r],n[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((i=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(r=i;0!==r--;)if(!Object.prototype.hasOwnProperty.call(n,o[r]))return!1;for(r=i;0!==r--;){var s=o[r];if(!e(t[s],n[s]))return!1}return!0}return t!=t&&n!=n}},88863(e,t){var n,i;(i=i||{}).stringify=(n={"visit_linear-gradient":function(e){return n.visit_gradient(e)},"visit_repeating-linear-gradient":function(e){return n.visit_gradient(e)},"visit_radial-gradient":function(e){return n.visit_gradient(e)},"visit_repeating-radial-gradient":function(e){return n.visit_gradient(e)},visit_gradient:function(e){var t=n.visit(e.orientation);return t&&(t+=", "),e.type+"("+t+n.visit(e.colorStops)+")"},visit_shape:function(e){var t=e.value,i=n.visit(e.at),r=n.visit(e.style);return r&&(t+=" "+r),i&&(t+=" at "+i),t},"visit_default-radial":function(e){var t="",i=n.visit(e.at);return i&&(t+=i),t},"visit_extent-keyword":function(e){var t=e.value,i=n.visit(e.at);return i&&(t+=" at "+i),t},"visit_position-keyword":function(e){return e.value},visit_position:function(e){return n.visit(e.value.x)+" "+n.visit(e.value.y)},"visit_%":function(e){return e.value+"%"},visit_em:function(e){return e.value+"em"},visit_px:function(e){return e.value+"px"},visit_calc:function(e){return"calc("+e.value+")"},visit_literal:function(e){return n.visit_color(e.value,e)},visit_hex:function(e){return n.visit_color("#"+e.value,e)},visit_rgb:function(e){return n.visit_color("rgb("+e.value.join(", ")+")",e)},visit_rgba:function(e){return n.visit_color("rgba("+e.value.join(", ")+")",e)},visit_hsl:function(e){return n.visit_color("hsl("+e.value[0]+", "+e.value[1]+"%, "+e.value[2]+"%)",e)},visit_hsla:function(e){return n.visit_color("hsla("+e.value[0]+", "+e.value[1]+"%, "+e.value[2]+"%, "+e.value[3]+")",e)},visit_var:function(e){return n.visit_color("var("+e.value+")",e)},visit_color:function(e,t){var i=e,r=n.visit(t.length);return r&&(i+=" "+r),i},visit_angular:function(e){return e.value+"deg"},visit_directional:function(e){return"to "+e.value},visit_array:function(e){var t="",i=e.length;return e.forEach(function(e,r){t+=n.visit(e),r<i-1&&(t+=", ")}),t},visit_object:function(e){return e.width&&e.height?n.visit(e.width)+" "+n.visit(e.height):""},visit:function(e){if(!e)return"";if(e instanceof Array)return n.visit_array(e);if("object"!=typeof e||e.type){if(e.type){var t=n["visit_"+e.type];if(t)return t(e);throw Error("Missing visitor visit_"+e.type)}throw Error("Invalid node.")}return n.visit_object(e)}},function(e){return n.visit(e)}),(i=i||{}).parse=function(){var e=/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,t=/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,n=/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,i=/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,r=/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,o=/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,s=/^(left|center|right|top|bottom)/i,a=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,l=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,c=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,u=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,d=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))rad/,h=/^\(/,p=/^\)/,f=/^,/,m=/^\#([0-9a-fA-F]+)/,g=/^([a-zA-Z]+)/,b=/^rgb/i,y=/^rgba/i,v=/^var/i,_=/^calc/i,x=/^(--[a-zA-Z0-9-,\s\#]+)/,k=/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,w=/^hsl/i,C=/^hsla/i,S="";function A(e){var t=new Error(S+": "+e);throw t.source=S,t}function I(){return E("linear-gradient",e,T)||E("repeating-linear-gradient",t,T)||E("radial-gradient",n,B)||E("repeating-radial-gradient",i,B)}function E(e,t,n){return j(t,function(t){var i=n();return i&&(U(f)||A("Missing comma before color stops")),{type:e,orientation:i,colorStops:M(P)}})}function j(e,t){var n=U(e);if(n){U(h)||A("Missing (");var i=t(n);return U(p)||A("Missing )"),i}}function T(){var e=V("directional",r,1);if(e)return e;var t=V("position-keyword",s,1);return t?{type:"directional",value:t.value}:V("angular",u,1)||V("angular",d,1)}function B(){var e,t,n=N();return n&&((e=[]).push(n),t=S,U(f)&&((n=N())?e.push(n):S=t)),e}function N(){var e,t,n=((t=V("shape",/^(circle)/i,0))&&(t.style=z()||R()),t||((e=V("shape",/^(ellipse)/i,0))&&(e.style=L()||F()||R()),e));if(n)n.at=O();else{var i=R();if(i){n=i;var r=O();r&&(n.at=r)}else{var o=O();if(o)n={type:"default-radial",at:o};else{var s=L();s&&(n={type:"default-radial",at:s})}}}return n}function R(){return V("extent-keyword",o,1)}function O(){if(V("position",/^at/,0)){var e=L();return e||A("Missing positioning value"),e}}function L(){var e={x:F(),y:F()};if(e.x||e.y)return{type:"position",value:e}}function M(e){var t=e(),n=[];if(t)for(n.push(t);U(f);)(t=e())?n.push(t):A("One extra comma");return n}function P(){var e=V("hex",m,1)||j(C,function(){var e=D();U(f);var t=U(l),n=t?t[1]:null;U(f);var i=(t=U(l))?t[1]:null;U(f);var r=D();return n&&i||A("Expected percentage value for saturation and lightness in HSLA"),{type:"hsla",value:[e,n,i,r]}})||j(w,function(){U(l)&&A("HSL hue value must be a number in degrees (0-360) or normalized (-360 to 360), not a percentage");var e=D();U(f);var t=U(l),n=t?t[1]:null;U(f);var i=(t=U(l))?t[1]:null;return n&&i||A("Expected percentage value for saturation and lightness in HSL"),{type:"hsl",value:[e,n,i]}})||j(y,function(){return{type:"rgba",value:M(D)}})||j(b,function(){return{type:"rgb",value:M(D)}})||j(v,function(){return{type:"var",value:U(x)[1]}})||V("literal",g,0);return e||A("Expected color definition"),e.length=F(),e}function D(){return U(k)[1]}function F(){return V("%",l,1)||V("position-keyword",s,1)||j(_,function(){for(var e=1,t=0;e>0&&t<S.length;){var n=S.charAt(t);"("===n?e++:")"===n&&e--,t++}e>0&&A("Missing closing parenthesis in calc() expression");var i=S.substring(0,t-1);return $(t-1),{type:"calc",value:i}})||z()}function z(){return V("px",a,1)||V("em",c,1)}function V(e,t,n){var i=U(t);if(i)return{type:e,value:i[n]}}function U(e){var t,n;return(n=/^[\n\r\t\s]+/.exec(S))&&$(n[0].length),(t=e.exec(S))&&$(t[0].length),t}function $(e){S=S.substr(e)}return function(e){return(S=e.toString().trim()).endsWith(";")&&(S=S.slice(0,-1)),t=M(I),S.length>0&&A("Invalid input not EOF"),t;var t}}(),t.parse=i.parse,t.stringify=i.stringify},49781(e,t,n){var i=n(76739);e.exports=function(e){var t=i(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var r=e.style.lineHeight;e.style.lineHeight=t+"em",t=i(e,"line-height"),n=parseFloat(t,10),r?e.style.lineHeight=r:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var o=e.nodeName,s=document.createElement(o);s.innerHTML=" ","TEXTAREA"===o.toUpperCase()&&s.setAttribute("rows","1");var a=i(e,"font-size");s.style.fontSize=a,s.style.padding="0px",s.style.border="0px";var l=document.body;l.appendChild(s),n=s.offsetHeight,l.removeChild(s)}return n}},75187(e,t,n){e.exports=n(21238)},90299(e){"use strict";var t=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:t,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:t&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:t&&!!window.screen,isInWorker:!t};e.exports=n},36048(e){var t,n,i,r,o,s,a,l,c,u,d,h,p,f,m,g=!1;function b(){if(!g){g=!0;var e=navigator.userAgent,b=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),y=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(h=/\b(iPhone|iP[ao]d)/.exec(e),p=/\b(iP[ao]d)/.exec(e),u=/Android/i.exec(e),f=/FBAN\/\w+;/i.exec(e),m=/Mobile/i.exec(e),d=!!/Win64/.exec(e),b){(t=b[1]?parseFloat(b[1]):b[5]?parseFloat(b[5]):NaN)&&document&&document.documentMode&&(t=document.documentMode);var v=/(?:Trident\/(\d+.\d+))/.exec(e);s=v?parseFloat(v[1])+4:t,n=b[2]?parseFloat(b[2]):NaN,i=b[3]?parseFloat(b[3]):NaN,(r=b[4]?parseFloat(b[4]):NaN)?(b=/(?:Chrome\/(\d+\.\d+))/.exec(e),o=b&&b[1]?parseFloat(b[1]):NaN):o=NaN}else t=n=i=o=r=NaN;if(y){if(y[1]){var _=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);a=!_||parseFloat(_[1].replace("_","."))}else a=!1;l=!!y[2],c=!!y[3]}else a=l=c=!1}}var y={ie:function(){return b()||t},ieCompatibilityMode:function(){return b()||s>t},ie64:function(){return y.ie()&&d},firefox:function(){return b()||n},opera:function(){return b()||i},webkit:function(){return b()||r},safari:function(){return y.webkit()},chrome:function(){return b()||o},windows:function(){return b()||l},osx:function(){return b()||a},linux:function(){return b()||c},iphone:function(){return b()||h},mobile:function(){return b()||h||p||u||m},nativeApp:function(){return b()||f},android:function(){return b()||u},ipad:function(){return b()||p}};e.exports=y},31186(e,t,n){"use strict";var i,r=n(90299);r.canUseDOM&&(i=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),e.exports=function(e,t){if(!r.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,o=n in document;if(!o){var s=document.createElement("div");s.setAttribute(n,"return;"),o="function"==typeof s[n]}return!o&&i&&"wheel"===e&&(o=document.implementation.hasFeature("Events.wheel","3.0")),o}},21238(e,t,n){"use strict";var i=n(36048),r=n(31186);function o(e){var t=0,n=0,i=0,r=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),i=10*t,r=10*n,"deltaY"in e&&(r=e.deltaY),"deltaX"in e&&(i=e.deltaX),(i||r)&&e.deltaMode&&(1==e.deltaMode?(i*=40,r*=40):(i*=800,r*=800)),i&&!t&&(t=i<1?-1:1),r&&!n&&(n=r<1?-1:1),{spinX:t,spinY:n,pixelX:i,pixelY:r}}o.getEventType=function(){return i.firefox()?"DOMMouseScroll":r("wheel")?"wheel":"mousewheel"},e.exports=o},46051(e){var t=String,n=function(){return{isColorSupported:!1,reset:t,bold:t,dim:t,italic:t,underline:t,inverse:t,hidden:t,strikethrough:t,black:t,red:t,green:t,yellow:t,blue:t,magenta:t,cyan:t,white:t,gray:t,bgBlack:t,bgRed:t,bgGreen:t,bgYellow:t,bgBlue:t,bgMagenta:t,bgCyan:t,bgWhite:t,blackBright:t,redBright:t,greenBright:t,yellowBright:t,blueBright:t,magentaBright:t,cyanBright:t,whiteBright:t,bgBlackBright:t,bgRedBright:t,bgGreenBright:t,bgYellowBright:t,bgBlueBright:t,bgMagentaBright:t,bgCyanBright:t,bgWhiteBright:t}};e.exports=n(),e.exports.createColors=n},96242(e){function t(e,t){return t.some(t=>t instanceof RegExp?t.test(e):e.includes(t))}e.exports=function(e){const n=e.prefix,i=/\s+$/.test(n)?n:`${n} `,r=e.ignoreFiles?[].concat(e.ignoreFiles):[],o=e.includeFiles?[].concat(e.includeFiles):[];return function(s){r.length&&s.source.input.file&&t(s.source.input.file,r)||o.length&&s.source.input.file&&!t(s.source.input.file,o)||s.walkRules(t=>{t.parent&&["keyframes","-webkit-keyframes","-moz-keyframes","-o-keyframes","-ms-keyframes"].includes(t.parent.name)||(t.selectors=t.selectors.map(r=>e.exclude&&function(e,t){return t.some(t=>t instanceof RegExp?t.test(e):e===t)}(r,e.exclude)?r:e.transform?e.transform(n,r,i+r,s.source.input.file,t):i+r))})}}},14686(e,t,n){const i=n(73427);e.exports=e=>{const t=Object.assign({skipHostRelativeUrls:!0},e);return{postcssPlugin:"rebaseUrl",Declaration(n){const r=i(n.value);let o=!1;r.walk(n=>{if("function"!==n.type||"url"!==n.value)return;const i=n.nodes[0].value,r=new URL(i,e.rootUrl);return r.pathname===i&&t.skipHostRelativeUrls||(n.nodes[0].value=r.toString(),o=!0),!1}),o&&(n.value=i.stringify(r))}}},e.exports.postcss=!0},73427(e,t,n){var i=n(80140),r=n(9434),o=n(90498);function s(e){return this instanceof s?(this.nodes=i(e),this):new s(e)}s.prototype.toString=function(){return Array.isArray(this.nodes)?o(this.nodes):""},s.prototype.walk=function(e,t){return r(this.nodes,e,t),this},s.unit=n(92497),s.walk=r,s.stringify=o,e.exports=s},80140(e){var t="(".charCodeAt(0),n=")".charCodeAt(0),i="'".charCodeAt(0),r='"'.charCodeAt(0),o="\\".charCodeAt(0),s="/".charCodeAt(0),a=",".charCodeAt(0),l=":".charCodeAt(0),c="*".charCodeAt(0),u="u".charCodeAt(0),d="U".charCodeAt(0),h="+".charCodeAt(0),p=/^[a-f0-9?-]+$/i;e.exports=function(e){for(var f,m,g,b,y,v,_,x,k,w=[],C=e,S=0,A=C.charCodeAt(S),I=C.length,E=[{nodes:w}],j=0,T="",B="",N="";S<I;)if(A<=32){f=S;do{f+=1,A=C.charCodeAt(f)}while(A<=32);b=C.slice(S,f),g=w[w.length-1],A===n&&j?N=b:g&&"div"===g.type?(g.after=b,g.sourceEndIndex+=b.length):A===a||A===l||A===s&&C.charCodeAt(f+1)!==c&&(!k||k&&"function"===k.type&&"calc"!==k.value)?B=b:w.push({type:"space",sourceIndex:S,sourceEndIndex:f,value:b}),S=f}else if(A===i||A===r){f=S,b={type:"string",sourceIndex:S,quote:m=A===i?"'":'"'};do{if(y=!1,~(f=C.indexOf(m,f+1)))for(v=f;C.charCodeAt(v-1)===o;)v-=1,y=!y;else f=(C+=m).length-1,b.unclosed=!0}while(y);b.value=C.slice(S+1,f),b.sourceEndIndex=b.unclosed?f:f+1,w.push(b),S=f+1,A=C.charCodeAt(S)}else if(A===s&&C.charCodeAt(S+1)===c)b={type:"comment",sourceIndex:S,sourceEndIndex:(f=C.indexOf("*/",S))+2},-1===f&&(b.unclosed=!0,f=C.length,b.sourceEndIndex=f),b.value=C.slice(S+2,f),w.push(b),S=f+2,A=C.charCodeAt(S);else if(A!==s&&A!==c||!k||"function"!==k.type||"calc"!==k.value)if(A===s||A===a||A===l)b=C[S],w.push({type:"div",sourceIndex:S-B.length,sourceEndIndex:S+b.length,value:b,before:B,after:""}),B="",S+=1,A=C.charCodeAt(S);else if(t===A){f=S;do{f+=1,A=C.charCodeAt(f)}while(A<=32);if(x=S,b={type:"function",sourceIndex:S-T.length,value:T,before:C.slice(x+1,f)},S=f,"url"===T&&A!==i&&A!==r){f-=1;do{if(y=!1,~(f=C.indexOf(")",f+1)))for(v=f;C.charCodeAt(v-1)===o;)v-=1,y=!y;else f=(C+=")").length-1,b.unclosed=!0}while(y);_=f;do{_-=1,A=C.charCodeAt(_)}while(A<=32);x<_?(b.nodes=S!==_+1?[{type:"word",sourceIndex:S,sourceEndIndex:_+1,value:C.slice(S,_+1)}]:[],b.unclosed&&_+1!==f?(b.after="",b.nodes.push({type:"space",sourceIndex:_+1,sourceEndIndex:f,value:C.slice(_+1,f)})):(b.after=C.slice(_+1,f),b.sourceEndIndex=f)):(b.after="",b.nodes=[]),S=f+1,b.sourceEndIndex=b.unclosed?f:S,A=C.charCodeAt(S),w.push(b)}else j+=1,b.after="",b.sourceEndIndex=S+1,w.push(b),E.push(b),w=b.nodes=[],k=b;T=""}else if(n===A&&j)S+=1,A=C.charCodeAt(S),k.after=N,k.sourceEndIndex+=N.length,N="",j-=1,E[E.length-1].sourceEndIndex=S,E.pop(),w=(k=E[j]).nodes;else{f=S;do{A===o&&(f+=1),f+=1,A=C.charCodeAt(f)}while(f<I&&!(A<=32||A===i||A===r||A===a||A===l||A===s||A===t||A===c&&k&&"function"===k.type&&"calc"===k.value||A===s&&"function"===k.type&&"calc"===k.value||A===n&&j));b=C.slice(S,f),t===A?T=b:u!==b.charCodeAt(0)&&d!==b.charCodeAt(0)||h!==b.charCodeAt(1)||!p.test(b.slice(2))?w.push({type:"word",sourceIndex:S,sourceEndIndex:f,value:b}):w.push({type:"unicode-range",sourceIndex:S,sourceEndIndex:f,value:b}),S=f}else b=C[S],w.push({type:"word",sourceIndex:S-B.length,sourceEndIndex:S+b.length,value:b}),S+=1,A=C.charCodeAt(S);for(S=E.length-1;S;S-=1)E[S].unclosed=!0,E[S].sourceEndIndex=C.length;return E[0].nodes}},90498(e){function t(e,t){var i,r,o=e.type,s=e.value;return t&&void 0!==(r=t(e))?r:"word"===o||"space"===o?s:"string"===o?(i=e.quote||"")+s+(e.unclosed?"":i):"comment"===o?"/*"+s+(e.unclosed?"":"*/"):"div"===o?(e.before||"")+s+(e.after||""):Array.isArray(e.nodes)?(i=n(e.nodes,t),"function"!==o?i:s+"("+(e.before||"")+i+(e.after||"")+(e.unclosed?"":")")):s}function n(e,n){var i,r;if(Array.isArray(e)){for(i="",r=e.length-1;~r;r-=1)i=t(e[r],n)+i;return i}return t(e,n)}e.exports=n},92497(e){var t="-".charCodeAt(0),n="+".charCodeAt(0),i=".".charCodeAt(0),r="e".charCodeAt(0),o="E".charCodeAt(0);e.exports=function(e){var s,a,l,c=0,u=e.length;if(0===u||!function(e){var r,o=e.charCodeAt(0);if(o===n||o===t){if((r=e.charCodeAt(1))>=48&&r<=57)return!0;var s=e.charCodeAt(2);return r===i&&s>=48&&s<=57}return o===i?(r=e.charCodeAt(1))>=48&&r<=57:o>=48&&o<=57}(e))return!1;for((s=e.charCodeAt(c))!==n&&s!==t||c++;c<u&&!((s=e.charCodeAt(c))<48||s>57);)c+=1;if(s=e.charCodeAt(c),a=e.charCodeAt(c+1),s===i&&a>=48&&a<=57)for(c+=2;c<u&&!((s=e.charCodeAt(c))<48||s>57);)c+=1;if(s=e.charCodeAt(c),a=e.charCodeAt(c+1),l=e.charCodeAt(c+2),(s===r||s===o)&&(a>=48&&a<=57||(a===n||a===t)&&l>=48&&l<=57))for(c+=a===n||a===t?3:2;c<u&&!((s=e.charCodeAt(c))<48||s>57);)c+=1;return{number:e.slice(0,c),unit:e.slice(c)}}},9434(e){e.exports=function e(t,n,i){var r,o,s,a;for(r=0,o=t.length;r<o;r+=1)s=t[r],i||(a=n(s,r,t)),!1!==a&&"function"===s.type&&Array.isArray(s.nodes)&&e(s.nodes,n,i),i&&n(s,r,t)}},81437(e,t,n){"use strict";let i=n(87952);class r extends i{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}e.exports=r,r.default=r,i.registerAtRule(r)},43794(e,t,n){"use strict";let i=n(44223);class r extends i{constructor(e){super(e),this.type="comment"}}e.exports=r,r.default=r},87952(e,t,n){"use strict";let i,r,o,s,a=n(43794),l=n(83271),c=n(44223),{isClean:u,my:d}=n(22450);function h(e){return e.map(e=>(e.nodes&&(e.nodes=h(e.nodes)),delete e.source,e))}function p(e){if(e[u]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)p(t)}class f extends c{get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,n,i=this.getIterator();for(;this.indexes[i]<this.proxyOf.nodes.length&&(t=this.indexes[i],n=e(this.proxyOf.nodes[t],t),!1!==n);)this.indexes[i]+=1;return delete this.indexes[i],n}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...n)=>e[t](...n.map(e=>"function"==typeof e?(t,n)=>e(t.toProxy(),n):e)):"every"===t||"some"===t?n=>e[t]((e,...t)=>n(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n,i=this.index(e),r=this.normalize(t,this.proxyOf.nodes[i]).reverse();i=this.index(e);for(let e of r)this.proxyOf.nodes.splice(i+1,0,e);for(let e in this.indexes)n=this.indexes[e],i<n&&(this.indexes[e]=n+r.length);return this.markDirty(),this}insertBefore(e,t){let n,i=this.index(e),r=0===i&&"prepend",o=this.normalize(t,this.proxyOf.nodes[i],r).reverse();i=this.index(e);for(let e of o)this.proxyOf.nodes.splice(i,0,e);for(let e in this.indexes)n=this.indexes[e],i<=n&&(this.indexes[e]=n+o.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=h(r(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e)){e=e.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if("root"===e.type&&"document"!==this.type){e=e.nodes.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new l(e)]}else if(e.selector||e.selectors)e=[new s(e)];else if(e.name)e=[new i(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new a(e)]}return e.map(e=>(e[d]||f.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[u]&&p(e),e.raws||(e.raws={}),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls(i=>{t.props&&!t.props.includes(i.prop)||t.fast&&!i.value.includes(t.fast)||(i.value=i.value.replace(e,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,n)=>{let i;try{i=e(t,n)}catch(e){throw t.addToError(e)}return!1!==i&&t.walk&&(i=t.walk(e)),i})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((n,i)=>{if("atrule"===n.type&&e.test(n.name))return t(n,i)}):this.walk((n,i)=>{if("atrule"===n.type&&n.name===e)return t(n,i)}):(t=e,this.walk((e,n)=>{if("atrule"===e.type)return t(e,n)}))}walkComments(e){return this.walk((t,n)=>{if("comment"===t.type)return e(t,n)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((n,i)=>{if("decl"===n.type&&e.test(n.prop))return t(n,i)}):this.walk((n,i)=>{if("decl"===n.type&&n.prop===e)return t(n,i)}):(t=e,this.walk((e,n)=>{if("decl"===e.type)return t(e,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((n,i)=>{if("rule"===n.type&&e.test(n.selector))return t(n,i)}):this.walk((n,i)=>{if("rule"===n.type&&n.selector===e)return t(n,i)}):(t=e,this.walk((e,n)=>{if("rule"===e.type)return t(e,n)}))}}f.registerParse=e=>{r=e},f.registerRule=e=>{s=e},f.registerAtRule=e=>{i=e},f.registerRoot=e=>{o=e},e.exports=f,f.default=f,f.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,i.prototype):"rule"===e.type?Object.setPrototypeOf(e,s.prototype):"decl"===e.type?Object.setPrototypeOf(e,l.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,o.prototype),e[d]=!0,e.nodes&&e.nodes.forEach(e=>{f.rebuild(e)})}},19737(e,t,n){"use strict";let i=n(46051),r=n(28479);class o extends Error{constructor(e,t,n,i,r,s){super(e),this.name="CssSyntaxError",this.reason=e,r&&(this.file=r),i&&(this.source=i),s&&(this.plugin=s),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,o)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=i.isColorSupported);let n=e=>e,o=e=>e,s=e=>e;if(e){let{bold:e,gray:t,red:a}=i.createColors(!0);o=t=>e(a(t)),n=e=>t(e),r&&(s=e=>r(e))}let a=t.split(/\r?\n/),l=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),u=String(c).length;return a.slice(l,c).map((e,t)=>{let i=l+1+t,r=" "+(" "+i).slice(-u)+" | ";if(i===this.line){if(e.length>160){let t=20,i=Math.max(0,this.column-t),a=Math.max(this.column+t,this.endColumn+t),l=e.slice(i,a),c=n(r.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return o(">")+n(r)+s(l)+"\n "+c+o("^")}let t=n(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return o(">")+n(r)+s(e)+"\n "+t+o("^")}return" "+n(r)+s(e)}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}e.exports=o,o.default=o},83271(e,t,n){"use strict";let i=n(44223);class r extends i{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}e.exports=r,r.default=r},93966(e,t,n){"use strict";let i,r,o=n(87952);class s extends o{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new i(new r,this,e).stringify()}}s.registerLazyResult=e=>{i=e},s.registerProcessor=e=>{r=e},e.exports=s,s.default=s},39799(e,t,n){"use strict";let{nanoid:i}=n(46931),{isAbsolute:r,resolve:o}=n(54652),{SourceMapConsumer:s,SourceMapGenerator:a}=n(8437),{fileURLToPath:l,pathToFileURL:c}=n(81516),u=n(19737),d=n(41637),h=n(28479),p=Symbol("lineToIndexCache"),f=Boolean(s&&a),m=Boolean(o&&r);function g(e){if(e[p])return e[p];let t=e.css.split("\n"),n=new Array(t.length),i=0;for(let e=0,r=t.length;e<r;e++)n[e]=i,i+=t[e].length+1;return e[p]=n,n}class b{get from(){return this.file||this.id}constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,t.document&&(this.document=t.document.toString()),t.from&&(!m||/^\w+:\/\//.test(t.from)||r(t.from)?this.file=t.from:this.file=o(t.from)),m&&f){let e=new d(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+i(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,n,i={}){let r,o,s,a,l;if(t&&"object"==typeof t){let e=t,i=n;if("number"==typeof e.offset){a=e.offset;let i=this.fromOffset(a);t=i.line,n=i.col}else t=e.line,n=e.column,a=this.fromLineAndColumn(t,n);if("number"==typeof i.offset){s=i.offset;let e=this.fromOffset(s);o=e.line,r=e.col}else o=i.line,r=i.column,s=this.fromLineAndColumn(i.line,i.column)}else if(n)a=this.fromLineAndColumn(t,n);else{a=t;let e=this.fromOffset(a);t=e.line,n=e.col}let d=this.origin(t,n,o,r);return l=d?new u(e,void 0===d.endLine?d.line:{column:d.column,line:d.line},void 0===d.endLine?d.column:{column:d.endColumn,line:d.endLine},d.source,d.file,i.plugin):new u(e,void 0===o?t:{column:n,line:t},void 0===o?n:{column:r,line:o},this.css,this.file,i.plugin),l.input={column:n,endColumn:r,endLine:o,endOffset:s,line:t,offset:a,source:this.css},this.file&&(c&&(l.input.url=c(this.file).toString()),l.input.file=this.file),l}fromLineAndColumn(e,t){return g(this)[e-1]+t-1}fromOffset(e){let t=g(this),n=0;if(e>=t[t.length-1])n=t.length-1;else{let i,r=t.length-2;for(;n<r;)if(i=n+(r-n>>1),e<t[i])r=i-1;else{if(!(e>=t[i+1])){n=i;break}n=i+1}}return{col:e-t[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:o(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,n,i){if(!this.map)return!1;let o,s,a=this.map.consumer(),u=a.originalPositionFor({column:t,line:e});if(!u.source)return!1;"number"==typeof n&&(o=a.originalPositionFor({column:i,line:n})),s=r(u.source)?c(u.source):new URL(u.source,this.map.consumer().sourceRoot||c(this.map.mapFile));let d={column:u.column,endColumn:o&&o.column,endLine:o&&o.line,line:u.line,url:s.toString()};if("file:"===s.protocol){if(!l)throw new Error("file: protocol is not available in this PostCSS build");d.file=l(s)}let h=a.sourceContentFor(u.source);return h&&(d.source=h),d}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}}e.exports=b,b.default=b,h&&h.registerInput&&h.registerInput(b)},11887(e,t,n){"use strict";let i=n(87952),r=n(93966),o=n(93741),s=n(40920),a=n(20510),l=n(94707),c=n(99734),{isClean:u,my:d}=n(22450);n(38605);const h={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},p={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},f={Once:!0,postcssPlugin:!0,prepare:!0};function m(e){return"object"==typeof e&&"function"==typeof e.then}function g(e){let t=!1,n=h[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function b(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:g(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function y(e){return e[u]=!1,e.nodes&&e.nodes.forEach(e=>y(e)),e}let v={};class _{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(e,t,n){let r;if(this.stringified=!1,this.processed=!1,"object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof _||t instanceof a)r=y(t.root),t.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=t.map);else{let e=s;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{r=e(t,n)}catch(e){this.processed=!0,this.error=e}r&&!r[d]&&i.rebuild(r)}else r=y(t);this.result=new a(e,r,n),this.helpers={...v,postcss:v,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let n=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin?n.postcssVersion:(e.plugin=n.postcssPlugin,e.setMessage())}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if("object"==typeof t)for(let n in t){if(!p[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!f[n])if("object"==typeof t[n])for(let i in t[n])e(t,"*"===i?n:n+"-"+i.toLowerCase(),t[n][i]);else"function"==typeof t[n]&&e(t,n,t[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],n=this.runOnRoot(t);if(m(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[u];){e[u]=!0;let t=[b(e)];for(;t.length>0;){let e=this.visitTick(t);if(m(e))try{await e}catch(e){let n=t[t.length-1].node;throw this.handleError(e,n)}}}if(this.listeners.OnceExit)for(let[t,n]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>n(e,this.helpers));await Promise.all(t)}else await n(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return m(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=c;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new o(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(m(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[u];)e[u]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[n,i]of e){let e;this.result.lastPlugin=n;try{e=i(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(m(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:n,visitors:i}=t;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void e.pop();if(i.length>0&&t.visitorIndex<i.length){let[e,r]=i[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===i.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return r(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){let i,r=t.iterator;for(;i=n.nodes[n.indexes[r]];)if(n.indexes[r]+=1,!i[u])return i[u]=!0,void e.push(b(i));t.iterator=0,delete n.indexes[r]}let r=t.events;for(;t.eventIndex<r.length;){let e=r[t.eventIndex];if(t.eventIndex+=1,0===e)return void(n.nodes&&n.nodes.length&&(n[u]=!0,t.iterator=n.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[u]=!0;let t=g(e);for(let n of t)if(0===n)e.nodes&&e.each(e=>{e[u]||this.walkSync(e)});else{let t=this.listeners[n];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}}_.registerPostcss=e=>{v=e},e.exports=_,_.default=_,l.registerLazyResult(_),r.registerLazyResult(_)},32003(e){"use strict";let t={comma:e=>t.split(e,[","],!0),space:e=>t.split(e,[" ","\n","\t"]),split(e,t,n){let i=[],r="",o=!1,s=0,a=!1,l="",c=!1;for(let n of e)c?c=!1:"\\"===n?c=!0:a?n===l&&(a=!1):'"'===n||"'"===n?(a=!0,l=n):"("===n?s+=1:")"===n?s>0&&(s-=1):0===s&&t.includes(n)&&(o=!0),o?(""!==r&&i.push(r.trim()),r="",o=!1):r+=n;return(n||""!==r)&&i.push(r.trim()),i}};e.exports=t,t.default=t},93741(e,t,n){"use strict";let{dirname:i,relative:r,resolve:o,sep:s}=n(54652),{SourceMapConsumer:a,SourceMapGenerator:l}=n(8437),{pathToFileURL:c}=n(81516),u=n(39799),d=Boolean(a&&l),h=Boolean(i&&o&&r&&s);e.exports=class{constructor(e,t,n,i){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,n=this.toUrl(this.path(e.file)),r=e.root||i(e.file);!1===this.mapOpts.sourcesContent?(t=new a(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else if(this.css){let e;for(;-1!==(e=this.css.lastIndexOf("/*#"));){let t=this.css.indexOf("*/",e+3);if(-1===t)break;for(;e>0&&"\n"===this.css[e-1];)e--;this.css=this.css.slice(0,e)+this.css.slice(t+2)}}}generate(){if(this.clearAnnotation(),h&&d&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=l.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new l({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new l({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,n=1,i=1,r="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(s,a,l)=>{if(this.css+=s,a&&"end"!==l&&(o.generated.line=n,o.generated.column=i-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=r,o.original.line=1,o.original.column=0,this.map.addMapping(o))),t=s.match(/\n/g),t?(n+=t.length,e=s.lastIndexOf("\n"),i=s.length-e):i+=s.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=n,o.generated.column=i-2,this.map.addMapping(o)):(o.source=r,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=i-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let n=this.opts.to?i(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=i(o(n,this.mapOpts.annotation)));let s=r(n,e);return this.memoizedPaths.set(e,s),s}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new u(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let i=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(i,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(c){let t=c(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===s&&(e=e.replace(/\\/g,"/"));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}}},36284(e,t,n){"use strict";let i=n(93741),r=n(40920),o=n(20510),s=n(99734);n(38605);class a{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=r;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(e,t,n){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;let r=s;this.result=new o(this._processor,void 0,this._opts),this.result.css=t;let a=this;Object.defineProperty(this.result,"root",{get:()=>a.root});let l=new i(r,void 0,this._opts,t);if(l.isMap()){let[e,t]=l.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else l.clearAnnotation(),this.result.css=l.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}}e.exports=a,a.default=a},44223(e,t,n){"use strict";let i=n(19737),r=n(3529),o=n(99734),{isClean:s,my:a}=n(22450);function l(e,t){let n=new e.constructor;for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;if("proxyCache"===i)continue;let r=e[i],o=typeof r;"parent"===i&&"object"===o?t&&(n[i]=t):"source"===i?n[i]=r:Array.isArray(r)?n[i]=r.map(e=>l(e,n)):("object"===o&&null!==r&&(r=l(r)),n[i]=r)}return n}function c(e,t){if(t&&void 0!==t.offset)return t.offset;let n=1,i=1,r=0;for(let o=0;o<e.length;o++){if(i===t.line&&n===t.column){r=o;break}"\n"===e[o]?(n=1,i+=1):n+=1}return r}class u{get proxyOf(){return this}constructor(e={}){this.raws={},this[s]=!1,this[a]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let n of e[t])"function"==typeof n.clone?this.append(n.clone()):this.append(n)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=l(this);for(let n in e)t[n]=e[n];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:n,start:i}=this.rangeBy(t);return this.source.input.error(e,{column:i.column,line:i.line},{column:n.column,line:n.line},t)}return new i(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markClean(){this[s]=!0}markDirty(){if(this[s]){this[s]=!1;let e=this;for(;e=e.parent;)e[s]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let n="document"in this.source.input?this.source.input.document:this.source.input.css,i=n.slice(c(n,this.source.start),c(n,this.source.end)).indexOf(e.word);-1!==i&&(t=this.positionInside(i))}return t}positionInside(e){let t=this.source.start.column,n=this.source.start.line,i="document"in this.source.input?this.source.input.document:this.source.input.css,r=c(i,this.source.start),o=r+e;for(let e=r;e<o;e++)"\n"===i[e]?(t=1,n+=1):t+=1;return{column:t,line:n,offset:o}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,n={column:this.source.start.column,line:this.source.start.line,offset:c(t,this.source.start)},i=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:"number"==typeof this.source.end.offset?this.source.end.offset:c(t,this.source.end)+1}:{column:n.column+1,line:n.line,offset:n.offset+1};if(e.word){let r=t.slice(c(t,this.source.start),c(t,this.source.end)).indexOf(e.word);-1!==r&&(n=this.positionInside(r),i=this.positionInside(r+e.word.length))}else e.start?n={column:e.start.column,line:e.start.line,offset:c(t,e.start)}:e.index&&(n=this.positionInside(e.index)),e.end?i={column:e.end.column,line:e.end.line,offset:c(t,e.end)}:"number"==typeof e.endIndex?i=this.positionInside(e.endIndex):e.index&&(i=this.positionInside(e.index+1));return(i.line<n.line||i.line===n.line&&i.column<=n.column)&&(i={column:n.column+1,line:n.line,offset:n.offset+1}),{end:i,start:n}}raw(e,t){return(new r).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,n=!1;for(let i of e)i===this?n=!0:n?(this.parent.insertAfter(t,i),t=i):this.parent.insertBefore(t,i);n||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let n={},i=null==t;t=t||new Map;let r=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let i=this[e];if(Array.isArray(i))n[e]=i.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof i&&i.toJSON)n[e]=i.toJSON(null,t);else if("source"===e){if(null==i)continue;let o=t.get(i.input);null==o&&(o=r,t.set(i.input,r),r++),n[e]={end:i.end,inputId:o,start:i.start}}else n[e]=i}return i&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=o){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,n={}){let i={node:this};for(let e in n)i[e]=n[e];return e.warn(t,i)}}e.exports=u,u.default=u},40920(e,t,n){"use strict";let i=n(87952),r=n(39799),o=n(41616);function s(e,t){let n=new r(e,t),i=new o(n);try{i.parse()}catch(e){throw e}return i.root}e.exports=s,s.default=s,i.registerParse(s)},41616(e,t,n){"use strict";let i=n(81437),r=n(43794),o=n(83271),s=n(94707),a=n(90101),l=n(30346);const c={empty:!0,space:!0};e.exports=class{constructor(e){this.input=e,this.root=new s,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,n,r,o=new i;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);let s=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(r=l.length-1,n=l[r];n&&"space"===n[0];)n=l[--r];n&&(o.source.end=this.getPosition(n[3]||n[2]),o.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),s&&(e=l[l.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let n,i=0;for(let r=t-1;r>=0&&(n=e[r],"space"===n[0]||(i+=1,2!==i));r--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}colon(e){let t,n,i,r=0;for(let[o,s]of e.entries()){if(n=s,i=n[0],"("===i&&(r+=1),")"===i&&(r-=1),0===r&&":"===i){if(t){if("word"===t[0]&&"progid"===t[1])continue;return o}this.doubleColon(n)}t=n}return!1}comment(e){let t=new r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(n.trim()){let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}else t.text="",t.raws.left=n,t.raws.right=""}createTokenizer(){this.tokenizer=l(this.input)}decl(e,t){let n=new o;this.init(n,e[0][2]);let i,r=e[e.length-1];for(";"===r[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(r[3]||r[2]||function(e){for(let t=e.length-1;t>=0;t--){let n=e[t],i=n[3]||n[2];if(i)return i}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(i=e.shift(),":"===i[0]){n.raws.between+=i[1];break}"word"===i[0]&&/\w/.test(i[1])&&this.unknownWord([i]),n.raws.between+=i[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s,a=[];for(;e.length&&(s=e[0][0],"space"===s||"comment"===s);)a.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(i=e[t],"!important"===i[1].toLowerCase()){n.important=!0;let i=this.stringFrom(e,t);i=this.spacesFromEnd(e)+i," !important"!==i&&(n.raws.important=i);break}if("important"===i[1].toLowerCase()){let i=e.slice(0),r="";for(let e=t;e>0;e--){let t=i[e][0];if(r.trim().startsWith("!")&&"space"!==t)break;r=i.pop()[1]+r}r.trim().startsWith("!")&&(n.important=!0,n.raws.important=r,e=i)}if("space"!==i[0]&&"comment"!==i[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new a;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,n=null,i=!1,r=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(n=l[0],a.push(l),"("===n||"["===n)r||(r=l),o.push("("===n?")":"]");else if(s&&i&&"{"===n)r||(r=l),o.push("}");else if(0===o.length){if(";"===n){if(i)return void this.decl(a,s);break}if("{"===n)return void this.rule(a);if("}"===n){this.tokenizer.back(a.pop()),t=!0;break}":"===n&&(i=!0)}else n===o[o.length-1]&&(o.pop(),0===o.length&&(r=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(r),t&&i){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,i){let r,o,s,a,l=n.length,u="",d=!0;for(let e=0;e<l;e+=1)r=n[e],o=r[0],"space"!==o||e!==l-1||i?"comment"===o?(a=n[e-1]?n[e-1][0]:"empty",s=n[e+1]?n[e+1][0]:"empty",c[a]||c[s]||","===u.slice(-1)?d=!1:u+=r[1]):u+=r[1]:d=!1;if(!d){let i=n.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:i,value:u}}e[t]=u}rule(e){e.pop();let t=new a;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n="";for(let i=t;i<e.length;i++)n+=e[i][1];return e.splice(t,e.length-t),n}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word "+e[0][1],{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}},41637(e,t,n){"use strict";let{existsSync:i,readFileSync:r}=n(62876),{dirname:o,join:s}=n(54652),{SourceMapConsumer:a,SourceMapGenerator:l}=n(8437);class c{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,i=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=o(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new a(this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let n=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(n)return i=e.substr(n[0].length),Buffer?Buffer.from(i,"base64").toString():window.atob(i);var i;let r=e.slice(22);throw r=r.slice(0,r.indexOf(",")),new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/g);if(!t)return;let n=e.lastIndexOf(t.pop()),i=e.indexOf("*/",n);n>-1&&i>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,i)))}loadFile(e){if(this.root=o(e),i(e))return this.mapFile=e,r(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof a)return l.fromSourceMap(t).toString();if(t instanceof l)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let n=t(e);if(n){let e=this.loadFile(n);if(!e)throw new Error("Unable to load previous source map: "+n.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=s(o(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}e.exports=c,c.default=c},81951(e,t,n){"use strict";let i=n(93966),r=n(11887),o=n(36284),s=n(94707);class a{constructor(e=[]){this.version="8.5.10",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(!0===n.postcss?n=n():n.postcss&&(n=n.postcss),"object"==typeof n&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if("object"==typeof n&&n.postcssPlugin)t.push(n);else if("function"==typeof n)t.push(n);else if("object"!=typeof n||!n.parse&&!n.stringify)throw new Error(n+" is not a PostCSS plugin");return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new r(this,e,t):new o(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}e.exports=a,a.default=a,s.registerProcessor(a),i.registerProcessor(a)},20510(e,t,n){"use strict";let i=n(2015);class r{get content(){return this.css}constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css="",this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let n=new i(e,t);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}}e.exports=r,r.default=r},94707(e,t,n){"use strict";let i,r,o=n(87952);class s extends o{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,n){let i=super.normalize(e);if(t)if("prepend"===n)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of i)e.raws.before=t.raws.before;return i}removeChild(e,t){let n=this.index(e);return!t&&0===n&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new i(new r,this,e).stringify()}}s.registerLazyResult=e=>{i=e},s.registerProcessor=e=>{r=e},e.exports=s,s.default=s,o.registerRoot(s)},90101(e,t,n){"use strict";let i=n(87952),r=n(32003);class o extends i{get selectors(){return r.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}e.exports=o,o.default=o,i.registerRule(o)},3529(e){"use strict";const t=/(<)(\/?style\b)/gi,n=/(<)(!--)/g;function i(e){return"string"!=typeof e?e:e.includes("<")?e.replace(t,"\\3c $2").replace(n,"\\3c $2"):e}const r={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class o{constructor(e){this.builder=e}atrule(e,t){let n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes)this.block(e,n+r);else{let o=(e.raws.between||"")+(t?";":"");this.builder(i(n+r+o),e)}}beforeAfter(e,t){let n;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let i=e.parent,r=0;for(;i&&"root"!==i.type;)r+=1,i=i.parent;if(n.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<r;e++)n+=t}return n}block(e,t){let n,r=this.raw(e,"between","beforeOpen");this.builder(i(t+r)+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(i(n)),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let n=this.raw(e,"semicolon"),r="document"===e.type;for(let o=0;o<e.nodes.length;o++){let s=e.nodes[o],a=this.raw(s,"before");a&&this.builder(r?a:i(a)),this.stringify(s,t!==o||n)}}comment(e){let t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder(i("/*"+t+e.text+n+"*/"),e)}decl(e,t){let n=this.raw(e,"between","colon"),r=e.prop+n+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(i(r),e)}document(e){this.body(e)}raw(e,t,n){let i;if(n||(n=t),t&&(i=e.raws[t],void 0!==i))return i;let o=e.parent;if("before"===n){if(!o||"root"===o.type&&o.first===e)return"";if(o&&"document"===o.type)return""}if(!o)return r[n];let s=e.root();if(s.rawCache||(s.rawCache={}),void 0!==s.rawCache[n])return s.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(e,n);{let r="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[r]?i=this[r](s,e):s.walk(e=>{if(i=e.raws[t],void 0!==i)return!1})}var a;return void 0===i&&(i=r[n]),s.rawCache[n]=i,i}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let n;return e.walkComments(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(e,t){let n;return e.walkDecls(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return t=n.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(n=>{let i=n.parent;if(i&&i!==e&&i.parent&&i.parent===e&&void 0!==n.raws.before){let e=n.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let n=e[t],i=e.raws[t];return i&&i.value===n?i.raw:n}root(e){if(this.body(e),e.raws.after){let t=e.raws.after,n=e.parent&&"document"===e.parent.type;this.builder(n?t:i(t))}}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(i(e.raws.ownSemicolon),e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}e.exports=o,o.default=o},99734(e,t,n){"use strict";let i=n(3529);function r(e,t){new i(t).stringify(e)}e.exports=r,r.default=r},22450(e){"use strict";e.exports.isClean=Symbol("isClean"),e.exports.my=Symbol("my")},30346(e){"use strict";const t="'".charCodeAt(0),n='"'.charCodeAt(0),i="\\".charCodeAt(0),r="/".charCodeAt(0),o="\n".charCodeAt(0),s=" ".charCodeAt(0),a="\f".charCodeAt(0),l="\t".charCodeAt(0),c="\r".charCodeAt(0),u="[".charCodeAt(0),d="]".charCodeAt(0),h="(".charCodeAt(0),p=")".charCodeAt(0),f="{".charCodeAt(0),m="}".charCodeAt(0),g=";".charCodeAt(0),b="*".charCodeAt(0),y=":".charCodeAt(0),v="@".charCodeAt(0),_=/[\t\n\f\r "#'()/;[\\\]{}]/g,x=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,k=/.[\r\n"'(/\\]/,w=/[\da-f]/i;e.exports=function(e,C={}){let S,A,I,E,j,T,B,N,R,O,L=e.css.valueOf(),M=C.ignoreErrors,P=L.length,D=0,F=[],z=[];function V(t){throw e.error("Unclosed "+t,D)}return{back:function(e){z.push(e)},endOfFile:function(){return 0===z.length&&D>=P},nextToken:function(e){if(z.length)return z.pop();if(D>=P)return;let C=!!e&&e.ignoreUnclosed;switch(S=L.charCodeAt(D),S){case o:case s:case l:case c:case a:E=D;do{E+=1,S=L.charCodeAt(E)}while(S===s||S===o||S===l||S===c||S===a);T=["space",L.slice(D,E)],D=E-1;break;case u:case d:case f:case m:case y:case g:case p:{let e=String.fromCharCode(S);T=[e,e,D];break}case h:if(O=F.length?F.pop()[1]:"",R=L.charCodeAt(D+1),"url"===O&&R!==t&&R!==n&&R!==s&&R!==o&&R!==l&&R!==a&&R!==c){E=D;do{if(B=!1,E=L.indexOf(")",E+1),-1===E){if(M||C){E=D;break}V("bracket")}for(N=E;L.charCodeAt(N-1)===i;)N-=1,B=!B}while(B);T=["brackets",L.slice(D,E+1),D,E],D=E}else E=L.indexOf(")",D+1),A=L.slice(D,E+1),-1===E||k.test(A)?T=["(","(",D]:(T=["brackets",A,D,E],D=E);break;case t:case n:j=S===t?"'":'"',E=D;do{if(B=!1,E=L.indexOf(j,E+1),-1===E){if(M||C){E=D+1;break}V("string")}for(N=E;L.charCodeAt(N-1)===i;)N-=1,B=!B}while(B);T=["string",L.slice(D,E+1),D,E],D=E;break;case v:_.lastIndex=D+1,_.test(L),E=0===_.lastIndex?L.length-1:_.lastIndex-2,T=["at-word",L.slice(D,E+1),D,E],D=E;break;case i:for(E=D,I=!0;L.charCodeAt(E+1)===i;)E+=1,I=!I;if(S=L.charCodeAt(E+1),I&&S!==r&&S!==s&&S!==o&&S!==l&&S!==c&&S!==a&&(E+=1,w.test(L.charAt(E)))){for(;w.test(L.charAt(E+1));)E+=1;L.charCodeAt(E+1)===s&&(E+=1)}T=["word",L.slice(D,E+1),D,E],D=E;break;default:S===r&&L.charCodeAt(D+1)===b?(E=L.indexOf("*/",D+2)+1,0===E&&(M||C?E=L.length:V("comment")),T=["comment",L.slice(D,E+1),D,E],D=E):(x.lastIndex=D+1,x.test(L),E=0===x.lastIndex?L.length-1:x.lastIndex-2,T=["word",L.slice(D,E+1),D,E],F.push(T),D=E)}return D++,T},position:function(){return D}}}},38605(e){"use strict";let t={};e.exports=function(e){t[e]||(t[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}},2015(e){"use strict";class t{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}e.exports=t,t.default=t},89738(e,t,n){var i;e=n.nmd(e),function(){t&&t.nodeType,e&&e.nodeType;var r="object"==typeof globalThis&&globalThis;r.global!==r&&r.window!==r&&r.self;var o,s=2147483647,a=36,l=/^xn--/,c=/[^\x20-\x7E]/,u=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=Math.floor,p=String.fromCharCode;function f(e){throw new RangeError(d[e])}function m(e,t){for(var n=e.length,i=[];n--;)i[n]=t(e[n]);return i}function g(e,t){var n=e.split("@"),i="";return n.length>1&&(i=n[0]+"@",e=n[1]),i+m((e=e.replace(u,".")).split("."),t).join(".")}function b(e){for(var t,n,i=[],r=0,o=e.length;r<o;)(t=e.charCodeAt(r++))>=55296&&t<=56319&&r<o?56320==(64512&(n=e.charCodeAt(r++)))?i.push(((1023&t)<<10)+(1023&n)+65536):(i.push(t),r--):i.push(t);return i}function y(e){return m(e,function(e){var t="";return e>65535&&(t+=p((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+p(e)}).join("")}function v(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:a}function _(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function x(e,t,n){var i=0;for(e=n?h(e/700):e>>1,e+=h(e/t);e>455;i+=a)e=h(e/35);return h(i+36*e/(e+38))}function k(e){var t,n,i,r,o,l,c,u,d,p,m=[],g=e.length,b=0,_=128,k=72;for((n=e.lastIndexOf("-"))<0&&(n=0),i=0;i<n;++i)e.charCodeAt(i)>=128&&f("not-basic"),m.push(e.charCodeAt(i));for(r=n>0?n+1:0;r<g;){for(o=b,l=1,c=a;r>=g&&f("invalid-input"),((u=v(e.charCodeAt(r++)))>=a||u>h((s-b)/l))&&f("overflow"),b+=u*l,!(u<(d=c<=k?1:c>=k+26?26:c-k));c+=a)l>h(s/(p=a-d))&&f("overflow"),l*=p;k=x(b-o,t=m.length+1,0==o),h(b/t)>s-_&&f("overflow"),_+=h(b/t),b%=t,m.splice(b++,0,_)}return y(m)}function w(e){var t,n,i,r,o,l,c,u,d,m,g,y,v,k,w,C=[];for(y=(e=b(e)).length,t=128,n=0,o=72,l=0;l<y;++l)(g=e[l])<128&&C.push(p(g));for(i=r=C.length,r&&C.push("-");i<y;){for(c=s,l=0;l<y;++l)(g=e[l])>=t&&g<c&&(c=g);for(c-t>h((s-n)/(v=i+1))&&f("overflow"),n+=(c-t)*v,t=c,l=0;l<y;++l)if((g=e[l])<t&&++n>s&&f("overflow"),g==t){for(u=n,d=a;!(u<(m=d<=o?1:d>=o+26?26:d-o));d+=a)w=u-m,k=a-m,C.push(p(_(m+w%k,0))),u=h(w/k);C.push(p(_(u,0))),o=x(n,v,i==r),n=0,++i}++n,++t}return C.join("")}o={version:"1.4.1",ucs2:{decode:b,encode:y},decode:k,encode:w,toASCII:function(e){return g(e,function(e){return c.test(e)?"xn--"+w(e):e})},toUnicode:function(e){return g(e,function(e){return l.test(e)?k(e.slice(4).toLowerCase()):e})}},void 0===(i=function(){return o}.call(t,n,t,e))||(e.exports=i)}()},74354(e,t,n){"use strict";var i,r=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},s=this&&this.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&(n[i[r]]=e[i[r]])}return n};t.__esModule=!0;var a=n(7378),l=n(23108),c=n(48198),u=n(49781),d="autosize:resized",h=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return r(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.maxRows,i=t.async;"number"==typeof n&&this.updateLineHeight(),"number"==typeof n||i?setTimeout(function(){return e.textarea&&c(e.textarea)}):this.textarea&&c(this.textarea),this.textarea&&this.textarea.addEventListener(d,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(d,this.onResize),c.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,n=(t.onResize,t.maxRows),i=(t.onChange,t.style),r=(t.innerRef,t.children),l=s(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return a.createElement("textarea",o({},l,{onChange:this.onChange,style:u?o({},i,{maxHeight:u}):i,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),r)},t.prototype.componentDidUpdate=function(){this.textarea&&c.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:l.number,maxRows:l.number,onResize:l.func,innerRef:l.any,async:l.bool},t}(a.Component);t.TextareaAutosize=a.forwardRef(function(e,t){return a.createElement(h,o({},e,{innerRef:t}))})},90552(e,t,n){"use strict";t.__esModule=!0;var i=n(74354);t.default=i.TextareaAutosize},16588(e,t){"use strict";Symbol.for("react.element"),Symbol.for("react.portal");var n,i=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=(Symbol.for("react.server_context"),Symbol.for("react.forward_ref")),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen");n=Symbol.for("react.module.reference"),t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===o||e===r||e===c||e===u||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===d||e.$$typeof===s||e.$$typeof===a||e.$$typeof===l||e.$$typeof===n||void 0!==e.getModuleId)}},74448(e,t,n){"use strict";e.exports=n(16588)},49482(e,t,n){var i;(function(){function r(e){"use strict";var t={omitExtraWLInCodeBlocks:{defaultValue:!1,describe:"Omit the default extra whiteline added to code blocks",type:"boolean"},noHeaderId:{defaultValue:!1,describe:"Turn on/off generated header id",type:"boolean"},prefixHeaderId:{defaultValue:!1,describe:"Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",type:"string"},rawPrefixHeaderId:{defaultValue:!1,describe:'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',type:"boolean"},ghCompatibleHeaderId:{defaultValue:!1,describe:"Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",type:"boolean"},rawHeaderId:{defaultValue:!1,describe:"Remove only spaces, ' and \" from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids",type:"boolean"},headerLevelStart:{defaultValue:!1,describe:"The header blocks level start",type:"integer"},parseImgDimensions:{defaultValue:!1,describe:"Turn on/off image dimension parsing",type:"boolean"},simplifiedAutoLink:{defaultValue:!1,describe:"Turn on/off GFM autolink style",type:"boolean"},excludeTrailingPunctuationFromURLs:{defaultValue:!1,describe:"Excludes trailing punctuation from links generated with autoLinking",type:"boolean"},literalMidWordUnderscores:{defaultValue:!1,describe:"Parse midword underscores as literal underscores",type:"boolean"},literalMidWordAsterisks:{defaultValue:!1,describe:"Parse midword asterisks as literal asterisks",type:"boolean"},strikethrough:{defaultValue:!1,describe:"Turn on/off strikethrough support",type:"boolean"},tables:{defaultValue:!1,describe:"Turn on/off tables support",type:"boolean"},tablesHeaderId:{defaultValue:!1,describe:"Add an id to table headers",type:"boolean"},ghCodeBlocks:{defaultValue:!0,describe:"Turn on/off GFM fenced code blocks support",type:"boolean"},tasklists:{defaultValue:!1,describe:"Turn on/off GFM tasklist support",type:"boolean"},smoothLivePreview:{defaultValue:!1,describe:"Prevents weird effects in live previews due to incomplete input",type:"boolean"},smartIndentationFix:{defaultValue:!1,description:"Tries to smartly fix indentation in es6 strings",type:"boolean"},disableForced4SpacesIndentedSublists:{defaultValue:!1,description:"Disables the requirement of indenting nested sublists by 4 spaces",type:"boolean"},simpleLineBreaks:{defaultValue:!1,description:"Parses simple line breaks as <br> (GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,description:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,description:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",description:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,description:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,description:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,description:"Support for HTML Tag escaping. ex: <div>foo</div>",type:"boolean"},emoji:{defaultValue:!1,description:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,description:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `<em>` and `<strong>`",type:"boolean"},completeHTMLDocument:{defaultValue:!1,description:"Outputs a complete html document, including `<html>`, `<head>` and `<body>` tags",type:"boolean"},metadata:{defaultValue:!1,description:"Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).",type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,description:"Split adjacent blockquote blocks",type:"boolean"}};if(!1===e)return JSON.parse(JSON.stringify(t));var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i].defaultValue);return n}var o={},s={},a={},l=r(!0),c="vanilla",u={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:r(!0),allOn:function(){"use strict";var e=r(!0),t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=!0);return t}()};function d(e,t){"use strict";var n=t?"Error in "+t+" extension->":"Error in unnamed extension",i={valid:!0,error:""};o.helper.isArray(e)||(e=[e]);for(var r=0;r<e.length;++r){var s=n+" sub-extension "+r+": ",a=e[r];if("object"!=typeof a)return i.valid=!1,i.error=s+"must be an object, but "+typeof a+" given",i;if(!o.helper.isString(a.type))return i.valid=!1,i.error=s+'property "type" must be a string, but '+typeof a.type+" given",i;var l=a.type=a.type.toLowerCase();if("language"===l&&(l=a.type="lang"),"html"===l&&(l=a.type="output"),"lang"!==l&&"output"!==l&&"listener"!==l)return i.valid=!1,i.error=s+"type "+l+' is not recognized. Valid values: "lang/language", "output/html" or "listener"',i;if("listener"===l){if(o.helper.isUndefined(a.listeners))return i.valid=!1,i.error=s+'. Extensions of type "listener" must have a property called "listeners"',i}else if(o.helper.isUndefined(a.filter)&&o.helper.isUndefined(a.regex))return i.valid=!1,i.error=s+l+' extensions must define either a "regex" property or a "filter" method',i;if(a.listeners){if("object"!=typeof a.listeners)return i.valid=!1,i.error=s+'"listeners" property must be an object but '+typeof a.listeners+" given",i;for(var c in a.listeners)if(a.listeners.hasOwnProperty(c)&&"function"!=typeof a.listeners[c])return i.valid=!1,i.error=s+'"listeners" property must be an hash of [event name]: [callback]. listeners.'+c+" must be a function but "+typeof a.listeners[c]+" given",i}if(a.filter){if("function"!=typeof a.filter)return i.valid=!1,i.error=s+'"filter" must be a function, but '+typeof a.filter+" given",i}else if(a.regex){if(o.helper.isString(a.regex)&&(a.regex=new RegExp(a.regex,"g")),!(a.regex instanceof RegExp))return i.valid=!1,i.error=s+'"regex" property must either be a string or a RegExp object, but '+typeof a.regex+" given",i;if(o.helper.isUndefined(a.replace))return i.valid=!1,i.error=s+'"regex" extensions must implement a replace string or function',i}}return i}function h(e,t){"use strict";return"¨E"+t.charCodeAt(0)+"E"}o.helper={},o.extensions={},o.setOption=function(e,t){"use strict";return l[e]=t,this},o.getOption=function(e){"use strict";return l[e]},o.getOptions=function(){"use strict";return l},o.resetOptions=function(){"use strict";l=r(!0)},o.setFlavor=function(e){"use strict";if(!u.hasOwnProperty(e))throw Error(e+" flavor was not found");o.resetOptions();var t=u[e];for(var n in c=e,t)t.hasOwnProperty(n)&&(l[n]=t[n])},o.getFlavor=function(){"use strict";return c},o.getFlavorOptions=function(e){"use strict";if(u.hasOwnProperty(e))return u[e]},o.getDefaultOptions=function(e){"use strict";return r(e)},o.subParser=function(e,t){"use strict";if(o.helper.isString(e)){if(void 0===t){if(s.hasOwnProperty(e))return s[e];throw Error("SubParser named "+e+" not registered!")}s[e]=t}},o.extension=function(e,t){"use strict";if(!o.helper.isString(e))throw Error("Extension 'name' must be a string");if(e=o.helper.stdExtName(e),o.helper.isUndefined(t)){if(!a.hasOwnProperty(e))throw Error("Extension named "+e+" is not registered!");return a[e]}"function"==typeof t&&(t=t()),o.helper.isArray(t)||(t=[t]);var n=d(t,e);if(!n.valid)throw Error(n.error);a[e]=t},o.getAllExtensions=function(){"use strict";return a},o.removeExtension=function(e){"use strict";delete a[e]},o.resetExtensions=function(){"use strict";a={}},o.validateExtension=function(e){"use strict";var t=d(e,null);return!!t.valid||(console.warn(t.error),!1)},o.hasOwnProperty("helper")||(o.helper={}),o.helper.isString=function(e){"use strict";return"string"==typeof e||e instanceof String},o.helper.isFunction=function(e){"use strict";return e&&"[object Function]"==={}.toString.call(e)},o.helper.isArray=function(e){"use strict";return Array.isArray(e)},o.helper.isUndefined=function(e){"use strict";return void 0===e},o.helper.forEach=function(e,t){"use strict";if(o.helper.isUndefined(e))throw new Error("obj param is required");if(o.helper.isUndefined(t))throw new Error("callback param is required");if(!o.helper.isFunction(t))throw new Error("callback param must be a function/closure");if("function"==typeof e.forEach)e.forEach(t);else if(o.helper.isArray(e))for(var n=0;n<e.length;n++)t(e[n],n,e);else{if("object"!=typeof e)throw new Error("obj does not seem to be an array or an iterable object");for(var i in e)e.hasOwnProperty(i)&&t(e[i],i,e)}},o.helper.stdExtName=function(e){"use strict";return e.replace(/[_?*+\/\\.^-]/g,"").replace(/\s/g,"").toLowerCase()},o.helper.escapeCharactersCallback=h,o.helper.escapeCharacters=function(e,t,n){"use strict";var i="(["+t.replace(/([\[\]\\])/g,"\\$1")+"])";n&&(i="\\\\"+i);var r=new RegExp(i,"g");return e.replace(r,h)},o.helper.unescapeHTMLEntities=function(e){"use strict";return e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")};var p=function(e,t,n,i){"use strict";var r,o,s,a,l,c=i||"",u=c.indexOf("g")>-1,d=new RegExp(t+"|"+n,"g"+c.replace(/g/g,"")),h=new RegExp(t,c.replace(/g/g,"")),p=[];do{for(r=0;s=d.exec(e);)if(h.test(s[0]))r++||(a=(o=d.lastIndex)-s[0].length);else if(r&&! --r){l=s.index+s[0].length;var f={left:{start:a,end:o},match:{start:o,end:s.index},right:{start:s.index,end:l},wholeMatch:{start:a,end:l}};if(p.push(f),!u)return p}}while(r&&(d.lastIndex=o));return p};o.helper.matchRecursiveRegExp=function(e,t,n,i){"use strict";for(var r=p(e,t,n,i),o=[],s=0;s<r.length;++s)o.push([e.slice(r[s].wholeMatch.start,r[s].wholeMatch.end),e.slice(r[s].match.start,r[s].match.end),e.slice(r[s].left.start,r[s].left.end),e.slice(r[s].right.start,r[s].right.end)]);return o},o.helper.replaceRecursiveRegExp=function(e,t,n,i,r){"use strict";if(!o.helper.isFunction(t)){var s=t;t=function(){return s}}var a=p(e,n,i,r),l=e,c=a.length;if(c>0){var u=[];0!==a[0].wholeMatch.start&&u.push(e.slice(0,a[0].wholeMatch.start));for(var d=0;d<c;++d)u.push(t(e.slice(a[d].wholeMatch.start,a[d].wholeMatch.end),e.slice(a[d].match.start,a[d].match.end),e.slice(a[d].left.start,a[d].left.end),e.slice(a[d].right.start,a[d].right.end))),d<c-1&&u.push(e.slice(a[d].wholeMatch.end,a[d+1].wholeMatch.start));a[c-1].wholeMatch.end<e.length&&u.push(e.slice(a[c-1].wholeMatch.end)),l=u.join("")}return l},o.helper.regexIndexOf=function(e,t,n){"use strict";if(!o.helper.isString(e))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";if(t instanceof RegExp==0)throw"InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp";var i=e.substring(n||0).search(t);return i>=0?i+(n||0):i},o.helper.splitAtIndex=function(e,t){"use strict";if(!o.helper.isString(e))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[e.substring(0,t),e.substring(t)]},o.helper.encodeEmailAddress=function(e){"use strict";var t=[function(e){return"&#"+e.charCodeAt(0)+";"},function(e){return"&#x"+e.charCodeAt(0).toString(16)+";"},function(e){return e}];return e.replace(/./g,function(e){if("@"===e)e=t[Math.floor(2*Math.random())](e);else{var n=Math.random();e=n>.9?t[2](e):n>.45?t[1](e):t[0](e)}return e})},o.helper.padEnd=function(e,t,n){"use strict";return t|=0,n=String(n||" "),e.length>t?String(e):((t-=e.length)>n.length&&(n+=n.repeat(t/n.length)),String(e)+n.slice(0,t))},"undefined"==typeof console&&(console={warn:function(e){"use strict";alert(e)},log:function(e){"use strict";alert(e)},error:function(e){"use strict";throw e}}),o.helper.regexes={asteriskDashAndColon:/([*_:~])/g},o.helper.emojis={"+1":"👍","-1":"👎",100:"💯",1234:"🔢","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉","8ball":"🎱",a:"🅰️",ab:"🆎",abc:"🔤",abcd:"🔡",accept:"🉑",aerial_tramway:"🚡",airplane:"✈️",alarm_clock:"⏰",alembic:"⚗️",alien:"👽",ambulance:"🚑",amphora:"🏺",anchor:"⚓️",angel:"👼",anger:"💢",angry:"😠",anguished:"😧",ant:"🐜",apple:"🍎",aquarius:"♒️",aries:"♈️",arrow_backward:"◀️",arrow_double_down:"⏬",arrow_double_up:"⏫",arrow_down:"⬇️",arrow_down_small:"🔽",arrow_forward:"▶️",arrow_heading_down:"⤵️",arrow_heading_up:"⤴️",arrow_left:"⬅️",arrow_lower_left:"↙️",arrow_lower_right:"↘️",arrow_right:"➡️",arrow_right_hook:"↪️",arrow_up:"⬆️",arrow_up_down:"↕️",arrow_up_small:"🔼",arrow_upper_left:"↖️",arrow_upper_right:"↗️",arrows_clockwise:"🔃",arrows_counterclockwise:"🔄",art:"🎨",articulated_lorry:"🚛",artificial_satellite:"🛰",astonished:"😲",athletic_shoe:"👟",atm:"🏧",atom_symbol:"⚛️",avocado:"🥑",b:"🅱️",baby:"👶",baby_bottle:"🍼",baby_chick:"🐤",baby_symbol:"🚼",back:"🔙",bacon:"🥓",badminton:"🏸",baggage_claim:"🛄",baguette_bread:"🥖",balance_scale:"⚖️",balloon:"🎈",ballot_box:"🗳",ballot_box_with_check:"☑️",bamboo:"🎍",banana:"🍌",bangbang:"‼️",bank:"🏦",bar_chart:"📊",barber:"💈",baseball:"⚾️",basketball:"🏀",basketball_man:"⛹️",basketball_woman:"⛹️‍♀️",bat:"🦇",bath:"🛀",bathtub:"🛁",battery:"🔋",beach_umbrella:"🏖",bear:"🐻",bed:"🛏",bee:"🐝",beer:"🍺",beers:"🍻",beetle:"🐞",beginner:"🔰",bell:"🔔",bellhop_bell:"🛎",bento:"🍱",biking_man:"🚴",bike:"🚲",biking_woman:"🚴‍♀️",bikini:"👙",biohazard:"☣️",bird:"🐦",birthday:"🎂",black_circle:"⚫️",black_flag:"🏴",black_heart:"🖤",black_joker:"🃏",black_large_square:"⬛️",black_medium_small_square:"◾️",black_medium_square:"◼️",black_nib:"✒️",black_small_square:"▪️",black_square_button:"🔲",blonde_man:"👱",blonde_woman:"👱‍♀️",blossom:"🌼",blowfish:"🐡",blue_book:"📘",blue_car:"🚙",blue_heart:"💙",blush:"😊",boar:"🐗",boat:"⛵️",bomb:"💣",book:"📖",bookmark:"🔖",bookmark_tabs:"📑",books:"📚",boom:"💥",boot:"👢",bouquet:"💐",bowing_man:"🙇",bow_and_arrow:"🏹",bowing_woman:"🙇‍♀️",bowling:"🎳",boxing_glove:"🥊",boy:"👦",bread:"🍞",bride_with_veil:"👰",bridge_at_night:"🌉",briefcase:"💼",broken_heart:"💔",bug:"🐛",building_construction:"🏗",bulb:"💡",bullettrain_front:"🚅",bullettrain_side:"🚄",burrito:"🌯",bus:"🚌",business_suit_levitating:"🕴",busstop:"🚏",bust_in_silhouette:"👤",busts_in_silhouette:"👥",butterfly:"🦋",cactus:"🌵",cake:"🍰",calendar:"📆",call_me_hand:"🤙",calling:"📲",camel:"🐫",camera:"📷",camera_flash:"📸",camping:"🏕",cancer:"♋️",candle:"🕯",candy:"🍬",canoe:"🛶",capital_abcd:"🔠",capricorn:"♑️",car:"🚗",card_file_box:"🗃",card_index:"📇",card_index_dividers:"🗂",carousel_horse:"🎠",carrot:"🥕",cat:"🐱",cat2:"🐈",cd:"💿",chains:"⛓",champagne:"🍾",chart:"💹",chart_with_downwards_trend:"📉",chart_with_upwards_trend:"📈",checkered_flag:"🏁",cheese:"🧀",cherries:"🍒",cherry_blossom:"🌸",chestnut:"🌰",chicken:"🐔",children_crossing:"🚸",chipmunk:"🐿",chocolate_bar:"🍫",christmas_tree:"🎄",church:"⛪️",cinema:"🎦",circus_tent:"🎪",city_sunrise:"🌇",city_sunset:"🌆",cityscape:"🏙",cl:"🆑",clamp:"🗜",clap:"👏",clapper:"🎬",classical_building:"🏛",clinking_glasses:"🥂",clipboard:"📋",clock1:"🕐",clock10:"🕙",clock1030:"🕥",clock11:"🕚",clock1130:"🕦",clock12:"🕛",clock1230:"🕧",clock130:"🕜",clock2:"🕑",clock230:"🕝",clock3:"🕒",clock330:"🕞",clock4:"🕓",clock430:"🕟",clock5:"🕔",clock530:"🕠",clock6:"🕕",clock630:"🕡",clock7:"🕖",clock730:"🕢",clock8:"🕗",clock830:"🕣",clock9:"🕘",clock930:"🕤",closed_book:"📕",closed_lock_with_key:"🔐",closed_umbrella:"🌂",cloud:"☁️",cloud_with_lightning:"🌩",cloud_with_lightning_and_rain:"⛈",cloud_with_rain:"🌧",cloud_with_snow:"🌨",clown_face:"🤡",clubs:"♣️",cocktail:"🍸",coffee:"☕️",coffin:"⚰️",cold_sweat:"😰",comet:"☄️",computer:"💻",computer_mouse:"🖱",confetti_ball:"🎊",confounded:"😖",confused:"😕",congratulations:"㊗️",construction:"🚧",construction_worker_man:"👷",construction_worker_woman:"👷‍♀️",control_knobs:"🎛",convenience_store:"🏪",cookie:"🍪",cool:"🆒",policeman:"👮",copyright:"©️",corn:"🌽",couch_and_lamp:"🛋",couple:"👫",couple_with_heart_woman_man:"💑",couple_with_heart_man_man:"👨‍❤️‍👨",couple_with_heart_woman_woman:"👩‍❤️‍👩",couplekiss_man_man:"👨‍❤️‍💋‍👨",couplekiss_man_woman:"💏",couplekiss_woman_woman:"👩‍❤️‍💋‍👩",cow:"🐮",cow2:"🐄",cowboy_hat_face:"🤠",crab:"🦀",crayon:"🖍",credit_card:"💳",crescent_moon:"🌙",cricket:"🏏",crocodile:"🐊",croissant:"🥐",crossed_fingers:"🤞",crossed_flags:"🎌",crossed_swords:"⚔️",crown:"👑",cry:"😢",crying_cat_face:"😿",crystal_ball:"🔮",cucumber:"🥒",cupid:"💘",curly_loop:"➰",currency_exchange:"💱",curry:"🍛",custard:"🍮",customs:"🛃",cyclone:"🌀",dagger:"🗡",dancer:"💃",dancing_women:"👯",dancing_men:"👯‍♂️",dango:"🍡",dark_sunglasses:"🕶",dart:"🎯",dash:"💨",date:"📅",deciduous_tree:"🌳",deer:"🦌",department_store:"🏬",derelict_house:"🏚",desert:"🏜",desert_island:"🏝",desktop_computer:"🖥",male_detective:"🕵️",diamond_shape_with_a_dot_inside:"💠",diamonds:"♦️",disappointed:"😞",disappointed_relieved:"😥",dizzy:"💫",dizzy_face:"😵",do_not_litter:"🚯",dog:"🐶",dog2:"🐕",dollar:"💵",dolls:"🎎",dolphin:"🐬",door:"🚪",doughnut:"🍩",dove:"🕊",dragon:"🐉",dragon_face:"🐲",dress:"👗",dromedary_camel:"🐪",drooling_face:"🤤",droplet:"💧",drum:"🥁",duck:"🦆",dvd:"📀","e-mail":"📧",eagle:"🦅",ear:"👂",ear_of_rice:"🌾",earth_africa:"🌍",earth_americas:"🌎",earth_asia:"🌏",egg:"🥚",eggplant:"🍆",eight_pointed_black_star:"✴️",eight_spoked_asterisk:"✳️",electric_plug:"🔌",elephant:"🐘",email:"✉️",end:"🔚",envelope_with_arrow:"📩",euro:"💶",european_castle:"🏰",european_post_office:"🏤",evergreen_tree:"🌲",exclamation:"❗️",expressionless:"😑",eye:"👁",eye_speech_bubble:"👁‍🗨",eyeglasses:"👓",eyes:"👀",face_with_head_bandage:"🤕",face_with_thermometer:"🤒",fist_oncoming:"👊",factory:"🏭",fallen_leaf:"🍂",family_man_woman_boy:"👪",family_man_boy:"👨‍👦",family_man_boy_boy:"👨‍👦‍👦",family_man_girl:"👨‍👧",family_man_girl_boy:"👨‍👧‍👦",family_man_girl_girl:"👨‍👧‍👧",family_man_man_boy:"👨‍👨‍👦",family_man_man_boy_boy:"👨‍👨‍👦‍👦",family_man_man_girl:"👨‍👨‍👧",family_man_man_girl_boy:"👨‍👨‍👧‍👦",family_man_man_girl_girl:"👨‍👨‍👧‍👧",family_man_woman_boy_boy:"👨‍👩‍👦‍👦",family_man_woman_girl:"👨‍👩‍👧",family_man_woman_girl_boy:"👨‍👩‍👧‍👦",family_man_woman_girl_girl:"👨‍👩‍👧‍👧",family_woman_boy:"👩‍👦",family_woman_boy_boy:"👩‍👦‍👦",family_woman_girl:"👩‍👧",family_woman_girl_boy:"👩‍👧‍👦",family_woman_girl_girl:"👩‍👧‍👧",family_woman_woman_boy:"👩‍👩‍👦",family_woman_woman_boy_boy:"👩‍👩‍👦‍👦",family_woman_woman_girl:"👩‍👩‍👧",family_woman_woman_girl_boy:"👩‍👩‍👧‍👦",family_woman_woman_girl_girl:"👩‍👩‍👧‍👧",fast_forward:"⏩",fax:"📠",fearful:"😨",feet:"🐾",female_detective:"🕵️‍♀️",ferris_wheel:"🎡",ferry:"⛴",field_hockey:"🏑",file_cabinet:"🗄",file_folder:"📁",film_projector:"📽",film_strip:"🎞",fire:"🔥",fire_engine:"🚒",fireworks:"🎆",first_quarter_moon:"🌓",first_quarter_moon_with_face:"🌛",fish:"🐟",fish_cake:"🍥",fishing_pole_and_fish:"🎣",fist_raised:"✊",fist_left:"🤛",fist_right:"🤜",flags:"🎏",flashlight:"🔦",fleur_de_lis:"⚜️",flight_arrival:"🛬",flight_departure:"🛫",floppy_disk:"💾",flower_playing_cards:"🎴",flushed:"😳",fog:"🌫",foggy:"🌁",football:"🏈",footprints:"👣",fork_and_knife:"🍴",fountain:"⛲️",fountain_pen:"🖋",four_leaf_clover:"🍀",fox_face:"🦊",framed_picture:"🖼",free:"🆓",fried_egg:"🍳",fried_shrimp:"🍤",fries:"🍟",frog:"🐸",frowning:"😦",frowning_face:"☹️",frowning_man:"🙍‍♂️",frowning_woman:"🙍",middle_finger:"🖕",fuelpump:"⛽️",full_moon:"🌕",full_moon_with_face:"🌝",funeral_urn:"⚱️",game_die:"🎲",gear:"⚙️",gem:"💎",gemini:"♊️",ghost:"👻",gift:"🎁",gift_heart:"💝",girl:"👧",globe_with_meridians:"🌐",goal_net:"🥅",goat:"🐐",golf:"⛳️",golfing_man:"🏌️",golfing_woman:"🏌️‍♀️",gorilla:"🦍",grapes:"🍇",green_apple:"🍏",green_book:"📗",green_heart:"💚",green_salad:"🥗",grey_exclamation:"❕",grey_question:"❔",grimacing:"😬",grin:"😁",grinning:"😀",guardsman:"💂",guardswoman:"💂‍♀️",guitar:"🎸",gun:"🔫",haircut_woman:"💇",haircut_man:"💇‍♂️",hamburger:"🍔",hammer:"🔨",hammer_and_pick:"⚒",hammer_and_wrench:"🛠",hamster:"🐹",hand:"✋",handbag:"👜",handshake:"🤝",hankey:"💩",hatched_chick:"🐥",hatching_chick:"🐣",headphones:"🎧",hear_no_evil:"🙉",heart:"❤️",heart_decoration:"💟",heart_eyes:"😍",heart_eyes_cat:"😻",heartbeat:"💓",heartpulse:"💗",hearts:"♥️",heavy_check_mark:"✔️",heavy_division_sign:"➗",heavy_dollar_sign:"💲",heavy_heart_exclamation:"❣️",heavy_minus_sign:"➖",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",helicopter:"🚁",herb:"🌿",hibiscus:"🌺",high_brightness:"🔆",high_heel:"👠",hocho:"🔪",hole:"🕳",honey_pot:"🍯",horse:"🐴",horse_racing:"🏇",hospital:"🏥",hot_pepper:"🌶",hotdog:"🌭",hotel:"🏨",hotsprings:"♨️",hourglass:"⌛️",hourglass_flowing_sand:"⏳",house:"🏠",house_with_garden:"🏡",houses:"🏘",hugs:"🤗",hushed:"😯",ice_cream:"🍨",ice_hockey:"🏒",ice_skate:"⛸",icecream:"🍦",id:"🆔",ideograph_advantage:"🉐",imp:"👿",inbox_tray:"📥",incoming_envelope:"📨",tipping_hand_woman:"💁",information_source:"ℹ️",innocent:"😇",interrobang:"⁉️",iphone:"📱",izakaya_lantern:"🏮",jack_o_lantern:"🎃",japan:"🗾",japanese_castle:"🏯",japanese_goblin:"👺",japanese_ogre:"👹",jeans:"👖",joy:"😂",joy_cat:"😹",joystick:"🕹",kaaba:"🕋",key:"🔑",keyboard:"⌨️",keycap_ten:"🔟",kick_scooter:"🛴",kimono:"👘",kiss:"💋",kissing:"😗",kissing_cat:"😽",kissing_closed_eyes:"😚",kissing_heart:"😘",kissing_smiling_eyes:"😙",kiwi_fruit:"🥝",koala:"🐨",koko:"🈁",label:"🏷",large_blue_circle:"🔵",large_blue_diamond:"🔷",large_orange_diamond:"🔶",last_quarter_moon:"🌗",last_quarter_moon_with_face:"🌜",latin_cross:"✝️",laughing:"😆",leaves:"🍃",ledger:"📒",left_luggage:"🛅",left_right_arrow:"↔️",leftwards_arrow_with_hook:"↩️",lemon:"🍋",leo:"♌️",leopard:"🐆",level_slider:"🎚",libra:"♎️",light_rail:"🚈",link:"🔗",lion:"🦁",lips:"👄",lipstick:"💄",lizard:"🦎",lock:"🔒",lock_with_ink_pen:"🔏",lollipop:"🍭",loop:"➿",loud_sound:"🔊",loudspeaker:"📢",love_hotel:"🏩",love_letter:"💌",low_brightness:"🔅",lying_face:"🤥",m:"Ⓜ️",mag:"🔍",mag_right:"🔎",mahjong:"🀄️",mailbox:"📫",mailbox_closed:"📪",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",man:"👨",man_artist:"👨‍🎨",man_astronaut:"👨‍🚀",man_cartwheeling:"🤸‍♂️",man_cook:"👨‍🍳",man_dancing:"🕺",man_facepalming:"🤦‍♂️",man_factory_worker:"👨‍🏭",man_farmer:"👨‍🌾",man_firefighter:"👨‍🚒",man_health_worker:"👨‍⚕️",man_in_tuxedo:"🤵",man_judge:"👨‍⚖️",man_juggling:"🤹‍♂️",man_mechanic:"👨‍🔧",man_office_worker:"👨‍💼",man_pilot:"👨‍✈️",man_playing_handball:"🤾‍♂️",man_playing_water_polo:"🤽‍♂️",man_scientist:"👨‍🔬",man_shrugging:"🤷‍♂️",man_singer:"👨‍🎤",man_student:"👨‍🎓",man_teacher:"👨‍🏫",man_technologist:"👨‍💻",man_with_gua_pi_mao:"👲",man_with_turban:"👳",tangerine:"🍊",mans_shoe:"👞",mantelpiece_clock:"🕰",maple_leaf:"🍁",martial_arts_uniform:"🥋",mask:"😷",massage_woman:"💆",massage_man:"💆‍♂️",meat_on_bone:"🍖",medal_military:"🎖",medal_sports:"🏅",mega:"📣",melon:"🍈",memo:"📝",men_wrestling:"🤼‍♂️",menorah:"🕎",mens:"🚹",metal:"🤘",metro:"🚇",microphone:"🎤",microscope:"🔬",milk_glass:"🥛",milky_way:"🌌",minibus:"🚐",minidisc:"💽",mobile_phone_off:"📴",money_mouth_face:"🤑",money_with_wings:"💸",moneybag:"💰",monkey:"🐒",monkey_face:"🐵",monorail:"🚝",moon:"🌔",mortar_board:"🎓",mosque:"🕌",motor_boat:"🛥",motor_scooter:"🛵",motorcycle:"🏍",motorway:"🛣",mount_fuji:"🗻",mountain:"⛰",mountain_biking_man:"🚵",mountain_biking_woman:"🚵‍♀️",mountain_cableway:"🚠",mountain_railway:"🚞",mountain_snow:"🏔",mouse:"🐭",mouse2:"🐁",movie_camera:"🎥",moyai:"🗿",mrs_claus:"🤶",muscle:"💪",mushroom:"🍄",musical_keyboard:"🎹",musical_note:"🎵",musical_score:"🎼",mute:"🔇",nail_care:"💅",name_badge:"📛",national_park:"🏞",nauseated_face:"🤢",necktie:"👔",negative_squared_cross_mark:"❎",nerd_face:"🤓",neutral_face:"😐",new:"🆕",new_moon:"🌑",new_moon_with_face:"🌚",newspaper:"📰",newspaper_roll:"🗞",next_track_button:"⏭",ng:"🆖",no_good_man:"🙅‍♂️",no_good_woman:"🙅",night_with_stars:"🌃",no_bell:"🔕",no_bicycles:"🚳",no_entry:"⛔️",no_entry_sign:"🚫",no_mobile_phones:"📵",no_mouth:"😶",no_pedestrians:"🚷",no_smoking:"🚭","non-potable_water":"🚱",nose:"👃",notebook:"📓",notebook_with_decorative_cover:"📔",notes:"🎶",nut_and_bolt:"🔩",o:"⭕️",o2:"🅾️",ocean:"🌊",octopus:"🐙",oden:"🍢",office:"🏢",oil_drum:"🛢",ok:"🆗",ok_hand:"👌",ok_man:"🙆‍♂️",ok_woman:"🙆",old_key:"🗝",older_man:"👴",older_woman:"👵",om:"🕉",on:"🔛",oncoming_automobile:"🚘",oncoming_bus:"🚍",oncoming_police_car:"🚔",oncoming_taxi:"🚖",open_file_folder:"📂",open_hands:"👐",open_mouth:"😮",open_umbrella:"☂️",ophiuchus:"⛎",orange_book:"📙",orthodox_cross:"☦️",outbox_tray:"📤",owl:"🦉",ox:"🐂",package:"📦",page_facing_up:"📄",page_with_curl:"📃",pager:"📟",paintbrush:"🖌",palm_tree:"🌴",pancakes:"🥞",panda_face:"🐼",paperclip:"📎",paperclips:"🖇",parasol_on_ground:"⛱",parking:"🅿️",part_alternation_mark:"〽️",partly_sunny:"⛅️",passenger_ship:"🛳",passport_control:"🛂",pause_button:"⏸",peace_symbol:"☮️",peach:"🍑",peanuts:"🥜",pear:"🍐",pen:"🖊",pencil2:"✏️",penguin:"🐧",pensive:"😔",performing_arts:"🎭",persevere:"😣",person_fencing:"🤺",pouting_woman:"🙎",phone:"☎️",pick:"⛏",pig:"🐷",pig2:"🐖",pig_nose:"🐽",pill:"💊",pineapple:"🍍",ping_pong:"🏓",pisces:"♓️",pizza:"🍕",place_of_worship:"🛐",plate_with_cutlery:"🍽",play_or_pause_button:"⏯",point_down:"👇",point_left:"👈",point_right:"👉",point_up:"☝️",point_up_2:"👆",police_car:"🚓",policewoman:"👮‍♀️",poodle:"🐩",popcorn:"🍿",post_office:"🏣",postal_horn:"📯",postbox:"📮",potable_water:"🚰",potato:"🥔",pouch:"👝",poultry_leg:"🍗",pound:"💷",rage:"😡",pouting_cat:"😾",pouting_man:"🙎‍♂️",pray:"🙏",prayer_beads:"📿",pregnant_woman:"🤰",previous_track_button:"⏮",prince:"🤴",princess:"👸",printer:"🖨",purple_heart:"💜",purse:"👛",pushpin:"📌",put_litter_in_its_place:"🚮",question:"❓",rabbit:"🐰",rabbit2:"🐇",racehorse:"🐎",racing_car:"🏎",radio:"📻",radio_button:"🔘",radioactive:"☢️",railway_car:"🚃",railway_track:"🛤",rainbow:"🌈",rainbow_flag:"🏳️‍🌈",raised_back_of_hand:"🤚",raised_hand_with_fingers_splayed:"🖐",raised_hands:"🙌",raising_hand_woman:"🙋",raising_hand_man:"🙋‍♂️",ram:"🐏",ramen:"🍜",rat:"🐀",record_button:"⏺",recycle:"♻️",red_circle:"🔴",registered:"®️",relaxed:"☺️",relieved:"😌",reminder_ribbon:"🎗",repeat:"🔁",repeat_one:"🔂",rescue_worker_helmet:"⛑",restroom:"🚻",revolving_hearts:"💞",rewind:"⏪",rhinoceros:"🦏",ribbon:"🎀",rice:"🍚",rice_ball:"🍙",rice_cracker:"🍘",rice_scene:"🎑",right_anger_bubble:"🗯",ring:"💍",robot:"🤖",rocket:"🚀",rofl:"🤣",roll_eyes:"🙄",roller_coaster:"🎢",rooster:"🐓",rose:"🌹",rosette:"🏵",rotating_light:"🚨",round_pushpin:"📍",rowing_man:"🚣",rowing_woman:"🚣‍♀️",rugby_football:"🏉",running_man:"🏃",running_shirt_with_sash:"🎽",running_woman:"🏃‍♀️",sa:"🈂️",sagittarius:"♐️",sake:"🍶",sandal:"👡",santa:"🎅",satellite:"📡",saxophone:"🎷",school:"🏫",school_satchel:"🎒",scissors:"✂️",scorpion:"🦂",scorpius:"♏️",scream:"😱",scream_cat:"🙀",scroll:"📜",seat:"💺",secret:"㊙️",see_no_evil:"🙈",seedling:"🌱",selfie:"🤳",shallow_pan_of_food:"🥘",shamrock:"☘️",shark:"🦈",shaved_ice:"🍧",sheep:"🐑",shell:"🐚",shield:"🛡",shinto_shrine:"⛩",ship:"🚢",shirt:"👕",shopping:"🛍",shopping_cart:"🛒",shower:"🚿",shrimp:"🦐",signal_strength:"📶",six_pointed_star:"🔯",ski:"🎿",skier:"⛷",skull:"💀",skull_and_crossbones:"☠️",sleeping:"😴",sleeping_bed:"🛌",sleepy:"😪",slightly_frowning_face:"🙁",slightly_smiling_face:"🙂",slot_machine:"🎰",small_airplane:"🛩",small_blue_diamond:"🔹",small_orange_diamond:"🔸",small_red_triangle:"🔺",small_red_triangle_down:"🔻",smile:"😄",smile_cat:"😸",smiley:"😃",smiley_cat:"😺",smiling_imp:"😈",smirk:"😏",smirk_cat:"😼",smoking:"🚬",snail:"🐌",snake:"🐍",sneezing_face:"🤧",snowboarder:"🏂",snowflake:"❄️",snowman:"⛄️",snowman_with_snow:"☃️",sob:"😭",soccer:"⚽️",soon:"🔜",sos:"🆘",sound:"🔉",space_invader:"👾",spades:"♠️",spaghetti:"🍝",sparkle:"❇️",sparkler:"🎇",sparkles:"✨",sparkling_heart:"💖",speak_no_evil:"🙊",speaker:"🔈",speaking_head:"🗣",speech_balloon:"💬",speedboat:"🚤",spider:"🕷",spider_web:"🕸",spiral_calendar:"🗓",spiral_notepad:"🗒",spoon:"🥄",squid:"🦑",stadium:"🏟",star:"⭐️",star2:"🌟",star_and_crescent:"☪️",star_of_david:"✡️",stars:"🌠",station:"🚉",statue_of_liberty:"🗽",steam_locomotive:"🚂",stew:"🍲",stop_button:"⏹",stop_sign:"🛑",stopwatch:"⏱",straight_ruler:"📏",strawberry:"🍓",stuck_out_tongue:"😛",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue_winking_eye:"😜",studio_microphone:"🎙",stuffed_flatbread:"🥙",sun_behind_large_cloud:"🌥",sun_behind_rain_cloud:"🌦",sun_behind_small_cloud:"🌤",sun_with_face:"🌞",sunflower:"🌻",sunglasses:"😎",sunny:"☀️",sunrise:"🌅",sunrise_over_mountains:"🌄",surfing_man:"🏄",surfing_woman:"🏄‍♀️",sushi:"🍣",suspension_railway:"🚟",sweat:"😓",sweat_drops:"💦",sweat_smile:"😅",sweet_potato:"🍠",swimming_man:"🏊",swimming_woman:"🏊‍♀️",symbols:"🔣",synagogue:"🕍",syringe:"💉",taco:"🌮",tada:"🎉",tanabata_tree:"🎋",taurus:"♉️",taxi:"🚕",tea:"🍵",telephone_receiver:"📞",telescope:"🔭",tennis:"🎾",tent:"⛺️",thermometer:"🌡",thinking:"🤔",thought_balloon:"💭",ticket:"🎫",tickets:"🎟",tiger:"🐯",tiger2:"🐅",timer_clock:"⏲",tipping_hand_man:"💁‍♂️",tired_face:"😫",tm:"™️",toilet:"🚽",tokyo_tower:"🗼",tomato:"🍅",tongue:"👅",top:"🔝",tophat:"🎩",tornado:"🌪",trackball:"🖲",tractor:"🚜",traffic_light:"🚥",train:"🚋",train2:"🚆",tram:"🚊",triangular_flag_on_post:"🚩",triangular_ruler:"📐",trident:"🔱",triumph:"😤",trolleybus:"🚎",trophy:"🏆",tropical_drink:"🍹",tropical_fish:"🐠",truck:"🚚",trumpet:"🎺",tulip:"🌷",tumbler_glass:"🥃",turkey:"🦃",turtle:"🐢",tv:"📺",twisted_rightwards_arrows:"🔀",two_hearts:"💕",two_men_holding_hands:"👬",two_women_holding_hands:"👭",u5272:"🈹",u5408:"🈴",u55b6:"🈺",u6307:"🈯️",u6708:"🈷️",u6709:"🈶",u6e80:"🈵",u7121:"🈚️",u7533:"🈸",u7981:"🈲",u7a7a:"🈳",umbrella:"☔️",unamused:"😒",underage:"🔞",unicorn:"🦄",unlock:"🔓",up:"🆙",upside_down_face:"🙃",v:"✌️",vertical_traffic_light:"🚦",vhs:"📼",vibration_mode:"📳",video_camera:"📹",video_game:"🎮",violin:"🎻",virgo:"♍️",volcano:"🌋",volleyball:"🏐",vs:"🆚",vulcan_salute:"🖖",walking_man:"🚶",walking_woman:"🚶‍♀️",waning_crescent_moon:"🌘",waning_gibbous_moon:"🌖",warning:"⚠️",wastebasket:"🗑",watch:"⌚️",water_buffalo:"🐃",watermelon:"🍉",wave:"👋",wavy_dash:"〰️",waxing_crescent_moon:"🌒",wc:"🚾",weary:"😩",wedding:"💒",weight_lifting_man:"🏋️",weight_lifting_woman:"🏋️‍♀️",whale:"🐳",whale2:"🐋",wheel_of_dharma:"☸️",wheelchair:"♿️",white_check_mark:"✅",white_circle:"⚪️",white_flag:"🏳️",white_flower:"💮",white_large_square:"⬜️",white_medium_small_square:"◽️",white_medium_square:"◻️",white_small_square:"▫️",white_square_button:"🔳",wilted_flower:"🥀",wind_chime:"🎐",wind_face:"🌬",wine_glass:"🍷",wink:"😉",wolf:"🐺",woman:"👩",woman_artist:"👩‍🎨",woman_astronaut:"👩‍🚀",woman_cartwheeling:"🤸‍♀️",woman_cook:"👩‍🍳",woman_facepalming:"🤦‍♀️",woman_factory_worker:"👩‍🏭",woman_farmer:"👩‍🌾",woman_firefighter:"👩‍🚒",woman_health_worker:"👩‍⚕️",woman_judge:"👩‍⚖️",woman_juggling:"🤹‍♀️",woman_mechanic:"👩‍🔧",woman_office_worker:"👩‍💼",woman_pilot:"👩‍✈️",woman_playing_handball:"🤾‍♀️",woman_playing_water_polo:"🤽‍♀️",woman_scientist:"👩‍🔬",woman_shrugging:"🤷‍♀️",woman_singer:"👩‍🎤",woman_student:"👩‍🎓",woman_teacher:"👩‍🏫",woman_technologist:"👩‍💻",woman_with_turban:"👳‍♀️",womans_clothes:"👚",womans_hat:"👒",women_wrestling:"🤼‍♀️",womens:"🚺",world_map:"🗺",worried:"😟",wrench:"🔧",writing_hand:"✍️",x:"❌",yellow_heart:"💛",yen:"💴",yin_yang:"☯️",yum:"😋",zap:"⚡️",zipper_mouth_face:"🤐",zzz:"💤",octocat:'<img alt=":octocat:" height="20" width="20" align="absmiddle" src="https://assets-cdn.github.com/images/icons/emoji/octocat.png">',showdown:"<span style=\"font-family: 'Anonymous Pro', monospace; text-decoration: underline; text-decoration-style: dashed; text-decoration-color: #3e8b8a;text-underline-position: under;\">S</span>"},o.Converter=function(e){"use strict";var t={},n=[],i=[],r={},s=c,h={parsed:{},raw:"",format:""};function p(e,t){if(t=t||null,o.helper.isString(e)){if(t=e=o.helper.stdExtName(e),o.extensions[e])return console.warn("DEPRECATION WARNING: "+e+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),void function(e,t){"function"==typeof e&&(e=e(new o.Converter)),o.helper.isArray(e)||(e=[e]);var r=d(e,t);if(!r.valid)throw Error(r.error);for(var s=0;s<e.length;++s)switch(e[s].type){case"lang":n.push(e[s]);break;case"output":i.push(e[s]);break;default:throw Error("Extension loader error: Type unrecognized!!!")}}(o.extensions[e],e);if(o.helper.isUndefined(a[e]))throw Error('Extension "'+e+'" could not be loaded. It was either not found or is not a valid extension.');e=a[e]}"function"==typeof e&&(e=e()),o.helper.isArray(e)||(e=[e]);var r=d(e,t);if(!r.valid)throw Error(r.error);for(var s=0;s<e.length;++s){switch(e[s].type){case"lang":n.push(e[s]);break;case"output":i.push(e[s])}if(e[s].hasOwnProperty("listeners"))for(var l in e[s].listeners)e[s].listeners.hasOwnProperty(l)&&f(l,e[s].listeners[l])}}function f(e,t){if(!o.helper.isString(e))throw Error("Invalid argument in converter.listen() method: name must be a string, but "+typeof e+" given");if("function"!=typeof t)throw Error("Invalid argument in converter.listen() method: callback must be a function, but "+typeof t+" given");r.hasOwnProperty(e)||(r[e]=[]),r[e].push(t)}!function(){for(var n in e=e||{},l)l.hasOwnProperty(n)&&(t[n]=l[n]);if("object"!=typeof e)throw Error("Converter expects the passed parameter to be an object, but "+typeof e+" was passed instead.");for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);t.extensions&&o.helper.forEach(t.extensions,p)}(),this._dispatch=function(e,t,n,i){if(r.hasOwnProperty(e))for(var o=0;o<r[e].length;++o){var s=r[e][o](e,t,this,n,i);s&&void 0!==s&&(t=s)}return t},this.listen=function(e,t){return f(e,t),this},this.makeHtml=function(e){if(!e)return e;var r={gHtmlBlocks:[],gHtmlMdBlocks:[],gHtmlSpans:[],gUrls:{},gTitles:{},gDimensions:{},gListLevel:0,hashLinkCounts:{},langExtensions:n,outputModifiers:i,converter:this,ghCodeBlocks:[],metadata:{parsed:{},raw:"",format:""}};return e=(e=(e=(e=(e=e.replace(/¨/g,"¨T")).replace(/\$/g,"¨D")).replace(/\r\n/g,"\n")).replace(/\r/g,"\n")).replace(/\u00A0/g," "),t.smartIndentationFix&&(e=function(e){var t=e.match(/^\s*/)[0].length,n=new RegExp("^\\s{0,"+t+"}","gm");return e.replace(n,"")}(e)),e="\n\n"+e+"\n\n",e=(e=o.subParser("detab")(e,t,r)).replace(/^[ \t]+$/gm,""),o.helper.forEach(n,function(n){e=o.subParser("runExtension")(n,e,t,r)}),e=o.subParser("metadata")(e,t,r),e=o.subParser("hashPreCodeTags")(e,t,r),e=o.subParser("githubCodeBlocks")(e,t,r),e=o.subParser("hashHTMLBlocks")(e,t,r),e=o.subParser("hashCodeTags")(e,t,r),e=o.subParser("stripLinkDefinitions")(e,t,r),e=o.subParser("blockGamut")(e,t,r),e=o.subParser("unhashHTMLSpans")(e,t,r),e=(e=(e=o.subParser("unescapeSpecialChars")(e,t,r)).replace(/¨D/g,"$$")).replace(/¨T/g,"¨"),e=o.subParser("completeHTMLDocument")(e,t,r),o.helper.forEach(i,function(n){e=o.subParser("runExtension")(n,e,t,r)}),h=r.metadata,e},this.makeMarkdown=this.makeMd=function(e,t){if(e=(e=(e=e.replace(/\r\n/g,"\n")).replace(/\r/g,"\n")).replace(/>[ \t]+</,">¨NBSP;<"),!t){if(!window||!window.document)throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");t=window.document}var n=t.createElement("div");n.innerHTML=e;var i={preList:function(e){for(var t=e.querySelectorAll("pre"),n=[],i=0;i<t.length;++i)if(1===t[i].childElementCount&&"code"===t[i].firstChild.tagName.toLowerCase()){var r=t[i].firstChild.innerHTML.trim(),s=t[i].firstChild.getAttribute("data-language")||"";if(""===s)for(var a=t[i].firstChild.className.split(" "),l=0;l<a.length;++l){var c=a[l].match(/^language-(.+)$/);if(null!==c){s=c[1];break}}r=o.helper.unescapeHTMLEntities(r),n.push(r),t[i].outerHTML='<precode language="'+s+'" precodenum="'+i.toString()+'"></precode>'}else n.push(t[i].innerHTML),t[i].innerHTML="",t[i].setAttribute("prenum",i.toString());return n}(n)};!function e(t){for(var n=0;n<t.childNodes.length;++n){var i=t.childNodes[n];3===i.nodeType?/\S/.test(i.nodeValue)?(i.nodeValue=i.nodeValue.split("\n").join(" "),i.nodeValue=i.nodeValue.replace(/(\s)+/g,"$1")):(t.removeChild(i),--n):1===i.nodeType&&e(i)}}(n);for(var r=n.childNodes,s="",a=0;a<r.length;a++)s+=o.subParser("makeMarkdown.node")(r[a],i);return s},this.setOption=function(e,n){t[e]=n},this.getOption=function(e){return t[e]},this.getOptions=function(){return t},this.addExtension=function(e,t){p(e,t=t||null)},this.useExtension=function(e){p(e)},this.setFlavor=function(e){if(!u.hasOwnProperty(e))throw Error(e+" flavor was not found");var n=u[e];for(var i in s=e,n)n.hasOwnProperty(i)&&(t[i]=n[i])},this.getFlavor=function(){return s},this.removeExtension=function(e){o.helper.isArray(e)||(e=[e]);for(var t=0;t<e.length;++t){for(var r=e[t],s=0;s<n.length;++s)n[s]===r&&n[s].splice(s,1);for(;0<i.length;++s)i[0]===r&&i[0].splice(s,1)}},this.getAllExtensions=function(){return{language:n,output:i}},this.getMetadata=function(e){return e?h.raw:h.parsed},this.getMetadataFormat=function(){return h.format},this._setMetadataPair=function(e,t){h.parsed[e]=t},this._setMetadataFormat=function(e){h.format=e},this._setMetadataRaw=function(e){h.raw=e}},o.subParser("anchors",function(e,t,n){"use strict";var i=function(e,i,r,s,a,l,c){if(o.helper.isUndefined(c)&&(c=""),r=r.toLowerCase(),e.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)s="";else if(!s){if(r||(r=i.toLowerCase().replace(/ ?\n/g," ")),s="#"+r,o.helper.isUndefined(n.gUrls[r]))return e;s=n.gUrls[r],o.helper.isUndefined(n.gTitles[r])||(c=n.gTitles[r])}var u='<a href="'+(s=s.replace(o.helper.regexes.asteriskDashAndColon,o.helper.escapeCharactersCallback))+'"';return""!==c&&null!==c&&(u+=' title="'+(c=(c=c.replace(/"/g,""")).replace(o.helper.regexes.asteriskDashAndColon,o.helper.escapeCharactersCallback))+'"'),t.openLinksInNewWindow&&!/^#/.test(s)&&(u+=' rel="noopener noreferrer" target="¨E95Eblank"'),u+">"+i+"</a>"};return e=(e=(e=(e=(e=n.converter._dispatch("anchors.before",e,t,n)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,i)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,i)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,i)).replace(/\[([^\[\]]+)]()()()()()/g,i),t.ghMentions&&(e=e.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gim,function(e,n,i,r,s){if("\\"===i)return n+r;if(!o.helper.isString(t.ghMentionsLink))throw new Error("ghMentionsLink option must be a string");var a=t.ghMentionsLink.replace(/\{u}/g,s),l="";return t.openLinksInNewWindow&&(l=' rel="noopener noreferrer" target="¨E95Eblank"'),n+'<a href="'+a+'"'+l+">"+r+"</a>"})),n.converter._dispatch("anchors.after",e,t,n)});var f=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,m=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,g=/()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,b=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gim,y=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,v=function(e){"use strict";return function(t,n,i,r,s,a,l){var c=i=i.replace(o.helper.regexes.asteriskDashAndColon,o.helper.escapeCharactersCallback),u="",d="",h=n||"",p=l||"";return/^www\./i.test(i)&&(i=i.replace(/^www\./i,"http://www.")),e.excludeTrailingPunctuationFromURLs&&a&&(u=a),e.openLinksInNewWindow&&(d=' rel="noopener noreferrer" target="¨E95Eblank"'),h+'<a href="'+i+'"'+d+">"+c+"</a>"+u+p}},_=function(e,t){"use strict";return function(n,i,r){var s="mailto:";return i=i||"",r=o.subParser("unescapeSpecialChars")(r,e,t),e.encodeEmails?(s=o.helper.encodeEmailAddress(s+r),r=o.helper.encodeEmailAddress(r)):s+=r,i+'<a href="'+s+'">'+r+"</a>"}};o.subParser("autoLinks",function(e,t,n){"use strict";return e=(e=(e=n.converter._dispatch("autoLinks.before",e,t,n)).replace(g,v(t))).replace(y,_(t,n)),n.converter._dispatch("autoLinks.after",e,t,n)}),o.subParser("simplifiedAutoLinks",function(e,t,n){"use strict";return t.simplifiedAutoLink?(e=n.converter._dispatch("simplifiedAutoLinks.before",e,t,n),e=(e=t.excludeTrailingPunctuationFromURLs?e.replace(m,v(t)):e.replace(f,v(t))).replace(b,_(t,n)),e=n.converter._dispatch("simplifiedAutoLinks.after",e,t,n)):e}),o.subParser("blockGamut",function(e,t,n){"use strict";return e=n.converter._dispatch("blockGamut.before",e,t,n),e=o.subParser("blockQuotes")(e,t,n),e=o.subParser("headers")(e,t,n),e=o.subParser("horizontalRule")(e,t,n),e=o.subParser("lists")(e,t,n),e=o.subParser("codeBlocks")(e,t,n),e=o.subParser("tables")(e,t,n),e=o.subParser("hashHTMLBlocks")(e,t,n),e=o.subParser("paragraphs")(e,t,n),n.converter._dispatch("blockGamut.after",e,t,n)}),o.subParser("blockQuotes",function(e,t,n){"use strict";e=n.converter._dispatch("blockQuotes.before",e,t,n),e+="\n\n";var i=/(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;return t.splitAdjacentBlockquotes&&(i=/^ {0,3}>[\s\S]*?(?:\n\n)/gm),e=e.replace(i,function(e){return e=(e=(e=e.replace(/^[ \t]*>[ \t]?/gm,"")).replace(/¨0/g,"")).replace(/^[ \t]+$/gm,""),e=o.subParser("githubCodeBlocks")(e,t,n),e=(e=(e=o.subParser("blockGamut")(e,t,n)).replace(/(^|\n)/g,"$1 ")).replace(/(\s*<pre>[^\r]+?<\/pre>)/gm,function(e,t){var n=t;return(n=n.replace(/^ /gm,"¨0")).replace(/¨0/g,"")}),o.subParser("hashBlock")("<blockquote>\n"+e+"\n</blockquote>",t,n)}),n.converter._dispatch("blockQuotes.after",e,t,n)}),o.subParser("codeBlocks",function(e,t,n){"use strict";return e=n.converter._dispatch("codeBlocks.before",e,t,n),e=(e=(e+="¨0").replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g,function(e,i,r){var s=i,a=r,l="\n";return s=o.subParser("outdent")(s,t,n),s=o.subParser("encodeCode")(s,t,n),s=(s=(s=o.subParser("detab")(s,t,n)).replace(/^\n+/g,"")).replace(/\n+$/g,""),t.omitExtraWLInCodeBlocks&&(l=""),s="<pre><code>"+s+l+"</code></pre>",o.subParser("hashBlock")(s,t,n)+a})).replace(/¨0/,""),n.converter._dispatch("codeBlocks.after",e,t,n)}),o.subParser("codeSpans",function(e,t,n){"use strict";return void 0===(e=n.converter._dispatch("codeSpans.before",e,t,n))&&(e=""),e=e.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(e,i,r,s){var a=s;return a=(a=a.replace(/^([ \t]*)/g,"")).replace(/[ \t]*$/g,""),a=i+"<code>"+(a=o.subParser("encodeCode")(a,t,n))+"</code>",o.subParser("hashHTMLSpans")(a,t,n)}),n.converter._dispatch("codeSpans.after",e,t,n)}),o.subParser("completeHTMLDocument",function(e,t,n){"use strict";if(!t.completeHTMLDocument)return e;e=n.converter._dispatch("completeHTMLDocument.before",e,t,n);var i="html",r="<!DOCTYPE HTML>\n",o="",s='<meta charset="utf-8">\n',a="",l="";for(var c in void 0!==n.metadata.parsed.doctype&&(r="<!DOCTYPE "+n.metadata.parsed.doctype+">\n","html"!==(i=n.metadata.parsed.doctype.toString().toLowerCase())&&"html5"!==i||(s='<meta charset="utf-8">')),n.metadata.parsed)if(n.metadata.parsed.hasOwnProperty(c))switch(c.toLowerCase()){case"doctype":break;case"title":o="<title>"+n.metadata.parsed.title+"</title>\n";break;case"charset":s="html"===i||"html5"===i?'<meta charset="'+n.metadata.parsed.charset+'">\n':'<meta name="charset" content="'+n.metadata.parsed.charset+'">\n';break;case"language":case"lang":a=' lang="'+n.metadata.parsed[c]+'"',l+='<meta name="'+c+'" content="'+n.metadata.parsed[c]+'">\n';break;default:l+='<meta name="'+c+'" content="'+n.metadata.parsed[c]+'">\n'}return e=r+"<html"+a+">\n<head>\n"+o+s+l+"</head>\n<body>\n"+e.trim()+"\n</body>\n</html>",n.converter._dispatch("completeHTMLDocument.after",e,t,n)}),o.subParser("detab",function(e,t,n){"use strict";return e=(e=(e=(e=(e=(e=n.converter._dispatch("detab.before",e,t,n)).replace(/\t(?=\t)/g," ")).replace(/\t/g,"¨A¨B")).replace(/¨B(.+?)¨A/g,function(e,t){for(var n=t,i=4-n.length%4,r=0;r<i;r++)n+=" ";return n})).replace(/¨A/g," ")).replace(/¨B/g,""),n.converter._dispatch("detab.after",e,t,n)}),o.subParser("ellipsis",function(e,t,n){"use strict";return e=(e=n.converter._dispatch("ellipsis.before",e,t,n)).replace(/\.\.\./g,"…"),n.converter._dispatch("ellipsis.after",e,t,n)}),o.subParser("emoji",function(e,t,n){"use strict";return t.emoji?(e=(e=n.converter._dispatch("emoji.before",e,t,n)).replace(/:([\S]+?):/g,function(e,t){return o.helper.emojis.hasOwnProperty(t)?o.helper.emojis[t]:e}),n.converter._dispatch("emoji.after",e,t,n)):e}),o.subParser("encodeAmpsAndAngles",function(e,t,n){"use strict";return e=(e=(e=(e=(e=n.converter._dispatch("encodeAmpsAndAngles.before",e,t,n)).replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&")).replace(/<(?![a-z\/?$!])/gi,"<")).replace(/</g,"<")).replace(/>/g,">"),n.converter._dispatch("encodeAmpsAndAngles.after",e,t,n)}),o.subParser("encodeBackslashEscapes",function(e,t,n){"use strict";return e=(e=(e=n.converter._dispatch("encodeBackslashEscapes.before",e,t,n)).replace(/\\(\\)/g,o.helper.escapeCharactersCallback)).replace(/\\([`*_{}\[\]()>#+.!~=|-])/g,o.helper.escapeCharactersCallback),n.converter._dispatch("encodeBackslashEscapes.after",e,t,n)}),o.subParser("encodeCode",function(e,t,n){"use strict";return e=(e=n.converter._dispatch("encodeCode.before",e,t,n)).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/([*_{}\[\]\\=~-])/g,o.helper.escapeCharactersCallback),n.converter._dispatch("encodeCode.after",e,t,n)}),o.subParser("escapeSpecialCharsWithinTagAttributes",function(e,t,n){"use strict";return e=(e=(e=n.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before",e,t,n)).replace(/<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,function(e){return e.replace(/(.)<\/?code>(?=.)/g,"$1`").replace(/([\\`*_~=|])/g,o.helper.escapeCharactersCallback)})).replace(/<!(--(?:(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>/gi,function(e){return e.replace(/([\\`*_~=|])/g,o.helper.escapeCharactersCallback)}),n.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after",e,t,n)}),o.subParser("githubCodeBlocks",function(e,t,n){"use strict";return t.ghCodeBlocks?(e=n.converter._dispatch("githubCodeBlocks.before",e,t,n),e=(e=(e+="¨0").replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g,function(e,i,r,s){var a=t.omitExtraWLInCodeBlocks?"":"\n";return s=o.subParser("encodeCode")(s,t,n),s="<pre><code"+(r?' class="'+r+" language-"+r+'"':"")+">"+(s=(s=(s=o.subParser("detab")(s,t,n)).replace(/^\n+/g,"")).replace(/\n+$/g,""))+a+"</code></pre>",s=o.subParser("hashBlock")(s,t,n),"\n\n¨G"+(n.ghCodeBlocks.push({text:e,codeblock:s})-1)+"G\n\n"})).replace(/¨0/,""),n.converter._dispatch("githubCodeBlocks.after",e,t,n)):e}),o.subParser("hashBlock",function(e,t,n){"use strict";return e=(e=n.converter._dispatch("hashBlock.before",e,t,n)).replace(/(^\n+|\n+$)/g,""),e="\n\n¨K"+(n.gHtmlBlocks.push(e)-1)+"K\n\n",n.converter._dispatch("hashBlock.after",e,t,n)}),o.subParser("hashCodeTags",function(e,t,n){"use strict";return e=n.converter._dispatch("hashCodeTags.before",e,t,n),e=o.helper.replaceRecursiveRegExp(e,function(e,i,r,s){var a=r+o.subParser("encodeCode")(i,t,n)+s;return"¨C"+(n.gHtmlSpans.push(a)-1)+"C"},"<code\\b[^>]*>","</code>","gim"),n.converter._dispatch("hashCodeTags.after",e,t,n)}),o.subParser("hashElement",function(e,t,n){"use strict";return function(e,t){var i=t;return i=(i=(i=i.replace(/\n\n/g,"\n")).replace(/^\n/,"")).replace(/\n+$/g,""),"\n\n¨K"+(n.gHtmlBlocks.push(i)-1)+"K\n\n"}}),o.subParser("hashHTMLBlocks",function(e,t,n){"use strict";e=n.converter._dispatch("hashHTMLBlocks.before",e,t,n);var i=["pre","div","h1","h2","h3","h4","h5","h6","blockquote","table","dl","ol","ul","script","noscript","form","fieldset","iframe","math","style","section","header","footer","nav","article","aside","address","audio","canvas","figure","hgroup","output","video","p"],r=function(e,t,i,r){var o=e;return-1!==i.search(/\bmarkdown\b/)&&(o=i+n.converter.makeHtml(t)+r),"\n\n¨K"+(n.gHtmlBlocks.push(o)-1)+"K\n\n"};t.backslashEscapesHTMLTags&&(e=e.replace(/\\<(\/?[^>]+?)>/g,function(e,t){return"<"+t+">"}));for(var s=0;s<i.length;++s)for(var a,l=new RegExp("^ {0,3}(<"+i[s]+"\\b[^>]*>)","im"),c="<"+i[s]+"\\b[^>]*>",u="</"+i[s]+">";-1!==(a=o.helper.regexIndexOf(e,l));){var d=o.helper.splitAtIndex(e,a),h=o.helper.replaceRecursiveRegExp(d[1],r,c,u,"im");if(h===d[1])break;e=d[0].concat(h)}return e=e.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,o.subParser("hashElement")(e,t,n)),e=(e=o.helper.replaceRecursiveRegExp(e,function(e){return"\n\n¨K"+(n.gHtmlBlocks.push(e)-1)+"K\n\n"},"^ {0,3}\x3c!--","--\x3e","gm")).replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,o.subParser("hashElement")(e,t,n)),n.converter._dispatch("hashHTMLBlocks.after",e,t,n)}),o.subParser("hashHTMLSpans",function(e,t,n){"use strict";function i(e){return"¨C"+(n.gHtmlSpans.push(e)-1)+"C"}return e=(e=(e=(e=(e=n.converter._dispatch("hashHTMLSpans.before",e,t,n)).replace(/<[^>]+?\/>/gi,function(e){return i(e)})).replace(/<([^>]+?)>[\s\S]*?<\/\1>/g,function(e){return i(e)})).replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,function(e){return i(e)})).replace(/<[^>]+?>/gi,function(e){return i(e)}),n.converter._dispatch("hashHTMLSpans.after",e,t,n)}),o.subParser("unhashHTMLSpans",function(e,t,n){"use strict";e=n.converter._dispatch("unhashHTMLSpans.before",e,t,n);for(var i=0;i<n.gHtmlSpans.length;++i){for(var r=n.gHtmlSpans[i],o=0;/¨C(\d+)C/.test(r);){var s=RegExp.$1;if(r=r.replace("¨C"+s+"C",n.gHtmlSpans[s]),10===o){console.error("maximum nesting of 10 spans reached!!!");break}++o}e=e.replace("¨C"+i+"C",r)}return n.converter._dispatch("unhashHTMLSpans.after",e,t,n)}),o.subParser("hashPreCodeTags",function(e,t,n){"use strict";return e=n.converter._dispatch("hashPreCodeTags.before",e,t,n),e=o.helper.replaceRecursiveRegExp(e,function(e,i,r,s){var a=r+o.subParser("encodeCode")(i,t,n)+s;return"\n\n¨G"+(n.ghCodeBlocks.push({text:e,codeblock:a})-1)+"G\n\n"},"^ {0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>","^ {0,3}</code>\\s*</pre>","gim"),n.converter._dispatch("hashPreCodeTags.after",e,t,n)}),o.subParser("headers",function(e,t,n){"use strict";e=n.converter._dispatch("headers.before",e,t,n);var i=isNaN(parseInt(t.headerLevelStart))?1:parseInt(t.headerLevelStart),r=t.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,s=t.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm;e=(e=e.replace(r,function(e,r){var s=o.subParser("spanGamut")(r,t,n),a=t.noHeaderId?"":' id="'+l(r)+'"',c="<h"+i+a+">"+s+"</h"+i+">";return o.subParser("hashBlock")(c,t,n)})).replace(s,function(e,r){var s=o.subParser("spanGamut")(r,t,n),a=t.noHeaderId?"":' id="'+l(r)+'"',c=i+1,u="<h"+c+a+">"+s+"</h"+c+">";return o.subParser("hashBlock")(u,t,n)});var a=t.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;function l(e){var i,r;if(t.customizedHeaderId){var s=e.match(/\{([^{]+?)}\s*$/);s&&s[1]&&(e=s[1])}return i=e,r=o.helper.isString(t.prefixHeaderId)?t.prefixHeaderId:!0===t.prefixHeaderId?"section-":"",t.rawPrefixHeaderId||(i=r+i),i=t.ghCompatibleHeaderId?i.replace(/ /g,"-").replace(/&/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"").toLowerCase():t.rawHeaderId?i.replace(/ /g,"-").replace(/&/g,"&").replace(/¨T/g,"¨").replace(/¨D/g,"$").replace(/["']/g,"-").toLowerCase():i.replace(/[^\w]/g,"").toLowerCase(),t.rawPrefixHeaderId&&(i=r+i),n.hashLinkCounts[i]?i=i+"-"+n.hashLinkCounts[i]++:n.hashLinkCounts[i]=1,i}return e=e.replace(a,function(e,r,s){var a=s;t.customizedHeaderId&&(a=s.replace(/\s?\{([^{]+?)}\s*$/,""));var c=o.subParser("spanGamut")(a,t,n),u=t.noHeaderId?"":' id="'+l(s)+'"',d=i-1+r.length,h="<h"+d+u+">"+c+"</h"+d+">";return o.subParser("hashBlock")(h,t,n)}),n.converter._dispatch("headers.after",e,t,n)}),o.subParser("horizontalRule",function(e,t,n){"use strict";e=n.converter._dispatch("horizontalRule.before",e,t,n);var i=o.subParser("hashBlock")("<hr />",t,n);return e=(e=(e=e.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,i)).replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,i)).replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,i),n.converter._dispatch("horizontalRule.after",e,t,n)}),o.subParser("images",function(e,t,n){"use strict";function i(e,t,i,r,s,a,l,c){var u=n.gUrls,d=n.gTitles,h=n.gDimensions;if(i=i.toLowerCase(),c||(c=""),e.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)r="";else if(""===r||null===r){if(""!==i&&null!==i||(i=t.toLowerCase().replace(/ ?\n/g," ")),r="#"+i,o.helper.isUndefined(u[i]))return e;r=u[i],o.helper.isUndefined(d[i])||(c=d[i]),o.helper.isUndefined(h[i])||(s=h[i].width,a=h[i].height)}t=t.replace(/"/g,""").replace(o.helper.regexes.asteriskDashAndColon,o.helper.escapeCharactersCallback);var p='<img src="'+(r=r.replace(o.helper.regexes.asteriskDashAndColon,o.helper.escapeCharactersCallback))+'" alt="'+t+'"';return c&&o.helper.isString(c)&&(p+=' title="'+(c=c.replace(/"/g,""").replace(o.helper.regexes.asteriskDashAndColon,o.helper.escapeCharactersCallback))+'"'),s&&a&&(p+=' width="'+(s="*"===s?"auto":s)+'"',p+=' height="'+(a="*"===a?"auto":a)+'"'),p+" />"}return e=(e=(e=(e=(e=(e=n.converter._dispatch("images.before",e,t,n)).replace(/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,i)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,function(e,t,n,r,o,s,a,l){return i(e,t,n,r=r.replace(/\s/g,""),o,s,0,l)})).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,i)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,i)).replace(/!\[([^\[\]]+)]()()()()()/g,i),n.converter._dispatch("images.after",e,t,n)}),o.subParser("italicsAndBold",function(e,t,n){"use strict";function i(e,t,n){return t+e+n}return e=n.converter._dispatch("italicsAndBold.before",e,t,n),e=t.literalMidWordUnderscores?(e=(e=e.replace(/\b___(\S[\s\S]*?)___\b/g,function(e,t){return i(t,"<strong><em>","</em></strong>")})).replace(/\b__(\S[\s\S]*?)__\b/g,function(e,t){return i(t,"<strong>","</strong>")})).replace(/\b_(\S[\s\S]*?)_\b/g,function(e,t){return i(t,"<em>","</em>")}):(e=(e=e.replace(/___(\S[\s\S]*?)___/g,function(e,t){return/\S$/.test(t)?i(t,"<strong><em>","</em></strong>"):e})).replace(/__(\S[\s\S]*?)__/g,function(e,t){return/\S$/.test(t)?i(t,"<strong>","</strong>"):e})).replace(/_([^\s_][\s\S]*?)_/g,function(e,t){return/\S$/.test(t)?i(t,"<em>","</em>"):e}),e=t.literalMidWordAsterisks?(e=(e=e.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g,function(e,t,n){return i(n,t+"<strong><em>","</em></strong>")})).replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g,function(e,t,n){return i(n,t+"<strong>","</strong>")})).replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g,function(e,t,n){return i(n,t+"<em>","</em>")}):(e=(e=e.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g,function(e,t){return/\S$/.test(t)?i(t,"<strong><em>","</em></strong>"):e})).replace(/\*\*(\S[\s\S]*?)\*\*/g,function(e,t){return/\S$/.test(t)?i(t,"<strong>","</strong>"):e})).replace(/\*([^\s*][\s\S]*?)\*/g,function(e,t){return/\S$/.test(t)?i(t,"<em>","</em>"):e}),n.converter._dispatch("italicsAndBold.after",e,t,n)}),o.subParser("lists",function(e,t,n){"use strict";function i(e,i){n.gListLevel++,e=e.replace(/\n{2,}$/,"\n");var r=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,s=/\n[ \t]*\n(?!¨0)/.test(e+="¨0");return t.disableForced4SpacesIndentedSublists&&(r=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),e=(e=e.replace(r,function(e,i,r,a,l,c,u){u=u&&""!==u.trim();var d=o.subParser("outdent")(l,t,n),h="";return c&&t.tasklists&&(h=' class="task-list-item" style="list-style-type: none;"',d=d.replace(/^[ \t]*\[(x|X| )?]/m,function(){var e='<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"';return u&&(e+=" checked"),e+">"})),d=d.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g,function(e){return"¨A"+e}),i||d.search(/\n{2,}/)>-1?(d=o.subParser("githubCodeBlocks")(d,t,n),d=o.subParser("blockGamut")(d,t,n)):(d=(d=o.subParser("lists")(d,t,n)).replace(/\n$/,""),d=(d=o.subParser("hashHTMLBlocks")(d,t,n)).replace(/\n\n+/g,"\n\n"),d=s?o.subParser("paragraphs")(d,t,n):o.subParser("spanGamut")(d,t,n)),"<li"+h+">"+(d=d.replace("¨A",""))+"</li>\n"})).replace(/¨0/g,""),n.gListLevel--,i&&(e=e.replace(/\s+$/,"")),e}function r(e,t){if("ol"===t){var n=e.match(/^ *(\d+)\./);if(n&&"1"!==n[1])return' start="'+n[1]+'"'}return""}function s(e,n,o){var s=t.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,a=t.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,l="ul"===n?s:a,c="";if(-1!==e.search(l))!function t(u){var d=u.search(l),h=r(e,n);-1!==d?(c+="\n\n<"+n+h+">\n"+i(u.slice(0,d),!!o)+"</"+n+">\n",l="ul"==(n="ul"===n?"ol":"ul")?s:a,t(u.slice(d))):c+="\n\n<"+n+h+">\n"+i(u,!!o)+"</"+n+">\n"}(e);else{var u=r(e,n);c="\n\n<"+n+u+">\n"+i(e,!!o)+"</"+n+">\n"}return c}return e=n.converter._dispatch("lists.before",e,t,n),e+="¨0",e=(e=n.gListLevel?e.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(e,t,n){return s(t,n.search(/[*+-]/g)>-1?"ul":"ol",!0)}):e.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(e,t,n,i){return s(n,i.search(/[*+-]/g)>-1?"ul":"ol",!1)})).replace(/¨0/,""),n.converter._dispatch("lists.after",e,t,n)}),o.subParser("metadata",function(e,t,n){"use strict";if(!t.metadata)return e;function i(e){n.metadata.raw=e,(e=(e=e.replace(/&/g,"&").replace(/"/g,""")).replace(/\n {4}/g," ")).replace(/^([\S ]+): +([\s\S]+?)$/gm,function(e,t,i){return n.metadata.parsed[t]=i,""})}return e=(e=(e=(e=n.converter._dispatch("metadata.before",e,t,n)).replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/,function(e,t,n){return i(n),"¨M"})).replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/,function(e,t,r){return t&&(n.metadata.format=t),i(r),"¨M"})).replace(/¨M/g,""),n.converter._dispatch("metadata.after",e,t,n)}),o.subParser("outdent",function(e,t,n){"use strict";return e=(e=(e=n.converter._dispatch("outdent.before",e,t,n)).replace(/^(\t|[ ]{1,4})/gm,"¨0")).replace(/¨0/g,""),n.converter._dispatch("outdent.after",e,t,n)}),o.subParser("paragraphs",function(e,t,n){"use strict";for(var i=(e=(e=(e=n.converter._dispatch("paragraphs.before",e,t,n)).replace(/^\n+/g,"")).replace(/\n+$/g,"")).split(/\n{2,}/g),r=[],s=i.length,a=0;a<s;a++){var l=i[a];l.search(/¨(K|G)(\d+)\1/g)>=0?r.push(l):l.search(/\S/)>=0&&(l=(l=o.subParser("spanGamut")(l,t,n)).replace(/^([ \t]*)/g,"<p>"),l+="</p>",r.push(l))}for(s=r.length,a=0;a<s;a++){for(var c="",u=r[a],d=!1;/¨(K|G)(\d+)\1/.test(u);){var h=RegExp.$1,p=RegExp.$2;c=(c="K"===h?n.gHtmlBlocks[p]:d?o.subParser("encodeCode")(n.ghCodeBlocks[p].text,t,n):n.ghCodeBlocks[p].codeblock).replace(/\$/g,"$$$$"),u=u.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/,c),/^<pre\b[^>]*>\s*<code\b[^>]*>/.test(u)&&(d=!0)}r[a]=u}return e=(e=(e=r.join("\n")).replace(/^\n+/g,"")).replace(/\n+$/g,""),n.converter._dispatch("paragraphs.after",e,t,n)}),o.subParser("runExtension",function(e,t,n,i){"use strict";if(e.filter)t=e.filter(t,i.converter,n);else if(e.regex){var r=e.regex;r instanceof RegExp||(r=new RegExp(r,"g")),t=t.replace(r,e.replace)}return t}),o.subParser("spanGamut",function(e,t,n){"use strict";return e=n.converter._dispatch("spanGamut.before",e,t,n),e=o.subParser("codeSpans")(e,t,n),e=o.subParser("escapeSpecialCharsWithinTagAttributes")(e,t,n),e=o.subParser("encodeBackslashEscapes")(e,t,n),e=o.subParser("images")(e,t,n),e=o.subParser("anchors")(e,t,n),e=o.subParser("autoLinks")(e,t,n),e=o.subParser("simplifiedAutoLinks")(e,t,n),e=o.subParser("emoji")(e,t,n),e=o.subParser("underline")(e,t,n),e=o.subParser("italicsAndBold")(e,t,n),e=o.subParser("strikethrough")(e,t,n),e=o.subParser("ellipsis")(e,t,n),e=o.subParser("hashHTMLSpans")(e,t,n),e=o.subParser("encodeAmpsAndAngles")(e,t,n),t.simpleLineBreaks?/\n\n¨K/.test(e)||(e=e.replace(/\n+/g,"<br />\n")):e=e.replace(/ +\n/g,"<br />\n"),n.converter._dispatch("spanGamut.after",e,t,n)}),o.subParser("strikethrough",function(e,t,n){"use strict";return t.strikethrough&&(e=(e=n.converter._dispatch("strikethrough.before",e,t,n)).replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,function(e,i){return function(e){return t.simplifiedAutoLink&&(e=o.subParser("simplifiedAutoLinks")(e,t,n)),"<del>"+e+"</del>"}(i)}),e=n.converter._dispatch("strikethrough.after",e,t,n)),e}),o.subParser("stripLinkDefinitions",function(e,t,n){"use strict";var i=function(e,i,r,s,a,l,c){return i=i.toLowerCase(),r.match(/^data:.+?\/.+?;base64,/)?n.gUrls[i]=r.replace(/\s/g,""):n.gUrls[i]=o.subParser("encodeAmpsAndAngles")(r,t,n),l?l+c:(c&&(n.gTitles[i]=c.replace(/"|'/g,""")),t.parseImgDimensions&&s&&a&&(n.gDimensions[i]={width:s,height:a}),"")};return(e=(e=(e+="¨0").replace(/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm,i)).replace(/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,i)).replace(/¨0/,"")}),o.subParser("tables",function(e,t,n){"use strict";if(!t.tables)return e;function i(e){return/^:[ \t]*--*$/.test(e)?' style="text-align:left;"':/^--*[ \t]*:[ \t]*$/.test(e)?' style="text-align:right;"':/^:[ \t]*--*[ \t]*:$/.test(e)?' style="text-align:center;"':""}function r(e,i){var r="";return e=e.trim(),(t.tablesHeaderId||t.tableHeaderId)&&(r=' id="'+e.replace(/ /g,"_").toLowerCase()+'"'),"<th"+r+i+">"+(e=o.subParser("spanGamut")(e,t,n))+"</th>\n"}function s(e,i){return"<td"+i+">"+o.subParser("spanGamut")(e,t,n)+"</td>\n"}function a(e){var a,l=e.split("\n");for(a=0;a<l.length;++a)/^ {0,3}\|/.test(l[a])&&(l[a]=l[a].replace(/^ {0,3}\|/,"")),/\|[ \t]*$/.test(l[a])&&(l[a]=l[a].replace(/\|[ \t]*$/,"")),l[a]=o.subParser("codeSpans")(l[a],t,n);var c=l[0].split("|").map(function(e){return e.trim()}),u=l[1].split("|").map(function(e){return e.trim()}),d=[],h=[],p=[],f=[];for(l.shift(),l.shift(),a=0;a<l.length;++a)""!==l[a].trim()&&d.push(l[a].split("|").map(function(e){return e.trim()}));if(c.length<u.length)return e;for(a=0;a<u.length;++a)p.push(i(u[a]));for(a=0;a<c.length;++a)o.helper.isUndefined(p[a])&&(p[a]=""),h.push(r(c[a],p[a]));for(a=0;a<d.length;++a){for(var m=[],g=0;g<h.length;++g)o.helper.isUndefined(d[a][g]),m.push(s(d[a][g],p[g]));f.push(m)}return function(e,t){for(var n="<table>\n<thead>\n<tr>\n",i=e.length,r=0;r<i;++r)n+=e[r];for(n+="</tr>\n</thead>\n<tbody>\n",r=0;r<t.length;++r){n+="<tr>\n";for(var o=0;o<i;++o)n+=t[r][o];n+="</tr>\n"}return n+"</tbody>\n</table>\n"}(h,f)}return e=(e=(e=(e=n.converter._dispatch("tables.before",e,t,n)).replace(/\\(\|)/g,o.helper.escapeCharactersCallback)).replace(/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,a)).replace(/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm,a),n.converter._dispatch("tables.after",e,t,n)}),o.subParser("underline",function(e,t,n){"use strict";return t.underline?(e=n.converter._dispatch("underline.before",e,t,n),e=(e=t.literalMidWordUnderscores?(e=e.replace(/\b___(\S[\s\S]*?)___\b/g,function(e,t){return"<u>"+t+"</u>"})).replace(/\b__(\S[\s\S]*?)__\b/g,function(e,t){return"<u>"+t+"</u>"}):(e=e.replace(/___(\S[\s\S]*?)___/g,function(e,t){return/\S$/.test(t)?"<u>"+t+"</u>":e})).replace(/__(\S[\s\S]*?)__/g,function(e,t){return/\S$/.test(t)?"<u>"+t+"</u>":e})).replace(/(_)/g,o.helper.escapeCharactersCallback),e=n.converter._dispatch("underline.after",e,t,n)):e}),o.subParser("unescapeSpecialChars",function(e,t,n){"use strict";return e=(e=n.converter._dispatch("unescapeSpecialChars.before",e,t,n)).replace(/¨E(\d+)E/g,function(e,t){var n=parseInt(t);return String.fromCharCode(n)}),n.converter._dispatch("unescapeSpecialChars.after",e,t,n)}),o.subParser("makeMarkdown.blockquote",function(e,t){"use strict";var n="";if(e.hasChildNodes())for(var i=e.childNodes,r=i.length,s=0;s<r;++s){var a=o.subParser("makeMarkdown.node")(i[s],t);""!==a&&(n+=a)}return"> "+(n=n.trim()).split("\n").join("\n> ")}),o.subParser("makeMarkdown.codeBlock",function(e,t){"use strict";var n=e.getAttribute("language"),i=e.getAttribute("precodenum");return"```"+n+"\n"+t.preList[i]+"\n```"}),o.subParser("makeMarkdown.codeSpan",function(e){"use strict";return"`"+e.innerHTML+"`"}),o.subParser("makeMarkdown.emphasis",function(e,t){"use strict";var n="";if(e.hasChildNodes()){n+="*";for(var i=e.childNodes,r=i.length,s=0;s<r;++s)n+=o.subParser("makeMarkdown.node")(i[s],t);n+="*"}return n}),o.subParser("makeMarkdown.header",function(e,t,n){"use strict";var i=new Array(n+1).join("#"),r="";if(e.hasChildNodes()){r=i+" ";for(var s=e.childNodes,a=s.length,l=0;l<a;++l)r+=o.subParser("makeMarkdown.node")(s[l],t)}return r}),o.subParser("makeMarkdown.hr",function(){"use strict";return"---"}),o.subParser("makeMarkdown.image",function(e){"use strict";var t="";return e.hasAttribute("src")&&(t+="+">",e.hasAttribute("width")&&e.hasAttribute("height")&&(t+=" ="+e.getAttribute("width")+"x"+e.getAttribute("height")),e.hasAttribute("title")&&(t+=' "'+e.getAttribute("title")+'"'),t+=")"),t}),o.subParser("makeMarkdown.links",function(e,t){"use strict";var n="";if(e.hasChildNodes()&&e.hasAttribute("href")){var i=e.childNodes,r=i.length;n="[";for(var s=0;s<r;++s)n+=o.subParser("makeMarkdown.node")(i[s],t);n+="](",n+="<"+e.getAttribute("href")+">",e.hasAttribute("title")&&(n+=' "'+e.getAttribute("title")+'"'),n+=")"}return n}),o.subParser("makeMarkdown.list",function(e,t,n){"use strict";var i="";if(!e.hasChildNodes())return"";for(var r=e.childNodes,s=r.length,a=e.getAttribute("start")||1,l=0;l<s;++l)void 0!==r[l].tagName&&"li"===r[l].tagName.toLowerCase()&&(i+=("ol"===n?a.toString()+". ":"- ")+o.subParser("makeMarkdown.listItem")(r[l],t),++a);return(i+="\n\x3c!-- --\x3e\n").trim()}),o.subParser("makeMarkdown.listItem",function(e,t){"use strict";for(var n="",i=e.childNodes,r=i.length,s=0;s<r;++s)n+=o.subParser("makeMarkdown.node")(i[s],t);return/\n$/.test(n)?n=n.split("\n").join("\n ").replace(/^ {4}$/gm,"").replace(/\n\n+/g,"\n\n"):n+="\n",n}),o.subParser("makeMarkdown.node",function(e,t,n){"use strict";n=n||!1;var i="";if(3===e.nodeType)return o.subParser("makeMarkdown.txt")(e,t);if(8===e.nodeType)return"\x3c!--"+e.data+"--\x3e\n\n";if(1!==e.nodeType)return"";switch(e.tagName.toLowerCase()){case"h1":n||(i=o.subParser("makeMarkdown.header")(e,t,1)+"\n\n");break;case"h2":n||(i=o.subParser("makeMarkdown.header")(e,t,2)+"\n\n");break;case"h3":n||(i=o.subParser("makeMarkdown.header")(e,t,3)+"\n\n");break;case"h4":n||(i=o.subParser("makeMarkdown.header")(e,t,4)+"\n\n");break;case"h5":n||(i=o.subParser("makeMarkdown.header")(e,t,5)+"\n\n");break;case"h6":n||(i=o.subParser("makeMarkdown.header")(e,t,6)+"\n\n");break;case"p":n||(i=o.subParser("makeMarkdown.paragraph")(e,t)+"\n\n");break;case"blockquote":n||(i=o.subParser("makeMarkdown.blockquote")(e,t)+"\n\n");break;case"hr":n||(i=o.subParser("makeMarkdown.hr")(e,t)+"\n\n");break;case"ol":n||(i=o.subParser("makeMarkdown.list")(e,t,"ol")+"\n\n");break;case"ul":n||(i=o.subParser("makeMarkdown.list")(e,t,"ul")+"\n\n");break;case"precode":n||(i=o.subParser("makeMarkdown.codeBlock")(e,t)+"\n\n");break;case"pre":n||(i=o.subParser("makeMarkdown.pre")(e,t)+"\n\n");break;case"table":n||(i=o.subParser("makeMarkdown.table")(e,t)+"\n\n");break;case"code":i=o.subParser("makeMarkdown.codeSpan")(e,t);break;case"em":case"i":i=o.subParser("makeMarkdown.emphasis")(e,t);break;case"strong":case"b":i=o.subParser("makeMarkdown.strong")(e,t);break;case"del":i=o.subParser("makeMarkdown.strikethrough")(e,t);break;case"a":i=o.subParser("makeMarkdown.links")(e,t);break;case"img":i=o.subParser("makeMarkdown.image")(e,t);break;default:i=e.outerHTML+"\n\n"}return i}),o.subParser("makeMarkdown.paragraph",function(e,t){"use strict";var n="";if(e.hasChildNodes())for(var i=e.childNodes,r=i.length,s=0;s<r;++s)n+=o.subParser("makeMarkdown.node")(i[s],t);return n.trim()}),o.subParser("makeMarkdown.pre",function(e,t){"use strict";var n=e.getAttribute("prenum");return"<pre>"+t.preList[n]+"</pre>"}),o.subParser("makeMarkdown.strikethrough",function(e,t){"use strict";var n="";if(e.hasChildNodes()){n+="~~";for(var i=e.childNodes,r=i.length,s=0;s<r;++s)n+=o.subParser("makeMarkdown.node")(i[s],t);n+="~~"}return n}),o.subParser("makeMarkdown.strong",function(e,t){"use strict";var n="";if(e.hasChildNodes()){n+="**";for(var i=e.childNodes,r=i.length,s=0;s<r;++s)n+=o.subParser("makeMarkdown.node")(i[s],t);n+="**"}return n}),o.subParser("makeMarkdown.table",function(e,t){"use strict";var n,i,r="",s=[[],[]],a=e.querySelectorAll("thead>tr>th"),l=e.querySelectorAll("tbody>tr");for(n=0;n<a.length;++n){var c=o.subParser("makeMarkdown.tableCell")(a[n],t),u="---";if(a[n].hasAttribute("style"))switch(a[n].getAttribute("style").toLowerCase().replace(/\s/g,"")){case"text-align:left;":u=":---";break;case"text-align:right;":u="---:";break;case"text-align:center;":u=":---:"}s[0][n]=c.trim(),s[1][n]=u}for(n=0;n<l.length;++n){var d=s.push([])-1,h=l[n].getElementsByTagName("td");for(i=0;i<a.length;++i){var p=" ";void 0!==h[i]&&(p=o.subParser("makeMarkdown.tableCell")(h[i],t)),s[d].push(p)}}var f=3;for(n=0;n<s.length;++n)for(i=0;i<s[n].length;++i){var m=s[n][i].length;m>f&&(f=m)}for(n=0;n<s.length;++n){for(i=0;i<s[n].length;++i)1===n?":"===s[n][i].slice(-1)?s[n][i]=o.helper.padEnd(s[n][i].slice(-1),f-1,"-")+":":s[n][i]=o.helper.padEnd(s[n][i],f,"-"):s[n][i]=o.helper.padEnd(s[n][i],f);r+="| "+s[n].join(" | ")+" |\n"}return r.trim()}),o.subParser("makeMarkdown.tableCell",function(e,t){"use strict";var n="";if(!e.hasChildNodes())return"";for(var i=e.childNodes,r=i.length,s=0;s<r;++s)n+=o.subParser("makeMarkdown.node")(i[s],t,!0);return n.trim()}),o.subParser("makeMarkdown.txt",function(e){"use strict";var t=e.nodeValue;return t=(t=t.replace(/ +/g," ")).replace(/¨NBSP;/g," "),(t=(t=(t=(t=(t=(t=(t=(t=o.helper.unescapeHTMLEntities(t)).replace(/([*_~|`])/g,"\\$1")).replace(/^(\s*)>/g,"\\$1>")).replace(/^#/gm,"\\#")).replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3")).replace(/^( {0,3}\d+)\./gm,"$1\\.")).replace(/^( {0,3})([+-])/gm,"$1\\$2")).replace(/]([\s]*)\(/g,"\\]$1\\(")).replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:")}),void 0===(i=function(){"use strict";return o}.call(t,n,t,e))||(e.exports=i)}).call(this)},68743(e,t,n){var i=n(43575),r=n(67243),o=n(83868),s=n(89293);function a(){return Array.prototype.reduce.call(arguments,function(e,t){return r.resolve(e,t)})}function l(e){return"\\"===o.sep?e.replace(/\\/g,"/").replace(/^[a-z]:\/?/i,"/"):e}function c(e){return s(e.replace(/\+/g,"%2B"))}function u(e,t,n){setImmediate(function(){e(t,n)})}function d(e,t){try{return JSON.parse(e.replace(/^\)\]\}'/,""))}catch(e){throw e.sourceMapData=t,e}}function h(e,t,n){var i=c(t);try{return String(e(i))}catch(e){throw e.sourceMapData=n,e}}var p=/[#@] sourceMappingURL=([^\s'"]*)/,f=RegExp("(?:/\\*(?:\\s*\r?\n(?://)?)?(?:"+p.source+")\\s*\\*/|//(?:"+p.source+"))\\s*");function m(e,t,n,i){var r;try{r=v(e,t)}catch(e){return u(i,e)}if(!r||r.map)return u(i,null,r);n(c(r.url),function(e,t){if(e)return e.sourceMapData=r,i(e);r.map=String(t);try{r.map=d(r.map,r)}catch(e){return i(e)}i(null,r)})}function g(e,t,n){var i=v(e,t);return!i||i.map||(i.map=h(n,i.url,i),i.map=d(i.map,i)),i}var b=/^data:([^,;]*)(;[^,;]*)*(?:,(.*))?$/,y=/^(?:application|text)\/json$/;function v(e,t){t=l(t);var n=function(e){var t=e.match(f);return t?t[1]||t[2]||"":null}(e);if(!n)return null;var r=n.match(b);if(r){var o=r[1]||"text/plain",s=r[2]||"",c=r[3]||"",u={sourceMappingURL:n,url:null,sourcesRelativeTo:t,map:c};if(!y.test(o)){var h=new Error("Unuseful data uri mime type: "+o);throw h.sourceMapData=u,h}try{u.map=d(";base64"===s?function(e){if("undefined"==typeof TextDecoder||"undefined"==typeof Uint8Array)return i(e);var t=function(e){for(var t=i(e),n=t.length,r=new Uint8Array(n),o=0;o<n;o++)r[o]=t.charCodeAt(o);return r}(e);return new TextDecoder("utf-8",{fatal:!0}).decode(t)}(c):decodeURIComponent(c),u)}catch(h){throw h.sourceMapData=u,h}return u}var p=a(t,n);return{sourceMappingURL:n,url:p,sourcesRelativeTo:p,map:null}}function _(e,t,n,i,r){"function"==typeof i&&(r=i,i={});var o=e.sources?e.sources.length:0,s={sourcesResolved:[],sourcesContent:[]};if(0!==o){var a=function(){0===--o&&r(null,s)};w(e,t,i,function(e,t,i){if(s.sourcesResolved[i]=e,"string"==typeof t)s.sourcesContent[i]=t,u(a,null);else{var r=c(e);n(r,function(e,t){s.sourcesContent[i]=e||String(t),a()})}})}else u(r,null,s)}function x(e,t,n,i){var r={sourcesResolved:[],sourcesContent:[]};return e.sources&&0!==e.sources.length?(w(e,t,i,function(e,t,i){if(r.sourcesResolved[i]=e,null!==n)if("string"==typeof t)r.sourcesContent[i]=t;else{var o=c(e);try{r.sourcesContent[i]=String(n(o))}catch(e){r.sourcesContent[i]=e}}}),r):r}var k=/\/?$/;function w(e,t,n,i){var r;n=n||{},t=l(t);for(var o=0,s=e.sources.length;o<s;o++)r=null,"string"==typeof n.sourceRoot?r=n.sourceRoot:"string"==typeof e.sourceRoot&&!1!==n.sourceRoot&&(r=e.sourceRoot),i(null===r||""===r?a(t,e.sources[o]):a(t,r.replace(k,"/"),e.sources[o]),(e.sourcesContent||[])[o],o)}e.exports={resolveSourceMap:m,resolveSourceMapSync:g,resolveSources:_,resolveSourcesSync:x,resolve:function(e,t,n,i,r){if("function"==typeof i&&(r=i,i={}),null===e){var o={sourceMappingURL:null,url:t,sourcesRelativeTo:t,map:null},s=c(t);n(s,function(e,t){if(e)return e.sourceMapData=o,r(e);o.map=String(t);try{o.map=d(o.map,o)}catch(e){return r(e)}a(o)})}else m(e,t,n,function(e,t){return e?r(e):t?void a(t):r(null,null)});function a(e){_(e.map,e.sourcesRelativeTo,n,i,function(t,n){if(t)return r(t);e.sourcesResolved=n.sourcesResolved,e.sourcesContent=n.sourcesContent,r(null,e)})}},resolveSync:function(e,t,n,i){var r;if(null===e)(r={sourceMappingURL:null,url:t,sourcesRelativeTo:t,map:null}).map=h(n,t,r),r.map=d(r.map,r);else if(!(r=g(e,t,n)))return null;var o=x(r.map,r.sourcesRelativeTo,n,i);return r.sourcesResolved=o.sourcesResolved,r.sourcesContent=o.sourcesContent,r},parseMapToJSON:d}},56320(e,t,n){var i=n(49057),r=Object.prototype.hasOwnProperty,o="undefined"!=typeof Map;function s(){this._array=[],this._set=o?new Map:Object.create(null)}s.fromArray=function(e,t){for(var n=new s,i=0,r=e.length;i<r;i++)n.add(e[i],t);return n},s.prototype.size=function(){return o?this._set.size:Object.getOwnPropertyNames(this._set).length},s.prototype.add=function(e,t){var n=o?e:i.toSetString(e),s=o?this.has(e):r.call(this._set,n),a=this._array.length;s&&!t||this._array.push(e),s||(o?this._set.set(e,a):this._set[n]=a)},s.prototype.has=function(e){if(o)return this._set.has(e);var t=i.toSetString(e);return r.call(this._set,t)},s.prototype.indexOf=function(e){if(o){var t=this._set.get(e);if(t>=0)return t}else{var n=i.toSetString(e);if(r.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},s.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},s.prototype.toArray=function(){return this._array.slice()},t.C=s},13929(e,t,n){var i=n(77865);t.encode=function(e){var t,n="",r=function(e){return e<0?1+(-e<<1):0+(e<<1)}(e);do{t=31&r,(r>>>=5)>0&&(t|=32),n+=i.encode(t)}while(r>0);return n},t.decode=function(e,t,n){var r,o,s,a,l=e.length,c=0,u=0;do{if(t>=l)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(o=i.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));r=!!(32&o),c+=(o&=31)<<u,u+=5}while(r);n.value=(a=(s=c)>>1,1&~s?a:-a),n.rest=t}},77865(e,t){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");t.encode=function(e){if(0<=e&&e<n.length)return n[e];throw new TypeError("Must be between 0 and 63: "+e)},t.decode=function(e){return 65<=e&&e<=90?e-65:97<=e&&e<=122?e-97+26:48<=e&&e<=57?e-48+52:43==e?62:47==e?63:-1}},24988(e,t){function n(e,i,r,o,s,a){var l=Math.floor((i-e)/2)+e,c=s(r,o[l],!0);return 0===c?l:c>0?i-l>1?n(l,i,r,o,s,a):a==t.LEAST_UPPER_BOUND?i<o.length?i:-1:l:l-e>1?n(e,l,r,o,s,a):a==t.LEAST_UPPER_BOUND?l:e<0?-1:e}t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.search=function(e,i,r,o){if(0===i.length)return-1;var s=n(-1,i.length,e,i,r,o||t.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&0===r(i[s],i[s-1],!0);)--s;return s}},59131(e,t,n){var i=n(49057);function r(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}r.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},r.prototype.add=function(e){var t,n,r,o,s,a;n=e,r=(t=this._last).generatedLine,o=n.generatedLine,s=t.generatedColumn,a=n.generatedColumn,o>r||o==r&&a>=s||i.compareByGeneratedPositionsInflated(t,n)<=0?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},r.prototype.toArray=function(){return this._sorted||(this._array.sort(i.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},t.P=r},84252(e,t){function n(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}function i(e,t,r,o){if(r<o){var s=r-1;n(e,(u=r,d=o,Math.round(u+Math.random()*(d-u))),o);for(var a=e[o],l=r;l<o;l++)t(e[l],a)<=0&&n(e,s+=1,l);n(e,s+1,l);var c=s+1;i(e,t,r,c-1),i(e,t,c+1,o)}var u,d}t.g=function(e,t){i(e,t,0,e.length-1)}},2589(e,t,n){var i=n(49057),r=n(24988),o=n(56320).C,s=n(13929),a=n(84252).g;function l(e,t){var n=e;return"string"==typeof e&&(n=i.parseSourceMapInput(e)),null!=n.sections?new d(n,t):new c(n,t)}function c(e,t){var n=e;"string"==typeof e&&(n=i.parseSourceMapInput(e));var r=i.getArg(n,"version"),s=i.getArg(n,"sources"),a=i.getArg(n,"names",[]),l=i.getArg(n,"sourceRoot",null),c=i.getArg(n,"sourcesContent",null),u=i.getArg(n,"mappings"),d=i.getArg(n,"file",null);if(r!=this._version)throw new Error("Unsupported version: "+r);l&&(l=i.normalize(l)),s=s.map(String).map(i.normalize).map(function(e){return l&&i.isAbsolute(l)&&i.isAbsolute(e)?i.relative(l,e):e}),this._names=o.fromArray(a.map(String),!0),this._sources=o.fromArray(s,!0),this._absoluteSources=this._sources.toArray().map(function(e){return i.computeSourceURL(l,e,t)}),this.sourceRoot=l,this.sourcesContent=c,this._mappings=u,this._sourceMapURL=t,this.file=d}function u(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function d(e,t){var n=e;"string"==typeof e&&(n=i.parseSourceMapInput(e));var r=i.getArg(n,"version"),s=i.getArg(n,"sections");if(r!=this._version)throw new Error("Unsupported version: "+r);this._sources=new o,this._names=new o;var a={line:-1,column:0};this._sections=s.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var n=i.getArg(e,"offset"),r=i.getArg(n,"line"),o=i.getArg(n,"column");if(r<a.line||r===a.line&&o<a.column)throw new Error("Section offsets must be ordered and non-overlapping.");return a=n,{generatedOffset:{generatedLine:r+1,generatedColumn:o+1},consumer:new l(i.getArg(e,"map"),t)}})}l.fromSourceMap=function(e,t){return c.fromSourceMap(e,t)},l.prototype._version=3,l.prototype.__generatedMappings=null,Object.defineProperty(l.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),l.prototype.__originalMappings=null,Object.defineProperty(l.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),l.prototype._charIsMappingSeparator=function(e,t){var n=e.charAt(t);return";"===n||","===n},l.prototype._parseMappings=function(e,t){throw new Error("Subclasses must implement _parseMappings")},l.GENERATED_ORDER=1,l.ORIGINAL_ORDER=2,l.GREATEST_LOWER_BOUND=1,l.LEAST_UPPER_BOUND=2,l.prototype.eachMapping=function(e,t,n){var r,o=t||null;switch(n||l.GENERATED_ORDER){case l.GENERATED_ORDER:r=this._generatedMappings;break;case l.ORIGINAL_ORDER:r=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var s=this.sourceRoot;r.map(function(e){var t=null===e.source?null:this._sources.at(e.source);return{source:t=i.computeSourceURL(s,t,this._sourceMapURL),generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:null===e.name?null:this._names.at(e.name)}},this).forEach(e,o)},l.prototype.allGeneratedPositionsFor=function(e){var t=i.getArg(e,"line"),n={source:i.getArg(e,"source"),originalLine:t,originalColumn:i.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var o=[],s=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",i.compareByOriginalPositions,r.LEAST_UPPER_BOUND);if(s>=0){var a=this._originalMappings[s];if(void 0===e.column)for(var l=a.originalLine;a&&a.originalLine===l;)o.push({line:i.getArg(a,"generatedLine",null),column:i.getArg(a,"generatedColumn",null),lastColumn:i.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++s];else for(var c=a.originalColumn;a&&a.originalLine===t&&a.originalColumn==c;)o.push({line:i.getArg(a,"generatedLine",null),column:i.getArg(a,"generatedColumn",null),lastColumn:i.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++s]}return o},t.SourceMapConsumer=l,c.prototype=Object.create(l.prototype),c.prototype.consumer=l,c.prototype._findSourceIndex=function(e){var t,n=e;if(null!=this.sourceRoot&&(n=i.relative(this.sourceRoot,n)),this._sources.has(n))return this._sources.indexOf(n);for(t=0;t<this._absoluteSources.length;++t)if(this._absoluteSources[t]==e)return t;return-1},c.fromSourceMap=function(e,t){var n=Object.create(c.prototype),r=n._names=o.fromArray(e._names.toArray(),!0),s=n._sources=o.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file,n._sourceMapURL=t,n._absoluteSources=n._sources.toArray().map(function(e){return i.computeSourceURL(n.sourceRoot,e,t)});for(var l=e._mappings.toArray().slice(),d=n.__generatedMappings=[],h=n.__originalMappings=[],p=0,f=l.length;p<f;p++){var m=l[p],g=new u;g.generatedLine=m.generatedLine,g.generatedColumn=m.generatedColumn,m.source&&(g.source=s.indexOf(m.source),g.originalLine=m.originalLine,g.originalColumn=m.originalColumn,m.name&&(g.name=r.indexOf(m.name)),h.push(g)),d.push(g)}return a(n.__originalMappings,i.compareByOriginalPositions),n},c.prototype._version=3,Object.defineProperty(c.prototype,"sources",{get:function(){return this._absoluteSources.slice()}}),c.prototype._parseMappings=function(e,t){for(var n,r,o,l,c,d=1,h=0,p=0,f=0,m=0,g=0,b=e.length,y=0,v={},_={},x=[],k=[];y<b;)if(";"===e.charAt(y))d++,y++,h=0;else if(","===e.charAt(y))y++;else{for((n=new u).generatedLine=d,l=y;l<b&&!this._charIsMappingSeparator(e,l);l++);if(o=v[r=e.slice(y,l)])y+=r.length;else{for(o=[];y<l;)s.decode(e,y,_),c=_.value,y=_.rest,o.push(c);if(2===o.length)throw new Error("Found a source, but no line and column");if(3===o.length)throw new Error("Found a source and line, but no column");v[r]=o}n.generatedColumn=h+o[0],h=n.generatedColumn,o.length>1&&(n.source=m+o[1],m+=o[1],n.originalLine=p+o[2],p=n.originalLine,n.originalLine+=1,n.originalColumn=f+o[3],f=n.originalColumn,o.length>4&&(n.name=g+o[4],g+=o[4])),k.push(n),"number"==typeof n.originalLine&&x.push(n)}a(k,i.compareByGeneratedPositionsDeflated),this.__generatedMappings=k,a(x,i.compareByOriginalPositions),this.__originalMappings=x},c.prototype._findMapping=function(e,t,n,i,o,s){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[i]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[i]);return r.search(e,t,o,s)},c.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(t.generatedLine===n.generatedLine){t.lastGeneratedColumn=n.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}},c.prototype.originalPositionFor=function(e){var t={generatedLine:i.getArg(e,"line"),generatedColumn:i.getArg(e,"column")},n=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",i.compareByGeneratedPositionsDeflated,i.getArg(e,"bias",l.GREATEST_LOWER_BOUND));if(n>=0){var r=this._generatedMappings[n];if(r.generatedLine===t.generatedLine){var o=i.getArg(r,"source",null);null!==o&&(o=this._sources.at(o),o=i.computeSourceURL(this.sourceRoot,o,this._sourceMapURL));var s=i.getArg(r,"name",null);return null!==s&&(s=this._names.at(s)),{source:o,line:i.getArg(r,"originalLine",null),column:i.getArg(r,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}},c.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e})},c.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var r,o=e;if(null!=this.sourceRoot&&(o=i.relative(this.sourceRoot,o)),null!=this.sourceRoot&&(r=i.urlParse(this.sourceRoot))){var s=o.replace(/^file:\/\//,"");if("file"==r.scheme&&this._sources.has(s))return this.sourcesContent[this._sources.indexOf(s)];if((!r.path||"/"==r.path)&&this._sources.has("/"+o))return this.sourcesContent[this._sources.indexOf("/"+o)]}if(t)return null;throw new Error('"'+o+'" is not in the SourceMap.')},c.prototype.generatedPositionFor=function(e){var t=i.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};var n={source:t,originalLine:i.getArg(e,"line"),originalColumn:i.getArg(e,"column")},r=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",i.compareByOriginalPositions,i.getArg(e,"bias",l.GREATEST_LOWER_BOUND));if(r>=0){var o=this._originalMappings[r];if(o.source===n.source)return{line:i.getArg(o,"generatedLine",null),column:i.getArg(o,"generatedColumn",null),lastColumn:i.getArg(o,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},d.prototype=Object.create(l.prototype),d.prototype.constructor=l,d.prototype._version=3,Object.defineProperty(d.prototype,"sources",{get:function(){for(var e=[],t=0;t<this._sections.length;t++)for(var n=0;n<this._sections[t].consumer.sources.length;n++)e.push(this._sections[t].consumer.sources[n]);return e}}),d.prototype.originalPositionFor=function(e){var t={generatedLine:i.getArg(e,"line"),generatedColumn:i.getArg(e,"column")},n=r.search(t,this._sections,function(e,t){return e.generatedLine-t.generatedOffset.generatedLine||e.generatedColumn-t.generatedOffset.generatedColumn}),o=this._sections[n];return o?o.consumer.originalPositionFor({line:t.generatedLine-(o.generatedOffset.generatedLine-1),column:t.generatedColumn-(o.generatedOffset.generatedLine===t.generatedLine?o.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},d.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})},d.prototype.sourceContentFor=function(e,t){for(var n=0;n<this._sections.length;n++){var i=this._sections[n].consumer.sourceContentFor(e,!0);if(i)return i}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},d.prototype.generatedPositionFor=function(e){for(var t=0;t<this._sections.length;t++){var n=this._sections[t];if(-1!==n.consumer._findSourceIndex(i.getArg(e,"source"))){var r=n.consumer.generatedPositionFor(e);if(r)return{line:r.line+(n.generatedOffset.generatedLine-1),column:r.column+(n.generatedOffset.generatedLine===r.line?n.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},d.prototype._parseMappings=function(e,t){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var r=this._sections[n],o=r.consumer._generatedMappings,s=0;s<o.length;s++){var l=o[s],c=r.consumer._sources.at(l.source);c=i.computeSourceURL(r.consumer.sourceRoot,c,this._sourceMapURL),this._sources.add(c),c=this._sources.indexOf(c);var u=null;l.name&&(u=r.consumer._names.at(l.name),this._names.add(u),u=this._names.indexOf(u));var d={source:c,generatedLine:l.generatedLine+(r.generatedOffset.generatedLine-1),generatedColumn:l.generatedColumn+(r.generatedOffset.generatedLine===l.generatedLine?r.generatedOffset.generatedColumn-1:0),originalLine:l.originalLine,originalColumn:l.originalColumn,name:u};this.__generatedMappings.push(d),"number"==typeof d.originalLine&&this.__originalMappings.push(d)}a(this.__generatedMappings,i.compareByGeneratedPositionsDeflated),a(this.__originalMappings,i.compareByOriginalPositions)}},15356(e,t,n){var i=n(13929),r=n(49057),o=n(56320).C,s=n(59131).P;function a(e){e||(e={}),this._file=r.getArg(e,"file",null),this._sourceRoot=r.getArg(e,"sourceRoot",null),this._skipValidation=r.getArg(e,"skipValidation",!1),this._sources=new o,this._names=new o,this._mappings=new s,this._sourcesContents=null}a.prototype._version=3,a.fromSourceMap=function(e){var t=e.sourceRoot,n=new a({file:e.file,sourceRoot:t});return e.eachMapping(function(e){var i={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(i.source=e.source,null!=t&&(i.source=r.relative(t,i.source)),i.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(i.name=e.name)),n.addMapping(i)}),e.sources.forEach(function(i){var o=i;null!==t&&(o=r.relative(t,i)),n._sources.has(o)||n._sources.add(o);var s=e.sourceContentFor(i);null!=s&&n.setSourceContent(i,s)}),n},a.prototype.addMapping=function(e){var t=r.getArg(e,"generated"),n=r.getArg(e,"original",null),i=r.getArg(e,"source",null),o=r.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,n,i,o),null!=i&&(i=String(i),this._sources.has(i)||this._sources.add(i)),null!=o&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=n&&n.line,originalColumn:null!=n&&n.column,source:i,name:o})},a.prototype.setSourceContent=function(e,t){var n=e;null!=this._sourceRoot&&(n=r.relative(this._sourceRoot,n)),null!=t?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[r.toSetString(n)]=t):this._sourcesContents&&(delete this._sourcesContents[r.toSetString(n)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},a.prototype.applySourceMap=function(e,t,n){var i=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');i=e.file}var s=this._sourceRoot;null!=s&&(i=r.relative(s,i));var a=new o,l=new o;this._mappings.unsortedForEach(function(t){if(t.source===i&&null!=t.originalLine){var o=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=o.source&&(t.source=o.source,null!=n&&(t.source=r.join(n,t.source)),null!=s&&(t.source=r.relative(s,t.source)),t.originalLine=o.line,t.originalColumn=o.column,null!=o.name&&(t.name=o.name))}var c=t.source;null==c||a.has(c)||a.add(c);var u=t.name;null==u||l.has(u)||l.add(u)},this),this._sources=a,this._names=l,e.sources.forEach(function(t){var i=e.sourceContentFor(t);null!=i&&(null!=n&&(t=r.join(n,t)),null!=s&&(t=r.relative(s,t)),this.setSourceContent(t,i))},this)},a.prototype._validateMapping=function(e,t,n,i){if(t&&"number"!=typeof t.line&&"number"!=typeof t.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||t||n||i)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:i}))},a.prototype._serializeMappings=function(){for(var e,t,n,o,s=0,a=1,l=0,c=0,u=0,d=0,h="",p=this._mappings.toArray(),f=0,m=p.length;f<m;f++){if(e="",(t=p[f]).generatedLine!==a)for(s=0;t.generatedLine!==a;)e+=";",a++;else if(f>0){if(!r.compareByGeneratedPositionsInflated(t,p[f-1]))continue;e+=","}e+=i.encode(t.generatedColumn-s),s=t.generatedColumn,null!=t.source&&(o=this._sources.indexOf(t.source),e+=i.encode(o-d),d=o,e+=i.encode(t.originalLine-1-c),c=t.originalLine-1,e+=i.encode(t.originalColumn-l),l=t.originalColumn,null!=t.name&&(n=this._names.indexOf(t.name),e+=i.encode(n-u),u=n)),h+=e}return h},a.prototype._generateSourcesContent=function(e,t){return e.map(function(e){if(!this._sourcesContents)return null;null!=t&&(e=r.relative(t,e));var n=r.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null},this)},a.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},a.prototype.toString=function(){return JSON.stringify(this.toJSON())},t.SourceMapGenerator=a},81624(e,t,n){var i=n(15356).SourceMapGenerator,r=n(49057),o=/(\r?\n)/,s="$$$isSourceNode$$$";function a(e,t,n,i,r){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==n?null:n,this.name=null==r?null:r,this[s]=!0,null!=i&&this.add(i)}a.fromStringWithSourceMap=function(e,t,n){var i=new a,s=e.split(o),l=0,c=function(){return e()+(e()||"");function e(){return l<s.length?s[l++]:void 0}},u=1,d=0,h=null;return t.eachMapping(function(e){if(null!==h){if(!(u<e.generatedLine)){var t=(n=s[l]||"").substr(0,e.generatedColumn-d);return s[l]=n.substr(e.generatedColumn-d),d=e.generatedColumn,p(h,t),void(h=e)}p(h,c()),u++,d=0}for(;u<e.generatedLine;)i.add(c()),u++;if(d<e.generatedColumn){var n=s[l]||"";i.add(n.substr(0,e.generatedColumn)),s[l]=n.substr(e.generatedColumn),d=e.generatedColumn}h=e},this),l<s.length&&(h&&p(h,c()),i.add(s.splice(l).join(""))),t.sources.forEach(function(e){var o=t.sourceContentFor(e);null!=o&&(null!=n&&(e=r.join(n,e)),i.setSourceContent(e,o))}),i;function p(e,t){if(null===e||void 0===e.source)i.add(t);else{var o=n?r.join(n,e.source):e.source;i.add(new a(e.originalLine,e.originalColumn,o,t,e.name))}}},a.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(e){this.add(e)},this);else{if(!e[s]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},a.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else{if(!e[s]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},a.prototype.walk=function(e){for(var t,n=0,i=this.children.length;n<i;n++)(t=this.children[n])[s]?t.walk(e):""!==t&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})},a.prototype.join=function(e){var t,n,i=this.children.length;if(i>0){for(t=[],n=0;n<i-1;n++)t.push(this.children[n]),t.push(e);t.push(this.children[n]),this.children=t}return this},a.prototype.replaceRight=function(e,t){var n=this.children[this.children.length-1];return n[s]?n.replaceRight(e,t):"string"==typeof n?this.children[this.children.length-1]=n.replace(e,t):this.children.push("".replace(e,t)),this},a.prototype.setSourceContent=function(e,t){this.sourceContents[r.toSetString(e)]=t},a.prototype.walkSourceContents=function(e){for(var t=0,n=this.children.length;t<n;t++)this.children[t][s]&&this.children[t].walkSourceContents(e);var i=Object.keys(this.sourceContents);for(t=0,n=i.length;t<n;t++)e(r.fromSetString(i[t]),this.sourceContents[i[t]])},a.prototype.toString=function(){var e="";return this.walk(function(t){e+=t}),e},a.prototype.toStringWithSourceMap=function(e){var t={code:"",line:1,column:0},n=new i(e),r=!1,o=null,s=null,a=null,l=null;return this.walk(function(e,i){t.code+=e,null!==i.source&&null!==i.line&&null!==i.column?(o===i.source&&s===i.line&&a===i.column&&l===i.name||n.addMapping({source:i.source,original:{line:i.line,column:i.column},generated:{line:t.line,column:t.column},name:i.name}),o=i.source,s=i.line,a=i.column,l=i.name,r=!0):r&&(n.addMapping({generated:{line:t.line,column:t.column}}),o=null,r=!1);for(var c=0,u=e.length;c<u;c++)10===e.charCodeAt(c)?(t.line++,t.column=0,c+1===u?(o=null,r=!1):r&&n.addMapping({source:i.source,original:{line:i.line,column:i.column},generated:{line:t.line,column:t.column},name:i.name})):t.column++}),this.walkSourceContents(function(e,t){n.setSourceContent(e,t)}),{code:t.code,map:n}}},49057(e,t){t.getArg=function(e,t,n){if(t in e)return e[t];if(3===arguments.length)return n;throw new Error('"'+t+'" is a required argument.')};var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,i=/^data:.+\,.+$/;function r(e){var t=e.match(n);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function o(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function s(e){var n=e,i=r(e);if(i){if(!i.path)return e;n=i.path}for(var s,a=t.isAbsolute(n),l=n.split(/\/+/),c=0,u=l.length-1;u>=0;u--)"."===(s=l[u])?l.splice(u,1):".."===s?c++:c>0&&(""===s?(l.splice(u+1,c),c=0):(l.splice(u,2),c--));return""===(n=l.join("/"))&&(n=a?"/":"."),i?(i.path=n,o(i)):n}function a(e,t){""===e&&(e="."),""===t&&(t=".");var n=r(t),a=r(e);if(a&&(e=a.path||"/"),n&&!n.scheme)return a&&(n.scheme=a.scheme),o(n);if(n||t.match(i))return t;if(a&&!a.host&&!a.path)return a.host=t,o(a);var l="/"===t.charAt(0)?t:s(e.replace(/\/+$/,"")+"/"+t);return a?(a.path=l,o(a)):l}t.urlParse=r,t.urlGenerate=o,t.normalize=s,t.join=a,t.isAbsolute=function(e){return"/"===e.charAt(0)||n.test(e)},t.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var i=e.lastIndexOf("/");if(i<0)return t;if((e=e.slice(0,i)).match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)};var l=!("__proto__"in Object.create(null));function c(e){return e}function u(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function d(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}t.toSetString=l?c:function(e){return u(e)?"$"+e:e},t.fromSetString=l?c:function(e){return u(e)?e.slice(1):e},t.compareByOriginalPositions=function(e,t,n){var i=d(e.source,t.source);return 0!==i||0!==(i=e.originalLine-t.originalLine)||0!==(i=e.originalColumn-t.originalColumn)||n||0!==(i=e.generatedColumn-t.generatedColumn)||0!==(i=e.generatedLine-t.generatedLine)?i:d(e.name,t.name)},t.compareByGeneratedPositionsDeflated=function(e,t,n){var i=e.generatedLine-t.generatedLine;return 0!==i||0!==(i=e.generatedColumn-t.generatedColumn)||n||0!==(i=d(e.source,t.source))||0!==(i=e.originalLine-t.originalLine)||0!==(i=e.originalColumn-t.originalColumn)?i:d(e.name,t.name)},t.compareByGeneratedPositionsInflated=function(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n||0!==(n=e.generatedColumn-t.generatedColumn)||0!==(n=d(e.source,t.source))||0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)?n:d(e.name,t.name)},t.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},t.computeSourceURL=function(e,t,n){if(t=t||"",e&&("/"!==e[e.length-1]&&"/"!==t[0]&&(e+="/"),t=e+t),n){var i=r(n);if(!i)throw new Error("sourceMapURL could not be parsed");if(i.path){var l=i.path.lastIndexOf("/");l>=0&&(i.path=i.path.substring(0,l+1))}t=a(o(i),t)}return s(t)}},56116(e,t,n){t.SourceMapGenerator=n(15356).SourceMapGenerator,t.SourceMapConsumer=n(2589).SourceMapConsumer,n(81624)},67243(e,t,n){"use strict";var i=n(89738);function r(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var o=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(l),u=["%","/","?",";","#"].concat(c),d=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=n(71453);function y(e,t,n){if(e&&"object"==typeof e&&e instanceof r)return e;var i=new r;return i.parse(e,t,n),i}r.prototype.parse=function(e,t,n){if("string"!=typeof e)throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var r=e.indexOf("?"),s=-1!==r&&r<e.indexOf("#")?"?":"#",l=e.split(s);l[0]=l[0].replace(/\\/g,"/");var y=e=l.join(s);if(y=y.trim(),!n&&1===e.split("#").length){var v=a.exec(y);if(v)return this.path=y,this.href=y,this.pathname=v[1],v[2]?(this.search=v[2],this.query=t?b.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var _=o.exec(y);if(_){var x=(_=_[0]).toLowerCase();this.protocol=x,y=y.substr(_.length)}if(n||_||y.match(/^\/\/[^@/]+@[^@/]+/)){var k="//"===y.substr(0,2);!k||_&&m[_]||(y=y.substr(2),this.slashes=!0)}if(!m[_]&&(k||_&&!g[_])){for(var w,C,S=-1,A=0;A<d.length;A++)-1!==(I=y.indexOf(d[A]))&&(-1===S||I<S)&&(S=I);for(-1!==(C=-1===S?y.lastIndexOf("@"):y.lastIndexOf("@",S))&&(w=y.slice(0,C),y=y.slice(C+1),this.auth=decodeURIComponent(w)),S=-1,A=0;A<u.length;A++){var I;-1!==(I=y.indexOf(u[A]))&&(-1===S||I<S)&&(S=I)}-1===S&&(S=y.length),this.host=y.slice(0,S),y=y.slice(S),this.parseHost(),this.hostname=this.hostname||"";var E="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!E)for(var j=this.hostname.split(/\./),T=(A=0,j.length);A<T;A++){var B=j[A];if(B&&!B.match(h)){for(var N="",R=0,O=B.length;R<O;R++)B.charCodeAt(R)>127?N+="x":N+=B[R];if(!N.match(h)){var L=j.slice(0,A),M=j.slice(A+1),P=B.match(p);P&&(L.push(P[1]),M.unshift(P[2])),M.length&&(y="/"+M.join(".")+y),this.hostname=L.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),E||(this.hostname=i.toASCII(this.hostname));var D=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+D,this.href+=this.host,E&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==y[0]&&(y="/"+y))}if(!f[x])for(A=0,T=c.length;A<T;A++){var z=c[A];if(-1!==y.indexOf(z)){var V=encodeURIComponent(z);V===z&&(V=escape(z)),y=y.split(z).join(V)}}var U=y.indexOf("#");-1!==U&&(this.hash=y.substr(U),y=y.slice(0,U));var $=y.indexOf("?");if(-1!==$?(this.search=y.substr($),this.query=y.substr($+1),t&&(this.query=b.parse(this.query)),y=y.slice(0,$)):t&&(this.search="",this.query={}),y&&(this.pathname=y),g[x]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){D=this.pathname||"";var H=this.search||"";this.path=D+H}return this.href=this.format(),this},r.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",i=this.hash||"",r=!1,o="";this.host?r=e+this.host:this.hostname&&(r=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(r+=":"+this.port)),this.query&&"object"==typeof this.query&&Object.keys(this.query).length&&(o=b.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var s=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||g[t])&&!1!==r?(r="//"+(r||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):r||(r=""),i&&"#"!==i.charAt(0)&&(i="#"+i),s&&"?"!==s.charAt(0)&&(s="?"+s),t+r+(n=n.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(s=s.replace("#","%23"))+i},r.prototype.resolve=function(e){return this.resolveObject(y(e,!1,!0)).format()},r.prototype.resolveObject=function(e){if("string"==typeof e){var t=new r;t.parse(e,!1,!0),e=t}for(var n=new r,i=Object.keys(this),o=0;o<i.length;o++){var s=i[o];n[s]=this[s]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var a=Object.keys(e),l=0;l<a.length;l++){var c=a[l];"protocol"!==c&&(n[c]=e[c])}return g[n.protocol]&&n.hostname&&!n.pathname&&(n.pathname="/",n.path=n.pathname),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!g[e.protocol]){for(var u=Object.keys(e),d=0;d<u.length;d++){var h=u[d];n[h]=e[h]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||m[e.protocol])n.pathname=e.pathname;else{for(var p=(e.pathname||"").split("/");p.length&&!(e.host=p.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),n.pathname=p.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var f=n.pathname||"",b=n.search||"";n.path=f+b}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var y=n.pathname&&"/"===n.pathname.charAt(0),v=e.host||e.pathname&&"/"===e.pathname.charAt(0),_=v||y||n.host&&e.pathname,x=_,k=n.pathname&&n.pathname.split("/")||[],w=(p=e.pathname&&e.pathname.split("/")||[],n.protocol&&!g[n.protocol]);if(w&&(n.hostname="",n.port=null,n.host&&(""===k[0]?k[0]=n.host:k.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===p[0]?p[0]=e.host:p.unshift(e.host)),e.host=null),_=_&&(""===p[0]||""===k[0])),v)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,k=p;else if(p.length)k||(k=[]),k.pop(),k=k.concat(p),n.search=e.search,n.query=e.query;else if(null!=e.search)return w&&(n.host=k.shift(),n.hostname=n.host,(E=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=E.shift(),n.hostname=E.shift(),n.host=n.hostname)),n.search=e.search,n.query=e.query,null===n.pathname&&null===n.search||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!k.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var C=k.slice(-1)[0],S=(n.host||e.host||k.length>1)&&("."===C||".."===C)||""===C,A=0,I=k.length;I>=0;I--)"."===(C=k[I])?k.splice(I,1):".."===C?(k.splice(I,1),A++):A&&(k.splice(I,1),A--);if(!_&&!x)for(;A--;A)k.unshift("..");!_||""===k[0]||k[0]&&"/"===k[0].charAt(0)||k.unshift(""),S&&"/"!==k.join("/").substr(-1)&&k.push("");var E,j=""===k[0]||k[0]&&"/"===k[0].charAt(0);return w&&(n.hostname=j?"":k.length?k.shift():"",n.host=n.hostname,(E=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=E.shift(),n.hostname=E.shift(),n.host=n.hostname)),(_=_||n.host&&k.length)&&!j&&k.unshift(""),k.length>0?n.pathname=k.join("/"):(n.pathname=null,n.path=null),null===n.pathname&&null===n.search||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},r.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},t.parse=y,t.resolve=function(e,t){return y(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?y(e,!1,!0).resolveObject(t):t},t.format=function(e){return"string"==typeof e&&(e=y(e)),e instanceof r?e.format():r.prototype.format.call(e)},t.Url=r},41669(e){"use strict";e.exports=jQuery},54581(){},14993(){},28479(){},62876(){},54652(){},8437(){},81516(){},83868(){},46931(e){e.exports={nanoid:(e=21)=>{let t="",n=0|e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let i="",r=0|n;for(;r--;)i+=e[Math.random()*e.length|0];return i}}}},e=>{e.O(0,[223],()=>e(e.s=94325)),e.O()}]);