PATH:
home
/
lab2454c
/
caimegroup.com
/
wp-content
/
plugins
/
mailpoet
/
assets
/
dist
/
js
/*! For license information please see form_editor.js.LICENSE.txt */ (self.webpackChunk=self.webpackChunk||[]).push([[514],{89504:function(e,t,n){e=n.nmd(e),function(t){"use strict";var n,r="function"==typeof(n=t.atob)?n:"function"==typeof Buffer?function(e){return new Buffer(e,"base64").toString("binary")}:"object"==typeof t.base64js?function(e){var n=t.base64js.b64ToByteArray(e);return Array.prototype.map.call(n,(function(e){return String.fromCharCode(e)})).join("")}:function(){throw new Error("You're probably in an old browser or an iOS webworker. It might help to include beatgammit's base64-js.")};t.atob=r,e&&e.exports&&(e.exports=r)}(window)},17121:function(e,t){var n,r;n=function(e,t){"use strict";var n,r,o="function"==typeof Map?new Map:(n=[],r=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return r[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),r.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),r.splice(t,1))}}),i=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){i=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function a(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!o.has(e)){var t=null,n=null,r=null,a=function(){e.clientWidth!==n&&d()},s=function(t){window.removeEventListener("resize",a,!1),e.removeEventListener("input",d,!1),e.removeEventListener("keyup",d,!1),e.removeEventListener("autosize:destroy",s,!1),e.removeEventListener("autosize:update",d,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),o.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",s,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",d,!1),window.addEventListener("resize",a,!1),e.addEventListener("input",d,!1),e.addEventListener("autosize:update",d,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",o.set(e,{destroy:s,update:d}),"vertical"===(l=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===l.resize&&(e.style.resize="horizontal"),t="content-box"===l.boxSizing?-(parseFloat(l.paddingTop)+parseFloat(l.paddingBottom)):parseFloat(l.borderTopWidth)+parseFloat(l.borderBottomWidth),isNaN(t)&&(t=0),d()}var l;function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(){if(0!==e.scrollHeight){var r=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),o=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,r.forEach((function(e){e.node.scrollTop=e.scrollTop})),o&&(document.documentElement.scrollTop=o)}}function d(){u();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),o="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(o<t?"hidden"===n.overflowY&&(c("scroll"),u(),o="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),u(),o="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),r!==o){r=o;var a=i("autosize:resized");try{e.dispatchEvent(a)}catch(e){}}}}function s(e){var t=o.get(e);t&&t.destroy()}function l(e){var t=o.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 a(e)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],s),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===(r=n.apply(t,[e,t]))||(e.exports=r)},9393:function(e,t,n){"use strict";var r={};n.r(r),n.d(r,{__experimentalBatch:function(){return ua},__experimentalReceiveCurrentGlobalStylesId:function(){return Ji},__experimentalReceiveThemeBaseGlobalStyles:function(){return Qi},__experimentalReceiveThemeGlobalStyleVariations:function(){return ea},__experimentalSaveSpecifiedEntityEdits:function(){return pa},__unstableCreateUndoLevel:function(){return la},addEntities:function(){return Ki},deleteEntityRecord:function(){return oa},editEntityRecord:function(){return ia},receiveAutosaves:function(){return fa},receiveCurrentTheme:function(){return Xi},receiveCurrentUser:function(){return qi},receiveEmbedPreview:function(){return ra},receiveEntityRecords:function(){return Yi},receiveNavigationFallbackId:function(){return ga},receiveThemeGlobalStyleRevisions:function(){return na},receiveThemeSupports:function(){return ta},receiveUploadPermissions:function(){return ha},receiveUserPermission:function(){return ma},receiveUserQuery:function(){return Gi},redo:function(){return sa},saveEditedEntityRecord:function(){return da},saveEntityRecord:function(){return ca},undo:function(){return aa}});var o={};n.r(o),n.d(o,{__experimentalGetCurrentGlobalStylesId:function(){return gs},__experimentalGetCurrentThemeBaseGlobalStyles:function(){return Is},__experimentalGetCurrentThemeGlobalStylesVariations:function(){return Ts},__experimentalGetDirtyEntityRecords:function(){return es},__experimentalGetEntitiesBeingSaved:function(){return ts},__experimentalGetEntityRecordNoResolver:function(){return Ya},__experimentalGetTemplateForLink:function(){return Ss},canUser:function(){return _s},canUserEditEntityRecord:function(){return ks},getAuthors:function(){return Va},getAutosave:function(){return Es},getAutosaves:function(){return ws},getBlockPatternCategories:function(){return Ps},getBlockPatterns:function(){return Ns},getCurrentTheme:function(){return fs},getCurrentThemeGlobalStylesRevisions:function(){return As},getCurrentUser:function(){return Ha},getEditedEntityRecord:function(){return is},getEmbedPreview:function(){return vs},getEntitiesByKind:function(){return $a},getEntitiesConfig:function(){return Wa},getEntity:function(){return Ga},getEntityConfig:function(){return qa},getEntityRecord:function(){return Ka},getEntityRecordEdits:function(){return ns},getEntityRecordNonTransientEdits:function(){return rs},getEntityRecords:function(){return Qa},getLastEntityDeleteError:function(){return us},getLastEntitySaveError:function(){return cs},getRawEntityRecord:function(){return Xa},getRedoEdit:function(){return ps},getReferenceByDistinctEdits:function(){return xs},getThemeSupports:function(){return bs},getUndoEdit:function(){return ds},getUserPatternCategories:function(){return Rs},getUserQueryResults:function(){return Ua},hasEditsForEntityRecord:function(){return os},hasEntityRecords:function(){return Ja},hasFetchedAutosaves:function(){return Cs},hasRedo:function(){return ms},hasUndo:function(){return hs},isAutosavingEntityRecord:function(){return as},isDeletingEntityRecord:function(){return ls},isPreviewEmbedFallback:function(){return ys},isRequestingEmbedPreview:function(){return za},isSavingEntityRecord:function(){return ss}});var i={};n.r(i),n.d(i,{getNavigationFallbackId:function(){return Ls},getUndoManager:function(){return Bs}});var a={};n.r(a),n.d(a,{__experimentalGetCurrentGlobalStylesId:function(){return Xs},__experimentalGetCurrentThemeBaseGlobalStyles:function(){return Js},__experimentalGetCurrentThemeGlobalStylesVariations:function(){return Qs},__experimentalGetTemplateForLink:function(){return Ys},canUser:function(){return Ws},canUserEditEntityRecord:function(){return Gs},getAuthors:function(){return Os},getAutosave:function(){return Ks},getAutosaves:function(){return qs},getBlockPatternCategories:function(){return nl},getBlockPatterns:function(){return tl},getCurrentTheme:function(){return Hs},getCurrentThemeGlobalStylesRevisions:function(){return el},getCurrentUser:function(){return Fs},getEditedEntityRecord:function(){return zs},getEmbedPreview:function(){return $s},getEntityRecord:function(){return js},getEntityRecords:function(){return Vs},getNavigationFallbackId:function(){return ol},getRawEntityRecord:function(){return Zs},getThemeSupports:function(){return Us},getUserPatternCategories:function(){return rl}});var s={};n.r(s),n.d(s,{__experimentalHasContentRoleAttribute:function(){return hu},getActiveBlockVariation:function(){return Qc},getBlockStyles:function(){return Xc},getBlockSupport:function(){return lu},getBlockType:function(){return Yc},getBlockTypes:function(){return Kc},getBlockVariations:function(){return Jc},getCategories:function(){return tu},getChildBlockNames:function(){return su},getCollections:function(){return nu},getDefaultBlockName:function(){return ru},getDefaultBlockVariation:function(){return eu},getFreeformFallbackBlockName:function(){return ou},getGroupingBlockName:function(){return au},getUnregisteredFallbackBlockName:function(){return iu},hasBlockSupport:function(){return cu},hasChildBlocks:function(){return du},hasChildBlocksWithInserterSupport:function(){return pu},isMatchingSearchTerm:function(){return uu}});var l={};n.r(l),n.d(l,{getBootstrappedBlockType:function(){return bu},getSupportedStyles:function(){return gu},getUnprocessedBlockTypes:function(){return vu}});var c={};n.r(c),n.d(c,{__experimentalReapplyBlockFilters:function(){return Su},addBlockCollection:function(){return Fu},addBlockStyles:function(){return Tu},addBlockTypes:function(){return Cu},addBlockVariations:function(){return Pu},reapplyBlockTypeFilters:function(){return xu},removeBlockCollection:function(){return ju},removeBlockStyles:function(){return Nu},removeBlockTypes:function(){return Iu},removeBlockVariations:function(){return Ru},setCategories:function(){return Du},setDefaultBlockName:function(){return Au},setFreeformFallbackBlockName:function(){return Bu},setGroupingBlockName:function(){return Mu},setUnregisteredFallbackBlockName:function(){return Lu},updateCategory:function(){return Ou}});var u={};n.r(u),n.d(u,{addBootstrappedBlockType:function(){return Zu},addUnprocessedBlockType:function(){return zu}});var d={};n.r(d),n.d(d,{getFormatType:function(){return Sm},getFormatTypeForBareElement:function(){return Im},getFormatTypeForClassName:function(){return Tm},getFormatTypes:function(){return xm}});var p={};n.r(p),n.d(p,{addFormatTypes:function(){return Nm},removeFormatTypes:function(){return Pm}});var h={};n.r(h),n.d(h,{__experimentalGetActiveBlockIdByBlockNames:function(){return ov},__experimentalGetAllowedBlocks:function(){return Bb},__experimentalGetAllowedPatterns:function(){return Zb},__experimentalGetBlockListSettingsForBlocks:function(){return Gb},__experimentalGetDirectInsertBlock:function(){return Mb},__experimentalGetGlobalBlocksByName:function(){return pg},__experimentalGetLastBlockAttributeChanges:function(){return Yb},__experimentalGetParsedPattern:function(){return Fb},__experimentalGetPatternTransformItems:function(){return Hb},__experimentalGetPatternsByBlockTypes:function(){return Vb},__experimentalGetReusableBlockTitle:function(){return qb},__experimentalUserPatternCategories:function(){return Ob},__unstableGetBlockWithoutInnerBlocks:function(){return ig},__unstableGetClientIdWithClientIdsTree:function(){return sg},__unstableGetClientIdsTree:function(){return lg},__unstableGetContentLockingParent:function(){return lv},__unstableGetEditorMode:function(){return Qb},__unstableGetSelectedBlocksWithPartialSelection:function(){return Gg},__unstableGetTemporarilyEditingAsBlocks:function(){return cv},__unstableGetVisibleBlocks:function(){return sv},__unstableHasActiveBlockOverlayActive:function(){return uv},__unstableIsFullySelected:function(){return Hg},__unstableIsLastBlockChangeIgnored:function(){return Kb},__unstableIsSelectionCollapsed:function(){return Ug},__unstableIsSelectionMergeable:function(){return Wg},__unstableIsWithinBlockOverlay:function(){return dv},__unstableSelectionHasUnmergeableBlock:function(){return $g},areInnerBlocksControlled:function(){return rv},canEditBlock:function(){return Eb},canInsertBlockType:function(){return bb},canInsertBlocks:function(){return vb},canLockBlockType:function(){return Cb},canMoveBlock:function(){return kb},canMoveBlocks:function(){return wb},canRemoveBlock:function(){return yb},canRemoveBlocks:function(){return _b},didAutomaticChange:function(){return tv},getAdjacentBlockClientId:function(){return Ng},getAllowedBlocks:function(){return Ab},getBlock:function(){return og},getBlockAttributes:function(){return rg},getBlockCount:function(){return fg},getBlockEditingMode:function(){return pv},getBlockHierarchyRootClientId:function(){return Ig},getBlockIndex:function(){return Kg},getBlockInsertionPoint:function(){return ub},getBlockListSettings:function(){return Ub},getBlockMode:function(){return rb},getBlockName:function(){return tg},getBlockNamesByClientId:function(){return mg},getBlockOrder:function(){return qg},getBlockParents:function(){return xg},getBlockParentsByBlockName:function(){return Sg},getBlockRootClientId:function(){return Cg},getBlockSelectionEnd:function(){return yg},getBlockSelectionStart:function(){return vg},getBlockTransformItems:function(){return Pb},getBlocks:function(){return ag},getBlocksByClientId:function(){return hg},getClientIdsOfDescendants:function(){return cg},getClientIdsWithDescendants:function(){return ug},getDirectInsertBlock:function(){return Lb},getDraggedBlockClientIds:function(){return ab},getFirstMultiSelectedBlockClientId:function(){return Dg},getGlobalBlockCount:function(){return dg},getInserterItems:function(){return Nb},getLastMultiSelectedBlockClientId:function(){return Og},getLowestCommonAncestorWithSelectedBlock:function(){return Tg},getMultiSelectedBlockClientIds:function(){return Lg},getMultiSelectedBlocks:function(){return Mg},getMultiSelectedBlocksEndClientId:function(){return Vg},getMultiSelectedBlocksStartClientId:function(){return zg},getNextBlockClientId:function(){return Rg},getPatternsByBlockTypes:function(){return zb},getPreviousBlockClientId:function(){return Pg},getSelectedBlock:function(){return Eg},getSelectedBlockClientId:function(){return wg},getSelectedBlockClientIds:function(){return Bg},getSelectedBlockCount:function(){return _g},getSelectedBlocksInitialCaretPosition:function(){return Ag},getSelectionEnd:function(){return bg},getSelectionStart:function(){return gg},getSettings:function(){return $b},getTemplate:function(){return hb},getTemplateLock:function(){return mb},hasBlockMovingClientId:function(){return ev},hasDraggedInnerBlock:function(){return Jg},hasInserterItems:function(){return Rb},hasMultiSelection:function(){return eb},hasSelectedBlock:function(){return kg},hasSelectedInnerBlock:function(){return Xg},isAncestorBeingDragged:function(){return lb},isAncestorMultiSelected:function(){return Zg},isBlockBeingDragged:function(){return sb},isBlockHighlighted:function(){return nv},isBlockInsertionPointVisible:function(){return db},isBlockMultiSelected:function(){return jg},isBlockSelected:function(){return Yg},isBlockValid:function(){return ng},isBlockVisible:function(){return av},isBlockWithinSelection:function(){return Qg},isCaretWithinFormattedText:function(){return cb},isDraggingBlocks:function(){return ib},isFirstMultiSelectedBlock:function(){return Fg},isGroupable:function(){return mv},isLastBlockChangePersistent:function(){return Wb},isMultiSelecting:function(){return tb},isNavigationMode:function(){return Jb},isSelectionEnabled:function(){return nb},isTyping:function(){return ob},isUngroupable:function(){return hv},isValidTemplate:function(){return pb},wasBlockJustInserted:function(){return iv}});var m={};n.r(m),n.d(m,{__experimentalUpdateSettings:function(){return gv},clearBlockRemovalPrompt:function(){return kv},deleteStyleOverride:function(){return xv},ensureDefaultBlock:function(){return _v},hideBlockInterface:function(){return bv},privateRemoveBlocks:function(){return yv},setBlockRemovalRules:function(){return wv},setOpenedBlockSettingsMenu:function(){return Ev},setStyleOverride:function(){return Cv},showBlockInterface:function(){return vv}});var f={};n.r(f),n.d(f,{getBlockRemovalRules:function(){return Av},getEnabledBlockParents:function(){return Pv},getEnabledClientIdsTree:function(){return Nv},getInserterMediaCategories:function(){return Dv},getLastInsertedBlocksClientIds:function(){return Iv},getOpenedBlockSettingsMenu:function(){return Bv},getRegisteredInserterMediaCategories:function(){return Mv},getRemovalPromptData:function(){return Rv},getStyleOverrides:function(){return Lv},isBlockInterfaceHidden:function(){return Sv},isBlockSubtreeDisabled:function(){return Tv}});var g={};n.r(g),n.d(g,{__unstableDeleteSelection:function(){return my},__unstableExpandSelection:function(){return gy},__unstableMarkAutomaticChange:function(){return My},__unstableMarkLastChangeAsPersistent:function(){return By},__unstableMarkNextChangeAsNotPersistent:function(){return Ly},__unstableSaveReusableBlock:function(){return Ay},__unstableSetEditorMode:function(){return Oy},__unstableSetTemporarilyEditingAsBlocks:function(){return Wy},__unstableSplitSelection:function(){return fy},clearSelectedBlock:function(){return Jv},duplicateBlocks:function(){return jy},enterFormattedText:function(){return Sy},exitFormattedText:function(){return Iy},flashBlock:function(){return Hy},hideInsertionPoint:function(){return dy},insertAfterBlock:function(){return zy},insertBeforeBlock:function(){return Zy},insertBlock:function(){return ly},insertBlocks:function(){return cy},insertDefaultBlock:function(){return Ny},mergeBlocks:function(){return by},moveBlockToPosition:function(){return sy},moveBlocksDown:function(){return oy},moveBlocksToPosition:function(){return ay},moveBlocksUp:function(){return iy},multiSelect:function(){return Xv},receiveBlocks:function(){return Hv},registerInserterMediaCategory:function(){return Gy},removeBlock:function(){return yy},removeBlocks:function(){return vy},replaceBlock:function(){return ny},replaceBlocks:function(){return ty},replaceInnerBlocks:function(){return _y},resetBlocks:function(){return Zv},resetSelection:function(){return Vv},selectBlock:function(){return Wv},selectNextBlock:function(){return qv},selectPreviousBlock:function(){return Gv},selectionChange:function(){return Ty},setBlockEditingMode:function(){return qy},setBlockMovingClientId:function(){return Fy},setBlockVisibility:function(){return $y},setHasControlledInnerBlocks:function(){return Uy},setNavigationMode:function(){return Dy},setTemplateValidity:function(){return py},showInsertionPoint:function(){return uy},startDraggingBlocks:function(){return Cy},startMultiSelect:function(){return Kv},startTyping:function(){return wy},stopDraggingBlocks:function(){return xy},stopMultiSelect:function(){return Yv},stopTyping:function(){return Ey},synchronizeTemplate:function(){return hy},toggleBlockHighlight:function(){return Vy},toggleBlockMode:function(){return ky},toggleSelection:function(){return Qv},unsetBlockEditingMode:function(){return Ky},updateBlock:function(){return $v},updateBlockAttributes:function(){return Uv},updateBlockListSettings:function(){return Py},updateSettings:function(){return Ry},validateBlocksToTemplate:function(){return zv}});var b={};n.r(b),n.d(b,{ButtonContentView:function(){return qw},LabelView:function(){return Hw},Uz:function(){return Yw},Ji:function(){return $w},IA:function(){return Uw}});var v={};n.r(v),n.d(v,{find:function(){return vA}});var y={};n.r(y),n.d(y,{find:function(){return xA},findNext:function(){return IA},findPrevious:function(){return SA},isTabbableIndex:function(){return _A}});var _={};n.r(_),n.d(_,{_v:function(){return az},TooltipPopoverView:function(){return sz},lr:function(){return lz}});var k={};n.r(k),n.d(k,{AdvancedPanel:function(){return h1},BorderPanel:function(){return rH},ColorPanel:function(){return RU},DimensionsPanel:function(){return TG},EffectsPanel:function(){return i1},FiltersPanel:function(){return bq},GlobalStylesContext:function(){return fC},ImageSettingsPanel:function(){return d1},TypographyPanel:function(){return W$},areGlobalStyleConfigsEqual:function(){return mC},getBlockCSSSelector:function(){return lq},getLayoutStyles:function(){return U0},useGlobalSetting:function(){return yC},useGlobalStyle:function(){return _C},useGlobalStylesOutput:function(){return Q0},useGlobalStylesOutputWithConfig:function(){return J0},useGlobalStylesReset:function(){return vC},useHasBorderPanel:function(){return YV},useHasColorPanel:function(){return vU},useHasDimensionsPanel:function(){return gG},useHasEffectsPanel:function(){return t1},useHasFiltersPanel:function(){return dq},useHasImageSettingsPanel:function(){return u1},useHasTypographyPanel:function(){return L$},useSettingsForBlockElement:function(){return kC}});var w={};n.r(w),n.d(w,{applyStylesToAllTextInputs:function(){return A5},blocksChangedInBlockEditor:function(){return R5},changeActiveSidebar:function(){return y5},changeFormBlocks:function(){return n5},changeFormName:function(){return r5},changeFormSettings:function(){return f5},changeFormStyles:function(){return s5},changePreviewSettings:function(){return _5},createCustomField:function(){return N5},createCustomFieldDone:function(){return p5},createCustomFieldFailed:function(){return m5},createCustomFieldStarted:function(){return h5},customFieldEdited:function(){return l5},deleteCustomField:function(){return P5},deleteCustomFieldDone:function(){return i5},deleteCustomFieldFailed:function(){return a5},deleteCustomFieldStarted:function(){return o5},hidePreview:function(){return E5},historyRedo:function(){return L5},historyUndo:function(){return B5},removeNotice:function(){return C5},saveCustomField:function(){return T5},saveCustomFieldDone:function(){return c5},saveCustomFieldFailed:function(){return d5},saveCustomFieldStarted:function(){return u5},saveForm:function(){return I5},saveFormDone:function(){return g5},saveFormFailed:function(){return v5},saveFormStarted:function(){return b5},showPlacementSettings:function(){return k5},showPreview:function(){return w5},switchDefaultSidebarTab:function(){return x5},toggleForm:function(){return e5},toggleFullscreen:function(){return t5},toggleInserter:function(){return Q2},toggleSidebar:function(){return J2},toggleSidebarPanel:function(){return S5},tutorialDismissed:function(){return M5}});var E={};n.r(E),n.d(E,{selectCategory:function(){return Dae},selectTemplate:function(){return Mae}});var C={};n.r(C),n.d(C,{CALL_API:function(){return q5.t},TRACK_EVENT:function(){return Oae.L}});var x=n(70079),S=n(2226),I=n(61970),T=n(14526),N=n(92883),P=n(26372),R=n.n(P),A=n(96082),B=n(43160),L=n(55701),M=n.n(L),D=n(21915),O=n(83554);function F(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}const j=(e,t)=>{const n=e?.findIndex((({id:e})=>"string"==typeof e?e===t.id:(0,O.default)(e,t.id))),r=[...e];return-1!==n?r[n]={id:t.id,changes:F(r[n].changes,t.changes)}:r.push(t),r};var Z=e=>t=>(n,r)=>void 0===n||e(r)?t(n,r):n,z=e=>t=>(n,r)=>t(n,e(r)),V=e=>t=>(n={},r)=>{const o=r[e];if(void 0===o)return n;const i=t(n[o],r);return i===n[o]?n:{...n,[o]:i}},H=n(27759),U=n(61387),$=n(51867),W=n(26275),G=n(28234),q=n(27786);function K(e,t,n){if(!e||"object"!=typeof e)return e;const r=Array.isArray(t)?t:t.split(".");return r.reduce(((e,t,o)=>(void 0===e[t]&&(Number.isInteger(r[o+1])?e[t]=[]:e[t]={}),o===r.length-1&&(e[t]=n),e[t])),e),e}function Y(e,t,n){if(!e||"object"!=typeof e||"string"!=typeof t&&!Array.isArray(t))return e;const r=Array.isArray(t)?t:t.split(".");let o=e;return r.forEach((e=>{o=o?.[e]})),void 0!==o?o:n}function X(e,t){return{type:"RECEIVE_ITEMS",items:Array.isArray(e)?e:[e],persistedEdits:t}}let J=null;async function Q(e){if(null===J){const e=await(0,I.default)({path:"/batch/v1",method:"OPTIONS"});J=e.endpoints[0].args.requests.maxItems}const t=[];for(const n of function(e,t){const n=[...e],r=[];for(;n.length;)r.push(n.splice(0,t));return r}(e,J)){const e=await(0,I.default)({path:"/batch/v1",method:"POST",data:{validation:"require-all-validate",requests:n.map((e=>({path:e.path,body:e.data,method:e.method,headers:e.headers})))}});let r;r=e.failed?e.responses.map((e=>({error:e?.body}))):e.responses.map((e=>{const t={};return e.status>=200&&e.status<300?t.output=e.body:t.error=e.body,t})),t.push(...r)}return t}function ee(e=Q){let t=0,n=[];const r=new te;return{add(e){const o=++t;r.add(o);const i=e=>new Promise(((t,i)=>{n.push({input:e,resolve:t,reject:i}),r.delete(o)}));return"function"==typeof e?Promise.resolve(e(i)).finally((()=>{r.delete(o)})):i(e)},async run(){let t;r.size&&await new Promise((e=>{const t=r.subscribe((()=>{r.size||(t(),e(void 0))}))}));try{if(t=await e(n.map((({input:e})=>e))),t.length!==n.length)throw new Error("run: Array returned by processor must be same size as input array.")}catch(e){for(const{reject:t}of n)t(e);throw e}let o=!0;return t.forEach(((e,t)=>{const r=n[t];var i;e?.error?(r?.reject(e.error),o=!1):r?.resolve(null!==(i=e?.output)&&void 0!==i?i:e)})),n=[],o}}}class te{constructor(...e){this.set=new Set(...e),this.subscribers=new Set}get size(){return this.set.size}add(e){return this.set.add(e),this.subscribers.forEach((e=>e())),this}delete(e){const t=this.set.delete(e);return this.subscribers.forEach((e=>e())),t}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}}const ne="core",re=()=>new Map,oe=e=>{const t=re();return e.forEach(((e,n)=>{t.set(n,e)})),t},ie=(e,t,n)=>{let r=e.get(t);return void 0===r&&e.set(t,r=n()),r},ae=()=>new Set,se=e=>e[e.length-1],le=(e,t)=>{for(let n=0;n<t.length;n++)e.push(t[n])},ce=Array.from,ue=Array.isArray;class de{constructor(){this._observers=re()}on(e,t){ie(this._observers,e,ae).add(t)}once(e,t){const n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){const n=this._observers.get(e);void 0!==n&&(n.delete(t),0===n.size&&this._observers.delete(e))}emit(e,t){return ce((this._observers.get(e)||re()).values()).forEach((e=>e(...t)))}destroy(){this._observers=re()}}const pe=Math.floor,he=(Math.ceil,Math.abs),me=(Math.imul,Math.round,Math.log10),fe=(Math.log2,Math.log,Math.sqrt,(e,t)=>e<t?e:t),ge=(e,t)=>e>t?e:t,be=(Number.isNaN,Math.pow,Math.sign,e=>0!==e?e<0:1/e<0),ve=64,ye=128,_e=127,ke=Number.MAX_SAFE_INTEGER,we=(Number.MIN_SAFE_INTEGER,Number.isInteger||(e=>"number"==typeof e&&isFinite(e)&&pe(e)===e)),Ee=(Number.isNaN,Number.parseInt,String.fromCharCode),Ce=(String.fromCodePoint,Ee(65535),/^\s*/g),xe=/([A-Z])/g,Se=(e,t)=>(e=>e.replace(Ce,""))(e.replace(xe,(e=>`${t}${(e=>e.toLowerCase())(e)}`))),Ie="undefined"!=typeof TextEncoder?new TextEncoder:null,Te=Ie?e=>Ie.encode(e):e=>{const t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.codePointAt(e);return r};let Ne="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});Ne&&1===Ne.decode(new Uint8Array).length&&(Ne=null);class Pe{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const Re=()=>new Pe,Ae=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 r=0;r<e.bufs.length;r++){const o=e.bufs[r];t.set(o,n),n+=o.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),n),t},Be=(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},Le=Be,Me=(e,t)=>{for(;t>_e;)Be(e,ye|_e&t),t=pe(t/128);Be(e,_e&t)},De=(e,t)=>{const n=be(t);for(n&&(t=-t),Be(e,(t>63?ye:0)|(n?ve:0)|63&t),t=pe(t/64);t>0;)Be(e,(t>_e?ye:0)|_e&t),t=pe(t/128)},Oe=new Uint8Array(3e4),Fe=Oe.length/3,je=Ie&&Ie.encodeInto?(e,t)=>{if(t.length<Fe){const n=Ie.encodeInto(t,Oe).written||0;Me(e,n);for(let t=0;t<n;t++)Be(e,Oe[t])}else ze(e,Te(t))}:(e,t)=>{const n=unescape(encodeURIComponent(t)),r=n.length;Me(e,r);for(let t=0;t<r;t++)Be(e,n.codePointAt(t))},Ze=(e,t)=>{const n=e.cbuf.length,r=e.cpos,o=fe(n-r,t.length),i=t.length-o;e.cbuf.set(t.subarray(0,o),r),e.cpos+=o,i>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(ge(2*n,i)),e.cbuf.set(t.subarray(o)),e.cpos=i)},ze=(e,t)=>{Me(e,t.byteLength),Ze(e,t)},Ve=(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*ge(n,t)),e.cpos=0)})(e,t);const n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},He=new DataView(new ArrayBuffer(4)),Ue=(e,t)=>{switch(typeof t){case"string":Be(e,119),je(e,t);break;case"number":we(t)&&he(t)<=2147483647?(Be(e,125),De(e,t)):(n=t,He.setFloat32(0,n),He.getFloat32(0)===n?(Be(e,124),((e,t)=>{Ve(e,4).setFloat32(0,t,!1)})(e,t)):(Be(e,123),((e,t)=>{Ve(e,8).setFloat64(0,t,!1)})(e,t)));break;case"bigint":Be(e,122),((e,t)=>{Ve(e,8).setBigInt64(0,t,!1)})(e,t);break;case"object":if(null===t)Be(e,126);else if(ue(t)){Be(e,117),Me(e,t.length);for(let n=0;n<t.length;n++)Ue(e,t[n])}else if(t instanceof Uint8Array)Be(e,116),ze(e,t);else{Be(e,118);const n=Object.keys(t);Me(e,n.length);for(let r=0;r<n.length;r++){const o=n[r];je(e,o),Ue(e,t[o])}}break;case"boolean":Be(e,t?120:121);break;default:Be(e,127)}var n};class $e extends Pe{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&Me(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const We=e=>{e.count>0&&(De(e.encoder,1===e.count?e.s:-e.s),e.count>1&&Me(e.encoder,e.count-2))};class Ge{constructor(){this.encoder=new Pe,this.s=0,this.count=0}write(e){this.s===e?this.count++:(We(this),this.count=1,this.s=e)}toUint8Array(){return We(this),Ae(this.encoder)}}const qe=e=>{if(e.count>0){const t=2*e.diff+(1===e.count?0:1);De(e.encoder,t),e.count>1&&Me(e.encoder,e.count-2)}};class Ke{constructor(){this.encoder=new Pe,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(qe(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return qe(this),Ae(this.encoder)}}class Ye{constructor(){this.sarr=[],this.s="",this.lensE=new Ge}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 Pe;return this.sarr.push(this.s),this.s="",je(e,this.sarr.join("")),Ze(e,this.lensE.toUint8Array()),Ae(e)}}const Xe=e=>new Error(e),Je=()=>{throw Xe("Method unimplemented")},Qe=()=>{throw Xe("Unexpected case")},et=Xe("Unexpected end of array"),tt=Xe("Integer out of Range");class nt{constructor(e){this.arr=e,this.pos=0}}const rt=e=>new nt(e),ot=e=>((e,t)=>{const n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n})(e,at(e)),it=e=>e.arr[e.pos++],at=e=>{let t=0,n=1;const r=e.arr.length;for(;e.pos<r;){const r=e.arr[e.pos++];if(t+=(r&_e)*n,n*=128,r<ye)return t;if(t>ke)throw tt}throw et},st=e=>{let t=e.arr[e.pos++],n=63&t,r=64;const o=(t&ve)>0?-1:1;if(0==(t&ye))return o*n;const i=e.arr.length;for(;e.pos<i;){if(t=e.arr[e.pos++],n+=(t&_e)*r,r*=128,t<ye)return o*n;if(n>ke)throw tt}throw et},lt=Ne?e=>Ne.decode(ot(e)):e=>{let t=at(e);if(0===t)return"";{let n=String.fromCodePoint(it(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(it(e));else for(;t>0;){const r=t<1e4?t:1e4,o=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,o),t-=r}return decodeURIComponent(escape(n))}},ct=(e,t)=>{const n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n},ut=[e=>{},e=>null,st,e=>ct(e,4).getFloat32(0,!1),e=>ct(e,8).getFloat64(0,!1),e=>ct(e,8).getBigInt64(0,!1),e=>!1,e=>!0,lt,e=>{const t=at(e),n={};for(let r=0;r<t;r++)n[lt(e)]=dt(e);return n},e=>{const t=at(e),n=[];for(let r=0;r<t;r++)n.push(dt(e));return n},ot],dt=e=>ut[127-it(e)](e);class pt extends nt{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=at(this)+1:this.count=-1),this.count--,this.s;var e}}class ht extends nt{constructor(e){super(e),this.s=0,this.count=0}read(){if(0===this.count){this.s=st(this);const e=be(this.s);this.count=1,e&&(this.s=-this.s,this.count=at(this)+2)}return this.count--,this.s}}class mt extends nt{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(0===this.count){const e=st(this),t=1&e;this.diff=pe(e/2),this.count=1,t&&(this.count=at(this)+2)}return this.s+=this.diff,this.count--,this.s}}class ft{constructor(e){this.decoder=new ht(e),this.str=lt(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 gt=crypto.getRandomValues.bind(crypto),bt=Math.random,vt=()=>gt(new Uint32Array(1))[0],yt=[1e7]+-1e3+-4e3+-8e3+-1e11,_t=()=>yt.replace(/[018]/g,(e=>(e^vt()&15>>e/4).toString(16))),kt=e=>new Promise(e),wt=(Promise.all.bind(Promise),e=>Promise.resolve(e));let Et=new class{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}},Ct=!0;try{"undefined"!=typeof localStorage&&localStorage&&(Et=localStorage,Ct=!1)}catch(e){}const xt=Et,St=Object.assign,It=Object.keys,Tt=e=>It(e).length,Nt=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Pt=(e,t,n=0)=>{try{for(;n<e.length;n++)e[n](...t)}finally{n<e.length&&Pt(e,t,n+1)}},Rt=()=>{},At=e=>e,Bt=(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)||!Bt(e.get(n),t.get(n)))return!1;break;case Object:if(Tt(e)!==Tt(t))return!1;for(const n in e)if(!Nt(e,n)||!Bt(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(!Bt(e[n],t[n]))return!1;break;default:return!1}return!0},Lt="undefined"!=typeof process&&process.release&&/node|io\.js/.test(process.release.name)&&"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0),Mt="undefined"!=typeof window&&"undefined"!=typeof document&&!Lt;let Dt;"undefined"!=typeof navigator&&/Mac/.test(navigator.platform);const Ot=[],Ft=e=>(()=>{if(void 0===Dt)if(Lt){Dt=re();const e=process.argv;let t=null;for(let n=0;n<e.length;n++){const r=e[n];"-"===r[0]?(null!==t&&Dt.set(t,""),t=r):null!==t?(Dt.set(t,r),t=null):Ot.push(r)}null!==t&&Dt.set(t,"")}else"object"==typeof location?(Dt=re(),(location.search||"?").slice(1).split("&").forEach((e=>{if(0!==e.length){const[t,n]=e.split("=");Dt.set(`--${Se(t,"-")}`,n),Dt.set(`-${Se(t,"-")}`,n)}}))):Dt=re();return Dt})().has(e),jt=e=>(e=>void 0===e?null:e)(Lt?process.env[e.toUpperCase()]:xt.getItem(e));Ft("--"+"production")||jt("production");const Zt=Lt&&($t=process.env.FORCE_COLOR,["true","1","2"].includes($t)),zt=!Ft("no-colors")&&(!Lt||process.stdout.isTTY||Zt)&&(!Lt||Ft("color")||Zt||null!==jt("COLORTERM")||(jt("TERM")||"").includes("color")),Vt=e=>new Uint8Array(e),Ht=Mt?e=>{let t="";for(let n=0;n<e.byteLength;n++)t+=Ee(e[n]);return btoa(t)}:e=>Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("base64"),Ut=Mt?e=>{const t=atob(e),n=Vt(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,r=t.byteOffset,o=t.byteLength,new Uint8Array(n,r,o);var n,r,o};var $t;class Wt{constructor(e,t){this.left=e,this.right=t}}const Gt=(e,t)=>new Wt(e,t),qt="undefined"!=typeof document?document:{},Kt=("undefined"!=typeof DOMParser&&new DOMParser,e=>((e,t)=>{const n=[];for(const[r,o]of e)n.push(t(o,r));return n})(e,((e,t)=>`${t}:${e};`)).join("")),Yt=(qt.ELEMENT_NODE,qt.TEXT_NODE,qt.CDATA_SECTION_NODE,qt.COMMENT_NODE,qt.DOCUMENT_NODE,qt.DOCUMENT_TYPE_NODE,qt.DOCUMENT_FRAGMENT_NODE,Symbol),Xt=Date.now,Jt=Yt(),Qt=Yt(),en=Yt(),tn=Yt(),nn=Yt(),rn=Yt(),on=Yt(),an=Yt(),sn=Yt(),ln=[nn,on,an,en];let cn=0,un=Xt();const dn={[Jt]:Gt("font-weight","bold"),[Qt]:Gt("font-weight","normal"),[en]:Gt("color","blue"),[nn]:Gt("color","green"),[tn]:Gt("color","grey"),[rn]:Gt("color","red"),[on]:Gt("color","purple"),[an]:Gt("color","orange"),[sn]:Gt("color","black")},pn=zt?e=>{const t=[],n=[],r=re();let o=[],i=0;for(;i<e.length;i++){const o=e[i],a=dn[o];if(void 0!==a)r.set(a.left,a.right);else{if(o.constructor!==String&&o.constructor!==Number)break;{const e=Kt(r);i>0||e.length>0?(t.push("%c"+o),n.push(e)):t.push(o)}}}for(i>0&&(o=n,o.unshift(t.join("")));i<e.length;i++){const t=e[i];t instanceof Symbol||o.push(t)}return o}:e=>{const t=[],n=[];let r=0;for(;r<e.length;r++){const o=e[r];o.constructor===String||o.constructor===Number?t.push(o):o.constructor===Object&&n.push(JSON.stringify(o))}return n},hn=(...e)=>{console.log(...pn(e)),mn.forEach((t=>t.print(e)))},mn=ae(),fn=e=>({[Symbol.iterator](){return this},next:e}),gn=(e,t)=>fn((()=>{const{done:n,value:r}=e.next();return{done:n,value:n?void 0:t(r)}}));class bn{constructor(e,t){this.clock=e,this.len=t}}class vn{constructor(){this.clients=new Map}}const yn=(e,t,n)=>t.clients.forEach(((t,r)=>{const o=e.doc.store.clients.get(r);for(let r=0;r<t.length;r++){const i=t[r];pr(e,o,i.clock,i.len,n)}})),_n=(e,t)=>{const n=e.clients.get(t.client);return void 0!==n&&null!==((e,t)=>{let n=0,r=e.length-1;for(;n<=r;){const o=pe((n+r)/2),i=e[o],a=i.clock;if(a<=t){if(t<a+i.len)return o;n=o+1}else r=o-1}return null})(n,t.clock)},kn=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 r=e[n-1],o=e[t];r.clock+r.len>=o.clock?r.len=ge(r.len,o.clock+o.len-r.clock):(n<t&&(e[n]=o),n++)}e.length=n}))},wn=(e,t,n,r)=>{ie(e.clients,t,(()=>[])).push(new bn(n,r))},En=()=>new vn,Cn=(e,t)=>{Me(e.restEncoder,t.clients.size),ce(t.clients.entries()).sort(((e,t)=>t[0]-e[0])).forEach((([t,n])=>{e.resetDsCurVal(),Me(e.restEncoder,t);const r=n.length;Me(e.restEncoder,r);for(let t=0;t<r;t++){const r=n[t];e.writeDsClock(r.clock),e.writeDsLen(r.len)}}))},xn=e=>{const t=new vn,n=at(e.restDecoder);for(let r=0;r<n;r++){e.resetDsCurVal();const n=at(e.restDecoder),r=at(e.restDecoder);if(r>0){const o=ie(t.clients,n,(()=>[]));for(let t=0;t<r;t++)o.push(new bn(e.readDsClock(),e.readDsLen()))}}return t},Sn=(e,t,n)=>{const r=new vn,o=at(e.restDecoder);for(let i=0;i<o;i++){e.resetDsCurVal();const o=at(e.restDecoder),i=at(e.restDecoder),a=n.clients.get(o)||[],s=ir(n,o);for(let n=0;n<i;n++){const n=e.readDsClock(),i=n+e.readDsLen();if(n<s){s<i&&wn(r,o,s,i-s);let e=sr(a,n),l=a[e];for(!l.deleted&&l.id.clock<n&&(a.splice(e+1,0,qo(t,l,n-l.id.clock)),e++);e<a.length&&(l=a[e++],l.id.clock<i);)l.deleted||(i<l.id.clock+l.length&&a.splice(e,0,qo(t,l,i-l.id.clock)),l.delete(t))}else wn(r,o,n,i-n)}}if(r.clients.size>0){const e=new Dn;return Me(e.restEncoder,0),Cn(e,r),e.toUint8Array()}return null},In=vt;class Tn extends de{constructor({guid:e=_t(),collectionid:t=null,gc:n=!0,gcFilter:r=(()=>!0),meta:o=null,autoLoad:i=!1,shouldLoad:a=!0}={}){super(),this.gc=n,this.gcFilter=r,this.clientID=In(),this.guid=e,this.collectionid=t,this.share=new Map,this.store=new rr,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=a,this.autoLoad=i,this.meta=o,this.isLoaded=!1,this.isSynced=!1,this.whenLoaded=kt((e=>{this.on("load",(()=>{this.isLoaded=!0,e(this)}))}));const s=()=>kt((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=s()),this.isSynced=void 0===e||!0===e,this.isSynced&&!this.isLoaded&&this.emit("load",[])})),this.whenSynced=s()}load(){const e=this._item;null===e||this.shouldLoad||vr(e.parent.doc,(e=>{e.subdocsLoaded.add(this)}),null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(ce(this.subdocs).map((e=>e.guid)))}transact(e,t=null){return vr(this,e,t)}get(e,t=Fr){const n=ie(this.share,e,(()=>{const e=new t;return e._integrate(this,null),e})),r=n.constructor;if(t!==Fr&&r!==t){if(r===Fr){const r=new t;r._map=n._map,n._map.forEach((e=>{for(;null!==e;e=e.left)e.parent=r})),r._start=n._start;for(let e=r._start;null!==e;e=e.right)e.parent=r;return r._length=n._length,this.share.set(e,r),r._integrate(this,null),r}throw new Error(`Type with the name ${e} has already been defined with a different constructor`)}return n}getArray(e=""){return this.get(e,no)}getText(e=""){return this.get(e,ko)}getMap(e=""){return this.get(e,oo)}getXmlElement(e=""){return this.get(e,Co)}getXmlFragment(e=""){return this.get(e,Eo)}toJSON(){const e={};return this.share.forEach(((t,n)=>{e[n]=t.toJSON()})),e}destroy(){ce(this.subdocs).forEach((e=>e.destroy()));const e=this._item;if(null!==e){this._item=null;const t=e.content;t.doc=new Tn({guid:this.guid,...t.opts,shouldLoad:!1}),t.doc._item=e,vr(e.parent.doc,(n=>{const r=t.doc;e.deleted||n.subdocsAdded.add(r),n.subdocsRemoved.add(this)}),null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}on(e,t){super.on(e,t)}off(e,t){super.off(e,t)}}class Nn{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return at(this.restDecoder)}readDsLen(){return at(this.restDecoder)}}class Pn extends Nn{readLeftID(){return Xn(at(this.restDecoder),at(this.restDecoder))}readRightID(){return Xn(at(this.restDecoder),at(this.restDecoder))}readClient(){return at(this.restDecoder)}readInfo(){return it(this.restDecoder)}readString(){return lt(this.restDecoder)}readParentInfo(){return 1===at(this.restDecoder)}readTypeRef(){return at(this.restDecoder)}readLen(){return at(this.restDecoder)}readAny(){return dt(this.restDecoder)}readBuf(){return(e=>{const t=Vt(e.byteLength);return t.set(e),t})(ot(this.restDecoder))}readJSON(){return JSON.parse(lt(this.restDecoder))}readKey(){return lt(this.restDecoder)}}class Rn{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=at(this.restDecoder),this.dsCurrVal}readDsLen(){const e=at(this.restDecoder)+1;return this.dsCurrVal+=e,e}}class An extends Rn{constructor(e){super(e),this.keys=[],at(e),this.keyClockDecoder=new mt(ot(e)),this.clientDecoder=new ht(ot(e)),this.leftClockDecoder=new mt(ot(e)),this.rightClockDecoder=new mt(ot(e)),this.infoDecoder=new pt(ot(e),it),this.stringDecoder=new ft(ot(e)),this.parentInfoDecoder=new pt(ot(e),it),this.typeRefDecoder=new ht(ot(e)),this.lenDecoder=new ht(ot(e))}readLeftID(){return new Kn(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new Kn(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 dt(this.restDecoder)}readBuf(){return ot(this.restDecoder)}readJSON(){return dt(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 Bn{constructor(){this.restEncoder=Re()}toUint8Array(){return Ae(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){Me(this.restEncoder,e)}writeDsLen(e){Me(this.restEncoder,e)}}class Ln extends Bn{writeLeftID(e){Me(this.restEncoder,e.client),Me(this.restEncoder,e.clock)}writeRightID(e){Me(this.restEncoder,e.client),Me(this.restEncoder,e.clock)}writeClient(e){Me(this.restEncoder,e)}writeInfo(e){Le(this.restEncoder,e)}writeString(e){je(this.restEncoder,e)}writeParentInfo(e){Me(this.restEncoder,e?1:0)}writeTypeRef(e){Me(this.restEncoder,e)}writeLen(e){Me(this.restEncoder,e)}writeAny(e){Ue(this.restEncoder,e)}writeBuf(e){ze(this.restEncoder,e)}writeJSON(e){je(this.restEncoder,JSON.stringify(e))}writeKey(e){je(this.restEncoder,e)}}class Mn{constructor(){this.restEncoder=Re(),this.dsCurrVal=0}toUint8Array(){return Ae(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){const t=e-this.dsCurrVal;this.dsCurrVal=e,Me(this.restEncoder,t)}writeDsLen(e){0===e&&Qe(),Me(this.restEncoder,e-1),this.dsCurrVal+=e}}class Dn extends Mn{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new Ke,this.clientEncoder=new Ge,this.leftClockEncoder=new Ke,this.rightClockEncoder=new Ke,this.infoEncoder=new $e(Le),this.stringEncoder=new Ye,this.parentInfoEncoder=new $e(Le),this.typeRefEncoder=new Ge,this.lenEncoder=new Ge}toUint8Array(){const e=Re();return Me(e,0),ze(e,this.keyClockEncoder.toUint8Array()),ze(e,this.clientEncoder.toUint8Array()),ze(e,this.leftClockEncoder.toUint8Array()),ze(e,this.rightClockEncoder.toUint8Array()),ze(e,Ae(this.infoEncoder)),ze(e,this.stringEncoder.toUint8Array()),ze(e,Ae(this.parentInfoEncoder)),ze(e,this.typeRefEncoder.toUint8Array()),ze(e,this.lenEncoder.toUint8Array()),Ze(e,Ae(this.restEncoder)),Ae(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){Ue(this.restEncoder,e)}writeBuf(e){ze(this.restEncoder,e)}writeJSON(e){Ue(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 On=(e,t,n)=>{const r=new Map;n.forEach(((e,n)=>{ir(t,n)>e&&r.set(n,e)})),or(t).forEach(((e,t)=>{n.has(t)||r.set(t,0)})),Me(e.restEncoder,r.size),ce(r.entries()).sort(((e,t)=>t[0]-e[0])).forEach((([n,r])=>{((e,t,n,r)=>{r=ge(r,t[0].id.clock);const o=sr(t,r);Me(e.restEncoder,t.length-o),e.writeClient(n),Me(e.restEncoder,r);const i=t[o];i.write(e,r-i.id.clock);for(let n=o+1;n<t.length;n++)t[n].write(e,0)})(e,t.clients.get(n),n,r)}))},Fn=(e,t,n,r=An)=>{const o=rt(t);((e,t,n,r=new An(e))=>{vr(t,(e=>{e.local=!1;let t=!1;const n=e.doc,o=n.store,i=((e,t)=>{const n=re(),r=at(e.restDecoder);for(let o=0;o<r;o++){const r=at(e.restDecoder),o=new Array(r),i=e.readClient();let a=at(e.restDecoder);n.set(i,{i:0,refs:o});for(let n=0;n<r;n++){const r=e.readInfo();switch(31&r){case 0:{const t=e.readLen();o[n]=new No(Xn(i,a),t),a+=t;break}case 10:{const t=at(e.restDecoder);o[n]=new Jo(Xn(i,a),t),a+=t;break}default:{const s=0==(192&r),l=new Ko(Xn(i,a),null,(r&ye)===ye?e.readLeftID():null,null,(r&ve)===ve?e.readRightID():null,s?e.readParentInfo()?t.get(e.readString()):e.readLeftID():null,s&&32==(32&r)?e.readString():null,Yo(e,r));o[n]=l,a+=l.length}}}}return n})(r,n),a=((e,t,n)=>{const r=[];let o=ce(n.keys()).sort(((e,t)=>e-t));if(0===o.length)return null;const i=()=>{if(0===o.length)return null;let e=n.get(o[o.length-1]);for(;e.refs.length===e.i;){if(o.pop(),!(o.length>0))return null;e=n.get(o[o.length-1])}return e};let a=i();if(null===a)return null;const s=new rr,l=new Map,c=(e,t)=>{const n=l.get(e);(null==n||n>t)&&l.set(e,t)};let u=a.refs[a.i++];const d=new Map,p=()=>{for(const e of r){const t=e.id.client,r=n.get(t);r?(r.i--,s.clients.set(t,r.refs.slice(r.i)),n.delete(t),r.i=0,r.refs=[]):s.clients.set(t,[e]),o=o.filter((e=>e!==t))}r.length=0};for(;;){if(u.constructor!==Jo){const o=ie(d,u.id.client,(()=>ir(t,u.id.client)))-u.id.clock;if(o<0)r.push(u),c(u.id.client,u.id.clock-1),p();else{const i=u.getMissing(e,t);if(null!==i){r.push(u);const e=n.get(i)||{refs:[],i:0};if(e.refs.length!==e.i){u=e.refs[e.i++];continue}c(i,ir(t,i)),p()}else(0===o||o<u.length)&&(u.integrate(e,o),d.set(u.id.client,u.id.clock+u.length))}}if(r.length>0)u=r.pop();else if(null!==a&&a.i<a.refs.length)u=a.refs[a.i++];else{if(a=i(),null===a)break;u=a.refs[a.i++]}}if(s.clients.size>0){const e=new Dn;return On(e,s,new Map),Me(e.restEncoder,0),{missing:l,update:e.toUint8Array()}}return null})(e,o,i),s=o.pendingStructs;if(s){for(const[e,n]of s.missing)if(n<ir(o,e)){t=!0;break}if(a){for(const[e,t]of a.missing){const n=s.missing.get(e);(null==n||n>t)&&s.missing.set(e,t)}s.update=Er([s.update,a.update])}}else o.pendingStructs=a;const l=Sn(r,e,o);if(o.pendingDs){const t=new An(rt(o.pendingDs));at(t.restDecoder);const n=Sn(t,e,o);o.pendingDs=l&&n?Er([l,n]):l||n}else o.pendingDs=l;if(t){const t=o.pendingStructs.update;o.pendingStructs=null,Fn(e.doc,t)}}),n,!1)})(o,e,n,new r(o))},jn=(e,t,n)=>Fn(e,t,n,Pn),Zn=(e,t=new Uint8Array([0]),n=new Dn)=>{((e,t,n=new Map)=>{On(e,t.store,n),Cn(e,(e=>{const t=En();return e.clients.forEach(((e,n)=>{const r=[];for(let t=0;t<e.length;t++){const n=e[t];if(n.deleted){const o=n.id.clock;let i=n.length;if(t+1<e.length)for(let n=e[t+1];t+1<e.length&&n.deleted;n=e[1+ ++t])i+=n.length;r.push(new bn(o,i))}}r.length>0&&t.clients.set(n,r)})),t})(t.store))})(n,e,Vn(t));const r=[n.toUint8Array()];if(e.store.pendingDs&&r.push(e.store.pendingDs),e.store.pendingStructs&&r.push(Cr(e.store.pendingStructs.update,t)),r.length>1){if(n.constructor===Ln)return kr(r.map(((e,t)=>0===t?e:Tr(e))));if(n.constructor===Dn)return Er(r)}return r[0]},zn=(e,t)=>Zn(e,t,new Ln),Vn=e=>(e=>{const t=new Map,n=at(e.restDecoder);for(let r=0;r<n;r++){const n=at(e.restDecoder),r=at(e.restDecoder);t.set(n,r)}return t})(new Nn(rt(e))),Hn=(e,t)=>(Me(e.restEncoder,t.size),ce(t.entries()).sort(((e,t)=>t[0]-e[0])).forEach((([t,n])=>{Me(e.restEncoder,t),Me(e.restEncoder,n)})),e);class Un{constructor(){this.l=[]}}const $n=()=>new Un,Wn=(e,t)=>e.l.push(t),Gn=(e,t)=>{const n=e.l,r=n.length;e.l=n.filter((e=>t!==e)),r===e.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},qn=(e,t,n)=>Pt(e.l,[t,n]);class Kn{constructor(e,t){this.client=e,this.clock=t}}const Yn=(e,t)=>e===t||null!==e&&null!==t&&e.client===t.client&&e.clock===t.clock,Xn=(e,t)=>new Kn(e,t);class Jn{constructor(e,t){this.ds=e,this.sv=t}}const Qn=(tr=En(),nr=new Map,new Jn(tr,nr),(e,t)=>void 0===t?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!_n(t.ds,e.id)),er=(e,t)=>{const n=ie(e.meta,er,ae),r=e.doc.store;n.has(t)||(t.sv.forEach(((t,n)=>{t<ir(r,n)&&ur(e,Xn(n,t))})),yn(e,t.ds,(e=>{})),n.add(t))};var tr,nr;class rr{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const or=e=>{const t=new Map;return e.clients.forEach(((e,n)=>{const r=e[e.length-1];t.set(n,r.id.clock+r.length)})),t},ir=(e,t)=>{const n=e.clients.get(t);if(void 0===n)return 0;const r=n[n.length-1];return r.id.clock+r.length},ar=(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 Qe()}n.push(t)},sr=(e,t)=>{let n=0,r=e.length-1,o=e[r],i=o.id.clock;if(i===t)return r;let a=pe(t/(i+o.length-1)*r);for(;n<=r;){if(o=e[a],i=o.id.clock,i<=t){if(t<i+o.length)return a;n=a+1}else r=a-1;a=pe((n+r)/2)}throw Qe()},lr=(e,t)=>{const n=e.clients.get(t.client);return n[sr(n,t.clock)]},cr=(e,t,n)=>{const r=sr(t,n),o=t[r];return o.id.clock<n&&o instanceof Ko?(t.splice(r+1,0,qo(e,o,n-o.id.clock)),r+1):r},ur=(e,t)=>{const n=e.doc.store.clients.get(t.client);return n[cr(e,n,t.clock)]},dr=(e,t,n)=>{const r=t.clients.get(n.client),o=sr(r,n.clock),i=r[o];return n.clock!==i.id.clock+i.length-1&&i.constructor!==No&&r.splice(o+1,0,qo(e,i,n.clock-i.id.clock+1)),i},pr=(e,t,n,r,o)=>{if(0===r)return;const i=n+r;let a,s=cr(e,t,n);do{a=t[s++],i<a.id.clock+a.length&&cr(e,t,i),o(a)}while(s<t.length&&t[s].id.clock<i)};class hr{constructor(e,t,n){this.doc=e,this.deleteSet=new vn,this.beforeState=or(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 mr=(e,t)=>!(0===t.deleteSet.clients.size&&!((e,t)=>{for(const[n,r]of e)if(t(r,n))return!0;return!1})(t.afterState,((e,n)=>t.beforeState.get(n)!==e))||(kn(t.deleteSet),((e,t)=>{On(e,t.doc.store,t.beforeState)})(e,t),Cn(e,t.deleteSet),0)),fr=(e,t,n)=>{const r=t._item;(null===r||r.id.clock<(e.beforeState.get(r.id.client)||0)&&!r.deleted)&&ie(e.changed,t,ae).add(n)},gr=(e,t)=>{let n=e[t],r=e[t-1],o=t;for(;o>0&&r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n);n=r,r=e[--o-1])n instanceof Ko&&null!==n.parentSub&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);const i=t-o;return i&&e.splice(t+1-i,i),i},br=(e,t)=>{if(t<e.length){const n=e[t],r=n.doc,o=r.store,i=n.deleteSet,a=n._mergeStructs;try{kn(i),n.afterState=or(n.doc.store),r.emit("beforeObserverCalls",[n,r]);const e=[];n.changed.forEach(((t,r)=>e.push((()=>{null!==r._item&&r._item.deleted||r._callObserver(n,t)})))),e.push((()=>{n.changedParentTypes.forEach(((e,t)=>{t._dEH.l.length>0&&(null===t._item||!t._item.deleted)&&((e=e.filter((e=>null===e.target._item||!e.target._item.deleted))).forEach((e=>{e.currentTarget=t,e._path=null})),e.sort(((e,t)=>e.path.length-t.path.length)),qn(t._dEH,e,n))}))})),e.push((()=>r.emit("afterTransaction",[n,r]))),Pt(e,[]),n._needFormattingCleanup&&vo(n)}finally{r.gc&&((e,t,n)=>{for(const[r,o]of e.clients.entries()){const e=t.clients.get(r);for(let r=o.length-1;r>=0;r--){const i=o[r],a=i.clock+i.len;for(let r=sr(e,i.clock),o=e[r];r<e.length&&o.id.clock<a;o=e[++r]){const o=e[r];if(i.clock+i.len<=o.id.clock)break;o instanceof Ko&&o.deleted&&!o.keep&&n(o)&&o.gc(t,!1)}}}})(i,o,r.gcFilter),((e,t)=>{e.clients.forEach(((e,n)=>{const r=t.clients.get(n);for(let t=e.length-1;t>=0;t--){const n=e[t];for(let e=fe(r.length-1,1+sr(r,n.clock+n.len-1)),t=r[e];e>0&&t.id.clock>=n.clock;t=r[e])e-=1+gr(r,e)}}))})(i,o),n.afterState.forEach(((e,t)=>{const r=n.beforeState.get(t)||0;if(r!==e){const e=o.clients.get(t),n=ge(sr(e,r),1);for(let t=e.length-1;t>=n;)t-=1+gr(e,t)}}));for(let e=a.length-1;e>=0;e--){const{client:t,clock:n}=a[e].id,r=o.clients.get(t),i=sr(r,n);i+1<r.length&&gr(r,i+1)>1||i>0&&gr(r,i)}if(n.local||n.afterState.get(r.clientID)===n.beforeState.get(r.clientID)||(hn(an,Jt,"[yjs] ",Qt,rn,"Changed the client-id because another client seems to be using it."),r.clientID=In()),r.emit("afterTransactionCleanup",[n,r]),r._observers.has("update")){const e=new Ln;mr(e,n)&&r.emit("update",[e.toUint8Array(),n.origin,r,n])}if(r._observers.has("updateV2")){const e=new Dn;mr(e,n)&&r.emit("updateV2",[e.toUint8Array(),n.origin,r,n])}const{subdocsAdded:s,subdocsLoaded:l,subdocsRemoved:c}=n;(s.size>0||c.size>0||l.size>0)&&(s.forEach((e=>{e.clientID=r.clientID,null==e.collectionid&&(e.collectionid=r.collectionid),r.subdocs.add(e)})),c.forEach((e=>r.subdocs.delete(e))),r.emit("subdocs",[{loaded:l,added:s,removed:c},r,n]),c.forEach((e=>e.destroy()))),e.length<=t+1?(r._transactionCleanups=[],r.emit("afterAllTransactions",[r,e])):br(e,t+1)}}},vr=(e,t,n=null,r=!0)=>{const o=e._transactionCleanups;let i=!1,a=null;null===e._transaction&&(i=!0,e._transaction=new hr(e,n,r),o.push(e._transaction),1===o.length&&e.emit("beforeAllTransactions",[e]),e.emit("beforeTransaction",[e._transaction,e]));try{a=t(e._transaction)}finally{if(i){const t=e._transaction===o[0];e._transaction=null,t&&br(o,0)}}return a};class yr{constructor(e,t){this.gen=function*(e){const t=at(e.restDecoder);for(let n=0;n<t;n++){const t=at(e.restDecoder),n=e.readClient();let r=at(e.restDecoder);for(let o=0;o<t;o++){const t=e.readInfo();if(10===t){const t=at(e.restDecoder);yield new Jo(Xn(n,r),t),r+=t}else if(0!=(31&t)){const o=0==(192&t),i=new Ko(Xn(n,r),null,(t&ye)===ye?e.readLeftID():null,null,(t&ve)===ve?e.readRightID():null,o?e.readParentInfo()?e.readString():e.readLeftID():null,o&&32==(32&t)?e.readString():null,Yo(e,t));yield i,r+=i.length}else{const t=e.readLen();yield new No(Xn(n,r),t),r+=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===Jo);return this.curr}}class _r{constructor(e){this.currClient=0,this.startClock=0,this.written=0,this.encoder=e,this.clientStructs=[]}}const kr=e=>Er(e,Pn,Ln),wr=(e,t)=>{if(e.constructor===No){const{client:n,clock:r}=e.id;return new No(Xn(n,r+t),e.length-t)}if(e.constructor===Jo){const{client:n,clock:r}=e.id;return new Jo(Xn(n,r+t),e.length-t)}{const n=e,{client:r,clock:o}=n.id;return new Ko(Xn(r,o+t),null,Xn(r,o+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},Er=(e,t=An,n=Dn)=>{if(1===e.length)return e[0];const r=e.map((e=>new t(rt(e))));let o=r.map((e=>new yr(e,!0))),i=null;const a=new n,s=new _r(a);for(;o=o.filter((e=>null!==e.curr)),o.sort(((e,t)=>{if(e.curr.id.client===t.curr.id.client){const n=e.curr.id.clock-t.curr.id.clock;return 0===n?e.curr.constructor===t.curr.constructor?0:e.curr.constructor===Jo?1:-1:n}return t.curr.id.client-e.curr.id.client})),0!==o.length;){const e=o[0],t=e.curr.id.client;if(null!==i){let n=e.curr,r=!1;for(;null!==n&&n.id.clock+n.length<=i.struct.id.clock+i.struct.length&&n.id.client>=i.struct.id.client;)n=e.next(),r=!0;if(null===n||n.id.client!==t||r&&n.id.clock>i.struct.id.clock+i.struct.length)continue;if(t!==i.struct.id.client)Sr(s,i.struct,i.offset),i={struct:n,offset:0},e.next();else if(i.struct.id.clock+i.struct.length<n.id.clock)if(i.struct.constructor===Jo)i.struct.length=n.id.clock+n.length-i.struct.id.clock;else{Sr(s,i.struct,i.offset);const e=n.id.clock-i.struct.id.clock-i.struct.length;i={struct:new Jo(Xn(t,i.struct.id.clock+i.struct.length),e),offset:0}}else{const t=i.struct.id.clock+i.struct.length-n.id.clock;t>0&&(i.struct.constructor===Jo?i.struct.length-=t:n=wr(n,t)),i.struct.mergeWith(n)||(Sr(s,i.struct,i.offset),i={struct:n,offset:0},e.next())}}else i={struct:e.curr,offset:0},e.next();for(let n=e.curr;null!==n&&n.id.client===t&&n.id.clock===i.struct.id.clock+i.struct.length&&n.constructor!==Jo;n=e.next())Sr(s,i.struct,i.offset),i={struct:n,offset:0}}null!==i&&(Sr(s,i.struct,i.offset),i=null),Ir(s);const l=(e=>{const t=new vn;for(let n=0;n<e.length;n++)e[n].clients.forEach(((r,o)=>{if(!t.clients.has(o)){const i=r.slice();for(let t=n+1;t<e.length;t++)le(i,e[t].clients.get(o)||[]);t.clients.set(o,i)}}));return kn(t),t})(r.map((e=>xn(e))));return Cn(a,l),a.toUint8Array()},Cr=(e,t,n=An,r=Dn)=>{const o=Vn(t),i=new r,a=new _r(i),s=new n(rt(e)),l=new yr(s,!1);for(;l.curr;){const e=l.curr,t=e.id.client,n=o.get(t)||0;if(l.curr.constructor!==Jo)if(e.id.clock+e.length>n)for(Sr(a,e,ge(n-e.id.clock,0)),l.next();l.curr&&l.curr.id.client===t;)Sr(a,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()}Ir(a);const c=xn(s);return Cn(i,c),i.toUint8Array()},xr=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:Ae(e.encoder.restEncoder)}),e.encoder.restEncoder=Re(),e.written=0)},Sr=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&xr(e),0===e.written&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),Me(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},Ir=e=>{xr(e);const t=e.encoder.restEncoder;Me(t,e.clientStructs.length);for(let n=0;n<e.clientStructs.length;n++){const r=e.clientStructs[n];Me(t,r.written),Ze(t,r.restEncoder)}},Tr=e=>((e,t,n,r)=>{const o=new n(rt(e)),i=new yr(o,!1),a=new r,s=new _r(a);for(let e=i.curr;null!==e;e=i.next())Sr(s,t(e),0);Ir(s);const l=xn(o);return Cn(a,l),a.toUint8Array()})(e,At,An,Ln),Nr="You must not compute changes after the event-handler fired.";class Pr{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=Rr(this.currentTarget,this.target))}deletes(e){return _n(this.transaction.deleteSet,e.id)}get keys(){if(null===this._keys){if(0===this.transaction.doc._transactionCleanups.length)throw Xe(Nr);const e=new Map,t=this.target;this.transaction.changed.get(t).forEach((n=>{if(null!==n){const r=t._map.get(n);let o,i;if(this.adds(r)){let e=r.left;for(;null!==e&&this.adds(e);)e=e.left;if(this.deletes(r)){if(null===e||!this.deletes(e))return;o="delete",i=se(e.content.getContent())}else null!==e&&this.deletes(e)?(o="update",i=se(e.content.getContent())):(o="add",i=void 0)}else{if(!this.deletes(r))return;o="delete",i=se(r.content.getContent())}e.set(n,{action:o,oldValue:i})}})),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(null===e){if(0===this.transaction.doc._transactionCleanups.length)throw Xe(Nr);const t=this.target,n=ae(),r=ae(),o=[];if(e={added:n,deleted:r,delta:o,keys:this.keys},this.transaction.changed.get(t).has(null)){let e=null;const i=()=>{e&&o.push(e)};for(let o=t._start;null!==o;o=o.right)o.deleted?this.deletes(o)&&!this.adds(o)&&(null!==e&&void 0!==e.delete||(i(),e={delete:0}),e.delete+=o.length,r.add(o)):this.adds(o)?(null!==e&&void 0!==e.insert||(i(),e={insert:[]}),e.insert=e.insert.concat(o.content.getContent()),n.add(o)):(null!==e&&void 0!==e.retain||(i(),e={retain:0}),e.retain+=o.length);null!==e&&void 0===e.retain&&i()}this._changes=e}return e}}const Rr=(e,t)=>{const n=[];for(;null!==t._item&&t!==e;){if(null!==t._item.parentSub)n.unshift(t._item.parentSub);else{let e=0,r=t._item.parent._start;for(;r!==t._item&&null!==r;)r.deleted||e++,r=r.right;n.unshift(e)}t=t._item.parent}return n};let Ar=0;class Br{constructor(e,t){e.marker=!0,this.p=e,this.index=t,this.timestamp=Ar++}}const Lr=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=Ar++},Mr=(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)=>he(t-e.index)<he(t-n.index)?e:n));let r=e._start,o=0;for(null!==n&&(r=n.p,o=n.index,(e=>{e.timestamp=Ar++})(n));null!==r.right&&o<t;){if(!r.deleted&&r.countable){if(t<o+r.length)break;o+=r.length}r=r.right}for(;null!==r.left&&o>t;)r=r.left,!r.deleted&&r.countable&&(o-=r.length);for(;null!==r.left&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(o-=r.length);return null!==n&&he(n.index-o)<r.parent.length/80?(Lr(n,r,o),n):((e,t,n)=>{if(e.length>=80){const r=e.reduce(((e,t)=>e.timestamp<t.timestamp?e:t));return Lr(r,t,n),r}{const r=new Br(t,n);return e.push(r),r}})(e._searchMarker,r,o)},Dr=(e,t,n)=>{for(let r=e.length-1;r>=0;r--){const o=e[r];if(n>0){let t=o.p;for(t.marker=!1;t&&(t.deleted||!t.countable);)t=t.left,t&&!t.deleted&&t.countable&&(o.index-=t.length);if(null===t||!0===t.marker){e.splice(r,1);continue}o.p=t,t.marker=!0}(t<o.index||n>0&&t===o.index)&&(o.index=ge(t,o.index+n))}},Or=(e,t,n)=>{const r=e,o=t.changedParentTypes;for(;ie(o,e,(()=>[])).push(n),null!==e._item;)e=e._item.parent;qn(r._eH,n,t)};class Fr{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=$n(),this._dEH=$n(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,t){this.doc=e,this._item=t}_copy(){throw Je()}clone(){throw Je()}_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){Wn(this._eH,e)}observeDeep(e){Wn(this._dEH,e)}unobserve(e){Gn(this._eH,e)}unobserveDeep(e){Gn(this._dEH,e)}toJSON(){}}const jr=(e,t,n)=>{t<0&&(t=e._length+t),n<0&&(n=e._length+n);let r=n-t;const o=[];let i=e._start;for(;null!==i&&r>0;){if(i.countable&&!i.deleted){const e=i.content.getContent();if(e.length<=t)t-=e.length;else{for(let n=t;n<e.length&&r>0;n++)o.push(e[n]),r--;t=0}}i=i.right}return o},Zr=e=>{const t=[];let n=e._start;for(;null!==n;){if(n.countable&&!n.deleted){const e=n.content.getContent();for(let n=0;n<e.length;n++)t.push(e[n])}n=n.right}return t},zr=(e,t)=>{let n=0,r=e._start;for(;null!==r;){if(r.countable&&!r.deleted){const o=r.content.getContent();for(let r=0;r<o.length;r++)t(o[r],n++,e)}r=r.right}},Vr=(e,t)=>{const n=[];return zr(e,((r,o)=>{n.push(t(r,o,e))})),n},Hr=e=>{let t=e._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(null===n){for(;null!==t&&t.deleted;)t=t.right;if(null===t)return{done:!0,value:void 0};n=t.content.getContent(),r=0,t=t.right}const e=n[r++];return n.length<=r&&(n=null),{done:!1,value:e}}}},Ur=(e,t)=>{const n=Mr(e,t);let r=e._start;for(null!==n&&(r=n.p,t-=n.index);null!==r;r=r.right)if(!r.deleted&&r.countable){if(t<r.length)return r.content.getContent()[t];t-=r.length}},$r=(e,t,n,r)=>{let o=n;const i=e.doc,a=i.clientID,s=i.store,l=null===n?t._start:n.right;let c=[];const u=()=>{c.length>0&&(o=new Ko(Xn(a,ir(s,a)),o,o&&o.lastId,l,l&&l.id,t,null,new Oo(c)),o.integrate(e,0),c=[])};r.forEach((n=>{if(null===n)c.push(n);else switch(n.constructor){case Number:case Object:case Boolean:case Array:case String:c.push(n);break;default:switch(u(),n.constructor){case Uint8Array:case ArrayBuffer:o=new Ko(Xn(a,ir(s,a)),o,o&&o.lastId,l,l&&l.id,t,null,new Po(new Uint8Array(n))),o.integrate(e,0);break;case Tn:o=new Ko(Xn(a,ir(s,a)),o,o&&o.lastId,l,l&&l.id,t,null,new Bo(n)),o.integrate(e,0);break;default:if(!(n instanceof Fr))throw new Error("Unexpected content type in insert operation");o=new Ko(Xn(a,ir(s,a)),o,o&&o.lastId,l,l&&l.id,t,null,new Go(n)),o.integrate(e,0)}}})),u()},Wr=()=>Xe("Length exceeded!"),Gr=(e,t,n,r)=>{if(n>t._length)throw Wr();if(0===n)return t._searchMarker&&Dr(t._searchMarker,n,r.length),$r(e,t,null,r);const o=n,i=Mr(t,n);let a=t._start;for(null!==i&&(a=i.p,0==(n-=i.index)&&(a=a.prev,n+=a&&a.countable&&!a.deleted?a.length:0));null!==a;a=a.right)if(!a.deleted&&a.countable){if(n<=a.length){n<a.length&&ur(e,Xn(a.id.client,a.id.clock+n));break}n-=a.length}return t._searchMarker&&Dr(t._searchMarker,o,r.length),$r(e,t,a,r)},qr=(e,t,n,r)=>{if(0===r)return;const o=n,i=r,a=Mr(t,n);let s=t._start;for(null!==a&&(s=a.p,n-=a.index);null!==s&&n>0;s=s.right)!s.deleted&&s.countable&&(n<s.length&&ur(e,Xn(s.id.client,s.id.clock+n)),n-=s.length);for(;r>0&&null!==s;)s.deleted||(r<s.length&&ur(e,Xn(s.id.client,s.id.clock+r)),s.delete(e),r-=s.length),s=s.right;if(r>0)throw Wr();t._searchMarker&&Dr(t._searchMarker,o,-i+r)},Kr=(e,t,n)=>{const r=t._map.get(n);void 0!==r&&r.delete(e)},Yr=(e,t,n,r)=>{const o=t._map.get(n)||null,i=e.doc,a=i.clientID;let s;if(null==r)s=new Oo([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:s=new Oo([r]);break;case Uint8Array:s=new Po(r);break;case Tn:s=new Bo(r);break;default:if(!(r instanceof Fr))throw new Error("Unexpected content type");s=new Go(r)}new Ko(Xn(a,ir(i.store,a)),o,o&&o.lastId,null,null,t,n,s).integrate(e,0)},Xr=(e,t)=>{const n=e._map.get(t);return void 0===n||n.deleted?void 0:n.content.getContent()[n.length-1]},Jr=e=>{const t={};return e._map.forEach(((e,n)=>{e.deleted||(t[n]=e.content.getContent()[e.length-1])})),t},Qr=(e,t)=>{const n=e._map.get(t);return void 0!==n&&!n.deleted},eo=e=>{return t=e.entries(),fn((()=>{let e;do{e=t.next()}while(!e.done&&e.value[1].deleted);return e}));var t};class to extends Pr{constructor(e,t){super(e,t),this._transaction=t}}class no extends Fr{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const t=new no;return t.push(e),t}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new no}clone(){const e=new no;return e.insert(0,this.toArray().map((e=>e instanceof Fr?e.clone():e))),e}get length(){return null===this._prelimContent?this._length:this._prelimContent.length}_callObserver(e,t){super._callObserver(e,t),Or(this,e,new to(this,e))}insert(e,t){null!==this.doc?vr(this.doc,(n=>{Gr(n,this,e,t)})):this._prelimContent.splice(e,0,...t)}push(e){null!==this.doc?vr(this.doc,(t=>{((e,t,n)=>{let r=(t._searchMarker||[]).reduce(((e,t)=>t.index>e.index?t:e),{index:0,p:t._start}).p;if(r)for(;r.right;)r=r.right;$r(e,t,r,n)})(t,this,e)})):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,t=1){null!==this.doc?vr(this.doc,(n=>{qr(n,this,e,t)})):this._prelimContent.splice(e,t)}get(e){return Ur(this,e)}toArray(){return Zr(this)}slice(e=0,t=this.length){return jr(this,e,t)}toJSON(){return this.map((e=>e instanceof Fr?e.toJSON():e))}map(e){return Vr(this,e)}forEach(e){zr(this,e)}[Symbol.iterator](){return Hr(this)}_write(e){e.writeTypeRef(Zo)}}class ro extends Pr{constructor(e,t,n){super(e,t),this.keysChanged=n}}class oo extends Fr{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 oo}clone(){const e=new oo;return this.forEach(((t,n)=>{e.set(n,t instanceof Fr?t.clone():t)})),e}_callObserver(e,t){Or(this,e,new ro(this,e,t))}toJSON(){const e={};return this._map.forEach(((t,n)=>{if(!t.deleted){const r=t.content.getContent()[t.length-1];e[n]=r instanceof Fr?r.toJSON():r}})),e}get size(){return[...eo(this._map)].length}keys(){return gn(eo(this._map),(e=>e[0]))}values(){return gn(eo(this._map),(e=>e[1].content.getContent()[e[1].length-1]))}entries(){return gn(eo(this._map),(e=>[e[0],e[1].content.getContent()[e[1].length-1]]))}forEach(e){this._map.forEach(((t,n)=>{t.deleted||e(t.content.getContent()[t.length-1],n,this)}))}[Symbol.iterator](){return this.entries()}delete(e){null!==this.doc?vr(this.doc,(t=>{Kr(t,this,e)})):this._prelimContent.delete(e)}set(e,t){return null!==this.doc?vr(this.doc,(n=>{Yr(n,this,e,t)})):this._prelimContent.set(e,t),t}get(e){return Xr(this,e)}has(e){return Qr(this,e)}clear(){null!==this.doc?vr(this.doc,(e=>{this.forEach((function(t,n,r){Kr(e,r,n)}))})):this._prelimContent.clear()}_write(e){e.writeTypeRef(zo)}}const io=(e,t)=>e===t||"object"==typeof e&&"object"==typeof t&&e&&t&&((e,t)=>e===t||Tt(e)===Tt(t)&&((e,t)=>{for(const n in e)if(!t(e[n],n))return!1;return!0})(e,((e,n)=>(void 0!==e||Nt(t,n))&&t[n]===e)))(e,t);class ao{constructor(e,t,n,r){this.left=e,this.right=t,this.index=n,this.currentAttributes=r}forward(){null===this.right&&Qe(),this.right.content.constructor===Mo?this.right.deleted||uo(this.currentAttributes,this.right.content):this.right.deleted||(this.index+=this.right.length),this.left=this.right,this.right=this.right.right}}const so=(e,t,n)=>{for(;null!==t.right&&n>0;)t.right.content.constructor===Mo?t.right.deleted||uo(t.currentAttributes,t.right.content):t.right.deleted||(n<t.right.length&&ur(e,Xn(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},lo=(e,t,n,r)=>{const o=new Map,i=r?Mr(t,n):null;if(i){const t=new ao(i.p.left,i.p,i.index,o);return so(e,t,n-i.index)}{const r=new ao(null,t._start,0,o);return so(e,r,n)}},co=(e,t,n,r)=>{for(;null!==n.right&&(!0===n.right.deleted||n.right.content.constructor===Mo&&io(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();const o=e.doc,i=o.clientID;r.forEach(((r,a)=>{const s=n.left,l=n.right,c=new Ko(Xn(i,ir(o.store,i)),s,s&&s.lastId,l,l&&l.id,t,null,new Mo(a,r));c.integrate(e,0),n.right=c,n.forward()}))},uo=(e,t)=>{const{key:n,value:r}=t;null===r?e.delete(n):e.set(n,r)},po=(e,t)=>{for(;null!==e.right&&(e.right.deleted||e.right.content.constructor===Mo&&io(t[e.right.content.key]||null,e.right.content.value));)e.forward()},ho=(e,t,n,r)=>{const o=e.doc,i=o.clientID,a=new Map;for(const s in r){const l=r[s],c=n.currentAttributes.get(s)||null;if(!io(c,l)){a.set(s,c);const{left:r,right:u}=n;n.right=new Ko(Xn(i,ir(o.store,i)),r,r&&r.lastId,u,u&&u.id,t,null,new Mo(s,l)),n.right.integrate(e,0),n.forward()}}return a},mo=(e,t,n,r,o)=>{n.currentAttributes.forEach(((e,t)=>{void 0===o[t]&&(o[t]=null)}));const i=e.doc,a=i.clientID;po(n,o);const s=ho(e,t,n,o),l=r.constructor===String?new Fo(r):r instanceof Fr?new Go(r):new Lo(r);let{left:c,right:u,index:d}=n;t._searchMarker&&Dr(t._searchMarker,n.index,l.getLength()),u=new Ko(Xn(a,ir(i.store,a)),c,c&&c.lastId,u,u&&u.id,t,null,l),u.integrate(e,0),n.right=u,n.index=d,n.forward(),co(e,t,n,s)},fo=(e,t,n,r,o)=>{const i=e.doc,a=i.clientID;po(n,o);const s=ho(e,t,n,o);e:for(;null!==n.right&&(r>0||s.size>0&&(n.right.deleted||n.right.content.constructor===Mo));){if(!n.right.deleted)switch(n.right.content.constructor){case Mo:{const{key:t,value:i}=n.right.content,a=o[t];if(void 0!==a){if(io(a,i))s.delete(t);else{if(0===r)break e;s.set(t,i)}n.right.delete(e)}else n.currentAttributes.set(t,i);break}default:r<n.right.length&&ur(e,Xn(n.right.id.client,n.right.id.clock+r)),r-=n.right.length}n.forward()}if(r>0){let o="";for(;r>0;r--)o+="\n";n.right=new Ko(Xn(a,ir(i.store,a)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new Fo(o)),n.right.integrate(e,0),n.forward()}co(e,t,n,s)},go=(e,t,n,r,o)=>{let i=t;const a=re();for(;i&&(!i.countable||i.deleted);){if(!i.deleted&&i.content.constructor===Mo){const e=i.content;a.set(e.key,e)}i=i.right}let s=0,l=!1;for(;t!==i;){if(n===t&&(l=!0),!t.deleted){const n=t.content;switch(n.constructor){case Mo:{const{key:i,value:c}=n,u=r.get(i)||null;a.get(i)===n&&u!==c||(t.delete(e),s++,l||(o.get(i)||null)!==c||u===c||(null===u?o.delete(i):o.set(i,u))),l||t.deleted||uo(o,n);break}}}t=t.right}return s},bo=e=>{let t=0;return vr(e.doc,(n=>{let r=e._start,o=e._start,i=re();const a=oe(i);for(;o;)!1===o.deleted&&(o.content.constructor===Mo?uo(a,o.content):(t+=go(n,r,o,i,a),i=oe(a),r=o)),o=o.right})),t},vo=e=>{const t=new Set,n=e.doc;for(const[r,o]of e.afterState.entries()){const i=e.beforeState.get(r)||0;o!==i&&pr(e,n.store.clients.get(r),i,o,(e=>{e.deleted||e.content.constructor!==Mo||e.constructor===No||t.add(e.parent)}))}vr(n,(n=>{yn(e,e.deleteSet,(e=>{if(e instanceof No||!e.parent._hasFormatting||t.has(e.parent))return;const r=e.parent;e.content.constructor===Mo?t.add(r):((e,t)=>{for(;t&&t.right&&(t.right.deleted||!t.right.countable);)t=t.right;const n=new Set;for(;t&&(t.deleted||!t.countable);){if(!t.deleted&&t.content.constructor===Mo){const r=t.content.key;n.has(r)?t.delete(e):n.add(r)}t=t.left}})(n,e)}));for(const e of t)bo(e)}))},yo=(e,t,n)=>{const r=n,o=oe(t.currentAttributes),i=t.right;for(;n>0&&null!==t.right;){if(!1===t.right.deleted)switch(t.right.content.constructor){case Go:case Lo:case Fo:n<t.right.length&&ur(e,Xn(t.right.id.client,t.right.id.clock+n)),n-=t.right.length,t.right.delete(e)}t.forward()}i&&go(e,i,t.right,o,t.currentAttributes);const a=(t.left||t.right).parent;return a._searchMarker&&Dr(a._searchMarker,t.index,-r+n),t};class _o extends Pr{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=[];vr(e,(e=>{const n=new Map,r=new Map;let o=this.target._start,i=null;const a={};let s="",l=0,c=0;const u=()=>{if(null!==i){let e=null;switch(i){case"delete":c>0&&(e={delete:c}),c=0;break;case"insert":("object"==typeof s||s.length>0)&&(e={insert:s},n.size>0&&(e.attributes={},n.forEach(((t,n)=>{null!==t&&(e.attributes[n]=t)})))),s="";break;case"retain":l>0&&(e={retain:l},(e=>{for(const t in e)return!1;return!0})(a)||(e.attributes=St({},a))),l=0}e&&t.push(e),i=null}};for(;null!==o;){switch(o.content.constructor){case Go:case Lo:this.adds(o)?this.deletes(o)||(u(),i="insert",s=o.content.getContent()[0],u()):this.deletes(o)?("delete"!==i&&(u(),i="delete"),c+=1):o.deleted||("retain"!==i&&(u(),i="retain"),l+=1);break;case Fo:this.adds(o)?this.deletes(o)||("insert"!==i&&(u(),i="insert"),s+=o.content.str):this.deletes(o)?("delete"!==i&&(u(),i="delete"),c+=o.length):o.deleted||("retain"!==i&&(u(),i="retain"),l+=o.length);break;case Mo:{const{key:t,value:s}=o.content;if(this.adds(o)){if(!this.deletes(o)){const l=n.get(t)||null;io(l,s)?null!==s&&o.delete(e):("retain"===i&&u(),io(s,r.get(t)||null)?delete a[t]:a[t]=s)}}else if(this.deletes(o)){r.set(t,s);const e=n.get(t)||null;io(e,s)||("retain"===i&&u(),a[t]=e)}else if(!o.deleted){r.set(t,s);const n=a[t];void 0!==n&&(io(n,s)?null!==n&&o.delete(e):("retain"===i&&u(),null===s?delete a[t]:a[t]=s))}o.deleted||("insert"===i&&u(),uo(n,o.content));break}}o=o.right}for(u();t.length>0;){const e=t[t.length-1];if(void 0===e.retain||void 0!==e.attributes)break;t.pop()}})),this._delta=t}return this._delta}}class ko extends Fr{constructor(e){super(),this._pending=void 0!==e?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this._length}_integrate(e,t){super._integrate(e,t);try{this._pending.forEach((e=>e()))}catch(e){console.error(e)}this._pending=null}_copy(){return new ko}clone(){const e=new ko;return e.applyDelta(this.toDelta()),e}_callObserver(e,t){super._callObserver(e,t);const n=new _o(this,e,t);Or(this,e,n),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){let e="",t=this._start;for(;null!==t;)!t.deleted&&t.countable&&t.content.constructor===Fo&&(e+=t.content.str),t=t.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:t=!0}={}){null!==this.doc?vr(this.doc,(n=>{const r=new ao(null,this._start,0,new Map);for(let o=0;o<e.length;o++){const i=e[o];if(void 0!==i.insert){const a=t||"string"!=typeof i.insert||o!==e.length-1||null!==r.right||"\n"!==i.insert.slice(-1)?i.insert:i.insert.slice(0,-1);("string"!=typeof a||a.length>0)&&mo(n,this,r,a,i.attributes||{})}else void 0!==i.retain?fo(n,this,r,i.retain,i.attributes||{}):void 0!==i.delete&&yo(n,r,i.delete)}})):this._pending.push((()=>this.applyDelta(e)))}toDelta(e,t,n){const r=[],o=new Map,i=this.doc;let a="",s=this._start;function l(){if(a.length>0){const e={};let t=!1;o.forEach(((n,r)=>{t=!0,e[r]=n}));const n={insert:a};t&&(n.attributes=e),r.push(n),a=""}}const c=()=>{for(;null!==s;){if(Qn(s,e)||void 0!==t&&Qn(s,t))switch(s.content.constructor){case Fo:{const r=o.get("ychange");void 0===e||Qn(s,e)?void 0===t||Qn(s,t)?void 0!==r&&(l(),o.delete("ychange")):void 0!==r&&r.user===s.id.client&&"added"===r.type||(l(),o.set("ychange",n?n("added",s.id):{type:"added"})):void 0!==r&&r.user===s.id.client&&"removed"===r.type||(l(),o.set("ychange",n?n("removed",s.id):{type:"removed"})),a+=s.content.str;break}case Go:case Lo:{l();const e={insert:s.content.getContent()[0]};if(o.size>0){const t={};e.attributes=t,o.forEach(((e,n)=>{t[n]=e}))}r.push(e);break}case Mo:Qn(s,e)&&(l(),uo(o,s.content))}s=s.right}l()};return e||t?vr(i,(n=>{e&&er(n,e),t&&er(n,t),c()}),"cleanup"):c(),r}insert(e,t,n){if(t.length<=0)return;const r=this.doc;null!==r?vr(r,(r=>{const o=lo(r,this,e,!n);n||(n={},o.currentAttributes.forEach(((e,t)=>{n[t]=e}))),mo(r,this,o,t,n)})):this._pending.push((()=>this.insert(e,t,n)))}insertEmbed(e,t,n){const r=this.doc;null!==r?vr(r,(r=>{const o=lo(r,this,e,!n);mo(r,this,o,t,n||{})})):this._pending.push((()=>this.insertEmbed(e,t,n||{})))}delete(e,t){if(0===t)return;const n=this.doc;null!==n?vr(n,(n=>{yo(n,lo(n,this,e,!0),t)})):this._pending.push((()=>this.delete(e,t)))}format(e,t,n){if(0===t)return;const r=this.doc;null!==r?vr(r,(r=>{const o=lo(r,this,e,!1);null!==o.right&&fo(r,this,o,t,n)})):this._pending.push((()=>this.format(e,t,n)))}removeAttribute(e){null!==this.doc?vr(this.doc,(t=>{Kr(t,this,e)})):this._pending.push((()=>this.removeAttribute(e)))}setAttribute(e,t){null!==this.doc?vr(this.doc,(n=>{Yr(n,this,e,t)})):this._pending.push((()=>this.setAttribute(e,t)))}getAttribute(e){return Xr(this,e)}getAttributes(){return Jr(this)}_write(e){e.writeTypeRef(Vo)}}class wo{constructor(e,t=(()=>!0)){this._filter=t,this._root=e,this._currentNode=e._start,this._firstCall=!0}[Symbol.iterator](){return this}next(){let e=this._currentNode,t=e&&e.content&&e.content.type;if(null!==e&&(!this._firstCall||e.deleted||!this._filter(t)))do{if(t=e.content.type,e.deleted||t.constructor!==Co&&t.constructor!==Eo||null===t._start)for(;null!==e;){if(null!==e.right){e=e.right;break}e=e.parent===this._root?null:e.parent._item}else e=t._start}while(null!==e&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,null===e?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}}class Eo extends Fr{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 Eo}clone(){const e=new Eo;return e.insert(0,this.toArray().map((e=>e instanceof Fr?e.clone():e))),e}get length(){return null===this._prelimContent?this._length:this._prelimContent.length}createTreeWalker(e){return new wo(this,e)}querySelector(e){e=e.toUpperCase();const t=new wo(this,(t=>t.nodeName&&t.nodeName.toUpperCase()===e)).next();return t.done?null:t.value}querySelectorAll(e){return e=e.toUpperCase(),ce(new wo(this,(t=>t.nodeName&&t.nodeName.toUpperCase()===e)))}_callObserver(e,t){Or(this,e,new xo(this,t,e))}toString(){return Vr(this,(e=>e.toString())).join("")}toJSON(){return this.toString()}toDOM(e=document,t={},n){const r=e.createDocumentFragment();return void 0!==n&&n._createAssociation(r,this),zr(this,(o=>{r.insertBefore(o.toDOM(e,t,n),null)})),r}insert(e,t){null!==this.doc?vr(this.doc,(n=>{Gr(n,this,e,t)})):this._prelimContent.splice(e,0,...t)}insertAfter(e,t){if(null!==this.doc)vr(this.doc,(n=>{const r=e&&e instanceof Fr?e._item:e;$r(n,this,r,t)}));else{const n=this._prelimContent,r=null===e?0:n.findIndex((t=>t===e))+1;if(0===r&&null!==e)throw Xe("Reference item not found");n.splice(r,0,...t)}}delete(e,t=1){null!==this.doc?vr(this.doc,(n=>{qr(n,this,e,t)})):this._prelimContent.splice(e,t)}toArray(){return Zr(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return Ur(this,e)}slice(e=0,t=this.length){return jr(this,e,t)}forEach(e){zr(this,e)}_write(e){e.writeTypeRef(Uo)}}class Co extends Eo{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 Co(this.nodeName)}clone(){const e=new Co(this.nodeName);return((e,t)=>{for(const n in e)t(e[n],n)})(this.getAttributes(),((t,n)=>{"string"==typeof t&&e.setAttribute(n,t)})),e.insert(0,this.toArray().map((e=>e instanceof Fr?e.clone():e))),e}toString(){const e=this.getAttributes(),t=[],n=[];for(const t in e)n.push(t);n.sort();const r=n.length;for(let o=0;o<r;o++){const r=n[o];t.push(r+'="'+e[r]+'"')}const o=this.nodeName.toLocaleLowerCase();return`<${o}${t.length>0?" "+t.join(" "):""}>${super.toString()}</${o}>`}removeAttribute(e){null!==this.doc?vr(this.doc,(t=>{Kr(t,this,e)})):this._prelimAttrs.delete(e)}setAttribute(e,t){null!==this.doc?vr(this.doc,(n=>{Yr(n,this,e,t)})):this._prelimAttrs.set(e,t)}getAttribute(e){return Xr(this,e)}hasAttribute(e){return Qr(this,e)}getAttributes(e){return e?((e,t)=>{const n={};return this._map.forEach(((e,r)=>{let o=e;for(;null!==o&&(!t.sv.has(o.id.client)||o.id.clock>=(t.sv.get(o.id.client)||0));)o=o.left;null!==o&&Qn(o,t)&&(n[r]=o.content.getContent()[o.length-1])})),n})(0,e):Jr(this)}toDOM(e=document,t={},n){const r=e.createElement(this.nodeName),o=this.getAttributes();for(const e in o){const t=o[e];"string"==typeof t&&r.setAttribute(e,t)}return zr(this,(o=>{r.appendChild(o.toDOM(e,t,n))})),void 0!==n&&n._createAssociation(r,this),r}_write(e){e.writeTypeRef(Ho),e.writeKey(this.nodeName)}}class xo extends Pr{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 So extends oo{constructor(e){super(),this.hookName=e}_copy(){return new So(this.hookName)}clone(){const e=new So(this.hookName);return this.forEach(((t,n)=>{e.set(n,t)})),e}toDOM(e=document,t={},n){const r=t[this.hookName];let o;return o=void 0!==r?r.createDom(this):document.createElement(this.hookName),o.setAttribute("data-yjs-hook",this.hookName),void 0!==n&&n._createAssociation(o,this),o}_write(e){e.writeTypeRef($o),e.writeKey(this.hookName)}}class Io extends ko{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 Io}clone(){const e=new Io;return e.applyDelta(this.toDelta()),e}toDOM(e=document,t,n){const r=e.createTextNode(this.toString());return void 0!==n&&n._createAssociation(r,this),r}toString(){return this.toDelta().map((e=>{const t=[];for(const n in e.attributes){const r=[];for(const t in e.attributes[n])r.push({key:t,value:e.attributes[n][t]});r.sort(((e,t)=>e.key<t.key?-1:1)),t.push({nodeName:n,attrs:r})}t.sort(((e,t)=>e.nodeName<t.nodeName?-1:1));let n="";for(let e=0;e<t.length;e++){const r=t[e];n+=`<${r.nodeName}`;for(let e=0;e<r.attrs.length;e++){const t=r.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(Wo)}}class To{constructor(e,t){this.id=e,this.length=t}get deleted(){throw Je()}mergeWith(e){return!1}write(e,t,n){throw Je()}integrate(e,t){throw Je()}}class No extends To{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),ar(e.doc.store,this)}write(e,t){e.writeInfo(0),e.writeLen(this.length-t)}getMissing(e,t){return null}}class Po{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new Po(this.content)}splice(e){throw Je()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeBuf(this.content)}getRef(){return 3}}class Ro{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new Ro(this.len)}splice(e){const t=new Ro(this.len-e);return this.len=e,t}mergeWith(e){return this.len+=e.len,!0}integrate(e,t){wn(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 Ao=(e,t)=>new Tn({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1});class Bo{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 Bo(Ao(this.doc.guid,this.opts))}splice(e){throw Je()}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 Lo{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new Lo(this.embed)}splice(e){throw Je()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeJSON(this.embed)}getRef(){return 5}}class Mo{constructor(e,t){this.key=e,this.value=t}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new Mo(this.key,this.value)}splice(e){throw Je()}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 Do{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Do(this.arr)}splice(e){const t=new Do(this.arr.slice(e));return this.arr=this.arr.slice(0,e),t}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){const n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){const t=this.arr[r];e.writeString(void 0===t?"undefined":JSON.stringify(t))}}getRef(){return 2}}class Oo{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Oo(this.arr)}splice(e){const t=new Oo(this.arr.slice(e));return this.arr=this.arr.slice(0,e),t}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){const n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){const t=this.arr[r];e.writeAny(t)}}getRef(){return 8}}class Fo{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new Fo(this.str)}splice(e){const t=new Fo(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 jo=[e=>new no,e=>new oo,e=>new ko,e=>new Co(e.readKey()),e=>new Eo,e=>new So(e.readKey()),e=>new Io],Zo=0,zo=1,Vo=2,Ho=3,Uo=4,$o=5,Wo=6;class Go{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new Go(this.type._copy())}splice(e){throw Je()}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 qo=(e,t,n)=>{const{client:r,clock:o}=t.id,i=new Ko(Xn(r,o+n),t,Xn(r,o+n-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(n));return t.deleted&&i.markDeleted(),t.keep&&(i.keep=!0),null!==t.redone&&(i.redone=Xn(t.redone.client,t.redone.clock+n)),t.right=i,null!==i.right&&(i.right.left=i),e._mergeStructs.push(i),null!==i.parentSub&&null===i.right&&i.parent._map.set(i.parentSub,i),t.length=n,i};class Ko extends To{constructor(e,t,n,r,o,i,a,s){super(e,s.getLength()),this.origin=n,this.left=t,this.right=r,this.rightOrigin=o,this.parent=i,this.parentSub=a,this.redone=null,this.content=s,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>=ir(t,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=ir(t,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===Kn&&this.id.client!==this.parent.client&&this.parent.clock>=ir(t,this.parent.client))return this.parent.client;if(this.origin&&(this.left=dr(e,t,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=ur(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===No||this.right&&this.right.constructor===No)this.parent=null;else if(this.parent){if(this.parent.constructor===Kn){const e=lr(t,this.parent);e.constructor===No?this.parent=null:this.parent=e.content.type}}else this.left&&this.left.constructor===Ko&&(this.parent=this.left.parent,this.parentSub=this.left.parentSub),this.right&&this.right.constructor===Ko&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);return null}integrate(e,t){if(t>0&&(this.id.clock+=t,this.left=dr(e,e.doc.store,Xn(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(t),this.length-=t),this.parent){if(!this.left&&(!this.right||null!==this.right.left)||this.left&&this.left.right!==this.right){let t,n=this.left;if(null!==n)t=n.right;else if(null!==this.parentSub)for(t=this.parent._map.get(this.parentSub)||null;null!==t&&null!==t.left;)t=t.left;else t=this.parent._start;const r=new Set,o=new Set;for(;null!==t&&t!==this.right;){if(o.add(t),r.add(t),Yn(this.origin,t.origin)){if(t.id.client<this.id.client)n=t,r.clear();else if(Yn(this.rightOrigin,t.rightOrigin))break}else{if(null===t.origin||!o.has(lr(e.doc.store,t.origin)))break;r.has(lr(e.doc.store,t.origin))||(n=t,r.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),ar(e.doc.store,this),this.content.integrate(e,this),fr(e,this.parent,this.parentSub),(null!==this.parent._item&&this.parent._item.deleted||null!==this.parentSub&&null!==this.right)&&this.delete(e)}else new No(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:Xn(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&Yn(e.origin,this.lastId)&&this.right===e&&Yn(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(),wn(e.deleteSet,this.id.client,this.id.clock,this.length),fr(e,t,this.parentSub),this.content.delete(e)}}gc(e,t){if(!this.deleted)throw Qe();this.content.gc(e),t?((e,t,n)=>{const r=e.clients.get(t.id.client);r[sr(r,t.id.clock)]=n})(e,this,new No(this.id,this.length)):this.content=new Ro(this.length)}write(e,t){const n=t>0?Xn(this.id.client,this.id.clock+t-1):this.origin,r=this.rightOrigin,o=this.parentSub,i=31&this.content.getRef()|(null===n?0:ye)|(null===r?0:ve)|(null===o?0:32);if(e.writeInfo(i),null!==n&&e.writeLeftID(n),null!==r&&e.writeRightID(r),null===n&&null===r){const t=this.parent;if(void 0!==t._item){const n=t._item;if(null===n){const n=(e=>{for(const[t,n]of e.doc.share.entries())if(n===e)return t;throw Qe()})(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===Kn?(e.writeParentInfo(!1),e.writeLeftID(t)):Qe();null!==o&&e.writeString(o)}this.content.write(e,t)}}const Yo=(e,t)=>Xo[31&t](e),Xo=[()=>{Qe()},e=>new Ro(e.readLen()),e=>{const t=e.readLen(),n=[];for(let r=0;r<t;r++){const t=e.readString();"undefined"===t?n.push(void 0):n.push(JSON.parse(t))}return new Do(n)},e=>new Po(e.readBuf()),e=>new Fo(e.readString()),e=>new Lo(e.readJSON()),e=>new Mo(e.readKey(),e.readJSON()),e=>new Go(jo[e.readTypeRef()](e)),e=>{const t=e.readLen(),n=[];for(let r=0;r<t;r++)n.push(e.readAny());return new Oo(n)},e=>new Bo(Ao(e.readString(),e.readAny())),()=>{Qe()}];class Jo extends To{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor&&(this.length+=e.length,!0)}integrate(e,t){Qe()}write(e,t){e.writeInfo(10),Me(e.restEncoder,this.length-t)}getMissing(e,t){return null}}const Qo="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},ei="__ $YJS$ __";!0===Qo[ei]&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438"),Qo[ei]=!0;const ti=(e,t)=>{const n={},r={},o={};return{register:function(e,t){n[e]=t},bootstrap:async function(i,a,s){const l=new Tn;o[i]=o[i]||{},o[i][a]=l;const c=()=>{const e=n[i].fromCRDTDoc(l);s(e)};l.on("update",c);const u=await e(a,i,l);t&&await t(a,i,l);const d=n[i].fetch;d&&d(a).then((e=>{l.transact((()=>{n[i].applyChangesToDoc(l,e)}))})),r[i]=r[i]||{},r[i][a]=()=>{u(),l.off("update",c)}},update:async function(e,t,r){const i=o[e][t];if(!i)throw"Error doc "+e+" "+t+" not found";i.transact((()=>{n[e].applyChangesToDoc(i,r)}))},discard:async function(e,t){r?.[e]?.[t]&&r[e][t]()}}},ni=e=>kt(((t,n)=>{e.onerror=e=>n(new Error(e.target.error)),e.onsuccess=e=>t(e.target.result)})),ri=(e,t,n="readwrite")=>{const r=e.transaction(t,n);return t.map((e=>li(r,e)))},oi=(e,t)=>ni(e.count(t)),ii=(e,t)=>ni(e.delete(t)),ai=(e,t)=>ni(e.add(t)),si=(e,t,n,r="next")=>((e,t)=>kt(((n,r)=>{e.onerror=r,e.onsuccess=async e=>{const r=e.target.result;if(null===r||!1===await t(r))return n();r.continue()}})))(e.openKeyCursor(t,r),(e=>n(e.key))),li=(e,t)=>e.objectStore(t),ci="custom",ui="updates",di=(e,t=(()=>{}),n=(()=>{}))=>{const[r]=ri(e.db,[ui]);return((e,t,n)=>ni(e.getAll(t,n)))(r,(o=e._dbref,!1,IDBKeyRange.lowerBound(o,false))).then((o=>{e._destroyed||(t(r),vr(e.doc,(()=>{o.forEach((t=>jn(e.doc,t)))}),e,!1),n(r))})).then((()=>((e,t=null)=>((e,t,n)=>{let r=null;return si(e,t,(e=>(r=e,!1)),n).then((()=>r))})(e,t,"prev"))(r).then((t=>{e._dbref=t+1})))).then((()=>oi(r).then((t=>{e._dbsize=t})))).then((()=>r));var o};class pi extends de{constructor(e,t){super(),this.doc=t,this.name=e,this._dbref=0,this._dbsize=0,this._destroyed=!1,this.db=null,this.synced=!1,this._db=((e,t)=>kt(((t,n)=>{const r=indexedDB.open(e);r.onupgradeneeded=e=>((e,t)=>[["updates",{autoIncrement:!0}],["custom"]].forEach((t=>e.createObjectStore.apply(e,t))))(e.target.result),r.onerror=e=>n(Xe(e.target.error)),r.onsuccess=e=>{const n=e.target.result;n.onversionchange=()=>{n.close()},t(n)}})))(e),this.whenSynced=kt((e=>this.on("synced",(()=>e(this))))),this._db.then((e=>{this.db=e,di(this,(e=>ai(e,zn(t))),(()=>{if(this._destroyed)return this;this.synced=!0,this.emit("synced",[this])}))})),this._storeTimeout=1e3,this._storeTimeoutId=null,this._storeUpdate=(e,t)=>{if(this.db&&t!==this){const[t]=ri(this.db,[ui]);ai(t,e),++this._dbsize>=500&&(null!==this._storeTimeoutId&&clearTimeout(this._storeTimeoutId),this._storeTimeoutId=setTimeout((()=>{((e,t=!0)=>{di(e).then((n=>{(t||e._dbsize>=500)&&ai(n,zn(e.doc)).then((()=>{return ii(n,(t=e._dbref,IDBKeyRange.upperBound(t,!0)));var t})).then((()=>oi(n).then((t=>{e._dbsize=t}))))}))})(this,!1),this._storeTimeoutId=null}),this._storeTimeout))}},t.on("update",this._storeUpdate),this.destroy=this.destroy.bind(this),t.on("destroy",this.destroy)}destroy(){return this._storeTimeoutId&&clearTimeout(this._storeTimeoutId),this.doc.off("update",this._storeUpdate),this.doc.off("destroy",this.destroy),this._destroyed=!0,this._db.then((e=>{e.close()}))}clearData(){return this.destroy().then((()=>{(e=>{ni(indexedDB.deleteDatabase(e))})(this.name)}))}get(e){return this._db.then((t=>{const[n]=ri(t,[ci],"readonly");return((e,t)=>ni(e.get(t)))(n,e)}))}set(e,t){return this._db.then((n=>{const[r]=ri(n,[ci]);return((e,t,n)=>ni(e.put(t,n)))(r,t,e)}))}del(e){return this._db.then((t=>{const[n]=ri(t,[ci]);return ii(n,e)}))}}function hi(e,t,n){const r=new pi(`${t}-${e}`,n);return new Promise((e=>{r.on("synced",(()=>{e((()=>r.destroy()))}))}))}const mi=e=>{if(e.shouldConnect&&null===e.ws){const t=new WebSocket(e.url),n=e.binaryType;let r=null;n&&(t.binaryType=n),e.ws=t,e.connecting=!0,e.connected=!1,t.onmessage=t=>{e.lastMessageReceived=Xt();const n=t.data,o="string"==typeof n?JSON.parse(n):n;o&&"pong"===o.type&&(clearTimeout(r),r=setTimeout(i,15e3)),e.emit("message",[o,e])};const o=t=>{null!==e.ws&&(e.ws=null,e.connecting=!1,e.connected?(e.connected=!1,e.emit("disconnect",[{type:"disconnect",error:t},e])):e.unsuccessfulReconnects++,setTimeout(mi,fe(1200*me(e.unsuccessfulReconnects+1),2500),e)),clearTimeout(r)},i=()=>{e.ws===t&&e.send({type:"ping"})};t.onclose=()=>o(null),t.onerror=e=>o(e),t.onopen=()=>{e.lastMessageReceived=Xt(),e.connecting=!1,e.connected=!0,e.unsuccessfulReconnects=0,e.emit("connect",[{type:"connect"},e]),r=setTimeout(i,15e3)}}};class fi extends de{constructor(e,{binaryType:t}={}){super(),this.url=e,this.ws=null,this.binaryType=t||null,this.connected=!1,this.connecting=!1,this.unsuccessfulReconnects=0,this.lastMessageReceived=0,this.shouldConnect=!0,this._checkInterval=setInterval((()=>{this.connected&&3e4<Xt()-this.lastMessageReceived&&this.ws.close()}),15e3),mi(this)}send(e){this.ws&&this.ws.send(JSON.stringify(e))}destroy(){clearInterval(this._checkInterval),this.disconnect(),super.destroy()}disconnect(){this.shouldConnect=!1,null!==this.ws&&this.ws.close()}connect(){this.shouldConnect=!0,this.connected||null!==this.ws||mi(this)}}const gi=new Map,bi="undefined"==typeof BroadcastChannel?class{constructor(e){var t;this.room=e,this.onmessage=null,this._onChange=t=>t.key===e&&null!==this.onmessage&&this.onmessage({data:Ut(t.newValue||"")}),t=this._onChange,Ct||addEventListener("storage",t)}postMessage(e){xt.setItem(this.room,Ht(new Uint8Array(e)))}close(){var e;e=this._onChange,Ct||removeEventListener("storage",e)}}:BroadcastChannel,vi=e=>ie(gi,e,(()=>{const t=ae(),n=new bi(e);return n.onmessage=e=>t.forEach((t=>t(e.data,"broadcastchannel"))),{bc:n,subs:t}}));var yi=n(47973);const _i=(e,t)=>{Me(e,0);const n=(e=>((e,t=new Mn)=>(e instanceof Map?Hn(t,e):((e,t)=>{Hn(e,or(t.store))})(t,e),t.toUint8Array()))(e,new Bn))(t);ze(e,n)},ki=(e,t,n)=>{Me(e,1),ze(e,zn(t,n))},wi=(e,t,n)=>{try{jn(t,ot(e),n)}catch(e){console.error("Caught error while handling a Yjs update",e)}},Ei=wi;class Ci extends de{constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval((()=>{const e=Xt();null!==this.getLocalState()&&15e3<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const t=[];this.meta.forEach(((n,r)=>{r!==this.clientID&&3e4<=e-n.lastUpdated&&this.states.has(r)&&t.push(r)})),t.length>0&&xi(this,t,"timeout")}),pe(3e3)),e.on("destroy",(()=>{this.destroy()})),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){const t=this.clientID,n=this.meta.get(t),r=void 0===n?0:n.clock+1,o=this.states.get(t);null===e?this.states.delete(t):this.states.set(t,e),this.meta.set(t,{clock:r,lastUpdated:Xt()});const i=[],a=[],s=[],l=[];null===e?l.push(t):null==o?null!=e&&i.push(t):(a.push(t),Bt(o,e)||s.push(t)),(i.length>0||s.length>0||l.length>0)&&this.emit("change",[{added:i,updated:s,removed:l},"local"]),this.emit("update",[{added:i,updated:a,removed:l},"local"])}setLocalStateField(e,t){const n=this.getLocalState();null!==n&&this.setLocalState({...n,[e]:t})}getStates(){return this.states}}const xi=(e,t,n)=>{const r=[];for(let n=0;n<t.length;n++){const o=t[n];if(e.states.has(o)){if(e.states.delete(o),o===e.clientID){const t=e.meta.get(o);e.meta.set(o,{clock:t.clock+1,lastUpdated:Xt()})}r.push(o)}}r.length>0&&(e.emit("change",[{added:[],updated:[],removed:r},n]),e.emit("update",[{added:[],updated:[],removed:r},n]))},Si=(e,t,n=e.states)=>{const r=t.length,o=Re();Me(o,r);for(let i=0;i<r;i++){const r=t[i],a=n.get(r)||null,s=e.meta.get(r).clock;Me(o,r),Me(o,s),je(o,JSON.stringify(a))}return Ae(o)},Ii=(e,t)=>{if(!t)return wt(e);const n=crypto.getRandomValues(new Uint8Array(12));return crypto.subtle.encrypt({name:"AES-GCM",iv:n},t,e).then((e=>{const t=Re();return je(t,"AES-GCM"),ze(t,n),ze(t,new Uint8Array(e)),Ae(t)}))},Ti=(e,t)=>{if(!t)return wt(e);const n=rt(e);var r;"AES-GCM"!==lt(n)&&(r=Xe("Unknown encryption algorithm"),Promise.reject(r));const o=ot(n),i=ot(n);return crypto.subtle.decrypt({name:"AES-GCM",iv:o},t,i).then((e=>new Uint8Array(e)))},Ni=((e,t)=>{const n=ln[cn],r=jt("log"),o=null!==r&&("*"===r||"true"===r||new RegExp(r,"gi").test(t));return cn=(cn+1)%ln.length,t+=": ",o?(...r)=>{const o=Xt(),i=o-un;un=o,e(n,t,sn,...r.map((e=>"string"==typeof e||"symbol"==typeof e?e:JSON.stringify(e))),n," +"+i+"ms")}:Rt})(hn,"y-webrtc"),Pi=new Map,Ri=new Map,Ai=e=>{let t=!0;e.webrtcConns.forEach((e=>{e.synced||(t=!1)})),(!t&&e.synced||t&&!e.synced)&&(e.synced=t,e.provider.emit("synced",[{synced:t}]),Ni("synced ",Jt,e.name,Qt," with all peers"))},Bi=(e,t,n)=>{const r=rt(t),o=Re(),i=at(r);if(void 0===e)return null;const a=e.awareness,s=e.doc;let l=!1;switch(i){case 0:{Me(o,0);const t=((e,t,n,r)=>{const o=at(e);switch(o){case 0:((e,t,n)=>{ki(t,n,ot(e))})(e,t,n);break;case 1:wi(e,n,r);break;case 2:Ei(e,n,r);break;default:throw new Error("Unknown message type")}return o})(r,o,s,e);1!==t||e.synced||n(),0===t&&(l=!0);break}case 3:Me(o,1),ze(o,Si(a,Array.from(a.getStates().keys()))),l=!0;break;case 1:((e,t,n)=>{const r=rt(t),o=Xt(),i=[],a=[],s=[],l=[],c=at(r);for(let t=0;t<c;t++){const t=at(r);let n=at(r);const c=JSON.parse(lt(r)),u=e.meta.get(t),d=e.states.get(t),p=void 0===u?0:u.clock;(p<n||p===n&&null===c&&e.states.has(t))&&(null===c?t===e.clientID&&null!=e.getLocalState()?n++:e.states.delete(t):e.states.set(t,c),e.meta.set(t,{clock:n,lastUpdated:o}),void 0===u&&null!==c?i.push(t):void 0!==u&&null===c?l.push(t):null!==c&&(Bt(c,d)||s.push(t),a.push(t)))}(i.length>0||s.length>0||l.length>0)&&e.emit("change",[{added:i,updated:s,removed:l},n]),(i.length>0||a.length>0||l.length>0)&&e.emit("update",[{added:i,updated:a,removed:l},n])})(a,ot(r),e);break;case 4:{const t=1===it(r),n=lt(r);if(n!==e.peerId&&(e.bcConns.has(n)&&!t||!e.bcConns.has(n)&&t)){const r=[],o=[];t?(e.bcConns.add(n),o.push(n)):(e.bcConns.delete(n),r.push(n)),e.provider.emit("peers",[{added:o,removed:r,webrtcPeers:Array.from(e.webrtcConns.keys()),bcPeers:Array.from(e.bcConns)}]),ji(e)}break}default:return console.error("Unable to compute message"),o}return l?o:null},Li=(e,t)=>{Ni("send message to ",Jt,e.remotePeerId,Qt,tn," (",e.room.name,")",sn);try{e.peer.send(Ae(t))}catch(e){}};class Mi{constructor(e,t,n,r){Ni("establishing connection to ",Jt,n),this.room=r,this.remotePeerId=n,this.glareToken=void 0,this.closed=!1,this.connected=!1,this.synced=!1,this.peer=new yi({initiator:t,...r.provider.peerOpts}),this.peer.on("signal",(t=>{void 0===this.glareToken&&(this.glareToken=Date.now()+Math.random()),zi(e,r,{to:n,from:r.peerId,type:"signal",token:this.glareToken,signal:t})})),this.peer.on("connect",(()=>{Ni("connected to ",Jt,n),this.connected=!0;const e=r.provider.doc,t=r.awareness,o=Re();Me(o,0),_i(o,e),Li(this,o);const i=t.getStates();if(i.size>0){const e=Re();Me(e,1),ze(e,Si(t,Array.from(i.keys()))),Li(this,e)}})),this.peer.on("close",(()=>{this.connected=!1,this.closed=!0,r.webrtcConns.has(this.remotePeerId)&&(r.webrtcConns.delete(this.remotePeerId),r.provider.emit("peers",[{removed:[this.remotePeerId],added:[],webrtcPeers:Array.from(r.webrtcConns.keys()),bcPeers:Array.from(r.bcConns)}])),Ai(r),this.peer.destroy(),Ni("closed connection to ",Jt,n),Fi(r)})),this.peer.on("error",(e=>{Ni("Error in connection to ",Jt,n,": ",e),Fi(r)})),this.peer.on("data",(e=>{const t=((e,t)=>{const n=e.room;return Ni("received message from ",Jt,e.remotePeerId,tn," (",n.name,")",Qt,sn),Bi(n,t,(()=>{e.synced=!0,Ni("synced ",Jt,n.name,Qt," with ",Jt,e.remotePeerId),Ai(n)}))})(this,e);null!==t&&Li(this,t)}))}destroy(){this.peer.destroy()}}const Di=(e,t)=>Ii(t,e.key).then((t=>e.mux((()=>((e,t,n=null)=>{const r=vi(e);r.bc.postMessage(t),r.subs.forEach((e=>e(t,n)))})(e.name,t))))),Oi=(e,t)=>{e.bcconnected&&Di(e,t),((e,t)=>{Ni("broadcast message in ",Jt,e.name,Qt),e.webrtcConns.forEach((e=>{try{e.peer.send(t)}catch(e){}}))})(e,t)},Fi=e=>{Pi.forEach((t=>{t.connected&&(t.send({type:"subscribe",topics:[e.name]}),e.webrtcConns.size<e.provider.maxConns&&zi(t,e,{type:"announce",from:e.peerId}))}))},ji=e=>{if(e.provider.filterBcConns){const t=Re();Me(t,4),Le(t,1),je(t,e.peerId),Di(e,Ae(t))}};class Zi{constructor(e,t,n,r){this.peerId=_t(),this.doc=e,this.awareness=t.awareness,this.provider=t,this.synced=!1,this.name=n,this.key=r,this.webrtcConns=new Map,this.bcConns=new Set,this.mux=(()=>{let e=!0;return(t,n)=>{if(e){e=!1;try{t()}finally{e=!0}}else void 0!==n&&n()}})(),this.bcconnected=!1,this._bcSubscriber=e=>Ti(new Uint8Array(e),r).then((e=>this.mux((()=>{const t=Bi(this,e,(()=>{}));t&&Di(this,Ae(t))})))),this._docUpdateHandler=(e,t)=>{const n=Re();Me(n,0),((e,t)=>{Me(e,2),ze(e,t)})(n,e),Oi(this,Ae(n))},this._awarenessUpdateHandler=({added:e,updated:t,removed:n},r)=>{const o=e.concat(t).concat(n),i=Re();Me(i,1),ze(i,Si(this.awareness,o)),Oi(this,Ae(i))},this._beforeUnloadHandler=()=>{xi(this.awareness,[e.clientID],"window unload"),Ri.forEach((e=>{e.disconnect()}))},"undefined"!=typeof window?window.addEventListener("beforeunload",this._beforeUnloadHandler):"undefined"!=typeof process&&process.on("exit",this._beforeUnloadHandler)}connect(){var e,t;this.doc.on("update",this._docUpdateHandler),this.awareness.on("update",this._awarenessUpdateHandler),Fi(this),e=this.name,t=this._bcSubscriber,vi(e).subs.add(t),this.bcconnected=!0,ji(this);const n=Re();Me(n,0),_i(n,this.doc),Di(this,Ae(n));const r=Re();Me(r,0),ki(r,this.doc),Di(this,Ae(r));const o=Re();Me(o,3),Di(this,Ae(o));const i=Re();Me(i,1),ze(i,Si(this.awareness,[this.doc.clientID])),Di(this,Ae(i))}disconnect(){Pi.forEach((e=>{e.connected&&e.send({type:"unsubscribe",topics:[this.name]})})),xi(this.awareness,[this.doc.clientID],"disconnect");const e=Re();Me(e,4),Le(e,0),je(e,this.peerId),Di(this,Ae(e)),((e,t)=>{const n=vi(e);n.subs.delete(t)&&0===n.subs.size&&(n.bc.close(),gi.delete(e))})(this.name,this._bcSubscriber),this.bcconnected=!1,this.doc.off("update",this._docUpdateHandler),this.awareness.off("update",this._awarenessUpdateHandler),this.webrtcConns.forEach((e=>e.destroy()))}destroy(){this.disconnect(),"undefined"!=typeof window?window.removeEventListener("beforeunload",this._beforeUnloadHandler):"undefined"!=typeof process&&process.off("exit",this._beforeUnloadHandler)}}const zi=(e,t,n)=>{t.key?((e,t)=>{const n=Re();return Ue(n,e),Ii(Ae(n),t)})(n,t.key).then((n=>{e.send({type:"publish",topic:t.name,data:Ht(n)})})):e.send({type:"publish",topic:t.name,data:n})};class Vi extends fi{constructor(e){super(e),this.providers=new Set,this.on("connect",(()=>{Ni(`connected (${e})`);const t=Array.from(Ri.keys());this.send({type:"subscribe",topics:t}),Ri.forEach((e=>zi(this,e,{type:"announce",from:e.peerId})))})),this.on("message",(e=>{if("publish"===e.type){const r=e.topic,o=Ri.get(r);if(null==o||"string"!=typeof r)return;const i=e=>{const t=o.webrtcConns,n=o.peerId;if(null==e||e.from===n||void 0!==e.to&&e.to!==n||o.bcConns.has(e.from))return;const r=t.has(e.from)?()=>{}:()=>o.provider.emit("peers",[{removed:[],added:[e.from],webrtcPeers:Array.from(o.webrtcConns.keys()),bcPeers:Array.from(o.bcConns)}]);switch(e.type){case"announce":t.size<o.provider.maxConns&&(ie(t,e.from,(()=>new Mi(this,!0,e.from,o))),r());break;case"signal":if("offer"===e.signal.type){const n=t.get(e.from);if(n){const t=e.token,r=n.glareToken;if(r&&r>t)return void Ni("offer rejected: ",e.from);n.glareToken=void 0}}"answer"===e.signal.type&&(Ni("offer answered by: ",e.from),t.get(e.from).glareToken=void 0),e.to===n&&(ie(t,e.from,(()=>new Mi(this,!1,e.from,o))).peer.signal(e.signal),r())}};o.key?"string"==typeof e.data&&(t=Ut(e.data),n=o.key,Ti(t,n).then((e=>dt(rt(new Uint8Array(e)))))).then(i):i(e.data)}var t,n})),this.on("disconnect",(()=>Ni(`disconnect (${e})`)))}}class Hi extends de{constructor(e,t,{signaling:n=["wss://y-webrtc-eu.fly.dev"],password:r=null,awareness:o=new Ci(t),maxConns:i=20+pe(15*bt()),filterBcConns:a=!0,peerOpts:s={}}={}){super(),this.roomName=e,this.doc=t,this.filterBcConns=a,this.awareness=o,this.shouldConnect=!1,this.signalingUrls=n,this.signalingConns=[],this.maxConns=i,this.peerOpts=s,this.key=r?((e,t)=>{const n=Te(e).buffer,r=Te(t).buffer;return crypto.subtle.importKey("raw",n,"PBKDF2",!1,["deriveKey"]).then((e=>crypto.subtle.deriveKey({name:"PBKDF2",salt:r,iterations:1e5,hash:"SHA-256"},e,{name:"AES-GCM",length:256},!0,["encrypt","decrypt"])))})(r,e):wt(null),this.room=null,this.key.then((n=>{this.room=((e,t,n,r)=>{if(Ri.has(n))throw Xe(`A Yjs Doc connected to room "${n}" already exists!`);const o=new Zi(e,t,n,r);return Ri.set(n,o),o})(t,this,e,n),this.shouldConnect?this.room.connect():this.room.disconnect()})),this.connect(),this.destroy=this.destroy.bind(this),t.on("destroy",this.destroy)}get connected(){return null!==this.room&&this.shouldConnect}connect(){this.shouldConnect=!0,this.signalingUrls.forEach((e=>{const t=ie(Pi,e,(()=>new Vi(e)));this.signalingConns.push(t),t.providers.add(this)})),this.room&&this.room.connect()}disconnect(){this.shouldConnect=!1,this.signalingConns.forEach((e=>{e.providers.delete(this),0===e.providers.size&&(e.destroy(),Pi.delete(e.url))})),this.room&&this.room.disconnect()}destroy(){this.doc.off("destroy",this.destroy),this.key.then((()=>{this.room.destroy(),Ri.delete(this.roomName)})),super.destroy()}}function Ui(e,t,n){return new Hi(`${t}-${e}`,n,{password:window.__experimentalCollaborativeEditingSecret}),Promise.resolve((()=>!0))}let $i;function Wi(){return $i||($i=ti(hi,Ui)),$i}function Gi(e,t){return{type:"RECEIVE_USER_QUERY",users:Array.isArray(t)?t:[t],queryID:e}}function qi(e){return{type:"RECEIVE_CURRENT_USER",currentUser:e}}function Ki(e){return{type:"ADD_ENTITIES",entities:e}}function Yi(e,t,n,r,o=!1,i){let a;return"postType"===e&&(n=(Array.isArray(n)?n:[n]).map((e=>"auto-draft"===e.status?{...e,title:""}:e))),a=r?function(e,t={},n){return{...X(e,n),query:t}}(n,r,i):X(n,i),{...a,kind:e,name:t,invalidateCache:o}}function Xi(e){return{type:"RECEIVE_CURRENT_THEME",currentTheme:e}}function Ji(e){return{type:"RECEIVE_CURRENT_GLOBAL_STYLES_ID",id:e}}function Qi(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLES",stylesheet:e,globalStyles:t}}function ea(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS",stylesheet:e,variations:t}}function ta(){return(0,q.Z)("wp.data.dispatch( 'core' ).receiveThemeSupports",{since:"5.9"}),{type:"DO_NOTHING"}}function na(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLE_REVISIONS",currentId:e,revisions:t}}function ra(e,t){return{type:"RECEIVE_EMBED_PREVIEW",url:e,preview:t}}const oa=(e,t,n,r,{__unstableFetch:o=I.default,throwOnError:i=!1}={})=>async({dispatch:a})=>{const s=(await a(Ca(e))).find((n=>n.kind===e&&n.name===t));let l,c=!1;if(!s||s?.__experimentalNoFetch)return;const u=await a.__unstableAcquireStoreLock(ne,["entities","records",e,t,n],{exclusive:!0});try{a({type:"DELETE_ENTITY_RECORD_START",kind:e,name:t,recordId:n});let u=!1;try{let i=`${s.baseURL}/${n}`;r&&(i=(0,G.f)(i,r)),c=await o({path:i,method:"DELETE"}),await a(function(e,t,n,r=!1){return{type:"REMOVE_ITEMS",itemIds:Array.isArray(n)?n:[n],kind:e,name:t,invalidateCache:r}}(e,t,n,!0))}catch(e){u=!0,l=e}if(a({type:"DELETE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:n,error:l}),u&&i)throw l;return c}finally{a.__unstableReleaseStoreLock(u)}},ia=(e,t,n,r,o={})=>({select:i,dispatch:a})=>{const s=i.getEntityConfig(e,t);if(!s)throw new Error(`The entity being edited (${e}, ${t}) does not have a loaded config.`);const{mergedEdits:l={}}=s,c=i.getRawEntityRecord(e,t,n),u=i.getEditedEntityRecord(e,t,n),d={kind:e,name:t,recordId:n,edits:Object.keys(r).reduce(((e,t)=>{const n=c[t],o=u[t],i=l[t]?{...o,...r[t]}:r[t];return e[t]=M()(n,i)?void 0:i,e}),{})};if(window.__experimentalEnableSync&&s.syncConfig){if(process.env.IS_GUTENBERG_PLUGIN){const e=s.getSyncObjectId(n);Wi().update(s.syncObjectType+"--edit",e,d.edits)}}else o.undoIgnore||i.getUndoManager().addRecord([{id:{kind:e,name:t,recordId:n},changes:Object.keys(r).reduce(((e,t)=>(e[t]={from:u[t],to:r[t]},e)),{})}],o.isCached),a({type:"EDIT_ENTITY_RECORD",...d})},aa=()=>({select:e,dispatch:t})=>{const n=e.getUndoManager().undo();n&&t({type:"UNDO",record:n})},sa=()=>({select:e,dispatch:t})=>{const n=e.getUndoManager().redo();n&&t({type:"REDO",record:n})},la=()=>({select:e})=>{e.getUndoManager().addRecord()},ca=(e,t,n,{isAutosave:r=!1,__unstableFetch:o=I.default,throwOnError:i=!1}={})=>async({select:a,resolveSelect:s,dispatch:l})=>{const c=(await l(Ca(e))).find((n=>n.kind===e&&n.name===t));if(!c||c?.__experimentalNoFetch)return;const u=c.key||ba,d=n[u],p=await l.__unstableAcquireStoreLock(ne,["entities","records",e,t,d||(0,W.Z)()],{exclusive:!0});try{for(const[r,o]of Object.entries(n))if("function"==typeof o){const i=o(a.getEditedEntityRecord(e,t,d));l.editEntityRecord(e,t,d,{[r]:i},{undoIgnore:!0}),n[r]=i}let u,p;l({type:"SAVE_ENTITY_RECORD_START",kind:e,name:t,recordId:d,isAutosave:r});let h=!1;try{const i=`${c.baseURL}${d?"/"+d:""}`,p=a.getRawEntityRecord(e,t,d);if(r){const r=a.getCurrentUser(),c=r?r.id:void 0,d=await s.getAutosave(p.type,p.id,c);let h={...p,...d,...n};if(h=Object.keys(h).reduce(((e,t)=>(["title","excerpt","content","meta"].includes(t)&&(e[t]=h[t]),e)),{status:"auto-draft"===h.status?"draft":h.status}),u=await o({path:`${i}/autosaves`,method:"POST",data:h}),p.id===u.id){let n={...p,...h,...u};n=Object.keys(n).reduce(((e,t)=>(["title","excerpt","content"].includes(t)?e[t]=n[t]:e[t]="status"===t?"auto-draft"===p.status&&"draft"===n.status?n.status:p.status:p[t],e)),{}),l.receiveEntityRecords(e,t,n,void 0,!0)}else l.receiveAutosaves(p.id,u)}else{let r=n;c.__unstablePrePersist&&(r={...r,...c.__unstablePrePersist(p,r)}),u=await o({path:i,method:d?"PUT":"POST",data:r}),l.receiveEntityRecords(e,t,u,void 0,!0,r)}}catch(e){h=!0,p=e}if(l({type:"SAVE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:d,error:p,isAutosave:r}),h&&i)throw p;return u}finally{l.__unstableReleaseStoreLock(p)}},ua=e=>async({dispatch:t})=>{const n=ee(),r={saveEntityRecord(e,r,o,i){return n.add((n=>t.saveEntityRecord(e,r,o,{...i,__unstableFetch:n})))},saveEditedEntityRecord(e,r,o,i){return n.add((n=>t.saveEditedEntityRecord(e,r,o,{...i,__unstableFetch:n})))},deleteEntityRecord(e,r,o,i,a){return n.add((n=>t.deleteEntityRecord(e,r,o,i,{...a,__unstableFetch:n})))}},o=e.map((e=>e(r))),[,...i]=await Promise.all([n.run(),...o]);return i},da=(e,t,n,r)=>async({select:o,dispatch:i})=>{if(!o.hasEditsForEntityRecord(e,t,n))return;const a=(await i(Ca(e))).find((n=>n.kind===e&&n.name===t));if(!a)return;const s=a.key||ba,l=o.getEntityRecordNonTransientEdits(e,t,n),c={[s]:n,...l};return await i.saveEntityRecord(e,t,c,r)},pa=(e,t,n,r,o)=>async({select:i,dispatch:a})=>{if(!i.hasEditsForEntityRecord(e,t,n))return;const s=i.getEntityRecordNonTransientEdits(e,t,n),l={};for(const e of r)K(l,e,Y(s,e));const c=(await a(Ca(e))).find((n=>n.kind===e&&n.name===t));return n&&(l[c?.key||ba]=n),await a.saveEntityRecord(e,t,l,o)};function ha(e){return(0,q.Z)("wp.data.dispatch( 'core' ).receiveUploadPermissions",{since:"5.9",alternative:"receiveUserPermission"}),ma("create/media",e)}function ma(e,t){return{type:"RECEIVE_USER_PERMISSION",key:e,isAllowed:t}}function fa(e,t){return{type:"RECEIVE_AUTOSAVES",postId:e,autosaves:Array.isArray(t)?t:[t]}}function ga(e){return{type:"RECEIVE_NAVIGATION_FALLBACK_ID",fallbackId:e}}const ba="id",va=["title","excerpt","content"],ya=[{label:(0,$.__)("Base"),kind:"root",name:"__unstableBase",baseURL:"/",baseURLParams:{_fields:["description","gmt_offset","home","name","site_icon","site_icon_url","site_logo","timezone_string","url"].join(",")},syncConfig:{fetch:async()=>(0,I.default)({path:"/"}),applyChangesToDoc:(e,t)=>{const n=e.getMap("document");Object.entries(t).forEach((([e,t])=>{n.get(e)!==t&&n.set(e,t)}))},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"root/base",getSyncObjectId:()=>"index"},{label:(0,$.__)("Site"),name:"site",kind:"root",baseURL:"/wp/v2/settings",getTitle:e=>{var t;return null!==(t=e?.title)&&void 0!==t?t:(0,$.__)("Site Title")},syncConfig:{fetch:async()=>(0,I.default)({path:"/wp/v2/settings"}),applyChangesToDoc:(e,t)=>{const n=e.getMap("document");Object.entries(t).forEach((([e,t])=>{n.get(e)!==t&&n.set(e,t)}))},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"root/site",getSyncObjectId:()=>"index"},{label:(0,$.__)("Post Type"),name:"postType",kind:"root",key:"slug",baseURL:"/wp/v2/types",baseURLParams:{context:"edit"},syncConfig:{fetch:async e=>(0,I.default)({path:`/wp/v2/types/${e}?context=edit`}),applyChangesToDoc:(e,t)=>{const n=e.getMap("document");Object.entries(t).forEach((([e,t])=>{n.get(e)!==t&&n.set(e,t)}))},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"root/postType",getSyncObjectId:e=>e},{name:"media",kind:"root",baseURL:"/wp/v2/media",baseURLParams:{context:"edit"},plural:"mediaItems",label:(0,$.__)("Media"),rawAttributes:["caption","title","description"]},{name:"taxonomy",kind:"root",key:"slug",baseURL:"/wp/v2/taxonomies",baseURLParams:{context:"edit"},plural:"taxonomies",label:(0,$.__)("Taxonomy")},{name:"sidebar",kind:"root",baseURL:"/wp/v2/sidebars",baseURLParams:{context:"edit"},plural:"sidebars",transientEdits:{blocks:!0},label:(0,$.__)("Widget areas")},{name:"widget",kind:"root",baseURL:"/wp/v2/widgets",baseURLParams:{context:"edit"},plural:"widgets",transientEdits:{blocks:!0},label:(0,$.__)("Widgets")},{name:"widgetType",kind:"root",baseURL:"/wp/v2/widget-types",baseURLParams:{context:"edit"},plural:"widgetTypes",label:(0,$.__)("Widget types")},{label:(0,$.__)("User"),name:"user",kind:"root",baseURL:"/wp/v2/users",baseURLParams:{context:"edit"},plural:"users"},{name:"comment",kind:"root",baseURL:"/wp/v2/comments",baseURLParams:{context:"edit"},plural:"comments",label:(0,$.__)("Comment")},{name:"menu",kind:"root",baseURL:"/wp/v2/menus",baseURLParams:{context:"edit"},plural:"menus",label:(0,$.__)("Menu")},{name:"menuItem",kind:"root",baseURL:"/wp/v2/menu-items",baseURLParams:{context:"edit"},plural:"menuItems",label:(0,$.__)("Menu Item"),rawAttributes:["title"]},{name:"menuLocation",kind:"root",baseURL:"/wp/v2/menu-locations",baseURLParams:{context:"edit"},plural:"menuLocations",label:(0,$.__)("Menu Location"),key:"name"},{label:(0,$.__)("Global Styles"),name:"globalStyles",kind:"root",baseURL:"/wp/v2/global-styles",baseURLParams:{context:"edit"},plural:"globalStylesVariations",getTitle:e=>e?.title?.rendered||e?.title},{label:(0,$.__)("Themes"),name:"theme",kind:"root",baseURL:"/wp/v2/themes",baseURLParams:{context:"edit"},key:"stylesheet"},{label:(0,$.__)("Plugins"),name:"plugin",kind:"root",baseURL:"/wp/v2/plugins",baseURLParams:{context:"edit"},key:"plugin"}],_a=[{kind:"postType",loadEntities:async function(){const e=await(0,I.default)({path:"/wp/v2/types?context=view"});return Object.entries(null!=e?e:{}).map((([e,t])=>{var n;const r=["wp_template","wp_template_part"].includes(e),o=null!==(n=t?.rest_namespace)&&void 0!==n?n:"wp/v2";return{kind:"postType",baseURL:`/${o}/${t.rest_base}`,baseURLParams:{context:"edit"},name:e,label:t.name,transientEdits:{blocks:!0,selection:!0},mergedEdits:{meta:!0},rawAttributes:va,getTitle:e=>{var t;return e?.title?.rendered||e?.title||(r?(0,H.I)(null!==(t=e.slug)&&void 0!==t?t:""):String(e.id))},__unstablePrePersist:r?void 0:ka,__unstable_rest_base:t.rest_base,syncConfig:{fetch:async e=>(0,I.default)({path:`/${o}/${t.rest_base}/${e}?context=edit`}),applyChangesToDoc:(e,t)=>{const n=e.getMap("document");Object.entries(t).forEach((([e,t])=>{n.get(e)!==t&&"function"!=typeof t&&n.set(e,t)}))},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"postType/"+t.name,getSyncObjectId:e=>e}}))}},{kind:"taxonomy",loadEntities:async function(){const e=await(0,I.default)({path:"/wp/v2/taxonomies?context=view"});return Object.entries(null!=e?e:{}).map((([e,t])=>{var n;return{kind:"taxonomy",baseURL:`/${null!==(n=t?.rest_namespace)&&void 0!==n?n:"wp/v2"}/${t.rest_base}`,baseURLParams:{context:"edit"},name:e,label:t.name}}))}}],ka=(e,t)=>{const n={};return"auto-draft"===e?.status&&(t.status||n.status||(n.status="draft"),t.title&&"Auto Draft"!==t.title||n.title||e?.title&&"Auto Draft"!==e?.title||(n.title="")),n},wa=(e,t,n="get",r=!1)=>{const o=ya.find((n=>n.kind===e&&n.name===t)),i="root"===e?"":(0,U.Ho)(e),a=(0,U.Ho)(t)+(r?"s":"");return`${n}${i}${r&&"plural"in o&&o?.plural?(0,U.Ho)(o.plural):a}`};function Ea(e){e.forEach((({syncObjectType:e,syncConfig:t})=>{Wi().register(e,t);const n={...t};delete n.fetch,Wi().register(e+"--edit",n)}))}const Ca=e=>async({select:t,dispatch:n})=>{let r=t.getEntitiesConfig(e);if(r&&0!==r.length)return window.__experimentalEnableSync&&process.env.IS_GUTENBERG_PLUGIN&&Ea(r),r;const o=_a.find((t=>t.kind===e));return o?(r=await o.loadEntities(),window.__experimentalEnableSync&&process.env.IS_GUTENBERG_PLUGIN&&Ea(r),n(Ki(r)),r):[]};var xa=function(e){return"string"==typeof e?e.split(","):Array.isArray(e)?e:null},Sa=function(e){const t=new WeakMap;return n=>{let r;return t.has(n)?r=t.get(n):(r=e(n),null!==n&&"object"==typeof n&&t.set(n,r)),r}}((function(e){const t={stableKey:"",page:1,perPage:10,fields:null,include:null,context:"default"},n=Object.keys(e).sort();for(let i=0;i<n.length;i++){const a=n[i];let s=e[a];switch(a){case"page":t[a]=Number(s);break;case"per_page":t.perPage=Number(s);break;case"context":t.context=s;break;default:var r,o;"_fields"===a&&(t.fields=null!==(r=xa(s))&&void 0!==r?r:[],s=t.fields.join()),"include"===a&&("number"==typeof s&&(s=s.toString()),t.include=(null!==(o=xa(s))&&void 0!==o?o:[]).map(Number),s=t.include.join()),t.stableKey+=(t.stableKey?"&":"")+(0,G.f)("",{[a]:s}).slice(1)}}return t}));function Ia(e){const{query:t}=e;return t?Sa(t).context:"default"}function Ta(e,t){return Object.fromEntries(Object.entries(e).filter((([e])=>!t.some((t=>Number.isInteger(t)?t===+e:t===e)))))}const Na=(0,D.Z)([Z((e=>"query"in e)),z((e=>e.query?{...e,...Sa(e.query)}:e)),V("context"),V("stableKey")])(((e=null,t)=>{const{type:n,page:r,perPage:o,key:i=ba}=t;return"RECEIVE_ITEMS"!==n?e:function(e,t,n,r){var o;if(1===n&&-1===r)return t;const i=(n-1)*r,a=Math.max(null!==(o=e?.length)&&void 0!==o?o:0,i+t.length),s=new Array(a);for(let n=0;n<a;n++){const r=n>=i&&n<i+t.length;s[n]=r?t[n-i]:e?.[n]}return s}(e||[],t.items.map((e=>e[i])),r,o)}));var Pa=(0,B.combineReducers)({items:function(e={},t){switch(t.type){case"RECEIVE_ITEMS":{const n=Ia(t),r=t.key||ba;return{...e,[n]:{...e[n],...t.items.reduce(((t,o)=>{const i=o[r];return t[i]=function(e,t){if(!e)return t;let n=!1;const r={};for(const o in t)M()(e[o],t[o])?r[o]=e[o]:(n=!0,r[o]=t[o]);if(!n)return e;for(const t in e)r.hasOwnProperty(t)||(r[t]=e[t]);return r}(e?.[n]?.[i],o),t}),{})}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(e).map((([e,n])=>[e,Ta(n,t.itemIds)])))}return e},itemIsComplete:function(e={},t){switch(t.type){case"RECEIVE_ITEMS":{const n=Ia(t),{query:r,key:o=ba}=t,i=r?Sa(r):{},a=!r||!Array.isArray(i.fields);return{...e,[n]:{...e[n],...t.items.reduce(((t,r)=>{const i=r[o];return t[i]=e?.[n]?.[i]||a,t}),{})}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(e).map((([e,n])=>[e,Ta(n,t.itemIds)])))}return e},queries:(e={},t)=>{switch(t.type){case"RECEIVE_ITEMS":return Na(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.filter((e=>!n[e]))])))])));default:return e}}});const Ra=e=>(t,n)=>{if("UNDO"===n.type||"REDO"===n.type){const{record:r}=n;let o=t;return r.forEach((({id:{kind:t,name:r,recordId:i},changes:a})=>{o=e(o,{type:"EDIT_ENTITY_RECORD",kind:t,name:r,recordId:i,edits:Object.entries(a).reduce(((e,[t,r])=>(e[t]="UNDO"===n.type?r.from:r.to,e)),{})})})),o}return e(t,n)};function Aa(e){return(0,D.Z)([Ra,Z((t=>t.name&&t.kind&&t.name===e.name&&t.kind===e.kind)),z((t=>({...t,key:e.key||ba})))])((0,B.combineReducers)({queriedData:Pa,edits:(e={},t)=>{var n;switch(t.type){case"RECEIVE_ITEMS":if("default"!==(null!==(n=t?.query?.context)&&void 0!==n?n:"default"))return e;const r={...e};for(const e of t.items){const n=e[t.key],o=r[n];if(!o)continue;const i=Object.keys(o).reduce(((n,r)=>{var i;return M()(o[r],null!==(i=e[r]?.raw)&&void 0!==i?i:e[r])||t.persistedEdits&&M()(o[r],t.persistedEdits[r])||(n[r]=o[r]),n}),{});Object.keys(i).length?r[n]=i:delete r[n]}return r;case"EDIT_ENTITY_RECORD":const o={...e[t.recordId],...t.edits};return Object.keys(o).forEach((e=>{void 0===o[e]&&delete o[e]})),{...e,[t.recordId]:o}}return e},saving:(e={},t)=>{switch(t.type){case"SAVE_ENTITY_RECORD_START":case"SAVE_ENTITY_RECORD_FINISH":return{...e,[t.recordId]:{pending:"SAVE_ENTITY_RECORD_START"===t.type,error:t.error,isAutosave:t.isAutosave}}}return e},deleting:(e={},t)=>{switch(t.type){case"DELETE_ENTITY_RECORD_START":case"DELETE_ENTITY_RECORD_FINISH":return{...e,[t.recordId]:{pending:"DELETE_ENTITY_RECORD_START"===t.type,error:t.error}}}return e}}))}var Ba=(0,B.combineReducers)({terms:function(e={},t){return"RECEIVE_TERMS"===t.type?{...e,[t.taxonomy]:t.terms}:e},users:function(e={byId:{},queries:{}},t){return"RECEIVE_USER_QUERY"===t.type?{byId:{...e.byId,...t.users.reduce(((e,t)=>({...e,[t.id]:t})),{})},queries:{...e.queries,[t.queryID]:t.users.map((e=>e.id))}}:e},currentTheme:function(e=void 0,t){return"RECEIVE_CURRENT_THEME"===t.type?t.currentTheme.stylesheet:e},currentGlobalStylesId:function(e=void 0,t){return"RECEIVE_CURRENT_GLOBAL_STYLES_ID"===t.type?t.id:e},currentUser:function(e={},t){return"RECEIVE_CURRENT_USER"===t.type?t.currentUser:e},themeGlobalStyleVariations:function(e={},t){return"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS"===t.type?{...e,[t.stylesheet]:t.variations}:e},themeBaseGlobalStyles:function(e={},t){return"RECEIVE_THEME_GLOBAL_STYLES"===t.type?{...e,[t.stylesheet]:t.globalStyles}:e},themeGlobalStyleRevisions:function(e={},t){return"RECEIVE_THEME_GLOBAL_STYLE_REVISIONS"===t.type?{...e,[t.currentId]:t.revisions}:e},taxonomies:function(e=[],t){return"RECEIVE_TAXONOMIES"===t.type?t.taxonomies:e},entities:(e={},t)=>{const n=function(e=ya,t){return"ADD_ENTITIES"===t.type?[...e,...t.entities]:e}(e.config,t);let r=e.reducer;if(!r||n!==e.config){const e=n.reduce(((e,t)=>{const{kind:n}=t;return e[n]||(e[n]=[]),e[n].push(t),e}),{});r=(0,B.combineReducers)(Object.entries(e).reduce(((e,[t,n])=>{const r=(0,B.combineReducers)(n.reduce(((e,t)=>({...e,[t.name]:Aa(t)})),{}));return e[t]=r,e}),{}))}const o=r(e.records,t);return o===e.records&&n===e.config&&r===e.reducer?e:{reducer:r,records:o,config:n}},editsReference:function(e={},t){switch(t.type){case"EDIT_ENTITY_RECORD":case"UNDO":case"REDO":return{}}return e},undoManager:function(e=function(){let e=[],t=[],n=0;const r=()=>{e=e.slice(0,n||void 0),n=0},o=()=>{var n;const r=0===e.length?0:e.length-1;let o=null!==(n=e[r])&&void 0!==n?n:[];t.forEach((e=>{o=j(o,e)})),t=[],e[r]=o};return{addRecord(n,i=!1){const a=!n||(e=>!e.filter((({changes:e})=>Object.values(e).some((({from:e,to:t})=>"function"!=typeof e&&"function"!=typeof t&&!(0,O.default)(e,t))))).length)(n);if(i){if(a)return;n.forEach((e=>{t=j(t,e)}))}else{if(r(),t.length&&o(),a)return;e.push(n)}},undo(){t.length&&(r(),o());const i=e[e.length-1+n];if(i)return n-=1,i},redo(){const t=e[e.length+n];if(t)return n+=1,t},hasUndo(){return!!e[e.length-1+n]},hasRedo(){return!!e[e.length+n]}}}()){return e},embedPreviews:function(e={},t){if("RECEIVE_EMBED_PREVIEW"===t.type){const{url:n,preview:r}=t;return{...e,[n]:r}}return e},userPermissions:function(e={},t){return"RECEIVE_USER_PERMISSION"===t.type?{...e,[t.key]:t.isAllowed}:e},autosaves:function(e={},t){if("RECEIVE_AUTOSAVES"===t.type){const{postId:n,autosaves:r}=t;return{...e,[n]:r}}return e},blockPatterns:function(e=[],t){return"RECEIVE_BLOCK_PATTERNS"===t.type?t.patterns:e},blockPatternCategories:function(e=[],t){return"RECEIVE_BLOCK_PATTERN_CATEGORIES"===t.type?t.categories:e},userPatternCategories:function(e=[],t){return"RECEIVE_USER_PATTERN_CATEGORIES"===t.type?t.patternCategories:e},navigationFallbackId:function(e=null,t){return"RECEIVE_NAVIGATION_FALLBACK_ID"===t.type?t.fallbackId:e}}),La=n(32407),Ma=n(62214),Da=n(24627),Oa=n.n(Da);const Fa=new WeakMap,ja=(0,La.Z)(((e,t={})=>{let n=Fa.get(e);if(n){const e=n.get(t);if(void 0!==e)return e}else n=new(Oa()),Fa.set(e,n);const r=function(e,t){const{stableKey:n,page:r,perPage:o,include:i,fields:a,context:s}=Sa(t);let l;if(e.queries?.[s]?.[n]&&(l=e.queries[s][n]),!l)return null;const c=-1===o?0:(r-1)*o,u=-1===o?l.length:Math.min(c+o,l.length),d=[];for(let t=c;t<u;t++){const n=l[t];if(Array.isArray(i)&&!i.includes(n))continue;if(!e.items[s]?.hasOwnProperty(n))return null;const r=e.items[s][n];let o;if(Array.isArray(a)){o={};for(let e=0;e<a.length;e++){const t=a[e].split(".");let n=r;t.forEach((e=>{n=n?.[e]})),K(o,t,n)}}else{if(!e.itemIsComplete[s]?.[n])return null;o=r}d.push(o)}return d}(e,t);return n.set(t,r),r})),Za={},za=(0,Ma.M)((e=>(t,n)=>e(ne).isResolving("getEmbedPreview",[n])));function Va(e,t){(0,q.Z)("select( 'core' ).getAuthors()",{since:"5.9",alternative:"select( 'core' ).getUsers({ who: 'authors' })"});const n=(0,G.f)("/wp/v2/users/?who=authors&per_page=100",t);return Ua(e,n)}function Ha(e){return e.currentUser}const Ua=(0,La.Z)(((e,t)=>{var n;return(null!==(n=e.users.queries[t])&&void 0!==n?n:[]).map((t=>e.users.byId[t]))}),((e,t)=>[e.users.queries[t],e.users.byId]));function $a(e,t){return(0,q.Z)("wp.data.select( 'core' ).getEntitiesByKind()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntitiesConfig()"}),Wa(e,t)}function Wa(e,t){return e.entities.config.filter((e=>e.kind===t))}function Ga(e,t,n){return(0,q.Z)("wp.data.select( 'core' ).getEntity()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntityConfig()"}),qa(e,t,n)}function qa(e,t,n){return e.entities.config?.find((e=>e.kind===t&&e.name===n))}const Ka=(0,La.Z)(((e,t,n,r,o)=>{var i;const a=e.entities.records?.[t]?.[n]?.queriedData;if(!a)return;const s=null!==(i=o?.context)&&void 0!==i?i:"default";if(void 0===o){if(!a.itemIsComplete[s]?.[r])return;return a.items[s][r]}const l=a.items[s]?.[r];if(l&&o._fields){var c;const e={},t=null!==(c=xa(o._fields))&&void 0!==c?c:[];for(let n=0;n<t.length;n++){const r=t[n].split(".");let o=l;r.forEach((e=>{o=o?.[e]})),K(e,r,o)}return e}return l}),((e,t,n,r,o)=>{var i;const a=null!==(i=o?.context)&&void 0!==i?i:"default";return[e.entities.records?.[t]?.[n]?.queriedData?.items[a]?.[r],e.entities.records?.[t]?.[n]?.queriedData?.itemIsComplete[a]?.[r]]}));function Ya(e,t,n,r){return Ka(e,t,n,r)}const Xa=(0,La.Z)(((e,t,n,r)=>{const o=Ka(e,t,n,r);return o&&Object.keys(o).reduce(((r,i)=>{var a;return!function(e,t){return(e.rawAttributes||[]).includes(t)}(qa(e,t,n),i)?r[i]=o[i]:r[i]=null!==(a=o[i]?.raw)&&void 0!==a?a:o[i],r}),{})}),((e,t,n,r,o)=>{var i;const a=null!==(i=o?.context)&&void 0!==i?i:"default";return[e.entities.config,e.entities.records?.[t]?.[n]?.queriedData?.items[a]?.[r],e.entities.records?.[t]?.[n]?.queriedData?.itemIsComplete[a]?.[r]]}));function Ja(e,t,n,r){return Array.isArray(Qa(e,t,n,r))}const Qa=(e,t,n,r)=>{const o=e.entities.records?.[t]?.[n]?.queriedData;return o?ja(o,r):null},es=(0,La.Z)((e=>{const{entities:{records:t}}=e,n=[];return Object.keys(t).forEach((r=>{Object.keys(t[r]).forEach((o=>{const i=Object.keys(t[r][o].edits).filter((t=>Ka(e,r,o,t)&&os(e,r,o,t)));if(i.length){const t=qa(e,r,o);i.forEach((i=>{const a=is(e,r,o,i);n.push({key:a?a[t.key||ba]:void 0,title:t?.getTitle?.(a)||"",name:o,kind:r})}))}}))})),n}),(e=>[e.entities.records])),ts=(0,La.Z)((e=>{const{entities:{records:t}}=e,n=[];return Object.keys(t).forEach((r=>{Object.keys(t[r]).forEach((o=>{const i=Object.keys(t[r][o].saving).filter((t=>ss(e,r,o,t)));if(i.length){const t=qa(e,r,o);i.forEach((i=>{const a=is(e,r,o,i);n.push({key:a?a[t.key||ba]:void 0,title:t?.getTitle?.(a)||"",name:o,kind:r})}))}}))})),n}),(e=>[e.entities.records]));function ns(e,t,n,r){return e.entities.records?.[t]?.[n]?.edits?.[r]}const rs=(0,La.Z)(((e,t,n,r)=>{const{transientEdits:o}=qa(e,t,n)||{},i=ns(e,t,n,r)||{};return o?Object.keys(i).reduce(((e,t)=>(o[t]||(e[t]=i[t]),e)),{}):i}),((e,t,n,r)=>[e.entities.config,e.entities.records?.[t]?.[n]?.edits?.[r]]));function os(e,t,n,r){return ss(e,t,n,r)||Object.keys(rs(e,t,n,r)).length>0}const is=(0,La.Z)(((e,t,n,r)=>({...Xa(e,t,n,r),...ns(e,t,n,r)})),((e,t,n,r,o)=>{var i;const a=null!==(i=o?.context)&&void 0!==i?i:"default";return[e.entities.config,e.entities.records?.[t]?.[n]?.queriedData.items[a]?.[r],e.entities.records?.[t]?.[n]?.queriedData.itemIsComplete[a]?.[r],e.entities.records?.[t]?.[n]?.edits?.[r]]}));function as(e,t,n,r){var o;const{pending:i,isAutosave:a}=null!==(o=e.entities.records?.[t]?.[n]?.saving?.[r])&&void 0!==o?o:{};return Boolean(i&&a)}function ss(e,t,n,r){var o;return null!==(o=e.entities.records?.[t]?.[n]?.saving?.[r]?.pending)&&void 0!==o&&o}function ls(e,t,n,r){var o;return null!==(o=e.entities.records?.[t]?.[n]?.deleting?.[r]?.pending)&&void 0!==o&&o}function cs(e,t,n,r){return e.entities.records?.[t]?.[n]?.saving?.[r]?.error}function us(e,t,n,r){return e.entities.records?.[t]?.[n]?.deleting?.[r]?.error}function ds(e){(0,q.Z)("select( 'core' ).getUndoEdit()",{since:"6.3"})}function ps(e){(0,q.Z)("select( 'core' ).getRedoEdit()",{since:"6.3"})}function hs(e){return e.undoManager.hasUndo()}function ms(e){return e.undoManager.hasRedo()}function fs(e){return Ka(e,"root","theme",e.currentTheme)}function gs(e){return e.currentGlobalStylesId}function bs(e){var t;return null!==(t=fs(e)?.theme_supports)&&void 0!==t?t:Za}function vs(e,t){return e.embedPreviews[t]}function ys(e,t){const n=e.embedPreviews[t],r='<a href="'+t+'">'+t+"</a>";return!!n&&n.html===r}function _s(e,t,n,r){const o=[t,n,r].filter(Boolean).join("/");return e.userPermissions[o]}function ks(e,t,n,r){const o=qa(e,t,n);return!!o&&_s(e,"update",o.__unstable_rest_base,r)}function ws(e,t,n){return e.autosaves[n]}function Es(e,t,n,r){if(void 0===r)return;const o=e.autosaves[n];return o?.find((e=>e.author===r))}const Cs=(0,Ma.M)((e=>(t,n,r)=>e(ne).hasFinishedResolution("getAutosaves",[n,r])));function xs(e){return e.editsReference}function Ss(e,t){const n=Qa(e,"postType","wp_template",{"find-template":t});return n?.length?is(e,"postType","wp_template",n[0].id):null}function Is(e){const t=fs(e);return t?e.themeBaseGlobalStyles[t.stylesheet]:null}function Ts(e){const t=fs(e);return t?e.themeGlobalStyleVariations[t.stylesheet]:null}function Ns(e){return e.blockPatterns}function Ps(e){return e.blockPatternCategories}function Rs(e){return e.userPatternCategories}function As(e){const t=gs(e);return t?e.themeGlobalStyleRevisions[t]:null}function Bs(e){return e.undoManager}function Ls(e){return e.navigationFallbackId}var Ms=n(15680),Ds=e=>(...t)=>async({resolveSelect:n})=>{await n[e](...t)};const Os=e=>async({dispatch:t})=>{const n=(0,G.f)("/wp/v2/users/?who=authors&per_page=100",e),r=await(0,I.default)({path:n});t.receiveUserQuery(n,r)},Fs=()=>async({dispatch:e})=>{const t=await(0,I.default)({path:"/wp/v2/users/me"});e.receiveCurrentUser(t)},js=(e,t,n="",r)=>async({select:o,dispatch:i})=>{const a=(await i(Ca(e))).find((n=>n.name===t&&n.kind===e));if(!a||a?.__experimentalNoFetch)return;const s=await i.__unstableAcquireStoreLock(ne,["entities","records",e,t,n],{exclusive:!1});try{if(window.__experimentalEnableSync&&a.syncConfig&&!r){if(process.env.IS_GUTENBERG_PLUGIN){const o=a.getSyncObjectId(n);await Wi().bootstrap(a.syncObjectType,o,(n=>{i.receiveEntityRecords(e,t,n,r)})),await Wi().bootstrap(a.syncObjectType+"--edit",o,(r=>{i({type:"EDIT_ENTITY_RECORD",kind:e,name:t,recordId:n,edits:r,meta:{undo:void 0}})}))}}else{void 0!==r&&r._fields&&(r={...r,_fields:[...new Set([...xa(r._fields)||[],a.key||ba])].join()});const s=(0,G.f)(a.baseURL+(n?"/"+n:""),{...a.baseURLParams,...r});if(void 0!==r&&(r={...r,include:[n]},o.hasEntityRecords(e,t,r)))return;const l=await(0,I.default)({path:s});i.receiveEntityRecords(e,t,l,r)}}finally{i.__unstableReleaseStoreLock(s)}},Zs=Ds("getEntityRecord"),zs=Ds("getEntityRecord"),Vs=(e,t,n={})=>async({dispatch:r})=>{const o=(await r(Ca(e))).find((n=>n.name===t&&n.kind===e));if(!o||o?.__experimentalNoFetch)return;const i=await r.__unstableAcquireStoreLock(ne,["entities","records",e,t],{exclusive:!1});try{n._fields&&(n={...n,_fields:[...new Set([...xa(n._fields)||[],o.key||ba])].join()});const i=(0,G.f)(o.baseURL,{...o.baseURLParams,...n});let a=Object.values(await(0,I.default)({path:i}));if(n._fields&&(a=a.map((e=>(n._fields.split(",").forEach((t=>{e.hasOwnProperty(t)||(e[t]=void 0)})),e)))),r.receiveEntityRecords(e,t,a,n),!n?._fields&&!n.context){const n=o.key||ba,i=a.filter((e=>e[n])).map((r=>[e,t,r[n]]));r({type:"START_RESOLUTIONS",selectorName:"getEntityRecord",args:i}),r({type:"FINISH_RESOLUTIONS",selectorName:"getEntityRecord",args:i})}}finally{r.__unstableReleaseStoreLock(i)}};Vs.shouldInvalidate=(e,t,n)=>("RECEIVE_ITEMS"===e.type||"REMOVE_ITEMS"===e.type)&&e.invalidateCache&&t===e.kind&&n===e.name;const Hs=()=>async({dispatch:e,resolveSelect:t})=>{const n=await t.getEntityRecords("root","theme",{status:"active"});e.receiveCurrentTheme(n[0])},Us=Ds("getCurrentTheme"),$s=e=>async({dispatch:t})=>{try{const n=await(0,I.default)({path:(0,G.f)("/oembed/1.0/proxy",{url:e})});t.receiveEmbedPreview(e,n)}catch(n){t.receiveEmbedPreview(e,!1)}},Ws=(e,t,n)=>async({dispatch:r,registry:o})=>{const{hasStartedResolution:i}=o.select(ne),a=n?`${t}/${n}`:t,s=["create","read","update","delete"];if(!s.includes(e))throw new Error(`'${e}' is not a valid action.`);for(const r of s)if(r!==e&&i("canUser",[r,t,n]))return;let l;try{l=await(0,I.default)({path:`/wp/v2/${a}`,method:"OPTIONS",parse:!1})}catch(e){return}const c=l.headers?.get("allow"),u=c?.allow||c||"",d={},p={create:"POST",read:"GET",update:"PUT",delete:"DELETE"};for(const[e,t]of Object.entries(p))d[e]=u.includes(t);for(const e of s)r.receiveUserPermission(`${e}/${a}`,d[e])},Gs=(e,t,n)=>async({dispatch:r})=>{const o=(await r(Ca(e))).find((n=>n.name===t&&n.kind===e));if(!o)return;const i=o.__unstable_rest_base;await r(Ws("update",i,n))},qs=(e,t)=>async({dispatch:n,resolveSelect:r})=>{const{rest_base:o,rest_namespace:i="wp/v2"}=await r.getPostType(e),a=await(0,I.default)({path:`/${i}/${o}/${t}/autosaves?context=edit`});a&&a.length&&n.receiveAutosaves(t,a)},Ks=(e,t)=>async({resolveSelect:n})=>{await n.getAutosaves(e,t)},Ys=e=>async({dispatch:t,resolveSelect:n})=>{let r;try{r=await(0,I.default)({url:(0,G.f)(e,{"_wp-find-template":!0})}).then((({data:e})=>e))}catch(e){}if(!r)return;const o=await n.getEntityRecord("postType","wp_template",r.id);o&&t.receiveEntityRecords("postType","wp_template",[o],{"find-template":e})};Ys.shouldInvalidate=e=>("RECEIVE_ITEMS"===e.type||"REMOVE_ITEMS"===e.type)&&e.invalidateCache&&"postType"===e.kind&&"wp_template"===e.name;const Xs=()=>async({dispatch:e,resolveSelect:t})=>{const n=await t.getEntityRecords("root","theme",{status:"active"}),r=n?.[0]?._links?.["wp:user-global-styles"]?.[0]?.href;if(r){const t=await(0,I.default)({url:r});e.__experimentalReceiveCurrentGlobalStylesId(t.id)}},Js=()=>async({resolveSelect:e,dispatch:t})=>{const n=await e.getCurrentTheme(),r=await(0,I.default)({path:`/wp/v2/global-styles/themes/${n.stylesheet}`});t.__experimentalReceiveThemeBaseGlobalStyles(n.stylesheet,r)},Qs=()=>async({resolveSelect:e,dispatch:t})=>{const n=await e.getCurrentTheme(),r=await(0,I.default)({path:`/wp/v2/global-styles/themes/${n.stylesheet}/variations`});t.__experimentalReceiveThemeGlobalStyleVariations(n.stylesheet,r)},el=()=>async({resolveSelect:e,dispatch:t})=>{const n=await e.__experimentalGetCurrentGlobalStylesId(),r=n?await e.getEntityRecord("root","globalStyles",n):void 0,o=r?._links?.["version-history"]?.[0]?.href;if(o){const e=await(0,I.default)({url:o}),r=e?.map((e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[(0,Ms.eV)(e),t])))));t.receiveThemeGlobalStyleRevisions(n,r)}};el.shouldInvalidate=e=>"SAVE_ENTITY_RECORD_FINISH"===e.type&&"root"===e.kind&&!e.error&&"globalStyles"===e.name;const tl=()=>async({dispatch:e})=>{const t=await(0,I.default)({path:"/wp/v2/block-patterns/patterns"}),n=t?.map((e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[(0,Ms.eV)(e),t])))));e({type:"RECEIVE_BLOCK_PATTERNS",patterns:n})},nl=()=>async({dispatch:e})=>{e({type:"RECEIVE_BLOCK_PATTERN_CATEGORIES",categories:await(0,I.default)({path:"/wp/v2/block-patterns/categories"})})},rl=()=>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:e.name,name:e.slug})))||[]})},ol=()=>async({dispatch:e,select:t})=>{const n=await(0,I.default)({path:(0,G.f)("/wp-block-editor/v1/navigation-fallback",{_embed:!0})}),r=n?._embedded?.self;if(e.receiveNavigationFallbackId(n?.id),r){const o=!t.getEntityRecord("postType","wp_navigation",n?.id);e.receiveEntityRecords("postType","wp_navigation",r,void 0,o),e.finishResolution("getEntityRecord",["postType","wp_navigation",n?.id])}};function il(e,t){const n={...e};let r=n;for(const e of t)r.children={...r.children,[e]:{locks:[],children:{},...r.children[e]}},r=r.children[e];return n}function al(e,t){let n=e;for(const e of t){const t=n.children[e];if(!t)return null;n=t}return n}function sl({exclusive:e},t){return!(!e||!t.length)||!(e||!t.filter((e=>e.exclusive)).length)}const ll={requests:[],tree:{locks:[],children:{}}};function cl(e=ll,t){switch(t.type){case"ENQUEUE_LOCK_REQUEST":{const{request:n}=t;return{...e,requests:[n,...e.requests]}}case"GRANT_LOCK_REQUEST":{const{lock:n,request:r}=t,{store:o,path:i}=r,a=[o,...i],s=il(e.tree,a),l=al(s,a);return l.locks=[...l.locks,n],{...e,requests:e.requests.filter((e=>e!==r)),tree:s}}case"RELEASE_LOCK":{const{lock:n}=t,r=[n.store,...n.path],o=il(e.tree,r),i=al(o,r);return i.locks=i.locks.filter((e=>e!==n)),{...e,tree:o}}}return e}function ul(e,t,n,{exclusive:r}){const o=[t,...n],i=e.tree;for(const e of function*(e,t){let n=e;yield n;for(const e of t){const t=n.children[e];if(!t)break;yield t,n=t}}(i,o))if(sl({exclusive:r},e.locks))return!1;const a=al(i,o);if(!a)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))}}(a))if(sl({exclusive:r},e.locks))return!1;return!0}function dl(){let e=cl(void 0,{type:"@@INIT"});function t(){for(const t of function(e){return e.requests}(e)){const{store:n,path:r,exclusive:o,notifyAcquired:i}=t;if(ul(e,n,r,{exclusive:o})){const a={store:n,path:r,exclusive:o};e=cl(e,{type:"GRANT_LOCK_REQUEST",lock:a,request:t}),i(a)}}}return{acquire:function(n,r,o){return new Promise((i=>{e=cl(e,{type:"ENQUEUE_LOCK_REQUEST",request:{store:n,path:r,exclusive:o,notifyAcquired:i}}),t()}))},release:function(n){e=cl(e,{type:"RELEASE_LOCK",lock:n}),t()}}}var pl=n(78466);const{lock:hl,unlock:ml}=(0,pl.es)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/core-data"),fl=ya.reduce(((e,t)=>{const{kind:n,name:r}=t;return e[wa(n,r)]=(e,t,o)=>Ka(e,n,r,t,o),e[wa(n,r,"get",!0)]=(e,t)=>Qa(e,n,r,t),e}),{}),gl=ya.reduce(((e,t)=>{const{kind:n,name:r}=t;e[wa(n,r)]=(e,t)=>js(n,r,e,t);const o=wa(n,r,"get",!0);return e[o]=(...e)=>Vs(n,r,...e),e[o].shouldInvalidate=e=>Vs.shouldInvalidate(e,n,r),e}),{}),bl=ya.reduce(((e,t)=>{const{kind:n,name:r}=t;return e[wa(n,r,"save")]=e=>ca(n,r,e),e[wa(n,r,"delete")]=(e,t)=>oa(n,r,e,t),e}),{}),vl=(0,A.Z)(ne,{reducer:Ba,actions:{...r,...bl,...function(){const e=dl();return{__unstableAcquireStoreLock:function(t,n,{exclusive:r}){return()=>e.acquire(t,n,r)},__unstableReleaseStoreLock:function(t){return()=>e.release(t)}}}()},selectors:{...o,...fl},resolvers:{...a,...gl}});ml(vl).registerPrivateSelectors(i),(0,B.register)(vl);var yl=n(21229),_l=n(14029),kl=n(485);const wl=[],El=()=>{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})])}})},Cl=()=>{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])}})},xl=e=>["sizes","mime","type","subtype","id","url","alt","link","caption"].reduce(((t,n)=>(e?.hasOwnProperty(n)&&(t[n]=e[n]),t)),{}),Sl=e=>{const{wp:t}=window;return t.media.query({order:"ASC",orderby:"post__in",post__in:e,posts_per_page:-1,query:!0,type:"image"})};class Il extends x.Component{constructor({allowedTypes:e,gallery:t=!1,unstableFeaturedImageFlow:n=!1,modalClass:r,multiple:o=!1,title:i=(0,$.__)("Select or Upload Media")}){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);const{wp:a}=window;if(t)this.buildAndSetGalleryFrame();else{const t={title:i,multiple:o};e&&(t.library={type:e}),this.frame=a.media(t)}r&&this.frame.$el.addClass(r),n&&this.buildAndSetFeatureImageFrame(),this.initializeListeners()}initializeListeners(){this.frame.on("select",this.onSelect),this.frame.on("update",this.onUpdate),this.frame.on("open",this.onOpen),this.frame.on("close",this.onClose)}buildAndSetGalleryFrame(){const{addToGallery:e=!1,allowedTypes:t,multiple:n=!1,value:r=wl}=this.props;if(r===this.lastGalleryValue)return;const{wp:o}=window;let i;this.lastGalleryValue=r,this.frame&&this.frame.remove(),i=e?"gallery-library":r&&r.length?"gallery-edit":"gallery",this.GalleryDetailsMediaFrame||(this.GalleryDetailsMediaFrame=Cl());const a=Sl(r),s=new o.media.model.Selection(a.models,{props:a.props.toJSON(),multiple:n});this.frame=new this.GalleryDetailsMediaFrame({mimeType:t,state:i,multiple:n,selection:s,editing:!(!r||!r.length)}),o.media.frame=this.frame,this.initializeListeners()}buildAndSetFeatureImageFrame(){const{wp:e}=window,t=El(),n=Sl(this.props.value),r=new e.media.model.Selection(n.models,{props:n.props.toJSON()});this.frame=new t({mimeType:this.props.allowedTypes,state:"featured-image",multiple:this.props.multiple,selection:r,editing:!!this.props.value}),e.media.frame=this.frame}componentWillUnmount(){this.frame.remove()}onUpdate(e){const{onSelect:t,multiple:n=!1}=this.props,r=this.frame.state(),o=e||r.get("selection");o&&o.models.length&&t(n?o.models.map((e=>xl(e.toJSON()))):xl(o.models[0].toJSON()))}onSelect(){const{onSelect:e,multiple:t=!1}=this.props,n=this.frame.state().get("selection").toJSON();e(t?n:n[0])}onOpen(){const{wp:e}=window,{value:t}=this.props;if(this.updateCollection(),this.props.mode&&this.frame.content.mode(this.props.mode),!(Array.isArray(t)?t?.length:t))return;const n=this.props.gallery,r=this.frame.state().get("selection"),o=Array.isArray(t)?t:[t];n||o.forEach((t=>{r.add(e.media.attachment(t))}));const i=Sl(o);i.more().done((function(){n&&i?.models?.length&&r.add(i.models)}))}onClose(){const{onClose:e}=this.props;e&&e()}updateCollection(){const e=this.frame.content.get();if(e&&e.collection){const t=e.collection;t.toArray().forEach((e=>e.trigger("destroy",e))),t.mirroring._hasMore=!0,t.more()}}openModal(){this.props.gallery&&this.buildAndSetGalleryFrame(),this.frame.open()}render(){return this.props.render({open:this.openModal})}}var Tl=Il;const Nl={};function Pl(e){const t=window.URL.createObjectURL(e);return Nl[t]=e,t}function Rl(e){Nl[e]&&window.URL.revokeObjectURL(e),delete Nl[e]}function Al(e){return!(!e||!e.indexOf)&&0===e.indexOf("blob:")}const Bl=()=>{};async function Ll({allowedTypes:e,additionalData:t={},filesList:n,maxUploadFileSize:r,onError:o=Bl,onFileChange:i,wpAllowedMimeTypes:a=null}){const s=[...n],l=[],c=(e,t)=>{Rl(l[e]?.url),l[e]=t,i(l.filter(Boolean))},u=t=>!e||e.some((e=>e.includes("/")?e===t:t.startsWith(`${e}/`))),d=(p=a)?Object.entries(p).map((([e,t])=>{const[n]=t.split("/");return[t,...e.split("|").map((e=>`${n}/${e}`))]})).flat():p;var p;const h=[];for(const e of s)d&&e.type&&(m=e.type,!d.includes(m))?o({code:"MIME_TYPE_NOT_ALLOWED_FOR_USER",message:(0,$.sprintf)((0,$.__)("%s: Sorry, you are not allowed to upload this file type."),e.name),file:e}):!e.type||u(e.type)?r&&e.size>r?o({code:"SIZE_ABOVE_LIMIT",message:(0,$.sprintf)((0,$.__)("%s: This file exceeds the maximum upload size for this site."),e.name),file:e}):e.size<=0?o({code:"EMPTY_FILE",message:(0,$.sprintf)((0,$.__)("%s: This file is empty."),e.name),file:e}):(h.push(e),l.push({url:Pl(e)}),i(l)):o({code:"MIME_TYPE_NOT_SUPPORTED",message:(0,$.sprintf)((0,$.__)("%s: Sorry, this file type is not supported here."),e.name),file:e});var m;for(let e=0;e<h.length;++e){const n=h[e];try{var f;const r=await Ml(n,t),{alt_text:o,source_url:i,...a}=r;c(e,{...a,alt:r.alt_text,caption:null!==(f=r.caption?.raw)&&void 0!==f?f:"",title:r.title.raw,url:r.source_url})}catch(t){let r;c(e,null),r=t.message?t.message:(0,$.sprintf)((0,$.__)("Error while uploading file %s to the media library."),n.name),o({code:"GENERAL",message:r,file:n})}}}function Ml(e,t){const n=new window.FormData;return n.append("file",e,e.name||e.type.replace("/",".")),t&&Object.entries(t).forEach((([e,t])=>n.append(e,t))),(0,I.default)({path:"/wp/v2/media",body:n,method:"POST"})}var Dl=n(11354),Ol=n(33262),Fl=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},jl=function(e){return.2126*Fl(e.r)+.7152*Fl(e.g)+.0722*Fl(e.b)};function Zl(e){e.prototype.luminance=function(){return e=jl(this.rgba),void 0===(t=2)&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0;var e,t,n},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var n,r,o,i,a,s,l,c=t instanceof e?t:new e(t);return i=this.rgba,a=c.toRgb(),n=(s=jl(i))>(l=jl(a))?(s+.05)/(l+.05):(l+.05)/(s+.05),void 0===(r=2)&&(r=0),void 0===o&&(o=Math.pow(10,r)),Math.floor(o*n)/o+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(a=void 0===(i=(n=t).size)?"normal":i,"AAA"===(o=void 0===(r=n.level)?"AA":r)&&"normal"===a?7:"AA"===o&&"large"===a?3:4.5);var n,r,o,i,a}}function zl(e){e.parentNode,e.parentNode.removeChild(e)}function Vl(e){const{body:t}=document.implementation.createHTMLDocument("");t.innerHTML=e;const n=t.getElementsByTagName("*");let r=n.length;for(;r--;){const e=n[r];if("SCRIPT"===e.tagName)zl(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 Hl(e){e=Vl(e);const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,t.body.textContent||""}const Ul="block-default",$l=["attributes","supports","save","migrate","isEligible","apiVersion"],Wl={"--wp--style--color--link":{value:["color","link"],support:["color","link"]},background:{value:["color","gradient"],support:["color","gradients"],useEngine:!0},backgroundColor:{value:["color","background"],support:["color","background"],requiresOptOut:!0,useEngine:!0},borderColor:{value:["border","color"],support:["__experimentalBorder","color"],useEngine:!0},borderRadius:{value:["border","radius"],support:["__experimentalBorder","radius"],properties:{borderTopLeftRadius:"topLeft",borderTopRightRadius:"topRight",borderBottomLeftRadius:"bottomLeft",borderBottomRightRadius:"bottomRight"},useEngine:!0},borderStyle:{value:["border","style"],support:["__experimentalBorder","style"],useEngine:!0},borderWidth:{value:["border","width"],support:["__experimentalBorder","width"],useEngine:!0},borderTopColor:{value:["border","top","color"],support:["__experimentalBorder","color"],useEngine:!0},borderTopStyle:{value:["border","top","style"],support:["__experimentalBorder","style"],useEngine:!0},borderTopWidth:{value:["border","top","width"],support:["__experimentalBorder","width"],useEngine:!0},borderRightColor:{value:["border","right","color"],support:["__experimentalBorder","color"],useEngine:!0},borderRightStyle:{value:["border","right","style"],support:["__experimentalBorder","style"],useEngine:!0},borderRightWidth:{value:["border","right","width"],support:["__experimentalBorder","width"],useEngine:!0},borderBottomColor:{value:["border","bottom","color"],support:["__experimentalBorder","color"],useEngine:!0},borderBottomStyle:{value:["border","bottom","style"],support:["__experimentalBorder","style"],useEngine:!0},borderBottomWidth:{value:["border","bottom","width"],support:["__experimentalBorder","width"],useEngine:!0},borderLeftColor:{value:["border","left","color"],support:["__experimentalBorder","color"],useEngine:!0},borderLeftStyle:{value:["border","left","style"],support:["__experimentalBorder","style"],useEngine:!0},borderLeftWidth:{value:["border","left","width"],support:["__experimentalBorder","width"],useEngine:!0},color:{value:["color","text"],support:["color","text"],requiresOptOut:!0,useEngine:!0},columnCount:{value:["typography","textColumns"],support:["typography","textColumns"],useEngine:!0},filter:{value:["filter","duotone"],support:["filter","duotone"]},linkColor:{value:["elements","link","color","text"],support:["color","link"]},captionColor:{value:["elements","caption","color","text"],support:["color","caption"]},buttonColor:{value:["elements","button","color","text"],support:["color","button"]},buttonBackgroundColor:{value:["elements","button","color","background"],support:["color","button"]},headingColor:{value:["elements","heading","color","text"],support:["color","heading"]},headingBackgroundColor:{value:["elements","heading","color","background"],support:["color","heading"]},fontFamily:{value:["typography","fontFamily"],support:["typography","__experimentalFontFamily"],useEngine:!0},fontSize:{value:["typography","fontSize"],support:["typography","fontSize"],useEngine:!0},fontStyle:{value:["typography","fontStyle"],support:["typography","__experimentalFontStyle"],useEngine:!0},fontWeight:{value:["typography","fontWeight"],support:["typography","__experimentalFontWeight"],useEngine:!0},lineHeight:{value:["typography","lineHeight"],support:["typography","lineHeight"],useEngine:!0},margin:{value:["spacing","margin"],support:["spacing","margin"],properties:{marginTop:"top",marginRight:"right",marginBottom:"bottom",marginLeft:"left"},useEngine:!0},minHeight:{value:["dimensions","minHeight"],support:["dimensions","minHeight"],useEngine:!0},padding:{value:["spacing","padding"],support:["spacing","padding"],properties:{paddingTop:"top",paddingRight:"right",paddingBottom:"bottom",paddingLeft:"left"},useEngine:!0},textDecoration:{value:["typography","textDecoration"],support:["typography","__experimentalTextDecoration"],useEngine:!0},textTransform:{value:["typography","textTransform"],support:["typography","__experimentalTextTransform"],useEngine:!0},letterSpacing:{value:["typography","letterSpacing"],support:["typography","__experimentalLetterSpacing"],useEngine:!0},writingMode:{value:["typography","writingMode"],support:["typography","__experimentalWritingMode"],useEngine:!0},"--wp--style--root--padding":{value:["spacing","padding"],support:["spacing","padding"],properties:{"--wp--style--root--padding-top":"top","--wp--style--root--padding-right":"right","--wp--style--root--padding-bottom":"bottom","--wp--style--root--padding-left":"left"},rootOnly:!0}},Gl={link:"a",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"},ql={"color.duotone":!0,"color.gradients":!0,"color.palette":!0,"typography.fontFamilies":!0,"typography.fontSizes":!0,"spacing.spacingSizes":!0};var Kl=n(41474),Yl=n(69138);const{lock:Xl,unlock:Jl}=(0,pl.es)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/blocks"),Ql={title:"block title",description:"block description",keywords:["block keyword"],styles:[{label:"block style label"}],variations:[{title:"block variation title",description:"block variation description",keywords:["block variation keyword"]}]};function ec(e){return null!==e&&"object"==typeof e}function tc({textdomain:e,...t}){const n=["apiVersion","title","category","parent","ancestor","icon","description","keywords","attributes","providesContext","usesContext","selectors","supports","styles","example","variations","blockHooks"],r=Object.fromEntries(Object.entries(t).filter((([e])=>n.includes(e))));return e&&Object.keys(Ql).forEach((t=>{r[t]&&(r[t]=rc(Ql[t],r[t],e))})),r}function nc(e,t){const n=ec(e)?e.name:e;if("string"!=typeof n)return void console.error("Block names must be strings.");if(!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(n))return void console.error("Block names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-block");if((0,Kl.Y)(Vu).getBlockType(n))return void console.error('Block "'+n+'" is already registered.');const{addBootstrappedBlockType:r,addUnprocessedBlockType:o}=Jl((0,Yl.W)(Vu));return ec(e)&&r(n,tc(e)),o(n,t),(0,Kl.Y)(Vu).getBlockType(n)}function rc(e,t,n){return"string"==typeof e&&"string"==typeof t?(0,$._x)(t,e,n):Array.isArray(e)&&e.length&&Array.isArray(t)?t.map((t=>rc(e[0],t,n))):ec(e)&&Object.entries(e).length&&ec(t)?Object.keys(t).reduce(((r,o)=>e[o]?(r[o]=rc(e[o],t[o],n),r):(r[o]=t[o],r)),{}):t}function oc(){return(0,Kl.Y)(Vu).getFreeformFallbackBlockName()}function ic(){return(0,Kl.Y)(Vu).getUnregisteredFallbackBlockName()}function ac(){return(0,Kl.Y)(Vu).getDefaultBlockName()}function sc(e){return(0,Kl.Y)(Vu)?.getBlockType(e)}function lc(){return(0,Kl.Y)(Vu).getBlockTypes()}function cc(e,t,n){return(0,Kl.Y)(Vu).getBlockSupport(e,t,n)}function uc(e,t,n){return(0,Kl.Y)(Vu).hasBlockSupport(e,t,n)}function dc(e){return"core/block"===e?.name}function pc(e){return"core/template-part"===e?.name}const hc=(e,t)=>(0,Kl.Y)(Vu).getBlockVariations(e,t);var mc=n(82234);function fc(e,t={},n=[]){const r=Bc(e,t);return{clientId:(0,W.Z)(),name:e,isValid:!0,attributes:r,innerBlocks:n}}function gc(e=[]){return e.map((e=>{const t=Array.isArray(e)?e:[e.name,e.attributes,e.innerBlocks],[n,r,o=[]]=t;return fc(n,r,gc(o))}))}function bc(e,t={},n){const r=(0,W.Z)(),o=Bc(e.name,{...e.attributes,...t});return{...e,clientId:r,attributes:o,innerBlocks:n||e.innerBlocks.map((e=>bc(e)))}}function vc(e,t={},n){const r=(0,W.Z)();return{...e,clientId:r,attributes:{...e.attributes,...t},innerBlocks:n||e.innerBlocks.map((e=>vc(e)))}}const yc=(e,t,n)=>{if(!n.length)return!1;const r=n.length>1,o=n[0].name;if(!_c(e)&&r&&!e.isMultiBlock)return!1;if(!_c(e)&&!n.every((e=>e.name===o)))return!1;if("block"!==e.type)return!1;const i=n[0];return!("from"===t&&-1===e.blocks.indexOf(i.name)&&!_c(e)||!r&&"from"===t&&kc(i.name)&&kc(e.blockName)||!Cc(e,n))},_c=e=>e&&"block"===e.type&&Array.isArray(e.blocks)&&e.blocks.includes("*"),kc=e=>e===(0,Kl.Y)(Vu).getGroupingBlockName();function wc(e,t){const n=(0,mc.createHooks)();for(let r=0;r<e.length;r++){const o=e[r];t(o)&&n.addFilter("transform","transform/"+r.toString(),(e=>e||o),o.priority)}return n.applyFilters("transform",null)}function Ec(e,t){if(void 0===t)return lc().map((({name:t})=>Ec(e,t))).flat();const n=Rc(t),{name:r,transforms:o}=n||{};if(!o||!Array.isArray(o[e]))return[];const i=o.supportedMobileTransforms&&Array.isArray(o.supportedMobileTransforms),a=i?o[e].filter((e=>"raw"===e.type||!(!e.blocks||!e.blocks.length)&&(!!_c(e)||e.blocks.every((e=>o.supportedMobileTransforms.includes(e)))))):o[e];return a.map((e=>({...e,blockName:r,usingMobileTransformations:i})))}function Cc(e,t){if("function"!=typeof e.isMatch)return!0;const n=t[0],r=e.isMultiBlock?t.map((e=>e.attributes)):n.attributes,o=e.isMultiBlock?t:n;return e.isMatch(r,o)}function xc(e,t){const n=Array.isArray(e)?e:[e],r=n.length>1,o=n[0],i=o.name,a=Ec("from",t),s=wc(Ec("to",i),(e=>"block"===e.type&&(_c(e)||-1!==e.blocks.indexOf(t))&&(!r||e.isMultiBlock)&&Cc(e,n)))||wc(a,(e=>"block"===e.type&&(_c(e)||-1!==e.blocks.indexOf(i))&&(!r||e.isMultiBlock)&&Cc(e,n)));if(!s)return null;let l;return l=s.isMultiBlock?"__experimentalConvert"in s?s.__experimentalConvert(n):s.transform(n.map((e=>e.attributes)),n.map((e=>e.innerBlocks))):"__experimentalConvert"in s?s.__experimentalConvert(o):s.transform(o.attributes,o.innerBlocks),null===l||"object"!=typeof l?null:(l=Array.isArray(l)?l:[l],l.some((e=>!sc(e.name)))?null:l.some((e=>e.name===t))?l.map(((t,n,r)=>(0,mc.applyFilters)("blocks.switchToBlockType.transformedBlock",t,e,n,r))):null)}const Sc=(e,t)=>{var n;return fc(e,t.attributes,(null!==(n=t.innerBlocks)&&void 0!==n?n:[]).map((e=>Sc(e.name,e))))};(0,Dl.l7)([Ol.Z,Zl]);const Ic=["#191e23","#f8f9f9"];function Tc(e){var t;Tc[e.name]||(Tc[e.name]=fc(e.name));const n=Tc[e.name],r=sc(e.name);return Object.keys(null!==(t=r?.attributes)&&void 0!==t?t:{}).every((t=>n.attributes[t]===e.attributes[t]))}function Nc(e){return e.name===ac()&&Tc(e)}function Pc(e){return!!e&&("string"==typeof e||(0,x.isValidElement)(e)||"function"==typeof e||e instanceof x.Component)}function Rc(e){return"string"==typeof e?sc(e):e}function Ac(e,t,n="visual"){const{__experimentalLabel:r,title:o}=e,i=r&&r(t,{context:n});return i?Hl(i):o}function Bc(e,t){const n=sc(e);if(void 0===n)throw new Error(`Block type '${e}' is not registered.`);return Object.entries(n.attributes).reduce(((e,[n,r])=>{const o=t[n];return void 0!==o?e[n]=o:r.hasOwnProperty("default")&&(e[n]=r.default),-1!==["node","children"].indexOf(r.source)&&("string"==typeof e[n]?e[n]=[e[n]]:Array.isArray(e[n])||(e[n]=[])),e}),{})}function Lc(e,t){return Object.fromEntries(Object.entries(e).filter((([e])=>!t.includes(e))))}const Mc=[{slug:"text",title:(0,$.__)("Text")},{slug:"media",title:(0,$.__)("Media")},{slug:"design",title:(0,$.__)("Design")},{slug:"widgets",title:(0,$.__)("Widgets")},{slug:"theme",title:(0,$.__)("Theme")},{slug:"embed",title:(0,$.__)("Embeds")},{slug:"reusable",title:(0,$.__)("Reusable blocks")}];function Dc(e){return e.reduce(((e,t)=>({...e,[t.name]:t})),{})}function Oc(e){return e.reduce(((e,t)=>(e.some((e=>e.name===t.name))||e.push(t),e)),[])}function Fc(e){return(t=null,n)=>{switch(n.type){case"REMOVE_BLOCK_TYPES":return-1!==n.names.indexOf(t)?null:t;case e:return n.name||null}return t}}const jc=Fc("SET_DEFAULT_BLOCK_NAME"),Zc=Fc("SET_FREEFORM_FALLBACK_BLOCK_NAME"),zc=Fc("SET_UNREGISTERED_FALLBACK_BLOCK_NAME"),Vc=Fc("SET_GROUPING_BLOCK_NAME");var Hc=(0,B.combineReducers)({bootstrappedBlockTypes:function(e={},t){switch(t.type){case"ADD_BOOTSTRAPPED_BLOCK_TYPE":const{name:n,blockType:r}=t,o=e[n];let i;return o?(void 0===o.selectors&&r.selectors&&(i={...o,selectors:r.selectors}),void 0===o.blockHooks&&r.blockHooks&&(i={...o,...i,blockHooks:r.blockHooks})):(i=Object.fromEntries(Object.entries(r).filter((([,e])=>null!=e)).map((([e,t])=>[(0,Ms.eV)(e),t]))),i.name=n),i?{...e,[n]:i}:e;case"REMOVE_BLOCK_TYPES":return Lc(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 Lc(e,t.names)}return e},blockTypes:function(e={},t){switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Dc(t.blockTypes)};case"REMOVE_BLOCK_TYPES":return Lc(e,t.names)}return e},blockStyles:function(e={},t){var n,r;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Object.fromEntries(Object.entries(Dc(t.blockTypes)).map((([t,n])=>{var r,o;return[t,Oc([...(null!==(r=n.styles)&&void 0!==r?r:[]).map((e=>({...e,source:"block"}))),...(null!==(o=e[n.name])&&void 0!==o?o:[]).filter((({source:e})=>"block"!==e))])]})))};case"ADD_BLOCK_STYLES":return{...e,[t.blockName]:Oc([...null!==(n=e[t.blockName])&&void 0!==n?n:[],...t.styles])};case"REMOVE_BLOCK_STYLES":return{...e,[t.blockName]:(null!==(r=e[t.blockName])&&void 0!==r?r:[]).filter((e=>-1===t.styleNames.indexOf(e.name)))}}return e},blockVariations:function(e={},t){var n,r;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Object.fromEntries(Object.entries(Dc(t.blockTypes)).map((([t,n])=>{var r,o;return[t,Oc([...(null!==(r=n.variations)&&void 0!==r?r:[]).map((e=>({...e,source:"block"}))),...(null!==(o=e[n.name])&&void 0!==o?o:[]).filter((({source:e})=>"block"!==e))])]})))};case"ADD_BLOCK_VARIATIONS":return{...e,[t.blockName]:Oc([...null!==(n=e[t.blockName])&&void 0!==n?n:[],...t.variations])};case"REMOVE_BLOCK_VARIATIONS":return{...e,[t.blockName]:(null!==(r=e[t.blockName])&&void 0!==r?r:[]).filter((e=>-1===t.variationNames.indexOf(e.name)))}}return e},defaultBlockName:jc,freeformFallbackBlockName:Zc,unregisteredFallbackBlockName:zc,groupingBlockName:Vc,categories:function(e=Mc,t){switch(t.type){case"SET_CATEGORIES":return t.categories||[];case"UPDATE_CATEGORY":if(!t.category||!Object.keys(t.category).length)return e;if(e.find((({slug:e})=>e===t.slug)))return e.map((e=>e.slug===t.slug?{...e,...t.category}:e))}return e},collections:function(e={},t){switch(t.type){case"ADD_BLOCK_COLLECTION":return{...e,[t.namespace]:{title:t.title,icon:t.icon}};case"REMOVE_BLOCK_COLLECTION":return Lc(e,t.namespace)}return e}}),Uc=n(22922),$c=n.n(Uc),Wc=n(71010);const Gc=(e,t,n)=>{var r;const o=Array.isArray(t)?t:t.split(".");let i=e;return o.forEach((e=>{i=i?.[e]})),null!==(r=i)&&void 0!==r?r:n},qc=(e,t)=>"string"==typeof t?Yc(e,t):t,Kc=(0,La.Z)((e=>Object.values(e.blockTypes)),(e=>[e.blockTypes]));function Yc(e,t){return e.blockTypes[t]}function Xc(e,t){return e.blockStyles[t]}const Jc=(0,La.Z)(((e,t,n)=>{const r=e.blockVariations[t];return r&&n?r.filter((e=>(e.scope||["block","inserter"]).includes(n))):r}),((e,t)=>[e.blockVariations[t]]));function Qc(e,t,n,r){const o=Jc(e,t,r),i=o?.find((r=>{if(Array.isArray(r.isActive)){const o=Yc(e,t),i=Object.keys(o?.attributes||{}),a=r.isActive.filter((e=>i.includes(e)));return 0!==a.length&&a.every((e=>n[e]===r.attributes[e]))}return r.isActive?.(n,r.attributes)}));return i}function eu(e,t,n){const r=Jc(e,t,n);return[...r].reverse().find((({isDefault:e})=>!!e))||r[0]}function tu(e){return e.categories}function nu(e){return e.collections}function ru(e){return e.defaultBlockName}function ou(e){return e.freeformFallbackBlockName}function iu(e){return e.unregisteredFallbackBlockName}function au(e){return e.groupingBlockName}const su=(0,La.Z)(((e,t)=>Kc(e).filter((e=>e.parent?.includes(t))).map((({name:e})=>e))),(e=>[e.blockTypes])),lu=(e,t,n,r)=>{const o=qc(e,t);return o?.supports?Gc(o.supports,n,r):r};function cu(e,t,n,r){return!!lu(e,t,n,r)}function uu(e,t,n){const r=qc(e,t),o=(0,Wc.Z)([e=>$c()(null!=e?e:""),e=>e.toLowerCase(),e=>e.trim()]),i=o(n),a=(0,Wc.Z)([o,e=>e.includes(i)]);return a(r.title)||r.keywords?.some(a)||a(r.category)||"string"==typeof r.description&&a(r.description)}const du=(e,t)=>su(e,t).length>0,pu=(e,t)=>su(e,t).some((t=>cu(e,t,"inserter",!0))),hu=(0,La.Z)(((e,t)=>{const n=Yc(e,t);return!!n&&Object.entries(n.attributes).some((([,{__experimentalRole:e}])=>"content"===e))}),((e,t)=>[e.blockTypes[t]?.attributes])),mu=["background","backgroundColor","color","linkColor","captionColor","buttonColor","headingColor","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","padding","contentSize","wideSize","blockGap","textDecoration","textTransform","letterSpacing"];function fu(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)||"letterSpacing"===e&&!t&&!["heading","h1","h2","h3","h4","h5","h6"].includes(n)||"textColumns"===e&&!t)))}const gu=(0,La.Z)(((e,t,n)=>{if(!t)return fu(mu,t,n);const r=Yc(e,t);if(!r)return[];const o=[];return r?.supports?.spacing?.blockGap&&o.push("blockGap"),r?.supports?.shadow&&o.push("shadow"),Object.keys(Wl).forEach((e=>{Wl[e].support&&(Wl[e].requiresOptOut&&Wl[e].support[0]in r.supports&&!1!==Gc(r.supports,Wl[e].support)||Gc(r.supports,Wl[e].support,!1))&&o.push(e)})),fu(o,t,n)}),((e,t)=>[e.blockTypes[t]]));function bu(e,t){return e.bootstrappedBlockTypes[t]}function vu(e){return e.unprocessedBlockTypes}var yu=n(85628);const{error:_u,warn:ku}=window.console,wu={common:"text",formatting:"text",layout:"design"},Eu=(e,t)=>({select:n})=>{const r={name:e,icon:Ul,keywords:[],attributes:{},providesContext:{},usesContext:[],selectors:{},supports:{},styles:[],variations:[],blockHooks:{},save:()=>null,...n.getBootstrappedBlockType(e),...t},o=(0,mc.applyFilters)("blocks.registerBlockType",r,e,null);if(o.description&&"string"!=typeof o.description&&(0,q.Z)("Declaring non-string block descriptions",{since:"6.2"}),o.deprecated&&(o.deprecated=o.deprecated.map((e=>Object.fromEntries(Object.entries((0,mc.applyFilters)("blocks.registerBlockType",{...Lc(r,$l),...e},r.name,e)).filter((([e])=>$l.includes(e))))))),(0,yu.P)(o))if("function"==typeof o.save)if("edit"in o&&"function"!=typeof o.edit)_u('The "edit" property must be a valid function.');else if(wu.hasOwnProperty(o.category)&&(o.category=wu[o.category]),"category"in o&&!n.getCategories().some((({slug:e})=>e===o.category))&&(ku('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){if(Pc(e=e||Ul))return{src:e};if("background"in e){const t=(0,Dl.Vi)(e.background),n=e=>t.contrast(e),r=Math.max(...Ic.map(n));return{...e,foreground:e.foreground?e.foreground:Ic.find((e=>n(e)===r)),shadowColor:t.alpha(.3).toRgbString()}}return e}(o.icon),Pc(o.icon.src))return o;_u("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 _u("Block titles must be strings.");else _u('The block "'+e+'" must have a title.');else _u('The "save" property must be a valid function.');else _u("Block settings must be a valid object.")};function Cu(e){return{type:"ADD_BLOCK_TYPES",blockTypes:Array.isArray(e)?e:[e]}}function xu(){return({dispatch:e,select:t})=>{const n=[];for(const[r,o]of Object.entries(t.getUnprocessedBlockTypes())){const t=e(Eu(r,o));t&&n.push(t)}n.length&&e.addBlockTypes(n)}}function Su(){return(0,q.Z)('wp.data.dispatch( "core/blocks" ).__experimentalReapplyBlockFilters',{since:"6.4",alternative:"reapplyBlockFilters"}),xu()}function Iu(e){return{type:"REMOVE_BLOCK_TYPES",names:Array.isArray(e)?e:[e]}}function Tu(e,t){return{type:"ADD_BLOCK_STYLES",styles:Array.isArray(t)?t:[t],blockName:e}}function Nu(e,t){return{type:"REMOVE_BLOCK_STYLES",styleNames:Array.isArray(t)?t:[t],blockName:e}}function Pu(e,t){return{type:"ADD_BLOCK_VARIATIONS",variations:Array.isArray(t)?t:[t],blockName:e}}function Ru(e,t){return{type:"REMOVE_BLOCK_VARIATIONS",variationNames:Array.isArray(t)?t:[t],blockName:e}}function Au(e){return{type:"SET_DEFAULT_BLOCK_NAME",name:e}}function Bu(e){return{type:"SET_FREEFORM_FALLBACK_BLOCK_NAME",name:e}}function Lu(e){return{type:"SET_UNREGISTERED_FALLBACK_BLOCK_NAME",name:e}}function Mu(e){return{type:"SET_GROUPING_BLOCK_NAME",name:e}}function Du(e){return{type:"SET_CATEGORIES",categories:e}}function Ou(e,t){return{type:"UPDATE_CATEGORY",slug:e,category:t}}function Fu(e,t,n){return{type:"ADD_BLOCK_COLLECTION",namespace:e,title:t,icon:n}}function ju(e){return{type:"REMOVE_BLOCK_COLLECTION",namespace:e}}function Zu(e,t){return{type:"ADD_BOOTSTRAPPED_BLOCK_TYPE",name:e,blockType:t}}function zu(e,t){return({dispatch:n})=>{n({type:"ADD_UNPROCESSED_BLOCK_TYPE",name:e,blockType:t});const r=n(Eu(e,t));r&&n.addBlockTypes(r)}}const Vu=(0,A.Z)("core/blocks",{reducer:Hc,selectors:s,actions:c});let Hu,Uu,$u,Wu;(0,B.register)(Vu),Jl(Vu).registerPrivateSelectors(l),Jl(Vu).registerPrivateActions(u);const Gu=/<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/g;function qu(e,t,n,r,o){return{blockName:e,attrs:t,innerBlocks:n,innerHTML:r,innerContent:o}}function Ku(e){return qu(null,{},[],e,[e])}const Yu=e=>{Hu=e,Uu=0,$u=[],Wu=[],Gu.lastIndex=0;do{}while(Xu());return $u};function Xu(){const e=Wu.length,t=function(){const e=Gu.exec(Hu);if(null===e)return["no-more-tokens","",null,0,0];const t=e.index,[n,r,o,i,a,,s]=e,l=n.length,c=!!r,u=!!s,d=(o||"core/")+i,p=!!a?function(e){try{return JSON.parse(e)}catch(e){return null}}(a):{};return u?["void-block",d,p,t,l]:c?["block-closer",d,null,t,l]:["block-opener",d,p,t,l]}(),[n,r,o,i,a]=t,s=i>Uu?Uu:null;switch(n){case"no-more-tokens":if(0===e)return Ju(),!1;if(1===e)return ed(),!1;for(;0<Wu.length;)ed();return!1;case"void-block":return 0===e?(null!==s&&$u.push(Ku(Hu.substr(s,i-s))),$u.push(qu(r,o,[],"",[])),Uu=i+a,!0):(Qu(qu(r,o,[],"",[]),i,a),Uu=i+a,!0);case"block-opener":return Wu.push(function(e,t,n,r,o){return{block:e,tokenStart:t,tokenLength:n,prevOffset:r||t+n,leadingHtmlStart:o}}(qu(r,o,[],"",[]),i,a,i+a,s)),Uu=i+a,!0;case"block-closer":if(0===e)return Ju(),!1;if(1===e)return ed(i),Uu=i+a,!0;const t=Wu.pop(),n=Hu.substr(t.prevOffset,i-t.prevOffset);return t.block.innerHTML+=n,t.block.innerContent.push(n),t.prevOffset=i+a,Qu(t.block,t.tokenStart,t.tokenLength,i+a),Uu=i+a,!0;default:return Ju(),!1}}function Ju(e){const t=e||Hu.length-Uu;0!==t&&$u.push(Ku(Hu.substr(Uu,t)))}function Qu(e,t,n,r){const o=Wu[Wu.length-1];o.block.innerBlocks.push(e);const i=Hu.substr(o.prevOffset,t-o.prevOffset);i&&(o.block.innerHTML+=i,o.block.innerContent.push(i)),o.block.innerContent.push(null),o.prevOffset=r||t+n}function ed(e){const{block:t,leadingHtmlStart:n,prevOffset:r,tokenStart:o}=Wu.pop(),i=e?Hu.substr(r,e-r):Hu.substr(r);i&&(t.innerHTML+=i,t.innerContent.push(i)),null!==n&&$u.push(Ku(Hu.substr(n,o-n))),$u.push(t)}const td=new RegExp("(<((?=!--|!\\[CDATA\\[)((?=!-)!(?:-(?!->)[^\\-]*)*(?:--\x3e)?|!\\[CDATA\\[[^\\]]*(?:](?!]>)[^\\]]*)*?(?:]]>)?)|[^>]*>?))");function nd({children:e,...t}){let n="";return x.Children.toArray(e).forEach((e=>{"string"==typeof e&&""!==e.trim()&&(n+=e)})),(0,x.createElement)("div",{dangerouslySetInnerHTML:{__html:n},...t})}var rd=n(1065),od=n(83488);const{Provider:id,Consumer:ad}=(0,x.createContext)(void 0),sd=(0,x.forwardRef)((()=>null)),ld=new Set(["string","boolean","number"]),cd=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),ud=new Set(["allowfullscreen","allowpaymentrequest","allowusermedia","async","autofocus","autoplay","checked","controls","default","defer","disabled","download","formnovalidate","hidden","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","typemustmatch"]),dd=new Set(["autocapitalize","autocomplete","charset","contenteditable","crossorigin","decoding","dir","draggable","enctype","formenctype","formmethod","http-equiv","inputmode","kind","method","preload","scope","shape","spellcheck","translate","type","wrap"]),pd=new Set(["animation","animationIterationCount","baselineShift","borderImageOutset","borderImageSlice","borderImageWidth","columnCount","cx","cy","fillOpacity","flexGrow","flexShrink","floodOpacity","fontWeight","gridColumnEnd","gridColumnStart","gridRowEnd","gridRowStart","lineHeight","opacity","order","orphans","r","rx","ry","shapeImageThreshold","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","tabSize","widows","x","y","zIndex","zoom"]);function hd(e,t){return t.some((t=>0===e.indexOf(t)))}function md(e){return"key"===e||"children"===e}function fd(e,t){return"style"===e?function(e){if(!(0,yu.P)(e))return e;let t;for(const n in e){const r=e[n];null!=r&&(t?t+=";":t="",t+=_d(n)+":"+kd(n,r))}return t}(t):t}const gd=["accentHeight","alignmentBaseline","arabicForm","baselineShift","capHeight","clipPath","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","dominantBaseline","enableBackground","fillOpacity","fillRule","floodColor","floodOpacity","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","horizAdvX","horizOriginX","imageRendering","letterSpacing","lightingColor","markerEnd","markerMid","markerStart","overlinePosition","overlineThickness","paintOrder","panose1","pointerEvents","renderingIntent","shapeRendering","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","textAnchor","textDecoration","textRendering","underlinePosition","underlineThickness","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","vHanging","vIdeographic","vMathematical","vectorEffect","vertAdvY","vertOriginX","vertOriginY","wordSpacing","writingMode","xmlnsXlink","xHeight"].reduce(((e,t)=>(e[t.toLowerCase()]=t,e)),{}),bd=["allowReorder","attributeName","attributeType","autoReverse","baseFrequency","baseProfile","calcMode","clipPathUnits","contentScriptType","contentStyleType","diffuseConstant","edgeMode","externalResourcesRequired","filterRes","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","suppressContentEditableWarning","suppressHydrationWarning","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector"].reduce(((e,t)=>(e[t.toLowerCase()]=t,e)),{}),vd=["xlink:actuate","xlink:arcrole","xlink:href","xlink:role","xlink:show","xlink:title","xlink:type","xml:base","xml:lang","xml:space","xmlns:xlink"].reduce(((e,t)=>(e[t.replace(":","").toLowerCase()]=t,e)),{});function yd(e){switch(e){case"htmlFor":return"for";case"className":return"class"}const t=e.toLowerCase();return bd[t]?bd[t]:gd[t]?(0,rd.o)(gd[t]):vd[t]?vd[t]:t}function _d(e){return e.startsWith("--")?e:hd(e,["ms","O","Moz","Webkit"])?"-"+(0,rd.o)(e):(0,rd.o)(e)}function kd(e,t){return"number"!=typeof t||0===t||pd.has(e)?t:t+"px"}function wd(e,t,n={}){if(null==e||!1===e)return"";if(Array.isArray(e))return Cd(e,t,n);switch(typeof e){case"string":return(0,od.r)(e);case"number":return e.toString()}const{type:r,props:o}=e;switch(r){case x.StrictMode:case x.Fragment:return Cd(o.children,t,n);case nd:const{children:e,...r}=o;return Ed(Object.keys(r).length?"div":null,{...r,dangerouslySetInnerHTML:{__html:e}},t,n)}switch(typeof r){case"string":return Ed(r,o,t,n);case"function":return r.prototype&&"function"==typeof r.prototype.render?function(e,t,n,r={}){const o=new e(t,r);"function"==typeof o.getChildContext&&Object.assign(r,o.getChildContext());return wd(o.render(),n,r)}(r,o,t,n):wd(r(o,n),t,n)}switch(r&&r.$$typeof){case id.$$typeof:return Cd(o.children,o.value,n);case ad.$$typeof:return wd(o.children(t||r._currentValue),t,n);case sd.$$typeof:return wd(r.render(o),t,n)}return""}function Ed(e,t,n,r={}){let o="";if("textarea"===e&&t.hasOwnProperty("value")){o=Cd(t.value,n,r);const{value:e,...i}=t;t=i}else t.dangerouslySetInnerHTML&&"string"==typeof t.dangerouslySetInnerHTML.__html?o=t.dangerouslySetInnerHTML.__html:void 0!==t.children&&(o=Cd(t.children,n,r));if(!e)return o;const i=function(e){let t="";for(const n in e){const r=yd(n);if(!(0,od.$b)(r))continue;let o=fd(n,e[n]);if(!ld.has(typeof o))continue;if(md(n))continue;const i=ud.has(r);if(i&&!1===o)continue;const a=i||hd(n,["data-","aria-"])||dd.has(r);("boolean"!=typeof o||a)&&(t+=" "+r,i||("string"==typeof o&&(o=(0,od.kb)(o)),t+='="'+o+'"'))}return t}(t);return cd.has(e)?"<"+e+i+"/>":"<"+e+i+">"+o+"</"+e+">"}function Cd(e,t,n={}){let r="";e=Array.isArray(e)?e:[e];for(let o=0;o<e.length;o++)r+=wd(e[o],t,n);return r}var xd=wd;function Sd(e,t={}){const{isCommentDelimited:n=!0}=t,{blockName:r,attrs:o={},innerBlocks:i=[],innerContent:a=[]}=e;let s=0;const l=a.map((e=>null!==e?e:Sd(i[s++],t))).join("\n").replace(/\n+/g,"\n").trim();return n?Md(r,o,l):l}function Id(e){const t="wp-block-"+e.replace(/\//,"-").replace(/^core-/,"");return(0,mc.applyFilters)("blocks.getBlockDefaultClassName",t,e)}function Td(e){const t="editor-block-list-item-"+e.replace(/\//,"-").replace(/^core-/,"");return(0,mc.applyFilters)("blocks.getBlockMenuDefaultClassName",t,e)}const Nd={},Pd={};function Rd(e={}){const{blockType:t,attributes:n}=Nd;return Rd.skipFilters?e:(0,mc.applyFilters)("blocks.getSaveContent.extraProps",{...e},t,n)}function Ad(e,t,n=[]){const r=Rc(e);if(!r?.save)return null;let{save:o}=r;if(o.prototype instanceof x.Component){const e=new o({attributes:t});o=e.render.bind(e)}Nd.blockType=r,Nd.attributes=t,Pd.innerBlocks=n;let i=o({attributes:t,innerBlocks:n});if(null!==i&&"object"==typeof i&&(0,mc.hasFilter)("blocks.getSaveContent.extraProps")&&!(r.apiVersion>1)){const e=(0,mc.applyFilters)("blocks.getSaveContent.extraProps",{...i.props},r,t);(0,O.default)(e,i.props)||(i=(0,x.cloneElement)(i,e))}return(0,mc.applyFilters)("blocks.getSaveElement",i,r,t)}function Bd(e,t,n){const r=Rc(e);return xd(Ad(r,t,n))}function Ld(e){let t=e.originalContent;if(e.isValid||e.innerBlocks.length)try{t=Bd(e.name,e.attributes,e.innerBlocks)}catch(e){}return t}function Md(e,t,n){const r=t&&Object.entries(t).length?function(e){return JSON.stringify(e).replace(/--/g,"\\u002d\\u002d").replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\\"/g,"\\u0022")}(t)+" ":"",o=e?.startsWith("core/")?e.slice(5):e;return n?`\x3c!-- wp:${o} ${r}--\x3e\n`+n+`\n\x3c!-- /wp:${o} --\x3e`:`\x3c!-- wp:${o} ${r}/--\x3e`}function Dd(e,t){return(Array.isArray(e)?e:[e]).map((e=>function(e,{isInnerBlocks:t=!1}={}){if(!e.isValid&&e.__unstableBlockSource)return Sd(e.__unstableBlockSource);const n=e.name,r=Ld(e);if(n===ic()||!t&&n===oc())return r;const o=sc(n);if(!o)return r;const i=function(e,t){var n;return Object.entries(null!==(n=e.attributes)&&void 0!==n?n:{}).reduce(((e,[n,r])=>{const o=t[n];return void 0===o||void 0!==r.source||"default"in r&&JSON.stringify(r.default)===JSON.stringify(o)||(e[n]=o),e}),{})}(o,e.attributes);return Md(n,i,r)}(e,t))).join("\n\n")}var Od=/[\t\n\f ]/,Fd=/[A-Za-z]/,jd=/\r\n?/g;function Zd(e){return Od.test(e)}function zd(e){return Fd.test(e)}var Vd=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||zd(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(){Zd(this.consume())&&this.transitionTo("beforeDoctypeName")},beforeDoctypeName:function(){var e=this.consume();Zd(e)||(this.transitionTo("doctypeName"),this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(e.toLowerCase()))},doctypeName:function(){var e=this.consume();Zd(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(!Zd(e))if(">"===e)this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData");else{var t=e.toUpperCase()+this.input.substring(this.index,this.index+5).toUpperCase(),n="PUBLIC"===t.toUpperCase(),r="SYSTEM"===t.toUpperCase();(n||r)&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume()),n?this.transitionTo("afterDoctypePublicKeyword"):r&&this.transitionTo("afterDoctypeSystemKeyword")}},afterDoctypePublicKeyword:function(){var e=this.peek();Zd(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();Zd(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();Zd(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();Zd(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();Zd(e)?this.transitionTo("beforeAttributeName"):"/"===e?this.transitionTo("selfClosingStartTag"):">"===e?(this.delegate.finishTag(),this.transitionTo("beforeData")):this.appendToTagName(e)},endTagName:function(){var e=this.consume();Zd(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();Zd(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();Zd(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();Zd(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();Zd(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();Zd(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();Zd(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||zd(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(jd,"\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 r=t.length;r;)this.consume(),r--;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}(),Hd=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 Vd(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}(),Ud=n(17350);function $d(){function e(e){return(t,...n)=>e("Block validation: "+t,...n)}return{error:e(console.error),warning:e(console.warn),getItems(){return[]}}}const Wd=/[\t\n\r\v\f ]+/g,Gd=/^[\t\n\r\v\f ]*$/,qd=/^url\s*\(['"\s]*(.*?)['"\s]*\)$/,Kd=["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"],Yd=[...Kd,"autocapitalize","autocomplete","charset","contenteditable","crossorigin","decoding","dir","draggable","enctype","formenctype","formmethod","http-equiv","inputmode","kind","method","preload","scope","shape","spellcheck","translate","type","wrap"],Xd=[e=>e,function(e){return np(e).join(" ")}],Jd=/^[\da-z]+$/i,Qd=/^#\d+$/,ep=/^#x[\da-f]+$/i;class tp{parse(e){if(t=e,Jd.test(t)||Qd.test(t)||ep.test(t))return(0,Ud.S)("&"+e+";");var t}}function np(e){return e.trim().split(Wd)}function rp(e){return e.attributes.filter((e=>{const[t,n]=e;return n||0===t.indexOf("data-")||Yd.includes(t)}))}function op(e,t,n=$d()){let r=e.chars,o=t.chars;for(let e=0;e<Xd.length;e++){const t=Xd[e];if(r=t(r),o=t(o),r===o)return!0}return n.warning("Expected text `%s`, saw `%s`.",t.chars,e.chars),!1}function ip(e){return 0===parseFloat(e)?"0":0===e.indexOf(".")?"0"+e:e}function ap(e){return np(e).map(ip).join(" ").replace(qd,"url($1)")}function sp(e){const t=e.replace(/;?\s*$/,"").split(";").map((e=>{const[t,...n]=e.split(":"),r=n.join(":");return[t.trim(),ap(r.trim())]}));return Object.fromEntries(t)}const lp={class:(e,t)=>{const[n,r]=[e,t].map(np),o=n.filter((e=>!r.includes(e))),i=r.filter((e=>!n.includes(e)));return 0===o.length&&0===i.length},style:(e,t)=>M()(...[e,t].map(sp)),...Object.fromEntries(Kd.map((e=>[e,()=>!0])))},cp={StartTag:(e,t,n=$d())=>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=$d()){if(e.length!==t.length)return n.warning("Expected attributes %o, instead saw %o.",t,e),!1;const r={};for(let e=0;e<t.length;e++)r[t[e][0].toLowerCase()]=t[e][1];for(let t=0;t<e.length;t++){const[o,i]=e[t],a=o.toLowerCase();if(!r.hasOwnProperty(a))return n.warning("Encountered unexpected attribute `%s`.",o),!1;const s=r[a],l=lp[a];if(l){if(!l(i,s))return n.warning("Expected attribute `%s` of value `%s`, saw `%s`.",o,s,i),!1}else if(i!==s)return n.warning("Expected attribute `%s` of value `%s`, saw `%s`.",o,s,i),!1}return!0}(...[e,t].map(rp),n),Chars:op,Comment:op};function up(e){let t;for(;t=e.shift();){if("Chars"!==t.type)return t;if(!Gd.test(t.chars))return t}}function dp(e,t){return!!e.selfClosing&&!(!t||t.tagName!==e.tagName||"EndTag"!==t.type)}function pp(e,t=e.name){if(e.name===oc()||e.name===ic())return[!0,[]];const n=function(){const e=[],t=$d();return{error(...n){e.push({log:t.error,args:n})},warning(...n){e.push({log:t.warning,args:n})},getItems(){return e}}}(),r=Rc(t);let o;try{o=Bd(r,e.attributes)}catch(e){return n.error("Block validation failed because an error occurred while generating block content:\n\n%s",e.toString()),[!1,n.getItems()]}const i=function(e,t,n=$d()){if(e===t)return!0;const[r,o]=[e,t].map((e=>function(e,t=$d()){try{return new Hd(new tp).tokenize(e)}catch(n){t.warning("Malformed HTML detected: %s",e)}return null}(e,n)));if(!r||!o)return!1;let i,a;for(;i=up(r);){if(a=up(o),!a)return n.warning("Expected end of content, instead saw %o.",i),!1;if(i.type!==a.type)return n.warning("Expected token of type `%s` (%o), instead saw `%s` (%o).",a.type,a,i.type,i),!1;const e=cp[i.type];if(e&&!e(i,a,n))return!1;dp(i,o[0])?up(o):dp(a,r[0])&&up(r)}return!(a=up(o))||(n.warning("Expected %o, instead saw end of content.",a),!1)}(e.originalContent,o,n);return i||n.error("Block validation failed for `%s` (%o).\n\nContent generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s",r.name,r,o,e.originalContent),[i,n.getItems()]}function hp(e,t){const n={...t};if("core/cover-image"===e&&(e="core/cover"),"core/text"!==e&&"core/cover-text"!==e||(e="core/paragraph"),e&&0===e.indexOf("core/social-link-")&&(n.service=e.substring(17),e="core/social-link"),e&&0===e.indexOf("core-embed/")){const t=e.substring(11),r={speaker:"speaker-deck",polldaddy:"crowdsignal"};n.providerNameSlug=t in r?r[t]:t,["amazon-kindle","wordpress"].includes(t)||(n.responsive=!0),e="core/embed"}if("core/post-comment-author"===e&&(e="core/comment-author-name"),"core/post-comment-content"===e&&(e="core/comment-content"),"core/post-comment-date"===e&&(e="core/comment-date"),"core/comments-query-loop"===e){e="core/comments";const{className:t=""}=n;t.includes("wp-block-comments-query-loop")||(n.className=["wp-block-comments-query-loop",t].join(" "))}return"core/post-comments"===e&&(e="core/comments",n.legacy=!0),[e,n]}var mp=function(){var e;return function(){return e||(e=document.implementation.createHTMLDocument("")),e}}();function fp(e,t){if(t){if("string"==typeof e){var n=mp();n.body.innerHTML=e,e=n.body}if("function"==typeof t)return t(e);if(Object===t.constructor)return Object.keys(t).reduce((function(n,r){return n[r]=fp(e,t[r]),n}),{})}}function gp(e,t){return 1===arguments.length&&(t=e,e=void 0),function(n){var r=n;if(e&&(r=n.querySelector(e)),r)return function(e,t){for(var n,r=t.split(".");n=r.shift();){if(!(n in e))return;e=e[n]}return e}(r,t)}}var bp=n(74806);function vp(e){const t={};for(let n=0;n<e.length;n++){const{name:r,value:o}=e[n];t[r]=o}return t}function yp(e){if((0,q.Z)("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:{...vp(e.attributes),children:_p(e.childNodes)}}}function _p(e){(0,q.Z)("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(yp(e[n]))}catch(e){}return t}function kp(e){return(0,q.Z)("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?_p(n.childNodes):[]}}var wp={concat:function(...e){(0,q.Z)("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 r=Array.isArray(e[n])?e[n]:[e[n]];for(let e=0;e<r.length;e++){const n=r[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,q.Z)("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:_p,toHTML:function(e){return(0,q.Z)("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/"}),xd(e)},matcher:kp};function Ep(e,t,n,r,o){let i;switch(t.source){case void 0:i=r?r[e]:void 0;break;case"raw":i=o;break;case"attribute":case"property":case"html":case"text":case"children":case"node":case"query":case"tag":i=Sp(n,t)}return function(e,t){return void 0===t||function(e,t){return t.some((t=>function(e,t){switch(t){case"string":return"string"==typeof e;case"boolean":return"boolean"==typeof e;case"object":return!!e&&e.constructor===Object;case"null":return null===e;case"array":return Array.isArray(e);case"integer":case"number":return"number"==typeof e}return!0}(e,t)))}(e,Array.isArray(t)?t:[t])}(i,t.type)&&function(e,t){return!Array.isArray(t)||t.includes(e)}(i,t.enum)||(i=void 0),void 0===i&&(i=t.default),i}const Cp=(0,bp.Z)((e=>{switch(e.source){case"attribute":let t=function(e,t){return 1===arguments.length&&(t=e,e=void 0),function(n){var r=gp(e,"attributes")(n);if(r&&r.hasOwnProperty(t))return r[t].value}}(e.selector,e.attribute);return"boolean"===e.type&&(t=(e=>(0,Wc.Z)([e,e=>void 0!==e]))(t)),t;case"html":return function(e,t){return n=>{let r=n;if(e&&(r=n.querySelector(e)),!r)return"";if(t){let e="";const n=r.children.length;for(let o=0;o<n;o++){const n=r.children[o];n.nodeName.toLowerCase()===t&&(e+=n.outerHTML)}return e}return r.innerHTML}}(e.selector,e.multiline);case"text":return function(e){return gp(e,"textContent")}(e.selector);case"children":return kp(e.selector);case"node":return function(e){return(0,q.Z)("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 yp(n)}catch(e){return null}}}(e.selector);case"query":const n=Object.fromEntries(Object.entries(e.query).map((([e,t])=>[e,Cp(t)])));return function(e,t){return function(n){var r=n.querySelectorAll(e);return[].map.call(r,(function(e){return fp(e,t)}))}}(e.selector,n);case"tag":return(0,Wc.Z)([gp(e.selector,"nodeName"),e=>e?e.toLowerCase():void 0]);default:console.error(`Unknown source type "${e.source}"`)}}));function xp(e){return fp(e,(e=>e))}function Sp(e,t){return Cp(t)(xp(e))}function Ip(e,t,n={}){var r;const o=xp(t),i=Rc(e),a=Object.fromEntries(Object.entries(null!==(r=i.attributes)&&void 0!==r?r:{}).map((([e,r])=>[e,Ep(e,r,o,n,t)])));return(0,mc.applyFilters)("blocks.getBlockAttributes",a,i,t,n)}const Tp={type:"string",source:"attribute",selector:"[data-custom-class-name] > *",attribute:"class"};function Np(e){const t=Sp(`<div data-custom-class-name>${e}</div>`,Tp);return t?t.trim().split(/\s+/):[]}function Pp(e,t){const n=function(e,t,n){if(uc(t,"customClassName",!0)){const{className:r,...o}=e,i=Bd(t,o),a=Np(i),s=Np(n).filter((e=>!a.includes(e)));s.length?e.className=s.join(" "):i&&delete e.className}return e}(e.attributes,t,e.originalContent);return{...e,attributes:n}}function Rp(){return!1}function Ap(e,t){const n=oc(),r=e.blockName||oc(),o=e.attrs||{},i=e.innerBlocks||[];let a=e.innerHTML.trim();return r!==n||"core/freeform"!==r||t?.__unstableSkipAutop||(a=function(e,t=!0){const n=[];if(""===e.trim())return"";if(-1!==(e+="\n").indexOf("<pre")){const t=e.split("</pre>"),r=t.pop();e="";for(let r=0;r<t.length;r++){const o=t[r],i=o.indexOf("<pre");if(-1===i){e+=o;continue}const a="<pre wp-pre-tag-"+r+"></pre>";n.push([a,o.substr(i)+"</pre>"]),e+=o.substr(0,i)+a}e+=r}const r="(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)";-1!==(e=function(e,t){const n=function(e){const t=[];let n,r=e;for(;n=r.match(td);){const e=n.index;t.push(r.slice(0,e)),t.push(n[0]),r=r.slice(e+n[0].length)}return r.length&&t.push(r),t}(e);let r=!1;const o=Object.keys(t);for(let e=1;e<n.length;e+=2)for(let i=0;i<o.length;i++){const a=o[i];if(-1!==n[e].indexOf(a)){n[e]=n[e].replace(new RegExp(a,"g"),t[a]),r=!0;break}}return r&&(e=n.join("")),e}(e=(e=(e=(e=e.replace(/<br\s*\/?>\s*<br\s*\/?>/g,"\n\n")).replace(new RegExp("(<"+r+"[\\s/>])","g"),"\n\n$1")).replace(new RegExp("(</"+r+">)","g"),"$1\n\n")).replace(/\r\n|\r/g,"\n"),{"\n":" \x3c!-- wpnl --\x3e "})).indexOf("<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 o=(e=e.replace(/\n\n+/g,"\n\n")).split(/\n\s*\n/).filter(Boolean);return e="",o.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*(</?"+r+"[^>]*>)\\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*(</?"+r+"[^>]*>)","g"),"$1")).replace(new RegExp("(</?"+r+"[^>]*>)\\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("(</?"+r+"[^>]*>)\\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,r]=t;e=e.replace(n,r)})),-1!==e.indexOf("\x3c!-- wpnl --\x3e")&&(e=e.replace(/\s?<!-- wpnl -->\s?/g,"\n")),e}(a).trim()),{...e,blockName:r,attrs:o,innerHTML:a,innerBlocks:i}}function Bp(e,t){let n=Ap(e,t);n=function(e){const[t,n]=hp(e.blockName,e.attrs);return{...e,blockName:t,attrs:n}}(n);let r=sc(n.blockName);r||(n=function(e){const t=ic()||oc(),n=Sd(e,{isCommentDelimited:!1}),r=Sd(e,{isCommentDelimited:!0});return{blockName:t,attrs:{originalName:e.blockName,originalContent:r,originalUndelimitedContent:n},innerHTML:e.blockName?r:e.innerHTML,innerBlocks:e.innerBlocks,innerContent:e.innerContent}}(n),r=sc(n.blockName));const o=n.blockName===oc()||n.blockName===ic();if(!r||!n.innerHTML&&o)return;const i=n.innerBlocks.map((e=>Bp(e,t))).filter((e=>!!e)),a=fc(n.blockName,Ip(r,n.innerHTML,n.attrs),i);a.originalContent=n.innerHTML;const s=function(e,t){const[n]=pp(e,t);if(n)return{...e,isValid:n,validationIssues:[]};const r=Pp(e,t),[o,i]=pp(e,t);return{...r,isValid:o,validationIssues:i}}(a,r),{validationIssues:l}=s,c=function(e,t,n){const r=t.attrs,{deprecated:o}=n;if(!o||!o.length)return e;for(let i=0;i<o.length;i++){const{isEligible:a=Rp}=o[i];if(e.isValid&&!a(r,e.innerBlocks,{blockNode:t,block:e}))continue;const s=Object.assign(Lc(n,$l),o[i]);let l={...e,attributes:Ip(s,e.originalContent,r)},[c]=pp(l,s);if(c||(l=Pp(l,s),[c]=pp(l,s)),!c)continue;let u=l.innerBlocks,d=l.attributes;const{migrate:p}=s;if(p){let t=p(d,e.innerBlocks);Array.isArray(t)||(t=[t]),[d=r,u=e.innerBlocks]=t}e={...e,attributes:d,innerBlocks:u,isValid:!0,validationIssues:[]}}return e}(s,n,r);return c.isValid||(c.__unstableBlockSource=e),s.isValid||!c.isValid||t?.__unstableSkipMigrationLogs?s.isValid||c.isValid||l.forEach((({log:e,args:t})=>e(...t))):(console.groupCollapsed("Updated Block: %s",r.name),console.info("Block successfully updated for `%s` (%o).\n\nNew content generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s",r.name,r,Bd(r,c.attributes),c.originalContent),console.groupEnd()),c}function Lp(e,t){return Yu(e).reduce(((e,n)=>{const r=Bp(n,t);return r&&e.push(r),e}),[])}function Mp(){return Ec("from").filter((({type:e})=>"raw"===e)).map((e=>e.isMatch?e:{...e,isMatch:t=>e.selector&&t.matches(e.selector)}))}function Dp(e,t){const n=document.implementation.createHTMLDocument("");return n.body.innerHTML=e,Array.from(n.body.children).flatMap((e=>{const n=wc(Mp(),(({isMatch:t})=>t(e)));if(!n)return fc("core/html",Ip("core/html",e.outerHTML));const{transform:r,blockName:o}=n;return r?r(e,t):fc(o,Ip(o,e.outerHTML))}))}function Op(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(Op));default:return!0}}const Fp={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":{}},jp=["#text","br"];Object.keys(Fp).filter((e=>!jp.includes(e))).forEach((e=>{const{[e]:t,...n}=Fp;Fp[e].children=n}));const Zp={...Fp,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","autoplay","mediagroup","loop","muted","controls","width","height"]}};function zp(e){if("paste"!==e)return Zp;const{u:t,abbr:n,data:r,time:o,wbr:i,bdi:a,bdo:s,...l}={...Zp,ins:{children:Zp.ins.children},del:{children:Zp.del.children}};return l}function Vp(e){const t=e.nodeName.toLowerCase();return zp().hasOwnProperty(t)||"span"===t}function Hp(e){const t=e.nodeName.toLowerCase();return Fp.hasOwnProperty(t)||"span"===t}function Up(e){const t=document.implementation.createHTMLDocument(""),n=document.implementation.createHTMLDocument(""),r=t.body,o=n.body;for(r.innerHTML=e;r.firstChild;){const e=r.firstChild;e.nodeType===e.TEXT_NODE?Op(e)?r.removeChild(e):(o.lastChild&&"P"===o.lastChild.nodeName||o.appendChild(n.createElement("P")),o.lastChild.appendChild(e)):e.nodeType===e.ELEMENT_NODE?"BR"===e.nodeName?(e.nextSibling&&"BR"===e.nextSibling.nodeName&&(o.appendChild(n.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?Op(e)?r.removeChild(e):o.appendChild(e):Vp(e)?(o.lastChild&&"P"===o.lastChild.nodeName||o.appendChild(n.createElement("P")),o.lastChild.appendChild(e)):o.appendChild(e):r.removeChild(e)}return o.innerHTML}function $p(e,t){t.parentNode,t.parentNode.insertBefore(e,t.nextSibling)}function Wp(e,t){e.parentNode,$p(t,e.parentNode),zl(e)}function Gp(e,t){e.nodeType===e.COMMENT_NODE&&("nextpage"!==e.nodeValue?0===e.nodeValue.indexOf("more")&&function(e,t){const n=e.nodeValue.slice(4).trim();let r=e,o=!1;for(;r=r.nextSibling;)if(r.nodeType===r.COMMENT_NODE&&"noteaser"===r.nodeValue){o=!0,zl(r);break}const i=function(e,t,n){const r=n.createElement("wp-block");return r.dataset.block="core/more",e&&(r.dataset.customText=e),t&&(r.dataset.noTeaser=""),r}(n,o,t);if(e.parentNode&&"P"===e.parentNode.nodeName&&1!==e.parentNode.childNodes.length){const n=Array.from(e.parentNode.childNodes),r=n.indexOf(e),o=e.parentNode.parentNode||t.body,a=(e,n)=>(e||(e=t.createElement("p")),e.appendChild(n),e);[n.slice(0,r).reduce(a,null),i,n.slice(r+1).reduce(a,null)].forEach((t=>t&&o.insertBefore(t,e.parentNode))),zl(e.parentNode)}else Wp(e,i)}(e,t):Wp(e,function(e){const t=e.createElement("wp-block");return t.dataset.block="core/nextpage",t}(t)))}function qp(e){const t=e.parentNode;for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}function Kp(e){return"OL"===e.nodeName||"UL"===e.nodeName}function Yp(e){if(!Kp(e))return;const t=e,n=e.previousElementSibling;if(n&&n.nodeName===e.nodeName&&1===t.children.length){for(;t.firstChild;)n.appendChild(t.firstChild);t.parentNode.removeChild(t)}const r=e.parentNode;if(r&&"LI"===r.nodeName&&1===r.children.length&&!/\S/.test((o=r,Array.from(o.childNodes).map((({nodeValue:e=""})=>e)).join("")))){const e=r,n=e.previousElementSibling,o=e.parentNode;n?(n.appendChild(t),o.removeChild(e)):(o.parentNode.insertBefore(t,o),o.parentNode.removeChild(o))}var o;if(r&&Kp(r)){const t=e.previousElementSibling;t?t.appendChild(e):qp(e)}}function Xp(e){"BLOCKQUOTE"===e.nodeName&&(e.innerHTML=Up(e.innerHTML))}function Jp(e,t=e){const n=e.ownerDocument.createElement("figure");t.parentNode.insertBefore(n,t),n.appendChild(e)}function Qp(e,t,n){if(!function(e,t){var n;const r=e.nodeName.toLowerCase();return"figcaption"!==r&&!Hp(e)&&r in(null!==(n=t?.figure?.children)&&void 0!==n?n:{})}(e,n))return;let r=e;const o=e.parentNode;(function(e,t){var n;return e.nodeName.toLowerCase()in(null!==(n=t?.figure?.children?.a?.children)&&void 0!==n?n:{})})(e,n)&&"A"===o.nodeName&&1===o.childNodes.length&&(r=e.parentNode);const i=r.closest("p,div");i?e.classList?(e.classList.contains("alignright")||e.classList.contains("alignleft")||e.classList.contains("aligncenter")||!i.textContent.trim())&&Jp(r,i):Jp(r,i):"BODY"===r.parentNode.nodeName&&Jp(r)}function eh(e,t,n=0){const r=th(e);r.lastIndex=n;const o=r.exec(t);if(!o)return;if("["===o[1]&&"]"===o[7])return eh(e,t,r.lastIndex);const i={index:o.index,content:o[0],shortcode:rh(o)};return o[1]&&(i.content=i.content.slice(1),i.index++),o[7]&&(i.content=i.content.slice(0,-1)),i}function th(e){return new RegExp("\\[(\\[?)("+e+")(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*(?:\\[(?!\\/\\2\\])[^\\[]*)*)(\\[\\/\\2\\]))?)(\\]?)","g")}const nh=(0,bp.Z)((e=>{const t={},n=[],r=/([\w-]+)\s*=\s*"([^"]*)"(?:\s|$)|([\w-]+)\s*=\s*'([^']*)'(?:\s|$)|([\w-]+)\s*=\s*([^\s'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|'([^']*)'(?:\s|$)|(\S+)(?:\s|$)/g;let o;for(e=e.replace(/[\u00a0\u200b]/g," ");o=r.exec(e);)o[1]?t[o[1].toLowerCase()]=o[2]:o[3]?t[o[3].toLowerCase()]=o[4]:o[5]?t[o[5].toLowerCase()]=o[6]:o[7]?n.push(o[7]):o[8]?n.push(o[8]):o[9]&&n.push(o[9]);return{named:t,numeric:n}}));function rh(e){let t;return t=e[4]?"self-closing":e[6]?"closed":"single",new oh({tag:e[2],attrs:e[3],type:t,content:e[5]})}const oh=Object.assign((function(e){const{tag:t,attrs:n,type:r,content:o}=e||{};if(Object.assign(this,{tag:t,type:r,content:o}),this.attrs={named:{},numeric:[]},!n)return;const i=["named","numeric"];"string"==typeof n?this.attrs=nh(n):n.length===i.length&&i.every(((e,t)=>e===n[t]))?this.attrs=n:Object.entries(n).forEach((([e,t])=>{this.set(e,t)}))}),{next:eh,replace:function(e,t,n){return t.replace(th(e),(function(e,t,r,o,i,a,s,l){if("["===t&&"]"===l)return e;const c=n(rh(arguments));return c||""===c?t+c+l:e}))},string:function(e){return new oh(e).string()},regexp:th,attrs:nh,fromMatch:rh});Object.assign(oh.prototype,{get(e){return this.attrs["number"==typeof e?"numeric":"named"][e]},set(e,t){return this.attrs["number"==typeof e?"numeric":"named"][e]=t,this},string(){let e="["+this.tag;return this.attrs.numeric.forEach((t=>{/\s/.test(t)?e+=' "'+t+'"':e+=" "+t})),Object.entries(this.attrs.named).forEach((([t,n])=>{e+=" "+t+'="'+n+'"'})),"single"===this.type?e+"]":"self-closing"===this.type?e+" /]":(e+="]",this.content&&(e+=this.content),e+"[/"+this.tag+"]")}});const ih=e=>Array.isArray(e)?e:[e];var ah=function e(t,n=0,r=[]){const o=wc(Ec("from"),(e=>-1===r.indexOf(e.blockName)&&"shortcode"===e.type&&ih(e.tag).some((e=>th(e).test(t)))));if(!o)return[t];const i=ih(o.tag).find((e=>th(e).test(t)));let a;const s=n;if(a=eh(i,t,n)){n=a.index+a.content.length;const i=t.substr(0,a.index),l=t.substr(n);if(!(a.shortcode.content?.includes("<")||/(\n|<p>)\s*$/.test(i)&&/^\s*(\n|<\/p>)/.test(l)))return e(t,n);if(o.isMatch&&!o.isMatch(a.shortcode.attrs))return e(t,s,[...r,o.blockName]);let c=[];if("function"==typeof o.transform)c=[].concat(o.transform(a.shortcode.attrs,a)),c=c.map((e=>(e.originalContent=a.shortcode.content,Pp(e,sc(e.name)))));else{const e=Object.fromEntries(Object.entries(o.attributes).filter((([,e])=>e.shortcode)).map((([e,t])=>[e,t.shortcode(a.shortcode.attrs,a)]))),n=sc(o.blockName);if(!n)return[t];const r={...n,attributes:o.attributes};let i=fc(o.blockName,Ip(r,a.shortcode.content,e));i.originalContent=a.shortcode.content,i=Pp(i,r),c=[i]}return[...e(i),...c,...e(l)]}return[t]},sh=n(8026),lh=n.n(sh);const ch=e=>(t,n)=>{switch(e){case"children":return"*"===n||"*"===t?"*":{...n,...t};case"attributes":case"require":return[...n||[],...t||[]];case"isMatch":if(!n||!t)return;return(...e)=>n(...e)||t(...e)}return lh()(n,t,{customMerge:ch,clone:!1})};function uh(e){return function(e,t){const n={phrasingContentSchema:zp(t),isPaste:"paste"===t},r=e.map((({isMatch:e,blockName:t,schema:r})=>{const o=uc(t,"anchor");return r="function"==typeof r?r(n):r,o||e?r?Object.fromEntries(Object.entries(r).map((([t,n])=>{let r=n.attributes||[];return o&&(r=[...r,"id"]),[t,{...n,attributes:r,isMatch:e||void 0}]}))):{}:r}));return lh().all(r,{customMerge:ch,clone:!1})}(Mp(),e)}function dh(e,t,n,r){Array.from(e).forEach((e=>{dh(e.childNodes,t,n,r),t.forEach((t=>{n.contains(e)&&t(e,n,r)}))}))}function ph(e,t=[],n){const r=document.implementation.createHTMLDocument("");return r.body.innerHTML=e,dh(r.body.childNodes,t,r,n),r.body.innerHTML}function hh(e,t){const n=e[`${t}Sibling`];if(n&&Vp(n))return n;const{parentNode:r}=e;return r&&Vp(r)?hh(r,t):void 0}function mh({HTML:e=""}){if(-1!==e.indexOf("\x3c!-- wp:"))return Lp(e);const t=ah(e),n=uh();return t.map((e=>"string"!=typeof e?e:Dp(e=Up(e=ph(e,[Yp,Gp,Qp,Xp],n)),mh))).flat().filter(Boolean)}const fh=()=>{};function gh(e,t,n,r){Array.from(e).forEach((e=>{const o=e.nodeName.toLowerCase();if(!n.hasOwnProperty(o)||n[o].isMatch&&!n[o].isMatch?.(e))gh(e.childNodes,t,n,r),r&&!Vp(e)&&e.nextElementSibling&&$p(t.createElement("br"),e),qp(e);else if(function(e){return!!e&&e.nodeType===e.ELEMENT_NODE}(e)){const{attributes:i=[],classes:a=[],children:s,require:l=[],allowEmpty:c}=n[o];if(s&&!c&&Op(e))return void zl(e);if(e.hasAttributes()&&(Array.from(e.attributes).forEach((({name:t})=>{"class"===t||i.includes(t)||e.removeAttribute(t)})),e.classList&&e.classList.length)){const t=a.map((e=>"string"==typeof e?t=>t===e:e instanceof RegExp?t=>e.test(t):fh));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("*"===s)return;if(s)l.length&&!e.querySelector(l.join(","))?(gh(e.childNodes,t,n,r),qp(e)):e.parentNode&&"BODY"===e.parentNode.nodeName&&Vp(e)?(gh(e.childNodes,t,n,r),Array.from(e.childNodes).some((e=>!Vp(e)))&&qp(e)):gh(e.childNodes,t,s,r);else for(;e.firstChild;)zl(e.firstChild)}}}))}function bh(e,t,n){const r=document.implementation.createHTMLDocument("");return r.body.innerHTML=e,gh(r.body.childNodes,r,t,n),r.body.innerHTML}function vh(e){e.nodeType===e.COMMENT_NODE&&zl(e)}function yh(e,t){return e.every((e=>function(e,t){if(Hp(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)&&yh(Array.from(e.children),t)))}function _h(e){return"BR"===e.nodeName&&e.previousSibling&&"BR"===e.previousSibling.nodeName}function kh(e,t){t.parentNode,t.parentNode.insertBefore(e,t),e.appendChild(t)}function wh(e,t){const n=e.ownerDocument.createElement(t);for(;e.firstChild;)n.appendChild(e.firstChild);return e.parentNode,e.parentNode.replaceChild(n,e),n}function Eh(e,t){if("SPAN"===e.nodeName&&e.style){const{fontWeight:n,fontStyle:r,textDecorationLine:o,textDecoration:i,verticalAlign:a}=e.style;"bold"!==n&&"700"!==n||kh(t.createElement("strong"),e),"italic"===r&&kh(t.createElement("em"),e),("line-through"===o||i.includes("line-through"))&&kh(t.createElement("s"),e),"super"===a?kh(t.createElement("sup"),e):"sub"===a&&kh(t.createElement("sub"),e)}else"B"===e.nodeName?e=wh(e,"strong"):"I"===e.nodeName?e=wh(e,"em"):"A"===e.nodeName&&(e.target&&"_blank"===e.target.toLowerCase()?e.rel="noreferrer noopener":(e.removeAttribute("target"),e.removeAttribute("rel")),e.name&&!e.id&&(e.id=e.name),e.id&&!e.ownerDocument.querySelector(`[href="#${e.id}"]`)&&e.removeAttribute("id"))}function Ch(e){"SCRIPT"!==e.nodeName&&"NOSCRIPT"!==e.nodeName&&"TEMPLATE"!==e.nodeName&&"STYLE"!==e.nodeName||e.parentNode.removeChild(e)}function xh(e){if(e.nodeType!==e.ELEMENT_NODE)return;const t=e.getAttribute("style");t&&t.includes("mso-list")&&"ignore"===t.split(";").reduce(((e,t)=>{const[n,r]=t.split(":");return e[n.trim().toLowerCase()]=r.trim().toLowerCase(),e}),{})["mso-list"]&&e.remove()}const{parseInt:Sh}=window;function Ih(e){return"OL"===e.nodeName||"UL"===e.nodeName}function Th(e,t){if("P"!==e.nodeName)return;const n=e.getAttribute("style");if(!n||!n.includes("mso-list"))return;const r=e.previousElementSibling;if(!r||!Ih(r)){const n=e.textContent.trim().slice(0,1),r=/[1iIaA]/.test(n),o=t.createElement(r?"ol":"ul");r&&o.setAttribute("type",n),e.parentNode.insertBefore(o,e)}const o=e.previousElementSibling,i=o.nodeName,a=t.createElement("li");let s=o;a.innerHTML=ph(e.innerHTML,[xh]);const l=/mso-list\s*:[^;]+level([0-9]+)/i.exec(n);let c=l&&Sh(l[1],10)-1||0;for(;c--;)s=s.lastChild||s,Ih(s)&&(s=s.lastChild||s);Ih(s)||(s=s.appendChild(t.createElement(i))),s.appendChild(a),e.parentNode.removeChild(e)}const{atob:Nh,File:Ph}=window;function Rh(e){if("IMG"===e.nodeName){if(0===e.src.indexOf("file:")&&(e.src=""),0===e.src.indexOf("data:")){const[t,n]=e.src.split(","),[r]=t.slice(5).split(";");if(!n||!r)return void(e.src="");let o;try{o=Nh(n)}catch(t){return void(e.src="")}const i=new Uint8Array(o.length);for(let e=0;e<i.length;e++)i[e]=o.charCodeAt(e);const a=r.replace("/","."),s=new Ph([i],a,{type:r});e.src=Pl(s)}1!==e.height&&1!==e.width||e.parentNode.removeChild(e)}}function Ah(e){"DIV"===e.nodeName&&(e.innerHTML=Up(e.innerHTML))}var Bh=n(52965);const Lh=new(n.n(Bh)().Converter)({noHeaderId:!0,tables:!0,literalMidWordUnderscores:!0,omitExtraWLInCodeBlocks:!0,simpleLineBreaks:!0,strikethrough:!0});function Mh(e){if("IFRAME"===e.nodeName){const t=e.ownerDocument.createTextNode(e.src);e.parentNode.replaceChild(t,e)}}function Dh(e){e.id&&0===e.id.indexOf("docs-internal-guid-")&&("B"===e.tagName?qp(e):e.removeAttribute("id"))}function Oh(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;let n=e.data.replace(/[ \r\n\t]+/g," ");if(" "===n[0]){const t=hh(e,"previous");t&&"BR"!==t.nodeName&&" "!==t.textContent.slice(-1)||(n=n.slice(1))}if(" "===n[n.length-1]){const t=hh(e,"next");(!t||"BR"===t.nodeName||t.nodeType===t.TEXT_NODE&&function(e){return" "===e||"\r"===e||"\n"===e||"\t"===e}(t.textContent[0]))&&(n=n.slice(0,-1))}n?e.data=n:e.parentNode.removeChild(e)}function Fh(e){"BR"===e.nodeName&&(hh(e,"next")||e.parentNode.removeChild(e))}function jh(e){"P"===e.nodeName&&(e.hasChildNodes()||e.parentNode.removeChild(e))}function Zh(e){if("SPAN"!==e.nodeName)return;if("paragraph-break"!==e.getAttribute("data-stringify-type"))return;const{parentNode:t}=e;t.insertBefore(e.ownerDocument.createElement("br"),e),t.insertBefore(e.ownerDocument.createElement("br"),e),t.removeChild(e)}const{console:zh}=window;function Vh(e,t){return e=bh(e=ph(e,[Ch,Dh,xh,Eh,vh]),zp("paste"),{inline:!0}),t||(e=ph(e,[Oh,Fh])),zh.log("Processed inline HTML:\n\n",e),e}function Hh({HTML:e="",plainText:t="",mode:n="AUTO",tagName:r,preserveWhiteSpace:o}){if(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:"))return Lp(n)}var i;if(String.prototype.normalize&&(e=e.normalize()),!t||e&&!function(e){return!/<(?!br[ />])/i.test(e)}(e)||(e=t,/^\s+$/.test(t)||(i=e,e=Lh.makeHtml(function(e){return e.replace(/((?:^|\n)```)([^\n`]+)(```(?:$|\n))/,((e,t,n,r)=>`${t}\n${n}\n${r}`))}(function(e){return e.replace(/(^|\n)•( +)/g,"$1*$2")}(i)))),"AUTO"===n&&-1===t.indexOf("\n")&&0!==t.indexOf("<p>")&&0===e.indexOf("<p>")&&(n="INLINE")),"INLINE"===n)return Vh(e,o);e=ph(e,[Zh]);const a=ah(e),s=a.length>1;if("AUTO"===n&&!s&&function(e,t){const n=document.implementation.createHTMLDocument("");n.body.innerHTML=e;const r=Array.from(n.body.children);return!r.some(_h)&&yh(r,t)}(e,r))return Vh(e,o);const l=zp("paste"),c=uh("paste"),u=a.map((e=>{if("string"!=typeof e)return e;const t=[Dh,Th,Ch,Yp,Rh,Eh,Gp,vh,Mh,Qp,Xp,Ah],n={...c,...l};return e=ph(e,t,c),e=ph(e=Up(e=bh(e,n)),[Oh,Fh,jh],c),zh.log("Processed HTML piece:\n\n",e),Dp(e,Hh)})).flat().filter(Boolean);if("AUTO"===n&&1===u.length&&uc(u[0].name,"__unstablePasteTextInline",!1)){const e=/^[\n]+|[\n]+$/g,n=t.replace(e,"");if(""!==n&&-1===n.indexOf("\n"))return bh(Ld(u[0]),l).replace(e,"")}return u}function Uh(e=[],t=[]){return e.length===t.length&&t.every((([t,,n],r)=>{const o=e[r];return t===o.name&&Uh(o.innerBlocks,n)}))}function $h(e=[],t){return t?t.map((([t,n,r],o)=>{var i;const a=e[o];if(a&&a.name===t){const e=$h(a.innerBlocks,r);return{...a,innerBlocks:e}}const s=sc(t),l=(e,t)=>t?Object.fromEntries(Object.entries(t).map((([t,n])=>[t,c(e[t],n)]))):{},c=(e,t)=>{return n=e,"html"===n?.source&&Array.isArray(t)?xd(t):(e=>"query"===e?.source)(e)&&t?t.map((t=>l(e.query,t))):t;var n},u=l(null!==(i=s?.attributes)&&void 0!==i?i:{},n);let[d,p]=hp(t,u);return void 0===sc(d)&&(p={originalName:t,originalContent:"",originalUndelimitedContent:""},d="core/missing"),fc(d,p,$h([],r))})):e}(0,mc.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&uc(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}));var Wh=n(35503),Gh=n(21263),qh=n(7097),Kh=n(19185),Yh=({children:e,className:t})=>(0,x.createElement)("div",{className:t},e);const Xh=(0,x.forwardRef)((function({children:e,className:t,containerClassName:n,extraProps:r,isActive:o,isDisabled:i,title:a,...s},l){return(0,x.useContext)(Kh.Z)?(0,x.createElement)(qh.Z,{className:R()("components-toolbar-button",t),...r,...s,ref:l},(t=>(0,x.createElement)(Gh.ZP,{label:a,isPressed:o,disabled:i,...t},e))):(0,x.createElement)(Yh,{className:n},(0,x.createElement)(Gh.ZP,{ref:l,icon:s.icon,label:a,shortcut:s.shortcut,"data-subscript":s.subscript,onClick:e=>{e.stopPropagation(),s.onClick&&s.onClick(e)},className:R()("components-toolbar__control",t),isPressed:o,disabled:i,"data-toolbar-item":!0,...r,...s},e))}));var Jh=Xh,Qh=({className:e,children:t,...n})=>(0,x.createElement)("div",{className:e,...n},t),em=n(33584),tm=function({controls:e=[],toggleProps:t,...n}){const r=t=>(0,x.createElement)(em.Z,{controls:e,toggleProps:{...t,"data-toolbar-item":!0},...n});return(0,x.useContext)(Kh.Z)?(0,x.createElement)(qh.Z,{...t},r):r(t)},nm=function({controls:e=[],children:t,className:n,isCollapsed:r,title:o,...i}){const a=(0,x.useContext)(Kh.Z);if(!(e&&e.length||t))return null;const s=R()(a?"components-toolbar-group":"components-toolbar",n);let l;var c;return c=e,l=Array.isArray(c)&&Array.isArray(c[0])?e:[e],r?(0,x.createElement)(tm,{label:o,controls:l,className:s,children:t,...i}):(0,x.createElement)(Qh,{className:s,...i},l?.flatMap(((e,t)=>e.map(((e,n)=>(0,x.createElement)(Jh,{key:[t,n].join(),containerClassName:t>0&&0===n?"has-left-divider":void 0,...e}))))),t)},rm=n(15601),om={default:(0,kl.up)("BlockControls"),block:(0,kl.up)("BlockControlsBlock"),inline:(0,kl.up)("BlockFormatControls"),other:(0,kl.up)("BlockControlsOther"),parent:(0,kl.up)("BlockControlsParent")};const im={insertUsage:{}},am={alignWide:!1,supportsLayout:!0,colors:[{name:(0,$.__)("Black"),slug:"black",color:"#000000"},{name:(0,$.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,$.__)("White"),slug:"white",color:"#ffffff"},{name:(0,$.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,$.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,$.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,$.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,$.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,$.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,$.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,$.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,$.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,$._x)("Small","font size name"),size:13,slug:"small"},{name:(0,$._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,$._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,$._x)("Large","font size name"),size:36,slug:"large"},{name:(0,$._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,$.__)("Thumbnail")},{slug:"medium",name:(0,$.__)("Medium")},{slug:"large",name:(0,$.__)("Large")},{slug:"full",name:(0,$.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,canLockBlocks:!0,enableOpenverseMediaCategory:!0,clearBlockSelection:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__unstableGalleryWithImageBlocks:!1,__unstableIsPreviewMode:!1,blockInspectorAnimation:{animationParent:"core/navigation","core/navigation":{enterDirection:"leftToRight"},"core/navigation-submenu":{enterDirection:"rightToLeft"},"core/navigation-link":{enterDirection:"rightToLeft"},"core/search":{enterDirection:"rightToLeft"},"core/social-links":{enterDirection:"rightToLeft"},"core/page-list":{enterDirection:"rightToLeft"},"core/spacer":{enterDirection:"rightToLeft"},"core/home-link":{enterDirection:"rightToLeft"},"core/site-title":{enterDirection:"rightToLeft"},"core/site-logo":{enterDirection:"rightToLeft"}},generateAnchors:!1,gradients:[{name:(0,$.__)("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,$.__)("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,$.__)("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,$.__)("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,$.__)("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,$.__)("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,$.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,$.__)("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,$.__)("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,$.__)("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,$.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,$.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function sm(e,t,n){return[...e.slice(0,n),...Array.isArray(t)?t:[t],...e.slice(n)]}function lm(e,t,n,r=1){const o=[...e];return o.splice(t,r),sm(o,e.slice(t,t+r),n)}const cm=e=>e;function um(e,t=""){const n=new Map,r=[];return n.set(t,r),e.forEach((e=>{const{clientId:t,innerBlocks:o}=e;r.push(t),um(o,t).forEach(((e,t)=>{n.set(t,e)}))})),n}function dm(e,t=""){const n=[],r=[[t,e]];for(;r.length;){const[e,t]=r.shift();t.forEach((({innerBlocks:t,...o})=>{n.push([o.clientId,e]),t?.length&&r.push([o.clientId,t])}))}return n}function pm(e,t=cm){const n=[],r=[...e];for(;r.length;){const{innerBlocks:e,...o}=r.shift();r.push(...e),n.push([o.clientId,t(o)])}return n}function hm(e){return pm(e,(e=>{const{attributes:t,...n}=e;return n}))}function mm(e){return pm(e,(e=>e.attributes))}function fm(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&M()(e.clientIds,t.clientIds)&&function(e,t){return M()(Object.keys(e),Object.keys(t))}(e.attributes,t.attributes)}function gm(e,t){const n=e.tree,r=[...t],o=[...t];for(;r.length;){const e=r.shift();r.push(...e.innerBlocks),o.push(...e.innerBlocks)}for(const e of o)n.set(e.clientId,{});for(const t of o)n.set(t.clientId,Object.assign(n.get(t.clientId),{...e.byClientId.get(t.clientId),attributes:e.attributes.get(t.clientId),innerBlocks:t.innerBlocks.map((e=>n.get(e.clientId)))}))}function bm(e,t,n=!1){const r=e.tree,o=new Set([]),i=new Set;for(const r of t){let t=n?r:e.parents.get(r);do{if(e.controlledInnerBlocks[t]){i.add(t);break}o.add(t),t=e.parents.get(t)}while(void 0!==t)}for(const e of o)r.set(e,{...r.get(e)});for(const t of o)r.get(t).innerBlocks=(e.order.get(t)||[]).map((e=>r.get(e)));for(const t of i)r.set("controlled||"+t,{innerBlocks:(e.order.get(t)||[]).map((e=>r.get(e)))})}const vm=(0,Wc.Z)(B.combineReducers,(e=>(t,n)=>{if(t&&"SAVE_REUSABLE_BLOCK_SUCCESS"===n.type){const{id:e,updatedId:r}=n;if(e===r)return t;(t={...t}).attributes=new Map(t.attributes),t.attributes.forEach(((n,o)=>{const{name:i}=t.byClientId.get(o);"core/block"===i&&n.ref===e&&t.attributes.set(o,{...n,ref:r})}))}return e(t,n)}),(e=>(t={},n)=>{const r=e(t,n);if(r===t)return t;switch(r.tree=t.tree?t.tree:new Map,n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":r.tree=new Map(r.tree),gm(r,n.blocks),bm(r,n.rootClientId?[n.rootClientId]:[""],!0);break;case"UPDATE_BLOCK":r.tree=new Map(r.tree),r.tree.set(n.clientId,{...r.tree.get(n.clientId),...r.byClientId.get(n.clientId),attributes:r.attributes.get(n.clientId)}),bm(r,[n.clientId],!1);break;case"UPDATE_BLOCK_ATTRIBUTES":r.tree=new Map(r.tree),n.clientIds.forEach((e=>{r.tree.set(e,{...r.tree.get(e),attributes:r.attributes.get(e)})})),bm(r,n.clientIds,!1);break;case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=function(e){const t={},n=[...e];for(;n.length;){const{innerBlocks:e,...r}=n.shift();n.push(...e),t[r.clientId]=!0}return t}(n.blocks);r.tree=new Map(r.tree),n.replacedClientIds.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e))).forEach((e=>{r.tree.delete(e)})),gm(r,n.blocks),bm(r,n.blocks.map((e=>e.clientId)),!1);const o=[];for(const e of n.clientIds)void 0===t.parents.get(e)||""!==t.parents.get(e)&&!r.byClientId.get(t.parents.get(e))||o.push(t.parents.get(e));bm(r,o,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const o of n.clientIds)void 0===t.parents.get(o)||""!==t.parents.get(o)&&!r.byClientId.get(t.parents.get(o))||e.push(t.parents.get(o));r.tree=new Map(r.tree),n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e))).forEach((e=>{r.tree.delete(e)})),bm(r,e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId?e.push(n.fromRootClientId):e.push(""),n.toRootClientId&&e.push(n.toRootClientId),r.tree=new Map(r.tree),bm(r,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];r.tree=new Map(r.tree),bm(r,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=[];r.attributes.forEach(((t,o)=>{"core/block"===r.byClientId.get(o).name&&t.ref===n.updatedId&&e.push(o)})),r.tree=new Map(r.tree),e.forEach((e=>{r.tree.set(e,{...r.byClientId.get(e),attributes:r.attributes.get(e),innerBlocks:r.tree.get(e).innerBlocks})})),bm(r,e,!1)}}return r}),(e=>(t,n)=>{const r=e=>{let r=e;for(let o=0;o<r.length;o++)!t.order.get(r[o])||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[r[o]]||(r===e&&(r=[...r]),r.push(...t.order.get(r[o])));return r};if(t)switch(n.type){case"REMOVE_BLOCKS":n={...n,type:"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN",removedClientIds:r(n.clientIds)};break;case"REPLACE_BLOCKS":n={...n,type:"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN",replacedClientIds:r(n.clientIds)}}return e(t,n)}),(e=>(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const r={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...o}=e.shift();e.push(...n),t.controlledInnerBlocks[o.clientId]&&(r[o.clientId]=!0)}}let o=t;t.order.get(n.rootClientId)&&(o=e(o,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:r,clientIds:t.order.get(n.rootClientId)}));let i=o;if(n.blocks.length){i=e(i,{...n,type:"INSERT_BLOCKS",index:0});const o=new Map(i.order);Object.keys(r).forEach((e=>{t.order.get(e)&&o.set(e,t.order.get(e))})),i.order=o,i.tree=new Map(i.tree),Object.keys(r).forEach((e=>{const n=`controlled||${e}`;t.tree.has(n)&&i.tree.set(n,t.tree.get(n))}))}return i}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:new Map(hm(n.blocks)),attributes:new Map(mm(n.blocks)),order:um(n.blocks),parents:new Map(dm(n.blocks)),controlledInnerBlocks:{}};return e.tree=new Map(t?.tree),gm(e,n.blocks),e.tree.set("",{innerBlocks:n.blocks.map((t=>e.tree.get(t.clientId)))}),e}return e(t,n)}),(function(e){let t,n=!1;return(r,o)=>{let i=e(r,o);const a="MARK_LAST_CHANGE_AS_PERSISTENT"===o.type||n;if(r===i&&!a){var s;n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===o.type;const e=null===(s=r?.isPersistentChange)||void 0===s||s;return r.isPersistentChange===e?r:{...i,isPersistentChange:e}}return i={...i,isPersistentChange:a?!n:!fm(o,t)},t=o,n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===o.type,i}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,r)=>{const o=e(n,r);return o!==n&&(o.isIgnoredChange=t.has(r.type)),o}}),(e=>(t,n)=>{if("SET_HAS_CONTROLLED_INNER_BLOCKS"===n.type){const r=e(t,{type:"REPLACE_INNER_BLOCKS",rootClientId:n.clientId,blocks:[]});return e(r,n)}return e(t,n)}))({byClientId(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const n=new Map(e);return hm(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"UPDATE_BLOCK":{if(!e.has(t.clientId))return e;const{attributes:n,...r}=t.updates;if(0===Object.values(r).length)return e;const o=new Map(e);return o.set(t.clientId,{...e.get(t.clientId),...r}),o}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),hm(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 mm(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"UPDATE_BLOCK":{if(!e.get(t.clientId)||!t.updates.attributes)return e;const n=new Map(e);return n.set(t.clientId,{...e.get(t.clientId),...t.updates.attributes}),n}case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e.get(t))))return e;let r=!1;const o=new Map(e);for(const i of t.clientIds){var n;const a=Object.entries(t.uniqueByBlock?t.attributes[i]:null!==(n=t.attributes)&&void 0!==n?n:{});if(0===a.length)continue;let s=!1;const l=e.get(i),c={};a.forEach((([e,t])=>{l[e]!==t&&(s=!0,c[e]=t)})),r=r||s,s&&o.set(i,{...l,...c})}return r?o:e}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),mm(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},order(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":{var n;const r=um(t.blocks),o=new Map(e);return r.forEach(((e,t)=>{""!==t&&o.set(t,e)})),o.set("",(null!==(n=e.get(""))&&void 0!==n?n:[]).concat(r[""])),o}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,r=e.get(n)||[],o=um(t.blocks,n),{index:i=r.length}=t,a=new Map(e);return o.forEach(((e,t)=>{a.set(t,e)})),a.set(n,sm(r,o.get(n),i)),a}case"MOVE_BLOCKS_TO_POSITION":{var r;const{fromRootClientId:n="",toRootClientId:o="",clientIds:i}=t,{index:a=e.get(o).length}=t;if(n===o){const t=e.get(o).indexOf(i[0]),n=new Map(e);return n.set(o,lm(e.get(o),t,a,i.length)),n}const s=new Map(e);return s.set(n,null!==(r=e.get(n)?.filter((e=>!i.includes(e))))&&void 0!==r?r:[]),s.set(o,sm(e.get(o),i,a)),s}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:r=""}=t,o=n[0],i=e.get(r);if(!i.length||o===i[0])return e;const a=i.indexOf(o),s=new Map(e);return s.set(r,lm(i,a,a-1,n.length)),s}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:r=""}=t,o=n[0],i=n[n.length-1],a=e.get(r);if(!a.length||i===a[a.length-1])return e;const s=a.indexOf(o),l=new Map(e);return l.set(r,lm(a,s,s+1,n.length)),l}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const r=um(t.blocks),o=new Map(e);return t.replacedClientIds.forEach((e=>{o.delete(e)})),r.forEach(((e,t)=>{""!==t&&o.set(t,e)})),o.forEach(((e,t)=>{const i=Object.values(e).reduce(((e,t)=>t===n[0]?[...e,...r.get("")]:(-1===n.indexOf(t)&&e.push(t),e)),[]);o.set(t,i)})),o}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n.forEach(((e,r)=>{var o;const i=null!==(o=e?.filter((e=>!t.removedClientIds.includes(e))))&&void 0!==o?o:[];i.length!==e.length&&n.set(r,i)})),n}}return e},parents(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":{const n=new Map(e);return dm(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"INSERT_BLOCKS":{const n=new Map(e);return dm(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)})),dm(t.blocks,e.get(t.clientIds[0])).forEach((([e,t])=>{n.set(e,t)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},controlledInnerBlocks(e={},{type:t,clientId:n,hasControlledInnerBlocks:r}){return"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:r}:e}});function ym(e={},t){switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return t.updateSelection&&t.blocks.length?{clientId:t.blocks[0].clientId}:e;case"REMOVE_BLOCKS":return t.clientIds&&t.clientIds.length&&-1!==t.clientIds.indexOf(e.clientId)?{}:e;case"REPLACE_BLOCKS":{if(-1===t.clientIds.indexOf(e.clientId))return e;const n=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return n?n.clientId===e.clientId?e:{clientId:n.clientId}:{}}}return e}const _m=(0,B.combineReducers)({blocks:vm,isTyping:function(e=!1,t){switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},isBlockInterfaceHidden:function(e=!1,t){switch(t.type){case"HIDE_BLOCK_INTERFACE":return!0;case"SHOW_BLOCK_INTERFACE":return!1}return e},draggedBlocks:function(e=[],t){switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},selection:function(e={},t){switch(t.type){case"SELECTION_CHANGE":return t.clientId?{selectionStart:{clientId:t.clientId,attributeKey:t.attributeKey,offset:t.startOffset},selectionEnd:{clientId:t.clientId,attributeKey:t.attributeKey,offset:t.endOffset}}:{selectionStart:t.start||e.selectionStart,selectionEnd:t.end||e.selectionEnd};case"RESET_SELECTION":const{selectionStart:n,selectionEnd:r}=t;return{selectionStart:n,selectionEnd:r};case"MULTI_SELECT":const{start:o,end:i}=t;return o===e.selectionStart?.clientId&&i===e.selectionEnd?.clientId?e:{selectionStart:{clientId:o},selectionEnd:{clientId:i}};case"RESET_BLOCKS":const a=e?.selectionStart?.clientId,s=e?.selectionEnd?.clientId;if(!a&&!s)return e;if(!t.blocks.some((e=>e.clientId===a)))return{selectionStart:{},selectionEnd:{}};if(!t.blocks.some((e=>e.clientId===s)))return{...e,selectionEnd:e.selectionStart}}const n=ym(e.selectionStart,t),r=ym(e.selectionEnd,t);return n===e.selectionStart&&r===e.selectionEnd?e:{selectionStart:n,selectionEnd:r}},isMultiSelecting:function(e=!1,t){switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(e=!0,t){return"TOGGLE_SELECTION"===t.type?t.isSelectionEnabled:e},initialPosition:function(e=null,t){return"REPLACE_BLOCKS"===t.type&&void 0!==t.initialPosition||["MULTI_SELECT","SELECT_BLOCK","RESET_SELECTION","INSERT_BLOCKS","REPLACE_INNER_BLOCKS"].includes(t.type)?t.initialPosition:e},blocksMode:function(e={},t){if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:(e={},t)=>{switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return Object.fromEntries(Object.entries(e).filter((([e])=>!t.clientIds.includes(e))));case"UPDATE_BLOCK_LIST_SETTINGS":{const{clientId:n}=t;if(!t.settings){if(e.hasOwnProperty(n)){const{[n]:t,...r}=e;return r}return e}return M()(e[n],t.settings)?e:{...e,[n]:t.settings}}}return e},insertionPoint:function(e=null,t){switch(t.type){case"SHOW_INSERTION_POINT":{const{rootClientId:n,index:r,__unstableWithInserter:o,operation:i}=t,a={rootClientId:n,index:r,__unstableWithInserter:o,operation:i};return M()(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=am,t){return"UPDATE_SETTINGS"===t.type?t.reset?{...am,...t.settings}:{...e,...t.settings}:e},preferences:function(e=im,t){switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":return t.blocks.reduce(((e,n)=>{const{attributes:r,name:o}=n;let i=o;const a=(0,Kl.Y)(Vu).getActiveBlockVariation(o,r);return a?.name&&(i+="/"+a.name),"core/block"===o&&(i+="/"+r.ref),{...e,insertUsage:{...e.insertUsage,[i]:{time:t.time,count:e.insertUsage[i]?e.insertUsage[i].count+1:1}}}}),e)}return e},lastBlockAttributesChange:function(e=null,t){switch(t.type){case"UPDATE_BLOCK":if(!t.updates.attributes)break;return{[t.clientId]:t.updates.attributes};case"UPDATE_BLOCK_ATTRIBUTES":return t.clientIds.reduce(((e,n)=>({...e,[n]:t.uniqueByBlock?t.attributes[n]:t.attributes})),{})}return e},editorMode:function(e="edit",t){return"INSERT_BLOCKS"===t.type&&"navigation"===e?"edit":"SET_EDITOR_MODE"===t.type?t.mode:e},hasBlockMovingClientId:function(e=null,t){return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_EDITOR_MODE"===t.type?null:e},highlightedBlock:function(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":const{clientId:n,isHighlighted:r}=t;return r?n:e===n?null:e;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},lastBlockInserted:function(e={},t){switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":if(!t.blocks.length)return e;const n=t.blocks.map((e=>e.clientId)),r=t.meta?.source;return{clientIds:n,source:r};case"RESET_BLOCKS":return{}}return e},temporarilyEditingAsBlocks:function(e="",t){return"SET_TEMPORARILY_EDITING_AS_BLOCKS"===t.type?t.temporarilyEditingAsBlocks:e},blockVisibility:function(e={},t){return"SET_BLOCK_VISIBILITY"===t.type?{...e,...t.updates}:e},blockEditingModes:function(e=new Map,t){switch(t.type){case"SET_BLOCK_EDITING_MODE":return new Map(e).set(t.clientId,t.mode);case"UNSET_BLOCK_EDITING_MODE":{const n=new Map(e);return n.delete(t.clientId),n}case"RESET_BLOCKS":return e.has("")?(new Map).set("",e.get("")):e}return e},styleOverrides:function(e=new Map,t){switch(t.type){case"SET_STYLE_OVERRIDE":return new Map(e).set(t.id,t.style);case"DELETE_STYLE_OVERRIDE":{const n=new Map(e);return n.delete(t.id),n}}return e},removalPromptData:function(e=!1,t){switch(t.type){case"DISPLAY_BLOCK_REMOVAL_PROMPT":const{clientIds:e,selectPrevious:n,blockNamesForPrompt:r}=t;return{clientIds:e,selectPrevious:n,blockNamesForPrompt:r};case"CLEAR_BLOCK_REMOVAL_PROMPT":return!1}return e},blockRemovalRules:function(e=!1,t){return"SET_BLOCK_REMOVAL_RULES"===t.type?t.rules:e},openedBlockSettingsMenu:function(e=null,t){var n;return"SET_OPENED_BLOCK_SETTINGS_MENU"===t.type?null!==(n=t?.clientId)&&void 0!==n?n:null:e},registeredInserterMediaCategories:function(e=[],t){return"REGISTER_INSERTER_MEDIA_CATEGORY"===t.type?[...e,t.category]:e}});var km=function(e){return(t,n)=>{const r=e(t,n);return t?(r.automaticChangeStatus=t.automaticChangeStatus,"MARK_AUTOMATIC_CHANGE"===n.type?{...r,automaticChangeStatus:"pending"}:"MARK_AUTOMATIC_CHANGE_FINAL"===n.type&&"pending"===t.automaticChangeStatus?{...r,automaticChangeStatus:"final"}:r.blocks===t.blocks&&r.selection===t.selection||"final"!==r.automaticChangeStatus&&r.selection!==t.selection?r:{...r,automaticChangeStatus:void 0}):r}}(_m),wm=n(86268),Em=n(5153),Cm=(0,B.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}});const xm=(0,La.Z)((e=>Object.values(e.formatTypes)),(e=>[e.formatTypes]));function Sm(e,t){return e.formatTypes[t]}function Im(e,t){const n=xm(e);return n.find((({className:e,tagName:n})=>null===e&&t===n))||n.find((({className:e,tagName:t})=>null===e&&"*"===t))}function Tm(e,t){return xm(e).find((({className:e})=>null!==e&&` ${t} `.indexOf(` ${e} `)>=0))}function Nm(e){return{type:"ADD_FORMAT_TYPES",formatTypes:Array.isArray(e)?e:[e]}}function Pm(e){return{type:"REMOVE_FORMAT_TYPES",names:Array.isArray(e)?e:[e]}}const Rm=(0,A.Z)("core/rich-text",{reducer:Cm,selectors:d,actions:p});function Am(e,t){if(e===t)return!0;if(!e||!t)return!1;if(e.type!==t.type)return!1;const n=e.attributes,r=t.attributes;if(n===r)return!0;if(!n||!r)return!1;const o=Object.keys(n),i=Object.keys(r);if(o.length!==i.length)return!1;const a=o.length;for(let e=0;e<a;e++){const t=o[e];if(n[t]!==r[t])return!1}return!0}function Bm(e){const t=e.formats.slice();return t.forEach(((e,n)=>{const r=t[n-1];if(r){const o=e.slice();o.forEach(((e,t)=>{const n=r[t];Am(e,n)&&(o[t]=n)})),t[n]=o}})),{...e,formats:t}}function Lm(e,t,n){return(e=e.slice())[t]=n,e}function Mm(e,t,n=e.start,r=e.end){const{formats:o,activeFormats:i}=e,a=o.slice();if(n===r){const e=a[n]?.find((({type:e})=>e===t.type));if(e){const o=a[n].indexOf(e);for(;a[n]&&a[n][o]===e;)a[n]=Lm(a[n],o,t),n--;for(r++;a[r]&&a[r][o]===e;)a[r]=Lm(a[r],o,t),r++}}else{let e=1/0;for(let o=n;o<r;o++)if(a[o]){a[o]=a[o].filter((({type:e})=>e!==t.type));const n=a[o].length;n<e&&(e=n)}else a[o]=[],e=0;for(let o=n;o<r;o++)a[o].splice(e,0,t)}return Bm({...e,formats:a,activeFormats:[...i?.filter((({type:e})=>e!==t.type))||[],t]})}function Dm({implementation:e},t){return Dm.body||(Dm.body=e.createHTMLDocument("").body),Dm.body.innerHTML=t,Dm.body}(0,B.register)(Rm);const Om="",Fm="\ufeff";function jm({tagName:e,attributes:t}){let n;if(t&&t.class&&(n=(0,Kl.Y)(Rm).getFormatTypeForClassName(t.class),n&&(t.class=` ${t.class} `.replace(` ${n.className} `," ").trim(),t.class||delete t.class)),n||(n=(0,Kl.Y)(Rm).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 r={},o={},i={...t};for(const e in n.attributes){const t=n.attributes[e];r[e]=i[t],n.__unstableFilterAttributeValue&&(r[e]=n.__unstableFilterAttributeValue(e,r[e])),delete i[t],void 0===r[e]&&delete r[e]}for(const e in i)o[e]=t[e];return!1===n.contentEditable&&delete o.contenteditable,{formatType:n,type:n.name,tagName:e,attributes:r,unregisteredAttributes:o}}function Zm({element:e,text:t,html:n,range:r,__unstableIsEditableTree:o,preserveWhiteSpace:i}={}){return"string"==typeof t&&t.length>0?{formats:Array(t.length),replacements:Array(t.length),text:t}:("string"==typeof n&&n.length>0&&(e=Dm(document,n)),"object"!=typeof e?{formats:[],replacements:[],text:""}:$m({element:e,range:r,isEditableTree:o,preserveWhiteSpace:i}))}function zm(e,t,n,r){if(!n)return;const{parentNode:o}=t,{startContainer:i,startOffset:a,endContainer:s,endOffset:l}=n,c=e.text.length;void 0!==r.start?e.start=c+r.start:t===i&&t.nodeType===t.TEXT_NODE?e.start=c+a:o===i&&t===i.childNodes[a]?e.start=c:o===i&&t===i.childNodes[a-1]?e.start=c+r.text.length:t===i&&(e.start=c),void 0!==r.end?e.end=c+r.end:t===s&&t.nodeType===t.TEXT_NODE?e.end=c+l:o===s&&t===s.childNodes[l-1]?e.end=c+r.text.length:o===s&&t===s.childNodes[l]?e.end=c:t===s&&(e.end=c+l)}function Vm(e,t,n){if(!t)return;const{startContainer:r,endContainer:o}=t;let{startOffset:i,endOffset:a}=t;return e===r&&(i=n(e.nodeValue.slice(0,i)).length),e===o&&(a=n(e.nodeValue.slice(0,a)).length),{startContainer:r,startOffset:i,endContainer:o,endOffset:a}}function Hm(e){return e.replace(/[\n\r\t]+/g," ")}function Um(e){return e.replace(new RegExp(`[${Fm}${Om}]`,"gu"),"")}function $m({element:e,range:t,isEditableTree:n,preserveWhiteSpace:r}){const o={formats:[],replacements:[],text:""};if(!e)return o;if(!e.hasChildNodes())return zm(o,e,t,{formats:[],replacements:[],text:""}),o;const i=e.childNodes.length;for(let a=0;a<i;a++){const s=e.childNodes[a],l=s.nodeName.toLowerCase();if(s.nodeType===s.TEXT_NODE){let d=Um;r||(d=e=>Um(Hm(e)));const p=d(s.nodeValue);zm(o,s,t=Vm(s,t,d),{text:p}),o.formats.length+=p.length,o.replacements.length+=p.length,o.text+=p;continue}if(s.nodeType!==s.ELEMENT_NODE)continue;if(n&&(s.getAttribute("data-rich-text-placeholder")||"br"===l&&!s.getAttribute("data-rich-text-line-break"))){zm(o,s,t,{formats:[],replacements:[],text:""});continue}if("script"===l){const h={formats:[,],replacements:[{type:l,attributes:{"data-rich-text-script":s.getAttribute("data-rich-text-script")||encodeURIComponent(s.innerHTML)}}],text:Om};zm(o,s,t,h),Gm(o,h);continue}if("br"===l){zm(o,s,t,{formats:[],replacements:[],text:""}),Gm(o,Zm({text:"\n"}));continue}const c=jm({tagName:l,attributes:Wm({element:s})});if(!1===c?.formatType?.contentEditable){delete c.formatType,zm(o,s,t,{formats:[],replacements:[],text:""}),Gm(o,{formats:[,],replacements:[{...c,innerHTML:s.innerHTML}],text:Om});continue}c&&delete c.formatType;const u=$m({element:s,range:t,isEditableTree:n,preserveWhiteSpace:r});if(zm(o,s,t,u),c)if(0===u.text.length)c.attributes&&Gm(o,{formats:[,],replacements:[c],text:Om});else{function m(e){if(m.formats===e)return m.newFormats;const t=e?[c,...e]:[c];return m.formats=e,m.newFormats=t,t}m.newFormats=[c],Gm(o,{...u,formats:Array.from(u.formats,m)})}else Gm(o,u)}return o}function Wm({element:e}){if(!e.hasAttributes())return;const t=e.attributes.length;let n;for(let r=0;r<t;r++){const{name:t,value:o}=e.attributes[r];0!==t.indexOf("data-rich-text-")&&(n=n||{},n[/^on/i.test(t)?"data-disable-rich-text-"+t:t]=o)}return n}function Gm(e,t){return e.formats=e.formats.concat(t.formats),e.replacements=e.replacements.concat(t.replacements),e.text+=t.text,e}function qm(e,t=[]){const{formats:n,start:r,end:o,activeFormats:i}=e;if(void 0===r)return t;if(r===o){if(i)return i;const e=n[r-1]||t,o=n[r]||t;return e.length<o.length?e:o}if(!n[r])return t;const a=n.slice(r,o),s=[...a[0]];let l=a.length;for(;l--;){const e=a[l];if(!e)return t;let n=s.length;for(;n--;){const t=s[n];e.find((e=>Am(t,e)))||s.splice(n,1)}if(0===s.length)return t}return s||t}function Km(e,t){return qm(e).find((({type:e})=>e===t))}function Ym({text:e}){return e.replace(Om,"")}function Xm({start:e,end:t}){if(void 0!==e&&void 0!==t)return e===t}function Jm({text:e}){return 0===e.length}function Qm(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,Kl.Y)(Rm).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,Kl.Y)(Rm).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,Kl.Y)(Rm).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,Yl.W)(Rm).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, 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 ef(e,t,n=e.start,r=e.end){const{formats:o,activeFormats:i}=e,a=o.slice();if(n===r){const e=a[n]?.find((({type:e})=>e===t));if(e){for(;a[n]?.find((t=>t===e));)tf(a,n,t),n--;for(r++;a[r]?.find((t=>t===e));)tf(a,r,t),r++}}else for(let e=n;e<r;e++)a[e]&&tf(a,e,t);return Bm({...e,formats:a,activeFormats:i?.filter((({type:e})=>e!==t))||[]})}function tf(e,t,n){const r=e[t].filter((({type:e})=>e!==n));r.length?e[t]=r:delete e[t]}function nf(e,t,n=e.start,r=e.end){const{formats:o,replacements:i,text:a}=e;"string"==typeof t&&(t=Zm({text:t}));const s=n+t.text.length;return Bm({formats:o.slice(0,n).concat(t.formats,o.slice(r)),replacements:i.slice(0,n).concat(t.replacements,i.slice(r)),text:a.slice(0,n)+t.text+a.slice(r),start:s,end:s})}function rf(e,t,n){return nf(e,Zm(),t,n)}function of(e,t=e.start,n=e.end){const{formats:r,replacements:o,text:i}=e;return void 0===t||void 0===n?{...e}:{formats:r.slice(t,n),replacements:o.slice(t,n),text:i.slice(t,n)}}function af({formats:e,replacements:t,text:n,start:r,end:o},i){if("string"!=typeof i)return function({formats:e,replacements:t,text:n,start:r,end:o},i=r,a=o){if(void 0===r||void 0===o)return;return[{formats:e.slice(0,i),replacements:t.slice(0,i),text:n.slice(0,i)},{formats:e.slice(a),replacements:t.slice(a),text:n.slice(a),start:0,end:0}]}(...arguments);let a=0;return n.split(i).map((n=>{const s=a,l={formats:e.slice(s,s+n.length),replacements:t.slice(s,s+n.length),text:n};return a+=i.length+n.length,void 0!==r&&void 0!==o&&(r>=s&&r<a?l.start=r-s:r<s&&o>s&&(l.start=0),o>=s&&o<a?l.end=o-s:r<a&&o>a&&(l.end=n.length)),l}))}function sf(e){return(0,Kl.Y)(Rm).getFormatType(e)}function lf(e,t){if(t)return e;const n={};for(const t in e){let r=t;t.startsWith("data-disable-rich-text-")&&(r=t.slice(23)),n[r]=e[t]}return n}function cf({type:e,tagName:t,attributes:n,unregisteredAttributes:r,object:o,boundaryClass:i,isEditableTree:a}){const s=sf(e);let l={};if(i&&a&&(l["data-rich-text-format-boundary"]="true"),!s)return n&&(l={...n,...l}),{type:e,attributes:lf(l,a),object:o};l={...r,...l};for(const e in n){const t=!!s.attributes&&s.attributes[e];t?l[t]=n[e]:l[e]=n[e]}return s.className&&(l.class?l.class=`${s.className} ${l.class}`:l.class=s.className),a&&!1===s.contentEditable&&(l.contenteditable="false"),{type:t||s.tagName,object:s.object,attributes:lf(l,a)}}function uf(e,t,n){do{if(e[n]!==t[n])return!1}while(n--);return!0}function df({value:e,preserveWhiteSpace:t,createEmpty:n,append:r,getLastChild:o,getParent:i,isText:a,getText:s,remove:l,appendText:c,onStartIndex:u,onEndIndex:d,isEditableTree:p,placeholder:h}){const{formats:m,replacements:f,text:g,start:b,end:v}=e,y=m.length+1,_=n(),k=qm(e),w=k[k.length-1];let E,C;r(_,"");for(let e=0;e<y;e++){const n=g.charAt(e),y=p&&(!C||"\n"===C),k=m[e];let x=o(_);if(k&&k.forEach(((e,t)=>{if(x&&E&&uf(k,E,t))return void(x=o(x));const{type:n,tagName:c,attributes:u,unregisteredAttributes:d}=e,h=p&&e===w,m=i(x),f=r(m,cf({type:n,tagName:c,attributes:u,unregisteredAttributes:d,boundaryClass:h,isEditableTree:p}));a(x)&&0===s(x).length&&l(x),x=r(f,"")})),0===e&&(u&&0===b&&u(_,x),d&&0===v&&d(_,x)),n===Om){const t=f[e];if(!t)continue;const{type:n,attributes:o,innerHTML:a}=t,s=sf(n);p||"script"!==n?!1===s?.contentEditable?(x=r(i(x),cf({...t,isEditableTree:p,boundaryClass:b===e&&v===e+1})),a&&r(x,{html:a})):x=r(i(x),cf({...t,object:!0,isEditableTree:p})):(x=r(i(x),cf({type:"script",isEditableTree:p})),r(x,{html:decodeURIComponent(o["data-rich-text-script"])})),x=r(i(x),"")}else t||"\n"!==n?a(x)?c(x,n):x=r(i(x),n):(x=r(i(x),{type:"br",attributes:p?{"data-rich-text-line-break":"true"}:void 0,object:!0}),x=r(i(x),""));u&&b===e+1&&u(_,x),d&&v===e+1&&d(_,x),y&&e===g.length&&(r(i(x),Fm),h&&0===g.length&&r(i(x),{type:"span",attributes:{"data-rich-text-placeholder":h,style:"pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;"}})),E=k,C=n}return _}function pf({value:e,preserveWhiteSpace:t}){return kf(df({value:e,preserveWhiteSpace:t,createEmpty:hf,append:ff,getLastChild:mf,getParent:bf,isText:vf,getText:yf,remove:_f,appendText:gf}).children)}function hf(){return{}}function mf({children:e}){return e&&e[e.length-1]}function ff(e,t){return"string"==typeof t&&(t={text:t}),t.parent=e,e.children=e.children||[],e.children.push(t),t}function gf(e,t){e.text+=t}function bf({parent:e}){return e}function vf({text:e}){return"string"==typeof e}function yf({text:e}){return e}function _f(e){const t=e.parent.children.indexOf(e);return-1!==t&&e.parent.children.splice(t,1),e}function kf(e=[]){return e.map((e=>void 0!==e.html?e.html:void 0===e.text?function({type:e,attributes:t,object:n,children:r}){let o="";for(const e in t)(0,od.$b)(e)&&(o+=` ${e}="${(0,od.kb)(t[e])}"`);return n?`<${e}${o}>`:`<${e}${o}>${kf(r)}</${e}>`}(e):(0,od.N2)(e.text))).join("")}var wf=n(85478);function Ef(e,t){return Km(e,t.type)?(t.title&&(0,wf.D)((0,$.sprintf)((0,$.__)("%s removed."),t.title),"assertive"),ef(e,t.type)):(t.title&&(0,wf.D)((0,$.sprintf)((0,$.__)("%s applied."),t.title),"assertive"),Mm(e,t))}function Cf(e,t,n){if(!e)return;const{ownerDocument:r}=e,{defaultView:o}=r,i=o.getSelection();if(!i)return;if(!i.rangeCount)return;const a=i.getRangeAt(0);if(!a||!a.startContainer)return;const s=function(e,t,n,r){let o=e.startContainer;if(o.nodeType===o.TEXT_NODE&&e.startOffset===o.length&&o.nextSibling)for(o=o.nextSibling;o.firstChild;)o=o.firstChild;if(o.nodeType!==o.ELEMENT_NODE&&(o=o.parentElement),!o)return;if(o===t)return;if(!t.contains(o))return;const i=n+(r?"."+r:"");for(;o!==t;){if(o.matches(i))return o;o=o.parentElement}}(a,e,t,n);return s||function(e,t){return{contextElement:t,getBoundingClientRect(){return t.contains(e.startContainer)?e.getBoundingClientRect():t.getBoundingClientRect()}}}(a,e)}function xf({editableContentElement:e,settings:t={}}){const{tagName:n,className:r}=t,[o,i]=(0,x.useState)((()=>Cf(e,n,r)));return(0,x.useLayoutEffect)((()=>{if(!e)return;const{ownerDocument:t}=e;function o(){i(Cf(e,n,r))}function a(){t.addEventListener("selectionchange",o)}function s(){t.removeEventListener("selectionchange",o)}return e===t.activeElement&&a(),e.addEventListener("focusin",a),e.addEventListener("focusout",s),s}),[e,n,r]),o}var Sf=n(92228);function If(e,t){const n=(0,x.useRef)();return(0,x.useCallback)((t=>{t?n.current=e(t):n.current&&n.current()}),t)}var Tf=n(36040);function Nf(e,t){return e===t||e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset}function Pf(e,t,n){const r=e.parentNode;let o=0;for(;e=e.previousSibling;)o++;return n=[o,...n],r!==t&&(n=Pf(r,t,n)),n}function Rf(e,t){for(t=[...t];e&&t.length>1;)e=e.childNodes[t.shift()];return{node:e,offset:t[0]}}function Af(e,t){if(void 0!==t.html)return e.innerHTML+=t.html;"string"==typeof t&&(t=e.ownerDocument.createTextNode(t));const{type:n,attributes:r}=t;if(n){t=e.ownerDocument.createElement(n);for(const e in r)t.setAttribute(e,r[e])}return e.appendChild(t)}function Bf(e,t){e.appendData(t)}function Lf({lastChild:e}){return e}function Mf({parentNode:e}){return e}function Df(e){return e.nodeType===e.TEXT_NODE}function Of({nodeValue:e}){return e}function Ff(e){return e.parentNode.removeChild(e)}function jf({value:e,current:t,prepareEditableTree:n,__unstableDomOnly:r,placeholder:o}){const{body:i,selection:a}=function({value:e,prepareEditableTree:t,isEditableTree:n=!0,placeholder:r,doc:o=document}){let i=[],a=[];t&&(e={...e,formats:t(e)});const s=df({value:e,createEmpty:()=>Dm(o,""),append:Af,getLastChild:Lf,getParent:Mf,isText:Df,getText:Of,remove:Ff,appendText:Bf,onStartIndex(e,t){i=Pf(t,e,[t.nodeValue.length])},onEndIndex(e,t){a=Pf(t,e,[t.nodeValue.length])},isEditableTree:n,placeholder:r});return{body:s,selection:{startPath:i,endPath:a}}}({value:e,prepareEditableTree:n,placeholder:o,doc:t.ownerDocument});Zf(i,t),void 0===e.start||r||function({startPath:e,endPath:t},n){const{node:r,offset:o}=Rf(n,e),{node:i,offset:a}=Rf(n,t),{ownerDocument:s}=n,{defaultView:l}=s,c=l.getSelection(),u=s.createRange();u.setStart(r,o),u.setEnd(i,a);const{activeElement:d}=s;if(c.rangeCount>0){if(Nf(u,c.getRangeAt(0)))return;c.removeAllRanges()}c.addRange(u),d!==s.activeElement&&d instanceof l.HTMLElement&&d.focus()}(a,t)}function Zf(e,t){let n,r=0;for(;n=e.firstChild;){const o=t.childNodes[r];if(o)if(o.isEqualNode(n))e.removeChild(n);else if(o.nodeName!==n.nodeName||o.nodeType===o.TEXT_NODE&&o.data!==n.data)t.replaceChild(n,o);else{const t=o.attributes,r=n.attributes;if(t){let e=t.length;for(;e--;){const{name:r}=t[e];n.getAttribute(r)||o.removeAttribute(r)}}if(r)for(let e=0;e<r.length;e++){const{name:t,value:n}=r[e];o.getAttribute(t)!==n&&o.setAttribute(t,n)}Zf(n,o),e.removeChild(n)}else t.appendChild(n);r++}for(;t.childNodes[r];)t.removeChild(t.childNodes[r])}function zf({record:e}){const t=(0,x.useRef)(),{activeFormats:n=[],replacements:r,start:o}=e.current,i=r[o];return(0,x.useEffect)((()=>{if(!(n&&n.length||i))return;const e="*[data-rich-text-format-boundary]",r=t.current.querySelector(e);if(!r)return;const{ownerDocument:o}=r,{defaultView:a}=o,s=`.rich-text:focus ${e} {background-color: ${a.getComputedStyle(r).color.replace(")",", 0.2)").replace("rgb","rgba")}}`,l="rich-text-boundary-style";let c=o.getElementById(l);c||(c=o.createElement("style"),c.id=l,o.head.appendChild(c)),c.innerHTML!==s&&(c.innerHTML=s)}),[n,i]),t}function Vf(e){const t=(0,x.useRef)(e);return t.current=e,If((e=>{function n(n){const{record:r,preserveWhiteSpace:o}=t.current,{ownerDocument:i}=e;if(Xm(r.current)||!e.contains(i.activeElement))return;const a=of(r.current),s=Ym(a),l=pf({value:a,preserveWhiteSpace:o});n.clipboardData.setData("text/plain",s),n.clipboardData.setData("text/html",l),n.clipboardData.setData("rich-text","true"),n.preventDefault(),"cut"===n.type&&i.execCommand("delete")}return e.addEventListener("copy",n),e.addEventListener("cut",n),()=>{e.removeEventListener("copy",n),e.removeEventListener("cut",n)}}),[])}var Hf=n(13368);const Uf=[];function $f(e){const[,t]=(0,x.useReducer)((()=>({}))),n=(0,x.useRef)(e);return n.current=e,If((e=>{function r(r){const{keyCode:o,shiftKey:i,altKey:a,metaKey:s,ctrlKey:l}=r;if(i||a||s||l||o!==Hf.RL&&o!==Hf.pX)return;const{record:c,applyRecord:u}=n.current,{text:d,formats:p,start:h,end:m,activeFormats:f=[]}=c.current,g=Xm(c.current),{ownerDocument:b}=e,{defaultView:v}=b,{direction:y}=v.getComputedStyle(e),_="rtl"===y?Hf.pX:Hf.RL,k=r.keyCode===_;if(g&&0===f.length){if(0===h&&k)return;if(m===d.length&&!k)return}if(!g)return;const w=p[h-1]||Uf,E=p[h]||Uf,C=k?w:E,x=f.every(((e,t)=>e===C[t]));let S=f.length;if(x?S<C.length&&S++:S--,S===f.length)return void(c.current._newActiveFormats=C);r.preventDefault();const I=(x?C:k?E:w).slice(0,S),T={...c.current,activeFormats:I};c.current=T,u(T),t()}return e.addEventListener("keydown",r),()=>{e.removeEventListener("keydown",r)}}),[])}const Wf=new Set(["insertParagraph","insertOrderedList","insertUnorderedList","insertHorizontalRule","insertLink"]),Gf=[],qf="data-rich-text-placeholder";function Kf(e){const t=(0,x.useRef)(e);return t.current=e,If((e=>{const{ownerDocument:n}=e,{defaultView:r}=n;let o=!1;function i(e){if(o)return;let n;e&&(n=e.inputType);const{record:r,applyRecord:i,createRecord:a,handleChange:s}=t.current;if(n&&(0===n.indexOf("format")||Wf.has(n)))return void i(r.current);const l=a(),{start:c,activeFormats:u=[]}=r.current,d=function({value:e,start:t,end:n,formats:r}){const o=Math.min(t,n),i=Math.max(t,n),a=e.formats[o-1]||[],s=e.formats[i]||[];for(e.activeFormats=r.map(((e,t)=>{if(a[t]){if(Am(e,a[t]))return a[t]}else if(s[t]&&Am(e,s[t]))return s[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:u});s(d)}function a(){const{record:a,applyRecord:s,createRecord:l,onSelectionChange:c}=t.current;if("true"!==e.contentEditable)return;if(n.activeElement!==e){if("true"!==n.activeElement.contentEditable)return;if(!n.activeElement.contains(e))return;const t=r.getSelection(),{anchorNode:o,focusNode:i}=t;if(e.contains(o)&&e!==o&&e.contains(i)&&e!==i){const{start:e,end:t}=l();a.current.activeFormats=Gf,c(e,t)}else if(e.contains(o)&&e!==o){const{start:e,end:t=e}=l();a.current.activeFormats=Gf,c(t)}else if(e.contains(i)){const{start:e,end:t=e}=l();a.current.activeFormats=Gf,c(void 0,t)}return}if(o)return;const{start:u,end:d,text:p}=l(),h=a.current;if(p!==h.text)return void i();if(u===h.start&&d===h.end)return void(0===h.text.length&&0===u&&function(e){const t=e.getSelection(),{anchorNode:n,anchorOffset:r}=t;if(n.nodeType!==n.ELEMENT_NODE)return;const o=n.childNodes[r];o&&o.nodeType===o.ELEMENT_NODE&&o.hasAttribute(qf)&&t.collapseToStart()}(r));const m={...h,start:u,end:d,activeFormats:h._newActiveFormats,_newActiveFormats:void 0},f=qm(m,Gf);m.activeFormats=f,a.current=m,s(m,{domOnly:!0}),c(u,d)}function s(){o=!0,n.removeEventListener("selectionchange",a),e.querySelector(`[${qf}]`)?.remove()}function l(){o=!1,i({inputType:"insertText"}),n.addEventListener("selectionchange",a)}function c(){const{record:n,isSelected:r,onSelectionChange:o,applyRecord:i}=t.current;if(!e.parentElement.closest('[contenteditable="true"]'))if(r)i(n.current),o(n.current.start,n.current.end);else{const e=void 0;n.current={...n.current,start:e,end:e,activeFormats:Gf}}}return e.addEventListener("input",i),e.addEventListener("compositionstart",s),e.addEventListener("compositionend",l),e.addEventListener("focus",c),n.addEventListener("selectionchange",a),()=>{e.removeEventListener("input",i),e.removeEventListener("compositionstart",s),e.removeEventListener("compositionend",l),e.removeEventListener("focus",c),n.removeEventListener("selectionchange",a)}}),[])}function Yf(e){const t=(0,x.useRef)(e);return t.current=e,If((e=>{function n(e){const{keyCode:n}=e,{createRecord:r,handleChange:o}=t.current;if(e.defaultPrevented)return;if(n!==Hf.yY&&n!==Hf.ZH)return;const i=r(),{start:a,end:s,text:l}=i;0===a&&0!==s&&s===l.length&&(o(rf(i)),e.preventDefault())}return e.addEventListener("keydown",n),()=>{e.removeEventListener("keydown",n)}}),[])}function Xf(e){const{__unstablePreserveWhiteSpace:t}=e;return{preserveWhiteSpace:t}}function Jf(e,t,n="asc"){return e.concat().sort(((e,t,n)=>(r,o)=>{let i,a;if("function"==typeof e?(i=e(r),a=e(o)):(i=r[e],a=o[e]),i>a)return"asc"===n?1:-1;if(a>i)return"asc"===n?-1:1;const s=t.findIndex((e=>e===r)),l=t.findIndex((e=>e===o));return s>l?1:l>s?-1:0})(t,e,n))}const Qf=[],eg=new Set;function tg(e,t){const n=e.blocks.byClientId.get(t),r="core/social-link";if("web"!==wm.Z.OS&&n?.name===r){const n=e.blocks.attributes.get(t),{service:o}=null!=n?n:{};return o?`${r}-${o}`:r}return n?n.name:null}function ng(e,t){const n=e.blocks.byClientId.get(t);return!!n&&n.isValid}function rg(e,t){return e.blocks.byClientId.get(t)?e.blocks.attributes.get(t):null}function og(e,t){return e.blocks.byClientId.has(t)?e.blocks.tree.get(t):null}const ig=(0,La.Z)(((e,t)=>e.blocks.byClientId.has(t)?{...e.blocks.byClientId.get(t),attributes:rg(e,t)}:null),((e,t)=>[e.blocks.byClientId.get(t),e.blocks.attributes.get(t)]));function ag(e,t){const n=t&&rv(e,t)?"controlled||"+t:t||"";return e.blocks.tree.get(n)?.innerBlocks||Qf}const sg=(0,La.Z)(((e,t)=>((0,q.Z)("wp.data.select( 'core/block-editor' ).__unstableGetClientIdWithClientIdsTree",{since:"6.3",version:"6.5"}),{clientId:t,innerBlocks:lg(e,t)})),(e=>[e.blocks.order])),lg=(0,La.Z)(((e,t="")=>((0,q.Z)("wp.data.select( 'core/block-editor' ).__unstableGetClientIdsTree",{since:"6.3",version:"6.5"}),qg(e,t).map((t=>sg(e,t))))),(e=>[e.blocks.order])),cg=(0,La.Z)(((e,t)=>{const n=Array.isArray(t)?t:[t],r=[];for(const t of n)for(const n of qg(e,t))r.push(n,...cg(e,n));return r}),(e=>[e.blocks.order])),ug=(0,La.Z)((e=>{const t=[];for(const n of qg(e))t.push(n,...cg(e,n));return t}),(e=>[e.blocks.order])),dg=(0,La.Z)(((e,t)=>{const n=ug(e);return t?n.reduce(((n,r)=>e.blocks.byClientId.get(r).name===t?n+1:n),0):n.length}),(e=>[e.blocks.order,e.blocks.byClientId])),pg=(0,La.Z)(((e,t)=>{if(!t)return Qf;const n=Array.isArray(t)?t:[t],r=ug(e).filter((t=>{const r=e.blocks.byClientId.get(t);return n.includes(r.name)}));return r.length>0?r:Qf}),(e=>[e.blocks.order,e.blocks.byClientId])),hg=(0,La.Z)(((e,t)=>(Array.isArray(t)?t:[t]).map((t=>og(e,t)))),((e,t)=>(Array.isArray(t)?t:[t]).map((t=>e.blocks.tree.get(t))))),mg=(0,La.Z)(((e,t)=>hg(e,t).filter(Boolean).map((e=>e.name))),((e,t)=>hg(e,t)));function fg(e,t){return qg(e,t).length}function gg(e){return e.selection.selectionStart}function bg(e){return e.selection.selectionEnd}function vg(e){return e.selection.selectionStart.clientId}function yg(e){return e.selection.selectionEnd.clientId}function _g(e){return Lg(e).length||(e.selection.selectionStart.clientId?1:0)}function kg(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function wg(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:r}=t;return r&&r===n.clientId?r:null}function Eg(e){const t=wg(e);return t?og(e,t):null}function Cg(e,t){return e.blocks.parents.has(t)?e.blocks.parents.get(t):null}const xg=(0,La.Z)(((e,t,n=!1)=>{const r=[];let o=t;for(;e.blocks.parents.get(o);)o=e.blocks.parents.get(o),r.push(o);return r.length?n?r:r.reverse():Qf}),(e=>[e.blocks.parents])),Sg=(0,La.Z)(((e,t,n,r=!1)=>{const o=xg(e,t,r),i=Array.isArray(n)?e=>n.includes(e):e=>n===e;return o.filter((t=>i(tg(e,t))))}),(e=>[e.blocks.parents]));function Ig(e,t){let n,r=t;do{n=r,r=e.blocks.parents.get(r)}while(r);return n}function Tg(e,t){const n=wg(e),r=[...xg(e,t),t],o=[...xg(e,n),n];let i;const a=Math.min(r.length,o.length);for(let e=0;e<a&&r[e]===o[e];e++)i=r[e];return i}function Ng(e,t,n=1){if(void 0===t&&(t=wg(e)),void 0===t&&(t=n<0?Dg(e):Og(e)),!t)return null;const r=Cg(e,t);if(null===r)return null;const{order:o}=e.blocks,i=o.get(r),a=i.indexOf(t)+1*n;return a<0||a===i.length?null:i[a]}function Pg(e,t){return Ng(e,t,-1)}function Rg(e,t){return Ng(e,t,1)}function Ag(e){return e.initialPosition}const Bg=(0,La.Z)((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(!t.clientId||!n.clientId)return Qf;if(t.clientId===n.clientId)return[t.clientId];const r=Cg(e,t.clientId);if(null===r)return Qf;const o=qg(e,r),i=o.indexOf(t.clientId),a=o.indexOf(n.clientId);return i>a?o.slice(a,i+1):o.slice(i,a+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Lg(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?Qf:Bg(e)}const Mg=(0,La.Z)((e=>{const t=Lg(e);return t.length?t.map((t=>og(e,t))):Qf}),(e=>[...Bg.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Dg(e){return Lg(e)[0]||null}function Og(e){const t=Lg(e);return t[t.length-1]||null}function Fg(e,t){return Dg(e)===t}function jg(e,t){return-1!==Lg(e).indexOf(t)}const Zg=(0,La.Z)(((e,t)=>{let n=t,r=!1;for(;n&&!r;)n=Cg(e,n),r=jg(e,n);return r}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function zg(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function Vg(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Hg(e){const t=gg(e),n=bg(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Ug(e){const t=gg(e),n=bg(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function $g(e){return Bg(e).some((t=>!sc(tg(e,t)).merge))}function Wg(e,t){const n=gg(e),r=bg(e);if(n.clientId===r.clientId)return!1;if(!n.attributeKey||!r.attributeKey||void 0===n.offset||void 0===r.offset)return!1;const o=Cg(e,n.clientId);if(o!==Cg(e,r.clientId))return!1;const i=qg(e,o);let a,s;i.indexOf(n.clientId)>i.indexOf(r.clientId)?(a=r,s=n):(a=n,s=r);const l=t?s.clientId:a.clientId,c=t?a.clientId:s.clientId,u=tg(e,l);if(!sc(u).merge)return!1;const d=og(e,c);if(d.name===u)return!0;const p=xc(d,u);return p&&p.length}const Gg=e=>{const t=gg(e),n=bg(e);if(t.clientId===n.clientId)return Qf;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return Qf;const r=Cg(e,t.clientId);if(r!==Cg(e,n.clientId))return Qf;const o=qg(e,r),i=o.indexOf(t.clientId),a=o.indexOf(n.clientId),[s,l]=i>a?[n,t]:[t,n],c=og(e,s.clientId),u=sc(c.name),d=og(e,l.clientId),p=sc(d.name),h=c.attributes[s.attributeKey],m=d.attributes[l.attributeKey],f=u.attributes[s.attributeKey],g=p.attributes[l.attributeKey];let b=Zm({html:h,...Xf(f)}),v=Zm({html:m,...Xf(g)});return b=rf(b,0,s.offset),v=rf(v,l.offset,v.text.length),[{...c,attributes:{...c.attributes,[s.attributeKey]:pf({value:b,...Xf(f)})}},{...d,attributes:{...d.attributes,[l.attributeKey]:pf({value:v,...Xf(g)})}}]};function qg(e,t){return e.blocks.order.get(t||"")||Qf}function Kg(e,t){return qg(e,Cg(e,t)).indexOf(t)}function Yg(e,t){const{selectionStart:n,selectionEnd:r}=e.selection;return n.clientId===r.clientId&&n.clientId===t}function Xg(e,t,n=!1){return qg(e,t).some((t=>Yg(e,t)||jg(e,t)||n&&Xg(e,t,n)))}function Jg(e,t,n=!1){return qg(e,t).some((t=>sb(e,t)||n&&Jg(e,t,n)))}function Qg(e,t){if(!t)return!1;const n=Lg(e),r=n.indexOf(t);return r>-1&&r<n.length-1}function eb(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function tb(e){return e.isMultiSelecting}function nb(e){return e.isSelectionEnabled}function rb(e,t){return e.blocksMode[t]||"visual"}function ob(e){return e.isTyping}function ib(e){return!!e.draggedBlocks.length}function ab(e){return e.draggedBlocks}function sb(e,t){return e.draggedBlocks.includes(t)}function lb(e,t){return!!ib(e)&&xg(e,t).some((t=>sb(e,t)))}function cb(){return(0,q.Z)('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}const ub=(0,La.Z)((e=>{let t,n;const{insertionPoint:r,selection:{selectionEnd:o}}=e;if(null!==r)return r;const{clientId:i}=o;return i?(t=Cg(e,i)||void 0,n=Kg(e,o.clientId)+1):n=qg(e).length,{rootClientId:t,index:n}}),(e=>[e.insertionPoint,e.selection.selectionEnd.clientId,e.blocks.parents,e.blocks.order]));function db(e){return null!==e.insertionPoint}function pb(e){return e.template.isValid}function hb(e){return e.settings.template}function mb(e,t){var n,r;return t?null!==(n=Ub(e,t)?.templateLock)&&void 0!==n&&n:null!==(r=e.settings.templateLock)&&void 0!==r&&r}const fb=(e,t,n=null)=>"boolean"==typeof e?e:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n,gb=(e,t,n=null)=>{let r;if(t&&"object"==typeof t?(r=t,t=r.name):r=sc(t),!r)return!1;const{allowedBlockTypes:o}=$b(e);if(!fb(o,t,!0))return!1;if(mb(e,n))return!1;if("disabled"===pv(e,null!=n?n:""))return!1;const i=Ub(e,n);if(n&&void 0===i)return!1;const a=i?.allowedBlocks,s=fb(a,t),l=r.parent,c=tg(e,n),u=fb(l,c);let d=!0;const p=r.ancestor;p&&(d=[n,...xg(e,n)].some((t=>fb(p,tg(e,t)))));const h=d&&(null===s&&null===u||!0===s||!0===u);return h?(0,mc.applyFilters)("blockEditor.__unstableCanInsertBlockType",h,r,n,{getBlock:og.bind(null,e),getBlockParentsByBlockName:Sg.bind(null,e)}):h},bb=(0,La.Z)(gb,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId.get(n),e.settings.allowedBlockTypes,e.settings.templateLock,e.blockEditingModes]));function vb(e,t,n=null){return t.every((t=>bb(e,tg(e,t),n)))}function yb(e,t,n=null){const r=rg(e,t);return null===r||(void 0!==r.lock?.remove?!r.lock.remove:!mb(e,n)&&"disabled"!==pv(e,n))}function _b(e,t,n=null){return t.every((t=>yb(e,t,n)))}function kb(e,t,n=null){const r=rg(e,t);return null===r||(void 0!==r.lock?.move?!r.lock.move:"all"!==mb(e,n)&&"disabled"!==pv(e,n))}function wb(e,t,n=null){return t.every((t=>kb(e,t,n)))}function Eb(e,t){const n=rg(e,t);if(null===n)return!0;const{lock:r}=n;return!r?.edit}function Cb(e,t){return!!uc(t,"lock",!0)&&!!e.settings?.canLockBlocks}function xb(e,t){var n;return null!==(n=e.preferences.insertUsage?.[t])&&void 0!==n?n:null}const Sb=(e,t,n)=>!!uc(t,"inserter",!0)&&gb(e,t.name,n),Ib=(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}},Tb=(e,{buildScope:t="inserter"})=>n=>{const r=n.name;let o=!1;uc(n.name,"multiple",!0)||(o=hg(e,ug(e)).some((({name:e})=>e===n.name)));const{time:i,count:a=0}=xb(e,r)||{},s={id:r,name:n.name,title:n.title,icon:n.icon,isDisabled:o,frecency:Ib(i,a)};if("transform"===t)return s;const l=hc(n.name,"inserter");return{...s,initialAttributes:{},description:n.description,category:n.category,keywords:n.keywords,variations:l,example:n.example,utility:1}},Nb=(0,La.Z)(((e,t=null)=>{const n=gb(e,"core/block",t)?Xb(e).map((t=>{const n=t.wp_pattern_sync_status?Em.Z:{src:Em.Z,foreground:"var(--wp-block-synced-color)"},r=`core/block/${t.id}`,{time:o,count:i=0}=xb(e,r)||{},a=Ib(o,i);return{id:r,name:"core/block",initialAttributes:{ref:t.id},title:t.title?.raw,icon:n,category:"reusable",keywords:["reusable"],isDisabled:!1,utility:1,frecency:a,content:t.content.raw,syncStatus:t.wp_pattern_sync_status}})):[],r=Tb(e,{buildScope:"inserter"}),o=lc().filter((n=>Sb(e,n,t))).map(r).reduce(((t,n)=>{const{variations:r=[]}=n;if(r.some((({isDefault:e})=>e))||t.push(n),r.length){const o=((e,t)=>n=>{const r=`${t.id}/${n.name}`,{time:o,count:i=0}=xb(e,r)||{};return{...t,id:r,icon:n.icon||t.icon,title:n.title||t.title,description:n.description||t.description,category:n.category||t.category,example:n.hasOwnProperty("example")?n.example:t.example,initialAttributes:{...t.initialAttributes,...n.attributes},innerBlocks:n.innerBlocks,keywords:n.keywords||t.keywords,frecency:Ib(o,i)}})(e,n);t.push(...r.map(o))}return t}),[]),{core:i,noncore:a}=o.reduce(((e,t)=>{const{core:n,noncore:r}=e;return(t.name.startsWith("core/")?n:r).push(t),e}),{core:[],noncore:[]});return[...i,...a,...n]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,Xb(e),lc()])),Pb=(0,La.Z)(((e,t,n=null)=>{const r=Array.isArray(t)?t:[t],o=Tb(e,{buildScope:"transform"}),i=lc().filter((t=>Sb(e,t,n))).map(o),a=Object.fromEntries(Object.entries(i).map((([,e])=>[e.name,e]))),s=function(e){if(!e.length)return[];const t=(e=>e.length?lc().filter((t=>!!wc(Ec("from",t.name),(t=>yc(t,"from",e))))):[])(e),n=(e=>{if(!e.length)return[];const t=sc(e[0].name);return(t?Ec("to",t.name):[]).filter((t=>t&&yc(t,"to",e))).map((e=>e.blocks)).flat().map(sc)})(e);return[...new Set([...t,...n])]}(r).reduce(((e,t)=>(a[t?.name]&&e.push(a[t.name]),e)),[]);return Jf(s,(e=>a[e.name].frecency),"desc")}),((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,lc()])),Rb=(0,La.Z)(((e,t=null)=>!!lc().some((n=>Sb(e,n,t)))||gb(e,"core/block",t)&&Xb(e).length>0),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Xb(e),lc()])),Ab=(0,La.Z)(((e,t=null)=>{if(t)return[...lc().filter((n=>Sb(e,n,t))),...gb(e,"core/block",t)&&Xb(e).length>0?["core/block"]:[]]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Xb(e),lc()])),Bb=(0,La.Z)(((e,t=null)=>((0,q.Z)('wp.data.select( "core/block-editor" ).__experimentalGetAllowedBlocks',{alternative:'wp.data.select( "core/block-editor" ).getAllowedBlocks',since:"6.2",version:"6.4"}),Ab(e,t))),((e,t)=>[...Ab.getDependants(e,t)])),Lb=(0,La.Z)(((e,t=null)=>{if(!t)return;const n=e.blockListSettings[t]?.defaultBlock,r=e.blockListSettings[t]?.directInsert;return n&&r?"function"==typeof r?r(og(e,t))?n:null:n:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree.get(t)])),Mb=(0,La.Z)(((e,t=null)=>((0,q.Z)('wp.data.select( "core/block-editor" ).__experimentalGetDirectInsertBlock',{alternative:'wp.data.select( "core/block-editor" ).getDirectInsertBlock',since:"6.3",version:"6.4"}),Lb(e,t))),((e,t)=>[e.blockListSettings[t],e.blocks.tree.get(t)]));function Db(e){var t,n;const r=null!==(t=e?.settings?.__experimentalReusableBlocks)&&void 0!==t?t:Qf,o=null!==(n=e?.settings?.__experimentalUserPatternCategories)&&void 0!==n?n:[],i=new Map;return o.forEach((e=>i.set(e.id,e))),r.map((e=>({name:`core/block/${e.id}`,id:e.id,type:"user",title:e.title.raw,categories:e.wp_pattern_category.map((e=>i&&i.get(e)?i.get(e).slug:e)),content:e.content.raw,syncStatus:e.wp_pattern_sync_status})))}const Ob=(0,La.Z)((e=>e?.settings?.__experimentalUserPatternCategories),(e=>[e.settings.__experimentalUserPatternCategories])),Fb=(0,La.Z)(((e,t)=>{const n=[...e.settings.__experimentalBlockPatterns,...Db(e)].find((({name:e})=>e===t));return n?{...n,blocks:Lp(n.content,{__unstableSkipMigrationLogs:!0})}:null}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.__experimentalReusableBlocks,e?.settings?.__experimentalUserPatternCategories])),jb=(0,La.Z)((e=>{const t=e.settings.__experimentalBlockPatterns,n=Db(e),{allowedBlockTypes:r}=$b(e),o=[...n,...t].filter((({inserter:e=!0})=>!!e)).map((({name:t})=>Fb(e,t))),i=o.filter((({blocks:e})=>((e,t)=>{if("boolean"==typeof t)return t;const n=[...e];for(;n.length>0;){const e=n.shift();if(!fb(t,e.name||e.blockName,!0))return!1;e.innerBlocks?.forEach((e=>{n.push(e)}))}return!0})(e,r)));return i}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.__experimentalReusableBlocks,e.settings.allowedBlockTypes,e?.settings?.__experimentalUserPatternCategories])),Zb=(0,La.Z)(((e,t=null)=>{const n=jb(e).filter((({blocks:n})=>n.every((({name:n})=>bb(e,n,t)))));return n}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.__experimentalReusableBlocks,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId.get(t)])),zb=(0,La.Z)(((e,t,n=null)=>{if(!t)return Qf;const r=Zb(e,n),o=Array.isArray(t)?t:[t],i=r.filter((e=>e?.blockTypes?.some?.((e=>o.includes(e)))));return 0===i.length?Qf:i}),((e,t,n)=>[...Zb.getDependants(e,n)])),Vb=(0,La.Z)(((e,t,n=null)=>((0,q.Z)('wp.data.select( "core/block-editor" ).__experimentalGetPatternsByBlockTypes',{alternative:'wp.data.select( "core/block-editor" ).getPatternsByBlockTypes',since:"6.2",version:"6.4"}),zb(e,t,n))),((e,t,n)=>[...Zb.getDependants(e,n)])),Hb=(0,La.Z)(((e,t,n=null)=>{if(!t)return Qf;if(t.some((({clientId:t,innerBlocks:n})=>n.length||rv(e,t))))return Qf;const r=Array.from(new Set(t.map((({name:e})=>e))));return zb(e,r,n)}),((e,t,n)=>[...zb.getDependants(e,n)]));function Ub(e,t){return e.blockListSettings[t]}function $b(e){return e.settings}function Wb(e){return e.blocks.isPersistentChange}const Gb=(0,La.Z)(((e,t=[])=>t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})),(e=>[e.blockListSettings])),qb=(0,La.Z)(((e,t)=>{const n=Xb(e).find((e=>e.id===t));return n?n.title?.raw:null}),(e=>[Xb(e)]));function Kb(e){return e.blocks.isIgnoredChange}function Yb(e){return e.lastBlockAttributesChange}function Xb(e){var t;return null!==(t=e?.settings?.__experimentalReusableBlocks)&&void 0!==t?t:Qf}function Jb(e){return"navigation"===e.editorMode}function Qb(e){return e.editorMode}function ev(e){return e.hasBlockMovingClientId}function tv(e){return!!e.automaticChangeStatus}function nv(e,t){return e.highlightedBlock===t}function rv(e,t){return!!e.blocks.controlledInnerBlocks[t]}const ov=(0,La.Z)(((e,t)=>{if(!t.length)return null;const n=wg(e);if(t.includes(tg(e,n)))return n;const r=Lg(e),o=Sg(e,n||r[0],t);return o?o[o.length-1]:null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function iv(e,t,n){const{lastBlockInserted:r}=e;return r.clientIds?.includes(t)&&r.source===n}function av(e,t){var n;return null===(n=e.blockVisibility?.[t])||void 0===n||n}const sv=(0,La.Z)((e=>{const t=new Set(Object.keys(e.blockVisibility).filter((t=>e.blockVisibility[t])));return 0===t.size?eg:t}),(e=>[e.blockVisibility])),lv=(0,La.Z)(((e,t)=>{let n,r=t;for(;e.blocks.parents.has(r);)r=e.blocks.parents.get(r),r&&"contentOnly"===mb(e,r)&&(n=r);return n}),(e=>[e.blocks.parents,e.blockListSettings]));function cv(e){return e.temporarilyEditingAsBlocks}function uv(e,t){if("default"!==pv(e,t))return!1;if(!Eb(e,t))return!0;const n=Qb(e);if("zoom-out"===n&&t&&!Cg(e,t))return!0;const r=uc(tg(e,t),"__experimentalDisableBlockOverlay",!1);return("navigation"===n||!r&&rv(e,t))&&!Yg(e,t)&&!Xg(e,t,!0)}function dv(e,t){let n=e.blocks.parents.get(t);for(;n;){if(uv(e,n))return!0;n=e.blocks.parents.get(n)}return!1}const pv=(0,Ma.M)((e=>(t,n="")=>{if(t.blockEditingModes.has(n))return t.blockEditingModes.get(n);if(!n)return"default";const r=Cg(t,n);if("contentOnly"===mb(t,r)){const r=tg(t,n);return e(Vu).__experimentalHasContentRoleAttribute(r)?"contentOnly":"disabled"}const o=pv(t,r);return"contentOnly"===o?"default":o})),hv=(0,Ma.M)((e=>(t,n="")=>{const r=n||wg(t);if(!r)return!1;const{getGroupingBlockName:o}=e(Vu),i=og(t,r),a=o();return i&&(i.name===a||sc(i.name)?.transforms?.ungroup)&&!!i.innerBlocks.length&&yb(t,r)})),mv=(0,Ma.M)((e=>(t,n=Qf)=>{const{getGroupingBlockName:r}=e(Vu),o=r(),i=n?.length?n:Bg(t),a=i?.length?Cg(t,i[0]):void 0;return bb(t,o,a)&&i.length&&_b(t,i,a)})),fv=["inserterMediaCategories","blockInspectorAnimation"];function gv(e,{stripExperimentalSettings:t=!1,reset:n=!1}={}){let r=e;if(t&&"web"===wm.Z.OS){r={};for(const t in e)fv.includes(t)||(r[t]=e[t])}return{type:"UPDATE_SETTINGS",settings:r,reset:n}}function bv(){return{type:"HIDE_BLOCK_INTERFACE"}}function vv(){return{type:"SHOW_BLOCK_INTERFACE"}}const yv=(e,t=!0,n=!1)=>({select:r,dispatch:o,registry:i})=>{if(!e||!e.length)return;var a;a=e,e=Array.isArray(a)?a:[a];const s=r.getBlockRootClientId(e[0]);if(!r.canRemoveBlocks(e,s))return;const l=!n&&r.getBlockRemovalRules();if(l){const n=new Set,i=[...e];for(;i.length;){const e=i.shift(),t=r.getBlockName(e);l[t]&&n.add(t);const o=r.getBlockOrder(e);i.push(...o)}if(n.size)return void o(function(e,t,n){return{type:"DISPLAY_BLOCK_REMOVAL_PROMPT",clientIds:e,selectPrevious:t,blockNamesForPrompt:n}}(e,t,Array.from(n)))}t&&o.selectPreviousBlock(e[0],t),i.batch((()=>{o({type:"REMOVE_BLOCKS",clientIds:e}),o(_v())}))},_v=()=>({select:e,dispatch:t})=>{if(e.getBlockCount()>0)return;const{__unstableHasCustomAppender:n}=e.getSettings();n||t.insertDefaultBlock()};function kv(){return{type:"CLEAR_BLOCK_REMOVAL_PROMPT"}}function wv(e=!1){return{type:"SET_BLOCK_REMOVAL_RULES",rules:e}}function Ev(e){return{type:"SET_OPENED_BLOCK_SETTINGS_MENU",clientId:e}}function Cv(e,t){return{type:"SET_STYLE_OVERRIDE",id:e,style:t}}function xv(e){return{type:"DELETE_STYLE_OVERRIDE",id:e}}function Sv(e){return e.isBlockInterfaceHidden}function Iv(e){return e?.lastBlockInserted?.clientIds}const Tv=(0,La.Z)(((e,t)=>{const n=t=>"disabled"===pv(e,t)&&qg(e,t).every(n);return"disabled"===pv(e,t)&&qg(e,t).every(n)}),(e=>[e.blocks.parents,e.blocks.order,e.blockEditingModes,e.blockListSettings])),Nv=(0,La.Z)(((e,t="")=>qg(e,t).flatMap((t=>"disabled"!==pv(e,t)?[{clientId:t,innerBlocks:Nv(e,t)}]:Nv(e,t)))),(e=>[e.blocks.order,e.blockEditingModes,e.settings.templateLock,e.blockListSettings])),Pv=(0,La.Z)(((e,t,n=!1)=>xg(e,t,n).filter((t=>"disabled"!==pv(e,t)))),(e=>[e.blocks.parents,e.blockEditingModes,e.settings.templateLock,e.blockListSettings]));function Rv(e){return e.removalPromptData}function Av(e){return e.blockRemovalRules}function Bv(e){return e.openedBlockSettingsMenu}function Lv(e){return e.styleOverrides}function Mv(e){return e.registeredInserterMediaCategories}const Dv=(0,La.Z)((e=>{const{settings:{inserterMediaCategories:t,allowedMimeTypes:n,enableOpenverseMediaCategory:r},registeredInserterMediaCategories:o}=e;if(!t&&!o.length||!n)return;const i=t?.map((({name:e})=>e))||[],a=[...t||[],...(o||[]).filter((({name:e})=>!i.includes(e)))];return a.filter((e=>!(!r&&"openverse"===e.name)&&Object.values(n).some((t=>t.startsWith(`${e.mediaType}/`)))))}),(e=>[e.settings.inserterMediaCategories,e.settings.allowedMimeTypes,e.settings.enableOpenverseMediaCategory,e.registeredInserterMediaCategories])),Ov="";function Fv(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return"string"==typeof n&&-1!==n.indexOf(Ov)}))}const jv=e=>Array.isArray(e)?e:[e],Zv=e=>({dispatch:t})=>{t({type:"RESET_BLOCKS",blocks:e}),t(zv(e))},zv=e=>({select:t,dispatch:n})=>{const r=t.getTemplate(),o=t.getTemplateLock(),i=!r||"all"!==o||Uh(e,r);if(i!==t.isValidTemplate())return n.setTemplateValidity(i),i};function Vv(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function Hv(e){return(0,q.Z)('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function Uv(e,t,n=!1){return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:jv(e),attributes:t,uniqueByBlock:n}}function $v(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function Wv(e,t=0){return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const Gv=(e,t=!1)=>({select:n,dispatch:r})=>{const o=n.getPreviousBlockClientId(e);if(o)r.selectBlock(o,-1);else if(t){const t=n.getBlockRootClientId(e);t&&r.selectBlock(t,-1)}},qv=e=>({select:t,dispatch:n})=>{const r=t.getNextBlockClientId(e);r&&n.selectBlock(r)};function Kv(){return{type:"START_MULTI_SELECT"}}function Yv(){return{type:"STOP_MULTI_SELECT"}}const Xv=(e,t,n=0)=>({select:r,dispatch:o})=>{if(r.getBlockRootClientId(e)!==r.getBlockRootClientId(t))return;o({type:"MULTI_SELECT",start:e,end:t,initialPosition:n});const i=r.getSelectedBlockCount();(0,wf.D)((0,$.sprintf)((0,$._n)("%s block selected.","%s blocks selected.",i),i),"assertive")};function Jv(){return{type:"CLEAR_SELECTED_BLOCK"}}function Qv(e=!0){return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function ey(e,t){var n;const r=null!==(n=t?.__experimentalPreferredStyleVariations?.value)&&void 0!==n?n:{};return e.map((e=>{const t=e.name;if(!uc(t,"defaultStylePicker",!0))return e;if(!r[t])return e;const n=e.attributes?.className;if(n?.includes("is-style-"))return e;const{attributes:o={}}=e,i=r[t];return{...e,attributes:{...o,className:`${n||""} is-style-${i}`.trim()}}}))}const ty=(e,t,n,r=0,o)=>({select:i,dispatch:a,registry:s})=>{e=jv(e),t=ey(jv(t),i.getSettings());const l=i.getBlockRootClientId(e[0]);for(let e=0;e<t.length;e++){const n=t[e];if(!i.canInsertBlockType(n.name,l))return}s.batch((()=>{a({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:r,meta:o}),a.ensureDefaultBlock()}))};function ny(e,t){return ty(e,t)}const ry=e=>(t,n)=>({select:r,dispatch:o})=>{r.canMoveBlocks(t,n)&&o({type:e,clientIds:jv(t),rootClientId:n})},oy=ry("MOVE_BLOCKS_DOWN"),iy=ry("MOVE_BLOCKS_UP"),ay=(e,t="",n="",r)=>({select:o,dispatch:i})=>{if(o.canMoveBlocks(e,t)){if(t!==n){if(!o.canRemoveBlocks(e,t))return;if(!o.canInsertBlocks(e,n))return}i({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:r})}};function sy(e,t="",n="",r){return ay([e],t,n,r)}function ly(e,t,n,r,o){return cy([e],t,n,r,0,o)}const cy=(e,t,n,r=!0,o=0,i)=>({select:a,dispatch:s})=>{null!==o&&"object"==typeof o&&(i=o,o=0,(0,q.Z)("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=ey(jv(e),a.getSettings());const l=[];for(const t of e)a.canInsertBlockType(t.name,n)&&l.push(t);l.length&&s({type:"INSERT_BLOCKS",blocks:l,index:t,rootClientId:n,time:Date.now(),updateSelection:r,initialPosition:r?o:null,meta:i})};function uy(e,t,n={}){const{__unstableWithInserter:r,operation:o}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:r,operation:o}}const dy=()=>({select:e,dispatch:t})=>{e.isBlockInsertionPointVisible()&&t({type:"HIDE_INSERTION_POINT"})};function py(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const hy=()=>({select:e,dispatch:t})=>{t({type:"SYNCHRONIZE_TEMPLATE"});const n=$h(e.getBlocks(),e.getTemplate());t.resetBlocks(n)},my=e=>({registry:t,select:n,dispatch:r})=>{const o=n.getSelectionStart(),i=n.getSelectionEnd();if(o.clientId===i.clientId)return;if(!o.attributeKey||!i.attributeKey||void 0===o.offset||void 0===i.offset)return!1;const a=n.getBlockRootClientId(o.clientId);if(a!==n.getBlockRootClientId(i.clientId))return;const s=n.getBlockOrder(a);let l,c;s.indexOf(o.clientId)>s.indexOf(i.clientId)?(l=i,c=o):(l=o,c=i);const u=e?c:l,d=n.getBlock(u.clientId),p=sc(d.name);if(!p.merge)return;const h=l,m=c,f=n.getBlock(h.clientId),g=sc(f.name),b=n.getBlock(m.clientId),v=sc(b.name),y=f.attributes[h.attributeKey],_=b.attributes[m.attributeKey],k=g.attributes[h.attributeKey],w=v.attributes[m.attributeKey];let E=Zm({html:y,...Xf(k)}),C=Zm({html:_,...Xf(w)});E=rf(E,h.offset,E.text.length),C=nf(C,Ov,0,m.offset);const x=vc(f,{[h.attributeKey]:pf({value:E,...Xf(k)})}),S=vc(b,{[m.attributeKey]:pf({value:C,...Xf(w)})}),I=e?x:S,T=f.name===b.name?[I]:xc(I,p.name);if(!T||!T.length)return;let N;if(e){const e=T.pop();N=p.merge(e.attributes,S.attributes)}else{const e=T.shift();N=p.merge(x.attributes,e.attributes)}const P=Fv(N),R=Zm({html:N[P],...Xf(p.attributes[P])}),A=R.text.indexOf(Ov),B=pf({value:rf(R,A,A+1),...Xf(p.attributes[P])});N[P]=B;const L=n.getSelectedBlockClientIds(),M=[...e?T:[],{...d,attributes:{...d.attributes,...N}},...e?[]:T];t.batch((()=>{r.selectionChange(d.clientId,P,A,A),r.replaceBlocks(L,M,0,n.getSelectedBlocksInitialCaretPosition())}))},fy=()=>({select:e,dispatch:t})=>{const n=e.getSelectionStart(),r=e.getSelectionEnd();if(n.clientId===r.clientId)return;if(!n.attributeKey||!r.attributeKey||void 0===n.offset||void 0===r.offset)return;const o=e.getBlockRootClientId(n.clientId);if(o!==e.getBlockRootClientId(r.clientId))return;const i=e.getBlockOrder(o);let a,s;i.indexOf(n.clientId)>i.indexOf(r.clientId)?(a=r,s=n):(a=n,s=r);const l=a,c=s,u=e.getBlock(l.clientId),d=sc(u.name),p=e.getBlock(c.clientId),h=sc(p.name),m=u.attributes[l.attributeKey],f=p.attributes[c.attributeKey],g=d.attributes[l.attributeKey],b=h.attributes[c.attributeKey];let v=Zm({html:m,...Xf(g)}),y=Zm({html:f,...Xf(b)});v=rf(v,l.offset,v.text.length),y=rf(y,0,c.offset),t.replaceBlocks(e.getSelectedBlockClientIds(),[{...u,attributes:{...u.attributes,[l.attributeKey]:pf({value:v,...Xf(g)})}},{...p,attributes:{...p.attributes,[c.attributeKey]:pf({value:y,...Xf(b)})}}])},gy=()=>({select:e,dispatch:t})=>{const n=e.getSelectionStart(),r=e.getSelectionEnd();t.selectionChange({start:{clientId:n.clientId},end:{clientId:r.clientId}})},by=(e,t)=>({registry:n,select:r,dispatch:o})=>{const i=[e,t];o({type:"MERGE_BLOCKS",blocks:i});const[a,s]=i,l=r.getBlock(a),c=sc(l.name);if(!c)return;if(!c.merge&&!cc(l.name,"__experimentalOnMerge"))return void o.selectBlock(l.clientId);const u=r.getBlock(s);if(!c.merge){const e=xc(u,c.name);if(1!==e?.length)return void o.selectBlock(l.clientId);const[t]=e;return t.innerBlocks.length<1?void o.selectBlock(l.clientId):void n.batch((()=>{o.insertBlocks(t.innerBlocks,void 0,a),o.removeBlock(s),o.selectBlock(t.innerBlocks[0].clientId);const e=r.getNextBlockClientId(a);if(e&&r.getBlockName(a)===r.getBlockName(e)){const t=r.getBlockAttributes(a),n=r.getBlockAttributes(e);Object.keys(t).every((e=>t[e]===n[e]))&&(o.moveBlocksToPosition(r.getBlockOrder(e),e,a),o.removeBlock(e,!1))}}))}const d=sc(u.name),{clientId:p,attributeKey:h,offset:m}=r.getSelectionStart(),f=(p===a?c:d).attributes[h],g=(p===a||p===s)&&void 0!==h&&void 0!==m&&!!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 b=vc(l),v=vc(u);if(g){const e=p===a?b:v,t=nf(Zm({html:e.attributes[h],...Xf(f)}),Ov,m,m);e.attributes[h]=pf({value:t,...Xf(f)})}const y=l.name===u.name?[v]:xc(v,l.name);if(!y||!y.length)return;const _=c.merge(b.attributes,y[0].attributes);if(g){const e=Fv(_),t=Zm({html:_[e],...Xf(c.attributes[e])}),n=t.text.indexOf(Ov),r=pf({value:rf(t,n,n+1),...Xf(c.attributes[e])});_[e]=r,o.selectionChange(l.clientId,e,n,n)}o.replaceBlocks([l.clientId,u.clientId],[{...l,attributes:{...l.attributes,..._}},...y.slice(1)],0)},vy=(e,t=!0)=>yv(e,t);function yy(e,t){return vy([e],t)}function _y(e,t,n=!1,r=0){return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?r:null,time:Date.now()}}function ky(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function wy(){return{type:"START_TYPING"}}function Ey(){return{type:"STOP_TYPING"}}function Cy(e=[]){return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function xy(){return{type:"STOP_DRAGGING_BLOCKS"}}function Sy(){return(0,q.Z)('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Iy(){return(0,q.Z)('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Ty(e,t,n,r){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:r}:{type:"SELECTION_CHANGE",...e}}const Ny=(e,t,n)=>({dispatch:r})=>{const o=ac();if(!o)return;const i=fc(o,e);return r.insertBlock(i,n,t)};function Py(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function Ry(e){return gv(e,{stripExperimentalSettings:!0})}function Ay(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function By(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function Ly(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const My=()=>({dispatch:e})=>{e({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:t=(e=>setTimeout(e,100))}=window;t((()=>{e({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))},Dy=(e=!0)=>({dispatch:t})=>{t.__unstableSetEditorMode(e?"navigation":"edit")},Oy=e=>({dispatch:t,select:n})=>{if("zoom-out"===e){const e=n.getBlockSelectionStart();e&&t.selectBlock(n.getBlockHierarchyRootClientId(e))}t({type:"SET_EDITOR_MODE",mode:e}),"navigation"===e?(0,wf.D)((0,$.__)("You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.")):"edit"===e?(0,wf.D)((0,$.__)("You are currently in edit mode. To return to the navigation mode, press Escape.")):"zoom-out"===e&&(0,wf.D)((0,$.__)("You are currently in zoom-out mode."))},Fy=(e=null)=>({dispatch:t})=>{t({type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e}),e&&(0,wf.D)((0,$.__)("Use the Tab key and Arrow keys to choose new block location. Use Left and Right Arrow keys to move between nesting levels. Once location is selected press Enter or Space to move the block."))},jy=(e,t=!0)=>({select:n,dispatch:r})=>{if(!e||!e.length)return;const o=n.getBlocksByClientId(e);if(o.some((e=>!e)))return;const i=o.map((e=>e.name));if(i.some((e=>!uc(e,"multiple",!0))))return;const a=n.getBlockRootClientId(e[0]),s=jv(e),l=n.getBlockIndex(s[s.length-1]),c=o.map((e=>bc(e)));return r.insertBlocks(c,l+1,a,t),c.length>1&&t&&r.multiSelect(c[0].clientId,c[c.length-1].clientId),c.map((e=>e.clientId))},Zy=e=>({select:t,dispatch:n})=>{if(!e)return;const r=t.getBlockRootClientId(e);if(t.getTemplateLock(r))return;const o=t.getBlockIndex(e);return n.insertDefaultBlock({},r,o)},zy=e=>({select:t,dispatch:n})=>{if(!e)return;const r=t.getBlockRootClientId(e);if(t.getTemplateLock(r))return;const o=t.getBlockIndex(e);return n.insertDefaultBlock({},r,o+1)};function Vy(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const Hy=e=>async({dispatch:t})=>{t(Vy(e,!0)),await new Promise((e=>setTimeout(e,150))),t(Vy(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 Wy(e){return{type:"SET_TEMPORARILY_EDITING_AS_BLOCKS",temporarilyEditingAsBlocks:e}}const Gy=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 r=t.getRegisteredInserterMediaCategories();r.some((({name:t})=>t===e.name))?console.error(`A category is already registered with the same name: "${e.name}".`):r.some((({labels:{name:t}={}})=>t===e.labels?.name))?console.error(`A category is already registered with the same labels.name: "${e.labels.name}".`):n({type:"REGISTER_INSERTER_MEDIA_CATEGORY",category:{...e,isExternalResource:!0}})};function qy(e="",t){return{type:"SET_BLOCK_EDITING_MODE",clientId:e,mode:t}}function Ky(e=""){return{type:"UNSET_BLOCK_EDITING_MODE",clientId:e}}const Yy="core/block-editor",{lock:Xy,unlock:Jy}=(0,pl.es)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/block-editor"),Qy={reducer:km,selectors:h,actions:g},e_=(0,A.Z)(Yy,{...Qy,persist:["preferences"]}),t_=(0,B.registerStore)(Yy,{...Qy,persist:["preferences"]});Jy(t_).registerPrivateActions(m),Jy(t_).registerPrivateSelectors(f),Jy(e_).registerPrivateActions(m),Jy(e_).registerPrivateSelectors(f);const n_={name:"",isSelected:!1},r_=(0,x.createContext)(n_),{Provider:o_}=r_;function i_(){return(0,x.useContext)(r_)}function a_(){const{isSelected:e,clientId:t,name:n}=i_();return(0,yl.Z)((r=>{if(e)return!0;const{getBlockName:o,isFirstMultiSelectedBlock:i,getMultiSelectedBlockClientIds:a}=r(e_);return!!i(t)&&a().every((e=>o(e)===n))}),[t,e,n])}function s_({group:e="default",controls:t,children:n,__experimentalShareWithChildBlocks:r=!1}){const o=function(e,t){const n=a_(),{clientId:r}=i_(),o=(0,yl.Z)((e=>{const{getBlockName:n,hasSelectedInnerBlock:o}=e(e_),{hasBlockSupport:i}=e(Vu);return t&&i(n(r),"__experimentalExposeControlsToChildren",!1)&&o(r)}),[t,r]);return n?om[e]?.Fill:o?om.parent.Fill:null}(e,r);if(!o)return null;const i=(0,x.createElement)(x.Fragment,null,"default"===e&&(0,x.createElement)(nm,{controls:t}),n);return(0,x.createElement)(rm.Z,{document:document},(0,x.createElement)(o,null,(e=>{const{forwardedContext:t=[]}=e;return t.reduce(((e,[t,n])=>(0,x.createElement)(t,{...n},e)),i)})))}var l_=n(72317),c_=n(81799),u_=n(32850),d_=n(13986),p_=n(86504),h_=n(46439),m_=n(43914),f_=n(81388),g_=n(12272),b_=n(18591),v_=n(87786),y_=n(90186);const __=e=>e.__nextUnconstrainedWidth?"":(0,b_.css)(y_.W2,"{min-width:130px;}",""),k_=(0,g_.default)(v_.Z,{target:"eswuck60"})(__,";");var w_=n(67670);const E_=e=>e?.name,C_=({selectedItem:e},{type:t,changes:n,props:{items:r}})=>{switch(t){case l_.useSelect.stateChangeTypes.ToggleButtonKeyDownArrowDown:return{selectedItem:r[e?Math.min(r.indexOf(e)+1,r.length-1):0]};case l_.useSelect.stateChangeTypes.ToggleButtonKeyDownArrowUp:return{selectedItem:r[e?Math.max(r.indexOf(e)-1,0):r.length-1]};default:return n}};function x_(e){const{__next36pxDefaultSize:t=!1,__nextUnconstrainedWidth:n=!1,className:r,hideLabelFromVision:o,label:i,describedBy:a,options:s,onChange:l,size:c="default",value:u,onMouseOver:d,onMouseOut:p,onFocus:h,onBlur:m,__experimentalShowSelectedHint:f=!1}=e,{getLabelProps:g,getToggleButtonProps:b,getMenuProps:v,getItemProps:y,isOpen:_,highlightedIndex:k,selectedItem:w}=(0,l_.useSelect)({initialSelectedItem:s[0],items:s,itemToString:E_,onSelectedItemChange:l,...null!=u?{selectedItem:u}:void 0,stateReducer:C_}),[E,C]=(0,x.useState)(!1);n||(0,p_.default)("Constrained width styles for wp.components.CustomSelectControl",{since:"6.1",version:"6.4",hint:"Set the `__nextUnconstrainedWidth` prop to true to start opting into the new styles, which will become the default in a future version"});const S=v({className:"components-custom-select-control__menu","aria-hidden":!_}),I=(0,x.useCallback)((e=>{e.stopPropagation(),S?.onKeyDown?.(e)}),[S]);return S["aria-activedescendant"]?.startsWith("downshift-null")&&delete S["aria-activedescendant"],(0,x.createElement)("div",{className:R()("components-custom-select-control",r)},o?(0,x.createElement)(h_.Z,{as:"label",...g()},i):(0,x.createElement)(w_.ar,{...g({className:"components-custom-select-control__label"})},i),(0,x.createElement)(k_,{__next36pxDefaultSize:t,__nextUnconstrainedWidth:n,isFocused:_||E,__unstableInputWidth:n?void 0:"auto",labelPosition:n?void 0:"top",size:c,suffix:(0,x.createElement)(f_.Z,null)},(0,x.createElement)(m_.Ph,{onMouseOver:d,onMouseOut:p,as:"button",onFocus:function(e){C(!0),h?.(e)},onBlur:function(e){C(!1),m?.(e)},selectSize:c,__next36pxDefaultSize:t,...b({"aria-label":i,"aria-labelledby":void 0,className:"components-custom-select-control__button",describedBy:a||(w?(0,d_.sprintf)((0,d_.__)("Currently selected: %s"),w.name):(0,d_.__)("No selection"))})},E_(w),f&&w.__experimentalHint&&(0,x.createElement)("span",{className:"components-custom-select-control__hint"},w.__experimentalHint))),(0,x.createElement)("ul",{...S,onKeyDown:I},_&&s.map(((e,n)=>(0,x.createElement)("li",{...y({item:e,index:n,key:e.key,className:R()(e.className,"components-custom-select-control__item",{"is-highlighted":n===k,"has-hint":!!e.__experimentalHint,"is-next-36px-default-size":t}),style:e.style})},e.name,e.__experimentalHint&&(0,x.createElement)("span",{className:"components-custom-select-control__item-hint"},e.__experimentalHint),e===w&&(0,x.createElement)(c_.Z,{icon:u_.Z,className:"components-custom-select-control__item-icon"}))))))}function S_(e){return(0,x.createElement)(x_,{...e,__experimentalShowSelectedHint:!1})}var I_=n(31771),T_=n(63734),N_=n(84523);const P_=(0,b_.keyframes)({"0%":{left:"-50%"},"100%":{left:"100%"}}),R_=(0,g_.default)("div",{target:"e15u147w2"})("position:relative;overflow:hidden;width:100%;max-width:160px;height:",T_.Z.borderWidthFocus,";background-color:color-mix(\n\t\tin srgb,\n\t\tvar( --wp-components-color-foreground, ",N_.D.gray[900]," ),\n\t\ttransparent 90%\n\t);border-radius:",T_.Z.radiusBlockUi,";outline:2px solid transparent;outline-offset:2px;"),A_=(0,g_.default)("div",{target:"e15u147w1"})("display:inline-block;position:absolute;top:0;height:100%;border-radius:",T_.Z.radiusBlockUi,";background-color:color-mix(\n\t\tin srgb,\n\t\tvar( --wp-components-color-foreground, ",N_.D.gray[900]," ),\n\t\ttransparent 10%\n\t);outline:2px solid transparent;outline-offset:-2px;",(({isIndeterminate:e,value:t})=>e?(0,b_.css)({animationDuration:"1.5s",animationTimingFunction:"ease-in-out",animationIterationCount:"infinite",animationName:P_,width:"50%"},"",""):(0,b_.css)({width:`${t}%`,transition:"width 0.4s ease-in-out"},"","")),";"),B_=(0,g_.default)("progress",{target:"e15u147w0"})({name:"11fb690",styles:"position:absolute;top:0;left:0;opacity:0;width:100%;height:100%"});var L_=(0,x.forwardRef)((function(e,t){const{className:n,value:r,...o}=e,i=!Number.isFinite(r);return(0,x.createElement)(R_,{className:n},(0,x.createElement)(A_,{isIndeterminate:i,value:r}),(0,x.createElement)(B_,{max:100,value:r,"aria-label":(0,d_.__)("Loading …"),ref:t,...o}))})),M_=n(41751),D_=n(32943),O_=n(72710),F_=n(58059),j_=n(75811),Z_=n(27295),z_=n(61816),V_=n(91908),H_=n(36630),U_=n(66244),$_=n(76027),W_=n(20582);const G_="2px",q_=(0,W_.D)(2),K_=(0,W_.D)(7),Y_=(0,W_.D)(2),X_=(0,W_.D)(2.5),J_=N_.D.ui.borderDisabled,Q_=N_.D.gray[900],ek=`0 0 0 ${T_.Z.borderWidth} ${J_}, ${T_.Z.popoverShadow}`,tk=`0 0 0 ${T_.Z.borderWidth} ${Q_}`,nk=(0,b_.keyframes)({"0%":{opacity:0,transform:`translateY(${G_})`},"100%":{opacity:1,transform:"translateY(0)"}}),rk=(0,b_.keyframes)({"0%":{opacity:0,transform:`translateX(-${G_})`},"100%":{opacity:1,transform:"translateX(0)"}}),ok=(0,b_.keyframes)({"0%":{opacity:0,transform:`translateY(-${G_})`},"100%":{opacity:1,transform:"translateY(0)"}}),ik=(0,b_.keyframes)({"0%":{opacity:0,transform:`translateX(${G_})`},"100%":{opacity:1,transform:"translateX(0)"}}),ak=e=>(0,b_.css)("min-width:220px;background-color:",N_.D.ui.background,";border-radius:",T_.Z.radiusBlockUi,";padding:",q_,";box-shadow:","toolbar"===e?tk:ek,";animation-duration:","400ms",";animation-timing-function:","cubic-bezier( 0.16, 1, 0.3, 1 )",";will-change:transform,opacity;&[data-side='top']{animation-name:",ok,";}&[data-side='right']{animation-name:",ik,";}&[data-side='bottom']{animation-name:",nk,";}&[data-side='left']{animation-name:",rk,";}@media ( prefers-reduced-motion ){animation-duration:0s;}",""),sk=(0,b_.css)("width:",K_,";display:inline-flex;align-items:center;justify-content:center;margin-inline-start:calc( -1 * ",Y_," );margin-top:",(0,W_.D)(-2),";margin-bottom:",(0,W_.D)(-2),";",""),lk=(0,b_.css)("width:max-content;display:inline-flex;align-items:center;justify-content:center;margin-inline-start:auto;padding-inline-start:",(0,W_.D)(6),";margin-top:",(0,W_.D)(-2),";margin-bottom:",(0,W_.D)(-2),";opacity:0.6;[data-highlighted]>&,[data-state='open']>&,[data-disabled]>&{opacity:1;}",""),ck=(0,g_.default)("span",{target:"e1kdzosf11"})(sk,";"),uk=(0,g_.default)("span",{target:"e1kdzosf10"})(lk,";"),dk=(0,b_.css)("all:unset;font-size:",(0,U_.L)("default.fontSize"),";font-family:inherit;font-weight:normal;line-height:20px;color:",N_.D.gray[900],";border-radius:",T_.Z.radiusBlockUi,";display:flex;align-items:center;padding:",(0,W_.D)(2)," ",X_," ",(0,W_.D)(2)," ",Y_,";position:relative;user-select:none;outline:none;&[data-disabled]{opacity:0.5;pointer-events:none;}&[data-highlighted]{background-color:",N_.D.gray[100],";outline:2px solid transparent;}svg{fill:currentColor;}&:not( :has( ",ck," ) ){padding-inline-start:",K_,";}",""),pk=(0,g_.default)(M_.Content,{target:"e1kdzosf9"})((e=>ak(e.variant)),";"),hk=(0,g_.default)(M_.SubContent,{target:"e1kdzosf8"})((e=>ak(e.variant)),";"),mk=(0,g_.default)(M_.Item,{target:"e1kdzosf7"})(dk,";"),fk=(0,g_.default)(M_.CheckboxItem,{target:"e1kdzosf6"})(dk,";"),gk=(0,g_.default)(M_.RadioItem,{target:"e1kdzosf5"})(dk,";"),bk=(0,g_.default)(M_.SubTrigger,{target:"e1kdzosf4"})(dk," &[data-state='open']{background-color:",N_.D.gray[100],";}"),vk=(0,g_.default)(M_.Label,{target:"e1kdzosf3"})("box-sizing:border-box;display:flex;align-items:center;min-height:",(0,W_.D)(8),";padding:",(0,W_.D)(2)," ",X_," ",(0,W_.D)(2)," ",K_,";color:",N_.D.gray[700],";font-size:11px;line-height:1.4;font-weight:500;text-transform:uppercase;"),yk=(0,g_.default)(M_.Separator,{target:"e1kdzosf2"})("height:",T_.Z.borderWidth,";background-color:",(e=>"toolbar"===e.variant?Q_:J_),";margin:",(0,W_.D)(2)," calc( -1 * ",q_," );"),_k=(0,g_.default)(M_.ItemIndicator,{target:"e1kdzosf1"})({name:"pl708y",styles:"display:inline-flex;align-items:center;justify-content:center"}),kk=(0,g_.default)(V_.Z,{target:"e1kdzosf0"})((0,$_.b)({transform:`scaleX(1) translateX(${(0,W_.D)(2)})`},{transform:`scaleX(-1) translateX(${(0,W_.D)(2)})`}),";"),wk=(0,x.createContext)({variant:void 0,portalContainer:null}),Ek=(0,Z_.Kc)((e=>{const{defaultOpen:t,open:n,onOpenChange:r,modal:o=!0,side:i="bottom",sideOffset:a=0,align:s="center",alignOffset:l=0,children:c,trigger:u,variant:d}=(0,j_.y)(e,"DropdownMenu"),p=(0,z_.Z)(H_._X),h=p.ref?.current,m=(0,x.useMemo)((()=>({variant:d,portalContainer:h})),[d,h]);return(0,x.createElement)(M_.Root,{defaultOpen:t,open:n,onOpenChange:r,modal:o,dir:(0,d_.isRTL)()?"rtl":"ltr"},(0,x.createElement)(M_.Trigger,{asChild:!0},u),(0,x.createElement)(M_.Portal,{container:h},(0,x.createElement)(pk,{side:i,align:s,sideOffset:a,alignOffset:l,loop:!0,variant:d},(0,x.createElement)(wk.Provider,{value:m},c))))}),"DropdownMenu"),Ck=(0,x.forwardRef)((({children:e,prefix:t,suffix:n,...r},o)=>(0,x.createElement)(mk,{...r,ref:o},t&&(0,x.createElement)(ck,null,t),e,n&&(0,x.createElement)(uk,null,n)))),xk=(0,x.createElement)(F_.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,x.createElement)(F_.Cd,{cx:12,cy:12,r:3,fill:"currentColor"}));var Sk=n(29466);const Ik=(0,g_.default)("div",{target:"e1krjpvb0"})("");var Tk=n(96419);function Nk(e){if(!e)return{};const t=Pk(e);return{background:e,foreground:t,foregroundInverted:Pk(t),gray:Rk(e,t)}}function Pk(e){return(0,Dl.Vi)(e).isDark()?N_.D.white:N_.D.gray[900]}function Rk(e,t){const n=(0,Dl.Vi)(e).isDark()?"lighten":"darken",r=Math.abs((0,Dl.Vi)(e).toHsl().l-(0,Dl.Vi)(t).toHsl().l)/100,o={};return Object.entries({100:.06,200:.121,300:.132,400:.2,600:.42,700:.543,800:.821}).forEach((([t,i])=>{o[parseInt(t)]=(0,Dl.Vi)(e)[n](i/.884*r).toHex()})),o}(0,Dl.l7)([Ol.Z,Zl]);var Ak=n(2295);const{lock:Bk,unlock:Lk}=(0,pl.es)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/components"),Mk={};Bk(Mk,{CustomSelectControl:x_,__experimentalPopoverLegacyPositionToPlacement:I_.KF,createPrivateSlotFill:kl.Es,ComponentsContext:Sk.Cd,DropdownMenuV2:Ek,DropdownMenuCheckboxItemV2:({children:e,checked:t=!1,suffix:n,...r})=>(0,x.createElement)(fk,{...r,checked:t},(0,x.createElement)(ck,null,(0,x.createElement)(_k,null,("indeterminate"===t||!0===t)&&(0,x.createElement)(V_.Z,{icon:"indeterminate"===t?O_.Z:u_.Z,size:24}))),e,n&&(0,x.createElement)(uk,null,n)),DropdownMenuGroupV2:e=>(0,x.createElement)(M_.Group,{...e}),DropdownMenuItemV2:Ck,DropdownMenuLabelV2:e=>(0,x.createElement)(vk,{...e}),DropdownMenuRadioGroupV2:e=>(0,x.createElement)(M_.RadioGroup,{...e}),DropdownMenuRadioItemV2:({children:e,suffix:t,...n})=>(0,x.createElement)(gk,{...n},(0,x.createElement)(ck,null,(0,x.createElement)(_k,null,(0,x.createElement)(V_.Z,{icon:xk,size:22}))),e,t&&(0,x.createElement)(uk,null,t)),DropdownMenuSeparatorV2:e=>{const{variant:t}=(0,x.useContext)(wk);return(0,x.createElement)(yk,{...e,variant:t})},DropdownSubMenuV2:({defaultOpen:e,open:t,onOpenChange:n,disabled:r,textValue:o,children:i,trigger:a})=>{const{variant:s,portalContainer:l}=(0,x.useContext)(wk);return(0,x.createElement)(M_.Sub,{defaultOpen:e,open:t,onOpenChange:n},(0,x.createElement)(bk,{disabled:r,textValue:o},a),(0,x.createElement)(M_.Portal,{container:l},(0,x.createElement)(hk,{loop:!0,sideOffset:16,alignOffset:-8,variant:s},i)))},DropdownSubMenuTriggerV2:({prefix:e,suffix:t=(0,x.createElement)(kk,{icon:D_.Z,size:24}),children:n})=>(0,x.createElement)(x.Fragment,null,e&&(0,x.createElement)(ck,null,e),n,t&&(0,x.createElement)(uk,null,t)),ProgressBar:L_,Theme:function({accent:e,background:t,className:n,...r}){const o=(0,Ak.I)(),i=(0,x.useMemo)((()=>o(...(({colors:e})=>{const t=Object.entries(e.gray||{}).map((([e,t])=>`--wp-components-color-gray-${e}: ${t};`)).join("");return[(0,b_.css)("--wp-components-color-accent:",e.accent,";--wp-components-color-accent-darker-10:",e.accentDarker10,";--wp-components-color-accent-darker-20:",e.accentDarker20,";--wp-components-color-accent-inverted:",e.accentInverted,";--wp-components-color-background:",e.background,";--wp-components-color-foreground:",e.foreground,";--wp-components-color-foreground-inverted:",e.foregroundInverted,";",t,";","")]})(function(e){!function(e){for(const[t,n]of Object.entries(e))void 0===n||(0,Dl.Vi)(n).isValid()||"undefined"!=typeof SCRIPT_DEBUG&&!0===SCRIPT_DEBUG&&(0,Tk.default)(`wp.components.Theme: "${n}" is not a valid color value for the '${t}' prop.`)}(e);const t={...(n=e.accent,n?{accent:n,accentDarker10:(0,Dl.Vi)(n).darken(.1).toHex(),accentDarker20:(0,Dl.Vi)(n).darken(.2).toHex(),accentInverted:Pk(n)}:{}),...Nk(e.background)};var n;return function(e){for(const t of Object.values(e))t&&"undefined"!=typeof SCRIPT_DEBUG&&!0===SCRIPT_DEBUG&&(0,Tk.default)("wp.components.Theme: "+t)}(function(e,t){const n=e.background||N_.D.white,r=e.accent||"#3858e9",o=t.foreground||N_.D.gray[900],i=t.gray||N_.D.gray;return{accent:(0,Dl.Vi)(n).isReadable(r)?void 0:`The background color ("${n}") does not have sufficient contrast against the accent color ("${r}").`,foreground:(0,Dl.Vi)(n).isReadable(o)?void 0:`The background color provided ("${n}") does not have sufficient contrast against the standard foreground colors.`,grays:(0,Dl.Vi)(n).contrast(i[600])>=3&&(0,Dl.Vi)(n).contrast(i[700])>=4.5?void 0:`The background color provided ("${n}") cannot generate a set of grayscale foreground colors with sufficient contrast. Try adjusting the color to be lighter or darker.`}}(e,t)),{colors:t}}({accent:e,background:t})),n)),[e,t,n,o]);return(0,x.createElement)(Ik,{className:i,...r})}});var Dk=n(5784),Ok=n(24394);function Fk(e){const t=(0,x.useContext)(Ok.Z);return(0,Dk.useSnapshot)(t.fills,{sync:!0}).get(e)}const{ComponentsContext:jk}=Jy(Mk);function Zk({group:e="default",...t}){const n=(0,x.useContext)(Kh.Z),r=(0,x.useContext)(jk),o=(0,x.useMemo)((()=>({forwardedContext:[[Kh.Z.Provider,{value:n}],[jk.Provider,{value:r}]]})),[n,r]),i=om[e]?.Slot,a=Fk(i?.__unstableName);if(!i)return"undefined"!=typeof SCRIPT_DEBUG&&!0===SCRIPT_DEBUG&&(0,Tk.default)(`Unknown BlockControls group "${e}" provided.`),null;if(!a?.length)return null;const s=(0,x.createElement)(i,{...t,bubblesVirtually:!0,fillProps:o});return"default"===e?s:(0,x.createElement)(nm,null,s)}const zk=s_;zk.Slot=Zk;const Vk=e=>(0,x.createElement)(s_,{group:"inline",...e});Vk.Slot=e=>(0,x.createElement)(Zk,{group:"inline",...e});var Hk=zk,Uk=(0,x.forwardRef)((function(e,t){return(0,x.useContext)(Kh.Z)?(0,x.createElement)(qh.Z,{ref:t,...e.toggleProps},(t=>(0,x.createElement)(em.Z,{...e,popoverProps:{...e.popoverProps},toggleProps:t}))):(0,x.createElement)(em.Z,{...e})})),$k=n(71608),Wk=n(46696),Gk=n(60448),qk=n(46911),Kk=n(85488),Yk=n(80974),Xk=n(72732),Jk=n(42541),Qk=n(36679),ew=n(69550),tw=n(96238),nw=n(86859);const rw=(0,x.createContext)(null);var ow=n(17090);const iw=e=>!e.isLayoutDirty&&e.willUpdate(!1);function aw(){const e=new Set,t=new WeakMap,n=()=>e.forEach(iw);return{add:r=>{e.add(r),t.set(r,r.addEventListener("willUpdate",n))},remove:r=>{e.delete(r);const o=t.get(r);o&&(o(),t.delete(r)),n()},dirty:n}}const sw=e=>!0===e,lw=({children:e,id:t,inherit:n=!0})=>{const r=(0,x.useContext)(nw.p),o=(0,x.useContext)(rw),[i,a]=(0,ow.N)(),s=(0,x.useRef)(null),l=r.id||o;null===s.current&&((e=>sw(!0===e)||"id"===e)(n)&&l&&(t=t?l+"-"+t:l),s.current={id:t,group:sw(n)&&r.group||aw()});const c=(0,x.useMemo)((()=>({...s.current,forceRender:i})),[a]);return x.createElement(nw.p.Provider,{value:c},e)};var cw=n(29814),uw=n(52643);const dw={name:"7whenc",styles:"display:flex;width:100%"},pw=(0,g_.default)("div",{target:"eakva830"})({name:"zjik7",styles:"display:flex"});var hw=n(63545),mw=n(44772),fw=n(48695),gw=n(80026),bw=n(15404),vw=n(77466),yw=n(19785);var _w=(0,x.createContext)(void 0),kw=n(56423),ww=n(94459),Ew=n(61394),Cw=n(35250),xw=(0,ww.Bi)((e=>{var t=e,{store:n}=t,r=(0,fw.S0)(t,["store"]);return r=(0,Ew.OJ)(r,(e=>(0,Cw.jsx)(_w.Provider,{value:n,children:e})),[n]),r=(0,fw.ih)({role:"radiogroup"},r),(0,kw.Q)((0,fw.ih)({store:n},r))})),Sw=(0,ww.LM)((e=>{const t=xw(e);return(0,ww.az)("div",t)})),Iw=n(38190);const Tw=(0,x.createContext)({});var Nw=Tw,Pw=n(28700);function Rw(e){const t=(0,x.useRef)(!1),n=(0,Pw.Z)(e);let r,o;return(0,x.useEffect)((()=>{t.current||(t.current=void 0!==e&&void 0!==n&&e!==n)}),[e,n]),t.current?r=null!=e?e:"":o=e,{value:r,defaultValue:o}}const Aw=(0,x.forwardRef)((function({children:e,isAdaptiveWidth:t,label:n,onChange:r,size:o,value:i,id:a,...s},l){const c=(0,cw.Z)(Aw,"toggle-group-control-as-radio-group"),u=a||c,{value:d,defaultValue:p}=Rw(i),h=r?e=>{r(null!=e?e:void 0)}:void 0,m=function(e={}){const t=function(e){return(0,hw.bD)(e)}(e),n=(0,mw.oR)((()=>function(e={}){var t,n=(0,yw.S0)(e,[]);const r=null==(t=n.store)?void 0:t.getState(),o=(0,gw.t)((0,yw.EZ)((0,yw.ih)({},n),{focusLoop:(0,vw.LS)(n.focusLoop,null==r?void 0:r.focusLoop,!0)})),i=(0,yw.EZ)((0,yw.ih)({},o.getState()),{value:(0,vw.LS)(n.value,null==r?void 0:r.value,n.defaultValue,null)}),a=(0,bw.MT)(i,o,n.store);return(0,yw.EZ)((0,yw.ih)((0,yw.ih)({},o),a),{setValue:e=>a.setState("value",e)})}((0,fw.ih)((0,fw.ih)({},e),t))));return function(e,t){return e=(0,hw.Py)(e,t),(0,mw.XS)(e,t,"value","setValue"),e}(n,e)}({defaultValue:p,value:d,setValue:h}),f=m.useState("value"),g=m.setValue,b=(0,x.useMemo)((()=>({baseId:u,isBlock:!t,size:o,value:f,setValue:g})),[u,t,o,f,g]);return(0,x.createElement)(Nw.Provider,{value:b},(0,x.createElement)(Sw,{store:m,"aria-label":n,as:Iw.Z,...s,id:u,ref:l},e))}));var Bw=n(34660);const Lw=(0,x.forwardRef)((function({children:e,isAdaptiveWidth:t,label:n,onChange:r,size:o,value:i,id:a,...s},l){const c=(0,cw.Z)(Lw,"toggle-group-control-as-button-group"),u=a||c,{value:d,defaultValue:p}=Rw(i),[h,m]=(0,Bw.O)({defaultValue:p,value:d,onChange:r}),f=(0,x.useMemo)((()=>({baseId:u,value:h,setValue:m,isBlock:!t,isDeselectable:!0,size:o})),[u,h,m,t,o]);return(0,x.createElement)(Nw.Provider,{value:f},(0,x.createElement)(Iw.Z,{"aria-label":n,...s,ref:l,role:"group"},e))})),Mw=(0,Z_.Iq)((function(e,t){const{__nextHasNoMarginBottom:n=!1,className:r,isAdaptiveWidth:o=!1,isBlock:i=!1,isDeselectable:a=!1,label:s,hideLabelFromVision:l=!1,help:c,onChange:u,size:d="default",value:p,children:h,...m}=(0,j_.y)(e,"ToggleGroupControl"),f=(0,cw.Z)(Mw,"toggle-group-control"),g=(0,Ak.I)(),b=(0,x.useMemo)((()=>g((({isBlock:e,isDeselectable:t,size:n})=>(0,b_.css)("background:",N_.D.ui.background,";border:1px solid transparent;border-radius:",T_.Z.controlBorderRadius,";display:inline-flex;min-width:0;padding:2px;position:relative;",(e=>(0,b_.css)("min-height:",{default:"36px","__unstable-large":"40px"}[e],";",""))(n)," ",!t&&(e=>{const t=(0,b_.css)("border-color:",N_.D.ui.border,";","");return(0,b_.css)(e&&t," &:hover{border-color:",N_.D.ui.borderHover,";}&:focus-within{border-color:",N_.D.ui.borderFocus,";box-shadow:",T_.Z.controlBoxShadowFocus,";z-index:1;outline:2px solid transparent;outline-offset:-2px;}","")})(e),";",""))({isBlock:i,isDeselectable:a,size:d}),i&&dw,r)),[r,g,i,a,d]),v=a?Lw:Aw;return(0,x.createElement)(uw.ZP,{help:c,__nextHasNoMarginBottom:n},!l&&(0,x.createElement)(pw,null,(0,x.createElement)(uw.ZP.VisualLabel,null,s)),(0,x.createElement)(v,{...m,className:b,isAdaptiveWidth:o,label:s,onChange:u,ref:t,size:d,value:p},(0,x.createElement)(lw,{id:f},h)))}),"ToggleGroupControl");var Dw=Mw,Ow=n(11782),Fw=(0,ww.Bi)((e=>{var t,n=e,{store:r,value:o,checked:i}=n,a=(0,fw.S0)(n,["store","value","checked"]);const s=(0,x.useContext)(_w);r=r||s;const l=(0,Ew.Me)(a.id),c=(0,x.useRef)(null),u=null!=(t=(0,mw.Kw)(r,(e=>null!=i?i:function(e,t){if(void 0!==t)return null!=e&&null!=t?t===e:!!t}(o,e.value))))?t:i;(0,x.useEffect)((()=>{l&&u&&((null==r?void 0:r.getState().activeId)===l||null==r||r.setActiveId(l))}),[r,u,l]);const d=a.onChange,p=(v=(0,Ew.O)(c,a.as||"input"),y=a.type,"input"===v&&(!y||"radio"===y)),h=(0,Ew.zX)((e=>{if(a.disabled)return e.preventDefault(),void e.stopPropagation();p||(e.currentTarget.checked=!0),null==d||d(e),e.defaultPrevented||null==r||r.setValue(o)})),m=a.onClick,f=(0,Ew.zX)((e=>{null==m||m(e),e.defaultPrevented||p||h(e)})),g=a.onFocus,b=(0,Ew.zX)((e=>{if(null==g||g(e),e.defaultPrevented)return;if(!p)return;if(!r)return;const{moves:t,activeId:n}=r.getState();t&&(l&&n!==l||h(e))}));var v,y;return a=(0,fw.EZ)((0,fw.ih)({id:l,role:p?void 0:"radio",type:p?"radio":void 0,"aria-checked":u},a),{ref:(0,Ew.qq)(c,a.ref),onChange:h,onClick:f,onFocus:b}),a=(0,Ow.E)((0,fw.ih)({store:r,clickOnEnter:!p},a)),(0,fw.ih)({value:p?o:void 0,checked:u},a)})),jw=(0,ww.W5)((e=>{const t=Fw(e);return(0,ww.az)("input",t)})),Zw=n(49712),zw=n(64688),Vw=n(97028);const Hw=(0,g_.default)("div",{target:"et6ln9s1"})({name:"sln1fl",styles:"display:inline-flex;max-width:100%;min-width:0;position:relative"}),Uw={name:"82a6rk",styles:"flex:1"},$w=({isDeselectable:e,isIcon:t,isPressed:n,size:r})=>(0,b_.css)("align-items:center;appearance:none;background:transparent;border:none;border-radius:",T_.Z.controlBorderRadius,";color:",N_.D.gray[700],";fill:currentColor;cursor:pointer;display:flex;font-family:inherit;height:100%;justify-content:center;line-height:100%;outline:none;padding:0 12px;position:relative;text-align:center;transition:background ",T_.Z.transitionDurationFast," linear,color ",T_.Z.transitionDurationFast," linear,font-weight 60ms linear;",(0,Vw.r)("transition")," user-select:none;width:100%;z-index:2;&::-moz-focus-inner{border:0;}&:active{background:",T_.Z.toggleGroupControlBackgroundColor,";}",e&&Gw," ",t&&Kw({size:r})," ",n&&Ww,";",""),Ww=(0,b_.css)("color:",N_.D.white,";&:active{background:transparent;}",""),Gw=(0,b_.css)("color:",N_.D.gray[900],";&:focus{box-shadow:inset 0 0 0 1px ",N_.D.white,",0 0 0 ",T_.Z.borderWidthFocus," ",N_.D.theme.accent,";outline:2px solid transparent;}",""),qw=(0,g_.default)("div",{target:"et6ln9s0"})("display:flex;font-size:",T_.Z.fontSize,";line-height:1;"),Kw=({size:e="default"})=>(0,b_.css)("color:",N_.D.gray[900],";width:",{default:"30px","__unstable-large":"34px"}[e],";padding-left:0;padding-right:0;",""),Yw=(0,b_.css)("background:",N_.D.gray[900],";border-radius:",T_.Z.controlBorderRadius,";position:absolute;inset:0;z-index:1;outline:2px solid transparent;outline-offset:-3px;","");var Xw=n(37266);const{ButtonContentView:Jw,LabelView:Qw}=b,eE={duration:0},tE=({showTooltip:e,text:t,children:n})=>e&&t?(0,x.createElement)(Xw.Z,{text:t,placement:"top"},n):(0,x.createElement)(x.Fragment,null,n),nE=(0,Z_.Iq)((function e(t,n){const r=(0,Zw.J)(),o=(0,x.useContext)(Tw),i=(0,cw.Z)(e,o.baseId||"toggle-group-control-option-base"),a=(0,j_.y)({...t,id:i},"ToggleGroupControlOptionBase"),{isBlock:s=!1,isDeselectable:l=!1,size:c="default"}=o,{className:u,isIcon:d=!1,value:p,children:h,showTooltip:m=!1,onFocus:f,...g}=a,b=o.value===p,v=(0,Ak.I)(),y=(0,x.useMemo)((()=>v(s&&Uw)),[v,s]),_=(0,x.useMemo)((()=>v($w({isDeselectable:l,isIcon:d,isPressed:b,size:c}),u)),[v,l,d,b,c,u]),k=(0,x.useMemo)((()=>v(Yw)),[v]),w={...g,className:_,"data-value":p,ref:n};return(0,x.createElement)(Qw,{className:y},(0,x.createElement)(tE,{showTooltip:m,text:g["aria-label"]},l?(0,x.createElement)("button",{...w,onFocus:f,"aria-pressed":b,type:"button",onClick:()=>{l&&b?o.setValue(void 0):o.setValue(p)}},(0,x.createElement)(Jw,null,h)):(0,x.createElement)(jw,{render:(0,x.createElement)("button",{...w,onFocus:e=>{f?.(e),e.defaultPrevented||o.setValue(p)}}),value:p},(0,x.createElement)(Jw,null,h))),b?(0,x.createElement)(zw.E.div,{className:k,transition:r?eE:void 0,role:"presentation",layoutId:"toggle-group-backdrop-shared-layout-id"}):null)}),"ToggleGroupControlOptionBase");var rE=nE;const oE=(0,x.forwardRef)((function(e,t){const{icon:n,label:r,...o}=e;return(0,x.createElement)(rE,{...o,isIcon:!0,"aria-label":r,showTooltip:!0,ref:t},(0,x.createElement)(V_.Z,{icon:n}))}));var iE=oE,aE=n(66805);const sE={default:{name:"default",slug:"flow",className:"is-layout-flow",baseStyles:[{selector:" > .alignleft",rules:{float:"left","margin-inline-start":"0","margin-inline-end":"2em"}},{selector:" > .alignright",rules:{float:"right","margin-inline-start":"2em","margin-inline-end":"0"}},{selector:" > .aligncenter",rules:{"margin-left":"auto !important","margin-right":"auto !important"}}],spacingStyles:[{selector:" > :first-child:first-child",rules:{"margin-block-start":"0"}},{selector:" > :last-child:last-child",rules:{"margin-block-end":"0"}},{selector:" > *",rules:{"margin-block-start":null,"margin-block-end":"0"}}]},constrained:{name:"constrained",slug:"constrained",className:"is-layout-constrained",baseStyles:[{selector:" > .alignleft",rules:{float:"left","margin-inline-start":"0","margin-inline-end":"2em"}},{selector:" > .alignright",rules:{float:"right","margin-inline-start":"2em","margin-inline-end":"0"}},{selector:" > .aligncenter",rules:{"margin-left":"auto !important","margin-right":"auto !important"}},{selector:" > :where(:not(.alignleft):not(.alignright):not(.alignfull))",rules:{"max-width":"var(--wp--style--global--content-size)","margin-left":"auto !important","margin-right":"auto !important"}},{selector:" > .alignwide",rules:{"max-width":"var(--wp--style--global--wide-size)"}}],spacingStyles:[{selector:" > :first-child:first-child",rules:{"margin-block-start":"0"}},{selector:" > :last-child:last-child",rules:{"margin-block-end":"0"}},{selector:" > *",rules:{"margin-block-start":null,"margin-block-end":"0"}}]},flex:{name:"flex",slug:"flex",className:"is-layout-flex",displayMode:"flex",baseStyles:[{selector:"",rules:{"flex-wrap":"wrap","align-items":"center"}},{selector:" > *",rules:{margin:"0"}}],spacingStyles:[{selector:"",rules:{gap:null}}]},grid:{name:"grid",slug:"grid",className:"is-layout-grid",displayMode:"grid",baseStyles:[{selector:" > *",rules:{margin:"0"}}],spacingStyles:[{selector:"",rules:{gap:null}}]}};function lE(e,t=""){return e.split(",").map((e=>`.editor-styles-wrapper ${e}${t?` ${t}`:""}`)).join(",")}function cE(e,t=sE,n,r){let o="";return t?.[n]?.spacingStyles?.length&&r&&t[n].spacingStyles.forEach((t=>{o+=`${lE(e,t.selector.trim())} { `,o+=Object.entries(t.rules).map((([e,t])=>`${e}: ${t||r}`)).join("; "),o+="; }"})),o}function uE(e){const{contentSize:t,wideSize:n,type:r="default"}=e,o={},i=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;return i.test(t)&&"constrained"===r&&(o.none=(0,$.sprintf)((0,$.__)("Max %s wide"),t)),i.test(n)&&(o.wide=(0,$.sprintf)((0,$.__)("Max %s wide"),n)),o}var dE=n(94380),pE=n(63054),hE=n(82394),mE=n(14453),fE=n(37397),gE=n(24929),bE=n(22842);const vE=["top","right","bottom","left"],yE={top:void 0,right:void 0,bottom:void 0,left:void 0},_E={custom:dE.Z,axial:dE.Z,horizontal:pE.Z,vertical:hE.Z,top:mE.Z,right:fE.Z,bottom:gE.Z,left:bE.Z},kE={default:(0,$.__)("Spacing control"),top:(0,$.__)("Top"),bottom:(0,$.__)("Bottom"),left:(0,$.__)("Left"),right:(0,$.__)("Right"),mixed:(0,$.__)("Mixed"),vertical:(0,$.__)("Vertical"),horizontal:(0,$.__)("Horizontal"),axial:(0,$.__)("Horizontal & vertical"),custom:(0,$.__)("Custom")},wE={axial:"axial",top:"top",right:"right",bottom:"bottom",left:"left",custom:"custom"};function EE(e){return!!e?.includes&&("0"===e||e.includes("var:preset|spacing|"))}function CE(e,t){if(!e||EE(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 xE(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function SE(e){if(!e)return;if("0"===e||"default"===e)return e;const t=e.match(/var:preset\|spacing\|(.+)/);return t?t[1]:void 0}function IE(e,t){if(!e||!e.length)return!1;const n=e.includes("horizontal")||e.includes("left")&&e.includes("right"),r=e.includes("vertical")||e.includes("top")&&e.includes("bottom");return"horizontal"===t?n:"vertical"===t?r:n||r}function TE(e,t="0"){const n=function(e){if(!e)return null;const t="string"==typeof e;return{top:t?e:e?.top,left:t?e:e?.left}}(e);if(!n)return null;const r=xE(n?.top)||t,o=xE(n?.left)||t;return r===o?r:`${r} ${o}`}const NE=(0,x.createElement)(F_.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,x.createElement)(F_.y$,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),PE=(0,x.createElement)(F_.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,x.createElement)(F_.y$,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),RE=(0,x.createElement)(F_.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,x.createElement)(F_.y$,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),AE=(0,x.createElement)(F_.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,x.createElement)(F_.y$,{d:"M4 4L20 4L20 5.5L4 5.5L4 4ZM10 7L14 7L14 17L10 17L10 7ZM20 18.5L4 18.5L4 20L20 20L20 18.5Z"})),BE=(0,x.createElement)(F_.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,x.createElement)(F_.y$,{d:"M7 4H17V8L7 8V4ZM7 16L17 16V20L7 20V16ZM20 11.25H4V12.75H20V11.25Z"})),LE={top:{icon:RE,title:(0,$._x)("Align top","Block vertical alignment setting")},center:{icon:PE,title:(0,$._x)("Align middle","Block vertical alignment setting")},bottom:{icon:NE,title:(0,$._x)("Align bottom","Block vertical alignment setting")},stretch:{icon:AE,title:(0,$._x)("Stretch to fill","Block vertical alignment setting")},"space-between":{icon:BE,title:(0,$._x)("Space between","Block vertical alignment setting")}},ME=["top","center","bottom"];var DE=function({value:e,onChange:t,controls:n=ME,isCollapsed:r=!0,isToolbar:o}){const i=LE[e],a=LE.top,s=o?nm:Uk,l=o?{isCollapsed:r}:{};return(0,x.createElement)(s,{icon:i?i.icon:a.icon,label:(0,$._x)("Change vertical alignment","Block vertical alignment setting label"),controls:n.map((n=>{return{...LE[n],isActive:e===n,role:r?"menuitemradio":void 0,onClick:(o=n,()=>t(e===o?void 0:o))};var o})),...l})};const OE=e=>(0,x.createElement)(DE,{...e,isToolbar:!1}),FE=e=>(0,x.createElement)(DE,{...e,isToolbar:!0}),jE={left:Gk.Z,center:qk.Z,right:Kk.Z,"space-between":Yk.Z,stretch:Xk.Z};var ZE=function({allowedControls:e=["left","center","right","space-between"],isCollapsed:t=!0,onChange:n,value:r,popoverProps:o,isToolbar:i}){const a=e=>{n(e===r?void 0:e)},s=r?jE[r]:jE.left,l=[{name:"left",icon:Gk.Z,title:(0,$.__)("Justify items left"),isActive:"left"===r,onClick:()=>a("left")},{name:"center",icon:qk.Z,title:(0,$.__)("Justify items center"),isActive:"center"===r,onClick:()=>a("center")},{name:"right",icon:Kk.Z,title:(0,$.__)("Justify items right"),isActive:"right"===r,onClick:()=>a("right")},{name:"space-between",icon:Yk.Z,title:(0,$.__)("Space between items"),isActive:"space-between"===r,onClick:()=>a("space-between")},{name:"stretch",icon:Xk.Z,title:(0,$.__)("Stretch items"),isActive:"stretch"===r,onClick:()=>a("stretch")}],c=i?nm:Uk,u=i?{isCollapsed:t}:{};return(0,x.createElement)(c,{icon:s,popoverProps:o,label:(0,$.__)("Change items justification"),controls:l.filter((t=>e.includes(t.name))),...u})};const zE=e=>(0,x.createElement)(ZE,{...e,isToolbar:!1});function VE(e){let t=e;var n;return"string"!=typeof e&&(t=null!==(n=e?.toString?.())&&void 0!==n?n:""),t=t.replace(/['\u2019]/,""),(0,rd.o)(t,{splitRegexp:[/(?!(?:1ST|2ND|3RD|[4-9]TH)(?![a-z]))([a-z0-9])([A-Z])/g,/(?!(?:1st|2nd|3rd|[4-9]th)(?![a-z]))([0-9])([a-z])/g,/([A-Za-z])([0-9])/g,/([A-Z])([A-Z][a-z])/g]})}function HE(e){return Array.isArray(e)?e.map(HE):e&&"object"==typeof e?{...Object.fromEntries(Object.entries(e).map((([e,t])=>[e,HE(t)])))}:e}function UE(e,t,n){const r=function(e){return Array.isArray(e)?e:"number"==typeof e?[e.toString()]:[e]}(t),o=e?HE(e):{};return r.reduce(((e,o,i)=>(void 0===e[o]&&(Number.isInteger(t[i+1])?e[o]=[]:e[o]={}),i===r.length-1&&(e[o]=n),e[o])),o),o}const $E=(e,t,n)=>{var r;const o=Array.isArray(t)?t:t.split(".");let i=e;return o.forEach((e=>{i=i?.[e]})),null!==(r=i)&&void 0!==r?r:n},WE=["color","border","dimensions","typography","spacing"],GE={"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},qE={"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"},KE=e=>qE[e]||e;function YE(e){const{name:t,clientId:n}=i_();return(0,yl.Z)((r=>{if(WE.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let o=(0,mc.applyFilters)("blockEditor.useSetting.before",void 0,e,n,t);if(void 0!==o)return o;const i=KE(e),a=[n,...r(e_).getBlockParents(n,!0)];for(const e of a)if(uc(r(e_).getBlockName(e),"__experimentalSettings",!1)){var s;const n=r(e_).getBlockAttributes(e);if(o=null!==(s=$E(n,`settings.blocks.${t}.${i}`))&&void 0!==s?s:$E(n,`settings.${i}`),void 0!==o)break}const l=r(e_).getSettings();if(void 0===o){var c;const e=`__experimentalFeatures.${i}`;o=null!==(c=$E(l,`__experimentalFeatures.blocks.${t}.${i}`))&&void 0!==c?c:$E(l,e)}var u,d;if(void 0!==o)return ql[i]?null!==(u=null!==(d=o.custom)&&void 0!==d?d:o.theme)&&void 0!==u?u:o.default:o;const p=GE[i]?GE[i](l):void 0;return void 0!==p?p:"typography.dropCap"===i||void 0}),[t,n,e])}const XE="1600px",JE="320px",QE=1,eC=.25,tC=.75,nC="14px";function rC(e,t={}){if("string"!=typeof e&&"number"!=typeof e)return null;isFinite(e)&&(e=`${e}px`);const{coerceTo:n,rootSizeValue:r,acceptableUnits:o}={coerceTo:"",rootSizeValue:16,acceptableUnits:["rem","px","em"],...t},i=o?.join("|"),a=new RegExp(`^(\\d*\\.?\\d+)(${i}){1,1}$`),s=e.match(a);if(!s||s.length<3)return null;let[,l,c]=s,u=parseFloat(l);return"px"!==n||"em"!==c&&"rem"!==c||(u*=r,c=n),"px"!==c||"em"!==n&&"rem"!==n||(u/=r,c=n),"em"!==n&&"rem"!==n||"em"!==c&&"rem"!==c||(c=n),{value:oC(u,3),unit:c}}function oC(e,t=3){const n=Math.pow(10,t);return Number.isFinite(e)?parseFloat(Math.round(e*n)/n):void 0}function iC(e,t){const{size:n}=e;if(!aC(t))return n;if(!n||"0"===n||!1===e?.fluid)return n;const r="object"==typeof t?.fluid?t?.fluid:{},o=function({minimumFontSize:e,maximumFontSize:t,fontSize:n,minimumViewportWidth:r=JE,maximumViewportWidth:o=XE,scaleFactor:i=QE,minimumFontSizeLimit:a}){if(a=rC(a)?a:nC,n){const r=rC(n);if(!r?.unit)return null;const o=rC(a,{coerceTo:r.unit});if(o?.value&&!e&&!t&&r?.value<=o?.value)return null;if(t||(t=`${r.value}${r.unit}`),!e){const t="px"===r.unit?r.value:16*r.value,n=Math.min(Math.max(1-.075*Math.log2(t),eC),tC),i=oC(r.value*n,3);e=o?.value&&i<o?.value?`${o.value}${o.unit}`:`${i}${r.unit}`}}const s=rC(e),l=s?.unit||"rem",c=rC(t,{coerceTo:l});if(!s||!c)return null;const u=rC(e,{coerceTo:"rem"}),d=rC(o,{coerceTo:l}),p=rC(r,{coerceTo:l});if(!d||!p||!u)return null;const h=oC(p.value/100,3),m=oC(h,3)+l,f=oC(((c.value-s.value)/(d.value-p.value)*100||1)*i,3);return`clamp(${e}, ${u.value}${u.unit} + ((1vw - ${m}) * ${f}), ${t})`}({minimumFontSize:e?.fluid?.min,maximumFontSize:e?.fluid?.max,fontSize:n,minimumFontSizeLimit:r?.minFontSize,maximumViewportWidth:r?.maxViewportWidth,minimumViewportWidth:r?.minViewportWidth});return o||n}function aC(e){const t=e?.fluid;return!0===t||t&&"object"==typeof t&&Object.keys(t).length>0}function sC(e){const t=e?.typography,n=e?.layout,r=rC(n?.wideSize)?n?.wideSize:null;return aC(t)&&r?{fluid:{maxViewportWidth:r,...t.fluid}}:{fluid:t?.fluid}}const lC="body",cC=[{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)=>iC(e,sC(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:[]}],uC={"color.background":"color","color.text":"color","filter.duotone":"duotone","elements.link.color.text":"color","elements.link.:hover.color.text":"color","elements.link.typography.fontFamily":"font-family","elements.link.typography.fontSize":"font-size","elements.button.color.text":"color","elements.button.color.background":"color","elements.caption.color.text":"color","elements.button.typography.fontFamily":"font-family","elements.button.typography.fontSize":"font-size","elements.heading.color":"color","elements.heading.color.background":"color","elements.heading.typography.fontFamily":"font-family","elements.heading.gradient":"gradient","elements.heading.color.gradient":"gradient","elements.h1.color":"color","elements.h1.color.background":"color","elements.h1.typography.fontFamily":"font-family","elements.h1.color.gradient":"gradient","elements.h2.color":"color","elements.h2.color.background":"color","elements.h2.typography.fontFamily":"font-family","elements.h2.color.gradient":"gradient","elements.h3.color":"color","elements.h3.color.background":"color","elements.h3.typography.fontFamily":"font-family","elements.h3.color.gradient":"gradient","elements.h4.color":"color","elements.h4.color.background":"color","elements.h4.typography.fontFamily":"font-family","elements.h4.color.gradient":"gradient","elements.h5.color":"color","elements.h5.color.background":"color","elements.h5.typography.fontFamily":"font-family","elements.h5.color.gradient":"gradient","elements.h6.color":"color","elements.h6.color.background":"color","elements.h6.typography.fontFamily":"font-family","elements.h6.color.gradient":"gradient","color.gradient":"gradient",shadow:"shadow","typography.fontSize":"font-size","typography.fontFamily":"font-family"};function dC(e,t,n,r,o){const i=[$E(e,["blocks",t,...n]),$E(e,n)];for(const a of i)if(a){const i=["custom","theme","default"];for(const s of i){const i=a[s];if(i){const a=i.find((e=>e[r]===o));if(a)return"slug"===r||dC(e,t,n,"slug",a.slug)[r]===a[r]?a:void 0}}}}function pC(e,t,n){if(!n||"string"!=typeof n){if(!n?.ref||"string"!=typeof n?.ref)return n;{const t=n.ref.split(".");if(!(n=$E(e,t))||n?.ref)return n}}let r;if(n.startsWith("var:"))r=n.slice(4).split("|");else{if(!n.startsWith("var(--wp--")||!n.endsWith(")"))return n;r=n.slice(10,-1).split("--")}const[o,...i]=r;return"preset"===o?function(e,t,n,[r,o]){const i=cC.find((e=>e.cssVarInfix===r));if(!i)return n;const a=dC(e.settings,t,i.path,"slug",o);if(a){const{valueKey:n}=i;return pC(e,t,a[n])}return n}(e,t,n,i):"custom"===o?function(e,t,n,r){var o;const i=null!==(o=$E(e.settings,["blocks",t,"custom",...r]))&&void 0!==o?o:$E(e.settings,["custom",...r]);return i?pC(e,t,i):n}(e,t,n,i):n}function hC(e,t){const n=e.split(","),r=t.split(","),o=[];return n.forEach((e=>{r.forEach((t=>{o.push(`${e.trim()} ${t.trim()}`)}))})),o.join(", ")}function mC(e,t){return"object"!=typeof e||"object"!=typeof t?e===t:M()(e?.styles,t?.styles)&&M()(e?.settings,t?.settings)}const fC=(0,x.createContext)({user:{},base:{},merged:{},setUserConfig:()=>{}}),gC={settings:{},styles:{}},bC=["appearanceTools","useRootPaddingAwareAlignments","border.color","border.radius","border.style","border.width","shadow.presets","shadow.defaultPresets","color.background","color.button","color.caption","color.custom","color.customDuotone","color.customGradient","color.defaultDuotone","color.defaultGradients","color.defaultPalette","color.duotone","color.gradients","color.heading","color.link","color.palette","color.text","custom","dimensions.minHeight","layout.contentSize","layout.definitions","layout.wideSize","lightbox.enabled","lightbox.allowEditing","position.fixed","position.sticky","spacing.customSpacingSize","spacing.spacingSizes","spacing.spacingScale","spacing.blockGap","spacing.margin","spacing.padding","spacing.units","typography.fluid","typography.customFontSize","typography.dropCap","typography.fontFamilies","typography.fontSizes","typography.fontStyle","typography.fontWeight","typography.letterSpacing","typography.lineHeight","typography.textColumns","typography.textDecoration","typography.textTransform","typography.writingMode"],vC=()=>{const{user:e,setUserConfig:t}=(0,x.useContext)(fC);return[!!e&&!M()(e,gC),(0,x.useCallback)((()=>t((()=>gC))),[t])]};function yC(e,t,n="all"){const{setUserConfig:r,...o}=(0,x.useContext)(fC),i=t?".blocks."+t:"",a=e?"."+e:"",s=`settings${i}${a}`,l=`settings${a}`,c="all"===n?"merged":n;return[(0,x.useMemo)((()=>{const t=o[c];if(!t)throw"Unsupported source";var n;if(e)return null!==(n=$E(t,s))&&void 0!==n?n:$E(t,l);let r={};return bC.forEach((e=>{var n;const o=null!==(n=$E(t,`settings${i}.${e}`))&&void 0!==n?n:$E(t,`settings.${e}`);void 0!==o&&(r=UE(r,e.split("."),o))})),r}),[o,c,e,s,l,i]),e=>{r((t=>UE(t,s.split("."),e)))}]}function _C(e,t,n="all",{shouldDecodeEncode:r=!0}={}){const{merged:o,base:i,user:a,setUserConfig:s}=(0,x.useContext)(fC),l=e?"."+e:"",c=t?`styles.blocks.${t}${l}`:`styles${l}`;let u,d;switch(n){case"all":u=$E(o,c),d=r?pC(o,t,u):u;break;case"user":u=$E(a,c),d=r?pC(o,t,u):u;break;case"base":u=$E(i,c),d=r?pC(i,t,u):u;break;default:throw"Unsupported source"}return[d,n=>{s((i=>UE(i,c.split("."),r?function(e,t,n,r){if(!r)return r;const o=uC[n],i=cC.find((e=>e.cssVarInfix===o));if(!i)return r;const{valueKey:a,path:s}=i,l=dC(e,t,s,a,r);return l?`var:preset|${o}|${l.slug}`:r}(o.settings,t,e,n):n)))}]}function kC(e,t,n){const{supportedStyles:r,supports:o}=(0,yl.Z)((e=>({supportedStyles:Jy(e(Vu)).getSupportedStyles(t,n),supports:e(Vu).getBlockType(t)?.supports})),[t,n]);return(0,x.useMemo)((()=>{const t={...e};return r.includes("fontSize")||(t.typography={...t.typography,fontSizes:{},customFontSize:!1}),r.includes("fontFamily")||(t.typography={...t.typography,fontFamilies:{}}),t.color={...t.color,text:t.color?.text&&r.includes("color"),background:t.color?.background&&(r.includes("background")||r.includes("backgroundColor")),button:t.color?.button&&r.includes("buttonColor"),heading:t.color?.heading&&r.includes("headingColor"),link:t.color?.link&&r.includes("linkColor"),caption:t.color?.caption&&r.includes("captionColor")},r.includes("background")||(t.color.gradients=[],t.color.customGradient=!1),r.includes("filter")||(t.color.defaultDuotone=!1,t.color.customDuotone=!1),["lineHeight","fontStyle","fontWeight","letterSpacing","textTransform","textDecoration","writingMode"].forEach((e=>{r.includes(e)||(t.typography={...t.typography,[e]:!1})})),r.includes("columnCount")||(t.typography={...t.typography,textColumns:!1}),["contentSize","wideSize"].forEach((e=>{r.includes(e)||(t.layout={...t.layout,[e]:!1})})),["padding","margin","blockGap"].forEach((e=>{r.includes(e)||(t.spacing={...t.spacing,[e]:!1});const n=Array.isArray(o?.spacing?.[e])?o?.spacing?.[e]:o?.spacing?.[e]?.sides;n?.length&&t.spacing?.[e]&&(t.spacing={...t.spacing,[e]:{...t.spacing?.[e],sides:n}})})),r.includes("minHeight")||(t.dimensions={...t.dimensions,minHeight:!1}),["radius","color","style","width"].forEach((e=>{r.includes("border"+e.charAt(0).toUpperCase()+e.slice(1))||(t.border={...t.border,[e]:!1})})),t.shadow=!!r.includes("shadow")&&t.shadow,t}),[e,r,o])}function wC(e){const t=e?.color?.palette?.custom,n=e?.color?.palette?.theme,r=e?.color?.palette?.default,o=e?.color?.defaultPalette;return(0,x.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,$._x)("Theme","Indicates this palette comes from the theme."),colors:n}),o&&r&&r.length&&e.push({name:(0,$._x)("Default","Indicates this palette comes from WordPress."),colors:r}),t&&t.length&&e.push({name:(0,$._x)("Custom","Indicates this palette is created by the user."),colors:t}),e}),[t,n,r,o])}function EC(e){const t=e?.color?.gradients?.custom,n=e?.color?.gradients?.theme,r=e?.color?.gradients?.default,o=e?.color?.defaultGradients;return(0,x.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,$._x)("Theme","Indicates this palette comes from the theme."),gradients:n}),o&&r&&r.length&&e.push({name:(0,$._x)("Default","Indicates this palette comes from WordPress."),gradients:r}),t&&t.length&&e.push({name:(0,$._x)("Custom","Indicates this palette is created by the user."),gradients:t}),e}),[t,n,r,o])}const CC=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=Object.entries(e).map((([e,t])=>[e,CC(t)])).filter((([,e])=>void 0!==e));return t.length?Object.fromEntries(t):void 0};function xC(e,t,n,r,o,i){if(Object.values(null!=e?e:{}).every((e=>!e)))return n;if(1===i.length&&n.innerBlocks.length===r.length)return n;let a=r[0]?.attributes;if(i.length>1&&r.length>1){if(!r[o])return n;a=r[o]?.attributes}let s=n;return Object.entries(e).forEach((([e,n])=>{n&&t[e].forEach((e=>{const t=$E(a,e);t&&(s={...s,attributes:UE(s.attributes,e,t)})}))})),s}function SC(e,t,n){const r=cc(e,t),o=r?.__experimentalSkipSerialization;return Array.isArray(o)?o.includes(n):o}function IC(e,t){const n=YE("typography.fontFamilies"),r=YE("typography.fontSizes"),o=YE("typography.customFontSize"),i=YE("typography.fontStyle"),a=YE("typography.fontWeight"),s=YE("typography.lineHeight"),l=YE("typography.textColumns"),c=YE("typography.textDecoration"),u=YE("typography.writingMode"),d=YE("typography.textTransform"),p=YE("typography.letterSpacing"),h=YE("spacing.padding"),m=YE("spacing.margin"),f=YE("spacing.blockGap"),g=YE("spacing.spacingSizes"),b=YE("spacing.units"),v=YE("dimensions.minHeight"),y=YE("layout"),_=YE("border.color"),k=YE("border.radius"),w=YE("border.style"),E=YE("border.width"),C=YE("color.custom"),S=YE("color.palette.custom"),I=YE("color.customDuotone"),T=YE("color.palette.theme"),N=YE("color.palette.default"),P=YE("color.defaultPalette"),R=YE("color.defaultDuotone"),A=YE("color.duotone.custom"),B=YE("color.duotone.theme"),L=YE("color.duotone.default"),M=YE("color.gradients.custom"),D=YE("color.gradients.theme"),O=YE("color.gradients.default"),F=YE("color.defaultGradients"),j=YE("color.customGradient"),Z=YE("color.background"),z=YE("color.link"),V=YE("color.text"),H=YE("color.heading"),U=YE("color.button");return kC((0,x.useMemo)((()=>({color:{palette:{custom:S,theme:T,default:N},gradients:{custom:M,theme:D,default:O},duotone:{custom:A,theme:B,default:L},defaultGradients:F,defaultPalette:P,defaultDuotone:R,custom:C,customGradient:j,customDuotone:I,background:Z,link:z,heading:H,button:U,text:V},typography:{fontFamilies:{custom:n},fontSizes:{custom:r},customFontSize:o,fontStyle:i,fontWeight:a,lineHeight:s,textColumns:l,textDecoration:c,textTransform:d,letterSpacing:p,writingMode:u},spacing:{spacingSizes:{custom:g},padding:h,margin:m,blockGap:f,units:b},border:{color:_,radius:k,style:w,width:E},dimensions:{minHeight:v},layout:y,parentLayout:t})),[n,r,o,i,a,s,l,c,d,p,u,h,m,f,g,b,v,y,t,_,k,w,E,C,S,I,T,N,P,R,A,B,L,M,D,O,F,j,Z,z,V,H,U]),e)}const TC={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},NC={left:"flex-start",right:"flex-end",center:"center",stretch:"stretch"},PC={top:"flex-start",center:"center",bottom:"flex-end",stretch:"stretch","space-between":"space-between"},RC=["wrap","nowrap"];var AC={name:"flex",label:(0,$.__)("Flex"),inspectorControls:function({layout:e={},onChange:t,layoutBlockSupport:n={}}){const{allowOrientation:r=!0}=n;return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(ew.Z,null,(0,x.createElement)(tw.Z,null,(0,x.createElement)(MC,{layout:e,onChange:t})),(0,x.createElement)(tw.Z,null,r&&(0,x.createElement)(OC,{layout:e,onChange:t}))),(0,x.createElement)(DC,{layout:e,onChange:t}))},toolBarControls:function({layout:e={},onChange:t,layoutBlockSupport:n}){if(n?.allowSwitching)return null;const{allowVerticalAlignment:r=!0}=n;return(0,x.createElement)(Hk,{group:"block",__experimentalShareWithChildBlocks:!0},(0,x.createElement)(MC,{layout:e,onChange:t,isToolbar:!0}),r&&(0,x.createElement)(BC,{layout:e,onChange:t,isToolbar:!0}))},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:r,hasBlockGapSupport:o,layoutDefinitions:i=sE}){const{orientation:a="horizontal"}=t,s=n?.spacing?.blockGap&&!SC(r,"spacing","blockGap")?TE(n?.spacing?.blockGap,"0.5em"):void 0,l=TC[t.justifyContent],c=RC.includes(t.flexWrap)?t.flexWrap:"wrap",u=PC[t.verticalAlignment],d=NC[t.justifyContent]||NC.left;let p="";const h=[];return c&&"wrap"!==c&&h.push(`flex-wrap: ${c}`),"horizontal"===a?(u&&h.push(`align-items: ${u}`),l&&h.push(`justify-content: ${l}`)):(u&&h.push(`justify-content: ${u}`),h.push("flex-direction: column"),h.push(`align-items: ${d}`)),h.length&&(p=`${lE(e)} {\n\t\t\t\t${h.join("; ")};\n\t\t\t}`),o&&s&&(p+=cE(e,i,"flex",s)),p},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments(){return[]}};function BC({layout:e,onChange:t,isToolbar:n=!1}){const{orientation:r="horizontal"}=e,o="horizontal"===r?PC.center:PC.top,{verticalAlignment:i=o}=e,a=n=>{t({...e,verticalAlignment:n})};if(n)return(0,x.createElement)(OE,{onChange:a,value:i,controls:"horizontal"===r?["top","center","bottom","stretch"]:["top","center","bottom","space-between"]});const s=[{value:"flex-start",label:(0,$.__)("Align items top")},{value:"center",label:(0,$.__)("Align items center")},{value:"flex-end",label:(0,$.__)("Align items bottom")}];return(0,x.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,x.createElement)("legend",null,(0,$.__)("Vertical alignment")),(0,x.createElement)("div",null,s.map(((e,t,n)=>(0,x.createElement)(Gh.ZP,{key:e,label:n,icon:t,isPressed:i===e,onClick:()=>a(e)})))))}const LC={placement:"bottom-start"};function MC({layout:e,onChange:t,isToolbar:n=!1}){const{justifyContent:r="left",orientation:o="horizontal"}=e,i=n=>{t({...e,justifyContent:n})},a=["left","center","right"];if("horizontal"===o?a.push("space-between"):a.push("stretch"),n)return(0,x.createElement)(zE,{allowedControls:a,value:r,onChange:i,popoverProps:LC});const s=[{value:"left",icon:Gk.Z,label:(0,$.__)("Justify items left")},{value:"center",icon:qk.Z,label:(0,$.__)("Justify items center")},{value:"right",icon:Kk.Z,label:(0,$.__)("Justify items right")}];return"horizontal"===o?s.push({value:"space-between",icon:Yk.Z,label:(0,$.__)("Space between items")}):s.push({value:"stretch",icon:Xk.Z,label:(0,$.__)("Stretch items")}),(0,x.createElement)(Dw,{__nextHasNoMarginBottom:!0,label:(0,$.__)("Justification"),value:r,onChange:i,className:"block-editor-hooks__flex-layout-justification-controls"},s.map((({value:e,icon:t,label:n})=>(0,x.createElement)(iE,{key:e,value:e,icon:t,label:n}))))}function DC({layout:e,onChange:t}){const{flexWrap:n="wrap"}=e;return(0,x.createElement)(aE.Z,{__nextHasNoMarginBottom:!0,label:(0,$.__)("Allow to wrap to multiple lines"),onChange:n=>{t({...e,flexWrap:n?"wrap":"nowrap"})},checked:"wrap"===n})}function OC({layout:e,onChange:t}){const{orientation:n="horizontal",verticalAlignment:r,justifyContent:o}=e;return(0,x.createElement)(Dw,{__nextHasNoMarginBottom:!0,className:"block-editor-hooks__flex-layout-orientation-controls",label:(0,$.__)("Orientation"),value:n,onChange:n=>{let i=r,a=o;return"horizontal"===n?("space-between"===r&&(i="center"),"stretch"===o&&(a="left")):("stretch"===r&&(i="top"),"space-between"===o&&(a="left")),t({...e,orientation:n,verticalAlignment:i,justifyContent:a})}},(0,x.createElement)(iE,{icon:Jk.Z,value:"horizontal",label:(0,$.__)("Horizontal")}),(0,x.createElement)(iE,{icon:Qk.Z,value:"vertical",label:(0,$.__)("Vertical")}))}var FC={name:"default",label:(0,$.__)("Flow"),inspectorControls:function(){return null},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,style:t,blockName:n,hasBlockGapSupport:r,layoutDefinitions:o=sE}){const i=TE(t?.spacing?.blockGap);let a="";SC(n,"spacing","blockGap")||(i?.top?a=TE(i?.top):"string"==typeof i&&(a=TE(i)));let s="";return r&&a&&(s+=cE(e,o,"default",a)),s},getOrientation(){return"vertical"},getAlignments(e,t){const n=uE(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:n[e]})));const r=[{name:"left"},{name:"center"},{name:"right"}];if(!t){const{contentSize:t,wideSize:o}=e;t&&r.unshift({name:"full"}),o&&r.unshift({name:"wide",info:n.wide})}return r.unshift({name:"none",info:n.none}),r}};const jC="web"===n(63022).Z.OS,ZC={px:{value:"px",label:jC?"px":(0,d_.__)("Pixels (px)"),a11yLabel:(0,d_.__)("Pixels (px)"),step:1},"%":{value:"%",label:jC?"%":(0,d_.__)("Percentage (%)"),a11yLabel:(0,d_.__)("Percent (%)"),step:.1},em:{value:"em",label:jC?"em":(0,d_.__)("Relative to parent font size (em)"),a11yLabel:(0,d_._x)("ems","Relative to parent font size (em)"),step:.01},rem:{value:"rem",label:jC?"rem":(0,d_.__)("Relative to root font size (rem)"),a11yLabel:(0,d_._x)("rems","Relative to root font size (rem)"),step:.01},vw:{value:"vw",label:jC?"vw":(0,d_.__)("Viewport width (vw)"),a11yLabel:(0,d_.__)("Viewport width (vw)"),step:.1},vh:{value:"vh",label:jC?"vh":(0,d_.__)("Viewport height (vh)"),a11yLabel:(0,d_.__)("Viewport height (vh)"),step:.1},vmin:{value:"vmin",label:jC?"vmin":(0,d_.__)("Viewport smallest dimension (vmin)"),a11yLabel:(0,d_.__)("Viewport smallest dimension (vmin)"),step:.1},vmax:{value:"vmax",label:jC?"vmax":(0,d_.__)("Viewport largest dimension (vmax)"),a11yLabel:(0,d_.__)("Viewport largest dimension (vmax)"),step:.1},ch:{value:"ch",label:jC?"ch":(0,d_.__)("Width of the zero (0) character (ch)"),a11yLabel:(0,d_.__)("Width of the zero (0) character (ch)"),step:.01},ex:{value:"ex",label:jC?"ex":(0,d_.__)("x-height of the font (ex)"),a11yLabel:(0,d_.__)("x-height of the font (ex)"),step:.01},cm:{value:"cm",label:jC?"cm":(0,d_.__)("Centimeters (cm)"),a11yLabel:(0,d_.__)("Centimeters (cm)"),step:.001},mm:{value:"mm",label:jC?"mm":(0,d_.__)("Millimeters (mm)"),a11yLabel:(0,d_.__)("Millimeters (mm)"),step:.1},in:{value:"in",label:jC?"in":(0,d_.__)("Inches (in)"),a11yLabel:(0,d_.__)("Inches (in)"),step:.001},pc:{value:"pc",label:jC?"pc":(0,d_.__)("Picas (pc)"),a11yLabel:(0,d_.__)("Picas (pc)"),step:1},pt:{value:"pt",label:jC?"pt":(0,d_.__)("Points (pt)"),a11yLabel:(0,d_.__)("Points (pt)"),step:1}},zC=Object.values(ZC),VC=[ZC.px,ZC["%"],ZC.em,ZC.rem,ZC.vw,ZC.vh],HC=ZC.px;function UC(e,t,n){return WC(t?`${null!=e?e:""}${t}`:e,n)}function $C(e){return Array.isArray(e)&&!!e.length}function WC(e,t=zC){let n,r;if(void 0!==e||null===e){n=`${e}`.trim();const t=parseFloat(n);r=isFinite(t)?t:void 0}const o=n?.match(/[\d.\-\+]*\s*(.*)/),i=o?.[1]?.toLowerCase();let a;if($C(t)){const e=t.find((e=>e.value===i));a=e?.value}else a=HC.value;return[r,a]}const GC=({units:e=zC,availableUnits:t=[],defaultValues:n})=>{const r=function(e=[],t){return Array.isArray(t)?t.filter((t=>e.includes(t.value))):[]}(t,e);return n&&r.forEach(((e,t)=>{if(n[e.value]){const[o]=WC(n[e.value]);r[t].default=o}})),r};var qC=n(27087);const KC=(0,g_.default)(qC.Z,{target:"e1bagdl32"})("&&&{input{display:block;width:100%;}",y_.Kg,"{transition:box-shadow 0.1s linear;}}"),YC=({selectSize:e})=>{const t={default:(0,b_.css)("box-sizing:border-box;padding:2px 1px;width:20px;color:",N_.D.gray[800],";font-size:8px;line-height:1;letter-spacing:-0.5px;text-transform:uppercase;text-align-last:center;",""),large:(0,b_.css)("box-sizing:border-box;min-width:24px;max-width:48px;height:24px;margin-inline-end:",(0,W_.D)(2),";padding:",(0,W_.D)(1),";color:",N_.D.theme.accent,";font-size:13px;line-height:1;text-align-last:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;","")};return"__unstable-large"===e?t.large:t.default},XC=(0,g_.default)("div",{target:"e1bagdl31"})("&&&{pointer-events:none;",YC,";color:",N_.D.gray[900],";}"),JC=(0,g_.default)("select",{target:"e1bagdl30"})("&&&{appearance:none;background:transparent;border-radius:2px;border:none;display:block;outline:none;margin:0;min-height:auto;font-family:inherit;",YC,";",(({selectSize:e="default"})=>{const t={default:(0,b_.css)("height:100%;border:1px solid transparent;transition:box-shadow 0.1s linear,border 0.1s linear;",(0,$_.b)({borderTopLeftRadius:0,borderBottomLeftRadius:0})()," &:not(:disabled):hover{background-color:",N_.D.gray[100],";}&:focus{border:1px solid ",N_.D.ui.borderFocus,";box-shadow:inset 0 0 0 ",T_.Z.borderWidth+" "+N_.D.ui.borderFocus,";outline-offset:0;outline:2px solid transparent;z-index:1;}",""),large:(0,b_.css)("display:flex;justify-content:center;align-items:center;&:hover{color:",N_.D.ui.borderFocus,";box-shadow:inset 0 0 0 ",T_.Z.borderWidth+" "+N_.D.ui.borderFocus,";outline:",T_.Z.borderWidth," solid transparent;}&:focus{box-shadow:0 0 0 ",T_.Z.borderWidthFocus+" "+N_.D.ui.borderFocus,";outline:",T_.Z.borderWidthFocus," solid transparent;}","")};return"__unstable-large"===e?t.large:t.default}),";&:not( :disabled ){cursor:pointer;}}");var QC=(0,x.forwardRef)((function({className:e,isUnitSelectTabbable:t=!0,onChange:n,size:r="default",unit:o="px",units:i=VC,...a},s){if(!$C(i)||1===i?.length)return(0,x.createElement)(XC,{className:"components-unit-control__unit-label",selectSize:r},o);const l=R()("components-unit-control__select",e);return(0,x.createElement)(JC,{ref:s,className:l,onChange:e=>{const{value:t}=e.target,r=i.find((e=>e.value===t));n?.(t,{event:e,data:r})},selectSize:r,tabIndex:t?void 0:-1,value:o,...a},i.map((e=>(0,x.createElement)("option",{value:e.value,key:e.value},e.label))))})),ex=n(55271);function tx(e){return e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")}new RegExp(`[${["-","~","","֊","־","᐀","᠆","‐","‑","‒","–","—","―","⁓","⁻","₋","−","⸗","⸺","⸻","〜","〰","゠","︱","︲","﹘","﹣","-"].join("")}]`,"g");const nx=(0,x.forwardRef)((function(e,t){const{__unstableStateReducer:n,autoComplete:r="off",children:o,className:i,disabled:a=!1,disableUnits:s=!1,isPressEnterToChange:l=!1,isResetValueOnUnitChange:c=!1,isUnitSelectTabbable:u=!0,label:d,onChange:p,onUnitChange:h,size:m="default",unit:f,units:g=VC,value:b,onFocus:v,...y}=e;"unit"in e&&(0,p_.default)("UnitControl unit prop",{since:"5.6",hint:"The unit should be provided within the `value` prop.",version:"6.2"});const _=null!=b?b:void 0,[k,w]=(0,x.useMemo)((()=>{const e=function(e,t,n=zC){const r=Array.isArray(n)?[...n]:[],[,o]=UC(e,t,zC);return o&&!r.some((e=>e.value===o))&&ZC[o]&&r.unshift(ZC[o]),r}(_,f,g),[{value:t=""}={},...n]=e,r=n.reduce(((e,{value:t})=>{const n=tx(t?.substring(0,1)||"");return e.includes(n)?e:`${e}|${n}`}),tx(t.substring(0,1)));return[e,new RegExp(`^(?:${r})$`,"i")]}),[_,f,g]),[E,C]=UC(_,f,k),[S,I]=(0,ex.Z)(1===k.length?k[0].value:f,{initial:C,fallback:""});(0,x.useEffect)((()=>{void 0!==C&&I(C)}),[C,I]);const T=R()("components-unit-control","components-unit-control-wrapper",i);let N;!s&&u&&k.length&&(N=e=>{y.onKeyDown?.(e),!e.metaKey&&w.test(e.key)&&P.current?.focus()});const P=(0,x.useRef)(null),A=s?null:(0,x.createElement)(QC,{ref:P,"aria-label":(0,d_.__)("Select unit"),disabled:a,isUnitSelectTabbable:u,onChange:(e,t)=>{const{data:n}=t;let r=`${null!=E?E:""}${e}`;c&&void 0!==n?.default&&(r=`${n.default}${e}`),p?.(r,t),h?.(e,t),I(e)},size:m,unit:S,units:k,onFocus:v,onBlur:e.onBlur});let B=y.step;if(!B&&k){var L;const e=k.find((e=>e.value===S));B=null!==(L=e?.step)&&void 0!==L?L:1}return(0,x.createElement)(KC,{...y,autoComplete:r,className:T,disabled:a,spinControls:"none",isPressEnterToChange:l,label:d,onKeyDown:N,onChange:(e,t)=>{if(""===e||null==e)return void p?.("",t);const n=function(e,t,n,r){const[o,i]=WC(e,t),a=null!=o?o:n;let s=i||r;return!s&&$C(t)&&(s=t[0].value),[a,s]}(e,k,E,S).join("");p?.(n,t)},ref:t,size:m,suffix:A,type:l?"text":"number",value:null!=E?E:"",step:B,onFocus:v,__unstableStateReducer:n})}));var rx=nx,ox=n(26111),ix=n(42907),ax=n(73863);const sx="var:",lx="|",cx="--",ux=(e,t)=>{let n=e;return t.forEach((e=>{n=n?.[e]})),n};function dx(e,t,n,r){const o=ux(e,n);return o?[{selector:t?.selector,key:r,value:hx(o)}]:[]}function px(e,t,n,r,o=["top","right","bottom","left"]){const i=ux(e,n);if(!i)return[];const a=[];if("string"==typeof i)a.push({selector:t?.selector,key:r.default,value:i});else{const e=o.reduce(((e,n)=>{const o=hx(ux(i,[n]));return o&&e.push({selector:t?.selector,key:r?.individual.replace("%s",mx(n)),value:o}),e}),[]);a.push(...e)}return a}function hx(e){return"string"==typeof e&&e.startsWith(sx)?`var(--wp--${e.slice(sx.length).split(lx).map((e=>(0,rd.o)(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(cx)})`:e}function mx(e){const[t,...n]=e;return t.toUpperCase()+n.join("")}function fx(e){try{return decodeURI(e)}catch(t){return e}}function gx(e){return(t,n)=>dx(t,n,e,function(e){const[t,...n]=e;return t.toLowerCase()+n.map(mx).join("")}(e))}function bx(e){return(t,n)=>["color","style","width"].flatMap((r=>gx(["border",e,r])(t,n)))}const vx={name:"radius",generate:(e,t)=>px(e,t,["border","radius"],{default:"borderRadius",individual:"border%sRadius"},["topLeft","topRight","bottomLeft","bottomRight"])},yx={name:"background",generate:(e,t)=>dx(e,t,["color","background"],"backgroundColor")},_x={name:"gradient",generate:(e,t)=>dx(e,t,["color","gradient"],"background")},kx={name:"text",generate:(e,t)=>dx(e,t,["color","text"],"color")},wx={name:"minHeight",generate:(e,t)=>dx(e,t,["dimensions","minHeight"],"minHeight")},Ex={name:"aspectRatio",generate:(e,t)=>dx(e,t,["dimensions","aspectRatio"],"aspectRatio")},Cx={name:"backgroundImage",generate:(e,t)=>{const n=e?.background?.backgroundImage,r=e?.background?.backgroundSize,o=[];return n?("file"===n?.source&&n?.url&&o.push({selector:t.selector,key:"backgroundImage",value:`url( '${encodeURI(fx(n.url))}' )`}),void 0===r&&o.push({selector:t.selector,key:"backgroundSize",value:"cover"}),o):o}},xx={name:"backgroundRepeat",generate:(e,t)=>dx(e,t,["background","backgroundPosition"],"backgroundPosition")},Sx={name:"backgroundRepeat",generate:(e,t)=>dx(e,t,["background","backgroundRepeat"],"backgroundRepeat")},Ix={name:"backgroundSize",generate:(e,t)=>{const n=e?.background?.backgroundSize,r=e?.background?.backgroundPosition,o=[];return void 0===n||(o.push(...dx(e,t,["background","backgroundSize"],"backgroundSize")),"contain"===n&&void 0===r&&o.push({selector:t.selector,key:"backgroundPosition",value:"center"})),o}},Tx={name:"shadow",generate:(e,t)=>dx(e,t,["shadow"],"boxShadow")},Nx={name:"color",generate:(e,t,n=["outline","color"],r="outlineColor")=>dx(e,t,n,r)},Px={name:"offset",generate:(e,t,n=["outline","offset"],r="outlineOffset")=>dx(e,t,n,r)},Rx={name:"style",generate:(e,t,n=["outline","style"],r="outlineStyle")=>dx(e,t,n,r)},Ax={name:"width",generate:(e,t,n=["outline","width"],r="outlineWidth")=>dx(e,t,n,r)},Bx={name:"padding",generate:(e,t)=>px(e,t,["spacing","padding"],{default:"padding",individual:"padding%s"})},Lx={name:"margin",generate:(e,t)=>px(e,t,["spacing","margin"],{default:"margin",individual:"margin%s"})},Mx={name:"fontSize",generate:(e,t)=>dx(e,t,["typography","fontSize"],"fontSize")},Dx={name:"fontStyle",generate:(e,t)=>dx(e,t,["typography","fontStyle"],"fontStyle")},Ox={name:"fontWeight",generate:(e,t)=>dx(e,t,["typography","fontWeight"],"fontWeight")},Fx={name:"fontFamily",generate:(e,t)=>dx(e,t,["typography","fontFamily"],"fontFamily")},jx={name:"letterSpacing",generate:(e,t)=>dx(e,t,["typography","letterSpacing"],"letterSpacing")},Zx={name:"lineHeight",generate:(e,t)=>dx(e,t,["typography","lineHeight"],"lineHeight")},zx={name:"textColumns",generate:(e,t)=>dx(e,t,["typography","textColumns"],"columnCount")},Vx={name:"textDecoration",generate:(e,t)=>dx(e,t,["typography","textDecoration"],"textDecoration")},Hx={name:"textTransform",generate:(e,t)=>dx(e,t,["typography","textTransform"],"textTransform")},Ux={name:"writingMode",generate:(e,t)=>dx(e,t,["typography","writingMode"],"writingMode")},$x=[{name:"color",generate:gx(["border","color"])},{name:"style",generate:gx(["border","style"])},{name:"width",generate:gx(["border","width"])},vx,{name:"borderTop",generate:bx("top")},{name:"borderRight",generate:bx("right")},{name:"borderBottom",generate:bx("bottom")},{name:"borderLeft",generate:bx("left")},kx,_x,yx,wx,Ex,Nx,Rx,Px,Ax,Lx,Bx,Fx,Mx,Dx,Ox,jx,Zx,zx,Vx,Hx,Ux,Tx,Cx,xx,Sx,Ix];function Wx(e,t={}){const n=Gx(e,t);if(!t?.selector){const e=[];return n.forEach((t=>{e.push(`${(0,rd.o)(t.key)}: ${t.value};`)})),e.join(" ")}const r=n.reduce(((e,t)=>{const{selector:n}=t;return n?(e[n]||(e[n]=[]),e[n].push(t),e):e}),{});return Object.keys(r).reduce(((e,t)=>(e.push(`${t} { ${r[t].map((e=>`${(0,rd.o)(e.key)}: ${e.value};`)).join(" ")} }`),e)),[]).join("\n")}function Gx(e,t={}){const n=[];return $x.forEach((r=>{"function"==typeof r.generate&&n.push(...r.generate(e,t))})),n}var qx={name:"constrained",label:(0,$.__)("Constrained"),inspectorControls:function({layout:e,onChange:t,layoutBlockSupport:n={}}){const{wideSize:r,contentSize:o,justifyContent:i="center"}=e,{allowJustification:a=!0}=n,s=[{value:"left",icon:Gk.Z,label:(0,$.__)("Justify items left")},{value:"center",icon:qk.Z,label:(0,$.__)("Justify items center")},{value:"right",icon:Kk.Z,label:(0,$.__)("Justify items right")}],l=GC({availableUnits:YE("spacing.units")||["%","px","em","rem","vw"]});return(0,x.createElement)(x.Fragment,null,(0,x.createElement)("div",{className:"block-editor-hooks__layout-controls"},(0,x.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,x.createElement)(rx,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,$.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,contentSize:n})},units:l}),(0,x.createElement)(ox.Z,{icon:ix.Z})),(0,x.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,x.createElement)(rx,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,$.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,wideSize:n})},units:l}),(0,x.createElement)(ox.Z,{icon:ax.Z}))),(0,x.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,$.__)("Customize the width for all elements that are assigned to the center or wide columns.")),a&&(0,x.createElement)(Dw,{__nextHasNoMarginBottom:!0,label:(0,$.__)("Justification"),value:i,onChange:n=>{t({...e,justifyContent:n})}},s.map((({value:e,icon:t,label:n})=>(0,x.createElement)(iE,{key:e,value:e,icon:t,label:n})))))},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,layout:t={},style:n,blockName:r,hasBlockGapSupport:o,layoutDefinitions:i=sE}){const{contentSize:a,wideSize:s,justifyContent:l}=t,c=TE(n?.spacing?.blockGap);let u="";SC(r,"spacing","blockGap")||(c?.top?u=TE(c?.top):"string"==typeof c&&(u=TE(c)));const d="left"===l?"0 !important":"auto !important",p="right"===l?"0 !important":"auto !important";let h=a||s?`\n\t\t\t\t\t${lE(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} {\n\t\t\t\t\t\tmax-width: ${null!=a?a:s};\n\t\t\t\t\t\tmargin-left: ${d};\n\t\t\t\t\t\tmargin-right: ${p};\n\t\t\t\t\t}\n\t\t\t\t\t${lE(e,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=s?s:a};\n\t\t\t\t\t}\n\t\t\t\t\t${lE(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?h+=`${lE(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-left: ${d}; }`:"right"===l&&(h+=`${lE(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-right: ${p}; }`),n?.spacing?.padding&&Gx(n).forEach((t=>{"paddingRight"===t.key?h+=`\n\t\t\t\t\t${lE(e,"> .alignfull")} {\n\t\t\t\t\t\tmargin-right: calc(${t.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`:"paddingLeft"===t.key&&(h+=`\n\t\t\t\t\t${lE(e,"> .alignfull")} {\n\t\t\t\t\t\tmargin-left: calc(${t.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`)})),o&&u&&(h+=cE(e,i,"constrained",u)),h},getOrientation(){return"vertical"},getAlignments(e){const t=uE(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:t[e]})));const{contentSize:n,wideSize:r}=e,o=[{name:"left"},{name:"center"},{name:"right"}];return n&&o.unshift({name:"full"}),r&&o.unshift({name:"wide",info:t.wide}),o.unshift({name:"none",info:t.none}),o}},Kx=n(15155),Yx=n(84927);function Xx(e,t,n){return"number"!=typeof e?null:parseFloat(`${(0,Yx.uZ)(e,t,n)}`)}const Jx=()=>(0,b_.css)({height:30,minHeight:30},"",""),Qx=(0,g_.default)("div",{target:"e1epgpqk14"})("-webkit-tap-highlight-color:transparent;align-items:center;display:flex;justify-content:flex-start;padding:0;position:relative;touch-action:none;width:100%;min-height:40px;",(({__next40pxDefaultSize:e})=>!e&&(0,b_.css)({minHeight:30},"","")),";"),eS=(0,g_.default)("div",{target:"e1epgpqk13"})("display:block;flex:1;position:relative;width:100%;",(({color:e=N_.D.ui.borderFocus})=>(0,b_.css)({color:e},"","")),";",Jx,";",(({marks:e,__nextHasNoMarginBottom:t})=>t?"":(0,b_.css)({marginBottom:e?16:void 0},"","")),";"),tS=(0,g_.default)("span",{target:"e1epgpqk12"})("display:flex;margin-top:",4,"px;",(0,$_.b)({marginRight:6}),";"),nS=(0,g_.default)("span",{target:"e1epgpqk11"})("display:flex;margin-top:",4,"px;",(0,$_.b)({marginLeft:6}),";"),rS=(0,g_.default)("span",{target:"e1epgpqk10"})("background-color:",N_.D.gray[300],";left:0;pointer-events:none;right:0;display:block;height:",4,"px;position:absolute;margin-top:",13,"px;top:0;border-radius:",4,"px;",(({disabled:e,railColor:t})=>{let n=t||"";return e&&(n=N_.D.ui.backgroundDisabled),(0,b_.css)({background:n},"","")}),";"),oS=(0,g_.default)("span",{target:"e1epgpqk9"})("background-color:currentColor;border-radius:",4,"px;height:",4,"px;pointer-events:none;display:block;position:absolute;margin-top:",13,"px;top:0;",(({disabled:e,trackColor:t})=>{let n=t||"currentColor";return e&&(n=N_.D.gray[400]),(0,b_.css)({background:n},"","")}),";"),iS=(0,g_.default)("span",{target:"e1epgpqk8"})({name:"l7tjj5",styles:"display:block;pointer-events:none;position:relative;width:100%;user-select:none"}),aS=(0,g_.default)("span",{target:"e1epgpqk7"})("height:",12,"px;left:0;position:absolute;top:-4px;width:1px;",(({disabled:e,isFilled:t})=>{let n=t?"currentColor":N_.D.gray[300];return e&&(n=N_.D.gray[400]),(0,b_.css)({backgroundColor:n},"","")}),";"),sS=(0,g_.default)("span",{target:"e1epgpqk6"})("color:",N_.D.gray[300],";left:0;font-size:11px;position:absolute;top:12px;transform:translateX( -50% );white-space:nowrap;",(({isFilled:e})=>(0,b_.css)({color:e?N_.D.gray[700]:N_.D.gray[300]},"","")),";"),lS=({disabled:e})=>e?(0,b_.css)("background-color:",N_.D.gray[400],";",""):(0,b_.css)("background-color:",N_.D.theme.accent,";",""),cS=(0,g_.default)("span",{target:"e1epgpqk5"})("align-items:center;display:flex;height:",12,"px;justify-content:center;margin-top:",9,"px;outline:0;pointer-events:none;position:absolute;top:0;user-select:none;width:",12,"px;border-radius:50%;",lS,";",(0,$_.b)({marginLeft:-10}),";",(0,$_.b)({transform:"translateX( 4.5px )"},{transform:"translateX( -4.5px )"}),";"),uS=(0,g_.default)("span",{target:"e1epgpqk4"})("align-items:center;border-radius:50%;height:100%;outline:0;position:absolute;user-select:none;width:100%;",lS,";",(({isFocused:e})=>e?(0,b_.css)("&::before{content:' ';position:absolute;background-color:",N_.D.theme.accent,";opacity:0.4;border-radius:50%;height:",20,"px;width:",20,"px;top:-4px;left:-4px;}",""):""),";"),dS=(0,g_.default)("input",{target:"e1epgpqk3"})("box-sizing:border-box;cursor:pointer;display:block;height:100%;left:0;margin:0 -",6,"px;opacity:0;outline:none;position:absolute;right:0;top:0;width:calc( 100% + ",12,"px );");var pS={name:"1cypxip",styles:"top:-80%"},hS={name:"1lr98c4",styles:"bottom:-80%"};const mS=(0,g_.default)("span",{target:"e1epgpqk2"})("background:rgba( 0, 0, 0, 0.8 );border-radius:2px;color:white;display:inline-block;font-size:12px;min-width:32px;opacity:0;padding:4px 8px;pointer-events:none;position:absolute;text-align:center;transition:opacity 120ms ease;user-select:none;line-height:1.4;",(({show:e})=>(0,b_.css)({opacity:e?1:0},"","")),";",(({position:e})=>"bottom"===e?hS:pS),";",(0,Vw.r)("transition"),";",(0,$_.b)({transform:"translateX(-50%)"},{transform:"translateX(50%)"}),";"),fS=(0,g_.default)(qC.Z,{target:"e1epgpqk1"})("display:inline-block;font-size:13px;margin-top:0;input[type='number']&{",Jx,";}",(0,$_.b)({marginLeft:`${(0,W_.D)(4)} !important`}),";"),gS=(0,g_.default)("span",{target:"e1epgpqk0"})("display:block;margin-top:0;button,button.is-small{margin-left:0;",Jx,";}",(0,$_.b)({marginLeft:8}),";");var bS=(0,x.forwardRef)((function(e,t){const{describedBy:n,label:r,value:o,...i}=e;return(0,x.createElement)(dS,{...i,"aria-describedby":n,"aria-label":r,"aria-hidden":!1,ref:t,tabIndex:0,type:"range",value:o})}));function vS(e){const{className:t,isFilled:n=!1,label:r,style:o={},...i}=e,a=R()("components-range-control__mark",n&&"is-filled",t),s=R()("components-range-control__mark-label",n&&"is-filled");return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(aS,{...i,"aria-hidden":"true",className:a,isFilled:n,style:o}),r&&(0,x.createElement)(sS,{"aria-hidden":"true",className:s,isFilled:n,style:o},r))}function yS(e){const{disabled:t=!1,marks:n=!1,min:r=0,max:o=100,step:i=1,value:a=0,...s}=e;return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(rS,{disabled:t,...s}),n&&(0,x.createElement)(_S,{disabled:t,marks:n,min:r,max:o,step:i,value:a}))}function _S(e){const{disabled:t=!1,marks:n=!1,min:r=0,max:o=100,step:i=1,value:a=0}=e,s=function({marks:e,min:t=0,max:n=100,step:r=1,value:o=0}){if(!e)return[];const i=n-t;if(!Array.isArray(e)){e=[];const n=1+Math.round(i/r);for(;n>e.push({value:r*e.length+t}););}const a=[];return e.forEach(((e,r)=>{if(e.value<t||e.value>n)return;const s=`mark-${r}`,l=e.value<=o,c=(e.value-t)/i*100+"%",u={[(0,d_.isRTL)()?"right":"left"]:c};a.push({...e,isFilled:l,key:s,style:u})})),a}({marks:n,min:r,max:o,step:"any"===i?1:i,value:a});return(0,x.createElement)(iS,{"aria-hidden":"true",className:"components-range-control__marks"},s.map((e=>(0,x.createElement)(vS,{...e,key:e.key,"aria-hidden":"true",disabled:t}))))}function kS(e){const{className:t,inputRef:n,tooltipPosition:r,show:o=!1,style:i={},value:a=0,renderTooltipContent:s=(e=>e),zIndex:l=100,...c}=e,u=function({inputRef:e,tooltipPosition:t}){const[n,r]=(0,x.useState)(),o=(0,x.useCallback)((()=>{e&&e.current&&r(t)}),[t,e]);return(0,x.useEffect)((()=>{o()}),[o]),(0,x.useEffect)((()=>(window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o)}))),n}({inputRef:n,tooltipPosition:r}),d=R()("components-simple-tooltip",t),p={...i,zIndex:l};return(0,x.createElement)(mS,{...c,"aria-hidden":o,className:d,position:u,show:o,role:"tooltip",style:p},s(a))}const wS=()=>{},ES=(0,x.forwardRef)((function e(t,n){const{__nextHasNoMarginBottom:r=!1,afterIcon:o,allowReset:i=!1,beforeIcon:a,className:s,color:l=N_.D.theme.accent,currentInput:c,disabled:u=!1,help:d,hideLabelFromVision:p=!1,initialPosition:h,isShiftStepEnabled:m=!0,label:f,marks:g=!1,max:b=100,min:v=0,onBlur:y=wS,onChange:_=wS,onFocus:k=wS,onMouseLeave:w=wS,onMouseMove:E=wS,railColor:C,renderTooltipContent:S=(e=>e),resetFallbackValue:I,__next40pxDefaultSize:T=!1,shiftStep:N=10,showTooltip:P,step:A=1,trackColor:B,value:L,withInputField:M=!0,...D}=t,[O,F]=function(e){const{min:t,max:n,value:r,initial:o}=e,[i,a]=(0,ex.Z)(Xx(r,t,n),{initial:Xx(null!=o?o:null,t,n),fallback:null});return[i,(0,x.useCallback)((e=>{a(null===e?null:Xx(e,t,n))}),[t,n,a])]}({min:v,max:b,value:null!=L?L:null,initial:h}),j=(0,x.useRef)(!1);let Z=P,z=M;"any"===A&&(Z=!1,z=!1);const[V,H]=(0,x.useState)(Z),[U,$]=(0,x.useState)(!1),W=(0,x.useRef)(),G=W.current?.matches(":focus"),q=!u&&U,K=null===O,Y=K?"":void 0!==O?O:c,X=K?(b-v)/2+v:O,J=K?50:(O-v)/(b-v)*100,Q=`${(0,Yx.uZ)(J,0,100)}%`,ee=R()("components-range-control",s),te=R()("components-range-control__wrapper",!!g&&"is-marked"),ne=(0,cw.Z)(e,"inspector-range-control"),re=d?`${ne}__help`:void 0,oe=!1!==Z&&Number.isFinite(O),ie=()=>{let e=parseFloat(`${I}`),t=e;isNaN(e)&&(e=null,t=void 0),F(e),_(t)},ae={[(0,d_.isRTL)()?"right":"left"]:Q};return(0,x.createElement)(uw.ZP,{__nextHasNoMarginBottom:r,className:ee,label:f,hideLabelFromVision:p,id:`${ne}`,help:d},(0,x.createElement)(Qx,{className:"components-range-control__root",__next40pxDefaultSize:T},a&&(0,x.createElement)(tS,null,(0,x.createElement)(V_.Z,{icon:a})),(0,x.createElement)(eS,{__nextHasNoMarginBottom:r,className:te,color:l,marks:!!g},(0,x.createElement)(bS,{...D,className:"components-range-control__slider",describedBy:re,disabled:u,id:`${ne}`,label:f,max:b,min:v,onBlur:e=>{y(e),$(!1),H(!1)},onChange:e=>{const t=parseFloat(e.target.value);F(t),_(t)},onFocus:e=>{k(e),$(!0),H(!0)},onMouseMove:E,onMouseLeave:w,ref:(0,Kx.Z)([W,n]),step:A,value:null!=Y?Y:void 0}),(0,x.createElement)(yS,{"aria-hidden":!0,disabled:u,marks:g,max:b,min:v,railColor:C,step:A,value:X}),(0,x.createElement)(oS,{"aria-hidden":!0,className:"components-range-control__track",disabled:u,style:{width:Q},trackColor:B}),(0,x.createElement)(cS,{className:"components-range-control__thumb-wrapper",style:ae,disabled:u},(0,x.createElement)(uS,{"aria-hidden":!0,isFocused:q,disabled:u})),oe&&(0,x.createElement)(kS,{className:"components-range-control__tooltip",inputRef:W,tooltipPosition:"bottom",renderTooltipContent:S,show:G||V,style:ae,value:O})),o&&(0,x.createElement)(nS,null,(0,x.createElement)(V_.Z,{icon:o})),z&&(0,x.createElement)(fS,{"aria-label":f,className:"components-range-control__number",disabled:u,inputMode:"decimal",isShiftStepEnabled:m,max:b,min:v,onBlur:()=>{j.current&&(ie(),j.current=!1)},onChange:e=>{let t=parseFloat(e);F(t),isNaN(t)?i&&(j.current=!0):((t<v||t>b)&&(t=Xx(t,v,b)),_(t),j.current=!1)},shiftStep:N,size:T?"__unstable-large":"default",__unstableInputWidth:T?(0,W_.D)(20):(0,W_.D)(16),step:A,value:Y}),i&&(0,x.createElement)(gS,null,(0,x.createElement)(Gh.ZP,{className:"components-range-control__reset",disabled:u||void 0===O,variant:"secondary",isSmall:!0,onClick:ie},(0,d_.__)("Reset")))))}));var CS=ES;const xS={px:600,"%":100,vw:100,vh:100,em:38,rem:38};var SS={name:"grid",label:(0,$.__)("Grid"),inspectorControls:function({layout:e={},onChange:t}){return e?.columnCount?(0,x.createElement)(TS,{layout:e,onChange:t}):(0,x.createElement)(IS,{layout:e,onChange:t})},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:r,hasBlockGapSupport:o,layoutDefinitions:i=sE}){const{minimumColumnWidth:a="12rem",columnCount:s=null}=t,l=n?.spacing?.blockGap&&!SC(r,"spacing","blockGap")?TE(n?.spacing?.blockGap,"0.5em"):void 0;let c="";const u=[];return s?u.push(`grid-template-columns: repeat(${s}, minmax(0, 1fr))`):a&&u.push(`grid-template-columns: repeat(auto-fill, minmax(min(${a}, 100%), 1fr))`),u.length&&(c=`${lE(e)} { ${u.join("; ")}; }`),o&&l&&(c+=cE(e,i,"grid",l)),c},getOrientation(){return"horizontal"},getAlignments(){return[]}};function IS({layout:e,onChange:t}){const{minimumColumnWidth:n="12rem"}=e,[r,o]=WC(n);return(0,x.createElement)("fieldset",null,(0,x.createElement)(uw.ZP.VisualLabel,{as:"legend"},(0,$.__)("Minimum column width")),(0,x.createElement)(ew.Z,{gap:4},(0,x.createElement)(tw.Z,{isBlock:!0},(0,x.createElement)(rx,{size:"__unstable-large",onChange:n=>{t({...e,minimumColumnWidth:n})},onUnitChange:n=>{let i;["em","rem"].includes(n)&&"px"===o?i=(r/16).toFixed(2)+n:["em","rem"].includes(o)&&"px"===n?i=Math.round(16*r)+n:["vh","vw","%"].includes(n)&&r>100&&(i=100+n),t({...e,minimumColumnWidth:i})},value:n,min:0})),(0,x.createElement)(tw.Z,{isBlock:!0},(0,x.createElement)(CS,{onChange:n=>{t({...e,minimumColumnWidth:[n,o].join("")})},value:r,min:0,max:xS[o]||600,withInputField:!1}))))}function TS({layout:e,onChange:t}){const{columnCount:n=3}=e;return(0,x.createElement)(CS,{label:(0,$.__)("Columns"),value:n,onChange:n=>t({...e,columnCount:n}),min:1,max:6})}const NS=[FC,AC,qx,SS];function PS(e="default"){return NS.find((t=>t.name===e))}const RS={type:"default"},AS=(0,x.createContext)(RS),BS=AS.Provider;function LS(){return(0,x.useContext)(AS)}const MS=[],DS=["none","left","center","right","wide","full"],OS=["wide","full"];function FS(e=DS){e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n,isBlockBasedTheme:r}=(0,yl.Z)((e=>{const{getSettings:t}=e(e_),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout,isBlockBasedTheme:n.__unstableIsBlockBasedTheme}}),[]),o=LS(),i=PS(o?.type),a=i.getAlignments(o,r);if(n){const t=a.filter((({name:t})=>e.includes(t)));return 1===t.length&&"none"===t[0].name?MS:t}if("default"!==i.name&&"constrained"!==i.name)return MS;const{alignments:s=DS}=o,l=e.filter((e=>(o.alignments||t||!OS.includes(e))&&s.includes(e))).map((e=>({name:e})));return 1===l.length&&"none"===l[0].name?MS:l}var jS=n(82427),ZS=n(66216),zS=n(24113),VS=n(28963);const HS={none:{icon:jS.Z,title:(0,$._x)("None","Alignment option")},left:{icon:ZS.Z,title:(0,$.__)("Align left")},center:{icon:ix.Z,title:(0,$.__)("Align center")},right:{icon:zS.Z,title:(0,$.__)("Align right")},wide:{icon:ax.Z,title:(0,$.__)("Wide width")},full:{icon:VS.Z,title:(0,$.__)("Full width")}};var US=function({value:e,onChange:t,controls:n,isToolbar:r,isCollapsed:o=!0}){const i=FS(n);if(!i.length)return null;function a(n){t([e,"none"].includes(n)?void 0:n)}const s=HS[e],l=HS.none,c=r?nm:Uk,u={icon:s?s.icon:l.icon,label:(0,$.__)("Align")},d=r?{isCollapsed:o,controls:i.map((({name:t})=>({...HS[t],isActive:e===t||!e&&"none"===t,role:o?"menuitemradio":void 0,onClick:()=>a(t)})))}:{toggleProps:{describedBy:(0,$.__)("Change alignment")},children:({onClose:t})=>(0,x.createElement)(x.Fragment,null,(0,x.createElement)($k.Z,{className:"block-editor-block-alignment-control__menu-group"},i.map((({name:n,info:r})=>{const{icon:o,title:i}=HS[n],s=n===e||!e&&"none"===n;return(0,x.createElement)(Wk.Z,{key:n,icon:o,iconPosition:"left",className:R()("components-dropdown-menu__menu-item",{"is-active":s}),isSelected:s,onClick:()=>{a(n),t()},role:"menuitemradio",info:r},i)}))))};return(0,x.createElement)(c,{...u,...d})};const $S=e=>(0,x.createElement)(US,{...e,isToolbar:!1}),WS=(0,x.createContext)(null);function GS(e){var t;const{clientId:n=""}=null!==(t=(0,x.useContext)(WS))&&void 0!==t?t:{},r=(0,yl.Z)((e=>e(e_).getBlockEditingMode(n)),[n]),{setBlockEditingMode:o,unsetBlockEditingMode:i}=(0,_l.Z)(e_);return(0,x.useEffect)((()=>(e&&o(n,e),()=>{e&&i(n)})),[n,e,o,i]),r}const qS=["left","center","right","wide","full"],KS=["wide","full"];function YS(e,t=!0,n=!0){let r;return r=Array.isArray(e)?qS.filter((t=>e.includes(t))):!0===e?[...qS]:[],!n||!0===e&&!t?r.filter((e=>!KS.includes(e))):r}const XS=(0,Wh.o)((e=>t=>{const n=(0,x.createElement)(e,{key:"edit",...t}),{name:r}=t,o=FS(YS(cc(r,"align"),uc(r,"alignWide",!0))).map((({name:e})=>e)),i=GS();return o.length&&"default"===i?(0,x.createElement)(x.Fragment,null,(0,x.createElement)(Hk,{group:"block",__experimentalShareWithChildBlocks:!0},(0,x.createElement)($S,{value:t.attributes.align,onChange:e=>{if(!e){const n=sc(t.name),r=n?.attributes?.align?.default;r&&(e="")}t.setAttributes({align:e})},controls:o})),n):n}),"withToolbarControls"),JS=(0,Wh.o)((e=>t=>{const{name:n,attributes:r}=t,{align:o}=r,i=FS(YS(cc(n,"align"),uc(n,"alignWide",!0)));if(void 0===o)return(0,x.createElement)(e,{...t});let a=t.wrapperProps;return i.some((e=>e.name===o))&&(a={...a,"data-align":o}),(0,x.createElement)(e,{...t,wrapperProps:a})}),"withDataAlign");(0,mc.addFilter)("blocks.registerBlockType","core/align/addAttribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.align)&&void 0!==t?t:{})||uc(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...qS,""]}}),e})),(0,mc.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",JS),(0,mc.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",XS),(0,mc.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:r}=n;return YS(cc(t,"align"),uc(t,"alignWide",!0)).includes(r)&&(e.className=R()(`align${r}`,e.className)),e})),(0,mc.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.lock)&&void 0!==t?t:{})||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));var QS=n(86339),eI=n(73817),tI=n(93832);const nI=()=>{},rI=(0,x.createContext)({menuItems:{default:{},optional:{}},hasMenuItems:!1,isResetting:!1,shouldRenderPlaceholderItems:!1,registerPanelItem:nI,deregisterPanelItem:nI,flagItemCustomization:nI,registerResetAllFilter:nI,deregisterResetAllFilter:nI,areAllOptionalControlsHidden:!0}),oI=()=>(0,x.useContext)(rI),iI=(0,kl.up)("InspectorControls"),aI=(0,kl.up)("InspectorAdvancedControls"),sI=(0,kl.up)("InspectorControlsBackground"),lI=(0,kl.up)("InspectorControlsBorder"),cI=(0,kl.up)("InspectorControlsColor"),uI=(0,kl.up)("InspectorControlsFilter"),dI=(0,kl.up)("InspectorControlsDimensions"),pI=(0,kl.up)("InspectorControlsPosition"),hI=(0,kl.up)("InspectorControlsTypography");var mI={default:iI,advanced:aI,background:sI,border:lI,color:cI,dimensions:dI,filter:uI,list:(0,kl.up)("InspectorControlsListView"),position:pI,settings:iI,styles:(0,kl.up)("InspectorControlsStyles"),typography:hI};function fI({children:e,group:t="default",__experimentalGroup:n,resetAllFilter:r}){n&&((0,q.Z)("`__experimentalGroup` property in `InspectorControlsFill`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=n);const o=a_(),i=mI[t]?.Fill;return i?o?(0,x.createElement)(rm.Z,{document:document},(0,x.createElement)(i,null,(t=>(0,x.createElement)(bI,{fillProps:t,children:e,resetAllFilter:r})))):null:("undefined"!=typeof SCRIPT_DEBUG&&!0===SCRIPT_DEBUG&&(0,Tk.default)(`Unknown InspectorControls group "${t}" provided.`),null)}function gI({resetAllFilter:e,children:t}){const{registerResetAllFilter:n,deregisterResetAllFilter:r}=(0,x.useContext)(rI);return(0,x.useEffect)((()=>{if(e&&n&&r)return n(e),()=>{r(e)}}),[e,n,r]),t}function bI({children:e,resetAllFilter:t,fillProps:n}){const{forwardedContext:r=[]}=n,o=(0,x.createElement)(gI,{resetAllFilter:t},e);return r.reduce(((e,[t,n])=>(0,x.createElement)(t,{...n},e)),o)}var vI=n(20428),yI=n(57608),_I=n(81618),kI=n(13738),wI=n(8225),EI=n(90710);const CI={columns:e=>(0,b_.css)("grid-template-columns:",`repeat( ${e}, minmax(0, 1fr) )`,";",""),spacing:(0,b_.css)("column-gap:",(0,W_.D)(2),";row-gap:",(0,W_.D)(4),";",""),item:{fullWidth:{name:"18iuzk9",styles:"grid-column:1/-1"}}},xI={name:"huufmu",styles:">div:not( :first-of-type ){display:none;}"},SI=(0,b_.css)(CI.item.fullWidth," gap:",(0,W_.D)(2),";.components-dropdown-menu{margin:",(0,W_.D)(-1)," 0;line-height:0;}&&&& .components-dropdown-menu__toggle{padding:0;min-width:",(0,W_.D)(6),";}",""),II={name:"1pmxm02",styles:"font-size:inherit;font-weight:500;line-height:normal;&&{margin:0;}"},TI=(0,b_.css)(CI.item.fullWidth,"&>div,&>fieldset{padding-bottom:0;margin-bottom:0;max-width:100%;}&& ",w_.im,"{margin-bottom:0;",w_.ob,":last-child{margin-bottom:0;}}",w_.vB,"{margin-bottom:0;}&& ",y_.ub,"{label{line-height:1.4em;}}",""),NI={name:"eivff4",styles:"display:none"},PI={name:"16gsvie",styles:"min-width:200px"},RI=(0,g_.default)("span",{target:"ews648u0"})("color:",N_.D.theme.accentDarker10,";font-size:11px;font-weight:500;line-height:1.4;",(0,$_.b)({marginLeft:(0,W_.D)(3)})," text-transform:uppercase;"),AI=(0,b_.css)("color:",N_.D.gray[900],";&&[aria-disabled='true']{color:",N_.D.gray[700],";opacity:1;&:hover{color:",N_.D.gray[700],";}",RI,"{opacity:0.3;}}",""),BI=({itemClassName:e,items:t,toggleItem:n})=>{if(!t.length)return null;const r=(0,x.createElement)(RI,{"aria-hidden":!0},(0,d_.__)("Reset"));return(0,x.createElement)($k.Z,{label:(0,d_.__)("Defaults")},t.map((([t,o])=>o?(0,x.createElement)(Wk.Z,{key:t,className:e,role:"menuitem",label:(0,d_.sprintf)((0,d_.__)("Reset %s"),t),onClick:()=>{n(t),(0,yI.speak)((0,d_.sprintf)((0,d_.__)("%s reset to default"),t),"assertive")},suffix:r},t):(0,x.createElement)(Wk.Z,{key:t,className:e,role:"menuitemcheckbox",isSelected:!0,"aria-disabled":!0},t))))},LI=({items:e,toggleItem:t})=>e.length?(0,x.createElement)($k.Z,{label:(0,d_.__)("Tools")},e.map((([e,n])=>{const r=n?(0,d_.sprintf)((0,d_.__)("Hide and reset %s"),e):(0,d_.sprintf)((0,d_.__)("Show %s"),e);return(0,x.createElement)(Wk.Z,{key:e,icon:n?u_.Z:null,isSelected:n,label:r,onClick:()=>{n?(0,yI.speak)((0,d_.sprintf)((0,d_.__)("%s hidden and reset to default"),e),"assertive"):(0,yI.speak)((0,d_.sprintf)((0,d_.__)("%s is now visible"),e),"assertive"),t(e)},role:"menuitemcheckbox"},e)}))):null;var MI=(0,Z_.Iq)(((e,t)=>{const{areAllOptionalControlsHidden:n,defaultControlsItemClassName:r,dropdownMenuClassName:o,hasMenuItems:i,headingClassName:a,headingLevel:s=2,label:l,menuItems:c,resetAll:u,toggleItem:d,...p}=function(e){const{className:t,headingLevel:n=2,...r}=(0,j_.y)(e,"ToolsPanelHeader"),o=(0,Ak.I)(),i=(0,x.useMemo)((()=>o(SI,t)),[t,o]),a=(0,x.useMemo)((()=>o(PI)),[o]),s=(0,x.useMemo)((()=>o(II)),[o]),l=(0,x.useMemo)((()=>o(AI)),[o]),{menuItems:c,hasMenuItems:u,areAllOptionalControlsHidden:d}=oI();return{...r,areAllOptionalControlsHidden:d,defaultControlsItemClassName:l,dropdownMenuClassName:a,hasMenuItems:u,headingClassName:s,headingLevel:n,menuItems:c,className:i}}(e);if(!l)return null;const h=Object.entries(c?.default||{}),m=Object.entries(c?.optional||{}),f=n?_I.Z:kI.Z,g=(0,d_.sprintf)((0,d_._x)("%s options","Button label to reveal tool panel options"),l),b=n?(0,d_.__)("All options are currently hidden"):void 0,v=[...h,...m].some((([,e])=>e));return(0,x.createElement)(wI.Z,{...p,ref:t},(0,x.createElement)(EI.Z,{level:s,className:a},l),i&&(0,x.createElement)(em.Z,{icon:f,label:g,menuProps:{className:o},toggleProps:{isSmall:!0,describedBy:b}},(()=>(0,x.createElement)(x.Fragment,null,(0,x.createElement)(BI,{items:h,toggleItem:d,itemClassName:r}),(0,x.createElement)(LI,{items:m,toggleItem:d}),(0,x.createElement)($k.Z,null,(0,x.createElement)(Wk.Z,{"aria-disabled":!v,variant:"tertiary",onClick:()=>{v&&(u(),(0,yI.speak)((0,d_.__)("All options reset"),"assertive"))}},(0,d_.__)("Reset all")))))))}),"ToolsPanelHeader");const DI=({panelItems:e,shouldReset:t,currentMenuItems:n,menuItemOrder:r})=>{const o={default:{},optional:{}},i={default:{},optional:{}};return e.forEach((({hasValue:e,isShownByDefault:r,label:i})=>{const a=r?"default":"optional",s=n?.[a]?.[i],l=s||e();o[a][i]=!t&&l})),r.forEach((e=>{o.default.hasOwnProperty(e)&&(i.default[e]=o.default[e]),o.optional.hasOwnProperty(e)&&(i.optional[e]=o.optional[e])})),Object.keys(o.default).forEach((e=>{i.default.hasOwnProperty(e)||(i.default[e]=o.default[e])})),Object.keys(o.optional).forEach((e=>{i.optional.hasOwnProperty(e)||(i.optional[e]=o.optional[e])})),i},OI=e=>e&&0===Object.keys(e).length;const FI={bottom:{alignItems:"flex-end",justifyContent:"center"},bottomLeft:{alignItems:"flex-start",justifyContent:"flex-end"},bottomRight:{alignItems:"flex-end",justifyContent:"flex-end"},center:{alignItems:"center",justifyContent:"center"},spaced:{alignItems:"center",justifyContent:"space-between"},left:{alignItems:"center",justifyContent:"flex-start"},right:{alignItems:"center",justifyContent:"flex-end"},stretch:{alignItems:"stretch"},top:{alignItems:"flex-start",justifyContent:"center"},topLeft:{alignItems:"flex-start",justifyContent:"flex-start"},topRight:{alignItems:"flex-start",justifyContent:"flex-end"}};var jI=n(40780);var ZI=(0,Z_.Iq)((function(e,t){const n=function(e){const{align:t,alignment:n,className:r,columnGap:o,columns:i=2,gap:a=3,isInline:s=!1,justify:l,rowGap:c,rows:u,templateColumns:d,templateRows:p,...h}=(0,j_.y)(e,"Grid"),m=Array.isArray(i)?i:[i],f=(0,jI.V)(m),g=Array.isArray(u)?u:[u],b=(0,jI.V)(g),v=d||!!i&&`repeat( ${f}, 1fr )`,y=p||!!u&&`repeat( ${b}, 1fr )`,_=(0,Ak.I)();return{...h,className:(0,x.useMemo)((()=>{const e=function(e){return e?FI[e]:{}}(n),i=(0,b_.css)({alignItems:t,display:s?"inline-grid":"grid",gap:`calc( ${T_.Z.gridBase} * ${a} )`,gridTemplateColumns:v||void 0,gridTemplateRows:y||void 0,gridRowGap:c,gridColumnGap:o,justifyContent:l,verticalAlign:s?"middle":void 0,...e},"","");return _(i,r)}),[t,n,r,o,_,a,v,y,s,l,c])}}(e);return(0,x.createElement)(Iw.Z,{...n,ref:t})}),"Grid");const zI=(0,Z_.Iq)(((e,t)=>{const{children:n,label:r,panelContext:o,resetAllItems:i,toggleItem:a,headingLevel:s,...l}=function(e){const{className:t,headingLevel:n=2,resetAll:r,panelId:o,hasInnerWrapper:i=!1,shouldRenderPlaceholderItems:a=!1,__experimentalFirstVisibleItemClass:s,__experimentalLastVisibleItemClass:l,...c}=(0,j_.y)(e,"ToolsPanel"),u=(0,x.useRef)(!1),d=u.current;(0,x.useEffect)((()=>{d&&(u.current=!1)}),[d]);const[p,h]=(0,x.useState)([]),[m,f]=(0,x.useState)([]),[g,b]=(0,x.useState)([]),v=(0,x.useCallback)((e=>{h((t=>{const n=[...t],r=n.findIndex((t=>t.label===e.label));return-1!==r&&n.splice(r,1),[...n,e]})),f((t=>t.includes(e.label)?t:[...t,e.label]))}),[h,f]),y=(0,x.useCallback)((e=>{h((t=>{const n=[...t],r=n.findIndex((t=>t.label===e));return-1!==r&&n.splice(r,1),n}))}),[h]),_=(0,x.useCallback)((e=>{b((t=>[...t,e]))}),[b]),k=(0,x.useCallback)((e=>{b((t=>t.filter((t=>t!==e))))}),[b]),[w,E]=(0,x.useState)({default:{},optional:{}});(0,x.useEffect)((()=>{E((e=>DI({panelItems:p,shouldReset:!1,currentMenuItems:e,menuItemOrder:m})))}),[p,E,m]);const C=(0,x.useCallback)(((e,t="default")=>{E((n=>({...n,[t]:{...n[t],[e]:!0}})))}),[E]),[S,I]=(0,x.useState)(!1);(0,x.useEffect)((()=>{if(OI(w?.default)&&!OI(w?.optional)){const e=!Object.entries(w.optional).some((([,e])=>e));I(e)}}),[w,I]);const T=(0,Ak.I)(),N=(0,x.useMemo)((()=>{const e=i&&(0,b_.css)(">div:not( :first-of-type ){display:grid;",CI.columns(2)," ",CI.spacing," ",CI.item.fullWidth,";}",""),n=OI(w?.default)&&S&&xI;return T((0,b_.css)(CI.columns(2)," ",CI.spacing," border-top:",T_.Z.borderWidth," solid ",N_.D.gray[300],";margin-top:-1px;padding:",(0,W_.D)(4),";",""),e,n,t)}),[S,t,T,i,w]),P=(0,x.useCallback)((e=>{const t=p.find((t=>t.label===e));if(!t)return;const n=t.isShownByDefault?"default":"optional",r={...w,[n]:{...w[n],[e]:!w[n][e]}};E(r)}),[w,p,E]),R=(0,x.useCallback)((()=>{"function"==typeof r&&(u.current=!0,r(g));const e=DI({panelItems:p,menuItemOrder:m,shouldReset:!0});E(e)}),[p,g,r,E,m]),A=e=>{const t=w.optional||{},n=e.find((e=>e.isShownByDefault||!!t[e.label]));return n?.label},B=A(p),L=A([...p].reverse());return{...c,headingLevel:n,panelContext:(0,x.useMemo)((()=>({areAllOptionalControlsHidden:S,deregisterPanelItem:y,deregisterResetAllFilter:k,firstDisplayedItem:B,flagItemCustomization:C,hasMenuItems:!!p.length,isResetting:u.current,lastDisplayedItem:L,menuItems:w,panelId:o,registerPanelItem:v,registerResetAllFilter:_,shouldRenderPlaceholderItems:a,__experimentalFirstVisibleItemClass:s,__experimentalLastVisibleItemClass:l})),[S,y,k,B,C,L,w,o,p,_,v,a,s,l]),resetAllItems:R,toggleItem:P,className:N}}(e);return(0,x.createElement)(ZI,{...l,columns:2,ref:t},(0,x.createElement)(rI.Provider,{value:o},(0,x.createElement)(MI,{label:r,resetAll:i,toggleItem:a,headingLevel:s}),n))}),"ToolsPanel");var VI=zI;function HI({children:e,group:t,label:n}){const{updateBlockAttributes:r}=(0,_l.Z)(e_),{getBlockAttributes:o,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:a,hasMultiSelection:s}=(0,yl.Z)(e_),l=a(),c=(0,x.useCallback)(((e=[])=>{const t={},n=s()?i():[l];n.forEach((n=>{const{style:r}=o(n);let i={style:r};e.forEach((e=>{i={...i,...e(i)}})),i={...i,style:CC(i.style)},t[n]=i})),r(n,t,!0)}),[o,i,s,l,r]);return(0,x.createElement)(VI,{className:`${t}-block-support-panel`,label:n,resetAll:c,key:l,panelId:l,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},e)}function UI({Slot:e,fillProps:t,...n}){const r=(0,x.useContext)(rI),o=(0,x.useMemo)((()=>{var e;return{...null!=t?t:{},forwardedContext:[...null!==(e=t?.forwardedContext)&&void 0!==e?e:[],[rI.Provider,{value:r}]]}}),[r,t]);return(0,x.createElement)(e,{...n,fillProps:o,bubblesVirtually:!0})}function $I({__experimentalGroup:e,group:t="default",label:n,fillProps:r,...o}){e&&((0,q.Z)("`__experimentalGroup` property in `InspectorControlsSlot`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=e);const i=mI[t]?.Slot,a=Fk(i?.__unstableName),s=(0,x.useContext)(vI.v),l=(0,x.useMemo)((()=>{var e;return{...null!=r?r:{},forwardedContext:[...null!==(e=r?.forwardedContext)&&void 0!==e?e:[],[vI.v.Provider,{value:s}]]}}),[s,r]);return i?a?.length?n?(0,x.createElement)(HI,{group:t,label:n},(0,x.createElement)(UI,{...o,fillProps:l,Slot:i})):(0,x.createElement)(i,{...o,fillProps:l,bubblesVirtually:!0}):null:("undefined"!=typeof SCRIPT_DEBUG&&!0===SCRIPT_DEBUG&&(0,Tk.default)(`Unknown InspectorControls group "${t}" provided.`),null)}const WI=fI;WI.Slot=$I;const GI=e=>(0,x.createElement)(fI,{...e,group:"advanced"});GI.Slot=e=>(0,x.createElement)($I,{...e,group:"advanced"}),GI.slotName="InspectorAdvancedControls";var qI=WI;const KI=/[\s#]/g,YI={type:"string",source:"attribute",attribute:"id",selector:"*"},XI=(0,Wh.o)((e=>t=>{const n=uc(t.name,"anchor"),r=GS();if(n&&t.isSelected){const n="web"===wm.Z.OS,o=(0,x.createElement)(QS.Z,{__nextHasNoMarginBottom:!0,className:"html-anchor-control",label:(0,$.__)("HTML anchor"),help:(0,x.createElement)(x.Fragment,null,(0,$.__)("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,x.createElement)(eI.Z,{href:(0,$.__)("https://wordpress.org/documentation/article/page-jumps/")},(0,$.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,$.__)("Add an anchor"),onChange:e=>{e=e.replace(KI,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(e,{...t}),n&&"default"===r&&(0,x.createElement)(qI,{group:"advanced"},o),!n&&"core/heading"===t.name&&(0,x.createElement)(qI,null,(0,x.createElement)(tI.ZP,{title:(0,$.__)("Heading settings")},o)))}return(0,x.createElement)(e,{...t})}),"withInspectorControl");(0,mc.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.anchor)&&void 0!==t?t:{})||uc(e,"anchor")&&(e.attributes={...e.attributes,anchor:YI}),e})),(0,mc.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",XI),(0,mc.addFilter)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return uc(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const JI={type:"string",source:"attribute",attribute:"aria-label",selector:"*"};(0,mc.addFilter)("blocks.registerBlockType","core/ariaLabel/attribute",(function(e){return e?.attributes?.ariaLabel?.type||uc(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:JI}),e})),(0,mc.addFilter)("blocks.getSaveContent.extraProps","core/ariaLabel/save-props",(function(e,t,n){return uc(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e}));const QI=(0,Wh.o)((e=>t=>{const n=GS();return uc(t.name,"customClassName",!0)&&t.isSelected?(0,x.createElement)(x.Fragment,null,(0,x.createElement)(e,{...t}),"default"===n&&(0,x.createElement)(qI,{group:"advanced"},(0,x.createElement)(QS.Z,{__nextHasNoMarginBottom:!0,autoComplete:"off",label:(0,$.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,$.__)("Separate multiple classes with spaces.")}))):(0,x.createElement)(e,{...t})}),"withInspectorControl");(0,mc.addFilter)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return uc(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,mc.addFilter)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",QI),(0,mc.addFilter)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return uc(t,"customClassName",!0)&&n.className&&(e.className=R()(e.className,n.className)),e})),(0,mc.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,r){if(!uc(e.name,"customClassName",!0))return e;if(1===r.length&&e.innerBlocks.length===t.length)return e;if(1===r.length&&t.length>1||r.length>1&&1===t.length)return e;if(t[n]){const r=t[n]?.attributes.className;if(r)return{...e,attributes:{...e.attributes,className:r}}}return e})),(0,mc.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return uc(t,"className",!0)&&("string"==typeof e.className?e.className=[...new Set([Id(t.name),...e.className.split(" ")])].join(" ").trim():e.className=Id(t.name)),e}));var eT=n(99581),tT=n(80174),nT=n(76778),rT=n(4064),oT=n(32770),iT=n(29073),aT=n(51869);function sT(e){return(0,iT.o)((t=>{const n="core/with-filters/"+e;let r;class o extends x.Component{constructor(n){super(n),void 0===r&&(r=(0,mc.applyFilters)(e,t))}componentDidMount(){o.instances.push(this),1===o.instances.length&&((0,mc.addAction)("hookRemoved",n,a),(0,mc.addAction)("hookAdded",n,a))}componentWillUnmount(){o.instances=o.instances.filter((e=>e!==this)),0===o.instances.length&&((0,mc.removeAction)("hookRemoved",n),(0,mc.removeAction)("hookAdded",n))}render(){return(0,x.createElement)(r,{...this.props})}}o.instances=[];const i=(0,aT.D)((()=>{r=(0,mc.applyFilters)(e,t),o.instances.forEach((e=>{e.forceUpdate()}))}),16);function a(t){t===e&&i()}return o}),"withFilters")}var lT=n(58999),cT=n(93410),uT=n(19675),dT=function(e){return(0,Wh.o)((t=>n=>e(n)?(0,x.createElement)(t,{...n}):null),"ifCondition")};const pT=(0,x.createContext)({});function hT({value:e,children:t}){const n=(0,x.useContext)(pT),r=(0,x.useMemo)((()=>({...n,...e})),[n,e]);return(0,x.createElement)(pT.Provider,{value:r,children:t})}var mT=pT;const fT={},gT=sT("editor.BlockEdit")((e=>{const{name:t}=e,n=sc(t);if(!n)return null;const r=n.edit||n.save;return(0,x.createElement)(r,{...e})}));var bT=e=>{const{attributes:t={},name:n}=e,r=sc(n),o=(0,x.useContext)(mT),i=(0,x.useMemo)((()=>r&&r.usesContext?Object.fromEntries(Object.entries(o).filter((([e])=>r.usesContext.includes(e)))):fT),[r,o]);if(!r)return null;if(r.apiVersion>1)return(0,x.createElement)(gT,{...e,context:i});const a=uc(r,"className",!0)?Id(n):null,s=R()(a,t.className,e.className);return(0,x.createElement)(gT,{...e,context:i,className:s})};function vT(e){const{name:t,isSelected:n,clientId:r,attributes:o={},__unstableLayoutClassNames:i}=e,{layout:a=null}=o,s={name:t,isSelected:n,clientId:r,layout:uc(t,"layout",!1)||uc(t,"__experimentalLayout",!1)?a:null,__unstableLayoutClassNames:i};return(0,x.createElement)(o_,{value:(0,x.useMemo)((()=>s),Object.values(s))},(0,x.createElement)(bT,{...e}))}var yT=n(18175),_T=n(14275),kT=function({className:e,actions:t,children:n,secondaryActions:r}){return(0,x.createElement)("div",{style:{display:"contents",all:"initial"}},(0,x.createElement)("div",{className:R()(e,"block-editor-warning")},(0,x.createElement)("div",{className:"block-editor-warning__contents"},(0,x.createElement)("p",{className:"block-editor-warning__message"},n),(x.Children.count(t)>0||r)&&(0,x.createElement)("div",{className:"block-editor-warning__actions"},x.Children.count(t)>0&&x.Children.map(t,((e,t)=>(0,x.createElement)("span",{key:t,className:"block-editor-warning__action"},e))),r&&(0,x.createElement)(em.Z,{className:"block-editor-warning__secondary",icon:_T.Z,label:(0,$.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,x.createElement)($k.Z,null,r.map(((e,t)=>(0,x.createElement)(Wk.Z,{onClick:e.onClick,key:t},e.title))))))))))},wT=n(79646);function ET({title:e,rawContent:t,renderedContent:n,action:r,actionText:o,className:i}){return(0,x.createElement)("div",{className:i},(0,x.createElement)("div",{className:"block-editor-block-compare__content"},(0,x.createElement)("h2",{className:"block-editor-block-compare__heading"},e),(0,x.createElement)("div",{className:"block-editor-block-compare__html"},t),(0,x.createElement)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor"},(0,x.createElement)(nd,null,Vl(n)))),(0,x.createElement)("div",{className:"block-editor-block-compare__action"},(0,x.createElement)(Gh.ZP,{variant:"secondary",tabIndex:"0",onClick:r},o)))}var CT=function({block:e,onKeep:t,onConvert:n,convertor:r,convertButtonText:o}){const i=function(e){const t=(Array.isArray(e)?e:[e]).map((e=>Bd(e.name,e.attributes,e.innerBlocks)));return t.join("")}(r(e)),a=(s=e.originalContent,l=i,(0,wT.Kx)(s,l).map(((e,t)=>{const n=R()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,x.createElement)("span",{key:t,className:n},e.value)})));var s,l;return(0,x.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,x.createElement)(ET,{title:(0,$.__)("Current"),className:"block-editor-block-compare__current",action:t,actionText:(0,$.__)("Convert to HTML"),rawContent:e.originalContent,renderedContent:e.originalContent}),(0,x.createElement)(ET,{title:(0,$.__)("After Conversion"),className:"block-editor-block-compare__converted",action:n,actionText:o,rawContent:a,renderedContent:i}))};const xT=e=>mh({HTML:e.originalContent});function ST({clientId:e}){const{block:t,canInsertHTMLBlock:n,canInsertClassicBlock:r}=(0,yl.Z)((t=>{const{canInsertBlockType:n,getBlock:r,getBlockRootClientId:o}=t(e_),i=o(e);return{block:r(e),canInsertHTMLBlock:n("core/html",i),canInsertClassicBlock:n("core/freeform",i)}}),[e]),{replaceBlock:o}=(0,_l.Z)(e_),[i,a]=(0,x.useState)(!1),s=(0,x.useCallback)((()=>a(!1)),[]),l=(0,x.useMemo)((()=>({toClassic(){const e=fc("core/freeform",{content:t.originalContent});return o(t.clientId,e)},toHTML(){const e=fc("core/html",{content:t.originalContent});return o(t.clientId,e)},toBlocks(){const e=xT(t);return o(t.clientId,e)},toRecoveredBlock(){const e=fc(t.name,t.attributes,t.innerBlocks);return o(t.clientId,e)}})),[t,o]),c=(0,x.useMemo)((()=>[{title:(0,$._x)("Resolve","imperative verb"),onClick:()=>a(!0)},n&&{title:(0,$.__)("Convert to HTML"),onClick:l.toHTML},r&&{title:(0,$.__)("Convert to Classic Block"),onClick:l.toClassic}].filter(Boolean)),[n,r,l]);return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(kT,{actions:[(0,x.createElement)(Gh.ZP,{key:"recover",onClick:l.toRecoveredBlock,variant:"primary"},(0,$.__)("Attempt Block Recovery"))],secondaryActions:c},(0,$.__)("This block contains unexpected or invalid content.")),i&&(0,x.createElement)(yT.Z,{title:(0,$.__)("Resolve Block"),onRequestClose:s,className:"block-editor-block-compare"},(0,x.createElement)(CT,{block:t,onKeep:l.toHTML,onConvert:l.toBlocks,convertor:xT,convertButtonText:(0,$.__)("Convert to Blocks")})))}const IT=(0,x.createElement)(kT,{className:"block-editor-block-list__block-crash-warning"},(0,$.__)("This block has encountered an error and cannot be previewed."));var TT=()=>IT;class NT extends x.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}}var PT=NT,RT=n(49710),AT=function({clientId:e}){const[t,n]=(0,x.useState)(""),r=(0,yl.Z)((t=>t(e_).getBlock(e)),[e]),{updateBlock:o}=(0,_l.Z)(e_);return(0,x.useEffect)((()=>{n(Ld(r))}),[r]),(0,x.createElement)(RT.Z,{className:"block-editor-block-list__block-html-textarea",value:t,onBlur:()=>{const i=sc(r.name);if(!i)return;const a=Ip(i,t,r.attributes),s=t||Bd(i,a),[l]=t?pp({...r,attributes:a,originalContent:s}):[!0];o(e,{attributes:a,originalContent:s,isValid:l}),t||n(s)},onChange:e=>n(e.target.value)})},BT=n(46879);function LT({isDisabled:e=!1}={}){return If((t=>{if(e)return;const n=t?.ownerDocument?.defaultView;if(!n)return;const r=[],o=()=>{t.childNodes.forEach((e=>{e instanceof n.HTMLElement&&(e.getAttribute("inert")||(e.setAttribute("inert","true"),r.push((()=>{e.removeAttribute("inert")}))))}))},i=(0,BT.D)(o,0,{leading:!0});o();const a=new window.MutationObserver(i);return a.observe(t,{childList:!0}),()=>{a&&a.disconnect(),i.cancel(),r.forEach((e=>e()))}}),[e])}var MT=XT(),DT=e=>GT(e,MT),OT=XT();DT.write=e=>GT(e,OT);var FT=XT();DT.onStart=e=>GT(e,FT);var jT=XT();DT.onFrame=e=>GT(e,jT);var ZT=XT();DT.onFinish=e=>GT(e,ZT);var zT=[];DT.setTimeout=(e,t)=>{let n=DT.now()+t,r=()=>{let e=zT.findIndex((e=>e.cancel==r));~e&&zT.splice(e,1),$T-=~e?1:0},o={time:n,handler:e,cancel:r};return zT.splice(VT(n),0,o),$T+=1,qT(),o};var VT=e=>~(~zT.findIndex((t=>t.time>e))||~zT.length);DT.cancel=e=>{FT.delete(e),jT.delete(e),ZT.delete(e),MT.delete(e),OT.delete(e)},DT.sync=e=>{WT=!0,DT.batchedUpdates(e),WT=!1},DT.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function r(...e){t=e,DT.onStart(n)}return r.handler=e,r.cancel=()=>{FT.delete(n),t=null},r};var HT=typeof window<"u"?window.requestAnimationFrame:()=>{};DT.use=e=>HT=e,DT.now=typeof performance<"u"?()=>performance.now():Date.now,DT.batchedUpdates=e=>e(),DT.catch=console.error,DT.frameLoop="always",DT.advance=()=>{"demand"!==DT.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):YT()};var UT=-1,$T=0,WT=!1;function GT(e,t){WT?(t.delete(e),e(0)):(t.add(e),qT())}function qT(){UT<0&&(UT=0,"demand"!==DT.frameLoop&&HT(KT))}function KT(){~UT&&(HT(KT),DT.batchedUpdates(YT))}function YT(){let e=UT;UT=DT.now();let t=VT(UT);t&&(JT(zT.splice(0,t),(e=>e.handler())),$T-=t),$T?(FT.flush(),MT.flush(e?Math.min(64,UT-e):16.667),jT.flush(),OT.flush(),ZT.flush()):UT=-1}function XT(){let e=new Set,t=e;return{add(n){$T+=t!=e||e.has(n)?0:1,e.add(n)},delete(n){return $T-=t==e&&e.has(n)?1:0,e.delete(n)},flush(n){t.size&&(e=new Set,$T-=t.size,JT(t,(t=>t(n)&&e.add(t))),$T+=e.size,t=e)}}}function JT(e,t){e.forEach((e=>{try{t(e)}catch(e){DT.catch(e)}}))}var QT=Object.defineProperty,eN={};function tN(){}((e,t)=>{for(var n in t)QT(e,n,{get:t[n],enumerable:!0})})(eN,{assign:()=>fN,colors:()=>pN,createStringInterpolator:()=>lN,skipAnimation:()=>hN,to:()=>cN,willAdvance:()=>mN});var nN={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 rN(e,t){if(nN.arr(e)){if(!nN.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 oN=(e,t)=>e.forEach(t);function iN(e,t,n){if(nN.arr(e))for(let r=0;r<e.length;r++)t.call(n,e[r],`${r}`);else for(let r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r)}var aN=e=>nN.und(e)?[]:nN.arr(e)?e:[e];function sN(e,t){if(e.size){let n=Array.from(e);e.clear(),oN(n,t)}}var lN,cN,uN=(e,...t)=>sN(e,(e=>e(...t))),dN=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),pN=null,hN=!1,mN=tN,fN=e=>{e.to&&(cN=e.to),e.now&&(DT.now=e.now),void 0!==e.colors&&(pN=e.colors),null!=e.skipAnimation&&(hN=e.skipAnimation),e.createStringInterpolator&&(lN=e.createStringInterpolator),e.requestAnimationFrame&&DT.use(e.requestAnimationFrame),e.batchedUpdates&&(DT.batchedUpdates=e.batchedUpdates),e.willAdvance&&(mN=e.willAdvance),e.frameLoop&&(DT.frameLoop=e.frameLoop)},gN=new Set,bN=[],vN=[],yN=0,_N={get idle(){return!gN.size&&!bN.length},start(e){yN>e.priority?(gN.add(e),DT.onStart(kN)):(wN(e),DT(CN))},advance:CN,sort(e){if(yN)DT.onFrame((()=>_N.sort(e)));else{let t=bN.indexOf(e);~t&&(bN.splice(t,1),EN(e))}},clear(){bN=[],gN.clear()}};function kN(){gN.forEach(wN),gN.clear(),DT(CN)}function wN(e){bN.includes(e)||EN(e)}function EN(e){bN.splice(function(e,t){let n=e.findIndex(t);return n<0?e.length:n}(bN,(t=>t.priority>e.priority)),0,e)}function CN(e){let t=vN;for(let n=0;n<bN.length;n++){let r=bN[n];yN=r.priority,r.idle||(mN(r),r.advance(e),r.idle||t.push(r))}return yN=0,(vN=bN).length=0,(bN=t).length>0}var xN="[-+]?\\d*\\.?\\d+",SN=xN+"%";function IN(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var TN=new RegExp("rgb"+IN(xN,xN,xN)),NN=new RegExp("rgba"+IN(xN,xN,xN,xN)),PN=new RegExp("hsl"+IN(xN,SN,SN)),RN=new RegExp("hsla"+IN(xN,SN,SN,xN)),AN=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,BN=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,LN=/^#([0-9a-fA-F]{6})$/,MN=/^#([0-9a-fA-F]{8})$/;function DN(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 ON(e,t,n){let r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,i=DN(o,r,e+1/3),a=DN(o,r,e),s=DN(o,r,e-1/3);return Math.round(255*i)<<24|Math.round(255*a)<<16|Math.round(255*s)<<8}function FN(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function jN(e){return(parseFloat(e)%360+360)%360/360}function ZN(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function zN(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function VN(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=LN.exec(e))?parseInt(t[1]+"ff",16)>>>0:pN&&void 0!==pN[e]?pN[e]:(t=TN.exec(e))?(FN(t[1])<<24|FN(t[2])<<16|FN(t[3])<<8|255)>>>0:(t=NN.exec(e))?(FN(t[1])<<24|FN(t[2])<<16|FN(t[3])<<8|ZN(t[4]))>>>0:(t=AN.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=MN.exec(e))?parseInt(t[1],16)>>>0:(t=BN.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=PN.exec(e))?(255|ON(jN(t[1]),zN(t[2]),zN(t[3])))>>>0:(t=RN.exec(e))?(ON(jN(t[1]),zN(t[2]),zN(t[3]))|ZN(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 HN=(e,t,n)=>{if(nN.fun(e))return e;if(nN.arr(e))return HN({range:e,output:t,extrapolate:n});if(nN.str(e.output[0]))return lN(e);let r=e,o=r.output,i=r.range||[0,1],a=r.extrapolateLeft||r.extrapolate||"extend",s=r.extrapolateRight||r.extrapolate||"extend",l=r.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,i);return function(e,t,n,r,o,i,a,s,l){let c=l?l(e):e;if(c<t){if("identity"===a)return c;"clamp"===a&&(c=t)}if(c>n){if("identity"===s)return c;"clamp"===s&&(c=n)}return r===o?r:t===n?e<=t?r:o:(t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t),c=i(c),r===-1/0?c=-c:o===1/0?c+=r:c=c*(o-r)+r,c)}(e,i[t],i[t+1],o[t],o[t+1],l,a,s,r.map)}},UN=1.70158,$N=1.525*UN,WN=UN+1,GN=2*Math.PI/3,qN=2*Math.PI/4.5,KN=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,YN={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=>WN*e*e*e-UN*e*e,easeOutBack:e=>1+WN*Math.pow(e-1,3)+UN*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(2*($N+1)*e-$N)/2:(Math.pow(2*e-2,2)*(($N+1)*(2*e-2)+$N)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*GN),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*GN)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*qN)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*qN)/2+1,easeInBounce:e=>1-KN(1-e),easeOutBounce:KN,easeInOutBounce:e=>e<.5?(1-KN(1-2*e))/2:(1+KN(2*e-1))/2,steps:(e,t="end")=>n=>{let r=(n="end"===t?Math.min(n,.999):Math.max(n,.001))*e;return((e,t,n)=>Math.min(Math.max(n,0),1))(0,0,("end"===t?Math.floor(r):Math.ceil(r))/e)}},XN=Symbol.for("FluidValue.get"),JN=Symbol.for("FluidValue.observers"),QN=e=>Boolean(e&&e[XN]),eP=e=>e&&e[XN]?e[XN]():e,tP=e=>e[JN]||null;function nP(e,t){let n=e[JN];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}var rP=class{[XN];[JN];constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");oP(this,e)}},oP=(e,t)=>lP(e,XN,t);function iP(e,t){if(e[XN]){let n=e[JN];n||lP(e,JN,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function aP(e,t){let n=e[JN];if(n&&n.has(t)){let r=n.size-1;r?n.delete(t):e[JN]=null,e.observerRemoved&&e.observerRemoved(r,t)}}var sP,lP=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),cP=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,uP=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,dP=new RegExp(`(${cP.source})(%|[a-z]+)`,"i"),pP=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,hP=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,mP=e=>{let[t,n]=fP(e);if(!t||dN())return e;let r=window.getComputedStyle(document.documentElement).getPropertyValue(t);return r?r.trim():n&&n.startsWith("--")?window.getComputedStyle(document.documentElement).getPropertyValue(n)||e:n&&hP.test(n)?mP(n):n||e},fP=e=>{let t=hP.exec(e);if(!t)return[,];let[,n,r]=t;return[n,r]},gP=(e,t,n,r,o)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${o})`,bP=e=>{sP||(sP=pN?new RegExp(`(${Object.keys(pN).join("|")})(?!\\w)`,"g"):/^\b$/);let t=e.output.map((e=>eP(e).replace(hP,mP).replace(uP,VN).replace(sP,VN))),n=t.map((e=>e.match(cP).map(Number))),r=n[0].map(((e,t)=>n.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))).map((t=>HN({...e,output:t})));return e=>{let n=!dP.test(t[0])&&t.find((e=>dP.test(e)))?.replace(cP,""),o=0;return t[0].replace(cP,(()=>`${r[o++](e)}${n||""}`)).replace(pP,gP)}},vP="react-spring: ",yP=e=>{let t=e,n=!1;if("function"!=typeof t)throw new TypeError(`${vP}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},_P=yP(console.warn),kP=yP(console.warn);function wP(e){return nN.str(e)&&("#"==e[0]||/\d/.test(e)||!dN()&&hP.test(e)||e in(pN||{}))}new WeakMap,new Set,new WeakMap,new WeakMap,new WeakMap;var EP=dN()?x.useEffect:x.useLayoutEffect,CP=()=>{let e=(0,x.useRef)(!1);return EP((()=>(e.current=!0,()=>{e.current=!1})),[]),e};function xP(){let e=(0,x.useState)()[1],t=CP();return()=>{t.current&&e(Math.random())}}var SP=e=>(0,x.useEffect)(e,IP),IP=[];function TP(e){let t=(0,x.useRef)();return(0,x.useEffect)((()=>{t.current=e})),t.current}var NP=Symbol.for("Animated:node"),PP=e=>e&&e[NP],RP=(e,t)=>((e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}))(e,NP,t),AP=e=>e&&e[NP]&&e[NP].getPayload(),BP=class{payload;constructor(){RP(this,this)}getPayload(){return this.payload||[]}},LP=class extends BP{constructor(e){super(),this._value=e,nN.num(this._value)&&(this.lastPosition=this._value)}done=!0;elapsedTime;lastPosition;lastVelocity;v0;durationProgress=0;static create(e){return new LP(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return nN.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,nN.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},MP=class extends LP{_string=null;_toString;constructor(e){super(0),this._toString=HN({output:[e,e]})}static create(e){return new MP(e)}getValue(){return this._string??(this._string=this._toString(this._value))}setValue(e){if(nN.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=HN({output:[this.getValue(),e]})),this._value=0,super.reset()}},DP={dependencies:null},OP=class extends BP{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){let t={};return iN(this.source,((n,r)=>{var o;(o=n)&&o[NP]===o?t[r]=n.getValue(e):QN(n)?t[r]=eP(n):e||(t[r]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&oN(this.payload,(e=>e.reset()))}_makePayload(e){if(e){let t=new Set;return iN(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){DP.dependencies&&QN(e)&&DP.dependencies.add(e);let t=AP(e);t&&oN(t,(e=>this.add(e)))}},FP=class extends OP{constructor(e){super(e)}static create(e){return new FP(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(jP)),!0)}};function jP(e){return(wP(e)?MP:LP).create(e)}function ZP(e){let t=PP(e);return t?t.constructor:nN.arr(e)?FP:wP(e)?MP:LP}var zP=(e,t)=>{let n=!nN.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,x.forwardRef)(((r,o)=>{let i=(0,x.useRef)(null),a=n&&(0,x.useCallback)((e=>{i.current=function(e,t){return e&&(nN.fun(e)?e(t):e.current=t),t}(o,e)}),[o]),[s,l]=function(e,t){let n=new Set;return DP.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new OP(e),DP.dependencies=null,[e,n]}(r,t),c=xP(),u=()=>{let e=i.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&c()},d=new VP(u,l),p=(0,x.useRef)();EP((()=>(p.current=d,oN(l,(e=>iP(e,d))),()=>{p.current&&(oN(p.current.deps,(e=>aP(e,p.current))),DT.cancel(p.current.update))}))),(0,x.useEffect)(u,[]),SP((()=>()=>{let e=p.current;oN(e.deps,(t=>aP(t,e)))}));let h=t.getComponentProps(s.getValue());return x.createElement(e,{...h,ref:a})}))},VP=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&DT.write(this.update)}},HP=Symbol.for("AnimatedComponent"),UP=e=>nN.str(e)?e:e&&nN.str(e.displayName)?e.displayName:nN.fun(e)&&e.name||null;function $P(e,...t){return nN.fun(e)?e(...t):e}var WP=(e,t)=>!0===e||!!(t&&e&&(nN.fun(e)?e(t):aN(e).includes(t))),GP=(e,t)=>nN.obj(e)?t&&e[t]:e,qP=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,KP=e=>e,YP=(e,t=KP)=>{let n=XP;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));let r={};for(let o of n){let n=t(e[o],o);nN.und(n)||(r[o]=n)}return r},XP=["config","onProps","onStart","onChange","onPause","onResume","onRest"],JP={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 QP(e){let t=function(e){let t={},n=0;if(iN(e,((e,r)=>{JP[r]||(t[r]=e,n++)})),n)return t}(e);if(t){let n={to:t};return iN(e,((e,r)=>r in t||(n[r]=e))),n}return{...e}}function eR(e){return e=eP(e),nN.arr(e)?e.map(eR):wP(e)?eN.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function tR(e){return nN.fun(e)||nN.arr(e)&&nN.obj(e[0])}var nR={tension:170,friction:26,mass:1,damping:1,easing:YN.linear,clamp:!1};function rR(e,t){if(nN.und(t.decay)){let n=!nN.und(t.tension)||!nN.und(t.friction);(n||!nN.und(t.frequency)||!nN.und(t.damping)||!nN.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}var oR=[];function iR(e,{key:t,props:n,defaultProps:r,state:o,actions:i}){return new Promise(((a,s)=>{let l,c,u=WP(n.cancel??r?.cancel,t);if(u)h();else{nN.und(n.pause)||(o.paused=WP(n.pause,t));let e=r?.pause;!0!==e&&(e=o.paused||WP(e,t)),l=$P(n.delay||0,t),e?(o.resumeQueue.add(p),i.pause()):(i.resume(),p())}function d(){o.resumeQueue.add(p),o.timeouts.delete(c),c.cancel(),l=c.time-DT.now()}function p(){l>0&&!eN.skipAnimation?(o.delayed=!0,c=DT.setTimeout(h,l),o.pauseQueue.add(d),o.timeouts.add(c)):h()}function h(){o.delayed&&(o.delayed=!1),o.pauseQueue.delete(d),o.timeouts.delete(c),e<=(o.cancelId||0)&&(u=!0);try{i.start({...n,callId:e,cancel:u},a)}catch(e){s(e)}}}))}var aR=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?cR(e.get()):t.every((e=>e.noop))?sR(e.get()):lR(e.get(),t.every((e=>e.finished))),sR=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),lR=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),cR=e=>({value:e,cancelled:!0,finished:!1});function uR(e,t,n,r){let{callId:o,parentId:i,onRest:a}=t,{asyncTo:s,promise:l}=n;return i||e!==s||t.reset?n.promise=(async()=>{n.asyncId=o,n.asyncTo=e;let c,u,d,p=YP(t,((e,t)=>"onRest"===t?void 0:e)),h=new Promise(((e,t)=>(c=e,u=t))),m=e=>{let t=o<=(n.cancelId||0)&&cR(r)||o!==n.asyncId&&lR(r,!1);if(t)throw e.result=t,u(e),e},f=(e,t)=>{let i=new pR,a=new hR;return(async()=>{if(eN.skipAnimation)throw dR(n),a.result=lR(r,!1),u(a),a;m(i);let s=nN.obj(e)?{...e}:{...t,to:e};s.parentId=o,iN(p,((e,t)=>{nN.und(s[t])&&(s[t]=e)}));let l=await r.start(s);return m(i),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),l})()};if(eN.skipAnimation)return dR(n),lR(r,!1);try{let t;t=nN.arr(e)?(async e=>{for(let t of e)await f(t)})(e):Promise.resolve(e(f,r.stop.bind(r))),await Promise.all([t.then(c),h]),d=lR(r.get(),!0,!1)}catch(e){if(e instanceof pR)d=e.result;else{if(!(e instanceof hR))throw e;d=e.result}}finally{o==n.asyncId&&(n.asyncId=i,n.asyncTo=i?s:void 0,n.promise=i?l:void 0)}return nN.fun(a)&&DT.batchedUpdates((()=>{a(d,r,r.item)})),d})():l}function dR(e,t){sN(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var pR=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.")}},hR=class extends Error{result;constructor(){super("SkipAnimationSignal")}},mR=e=>e instanceof gR,fR=1,gR=class extends rP{id=fR++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=PP(this);return e&&e.getValue()}to(...e){return eN.to(this,e)}interpolate(...e){return _P(`${vP}The "interpolate" function is deprecated in v9 (use "to" instead)`),eN.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){nP(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||_N.sort(this),nP(this,{type:"priority",parent:this,priority:e})}},bR=Symbol.for("SpringPhase"),vR=e=>(1&e[bR])>0,yR=e=>(2&e[bR])>0,_R=e=>(4&e[bR])>0,kR=(e,t)=>t?e[bR]|=3:e[bR]&=-3,wR=(e,t)=>t?e[bR]|=4:e[bR]&=-5,ER=class extends gR{key;animation=new class{changed=!1;values=oR;toValues=null;fromValues=oR;to;from;config=new class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,nR)}};immediate=!1};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(),!nN.und(e)||!nN.und(t)){let n=nN.obj(e)?{...e}:{...t,from:e};nN.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(yR(this)||this._state.asyncTo)||_R(this)}get goal(){return eP(this.animation.to)}get velocity(){let e=PP(this);return e instanceof LP?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return vR(this)}get isAnimating(){return yR(this)}get isPaused(){return _R(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1,r=this.animation,{config:o,toValues:i}=r,a=AP(r.to);!a&&QN(r.to)&&(i=aN(eP(r.to))),r.values.forEach(((s,l)=>{if(s.done)return;let c=s.constructor==MP?1:a?a[l].lastPosition:i[l],u=r.immediate,d=c;if(!u){if(d=s.lastPosition,o.tension<=0)return void(s.done=!0);let t,n=s.elapsedTime+=e,i=r.fromValues[l],a=null!=s.v0?s.v0:s.v0=nN.arr(o.velocity)?o.velocity[l]:o.velocity,p=o.precision||(i==c?.005:Math.min(1,.001*Math.abs(c-i)));if(nN.und(o.duration))if(o.decay){let e=!0===o.decay?.998:o.decay,r=Math.exp(-(1-e)*n);d=i+a/(1-e)*(1-r),u=Math.abs(s.lastPosition-d)<=p,t=a*r}else{t=null==s.lastVelocity?a:s.lastVelocity;let n,r=o.restVelocity||p/10,l=o.clamp?0:o.bounce,h=!nN.und(l),m=i==c?s.v0>0:i<c,f=!1,g=1,b=Math.ceil(e/g);for(let e=0;e<b&&(n=Math.abs(t)>r,n||(u=Math.abs(c-d)<=p,!u));++e)h&&(f=d==c||d>c==m,f&&(t=-t*l,d=c)),t+=(1e-6*-o.tension*(d-c)+.001*-o.friction*t)/o.mass*g,d+=t*g}else{let r=1;o.duration>0&&(this._memoizedDuration!==o.duration&&(this._memoizedDuration=o.duration,s.durationProgress>0&&(s.elapsedTime=o.duration*s.durationProgress,n=s.elapsedTime+=e)),r=(o.progress||0)+n/this._memoizedDuration,r=r>1?1:r<0?0:r,s.durationProgress=r),d=i+o.easing(r)*(c-i),t=(d-s.lastPosition)/e,u=1==r}s.lastVelocity=t,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}a&&!a[l].done&&(u=!1),u?s.done=!0:t=!1,s.setValue(d,o.round)&&(n=!0)}));let s=PP(this),l=s.getValue();if(t){let e=eP(r.to);l===e&&!n||o.decay?n&&o.decay&&this._onChange(l):(s.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(l)}set(e){return DT.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(yR(this)){let{to:e,config:t}=this.animation;DT.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 nN.und(e)?(n=this.queue||[],this.queue=[]):n=[nN.obj(e)?e:{...t,to:e}],Promise.all(n.map((e=>this._update(e)))).then((e=>aR(this,e)))}stop(e){let{to:t}=this.animation;return this._focus(this.get()),dR(this._state,e&&this._lastCallId),DT.batchedUpdates((()=>this._stop(t,e))),this}reset(){this._update({reset:!0})}eventObserved(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}_prepareNode(e){let t=this.key||"",{to:n,from:r}=e;n=nN.obj(n)?n[t]:n,(null==n||tR(n))&&(n=void 0),r=nN.obj(r)?r[t]:r,null==r&&(r=void 0);let o={to:n,from:r};return vR(this)||(e.reverse&&([n,r]=[r,n]),r=eP(r),nN.und(r)?PP(this)||this._set(n):this._set(r)),o}_update({...e},t){let{key:n,defaultProps:r}=this;e.default&&Object.assign(r,YP(e,((e,t)=>/^on/.test(t)?GP(e,n):e))),PR(this,e,"onProps"),RR(this,"onProps",e,this);let o=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let i=this._state;return iR(++this._lastCallId,{key:n,props:e,defaultProps:r,state:i,actions:{pause:()=>{_R(this)||(wR(this,!0),uN(i.pauseQueue),RR(this,"onPause",lR(this,CR(this,this.animation.to)),this))},resume:()=>{_R(this)&&(wR(this,!1),yR(this)&&this._resume(),uN(i.resumeQueue),RR(this,"onResume",lR(this,CR(this,this.animation.to)),this))},start:this._merge.bind(this,o)}}).then((n=>{if(e.loop&&n.finished&&(!t||!n.noop)){let t=xR(e);if(t)return this._update(t,!0)}return n}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(cR(this));let r=!nN.und(e.to),o=!nN.und(e.from);if(r||o){if(!(t.callId>this._lastToId))return n(cR(this));this._lastToId=t.callId}let{key:i,defaultProps:a,animation:s}=this,{to:l,from:c}=s,{to:u=l,from:d=c}=e;o&&!r&&(!t.default||nN.und(u))&&(u=d),t.reverse&&([u,d]=[d,u]);let p=!rN(d,c);p&&(s.from=d),d=eP(d);let h=!rN(u,l);h&&this._focus(u);let m=tR(t.to),{config:f}=s,{decay:g,velocity:b}=f;(r||o)&&(f.velocity=0),t.config&&!m&&function(e,t,n){n&&(rR(n={...n},t),t={...n,...t}),rR(e,t),Object.assign(e,t);for(let t in nR)null==e[t]&&(e[t]=nR[t]);let{mass:r,frequency:o,damping:i}=e;nN.und(o)||(o<.01&&(o=.01),i<0&&(i=0),e.tension=Math.pow(2*Math.PI/o,2)*r,e.friction=4*Math.PI*i*r/o)}(f,$P(t.config,i),t.config!==a.config?$P(a.config,i):void 0);let v=PP(this);if(!v||nN.und(u))return n(lR(this,!0));let y=nN.und(t.reset)?o&&!t.default:!nN.und(d)&&WP(t.reset,i),_=y?d:this.get(),k=eR(u),w=nN.num(k)||nN.arr(k)||wP(k),E=!m&&(!w||WP(a.immediate||t.immediate,i));if(h){let e=ZP(u);if(e!==v.constructor){if(!E)throw Error(`Cannot animate between ${v.constructor.name} and ${e.name}, as the "to" prop suggests`);v=this._set(k)}}let C=v.constructor,x=QN(u),S=!1;if(!x){let e=y||!vR(this)&&p;(h||e)&&(S=rN(eR(_),k),x=!S),(!rN(s.immediate,E)&&!E||!rN(f.decay,g)||!rN(f.velocity,b))&&(x=!0)}if(S&&yR(this)&&(s.changed&&!y?x=!0:x||this._stop(l)),!m&&((x||QN(l))&&(s.values=v.getPayload(),s.toValues=QN(u)?null:C==MP?[1]:aN(k)),s.immediate!=E&&(s.immediate=E,!E&&!y&&this._set(l)),x)){let{onRest:e}=s;oN(NR,(e=>PR(this,t,e)));let r=lR(this,CR(this,l));uN(this._pendingCalls,r),this._pendingCalls.add(n),s.changed&&DT.batchedUpdates((()=>{s.changed=!y,e?.(r,this),y?$P(a.onRest,r):s.onStart?.(r,this)}))}y&&this._set(_),m?n(uR(t.to,t,this._state,this)):x?this._start():yR(this)&&!h?this._pendingCalls.add(n):n(sR(_))}_focus(e){let t=this.animation;e!==t.to&&(tP(this)&&this._detach(),t.to=e,tP(this)&&this._attach())}_attach(){let e=0,{to:t}=this.animation;QN(t)&&(iP(t,this),mR(t)&&(e=t.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;QN(e)&&aP(e,this)}_set(e,t=!0){let n=eP(e);if(!nN.und(n)){let e=PP(this);if(!e||!rN(n,e.getValue())){let r=ZP(n);e&&e.constructor==r?e.setValue(n):RP(this,r.create(n)),e&&DT.batchedUpdates((()=>{this._onChange(n,t)}))}}return PP(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,RR(this,"onStart",lR(this,CR(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),$P(this.animation.onChange,e,this)),$P(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){let e=this.animation;PP(this).reset(eP(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),yR(this)||(kR(this,!0),_R(this)||this._resume())}_resume(){eN.skipAnimation?this.finish():_N.start(this)}_stop(e,t){if(yR(this)){kR(this,!1);let n=this.animation;oN(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),nP(this,{type:"idle",parent:this});let r=t?cR(this.get()):lR(this.get(),CR(this,e??n.to));uN(this._pendingCalls,r),n.changed&&(n.changed=!1,RR(this,"onRest",r,this))}}};function CR(e,t){let n=eR(t);return rN(eR(e.get()),n)}function xR(e,t=e.loop,n=e.to){let r=$P(t);if(r){let o=!0!==r&&QP(r),i=(o||e).reverse,a=!o||o.reset;return SR({...e,loop:t,default:!1,pause:void 0,to:!i||tR(n)?n:void 0,from:a?e.from:void 0,reset:a,...o})}}function SR(e){let{to:t,from:n}=e=QP(e),r=new Set;return nN.obj(t)&&TR(t,r),nN.obj(n)&&TR(n,r),e.keys=r.size?Array.from(r):null,e}function IR(e){let t=SR(e);return nN.und(t.default)&&(t.default=YP(t)),t}function TR(e,t){iN(e,((e,n)=>null!=e&&t.add(n)))}var NR=["onStart","onRest","onChange","onPause","onResume"];function PR(e,t,n){e.animation[n]=t[n]!==qP(t,n)?GP(t[n],e.key):void 0}function RR(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var AR=["onStart","onChange","onRest"],BR=1,LR=class{id=BR++;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];nN.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(SR(e)),this}start(e){let{queue:t}=this;return e?t=aN(e).map(SR):this.queue=[],this._flush?this._flush(this,t):(zR(this,t),MR(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){let n=this.springs;oN(aN(t),(t=>n[t].stop(!!e)))}else dR(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(nN.und(e))this.start({pause:!0});else{let t=this.springs;oN(aN(e),(e=>t[e].pause()))}return this}resume(e){if(nN.und(e))this.start({pause:!1});else{let t=this.springs;oN(aN(e),(e=>t[e].resume()))}return this}each(e){iN(this.springs,e)}_onFrame(){let{onStart:e,onChange:t,onRest:n}=this._events,r=this._active.size>0,o=this._changed.size>0;(r&&!this._started||o&&!this._started)&&(this._started=!0,sN(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));let i=!r&&this._started,a=o||i&&n.size?this.get():null;o&&t.size&&sN(t,(([e,t])=>{t.value=a,e(t,this,this._item)})),i&&(this._started=!1,sN(n,(([e,t])=>{t.value=a,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)}DT.onFrame(this._onFrame)}};function MR(e,t){return Promise.all(t.map((t=>DR(e,t)))).then((t=>aR(e,t)))}async function DR(e,t,n){let{keys:r,to:o,from:i,loop:a,onRest:s,onResolve:l}=t,c=nN.obj(t.default)&&t.default;a&&(t.loop=!1),!1===o&&(t.to=null),!1===i&&(t.from=null);let u=nN.arr(o)||nN.fun(o)?o:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):oN(AR,(n=>{let r=t[n];if(nN.fun(r)){let o=e._events[n];t[n]=({finished:e,cancelled:t})=>{let n=o.get(r);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):o.set(r,{value:null,finished:e||!1,cancelled:t||!1})},c&&(c[n]=t[n])}}));let d=e._state;t.pause===!d.paused?(d.paused=t.pause,uN(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);let p=(r||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),h=!0===t.cancel||!0===qP(t,"cancel");(u||h&&d.asyncId)&&p.push(iR(++e._lastAsyncId,{props:t,state:d,actions:{pause:tN,resume:tN,start(t,n){h?(dR(d,e._lastAsyncId),n(cR(e))):(t.onRest=s,n(uR(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));let m=aR(e,await Promise.all(p));if(a&&m.finished&&(!n||!m.noop)){let n=xR(t,a,o);if(n)return zR(e,[n]),DR(e,n,!0)}return l&&DT.batchedUpdates((()=>l(m,e,e.item))),m}function OR(e,t){let n={...e.springs};return t&&oN(aN(t),(e=>{nN.und(e.keys)&&(e=SR(e)),nN.obj(e.to)||(e={...e,to:void 0}),ZR(n,e,(e=>jR(e)))})),FR(e,n),n}function FR(e,t){iN(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,iP(t,e))}))}function jR(e,t){let n=new ER;return n.key=e,t&&iP(n,t),n}function ZR(e,t,n){t.keys&&oN(t.keys,(r=>{(e[r]||(e[r]=n(r)))._prepareNode(t)}))}function zR(e,t){oN(t,(t=>{ZR(e.springs,t,(t=>jR(t,e)))}))}var VR=({children:e,...t})=>{let n=(0,x.useContext)(HR),r=t.pause||!!n.pause,o=t.immediate||!!n.immediate;t=function(e,t){let[n]=(0,x.useState)((()=>({inputs:t,result:e()}))),r=(0,x.useRef)(),o=r.current,i=o;return i?Boolean(t&&i.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,i.inputs))||(i={inputs:t,result:e()}):i=n,(0,x.useEffect)((()=>{r.current=i,o==n&&(n.inputs=n.result=void 0)}),[i]),i.result}((()=>({pause:r,immediate:o})),[r,o]);let{Provider:i}=HR;return x.createElement(i,{value:t},e)},HR=function(e,t){return Object.assign(e,x.createContext({})),e.Provider._context=e,e.Consumer._context=e,e}(VR);VR.Provider=HR.Provider,VR.Consumer=HR.Consumer;var UR=()=>{let e=[],t=function(t){kP(`${vP}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`);let r=[];return oN(e,((e,o)=>{if(nN.und(t))r.push(e.start());else{let i=n(t,e,o);i&&r.push(e.start(i))}})),r};t.current=e,t.add=function(t){e.includes(t)||e.push(t)},t.delete=function(t){let n=e.indexOf(t);~n&&e.splice(n,1)},t.pause=function(){return oN(e,(e=>e.pause(...arguments))),this},t.resume=function(){return oN(e,(e=>e.resume(...arguments))),this},t.set=function(t){oN(e,((e,n)=>{let r=nN.fun(t)?t(n,e):t;r&&e.set(r)}))},t.start=function(t){let n=[];return oN(e,((e,r)=>{if(nN.und(t))n.push(e.start());else{let o=this._getProps(t,e,r);o&&n.push(e.start(o))}})),n},t.stop=function(){return oN(e,(e=>e.stop(...arguments))),this},t.update=function(t){return oN(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};let n=function(e,t,n){return nN.fun(e)?e(n,t):e};return t._getProps=n,t};function $R(e,t){let n=nN.fun(e),[[r],o]=function(e,t,n){let r=nN.fun(t)&&t;r&&!n&&(n=[]);let o=(0,x.useMemo)((()=>r||3==arguments.length?UR():void 0),[]),i=(0,x.useRef)(0),a=xP(),s=(0,x.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){let n=OR(e,t);return i.current>0&&!s.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?MR(e,t):new Promise((r=>{FR(e,n),s.queue.push((()=>{r(MR(e,t))})),a()}))}})),[]),l=(0,x.useRef)([...s.ctrls]),c=[],u=TP(e)||0;function d(e,n){for(let o=e;o<n;o++){let e=l.current[o]||(l.current[o]=new LR(null,s.flush)),n=r?r(o,e):t[o];n&&(c[o]=IR(n))}}(0,x.useMemo)((()=>{oN(l.current.slice(e,u),(e=>{(function(e,t){e.ref?.delete(e),t?.delete(e)})(e,o),e.stop(!0)})),l.current.length=e,d(u,e)}),[e]),(0,x.useMemo)((()=>{d(0,Math.min(u,e))}),n);let p=l.current.map(((e,t)=>OR(e,c[t]))),h=(0,x.useContext)(VR),m=TP(h),f=h!==m&&function(e){for(let t in e)return!0;return!1}(h);EP((()=>{i.current++,s.ctrls=l.current;let{queue:e}=s;e.length&&(s.queue=[],oN(e,(e=>e()))),oN(l.current,((e,t)=>{o?.add(e),f&&e.start({default:h});let n=c[t];n&&(function(e,t){t&&e.ref!==t&&(e.ref?.delete(e),t.add(e),e.ref=t)}(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),SP((()=>()=>{oN(s.ctrls,(e=>e.stop(!0)))}));let g=p.map((e=>({...e})));return o?[g,o]:g}(1,n?e:[e],n?t||[]:t);return n||2==arguments.length?[r,o]:r}var WR=class extends gR{constructor(e,t){super(),this.source=e,this.calc=HN(...t);let n=this._get(),r=ZP(n);RP(this,r.create(n))}key;idle=!0;calc;_active=new Set;advance(e){let t=this._get();rN(t,this.get())||(PP(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&qR(this._active)&&KR(this)}_get(){let e=nN.arr(this.source)?this.source.map(eP):aN(eP(this.source));return this.calc(...e)}_start(){this.idle&&!qR(this._active)&&(this.idle=!1,oN(AP(this),(e=>{e.done=!1})),eN.skipAnimation?(DT.batchedUpdates((()=>this.advance())),KR(this)):_N.start(this))}_attach(){let e=1;oN(aN(this.source),(t=>{QN(t)&&iP(t,this),mR(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){oN(aN(this.source),(e=>{QN(e)&&aP(e,this)})),this._active.clear(),KR(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=aN(this.source).reduce(((e,t)=>Math.max(e,(mR(t)?t.priority:0)+1)),0))}};function GR(e){return!1!==e.idle}function qR(e){return!e.size||Array.from(e).every(GR)}function KR(e){e.idle||(e.idle=!0,oN(AP(e),(e=>{e.done=!0})),nP(e,{type:"idle",parent:e}))}eN.assign({createStringInterpolator:bP,to:(e,t)=>new WR(e,t)}),_N.advance;var YR=/^--/;function XR(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||YR.test(e)||QR.hasOwnProperty(e)&&QR[e]?(""+t).trim():t+"px"}var JR={},QR={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},eA=["Webkit","Ms","Moz","O"];QR=Object.keys(QR).reduce(((e,t)=>(eA.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),QR);var tA=/^(matrix|translate|scale|rotate|skew)/,nA=/^(translate)/,rA=/^(rotate|skew)/,oA=(e,t)=>nN.num(e)&&0!==e?e+t:e,iA=(e,t)=>nN.arr(e)?e.every((e=>iA(e,t))):nN.num(e)?e===t:parseFloat(e)===t,aA=class extends OP{constructor({x:e,y:t,z:n,...r}){let o=[],i=[];(e||t||n)&&(o.push([e||0,t||0,n||0]),i.push((e=>[`translate3d(${e.map((e=>oA(e,"px"))).join(",")})`,iA(e,0)]))),iN(r,((e,t)=>{if("transform"===t)o.push([e||""]),i.push((e=>[e,""===e]));else if(tA.test(t)){if(delete r[t],nN.und(e))return;let n=nA.test(t)?"px":rA.test(t)?"deg":"";o.push(aN(e)),i.push("rotate3d"===t?([e,t,r,o])=>[`rotate3d(${e},${t},${r},${oA(o,n)})`,iA(o,0)]:e=>[`${t}(${e.map((e=>oA(e,n))).join(",")})`,iA(e,t.startsWith("scale")?1:0)])}})),o.length&&(r.transform=new sA(o,i)),super(r)}},sA=class extends rP{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 oN(this.inputs,((n,r)=>{let o=eP(n[0]),[i,a]=this.transforms[r](nN.arr(o)?o:n.map(eP));e+=" "+i,t=t&&a})),t?"none":e}observerAdded(e){1==e&&oN(this.inputs,(e=>oN(e,(e=>QN(e)&&iP(e,this)))))}observerRemoved(e){0==e&&oN(this.inputs,(e=>oN(e,(e=>QN(e)&&aP(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),nP(this,e)}};eN.assign({batchedUpdates:eT.unstable_batchedUpdates,createStringInterpolator:bP,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 lA=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new OP(e)),getComponentProps:r=(e=>e)}={})=>{let o={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:r},i=e=>{let t=UP(e)||"Anonymous";return(e=nN.str(e)?i[e]||(i[e]=zP(e,o)):e[HP]||(e[HP]=zP(e,o))).displayName=`Animated(${t})`,e};return iN(e,((t,n)=>{nN.arr(e)&&(n=UP(t)),i[n]=i(t)})),{animated:i}})(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(e,t){if(!e.nodeType||!e.setAttribute)return!1;let n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,{style:r,children:o,scrollTop:i,scrollLeft:a,viewBox:s,...l}=t,c=Object.values(l),u=Object.keys(l).map((t=>n||e.hasAttribute(t)?t:JR[t]||(JR[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==o&&(e.textContent=o);for(let t in r)if(r.hasOwnProperty(t)){let n=XR(t,r[t]);YR.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==i&&(e.scrollTop=i),void 0!==a&&(e.scrollLeft=a),void 0!==s&&e.setAttribute("viewBox",s)},createAnimatedStyle:e=>new aA(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),cA=lA.animated,uA=n(88594),dA=()=>(0,uA.Z)("(prefers-reduced-motion: reduce)");function pA(e){return e.ownerDocument.defaultView,e.ownerDocument.defaultView.getComputedStyle(e)}function hA(e,t="vertical"){if(e){if(("vertical"===t||"all"===t)&&e.scrollHeight>e.clientHeight){const{overflowY:t}=pA(e);if(/(auto|scroll)/.test(t))return e}if(("horizontal"===t||"all"===t)&&e.scrollWidth>e.clientWidth){const{overflowX:t}=pA(e);if(/(auto|scroll)/.test(t))return e}return e.ownerDocument===e.parentNode?e:hA(e.parentNode,t)}}const mA=e=>e+1,fA=e=>({top:e.offsetTop,left:e.offsetLeft});var gA=function({isSelected:e,adjustScrolling:t,enableAnimation:n,triggerAnimationOnChange:r}){const o=(0,x.useRef)(),i=dA()||!n,[a,s]=(0,x.useReducer)(mA,0),[l,c]=(0,x.useReducer)(mA,0),[u,d]=(0,x.useState)({x:0,y:0}),p=(0,x.useMemo)((()=>o.current?fA(o.current):null),[r]),h=(0,x.useMemo)((()=>{if(!t||!o.current)return()=>{};const e=hA(o.current);if(!e)return()=>{};const n=o.current.getBoundingClientRect();return()=>{const t=o.current.getBoundingClientRect().top-n.top;t&&(e.scrollTop+=t)}}),[r,t]);return(0,x.useLayoutEffect)((()=>{a&&c()}),[a]),(0,x.useLayoutEffect)((()=>{if(!p)return;if(i)return void h();o.current.style.transform=void 0;const e=fA(o.current);s(),d({x:Math.round(p.left-e.left),y:Math.round(p.top-e.top)})}),[r]),$R({from:{x:u.x,y:u.y},to:{x:0,y:0},reset:a!==l,config:{mass:5,tension:2e3,friction:200},immediate:i,onChange:function({value:t}){if(!o.current)return;let{x:n,y:r}=t;n=Math.round(n),r=Math.round(r);const i=0===n&&0===r;o.current.style.transformOrigin="center center",o.current.style.transform=i?void 0:`translate3d(${n}px,${r}px,0)`,o.current.style.zIndex=e?"1":"",h()}}),o};function bA(e){return e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0}function vA(e,{sequential:t=!1}={}){const n=e.querySelectorAll(function(e){return[e?'[tabindex]:not([tabindex^="-"])':"[tabindex]","a[href]","button:not([disabled])",'input:not([type="hidden"]):not([disabled])',"select:not([disabled])","textarea:not([disabled])",'iframe:not([tabindex^="-"])',"object","embed","area[href]","[contenteditable]:not([contenteditable=false])"].join(",")}(t));return Array.from(n).filter((e=>{if(!bA(e))return!1;const{nodeName:t}=e;return"AREA"!==t||function(e){const t=e.closest("map[name]");if(!t)return!1;const n=e.ownerDocument.querySelector('img[usemap="#'+t.name+'"]');return!!n&&bA(n)}(e)}))}function yA(e){const t=e.getAttribute("tabindex");return null===t?0:parseInt(t,10)}function _A(e){return-1!==yA(e)}function kA(e,t){return{element:e,index:t}}function wA(e){return e.element}function EA(e,t){const n=yA(e.element),r=yA(t.element);return n===r?e.index-t.index:n-r}function CA(e){return e.filter(_A).map(kA).sort(EA).map(wA).reduce(function(){const e={};return function(t,n){const{nodeName:r,type:o,checked:i,name:a}=n;if("INPUT"!==r||"radio"!==o||!a)return t.concat(n);const s=e.hasOwnProperty(a);if(!i&&s)return t;if(s){const n=e[a];t=t.filter((e=>e!==n))}return e[a]=n,t.concat(n)}}(),[])}function xA(e){return CA(vA(e))}function SA(e){return CA(vA(e.ownerDocument.body)).reverse().find((t=>e.compareDocumentPosition(t)&e.DOCUMENT_POSITION_PRECEDING))}function IA(e){return CA(vA(e.ownerDocument.body)).find((t=>e.compareDocumentPosition(t)&e.DOCUMENT_POSITION_FOLLOWING))}const TA={focusable:v,tabbable:y};function NA(e){return"INPUT"===e?.nodeName}function PA(e){return NA(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 RA(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName}function AA(e){if(!e)return!1;const{tagName:t}=e;return RA(e)||"BUTTON"===t||"SELECT"===t}function BA(e,t,n,r){const o=r.style.zIndex,i=r.style.position,{position:a="static"}=pA(r);"static"===a&&(r.style.position="relative"),r.style.zIndex="10000";const s=function(e,t,n){if(e.caretRangeFromPoint)return e.caretRangeFromPoint(t,n);if(!e.caretPositionFromPoint)return null;const r=e.caretPositionFromPoint(t,n);if(!r)return null;const o=e.createRange();return o.setStart(r.offsetNode,r.offset),o.collapse(!0),o}(e,t,n);return r.style.zIndex=o,r.style.position=i,s}function LA(e){return"rtl"===pA(e).direction}function MA(e,t,n){let r=n();return r&&r.startContainer&&e.contains(r.startContainer)||(e.scrollIntoView(t),r=n(),r&&r.startContainer&&e.contains(r.startContainer))?r:null}function DA(e,t,n){if(!e)return;if(e.focus(),RA(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 r=MA(e,t,(()=>function(e,t,n){const{ownerDocument:r}=e,o=LA(e)?!t:t,i=e.getBoundingClientRect();return void 0===n?n=t?i.right-1:i.left+1:n<=i.left?n=i.left+1:n>=i.right&&(n=i.right-1),BA(r,n,o?i.bottom-1:i.top+1,e)}(e,t,n)));if(!r)return;const{ownerDocument:o}=e,{defaultView:i}=o,a=i.getSelection();a.removeAllRanges(),a.addRange(r)}function OA(e,t){return DA(e,t,void 0)}const FA=".block-editor-block-list__block",jA=".block-list-appender",ZA=".block-editor-button-block-appender";function zA(e,t){return e.closest(FA)===t.closest(FA)}function VA(e,t){return t.closest([FA,jA,ZA].join(","))===e}function HA(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(FA);return t?t.id.slice(6):void 0}function UA(e){const t=(0,x.useRef)(),n=function(e){return(0,yl.Z)((t=>{const{getSelectedBlocksInitialCaretPosition:n,__unstableGetEditorMode:r,isBlockSelected:o}=t(e_);if(o(e)&&"edit"===r())return n()}),[e])}(e),{isBlockSelected:r,isMultiSelecting:o}=(0,yl.Z)(e_);return(0,x.useEffect)((()=>{if(!r(e)||o())return;if(null==n)return;if(!t.current)return;const{ownerDocument:i}=t.current;if(VA(t.current,i.activeElement))return;const a=TA.tabbable.find(t.current).filter((e=>PA(e))),s=-1===n,l=a[s?a.length-1:0]||t.current;if(VA(t.current,l)){if(!t.current.getAttribute("contenteditable")){const e=TA.tabbable.findNext(t.current);if(e&&VA(t.current,e)&&AA(e))return void e.focus()}OA(l,s)}else t.current.focus()}),[n,e]),t}function $A(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function WA(){const e=(0,yl.Z)((e=>{const{getSettings:t}=e(e_);return t().outlineMode}),[]);return If((t=>{if(e)return t.addEventListener("mouseout",$A),t.addEventListener("mouseover",$A),()=>{t.removeEventListener("mouseout",$A),t.removeEventListener("mouseover",$A),t.classList.remove("is-hovered")}}),[e])}function GA(e){return(0,yl.Z)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:r,isBlockSelected:o,isBlockMultiSelected:i,getBlockName:a,getSettings:s,hasSelectedInnerBlock:l,isTyping:c,__unstableIsFullySelected:u,__unstableSelectionHasUnmergeableBlock:d}=t(e_),{outlineMode:p}=s(),h=n(e),m=o(e),f=a(e),g=l(e,!0),b=i(e);return R()({"is-selected":m,"is-highlighted":r(e),"is-multi-selected":b,"is-partially-selected":b&&!u()&&!d(),"is-reusable":dc(sc(f)),"is-dragging":h,"has-child-selected":g,"remove-outline":m&&p&&c()})}),[e])}function qA(e){return(0,yl.Z)((t=>{const n=t(e_).getBlockName(e),r=sc(n);if(r?.apiVersion>1)return Id(n)}),[e])}function KA(e){return(0,yl.Z)((t=>{const{getBlockName:n,getBlockAttributes:r}=t(e_),o=r(e);if(!o?.className)return;const i=sc(n(e));return i?.apiVersion>1?o.className:void 0}),[e])}function YA(e){return(0,yl.Z)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:r,getBlockName:o,getBlockRootClientId:i,isBlockSelected:a}=t(e_);if(!a(e))return;const s=n();return s?R()("is-block-moving-mode",{"can-insert-moving-block":r(o(s),i(e))}):void 0}),[e])}function XA(e){const{isBlockSelected:t}=(0,yl.Z)(e_),{selectBlock:n,selectionChange:r}=(0,_l.Z)(e_);return If((o=>{function i(i){o.parentElement.closest('[contenteditable="true"]')||(t(e)?i.target.isContentEditable||r(e):VA(o,i.target)&&n(e))}return o.addEventListener("focusin",i),()=>{o.removeEventListener("focusin",i)}}),[t,n])}function JA(e){const t=(0,yl.Z)((t=>t(e_).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:r}=(0,yl.Z)(e_),{insertDefaultBlock:o,removeBlock:i}=(0,_l.Z)(e_);return If((a=>{if(t)return a.addEventListener("keydown",s),a.addEventListener("dragstart",l),()=>{a.removeEventListener("keydown",s),a.removeEventListener("dragstart",l)};function s(t){const{keyCode:s,target:l}=t;s!==Hf.K5&&s!==Hf.ZH&&s!==Hf.yY||l!==a||PA(l)||(t.preventDefault(),s===Hf.K5?o({},n(e),r(e)+1):i(e))}function l(e){e.preventDefault()}}),[e,t,n,r,o,i])}function QA(e){const{isNavigationMode:t,isBlockSelected:n}=(0,yl.Z)(e_),{setNavigationMode:r,selectBlock:o}=(0,_l.Z)(e_);return If((i=>{function a(i){t()&&!i.defaultPrevented&&(i.preventDefault(),n(e)?r(!1):o(e))}return i.addEventListener("mousedown",a),()=>{i.removeEventListener("mousedown",a)}}),[e,t,n,r])}const eB=(0,x.createContext)({refs:new Map,callbacks:new Map});function tB({children:e}){const t=(0,x.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,x.createElement)(eB.Provider,{value:t},e)}function nB(e){const{refs:t,callbacks:n}=(0,x.useContext)(eB),r=(0,x.useRef)();return(0,x.useLayoutEffect)((()=>(t.set(r,e),()=>{t.delete(r)})),[e]),If((t=>{r.current=t,n.forEach(((n,r)=>{e===n&&r(t)}))}),[e])}function rB(e){const{refs:t}=(0,x.useContext)(eB),n=(0,x.useRef)();return n.current=e,(0,x.useMemo)((()=>({get current(){let e=null;for(const[r,o]of t.entries())o===n.current&&r.current&&(e=r.current);return e}})),[])}function oB(e){const{callbacks:t}=(0,x.useContext)(eB),n=rB(e),[r,o]=(0,x.useState)(null);return(0,x.useLayoutEffect)((()=>{if(e)return t.set(o,e),()=>{t.delete(o)}}),[e]),n.current||r}function iB(){const e=(0,x.useContext)(pF);return If((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}const aB=200;function sB(e={},{__unstableIsHtml:t}={}){const{clientId:n,className:r,wrapperProps:o={},isAligned:i}=(0,x.useContext)(WS),{index:a,mode:s,name:l,blockApiVersion:c,blockTitle:u,isPartOfSelection:d,adjustScrolling:p,enableAnimation:h,isSubtreeDisabled:m}=(0,yl.Z)((e=>{const{getBlockAttributes:t,getBlockIndex:r,getBlockMode:o,getBlockName:i,isTyping:a,getGlobalBlockCount:s,isBlockSelected:l,isBlockMultiSelected:c,isAncestorMultiSelected:u,isFirstMultiSelectedBlock:d,isBlockSubtreeDisabled:p}=Jy(e(e_)),{getActiveBlockVariation:h}=e(Vu),m=l(n),f=c(n)||u(n),g=i(n),b=sc(g),v=h(g,t(n));return{index:r(n),mode:o(n),name:g,blockApiVersion:b?.apiVersion||1,blockTitle:v?.title||b?.title,isPartOfSelection:m||f,adjustScrolling:m||d(n),enableAnimation:!a()&&s()<=aB,isSubtreeDisabled:p(n)}}),[n]),f=function(e){return(0,yl.Z)((t=>{const{__unstableHasActiveBlockOverlayActive:n}=t(e_);return n(e)}),[e])}(n),g=(0,$.sprintf)((0,$.__)("Block: %s"),u),b="html"!==s||t?"":"-visual",v=(0,Sf.Z)([e.ref,UA(n),nB(n),XA(n),JA(n),QA(n),WA(),iB(),gA({isSelected:d,adjustScrolling:p,enableAnimation:h,triggerAnimationOnChange:a}),LT({isDisabled:!f})]),y=i_();return c<2&&n===y.clientId&&"undefined"!=typeof SCRIPT_DEBUG&&!0===SCRIPT_DEBUG&&(0,Tk.default)(`Block type "${l}" must support API version 2 or higher to work correctly with "useBlockProps" method.`),{tabIndex:0,...o,...e,ref:v,id:`block-${n}${b}`,role:"document","aria-label":g,"data-block":n,"data-type":l,"data-title":u,inert:m?"true":void 0,className:R()(R()("block-editor-block-list__block",{"wp-block":!i,"has-block-overlay":f}),r,e.className,o.className,GA(n),qA(n),KA(n),YA(n)),style:{...o.style,...e.style}}}function lB({children:e,isHtml:t,...n}){return(0,x.createElement)("div",{...sB(n,{__unstableIsHtml:t})},e)}sB.save=Rd;const cB=(0,lT.Z)(((e,{clientId:t,rootClientId:n})=>{const{isBlockSelected:r,getBlockMode:o,isSelectionEnabled:i,getTemplateLock:a,__unstableGetBlockWithoutInnerBlocks:s,canRemoveBlock:l,canMoveBlock:c}=e(e_),u=s(t),d=r(t),p=a(n),h=l(t,n),m=c(t,n),{name:f,attributes:g,isValid:b}=u||{};return{mode:o(t),isSelectionEnabled:i(),isLocked:!!p,canRemove:h,canMove:m,block:u,name:f,attributes:g,isValid:b,isSelected:d}})),uB=(0,cT.Z)(((e,t,n)=>{const{updateBlockAttributes:r,insertBlocks:o,mergeBlocks:i,replaceBlocks:a,toggleSelection:s,__unstableMarkLastChangeAsPersistent:l,moveBlocksToPosition:c,removeBlock:u}=e(e_);return{setAttributes(e){const{getMultiSelectedBlockClientIds:o}=n.select(e_),i=o(),{clientId:a}=t,s=i.length?i:[a];r(s,e)},onInsertBlocks(e,n){const{rootClientId:r}=t;o(e,n,r)},onInsertBlocksAfter(e){const{clientId:r,rootClientId:i}=t,{getBlockIndex:a}=n.select(e_),s=a(r);o(e,s+1,i)},onMerge(e){const{clientId:r,rootClientId:a}=t,{getPreviousBlockClientId:s,getNextBlockClientId:l,getBlock:d,getBlockAttributes:p,getBlockName:h,getBlockOrder:m,getBlockIndex:f,getBlockRootClientId:g,canInsertBlockType:b}=n.select(e_);function v(e,t=!0){const r=g(e),i=m(e),[a]=i;1===i.length&&Tc(d(a))?u(e):n.batch((()=>{if(b(h(a),r))c([a],e,r,f(e));else{const n=xc(d(a),ac());n&&n.length&&(o(n,f(e),r,t),u(a,!1))}!m(e).length&&Tc(d(e))&&u(e,!1)}))}if(e){if(a){const e=l(a);if(e){if(h(a)!==h(e))return void i(a,e);{const t=p(a),r=p(e);if(Object.keys(t).every((e=>t[e]===r[e])))return void n.batch((()=>{c(m(e),e,a),u(e,!1)}))}}}const e=l(r);if(!e)return;m(e).length?v(e,!1):i(r,e)}else{const e=s(r);if(e)i(e,r);else if(a){const e=s(a);if(e&&h(a)===h(e)){const t=p(a),r=p(e);if(Object.keys(t).every((e=>t[e]===r[e])))return void n.batch((()=>{c(m(a),a,e),u(a,!1)}))}v(a)}}},onReplace(e,n,r){e.length&&!Nc(e[e.length-1])&&l();const o=1===e?.length&&Array.isArray(e[0])?e[0]:e;a([t.clientId],o,n,r)},toggleSelection(e){s(e)}}}));var dB=(0,D.Z)(uT.Z,cB,uB,dT((({block:e})=>!!e)),sT("editor.BlockListBlock"))((function({block:{__unstableBlockSource:e},mode:t,isLocked:n,canRemove:r,clientId:o,isSelected:i,isSelectionEnabled:a,className:s,__unstableLayoutClassNames:l,name:c,isValid:u,attributes:d,wrapperProps:p,setAttributes:h,onReplace:m,onInsertBlocksAfter:f,onMerge:g,toggleSelection:b}){var v;const{themeSupportsLayout:y,isTemporarilyEditingAsBlocks:_,blockEditingMode:k}=(0,yl.Z)((e=>{const{getSettings:t,__unstableGetTemporarilyEditingAsBlocks:n,getBlockEditingMode:r}=e(e_);return{themeSupportsLayout:t().supportsLayout,isTemporarilyEditingAsBlocks:n()===o,blockEditingMode:r(o)}}),[o]),{removeBlock:w}=(0,_l.Z)(e_),E=(0,x.useCallback)((()=>w(o)),[o]),C=LS()||{};let S=(0,x.createElement)(vT,{name:c,isSelected:i,attributes:d,setAttributes:h,insertBlocksAfter:n?void 0:f,onReplace:r?m:void 0,onRemove:r?E:void 0,mergeBlocks:r?g:void 0,clientId:o,isSelectionEnabled:a,toggleSelection:b,__unstableLayoutClassNames:l,__unstableParentLayout:Object.keys(C).length?C:void 0});const I=sc(c);"disabled"===k&&(p={...p,tabIndex:-1}),I?.getEditWrapperProps&&(p=function(e,t){const n={...e,...t};return e?.className&&t?.className&&(n.className=R()(e.className,t.className)),e?.style&&t?.style&&(n.style={...e.style,...t.style}),n}(p,I.getEditWrapperProps(d)));const T=p&&!!p["data-align"]&&!y;let N;if(T&&(S=(0,x.createElement)("div",{className:"wp-block","data-align":p["data-align"]},S)),u)N="html"===t?(0,x.createElement)(x.Fragment,null,(0,x.createElement)("div",{style:{display:"none"}},S),(0,x.createElement)(lB,{isHtml:!0},(0,x.createElement)(AT,{clientId:o}))):I?.apiVersion>1?S:(0,x.createElement)(lB,{...p},S);else{const t=e?Sd(e):Bd(I,d);N=(0,x.createElement)(lB,{className:"has-warning"},(0,x.createElement)(ST,{clientId:o}),(0,x.createElement)(nd,null,Vl(t)))}const{"data-align":P,...A}=null!==(v=p)&&void 0!==v?v:{},B={clientId:o,className:R()({"is-editing-disabled":"disabled"===k,"is-content-locked-temporarily-editing-as-blocks":_},P&&y&&`align${P}`,s),wrapperProps:A,isAligned:T},L=(0,x.useMemo)((()=>B),Object.values(B));return(0,x.createElement)(WS.Provider,{value:L},(0,x.createElement)(PT,{fallback:(0,x.createElement)(lB,{className:"has-warning"},(0,x.createElement)(TT,null))},N))})),pB=n(96599),hB=n(618),mB=n(5600),fB=n(98097),gB=n(7357),bB=function(e){const{children:t}=e;return(0,x.createElement)("div",{className:"components-tip"},(0,x.createElement)(c_.Z,{icon:gB.Z}),(0,x.createElement)("p",null,t))};const vB=[(0,fB.Z)((0,$.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,x.createElement)("kbd",null)}),(0,fB.Z)((0,$.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,x.createElement)("kbd",null)}),(0,fB.Z)((0,$.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,x.createElement)("kbd",null)}),(0,$.__)("Drag files into the editor to automatically insert media blocks."),(0,$.__)("Change a block's type by pressing the block icon on the toolbar.")];var yB=function(){const[e]=(0,x.useState)(Math.floor(Math.random()*vB.length));return(0,x.createElement)(bB,null,vB[e])},_B=n(27773),kB=n(91023),wB=n(32566),EB=(0,x.memo)((function({icon:e,showColors:t=!1,className:n,context:r}){"block-default"===e?.src&&(e={src:wB.Z});const o=(0,x.createElement)(V_.Z,{icon:e&&e.src?e.src:e,context:r}),i=t?{backgroundColor:e&&e.background,color:e&&e.foreground}:{};return(0,x.createElement)("span",{style:i,className:R()("block-editor-block-icon",n,{"has-colors":t})},o)})),CB=function({title:e,icon:t,description:n,blockType:r,className:o}){r&&((0,q.Z)("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:e,icon:t,description:n}=r));const{parentNavBlockClientId:i}=(0,yl.Z)((e=>{const{getSelectedBlockClientId:t,getBlockParentsByBlockName:n}=e(e_);return{parentNavBlockClientId:n(t(),"core/navigation",!0)[0]}}),[]),{selectBlock:a}=(0,_l.Z)(e_);return(0,x.createElement)("div",{className:R()("block-editor-block-card",o)},i&&(0,x.createElement)(Gh.ZP,{onClick:()=>a(i),label:(0,$.__)("Go to parent Navigation block"),style:{minWidth:24,padding:0},icon:(0,$.isRTL)()?_B.Z:kB.Z,isSmall:!0}),(0,x.createElement)(EB,{icon:t,showColors:!0}),(0,x.createElement)("div",{className:"block-editor-block-card__content"},(0,x.createElement)("h2",{className:"block-editor-block-card__title"},e),(0,x.createElement)("span",{className:"block-editor-block-card__description"},n)))},xB=n(28043),SB=n(87256),IB=n(37127),TB=(0,Wh.o)((e=>(0,xB.Z)((({useSubRegistry:t=!0,registry:n,...r})=>{if(!t)return(0,x.createElement)(e,{registry:n,...r});const[o,i]=(0,x.useState)(null);return(0,x.useEffect)((()=>{const e=(0,SB.p)({},n);e.registerStore(Yy,Qy),i(e)}),[n]),o?(0,x.createElement)(IB.ZP,{value:o},(0,x.createElement)(e,{registry:o,...r})):null}))),"withRegistryProvider");const NB=()=>{};function PB({clientId:e=null,value:t,selection:n,onChange:r=NB,onInput:o=NB}){const i=(0,Tf.Z)(),{resetBlocks:a,resetSelection:s,replaceInnerBlocks:l,selectBlock:c,setHasControlledInnerBlocks:u,__unstableMarkNextChangeAsNotPersistent:d}=i.dispatch(e_),{hasSelectedBlock:p,getBlockName:h,getBlocks:m,getSelectionStart:f,getSelectionEnd:g,getBlock:b}=i.select(e_),v=(0,yl.Z)((t=>!e||t(e_).areInnerBlocksControlled(e)),[e]),y=(0,x.useRef)({incoming:null,outgoing:[]}),_=(0,x.useRef)(!1),k=()=>{t&&(d(),e?i.batch((()=>{u(e,!0);const n=t.map((e=>vc(e)));_.current&&(y.current.incoming=n),d(),l(e,n)})):(_.current&&(y.current.incoming=t),a(t)))},w=(0,x.useRef)(o),E=(0,x.useRef)(r);(0,x.useEffect)((()=>{w.current=o,E.current=r}),[o,r]),(0,x.useEffect)((()=>{if(y.current.outgoing.includes(t))y.current.outgoing[y.current.outgoing.length-1]===t&&(y.current.outgoing=[]);else if(m(e)!==t){y.current.outgoing=[];const t=p(),r=f(),o=g();if(k(),n)s(n.selectionStart,n.selectionEnd,n.initialPosition);else{const n=b(r.clientId);t&&!n?c(e):s(r,o)}}}),[t,e]),(0,x.useEffect)((()=>{v||(y.current.outgoing=[],k())}),[v]),(0,x.useEffect)((()=>{const{getSelectedBlocksInitialCaretPosition:t,isLastBlockChangePersistent:n,__unstableIsLastBlockChangeIgnored:r,areInnerBlocksControlled:o}=i.select(e_);let a=m(e),s=n(),l=!1;_.current=!0;const c=i.subscribe((()=>{if(null!==e&&null===h(e))return;if(e&&!o(e))return;const i=n(),c=m(e),u=c!==a;if(a=c,u&&(y.current.incoming||r()))return y.current.incoming=null,void(s=i);(u||l&&!u&&i&&!s)&&(s=i,y.current.outgoing.push(a),(s?E.current:w.current)(a,{selection:{selectionStart:f(),selectionEnd:g(),initialPosition:t()}})),l=u}));return()=>{_.current=!1,c()}}),[i,e]),(0,x.useEffect)((()=>()=>{d(),e?(u(e,!1),d(),l(e,[])):a([])}),[])}var RB=n(61750);function AB(){return null}AB.Register=function(){const{registerShortcut:e}=(0,_l.Z)(RB.h);return(0,x.useEffect)((()=>{e({name:"core/block-editor/duplicate",category:"block",description:(0,$.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,$.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,$.__)("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,$.__)("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,$.__)("Delete selection."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:(0,$.__)("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,$.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/multi-text-selection",category:"selection",description:(0,$.__)("Select text across multiple blocks."),keyCombination:{modifier:"shift",character:"arrow"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,$.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,$.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,$.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}})}),[e]),null};var BB=AB;const LB=TB((e=>{const{children:t,settings:n,stripExperimentalSettings:r=!1}=e,{__experimentalUpdateSettings:o}=Jy((0,_l.Z)(e_));return(0,x.useEffect)((()=>{o({...n,__internalIsInitialized:!0},{stripExperimentalSettings:r,reset:!0})}),[n,r,o]),PB(e),(0,x.createElement)(kl.zt,{passthrough:!0},(0,x.createElement)(BB.Register,null),(0,x.createElement)(tB,null,t))}));var MB=e=>(0,x.createElement)(LB,{...e,stripExperimentalSettings:!0},e.children);const DB=(e,t,n)=>e[t]?e[t][0]?e[t][0][n]:e[t][n]:"contentBoxSize"===t?e.contentRect["inlineSize"===n?"width":"height"]:void 0;function OB(){const{ref:e,width:t,height:n}=function(e={}){const t=e.onResize,n=(0,x.useRef)(void 0);n.current=t;const r=e.round||Math.round,o=(0,x.useRef)(),[i,a]=(0,x.useState)({width:void 0,height:void 0}),s=(0,x.useRef)(!1);(0,x.useEffect)((()=>(s.current=!1,()=>{s.current=!0})),[]);const l=(0,x.useRef)({width:void 0,height:void 0}),c=function(e,t){const n=(0,x.useRef)(null),r=(0,x.useRef)(null),o=(0,x.useRef)(),i=(0,x.useCallback)((()=>{let a=null;n.current?a=n.current:t&&(a=t instanceof HTMLElement?t:t.current),r.current&&r.current.element===a&&r.current.reporter===i||(o.current&&(o.current(),o.current=null),r.current={reporter:i,element:a},a&&(o.current=e(a)))}),[t,e]);return(0,x.useEffect)((()=>{i()}),[i]),(0,x.useCallback)((e=>{n.current=e,i()}),[i])}((0,x.useCallback)((t=>(o.current&&o.current.box===e.box&&o.current.round===r||(o.current={box:e.box,round:r,instance:new ResizeObserver((t=>{const o=t[0];let i="borderBoxSize";i="border-box"===e.box?"borderBoxSize":"device-pixel-content-box"===e.box?"devicePixelContentBoxSize":"contentBoxSize";const c=DB(o,i,"inlineSize"),u=DB(o,i,"blockSize"),d=c?r(c):void 0,p=u?r(u):void 0;if(l.current.width!==d||l.current.height!==p){const e={width:d,height:p};l.current.width=d,l.current.height=p,n.current?n.current(e):s.current||a(e)}}))}),o.current.instance.observe(t,{box:e.box}),()=>{o.current&&o.current.instance.unobserve(t)})),[e.box,r]),e.ref);return(0,x.useMemo)((()=>({ref:c,width:i.width,height:i.height})),[c,i?i.width:null,i?i.height:null])}(),r=(0,x.useMemo)((()=>({width:null!=t?t:null,height:null!=n?n:null})),[t,n]);return[(0,x.createElement)("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none",opacity:0,overflow:"hidden",zIndex:-1},"aria-hidden":"true",ref:e}),r]}const FB={name:"u2jump",styles:"position:relative;pointer-events:none;&::after{content:'';position:absolute;top:0;right:0;bottom:0;left:0;}*{pointer-events:none;}"},jB=(0,x.createContext)(!1),{Consumer:ZB,Provider:zB}=jB;function VB({className:e,children:t,isDisabled:n=!0,...r}){const o=(0,Ak.I)();return(0,x.createElement)(zB,{value:n},(0,x.createElement)("div",{inert:n?"true":void 0,className:n?o(FB,e,"components-disabled"):void 0,...r},t))}VB.Context=jB,VB.Consumer=ZB;var HB=VB;function UB(){const{getSettings:e,hasSelectedBlock:t,hasMultiSelection:n}=(0,yl.Z)(e_),{clearSelectedBlock:r}=(0,_l.Z)(e_),{clearBlockSelection:o}=e();return If((e=>{if(o)return e.addEventListener("mousedown",i),()=>{e.removeEventListener("mousedown",i)};function i(o){(t()||n())&&o.target===e&&r()}}),[t,n,r,o])}function $B(e){return(0,x.createElement)("div",{ref:UB(),...e})}function WB(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:r,getSelectedBlockClientId:o,getSelectedBlocksInitialCaretPosition:i,__unstableIsFullySelected:a}=e(e_);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:r(),selectedBlockClientId:o(),initialPosition:i(),isFullSelection:a()}}function GB(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:r,selectedBlockClientId:o,isFullSelection:i}=(0,yl.Z)(WB,[]);return If((o=>{const{ownerDocument:a}=o,{defaultView:s}=a;if(null==e)return;if(!r||t)return;const{length:l}=n;l<2||i&&(o.contentEditable=!0,o.focus(),s.getSelection().removeAllRanges())}),[r,t,n,o,e,i])}function qB(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:r,bottom:o,left:i,right:a}=n[0];for(const{top:e,bottom:t,left:s,right:l}of n)e<r&&(r=e),t>o&&(o=t),s<i&&(i=s),l>a&&(a=l);return new window.DOMRect(i,r,a-i,o-r)}const{startContainer:t}=e,{ownerDocument:n}=t;if("BR"===t.nodeName){const{parentNode:r}=t,o=Array.from(r.childNodes).indexOf(t);(e=n.createRange()).setStart(r,o),e.setEnd(r,o)}const r=e.getClientRects();if(r.length>1)return null;let o=r[0];if(!o||0===o.height){const t=n.createTextNode("");(e=e.cloneRange()).insertNode(t),o=e.getClientRects()[0],t.parentNode,t.parentNode.removeChild(t)}return o}function KB(e,t,n=!1){if(RA(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:r}=e,{defaultView:o}=r,i=o.getSelection();if(!i||!i.rangeCount)return!1;const a=i.getRangeAt(0),s=a.cloneRange(),l=function(e){const{anchorNode:t,focusNode:n,anchorOffset:r,focusOffset:o}=e,i=t.compareDocumentPosition(n);return!(i&t.DOCUMENT_POSITION_PRECEDING)&&(!!(i&t.DOCUMENT_POSITION_FOLLOWING)||0!==i||r<=o)}(i),c=i.isCollapsed;c||s.collapse(!l);const u=qB(s),d=qB(a);if(!u||!d)return!1;const p=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}(a);if(!c&&p&&p>u.height&&l===t)return!1;const h=LA(e)?!t:t,m=e.getBoundingClientRect(),f=h?m.left+1:m.right-1,g=t?m.top+1:m.bottom-1,b=MA(e,t,(()=>BA(r,f,g,e)));if(!b)return!1;const v=qB(b);if(!v)return!1;const y=t?"top":"bottom",_=h?"left":"right",k=v[y]-d[y],w=v[_]-u[_],E=Math.abs(k)<=1,C=Math.abs(w)<=1;return n?E:E&&C}function YB(e,t){return KB(e,t,!0)}function XB(e,t){return KB(e,t)}function JB(e,t,n,r){let o,i=TA.focusable.find(n);return t&&i.reverse(),i=i.slice(i.indexOf(e)+1),r&&(o=e.getBoundingClientRect()),i.find((function(e){if(1!==e.children.length||!zA(e,e.firstElementChild)||"true"!==e.firstElementChild.getAttribute("contenteditable")){if(!TA.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(r){const t=e.getBoundingClientRect();if(t.left>=o.right||t.right<=o.left)return!1}return!0}}))}function QB(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:r,__unstableIsFullySelected:o}=(0,yl.Z)(e_),{selectBlock:i}=(0,_l.Z)(e_);return If((a=>{let s;function l(){s=null}function c(l){if(l.defaultPrevented)return;const{keyCode:c,target:u,shiftKey:d,ctrlKey:p,altKey:h,metaKey:m}=l,f=c===Hf.UP,g=c===Hf.WV,b=c===Hf.RL,v=c===Hf.pX,y=f||b,_=b||v,k=f||g,w=_||k,E=d||p||h||m,C=k?YB:XB,{ownerDocument:x}=a,{defaultView:S}=x;if(!w)return;if(r()){if(d)return;if(!o())return;return l.preventDefault(),void(y?i(e()):i(t(),-1))}if(!function(e,t,n){const r=t===Hf.UP||t===Hf.WV,{tagName:o}=e,i=e.getAttribute("type");return r&&!n?"INPUT"!==o||!["date","datetime-local","month","number","range","time","week"].includes(i):"INPUT"===o?["button","checkbox","number","color","file","image","radio","reset","submit"].includes(i):"TEXTAREA"!==o}(u,c,E))return;k?s||(s=function(e){const t=e.getSelection(),n=t.rangeCount?t.getRangeAt(0):null;return n?qB(n):null}(S)):s=null;const I=LA(u)?!y:y,{keepCaretInsideBlock:T}=n();if(d)(function(e,t){const n=JB(e,t,a);return n&&HA(n)})(u,y)&&C(u,y)&&(a.contentEditable=!0,a.focus());else if(!k||!YB(u,y)||h&&!XB(u,I)||T)_&&S.getSelection().isCollapsed&&XB(u,I)&&!T&&(OA(JB(u,I,a),y),l.preventDefault());else{const e=JB(u,y,a,!0);e&&(function(e,t,n){DA(e,t,n?.left)}(e,h?!y:y,h?void 0:s),l.preventDefault())}}return a.addEventListener("mousedown",l),a.addEventListener("keydown",c),()=>{a.removeEventListener("mousedown",l),a.removeEventListener("keydown",c)}}),[])}function eL(e,t,n){let r=t;do{if(e===r)return!0;r=r[n]}while(r);return!1}function tL(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,yl.Z)(e_),{multiSelect:r,selectBlock:o}=(0,_l.Z)(e_),i=(0,RB.sx)();return If((a=>{function s(s){if(!i("core/block-editor/select-all",s))return;const l=t();if(l.length<2&&!function(e){if(RA(e))return 0===e.selectionStart&&e.value.length===e.selectionEnd;if(!e.isContentEditable)return!0;const{ownerDocument:t}=e,{defaultView:n}=t,r=n.getSelection(),o=r.rangeCount?r.getRangeAt(0):null;if(!o)return!0;const{startContainer:i,endContainer:a,startOffset:s,endOffset:l}=o;if(i===e&&a===e&&0===s&&l===e.childNodes.length)return!0;e.lastChild;const c=a.nodeType===a.TEXT_NODE?a.data.length:a.childNodes.length;return eL(i,e,"firstChild")&&eL(a,e,"lastChild")&&0===s&&l===c}(s.target))return;s.preventDefault();const[c]=l,u=n(c),d=e(u);l.length!==d.length?r(d[0],d[d.length-1]):u&&(a.ownerDocument.defaultView.getSelection().removeAllRanges(),o(u))}return a.addEventListener("keydown",s),()=>{a.removeEventListener("keydown",s)}}),[])}function nL(e,t){e.contentEditable=t,t&&e.focus()}function rL(){const{startMultiSelect:e,stopMultiSelect:t}=(0,_l.Z)(e_),{isSelectionEnabled:n,hasMultiSelection:r,isDraggingBlocks:o}=(0,yl.Z)(e_);return If((i=>{const{ownerDocument:a}=i,{defaultView:s}=a;let l,c;function u(){t(),s.removeEventListener("mouseup",u),c=s.requestAnimationFrame((()=>{if(r())return;nL(i,!1);const e=s.getSelection();if(e.rangeCount){const{commonAncestorContainer:t}=e.getRangeAt(0);l.contains(t)&&l.focus()}}))}function d({buttons:t,target:r}){o()||1===t&&"true"===r.getAttribute("contenteditable")&&n()&&(l=r,e(),s.addEventListener("mouseup",u),nL(i,!0))}return i.addEventListener("mouseout",d),()=>{i.removeEventListener("mouseout",d),s.removeEventListener("mouseup",u),s.cancelAnimationFrame(c)}}),[e,t,n,r])}function oL(e,t){e.contentEditable!==String(t)&&(e.contentEditable=t),t&&e.focus()}function iL(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,_l.Z)(e_),{getBlockParents:r,getBlockSelectionStart:o}=(0,yl.Z)(e_);return If((n=>{const{ownerDocument:i}=n,{defaultView:a}=i;function s(i){const s=a.getSelection();if(!s.rangeCount)return;const l=i.shiftKey&&"mouseup"===i.type;if(s.isCollapsed&&!l)return void oL(n,!1);let c=HA(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE||0===n?t:t.childNodes[n-1]}(s)),u=HA(function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE||n===t.childNodes.length?t:t.childNodes[n]}(s));if(l){const e=o(),t=HA(i.target),n=t!==u;(c===u&&s.isCollapsed||!u||n)&&(u=t),c!==e&&(c=e)}if(void 0!==c||void 0!==u)if(c===u)t(c);else{const t=[...r(c),c],n=[...r(u),u],o=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,n);e(t[o],n[o])}else oL(n,!1)}function l(){i.addEventListener("selectionchange",s),a.addEventListener("mouseup",s)}function c(){i.removeEventListener("selectionchange",s),a.removeEventListener("mouseup",s)}function u(){c(),l()}return l(),n.addEventListener("focusin",u),()=>{c(),n.removeEventListener("focusin",u)}}),[e,t,n,r])}function aL(){const{selectBlock:e}=(0,_l.Z)(e_),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:r}=(0,yl.Z)(e_);return If((o=>{function i(i){if(!t()||0!==i.button)return;const a=n(),s=HA(i.target);i.shiftKey?a!==s&&(o.contentEditable=!0,o.focus()):r()&&e(s)}return o.addEventListener("mousedown",i),()=>{o.removeEventListener("mousedown",i)}}),[e,t,n,r])}function sL(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:r}=(0,yl.Z)(e_),{replaceBlocks:o,__unstableSplitSelection:i,removeBlocks:a,__unstableDeleteSelection:s,__unstableExpandSelection:l}=(0,_l.Z)(e_);return If((c=>{function u(e){"true"===c.contentEditable&&e.preventDefault()}function d(u){u.defaultPrevented||r()&&(u.keyCode===Hf.K5?(c.contentEditable=!1,u.preventDefault(),e()?o(t(),fc(ac())):i()):u.keyCode===Hf.ZH||u.keyCode===Hf.yY?(c.contentEditable=!1,u.preventDefault(),e()?a(t()):n()?s(u.keyCode===Hf.yY):l()):1!==u.key.length||u.metaKey||u.ctrlKey||(c.contentEditable=!1,n()?s(u.keyCode===Hf.yY):(u.preventDefault(),c.ownerDocument.defaultView.getSelection().removeAllRanges())))}function p(e){r()&&(c.contentEditable=!1,n()?s():(e.preventDefault(),c.ownerDocument.defaultView.getSelection().removeAllRanges()))}return c.addEventListener("beforeinput",u),c.addEventListener("keydown",d),c.addEventListener("compositionstart",p),()=>{c.removeEventListener("beforeinput",u),c.removeEventListener("keydown",d),c.removeEventListener("compositionstart",p)}}),[])}function lL(){const[e,t,n]=function(){const e=(0,x.useRef)(),t=(0,x.useRef)(),n=(0,x.useRef)(),r=(0,x.useRef)(),{hasMultiSelection:o,getSelectedBlockClientId:i,getBlockCount:a}=(0,yl.Z)(e_),{setNavigationMode:s}=(0,_l.Z)(e_),l=(0,yl.Z)((e=>e(e_).isNavigationMode()),[])?void 0:"0",c=(0,x.useRef)();function u(t){if(c.current)c.current=null;else if(o())e.current.focus();else if(i())r.current.focus();else{s(!0);const n=e.current.ownerDocument===t.target.ownerDocument?e.current:e.current.ownerDocument.defaultView.frameElement,r=t.target.compareDocumentPosition(n)&t.target.DOCUMENT_POSITION_FOLLOWING,o=TA.tabbable.find(e.current);o.length&&(r?o[0]:o[o.length-1]).focus()}}const d=(0,x.createElement)("div",{ref:t,tabIndex:l,onFocus:u}),p=(0,x.createElement)("div",{ref:n,tabIndex:l,onFocus:u}),h=If((l=>{function u(e){if(e.defaultPrevented)return;if(e.keyCode===Hf.hY&&!o())return e.preventDefault(),void s(!0);if(e.keyCode!==Hf.Mf)return;const r=e.shiftKey,a=r?"findPrevious":"findNext";if(!o()&&!i())return void(e.target===l&&s(!0));const u=TA.tabbable[a](e.target),d=e.target.closest("[data-block]"),p=d&&u&&(zA(d,u)||VA(d,u));if(AA(u)&&p)return;const h=r?t:n;c.current=!0,h.current.focus({preventScroll:!0})}function d(e){r.current=e.target;const{ownerDocument:t}=l;e.relatedTarget||t.activeElement!==t.body||0!==a()||l.focus()}function p(r){if(r.keyCode!==Hf.Mf)return;if("region"===r.target?.getAttribute("role"))return;if(e.current===r.target)return;const o=r.shiftKey?"findPrevious":"findNext",i=TA.tabbable[o](r.target);i!==t.current&&i!==n.current||(r.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:h}=l,{defaultView:m}=h;return m.addEventListener("keydown",p),l.addEventListener("keydown",u),l.addEventListener("focusout",d),()=>{m.removeEventListener("keydown",p),l.removeEventListener("keydown",u),l.removeEventListener("focusout",d)}}),[]);return[d,(0,Sf.Z)([e,h]),p]}(),r=(0,yl.Z)((e=>e(e_).hasMultiSelection()),[]);return[e,(0,Sf.Z)([t,sL(),rL(),iL(),aL(),GB(),tL(),QB(),If((e=>{if(e.tabIndex=0,e.contentEditable=r,r)return e.classList.add("has-multi-selection"),e.setAttribute("aria-label",(0,$.__)("Multiple selected blocks")),()=>{e.classList.remove("has-multi-selection"),e.removeAttribute("aria-label")}}),[r])]),n]}var cL=(0,x.forwardRef)((function({children:e,...t},n){const[r,o,i]=lL();return(0,x.createElement)(x.Fragment,null,r,(0,x.createElement)("div",{...t,ref:(0,Sf.Z)([o,n]),className:R()(t.className,"block-editor-writing-flow")},e),i)}));function uL(e,t,n){const r={};for(const t in e)r[t]=e[t];if(e instanceof n.contentDocument.defaultView.MouseEvent){const e=n.getBoundingClientRect();r.clientX+=e.left,r.clientY+=e.top}const o=new t(e.type,r);r.defaultPrevented&&o.preventDefault(),!n.dispatchEvent(o)&&e.preventDefault()}function dL(e){return If((t=>{const{defaultView:n}=e;if(!n)return;const{frameElement:r}=n,o=["dragover","mousemove"],i={};for(const e of o)i[e]=e=>{const t=Object.getPrototypeOf(e).constructor.name;uL(e,window[t],r)},t.addEventListener(e,i[e]);return()=>{for(const e of o)t.removeEventListener(e,i[e])}}))}function pL({contentRef:e,children:t,tabIndex:n=0,scale:r=1,frameSize:o=0,expand:i=!1,readonly:a,forwardedRef:s,...l}){const{resolvedAssets:c,isPreviewMode:u}=(0,yl.Z)((e=>{const t=e(e_).getSettings();return{resolvedAssets:t.__unstableResolvedAssets,isPreviewMode:t.__unstableIsPreviewMode}}),[]),{styles:d="",scripts:p=""}=c,[h,m]=(0,x.useState)(),[f,g]=(0,x.useState)([]),b=(0,x.useMemo)((()=>Array.from(document.styleSheets).reduce(((e,t)=>{try{t.cssRules}catch(t){return e}const{ownerNode:n,cssRules:r}=t;if(null===n)return e;if(!r)return e;if("wp-reset-editor-styles-css"===n.id)return e;if(!n.id)return e;if(function e(t){return Array.from(t).find((({selectorText:t,conditionText:n,cssRules:r})=>n?e(r):t&&(t.includes(".editor-styles-wrapper")||t.includes(".wp-block"))))}(r)){const t="STYLE"===n.tagName;if(t){const t=n.id.replace("-inline-css","-css"),r=document.getElementById(t);r&&e.push(r.cloneNode(!0))}if(e.push(n.cloneNode(!0)),!t){const t=n.id.replace("-css","-inline-css"),r=document.getElementById(t);r&&e.push(r.cloneNode(!0))}}return e}),[])),[]),v=UB(),[y,_,k]=lL(),[w,{height:E}]=OB(),C=If((e=>{let t;function n(e){e.preventDefault()}function r(){const{contentDocument:r,ownerDocument:o}=e,{documentElement:i}=r;t=r,v(i),g(Array.from(o.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),r.dir=o.dir;for(const e of b)r.getElementById(e.id)||(r.head.appendChild(e.cloneNode(!0)),u||console.warn(`${e.id} was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,e));t.addEventListener("dragover",n,!1),t.addEventListener("drop",n,!1)}return e._load=()=>{m(e.contentDocument)},e.addEventListener("load",r),()=>{delete e._load,e.removeEventListener("load",r),t?.removeEventListener("dragover",n),t?.removeEventListener("drop",n)}}),[]),S=LT({isDisabled:!a}),I=(0,Sf.Z)([dL(h),e,v,_,S]),T=`<!doctype html>\n<html>\n\t<head>\n\t\t<meta charset="utf-8">\n\t\t<script>window.frameElement._load()<\/script>\n\t\t<style>html{height:auto!important;min-height:100%;}body{margin:0}</style>\n\t\t${d}\n\t\t${p}\n\t</head>\n\t<body>\n\t\t<script>document.currentScript.parentElement.remove()<\/script>\n\t</body>\n</html>`,[N,P]=(0,x.useMemo)((()=>{const e=URL.createObjectURL(new window.Blob([T],{type:"text/html"}));return[e,()=>URL.revokeObjectURL(e)]}),[T]);(0,x.useEffect)((()=>P),[P]);const A=E*(1-r)/2;return(0,x.createElement)(x.Fragment,null,n>=0&&y,(0,x.createElement)("iframe",{...l,style:{border:0,...l.style,height:i?E:l.style?.height,marginTop:1!==r?-A+o:l.style?.marginTop,marginBottom:1!==r?-A+o:l.style?.marginBottom,transform:1!==r?`scale( ${r} )`:l.style?.transform,transition:"all .3s"},ref:(0,Sf.Z)([s,C]),tabIndex:n,src:N,title:(0,$.__)("Editor canvas"),onKeyDown:e=>{e.currentTarget.ownerDocument!==e.target.ownerDocument&&(e.stopPropagation(),uL(e,window.KeyboardEvent,e.currentTarget))}},h&&(0,eT.createPortal)((0,x.createElement)("body",{ref:I,className:R()("block-editor-iframe__body","editor-styles-wrapper",...f)},w,(0,x.createElement)(rm.Z,{document:h},t)),h.documentElement)),n>=0&&k)}var hL=(0,x.forwardRef)((function(e,t){return(0,yl.Z)((e=>e(e_).getSettings().__internalIsInitialized),[])?(0,x.createElement)(pL,{...e,forwardedRef:t}):null})),mL=n(28771),fL=n.n(mL);const gL=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function bL(e,t){t=t||{};let n=1,r=1;function o(e){const t=e.match(/\n/g);t&&(n+=t.length);const o=e.lastIndexOf("\n");r=~o?e.length-o:r+e.length}function i(){const e={line:n,column:r};return function(t){return t.position=new a(e),h(),t}}function a(e){this.start=e,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;const s=[];function l(o){const i=new Error(t.source+":"+n+":"+r+": "+o);if(i.reason=o,i.filename=t.source,i.line=n,i.column=r,i.source=e,!t.silent)throw i;s.push(i)}function c(){return p(/^{\s*/)}function u(){return p(/^}/)}function d(){let t;const n=[];for(h(),m(n);e.length&&"}"!==e.charAt(0)&&(t=C()||x());)!1!==t&&(n.push(t),m(n));return n}function p(t){const n=t.exec(e);if(!n)return;const r=n[0];return o(r),e=e.slice(r.length),n}function h(){p(/^\s*/)}function m(e){let t;for(e=e||[];t=f();)!1!==t&&e.push(t);return e}function f(){const t=i();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return l("End of comment missing");const a=e.slice(2,n-2);return r+=2,o(a),e=e.slice(n),r+=2,t({type:"comment",comment:a})}function g(){const e=p(/^([^{]+)/);if(e)return vL(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function b(){const e=i();let t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;if(t=vL(t[0]),!p(/^:\s*/))return l("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),r=e({type:"declaration",property:t.replace(gL,""),value:n?vL(n[0]).replace(gL,""):""});return p(/^[;\s]*/),r}function v(){const e=[];if(!c())return l("missing '{'");let t;for(m(e);t=b();)!1!==t&&(e.push(t),m(e));return u()?e:l("missing '}'")}function y(){let e;const t=[],n=i();for(;e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:v()})}const _=E("import"),k=E("charset"),w=E("namespace");function E(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){const n=i(),r=p(t);if(!r)return;const o={type:e};return o[e]=r[1].trim(),n(o)}}function C(){if("@"===e[0])return function(){const e=i();let t=p(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=p(/^([-\w]+)\s*/),!t)return l("@keyframes missing name");const r=t[1];if(!c())return l("@keyframes missing '{'");let o,a=m();for(;o=y();)a.push(o),a=a.concat(m());return u()?e({type:"keyframes",name:r,vendor:n,keyframes:a}):l("@keyframes missing '}'")}()||function(){const e=i(),t=p(/^@media *([^{]+)/);if(!t)return;const n=vL(t[1]);if(!c())return l("@media missing '{'");const r=m().concat(d());return u()?e({type:"media",media:n,rules:r}):l("@media missing '}'")}()||function(){const e=i(),t=p(/^@container *([^{]+)/);if(!t)return;const n=vL(t[1]);if(!c())return l("@container missing '{'");const r=m().concat(d());return u()?e({type:"container",container:n,rules:r}):l("@container missing '}'")}()||function(){const e=i(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:vL(t[1]),media:vL(t[2])})}()||function(){const e=i(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=vL(t[1]);if(!c())return l("@supports missing '{'");const r=m().concat(d());return u()?e({type:"supports",supports:n,rules:r}):l("@supports missing '}'")}()||_()||k()||w()||function(){const e=i(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=vL(t[1]),r=vL(t[2]);if(!c())return l("@document missing '{'");const o=m().concat(d());return u()?e({type:"document",document:r,vendor:n,rules:o}):l("@document missing '}'")}()||function(){const e=i();if(!p(/^@page */))return;const t=g()||[];if(!c())return l("@page missing '{'");let n,r=m();for(;n=b();)r.push(n),r=r.concat(m());return u()?e({type:"page",selectors:t,declarations:r}):l("@page missing '}'")}()||function(){const e=i();if(!p(/^@host\s*/))return;if(!c())return l("@host missing '{'");const t=m().concat(d());return u()?e({type:"host",rules:t}):l("@host missing '}'")}()||function(){const e=i();if(!p(/^@font-face\s*/))return;if(!c())return l("@font-face missing '{'");let t,n=m();for(;t=b();)n.push(t),n=n.concat(m());return u()?e({type:"font-face",declarations:n}):l("@font-face missing '}'")}()}function x(){const e=i(),t=g();return t?(m(),e({type:"rule",selectors:t,declarations:v()})):l("selector missing")}return yL(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:s}}}())}function vL(e){return e?e.replace(/^\s+|\s+$/g,""):""}function yL(e,t){const n=e&&"string"==typeof e.type,r=n?e:t;for(const t in e){const n=e[t];Array.isArray(n)?n.forEach((function(e){yL(e,r)})):n&&"object"==typeof n&&yL(n,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var _L=n(89118),kL=n.n(_L),wL=EL;function EL(e){this.options=e||{}}EL.prototype.emit=function(e){return e},EL.prototype.visit=function(e){return this[e.type](e)},EL.prototype.mapVisit=function(e,t){let n="";t=t||"";for(let r=0,o=e.length;r<o;r++)n+=this.visit(e[r]),t&&r<o-1&&(n+=this.emit(t));return n};var CL=xL;function xL(e){wL.call(this,e)}kL()(xL,wL),xL.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},xL.prototype.comment=function(e){return this.emit("",e.position)},xL.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},xL.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},xL.prototype.container=function(e){return this.emit("@container "+e.container,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},xL.prototype.document=function(e){const t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},xL.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},xL.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},xL.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},xL.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},xL.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},xL.prototype.page=function(e){const t=e.selectors.length?e.selectors.join(", "):"";return this.emit("@page "+t,e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},xL.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},xL.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},xL.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},xL.prototype.rule=function(e){const t=e.declarations;return t.length?this.emit(e.selectors.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}"):""},xL.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};var SL=IL;function IL(e){e=e||{},wL.call(this,e),this.indentation=e.indent}kL()(IL,wL),IL.prototype.compile=function(e){return this.stylesheet(e)},IL.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},IL.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},IL.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},IL.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}")},IL.prototype.container=function(e){return this.emit("@container "+e.container,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},IL.prototype.document=function(e){const t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},IL.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},IL.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},IL.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}")},IL.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)+"}")},IL.prototype.keyframe=function(e){const t=e.declarations;return this.emit(this.indent())+this.emit(e.values.join(", "),e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(t,"\n")+this.emit(this.indent(-1)+"\n"+this.indent()+"}\n")},IL.prototype.page=function(e){const t=e.selectors.length?e.selectors.join(", ")+" ":"";return this.emit("@page "+t,e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},IL.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}")},IL.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}")},IL.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},IL.prototype.rule=function(e){const t=this.indent(),n=e.declarations;return n.length?this.emit(e.selectors.map((function(e){return t+e})).join(",\n"),e.position)+this.emit(" {\n")+this.emit(this.indent(1))+this.mapVisit(n,"\n")+this.emit(this.indent(-1))+this.emit("\n"+this.indent()+"}"):""},IL.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},IL.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};function TL(e){return 0!==e.value.indexOf("data:")&&0!==e.value.indexOf("#")&&(t=e.value,!/^\/(?!\/)/.test(t)&&!function(e){return/^(?:https?:)?\/\//.test(e)}(e.value));var t}function NL(e,t){return new URL(e,t).toString()}const PL=/^(body|html|:root).*$/;var RL=(e,t="")=>Object.values(null!=e?e:[]).map((({css:e,baseURL:n})=>{const r=[];return t&&r.push(((e,t=[])=>n=>"rule"===n.type?{...n,selectors:n.selectors.map((n=>t.includes(n.trim())||n.trim().startsWith(`${e} `)?n:n.match(PL)?n.replace(/^(body|html|:root)/,e):e+" "+n))}:n)(t)),n&&r.push((o=n,e=>{if("declaration"===e.type){const i=function(e){const t=/url\((\s*)(['"]?)(.+?)\2(\s*)\)/g;let n;const r=[];for(;null!==(n=t.exec(e));){const e={source:n[0],before:n[1],quote:n[2],value:n[3],after:n[4]};TL(e)&&r.push(e)}return r}(e.value).map((r=o,e=>({...e,newUrl:"url("+e.before+e.quote+NL(e.value,r)+e.quote+e.after+")"})));return{...e,value:(t=e.value,n=i,n.forEach((e=>{t=t.replace(e.source,e.newUrl)})),t)}}var t,n,r;return e})),r.length?function(e,t){try{const n=bL(e);return function(e,t){return((t=t||{}).compress?new CL(t):new SL(t)).compile(e)}(fL().map(n,(function(e){if(!e)return e;const n=t(e);return this.update(n)})))}catch(e){return console.warn("Error while traversing the CSS: "+e),null}}(e,(0,D.Z)(r)):e;var o}));function AL(e,t){return(0,x.useCallback)((e=>{if(!e)return;const{ownerDocument:n}=e,{defaultView:r,body:o}=n,i=t?n.querySelector(t):o;let a;if(i)a=r?.getComputedStyle(i,null).getPropertyValue("background-color");else{const e=n.createElement("div");e.classList.add("editor-styles-wrapper"),o.appendChild(e),a=r?.getComputedStyle(e,null).getPropertyValue("background-color"),o.removeChild(e)}const s=(0,Dl.Vi)(a);s.luminance()>.5||0===s.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e,t])}function BL({styles:e,scope:t}){const n=(0,yl.Z)((e=>Jy(e(e_)).getStyleOverrides()),[]),[r,o]=(0,x.useMemo)((()=>{const r=Object.values(null!=e?e:[]);for(const[e,t]of n){const n=r.findIndex((({id:t})=>e===t)),o={...t,id:e};-1===n?r.push(o):r[n]=o}return[RL(r.filter((e=>e?.css)),t),r.filter((e=>"svgs"===e.__unstableType)).map((e=>e.assets)).join("")]}),[e,n,t]);return(0,x.createElement)(x.Fragment,null,(0,x.createElement)("style",{ref:AL(r,t)}),r.map(((e,t)=>(0,x.createElement)("style",{key:t},e))),(0,x.createElement)(F_.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 0 0",width:"0",height:"0",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"},dangerouslySetInnerHTML:{__html:o}}))}let LL;(0,Dl.l7)([Ol.Z,Zl]);const ML=2e3;function DL({viewportWidth:e,containerWidth:t,minHeight:n,additionalStyles:r=[]}){e||(e=t);const[o,{height:i}]=OB(),{styles:a}=(0,yl.Z)((e=>({styles:e(e_).getSettings().styles})),[]),s=(0,x.useMemo)((()=>a?[...a,{css:"body{height:auto;overflow:hidden;border:none;padding:0;}",__unstableType:"presets"},...r]:a),[a,r]);LL=LL||(0,uT.Z)(fF);const l=t/e,c=i?t/(i*l):0;return(0,x.createElement)(HB,{className:"block-editor-block-preview__content",style:{transform:`scale(${l})`,aspectRatio:c,maxHeight:i>ML?ML*l:void 0,minHeight:n}},(0,x.createElement)(hL,{contentRef:If((e=>{const{ownerDocument:{documentElement:t}}=e;t.classList.add("block-editor-block-preview__content-iframe"),t.style.position="absolute",t.style.width="100%",e.style.boxSizing="border-box",e.style.position="absolute",e.style.width="100%"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:e,height:i,pointerEvents:"none",maxHeight:ML,minHeight:0!==l&&l<1&&n?n/l:n}},(0,x.createElement)(BL,{styles:s}),o,(0,x.createElement)(LL,{renderAppender:!1})))}function OL(e){const[t,{width:n}]=OB();return(0,x.createElement)(x.Fragment,null,(0,x.createElement)("div",{style:{position:"relative",width:"100%",height:0}},t),(0,x.createElement)("div",{className:"block-editor-block-preview__container"},!!n&&(0,x.createElement)(DL,{...e,containerWidth:n})))}var FL=(0,x.memo)((function({blocks:e,viewportWidth:t=1200,minHeight:n,additionalStyles:r=[],__experimentalMinHeight:o,__experimentalPadding:i}){o&&(n=o,(0,q.Z)("The __experimentalMinHeight prop",{since:"6.2",version:"6.4",alternative:"minHeight"})),i&&(r=[...r,{css:`body { padding: ${i}px; }`}],(0,q.Z)("The __experimentalPadding prop of BlockPreview",{since:"6.2",version:"6.4",alternative:"additionalStyles"}));const a=(0,yl.Z)((e=>e(e_).getSettings()),[]),s=(0,x.useMemo)((()=>({...a,__unstableIsPreviewMode:!0})),[a]),l=(0,x.useMemo)((()=>Array.isArray(e)?e:[e]),[e]);return e&&0!==e.length?(0,x.createElement)(LB,{value:l,settings:s},(0,x.createElement)(OL,{viewportWidth:t,minHeight:n,additionalStyles:r})):null})),jL=function({item:e}){var t;const{name:n,title:r,icon:o,description:i,initialAttributes:a,example:s}=e,l=dc(e),c=(0,x.useMemo)((()=>s?Sc(n,{attributes:{...s.attributes,...a},innerBlocks:s.innerBlocks}):fc(n,a)),[n,s,a]);return(0,x.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,x.createElement)("div",{className:"block-editor-inserter__preview"},l||s?(0,x.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,x.createElement)(FL,{blocks:c,viewportWidth:null!==(t=s?.viewportWidth)&&void 0!==t?t:500,additionalStyles:[{css:"body { padding: 16px; }"}]})):(0,x.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,$.__)("No Preview Available."))),!l&&(0,x.createElement)(CB,{title:r,icon:o,description:i}))},ZL=n(79042),zL=function(e,t={step:1}){const{step:n=1}=t,[r,o]=(0,x.useState)([]);return(0,x.useEffect)((()=>{let t=function(e,t){const n=[];for(let r=0;r<e.length;r++){const o=e[r];if(!t.includes(o))break;n.push(o)}return n}(e,r);t.length<n&&(t=t.concat(e.slice(t.length,n))),o(t);const i=(0,ZL.j)();for(let r=t.length;r<e.length;r+=n)i.add({},(()=>{(0,eT.flushSync)((()=>{o((t=>[...t,...e.slice(r,r+n)]))}))}));return()=>i.reset()}),[e]),r},VL=n(38551),HL=(0,Z_.Iq)((function(e,t){const n=(0,VL.Z)(e);return(0,x.createElement)(Iw.Z,{as:"span",...n,ref:t})}),"Truncate"),UL=n(1175),$L=n(83453),WL=(0,x.createContext)(),GL=(0,x.forwardRef)((function({isFirst:e,as:t,children:n,...r},o){const i=(0,x.useContext)(WL);return(0,x.createElement)($L.A,{ref:o,state:i,role:"option",focusable:!0,...r},(r=>{const o={...r,tabIndex:e?0:r.tabIndex};return t?(0,x.createElement)(t,{...o},n):"function"==typeof n?n(o):(0,x.createElement)(Gh.ZP,{...o},n)}))})),qL=n(6862);const KL="is-dragging-components-draggable";var YL=function({children:e,onDragStart:t,onDragOver:n,onDragEnd:r,appendToOwnerDocument:o=!1,cloneClassname:i,elementId:a,transferData:s,__experimentalTransferDataType:l="text",__experimentalDragComponent:c}){const u=(0,x.useRef)(null),d=(0,x.useRef)((()=>{}));return(0,x.useEffect)((()=>()=>{d.current()}),[]),(0,x.createElement)(x.Fragment,null,e({onDraggableStart:function(e){const{ownerDocument:r}=e.target;e.dataTransfer.setData(l,JSON.stringify(s));const c=r.createElement("div");c.style.top="0",c.style.left="0";const p=r.createElement("div");"function"==typeof e.dataTransfer.setDragImage&&(p.classList.add("components-draggable__invisible-drag-image"),r.body.appendChild(p),e.dataTransfer.setDragImage(p,0,0)),c.classList.add("components-draggable__clone"),i&&c.classList.add(i);let h=0,m=0;if(u.current){h=e.clientX,m=e.clientY,c.style.transform=`translate( ${h}px, ${m}px )`;const t=r.createElement("div");t.innerHTML=u.current.innerHTML,c.appendChild(t),r.body.appendChild(c)}else{const e=r.getElementById(a),t=e.getBoundingClientRect(),n=e.parentNode,i=t.top,s=t.left;c.style.width=`${t.width+0}px`;const l=e.cloneNode(!0);l.id=`clone-${a}`,h=s-0,m=i-0,c.style.transform=`translate( ${h}px, ${m}px )`,Array.from(l.querySelectorAll("iframe")).forEach((e=>e.parentNode?.removeChild(e))),c.appendChild(l),o?r.body.appendChild(c):n?.appendChild(c)}let f=e.clientX,g=e.clientY;const b=(0,qL.P)((function(e){if(f===e.clientX&&g===e.clientY)return;const t=h+e.clientX-f,r=m+e.clientY-g;c.style.transform=`translate( ${t}px, ${r}px )`,f=e.clientX,g=e.clientY,h=t,m=r,n&&n(e)}),16);r.addEventListener("dragover",b),r.body.classList.add(KL),t&&t(e),d.current=()=>{c&&c.parentNode&&c.parentNode.removeChild(c),p&&p.parentNode&&p.parentNode.removeChild(p),r.body.classList.remove(KL),r.removeEventListener("dragover",b)}},onDraggableEnd:function(e){e.preventDefault(),d.current(),r&&r(e)}}),c&&(0,x.createElement)("div",{className:"components-draggable-drag-component-root",style:{display:"none"},ref:u},c))},XL=n(98576);function JL({count:e,icon:t,isPattern:n}){const r=n&&(0,$.__)("Pattern");return(0,x.createElement)("div",{className:"block-editor-block-draggable-chip-wrapper"},(0,x.createElement)("div",{className:"block-editor-block-draggable-chip","data-testid":"block-draggable-chip"},(0,x.createElement)(ew.Z,{justify:"center",className:"block-editor-block-draggable-chip__content"},(0,x.createElement)(tw.Z,null,t?(0,x.createElement)(EB,{icon:t}):r||(0,$.sprintf)((0,$._n)("%d block","%d blocks",e),e)),(0,x.createElement)(tw.Z,null,(0,x.createElement)(EB,{icon:XL.Z})))))}var QL=({isEnabled:e,blocks:t,icon:n,children:r,isPattern:o})=>{const i={type:"inserter",blocks:t},a=(0,yl.Z)((e=>{const{getBlockType:n}=e(Vu);return 1===t.length&&n(t[0].name)?.icon}),[t]);return(0,x.createElement)(YL,{__experimentalTransferDataType:"wp-blocks",transferData:i,onDragStart:e=>{e.dataTransfer.setData("text/html",Dd(t))},__experimentalDragComponent:(0,x.createElement)(JL,{count:t.length,icon:n||!o&&a,isPattern:o})},(({onDraggableStart:t,onDraggableEnd:n})=>r({draggable:e,onDragStart:e?t:void 0,onDragEnd:e?n:void 0})))},eM=(0,x.memo)((function({className:e,isFirst:t,item:n,onSelect:r,onHover:o,isDraggable:i,...a}){const s=(0,x.useRef)(!1),l=n.icon?{backgroundColor:n.icon.background,color:n.icon.foreground}:{},c=(0,x.useMemo)((()=>[fc(n.name,n.initialAttributes,gc(n.innerBlocks))]),[n.name,n.initialAttributes,n.initialAttributes]),u=dc(n)&&"unsynced"!==n.syncStatus||pc(n);return(0,x.createElement)(QL,{isEnabled:i&&!n.disabled,blocks:c,icon:n.icon},(({draggable:i,onDragStart:c,onDragEnd:d})=>(0,x.createElement)("div",{className:R()("block-editor-block-types-list__list-item",{"is-synced":u}),draggable:i,onDragStart:e=>{s.current=!0,c&&(o(null),c(e))},onDragEnd:e=>{s.current=!1,d&&d(e)}},(0,x.createElement)(GL,{isFirst:t,className:R()("block-editor-block-types-list__item",e),disabled:n.isDisabled,onClick:e=>{e.preventDefault(),r(n,(0,UL.R)()?e.metaKey:e.ctrlKey),o(null)},onKeyDown:e=>{const{keyCode:t}=e;t===Hf.K5&&(e.preventDefault(),r(n,(0,UL.R)()?e.metaKey:e.ctrlKey),o(null))},onMouseEnter:()=>{s.current||o(n)},onMouseLeave:()=>o(null),...a},(0,x.createElement)("span",{className:"block-editor-block-types-list__item-icon",style:l},(0,x.createElement)(EB,{icon:n.icon,showColors:!0})),(0,x.createElement)("span",{className:"block-editor-block-types-list__item-title"},(0,x.createElement)(HL,{numberOfLines:3},n.title))))))})),tM=(0,x.forwardRef)((function(e,t){const[n,r]=(0,x.useState)(!1);return(0,x.useEffect)((()=>{n&&(0,wf.D)((0,$.__)("Use left and right arrow keys to move through blocks"))}),[n]),(0,x.createElement)("div",{ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{r(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&r(!1)},...e})})),nM=n(19386),rM=(0,x.forwardRef)((function(e,t){const n=(0,x.useContext)(WL);return(0,x.createElement)(nM.E,{state:n,role:"presentation",ref:t,...e})})),oM=function({items:e=[],onSelect:t,onHover:n=(()=>{}),children:r,label:o,isDraggable:i=!0}){return(0,x.createElement)(tM,{className:"block-editor-block-types-list","aria-label":o},function(e,t){const n=[];for(let t=0,r=e.length;t<r;t+=3)n.push(e.slice(t,t+3));return n}(e).map(((e,r)=>(0,x.createElement)(rM,{key:r},e.map(((e,o)=>(0,x.createElement)(eM,{key:e.id,item:e,className:Td(e.id),onSelect:t,onHover:n,isDraggable:i&&!e.isDisabled,isFirst:0===r&&0===o})))))),r)},iM=function({title:e,icon:t,children:n}){return(0,x.createElement)(x.Fragment,null,(0,x.createElement)("div",{className:"block-editor-inserter__panel-header"},(0,x.createElement)("h2",{className:"block-editor-inserter__panel-title"},e),(0,x.createElement)(V_.Z,{icon:t})),(0,x.createElement)("div",{className:"block-editor-inserter__panel-content"},n))},aM=(e,t)=>{const{categories:n,collections:r,items:o}=(0,yl.Z)((t=>{const{getInserterItems:n}=t(e_),{getCategories:r,getCollections:o}=t(Vu);return{categories:r(),collections:o(),items:n(e)}}),[e]),i=(0,x.useCallback)((({name:e,initialAttributes:n,innerBlocks:r,syncStatus:o,content:i},a)=>{const s="unsynced"===o?Lp(i,{__unstableSkipMigrationLogs:!0}):fc(e,n,gc(r));t(s,void 0,a)}),[t]);return[o,n,r,i]},sM=n(77996),lM=function({children:e}){const t=(0,sM.u)({shift:!0,wrap:"horizontal"});return(0,x.createElement)(WL.Provider,{value:t},e)};const cM=[];var uM=function({rootClientId:e,onInsert:t,onHover:n,showMostUsedBlocks:r}){const[o,i,a,s]=aM(e,t),l=(0,x.useMemo)((()=>Jf(o,"frecency","desc").slice(0,6)),[o]),c=(0,x.useMemo)((()=>o.filter((e=>!e.category))),[o]),u=(0,x.useMemo)((()=>(0,Wc.Z)((e=>e.filter((e=>e.category&&"reusable"!==e.category))),(e=>e.reduce(((e,t)=>{const{category:n}=t;return e[n]||(e[n]=[]),e[n].push(t),e}),{})))(o)),[o]),d=(0,x.useMemo)((()=>{const e={...a};return Object.keys(a).forEach((t=>{e[t]=o.filter((e=>(e=>e.name.split("/")[0])(e)===t)),0===e[t].length&&delete e[t]})),e}),[o,a]);(0,x.useEffect)((()=>()=>n(null)),[]);const p=zL(i),h=i.length===p.length,m=(0,x.useMemo)((()=>Object.entries(a)),[a]),f=zL(h?m:cM);return(0,x.createElement)(lM,null,(0,x.createElement)("div",null,r&&!!l.length&&(0,x.createElement)(iM,{title:(0,$._x)("Most used","blocks")},(0,x.createElement)(oM,{items:l,onSelect:s,onHover:n,label:(0,$._x)("Most used","blocks")})),p.map((e=>{const t=u[e.slug];return t&&t.length?(0,x.createElement)(iM,{key:e.slug,title:e.title,icon:e.icon},(0,x.createElement)(oM,{items:t,onSelect:s,onHover:n,label:e.title})):null})),h&&c.length>0&&(0,x.createElement)(iM,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,$.__)("Uncategorized")},(0,x.createElement)(oM,{items:c,onSelect:s,onHover:n,label:(0,$.__)("Uncategorized")})),f.map((([e,t])=>{const r=d[e];return r&&r.length?(0,x.createElement)(iM,{key:e,title:t.title,icon:t.icon},(0,x.createElement)(oM,{items:r,onSelect:s,onHover:n,label:t.title})):null}))))},dM=n(60237),pM=n(12747),hM=n(24129);const mM={name:"1bcj5ek",styles:"width:100%;display:block"},fM={name:"150ruhm",styles:"box-sizing:border-box;width:100%;display:block;margin:0;color:inherit"},gM=(0,b_.css)("border:1px solid ",T_.Z.surfaceBorderColor,";",""),bM=(0,b_.css)(">*:not( marquee )>*{border-bottom:1px solid ",T_.Z.surfaceBorderColor,";}>*:last-of-type>*:not( :focus ){border-bottom-color:transparent;}",""),vM=T_.Z.controlBorderRadius,yM=(0,b_.css)("border-radius:",vM,";",""),_M=(0,b_.css)("border-radius:",vM,";>*:first-of-type>*{border-top-left-radius:",vM,";border-top-right-radius:",vM,";}>*:last-of-type>*{border-bottom-left-radius:",vM,";border-bottom-right-radius:",vM,";}",""),kM=`calc(${T_.Z.fontSize} * ${T_.Z.fontLineHeightBase})`,wM=`calc((${T_.Z.controlHeight} - ${kM} - 2px) / 2)`,EM=`calc((${T_.Z.controlHeightSmall} - ${kM} - 2px) / 2)`,CM=`calc((${T_.Z.controlHeightLarge} - ${kM} - 2px) / 2)`,xM={small:(0,b_.css)("padding:",EM," ",T_.Z.controlPaddingXSmall,";",""),medium:(0,b_.css)("padding:",wM," ",T_.Z.controlPaddingX,";",""),large:(0,b_.css)("padding:",CM," ",T_.Z.controlPaddingXLarge,";","")},SM=(0,x.createContext)({size:"medium"}),IM=()=>(0,x.useContext)(SM);var TM=(0,Z_.Iq)((function(e,t){const{isBordered:n,isSeparated:r,size:o,...i}=function(e){const{className:t,isBordered:n=!1,isRounded:r=!0,isSeparated:o=!1,role:i="list",...a}=(0,j_.y)(e,"ItemGroup");return{isBordered:n,className:(0,Ak.I)()(n&&gM,o&&bM,r&&_M,t),role:i,isSeparated:o,...a}}(e),{size:a}=IM(),s={spacedAround:!n&&!r,size:o||a};return(0,x.createElement)(SM.Provider,{value:s},(0,x.createElement)(Iw.Z,{...i,ref:t}))}),"ItemGroup"),NM=(0,Z_.Iq)((function(e,t){const{role:n,wrapperClassName:r,...o}=function(e){const{as:t,className:n,onClick:r,role:o="listitem",size:i,...a}=(0,j_.y)(e,"Item"),{spacedAround:s,size:l}=IM(),c=i||l,u=t||(void 0!==r?"button":"div"),d=(0,Ak.I)(),p=(0,x.useMemo)((()=>d(("button"===u||"a"===u)&&(e=>(0,b_.css)("font-size:",(0,U_.L)("default.fontSize"),";font-family:inherit;appearance:none;border:1px solid transparent;cursor:pointer;background:none;text-align:start;text-decoration:","a"===e?"none":void 0,";svg,path{fill:currentColor;}&:hover{color:",N_.D.theme.accent,";}&:focus{box-shadow:none;outline:none;}&:focus-visible{box-shadow:0 0 0 var( --wp-admin-border-width-focus ) var(\n\t\t\t\t\t--wp-components-color-accent,\n\t\t\t\t\tvar( --wp-admin-theme-color, ",N_.D.theme.accent," )\n\t\t\t\t);outline:2px solid transparent;outline-offset:0;}",""))(u),xM[c]||xM.medium,fM,s&&yM,n)),[u,n,d,c,s]),h=d(mM);return{as:u,className:p,onClick:r,wrapperClassName:h,role:o,...a}}(e);return(0,x.createElement)("div",{role:n,className:r},(0,x.createElement)(Iw.Z,{...o,ref:t}))}),"Item"),PM=n(30550),RM=(e,t)=>{const{patternCategories:n,patterns:r,userPatternCategories:o}=(0,yl.Z)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:r}=e(e_),{__experimentalUserPatternCategories:o,__experimentalBlockPatternCategories:i}=r();return{patterns:n(t),userPatternCategories:o,patternCategories:i}}),[t]),i=(0,x.useMemo)((()=>{const e=[...n];return o?.forEach((t=>{e.find((e=>e.name===t.name))||e.push(t)})),e}),[n,o]),{createSuccessNotice:a}=(0,_l.Z)(PM.store),s=(0,x.useCallback)(((t,n)=>{const r=t.id&&"unsynced"!==t.syncStatus?[fc("core/block",{ref:t.id})]:n;e((null!=r?r:[]).map((e=>vc(e))),t.name),a((0,$.sprintf)((0,$.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar",id:"block-pattern-inserted-notice"})}),[a,e]);return[r,i,s]},AM=n(60369);function BM({currentPage:e,numPages:t,changePage:n,totalItems:r}){return(0,x.createElement)(dM.Z,{className:"block-editor-patterns__grid-pagination-wrapper"},(0,x.createElement)(hM.Z,{variant:"muted"},(0,$.sprintf)((0,$._n)("%s item","%s items",r),r)),t>1&&(0,x.createElement)(wI.Z,{expanded:!1,spacing:3,justify:"flex-start",className:"block-editor-patterns__grid-pagination"},(0,x.createElement)(wI.Z,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-previous"},(0,x.createElement)(Gh.ZP,{variant:"tertiary",onClick:()=>n(1),disabled:1===e,"aria-label":(0,$.__)("First page")},(0,x.createElement)("span",null,"«")),(0,x.createElement)(Gh.ZP,{variant:"tertiary",onClick:()=>n(e-1),disabled:1===e,"aria-label":(0,$.__)("Previous page")},(0,x.createElement)("span",null,"‹"))),(0,x.createElement)(hM.Z,{variant:"muted"},(0,$.sprintf)((0,$._x)("%1$s of %2$s","paging"),e,t)),(0,x.createElement)(wI.Z,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-next"},(0,x.createElement)(Gh.ZP,{variant:"tertiary",onClick:()=>n(e+1),disabled:e===t,"aria-label":(0,$.__)("Next page")},(0,x.createElement)("span",null,"›")),(0,x.createElement)(Gh.ZP,{variant:"tertiary",onClick:()=>n(t),disabled:e===t,"aria-label":(0,$.__)("Last page"),size:"default"},(0,x.createElement)("span",null,"»")))))}const LM=({showTooltip:e,title:t,children:n})=>e?(0,x.createElement)(Xw.Z,{text:t},n):(0,x.createElement)(x.Fragment,null,n);function MM({isDraggable:e,pattern:t,onClick:n,onHover:r,composite:o,showTooltip:i}){const[a,s]=(0,x.useState)(!1),{blocks:l,viewportWidth:c}=t,u=`block-editor-block-patterns-list__item-description-${(0,tT.Z)(MM)}`;return(0,x.createElement)(QL,{isEnabled:e,blocks:l,isPattern:!!t},(({draggable:e,onDragStart:d,onDragEnd:p})=>(0,x.createElement)("div",{className:"block-editor-block-patterns-list__list-item",draggable:e,onDragStart:e=>{s(!0),d&&(r?.(null),d(e))},onDragEnd:e=>{s(!1),p&&p(e)}},(0,x.createElement)(LM,{showTooltip:i&&"user"===!t.type,title:t.title},(0,x.createElement)($L.A,{role:"option",as:"div",...o,className:R()("block-editor-block-patterns-list__item",{"block-editor-block-patterns-list__list-item-synced":"user"===t.type&&!t.syncStatus}),onClick:()=>{n(t,l),r?.(null)},onMouseEnter:()=>{a||r?.(t)},onMouseLeave:()=>r?.(null),"aria-label":t.title,"aria-describedby":t.description?u:void 0},(0,x.createElement)(FL,{blocks:l,viewportWidth:c}),(0,x.createElement)(wI.Z,{className:"block-editor-patterns__pattern-details"},"user"===t.type&&!t.syncStatus&&(0,x.createElement)("div",{className:"block-editor-patterns__pattern-icon-wrapper"},(0,x.createElement)(ox.Z,{className:"block-editor-patterns__pattern-icon",icon:Em.Z})),(!i||"user"===t.type)&&(0,x.createElement)("div",{className:"block-editor-block-patterns-list__item-title"},t.title)),!!t.description&&(0,x.createElement)(h_.Z,{id:u},t.description))))))}function DM(){return(0,x.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}var OM=(0,x.forwardRef)((function({isDraggable:e,blockPatterns:t,shownPatterns:n,onHover:r,onClickPattern:o,orientation:i,label:a=(0,$.__)("Block patterns"),showTitlesAsTooltip:s,pagingProps:l},c){const u=(0,sM.u)({orientation:i});return(0,x.createElement)(AM.b,{...u,role:"listbox",className:"block-editor-block-patterns-list","aria-label":a,ref:c},t.map((t=>n.includes(t)?(0,x.createElement)(MM,{key:t.name,pattern:t,onClick:o,onHover:r,isDraggable:e,composite:u,showTooltip:s}):(0,x.createElement)(DM,{key:t.name}))),l&&(0,x.createElement)(BM,{...l}))}));function FM({selectedCategory:e,patternCategories:t,onClickCategory:n}){const r="block-editor-block-patterns-explorer__sidebar";return(0,x.createElement)("div",{className:`${r}__categories-list`},t.map((({name:t,label:o})=>(0,x.createElement)(Gh.ZP,{key:t,label:o,className:`${r}__categories-list__item`,isPressed:e===t,onClick:()=>{n(t)}},o))))}function jM({searchValue:e,setSearchValue:t}){return(0,x.createElement)("div",{className:"block-editor-block-patterns-explorer__search"},(0,x.createElement)(mB.Z,{__nextHasNoMarginBottom:!0,onChange:t,value:e,label:(0,$.__)("Search for patterns"),placeholder:(0,$.__)("Search")}))}var ZM=function({selectedCategory:e,patternCategories:t,onClickCategory:n,searchValue:r,setSearchValue:o}){return(0,x.createElement)("div",{className:"block-editor-block-patterns-explorer__sidebar"},(0,x.createElement)(jM,{searchValue:r,setSearchValue:o}),!r&&(0,x.createElement)(FM,{selectedCategory:e,patternCategories:t,onClickCategory:n}))},zM=function({rootClientId:e="",insertionIndex:t,clientId:n,isAppender:r,onSelect:o,shouldFocusBlock:i=!0,selectBlockOnInsert:a=!0}){const{getSelectedBlock:s}=(0,yl.Z)(e_),{destinationRootClientId:l,destinationIndex:c}=(0,yl.Z)((o=>{const{getSelectedBlockClientId:i,getBlockRootClientId:a,getBlockIndex:s,getBlockOrder:l}=o(e_),c=i();let u,d=e;return void 0!==t?u=t:n?u=s(n):!r&&c?(d=a(c),u=s(c)+1):u=l(d).length,{destinationRootClientId:d,destinationIndex:u}}),[e,t,n,r]),{replaceBlocks:u,insertBlocks:d,showInsertionPoint:p,hideInsertionPoint:h}=(0,_l.Z)(e_),m=(0,x.useCallback)(((e,t,n=!1)=>{const p=s();!r&&p&&Nc(p)?u(p.clientId,e,null,i||n?0:null,t):d(e,c,l,a,i||n?0:null,t);const h=Array.isArray(e)?e.length:1,m=(0,$.sprintf)((0,$._n)("%d block added.","%d blocks added.",h),h);(0,wf.D)(m),o&&o(e)}),[r,s,u,d,l,c,o,i,a]),f=(0,x.useCallback)((e=>{e?p(l,c):h()}),[p,h,l,c]);return[l,m,f]},VM=n(37066);const HM=e=>e.name||"",UM=e=>e.title,$M=e=>e.description||"",WM=e=>e.keywords||[],GM=e=>e.category,qM=()=>null;function KM(e=""){return(0,VM.B)(e,{splitRegexp:[/([\p{Ll}\p{Lo}\p{N}])([\p{Lu}\p{Lt}])/gu,/([\p{Lu}\p{Lt}])([\p{Lu}\p{Lt}][\p{Ll}\p{Lo}])/gu],stripRegexp:/(\p{C}|\p{P}|\p{S})+/giu}).split(" ").filter(Boolean)}function YM(e=""){return(e=(e=$c()(e)).replace(/^\//,"")).toLowerCase()}const XM=(e="")=>KM(YM(e)),JM=(e,t,n,r)=>{if(0===XM(r).length)return e;const o={getCategory:e=>t.find((({slug:t})=>t===e.category))?.title,getCollection:e=>n[e.name.split("/")[0]]?.title};return QM(e,r,o)},QM=(e=[],t="",n={})=>{if(0===XM(t).length)return e;const r=e.map((e=>[e,eD(e,t,n)])).filter((([,e])=>e>0));return r.sort((([,e],[,t])=>t-e)),r.map((([e])=>e))};function eD(e,t,n={}){const{getName:r=HM,getTitle:o=UM,getDescription:i=$M,getKeywords:a=WM,getCategory:s=GM,getCollection:l=qM}=n,c=r(e),u=o(e),d=i(e),p=a(e),h=s(e),m=l(e),f=YM(t),g=YM(u);let b=0;if(f===g)b+=30;else if(g.startsWith(f))b+=20;else{const e=[c,u,d,...p,h,m].join(" ");0===(v=KM(f),y=e,v.filter((e=>!XM(y).some((t=>t.includes(e)))))).length&&(b+=10)}var v,y;return 0!==b&&c.startsWith("core/")&&(b+=c!==e.id?1:2),b}function tD(e){const t=(0,x.useRef)();return(0,x.useEffect)((()=>{t.current=e}),[e]),t.current}const nD=20,rD=5;function oD(e,t,n,r=""){const[o,i]=(0,x.useState)(1),a=tD(t),s=tD(r);a===t&&s===r||1===o||i(1);const l=e.length,c=o-1,u=(0,x.useMemo)((()=>e.slice(c*nD,c*nD+nD)),[c,e]),d=zL(u,{step:rD}),p=Math.ceil(e.length/nD);return(0,x.useEffect)((function(){const e=hA(n?.current);e?.scrollTo(0,0)}),[t,n]),{totalItems:l,categoryPatterns:u,categoryPatternsAsyncList:d,numPages:p,changePage:e=>{const t=hA(n?.current);t?.scrollTo(0,0),i(e)},currentPage:o}}function iD({filterValue:e,filteredBlockPatternsLength:t}){return e?(0,x.createElement)(EI.Z,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count"},(0,$.sprintf)((0,$._n)("%d pattern found","%d patterns found",t),t)):null}var aD=function({searchValue:e,selectedCategory:t,patternCategories:n}){const r=(0,x.useRef)(),o=(0,oT.Z)(wf.D,500),[i,a]=zM({shouldFocusBlock:!0}),[s,,l]=RM(a,i),c=(0,x.useMemo)((()=>n.map((e=>e.name))),[n]),u=(0,x.useMemo)((()=>{const n=s.filter((e=>{if(t===DD.name)return!0;if(t===OD.name&&e.id)return!0;if("uncategorized"===t){const t=e.categories.some((e=>c.includes(e)));return!e.categories?.length||!t}return e.categories?.includes(t)}));return e?QM(n,e):n}),[e,s,t,c]);(0,x.useEffect)((()=>{if(!e)return;const t=u.length,n=(0,$.sprintf)((0,$._n)("%d result found.","%d results found.",t),t);o(n)}),[e,o,u.length]);const d=oD(u,t,r),[p,h]=(0,x.useState)(e);e!==p&&(h(e),d.changePage(1));const m=!!u?.length;return(0,x.createElement)("div",{className:"block-editor-block-patterns-explorer__list",ref:r},(0,x.createElement)(iD,{filterValue:e,filteredBlockPatternsLength:u.length}),(0,x.createElement)(lM,null,m&&(0,x.createElement)(x.Fragment,null,(0,x.createElement)(OM,{shownPatterns:d.categoryPatternsAsyncList,blockPatterns:d.categoryPatterns,onClickPattern:l,isDraggable:!1}),(0,x.createElement)(BM,{...d}))))};function sD({initialCategory:e,rootClientId:t}){const[n,r]=(0,x.useState)(""),[o,i]=(0,x.useState)("all"),[a,s]=(0,x.useState)(e?.name),l=jD(t,o);return(0,x.createElement)("div",{className:"block-editor-block-patterns-explorer"},(0,x.createElement)(ZM,{selectedCategory:a,patternCategories:l,onClickCategory:s,searchValue:n,setSearchValue:r,patternSourceFilter:o,setPatternSourceFilter:i}),(0,x.createElement)(aD,{searchValue:n,selectedCategory:a,patternCategories:l,patternSourceFilter:o}))}var lD=function({onModalClose:e,...t}){return(0,x.createElement)(yT.Z,{title:(0,$.__)("Patterns"),onRequestClose:e,isFullScreen:!0},(0,x.createElement)(sD,{...t}))},cD=n(86881);const uD=(0,x.createContext)({location:{},goTo:()=>{},goBack:()=>{},goToParent:()=>{},addScreen:()=>{},removeScreen:()=>{},params:{}});var dD=function(){const{location:e,params:t,goTo:n,goBack:r,goToParent:o}=(0,x.useContext)(uD);return{location:e,goTo:n,goBack:r,goToParent:o,params:t}},pD=(0,Z_.Iq)((function(e,t){const n=function(e){const{onClick:t,as:n=Gh.ZP,goToParent:r=!1,...o}=(0,j_.y)(e,"NavigatorBackButton"),{goBack:i,goToParent:a}=dD();return{as:n,onClick:(0,x.useCallback)((e=>{e.preventDefault(),r?a():i(),t?.(e)}),[r,a,i,t]),...o}}(e);return(0,x.createElement)(Iw.Z,{ref:t,...n})}),"NavigatorBackButton"),hD=n(95997);function mD(e,t){return(0,hD.match)(t,{decode:decodeURIComponent})(e)}function fD(e=[],t){switch(t.type){case"add":return[...e,t.screen];case"remove":return e.filter((e=>e.id!==t.screen.id))}return e}var gD={name:"15bx5k",styles:"overflow-x:hidden"};const bD=(0,Z_.Iq)((function(e,t){const{initialPath:n,children:r,className:o,...i}=(0,j_.y)(e,"NavigatorProvider"),[a,s]=(0,x.useState)([{path:n}]),l=(0,x.useRef)([]),[c,u]=(0,x.useReducer)(fD,[]),d=(0,x.useRef)([]);(0,x.useEffect)((()=>{d.current=c}),[c]),(0,x.useEffect)((()=>{l.current=a}),[a]);const p=(0,x.useRef)(),h=(0,x.useMemo)((()=>{let e;if(0===a.length||void 0===(e=a[a.length-1].path))return void(p.current=void 0);const t=(e=>{const t=function(e,t){for(const n of t){const t=mD(e,n.path);if(t)return{params:t.params,id:n.id}}}(e,c);return p.current&&t&&(0,O.default)(t.params,p.current.params)&&t.id===p.current.id?p.current:t})(e);return p.current=t,t}),[c,a]),m=(0,x.useCallback)((e=>u({type:"add",screen:e})),[]),f=(0,x.useCallback)((e=>u({type:"remove",screen:e})),[]),g=(0,x.useCallback)((()=>{s((e=>e.length<=1?e:[...e.slice(0,-2),{...e[e.length-2],isBack:!0,hasRestoredFocus:!1}]))}),[]),b=(0,x.useCallback)(((e,t={})=>{const{focusTargetSelector:n,isBack:r=!1,skipFocus:o=!1,replace:i=!1,...a}=t;r&&l.current.length>1&&l.current[l.current.length-2].path===e?g():s((t=>{const s={...a,path:e,isBack:r,hasRestoredFocus:!1,skipFocus:o};if(0===t.length)return i?[]:[s];const l=t.slice(t.length>49?1:0,-1);return i||l.push({...t[t.length-1],focusTargetSelector:n}),l.push(s),l}))}),[g]),v=(0,x.useCallback)(((e={})=>{const t=l.current[l.current.length-1].path;if(void 0===t)return;const n=function(e,t){if(!e.startsWith("/"))return;const n=e.split("/");let r;for(;n.length>1&&void 0===r;){n.pop();const e=""===n.join("/")?"/":n.join("/");t.find((t=>!1!==mD(e,t.path)))&&(r=e)}return r}(t,d.current);void 0!==n&&b(n,{...e,isBack:!0})}),[b]),y=(0,x.useMemo)((()=>({location:{...a[a.length-1],isInitial:1===a.length},params:h?h.params:{},match:h?h.id:void 0,goTo:b,goBack:g,goToParent:v,addScreen:m,removeScreen:f})),[a,h,b,g,v,m,f]),_=(0,Ak.I)(),k=(0,x.useMemo)((()=>_(gD,o)),[o,_]);return(0,x.createElement)(Iw.Z,{ref:t,className:k,...i},(0,x.createElement)(uD.Provider,{value:y},r))}),"NavigatorProvider");var vD=bD,yD=n(87407),_D=n(92987),kD=n(56482),wD={name:"14x3t6z",styles:"overflow-x:auto;max-height:100%"};const ED=(0,Z_.Iq)((function(e,t){const n=(0,x.useId)(),{children:r,className:o,path:i,...a}=(0,j_.y)(e,"NavigatorScreen"),s=(0,_D.Z)(),{location:l,match:c,addScreen:u,removeScreen:d}=(0,x.useContext)(uD),p=c===n,h=(0,x.useRef)(null);(0,x.useEffect)((()=>{const e={id:n,path:(0,kD.escapeAttribute)(i)};return u(e),()=>d(e)}),[n,i,u,d]);const m=(0,Ak.I)(),f=(0,x.useMemo)((()=>m(wD,o)),[o,m]),g=(0,x.useRef)(l);(0,x.useEffect)((()=>{g.current=l}),[l]);const b=l.isInitial&&!l.isBack;(0,x.useEffect)((()=>{if(b||!p||!h.current||g.current.hasRestoredFocus||l.skipFocus)return;const e=h.current.ownerDocument.activeElement;if(h.current.contains(e))return;let t=null;if(l.isBack&&l?.focusTargetSelector&&(t=h.current.querySelector(l.focusTargetSelector)),!t){const e=yD.focus.tabbable.find(h.current)[0];t=null!=e?e:h.current}g.current.hasRestoredFocus=!0,t.focus()}),[b,p,l.isBack,l.focusTargetSelector,l.skipFocus]);const v=(0,Kx.Z)([t,h]);if(!p)return null;if(s)return(0,x.createElement)(Iw.Z,{ref:v,className:f,...a},r);const y=!(l.isInitial&&!l.isBack)&&{opacity:0,x:(0,d_.isRTL)()&&l.isBack||!(0,d_.isRTL)()&&!l.isBack?50:-50},_={animate:{opacity:1,transition:{delay:0,duration:.14,ease:"easeInOut"},x:0},exit:{delay:0,opacity:0,x:!(0,d_.isRTL)()&&l.isBack||(0,d_.isRTL)()&&!l.isBack?50:-50,transition:{duration:.14,ease:"easeInOut"}},initial:y};return(0,x.createElement)(zw.E.div,{ref:v,className:f,...a,..._},r)}),"NavigatorScreen");var CD=ED;var xD=(0,Z_.Iq)((function(e,t){const n=function(e){const{path:t,onClick:n,as:r=Gh.ZP,attributeName:o="id",...i}=(0,j_.y)(e,"NavigatorButton"),a=(0,kD.escapeAttribute)(t),{goTo:s}=dD();return{as:r,onClick:(0,x.useCallback)((e=>{var t,r;e.preventDefault(),s(a,{focusTargetSelector:(t=o,r=a,`[${t}="${r}"]`)}),n?.(e)}),[s,n,o,a]),...i,[o]:a}}(e);return(0,x.createElement)(Iw.Z,{ref:t,...n})}),"NavigatorButton");function SD({title:e}){return(0,x.createElement)(dM.Z,{spacing:0},(0,x.createElement)(Iw.Z,null,(0,x.createElement)(cD.Z,{marginBottom:0,paddingX:4,paddingY:3},(0,x.createElement)(wI.Z,{spacing:2},(0,x.createElement)(pD,{style:{minWidth:24,padding:0},icon:(0,$.isRTL)()?_B.Z:kB.Z,isSmall:!0,"aria-label":(0,$.__)("Navigate to the previous view")}),(0,x.createElement)(cD.Z,null,(0,x.createElement)(EI.Z,{level:5},e))))))}function ID({categories:e,children:t}){return(0,x.createElement)(vD,{initialPath:"/",className:"block-editor-inserter__mobile-tab-navigation"},(0,x.createElement)(CD,{path:"/"},(0,x.createElement)(TM,null,e.map((e=>(0,x.createElement)(xD,{key:e.name,path:`/category/${e.name}`,as:NM,isAction:!0},(0,x.createElement)(wI.Z,null,(0,x.createElement)(pM.Z,null,e.label),(0,x.createElement)(ox.Z,{icon:(0,$.isRTL)()?kB.Z:_B.Z}))))))),e.map((e=>(0,x.createElement)(CD,{key:e.name,path:`/category/${e.name}`},(0,x.createElement)(SD,{title:(0,$.__)("Back")}),t(e)))))}const TD=()=>{};var ND=function({choices:e=[],onHover:t=TD,onSelect:n,value:r}){return(0,x.createElement)(x.Fragment,null,e.map((e=>{const o=r===e.value;return(0,x.createElement)(Wk.Z,{key:e.value,role:"menuitemradio",disabled:e.disabled,icon:o?u_.Z:null,info:e.info,isSelected:o,shortcut:e.shortcut,className:"components-menu-items-choice",onClick:()=>{o||n(e.value)},onMouseEnter:()=>t(e.value),onMouseLeave:()=>t(null),"aria-label":e["aria-label"]},e.label)})))};const PD={all:"all",synced:"synced",unsynced:"unsynced",user:"user",theme:"theme",directory:"directory"},RD={all:"all",full:"fully",unsynced:"unsynced"},AD=e=>e!==PD.all&&e!==PD.user,BD=e=>e.name===OD.name;function LD({setPatternSyncFilter:e,setPatternSourceFilter:t,patternSyncFilter:n,patternSourceFilter:r,scrollContainerRef:o,category:i}){const a=i.name===OD.name?PD.user:r,s=AD(a),l=BD(i),c=(0,x.useMemo)((()=>[{value:RD.all,label:(0,$._x)("All","Option that shows all patterns")},{value:RD.full,label:(0,$._x)("Synced","Option that shows all synchronized patterns"),disabled:s},{value:RD.unsynced,label:(0,$._x)("Not synced","Option that shows all patterns that are not synchronized"),disabled:s}]),[s]),u=(0,x.useMemo)((()=>[{value:PD.all,label:(0,$.__)("All"),disabled:l},{value:PD.directory,label:(0,$.__)("Pattern Directory"),disabled:l},{value:PD.theme,label:(0,$.__)("Theme & Plugins"),disabled:l},{value:PD.user,label:(0,$.__)("User")}]),[l]);return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(em.Z,{popoverProps:{placement:"right-end"},label:"Filter patterns",icon:(0,x.createElement)(ox.Z,{icon:(0,x.createElement)(F_.Wj,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,x.createElement)(F_.y$,{d:"M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z",fill:"#1E1E1E"}))})},(()=>(0,x.createElement)(x.Fragment,null,(0,x.createElement)($k.Z,{label:(0,$.__)("Source")},(0,x.createElement)(ND,{choices:u,onSelect:n=>{var r;t(r=n),AD(r)&&e(RD.all),o.current?.scrollTo(0,0)},value:a})),(0,x.createElement)($k.Z,{label:(0,$.__)("Type")},(0,x.createElement)(ND,{choices:c,onSelect:t=>{e(t),o.current?.scrollTo(0,0)},value:n})),(0,x.createElement)("div",{className:"block-editor-tool-selector__help"},(0,fB.Z)((0,$.__)("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,x.createElement)(eI.Z,{href:(0,$.__)("https://wordpress.org/patterns/")})}))))))}const MD=()=>{},DD={name:"allPatterns",label:(0,$.__)("All patterns")},OD={name:"myPatterns",label:(0,$.__)("My patterns")};function FD(e,t,n){const r=e.name.startsWith("core/block"),o="core"===e.source||e.source?.startsWith("pattern-directory");return!(t!==PD.theme||!r&&!o)||!(t!==PD.directory||!r&&o)||t===PD.user&&!e.id||n===RD.full&&""!==e.syncStatus||!(n!==RD.unsynced||"unsynced"===e.syncStatus||!r)}function jD(e,t="all"){const[n,r]=RM(void 0,e),o=(0,x.useMemo)((()=>"all"===t?n:n.filter((e=>!FD(e,t)))),[t,n]),i=(0,x.useCallback)((e=>!(!e.categories||!e.categories.length)&&e.categories.some((e=>r.some((t=>t.name===e))))),[r]),a=(0,x.useMemo)((()=>{const e=r.filter((e=>o.some((t=>t.categories?.includes(e.name))))).sort(((e,t)=>e.label.localeCompare(t.label)));return o.some((e=>!i(e)))&&!e.find((e=>"uncategorized"===e.name))&&e.push({name:"uncategorized",label:(0,$._x)("Uncategorized")}),o.some((e=>e.id))&&e.unshift(OD),o.length>0&&e.unshift({name:DD.name,label:DD.label}),(0,wf.D)((0,$.sprintf)((0,$._n)("%d category button displayed.","%d category buttons displayed.",e.length),e.length)),e}),[r,o,i]);return a}function ZD({rootClientId:e,onInsert:t,onHover:n,category:r,showTitlesAsTooltip:o,patternFilter:i}){const a=(0,x.useRef)();return(0,x.useEffect)((()=>{const e=setTimeout((()=>{const[e]=TA.tabbable.find(a.current);e?.focus()}));return()=>clearTimeout(e)}),[r]),(0,x.createElement)("div",{ref:a,className:"block-editor-inserter__patterns-category-dialog"},(0,x.createElement)(zD,{key:r.name,rootClientId:e,onInsert:t,onHover:n,category:r,showTitlesAsTooltip:o,patternFilter:i}))}function zD({rootClientId:e,onInsert:t,onHover:n=MD,category:r,showTitlesAsTooltip:o}){const[i,,a]=RM(t,e),[s,l]=(0,x.useState)("all"),[c,u]=(0,x.useState)("all"),d=jD(e,c),p=(0,x.useRef)(),h=(0,x.useMemo)((()=>i.filter((e=>{var t;return!FD(e,c,s)&&(r.name===DD.name||(!(r.name!==OD.name||!e.id)||("uncategorized"!==r.name?e.categories?.includes(r.name):0===(null!==(t=e.categories?.filter((e=>d.find((t=>t.name===e)))))&&void 0!==t?t:[]).length)))}))),[i,d,r.name,c,s]),m=oD(h,r,p),{changePage:f}=m;(0,x.useEffect)((()=>()=>n(null)),[]);const g=(0,x.useCallback)((e=>{l(e),f(1)}),[l,f]),b=(0,x.useCallback)((e=>{u(e),f(1)}),[u,f]);return(0,x.createElement)("div",{className:"block-editor-inserter__patterns-category-panel"},(0,x.createElement)(dM.Z,{spacing:2,className:"block-editor-inserter__patterns-category-panel-header"},(0,x.createElement)(wI.Z,null,(0,x.createElement)(pM.Z,null,(0,x.createElement)(EI.Z,{level:4,as:"div"},r.label)),(0,x.createElement)(LD,{patternSyncFilter:s,patternSourceFilter:c,setPatternSyncFilter:g,setPatternSourceFilter:b,scrollContainerRef:p,category:r})),!h.length&&(0,x.createElement)(hM.Z,{variant:"muted",className:"block-editor-inserter__patterns-category-no-results"},(0,$.__)("No results found"))),h.length>0&&(0,x.createElement)(OM,{ref:p,shownPatterns:m.categoryPatternsAsyncList,blockPatterns:m.categoryPatterns,onClickPattern:a,onHover:n,label:r.label,orientation:"vertical",category:r.name,isDraggable:!0,showTitlesAsTooltip:o,patternFilter:c,pagingProps:m}))}var VD=function({onSelectCategory:e,selectedCategory:t,onInsert:n,rootClientId:r}){const[o,i]=(0,x.useState)(!1),a=jD(r),s=t||a[0],l=(0,rT.Z)("medium","<");return(0,x.createElement)(x.Fragment,null,!l&&(0,x.createElement)("div",{className:"block-editor-inserter__block-patterns-tabs-container"},(0,x.createElement)("nav",{"aria-label":(0,$.__)("Block pattern categories"),className:"block-editor-inserter__block-patterns-tabs"},(0,x.createElement)(TM,{role:"list"},a.map((n=>(0,x.createElement)(NM,{role:"listitem",key:n.name,onClick:()=>e(n),className:n===t?"block-editor-inserter__patterns-category block-editor-inserter__patterns-selected-category":"block-editor-inserter__patterns-category","aria-label":n.label,"aria-current":n===t?"true":void 0},(0,x.createElement)(wI.Z,null,(0,x.createElement)(pM.Z,null,n.label),(0,x.createElement)(ox.Z,{icon:(0,$.isRTL)()?kB.Z:_B.Z}))))),(0,x.createElement)("div",{role:"listitem"},(0,x.createElement)(Gh.ZP,{className:"block-editor-inserter__patterns-explore-button",onClick:()=>i(!0),variant:"secondary"},(0,$.__)("Explore all patterns")))))),l&&(0,x.createElement)(ID,{categories:a},(e=>(0,x.createElement)(zD,{key:e.name,onInsert:n,rootClientId:r,category:e,showTitlesAsTooltip:!1}))),o&&(0,x.createElement)(lD,{initialCategory:s,patternCategories:a,onModalClose:()=>i(!1),rootClientId:r}))};function HD(e){const[t,n]=(0,x.useState)([]),r=(0,yl.Z)((e=>Jy(e(e_)).getInserterMediaCategories()),[]),{canInsertImage:o,canInsertVideo:i,canInsertAudio:a}=(0,yl.Z)((t=>{const{canInsertBlockType:n}=t(e_);return{canInsertImage:n("core/image",e),canInsertVideo:n("core/video",e),canInsertAudio:n("core/audio",e)}}),[e]);return(0,x.useEffect)((()=>{(async()=>{const e=[];if(!r)return;const t=new Map(await Promise.all(r.map((async e=>{if(e.isExternalResource)return[e.name,!0];let t=[];try{t=await e.fetch({per_page:1})}catch(e){}return[e.name,!!t.length]})))),s={image:o,video:i,audio:a};r.forEach((n=>{s[n.mediaType]&&t.get(n.name)&&e.push(n)})),e.length&&n(e)})()}),[o,i,a,r]),t}var UD=n(6958),$D=n(36503);const WD={image:"img",video:"video",audio:"audio"};function GD(e,t){const n={id:e.id||void 0,caption:e.caption||void 0},r=e.url,o=e.alt||void 0;"image"===t?(n.url=r,n.alt=o):["video","audio"].includes(t)&&(n.src=r);const i=WD[t],a=(0,x.createElement)(i,{src:e.previewUrl||r,alt:o,controls:"audio"===t||void 0,inert:"true",onError:({currentTarget:t})=>{t.src===e.previewUrl&&(t.src=r)}});return[fc(`core/${t}`,n),a]}const qD=["image"],KD={position:"bottom left",className:"block-editor-inserter__media-list__item-preview-options__popover"};function YD({category:e,media:t}){if(!e.getReportUrl)return null;const n=e.getReportUrl(t);return(0,x.createElement)(em.Z,{className:"block-editor-inserter__media-list__item-preview-options",label:(0,$.__)("Options"),popoverProps:KD,icon:_T.Z},(()=>(0,x.createElement)($k.Z,null,(0,x.createElement)(Wk.Z,{onClick:()=>window.open(n,"_blank").focus(),icon:$D.Z},(0,$.sprintf)((0,$.__)("Report %s"),e.mediaType)))))}function XD({onClose:e,onSubmit:t}){return(0,x.createElement)(yT.Z,{title:(0,$.__)("Insert external image"),onRequestClose:e,className:"block-editor-inserter-media-tab-media-preview-inserter-external-image-modal"},(0,x.createElement)(dM.Z,{spacing:3},(0,x.createElement)("p",null,(0,$.__)("This image cannot be uploaded to your Media Library, but it can still be inserted as an external image.")),(0,x.createElement)("p",null,(0,$.__)("External images can be removed by the external provider without warning and could even have legal compliance issues related to privacy legislation."))),(0,x.createElement)(ew.Z,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,x.createElement)(tw.Z,null,(0,x.createElement)(Gh.ZP,{variant:"tertiary",onClick:e},(0,$.__)("Cancel"))),(0,x.createElement)(tw.Z,null,(0,x.createElement)(Gh.ZP,{variant:"primary",onClick:t},(0,$.__)("Insert")))))}function JD({media:e,onClick:t,composite:n,category:r}){const[o,i]=(0,x.useState)(!1),[a,s]=(0,x.useState)(!1),[l,c]=(0,x.useState)(!1),[u,d]=(0,x.useMemo)((()=>GD(e,r.mediaType)),[e,r.mediaType]),{createErrorNotice:p,createSuccessNotice:h}=(0,_l.Z)(PM.store),m=(0,yl.Z)((e=>e(e_).getSettings().mediaUpload),[]),f=(0,x.useCallback)((e=>{if(l)return;const n=vc(e),{id:r,url:o,caption:a}=n.attributes;r?t(n):(c(!0),window.fetch(o).then((e=>e.blob())).then((e=>{m({filesList:[e],additionalData:{caption:a},onFileChange([e]){Al(e.url)||(t({...n,attributes:{...n.attributes,id:e.id,url:e.url}}),h((0,$.__)("Image uploaded and inserted."),{type:"snackbar"}),c(!1))},allowedTypes:qD,onError(e){p(e,{type:"snackbar"}),c(!1)}})})).catch((()=>{i(!0),c(!1)})))}),[l,t,m,p,h]),g=e.title?.rendered||e.title;let b;if(g.length>25){const e="...";b=g.slice(0,25-e.length)+e}const v=(0,x.useCallback)((()=>s(!0)),[]),y=(0,x.useCallback)((()=>s(!1)),[]);return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(QL,{isEnabled:!0,blocks:[u]},(({draggable:t,onDragStart:o,onDragEnd:i})=>(0,x.createElement)("div",{className:R()("block-editor-inserter__media-list__list-item",{"is-hovered":a}),draggable:t,onDragStart:o,onDragEnd:i},(0,x.createElement)(Xw.Z,{text:b||g},(0,x.createElement)("div",{onMouseEnter:v,onMouseLeave:y},(0,x.createElement)($L.A,{role:"option",as:"div",...n,className:"block-editor-inserter__media-list__item",onClick:()=>f(u),"aria-label":g},(0,x.createElement)("div",{className:"block-editor-inserter__media-list__item-preview"},d,l&&(0,x.createElement)("div",{className:"block-editor-inserter__media-list__item-preview-spinner"},(0,x.createElement)(UD.ZP,null)))),!l&&(0,x.createElement)(YD,{category:r,media:e})))))),o&&(0,x.createElement)(XD,{onClose:()=>i(!1),onSubmit:()=>{t(vc(u)),h((0,$.__)("Image inserted."),{type:"snackbar"}),i(!1)}}))}var QD=function({mediaList:e,category:t,onClick:n,label:r=(0,$.__)("Media List")}){const o=(0,sM.u)();return(0,x.createElement)(AM.b,{...o,role:"listbox",className:"block-editor-inserter__media-list","aria-label":r},e.map(((e,r)=>(0,x.createElement)(JD,{key:e.id||e.sourceId||r,media:e,category:t,onClick:n,composite:o}))))};function eO(e=""){const[t,n]=(0,x.useState)(e),[r,o]=(0,x.useState)(e),i=(0,oT.Z)(o,250);return(0,x.useEffect)((()=>{i(t)}),[t]),[t,n,r]}var tO=function(){return(0,x.createElement)("div",{className:"block-editor-inserter__no-results"},(0,x.createElement)(ox.Z,{className:"block-editor-inserter__no-results-icon",icon:wB.Z}),(0,x.createElement)("p",null,(0,$.__)("No results found.")))};const nO=10;function rO({rootClientId:e,onInsert:t,category:n}){const r=(0,x.useRef)();return(0,x.useEffect)((()=>{const e=setTimeout((()=>{const[e]=TA.tabbable.find(r.current);e?.focus()}));return()=>clearTimeout(e)}),[n]),(0,x.createElement)("div",{ref:r,className:"block-editor-inserter__media-dialog"},(0,x.createElement)(oO,{rootClientId:e,onInsert:t,category:n}))}function oO({rootClientId:e,onInsert:t,category:n}){const[r,o,i]=eO(),{mediaList:a,isLoading:s}=function(e,t={}){const[n,r]=(0,x.useState)(),[o,i]=(0,x.useState)(!1),a=(0,x.useRef)();return(0,x.useEffect)((()=>{(async()=>{const n=JSON.stringify({category:e.name,...t});a.current=n,i(!0),r([]);const o=await(e.fetch?.(t));n===a.current&&(r(o),i(!1))})()}),[e.name,...Object.values(t)]),{mediaList:n,isLoading:o}}(n,{per_page:i?20:nO,search:i}),l="block-editor-inserter__media-panel",c=n.labels.search_items||(0,$.__)("Search");return(0,x.createElement)("div",{className:l},(0,x.createElement)(mB.Z,{className:`${l}-search`,onChange:o,value:r,label:c,placeholder:c}),s&&(0,x.createElement)("div",{className:`${l}-spinner`},(0,x.createElement)(UD.ZP,null)),!s&&!a?.length&&(0,x.createElement)(tO,null),!s&&!!a?.length&&(0,x.createElement)(QD,{rootClientId:e,onClick:t,mediaList:a,category:n}))}var iO=function({fallback:e=null,children:t}){const n=(0,yl.Z)((e=>{const{getSettings:t}=e(e_);return!!t().mediaUpload}),[]);return n?t:e},aO=sT("editor.MediaUpload")((()=>null));const sO=["image","video","audio"];var lO=function({rootClientId:e,selectedCategory:t,onSelectCategory:n,onInsert:r}){const o=HD(e),i=(0,rT.Z)("medium","<"),a="block-editor-inserter__media-tabs",s=(0,x.useCallback)((e=>{if(!e?.url)return;const[t]=GD(e,e.type);r(t)}),[r]),l=(0,x.useMemo)((()=>o.map((e=>({...e,label:e.labels.name})))),[o]);return(0,x.createElement)(x.Fragment,null,!i&&(0,x.createElement)("div",{className:`${a}-container`},(0,x.createElement)("nav",{"aria-label":(0,$.__)("Media categories")},(0,x.createElement)(TM,{role:"list",className:a},o.map((e=>(0,x.createElement)(NM,{role:"listitem",key:e.name,onClick:()=>n(e),className:R()(`${a}__media-category`,{"is-selected":t===e}),"aria-label":e.labels.name,"aria-current":e===t?"true":void 0},(0,x.createElement)(wI.Z,null,(0,x.createElement)(pM.Z,null,e.labels.name),(0,x.createElement)(ox.Z,{icon:(0,$.isRTL)()?kB.Z:_B.Z}))))),(0,x.createElement)("div",{role:"listitem"},(0,x.createElement)(iO,null,(0,x.createElement)(aO,{multiple:!1,onSelect:s,allowedTypes:sO,render:({open:e})=>(0,x.createElement)(Gh.ZP,{onClick:t=>{t.target.focus(),e()},className:"block-editor-inserter__media-library-button",variant:"secondary","data-unstable-ignore-focus-outside-for-relatedtarget":".media-modal"},(0,$.__)("Open Media Library"))})))))),i&&(0,x.createElement)(ID,{categories:l},(t=>(0,x.createElement)(oO,{onInsert:r,rootClientId:e,category:t}))))};const{Fill:cO,Slot:uO}=(0,kl.up)("__unstableInserterMenuExtension");cO.Slot=uO;var dO=cO;const pO=(e,t)=>t?(e.sort((({id:e},{id:n})=>{let r=t.indexOf(e),o=t.indexOf(n);return r<0&&(r=t.length),o<0&&(o=t.length),r-o})),e):e,hO=[];var mO=function({filterValue:e,onSelect:t,onHover:n,onHoverPattern:r,rootClientId:o,clientId:i,isAppender:a,__experimentalInsertionIndex:s,maxBlockPatterns:l,maxBlockTypes:c,showBlockDirectory:u=!1,isDraggable:d=!0,shouldFocusBlock:p=!0,prioritizePatterns:h,selectBlockOnInsert:m}){const f=(0,oT.Z)(wf.D,500),{prioritizedBlocks:g}=(0,yl.Z)((e=>{const t=e(e_).getBlockListSettings(o);return{prioritizedBlocks:t?.prioritizedInserterBlocks||hO}}),[o]),[b,v]=zM({onSelect:t,rootClientId:o,clientId:i,isAppender:a,insertionIndex:s,shouldFocusBlock:p,selectBlockOnInsert:m}),[y,_,k,w]=aM(b,v),[E,,C]=RM(v,b),S=(0,x.useMemo)((()=>{if(0===l)return[];const t=QM(E,e);return void 0!==l?t.slice(0,l):t}),[e,E,l]);let I=c;h&&S.length>2&&(I=0);const T=(0,x.useMemo)((()=>{if(0===I)return[];let t=Jf(y.filter((e=>"core/block"!==e.name)),"frecency","desc");!e&&g.length&&(t=pO(t,g));const n=JM(t,_,k,e);return void 0!==I?n.slice(0,I):n}),[e,y,_,k,I,g]);(0,x.useEffect)((()=>{if(!e)return;const t=T.length+S.length,n=(0,$.sprintf)((0,$._n)("%d result found.","%d results found.",t),t);f(n)}),[e,f,T,S]);const N=zL(T,{step:9}),P=zL(N.length===T.length?S:hO),R=T.length>0||S.length>0,A=!!T.length&&(0,x.createElement)(iM,{title:(0,x.createElement)(h_.Z,null,(0,$.__)("Blocks"))},(0,x.createElement)(oM,{items:N,onSelect:w,onHover:n,label:(0,$.__)("Blocks"),isDraggable:d})),B=!!S.length&&(0,x.createElement)(iM,{title:(0,x.createElement)(h_.Z,null,(0,$.__)("Block patterns"))},(0,x.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,x.createElement)(OM,{shownPatterns:P,blockPatterns:S,onClickPattern:C,onHover:r,isDraggable:d})));return(0,x.createElement)(lM,null,!u&&!R&&(0,x.createElement)(tO,null),h?B:A,!!T.length&&!!S.length&&(0,x.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),h?A:B,u&&(0,x.createElement)(dO.Slot,{fillProps:{onSelect:w,onHover:n,filterValue:e,hasItems:R,rootClientId:b}},(e=>e.length?e:R?null:(0,x.createElement)(tO,null))))},fO=n(83200);const gO={name:"blocks",title:(0,$.__)("Blocks")},bO={name:"patterns",title:(0,$.__)("Patterns")},vO={name:"media",title:(0,$.__)("Media")};var yO=function({children:e,showPatterns:t=!1,showMedia:n=!1,onSelect:r,prioritizePatterns:o}){const i=(0,x.useMemo)((()=>{const e=[];return o&&t&&e.push(bO),e.push(gO),!o&&t&&e.push(bO),n&&e.push(vO),e}),[o,t,n]);return(0,x.createElement)(fO.Z,{className:"block-editor-inserter__tabs",tabs:i,onSelect:r},e)},_O=(0,x.forwardRef)((function({rootClientId:e,clientId:t,isAppender:n,__experimentalInsertionIndex:r,onSelect:o,showInserterHelpPanel:i,showMostUsedBlocks:a,__experimentalFilterValue:s="",shouldFocusBlock:l=!0,prioritizePatterns:c},u){const[d,p,h]=eO(s),[m,f]=(0,x.useState)(null),[g,b]=(0,x.useState)(null),[v,y]=(0,x.useState)("all"),[_,k]=(0,x.useState)(null),[w,E]=(0,x.useState)(null),[C,S,I]=zM({rootClientId:e,clientId:t,isAppender:n,insertionIndex:r,shouldFocusBlock:l}),{showPatterns:T,inserterItems:N}=(0,yl.Z)((e=>{const{__experimentalGetAllowedPatterns:t,getInserterItems:n}=e(e_);return{showPatterns:!!t(C).length,inserterItems:n(C)}}),[C]),P=(0,x.useMemo)((()=>N.some((({category:e})=>"reusable"===e))),[N]),A=!!HD(C).length,B=(0,x.useCallback)(((e,t,n)=>{S(e,t,n),o()}),[S,o]),L=(0,x.useCallback)(((e,t)=>{S(e,{patternName:t}),o()}),[S,o]),M=(0,x.useCallback)((e=>{I(!!e),f(e)}),[I,f]),D=(0,x.useCallback)((e=>{I(!!e)}),[I]),O=(0,x.useCallback)(((e,t)=>{b(e),y(t)}),[b]),F=(0,x.useMemo)((()=>(0,x.createElement)(x.Fragment,null,(0,x.createElement)("div",{className:"block-editor-inserter__block-list"},(0,x.createElement)(uM,{rootClientId:C,onInsert:B,onHover:M,showMostUsedBlocks:a})),i&&(0,x.createElement)("div",{className:"block-editor-inserter__tips"},(0,x.createElement)(h_.Z,{as:"h2"},(0,$.__)("A tip for using the block editor")),(0,x.createElement)(yB,null)))),[C,B,M,a,i]),j=(0,x.useMemo)((()=>(0,x.createElement)(VD,{rootClientId:C,onInsert:L,onSelectCategory:O,selectedCategory:g})),[C,L,O,g]),Z=(0,x.useMemo)((()=>(0,x.createElement)(lO,{rootClientId:C,selectedCategory:_,onSelectCategory:k,onInsert:B})),[C,B,_,k]),z=(0,x.useCallback)((e=>"blocks"===e.name?F:"patterns"===e.name?j:"media"===e.name?Z:void 0),[F,j,Z]),V=(0,x.useRef)();(0,x.useImperativeHandle)(u,(()=>({focusSearch:()=>{V.current.focus()}})));const H="patterns"===w&&!h&&g,U=!h&&(T||P||A),W="media"===w&&!h&&_;return(0,x.createElement)("div",{className:"block-editor-inserter__menu"},(0,x.createElement)("div",{className:R()("block-editor-inserter__main-area",{"show-as-tabs":U})},(0,x.createElement)(mB.Z,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",onChange:e=>{m&&f(null),p(e)},value:d,label:(0,$.__)("Search for blocks and patterns"),placeholder:(0,$.__)("Search"),ref:V}),!!h&&(0,x.createElement)("div",{className:"block-editor-inserter__no-tab-container"},(0,x.createElement)(mO,{filterValue:h,onSelect:o,onHover:M,onHoverPattern:D,rootClientId:e,clientId:t,isAppender:n,__experimentalInsertionIndex:r,showBlockDirectory:!0,shouldFocusBlock:l})),U&&(0,x.createElement)(yO,{showPatterns:T,showReusableBlocks:P,showMedia:A,prioritizePatterns:c,onSelect:e=>{"patterns"!==e&&b(null),E(e)}},z),!h&&!U&&(0,x.createElement)("div",{className:"block-editor-inserter__no-tab-container"},F)),W&&(0,x.createElement)(rO,{rootClientId:C,onInsert:B,category:_}),i&&m&&(0,x.createElement)(jL,{item:m}),H&&(0,x.createElement)(ZD,{rootClientId:C,onInsert:L,onHover:D,category:g,patternFilter:v,showTitlesAsTooltip:!0}))}));function kO({onSelect:e,rootClientId:t,clientId:n,isAppender:r,prioritizePatterns:o,selectBlockOnInsert:i}){const[a,s]=(0,x.useState)(""),[l,c]=zM({onSelect:e,rootClientId:t,clientId:n,isAppender:r,selectBlockOnInsert:i}),[u]=aM(l,c),[d]=RM(c,l),{setInserterIsOpened:p,insertionIndex:h}=(0,yl.Z)((e=>{const{getSettings:t,getBlockIndex:r,getBlockCount:o}=e(e_),i=t(),a=r(n),s=o();return{setInserterIsOpened:i.__experimentalSetIsInserterOpened,insertionIndex:-1===a?s:a}}),[n]),m=d.length&&(!!a||o),f=m&&d.length>6||u.length>6;(0,x.useEffect)((()=>{p&&p(!1)}),[p]);let g=0;return m&&(g=o?4:2),(0,x.createElement)("div",{className:R()("block-editor-inserter__quick-inserter",{"has-search":f,"has-expand":p})},f&&(0,x.createElement)(mB.Z,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",value:a,onChange:e=>{s(e)},label:(0,$.__)("Search for blocks and patterns"),placeholder:(0,$.__)("Search")}),(0,x.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},(0,x.createElement)(mO,{filterValue:a,onSelect:e,rootClientId:t,clientId:n,isAppender:r,maxBlockPatterns:g,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:o,selectBlockOnInsert:i})),p&&(0,x.createElement)(Gh.ZP,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{p({rootClientId:t,insertionIndex:h,filterValue:a})},"aria-label":(0,$.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,$.__)("Browse all")))}const wO=({onToggle:e,disabled:t,isOpen:n,blockTitle:r,hasSingleBlockType:o,toggleProps:i={},prioritizePatterns:a})=>{const{as:s=Gh.ZP,label:l,onClick:c,...u}=i;let d=l;return!d&&o?d=(0,$.sprintf)((0,$._x)("Add %s","directly add the only allowed block"),r):!d&&a?d=(0,$.__)("Add pattern"):d||(d=(0,$._x)("Add block","Generic label for block inserter button")),(0,x.createElement)(s,{icon:hB.Z,label:d,tooltipPosition:"bottom",onClick:function(t){e&&e(t),c&&c(t)},className:"block-editor-inserter__toggle","aria-haspopup":!o&&"true","aria-expanded":!o&&n,disabled:t,...u})};class EO extends x.Component{constructor(){super(...arguments),this.onToggle=this.onToggle.bind(this),this.renderToggle=this.renderToggle.bind(this),this.renderContent=this.renderContent.bind(this)}onToggle(e){const{onToggle:t}=this.props;t&&t(e)}renderToggle({onToggle:e,isOpen:t}){const{disabled:n,blockTitle:r,hasSingleBlockType:o,directInsertBlock:i,toggleProps:a,hasItems:s,renderToggle:l=wO,prioritizePatterns:c}=this.props;return l({onToggle:e,isOpen:t,disabled:n||!s,blockTitle:r,hasSingleBlockType:o,directInsertBlock:i,toggleProps:a,prioritizePatterns:c})}renderContent({onClose:e}){const{rootClientId:t,clientId:n,isAppender:r,showInserterHelpPanel:o,__experimentalIsQuick:i,prioritizePatterns:a,onSelectOrClose:s,selectBlockOnInsert:l}=this.props;return i?(0,x.createElement)(kO,{onSelect:t=>{const n=Array.isArray(t)&&t?.length?t[0]:t;s&&"function"==typeof s&&s(n),e()},rootClientId:t,clientId:n,isAppender:r,prioritizePatterns:a,selectBlockOnInsert:l}):(0,x.createElement)(_O,{onSelect:()=>{e()},rootClientId:t,clientId:n,isAppender:r,showInserterHelpPanel:o,prioritizePatterns:a})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:r,__experimentalIsQuick:o,onSelectOrClose:i}=this.props;return t||n?this.renderToggle({onToggle:r}):(0,x.createElement)(pB.Z,{className:"block-editor-inserter",contentClassName:R()("block-editor-inserter__popover",{"is-quick":o}),popoverProps:{position:e,shift:!0},onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,$.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:i})}}const CO=(0,D.Z)([(0,lT.Z)(((e,{clientId:t,rootClientId:n,shouldDirectInsert:r=!0})=>{const{getBlockRootClientId:o,hasInserterItems:i,getAllowedBlocks:a,getDirectInsertBlock:s,getSettings:l}=e(e_),{getBlockVariations:c}=e(Vu),u=a(n=n||o(t)||void 0),d=r&&s(n),p=l(),h=1===u?.length&&0===c(u[0].name,"inserter")?.length;let m=!1;return h&&(m=u[0]),{hasItems:i(n),hasSingleBlockType:h,blockTitle:m?m.title:"",allowedBlockType:m,directInsertBlock:d,rootClientId:n,prioritizePatterns:p.__experimentalPreferPatternsOnRoot&&!n}})),(0,cT.Z)(((e,t,{select:n})=>({insertOnlyAllowedBlock(){const{rootClientId:r,clientId:o,isAppender:i,hasSingleBlockType:a,allowedBlockType:s,directInsertBlock:l,onSelectOrClose:c,selectBlockOnInsert:u}=t;if(!a&&!l)return;const{insertBlock:d}=e(e_);let p;if(l){const e=function(e){const{getBlock:t,getPreviousBlockClientId:i}=n(e_);if(!e||!o&&!r)return{};const a={};let s={};if(o){const e=t(o),n=t(i(o));e?.name===n?.name&&(s=n?.attributes||{})}else{const e=t(r);if(e?.innerBlocks?.length){const t=e.innerBlocks[e.innerBlocks.length-1];l&&l?.name===t.name&&(s=t.attributes)}}return e.forEach((e=>{s.hasOwnProperty(e)&&(a[e]=s[e])})),a}(l.attributesToCopy);p=fc(l.name,{...l.attributes||{},...e})}else p=fc(s.name);d(p,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:a,getBlockRootClientId:s}=n(e_);if(o)return e(o);const l=t();return!i&&l&&s(l)===r?e(l)+1:a(r).length}(),r,u),c&&c({clientId:p?.clientId});const h=(0,$.sprintf)((0,$.__)("%s block added"),s.title);(0,wf.D)(h)}}))),dT((({hasItems:e,isAppender:t,rootClientId:n,clientId:r})=>e||!t&&!n&&!r))])(EO);var xO=(0,x.forwardRef)(((e,t)=>(0,x.createElement)(CO,{ref:t,...e}))),SO=(0,D.Z)((0,lT.Z)(((e,t)=>{const{getBlockCount:n,getSettings:r,getTemplateLock:o}=e(e_),i=!n(t.rootClientId),{bodyPlaceholder:a}=r();return{showPrompt:i,isLocked:!!o(t.rootClientId),placeholder:a}})),(0,cT.Z)(((e,t)=>{const{insertDefaultBlock:n,startTyping:r}=e(e_);return{onAppend(){const{rootClientId:e}=t;n(void 0,e),r()}}})))((function({isLocked:e,onAppend:t,showPrompt:n,placeholder:r,rootClientId:o}){if(e)return null;const i=(0,Ud.S)(r)||(0,$.__)("Type / to choose a block");return(0,x.createElement)("div",{"data-root-client-id":o||"",className:R()("block-editor-default-block-appender",{"has-visible-prompt":n})},(0,x.createElement)("p",{tabIndex:"0",role:"button","aria-label":(0,$.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{Hf.K5!==e.keyCode&&Hf.L_!==e.keyCode||t()},onClick:()=>t(),onFocus:()=>{n&&t()}},n?i:"\ufeff"),(0,x.createElement)(xO,{rootClientId:o,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function IO({rootClientId:e,className:t,onFocus:n,tabIndex:r},o){return(0,x.createElement)(xO,{position:"bottom center",rootClientId:e,__experimentalIsQuick:!0,renderToggle:({onToggle:e,disabled:i,isOpen:a,blockTitle:s,hasSingleBlockType:l})=>{let c;c=l?(0,$.sprintf)((0,$._x)("Add %s","directly add the only allowed block"),s):(0,$._x)("Add block","Generic label for block inserter button");const u=!l;let d=(0,x.createElement)(Gh.ZP,{ref:o,onFocus:n,tabIndex:r,className:R()(t,"block-editor-button-block-appender"),onClick:e,"aria-haspopup":u?"true":void 0,"aria-expanded":u?a:void 0,disabled:i,label:c},!l&&(0,x.createElement)(h_.Z,{as:"span"},c),(0,x.createElement)(ox.Z,{icon:hB.Z}));return(u||l)&&(d=(0,x.createElement)(Xw.Z,{text:c},d)),d},isAppender:!0})}(0,x.forwardRef)(((e,t)=>((0,q.Z)("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),IO(e,t))));var TO=(0,x.forwardRef)(IO);function NO({rootClientId:e}){return(0,yl.Z)((t=>t(e_).canInsertBlockType(ac(),e)))?(0,x.createElement)(SO,{rootClientId:e}):(0,x.createElement)(TO,{rootClientId:e,className:"block-list-appender__toggle"})}var PO=function({rootClientId:e,renderAppender:t,className:n,tagName:r="div"}){const o=function(e,t){const n=(0,yl.Z)((n=>{const{getTemplateLock:r,getSelectedBlockClientId:o,__unstableGetEditorMode:i,getBlockEditingMode:a}=n(e_);if(!1===t)return!1;if(!t){const t=o();if(e!==t&&(e||t))return!1}return!r(e)&&"disabled"!==a(e)&&"zoom-out"!==i()}),[e,t]);return n?t?(0,x.createElement)(t,null):(0,x.createElement)(NO,{rootClientId:e}):null}(e,t),i=(0,yl.Z)((t=>{const{getBlockInsertionPoint:n,isBlockInsertionPointVisible:r,getBlockCount:o}=t(e_),i=n();return r()&&e===i?.rootClientId&&0===o(e)}),[e]);return o?(0,x.createElement)(r,{tabIndex:-1,className:R()("block-list-appender wp-block",n,{"is-drag-over":i}),contentEditable:!1,"data-block":!0},o):null},RO=function(e){return If((t=>{if(!e)return;function n(t){const{deltaX:n,deltaY:r}=t;e.current.scrollBy(n,r)}const r={passive:!0};return t.addEventListener("wheel",n,r),()=>{t.removeEventListener("wheel",n,r)}}),[e])};const AO=Number.MAX_SAFE_INTEGER;(0,x.createContext)();var BO=function({previousClientId:e,nextClientId:t,children:n,__unstablePopoverSlot:r,__unstableContentRef:o,...i}){const[a,s]=(0,x.useReducer)((e=>(e+1)%AO),0),{orientation:l,rootClientId:c,isVisible:u}=(0,yl.Z)((n=>{const{getBlockListSettings:r,getBlockRootClientId:o,isBlockVisible:i}=n(e_),a=o(null!=e?e:t);return{orientation:r(a)?.orientation||"vertical",rootClientId:a,isVisible:i(e)&&i(t)}}),[e,t]),d=oB(e),p=oB(t),h="vertical"===l,m=(0,x.useMemo)((()=>{if(!(a<0||!d&&!p)&&u)return{contextElement:d||p,getBoundingClientRect(){const e=d?d.getBoundingClientRect():null,t=p?p.getBoundingClientRect():null;let n=0,r=0,o=0,i=0;return h?(r=e?e.bottom:t.top,o=e?e.width:t.width,i=t&&e?t.top-e.bottom:0,n=e?e.left:t.left):(r=e?e.top:t.top,i=e?e.height:t.height,(0,$.isRTL)()?(n=t?t.right:e.left,o=e&&t?e.left-t.right:0):(n=e?e.right:t.left,o=e&&t?t.left-e.right:0)),new window.DOMRect(n,r,o,i)}}}),[d,p,a,h,u]),f=RO(o);return(0,x.useLayoutEffect)((()=>{if(!d)return;const e=new window.MutationObserver(s);return e.observe(d,{attributes:!0}),()=>{e.disconnect()}}),[d]),(0,x.useLayoutEffect)((()=>{if(!p)return;const e=new window.MutationObserver(s);return e.observe(p,{attributes:!0}),()=>{e.disconnect()}}),[p]),(0,x.useLayoutEffect)((()=>{if(d)return d.ownerDocument.defaultView.addEventListener("resize",s),()=>{d.ownerDocument.defaultView?.removeEventListener("resize",s)}}),[d]),(d||p)&&u?(0,x.createElement)(H_.ZP,{ref:f,animate:!1,anchor:m,focusOnMount:!1,__unstableSlotName:r,inline:!r,key:t+"--"+c,...i,className:R()("block-editor-block-popover","block-editor-block-popover__inbetween",i.className),resize:!1,flip:!1,placement:"overlay",variant:"unstyled"},(0,x.createElement)("div",{className:"block-editor-block-popover__inbetween-container"},n)):null};const LO=Number.MAX_SAFE_INTEGER;var MO=(0,x.forwardRef)((function({clientId:e,bottomClientId:t,children:n,__unstableRefreshSize:r,__unstableCoverTarget:o=!1,__unstablePopoverSlot:i,__unstableContentRef:a,shift:s=!0,...l},c){const u=oB(e),d=oB(null!=t?t:e),p=(0,Sf.Z)([c,RO(a)]),[h,m]=(0,x.useReducer)((e=>(e+1)%LO),0);(0,x.useLayoutEffect)((()=>{if(!u)return;const e=new window.MutationObserver(m);return e.observe(u,{attributes:!0}),()=>{e.disconnect()}}),[u]);const f=(0,x.useMemo)((()=>h<0||!u||d!==u?{}:{position:"absolute",width:u.offsetWidth,height:u.offsetHeight}),[u,d,r,h]),g=(0,x.useMemo)((()=>{if(!(h<0||!u||t&&!d))return{getBoundingClientRect(){var e,t,n,r;const o=u.getBoundingClientRect(),i=d?.getBoundingClientRect(),a=Math.min(o.left,null!==(e=i?.left)&&void 0!==e?e:1/0),s=Math.min(o.top,null!==(t=i?.top)&&void 0!==t?t:1/0),l=Math.max(o.right,null!==(n=i.right)&&void 0!==n?n:-1/0)-a,c=Math.max(o.bottom,null!==(r=i.bottom)&&void 0!==r?r:-1/0)-s;return new window.DOMRect(a,s,l,c)},contextElement:u}}),[t,d,u,h]);return!u||t&&!d?null:(0,x.createElement)(H_.ZP,{ref:p,animate:!1,focusOnMount:!1,anchor:g,__unstableSlotName:i,inline:!i,placement:"top-start",resize:!1,flip:!1,shift:s,...l,className:R()("block-editor-block-popover",l.className),variant:"unstyled"},o&&(0,x.createElement)("div",{style:f},n),!o&&n)}));const DO={hide:{opacity:0,scaleY:.75},show:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:.9}};var OO=function({__unstablePopoverSlot:e,__unstableContentRef:t}){const{clientId:n}=(0,yl.Z)((e=>{const{getBlockOrder:t,getBlockInsertionPoint:n}=e(e_),r=n(),o=t(r.rootClientId);return o.length?{clientId:o[r.index]}:{}}),[]),r=dA();return(0,x.createElement)(MO,{clientId:n,__unstableCoverTarget:!0,__unstablePopoverSlot:e,__unstableContentRef:t,className:"block-editor-block-popover__drop-zone"},(0,x.createElement)(zw.E.div,{"data-testid":"block-popover-drop-zone",initial:r?DO.show:DO.hide,animate:DO.show,exit:r?DO.show:DO.exit,className:"block-editor-block-popover__drop-zone-foreground"}))};const FO=(0,x.createContext)();function jO({__unstablePopoverSlot:e,__unstableContentRef:t}){const{selectBlock:n,hideInsertionPoint:r}=(0,_l.Z)(e_),o=(0,x.useContext)(FO),i=(0,x.useRef)(),{orientation:a,previousClientId:s,nextClientId:l,rootClientId:c,isInserterShown:u,isDistractionFree:d,isNavigationMode:p}=(0,yl.Z)((e=>{const{getBlockOrder:t,getBlockListSettings:n,getBlockInsertionPoint:r,isBlockBeingDragged:o,getPreviousBlockClientId:i,getNextBlockClientId:a,getSettings:s,isNavigationMode:l}=e(e_),c=r(),u=t(c.rootClientId);if(!u.length)return{};let d=u[c.index-1],p=u[c.index];for(;o(d);)d=i(d);for(;o(p);)p=a(p);const h=s();return{previousClientId:d,nextClientId:p,orientation:n(c.rootClientId)?.orientation||"vertical",rootClientId:c.rootClientId,isNavigationMode:l(),isDistractionFree:h.isDistractionFree,isInserterShown:c?.__unstableWithInserter}}),[]),h=dA(),m={start:{opacity:0,scale:0},rest:{opacity:1,scale:1,transition:{delay:u?.5:0,type:"tween"}},hover:{opacity:1,scale:1,transition:{delay:.5,type:"tween"}}},f={start:{scale:h?1:0},rest:{scale:1,transition:{delay:.4,type:"tween"}}};if(d&&!p)return null;const g=R()("block-editor-block-list__insertion-point","is-"+a);return(0,x.createElement)(BO,{previousClientId:s,nextClientId:l,__unstablePopoverSlot:e,__unstableContentRef:t},(0,x.createElement)(zw.E.div,{layout:!h,initial:h?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:i,tabIndex:-1,onClick:function(e){e.target===i.current&&l&&n(l,-1)},onFocus:function(e){e.target!==i.current&&(o.current=!0)},className:R()(g,{"is-with-inserter":u}),onHoverEnd:function(e){e.target!==i.current||o.current||r()}},(0,x.createElement)(zw.E.div,{variants:m,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),u&&(0,x.createElement)(zw.E.div,{variants:f,className:R()("block-editor-block-list__insertion-point-inserter")},(0,x.createElement)(xO,{position:"bottom center",clientId:l,rootClientId:c,__experimentalIsQuick:!0,onToggle:e=>{o.current=e},onSelectOrClose:()=>{o.current=!1}}))))}function ZO(e){const{insertionPoint:t,isVisible:n,isBlockListEmpty:r}=(0,yl.Z)((e=>{const{getBlockInsertionPoint:t,isBlockInsertionPointVisible:n,getBlockCount:r}=e(e_),o=t();return{insertionPoint:o,isVisible:n(),isBlockListEmpty:0===r(o?.rootClientId)}}),[]);return!n||r?null:"replace"===t.operation?(0,x.createElement)(OO,{key:`${t.rootClientId}-${t.index}`,...e}):(0,x.createElement)(jO,{...e})}function zO(){const e=(0,x.useContext)(FO),t=(0,yl.Z)((e=>e(e_).getSettings().isDistractionFree||"zoom-out"===e(e_).__unstableGetEditorMode()),[]),{getBlockListSettings:n,getBlockIndex:r,isMultiSelecting:o,getSelectedBlockClientIds:i,getTemplateLock:a,__unstableIsWithinBlockOverlay:s,getBlockEditingMode:l}=(0,yl.Z)(e_),{showInsertionPoint:c,hideInsertionPoint:u}=(0,_l.Z)(e_);return If((d=>{if(!t)return d.addEventListener("mousemove",p),()=>{d.removeEventListener("mousemove",p)};function p(t){if(e.current)return;if(t.target.nodeType===t.target.TEXT_NODE)return;if(o())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void u();let d;if(t.target.classList.contains("is-root-container")||(d=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")),a(d)||"disabled"===l(d))return;const p=n(d)?.orientation||"vertical",h=t.clientY,m=t.clientX;let f=Array.from(t.target.children).find((e=>{const t=e.getBoundingClientRect();return e.classList.contains("wp-block")&&"vertical"===p&&t.top>h||e.classList.contains("wp-block")&&"horizontal"===p&&((0,$.isRTL)()?t.right<m:t.left>m)}));if(!f)return void u();if(!f.id&&(f=f.firstElementChild,!f))return void u();const g=f.id.slice(6);if(!g||s(g))return;if(i().includes(g))return;const b=f.getBoundingClientRect();if("horizontal"===p&&(t.clientY>b.bottom||t.clientY<b.top)||"vertical"===p&&(t.clientX>b.right||t.clientX<b.left))return void u();const v=r(g);0!==v?c(d,v,{__unstableWithInserter:!0}):u()}}),[e,n,r,o,c,u,i,t])}var VO=(0,Wh.o)((e=>t=>{const{clientId:n}=i_();return(0,x.createElement)(e,{...t,clientId:n})}),"withClientId"),HO=VO((({clientId:e,showSeparator:t,isFloating:n,onAddBlock:r,isToggle:o})=>(0,x.createElement)(TO,{className:R()({"block-list-appender__toggle":o}),rootClientId:e,showSeparator:t,isFloating:n,onAddBlock:r}))),UO=(0,D.Z)([VO,(0,lT.Z)(((e,{clientId:t})=>{const{getBlockOrder:n}=e(e_),r=n(t);return{lastBlockClientId:r[r.length-1]}}))])((({clientId:e})=>(0,x.createElement)(SO,{rootClientId:e})));const $O=new WeakMap;var WO=n(82033);const GO=(e,t,n)=>{let r=!0,o=!0;return n&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),(0,BT.D)(e,t,{leading:r,trailing:o,maxWait:t})};function qO(e,t,n){const r=(0,WO.Pr)((()=>GO(e,null!=t?t:0,n)),[e,t,n]);return(0,x.useEffect)((()=>()=>r.cancel()),[r]),r}function KO(e){const t=(0,x.useRef)();return t.current=e,t}function YO({dropZoneElement:e,isDisabled:t,onDrop:n,onDragStart:r,onDragEnter:o,onDragLeave:i,onDragEnd:a,onDragOver:s}){const l=KO(n),c=KO(r),u=KO(o),d=KO(i),p=KO(a),h=KO(s);return If((n=>{if(t)return;const r=null!=e?e:n;let o=!1;const{ownerDocument:i}=r;function a(e){o||(o=!0,i.addEventListener("dragend",b),i.addEventListener("mousemove",b),c.current&&c.current(e))}function s(e){e.preventDefault(),r.contains(e.relatedTarget)||u.current&&u.current(e)}function m(e){!e.defaultPrevented&&h.current&&h.current(e),e.preventDefault()}function f(e){(function(e){const{defaultView:t}=i;if(!(e&&t&&e instanceof t.HTMLElement&&r.contains(e)))return!1;let n=e;do{if(n.dataset.isDropZone)return n===r}while(n=n.parentElement);return!1})(e.relatedTarget)||d.current&&d.current(e)}function g(e){e.defaultPrevented||(e.preventDefault(),e.dataTransfer&&e.dataTransfer.files.length,l.current&&l.current(e),b(e))}function b(e){o&&(o=!1,i.removeEventListener("dragend",b),i.removeEventListener("mousemove",b),p.current&&p.current(e))}return r.dataset.isDropZone="true",r.addEventListener("drop",g),r.addEventListener("dragenter",s),r.addEventListener("dragover",m),r.addEventListener("dragleave",f),i.addEventListener("dragenter",a),()=>{delete r.dataset.isDropZone,r.removeEventListener("drop",g),r.removeEventListener("dragenter",s),r.removeEventListener("dragover",m),r.removeEventListener("dragleave",f),i.removeEventListener("dragend",b),i.removeEventListener("mousemove",b),i.removeEventListener("dragenter",a)}}),[t,e])}function XO(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:r})=>e===n.name&&t===n.type&&r===n.size))&&t.push(n)})),t}function JO(e,t,n={}){const{operation:r="insert"}=n,o=(0,yl.Z)((e=>e(e_).getSettings().mediaUpload),[]),{canInsertBlockType:i,getBlockIndex:a,getClientIdsOfDescendants:s,getBlockOrder:l,getBlocksByClientId:c}=(0,yl.Z)(e_),{insertBlocks:u,moveBlocksToPosition:d,updateBlockAttributes:p,clearSelectedBlock:h,replaceBlocks:m,removeBlocks:f}=(0,_l.Z)(e_),g=(0,Tf.Z)(),b=(0,x.useCallback)(((n,o=!0,i=0)=>{if("replace"===r){const r=l(e)[t];m(r,n,void 0,i)}else u(n,t,e,o,i)}),[r,l,u,m,t,e]),v=(0,x.useCallback)(((n,o,i)=>{if("replace"===r){const r=c(n),o=l(e)[t];g.batch((()=>{f(n,!1),m(o,r,void 0,0)}))}else d(n,o,e,i)}),[r,l,c,u,d,f,t,e]),y=function(e,t,n,r,o,i,a){return s=>{const{srcRootClientId:l,srcClientIds:c,type:u,blocks:d}=function(e){let t={srcRootClientId:null,srcClientIds:null,srcIndex:null,type:null,blocks:null};if(!e.dataTransfer)return t;try{t=Object.assign(t,JSON.parse(e.dataTransfer.getData("wp-blocks")))}catch(e){return t}return t}(s);if("inserter"===u){a();const e=d.map((e=>vc(e)));i(e,!0,null)}if("block"===u){const i=n(c[0]);if(l===e&&i===t)return;if(c.includes(e)||r(c).some((t=>t===e)))return;const a=l===e,s=c.length;o(c,l,a&&i<t?t-s:t)}}}(e,t,a,s,v,b,h),_=function(e,t,n,r,o,i){return t=>{if(!n)return;const a=wc(Ec("from"),(n=>"files"===n.type&&o(n.blockName,e)&&n.isMatch(t)));if(a){const e=a.transform(t,r);i(e)}}}(e,0,o,p,i,b),k=function(e,t,n){return e=>{const t=Hh({HTML:e,mode:"BLOCKS"});t.length&&n(t)}}(0,0,b);return e=>{const t=XO(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?k(n):t.length?_(t):y(e)}}function QO(e,t,n=["top","bottom","left","right"]){let r,o;return n.forEach((n=>{const i=function(e,t,n){const r="top"===n||"bottom"===n,{x:o,y:i}=e,a=r?o:i,s=r?i:o,l=r?t.left:t.top,c=r?t.right:t.bottom,u=t[n];let d;return d=a>=l&&a<=c?a:a<c?l:c,Math.sqrt((a-d)**2+(s-u)**2)}(e,t,n);(void 0===r||i<r)&&(r=i,o=n)})),[r,o]}function eF(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const tF={};function nF(e){const{clientId:t,allowedBlocks:n,prioritizedInserterBlocks:r,defaultBlock:o,directInsert:i,__experimentalDefaultBlock:a,__experimentalDirectInsert:s,template:l,templateLock:c,wrapperRef:u,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:p,__experimentalAppenderTagName:h,renderAppender:m,orientation:f,placeholder:g,layout:b}=e;(function(e,t,n,r,o,i,a,s,l,c,u){const{updateBlockListSettings:d}=(0,_l.Z)(e_),p=(0,Tf.Z)(),{parentLock:h}=(0,yl.Z)((t=>{const n=t(e_).getBlockRootClientId(e);return{parentLock:t(e_).getTemplateLock(n)}}),[e]),m=function(e){const[t,n]=(0,x.useState)(e);return(0,O.default)(t,e)||n(e),t}(t),f=(0,x.useMemo)((()=>n),n),g=void 0===s||"contentOnly"===h?h:s;(0,x.useLayoutEffect)((()=>{const t={allowedBlocks:m,prioritizedInserterBlocks:f,templateLock:g};if(void 0!==l&&(t.__experimentalCaptureToolbars=l),void 0!==c)t.orientation=c;else{const e=PS(u?.type);t.orientation=e.getOrientation(u)}void 0!==i&&((0,q.Z)("__experimentalDefaultBlock",{alternative:"defaultBlock",since:"6.3",version:"6.4"}),t.defaultBlock=i),void 0!==r&&(t.defaultBlock=r),void 0!==a&&((0,q.Z)("__experimentalDirectInsert",{alternative:"directInsert",since:"6.3",version:"6.4"}),t.directInsert=a),void 0!==o&&(t.directInsert=o),$O.get(p)||$O.set(p,[]),$O.get(p).push([e,t]),window.queueMicrotask((()=>{$O.get(p)?.length&&p.batch((()=>{$O.get(p).forEach((e=>{d(...e)})),$O.set(p,[])}))}))}),[e,m,f,g,r,o,i,a,l,c,d,u,p])})(t,n,r,o,i,a,s,c,p,f,b),function(e,t,n,r){const{getBlocks:o,getSelectedBlocksInitialCaretPosition:i,isBlockSelected:a}=(0,yl.Z)(e_),{replaceInnerBlocks:s,__unstableMarkNextChangeAsNotPersistent:l}=(0,_l.Z)(e_),{innerBlocks:c}=(0,yl.Z)((t=>({innerBlocks:t(e_).getBlocks(e)})),[e]),u=(0,x.useRef)(null);(0,x.useLayoutEffect)((()=>{let c=!1;return window.queueMicrotask((()=>{if(c)return;const d=o(e),p=0===d.length||"all"===n||"contentOnly"===n,h=!M()(t,u.current);if(!p||!h)return;u.current=t;const m=$h(d,t);M()(m,d)||(l(),s(e,m,0===d.length&&r&&0!==m.length&&a(e),i()))})),()=>{c=!0}}),[c,t,n,e])}(t,l,c,d);const v=function(e){return(0,yl.Z)((t=>{const n=t(e_).getBlock(e);if(!n)return;const r=t(Vu).getBlockType(n.name);return r&&0!==Object.keys(r.providesContext).length?Object.fromEntries(Object.entries(r.providesContext).map((([e,t])=>[e,n.attributes[t]]))):void 0}),[e])}(t),y=(0,yl.Z)((e=>e(e_).getBlock(t)?.name),[t]),_=cc(y,"layout")||cc(y,"__experimentalLayout")||tF,{allowSizingOnChildren:k=!1}=_,w=YE("layout")||tF,E=b||_,C=(0,x.useMemo)((()=>({...w,...E,...k&&{allowSizingOnChildren:!0}})),[w,E,k]);return(0,x.createElement)(hT,{value:v},(0,x.createElement)(bF,{rootClientId:t,renderAppender:m,__experimentalAppenderTagName:h,layout:C,wrapperRef:u,placeholder:g}))}function rF(e){return PB(e),(0,x.createElement)(nF,{...e})}const oF=(0,x.forwardRef)(((e,t)=>{const n=iF({ref:t},e);return(0,x.createElement)("div",{className:"block-editor-inner-blocks"},(0,x.createElement)("div",{...n}))}));function iF(e={},t={}){const{__unstableDisableLayoutClassNames:n,__unstableDisableDropZone:r}=t,{clientId:o,layout:i=null,__unstableLayoutClassNames:a=""}=i_(),s=(0,rT.Z)("medium","<"),{__experimentalCaptureToolbars:l,hasOverlay:c}=(0,yl.Z)((e=>{if(!o)return{};const{getBlockName:t,isBlockSelected:n,hasSelectedInnerBlock:r,__unstableGetEditorMode:i}=e(e_),a=t(o),l="navigation"===i()||s;return{__experimentalCaptureToolbars:e(Vu).hasBlockSupport(a,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==a&&!n(o)&&!r(o,!0)&&l}}),[o,s]),u=function({rootClientId:e=""}={}){const t=(0,Tf.Z)(),[n,r]=(0,x.useState)({index:null,operation:"insert"}),o=(0,yl.Z)((t=>{const{__unstableIsWithinBlockOverlay:n,__unstableHasActiveBlockOverlayActive:r,getBlockEditingMode:o}=t(e_);return"default"!==o(e)||r(e)||n(e)}),[e]),{getBlockListSettings:i,getBlocks:a,getBlockIndex:s}=(0,yl.Z)(e_),{showInsertionPoint:l,hideInsertionPoint:c}=(0,_l.Z)(e_),u=JO(e,n.index,{operation:n.operation}),d=qO((0,x.useCallback)(((n,o)=>{const c=a(e);if(0===c.length)return void t.batch((()=>{r({index:0,operation:"insert"}),l(e,0,{operation:"insert"})}));const u=c.map((e=>{const t=e.clientId;return{isUnmodifiedDefaultBlock:Nc(e),getBoundingClientRect:()=>o.getElementById(`block-${t}`).getBoundingClientRect(),blockIndex:s(t)}})),[d,p]=function(e,t,n="vertical"){const r="horizontal"===n?["left","right"]:["top","bottom"],o=(0,$.isRTL)();let i=0,a="before",s=1/0;e.forEach((({isUnmodifiedDefaultBlock:e,getBoundingClientRect:n,blockIndex:l})=>{const c=n();let[u,d]=QO(t,c,r);e&&eF(t,c)&&(u=0),u<s&&(a="bottom"===d||!o&&"right"===d||o&&"left"===d?"after":"before",s=u,i=l)}));const l=i+("after"===a?1:-1),c=!!e[i]?.isUnmodifiedDefaultBlock,u=!!e[l]?.isUnmodifiedDefaultBlock;return c||u?[c?i:l,"replace"]:["after"===a?i+1:i,"insert"]}(u,{x:n.clientX,y:n.clientY},i(e)?.orientation);t.batch((()=>{r({index:d,operation:p}),l(e,d,{operation:p})}))}),[a,e,i,t,l,s]),200);return YO({isDisabled:o,onDrop:u,onDragOver(e){d(e,e.currentTarget.ownerDocument)},onDragLeave(){d.cancel(),c()},onDragEnd(){d.cancel(),c()}})}({rootClientId:o}),d=(0,Sf.Z)([e.ref,r?null:u]),p={__experimentalCaptureToolbars:l,layout:i,...t},h=p.value&&p.onChange?rF:nF;return{...e,ref:d,className:R()(e.className,"block-editor-block-list__layout",n?"":a,{"has-overlay":c}),children:o?(0,x.createElement)(h,{...p,clientId:o}):(0,x.createElement)(bF,{...t})}}iF.save=function(e={}){const{innerBlocks:t}=Pd;if(!Array.isArray(t))return{...e,children:t};const n=Dd(t,{isInnerBlocks:!0}),r=(0,x.createElement)(nd,null,n);return{...e,children:r}},oF.DefaultBlockAppender=UO,oF.ButtonBlockAppender=HO,oF.Content=()=>iF.save().children;var aF=oF;const sF=new Set([Hf.UP,Hf.pX,Hf.WV,Hf.RL,Hf.K5,Hf.ZH]);function lF(){const e=(0,yl.Z)((e=>e(e_).isTyping()),[]),{stopTyping:t}=(0,_l.Z)(e_);return If((n=>{if(!e)return;const{ownerDocument:r}=n;let o,i;function a(e){const{clientX:n,clientY:r}=e;o&&i&&(o!==n||i!==r)&&t(),o=n,i=r}return r.addEventListener("mousemove",a),()=>{r.removeEventListener("mousemove",a)}}),[e,t])}function cF(){const{isTyping:e,hasInlineToolbar:t}=(0,yl.Z)((e=>{const{isTyping:t,getSettings:n}=e(e_);return{isTyping:t(),hasInlineToolbar:n().hasInlineToolbar}}),[]),{startTyping:n,stopTyping:r}=(0,_l.Z)(e_),o=lF(),i=If((o=>{const{ownerDocument:i}=o,{defaultView:a}=i,s=a.getSelection();if(e){let c;function u(e){const{target:t}=e;c=a.setTimeout((()=>{PA(t)||r()}))}function d(e){const{keyCode:t}=e;t!==Hf.hY&&t!==Hf.Mf||r()}function p(){s.isCollapsed||r()}return o.addEventListener("focus",u),o.addEventListener("keydown",d),t||i.addEventListener("selectionchange",p),()=>{a.clearTimeout(c),o.removeEventListener("focus",u),o.removeEventListener("keydown",d),i.removeEventListener("selectionchange",p)}}function l(e){const{type:t,target:r}=e;PA(r)&&o.contains(r)&&("keydown"!==t||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&sF.has(t)}(e))&&n()}return o.addEventListener("keypress",l),o.addEventListener("keydown",l),()=>{o.removeEventListener("keypress",l),o.removeEventListener("keydown",l)}}),[e,t,n,r]);return(0,Sf.Z)([o,i])}var uF=function({children:e}){return(0,x.createElement)("div",{ref:cF()},e)};const dF=(0,x.createContext)(),pF=(0,x.createContext)(),hF=new WeakMap;function mF({className:e,...t}){const[n,r]=(0,x.useState)(),o=(0,rT.Z)("medium"),{isOutlineMode:i,isFocusMode:a,editorMode:s}=(0,yl.Z)((e=>{const{getSettings:t,__unstableGetEditorMode:n}=e(e_),{outlineMode:r,focusMode:o}=t();return{isOutlineMode:r,isFocusMode:o,editorMode:n()}}),[]),l=(0,Tf.Z)(),{setBlockVisibility:c}=(0,_l.Z)(e_),u=(0,oT.Z)((0,x.useCallback)((()=>{const e={};hF.get(l).forEach((([t,n])=>{e[t]=n})),c(e)}),[l]),300,{trailing:!0}),d=(0,x.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{hF.get(l)||hF.set(l,[]);for(const t of e){const e=t.target.getAttribute("data-block");hF.get(l).push([e,t.isIntersecting])}u()}))}),[]),p=iF({ref:(0,Sf.Z)([UB(),zO(),cF()]),className:R()("is-root-container",e,{"is-outline-mode":i,"is-focus-mode":a&&o,"is-navigate-mode":"navigation"===s})},t);return(0,x.createElement)(dF.Provider,{value:n},(0,x.createElement)(pF.Provider,{value:d},(0,x.createElement)("div",{...p}),(0,x.createElement)("div",{ref:r})))}function fF(e){return(0,x.createElement)(o_,{value:n_},(0,x.createElement)(mF,{...e}))}function gF({placeholder:e,rootClientId:t,renderAppender:n,__experimentalAppenderTagName:r,layout:o=RS}){const{order:i,selectedBlocks:a,visibleBlocks:s}=(0,yl.Z)((e=>{const{getBlockOrder:n,getSelectedBlockClientIds:r,__unstableGetVisibleBlocks:o}=e(e_);return{order:n(t),selectedBlocks:r(),visibleBlocks:o()}}),[t]);return(0,x.createElement)(BS,{value:o},i.map((e=>(0,x.createElement)(nT.ZP,{key:e,value:!s.has(e)&&!a.includes(e)},(0,x.createElement)(dB,{rootClientId:t,clientId:e})))),i.length<1&&e,(0,x.createElement)(PO,{tagName:r,rootClientId:t,renderAppender:n}))}function bF(e){return(0,x.createElement)(nT.ZP,{value:!1},(0,x.createElement)(gF,{...e}))}fF.__unstableElementContext=dF;const vF=()=>{},yF=(0,Z_.Iq)(((e,t)=>{const{children:n,isShown:r,shouldRenderPlaceholder:o,...i}=function(e){const{className:t,hasValue:n,isShownByDefault:r=!1,label:o,panelId:i,resetAllFilter:a=vF,onDeselect:s,onSelect:l,...c}=(0,j_.y)(e,"ToolsPanelItem"),{panelId:u,menuItems:d,registerResetAllFilter:p,deregisterResetAllFilter:h,registerPanelItem:m,deregisterPanelItem:f,flagItemCustomization:g,isResetting:b,shouldRenderPlaceholderItems:v,firstDisplayedItem:y,lastDisplayedItem:_,__experimentalFirstVisibleItemClass:k,__experimentalLastVisibleItemClass:w}=oI(),E=(0,x.useCallback)(n,[i,n]),C=(0,x.useCallback)(a,[i,a]),S=(0,Pw.Z)(u),I=u===i||null===u;(0,x.useEffect)((()=>(I&&null!==S&&m({hasValue:E,isShownByDefault:r,label:o,panelId:i}),()=>{(null===S&&u||u===i)&&f(o)})),[u,I,r,o,E,i,S,m,f]),(0,x.useEffect)((()=>(I&&p(C),()=>{I&&h(C)})),[p,h,C,I]);const T=r?"default":"optional",N=d?.[T]?.[o],P=(0,Pw.Z)(N),R=void 0!==d?.[T]?.[o],A=n(),B=(0,Pw.Z)(A),L=A&&!B;(0,x.useEffect)((()=>{L&&(r||null===u)&&g(o,T)}),[u,L,r,T,o,g]),(0,x.useEffect)((()=>{R&&!b&&I&&(!N||A||P||l?.(),!N&&P&&s?.())}),[I,N,R,b,A,P,l,s]);const M=r?void 0!==d?.[T]?.[o]:N,D=(0,Ak.I)(),O=(0,x.useMemo)((()=>D(TI,v&&!M&&NI,t,y===o&&k,_===o&&w)),[M,v,t,D,y,_,k,w,o]);return{...c,isShown:M,shouldRenderPlaceholder:v,className:O}}(e);return r?(0,x.createElement)(Iw.Z,{...i,ref:t},n):o?(0,x.createElement)(Iw.Z,{...i,ref:t}):null}),"ToolsPanelItem");var _F=yF,kF=n(42422),wF=n(95578),EF=n(40953),CF=n(58228),xF=function({className:e,label:t,onFilesDrop:n,onHTMLDrop:r,onDrop:o,...i}){const[a,s]=(0,x.useState)(),[l,c]=(0,x.useState)(),[u,d]=(0,x.useState)(),p=(0,EF.Z)({onDrop(e){const t=e.dataTransfer?(0,wF.f)(e.dataTransfer):[],i=e.dataTransfer?.getData("text/html");i&&r?r(i):t.length&&n?n(t):o&&o(e)},onDragStart(e){s(!0);let t="default";e.dataTransfer?.types.includes("text/html")?t="html":(e.dataTransfer?.types.includes("Files")||(e.dataTransfer?(0,wF.f)(e.dataTransfer):[]).length>0)&&(t="file"),d(t)},onDragEnd(){s(!1),d(void 0)},onDragEnter(){c(!0)},onDragLeave(){c(!1)}}),h=(0,_D.Z)();let m;l&&(m=(0,x.createElement)(zw.E.div,{variants:{hidden:{opacity:0},show:{opacity:1,transition:{type:"tween",duration:.2,delay:0,delayChildren:.1}},exit:{opacity:0,transition:{duration:.2,delayChildren:0}}},initial:h?"show":"hidden",animate:"show",exit:h?"show":"exit",className:"components-drop-zone__content",style:{pointerEvents:"none"}},(0,x.createElement)(zw.E.div,{variants:{hidden:{opacity:0,scale:.9},show:{opacity:1,scale:1,transition:{duration:.1}},exit:{opacity:0,scale:.9}}},(0,x.createElement)(c_.Z,{icon:kF.Z,className:"components-drop-zone__content-icon"}),(0,x.createElement)("span",{className:"components-drop-zone__content-text"},t||(0,d_.__)("Drop files to upload")))));const f=R()("components-drop-zone",e,{"is-active":(a||l)&&("file"===u&&n||"html"===u&&r||"default"===u&&o),"is-dragging-over-document":a,"is-dragging-over-element":l,[`is-dragging-${u}`]:!!u});return(0,x.createElement)("div",{...i,ref:p,className:f},h?m:(0,x.createElement)(CF.M,null,m))},SF=n(64650),IF=n(20295),TF=function({accept:e,children:t,multiple:n=!1,onChange:r,onClick:o,render:i,...a}){const s=(0,x.useRef)(null),l=()=>{s.current?.click()},c=i?i({openFileDialog:l}):(0,x.createElement)(Gh.ZP,{onClick:l,...a},t);return(0,x.createElement)("div",{className:"components-form-file-upload"},c,(0,x.createElement)("input",{type:"file",ref:s,multiple:n,style:{display:"none"},accept:e,onChange:r,onClick:o,"data-testid":"form-file-upload-input"}))},NF=n(44779),PF=n(43587),RF=n(76168),AF=n(48558),BF=n(5975),LF=n(14847),MF=n(92061),DF=n(26564),OF=n(69709),FF=function e({children:t,settingsOpen:n,setSettingsOpen:r}){const o=dA(),i=o?x.Fragment:CF.M,a=o?"div":zw.E.div,s=`link-control-settings-drawer-${(0,tT.Z)(e)}`;return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(Gh.ZP,{className:"block-editor-link-control__drawer-toggle","aria-expanded":n,onClick:()=>r(!n),icon:(0,$.isRTL)()?DF.Z:OF.Z,"aria-controls":s},(0,$._x)("Advanced","Additional link settings")),(0,x.createElement)(i,null,n&&(0,x.createElement)(a,{className:"block-editor-link-control__drawer",hidden:!n,id:s,initial:"collapsed",animate:"open",exit:"collapsed",variants:{open:{opacity:1,height:"auto"},collapsed:{opacity:0,height:0}},transition:{duration:.1}},(0,x.createElement)("div",{className:"block-editor-link-control__drawer-inner"},t))))},jF=n(63162),ZF=n.n(jF),zF=n(74826);const VF=(0,Wh.o)((e=>class extends x.Component{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,x.createElement)(e,{...this.props,setTimeout:this.setTimeout,clearTimeout:this.clearTimeout})}}),"withSafeTimeout");var HF=VF,UF=n(62087),$F=n(94397);function WF(e){return"function"==typeof e}class GF extends x.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,x.createRef)(),this.inputRef=(0,x.createRef)(),this.updateSuggestions=(0,BT.D)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.suggestionsRequest=null,this.state={suggestions:[],showSuggestions:!1,isUpdatingSuggestions:!1,suggestionsValue:null,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){const{showSuggestions:t,selectedSuggestion:n}=this.state,{value:r,__experimentalShowInitialSuggestions:o=!1}=this.props;t&&null!==n&&this.suggestionNodes[n]&&!this.scrollingIntoView&&(this.scrollingIntoView=!0,ZF()(this.suggestionNodes[n],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),this.props.setTimeout((()=>{this.scrollingIntoView=!1}),100)),e.value===r||this.props.disableSuggestions||this.state.isUpdatingSuggestions||(r?.length?this.updateSuggestions(r):o&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){this.suggestionsRequest?.cancel?.(),this.suggestionsRequest=null}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){const{__experimentalShowInitialSuggestions:e=!1,value:t}=this.props;return e&&!(t&&t.length)}updateSuggestions(e=""){const{__experimentalFetchLinkSuggestions:t,__experimentalHandleURLSuggestions:n}=this.props;if(!t)return;const r=!e?.length;if(e=e.trim(),!r&&(e.length<2||!n&&(0,$F.P)(e)))return this.suggestionsRequest?.cancel?.(),this.suggestionsRequest=null,void this.setState({suggestions:[],showSuggestions:!1,suggestionsValue:e,selectedSuggestion:null,loading:!1});this.setState({isUpdatingSuggestions:!0,selectedSuggestion:null,loading:!0});const o=t(e,{isInitialSuggestions:r});o.then((t=>{this.suggestionsRequest===o&&(this.setState({suggestions:t,isUpdatingSuggestions:!1,suggestionsValue:e,loading:!1,showSuggestions:!!t.length}),t.length?this.props.debouncedSpeak((0,$.sprintf)((0,$._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,$.__)("No results."),"assertive"))})).catch((()=>{this.suggestionsRequest===o&&this.setState({isUpdatingSuggestions:!1,loading:!1})})),this.suggestionsRequest=o}onChange(e){this.props.onChange(e.target.value)}onFocus(){const{suggestions:e}=this.state,{disableSuggestions:t,value:n}=this.props;!n||t||this.state.isUpdatingSuggestions||e&&e.length||this.updateSuggestions(n)}onKeyDown(e){this.props.onKeyDown?.(e);const{showSuggestions:t,selectedSuggestion:n,suggestions:r,loading:o}=this.state;if(!t||!r.length||o){switch(e.keyCode){case Hf.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case Hf.WV:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case Hf.K5:this.props.onSubmit&&(e.preventDefault(),this.props.onSubmit(null,e))}return}const i=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case Hf.UP:{e.preventDefault();const t=n?n-1:r.length-1;this.setState({selectedSuggestion:t});break}case Hf.WV:{e.preventDefault();const t=null===n||n===r.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case Hf.Mf:null!==this.state.selectedSuggestion&&(this.selectLink(i),this.props.speak((0,$.__)("Link selected.")));break;case Hf.K5:e.preventDefault(),null!==this.state.selectedSuggestion?(this.selectLink(i),this.props.onSubmit&&this.props.onSubmit(i,e)):this.props.onSubmit&&this.props.onSubmit(null,e)}}selectLink(e){this.props.onChange(e.url,e),this.setState({selectedSuggestion:null,showSuggestions:!1})}handleOnClick(e){this.selectLink(e),this.inputRef.current.focus()}static getDerivedStateFromProps({value:e,instanceId:t,disableSuggestions:n,__experimentalShowInitialSuggestions:r=!1},{showSuggestions:o}){let i=o;const a=e&&e.length;return r||a||(i=!1),!0===n&&(i=!1),{showSuggestions:i,suggestionsListboxId:`block-editor-url-input-suggestions-${t}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${t}`}}render(){return(0,x.createElement)(x.Fragment,null,this.renderControl(),this.renderSuggestions())}renderControl(){const{__nextHasNoMarginBottom:e=!1,label:t=null,className:n,isFullWidth:r,instanceId:o,placeholder:i=(0,$.__)("Paste URL or type to search"),__experimentalRenderControl:a,value:s="",hideLabelFromVision:l=!1}=this.props,{loading:c,showSuggestions:u,selectedSuggestion:d,suggestionsListboxId:p,suggestionOptionIdPrefix:h}=this.state,m=`url-input-control-${o}`,f={id:m,label:t,className:R()("block-editor-url-input",n,{"is-full-width":r}),hideLabelFromVision:l},g={id:m,value:s,required:!0,className:"block-editor-url-input__input",type:"text",onChange:this.onChange,onFocus:this.onFocus,placeholder:i,onKeyDown:this.onKeyDown,role:"combobox","aria-label":t?void 0:(0,$.__)("URL"),"aria-expanded":u,"aria-autocomplete":"list","aria-owns":p,"aria-activedescendant":null!==d?`${h}-${d}`:void 0,ref:this.inputRef};return a?a(f,g,c):(e||(0,q.Z)("Bottom margin styles for wp.blockEditor.URLInput",{since:"6.2",version:"6.5",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"}),(0,x.createElement)(uw.ZP,{__nextHasNoMarginBottom:e,...f},(0,x.createElement)("input",{...g}),c&&(0,x.createElement)(UD.ZP,null)))}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t}=this.props,{showSuggestions:n,suggestions:r,suggestionsValue:o,selectedSuggestion:i,suggestionsListboxId:a,suggestionOptionIdPrefix:s,loading:l}=this.state;if(!n||0===r.length)return null;const c={id:a,ref:this.autocompleteRef,role:"listbox"},u=(e,t)=>({role:"option",tabIndex:"-1",id:`${s}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===i||void 0});return WF(t)?t({suggestions:r,selectedSuggestion:i,suggestionsListProps:c,buildSuggestionItemProps:u,isLoading:l,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:!o?.length,currentInputValue:o}):(0,x.createElement)(H_.ZP,{placement:"bottom",focusOnMount:!1},(0,x.createElement)("div",{...c,className:R()("block-editor-url-input__suggestions",`${e}__suggestions`)},r.map(((e,t)=>(0,x.createElement)(Gh.ZP,{...u(0,t),key:e.id,className:R()("block-editor-url-input__suggestion",{"is-selected":t===i}),onClick:()=>this.handleOnClick(e)},e.title)))))}}var qF=(0,D.Z)(HF,zF.Z,UF.Z,(0,lT.Z)(((e,t)=>{if(WF(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(e_);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(GF),KF=({searchTerm:e,onClick:t,itemProps:n,buttonText:r})=>{if(!e)return null;let o;return o=r?"function"==typeof r?r(e):r:(0,fB.Z)((0,$.sprintf)((0,$.__)("Create: <mark>%s</mark>"),e),{mark:(0,x.createElement)("mark",null)}),(0,x.createElement)(Wk.Z,{...n,iconPosition:"left",icon:hB.Z,className:"block-editor-link-control__search-item",onClick:t},o)},YF=n(39033),XF=e=>{const{text:t="",highlight:n=""}=e,r=n.trim();if(!r)return(0,x.createElement)(x.Fragment,null,t);const o=new RegExp(`(${tx(r)})`,"gi");return(0,YF.Z)(t.replace(o,"<mark>$&</mark>"),{mark:(0,x.createElement)("mark",null)})},JF=n(66957),QF=n(51113),ej=n(5316),tj=n(22758),nj=n(33248),rj=n(49557),oj=n(21364),ij=n(21422),aj=n(48383);const sj={post:JF.Z,page:QF.Z,post_tag:ej.Z,category:tj.Z,attachment:nj.Z};function lj({isURL:e,suggestion:t}){let n=null;return e?n=rj.Z:t.type in sj&&(n=sj[t.type]),n?(0,x.createElement)(ox.Z,{className:"block-editor-link-control__search-item-icon",icon:n}):null}function cj(e){const t=e?.trim();return t?.length?e?.replace(/^\/?/,"/"):e}function uj(e){const t=e?.trim();return t?.length?e?.replace(/\/$/,""):e}function dj(e){return e.isFrontPage?"front page":"post_tag"===e.type?"tag":e.type}var pj=({itemProps:e,suggestion:t,searchTerm:n,onClick:r,isURL:o=!1,shouldShowType:i=!1})=>{const a=o?(0,$.__)("Press ENTER to add this link"):(s=t.url)?(0,Wc.Z)(oj.x,ij.D,(e=>null==e||e!=e?"":e),((e,...t)=>(...n)=>e(...n,...t))(aj.w,24),uj,cj)(s):s;var s;return(0,x.createElement)(Wk.Z,{...e,info:a,iconPosition:"left",icon:(0,x.createElement)(lj,{suggestion:t,isURL:o}),onClick:r,shortcut:i&&dj(t),className:"block-editor-link-control__search-item"},(0,x.createElement)(XF,{text:Hl(t.title),highlight:n}))};const hj="__CREATE__",mj="link",fj="mailto",gj="internal",bj=[mj,fj,"tel",gj],vj=[{id:"opensInNewTab",title:(0,$.__)("Open in new tab")}];function yj({instanceId:e,withCreateSuggestion:t,currentInputValue:n,handleSuggestionClick:r,suggestionsListProps:o,buildSuggestionItemProps:i,suggestions:a,selectedSuggestion:s,isLoading:l,isInitialSuggestions:c,createSuggestionButtonText:u,suggestionsQuery:d}){const p=R()("block-editor-link-control__search-results",{"is-loading":l}),h=1===a.length&&bj.includes(a[0].type),m=t&&!h&&!c,f=!d?.type,g=`block-editor-link-control-search-results-label-${e}`,b=c?(0,$.__)("Suggestions"):(0,$.sprintf)((0,$.__)('Search results for "%s"'),n),v=(0,x.createElement)(h_.Z,{id:g},b);return(0,x.createElement)("div",{className:"block-editor-link-control__search-results-wrapper"},v,(0,x.createElement)("div",{...o,className:p,"aria-labelledby":g},(0,x.createElement)($k.Z,null,a.map(((e,t)=>m&&hj===e.type?(0,x.createElement)(KF,{searchTerm:n,buttonText:u,onClick:()=>r(e),key:e.type,itemProps:i(e,t),isSelected:t===s}):hj===e.type?null:(0,x.createElement)(pj,{key:`${e.id}-${e.type}`,itemProps:i(e,t),suggestion:e,index:t,onClick:()=>{r(e)},isSelected:t===s,isURL:bj.includes(e.type),searchTerm:n,shouldShowType:f,isFrontPage:e?.isFrontPage}))))))}var _j=n(44507),kj=n(17753),wj=n(29670),Ej=n(19241);function Cj(e){if(e.includes(" "))return!1;const t=(0,_j.E)(e),n=(0,wj.M)(t),r=function(e,t=6){const n=e.split(/[?#]/)[0];return new RegExp(`(?<=\\S)\\.(?:[a-zA-Z_]{2,${t}})(?:\\/|$)`).test(n)}(e),o=e?.startsWith("www."),i=e?.startsWith("#")&&(0,Ej.Z)(e);return n||o||i||r}const xj=()=>Promise.resolve([]),Sj=e=>{let t=mj;const n=(0,_j.E)(e)||"";return n.includes("mailto")&&(t=fj),n.includes("tel")&&(t="tel"),e?.startsWith("#")&&(t=gj),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,kj.u)(e):e,type:t}])};const Ij=()=>Promise.resolve([]),Tj=()=>{},Nj=(0,x.forwardRef)((({value:e,children:t,currentLink:n={},className:r=null,placeholder:o=null,withCreateSuggestion:i=!1,onCreateSuggestion:a=Tj,onChange:s=Tj,onSelect:l=Tj,showSuggestions:c=!0,renderSuggestions:u=(e=>(0,x.createElement)(yj,{...e})),fetchSuggestions:d=null,allowDirectEntry:p=!0,showInitialSuggestions:h=!1,suggestionsQuery:m={},withURLSuggestion:f=!0,createSuggestionButtonText:g,hideLabelFromVision:b=!1},v)=>{const y=function(e,t,n,r){const{fetchSearchSuggestions:o,pageOnFront:i}=(0,yl.Z)((e=>{const{getSettings:t}=e(e_);return{pageOnFront:t().pageOnFront,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),a=t?Sj:xj;return(0,x.useCallback)(((t,{isInitialSuggestions:i})=>Cj(t)?a(t,{isInitialSuggestions:i}):(async(e,t,n,r,o)=>{const{isInitialSuggestions:i}=t,a=await n(e,t);return a.map((e=>Number(e.id)===o?(e.isFrontPage=!0,e):e)),i||Cj(e)||!r?a:a.concat({title:e,url:e,type:hj})})(t,{...e,isInitialSuggestions:i},o,n,r)),[a,o,i,e,n,r])}(m,p,i,f),_=c?d||y:Ij,k=(0,tT.Z)(Nj),[w,E]=(0,x.useState)(),C=async e=>{let t=e;if(hj!==e.type){if(p||t&&Object.keys(t).length>=1){const{id:e,url:r,...o}=null!=n?n:{};l({...o,...t},t)}}else try{t=await a(e.title),t?.url&&l(t)}catch(e){}},S=R()(r,{});return(0,x.createElement)("div",{className:"block-editor-link-control__search-input-container"},(0,x.createElement)(qF,{disableSuggestions:n?.url===e,__nextHasNoMarginBottom:!0,label:(0,$.__)("Link"),hideLabelFromVision:b,className:S,value:e,onChange:(e,t)=>{s(e),E(t)},placeholder:null!=o?o:(0,$.__)("Search or type url"),__experimentalRenderSuggestions:c?e=>u({...e,instanceId:k,withCreateSuggestion:i,createSuggestionButtonText:g,suggestionsQuery:m,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),C(t)}}):null,__experimentalFetchLinkSuggestions:_,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:h,onSubmit:(t,n)=>{const r=t||w;r||e?.trim()?.length?C(r||{url:e}):n.preventDefault()},ref:v}),t)}));var Pj=Nj,Rj=n(87118),Aj=n(97188),Bj=n(69854);const{Slot:Lj,Fill:Mj}=(0,kl.up)("BlockEditorLinkControlViewer");function Dj(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 Oj=function(e){const[t,n]=(0,x.useReducer)(Dj,{richData:null,isFetching:!1}),{fetchRichUrlData:r}=(0,yl.Z)((e=>{const{getSettings:t}=e(e_);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}}),[]);return(0,x.useEffect)((()=>{if(e?.length&&r&&"undefined"!=typeof AbortController){n({type:"LOADING"});const t=new window.AbortController,o=t.signal;return r(e,{signal:o}).then((e=>{n({type:"RESOLVED",richData:e})})).catch((()=>{o.aborted||n({type:"ERROR"})})),()=>{t.abort()}}}),[e]),t};function Fj({value:e,onEditClick:t,hasRichPreviews:n=!1,hasUnlinkControl:r=!1,onRemove:o,additionalControls:i}){const a=n?e?.url:null,{richData:s,isFetching:l}=Oj(a),c=s&&Object.keys(s).length,u=e&&(0,aj.w)((0,oj.x)(e.url),16)||"",d=!e?.url?.length,p=!d&&Hl(s?.title||e?.title||u);let h;return h=s?.icon?(0,x.createElement)("img",{src:s?.icon,alt:""}):d?(0,x.createElement)(ox.Z,{icon:Rj.Z,size:32}):(0,x.createElement)(ox.Z,{icon:rj.Z}),(0,x.createElement)("div",{"aria-label":(0,$.__)("Currently selected"),className:R()("block-editor-link-control__search-item",{"is-current":!0,"is-rich":c,"is-fetching":!!l,"is-preview":!0,"is-error":d,"is-url-title":p===u})},(0,x.createElement)("div",{className:"block-editor-link-control__search-item-top"},(0,x.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,x.createElement)("span",{className:R()("block-editor-link-control__search-item-icon",{"is-image":s?.icon})},h),(0,x.createElement)("span",{className:"block-editor-link-control__search-item-details"},d?(0,x.createElement)("span",{className:"block-editor-link-control__search-item-error-notice"},(0,$.__)("Link is empty")):(0,x.createElement)(x.Fragment,null,(0,x.createElement)(eI.Z,{className:"block-editor-link-control__search-item-title",href:e.url},p),e?.url&&p!==u&&(0,x.createElement)("span",{className:"block-editor-link-control__search-item-info"},u)))),(0,x.createElement)(Gh.ZP,{icon:Aj.Z,label:(0,$.__)("Edit"),className:"block-editor-link-control__search-item-action",onClick:t,iconSize:24}),r&&(0,x.createElement)(Gh.ZP,{icon:Bj.Z,label:(0,$.__)("Unlink"),className:"block-editor-link-control__search-item-action block-editor-link-control__unlink",onClick:o,iconSize:24}),(0,x.createElement)(Lj,{fillProps:e})),!!(c&&(s?.image||s?.description)||l)&&(0,x.createElement)("div",{className:"block-editor-link-control__search-item-bottom"},(s?.image||l)&&(0,x.createElement)("div",{"aria-hidden":!s?.image,className:R()("block-editor-link-control__search-item-image",{"is-placeholder":!s?.image})},s?.image&&(0,x.createElement)("img",{src:s?.image,alt:""})),(s?.description||l)&&(0,x.createElement)("div",{"aria-hidden":!s?.description,className:R()("block-editor-link-control__search-item-description",{"is-placeholder":!s?.description})},s?.description&&(0,x.createElement)(hM.Z,{truncate:!0,numberOfLines:"2"},s.description))),i&&i())}var jj=n(5681);const Zj=()=>{};var zj=({value:e,onChange:t=Zj,settings:n})=>{if(!n||!n.length)return null;const r=n=>r=>{t({...e,[n.id]:r})},o=n.map((t=>(0,x.createElement)(jj.C,{__nextHasNoMarginBottom:!0,className:"block-editor-link-control__setting",key:t.id,label:t.title,onChange:r(t),checked:!!e&&!!e[t.id],help:t?.help})));return(0,x.createElement)("fieldset",{className:"block-editor-link-control__settings"},(0,x.createElement)(h_.Z,{as:"legend"},(0,$.__)("Currently selected link settings")),o)};const Vj=()=>{},Hj="core/block-editor",Uj="linkControlSettingsDrawer";function $j({searchInputPlaceholder:e,value:t,settings:n=vj,onChange:r=Vj,onRemove:o,onCancel:i,noDirectEntry:a=!1,showSuggestions:s=!0,showInitialSuggestions:l,forceIsEditingLink:c,createSuggestion:u,withCreateSuggestion:d,inputValue:p="",suggestionsQuery:h={},noURLSuggestion:m=!1,createSuggestionButtonText:f,hasRichPreviews:g=!1,hasTextControl:b=!1,renderControlBottom:v=null}){void 0===d&&u&&(d=!0);const[y,_]=(0,x.useState)(!1),{advancedSettingsPreference:k}=(0,yl.Z)((e=>{var t;return{advancedSettingsPreference:null!==(t=e(LF.h).get(Hj,Uj))&&void 0!==t&&t}}),[]),{set:w}=(0,_l.Z)(LF.h),E=k||y,C=(0,x.useRef)(!0),S=(0,x.useRef)(),I=(0,x.useRef)(),T=(0,x.useRef)(!1),N=n.map((({id:e})=>e)),[P,A,B,L,M]=function(e){const[t,n]=(0,x.useState)(e||{});return(0,x.useEffect)((()=>{n((t=>e&&e!==t?e:t))}),[e]),[t,n,e=>{n({...t,url:e})},e=>{n({...t,title:e})},e=>r=>{const o=Object.keys(r).reduce(((t,n)=>(e.includes(n)&&(t[n]=r[n]),t)),{});n({...t,...o})}]}(t),D=t&&!(0,BF.Z)(P,t),[O,F]=(0,x.useState)(void 0!==c?c:!t||!t.url),{createPage:j,isCreatingPage:Z,errorMessage:z}=function(e){const t=(0,x.useRef)(),[n,r]=(0,x.useState)(!1),[o,i]=(0,x.useState)(null);return(0,x.useEffect)((()=>()=>{t.current&&t.current.cancel()}),[]),{createPage:async function(n){r(!0),i(null);try{return t.current=(e=>{let t=!1;const n=new Promise(((n,r)=>{e.then((e=>t?r({isCanceled:!0}):n(e)),(e=>r(t?{isCanceled:!0}:e)))}));return{promise:n,cancel(){t=!0}}})(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw i(e.message||(0,$.__)("An unknown error occurred during creation. Please try again.")),e}finally{r(!1)}},isCreatingPage:n,errorMessage:o}}(u);(0,x.useEffect)((()=>{void 0!==c&&F(c)}),[c]),(0,x.useEffect)((()=>{C.current?C.current=!1:((TA.focusable.find(S.current)[0]||S.current).focus(),T.current=!1)}),[O,Z]);const V=t?.url?.trim()?.length>0,H=()=>{T.current=!!S.current?.contains(S.current.ownerDocument.activeElement),F(!1)},U=()=>{D&&r({...t,...P,url:W}),H()},W=p||P?.url||"",G=!W?.trim()?.length,q=o&&t&&!O&&!Z,K=O&&V,Y=V&&b,X=(O||!t)&&!Z,J=!D||G,Q=!!n?.length&&O&&V;return(0,x.createElement)("div",{tabIndex:-1,ref:S,className:"block-editor-link-control"},Z&&(0,x.createElement)("div",{className:"block-editor-link-control__loading"},(0,x.createElement)(UD.ZP,null)," ",(0,$.__)("Creating"),"…"),X&&(0,x.createElement)(x.Fragment,null,(0,x.createElement)("div",{className:R()({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":Y,"has-actions":K})},Y&&(0,x.createElement)(QS.Z,{__nextHasNoMarginBottom:!0,ref:I,className:"block-editor-link-control__field block-editor-link-control__text-content",label:(0,$.__)("Text"),value:P?.title,onChange:L,onKeyDown:e=>{const{keyCode:t}=e;t!==Hf.K5||G||(e.preventDefault(),U())},size:"__unstable-large"}),(0,x.createElement)(Pj,{currentLink:t,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:e,value:W,withCreateSuggestion:d,onCreateSuggestion:j,onChange:B,onSelect:e=>{const t=Object.keys(e).reduce(((t,n)=>(N.includes(n)||(t[n]=e[n]),t)),{});r({...P,...t,title:P?.title||e?.title}),H()},showInitialSuggestions:l,allowDirectEntry:!a,showSuggestions:s,suggestionsQuery:h,withURLSuggestion:!m,createSuggestionButtonText:f,hideLabelFromVision:!Y}),!K&&(0,x.createElement)("div",{className:"block-editor-link-control__search-enter"},(0,x.createElement)(Gh.ZP,{onClick:J?Vj:U,label:(0,$.__)("Submit"),icon:MF.Z,className:"block-editor-link-control__search-submit","aria-disabled":J}))),z&&(0,x.createElement)(AF.Z,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1},z)),t&&!O&&!Z&&(0,x.createElement)(Fj,{key:t?.url,value:t,onEditClick:()=>F(!0),hasRichPreviews:g,hasUnlinkControl:q,additionalControls:()=>{if(n?.find((e=>"opensInNewTab"===e.id)))return(0,x.createElement)(zj,{value:P,settings:n?.filter((({id:e})=>"opensInNewTab"===e)),onChange:r})},onRemove:()=>{o(),F(!0)}}),Q&&(0,x.createElement)("div",{className:"block-editor-link-control__tools"},!G&&(0,x.createElement)(FF,{settingsOpen:E,setSettingsOpen:e=>{w&&w(Hj,Uj,e),_(e)}},(0,x.createElement)(zj,{value:P,settings:n,onChange:M(N)}))),K&&(0,x.createElement)("div",{className:"block-editor-link-control__search-actions"},(0,x.createElement)(Gh.ZP,{variant:"primary",onClick:J?Vj:U,className:"block-editor-link-control__search-submit","aria-disabled":J},(0,$.__)("Save")),(0,x.createElement)(Gh.ZP,{variant:"tertiary",onClick:e=>{e.preventDefault(),e.stopPropagation(),A(t),V?H():o?.(),i?.()}},(0,$.__)("Cancel"))),v&&v())}$j.ViewerFill=Mj,$j.DEFAULT_LINK_SETTINGS=vj;var Wj=$j;const Gj=()=>{};let qj=0;var Kj=(0,D.Z)([(0,cT.Z)((e=>{const{createNotice:t,removeNotice:n}=e(PM.store);return{createNotice:t,removeNotice:n}})),sT("editor.MediaReplaceFlow")])((({mediaURL:e,mediaId:t,mediaIds:n,allowedTypes:r,accept:o,onError:i,onSelect:a,onSelectURL:s,onToggleFeaturedImage:l,useFeaturedImage:c,onFilesUpload:u=Gj,name:d=(0,$.__)("Replace"),createNotice:p,removeNotice:h,children:m,multiple:f=!1,addToGallery:g,handleUpload:b=!0,popoverProps:v})=>{const y=(0,yl.Z)((e=>e(e_).getSettings().mediaUpload),[]),_=!!y,k=(0,x.useRef)(),w="block-editor/media-replace-flow/error-notice/"+ ++qj,E=e=>{const t=Hl(e);i?i(t):setTimeout((()=>{p("error",t,{speak:!0,id:w,isDismissible:!0})}),1e3)},C=(e,t)=>{c&&l&&l(),t(),a(e),(0,wf.D)((0,$.__)("The media file has been replaced")),h(w)},S=e=>{e.keyCode===Hf.WV&&(e.preventDefault(),e.target.click())},I=f&&!(!r||0===r.length)&&r.every((e=>"image"===e||e.startsWith("image/")));return(0,x.createElement)(pB.Z,{popoverProps:v,contentClassName:"block-editor-media-replace-flow__options",renderToggle:({isOpen:e,onToggle:t})=>(0,x.createElement)(Jh,{ref:k,"aria-expanded":e,"aria-haspopup":"true",onClick:t,onKeyDown:S},d),renderContent:({onClose:i})=>(0,x.createElement)(x.Fragment,null,(0,x.createElement)(IF.ZP,{className:"block-editor-media-replace-flow__media-upload-menu"},(0,x.createElement)(iO,null,(0,x.createElement)(aO,{gallery:I,addToGallery:g,multiple:f,value:f?n:t,onSelect:e=>C(e,i),allowedTypes:r,render:({open:e})=>(0,x.createElement)(Wk.Z,{icon:NF.Z,onClick:e},(0,$.__)("Open Media Library"))}),(0,x.createElement)(TF,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!b)return t(),a(n);u(n),y({allowedTypes:r,filesList:n,onFileChange:([e])=>{C(e,t)},onError:E})})(e,i)},accept:o,multiple:!!f,render:({openFileDialog:e})=>(0,x.createElement)(Wk.Z,{icon:PF.Z,onClick:()=>{e()}},(0,$.__)("Upload"))})),l&&(0,x.createElement)(Wk.Z,{icon:RF.Z,onClick:l,isPressed:c},(0,$.__)("Use featured image")),m),s&&(0,x.createElement)("form",{className:R()("block-editor-media-flow__url-input",{"has-siblings":_||l})},(0,x.createElement)("span",{className:"block-editor-media-replace-flow__image-url-label"},(0,$.__)("Current media URL:")),(0,x.createElement)(Xw.Z,{text:e},(0,x.createElement)("div",null,(0,x.createElement)(Wj,{value:{url:e},settings:[],showSuggestions:!1,onChange:({url:e})=>{s(e),k.current.focus()}})))))})}));const Yj="background",Xj="image";function Jj({attributes:e={},setAttributes:t}){const{style:n={}}=e;t({style:CC({...n,background:{...n?.background,backgroundImage:void 0}})})}function Qj({label:e,filename:t,url:n}){const r=e||(0,SF.v)(n);return(0,x.createElement)(TM,{as:"span"},(0,x.createElement)(wI.Z,{justify:"flex-start",as:"span"},(0,x.createElement)("span",{className:R()("block-editor-hooks__background__inspector-image-indicator-wrapper",{"has-image":n}),"aria-hidden":!0},n&&(0,x.createElement)("span",{className:"block-editor-hooks__background__inspector-image-indicator",style:{backgroundImage:`url(${n})`}})),(0,x.createElement)(tw.Z,{as:"span"},(0,x.createElement)(HL,{numberOfLines:1,className:"block-editor-hooks__background__inspector-media-replace-title"},r),(0,x.createElement)(h_.Z,{as:"span"},t?(0,$.sprintf)((0,$.__)("Selected image: %s"),t):(0,$.__)("No image selected")))))}function eZ(e){const{attributes:t,clientId:n,setAttributes:r}=e,{id:o,title:i,url:a}=t.style?.background?.backgroundImage||{},s=(0,x.useRef)(),{mediaUpload:l}=(0,yl.Z)((e=>({mediaUpload:e(e_).getSettings().mediaUpload}))),{createErrorNotice:c}=(0,_l.Z)(PM.store),u=e=>{c(e,{type:"snackbar"})},d=e=>{if(!e||!e.url){const e={...t.style,background:{...t.style?.background,backgroundImage:void 0}},n={style:CC(e)};return void r(n)}if(Al(e.url))return;if(e.media_type&&e.media_type!==Xj||!e.media_type&&e.type&&e.type!==Xj)return void u((0,$.__)("Only images can be used as a background image."));const n={...t.style,background:{...t.style?.background,backgroundImage:{url:e.url,id:e.id,source:"file",title:e.title||void 0}}},o={style:CC(n)};r(o)},p=(0,x.useCallback)((e=>({...e,style:{...e.style,background:void 0}})),[]),h=function(e){return!!e.attributes.style?.background?.backgroundImage?.id||!!e.attributes.style?.background?.backgroundImage?.url}(e);return(0,x.createElement)(_F,{className:"single-column",hasValue:()=>h,label:(0,$.__)("Background image"),onDeselect:()=>Jj(e),isShownByDefault:!0,resetAllFilter:p,panelId:n},(0,x.createElement)("div",{className:"block-editor-hooks__background__inspector-media-replace-container",ref:s},(0,x.createElement)(Kj,{mediaId:o,mediaURL:a,allowedTypes:[Xj],accept:"image/*",onSelect:d,name:(0,x.createElement)(Qj,{label:(0,$.__)("Background image"),filename:i,url:a}),variant:"secondary"},h&&(0,x.createElement)(Wk.Z,{onClick:()=>{const[t]=TA.tabbable.find(s.current);t?.focus(),t?.click(),Jj(e)}},(0,$.__)("Reset "))),(0,x.createElement)(xF,{onFilesDrop:e=>{l({allowedTypes:["image"],filesList:e,onFileChange([e]){Al(e?.url)||d(e)},onError:u})},label:(0,$.__)("Drop to upload")})))}function tZ(e){const t=YE("background.backgroundImage")&&function(e,t="any"){if("web"!==wm.Z.OS)return!1;const n=cc(e,Yj);return!0===n||("any"===t?!!n?.backgroundImage:!!n?.[t])}(e.name,"backgroundImage");return t?(0,x.createElement)(qI,{group:"background"},t&&(0,x.createElement)(eZ,{...e})):null}const nZ=/^([\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)?$/,rZ=["top","right","bottom","left"],oZ=["color","style","width"],iZ=e=>!e||!oZ.some((t=>void 0!==e[t])),aZ=e=>!!e&&(sZ(e)?!rZ.every((t=>iZ(e[t]))):!iZ(e)),sZ=(e={})=>Object.keys(e).some((e=>-1!==rZ.indexOf(e))),lZ=e=>{if(!sZ(e))return!1;const t=rZ.map((t=>cZ(e?.[t])));return!t.every((e=>e===t[0]))},cZ=(e,t)=>{if(iZ(e))return t;const{color:n,style:r,width:o}=t||{},{color:i=n,style:a=r,width:s=o}=e;return[s,s&&"0"!==s||i?a||"solid":a,i].filter(Boolean).join(" ")},uZ=e=>function(e){if(0===e.length)return;const t={};let n,r=0;return e.forEach((e=>{t[e]=void 0===t[e]?1:t[e]+1,t[e]>r&&(n=e,r=t[e])})),n}(e.map((e=>void 0===e?void 0:function(e){const t=e.trim().match(nZ);if(!t)return[void 0,void 0];const[,n,r]=t;let o=parseFloat(n);return o=Number.isNaN(o)?void 0:o,[o,r]}(`${e}`)[1])).filter((e=>void 0!==e)));(0,Dl.l7)([Ol.Z,Zl]);const dZ=(e,t,n)=>{if(t){const n=e?.find((e=>e.slug===t));if(n)return n}return{color:n}},pZ=(e,t)=>e?.find((e=>e.color===t));function hZ(e,t){if(e&&t)return`has-${VE(t)}-${e}`}function mZ(){const e={disableCustomColors:!YE("color.custom"),disableCustomGradients:!YE("color.customGradient")},t=YE("color.palette.custom"),n=YE("color.palette.theme"),r=YE("color.palette.default"),o=YE("color.defaultPalette");e.colors=(0,x.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,$._x)("Theme","Indicates this palette comes from the theme."),colors:n}),o&&r&&r.length&&e.push({name:(0,$._x)("Default","Indicates this palette comes from WordPress."),colors:r}),t&&t.length&&e.push({name:(0,$._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[r,n,t,o]);const i=YE("color.gradients.custom"),a=YE("color.gradients.theme"),s=YE("color.gradients.default"),l=YE("color.defaultGradients");return e.gradients=(0,x.useMemo)((()=>{const e=[];return a&&a.length&&e.push({name:(0,$._x)("Theme","Indicates this palette comes from the theme."),gradients:a}),l&&s&&s.length&&e.push({name:(0,$._x)("Default","Indicates this palette comes from WordPress."),gradients:s}),i&&i.length&&e.push({name:(0,$._x)("Custom","Indicates this palette is created by the user."),gradients:i}),e}),[i,a,s,l]),e.hasColorsOrGradients=!!e.colors.length||!!e.gradients.length,e}var fZ=n(80777),gZ=n(50070);const bZ=(0,b_.css)("",""),vZ={name:"bjn8wh",styles:"position:relative"},yZ=e=>{const{color:t=N_.D.gray[200],style:n="solid",width:r=T_.Z.borderWidth}=e||{};return`${t} ${r&&"0"!==r||t?n||"solid":n} ${r!==T_.Z.borderWidth?`clamp(1px, ${r}, 10px)`:r}`},_Z={name:"1nwbfnf",styles:"grid-column:span 2;margin:0 auto"};var kZ=(0,Z_.Iq)(((e,t)=>{const{className:n,isLinked:r,...o}=function(e){const{className:t,size:n="default",...r}=(0,j_.y)(e,"BorderBoxControlLinkedButton"),o=(0,Ak.I)();return{...r,className:(0,x.useMemo)((()=>o((e=>(0,b_.css)("position:absolute;top:","__unstable-large"===e?"8px":"3px",";",(0,$_.b)({right:0})()," line-height:0;",""))(n),t)),[t,o,n])}}(e),i=r?(0,d_.__)("Unlink sides"):(0,d_.__)("Link sides");return(0,x.createElement)(Xw.Z,{text:i},(0,x.createElement)(Iw.Z,{className:n},(0,x.createElement)(Gh.ZP,{...o,isSmall:!0,icon:r?fZ.Z:gZ.Z,iconSize:24,"aria-label":i,ref:t})))}),"BorderBoxControlLinkedButton");var wZ=(0,Z_.Iq)(((e,t)=>{const{value:n,...r}=function(e){const{className:t,value:n,size:r="default",...o}=(0,j_.y)(e,"BorderBoxControlVisualizer"),i=(0,Ak.I)();return{...o,className:(0,x.useMemo)((()=>i(((e,t)=>(0,b_.css)("position:absolute;top:","__unstable-large"===t?"20px":"15px",";right:","__unstable-large"===t?"39px":"29px",";bottom:","__unstable-large"===t?"20px":"15px",";left:","__unstable-large"===t?"39px":"29px",";border-top:",yZ(e?.top),";border-bottom:",yZ(e?.bottom),";",(0,$_.b)({borderLeft:yZ(e?.left)})()," ",(0,$_.b)({borderRight:yZ(e?.right)})(),";",""))(n,r),t)),[i,t,n,r]),value:n}}(e);return(0,x.createElement)(Iw.Z,{...r,ref:t})}),"BorderBoxControlVisualizer"),EZ=n(28159),CZ=n(67429),xZ=n(73624),SZ=n(55712);const IZ={name:"f3vz0n",styles:"font-weight:500"},TZ=(0,b_.css)("box-shadow:inset ",T_.Z.controlBoxShadowFocus,";",""),NZ=(0,b_.css)("border:0;padding:0;margin:0;",SZ.p,";",""),PZ=(0,b_.css)(KC,"{flex:0 0 auto;}",""),RZ=(0,b_.css)("width:",228,"px;>div:first-of-type>",w_.ar,"{margin-bottom:0;",IZ,";}&& ",w_.ar,"+button:not( .has-text ){min-width:24px;padding:0;}",""),AZ=(0,b_.css)("",""),BZ=(0,b_.css)("",""),LZ=(0,b_.css)("justify-content:center;width:100%;&&{border-top:",T_.Z.borderWidth," solid ",N_.D.gray[400],";border-top-left-radius:0;border-top-right-radius:0;height:40px;}",""),MZ=(0,b_.css)(w_.ar,"{",IZ,";}",""),DZ={name:"ed6beh",styles:"&&&&&{min-width:32px;width:32px;height:32px;padding:4px;}"},OZ=[{label:(0,d_.__)("Solid"),icon:O_.Z,value:"solid"},{label:(0,d_.__)("Dashed"),icon:CZ.Z,value:"dashed"},{label:(0,d_.__)("Dotted"),icon:xZ.Z,value:"dotted"}],FZ=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,x.createElement)(h_.Z,{as:"label"},t):(0,x.createElement)(w_.ar,null,t):null},jZ=(0,Z_.Iq)(((e,t)=>{const{buttonClassName:n,hideLabelFromVision:r,label:o,onChange:i,value:a,...s}=function(e){const{className:t,...n}=(0,j_.y)(e,"BorderControlStylePicker"),r=(0,Ak.I)();return{...n,className:(0,x.useMemo)((()=>r(MZ,t)),[t,r]),buttonClassName:(0,x.useMemo)((()=>r(DZ)),[r])}}(e);return(0,x.createElement)(Iw.Z,{...s,ref:t},(0,x.createElement)(FZ,{label:o,hideLabelFromVision:r}),(0,x.createElement)(ew.Z,{justify:"flex-start",gap:1},OZ.map((e=>(0,x.createElement)(Gh.ZP,{key:e.value,className:n,icon:e.icon,isSmall:!0,isPressed:e.value===a,onClick:()=>i(e.value===a?void 0:e.value),"aria-label":e.label,label:e.label,showTooltip:!0})))))}),"BorderControlStylePicker");var ZZ=jZ,zZ=(0,x.forwardRef)((function(e,t){const{className:n,colorValue:r,...o}=e;return(0,x.createElement)("span",{className:R()("component-color-indicator",n),style:{background:r},ref:t,...o})})),VZ=n(80346),HZ=n(44603);const UZ=(0,g_.default)(qC.Z,{target:"ez9hsf47"})(y_.W2,"{width:",(0,W_.D)(24),";}"),$Z=(0,g_.default)(HZ.Z,{target:"ez9hsf46"})("margin-left:",(0,W_.D)(-2),";width:5em;select:not( :focus )~",y_.Kg,y_.Kg,y_.Kg,"{border-color:transparent;}"),WZ=(0,g_.default)(CS,{target:"ez9hsf45"})("flex:1;margin-right:",(0,W_.D)(2),";"),GZ=`\n.react-colorful__interactive {\n\twidth: calc( 100% - ${(0,W_.D)(2)} );\n\tmargin-left: ${(0,W_.D)(1)};\n}`,qZ=(0,g_.default)("div",{target:"ez9hsf44"})("padding-top:",(0,W_.D)(2),";padding-right:0;padding-left:0;padding-bottom:0;"),KZ=(0,g_.default)(wI.Z,{target:"ez9hsf43"})("padding-left:",(0,W_.D)(4),";padding-right:",(0,W_.D)(4),";"),YZ=(0,g_.default)(ew.Z,{target:"ez9hsf42"})("padding-top:",(0,W_.D)(4),";padding-left:",(0,W_.D)(4),";padding-right:",(0,W_.D)(3),";padding-bottom:",(0,W_.D)(5),";"),XZ=(0,g_.default)("div",{target:"ez9hsf41"})(SZ.p,";width:216px;.react-colorful{display:flex;flex-direction:column;align-items:center;width:216px;height:auto;overflow:hidden;}.react-colorful__saturation{width:100%;border-radius:0;height:216px;margin-bottom:",(0,W_.D)(4),";border-bottom:none;}.react-colorful__hue,.react-colorful__alpha{width:184px;height:16px;border-radius:16px;margin-bottom:",(0,W_.D)(2),";}.react-colorful__pointer{height:16px;width:16px;border:none;box-shadow:0 0 2px 0 rgba( 0, 0, 0, 0.25 );outline:2px solid transparent;}.react-colorful__pointer-fill{box-shadow:inset 0 0 0 ",T_.Z.borderWidthFocus," #fff;}",GZ,";"),JZ=(0,g_.default)(Gh.ZP,{target:"ez9hsf40"})("&&&&&{min-width:",(0,W_.D)(6),";padding:0;>svg{margin-right:0;}}");var QZ=n(57364),ez=n(6528),tz=n(33955),nz=n(6686);const rz=(0,x.createContext)({});var oz=n(23561),iz=(0,Z_.Iq)((function(e,t){const{as:n="span",shortcut:r,className:o,...i}=(0,j_.y)(e,"Shortcut");if(!r)return null;let a,s;return"string"==typeof r?a=r:(a=r.display,s=r.ariaLabel),(0,x.createElement)(Iw.Z,{as:n,className:o,"aria-label":s,ref:t,...i},a)}),"Shortcut");const az=(0,b_.css)("z-index:",1000002,";box-sizing:border-box;opacity:0;outline:none;transform-origin:top center;transition:opacity ",T_.Z.transitionDurationFastest," ease;font-size:",T_.Z.fontSize,";&[data-enter]{opacity:1;}",""),sz=(0,g_.default)("div",{target:"e7tfjmw1"})("background:rgba( 0, 0, 0, 0.8 );border-radius:2px;box-shadow:0 0 0 1px rgba( 255, 255, 255, 0.04 );color:",N_.D.white,";padding:4px 8px;"),lz=(0,g_.default)(iz,{target:"e7tfjmw0"})("display:inline-block;margin-left:",(0,W_.D)(1),";"),{TooltipPopoverView:cz}=_;var uz=(0,Z_.Iq)((function(e,t){const{children:n,className:r,...o}=(0,j_.y)(e,"TooltipContent"),{tooltip:i}=(0,x.useContext)(rz),a=(0,Ak.I)()(az,r);return(0,x.createElement)(oz.u,{as:Iw.Z,...o,...i,className:a,ref:t},(0,x.createElement)(cz,null,n))}),"TooltipContent");const dz=(0,Z_.Iq)((function(e,t){const{animated:n=!0,animationDuration:r=160,baseId:o,children:i,content:a,focusable:s=!0,gutter:l=4,id:c,modal:u=!0,placement:d,visible:p=!1,shortcut:h,...m}=(0,j_.y)(e,"Tooltip"),f=(0,tz.K)({animated:n?r:void 0,baseId:o||c,gutter:l,placement:d,visible:p,...m}),g=(0,x.useMemo)((()=>({tooltip:f})),[f]);return(0,x.createElement)(rz.Provider,{value:g},a&&(0,x.createElement)(uz,{unstable_portal:u,ref:t},a,h&&(0,x.createElement)(lz,{shortcut:h})),i&&(0,x.createElement)(nz.v,{...f,...i.props,ref:i?.ref},(e=>(s||(e.tabIndex=void 0),(0,x.cloneElement)(i,e)))))}),"Tooltip");var pz=dz;const hz=e=>{const{color:t,colorType:n}=e,[r,o]=(0,x.useState)(null),i=(0,x.useRef)(),a=(0,QZ.Z)((()=>{switch(n){case"hsl":return t.toHslString();case"rgb":return t.toRgbString();default:return t.toHex()}}),(()=>{i.current&&clearTimeout(i.current),o(t.toHex()),i.current=setTimeout((()=>{o(null),i.current=void 0}),3e3)}));return(0,x.useEffect)((()=>()=>{i.current&&clearTimeout(i.current)}),[]),(0,x.createElement)(pz,{content:(0,x.createElement)(hM.Z,{color:"white"},r===t.toHex()?(0,d_.__)("Copied!"):(0,d_.__)("Copy")),placement:"bottom"},(0,x.createElement)(JZ,{isSmall:!0,ref:a,icon:ez.Z,showTooltip:!1}))},mz=({min:e,max:t,label:n,abbreviation:r,onChange:o,value:i})=>(0,x.createElement)(wI.Z,{spacing:4},(0,x.createElement)(UZ,{min:e,max:t,label:n,hideLabelFromVision:!0,value:i,onChange:e=>{o(e?"string"!=typeof e?e:parseInt(e,10):0)},prefix:(0,x.createElement)(cD.Z,{as:hM.Z,paddingLeft:(0,W_.D)(4),color:N_.D.theme.accent,lineHeight:1},r),spinControls:"none",size:"__unstable-large"}),(0,x.createElement)(WZ,{__nextHasNoMarginBottom:!0,label:n,hideLabelFromVision:!0,min:e,max:t,value:i,onChange:o,withInputField:!1})),fz=({color:e,onChange:t,enableAlpha:n})=>{const{r:r,g:o,b:i,a:a}=e.toRgb();return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(mz,{min:0,max:255,label:"Red",abbreviation:"R",value:r,onChange:e=>t((0,Dl.Vi)({r:e,g:o,b:i,a:a}))}),(0,x.createElement)(mz,{min:0,max:255,label:"Green",abbreviation:"G",value:o,onChange:e=>t((0,Dl.Vi)({r:r,g:e,b:i,a:a}))}),(0,x.createElement)(mz,{min:0,max:255,label:"Blue",abbreviation:"B",value:i,onChange:e=>t((0,Dl.Vi)({r:r,g:o,b:e,a:a}))}),n&&(0,x.createElement)(mz,{min:0,max:100,label:"Alpha",abbreviation:"A",value:Math.trunc(100*a),onChange:e=>t((0,Dl.Vi)({r:r,g:o,b:i,a:e/100}))}))},gz=({color:e,onChange:t,enableAlpha:n})=>{const{h:r,s:o,l:i,a:a}=e.toHsl();return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(mz,{min:0,max:359,label:"Hue",abbreviation:"H",value:r,onChange:e=>{t((0,Dl.Vi)({h:e,s:o,l:i,a:a}))}}),(0,x.createElement)(mz,{min:0,max:100,label:"Saturation",abbreviation:"S",value:o,onChange:e=>{t((0,Dl.Vi)({h:r,s:e,l:i,a:a}))}}),(0,x.createElement)(mz,{min:0,max:100,label:"Lightness",abbreviation:"L",value:i,onChange:e=>{t((0,Dl.Vi)({h:r,s:o,l:e,a:a}))}}),n&&(0,x.createElement)(mz,{min:0,max:100,label:"Alpha",abbreviation:"A",value:Math.trunc(100*a),onChange:e=>{t((0,Dl.Vi)({h:r,s:o,l:i,a:e/100}))}}))};var bz=n(263);const vz=({color:e,onChange:t,enableAlpha:n})=>(0,x.createElement)(bz.gs,{prefix:(0,x.createElement)(cD.Z,{as:hM.Z,marginLeft:(0,W_.D)(4),color:N_.D.theme.accent,lineHeight:1},"#"),value:e.toHex().slice(1).toUpperCase(),onChange:e=>{if(!e)return;const n=e.startsWith("#")?e:"#"+e;t((0,Dl.Vi)(n))},maxLength:n?9:7,label:(0,d_.__)("Hex color"),hideLabelFromVision:!0,size:"__unstable-large",__unstableStateReducer:(e,t)=>{const n=t.payload?.event?.nativeEvent;if("insertFromPaste"!==n?.inputType)return{...e};const r=e.value?.startsWith("#")?e.value.slice(1).toUpperCase():e.value?.toUpperCase();return{...e,value:r}},__unstableInputWidth:"9em"}),yz=({colorType:e,color:t,onChange:n,enableAlpha:r})=>{const o={color:t,onChange:n,enableAlpha:r};switch(e){case"hsl":return(0,x.createElement)(gz,{...o});case"rgb":return(0,x.createElement)(fz,{...o});default:return(0,x.createElement)(vz,{...o})}};function _z(){return(_z=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function kz(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}function wz(e){var t=(0,x.useRef)(e),n=(0,x.useRef)((function(e){t.current&&t.current(e)}));return t.current=e,n.current}var Ez=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e<t?t:e},Cz=function(e){return"touches"in e},xz=function(e){return e&&e.ownerDocument.defaultView||self},Sz=function(e,t,n){var r=e.getBoundingClientRect(),o=Cz(t)?function(e,t){for(var n=0;n<e.length;n++)if(e[n].identifier===t)return e[n];return e[0]}(t.touches,n):t;return{left:Ez((o.pageX-(r.left+xz(e).pageXOffset))/r.width),top:Ez((o.pageY-(r.top+xz(e).pageYOffset))/r.height)}},Iz=function(e){!Cz(e)&&e.preventDefault()},Tz=x.memo((function(e){var t=e.onMove,n=e.onKey,r=kz(e,["onMove","onKey"]),o=(0,x.useRef)(null),i=wz(t),a=wz(n),s=(0,x.useRef)(null),l=(0,x.useRef)(!1),c=(0,x.useMemo)((function(){var e=function(e){Iz(e),(Cz(e)?e.touches.length>0:e.buttons>0)&&o.current?i(Sz(o.current,e,s.current)):n(!1)},t=function(){return n(!1)};function n(n){var r=l.current,i=xz(o.current),a=n?i.addEventListener:i.removeEventListener;a(r?"touchmove":"mousemove",e),a(r?"touchend":"mouseup",t)}return[function(e){var t=e.nativeEvent,r=o.current;if(r&&(Iz(t),!function(e,t){return t&&!Cz(e)}(t,l.current)&&r)){if(Cz(t)){l.current=!0;var a=t.changedTouches||[];a.length&&(s.current=a[0].identifier)}r.focus(),i(Sz(r,t,s.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),a({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},n]}),[a,i]),u=c[0],d=c[1],p=c[2];return(0,x.useEffect)((function(){return p}),[p]),x.createElement("div",_z({},r,{onTouchStart:u,onMouseDown:u,className:"react-colorful__interactive",ref:o,onKeyDown:d,tabIndex:0,role:"slider"}))})),Nz=function(e){return e.filter(Boolean).join(" ")},Pz=function(e){var t=e.color,n=e.left,r=e.top,o=void 0===r?.5:r,i=Nz(["react-colorful__pointer",e.className]);return x.createElement("div",{className:i,style:{top:100*o+"%",left:100*n+"%"}},x.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},Rz=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n},Az=(Math.PI,function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:Rz(e.h),s:Rz(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:Rz(o/2),a:Rz(r,2)}}),Bz=function(e){var t=Az(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},Lz=function(e){var t=Az(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},Mz=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),a=r*(1-n),s=r*(1-(t-i)*n),l=r*(1-(1-t+i)*n),c=i%6;return{r:Rz(255*[r,s,a,a,l,r][c]),g:Rz(255*[l,r,r,s,a,a][c]),b:Rz(255*[a,a,l,r,r,s][c]),a:Rz(o,2)}},Dz=function(e){var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?Fz({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}},Oz=Dz,Fz=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=Math.max(t,n,r),a=i-Math.min(t,n,r),s=a?i===t?(n-r)/a:i===n?2+(r-t)/a:4+(t-n)/a:0;return{h:Rz(60*(s<0?s+6:s)),s:Rz(i?a/i*100:0),v:Rz(i/255*100),a:o}},jz=x.memo((function(e){var t=e.hue,n=e.onChange,r=Nz(["react-colorful__hue",e.className]);return x.createElement("div",{className:r},x.createElement(Tz,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:Ez(t+360*e.left,0,360)})},"aria-label":"Hue","aria-valuenow":Rz(t),"aria-valuemax":"360","aria-valuemin":"0"},x.createElement(Pz,{className:"react-colorful__hue-pointer",left:t/360,color:Bz({h:t,s:100,v:100,a:1})})))})),Zz=x.memo((function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:Bz({h:t.h,s:100,v:100,a:1})};return x.createElement("div",{className:"react-colorful__saturation",style:r},x.createElement(Tz,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:Ez(t.s+100*e.left,0,100),v:Ez(t.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Rz(t.s)+"%, Brightness "+Rz(t.v)+"%"},x.createElement(Pz,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:Bz(t)})))})),zz=function(e,t){return e.replace(/\s/g,"")===t.replace(/\s/g,"")};function Vz(e,t,n){var r=wz(n),o=(0,x.useState)((function(){return e.toHsva(t)})),i=o[0],a=o[1],s=(0,x.useRef)({color:t,hsva:i});(0,x.useEffect)((function(){if(!e.equal(t,s.current.color)){var n=e.toHsva(t);s.current={hsva:n,color:t},a(n)}}),[t,e]),(0,x.useEffect)((function(){var t;(function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0})(i,s.current.hsva)||e.equal(t=e.fromHsva(i),s.current.color)||(s.current={hsva:i,color:t},r(t))}),[i,e,r]);var l=(0,x.useCallback)((function(e){a((function(t){return Object.assign({},t,e)}))}),[]);return[i,l]}var Hz="undefined"!=typeof window?x.useLayoutEffect:x.useEffect,Uz=new Map,$z=function(e){Hz((function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!Uz.has(t)){var r=t.createElement("style");r.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',Uz.set(t,r);var o=n.nc;o&&r.setAttribute("nonce",o),t.head.appendChild(r)}}),[])},Wz=function(e){var t=e.className,n=e.colorModel,r=e.color,o=void 0===r?n.defaultColor:r,i=e.onChange,a=kz(e,["className","colorModel","color","onChange"]),s=(0,x.useRef)(null);$z(s);var l=Vz(n,o,i),c=l[0],u=l[1],d=Nz(["react-colorful",t]);return x.createElement("div",_z({},a,{ref:s,className:d}),x.createElement(Zz,{hsva:c,onChange:u}),x.createElement(jz,{hue:c.h,onChange:u,className:"react-colorful__last-control"}))},Gz=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+Lz(Object.assign({},n,{a:0}))+", "+Lz(Object.assign({},n,{a:1}))+")"},i=Nz(["react-colorful__alpha",t]),a=Rz(100*n.a);return x.createElement("div",{className:i},x.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),x.createElement(Tz,{onMove:function(e){r({a:e.left})},onKey:function(e){r({a:Ez(n.a+e.left)})},"aria-label":"Alpha","aria-valuetext":a+"%","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},x.createElement(Pz,{className:"react-colorful__alpha-pointer",left:n.a,color:Lz(n)})))},qz=function(e){var t=e.className,n=e.colorModel,r=e.color,o=void 0===r?n.defaultColor:r,i=e.onChange,a=kz(e,["className","colorModel","color","onChange"]),s=(0,x.useRef)(null);$z(s);var l=Vz(n,o,i),c=l[0],u=l[1],d=Nz(["react-colorful",t]);return x.createElement("div",_z({},a,{ref:s,className:d}),x.createElement(Zz,{hsva:c,onChange:u}),x.createElement(jz,{hue:c.h,onChange:u}),x.createElement(Gz,{hsva:c,onChange:u,className:"react-colorful__last-control"}))},Kz={defaultColor:"rgba(0, 0, 0, 1)",toHsva:Dz,fromHsva:function(e){var t=Mz(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"},equal:zz},Yz=function(e){return x.createElement(qz,_z({},e,{colorModel:Kz}))},Xz={defaultColor:"rgb(0, 0, 0)",toHsva:Oz,fromHsva:function(e){var t=Mz(e);return"rgb("+t.r+", "+t.g+", "+t.b+")"},equal:zz},Jz=function(e){return x.createElement(Wz,_z({},e,{colorModel:Xz}))};const Qz=({color:e,enableAlpha:t,onChange:n})=>{const r=t?Yz:Jz,o=(0,x.useMemo)((()=>e.toRgbString()),[e]);return(0,x.createElement)(r,{color:o,onChange:e=>{n((0,Dl.Vi)(e))}})};(0,Dl.l7)([Ol.Z]);const eV=[{label:"RGB",value:"rgb"},{label:"HSL",value:"hsl"},{label:"Hex",value:"hex"}];var tV=(0,Z_.Iq)(((e,t)=>{const{enableAlpha:n=!1,color:r,onChange:o,defaultValue:i="#fff",copyFormat:a,...s}=(0,j_.y)(e,"ColorPicker"),[l,c]=(0,Bw.O)({onChange:o,value:r,defaultValue:i}),u=(0,x.useMemo)((()=>(0,Dl.Vi)(l||"")),[l]),d=(0,VZ.Z)(c),p=(0,x.useCallback)((e=>{d(e.toHex())}),[d]),[h,m]=(0,x.useState)(a||"hex");return(0,x.createElement)(XZ,{ref:t,...s},(0,x.createElement)(Qz,{onChange:p,color:u,enableAlpha:n}),(0,x.createElement)(qZ,null,(0,x.createElement)(KZ,{justify:"space-between"},(0,x.createElement)($Z,{__nextHasNoMarginBottom:!0,options:eV,value:h,onChange:e=>m(e),label:(0,d_.__)("Color format"),hideLabelFromVision:!0}),(0,x.createElement)(hz,{color:u,colorType:a||h})),(0,x.createElement)(YZ,{direction:"column",gap:2},(0,x.createElement)(yz,{colorType:h,color:u,onChange:p,enableAlpha:n}))))}),"ColorPicker");function nV(e){if(void 0!==e)return"string"==typeof e?e:e.hex?e.hex:void 0}const rV=(0,bp.Z)((e=>{const t=(0,Dl.Vi)(e),n=t.toHex(),r=t.toRgb(),o=t.toHsv(),i=t.toHsl();return{hex:n,rgb:r,hsv:o,hsl:i,source:"hex",oldHue:i.h}}));function oV(e){const{onChangeComplete:t}=e,n=(0,x.useCallback)((e=>{t(rV(e))}),[t]);return function(e){return void 0!==e.onChangeComplete||void 0!==e.disableAlpha||"string"==typeof e.color?.hex}(e)?{color:nV(e.color),enableAlpha:!e.disableAlpha,onChange:n}:{...e,color:e.color,enableAlpha:e.enableAlpha,onChange:e.onChange}}const iV=e=>(0,x.createElement)(tV,{...oV(e)}),aV=(0,x.createContext)({}),sV=new Map,lV=(0,x.forwardRef)((function(e,t){return(0,x.createElement)(Gh.ZP,{...e,ref:t})})),cV=(0,x.forwardRef)((function(e,t){const{id:n,className:r,isSelected:o,context:i,...a}=e,{isComposite:s,...l}=i,c=l,{baseId:u,currentId:d,setCurrentId:p}=c;return(0,x.useEffect)((()=>{!o||d||sV.get(u)||(sV.set(u,!0),p(n))}),[u,d,n,o,p]),(0,x.createElement)($L.A,{...a,...c,as:Gh.ZP,id:n,className:R()(r,{"is-pressed":o}),role:"option","aria-selected":!!o,ref:t})}));function uV(e){const{actions:t,options:n,baseId:r,className:o,loop:i=!0,children:a,...s}=e,l=(0,d_.isRTL)(),c=(0,sM.u)({baseId:r,loop:i,rtl:l}),{setBaseId:u,setLoop:d,setRTL:p}=c;(0,x.useEffect)((()=>{u(r)}),[u,r]),(0,x.useEffect)((()=>{d(i)}),[d,i]),(0,x.useEffect)((()=>{p(l)}),[p,l]);const h={isComposite:!0,...c};return(0,x.createElement)("div",{className:o},(0,x.createElement)(aV.Provider,{value:h},(0,x.createElement)(AM.b,{...s,...c,role:"listbox"},n),a,t))}function dV(e){const{actions:t,options:n,children:r,baseId:o,...i}=e;return(0,x.createElement)("div",{...i},(0,x.createElement)(aV.Provider,{value:{isComposite:!1,baseId:o}},n,r,t))}function pV(e){const{asButtons:t,actions:n,options:r,children:o,className:i,...a}=e,s=(0,cw.Z)(pV,"components-circular-option-picker",a.id),l=t?dV:uV,c=n?(0,x.createElement)("div",{className:"components-circular-option-picker__custom-clear-wrapper"},n):void 0,u=(0,x.createElement)("div",{className:"components-circular-option-picker__swatches"},r);return(0,x.createElement)(l,{...a,baseId:s,className:R()("components-circular-option-picker",i),actions:c,options:u},o)}pV.Option=function e({className:t,isSelected:n,selectedIconProps:r={},tooltipText:o,...i}){const a=(0,x.useContext)(aV),{isComposite:s,baseId:l}=a,c={id:(0,cw.Z)(e,l||"components-circular-option-picker__option"),className:"components-circular-option-picker__option",...i},u=s?(0,x.createElement)(cV,{...c,context:a,isSelected:n}):(0,x.createElement)(lV,{...c,isPressed:n});return(0,x.createElement)("div",{className:R()(t,"components-circular-option-picker__option-wrapper")},o?(0,x.createElement)(Xw.Z,{text:o},u):u,n&&(0,x.createElement)(c_.Z,{icon:u_.Z,...r}))},pV.OptionGroup=function({className:e,options:t,...n}){const r="aria-label"in n||"aria-labelledby"in n?"group":void 0;return(0,x.createElement)("div",{...n,role:r,className:R()("components-circular-option-picker__option-group","components-circular-option-picker__swatches",e)},t)},pV.ButtonAction=function({className:e,children:t,...n}){return(0,x.createElement)(Gh.ZP,{className:R()("components-circular-option-picker__clear",e),variant:"tertiary",...n},t)},pV.DropdownLinkAction=function({buttonProps:e,className:t,dropdownProps:n,linkText:r}){return(0,x.createElement)(pB.Z,{className:R()("components-circular-option-picker__dropdown-link-action",t),renderToggle:({isOpen:t,onToggle:n})=>(0,x.createElement)(Gh.ZP,{"aria-expanded":t,"aria-haspopup":"true",onClick:n,variant:"link",...e},r),...n})};var hV=pV;const mV=(0,g_.default)(EI.Z,{target:"ev9wop70"})({name:"13lxv2o",styles:"text-transform:uppercase;line-height:24px;font-weight:500;&&&{font-size:11px;margin-bottom:0;}"}),fV=(0,g_.default)("div",{target:"eovvns30"})("margin-left:",(0,W_.D)(-2),";margin-right:",(0,W_.D)(-2),";&:first-of-type{margin-top:",(0,W_.D)(-2),";}&:last-of-type{margin-bottom:",(0,W_.D)(-2),";}",(({paddingSize:e="small"})=>{if("none"===e)return;const t={small:(0,W_.D)(2),medium:(0,W_.D)(4)};return(0,b_.css)("padding:",t[e]||t.small,";","")}),";");var gV=(0,Z_.Iq)((function(e,t){const{paddingSize:n="small",...r}=(0,j_.y)(e,"DropdownContentWrapper");return(0,x.createElement)(fV,{...r,paddingSize:n,ref:t})}),"DropdownContentWrapper");(0,Dl.l7)([Ol.Z,Zl]);const bV=e=>e.length>0&&e.every((e=>{return t=e,Array.isArray(t.colors)&&!("color"in t);var t}));function vV({className:e,clearColor:t,colors:n,onChange:r,value:o,...i}){const a=(0,x.useMemo)((()=>n.map((({color:e,name:n},i)=>{const a=(0,Dl.Vi)(e),s=o===e;return(0,x.createElement)(hV.Option,{key:`${e}-${i}`,isSelected:s,selectedIconProps:s?{fill:a.contrast()>a.contrast("#000")?"#fff":"#000"}:{},tooltipText:n||(0,d_.sprintf)((0,d_.__)("Color code: %s"),e),style:{backgroundColor:e,color:e},onClick:s?t:()=>r(e,i),"aria-label":n?(0,d_.sprintf)((0,d_.__)("Color: %s"),n):(0,d_.sprintf)((0,d_.__)("Color code: %s"),e)})}))),[n,o,r,t]);return(0,x.createElement)(hV.OptionGroup,{className:e,options:a,...i})}function yV({className:e,clearColor:t,colors:n,onChange:r,value:o,headingLevel:i}){const a=(0,cw.Z)(yV,"color-palette");return 0===n.length?null:(0,x.createElement)(dM.Z,{spacing:3,className:e},n.map((({name:e,colors:n},s)=>{const l=`${a}-${s}`;return(0,x.createElement)(dM.Z,{spacing:2,key:s},(0,x.createElement)(mV,{id:l,level:i},e),(0,x.createElement)(vV,{clearColor:t,colors:n,onChange:e=>r(e,s),value:o,"aria-labelledby":l}))})))}function _V({isRenderedInSidebar:e,popoverProps:t,...n}){const r=(0,x.useMemo)((()=>({shift:!0,...e?{placement:"left-start",offset:34}:{placement:"bottom",offset:8},...t})),[e,t]);return(0,x.createElement)(pB.Z,{contentClassName:"components-color-palette__custom-color-dropdown-content",popoverProps:r,...n})}(0,Dl.l7)([Ol.Z,Zl]);const kV=(0,x.forwardRef)((function(e,t){const{asButtons:n,loop:r,clearable:o=!0,colors:i=[],disableCustomColors:a=!1,enableAlpha:s=!1,onChange:l,value:c,__experimentalIsRenderedInSidebar:u=!1,headingLevel:d=2,"aria-label":p,"aria-labelledby":h,...m}=e,[f,g]=(0,x.useState)(c),b=(0,x.useCallback)((()=>l(void 0)),[l]),v=(0,x.useCallback)((e=>{g(((e,t)=>{if(!/^var\(/.test(null!=e?e:"")||null===t)return e;const{ownerDocument:n}=t,{defaultView:r}=n,o=r?.getComputedStyle(t).backgroundColor;return o?(0,Dl.Vi)(o).toHex():e})(c,e))}),[c]),y=bV(i),_=(0,x.useMemo)((()=>((e,t=[],n=!1)=>{if(!e)return"";const r=/^var\(/.test(e),o=r?e:(0,Dl.Vi)(e).toHex(),i=n?t:[{colors:t}];for(const{colors:e}of i)for(const{name:t,color:n}of e)if(o===(r?n:(0,Dl.Vi)(n).toHex()))return t;return(0,d_.__)("Custom")})(c,i,y)),[c,i,y]),k=c?.startsWith("#"),w=c?.replace(/^var\((.+)\)$/,"$1"),E=w?(0,d_.sprintf)((0,d_.__)('Custom color picker. The currently selected color is called "%1$s" and has a value of "%2$s".'),_,w):(0,d_.__)("Custom color picker."),C={clearColor:b,onChange:l,value:c},S=!!o&&(0,x.createElement)(hV.ButtonAction,{onClick:b},(0,d_.__)("Clear"));let I;if(n)I={asButtons:!0};else{const e={asButtons:!1,loop:r};I=p?{...e,"aria-label":p}:h?{...e,"aria-labelledby":h}:{...e,"aria-label":(0,d_.__)("Custom color picker.")}}return(0,x.createElement)(dM.Z,{spacing:3,ref:t,...m},!a&&(0,x.createElement)(_V,{isRenderedInSidebar:u,renderContent:()=>(0,x.createElement)(gV,{paddingSize:"none"},(0,x.createElement)(iV,{color:f,onChange:e=>l(e),enableAlpha:s})),renderToggle:({isOpen:e,onToggle:t})=>(0,x.createElement)(dM.Z,{className:"components-color-palette__custom-color-wrapper",spacing:0},(0,x.createElement)("button",{ref:v,className:"components-color-palette__custom-color-button","aria-expanded":e,"aria-haspopup":"true",onClick:t,"aria-label":E,style:{background:c}}),(0,x.createElement)(dM.Z,{className:"components-color-palette__custom-color-text-wrapper",spacing:.5},(0,x.createElement)(HL,{className:"components-color-palette__custom-color-name"},c?_:"No color selected"),(0,x.createElement)(HL,{className:R()("components-color-palette__custom-color-value",{"components-color-palette__custom-color-value--is-hex":k})},w)))}),(0,x.createElement)(hV,{...I,actions:S,options:y?(0,x.createElement)(yV,{...C,headingLevel:d,colors:i,value:c}):(0,x.createElement)(vV,{...C,colors:i,value:c})}))}));var wV=kV;function EV(e){const{border:t,className:n,colors:r=[],enableAlpha:o=!1,enableStyle:i=!0,onChange:a,previousStyleSelection:s,size:l="default",__experimentalIsRenderedInSidebar:c=!1,...u}=(0,j_.y)(e,"BorderControlDropdown"),[d]=WC(t?.width),p=0===d,h=(0,Ak.I)(),m=(0,x.useMemo)((()=>h((e=>(0,b_.css)("background:#fff;&&>button{height:","__unstable-large"===e?"40px":"30px",";width:","__unstable-large"===e?"40px":"30px",";padding:0;display:flex;align-items:center;justify-content:center;",(0,$_.b)({borderRadius:"2px 0 0 2px"},{borderRadius:"0 2px 2px 0"})()," border:",T_.Z.borderWidth," solid ",N_.D.ui.border,";&:focus,&:hover:not( :disabled ){",TZ," border-color:",N_.D.ui.borderFocus,";z-index:1;position:relative;}}",""))(l),n)),[n,h,l]),f=(0,x.useMemo)((()=>h(BZ)),[h]),g=(0,x.useMemo)((()=>h(((e,t)=>{const{style:n}=e||{};return(0,b_.css)("border-radius:9999px;border:2px solid transparent;",n?(e=>{const{color:t,style:n}=e||{},r=n&&"none"!==n?N_.D.gray[300]:void 0;return(0,b_.css)("border-style:","none"===n?"solid":n,";border-color:",t||r,";","")})(e):void 0," width:","__unstable-large"===t?"24px":"22px",";height:","__unstable-large"===t?"24px":"22px",";padding:","__unstable-large"===t?"2px":"1px",";&>span{height:",(0,W_.D)(4),";width:",(0,W_.D)(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,h,l]),b=(0,x.useMemo)((()=>h(RZ)),[h]),v=(0,x.useMemo)((()=>h(AZ)),[h]),y=(0,x.useMemo)((()=>h(LZ)),[h]);return{...u,border:t,className:m,colors:r,enableAlpha:o,enableStyle:i,indicatorClassName:f,indicatorWrapperClassName:g,onColorChange:e=>{a({color:e,style:"none"===t?.style?s:t?.style,width:p&&e?"1px":t?.width})},onStyleChange:e=>{const n=p&&e?"1px":t?.width;a({...t,style:e,width:n})},onReset:()=>{a({...t,color:void 0,style:void 0})},popoverContentClassName:v,popoverControlsClassName:b,resetButtonClassName:y,__experimentalIsRenderedInSidebar:c}}const CV=e=>e.replace(/^var\((.+)\)$/,"$1"),xV=(0,Z_.Iq)(((e,t)=>{const{__experimentalIsRenderedInSidebar:n,border:r,colors:o,disableCustomColors:i,enableAlpha:a,enableStyle:s,indicatorClassName:l,indicatorWrapperClassName:c,onReset:u,onColorChange:d,onStyleChange:p,popoverContentClassName:h,popoverControlsClassName:m,resetButtonClassName:f,showDropdownHeader:g,__unstablePopoverProps:b,...v}=EV(e),{color:y,style:_}=r||{},k=((e,t)=>{if(e&&t){if(bV(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))}})(y,o),w=((e,t,n,r)=>{if(r){if(t){const e=CV(t.color);return n?(0,d_.sprintf)('Border color and style picker. The currently selected color is called "%1$s" and has a value of "%2$s". The currently selected style is "%3$s".',t.name,e,n):(0,d_.sprintf)('Border color and style picker. The currently selected color is called "%1$s" and has a value of "%2$s".',t.name,e)}if(e){const t=CV(e);return n?(0,d_.sprintf)('Border color and style picker. The currently selected color has a value of "%1$s". The currently selected style is "%2$s".',t,n):(0,d_.sprintf)('Border color and style picker. The currently selected color has a value of "%1$s".',t)}return(0,d_.__)("Border color and style picker.")}return t?(0,d_.sprintf)('Border color picker. The currently selected color is called "%1$s" and has a value of "%2$s".',t.name,CV(t.color)):e?(0,d_.sprintf)('Border color picker. The currently selected color has a value of "%1$s".',CV(e)):(0,d_.__)("Border color picker.")})(y,k,_,s),E=y||_&&"none"!==_,C=n?"bottom left":void 0;return(0,x.createElement)(pB.Z,{renderToggle:({onToggle:e})=>(0,x.createElement)(Gh.ZP,{onClick:e,variant:"tertiary","aria-label":w,tooltipPosition:C,label:(0,d_.__)("Border color and style picker"),showTooltip:!0},(0,x.createElement)("span",{className:c},(0,x.createElement)(zZ,{className:l,colorValue:y}))),renderContent:({onClose:e})=>(0,x.createElement)(x.Fragment,null,(0,x.createElement)(gV,{paddingSize:"medium"},(0,x.createElement)(dM.Z,{className:m,spacing:6},g?(0,x.createElement)(wI.Z,null,(0,x.createElement)(w_.ar,null,(0,d_.__)("Border color")),(0,x.createElement)(Gh.ZP,{isSmall:!0,label:(0,d_.__)("Close border color"),icon:EZ.Z,onClick:e})):void 0,(0,x.createElement)(wV,{className:h,value:y,onChange:d,colors:o,disableCustomColors:i,__experimentalIsRenderedInSidebar:n,clearable:!1,enableAlpha:a}),s&&(0,x.createElement)(ZZ,{label:(0,d_.__)("Style"),value:_,onChange:p}))),E&&(0,x.createElement)(gV,{paddingSize:"none"},(0,x.createElement)(Gh.ZP,{className:f,variant:"tertiary",onClick:()=>{u(),e()}},(0,d_.__)("Reset")))),popoverProps:{...b},...v,ref:t})}),"BorderControlDropdown");var SV=xV;const IV=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,x.createElement)(h_.Z,{as:"legend"},t):(0,x.createElement)(w_.ar,{as:"legend"},t):null},TV=(0,Z_.Iq)(((e,t)=>{const{colors:n,disableCustomColors:r,disableUnits:o,enableAlpha:i,enableStyle:a,hideLabelFromVision:s,innerWrapperClassName:l,inputWidth:c,label:u,onBorderChange:d,onSliderChange:p,onWidthChange:h,placeholder:m,__unstablePopoverProps:f,previousStyleSelection:g,showDropdownHeader:b,size:v,sliderClassName:y,value:_,widthUnit:k,widthValue:w,withSlider:E,__experimentalIsRenderedInSidebar:C,...S}=function(e){const{className:t,colors:n=[],isCompact:r,onChange:o,enableAlpha:i=!0,enableStyle:a=!0,shouldSanitizeBorder:s=!0,size:l="default",value:c,width:u,__experimentalIsRenderedInSidebar:d=!1,...p}=(0,j_.y)(e,"BorderControl"),[h,m]=WC(c?.width),f=m||"px",g=0===h,[b,v]=(0,x.useState)(),[y,_]=(0,x.useState)(),k=(0,x.useCallback)((e=>{if(s)return o((e=>{if(void 0!==e?.width&&""!==e.width||void 0!==e?.color)return e})(e));o(e)}),[o,s]),w=(0,x.useCallback)((e=>{const t=""===e?void 0:e,[n]=WC(e),r=0===n,o={...c,width:t};r&&!g&&(v(c?.color),_(c?.style),o.color=void 0,o.style="none"),!r&&g&&(void 0===o.color&&(o.color=b),"none"===o.style&&(o.style=y)),k(o)}),[c,g,b,y,k]),E=(0,x.useCallback)((e=>{w(`${e}${f}`)}),[w,f]),C=(0,Ak.I)(),S=(0,x.useMemo)((()=>C(NZ,t)),[t,C]);let I=u;r&&(I="__unstable-large"===l?"116px":"90px");const T=(0,x.useMemo)((()=>{const e=!!I&&PZ,t=(e=>(0,b_.css)("height:","__unstable-large"===e?"40px":"30px",";",""))(l);return C((0,b_.css)(KC,"{flex:1 1 40%;}&& ",JC,"{min-height:0;}",""),e,t)}),[I,C,l]),N=(0,x.useMemo)((()=>C((0,b_.css)("flex:1 1 60%;",(0,$_.b)({marginRight:(0,W_.D)(3)})(),";",""))),[C]);return{...p,className:S,colors:n,enableAlpha:i,enableStyle:a,innerWrapperClassName:T,inputWidth:I,onBorderChange:k,onSliderChange:E,onWidthChange:w,previousStyleSelection:y,sliderClassName:N,value:c,widthUnit:f,widthValue:h,size:l,__experimentalIsRenderedInSidebar:d}}(e);return(0,x.createElement)(Iw.Z,{as:"fieldset",...S,ref:t},(0,x.createElement)(IV,{label:u,hideLabelFromVision:s}),(0,x.createElement)(wI.Z,{spacing:4,className:l},(0,x.createElement)(rx,{prefix:(0,x.createElement)(SV,{border:_,colors:n,__unstablePopoverProps:f,disableCustomColors:r,enableAlpha:i,enableStyle:a,onChange:d,previousStyleSelection:g,showDropdownHeader:b,__experimentalIsRenderedInSidebar:C,size:v}),label:(0,d_.__)("Border width"),hideLabelFromVision:!0,min:0,onChange:h,value:_?.width||"",placeholder:m,disableUnits:o,__unstableInputWidth:c,size:v}),E&&(0,x.createElement)(CS,{__nextHasNoMarginBottom:!0,label:(0,d_.__)("Border width"),hideLabelFromVision:!0,className:y,initialPosition:0,max:100,min:0,onChange:p,step:["px","%"].includes(k)?1:.1,value:w||void 0,withInputField:!1})))}),"BorderControl");var NV=TV;const PV=(0,Z_.Iq)(((e,t)=>{const{centeredClassName:n,colors:r,disableCustomColors:o,enableAlpha:i,enableStyle:a,onChange:s,popoverPlacement:l,popoverOffset:c,rightAlignedClassName:u,size:d="default",value:p,__experimentalIsRenderedInSidebar:h,...m}=function(e){const{className:t,colors:n=[],enableAlpha:r=!1,enableStyle:o=!0,size:i="default",__experimentalIsRenderedInSidebar:a=!1,...s}=(0,j_.y)(e,"BorderBoxControlSplitControls"),l=(0,Ak.I)(),c=(0,x.useMemo)((()=>l((e=>(0,b_.css)("position:relative;flex:1;width:","__unstable-large"===e?void 0:"80%",";",""))(i),t)),[l,t,i]);return{...s,centeredClassName:(0,x.useMemo)((()=>l(_Z,t)),[l,t]),className:c,colors:n,enableAlpha:r,enableStyle:o,rightAlignedClassName:(0,x.useMemo)((()=>l((0,b_.css)((0,$_.b)({marginLeft:"auto"})(),";",""),t)),[l,t]),size:i,__experimentalIsRenderedInSidebar:a}}(e),[f,g]=(0,x.useState)(null),b=(0,x.useMemo)((()=>l?{placement:l,offset:c,anchor:f,shift:!0}:void 0),[l,c,f]),v={colors:r,disableCustomColors:o,enableAlpha:i,enableStyle:a,isCompact:!0,__experimentalIsRenderedInSidebar:h,size:d},y=(0,Kx.Z)([g,t]);return(0,x.createElement)(ZI,{...m,ref:y,gap:4},(0,x.createElement)(wZ,{value:p,size:d}),(0,x.createElement)(NV,{className:n,hideLabelFromVision:!0,label:(0,d_.__)("Top border"),onChange:e=>s(e,"top"),__unstablePopoverProps:b,value:p?.top,...v}),(0,x.createElement)(NV,{hideLabelFromVision:!0,label:(0,d_.__)("Left border"),onChange:e=>s(e,"left"),__unstablePopoverProps:b,value:p?.left,...v}),(0,x.createElement)(NV,{className:u,hideLabelFromVision:!0,label:(0,d_.__)("Right border"),onChange:e=>s(e,"right"),__unstablePopoverProps:b,value:p?.right,...v}),(0,x.createElement)(NV,{className:n,hideLabelFromVision:!0,label:(0,d_.__)("Bottom border"),onChange:e=>s(e,"bottom"),__unstablePopoverProps:b,value:p?.bottom,...v}))}),"BorderBoxControlSplitControls");var RV=PV;function AV(e){const{className:t,colors:n=[],onChange:r,enableAlpha:o=!1,enableStyle:i=!0,size:a="default",value:s,__experimentalIsRenderedInSidebar:l=!1,...c}=(0,j_.y)(e,"BorderBoxControl"),u=lZ(s),d=sZ(s),p=d?(e=>{if(!e)return;const t=[],n=[],r=[];rZ.forEach((o=>{t.push(e[o]?.color),n.push(e[o]?.style),r.push(e[o]?.width)}));const o=t.every((e=>e===t[0])),i=n.every((e=>e===n[0])),a=r.every((e=>e===r[0]));return{color:o?t[0]:void 0,style:i?n[0]:void 0,width:a?r[0]:uZ(r)}})(s):s,h=d?s:(e=>{if(e&&!iZ(e))return{top:e,right:e,bottom:e,left:e}})(s),m=!isNaN(parseFloat(`${p?.width}`)),[f,g]=(0,x.useState)(!u),b=(0,Ak.I)(),v=(0,x.useMemo)((()=>b(bZ,t)),[b,t]),y=(0,x.useMemo)((()=>b((0,b_.css)("flex:1;",(0,$_.b)({marginRight:"24px"})(),";",""))),[b]),_=(0,x.useMemo)((()=>b(vZ)),[b]);return{...c,className:v,colors:n,disableUnits:u&&!m,enableAlpha:o,enableStyle:i,hasMixedBorders:u,isLinked:f,linkedControlClassName:y,onLinkedChange:e=>{if(!e)return r(void 0);if(!u||(t=e)&&oZ.every((e=>void 0!==t[e])))return r(iZ(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})(p,e),o={top:{...s?.top,...n},right:{...s?.right,...n},bottom:{...s?.bottom,...n},left:{...s?.left,...n}};if(lZ(o))return r(o);const i=iZ(o.top)?void 0:o.top;r(i)},onSplitChange:(e,t)=>{const n={...h,[t]:e};lZ(n)?r(n):r(e)},toggleLinked:()=>g(!f),linkedValue:p,size:a,splitValue:h,wrapperClassName:_,__experimentalIsRenderedInSidebar:l}}const BV=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,x.createElement)(h_.Z,{as:"label"},t):(0,x.createElement)(w_.ar,null,t):null},LV=(0,Z_.Iq)(((e,t)=>{const{className:n,colors:r,disableCustomColors:o,disableUnits:i,enableAlpha:a,enableStyle:s,hasMixedBorders:l,hideLabelFromVision:c,isLinked:u,label:d,linkedControlClassName:p,linkedValue:h,onLinkedChange:m,onSplitChange:f,popoverPlacement:g,popoverOffset:b,size:v,splitValue:y,toggleLinked:_,wrapperClassName:k,__experimentalIsRenderedInSidebar:w,...E}=AV(e),[C,S]=(0,x.useState)(null),I=(0,x.useMemo)((()=>g?{placement:g,offset:b,anchor:C,shift:!0}:void 0),[g,b,C]),T=(0,Kx.Z)([S,t]);return(0,x.createElement)(Iw.Z,{className:n,...E,ref:T},(0,x.createElement)(BV,{label:d,hideLabelFromVision:c}),(0,x.createElement)(Iw.Z,{className:k},u?(0,x.createElement)(NV,{className:p,colors:r,disableUnits:i,disableCustomColors:o,enableAlpha:a,enableStyle:s,onChange:m,placeholder:l?(0,d_.__)("Mixed"):void 0,__unstablePopoverProps:I,shouldSanitizeBorder:!1,value:h,withSlider:!0,width:"__unstable-large"===v?"116px":"110px",__experimentalIsRenderedInSidebar:w,size:v}):(0,x.createElement)(RV,{colors:r,disableCustomColors:o,enableAlpha:a,enableStyle:s,onChange:f,popoverPlacement:g,popoverOffset:b,value:y,__experimentalIsRenderedInSidebar:w,size:v}),(0,x.createElement)(kZ,{onClick:_,isLinked:u,size:v})))}),"BorderBoxControl");var MV=LV;function DV(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function OV(e={}){const{flat:t,...n}=e;return t||DV(Object.values(n).filter(Boolean))||"px"}function FV(e={}){if("string"==typeof e)return e;const t=Object.values(e).map((e=>WC(e))),n=t.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),r=t.map((e=>e[1])),o=n.every((e=>e===n[0]))?n[0]:"",i=DV(r);return 0===o||o?`${o}${i}`:void 0}function jV(e={}){const t=FV(e);return"string"!=typeof e&&isNaN(parseFloat(t))}function ZV(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function zV({onChange:e,selectedUnits:t,setSelectedUnits:n,values:r,...o}){let i=FV(r);void 0===i&&(i=OV(t));const a=ZV(r)&&jV(r),s=a?(0,$.__)("Mixed"):null;return(0,x.createElement)(rx,{...o,"aria-label":(0,$.__)("Border radius"),disableUnits:a,isOnly:!0,value:i,onChange:t=>{const n=!isNaN(parseFloat(t));e(n?t:void 0)},onUnitChange:e=>{n({topLeft:e,topRight:e,bottomLeft:e,bottomRight:e})},placeholder:s,size:"__unstable-large"})}const VV={topLeft:(0,$.__)("Top left"),topRight:(0,$.__)("Top right"),bottomLeft:(0,$.__)("Bottom left"),bottomRight:(0,$.__)("Bottom right")};function HV({onChange:e,selectedUnits:t,setSelectedUnits:n,values:r,...o}){const i=t=>n=>{if(!e)return;const r=isNaN(parseFloat(n))?void 0:n;e({...a,[t]:r})},a="string"!=typeof r?r:{topLeft:r,topRight:r,bottomLeft:r,bottomRight:r};return(0,x.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries(VV).map((([e,r])=>{const[s,l]=WC(a[e]),c=a[e]?l:t[e]||t.flat;return(0,x.createElement)(Xw.Z,{text:r,placement:"top",key:e},(0,x.createElement)("div",{className:"components-border-radius-control__tooltip-wrapper"},(0,x.createElement)(rx,{...o,"aria-label":r,value:[s,c].join(""),onChange:i(e),onUnitChange:(u=e,e=>{const r={...t};r[u]=e,n(r)}),size:"__unstable-large"})));var u})))}var UV=n(4185);function $V({isLinked:e,...t}){const n=e?(0,$.__)("Unlink radii"):(0,$.__)("Link radii");return(0,x.createElement)(Xw.Z,{text:n},(0,x.createElement)(Gh.ZP,{...t,className:"component-border-radius-control__linked-button",isSmall:!0,icon:e?UV.Z:Bj.Z,iconSize:24,"aria-label":n}))}const WV={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},GV=0,qV={px:100,em:20,rem:20};function KV({onChange:e,values:t}){const[n,r]=(0,x.useState)(!ZV(t)||!jV(t)),[o,i]=(0,x.useState)({flat:"string"==typeof t?WC(t)[1]:void 0,topLeft:WC(t?.topLeft)[1],topRight:WC(t?.topRight)[1],bottomLeft:WC(t?.bottomLeft)[1],bottomRight:WC(t?.bottomRight)[1]}),a=GC({availableUnits:YE("spacing.units")||["px","em","rem"]}),s=OV(o),l=a&&a.find((e=>e.value===s)),c=l?.step||1,[u]=WC(FV(t));return(0,x.createElement)("fieldset",{className:"components-border-radius-control"},(0,x.createElement)(uw.ZP.VisualLabel,{as:"legend"},(0,$.__)("Radius")),(0,x.createElement)("div",{className:"components-border-radius-control__wrapper"},n?(0,x.createElement)(x.Fragment,null,(0,x.createElement)(zV,{className:"components-border-radius-control__unit-control",values:t,min:GV,onChange:e,selectedUnits:o,setSelectedUnits:i,units:a}),(0,x.createElement)(CS,{label:(0,$.__)("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:null!=u?u:"",min:GV,max:qV[s],initialPosition:0,withInputField:!1,onChange:t=>{e(void 0!==t?`${t}${s}`:void 0)},step:c,__nextHasNoMarginBottom:!0})):(0,x.createElement)(HV,{min:GV,onChange:e,selectedUnits:o,setSelectedUnits:i,values:t||WV,units:a}),(0,x.createElement)($V,{onClick:()=>r(!n),isLinked:n})))}function YV(e){return[XV(e),JV(e),QV(e),eH(e)].some(Boolean)}function XV(e){return e?.border?.color}function JV(e){return e?.border?.radius}function QV(e){return e?.border?.style}function eH(e){return e?.border?.width}function tH({resetAllFilter:e,onChange:t,value:n,panelId:r,children:o}){return(0,x.createElement)(VI,{label:(0,$.__)("Border"),resetAll:()=>{const r=e(n);t(r)},panelId:r},o)}const nH={radius:!0,color:!0,width:!0};function rH({as:e=tH,value:t,onChange:n,inheritedValue:r=t,settings:o,panelId:i,defaultControls:a=nH}){const s=wC(o),l=e=>{const t=s.flatMap((({colors:e})=>e)).find((({color:t})=>t===e));return t?"var:preset|color|"+t.slug:e},c=(0,x.useCallback)((e=>{const t=s.flatMap((({colors:e})=>e)).find((({slug:t})=>e==="var:preset|color|"+t));return t?t.color:e}),[s]),u=(0,x.useMemo)((()=>{if(sZ(r?.border)){const e={...r?.border};return["top","right","bottom","left"].forEach((t=>{e[t]={...e[t],color:c(e[t]?.color)}})),e}return{...r?.border,color:r?.border?.color?c(r?.border?.color):void 0}}),[r?.border,c]),d=e=>n({...t,border:e}),p=XV(o),h=QV(o),m=eH(o),f=JV(o),g=(b=u?.radius,pC({settings:o},"",b));var b;const v=e=>d({...u,radius:e}),y=()=>{const e=t?.border?.radius;return"object"==typeof e?Object.entries(e).some(Boolean):!!e},_=(0,x.useCallback)((e=>({...e,border:void 0})),[]),k=a?.color||a?.width;return(0,x.createElement)(e,{resetAllFilter:_,value:t,onChange:n,panelId:i},(m||p)&&(0,x.createElement)(_F,{hasValue:()=>aZ(t?.border),label:(0,$.__)("Border"),onDeselect:()=>(()=>{if(y())return d({radius:t?.border?.radius});d(void 0)})(),isShownByDefault:k,panelId:i},(0,x.createElement)(MV,{colors:s,enableAlpha:!0,enableStyle:h,onChange:e=>{const t={...e};sZ(t)?["top","right","bottom","left"].forEach((e=>{t[e]&&(t[e]={...t[e],color:l(t[e]?.color)})})):t&&(t.color=l(t.color)),d({radius:u?.radius,...t})},popoverOffset:40,popoverPlacement:"left-start",value:u,__experimentalIsRenderedInSidebar:!0,size:"__unstable-large"})),f&&(0,x.createElement)(_F,{hasValue:y,label:(0,$.__)("Radius"),onDeselect:()=>v(void 0),isShownByDefault:a.radius,panelId:i},(0,x.createElement)(KV,{values:g,onChange:e=>{v(e||void 0)}})))}const oH="__experimentalBorder",iH=(e,t,n)=>{let r;return e.some((e=>e.colors.some((e=>e[t]===n&&(r=e,!0))))),r},aH=({colors:e,namedColor:t,customColor:n})=>{if(t){const n=iH(e,"slug",t);if(n)return n}if(!n)return{color:void 0};return iH(e,"color",n)||{color:n}};function sH(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function lH(e){if(sZ(e?.border))return{style:e,borderColor:void 0};const t=e?.border?.color,n=t?.startsWith("var:preset|color|")?t.substring(17):void 0,r={...e};return r.border={...r.border,color:n?void 0:t},{style:CC(r),borderColor:n}}function cH(e){return sZ(e.style?.border)?e.style:{...e.style,border:{...e.style?.border,color:e.borderColor?"var:preset|color|"+e.borderColor:e.style?.border?.color}}}function uH({children:e,resetAllFilter:t}){const n=(0,x.useCallback)((e=>{const n=cH(e),r=t(n);return{...e,...lH(r)}}),[t]);return(0,x.createElement)(qI,{group:"border",resetAllFilter:n},e)}function dH(e){const{clientId:t,name:n,attributes:r,setAttributes:o}=e,i=IC(n),a=YV(i),s=(0,x.useMemo)((()=>cH({style:r.style,borderColor:r.borderColor})),[r.style,r.borderColor]);if(!a)return null;const l=cc(e.name,[oH,"__experimentalDefaultControls"]);return(0,x.createElement)(rH,{as:uH,panelId:t,settings:i,value:s,onChange:e=>{o(lH(e))},defaultControls:l})}function pH(e,t="any"){if("web"!==wm.Z.OS)return!1;const n=cc(e,oH);return!0===n||("any"===t?!!(n?.color||n?.radius||n?.width||n?.style):!!n?.[t])}function hH(e,t,n){if(!pH(t,"color")||SC(t,oH,"color"))return e;const r=mH(n),o=R()(e.className,r);return e.className=o||void 0,e}function mH(e){const{borderColor:t,style:n}=e,r=hZ("border-color",t);return R()({"has-border-color":t||n?.border?.color,[r]:!!r})}const fH=(0,Wh.o)((e=>t=>{const{name:n,attributes:r}=t,{borderColor:o,style:i}=r,{colors:a}=mZ();if(!pH(n,"color")||SC(n,oH,"color"))return(0,x.createElement)(e,{...t});const{color:s}=aH({colors:a,namedColor:o}),{color:l}=aH({colors:a,namedColor:sH(i?.border?.top?.color)}),{color:c}=aH({colors:a,namedColor:sH(i?.border?.right?.color)}),{color:u}=aH({colors:a,namedColor:sH(i?.border?.bottom?.color)}),{color:d}=aH({colors:a,namedColor:sH(i?.border?.left?.color)}),p=CC({borderTopColor:l||s,borderRightColor:c||s,borderBottomColor:u||s,borderLeftColor:d||s})||{};let h=t.wrapperProps;return h={...t.wrapperProps,style:{...t.wrapperProps?.style,...p}},(0,x.createElement)(e,{...t,wrapperProps:h})}),"withBorderColorPaletteStyles");(0,mc.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return pH(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,mc.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",hH),(0,mc.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!pH(e,"color")||SC(e,oH,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let r={};return t&&(r=t(n)),hH(r,e,n)},e})),(0,mc.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",fH);var gH=n(55213);const bH=(0,g_.default)("div",{target:"ebn2ljm1"})("&:not( :first-of-type ){",(({offsetAmount:e})=>(0,b_.css)({marginInlineStart:e},"","")),";}",(({zIndex:e})=>(0,b_.css)({zIndex:e},"","")),";");var vH={name:"rs0gp6",styles:"grid-row-start:1;grid-column-start:1"};const yH=(0,g_.default)("div",{target:"ebn2ljm0"})("display:inline-grid;grid-auto-flow:column;position:relative;&>",bH,"{position:relative;justify-self:start;",(({isLayered:e})=>e?vH:void 0),";}"),_H=(0,Z_.Iq)((function(e,t){const{children:n,className:r,isLayered:o=!0,isReversed:i=!1,offset:a=0,...s}=(0,j_.y)(e,"ZStack"),l=(0,gH.W)(n),c=l.length-1,u=l.map(((e,t)=>{const n=i?c-t:t,r=o?a*t:a,s=(0,x.isValidElement)(e)?e.key:t;return(0,x.createElement)(bH,{offsetAmount:r,zIndex:n,key:s},e)}));return(0,x.createElement)(yH,{...s,className:r,isLayered:o,ref:t},u)}),"ZStack");var kH=_H,wH=n(38531);const EH=({__nextHasNoMarginBottom:e})=>e?"":(0,b_.css)("margin-bottom:",(0,W_.D)(2),";",""),CH=(0,g_.default)(ew.Z,{target:"eln3bjz4"})(EH,";"),xH=(0,g_.default)("div",{target:"eln3bjz3"})("border-radius:50%;border:",T_.Z.borderWidth," solid ",N_.D.ui.border,";box-sizing:border-box;cursor:grab;height:",32,"px;overflow:hidden;width:",32,"px;:active{cursor:grabbing;}"),SH=(0,g_.default)("div",{target:"eln3bjz2"})({name:"1r307gh",styles:"box-sizing:border-box;position:relative;width:100%;height:100%;:focus-visible{outline:none;}"}),IH=(0,g_.default)("div",{target:"eln3bjz1"})("background:",N_.D.theme.accent,";border-radius:50%;box-sizing:border-box;display:block;left:50%;top:4px;transform:translateX( -50% );position:absolute;width:",6,"px;height:",6,"px;"),TH=(0,g_.default)(hM.Z,{target:"eln3bjz0"})("color:",N_.D.theme.accent,";margin-right:",(0,W_.D)(3),";");var NH=function({value:e,onChange:t,...n}){const r=(0,x.useRef)(null),o=(0,x.useRef)(),i=(0,x.useRef)(),a=e=>{if(void 0!==e&&(e.preventDefault(),e.target?.focus(),void 0!==o.current&&void 0!==t)){const{x:n,y:r}=o.current;t(function(e,t,n,r){const o=r-t,i=n-e,a=Math.atan2(o,i),s=Math.round(a*(180/Math.PI))+90;return s<0?360+s:s}(n,r,e.clientX,e.clientY))}},{startDrag:s,isDragging:l}=(0,wH.Z)({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,x.useEffect)((()=>{l?(void 0===i.current&&(i.current=document.body.style.cursor),document.body.style.cursor="grabbing"):(document.body.style.cursor=i.current||"",i.current=void 0)}),[l]),(0,x.createElement)(xH,{ref:r,onMouseDown:s,className:"components-angle-picker-control__angle-circle",...n},(0,x.createElement)(SH,{style:e?{transform:`rotate(${e}deg)`}:void 0,className:"components-angle-picker-control__angle-circle-indicator-wrapper",tabIndex:-1},(0,x.createElement)(IH,{className:"components-angle-picker-control__angle-circle-indicator"})))};const PH=(0,x.forwardRef)((function(e,t){const{__nextHasNoMarginBottom:n=!1,className:r,label:o=(0,d_.__)("Angle"),onChange:i,value:a,...s}=e;n||(0,p_.default)("Bottom margin styles for wp.components.AnglePickerControl",{since:"6.1",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."});const l=R()("components-angle-picker-control",r),c=(0,x.createElement)(TH,null,"°"),[u,d]=(0,d_.isRTL)()?[c,null]:[null,c];return(0,x.createElement)(CH,{...s,ref:t,__nextHasNoMarginBottom:n,className:l,gap:2},(0,x.createElement)(pM.Z,null,(0,x.createElement)(qC.Z,{label:o,className:"components-angle-picker-control__input-field",max:360,min:0,onChange:e=>{if(void 0===i)return;const t=void 0!==e&&""!==e?parseInt(e,10):0;i(t)},size:"__unstable-large",step:"1",value:a,spinControls:"none",prefix:u,suffix:d})),(0,x.createElement)(cD.Z,{marginBottom:"1",marginTop:"auto"},(0,x.createElement)(NH,{"aria-hidden":"true",value:a,onChange:i})))}));var RH=PH;const AH=10,BH=0,LH=AH;function MH(e){return Math.max(0,Math.min(100,e))}function DH(e,t,n){const r=e.slice();return r[t]=n,r}function OH(e,t,n){return function(e,t,n,r=BH){const o=e[t].position,i=Math.min(o,n),a=Math.max(o,n);return e.some((({position:e},o)=>o!==t&&(Math.abs(e-n)<r||i<e&&e<a)))}(e,t,n)?e:DH(e,t,{...e[t],position:n})}function FH(e,t,n){return DH(e,t,{...e[t],color:n})}function jH(e,t){if(!t)return;const{x:n,width:r}=t.getBoundingClientRect(),o=e-n;return Math.round(MH(100*o/r))}function ZH({isOpen:e,position:t,color:n,...r}){const o=`components-custom-gradient-picker__control-point-button-description-${(0,cw.Z)(ZH)}`;return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(Gh.ZP,{"aria-label":(0,d_.sprintf)((0,d_.__)("Gradient control point at position %1$s%% with color code %2$s."),t,n),"aria-describedby":o,"aria-haspopup":"true","aria-expanded":e,className:R()("components-custom-gradient-picker__control-point-button",{"is-active":e}),...r}),(0,x.createElement)(h_.Z,{id:o},(0,d_.__)("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 zH({isRenderedInSidebar:e,className:t,...n}){const r=(0,x.useMemo)((()=>({placement:"bottom",offset:8})),[]),o=R()("components-custom-gradient-picker__control-point-dropdown",t);return(0,x.createElement)(_V,{isRenderedInSidebar:e,popoverProps:r,className:o,...n})}function VH({disableRemove:e,disableAlpha:t,gradientPickerDomRef:n,ignoreMarkerPosition:r,value:o,onChange:i,onStartControlPointChange:a,onStopControlPointChange:s,__experimentalIsRenderedInSidebar:l}){const c=(0,x.useRef)(),u=e=>{if(void 0===c.current||null===n.current)return;const t=jH(e.clientX,n.current),{initialPosition:r,index:a,significantMoveHappened:s}=c.current;!s&&Math.abs(r-t)>=5&&(c.current.significantMoveHappened=!0),i(OH(o,a,t))},d=()=>{window&&window.removeEventListener&&c.current&&c.current.listenersActivated&&(window.removeEventListener("mousemove",u),window.removeEventListener("mouseup",d),s(),c.current.listenersActivated=!1)},p=(0,x.useRef)();return p.current=d,(0,x.useEffect)((()=>()=>{p.current?.()}),[]),(0,x.createElement)(x.Fragment,null,o.map(((n,p)=>{const h=n?.position;return r!==h&&(0,x.createElement)(zH,{isRenderedInSidebar:l,key:p,onClose:s,renderToggle:({isOpen:e,onToggle:t})=>(0,x.createElement)(ZH,{key:p,onClick:()=>{c.current&&c.current.significantMoveHappened||(e?s():a(),t())},onMouseDown:()=>{window&&window.addEventListener&&(c.current={initialPosition:h,index:p,significantMoveHappened:!1,listenersActivated:!0},a(),window.addEventListener("mousemove",u),window.addEventListener("mouseup",d))},onKeyDown:e=>{"ArrowLeft"===e.code?(e.stopPropagation(),i(OH(o,p,MH(n.position-LH)))):"ArrowRight"===e.code&&(e.stopPropagation(),i(OH(o,p,MH(n.position+LH))))},isOpen:e,position:n.position,color:n.color}),renderContent:({onClose:r})=>(0,x.createElement)(x.Fragment,null,(0,x.createElement)(iV,{enableAlpha:!t,color:n.color,onChange:e=>{i(FH(o,p,(0,Dl.Vi)(e).toRgbString()))}}),!e&&o.length>2&&(0,x.createElement)(wI.Z,{className:"components-custom-gradient-picker__remove-control-point-wrapper",alignment:"center"},(0,x.createElement)(Gh.ZP,{onClick:()=>{i(function(e,t){return e.filter(((e,n)=>n!==t))}(o,p)),r()},variant:"link"},(0,d_.__)("Remove Control Point")))),style:{left:`${n.position}%`,transform:"translateX( -50% )"}})})))}VH.InsertPoint=function({value:e,onChange:t,onOpenInserter:n,onCloseInserter:r,insertPosition:o,disableAlpha:i,__experimentalIsRenderedInSidebar:a}){const[s,l]=(0,x.useState)(!1);return(0,x.createElement)(zH,{isRenderedInSidebar:a,className:"components-custom-gradient-picker__inserter",onClose:()=>{r()},renderToggle:({isOpen:e,onToggle:t})=>(0,x.createElement)(Gh.ZP,{"aria-expanded":e,"aria-haspopup":"true",onClick:()=>{e?r():(l(!1),n()),t()},className:"components-custom-gradient-picker__insert-point-dropdown",icon:_I.Z}),renderContent:()=>(0,x.createElement)(iV,{enableAlpha:!i,onChange:n=>{s?t(function(e,t,n){const r=e.findIndex((e=>e.position===t));return FH(e,r,n)}(e,o,(0,Dl.Vi)(n).toRgbString())):(t(function(e,t,n){const r=e.findIndex((e=>e.position>t)),o={color:n,position:t},i=e.slice();return i.splice(r-1,0,o),i}(e,o,(0,Dl.Vi)(n).toRgbString())),l(!0))}}),style:null!==o?{left:`${o}%`,transform:"translateX( -50% )"}:void 0})};var HH=VH;const UH=(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},$H={id:"IDLE"};function WH({background:e,hasGradient:t,value:n,onChange:r,disableInserter:o=!1,disableAlpha:i=!1,__experimentalIsRenderedInSidebar:a=!1}){const s=(0,x.useRef)(null),[l,c]=(0,x.useReducer)(UH,$H),u=e=>{if(!s.current)return;const t=jH(e.clientX,s.current);n.some((({position:e})=>Math.abs(t-e)<AH))?"MOVING_INSERTER"===l.id&&c({type:"STOP_INSERTER_MOVE"}):c({type:"MOVE_INSERTER",insertPosition:t})},d="MOVING_INSERTER"===l.id,p="INSERTING_CONTROL_POINT"===l.id;return(0,x.createElement)("div",{className:R()("components-custom-gradient-picker__gradient-bar",{"has-gradient":t}),onMouseEnter:u,onMouseMove:u,onMouseLeave:()=>{c({type:"STOP_INSERTER_MOVE"})}},(0,x.createElement)("div",{className:"components-custom-gradient-picker__gradient-bar-background",style:{background:e,opacity:t?1:.4}}),(0,x.createElement)("div",{ref:s,className:"components-custom-gradient-picker__markers-container"},!o&&(d||p)&&(0,x.createElement)(HH.InsertPoint,{__experimentalIsRenderedInSidebar:a,disableAlpha:i,insertPosition:l.insertPosition,value:n,onChange:r,onOpenInserter:()=>{c({type:"OPEN_INSERTER"})},onCloseInserter:()=>{c({type:"CLOSE_INSERTER"})}}),(0,x.createElement)(HH,{__experimentalIsRenderedInSidebar:a,disableAlpha:i,disableRemove:o,gradientPickerDomRef:s,ignoreMarkerPosition:p?l.insertPosition:void 0,value:n,onChange:r,onStartControlPointChange:()=>{c({type:"START_CONTROL_CHANGE"})},onStopControlPointChange:()=>{c({type:"STOP_CONTROL_CHANGE"})}})))}var GH=n(49963);const qH="linear-gradient(135deg, rgba(6, 147, 227, 1) 0%, rgb(155, 81, 224) 100%)",KH={type:"angular",value:"90"},YH=[{value:"linear-gradient",label:(0,d_.__)("Linear")},{value:"radial-gradient",label:(0,d_.__)("Radial")}],XH={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 JH({type:e,value:t,length:n}){return`${function({type:e,value:t}){return"literal"===e?t:"hex"===e?`#${t}`:`${e}(${t.join(",")})`}({type:e,value:t})} ${function(e){if(!e)return"";const{value:t,type:n}=e;return`${t}${n}`}(n)}`}function QH({type:e,orientation:t,colorStops:n}){const r=function(e){if(!Array.isArray(e)&&e&&"angular"===e.type)return`${e.value}deg`}(t);return`${e}(${[r,...n.sort(((e,t)=>{const n=e=>void 0===e?.length?.value?0:parseInt(e.length.value);return n(e)-n(t)})).map(JH)].filter(Boolean).join(",")})`}function eU(e){return void 0===e.length||"%"!==e.length.type}function tU(e){switch(e.type){case"hex":return`#${e.value}`;case"literal":return e.value;case"rgb":case"rgba":return`${e.type}(${e.value.join(",")})`;default:return"transparent"}}(0,Dl.l7)([Ol.Z]);const nU=(0,g_.default)(pM.Z,{target:"e10bzpgi1"})({name:"1gvx10y",styles:"flex-grow:5"}),rU=(0,g_.default)(pM.Z,{target:"e10bzpgi0"})({name:"1gvx10y",styles:"flex-grow:5"}),oU=({gradientAST:e,hasGradient:t,onChange:n})=>{var r;const o=null!==(r=e?.orientation?.value)&&void 0!==r?r:180;return(0,x.createElement)(RH,{__nextHasNoMarginBottom:!0,onChange:t=>{n(QH({...e,orientation:{type:"angular",value:`${t}`}}))},value:t?o:""})},iU=({gradientAST:e,hasGradient:t,onChange:n})=>{const{type:r}=e;return(0,x.createElement)(HZ.Z,{__nextHasNoMarginBottom:!0,className:"components-custom-gradient-picker__type-picker",label:(0,d_.__)("Type"),labelPosition:"top",onChange:t=>{"linear-gradient"===t&&n(QH({...e,orientation:e.orientation?void 0:KH,type:"linear-gradient"})),"radial-gradient"===t&&(()=>{const{orientation:t,...r}=e;n(QH({...r,type:"radial-gradient"}))})()},options:YH,size:"__unstable-large",value:t?r:void 0})};var aU=function({__nextHasNoMargin:e=!1,value:t,onChange:n,__experimentalIsRenderedInSidebar:r=!1}){const{gradientAST:o,hasGradient:i}=function(e){let t,n=!!e;const r=null!=e?e:qH;try{t=GH.parse(r)[0]}catch(e){console.warn("wp.components.CustomGradientPicker failed to parse the gradient with error",e),t=GH.parse(qH)[0],n=!1}if(Array.isArray(t.orientation)||"directional"!==t.orientation?.type||(t.orientation={type:"angular",value:XH[t.orientation.value].toString()}),t.colorStops.some(eU)){const{colorStops:e}=t,n=100/(e.length-1);e.forEach(((e,t)=>{e.length={value:""+n*t,type:"%"}}))}return{gradientAST:t,hasGradient:n}}(t),a=function(e){return QH({type:"linear-gradient",orientation:KH,colorStops:e.colorStops})}(o),s=o.colorStops.map((e=>({color:tU(e),position:parseInt(e.length.value)})));return e||(0,p_.default)("Outer margin styles for wp.components.CustomGradientPicker",{since:"6.1",version:"6.4",hint:"Set the `__nextHasNoMargin` prop to true to start opting into the new styles, which will become the default in a future version"}),(0,x.createElement)(dM.Z,{spacing:4,className:R()("components-custom-gradient-picker",{"is-next-has-no-margin":e})},(0,x.createElement)(WH,{__experimentalIsRenderedInSidebar:r,background:a,hasGradient:i,value:s,onChange:e=>{n(QH(function(e,t){return{...e,colorStops:t.map((({position:e,color:t})=>{const{r:n,g:r,b:o,a:i}=(0,Dl.Vi)(t).toRgb();return{length:{type:"%",value:e?.toString()},type:i<1?"rgba":"rgb",value:i<1?[`${n}`,`${r}`,`${o}`,`${i}`]:[`${n}`,`${r}`,`${o}`]}}))}}(o,e)))}}),(0,x.createElement)(ew.Z,{gap:3,className:"components-custom-gradient-picker__ui-line"},(0,x.createElement)(nU,null,(0,x.createElement)(iU,{gradientAST:o,hasGradient:i,onChange:n})),(0,x.createElement)(rU,null,"linear-gradient"===o.type&&(0,x.createElement)(oU,{gradientAST:o,hasGradient:i,onChange:n}))))};function sU({className:e,clearGradient:t,gradients:n,onChange:r,value:o,...i}){const a=(0,x.useMemo)((()=>n.map((({gradient:e,name:n},i)=>(0,x.createElement)(hV.Option,{key:e,value:e,isSelected:o===e,tooltipText:n||(0,d_.sprintf)((0,d_.__)("Gradient code: %s"),e),style:{color:"rgba( 0,0,0,0 )",background:e},onClick:o===e?t:()=>r(e,i),"aria-label":n?(0,d_.sprintf)((0,d_.__)("Gradient: %s"),n):(0,d_.sprintf)((0,d_.__)("Gradient code: %s"),e)})))),[n,o,r,t]);return(0,x.createElement)(hV.OptionGroup,{className:e,options:a,...i})}function lU({className:e,clearGradient:t,gradients:n,onChange:r,value:o,headingLevel:i}){const a=(0,cw.Z)(lU);return(0,x.createElement)(dM.Z,{spacing:3,className:e},n.map((({name:e,gradients:n},s)=>{const l=`color-palette-${a}-${s}`;return(0,x.createElement)(dM.Z,{spacing:2,key:s},(0,x.createElement)(mV,{level:i,id:l},e),(0,x.createElement)(sU,{clearGradient:t,gradients:n,onChange:e=>r(e,s),value:o,"aria-labelledby":l}))})))}function cU(e){const{asButtons:t,loop:n,actions:r,headingLevel:o,"aria-label":i,"aria-labelledby":a,...s}=e,l=(c=e.gradients).length>0&&c.every((e=>{return t=e,Array.isArray(t.gradients)&&!("gradient"in t);var t}))?(0,x.createElement)(lU,{headingLevel:o,...s}):(0,x.createElement)(sU,{...s});var c;let u;if(t)u={asButtons:!0};else{const e={asButtons:!1,loop:n};u=i?{...e,"aria-label":i}:a?{...e,"aria-labelledby":a}:{...e,"aria-label":(0,d_.__)("Custom color picker.")}}return(0,x.createElement)(hV,{...u,actions:r,options:l})}var uU=function({__nextHasNoMargin:e=!1,className:t,gradients:n=[],onChange:r,value:o,clearable:i=!0,disableCustomGradients:a=!1,__experimentalIsRenderedInSidebar:s,headingLevel:l=2,...c}){const u=(0,x.useCallback)((()=>r(void 0)),[r]);e||(0,p_.default)("Outer margin styles for wp.components.GradientPicker",{since:"6.1",version:"6.4",hint:"Set the `__nextHasNoMargin` prop to true to start opting into the new styles, which will become the default in a future version"});const d=e?{}:{marginTop:n.length?void 0:3,marginBottom:i?0:6};return(0,x.createElement)(cD.Z,{marginBottom:0,...d},(0,x.createElement)(dM.Z,{spacing:n.length?4:0},!a&&(0,x.createElement)(aU,{__nextHasNoMargin:!0,__experimentalIsRenderedInSidebar:s,value:o,onChange:r}),(n.length||i)&&(0,x.createElement)(cU,{...c,className:t,clearGradient:u,gradients:n,onChange:r,value:o,actions:i&&!a&&(0,x.createElement)(hV.ButtonAction,{onClick:u},(0,d_.__)("Clear")),headingLevel:l})))};const dU=["colors","disableCustomColors","gradients","disableCustomGradients"],pU={name:"color",title:(0,$.__)("Solid"),value:"color"},hU={name:"gradient",title:(0,$.__)("Gradient"),value:"gradient"},mU=[pU,hU];function fU({colors:e,gradients:t,disableCustomColors:n,disableCustomGradients:r,__experimentalIsRenderedInSidebar:o,className:i,label:a,onColorChange:s,onGradientChange:l,colorValue:c,gradientValue:u,clearable:d,showTitle:p=!0,enableAlpha:h,headingLevel:m}){const f=s&&(e&&e.length>0||!n),g=l&&(t&&t.length>0||!r);if(!f&&!g)return null;const b={[pU.value]:(0,x.createElement)(wV,{value:c,onChange:g?e=>{s(e),l()}:s,colors:e,disableCustomColors:n,__experimentalIsRenderedInSidebar:o,clearable:d,enableAlpha:h,headingLevel:m}),[hU.value]:(0,x.createElement)(uU,{__nextHasNoMargin:!0,value:u,onChange:f?e=>{l(e),s()}:l,gradients:t,disableCustomGradients:r,__experimentalIsRenderedInSidebar:o,clearable:d,headingLevel:m})},v=e=>(0,x.createElement)("div",{className:"block-editor-color-gradient-control__panel"},b[e]);return(0,x.createElement)(uw.ZP,{__nextHasNoMarginBottom:!0,className:R()("block-editor-color-gradient-control",i)},(0,x.createElement)("fieldset",{className:"block-editor-color-gradient-control__fieldset"},(0,x.createElement)(dM.Z,{spacing:1},p&&(0,x.createElement)("legend",null,(0,x.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,x.createElement)(uw.ZP.VisualLabel,null,a))),f&&g&&(0,x.createElement)(fO.Z,{className:"block-editor-color-gradient-control__tabs",tabs:mU,initialTabName:u?hU.value:!!f&&pU.value},(e=>v(e.value))),!g&&v(pU.value),!f&&v(hU.value))))}function gU(e){const t={};return t.colors=YE("color.palette"),t.gradients=YE("color.gradients"),t.disableCustomColors=!YE("color.custom"),t.disableCustomGradients=!YE("color.customGradient"),(0,x.createElement)(fU,{...t,...e})}var bU=function(e){return dU.every((t=>e.hasOwnProperty(t)))?(0,x.createElement)(fU,{...e}):(0,x.createElement)(gU,{...e})};function vU(e){const t=yU(e),n=CU(e),r=_U(e),o=wU(e),i=EU(e),a=kU(e);return t||n||r||o||i||a}function yU(e){const t=wC(e);return e?.color?.text&&(t?.length>0||e?.color?.custom)}function _U(e){const t=wC(e);return e?.color?.link&&(t?.length>0||e?.color?.custom)}function kU(e){const t=wC(e);return e?.color?.caption&&(t?.length>0||e?.color?.custom)}function wU(e){const t=wC(e),n=EC(e);return e?.color?.heading&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function EU(e){const t=wC(e),n=EC(e);return e?.color?.button&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function CU(e){const t=wC(e),n=EC(e);return e?.color?.background&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function xU({resetAllFilter:e,onChange:t,value:n,panelId:r,children:o}){return(0,x.createElement)(VI,{label:(0,$.__)("Color"),resetAll:()=>{const r=e(n);t(r)},panelId:r,hasInnerWrapper:!0,className:"color-block-support-panel",__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},(0,x.createElement)("div",{className:"color-block-support-panel__inner-wrapper"},o))}const SU={text:!0,background:!0,link:!0,heading:!0,button:!0,caption:!0},IU={placement:"left-start",offset:36,shift:!0},TU=({indicators:e,label:t})=>(0,x.createElement)(wI.Z,{justify:"flex-start"},(0,x.createElement)(kH,{isLayered:!1,offset:-8},e.map(((e,t)=>(0,x.createElement)(ew.Z,{key:t,expanded:!1},(0,x.createElement)(zZ,{colorValue:e}))))),(0,x.createElement)(tw.Z,{className:"block-editor-panel-color-gradient-settings__color-name",title:t},t));function NU({isGradient:e,inheritedValue:t,userValue:n,setValue:r,colorGradientControlSettings:o}){return(0,x.createElement)(bU,{...o,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:e?void 0:t,gradientValue:e?t:void 0,onColorChange:e?void 0:r,onGradientChange:e?r:void 0,clearable:t===n,headingLevel:3})}function PU({label:e,hasValue:t,resetValue:n,isShownByDefault:r,indicators:o,tabs:i,colorGradientControlSettings:a,panelId:s}){const l=i.map((({key:e,label:t})=>({name:e,title:t})));return(0,x.createElement)(_F,{className:"block-editor-tools-panel-color-gradient-settings__item",hasValue:t,label:e,onDeselect:n,isShownByDefault:r,panelId:s},(0,x.createElement)(pB.Z,{popoverProps:IU,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:({onToggle:t,isOpen:n})=>{const r={onClick:t,className:R()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":n}),"aria-expanded":n,"aria-label":(0,$.sprintf)((0,$.__)("Color %s styles"),e)};return(0,x.createElement)(Gh.ZP,{...r},(0,x.createElement)(TU,{indicators:o,label:e}))},renderContent:()=>(0,x.createElement)(gV,{paddingSize:"none"},(0,x.createElement)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content"},1===i.length&&(0,x.createElement)(NU,{...i[0],colorGradientControlSettings:a}),i.length>1&&(0,x.createElement)(fO.Z,{tabs:l},(e=>{const t=i.find((t=>t.key===e.name));return t?(0,x.createElement)(NU,{...t,colorGradientControlSettings:a}):null}))))}))}function RU({as:e=xU,value:t,onChange:n,inheritedValue:r=t,settings:o,panelId:i,defaultControls:a=SU,children:s}){const l=wC(o),c=EC(o),u=o?.color?.custom,d=o?.color?.customGradient,p=l.length>0||u,h=c.length>0||d,m=e=>pC({settings:o},"",e),f=e=>{const t=l.flatMap((({colors:e})=>e)).find((({color:t})=>t===e));return t?"var:preset|color|"+t.slug:e},g=e=>{const t=c.flatMap((({gradients:e})=>e)).find((({gradient:t})=>t===e));return t?"var:preset|gradient|"+t.slug:e},b=CU(o),v=m(r?.color?.background),y=m(t?.color?.background),_=m(r?.color?.gradient),k=m(t?.color?.gradient),w=_U(o),E=m(r?.elements?.link?.color?.text),C=m(t?.elements?.link?.color?.text),S=m(r?.elements?.link?.[":hover"]?.color?.text),I=m(t?.elements?.link?.[":hover"]?.color?.text),T=yU(o),N=m(r?.color?.text),P=m(t?.color?.text),R=e=>{let r=UE(t,["color","text"],f(e));N===E&&(r=UE(r,["elements","link","color","text"],f(e))),n(r)},A=[{name:"caption",label:(0,$.__)("Captions"),showPanel:kU(o)},{name:"button",label:(0,$.__)("Button"),showPanel:EU(o)},{name:"heading",label:(0,$.__)("Heading"),showPanel:wU(o)},{name:"h1",label:(0,$.__)("H1"),showPanel:wU(o)},{name:"h2",label:(0,$.__)("H2"),showPanel:wU(o)},{name:"h3",label:(0,$.__)("H3"),showPanel:wU(o)},{name:"h4",label:(0,$.__)("H4"),showPanel:wU(o)},{name:"h5",label:(0,$.__)("H5"),showPanel:wU(o)},{name:"h6",label:(0,$.__)("H6"),showPanel:wU(o)}],B=(0,x.useCallback)((e=>({...e,color:void 0,elements:{...e?.elements,link:{...e?.elements?.link,color:void 0,":hover":{color:void 0}},...A.reduce(((t,n)=>({...t,[n.name]:{...e?.elements?.[n.name],color:void 0}})),{})}})),[]),L=[T&&{key:"text",label:(0,$.__)("Text"),hasValue:()=>!!P,resetValue:()=>R(void 0),isShownByDefault:a.text,indicators:[N],tabs:[{key:"text",label:(0,$.__)("Text"),inheritedValue:N,setValue:R,userValue:P}]},b&&{key:"background",label:(0,$.__)("Background"),hasValue:()=>!!y||!!k,resetValue:()=>{const e=UE(t,["color","background"],void 0);e.color.gradient=void 0,n(e)},isShownByDefault:a.background,indicators:[null!=_?_:v],tabs:[p&&{key:"background",label:(0,$.__)("Solid"),inheritedValue:v,setValue:e=>{const r=UE(t,["color","background"],f(e));r.color.gradient=void 0,n(r)},userValue:y},h&&{key:"gradient",label:(0,$.__)("Gradient"),inheritedValue:_,setValue:e=>{const r=UE(t,["color","gradient"],g(e));r.color.background=void 0,n(r)},userValue:k,isGradient:!0}].filter(Boolean)},w&&{key:"link",label:(0,$.__)("Link"),hasValue:()=>!!C||!!I,resetValue:()=>{let e=UE(t,["elements","link",":hover","color","text"],void 0);e=UE(e,["elements","link","color","text"],void 0),n(e)},isShownByDefault:a.link,indicators:[E,S],tabs:[{key:"link",label:(0,$.__)("Default"),inheritedValue:E,setValue:e=>{n(UE(t,["elements","link","color","text"],f(e)))},userValue:C},{key:"hover",label:(0,$.__)("Hover"),inheritedValue:S,setValue:e=>{n(UE(t,["elements","link",":hover","color","text"],f(e)))},userValue:I}]}].filter(Boolean);return A.forEach((({name:e,label:o,showPanel:i})=>{if(!i)return;const s=m(r?.elements?.[e]?.color?.background),l=m(r?.elements?.[e]?.color?.gradient),c=m(r?.elements?.[e]?.color?.text),u=m(t?.elements?.[e]?.color?.background),d=m(t?.elements?.[e]?.color?.gradient),b=m(t?.elements?.[e]?.color?.text),v="caption"!==e;L.push({key:e,label:o,hasValue:()=>!!(b||u||d),resetValue:()=>{const r=UE(t,["elements",e,"color","background"],void 0);r.elements[e].color.gradient=void 0,r.elements[e].color.text=void 0,n(r)},isShownByDefault:a[e],indicators:v?[c,null!=l?l:s]:[c],tabs:[p&&{key:"text",label:(0,$.__)("Text"),inheritedValue:c,setValue:r=>{n(UE(t,["elements",e,"color","text"],f(r)))},userValue:b},p&&v&&{key:"background",label:(0,$.__)("Background"),inheritedValue:s,setValue:r=>{const o=UE(t,["elements",e,"color","background"],f(r));o.elements[e].color.gradient=void 0,n(o)},userValue:u},h&&v&&{key:"gradient",label:(0,$.__)("Gradient"),inheritedValue:l,setValue:r=>{const o=UE(t,["elements",e,"color","gradient"],g(r));o.elements[e].color.background=void 0,n(o)},userValue:d,isGradient:!0}].filter(Boolean)})})),(0,x.createElement)(e,{resetAllFilter:B,value:t,onChange:n,panelId:i},L.map((e=>(0,x.createElement)(PU,{key:e.key,...e,colorGradientControlSettings:{colors:l,disableCustomColors:!u,gradients:c,disableCustomGradients:!d},panelId:i}))),s)}(0,Dl.l7)([Ol.Z,Zl]);var AU=function({backgroundColor:e,fallbackBackgroundColor:t,fallbackTextColor:n,fallbackLinkColor:r,fontSize:o,isLargeText:i,textColor:a,linkColor:s,enableAlphaChecker:l=!1}){const c=e||t;if(!c)return null;const u=a||n,d=s||r;if(!u&&!d)return null;const p=[{color:u,description:(0,$.__)("text color")},{color:d,description:(0,$.__)("link color")}],h=(0,Dl.Vi)(c),m=h.alpha()<1,f=h.brightness(),g={level:"AA",size:i||!1!==i&&o>=24?"large":"small"};let b="",v="";for(const e of p){if(!e.color)continue;const t=(0,Dl.Vi)(e.color),n=t.isReadable(h,g),r=t.alpha()<1;if(!n){if(m||r)continue;b=f<t.brightness()?(0,$.sprintf)((0,$.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,$.sprintf)((0,$.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),e.description),v=(0,$.__)("This color combination may be hard for people to read.");break}r&&l&&(b=(0,$.__)("Transparent text may be hard for people to read."),v=(0,$.__)("Transparent text may be hard for people to read."))}return b?((0,wf.D)(v),(0,x.createElement)("div",{className:"block-editor-contrast-checker"},(0,x.createElement)(AF.Z,{spokenMessage:null,status:"warning",isDismissible:!1},b))):null};function BU(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function LU({clientId:e}){const[t,n]=(0,x.useState)(),[r,o]=(0,x.useState)(),[i,a]=(0,x.useState)(),s=rB(e);return(0,x.useEffect)((()=>{if(!s.current)return;o(BU(s.current).color);const e=s.current?.querySelector("a");e&&e.innerText&&a(BU(e).color);let t=s.current,r=BU(t).backgroundColor;for(;"rgba(0, 0, 0, 0)"===r&&t.parentNode&&t.parentNode.nodeType===t.parentNode.ELEMENT_NODE;)t=t.parentNode,r=BU(t).backgroundColor;n(r)})),(0,x.createElement)(AU,{backgroundColor:t,textColor:r,enableAlphaChecker:!0,linkColor:i})}const MU="color",DU=e=>{const t=cc(e,MU);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},OU=e=>{if("web"!==wm.Z.OS)return!1;const t=cc(e,MU);return null!==t&&"object"==typeof t&&!!t.link},FU=e=>{const t=cc(e,MU);return null!==t&&"object"==typeof t&&!!t.gradients},jU=e=>{const t=cc(e,MU);return t&&!1!==t.background},ZU=e=>{const t=cc(e,MU);return t&&!1!==t.text};function zU(e,t,n){if(!DU(t)||SC(t,MU))return e;const r=FU(t),{backgroundColor:o,textColor:i,gradient:a,style:s}=n,l=e=>!SC(t,MU,e),c=l("text")?hZ("color",i):void 0,u=l("gradients")?function(e){if(e)return`has-${e}-gradient-background`}(a):void 0,d=l("background")?hZ("background-color",o):void 0,p=l("background")||l("gradients"),h=o||s?.color?.background||r&&(a||s?.color?.gradient),m=R()(e.className,c,u,{[d]:!(r&&s?.color?.gradient||!d),"has-text-color":l("text")&&(i||s?.color?.text),"has-background":p&&h,"has-link-color":l("link")&&s?.elements?.link?.color});return e.className=m||void 0,e}function VU(e){const t=e?.color?.text,n=t?.startsWith("var:preset|color|")?t.substring(17):void 0,r=e?.color?.background,o=r?.startsWith("var:preset|color|")?r.substring(17):void 0,i=e?.color?.gradient,a=i?.startsWith("var:preset|gradient|")?i.substring(20):void 0,s={...e};return s.color={...s.color,text:n?void 0:t,background:o?void 0:r,gradient:a?void 0:i},{style:CC(s),textColor:n,backgroundColor:o,gradient:a}}function HU(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 UU({children:e,resetAllFilter:t}){const n=(0,x.useCallback)((e=>{const n=HU(e),r=t(n);return{...e,...VU(r)}}),[t]);return(0,x.createElement)(qI,{group:"color",resetAllFilter:n},e)}function $U(e){const{clientId:t,name:n,attributes:r,setAttributes:o}=e,i=IC(n),a=vU(i),s=(0,x.useMemo)((()=>HU({style:r.style,textColor:r.textColor,backgroundColor:r.backgroundColor,gradient:r.gradient})),[r.style,r.textColor,r.backgroundColor,r.gradient]);if(!a)return null;const l=cc(e.name,[MU,"__experimentalDefaultControls"]),c="web"===wm.Z.OS&&!s?.color?.gradient&&(i?.color?.text||i?.color?.link)&&!1!==cc(e.name,[MU,"enableContrastChecker"]);return(0,x.createElement)(RU,{as:UU,panelId:t,settings:i,value:s,onChange:e=>{o(VU(e))},defaultControls:l,enableContrastChecker:!1!==cc(e.name,[MU,"enableContrastChecker"])},c&&(0,x.createElement)(LU,{clientId:t}))}const WU=(0,Wh.o)((e=>t=>{const{name:n,attributes:r}=t,{backgroundColor:o,textColor:i}=r,a=YE("color.palette.custom"),s=YE("color.palette.theme"),l=YE("color.palette.default"),c=(0,x.useMemo)((()=>[...a||[],...s||[],...l||[]]),[a,s,l]);if(!DU(n)||SC(n,MU))return(0,x.createElement)(e,{...t});const u={};i&&!SC(n,MU,"text")&&(u.color=dZ(c,i)?.color),o&&!SC(n,MU,"background")&&(u.backgroundColor=dZ(c,o)?.color);let d=t.wrapperProps;return d={...t.wrapperProps,style:{...u,...t.wrapperProps?.style}},(0,x.createElement)(e,{...t,wrapperProps:d})}),"withColorPaletteStyles"),GU={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};(0,mc.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return DU(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),FU(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,mc.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",zU),(0,mc.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!DU(e)||SC(e,MU))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let r={};return t&&(r=t(n)),zU(r,e,n)},e})),(0,mc.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",WU),(0,mc.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,r){const o=e.name;return xC({linkColor:OU(o),textColor:ZU(o),backgroundColor:jU(o),gradient:FU(o)},GU,e,t,n,r)}));var qU=n(43389);function KU(e){const[t,...n]=e;if(!t)return null;const[,r]=WC(t.size),o=n.every((e=>{const[,t]=WC(e.size);return t===r}));return o?r:null}const YU=(0,g_.default)("fieldset",{target:"e8tqeku5"})({name:"1t1ytme",styles:"border:0;margin:0;padding:0"}),XU=(0,g_.default)(wI.Z,{target:"e8tqeku4"})("height:",(0,W_.D)(4),";"),JU=(0,g_.default)(Gh.ZP,{target:"e8tqeku3"})("margin-top:",(0,W_.D)(-1),";"),QU=(0,g_.default)(uw.ZP.VisualLabel,{target:"e8tqeku2"})("display:flex;gap:",(0,W_.D)(1),";justify-content:flex-start;margin-bottom:0;"),e$=(0,g_.default)("span",{target:"e8tqeku1"})("color:",N_.D.gray[700],";"),t$=(0,g_.default)("div",{target:"e8tqeku0"})((e=>!e.__nextHasNoMarginBottom&&`margin-bottom: ${(0,W_.D)(6)};`),";"),n$={key:"default",name:(0,d_.__)("Default"),value:void 0},r$={key:"custom",name:(0,d_.__)("Custom")};var o$=e=>{var t;const{fontSizes:n,value:r,disableCustomFontSizes:o,size:i,onChange:a,onSelectCustom:s}=e,l=!!KU(n),c=[n$,...n.map((e=>{let t;if(l){const[n]=WC(e.size);void 0!==n&&(t=String(n))}else(function(e){return/^[\d\.]+(px|em|rem|vw|vh|%)?$/i.test(String(e))})(e.size)&&(t=String(e.size));return{key:e.slug,name:e.name||e.slug,value:e.size,__experimentalHint:t}})),...o?[]:[r$]],u=r?null!==(t=c.find((e=>e.value===r)))&&void 0!==t?t:r$:n$;return(0,x.createElement)(x_,{__nextUnconstrainedWidth:!0,className:"components-font-size-picker__select",label:(0,d_.__)("Font size"),hideLabelFromVision:!0,describedBy:(0,d_.sprintf)((0,d_.__)("Currently selected font size: %s"),u.name),options:c,value:u,__experimentalShowSelectedHint:!0,onChange:({selectedItem:e})=>{e===r$?s():a(e.value)},size:i})},i$=(0,x.forwardRef)((function(e,t){const{label:n,...r}=e,o=r["aria-label"]||n;return(0,x.createElement)(rE,{...r,"aria-label":o,ref:t},n)}));const a$=[(0,d_.__)("S"),(0,d_.__)("M"),(0,d_.__)("L"),(0,d_.__)("XL"),(0,d_.__)("XXL")],s$=[(0,d_.__)("Small"),(0,d_.__)("Medium"),(0,d_.__)("Large"),(0,d_.__)("Extra Large"),(0,d_.__)("Extra Extra Large")];var l$=e=>{const{fontSizes:t,value:n,__nextHasNoMarginBottom:r,size:o,onChange:i}=e;return(0,x.createElement)(Dw,{__nextHasNoMarginBottom:r,label:(0,d_.__)("Font size"),hideLabelFromVision:!0,value:n,onChange:i,isBlock:!0,size:o},t.map(((e,t)=>(0,x.createElement)(i$,{key:e.slug,value:e.size,label:a$[t],"aria-label":e.name||s$[t],showTooltip:!0}))))};const c$=(0,x.forwardRef)(((e,t)=>{const{__nextHasNoMarginBottom:n=!1,fallbackFontSize:r,fontSizes:o=[],disableCustomFontSizes:i=!1,onChange:a,size:s="default",units:l,value:c,withSlider:u=!1,withReset:d=!0}=e;n||(0,p_.default)("Bottom margin styles for wp.components.FontSizePicker",{since:"6.1",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."});const p=GC({availableUnits:l||["px","em","rem"]}),h=o.length>5,m=o.find((e=>e.size===c)),f=!!c&&!m,[g,b]=(0,x.useState)(!i&&f),v=(0,x.useMemo)((()=>{if(g)return(0,d_.__)("Custom");if(!h)return m?m.name||s$[o.indexOf(m)]:"";const e=KU(o);return e?`(${e})`:""}),[g,h,m,o]);if(0===o.length&&i)return null;const y="string"==typeof c||"string"==typeof o[0]?.size,[_,k]=WC(c,p),w=!!k&&["em","rem"].includes(k);return(0,x.createElement)(YU,{ref:t,className:"components-font-size-picker"},(0,x.createElement)(h_.Z,{as:"legend"},(0,d_.__)("Font size")),(0,x.createElement)(cD.Z,null,(0,x.createElement)(XU,{className:"components-font-size-picker__header"},(0,x.createElement)(QU,{"aria-label":`${(0,d_.__)("Size")} ${v||""}`},(0,d_.__)("Size"),v&&(0,x.createElement)(e$,{className:"components-font-size-picker__header__hint"},v)),!i&&(0,x.createElement)(JU,{label:g?(0,d_.__)("Use size preset"):(0,d_.__)("Set custom size"),icon:qU.Z,onClick:()=>{b(!g)},isPressed:g,isSmall:!0}))),(0,x.createElement)(t$,{className:"components-font-size-picker__controls",__nextHasNoMarginBottom:n},!!o.length&&h&&!g&&(0,x.createElement)(o$,{fontSizes:o,value:c,disableCustomFontSizes:i,size:s,onChange:e=>{void 0===e?a?.(void 0):a?.(y?e:Number(e),o.find((t=>t.size===e)))},onSelectCustom:()=>b(!0)}),!h&&!g&&(0,x.createElement)(l$,{fontSizes:o,value:c,__nextHasNoMarginBottom:n,size:s,onChange:e=>{void 0===e?a?.(void 0):a?.(y?e:Number(e),o.find((t=>t.size===e)))}}),!i&&g&&(0,x.createElement)(ew.Z,{className:"components-font-size-picker__custom-size-control"},(0,x.createElement)(tw.Z,{isBlock:!0},(0,x.createElement)(rx,{label:(0,d_.__)("Custom"),labelPosition:"top",hideLabelFromVision:!0,value:c,onChange:e=>{a?.(void 0===e?void 0:y?e:parseInt(e,10))},size:s,units:y?p:[],min:0})),u&&(0,x.createElement)(tw.Z,{isBlock:!0},(0,x.createElement)(cD.Z,{marginX:2,marginBottom:0},(0,x.createElement)(CS,{__nextHasNoMarginBottom:n,className:"components-font-size-picker__custom-input",label:(0,d_.__)("Custom Size"),hideLabelFromVision:!0,value:_,initialPosition:r,withInputField:!1,onChange:e=>{a?.(void 0===e?void 0:y?e+(null!=k?k:"px"):e)},min:0,max:w?10:100,step:w?.1:1}))),d&&(0,x.createElement)(tw.Z,null,(0,x.createElement)(Gh.zx,{disabled:void 0===c,onClick:()=>{a?.(void 0)},variant:"secondary",__next40pxDefaultSize:!0,size:"__unstable-large"!==s?"small":"default"},(0,d_.__)("Reset"))))))}));var u$=c$;function d$({value:e="",onChange:t,fontFamilies:n,...r}){const o=YE("typography.fontFamilies");if(n||(n=o),!n||0===n.length)return null;const i=[{value:"",label:(0,$.__)("Default")},...n.map((({fontFamily:e,name:t})=>({value:e,label:t||e})))];return(0,x.createElement)(HZ.Z,{label:(0,$.__)("Font"),options:i,value:e,onChange:t,labelPosition:"top",...r})}const p$=[{name:(0,$._x)("Regular","font style"),value:"normal"},{name:(0,$._x)("Italic","font style"),value:"italic"}],h$=[{name:(0,$._x)("Thin","font weight"),value:"100"},{name:(0,$._x)("Extra Light","font weight"),value:"200"},{name:(0,$._x)("Light","font weight"),value:"300"},{name:(0,$._x)("Regular","font weight"),value:"400"},{name:(0,$._x)("Medium","font weight"),value:"500"},{name:(0,$._x)("Semi Bold","font weight"),value:"600"},{name:(0,$._x)("Bold","font weight"),value:"700"},{name:(0,$._x)("Extra Bold","font weight"),value:"800"},{name:(0,$._x)("Black","font weight"),value:"900"}],m$=(e,t)=>e?t?(0,$.__)("Appearance"):(0,$.__)("Font style"):(0,$.__)("Font weight");function f$(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:r=!0,value:{fontStyle:o,fontWeight:i},...a}=e,s=n||r,l=m$(n,r),c={key:"default",name:(0,$.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},u=(0,x.useMemo)((()=>n&&r?(()=>{const e=[c];return p$.forEach((({name:t,value:n})=>{h$.forEach((({name:r,value:o})=>{const i="normal"===n?r:(0,$.sprintf)((0,$.__)("%1$s %2$s"),r,t);e.push({key:`${n}-${o}`,name:i,style:{fontStyle:n,fontWeight:o}})}))})),e})():n?(()=>{const e=[c];return p$.forEach((({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:n,fontWeight:void 0}})})),e})():(()=>{const e=[c];return h$.forEach((({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:void 0,fontWeight:n}})})),e})()),[e.options]),d=u.find((e=>e.style.fontStyle===o&&e.style.fontWeight===i))||u[0];return s&&(0,x.createElement)(S_,{...a,className:"components-font-appearance-control",label:l,describedBy:d?n?r?(0,$.sprintf)((0,$.__)("Currently selected font appearance: %s"),d.name):(0,$.sprintf)((0,$.__)("Currently selected font style: %s"),d.name):(0,$.sprintf)((0,$.__)("Currently selected font weight: %s"),d.name):(0,$.__)("No selected font appearance"),options:u,value:d,onChange:({selectedItem:e})=>t(e.style),__nextUnconstrainedWidth:!0})}var g$=({value:e,onChange:t,__nextHasNoMarginBottom:n=!1,__unstableInputWidth:r="60px",...o})=>{const i=function(e){return void 0!==e&&""!==e}(e),a=(e,t)=>{if(i)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return 1.5;default:return e}},s=i?e:"";n||(0,q.Z)("Bottom margin styles for wp.blockEditor.LineHeightControl",{since:"6.0",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"});const l=n?void 0:{marginBottom:24};return(0,x.createElement)("div",{className:"block-editor-line-height-control",style:l},(0,x.createElement)(qC.Z,{...o,__unstableInputWidth:r,__unstableStateReducer:(e,t)=>{const n=["insertText","insertFromPaste"].includes(t.payload.event.nativeEvent?.inputType),r=a(e.value,n);return{...e,value:r}},onChange:(e,{event:n})=>{""!==e?"click"!==n.type?t(`${e}`):t(a(`${e}`,!1)):t()},label:(0,$.__)("Line height"),placeholder:1.5,step:.01,spinFactor:10,value:s,min:0,spinControls:"custom"}))};function b$({value:e,onChange:t,__unstableInputWidth:n="60px",...r}){const o=GC({availableUnits:YE("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,x.createElement)(rx,{...r,label:(0,$.__)("Letter spacing"),value:e,__unstableInputWidth:n,units:o,onChange:t})}var v$=n(80700),y$=n(26719),_$=n(47870),k$=n(14094);const w$=[{name:(0,$.__)("None"),value:"none",icon:v$.Z},{name:(0,$.__)("Uppercase"),value:"uppercase",icon:y$.Z},{name:(0,$.__)("Lowercase"),value:"lowercase",icon:_$.Z},{name:(0,$.__)("Capitalize"),value:"capitalize",icon:k$.Z}];function E$({className:e,value:t,onChange:n}){return(0,x.createElement)("fieldset",{className:R()("block-editor-text-transform-control",e)},(0,x.createElement)(uw.ZP.VisualLabel,{as:"legend"},(0,$.__)("Letter case")),(0,x.createElement)("div",{className:"block-editor-text-transform-control__buttons"},w$.map((e=>(0,x.createElement)(Gh.ZP,{key:e.value,icon:e.icon,label:e.name,isPressed:e.value===t,onClick:()=>{n(e.value===t?void 0:e.value)}})))))}var C$=n(81441),x$=n(92665);const S$=[{name:(0,$.__)("None"),value:"none",icon:v$.Z},{name:(0,$.__)("Underline"),value:"underline",icon:C$.Z},{name:(0,$.__)("Strikethrough"),value:"line-through",icon:x$.Z}];function I$({value:e,onChange:t,className:n}){return(0,x.createElement)("fieldset",{className:R()("block-editor-text-decoration-control",n)},(0,x.createElement)(uw.ZP.VisualLabel,{as:"legend"},(0,$.__)("Decoration")),(0,x.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},S$.map((n=>(0,x.createElement)(Gh.ZP,{key:n.value,icon:n.icon,label:n.name,isPressed:n.value===e,onClick:()=>{t(n.value===e?void 0:n.value)}})))))}var T$=n(31908),N$=n(96011);const P$=[{name:(0,$.__)("Horizontal"),value:"horizontal-tb",icon:T$.Z},{name:(0,$.__)("Vertical"),value:(0,$.isRTL)()?"vertical-lr":"vertical-rl",icon:N$.Z}];function R$({className:e,value:t,onChange:n}){return(0,x.createElement)("fieldset",{className:R()("block-editor-writing-mode-control",e)},(0,x.createElement)(uw.ZP.VisualLabel,{as:"legend"},(0,$.__)("Orientation")),(0,x.createElement)("div",{className:"block-editor-writing-mode-control__buttons"},P$.map((e=>(0,x.createElement)(Gh.ZP,{key:e.value,icon:e.icon,label:e.name,isPressed:e.value===t,onClick:()=>{n(e.value===t?void 0:e.value)}})))))}const A$=1,B$=6;function L$(e){const t=D$(e),n=O$(e),r=F$(e),o=j$(e),i=Z$(e),a=z$(e),s=V$(e),l=H$(e),c=M$(e);return t||n||r||o||i||c||a||s||l}function M$(e){var t,n,r,o;const i=!e?.typography?.customFontSize,a=null!==(t=e?.typography?.fontSizes)&&void 0!==t?t:{},s=[].concat(null!==(n=a?.custom)&&void 0!==n?n:[]).concat(null!==(r=a?.theme)&&void 0!==r?r:[]).concat(null!==(o=a.default)&&void 0!==o?o:[]);return!!s?.length||!i}function D$(e){var t,n,r;const o=e?.typography?.fontFamilies,i=[].concat(null!==(t=o?.custom)&&void 0!==t?t:[]).concat(null!==(n=o?.theme)&&void 0!==n?n:[]).concat(null!==(r=o?.default)&&void 0!==r?r:[]).sort(((e,t)=>(e?.name||e?.slug).localeCompare(t?.name||e?.slug)));return!!i?.length}function O$(e){return e?.typography?.lineHeight}function F$(e){const t=e?.typography?.fontStyle,n=e?.typography?.fontWeight;return t||n}function j$(e){return e?.typography?.letterSpacing}function Z$(e){return e?.typography?.textTransform}function z$(e){return e?.typography?.textDecoration}function V$(e){return e?.typography?.writingMode}function H$(e){return e?.typography?.textColumns}function U$({resetAllFilter:e,onChange:t,value:n,panelId:r,children:o}){return(0,x.createElement)(VI,{label:(0,$.__)("Typography"),resetAll:()=>{const r=e(n);t(r)},panelId:r},o)}const $$={fontFamily:!0,fontSize:!0,fontAppearance:!0,lineHeight:!0,letterSpacing:!0,textTransform:!0,textDecoration:!0,writingMode:!0,textColumns:!0};function W$({as:e=U$,value:t,onChange:n,inheritedValue:r=t,settings:o,panelId:i,defaultControls:a=$$}){var s,l,c;const u=e=>pC({settings:o},"",e),d=D$(o),p=o?.typography?.fontFamilies,h=[].concat(null!==(s=p?.custom)&&void 0!==s?s:[]).concat(null!==(l=p?.theme)&&void 0!==l?l:[]).concat(null!==(c=p?.default)&&void 0!==c?c:[]),m=u(r?.typography?.fontFamily),f=e=>{const r=h?.find((({fontFamily:t})=>t===e))?.slug;n(UE(t,["typography","fontFamily"],r?`var:preset|font-family|${r}`:e||void 0))},g=M$(o),b=!o?.typography?.customFontSize,v=function(e){var t,n,r,o;const i=null!==(t=e?.typography?.fontSizes)&&void 0!==t?t:{};return[].concat(null!==(n=i?.custom)&&void 0!==n?n:[]).concat(null!==(r=i?.theme)&&void 0!==r?r:[]).concat(null!==(o=i.default)&&void 0!==o?o:[]).reduce(((e,t)=>(e.some((({slug:e})=>e===t.slug))||e.push(t),e)),[])}(o),y=u(r?.typography?.fontSize),_=(e,r)=>{n(UE(t,["typography","fontSize"],(r?.slug?`var:preset|font-size|${r?.slug}`:e)||void 0))},k=F$(o),w=function(e){const t=e?.typography?.fontStyle,n=e?.typography?.fontWeight;return t?n?(0,$.__)("Appearance"):(0,$.__)("Font style"):(0,$.__)("Font weight")}(o),E=o?.typography?.fontStyle,C=o?.typography?.fontWeight,S=u(r?.typography?.fontStyle),I=u(r?.typography?.fontWeight),T=({fontStyle:e,fontWeight:r})=>{n({...t,typography:{...t?.typography,fontStyle:e||void 0,fontWeight:r||void 0}})},N=O$(o),P=u(r?.typography?.lineHeight),R=e=>{n(UE(t,["typography","lineHeight"],e||void 0))},A=j$(o),B=u(r?.typography?.letterSpacing),L=e=>{n(UE(t,["typography","letterSpacing"],e||void 0))},M=H$(o),D=u(r?.typography?.textColumns),O=e=>{n(UE(t,["typography","textColumns"],e||void 0))},F=Z$(o),j=u(r?.typography?.textTransform),Z=e=>{n(UE(t,["typography","textTransform"],e||void 0))},z=z$(o),V=u(r?.typography?.textDecoration),H=e=>{n(UE(t,["typography","textDecoration"],e||void 0))},U=V$(o),W=u(r?.typography?.writingMode),G=e=>{n(UE(t,["typography","writingMode"],e||void 0))},q=(0,x.useCallback)((e=>({...e,typography:{}})),[]);return(0,x.createElement)(e,{resetAllFilter:q,value:t,onChange:n,panelId:i},d&&(0,x.createElement)(_F,{label:(0,$.__)("Font family"),hasValue:()=>!!t?.typography?.fontFamily,onDeselect:()=>f(void 0),isShownByDefault:a.fontFamily,panelId:i},(0,x.createElement)(d$,{fontFamilies:h,value:m,onChange:f,size:"__unstable-large",__nextHasNoMarginBottom:!0})),g&&(0,x.createElement)(_F,{label:(0,$.__)("Font size"),hasValue:()=>!!t?.typography?.fontSize,onDeselect:()=>_(void 0),isShownByDefault:a.fontSize,panelId:i},(0,x.createElement)(u$,{value:y,onChange:_,fontSizes:v,disableCustomFontSizes:b,withReset:!1,withSlider:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})),k&&(0,x.createElement)(_F,{className:"single-column",label:w,hasValue:()=>!!t?.typography?.fontStyle||!!t?.typography?.fontWeight,onDeselect:()=>{T({})},isShownByDefault:a.fontAppearance,panelId:i},(0,x.createElement)(f$,{value:{fontStyle:S,fontWeight:I},onChange:T,hasFontStyles:E,hasFontWeights:C,size:"__unstable-large",__nextHasNoMarginBottom:!0})),N&&(0,x.createElement)(_F,{className:"single-column",label:(0,$.__)("Line height"),hasValue:()=>void 0!==t?.typography?.lineHeight,onDeselect:()=>R(void 0),isShownByDefault:a.lineHeight,panelId:i},(0,x.createElement)(g$,{__nextHasNoMarginBottom:!0,__unstableInputWidth:"auto",value:P,onChange:R,size:"__unstable-large"})),A&&(0,x.createElement)(_F,{className:"single-column",label:(0,$.__)("Letter spacing"),hasValue:()=>!!t?.typography?.letterSpacing,onDeselect:()=>L(void 0),isShownByDefault:a.letterSpacing,panelId:i},(0,x.createElement)(b$,{value:B,onChange:L,size:"__unstable-large",__unstableInputWidth:"auto"})),M&&(0,x.createElement)(_F,{className:"single-column",label:(0,$.__)("Text columns"),hasValue:()=>!!t?.typography?.textColumns,onDeselect:()=>O(void 0),isShownByDefault:a.textColumns,panelId:i},(0,x.createElement)(qC.Z,{label:(0,$.__)("Text columns"),max:B$,min:A$,onChange:O,size:"__unstable-large",spinControls:"custom",value:D,initialPosition:1})),z&&(0,x.createElement)(_F,{className:"single-column",label:(0,$.__)("Text decoration"),hasValue:()=>!!t?.typography?.textDecoration,onDeselect:()=>H(void 0),isShownByDefault:a.textDecoration,panelId:i},(0,x.createElement)(I$,{value:V,onChange:H,size:"__unstable-large",__unstableInputWidth:"auto"})),U&&(0,x.createElement)(_F,{className:"single-column",label:(0,$.__)("Text orientation"),hasValue:()=>!!t?.typography?.writingMode,onDeselect:()=>G(void 0),isShownByDefault:a.writingMode,panelId:i},(0,x.createElement)(R$,{value:W,onChange:G,size:"__unstable-large",__nextHasNoMarginBottom:!0})),F&&(0,x.createElement)(_F,{label:(0,$.__)("Letter case"),hasValue:()=>!!t?.typography?.textTransform,onDeselect:()=>Z(void 0),isShownByDefault:a.textTransform,panelId:i},(0,x.createElement)(E$,{value:j,onChange:Z,showNone:!0,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})))}class G${constructor(e=""){this.value=e,this._currentValue,this._valueAsArray}entries(...e){return this._valueAsArray.entries(...e)}forEach(...e){return this._valueAsArray.forEach(...e)}keys(...e){return this._valueAsArray.keys(...e)}values(...e){return this._valueAsArray.values(...e)}get value(){return this._currentValue}set value(e){e=String(e),this._valueAsArray=[...new Set(e.split(/\s+/g).filter(Boolean))],this._currentValue=this._valueAsArray.join(" ")}get length(){return this._valueAsArray.length}toString(){return this.value}*[Symbol.iterator](){return yield*this._valueAsArray}item(e){return this._valueAsArray[e]}contains(e){return-1!==this._valueAsArray.indexOf(e)}add(...e){this.value+=" "+e.join(" ")}remove(...e){this.value=this._valueAsArray.filter((t=>!e.includes(t))).join(" ")}toggle(e,t){return void 0===t&&(t=!this.contains(e)),t?this.add(e):this.remove(e),t}replace(e,t){return!!this.contains(e)&&(this.remove(e),this.add(t),!0)}supports(){return!0}}const q$="typography.__experimentalFontFamily";function K$(e,t,n){if(!uc(t,q$))return e;if(SC(t,nW,"fontFamily"))return e;if(!n?.fontFamily)return e;const r=new G$(e.className);r.add(`has-${VE(n?.fontFamily)}-font-family`);const o=r.value;return e.className=o||void 0,e}function Y$(e){if(e)return`has-${VE(e)}-font-size`}(0,mc.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return uc(e,q$)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,mc.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",K$),(0,mc.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!uc(e,q$))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let r={};return t&&(r=t(n)),K$(r,e,n)},e}));const X$="typography.fontSize";function J$(e,t,n){if(!uc(t,X$))return e;if(SC(t,nW,"fontSize"))return e;const r=new G$(e.className);r.add(Y$(n.fontSize));const o=r.value;return e.className=o||void 0,e}const Q$=(0,Wh.o)((e=>t=>{const n=YE("typography.fontSizes"),{name:r,attributes:{fontSize:o,style:i},wrapperProps:a}=t;if(!uc(r,X$)||SC(r,nW,"fontSize")||!o||i?.typography?.fontSize)return(0,x.createElement)(e,{...t});const s=((e,t,n)=>{if(t){const n=e?.find((({slug:e})=>e===t));if(n)return n}return{size:n}})(n,o,i?.typography?.fontSize).size,l={...t,wrapperProps:{...a,style:{fontSize:s,...a?.style}}};return(0,x.createElement)(e,{...l})}),"withFontSizeInlineStyles"),eW={fontSize:[["fontSize"],["style","typography","fontSize"]]};function tW(e,t){return Object.fromEntries(Object.entries(e).filter((([e])=>!t.includes(e))))}(0,mc.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return uc(e,X$)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,mc.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",J$),(0,mc.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!uc(e,X$))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let r={};return t&&(r=t(n)),J$(r,e,n)},e})),(0,mc.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",Q$),(0,mc.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,r){return xC({fontSize:uc(e.name,X$)},eW,e,t,n,r)})),(0,mc.addFilter)("blocks.registerBlockType","core/font-size/addEditPropsForFluidCustomFontSizes",(function(e){if(!uc(e,X$)||SC(e,nW,"fontSize"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=e=>{const n=t?t(e):{},r=n?.style?.fontSize,o=sC((0,Kl.Y)(e_).getSettings().__experimentalFeatures),i=r?iC({size:r},o):null;return null===i?n:{...n,style:{...n?.style,fontSize:i}}},e}),11);const nW="typography",rW=["typography.lineHeight",X$,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",q$,"typography.textColumns","typography.__experimentalTextDecoration","typography.__experimentalWritingMode","typography.__experimentalTextTransform","typography.__experimentalLetterSpacing"];function oW(e){const t={...tW(e,["fontFamily"])},n=e?.typography?.fontSize,r=e?.typography?.fontFamily,o=n?.startsWith("var:preset|font-size|")?n.substring(21):void 0,i=r?.startsWith("var:preset|font-family|")?r.substring(23):void 0;return t.typography={...tW(t.typography,["fontFamily"]),fontSize:o?void 0:n},{style:CC(t),fontFamily:i,fontSize:o}}function iW(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 aW({children:e,resetAllFilter:t}){const n=(0,x.useCallback)((e=>{const n=iW(e),r=t(n);return{...e,...oW(r)}}),[t]);return(0,x.createElement)(qI,{group:"typography",resetAllFilter:n},e)}function sW({clientId:e,name:t,attributes:n,setAttributes:r,__unstableParentLayout:o}){const i=IC(t,o),a=L$(i),s=(0,x.useMemo)((()=>iW({style:n.style,fontFamily:n.fontFamily,fontSize:n.fontSize})),[n.style,n.fontSize,n.fontFamily]);if(!a)return null;const l=cc(t,[nW,"__experimentalDefaultControls"]);return(0,x.createElement)(W$,{as:aW,panelId:e,settings:i,value:s,onChange:e=>{r(oW(e))},defaultControls:l})}var lW=n(87594);const cW=(0,g_.default)("div",{target:"e1jovhle6"})({name:"14bvcyk",styles:"box-sizing:border-box;max-width:235px;padding-bottom:12px;width:100%"}),uW=(0,g_.default)(ew.Z,{target:"e1jovhle5"})({name:"5bhc30",styles:"margin-bottom:8px"}),dW=(0,g_.default)(ew.Z,{target:"e1jovhle4"})({name:"aujtid",styles:"min-height:30px;gap:0"}),pW=(0,g_.default)("div",{target:"e1jovhle3"})({name:"112jwab",styles:"box-sizing:border-box;max-width:80px"}),hW=(0,g_.default)(ew.Z,{target:"e1jovhle2"})({name:"xy18ro",styles:"justify-content:center;padding-top:8px"}),mW=(0,g_.default)(ew.Z,{target:"e1jovhle1"})({name:"3tw5wk",styles:"position:relative;height:100%;width:100%;justify-content:flex-start"});var fW={name:"1ch9yvl",styles:"border-radius:0"},gW={name:"tg3mx0",styles:"border-radius:2px"};const bW=({isFirst:e,isLast:t,isOnly:n})=>e?(0,$_.b)({borderTopRightRadius:0,borderBottomRightRadius:0})():t?(0,$_.b)({borderTopLeftRadius:0,borderBottomLeftRadius:0})():n?gW:fW,vW=({isFirst:e,isOnly:t})=>{const n=e||t?0:-1;return(0,$_.b)({marginLeft:n})()},yW=(0,g_.default)(rx,{target:"e1jovhle0"})("max-width:60px;",bW,";",vW,";"),_W=()=>{};function kW({isFirst:e,isLast:t,isOnly:n,onHoverOn:r=_W,onHoverOff:o=_W,label:i,value:a,...s}){const l=(0,lW.useHover)((({event:e,...t})=>{t.hovering?r(e,t):o(e,t)}));return(0,x.createElement)(pW,{...l()},(0,x.createElement)(wW,{text:i},(0,x.createElement)(yW,{"aria-label":i,className:"component-box-control__unit-control",isFirst:e,isLast:t,isOnly:n,isPressEnterToChange:!0,isResetValueOnUnitChange:!1,value:a,...s})))}function wW({children:e,text:t}){return t?(0,x.createElement)(Xw.Z,{text:t,placement:"top"},(0,x.createElement)("div",null,e)):e}const EW={all:(0,d_.__)("All"),top:(0,d_.__)("Top"),bottom:(0,d_.__)("Bottom"),left:(0,d_.__)("Left"),right:(0,d_.__)("Right"),mixed:(0,d_.__)("Mixed"),vertical:(0,d_.__)("Vertical"),horizontal:(0,d_.__)("Horizontal")},CW={top:void 0,right:void 0,bottom:void 0,left:void 0},xW=["top","right","bottom","left"];function SW(e){return e.sort(((t,n)=>e.filter((e=>e===t)).length-e.filter((e=>e===n)).length)).pop()}function IW(e={},t,n=xW){const r=function(e){const t=[];if(!e?.length)return xW;if(e.includes("vertical"))t.push("top","bottom");else if(e.includes("horizontal"))t.push("left","right");else{const n=xW.filter((t=>e.includes(t)));t.push(...n)}return t}(n).map((t=>WC(e[t]))),o=r.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),i=r.map((e=>e[1])),a=o.every((e=>e===o[0]))?o[0]:"";let s;var l;return s="number"==typeof a?SW(i):null!==(l=function(e){if(!e||"object"!=typeof e)return;return SW(Object.values(e).filter(Boolean))}(t))&&void 0!==l?l:SW(i),[a,s].join("")}function TW(e={},t,n=xW){const r=IW(e,t,n);return isNaN(parseFloat(r))}function NW(e){return void 0!==e&&Object.values(e).filter((e=>!!e&&/\d/.test(e))).length>0}function PW(e,t){let n="all";return e||(n=t?"vertical":"top"),n}function RW(e,t,n){const r={...e};return n?.length?n.forEach((e=>{"vertical"===e?(r.top=t,r.bottom=t):"horizontal"===e?(r.left=t,r.right=t):r[e]=t})):xW.forEach((e=>r[e]=t)),r}const AW=()=>{};function BW({onChange:e=AW,onFocus:t=AW,onHoverOn:n=AW,onHoverOff:r=AW,values:o,sides:i,selectedUnits:a,setSelectedUnits:s,...l}){const c=IW(o,a,i),u=NW(o)&&TW(o,a,i),d=u?EW.mixed:void 0;return(0,x.createElement)(kW,{...l,disableUnits:u,isOnly:!0,value:c,onChange:t=>{const n=void 0!==t&&!isNaN(parseFloat(t)),r=RW(o,n?t:void 0,i);e(r)},onUnitChange:e=>{const t=RW(a,e,i);s(t)},onFocus:e=>{t(e,{side:"all"})},onHoverOn:()=>{n({top:!0,bottom:!0,left:!0,right:!0})},onHoverOff:()=>{r({top:!1,bottom:!1,left:!1,right:!1})},placeholder:d})}const LW=()=>{};function MW({onChange:e=LW,onFocus:t=LW,onHoverOn:n=LW,onHoverOff:r=LW,values:o,selectedUnits:i,setSelectedUnits:a,sides:s,...l}){const c=e=>n=>{t(n,{side:e})},u=e=>()=>{n({[e]:!0})},d=e=>()=>{r({[e]:!1})},p=t=>(n,{event:r})=>{const i={...o},a=void 0===n||isNaN(parseFloat(n))?void 0:n;if(i[t]=a,r.altKey)switch(t){case"top":i.bottom=a;break;case"bottom":i.top=a;break;case"left":i.right=a;break;case"right":i.left=a}(t=>{e(t)})(i)},h=e=>t=>{const n={...i};n[e]=t,a(n)},m=s?.length?xW.filter((e=>s.includes(e))):xW,f=m[0],g=m[m.length-1],b=f===g&&f;return(0,x.createElement)(hW,{className:"component-box-control__input-controls-wrapper"},(0,x.createElement)(mW,{gap:0,align:"top",className:"component-box-control__input-controls"},m.map((e=>{const[t,n]=WC(o[e]),r=o[e]?n:i[e];return(0,x.createElement)(kW,{...l,isFirst:f===e,isLast:g===e,isOnly:b===e,value:[t,r].join(""),onChange:p(e),onUnitChange:h(e),onFocus:c(e),onHoverOn:u(e),onHoverOff:d(e),label:EW[e],key:`box-control-${e}`})}))))}const DW=["vertical","horizontal"];function OW({onChange:e,onFocus:t,onHoverOn:n,onHoverOff:r,values:o,selectedUnits:i,setSelectedUnits:a,sides:s,...l}){const c=e=>n=>{t&&t(n,{side:e})},u=e=>()=>{n&&("vertical"===e&&n({top:!0,bottom:!0}),"horizontal"===e&&n({left:!0,right:!0}))},d=e=>()=>{r&&("vertical"===e&&r({top:!1,bottom:!1}),"horizontal"===e&&r({left:!1,right:!1}))},p=t=>n=>{if(!e)return;const r={...o},i=void 0===n||isNaN(parseFloat(n))?void 0:n;"vertical"===t&&(r.top=i,r.bottom=i),"horizontal"===t&&(r.left=i,r.right=i),e(r)},h=e=>t=>{const n={...i};"vertical"===e&&(n.top=t,n.bottom=t),"horizontal"===e&&(n.left=t,n.right=t),a(n)},m=s?.length?DW.filter((e=>s.includes(e))):DW,f=m[0],g=m[m.length-1],b=f===g&&f;return(0,x.createElement)(mW,{gap:0,align:"top",className:"component-box-control__vertical-horizontal-input-controls"},m.map((e=>{const[t,n]=WC("vertical"===e?o.top:o.left),r="vertical"===e?i.top:i.left;return(0,x.createElement)(kW,{...l,isFirst:f===e,isLast:g===e,isOnly:b===e,value:[t,null!=r?r:n].join(""),onChange:p(e),onUnitChange:h(e),onFocus:c(e),onHoverOn:u(e),onHoverOff:d(e),label:EW[e],key:e})})))}const FW=(0,g_.default)("span",{target:"e1j5nr4z8"})({name:"1w884gc",styles:"box-sizing:border-box;display:block;width:24px;height:24px;position:relative;padding:4px"}),jW=(0,g_.default)("span",{target:"e1j5nr4z7"})({name:"i6vjox",styles:"box-sizing:border-box;display:block;position:relative;width:100%;height:100%"}),ZW=(0,g_.default)("span",{target:"e1j5nr4z6"})("box-sizing:border-box;display:block;pointer-events:none;position:absolute;",(({isFocused:e})=>(0,b_.css)({backgroundColor:"currentColor",opacity:e?1:.3},"","")),";"),zW=(0,g_.default)(ZW,{target:"e1j5nr4z5"})({name:"1k2w39q",styles:"bottom:3px;top:3px;width:2px"}),VW=(0,g_.default)(ZW,{target:"e1j5nr4z4"})({name:"1q9b07k",styles:"height:2px;left:3px;right:3px"}),HW=(0,g_.default)(VW,{target:"e1j5nr4z3"})({name:"abcix4",styles:"top:0"}),UW=(0,g_.default)(zW,{target:"e1j5nr4z2"})({name:"1wf8jf",styles:"right:0"}),$W=(0,g_.default)(VW,{target:"e1j5nr4z1"})({name:"8tapst",styles:"bottom:0"}),WW=(0,g_.default)(zW,{target:"e1j5nr4z0"})({name:"1ode3cm",styles:"left:0"}),GW=24;function qW({size:e=24,side:t="all",sides:n,...r}){const o=e=>!(e=>n?.length&&!n.includes(e))(e)&&("all"===t||t===e),i=o("top")||o("vertical"),a=o("right")||o("horizontal"),s=o("bottom")||o("vertical"),l=o("left")||o("horizontal"),c=e/GW;return(0,x.createElement)(FW,{style:{transform:`scale(${c})`},...r},(0,x.createElement)(jW,null,(0,x.createElement)(HW,{isFocused:i}),(0,x.createElement)(UW,{isFocused:a}),(0,x.createElement)($W,{isFocused:s}),(0,x.createElement)(WW,{isFocused:l})))}function KW({isLinked:e,...t}){const n=e?(0,d_.__)("Unlink sides"):(0,d_.__)("Link sides");return(0,x.createElement)(Xw.Z,{text:n},(0,x.createElement)(Gh.ZP,{...t,className:"component-box-control__linked-button",isSmall:!0,icon:e?fZ.Z:gZ.Z,iconSize:24,"aria-label":n}))}const YW={min:0},XW=()=>{};var JW=function e({id:t,inputProps:n=YW,onChange:r=XW,label:o=(0,d_.__)("Box Control"),values:i,units:a,sides:s,splitOnAxis:l=!1,allowReset:c=!0,resetValues:u=CW,onMouseOver:d,onMouseOut:p}){const[h,m]=(0,ex.Z)(i,{fallback:CW}),f=h||CW,g=NW(i),b=1===s?.length,[v,y]=(0,x.useState)(g),[_,k]=(0,x.useState)(!g||!TW(f)||b),[w,E]=(0,x.useState)(PW(_,l)),[C,S]=(0,x.useState)({top:WC(i?.top)[1],right:WC(i?.right)[1],bottom:WC(i?.bottom)[1],left:WC(i?.left)[1]}),I=function(t){const n=(0,cw.Z)(e,"inspector-box-control");return t||n}(t),T=`${I}-heading`,N={...n,onChange:e=>{r(e),m(e),y(!0)},onFocus:(e,{side:t})=>{E(t)},isLinked:_,units:a,selectedUnits:C,setSelectedUnits:S,sides:s,values:f,onMouseOver:d,onMouseOut:p};return(0,x.createElement)(cW,{id:I,role:"group","aria-labelledby":T},(0,x.createElement)(uW,{className:"component-box-control__header"},(0,x.createElement)(tw.Z,null,(0,x.createElement)(uw.Xp.VisualLabel,{id:T},o)),c&&(0,x.createElement)(tw.Z,null,(0,x.createElement)(Gh.ZP,{className:"component-box-control__reset-button",variant:"secondary",isSmall:!0,onClick:()=>{r(u),m(u),S(u),y(!1)},disabled:!v},(0,d_.__)("Reset")))),(0,x.createElement)(dW,{className:"component-box-control__header-control-wrapper"},(0,x.createElement)(tw.Z,null,(0,x.createElement)(qW,{side:w,sides:s})),_&&(0,x.createElement)(pM.Z,null,(0,x.createElement)(BW,{"aria-label":o,...N})),!_&&l&&(0,x.createElement)(pM.Z,null,(0,x.createElement)(OW,{...N})),!b&&(0,x.createElement)(tw.Z,null,(0,x.createElement)(KW,{onClick:()=>{k(!_),E(PW(!_,l))},isLinked:_}))),!_&&!l&&(0,x.createElement)(MW,{...N}))},QW=n(88797);const eG={px:{max:300,steps:1},"%":{max:100,steps:1},vw:{max:100,steps:1},vh:{max:100,steps:1},em:{max:10,steps:.1},rm:{max:10,steps:.1}};function tG({icon:e,isMixed:t=!1,minimumCustomValue:n,onChange:r,onMouseOut:o,onMouseOver:i,showSideInLabel:a=!0,side:s,spacingSizes:l,type:c,value:u}){var d,p;u=CE(u,l);let h=l;const m=l.length<=8,f=(0,yl.Z)((e=>{const t=e(e_).getSettings();return t?.disableCustomSpacingSizes})),[g,b]=(0,x.useState)(!f&&void 0!==u&&!EE(u)),v=tD(u);u&&v!==u&&!EE(u)&&!0!==g&&b(!0);const y=GC({availableUnits:YE("spacing.units")||["px","em","rem"]});let _=null;m||g||void 0===u||!(!EE(u)||EE(u)&&t)?t||(_=g?function(e,t){if(!EE(e))return e;const n=SE(e),r=t.find((e=>String(e.slug)===n));return r?.size}(u,l):function(e,t){if(void 0===e)return 0;const n=0===parseFloat(e,10)?"0":SE(e),r=t.findIndex((e=>String(e.slug)===n));return-1!==r?r:NaN}(u,l)):(h=[...l,{name:t?(0,$.__)("Mixed"):(0,$.sprintf)((0,$.__)("Custom (%s)"),u),slug:"custom",size:u}],_=h.length-1);const k=(0,x.useMemo)((()=>WC(_)),[_])[1]||y[0].value,w=parseFloat(_,10),E=(e,t)=>{const n=parseInt(e,10);if("selectList"===t){if(0===n)return;if(1===n)return"0"}else if(0===n)return"0";return`var:preset|spacing|${l[e]?.slug}`},C=t?(0,$.__)("Mixed"):null,S=h.map(((e,t)=>({key:t,name:e.name}))),I=l.map(((e,t)=>({value:t,label:void 0}))),T=vE.includes(s)&&a?kE[s]:"",N=a?c?.toLowerCase():c,P=(0,$.sprintf)((0,$.__)("%1$s %2$s"),T,N).trim();return(0,x.createElement)(wI.Z,{className:"spacing-sizes-control__wrapper"},e&&(0,x.createElement)(V_.Z,{className:"spacing-sizes-control__icon",icon:e,size:24}),g&&(0,x.createElement)(x.Fragment,null,(0,x.createElement)(rx,{onMouseOver:i,onMouseOut:o,onFocus:i,onBlur:o,onChange:e=>r((e=>isNaN(parseFloat(e))?void 0:e)(e)),value:_,units:y,min:n,placeholder:C,disableUnits:t,label:P,hideLabelFromVision:!0,className:"spacing-sizes-control__custom-value-input",size:"__unstable-large"}),(0,x.createElement)(CS,{onMouseOver:i,onMouseOut:o,onFocus:i,onBlur:o,value:w,min:0,max:null!==(d=eG[k]?.max)&&void 0!==d?d:10,step:null!==(p=eG[k]?.steps)&&void 0!==p?p:.1,withInputField:!1,onChange:e=>{r([e,k].join(""))},className:"spacing-sizes-control__custom-value-range",__nextHasNoMarginBottom:!0})),m&&!g&&(0,x.createElement)(CS,{onMouseOver:i,onMouseOut:o,className:"spacing-sizes-control__range-control",value:_,onChange:e=>r(E(e)),onMouseDown:e=>{e?.nativeEvent?.offsetX<35&&void 0===u&&r("0")},withInputField:!1,"aria-valuenow":_,"aria-valuetext":l[_]?.name,renderTooltipContent:e=>void 0===u?void 0:l[e]?.name,min:0,max:l.length-1,marks:I,label:P,hideLabelFromVision:!0,__nextHasNoMarginBottom:!0,onFocus:i,onBlur:o}),!m&&!g&&(0,x.createElement)(S_,{className:"spacing-sizes-control__custom-select-control",value:S.find((e=>e.key===_))||"",onChange:e=>{r(E(e.selectedItem.key,"selectList"))},options:S,label:P,hideLabelFromVision:!0,__nextUnconstrainedWidth:!0,size:"__unstable-large",onMouseOver:i,onMouseOut:o,onFocus:i,onBlur:o}),!f&&(0,x.createElement)(Gh.ZP,{label:g?(0,$.__)("Use size preset"):(0,$.__)("Set custom size"),icon:QW.Z,onClick:()=>{b(!g)},isPressed:g,isSmall:!0,className:"spacing-sizes-control__custom-toggle",iconSize:24}))}const nG=["vertical","horizontal"];function rG({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:r,sides:o,spacingSizes:i,type:a,values:s}){const l=e=>n=>{if(!t)return;const r={...Object.keys(s).reduce(((e,t)=>(e[t]=CE(s[t],i),e)),{})};"vertical"===e&&(r.top=n,r.bottom=n),"horizontal"===e&&(r.left=n,r.right=n),t(r)},c=o?.length?nG.filter((e=>IE(o,e))):nG;return(0,x.createElement)(x.Fragment,null,c.map((t=>{const o="vertical"===t?s.top:s.left;return(0,x.createElement)(tG,{key:`spacing-sizes-control-${t}`,icon:_E[t],label:kE[t],minimumCustomValue:e,onChange:l(t),onMouseOut:n,onMouseOver:r,side:t,spacingSizes:i,type:a,value:o,withInputField:!1})})))}function oG({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:r,sides:o,spacingSizes:i,type:a,values:s}){const l=o?.length?vE.filter((e=>o.includes(e))):vE,c=e=>n=>{const r={...Object.keys(s).reduce(((e,t)=>(e[t]=CE(s[t],i),e)),{})};r[e]=n,t(r)};return(0,x.createElement)(x.Fragment,null,l.map((t=>(0,x.createElement)(tG,{key:`spacing-sizes-control-${t}`,icon:_E[t],label:kE[t],minimumCustomValue:e,onChange:c(t),onMouseOut:n,onMouseOver:r,side:t,spacingSizes:i,type:a,value:s[t],withInputField:!1}))))}function iG({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:r,showSideInLabel:o,side:i,spacingSizes:a,type:s,values:l}){return(0,x.createElement)(tG,{label:kE[i],minimumCustomValue:e,onChange:(c=i,e=>{const n={...Object.keys(l).reduce(((e,t)=>(e[t]=CE(l[t],a),e)),{})};n[c]=e,t(n)}),onMouseOut:n,onMouseOver:r,showSideInLabel:o,side:i,spacingSizes:a,type:s,value:l[i],withInputField:!1});var c}var aG=n(64052);const sG=(0,x.createElement)(V_.Z,{icon:aG.Z,size:24});function lG({label:e,onChange:t,sides:n,value:r}){if(!n||!n.length)return;const o=function(e){if(!e||!e.length)return{};const t={},n=IE(e,"horizontal"),r=IE(e,"vertical");n&&r?t.axial={label:kE.axial,icon:_E.axial}:n?t.axial={label:kE.horizontal,icon:_E.horizontal}:r&&(t.axial={label:kE.vertical,icon:_E.vertical});let o=0;return vE.forEach((n=>{e.includes(n)&&(o+=1,t[n]={label:kE[n],icon:_E[n]})})),o>1&&(t.custom={label:kE.custom,icon:_E.custom}),t}(n),i=o[r].icon,{custom:a,...s}=o;return(0,x.createElement)(em.Z,{icon:i,label:e,className:"spacing-sizes-control__dropdown",toggleProps:{isSmall:!0}},(({onClose:e})=>(0,x.createElement)(x.Fragment,null,(0,x.createElement)($k.Z,null,Object.entries(s).map((([n,{label:o,icon:i}])=>{const a=r===n;return(0,x.createElement)(Wk.Z,{key:n,icon:i,iconPosition:"left",isSelected:a,role:"menuitemradio",onClick:()=>{t(n),e()},suffix:a?sG:void 0},o)}))),!!a&&(0,x.createElement)($k.Z,null,(0,x.createElement)(Wk.Z,{icon:a.icon,iconPosition:"left",isSelected:r===wE.custom,role:"menuitemradio",onClick:()=>{t(wE.custom),e()},suffix:r===wE.custom?sG:void 0},a.label)))))}function cG({inputProps:e,label:t,minimumCustomValue:n=0,onChange:r,onMouseOut:o,onMouseOver:i,showSideInLabel:a=!0,sides:s=vE,useSelect:l,values:c}){const u=function(){const e=[{name:0,slug:"0",size:0},...YE("spacing.spacingSizes")||[]];return e.length>8&&e.unshift({name:(0,$.__)("Default"),slug:"default",size:void 0}),e}(),d=c||yE,p=1===s?.length,h=s?.includes("horizontal")&&s?.includes("vertical")&&2===s?.length,[m,f]=(0,x.useState)(function(e={},t){const{top:n,right:r,bottom:o,left:i}=e,a=[n,r,o,i].filter(Boolean),s=!(n!==o||i!==r||!n&&!i),l=!a.length&&function(e=[]){const t={top:0,right:0,bottom:0,left:0};return e.forEach((e=>t[e]+=1)),(t.top+t.bottom)%2==0&&(t.left+t.right)%2==0}(t);if(IE(t)&&(s||l))return wE.axial;if(1===a.length){let t;return Object.entries(e).some((([e,n])=>(t=e,void 0!==n))),t}return 1!==t?.length||a.length?wE.custom:t[0]}(d,s)),g={...e,minimumCustomValue:n,onChange:e=>{const t={...c,...e};r(t)},onMouseOut:o,onMouseOver:i,sides:s,spacingSizes:u,type:t,useSelect:l,values:d},b=vE.includes(m)&&a?kE[m]:"",v=(0,$.sprintf)((0,$.__)("%1$s %2$s"),t,b).trim(),y=(0,$.sprintf)((0,$._x)("%s options","Button label to reveal side configuration options"),t);return(0,x.createElement)("fieldset",{className:"spacing-sizes-control"},(0,x.createElement)(wI.Z,{className:"spacing-sizes-control__header"},(0,x.createElement)(uw.ZP.VisualLabel,{as:"legend",className:"spacing-sizes-control__label"},v),!p&&!h&&(0,x.createElement)(lG,{label:y,onChange:f,sides:s,value:m})),m===wE.axial?(0,x.createElement)(rG,{...g}):m===wE.custom?(0,x.createElement)(oG,{...g}):(0,x.createElement)(iG,{side:m,...g,showSideInLabel:a}))}const uG={px:{max:1e3,step:1},"%":{max:100,step:1},vw:{max:100,step:1},vh:{max:100,step:1},em:{max:50,step:.1},rem:{max:50,step:.1}};function dG({label:e=(0,$.__)("Height"),onChange:t,value:n}){var r,o;const i=parseFloat(n),a=GC({availableUnits:YE("spacing.units")||["%","px","em","rem","vh","vw"]}),s=(0,x.useMemo)((()=>WC(n)),[n])[1]||a[0]?.value||"px";return(0,x.createElement)("fieldset",{className:"block-editor-height-control"},(0,x.createElement)(uw.ZP.VisualLabel,{as:"legend"},e),(0,x.createElement)(ew.Z,null,(0,x.createElement)(tw.Z,{isBlock:!0},(0,x.createElement)(rx,{value:n,units:a,onChange:t,onUnitChange:e=>{const[r,o]=WC(n);["em","rem"].includes(e)&&"px"===o?t((r/16).toFixed(2)+e):["em","rem"].includes(o)&&"px"===e?t(Math.round(16*r)+e):["vh","vw","%"].includes(e)&&r>100&&t(100+e)},min:0,size:"__unstable-large"})),(0,x.createElement)(tw.Z,{isBlock:!0},(0,x.createElement)(cD.Z,{marginX:2,marginBottom:0},(0,x.createElement)(CS,{value:i,min:0,max:null!==(r=uG[s]?.max)&&void 0!==r?r:100,step:null!==(o=uG[s]?.step)&&void 0!==o?o:.1,withInputField:!1,onChange:e=>{t([e,s].join(""))},__nextHasNoMarginBottom:!0})))))}function pG(e,t){const{orientation:n="horizontal"}=t;return"fill"===e?(0,$.__)("Stretch to fill available space."):"fixed"===e&&"horizontal"===n?(0,$.__)("Specify a fixed width."):"fixed"===e?(0,$.__)("Specify a fixed height."):(0,$.__)("Fit contents.")}function hG({value:e={},onChange:t,parentLayout:n}){const{selfStretch:r,flexSize:o}=e;return(0,x.useEffect)((()=>{"fixed"!==r||o||t({...e,selfStretch:"fit"})}),[]),(0,x.createElement)(x.Fragment,null,(0,x.createElement)(Dw,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:mG(n),value:r||"fit",help:pG(r,n),onChange:n=>{const r="fixed"!==n?null:o;t({...e,selfStretch:n,flexSize:r})},isBlock:!0},(0,x.createElement)(i$,{key:"fit",value:"fit",label:(0,$.__)("Fit")}),(0,x.createElement)(i$,{key:"fill",value:"fill",label:(0,$.__)("Fill")}),(0,x.createElement)(i$,{key:"fixed",value:"fixed",label:(0,$.__)("Fixed")})),"fixed"===r&&(0,x.createElement)(rx,{size:"__unstable-large",onChange:n=>{t({...e,flexSize:n})},value:o}))}function mG(e){const{orientation:t="horizontal"}=e;return"horizontal"===t?(0,$.__)("Width"):(0,$.__)("Height")}const fG=["horizontal","vertical"];function gG(e){const t=bG(e),n=vG(e),r=yG(e),o=_G(e),i=kG(e),a=wG(e),s=EG(e);return"web"===wm.Z.OS&&(t||n||r||o||i||a||s)}function bG(e){return e?.layout?.contentSize}function vG(e){return e?.layout?.wideSize}function yG(e){return e?.spacing?.padding}function _G(e){return e?.spacing?.margin}function kG(e){return e?.spacing?.blockGap}function wG(e){return e?.dimensions?.minHeight}function EG(e){var t;const{type:n="default",default:{type:r="default"}={},allowSizingOnChildren:o=!1}=null!==(t=e?.parentLayout)&&void 0!==t?t:{},i=("flex"===r||"flex"===n)&&o;return!!e?.layout&&i}function CG(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 xG(e){return e&&"string"==typeof e?{top:e,right:e,bottom:e,left:e}:e}function SG({resetAllFilter:e,onChange:t,value:n,panelId:r,children:o}){return(0,x.createElement)(VI,{label:(0,$.__)("Dimensions"),resetAll:()=>{const r=e(n);t(r)},panelId:r},o)}const IG={contentSize:!0,wideSize:!0,padding:!0,margin:!0,blockGap:!0,minHeight:!0,childLayout:!0};function TG({as:e=SG,value:t,onChange:n,inheritedValue:r=t,settings:o,panelId:i,defaultControls:a=IG,onVisualize:s=(()=>{}),includeLayoutControls:l=!1}){var c,u,d,p,h,m,f,g;const{dimensions:b,spacing:v}=o,y=e=>e&&"object"==typeof e?Object.keys(e).reduce(((t,n)=>(t[n]=pC({settings:{dimensions:b,spacing:v}},"",e[n]),t)),{}):pC({settings:{dimensions:b,spacing:v}},"",e),_=function(e){var t,n;const{custom:r,theme:o,default:i}=e?.spacing?.spacingSizes||{};return(null!==(t=null!==(n=null!=r?r:o)&&void 0!==n?n:i)&&void 0!==t?t:[]).length>0}(o),k=GC({availableUnits:o?.spacing?.units||["%","px","em","rem","vw"]}),w=bG(o)&&l,E=y(r?.layout?.contentSize),C=e=>{n(UE(t,["layout","contentSize"],e||void 0))},S=vG(o)&&l,I=y(r?.layout?.wideSize),T=e=>{n(UE(t,["layout","wideSize"],e||void 0))},N=yG(o),P=xG(y(r?.spacing?.padding)),A=Array.isArray(o?.spacing?.padding)?o?.spacing?.padding:o?.spacing?.padding?.sides,B=A&&A.some((e=>fG.includes(e))),L=e=>{const r=CG(e,A);n(UE(t,["spacing","padding"],r))},M=()=>s("padding"),D=_G(o),O=xG(y(r?.spacing?.margin)),F=Array.isArray(o?.spacing?.margin)?o?.spacing?.margin:o?.spacing?.margin?.sides,j=F&&F.some((e=>fG.includes(e))),Z=e=>{const r=CG(e,F);n(UE(t,["spacing","margin"],r))},z=()=>s("margin"),V=kG(o),H=y(r?.spacing?.blockGap),U=function(e){return e&&"string"==typeof e?{top:e}:e?{...e,right:e?.left,bottom:e?.top}:e}(H),W=Array.isArray(o?.spacing?.blockGap)?o?.spacing?.blockGap:o?.spacing?.blockGap?.sides,G=W&&W.some((e=>fG.includes(e))),q=e=>{n(UE(t,["spacing","blockGap"],e))},K=e=>{e||q(null),!G&&e?.hasOwnProperty("top")?q(e.top):q({top:e?.top,left:e?.left})},Y=wG(o),X=y(r?.dimensions?.minHeight),J=e=>{n(UE(t,["dimensions","minHeight"],e))},Q=EG(o),ee=r?.layout,{orientation:te="horizontal"}=null!==(c=o?.parentLayout)&&void 0!==c?c:{},ne="horizontal"===te?(0,$.__)("Width"):(0,$.__)("Height"),re=e=>{n({...t,layout:{...t?.layout,...e}})},oe=(0,x.useCallback)((e=>({...e,layout:CC({...e?.layout,contentSize:void 0,wideSize:void 0,selfStretch:void 0,flexSize:void 0}),spacing:{...e?.spacing,padding:void 0,margin:void 0,blockGap:void 0},dimensions:{...e?.dimensions,minHeight:void 0}})),[]),ie=()=>s(!1);return(0,x.createElement)(e,{resetAllFilter:oe,value:t,onChange:n,panelId:i},(w||S)&&(0,x.createElement)("span",{className:"span-columns"},(0,$.__)("Set the width of the main content area.")),w&&(0,x.createElement)(_F,{className:"single-column",label:(0,$.__)("Content size"),hasValue:()=>!!t?.layout?.contentSize,onDeselect:()=>C(void 0),isShownByDefault:null!==(u=a.contentSize)&&void 0!==u?u:IG.contentSize,panelId:i},(0,x.createElement)(wI.Z,{alignment:"flex-end",justify:"flex-start"},(0,x.createElement)(rx,{label:(0,$.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:E||"",onChange:e=>{C(e)},units:k}),(0,x.createElement)(Iw.Z,null,(0,x.createElement)(ox.Z,{icon:ix.Z})))),S&&(0,x.createElement)(_F,{className:"single-column",label:(0,$.__)("Wide size"),hasValue:()=>!!t?.layout?.wideSize,onDeselect:()=>T(void 0),isShownByDefault:null!==(d=a.wideSize)&&void 0!==d?d:IG.wideSize,panelId:i},(0,x.createElement)(wI.Z,{alignment:"flex-end",justify:"flex-start"},(0,x.createElement)(rx,{label:(0,$.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:I||"",onChange:e=>{T(e)},units:k}),(0,x.createElement)(Iw.Z,null,(0,x.createElement)(ox.Z,{icon:ax.Z})))),N&&(0,x.createElement)(_F,{hasValue:()=>!!t?.spacing?.padding&&Object.keys(t?.spacing?.padding).length,label:(0,$.__)("Padding"),onDeselect:()=>L(void 0),isShownByDefault:null!==(p=a.padding)&&void 0!==p?p:IG.padding,className:R()({"tools-panel-item-spacing":_}),panelId:i},!_&&(0,x.createElement)(JW,{values:P,onChange:L,label:(0,$.__)("Padding"),sides:A,units:k,allowReset:!1,splitOnAxis:B,onMouseOver:M,onMouseOut:ie}),_&&(0,x.createElement)(cG,{values:P,onChange:L,label:(0,$.__)("Padding"),sides:A,units:k,allowReset:!1,onMouseOver:M,onMouseOut:ie})),D&&(0,x.createElement)(_F,{hasValue:()=>!!t?.spacing?.margin&&Object.keys(t?.spacing?.margin).length,label:(0,$.__)("Margin"),onDeselect:()=>Z(void 0),isShownByDefault:null!==(h=a.margin)&&void 0!==h?h:IG.margin,className:R()({"tools-panel-item-spacing":_}),panelId:i},!_&&(0,x.createElement)(JW,{values:O,onChange:Z,label:(0,$.__)("Margin"),sides:F,units:k,allowReset:!1,splitOnAxis:j,onMouseOver:z,onMouseOut:ie}),_&&(0,x.createElement)(cG,{values:O,onChange:Z,label:(0,$.__)("Margin"),sides:F,units:k,allowReset:!1,onMouseOver:z,onMouseOut:ie})),V&&(0,x.createElement)(_F,{hasValue:()=>!!t?.spacing?.blockGap,label:(0,$.__)("Block spacing"),onDeselect:()=>q(void 0),isShownByDefault:null!==(m=a.blockGap)&&void 0!==m?m:IG.blockGap,className:R()({"tools-panel-item-spacing":_}),panelId:i},!_&&(G?(0,x.createElement)(JW,{label:(0,$.__)("Block spacing"),min:0,onChange:K,units:k,sides:W,values:U,allowReset:!1,splitOnAxis:G}):(0,x.createElement)(rx,{label:(0,$.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:q,units:k,value:H})),_&&(0,x.createElement)(cG,{label:(0,$.__)("Block spacing"),min:0,onChange:K,showSideInLabel:!1,sides:G?W:["top"],values:U,allowReset:!1})),Y&&(0,x.createElement)(_F,{hasValue:()=>!!t?.dimensions?.minHeight,label:(0,$.__)("Min. height"),onDeselect:()=>{J(void 0)},isShownByDefault:null!==(f=a.minHeight)&&void 0!==f?f:IG.minHeight,panelId:i},(0,x.createElement)(dG,{label:(0,$.__)("Min. height"),value:X,onChange:J})),Q&&(0,x.createElement)(dM.Z,{as:_F,spacing:2,hasValue:()=>!!t?.layout,label:ne,onDeselect:()=>{re({selfStretch:void 0,flexSize:void 0})},isShownByDefault:null!==(g=a.childLayout)&&void 0!==g?g:IG.childLayout,panelId:i},(0,x.createElement)(hG,{value:ee,onChange:re,parentLayout:o?.parentLayout})))}function NG(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function PG({clientId:e,attributes:t,forceShow:n}){const r=oB(e),[o,i]=(0,x.useState)(),a=t?.style?.spacing?.margin;(0,x.useEffect)((()=>{if(!r||null===r.ownerDocument.defaultView)return;const e=NG(r,"margin-top"),t=NG(r,"margin-right"),n=NG(r,"margin-bottom"),o=NG(r,"margin-left");i({borderTopWidth:e,borderRightWidth:t,borderBottomWidth:n,borderLeftWidth:o,top:e?`-${e}`:0,right:t?`-${t}`:0,bottom:n?`-${n}`:0,left:o?`-${o}`:0})}),[r,a]);const[s,l]=(0,x.useState)(!1),c=(0,x.useRef)(a),u=(0,x.useRef)();return(0,x.useEffect)((()=>((0,O.default)(a,c.current)||n||(l(!0),c.current=a,u.current=setTimeout((()=>{l(!1)}),400)),()=>{l(!1),u.current&&window.clearTimeout(u.current)})),[a,n]),s||n?(0,x.createElement)(MO,{clientId:e,__unstableCoverTarget:!0,__unstableRefreshSize:a,__unstablePopoverSlot:"block-toolbar",shift:!1},(0,x.createElement)("div",{className:"block-editor__padding-visualizer",style:o})):null}function RG(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function AG({clientId:e,attributes:t,forceShow:n}){const r=oB(e),[o,i]=(0,x.useState)(),a=t?.style?.spacing?.padding;(0,x.useEffect)((()=>{r&&null!==r.ownerDocument.defaultView&&i({borderTopWidth:RG(r,"padding-top"),borderRightWidth:RG(r,"padding-right"),borderBottomWidth:RG(r,"padding-bottom"),borderLeftWidth:RG(r,"padding-left")})}),[r,a]);const[s,l]=(0,x.useState)(!1),c=(0,x.useRef)(a),u=(0,x.useRef)();return(0,x.useEffect)((()=>((0,O.default)(a,c.current)||n||(l(!0),c.current=a,u.current=setTimeout((()=>{l(!1)}),400)),()=>{l(!1),u.current&&window.clearTimeout(u.current)})),[a,n]),s||n?(0,x.createElement)(MO,{clientId:e,__unstableCoverTarget:!0,__unstableRefreshSize:a,__unstablePopoverSlot:"block-toolbar",shift:!1},(0,x.createElement)("div",{className:"block-editor__padding-visualizer",style:o})):null}const BG="dimensions",LG="spacing";function MG({children:e,resetAllFilter:t}){const n=(0,x.useCallback)((e=>{const n=e.style,r=t(n);return{...e,style:r}}),[t]);return(0,x.createElement)(qI,{group:"dimensions",resetAllFilter:n},e)}function DG(e){const{clientId:t,name:n,attributes:r,setAttributes:o,__unstableParentLayout:i}=e,a=IC(n,i),s=gG(a),l=r.style,[c,u]=function(){const[e,t]=(0,x.useState)(!1),{hideBlockInterface:n,showBlockInterface:r}=Jy((0,_l.Z)(e_));return(0,x.useEffect)((()=>{e?n():r()}),[e,r,n]),[e,t]}();if(!s)return null;const d={...cc(e.name,[BG,"__experimentalDefaultControls"]),...cc(e.name,[LG,"__experimentalDefaultControls"])};return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(TG,{as:MG,panelId:t,settings:a,value:l,onChange:e=>{o({style:CC(e)})},defaultControls:d,onVisualize:u}),!!a?.spacing?.padding&&(0,x.createElement)(AG,{forceShow:"padding"===c,...e}),!!a?.spacing?.margin&&(0,x.createElement)(PG,{forceShow:"margin"===c,...e}))}const OG=[...rW,oH,MU,BG,Yj,LG],FG=e=>OG.some((t=>uc(e,t)));function jG(e={}){const t={};return Gx(e).forEach((e=>{t[e.key]=e.value})),t}const ZG={[`${oH}.__experimentalSkipSerialization`]:["border"],[`${MU}.__experimentalSkipSerialization`]:[MU],[`${nW}.__experimentalSkipSerialization`]:[nW],[`${BG}.__experimentalSkipSerialization`]:[BG],[`${LG}.__experimentalSkipSerialization`]:[LG]},zG={...ZG,[`${Yj}`]:[Yj]},VG={[`${Yj}`]:!0},HG={gradients:"gradient"};function UG(e,t,n=!1){if(!e)return e;let r=e;return n||(r=JSON.parse(JSON.stringify(e))),Array.isArray(t)||(t=[t]),t.forEach((e=>{if(Array.isArray(e)||(e=e.split(".")),e.length>1){const[t,...n]=e;UG(r[t],[n],!0)}else 1===e.length&&delete r[e[0]]})),r}function $G(e,t,n,r=zG){if(!FG(t))return e;let{style:o}=n;return Object.entries(r).forEach((([e,n])=>{const r=VG[e]||cc(t,e);!0===r&&(o=UG(o,n)),Array.isArray(r)&&r.forEach((e=>{const t=HG[e]||e;o=UG(o,[[...n,t]])}))})),e.style={...jG(o),...e.style},e}const WG=(0,Wh.o)((e=>t=>{if(!FG(t.name))return(0,x.createElement)(e,{key:"edit",...t});const n=a_(),r=GS();return(0,x.createElement)(x.Fragment,null,n&&"default"===r&&(0,x.createElement)(x.Fragment,null,(0,x.createElement)($U,{...t}),(0,x.createElement)(tZ,{...t}),(0,x.createElement)(sW,{...t}),(0,x.createElement)(dH,{...t}),(0,x.createElement)(DG,{...t})),(0,x.createElement)(e,{key:"edit",...t}))}),"withToolbarControls"),GG=[{elementType:"button"},{elementType:"link",pseudo:[":hover"]},{elementType:"heading",elements:["h1","h2","h3","h4","h5","h6"]}],qG=(0,Wh.o)((e=>t=>{const n=`wp-elements-${(0,tT.Z)(e)}`,r=`.editor-styles-wrapper .${n}`,o=t.attributes.style?.elements,i=(0,x.useMemo)((()=>{if(!o)return;const e=[];return GG.forEach((({elementType:n,pseudo:i,elements:a})=>{if(SC(t.name,MU,n))return;const s=o?.[n];if(s){const t=hC(r,Gl[n]);e.push(Wx(s,{selector:t})),i&&i.forEach((t=>{s[t]&&e.push(Wx(s[t],{selector:hC(r,`${Gl[n]}${t}`)}))}))}a&&a.forEach((t=>{o[t]&&e.push(Wx(o[t],{selector:hC(r,Gl[t])}))}))})),e.length>0?e.join(""):void 0}),[r,o,t.name]),a=(0,x.useContext)(fF.__unstableElementContext);return(0,x.createElement)(x.Fragment,null,i&&a&&(0,eT.createPortal)((0,x.createElement)("style",{dangerouslySetInnerHTML:{__html:i}}),a),(0,x.createElement)(e,{...t,className:t.attributes.style?.elements?R()(t.className,n):t.className}))}),"withElementsStyles");(0,mc.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return FG(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,mc.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",$G),(0,mc.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!FG(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let r={};return t&&(r=t(n)),$G(r,e,n,ZG)},e})),(0,mc.addFilter)("editor.BlockEdit","core/style/with-block-controls",WG),(0,mc.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",qG),(0,mc.addFilter)("blocks.registerBlockType","core/settings/addAttribute",(function(e){return uc(e,"__experimentalSettings",!1)?(e?.attributes?.settings||(e.attributes={...e.attributes,settings:{type:"object"}}),e):e}));var KG=n(35266);function YG(e=[],t="90deg"){const n=100/e.length,r=e.map(((e,t)=>`${e} ${t*n}%, ${e} ${(t+1)*n}%`)).join(", ");return`linear-gradient( ${t}, ${r} )`}(0,Dl.l7)([Ol.Z]);var XG=function({values:e}){return e?(0,x.createElement)(zZ,{colorValue:YG(e,"135deg")}):(0,x.createElement)(V_.Z,{icon:KG.Z})};function JG({label:e,value:t,colors:n,disableCustomColors:r,enableAlpha:o,onChange:i}){const[a,s]=(0,x.useState)(!1),l=(0,cw.Z)(JG,"color-list-picker-option"),c=`${l}__label`,u=`${l}__content`;return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(Gh.ZP,{className:"components-color-list-picker__swatch-button",onClick:()=>s((e=>!e)),"aria-expanded":a,"aria-controls":u},(0,x.createElement)(wI.Z,{justify:"flex-start",spacing:2},t?(0,x.createElement)(zZ,{colorValue:t,className:"components-color-list-picker__swatch-color"}):(0,x.createElement)(V_.Z,{icon:KG.Z}),(0,x.createElement)("span",{id:c},e))),(0,x.createElement)("div",{role:"group",id:u,"aria-labelledby":c,"aria-hidden":!a},a&&(0,x.createElement)(wV,{"aria-label":(0,d_.__)("Color options"),className:"components-color-list-picker__color-picker",colors:n,value:t,clearable:!1,onChange:i,disableCustomColors:r,enableAlpha:o})))}var QG=function({colors:e,labels:t,value:n=[],disableCustomColors:r,enableAlpha:o,onChange:i}){return(0,x.createElement)("div",{className:"components-color-list-picker"},t.map(((t,a)=>(0,x.createElement)(JG,{key:a,label:t,value:n[a],colors:e,disableCustomColors:r,enableAlpha:o,onChange:e=>{const t=n.slice();t[a]=e,i(t)}}))))};const eq=["#333","#CCC"];function tq({value:e,onChange:t}){const n=!!e,r=n?e:eq,o=YG(r),i=(a=r).map(((e,t)=>({position:100*t/(a.length-1),color:e})));var a;return(0,x.createElement)(WH,{disableInserter:!0,background:o,hasGradient:n,value:i,onChange:e=>{const n=function(e=[]){return e.map((({color:e})=>e))}(e);t(n)}})}var nq=function({asButtons:e,loop:t,clearable:n=!0,unsetable:r=!0,colorPalette:o,duotonePalette:i,disableCustomColors:a,disableCustomDuotone:s,value:l,onChange:c,"aria-label":u,"aria-labelledby":d}){const[p,h]=(0,x.useMemo)((()=>{return!(e=o)||e.length<2?["#000","#fff"]:e.map((({color:e})=>({color:e,brightness:(0,Dl.Vi)(e).brightness()}))).reduce((([e,t],n)=>[n.brightness<=e.brightness?n:e,n.brightness>=t.brightness?n:t]),[{brightness:1,color:""},{brightness:0,color:""}]).map((({color:e})=>e));var e}),[o]),m="unset"===l,f=(0,x.createElement)(hV.Option,{key:"unset",value:"unset",isSelected:m,tooltipText:(0,d_.__)("Unset"),className:"components-duotone-picker__color-indicator",onClick:()=>{c(m?void 0:"unset")}}),g=i.map((({colors:e,slug:t,name:n})=>{const r={background:YG(e,"135deg"),color:"transparent"},o=null!=n?n:(0,d_.sprintf)((0,d_.__)("Duotone code: %s"),t),i=n?(0,d_.sprintf)((0,d_.__)("Duotone: %s"),n):o,a=M()(e,l);return(0,x.createElement)(hV.Option,{key:t,value:e,isSelected:a,"aria-label":i,tooltipText:o,style:r,onClick:()=>{c(a?void 0:e)}})}));let b;if(e)b={asButtons:!0};else{const e={asButtons:!1,loop:t};b=u?{...e,"aria-label":u}:d?{...e,"aria-labelledby":d}:{...e,"aria-label":(0,d_.__)("Custom color picker.")}}return(0,x.createElement)(hV,{...b,options:r?[f,...g]:g,actions:!!n&&(0,x.createElement)(hV.ButtonAction,{onClick:()=>c(void 0)},(0,d_.__)("Clear"))},(0,x.createElement)(cD.Z,{paddingTop:4},(0,x.createElement)(dM.Z,{spacing:3},!a&&!s&&(0,x.createElement)(tq,{value:m?void 0:l,onChange:c}),!s&&(0,x.createElement)(QG,{labels:[(0,d_.__)("Shadows"),(0,d_.__)("Highlights")],colors:o,value:m?void 0:l,disableCustomColors:a,enableAlpha:!0,onChange:e=>{e[0]||(e[0]=p),e[1]||(e[1]=h);const t=e.length>=2?e:void 0;c(t)}}))))},rq=n(75893),oq=function({colorPalette:e,duotonePalette:t,disableCustomColors:n,disableCustomDuotone:r,value:o,onChange:i}){let a;return a="unset"===o?(0,x.createElement)(zZ,{className:"block-editor-duotone-control__unset-indicator"}):o?(0,x.createElement)(XG,{values:o}):(0,x.createElement)(ox.Z,{icon:rq.Z}),(0,x.createElement)(pB.Z,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,$.__)("Duotone")},renderToggle:({isOpen:e,onToggle:t})=>(0,x.createElement)(Jh,{showTooltip:!0,onClick:t,"aria-haspopup":"true","aria-expanded":e,onKeyDown:n=>{e||n.keyCode!==Hf.WV||(n.preventDefault(),t())},label:(0,$.__)("Apply duotone filter"),icon:a}),renderContent:()=>(0,x.createElement)($k.Z,{label:(0,$.__)("Duotone")},(0,x.createElement)("div",{className:"block-editor-duotone-control__description"},(0,$.__)("Create a two-tone color effect without losing your original image.")),(0,x.createElement)(nq,{colorPalette:e,duotonePalette:t,disableCustomColors:n,disableCustomDuotone:r,value:o,onChange:i}))})};function iq(e){return`${e}{filter:none}`}function aq(e,t){return`${e}{filter:url(#${t})}`}function sq(e,t){const n=function(e=[]){const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=(0,Dl.Vi)(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>`}function lq(e,t="root",n={}){if(!t)return null;const{fallback:r=!1}=n,{name:o,selectors:i,supports:a}=e,s=i&&Object.keys(i).length>0,l=Array.isArray(t)?t.join("."):t;let c=null;if(c=s&&i.root?i?.root:a?.__experimentalSelector?a.__experimentalSelector:".wp-block-"+o.replace("core/","").replace("/","-"),"root"===l)return c;const u=Array.isArray(t)?t:t.split(".");if(1===u.length){const e=r?c:null;if(s)return $E(i,`${l}.root`,null)||$E(i,l,null)||e;const t=$E(a,`${l}.__experimentalSelector`,null);return t?hC(c,t):e}let d;return s&&(d=$E(i,l,null)),d||(r?lq(e,u[0],n):null)}const cq=[];function uq(e,{presetSetting:t,defaultSetting:n}){const r=!e?.color?.[n],o=e?.color?.[t]?.custom||cq,i=e?.color?.[t]?.theme||cq,a=e?.color?.[t]?.default||cq;return(0,x.useMemo)((()=>[...o,...i,...r?cq:a]),[r,o,i,a])}function dq(e){return pq(e)}function pq(e){return e.color.customDuotone||e.color.defaultDuotone||e.color.duotone.length>0}function hq({resetAllFilter:e,onChange:t,value:n,panelId:r,children:o}){return(0,x.createElement)(VI,{label:(0,$._x)("Filters","Name for applying graphical effects"),resetAll:()=>{const r=e(n);t(r)},panelId:r},o)}const mq={duotone:!0},fq={placement:"left-start",offset:36,shift:!0,className:"block-editor-duotone-control__popover",headerTitle:(0,$.__)("Duotone")},gq=({indicator:e,label:t})=>(0,x.createElement)(wI.Z,{justify:"flex-start"},(0,x.createElement)(kH,{isLayered:!1,offset:-8},(0,x.createElement)(ew.Z,{expanded:!1},"unset"!==e&&e?(0,x.createElement)(XG,{values:e}):(0,x.createElement)(zZ,{className:"block-editor-duotone-control__unset-indicator"}))),(0,x.createElement)(tw.Z,{title:t},t));function bq({as:e=hq,value:t,onChange:n,inheritedValue:r=t,settings:o,panelId:i,defaultControls:a=mq}){const s=pq(o),l=uq(o,{presetSetting:"duotone",defaultSetting:"defaultDuotone"}),c=uq(o,{presetSetting:"palette",defaultSetting:"defaultPalette"}),u=(d=r?.filter?.duotone,pC({settings:o},"",d));var d;const p=e=>{const r=l.find((({colors:t})=>t===e)),o=r?`var:preset|duotone|${r.slug}`:e;n(UE(t,["filter","duotone"],o))},h=(0,x.useCallback)((e=>({...e,filter:{...e.filter,duotone:void 0}})),[]);return(0,x.createElement)(e,{resetAllFilter:h,value:t,onChange:n,panelId:i},s&&(0,x.createElement)(_F,{label:(0,$.__)("Duotone"),hasValue:()=>!!t?.filter?.duotone,onDeselect:()=>p(void 0),isShownByDefault:a.duotone,panelId:i},(0,x.createElement)(pB.Z,{popoverProps:fq,className:"block-editor-global-styles-filters-panel__dropdown",renderToggle:({onToggle:e,isOpen:t})=>{const n={onClick:e,className:R()({"is-open":t}),"aria-expanded":t};return(0,x.createElement)(TM,{isBordered:!0,isSeparated:!0},(0,x.createElement)(Gh.ZP,{...n},(0,x.createElement)(gq,{indicator:u,label:(0,$.__)("Duotone")})))},renderContent:()=>(0,x.createElement)(gV,{paddingSize:"medium"},(0,x.createElement)(dM.Z,null,(0,x.createElement)("p",null,(0,$.__)("Create a two-tone color effect without losing your original image.")),(0,x.createElement)(nq,{colorPalette:c,duotonePalette:l,disableCustomColors:!0,disableCustomDuotone:!0,value:u,onChange:p})))})))}const vq=[],yq=window?.navigator.userAgent&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&!window.navigator.userAgent.includes("Chromium");function _q({presetSetting:e,defaultSetting:t}){const n=!YE(t),r=YE(`${e}.custom`)||vq,o=YE(`${e}.theme`)||vq,i=YE(`${e}.default`)||vq;return(0,x.useMemo)((()=>[...r,...o,...n?vq:i]),[n,r,o,i])}function kq(e,t){if(!e)return;const n=t?.find((({slug:t})=>e===`var:preset|duotone|${t}`));return n?n.colors:void 0}function wq({attributes:e,setAttributes:t,name:n}){const r=e?.style,o=r?.color?.duotone,i=IC(n),a=_q({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),s=_q({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),l=!YE("color.custom"),c=!YE("color.customDuotone")||0===s?.length&&l;if(0===a?.length&&c)return null;const u=Array.isArray(o)?o:kq(o,a);return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(qI,{group:"filter"},(0,x.createElement)(bq,{value:{filter:{duotone:u}},onChange:e=>{const n={...r,color:{...e?.filter}};t({style:n})},settings:i})),(0,x.createElement)(Hk,{group:"block",__experimentalShareWithChildBlocks:!0},(0,x.createElement)(oq,{duotonePalette:a,colorPalette:s,disableCustomDuotone:c,disableCustomColors:l,value:u,onChange:e=>{const n=function(e,t){if(!e||!Array.isArray(e))return;const n=t?.find((t=>t?.colors?.every(((t,n)=>t===e[n]))));return n?`var:preset|duotone|${n.slug}`:void 0}(e,a),o={...r,color:{...r?.color,duotone:null!=n?n:e}};t({style:o})},settings:i})))}(0,Dl.l7)([Ol.Z]);const Eq=(0,Wh.o)((e=>t=>{const n=uc(t.name,"filter.duotone"),r=GS();return(0,x.createElement)(x.Fragment,null,n&&"default"===r&&(0,x.createElement)(wq,{...t}),(0,x.createElement)(e,{...t}))}),"withDuotoneControls");function Cq({clientId:e,id:t,selector:n,attribute:r}){const o=_q({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),i=Array.isArray(r),a=i?void 0:kq(r,o),s="string"==typeof r&&a;let l=null;s?l=a:("string"==typeof r&&!s||i)&&(l=r);const c=n.split(",").map((e=>`.${t}${e.trim()}`)).join(", "),u=Array.isArray(l)||"unset"===l,{setStyleOverride:d,deleteStyleOverride:p}=Jy((0,_l.Z)(e_)),h=oB(e);return(0,x.useEffect)((()=>{if(u){if(d(t,{css:"unset"!==l?aq(c,t):iq(c),__unstableType:"presets"}),d(`duotone-${t}`,{assets:"unset"!==l?sq(t,l):"",__unstableType:"svgs"}),h&&yq){const e=h.style.display;h.style.display="inline-block",h.offsetHeight,h.style.display=e}return()=>{p(t),p(`duotone-${t}`)}}}),[u,h,l,c,t,d,p]),null}const xq=(0,Wh.o)((e=>t=>{const n=(0,tT.Z)(e),r=(0,x.useMemo)((()=>{const e=sc(t.name);if(e){if(!cc(e,"filter.duotone",!1))return null;const t=cc(e,"color.__experimentalDuotone",!1);if(t){const n=lq(e);return"string"==typeof t?hC(n,t):n}return lq(e,"filter.duotone",{fallback:!0})}}),[t.name]),o=t?.attributes?.style?.color?.duotone,i=`wp-duotone-${n}`,a=r&&o,s=a?R()(t?.className,i):t?.className;return(0,x.createElement)(x.Fragment,null,a&&(0,x.createElement)(Cq,{clientId:t.clientId,id:i,selector:r,attribute:o}),(0,x.createElement)(e,{...t,className:s}))}),"withDuotoneStyles");function Sq(e){return(0,yl.Z)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:r,__experimentalGetReusableBlockTitle:o}=t(e_),{getBlockType:i,getActiveBlockVariation:a}=t(Vu),s=n(e),l=i(s);if(!l)return null;const c=r(e),u=a(s,c),d=dc(l),p=(d?o(c.ref):void 0)||l.title,h=d||pc(l),m=function(e){const t=e?.style?.position?.type;return"sticky"===t?(0,$.__)("Sticky"):"fixed"===t?(0,$.__)("Fixed"):null}(c),f={isSynced:h,title:p,icon:l.icon,description:l.description,anchor:c?.anchor,positionLabel:m,positionType:c?.style?.position?.type,name:c?.metadata?.name};return u?{isSynced:h,title:u.title||l.title,icon:u.icon||l.icon,description:u.description||l.description,anchor:c?.anchor,positionLabel:m,positionType:c?.style?.position?.type,name:c?.metadata?.name}:f}),[e])}(0,mc.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return uc(e,"filter.duotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,mc.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",Eq),(0,mc.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",xq);const{CustomSelectControl:Iq}=Jy(Mk),Tq="position",Nq="block-editor-hooks__position-selection__select-control__option",Pq={key:"default",value:"",name:(0,$.__)("Default"),className:Nq},Rq={key:"sticky",value:"sticky",name:(0,$._x)("Sticky","Name for the value of the CSS position property"),className:Nq,__experimentalHint:(0,$.__)("The block will stick to the top of the window instead of scrolling.")},Aq={key:"fixed",value:"fixed",name:(0,$._x)("Fixed","Name for the value of the CSS position property"),className:Nq,__experimentalHint:(0,$.__)("The block will not move when the page is scrolled.")},Bq=["top","right","bottom","left"],Lq=["sticky","fixed"];function Mq(e){const t=e.style?.position?.type;return"sticky"===t||"fixed"===t}function Dq({name:e}={}){const t=YE("position.fixed"),n=YE("position.sticky"),r=!t&&!n;return!cc(e,Tq)||r}function Oq(e){const{attributes:{style:t={}},clientId:n,name:r,setAttributes:o}=e,i=function(e){const t=cc(e,Tq);return!(!0!==t&&!t?.fixed)}(r),a=function(e){const t=cc(e,Tq);return!(!0!==t&&!t?.sticky)}(r),s=t?.position?.type,{firstParentClientId:l}=(0,yl.Z)((e=>{const{getBlockParents:t}=e(e_),r=t(n);return{firstParentClientId:r[r.length-1]}}),[n]),c=Sq(l),u=a&&s===Rq.value&&c?(0,$.sprintf)((0,$.__)("The block will stick to the scrollable area of the parent %s block."),c.title):null,d=(0,x.useMemo)((()=>{const e=[Pq];return(a||s===Rq.value)&&e.push(Rq),(i||s===Aq.value)&&e.push(Aq),e}),[i,a,s]),p=s&&d.find((e=>e.value===s))||Pq;return wm.Z.select({web:d.length>1?(0,x.createElement)(qI,{group:"position"},(0,x.createElement)(uw.ZP,{className:"block-editor-hooks__position-selection",__nextHasNoMarginBottom:!0,help:u},(0,x.createElement)(Iq,{__nextUnconstrainedWidth:!0,__next36pxDefaultSize:!0,className:"block-editor-hooks__position-selection__select-control",label:(0,$.__)("Position"),hideLabelFromVision:!0,describedBy:(0,$.sprintf)((0,$.__)("Currently selected position: %s"),p.name),options:d,value:p,__experimentalShowSelectedHint:!0,onChange:({selectedItem:e})=>{(e=>{const n={...t,position:{...t?.position,type:e,top:"sticky"===e||"fixed"===e?"0px":void 0}};o({style:CC(n)})})(e.value)},size:"__unstable-large"}))):null,native:null})}const Fq=(0,Wh.o)((e=>t=>{const{name:n}=t,r=uc(n,Tq),o=Dq(t);return[r&&!o&&(0,x.createElement)(Oq,{key:"position",...t}),(0,x.createElement)(e,{key:"edit",...t})]}),"withInspectorControls"),jq=(0,Wh.o)((e=>t=>{const{name:n,attributes:r}=t,o=uc(n,Tq),i=Dq(t),a=o&&!i,s=(0,tT.Z)(e),l=(0,x.useContext)(fF.__unstableElementContext);let c;a&&(c=function({selector:e,style:t}){let n="";const{type:r}=t?.position||{};return Lq.includes(r)?(n+=`${e} {`,n+=`position: ${r};`,Bq.forEach((e=>{void 0!==t?.position?.[e]&&(n+=`${e}: ${t.position[e]};`)})),"sticky"!==r&&"fixed"!==r||(n+="z-index: 10"),n+="}",n):n}({selector:`.wp-container-${s}.wp-container-${s}`,style:r?.style})||"");const u=R()(t?.className,{[`wp-container-${s}`]:a&&!!c,[`is-position-${r?.style?.position?.type}`]:a&&!!c&&!!r?.style?.position?.type});return(0,x.createElement)(x.Fragment,null,a&&l&&!!c&&(0,eT.createPortal)((0,x.createElement)("style",null,c),l),(0,x.createElement)(e,{...t,className:u}))}),"withPositionStyles");(0,mc.addFilter)("editor.BlockListBlock","core/editor/position/with-position-styles",jq),(0,mc.addFilter)("editor.BlockEdit","core/editor/position/with-inspector-controls",Fq);var Zq=n(41932);const zq="layout";function Vq(e){return uc(e,"layout")||uc(e,"__experimentalLayout")}function Hq(e={},t=""){const n=(0,yl.Z)((e=>{const{getSettings:t}=e(e_);return t().__experimentalFeatures?.useRootPaddingAwareAlignments}),[]),{layout:r}=e,{default:o}=cc(t,zq)||{},i=r?.inherit||r?.contentSize||r?.wideSize?{...r,type:"constrained"}:r||o||{},a=[];if(sE[i?.type||"default"]?.className){const e=sE[i?.type||"default"]?.className,n=t.split("/"),r=`wp-block-${"core"===n[0]?n.pop():n.join("-")}-${e}`;a.push(e,r)}return(i?.inherit||i?.contentSize||"constrained"===i?.type)&&n&&a.push("has-global-padding"),i?.orientation&&a.push(`is-${VE(i.orientation)}`),i?.justifyContent&&a.push(`is-content-justification-${VE(i.justifyContent)}`),i?.flexWrap&&"nowrap"===i.flexWrap&&a.push("is-nowrap"),a}function Uq({setAttributes:e,attributes:t,name:n}){const r=IC(n),{layout:{allowEditing:o}}=r,{layout:i}=t,a=YE("layout"),{themeSupportsLayout:s}=(0,yl.Z)((e=>{const{getSettings:t}=e(e_);return{themeSupportsLayout:t().supportsLayout}}),[]),l=GS(),c=cc(n,zq,{}),{allowSwitching:u,allowEditing:d=null==o||o,allowInheriting:p=!0,default:h}=c;if(!d)return null;const m=!(!p||!a||i?.type&&"default"!==i?.type&&"constrained"!==i?.type&&!i?.inherit),f=i||h||{},{inherit:g=!1,type:b="default",contentSize:v=null}=f;if(("default"===b||"constrained"===b)&&!s)return null;const y=PS(b),_=PS("constrained"),k=!f.type&&(v||g),w=!!g||!!v,E=t=>e({layout:t});return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(qI,null,(0,x.createElement)(tI.ZP,{title:(0,$.__)("Layout")},m&&(0,x.createElement)(x.Fragment,null,(0,x.createElement)(aE.Z,{__nextHasNoMarginBottom:!0,className:"block-editor-hooks__toggle-control",label:(0,$.__)("Inner blocks use content width"),checked:"constrained"===y?.name||w,onChange:()=>e({layout:{type:"constrained"===y?.name||w?"default":"constrained"}}),help:"constrained"===y?.name||w?(0,$.__)("Nested blocks use content width with options for full and wide widths."):(0,$.__)("Nested blocks will fill the width of this container. Toggle to constrain.")})),!g&&u&&(0,x.createElement)($q,{type:b,onChange:t=>e({layout:{type:t}})}),y&&"default"!==y.name&&(0,x.createElement)(y.inspectorControls,{layout:f,onChange:E,layoutBlockSupport:c}),_&&k&&(0,x.createElement)(_.inspectorControls,{layout:f,onChange:E,layoutBlockSupport:c}))),!g&&"default"===l&&y&&(0,x.createElement)(y.toolBarControls,{layout:f,onChange:E,layoutBlockSupport:c}))}function $q({type:e,onChange:t}){return(0,x.createElement)(Zq.Z,null,NS.map((({name:n,label:r})=>(0,x.createElement)(Gh.ZP,{key:n,isPressed:e===n,onClick:()=>t(n)},r))))}const Wq=(0,Wh.o)((e=>t=>{const{name:n}=t,r=Vq(n),o=GS();return[r&&"default"===o&&(0,x.createElement)(Uq,{key:"layout",...t}),(0,x.createElement)(e,{key:"edit",...t})]}),"withInspectorControls"),Gq=(0,Wh.o)((e=>t=>{const{name:n,attributes:r}=t,o=Vq(n),i=(0,yl.Z)((e=>{const{getSettings:t}=e(e_);return!!t().disableLayoutStyles})),a=o&&!i,s=(0,tT.Z)(e),{layout:l}=r,{default:c}=cc(n,zq)||{},u=l?.inherit||l?.contentSize||l?.wideSize?{...l,type:"constrained"}:l||c||{},d=o?Hq(r,n):null,p=`.wp-container-${s}.wp-container-${s}`,h=null!==YE("spacing.blockGap");let m;if(a){const e=PS(u?.type||"default");m=e?.getLayoutStyle?.({blockName:n,selector:p,layout:u,style:r?.style,hasBlockGapSupport:h})}const f=R()({[`wp-container-${s}`]:a&&!!m},d),{setStyleOverride:g,deleteStyleOverride:b}=Jy((0,_l.Z)(e_));return(0,x.useEffect)((()=>{if(m)return g(p,{css:m}),()=>{b(p)}}),[p,m,g,b]),(0,x.createElement)(e,{...t,__unstableLayoutClassNames:f})}),"withLayoutStyles"),qq=(0,Wh.o)((e=>t=>{const{attributes:n}=t,{style:{layout:r={}}={}}=n,{selfStretch:o,flexSize:i}=r,a=o||i,s=(0,yl.Z)((e=>{const{getSettings:t}=e(e_);return!!t().disableLayoutStyles})),l=a&&!s,c=(0,tT.Z)(e),u=`.wp-container-content-${c}`;let d="";"fixed"===o&&i?d+=`${u} {\n\t\t\t\tflex-basis: ${i};\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}`:"fill"===o&&(d+=`${u} {\n\t\t\t\tflex-grow: 1;\n\t\t\t}`);const p=R()(t?.className,{[`wp-container-content-${c}`]:l&&!!d}),{setStyleOverride:h,deleteStyleOverride:m}=Jy((0,_l.Z)(e_));return(0,x.useEffect)((()=>{if(d)return h(u,{css:d}),()=>{m(u)}}),[u,d,h,m]),(0,x.createElement)(e,{...t,className:p})}),"withChildLayoutStyles");function Kq(e){return(0,yl.Z)((t=>{const{getBlocksByClientId:n,getSelectedBlockClientIds:r,isUngroupable:o,isGroupable:i}=t(e_),{getGroupingBlockName:a,getBlockType:s}=t(Vu),l=e?.length?e:r(),c=n(l),[u]=c,d=1===l.length&&o(l[0]);return{clientIds:l,isGroupable:i(l),isUngroupable:d,blocksSelection:c,groupingBlockName:a(),onUngroup:d&&s(u.name)?.transforms?.ungroup}}),[e])}function Yq({clientIds:e,isGroupable:t,isUngroupable:n,onUngroup:r,blocksSelection:o,groupingBlockName:i,onClose:a=(()=>{})}){const{replaceBlocks:s}=(0,_l.Z)(e_);return t||n?(0,x.createElement)(x.Fragment,null,t&&(0,x.createElement)(Wk.Z,{onClick:()=>{(()=>{const t=xc(o,i);t&&s(e,t)})(),a()}},(0,$._x)("Group","verb")),n&&(0,x.createElement)(Wk.Z,{onClick:()=>{(()=>{let t=o[0].innerBlocks;t.length&&(r&&(t=r(o[0].attributes,o[0].innerBlocks)),s(e,t))})(),a()}},(0,$._x)("Ungroup","Ungrouping blocks from within a grouping block back into individual blocks within the Editor "))):null}function Xq(e){return(0,yl.Z)((t=>{const{canEditBlock:n,canMoveBlock:r,canRemoveBlock:o,canLockBlockType:i,getBlockName:a,getBlockRootClientId:s,getTemplateLock:l}=t(e_),c=s(e),u=n(e),d=r(e,c),p=o(e,c);return{canEdit:u,canMove:d,canRemove:p,canLock:i(a(e)),isContentLocked:"contentOnly"===l(e),isLocked:!u||!d||!p}}),[e])}(0,mc.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.layout)&&void 0!==t?t:{})||Vq(e)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,mc.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",Gq),(0,mc.addFilter)("editor.BlockListBlock","core/editor/layout/with-child-layout-styles",qq),(0,mc.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",Wq);var Jq=n(51214),Qq=n(68712),eK=n(57294);const tK=["core/block","core/navigation"];function nK(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function rK({clientId:e,onClose:t}){const[n,r]=(0,x.useState)({move:!1,remove:!1}),{canEdit:o,canMove:i,canRemove:a}=Xq(e),{allowsEditLocking:s,templateLock:l,hasTemplateLock:c}=(0,yl.Z)((t=>{const{getBlockName:n,getBlockAttributes:r}=t(e_),o=n(e),i=sc(o);return{allowsEditLocking:tK.includes(o),templateLock:r(e)?.templateLock,hasTemplateLock:!!i?.attributes?.templateLock}}),[e]),[u,d]=(0,x.useState)(!!l),{updateBlockAttributes:p}=(0,_l.Z)(e_),h=Sq(e),m=(0,tT.Z)(rK,"block-editor-block-lock-modal__options-title");(0,x.useEffect)((()=>{r({move:!i,remove:!a,...s?{edit:!o}:{}})}),[o,i,a,s]);const f=Object.values(n).every(Boolean),g=Object.values(n).some(Boolean)&&!f;return(0,x.createElement)(yT.Z,{title:(0,$.sprintf)((0,$.__)("Lock %s"),h.title),overlayClassName:"block-editor-block-lock-modal",onRequestClose:t},(0,x.createElement)("p",null,(0,$.__)("Choose specific attributes to restrict or lock all available options.")),(0,x.createElement)("form",{onSubmit:r=>{r.preventDefault(),p([e],{lock:n,templateLock:u?nK(n):void 0}),t()}},(0,x.createElement)("div",{role:"group","aria-labelledby":m,className:"block-editor-block-lock-modal__options"},(0,x.createElement)(jj.C,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__options-title",label:(0,x.createElement)("span",{id:m},(0,$.__)("Lock all")),checked:f,indeterminate:g,onChange:e=>r({move:e,remove:e,...s?{edit:e}:{}})}),(0,x.createElement)("ul",{className:"block-editor-block-lock-modal__checklist"},s&&(0,x.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,x.createElement)(jj.C,{__nextHasNoMarginBottom:!0,label:(0,$.__)("Restrict editing"),checked:!!n.edit,onChange:e=>r((t=>({...t,edit:e})))}),(0,x.createElement)(V_.Z,{className:"block-editor-block-lock-modal__lock-icon",icon:n.edit?eK.Z:Jq.Z})),(0,x.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,x.createElement)(jj.C,{__nextHasNoMarginBottom:!0,label:(0,$.__)("Disable movement"),checked:n.move,onChange:e=>r((t=>({...t,move:e})))}),(0,x.createElement)(V_.Z,{className:"block-editor-block-lock-modal__lock-icon",icon:n.move?eK.Z:Jq.Z})),(0,x.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,x.createElement)(jj.C,{__nextHasNoMarginBottom:!0,label:(0,$.__)("Prevent removal"),checked:n.remove,onChange:e=>r((t=>({...t,remove:e})))}),(0,x.createElement)(V_.Z,{className:"block-editor-block-lock-modal__lock-icon",icon:n.remove?eK.Z:Jq.Z}))),c&&(0,x.createElement)(aE.Z,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__template-lock",label:(0,$.__)("Apply to all blocks inside"),checked:u,disabled:n.move&&!n.remove,onChange:()=>d(!u)})),(0,x.createElement)(ew.Z,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,x.createElement)(tw.Z,null,(0,x.createElement)(Gh.ZP,{variant:"tertiary",onClick:t},(0,$.__)("Cancel"))),(0,x.createElement)(tw.Z,null,(0,x.createElement)(Gh.ZP,{variant:"primary",type:"submit"},(0,$.__)("Apply"))))))}function oK({clientId:e}){const{canLock:t,isLocked:n}=Xq(e),[r,o]=(0,x.useReducer)((e=>!e),!1);if(!t)return null;const i=n?(0,$.__)("Unlock"):(0,$.__)("Lock");return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(Wk.Z,{icon:n?Jq.Z:Qq.Z,onClick:o,"aria-expanded":r,"aria-haspopup":"dialog"},i),r&&(0,x.createElement)(rK,{clientId:e,onClose:o}))}const iK=()=>{};var aK=(0,D.Z)([(0,lT.Z)(((e,{clientId:t})=>{const{getBlock:n,getBlockMode:r,getSettings:o}=e(e_),i=n(t),a=o().codeEditingEnabled;return{mode:r(t),blockType:i?sc(i.name):null,isCodeEditingEnabled:a}})),(0,cT.Z)(((e,{onToggle:t=iK,clientId:n})=>({onToggleMode(){e(e_).toggleBlockMode(n),t()}})))])((function({blockType:e,mode:t,onToggleMode:n,small:r=!1,isCodeEditingEnabled:o=!0}){if(!e||!uc(e,"html",!0)||!o)return null;const i="visual"===t?(0,$.__)("Edit as HTML"):(0,$.__)("Edit visually");return(0,x.createElement)(Wk.Z,{onClick:n},!r&&i)}));function sK(e){return 0===e?.trim()?.length}function lK({blockName:e,originalBlockName:t,onClose:n,onSave:r}){const[o,i]=(0,x.useState)(e),a=o!==e,s=o===t,l=sK(o),c=a||s,u=(0,tT.Z)(lK,"block-editor-rename-modal__description");return(0,x.createElement)(yT.Z,{title:(0,$.__)("Rename"),onRequestClose:n,overlayClassName:"block-editor-block-rename-modal",aria:{describedby:u},focusOnMount:"firstContentElement"},(0,x.createElement)("p",{id:u},(0,$.__)("Enter a custom name for this block.")),(0,x.createElement)("form",{onSubmit:e=>{e.preventDefault(),c&&(()=>{const e=s||l?(0,$.sprintf)((0,$.__)('Block name reset to: "%s".'),o):(0,$.sprintf)((0,$.__)('Block name changed to: "%s".'),o);(0,wf.D)(e,"assertive"),r(o),n()})()}},(0,x.createElement)(dM.Z,{spacing:"3"},(0,x.createElement)(QS.Z,{__nextHasNoMarginBottom:!0,value:o,label:(0,$.__)("Block name"),hideLabelFromVision:!0,placeholder:t,onChange:i,onFocus:e=>e.target.select()}),(0,x.createElement)(wI.Z,{justify:"right"},(0,x.createElement)(Gh.ZP,{variant:"tertiary",onClick:n},(0,$.__)("Cancel")),(0,x.createElement)(Gh.ZP,{"aria-disabled":!c,variant:"primary",type:"submit"},(0,$.__)("Save"))))))}function cK({clientId:e}){const[t,n]=(0,x.useState)(!1),{metadata:r}=(0,yl.Z)((t=>{const{getBlockAttributes:n}=t(e_),r=n(e)?.metadata;return{metadata:r}}),[e]),{updateBlockAttributes:o}=(0,_l.Z)(e_),i=r?.name,a=Sq(e);return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(Wk.Z,{onClick:()=>{n(!0)},"aria-expanded":t,"aria-haspopup":"dialog"},(0,$.__)("Rename")),t&&(0,x.createElement)(lK,{blockName:i||"",originalBlockName:a?.title,onClose:()=>n(!1),onSave:t=>{(t===a?.title||sK(t))&&(t=void 0),function(t){o([e],{metadata:{...r&&r,name:t}})}(t)}}))}const{Fill:uK,Slot:dK}=(0,kl.up)("BlockSettingsMenuControls");function pK({...e}){return(0,x.createElement)(rm.Z,{document:document},(0,x.createElement)(uK,{...e}))}pK.Slot=({fillProps:e,clientIds:t=null,__unstableDisplayLocation:n})=>{const{selectedBlocks:r,selectedClientIds:o}=(0,yl.Z)((e=>{const{getBlockNamesByClientId:n,getSelectedBlockClientIds:r}=e(e_),o=null!==t?t:r();return{selectedBlocks:n(o),selectedClientIds:o}}),[t]),{canLock:i}=Xq(o[0]),{canRename:a}=function(e){const t=cc(e,"__experimentalMetadata",!1);return{canRename:!(!0!==t&&!t?.name)}}(r[0]),s=1===o.length&&i,l=1===o.length&&a,c=Kq(o),{isGroupable:u,isUngroupable:d}=c,p=u||d;return(0,x.createElement)(dK,{fillProps:{...e,__unstableDisplayLocation:n,selectedBlocks:r,selectedClientIds:o}},(t=>!t?.length>0&&!p&&!s?null:(0,x.createElement)($k.Z,null,p&&(0,x.createElement)(Yq,{...c,onClose:e?.onClose}),s&&(0,x.createElement)(oK,{clientId:o[0]}),l&&(0,x.createElement)(cK,{clientId:o[0]}),t,e?.canMove&&!e?.onlyBlock&&(0,x.createElement)(Wk.Z,{onClick:(0,Wc.Z)(e?.onClose,e?.onMoveTo)},(0,$.__)("Move to")),1===e?.count&&(0,x.createElement)(aK,{clientId:e?.firstBlockClientId,onToggle:e?.onClose}))))};var hK=pK;function mK({clientId:e,stopEditingAsBlock:t}){const n=(0,yl.Z)((t=>{const{isBlockSelected:n,hasSelectedInnerBlock:r}=t(e_);return n(e)||r(e,!0)}),[e]);return(0,x.useEffect)((()=>{n||t()}),[n,t]),null}const fK=(0,Wh.o)((e=>t=>{const{getBlockListSettings:n,getSettings:r}=(0,yl.Z)(e_),o=(0,x.useRef)(),{templateLock:i,isLockedByParent:a,isEditingAsBlocks:s}=(0,yl.Z)((e=>{const{__unstableGetContentLockingParent:n,getTemplateLock:r,__unstableGetTemporarilyEditingAsBlocks:o}=e(e_);return{templateLock:r(t.clientId),isLockedByParent:!!n(t.clientId),isEditingAsBlocks:o()===t.clientId}}),[t.clientId]),{updateSettings:l,updateBlockListSettings:c,__unstableSetTemporarilyEditingAsBlocks:u}=(0,_l.Z)(e_),d=!a&&"contentOnly"===i,{__unstableMarkNextChangeAsNotPersistent:p,updateBlockAttributes:h}=(0,_l.Z)(e_),m=(0,x.useCallback)((()=>{p(),h(t.clientId,{templateLock:"contentOnly"}),c(t.clientId,{...n(t.clientId),templateLock:"contentOnly"}),l({focusMode:o.current}),u()}),[t.clientId,l,c,n,p,h,u]);if(!d&&!s)return(0,x.createElement)(e,{key:"edit",...t});const f=s&&!d,g=!s&&d&&t.isSelected;return(0,x.createElement)(x.Fragment,null,f&&(0,x.createElement)(x.Fragment,null,(0,x.createElement)(mK,{clientId:t.clientId,stopEditingAsBlock:m}),(0,x.createElement)(Hk,{group:"other"},(0,x.createElement)(Jh,{onClick:()=>{m()}},(0,$.__)("Done")))),g&&(0,x.createElement)(hK,null,(({onClose:e})=>(0,x.createElement)(Wk.Z,{onClick:()=>{p(),h(t.clientId,{templateLock:void 0}),c(t.clientId,{...n(t.clientId),templateLock:!1}),o.current=r().focusMode,l({focusMode:!0}),u(t.clientId),e()}},(0,$.__)("Modify")))),(0,x.createElement)(e,{key:"edit",...t}))}),"withToolbarControls");(0,mc.addFilter)("editor.BlockEdit","core/content-lock-ui/with-block-controls",fK);const gK="metadata";function bK(e,t=""){if(!e.name.startsWith("core/"))return!1;const n=cc(e,"__experimentalMetadata");return!(!0!==n&&!n?.[t])}(0,mc.addFilter)("blocks.registerBlockType","core/metadata/addMetaAttribute",(function(e){return e?.attributes?.[gK]?.type||bK(e,"name")&&(e.attributes={...e.attributes,[gK]:{type:"object"}}),e})),(0,mc.addFilter)("blocks.getSaveContent.extraProps","core/metadata/save-props",(function(e,t,n){return bK(t)&&(e[gK]=n[gK]),e})),(0,mc.addFilter)("blocks.registerBlockType","core/metadata/addLabelCallback",(function(e){return e.__experimentalLabel||bK(e,"name")&&(e.__experimentalLabel=(e,{context:t})=>{const{metadata:n}=e;if("list-view"===t&&n?.name)return n.name}),e}));const vK=(0,Wh.o)((e=>t=>{const n=GS(),r=uc(t.name,"__experimentalConnections",!1);if(!["core/paragraph","core/image"].includes(t.name))return(0,x.createElement)(e,{...t});let o;return"core/paragraph"===t.name&&(o="content"),"core/image"===t.name&&(o="url"),r&&t.isSelected?(0,x.createElement)(x.Fragment,null,(0,x.createElement)(e,{...t}),"default"===n&&(0,x.createElement)(qI,null,(0,x.createElement)(tI.ZP,{title:(0,$.__)("Connections"),initialOpen:!0},(0,x.createElement)(QS.Z,{__nextHasNoMarginBottom:!0,autoComplete:"off",label:(0,$.__)("Custom field meta_key"),value:t.attributes?.connections?.attributes?.[o]?.value||"",onChange:e=>{""===e?t.setAttributes({connections:void 0,[o]:void 0,placeholder:void 0}):t.setAttributes({connections:{attributes:{[o]:{source:"meta_fields",value:e}}},[o]:void 0,placeholder:(0,$.sprintf)('This content will be replaced on the frontend by the value of "%s" custom field.',e)})}})))):(0,x.createElement)(e,{...t})}),"withInspectorControl");window.__experimentalConnections&&((0,mc.addFilter)("blocks.registerBlockType","core/connections/attribute",(function(e){return uc(e,"__experimentalConnections",!0)&&(e.attributes={...e.attributes,connections:{type:"object"}}),e})),(0,mc.addFilter)("editor.BlockEdit","core/connections/with-inspector-control",vK));const yK={};function _K(e){const t=(0,yl.Z)((e=>e(Vu).getBlockTypes()),[]),n=(0,x.useMemo)((()=>t?.filter((({blockHooks:t})=>t&&e.blockName in t))),[t,e.blockName]),{blockIndex:r,rootClientId:o,innerBlocksLength:i}=(0,yl.Z)((t=>{const{getBlock:n,getBlockIndex:r,getBlockRootClientId:o}=t(e_);return{blockIndex:r(e.clientId),innerBlocksLength:n(e.clientId)?.innerBlocks?.length,rootClientId:o(e.clientId)}}),[e.clientId]),a=(0,yl.Z)((t=>{const{getBlock:r,getGlobalBlockCount:i}=t(e_),a=n.reduce(((t,n)=>{if(0===i(n.name))return t;const a=n?.blockHooks?.[e.blockName];let s;switch(a){case"before":case"after":s=r(o)?.innerBlocks;break;case"first_child":case"last_child":s=r(e.clientId).innerBlocks}const l=s?.find((({name:e})=>e===n.name));return l?{...t,[n.name]:l.clientId}:{...t,[n.name]:!1}}),{});return Object.values(a).length>0?a:yK}),[n,e.blockName,e.clientId,o]),{insertBlock:s,removeBlock:l}=(0,_l.Z)(e_),c=n?.filter((e=>!1!==a?.[e.name]));if(!c.length)return null;const u=n.reduce(((e,t)=>{const[n]=t.name.split("/");return e[n]||(e[n]=[]),e[n].push(t),e}),{});return(0,x.createElement)(qI,null,(0,x.createElement)(tI.ZP,{className:"block-editor-hooks__block-hooks",title:(0,$.__)("Plugins"),initialOpen:!0},Object.keys(u).map((t=>(0,x.createElement)(x.Fragment,{key:t},(0,x.createElement)("h3",null,t),u[t].map((t=>{const n=t.name in a;return(0,x.createElement)(aE.Z,{checked:n,key:t.title,label:(0,x.createElement)(wI.Z,{justify:"flex-start"},(0,x.createElement)(EB,{icon:t.icon}),(0,x.createElement)("span",null,t.title)),onChange:()=>{if(!n){const n=t.blockHooks[e.blockName];return void((t,n)=>{switch(n){case"before":case"after":s(t,"after"===n?r+1:r,o,!1);break;case"first_child":case"last_child":s(t,"first_child"===n?0:i,e.clientId,!1)}})(fc(t.name),n)}const c=a[t.name];l(c,!1)}})})))))))}const kK=(0,Wh.o)((e=>t=>{const n=(0,x.createElement)(e,{key:"edit",...t});return(0,x.createElement)(x.Fragment,null,n,(0,x.createElement)(_K,{blockName:t.name,clientId:t.clientId}))}),"withBlockHooks");(0,mc.addFilter)("editor.BlockEdit","core/block-hooks/with-inspector-control",kK);const wK=(0,Wh.o)((e=>t=>{const{name:n,attributes:r,setAttributes:o,isSelected:i}=t,a=uc(n,"__experimentalMetadata",!1);return(0,x.createElement)(x.Fragment,null,i&&a&&(0,x.createElement)(qI,{group:"advanced"},(0,x.createElement)(QS.Z,{__nextHasNoMarginBottom:!0,label:(0,$.__)("Block name"),value:r?.metadata?.name||"",onChange:e=>{o({metadata:{...r?.metadata,name:e}})}})),(0,x.createElement)(e,{key:"edit",...t}))}),"withToolbarControls");function EK(e){const t=e.style?.border||{};return{className:mH(e)||void 0,style:jG({border:t})}}function CK(e){const{colors:t}=mZ(),n=EK(e),{borderColor:r}=e;if(r){const e=aH({colors:t,namedColor:r});n.style.borderColor=e.color}return n}(0,mc.addFilter)("editor.BlockEdit","core/block-rename-ui/with-block-rename-control",wK);var xK=n(64485),SK=n(90523),IK=n(22410);const TK=[{icon:xK.Z,title:(0,$.__)("Align text left"),align:"left"},{icon:SK.Z,title:(0,$.__)("Align text center"),align:"center"},{icon:IK.Z,title:(0,$.__)("Align text right"),align:"right"}],NK={placement:"bottom-start"};var PK=function({value:e,onChange:t,alignmentControls:n=TK,label:r=(0,$.__)("Align text"),describedBy:o=(0,$.__)("Change text alignment"),isCollapsed:i=!0,isToolbar:a}){function s(n){return()=>t(e===n?void 0:n)}const l=n.find((t=>t.align===e)),c=a?nm:Uk,u=a?{isCollapsed:i}:{toggleProps:{describedBy:o},popoverProps:NK};return(0,x.createElement)(c,{icon:l?l.icon:(0,$.isRTL)()?IK.Z:xK.Z,label:r,controls:n.map((t=>{const{align:n}=t,r=e===n;return{...t,isActive:r,role:i?"menuitemradio":void 0,onClick:s(n)}})),...u})};const RK=e=>(0,x.createElement)(PK,{...e,isToolbar:!1});var AK=n(92328),BK=n(22574),LK=n(5844),MK=n(95675),DK=n(21972),OK=n(49549),FK=n(92747);const jK={0:AK.Z,1:BK.Z,2:LK.Z,3:MK.Z,4:DK.Z,5:OK.Z,6:FK.Z};function ZK({level:e}){return jK[e]?(0,x.createElement)(V_.Z,{icon:jK[e]}):null}const zK=[1,2,3,4,5,6],VK={className:"block-library-heading-level-dropdown"};function HK({options:e=zK,value:t,onChange:n}){return(0,x.createElement)(Uk,{popoverProps:VK,icon:(0,x.createElement)(ZK,{level:t}),label:(0,$.__)("Change level"),controls:e.map((e=>{{const r=e===t;return{icon:(0,x.createElement)(ZK,{level:e,isPressed:r}),label:0===e?(0,$.__)("Paragraph"):(0,$.sprintf)((0,$.__)("Heading %d"),e),isActive:r,onClick(){n(e)},role:"menuitemradio"}}}))})}var UK=n(28279);const $K=(0,x.createElement)(F_.Wj,{className:"components-placeholder__illustration",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 60 60",preserveAspectRatio:"none"},(0,x.createElement)(F_.y$,{vectorEffect:"non-scaling-stroke",d:"M60 60 0 0"}));var WK=function(e){const{icon:t,children:n,label:r,instructions:o,className:i,notices:a,preview:s,isColumnLayout:l,withIllustration:c,...u}=e,[d,{width:p}]=(0,UK.Z)();let h;"number"==typeof p&&(h={"is-large":p>=480,"is-medium":p>=160&&p<480,"is-small":p<160});const m=R()("components-placeholder",i,h,c?"has-illustration":null),f=R()("components-placeholder__fieldset",{"is-column-layout":l});return(0,x.useEffect)((()=>{o&&(0,yI.speak)(o)}),[o]),(0,x.createElement)("div",{...u,className:m},c?$K:null,d,a,s&&(0,x.createElement)("div",{className:"components-placeholder__preview"},s),(0,x.createElement)("div",{className:"components-placeholder__label"},(0,x.createElement)(V_.Z,{icon:t}),r),!!o&&(0,x.createElement)("div",{className:"components-placeholder__instructions"},o),(0,x.createElement)("div",{className:f},n))},GK=n(36646),qK=function({icon:e=GK.Z,label:t=(0,$.__)("Choose variation"),instructions:n=(0,$.__)("Select a variation to start with."),variations:r,onSelect:o,allowSkip:i}){const a=R()("block-editor-block-variation-picker",{"has-many-variations":r.length>4});return(0,x.createElement)(WK,{icon:e,label:t,instructions:n,className:a},(0,x.createElement)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,$.__)("Block variations")},r.map((e=>(0,x.createElement)("li",{key:e.name},(0,x.createElement)(Gh.ZP,{variant:"secondary",icon:e.icon&&e.icon.src?e.icon.src:e.icon,iconSize:48,onClick:()=>o(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,x.createElement)("span",{className:"block-editor-block-variation-picker__variation-label"},e.title))))),i&&(0,x.createElement)("div",{className:"block-editor-block-variation-picker__skip"},(0,x.createElement)(Gh.ZP,{variant:"link",onClick:()=>o()},(0,$.__)("Skip"))))},KK=(0,Wh.o)((e=>t=>{const n=YE("color.palette"),r=!YE("color.custom"),o=void 0===t.colors?n:t.colors,i=void 0===t.disableCustomColors?r:t.disableCustomColors,a=o&&o.length>0||!i;return(0,x.createElement)(e,{...t,colors:o,disableCustomColors:i,hasColorsToChoose:a})}),"withColorContext")(wV);const YK=(0,x.createContext)({}),XK=()=>(0,x.useContext)(YK);function JK({id:e,url:t,naturalWidth:n,naturalHeight:r,onFinishEditing:o,onSaveImage:i,children:a}){const s=function({url:e,naturalWidth:t,naturalHeight:n}){const[r,o]=(0,x.useState)(),[i,a]=(0,x.useState)(),[s,l]=(0,x.useState)({x:0,y:0}),[c,u]=(0,x.useState)(100),[d,p]=(0,x.useState)(0),h=t/n,[m,f]=(0,x.useState)(h),g=(0,x.useCallback)((()=>{const t=(d+90)%360;let n=h;if(d%180==90&&(n=1/h),0===t)return o(),p(t),f(h),void l((e=>({x:-e.y*n,y:e.x*n})));const r=new window.Image;r.src=e,r.onload=function(e){const r=document.createElement("canvas");let i=0,a=0;t%180?(r.width=e.target.height,r.height=e.target.width):(r.width=e.target.width,r.height=e.target.height),90!==t&&180!==t||(i=r.width),270!==t&&180!==t||(a=r.height);const s=r.getContext("2d");s.translate(i,a),s.rotate(t*Math.PI/180),s.drawImage(e.target,0,0),r.toBlob((e=>{o(URL.createObjectURL(e)),p(t),f(r.width/r.height),l((e=>({x:-e.y*n,y:e.x*n})))}))};const i=(0,mc.applyFilters)("media.crossOrigin",void 0,e);"string"==typeof i&&(r.crossOrigin=i)}),[d,h,e]);return(0,x.useMemo)((()=>({editedUrl:r,setEditedUrl:o,crop:i,setCrop:a,position:s,setPosition:l,zoom:c,setZoom:u,rotation:d,setRotation:p,rotateClockwise:g,aspect:m,setAspect:f,defaultAspect:h})),[r,i,s,c,d,g,m,h])}({url:t,naturalWidth:n,naturalHeight:r}),l=function({crop:e,rotation:t,url:n,id:r,onSaveImage:o,onFinishEditing:i}){const{createErrorNotice:a}=(0,_l.Z)(PM.store),[s,l]=(0,x.useState)(!1),c=(0,x.useCallback)((()=>{l(!1),i()}),[i]),u=(0,x.useCallback)((()=>{l(!0);const s=[];t>0&&s.push({type:"rotate",args:{angle:t}}),(e.width<99.9||e.height<99.9)&&s.push({type:"crop",args:{left:e.x,top:e.y,width:e.width,height:e.height}}),(0,I.default)({path:`/wp/v2/media/${r}/edit`,method:"POST",data:{src:n,modifiers:s}}).then((e=>{o({id:e.id,url:e.source_url})})).catch((e=>{a((0,$.sprintf)((0,$.__)("Could not edit image. %s"),Hl(e.message)),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{l(!1),i()}))}),[e,t,r,n,o,a,i]);return(0,x.useMemo)((()=>({isInProgress:s,apply:u,cancel:c})),[s,u,c])}({id:e,url:t,onSaveImage:i,onFinishEditing:o,...s}),c=(0,x.useMemo)((()=>({...s,...l})),[s,l]);return(0,x.createElement)(YK.Provider,{value:c},a)}var QK=function(e,t){return QK=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])},QK(e,t)},eY=function(){return eY=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},eY.apply(this,arguments)};Object.create,Object.create;var tY=n(91544),nY=n.n(tY);function rY(e,t,n,r,o){void 0===o&&(o=0);var i=uY(t.width,t.height,o),a=i.width,s=i.height;return{x:oY(e.x,a,n.width,r),y:oY(e.y,s,n.height,r)}}function oY(e,t,n,r){var o=t*r/2-n/2;return dY(e,-o,o)}function iY(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function aY(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function sY(e,t){return Math.min(e,Math.max(0,t))}function lY(e,t){return t}function cY(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function uY(e,t,n){var r=n*Math.PI/180;return{width:Math.abs(Math.cos(r)*e)+Math.abs(Math.sin(r)*t),height:Math.abs(Math.sin(r)*e)+Math.abs(Math.cos(r)*t)}}function dY(e,t,n){return Math.min(Math.max(e,t),n)}function pY(){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 hY=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=x.createRef(),n.videoRef=x.createRef(),n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc="undefined"!=typeof document?document:null,n.currentWindow="undefined"!=typeof window?window:null,n.resizeObserver=null,n.state={cropSize:null,hasWheelJustStarted:!1},n.initResizeObserver=function(){if(void 0!==window.ResizeObserver&&n.containerRef){var e=!0;n.resizeObserver=new window.ResizeObserver((function(t){e?e=!1:n.computeSizes()})),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd))},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var e=n.computeSizes();e&&(n.emitCropData(),n.setInitialCrop(e)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(e){if(n.props.initialCroppedAreaPercentages){var t=function(e,t,n,r,o,i){var a=uY(t.width,t.height,n),s=dY(r.width/a.width*(100/e.width),o,i);return{crop:{x:s*a.width/2-r.width/2-a.width*s*(e.x/100),y:s*a.height/2-r.height/2-a.height*s*(e.y/100)},zoom:s}}(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom),r=t.crop,o=t.zoom;n.props.onCropChange(r),n.props.onZoomChange&&n.props.onZoomChange(o)}else if(n.props.initialCroppedAreaPixels){var i=function(e,t,n,r,o,i){void 0===n&&(n=0);var a=uY(t.naturalWidth,t.naturalHeight,n),s=dY(function(e,t,n){var r=function(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}(t);return n.height>n.width?n.height/(e.height*r):n.width/(e.width*r)}(e,t,r),o,i),l=r.height>r.width?r.height/e.height:r.width/e.width;return{crop:{x:((a.width-e.width)/2-e.x)*l,y:((a.height-e.height)/2-e.y)*l},zoom:s}}(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom);r=i.crop,o=i.zoom,n.props.onCropChange(r),n.props.onZoomChange&&n.props.onZoomChange(o)}},n.computeSizes=function(){var e,t,r,o,i,a,s=n.imageRef.current||n.videoRef.current;if(s&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect();var l=n.containerRect.width/n.containerRect.height,c=(null===(e=n.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef.current)||void 0===t?void 0:t.videoWidth)||0,u=(null===(r=n.imageRef.current)||void 0===r?void 0:r.naturalHeight)||(null===(o=n.videoRef.current)||void 0===o?void 0:o.videoHeight)||0,d=c/u,p=void 0;if(s.offsetWidth<c||s.offsetHeight<u)switch(n.props.objectFit){default:case"contain":p=l>d?{width:n.containerRect.height*d,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/d};break;case"horizontal-cover":p={width:n.containerRect.width,height:n.containerRect.width/d};break;case"vertical-cover":p={width:n.containerRect.height*d,height:n.containerRect.height};break;case"auto-cover":p=c>u?{width:n.containerRect.width,height:n.containerRect.width/d}:{width:n.containerRect.height*d,height:n.containerRect.height}}else p={width:s.offsetWidth,height:s.offsetHeight};n.mediaSize=eY(eY({},p),{naturalWidth:c,naturalHeight:u}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var h=n.props.cropSize?n.props.cropSize:function(e,t,n,r,o,i){void 0===i&&(i=0);var a=uY(e,t,i),s=a.width,l=a.height,c=Math.min(s,n),u=Math.min(l,r);return c>u*o?{width:u*o,height:u}:{width:c,height:c/o}}(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(null===(i=n.state.cropSize)||void 0===i?void 0:i.height)===h.height&&(null===(a=n.state.cropSize)||void 0===a?void 0:a.width)===h.width||n.props.onCropSizeChange&&n.props.onCropSizeChange(h),n.setState({cropSize:h},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(h),h}},n.onMouseDown=function(e){n.currentDoc&&(e.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e)))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onTouchStart=function(e){n.currentDoc&&(n.isTouching=!0,n.props.onTouchRequest&&!n.props.onTouchRequest(e)||(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onGestureStart=function(e){n.currentDoc&&(e.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureMove),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureMove=function(e){if(e.preventDefault(),!n.isTouching){var r=t.getMousePoint(e),o=n.gestureZoomStart-1+e.scale;if(n.setNewZoom(o,r,{shouldUpdatePosition:!0}),n.props.onRotationChange){var i=n.gestureRotationStart+e.rotation;n.props.onRotationChange(i)}}},n.onGestureEnd=function(e){n.cleanEvents()},n.onDragStart=function(e){var t,r,o=e.x,i=e.y;n.dragStartPosition={x:o,y:i},n.dragStartCrop=eY({},n.props.crop),null===(r=(t=n.props).onInteractionStart)||void 0===r||r.call(t)},n.onDrag=function(e){var t=e.x,r=e.y;n.currentWindow&&(n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==r){var e=t-n.dragStartPosition.x,o=r-n.dragStartPosition.y,i={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+o},a=n.props.restrictPosition?rY(i,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):i;n.props.onCropChange(a)}})))},n.onDragStopped=function(){var e,t;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){if(n.currentWindow&&(!n.props.onWheelRequest||n.props.onWheelRequest(e))){e.preventDefault();var r=t.getMousePoint(e),o=nY()(e).pixelY,i=n.props.zoom-o*n.props.zoomSpeed/200;n.setNewZoom(i,r,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)}},n.getPointOnContainer=function(e){var t=e.x,r=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(t-n.containerRect.left),y:n.containerRect.height/2-(r-n.containerRect.top)}},n.getPointOnMedia=function(e){var t=e.x,r=e.y,o=n.props,i=o.crop,a=o.zoom;return{x:(t+i.x)/a,y:(r+i.y)/a}},n.setNewZoom=function(e,t,r){var o=(void 0===r?{}:r).shouldUpdatePosition,i=void 0===o||o;if(n.state.cropSize&&n.props.onZoomChange){var a=dY(e,n.props.minZoom,n.props.maxZoom);if(i){var s=n.getPointOnContainer(t),l=n.getPointOnMedia(s),c={x:l.x*a-s.x,y:l.y*a-s.y},u=n.props.restrictPosition?rY(c,n.mediaSize,n.state.cropSize,a,n.props.rotation):c;n.props.onCropChange(u)}n.props.onZoomChange(a)}},n.getCropData=function(){return n.state.cropSize?function(e,t,n,r,o,i,a){void 0===i&&(i=0),void 0===a&&(a=!0);var s=a?sY:lY,l=uY(t.width,t.height,i),c=uY(t.naturalWidth,t.naturalHeight,i),u={x:s(100,((l.width-n.width/o)/2-e.x/o)/l.width*100),y:s(100,((l.height-n.height/o)/2-e.y/o)/l.height*100),width:s(100,n.width/l.width*100/o),height:s(100,n.height/l.height*100/o)},d=Math.round(s(c.width,u.width*c.width/100)),p=Math.round(s(c.height,u.height*c.height/100)),h=c.width>=c.height*r?{width:Math.round(p*r),height:p}:{width:d,height:Math.round(d/r)};return{croppedAreaPercentages:u,croppedAreaPixels:eY(eY({},h),{x:Math.round(s(c.width-h.width,u.x*c.width/100)),y:Math.round(s(c.height-h.height,u.y*c.height/100))})}}(n.props.restrictPosition?rY(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition):null},n.emitCropData=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,r=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,r),n.props.onCropAreaChange&&n.props.onCropAreaChange(t,r)}},n.emitCropAreaChange=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,r=e.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(t,r)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?rY(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(e),n.emitCropData()}},n}return function(e,t){function n(){this.constructor=e}QK(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){this.currentDoc&&this.currentWindow&&(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),void 0===window.ResizeObserver&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef))},t.prototype.componentWillUnmount=function(){var e,t;this.currentDoc&&this.currentWindow&&(void 0===window.ResizeObserver&&this.currentWindow.removeEventListener("resize",this.computeSizes),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&(null===(t=this.styleRef.parentNode)||void 0===t||t.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(e){var t,n,r,o,i,a,s,l,c;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():(null===(t=e.cropSize)||void 0===t?void 0:t.height)!==(null===(n=this.props.cropSize)||void 0===n?void 0:n.height)||(null===(r=e.cropSize)||void 0===r?void 0:r.width)!==(null===(o=this.props.cropSize)||void 0===o?void 0:o.width)?this.computeSizes():(null===(i=e.crop)||void 0===i?void 0:i.x)===(null===(a=this.props.crop)||void 0===a?void 0:a.x)&&(null===(s=e.crop)||void 0===s?void 0:s.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())},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=iY(n,r),this.lastPinchRotation=aY(n,r),this.onDragStart(cY(n,r))},t.prototype.onPinchMove=function(e){var n=this;if(this.currentDoc&&this.currentWindow){var r=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]),i=cY(r,o);this.onDrag(i),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame((function(){var e=iY(r,o),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,i,{shouldUpdatePosition:!1}),n.lastPinchDistance=e;var a=aY(r,o),s=n.props.rotation+(a-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(s),n.lastPinchRotation=a}))}},t.prototype.render=function(){var e=this,t=this.props,n=t.image,r=t.video,o=t.mediaProps,i=t.transform,a=t.crop,s=a.x,l=a.y,c=t.rotation,u=t.zoom,d=t.cropShape,p=t.showGrid,h=t.style,m=h.containerStyle,f=h.cropAreaStyle,g=h.mediaStyle,b=t.classes,v=b.containerClassName,y=b.cropAreaClassName,_=b.mediaClassName,k=t.objectFit;return x.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:m,className:pY("reactEasyCrop_Container",v)},n?x.createElement("img",eY({alt:"",className:pY("reactEasyCrop_Image","contain"===k&&"reactEasyCrop_Contain","horizontal-cover"===k&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===k&&"reactEasyCrop_Cover_Vertical","auto-cover"===k&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),_)},o,{src:n,ref:this.imageRef,style:eY(eY({},g),{transform:i||"translate(".concat(s,"px, ").concat(l,"px) rotate(").concat(c,"deg) scale(").concat(u,")")}),onLoad:this.onMediaLoad})):r&&x.createElement("video",eY({autoPlay:!0,loop:!0,muted:!0,className:pY("reactEasyCrop_Video","contain"===k&&"reactEasyCrop_Contain","horizontal-cover"===k&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===k&&"reactEasyCrop_Cover_Vertical","auto-cover"===k&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),_)},o,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:eY(eY({},g),{transform:i||"translate(".concat(s,"px, ").concat(l,"px) rotate(").concat(c,"deg) scale(").concat(u,")")}),controls:!1}),(Array.isArray(r)?r:[{src:r}]).map((function(e){return x.createElement("source",eY({key:e.src},e))}))),this.state.cropSize&&x.createElement("div",{style:eY(eY({},f),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:pY("reactEasyCrop_CropArea","round"===d&&"reactEasyCrop_CropAreaRound",p&&"reactEasyCrop_CropAreaGrid",y)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(x.Component);const mY=100,fY=300,gY={placement:"bottom-start"};function bY({url:e,width:t,height:n,clientWidth:r,naturalHeight:o,naturalWidth:i,borderProps:a}){const{isInProgress:s,editedUrl:l,position:c,zoom:u,aspect:d,setPosition:p,setCrop:h,setZoom:m,rotation:f}=XK();let g=n||r*o/i;return f%180==90&&(g=r*i/o),(0,x.createElement)("div",{className:R()("wp-block-image__crop-area",a?.className,{"is-applying":s}),style:{...a?.style,width:t||r,height:g}},(0,x.createElement)(hY,{image:l||e,disabled:s,minZoom:mY/100,maxZoom:fY/100,crop:c,zoom:u/100,aspect:d,onCropChange:e=>{p(e)},onCropComplete:e=>{h(e)},onZoomChange:e=>{m(100*e)}}),s&&(0,x.createElement)(UD.ZP,null))}var vY=n(47633);function yY(){const{isInProgress:e,zoom:t,setZoom:n}=XK();return(0,x.createElement)(pB.Z,{contentClassName:"wp-block-image__zoom",popoverProps:gY,renderToggle:({isOpen:t,onToggle:n})=>(0,x.createElement)(Jh,{icon:vY.Z,label:(0,$.__)("Zoom"),onClick:n,"aria-expanded":t,disabled:e}),renderContent:()=>(0,x.createElement)(CS,{__nextHasNoMarginBottom:!0,label:(0,$.__)("Zoom"),min:mY,max:fY,value:Math.round(t),onChange:n})})}var _Y=n(53028);function kY({aspectRatios:e,isDisabled:t,label:n,onClick:r,value:o}){return(0,x.createElement)($k.Z,{label:n},e.map((({title:e,aspect:n})=>(0,x.createElement)(Wk.Z,{key:n,disabled:t,onClick:()=>{r(n)},role:"menuitemradio",isSelected:n===o,icon:n===o?aG.Z:void 0},e))))}function wY({toggleProps:e}){const{isInProgress:t,aspect:n,setAspect:r,defaultAspect:o}=XK();return(0,x.createElement)(em.Z,{icon:_Y.Z,label:(0,$.__)("Aspect Ratio"),popoverProps:gY,toggleProps:e,className:"wp-block-image__aspect-ratio"},(({onClose:e})=>(0,x.createElement)(x.Fragment,null,(0,x.createElement)(kY,{isDisabled:t,onClick:t=>{r(t),e()},value:n,aspectRatios:[{title:(0,$.__)("Original"),aspect:o},{title:(0,$.__)("Square"),aspect:1}]}),(0,x.createElement)(kY,{label:(0,$.__)("Landscape"),isDisabled:t,onClick:t=>{r(t),e()},value:n,aspectRatios:[{title:(0,$.__)("16:10"),aspect:1.6},{title:(0,$.__)("16:9"),aspect:16/9},{title:(0,$.__)("4:3"),aspect:4/3},{title:(0,$.__)("3:2"),aspect:1.5}]}),(0,x.createElement)(kY,{label:(0,$.__)("Portrait"),isDisabled:t,onClick:t=>{r(t),e()},value:n,aspectRatios:[{title:(0,$.__)("10:16"),aspect:.625},{title:(0,$.__)("9:16"),aspect:9/16},{title:(0,$.__)("3:4"),aspect:3/4},{title:(0,$.__)("2:3"),aspect:2/3}]}))))}var EY=n(38010);function CY(){const{isInProgress:e,rotateClockwise:t}=XK();return(0,x.createElement)(Jh,{icon:EY.Z,label:(0,$.__)("Rotate"),onClick:t,disabled:e})}function xY(){const{isInProgress:e,apply:t,cancel:n}=XK();return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(Jh,{onClick:t,disabled:e},(0,$.__)("Apply")),(0,x.createElement)(Jh,{onClick:n},(0,$.__)("Cancel")))}function SY({id:e,url:t,width:n,height:r,clientWidth:o,naturalHeight:i,naturalWidth:a,onSaveImage:s,onFinishEditing:l,borderProps:c}){return(0,x.createElement)(JK,{id:e,url:t,naturalWidth:a,naturalHeight:i,onSaveImage:s,onFinishEditing:l},(0,x.createElement)(bY,{borderProps:c,url:t,width:n,height:r,clientWidth:o,naturalHeight:i,naturalWidth:a}),(0,x.createElement)(Hk,null,(0,x.createElement)(nm,null,(0,x.createElement)(yY,null),(0,x.createElement)(qh.Z,null,(e=>(0,x.createElement)(wY,{toggleProps:e}))),(0,x.createElement)(CY,null)),(0,x.createElement)(nm,null,(0,x.createElement)(xY,null))))}var IY=n(77701);function TY({url:e,urlLabel:t,className:n}){const r=R()(n,"block-editor-url-popover__link-viewer-url");return e?(0,x.createElement)(eI.Z,{className:r,href:e},t||(0,aj.w)((0,oj.x)(e))):(0,x.createElement)("span",{className:r})}const{__experimentalPopoverLegacyPositionToPlacement:NY}=Jy(Mk);function PY({additionalControls:e,children:t,renderSettings:n,placement:r,focusOnMount:o="firstElement",position:i,...a}){let s;void 0!==i&&(0,q.Z)("`position` prop in wp.blockEditor.URLPopover",{since:"6.2",alternative:"`placement` prop"}),void 0!==r?s=r:void 0!==i&&(s=NY(i)),s=s||"bottom";const[l,c]=(0,x.useState)(!1),u=!!n&&l;return(0,x.createElement)(H_.ZP,{className:"block-editor-url-popover",focusOnMount:o,placement:s,shift:!0,...a},(0,x.createElement)("div",{className:"block-editor-url-popover__input-container"},(0,x.createElement)("div",{className:"block-editor-url-popover__row"},t,!!n&&(0,x.createElement)(Gh.ZP,{className:"block-editor-url-popover__settings-toggle",icon:IY.Z,label:(0,$.__)("Link settings"),onClick:()=>{c(!l)},"aria-expanded":l})),u&&(0,x.createElement)("div",{className:"block-editor-url-popover__row block-editor-url-popover__settings"},n())),e&&!u&&(0,x.createElement)("div",{className:"block-editor-url-popover__additional-controls"},e))}PY.LinkEditor=function({autocompleteRef:e,className:t,onChangeInputValue:n,value:r,...o}){return(0,x.createElement)("form",{className:R()("block-editor-url-popover__link-editor",t),...o},(0,x.createElement)(qF,{__nextHasNoMarginBottom:!0,value:r,onChange:n,autocompleteRef:e}),(0,x.createElement)(Gh.ZP,{icon:MF.Z,label:(0,$.__)("Apply"),type:"submit"}))},PY.LinkViewer=function({className:e,linkClassName:t,onEditLinkClick:n,url:r,urlLabel:o,...i}){return(0,x.createElement)("div",{className:R()("block-editor-url-popover__link-viewer",e),...i},(0,x.createElement)(TY,{url:r,urlLabel:o,className:t}),n&&(0,x.createElement)(Gh.ZP,{icon:Aj.Z,label:(0,$.__)("Edit"),onClick:n}))};var RY=PY;const AY=()=>{},BY=({src:e,onChange:t,onSubmit:n,onClose:r,popoverAnchor:o})=>(0,x.createElement)(RY,{anchor:o,onClose:r},(0,x.createElement)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:n},(0,x.createElement)("input",{className:"block-editor-media-placeholder__url-input-field",type:"text","aria-label":(0,$.__)("URL"),placeholder:(0,$.__)("Paste or type URL"),onChange:t,value:e}),(0,x.createElement)(Gh.ZP,{className:"block-editor-media-placeholder__url-input-submit-button",icon:MF.Z,label:(0,$.__)("Apply"),type:"submit"}))),LY=({isURLInputVisible:e,src:t,onChangeSrc:n,onSubmitSrc:r,openURLInput:o,closeURLInput:i})=>{const[a,s]=(0,x.useState)(null);return(0,x.createElement)("div",{className:"block-editor-media-placeholder__url-input-container",ref:s},(0,x.createElement)(Gh.ZP,{className:"block-editor-media-placeholder__button",onClick:o,isPressed:e,variant:"tertiary"},(0,$.__)("Insert from URL")),e&&(0,x.createElement)(BY,{src:t,onChange:n,onSubmit:r,onClose:i,popoverAnchor:a}))};var MY=sT("editor.MediaPlaceholder")((function({value:e={},allowedTypes:t,className:n,icon:r,labels:o={},mediaPreview:i,notices:a,isAppender:s,accept:l,addToGallery:c,multiple:u=!1,handleUpload:d=!0,disableDropZone:p,disableMediaButtons:h,onError:m,onSelect:f,onCancel:g,onSelectURL:b,onToggleFeaturedImage:v,onDoubleClick:y,onFilesPreUpload:_=AY,onHTMLDrop:k,children:w,mediaLibraryButton:E,placeholder:C,style:S}){k&&(0,q.Z)("wp.blockEditor.MediaPlaceholder onHTMLDrop prop",{since:"6.2",version:"6.4"});const I=(0,yl.Z)((e=>{const{getSettings:t}=e(e_);return t().mediaUpload}),[]),[T,N]=(0,x.useState)(""),[P,A]=(0,x.useState)(!1);(0,x.useEffect)((()=>{var t;N(null!==(t=e?.src)&&void 0!==t?t:"")}),[e?.src]);const B=e=>{N(e.target.value)},L=()=>{A(!0)},M=()=>{A(!1)},D=e=>{e.preventDefault(),T&&b&&(b(T),M())},O=n=>{if(!d)return f(n);let r;if(_(n),u)if(c){let t=[];r=n=>{const r=(null!=e?e:[]).filter((e=>e.id?!t.some((({id:t})=>Number(t)===Number(e.id))):!t.some((({urlSlug:t})=>e.url.includes(t)))));f(r.concat(n)),t=n.map((e=>{const t=e.url.lastIndexOf("."),n=e.url.slice(0,t);return{id:e.id,urlSlug:n}}))}}else r=f;else r=([e])=>f(e);I({allowedTypes:t,filesList:n,onFileChange:r,onError:m})};async function F(e){const n=Hh({HTML:e});return await async function(e){if(!e||!Array.isArray(e))return;const n=function e(t){return t.flatMap((t=>"core/image"!==t.name&&"core/audio"!==t.name&&"core/video"!==t.name||!t.attributes.url?e(t.innerBlocks):[t]))}(e);if(!n.length)return;const r=await Promise.all(n.map((e=>e.attributes.id?e.attributes:new Promise(((n,r)=>{window.fetch(e.attributes.url).then((e=>e.blob())).then((o=>I({filesList:[o],additionalData:{title:e.attributes.title,alt_text:e.attributes.alt,caption:e.attributes.caption},onFileChange:([e])=>{e.id&&n(e)},allowedTypes:t,onError:r}))).catch((()=>n(e.attributes.url)))}))))).catch((e=>m(e)));f(u?r:r[0])}(n)}const j=e=>{O(e.target.files)},Z=null!=C?C:e=>{let{instructions:l,title:c}=o;if(I||b||(l=(0,$.__)("To edit this block, you need permission to upload media.")),void 0===l||void 0===c){const e=null!=t?t:[],[n]=e,r=1===e.length,o=r&&"audio"===n,i=r&&"image"===n,a=r&&"video"===n;void 0===l&&I&&(l=(0,$.__)("Upload a media file or pick one from your media library."),o?l=(0,$.__)("Upload an audio file, pick one from your media library, or add one with a URL."):i?l=(0,$.__)("Upload an image file, pick one from your media library, or add one with a URL."):a&&(l=(0,$.__)("Upload a video file, pick one from your media library, or add one with a URL."))),void 0===c&&(c=(0,$.__)("Media"),o?c=(0,$.__)("Audio"):i?c=(0,$.__)("Image"):a&&(c=(0,$.__)("Video")))}const u=R()("block-editor-media-placeholder",n,{"is-appender":s});return(0,x.createElement)(WK,{icon:r,label:c,instructions:l,className:u,notices:a,onDoubleClick:y,preview:i,style:S},e,w)},z=()=>p?null:(0,x.createElement)(xF,{onFilesDrop:O,onHTMLDrop:F}),V=()=>g&&(0,x.createElement)(Gh.ZP,{className:"block-editor-media-placeholder__cancel-button",title:(0,$.__)("Cancel"),variant:"link",onClick:g},(0,$.__)("Cancel")),H=()=>b&&(0,x.createElement)(LY,{isURLInputVisible:P,src:T,onChangeSrc:B,onSubmitSrc:D,openURLInput:L,closeURLInput:M}),U=()=>v&&(0,x.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,x.createElement)(Gh.ZP,{className:"block-editor-media-placeholder__button",onClick:v,variant:"tertiary"},(0,$.__)("Use featured image")));return h?(0,x.createElement)(iO,null,z()):(0,x.createElement)(iO,{fallback:Z(H())},(()=>{const n=null!=E?E:({open:e})=>(0,x.createElement)(Gh.ZP,{variant:"tertiary",onClick:()=>{e()}},(0,$.__)("Media Library")),r=(0,x.createElement)(aO,{addToGallery:c,gallery:u&&!(!t||0===t.length)&&t.every((e=>"image"===e||e.startsWith("image/"))),multiple:u,onSelect:f,allowedTypes:t,mode:"browse",value:Array.isArray(e)?e.map((({id:e})=>e)):e.id,render:n});if(I&&s)return(0,x.createElement)(x.Fragment,null,z(),(0,x.createElement)(TF,{onChange:j,accept:l,multiple:!!u,render:({openFileDialog:e})=>{const t=(0,x.createElement)(x.Fragment,null,(0,x.createElement)(Gh.ZP,{variant:"primary",className:R()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:e},(0,$.__)("Upload")),r,H(),U(),V());return Z(t)}}));if(I){const e=(0,x.createElement)(x.Fragment,null,z(),(0,x.createElement)(TF,{variant:"primary",className:R()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:j,accept:l,multiple:!!u},(0,$.__)("Upload")),r,H(),U(),V());return Z(e)}return Z(r)})())})),DY=n(56982),OY=n(28619),FY=n(45554),jY=n(74947);function ZY(e){const t=e.useItems?e.useItems:function(e){return t=>{const[n,r]=(0,x.useState)([]);return(0,x.useLayoutEffect)((()=>{const{options:n,isDebounced:o}=e,i=(0,aT.D)((()=>{const o=Promise.resolve("function"==typeof n?n(t):n).then((n=>{if(o.canceled)return;const i=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)}))),a=new RegExp("(?:\\b|\\s|^)"+tx(t),"i");r(function(e,t=[],n=10){const r=[];for(let o=0;o<t.length;o++){const i=t[o];let{keywords:a=[]}=i;if("string"==typeof i.label&&(a=[...a,i.label]),a.some((t=>e.test($c()(t))))&&(r.push(i),r.length===n))break}return r}(a,i))}));return o}),o?250:0),a=i();return()=>{i.cancel(),a&&(a.canceled=!0)}}),[t]),[n]}}(e);return function({filterValue:e,instanceId:n,listBoxId:r,className:o,selectedIndex:i,onChangeOptions:a,onSelect:s,onReset:l,reset:c,contentRef:u}){const[d]=t(e),p=(0,FY.useAnchor)({editableContentElement:u.current}),[h,m]=(0,x.useState)(!1),f=(0,x.useRef)(null),g=(0,Kx.Z)([f,(0,OY.Z)((e=>{u.current&&m(e.ownerDocument!==u.current.ownerDocument)}),[u])]);var b,v;b=f,v=c,(0,x.useEffect)((()=>{const e=e=>{b.current&&!b.current.contains(e.target)&&v(e)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}}),[v]);const y=(0,VZ.Z)(yI.speak,500);if((0,x.useLayoutEffect)((()=>{a(d),function(t){y&&(t.length?y(e?(0,d_.sprintf)((0,d_._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):(0,d_.sprintf)((0,d_._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.",t.length),t.length),"assertive"):y((0,d_.__)("No results."),"assertive"))}(d)}),[d]),0===d.length)return null;const _=({Component:e="div"})=>(0,x.createElement)(e,{id:r,role:"listbox",className:"components-autocomplete__results"},d.map(((e,t)=>(0,x.createElement)(Gh.ZP,{key:e.key,id:`components-autocomplete-item-${n}-${e.key}`,role:"option","aria-selected":t===i,disabled:e.isDisabled,className:R()("components-autocomplete__result",o,{"is-selected":t===i}),onClick:()=>s(e)},e.label))));return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(H_.ZP,{focusOnMount:!1,onClose:l,placement:"top-start",className:"components-autocomplete__popover",anchor:p,ref:g},(0,x.createElement)(_,null)),u.current&&h&&(0,eT.createPortal)((0,x.createElement)(_,{Component:h_.Z}),u.current.ownerDocument.body))}}const zY=e=>{if(null===e)return"";switch(typeof e){case"string":case"number":return e.toString();case"boolean":default:return"";case"object":if(e instanceof Array)return e.map(zY).join("");if("props"in e)return zY(e.props.children)}return""},VY=[];function HY({record:e,onChange:t,onReplace:n,completers:r,contentRef:o}){const i=(0,cw.Z)(HY),[a,s]=(0,x.useState)(0),[l,c]=(0,x.useState)(VY),[u,d]=(0,x.useState)(""),[p,h]=(0,x.useState)(null),[m,f]=(0,x.useState)(null),g=(0,x.useRef)(!1);function b(r){const{getOptionCompletion:o}=p||{};if(!r.isDisabled){if(o){const a=o(r.value,u),s=null!==(i=a)&&"object"==typeof i&&"action"in i&&void 0!==i.action&&"value"in i&&void 0!==i.value?a:{action:"insert-at-caret",value:a};if("replace"===s.action)return void n([s.value]);"insert-at-caret"===s.action&&function(n){if(null===p)return;const r=e.start,o=r-p.triggerPrefix.length-u.length,i=(0,FY.create)({html:(0,DY.ZP)(n)});t((0,FY.insert)(e,i,o,r))}(s.value)}v()}var i}function v(){s(0),c(VY),d(""),h(null),f(null)}const y=(0,x.useMemo)((()=>(0,FY.isCollapsed)(e)?(0,FY.getTextContent)((0,FY.slice)(e,0)):""),[e]);(0,x.useEffect)((()=>{if(!y)return void(p&&v());const t=r?.find((({triggerPrefix:t,allowContext:n})=>{const r=y.lastIndexOf(t);if(-1===r)return!1;const o=y.slice(r+t.length);if(o.length>50)return!1;const i=0===l.length,a=1===o.split(/\s/).length,s=g.current&&o.split(/\s/).length<=3;if(i&&!s&&!a)return!1;const c=(0,FY.getTextContent)((0,FY.slice)(e,void 0,(0,FY.getTextContent)(e).length));return!(n&&!n(y.slice(0,r),c))&&!/^\s/.test(o)&&!/\s\s+$/.test(o)&&/[\u0000-\uFFFF]*$/.test(o)}));if(!t)return void(p&&v());const n=tx(t.triggerPrefix),o=$c()(y),i=o.slice(o.lastIndexOf(t.triggerPrefix)).match(new RegExp(`${n}([\0-]*)$`)),a=i&&i[1];h(t),f((()=>t!==p?ZY(t):m)),d(null===a?"":a)}),[y]);const{key:_=""}=l[a]||{},{className:k}=p||{},w=!!p&&l.length>0,E=w?`components-autocomplete-listbox-${i}`:void 0;return{listBoxId:E,activeId:w?`components-autocomplete-item-${i}-${_}`:null,onKeyDown:function(e){if(g.current="Backspace"===e.key,p&&0!==l.length&&!e.defaultPrevented&&!e.isComposing&&229!==e.keyCode){switch(e.key){case"ArrowUp":{const e=(0===a?l.length:a)-1;s(e),(0,jY.R)()&&(0,yI.speak)(zY(l[e].label),"assertive");break}case"ArrowDown":{const e=(a+1)%l.length;s(e),(0,jY.R)()&&(0,yI.speak)(zY(l[e].label),"assertive");break}case"Escape":h(null),f(null),e.preventDefault();break;case"Enter":b(l[a]);break;case"ArrowLeft":case"ArrowRight":return void v();default:return}e.preventDefault()}},popover:void 0!==e.start&&m&&(0,x.createElement)(m,{className:k,filterValue:u,instanceId:i,listBoxId:E,selectedIndex:a,onChangeOptions:function(e){s(e.length===l.length?a:0),c(e)},onSelect:b,value:e,contentRef:o,reset:v})}}const UY=()=>{};var $Y={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n,prioritizedBlocks:r}=(0,yl.Z)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockListSettings:r,getBlockRootClientId:o}=e(e_),i=t(),a=o(i);return{selectedBlockName:i?n(i):null,rootClientId:a,prioritizedBlocks:r(a)?.prioritizedInserterBlocks}}),[]),[o,i,a]=aM(t,UY),s=(0,x.useMemo)((()=>(e.trim()?JM(o,i,a,e):pO(Jf(o,"frecency","desc"),r)).filter((e=>e.name!==n)).slice(0,9)),[e,n,o,i,a,r]),l=(0,x.useMemo)((()=>s.map((e=>{const{title:t,icon:n,isDisabled:r}=e;return{key:`block-${e.id}`,value:e,label:(0,x.createElement)(x.Fragment,null,(0,x.createElement)(EB,{key:"icon",icon:n,showColors:!0}),t),isDisabled:r}}))),[s]);return[l]},allowContext(e,t){return!(/\S/.test(e)||/\S/.test(t))},getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:r,syncStatus:o,content:i}=e;return{action:"replace",value:"unsynced"===o?Lp(i,{__unstableSkipMigrationLogs:!0}):fc(t,n,gc(r))}}},WY=n(24547),GY={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await(0,I.default)({path:(0,G.f)("/wp/v2/search",{per_page:10,search:e,type:"post",order_by:"menu_order"})});return t=t.filter((e=>""!==e.title)),t},getOptionKeywords(e){return[...e.title.split(/\s+/)]},getOptionLabel(e){return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(ox.Z,{key:"icon",icon:"page"===e.subtype?QF.Z:WY.Z}),e.title)},getOptionCompletion(e){return(0,x.createElement)("a",{href:e.url},e.title)}};const qY=[];function KY({completers:e=qY}){const{name:t}=i_();return(0,x.useMemo)((()=>{let n=[...e,GY];return(t===ac()||cc(t,"__experimentalSlashInserter",!1))&&(n=[...n,$Y]),(0,mc.hasFilter)("editor.Autocomplete.completers")&&(n===e&&(n=n.map((e=>({...e})))),n=(0,mc.applyFilters)("editor.Autocomplete.completers",n,t)),n}),[e,t])}const YY={placement:"bottom-start"};var XY=()=>(0,x.createElement)(x.Fragment,null,["bold","italic","link","unknown"].map((e=>(0,x.createElement)(kl.g7,{name:`RichText.ToolbarControls.${e}`,key:e}))),(0,x.createElement)(kl.g7,{name:"RichText.ToolbarControls"},(e=>{if(!e.length)return null;const t=e.map((([{props:e}])=>e)).some((({isActive:e})=>e));return(0,x.createElement)(qh.Z,null,(n=>(0,x.createElement)(em.Z,{icon:IY.Z,label:(0,$.__)("More"),toggleProps:{...n,className:R()(n.className,{"is-pressed":t}),describedBy:(0,$.__)("Displays more block tools")},controls:Jf(e.map((([{props:e}])=>e)),"title"),popoverProps:YY})))})));var JY=(0,x.createContext)(void 0),QY=(0,ww.Bi)((e=>{var t=e,{store:n}=t,r=(0,fw.S0)(t,["store"]);const o=n.useState((e=>"both"===e.orientation?void 0:e.orientation));return r=(0,Ew.OJ)(r,(e=>(0,Cw.jsx)(JY.Provider,{value:n,children:e})),[n]),r=(0,fw.ih)({role:"toolbar","aria-orientation":o},r),(0,kw.Q)((0,fw.ih)({store:n},r))})),eX=(0,ww.LM)((e=>{const t=QY(e);return(0,ww.az)("div",t)})),tX=(0,x.forwardRef)((function({label:e,...t},n){const r=function(e={}){const t=function(e){return(0,hw.bD)(e)}(e),n=(0,mw.oR)((()=>function(e={}){var t;const n=null==(t=e.store)?void 0:t.getState();return(0,gw.t)((0,yw.EZ)((0,yw.ih)({},e),{orientation:(0,vw.LS)(e.orientation,null==n?void 0:n.orientation,"horizontal"),focusLoop:(0,vw.LS)(e.focusLoop,null==n?void 0:n.focusLoop,!0)}))}((0,fw.ih)((0,fw.ih)({},e),t))));return function(e,t){return(0,hw.Py)(e,t)}(n,e)}({focusLoop:!0,rtl:(0,d_.isRTL)()});return(0,x.createElement)(Kh.Z.Provider,{value:r},(0,x.createElement)(eX,{ref:n,"aria-label":e,store:r,...t}))}));const nX={DropdownMenu:{variant:"toolbar"},Dropdown:{variant:"toolbar"}};var rX=(0,x.forwardRef)((function({className:e,label:t,...n},r){if(!t){(0,p_.default)("Using Toolbar without label prop",{since:"5.6",alternative:"ToolbarGroup component",link:"https://developer.wordpress.org/block-editor/components/toolbar/"});const{title:t,...r}=n;return(0,x.createElement)(nm,{isCollapsed:!1,...r,className:e})}const o=R()("components-accessible-toolbar",e);return(0,x.createElement)(Sk.G8,{value:nX},(0,x.createElement)(tX,{className:o,label:t,ref:r,...n}))}));function oX(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}var iX=function({children:e,focusOnMount:t,shouldUseKeyboardFocusShortcut:n=!0,__experimentalInitialIndex:r,__experimentalOnIndexChange:o,...i}){const a=(0,x.useRef)(),s=function(e){const[t,n]=(0,x.useState)(!0),r=(0,x.useCallback)((()=>{const t=!TA.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||(0,q.Z)("Using custom components as toolbar controls",{since:"5.6",alternative:"ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",link:"https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"}),n(t)}),[]);return(0,x.useLayoutEffect)((()=>{const t=new window.MutationObserver(r);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[t]),t}(a);return function(e,t,n,r,o,i){const[a]=(0,x.useState)(t),[s]=(0,x.useState)(r),l=(0,x.useCallback)((()=>{!function(e){const[t]=TA.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)}),[]);(0,RB.bx)("core/block-editor/focus-toolbar",(()=>{i&&l()})),(0,x.useEffect)((()=>{a&&l()}),[n,a,l]),(0,x.useEffect)((()=>{const t=e.current;let n=0;return a||(n=window.requestAnimationFrame((()=>{const e=oX(t),n=s||0;e[n]&&function(e){return e.contains(e.ownerDocument.activeElement)}(t)&&e[n].focus({preventScroll:!0})}))),()=>{if(window.cancelAnimationFrame(n),!o||!t)return;const e=oX(t).findIndex((e=>0===e.tabIndex));o(e)}}),[s,a])}(a,t,s,r,o,n),s?(0,x.createElement)(rX,{label:i["aria-label"],ref:a,...i},e):(0,x.createElement)(IF.ZP,{orientation:"horizontal",role:"toolbar",ref:a,...i},e)};function aX({editableContentElement:e,activeFormats:t}){const n=t[t.length-1],r=n?.type,o=xf({editableContentElement:e,settings:(0,yl.Z)((e=>e(Rm).getFormatType(r)),[r])});return(0,x.createElement)(sX,{popoverAnchor:o})}function sX({popoverAnchor:e}){return(0,x.createElement)(H_.ZP,{placement:"top",focusOnMount:!1,anchor:e,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar"},(0,x.createElement)(iX,{className:"block-editor-rich-text__inline-format-toolbar-group","aria-label":(0,$.__)("Format tools")},(0,x.createElement)(nm,null,(0,x.createElement)(XY,null))))}var lX=({inline:e,editableContentElement:t,value:n})=>{const r=(0,yl.Z)((e=>e(e_).getSettings().hasInlineToolbar),[]);if(e)return(0,x.createElement)(sX,{popoverAnchor:t});if(r){const e=qm(n);return Xm(n)&&!e.length?null:(0,x.createElement)(aX,{editableContentElement:t,activeFormats:e})}return(0,x.createElement)(Hk,{group:"inline"},(0,x.createElement)(XY,null))};function cX(){const{didAutomaticChange:e,getSettings:t}=(0,yl.Z)(e_);return If((n=>{function r(n){const{keyCode:r}=n;if(n.defaultPrevented)return;if(r!==Hf.yY&&r!==Hf.ZH&&r!==Hf.hY)return;const{__experimentalUndo:o}=t();o&&e()&&(n.preventDefault(),o())}return n.addEventListener("keydown",r),()=>{n.removeEventListener("keydown",r)}}),[])}function uX(e,t){if(t?.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}function dX(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function pX({allowedFormats:e,disableFormats:t}){return t?pX.EMPTY_ARRAY:e}pX.EMPTY_ARRAY=[];const hX=e=>th(".*").test(e);function mX({value:e,pastedBlocks:t=[],onReplace:n,onSplit:r}){if(!n||!r)return;const{start:o=0,end:i=0}=e,a={...e,start:o,end:i},s=[],[l,c]=af(a),u=t.length>0;let d=-1;const p=Jm(l)&&!Jm(c);u&&Jm(l)||(s.push(r(pf({value:l}),!p)),d+=1),u&&(s.push(...t),d+=t.length),u&&Jm(c)||s.push(r(pf({value:c}),p)),n(s,u?d:1,u?-1:0)}function fX(e,t){if(t&&1===e?.length&&0===e[0].type.indexOf("image/")){const e=/<\s*img\b/gi;if(1!==t.match(e)?.length)return!0;const n=/<\s*img\b[^>]*\bsrc="file:\/\//i;if(t.match(n))return!0}return!1}function gX(e){const t=(0,x.useRef)(e);return t.current=e,If((e=>{function n(e){const{isSelected:n,disableFormats:r,onChange:o,value:i,formatTypes:a,tagName:s,onReplace:l,onSplit:c,__unstableEmbedURLOnPaste:u,preserveWhiteSpace:d,pastePlainText:p}=t.current;if(!n)return;const{clipboardData:h}=e;let m="",f="";try{m=h.getData("text/plain"),f=h.getData("text/html")}catch(e){try{f=h.getData("Text")}catch(e){return}}if(f=function(e){const t="\x3c!--StartFragment--\x3e",n=e.indexOf(t);if(!(n>-1))return e;const r=(e=e.substring(n+20)).indexOf("\x3c!--EndFragment--\x3e");return r>-1&&(e=e.substring(0,r)),e}(f),f=function(e){const t="<meta charset='utf-8'>";return e.startsWith(t)?e.slice(22):e}(f),e.preventDefault(),window.console.log("Received HTML:\n\n",f),window.console.log("Received plain text:\n\n",m),r)return void o(nf(i,m));const g=a.reduce(((e,{__unstablePasteRule:t})=>(t&&e===i&&(e=t(i,{html:f,plainText:m})),e)),i);if(g!==i)return void o(g);const b=[...XO(h)];if("true"===h.getData("rich-text")){const e=Zm({html:f,preserveWhiteSpace:d});return uX(e,i.activeFormats),void o(nf(i,e))}if(p)return void o(nf(i,Zm({text:m})));if(b?.length&&window.console.log("Received items:\n\n",b),b?.length&&!fX(b,f)){const e=Ec("from"),t=b.reduce(((t,n)=>{const r=wc(e,(e=>"files"===e.type&&e.isMatch([n])));return r&&t.push(r.transform([n])),t}),[]).flat();if(!t.length)return;return void(l&&Jm(i)?l(t):mX({value:i,pastedBlocks:t,onReplace:l,onSplit:c}))}let v=l&&c?"AUTO":"INLINE";"AUTO"===v&&Jm(i)&&hX(m)&&(v="BLOCKS"),u&&Jm(i)&&(0,$F.P)(m.trim())&&(v="BLOCKS");const y=Hh({HTML:f,plainText:m,mode:v,tagName:s,preserveWhiteSpace:d});if("string"==typeof y){const e=Zm({html:y});uX(e,i.activeFormats),o(nf(i,e))}else y.length>0&&(l&&Jm(i)?l(y,y.length-1,-1):mX({value:i,pastedBlocks:y,onReplace:l,onSplit:c}))}return e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}}),[])}const bX=["`",'"',"'","“”","‘’"];function vX(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,_l.Z)(e_),r=(0,x.useRef)(e);return r.current=e,If((e=>{function o(o){const{inputType:i,data:a}=o,{value:s,onChange:l}=r.current;if("insertText"!==i)return;if(Xm(s))return;const c=(0,mc.applyFilters)("blockEditor.wrapSelectionSettings",bX).find((([e,t])=>e===a||t===a));if(!c)return;const[u,d=u]=c,p=s.start,h=s.end+u.length;let m=nf(s,u,p,p);m=nf(m,d,h,h),t(),l(m),n();const f={};for(const e in o)f[e]=o[e];f.data=d;const{ownerDocument:g}=e,{defaultView:b}=g,v=new b.InputEvent("input",f);window.queueMicrotask((()=>{o.target.dispatchEvent(v)})),o.preventDefault()}return e.addEventListener("beforeinput",o),()=>{e.removeEventListener("beforeinput",o)}}),[])}function yX(e){let t=e.length;for(;t--;){const n=Fv(e[t].attributes);if(n)return e[t].attributes[n]=e[t].attributes[n].replace(Ov,""),[e[t].clientId,n,0,0];const r=yX(e[t].innerBlocks);if(r)return r}return[]}function _X(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,_l.Z)(e_),r=(0,x.useRef)(e);return r.current=e,If((e=>{function o(){const{getValue:e,onReplace:t,selectionChange:o}=r.current;if(!t)return;const i=e(),{start:a,text:s}=i;if(" "!==s.slice(a-1,a))return;const l=s.slice(0,a).trim(),c=wc(Ec("from").filter((({type:e})=>"prefix"===e)),(({prefix:e})=>l===e));if(!c)return;const u=pf({value:nf(i,Ov,0,a)}),d=c.transform(u);return o(...yX([d])),t([d]),n(),!0}function i(e){const{inputType:i,type:a}=e,{getValue:s,onChange:l,__unstableAllowPrefixTransformations:c,formatTypes:u}=r.current;if("insertText"!==i&&"compositionend"!==a)return;if(c&&o&&o())return;const d=s(),p=u.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:nf(e," 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️")}(d));p!==d&&(t(),l({...p,activeFormats:d.activeFormats}),n())}return e.addEventListener("input",i),e.addEventListener("compositionend",i),()=>{e.removeEventListener("input",i),e.removeEventListener("compositionend",i)}}),[])}function kX(e){const t=(0,x.useRef)(e);return t.current=e,If((e=>{function n(e){const{keyCode:n}=e;if(e.defaultPrevented)return;const{value:r,onMerge:o,onRemove:i}=t.current;if(n===Hf.yY||n===Hf.ZH){const{start:t,end:a,text:s}=r,l=n===Hf.ZH,c=r.activeFormats&&!!r.activeFormats.length;if(!Xm(r)||c||l&&0!==t||!l&&a!==s.length)return;o&&o(!l),i&&Jm(r)&&l&&i(!l),e.preventDefault()}}return e.addEventListener("keydown",n),()=>{e.removeEventListener("keydown",n)}}),[])}function wX(e){const t=(0,Tf.Z)(),{__unstableMarkAutomaticChange:n}=(0,_l.Z)(e_),r=(0,x.useRef)(e);return r.current=e,If((e=>{function o(e){if(e.defaultPrevented)return;if(e.keyCode!==Hf.K5)return;const{removeEditorOnlyFormats:o,value:i,onReplace:a,onSplit:s,onChange:l,disableLineBreaks:c,onSplitAtEnd:u,onSplitAtDoubleLineEnd:d}=r.current;e.preventDefault();const p={...i};p.formats=o(i);const h=a&&s;if(a){const e=wc(Ec("from").filter((({type:e})=>"enter"===e)),(e=>e.regExp.test(p.text)));e&&(a([e.transform({content:p.text})]),n())}const{text:m,start:f,end:g}=p;e.shiftKey?c||l(nf(p,"\n")):h?mX({value:p,onReplace:a,onSplit:s}):u&&f===g&&g===m.length?u():d&&f===g&&g===m.length&&"\n\n"===m.slice(-2)?t.batch((()=>{p.start=p.end-2,l(rf(p)),d()})):c||l(nf(p,"\n"))}return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o)}}),[])}function EX(e){return e(Rm).getFormatTypes()}const CX=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function xX(e,t){return"object"!=typeof e?{[t]:e}:Object.fromEntries(Object.entries(e).map((([e,n])=>[`${t}.${e}`,n])))}function SX(e,t){return e[t]?e[t]:Object.keys(e).filter((e=>e.startsWith(t+"."))).reduce(((n,r)=>(n[r.slice(t.length+1)]=e[r],n)),{})}function IX(e){return If((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}}),[])}function TX(e){return If((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("input",n),()=>{t.removeEventListener("input",n)}}),[])}function NX(){const{__unstableMarkLastChangeAsPersistent:e}=(0,_l.Z)(e_);return If((t=>{function n(t){"insertReplacementText"===t.inputType&&e()}return t.addEventListener("beforeinput",n),()=>{t.removeEventListener("beforeinput",n)}}),[])}function PX(){const{isMultiSelecting:e}=(0,yl.Z)(e_);return If((t=>{function n(){if(!e())return;const n=t.parentElement.closest('[contenteditable="true"]');n&&n.focus()}return t.addEventListener("focus",n),()=>{t.removeEventListener("focus",n)}}),[])}const RX={},AX=Symbol("usesContext");function BX({onChange:e,onFocus:t,value:n,forwardedRef:r,settings:o}){const{name:i,edit:a,[AX]:s}=o,l=(0,x.useContext)(mT),c=(0,x.useMemo)((()=>s?Object.fromEntries(Object.entries(l).filter((([e])=>s.includes(e)))):RX),[s,l]);if(!a)return null;const u=Km(n,i),d=void 0!==u,p=function({start:e,end:t,replacements:n,text:r}){if(e+1===t&&r[e]===Om)return n[e]}(n),h=void 0!==p&&p.type===i;return(0,x.createElement)(a,{key:i,isActive:d,activeAttributes:d&&u.attributes||{},isObjectActive:h,activeObjectAttributes:h&&p.attributes||{},value:n,onChange:e,onFocus:t,contentRef:r,context:c})}function LX({formatTypes:e,...t}){return e.map((e=>(0,x.createElement)(BX,{settings:e,...t,key:e.name})))}const MX=({value:e,tagName:t,multiline:n,...r})=>{Array.isArray(e)&&((0,q.Z)("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),e=wp.toHTML(e));const o=dX(n);!e&&o&&(e=`<${o}></${o}>`);const i=(0,x.createElement)(nd,null,e);if(t){const{format:e,...n}=r;return(0,x.createElement)(t,{...n},i)}return i};var DX=(0,x.forwardRef)((function({children:e,identifier:t,tagName:n="div",value:r="",onChange:o,multiline:i,...a},s){(0,q.Z)("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}=i_(),{selectionChange:c}=(0,_l.Z)(e_),u=dX(i),d=`</${u}>${r=r||`<${u}></${u}>`}<${u}>`.split(`</${u}><${u}>`);function p(e){o(`<${u}>${e.join(`</${u}><${u}>`)}</${u}>`)}return d.shift(),d.pop(),(0,x.createElement)(n,{ref:s},d.map(((e,n)=>(0,x.createElement)(jX,{key:n,identifier:`${t}-${n}`,tagName:u,value:e,onChange:e=>{const t=d.slice();t[n]=e,p(t)},isSelected:void 0,onSplit:e=>e,onReplace:e=>{const r=d.slice();r.splice(n,1,...e),p(r),c(l,`${t}-${n+1}`,0,0)},onMerge:e=>{const r=d.slice();let o=0;if(e){if(!r[n+1])return;r.splice(n,2,r[n]+r[n+1]),o=r[n].length-1}else{if(!r[n-1])return;r.splice(n-1,2,r[n-1]+r[n]),o=r[n-1].length-1}p(r),c(l,`${t}-${n-(e?0:1)}`,o,o)},...a}))))}));const OX=(0,x.createContext)(),FX=(0,x.createContext)();function jX({children:e,tagName:t="div",value:n="",onChange:r,isSelected:o,multiline:i,inlineToolbar:a,wrapperClassName:s,autocompleters:l,onReplace:c,placeholder:u,allowedFormats:d,withoutInteractiveFormatting:p,onRemove:h,onMerge:m,onSplit:f,__unstableOnSplitAtEnd:g,__unstableOnSplitAtDoubleLineEnd:b,identifier:v,preserveWhiteSpace:y,__unstablePastePlainText:_,__unstableEmbedURLOnPaste:k,__unstableDisableFormats:w,disableLineBreaks:E,__unstableAllowPrefixTransformations:C,...S},I){S=function(e){const{__unstableMobileNoFocusOnMount:t,deleteEnter:n,placeholderTextColor:r,textAlign:o,selectionColor:i,tagsToEliminate:a,disableEditingMenu:s,fontSize:l,fontFamily:c,fontWeight:u,fontStyle:d,minWidth:p,maxWidth:h,setRef:m,disableSuggestions:f,disableAutocorrection:g,...b}=e;return b}(S);const T=(0,x.useRef)(),{clientId:N}=i_(),{selectionStart:P,selectionEnd:A,isSelected:B}=(0,yl.Z)((e=>{const{getSelectionStart:t,getSelectionEnd:n}=e(e_),r=t(),i=n();let a;return void 0===o?a=r.clientId===N&&i.clientId===N&&r.attributeKey===v:o&&(a=r.clientId===N),{selectionStart:a?r.offset:void 0,selectionEnd:a?i.offset:void 0,isSelected:a}})),{getSelectionStart:L,getSelectionEnd:M,getBlockRootClientId:D}=(0,yl.Z)(e_),{selectionChange:O}=(0,_l.Z)(e_),F=pX({allowedFormats:d,disableFormats:w}),j=!F||F.length>0,Z=(0,x.useCallback)(((e,t)=>{const n={},r=void 0===e&&void 0===t;if("number"==typeof e||r){if(void 0===t&&D(N)!==D(M().clientId))return;n.start={clientId:N,attributeKey:v,offset:e}}if("number"==typeof t||r){if(void 0===e&&D(N)!==D(L().clientId))return;n.end={clientId:N,attributeKey:v,offset:t}}O(n)}),[N,v]),{formatTypes:z,prepareHandlers:V,valueHandlers:H,changeHandlers:U,dependencies:$}=function({clientId:e,identifier:t,withoutInteractiveFormatting:n,allowedFormats:r}){const o=(0,yl.Z)(EX,[]),i=(0,x.useMemo)((()=>o.filter((({name:e,interactive:t,tagName:o})=>!(r&&!r.includes(e)||n&&(t||CX.has(o)))))),[o,r,n]),a=(0,yl.Z)((n=>i.reduce(((r,o)=>o.__experimentalGetPropsForEditableTreePreparation?{...r,...xX(o.__experimentalGetPropsForEditableTreePreparation(n,{richTextIdentifier:t,blockClientId:e}),o.name)}:r),{})),[i,e,t]),s=(0,_l.Z)(),l=[],c=[],u=[],d=[];for(const e in a)d.push(a[e]);return i.forEach((n=>{if(n.__experimentalCreatePrepareEditableTree){const r=n.__experimentalCreatePrepareEditableTree(SX(a,n.name),{richTextIdentifier:t,blockClientId:e});n.__experimentalCreateOnChangeEditableValue?c.push(r):l.push(r)}if(n.__experimentalCreateOnChangeEditableValue){let r={};n.__experimentalGetPropsForEditableTreeChangeHandler&&(r=n.__experimentalGetPropsForEditableTreeChangeHandler(s,{richTextIdentifier:t,blockClientId:e}));const o=SX(a,n.name);u.push(n.__experimentalCreateOnChangeEditableValue({..."object"==typeof o?o:{},...r},{richTextIdentifier:t,blockClientId:e}))}})),{formatTypes:i,prepareHandlers:l,valueHandlers:c,changeHandlers:u,dependencies:d}}({clientId:N,identifier:v,withoutInteractiveFormatting:p,allowedFormats:F});function W(e){return z.forEach((t=>{t.__experimentalCreatePrepareEditableTree&&(e=ef(e,t.name,0,e.text.length))})),e.formats}const{value:G,getValue:q,onChange:K,ref:Y}=function({value:e="",selectionStart:t,selectionEnd:n,placeholder:r,preserveWhiteSpace:o,onSelectionChange:i,onChange:a,__unstableDisableFormats:s,__unstableIsSelected:l,__unstableDependencies:c=[],__unstableAfterParse:u,__unstableBeforeSerialize:d,__unstableAddInvisibleFormats:p}){const h=(0,Tf.Z)(),[,m]=(0,x.useReducer)((()=>({}))),f=(0,x.useRef)();function g(){const{ownerDocument:{defaultView:e}}=f.current,t=e.getSelection(),n=t.rangeCount>0?t.getRangeAt(0):null;return Zm({element:f.current,range:n,__unstableIsEditableTree:!0,preserveWhiteSpace:o})}function b(e,{domOnly:t}={}){jf({value:e,current:f.current,prepareEditableTree:p,__unstableDomOnly:t,placeholder:r})}const v=(0,x.useRef)(e),y=(0,x.useRef)();function _(){v.current=e,y.current=Zm({html:e,preserveWhiteSpace:o}),s&&(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 k=(0,x.useRef)(!1);function w(e){y.current=e,b(e),v.current=s?e.text:pf({value:d?{...e,formats:d(e)}:e,preserveWhiteSpace:o});const{start:t,end:n,formats:r,text:l}=e;h.batch((()=>{i(t,n),a(v.current,{__unstableFormats:r,__unstableText:l})})),m()}function E(){_(),b(y.current)}y.current?t===y.current.start&&n===y.current.end||(k.current=l,y.current={...y.current,start:t,end:n,activeFormats:void 0}):(k.current=l,_(),"core/text-color"===y.current?.formats[0]?.[0]?.type&&function(e){y.current=e,v.current=pf({value:d?{...e,formats:d(e)}:e,preserveWhiteSpace:o});const{formats:t,text:n}=e;h.batch((()=>{a(v.current,{__unstableFormats:t,__unstableText:n})})),m()}(y.current));const C=(0,x.useRef)(!1);(0,x.useLayoutEffect)((()=>{C.current&&e!==v.current&&(E(),m())}),[e]),(0,x.useLayoutEffect)((()=>{k.current&&(f.current.ownerDocument.activeElement!==f.current&&f.current.focus(),b(y.current),k.current=!1)}),[k.current]);const S=(0,Sf.Z)([f,(0,x.useCallback)((e=>{e&&(e.style.whiteSpace="pre-wrap",e.style.minWidth="1px")}),[]),zf({record:y}),Vf({record:y,preserveWhiteSpace:o}),If((e=>{function t(t){const{target:n}=t;if(n===e||n.textContent&&n.isContentEditable)return;const{ownerDocument:r}=n,{defaultView:o}=r,i=o.getSelection();if(i.containsNode(n))return;const a=r.createRange(),s=n.isContentEditable?n:n.closest("[contenteditable]");a.selectNode(s),i.removeAllRanges(),i.addRange(a),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)}}),[]),$f({record:y,applyRecord:b}),Yf({createRecord:g,handleChange:w}),Kf({record:y,applyRecord:b,createRecord:g,handleChange:w,isSelected:l,onSelectionChange:i}),If((e=>{const{ownerDocument:t}=e,{defaultView:n}=t,r=n?.getSelection();let o;function i(){return r.rangeCount?r.getRangeAt(0):null}function a(e){const n="keydown"===e.type?"keyup":"pointerup";function r(){t.removeEventListener(n,a),t.removeEventListener("selectionchange",r),t.removeEventListener("input",r)}function a(){r(),Nf(o,i())||t.dispatchEvent(new Event("selectionchange"))}t.addEventListener(n,a),t.addEventListener("selectionchange",r),t.addEventListener("input",r),o=i()}return e.addEventListener("pointerdown",a),e.addEventListener("keydown",a),()=>{e.removeEventListener("pointerdown",a),e.removeEventListener("keydown",a)}}),[]),If((()=>{E(),C.current=!0}),[r,...c])]);return{value:y.current,getValue:()=>y.current,onChange:w,ref:S}}({value:n,onChange(e,{__unstableFormats:t,__unstableText:n}){r(e),Object.values(U).forEach((e=>{e(t,n)}))},selectionStart:P,selectionEnd:A,onSelectionChange:Z,placeholder:u,__unstableIsSelected:B,__unstableDisableFormats:w,preserveWhiteSpace:y,__unstableDependencies:[...$,t],__unstableAfterParse:function(e){return H.reduce(((t,n)=>n(t,e.text)),e.formats)},__unstableBeforeSerialize:W,__unstableAddInvisibleFormats:function(e){return V.reduce(((t,n)=>n(t,e.text)),e.formats)}}),X=function(e){return function(e){const t=(0,x.useRef)(null),n=(0,x.useRef)(),{record:r}=e,o=function(e){const t=(0,x.useRef)(new Set);return t.current.add(e),t.current.size>2&&t.current.delete(Array.from(t.current)[0]),Array.from(t.current)[0]}(r),{popover:i,listBoxId:a,activeId:s,onKeyDown:l}=HY({...e,contentRef:t});n.current=l;const c=(0,Kx.Z)([t,(0,OY.Z)((e=>{function t(e){n.current?.(e)}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}),[])]);return r.text!==o?.text?{ref:c,children:i,"aria-autocomplete":a?"list":void 0,"aria-owns":a,"aria-activedescendant":s}:{ref:c}}({...e,completers:KY(e)})}({onReplace:c,completers:l,record:G,onChange:K});!function({html:e,value:t}){const n=(0,x.useRef)(),r=t.activeFormats&&!!t.activeFormats.length,{__unstableMarkLastChangeAsPersistent:o}=(0,_l.Z)(e_);(0,x.useLayoutEffect)((()=>{if(n.current){if(n.current!==t.text){const e=window.setTimeout((()=>{o()}),1e3);return n.current=t.text,()=>{window.clearTimeout(e)}}o()}else n.current=t.text}),[e,r])}({html:n,value:G});const J=(0,x.useRef)(new Set),Q=(0,x.useRef)(new Set);function ee(){T.current?.focus()}const te=t;return(0,x.createElement)(x.Fragment,null,B&&(0,x.createElement)(OX.Provider,{value:J},(0,x.createElement)(FX.Provider,{value:Q},(0,x.createElement)(H_.ZP.__unstableSlotNameProvider,{value:"__unstable-block-tools-after"},e&&e({value:G,onChange:K,onFocus:ee}),(0,x.createElement)(LX,{value:G,onChange:K,onFocus:ee,formatTypes:z,forwardedRef:T})))),B&&j&&(0,x.createElement)(lX,{inline:a,editableContentElement:T.current,value:G}),(0,x.createElement)(te,{role:"textbox","aria-multiline":!E,"aria-label":u,...S,...X,ref:(0,Sf.Z)([I,X.ref,S.ref,Y,vX({value:G,onChange:K}),_X({getValue:q,onChange:K,__unstableAllowPrefixTransformations:C,formatTypes:z,onReplace:c,selectionChange:O}),NX(),If((e=>{function t(e){(Hf.vd.primary(e,"z")||Hf.vd.primary(e,"y")||Hf.vd.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}),[]),IX(J),TX(Q),cX(),gX({isSelected:B,disableFormats:w,onChange:K,value:G,formatTypes:z,tagName:t,onReplace:c,onSplit:f,__unstableEmbedURLOnPaste:k,preserveWhiteSpace:y,pastePlainText:_}),kX({value:G,onMerge:m,onRemove:h}),wX({removeEditorOnlyFormats:W,value:G,onReplace:c,onSplit:f,onChange:K,disableLineBreaks:E,onSplitAtEnd:g,onSplitAtDoubleLineEnd:b}),PX(),T]),contentEditable:!0,suppressContentEditableWarning:!0,className:R()("block-editor-rich-text__editable",S.className,"rich-text"),tabIndex:0===S.tabIndex?null:S.tabIndex}))}const ZX=(0,x.forwardRef)(jX),zX=(0,x.forwardRef)((function e(t,n){let r=t.value,o=t.onChange;Array.isArray(r)&&((0,q.Z)("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/"}),r=wp.toHTML(t.value),o=e=>t.onChange(wp.fromDOM(Dm(document,e).childNodes)));const i=t.multiline?DX:ZX,a=(0,tT.Z)(e);return(0,x.createElement)(i,{...t,identifier:t.identifier||a,value:r,onChange:o,ref:n})}));zX.Content=MX,zX.isEmpty=e=>!e||0===e.length;var VX=zX;function HX({character:e,type:t,onUse:n}){const r=(0,x.useContext)(OX),o=(0,x.useRef)();return o.current=n,(0,x.useEffect)((()=>{function n(n){Hf.vd[t](n,e)&&(o.current(),n.preventDefault())}return r.current.add(n),()=>{r.current.delete(n)}}),[e,t]),null}function UX({name:e,shortcutType:t,shortcutCharacter:n,...r}){let o,i="RichText.ToolbarControls";return e&&(i+=`.${e}`),t&&n&&(o=Hf.E_[t](n)),(0,x.createElement)(kl.de,{name:i},(0,x.createElement)(Jh,{...r,shortcut:o}))}function $X({inputType:e,onInput:t}){const n=(0,x.useContext)(FX),r=(0,x.useRef)();return r.current=t,(0,x.useEffect)((()=>{function t(t){t.inputType===e&&(r.current(),t.preventDefault())}return n.current.add(t),()=>{n.current.delete(t)}}),[e]),null}var WX=n(34213);const GX="none",qX="custom",KX="media",YX="attachment",XX=["noreferrer","noopener"],JX=(0,x.createElement)(F_.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,x.createElement)(F_.y$,{d:"M0,0h24v24H0V0z",fill:"none"}),(0,x.createElement)(F_.y$,{d:"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z"}),(0,x.createElement)(F_.y$,{d:"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z"})),QX=({linkDestination:e,onChangeUrl:t,url:n,mediaType:r="image",mediaUrl:o,mediaLink:i,linkTarget:a,linkClass:s,rel:l})=>{const[c,u]=(0,x.useState)(!1),[d,p]=(0,x.useState)(null),[h,m]=(0,x.useState)(!1),[f,g]=(0,x.useState)(null),b=(0,x.useRef)(null),v=()=>{m(!1)},y=()=>{const e=[{linkDestination:KX,title:(0,$.__)("Media File"),url:"image"===r?o:void 0,icon:JX}];return"image"===r&&i&&e.push({linkDestination:YX,title:(0,$.__)("Attachment Page"),url:"image"===r?i:void 0,icon:(0,x.createElement)(F_.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,x.createElement)(F_.y$,{d:"M0 0h24v24H0V0z",fill:"none"}),(0,x.createElement)(F_.y$,{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z"}))}),e},_=(0,x.createElement)(dM.Z,{spacing:"3"},(0,x.createElement)(aE.Z,{__nextHasNoMarginBottom:!0,label:(0,$.__)("Open in new tab"),onChange:e=>{const n=(e=>{const t=e?"_blank":void 0;let n;if(t){const e=(null!=l?l:"").split(" ");XX.forEach((t=>{e.includes(t)||e.push(t)})),n=e.join(" ")}else{const e=(null!=l?l:"").split(" ").filter((e=>!1===XX.includes(e)));n=e.length?e.join(" "):void 0}return{linkTarget:t,rel:n}})(e);t(n)},checked:"_blank"===a}),(0,x.createElement)(QS.Z,{__nextHasNoMarginBottom:!0,label:(0,$.__)("Link rel"),value:null!=l?l:"",onChange:e=>{t({rel:e})}}),(0,x.createElement)(QS.Z,{__nextHasNoMarginBottom:!0,label:(0,$.__)("Link CSS Class"),value:s||"",onChange:e=>{t({linkClass:e})}})),k=null!==f?f:n,w=(y().find((t=>t.linkDestination===e))||{}).title;return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(Jh,{icon:UV.Z,className:"components-toolbar__control",label:n?(0,$.__)("Edit link"):(0,$.__)("Insert link"),"aria-expanded":c,onClick:()=>{u(!0)},ref:p}),c&&(0,x.createElement)(RY,{anchor:d,onFocusOutside:e=>{const t=b.current;t&&t.contains(e.target)||(u(!1),g(null),v())},onClose:()=>{g(null),v(),u(!1)},renderSettings:()=>_,additionalControls:!k&&(0,x.createElement)(IF.ZP,null,y().map((e=>(0,x.createElement)(Wk.Z,{key:e.linkDestination,icon:e.icon,onClick:()=>{g(null),(e=>{const n=y();let r;r=e?(n.find((t=>t.url===e))||{linkDestination:qX}).linkDestination:GX,t({linkDestination:r,href:e})})(e.url),v()}},e.title))))},(!n||h)&&(0,x.createElement)(RY.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:k,onChangeInputValue:g,onSubmit:e=>{if(f){const e=y().find((e=>e.url===f))?.linkDestination||qX;t({href:f,linkDestination:e})}v(),g(null),e.preventDefault()},autocompleteRef:b}),n&&!h&&(0,x.createElement)(x.Fragment,null,(0,x.createElement)(RY.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:n,onEditLinkClick:()=>{e!==KX&&e!==YX||g(""),m(!0)},urlLabel:w}),(0,x.createElement)(Gh.ZP,{icon:WX.Z,label:(0,$.__)("Remove link"),onClick:()=>{t({linkDestination:GX,href:""})}}))))};var eJ=(0,lT.Z)((e=>({selectedBlockClientId:e(e_).getBlockSelectionStart()})))((({selectedBlockClientId:e})=>{const t=rB(e);return e?(0,x.createElement)(Gh.ZP,{variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{t.current.focus()}},(0,$.__)("Skip to the selected block")):null}));const tJ={HTMLRegExp:/<\/?[a-z][^>]*?>/gi,HTMLcommentRegExp:/<!--[\s\S]*?-->/g,spaceRegExp:/ | /gi,HTMLEntityRegExp:/&\S+?;/g,connectorRegExp:/--|\u2014/g,removeRegExp:new RegExp(["[","!-/:-@[-`{-~","-¿×÷"," -⯿","⸀-","]"].join(""),"g"),astralRegExp:/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,wordsRegExp:/\S\s+/g,characters_excluding_spacesRegExp:/\S/g,characters_including_spacesRegExp:/[^\f\n\r\t\v\u00AD\u2028\u2029]/g,l10n:{type:"words"}};function nJ(e,t){return t.replace(e.HTMLRegExp,"\n")}function rJ(e,t){return t.replace(e.astralRegExp,"a")}function oJ(e,t){return t.replace(e.HTMLEntityRegExp,"")}function iJ(e,t){return t.replace(e.connectorRegExp," ")}function aJ(e,t){return t.replace(e.removeRegExp,"")}function sJ(e,t){return t.replace(e.HTMLcommentRegExp,"")}function lJ(e,t){return e.shortcodesRegExp?t.replace(e.shortcodesRegExp,"\n"):t}function cJ(e,t){return t.replace(e.spaceRegExp," ")}function uJ(e,t){return t.replace(e.HTMLEntityRegExp,"a")}function dJ(e,t,n){var r;return e=[nJ.bind(null,n),sJ.bind(null,n),lJ.bind(null,n),rJ.bind(null,n),cJ.bind(null,n),uJ.bind(null,n)].reduce(((e,t)=>t(e)),e),e+="\n",null!==(r=e.match(t)?.length)&&void 0!==r?r:0}var pJ=n(67225),hJ=(0,lT.Z)((e=>{const{getMultiSelectedBlocks:t}=e(e_);return{blocks:t()}}))((function({blocks:e}){const t=function(e,t,n){const r=function(e,t){var n;const r=Object.assign({},tJ,t);return r.shortcodes=null!==(n=r.l10n?.shortcodes)&&void 0!==n?n:[],r.shortcodes&&r.shortcodes.length&&(r.shortcodesRegExp=new RegExp("\\[\\/?(?:"+r.shortcodes.join("|")+")[^\\]]*?\\]","g")),r.type=e,"characters_excluding_spaces"!==r.type&&"characters_including_spaces"!==r.type&&(r.type="words"),r}(t,n);let o;switch(r.type){case"words":return o=r.wordsRegExp,function(e,t,n){var r;return e=[nJ.bind(null,n),sJ.bind(null,n),lJ.bind(null,n),cJ.bind(null,n),oJ.bind(null,n),iJ.bind(null,n),aJ.bind(null,n)].reduce(((e,t)=>t(e)),e),e+="\n",null!==(r=e.match(t)?.length)&&void 0!==r?r:0}(e,o,r);case"characters_including_spaces":return o=r.characters_including_spacesRegExp,dJ(e,o,r);case"characters_excluding_spaces":return o=r.characters_excluding_spacesRegExp,dJ(e,o,r);default:return 0}}(Dd(e),"words");return(0,x.createElement)("div",{className:"block-editor-multi-selection-inspector__card"},(0,x.createElement)(EB,{icon:pJ.Z,showColors:!0}),(0,x.createElement)("div",{className:"block-editor-multi-selection-inspector__card-content"},(0,x.createElement)("div",{className:"block-editor-multi-selection-inspector__card-title"},(0,$.sprintf)((0,$._n)("%d Block","%d Blocks",e.length),e.length)),(0,x.createElement)("div",{className:"block-editor-multi-selection-inspector__card-description"},(0,$.sprintf)((0,$._n)("%d word selected.","%d words selected.",t),t))))}));function mJ({className:e,onSelectVariation:t,selectedValue:n,variations:r}){return(0,x.createElement)("fieldset",{className:e},(0,x.createElement)(h_.Z,{as:"legend"},(0,$.__)("Transform to variation")),r.map((e=>(0,x.createElement)(Gh.ZP,{key:e.name,icon:(0,x.createElement)(EB,{icon:e.icon,showColors:!0}),isPressed:n===e.name,label:n===e.name?e.title:(0,$.sprintf)((0,$.__)("Transform to %s"),e.title),onClick:()=>t(e.name),"aria-label":e.title,showTooltip:!0}))))}function fJ({className:e,onSelectVariation:t,selectedValue:n,variations:r}){const o=r.map((({name:e,title:t,description:n})=>({value:e,label:t,info:n})));return(0,x.createElement)(em.Z,{className:e,label:(0,$.__)("Transform to variation"),text:(0,$.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${e}__popover`},icon:IY.Z,toggleProps:{iconPosition:"right"}},(()=>(0,x.createElement)("div",{className:`${e}__container`},(0,x.createElement)($k.Z,null,(0,x.createElement)(ND,{choices:o,value:n,onSelect:t})))))}var gJ=function({blockClientId:e}){const{updateBlockAttributes:t}=(0,_l.Z)(e_),{activeBlockVariation:n,variations:r}=(0,yl.Z)((t=>{const{getActiveBlockVariation:n,getBlockVariations:r}=t(Vu),{getBlockName:o,getBlockAttributes:i}=t(e_),a=e&&o(e);return{activeBlockVariation:n(a,i(e)),variations:a&&r(a,"transform")}}),[e]),o=n?.name,i=(0,x.useMemo)((()=>{const e=new Set;return!!r&&(r.forEach((t=>{t.icon&&e.add(t.icon?.src||t.icon)})),e.size===r.length)}),[r]);if(!r?.length)return null;const a=i?mJ:fJ;return(0,x.createElement)(a,{className:"block-editor-block-variation-transforms",onSelectVariation:n=>{t(e,{...r.find((({name:e})=>e===n)).attributes})},selectedValue:o,variations:r})};function bJ(e,t,n){const r=new G$(e);return t&&r.remove("is-style-"+t.name),r.add("is-style-"+n.name),r.value}function vJ(e){return e?.find((e=>e.isDefault))}function yJ({genericPreviewBlock:e,style:t,className:n,activeStyle:r}){const o=sc(e.name)?.example,i=bJ(n,r,t),a=(0,x.useMemo)((()=>({...e,title:t.label||t.name,description:t.description,initialAttributes:{...e.attributes,className:i+" block-editor-block-styles__block-preview-container"},example:o})),[e,i]);return(0,x.createElement)(jL,{item:a})}function _J({clientId:e,onSwitch:t}){const{styles:n,block:r,blockType:o,className:i}=(0,yl.Z)((t=>{const{getBlock:n}=t(e_),r=n(e);if(!r)return{};const o=sc(r.name),{getBlockStyles:i}=t(Vu);return{block:r,blockType:o,styles:i(r.name),className:r.attributes.className||""}}),[e]),{updateBlockAttributes:a}=(0,_l.Z)(e_),s=function(e){return e&&0!==e.length?vJ(e)?e:[{name:"default",label:(0,$._x)("Default","block style"),isDefault:!0},...e]:[]}(n),l=function(e,t){for(const n of new G$(t).values()){if(-1===n.indexOf("is-style-"))continue;const t=n.substring(9),r=e?.find((({name:e})=>e===t));if(r)return r}return vJ(e)}(s,i),c=function(e,t){return(0,x.useMemo)((()=>{const n=t?.example,r=t?.name;return n&&r?Sc(r,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?vc(e):void 0}),[t?.example?e?.name:e,t])}(r,o);return{onSelect:n=>{const r=bJ(i,l,n);a(e,{className:r}),t()},stylesToRender:s,activeStyle:l,genericPreviewBlock:c,className:i}}const kJ=()=>{};function wJ({clientId:e,onSwitch:t=kJ,onHoverClassName:n=kJ}){const{onSelect:r,stylesToRender:o,activeStyle:i,genericPreviewBlock:a,className:s}=_J({clientId:e,onSwitch:t}),[l,c]=(0,x.useState)(null),u=(0,rT.Z)("medium","<");if(!o||0===o.length)return null;const d=(0,BT.D)(c,250),p=e=>{var t;l!==e?(d(e),n(null!==(t=e?.name)&&void 0!==t?t:null)):d.cancel()};return(0,x.createElement)("div",{className:"block-editor-block-styles"},(0,x.createElement)("div",{className:"block-editor-block-styles__variants"},o.map((e=>{const t=e.label||e.name;return(0,x.createElement)(Gh.ZP,{__next40pxDefaultSize:!0,className:R()("block-editor-block-styles__item",{"is-active":i.name===e.name}),key:e.name,variant:"secondary",label:t,onMouseEnter:()=>p(e),onFocus:()=>p(e),onMouseLeave:()=>p(null),onBlur:()=>p(null),onClick:()=>(e=>{r(e),n(null),c(null),d.cancel()})(e),"aria-current":i.name===e.name},(0,x.createElement)(HL,{numberOfLines:1,className:"block-editor-block-styles__item-text"},t))}))),l&&!u&&(0,x.createElement)(H_.ZP,{placement:"left-start",offset:20,focusOnMount:!1},(0,x.createElement)("div",{className:"block-editor-block-styles__preview-panel",onMouseLeave:()=>p(null)},(0,x.createElement)(yJ,{activeStyle:i,className:s,genericPreviewBlock:a,style:l}))))}var EJ=wJ;function CJ({blockName:e}){const{preferredStyle:t,onUpdatePreferredStyleVariations:n,styles:r}=(0,yl.Z)((t=>{var n;const r=t(e_).getSettings().__experimentalPreferredStyleVariations;return{preferredStyle:r?.value?.[e],onUpdatePreferredStyleVariations:null!==(n=r?.onChange)&&void 0!==n?n:null,styles:t(Vu).getBlockStyles(e)}}),[e]),o=(0,x.useMemo)((()=>[{label:(0,$.__)("Not set"),value:""},...r.map((({label:e,name:t})=>({label:e,value:t})))]),[r]),i=(0,x.useMemo)((()=>vJ(r)?.name),[r]),a=(0,x.useCallback)((t=>{n(e,t)}),[e,n]);return t&&t!==i?n&&(0,x.createElement)("div",{className:"default-style-picker__default-switcher"},(0,x.createElement)(HZ.Z,{__nextHasNoMarginBottom:!0,options:o,value:t||"",label:(0,$.__)("Default Style"),onChange:a})):null}wJ.Slot=()=>((0,q.Z)("BlockStyles.Slot",{version:"6.4",since:"6.2"}),null);var xJ=n(62301),SJ=n(8280),IJ=n(8409);const TJ={name:"settings",title:(0,$.__)("Settings"),value:"settings",icon:xJ.Z,className:"block-editor-block-inspector__tab-item"},NJ={name:"styles",title:(0,$.__)("Styles"),value:"styles",icon:SJ.Z,className:"block-editor-block-inspector__tab-item"},PJ={name:"list",title:(0,$.__)("List View"),value:"list-view",icon:IJ.Z,className:"block-editor-block-inspector__tab-item"};var RJ=()=>{const e=Fk(GI.slotName);return Boolean(e&&e.length)?(0,x.createElement)(tI.ZP,{className:"block-editor-block-inspector__advanced",title:(0,$.__)("Advanced"),initialOpen:!1},(0,x.createElement)(qI.Slot,{group:"advanced"})):null};const AJ=()=>{const[e,t]=(0,x.useState)(),{multiSelectedBlocks:n}=(0,yl.Z)((e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:n}=e(e_);return{multiSelectedBlocks:t(n())}}),[]);return(0,x.useLayoutEffect)((()=>{void 0===e&&t(n.some((({attributes:e})=>!!e?.style?.position?.type)))}),[e,n,t]),(0,x.createElement)(tI.ZP,{className:"block-editor-block-inspector__position",title:(0,$.__)("Position"),initialOpen:null!=e&&e},(0,x.createElement)(qI.Slot,{group:"position"}))};var BJ=()=>{const e=Fk(mI.position.Slot.__unstableName);return Boolean(e&&e.length)?(0,x.createElement)(AJ,null):null};const LJ="isInspectorControlsTabsHintVisible";function MJ(){const e=(0,yl.Z)((e=>{var t;return null===(t=e(LF.h).get("core",LJ))||void 0===t||t}),[]),t=(0,x.useRef)(),{set:n}=(0,_l.Z)(LF.h);return e?(0,x.createElement)("div",{ref:t,className:"block-editor-inspector-controls-tabs__hint"},(0,x.createElement)("div",{className:"block-editor-inspector-controls-tabs__hint-content"},(0,$.__)("Looking for other block settings? They've moved to the styles tab.")),(0,x.createElement)(Gh.ZP,{className:"block-editor-inspector-controls-tabs__hint-dismiss",icon:WX.Z,iconSize:"16",label:(0,$.__)("Dismiss hint"),onClick:()=>{const e=TA.tabbable.findPrevious(t.current);e?.focus(),n("core",LJ,!1)},showTooltip:!1})):null}var DJ=({showAdvancedControls:e=!1})=>(0,x.createElement)(x.Fragment,null,(0,x.createElement)(qI.Slot,null),(0,x.createElement)(BJ,null),e&&(0,x.createElement)("div",null,(0,x.createElement)(RJ,null)),(0,x.createElement)(MJ,null)),OJ=({blockName:e,clientId:t,hasBlockStyles:n})=>(0,x.createElement)(x.Fragment,null,n&&(0,x.createElement)("div",null,(0,x.createElement)(tI.ZP,{title:(0,$.__)("Styles")},(0,x.createElement)(EJ,{clientId:t}),uc(e,"defaultStylePicker",!0)&&(0,x.createElement)(CJ,{blockName:e}))),(0,x.createElement)(qI.Slot,{group:"color",label:(0,$.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,x.createElement)(qI.Slot,{group:"background",label:(0,$.__)("Background")}),(0,x.createElement)(qI.Slot,{group:"filter"}),(0,x.createElement)(qI.Slot,{group:"typography",label:(0,$.__)("Typography")}),(0,x.createElement)(qI.Slot,{group:"dimensions",label:(0,$.__)("Dimensions")}),(0,x.createElement)(qI.Slot,{group:"border",label:(0,$.__)("Border")}),(0,x.createElement)(qI.Slot,{group:"styles"}));const FJ=["core/navigation"];var jJ=e=>!FJ.includes(e);function ZJ({blockName:e,clientId:t,hasBlockStyles:n,tabs:r}){const o=jJ(e)?void 0:PJ.name;return(0,x.createElement)(fO.Z,{className:"block-editor-block-inspector__tabs",tabs:r,initialTabName:o,key:t},(r=>r.name===TJ.name?(0,x.createElement)(DJ,{showAdvancedControls:!!e}):r.name===NJ.name?(0,x.createElement)(OJ,{blockName:e,clientId:t,hasBlockStyles:n}):r.name===PJ.name?(0,x.createElement)(qI.Slot,{group:"list"}):void 0))}const zJ=[];function VJ(e){const t=[],{border:n,color:r,default:o,dimensions:i,list:a,position:s,styles:l,typography:c}=mI,u=jJ(e),d=Fk(a.Slot.__unstableName),p=!u&&!!d&&d.length,h=[...Fk(n.Slot.__unstableName)||[],...Fk(r.Slot.__unstableName)||[],...Fk(i.Slot.__unstableName)||[],...Fk(l.Slot.__unstableName)||[],...Fk(c.Slot.__unstableName)||[]].length,m=Fk(GI.slotName)||[],f=[...Fk(o.Slot.__unstableName)||[],...Fk(s.Slot.__unstableName)||[],...p&&h>1?m:[]];p&&t.push(PJ),f.length&&t.push(TJ),h&&t.push(NJ);const g=function(e,t={}){return void 0!==t[e]?t[e]:void 0===t.default||t.default}(e,(0,yl.Z)((e=>e(e_).getSettings().blockInspectorTabs),[]));return g?t:zJ}const{createPrivateSlotFill:HJ}=Jy(Mk),{Fill:UJ,Slot:$J}=HJ("BlockInformation"),WJ=e=>a_()?(0,x.createElement)(UJ,{...e}):null;WJ.Slot=e=>(0,x.createElement)($J,{...e});var GJ=WJ;function qJ({clientIds:e}){return e.length?(0,x.createElement)(dM.Z,{spacing:1},e.map((e=>(0,x.createElement)(KJ,{key:e,clientId:e})))):null}function KJ({clientId:e}){const{name:t,icon:n,isSelected:r}=(0,yl.Z)((t=>{const{getBlockName:n,getBlockAttributes:r,isBlockSelected:o,hasSelectedInnerBlock:i}=t(e_),{getBlockType:a}=t(Vu),s=a(n(e)),l=r(e);return{name:s&&Ac(s,l,"list-view"),icon:s?.icon,isSelected:o(e)||i(e,!0)}}),[e]),{selectBlock:o}=(0,_l.Z)(e_);return(0,x.createElement)(Gh.ZP,{isPressed:r,onClick:()=>o(e)},(0,x.createElement)(wI.Z,{justify:"flex-start"},(0,x.createElement)(EB,{icon:n}),(0,x.createElement)(tw.Z,null,t)))}function YJ({topLevelLockedBlock:e}){const t=(0,yl.Z)((t=>{const{getClientIdsOfDescendants:n,getBlockName:r,getBlockEditingMode:o}=t(e_);return n(e).filter((e=>"core/list-item"!==r(e)&&"contentOnly"===o(e)))}),[e]),n=Sq(e);return(0,x.createElement)("div",{className:"block-editor-block-inspector"},(0,x.createElement)(CB,{...n,className:n.isSynced&&"is-synced"}),(0,x.createElement)(gJ,{blockClientId:e}),(0,x.createElement)(GJ.Slot,null),(0,x.createElement)(tI.ZP,{title:(0,$.__)("Content")},(0,x.createElement)(qJ,{clientIds:t})))}const XJ=({animate:e,wrapper:t,children:n})=>e?t(n):n,JJ=({blockInspectorAnimationSettings:e,selectedBlockClientId:t,children:n})=>{const r=e&&"leftToRight"===e.enterDirection?-50:50;return(0,x.createElement)(zw.E.div,{animate:{x:0,opacity:1,transition:{ease:"easeInOut",duration:.14}},initial:{x:r,opacity:0},key:t},n)},QJ=({clientId:e,blockName:t})=>{const n=VJ(t),r=n?.length>1,o=(0,yl.Z)((e=>{const{getBlockStyles:n}=e(Vu),r=n(t);return r&&r.length>0}),[t]),i=Sq(e);return(0,x.createElement)("div",{className:"block-editor-block-inspector"},(0,x.createElement)(CB,{...i,className:i.isSynced&&"is-synced"}),(0,x.createElement)(gJ,{blockClientId:e}),(0,x.createElement)(GJ.Slot,null),r&&(0,x.createElement)(ZJ,{hasBlockStyles:o,clientId:e,blockName:t,tabs:n}),!r&&(0,x.createElement)(x.Fragment,null,o&&(0,x.createElement)("div",null,(0,x.createElement)(tI.ZP,{title:(0,$.__)("Styles")},(0,x.createElement)(EJ,{clientId:e}),uc(t,"defaultStylePicker",!0)&&(0,x.createElement)(CJ,{blockName:t}))),(0,x.createElement)(qI.Slot,null),(0,x.createElement)(qI.Slot,{group:"list"}),(0,x.createElement)(qI.Slot,{group:"color",label:(0,$.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,x.createElement)(qI.Slot,{group:"typography",label:(0,$.__)("Typography")}),(0,x.createElement)(qI.Slot,{group:"dimensions",label:(0,$.__)("Dimensions")}),(0,x.createElement)(qI.Slot,{group:"border",label:(0,$.__)("Border")}),(0,x.createElement)(qI.Slot,{group:"styles"}),(0,x.createElement)(qI.Slot,{group:"background",label:(0,$.__)("Background")}),(0,x.createElement)(BJ,null),(0,x.createElement)("div",null,(0,x.createElement)(RJ,null))),(0,x.createElement)(eJ,{key:"back"}))};var eQ=({showNoBlockSelectedMessage:e=!0})=>{const{count:t,selectedBlockName:n,selectedBlockClientId:r,blockType:o,topLevelLockedBlock:i}=(0,yl.Z)((e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:r,__unstableGetContentLockingParent:o,getTemplateLock:i}=e(e_),a=t(),s=a&&r(a),l=s&&sc(s);return{count:n(),selectedBlockClientId:a,selectedBlockName:s,blockType:l,topLevelLockedBlock:o(a)||("contentOnly"===i(a)?a:void 0)}}),[]),a=VJ(o?.name),s=a?.length>1,l=function(e,t){return(0,yl.Z)((t=>{if(e){const n=t(e_).getSettings().blockInspectorAnimation,r=n?.animationParent,{getSelectedBlockClientId:o,getBlockParentsByBlockName:i}=t(e_);return i(o(),r,!0)[0]||e.name===r?n?.[e.name]:null}return null}),[t,e])}(o,r);if(t>1)return(0,x.createElement)("div",{className:"block-editor-block-inspector"},(0,x.createElement)(hJ,null),s?(0,x.createElement)(ZJ,{tabs:a}):(0,x.createElement)(x.Fragment,null,(0,x.createElement)(qI.Slot,null),(0,x.createElement)(qI.Slot,{group:"color",label:(0,$.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,x.createElement)(qI.Slot,{group:"typography",label:(0,$.__)("Typography")}),(0,x.createElement)(qI.Slot,{group:"dimensions",label:(0,$.__)("Dimensions")}),(0,x.createElement)(qI.Slot,{group:"border",label:(0,$.__)("Border")}),(0,x.createElement)(qI.Slot,{group:"styles"})));const c=n===ic();return o&&r&&!c?i?(0,x.createElement)(YJ,{topLevelLockedBlock:i}):(0,x.createElement)(XJ,{animate:l,wrapper:e=>(0,x.createElement)(JJ,{blockInspectorAnimationSettings:l,selectedBlockClientId:r},e)},(0,x.createElement)(QJ,{clientId:r,blockName:o.name})):e?(0,x.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},(0,$.__)("No block selected.")):null};function tQ({clientId:e,maximumLength:t,context:n}){const{attributes:r,name:o,reusableBlockTitle:i}=(0,yl.Z)((t=>{if(!e)return{};const{getBlockName:n,getBlockAttributes:r,__experimentalGetReusableBlockTitle:o}=t(e_),i=n(e);if(!i)return{};const a=dc(sc(i));return{attributes:r(e),name:i,reusableBlockTitle:a&&o(r(e).ref)}}),[e]),a=Sq(e);if(!o||!a)return null;const s=sc(o),l=s?Ac(s,r,n):null,c=i||l,u=c&&c!==s.title?c:a.title;if(t&&t>0&&u.length>t){const e="...";return u.slice(0,t-e.length)+e}return u}function nQ({clientId:e,maximumLength:t,context:n}){return tQ({clientId:e,maximumLength:t,context:n})}var rQ=({children:e,clientIds:t,cloneClassname:n,onDragStart:r,onDragEnd:o})=>{const{srcRootClientId:i,isDraggable:a,icon:s}=(0,yl.Z)((e=>{const{canMoveBlocks:n,getBlockRootClientId:r,getBlockName:o,getBlockAttributes:i}=e(e_),{getBlockType:a,getActiveBlockVariation:s}=e(Vu),l=r(t[0]),c=o(t[0]),u=s(c,i(t[0]));return{srcRootClientId:l,isDraggable:n(t,l),icon:u?.icon||a(c)?.icon}}),[t]),l=(0,x.useRef)(!1),[c,u,d]=function(){const e=(0,x.useRef)(null),t=(0,x.useRef)(null),n=(0,x.useRef)(null),r=(0,x.useRef)(null);return(0,x.useEffect)((()=>()=>{r.current&&(clearInterval(r.current),r.current=null)}),[]),[(0,x.useCallback)((o=>{e.current=o.clientY,n.current=hA(o.target),r.current=setInterval((()=>{if(n.current&&t.current){const e=n.current.scrollTop+t.current;n.current.scroll({top:e})}}),25)}),[]),(0,x.useCallback)((r=>{if(!n.current)return;const o=n.current.offsetHeight,i=e.current-n.current.offsetTop,a=r.clientY-n.current.offsetTop;if(r.clientY>i){const e=Math.max(o-i-50,0),n=Math.max(a-i-50,0),r=0===e||0===n?0:n/e;t.current=25*r}else if(r.clientY<i){const e=Math.max(i-50,0),n=Math.max(i-a-50,0),r=0===e||0===n?0:n/e;t.current=-25*r}else t.current=0}),[]),()=>{e.current=null,n.current=null,r.current&&(clearInterval(r.current),r.current=null)}]}(),{startDraggingBlocks:p,stopDraggingBlocks:h}=(0,_l.Z)(e_);if((0,x.useEffect)((()=>()=>{l.current&&h()}),[]),!a)return e({draggable:!1});const m={type:"block",srcClientIds:t,srcRootClientId:i};return(0,x.createElement)(YL,{cloneClassname:n,__experimentalTransferDataType:"wp-blocks",transferData:m,onDragStart:e=>{window.requestAnimationFrame((()=>{p(t),l.current=!0,c(e),r&&r()}))},onDragOver:u,onDragEnd:()=>{h(),l.current=!1,d(),o&&o()},__experimentalDragComponent:(0,x.createElement)(JL,{count:t.length,icon:s})},(({onDraggableStart:t,onDraggableEnd:n})=>e({draggable:!0,onDragStart:t,onDragEnd:n})))},oQ=n(6454);const iQ=(e,t)=>"up"===e?"horizontal"===t?(0,$.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,$.isRTL)()?"left":"right":"down":null;const aQ=(e,t)=>"up"===e?"horizontal"===t?(0,$.isRTL)()?_B.Z:kB.Z:oQ.Z:"down"===e?"horizontal"===t?(0,$.isRTL)()?kB.Z:_B.Z:IY.Z:null,sQ=(e,t)=>"up"===e?"horizontal"===t?(0,$.isRTL)()?(0,$.__)("Move right"):(0,$.__)("Move left"):(0,$.__)("Move up"):"down"===e?"horizontal"===t?(0,$.isRTL)()?(0,$.__)("Move left"):(0,$.__)("Move right"):(0,$.__)("Move down"):null,lQ=(0,x.forwardRef)((({clientIds:e,direction:t,orientation:n,...r},o)=>{const i=(0,tT.Z)(lQ),a=Array.isArray(e)?e:[e],s=a.length,{blockType:l,isDisabled:c,rootClientId:u,isFirst:d,isLast:p,firstIndex:h,orientation:m="vertical"}=(0,yl.Z)((e=>{const{getBlockIndex:r,getBlockRootClientId:o,getBlockOrder:i,getBlock:s,getBlockListSettings:l}=e(e_),c=a[0],u=o(c),d=r(c),p=r(a[a.length-1]),h=i(u),m=s(c),f=0===d,g=p===h.length-1,{orientation:b}=l(u)||{};return{blockType:m?sc(m.name):null,isDisabled:"up"===t?f:g,rootClientId:u,firstIndex:d,isFirst:f,isLast:g,orientation:n||b}}),[e,t]),{moveBlocksDown:f,moveBlocksUp:g}=(0,_l.Z)(e_),b="up"===t?g:f,v=`block-editor-block-mover-button__description-${i}`;return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(Gh.ZP,{ref:o,className:R()("block-editor-block-mover-button",`is-${t}-button`),icon:aQ(t,m),label:sQ(t,m),"aria-describedby":v,...r,onClick:c?null:t=>{b(e,u),r.onClick&&r.onClick(t)},disabled:c,__experimentalIsFocusable:!0}),(0,x.createElement)(h_.Z,{id:v},function(e,t,n,r,o,i,a){const s=n+1;if(e>1)return function(e,t,n,r,o,i){const a=t+1;if(n&&r)return(0,$.__)("All blocks are selected, and cannot be moved");if(o>0&&!r){const t=iQ("down",i);if("down"===t)return(0,$.sprintf)((0,$.__)("Move %1$d blocks from position %2$d down by one place"),e,a);if("left"===t)return(0,$.sprintf)((0,$.__)("Move %1$d blocks from position %2$d left by one place"),e,a);if("right"===t)return(0,$.sprintf)((0,$.__)("Move %1$d blocks from position %2$d right by one place"),e,a)}if(o>0&&r){const e=iQ("down",i);if("down"===e)return(0,$.__)("Blocks cannot be moved down as they are already at the bottom");if("left"===e)return(0,$.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,$.__)("Blocks cannot be moved right as they are already are at the rightmost position")}if(o<0&&!n){const t=iQ("up",i);if("up"===t)return(0,$.sprintf)((0,$.__)("Move %1$d blocks from position %2$d up by one place"),e,a);if("left"===t)return(0,$.sprintf)((0,$.__)("Move %1$d blocks from position %2$d left by one place"),e,a);if("right"===t)return(0,$.sprintf)((0,$.__)("Move %1$d blocks from position %2$d right by one place"),e,a)}if(o<0&&n){const e=iQ("up",i);if("up"===e)return(0,$.__)("Blocks cannot be moved up as they are already at the top");if("left"===e)return(0,$.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,$.__)("Blocks cannot be moved right as they are already are at the rightmost position")}}(e,n,r,o,i,a);if(r&&o)return(0,$.sprintf)((0,$.__)("Block %s is the only block, and cannot be moved"),t);if(i>0&&!o){const e=iQ("down",a);if("down"===e)return(0,$.sprintf)((0,$.__)("Move %1$s block from position %2$d down to position %3$d"),t,s,s+1);if("left"===e)return(0,$.sprintf)((0,$.__)("Move %1$s block from position %2$d left to position %3$d"),t,s,s+1);if("right"===e)return(0,$.sprintf)((0,$.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s+1)}if(i>0&&o){const e=iQ("down",a);if("down"===e)return(0,$.sprintf)((0,$.__)("Block %1$s is at the end of the content and can’t be moved down"),t);if("left"===e)return(0,$.sprintf)((0,$.__)("Block %1$s is at the end of the content and can’t be moved left"),t);if("right"===e)return(0,$.sprintf)((0,$.__)("Block %1$s is at the end of the content and can’t be moved right"),t)}if(i<0&&!r){const e=iQ("up",a);if("up"===e)return(0,$.sprintf)((0,$.__)("Move %1$s block from position %2$d up to position %3$d"),t,s,s-1);if("left"===e)return(0,$.sprintf)((0,$.__)("Move %1$s block from position %2$d left to position %3$d"),t,s,s-1);if("right"===e)return(0,$.sprintf)((0,$.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s-1)}if(i<0&&r){const e=iQ("up",a);if("up"===e)return(0,$.sprintf)((0,$.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,$.sprintf)((0,$.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,$.sprintf)((0,$.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}(s,l&&l.title,h,d,p,"up"===t?-1:1,m)))})),cQ=(0,x.forwardRef)(((e,t)=>(0,x.createElement)(lQ,{direction:"up",ref:t,...e}))),uQ=(0,x.forwardRef)(((e,t)=>(0,x.createElement)(lQ,{direction:"down",ref:t,...e})));var dQ=function({clientIds:e,hideDragHandle:t}){const{canMove:n,rootClientId:r,isFirst:o,isLast:i,orientation:a}=(0,yl.Z)((t=>{const{getBlockIndex:n,getBlockListSettings:r,canMoveBlocks:o,getBlockOrder:i,getBlockRootClientId:a}=t(e_),s=Array.isArray(e)?e:[e],l=s[0],c=a(l),u=n(l),d=n(s[s.length-1]),p=i(c);return{canMove:o(e,c),rootClientId:c,isFirst:0===u,isLast:d===p.length-1,orientation:r(c)?.orientation}}),[e]);if(!n||o&&i&&!r)return null;const s=(0,$.__)("Drag");return(0,x.createElement)(nm,{className:R()("block-editor-block-mover",{"is-horizontal":"horizontal"===a})},!t&&(0,x.createElement)(rQ,{clientIds:e},(e=>(0,x.createElement)(Gh.ZP,{icon:XL.Z,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:s,tabIndex:"-1",...e}))),(0,x.createElement)("div",{className:"block-editor-block-mover__move-button-container"},(0,x.createElement)(qh.Z,null,(t=>(0,x.createElement)(cQ,{clientIds:e,...t}))),(0,x.createElement)(qh.Z,null,(t=>(0,x.createElement)(uQ,{clientIds:e,...t})))))},pQ=function({clientId:e,rootClientId:t}){const n=Sq(e),r=(0,yl.Z)((n=>{const{getBlock:r,getBlockIndex:o,hasBlockMovingClientId:i,getBlockListSettings:a,__unstableGetEditorMode:s}=n(e_),l=o(e),{name:c,attributes:u}=r(e);return{index:l,name:c,attributes:u,blockMovingMode:i(),orientation:a(t)?.orientation,editorMode:s()}}),[e,t]),{index:o,name:i,attributes:a,blockMovingMode:s,orientation:l,editorMode:c}=r,{setNavigationMode:u,removeBlock:d}=(0,_l.Z)(e_),p=(0,x.useRef)(),h=function(e,t,n,r="vertical"){const o=e?.title,i=e?Ac(e,t,"accessibility"):"",a=void 0!==n,s=i&&i!==o;return a&&"vertical"===r?s?(0,$.sprintf)((0,$.__)("%1$s Block. Row %2$d. %3$s"),o,n,i):(0,$.sprintf)((0,$.__)("%1$s Block. Row %2$d"),o,n):a&&"horizontal"===r?s?(0,$.sprintf)((0,$.__)("%1$s Block. Column %2$d. %3$s"),o,n,i):(0,$.sprintf)((0,$.__)("%1$s Block. Column %2$d"),o,n):s?(0,$.sprintf)((0,$.__)("%1$s Block. %2$s"),o,i):(0,$.sprintf)((0,$.__)("%s Block"),o)}(sc(i),a,o+1,l);(0,x.useEffect)((()=>{p.current.focus(),(0,wf.D)(h)}),[h]);const m=oB(e),{hasBlockMovingClientId:f,getBlockIndex:g,getBlockRootClientId:b,getClientIdsOfDescendants:v,getSelectedBlockClientId:y,getMultiSelectedBlocksEndClientId:_,getPreviousBlockClientId:k,getNextBlockClientId:w}=(0,yl.Z)(e_),{selectBlock:E,clearSelectedBlock:C,setBlockMovingClientId:S,moveBlockToPosition:I}=(0,_l.Z)(e_),T=R()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!s}),N=(0,$.__)("Drag");return(0,x.createElement)("div",{className:T},(0,x.createElement)(ew.Z,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},(0,x.createElement)(tw.Z,null,(0,x.createElement)(EB,{icon:n?.icon,showColors:!0})),(0,x.createElement)(tw.Z,null,"zoom-out"===c&&(0,x.createElement)(dQ,{clientIds:[e],hideDragHandle:!0}),"navigation"===c&&(0,x.createElement)(rQ,{clientIds:[e]},(e=>(0,x.createElement)(Gh.ZP,{icon:XL.Z,className:"block-selection-button_drag-handle","aria-hidden":"true",label:N,tabIndex:"-1",...e})))),(0,x.createElement)(tw.Z,null,(0,x.createElement)(Gh.ZP,{ref:p,onClick:"navigation"===c?()=>u(!1):void 0,onKeyDown:function(t){const{keyCode:n}=t,r=n===Hf.UP,o=n===Hf.WV,i=n===Hf.RL,a=n===Hf.pX,s=n===Hf.Mf,l=n===Hf.hY,c=n===Hf.K5,u=n===Hf.L_,p=t.shiftKey;if(n===Hf.ZH||n===Hf.yY)return d(e),void t.preventDefault();const h=y(),x=_(),T=k(x||h),N=w(x||h),P=s&&p||r,R=s&&!p||o,A=i,B=a;let L;if(P)L=T;else if(R)L=N;else if(A){var M;L=null!==(M=b(h))&&void 0!==M?M:h}else if(B){var D;L=null!==(D=v(h)[0])&&void 0!==D?D:h}const O=f();if(l&&O&&!t.defaultPrevented&&(S(null),t.preventDefault()),(c||u)&&O){const e=b(O),t=b(h),n=g(O);let r=g(h);n<r&&e===t&&(r-=1),I(O,e,t,r),E(O),S(null)}if((!O||h!==O||!B)&&(R||P||A||B))if(L)t.preventDefault(),E(L);else if(s&&h){let e;if(R){e=m;do{e=TA.tabbable.findNext(e)}while(e&&m.contains(e));e||(e=m.ownerDocument.defaultView.frameElement,e=TA.tabbable.findNext(e))}else e=TA.tabbable.findPrevious(m);e&&(t.preventDefault(),e.focus(),C())}},label:h,showTooltip:!1,className:"block-selection-button_select-button"},(0,x.createElement)(nQ,{clientId:e,maximumLength:35})))))},hQ=n(67588),mQ=n(59560);const{clearTimeout:fQ,setTimeout:gQ}=window,bQ=200;function vQ({ref:e,isFocused:t,highlightParent:n,debounceTimeout:r=bQ}){const{getSelectedBlockClientId:o,getBlockRootClientId:i}=(0,yl.Z)(e_),{toggleBlockHighlight:a}=(0,_l.Z)(e_),s=(0,x.useRef)(),l=(0,yl.Z)((e=>e(e_).getSettings().isDistractionFree),[]),c=e=>{if(e&&l)return;const t=o(),r=n?i(t):t;a(r,e)},u=()=>{const e=s.current;e&&fQ&&fQ(e)};return(0,x.useEffect)((()=>()=>{c(!1),u()}),[]),{debouncedShowGestures:e=>{e&&e.stopPropagation(),u(),c(!0)},debouncedHideGestures:n=>{n&&n.stopPropagation(),u(),s.current=gQ((()=>{(()=>{const n=e?.current&&e.current.matches(":hover");return!t&&!n})()&&c(!1)}),r)}}}function yQ({ref:e,highlightParent:t=!1,debounceTimeout:n=bQ}){const[r,o]=(0,x.useState)(!1),{debouncedShowGestures:i,debouncedHideGestures:a}=vQ({ref:e,debounceTimeout:n,isFocused:r,highlightParent:t}),s=(0,x.useRef)(!1),l=()=>e?.current&&e.current.contains(e.current.ownerDocument.activeElement);return(0,x.useEffect)((()=>{const t=e.current,n=()=>{l()&&(o(!0),i())},r=()=>{l()||(o(!1),a())};return t&&!s.current&&(t.addEventListener("focus",n,!0),t.addEventListener("blur",r,!0),s.current=!0),()=>{t&&(t.removeEventListener("focus",n),t.removeEventListener("blur",r))}}),[e,s,o,i,a]),{onMouseMove:i,onMouseLeave:a}}function _Q(){const{selectBlock:e}=(0,_l.Z)(e_),{firstParentClientId:t,isVisible:n}=(0,yl.Z)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:r,getBlockEditingMode:o}=e(e_),{hasBlockSupport:i}=e(Vu),a=n(r()),s=a[a.length-1],l=sc(t(s));return{firstParentClientId:s,isVisible:s&&"default"===o(s)&&i(l,"__experimentalParentSelector",!0)}}),[]),r=Sq(t),o=(0,x.useRef)(),i=yQ({ref:o,highlightParent:!0});return n?(0,x.createElement)("div",{className:"block-editor-block-parent-selector",key:t,ref:o,...i},(0,x.createElement)(Jh,{className:"block-editor-block-parent-selector__button",onClick:()=>e(t),label:(0,$.sprintf)((0,$.__)("Select %s"),r?.title),showTooltip:!0,icon:(0,x.createElement)(EB,{icon:r?.icon})})):null}function kQ({blocks:e}){return(0,x.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,x.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,x.createElement)(H_.ZP,{className:"block-editor-block-switcher__preview__popover",placement:"bottom-start",focusOnMount:!1},(0,x.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,x.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,$.__)("Preview")),(0,x.createElement)(FL,{viewportWidth:500,blocks:e})))))}const wQ={};function EQ({item:e,onSelect:t,setHoveredTransformItemName:n}){const{name:r,icon:o,title:i}=e;return(0,x.createElement)(Wk.Z,{className:Td(r),onClick:e=>{e.preventDefault(),t(r)},onMouseLeave:()=>n(null),onMouseEnter:()=>n(r)},(0,x.createElement)(EB,{icon:o,showColors:!0}),i)}var CQ=({transformations:e,onSelect:t,blocks:n})=>{const[r,o]=(0,x.useState)();return(0,x.createElement)(x.Fragment,null,r&&(0,x.createElement)(kQ,{blocks:vc(n[0],e.find((({name:e})=>e===r)).attributes)}),e?.map((e=>(0,x.createElement)(EQ,{key:e.name,item:e,onSelect:t,setHoveredTransformItemName:o}))))};function xQ({restTransformations:e,onSelect:t,setHoveredTransformItemName:n}){return e.map((e=>(0,x.createElement)(SQ,{key:e.name,item:e,onSelect:t,setHoveredTransformItemName:n})))}function SQ({item:e,onSelect:t,setHoveredTransformItemName:n}){const{name:r,icon:o,title:i,isDisabled:a}=e;return(0,x.createElement)(Wk.Z,{className:Td(r),onClick:e=>{e.preventDefault(),t(r)},disabled:a,onMouseLeave:()=>n(null),onMouseEnter:()=>n(r)},(0,x.createElement)(EB,{icon:o,showColors:!0}),i)}var IQ=({className:e,possibleBlockTransformations:t,possibleBlockVariationTransformations:n,onSelect:r,onSelectVariation:o,blocks:i})=>{const[a,s]=(0,x.useState)(),{priorityTextTransformations:l,restTransformations:c}=function(e){const t={"core/paragraph":1,"core/heading":2,"core/list":3,"core/quote":4},n=(0,x.useMemo)((()=>{const n=Object.keys(t);return e.reduce(((e,t)=>{const{name:r}=t;return n.includes(r)?e.priorityTextTransformations.push(t):e.restTransformations.push(t),e}),{priorityTextTransformations:[],restTransformations:[]})}),[e]);return n.priorityTextTransformations.sort((({name:e},{name:n})=>t[e]<t[n]?-1:1)),n}(t),u=l.length&&c.length,d=!!c.length&&(0,x.createElement)(xQ,{restTransformations:c,onSelect:r,setHoveredTransformItemName:s});return(0,x.createElement)(x.Fragment,null,(0,x.createElement)($k.Z,{label:(0,$.__)("Transform to"),className:e},a&&(0,x.createElement)(kQ,{blocks:xc(i,a)}),!!n?.length&&(0,x.createElement)(CQ,{transformations:n,blocks:i,onSelect:o}),l.map((e=>(0,x.createElement)(SQ,{key:e.name,item:e,onSelect:r,setHoveredTransformItemName:s}))),!u&&d),!!u&&(0,x.createElement)($k.Z,{className:e},d))};const TQ=()=>{};function NQ({clientId:e,onSwitch:t=TQ}){const{onSelect:n,stylesToRender:r,activeStyle:o}=_J({clientId:e,onSwitch:t});return r&&0!==r.length?(0,x.createElement)(x.Fragment,null,r.map((e=>{const t=e.label||e.name;return(0,x.createElement)(Wk.Z,{key:e.name,icon:o.name===e.name?aG.Z:null,onClick:()=>n(e)},(0,x.createElement)(hM.Z,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function PQ({hoveredBlock:e,onSwitch:t}){const{clientId:n}=e;return(0,x.createElement)($k.Z,{label:(0,$.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,x.createElement)(NQ,{clientId:n,onSwitch:t}))}const RQ=(e,t,n=new Set)=>{const{clientId:r,name:o,innerBlocks:i=[]}=e;if(!n.has(r)){if(o===t)return e;for(const e of i){const r=RQ(e,t,n);if(r)return r}}},AQ=(e,t)=>{const n=((e,t)=>{const n=function(e,t){const n=sc(e)?.attributes;if(!n)return[];const r=Object.keys(n);return t?r.filter((e=>n[e]?.__experimentalRole===t)):r}(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 BQ({patterns:e,onSelect:t}){return(0,x.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,x.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,x.createElement)(H_.ZP,{className:"block-editor-block-switcher__preview__popover",position:"bottom right"},(0,x.createElement)("div",{className:"block-editor-block-switcher__preview is-pattern-list-preview"},(0,x.createElement)(LQ,{patterns:e,onSelect:t})))))}function LQ({patterns:e,onSelect:t}){const n=(0,sM.u)();return(0,x.createElement)(AM.b,{...n,role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,$.__)("Patterns list")},e.map((e=>(0,x.createElement)(MQ,{key:e.name,pattern:e,onSelect:t,composite:n}))))}function MQ({pattern:e,onSelect:t,composite:n}){const r="block-editor-block-switcher__preview-patterns-container",o=(0,tT.Z)(MQ,`${r}-list__item-description`);return(0,x.createElement)("div",{className:`${r}-list__list-item`},(0,x.createElement)($L.A,{role:"option",as:"div",...n,"aria-label":e.title,"aria-describedby":e.description?o:void 0,className:`${r}-list__item`,onClick:()=>t(e.transformedBlocks)},(0,x.createElement)(FL,{blocks:e.transformedBlocks,viewportWidth:e.viewportWidth||500}),(0,x.createElement)("div",{className:`${r}-list__item-title`},e.title)),!!e.description&&(0,x.createElement)(h_.Z,{id:o},e.description))}var DQ=function({blocks:e,patterns:t,onSelect:n}){const[r,o]=(0,x.useState)(!1),i=((e,t)=>(0,x.useMemo)((()=>e.reduce(((e,n)=>{const r=((e,t)=>{const n=t.map((e=>vc(e))),r=new Set;for(const t of e){let e=!1;for(const o of n){const n=RQ(o,t.name,r);if(n){e=!0,r.add(n.clientId),AQ(n,t);break}}if(!e)return}return n})(t,n.blocks);return r&&e.push({...n,transformedBlocks:r}),e}),[])),[e,t]))(t,e);return i.length?(0,x.createElement)($k.Z,{className:"block-editor-block-switcher__pattern__transforms__menugroup"},r&&(0,x.createElement)(BQ,{patterns:i,onSelect:n}),(0,x.createElement)(Wk.Z,{onClick:e=>{e.preventDefault(),o(!r)},icon:_B.Z},(0,$.__)("Patterns"))):null};const OQ=({clientIds:e,blocks:t})=>{const{replaceBlocks:n,multiSelect:r,updateBlockAttributes:o}=(0,_l.Z)(e_),i=Sq(t[0].clientId),{possibleBlockTransformations:a,canRemove:s,hasBlockStyles:l,icon:c,patterns:u}=(0,yl.Z)((n=>{const{getBlockRootClientId:r,getBlockTransformItems:o,__experimentalGetPatternTransformItems:a,canRemoveBlocks:s}=n(e_),{getBlockStyles:l,getBlockType:c}=n(Vu),u=r(Array.isArray(e)?e[0]:e),[{name:d}]=t,p=1===t.length,h=p&&l(d);let m;if(p)m=i?.icon;else{const e=1===new Set(t.map((({name:e})=>e))).size;m=e?c(d)?.icon:pJ.Z}return{possibleBlockTransformations:o(t,u),canRemove:s(e,u),hasBlockStyles:!!h?.length,icon:m,patterns:a(t,u)}}),[e,t,i?.icon]),d=function({clientIds:e,blocks:t}){const{activeBlockVariation:n,blockVariationTransformations:r}=(0,yl.Z)((n=>{const{getBlockRootClientId:r,getBlockAttributes:o,canRemoveBlocks:i}=n(e_),{getActiveBlockVariation:a,getBlockVariations:s}=n(Vu),l=r(Array.isArray(e)?e[0]:e),c=i(e,l);if(1!==t.length||!c)return wQ;const[u]=t;return{blockVariationTransformations:s(u.name,"transform"),activeBlockVariation:a(u.name,o(u.clientId))}}),[e,t]),o=(0,x.useMemo)((()=>r?.filter((({name:e})=>e!==n?.name))),[r,n]);return o}({clientIds:e,blocks:t}),p=tQ({clientId:Array.isArray(e)?e[0]:e,maximumLength:35}),h=1===t.length&&dc(t[0]),m=1===t.length&&pc(t[0]);function f(e){e.length>1&&r(e[0].clientId,e[e.length-1].clientId)}const g=!!a.length&&s&&!m,b=!!d?.length,v=!!u?.length&&s;if(!l&&!g&&!b)return(0,x.createElement)(nm,null,(0,x.createElement)(Jh,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:p,icon:(0,x.createElement)(x.Fragment,null,(0,x.createElement)(EB,{icon:c,showColors:!0}),(h||m)&&(0,x.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},p))}));const y=p,_=1===t.length?(0,$.sprintf)((0,$.__)("%s: Change block type or style"),p):(0,$.sprintf)((0,$._n)("Change type of %d block","Change type of %d blocks",t.length),t.length),k=g||b,w=l||k||v;return(0,x.createElement)(nm,null,(0,x.createElement)(qh.Z,null,(r=>(0,x.createElement)(em.Z,{className:"block-editor-block-switcher",label:y,popoverProps:{placement:"bottom-start",className:"block-editor-block-switcher__popover"},icon:(0,x.createElement)(x.Fragment,null,(0,x.createElement)(EB,{icon:c,className:"block-editor-block-switcher__toggle",showColors:!0}),(h||m)&&(0,x.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},p)),toggleProps:{describedBy:_,...r},menuProps:{orientation:"both"}},(({onClose:r})=>w&&(0,x.createElement)("div",{className:"block-editor-block-switcher__container"},v&&(0,x.createElement)(DQ,{blocks:t,patterns:u,onSelect:t=>{!function(t){n(e,t),f(t)}(t),r()}}),k&&(0,x.createElement)(IQ,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:a,possibleBlockVariationTransformations:d,blocks:t,onSelect:o=>{!function(r){const o=xc(t,r);n(e,o),f(o)}(o),r()},onSelectVariation:e=>{!function(e){o(t[0].clientId,{...d.find((({name:t})=>t===e)).attributes})}(e),r()}}),l&&(0,x.createElement)(PQ,{hoveredBlock:t[0],onSwitch:r})))))))};var FQ=({clientIds:e})=>{const t=(0,yl.Z)((t=>t(e_).getBlocksByClientId(e)),[e]);return!t.length||t.some((e=>!e))?null:(0,x.createElement)(OQ,{clientIds:e,blocks:t})};const{Fill:jQ,Slot:ZQ}=(0,kl.up)("__unstableBlockToolbarLastItem");jQ.Slot=ZQ;var zQ=jQ,VQ=n(92022),HQ=n.n(VQ);function UQ(e){const t=(0,x.useRef)(e);return t.current=e,t}function $Q(e){e.defaultView;const t=e.defaultView.getSelection(),n=t.rangeCount?t.getRangeAt(0):null;return!!n&&!n.collapsed}function WQ(){const{getBlockName:e}=(0,yl.Z)(e_),{getBlockType:t}=(0,yl.Z)(Vu),{createSuccessNotice:n}=(0,_l.Z)(PM.store);return(0,x.useCallback)(((r,o)=>{let i="";if(1===o.length){const n=o[0],a=t(e(n))?.title;i="copy"===r?(0,$.sprintf)((0,$.__)('Copied "%s" to clipboard.'),a):(0,$.sprintf)((0,$.__)('Moved "%s" to clipboard.'),a)}else i="copy"===r?(0,$.sprintf)((0,$._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",o.length),o.length):(0,$.sprintf)((0,$._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",o.length),o.length);n(i,{type:"snackbar"})}),[])}function GQ(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:r,__unstableIsFullySelected:o,__unstableIsSelectionCollapsed:i,__unstableIsSelectionMergeable:a,__unstableGetSelectedBlocksWithPartialSelection:s,canInsertBlockType:l}=(0,yl.Z)(e_),{flashBlock:c,removeBlocks:u,replaceBlocks:d,__unstableDeleteSelection:p,__unstableExpandSelection:h,insertBlocks:m}=(0,_l.Z)(e_),f=WQ();return If((g=>{function b(b){if(b.defaultPrevented)return;const v=t();if(0===v.length)return;if(!n()){const{target:e}=b,{ownerDocument:t}=e,n="copy"===b.type||"cut"===b.type?function(e){return $Q(e)||!!e.activeElement&&function(e){if(!NA(e)&&!PA(e))return!1;try{const{selectionStart:t,selectionEnd:n}=e;return null===t||t!==n}catch(e){return!0}}(e.activeElement)}(t):function(e){return!!e.activeElement&&(NA(e.activeElement)||PA(e.activeElement)||$Q(e))}(t);if(n)return}if(!g.contains(b.target.ownerDocument.activeElement))return;b.preventDefault();const y=a(),_=i()||o(),k=!_&&!y;if("copy"===b.type||"cut"===b.type)if(1===v.length&&c(v[0]),k)h();else{let t;if(f(b.type,v),_)t=e(v);else{const[n,r]=s();t=[n,...e(v.slice(1,v.length-1)),r]}const n=b.clipboardData.getData("__unstableWrapperBlockName");n&&(t=fc(n,JSON.parse(b.clipboardData.getData("__unstableWrapperBlockAttributes")),t));const r=Dd(t);b.clipboardData.setData("text/plain",Hl(r.replace(/<br>/g,"\n")).trim().replace(/\n\n+/g,"\n\n")),b.clipboardData.setData("text/html",r)}if("cut"===b.type)_&&!k?u(v):(b.target.ownerDocument.activeElement.contentEditable=!1,p());else if("paste"===b.type){const{__experimentalCanUserUseUnfilteredHTML:e}=r(),{plainText:t,html:n,files:o}=function({clipboardData:e}){let t="",n="";try{t=e.getData("text/plain"),n=e.getData("text/html")}catch(t){try{n=e.getData("Text")}catch(e){return}}const r=XO(e);return r.length&&!fX(r,n)?{files:r}:{html:n,plainText:t,files:[]}}(b);let i=[];if(o.length){const e=Ec("from");i=o.reduce(((t,n)=>{const r=wc(e,(e=>"files"===e.type&&e.isMatch([n])));return r&&t.push(r.transform([n])),t}),[]).flat()}else i=Hh({HTML:n,plainText:t,mode:"BLOCKS",canUserUseUnfilteredHTML:e});if(1===v.length){const[e]=v;if(i.every((t=>l(t.name,e))))return void m(i,void 0,e)}d(v,i,i.length-1,-1)}}return g.ownerDocument.addEventListener("copy",b),g.ownerDocument.addEventListener("cut",b),g.ownerDocument.addEventListener("paste",b),()=>{g.ownerDocument.removeEventListener("copy",b),g.ownerDocument.removeEventListener("cut",b),g.ownerDocument.removeEventListener("paste",b)}}),[])}const qQ="__experimentalBorder",KQ="color",YQ="typography.__experimentalFontFamily",XQ="typography.fontSize",JQ=["typography.lineHeight",XQ,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",YQ,"typography.textColumns","typography.__experimentalTextDecoration","typography.__experimentalTextTransform","typography.__experimentalWritingMode","typography.__experimentalLetterSpacing",qQ,KQ,"spacing"],QQ={align:e=>uc(e,"align"),borderColor:e=>function(e,t="any"){if("web"!==wm.Z.OS)return!1;const n=cc(e,qQ);return!0===n||("any"===t?!!(n?.color||n?.radius||n?.width||n?.style):!!n?.[t])}(e,"color"),backgroundColor:e=>{const t=cc(e,KQ);return t&&!1!==t.background},textColor:e=>{const t=cc(e,KQ);return t&&!1!==t.text},gradient:e=>{const t=cc(e,KQ);return null!==t&&"object"==typeof t&&!!t.gradients},className:e=>uc(e,"customClassName",!0),fontFamily:e=>uc(e,YQ),fontSize:e=>uc(e,XQ),layout:e=>uc(e,"layout"),style:e=>JQ.some((t=>uc(e,t)))};function e0(e,t){return Object.entries(QQ).reduce(((n,[r,o])=>(o(e.name)&&o(t.name)&&(n[r]=e.attributes[r]),n)),{})}function t0(e,t,n){for(let r=0;r<Math.min(t.length,e.length);r+=1)n(e[r].clientId,e0(t[r],e[r])),t0(e[r].innerBlocks,t[r].innerBlocks,n)}function n0({clientIds:e,children:t,__experimentalUpdateSelection:n}){const{canInsertBlockType:r,getBlockRootClientId:o,getBlocksByClientId:i,canMoveBlocks:a,canRemoveBlocks:s}=(0,yl.Z)(e_),{getDefaultBlockName:l,getGroupingBlockName:c}=(0,yl.Z)(Vu),u=i(e),d=o(e[0]),p=u.every((e=>!!e&&(uc(e.name,"color")||uc(e.name,"typography")))),h=u.every((e=>!!e&&uc(e.name,"multiple",!0)&&r(e.name,d))),m=r(l(),d),f=a(e,d),g=s(e,d),{removeBlocks:b,replaceBlocks:v,duplicateBlocks:y,insertAfterBlock:_,insertBeforeBlock:k,flashBlock:w,setBlockMovingClientId:E,setNavigationMode:C,selectBlock:S}=(0,_l.Z)(e_),I=WQ(),T=function(){const e=(0,Tf.Z)(),{updateBlockAttributes:t}=(0,_l.Z)(e_),{createSuccessNotice:n,createWarningNotice:r,createErrorNotice:o}=(0,_l.Z)(PM.store);return(0,x.useCallback)((async i=>{let a="";try{if(!window.navigator.clipboard)return void o((0,$.__)("Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers."),{type:"snackbar"});a=await window.navigator.clipboard.readText()}catch(e){return void o((0,$.__)("Unable to paste styles. Please allow browser clipboard permissions before continuing."),{type:"snackbar"})}if(!a||!function(e){try{const t=Lp(e,{__unstableSkipMigrationLogs:!0,__unstableSkipAutop:!0});return 1!==t.length||"core/freeform"!==t[0].name}catch(e){return!1}}(a))return void r((0,$.__)("Unable to paste styles. Block styles couldn't be found within the copied content."),{type:"snackbar"});const s=Lp(a);if(1===s.length?e.batch((()=>{t0(i,i.map((()=>s[0])),t)})):e.batch((()=>{t0(i,s,t)})),1===i.length){const e=sc(i[0].name)?.title;n((0,$.sprintf)((0,$.__)("Pasted styles to %s."),e),{type:"snackbar"})}else n((0,$.sprintf)((0,$.__)("Pasted styles to %d blocks."),i.length),{type:"snackbar"})}),[e.batch,t,n,r,o])}();return t({canCopyStyles:p,canDuplicate:h,canInsertDefaultBlock:m,canMove:f,canRemove:g,rootClientId:d,blocks:u,onDuplicate(){return y(e,n)},onRemove(){return b(e,n)},onInsertBefore(){const t=Array.isArray(e)?e[0]:t;k(t)},onInsertAfter(){const t=Array.isArray(e)?e[e.length-1]:t;_(t)},onMoveTo(){C(!0),S(e[0]),E(e[0])},onGroup(){if(!u.length)return;const t=c(),n=xc(u,t);n&&v(e,n)},onUngroup(){if(!u.length)return;const t=u[0].innerBlocks;t.length&&v(e,t)},onCopy(){const e=u.map((({clientId:e})=>e));1===u.length&&w(e[0]),I("copy",e)},async onPasteStyles(){await T(u)}})}var r0=(0,D.Z)((0,lT.Z)(((e,{clientId:t})=>{const n=e(e_).getBlock(t);return{block:n,shouldRender:n&&"core/html"===n.name}})),(0,cT.Z)(((e,{block:t})=>({onClick:()=>e(e_).replaceBlocks(t.clientId,mh({HTML:Ld(t)}))}))))((function({shouldRender:e,onClick:t,small:n}){if(!e)return null;const r=(0,$.__)("Convert to Blocks");return(0,x.createElement)(Wk.Z,{onClick:t},!n&&r)}));const{Fill:o0,Slot:i0}=(0,kl.up)("__unstableBlockSettingsMenuFirstItem");o0.Slot=i0;var a0=o0;const s0={className:"block-editor-block-settings-menu__popover",placement:"bottom-start"};function l0({blocks:e,onCopy:t,label:n}){const r=function(t,n){const r=UQ((()=>Dd(e))),o=UQ(n);return If((e=>{const t=new(HQ())(e,{text(){return"function"==typeof r.current?r.current():r.current||""}});return t.on("success",(({clearSelection:t})=>{t(),e.focus(),o.current&&o.current()})),()=>{t.destroy()}}),[])}(0,t),o=e.length>1?(0,$.__)("Copy blocks"):(0,$.__)("Copy"),i=n||o;return(0,x.createElement)(Wk.Z,{ref:r},i)}function c0({block:e,clientIds:t,__experimentalSelectBlock:n,children:r,__unstableDisplayLocation:o,...i}){const a=e?.clientId,s=Array.isArray(t)?t:[t],l=s.length,c=s[0],{firstParentClientId:u,onlyBlock:d,parentBlockType:p,previousBlockClientId:h,selectedBlockClientIds:m}=(0,yl.Z)((e=>{const{getBlockCount:t,getBlockName:n,getBlockRootClientId:r,getPreviousBlockClientId:o,getSelectedBlockClientIds:i,getBlockAttributes:a}=e(e_),{getActiveBlockVariation:s}=e(Vu),l=r(c),u=l&&n(l);return{firstParentClientId:l,onlyBlock:1===t(l),parentBlockType:l&&(s(u,a(l))||sc(u)),previousBlockClientId:o(c),selectedBlockClientIds:i()}}),[c]),{getBlockOrder:f,getSelectedBlockClientIds:g}=(0,yl.Z)(e_),b=(0,yl.Z)((e=>Jy(e(e_)).getOpenedBlockSettingsMenu()),[]),{setOpenedBlockSettingsMenu:v}=Jy((0,_l.Z)(e_)),y=(0,yl.Z)((e=>{const{getShortcutRepresentation:t}=e(RB.h);return{duplicate:t("core/block-editor/duplicate"),remove:t("core/block-editor/remove"),insertAfter:t("core/block-editor/insert-after"),insertBefore:t("core/block-editor/insert-before")}}),[]),_=(0,RB.sx)(),{selectBlock:k}=(0,_l.Z)(e_),w=m.length>0,E=(0,x.useCallback)((async e=>{if(n){const t=await e;t&&t[0]&&n(t[0],!1)}}),[n]),C=(0,x.useCallback)((()=>{if(n){let e=h||u;e||(e=f()[0]);const t=w&&0===g().length;n(e,t)}}),[n,h,u,f,w,g]),S=1===l?(0,$.__)("Delete"):(0,$.__)("Delete blocks"),I=(0,x.useRef)(),T=yQ({ref:I,highlightParent:!0}),N=m?.includes(u),P=a?b===a||!1:void 0,R=(0,x.useCallback)((e=>{e&&b!==a?v(a):!e&&b&&b===a&&v(void 0)}),[a,b,v]);return(0,x.createElement)(n0,{clientIds:t,__experimentalUpdateSelection:!n},(({canCopyStyles:e,canDuplicate:n,canInsertDefaultBlock:a,canMove:s,canRemove:h,onDuplicate:m,onInsertAfter:f,onInsertBefore:g,onRemove:b,onCopy:w,onPasteStyles:A,onMoveTo:B,blocks:L})=>(0,x.createElement)(em.Z,{icon:_T.Z,label:(0,$.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:s0,open:P,onToggle:R,noIcons:!0,menuProps:{onKeyDown(e){e.defaultPrevented||(_("core/block-editor/remove",e)&&h?(e.preventDefault(),C(b())):_("core/block-editor/duplicate",e)&&n?(e.preventDefault(),E(m())):_("core/block-editor/insert-after",e)&&a?(e.preventDefault(),v(void 0),f()):_("core/block-editor/insert-before",e)&&a&&(e.preventDefault(),v(void 0),g()))}},...i},(({onClose:i})=>(0,x.createElement)(x.Fragment,null,(0,x.createElement)($k.Z,null,(0,x.createElement)(a0.Slot,{fillProps:{onClose:i}}),!N&&!!u&&(0,x.createElement)(Wk.Z,{...T,ref:I,icon:(0,x.createElement)(EB,{icon:p.icon}),onClick:()=>k(u)},(0,$.sprintf)((0,$.__)("Select parent block (%s)"),p.title)),1===l&&(0,x.createElement)(r0,{clientId:c}),(0,x.createElement)(l0,{blocks:L,onCopy:w}),n&&(0,x.createElement)(Wk.Z,{onClick:(0,Wc.Z)(i,m,E),shortcut:y.duplicate},(0,$.__)("Duplicate")),a&&(0,x.createElement)(x.Fragment,null,(0,x.createElement)(Wk.Z,{onClick:(0,Wc.Z)(i,g),shortcut:y.insertBefore},(0,$.__)("Add before")),(0,x.createElement)(Wk.Z,{onClick:(0,Wc.Z)(i,f),shortcut:y.insertAfter},(0,$.__)("Add after")))),e&&(0,x.createElement)($k.Z,null,(0,x.createElement)(l0,{blocks:L,onCopy:w,label:(0,$.__)("Copy styles")}),(0,x.createElement)(Wk.Z,{onClick:A},(0,$.__)("Paste styles"))),(0,x.createElement)(hK.Slot,{fillProps:{onClose:i,canMove:s,onMoveTo:B,onlyBlock:d,count:l,firstBlockClientId:c},clientIds:t,__unstableDisplayLocation:o}),"function"==typeof r?r({onClose:i}):x.Children.map((e=>(0,x.cloneElement)(e,{onClose:i}))),h&&(0,x.createElement)($k.Z,null,(0,x.createElement)(Wk.Z,{onClick:(0,Wc.Z)(i,b,C),shortcut:y.remove},S)))))))}var u0=c0,d0=function({clientIds:e,...t}){return(0,x.createElement)(nm,null,(0,x.createElement)(qh.Z,null,(n=>(0,x.createElement)(u0,{clientIds:e,toggleProps:n,...t}))))};function p0({clientId:e,wrapperRef:t}){const{canEdit:n,canMove:r,canRemove:o,canLock:i}=Xq(e),[a,s]=(0,x.useReducer)((e=>!e),!1),l=(0,x.useRef)(null),c=(0,x.useRef)(!0),u=!i||n&&r&&o;return(0,x.useEffect)((()=>{c.current?c.current=!1:!a&&u&&TA.focusable.find(t.current,{sequential:!1}).find((e=>"BUTTON"===e.tagName&&e!==l.current))?.focus()}),[a,u,t]),u?null:(0,x.createElement)(x.Fragment,null,(0,x.createElement)(nm,{className:"block-editor-block-lock-toolbar"},(0,x.createElement)(Jh,{ref:l,icon:eK.Z,label:(0,$.__)("Unlock"),onClick:s,"aria-expanded":a,"aria-haspopup":"dialog"})),a&&(0,x.createElement)(rK,{clientId:e,onClose:s}))}var h0=n(64527),m0=n(47897),f0=n(64438);const g0={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}};var b0=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:r}=Kq(),{replaceBlocks:o}=(0,_l.Z)(e_),{canRemove:i,variations:a}=(0,yl.Z)((e=>{const{canRemoveBlocks:r}=e(e_),{getBlockVariations:o}=e(Vu);return{canRemove:r(t),variations:o(n,"transform")}}),[t,n]),s=r=>{const i=xc(e,n);"string"!=typeof r&&(r="group"),i&&i.length>0&&(i[0].attributes.layout=g0[r],o(t,i))};if(!r||!i)return null;const l=!!a.find((({name:e})=>"group-row"===e)),c=!!a.find((({name:e})=>"group-stack"===e));return(0,x.createElement)(nm,null,(0,x.createElement)(Jh,{icon:h0.Z,label:(0,$._x)("Group","verb"),onClick:s}),l&&(0,x.createElement)(Jh,{icon:m0.Z,label:(0,$._x)("Row","single horizontal line"),onClick:()=>s("row")}),c&&(0,x.createElement)(Jh,{icon:f0.Z,label:(0,$._x)("Stack","verb"),onClick:()=>s("stack")}))};function v0({clientIds:e}){const t=1===e.length?e[0]:void 0,n=(0,yl.Z)((e=>!!t&&"html"===e(e_).getBlockMode(t)),[t]),{toggleBlockMode:r}=(0,_l.Z)(e_);return n?(0,x.createElement)(nm,null,(0,x.createElement)(Jh,{onClick:()=>{r(t)}},(0,$.__)("Edit visually"))):null}var y0=(0,x.createContext)(""),_0=({hideDragHandle:e})=>{const{blockClientIds:t,blockType:n,isValid:r,isVisual:o,blockEditingMode:i}=(0,yl.Z)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:r,isBlockValid:o,getBlockRootClientId:i,getBlockEditingMode:a}=e(e_),s=r(),l=s[0],c=i(l);return{blockClientIds:s,blockType:l&&sc(t(l)),rootClientId:c,isValid:s.every((e=>o(e))),isVisual:s.every((e=>"visual"===n(e))),blockEditingMode:a(l)}}),[]),a=(0,x.useRef)(null),s=(0,x.useRef)(),l=yQ({ref:s}),c=!(0,rT.Z)("medium","<");if(n&&!uc(n,"__experimentalToolbar",!0))return null;if(0===t.length)return null;const u=r&&o,d=t.length>1,p=dc(n)||pc(n),h=R()("block-editor-block-toolbar",{"is-synced":p});return(0,x.createElement)("div",{className:h,ref:a},!d&&c&&"default"===i&&(0,x.createElement)(_Q,null),(u||d)&&"default"===i&&(0,x.createElement)("div",{ref:s,...l},(0,x.createElement)(nm,{className:"block-editor-block-toolbar__block-controls"},(0,x.createElement)(FQ,{clientIds:t}),!d&&(0,x.createElement)(p0,{clientId:t[0],wrapperRef:a}),(0,x.createElement)(dQ,{clientIds:t,hideDragHandle:e}))),u&&d&&(0,x.createElement)(b0,null),u&&(0,x.createElement)(x.Fragment,null,(0,x.createElement)(Hk.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,x.createElement)(Hk.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,x.createElement)(Hk.Slot,{className:"block-editor-block-toolbar__slot"}),(0,x.createElement)(Hk.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,x.createElement)(Hk.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,x.createElement)(y0.Provider,{value:n?.name},(0,x.createElement)(zQ.Slot,null))),(0,x.createElement)(v0,{clientIds:t}),"default"===i&&(0,x.createElement)(d0,{clientIds:t}))};function k0(e="default"){const t=om[e]?.Slot,n=Fk(t?.__unstableName);return t?!!n?.length:("undefined"!=typeof SCRIPT_DEBUG&&!0===SCRIPT_DEBUG&&(0,Tk.default)(`Unknown BlockControls group "${e}" provided.`),null)}var w0=function({focusOnMount:e,isFixed:t,...n}){const[r,o]=(0,x.useState)(!1),i=(0,x.useRef)(),a=(0,rT.Z)("medium"),{blockType:s,blockEditingMode:l,hasParents:c,showParentSelector:u,selectedBlockClientId:d}=(0,yl.Z)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientIds:r,getBlockEditingMode:o}=e(e_),{getBlockType:i}=e(Vu),a=r(),s=a[0],l=n(s),c=l[l.length-1],u=i(t(c));return{selectedBlockClientId:s,blockType:s&&i(t(s)),blockEditingMode:o(s),hasParents:l.length,showParentSelector:u&&"default"===o(c)&&uc(u,"__experimentalParentSelector",!0)&&a.length<=1&&"default"===o(s)}}),[]);(0,x.useEffect)((()=>{o(!1)}),[d]);const p=(0,rT.Z)("large",">="),h=document.body.classList.contains("is-fullscreen-mode");(0,x.useLayoutEffect)((()=>{if(!t)return;const e=document.querySelector(".block-editor-block-contextual-toolbar");if(!e)return;if(!s)return void(e.style.width="initial");if(!p)return void(e.style={});if(r)return void(e.style.width="auto");const n=document.querySelector(".edit-post-header__settings, .edit-widgets-header__actions"),o=document.querySelector(".edit-site-header-edit-mode__end"),i=window.getComputedStyle(e),a=!!n&&window.getComputedStyle(n),l=!!o&&window.getComputedStyle(o),c=parseFloat(i.marginLeft),u=a?parseFloat(a.width):0,d=l?parseFloat(l.width):0;e.style.width=`calc(100% - ${d+u+c+(n||o?2:0)+(h?0:160)}px)`}),[t,p,r,h,s]);const m=!s||uc(s,"__experimentalToolbar",!0),f=function(){let e=!1;for(const t in om)k0(t)&&(e=!0);return e}();if(!m||"default"!==l&&!f)return null;const g=R()("block-editor-block-contextual-toolbar",{"has-parent":c&&u,"is-fixed":t,"is-collapsed":r});return(0,x.createElement)(iX,{focusOnMount:e,className:g,"aria-label":(0,$.__)("Block tools"),...n},!r&&(0,x.createElement)(_0,{hideDragHandle:t}),t&&a&&s&&(0,x.createElement)(nm,{className:r?"block-editor-block-toolbar__group-expand-fixed-toolbar":"block-editor-block-toolbar__group-collapse-fixed-toolbar"},(0,x.createElement)(qh.Z,{as:Jh,ref:i,icon:r?hQ.Z:mQ.Z,onClick:()=>{o((e=>!e)),i.current.focus()},label:r?(0,$.__)("Show block tools"):(0,$.__)("Hide block tools")})))};const E0={placement:"top-start"},C0={...E0,flip:!1,shift:!0},x0={...E0,flip:!0,shift:!1};function S0(e,t,n,r,o){if(!e||!t)return C0;const i=n?.scrollTop||0,a=t.getBoundingClientRect(),s=i+e.getBoundingClientRect().top,l=e.ownerDocument.documentElement.clientHeight,c=s+r,u=a.top>c,d=a.height>l-r;return o||!u&&!d?x0:C0}function I0(){const e=(0,rT.Z)("medium"),{shouldShowContextualToolbar:t,canFocusHiddenToolbar:n,fixedToolbarCanBeFocused:r}=(0,yl.Z)((t=>{const{__unstableGetEditorMode:n,isMultiSelecting:r,isTyping:o,isBlockInterfaceHidden:i,getBlock:a,getSettings:s,isNavigationMode:l,getSelectedBlockClientId:c,getFirstMultiSelectedBlockClientId:u}=Jy(t(e_)),d="edit"===n(),p=s().hasFixedToolbar,h=s().isDistractionFree,m=u()||c(),f=!!m,g=Nc(a(m)||{}),b=d&&!p&&(!h||l())&&e&&!r()&&!o()&&f&&!g&&!i();return{shouldShowContextualToolbar:b,canFocusHiddenToolbar:d&&f&&!b&&!p&&!h&&!g,fixedToolbarCanBeFocused:(p||!e)&&m}}),[e]);return{shouldShowContextualToolbar:t,canFocusHiddenToolbar:n,fixedToolbarCanBeFocused:r}}function T0(e){const{__unstableGetEditorMode:t,hasMultiSelection:n,isTyping:r,getLastMultiSelectedBlockClientId:o}=e(e_);return{editorMode:t(),hasMultiSelection:n(),isTyping:r(),lastClientId:n()?o():null}}function N0({clientId:e,rootClientId:t,isEmptyDefaultBlock:n,capturingClientId:r,__unstablePopoverSlot:o,__unstableContentRef:i}){const{editorMode:a,hasMultiSelection:s,isTyping:l,lastClientId:c}=(0,yl.Z)(T0,[]),u=(0,yl.Z)((t=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:r,getBlockOrder:o}=t(e_);if(!n())return!1;const i=r();return o(i.rootClientId)[i.index]===e}),[e]),d=(0,x.useRef)(!1),{shouldShowContextualToolbar:p,canFocusHiddenToolbar:h}=I0(),{stopTyping:m}=(0,_l.Z)(e_),f=!l&&"edit"===a&&n,g=!s&&("navigation"===a||"zoom-out"===a);(0,RB.bx)("core/block-editor/focus-toolbar",(()=>{d.current=!0,m(!0)}),{isDisabled:!h}),(0,x.useEffect)((()=>{d.current=!1}));const b=(0,x.useRef)();(0,x.useEffect)((()=>{b.current=void 0}),[e]);const v=function({contentElement:e,clientId:t}){const n=oB(t),[r,o]=(0,x.useState)(0),{blockIndex:i,isSticky:a}=(0,yl.Z)((e=>{const{getBlockIndex:n,getBlockAttributes:r}=e(e_);return{blockIndex:n(t),isSticky:Mq(r(t))}}),[t]),s=(0,x.useMemo)((()=>{if(e)return hA(e)}),[e]),[l,c]=(0,x.useState)((()=>S0(e,n,s,r,a))),u=If((e=>{o(e.offsetHeight)}),[]),d=(0,x.useCallback)((()=>c(S0(e,n,s,r,a))),[e,n,s,r]);return(0,x.useLayoutEffect)(d,[i,d]),(0,x.useLayoutEffect)((()=>{if(!e||!n)return;const t=e?.ownerDocument?.defaultView;let r;t?.addEventHandler?.("resize",d);const o=n?.ownerDocument?.defaultView;return o.ResizeObserver&&(r=new o.ResizeObserver(d),r.observe(n)),()=>{t?.removeEventHandler?.("resize",d),r&&r.disconnect()}}),[d,e,n]),{...l,ref:u}}({contentElement:i?.current,clientId:e});return f?(0,x.createElement)(MO,{clientId:r||e,__unstableCoverTarget:!0,bottomClientId:c,className:R()("block-editor-block-list__block-side-inserter-popover",{"is-insertion-point-visible":u}),__unstablePopoverSlot:o,__unstableContentRef:i,resize:!1,shift:!1,...v},(0,x.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},(0,x.createElement)(xO,{position:"bottom right",rootClientId:t,clientId:e,__experimentalIsQuick:!0}))):g||p?(0,x.createElement)(MO,{clientId:r||e,bottomClientId:c,className:R()("block-editor-block-list__block-popover",{"is-insertion-point-visible":u}),__unstablePopoverSlot:o,__unstableContentRef:i,resize:!1,...v},p&&(0,x.createElement)(w0,{focusOnMount:d.current,__experimentalInitialIndex:b.current,__experimentalOnIndexChange:e=>{b.current=e},key:e}),g&&(0,x.createElement)(pQ,{clientId:e,rootClientId:t})):null}function P0(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:r,getBlock:o,getBlockParents:i,__experimentalGetBlockListSettingsForBlocks:a}=e(e_),s=t()||n();if(!s)return;const{name:l,attributes:c={}}=o(s)||{},u=i(s),d=a(u),p=u.find((e=>d[e]?.__experimentalCaptureToolbars));return{clientId:s,rootClientId:r(s),name:l,isEmptyDefaultBlock:l&&Nc({name:l,attributes:c}),capturingClientId:p}}function R0({__unstablePopoverSlot:e,__unstableContentRef:t}){const n=(0,yl.Z)(P0,[]);if(!n)return null;const{clientId:r,rootClientId:o,name:i,isEmptyDefaultBlock:a,capturingClientId:s}=n;return i?(0,x.createElement)(N0,{clientId:r,rootClientId:o,isEmptyDefaultBlock:a,capturingClientId:s,__unstablePopoverSlot:e,__unstableContentRef:t}):null}var A0=function({__unstableContentRef:e}){const[t,n]=(0,x.useState)(!1),r=(0,yl.Z)((e=>e(e_).getBlockOrder()),[]);return(0,x.useEffect)((()=>{const e=setTimeout((()=>{n(!0)}),500);return()=>{clearTimeout(e)}}),[]),t?r.map(((t,n)=>n===r.length-1?null:(0,x.createElement)(BO,{key:t,previousClientId:t,nextClientId:r[n+1],__unstableContentRef:e},(0,x.createElement)("div",{className:"block-editor-block-list__insertion-point-inserter is-with-inserter"},(0,x.createElement)(xO,{position:"bottom center",clientId:r[n+1],__experimentalIsQuick:!0}))))):null};function B0(e){const{__unstableGetEditorMode:t,getSettings:n,isTyping:r}=e(e_);return{isZoomOutMode:"zoom-out"===t(),hasFixedToolbar:n().hasFixedToolbar,isTyping:r()}}function L0({children:e,__unstableContentRef:t,...n}){const r=(0,rT.Z)("medium"),{hasFixedToolbar:o,isZoomOutMode:i,isTyping:a}=(0,yl.Z)(B0,[]),s=(0,RB.sx)(),{getSelectedBlockClientIds:l,getBlockRootClientId:c}=(0,yl.Z)(e_),{duplicateBlocks:u,removeBlocks:d,insertAfterBlock:p,insertBeforeBlock:h,clearSelectedBlock:m,selectBlock:f,moveBlocksUp:g,moveBlocksDown:b}=(0,_l.Z)(e_),v=RO(t),y=RO(t);return(0,x.createElement)("div",{...n,onKeyDown:function(e){if(!e.defaultPrevented)if(s("core/block-editor/move-up",e)){const t=l();if(t.length){e.preventDefault();const n=c(t[0]);g(t,n)}}else if(s("core/block-editor/move-down",e)){const t=l();if(t.length){e.preventDefault();const n=c(t[0]);b(t,n)}}else if(s("core/block-editor/duplicate",e)){const t=l();t.length&&(e.preventDefault(),u(t))}else if(s("core/block-editor/remove",e)){const t=l();t.length&&(e.preventDefault(),d(t))}else if(s("core/block-editor/insert-after",e)){const t=l();t.length&&(e.preventDefault(),p(t[t.length-1]))}else if(s("core/block-editor/insert-before",e)){const t=l();t.length&&(e.preventDefault(),h(t[0]))}else if(s("core/block-editor/unselect",e)){const n=l();n.length&&(e.preventDefault(),n.length>1?f(n[0]):m(),e.target.ownerDocument.defaultView.getSelection().removeAllRanges(),t?.current.focus())}}},(0,x.createElement)(FO.Provider,{value:(0,x.useRef)(!1)},!a&&(0,x.createElement)(ZO,{__unstableContentRef:t}),!i&&(o||!r)&&(0,x.createElement)(w0,{isFixed:!0}),(0,x.createElement)(R0,{__unstableContentRef:t}),(0,x.createElement)(H_.ZP.Slot,{name:"block-toolbar",ref:v}),e,(0,x.createElement)(H_.ZP.Slot,{name:"__unstable-block-tools-after",ref:y}),i&&(0,x.createElement)(A0,{__unstableContentRef:t})))}const M0=()=>{};var D0=(0,x.forwardRef)((function({rootClientId:e,clientId:t,isAppender:n,showInserterHelpPanel:r,showMostUsedBlocks:o=!1,__experimentalInsertionIndex:i,__experimentalFilterValue:a,onSelect:s=M0,shouldFocusBlock:l=!1},c){const{destinationRootClientId:u,prioritizePatterns:d}=(0,yl.Z)((n=>{const{getBlockRootClientId:r,getSettings:o}=n(e_),i=e||r(t)||void 0;return{destinationRootClientId:i,prioritizePatterns:o().__experimentalPreferPatternsOnRoot&&!i}}),[t,e]);return(0,x.createElement)(_O,{onSelect:s,rootClientId:u,clientId:t,isAppender:n,showInserterHelpPanel:r,showMostUsedBlocks:o,__experimentalInsertionIndex:i,__experimentalFilterValue:a,shouldFocusBlock:l,prioritizePatterns:d,ref:c})}));const O0={button:"wp-element-button",caption:"wp-element-caption"},F0=e=>O0[e]?O0[e]:"",j0={__experimentalBorder:"border",color:"color",spacing:"spacing",typography:"typography"};function Z0(e){return e?.startsWith?.("var:")?`var(--wp--${e.slice(4).split("|").join("--")})`:e}function z0(e={},t,n){let r=[];return Object.keys(e).forEach((o=>{const i=t+VE(o.replace("/","-")),a=e[o];if(a instanceof Object){const e=i+n;r=[...r,...z0(a,e,n)]}else r.push(`${i}: ${a}`)})),r}const V0=(e,t)=>{const n={};return Object.entries(e).forEach((([e,r])=>{if("root"===e||!t?.[e])return;const o="string"==typeof r;if(o||Object.entries(r).forEach((([r,o])=>{if("root"===r||!t?.[e][r])return;const i=H0({[e]:{[r]:t[e][r]}});n[o]=[...n[o]||[],...i],delete t[e][r]})),o||r.root){const i=o?r:r.root,a=H0({[e]:t[e]});n[i]=[...n[i]||[],...a],delete t[e]}})),n};function H0(e={},t="",n,r={},o=!0){const i=lC===t,a=Object.entries(Wl).reduce(((t,[r,{value:o,properties:a,useEngine:s,rootOnly:l}])=>{if(l&&!i)return t;const c=o;if("elements"===c[0]||s)return t;const u=$E(e,c);if("--wp--style--root--padding"===r&&("string"==typeof u||!n))return t;if(a&&"string"!=typeof u)Object.entries(a).forEach((e=>{const[n,r]=e;if(!$E(u,[r],!1))return;const o=n.startsWith("--")?n:VE(n);t.push(`${o}: ${Z0($E(u,[r]))}`)}));else if($E(e,c,!1)){const n=r.startsWith("--")?r:VE(r);t.push(`${n}: ${Z0($E(e,c))}`)}return t}),[]);return Gx(e).forEach((e=>{if(i&&(n||!o)&&e.key.startsWith("padding"))return;const t=e.key.startsWith("--")?e.key:VE(e.key);let s=e.value;if("string"!=typeof s&&s?.ref){const e=s.ref.split(".");if(s=$E(r,e),!s||s?.ref)return}"font-size"===t&&(s=iC({size:s},sC(r?.settings))),a.push(`${t}: ${s}`)})),a}function U0({layoutDefinitions:e=sE,style:t,selector:n,hasBlockGapSupport:r,hasFallbackGapSupport:o,fallbackGapValue:i}){let a="",s=r?TE(t?.spacing?.blockGap):"";if(o&&(n===lC?s=s||"0.5em":!r&&i&&(s=i)),s&&e&&(Object.values(e).forEach((({className:e,name:t,spacingStyles:o})=>{(r||"flex"===t||"grid"===t)&&o?.length&&o.forEach((t=>{const o=[];if(t.rules&&Object.entries(t.rules).forEach((([e,t])=>{o.push(`${e}: ${t||s}`)})),o.length){let i="";i=r?n===lC?`:where(${n} .${e})${t?.selector||""}`:`${n}-${e}${t?.selector||""}`:n===lC?`:where(.${e}${t?.selector||""})`:`:where(${n}.${e}${t?.selector||""})`,a+=`${i} { ${o.join("; ")}; }`}}))})),n===lC&&r&&(a+=`${n} { --wp--style--block-gap: ${s}; }`)),n===lC&&e){const t=["block","flex","grid"];Object.values(e).forEach((({className:e,displayMode:r,baseStyles:o})=>{r&&t.includes(r)&&(a+=`${n} .${e} { display:${r}; }`),o?.length&&o.forEach((t=>{const r=[];t.rules&&Object.entries(t.rules).forEach((([e,t])=>{r.push(`${e}: ${t}`)})),r.length&&(a+=`${n} .${e}${t?.selector||""} { ${r.join("; ")}; }`)}))}))}return a}const $0=["border","color","dimensions","spacing","typography","filter","outline","shadow"];function W0(e){if(!e)return{};const t=Object.entries(e).filter((([e])=>$0.includes(e))).map((([e,t])=>[e,JSON.parse(JSON.stringify(t))]));return Object.fromEntries(t)}const G0=(e,t)=>{var n;const r=[];if(!e?.settings)return r;const o=e=>{let t={};return cC.forEach((({path:n})=>{const r=$E(e,n,!1);!1!==r&&(t=UE(t,n,r))})),t},i=o(e.settings),a=e.settings?.custom;return(Object.keys(i).length>0||a)&&r.push({presets:i,custom:a,selector:lC}),Object.entries(null!==(n=e.settings?.blocks)&&void 0!==n?n:{}).forEach((([e,n])=>{const i=o(n),a=n.custom;(Object.keys(i).length>0||a)&&r.push({presets:i,custom:a,selector:t[e]?.selector})})),r},q0=(e,t)=>{const n=G0(e,t);let r="";return n.forEach((({presets:t,custom:n,selector:o})=>{const i=function(e={},t){return cC.reduce(((n,{path:r,valueKey:o,valueFunc:i,cssVarInfix:a})=>{const s=$E(e,r,[]);return["default","theme","custom"].forEach((e=>{s[e]&&s[e].forEach((e=>{o&&!i?n.push(`--wp--preset--${a}--${VE(e.slug)}: ${e[o]}`):i&&"function"==typeof i&&n.push(`--wp--preset--${a}--${VE(e.slug)}: ${i(e,t)}`)}))})),n}),[])}(t,e?.settings),a=z0(n,"--wp--custom--","--");a.length>0&&i.push(...a),i.length>0&&(r+=`${o}{${i.join(";")};}`)})),r},K0=(e,t,n,r,o=!1,i=!0)=>{const a=((e,t)=>{var n;const r=[];if(!e?.styles)return r;const o=W0(e.styles);return o&&r.push({styles:o,selector:lC}),Object.entries(Gl).forEach((([t,n])=>{e.styles?.elements?.[t]&&r.push({styles:e.styles?.elements?.[t],selector:n})})),Object.entries(null!==(n=e.styles?.blocks)&&void 0!==n?n:{}).forEach((([e,n])=>{var o;const i=W0(n);if(n?.variations){const e={};Object.keys(n.variations).forEach((t=>{e[t]=W0(n.variations[t])})),i.variations=e}i&&t?.[e]?.selector&&r.push({duotoneSelector:t[e].duotoneSelector,fallbackGapValue:t[e].fallbackGapValue,hasLayoutSupport:t[e].hasLayoutSupport,selector:t[e].selector,styles:i,featureSelectors:t[e].featureSelectors,styleVariationSelectors:t[e].styleVariationSelectors}),Object.entries(null!==(o=n?.elements)&&void 0!==o?o:{}).forEach((([n,o])=>{o&&t?.[e]&&Gl[n]&&r.push({styles:o,selector:t[e]?.selector.split(",").map((e=>Gl[n].split(",").map((t=>e+" "+t)))).join(",")})}))})),r})(e,t),s=G0(e,t),l=e?.settings?.useRootPaddingAwareAlignments,{contentSize:c,wideSize:u}=e?.settings?.layout||{};let d="body {margin: 0;";if(c&&(d+=` --wp--style--global--content-size: ${c};`),u&&(d+=` --wp--style--global--wide-size: ${u};`),l&&i&&(d+="padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) }\n\t\t\t.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t.has-global-padding :where(.has-global-padding:not(.wp-block-block)) { padding-right: 0; padding-left: 0; }\n\t\t\t.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); }\n\t\t\t.has-global-padding :where(.has-global-padding:not(.wp-block-block)) > .alignfull { margin-right: 0; margin-left: 0; }\n\t\t\t.has-global-padding > .alignfull:where(:not(.has-global-padding):not(.is-layout-flex):not(.is-layout-grid)) > :where(.wp-block:not(.alignfull),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t.has-global-padding :where(.has-global-padding) > .alignfull:where(:not(.has-global-padding)) > :where(.wp-block:not(.alignfull),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: 0; padding-left: 0;"),d+="}",a.forEach((({selector:t,duotoneSelector:a,styles:s,fallbackGapValue:c,hasLayoutSupport:u,featureSelectors:p,styleVariationSelectors:h})=>{if(p){const e=V0(p,s);Object.entries(e).forEach((([e,t])=>{if(t.length){const n=t.join(";");d+=`${e}{${n};}`}}))}if(h&&Object.entries(h).forEach((([t,n])=>{const r=s?.variations?.[t];if(r){if(p){const e=V0(p,r);Object.entries(e).forEach((([e,t])=>{if(t.length){const r=function(e,t){const n=e.split(","),r=[];return n.forEach((e=>{r.push(`${t.trim()}${e.trim()}`)})),r.join(", ")}(e,n),o=t.join(";");d+=`${r}{${o};}`}}))}const t=H0(r,n,l,e);t.length&&(d+=`${n}{${t.join(";")};}`)}})),a){const e={};s?.filter&&(e.filter=s.filter,delete s.filter);const t=H0(e);t.length&&(d+=`${a}{${t.join(";")};}`)}o||lC!==t&&!u||(d+=U0({style:s,selector:t,hasBlockGapSupport:n,hasFallbackGapSupport:r,fallbackGapValue:c}));const m=H0(s,t,l,e,i);m?.length&&(d+=`${t}{${m.join(";")};}`);const f=Object.entries(s).filter((([e])=>e.startsWith(":")));f?.length&&f.forEach((([e,n])=>{const r=H0(n);if(!r?.length)return;const o=`${t.split(",").map((t=>t+e)).join(",")}{${r.join(";")};}`;d+=o}))})),d+=".wp-site-blocks > .alignleft { float: left; margin-right: 2em; }",d+=".wp-site-blocks > .alignright { float: right; margin-left: 2em; }",d+=".wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }",n){const t=TE(e?.styles?.spacing?.blockGap)||"0.5em";d+=`:where(.wp-site-blocks) > * { margin-block-start: ${t}; margin-block-end: 0; }`,d+=":where(.wp-site-blocks) > :first-child:first-child { margin-block-start: 0; }",d+=":where(.wp-site-blocks) > :last-child:last-child { margin-block-end: 0; }"}return s.forEach((({selector:e,presets:t})=>{lC===e&&(e="");const n=function(e="*",t={}){return cC.reduce(((n,{path:r,cssVarInfix:o,classes:i})=>{if(!i)return n;const a=$E(t,r,[]);return["default","theme","custom"].forEach((t=>{a[t]&&a[t].forEach((({slug:t})=>{i.forEach((({classSuffix:r,propertyName:i})=>{const a=`.has-${VE(t)}-${r}`,s=e.split(",").map((e=>`${e}${a}`)).join(","),l=`var(--wp--preset--${o}--${VE(t)})`;n+=`${s}{${i}: ${l} !important;}`}))}))})),n}),"")}(e,t);n.length>0&&(d+=n)})),d};const Y0=(e,t)=>{const n={};return e.forEach((e=>{const r=e.name,o=lq(e);let i=lq(e,"filter.duotone");if(!i){const t=lq(e),n=cc(e,"color.__experimentalDuotone",!1);i=n&&hC(t,n)}const a=!!e?.supports?.layout||!!e?.supports?.__experimentalLayout,s=e?.supports?.spacing?.blockGap?.__experimentalDefault,l=t(r),c={};l?.length&&l.forEach((e=>{const t=`.is-style-${e.name}${o}`;c[e.name]=t}));const u=((e,t)=>{if(e?.selectors&&Object.keys(e.selectors).length>0)return e.selectors;const n={root:t};return Object.entries(j0).forEach((([t,r])=>{const o=lq(e,t);o&&(n[r]=o)})),n})(e,o);n[r]={duotoneSelector:i,fallbackGapValue:s,featureSelectors:Object.keys(u).length?u:void 0,hasLayoutSupport:a,name:r,selector:o,styleVariationSelectors:Object.keys(c).length?c:void 0}})),n};function X0(e,t){let n="";return e.split("&").forEach((e=>{if(e.includes("{")){const r=e.replace("}","").split("{");if(2!==r.length)return;const[o,i]=r,a=o.startsWith(" ")?hC(t,o):function(e,t){return e.includes(",")?e.split(",").map((e=>e+t)).join(","):e+t}(t,o);n+=`${a}{${i.trim()}}`}else n+=`${t}{${e.trim()}}`})),n}function J0(e={}){const[t]=yC("spacing.blockGap"),n=null!==t,r=!n,o=(0,yl.Z)((e=>{const{getSettings:t}=e(e_);return!!t().disableLayoutStyles})),i=(0,x.useContext)(mT),a=void 0!==i?.templateSlug,s=(0,yl.Z)((e=>e(Vu).getBlockStyles),[]);return(0,x.useMemo)((()=>{var t,i;if(!e?.styles||!e?.settings)return[];i=e,e=i.styles?.blocks?.["core/separator"]&&i.styles?.blocks?.["core/separator"].color?.background&&!i.styles?.blocks?.["core/separator"].color?.text&&!i.styles?.blocks?.["core/separator"].border?.color?{...i,styles:{...i.styles,blocks:{...i.styles.blocks,"core/separator":{...i.styles.blocks["core/separator"],color:{...i.styles.blocks["core/separator"].color,text:i.styles?.blocks["core/separator"].color.background}}}}}:i;const l=Y0(lc(),s),c=q0(e,l),u=K0(e,l,n,r,o,a),d=function(e,t){return G0(e,t).flatMap((({presets:e})=>function(e={}){return cC.filter((e=>"duotone"===e.path.at(-1))).flatMap((t=>{const n=$E(e,t.path,{});return["default","theme"].filter((e=>n[e])).flatMap((e=>n[e].map((e=>sq(`wp-duotone-${e.slug}`,e.colors))))).join("")}))}(e)))}(e,l),p=[{css:c,isGlobalStyles:!0},{css:u,isGlobalStyles:!0},{css:null!==(t=e.styles.css)&&void 0!==t?t:"",isGlobalStyles:!0},{assets:d,__unstableType:"svg",isGlobalStyles:!0}];return lc().forEach((t=>{if(e.styles.blocks[t.name]?.css){const n=l[t.name].selector;p.push({css:X0(e.styles.blocks[t.name]?.css,n),isGlobalStyles:!0})}})),[p,e.settings]}),[n,r,e,o])}function Q0(){const{merged:e}=(0,x.useContext)(fC);return J0(e)}var e1=n(97771);function t1(e){return n1(e)}function n1(e){return!!e?.shadow}function r1({resetAllFilter:e,onChange:t,value:n,panelId:r,children:o}){return(0,x.createElement)(VI,{label:(0,$.__)("Effects"),resetAll:()=>{const r=e(n);t(r)},panelId:r},o)}const o1={shadow:!0};function i1({as:e=r1,value:t,onChange:n,inheritedValue:r=t,settings:o,panelId:i,defaultControls:a=o1}){const s=n1(o),l=(c=r?.shadow,pC({settings:o},"",c));var c;const u=e=>{n(UE(t,["shadow"],e))},d=(0,x.useCallback)((e=>({...e,shadow:void 0})),[]);return(0,x.createElement)(e,{resetAllFilter:d,value:t,onChange:n,panelId:i},s&&(0,x.createElement)(_F,{label:(0,$.__)("Shadow"),hasValue:()=>!!t?.shadow,onDeselect:()=>u(void 0),isShownByDefault:a.shadow,panelId:i},(0,x.createElement)(TM,{isBordered:!0,isSeparated:!0},(0,x.createElement)(a1,{shadow:l,onShadowChange:u,settings:o}))))}const a1=({shadow:e,onShadowChange:t,settings:n})=>(0,x.createElement)(pB.Z,{popoverProps:{placement:"left-start",offset:36,shift:!0},className:"block-editor-global-styles-effects-panel__shadow-dropdown",renderToggle:({onToggle:e,isOpen:t})=>{const n={onClick:e,className:R()({"is-open":t}),"aria-expanded":t};return(0,x.createElement)(Gh.ZP,{...n},(0,x.createElement)(wI.Z,{justify:"flex-start"},(0,x.createElement)(ox.Z,{className:"block-editor-global-styles-effects-panel__toggle-icon",icon:e1.Z,size:24}),(0,x.createElement)(tw.Z,null,(0,$.__)("Shadow"))))},renderContent:()=>(0,x.createElement)(gV,{paddingSize:"medium"},(0,x.createElement)(s1,{shadow:e,onShadowChange:t,settings:n}))});function s1({shadow:e,onShadowChange:t,settings:n}){const r=n?.shadow?.presets?.default,o=n?.shadow?.presets?.theme,i=n?.shadow?.defaultPresets,a=[...i?r:[],...o||[]];return(0,x.createElement)("div",{className:"block-editor-global-styles-effects-panel__shadow-popover-container"},(0,x.createElement)(dM.Z,{spacing:4},(0,x.createElement)(EI.Z,{level:5},(0,$.__)("Shadow")),(0,x.createElement)(l1,{presets:a,activeShadow:e,onSelect:t})))}function l1({presets:e,activeShadow:t,onSelect:n}){return e?(0,x.createElement)(ZI,{columns:6,gap:0,align:"center",justify:"center"},e.map((({name:e,slug:r,shadow:o})=>(0,x.createElement)(c1,{key:r,label:e,isActive:o===t,onSelect:()=>n(o===t?void 0:o),shadow:o})))):null}function c1({label:e,isActive:t,onSelect:n,shadow:r}){return(0,x.createElement)("div",{className:"block-editor-global-styles-effects-panel__shadow-indicator-wrapper"},(0,x.createElement)(Gh.ZP,{className:"block-editor-global-styles-effects-panel__shadow-indicator",onClick:n,label:e,style:{boxShadow:r},showTooltip:!0},t&&(0,x.createElement)(ox.Z,{icon:aG.Z})))}function u1(e,t,n){return"core/image"===e&&n?.lightbox?.allowEditing||!!t?.lightbox}function d1({onChange:e,value:t,inheritedValue:n,panelId:r}){const o=()=>{e(void 0)};let i=!1;return n?.lightbox?.enabled&&(i=n.lightbox.enabled),(0,x.createElement)(x.Fragment,null,(0,x.createElement)(VI,{label:(0,$._x)("Settings","Image settings"),resetAll:o,panelId:r},(0,x.createElement)(_F,{hasValue:()=>!!t?.lightbox,label:(0,$.__)("Expand on click"),onDeselect:o,isShownByDefault:!0,panelId:r},(0,x.createElement)(aE.Z,{label:(0,$.__)("Expand on click"),checked:i,onChange:t=>{e({enabled:t})}}))))}var p1=n(94654);function h1({value:e,onChange:t,inheritedValue:n=e}){const[r,o]=(0,x.useState)(null),i=n?.css;return(0,x.createElement)(dM.Z,{spacing:3},(0,x.createElement)(p1.Z,{label:(0,$.__)("Additional CSS"),__nextHasNoMarginBottom:!0,value:i,onChange:n=>function(n){if(t({...e,css:n}),r){const[t]=RL([{css:e}],".editor-styles-wrapper");t&&o(null)}}(n),onBlur:function(e){if(!e?.target?.value)return void o(null);const[t]=RL([{css:e.target.value}],".editor-styles-wrapper");o(null===t?(0,$.__)("There is an error with your CSS structure."):null)},className:"block-editor-global-styles-advanced-panel__custom-css-input",spellCheck:!1}),r&&(0,x.createElement)(Xw.Z,{text:r},(0,x.createElement)("div",{className:"block-editor-global-styles-advanced-panel__custom-css-validation-wrapper"},(0,x.createElement)(ox.Z,{icon:Rj.Z,className:"block-editor-global-styles-advanced-panel__custom-css-validation-icon"}))))}function m1(e,t,n){if(null==e||!1===e)return;if(Array.isArray(e))return f1(e,t,n);switch(typeof e){case"string":case"number":return}const{type:r,props:o}=e;switch(r){case x.StrictMode:case x.Fragment:return f1(o.children,t,n);case nd:return;case aF.Content:return g1(t,n);case MX:return void t.push(o.value)}switch(typeof r){case"string":return void 0!==o.children?f1(o.children,t,n):void 0;case"function":return m1(r.prototype&&"function"==typeof r.prototype.render?new r(o).render():r(o),t,n)}}function f1(e,...t){e=Array.isArray(e)?e:[e];for(let n=0;n<e.length;n++)m1(e[n],...t)}function g1(e,t){for(let n=0;n<t.length;n++){const{name:r,attributes:o,innerBlocks:i}=t[n];m1(Ad(r,o,(0,x.createElement)(aF.Content,null)),e,i)}}var b1=n(56217);const v1=()=>{},y1="bottom",_1="corner";const k1=(0,g_.default)("div",{target:"e1wq7y4k3"})({name:"1cd7zoc",styles:"bottom:0;box-sizing:border-box;left:0;pointer-events:none;position:absolute;right:0;top:0"}),w1=(0,g_.default)("div",{target:"e1wq7y4k2"})({name:"ajymcs",styles:"align-items:center;box-sizing:border-box;display:inline-flex;justify-content:center;opacity:0;pointer-events:none;transition:opacity 120ms linear"}),E1=(0,g_.default)("div",{target:"e1wq7y4k1"})("background:",N_.D.gray[900],";border-radius:2px;box-sizing:border-box;font-family:",(0,U_.L)("default.fontFamily"),";font-size:12px;color:",N_.D.ui.textDark,";padding:4px 8px;position:relative;"),C1=(0,g_.default)(hM.Z,{target:"e1wq7y4k0"})("&&&{color:",N_.D.ui.textDark,";display:block;font-size:13px;line-height:1.4;white-space:nowrap;}"),x1=(0,x.forwardRef)((function({label:e,position:t=_1,zIndex:n=1e3,...r},o){const i=!!e,a=t===_1;if(!i)return null;let s={opacity:i?1:void 0,zIndex:n},l={};return t===y1&&(s={...s,position:"absolute",bottom:-10,left:"50%",transform:"translate(-50%, 0)"},l={transform:"translate(0, 100%)"}),a&&(s={...s,position:"absolute",top:4,right:(0,d_.isRTL)()?void 0:4,left:(0,d_.isRTL)()?4:void 0}),(0,x.createElement)(w1,{"aria-hidden":"true",className:"components-resizable-tooltip__tooltip-wrapper",ref:o,style:s,...r},(0,x.createElement)(E1,{className:"components-resizable-tooltip__tooltip",style:l},(0,x.createElement)(C1,{as:"span"},e)))}));var S1=x1;const I1=()=>{},T1=(0,x.forwardRef)((function({axis:e,className:t,fadeTimeout:n=180,isVisible:r=!0,labelRef:o,onResize:i=I1,position:a=y1,showPx:s=!0,zIndex:l=1e3,...c},u){const{label:d,resizeListener:p}=function({axis:e,fadeTimeout:t=180,onResize:n=v1,position:r=y1,showPx:o=!1}){const[i,a]=(0,UK.Z)(),s=!!e,[l,c]=(0,x.useState)(!1),[u,d]=(0,x.useState)(!1),{width:p,height:h}=a,m=(0,x.useRef)(h),f=(0,x.useRef)(p),g=(0,x.useRef)(),b=(0,x.useCallback)((()=>{g.current&&window.clearTimeout(g.current),g.current=window.setTimeout((()=>{s||(c(!1),d(!1))}),t)}),[t,s]);(0,x.useEffect)((()=>{if(null===p&&null===h)return;const e=p!==f.current,t=h!==m.current;if(e||t){if(p&&!f.current&&h&&!m.current)return f.current=p,void(m.current=h);e&&(c(!0),f.current=p),t&&(d(!0),m.current=h),n({width:p,height:h}),b()}}),[p,h,n,b]);const v=function({axis:e,height:t,moveX:n=!1,moveY:r=!1,position:o=y1,showPx:i=!1,width:a}){if(!n&&!r)return;if(o===_1)return`${a} x ${t}`;const s=i?" px":"";if(e){if("x"===e&&n)return`${a}${s}`;if("y"===e&&r)return`${t}${s}`}return n&&r?`${a} x ${t}`:n?`${a}${s}`:r?`${t}${s}`:void 0}({axis:e,height:h,moveX:l,moveY:u,position:r,showPx:o,width:p});return{label:v,resizeListener:i}}({axis:e,fadeTimeout:n,onResize:i,showPx:s,position:a});if(!r)return null;const h=R()("components-resize-tooltip",t);return(0,x.createElement)(k1,{"aria-hidden":"true",className:h,ref:u,...c},p,(0,x.createElement)(S1,{"aria-hidden":c["aria-hidden"],label:d,position:a,ref:o,zIndex:l}))}));var N1=T1;const P1="components-resizable-box__handle",R1="components-resizable-box__side-handle",A1="components-resizable-box__corner-handle",B1={top:R()(P1,R1,"components-resizable-box__handle-top"),right:R()(P1,R1,"components-resizable-box__handle-right"),bottom:R()(P1,R1,"components-resizable-box__handle-bottom"),left:R()(P1,R1,"components-resizable-box__handle-left"),topLeft:R()(P1,A1,"components-resizable-box__handle-top","components-resizable-box__handle-left"),topRight:R()(P1,A1,"components-resizable-box__handle-top","components-resizable-box__handle-right"),bottomRight:R()(P1,A1,"components-resizable-box__handle-bottom","components-resizable-box__handle-right"),bottomLeft:R()(P1,A1,"components-resizable-box__handle-bottom","components-resizable-box__handle-left")},L1={width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0},M1={top:L1,right:L1,bottom:L1,left:L1,topLeft:L1,topRight:L1,bottomRight:L1,bottomLeft:L1},D1=(0,x.forwardRef)((function({className:e,children:t,showHandle:n=!0,__experimentalShowTooltip:r=!1,__experimentalTooltipProps:o={},...i},a){return(0,x.createElement)(b1.Resizable,{className:R()("components-resizable-box__container",n&&"has-show-handle",e),handleClasses:B1,handleStyles:M1,ref:a,...i},t,r&&(0,x.createElement)(N1,{...o}))}));var O1=D1;var F1=n(87916);const j1=(0,x.createContext)(void 0),Z1=j1.Provider;function z1({children:e}){const[t,n]=(0,x.useState)(),r=(0,x.useMemo)((()=>({lastFocusedElement:t,setLastFocusedElement:n})),[t]);return(0,x.createElement)(Z1,{value:r},e)}function V1(e){return yD.focus.focusable.find(e,{sequential:!0}).filter((t=>t.closest('[role="row"]')===e))}const H1=(0,x.forwardRef)((function({children:e,onExpandRow:t=(()=>{}),onCollapseRow:n=(()=>{}),onFocusRow:r=(()=>{}),applicationAriaLabel:o,...i},a){const s=(0,x.useCallback)((e=>{const{keyCode:o,metaKey:i,ctrlKey:a,altKey:s}=e;if(i||a||s||![F1.UP,F1.DOWN,F1.LEFT,F1.RIGHT,F1.HOME,F1.END].includes(o))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=V1(u),p=d.indexOf(l),h=0===p,m=h&&("false"===u.getAttribute("data-expanded")||"false"===u.getAttribute("aria-expanded"))&&o===F1.RIGHT;if([F1.LEFT,F1.RIGHT].includes(o)){let r;if(r=o===F1.LEFT?Math.max(0,p-1):Math.min(p+1,d.length-1),h){if(o===F1.LEFT){var f;if("true"===u.getAttribute("data-expanded")||"true"===u.getAttribute("aria-expanded"))return n(u),void e.preventDefault();const t=Math.max(parseInt(null!==(f=u?.getAttribute("aria-level"))&&void 0!==f?f:"1",10)-1,1),r=Array.from(c.querySelectorAll('[role="row"]'));let o=u;for(let e=r.indexOf(u);e>=0;e--){const n=r[e].getAttribute("aria-level");if(null!==n&&parseInt(n,10)===t){o=r[e];break}}V1(o)?.[0]?.focus()}if(o===F1.RIGHT){if("false"===u.getAttribute("data-expanded")||"false"===u.getAttribute("aria-expanded"))return t(u),void e.preventDefault();const n=V1(u);n.length>0&&n[r]?.focus()}return void e.preventDefault()}if(m)return;d[r].focus(),e.preventDefault()}else if([F1.UP,F1.DOWN].includes(o)){const t=Array.from(c.querySelectorAll('[role="row"]')),n=t.indexOf(u);let i;if(i=o===F1.UP?Math.max(0,n-1):Math.min(n+1,t.length-1),i===n)return void e.preventDefault();const a=V1(t[i]);if(!a||!a.length)return void e.preventDefault();a[Math.min(p,a.length-1)].focus(),r(e,u,t[i]),e.preventDefault()}else if([F1.HOME,F1.END].includes(o)){const t=Array.from(c.querySelectorAll('[role="row"]')),n=t.indexOf(u);let i;if(i=o===F1.HOME?0:t.length-1,i===n)return void e.preventDefault();const a=V1(t[i]);if(!a||!a.length)return void e.preventDefault();a[Math.min(p,a.length-1)].focus(),r(e,u,t[i]),e.preventDefault()}}),[t,n,r]);return(0,x.createElement)(z1,null,(0,x.createElement)("div",{role:"application","aria-label":o},(0,x.createElement)("table",{...i,role:"treegrid",onKeyDown:s,ref:a},(0,x.createElement)("tbody",null,e))))}));var U1=H1;const $1=(0,x.forwardRef)((function({children:e,level:t,positionInSet:n,setSize:r,isExpanded:o,...i},a){return(0,x.createElement)("tr",{...i,ref:a,role:"row","aria-level":t,"aria-posinset":n,"aria-setsize":r,"aria-expanded":o},e)}));var W1=$1;const G1=(0,x.forwardRef)((function({children:e,as:t,...n},r){const o=(0,x.useRef)(),i=r||o,{lastFocusedElement:a,setLastFocusedElement:s}=(0,x.useContext)(j1);let l;a&&(l=a===("current"in i?i.current:void 0)?0:-1);const c={ref:i,tabIndex:l,onFocus:e=>s?.(e.target),...n};return"function"==typeof e?e(c):t?(0,x.createElement)(t,{...c},e):null}));var q1=G1;const K1=(0,x.forwardRef)((function({children:e,...t},n){return(0,x.createElement)(q1,{ref:n,...t},e)}));var Y1=K1;const X1=(0,x.forwardRef)((function({children:e,withoutGridItem:t=!1,...n},r){return(0,x.createElement)("td",{...n,role:"gridcell"},t?(0,x.createElement)(x.Fragment,null,e):(0,x.createElement)(Y1,{ref:r},e))}));var J1=X1;const Q1=(0,x.createContext)({}),e2=()=>(0,x.useContext)(Q1);function t2({children:e,...t}){const n=(0,x.useRef)();return(0,x.useEffect)((()=>{n.current&&(n.current.textContent=n.current.textContent)}),[e]),(0,x.createElement)("div",{hidden:!0,...t,ref:n},e)}const n2=(0,x.forwardRef)((({nestingLevel:e,blockCount:t,clientId:n,...r},o)=>{const{insertedBlock:i,setInsertedBlock:a}=e2(),s=(0,tT.Z)(n2),l=(0,yl.Z)((e=>{const{getTemplateLock:t,__unstableGetEditorMode:r}=e(e_);return!!t(n)||"zoom-out"===r()}),[n]),c=tQ({clientId:n,context:"list-view"}),u=tQ({clientId:i?.clientId,context:"list-view"});if((0,x.useEffect)((()=>{u?.length&&(0,wf.D)((0,$.sprintf)((0,$.__)("%s block inserted"),u),"assertive")}),[u]),l)return null;const d=`list-view-appender__${s}`,p=(0,$.sprintf)((0,$.__)("Append to %1$s block at position %2$d, Level %3$d"),c,t+1,e);return(0,x.createElement)("div",{className:"list-view-appender"},(0,x.createElement)(xO,{ref:o,rootClientId:n,position:"bottom right",isAppender:!0,selectBlockOnInsert:!1,shouldDirectInsert:!1,__experimentalIsQuick:!0,...r,toggleProps:{"aria-describedby":d},onSelectOrClose:e=>{e?.clientId&&a(e)}}),(0,x.createElement)(t2,{id:d},p))})),r2=cA(W1),o2=(0,x.forwardRef)((({isSelected:e,position:t,level:n,rowCount:r,children:o,className:i,path:a,...s},l)=>{const c=gA({isSelected:e,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:a}),u=(0,Sf.Z)([l,c]);return(0,x.createElement)(r2,{ref:u,className:R()("block-editor-list-view-leaf",i),level:n,positionInSet:t,setSize:r,isExpanded:void 0,...s},o)}));var i2=o2,a2=n(87748),s2=n(23331);function l2({onClick:e}){return(0,x.createElement)("span",{className:"block-editor-list-view__expander",onClick:t=>e(t,{forceToggle:!0}),"aria-hidden":"true","data-testid":"list-view-expander"},(0,x.createElement)(ox.Z,{icon:(0,$.isRTL)()?DF.Z:OF.Z}))}function c2(e){if("core/image"===e.name)return e.attributes?.url?{url:e.attributes.url,alt:e.attributes.alt,clientId:e.clientId}:void 0}var u2=(0,x.forwardRef)((function({className:e,block:{clientId:t},onClick:n,onToggleExpanded:r,tabIndex:o,onFocus:i,onDragStart:a,onDragEnd:s,draggable:l,isExpanded:c,ariaLabel:u,ariaDescribedBy:d,updateFocusAndSelection:p},h){const m=Sq(t),f=tQ({clientId:t,context:"list-view"}),{isLocked:g}=Xq(t),{canInsertBlockType:b,getSelectedBlockClientIds:v,getPreviousBlockClientId:y,getBlockRootClientId:_,getBlockOrder:k,getBlocksByClientId:w,canRemoveBlocks:E}=(0,yl.Z)(e_),{duplicateBlocks:C,removeBlocks:S}=(0,_l.Z)(e_),I=(0,RB.sx)(),T="sticky"===m?.positionType,N=function({clientId:e,isExpanded:t}){const{block:n}=(0,yl.Z)((t=>({block:t(e_).getBlock(e)})),[e]);return(0,x.useMemo)((()=>function(e,t){const n=c2(e);return n?[n]:t?[]:function(e){if("core/gallery"!==e.name||!e.innerBlocks)return[];const t=[];for(const n of e.innerBlocks){const e=c2(n);if(e&&t.push(e),t.length>=3)return t}return t}(e)}(n,t)),[n,t])}({clientId:t,isExpanded:c}),P=m?.positionLabel?(0,$.sprintf)((0,$.__)("Position: %1$s"),m.positionLabel):"";function A(){const e=v(),n=e.includes(t),r=n?e[0]:t,o=_(r);return{blocksToUpdate:n?e:[t],firstBlockClientId:r,firstBlockRootClientId:o,selectedBlockClientIds:e}}return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(Gh.ZP,{className:R()("block-editor-list-view-block-select-button",e),onClick:n,onKeyDown:async function(e){if(e.keyCode===Hf.K5||e.keyCode===Hf.L_)n(e);else if(e.keyCode===Hf.ZH||e.keyCode===Hf.yY||I("core/block-editor/remove",e)){var t;const{blocksToUpdate:e,firstBlockClientId:n,firstBlockRootClientId:r,selectedBlockClientIds:o}=A();if(!E(e,r))return;let i=null!==(t=y(n))&&void 0!==t?t:r;S(e,!1);const a=o.length>0&&0===v().length;i||(i=k()[0]),p(i,a)}else if(I("core/block-editor/duplicate",e)){if(e.defaultPrevented)return;e.preventDefault();const{blocksToUpdate:t,firstBlockRootClientId:n}=A(),r=w(t).every((e=>!!e&&uc(e.name,"multiple",!0)&&b(e.name,n)));if(r){const e=await C(t,!1);e?.length&&p(e[0],!1)}}},ref:h,tabIndex:o,onFocus:i,onDragStart:e=>{e.dataTransfer.clearData(),a?.(e)},onDragEnd:s,draggable:l,href:`#block-${t}`,"aria-label":u,"aria-describedby":d,"aria-expanded":c},(0,x.createElement)(l2,{onClick:r}),(0,x.createElement)(EB,{icon:m?.icon,showColors:!0,context:"list-view"}),(0,x.createElement)(wI.Z,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1},(0,x.createElement)("span",{className:"block-editor-list-view-block-select-button__title"},(0,x.createElement)(HL,{ellipsizeMode:"auto"},f)),m?.anchor&&(0,x.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper"},(0,x.createElement)(HL,{className:"block-editor-list-view-block-select-button__anchor",ellipsizeMode:"auto"},m.anchor)),P&&T&&(0,x.createElement)(Xw.Z,{text:P},(0,x.createElement)(ox.Z,{icon:a2.Z})),N.length?(0,x.createElement)("span",{className:"block-editor-list-view-block-select-button__images","aria-hidden":!0},N.map(((e,t)=>(0,x.createElement)("span",{className:"block-editor-list-view-block-select-button__image",key:e.clientId,style:{backgroundImage:`url(${e.url})`,zIndex:N.length-t}})))):null,g&&(0,x.createElement)("span",{className:"block-editor-list-view-block-select-button__lock"},(0,x.createElement)(ox.Z,{icon:s2.Z})))))}));const d2=(0,x.forwardRef)((({onClick:e,onToggleExpanded:t,block:n,isSelected:r,position:o,siblingBlockCount:i,level:a,isExpanded:s,selectedClientIds:l,...c},u)=>{const{clientId:d}=n,{blockMovingClientId:p,selectedBlockInBlockEditor:h}=(0,yl.Z)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(e_);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[]),{AdditionalBlockContent:m,insertedBlock:f,setInsertedBlock:g}=e2(),b=p&&h===d,v=R()("block-editor-list-view-block-contents",{"is-dropping-before":b}),y=l.includes(d)?l:[d];return(0,x.createElement)(x.Fragment,null,m&&(0,x.createElement)(m,{block:n,insertedBlock:f,setInsertedBlock:g}),(0,x.createElement)(rQ,{clientIds:y},(({draggable:l,onDragStart:d,onDragEnd:p})=>(0,x.createElement)(u2,{ref:u,className:v,block:n,onClick:e,onToggleExpanded:t,isSelected:r,position:o,siblingBlockCount:i,level:a,draggable:l,onDragStart:d,onDragEnd:p,isExpanded:s,...c}))))}));var p2=d2;function h2(e,t){const n=()=>{const n=t.current?.querySelector(`[role=row][data-block="${e}"]`);return n?TA.focusable.find(n)[0]:null};let r=n();r?r.focus():window.requestAnimationFrame((()=>{r=n(),r&&r.focus()}))}var m2=(0,x.memo)((function e({block:{clientId:t},isDragged:n,isSelected:r,isBranchSelected:o,selectBlock:i,position:a,level:s,rowCount:l,siblingBlockCount:c,showBlockMovers:u,path:d,isExpanded:p,selectedClientIds:h,isSyncedBranch:m}){const f=(0,x.useRef)(null),g=(0,x.useRef)(null),[b,v]=(0,x.useState)(!1),{isLocked:y,canEdit:_}=Xq(t),k=r&&h[0]===t,w=r&&h[h.length-1]===t,{toggleBlockHighlight:E}=(0,_l.Z)(e_),C=Sq(t),S=C?.name||C?.title||(0,$.__)("Untitled"),I=(0,yl.Z)((e=>e(e_).getBlock(t)),[t]),T=(0,yl.Z)((e=>e(e_).getBlockName(t)),[t]),N=(0,yl.Z)((e=>e(e_).getBlockEditingMode(t)),[t]),P=uc(T,"__experimentalToolbar",!0)&&"default"===N,A=`list-view-block-select-button__${(0,tT.Z)(e)}`,B=((e,t,n)=>(0,$.sprintf)((0,$.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(a,c,s),L=y?(0,$.sprintf)((0,$.__)("%s (locked)"),S):S,M=(0,$.sprintf)((0,$.__)("Options for %s"),S),{expand:D,collapse:O,BlockSettingsMenu:F,listViewInstanceId:j,expandedState:Z,setInsertedBlock:z,treeGridElementRef:V}=e2(),H=u&&c>0,U=R()("block-editor-list-view-block__mover-cell",{"is-visible":b||r}),W=R()("block-editor-list-view-block__menu-cell",{"is-visible":b||k}),G=(0,x.useCallback)((()=>{v(!0),E(t,!0)}),[t,v,E]),q=(0,x.useCallback)((()=>{v(!1),E(t,!1)}),[t,v,E]),K=(0,x.useCallback)((e=>{i(e,t),e.preventDefault()}),[t,i]),Y=(0,x.useCallback)(((e,t)=>{t&&i(void 0,e,null,null),h2(e,V)}),[i,V]),X=(0,x.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===p?O(t):!1===p&&D(t)}),[t,D,O,p]);let J;H?J=2:P||(J=3);const Q=R()({"is-selected":r,"is-first-selected":k,"is-last-selected":w,"is-branch-selected":o,"is-synced-branch":m,"is-dragging":n,"has-single-cell":!P,"is-synced":C?.isSynced}),ee=h.includes(t)?h:[t];!function({isSelected:e,selectedClientIds:t,rowItemRef:n}){const r=1===t.length;(0,x.useLayoutEffect)((()=>{if(!e||!r||!n.current)return;const t=hA(n.current),{ownerDocument:o}=n.current;if(t===o.body||t===o.documentElement||!t)return;const i=n.current.getBoundingClientRect(),a=t.getBoundingClientRect();(i.top<a.top||i.bottom>a.bottom)&&n.current.scrollIntoView()}),[e,r,n])}({isSelected:r,rowItemRef:g,selectedClientIds:h});const te=r&&1===h.length;return(0,x.createElement)(i2,{className:Q,onKeyDown:e=>{e.keyCode===Hf.hY&&!e.defaultPrevented&&h.length>0&&(e.stopPropagation(),e.preventDefault(),i(e,void 0))},onMouseEnter:G,onMouseLeave:q,onFocus:G,onBlur:q,level:s,position:a,rowCount:l,path:d,id:`list-view-${j}-block-${t}`,"data-block":t,"data-expanded":_?p:void 0,ref:g},(0,x.createElement)(J1,{className:"block-editor-list-view-block__contents-cell",colSpan:J,ref:f,"aria-selected":!!r},(({ref:e,tabIndex:t,onFocus:n})=>(0,x.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,x.createElement)(p2,{block:I,onClick:K,onToggleExpanded:X,isSelected:r,position:a,siblingBlockCount:c,level:s,ref:e,tabIndex:te?0:t,onFocus:n,isExpanded:_?p:void 0,selectedClientIds:h,ariaLabel:L,ariaDescribedBy:A,updateFocusAndSelection:Y}),(0,x.createElement)(t2,{id:A},B)))),H&&(0,x.createElement)(x.Fragment,null,(0,x.createElement)(J1,{className:U,withoutGridItem:!0},(0,x.createElement)(Y1,null,(({ref:e,tabIndex:n,onFocus:r})=>(0,x.createElement)(cQ,{orientation:"vertical",clientIds:[t],ref:e,tabIndex:n,onFocus:r}))),(0,x.createElement)(Y1,null,(({ref:e,tabIndex:n,onFocus:r})=>(0,x.createElement)(uQ,{orientation:"vertical",clientIds:[t],ref:e,tabIndex:n,onFocus:r}))))),P&&F&&(0,x.createElement)(J1,{className:W,"aria-selected":!!r},(({ref:e,tabIndex:t,onFocus:n})=>(0,x.createElement)(F,{clientIds:ee,block:I,icon:_T.Z,label:M,toggleProps:{ref:e,className:"block-editor-list-view-block__menu",tabIndex:t,onFocus:n},disableOpenOnArrowDown:!0,expand:D,expandedState:Z,setInsertedBlock:z,__experimentalSelectBlock:Y}))))}));function f2(e,t,n,r){var o;const i=n?.includes(e.clientId);return i?0:(null!==(o=t[e.clientId])&&void 0!==o?o:r)?1+e.innerBlocks.reduce(g2(t,n,r),0):1}const g2=(e,t,n)=>(r,o)=>{var i;const a=t?.includes(o.clientId);return a?r:(null!==(i=e[o.clientId])&&void 0!==i?i:n)&&o.innerBlocks.length>0?r+f2(o,e,t,n):r+1},b2=()=>{};var v2=(0,x.memo)((function e(t){const{blocks:n,selectBlock:r=b2,showBlockMovers:o,selectedClientIds:i,level:a=1,path:s="",isBranchDragged:l=!1,isBranchSelected:c=!1,listPosition:u=0,fixedListWindow:d,isExpanded:p,parentId:h,shouldShowInnerBlocks:m=!0,isSyncedBranch:f=!1,showAppender:g=!0}=t,b=Sq(h),v=f||!!b?.isSynced,y=(0,yl.Z)((e=>!h||e(e_).canEditBlock(h)),[h]),{expandedState:_,draggedClientIds:k}=e2();if(!y)return null;const w=g&&1===a,E=n.filter(Boolean),C=E.length,S=w?C+1:C;let I=u;return(0,x.createElement)(x.Fragment,null,E.map(((t,n)=>{var u;const{clientId:h,innerBlocks:f}=t;n>0&&(I+=f2(E[n-1],_,k,p));const{itemInView:g}=d,b=g(I),y=n+1,w=s.length>0?`${s}_${y}`:`${y}`,T=!!f?.length,N=T&&m?null!==(u=_[h])&&void 0!==u?u:p:void 0,P=!!k?.includes(h),R=((e,t)=>Array.isArray(t)&&t.length?-1!==t.indexOf(e):t===e)(h,i),A=c||R&&T,B=P||b||l||R&&h===i[0];return(0,x.createElement)(nT.ZP,{key:h,value:!R},B&&(0,x.createElement)(m2,{block:t,selectBlock:r,isSelected:R,isBranchSelected:A,isDragged:P||l,level:a,position:y,rowCount:S,siblingBlockCount:C,showBlockMovers:o,path:w,isExpanded:N,listPosition:I,selectedClientIds:i,isSyncedBranch:v}),!B&&(0,x.createElement)("tr",null,(0,x.createElement)("td",{className:"block-editor-list-view-placeholder"})),T&&N&&(0,x.createElement)(e,{parentId:h,blocks:f,selectBlock:r,showBlockMovers:o,level:a+1,path:w,listPosition:I+1,fixedListWindow:d,isBranchSelected:A,isBranchDragged:P||l,selectedClientIds:i,isExpanded:p,isSyncedBranch:v}))})),w&&(0,x.createElement)(W1,{level:a,setSize:S,positionInSet:S,isExpanded:!0},(0,x.createElement)(J1,null,(e=>(0,x.createElement)(n2,{clientId:h,nestingLevel:a,blockCount:C,...e})))))}));function y2({listViewRef:e,blockDropTarget:t}){const{rootClientId:n,clientId:r,dropPosition:o}=t||{},[i,a]=(0,x.useMemo)((()=>e.current?[n?e.current.querySelector(`[data-block="${n}"]`):void 0,r?e.current.querySelector(`[data-block="${r}"]`):void 0]:[]),[n,r]),s=a||i,l=(0,$.isRTL)(),c=(0,x.useCallback)((e=>{if(!i)return 0;const t=i.querySelector(".block-editor-block-icon").getBoundingClientRect();return l?e.right-t.left:t.right-e.left}),[i,l]),u=(0,x.useCallback)(((e,t)=>{if(!s)return 0;let n=s.offsetWidth;const r=hA(s,"horizontal"),o=s.ownerDocument,i=r===o.body||r===o.documentElement;if(r&&!i){const o=r.getBoundingClientRect(),i=(0,$.isRTL)()?o.right-e.right:e.left-o.left,a=r.clientWidth;if(a<n+i&&(n=a-i),!l&&e.left+t<o.left)return n-=o.left-e.left,n;if(l&&e.right-t>o.right)return n-=e.right-o.right,n}return n-t}),[l,s]),d=(0,x.useMemo)((()=>{if(!s)return{};const e=s.getBoundingClientRect(),t=c(e);return{width:u(e,t)}}),[c,u,s]),p=(0,x.useMemo)((()=>{if(s&&("top"===o||"bottom"===o||"inside"===o))return{contextElement:s,getBoundingClientRect(){const e=s.getBoundingClientRect(),t=c(e);let n=l?e.left:e.left+t,r=0,i=0;const a=hA(s,"horizontal"),d=s.ownerDocument,p=a===d.body||a===d.documentElement;if(a&&!p){const e=a.getBoundingClientRect(),t=l?a.offsetWidth-a.clientWidth:0;n<e.left+t&&(n=e.left+t)}"top"===o?(r=e.top,i=e.top):(r=e.bottom,i=e.bottom);const h=u(e,t),m=i-r;return new window.DOMRect(n,r,h,m)}}}),[s,o,c,u,l]);return s?(0,x.createElement)(H_.ZP,{animate:!1,anchor:p,focusOnMount:!1,className:"block-editor-list-view-drop-indicator",variant:"unstyled"},(0,x.createElement)("div",{style:d,className:"block-editor-list-view-drop-indicator__line"})):null}const _2=28;function k2(e,t){const n=e[t+1];return n&&n.isDraggedBlock?k2(e,t+1):n}const w2=["top","bottom"];function E2(e,t,n=!1){let r,o,i,a,s;for(let n=0;n<e.length;n++){const l=e[n];if(l.isDraggedBlock)continue;const c=l.element.getBoundingClientRect(),[u,d]=QO(t,c,w2),p=eF(t,c);if(void 0===i||u<i||p){i=u;const t=e.indexOf(l),n=e[t-1];if("top"===d&&n&&n.rootClientId===l.rootClientId&&!n.isDraggedBlock?(o=n,r="bottom",a=n.element.getBoundingClientRect(),s=t-1):(o=l,r=d,a=c,s=t),p)break}}if(!o)return;const l=function(e,t){const n=[];let r=e;for(;r;)n.push({...r}),r=t.find((e=>e.clientId===r.rootClientId));return n}(o,e),c="bottom"===r;if(c&&o.canInsertDraggedBlocksAsChild&&(o.innerBlockCount>0&&o.isExpanded||function(e,t,n=1,r=!1){const o=r?t.right-n*_2:t.left+n*_2;return(r?e.x<o-_2:e.x>o+_2)&&e.y<t.bottom}(t,a,l.length,n))){const e=o.isExpanded?0:o.innerBlockCount||0;return{rootClientId:o.clientId,blockIndex:e,dropPosition:"inside"}}if(c&&o.rootClientId&&function(e,t,n=1,r=!1){const o=r?t.right-n*_2:t.left+n*_2;return r?e.x>o:e.x<o}(t,a,l.length,n)){const i=k2(e,s),c=o.nestingLevel,u=i?i.nestingLevel:1;if(c&&u){const d=function(e,t,n=1,r=!1){const o=r?t.right-n*_2:t.left+n*_2,i=r?o-e.x:e.x-o,a=Math.round(i/_2);return Math.abs(a)}(t,a,l.length,n),p=Math.max(Math.min(d,c-u),0);if(l[p]){let t=o.blockIndex;if(l[p].nestingLevel===i?.nestingLevel)t=i?.blockIndex;else for(let n=s;n>=0;n--){const r=e[n];if(r.rootClientId===l[p].rootClientId){t=r.blockIndex+1;break}}return{rootClientId:l[p].rootClientId,clientId:o.clientId,blockIndex:t,dropPosition:r}}}}if(!o.canInsertDraggedBlocksAsSibling)return;const u=c?1:0;return{rootClientId:o.rootClientId,clientId:o.clientId,blockIndex:o.blockIndex+u,dropPosition:r}}const C2=(e,t)=>Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e,x2=(0,x.forwardRef)((function e({id:t,blocks:n,dropZoneElement:r,showBlockMovers:o=!1,isExpanded:i=!1,showAppender:a=!1,blockSettingsMenu:s=c0,rootClientId:l,description:c,onSelect:u,additionalBlockContent:d},p){n&&(0,q.Z)("`blocks` property in `wp.blockEditor.__experimentalListView`",{since:"6.3",alternative:"`rootClientId` property"});const h=(0,tT.Z)(e),{clientIdsTree:m,draggedClientIds:f,selectedClientIds:g}=function({blocks:e,rootClientId:t}){return(0,yl.Z)((n=>{const{getDraggedBlockClientIds:r,getSelectedBlockClientIds:o,getEnabledClientIdsTree:i}=Jy(n(e_));return{selectedClientIds:o(),draggedClientIds:r(),clientIdsTree:null!=e?e:i(t)}}),[e,t])}({blocks:n,rootClientId:l}),{getBlock:b}=(0,yl.Z)(e_),{visibleBlockCount:v,shouldShowInnerBlocks:y}=(0,yl.Z)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n,__unstableGetEditorMode:r}=e(e_),o=f?.length>0?n(f).length+1:0;return{visibleBlockCount:t()-o,shouldShowInnerBlocks:"zoom-out"!==r()}}),[f]),{updateBlockSelection:_}=function(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,_l.Z)(e_),{getBlockName:r,getBlockParents:o,getBlockSelectionStart:i,getSelectedBlockClientIds:a,hasMultiSelection:s,hasSelectedBlock:l}=(0,yl.Z)(e_),{getBlockType:c}=(0,yl.Z)(Vu),u=(0,x.useCallback)((async(u,d,p,h)=>{if(!u?.shiftKey&&u?.keyCode!==Hf.hY)return void n(d,h);u.preventDefault();const m="keydown"===u.type&&u.keyCode===Hf.hY,f="keydown"===u.type&&(u.keyCode===Hf.UP||u.keyCode===Hf.WV||u.keyCode===Hf.Sd||u.keyCode===Hf.uR);if(!f&&!l()&&!s())return void n(d,null);const g=a(),b=[...o(d),d];if((m||f&&!g.some((e=>b.includes(e))))&&await e(),!m){let e=i(),n=d;f&&(l()||s()||(e=d),p&&(n=p));const r=o(e),a=o(n),{start:c,end:u}=function(e,t,n,r){const o=[...n,e],i=[...r,t],a=Math.min(o.length,i.length)-1;return{start:o[a],end:i[a]}}(e,n,r,a);await t(c,u,null)}const v=a();if((u.keyCode===Hf.Sd||u.keyCode===Hf.uR)&&v.length>1)return;const y=g.filter((e=>!v.includes(e)));let _;if(1===y.length){const e=c(r(y[0]))?.title;e&&(_=(0,$.sprintf)((0,$.__)("%s deselected."),e))}else y.length>1&&(_=(0,$.sprintf)((0,$.__)("%s blocks deselected."),y.length));_&&(0,wf.D)(_,"assertive")}),[e,r,c,o,i,a,s,l,t,n]);return{updateBlockSelection:u}}(),[k,w]=(0,x.useReducer)(C2,{}),{ref:E,target:C}=function({dropZoneElement:e}){const{getBlockRootClientId:t,getBlockIndex:n,getBlockCount:r,getDraggedBlockClientIds:o,canInsertBlocks:i}=(0,yl.Z)(e_),[a,s]=(0,x.useState)(),{rootClientId:l,blockIndex:c}=a||{},u=JO(l,c),d=(0,$.isRTL)(),p=o(),h=qO((0,x.useCallback)(((e,o)=>{const a={x:e.clientX,y:e.clientY},l=!!p?.length,c=E2(Array.from(o.querySelectorAll("[data-block]")).map((e=>{const o=e.dataset.block,a="true"===e.dataset.expanded,s=e.classList.contains("is-dragging"),c=parseInt(e.getAttribute("aria-level"),10),u=t(o);return{clientId:o,isExpanded:a,rootClientId:u,blockIndex:n(o),element:e,nestingLevel:c||void 0,isDraggedBlock:!!l&&s,innerBlockCount:r(o),canInsertDraggedBlocksAsSibling:!l||i(p,u),canInsertDraggedBlocksAsChild:!l||i(p,o)}})),a,d);c&&s(c)}),[i,p,r,n,t,d]),200);return{ref:YO({dropZoneElement:e,onDrop(e){a&&u(e)},onDragLeave(){h.cancel(),s(null)},onDragOver(e){h(e,e.currentTarget)},onDragEnd(){h.cancel(),s(null)}}),target:a}}({dropZoneElement:r}),S=(0,x.useRef)(),I=(0,Sf.Z)([S,E,p]),[T,N]=(0,x.useState)(null),{setSelectedTreeId:P}=function({firstSelectedBlockClientId:e,setExpandedState:t}){const[n,r]=(0,x.useState)(null),{selectedBlockParentClientIds:o}=(0,yl.Z)((t=>{const{getBlockParents:n}=t(e_);return{selectedBlockParentClientIds:n(e,!1)}}),[e]),i=Array.isArray(o)&&o.length?o:null;return(0,x.useEffect)((()=>{n!==e&&i&&t({type:"expand",clientIds:o})}),[e]),{setSelectedTreeId:r}}({firstSelectedBlockClientId:g[0],setExpandedState:w}),R=(0,x.useCallback)(((e,t,n)=>{_(e,t,null,n),P(t),u&&u(b(t))}),[P,_,u,b]);(0,x.useEffect)((()=>{g?.length&&h2(g[0],S)}),[]);const A=(0,x.useCallback)((e=>{e&&w({type:"expand",clientIds:[e]})}),[w]),B=(0,x.useCallback)((e=>{e&&w({type:"collapse",clientIds:[e]})}),[w]),L=(0,x.useCallback)((e=>{A(e?.dataset?.block)}),[A]),M=(0,x.useCallback)((e=>{B(e?.dataset?.block)}),[B]),D=(0,x.useCallback)(((e,t,n)=>{e.shiftKey&&_(e,t?.dataset?.block,n?.dataset?.block)}),[_]),O=(0,x.useMemo)((()=>({draggedClientIds:f,expandedState:k,expand:A,collapse:B,BlockSettingsMenu:s,listViewInstanceId:h,AdditionalBlockContent:d,insertedBlock:T,setInsertedBlock:N,treeGridElementRef:S})),[f,k,A,B,s,h,d,T,N]),[F]=function(e,t,n,r){var o,i;const a=null!==(o=r?.initWindowSize)&&void 0!==o?o:30,s=null===(i=r?.useWindowing)||void 0===i||i,[l,c]=(0,x.useState)({visibleItems:a,start:0,end:a,itemInView:e=>e>=0&&e<=a});return(0,x.useLayoutEffect)((()=>{if(!s)return;const o=hA(e.current),i=e=>{var i;if(!o)return;const a=Math.ceil(o.clientHeight/t),s=e?a:null!==(i=r?.windowOverscan)&&void 0!==i?i:a,l=Math.floor(o.scrollTop/t),u=Math.max(0,l-s),d=Math.min(n-1,l+a+s);c((e=>{const t={visibleItems:a,start:u,end:d,itemInView:e=>u<=e&&e<=d};return e.start!==t.start||e.end!==t.end||e.visibleItems!==t.visibleItems?t:e}))};i(!0);const a=(0,BT.D)((()=>{i()}),16);return o?.addEventListener("scroll",a),o?.ownerDocument?.defaultView?.addEventListener("resize",a),o?.ownerDocument?.defaultView?.addEventListener("resize",a),()=>{o?.removeEventListener("scroll",a),o?.ownerDocument?.defaultView?.removeEventListener("resize",a)}}),[t,e,n,r?.expandedState,r?.windowOverscan,s]),(0,x.useLayoutEffect)((()=>{if(!s)return;const r=hA(e.current),o=e=>{switch(e.keyCode){case Hf.Sd:return r?.scrollTo({top:0});case Hf.uR:return r?.scrollTo({top:n*t});case Hf.wx:return r?.scrollTo({top:r.scrollTop-l.visibleItems*t});case Hf.Bi:return r?.scrollTo({top:r.scrollTop+l.visibleItems*t})}};return r?.ownerDocument?.defaultView?.addEventListener("keydown",o),()=>{r?.ownerDocument?.defaultView?.removeEventListener("keydown",o)}}),[n,t,e,l.visibleItems,s,r?.expandedState]),[l,c]}(S,36,v,{expandedState:k,useWindowing:!0,windowOverscan:40});return m.length||a?(0,x.createElement)(nT.ZP,{value:!0},(0,x.createElement)(y2,{listViewRef:S,blockDropTarget:C}),(0,x.createElement)(U1,{id:t,className:"block-editor-list-view-tree","aria-label":(0,$.__)("Block navigation structure"),ref:I,onCollapseRow:M,onExpandRow:L,onFocusRow:D,applicationAriaLabel:(0,$.__)("Block navigation structure"),"aria-description":c},(0,x.createElement)(Q1.Provider,{value:O},(0,x.createElement)(v2,{blocks:m,parentId:l,selectBlock:R,showBlockMovers:o,fixedListWindow:F,selectedClientIds:g,isExpanded:i,shouldShowInnerBlocks:y,showAppender:a})))):null}));(0,x.forwardRef)(((e,t)=>(0,x.createElement)(x2,{ref:t,...e,showAppender:!1,rootClientId:null,onSelect:null,additionalBlockContent:null,blockSettingsMenu:void 0})));const S2=[{label:(0,$._x)("Original","Aspect ratio option for dimensions control"),value:"auto"},{label:(0,$._x)("Square - 1:1","Aspect ratio option for dimensions control"),value:"1"},{label:(0,$._x)("Standard - 4:3","Aspect ratio option for dimensions control"),value:"4/3"},{label:(0,$._x)("Portrait - 3:4","Aspect ratio option for dimensions control"),value:"3/4"},{label:(0,$._x)("Classic - 3:2","Aspect ratio option for dimensions control"),value:"3/2"},{label:(0,$._x)("Classic Portrait - 2:3","Aspect ratio option for dimensions control"),value:"2/3"},{label:(0,$._x)("Wide - 16:9","Aspect ratio option for dimensions control"),value:"16/9"},{label:(0,$._x)("Tall - 9:16","Aspect ratio option for dimensions control"),value:"9/16"},{label:(0,$._x)("Custom","Aspect ratio option for dimensions control"),value:"custom",disabled:!0,hidden:!0}];function I2({panelId:e,value:t,onChange:n=(()=>{}),options:r=S2,defaultValue:o=S2[0].value,isShownByDefault:i=!0}){const a=null!=t?t:"auto";return(0,x.createElement)(_F,{hasValue:()=>a!==o,label:(0,$.__)("Aspect ratio"),onDeselect:()=>n(void 0),isShownByDefault:i,panelId:e},(0,x.createElement)(HZ.Z,{label:(0,$.__)("Aspect ratio"),value:a,options:r,onChange:n,size:"__unstable-large",__nextHasNoMarginBottom:!0}))}const T2=[{value:"fill",label:(0,$._x)("Fill","Scale option for dimensions control"),help:(0,$.__)("Fill the space by stretching the content.")},{value:"contain",label:(0,$._x)("Contain","Scale option for dimensions control"),help:(0,$.__)("Fit the content to the space without clipping.")},{value:"cover",label:(0,$._x)("Cover","Scale option for dimensions control"),help:(0,$.__)("Fill the space by clipping what doesn't fit.")},{value:"none",label:(0,$._x)("None","Scale option for dimensions control"),help:(0,$.__)("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,$._x)("Scale down","Scale option for dimensions control"),help:(0,$.__)("Scale down the content to fit the space if it is too big. Content that is too small will have additional padding.")}];function N2({panelId:e,value:t,onChange:n,options:r=T2,defaultValue:o=T2[0].value,isShownByDefault:i=!0}){const a=null!=t?t:"fill",s=(0,x.useMemo)((()=>r.reduce(((e,t)=>(e[t.value]=t.help,e)),{})),[r]);return(0,x.createElement)(_F,{label:(0,$.__)("Scale"),isShownByDefault:i,hasValue:()=>a!==o,onDeselect:()=>n(o),panelId:e},(0,x.createElement)(Dw,{label:(0,$.__)("Scale"),isBlock:!0,help:s[a],value:a,onChange:n,__nextHasNoMarginBottom:!0},r.map((e=>(0,x.createElement)(i$,{key:e.value,...e})))))}const P2=(0,g_.default)(_F,{target:"ef8pe3d0"})({name:"957xgf",styles:"grid-column:span 1"});function R2({panelId:e,value:t={},onChange:n=(()=>{}),units:r,isShownByDefault:o=!0}){var i,a;const s="auto"===t.width?"":null!==(i=t.width)&&void 0!==i?i:"",l="auto"===t.height?"":null!==(a=t.height)&&void 0!==a?a:"",c=e=>r=>{const o={...t};r?o[e]=r:delete o[e],n(o)};return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(P2,{label:(0,$.__)("Width"),isShownByDefault:o,hasValue:()=>""!==s,onDeselect:c("width"),panelId:e},(0,x.createElement)(rx,{label:(0,$.__)("Width"),placeholder:(0,$.__)("Auto"),labelPosition:"top",units:r,min:0,value:s,onChange:c("width"),size:"__unstable-large"})),(0,x.createElement)(P2,{label:(0,$.__)("Height"),isShownByDefault:o,hasValue:()=>""!==l,onDeselect:c("height"),panelId:e},(0,x.createElement)(rx,{label:(0,$.__)("Height"),placeholder:(0,$.__)("Auto"),labelPosition:"top",units:r,min:0,value:l,onChange:c("height"),size:"__unstable-large"})))}const A2=[{label:(0,$._x)("Thumbnail","Image size option for resolution control"),value:"thumbnail"},{label:(0,$._x)("Medium","Image size option for resolution control"),value:"medium"},{label:(0,$._x)("Large","Image size option for resolution control"),value:"large"},{label:(0,$._x)("Full Size","Image size option for resolution control"),value:"full"}],B2="isResuableBlocksrRenameHintVisible";const L2={};Xy(L2,{...k,ExperimentalBlockCanvas:function({shouldIframe:e=!0,height:t="300px",children:n=(0,x.createElement)(fF,null),styles:r,contentRef:o,iframeProps:i}){const a=lF(),s=GQ(),l=UB(),c=(0,Sf.Z)([s,o,l]);return e?(0,x.createElement)(hL,{...i,ref:a,contentRef:c,style:{width:"100%",height:t,...i?.style},name:"editor-canvas"},(0,x.createElement)(BL,{styles:r}),n):(0,x.createElement)(x.Fragment,null,(0,x.createElement)(BL,{styles:r,scope:".editor-styles-wrapper"}),(0,x.createElement)(cL,{ref:c,className:"editor-styles-wrapper",tabIndex:-1,style:{height:t}},n))},ExperimentalBlockEditorProvider:LB,getRichTextValues:function(e=[]){Rd.skipFilters=!0;const t=[];return g1(t,e),Rd.skipFilters=!1,t},kebabCase:VE,PrivateInserter:CO,PrivateListView:x2,ResizableBoxPopover:function({clientId:e,resizableBoxProps:t,...n}){return(0,x.createElement)(MO,{clientId:e,__unstableCoverTarget:!0,__unstablePopoverSlot:"block-toolbar",shift:!1,...n},(0,x.createElement)(O1,{...t}))},BlockInfo:GJ,useShouldContextualToolbarShow:I0,cleanEmptyObject:CC,BlockQuickNavigation:qJ,LayoutStyle:function({layout:e={},css:t,...n}){const r=PS(e.type),o=null!==YE("spacing.blockGap");if(r){if(t)return(0,x.createElement)("style",null,t);const i=r.getLayoutStyle?.({hasBlockGapSupport:o,layout:e,...n});if(i)return(0,x.createElement)("style",null,i)}return null},BlockRemovalWarningModal:function({rules:e}){const{clientIds:t,selectPrevious:n,blockNamesForPrompt:r}=(0,yl.Z)((e=>Jy(e(e_)).getRemovalPromptData())),{clearBlockRemovalPrompt:o,setBlockRemovalRules:i,privateRemoveBlocks:a}=Jy((0,_l.Z)(e_));if((0,x.useEffect)((()=>(i(e),()=>{i()})),[e,i]),r)return(0,x.createElement)(yT.Z,{title:(0,$.__)("Are you sure?"),onRequestClose:o},1===r.length?(0,x.createElement)("p",null,e[r[0]]):(0,x.createElement)("ul",{style:{listStyleType:"disc",paddingLeft:"1rem"}},r.map((t=>(0,x.createElement)("li",{key:t},e[t])))),(0,x.createElement)("p",null,r.length>1?(0,$.__)("Removing these blocks is not advised."):(0,$.__)("Removing this block is not advised.")),(0,x.createElement)(wI.Z,{justify:"right"},(0,x.createElement)(Gh.ZP,{variant:"tertiary",onClick:o},(0,$.__)("Cancel")),(0,x.createElement)(Gh.ZP,{variant:"primary",onClick:()=>{a(t,n,!0),o()}},(0,$.__)("Delete"))))},useLayoutClasses:Hq,useLayoutStyles:function(e={},t,n){const{layout:r={},style:o={}}=e,i=r?.inherit||r?.contentSize||r?.wideSize?{...r,type:"constrained"}:r||{},a=PS(i?.type||"default"),s=null!==YE("spacing.blockGap"),l=a?.getLayoutStyle?.({blockName:t,selector:n,layout:r,style:o,hasBlockGapSupport:s});return l},DimensionsTool:function({panelId:e,value:t={},onChange:n=(()=>{}),aspectRatioOptions:r,defaultAspectRatio:o="auto",scaleOptions:i,defaultScale:a="fill",unitsOptions:s}){const l=void 0===t.width||"auto"===t.width?null:t.width,c=void 0===t.height||"auto"===t.height?null:t.height,u=void 0===t.aspectRatio||"auto"===t.aspectRatio?null:t.aspectRatio,d=void 0===t.scale||"fill"===t.scale?null:t.scale,[p,h]=(0,x.useState)(d),[m,f]=(0,x.useState)(u),g=l&&c?"custom":m,b=u||l&&c;return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(I2,{panelId:e,options:r,defaultValue:o,value:g,onChange:e=>{const r={...t};f(e="auto"===e?null:e),e?r.aspectRatio=e:delete r.aspectRatio,e?p?r.scale=p:(r.scale=a,h(a)):delete r.scale,"custom"!==e&&l&&c&&delete r.height,n(r)}}),b&&(0,x.createElement)(N2,{panelId:e,options:i,defaultValue:a,value:p,onChange:e=>{const r={...t};h(e="fill"===e?null:e),e?r.scale=e:delete r.scale,n(r)}}),(0,x.createElement)(R2,{panelId:e,units:s,value:{width:l,height:c},onChange:({width:e,height:r})=>{const o={...t};r="auto"===r?null:r,(e="auto"===e?null:e)?o.width=e:delete o.width,r?o.height=r:delete o.height,e&&r?delete o.aspectRatio:m&&(o.aspectRatio=m),m||!!e==!!r?p?o.scale=p:(o.scale=a,h(a)):delete o.scale,n(o)}}))},ResolutionTool:function({panelId:e,value:t,onChange:n,options:r=A2,defaultValue:o=A2[0].value,isShownByDefault:i=!0}){const a=null!=t?t:o;return(0,x.createElement)(_F,{hasValue:()=>a!==o,label:(0,$.__)("Resolution"),onDeselect:()=>n(o),isShownByDefault:i,panelId:e},(0,x.createElement)(HZ.Z,{label:(0,$.__)("Resolution"),value:a,options:r,onChange:n,help:(0,$.__)("Select the size of the source image."),size:"__unstable-large"}))},ReusableBlocksRenameHint:function(){const e=(0,yl.Z)((e=>{var t;return null===(t=e(LF.h).get("core",B2))||void 0===t||t}),[]),t=(0,x.useRef)(),{set:n}=(0,_l.Z)(LF.h);return e?(0,x.createElement)("div",{ref:t,className:"reusable-blocks-menu-items__rename-hint"},(0,x.createElement)("div",{className:"reusable-blocks-menu-items__rename-hint-content"},(0,$.__)("Reusable blocks are now synced patterns. A synced pattern will behave in exactly the same way as a reusable block.")),(0,x.createElement)(Gh.ZP,{className:"reusable-blocks-menu-items__rename-hint-dismiss",icon:WX.Z,iconSize:"16",label:(0,$.__)("Dismiss hint"),onClick:()=>{const e=TA.tabbable.findPrevious(t.current);e?.focus(),n("core",B2,!1)},showTooltip:!1})):null},useReusableBlocksRenameHint:function(){return(0,yl.Z)((e=>{var t;return null===(t=e(LF.h).get("core",B2))||void 0===t||t}),[])},usesContextKey:AX});var M2=n(38358),D2=n(89912),O2=n(69177);const F2=async(e,{perPage:t=20}={})=>{const n=await(0,I.default)({path:(0,G.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,Ud.S)(e.title)||`(${O2.MailPoet.I18n.t("noName")})`,type:e.subtype||e.type}))):[]};var j2=n(39519),Z2=n.n(j2);function z2({isActive:e,label:t,info:n,onToggle:r}){return(0,Cw.jsx)(Wk.Z,{icon:e&&aG.Z,isSelected:e,onClick:r,role:"menuitemcheckbox",info:n,children:t})}var V2=n(28369);const H2="mailpoet-form-editor",U2=am.fontSizes.map((e=>({...e,size:`${e.size}${Number.isNaN(Number(`${e.size}`||NaN))?"":"px"}`})));var $2=n(61888);const W2=e=>{const t={full_width:e.fullWidth?"1":"0"};return e.inheritFromTheme||(t.bold=e.bold?"1":"0",(0,$2.has)(e,"backgroundColor")&&e.backgroundColor&&(t.background_color=e.backgroundColor),(0,$2.has)(e,"gradient")&&e.gradient&&(t.gradient=e.gradient),(0,$2.has)(e,"fontSize")&&void 0!==e.fontSize&&(t.font_size=e.fontSize),(0,$2.has)(e,"fontColor")&&e.fontColor&&(t.font_color=e.fontColor),(0,$2.has)(e,"borderSize")&&void 0!==e.borderSize&&(t.border_size=e.borderSize),(0,$2.has)(e,"borderRadius")&&void 0!==e.borderRadius&&(t.border_radius=e.borderRadius),(0,$2.has)(e,"borderColor")&&e.borderColor&&(t.border_color=e.borderColor),(0,$2.has)(e,"padding")&&void 0!==e.padding&&(t.padding=e.padding),(0,$2.has)(e,"fontFamily")&&e.fontFamily&&(t.font_family=e.fontFamily)),t},G2=(e,t,n=null)=>{const r=e.find((e=>e.slug===t));return r?r.color:n},q2=(e,t,n=null)=>{const r=e.find((e=>e.slug===t));return r?r.gradient:n},K2=(e,t,n=null)=>{const r=e.find((e=>e.slug===t));return r?r.size:n},Y2=(e,t,n,r)=>{if(!Array.isArray(r))throw new Error("Mapper expects customFields to be an array.");const o=i=>{if(!Array.isArray(i))throw new Error("Mapper expects blocks to be an array.");return i.map((i=>{const a={type:"text",params:{label:i.attributes.label,class_name:i.attributes.className||null}};switch(i.attributes.mandatory&&(a.params.required="1"),i.attributes.labelWithinInput&&(a.params.label_within="1"),i.name){case"core/heading":return{type:"heading",id:"heading",params:{content:i.attributes.content,level:i.attributes.level,align:i.attributes.textAlign||"left",font_size:K2(e,i.attributes.fontSize,i.attributes.style?.typography?.fontSize||null),text_color:G2(t,i.attributes.textColor,i.attributes.style?.color?.text||null),line_height:i.attributes.style?.typography?.lineHeight,background_color:G2(t,i.attributes.backgroundColor,i.attributes.style?.color?.background||null),gradient:q2(n,i.attributes.gradient,i.attributes.style?.color?.gradient||null),anchor:i.attributes.anchor||null,class_name:i.attributes.className||null,padding:i.attributes.style?.spacing?.padding||null}};case"core/paragraph":return{type:"paragraph",id:"paragraph",params:{content:i.attributes.content,drop_cap:i.attributes.dropCap?"1":"0",align:i.attributes.align||"left",font_size:K2(e,i.attributes.fontSize,i.attributes.style?.typography?.fontSize||null),line_height:i.attributes.style?.typography?.lineHeight,text_color:G2(t,i.attributes.textColor,i.attributes.style?.color?.text||null),background_color:G2(t,i.attributes.backgroundColor,i.attributes.style?.color?.background||null),gradient:q2(n,i.attributes.gradient,i.attributes.style?.color?.gradient||null),class_name:i.attributes.className||null,padding:i.attributes.style?.spacing?.padding||null}};case"core/image":return{type:"image",id:"image",params:{class_name:i.attributes.className||null,align:i.attributes.align||null,url:i.attributes.url||null,alt:i.attributes.alt||null,title:i.attributes.title||null,caption:i.attributes.caption||null,link_destination:i.attributes.linkDestination||null,link:i.attributes.link||null,href:i.attributes.href||null,link_class:i.attributes.linkClass||null,rel:i.attributes.rel||null,link_target:i.attributes.linkTarget||null,id:i.attributes.id||null,size_slug:i.attributes.sizeSlug||null,width:i.attributes.width||null,height:i.attributes.height||null}};case"core/column":return{type:"column",body:o(i.innerBlocks),params:{class_name:i.attributes.className||null,vertical_alignment:i.attributes.verticalAlignment||null,width:i.attributes.width||null,padding:i.attributes.style?.spacing?.padding||null,text_color:G2(t,i.attributes.textColor,i.attributes.style?.color?.text||null),background_color:G2(t,i.attributes.backgroundColor,i.attributes.style?.color?.background||null),gradient:q2(n,i.attributes.gradient,i.attributes.style?.color?.gradient||null)}};case"core/columns":return{type:"columns",body:o(i.innerBlocks),params:{vertical_alignment:i.attributes.verticalAlignment||null,is_stacked_on_mobile:i.attributes.isStackedOnMobile||void 0===i.attributes.isStackedOnMobile?"1":"0",class_name:i.attributes.className||null,padding:i.attributes.style?.spacing?.padding||null,text_color:G2(t,i.attributes.textColor,i.attributes.style?.color?.text||null),background_color:G2(t,i.attributes.backgroundColor,i.attributes.style?.color?.background||null),gradient:q2(n,i.attributes.gradient,i.attributes.style?.color?.gradient||null)}};case"mailpoet-form/email-input":return{...a,id:"email",name:"Email",params:{...a.params,required:"1"},styles:W2(i.attributes.styles)};case"mailpoet-form/first-name-input":return{...a,id:"first_name",name:"First name",styles:W2(i.attributes.styles)};case"mailpoet-form/last-name-input":return{...a,id:"last_name",name:"Last name",styles:W2(i.attributes.styles)};case"mailpoet-form/segment-select":return{...a,id:"segments",type:"segment",name:"List selection",params:{...a.params,values:i.attributes.values.map((e=>({id:e.id,is_checked:e.isChecked?"1":void 0})))}};case"mailpoet-form/submit-button":return{...a,id:"submit",type:"submit",name:"Submit",styles:W2(i.attributes.styles)};case"mailpoet-form/divider":return{...a,id:"divider",type:"divider",name:"Divider",params:{class_name:i.attributes.className||null,height:i.attributes.height,type:i.attributes.type,style:i.attributes.style,divider_height:i.attributes.dividerHeight,divider_width:i.attributes.dividerWidth,color:i.attributes.color}};case"mailpoet-form/html":return{...a,id:"html",type:"html",name:"Custom text or HTML",params:{text:i.attributes&&i.attributes.content?i.attributes.content:"",nl2br:i.attributes&&i.attributes.nl2br?"1":"0",class_name:i.attributes.className||null}};default:return i.name.startsWith("mailpoet-form/custom-")?((e,t,n)=>{const r=t.find((t=>t.id===e.attributes.customFieldId));if(!r)return null;const o={...n,id:e.attributes.customFieldId.toString(),name:r.name};return e.name.startsWith("mailpoet-form/custom-date")&&(o.type="date"),e.name.startsWith("mailpoet-form/custom-text")&&(o.type="text",o.styles=W2(e.attributes.styles)),e.name.startsWith("mailpoet-form/custom-textarea")&&(o.type="textarea",o.styles=W2(e.attributes.styles)),e.name.startsWith("mailpoet-form/custom-radio")&&(o.type="radio"),e.name.startsWith("mailpoet-form/custom-checkbox")&&(o.type="checkbox"),e.name.startsWith("mailpoet-form/custom-select")&&(o.type="select"),(0,$2.has)(e.attributes,"validate")&&(o.params.validate=e.attributes.validate),(0,$2.has)(e.attributes,"hideLabel")&&e.attributes.hideLabel&&(o.params.hide_label="1"),(0,$2.has)(e.attributes,"defaultToday")&&e.attributes.defaultToday&&(o.params.is_default_today="1"),(0,$2.has)(e.attributes,"dateType")&&(o.params.date_type=e.attributes.dateType),(0,$2.has)(e.attributes,"lines")&&(o.params.lines=e.attributes.lines),(0,$2.has)(e.attributes,"dateFormat")&&(o.params.date_format=e.attributes.dateFormat),(0,$2.has)(e.attributes,"values")&&(o.params.values=e.attributes.values.map((e=>{const t={value:e.name};return(0,$2.has)(e,"isChecked")&&e.isChecked&&(t.is_checked="1"),t}))),o})(i,r,a):null}})).filter(Boolean)};return o};function X2(e){const t={...e,settings:{...e.settings,form_placement:{popup:{enabled:!0===e.settings.formPlacement?.popup?.enabled?"1":"",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 J2(e){return{type:"TOGGLE_SIDEBAR",toggleTo:e}}function Q2(e){return{type:"TOGGLE_INSERTER_SIDEBAR",value:e}}function e5(e){return e?{type:"ENABLE_FORM"}:{type:"DISABLE_FORM"}}function*t5(e){yield{type:"STORE_LOCALLY",key:"mailpoet_form_view_options",value:e},yield{type:"TOGGLE_FULLSCREEN",toggleTo:e}}function n5(e){return{type:"CHANGE_FORM_BLOCKS",blocks:e}}function r5(e){return{type:"CHANGE_FORM_NAME",name:e}}function o5(){return{type:"DELETE_CUSTOM_FIELD_STARTED"}}function i5(e,t){return{type:"DELETE_CUSTOM_FIELD_DONE",customFieldId:e,clientId:t}}function a5(e=void 0){return{type:"DELETE_CUSTOM_FIELD_FAILED",message:e}}function s5(e){return{type:"CHANGE_FORM_STYLES",styles:e}}function l5(){return{type:"CUSTOM_FIELD_EDITED"}}function c5(e,t){return{type:"SAVE_CUSTOM_FIELD_DONE",customFieldId:e,response:t}}function u5(){return{type:"SAVE_CUSTOM_FIELD_STARTED"}}function d5(e=void 0){return{type:"SAVE_CUSTOM_FIELD_FAILED",message:e}}function p5(e){return{type:"CREATE_CUSTOM_FIELD_DONE",response:e}}function h5(e){return{type:"CREATE_CUSTOM_FIELD_STARTED",customField:e}}function m5(e=void 0){return{type:"CREATE_CUSTOM_FIELD_FAILED",message:e}}function f5(e){return{type:"CHANGE_FORM_SETTINGS",settings:e}}function*g5(e){yield{type:"SAVE_FORM_DONE",formId:e},yield{type:"ENSURE_BROWSER_URL",formId:e}}function b5(){return{type:"SAVE_FORM_STARTED"}}function v5(e=void 0){return{type:"SAVE_FORM_FAILED",message:e}}function y5(e){return"placement_settings"===e&&(0,Yl.W)(e_).clearSelectedBlock(),{type:"CHANGE_ACTIVE_SIDEBAR",sidebar:e}}function*_5(e){const t=(0,Kl.Y)(H2).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*k5(e){const t={...(0,Kl.Y)(H2).getPreviewSettings(),formType:e};return yield*_5(t),y5("placement_settings")}function*w5(){yield{type:"SHOW_PREVIEW"},yield y5("default");const e=(0,Kl.Y)(H2).getAllAvailableCustomFields(),t=(0,Kl.Y)(H2).getFormData(),n=(0,Kl.Y)(H2).getFormBlocks(),r=Y2(U2,am.colors,am.gradients,e),{success:o,error:i}=yield{type:"CALL_API",endpoint:"forms",action:"previewEditor",data:{...X2(t),body:r(n)}};return o?{type:"PREVIEW_DATA_SAVED"}:{type:"PREVIEW_DATA_NOT_SAVED",error:i}}function E5(){return{type:"HIDE_PREVIEW"}}function C5(e){return{type:"REMOVE_NOTICE",id:e}}function x5(e){return{type:"SWITCH_DEFAULT_SIDEBAR_TAB",id:e}}function S5(e,t=void 0){return{type:"TOGGLE_SIDEBAR_PANEL",id:e,toggleTo:t}}function*I5(){yield{type:"SAVE_FORM"}}function*T5(e){yield{type:"SAVE_CUSTOM_FIELD",...e}}function*N5(e,t){yield{type:"CREATE_CUSTOM_FIELD",clientId:t,data:e}}function*P5(e,t){yield{type:"DELETE_CUSTOM_FIELD",customFieldId:e,clientId:t}}function*R5(e){yield{type:"BLOCKS_CHANGED_IN_BLOCK_EDITOR",blocks:e}}function*A5(e){yield{type:"APPLY_STYLES_TO_ALL_TEXT_INPUTS",styles:e}}function B5(){return{type:"HISTORY_UNDO"}}function L5(){return{type:"HISTORY_REDO"}}function*M5(){yield{type:"TUTORIAL_DISMISS"},yield{type:"TUTORIAL_DISMISSED"}}const D5=(e,t)=>e.reduce(((e,n)=>e||(n.name===t?n:Array.isArray(n.innerBlocks)&&n.innerBlocks.length?D5(n.innerBlocks,t):null)),null),O5=(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=D5(t,"mailpoet-form/segment-select"),r=[];n&&0!==n.attributes.values.length||e.settings.segments&&0!==e.settings.segments.length||r.push("missing-lists"),n&&0===n.attributes.values.length&&r.push("missing-lists-in-custom-segments-block");const o=D5(t,"mailpoet-form/email-input"),i=D5(t,"mailpoet-form/submit-button");return o||r.push("missing-email-input"),i||r.push("missing-submit"),r},F5=e=>{let t=e.editorHistory,n=e.editorHistoryOffset;const r=((e,t)=>{const n=e[e.length-1],r=Date.now();if(void 0!==n&&r-n.time<1e3&&e.length>1)return e.pop(),{blocks:t.formBlocks,data:t.formData,time:n.time};const o={blocks:t.formBlocks,data:t.formData,time:r};return void 0!==n&&(0,$2.isEqual)(n.data,o.data)&&(0,$2.isEqual)(n.blocks,o.blocks)?null:o})(t,e);if(null===r)return e;if(0!==e.editorHistoryOffset){const r=e.editorHistory.length-(e.editorHistoryOffset+1);n=0,t=t.slice(0,r)}return t.length>=100&&t.shift(),t.push(r),{...e,editorHistory:t,editorHistoryOffset:n}},j5=(e,t)=>{let n=e.editorHistoryOffset;0===n&&F5(e),n+=t;const r=e.editorHistory.length-(n+1);let o,i;if(void 0===e.editorHistory[r])return e;{const t=e.editorHistory[r];o=t.blocks,i=t.data}return{...e,editorHistoryOffset:n,formBlocks:o,formData:i}},Z5=(z5=O2.MailPoet,(e,t)=>{const n=e.notices.filter((e=>"custom-field"!==e.id)),r=(0,$2.trim)(t.customField.name),o=e.customFields.find((e=>e.name===r));return o&&n.push({id:"custom-field",content:z5.I18n.t("customFieldWithNameExists").replace("[name]",r),isDismissible:!0,status:"error"}),{...e,isCustomFieldCreating:!o,notices:n}});var z5;const V5=(e=>t=>{const n=t.notices.filter((e=>!["missing-lists-in-custom-segments-block","save-form","missing-lists","missing-block"].includes(e.id))),r=t.formErrors.includes("missing-lists")||t.formErrors.includes("missing-lists-in-custom-segments-block"),o=[...t.sidebar.openedPanels];r&&(n.push({id:"missing-lists",content:e.I18n.t("settingsPleaseSelectList"),isDismissible:!0,status:"error"}),o.includes("basic-settings")||o.push("basic-settings"));const i=t.formErrors.includes("missing-email-input"),a=t.formErrors.includes("missing-submit");return(i||a)&&n.push({id:"missing-block",content:e.I18n.t("missingObligatoryBlock"),isDismissible:!0,status:"error"}),{...t,isFormSaving:!r,sidebar:{...t.sidebar,activeTab:r?"form":t.sidebar.activeTab,openedPanels:o},notices:n}})(O2.MailPoet),H5=e=>(t=e,n={})=>{const r=((e,t)=>"CHANGE_FORM_BLOCKS"===t.type||"CHANGE_FORM_NAME"===t.type||"CHANGE_FORM_SETTINGS"===t.type||"CHANGE_FORM_STYLES"===t.type?F5(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:O2.MailPoet.I18n.t("customFieldSaved"),isDismissible:!0,status:"success"});const r=[...e.customFields];return r.push(t.response),{...e,isCustomFieldCreating:!1,notices:n,customFields:r}})(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 Z5(e,t);case"CHANGE_FORM_BLOCKS":return((e,t)=>{const n={...e,formBlocks:t.blocks};return{...n,hasUnsavedChanges:!0,formErrors:O5(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:O5(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:`${O2.MailPoet.I18n.t("formSaved")} ${O2.MailPoet.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 V5(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:O2.MailPoet.I18n.t("customFieldSaved"),isDismissible:!0,status:"success"});const r=e.customFields.map((e=>e.id===t.customFieldId?t.response:e));return{...e,isCustomFieldSaving:!1,notices:n,customFields:r}})(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}})(e,t);case"TOGGLE_SIDEBAR_PANEL":return((e,t)=>{let n;!0===t.toggleTo&&(n="opened"),!1===t.toggleTo&&(n="closed");const r=[...e.sidebar.openedPanels],o=((e,t,n)=>{const r=e.includes(t);let o=n;return void 0===o&&(o=r?"closed":"opened"),r&&"closed"===o?"close":r||"opened"!==o?null:"open"})(r,t.id,n);return"open"===o?r.push(t.id):"close"===o&&(0,$2.remove)(r,(e=>e===t.id)),{...e,sidebar:{...e.sidebar,openedPanels:r}}})(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)),r=e.formBlocks.filter((e=>e.clientId!==t.clientId));return{...e,formBlocks:r,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=>j5(e,1))(e);case"HISTORY_REDO":return(e=>j5(e,-1))(e);case"TUTORIAL_DISMISSED":return(e=>({...e,tutorialSeen:!0}))(e);default:return e}})(r,n)},U5=(e,t,n=[])=>e.reduce(((e,r)=>{if(e.length)return e;if(Array.isArray(r.innerBlocks)&&r.innerBlocks.length){n.push(r);const e=r.innerBlocks.find((e=>e.clientId===t));return e?n:U5(r.innerBlocks,t,n)}return[]}),[]),$5={isFormSaved(e){return"number"==typeof e.formData.id},isFormEnabled(e){return"enabled"===e.formData.status},isFullscreenEnabled(e){return e.fullscreenStatus},isInserterOpened(e){return!!e.inserterPanel},getInserterPanelInsertPoint(e){return e.inserterPanel},getSidebarOpened(e){return e.sidebarOpened},getFormName(e){return e.formData.name},getFormData(e){return e.formData},getFormStyles(e){return e.formData.styles},getFormExports(e){return Object.fromEntries(Object.entries(e.formExports).map((([t,n])=>[t,n.replace(":form_id:",`${e.formData.id}`)])))},getFormSettings(e){return e.formData.settings},getAllAvailableSegments(e){return e.segments},getAllAvailableCustomFields(e){return e.customFields},getIsFormSaving(e){return e.isFormSaving},getIsPreviewShown(e){return e.isPreviewShown},getIsPreviewReady(e){return 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){return e.isCustomFieldSaving},getIsCustomFieldDeleting(e){return e.isCustomFieldDeleting},getDismissibleNotices(e){return e.notices.filter((e=>!0===e.isDismissible))},getNonDismissibleNotices(e){return e.notices.filter((e=>!1===e.isDismissible))},getNotice(e,t){return e.notices.find((e=>e.id===t))},getFormErrors(e){return e.formErrors},getDefaultSidebarActiveTab(e){return e.sidebar.activeTab},getSidebarOpenedPanels(e){return e.sidebar.openedPanels},getFormBlocks(e){return e.formBlocks},getDateSettingsData(e){return e.dateSettingData},getIsCustomFieldCreating(e){return e.isCustomFieldCreating},hasUnsavedChanges(e){return e.hasUnsavedChanges},getEditorUrl(e){return e.editorUrl},getPreviewPageUrl(e){return e.previewPageUrl},getCloseIconsUrl(e){return e.closeIconsUrl},getAllCustomFonts(e){return e.customFonts},getActiveSidebar(e){return e.sidebar.activeSidebar},getAllWPPosts(e){return e.allWpPosts},getAllWPPages(e){return e.allWpPages},getAllWPCategories(e){return e.allWpCategories},getAllWPTags(e){return e.allWpTags},getAllWooCommerceProducts(e){return e.allWooCommerceProducts},getAllWooCommerceCategories(e){return e.allWooCommerceCategories},getAllWooCommerceTags(e){return e.allWooCommerceTags},getTutorialSeen(e){return e.tutorialSeen},getFormEditorUrl(e){return e.formEditorUrl},getTutorialUrl(e){return e.tutorialUrl},getClosestParentAttribute(e,t,n){return U5(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){return e.editorHistoryOffset>0},isUserAdministrator(e){return e.user.isAdministrator}};function W5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var G5=function e(t,n){function r(e,r,o){if("undefined"!=typeof document){"number"==typeof(o=W5({},n,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var a in o)o[a]&&(i+="; "+a,!0!==o[a]&&(i+="="+o[a].split(";")[0]));return document.cookie=e+"="+t.write(r,e)+i}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},o=0;o<n.length;o++){var i=n[o].split("="),a=i.slice(1).join("=");try{var s=decodeURIComponent(i[0]);if(r[s]=t.read(a,s),e===s)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){r(e,"",W5({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,W5({},this.attributes,t))},withConverter:function(t){return e(W5({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({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)}},{path:"/"}),q5=n(76944),K5=n(5837),Y5=n.n(K5);function X5(e,t){return`${e}-${Y5()(t.name,{lower:!0}).replace(/[^a-z0-9]+/g,"").replace(/-$/,"")}`}const J5=(0,Cw.jsxs)(F_.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,Cw.jsx)(F_.y$,{d:"M0,0h24v24H0V0z",fill:"none"}),(0,Cw.jsx)(F_.y$,{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,Cw.jsx)(F_.UL,{x:"6",y:"10",width:"2",height:"2"}),(0,Cw.jsx)(F_.UL,{x:"6",y:"14",width:"8",height:"2"}),(0,Cw.jsx)(F_.UL,{x:"16",y:"14",width:"2",height:"2"}),(0,Cw.jsx)(F_.UL,{x:"10",y:"10",width:"8",height:"2"})]});var Q5=n(73136),e3=n.n(Q5),t3=n(46251);function n3({isBusy:e,onDelete:t}){const n=(0,x.useCallback)((()=>{window.confirm(O2.MailPoet.I18n.t("customFieldDeleteConfirm"))&&t()}),[t]);return(0,Cw.jsx)(Gh.ZP,{isDestructive:!0,isLink:!0,isBusy:e,onClick:n,className:"button-on-top",children:O2.MailPoet.I18n.t("customFieldDeleteCTA")})}function r3({label:e,mandatory:t,dateType:n,dateFormat:r,defaultToday:o,dateSettings:i,isSaving:a,onSave:s,isDeleting:l,onCustomFieldDelete:c,onChange:u}){const[d,p]=(0,x.useState)(e),[h,m]=(0,x.useState)(t),[f,g]=(0,x.useState)(o),[b,v]=(0,x.useState)(n),[y,_]=(0,x.useState)(r),k=(0,x.useMemo)((()=>({label:d,mandatory:h,dateType:b,dateFormat:y,defaultToday:f})),[d,h,b,y,f]),w=h!==t||f!==o||b!==n||y!==r||d!==e;return(0,x.useEffect)((()=>{u&&u(k,w)}),[k,u,w]),(0,Cw.jsxs)("div",{className:"custom-field-settings",children:[(0,Cw.jsx)(QS.Z,{label:O2.MailPoet.I18n.t("label"),value:d,"data-automation-id":"settings_custom_date_label_input",onChange:p}),(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("blockMandatory"),checked:h,onChange:m}),(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("customFieldDefaultToday"),checked:f,onChange:g}),(0,Cw.jsx)(HZ.Z,{label:O2.MailPoet.I18n.t("customFieldDateType"),"data-automation-id":"settings_custom_date_type",value:b,onChange:e=>{v(e);const t=i.dateFormats[e];_(t[0])},options:i.dateTypes}),(()=>{const e=i.dateFormats[b];return Array.isArray(e)&&1===e.length?null:(0,Cw.jsx)(HZ.Z,{label:O2.MailPoet.I18n.t("customFieldDateFormat"),"data-automation-id":"settings_custom_date_format",value:y,onChange:e=>_(e),options:e.map((e=>({value:e,label:e})))})})(),s?(0,Cw.jsx)(Gh.ZP,{variant:"primary",onClick:()=>s({mandatory:h,dateType:b,dateFormat:y,defaultToday:f,label:d}),isBusy:a,disabled:a||!w,className:"button-on-top","data-automation-id":"custom_field_save",children:O2.MailPoet.I18n.t("customFieldSaveCTA")}):null,c?(0,Cw.jsx)(n3,{isBusy:a||l,onDelete:c}):null]})}n3.propTypes={isBusy:Z2().bool,onDelete:Z2().func},n3.defaultProps={isBusy:!1,onDelete:()=>{}},r3.propTypes={mandatory:Z2().bool,label:Z2().string,dateType:Z2().string,dateFormat:Z2().string,defaultToday:Z2().bool,onSave:Z2().func,isSaving:Z2().bool,dateSettings:Z2().shape({dateTypes:Z2().arrayOf(Z2().shape({label:Z2().string,value:Z2().string})),dateFormats:Z2().objectOf(Z2().arrayOf(Z2().string)),months:Z2().arrayOf(Z2().string)}).isRequired,isDeleting:Z2().bool,onCustomFieldDelete:Z2().func,onChange:Z2().func},r3.defaultProps={label:"",mandatory:!1,isSaving:!1,dateType:null,dateFormat:null,defaultToday:!1,isDeleting:!1,onCustomFieldDelete:null,onSave:null,onChange:null};const o3=e=>{const t=e.label?e.label:"";return e.mandatory?`${t} *`:t};function i3(e){const t=[];void 0!==e.placeholder&&t.push((0,Cw.jsx)("option",{value:"",children:e.placeholder},0));const n=e3()().year();for(let e=n;e>=n-100;e-=1)t.push((0,Cw.jsx)("option",{value:e,children:e},e));return(0,Cw.jsx)("select",{name:`${e.name}[year]`,value:e.year,onChange:e.onValueChange,className:R()({mailpoet_date_year:e.addDefaultClasses}),children:t})}function a3(e){const t=[];void 0!==e.placeholder&&t.push((0,Cw.jsx)("option",{value:"",children:e.placeholder},0));for(let n=1;n<=12;n+=1)t.push((0,Cw.jsx)("option",{value:n,children:e.monthNames[n-1]},n));return(0,Cw.jsx)("select",{name:`${e.name}[month]`,value:e.month,onChange:e.onValueChange,className:R()({mailpoet_date_month:e.addDefaultClasses}),children:t})}function s3(e){const t=[];void 0!==e.placeholder&&t.push((0,Cw.jsx)("option",{value:"",children:e.placeholder},0));for(let e=1;e<=31;e+=1)t.push((0,Cw.jsx)("option",{value:e,children:e},e));return(0,Cw.jsx)("select",{name:`${e.name}[day]`,value:e.day,onChange:e.onValueChange,className:R()({mailpoet_date_day:e.addDefaultClasses}),children:t})}i3.propTypes={name:Z2().string.isRequired,placeholder:Z2().string.isRequired,onValueChange:Z2().func.isRequired,year:Z2().oneOfType([Z2().string,Z2().number]).isRequired,addDefaultClasses:Z2().bool.isRequired},a3.propTypes={name:Z2().string.isRequired,placeholder:Z2().string.isRequired,onValueChange:Z2().func.isRequired,month:Z2().oneOfType([Z2().string,Z2().number]).isRequired,monthNames:Z2().arrayOf(Z2().string).isRequired,addDefaultClasses:Z2().bool.isRequired},s3.propTypes={name:Z2().string.isRequired,placeholder:Z2().string.isRequired,onValueChange:Z2().func.isRequired,day:Z2().oneOfType([Z2().string,Z2().number]).isRequired,addDefaultClasses:Z2().bool.isRequired};class l3 extends x.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,r=null;if(null!==t&&3===t.length){[,n,r]=t;const o=Number(e.target.value);this.setState({[`${r}`]:o},(()=>{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=e3()(e);this.setState({year:t.format("YYYY"),month:t.format("M"),day:t.format("D")})}render(){const e=window.mailpoet_month_names||[];let t=(window.mailpoet_date_formats||{})[this.props.field.params.date_type][0];this.props.field.params.date_format&&(t=this.props.field.params.date_format);const n=t.split("/").map((t=>{switch(t){case"YYYY":return(0,Cw.jsx)(i3,{onValueChange:this.onValueChange,name:this.props.field.name,addDefaultClasses:this.props.addDefaultClasses,year:this.state.year,placeholder:this.props.field.year_placeholder},"year");case"MM":return(0,Cw.jsx)(a3,{onValueChange:this.onValueChange,name:this.props.field.name,addDefaultClasses:this.props.addDefaultClasses,month:this.state.month,monthNames:e,placeholder:this.props.field.month_placeholder},"month");case"DD":return(0,Cw.jsx)(s3,{onValueChange:this.onValueChange,name:this.props.field.name,addDefaultClasses:this.props.addDefaultClasses,day:this.state.day,placeholder:this.props.field.day_placeholder},"day");default:return(0,Cw.jsx)("div",{children:"Invalid date type"})}}));return(0,Cw.jsx)("div",{children:n})}}function c3({children:e,className:t}){return(0,Cw.jsx)("div",{className:R()("mailpoet_paragraph",t),children:e})}function u3(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 d3({attributes:e,setAttributes:t,clientId:n}){const r=(0,yl.Z)((e=>e(H2).getIsCustomFieldSaving()),[]),o=(0,yl.Z)((e=>e(H2).getDateSettingsData()),[]),i=(0,yl.Z)((e=>e(H2).getIsCustomFieldDeleting()),[]),{saveCustomField:a,deleteCustomField:s,customFieldEdited:l}=(0,_l.Z)(H2),c=(0,Cw.jsx)(qI,{children:(0,Cw.jsx)(t3.Z,{children:(0,Cw.jsx)(tI.ZP,{title:O2.MailPoet.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,Cw.jsx)(r3,{label:e.label,mandatory:e.mandatory,dateSettings:o,defaultToday:e.defaultToday,dateFormat:e.dateFormat,dateType:e.dateType,isSaving:r,onSave:n=>a({customFieldId:e.customFieldId,data:{params:u3("date",n)},onFinish:()=>t({mandatory:n.mandatory,dateType:n.dateType,dateFormat:n.dateFormat,defaultToday:n.defaultToday,label:n.label})}),onCustomFieldDelete:()=>s(e.customFieldId,n),isDeleting:i,onChange:(e,t)=>t&&l()})})})});return(0,Cw.jsx)(c3,{className:e.className,children:(0,Cw.jsxs)("div",{className:"mailpoet_custom_date",children:[c,(0,Cw.jsx)("label",{className:"mailpoet_date_label","data-automation-id":"editor_custom_date_label",htmlFor:n,children:o3(e)}),(0,Cw.jsx)(l3,{field:{name:n,day_placeholder:O2.MailPoet.I18n.t("customFieldDay"),month_placeholder:O2.MailPoet.I18n.t("customFieldMonth"),year_placeholder:O2.MailPoet.I18n.t("customFieldYear"),params:{date_type:e.dateType,date_format:e.dateFormat}},item:{[n]:e.defaultToday?e3()().format("YYYY-MM-DD"):""},addDefaultClasses:!0,onValueChange:()=>{}})]})})}function p3(e){return{title:e.name,description:"",icon:J5,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:d3,save(){return null}}}l3.propTypes={item:Z2().object.isRequired,field:Z2().shape({name:Z2().string,day_placeholder:Z2().string,month_placeholder:Z2().string,year_placeholder:Z2().string,params:Z2().object}).isRequired,onValueChange:Z2().func.isRequired,addDefaultClasses:Z2().bool},l3.defaultProps={addDefaultClasses:!1},c3.propTypes={children:Z2().node.isRequired,className:Z2().string},c3.defaultProps={className:""},d3.propTypes={attributes:Z2().shape({label:Z2().string.isRequired,dateFormat:Z2().string.isRequired,dateType:Z2().string.isRequired,defaultToday:Z2().bool,mandatory:Z2().bool.isRequired,customFieldId:Z2().number.isRequired,className:Z2().string}).isRequired,clientId:Z2().string.isRequired,setAttributes:Z2().func.isRequired};const h3={fullWidth:!0,inheritFromTheme:!0},m3={fullWidth:!1,inheritFromTheme:!0},f3=e=>{if(!e)return m3;const t={fullWidth:"1"===e.full_width||!0===e.full_width,inheritFromTheme:!(0,$2.has)(e,"bold")};return t.inheritFromTheme||(t.bold="1"===e.bold||!0===e.bold,(0,$2.has)(e,"background_color")&&e.background_color&&(t.backgroundColor=e.background_color),(0,$2.has)(e,"gradient")&&e.gradient&&(t.gradient=e.gradient),(0,$2.has)(e,"border_size")&&void 0!==e.border_size&&(t.borderSize=Number(e.border_size)),(0,$2.has)(e,"font_size")&&void 0!==e.font_size&&(t.fontSize=Number(e.font_size)),(0,$2.has)(e,"font_color")&&e.font_color&&(t.fontColor=e.font_color),(0,$2.has)(e,"border_radius")&&void 0!==e.border_radius&&(t.borderRadius=Number(e.border_radius)),(0,$2.has)(e,"border_color")&&e.border_color&&(t.borderColor=e.border_color),(0,$2.has)(e,"padding")&&void 0!==e.padding&&(t.padding=Number(e.padding)),(0,$2.has)(e,"font_family")&&e.font_family&&(t.fontFamily=e.font_family)),t},g3=(e,t)=>{const n=e.find((e=>e.color===t));return n?n.slug:void 0},b3=(e,t)=>{const n=e.find((e=>e.gradient===t));return n?n.slug:void 0};function v3({label:e,mandatory:t,validate:n,isSaving:r,onSave:o,isDeleting:i,onCustomFieldDelete:a,onChange:s,fieldType:l}){const[c,u]=(0,x.useState)(e),[d,p]=(0,x.useState)(t),[h,m]=(0,x.useState)(n),f=(0,x.useMemo)((()=>({label:c,mandatory:d,validate:h})),[c,d,h]),g=d!==t||h!==n||c!==e;return(0,x.useEffect)((()=>{s&&s(f,g)}),[f,s,g,l]),(0,Cw.jsxs)(Cw.Fragment,{children:[(0,Cw.jsx)(QS.Z,{label:O2.MailPoet.I18n.t("label"),value:c,"data-automation-id":"settings_custom_text_label_input",onChange:u}),(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("blockMandatory"),checked:d,onChange:p}),(0,Cw.jsx)(HZ.Z,{label:`${O2.MailPoet.I18n.t("customFieldValidateFor")}:`,"data-automation-id":"settings_custom_text_input_validation_type",options:[{label:O2.MailPoet.I18n.t("customFieldValidateNothing"),value:""},{label:O2.MailPoet.I18n.t("customFieldValidateNumbersOnly"),value:"number"},{label:O2.MailPoet.I18n.t("customFieldValidateAlphanumerical"),value:"alphanum"},{label:O2.MailPoet.I18n.t("customFieldValidatePhoneNumber"),value:"phone"}],value:h,onChange:m}),o?(0,Cw.jsx)(Gh.ZP,{variant:"primary",onClick:()=>o(f),isBusy:r,disabled:r||i||!g,className:"button-on-top","data-automation-id":"custom_field_save",children:O2.MailPoet.I18n.t("customFieldSaveCTA")}):null,a?(0,Cw.jsx)(n3,{isBusy:r||i,onDelete:a}):null]})}v3.propTypes={label:Z2().string,mandatory:Z2().bool,validate:Z2().string,onSave:Z2().func,isSaving:Z2().bool,isDeleting:Z2().bool,onCustomFieldDelete:Z2().func,onChange:Z2().func,fieldType:Z2().string},v3.defaultProps={label:"",mandatory:!1,fieldType:"",isSaving:!1,validate:"",isDeleting:!1,onCustomFieldDelete:null,onSave:null,onChange:null};const y3=({setting:e,children:t,panelId:n,...r})=>(0,x.createElement)(_F,{hasValue:()=>!!e.colorValue||!!e.gradientValue,label:e.label,onDeselect:()=>{e.colorValue?e.onColorChange():e.gradientValue&&e.onGradientChange()},isShownByDefault:void 0===e.isShownByDefault||e.isShownByDefault,...r,className:"block-editor-tools-panel-color-gradient-settings__item",panelId:n,resetAllFilter:e.resetAllFilter},t),_3=({colorValue:e,label:t})=>(0,x.createElement)(wI.Z,{justify:"flex-start"},(0,x.createElement)(zZ,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:e}),(0,x.createElement)(tw.Z,{className:"block-editor-panel-color-gradient-settings__color-name",title:t},t)),k3=e=>({onToggle:t,isOpen:n})=>{const{colorValue:r,label:o}=e,i={onClick:t,className:R()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":n}),"aria-expanded":n};return(0,x.createElement)(Gh.ZP,{...i},(0,x.createElement)(_3,{colorValue:r,label:o}))};function w3({colors:e,disableCustomColors:t,disableCustomGradients:n,enableAlpha:r,gradients:o,settings:i,__experimentalIsRenderedInSidebar:a,...s}){let l;return a&&(l={placement:"left-start",offset:36,shift:!0}),(0,x.createElement)(x.Fragment,null,i.map(((i,c)=>{var u;const d={clearable:!1,colorValue:i.colorValue,colors:e,disableCustomColors:t,disableCustomGradients:n,enableAlpha:r,gradientValue:i.gradientValue,gradients:o,label:i.label,onColorChange:i.onColorChange,onGradientChange:i.onGradientChange,showTitle:!1,__experimentalIsRenderedInSidebar:a,...i},p={colorValue:null!==(u=i.gradientValue)&&void 0!==u?u:i.colorValue,label:i.label};return i&&(0,x.createElement)(y3,{key:c,setting:i,...s},(0,x.createElement)(pB.Z,{popoverProps:l,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:k3(p),renderContent:()=>(0,x.createElement)(gV,{paddingSize:"none"},(0,x.createElement)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content"},(0,x.createElement)(bU,{...d})))}))})))}const E3=["colors","disableCustomColors","gradients","disableCustomGradients"],C3=({className:e,colors:t,gradients:n,disableCustomColors:r,disableCustomGradients:o,children:i,settings:a,title:s,showTitle:l=!0,__experimentalIsRenderedInSidebar:c,enableAlpha:u})=>{const d=(0,tT.Z)(C3),{batch:p}=(0,Tf.Z)();return t&&0!==t.length||n&&0!==n.length||!r||!o||!a?.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,x.createElement)(VI,{className:R()("block-editor-panel-color-gradient-settings",e),label:l?s:void 0,resetAll:()=>{p((()=>{a.forEach((({colorValue:e,gradientValue:t,onColorChange:n,onGradientChange:r})=>{e?n():t&&r()}))}))},panelId:d,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},(0,x.createElement)(w3,{settings:a,panelId:d,colors:t,gradients:n,disableCustomColors:r,disableCustomGradients:o,__experimentalIsRenderedInSidebar:c,enableAlpha:u}),!!i&&(0,x.createElement)(x.Fragment,null,(0,x.createElement)(cD.Z,{marginY:4})," ",i)):null},x3=e=>{const t=mZ();return(0,x.createElement)(C3,{...t,...e})};var S3=e=>E3.every((t=>e.hasOwnProperty(t)))?(0,x.createElement)(C3,{...e}):(0,x.createElement)(x3,{...e});function I3({title:e,settings:t}){const n=YE("color.palette"),r=YE("color.gradients");return(0,Cw.jsx)("div",{children:(0,Cw.jsx)(S3,{title:e,colors:n,gradients:r,settings:t})})}I3.displayName="ColorGradientSettings";const T3=(0,D2.withBoundary)(I3);function N3({styles:e,onChange:t}){const n=(0,x.useRef)(e),r=n.current,{applyStylesToAllTextInputs:o}=(0,_l.Z)(H2),i=(e,r)=>{const o={...n.current};o[e]=r,t(o),n.current=o};return(0,Cw.jsx)(t3.Z,{className:"mailpoet-automation-input-styles-panel",children:(0,Cw.jsx)(tI.ZP,{title:O2.MailPoet.I18n.t("formSettingsStyles"),initialOpen:!1,children:(0,Cw.jsxs)("div",{className:"mailpoet-styles-settings","data-automation-id":"input_styles_settings",children:[(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("formSettingsDisplayFullWidth"),checked:r.fullWidth,onChange:(0,$2.partial)(i,"fullWidth")}),(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("formSettingsInheritStyleFromTheme"),checked:r.inheritFromTheme,onChange:e=>{if(e)return void i("inheritFromTheme",e);const r={...n.current};r.backgroundColor="#ffffff",r.bold=!1,r.borderRadius=0,r.borderSize=1,r.borderColor="#313131",r.inheritFromTheme=e,t(r),n.current=r},className:"mailpoet-automation-inherit-theme-toggle"}),r.inheritFromTheme?null:(0,Cw.jsxs)(Cw.Fragment,{children:[(0,Cw.jsx)(T3,{title:O2.MailPoet.I18n.t("formSettingsColor"),settings:[{label:O2.MailPoet.I18n.t("formSettingsStylesFont"),colorValue:r.fontColor,onColorChange:(0,$2.partial)(i,"fontColor")},{label:O2.MailPoet.I18n.t("formSettingsStylesBackground"),colorValue:r.backgroundColor,onColorChange:(0,$2.partial)(i,"backgroundColor")},{label:O2.MailPoet.I18n.t("formSettingsBorder"),colorValue:r.borderColor,onColorChange:(0,$2.partial)(i,"borderColor")}]}),(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("formSettingsBold"),checked:r.bold||!1,onChange:(0,$2.partial)(i,"bold"),className:"mailpoet-automation-styles-bold-toggle"}),(0,Cw.jsx)(CS,{label:O2.MailPoet.I18n.t("formSettingsBorderSize"),value:void 0===r.borderSize?1:r.borderSize,min:0,max:10,allowReset:!0,onChange:(0,$2.partial)(i,"borderSize"),className:"mailpoet-automation-styles-border-size"}),(0,Cw.jsx)(CS,{label:O2.MailPoet.I18n.t("formSettingsBorderRadius"),value:void 0===r.borderRadius?1:r.borderRadius,min:0,max:40,allowReset:!0,onChange:(0,$2.partial)(i,"borderRadius"),className:"mailpoet-automation-styles-border-radius-size"})]}),(0,Cw.jsx)("div",{children:(0,Cw.jsx)(Gh.ZP,{variant:"primary",onClick:()=>o(r),"data-automation-id":"styles_apply_to_all",children:O2.MailPoet.I18n.t("formSettingsApplyToAll")})})]})})})}const P3=Z2().shape({fullWidth:Z2().bool.isRequired,inheritFromTheme:Z2().bool.isRequired,bold:Z2().bool,backgroundColor:Z2().string,borderSize:Z2().number,borderRadius:Z2().number,borderColor:Z2().string});let R3=function(e){return e.Left="left",e.Center="center",e.Right="right",e}({});function A3(e){return e===R3.Right?"0 0 0 auto":e===R3.Center?"0 auto":"auto 0"}function B3({label:e,labelWithinInput:t,name:n,mandatory:r,styles:o,className:i}){const a=(0,yl.Z)((e=>e(H2).getFormSettings()),[]),s=(0,x.useRef)(null),l=`${n}_${Math.random().toString(36).substring(2,15)}`,[c,u]=(0,x.useState)(""),d=o.inheritFromTheme?{}:{fontWeight:o.bold?"bold":"inherit"},p=o.inheritFromTheme?{}:{borderRadius:o.borderRadius?`${o.borderRadius}px`:0,borderWidth:void 0!==o.borderSize?`${o.borderSize}px`:"1px",borderColor:o.borderColor||"initial",borderStyle:"solid"};void 0!==a.inputPadding&&(p.padding=a.inputPadding),void 0!==a.inputPadding&&(p.padding=a.inputPadding),void 0!==a.alignment&&(p.textAlign=a.alignment,p.margin=A3(p.textAlign)),o.fullWidth&&(p.width="100%"),o.backgroundColor&&!o.inheritFromTheme&&(p.backgroundColor=o.backgroundColor);const h={};return o.fontColor&&!o.inheritFromTheme&&(p.color=o.fontColor,t&&(h.color=o.fontColor)),(0,Cw.jsxs)(c3,{className:i,children:[t?null:(0,Cw.jsx)("label",{className:"mailpoet_text_label","data-automation-id":`editor_${n}_label`,htmlFor:l,style:d,children:o3({label:e,mandatory:r})}),(e=>{let t=`#${l}::placeholder {`;return void 0!==h.color&&(t+=`color: ${h.color};`),a.fontFamily&&(t+=`font-family: ${a.fontFamily};`),t+="}",(0,Cw.jsxs)(Cw.Fragment,{children:[(0,Cw.jsx)("style",{children:t}),(0,Cw.jsx)("input",{id:l,ref:s,className:"mailpoet_text",type:"text",name:n,value:c,onChange:()=>u(""),placeholder:e,"data-automation-id":`editor_${n}_input`,style:p,autoComplete:"off"})]})})(t?o3({label:e,mandatory:r}):"")]})}function L3({attributes:e,setAttributes:t,clientId:n}){const r=(0,yl.Z)((e=>e(H2).getIsCustomFieldSaving()),[]),o=(0,yl.Z)((e=>e(H2).getIsCustomFieldDeleting()),[]),{saveCustomField:i,deleteCustomField:a,customFieldEdited:s}=(0,_l.Z)(H2),l=(0,Cw.jsxs)(qI,{children:[(0,Cw.jsx)(t3.Z,{children:(0,Cw.jsx)(tI.ZP,{title:O2.MailPoet.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,Cw.jsx)(v3,{updateAttributes:e=>t(e),customFieldId:e.customFieldId,label:e.label,mandatory:e.mandatory,validate:e.validate,isSaving:r,onSave:n=>{i({customFieldId:e.customFieldId,data:{params:u3("text",n)},onFinish:()=>t({mandatory:n.mandatory,validate:n.validate,label:n.label})})},onCustomFieldDelete:()=>a(e.customFieldId,n),isDeleting:o,onChange:(e,t)=>t&&s()})})}),(0,Cw.jsx)(t3.Z,{children:(0,Cw.jsx)(tI.ZP,{title:O2.MailPoet.I18n.t("customFieldsFormSettings"),initialOpen:!0,children:(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("displayLabelWithinInput"),checked:e.labelWithinInput,onChange:e=>t({labelWithinInput:e})})})}),(0,Cw.jsx)(N3,{styles:e.styles,onChange:e=>t({styles:e})})]});return(0,Cw.jsxs)(Cw.Fragment,{children:[l,(0,Cw.jsx)(B3,{className:e.className,name:"custom_text",mandatory:e.mandatory,labelWithinInput:e.labelWithinInput,label:e.label,styles:e.styles})]})}function M3(e){return{title:e.name,description:"",icon:J5,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:h3}},supports:{html:!1,multiple:!1},edit:L3,save(){return null}}}function D3({name:e,attributes:t,setAttributes:n,clientId:r}){const o=`${e.replace(/[^a-zA-Z]/g,"")}_${Math.random().toString(36).substring(2,15)}`,i=(0,yl.Z)((e=>e(H2).getFormSettings()),[]),a=(0,yl.Z)((e=>e(H2).getIsCustomFieldSaving()),[]),s=(0,yl.Z)((e=>e(H2).getIsCustomFieldDeleting()),[]),[l,c]=(0,x.useState)(""),{saveCustomField:u,deleteCustomField:d,customFieldEdited:p}=(0,_l.Z)(H2),h=(0,Cw.jsxs)(qI,{children:[(0,Cw.jsx)(t3.Z,{children:(0,Cw.jsx)(tI.ZP,{title:O2.MailPoet.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,Cw.jsx)(v3,{label:t.label,mandatory:t.mandatory,validate:t.validate,isSaving:a,onSave:e=>u({customFieldId:t.customFieldId,data:{params:u3("textarea",e)},onFinish:()=>n({mandatory:e.mandatory,validate:e.validate,lines:e.lines,label:e.label})}),onCustomFieldDelete:()=>d(t.customFieldId,r),isDeleting:s,onChange:(e,t)=>t&&p()})})}),(0,Cw.jsx)(t3.Z,{children:(0,Cw.jsxs)(tI.ZP,{title:O2.MailPoet.I18n.t("formSettings"),initialOpen:!0,children:[(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("displayLabelWithinInput"),checked:t.labelWithinInput,onChange:e=>n({labelWithinInput:e})}),(0,Cw.jsx)(HZ.Z,{label:`${O2.MailPoet.I18n.t("customFieldNumberOfLines")}:`,"data-automation-id":"settings_custom_text_area_number_of_lines",value:t.lines,options:[{label:O2.MailPoet.I18n.t("customField1Line"),value:"1"},{label:O2.MailPoet.I18n.t("customField2Lines"),value:"2"},{label:O2.MailPoet.I18n.t("customField3Lines"),value:"3"},{label:O2.MailPoet.I18n.t("customField4Lines"),value:"4"},{label:O2.MailPoet.I18n.t("customField5Lines"),value:"5"}],onChange:e=>n({lines:e})})]})}),(0,Cw.jsx)(N3,{styles:t.styles,onChange:e=>n({styles:e})})]}),m=t.styles.inheritFromTheme?{}:{fontWeight:t.styles.bold?"bold":"inherit"},f=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&&(f.width="100%"),t.styles.backgroundColor&&!t.styles.inheritFromTheme&&(f.backgroundColor=t.styles.backgroundColor),void 0!==i.inputPadding&&(f.padding=i.inputPadding),void 0!==i.alignment&&(f.textAlign=i.alignment,f.margin=A3(f.textAlign)),f.resize="none";const g={};t.styles.fontColor&&!t.styles.inheritFromTheme&&(f.color=t.styles.fontColor,t.labelWithinInput&&(g.color=t.styles.fontColor));const b=(0,x.useRef)(null),v=e=>{let n=`#${o}::placeholder {`;return void 0!==g.color&&(n+=`color: ${g.color};`),i.fontFamily&&(n+=`font-family: ${i.fontFamily};`),n+="}",(0,Cw.jsxs)(Cw.Fragment,{children:[(0,Cw.jsx)("style",{children:n}),(0,Cw.jsx)("textarea",{id:o,ref:b,className:"mailpoet_textarea",name:"custom_text","data-automation-id":"editor_custom_textarea_input",rows:t.lines,style:f,onChange:()=>c(""),placeholder:e,value:l})]})};return(0,Cw.jsxs)(c3,{className:t.className,children:[h,t.labelWithinInput?v(o3(t)):(0,Cw.jsxs)(Cw.Fragment,{children:[(0,Cw.jsx)("label",{className:"mailpoet_textarea_label","data-automation-id":"editor_custom_text_label",htmlFor:o,style:m,children:o3(t)}),v("")]})]})}function O3(e){return{title:e.name,description:"",icon:J5,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:h3}},supports:{html:!1,multiple:!1},edit:D3,save(){return null}}}B3.propTypes={label:Z2().string.isRequired,labelWithinInput:Z2().bool.isRequired,name:Z2().string.isRequired,mandatory:Z2().bool.isRequired,className:Z2().string,styles:P3.isRequired},B3.defaultProps={className:""},L3.propTypes={attributes:Z2().shape({label:Z2().string.isRequired,validate:Z2().string,labelWithinInput:Z2().bool.isRequired,mandatory:Z2().bool.isRequired,customFieldId:Z2().number.isRequired,styles:P3.isRequired,className:Z2().string}).isRequired,setAttributes:Z2().func.isRequired,clientId:Z2().string.isRequired},D3.propTypes={attributes:Z2().shape({label:Z2().string.isRequired,customFieldId:Z2().number.isRequired,validate:Z2().string,labelWithinInput:Z2().bool.isRequired,mandatory:Z2().bool.isRequired,lines:Z2().string,styles:P3.isRequired,className:Z2().string}).isRequired,setAttributes:Z2().func.isRequired,clientId:Z2().string.isRequired,name:Z2().string.isRequired};var F3=n(31280),j3=n(82900),Z3=n(10328),z3=n(98566),V3=x.createContext(null),H3=function(e){e()},U3=function(){return H3},$3={notify:function(){},get:function(){return[]}};function W3(e,t){var n,r=$3;function o(){a.onStateChange&&a.onStateChange()}function i(){n||(n=t?t.addNestedSub(o):e.subscribe(o),r=function(){var e=U3(),t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())}var a={addNestedSub:function(e){return i(),r.subscribe(e)},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:o,isSubscribed:function(){return Boolean(n)},trySubscribe:i,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=$3)},getListeners:function(){return r}};return a}var G3="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?x.useLayoutEffect:x.useEffect,q3=function(e){var t=e.store,n=e.context,r=e.children,o=(0,x.useMemo)((function(){var e=W3(t);return{store:t,subscription:e}}),[t]),i=(0,x.useMemo)((function(){return t.getState()}),[t]);G3((function(){var e=o.subscription;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),i!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[o,i]);var a=n||V3;return x.createElement(a.Provider,{value:o},r)},K3=n(25914),Y3=n(30462),X3=n(26095),J3=n.n(X3),Q3=n(20503),e4=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],t4=["reactReduxForwardedRef"],n4=[],r4=[null,null];function o4(e,t){var n=e[1];return[t.payload,n+1]}function i4(e,t,n){G3((function(){return e.apply(void 0,t)}),n)}function a4(e,t,n,r,o,i,a){e.current=r,t.current=o,n.current=!1,i.current&&(i.current=null,a())}function s4(e,t,n,r,o,i,a,s,l,c){if(e){var u=!1,d=null,p=function(){if(!u){var e,n,p=t.getState();try{e=r(p,o.current)}catch(e){n=e,d=e}n||(d=null),e===i.current?a.current||l():(i.current=e,s.current=e,a.current=!0,c({type:"STORE_UPDATED",payload:{error:n}}))}};return n.onStateChange=p,n.trySubscribe(),p(),function(){if(u=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}}var l4=function(){return[null,0]};function c4(e,t){void 0===t&&(t={});var n=t,r=n.getDisplayName,o=void 0===r?function(e){return"ConnectAdvanced("+e+")"}:r,i=n.methodName,a=void 0===i?"connectAdvanced":i,s=n.renderCountProp,l=void 0===s?void 0:s,c=n.shouldHandleStateChanges,u=void 0===c||c,d=n.storeKey,p=void 0===d?"store":d,h=(n.withRef,n.forwardRef),m=void 0!==h&&h,f=n.context,g=void 0===f?V3:f,b=(0,Y3.Z)(n,e4),v=g;return function(t){var n=t.displayName||t.name||"Component",r=o(n),i=(0,K3.Z)({},b,{getDisplayName:o,methodName:a,renderCountProp:l,shouldHandleStateChanges:u,storeKey:p,displayName:r,wrappedComponentName:n,WrappedComponent:t}),s=b.pure,c=s?x.useMemo:function(e){return e()};function d(n){var r=(0,x.useMemo)((function(){var e=n.reactReduxForwardedRef,t=(0,Y3.Z)(n,t4);return[n.context,e,t]}),[n]),o=r[0],a=r[1],s=r[2],l=(0,x.useMemo)((function(){return o&&o.Consumer&&(0,Q3.isContextConsumer)(x.createElement(o.Consumer,null))?o:v}),[o,v]),d=(0,x.useContext)(l),p=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(d)&&Boolean(d.store);var h=p?n.store:d.store,m=(0,x.useMemo)((function(){return function(t){return e(t.dispatch,i)}(h)}),[h]),f=(0,x.useMemo)((function(){if(!u)return r4;var e=W3(h,p?null:d.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[h,p,d]),g=f[0],b=f[1],y=(0,x.useMemo)((function(){return p?d:(0,K3.Z)({},d,{subscription:g})}),[p,d,g]),_=(0,x.useReducer)(o4,n4,l4),k=_[0][0],w=_[1];if(k&&k.error)throw k.error;var E=(0,x.useRef)(),C=(0,x.useRef)(s),S=(0,x.useRef)(),I=(0,x.useRef)(!1),T=c((function(){return S.current&&s===C.current?S.current:m(h.getState(),s)}),[h,k,s]);i4(a4,[C,E,I,s,T,S,b]),i4(s4,[u,h,g,m,C,E,I,S,b,w],[h,g,m]);var N=(0,x.useMemo)((function(){return x.createElement(t,(0,K3.Z)({},T,{ref:a}))}),[a,t,T]);return(0,x.useMemo)((function(){return u?x.createElement(l.Provider,{value:y},N):N}),[l,N,y])}var h=s?x.memo(d):d;if(h.WrappedComponent=t,h.displayName=d.displayName=r,m){var f=x.forwardRef((function(e,t){return x.createElement(h,(0,K3.Z)({},e,{reactReduxForwardedRef:t}))}));return f.displayName=r,f.WrappedComponent=t,J3()(f,t)}return J3()(h,t)}}function u4(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function d4(e,t){if(u4(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(t,n[o])||!u4(e[n[o]],t[n[o]]))return!1;return!0}function p4(e){return function(t,n){var r=e(t,n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function h4(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function m4(e,t){return function(t,n){n.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=h4(e);var o=r(t,n);return"function"==typeof o&&(r.mapToProps=o,r.dependsOnOwnProps=h4(o),o=r(t,n)),o},r}}var f4=[function(e){return"function"==typeof e?m4(e):void 0},function(e){return e?void 0:p4((function(e){return{dispatch:e}}))},function(e){return e&&"object"==typeof e?p4((function(t){return function(e,t){var n={},r=function(r){var o=e[r];"function"==typeof o&&(n[r]=function(){return t(o.apply(void 0,arguments))})};for(var o in e)r(o);return n}(e,t)})):void 0}],g4=[function(e){return"function"==typeof e?m4(e):void 0},function(e){return e?void 0:p4((function(){return{}}))}];function b4(e,t,n){return(0,K3.Z)({},n,e,t)}var v4=[function(e){return"function"==typeof e?function(e){return function(t,n){n.displayName;var r,o=n.pure,i=n.areMergedPropsEqual,a=!1;return function(t,n,s){var l=e(t,n,s);return a?o&&i(l,r)||(r=l):(a=!0,r=l),r}}}(e):void 0},function(e){return e?void 0:function(){return b4}}],y4=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function _4(e,t,n,r){return function(o,i){return n(e(o,i),t(r,i),i)}}function k4(e,t,n,r,o){var i,a,s,l,c,u=o.areStatesEqual,d=o.areOwnPropsEqual,p=o.areStatePropsEqual,h=!1;return function(o,m){return h?function(o,h){var m,f,g=!d(h,a),b=!u(o,i,h,a);return i=o,a=h,g&&b?(s=e(i,a),t.dependsOnOwnProps&&(l=t(r,a)),c=n(s,l,a)):g?(e.dependsOnOwnProps&&(s=e(i,a)),t.dependsOnOwnProps&&(l=t(r,a)),c=n(s,l,a)):b?(m=e(i,a),f=!p(m,s),s=m,f&&(c=n(s,l,a)),c):c}(o,m):(s=e(i=o,a=m),l=t(r,a),c=n(s,l,a),h=!0,c)}}function w4(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,o=t.initMergeProps,i=(0,Y3.Z)(t,y4),a=n(e,i),s=r(e,i),l=o(e,i);return(i.pure?k4:_4)(a,s,l,e,i)}var E4=["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"];function C4(e,t,n){for(var r=t.length-1;r>=0;r--){var o=t[r](e);if(o)return o}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function x4(e,t){return e===t}function S4(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?c4:n,o=t.mapStateToPropsFactories,i=void 0===o?g4:o,a=t.mapDispatchToPropsFactories,s=void 0===a?f4:a,l=t.mergePropsFactories,c=void 0===l?v4:l,u=t.selectorFactory,d=void 0===u?w4:u;return function(e,t,n,o){void 0===o&&(o={});var a=o,l=a.pure,u=void 0===l||l,p=a.areStatesEqual,h=void 0===p?x4:p,m=a.areOwnPropsEqual,f=void 0===m?d4:m,g=a.areStatePropsEqual,b=void 0===g?d4:g,v=a.areMergedPropsEqual,y=void 0===v?d4:v,_=(0,Y3.Z)(a,E4),k=C4(e,i,"mapStateToProps"),w=C4(t,s,"mapDispatchToProps"),E=C4(n,c,"mergeProps");return r(d,(0,K3.Z)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:k,initMapDispatchToProps:w,initMergeProps:E,pure:u,areStatesEqual:h,areOwnPropsEqual:f,areStatePropsEqual:b,areMergedPropsEqual:y},_))}}var I4,T4=S4();I4=eT.unstable_batchedUpdates,H3=I4;var N4=n(86381),P4=function(e){var t=e.top,n=e.right,r=e.bottom,o=e.left;return{top:t,right:n,bottom:r,left:o,width:n-o,height:r-t,x:o,y:t,center:{x:(n+o)/2,y:(r+t)/2}}},R4=function(e,t){return{top:e.top-t.top,left:e.left-t.left,bottom:e.bottom+t.bottom,right:e.right+t.right}},A4=function(e,t){return{top:e.top+t.top,left:e.left+t.left,bottom:e.bottom-t.bottom,right:e.right-t.right}},B4={top:0,right:0,bottom:0,left:0},L4=function(e){var t=e.borderBox,n=e.margin,r=void 0===n?B4:n,o=e.border,i=void 0===o?B4:o,a=e.padding,s=void 0===a?B4:a,l=P4(R4(t,r)),c=P4(A4(t,i)),u=P4(A4(c,s));return{marginBox:l,borderBox:P4(t),paddingBox:c,contentBox:u,margin:r,border:i,padding:s}},M4=function(e){var t=e.slice(0,-2);if("px"!==e.slice(-2))return 0;var n=Number(t);return isNaN(n)&&(0,N4.Z)(!1),n},D4=function(e,t){var n,r,o=e.borderBox,i=e.border,a=e.margin,s=e.padding,l=(r=t,{top:(n=o).top+r.y,left:n.left+r.x,bottom:n.bottom+r.y,right:n.right+r.x});return L4({borderBox:l,border:i,margin:a,padding:s})},O4=function(e,t){return void 0===t&&(t={x:window.pageXOffset,y:window.pageYOffset}),D4(e,t)},F4=function(e,t){var n={top:M4(t.marginTop),right:M4(t.marginRight),bottom:M4(t.marginBottom),left:M4(t.marginLeft)},r={top:M4(t.paddingTop),right:M4(t.paddingRight),bottom:M4(t.paddingBottom),left:M4(t.paddingLeft)},o={top:M4(t.borderTopWidth),right:M4(t.borderRightWidth),bottom:M4(t.borderBottomWidth),left:M4(t.borderLeftWidth)};return L4({borderBox:e,margin:n,padding:r,border:o})},j4=function(e){var t=e.getBoundingClientRect(),n=window.getComputedStyle(e);return F4(t,n)},Z4=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function z4(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(r=e[n],o=t[n],!(r===o||Z4(r)&&Z4(o)))return!1;var r,o;return!0}var V4=function(e,t){var n;void 0===t&&(t=z4);var r,o=[],i=!1;return function(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];return i&&n===this&&t(a,o)||(r=e.apply(this,a),i=!0,n=this,o=a),r}},H4=function(e){var t=[],n=null,r=function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];t=o,n||(n=requestAnimationFrame((function(){n=null,e.apply(void 0,t)})))};return r.cancel=function(){n&&(cancelAnimationFrame(n),n=null)},r};function U4(e,t){}function $4(){}function W4(e,t,n){var r=t.map((function(t){var r,o,i=(r=n,o=t.options,(0,Z3.Z)({},r,{},o));return e.addEventListener(t.eventName,t.fn,i),function(){e.removeEventListener(t.eventName,t.fn,i)}}));return function(){r.forEach((function(e){e()}))}}U4.bind(null,"warn"),U4.bind(null,"error");var G4=!0,q4="Invariant failed";function K4(e){this.message=e}function Y4(e,t){if(!e)throw new K4(G4?q4:q4+": "+(t||""))}K4.prototype.toString=function(){return this.message};var X4=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).callbacks=null,t.unbind=$4,t.onWindowError=function(e){var n=t.getCallbacks();n.isDragging()&&n.tryAbort(),e.error instanceof K4&&e.preventDefault()},t.getCallbacks=function(){if(!t.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return t.callbacks},t.setCallbacks=function(e){t.callbacks=e},t}(0,j3.Z)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.unbind=W4(window,[{eventName:"error",fn:this.onWindowError}])},n.componentDidCatch=function(e){if(!(e instanceof K4))throw e;this.setState({})},n.componentWillUnmount=function(){this.unbind()},n.render=function(){return this.props.children(this.setCallbacks)},t}(x.Component),J4=function(e){return e+1},Q4=function(e,t){var n=e.droppableId===t.droppableId,r=J4(e.index),o=J4(t.index);return n?"\n You have moved the item from position "+r+"\n to position "+o+"\n ":"\n You have moved the item from position "+r+"\n in list "+e.droppableId+"\n to list "+t.droppableId+"\n in position "+o+"\n "},e8=function(e,t,n){return t.droppableId===n.droppableId?"\n The item "+e+"\n has been combined with "+n.draggableId:"\n The item "+e+"\n in list "+t.droppableId+"\n has been combined with "+n.draggableId+"\n in list "+n.droppableId+"\n "},t8=function(e){return"\n The item has returned to its starting position\n of "+J4(e.index)+"\n"},n8={dragHandleUsageInstructions:"\n Press space bar to start a drag.\n When dragging you can use the arrow keys to move the item around and escape to cancel.\n Some screen readers may require you to be in focus mode or to use your pass through key\n",onDragStart:function(e){return"\n You have lifted an item in position "+J4(e.source.index)+"\n"},onDragUpdate:function(e){var t=e.destination;if(t)return Q4(e.source,t);var n=e.combine;return n?e8(e.draggableId,e.source,n):"You are over an area that cannot be dropped on"},onDragEnd:function(e){if("CANCEL"===e.reason)return"\n Movement cancelled.\n "+t8(e.source)+"\n ";var t=e.destination,n=e.combine;return t?"\n You have dropped the item.\n "+Q4(e.source,t)+"\n ":n?"\n You have dropped the item.\n "+e8(e.draggableId,e.source,n)+"\n ":"\n The item has been dropped while not over a drop area.\n "+t8(e.source)+"\n "}},r8={x:0,y:0},o8=function(e,t){return{x:e.x+t.x,y:e.y+t.y}},i8=function(e,t){return{x:e.x-t.x,y:e.y-t.y}},a8=function(e,t){return e.x===t.x&&e.y===t.y},s8=function(e){return{x:0!==e.x?-e.x:0,y:0!==e.y?-e.y:0}},l8=function(e,t,n){var r;return void 0===n&&(n=0),(r={})[e]=t,r["x"===e?"y":"x"]=n,r},c8=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},u8=function(e,t){return Math.min.apply(Math,t.map((function(t){return c8(e,t)})))},d8=function(e){return function(t){return{x:e(t.x),y:e(t.y)}}},p8=function(e,t){return{top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}},h8=function(e){return[{x:e.left,y:e.top},{x:e.right,y:e.top},{x:e.left,y:e.bottom},{x:e.right,y:e.bottom}]},m8=function(e,t){return t&&t.shouldClipSubject?function(e,t){var n=P4({top:Math.max(t.top,e.top),right:Math.min(t.right,e.right),bottom:Math.min(t.bottom,e.bottom),left:Math.max(t.left,e.left)});return n.width<=0||n.height<=0?null:n}(t.pageMarginBox,e):P4(e)},f8=function(e){var t=e.page,n=e.withPlaceholder,r=e.axis,o=e.frame,i=function(e,t){return t?p8(e,t.scroll.diff.displacement):e}(t.marginBox,o),a=function(e,t,n){var r;return n&&n.increasedBy?(0,Z3.Z)({},e,((r={})[t.end]=e[t.end]+n.increasedBy[t.line],r)):e}(i,r,n);return{page:t,withPlaceholder:n,active:m8(a,o)}},g8=function(e,t){e.frame||Y4(!1);var n=e.frame,r=i8(t,n.scroll.initial),o=s8(r),i=(0,Z3.Z)({},n,{scroll:{initial:n.scroll.initial,current:t,diff:{value:r,displacement:o},max:n.scroll.max}}),a=f8({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:i});return(0,Z3.Z)({},e,{frame:i,subject:a})};function b8(e){return Object.values?Object.values(e):Object.keys(e).map((function(t){return e[t]}))}function v8(e,t){if(e.findIndex)return e.findIndex(t);for(var n=0;n<e.length;n++)if(t(e[n]))return n;return-1}function y8(e,t){if(e.find)return e.find(t);var n=v8(e,t);return-1!==n?e[n]:void 0}function _8(e){return Array.prototype.slice.call(e)}var k8=V4((function(e){return e.reduce((function(e,t){return e[t.descriptor.id]=t,e}),{})})),w8=V4((function(e){return e.reduce((function(e,t){return e[t.descriptor.id]=t,e}),{})})),E8=V4((function(e){return b8(e)})),C8=V4((function(e){return b8(e)})),x8=V4((function(e,t){var n=C8(t).filter((function(t){return e===t.descriptor.droppableId})).sort((function(e,t){return e.descriptor.index-t.descriptor.index}));return n}));function S8(e){return e.at&&"REORDER"===e.at.type?e.at.destination:null}function I8(e){return e.at&&"COMBINE"===e.at.type?e.at.combine:null}var T8=V4((function(e,t){return t.filter((function(t){return t.descriptor.id!==e.descriptor.id}))})),N8=function(e,t){return e.descriptor.droppableId===t.descriptor.id},P8={point:r8,value:0},R8={invisible:{},visible:{},all:[]},A8={displaced:R8,displacedBy:P8,at:null},B8=function(e,t){return function(n){return e<=n&&n<=t}},L8=function(e){var t=B8(e.top,e.bottom),n=B8(e.left,e.right);return function(r){if(t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right))return!0;var o=t(r.top)||t(r.bottom),i=n(r.left)||n(r.right);if(o&&i)return!0;var a=r.top<e.top&&r.bottom>e.bottom,s=r.left<e.left&&r.right>e.right;return!(!a||!s)||a&&i||s&&o}},M8=function(e){var t=B8(e.top,e.bottom),n=B8(e.left,e.right);return function(e){return t(e.top)&&t(e.bottom)&&n(e.left)&&n(e.right)}},D8={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},O8={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},F8=function(e){var t=e.target,n=e.destination,r=e.viewport,o=e.withDroppableDisplacement,i=e.isVisibleThroughFrameFn,a=o?function(e,t){var n=t.frame?t.frame.scroll.diff.displacement:r8;return p8(e,n)}(t,n):t;return function(e,t,n){return!!t.subject.active&&n(t.subject.active)(e)}(a,n,i)&&function(e,t,n){return n(t)(e)}(a,r,i)},j8=function(e){return F8((0,Z3.Z)({},e,{isVisibleThroughFrameFn:L8}))},Z8=function(e){return F8((0,Z3.Z)({},e,{isVisibleThroughFrameFn:M8}))},z8=function(e,t,n){if("boolean"==typeof n)return n;if(!t)return!0;var r=t.invisible,o=t.visible;if(r[e])return!1;var i=o[e];return!i||i.shouldAnimate};function V8(e){var t=e.afterDragging,n=e.destination,r=e.displacedBy,o=e.viewport,i=e.forceShouldAnimate,a=e.last;return t.reduce((function(e,t){var s=function(e,t){var n=e.page.marginBox,r={top:t.point.y,right:0,bottom:0,left:t.point.x};return P4(R4(n,r))}(t,r),l=t.descriptor.id;if(e.all.push(l),!j8({target:s,destination:n,viewport:o,withDroppableDisplacement:!0}))return e.invisible[t.descriptor.id]=!0,e;var c={draggableId:l,shouldAnimate:z8(l,a,i)};return e.visible[l]=c,e}),{all:[],visible:{},invisible:{}})}function H8(e){var t=e.insideDestination,n=e.inHomeList,r=e.displacedBy,o=e.destination,i=function(e,t){if(!e.length)return 0;var n=e[e.length-1].descriptor.index;return t.inHomeList?n:n+1}(t,{inHomeList:n});return{displaced:R8,displacedBy:r,at:{type:"REORDER",destination:{droppableId:o.descriptor.id,index:i}}}}function U8(e){var t=e.draggable,n=e.insideDestination,r=e.destination,o=e.viewport,i=e.displacedBy,a=e.last,s=e.index,l=e.forceShouldAnimate,c=N8(t,r);if(null==s)return H8({insideDestination:n,inHomeList:c,displacedBy:i,destination:r});var u=y8(n,(function(e){return e.descriptor.index===s}));if(!u)return H8({insideDestination:n,inHomeList:c,displacedBy:i,destination:r});var d=T8(t,n),p=n.indexOf(u);return{displaced:V8({afterDragging:d.slice(p),destination:r,displacedBy:i,last:a,viewport:o.frame,forceShouldAnimate:l}),displacedBy:i,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:s}}}}function $8(e,t){return Boolean(t.effected[e])}var W8=function(e,t){return t.margin[e.start]+t.borderBox[e.size]/2},G8=function(e,t,n){return t[e.crossAxisStart]+n.margin[e.crossAxisStart]+n.borderBox[e.crossAxisSize]/2},q8=function(e){var t=e.axis,n=e.moveRelativeTo,r=e.isMoving;return l8(t.line,n.marginBox[t.end]+W8(t,r),G8(t,n.marginBox,r))},K8=function(e){var t=e.axis,n=e.moveRelativeTo,r=e.isMoving;return l8(t.line,n.marginBox[t.start]-function(e,t){return t.margin[e.end]+t.borderBox[e.size]/2}(t,r),G8(t,n.marginBox,r))},Y8=function(e,t){var n=e.frame;return n?o8(t,n.scroll.diff.displacement):t},X8=function(e){var t=function(e){var t=e.impact,n=e.draggable,r=e.droppable,o=e.draggables,i=e.afterCritical,a=n.page.borderBox.center,s=t.at;return r&&s?"REORDER"===s.type?function(e){var t=e.impact,n=e.draggable,r=e.draggables,o=e.droppable,i=e.afterCritical,a=x8(o.descriptor.id,r),s=n.page,l=o.axis;if(!a.length)return function(e){var t=e.axis,n=e.moveInto,r=e.isMoving;return l8(t.line,n.contentBox[t.start]+W8(t,r),G8(t,n.contentBox,r))}({axis:l,moveInto:o.page,isMoving:s});var c=t.displaced,u=t.displacedBy,d=c.all[0];if(d){var p=r[d];if($8(d,i))return K8({axis:l,moveRelativeTo:p.page,isMoving:s});var h=D4(p.page,u.point);return K8({axis:l,moveRelativeTo:h,isMoving:s})}var m=a[a.length-1];if(m.descriptor.id===n.descriptor.id)return s.borderBox.center;if($8(m.descriptor.id,i)){var f=D4(m.page,s8(i.displacedBy.point));return q8({axis:l,moveRelativeTo:f,isMoving:s})}return q8({axis:l,moveRelativeTo:m.page,isMoving:s})}({impact:t,draggable:n,draggables:o,droppable:r,afterCritical:i}):function(e){var t=e.afterCritical,n=e.impact,r=e.draggables,o=I8(n);o||Y4(!1);var i=o.draggableId,a=r[i].page.borderBox.center,s=function(e){var t=e.displaced,n=e.afterCritical,r=e.combineWith,o=e.displacedBy,i=Boolean(t.visible[r]||t.invisible[r]);return $8(r,n)?i?r8:s8(o.point):i?o.point:r8}({displaced:n.displaced,afterCritical:t,combineWith:i,displacedBy:n.displacedBy});return o8(a,s)}({impact:t,draggables:o,afterCritical:i}):a}(e),n=e.droppable;return n?Y8(n,t):t},J8=function(e,t){var n=i8(t,e.scroll.initial),r=s8(n);return{frame:P4({top:t.y,bottom:t.y+e.frame.height,left:t.x,right:t.x+e.frame.width}),scroll:{initial:e.scroll.initial,max:e.scroll.max,current:t,diff:{value:n,displacement:r}}}};function Q8(e,t){return e.map((function(e){return t[e]}))}var e6=function(e){var t,n,r=e.pageBorderBoxCenter,o=e.draggable,i=(t=e.viewport,n=r,o8(t.scroll.diff.displacement,n)),a=i8(i,o.page.borderBox.center);return o8(o.client.borderBox.center,a)},t6=function(e){var t=e.draggable,n=e.destination,r=e.newPageBorderBoxCenter,o=e.viewport,i=e.withDroppableDisplacement,a=e.onlyOnMainAxis,s=void 0!==a&&a,l=i8(r,t.page.borderBox.center),c={target:p8(t.page.borderBox,l),destination:n,withDroppableDisplacement:i,viewport:o};return s?function(e){return F8((0,Z3.Z)({},e,{isVisibleThroughFrameFn:(t=e.destination.axis,function(e){var n=B8(e.top,e.bottom),r=B8(e.left,e.right);return function(e){return t===D8?n(e.top)&&n(e.bottom):r(e.left)&&r(e.right)}})}));var t}(c):Z8(c)},n6=function(e){var t=e.isMovingForward,n=e.draggable,r=e.destination,o=e.draggables,i=e.previousImpact,a=e.viewport,s=e.previousPageBorderBoxCenter,l=e.previousClientSelection,c=e.afterCritical;if(!r.isEnabled)return null;var u=x8(r.descriptor.id,o),d=N8(n,r),p=function(e){var t=e.isMovingForward,n=e.draggable,r=e.destination,o=e.insideDestination,i=e.previousImpact;if(!r.isCombineEnabled)return null;if(!S8(i))return null;function a(e){var t={type:"COMBINE",combine:{draggableId:e,droppableId:r.descriptor.id}};return(0,Z3.Z)({},i,{at:t})}var s=i.displaced.all,l=s.length?s[0]:null;if(t)return l?a(l):null;var c=T8(n,o);if(!l)return c.length?a(c[c.length-1].descriptor.id):null;var u=v8(c,(function(e){return e.descriptor.id===l}));-1===u&&Y4(!1);var d=u-1;return d<0?null:a(c[d].descriptor.id)}({isMovingForward:t,draggable:n,destination:r,insideDestination:u,previousImpact:i})||function(e){var t=e.isMovingForward,n=e.isInHomeList,r=e.draggable,o=e.draggables,i=e.destination,a=e.insideDestination,s=e.previousImpact,l=e.viewport,c=e.afterCritical,u=s.at;if(u||Y4(!1),"REORDER"===u.type){var d=function(e){var t=e.isMovingForward,n=e.isInHomeList,r=e.insideDestination,o=e.location;if(!r.length)return null;var i=o.index,a=t?i+1:i-1,s=r[0].descriptor.index,l=r[r.length-1].descriptor.index;return a<s||a>(n?l:l+1)?null:a}({isMovingForward:t,isInHomeList:n,location:u.destination,insideDestination:a});return null==d?null:U8({draggable:r,insideDestination:a,destination:i,viewport:l,last:s.displaced,displacedBy:s.displacedBy,index:d})}var p=function(e){var t=e.isMovingForward,n=e.draggables,r=e.combine,o=e.afterCritical;if(!e.destination.isCombineEnabled)return null;var i=r.draggableId,a=n[i].descriptor.index;return $8(i,o)?t?a:a-1:t?a+1:a}({isMovingForward:t,destination:i,displaced:s.displaced,draggables:o,combine:u.combine,afterCritical:c});return null==p?null:U8({draggable:r,insideDestination:a,destination:i,viewport:l,last:s.displaced,displacedBy:s.displacedBy,index:p})}({isMovingForward:t,isInHomeList:d,draggable:n,draggables:o,destination:r,insideDestination:u,previousImpact:i,viewport:a,afterCritical:c});if(!p)return null;var h=X8({impact:p,draggable:n,droppable:r,draggables:o,afterCritical:c});if(t6({draggable:n,destination:r,newPageBorderBoxCenter:h,viewport:a.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:e6({pageBorderBoxCenter:h,draggable:n,viewport:a}),impact:p,scrollJumpRequest:null};var m=i8(h,s),f=function(e){var t=e.impact,n=e.viewport,r=e.destination,o=e.draggables,i=e.maxScrollChange,a=J8(n,o8(n.scroll.current,i)),s=r.frame?g8(r,o8(r.frame.scroll.current,i)):r,l=t.displaced,c=V8({afterDragging:Q8(l.all,o),destination:r,displacedBy:t.displacedBy,viewport:a.frame,last:l,forceShouldAnimate:!1}),u=V8({afterDragging:Q8(l.all,o),destination:s,displacedBy:t.displacedBy,viewport:n.frame,last:l,forceShouldAnimate:!1}),d={},p={},h=[l,c,u];return l.all.forEach((function(e){var t=function(e,t){for(var n=0;n<t.length;n++){var r=t[n].visible[e];if(r)return r}return null}(e,h);t?p[e]=t:d[e]=!0})),(0,Z3.Z)({},t,{displaced:{all:l.all,invisible:d,visible:p}})}({impact:p,viewport:a,destination:r,draggables:o,maxScrollChange:m});return{clientSelection:l,impact:f,scrollJumpRequest:m}},r6=function(e){var t=e.subject.active;return t||Y4(!1),t},o6=function(e,t){var n=e.page.borderBox.center;return $8(e.descriptor.id,t)?i8(n,t.displacedBy.point):n},i6=function(e,t){var n=e.page.borderBox;return $8(e.descriptor.id,t)?p8(n,s8(t.displacedBy.point)):n},a6=V4((function(e,t){var n=t[e.line];return{value:n,point:l8(e.line,n)}})),s6=function(e,t){return(0,Z3.Z)({},e,{scroll:(0,Z3.Z)({},e.scroll,{max:t})})},l6=function(e,t,n){var r=e.frame;N8(t,e)&&Y4(!1),e.subject.withPlaceholder&&Y4(!1);var o=a6(e.axis,t.displaceBy).point,i=function(e,t,n){var r=e.axis;if("virtual"===e.descriptor.mode)return l8(r.line,t[r.line]);var o=e.subject.page.contentBox[r.size],i=x8(e.descriptor.id,n).reduce((function(e,t){return e+t.client.marginBox[r.size]}),0)+t[r.line]-o;return i<=0?null:l8(r.line,i)}(e,o,n),a={placeholderSize:o,increasedBy:i,oldFrameMaxScroll:e.frame?e.frame.scroll.max:null};if(!r){var s=f8({page:e.subject.page,withPlaceholder:a,axis:e.axis,frame:e.frame});return(0,Z3.Z)({},e,{subject:s})}var l=i?o8(r.scroll.max,i):r.scroll.max,c=s6(r,l),u=f8({page:e.subject.page,withPlaceholder:a,axis:e.axis,frame:c});return(0,Z3.Z)({},e,{subject:u,frame:c})},c6=function(e){var t=e.at;return t?"REORDER"===t.type?t.destination.droppableId:t.combine.droppableId:null},u6=function(e){var t=e.state,n=e.type,r=function(e,t){var n=c6(e);return n?t[n]:null}(t.impact,t.dimensions.droppables),o=Boolean(r),i=t.dimensions.droppables[t.critical.droppable.id],a=r||i,s=a.axis.direction,l="vertical"===s&&("MOVE_UP"===n||"MOVE_DOWN"===n)||"horizontal"===s&&("MOVE_LEFT"===n||"MOVE_RIGHT"===n);if(l&&!o)return null;var c="MOVE_DOWN"===n||"MOVE_RIGHT"===n,u=t.dimensions.draggables[t.critical.draggable.id],d=t.current.page.borderBoxCenter,p=t.dimensions,h=p.draggables,m=p.droppables;return l?n6({isMovingForward:c,previousPageBorderBoxCenter:d,draggable:u,destination:a,draggables:h,viewport:t.viewport,previousClientSelection:t.current.client.selection,previousImpact:t.impact,afterCritical:t.afterCritical}):function(e){var t=e.isMovingForward,n=e.previousPageBorderBoxCenter,r=e.draggable,o=e.isOver,i=e.draggables,a=e.droppables,s=e.viewport,l=e.afterCritical,c=function(e){var t=e.isMovingForward,n=e.pageBorderBoxCenter,r=e.source,o=e.droppables,i=e.viewport,a=r.subject.active;if(!a)return null;var s=r.axis,l=B8(a[s.start],a[s.end]),c=E8(o).filter((function(e){return e!==r})).filter((function(e){return e.isEnabled})).filter((function(e){return Boolean(e.subject.active)})).filter((function(e){return L8(i.frame)(r6(e))})).filter((function(e){var n=r6(e);return t?a[s.crossAxisEnd]<n[s.crossAxisEnd]:n[s.crossAxisStart]<a[s.crossAxisStart]})).filter((function(e){var t=r6(e),n=B8(t[s.start],t[s.end]);return l(t[s.start])||l(t[s.end])||n(a[s.start])||n(a[s.end])})).sort((function(e,n){var r=r6(e)[s.crossAxisStart],o=r6(n)[s.crossAxisStart];return t?r-o:o-r})).filter((function(e,t,n){return r6(e)[s.crossAxisStart]===r6(n[0])[s.crossAxisStart]}));if(!c.length)return null;if(1===c.length)return c[0];var u=c.filter((function(e){return B8(r6(e)[s.start],r6(e)[s.end])(n[s.line])}));return 1===u.length?u[0]:u.length>1?u.sort((function(e,t){return r6(e)[s.start]-r6(t)[s.start]}))[0]:c.sort((function(e,t){var r=u8(n,h8(r6(e))),o=u8(n,h8(r6(t)));return r!==o?r-o:r6(e)[s.start]-r6(t)[s.start]}))[0]}({isMovingForward:t,pageBorderBoxCenter:n,source:o,droppables:a,viewport:s});if(!c)return null;var u=x8(c.descriptor.id,i),d=function(e){var t=e.pageBorderBoxCenter,n=e.viewport,r=e.destination,o=e.afterCritical,i=e.insideDestination.filter((function(e){return Z8({target:i6(e,o),destination:r,viewport:n.frame,withDroppableDisplacement:!0})})).sort((function(e,n){var i=c8(t,Y8(r,o6(e,o))),a=c8(t,Y8(r,o6(n,o)));return i<a?-1:a<i?1:e.descriptor.index-n.descriptor.index}));return i[0]||null}({pageBorderBoxCenter:n,viewport:s,destination:c,insideDestination:u,afterCritical:l}),p=function(e){var t=e.previousPageBorderBoxCenter,n=e.moveRelativeTo,r=e.insideDestination,o=e.draggable,i=e.draggables,a=e.destination,s=e.viewport,l=e.afterCritical;if(!n){if(r.length)return null;var c={displaced:R8,displacedBy:P8,at:{type:"REORDER",destination:{droppableId:a.descriptor.id,index:0}}},u=X8({impact:c,draggable:o,droppable:a,draggables:i,afterCritical:l}),d=N8(o,a)?a:l6(a,o,i);return t6({draggable:o,destination:d,newPageBorderBoxCenter:u,viewport:s.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0})?c:null}var p,h=Boolean(t[a.axis.line]<=n.page.borderBox.center[a.axis.line]),m=(p=n.descriptor.index,n.descriptor.id===o.descriptor.id||h?p:p+1);return U8({draggable:o,insideDestination:r,destination:a,viewport:s,displacedBy:a6(a.axis,o.displaceBy),last:R8,index:m})}({previousPageBorderBoxCenter:n,destination:c,draggable:r,draggables:i,moveRelativeTo:d,insideDestination:u,viewport:s,afterCritical:l});if(!p)return null;var h=X8({impact:p,draggable:r,droppable:c,draggables:i,afterCritical:l});return{clientSelection:e6({pageBorderBoxCenter:h,draggable:r,viewport:s}),impact:p,scrollJumpRequest:null}}({isMovingForward:c,previousPageBorderBoxCenter:d,draggable:u,isOver:a,draggables:h,droppables:m,viewport:t.viewport,afterCritical:t.afterCritical})};function d6(e){return"DRAGGING"===e.phase||"COLLECTING"===e.phase}function p6(e){var t=B8(e.top,e.bottom),n=B8(e.left,e.right);return function(e){return t(e.y)&&n(e.x)}}var h6=function(e,t){return P4(p8(e,t))};function m6(e){var t=e.displaced,n=e.id;return Boolean(t.visible[n]||t.invisible[n])}var f6=function(e){var t=e.pageOffset,n=e.draggable,r=e.draggables,o=e.droppables,i=e.previousImpact,a=e.viewport,s=e.afterCritical,l=h6(n.page.borderBox,t),c=function(e){var t=e.pageBorderBox,n=e.draggable,r=e.droppables,o=E8(r).filter((function(e){if(!e.isEnabled)return!1;var n,r,o=e.subject.active;if(!o)return!1;if(r=o,!((n=t).left<r.right&&n.right>r.left&&n.top<r.bottom&&n.bottom>r.top))return!1;if(p6(o)(t.center))return!0;var i=e.axis,a=o.center[i.crossAxisLine],s=t[i.crossAxisStart],l=t[i.crossAxisEnd],c=B8(o[i.crossAxisStart],o[i.crossAxisEnd]),u=c(s),d=c(l);return!u&&!d||(u?s<a:l>a)}));return o.length?1===o.length?o[0].descriptor.id:function(e){var t=e.pageBorderBox,n=e.candidates,r=e.draggable.page.borderBox.center,o=n.map((function(e){var n=e.axis,o=l8(e.axis.line,t.center[n.line],e.page.borderBox.center[n.crossAxisLine]);return{id:e.descriptor.id,distance:c8(r,o)}})).sort((function(e,t){return t.distance-e.distance}));return o[0]?o[0].id:null}({pageBorderBox:t,draggable:n,candidates:o}):null}({pageBorderBox:l,draggable:n,droppables:o});if(!c)return A8;var u=o[c],d=x8(u.descriptor.id,r),p=function(e,t){var n=e.frame;return n?h6(t,n.scroll.diff.value):t}(u,l);return function(e){var t=e.draggable,n=e.pageBorderBoxWithDroppableScroll,r=e.previousImpact,o=e.destination,i=e.insideDestination,a=e.afterCritical;if(!o.isCombineEnabled)return null;var s=o.axis,l=a6(o.axis,t.displaceBy),c=l.value,u=n[s.start],d=n[s.end],p=y8(T8(t,i),(function(e){var t=e.descriptor.id,n=e.page.borderBox,o=n[s.size]/4,i=$8(t,a),l=m6({displaced:r.displaced,id:t});return i?l?d>n[s.start]+o&&d<n[s.end]-o:u>n[s.start]-c+o&&u<n[s.end]-c-o:l?d>n[s.start]+c+o&&d<n[s.end]+c-o:u>n[s.start]+o&&u<n[s.end]-o}));return p?{displacedBy:l,displaced:r.displaced,at:{type:"COMBINE",combine:{draggableId:p.descriptor.id,droppableId:o.descriptor.id}}}:null}({pageBorderBoxWithDroppableScroll:p,draggable:n,previousImpact:i,destination:u,insideDestination:d,afterCritical:s})||function(e){var t=e.pageBorderBoxWithDroppableScroll,n=e.draggable,r=e.destination,o=e.insideDestination,i=e.last,a=e.viewport,s=e.afterCritical,l=r.axis,c=a6(r.axis,n.displaceBy),u=c.value,d=t[l.start],p=t[l.end],h=y8(T8(n,o),(function(e){var t=e.descriptor.id,n=e.page.borderBox.center[l.line],r=$8(t,s),o=m6({displaced:i,id:t});return r?o?p<=n:d<n-u:o?p<=n+u:d<n})),m=function(e){var t=e.draggable,n=e.closest;return n?e.inHomeList&&n.descriptor.index>t.descriptor.index?n.descriptor.index-1:n.descriptor.index:null}({draggable:n,closest:h,inHomeList:N8(n,r)});return U8({draggable:n,insideDestination:o,destination:r,viewport:a,last:i,displacedBy:c,index:m})}({pageBorderBoxWithDroppableScroll:p,draggable:n,destination:u,insideDestination:d,last:i.displaced,viewport:a,afterCritical:s})},g6=function(e,t){var n;return(0,Z3.Z)({},e,((n={})[t.descriptor.id]=t,n))},b6=function(e){var t=e.state,n=e.clientSelection,r=e.dimensions,o=e.viewport,i=e.impact,a=e.scrollJumpRequest,s=o||t.viewport,l=r||t.dimensions,c=n||t.current.client.selection,u=i8(c,t.initial.client.selection),d={offset:u,selection:c,borderBoxCenter:o8(t.initial.client.borderBoxCenter,u)},p={selection:o8(d.selection,s.scroll.current),borderBoxCenter:o8(d.borderBoxCenter,s.scroll.current),offset:o8(d.offset,s.scroll.diff.value)},h={client:d,page:p};if("COLLECTING"===t.phase)return(0,Z3.Z)({phase:"COLLECTING"},t,{dimensions:l,viewport:s,current:h});var m=l.draggables[t.critical.draggable.id],f=i||f6({pageOffset:p.offset,draggable:m,draggables:l.draggables,droppables:l.droppables,previousImpact:t.impact,viewport:s,afterCritical:t.afterCritical}),g=function(e){var t=e.draggable,n=e.draggables,r=e.droppables,o=e.impact,i=function(e){var t=e.previousImpact,n=e.impact,r=e.droppables,o=c6(t),i=c6(n);if(!o)return r;if(o===i)return r;var a=r[o];if(!a.subject.withPlaceholder)return r;var s=function(e){var t=e.subject.withPlaceholder;t||Y4(!1);var n=e.frame;if(!n){var r=f8({page:e.subject.page,axis:e.axis,frame:null,withPlaceholder:null});return(0,Z3.Z)({},e,{subject:r})}var o=t.oldFrameMaxScroll;o||Y4(!1);var i=s6(n,o),a=f8({page:e.subject.page,axis:e.axis,frame:i,withPlaceholder:null});return(0,Z3.Z)({},e,{subject:a,frame:i})}(a);return g6(r,s)}({previousImpact:e.previousImpact,impact:o,droppables:r}),a=c6(o);if(!a)return i;var s=r[a];if(N8(t,s))return i;if(s.subject.withPlaceholder)return i;var l=l6(s,t,n);return g6(i,l)}({draggable:m,impact:f,previousImpact:t.impact,draggables:l.draggables,droppables:l.droppables});return(0,Z3.Z)({},t,{current:h,dimensions:{draggables:l.draggables,droppables:g},impact:f,viewport:s,scrollJumpRequest:a||null,forceShouldAnimate:!a&&null})},v6=function(e){var t=e.impact,n=e.viewport,r=e.draggables,o=e.destination,i=e.forceShouldAnimate,a=t.displaced,s=function(e,t){return e.map((function(e){return t[e]}))}(a.all,r),l=V8({afterDragging:s,destination:o,displacedBy:t.displacedBy,viewport:n.frame,forceShouldAnimate:i,last:a});return(0,Z3.Z)({},t,{displaced:l})},y6=function(e){var t=e.impact,n=e.draggable,r=e.droppable,o=e.draggables,i=e.viewport,a=e.afterCritical,s=X8({impact:t,draggable:n,draggables:o,droppable:r,afterCritical:a});return e6({pageBorderBoxCenter:s,draggable:n,viewport:i})},_6=function(e){var t=e.state,n=e.dimensions,r=e.viewport;"SNAP"!==t.movementMode&&Y4(!1);var o=t.impact,i=r||t.viewport,a=n||t.dimensions,s=a.draggables,l=a.droppables,c=s[t.critical.draggable.id],u=c6(o);u||Y4(!1);var d=l[u],p=v6({impact:o,viewport:i,destination:d,draggables:s}),h=y6({impact:p,draggable:c,droppable:d,draggables:s,viewport:i,afterCritical:t.afterCritical});return b6({impact:p,clientSelection:h,state:t,dimensions:a,viewport:i})},k6=function(e){var t=e.draggable,n=e.home,r=e.draggables,o=e.viewport,i=a6(n.axis,t.displaceBy),a=x8(n.descriptor.id,r),s=a.indexOf(t);-1===s&&Y4(!1);var l,c=a.slice(s+1),u=c.reduce((function(e,t){return e[t.descriptor.id]=!0,e}),{}),d={inVirtualList:"virtual"===n.descriptor.mode,displacedBy:i,effected:u};return{impact:{displaced:V8({afterDragging:c,destination:n,displacedBy:i,last:null,viewport:o.frame,forceShouldAnimate:!1}),displacedBy:i,at:{type:"REORDER",destination:(l=t.descriptor,{index:l.index,droppableId:l.droppableId})}},afterCritical:d}},w6=function(e){return"SNAP"===e.movementMode},E6=function(e,t,n){var r=function(e,t){return{draggables:e.draggables,droppables:g6(e.droppables,t)}}(e.dimensions,t);return!w6(e)||n?b6({state:e,dimensions:r}):_6({state:e,dimensions:r})};function C6(e){return e.isDragging&&"SNAP"===e.movementMode?(0,Z3.Z)({phase:"DRAGGING"},e,{scrollJumpRequest:null}):e}var x6={phase:"IDLE",completed:null,shouldFlush:!1},S6=function(e,t){if(void 0===e&&(e=x6),"FLUSH"===t.type)return(0,Z3.Z)({},x6,{shouldFlush:!0});if("INITIAL_PUBLISH"===t.type){"IDLE"!==e.phase&&Y4(!1);var n=t.payload,r=n.critical,o=n.clientSelection,i=n.viewport,a=n.dimensions,s=n.movementMode,l=a.draggables[r.draggable.id],c=a.droppables[r.droppable.id],u={selection:o,borderBoxCenter:l.client.borderBox.center,offset:r8},d={client:u,page:{selection:o8(u.selection,i.scroll.initial),borderBoxCenter:o8(u.selection,i.scroll.initial),offset:o8(u.selection,i.scroll.diff.value)}},p=E8(a.droppables).every((function(e){return!e.isFixedOnPage})),h=k6({draggable:l,home:c,draggables:a.draggables,viewport:i}),m=h.impact;return{phase:"DRAGGING",isDragging:!0,critical:r,movementMode:s,dimensions:a,initial:d,current:d,isWindowScrollAllowed:p,impact:m,afterCritical:h.afterCritical,onLiftImpact:m,viewport:i,scrollJumpRequest:null,forceShouldAnimate:null}}if("COLLECTION_STARTING"===t.type)return"COLLECTING"===e.phase||"DROP_PENDING"===e.phase?e:("DRAGGING"!==e.phase&&Y4(!1),(0,Z3.Z)({phase:"COLLECTING"},e,{phase:"COLLECTING"}));if("PUBLISH_WHILE_DRAGGING"===t.type)return"COLLECTING"!==e.phase&&"DROP_PENDING"!==e.phase&&Y4(!1),function(e){var t=e.state,n=e.published,r=n.modified.map((function(e){var n=t.dimensions.droppables[e.droppableId];return g8(n,e.scroll)})),o=(0,Z3.Z)({},t.dimensions.droppables,{},k8(r)),i=w8(function(e){var t=e.additions,n=e.updatedDroppables,r=e.viewport,o=r.scroll.diff.value;return t.map((function(e){var t=e.descriptor.droppableId,i=function(e){var t=e.frame;return t||Y4(!1),t}(n[t]),a=i.scroll.diff.value,s=function(e){var t=e.draggable,n=e.offset,r=e.initialWindowScroll,o=D4(t.client,n),i=O4(o,r);return(0,Z3.Z)({},t,{placeholder:(0,Z3.Z)({},t.placeholder,{client:o}),client:o,page:i})}({draggable:e,offset:o8(o,a),initialWindowScroll:r.scroll.initial});return s}))}({additions:n.additions,updatedDroppables:o,viewport:t.viewport})),a=(0,Z3.Z)({},t.dimensions.draggables,{},i);n.removals.forEach((function(e){delete a[e]}));var s={droppables:o,draggables:a},l=c6(t.impact),c=l?s.droppables[l]:null,u=s.draggables[t.critical.draggable.id],d=s.droppables[t.critical.droppable.id],p=k6({draggable:u,home:d,draggables:a,viewport:t.viewport}),h=p.impact,m=p.afterCritical,f=c&&c.isCombineEnabled?t.impact:h,g=f6({pageOffset:t.current.page.offset,draggable:s.draggables[t.critical.draggable.id],draggables:s.draggables,droppables:s.droppables,previousImpact:f,viewport:t.viewport,afterCritical:m}),b=(0,Z3.Z)({phase:"DRAGGING"},t,{phase:"DRAGGING",impact:g,onLiftImpact:h,dimensions:s,afterCritical:m,forceShouldAnimate:!1});return"COLLECTING"===t.phase?b:(0,Z3.Z)({phase:"DROP_PENDING"},b,{phase:"DROP_PENDING",reason:t.reason,isWaiting:!1})}({state:e,published:t.payload});if("MOVE"===t.type){if("DROP_PENDING"===e.phase)return e;d6(e)||Y4(!1);var f=t.payload.client;return a8(f,e.current.client.selection)?e:b6({state:e,clientSelection:f,impact:w6(e)?e.impact:null})}if("UPDATE_DROPPABLE_SCROLL"===t.type){if("DROP_PENDING"===e.phase)return C6(e);if("COLLECTING"===e.phase)return C6(e);d6(e)||Y4(!1);var g=t.payload,b=g.id,v=g.newScroll,y=e.dimensions.droppables[b];if(!y)return e;var _=g8(y,v);return E6(e,_,!1)}if("UPDATE_DROPPABLE_IS_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;d6(e)||Y4(!1);var k=t.payload,w=k.id,E=k.isEnabled,C=e.dimensions.droppables[w];C||Y4(!1),C.isEnabled===E&&Y4(!1);var x=(0,Z3.Z)({},C,{isEnabled:E});return E6(e,x,!0)}if("UPDATE_DROPPABLE_IS_COMBINE_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;d6(e)||Y4(!1);var S=t.payload,I=S.id,T=S.isCombineEnabled,N=e.dimensions.droppables[I];N||Y4(!1),N.isCombineEnabled===T&&Y4(!1);var P=(0,Z3.Z)({},N,{isCombineEnabled:T});return E6(e,P,!0)}if("MOVE_BY_WINDOW_SCROLL"===t.type){if("DROP_PENDING"===e.phase||"DROP_ANIMATING"===e.phase)return e;d6(e)||Y4(!1),e.isWindowScrollAllowed||Y4(!1);var R=t.payload.newScroll;if(a8(e.viewport.scroll.current,R))return C6(e);var A=J8(e.viewport,R);return w6(e)?_6({state:e,viewport:A}):b6({state:e,viewport:A})}if("UPDATE_VIEWPORT_MAX_SCROLL"===t.type){if(!d6(e))return e;var B=t.payload.maxScroll;if(a8(B,e.viewport.scroll.max))return e;var L=(0,Z3.Z)({},e.viewport,{scroll:(0,Z3.Z)({},e.viewport.scroll,{max:B})});return(0,Z3.Z)({phase:"DRAGGING"},e,{viewport:L})}if("MOVE_UP"===t.type||"MOVE_DOWN"===t.type||"MOVE_LEFT"===t.type||"MOVE_RIGHT"===t.type){if("COLLECTING"===e.phase||"DROP_PENDING"===e.phase)return e;"DRAGGING"!==e.phase&&Y4(!1);var M=u6({state:e,type:t.type});return M?b6({state:e,impact:M.impact,clientSelection:M.clientSelection,scrollJumpRequest:M.scrollJumpRequest}):e}if("DROP_PENDING"===t.type){var D=t.payload.reason;return"COLLECTING"!==e.phase&&Y4(!1),(0,Z3.Z)({phase:"DROP_PENDING"},e,{phase:"DROP_PENDING",isWaiting:!0,reason:D})}if("DROP_ANIMATE"===t.type){var O=t.payload,F=O.completed,j=O.dropDuration,Z=O.newHomeClientOffset;return"DRAGGING"!==e.phase&&"DROP_PENDING"!==e.phase&&Y4(!1),{phase:"DROP_ANIMATING",completed:F,dropDuration:j,newHomeClientOffset:Z,dimensions:e.dimensions}}return"DROP_COMPLETE"===t.type?{phase:"IDLE",completed:t.payload.completed,shouldFlush:!1}:e},I6=function(e){return{type:"LIFT",payload:e}},T6=function(e){return{type:"PUBLISH_WHILE_DRAGGING",payload:e}},N6=function(){return{type:"COLLECTION_STARTING",payload:null}},P6=function(e){return{type:"UPDATE_DROPPABLE_SCROLL",payload:e}},R6=function(e){return{type:"UPDATE_DROPPABLE_IS_ENABLED",payload:e}},A6=function(e){return{type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:e}},B6=function(e){return{type:"MOVE",payload:e}},L6=function(){return{type:"MOVE_UP",payload:null}},M6=function(){return{type:"MOVE_DOWN",payload:null}},D6=function(){return{type:"MOVE_RIGHT",payload:null}},O6=function(){return{type:"MOVE_LEFT",payload:null}},F6=function(){return{type:"FLUSH",payload:null}},j6=function(e){return{type:"DROP_COMPLETE",payload:e}},Z6=function(e){return{type:"DROP",payload:e}},z6="cubic-bezier(.2,1,.1,1)",V6=0,H6=.7,U6=.75,$6="0.2s cubic-bezier(0.2, 0, 0, 1)",W6={fluid:"opacity "+$6,snap:"transform "+$6+", opacity "+$6,drop:function(e){var t=e+"s "+z6;return"transform "+t+", opacity "+t},outOfTheWay:"transform "+$6,placeholder:"height "+$6+", width "+$6+", margin "+$6},G6=function(e){return a8(e,r8)?null:"translate("+e.x+"px, "+e.y+"px)"},q6=G6,K6=function(e,t){var n=G6(e);return n?t?n+" scale("+U6+")":n:null},Y6=.33,X6=function(e){var t=e.getState,n=e.dispatch;return function(e){return function(r){if("DROP"===r.type){var o=t(),i=r.payload.reason;if("COLLECTING"!==o.phase){if("IDLE"!==o.phase){"DROP_PENDING"===o.phase&&o.isWaiting&&Y4(!1),"DRAGGING"!==o.phase&&"DROP_PENDING"!==o.phase&&Y4(!1);var a=o.critical,s=o.dimensions,l=s.draggables[o.critical.draggable.id],c=function(e){var t=e.draggables,n=e.reason,r=e.lastImpact,o=e.home,i=e.viewport,a=e.onLiftImpact;return r.at&&"DROP"===n?"REORDER"===r.at.type?{impact:r,didDropInsideDroppable:!0}:{impact:(0,Z3.Z)({},r,{displaced:R8}),didDropInsideDroppable:!0}:{impact:v6({draggables:t,impact:a,destination:o,viewport:i,forceShouldAnimate:!0}),didDropInsideDroppable:!1}}({reason:i,lastImpact:o.impact,afterCritical:o.afterCritical,onLiftImpact:o.onLiftImpact,home:o.dimensions.droppables[o.critical.droppable.id],viewport:o.viewport,draggables:o.dimensions.draggables}),u=c.impact,d=c.didDropInsideDroppable,p=d?S8(u):null,h=d?I8(u):null,m={index:a.draggable.index,droppableId:a.droppable.id},f={draggableId:l.descriptor.id,type:l.descriptor.type,source:m,reason:i,mode:o.movementMode,destination:p,combine:h},g=function(e){var t=e.impact,n=e.draggable,r=e.dimensions,o=e.viewport,i=e.afterCritical,a=r.draggables,s=r.droppables,l=c6(t),c=l?s[l]:null,u=s[n.descriptor.droppableId],d=y6({impact:t,draggable:n,draggables:a,afterCritical:i,droppable:c||u,viewport:o});return i8(d,n.client.borderBox.center)}({impact:u,draggable:l,dimensions:s,viewport:o.viewport,afterCritical:o.afterCritical}),b={critical:o.critical,afterCritical:o.afterCritical,result:f,impact:u};if(!a8(o.current.client.offset,g)||Boolean(f.combine)){var v=function(e){var t=e.reason,n=c8(e.current,e.destination);if(n<=0)return Y6;if(n>=1500)return.55;var r=Y6+n/1500*.22000000000000003;return Number(("CANCEL"===t?.6*r:r).toFixed(2))}({current:o.current.client.offset,destination:g,reason:i});n(function(e){return{type:"DROP_ANIMATE",payload:e}}({newHomeClientOffset:g,dropDuration:v,completed:b}))}else n(j6({completed:b}))}}else n(function(e){return{type:"DROP_PENDING",payload:e}}({reason:i}))}else e(r)}}},J6=function(){return{x:window.pageXOffset,y:window.pageYOffset}};var Q6=function(e){var t=function(e){var t=e.onWindowScroll,n=H4((function(){t(J6())})),r=function(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(t){t.target!==window&&t.target!==window.document||e()}}}(n),o=$4;function i(){return o!==$4}return{start:function(){i()&&Y4(!1),o=W4(window,[r])},stop:function(){i()||Y4(!1),n.cancel(),o(),o=$4},isActive:i}}({onWindowScroll:function(t){e.dispatch(function(e){return{type:"MOVE_BY_WINDOW_SCROLL",payload:e}}({newScroll:t}))}});return function(e){return function(n){t.isActive()||"INITIAL_PUBLISH"!==n.type||t.start(),t.isActive()&&function(e){return"DROP_COMPLETE"===e.type||"DROP_ANIMATE"===e.type||"FLUSH"===e.type}(n)&&t.stop(),e(n)}}},e9=function(e,t){t()},t9=function(e,t){return{draggableId:e.draggable.id,type:e.droppable.type,source:{droppableId:e.droppable.id,index:e.draggable.index},mode:t}},n9=function(e,t,n,r){if(e){var o=function(e){var t=!1,n=!1,r=setTimeout((function(){n=!0})),o=function(o){t||n||(t=!0,e(o),clearTimeout(r))};return o.wasCalled=function(){return t},o}(n);e(t,{announce:o}),o.wasCalled()||n(r(t))}else n(r(t))},r9=function(e,t){var n=function(e,t){var n,r=(n=[],{add:function(e){var t=setTimeout((function(){return function(e){var t=v8(n,(function(t){return t.timerId===e}));-1===t&&Y4(!1),n.splice(t,1)[0].callback()}(t)})),r={timerId:t,callback:e};n.push(r)},flush:function(){if(n.length){var e=[].concat(n);n.length=0,e.forEach((function(e){clearTimeout(e.timerId),e.callback()}))}}}),o=null,i=function(n){o||Y4(!1),o=null,e9(0,(function(){return n9(e().onDragEnd,n,t,n8.onDragEnd)}))};return{beforeCapture:function(t,n){o&&Y4(!1),e9(0,(function(){var r=e().onBeforeCapture;r&&r({draggableId:t,mode:n})}))},beforeStart:function(t,n){o&&Y4(!1),e9(0,(function(){var r=e().onBeforeDragStart;r&&r(t9(t,n))}))},start:function(n,i){o&&Y4(!1);var a=t9(n,i);o={mode:i,lastCritical:n,lastLocation:a.source,lastCombine:null},r.add((function(){e9(0,(function(){return n9(e().onDragStart,a,t,n8.onDragStart)}))}))},update:function(n,i){var a=S8(i),s=I8(i);o||Y4(!1);var l=!function(e,t){if(e===t)return!0;var n=e.draggable.id===t.draggable.id&&e.draggable.droppableId===t.draggable.droppableId&&e.draggable.type===t.draggable.type&&e.draggable.index===t.draggable.index,r=e.droppable.id===t.droppable.id&&e.droppable.type===t.droppable.type;return n&&r}(n,o.lastCritical);l&&(o.lastCritical=n);var c,u,d=(c=o.lastLocation,u=a,!(null==c&&null==u||null!=c&&null!=u&&c.droppableId===u.droppableId&&c.index===u.index));d&&(o.lastLocation=a);var p=!function(e,t){return null==e&&null==t||null!=e&&null!=t&&e.draggableId===t.draggableId&&e.droppableId===t.droppableId}(o.lastCombine,s);if(p&&(o.lastCombine=s),l||d||p){var h=(0,Z3.Z)({},t9(n,o.mode),{combine:s,destination:a});r.add((function(){e9(0,(function(){return n9(e().onDragUpdate,h,t,n8.onDragUpdate)}))}))}},flush:function(){o||Y4(!1),r.flush()},drop:i,abort:function(){if(o){var e=(0,Z3.Z)({},t9(o.lastCritical,o.mode),{combine:null,destination:null,reason:"CANCEL"});i(e)}}}}(e,t);return function(e){return function(t){return function(r){if("BEFORE_INITIAL_CAPTURE"!==r.type){if("INITIAL_PUBLISH"===r.type){var o=r.payload.critical;return n.beforeStart(o,r.payload.movementMode),t(r),void n.start(o,r.payload.movementMode)}if("DROP_COMPLETE"===r.type){var i=r.payload.completed.result;return n.flush(),t(r),void n.drop(i)}if(t(r),"FLUSH"!==r.type){var a=e.getState();"DRAGGING"===a.phase&&n.update(a.critical,a.impact)}else n.abort()}else n.beforeCapture(r.payload.draggableId,r.payload.movementMode)}}}},o9=function(e){return function(t){return function(n){if("DROP_ANIMATION_FINISHED"===n.type){var r=e.getState();"DROP_ANIMATING"!==r.phase&&Y4(!1),e.dispatch(j6({completed:r.completed}))}else t(n)}}},i9=function(e){var t=null,n=null;return function(r){return function(o){if("FLUSH"!==o.type&&"DROP_COMPLETE"!==o.type&&"DROP_ANIMATION_FINISHED"!==o.type||(n&&(cancelAnimationFrame(n),n=null),t&&(t(),t=null)),r(o),"DROP_ANIMATE"===o.type){var i={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){"DROP_ANIMATING"===e.getState().phase&&e.dispatch({type:"DROP_ANIMATION_FINISHED",payload:null})}};n=requestAnimationFrame((function(){n=null,t=W4(window,[i])}))}}}},a9=function(e){return function(t){return function(n){if(t(n),"PUBLISH_WHILE_DRAGGING"===n.type){var r=e.getState();"DROP_PENDING"===r.phase&&(r.isWaiting||e.dispatch(Z6({reason:r.reason})))}}}},s9=z3.qC,l9=function(e){var t,n=e.dimensionMarshal,r=e.focusMarshal,o=e.styleMarshal,i=e.getResponders,a=e.announce,s=e.autoScroller;return(0,z3.MT)(S6,s9((0,z3.md)((t=o,function(){return function(e){return function(n){"INITIAL_PUBLISH"===n.type&&t.dragging(),"DROP_ANIMATE"===n.type&&t.dropping(n.payload.completed.result.reason),"FLUSH"!==n.type&&"DROP_COMPLETE"!==n.type||t.resting(),e(n)}}}),function(e){return function(){return function(t){return function(n){"DROP_COMPLETE"!==n.type&&"FLUSH"!==n.type&&"DROP_ANIMATE"!==n.type||e.stopPublishing(),t(n)}}}}(n),function(e){return function(t){var n=t.getState,r=t.dispatch;return function(t){return function(o){if("LIFT"===o.type){var i=o.payload,a=i.id,s=i.clientSelection,l=i.movementMode,c=n();"DROP_ANIMATING"===c.phase&&r(j6({completed:c.completed})),"IDLE"!==n().phase&&Y4(!1),r(F6()),r(function(e){return{type:"BEFORE_INITIAL_CAPTURE",payload:e}}({draggableId:a,movementMode:l}));var u={draggableId:a,scrollOptions:{shouldPublishImmediately:"SNAP"===l}},d=e.startPublishing(u),p=d.critical,h=d.dimensions,m=d.viewport;r(function(e){return{type:"INITIAL_PUBLISH",payload:e}}({critical:p,dimensions:h,clientSelection:s,movementMode:l,viewport:m}))}else t(o)}}}}(n),X6,o9,i9,a9,function(e){return function(t){return function(n){return function(r){if(function(e){return"DROP_COMPLETE"===e.type||"DROP_ANIMATE"===e.type||"FLUSH"===e.type}(r))return e.stop(),void n(r);if("INITIAL_PUBLISH"===r.type){n(r);var o=t.getState();return"DRAGGING"!==o.phase&&Y4(!1),void e.start(o)}n(r),e.scroll(t.getState())}}}}(s),Q6,function(e){var t=!1;return function(){return function(n){return function(r){if("INITIAL_PUBLISH"===r.type)return t=!0,e.tryRecordFocus(r.payload.critical.draggable.id),n(r),void e.tryRestoreFocusRecorded();if(n(r),t){if("FLUSH"===r.type)return t=!1,void e.tryRestoreFocusRecorded();if("DROP_COMPLETE"===r.type){t=!1;var o=r.payload.completed.result;o.combine&&e.tryShiftRecord(o.draggableId,o.combine.draggableId),e.tryRestoreFocusRecorded()}}}}}}(r),r9(i,a))))},c9=function(e){var t=e.scrollHeight,n=e.scrollWidth,r=e.height,o=e.width,i=i8({x:n,y:t},{x:o,y:r});return{x:Math.max(0,i.x),y:Math.max(0,i.y)}},u9=function(){var e=document.documentElement;return e||Y4(!1),e},d9=function(){var e=u9();return c9({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight})};function p9(e,t,n){return n.descriptor.id!==t.id&&n.descriptor.type===t.type&&"virtual"===e.droppable.getById(n.descriptor.droppableId).descriptor.mode}var h9,m9,f9=function(e,t){var n=null,r=function(e){var t=e.registry,n=e.callbacks,r={additions:{},removals:{},modified:{}},o=null,i=function(){o||(n.collectionStarting(),o=requestAnimationFrame((function(){o=null;var e=r,i=e.additions,a=e.removals,s=e.modified,l=Object.keys(i).map((function(e){return t.draggable.getById(e).getDimension(r8)})).sort((function(e,t){return e.descriptor.index-t.descriptor.index})),c=Object.keys(s).map((function(e){return{droppableId:e,scroll:t.droppable.getById(e).callbacks.getScrollWhileDragging()}})),u={additions:l,removals:Object.keys(a),modified:c};r={additions:{},removals:{},modified:{}},n.publish(u)})))};return{add:function(e){var t=e.descriptor.id;r.additions[t]=e,r.modified[e.descriptor.droppableId]=!0,r.removals[t]&&delete r.removals[t],i()},remove:function(e){var t=e.descriptor;r.removals[t.id]=!0,r.modified[t.droppableId]=!0,r.additions[t.id]&&delete r.additions[t.id],i()},stop:function(){o&&(cancelAnimationFrame(o),o=null,r={additions:{},removals:{},modified:{}})}}}({callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}),o=function(t){n||Y4(!1);var o=n.critical.draggable;"ADDITION"===t.type&&p9(e,o,t.value)&&r.add(t.value),"REMOVAL"===t.type&&p9(e,o,t.value)&&r.remove(t.value)},i={updateDroppableIsEnabled:function(r,o){e.droppable.exists(r)||Y4(!1),n&&t.updateDroppableIsEnabled({id:r,isEnabled:o})},updateDroppableIsCombineEnabled:function(r,o){n&&(e.droppable.exists(r)||Y4(!1),t.updateDroppableIsCombineEnabled({id:r,isCombineEnabled:o}))},scrollDroppable:function(t,r){n&&e.droppable.getById(t).callbacks.scroll(r)},updateDroppableScroll:function(r,o){n&&(e.droppable.exists(r)||Y4(!1),t.updateDroppableScroll({id:r,newScroll:o}))},startPublishing:function(t){n&&Y4(!1);var r=e.draggable.getById(t.draggableId),i=e.droppable.getById(r.descriptor.droppableId),a={draggable:r.descriptor,droppable:i.descriptor},s=e.subscribe(o);return n={critical:a,unsubscribe:s},function(e){var t=e.critical,n=e.scrollOptions,r=e.registry,o=function(){var e=J6(),t=d9(),n=e.y,r=e.x,o=u9(),i=o.clientWidth,a=o.clientHeight;return{frame:P4({top:n,left:r,right:r+i,bottom:n+a}),scroll:{initial:e,current:e,max:t,diff:{value:r8,displacement:r8}}}}(),i=o.scroll.current,a=t.droppable,s=r.droppable.getAllByType(a.type).map((function(e){return e.callbacks.getDimensionAndWatchScroll(i,n)})),l=r.draggable.getAllByType(t.draggable.type).map((function(e){return e.getDimension(i)}));return{dimensions:{draggables:w8(l),droppables:k8(s)},critical:t,viewport:o}}({critical:a,registry:e,scrollOptions:t.scrollOptions})},stopPublishing:function(){if(n){r.stop();var t=n.critical.droppable;e.droppable.getAllByType(t.type).forEach((function(e){return e.callbacks.dragStopped()})),n.unsubscribe(),n=null}}};return i},g9=function(e,t){return"IDLE"===e.phase||"DROP_ANIMATING"===e.phase&&e.completed.result.draggableId!==t&&"DROP"===e.completed.result.reason},b9=function(e){window.scrollBy(e.x,e.y)},v9=V4((function(e){return E8(e).filter((function(e){return!!e.isEnabled&&!!e.frame}))})),y9=function(e){return Math.pow(e,2)},_9=function(e){var t=e.startOfRange,n=e.endOfRange,r=e.current,o=n-t;return 0===o?0:(r-t)/o},k9=360,w9=1200,E9=function(e){var t=e.distanceToEdge,n=e.thresholds,r=e.dragStartTime,o=e.shouldUseTimeDampening,i=function(e,t){if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return 28;if(e===t.startScrollingFrom)return 1;var n=_9({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),r=28*y9(1-n);return Math.ceil(r)}(t,n);return 0===i?0:o?Math.max(function(e,t){var n=t,r=w9,o=Date.now()-n;if(o>=w9)return e;if(o<k9)return 1;var i=_9({startOfRange:k9,endOfRange:r,current:o}),a=e*y9(i);return Math.ceil(a)}(i,r),1):i},C9=function(e){var t=e.container,n=e.distanceToEdges,r=e.dragStartTime,o=e.axis,i=e.shouldUseTimeDampening,a=function(e,t){return{startScrollingFrom:.25*e[t.size],maxScrollValueAt:.05*e[t.size]}}(t,o);return n[o.end]<n[o.start]?E9({distanceToEdge:n[o.end],thresholds:a,dragStartTime:r,shouldUseTimeDampening:i}):-1*E9({distanceToEdge:n[o.start],thresholds:a,dragStartTime:r,shouldUseTimeDampening:i})},x9=d8((function(e){return 0===e?0:e})),S9=function(e){var t=e.dragStartTime,n=e.container,r=e.subject,o=e.center,i=e.shouldUseTimeDampening,a={top:o.y-n.top,right:n.right-o.x,bottom:n.bottom-o.y,left:o.x-n.left},s=C9({container:n,distanceToEdges:a,dragStartTime:t,axis:D8,shouldUseTimeDampening:i}),l=C9({container:n,distanceToEdges:a,dragStartTime:t,axis:O8,shouldUseTimeDampening:i}),c=x9({x:l,y:s});if(a8(c,r8))return null;var u=function(e){var t=e.container,n=e.subject,r=e.proposedScroll,o=n.height>t.height,i=n.width>t.width;return i||o?i&&o?null:{x:i?0:r.x,y:o?0:r.y}:r}({container:n,subject:r,proposedScroll:c});return u?a8(u,r8)?null:u:null},I9=d8((function(e){return 0===e?0:e>0?1:-1})),T9=(h9=function(e,t){return e<0?e:e>t?e-t:0},function(e){var t=e.current,n=e.max,r=e.change,o=o8(t,r),i={x:h9(o.x,n.x),y:h9(o.y,n.y)};return a8(i,r8)?null:i}),N9=function(e){var t=e.max,n=e.current,r=e.change,o={x:Math.max(n.x,t.x),y:Math.max(n.y,t.y)},i=I9(r),a=T9({max:o,current:n,change:i});return!a||0!==i.x&&0===a.x||0!==i.y&&0===a.y},P9=function(e,t){return N9({current:e.scroll.current,max:e.scroll.max,change:t})},R9=function(e,t){var n=e.frame;return!!n&&N9({current:n.scroll.current,max:n.scroll.max,change:t})},A9=function(e){var t=e.state,n=e.dragStartTime,r=e.shouldUseTimeDampening,o=e.scrollWindow,i=e.scrollDroppable,a=t.current.page.borderBoxCenter,s=t.dimensions.draggables[t.critical.draggable.id].page.marginBox;if(t.isWindowScrollAllowed){var l=function(e){var t=e.viewport,n=e.subject,r=e.center,o=e.shouldUseTimeDampening,i=S9({dragStartTime:e.dragStartTime,container:t.frame,subject:n,center:r,shouldUseTimeDampening:o});return i&&P9(t,i)?i:null}({dragStartTime:n,viewport:t.viewport,subject:s,center:a,shouldUseTimeDampening:r});if(l)return void o(l)}var c=function(e){var t=e.center,n=e.destination,r=e.droppables;if(n){var o=r[n];return o.frame?o:null}var i=function(e,t){var n=y8(v9(t),(function(t){return t.frame||Y4(!1),p6(t.frame.pageMarginBox)(e)}));return n}(t,r);return i}({center:a,destination:c6(t.impact),droppables:t.dimensions.droppables});if(c){var u=function(e){var t=e.droppable,n=e.subject,r=e.center,o=e.dragStartTime,i=e.shouldUseTimeDampening,a=t.frame;if(!a)return null;var s=S9({dragStartTime:o,container:a.pageMarginBox,subject:n,center:r,shouldUseTimeDampening:i});return s&&R9(t,s)?s:null}({dragStartTime:n,droppable:c,subject:s,center:a,shouldUseTimeDampening:r});u&&i(c.descriptor.id,u)}},B9=function(e){var t=e.move,n=e.scrollDroppable,r=e.scrollWindow;return function(e){var o=e.scrollJumpRequest;if(o){var i=c6(e.impact);i||Y4(!1);var a=function(e,t){if(!R9(e,t))return t;var r=function(e,t){var n=e.frame;return n&&R9(e,t)?T9({current:n.scroll.current,max:n.scroll.max,change:t}):null}(e,t);if(!r)return n(e.descriptor.id,t),null;var o=i8(t,r);return n(e.descriptor.id,o),i8(t,o)}(e.dimensions.droppables[i],o);if(a){var s=e.viewport,l=function(e,t,n){if(!e)return n;if(!P9(t,n))return n;var o=function(e,t){if(!P9(e,t))return null;var n=e.scroll.max,r=e.scroll.current;return T9({current:r,max:n,change:t})}(t,n);if(!o)return r(n),null;var i=i8(n,o);return r(i),i8(n,i)}(e.isWindowScrollAllowed,s,a);l&&function(e,n){var r=o8(e.current.client.selection,n);t({client:r})}(e,l)}}}},L9=function(e){var t=e.scrollDroppable,n=e.scrollWindow,r=e.move,o=function(e){var t=e.scrollDroppable,n=H4(e.scrollWindow),r=H4(t),o=null,i=function(e){o||Y4(!1);var t=o,i=t.shouldUseTimeDampening,a=t.dragStartTime;A9({state:e,scrollWindow:n,scrollDroppable:r,dragStartTime:a,shouldUseTimeDampening:i})};return{start:function(e){o&&Y4(!1);var t=Date.now(),n=!1,r=function(){n=!0};A9({state:e,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:r,scrollDroppable:r}),o={dragStartTime:t,shouldUseTimeDampening:n},n&&i(e)},stop:function(){o&&(n.cancel(),r.cancel(),o=null)},scroll:i}}({scrollWindow:n,scrollDroppable:t}),i=B9({move:r,scrollWindow:n,scrollDroppable:t});return{scroll:function(e){"DRAGGING"===e.phase&&("FLUID"!==e.movementMode?e.scrollJumpRequest&&i(e):o.scroll(e))},start:o.start,stop:o.stop}},M9="data-rbd",D9={base:m9=M9+"-drag-handle",draggableId:m9+"-draggable-id",contextId:m9+"-context-id"},O9=function(){var e=M9+"-draggable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),F9=function(){var e=M9+"-droppable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),j9={contextId:M9+"-scroll-container-context-id"},Z9=function(e,t){return e.map((function(e){var n=e.styles[t];return n?e.selector+" { "+n+" }":""})).join(" ")},z9=function(e){var t,n,r=function(e){return function(t){return"["+t+'="'+e+'"]'}}(e),o=(t="\n cursor: -webkit-grab;\n cursor: grab;\n ",{selector:r(D9.contextId),styles:{always:"\n -webkit-touch-callout: none;\n -webkit-tap-highlight-color: rgba(0,0,0,0);\n touch-action: manipulation;\n ",resting:t,dragging:"pointer-events: none;",dropAnimating:t}}),i=[(n="\n transition: "+W6.outOfTheWay+";\n ",{selector:r(O9.contextId),styles:{dragging:n,dropAnimating:n,userCancel:n}}),o,{selector:r(F9.contextId),styles:{always:"overflow-anchor: none;"}},{selector:"body",styles:{dragging:"\n cursor: grabbing;\n cursor: -webkit-grabbing;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n overflow-anchor: none;\n "}}];return{always:Z9(i,"always"),resting:Z9(i,"resting"),dragging:Z9(i,"dragging"),dropAnimating:Z9(i,"dropAnimating"),userCancel:Z9(i,"userCancel")}},V9="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?x.useLayoutEffect:x.useEffect,H9=function(){var e=document.querySelector("head");return e||Y4(!1),e},U9=function(e){var t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t},$9=function(e){return e&&e.ownerDocument?e.ownerDocument.defaultView:window};function W9(e){return e instanceof $9(e).HTMLElement}function G9(){var e={draggables:{},droppables:{}},t=[];function n(e){t.length&&t.forEach((function(t){return t(e)}))}function r(t){return e.draggables[t]||null}var o={register:function(t){e.draggables[t.descriptor.id]=t,n({type:"ADDITION",value:t})},update:function(t,n){var r=e.draggables[n.descriptor.id];r&&r.uniqueId===t.uniqueId&&(delete e.draggables[n.descriptor.id],e.draggables[t.descriptor.id]=t)},unregister:function(t){var o=t.descriptor.id,i=r(o);i&&t.uniqueId===i.uniqueId&&(delete e.draggables[o],n({type:"REMOVAL",value:t}))},getById:function(e){var t=r(e);return t||Y4(!1),t},findById:r,exists:function(e){return Boolean(r(e))},getAllByType:function(t){return b8(e.draggables).filter((function(e){return e.descriptor.type===t}))}};function i(t){return e.droppables[t]||null}var a={register:function(t){e.droppables[t.descriptor.id]=t},unregister:function(t){var n=i(t.descriptor.id);n&&t.uniqueId===n.uniqueId&&delete e.droppables[t.descriptor.id]},getById:function(e){var t=i(e);return t||Y4(!1),t},findById:i,exists:function(e){return Boolean(i(e))},getAllByType:function(t){return b8(e.droppables).filter((function(e){return e.descriptor.type===t}))}};return{draggable:o,droppable:a,subscribe:function(e){return t.push(e),function(){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}},clean:function(){e.draggables={},e.droppables={},t.length=0}}}var q9=x.createContext(null),K9=function(){var e=document.body;return e||Y4(!1),e},Y9={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},X9=function(e){return"rbd-announcement-"+e},J9=0,Q9={separator:"::"};function e7(e,t){return void 0===t&&(t=Q9),(0,WO.Ye)((function(){return""+e+t.separator+J9++}),[t.separator,e])}var t7=x.createContext(null);function n7(e){var t=(0,x.useRef)(e);return(0,x.useEffect)((function(){t.current=e})),t}var r7,o7,i7=((r7={})[13]=!0,r7[9]=!0,r7),a7=function(e){i7[e.keyCode]&&e.preventDefault()},s7=function(){var e="visibilitychange";return"undefined"==typeof document?e:y8([e,"ms"+e,"webkit"+e,"moz"+e,"o"+e],(function(e){return"on"+e in document}))||e}(),l7={type:"IDLE"};function c7(){}var u7=((o7={})[34]=!0,o7[33]=!0,o7[36]=!0,o7[35]=!0,o7);var d7={type:"IDLE"},p7={input:!0,button:!0,textarea:!0,select:!0,option:!0,optgroup:!0,video:!0,audio:!0};function h7(e,t){if(null==t)return!1;if(Boolean(p7[t.tagName.toLowerCase()]))return!0;var n=t.getAttribute("contenteditable");return"true"===n||""===n||t!==e&&h7(e,t.parentElement)}function m7(e,t){var n=t.target;return!!W9(n)&&h7(e,n)}var f7=function(e){return P4(e.getBoundingClientRect()).center},g7=function(){var e="matches";if("undefined"==typeof document)return e;var t=y8([e,"msMatchesSelector","webkitMatchesSelector"],(function(e){return e in Element.prototype}));return t||e}();function b7(e,t){return null==e?null:e[g7](t)?e:b7(e.parentElement,t)}function v7(e,t){return e.closest?e.closest(t):b7(e,t)}function y7(e){e.preventDefault()}function _7(e){var t=e.expected,n=e.phase,r=e.isLockActive;return e.shouldWarn,!!r()&&t===n}function k7(e){var t=e.lockAPI,n=e.store,r=e.registry,o=e.draggableId;if(t.isClaimed())return!1;var i=r.draggable.findById(o);return!!i&&!!i.options.isEnabled&&!!g9(n.getState(),o)}var w7=[function(e){var t=(0,x.useRef)(l7),n=(0,x.useRef)($4),r=(0,WO.Ye)((function(){return{eventName:"mousedown",fn:function(t){if(!t.defaultPrevented&&0===t.button&&!(t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)){var r=e.findClosestDraggableId(t);if(r){var o=e.tryGetLock(r,a,{sourceEvent:t});if(o){t.preventDefault();var i={x:t.clientX,y:t.clientY};n.current(),c(o,i)}}}}}}),[e]),o=(0,WO.Ye)((function(){return{eventName:"webkitmouseforcewillbegin",fn:function(t){if(!t.defaultPrevented){var n=e.findClosestDraggableId(t);if(n){var r=e.findOptionsForDraggable(n);r&&(r.shouldRespectForcePress||e.canGetLock(n)&&t.preventDefault())}}}}}),[e]),i=(0,WO.I4)((function(){n.current=W4(window,[o,r],{passive:!1,capture:!0})}),[o,r]),a=(0,WO.I4)((function(){"IDLE"!==t.current.type&&(t.current=l7,n.current(),i())}),[i]),s=(0,WO.I4)((function(){var e=t.current;a(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()}),[a]),l=(0,WO.I4)((function(){var e=function(e){var t=e.cancel,n=e.completed,r=e.getPhase,o=e.setPhase;return[{eventName:"mousemove",fn:function(e){var t=e.button,n=e.clientX,i=e.clientY;if(0===t){var a={x:n,y:i},s=r();if("DRAGGING"===s.type)return e.preventDefault(),void s.actions.move(a);if("PENDING"!==s.type&&Y4(!1),l=s.point,c=a,Math.abs(c.x-l.x)>=5||Math.abs(c.y-l.y)>=5){var l,c;e.preventDefault();var u=s.actions.fluidLift(a);o({type:"DRAGGING",actions:u})}}}},{eventName:"mouseup",fn:function(e){var o=r();"DRAGGING"===o.type?(e.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),n()):t()}},{eventName:"mousedown",fn:function(e){"DRAGGING"===r().type&&e.preventDefault(),t()}},{eventName:"keydown",fn:function(e){if("PENDING"!==r().type)return 27===e.keyCode?(e.preventDefault(),void t()):void a7(e);t()}},{eventName:"resize",fn:t},{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(){"PENDING"===r().type&&t()}},{eventName:"webkitmouseforcedown",fn:function(e){var n=r();"IDLE"===n.type&&Y4(!1),n.actions.shouldRespectForcePress()?t():e.preventDefault()}},{eventName:s7,fn:t}]}({cancel:s,completed:a,getPhase:function(){return t.current},setPhase:function(e){t.current=e}});n.current=W4(window,e,{capture:!0,passive:!1})}),[s,a]),c=(0,WO.I4)((function(e,n){"IDLE"!==t.current.type&&Y4(!1),t.current={type:"PENDING",point:n,actions:e},l()}),[l]);V9((function(){return i(),function(){n.current()}}),[i])},function(e){var t=(0,x.useRef)(c7),n=(0,WO.Ye)((function(){return{eventName:"keydown",fn:function(n){if(!n.defaultPrevented&&32===n.keyCode){var o=e.findClosestDraggableId(n);if(o){var i=e.tryGetLock(o,l,{sourceEvent:n});if(i){n.preventDefault();var a=!0,s=i.snapLift();t.current(),t.current=W4(window,function(e,t){function n(){t(),e.cancel()}return[{eventName:"keydown",fn:function(r){return 27===r.keyCode?(r.preventDefault(),void n()):32===r.keyCode?(r.preventDefault(),t(),void e.drop()):40===r.keyCode?(r.preventDefault(),void e.moveDown()):38===r.keyCode?(r.preventDefault(),void e.moveUp()):39===r.keyCode?(r.preventDefault(),void e.moveRight()):37===r.keyCode?(r.preventDefault(),void e.moveLeft()):void(u7[r.keyCode]?r.preventDefault():a7(r))}},{eventName:"mousedown",fn:n},{eventName:"mouseup",fn:n},{eventName:"click",fn:n},{eventName:"touchstart",fn:n},{eventName:"resize",fn:n},{eventName:"wheel",fn:n,options:{passive:!0}},{eventName:s7,fn:n}]}(s,l),{capture:!0,passive:!1})}}}function l(){a||Y4(!1),a=!1,t.current(),r()}}}}),[e]),r=(0,WO.I4)((function(){t.current=W4(window,[n],{passive:!1,capture:!0})}),[n]);V9((function(){return r(),function(){t.current()}}),[r])},function(e){var t=(0,x.useRef)(d7),n=(0,x.useRef)($4),r=(0,WO.I4)((function(){return t.current}),[]),o=(0,WO.I4)((function(e){t.current=e}),[]),i=(0,WO.Ye)((function(){return{eventName:"touchstart",fn:function(t){if(!t.defaultPrevented){var r=e.findClosestDraggableId(t);if(r){var o=e.tryGetLock(r,s,{sourceEvent:t});if(o){var i=t.touches[0],a={x:i.clientX,y:i.clientY};n.current(),d(o,a)}}}}}}),[e]),a=(0,WO.I4)((function(){n.current=W4(window,[i],{capture:!0,passive:!1})}),[i]),s=(0,WO.I4)((function(){var e=t.current;"IDLE"!==e.type&&("PENDING"===e.type&&clearTimeout(e.longPressTimerId),o(d7),n.current(),a())}),[a,o]),l=(0,WO.I4)((function(){var e=t.current;s(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()}),[s]),c=(0,WO.I4)((function(){var e={capture:!0,passive:!1},t={cancel:l,completed:s,getPhase:r},o=W4(window,function(e){var t=e.cancel,n=e.completed,r=e.getPhase;return[{eventName:"touchmove",options:{capture:!1},fn:function(e){var n=r();if("DRAGGING"===n.type){n.hasMoved=!0;var o=e.touches[0],i={x:o.clientX,y:o.clientY};e.preventDefault(),n.actions.move(i)}else t()}},{eventName:"touchend",fn:function(e){var o=r();"DRAGGING"===o.type?(e.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),n()):t()}},{eventName:"touchcancel",fn:function(e){"DRAGGING"===r().type?(e.preventDefault(),t()):t()}},{eventName:"touchforcechange",fn:function(e){var n=r();"IDLE"===n.type&&Y4(!1);var o=e.touches[0];if(o&&o.force>=.15){var i=n.actions.shouldRespectForcePress();if("PENDING"!==n.type)return i?n.hasMoved?void e.preventDefault():void t():void e.preventDefault();i&&t()}}},{eventName:s7,fn:t}]}(t),e),i=W4(window,function(e){var t=e.cancel,n=e.getPhase;return[{eventName:"orientationchange",fn:t},{eventName:"resize",fn:t},{eventName:"contextmenu",fn:function(e){e.preventDefault()}},{eventName:"keydown",fn:function(e){"DRAGGING"===n().type?(27===e.keyCode&&e.preventDefault(),t()):t()}},{eventName:s7,fn:t}]}(t),e);n.current=function(){o(),i()}}),[l,r,s]),u=(0,WO.I4)((function(){var e=r();"PENDING"!==e.type&&Y4(!1);var t=e.actions.fluidLift(e.point);o({type:"DRAGGING",actions:t,hasMoved:!1})}),[r,o]),d=(0,WO.I4)((function(e,t){"IDLE"!==r().type&&Y4(!1);var n=setTimeout(u,120);o({type:"PENDING",point:t,actions:e,longPressTimerId:n}),c()}),[c,r,o,u]);V9((function(){return a(),function(){n.current();var e=r();"PENDING"===e.type&&(clearTimeout(e.longPressTimerId),o(d7))}}),[r,a,o]),V9((function(){return W4(window,[{eventName:"touchmove",fn:function(){},options:{capture:!1,passive:!1}}])}),[])}];function E7(e){var t=e.contextId,n=e.store,r=e.registry,o=e.customSensors,i=e.enableDefaultSensors,a=[].concat(i?w7:[],o||[]),s=(0,x.useState)((function(){return function(){var e=null;function t(){e||Y4(!1),e=null}return{isClaimed:function(){return Boolean(e)},isActive:function(t){return t===e},claim:function(t){e&&Y4(!1);var n={abandon:t};return e=n,n},release:t,tryAbandon:function(){e&&(e.abandon(),t())}}}()}))[0],l=(0,WO.I4)((function(e,t){e.isDragging&&!t.isDragging&&s.tryAbandon()}),[s]);V9((function(){var e=n.getState();return n.subscribe((function(){var t=n.getState();l(e,t),e=t}))}),[s,n,l]),V9((function(){return s.tryAbandon}),[s.tryAbandon]);for(var c=(0,WO.I4)((function(e){return k7({lockAPI:s,registry:r,store:n,draggableId:e})}),[s,r,n]),u=(0,WO.I4)((function(e,o,i){return function(e){var t=e.lockAPI,n=e.contextId,r=e.store,o=e.registry,i=e.draggableId,a=e.forceSensorStop,s=e.sourceEvent;if(!k7({lockAPI:t,store:r,registry:o,draggableId:i}))return null;var l=o.draggable.getById(i),c=function(e,t){var n="["+O9.contextId+'="'+e+'"]',r=y8(_8(document.querySelectorAll(n)),(function(e){return e.getAttribute(O9.id)===t}));return r&&W9(r)?r:null}(n,l.descriptor.id);if(!c)return null;if(s&&!l.options.canDragInteractiveElements&&m7(c,s))return null;var u=t.claim(a||$4),d="PRE_DRAG";function p(){return l.options.shouldRespectForcePress}function h(){return t.isActive(u)}var m=function(e,t){_7({expected:e,phase:d,isLockActive:h,shouldWarn:!0})&&r.dispatch(t())}.bind(null,"DRAGGING");function f(e){function n(){t.release(),d="COMPLETED"}function o(t,o){if(void 0===o&&(o={shouldBlockNextClick:!1}),e.cleanup(),o.shouldBlockNextClick){var i=W4(window,[{eventName:"click",fn:y7,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(i)}n(),r.dispatch(Z6({reason:t}))}return"PRE_DRAG"!==d&&(n(),"PRE_DRAG"!==d&&Y4(!1)),r.dispatch(I6(e.liftActionArgs)),d="DRAGGING",(0,Z3.Z)({isActive:function(){return _7({expected:"DRAGGING",phase:d,isLockActive:h,shouldWarn:!1})},shouldRespectForcePress:p,drop:function(e){return o("DROP",e)},cancel:function(e){return o("CANCEL",e)}},e.actions)}var g={isActive:function(){return _7({expected:"PRE_DRAG",phase:d,isLockActive:h,shouldWarn:!1})},shouldRespectForcePress:p,fluidLift:function(e){var t=H4((function(e){m((function(){return B6({client:e})}))})),n=f({liftActionArgs:{id:i,clientSelection:e,movementMode:"FLUID"},cleanup:function(){return t.cancel()},actions:{move:t}});return(0,Z3.Z)({},n,{move:t})},snapLift:function(){var e={moveUp:function(){return m(L6)},moveRight:function(){return m(D6)},moveDown:function(){return m(M6)},moveLeft:function(){return m(O6)}};return f({liftActionArgs:{id:i,clientSelection:f7(c),movementMode:"SNAP"},cleanup:$4,actions:e})},abort:function(){_7({expected:"PRE_DRAG",phase:d,isLockActive:h,shouldWarn:!0})&&t.release()}};return g}({lockAPI:s,registry:r,contextId:t,store:n,draggableId:e,forceSensorStop:o,sourceEvent:i&&i.sourceEvent?i.sourceEvent:null})}),[t,s,r,n]),d=(0,WO.I4)((function(e){return function(e,t){var n=function(e,t){var n,r=t.target;if(!((n=r)instanceof $9(n).Element))return null;var o=function(e){return"["+D9.contextId+'="'+e+'"]'}(e),i=v7(r,o);return i&&W9(i)?i:null}(e,t);return n?n.getAttribute(D9.draggableId):null}(t,e)}),[t]),p=(0,WO.I4)((function(e){var t=r.draggable.findById(e);return t?t.options:null}),[r.draggable]),h=(0,WO.I4)((function(){s.isClaimed()&&(s.tryAbandon(),"IDLE"!==n.getState().phase&&n.dispatch(F6()))}),[s,n]),m=(0,WO.I4)(s.isClaimed,[s]),f=(0,WO.Ye)((function(){return{canGetLock:c,tryGetLock:u,findClosestDraggableId:d,findOptionsForDraggable:p,tryReleaseLock:h,isLockClaimed:m}}),[c,u,d,p,h,m]),g=0;g<a.length;g++)a[g](f)}var C7=function(e){return{onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragUpdate:e.onDragUpdate}};function x7(e){return e.current||Y4(!1),e.current}function S7(e){var t=e.contextId,n=e.setCallbacks,r=e.sensors,o=e.nonce,i=e.dragHandleUsageInstructions,a=(0,x.useRef)(null),s=n7(e),l=(0,WO.I4)((function(){return C7(s.current)}),[s]),c=function(e){var t=(0,WO.Ye)((function(){return X9(e)}),[e]),n=(0,x.useRef)(null);return(0,x.useEffect)((function(){var e=document.createElement("div");return n.current=e,e.id=t,e.setAttribute("aria-live","assertive"),e.setAttribute("aria-atomic","true"),(0,Z3.Z)(e.style,Y9),K9().appendChild(e),function(){setTimeout((function(){var t=K9();t.contains(e)&&t.removeChild(e),e===n.current&&(n.current=null)}))}}),[t]),(0,WO.I4)((function(e){var t=n.current;t&&(t.textContent=e)}),[])}(t),u=function(e){var t=e.contextId,n=e.text,r=e7("hidden-text",{separator:"-"}),o=(0,WO.Ye)((function(){return function(e){return"rbd-hidden-text-"+e.contextId+"-"+e.uniqueId}({contextId:t,uniqueId:r})}),[r,t]);return(0,x.useEffect)((function(){var e=document.createElement("div");return e.id=o,e.textContent=n,e.style.display="none",K9().appendChild(e),function(){var t=K9();t.contains(e)&&t.removeChild(e)}}),[o,n]),o}({contextId:t,text:i}),d=function(e,t){var n=(0,WO.Ye)((function(){return z9(e)}),[e]),r=(0,x.useRef)(null),o=(0,x.useRef)(null),i=(0,WO.I4)(V4((function(e){var t=o.current;t||Y4(!1),t.textContent=e})),[]),a=(0,WO.I4)((function(e){var t=r.current;t||Y4(!1),t.textContent=e}),[]);V9((function(){(r.current||o.current)&&Y4(!1);var s=U9(t),l=U9(t);return r.current=s,o.current=l,s.setAttribute(M9+"-always",e),l.setAttribute(M9+"-dynamic",e),H9().appendChild(s),H9().appendChild(l),a(n.always),i(n.resting),function(){var e=function(e){var t=e.current;t||Y4(!1),H9().removeChild(t),e.current=null};e(r),e(o)}}),[t,a,i,n.always,n.resting,e]);var s=(0,WO.I4)((function(){return i(n.dragging)}),[i,n.dragging]),l=(0,WO.I4)((function(e){i("DROP"!==e?n.userCancel:n.dropAnimating)}),[i,n.dropAnimating,n.userCancel]),c=(0,WO.I4)((function(){o.current&&i(n.resting)}),[i,n.resting]);return(0,WO.Ye)((function(){return{dragging:s,dropping:l,resting:c}}),[s,l,c])}(t,o),p=(0,WO.I4)((function(e){x7(a).dispatch(e)}),[]),h=(0,WO.Ye)((function(){return(0,z3.DE)({publishWhileDragging:T6,updateDroppableScroll:P6,updateDroppableIsEnabled:R6,updateDroppableIsCombineEnabled:A6,collectionStarting:N6},p)}),[p]),m=function(){var e=(0,WO.Ye)(G9,[]);return(0,x.useEffect)((function(){return function(){requestAnimationFrame(e.clean)}}),[e]),e}(),f=(0,WO.Ye)((function(){return f9(m,h)}),[m,h]),g=(0,WO.Ye)((function(){return L9((0,Z3.Z)({scrollWindow:b9,scrollDroppable:f.scrollDroppable},(0,z3.DE)({move:B6},p)))}),[f.scrollDroppable,p]),b=function(e){var t=(0,x.useRef)({}),n=(0,x.useRef)(null),r=(0,x.useRef)(null),o=(0,x.useRef)(!1),i=(0,WO.I4)((function(e,n){var r={id:e,focus:n};return t.current[e]=r,function(){var n=t.current;n[e]!==r&&delete n[e]}}),[]),a=(0,WO.I4)((function(t){var n=function(e,t){var n="["+D9.contextId+'="'+e+'"]',r=_8(document.querySelectorAll(n));if(!r.length)return null;var o=y8(r,(function(e){return e.getAttribute(D9.draggableId)===t}));return o&&W9(o)?o:null}(e,t);n&&n!==document.activeElement&&n.focus()}),[e]),s=(0,WO.I4)((function(e,t){n.current===e&&(n.current=t)}),[]),l=(0,WO.I4)((function(){r.current||o.current&&(r.current=requestAnimationFrame((function(){r.current=null;var e=n.current;e&&a(e)})))}),[a]),c=(0,WO.I4)((function(e){n.current=null;var t=document.activeElement;t&&t.getAttribute(D9.draggableId)===e&&(n.current=e)}),[]);return V9((function(){return o.current=!0,function(){o.current=!1;var e=r.current;e&&cancelAnimationFrame(e)}}),[]),(0,WO.Ye)((function(){return{register:i,tryRecordFocus:c,tryRestoreFocusRecorded:l,tryShiftRecord:s}}),[i,c,l,s])}(t),v=(0,WO.Ye)((function(){return l9({announce:c,autoScroller:g,dimensionMarshal:f,focusMarshal:b,getResponders:l,styleMarshal:d})}),[c,g,f,b,l,d]);a.current=v;var y=(0,WO.I4)((function(){var e=x7(a);"IDLE"!==e.getState().phase&&e.dispatch(F6())}),[]),_=(0,WO.I4)((function(){var e=x7(a).getState();return e.isDragging||"DROP_ANIMATING"===e.phase}),[]);n((0,WO.Ye)((function(){return{isDragging:_,tryAbort:y}}),[_,y]));var k=(0,WO.I4)((function(e){return g9(x7(a).getState(),e)}),[]),w=(0,WO.I4)((function(){return d6(x7(a).getState())}),[]),E=(0,WO.Ye)((function(){return{marshal:f,focus:b,contextId:t,canLift:k,isMovementAllowed:w,dragHandleUsageInstructionsId:u,registry:m}}),[t,f,u,b,k,w,m]);return E7({contextId:t,store:v,registry:m,customSensors:r,enableDefaultSensors:!1!==e.enableDefaultSensors}),(0,x.useEffect)((function(){return y}),[y]),x.createElement(t7.Provider,{value:E},x.createElement(q3,{context:q9,store:v},e.children))}var I7=0;function T7(e){var t=(0,WO.Ye)((function(){return""+I7++}),[]),n=e.dragHandleUsageInstructions||n8.dragHandleUsageInstructions;return x.createElement(X4,null,(function(r){return x.createElement(S7,{nonce:e.nonce,contextId:t,setCallbacks:r,dragHandleUsageInstructions:n,enableDefaultSensors:e.enableDefaultSensors,sensors:e.sensors,onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragUpdate:e.onDragUpdate,onDragEnd:e.onDragEnd},e.children)}))}var N7=function(e){return function(t){return e===t}},P7=N7("scroll"),R7=N7("auto"),A7=(N7("visible"),function(e,t){return t(e.overflowX)||t(e.overflowY)}),B7=function e(t){return null==t||t===document.body||t===document.documentElement?null:function(e){var t=window.getComputedStyle(e),n={overflowX:t.overflowX,overflowY:t.overflowY};return A7(n,P7)||A7(n,R7)}(t)?t:e(t.parentElement)},L7=function(e){return{x:e.scrollLeft,y:e.scrollTop}},M7=function e(t){return!!t&&("fixed"===window.getComputedStyle(t).position||e(t.parentElement))},D7={passive:!1},O7={passive:!0},F7=function(e){return e.shouldPublishImmediately?D7:O7};function j7(e){var t=(0,x.useContext)(e);return t||Y4(!1),t}var Z7=function(e){return e&&e.env.closestScrollable||null};function z7(){}var V7={width:0,height:0,margin:{top:0,right:0,bottom:0,left:0}},H7=x.memo((function(e){var t=(0,x.useRef)(null),n=(0,WO.I4)((function(){t.current&&(clearTimeout(t.current),t.current=null)}),[]),r=e.animate,o=e.onTransitionEnd,i=e.onClose,a=e.contextId,s=(0,x.useState)("open"===e.animate),l=s[0],c=s[1];(0,x.useEffect)((function(){return l?"open"!==r?(n(),c(!1),z7):t.current?z7:(t.current=setTimeout((function(){t.current=null,c(!1)})),n):z7}),[r,l,n]);var u=(0,WO.I4)((function(e){"height"===e.propertyName&&(o(),"close"===r&&i())}),[r,i,o]),d=function(e){var t=e.isAnimatingOpenOnMount,n=e.placeholder,r=e.animate,o=function(e){var t=e.placeholder;return e.isAnimatingOpenOnMount||"close"===e.animate?V7:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin}}({isAnimatingOpenOnMount:t,placeholder:n,animate:r});return{display:n.display,boxSizing:"border-box",width:o.width,height:o.height,marginTop:o.margin.top,marginRight:o.margin.right,marginBottom:o.margin.bottom,marginLeft:o.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:"none"!==r?W6.placeholder:null}}({isAnimatingOpenOnMount:l,animate:e.animate,placeholder:e.placeholder});return x.createElement(e.placeholder.tagName,{style:d,"data-rbd-placeholder-context-id":a,onTransitionEnd:u,ref:e.innerRef})})),U7=x.createContext(null),$7=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).state={isVisible:Boolean(t.props.on),data:t.props.on,animate:t.props.shouldAnimate&&t.props.on?"open":"none"},t.onClose=function(){"close"===t.state.animate&&t.setState({isVisible:!1})},t}return(0,j3.Z)(t,e),t.getDerivedStateFromProps=function(e,t){return e.shouldAnimate?e.on?{isVisible:!0,data:e.on,animate:"open"}:t.isVisible?{isVisible:!0,data:t.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:Boolean(e.on),data:e.on,animate:"none"}},t.prototype.render=function(){if(!this.state.isVisible)return null;var e={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(e)},t}(x.PureComponent),W7=5e3,G7=4500,q7=function(e,t){return t?W6.drop(t.duration):e?W6.snap:W6.fluid},K7=function(e,t){return e?t?V6:H6:null};function Y7(e){e.preventDefault()}var X7=function(e,t){return e===t},J7=function(e){var t=e.combine,n=e.destination;return n?n.droppableId:t?t.droppableId:null};function Q7(e){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}var eee={mapped:{type:"SECONDARY",offset:r8,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:Q7(null)}},tee=T4((function(){var e,t,n,r=(e=V4((function(e,t){return{x:e,y:t}})),t=V4((function(e,t,n,r,o){return{isDragging:!0,isClone:t,isDropAnimating:Boolean(o),dropAnimation:o,mode:e,draggingOver:n,combineWith:r,combineTargetFor:null}})),n=V4((function(e,n,r,o,i,a,s){return{mapped:{type:"DRAGGING",dropping:null,draggingOver:i,combineWith:a,mode:n,offset:e,dimension:r,forceShouldAnimate:s,snapshot:t(n,o,i,a,null)}}})),function(r,o){if(r.isDragging){if(r.critical.draggable.id!==o.draggableId)return null;var i=r.current.client.offset,a=r.dimensions.draggables[o.draggableId],s=c6(r.impact),l=(u=r.impact).at&&"COMBINE"===u.at.type?u.at.combine.draggableId:null,c=r.forceShouldAnimate;return n(e(i.x,i.y),r.movementMode,a,o.isClone,s,l,c)}var u;if("DROP_ANIMATING"===r.phase){var d=r.completed;if(d.result.draggableId!==o.draggableId)return null;var p=o.isClone,h=r.dimensions.draggables[o.draggableId],m=d.result,f=m.mode,g=J7(m),b=function(e){return e.combine?e.combine.draggableId:null}(m),v={duration:r.dropDuration,curve:z6,moveTo:r.newHomeClientOffset,opacity:b?V6:null,scale:b?U6:null};return{mapped:{type:"DRAGGING",offset:r.newHomeClientOffset,dimension:h,dropping:v,draggingOver:g,combineWith:b,mode:f,forceShouldAnimate:null,snapshot:t(f,p,g,b,v)}}}return null}),o=function(){var e=V4((function(e,t){return{x:e,y:t}})),t=V4(Q7),n=V4((function(e,n,r){return void 0===n&&(n=null),{mapped:{type:"SECONDARY",offset:e,combineTargetFor:n,shouldAnimateDisplacement:r,snapshot:t(n)}}})),r=function(e){return e?n(r8,e,!0):null},o=function(t,o,i,a){var s=i.displaced.visible[t],l=Boolean(a.inVirtualList&&a.effected[t]),c=I8(i),u=c&&c.draggableId===t?o:null;if(!s){if(!l)return r(u);if(i.displaced.invisible[t])return null;var d=s8(a.displacedBy.point),p=e(d.x,d.y);return n(p,u,!0)}if(l)return r(u);var h=i.displacedBy.point,m=e(h.x,h.y);return n(m,u,s.shouldAnimate)};return function(e,t){if(e.isDragging)return e.critical.draggable.id===t.draggableId?null:o(t.draggableId,e.critical.draggable.id,e.impact,e.afterCritical);if("DROP_ANIMATING"===e.phase){var n=e.completed;return n.result.draggableId===t.draggableId?null:o(t.draggableId,n.result.draggableId,n.impact,n.afterCritical)}return null}}();return function(e,t){return r(e,t)||o(e,t)||eee}}),{dropAnimationFinished:function(){return{type:"DROP_ANIMATION_FINISHED",payload:null}}},null,{context:q9,pure:!0,areStatePropsEqual:X7})((function(e){var t=(0,x.useRef)(null),n=(0,WO.I4)((function(e){t.current=e}),[]),r=(0,WO.I4)((function(){return t.current}),[]),o=j7(t7),i=o.contextId,a=o.dragHandleUsageInstructionsId,s=o.registry,l=j7(U7),c=l.type,u=l.droppableId,d=(0,WO.Ye)((function(){return{id:e.draggableId,index:e.index,type:c,droppableId:u}}),[e.draggableId,e.index,c,u]),p=e.children,h=e.draggableId,m=e.isEnabled,f=e.shouldRespectForcePress,g=e.canDragInteractiveElements,b=e.isClone,v=e.mapped,y=e.dropAnimationFinished;b||function(e){var t=e7("draggable"),n=e.descriptor,r=e.registry,o=e.getDraggableRef,i=e.canDragInteractiveElements,a=e.shouldRespectForcePress,s=e.isEnabled,l=(0,WO.Ye)((function(){return{canDragInteractiveElements:i,shouldRespectForcePress:a,isEnabled:s}}),[i,s,a]),c=(0,WO.I4)((function(e){var t=o();return t||Y4(!1),function(e,t,n){void 0===n&&(n=r8);var r=window.getComputedStyle(t),o=t.getBoundingClientRect(),i=F4(o,r),a=O4(i,n);return{descriptor:e,placeholder:{client:i,tagName:t.tagName.toLowerCase(),display:r.display},displaceBy:{x:i.marginBox.width,y:i.marginBox.height},client:i,page:a}}(n,t,e)}),[n,o]),u=(0,WO.Ye)((function(){return{uniqueId:t,descriptor:n,options:l,getDimension:c}}),[n,c,l,t]),d=(0,x.useRef)(u),p=(0,x.useRef)(!0);V9((function(){return r.draggable.register(d.current),function(){return r.draggable.unregister(d.current)}}),[r.draggable]),V9((function(){if(p.current)p.current=!1;else{var e=d.current;d.current=u,r.draggable.update(u,e)}}),[u,r.draggable])}((0,WO.Ye)((function(){return{descriptor:d,registry:s,getDraggableRef:r,canDragInteractiveElements:g,shouldRespectForcePress:f,isEnabled:m}}),[d,s,r,g,f,m]));var _=(0,WO.Ye)((function(){return m?{tabIndex:0,role:"button","aria-describedby":a,"data-rbd-drag-handle-draggable-id":h,"data-rbd-drag-handle-context-id":i,draggable:!1,onDragStart:Y7}:null}),[i,a,h,m]),k=(0,WO.I4)((function(e){"DRAGGING"===v.type&&v.dropping&&"transform"===e.propertyName&&y()}),[y,v]),w=(0,WO.Ye)((function(){var e=function(e){return"DRAGGING"===e.type?function(e){var t=e.dimension.client,n=e.offset,r=e.combineWith,o=e.dropping,i=Boolean(r),a=function(e){return null!=e.forceShouldAnimate?e.forceShouldAnimate:"SNAP"===e.mode}(e),s=Boolean(o),l=s?K6(n,i):q6(n);return{position:"fixed",top:t.marginBox.top,left:t.marginBox.left,boxSizing:"border-box",width:t.borderBox.width,height:t.borderBox.height,transition:q7(a,o),transform:l,opacity:K7(i,s),zIndex:s?G7:W7,pointerEvents:"none"}}(e):{transform:q6((t=e).offset),transition:t.shouldAnimateDisplacement?null:"none"};var t}(v),t="DRAGGING"===v.type&&v.dropping?k:null;return{innerRef:n,draggableProps:{"data-rbd-draggable-context-id":i,"data-rbd-draggable-id":h,style:e,onTransitionEnd:t},dragHandleProps:_}}),[i,_,h,v,k,n]),E=(0,WO.Ye)((function(){return{draggableId:d.id,type:d.type,source:{index:d.index,droppableId:d.droppableId}}}),[d.droppableId,d.id,d.index,d.type]);return p(w,v.snapshot,E)}));function nee(e){return j7(U7).isUsingCloneFor!==e.draggableId||e.isClone?x.createElement(tee,e):null}function ree(e){var t="boolean"!=typeof e.isDragDisabled||!e.isDragDisabled,n=Boolean(e.disableInteractiveElementBlocking),r=Boolean(e.shouldRespectForcePress);return x.createElement(nee,(0,Z3.Z)({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:n,shouldRespectForcePress:r}))}var oee=function(e,t){return e===t.droppable.type},iee=function(e,t){return t.draggables[e.draggable.id]},aee={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:function(){return document.body||Y4(!1),document.body}},see=T4((function(){var e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t=(0,Z3.Z)({},e,{shouldAnimatePlaceholder:!1}),n=V4((function(e){return{draggableId:e.id,type:e.type,source:{index:e.index,droppableId:e.droppableId}}})),r=V4((function(r,o,i,a,s,l){var c=s.descriptor.id;if(s.descriptor.droppableId===r){var u=l?{render:l,dragging:n(s.descriptor)}:null,d={isDraggingOver:i,draggingOverWith:i?c:null,draggingFromThisWith:c,isUsingPlaceholder:!0};return{placeholder:s.placeholder,shouldAnimatePlaceholder:!1,snapshot:d,useClone:u}}if(!o)return t;if(!a)return e;var p={isDraggingOver:i,draggingOverWith:c,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:s.placeholder,shouldAnimatePlaceholder:!0,snapshot:p,useClone:null}}));return function(n,o){var i=o.droppableId,a=o.type,s=!o.isDropDisabled,l=o.renderClone;if(n.isDragging){var c=n.critical;if(!oee(a,c))return t;var u=iee(c,n.dimensions),d=c6(n.impact)===i;return r(i,s,d,d,u,l)}if("DROP_ANIMATING"===n.phase){var p=n.completed;if(!oee(a,p.critical))return t;var h=iee(p.critical,n.dimensions);return r(i,s,J7(p.result)===i,c6(p.impact)===i,h,l)}if("IDLE"===n.phase&&n.completed&&!n.shouldFlush){var m=n.completed;if(!oee(a,m.critical))return t;var f=c6(m.impact)===i,g=Boolean(m.impact.at&&"COMBINE"===m.impact.at.type),b=m.critical.droppable.id===i;return f?g?e:t:b?e:t}return t}}),{updateViewportMaxScroll:function(e){return{type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:e}}},null,{context:q9,pure:!0,areStatePropsEqual:X7})((function(e){var t=(0,x.useContext)(t7);t||Y4(!1);var n=t.contextId,r=t.isMovementAllowed,o=(0,x.useRef)(null),i=(0,x.useRef)(null),a=e.children,s=e.droppableId,l=e.type,c=e.mode,u=e.direction,d=e.ignoreContainerClipping,p=e.isDropDisabled,h=e.isCombineEnabled,m=e.snapshot,f=e.useClone,g=e.updateViewportMaxScroll,b=e.getContainerForClone,v=(0,WO.I4)((function(){return o.current}),[]),y=(0,WO.I4)((function(e){o.current=e}),[]),_=((0,WO.I4)((function(){return i.current}),[]),(0,WO.I4)((function(e){i.current=e}),[])),k=(0,WO.I4)((function(){r()&&g({maxScroll:d9()})}),[r,g]);!function(e){var t=(0,x.useRef)(null),n=j7(t7),r=e7("droppable"),o=n.registry,i=n.marshal,a=n7(e),s=(0,WO.Ye)((function(){return{id:e.droppableId,type:e.type,mode:e.mode}}),[e.droppableId,e.mode,e.type]),l=(0,x.useRef)(s),c=(0,WO.Ye)((function(){return V4((function(e,n){t.current||Y4(!1);var r={x:e,y:n};i.updateDroppableScroll(s.id,r)}))}),[s.id,i]),u=(0,WO.I4)((function(){var e=t.current;return e&&e.env.closestScrollable?L7(e.env.closestScrollable):r8}),[]),d=(0,WO.I4)((function(){var e=u();c(e.x,e.y)}),[u,c]),p=(0,WO.Ye)((function(){return H4(d)}),[d]),h=(0,WO.I4)((function(){var e=t.current,n=Z7(e);e&&n||Y4(!1),e.scrollOptions.shouldPublishImmediately?d():p()}),[p,d]),m=(0,WO.I4)((function(e,r){t.current&&Y4(!1);var o=a.current,i=o.getDroppableRef();i||Y4(!1);var l=function(e){return{closestScrollable:B7(e),isFixedOnPage:M7(e)}}(i),c={ref:i,descriptor:s,env:l,scrollOptions:r};t.current=c;var u=function(e){var t=e.ref,n=e.descriptor,r=e.env,o=e.windowScroll,i=e.direction,a=e.isDropDisabled,s=e.isCombineEnabled,l=e.shouldClipSubject,c=r.closestScrollable,u=function(e,t){var n=j4(e);if(!t)return n;if(e!==t)return n;var r=n.paddingBox.top-t.scrollTop,o=n.paddingBox.left-t.scrollLeft,i=r+t.scrollHeight,a=o+t.scrollWidth,s=R4({top:r,right:a,bottom:i,left:o},n.border);return L4({borderBox:s,margin:n.margin,border:n.border,padding:n.padding})}(t,c),d=O4(u,o),p=function(){if(!c)return null;var e=j4(c),t={scrollHeight:c.scrollHeight,scrollWidth:c.scrollWidth};return{client:e,page:O4(e,o),scroll:L7(c),scrollSize:t,shouldClipSubject:l}}(),h=function(e){var t=e.descriptor,n=e.isEnabled,r=e.isCombineEnabled,o=e.isFixedOnPage,i=e.direction,a=e.client,s=e.page,l=e.closest,c=function(){if(!l)return null;var e=l.scrollSize,t=l.client,n=c9({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,height:t.paddingBox.height,width:t.paddingBox.width});return{pageMarginBox:l.page.marginBox,frameClient:t,scrollSize:e,shouldClipSubject:l.shouldClipSubject,scroll:{initial:l.scroll,current:l.scroll,max:n,diff:{value:r8,displacement:r8}}}}(),u="vertical"===i?D8:O8;return{descriptor:t,isCombineEnabled:r,isFixedOnPage:o,axis:u,isEnabled:n,client:a,page:s,frame:c,subject:f8({page:s,withPlaceholder:null,axis:u,frame:c})}}({descriptor:n,isEnabled:!a,isCombineEnabled:s,isFixedOnPage:r.isFixedOnPage,direction:i,client:u,page:d,closest:p});return h}({ref:i,descriptor:s,env:l,windowScroll:e,direction:o.direction,isDropDisabled:o.isDropDisabled,isCombineEnabled:o.isCombineEnabled,shouldClipSubject:!o.ignoreContainerClipping}),d=l.closestScrollable;return d&&(d.setAttribute(j9.contextId,n.contextId),d.addEventListener("scroll",h,F7(c.scrollOptions))),u}),[n.contextId,s,h,a]),f=(0,WO.I4)((function(){var e=t.current,n=Z7(e);return e&&n||Y4(!1),L7(n)}),[]),g=(0,WO.I4)((function(){var e=t.current;e||Y4(!1);var n=Z7(e);t.current=null,n&&(p.cancel(),n.removeAttribute(j9.contextId),n.removeEventListener("scroll",h,F7(e.scrollOptions)))}),[h,p]),b=(0,WO.I4)((function(e){var n=t.current;n||Y4(!1);var r=Z7(n);r||Y4(!1),r.scrollTop+=e.y,r.scrollLeft+=e.x}),[]),v=(0,WO.Ye)((function(){return{getDimensionAndWatchScroll:m,getScrollWhileDragging:f,dragStopped:g,scroll:b}}),[g,m,f,b]),y=(0,WO.Ye)((function(){return{uniqueId:r,descriptor:s,callbacks:v}}),[v,s,r]);V9((function(){return l.current=y.descriptor,o.droppable.register(y),function(){t.current&&g(),o.droppable.unregister(y)}}),[v,s,g,y,i,o.droppable]),V9((function(){t.current&&i.updateDroppableIsEnabled(l.current.id,!e.isDropDisabled)}),[e.isDropDisabled,i]),V9((function(){t.current&&i.updateDroppableIsCombineEnabled(l.current.id,e.isCombineEnabled)}),[e.isCombineEnabled,i])}({droppableId:s,type:l,mode:c,direction:u,isDropDisabled:p,isCombineEnabled:h,ignoreContainerClipping:d,getDroppableRef:v});var w=x.createElement($7,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},(function(e){var t=e.onClose,r=e.data,o=e.animate;return x.createElement(H7,{placeholder:r,onClose:t,innerRef:_,animate:o,contextId:n,onTransitionEnd:k})})),E=(0,WO.Ye)((function(){return{innerRef:y,placeholder:w,droppableProps:{"data-rbd-droppable-id":s,"data-rbd-droppable-context-id":n}}}),[n,s,w,y]),C=f?f.dragging.draggableId:null,S=(0,WO.Ye)((function(){return{droppableId:s,type:l,isUsingCloneFor:C}}),[s,C,l]);return x.createElement(U7.Provider,{value:S},a(E,m),function(){if(!f)return null;var e=f.dragging,t=f.render,n=x.createElement(nee,{draggableId:e.draggableId,index:e.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(function(n,r){return t(n,r,e)}));return eT.createPortal(n,b())}())}));function lee({value:e,remove:t,onUpdate:n,onCheck:r,index:o}){return(0,Cw.jsxs)("div",{className:"mailpoet-form-segments-settings-list","data-automation-id":"custom_field_value_settings",children:[(0,Cw.jsx)("input",{type:"checkbox",defaultChecked:e.isChecked||!1,onChange:t=>r(e.id,t.target.checked)},`check-${e.id}`),(0,Cw.jsx)("input",{type:"text",value:e.name,"data-automation-id":"custom_field_value_settings_value",onChange:t=>n(e.id,t.target.value)}),0!==o&&(0,Cw.jsx)(F3.Z,{icon:"no-alt",color:"#900",className:"mailpoet-form-segments-segment-remove",onClick:(0,$2.partial)(t,e.id)})]},e.id)}function cee({values:e,update:t,remove:n,onReorder:r}){const[o,i]=(0,x.useState)(e);if((0,x.useEffect)((()=>{i(e)}),[e]),0===o.length)return null;const a=(e,n)=>{const r=o.find((t=>t.id===e));r.name=n,t(r)},s=(e,n)=>{const r=o.find((t=>t.id===e));if(n){const e=o.find((e=>e.isChecked));e&&(delete e.isChecked,t(e)),r.isChecked=!0}else delete r.isChecked;t(r)};return(0,Cw.jsx)("div",{className:"mailpoet-dnd-items-list",children:(0,Cw.jsx)(T7,{onDragEnd:e=>{const t=e.source.index,n=e.destination.index,a=[...o],[s]=a.splice(t,1);a.splice(n,0,s),i(a),r(a)},children:(0,Cw.jsx)(see,{droppableId:"droppable",children:e=>(0,Cw.jsxs)("div",{...e.droppableProps,ref:e.innerRef,children:[o.map(((e,t)=>(0,Cw.jsx)(ree,{draggableId:e.id,index:t,children:r=>(0,Cw.jsx)("div",{ref:r.innerRef,...r.draggableProps,...r.dragHandleProps,children:(0,Cw.jsx)(lee,{index:t,value:e,remove:n,onCheck:s,onUpdate:a},`inner${e.id}`)})},e.id))),e.placeholder]})})})})}function uee({label:e,mandatory:t,values:n,isSaving:r,onSave:o,isDeleting:i,onCustomFieldDelete:a,onChange:s,useDragAndDrop:l}){const[c,u]=(0,x.useState)(e),[d,p]=(0,x.useState)(t),[h,m]=(0,x.useState)(JSON.parse(JSON.stringify(n))),f=(0,x.useMemo)((()=>({label:c,mandatory:d,values:h,isValid:(0,$2.reduce)(h,((e,t)=>!(0,$2.isEmpty)(t.name)&&e),!0)})),[c,d,h]),g=d!==t||!(0,$2.isEqualWith)(n,h)||c!==e;return(0,x.useEffect)((()=>{s&&s(f,g)}),[f,s,g]),(0,Cw.jsxs)("div",{className:"custom-field-settings","data-automation-id":"custom_field_settings",children:[(0,Cw.jsx)(QS.Z,{label:O2.MailPoet.I18n.t("label"),value:c,"data-automation-id":"settings_custom_text_label_input",onChange:u}),(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("blockMandatory"),checked:d,onChange:p}),(0,Cw.jsx)(cee,{remove:e=>{m(h.filter((t=>e!==t.id)))},update:e=>{m(h.map((t=>e.id!==t.id?t:e)))},values:h,onReorder:m,useDragAndDrop:l}),(0,Cw.jsx)(Gh.ZP,{variant:"link",onClick:()=>m([...h,{id:`${1e3*Math.random()}-${Date.now()}`,name:`Option ${h.length+1}`}]),className:"button-on-top","data-automation-id":"custom_field_values_add_item",children:O2.MailPoet.I18n.t("customFieldAddItem")}),(0,Cw.jsx)("br",{}),o?(0,Cw.jsx)(Gh.ZP,{variant:"primary",onClick:()=>o({mandatory:d,values:h,label:c}),isBusy:r,disabled:r||!g,className:"button-on-top","data-automation-id":"custom_field_save",children:O2.MailPoet.I18n.t("customFieldSaveCTA")}):null,a?(0,Cw.jsx)(n3,{isBusy:r||i,onDelete:a}):null]})}function dee({attributes:e,setAttributes:t,clientId:n}){const r=(0,yl.Z)((e=>e(H2).getIsCustomFieldSaving()),[]),o=(0,yl.Z)((e=>e(H2).getIsCustomFieldDeleting()),[]),{saveCustomField:i,deleteCustomField:a,customFieldEdited:s}=(0,_l.Z)(H2),l=(0,Cw.jsxs)(qI,{children:[(0,Cw.jsx)(t3.Z,{children:(0,Cw.jsx)(tI.ZP,{title:O2.MailPoet.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,Cw.jsx)(uee,{label:e.label,mandatory:e.mandatory,values:e.values,isSaving:r,onSave:n=>i({customFieldId:e.customFieldId,data:{params:u3("radio",n)},onFinish:()=>t({mandatory:n.mandatory,values:n.values,label:n.label})}),onCustomFieldDelete:()=>a(e.customFieldId,n),isDeleting:o,onChange:(e,t)=>t&&s()})})}),(0,Cw.jsx)(t3.Z,{children:(0,Cw.jsx)(tI.ZP,{title:O2.MailPoet.I18n.t("formSettings"),initialOpen:!0,children:(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("displayLabel"),checked:!e.hideLabel,onChange:e=>t({hideLabel:!e})})})})]});return(0,Cw.jsxs)(c3,{className:e.className,children:[l,(0,Cw.jsx)("span",{className:"mailpoet_radio_label","data-automation-id":"editor_custom_field_radio_buttons_block",children:e.hideLabel?null:o3(e)}),Array.isArray(e.values)&&e.values.map((e=>(0,Cw.jsx)("div",{children:(0,Cw.jsxs)("label",{children:[(0,Cw.jsx)("input",{type:"radio",disabled:!0,checked:e.isChecked||!1,className:"mailpoet_radio"}),e.name]})},e.id)))]})}function pee(e){const t=parseInt(e,10);if(!Number.isNaN(t))return t}see.defaultProps=aee,lee.propTypes={value:Z2().shape({name:Z2().string.isRequired,id:Z2().string.isRequired,isChecked:Z2().bool}).isRequired,onUpdate:Z2().func.isRequired,onCheck:Z2().func.isRequired,index:Z2().number.isRequired,remove:Z2().func.isRequired},cee.propTypes={values:Z2().arrayOf(Z2().shape({name:Z2().string.isRequired,id:Z2().string.isRequired}).isRequired).isRequired,update:Z2().func.isRequired,remove:Z2().func.isRequired,onReorder:Z2().func.isRequired},uee.propTypes={label:Z2().string,mandatory:Z2().bool,values:Z2().arrayOf(Z2().shape({name:Z2().string.isRequired,id:Z2().string.isRequired})),onSave:Z2().func,isSaving:Z2().bool,isDeleting:Z2().bool,onCustomFieldDelete:Z2().func,onChange:Z2().func,useDragAndDrop:Z2().bool},uee.defaultProps={label:"",mandatory:!1,isSaving:!1,values:[],isDeleting:!1,onCustomFieldDelete:null,onSave:null,onChange:null,useDragAndDrop:!0},dee.propTypes={attributes:Z2().shape({label:Z2().string.isRequired,customFieldId:Z2().number.isRequired,values:Z2().arrayOf(Z2().shape({name:Z2().string.isRequired,id:Z2().string.isRequired,isChecked:Z2().bool})),mandatory:Z2().bool.isRequired,hideLabel:Z2().bool,className:Z2().string}).isRequired,setAttributes:Z2().func.isRequired,clientId:Z2().string.isRequired};let hee=function(e){return e.Divider="divider",e.Spacer="spacer",e}({}),mee=function(e){return e.Solid="solid",e.Dashed="dashed",e.Dotted="dotted",e}({});const fee={className:void 0,height:1,type:hee.Divider,style:mee.Solid,dividerHeight:1,dividerWidth:100,color:"black"},gee=()=>`${Math.random().toString()}-${Date.now()}`,bee=e=>e.map((e=>{const t={name:e.value,id:gee()};return(0,$2.has)(e,"is_checked")&&e.is_checked&&(t.isChecked=!0),t})),vee=(e,t,n,r=[])=>{if(!Array.isArray(r))throw new Error("Mapper expects customFields to be an array.");return o=>{if(!Array.isArray(o))throw new Error("Mapper expects form body to be an array.");return o.map((o=>{if(["column","columns"].includes(o.type))return((e,t,n,r,o=[])=>{const i=vee(t,n,r,o),a={clientId:gee(),name:`core/${e.type}`,isValid:!0,attributes:{style:{color:{}}},innerBlocks:i(e.body?e.body:[])},s=g3(n,e.params.text_color),l=g3(n,e.params.background_color),c=b3(r,e.params.gradient);return(0,$2.has)(e.params,"width")&&(a.attributes.width=Number.isNaN(Number(e.params.width))?e.params.width:`${e.params.width}%`),(0,$2.has)(e.params,"vertical_alignment")&&(a.attributes.verticalAlignment=e.params.vertical_alignment),(0,$2.has)(e.params,"text_color")&&(a.attributes.textColor=s,a.attributes.style.color.text=s?void 0:e.params.text_color),(0,$2.has)(e.params,"background_color")&&(a.attributes.backgroundColor=l,a.attributes.style.color.background=l?void 0:e.params.background_color),(0,$2.has)(e.params,"gradient")&&(a.attributes.gradient=c,a.attributes.style.color.gradient=c?void 0:e.params.gradient),(0,$2.has)(e.params,"class_name")&&e.params.class_name&&(a.attributes.className=e.params.class_name),(0,$2.has)(e.params,"padding")&&(a.attributes.style.spacing={padding:e.params.padding}),(0,$2.has)(e.params,"is_stacked_on_mobile")&&(a.attributes.isStackedOnMobile="1"===e.params.is_stacked_on_mobile),"columns"!==e.type||(0,$2.has)(e.params,"is_stacked_on_mobile")||(a.attributes.isStackedOnMobile=!0),a})(o,e,t,n,r);const i={clientId:`${o.id}_${gee()}`,isValid:!0,innerBlocks:[],attributes:{labelWithinInput:!1,mandatory:!1,className:null}};if(["heading","paragraph"].includes(o.type)&&(i.attributes.style={color:{},typography:{fontSize:void 0,lineHeight:void 0}}),o.params&&(0,$2.has)(o.params,"class_name")&&(i.attributes.className=o.params.class_name),o.params&&(0,$2.has)(o.params,"required")&&(i.attributes.mandatory=!!o.params.required),o.params&&(0,$2.has)(o.params,"label_within")&&(i.attributes.labelWithinInput=!!o.params.label_within),o.params&&(i.attributes.label=o.params.label?o.params.label:""),o.params&&(0,$2.has)(o.params,"text_color")){const e=g3(t,o.params.text_color);i.attributes.textColor=e,["heading","paragraph"].includes(o.type)&&!e?i.attributes.style.color.text=o.params.text_color:e||(i.attributes.customTextColor=o.params.text_color)}if(o.params&&(0,$2.has)(o.params,"background_color")){const e=g3(t,o.params.background_color);i.attributes.backgroundColor=e,["heading","paragraph"].includes(o.type)&&!e?i.attributes.style.color.background=o.params.background_color:e||(i.attributes.customBackgroundColor=o.params.background_color)}if(o.params&&(0,$2.has)(o.params,"gradient")){const e=b3(n,o.params.gradient);i.attributes.gradient=e,e||(i.attributes.style.color.gradient=o.params.gradient)}if((0,$2.has)(o.params,"padding")&&(i.attributes.style.spacing={padding:o.params.padding}),o.params&&(0,$2.has)(o.params,"font_size")){const t=`${o.params.font_size}${Number.isNaN(Number(`${o.params.font_size}`||NaN))?"":"px"}`,n=((e,t)=>{const n=e.find((e=>e.size===t));return n?n.slug:void 0})(e,t);i.attributes.fontSize=n,i.attributes.style.typography.fontSize=n?void 0:t}o.params&&(0,$2.has)(o.params,"line_height")&&(i.attributes.style.typography.lineHeight=o.params.line_height);let a=2;switch(o.id){case"email":return{...i,name:"mailpoet-form/email-input",attributes:{...i.attributes,styles:f3(o.styles)}};case"heading":return o.params&&(0,$2.has)(o.params,"level")&&(a=pee(o.params.level),void 0===a&&(a=2)),{...i,attributes:{...i.attributes,content:o.params?.content||"",level:a,textAlign:o.params?.align,anchor:o.params?.anchor,className:o.params?.class_name},name:"core/heading"};case"paragraph":return{...i,attributes:{...i.attributes,content:o.params?.content||"",align:o.params?.align,className:o.params?.class_name,dropCap:"1"===o.params?.drop_cap},name:"core/paragraph"};case"image":return{...i,name:"core/image",attributes:{className:o.params?.class_name||"",align:o.params?.align,url:o.params?.url,alt:o.params?.alt,title:o.params?.title,caption:o.params?.caption,linkDestination:o.params?.link_destination,link:o.params?.link,href:o.params?.href,linkClass:o.params?.link_class,rel:o.params?.rel,linkTarget:o.params?.link_target,id:o.params?.id,sizeSlug:o.params?.size_slug,width:o.params?.width,height:o.params?.height}};case"first_name":return{...i,name:"mailpoet-form/first-name-input",attributes:{...i.attributes,styles:f3(o.styles)}};case"last_name":return{...i,name:"mailpoet-form/last-name-input",attributes:{...i.attributes,styles:f3(o.styles)}};case"segments":return o.params&&(0,$2.has)(o.params,"values")&&Array.isArray(o.params.values)?i.attributes.values=o.params.values.map((e=>({id:e.id,isChecked:"1"===e.is_checked||void 0}))):i.attributes.values=[],{...i,name:"mailpoet-form/segment-select"};case"submit":return{...i,name:"mailpoet-form/submit-button",attributes:{...i.attributes,styles:f3(o.styles)}};case"divider":return delete i.attributes.label,{...i,name:"mailpoet-form/divider",attributes:{className:i.attributes.className,height:pee(o.params?.height??fee.height),type:o.params?.type??fee.type,style:o.params?.style??fee.style,dividerHeight:pee(o.params?.divider_height??fee.dividerHeight),dividerWidth:pee(o.params?.divider_width??fee.dividerWidth),color:o.params?.color??fee.color}};case"html":return{...i,name:"mailpoet-form/html",attributes:{className:i.attributes.className,content:o.params&&o.params.text?o.params.text:"",nl2br:!(!o.params||!o.params.nl2br||!o.params.nl2br)}};default:return Number.isInteger(parseInt(o.id,10))?((e,t,n)=>{const r=t.find((t=>t.id===parseInt(e.id,10)));if(!r)return null;const o={...n,name:X5({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"}[r.type],r)};return o.attributes.customFieldId=r.id,e.params&&((0,$2.has)(e.params,"validate")&&e.params.validate&&(o.attributes.validate=e.params.validate),(0,$2.has)(e.params,"hide_label")&&(o.attributes.hideLabel=!!e.params.hide_label),(0,$2.has)(e.params,"lines")&&(o.attributes.lines=e.params.lines),(0,$2.has)(e.params,"date_type")&&(o.attributes.dateType=e.params.date_type),(0,$2.has)(e.params,"date_format")&&(o.attributes.dateFormat=e.params.date_format),(0,$2.has)(e.params,"is_default_today")&&(o.attributes.defaultToday=!!e.params.is_default_today),(0,$2.has)(e.params,"values")&&Array.isArray(e.params.values)&&(o.attributes.values=bee(e.params.values))),"text"!==r.type&&"textarea"!==r.type||(o.attributes.styles=f3(e.styles)),o})(o,r,i):null}})).filter(Boolean)}};function yee(e){return{title:e.name,description:"",icon:J5,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?bee(e.params.values):[]},customFieldId:{type:"string",default:e.id}},supports:{html:!1,multiple:!1},edit:dee,save(){return null}}}function _ee({label:e,mandatory:t,isSaving:n,onSave:r,isChecked:o,checkboxLabel:i,isDeleting:a,onCustomFieldDelete:s,onChange:l}){const[c,u]=(0,x.useState)(e),[d,p]=(0,x.useState)(t),[h,m]=(0,x.useState)(o),[f,g]=(0,x.useState)(i),b=d!==t||h!==o||c!==e||f!==i,v=(0,x.useMemo)((()=>({mandatory:d,isChecked:h,label:c,checkboxLabel:f,isValid:!(0,$2.isEmpty)(f)})),[c,d,h,f]);return(0,x.useEffect)((()=>{l(v,b)}),[v,l,b]),(0,Cw.jsxs)("div",{className:"custom-field-settings",children:[(0,Cw.jsx)(QS.Z,{label:O2.MailPoet.I18n.t("label"),value:c,"data-automation-id":"settings_custom_text_label_input",onChange:u}),(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("blockMandatory"),checked:d,onChange:p}),(0,Cw.jsxs)(uw.ZP,{children:[(0,Cw.jsx)("input",{type:"checkbox",checked:h,onChange:e=>m(!!e.target.checked)}),(0,Cw.jsx)("input",{value:f,"data-automation-id":"settings_custom_checkbox_value",type:"text",onChange:e=>g(e.target.value)})]}),r?(0,Cw.jsx)(Gh.ZP,{variant:"primary",onClick:()=>r(v),isBusy:n,disabled:n||!b,className:"button-on-top","data-automation-id":"custom_field_save",children:O2.MailPoet.I18n.t("customFieldSaveCTA")}):null,s?(0,Cw.jsx)(n3,{isBusy:n||a,onDelete:s}):null]})}function kee({attributes:e,setAttributes:t,clientId:n}){const r=(0,yl.Z)((e=>e(H2).getIsCustomFieldSaving()),[]),o=(0,yl.Z)((e=>e(H2).getIsCustomFieldDeleting()),[]),{saveCustomField:i,deleteCustomField:a,customFieldEdited:s}=(0,_l.Z)(H2),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,Cw.jsxs)(qI,{children:[(0,Cw.jsx)(t3.Z,{children:(0,Cw.jsx)(tI.ZP,{title:O2.MailPoet.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,Cw.jsx)(_ee,{label:e.label,mandatory:e.mandatory,isSaving:r,isChecked:c(),checkboxLabel:l(),onSave:n=>i({customFieldId:e.customFieldId,data:{params:u3("checkbox",n)},onFinish:()=>t({mandatory:n.mandatory,label:n.label,values:[{isChecked:n.isChecked,name:n.checkboxLabel}]})}),onCustomFieldDelete:()=>a(e.customFieldId,n),isDeleting:o,onChange:(e,t)=>t&&s()})})}),(0,Cw.jsx)(t3.Z,{children:(0,Cw.jsx)(tI.ZP,{title:O2.MailPoet.I18n.t("formSettings"),initialOpen:!0,children:(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("displayLabel"),checked:!e.hideLabel,onChange:e=>t({hideLabel:!e})})})})]});let d=l();return e.mandatory&&(d+=" *"),(0,Cw.jsxs)(c3,{className:e.className,children:[u,(0,Cw.jsx)("span",{className:"mailpoet_checkbox_label","data-automation-id":"editor_custom_field_checkbox_block",children:e.hideLabel||!e.label?null:e.label}),(0,Cw.jsx)("div",{children:(0,Cw.jsxs)("label",{children:[(0,Cw.jsx)("input",{type:"checkbox",disabled:!0,checked:c(),className:"mailpoet_checkbox"}),(0,Cw.jsx)("span",{dangerouslySetInnerHTML:{__html:d}})]})})]})}function wee(e){return{title:e.name,description:"",icon:J5,category:"custom-fields",attributes:{label:{type:"string",default:e.name},hideLabel:{type:"boolean",default:!1},values:{type:"array",default:e.params.values?bee(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:kee,save(){return null}}}function Eee({attributes:e,setAttributes:t,clientId:n}){const r=(0,yl.Z)((e=>e(H2).getFormSettings()),[]),o=(0,yl.Z)((e=>e(H2).getIsCustomFieldSaving()),[]),i=(0,yl.Z)((e=>e(H2).getIsCustomFieldDeleting()),[]),{saveCustomField:a,deleteCustomField:s,customFieldEdited:l}=(0,_l.Z)(H2),c=(0,Cw.jsxs)(qI,{children:[(0,Cw.jsx)(t3.Z,{children:(0,Cw.jsx)(tI.ZP,{title:O2.MailPoet.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,Cw.jsx)(uee,{label:e.label,mandatory:e.mandatory,values:e.values,isSaving:o,onSave:n=>a({customFieldId:e.customFieldId,data:{params:u3("select",n)},onFinish:()=>t({mandatory:n.mandatory,values:n.values,label:n.label})}),onCustomFieldDelete:()=>s(e.customFieldId,n),isDeleting:i,onChange:(e,t)=>t&&l()})})}),(0,Cw.jsx)(t3.Z,{children:(0,Cw.jsx)(tI.ZP,{title:O2.MailPoet.I18n.t("formSettings"),initialOpen:!0,children:(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("displayLabelWithinInput"),checked:e.labelWithinInput,onChange:e=>t({labelWithinInput:e})})})})]});return(0,Cw.jsxs)(c3,{className:e.className,children:[c,(0,Cw.jsxs)("div",{className:"mailpoet_custom_select","data-automation-id":"custom_select_block",children:[e.labelWithinInput?null:(0,Cw.jsx)("label",{className:"mailpoet_select_label",htmlFor:n,children:o3(e)}),(()=>{let t=e.labelWithinInput?o3(e):"-";const o=[{label:t}];!Array.isArray(e.values)&&e.values.length||e.values.forEach((n=>{o.push({label:n.name}),!e.labelWithinInput&&n.isChecked&&(t=n.name)}));const i={};return void 0!==r.inputPadding&&(i.padding=r.inputPadding),void 0!==r.alignment&&(i.textAlign=r.alignment,i.margin=A3(i.textAlign)),r.fontFamily&&(i.fontFamily=r.fontFamily),(0,Cw.jsx)("select",{style:i,className:"mailpoet_select",id:n,value:t,readOnly:!0,children:o.map(((e,t)=>(0,Cw.jsx)("option",{value:e.label,disabled:0===t,children:e.label},e.label)))})})()]})]})}function Cee(e){return{title:e.name,description:"",icon:J5,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?bee(e.params.values):[]},customFieldId:{type:"string",default:e.id}},supports:{html:!1,multiple:!1},edit:Eee,save(){return null}}}function xee(e){return{date:{name:"mailpoet-form/custom-date",settings:p3(e)},text:{name:"mailpoet-form/custom-text",settings:M3(e)},textarea:{name:"mailpoet-form/custom-textarea",settings:O3(e)},radio:{name:"mailpoet-form/custom-radio",settings:yee(e)},checkbox:{name:"mailpoet-form/custom-checkbox",settings:wee(e)},select:{name:"mailpoet-form/custom-select",settings:Cee(e)}}}_ee.propTypes={label:Z2().string,mandatory:Z2().bool,onSave:Z2().func,isSaving:Z2().bool,isChecked:Z2().bool,checkboxLabel:Z2().string,isDeleting:Z2().bool,onCustomFieldDelete:Z2().func,onChange:Z2().func},_ee.defaultProps={label:"",mandatory:!1,onSave:null,isSaving:!1,isChecked:!1,checkboxLabel:"",isDeleting:!1,onCustomFieldDelete:null,onChange:()=>{}},kee.propTypes={attributes:Z2().shape({label:Z2().string.isRequired,customFieldId:Z2().number.isRequired,mandatory:Z2().bool.isRequired,hideLabel:Z2().bool,className:Z2().string,values:Z2().arrayOf(Z2().shape({name:Z2().string.isRequired,isChecked:Z2().bool}))}).isRequired,setAttributes:Z2().func.isRequired,clientId:Z2().string.isRequired},Eee.propTypes={attributes:Z2().shape({customFieldId:Z2().number.isRequired,labelWithinInput:Z2().bool.isRequired,label:Z2().string.isRequired,values:Z2().arrayOf(Z2().shape({name:Z2().string.isRequired,isChecked:Z2().bool,id:Z2().string.isRequired})),mandatory:Z2().bool.isRequired,className:Z2().string}).isRequired,setAttributes:Z2().func.isRequired,clientId:Z2().string.isRequired};const See=(0,Cw.jsxs)(F_.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,Cw.jsx)(F_.y$,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,Cw.jsx)(F_.y$,{d:"M19 13H5v-2h14v2z"})]}),Iee={title:O2.MailPoet.I18n.t("blockDivider"),description:null,icon:See,category:"design",attributes:{height:{type:"number",default:fee.height},type:{type:"string",default:fee.type},style:{type:"string",default:fee.style},dividerHeight:{type:"number",default:fee.dividerHeight},dividerWidth:{type:"number",default:fee.dividerWidth},color:{type:"string",default:fee.color}},supports:{html:!1,multiple:!0},edit:function({attributes:e,setAttributes:t}){const n=e.dividerHeight??fee.dividerHeight,r=e.dividerWidth??fee.dividerWidth,o=e.height??fee.height,i=(0,Cw.jsxs)("div",{className:"mailpoet-styles-settings",children:[(0,Cw.jsx)(HZ.Z,{label:O2.MailPoet.I18n.t("blockDividerStyle"),"data-automation-id":"settings_divider_style",value:e.style,onChange:e=>t({style:e}),options:[{value:mee.Solid,label:O2.MailPoet.I18n.t("blockDividerStyleSolid")},{value:mee.Dashed,label:O2.MailPoet.I18n.t("blockDividerStyleDashed")},{value:mee.Dotted,label:O2.MailPoet.I18n.t("blockDividerStyleDotted")}]}),(0,Cw.jsx)(CS,{label:O2.MailPoet.I18n.t("blockDividerDividerHeight"),className:"mailpoet-automation-styles-divider-height",value:n,min:1,max:40,allowReset:!0,onChange:e=>{let n=o;void 0!==e&&(n=Math.max(e,o)),t({dividerHeight:e,height:n})}}),(0,Cw.jsx)(CS,{label:O2.MailPoet.I18n.t("blockDividerDividerWidth"),className:"mailpoet-automation-styles-divider-width",value:r,min:1,max:100,allowReset:!0,onChange:e=>t({dividerWidth:e})}),(0,Cw.jsx)(T3,{title:O2.MailPoet.I18n.t("formSettingsColor"),settings:[{label:O2.MailPoet.I18n.t("blockDividerBackground"),colorValue:e.color,onColorChange:e=>t({color:e})}]})]}),a={};return e.type===hee.Divider&&(a.borderTopStyle=e.style,a.borderTopWidth=n,a.borderTopColor=e.color,a.height=n,a.width=`${r}%`),(0,Cw.jsxs)(Cw.Fragment,{children:[(0,Cw.jsx)(qI,{children:(0,Cw.jsx)(t3.Z,{children:(0,Cw.jsxs)(tI.ZP,{title:O2.MailPoet.I18n.t("formSettingsStyles"),initialOpen:!0,children:[(0,Cw.jsx)(CS,{label:O2.MailPoet.I18n.t("blockSpacerHeight"),className:"mailpoet-automation-spacer-height-size",value:o,min:1,max:400,allowReset:!0,onChange:e=>{let r=n;r=void 0!==e?Math.min(e,n):1,t({height:e,dividerHeight:r})}}),(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("blockSpacerEnableDivider"),className:"mailpoet-automation-divider-togle-enable",checked:e.type===hee.Divider,onChange:e=>t({type:e?hee.Divider:hee.Spacer})}),e.type===hee.Divider&&i]})})}),(0,Cw.jsx)("div",{className:R()("mailpoet_spacer",e.className),"data-automation-id":"editor_spacer_block",style:{height:o,display:"flex",flexDirection:"column",alignItems:"center",width:"100%",justifyContent:"center"},children:(0,Cw.jsx)("div",{className:"mailpoet_divider","data-automation-id":"editor_divider_block",style:a})})]})},save(){return null}};function Tee({attributes:e,setAttributes:t}){const n=(0,Cw.jsxs)(qI,{children:[(0,Cw.jsx)(t3.Z,{children:(0,Cw.jsxs)(tI.ZP,{title:O2.MailPoet.I18n.t("formSettings"),initialOpen:!0,children:[(0,Cw.jsx)(QS.Z,{label:O2.MailPoet.I18n.t("label"),value:e.label,"data-automation-id":"settings_email_label_input",onChange:e=>t({label:e})}),(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("displayLabelWithinInput"),checked:e.labelWithinInput,onChange:e=>t({labelWithinInput:e})})]})}),(0,Cw.jsx)(N3,{styles:e.styles,onChange:e=>t({styles:e})})]});return(0,Cw.jsxs)(Cw.Fragment,{children:[n,(0,Cw.jsx)(B3,{className:e.className,name:"email",label:e.label,labelWithinInput:!!e.labelWithinInput,mandatory:!0,styles:e.styles})]})}Tee.propTypes={attributes:Z2().shape({label:Z2().string.isRequired,labelWithinInput:Z2().bool.isRequired,className:Z2().string,styles:P3.isRequired}).isRequired,setAttributes:Z2().func.isRequired};const Nee=(0,Cw.jsxs)(F_.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,Cw.jsx)(F_.y$,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,Cw.jsx)(F_.G,{children:(0,Cw.jsx)(F_.y$,{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"})})]}),Pee={title:O2.MailPoet.I18n.t("blockEmail"),description:O2.MailPoet.I18n.t("blockEmailDescription"),icon:Nee,category:"obligatory",attributes:{label:{type:"string",default:O2.MailPoet.I18n.t("blockEmail")},labelWithinInput:{type:"boolean",default:!0},styles:{type:"object",default:h3}},supports:{html:!1,inserter:!1,multiple:!1},edit:Tee,save(){return null}};function Ree({value:e,onChange:t}){const n=YE("typography.fontSizes");return(0,Cw.jsx)(u$,{value:e,onChange:t,fontSizes:n,__nextHasNoMarginBottom:!0})}const Aee=["Arial","Comic Sans MS","Courier New","Georgia","Lucida","Tahoma","Times New Roman","Trebuchet MS","Verdana"];function Bee({onChange:e,value:t,name:n,hideLabelFromVision:r=!1}){const o=(0,yl.Z)((e=>e(H2).getAllCustomFonts()),[]),i={color:"lightgray",backgroundColor:"white",cursor:"default"},a=e=>({fontFamily:e,cursor:"default",marginLeft:16}),s=[{key:O2.MailPoet.I18n.t("formFontsDefaultTheme"),name:O2.MailPoet.I18n.t("formFontsDefaultTheme"),selectable:!0,value:""},{key:O2.MailPoet.I18n.t("formFontsStandard"),name:O2.MailPoet.I18n.t("formFontsStandard"),selectable:!1,style:i},...Aee.map((e=>({key:e,name:e,selectable:!0,style:a(e),value:e})))];O2.MailPoet.libs3rdPartyEnabled&&(s.push({key:O2.MailPoet.I18n.t("formFontsCustom"),name:O2.MailPoet.I18n.t("formFontsCustom"),selectable:!1,style:i}),o.forEach((e=>{s.push({key:e,name:e,selectable:!0,style:a(e),value:e})})));let l=void 0!==t&&s.find((e=>e.value===t));return l||(l=s[0]),(0,Cw.jsx)(S_,{__nextUnconstrainedWidth:!0,options:s,onChange:t=>{const n=t.selectedItem;n.selectable&&e(n.value)},value:l,label:n,className:"mailpoet-font-family-select",hideLabelFromVision:r})}function Lee(){const e=(0,yl.Z)((e=>e(H2).getAllCustomFonts()),[]);if(!O2.MailPoet.libs3rdPartyEnabled)return null;const t=e.map((e=>e.replace(" ","+"))).map((e=>e.concat(":400,400i,700,700i"))).join("|");return(0,Cw.jsx)("link",{rel:"stylesheet",href:`https://fonts.googleapis.com/css?family=${t}`})}function Mee({styles:e,onChange:t,formInputPadding:n,formFontFamily:r}){const o=(0,x.useRef)(e),i=o.current,a=(e,n)=>{const r={...o.current};r[e]=n,t(r),o.current=r};return(0,Cw.jsx)(t3.Z,{className:"mailpoet-automation-input-styles-panel",children:(0,Cw.jsx)(tI.ZP,{title:O2.MailPoet.I18n.t("formSettingsStyles"),initialOpen:!1,children:(0,Cw.jsxs)("div",{className:"mailpoet-styles-settings","data-automation-id":"input_styles_settings",children:[(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("formSettingsDisplayFullWidth"),checked:i.fullWidth,onChange:(0,$2.partial)(a,"fullWidth")}),(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("formSettingsInheritStyleFromTheme"),checked:i.inheritFromTheme,onChange:e=>{if(e)return void a("inheritFromTheme",e);const r={...o.current};r.backgroundColor="#eeeeee",r.bold=!1,r.borderRadius=0,r.borderSize=1,r.borderColor="#313131",r.fontColor="#313131",r.fontSize=void 0,r.padding=n,r.inheritFromTheme=e,t(r),o.current=r},className:"mailpoet-automation-inherit-theme-toggle"}),i.inheritFromTheme?null:(0,Cw.jsxs)(Cw.Fragment,{children:[(0,Cw.jsx)(T3,{title:O2.MailPoet.I18n.t("formSettingsColor"),settings:[{label:O2.MailPoet.I18n.t("formSettingsStylesBackground"),colorValue:e.backgroundColor,gradientValue:e.gradient,onColorChange:(0,$2.partial)(a,"backgroundColor"),onGradientChange:(0,$2.partial)(a,"gradient")},{label:O2.MailPoet.I18n.t("formSettingsStylesFont"),colorValue:e.fontColor,onColorChange:(0,$2.partial)(a,"fontColor")},{label:O2.MailPoet.I18n.t("formSettingsBorder"),colorValue:i.borderColor,onColorChange:(0,$2.partial)(a,"borderColor")}]}),(0,Cw.jsx)(Ree,{value:e.fontSize,onChange:(0,$2.partial)(a,"fontSize")}),(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("formSettingsBold"),checked:i.bold||!1,onChange:(0,$2.partial)(a,"bold"),className:"mailpoet-automation-styles-bold-toggle"}),(0,Cw.jsx)(Bee,{name:O2.MailPoet.I18n.t("formSettingsStylesFontFamily"),value:e.fontFamily||r,onChange:(0,$2.partial)(a,"fontFamily")}),(0,Cw.jsx)(CS,{label:O2.MailPoet.I18n.t("formSettingsInputPadding"),value:void 0!==i.padding?i.padding:n,min:0,max:30,allowReset:!0,onChange:(0,$2.partial)(a,"padding")}),(0,Cw.jsx)(CS,{label:O2.MailPoet.I18n.t("formSettingsBorderSize"),value:void 0!==i.borderSize?i.borderSize:1,min:0,max:10,allowReset:!0,onChange:(0,$2.partial)(a,"borderSize"),className:"mailpoet-automation-styles-border-size"}),(0,Cw.jsx)(CS,{label:O2.MailPoet.I18n.t("formSettingsBorderRadius"),value:void 0!==i.borderRadius?i.borderRadius:0,min:0,max:40,allowReset:!0,onChange:(0,$2.partial)(a,"borderRadius")})]})]})})})}const Dee=(0,Cw.jsxs)(F_.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,Cw.jsx)(F_.y$,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,Cw.jsx)(F_.G,{children:(0,Cw.jsx)(F_.y$,{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"})})]}),Oee={title:O2.MailPoet.I18n.t("blockSubmit"),description:O2.MailPoet.I18n.t("blockSubmitDescription"),icon:Dee,category:"obligatory",attributes:{label:{type:"string",default:O2.MailPoet.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,yl.Z)((e=>e(H2).getFormSettings()),[]),r=(0,Cw.jsxs)(qI,{children:[(0,Cw.jsx)(t3.Z,{children:(0,Cw.jsx)(tI.ZP,{title:O2.MailPoet.I18n.t("formSettings"),initialOpen:!0,children:(0,Cw.jsx)(QS.Z,{label:O2.MailPoet.I18n.t("label"),value:e.label,onChange:e=>t({label:e}),"data-automation-id":"settings_submit_label_input"})})}),(0,Cw.jsx)(Mee,{onChange:e=>t({styles:e}),styles:e.styles,formInputPadding:n.inputPadding,formFontFamily:n.fontFamily})]}),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:e.styles.fontSize?`${e.styles.fontSize}px`:"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 i=R()("mailpoet_submit",{button:e.styles.inheritFromTheme});return(0,Cw.jsxs)(c3,{className:e.className,children:[r,(0,Cw.jsx)("input",{className:i,type:"submit",value:e.label,"data-automation-id":"editor_submit_input",style:o})]})},save(){return null}},Fee=(0,Cw.jsxs)(F_.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,Cw.jsx)(F_.y$,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,Cw.jsx)(F_.G,{children:(0,Cw.jsx)(F_.y$,{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 jee({attributes:e,setAttributes:t}){const n=(0,Cw.jsxs)(qI,{children:[(0,Cw.jsx)(t3.Z,{children:(0,Cw.jsxs)(tI.ZP,{title:O2.MailPoet.I18n.t("formSettings"),initialOpen:!0,children:[(0,Cw.jsx)(QS.Z,{label:O2.MailPoet.I18n.t("label"),value:e.label,"data-automation-id":"settings_first_name_label_input",onChange:e=>t({label:e})}),(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("displayLabelWithinInput"),checked:e.labelWithinInput,onChange:e=>t({labelWithinInput:e}),className:"mailpoet-automation-label-within-input-toggle"}),(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("blockMandatory"),checked:e.mandatory,onChange:e=>t({mandatory:e})})]})}),(0,Cw.jsx)(N3,{styles:e.styles,onChange:e=>t({styles:e})})]});return(0,Cw.jsxs)(Cw.Fragment,{children:[n,(0,Cw.jsx)(B3,{className:e.className,name:"first_name",mandatory:e.mandatory,labelWithinInput:e.labelWithinInput,label:e.label,styles:e.styles})]})}jee.propTypes={attributes:Z2().shape({label:Z2().string.isRequired,labelWithinInput:Z2().bool.isRequired,mandatory:Z2().bool.isRequired,className:Z2().string,styles:P3.isRequired}).isRequired,setAttributes:Z2().func.isRequired};const Zee={title:O2.MailPoet.I18n.t("blockFirstName"),description:O2.MailPoet.I18n.t("blockFirstNameDescription"),icon:Fee,category:"fields",attributes:{label:{type:"string",default:O2.MailPoet.I18n.t("blockFirstName")},labelWithinInput:{type:"boolean",default:!0},mandatory:{type:"boolean",default:!1},styles:{type:"object",default:h3}},supports:{html:!1,multiple:!1},edit:jee,save(){return null}},zee=(0,Cw.jsxs)(F_.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,Cw.jsx)(F_.y$,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,Cw.jsx)(F_.G,{children:(0,Cw.jsx)(F_.y$,{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 Vee({attributes:e,setAttributes:t}){const n=(0,Cw.jsxs)(qI,{children:[(0,Cw.jsx)(t3.Z,{children:(0,Cw.jsxs)(tI.ZP,{title:O2.MailPoet.I18n.t("formSettings"),initialOpen:!0,children:[(0,Cw.jsx)(QS.Z,{label:O2.MailPoet.I18n.t("label"),value:e.label,"data-automation-id":"settings_last_name_label_input",onChange:e=>t({label:e})}),(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("displayLabelWithinInput"),checked:e.labelWithinInput,onChange:e=>t({labelWithinInput:e})}),(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("blockMandatory"),checked:e.mandatory,onChange:e=>t({mandatory:e})})]})}),(0,Cw.jsx)(N3,{styles:e.styles,onChange:e=>t({styles:e})})]});return(0,Cw.jsxs)(Cw.Fragment,{children:[n,(0,Cw.jsx)(B3,{className:e.className,name:"last_name",mandatory:e.mandatory,labelWithinInput:e.labelWithinInput,label:e.label,styles:e.styles})]})}Vee.propTypes={attributes:Z2().shape({label:Z2().string.isRequired,labelWithinInput:Z2().bool.isRequired,mandatory:Z2().bool.isRequired,className:Z2().string,styles:P3.isRequired}).isRequired,setAttributes:Z2().func.isRequired};const Hee={title:O2.MailPoet.I18n.t("blockLastName"),description:O2.MailPoet.I18n.t("blockLastNameDescription"),icon:zee,category:"fields",attributes:{label:{type:"string",default:O2.MailPoet.I18n.t("blockLastName")},labelWithinInput:{type:"boolean",default:!0},mandatory:{type:"boolean",default:!1},styles:{type:"object",default:h3}},supports:{html:!1,multiple:!1},edit:Vee,save(){return null}},Uee=(0,Cw.jsx)(F_.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Cw.jsx)(F_.G,{children:(0,Cw.jsx)(F_.y$,{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 $ee=n(90564);function Wee({segment:e,removeSegment:t,onCheck:n}){return(0,Cw.jsxs)("div",{className:"mailpoet-form-segments-settings-list",children:[(0,Cw.jsx)(jj.C,{label:e.name,defaultChecked:!!e.isChecked,onChange:(0,$2.partial)(n,e.id)},`check-${e.id}`),(0,Cw.jsx)(F3.Z,{icon:"no-alt",color:"#900",className:"mailpoet-form-segments-segment-remove",onClick:(0,$2.partial)(t,e.id)})]},e.id)}function Gee({segments:e,updateSegment:t,removeSegment:n,onSegmentsReorder:r}){const[o,i]=(0,x.useState)(e);if((0,x.useEffect)((()=>{i(e)}),[e]),0===o.length)return null;const a=(e,n)=>{const r=o.find((t=>t.id===e));r.isChecked=n,t(r)};return(0,Cw.jsx)(T7,{onDragEnd:e=>{const t=e.source.index,n=e.destination.index,a=[...o],[s]=a.splice(t,1);a.splice(n,0,s),i(a),r(a)},children:(0,Cw.jsx)(see,{droppableId:"droppable",children:e=>(0,Cw.jsxs)("div",{...e.droppableProps,ref:e.innerRef,children:[o.map(((e,t)=>(0,Cw.jsx)(ree,{draggableId:e.id,index:t,children:r=>(0,Cw.jsx)("div",{ref:r.innerRef,...r.draggableProps,...r.dragHandleProps,children:(0,Cw.jsx)(Wee,{index:t,segment:e,onCheck:a,removeSegment:n},e.id)})},e.id))),e.placeholder]})})})}Wee.propTypes={segment:Z2().shape({name:Z2().string.isRequired,isChecked:Z2().bool,id:Z2().string.isRequired}).isRequired,onCheck:Z2().func.isRequired,removeSegment:Z2().func.isRequired},Gee.propTypes={segments:Z2().arrayOf(Z2().shape({name:Z2().string.isRequired,isChecked:Z2().bool,id:Z2().string.isRequired}).isRequired).isRequired,updateSegment:Z2().func.isRequired,removeSegment:Z2().func.isRequired,onSegmentsReorder:Z2().func.isRequired};const qee=(e,t)=>e.find((e=>e.id===t));function Kee({label:e,onLabelChanged:t,segmentsAddedIntoSelection:n,addSegmentIntoSelection:r,setNewSelection:o}){const i=(0,yl.Z)((e=>e(H2).getAllAvailableSegments()),[]),a=i.map((e=>({label:e.name,value:e.id}))).filter((e=>!qee(n,e.value)));return(0,Cw.jsx)(qI,{children:(0,Cw.jsx)(t3.Z,{children:(0,Cw.jsxs)(tI.ZP,{title:O2.MailPoet.I18n.t("formSettings"),initialOpen:!0,children:[(0,Cw.jsx)($ee.Z,{children:(0,Cw.jsx)(QS.Z,{label:O2.MailPoet.I18n.t("label"),value:e,"data-automation-id":"settings_first_name_label_input",onChange:t})}),(0,Cw.jsx)($ee.Z,{children:a.length?(0,Cw.jsx)(HZ.Z,{label:`${O2.MailPoet.I18n.t("blockSegmentSelectListLabel")}:`,"data-automation-id":"select_list_selections_list",options:[{label:O2.MailPoet.I18n.t("settingsPleaseSelectList"),value:null},...a],onChange:e=>{const t=qee(i,e);r({name:t.name,isChecked:!1,id:e})}}):null}),(0,Cw.jsx)(Gee,{segments:n,updateSegment:e=>{o(n.map((t=>e.id!==t?t:e)))},removeSegment:e=>{o(n.filter((t=>e!==t.id)))},onSegmentsReorder:o})]})})})}function Yee({attributes:e,setAttributes:t}){const n=(0,yl.Z)((e=>e(H2).getAllAvailableSegments()),[]),r=(0,x.useMemo)((()=>e.values.map((e=>{const t={...e},r=n.find((t=>parseInt(t.id,10)===parseInt(e.id,10)));return t.name=r?r.name:"",t}))),[e.values,n]),o=e=>e.map((e=>{const t={...e};return delete t.name,t}));return(0,Cw.jsxs)(c3,{className:e.className,children:[(0,Cw.jsx)(Kee,{label:e.label,onLabelChanged:e=>t({label:e}),segmentsAddedIntoSelection:r,setNewSelection:e=>t({values:o(e)}),addSegmentIntoSelection:n=>t({values:o([...e.values,n])})}),(0,Cw.jsx)("span",{className:"mailpoet_segment_label","data-automation-id":"mailpoet_list_selection_block",children:e.label}),0===e.values.length?(0,Cw.jsx)("p",{className:"mailpoet_error",children:O2.MailPoet.I18n.t("blockSegmentSelectNoLists")}):r.map((e=>(0,Cw.jsxs)("label",{className:"mailpoet_checkbox_label",children:[(0,Cw.jsx)("input",{type:"checkbox",disabled:!0,checked:!!e.isChecked,className:"mailpoet_checkbox"},e.id),e.name]},e.id)))]})}Kee.propTypes={label:Z2().string.isRequired,onLabelChanged:Z2().func.isRequired,addSegmentIntoSelection:Z2().func.isRequired,setNewSelection:Z2().func.isRequired,segmentsAddedIntoSelection:Z2().arrayOf(Z2().shape({name:Z2().string.isRequired,isChecked:Z2().bool,id:Z2().string.isRequired}).isRequired).isRequired},Yee.propTypes={attributes:Z2().shape({label:Z2().string.isRequired,className:Z2().string,values:Z2().arrayOf(Z2().shape({isChecked:Z2().bool,id:Z2().string.isRequired})).isRequired}).isRequired,setAttributes:Z2().func.isRequired};const Xee={title:O2.MailPoet.I18n.t("blockSegmentSelect"),description:O2.MailPoet.I18n.t("blockLastNameDescription"),icon:Uee,category:"fields",attributes:{label:{type:"string",default:O2.MailPoet.I18n.t("blockSegmentSelectLabel")},values:{type:"array",default:[]}},supports:{html:!1,multiple:!1},edit:Yee,save(){return null}},Jee=(0,Cw.jsx)(F_.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Cw.jsx)(F_.y$,{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"})});var Qee=n(86734);const ete=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+(vmin|vmax|vh|vw)$/.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))};var tte=function({html:e="",title:t="",type:n,styles:r=[],scripts:o=[],onFocus:i}){const a=(0,x.useRef)(),[s,l]=(0,x.useState)(0),[c,u]=(0,x.useState)(0);function d(i=!1){if(!function(){try{return!!a.current?.contentDocument?.body}catch(e){return!1}}())return;const{contentDocument:s,ownerDocument:l}=a.current;if(!i&&null!==s?.body.getAttribute("data-resizable-iframe-connected"))return;const c=(0,x.createElement)("html",{lang:l.documentElement.lang,className:n},(0,x.createElement)("head",null,(0,x.createElement)("title",null,t),(0,x.createElement)("style",{dangerouslySetInnerHTML:{__html:"\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"}}),r.map(((e,t)=>(0,x.createElement)("style",{key:t,dangerouslySetInnerHTML:{__html:e}})))),(0,x.createElement)("body",{"data-resizable-iframe-connected":"data-resizable-iframe-connected",className:n},(0,x.createElement)("div",{dangerouslySetInnerHTML:{__html:e}}),(0,x.createElement)("script",{type:"text/javascript",dangerouslySetInnerHTML:{__html:`(${ete.toString()})();`}}),o.map((e=>(0,x.createElement)("script",{key:e,src:e})))));s.open(),s.write("<!DOCTYPE html>"+(0,DY.ZP)(c)),s.close()}return(0,x.useEffect)((()=>{function e(){d(!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(e){}"resize"===n.action&&(l(n.width),u(n.height))}d();const n=a.current,r=n?.ownerDocument?.defaultView;return n?.addEventListener("load",e,!1),r?.addEventListener("message",t),()=>{n?.removeEventListener("load",e,!1),r?.removeEventListener("message",t)}}),[]),(0,x.useEffect)((()=>{d()}),[t,r,o]),(0,x.useEffect)((()=>{d(!0)}),[e,n]),(0,x.createElement)("iframe",{ref:(0,Kx.Z)([a,(0,Qee.Z)()]),title:t,className:"components-sandbox",sandbox:"allow-scripts allow-same-origin allow-presentation",onFocus:i,width:Math.ceil(s),height:Math.ceil(c)})};function nte({attributes:e,setAttributes:t,clientId:n}){const r=YE("color.palette"),{fontColor:o,fontSize:i,alignment:a,fontFamily:s}=(0,yl.Z)((e=>{const t=e(H2).getFormSettings(),o=G2(r,e(H2).getClosestParentAttribute(n,"backgroundColor"),e(H2).getClosestParentAttribute(n,"customBackgroundColor")),i=G2(r,e(H2).getClosestParentAttribute(n,"textColor"),e(H2).getClosestParentAttribute(n,"customTextColor"));return{backgroundColor:o||t.backgroundColor,fontColor:i||t.fontColor,fontSize:t.fontSize,alignment:t.alignment,fontFamily:t.fontFamily}}),[]),[l,c]=(0,x.useState)(e.content),u=(0,x.useCallback)((0,$2.debounce)((e=>{c(e)}),300),[]),d=(0,Cw.jsx)(qI,{children:(0,Cw.jsx)(t3.Z,{children:(0,Cw.jsxs)(tI.ZP,{title:O2.MailPoet.I18n.t("formSettings"),initialOpen:!0,children:[(0,Cw.jsx)(p1.Z,{label:O2.MailPoet.I18n.t("blockCustomHtmlContentLabel"),value:e.content,"data-automation-id":"settings_custom_html_content",rows:4,onChange:e=>{t({content:e}),u(e)}}),(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("blockCustomHtmlNl2br"),checked:e.nl2br,onChange:e=>t({nl2br:e})})]})})}),p=e.nl2br?["body { white-space: pre-line; }"]:[];p.push(` body {font-family: ${getComputedStyle(document.body).fontFamily};}`),o?p.push(` body {color: ${o};}`):p.push(` body {color: ${getComputedStyle(document.body).color};}`),i?p.push(` body {font-size: ${i}px }`):p.push(` body {font-size: ${getComputedStyle(document.body).fontSize};}`),a&&p.push(` body {text-align: ${a}}`),s&&p.push(` body {font-family: "${s}"}`);const h=`${l}_${p}`;return(0,Cw.jsxs)(c3,{className:e.className,children:[d,(0,Cw.jsx)("div",{className:"mailpoet-html-block-editor-content-wrapper",children:(0,Cw.jsx)(tte,{html:l,styles:p},h)})]})}nte.propTypes={attributes:Z2().shape({content:Z2().string.isRequired,nl2br:Z2().bool.isRequired,className:Z2().string}).isRequired,setAttributes:Z2().func.isRequired,clientId:Z2().string.isRequired};const rte={title:O2.MailPoet.I18n.t("blockCustomHtml"),description:O2.MailPoet.I18n.t("blockCustomHtmlDescription"),icon:Jee,category:"fields",attributes:{content:{type:"string",default:O2.MailPoet.I18n.t("blockCustomHtmlDefault")},nl2br:{type:"boolean",default:!0}},supports:{html:!1,multiple:!0},edit:nte,save(){return null}},ote=(0,Cw.jsx)(F_.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 694 694",children:(0,Cw.jsx)(F_.G,{children:(0,Cw.jsx)(F_.y$,{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"})})}),ite=[{value:"text",label:O2.MailPoet.I18n.t("customFieldTypeText")},{value:"textarea",label:O2.MailPoet.I18n.t("customFieldTypeTextarea")},{value:"radio",label:O2.MailPoet.I18n.t("customFieldTypeRadio")},{value:"checkbox",label:O2.MailPoet.I18n.t("customFieldTypeCheckbox")},{value:"select",label:O2.MailPoet.I18n.t("customFieldTypeSelect")},{value:"date",label:O2.MailPoet.I18n.t("customFieldTypeDate")}];function ate({dateSettings:e,onSubmit:t}){const[n,r]=(0,x.useState)("text"),[o,i]=(0,x.useState)(null),[a,s]=(0,x.useState)({}),l=o&&!(0,$2.isEmpty)(a)&&!1!==a.isValid,c=e.dateTypes[0].value,u=e.dateFormats[c][0];return(0,Cw.jsxs)("div",{className:"mailpoet_custom_field_add_form","data-automation-id":"create_custom_field_form",children:[(0,Cw.jsx)("hr",{}),(0,Cw.jsx)(HZ.Z,{label:O2.MailPoet.I18n.t("selectCustomFieldType"),options:ite,"data-automation-id":"create_custom_field_type_select",onChange:e=>{s({}),r(e)}}),(0,Cw.jsx)(QS.Z,{label:O2.MailPoet.I18n.t("customFieldName"),onChange:i,"data-automation-id":"create_custom_field_name_input"}),(0,Cw.jsx)("hr",{}),(()=>{switch(n){case"checkbox":return(0,Cw.jsx)(_ee,{mandatory:!!a.mandatory&&a.mandatory,isChecked:!!a.isChecked&&a.isChecked,checkboxLabel:a.checkboxLabel?a.checkboxLabel:"",onChange:s});case"date":return(0,Cw.jsx)(r3,{dateSettings:e,mandatory:!!a.mandatory&&a.mandatory,dateFormat:a.dateFormat?a.dateFormat:u,dateType:a.dateType?a.dateType:c,defaultToday:!!a.defaultToday&&a.defaultToday,onChange:s});case"radio":case"select":return(0,Cw.jsx)(uee,{mandatory:!!a.mandatory&&a.mandatory,values:a.values?a.values:[{name:"",id:Math.random().toString()}],onChange:s});default:return(0,Cw.jsx)(v3,{mandatory:!!a.mandatory&&a.mandatory,validate:a.validate?a.validate:"",fieldType:n,onChange:s})}})(),(0,Cw.jsx)(Gh.ZP,{variant:"secondary",disabled:!l,"data-automation-id":"create_custom_field_submit",onClick:()=>{const e={name:o,type:n,params:u3(n,a)};t(e)},children:O2.MailPoet.I18n.t("blockCreateButton")})]})}function ste({clientId:e}){const{createCustomField:t}=(0,_l.Z)(H2),n=(0,yl.Z)((e=>e(H2).getDateSettingsData()),[]),r=(0,yl.Z)((e=>e(H2).getIsCustomFieldCreating()),[]);return(0,Cw.jsx)(WK,{icon:(0,Cw.jsx)(EB,{icon:ote,showColors:!0}),label:O2.MailPoet.I18n.t("blockAddCustomFieldFormHeading"),className:"mailpoet_custom_field_add_placeholder",children:r?(0,Cw.jsx)(UD.ZP,{}):(0,Cw.jsxs)(Cw.Fragment,{children:[(0,Cw.jsx)("p",{children:O2.MailPoet.I18n.t("blockAddCustomFieldDescription")}),(0,Cw.jsx)(ate,{onSubmit:n=>{t(n,e)},dateSettings:n})]})})}ate.propTypes={dateSettings:Z2().shape({dateTypes:Z2().arrayOf(Z2().shape({label:Z2().string,value:Z2().string})),dateFormats:Z2().objectOf(Z2().arrayOf(Z2().string)),months:Z2().arrayOf(Z2().string)}).isRequired,onSubmit:Z2().func.isRequired},ste.propTypes={clientId:Z2().string.isRequired};const lte={title:O2.MailPoet.I18n.t("blockAddCustomField"),description:O2.MailPoet.I18n.t("blockAddCustomFieldDescription"),icon:ote,category:"custom-fields",attributes:{},supports:{html:!1,multiple:!1},edit:ste,save(){return null}};var cte=n(50599);function ute(e){let t,{doc:n}=ute;n||(n=document.implementation.createHTMLDocument(""),ute.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 dte=[{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:r,...o}=e;return{...o,style:t,isStackedOnMobile:!0}},save({attributes:e}){const{verticalAlignment:t,backgroundColor:n,customBackgroundColor:r,textColor:o,customTextColor:i}=e,a=hZ("background-color",n),s=hZ("color",o),l=R()({"has-background":n||r,"has-text-color":o||i,[a]:a,[s]:s,[`are-vertically-aligned-${t}`]:t}),c={backgroundColor:a?void 0:r,color:s?void 0:i};return(0,x.createElement)("div",{className:l||void 0,style:c},(0,x.createElement)(aF.Content,null))}},{attributes:{columns:{type:"number",default:2}},isEligible(e,t){return!!t.some((e=>/layout-column-\d+/.test(e.originalContent)))&&t.some((e=>void 0!==ute(e.originalContent)))},migrate(e,t){const n=t.reduce(((e,t)=>{const{originalContent:n}=t;let r=ute(n);return void 0===r&&(r=0),e[r]||(e[r]=[]),e[r].push(t),e}),[]).map((e=>fc("core/column",{},e))),{columns:r,...o}=e;return[{...o,isStackedOnMobile:!0},n]},save({attributes:e}){const{columns:t}=e;return(0,x.createElement)("div",{className:`has-${t}-columns`},(0,x.createElement)(aF.Content,null))}},{attributes:{columns:{type:"number",default:2}},migrate(e,t){const{columns:n,...r}=e;return[e={...r,isStackedOnMobile:!0},t]},save({attributes:e}){const{verticalAlignment:t,columns:n}=e,r=R()(`has-${n}-columns`,{[`are-vertically-aligned-${t}`]:t});return(0,x.createElement)("div",{className:r},(0,x.createElement)(aF.Content,null))}}];const pte=e=>{const t=parseFloat(e);return Number.isFinite(t)?parseFloat(t.toFixed(2)):void 0};function hte(e,t){const{width:n=100/t}=e.attributes;return pte(n)}function mte(e,t,n=e.length){const r=function(e,t=e.length){return e.reduce(((e,n)=>e+hte(n,t)),0)}(e,n);return Object.fromEntries(Object.entries(function(e,t=e.length){return e.reduce(((e,n)=>{const r=hte(n,t);return Object.assign(e,{[n.clientId]:r})}),{})}(e,n)).map((([e,n])=>[e,pte(t*n/r)])))}function fte(e,t){return e.map((e=>({...e,attributes:{...e.attributes,width:`${t[e.clientId]}%`}})))}const gte=["core/column"],bte=(0,cT.Z)(((e,t,n)=>({updateAlignment(r){const{clientId:o,setAttributes:i}=t,{updateBlockAttributes:a}=e(e_),{getBlockOrder:s}=n.select(e_);i({verticalAlignment:r}),s(o).forEach((e=>{a(e,{verticalAlignment:r})}))},updateColumns(r,o){const{clientId:i}=t,{replaceInnerBlocks:a}=e(e_),{getBlocks:s}=n.select(e_);let l=s(i);const c=function(e){return e.every((e=>{const t=e.attributes.width;return Number.isFinite(t?.endsWith?.("%")?parseFloat(t):t)}))}(l),u=o>r;if(u&&c){const e=pte(100/o);l=[...fte(l,mte(l,100-e)),...Array.from({length:o-r}).map((()=>fc("core/column",{width:`${e}%`})))]}else u?l=[...l,...Array.from({length:o-r}).map((()=>fc("core/column")))]:o<r&&(l=l.slice(0,-(r-o)),c)&&(l=fte(l,mte(l,100)));a(i,l)}})))((function({attributes:e,setAttributes:t,updateAlignment:n,updateColumns:r,clientId:o}){const{isStackedOnMobile:i,verticalAlignment:a,templateLock:s}=e,{count:l,canInsertColumnBlock:c,minCount:u}=(0,yl.Z)((e=>{const{canInsertBlockType:t,canRemoveBlock:n,getBlocks:r,getBlockCount:i}=e(e_),a=r(o).reduce(((e,t,r)=>(n(t.clientId)||e.push(r),e)),[]);return{count:i(o),canInsertColumnBlock:t("core/column",o),minCount:Math.max(...a)+1}}),[o]),d=iF(sB({className:R()({[`are-vertically-aligned-${a}`]:a,"is-not-stacked-on-mobile":!i})}),{allowedBlocks:gte,orientation:"horizontal",renderAppender:!1,templateLock:s});return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(Hk,null,(0,x.createElement)(FE,{onChange:n,value:a})),(0,x.createElement)(qI,null,(0,x.createElement)(tI.ZP,null,c&&(0,x.createElement)(x.Fragment,null,(0,x.createElement)(CS,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,$.__)("Columns"),value:l,onChange:e=>r(l,Math.max(u,e)),min:Math.max(1,u),max:Math.max(6,l)}),l>6&&(0,x.createElement)(AF.Z,{status:"warning",isDismissible:!1},(0,$.__)("This column count exceeds the recommended amount and may cause visual breakage."))),(0,x.createElement)(aE.Z,{__nextHasNoMarginBottom:!0,label:(0,$.__)("Stack on mobile"),checked:i,onChange:()=>t({isStackedOnMobile:!i})}))),(0,x.createElement)("div",{...d}))}));function vte({clientId:e,name:t,setAttributes:n}){const{blockType:r,defaultVariation:o,variations:i}=(0,yl.Z)((e=>{const{getBlockVariations:n,getBlockType:r,getDefaultBlockVariation:o}=e(Vu);return{blockType:r(t),defaultVariation:o(t,"block"),variations:n(t,"block")}}),[t]),{replaceInnerBlocks:a}=(0,_l.Z)(e_),s=sB();return(0,x.createElement)("div",{...s},(0,x.createElement)(qK,{icon:r?.icon?.src,label:r?.title,variations:i,onSelect:(t=o)=>{t.attributes&&n(t.attributes),t.innerBlocks&&a(e,gc(t.innerBlocks),!0)},allowSkip:!0}))}var yte=[{name:"one-column-full",title:(0,$.__)("100"),description:(0,$.__)("One column"),icon:(0,x.createElement)(F_.Wj,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,x.createElement)(F_.y$,{fillRule:"evenodd",clipRule:"evenodd",d:"m39.0625 14h-30.0625v20.0938h30.0625zm-30.0625-2c-1.10457 0-2 .8954-2 2v20.0938c0 1.1045.89543 2 2 2h30.0625c1.1046 0 2-.8955 2-2v-20.0938c0-1.1046-.8954-2-2-2z"})),innerBlocks:[["core/column"]],scope:["block"]},{name:"two-columns-equal",title:(0,$.__)("50 / 50"),description:(0,$.__)("Two columns; equal split"),icon:(0,x.createElement)(F_.Wj,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,x.createElement)(F_.y$,{fillRule:"evenodd",clipRule:"evenodd",d:"M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H25V34H39ZM23 34H9V14H23V34Z"})),isDefault:!0,innerBlocks:[["core/column"],["core/column"]],scope:["block"]},{name:"two-columns-one-third-two-thirds",title:(0,$.__)("33 / 66"),description:(0,$.__)("Two columns; one-third, two-thirds split"),icon:(0,x.createElement)(F_.Wj,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,x.createElement)(F_.y$,{fillRule:"evenodd",clipRule:"evenodd",d:"M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H20V34H39ZM18 34H9V14H18V34Z"})),innerBlocks:[["core/column",{width:"33.33%"}],["core/column",{width:"66.66%"}]],scope:["block"]},{name:"two-columns-two-thirds-one-third",title:(0,$.__)("66 / 33"),description:(0,$.__)("Two columns; two-thirds, one-third split"),icon:(0,x.createElement)(F_.Wj,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,x.createElement)(F_.y$,{fillRule:"evenodd",clipRule:"evenodd",d:"M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H30V34H39ZM28 34H9V14H28V34Z"})),innerBlocks:[["core/column",{width:"66.66%"}],["core/column",{width:"33.33%"}]],scope:["block"]},{name:"three-columns-equal",title:(0,$.__)("33 / 33 / 33"),description:(0,$.__)("Three columns; equal split"),icon:(0,x.createElement)(F_.Wj,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,x.createElement)(F_.y$,{fillRule:"evenodd",d:"M41 14a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h30a2 2 0 0 0 2-2V14zM28.5 34h-9V14h9v20zm2 0V14H39v20h-8.5zm-13 0H9V14h8.5v20z"})),innerBlocks:[["core/column"],["core/column"],["core/column"]],scope:["block"]},{name:"three-columns-wider-center",title:(0,$.__)("25 / 50 / 25"),description:(0,$.__)("Three columns; wide center column"),icon:(0,x.createElement)(F_.Wj,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,x.createElement)(F_.y$,{fillRule:"evenodd",d:"M41 14a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h30a2 2 0 0 0 2-2V14zM31 34H17V14h14v20zm2 0V14h6v20h-6zm-18 0H9V14h6v20z"})),innerBlocks:[["core/column",{width:"25%"}],["core/column",{width:"50%"}],["core/column",{width:"25%"}]],scope:["block"]}];const _te={from:[{type:"block",isMultiBlock:!0,blocks:["*"],__experimentalConvert:e=>{const t=+(100/e.length).toFixed(2),n=e.map((({name:e,attributes:n,innerBlocks:r})=>["core/column",{width:`${t}%`},[[e,{...n},r]]]));return fc("core/columns",{},gc(n))},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:r,textColor:o,style:i,mediaAlt:a,mediaId:s,mediaPosition:l,mediaSizeSlug:c,mediaType:u,mediaUrl:d,mediaWidth:p,verticalAlignment:h}=e;let m;m="image"!==u&&u?["core/video",{id:s,src:d}]:["core/image",{id:s,alt:a,url:d,sizeSlug:c,href:e.href,linkClass:e.linkClass,linkDestination:e.linkDestination,linkTarget:e.linkTarget,rel:e.rel}];const f=[["core/column",{width:`${p}%`},[m]],["core/column",{width:100-p+"%"},t]];return"right"===l&&f.reverse(),fc("core/columns",{align:n,backgroundColor:r,textColor:o,style:i,verticalAlignment:h},gc(f))}}],ungroup:(e,t)=>t.flatMap((e=>e.innerBlocks))};var kte=_te;const wte={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/columns",title:"Columns",category:"design",description:"Display content in multiple columns, with blocks added to each column.",textdomain:"default",attributes:{verticalAlignment:{type:"string"},isStackedOnMobile:{type:"boolean",default:!0},templateLock:{type:["string","boolean"],enum:["all","insert","contentOnly",!1]}},supports:{anchor:!0,align:["wide","full"],html:!1,color:{gradients:!0,link:!0,heading:!0,button:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{blockGap:{__experimentalDefault:"2em",sides:["horizontal","vertical"]},margin:["top","bottom"],padding:!0,__experimentalDefaultControls:{padding:!0,blockGap:!0}},layout:{allowSwitching:!1,allowInheriting:!1,allowEditing:!1,default:{type:"flex",flexWrap:"nowrap"}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}}},editorStyle:"wp-block-columns-editor",style:"wp-block-columns"},{name:Ete}=wte,Cte={icon:cte.Z,variations:yte,example:{viewportWidth:600,innerBlocks:[{name:"core/column",innerBlocks:[{name:"core/paragraph",attributes:{content:(0,$.__)("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,$.__)("Suspendisse commodo neque lacus, a dictum orci interdum et.")}}]},{name:"core/column",innerBlocks:[{name:"core/paragraph",attributes:{content:(0,$.__)("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,$.__)("Nam risus massa, ullamcorper consectetur eros fermentum, porta aliquet ligula. Sed vel mauris nec enim.")}}]}]},deprecated:dte,edit:e=>{const{clientId:t}=e,n=(0,yl.Z)((e=>e(e_).getBlocks(t).length>0),[t])?bte:vte;return(0,x.createElement)(n,{...e})},save:function({attributes:e}){const{isStackedOnMobile:t,verticalAlignment:n}=e,r=R()({[`are-vertically-aligned-${n}`]:n,"is-not-stacked-on-mobile":!t}),o=sB.save({className:r}),i=iF.save(o);return(0,x.createElement)("div",{...i})},transforms:kte},xte="core/columns",Ste={name:xte,examples:null,deprecated:null,save:()=>null},Ite={...wte,...Cte,...Ste,category:"design",supports:{...wte.supports,anchor:!1}};var Tte=n(74120);var Nte=[{attributes:{verticalAlignment:{type:"string"},width:{type:"number",min:0,max:100}},isEligible({width:e}){return isFinite(e)},migrate(e){return{...e,width:`${e.width}%`}},save({attributes:e}){const{verticalAlignment:t,width:n}=e,r=R()({[`is-vertically-aligned-${t}`]:t}),o={flexBasis:n+"%"};return(0,x.createElement)("div",{className:r,style:o},(0,x.createElement)(aF.Content,null))}}];const Pte={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/column",title:"Column",category:"design",parent:["core/columns"],description:"A single column within a columns block.",textdomain:"default",attributes:{verticalAlignment:{type:"string"},width:{type:"string"},allowedBlocks:{type:"array"},templateLock:{type:["string","boolean"],enum:["all","insert","contentOnly",!1]}},supports:{__experimentalOnEnter:!0,anchor:!0,reusable:!1,html:!1,color:{gradients:!0,heading:!0,button:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{blockGap:!0,padding:!0,__experimentalDefaultControls:{padding:!0,blockGap:!0}},__experimentalBorder:{color:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,style:!0,width:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},layout:!0}},{name:Rte}=Pte,Ate={icon:Tte.Z,edit:function({attributes:{verticalAlignment:e,width:t,templateLock:n,allowedBlocks:r},setAttributes:o,clientId:i}){const a=R()("block-core-columns",{[`is-vertically-aligned-${e}`]:e}),s=GC({availableUnits:YE("spacing.units")||["%","px","em","rem","vw"]}),{columnsIds:l,hasChildBlocks:c,rootClientId:u}=(0,yl.Z)((e=>{const{getBlockOrder:t,getBlockRootClientId:n}=e(e_),r=n(i);return{hasChildBlocks:t(i).length>0,rootClientId:r,columnsIds:t(r)}}),[i]),{updateBlockAttributes:d}=(0,_l.Z)(e_),p=Number.isFinite(t)?t+"%":t,h=sB({className:a,style:p?{flexBasis:p}:void 0}),m=l.length,f=l.indexOf(i)+1,g=(0,$.sprintf)((0,$.__)("%1$s (%2$d of %3$d)"),h["aria-label"],f,m),b=iF({...h,"aria-label":g},{templateLock:n,allowedBlocks:r,renderAppender:c?void 0:aF.ButtonBlockAppender});return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(Hk,null,(0,x.createElement)(FE,{onChange:e=>{o({verticalAlignment:e}),d(u,{verticalAlignment:null})},value:e,controls:["top","center","bottom","stretch"]})),(0,x.createElement)(qI,null,(0,x.createElement)(tI.ZP,{title:(0,$.__)("Column settings")},(0,x.createElement)(rx,{label:(0,$.__)("Width"),labelPosition:"edge",__unstableInputWidth:"80px",value:t||"",onChange:e=>{e=0>parseFloat(e)?"0":e,o({width:e})},units:s}))),(0,x.createElement)("div",{...b}))},save:function({attributes:e}){const{verticalAlignment:t,width:n}=e,r=R()({[`is-vertically-aligned-${t}`]:t});let o;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+"%"}o={flexBasis:e}}const i=sB.save({className:r,style:o}),a=iF.save(i);return(0,x.createElement)("div",{...a})},deprecated:Nte},Bte="core/column",Lte={name:Bte,examples:null,deprecated:null,save:()=>null},Mte={...Pte,...Ate,...Lte,category:"design",supports:{...Pte.supports,anchor:!1}};var Dte=n(6730);const Ote={className:!1,anchor:!0},Fte={align:{type:"string"},content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:""},level:{type:"number",default:2},placeholder:{type:"string"}},jte=e=>{if(!e.customTextColor)return e;const t={color:{text:e.customTextColor}},{customTextColor:n,...r}=e;return{...r,style:t}},Zte=["left","right","center"],zte=e=>{const{align:t,...n}=e;return Zte.includes(t)?{...n,textAlign:t}:e},Vte={supports:Ote,attributes:{...Fte,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>jte(zte(e)),save({attributes:e}){const{align:t,level:n,content:r,textColor:o,customTextColor:i}=e,a="h"+n,s=hZ("color",o),l=R()({[s]:s});return(0,x.createElement)(VX.Content,{className:l||void 0,tagName:a,style:{textAlign:t,color:s?void 0:i},value:r})}},Hte={attributes:{...Fte,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>jte(zte(e)),save({attributes:e}){const{align:t,content:n,customTextColor:r,level:o,textColor:i}=e,a="h"+o,s=hZ("color",i),l=R()({[s]:s,[`has-text-align-${t}`]:t});return(0,x.createElement)(VX.Content,{className:l||void 0,tagName:a,style:{color:s?void 0:r},value:n})},supports:Ote},Ute={supports:Ote,attributes:{...Fte,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>jte(zte(e)),save({attributes:e}){const{align:t,content:n,customTextColor:r,level:o,textColor:i}=e,a="h"+o,s=hZ("color",i),l=R()({[s]:s,"has-text-color":i||r,[`has-text-align-${t}`]:t});return(0,x.createElement)(VX.Content,{className:l||void 0,tagName:a,style:{color:s?void 0:r},value:n})}};var $te=[{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:"",__experimentalRole:"content"},level:{type:"number",default:2},placeholder:{type:"string"}},save({attributes:e}){const{textAlign:t,content:n,level:r}=e,o="h"+r,i=R()({[`has-text-align-${t}`]:t});return(0,x.createElement)(o,{...sB.save({className:i})},(0,x.createElement)(VX.Content,{value:n}))}},{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:Fte,isEligible:({align:e})=>Zte.includes(e),migrate:zte,save({attributes:e}){const{align:t,content:n,level:r}=e,o="h"+r,i=R()({[`has-text-align-${t}`]:t});return(0,x.createElement)(o,{...sB.save({className:i})},(0,x.createElement)(VX.Content,{value:n}))}},Ute,Hte,Vte];const Wte={},Gte=(e,t)=>{const n=(e=>$c()((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 Wte[e];let r=n,o=0;for(;Object.values(Wte).includes(r);)o+=1,r=n+"-"+o;return r},qte=(e,t)=>{Wte[e]=t};const Kte={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>e.map((({content:e,anchor:t,align:n})=>fc("core/heading",{content:e,anchor:t,textAlign:n})))},{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=Ip("core/heading",e.outerHTML),{textAlign:n}=e.style||{};var r;return t.level=(r=e.nodeName,Number(r.substr(1))),"left"!==n&&"center"!==n&&"right"!==n||(t.align=n),fc("core/heading",t)}},...[1,2,3,4,5,6].map((e=>({type:"prefix",prefix:Array(e+1).join("#"),transform(t){return fc("core/heading",{level:e,content:t})}}))),...[1,2,3,4,5,6].map((e=>({type:"enter",regExp:new RegExp(`^/(h|H)${e}$`),transform:()=>fc("core/heading",{level:e})})))],to:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>e.map((({content:e,textAlign:t})=>fc("core/paragraph",{content:e,align:t})))}]};var Yte=Kte;const Xte={$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:{textAlign:{type:"string"},content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:"",__experimentalRole:"content"},level:{type:"number",default:2},placeholder:{type:"string"}},supports:{align:["wide","full"],anchor:!0,className:!0,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0,textTransform:!0}},__unstablePasteTextInline:!0,__experimentalSlashInserter:!0},editorStyle:"wp-block-heading-editor",style:"wp-block-heading"},{name:Jte}=Xte,Qte={icon:Dte.Z,example:{attributes:{content:(0,$.__)("Code is Poetry"),level:2}},__experimentalLabel(e,{context:t}){const{content:n,level:r}=e;return"list-view"===t&&n?n:"accessibility"===t?n&&0!==n.length?(0,$.sprintf)((0,$.__)("Level %1$s. %2$s"),r,n):(0,$.sprintf)((0,$.__)("Level %s. Empty."),r):void 0},transforms:Yte,deprecated:$te,merge(e,t){return{content:(e.content||"")+(t.content||"")}},edit:function({attributes:e,setAttributes:t,mergeBlocks:n,onReplace:r,style:o,clientId:i}){const{textAlign:a,content:s,level:l,placeholder:c,anchor:u}=e,d="h"+l,p=sB({className:R()({[`has-text-align-${a}`]:a}),style:o}),{canGenerateAnchors:h}=(0,yl.Z)((e=>{const{getGlobalBlockCount:t,getSettings:n}=e(e_);return{canGenerateAnchors:!!n().generateAnchors||t("core/table-of-contents")>0}}),[]),{__unstableMarkNextChangeAsNotPersistent:m}=(0,_l.Z)(e_);return(0,x.useEffect)((()=>{if(h)return!u&&s&&(m(),t({anchor:Gte(i,s)})),qte(i,u),()=>qte(i,null)}),[u,s,i,h]),(0,x.createElement)(x.Fragment,null,(0,x.createElement)(Hk,{group:"block"},(0,x.createElement)(HK,{value:l,onChange:e=>t({level:e})}),(0,x.createElement)(RK,{value:a,onChange:e=>{t({textAlign:e})}})),(0,x.createElement)(VX,{identifier:"content",tagName:d,value:s,onChange:e=>{const n={content:e};!h||u&&e&&Gte(i,s)!==u||(n.anchor=Gte(i,e)),t(n)},onMerge:n,onSplit:(t,n)=>{let r;var o;return r=n||t?fc("core/heading",{...e,content:t}):fc(null!==(o=ac())&&void 0!==o?o:"core/heading"),n&&(r.clientId=i),r},onReplace:r,onRemove:()=>r([]),placeholder:c||(0,$.__)("Heading"),textAlign:a,...wm.Z.isNative&&{deleteEnter:!0},...p}))},save:function({attributes:e}){const{textAlign:t,content:n,level:r}=e,o="h"+r,i=R()({[`has-text-align-${t}`]:t});return(0,x.createElement)(o,{...sB.save({className:i})},(0,x.createElement)(VX.Content,{value:n}))}},ene="core/heading",tne={name:ene,examples:null,deprecated:null,save:()=>null},nne={...Xte,...Qte,...tne,category:"design",supports:{...Xte.supports,html:!1}},rne={className:!1},one={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"}},ine=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:r,customFontSize:o,...i}=e;return{...i,style:t}},{style:ane,...sne}=one,lne=[{supports:rne,attributes:{...sne,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},save({attributes:e}){const{align:t,content:n,dropCap:r,direction:o}=e,i=R()({"has-drop-cap":t!==((0,$.isRTL)()?"left":"right")&&"center"!==t&&r,[`has-text-align-${t}`]:t});return(0,x.createElement)("p",{...sB.save({className:i,dir:o})},(0,x.createElement)(VX.Content,{value:n}))}},{supports:rne,attributes:{...sne,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},migrate:ine,save({attributes:e}){const{align:t,content:n,dropCap:r,backgroundColor:o,textColor:i,customBackgroundColor:a,customTextColor:s,fontSize:l,customFontSize:c,direction:u}=e,d=hZ("color",i),p=hZ("background-color",o),h=Y$(l),m=R()({"has-text-color":i||s,"has-background":o||a,"has-drop-cap":r,[`has-text-align-${t}`]:t,[h]:h,[d]:d,[p]:p}),f={backgroundColor:p?void 0:a,color:d?void 0:s,fontSize:h?void 0:c};return(0,x.createElement)(VX.Content,{tagName:"p",style:f,className:m||void 0,value:n,dir:u})}},{supports:rne,attributes:{...sne,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},migrate:ine,save({attributes:e}){const{align:t,content:n,dropCap:r,backgroundColor:o,textColor:i,customBackgroundColor:a,customTextColor:s,fontSize:l,customFontSize:c,direction:u}=e,d=hZ("color",i),p=hZ("background-color",o),h=Y$(l),m=R()({"has-text-color":i||s,"has-background":o||a,"has-drop-cap":r,[h]:h,[d]:d,[p]:p}),f={backgroundColor:p?void 0:a,color:d?void 0:s,fontSize:h?void 0:c,textAlign:t};return(0,x.createElement)(VX.Content,{tagName:"p",style:f,className:m||void 0,value:n,dir:u})}},{supports:rne,attributes:{...sne,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"},width:{type:"string"}},migrate:ine,save({attributes:e}){const{width:t,align:n,content:r,dropCap:o,backgroundColor:i,textColor:a,customBackgroundColor:s,customTextColor:l,fontSize:c,customFontSize:u}=e,d=hZ("color",a),p=hZ("background-color",i),h=c&&`is-${c}-text`,m=R()({[`align${t}`]:t,"has-background":i||s,"has-drop-cap":o,[h]:h,[d]:d,[p]:p}),f={backgroundColor:p?void 0:s,color:d?void 0:l,fontSize:h?void 0:u,textAlign:n};return(0,x.createElement)(VX.Content,{tagName:"p",style:f,className:m||void 0,value:r})}},{supports:rne,attributes:{...sne,fontSize:{type:"number"}},save({attributes:e}){const{width:t,align:n,content:r,dropCap:o,backgroundColor:i,textColor:a,fontSize:s}=e,l=R()({[`align${t}`]:t,"has-background":i,"has-drop-cap":o}),c={backgroundColor:i,color:a,fontSize:s,textAlign:n};return(0,x.createElement)("p",{style:c,className:l||void 0},r)},migrate(e){return ine({...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:rne,attributes:{...one,content:{type:"string",source:"html",default:""}},save({attributes:e}){return(0,x.createElement)(nd,null,e.content)},migrate(e){return e}}];var cne=lne,une=n(61038);function dne(e){const{batch:t}=(0,Tf.Z)(),{moveBlocksToPosition:n,replaceInnerBlocks:r,duplicateBlocks:o,insertBlock:i}=(0,_l.Z)(e_),{getBlockRootClientId:a,getBlockIndex:s,getBlockOrder:l,getBlockName:c,getBlock:u,getNextBlockClientId:d,canInsertBlockType:p}=(0,yl.Z)(e_),h=(0,x.useRef)(e);return h.current=e,If((e=>{function m(e){if(e.defaultPrevented)return;if(e.keyCode!==Hf.K5)return;const{content:m,clientId:f}=h.current;if(m.length)return;const g=a(f);if(!uc(c(g),"__experimentalOnEnter",!1))return;const b=l(g),v=b.indexOf(f);if(v===b.length-1){let t=g;for(;!p(c(f),a(t));)t=a(t);return void("string"==typeof t&&(e.preventDefault(),n([f],g,a(t),s(t)+1)))}const y=ac();if(!p(y,a(g)))return;e.preventDefault();const _=u(g);t((()=>{o([g]);const e=s(g);r(g,_.innerBlocks.slice(0,v)),r(d(g),_.innerBlocks.slice(v+1)),i(fc(y),e+1,a(g),!0)}))}return e.addEventListener("keydown",m),()=>{e.removeEventListener("keydown",m)}}),[])}function pne({direction:e,setDirection:t}){return(0,$.isRTL)()&&(0,x.createElement)(Jh,{icon:une.Z,title:(0,$._x)("Left to right","editor button"),isActive:"ltr"===e,onClick:()=>{t("ltr"===e?void 0:"ltr")}})}function hne(e){return e===((0,$.isRTL)()?"left":"right")||"center"===e}const{name:mne}={$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",usesContext:["postId"],attributes:{align:{type:"string"},content:{type:"string",source:"html",selector:"p",default:"",__experimentalRole:"content"},dropCap:{type:"boolean",default:!1},placeholder:{type:"string"},direction:{type:"string",enum:["ltr","rtl"]}},supports:{anchor:!0,className:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},__experimentalConnections:!0,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalSelector:"p",__unstablePasteTextInline:!0},editorStyle:"wp-block-paragraph-editor",style:"wp-block-paragraph"},fne={from:[{type:"raw",priority:20,selector:"p",schema:({phrasingContentSchema:e,isPaste:t})=>({p:{children:e,attributes:t?[]:["style","id"]}}),transform(e){const t=Ip(mne,e.outerHTML),{textAlign:n}=e.style||{};return"left"!==n&&"center"!==n&&"right"!==n||(t.align=n),fc(mne,t)}}]};var gne=fne;const bne={$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",usesContext:["postId"],attributes:{align:{type:"string"},content:{type:"string",source:"html",selector:"p",default:"",__experimentalRole:"content"},dropCap:{type:"boolean",default:!1},placeholder:{type:"string"},direction:{type:"string",enum:["ltr","rtl"]}},supports:{anchor:!0,className:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},__experimentalConnections:!0,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalSelector:"p",__unstablePasteTextInline:!0},editorStyle:"wp-block-paragraph-editor",style:"wp-block-paragraph"},{name:vne}=bne,yne={icon:AK.Z,example:{attributes:{content:(0,$.__)("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}){if("accessibility"===t){const{content:t}=e;return t&&0!==t.length?t:(0,$.__)("Empty")}},transforms:gne,deprecated:cne,merge(e,t){return{content:(e.content||"")+(t.content||"")}},edit:function({attributes:e,mergeBlocks:t,onReplace:n,onRemove:r,setAttributes:o,clientId:i}){const{align:a,content:s,direction:l,dropCap:c,placeholder:u}=e,d=YE("typography.dropCap"),p=sB({ref:dne({clientId:i,content:s}),className:R()({"has-drop-cap":!hne(a)&&c,[`has-text-align-${a}`]:a}),style:{direction:l}});let h;return h=hne(a)?(0,$.__)("Not available for aligned text."):c?(0,$.__)("Showing large initial letter."):(0,$.__)("Toggle to show a large initial letter."),(0,x.createElement)(x.Fragment,null,(0,x.createElement)(Hk,{group:"block"},(0,x.createElement)(RK,{value:a,onChange:e=>o({align:e,dropCap:!hne(e)&&c})}),(0,x.createElement)(pne,{direction:l,setDirection:e=>o({direction:e})})),d&&(0,x.createElement)(qI,{group:"typography"},(0,x.createElement)(_F,{hasValue:()=>!!c,label:(0,$.__)("Drop cap"),onDeselect:()=>o({dropCap:void 0}),resetAllFilter:()=>({dropCap:void 0}),panelId:i},(0,x.createElement)(aE.Z,{__nextHasNoMarginBottom:!0,label:(0,$.__)("Drop cap"),checked:!!c,onChange:()=>o({dropCap:!c}),help:h,disabled:!!hne(a)}))),(0,x.createElement)(VX,{identifier:"content",tagName:"p",...p,value:s,onChange:e=>o({content:e}),onSplit:(t,n)=>{let r;(n||t)&&(r={...e,content:t});const o=fc("core/paragraph",r);return n&&(o.clientId=i),o},onMerge:t,onReplace:n,onRemove:r,"aria-label":s?(0,$.__)("Block: Paragraph"):(0,$.__)("Empty block; start writing or type forward slash to choose a block"),"data-empty":!s,placeholder:u||(0,$.__)("Type / to choose a block"),"data-custom-placeholder":!!u||void 0,__unstableEmbedURLOnPaste:!0,__unstableAllowPrefixTransformations:!0}))},save:function({attributes:e}){const{align:t,content:n,dropCap:r,direction:o}=e,i=R()({"has-drop-cap":t!==((0,$.isRTL)()?"left":"right")&&"center"!==t&&r,[`has-text-align-${t}`]:t});return(0,x.createElement)("p",{...sB.save({className:i,dir:o})},(0,x.createElement)(VX.Content,{value:n}))}},_ne="core/paragraph",kne={name:_ne,examples:null,deprecated:null,save:()=>null},wne={...bne,...yne,...kne,category:"design",supports:{...bne.supports,html:!1,anchor:!1}};var Ene=n(85977);const Cne={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:r,align:o,href:i,width:a,height:s,id:l}=e,c=(0,x.createElement)("img",{src:t,alt:n,className:l?`wp-image-${l}`:null,width:a,height:s});return(0,x.createElement)("figure",{className:o?`align${o}`:null},i?(0,x.createElement)("a",{href:i},c):c,!VX.isEmpty(r)&&(0,x.createElement)(VX.Content,{tagName:"figcaption",value:r}))}},xne={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:r,align:o,href:i,width:a,height:s,id:l}=e,c=R()({[`align${o}`]:o,"is-resized":a||s}),u=(0,x.createElement)("img",{src:t,alt:n,className:l?`wp-image-${l}`:null,width:a,height:s});return(0,x.createElement)("figure",{className:c},i?(0,x.createElement)("a",{href:i},u):u,!VX.isEmpty(r)&&(0,x.createElement)(VX.Content,{tagName:"figcaption",value:r}))}},Sne={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:r,align:o,href:i,rel:a,linkClass:s,width:l,height:c,id:u,linkTarget:d,sizeSlug:p,title:h}=e,m=a||void 0,f=R()({[`align${o}`]:o,[`size-${p}`]:p,"is-resized":l||c}),g=(0,x.createElement)("img",{src:t,alt:n,className:u?`wp-image-${u}`:null,width:l,height:c,title:h}),b=(0,x.createElement)(x.Fragment,null,i?(0,x.createElement)("a",{className:s,href:i,target:d,rel:m},g):g,!VX.isEmpty(r)&&(0,x.createElement)(VX.Content,{tagName:"figcaption",value:r}));return"left"===o||"right"===o||"center"===o?(0,x.createElement)("div",{...sB.save()},(0,x.createElement)("figure",{className:f},b)):(0,x.createElement)("figure",{...sB.save({className:f})},b)}},Ine={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:r,align:o,href:i,rel:a,linkClass:s,width:l,height:c,id:u,linkTarget:d,sizeSlug:p,title:h}=e,m=a||void 0,f=R()({[`align${o}`]:o,[`size-${p}`]:p,"is-resized":l||c}),g=(0,x.createElement)("img",{src:t,alt:n,className:u?`wp-image-${u}`:null,width:l,height:c,title:h}),b=(0,x.createElement)(x.Fragment,null,i?(0,x.createElement)("a",{className:s,href:i,target:d,rel:m},g):g,!VX.isEmpty(r)&&(0,x.createElement)(VX.Content,{tagName:"figcaption",value:r}));return(0,x.createElement)("figure",{...sB.save({className:f})},b)}},Tne={attributes:{align:{type:"string"},url:{type:"string",source:"attribute",selector:"img",attribute:"src",__experimentalRole:"content"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:"",__experimentalRole:"content"},caption:{type:"string",source:"html",selector:"figcaption",__experimentalRole:"content"},title:{type:"string",source:"attribute",selector:"img",attribute:"title",__experimentalRole:"content"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href",__experimentalRole:"content"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number",__experimentalRole:"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:r,align:o,href:i,rel:a,linkClass:s,width:l,height:c,aspectRatio:u,scale:d,id:p,linkTarget:h,sizeSlug:m,title:f}=e,g=a||void 0,b=EK(e),v=R()({[`align${o}`]:o,[`size-${m}`]:m,"is-resized":l||c,"has-custom-border":!!b.className||b.style&&Object.keys(b.style).length>0}),y=R()(b.className,{[`wp-image-${p}`]:!!p}),_=(0,x.createElement)("img",{src:t,alt:n,className:y||void 0,style:{...b.style,aspectRatio:u,objectFit:d},width:l,height:c,title:f}),k=(0,x.createElement)(x.Fragment,null,i?(0,x.createElement)("a",{className:s,href:i,target:h,rel:g},_):_,!VX.isEmpty(r)&&(0,x.createElement)(VX.Content,{className:F0("caption"),tagName:"figcaption",value:r}));return(0,x.createElement)("figure",{...sB.save({className:v})},k)}},Nne={attributes:{align:{type:"string"},url:{type:"string",source:"attribute",selector:"img",attribute:"src",__experimentalRole:"content"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:"",__experimentalRole:"content"},caption:{type:"string",source:"html",selector:"figcaption",__experimentalRole:"content"},title:{type:"string",source:"attribute",selector:"img",attribute:"title",__experimentalRole:"content"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href",__experimentalRole:"content"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number",__experimentalRole:"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}){return{...n,width:`${e}px`,height:`${t}px`}},save({attributes:e}){const{url:t,alt:n,caption:r,align:o,href:i,rel:a,linkClass:s,width:l,height:c,aspectRatio:u,scale:d,id:p,linkTarget:h,sizeSlug:m,title:f}=e,g=a||void 0,b=EK(e),v=R()({[`align${o}`]:o,[`size-${m}`]:m,"is-resized":l||c,"has-custom-border":!!b.className||b.style&&Object.keys(b.style).length>0}),y=R()(b.className,{[`wp-image-${p}`]:!!p}),_=(0,x.createElement)("img",{src:t,alt:n,className:y||void 0,style:{...b.style,aspectRatio:u,objectFit:d,width:l,height:c},width:l,height:c,title:f}),k=(0,x.createElement)(x.Fragment,null,i?(0,x.createElement)("a",{className:s,href:i,target:h,rel:g},_):_,!VX.isEmpty(r)&&(0,x.createElement)(VX.Content,{className:F0("caption"),tagName:"figcaption",value:r}));return(0,x.createElement)("figure",{...sB.save({className:v})},k)}},Pne={attributes:{align:{type:"string"},behaviors:{type:"object"},url:{type:"string",source:"attribute",selector:"img",attribute:"src",__experimentalRole:"content"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:"",__experimentalRole:"content"},caption:{type:"string",source:"html",selector:"figcaption",__experimentalRole:"content"},title:{type:"string",source:"attribute",selector:"img",attribute:"title",__experimentalRole:"content"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href",__experimentalRole:"content"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number",__experimentalRole:"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:r}}}=n,o={...n,lightbox:{enabled:r}};return delete o.behaviors,o},isEligible(e){return!!e.behaviors},save({attributes:e}){const{url:t,alt:n,caption:r,align:o,href:i,rel:a,linkClass:s,width:l,height:c,aspectRatio:u,scale:d,id:p,linkTarget:h,sizeSlug:m,title:f}=e,g=a||void 0,b=EK(e),v=R()({[`align${o}`]:o,[`size-${m}`]:m,"is-resized":l||c,"has-custom-border":!!b.className||b.style&&Object.keys(b.style).length>0}),y=R()(b.className,{[`wp-image-${p}`]:!!p}),_=(0,x.createElement)("img",{src:t,alt:n,className:y||void 0,style:{...b.style,aspectRatio:u,objectFit:d,width:l,height:c},title:f}),k=(0,x.createElement)(x.Fragment,null,i?(0,x.createElement)("a",{className:s,href:i,target:h,rel:g},_):_,!VX.isEmpty(r)&&(0,x.createElement)(VX.Content,{className:F0("caption"),tagName:"figcaption",value:r}));return(0,x.createElement)("figure",{...sB.save({className:v})},k)}};var Rne=[Pne,Nne,Tne,Ine,Sne,xne,Cne,{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:r,align:o,href:i,width:a,height:s}=e,l=a||s?{width:a,height:s}:{},c=(0,x.createElement)("img",{src:t,alt:n,...l});let u={};return a?u={width:a}:"left"!==o&&"right"!==o||(u={maxWidth:"50%"}),(0,x.createElement)("figure",{className:o?`align${o}`:null,style:u},i?(0,x.createElement)("a",{href:i},c):c,!VX.isEmpty(r)&&(0,x.createElement)(VX.Content,{tagName:"figcaption",value:r}))}}],Ane=n(48515),Bne=n(15349),Lne=n(25922);const{lock:Mne,unlock:Dne}=(0,pl.es)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/block-library");var One=n(5287),Fne=n.n(One);const jne=[{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"}],Zne="wp-embed",{name:zne}={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/embed",title:"Embed",category:"embed",description:"Add a block that displays content pulled from other sites, like Twitter or YouTube.",textdomain:"default",attributes:{url:{type:"string",__experimentalRole:"content"},caption:{type:"string",source:"html",selector:"figcaption",__experimentalRole:"content"},type:{type:"string",__experimentalRole:"content"},providerNameSlug:{type:"string",__experimentalRole:"content"},allowResponsive:{type:"boolean",default:!0},responsive:{type:"boolean",default:!1,__experimentalRole:"content"},previewable:{type:"boolean",default:!0,__experimentalRole:"content"}},supports:{align:!0,spacing:{margin:!0}},editorStyle:"wp-block-embed-editor",style:"wp-block-embed"},{kebabCase:Vne}=Dne(L2),Hne=e=>e&&e.includes('class="wp-embedded-content"'),Une=e=>{if(!e)return e;const t=jne.reduce(((e,{className:t})=>(e[t]=!1,e)),{"wp-has-aspect-ratio":!1});return Fne()(e,t)};(0,bp.Z)(((e,t,n,r,o=!0)=>{if(!e)return{};const i={};let{type:a="rich"}=e;const{html:s,provider_name:l}=e,c=Vne((l||t).toLowerCase());return Hne(s)&&(a=Zne),(s||"photo"===a)&&(i.type=a,i.providerNameSlug=c),(u=n)&&jne.some((({className:e})=>u.includes(e)))||(i.className=function(e,t,n=!0){if(!n)return Une(t);const r=document.implementation.createHTMLDocument("");r.body.innerHTML=e;const o=r.body.querySelector("iframe");if(o&&o.height&&o.width){const e=(o.width/o.height).toFixed(2);for(let n=0;n<jne.length;n++){const r=jne[n];if(e>=r.ratio)return e-r.ratio>.1?Une(t):Fne()(Une(t),r.className,"wp-has-aspect-ratio")}}return t}(s,n,r&&o)),i;var u}));const $ne="none",Wne="media",Gne="attachment",qne="custom",Kne=["image"],{DimensionsTool:Yne,ResolutionTool:Xne}=Dne(L2),Jne=[{value:"cover",label:(0,$._x)("Cover","Scale option for dimensions control"),help:(0,$.__)("Image covers the space evenly.")},{value:"contain",label:(0,$._x)("Contain","Scale option for dimensions control"),help:(0,$.__)("Image is contained without distortion.")}],Qne=({href:e,children:t})=>e?(0,x.createElement)("a",{href:e,onClick:e=>e.preventDefault(),"aria-disabled":!0,style:{pointerEvents:"none",cursor:"default",display:"inline"}},t):t;function ere({temporaryURL:e,attributes:t,setAttributes:n,isSelected:r,insertBlocksAfter:o,onReplace:i,onSelectImage:a,onSelectURL:s,onUploadError:l,containerRef:c,context:u,clientId:d,blockEditingMode:p}){const{url:h="",alt:m,caption:f,align:g,id:b,href:v,rel:y,linkClass:_,linkDestination:k,title:w,width:E,height:C,aspectRatio:S,scale:I,linkTarget:T,sizeSlug:N,lightbox:P}=t,R=E?parseInt(E,10):void 0,A=C?parseInt(C,10):void 0,B=(0,x.useRef)(),L=tD(f),[M,D]=(0,x.useState)(!!f),{allowResize:O=!0}=u,{getBlock:F}=(0,yl.Z)(e_),{image:j,multiImageSelection:Z}=(0,yl.Z)((e=>{const{getMedia:t}=e(vl),{getMultiSelectedBlockClientIds:n,getBlockName:o}=e(e_),i=n();return{image:b&&r?t(b,{context:"view"}):null,multiImageSelection:i.length&&i.every((e=>"core/image"===o(e)))}}),[b,r]),{canInsertCover:z,imageEditing:V,imageSizes:H,maxWidth:U,mediaUpload:W}=(0,yl.Z)((e=>{const{getBlockRootClientId:t,getSettings:n,canInsertBlockType:r}=e(e_),o=t(d),i=n();return{imageEditing:i.imageEditing,imageSizes:i.imageSizes,maxWidth:i.maxWidth,mediaUpload:i.mediaUpload,canInsertCover:r("core/cover",o)}}),[d]),{replaceBlocks:G,toggleSelection:q}=(0,_l.Z)(e_),{createErrorNotice:K,createSuccessNotice:Y}=(0,_l.Z)(PM.store),X=(0,rT.Z)("medium"),J=["wide","full"].includes(g),[{loadedNaturalWidth:Q,loadedNaturalHeight:ee},te]=(0,x.useState)({}),[ne,re]=(0,x.useState)(!1),[oe,ie]=(0,x.useState)(),ae=function(e,t){const[n,r]=(0,x.useState)();function o(){r(e.current?.clientWidth)}return(0,x.useEffect)(o,t),(0,x.useEffect)((()=>{const{defaultView:t}=e.current.ownerDocument;return t.addEventListener("resize",o),()=>{t.removeEventListener("resize",o)}}),[]),n}(c,[g]),se="default"===p,le=O&&se&&!(J&&X),ce=H.filter((({slug:e})=>j?.media_details?.sizes?.[e]?.source_url)).map((({name:e,slug:t})=>({value:t,label:e}))),ue=!!W;(0,x.useEffect)((()=>{tre(b,h)&&r&&ue?oe||window.fetch(h.includes("?")?h:h+"?").then((e=>e.blob())).then((e=>ie(e))).catch((()=>{})):ie()}),[b,h,r,oe,ue]),(0,x.useEffect)((()=>{f&&!L&&D(!0)}),[f,L]);const de=(0,x.useCallback)((e=>{e&&!f&&e.focus()}),[f]),{naturalWidth:pe,naturalHeight:he}=(0,x.useMemo)((()=>({naturalWidth:B.current?.naturalWidth||Q||void 0,naturalHeight:B.current?.naturalHeight||ee||void 0})),[Q,ee,B.current?.complete]);(0,x.useEffect)((()=>{r||(re(!1),f||D(!1))}),[r,f]);const me=b&&pe&&he&&V,fe=!Z&&me&&!ne,ge=GC({availableUnits:["px"]}),be=YE("lightbox"),ve=!!P||!0===be?.allowEditing,ye=!!P?.enabled||!P&&!!be?.enabled,_e="none"!==k,ke=(0,x.createElement)(Yne,{value:{width:E,height:C,scale:I,aspectRatio:S},onChange:({width:e,height:t,scale:r,aspectRatio:o})=>{n({width:!e&&t?"auto":e,height:t,scale:r,aspectRatio:o})},defaultScale:"cover",defaultAspectRatio:"auto",scaleOptions:Jne,unitsOptions:ge}),we=()=>{n({width:void 0,height:void 0,scale:void 0,aspectRatio:void 0,lightbox:void 0})},Ee=(0,x.createElement)(qI,null,(0,x.createElement)(VI,{label:(0,$.__)("Settings"),resetAll:we},le&&ke)),Ce=(0,x.createElement)(x.Fragment,null,(0,x.createElement)(Hk,{group:"block"},se&&(0,x.createElement)($S,{value:g,onChange:function(e){const t=["wide","full"].includes(e)?{width:void 0,height:void 0,aspectRatio:void 0,scale:void 0}:{};n({...t,align:e})}}),se&&(0,x.createElement)(Jh,{onClick:()=>{D(!M),M&&f&&n({caption:void 0})},icon:Ane.Z,isPressed:M,label:M?(0,$.__)("Remove caption"):(0,$.__)("Add caption")}),!Z&&!ne&&(0,x.createElement)(QX,{url:v||"",onChangeUrl:function(e){n(e)},linkDestination:k,mediaUrl:j&&j.source_url||h,mediaLink:j&&j.link,linkTarget:T,linkClass:_,rel:y}),fe&&(0,x.createElement)(Jh,{onClick:()=>re(!0),icon:Bne.Z,label:(0,$.__)("Crop")}),!Z&&z&&(0,x.createElement)(Jh,{icon:Lne.Z,label:(0,$.__)("Add text over image"),onClick:function(){G(d,xc(F(d),"core/cover"))}})),!Z&&!ne&&(0,x.createElement)(Hk,{group:"other"},(0,x.createElement)(Kj,{mediaId:b,mediaURL:h,allowedTypes:Kne,accept:"image/*",onSelect:a,onSelectURL:s,onError:l})),!Z&&oe&&(0,x.createElement)(Hk,null,(0,x.createElement)(nm,null,(0,x.createElement)(Jh,{onClick:function(){W({filesList:[oe],onFileChange([e]){a(e),Al(e.url)||(ie(),Y((0,$.__)("Image uploaded."),{type:"snackbar"}))},allowedTypes:Kne,onError(e){K(e,{type:"snackbar"})}})},icon:PF.Z,label:(0,$.__)("Upload external image")}))),(0,x.createElement)(qI,null,(0,x.createElement)(VI,{label:(0,$.__)("Settings"),resetAll:we},!Z&&(0,x.createElement)(_F,{label:(0,$.__)("Alternative text"),isShownByDefault:!0,hasValue:()=>""!==m,onDeselect:()=>n({alt:void 0})},(0,x.createElement)(p1.Z,{label:(0,$.__)("Alternative text"),value:m,onChange:function(e){n({alt:e})},help:(0,x.createElement)(x.Fragment,null,(0,x.createElement)(eI.Z,{href:"https://www.w3.org/WAI/tutorials/images/decision-tree"},(0,$.__)("Describe the purpose of the image.")),(0,x.createElement)("br",null),(0,$.__)("Leave empty if decorative.")),__nextHasNoMarginBottom:!0})),le&&ke,(0,x.createElement)(Xne,{value:N,onChange:function(e){const t=j?.media_details?.sizes?.[e]?.source_url;if(!t)return null;n({url:t,sizeSlug:e})},options:ce}),ve&&(0,x.createElement)(_F,{hasValue:()=>!!P,label:(0,$.__)("Expand on click"),onDeselect:()=>{n({lightbox:void 0})},isShownByDefault:!0},(0,x.createElement)(aE.Z,{label:(0,$.__)("Expand on click"),checked:ye,onChange:e=>{n({lightbox:{enabled:e}})},disabled:_e,help:_e?(0,$.__)("“Expand on click” scales the image up, and can’t be combined with a link."):""})))),(0,x.createElement)(qI,{group:"advanced"},(0,x.createElement)(QS.Z,{__nextHasNoMarginBottom:!0,label:(0,$.__)("Title attribute"),value:w||"",onChange:function(e){n({title:e})},help:(0,x.createElement)(x.Fragment,null,(0,$.__)("Describe the role of this image on the page."),(0,x.createElement)(eI.Z,{href:"https://www.w3.org/TR/html52/dom.html#the-title-attribute"},(0,$.__)("(Note: many devices and browsers do not display this text.)")))}))),xe=(0,SF.v)(h);let Se;Se=m||(xe?(0,$.sprintf)((0,$.__)("This image has an empty alt attribute; its file name is %s"),xe):(0,$.__)("This image has an empty alt attribute"));const Ie=CK(t),Te=t.className?.includes("is-style-rounded");let Ne=(0,x.createElement)(x.Fragment,null,(0,x.createElement)("img",{src:e||h,alt:Se,onError:()=>function(){const e=((e,t={})=>{const{preview:n,attributes:r={}}=e,{url:o,providerNameSlug:i,type:a,...s}=r;if(!o||!sc(zne))return;const l=(e=>hc(zne)?.find((({patterns:t})=>((e,t=[])=>t.some((t=>e.match(t))))(e,t))))(o),c="wordpress"===i||a===Zne;if(!c&&l&&(l.attributes.providerNameSlug!==i||!i))return fc(zne,{url:o,...s,...l.attributes});const u=hc(zne)?.find((({name:e})=>"wordpress"===e));return u&&n&&Hne(n.html)&&!c?fc(zne,{url:o,...u.attributes,...t}):void 0})({attributes:{url:h}});void 0!==e&&i(e)}(),onLoad:e=>{te({loadedNaturalWidth:e.target?.naturalWidth,loadedNaturalHeight:e.target?.naturalHeight})},ref:B,className:Ie.className,style:{width:E&&C||S?"100%":void 0,height:E&&C||S?"100%":void 0,objectFit:I,...Ie.style}}),e&&(0,x.createElement)(UD.ZP,null));const Pe=B.current?.width||ae;if(me&&ne)Ne=(0,x.createElement)(Qne,{href:v},(0,x.createElement)(SY,{id:b,url:h,width:R,height:A,clientWidth:Pe,naturalHeight:he,naturalWidth:pe,onSaveImage:e=>n(e),onFinishEditing:()=>{re(!1)},borderProps:Te?void 0:Ie}));else if(le){const e=S&&function(e){const[t,n=1]=e.split("/").map(Number),r=t/n;return r===1/0||0===r?NaN:r}(S),t=pe/he,o=e||R/A||t||1,i=!R&&A?A*o:R,a=!A&&R?R/o:A,s=pe<he?20:20*o,l=he<pe?20:20/o,c=2.5*U;let u=!1,d=!1;"center"===g?(u=!0,d=!0):(0,$.isRTL)()?"left"===g?u=!0:d=!0:"right"===g?d=!0:u=!0,Ne=(0,x.createElement)(O1,{style:{display:"block",objectFit:I,aspectRatio:E||C||!S?void 0:S},size:{width:null!=i?i:"auto",height:null!=a?a:"auto"},showHandle:r,minWidth:s,maxWidth:c,minHeight:l,maxHeight:c/o,lockAspectRatio:o,enable:{top:!1,right:u,bottom:!0,left:d},onResizeStart:function(){q(!1)},onResizeStop:(e,r,i)=>{q(!0),n({width:`${i.offsetWidth}px`,height:"auto",aspectRatio:o===t?void 0:String(o)})},resizeRatio:"center"===g?2:1},(0,x.createElement)(Qne,{href:v},Ne))}else Ne=(0,x.createElement)("div",{style:{width:E,height:C,aspectRatio:S}},(0,x.createElement)(Qne,{href:v},Ne));return h||e?(0,x.createElement)(x.Fragment,null,!e&&Ce,Ne,M&&(!VX.isEmpty(f)||r)&&(0,x.createElement)(VX,{identifier:"caption",className:F0("caption"),ref:de,tagName:"figcaption","aria-label":(0,$.__)("Image caption text"),placeholder:(0,$.__)("Add caption"),value:f,onChange:e=>n({caption:e}),inlineToolbar:!0,__unstableOnSplitAtEnd:()=>o(fc(ac()))})):Ee}const tre=(e,t)=>t&&!e&&!Al(t);function nre(e,t){var n,r;return"url"in(null!==(n=e?.sizes?.[t])&&void 0!==n?n:{})||"source_url"in(null!==(r=e?.media_details?.sizes?.[t])&&void 0!==r?r:{})}function rre(e,t){const{body:n}=document.implementation.createHTMLDocument("");n.innerHTML=e;const{firstElementChild:r}=n;if(r&&"A"===r.nodeName)return r.getAttribute(t)||void 0}const ore={img:{attributes:["src","alt","title"],classes:["alignleft","aligncenter","alignright","alignnone",/^wp-image-\d+$/]}},ire={from:[{type:"raw",isMatch:e=>"FIGURE"===e.nodeName&&!!e.querySelector("img"),schema:({phrasingContentSchema:e})=>({figure:{require:["img"],children:{...ore,a:{attributes:["href","rel","target"],children:ore},figcaption:{children:e}}}}),transform:e=>{const t=e.className+" "+e.querySelector("img").className,n=/(?:^|\s)align(left|center|right)(?:$|\s)/.exec(t),r=""===e.id?void 0:e.id,o=n?n[1]:void 0,i=/(?:^|\s)wp-image-(\d+)(?:$|\s)/.exec(t),a=i?Number(i[1]):void 0,s=e.querySelector("a"),l=s&&s.href?"custom":void 0,c=s&&s.href?s.href:void 0,u=s&&s.rel?s.rel:void 0,d=s&&s.className?s.className:void 0;return fc("core/image",Ip("core/image",e.outerHTML,{align:o,id:a,linkDestination:l,href:c,rel:u,linkClass:d,anchor:r}))}},{type:"files",isMatch(e){if(e.some((e=>0===e.type.indexOf("image/")))&&e.some((e=>0!==e.type.indexOf("image/")))){const{createErrorNotice:e}=(0,Yl.W)(PM.store);e((0,$.__)("If uploading to a gallery all files need to be image formats"),{id:"gallery-transform-invalid-file",type:"snackbar"})}return e.every((e=>0===e.type.indexOf("image/")))},transform(e){const t=e.map((e=>fc("core/image",{url:Pl(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 r=n.querySelector("img");for(;r&&r.parentNode&&r.parentNode!==n;)r=r.parentNode;return r&&r.parentNode.removeChild(r),n.innerHTML.trim()}},href:{shortcode:(e,{shortcode:t})=>rre(t.content,"href")},rel:{shortcode:(e,{shortcode:t})=>rre(t.content,"rel")},linkClass:{shortcode:(e,{shortcode:t})=>rre(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","")}}}]};var are=ire;const sre={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/image",title:"Image",category:"media",usesContext:["allowResize","imageCrop","fixedHeight"],description:"Insert an image to make a visual statement.",keywords:["img","photo","picture"],textdomain:"default",attributes:{align:{type:"string"},url:{type:"string",source:"attribute",selector:"img",attribute:"src",__experimentalRole:"content"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:"",__experimentalRole:"content"},caption:{type:"string",source:"html",selector:"figcaption",__experimentalRole:"content"},lightbox:{type:"object",enabled:{type:"boolean"}},title:{type:"string",source:"attribute",selector:"img",attribute:"title",__experimentalRole:"content"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href",__experimentalRole:"content"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number",__experimentalRole:"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}}},selectors:{border:".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:!0},{name:"rounded",label:"Rounded"}],editorStyle:"wp-block-image-editor",style:"wp-block-image",viewScript:"file:./view.min.js"},{name:lre}=sre,cre={icon:Ene.Z,example:{attributes:{sizeSlug:"large",url:"https://s.w.org/images/core/5.3/MtBlanc1.jpg",caption:(0,$.__)("Mont Blanc appears—still, snowy, and serene.")}},__experimentalLabel(e,{context:t}){if("accessibility"===t){const{caption:t,alt:n,url:r}=e;return r?n?n+(t?". "+t:""):t||"":(0,$.__)("Empty")}},getEditWrapperProps(e){return{"data-align":e.align}},transforms:are,edit:function({attributes:e,setAttributes:t,isSelected:n,className:r,insertBlocksAfter:o,onReplace:i,context:a,clientId:s}){const{url:l="",alt:c,caption:u,align:d,id:p,width:h,height:m,sizeSlug:f,aspectRatio:g,scale:b}=e,[v,y]=(0,x.useState)(),_=(0,x.useRef)();(0,x.useEffect)((()=>{_.current=c}),[c]);const k=(0,x.useRef)();(0,x.useEffect)((()=>{k.current=u}),[u]);const w=(0,x.useRef)(),{imageDefaultSize:E,mediaUpload:C}=(0,yl.Z)((e=>{const{getSettings:t}=e(e_),n=t();return{imageDefaultSize:n.imageDefaultSize,mediaUpload:n.mediaUpload}}),[]),S=GS(),{createErrorNotice:I}=(0,_l.Z)(PM.store);function T(e){I(e,{type:"snackbar"}),t({src:void 0,id:void 0,url:void 0}),y(void 0)}function N(n){if(!n||!n.url)return void t({url:void 0,alt:void 0,id:void 0,title:void 0,caption:void 0});if(Al(n.url))return void y(n.url);y();let r="full";f&&nre(n,f)?r=f:nre(n,E)&&(r=E);let o,i=((e,t)=>{const n=Object.fromEntries(Object.entries(null!=e?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(k.current&&!i.caption){const{caption:e,...t}=i;i=t}o=n.id&&n.id===p?{url:l}:{sizeSlug:r};let a,s=e.linkDestination;if(!s)switch(window?.wp?.media?.view?.settings?.defaultProps?.link||$ne){case"file":case Wne:s=Wne;break;case"post":case Gne:s=Gne;break;case qne:s=qne;break;case $ne:s=$ne}switch(s){case Wne:a=n.url;break;case Gne:a=n.link}i.href=a,t({...i,...o,linkDestination:s})}function P(e){e!==l&&t({url:e,id:void 0,sizeSlug:E})}let A=((e,t)=>!e&&Al(t))(p,l);(0,x.useEffect)((()=>{if(!A)return;const e=function(e){return Nl[e]}(l);e&&C({filesList:[e],onFileChange:([e])=>{N(e)},allowedTypes:Kne,onError:e=>{A=!1,T(e)}})}),[]),(0,x.useEffect)((()=>{A?y(l):Rl(v)}),[A,l]);const B=tre(p,l)?l:void 0,L=!!l&&(0,x.createElement)("img",{alt:(0,$.__)("Edit image"),title:(0,$.__)("Edit image"),className:"edit-image-preview",src:l}),M=CK(e),D=sB({ref:w,className:R()(r,{"is-transient":v,"is-resized":!!h||!!m,[`size-${f}`]:f,"has-custom-border":!!M.className||M.style&&Object.keys(M.style).length>0})});return(0,x.createElement)("figure",{...D},(0,x.createElement)(ere,{temporaryURL:v,attributes:e,setAttributes:t,isSelected:n,insertBlocksAfter:o,onReplace:i,onSelectImage:N,onSelectURL:P,onUploadError:T,containerRef:w,context:a,clientId:s,blockEditingMode:S}),!l&&"default"===S&&(0,x.createElement)(Hk,{group:"block"},(0,x.createElement)($S,{value:d,onChange:function(e){const n=["wide","full"].includes(e)?{width:void 0,height:void 0}:{};t({...n,align:e})}})),(0,x.createElement)(MY,{icon:(0,x.createElement)(EB,{icon:Ene.Z}),onSelect:N,onSelectURL:P,onError:T,placeholder:e=>(0,x.createElement)(WK,{className:R()("block-editor-media-placeholder",{[M.className]:!!M.className&&!n}),withIllustration:!0,icon:Ene.Z,label:(0,$.__)("Image"),instructions:(0,$.__)("Upload an image file, pick one from your media library, or add one with a URL."),style:{aspectRatio:h&&m||!g?void 0:g,width:m&&g?"100%":h,height:h&&g?"100%":m,objectFit:b,...M.style}},e),accept:"image/*",allowedTypes:Kne,value:{id:p,src:B},mediaPreview:L,disableMediaButtons:v||l}))},save:function({attributes:e}){const{url:t,alt:n,caption:r,align:o,href:i,rel:a,linkClass:s,width:l,height:c,aspectRatio:u,scale:d,id:p,linkTarget:h,sizeSlug:m,title:f}=e,g=a||void 0,b=EK(e),v=R()({[`align${o}`]:o,[`size-${m}`]:m,"is-resized":l||c,"has-custom-border":!!b.className||b.style&&Object.keys(b.style).length>0}),y=R()(b.className,{[`wp-image-${p}`]:!!p}),_=(0,x.createElement)("img",{src:t,alt:n,className:y||void 0,style:{...b.style,aspectRatio:u,objectFit:d,width:l,height:c},title:f}),k=(0,x.createElement)(x.Fragment,null,i?(0,x.createElement)("a",{className:s,href:i,target:h,rel:g},_):_,!VX.isEmpty(r)&&(0,x.createElement)(VX.Content,{className:F0("caption"),tagName:"figcaption",value:r}));return(0,x.createElement)("figure",{...sB.save({className:v})},k)},deprecated:Rne},ure="core/image",dre={name:ure,examples:null,deprecated:null,save:()=>null},pre={...sre,...cre,...dre,category:"design",supports:{...sre.supports,html:!1,anchor:!1}},hre=e=>{const t=xee(e);if(!t[e.type])return null;const n=X5(t[e.type].name,e);return nc(n,t[e.type].settings),n},mre=e=>{let t=null;return Array.isArray(e.errors)&&e.errors.length>0&&(t=e.errors.map((e=>e.message)),t=t.join(", ")),t},fre=(e,t)=>e.map((e=>{const n=t(e);return e.innerBlocks?{...n,innerBlocks:fre(e.innerBlocks,t)}:n})),gre={async SAVE_FORM(){if((0,Kl.Y)(H2).getIsFormSaving())return;if((0,Yl.W)(H2).saveFormStarted(),(0,Kl.Y)(H2).getFormErrors().length)return;const e=(0,Kl.Y)(H2).getFormData(),t=(0,Kl.Y)(H2).getFormBlocks(),n=(0,Kl.Y)(H2).getAllAvailableCustomFields(),r=Y2(U2,am.colors,am.gradients,n),o={...X2(e),body:r(t),editor_version:2};await O2.MailPoet.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"forms",action:"saveEditor",data:o}).done((e=>{(0,Yl.W)(H2).saveFormDone(e.data.id),G5.remove(`popup_form_dismissed_${e.data.id}`,{path:"/"})})).fail((e=>{(0,Yl.W)(H2).saveFormFailed(mre(e))}))},async SAVE_CUSTOM_FIELD(e){(0,Yl.W)(H2).saveCustomFieldStarted();const t=(0,Kl.Y)(H2).getAllAvailableCustomFields().find((t=>t.id===e.customFieldId)),n={};(0,$2.merge)(n,t,e.data),await O2.MailPoet.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"customFields",action:"save",data:n}).then((n=>{(0,Yl.W)(H2).saveCustomFieldDone(t.id,n.data),"function"==typeof e.onFinish&&e.onFinish()})).then((()=>{(0,Yl.W)(H2).saveForm()})).fail((e=>{(0,Yl.W)(H2).saveCustomFieldFailed(mre(e))}))},async CREATE_CUSTOM_FIELD(e){const{clientId:t,data:n}=e;(0,Kl.Y)(H2).getIsCustomFieldCreating()||((0,Yl.W)(H2).createCustomFieldStarted(e.data),(0,Kl.Y)(H2).getIsCustomFieldCreating()&&await O2.MailPoet.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"customFields",action:"save",data:n}).then((e=>{const n=e.data;O2.MailPoet.trackEvent("Forms > Add new custom field",{"Field type":n.type});const r=fc(hre(n));(0,Yl.W)(e_).replaceBlock(t,r),(0,Yl.W)(H2).createCustomFieldDone(e.data)})).fail((e=>{(0,Yl.W)(H2).createCustomFieldFailed(mre(e))})))},async DELETE_CUSTOM_FIELD(e){const{customFieldId:t,clientId:n}=e;(0,Yl.W)(H2).deleteCustomFieldStarted();const r=(0,Kl.Y)(H2).getAllAvailableCustomFields().find((e=>e.id===t)),o=xee(r);await O2.MailPoet.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"customFields",action:"delete",data:{id:t}}).then((()=>{O2.MailPoet.trackEvent("Forms > Delete custom field",{"Field type":r.type}),(0,Yl.W)(H2).deleteCustomFieldDone(t,n);const e=X5(o[r.type].name,r);sc(e)&&function(e){const t=(0,Kl.Y)(Vu).getBlockType(e);if(t)return(0,Yl.W)(Vu).removeBlockTypes(e),t;console.error('Block "'+e+'" is not registered.')}(e),(0,Yl.W)(e_).removeBlock(n)})).fail((e=>{(0,Yl.W)(H2).deleteCustomFieldFailed(mre(e))}))},APPLY_STYLES_TO_ALL_TEXT_INPUTS(e){const t=(0,Kl.Y)(H2).getFormBlocks(),n=fre(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,Yl.W)(e_).resetBlocks(n)},async TUTORIAL_DISMISS(){await O2.MailPoet.Ajax.post({api_version:O2.MailPoet.apiVersion,endpoint:"user_flags",action:"set",data:{form_editor_tutorial_seen:1}})},BLOCKS_CHANGED_IN_BLOCK_EDITOR(e){const t=e.blocks,n=D5(t,"mailpoet-form/email-input"),r=D5(t,"mailpoet-form/submit-button");if(n&&r)return void(0,Yl.W)(H2).changeFormBlocks(t);const o=(0,Kl.Y)(H2).getFormBlocks(),i=[...t];if(!n){let e=D5(o,"mailpoet-form/email-input");e||(e=fc("mailpoet-form/email-input")),i.unshift(e)}if(!r){let e=D5(o,"mailpoet-form/submit-button");e||(e=fc("mailpoet-form/submit-button")),i.push(e)}(0,Yl.W)(e_).resetBlocks(i)},STORE_LOCALLY(e){const{key:t,value:n}=e;window.localStorage.setItem(t,JSON.stringify(n))},CALL_API:q5.t,ENSURE_BROWSER_URL(e){const{formId:t}=e;let n=(0,Kl.Y)(H2).getFormEditorUrl();n=`${n}${t}`,window.location.href!==n&&window.history.replaceState(null,"",n)}},bre={width:{unit:"percent",value:100}},vre={formDelay:15,formCookieExpiration:7},yre={styles:{width:{unit:"pixel",value:560}},...vre,animation:"slideup"},_re={styles:{width:{unit:"percent",value:100}},position:"top",...vre,animation:"slideup"},kre={width:{unit:"percent",value:100}},wre={styles:{width:{unit:"pixel",value:560}},position:"right",...vre,animation:"slideup"},Ere={formPadding:20,inputPadding:5,borderSize:0,borderRadius:0,alignment:"left",closeButton:"round_white"};function Cre(e){const t={...e,settings:{...e.settings,formPlacement:{popup:{enabled:"1"===e.settings.form_placement?.popup?.enabled,exitIntentEnabled:"1"===e.settings.form_placement?.popup?.exit_intent_enabled,delay:void 0!==e.settings.form_placement?.popup?.delay?pee(e.settings.form_placement?.popup?.delay):yre.formDelay,cookieExpiration:void 0!==e.settings.form_placement?.popup?.cookieExpiration?pee(e.settings.form_placement?.popup?.cookieExpiration):yre.formCookieExpiration,animation:void 0!==e.settings.form_placement?.popup?.animation?e.settings.form_placement?.popup?.animation:yre.animation,styles:{...yre.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?pee(e.settings.form_placement?.fixed_bar?.delay):_re.formDelay,cookieExpiration:void 0!==e.settings.form_placement?.fixed_bar?.cookieExpiration?pee(e.settings.form_placement?.fixed_bar?.cookieExpiration):_re.formCookieExpiration,animation:e.settings.form_placement?.fixed_bar?.animation??_re.animation,styles:{..._re.styles,...e.settings.form_placement?.fixed_bar?.styles},position:e.settings.form_placement?.fixed_bar?.position??_re.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:{...bre,...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?pee(e.settings.form_placement?.slide_in?.delay):wre.formDelay,cookieExpiration:void 0!==e.settings.form_placement?.slide_in?.cookieExpiration?pee(e.settings.form_placement?.slide_in?.cookieExpiration):wre.formCookieExpiration,position:e.settings.form_placement?.slide_in?.position??wre.position,animation:e.settings.form_placement?.slide_in?.animation??wre.animation,styles:{...wre.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:{...kre,...e.settings.form_placement?.others?.styles}}},alignment:e.settings.alignment??Ere.alignment,borderRadius:void 0!==e.settings.border_radius?pee(e.settings.border_radius):Ere.borderRadius,borderSize:void 0!==e.settings.border_size?pee(e.settings.border_size):Ere.borderSize,formPadding:void 0!==e.settings.form_padding?pee(e.settings.form_padding):Ere.formPadding,inputPadding:void 0!==e.settings.input_padding?pee(e.settings.input_padding):Ere.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??Ere.closeButton}};return t.settings.formPlacement.belowPosts.styles.width.value=pee(t.settings.formPlacement.belowPosts.styles.width.value),t.settings.formPlacement.slideIn.styles.width.value=pee(t.settings.formPlacement.slideIn.styles.width.value),t.settings.formPlacement.fixedBar.styles.width.value=pee(t.settings.formPlacement.fixedBar.styles.width.value),t.settings.formPlacement.popup.styles.width.value=pee(t.settings.formPlacement.popup.styles.width.value),t.settings.formPlacement.others.styles.width.value=pee(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 xre(e){const t=(0,yl.Z)((e=>e(H2).hasEditorUndo()),[]),{historyUndo:n}=(0,_l.Z)(H2),{registerShortcut:r}=(0,_l.Z)("core/keyboard-shortcuts");return(0,RB.bx)("mailpoet-form-editor/undo",(e=>{n(),e.preventDefault()})),(0,x.useEffect)((()=>{r({name:"mailpoet-form-editor/undo",category:"block",description:(0,$.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}})}),[r]),(0,Cw.jsx)(Gh.ZP,{...e,icon:V2.Z,label:(0,$.__)("Undo"),shortcut:Hf.E_.primary("z"),"aria-disabled":!t,onClick:t?()=>{n()}:void 0,className:"editor-history__undo"})}var Sre=n(59067);function Ire(e){const t=(0,yl.Z)((e=>e(H2).hasEditorRedo()),[]),{historyRedo:n}=(0,_l.Z)(H2),{registerShortcut:r}=(0,_l.Z)("core/keyboard-shortcuts"),o=()=>{n()};return(0,RB.bx)("mailpoet-form-editor/redo",(e=>{o(),e.preventDefault()})),(0,x.useEffect)((()=>{r({name:"mailpoet-form-editor/redo",category:"block",description:(0,$.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"}})}),[r]),(0,Cw.jsx)(Gh.ZP,{...e,icon:Sre.Z,label:(0,$.__)("Redo"),shortcut:Hf.E_.primaryShift("z"),"aria-disabled":!t,onClick:t?o:void 0,className:"editor-history__redo"})}function Tre({isInserterOpened:e,setIsInserterOpened:t}){const n=(0,yl.Z)((e=>e(H2).getSidebarOpened()),[]),r=(0,yl.Z)((e=>e(H2).getIsFormSaving()),[]),o=(0,yl.Z)((e=>e(H2).getIsPreviewShown()),[]),i=(0,yl.Z)((e=>e(H2).isFullscreenEnabled()),[]),{toggleSidebar:a,saveForm:s,showPreview:l,toggleFullscreen:c}=(0,_l.Z)(H2);return(0,Cw.jsxs)("div",{className:"edit-post-header",children:[(0,Cw.jsxs)("div",{className:"edit-post-header__settings",children:[(0,Cw.jsx)(Gh.ZP,{variant:"secondary",onClick:l,isPressed:o,className:"mailpoet-preview-button","data-automation-id":"form_preview_button",children:(0,$.__)("Preview")}),(0,Cw.jsx)(Gh.ZP,{variant:"primary",className:"editor-post-publish-button","data-automation-id":"form_save_button",isBusy:r,onClick:s,children:r?`${(0,$.__)("Saving")}`:(0,$.__)("Save")}),(0,Cw.jsx)(Gh.ZP,{icon:"admin-generic",label:O2.MailPoet.I18n.t("formSettings"),tooltipPosition:"down",onClick:()=>a(!n),isPressed:n,className:"mailpoet-editor-header-button"}),(0,Cw.jsx)(em.Z,{icon:_T.Z,label:(0,$.__)("More tools & options"),className:"edit-post-more-menu",popoverProps:{className:"edit-post-more-menu__content"},children:()=>(0,Cw.jsx)($k.Z,{label:(0,$._x)("View","noun"),className:"mailpoet-dropdown-menu-group",children:(0,Cw.jsx)(z2,{shortcut:"Ctrl+Shift+Alt+F",label:(0,$.__)("Fullscreen mode"),info:(0,$.__)("Work without distraction"),isActive:i,onToggle:()=>c(!i)})})})]}),(0,Cw.jsx)("div",{className:"edit-post-header__toolbar",children:(0,Cw.jsxs)("div",{className:"toolbar edit-post-header-toolbar edit-post-header-toolbar__left",children:[(0,Cw.jsx)(Gh.ZP,{variant:"secondary",href:"?page=mailpoet-forms#/",className:"mailpoet-editor-header-button",children:O2.MailPoet.I18n.t("back")}),(0,Cw.jsx)(qh.Z,{as:Gh.ZP,"data-automation-id":"form_inserter_open",className:"edit-post-header-toolbar__inserter-toggle",isPrimary:!0,isPressed:e,onClick:()=>t(!e),icon:hB.Z,label:(0,$._x)("Add block","Generic label for block inserter button")}),(0,Cw.jsx)(xre,{"data-automation-id":"form_undo_button"}),(0,Cw.jsx)(Ire,{"data-automation-id":"form_redo_button"})]})})]})}Tre.propTypes={isInserterOpened:Z2().bool.isRequired,setIsInserterOpened:Z2().func.isRequired},Tre.displayName="FormEditorHeader";var Nre=n(30425),Pre=n(86104);function Rre(){const e=(0,yl.Z)((e=>e(H2).getTutorialUrl()),[]),t=(0,yl.Z)((e=>e(H2).getTutorialSeen()),[]),{tutorialDismissed:n}=(0,_l.Z)(H2),r=(0,x.useCallback)((()=>{n()}),[n]);return t?null:(0,Cw.jsx)(Nre.u,{isDismissible:!0,onRequestClose:r,children:(0,Cw.jsxs)("div",{className:"mailpoet_drag_and_drop_tutorial","data-automation-id":"form-editor-tutorial",children:[(0,Cw.jsx)(Pre.X,{level:2,children:O2.MailPoet.I18n.t("tutorialHeading")}),(0,Cw.jsx)("video",{style:{height:"640px"},src:e,controls:!0,autoPlay:!0})]})})}var Are=n(11237),Bre=n(65311),Lre=n.n(Bre),Mre=n(43869);n(1201);class Dre extends x.Component{constructor(e){super(e),this.selectRef=(0,x.createRef)()}componentDidMount(){this.isSelect2Component()&&this.setupSelect2()}componentDidUpdate(e){void 0!==this.props.item&&void 0!==e.item&&this.props.item.id!==e.item.id&&Lre()(`#${this.selectRef.current.id}`).val(this.getSelectedValues()).trigger("change"),void 0!==this.props.item&&void 0!==e.item&&this.allowMultipleValues()&&Mre.default.isArray(this.props.item[this.props.field.name])&&!Mre.default.isEqual(this.props.item[this.props.field.name],e.item[this.props.field.name])&&Lre()(`#${this.selectRef.current.id}`).val(this.getSelectedValues()).trigger("change"),this.isSelect2Initialized()&&this.getFieldId(this.props)!==this.getFieldId(e)&&void 0!==this.props.field.resetSelect2OnUpdate&&this.resetSelect2()}componentWillUnmount(){this.isSelect2Component()&&this.destroySelect2()}getFieldId=e=>{const t=e||this.props;return t.field.id||t.field.name};getSelectedValues=()=>{if(void 0!==this.props.field.selected)return this.props.field.selected(this.props.item);if(void 0!==this.props.item&&void 0!==this.props.field.name){if(!this.allowMultipleValues())return this.props.item[this.props.field.name];if(Mre.default.isArray(this.props.item[this.props.field.name]))return this.props.item[this.props.field.name].map((e=>e.id))}return null};getItems=()=>{let e;return void 0!==window[`mailpoet_${this.props.field.endpoint}`]?e=window[`mailpoet_${this.props.field.endpoint}`]:void 0!==this.props.field.values&&(e=this.props.field.values),Mre.default.isArray(e)&&void 0!==this.props.field.filter&&(e=e.filter(this.props.field.filter)),e};getLabel=e=>void 0!==this.props.field.getLabel?this.props.field.getLabel(e,this.props.item):e.name;getSearchLabel=e=>void 0!==this.props.field.getSearchLabel?this.props.field.getSearchLabel(e,this.props.item):null;getValue=e=>void 0!==this.props.field.getValue?this.props.field.getValue(e,this.props.item):e.id;setupSelect2=()=>{if(this.isSelect2Initialized())return;let e={disabled:this.props.disabled||!1,width:this.props.width||"",placeholder:{id:"",text:this.props.field.placeholder},templateResult:function(e){return e.element&&e.element.selected?null:e.title?e.title:e.text}};this.props.dropDownParent&&(e.dropdownParent=Lre()(this.props.dropDownParent));const t=this.props.field.remoteQuery||null;t&&(e=Object.assign(e,{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:t.endpoint,method:t.method,data:Object.assign(t.data,{query:e.term})}},processResults:function(e){let t;return t=Mre.default.has(e,"data")?e.data.map((e=>({id:e.id||e.value,text:e.name||e.text}))):[],{results:t}}},minimumInputLength:t.minimumInputLength||2})),void 0!==this.props.field.extendSelect2Options&&(e=Object.assign(e,this.props.field.extendSelect2Options));const n=Lre()(`#${this.selectRef.current.id}`).select2(e);let r=!1;n.on("select2:unselecting",(()=>{r=!0})),n.on("select2:opening",(e=>{!0===r&&(r=!1,e.preventDefault())})),n.on("change",this.handleChange)};resetSelect2=()=>{this.destroySelect2(),this.setupSelect2()};destroySelect2=()=>{this.isSelect2Initialized()&&(Lre()(`#${this.selectRef.current.id}`).select2("destroy"),this.cleanupAfterSelect2())};cleanupAfterSelect2=()=>{Lre()(`#${this.selectRef.current.id}`).find("option:not(.default)").remove(),Lre()(`#${this.selectRef.current.id}`).off("select2:unselecting").off("select2:opening")};allowMultipleValues=()=>!0===this.props.field.multiple;isSelect2Initialized=()=>!0===Lre()(`#${this.selectRef.current.id}`).hasClass("select2-hidden-accessible");isSelect2Component=()=>this.allowMultipleValues()||this.props.field.forceSelect2;handleChange=e=>{if(void 0===this.props.onValueChange)return;const t=Lre()(`#${this.selectRef.current.id}`).children(":selected").map((function(){return{id:Lre()(this).val(),text:Lre()(this).text()}})),n=this.props.field.multiple?Mre.default.pluck(t,"id"):Mre.default.pluck(t,"id").toString(),r=this.transformChangedValue(n,t);this.props.onValueChange({target:{value:r,name:this.props.field.name,id:e.target.id}})};transformChangedValue=(e,t)=>"function"==typeof this.props.field.transformChangedValue?this.props.field.transformChangedValue.call(this,e,t):e;insertEmptyOption=()=>{if(!this.allowMultipleValues())return this.props.field.placeholder?(0,Cw.jsx)("option",{className:"default"}):void 0};render(){const e=this.getItems(this.props.field),t=this.getSelectedValues(),n=e.map((e=>{const t=this.getLabel(e),n=this.getSearchLabel(e),r=this.getValue(e);return(0,Cw.jsx)("option",{className:"default",value:r,title:n,children:t},`option-${e.id}`)}));return(0,Cw.jsxs)("select",{id:this.getFieldId(),ref:this.selectRef,disabled:this.props.field.disabled,"data-placeholder":this.props.field.placeholder,multiple:this.props.field.multiple,defaultValue:t,...this.props.field.validation,children:[this.insertEmptyOption(),n]})}}Dre.propTypes={onValueChange:Z2().func,field:Z2().shape({name:Z2().string.isRequired,values:Z2().oneOfType([Z2().object,Z2().array]),getLabel:Z2().func,resetSelect2OnUpdate:Z2().bool,selected:Z2().func,endpoint:Z2().string,filter:Z2().func,getSearchLabel:Z2().func,getValue:Z2().func,placeholder:Z2().string,remoteQuery:Z2().object,extendSelect2Options:Z2().object,multiple:Z2().bool,forceSelect2:Z2().bool,transformChangedValue:Z2().func,disabled:Z2().bool,validation:Z2().shape({"data-parsley-required":Z2().bool,"data-parsley-required-message":Z2().string,"data-parsley-type":Z2().string,"data-parsley-errors-container":Z2().string,maxLength:Z2().number})}).isRequired,item:Z2().object,disabled:Z2().bool,width:Z2().string,dropDownParent:Z2().string},Dre.defaultProps={onValueChange:function(){},disabled:!1,width:"",item:void 0,dropDownParent:void 0},Dre.displayName="FormEditorSelection";const Ore=(0,D2.withBoundary)(Dre);function Fre(){const[e,t]=(0,x.useState)(!1),n=(0,yl.Z)((e=>e(H2).getFormName()),[]),r=R()({"is-selected":e}),{changeFormName:o}=(0,_l.Z)(H2);return(0,Cw.jsxs)("div",{className:r,children:[(0,Cw.jsx)("label",{htmlFor:"post-title",className:"screen-reader-text",children:O2.MailPoet.I18n.t("addFormName")}),(0,Cw.jsx)("input",{id:"form-title",className:"form-editor-title",placeholder:O2.MailPoet.I18n.t("addFormName"),"data-automation-id":"form_title_input",type:"text",onKeyPress:()=>t(!1),onBlur:()=>t(!1),onChange:e=>o(e.target.value),value:n})]})}function jre({onToggle:e,isOpened:t}){const{settings:n,segments:r,pages:o,missingListError:i,isFormEnabled:a}=(0,yl.Z)((e=>({settings:e(H2).getFormSettings(),segments:e(H2).getAllAvailableSegments(),pages:e(H2).getAllWPPages(),missingListError:e(H2).getNotice("missing-lists"),isFormEnabled:e(H2).isFormEnabled()})),[]),{changeFormSettings:s,toggleForm:l}=(0,_l.Z)(H2),c=n.segments?r.filter((e=>n.segments.includes(e.id.toString()))):[],u=i&&!c.length;return(0,Cw.jsx)(t3.Z,{children:(0,Cw.jsxs)(tI.ZP,{title:O2.MailPoet.I18n.t("formSettings"),opened:t,onToggle:e,children:[(0,Cw.jsx)(Fre,{}),(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("displayForm"),checked:a,onChange:l}),(0,Cw.jsxs)(uw.ZP,{label:O2.MailPoet.I18n.t("settingsListLabel"),className:R()({"mailpoet-form-missing-lists":u}),children:[u?(0,Cw.jsx)("span",{className:"mailpoet-form-lists-error",children:O2.MailPoet.I18n.t("settingsPleaseSelectList")}):null,(0,Cw.jsx)(Ore,{item:{segments:c},onValueChange:e=>{(0,$2.isEqual)(n.segments,e.target.value)||s({...n,segments:e.target.value})},field:{id:"segments",name:"segments",values:r,multiple:!0,placeholder:O2.MailPoet.I18n.t("settingsPleaseSelectList"),getLabel:e=>`${e.name} (${parseInt(e.subscribers,10).toLocaleString()})`,filter:e=>!(e.deleted_at||"default"!==e.type)}})]}),(0,Cw.jsx)(Are.Z,{className:"mailpoet-form-inline-radios__control",onChange:e=>{s({...n,on_success:e})},selected:n.on_success||"message",label:O2.MailPoet.I18n.t("settingsAfterSubmit"),options:[{label:O2.MailPoet.I18n.t("settingsShowMessage"),value:"message"},{label:O2.MailPoet.I18n.t("settingsGoToPage"),value:"page"}]}),"page"===n.on_success?(0,Cw.jsx)(HZ.Z,{value:n.success_page,options:o.map((e=>({value:e.id.toString(),label:e.name}))),onChange:e=>{s({...n,success_page:e})}}):(0,Cw.jsx)(p1.Z,{value:n.success_message,onChange:e=>{s({...n,success_message:e})},rows:3})]})})}function Zre({name:e,imageUrl:t,onImageUrlChange:n,imageDisplay:r,onImageDisplayChange:o}){return(0,Cw.jsxs)("div",{className:"mailpoet-styles-settings-image-url",children:[(0,Cw.jsx)(uw.ZP.VisualLabel,{children:e}),(0,Cw.jsxs)("div",{className:"mailpoet-styles-settings-image-url-body",children:[(0,Cw.jsx)("input",{type:"text",value:t??"",onChange:e=>n(e.target.value)}),(0,Cw.jsx)(aO,{onSelect:e=>n(e.url),allowedTypes:["image"],render:({open:e})=>(0,Cw.jsx)(Gh.ZP,{variant:"secondary",size:"small",onClick:e,children:O2.MailPoet.I18n.t("formSettingsStylesSelectImage")})})]}),(0,Cw.jsx)("div",{className:"mailpoet-styles-settings-image-url-display",children:(0,Cw.jsx)(HZ.Z,{value:r,options:[{label:O2.MailPoet.I18n.t("imagePlacementScale"),value:"scale"},{label:O2.MailPoet.I18n.t("imagePlacementFit"),value:"fit"},{label:O2.MailPoet.I18n.t("imagePlacementTile"),value:"tile"}],onChange:o})})]})}jre.propTypes={onToggle:Z2().func.isRequired,isOpened:Z2().bool.isRequired},jre.displayName="FormEditorBasicSettingsPanel";const zre=(0,Cw.jsx)(F_.Wj,{width:"14px",height:"14px",viewBox:"0 0 14 14",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:(0,Cw.jsx)(F_.G,{id:"Symbols",stroke:"none",strokeWidth:"1",children:(0,Cw.jsx)(F_.G,{id:"icons/ic_settings",children:(0,Cw.jsx)(F_.y$,{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"})})})}),Vre=(0,Cw.jsx)(F_.Wj,{width:"13",height:"13",viewBox:"4 4 16 16",xmlns:"http://www.w3.org/2000/svg",children:(0,Cw.jsx)(F_.G,{id:"icons/checkbox-on-small",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:(0,Cw.jsx)(F_.y$,{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 Hre({label:e,active:t,canBeActive:n,onClick:r,children:o,className:i,automationId:a,displaySettingsIcon:s}){const[l,c]=(0,x.useState)(!1);return(0,Cw.jsxs)("div",{"data-automation-id":a,className:R()(i,"selection-item",{"selection-item-active":t&&n}),onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),onClick:r,onKeyDown:e=>{["keydown","keypress"].includes(e.type)&&["Enter"," "].includes(e.key)&&(e.preventDefault(),r())},role:"button",tabIndex:0,children:[(0,Cw.jsxs)("div",{className:"selection-item-body",children:[(0,Cw.jsxs)("div",{className:"selection-item-settings",children:[s?(0,Cw.jsx)("div",{className:R()("selection-item-icon",{"selection-item-icon-hover":l}),children:zre}):(0,Cw.jsx)("div",{}),l&&!t&&n&&(0,Cw.jsx)("div",{className:"selection-item-settings-oval"}),t&&n&&(0,Cw.jsx)("div",{className:"selection-item-check",children:Vre})]}),o]}),l&&(0,Cw.jsx)("div",{className:"selection-item-overlay"})]},e)}function Ure({label:e,active:t,onClick:n,iconUrl:r}){return(0,Cw.jsx)(Hre,{label:e,onClick:n,active:t,canBeActive:!0,displaySettingsIcon:!1,className:"close-button-selection-item",children:(0,Cw.jsx)("img",{src:r,alt:e.replace("_"," "),className:"close-button-selection-item-icon"})})}function $re({name:e,value:t,onChange:n}){const r=(0,yl.Z)((e=>e(H2).getCloseIconsUrl()),[]);return(0,Cw.jsxs)("div",{children:[(0,Cw.jsx)(uw.ZP.VisualLabel,{children:e}),(0,Cw.jsxs)("div",{className:"close-button-selection-item-list",children:[(0,Cw.jsx)(Ure,{label:"round_white",active:"round_white"===t,iconUrl:r.replace("img/form_close_icon","img/form_close_icon/round_white.svg"),onClick:()=>n("round_white")}),(0,Cw.jsx)(Ure,{label:"round_black",active:"round_black"===t,iconUrl:r.replace("img/form_close_icon","img/form_close_icon/round_black.svg"),onClick:()=>n("round_black")}),(0,Cw.jsx)(Ure,{label:"square_white",active:"square_white"===t,iconUrl:r.replace("img/form_close_icon","img/form_close_icon/square_white.svg"),onClick:()=>n("square_white")}),(0,Cw.jsx)(Ure,{label:"square_black",active:"square_black"===t,iconUrl:r.replace("img/form_close_icon","img/form_close_icon/square_black.svg"),onClick:()=>n("square_black")}),(0,Cw.jsx)(Ure,{label:"classic",active:"classic"===t,iconUrl:r.replace("img/form_close_icon","img/form_close_icon/classic.svg"),onClick:()=>n("classic")}),(0,Cw.jsx)(Ure,{label:"classic_white",active:"classic_white"===t,iconUrl:r.replace("img/form_close_icon","img/form_close_icon/classic_white.svg"),onClick:()=>n("classic_white")})]})]})}function Wre({onToggle:e,isOpened:t}){const{changeFormSettings:n}=(0,_l.Z)(H2),r=(0,yl.Z)((e=>e(H2).getFormSettings()),[]),o=(0,x.useRef)(r);(0,x.useEffect)((()=>{o.current=r}),[r]);const i=(e,t)=>{const r={...o.current};r[e]=t??Ere[e]??void 0,n(r),o.current=r};return(0,Cw.jsx)(t3.Z,{children:(0,Cw.jsx)(tI.ZP,{title:O2.MailPoet.I18n.t("formSettingsStyles"),opened:t,onToggle:e,children:(0,Cw.jsxs)("div",{className:"mailpoet-styles-settings",children:[(0,Cw.jsx)(T3,{title:O2.MailPoet.I18n.t("formSettingsColor"),settings:[{label:O2.MailPoet.I18n.t("formSettingsStylesBackground"),colorValue:r.backgroundColor,gradientValue:r.gradient,onColorChange:(0,$2.partial)(i,"backgroundColor"),onGradientChange:(0,$2.partial)(i,"gradient")},{label:O2.MailPoet.I18n.t("formSettingsStylesFont"),colorValue:r.fontColor,onColorChange:(0,$2.partial)(i,"fontColor")},{label:O2.MailPoet.I18n.t("formSettingsBorder"),colorValue:r.borderColor,onColorChange:(0,$2.partial)(i,"borderColor")}]}),(0,Cw.jsx)(Zre,{name:O2.MailPoet.I18n.t("formSettingsStylesBackgroundImage"),imageUrl:r.backgroundImageUrl,onImageUrlChange:(0,$2.partial)(i,"backgroundImageUrl"),imageDisplay:r.backgroundImageDisplay,onImageDisplayChange:(0,$2.partial)(i,"backgroundImageDisplay")}),(0,Cw.jsx)(Ree,{value:r.fontSize,onChange:(0,$2.partial)(i,"fontSize")}),(0,Cw.jsx)(Bee,{name:O2.MailPoet.I18n.t("formSettingsStylesFontFamily"),value:r.fontFamily,onChange:(0,$2.partial)(i,"fontFamily")}),(0,Cw.jsx)(CS,{label:O2.MailPoet.I18n.t("formSettingsInputPadding"),value:r.inputPadding,min:0,max:30,allowReset:!0,onChange:(0,$2.partial)(i,"inputPadding")}),(0,Cw.jsx)(CS,{label:O2.MailPoet.I18n.t("formSettingsBorderSize"),value:void 0!==r.borderSize?r.borderSize:0,min:0,max:10,allowReset:!0,onChange:(0,$2.partial)(i,"borderSize"),className:"mailpoet-automation-styles-border-size"}),(0,Cw.jsx)(CS,{label:O2.MailPoet.I18n.t("formSettingsBorderRadius"),value:void 0!==r.borderRadius?r.borderRadius:0,min:0,max:40,allowReset:!0,onChange:(0,$2.partial)(i,"borderRadius")}),(0,Cw.jsx)(HZ.Z,{label:O2.MailPoet.I18n.t("formSettingsAlignment"),onChange:(0,$2.partial)(i,"alignment"),options:[{value:R3.Left,label:O2.MailPoet.I18n.t("formSettingsAlignmentLeft")},{value:R3.Center,label:O2.MailPoet.I18n.t("formSettingsAlignmentCenter")},{value:R3.Right,label:O2.MailPoet.I18n.t("formSettingsAlignmentRight")}],value:r.alignment}),(0,Cw.jsx)(CS,{label:O2.MailPoet.I18n.t("formSettingsFormPadding"),value:r.formPadding,min:0,max:40,allowReset:!0,onChange:(0,$2.partial)(i,"formPadding")}),(0,Cw.jsx)(T3,{title:O2.MailPoet.I18n.t("validationMessageColor"),settings:[{label:O2.MailPoet.I18n.t("successValidationColorTitle"),colorValue:r.successValidationColor,onColorChange:(0,$2.partial)(i,"successValidationColor")},{label:O2.MailPoet.I18n.t("errorValidationColorTitle"),colorValue:r.errorValidationColor,onColorChange:(0,$2.partial)(i,"errorValidationColor")}]}),(0,Cw.jsx)($re,{name:O2.MailPoet.I18n.t("closeButtonHeading"),value:r.closeButton,onChange:(0,$2.partial)(i,"closeButton")})]})})})}Hre.defaultProps={canBeActive:!0,displaySettingsIcon:!0,className:void 0,automationId:void 0};const Gre=(0,Cw.jsxs)(F_.Wj,{width:"144",height:"120",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 144 120",children:[(0,Cw.jsxs)("defs",{children:[(0,Cw.jsx)(F_.UL,{id:"a",x:"8",y:"8",width:"128",height:"68",rx:"1"}),(0,Cw.jsx)(F_.UL,{id:"b",x:"8",y:"100",width:"128",height:"12",rx:"1"})]}),(0,Cw.jsxs)(F_.G,{fill:"none",fillRule:"evenodd",children:[(0,Cw.jsx)(F_.y$,{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,Cw.jsx)("use",{fill:"#FFF",xlinkHref:"#a"}),(0,Cw.jsx)("use",{fillOpacity:".4",fill:"#E5E9F8",xlinkHref:"#a"}),(0,Cw.jsx)("use",{fill:"#FFF",xlinkHref:"#b"}),(0,Cw.jsx)("use",{fillOpacity:".4",fill:"#E5E9F8",xlinkHref:"#b"}),(0,Cw.jsx)(F_.UL,{fill:"#FF5301",fillRule:"nonzero",x:"98",y:"84",width:"38",height:"8",rx:"1"}),(0,Cw.jsx)(F_.UL,{fill:"#FFE0D0",fillRule:"nonzero",x:"53",y:"84",width:"38",height:"8",rx:"1"}),(0,Cw.jsx)(F_.UL,{fill:"#FFE0D0",fillRule:"nonzero",x:"8",y:"84",width:"38",height:"8",rx:"1"})]})]});function qre({label:e,icon:t,active:n,canBeActive:r,onClick:o}){return(0,Cw.jsxs)(Hre,{label:e,onClick:o,active:n,canBeActive:r,className:"form-placement-option",automationId:`form-placement-option-${e}`,children:[(0,Cw.jsx)("div",{className:"form-placement-option-icon",children:t}),(0,Cw.jsx)("div",{className:"form-placement-option-label",children:(0,Cw.jsx)("p",{children:e})})]})}function Kre(){const e=(0,yl.Z)((e=>e(H2).getFormSettings()),[]),{showPlacementSettings:t}=(0,_l.Z)(H2);return(0,Cw.jsx)(qre,{active:e.formPlacement.belowPosts.enabled,label:O2.MailPoet.I18n.t("placeFormBellowPages"),icon:Gre,onClick:()=>{t("below_posts")},canBeActive:!0})}qre.defaultProps={canBeActive:!0};const Yre=(0,Cw.jsxs)(F_.Wj,{width:"144",height:"120",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 144 120",children:[(0,Cw.jsxs)("defs",{children:[(0,Cw.jsx)(F_.UL,{id:"popup_icon_a",x:"8",y:"8",width:"128",height:"104",rx:"1"}),(0,Cw.jsx)(F_.y$,{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,Cw.jsxs)("filter",{x:"-61.1%",y:"-56.2%",width:"222.2%",height:"237.5%",filterUnits:"objectBoundingBox",id:"popup_icon_b",children:[(0,Cw.jsx)("feOffset",{dy:"6",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,Cw.jsx)("feGaussianBlur",{stdDeviation:"10",in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),(0,Cw.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,Cw.jsxs)(F_.G,{fill:"none",fillRule:"evenodd",children:[(0,Cw.jsx)(F_.y$,{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,Cw.jsx)("use",{fill:"#FFF",xlinkHref:"#popup_icon_a"}),(0,Cw.jsx)("use",{fillOpacity:".4",fill:"#E5E9F8",xlinkHref:"#popup_icon_a"}),(0,Cw.jsxs)(F_.G,{fillRule:"nonzero",children:[(0,Cw.jsx)("use",{fill:"#000",filter:"url(#popup_icon_b)",xlinkHref:"#popup_icon_c"}),(0,Cw.jsx)("use",{fill:"#FFF",xlinkHref:"#popup_icon_c"})]}),(0,Cw.jsx)(F_.UL,{fill:"#FF5301",fillRule:"nonzero",x:"53",y:"66",width:"38",height:"8",rx:"1"}),(0,Cw.jsx)(F_.UL,{fill:"#FFE0D0",fillRule:"nonzero",x:"53",y:"54",width:"38",height:"8",rx:"1"}),(0,Cw.jsx)(F_.UL,{fill:"#FFE0D0",fillRule:"nonzero",x:"53",y:"42",width:"38",height:"8",rx:"1"})]})]});function Xre(){const e=(0,yl.Z)((e=>e(H2).getFormSettings()),[]),{showPlacementSettings:t}=(0,_l.Z)(H2);return(0,Cw.jsx)(qre,{active:e.formPlacement.popup.enabled,label:O2.MailPoet.I18n.t("placePopupFormOnPages"),icon:Yre,onClick:()=>{t("popup")},canBeActive:!0})}const Jre=(0,Cw.jsxs)(F_.Wj,{width:"144",height:"120",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 144 120",children:[(0,Cw.jsx)("defs",{children:(0,Cw.jsx)(F_.UL,{id:"fixed_bar_a",x:"8",y:"24",width:"128",height:"88",rx:"1"})}),(0,Cw.jsxs)(F_.G,{fill:"none",fillRule:"evenodd",children:[(0,Cw.jsx)(F_.y$,{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,Cw.jsx)("use",{fill:"#FFF",xlinkHref:"#a"}),(0,Cw.jsx)("use",{fillOpacity:".4",fill:"#E5E9F8",xlinkHref:"#fixed_bar_a"}),(0,Cw.jsx)(F_.UL,{fill:"#FF5301",fillRule:"nonzero",x:"98",y:"8",width:"38",height:"8",rx:"1"}),(0,Cw.jsx)(F_.UL,{fill:"#FFE0D0",fillRule:"nonzero",x:"53",y:"8",width:"38",height:"8",rx:"1"}),(0,Cw.jsx)(F_.UL,{fill:"#FFE0D0",fillRule:"nonzero",x:"8",y:"8",width:"38",height:"8",rx:"1"})]})]});function Qre(){const e=(0,yl.Z)((e=>e(H2).getFormSettings()),[]),{showPlacementSettings:t}=(0,_l.Z)(H2);return(0,Cw.jsx)(qre,{active:e.formPlacement.fixedBar.enabled,label:O2.MailPoet.I18n.t("placeFixedBarFormOnPages"),icon:Jre,onClick:()=>{t("fixed_bar")},canBeActive:!0})}const eoe=(0,Cw.jsxs)(F_.Wj,{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,Cw.jsxs)("defs",{children:[(0,Cw.jsxs)("filter",{id:"slide_in_prefix__a",width:"216.9%",height:"245.3%",x:"-55.8%",y:"-67.2%",filterUnits:"objectBoundingBox",children:[(0,Cw.jsx)("feOffset",{dy:"4",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,Cw.jsx)("feGaussianBlur",{in:"shadowOffsetOuter1",result:"shadowBlurOuter1",stdDeviation:"9"}),(0,Cw.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,Cw.jsxs)("feMerge",{children:[(0,Cw.jsx)("feMergeNode",{in:"shadowMatrixOuter1"}),(0,Cw.jsx)("feMergeNode",{in:"SourceGraphic"})]})]}),(0,Cw.jsxs)("filter",{id:"slide_in_prefix__c",width:"226.3%",height:"255.8%",x:"-73.7%",y:"-77.9%",filterUnits:"objectBoundingBox",children:[(0,Cw.jsx)("feOffset",{dx:"-3",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,Cw.jsx)("feGaussianBlur",{in:"shadowOffsetOuter1",result:"shadowBlurOuter1",stdDeviation:"5.5"}),(0,Cw.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,Cw.jsx)(F_.UL,{id:"slide_in_prefix__b",width:"67.556",height:"54.6",x:"4.222",y:"4.2",rx:".525"}),(0,Cw.jsx)(F_.y$,{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,Cw.jsxs)(F_.G,{fill:"none",fillRule:"evenodd",filter:"url(#slide_in_prefix__a)",children:[(0,Cw.jsx)(F_.y$,{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,Cw.jsx)("use",{fill:"#FFF",xlinkHref:"#slide_in_prefix__b"}),(0,Cw.jsx)("use",{fill:"#E5E9F8",fillOpacity:".4",xlinkHref:"#slide_in_prefix__b"}),(0,Cw.jsxs)(F_.G,{fillRule:"nonzero",transform:"translate(43.278 35.7)",children:[(0,Cw.jsx)("use",{fill:"#000",filter:"url(#slide_in_prefix__c)",xlinkHref:"#slide_in_prefix__d"}),(0,Cw.jsx)("use",{fill:"#FFF",xlinkHref:"#slide_in_prefix__d"}),(0,Cw.jsx)(F_.UL,{width:"15.833",height:"4.2",x:"6.333",y:"14.7",fill:"#FF5301",rx:".525"}),(0,Cw.jsx)(F_.UL,{width:"15.833",height:"4.2",x:"6.333",y:"9.45",fill:"#FFE0D0",rx:".525"}),(0,Cw.jsx)(F_.UL,{width:"15.833",height:"4.2",x:"6.333",y:"4.2",fill:"#FFE0D0",rx:".525"})]})]})]});function toe(){const e=(0,yl.Z)((e=>e(H2).getFormSettings()),[]),{showPlacementSettings:t}=(0,_l.Z)(H2);return(0,Cw.jsx)(qre,{active:e.formPlacement.slideIn.enabled,label:O2.MailPoet.I18n.t("placeSlideInFormOnPages"),icon:eoe,onClick:()=>{t("slide_in")},canBeActive:!0})}const noe=(0,Cw.jsxs)(F_.Wj,{xmlns:"http://www.w3.org/2000/svg",width:"144",height:"120",viewBox:"0 0 144 120",children:[(0,Cw.jsxs)("defs",{children:[(0,Cw.jsx)(F_.UL,{id:"sidebar_icon_prefix__b",width:"82",height:"104",x:"8",y:"8",rx:"1"}),(0,Cw.jsx)(F_.UL,{id:"sidebar_icon_prefix__c",width:"38",height:"30",x:"98",y:"8",rx:"1"}),(0,Cw.jsx)(F_.UL,{id:"sidebar_icon_prefix__d",width:"38",height:"30",x:"98",y:"82",rx:"1"}),(0,Cw.jsxs)("filter",{id:"sidebar_icon_prefix__a",width:"212.5%",height:"235%",x:"-56.2%",y:"-67.5%",filterUnits:"objectBoundingBox",children:[(0,Cw.jsx)("feOffset",{dy:"7",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,Cw.jsx)("feGaussianBlur",{in:"shadowOffsetOuter1",result:"shadowBlurOuter1",stdDeviation:"17.5"}),(0,Cw.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,Cw.jsxs)("feMerge",{children:[(0,Cw.jsx)("feMergeNode",{in:"shadowMatrixOuter1"}),(0,Cw.jsx)("feMergeNode",{in:"SourceGraphic"})]})]})]}),(0,Cw.jsxs)(F_.G,{fill:"none",fillRule:"evenodd",filter:"url(#sidebar_icon_prefix__a)",children:[(0,Cw.jsx)(F_.y$,{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,Cw.jsx)("use",{fill:"#FFF",xlinkHref:"#sidebar_icon_prefix__b"}),(0,Cw.jsx)("use",{fill:"#E5E9F8",fillOpacity:".4",xlinkHref:"#sidebar_icon_prefix__b"}),(0,Cw.jsx)("use",{fill:"#FFF",xlinkHref:"#sidebar_icon_prefix__c"}),(0,Cw.jsx)("use",{fill:"#E5E9F8",fillOpacity:".4",xlinkHref:"#sidebar_icon_prefix__c"}),(0,Cw.jsx)("use",{fill:"#FFF",xlinkHref:"#sidebar_icon_prefix__d"}),(0,Cw.jsx)("use",{fill:"#E5E9F8",fillOpacity:".4",xlinkHref:"#sidebar_icon_prefix__d"}),(0,Cw.jsx)(F_.UL,{width:"38",height:"8",x:"98",y:"66",fill:"#FF5301",fillRule:"nonzero",rx:"1"}),(0,Cw.jsx)(F_.UL,{width:"38",height:"8",x:"98",y:"56",fill:"#FFE0D0",fillRule:"nonzero",rx:"1"}),(0,Cw.jsx)(F_.UL,{width:"38",height:"8",x:"98",y:"46",fill:"#FFE0D0",fillRule:"nonzero",rx:"1"})]})]});function roe(){const{showPlacementSettings:e}=(0,_l.Z)(H2);return(0,Cw.jsx)(qre,{active:!1,label:O2.MailPoet.I18n.t("formPlacementOtherLabel"),icon:noe,onClick:()=>{e("others")},canBeActive:!1})}function ooe({onToggle:e,isOpened:t}){return(0,Cw.jsx)(t3.Z,{children:(0,Cw.jsx)(tI.ZP,{title:O2.MailPoet.I18n.t("formPlacement"),opened:t,onToggle:e,className:"form-sidebar-form-placement-panel",children:(0,Cw.jsxs)("div",{className:"form-placement-option-list",children:[(0,Cw.jsx)(Kre,{}),(0,Cw.jsx)(Qre,{}),(0,Cw.jsx)(Xre,{}),(0,Cw.jsx)(toe,{}),(0,Cw.jsx)(roe,{})]})})})}ooe.propTypes={onToggle:Z2().func.isRequired,isOpened:Z2().bool.isRequired};var ioe=n(70907),aoe=n.n(ioe);function soe({options:e,value:t,onChange:n}){const r=(0,x.useRef)(null),o=(0,x.useRef)(null),i=(0,x.useCallback)((e=>{n(e.getValue())}),[n]);return(0,x.useEffect)((()=>(o.current=aoe().fromTextArea(r.current,e),o.current.on("change",i),()=>{o.current&&o.current.toTextArea()})),[e,i]),(0,x.useEffect)((()=>{o.current.getValue()!==t&&(o.current.off("change",i),o.current.setValue(t),o.current.on("change",i))}),[t,i]),(0,Cw.jsx)("div",{children:(0,Cw.jsx)("textarea",{ref:r,name:"name",defaultValue:t,autoComplete:"off"})})}function loe({onToggle:e,isOpened:t}){const n=(0,yl.Z)((e=>e(H2).getFormStyles()),[]),{changeFormStyles:r}=(0,_l.Z)(H2);return(0,Cw.jsx)(t3.Z,{children:(0,Cw.jsx)(tI.ZP,{title:O2.MailPoet.I18n.t("customCss"),opened:t,onToggle:e,children:(0,Cw.jsx)(soe,{value:n,onChange:r})})})}n(25002),soe.propTypes={value:Z2().string.isRequired,onChange:Z2().func.isRequired,options:Z2().shape({lineNumbers:Z2().bool,tabMode:Z2().string,matchBrackets:Z2().bool,theme:Z2().string,mode:Z2().string})},soe.defaultProps={options:{lineNumbers:!0,tabMode:"indent",matchBrackets:!0,theme:"neo",mode:"css"}},loe.propTypes={onToggle:Z2().func.isRequired,isOpened:Z2().bool.isRequired};var coe=n(41745);function uoe({onToggle:e,isOpened:t}){const n=(0,yl.Z)((e=>e(H2).getFormSettings()),[]),{changeFormSettings:r}=(0,_l.Z)(H2),o=O2.MailPoet.tags.map((e=>e.name));return(0,Cw.jsx)(t3.Z,{children:(0,Cw.jsx)(tI.ZP,{title:"Tags",opened:t,onToggle:e,children:(0,Cw.jsx)(coe.T,{label:O2.MailPoet.I18n.t("addNewTag"),onChange:e=>{(0,$2.isEqual)(n.tags,e.value)||r({...n,tags:e.value})},suggestedValues:o,selectedValues:n.tags})})})}function doe(){const{toggleSidebarPanel:e}=(0,_l.Z)(H2),t=(0,yl.Z)((e=>e(H2).getSidebarOpenedPanels()),[]);return(0,Cw.jsxs)(Cw.Fragment,{children:[(0,Cw.jsx)(D2.ErrorBoundary,{children:(0,Cw.jsx)(jre,{isOpened:t.includes("basic-settings"),onToggle:(0,$2.partial)(e,"basic-settings")})}),(0,Cw.jsx)(Wre,{isOpened:t.includes("styles-settings"),onToggle:(0,$2.partial)(e,"styles-settings")}),(0,Cw.jsx)(ooe,{isOpened:t.includes("form-placement"),onToggle:(0,$2.partial)(e,"form-placement")}),(0,Cw.jsx)(uoe,{isOpened:t.includes("tags"),onToggle:(0,$2.partial)(e,"tags")}),(0,Cw.jsx)(loe,{isOpened:t.includes("custom-css"),onToggle:(0,$2.partial)(e,"custom-css")})]})}function poe(){return(0,Cw.jsx)(t3.Z,{children:(0,Cw.jsx)(eQ,{})})}function hoe({children:e,closeSidebar:t}){return(0,Cw.jsxs)(Cw.Fragment,{children:[(0,Cw.jsxs)("div",{className:"components-panel__header interface-complementary-area-header__small",children:[(0,Cw.jsx)("span",{className:"interface-complementary-area-header__small-title",children:O2.MailPoet.I18n.t("formSettings")}),(0,Cw.jsx)(Gh.ZP,{onClick:t,icon:"no-alt"})]}),(0,Cw.jsxs)("div",{className:"components-panel__header interface-complementary-area-header edit-post-sidebar__panel-tabs",children:[e,(0,Cw.jsx)(Gh.ZP,{onClick:t,icon:"no-alt"})]})]})}function moe({onClose:e}){const t=(0,yl.Z)((e=>e(H2).getDefaultSidebarActiveTab()),[]),n=(0,yl.Z)((e=>e("core/block-editor").getSelectedBlockClientId()),[]),{switchDefaultSidebarTab:r}=(0,_l.Z)(H2);return(0,x.useEffect)((()=>{r(n?"block":"form")}),[n,r]),(0,Cw.jsxs)(Cw.Fragment,{children:[(0,Cw.jsx)(hoe,{closeSidebar:e,children:(0,Cw.jsxs)("ul",{children:[(0,Cw.jsx)("li",{children:(0,Cw.jsx)("button",{onClick:()=>{r("form")},className:R()("components-button edit-post-sidebar__panel-tab",{"is-active":"form"===t}),"data-automation-id":"mailpoet_form_settings_tab",type:"button",children:O2.MailPoet.I18n.t("form")})}),(0,Cw.jsx)("li",{children:(0,Cw.jsx)("button",{onClick:()=>{r("block")},className:R()("components-button edit-post-sidebar__panel-tab",{"is-active":"block"===t}),"data-automation-id":"mailpoet_block_settings_tab",type:"button",children:(0,$.__)("Block")})})]})}),"form"===t?(0,Cw.jsx)(doe,{}):(0,Cw.jsx)(poe,{})]})}var foe=n(30211);function goe({label:e,minPercents:t=0,maxPercents:n=100,minPixels:r=10,maxPixels:o=1e3,value:i,defaultPercentValue:a=50,defaultPixelValue:s=200,onChange:l}){const[c,u]=(0,x.useState)(i??{unit:"pixel",value:void 0});return(0,x.useEffect)((()=>{u(i)}),[i]),(0,Cw.jsxs)("div",{className:"mailpoet-size-settings-control",children:[(0,Cw.jsx)(uw.ZP.VisualLabel,{children:e}),(0,Cw.jsx)(Are.Z,{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?s:a,unit:e};u(t),l(t)}}),(0,Cw.jsx)(CS,{value:c.value??("pixel"===c.unit?s:a),min:"pixel"===c.unit?r:t,max:"pixel"===c.unit?o:n,onChange:e=>{const t={unit:"pixel"===c.unit?"pixel":"percent",value:e};u(t),l(t)}})]})}goe.displayName="FormEditorSizeSettings";const boe=(0,D2.withBoundary)(goe);function voe({settingsPlacementKey:e}){const t=(0,yl.Z)((e=>e(H2).getFormSettings()),[]),n=(0,yl.Z)((e=>(0,foe.sortBy)("name",e(H2).getAllWPTags().concat(e(H2).getAllWooCommerceTags()))),[]),r=(0,yl.Z)((e=>(0,foe.sortBy)("name",e(H2).getAllWPCategories().concat(e(H2).getAllWooCommerceCategories()))),[]),o=(0,yl.Z)((e=>e(H2).getAllWPPages()),[]),i=(0,yl.Z)((e=>(0,foe.sortBy)("name",e(H2).getAllWPPosts().concat(e(H2).getAllWooCommerceProducts()))),[]),a=(0,yl.Z)((e=>e(H2).getIsPreviewShown()),[]),{changeFormSettings:s}=(0,_l.Z)(H2);let l="no-preview";a&&(l="preview");const c="belowPosts"!==e;return(0,Cw.jsxs)(Cw.Fragment,{children:[c&&(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("placeFormOnHomepage"),checked:t.formPlacement[e].homepage,onChange:n=>{(0,foe.compose)([s,(0,foe.assocPath)(`formPlacement.${e}.homepage`,n)])(t)}}),(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("placeFormOnAllPages"),checked:t.formPlacement[e].pages.all,onChange:n=>{(0,foe.compose)([s,(0,foe.assocPath)(`formPlacement.${e}.pages.all`,n),(0,foe.cond)([[()=>n,(0,foe.compose)([(0,foe.assocPath)(`formPlacement.${e}.pages.selected`,[]),(0,foe.assocPath)(`formPlacement.${e}.categories`,[]),(0,foe.assocPath)(`formPlacement.${e}.tags`,[])])],[()=>!n,foe.identity]])])(t)}}),(0,Cw.jsx)("div",{"data-automation-id":"form-placement-select-page",children:(0,Cw.jsx)("div",{className:"form-editor-placement-selection",children:(0,Cw.jsx)(Ore,{dropDownParent:a?".mailpoet-modal-content":void 0,item:{id:`${l}${t.formPlacement[e].pages.selected.join()}`},onValueChange:n=>{const r=t.formPlacement[e].pages.selected;(0,foe.isEqual)(r,n.target.value)||(0,foe.compose)([s,(0,foe.assocPath)(`formPlacement.${e}.pages.selected`,n.target.value),(0,foe.cond)([[()=>!!n.target.value.length,(0,foe.assocPath)(`formPlacement.${e}.pages.all`,!1)],[()=>!n.target.value.length,foe.identity]])])(t)},field:{id:`${l}pages`,name:"pages",values:o,multiple:!0,placeholder:O2.MailPoet.I18n.t("selectPage"),getLabel:e=>e.name,selected:()=>t.formPlacement[e].pages.selected}})})}),(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("placeFormOnAllPosts"),checked:t.formPlacement[e].posts.all,onChange:n=>{(0,foe.compose)([s,(0,foe.assocPath)(`formPlacement.${e}.posts.all`,n),(0,foe.cond)([[()=>n,(0,foe.compose)([(0,foe.assocPath)(`formPlacement.${e}.posts.selected`,[]),(0,foe.assocPath)(`formPlacement.${e}.categories`,[]),(0,foe.assocPath)(`formPlacement.${e}.tags`,[])])],[()=>!n,foe.identity]])])(t)}}),(0,Cw.jsx)("div",{className:"form-editor-placement-selection",children:(0,Cw.jsx)(Ore,{dropDownParent:a?".mailpoet-modal-content":void 0,item:{id:`${l}${t.formPlacement[e].posts.selected.join()}`},onValueChange:n=>{const r=t.formPlacement[e].posts.selected;(0,foe.isEqual)(r,n.target.value)||(0,foe.compose)([s,(0,foe.assocPath)(`formPlacement.${e}.posts.selected`,n.target.value),(0,foe.cond)([[()=>!!n.target.value.length,(0,foe.assocPath)(`formPlacement.${e}.posts.all`,!1)],[()=>!n.target.value.length,foe.identity]])])(t)},field:{id:`${l}posts`,name:"posts",values:i,multiple:!0,placeholder:O2.MailPoet.I18n.t("selectPage"),getLabel:e=>e.name,selected:()=>t.formPlacement[e].posts.selected}})}),(0,Cw.jsxs)("div",{children:[(0,Cw.jsx)("p",{className:"form-editor-sidebar-heading",children:O2.MailPoet.I18n.t("displayOnCategories")}),(0,Cw.jsx)("div",{className:"form-editor-placement-selection",children:(0,Cw.jsx)(Ore,{dropDownParent:a?".mailpoet-modal-content":void 0,item:{id:`${l}${t.formPlacement[e].categories.join()}`},onValueChange:n=>{const r=t.formPlacement[e].categories;(0,foe.isEqual)(r,n.target.value)||(0,foe.compose)([s,(0,foe.assocPath)(`formPlacement.${e}.categories`,n.target.value),(0,foe.cond)([[()=>!!n.target.value.length,(0,foe.compose)([(0,foe.assocPath)(`formPlacement.${e}.pages.all`,!1),(0,foe.assocPath)(`formPlacement.${e}.posts.all`,!1)])],[()=>!n.target.value.length,foe.identity]])])(t)},field:{id:`${l}categories`,name:"categories",values:r,multiple:!0,placeholder:O2.MailPoet.I18n.t("selectPage"),getLabel:e=>e.name,selected:()=>t.formPlacement[e].categories}})})]}),(0,Cw.jsxs)("div",{children:[(0,Cw.jsx)("p",{className:"form-editor-sidebar-heading",children:O2.MailPoet.I18n.t("displayOnTags")}),(0,Cw.jsx)("div",{className:"form-editor-placement-selection",children:(0,Cw.jsx)(Ore,{dropDownParent:a?".mailpoet-modal-content":void 0,item:{id:`${l}${t.formPlacement[e].tags.join()}`},onValueChange:n=>{const r=t.formPlacement[e].tags;(0,foe.isEqual)(r,n.target.value)||(0,foe.compose)([s,(0,foe.assocPath)(`formPlacement.${e}.tags`,n.target.value),(0,foe.cond)([[()=>!!n.target.value.length,(0,foe.compose)([(0,foe.assocPath)(`formPlacement.${e}.pages.all`,!1),(0,foe.assocPath)(`formPlacement.${e}.posts.all`,!1)])],[()=>!n.target.value.length,foe.identity]])])(t)},field:{id:`${l}tags`,name:"tags",values:n,multiple:!0,placeholder:O2.MailPoet.I18n.t("selectPage"),getLabel:e=>e.name,selected:()=>t.formPlacement[e].tags}})})]}),c&&(0,Cw.jsxs)(Cw.Fragment,{children:[(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("displayOnAllTagArchives"),checked:t.formPlacement[e].tagArchives.all,onChange:n=>{(0,foe.compose)([s,(0,foe.assocPath)(`formPlacement.${e}.tagArchives.all`,n),(0,foe.cond)([[()=>n,(0,foe.compose)([(0,foe.assocPath)(`formPlacement.${e}.tagArchives.selected`,[])])],[()=>!n,foe.identity]])])(t)}}),(0,Cw.jsx)("div",{"data-automation-id":"form-placement-select-archive-tags",children:(0,Cw.jsx)("div",{className:"form-editor-placement-selection",children:(0,Cw.jsx)(Ore,{dropDownParent:a?".mailpoet-modal-content":void 0,item:{id:`${l}${t.formPlacement[e].tagArchives.selected.join()}`},onValueChange:n=>{const r=t.formPlacement[e].tagArchives.selected;(0,foe.isEqual)(r,n.target.value)||(0,foe.compose)([s,(0,foe.assocPath)(`formPlacement.${e}.tagArchives.selected`,n.target.value),(0,foe.cond)([[()=>!!n.target.value.length,(0,foe.assocPath)(`formPlacement.${e}.tagArchives.all`,!1)],[()=>!n.target.value.length,foe.identity]])])(t)},field:{id:`${l}tagArchives`,name:"tagArchives",values:n,multiple:!0,placeholder:O2.MailPoet.I18n.t("selectSpecificArchiveTags"),getLabel:e=>e.name,selected:()=>t.formPlacement[e].tagArchives.selected}})})}),(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("displayOnAllCategoryArchives"),checked:t.formPlacement[e].categoryArchives.all,onChange:n=>{(0,foe.compose)([s,(0,foe.assocPath)(`formPlacement.${e}.categoryArchives.all`,n),(0,foe.cond)([[()=>n,(0,foe.compose)([(0,foe.assocPath)(`formPlacement.${e}.categoryArchives.selected`,[])])],[()=>!n,foe.identity]])])(t)}}),(0,Cw.jsx)("div",{"data-automation-id":"form-placement-select-archive-categories",children:(0,Cw.jsx)("div",{className:"form-editor-placement-selection",children:(0,Cw.jsx)(Ore,{dropDownParent:a?".mailpoet-modal-content":void 0,item:{id:`${l}${t.formPlacement[e].categoryArchives.selected.join()}`},onValueChange:n=>{const r=t.formPlacement[e].categoryArchives.selected;(0,foe.isEqual)(r,n.target.value)||(0,foe.compose)([s,(0,foe.assocPath)(`formPlacement.${e}.categoryArchives.selected`,n.target.value),(0,foe.cond)([[()=>!!n.target.value.length,(0,foe.assocPath)(`formPlacement.${e}.categoryArchives.all`,!1)],[()=>!n.target.value.length,foe.identity]])])(t)},field:{id:`${l}categoryArchives`,name:"categoryArchives",values:r,multiple:!0,placeholder:O2.MailPoet.I18n.t("selectSpecificArchiveCategories"),getLabel:e=>e.name,selected:()=>t.formPlacement[e].categoryArchives.selected}})})})]})]})}voe.displayName="FormEditorPlacementSettings";const yoe=(0,D2.withBoundary)(voe);function _oe(){const e=(0,yl.Z)((e=>e(H2).getFormSettings()),[]),{changeFormSettings:t}=(0,_l.Z)(H2),n=e.formPlacement.belowPosts.enabled;return(0,Cw.jsxs)(Cw.Fragment,{children:[(0,Cw.jsx)("p",{children:O2.MailPoet.I18n.t("placeFormBellowPagesDescription")}),(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("enable"),checked:n,onChange:(0,foe.compose)([t,(0,foe.assocPath)("formPlacement.belowPosts.enabled",foe.__,e)])}),n&&(0,Cw.jsxs)(Cw.Fragment,{children:[(0,Cw.jsx)(boe,{label:O2.MailPoet.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,foe.assocPath)("formPlacement.belowPosts.styles.width",n,e))}}),(0,Cw.jsx)(yoe,{settingsPlacementKey:"belowPosts"})]})]})}function koe({settingsPlacementKey:e}){const t=(0,yl.Z)((e=>e(H2).getFormSettings()),[]),{changeFormSettings:n}=(0,_l.Z)(H2);return(0,Cw.jsx)(HZ.Z,{label:O2.MailPoet.I18n.t("animationHeader"),value:t.formPlacement[e].animation,options:[{label:O2.MailPoet.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,foe.compose)([n,(0,foe.assocPath)(`formPlacement.${e}.animation`,foe.__,t)])})}koe.displayName="FormEditorAnimationSettings";const woe=(0,D2.withBoundary)(koe);function Eoe({settingsPlacementKey:e}){const t=(0,yl.Z)((e=>e(H2).getFormSettings()),[]),{changeFormSettings:n}=(0,_l.Z)(H2);return(0,Cw.jsx)(HZ.Z,{label:O2.MailPoet.I18n.t("formPlacementCookieExpiration"),value:t.formPlacement[e].cookieExpiration,options:[{value:"0",label:O2.MailPoet.I18n.t("formPlacementCookieExpirationAlways")},{value:"1",label:O2.MailPoet.I18n.t("formPlacementCookieExpirationDay")},...[3,7,14,30,60,90].map((e=>({value:`${e}`,label:O2.MailPoet.I18n.t("formPlacementCookieExpirationDays").replace("%1s",e.toString())})))],onChange:(0,foe.compose)([n,(0,foe.assocPath)(`formPlacement.${e}.cookieExpiration`,foe.__,t)])})}Eoe.displayName="FormEditorCookieSettings";const Coe=(0,D2.withBoundary)(Eoe),xoe=[0,2,5,10,15,30,45,60,120,180,240];function Soe(){const e=(0,yl.Z)((e=>e(H2).getFormSettings()),[]),{changeFormSettings:t}=(0,_l.Z)(H2),n=e.formPlacement.popup.enabled;return(0,Cw.jsxs)(Cw.Fragment,{children:[(0,Cw.jsx)("p",{children:O2.MailPoet.I18n.t("placePopupFormOnPagesDescription")}),(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("enable"),checked:n,onChange:(0,foe.compose)([t,(0,foe.assocPath)("formPlacement.popup.enabled",foe.__,e)])}),n&&(0,Cw.jsxs)(Cw.Fragment,{children:[(0,Cw.jsx)("hr",{}),(0,Cw.jsx)(boe,{label:O2.MailPoet.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,foe.assocPath)("formPlacement.popup.styles.width",n,e))}}),(0,Cw.jsx)(yoe,{settingsPlacementKey:"popup"}),(0,Cw.jsx)(woe,{settingsPlacementKey:"popup"}),(0,Cw.jsx)(HZ.Z,{label:O2.MailPoet.I18n.t("formPlacementDelay"),value:`${e.formPlacement.popup.delay}`,onChange:(0,foe.compose)([t,(0,foe.assocPath)("formPlacement.popup.delay",foe.__,e)]),options:xoe.map((e=>({value:`${e}`,label:O2.MailPoet.I18n.t("formPlacementDelaySeconds").replace("%1s",`${e}`)})))}),(0,Cw.jsx)(Coe,{settingsPlacementKey:"popup"}),(0,Cw.jsxs)("div",{children:[(0,Cw.jsx)("p",{children:(0,Cw.jsx)("b",{children:O2.MailPoet.I18n.t("exitIntentTitle")})}),(0,Cw.jsx)("p",{children:O2.MailPoet.I18n.t("exitIntentDescription")}),(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("exitIntentSwitch"),checked:e.formPlacement.popup.exitIntentEnabled,onChange:(0,foe.compose)([t,(0,foe.assocPath)("formPlacement.popup.exitIntentEnabled",foe.__,e)])})]})]})]})}var Ioe=n(34352),Toe=n.n(Ioe);function Noe(){const[e,t]=(0,x.useState)(null),n=(0,yl.Z)((e=>e(H2).getFormExports()),[]),r=(0,yl.Z)((e=>e(H2).getFormSettings()),[]),o=(0,yl.Z)((e=>e(H2).isFormSaved()),[]),{changeFormSettings:i}=(0,_l.Z)(H2),a=Toe()(O2.MailPoet.I18n.t("addFormWidgetHint"),/\[link](.*?)\[\/link]/g,(e=>(0,Cw.jsx)("a",{href:"widgets.php",target:"_blank",children:e},"addFormWidgetHintLink"))),s=Toe()(O2.MailPoet.I18n.t("addFormShortcodeHint"),/\[shortcode]/g,(e=>(0,Cw.jsx)("code",{children:n.shortcode},e))),l=(0,$2.curry)(((e,r)=>(r.preventDefault(),O2.MailPoet.trackEvent("Forms > Embed",{"Embed type":e}),t("php"===e?n.php:n.iframe)))),c=Toe()(O2.MailPoet.I18n.t("addFormPhpIframeHint"),/\[link](.*?)\[\/link]/g,(e=>"PHP"===e?(0,Cw.jsx)("a",{href:"#",onClick:l("php"),children:e},"exportPHP"):(0,Cw.jsx)("a",{href:"#",onClick:l("iframe"),children:e},"exportIframe")));return o?(0,Cw.jsxs)(Cw.Fragment,{children:[(0,Cw.jsx)("p",{children:a}),(0,Cw.jsx)("p",{children:s}),(0,Cw.jsx)("p",{children:c}),e?(0,Cw.jsx)(p1.Z,{readOnly:!0,onClick:e=>e.target.select(),rows:8,value:e,onChange:()=>{}},"copyTextArea"):null,(0,Cw.jsx)("hr",{}),(0,Cw.jsx)(boe,{label:O2.MailPoet.I18n.t("formSettingsWidth"),value:r.formPlacement.others.styles.width,minPixels:200,maxPixels:1200,minPercents:10,maxPercents:100,defaultPixelValue:200,defaultPercentValue:100,onChange:e=>{i((0,foe.assocPath)("formPlacement.others.styles.width",e,r))}})]}):(0,Cw.jsx)("p",{children:O2.MailPoet.I18n.t("saveFormFirst")})}Noe.displayName="FormEditorOtherSettings";const Poe=[0,2,5,10,15,30,45,60,120,180,240];function Roe(){const e=(0,yl.Z)((e=>e(H2).getFormSettings()),[]),{changeFormSettings:t}=(0,_l.Z)(H2),n=e.formPlacement.fixedBar.enabled;return(0,Cw.jsxs)(Cw.Fragment,{children:[(0,Cw.jsx)("p",{children:O2.MailPoet.I18n.t("placeFixedBarFormOnPagesDescription")}),(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("enable"),checked:n,onChange:(0,foe.compose)([t,(0,foe.assocPath)("formPlacement.fixedBar.enabled",foe.__,e)])}),n&&(0,Cw.jsxs)(Cw.Fragment,{children:[(0,Cw.jsx)("hr",{}),(0,Cw.jsx)(Are.Z,{label:O2.MailPoet.I18n.t("formPlacementPlacementPosition"),selected:e.formPlacement.fixedBar.position,options:[{label:O2.MailPoet.I18n.t("formPlacementPlacementPositionTop"),value:"top"},{label:O2.MailPoet.I18n.t("formPlacementPlacementPositionBottom"),value:"bottom"}],onChange:(0,foe.compose)([t,(0,foe.assocPath)("formPlacement.fixedBar.position",foe.__,e)])}),(0,Cw.jsx)(boe,{label:O2.MailPoet.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,foe.assocPath)("formPlacement.fixedBar.styles.width",n,e))}}),(0,Cw.jsx)(yoe,{settingsPlacementKey:"fixedBar"}),(0,Cw.jsx)(woe,{settingsPlacementKey:"fixedBar"}),(0,Cw.jsx)(HZ.Z,{label:O2.MailPoet.I18n.t("formPlacementDelay"),value:`${e.formPlacement.fixedBar.delay}`,onChange:(0,foe.compose)([t,(0,foe.assocPath)("formPlacement.fixedBar.delay",foe.__,e)]),options:Poe.map((e=>({value:`${e}`,label:O2.MailPoet.I18n.t("formPlacementDelaySeconds").replace("%1s",`${e}`)})))}),(0,Cw.jsx)(Coe,{settingsPlacementKey:"fixedBar"})]})]})}Roe.displayName="FormEditorFixedBarSettings";const Aoe=[0,2,5,10,15,30,45,60,120,180,240];function Boe(){const e=(0,yl.Z)((e=>e(H2).getFormSettings()),[]),{changeFormSettings:t}=(0,_l.Z)(H2),n=e.formPlacement.slideIn.enabled;return(0,Cw.jsxs)(Cw.Fragment,{children:[(0,Cw.jsx)("p",{children:O2.MailPoet.I18n.t("placeSlideInFormOnPagesDescription")}),(0,Cw.jsx)(aE.Z,{label:O2.MailPoet.I18n.t("enable"),checked:n,onChange:(0,foe.compose)([t,(0,foe.assocPath)("formPlacement.slideIn.enabled",foe.__,e)])}),n&&(0,Cw.jsxs)(Cw.Fragment,{children:[(0,Cw.jsx)("hr",{}),(0,Cw.jsx)(Are.Z,{label:O2.MailPoet.I18n.t("formPlacementPlacementPosition"),selected:e.formPlacement.slideIn.position,options:[{label:O2.MailPoet.I18n.t("formPlacementPlacementPositionLeft"),value:"left"},{label:O2.MailPoet.I18n.t("formPlacementPlacementPositionRight"),value:"right"}],onChange:(0,foe.compose)([t,(0,foe.assocPath)("formPlacement.slideIn.position",foe.__,e)])}),(0,Cw.jsx)(boe,{label:O2.MailPoet.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,foe.assocPath)("formPlacement.slideIn.styles.width",n,e))}}),(0,Cw.jsx)(yoe,{settingsPlacementKey:"slideIn"}),(0,Cw.jsx)(woe,{settingsPlacementKey:"slideIn"}),(0,Cw.jsx)(HZ.Z,{label:O2.MailPoet.I18n.t("formPlacementDelay"),value:`${e.formPlacement.slideIn.delay}`,onChange:(0,foe.compose)([t,(0,foe.assocPath)("formPlacement.slideIn.delay",foe.__,e)]),options:Aoe.map((e=>({value:`${e}`,label:O2.MailPoet.I18n.t("formPlacementDelaySeconds").replace("%1s",`${e}`)})))}),(0,Cw.jsx)(Coe,{settingsPlacementKey:"slideIn"})]})]})}function Loe({activePanel:e}){return(0,Cw.jsxs)("div",{className:"mailpoet-styles-settings",children:["others"===e&&(0,Cw.jsx)(D2.ErrorBoundary,{children:(0,Cw.jsx)(Noe,{})}),"below_posts"===e&&(0,Cw.jsx)(D2.ErrorBoundary,{children:(0,Cw.jsx)(_oe,{})}),"fixed_bar"===e&&(0,Cw.jsx)(D2.ErrorBoundary,{children:(0,Cw.jsx)(Roe,{})}),"popup"===e&&(0,Cw.jsx)(D2.ErrorBoundary,{children:(0,Cw.jsx)(Soe,{})}),"slide_in"===e&&(0,Cw.jsx)(D2.ErrorBoundary,{children:(0,Cw.jsx)(Boe,{})})]})}function Moe({onClose:e}){const t=(0,yl.Z)((e=>e(H2).getPreviewSettings()),[]);return(0,Cw.jsxs)(Cw.Fragment,{children:[(0,Cw.jsx)(hoe,{closeSidebar:e,children:(0,Cw.jsxs)("h3",{className:"mailpoet-sidebar-header-heading",children:["others"===t.formType&&O2.MailPoet.I18n.t("placeFormOthers"),"below_posts"===t.formType&&O2.MailPoet.I18n.t("placeFormBellowPages"),"fixed_bar"===t.formType&&O2.MailPoet.I18n.t("placeFixedBarFormOnPages"),"popup"===t.formType&&O2.MailPoet.I18n.t("placePopupFormOnPages"),"slide_in"===t.formType&&O2.MailPoet.I18n.t("placeSlideInFormOnPages")]})}),(0,Cw.jsx)(t3.Z,{children:(0,Cw.jsx)(tI.ZP,{children:(0,Cw.jsx)(Loe,{activePanel:t.formType})})})]})}function Doe(){const{toggleSidebar:e,changeActiveSidebar:t}=(0,_l.Z)(H2),n=(0,yl.Z)((e=>e(H2).getActiveSidebar()),[]),r=(0,yl.Z)((e=>e("core/block-editor").getSelectedBlockClientId()),[]);return(0,x.useEffect)((()=>{r&&t("default")}),[r,t]),(0,Cw.jsxs)("div",{className:"edit-post-sidebar interface-complementary-area mailpoet_form_editor_sidebar",children:["default"===n&&(0,Cw.jsx)(moe,{onClose:()=>{e(!1)}}),"placement_settings"===n&&(0,Cw.jsx)(Moe,{onClose:()=>{t("default")}})]})}function Ooe({setIsInserterOpened:e}){const t=(0,yl.Z)((e=>e(H2).getInserterPanelInsertPoint()),[]);return(0,Cw.jsxs)("div",{className:"edit-post-editor__inserter-panel",children:[(0,Cw.jsx)("div",{className:"edit-post-editor__inserter-panel-header",children:(0,Cw.jsx)(Gh.ZP,{icon:WX.Z,onClick:()=>e(!1)})}),(0,Cw.jsx)("div",{className:"edit-post-editor__inserter-panel-content",children:(0,Cw.jsx)(D0,{showMostUsedBlocks:!0,showInserterHelpPanel:!1,rootClientId:t.rootClientId??void 0,__experimentalInsertionIndex:t.insertionIndex??void 0})})]})}Doe.displayName="FormEditorSidebar";var Foe=n(18558);function joe(){const e=(0,yl.Z)((e=>e(H2).getDismissibleNotices()),[]),t=(0,yl.Z)((e=>e(H2).getNonDismissibleNotices()),[]),{removeNotice:n}=(0,_l.Z)(H2),r=(0,$2.memoize)((e=>{setTimeout((()=>n(e)),5e3)}));return e.forEach((e=>r(e.id))),(0,Cw.jsxs)(Cw.Fragment,{children:[(0,Cw.jsx)(Foe.Z,{notices:t,className:"components-editor-notices__pinned"}),(0,Cw.jsx)(Foe.Z,{notices:e,className:"components-editor-notices__dismissible automation-dismissible-notices",onRemove:n})]})}joe.displayName="FormEditorNotices";var Zoe=n(35572);const zoe=()=>{const e=document.getElementById("mailpoet-form-editor-form-styles"),t=(0,yl.Z)((e=>e(H2).getFormStyles()),[]);try{Zoe.parse(t)}catch(t){return eT.createPortal(null,e)}const n=RL([{css:t}],".editor-styles-wrapper");return eT.createPortal(n[0],e)};function Voe(){return(0,Cw.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,Cw.jsx)("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:(0,Cw.jsx)("g",{className:"mailpoet_preview_icon_fill",transform:"translate(-760.000000, -64.000000)",fillRule:"nonzero",children:(0,Cw.jsx)("g",{transform:"translate(712.000000, 64.000000)",children:(0,Cw.jsx)("g",{transform:"translate(48.000000, 0.000000)",children:(0,Cw.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 Hoe(){return(0,Cw.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,Cw.jsx)("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:(0,Cw.jsx)("g",{className:"mailpoet_preview_icon_fill",transform:"translate(-712.000000, -64.000000)",fillRule:"nonzero",children:(0,Cw.jsx)("g",{transform:"translate(712.000000, 64.000000)",children:(0,Cw.jsx)("g",{children:(0,Cw.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 Uoe({children:e,onDisplayTypeChange:t,selectedDisplayType:n}){const[r,o]=(0,x.useState)(n),i=e=>{o(e),t(e)};return(0,Cw.jsxs)("div",{className:"mailpoet_browser_preview",children:[(0,Cw.jsxs)("div",{className:"mailpoet_browser_preview_toggle",children:[(0,Cw.jsx)("a",{className:R()("mailpoet_browser_preview_icon",{mailpoet_active:"desktop"===r}),onClick:e=>{e.preventDefault(),i("desktop")},title:(0,$._x)("Desktop","Desktop browser preview mode","mailpoet"),href:"#","data-automation-id":"preview_type_desktop",children:(0,Cw.jsx)(Hoe,{})}),(0,Cw.jsx)("a",{className:R()("mailpoet_browser_preview_icon",{mailpoet_active:"mobile"===r}),onClick:e=>{e.preventDefault(),i("mobile")},title:(0,$._x)("Mobile","Mobile browser preview mode","mailpoet"),href:"#","data-automation-id":"preview_type_mobile",children:(0,Cw.jsx)(Voe,{})})]}),(0,Cw.jsx)("div",{className:R()("mailpoet_browser_preview_container",{mailpoet_browser_preview_container_mobile:"desktop"!==r},{mailpoet_browser_preview_container_desktop:"desktop"===r}),children:(0,Cw.jsx)("div",{className:"mailpoet_browser_preview_border",children:e})}),"desktop"!==r&&(0,Cw.jsx)("p",{className:"mailpoet_form_preview_disclaimer",children:(0,$.__)("Psssst. Forms on mobile appear smaller automatically because it’s better for SEO.","mailpoet")})]})}function $oe(){const e=(0,x.useRef)(null),[t,n]=(0,x.useState)(!1),{hidePreview:r,changePreviewSettings:o}=(0,_l.Z)(H2),i=(0,yl.Z)((e=>e(H2).getIsPreviewShown()),[]),a=(0,yl.Z)((e=>e(H2).getIsPreviewReady()),[]),s=(0,yl.Z)((e=>e(H2).getPreviewSettings()),[]),l=(0,yl.Z)((e=>e(H2).getFormSettings()),[]),c=(0,yl.Z)((e=>e(H2).getFormData().id),[]),u=(0,yl.Z)((e=>e(H2).getEditorUrl()),[]),d=(0,yl.Z)((e=>e(H2).getPreviewPageUrl()),[]);(0,x.useEffect)((()=>{n(!1);const e=document.getElementById("beacon-container");i&&e&&(e.style.display="none")}),[i]),(0,x.useEffect)((()=>{if(!e.current||!t)return;const n={formType:s.formType,formSettings:l};e.current.contentWindow.postMessage(n,d)}),[l,e,s,t,d]);const p=(0,x.useCallback)((()=>{const e=document.getElementById("beacon-container");e&&(e.style.display="block"),r()}),[r]),h=(0,x.useCallback)((e=>{n(!1),o({...s,formType:e})}),[o,s]),m=(0,x.useCallback)((e=>{o({...s,displayType:e})}),[o,s]);if(!i)return null;const f={id:c,form_type:s.formType,editor_url:u};let g=`${d}&data=${btoa(JSON.stringify(f))}`;return["below_posts"].includes(s.formType)&&(g+=`#mailpoet_form_preview_${c}`),(0,Cw.jsxs)(Nre.u,{onRequestClose:p,fullScreen:!0,contentClassName:"mailpoet_form_preview_modal",children:[!a&&(0,Cw.jsx)("div",{className:"mailpoet_spinner_wrapper",children:(0,Cw.jsx)(UD.ZP,{})}),a&&(0,Cw.jsxs)("div",{className:"mailpoet_preview_content_wrapper",children:[(0,Cw.jsxs)("div",{className:"mailpoet_preview_sidebar",children:[(0,Cw.jsx)(HZ.Z,{label:O2.MailPoet.I18n.t("formPlacementLabel"),value:s.formType,onChange:h,className:"mailpoet_preview_form_type_selection","data-automation-id":"form_type_selection",options:[{value:"others",label:O2.MailPoet.I18n.t("placeFormOthers")},{value:"below_posts",label:O2.MailPoet.I18n.t("placeFormBellowPages")},{value:"fixed_bar",label:O2.MailPoet.I18n.t("placeFixedBarFormOnPages")},{value:"popup",label:O2.MailPoet.I18n.t("placePopupFormOnPages")},{value:"slide_in",label:O2.MailPoet.I18n.t("placeSlideInFormOnPages")}]}),(0,Cw.jsx)(Loe,{activePanel:s.formType})]}),(0,Cw.jsx)(D2.ErrorBoundary,{children:(0,Cw.jsxs)(Uoe,{onDisplayTypeChange:m,selectedDisplayType:s.displayType,children:[!t&&(0,Cw.jsx)("div",{className:"mailpoet_spinner_wrapper",children:(0,Cw.jsx)(UD.ZP,{})}),(0,Cw.jsx)("iframe",{ref:e,className:"mailpoet_form_preview_iframe",src:g,title:O2.MailPoet.I18n.t("formPreview"),onLoad:()=>n(!0),"data-automation-id":"form_preview_iframe",scrolling:"others"===s.formType?"no":"yes"}),"others"===s.formType&&"desktop"===s.displayType&&(0,Cw.jsx)("div",{className:"mailpoet_form_preview_disclaimer",children:O2.MailPoet.I18n.t("formPreviewOthersDisclaimer")})]})})]})]})}function Woe({children:e}){const{fontColor:t,backgroundColor:n,gradient:r,fontSize:o,borderRadius:i,borderSize:a,borderColor:s,alignment:l,formPadding:c,backgroundImageUrl:u,backgroundImageDisplay:d,fontFamily:p}=(0,yl.Z)((e=>e(H2).getFormSettings()),[]),h=(0,yl.Z)((e=>e(H2).getPreviewSettings()),[]),m=(0,yl.Z)((e=>e(H2).getFormWidth(h.formType)),[h.formType]);let f,g,b,v;a&&s&&(f="solid"),i&&(g=Number(i)),c&&(b=Number(c)),l&&(v=l);const y=[],_={color:t,fontSize:`${o}${Number.isNaN(Number(`${o}`||NaN))?"":"px"}`,fontFamily:p,lineHeight:1.2,borderRadius:g,borderWidth:a,borderColor:s,borderStyle:f,textAlign:v,padding:b,width:"pixel"===m.unit?m.value:`${m.value}%`,margin:"0 auto",maxWidth:"100%"};if(["others","below_posts"].includes(h.formType)&&"percent"===m.unit&&(_.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(r&&y.push(r),n&&y.push(n),y.length&&(_.background=y.join(", ")),"fixed_bar"===h.formType){const t={width:_.width,margin:"0 auto"};return _.width="max-content",_.minWidth="100%",_.maxWidth="auto",(0,Cw.jsx)("div",{className:"mailpoet-form-background",style:_,children:(0,Cw.jsx)("div",{style:t,children:e})})}return(0,Cw.jsx)("div",{className:"mailpoet-form-background",style:_,children:e})}function Goe(){const e=(0,yl.Z)((e=>e(H2).isFullscreenEnabled()),[]);return(0,x.useEffect)((()=>{e?document.body.classList.add("is-fullscreen-mode"):document.body.classList.remove("is-fullscreen-mode")}),[e]),null}function qoe(){const e=(0,yl.Z)((e=>e(H2).getSidebarOpened()),[]),t=(0,yl.Z)((e=>e(H2).isInserterOpened()),[]),n=(0,yl.Z)((e=>e(H2).getFormBlocks()),[]),r=(0,yl.Z)((e=>e("core").canUser("create","media")),[]),o=(0,yl.Z)((e=>e("core/block-editor").getSelectedBlock()),[]),i=R()("edit-post-layout interface-interface-skeleton",o?o.name.replace("/","-"):null,{"is-sidebar-opened":e}),{blocksChangedInBlockEditor:a,toggleInserter:s}=(0,_l.Z)(H2),l={mediaUpload:r?Ll:null,supportsLayout:!1,maxWidth:580,fontSizes:U2,enableCustomSpacing:!0,enableCustomLineHeight:!0,disableCustomFontSizes:!1,enableCustomUnits:!0,__experimentalFetchLinkSuggestions:F2,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__experimentalSetIsInserterOpened:s,__experimentalFeatures:{useRootPaddingAwareAlignments:!0,color:{custom:!0,text:!0,background:!0,customGradient:!0,defaultPalette:!0,palette:{default:am.colors},gradients:{default:am.gradients}}}};return(0,Cw.jsxs)(Cw.Fragment,{children:[(0,Cw.jsx)(Lee,{}),(0,Cw.jsx)(RB.vn,{children:(0,Cw.jsx)(kl.zt,{children:(0,Cw.jsx)("div",{className:i,children:(0,Cw.jsxs)("div",{className:"interface-interface-skeleton__editor",children:[(0,Cw.jsx)("div",{className:"interface-interface-skeleton__header",children:(0,Cw.jsx)(D2.ErrorBoundary,{children:(0,Cw.jsx)(Tre,{isInserterOpened:t,setIsInserterOpened:s})})}),(0,Cw.jsx)("div",{className:"interface-interface-skeleton__body",children:(0,Cw.jsxs)(MB,{value:n,onInput:a,onChange:a,settings:l,useSubRegistry:!1,children:[t&&(0,Cw.jsx)("div",{className:"interface-interface-skeleton__secondary-sidebar",children:(0,Cw.jsx)(Ooe,{setIsInserterOpened:s})}),(0,Cw.jsxs)("div",{className:"interface-interface-skeleton__content",children:[(0,Cw.jsx)(D2.ErrorBoundary,{children:(0,Cw.jsx)(joe,{})}),(0,Cw.jsx)(M2.D,{storeName:"mailpoet-form-editor"}),(0,Cw.jsx)($B,{className:"edit-post-visual-editor editor-styles-wrapper",children:(0,Cw.jsxs)(L0,{children:[(0,Cw.jsx)(BB,{}),(0,Cw.jsx)(BB.Register,{}),(0,Cw.jsx)("div",{className:"mailpoet_form",children:(0,Cw.jsx)(cL,{children:(0,Cw.jsx)(uF,{children:(0,Cw.jsx)(D2.ErrorBoundary,{children:(0,Cw.jsx)(Woe,{children:(0,Cw.jsx)(fF,{})})})})})})]})})]}),e&&(0,Cw.jsx)("div",{className:"interface-interface-skeleton__sidebar",children:(0,Cw.jsx)(D2.ErrorBoundary,{children:(0,Cw.jsx)(Doe,{})})})]})}),(0,Cw.jsx)(D2.ErrorBoundary,{children:(0,Cw.jsx)(zoe,{})}),(0,Cw.jsx)(D2.ErrorBoundary,{children:(0,Cw.jsx)(Goe,{})})]})})})}),(0,Cw.jsx)(D2.ErrorBoundary,{children:(0,Cw.jsx)($oe,{})}),(0,Cw.jsx)(Rre,{})]})}zoe.displayName="FormStyles",Uoe.propTypes={children:Z2().node.isRequired,onDisplayTypeChange:Z2().func,selectedDisplayType:Z2().string},Uoe.defaultProps={onDisplayTypeChange:()=>{},selectedDisplayType:"desktop"},Uoe.displayName="FormEditorPreview",$oe.displayName="FormPreviewWrapper",Woe.propTypes={children:Z2().node.isRequired},Woe.displayName="FormStylingBackground",Goe.displayName="Fullscreen";const Koe=(0,D.Z)((0,lT.Z)(((e,t)=>{if(uc(t.name,"multiple",!0))return{};const n=e(e_).getBlocks().find((({name:e})=>t.name===e));return{originalBlockClientId:n&&n.clientId!==t.clientId&&n.clientId}})),(0,cT.Z)(((e,{originalBlockClientId:t})=>({selectFirst:()=>e(e_).selectBlock(t)})))),Yoe=(0,Wh.o)((e=>Koe((({originalBlockClientId:t,selectFirst:n,...r})=>{if(!t)return(0,x.createElement)(e,{...r});const o=sc(r.name),i=function(e){const t=wc(Ec("to",e),(({type:e,blocks:t})=>"block"===e&&1===t.length));return t?sc(t.blocks[0]):null}(r.name);return[(0,x.createElement)("div",{key:"invalid-preview",style:{minHeight:"60px"}},(0,x.createElement)(e,{key:"block-edit",...r})),(0,x.createElement)(kT,{key:"multiple-use-warning",actions:[(0,x.createElement)(Gh.ZP,{key:"find-original",variant:"secondary",onClick:n},(0,$.__)("Find original")),(0,x.createElement)(Gh.ZP,{key:"remove",variant:"secondary",onClick:()=>r.onReplace([])},(0,$.__)("Remove")),i&&(0,x.createElement)(Gh.ZP,{key:"transform",variant:"secondary",onClick:()=>r.onReplace(fc(i.name,r.attributes))},(0,$.__)("Transform into:")," ",i.title)]},(0,x.createElement)("strong",null,o?.title,": "),(0,$.__)("This block can only be used once."))]}))),"withMultipleValidation");(0,mc.addFilter)("editor.BlockEdit","core/edit-post/validate-multiple-use/with-multiple-validation",Yoe);var Xoe=n(70326);const Joe="core/bold",Qoe=(0,$.__)("Bold"),eie={name:Joe,title:Qoe,tagName:"strong",className:null,edit({isActive:e,value:t,onChange:n,onFocus:r}){function o(){n(Ef(t,{type:Joe,title:Qoe}))}return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(HX,{type:"primary",character:"b",onUse:o}),(0,x.createElement)(UX,{name:"bold",icon:Xoe.Z,title:Qoe,onClick:function(){n(Ef(t,{type:Joe})),r()},isActive:e,shortcutType:"primary",shortcutCharacter:"b"}),(0,x.createElement)($X,{inputType:"formatBold",onInput:o}))}};var tie=n(36162);const nie="core/code",rie=(0,$.__)("Inline code"),oie={name:nie,title:rie,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 r=n.lastIndexOf("`",t-2);if(-1===r)return e;const o=r,i=t-2;return o===i?e:(e=rf(e,o,o+1),e=Mm(e=rf(e,i,i+1),{type:nie},o,i))},edit({value:e,onChange:t,onFocus:n,isActive:r}){function o(){t(Ef(e,{type:nie,title:rie})),n()}return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(HX,{type:"access",character:"x",onUse:o}),(0,x.createElement)(UX,{icon:tie.Z,title:rie,onClick:o,isActive:r,role:"menuitemcheckbox"}))}},iie=["image"],aie="core/image",sie=(0,$.__)("Inline image"),lie={name:aie,title:sie,keywords:[(0,$.__)("photo"),(0,$.__)("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:r,activeObjectAttributes:o,contentRef:i}){const[a,s]=(0,x.useState)(!1);function l(){s(!1)}return(0,x.createElement)(iO,null,(0,x.createElement)(UX,{icon:(0,x.createElement)(F_.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,x.createElement)(F_.y$,{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:sie,onClick:function(){s(!0)},isActive:r}),a&&(0,x.createElement)(aO,{allowedTypes:iie,onSelect:({id:r,url:o,alt:i,width:a})=>{l(),t(function(e,t,n,r){return nf(e,{formats:[,],replacements:[t],text:Om},void 0,void 0)}(e,{type:aie,attributes:{className:`wp-image-${r}`,style:`width: ${Math.min(a,150)}px;`,url:o,alt:i}})),n()},onClose:l,render:({open:e})=>(e(),null)}),r&&(0,x.createElement)(cie,{value:e,onChange:t,activeObjectAttributes:o,contentRef:i}))}};function cie({value:e,onChange:t,activeObjectAttributes:n,contentRef:r}){const{style:o}=n,[i,a]=(0,x.useState)(o?.replace(/\D/g,"")),s=xf({editableContentElement:r.current,settings:lie});return(0,x.createElement)(H_.ZP,{placement:"bottom",focusOnMount:!1,anchor:s,className:"block-editor-format-toolbar__image-popover"},(0,x.createElement)("form",{className:"block-editor-format-toolbar__image-container-content",onSubmit:r=>{const o=e.replacements.slice();o[e.start]={type:aie,attributes:{...n,style:i?`width: ${i}px;`:""}},t({...e,replacements:o}),r.preventDefault()}},(0,x.createElement)(wI.Z,{alignment:"bottom",spacing:"0"},(0,x.createElement)(qC.Z,{className:"block-editor-format-toolbar__image-container-value",label:(0,$.__)("Width"),value:i,min:1,onChange:e=>a(e)}),(0,x.createElement)(Gh.ZP,{className:"block-editor-format-toolbar__image-container-button",icon:MF.Z,label:(0,$.__)("Apply"),type:"submit"}))))}var uie=n(57606);const die="core/italic",pie=(0,$.__)("Italic"),hie={name:die,title:pie,tagName:"em",className:null,edit({isActive:e,value:t,onChange:n,onFocus:r}){function o(){n(Ef(t,{type:die,title:pie}))}return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(HX,{type:"primary",character:"i",onUse:o}),(0,x.createElement)(UX,{name:"italic",icon:uie.Z,title:pie,onClick:function(){n(Ef(t,{type:die})),r()},isActive:e,shortcutType:"primary",shortcutCharacter:"i"}),(0,x.createElement)($X,{inputType:"formatItalic",onInput:o}))}};var mie=n(4348),fie=n(51753),gie=n(73520),bie=n(28632),vie=n(60363),yie=n(99544),_ie=n(68106);function kie(e){if(!e)return!1;const t=e.trim();if(!t)return!1;if(/^\S+:/.test(t)){const e=(0,_j.E)(t);if(!(0,wj.M)(e))return!1;if(e.startsWith("http")&&!/^https?:\/\/[^\/\s]/i.test(t))return!1;const n=(0,fie.C)(t);if(!(0,gie.x)(n))return!1;const r=(0,ij.D)(t);if(r&&!(0,bie.t)(r))return!1;const o=(0,vie.W)(t);if(o&&!(0,yie.A)(o))return!1;const i=(0,_ie.S)(t);if(i&&!(0,Ej.Z)(i))return!1}return!(t.startsWith("#")&&!(0,Ej.Z)(t))}function wie(e,t,n=e.start,r=e.end){const o={start:null,end:null},{formats:i}=e;let a,s;if(!i?.length)return o;const l=i.slice(),c=l[n]?.find((({type:e})=>e===t.type)),u=l[r]?.find((({type:e})=>e===t.type)),d=l[r-1]?.find((({type:e})=>e===t.type));if(c)a=c,s=n;else if(u)a=u,s=r;else{if(!d)return o;a=d,s=r-1}const p=l[s].indexOf(a),h=[l,s,a,p];return{start:n=(n=xie(...h))<0?0:n,end:r=Sie(...h)}}function Eie(e,t,n,r,o){let i=t;const a={forwards:1,backwards:-1}[o]||1,s=-1*a;for(;e[i]&&e[i][r]===n;)i+=a;return i+=s,i}const Cie=(e,...t)=>(...n)=>e(...n,...t),xie=Cie(Eie,"backwards"),Sie=Cie(Eie,"forwards"),Iie=new WeakMap;let Tie=-1;function Nie(e){return`link-control-instance-${e}`}const Pie=[...Wj.DEFAULT_LINK_SETTINGS,{id:"nofollow",title:(0,$.__)("Mark as nofollow")}];var Rie=function({isActive:e,activeAttributes:t,addingLink:n,value:r,onChange:o,stopAddingLink:i,contentRef:a}){const s=function(e,t){let n=e.start,r=e.end;if(t){const t=wie(e,{type:"core/link"});n=t.start,r=t.end+1}return of(e,n,r)}(r,e).text,{createPageEntity:l,userCanCreatePages:c}=(0,yl.Z)((e=>{const{getSettings:t}=e(e_),n=t();return{createPageEntity:n.__experimentalCreatePageEntity,userCanCreatePages:n.__experimentalUserCanCreatePages}}),[]),u=(0,x.useMemo)((()=>({url:t.url,type:t.type,id:t.id,opensInNewTab:"_blank"===t.target,nofollow:t.rel?.includes("nofollow"),title:s})),[t.id,t.rel,t.target,t.type,t.url,s]),d=xf({editableContentElement:a.current,settings:Lie}),p=function(e){if(e)return Iie.has(e)?Nie(Iie.get(e)):(Tie+=1,Iie.set(e,Tie),Nie(Tie))}(d),h=(0,x.useRef)(!!n&&"firstElement");return(0,x.createElement)(H_.ZP,{anchor:d,focusOnMount:h.current,onClose:i,onFocusOutside:()=>i(!1),placement:"bottom",shift:!0},(0,x.createElement)(Wj,{key:p,value:u,onChange:function(t){const n=u.opensInNewTab!==t.opensInNewTab&&void 0===t.url;t={...u,...t};const a=(0,kj.u)(t.url),l=function({url:e,type:t,id:n,opensInNewWindow:r,nofollow:o}){const i={type:"core/link",attributes:{url:e}};return t&&(i.attributes.type=t),n&&(i.attributes.id=n),r&&(i.attributes.target="_blank",i.attributes.rel=i.attributes.rel?i.attributes.rel+" noreferrer noopener":"noreferrer noopener"),o&&(i.attributes.rel=i.attributes.rel?i.attributes.rel+" nofollow":"nofollow"),i}({url:a,type:t.type,id:void 0!==t.id&&null!==t.id?String(t.id):void 0,opensInNewWindow:t.opensInNewTab,nofollow:t.nofollow}),c=t.title||a;if(Xm(r)&&!e){const e=Mm(Zm({text:c}),l,0,c.length);o(nf(r,e))}else{let e;if(c===s)e=Mm(r,l);else{e=Zm({text:c}),e=Mm(e,l,0,c.length);const t=wie(r,{type:"core/link"}),[n,o]=af(r,t.start,t.start),i=function({formats:e,replacements:t,text:n,start:r,end:o},i,a){return n=n.replace(i,((n,...i)=>{const s=i[i.length-2];let l,c,u=a;return"function"==typeof u&&(u=a(n,...i)),"object"==typeof u?(l=u.formats,c=u.replacements,u=u.text):(l=Array(u.length),c=Array(u.length),e[s]&&(l=l.fill(e[s]))),e=e.slice(0,s).concat(l,e.slice(s+n.length)),t=t.slice(0,s).concat(c,t.slice(s+n.length)),r&&(r=o=s+u.length),u})),Bm({formats:e,replacements:t,text:n,start:r,end:o})}(o,s,e);e=function(...e){return Bm(e.reduce(Gm,Zm()))}(n,i)}e.start=e.end,e.activeFormats=[],o(e)}n||i(),kie(a)?e?(0,wf.D)((0,$.__)("Link edited."),"assertive"):(0,wf.D)((0,$.__)("Link inserted."),"assertive"):(0,wf.D)((0,$.__)("Warning: the link has been inserted but may have errors. Please test it."),"assertive")},onRemove:function(){const e=ef(r,"core/link");o(e),i(),(0,wf.D)((0,$.__)("Link removed."),"assertive")},forceIsEditingLink:n,hasRichPreviews:!0,createSuggestion:l&&async function(e){const t=await l({title:e,status:"draft"});return{id:t.id,type:t.type,title:t.title.rendered,url:t.link,kind:"post-type"}},withCreateSuggestion:c,createSuggestionButtonText:function(e){return(0,fB.Z)((0,$.sprintf)((0,$.__)("Create page: <mark>%s</mark>"),e),{mark:(0,x.createElement)("mark",null)})},hasTextControl:!0,settings:Pie}))};const Aie="core/link",Bie=(0,$.__)("Link"),Lie={name:Aie,title:Bie,tagName:"a",className:null,attributes:{url:"href",type:"data-type",id:"data-id",target:"target",rel:"rel"},__unstablePasteRule(e,{html:t,plainText:n}){if(Xm(e))return e;const r=(t||n).replace(/<[^>]+>/g,"").trim();return(0,$F.P)(r)?(window.console.log("Created link:\n\n",r),Mm(e,{type:Aie,attributes:{url:(0,Ud.S)(r)}})):e},edit:function({isActive:e,activeAttributes:t,value:n,onChange:r,onFocus:o,contentRef:i}){const[a,s]=(0,x.useState)(!1);function l(){const e=Ym(of(n));e&&(0,$F.P)(e)&&kie(e)?r(Mm(n,{type:Aie,attributes:{url:e}})):e&&(0,mie.J)(e)?r(Mm(n,{type:Aie,attributes:{url:`mailto:${e}`}})):s(!0)}function c(){r(ef(n,Aie)),(0,wf.D)((0,$.__)("Link removed."),"assertive")}return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(HX,{type:"primary",character:"k",onUse:l}),(0,x.createElement)(HX,{type:"primaryShift",character:"k",onUse:c}),e&&(0,x.createElement)(UX,{name:"link",icon:Bj.Z,title:(0,$.__)("Unlink"),onClick:c,isActive:e,shortcutType:"primaryShift",shortcutCharacter:"k","aria-haspopup":"true","aria-expanded":a||e}),!e&&(0,x.createElement)(UX,{name:"link",icon:UV.Z,title:Bie,onClick:l,isActive:e,shortcutType:"primary",shortcutCharacter:"k","aria-haspopup":"true","aria-expanded":a||e}),(a||e)&&(0,x.createElement)(Rie,{addingLink:a,stopAddingLink:function(e=!0){s(!1),e&&o()},isActive:e,activeAttributes:t,value:n,onChange:r,contentRef:i}))}},Mie="core/strikethrough",Die=(0,$.__)("Strikethrough"),Oie={name:Mie,title:Die,tagName:"s",className:null,edit({isActive:e,value:t,onChange:n,onFocus:r}){function o(){n(Ef(t,{type:Mie,title:Die})),r()}return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(HX,{type:"access",character:"d",onUse:o}),(0,x.createElement)(UX,{icon:x$.Z,title:Die,onClick:o,isActive:e,role:"menuitemcheckbox"}))}},Fie="core/underline",jie=(0,$.__)("Underline"),Zie={name:Fie,title:jie,tagName:"span",className:null,attributes:{style:"style"},edit({value:e,onChange:t}){const n=()=>{t(Ef(e,{type:Fie,attributes:{style:"text-decoration: underline;"},title:jie}))};return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(HX,{type:"primary",character:"u",onUse:n}),(0,x.createElement)($X,{inputType:"formatUnderline",onInput:n}))}};var zie=n(55586),Vie=n(37447);function Hie(e=""){return e.split(";").reduce(((e,t)=>{if(t){const[n,r]=t.split(":");"color"===n&&(e.color=r),"background-color"===n&&r!==qie&&(e.backgroundColor=r)}return e}),{})}function Uie(e="",t){return e.split(" ").reduce(((e,n)=>{if(n.startsWith("has-")&&n.endsWith("-color")){const r=n.replace(/^has-/,"").replace(/-color$/,""),o=dZ(t,r);e.color=o.color}return e}),{})}function $ie(e,t,n){const r=Km(e,t);return r?{...Hie(r.attributes.style),...Uie(r.attributes.class,n)}:{}}function Wie({name:e,property:t,value:n,onChange:r}){const o=(0,yl.Z)((e=>{var t;const{getSettings:n}=e(e_);return null!==(t=n().colors)&&void 0!==t?t:[]}),[]),i=(0,x.useCallback)((i=>{r(function(e,t,n,r){const{color:o,backgroundColor:i}={...$ie(e,t,n),...r};if(!o&&!i)return ef(e,t);const a=[],s=[],l={};if(i?a.push(["background-color",i].join(":")):a.push(["background-color",qie].join(":")),o){const e=pZ(n,o);e?s.push(hZ("color",e.slug)):a.push(["color",o].join(":"))}return a.length&&(l.style=a.join(";")),s.length&&(l.class=s.join(" ")),Mm(e,{type:t,attributes:l})}(n,e,o,{[t]:i}))}),[o,r,t]),a=(0,x.useMemo)((()=>$ie(n,e,o)),[e,n,o]);return(0,x.createElement)(KK,{value:a[t],onChange:i})}function Gie({name:e,value:t,onChange:n,onClose:r,contentRef:o}){const i=xf({editableContentElement:o.current,settings:Qie}),a=function(e){const[t,n]=(0,x.useState)(e);return(0,x.useEffect)((()=>{e&&n(e)}),[e]),t}(i.getBoundingClientRect());return i.getBoundingClientRect=()=>a,(0,x.createElement)(H_.ZP,{onClose:r,className:"components-inline-color-popover",anchor:i},(0,x.createElement)(fO.Z,{tabs:[{name:"color",title:(0,$.__)("Text")},{name:"backgroundColor",title:(0,$.__)("Background")}]},(r=>(0,x.createElement)(Wie,{name:e,property:r.name,value:t,onChange:n}))))}const qie="rgba(0, 0, 0, 0)",Kie="core/text-color",Yie=(0,$.__)("Highlight"),Xie=[];function Jie(e,t){const{ownerDocument:n}=e,{defaultView:r}=n,o=r.getComputedStyle(e).getPropertyValue(t);return"background-color"===t&&o===qie&&e.parentElement?Jie(e.parentElement,t):o}const Qie={name:Kie,title:Yie,tagName:"mark",className:"has-inline-color",attributes:{style:"style",class:"class"},__unstableFilterAttributeValue(e,t){if("style"!==e)return t;if(t&&t.includes("background-color"))return t;const n=["background-color",qie].join(":");return t?[n,t].join(";"):n},edit:function({value:e,onChange:t,isActive:n,activeAttributes:r,contentRef:o}){const i=YE("color.custom"),a=YE("color.palette")||Xie,[s,l]=(0,x.useState)(!1),c=(0,x.useCallback)((()=>l(!0)),[l]),u=(0,x.useCallback)((()=>l(!1)),[l]),d=(0,x.useMemo)((()=>function(e,{color:t,backgroundColor:n}){if(t||n)return{color:t||Jie(e,"color"),backgroundColor:n===qie?Jie(e,"background-color"):n}}(o.current,$ie(e,Kie,a))),[e,a]),p=a.length||!i;return p||n?(0,x.createElement)(x.Fragment,null,(0,x.createElement)(UX,{className:"format-library-text-color-button",isActive:n,icon:(0,x.createElement)(ox.Z,{icon:Object.keys(r).length?zie.Z:Vie.Z,style:d}),title:Yie,onClick:p?c:()=>t(ef(e,Kie)),role:"menuitemcheckbox"}),s&&(0,x.createElement)(Gie,{name:Kie,onClose:u,activeAttributes:r,value:e,onChange:t,contentRef:o})):null}};var eae=n(93705);const tae="core/subscript",nae=(0,$.__)("Subscript"),rae={name:tae,title:nae,tagName:"sub",className:null,edit({isActive:e,value:t,onChange:n,onFocus:r}){return(0,x.createElement)(UX,{icon:eae.Z,title:nae,onClick:function(){n(Ef(t,{type:tae,title:nae})),r()},isActive:e,role:"menuitemcheckbox"})}};var oae=n(35217);const iae="core/superscript",aae=(0,$.__)("Superscript"),sae={name:iae,title:aae,tagName:"sup",className:null,edit({isActive:e,value:t,onChange:n,onFocus:r}){return(0,x.createElement)(UX,{icon:oae.Z,title:aae,onClick:function(){n(Ef(t,{type:iae,title:aae})),r()},isActive:e,role:"menuitemcheckbox"})}};var lae=n(62221);const cae="core/keyboard",uae=(0,$.__)("Keyboard input"),dae={name:cae,title:uae,tagName:"kbd",className:null,edit({isActive:e,value:t,onChange:n,onFocus:r}){return(0,x.createElement)(UX,{icon:lae.Z,title:uae,onClick:function(){n(Ef(t,{type:cae,title:uae})),r()},isActive:e,role:"menuitemcheckbox"})}};var pae=n(52485);const hae="core/unknown",mae=(0,$.__)("Clear Unknown Formatting"),fae={name:hae,title:mae,tagName:"*",className:null,edit({isActive:e,value:t,onChange:n,onFocus:r}){const o=of(t).formats.some((e=>e.some((e=>e.type===hae))));return e||o?(0,x.createElement)(UX,{name:"unknown",icon:pae.Z,title:mae,onClick:function(){n(ef(t,hae)),r()},isActive:!0}):null}};var gae=n(54906);const bae="core/language",vae=(0,$.__)("Language"),yae={name:bae,tagName:"bdo",className:null,edit:function({isActive:e,value:t,onChange:n,contentRef:r}){const[o,i]=(0,x.useState)(!1),a=()=>{i((e=>!e))};return(0,x.createElement)(x.Fragment,null,(0,x.createElement)(UX,{icon:gae.Z,label:vae,title:vae,onClick:()=>{e?n(ef(t,bae)):a()},isActive:e,role:"menuitemcheckbox"}),o&&(0,x.createElement)(_ae,{value:t,onChange:n,onClose:a,contentRef:r}))},title:vae};function _ae({value:e,contentRef:t,onChange:n,onClose:r}){const o=xf({editableContentElement:t.current,settings:yae}),[i,a]=(0,x.useState)(""),[s,l]=(0,x.useState)("ltr");return(0,x.createElement)(H_.ZP,{className:"block-editor-format-toolbar__language-popover",anchor:o,onClose:r},(0,x.createElement)("form",{className:"block-editor-format-toolbar__language-container-content",onSubmit:t=>{t.preventDefault(),n(Mm(e,{type:bae,attributes:{lang:i,dir:s}})),r()}},(0,x.createElement)(QS.Z,{label:vae,value:i,onChange:e=>a(e),help:(0,$.__)('A valid language attribute, like "en" or "fr".')}),(0,x.createElement)(HZ.Z,{label:(0,$.__)("Text direction"),value:s,options:[{label:(0,$.__)("Left to right"),value:"ltr"},{label:(0,$.__)("Right to left"),value:"rtl"}],onChange:e=>l(e)}),(0,x.createElement)(wI.Z,{alignment:"right"},(0,x.createElement)(Gh.ZP,{variant:"primary",type:"submit",text:(0,$.__)("Apply")}))))}[eie,oie,lie,hie,Lie,Oie,Zie,Qie,rae,sae,dae,fae,yae].forEach((({name:e,...t})=>Qm(e,t)));const kae="mailpoet-form/font-selection",wae=["core/paragraph","core/heading"],Eae={name:kae,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 r=(0,yl.Z)((e=>e("core/block-editor").getSelectedBlock()),[]);return wae.includes(r.name)?(0,Cw.jsx)(Vk,{children:(0,Cw.jsx)("div",{className:"mailpoet_toolbar_item",children:(0,Cw.jsx)(Bee,{value:n.font,onChange:n=>{t(Mm(e,{type:"mailpoet-form/font-selection",attributes:{style:`font-family: ${n}`,font:n}}))},name:O2.MailPoet.I18n.t("formSettingsStylesFontFamily"),hideLabelFromVision:!0})})}):null}};var Cae=n(23525),xae=n(93625),Sae=n(9515),Iae=n(26050),Tae=n(44259),Nae=n(82299);const Pae="mailpoet-form-editor-templates";var Rae=n(2632);function Aae(){const e=[{name:"popup",label:(0,$._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,$._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,$._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,$._x)("Below pages","This is a text on a widget that leads to settings for form placement","mailpoet")},{name:"others",label:(0,$._x)("Others (widget)","Placement of the form using theme widget","mailpoet")}],t=(0,yl.Z)((e=>e(Pae).getSelectedCategory()),[]),n=(0,yl.Z)((e=>e(Pae).getTemplates()),[]),r=(0,yl.Z)((e=>e(Pae).getLoading()),[]),o=(0,yl.Z)((e=>e(Pae).getSelectTemplateFailed()),[]),{selectTemplate:i,selectCategory:a}=(0,_l.Z)(Pae);return(0,Cw.jsxs)(Cw.Fragment,{children:[e.map((e=>n[e.name].map(((e,t)=>t<4&&(0,Cw.jsx)("link",{rel:"preload",href:e.thumbnail,as:"image"},`thumbnail_prefetch_${e.id}`))))),(0,Cw.jsx)(Tae.Q,{}),o&&(0,Cw.jsx)(Nae.q,{type:"error",scroll:!0,renderInPlace:!0,children:(0,Cw.jsx)("p",{children:(0,$.__)("Sorry, there was an error, please try again later.","mailpoet")})}),(0,Cw.jsxs)("div",{"data-automation-id":"template_selection_list",children:[(0,Cw.jsx)(xae.A,{color:"#fff"}),(0,Cw.jsxs)("div",{className:"mailpoet-form-templates",children:[(0,Cw.jsx)(Rae.m,{heading:(0,$.__)("Start with a template","mailpoet"),headingPrefix:(0,Cw.jsx)(Rae.x,{href:"?page=mailpoet-forms",label:(0,$.__)("Back to forms list","mailpoet")}),children:(0,Cw.jsx)(Gh.ZP,{"data-automation-id":"create_blank_form",variant:"secondary",onClick:()=>{i("initial_form","Blank template")},children:(0,$.__)("Or, start with a blank form","mailpoet")})}),(0,Cw.jsx)(Cae.R,{categories:e,active:t,onSelect:a}),n[t].map((e=>(0,Cw.jsx)(Iae.G,{onSelect:()=>{i(e.id,e.name)},label:e.name,automationId:`select_template_${e.id}`,className:"mailpoet-form-template",children:(0,Cw.jsx)("div",{className:"mailpoet-template-thumbnail",children:(0,Cw.jsx)("img",{src:e.thumbnail,alt:e.name,width:"480",height:"317",loading:"lazy"})})},e.id))),(0,Cw.jsxs)("div",{className:"mailpoet-form-template-selection-footer",children:[(0,Cw.jsx)("p",{children:(0,$.__)("Can’t find a template that suits your needs?","mailpoet")}),(0,Cw.jsx)(Gh.ZP,{variant:"link",onClick:()=>{i("initial_form","Blank template")},children:(0,$.__)("Start with a blank form","mailpoet")})]})]})]}),r&&(0,Cw.jsx)(Sae.g,{})]})}const Bae={getTemplates(e){return e.templates},getFormEditorUrl(e){return e.formEditorUrl},getSelectTemplateFailed(e){return e.selectTemplateFailed},getLoading(e){return e.loading},getSelectedCategory(e){return e.activeCategory}},Lae=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*Mae(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,Kl.Y)(Pae).getFormEditorUrl();return window.location.href=`${n}${e}`,{}}function Dae(e){return{type:"SELECT_CATEGORY",category:e}}var Oae=n(55861);let Fae=function(e){return e.Popup="popup",e.SlideIn="slide_in",e.FixedBar="fixed_bar",e.BelowPosts="below_posts",e.Others="others",e}({});function jae(){return(0,Cw.jsx)(T.k.Provider,{value:(0,T.S)(window),children:(0,Cw.jsxs)(Cw.Fragment,{children:[(0,Cw.jsx)(N.w,{}),(0,Cw.jsx)(Aae,{})]})})}const Zae=document.querySelector("#mailpoet_form_edit_templates");function zae(){return(0,Cw.jsx)(T.k.Provider,{value:(0,T.S)(window),children:(0,Cw.jsxs)(Cw.Fragment,{children:[(0,Cw.jsx)(N.w,{}),(0,Cw.jsx)(qoe,{})]})})}Zae&&((0,D2.registerTranslations)(),(()=>{const e={templates:window.mailpoet_templates,formEditorUrl:window.mailpoet_form_edit_url,selectTemplateFailed:!1,loading:!1,activeCategory:Fae.Popup},t={selectors:Bae,actions:E,controls:C,reducer:Lae(e),resolvers:{}},n=(0,A.Z)(Pae,t);(0,B.register)(n)})(),(0,S.s)(Zae).render((0,Cw.jsx)(x.StrictMode,{children:(0,Cw.jsx)(jae,{})}))),window.addEventListener("DOMContentLoaded",(()=>{const e=document.querySelector("#mailpoet_form_edit");if(e){const t=(0,S.s)(e);I.default.use(I.default.createRootURLMiddleware(window.wpApiSettings.root)),I.default.use(I.default.createNonceMiddleware(window.wpApiSettings.nonce)),(0,mc.addFilter)("editor.MediaUpload","mailpoet/form-editor/replace-media-upload",(()=>Tl)),(()=>{const e=window.mailpoet_custom_fields.map((e=>({...e,params:e.params||{}}))),t=vee(U2,am.colors,am.gradients,e),n={...window.mailpoet_form_data},r=t(n.body);delete n.body;const o={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 i,a=null;if(null!==n.id)try{a=JSON.parse(window.localStorage.getItem(`mailpoet_form_preview_settings${n.id}`)),"below_post"===a.formType&&(a.formType="below_posts")}catch(e){}try{i=JSON.parse(window.localStorage.getItem("mailpoet_form_view_options"))}catch(e){i=!1}const s={editorHistory:[],editorHistoryOffset:0,formBlocks:r,formData:Cre(n),dateSettingData:o,sidebarOpened:!0,formExports:window.mailpoet_form_exports,formErrors:O5(n,r),segments:window.mailpoet_form_segments,customFields:e,isFormSaving:!1,isCustomFieldSaving:!1,isCustomFieldCreating:!1,isPreviewShown:!1,isPreviewReady:!1,isCustomFieldDeleting:!1,inserterPanel:null,notices:[],hasUnsavedChanges:!1,sidebar:{activeSidebar:"default",activeTab:"form",openedPanels:["basic-settings"]},previewSettings:a,fullscreenStatus:i,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}},l={reducer:H5(s),actions:w,selectors:$5,controls:gre,resolvers:{}},c=(0,A.Z)(H2,l);(0,B.register)(c)})(),(()=>{const e=(0,Kl.Y)(H2).getAllAvailableCustomFields();rte.supports.inserter=(0,Kl.Y)(H2).isUserAdministrator();const t=[{slug:"obligatory",title:""}];t.push({slug:"design",title:O2.MailPoet.I18n.t("layoutBlocksCategory")}),t.push({slug:"fields",title:O2.MailPoet.I18n.t("fieldsBlocksCategory")}),t.push({slug:"custom-fields",title:O2.MailPoet.I18n.t("customFieldsBlocksCategory")}),function(e){(0,Yl.W)(Vu).setCategories(e)}(t),nc("mailpoet-form/divider",Iee),nc("mailpoet-form/email-input",Pee),nc("mailpoet-form/submit-button",Oee),nc("mailpoet-form/first-name-input",Zee),nc("mailpoet-form/last-name-input",Hee),nc("mailpoet-form/segment-select",Xee),nc("mailpoet-form/html",rte),nc("mailpoet-form/add-custom-field",lte),nc(xte,Ite),nc(Bte,Mte),nc(_ne,wne),nc(ene,nne),nc(ure,pre),Array.isArray(e)&&e.forEach(hre)})(),Qm(kae,Eae),window.mailpoet_translations.forEach((e=>{const t=JSON.parse(e);t&&t.locale_data?.messages&&(0,$.setLocaleData)(t.locale_data.messages)})),(0,D2.registerTranslations)(),t.render((0,Cw.jsx)(x.StrictMode,{children:(0,Cw.jsx)(zae,{})}))}}))},5287:function(e,t){var n;!function(){"use strict";var r=function(){function e(){}function t(e,t){for(var n=t.length,r=0;r<n;++r)o(e,t[r])}e.prototype=Object.create(null);var n={}.hasOwnProperty,r=/\s+/;function o(e,o){if(o){var i=typeof o;"string"===i?function(e,t){for(var n=t.split(r),o=n.length,i=0;i<o;++i)e[n[i]]=!0}(e,o):Array.isArray(o)?t(e,o):"object"===i?function(e,t){if(t.toString===Object.prototype.toString||t.toString.toString().includes("[native code]"))for(var r in t)n.call(t,r)&&(e[r]=!!t[r]);else e[t.toString()]=!0}(e,o):"number"===i&&function(e,t){e[t]=!0}(e,o)}}return function(){for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];var i=new e;t(i,r);var a=[];for(var s in i)i[s]&&a.push(s);return a.join(" ")}}();e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},70907:function(e){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),o=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),i=/Edge\/(\d+)/.exec(e),a=r||o||i,s=a&&(r?document.documentMode||6:+(i||o)[1]),l=!i&&/WebKit\//.test(e),c=l&&/Qt\/\d+\.\d+/.test(e),u=!i&&/Chrome\//.test(e),d=/Opera\//.test(e),p=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),m=/PhantomJS/.test(e),f=p&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),g=/Android/.test(e),b=f||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),v=f||/Mac/.test(t),y=/\bCrOS\b/.test(e),_=/win/i.test(t),k=d&&e.match(/Version\/(\d*\.\d*)/);k&&(k=Number(k[1])),k&&k>=15&&(d=!1,l=!0);var w=v&&(c||d&&(null==k||k<12.11)),E=n||a&&s>=9;function C(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var x,S=function(e,t){var n=e.className,r=C(t).exec(n);if(r){var o=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(o?r[1]+o:"")}};function I(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function T(e,t){return I(e).appendChild(t)}function N(e,t,n,r){var o=document.createElement(e);if(n&&(o.className=n),r&&(o.style.cssText=r),"string"==typeof t)o.appendChild(document.createTextNode(t));else if(t)for(var i=0;i<t.length;++i)o.appendChild(t[i]);return o}function P(e,t,n,r){var o=N(e,t,n,r);return o.setAttribute("role","presentation"),o}function R(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function A(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function B(e,t){var n=e.className;C(t).test(n)||(e.className+=(n?" ":"")+t)}function L(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!C(n[r]).test(t)&&(t+=" "+n[r]);return t}x=document.createRange?function(e,t,n,r){var o=document.createRange();return o.setEnd(r||e,n),o.setStart(e,t),o}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(e){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var M=function(e){e.select()};function D(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function O(e,t,n){for(var r in t||(t={}),e)!e.hasOwnProperty(r)||!1===n&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function F(e,t,n,r,o){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var i=r||0,a=o||0;;){var s=e.indexOf("\t",i);if(s<0||s>=t)return a+(t-i);a+=s-i,a+=n-a%n,i=s+1}}f?M=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(M=function(e){try{e.select()}catch(e){}});var j=function(){this.id=null,this.f=null,this.time=0,this.handler=D(this.onTimeout,this)};function Z(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}j.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},j.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};var z=50,V={toString:function(){return"CodeMirror.Pass"}},H={scroll:!1},U={origin:"*mouse"},$={origin:"+move"};function W(e,t,n){for(var r=0,o=0;;){var i=e.indexOf("\t",r);-1==i&&(i=e.length);var a=i-r;if(i==e.length||o+a>=t)return r+Math.min(a,t-o);if(o+=i-r,r=i+1,(o+=n-o%n)>=t)return r}}var G=[""];function q(e){for(;G.length<=e;)G.push(K(G)+" ");return G[e]}function K(e){return e[e.length-1]}function Y(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function X(){}function J(e,t){var n;return Object.create?n=Object.create(e):(X.prototype=e,n=new X),t&&O(t,n),n}var Q=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ee(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||Q.test(e))}function te(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ee(e))||t.test(e):ee(e)}function ne(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var re=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function oe(e){return e.charCodeAt(0)>=768&&re.test(e)}function ie(e,t,n){for(;(n<0?t>0:t<e.length)&&oe(e.charAt(t));)t+=n;return t}function ae(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var o=(t+n)/2,i=r<0?Math.ceil(o):Math.floor(o);if(i==t)return e(i)?t:n;e(i)?n=i:t=i+r}}var se=null;function le(e,t,n){var r;se=null;for(var o=0;o<e.length;++o){var i=e[o];if(i.from<t&&i.to>t)return o;i.to==t&&(i.from!=i.to&&"before"==n?r=o:se=o),i.from==t&&(i.from!=i.to&&"before"!=n?r=o:se=o)}return null!=r?r:se}var ce=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,n=/[LRr]/,r=/[Lb1n]/,o=/[1n]/;function i(e,t,n){this.level=e,this.from=t,this.to=n}return function(a,s){var l,c="ltr"==s?"L":"R";if(0==a.length||"ltr"==s&&!e.test(a))return!1;for(var u=a.length,d=[],p=0;p<u;++p)d.push((l=a.charCodeAt(p))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(l):1424<=l&&l<=1524?"R":1536<=l&&l<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(l-1536):1774<=l&&l<=2220?"r":8192<=l&&l<=8203?"w":8204==l?"b":"L");for(var h=0,m=c;h<u;++h){var f=d[h];"m"==f?d[h]=m:m=f}for(var g=0,b=c;g<u;++g){var v=d[g];"1"==v&&"r"==b?d[g]="n":n.test(v)&&(b=v,"r"==v&&(d[g]="R"))}for(var y=1,_=d[0];y<u-1;++y){var k=d[y];"+"==k&&"1"==_&&"1"==d[y+1]?d[y]="1":","!=k||_!=d[y+1]||"1"!=_&&"n"!=_||(d[y]=_),_=k}for(var w=0;w<u;++w){var E=d[w];if(","==E)d[w]="N";else if("%"==E){var C=void 0;for(C=w+1;C<u&&"%"==d[C];++C);for(var x=w&&"!"==d[w-1]||C<u&&"1"==d[C]?"1":"N",S=w;S<C;++S)d[S]=x;w=C-1}}for(var I=0,T=c;I<u;++I){var N=d[I];"L"==T&&"1"==N?d[I]="L":n.test(N)&&(T=N)}for(var P=0;P<u;++P)if(t.test(d[P])){var R=void 0;for(R=P+1;R<u&&t.test(d[R]);++R);for(var A="L"==(P?d[P-1]:c),B=A==("L"==(R<u?d[R]:c))?A?"L":"R":c,L=P;L<R;++L)d[L]=B;P=R-1}for(var M,D=[],O=0;O<u;)if(r.test(d[O])){var F=O;for(++O;O<u&&r.test(d[O]);++O);D.push(new i(0,F,O))}else{var j=O,Z=D.length,z="rtl"==s?1:0;for(++O;O<u&&"L"!=d[O];++O);for(var V=j;V<O;)if(o.test(d[V])){j<V&&(D.splice(Z,0,new i(1,j,V)),Z+=z);var H=V;for(++V;V<O&&o.test(d[V]);++V);D.splice(Z,0,new i(2,H,V)),Z+=z,j=V}else++V;j<O&&D.splice(Z,0,new i(1,j,O))}return"ltr"==s&&(1==D[0].level&&(M=a.match(/^\s+/))&&(D[0].from=M[0].length,D.unshift(new i(0,0,M[0].length))),1==K(D).level&&(M=a.match(/\s+$/))&&(K(D).to-=M[0].length,D.push(new i(0,u-M[0].length,u)))),"rtl"==s?D.reverse():D}}();function ue(e,t){var n=e.order;return null==n&&(n=e.order=ce(e.text,t)),n}var de=[],pe=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||de).concat(n)}};function he(e,t){return e._handlers&&e._handlers[t]||de}function me(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,o=r&&r[t];if(o){var i=Z(o,n);i>-1&&(r[t]=o.slice(0,i).concat(o.slice(i+1)))}}}function fe(e,t){var n=he(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),o=0;o<n.length;++o)n[o].apply(null,r)}function ge(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),fe(e,n||t.type,e,t),we(t)||t.codemirrorIgnore}function be(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==Z(n,t[r])&&n.push(t[r])}function ve(e,t){return he(e,t).length>0}function ye(e){e.prototype.on=function(e,t){pe(this,e,t)},e.prototype.off=function(e,t){me(this,e,t)}}function _e(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ke(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function we(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Ee(e){_e(e),ke(e)}function Ce(e){return e.target||e.srcElement}function xe(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),v&&e.ctrlKey&&1==t&&(t=3),t}var Se,Ie,Te=function(){if(a&&s<9)return!1;var e=N("div");return"draggable"in e||"dragDrop"in e}();function Ne(e){if(null==Se){var t=N("span","");T(e,N("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Se=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var n=Se?N("span",""):N("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Pe(e){if(null!=Ie)return Ie;var t=T(e,document.createTextNode("AخA")),n=x(t,0,1).getBoundingClientRect(),r=x(t,1,2).getBoundingClientRect();return I(e),!(!n||n.left==n.right)&&(Ie=r.right-n.right<3)}var Re,Ae=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var o=e.indexOf("\n",t);-1==o&&(o=e.length);var i=e.slice(t,"\r"==e.charAt(o-1)?o-1:o),a=i.indexOf("\r");-1!=a?(n.push(i.slice(0,a)),t+=a+1):(n.push(i),t=o+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Be=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Le="oncopy"in(Re=N("div"))||(Re.setAttribute("oncopy","return;"),"function"==typeof Re.oncopy),Me=null;var De={},Oe={};function Fe(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),De[e]=t}function je(e){if("string"==typeof e&&Oe.hasOwnProperty(e))e=Oe[e];else if(e&&"string"==typeof e.name&&Oe.hasOwnProperty(e.name)){var t=Oe[e.name];"string"==typeof t&&(t={name:t}),(e=J(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return je("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return je("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ze(e,t){t=je(t);var n=De[t.name];if(!n)return Ze(e,"text/plain");var r=n(e,t);if(ze.hasOwnProperty(t.name)){var o=ze[t.name];for(var i in o)o.hasOwnProperty(i)&&(r.hasOwnProperty(i)&&(r["_"+i]=r[i]),r[i]=o[i])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var ze={};function Ve(e,t){O(t,ze.hasOwnProperty(e)?ze[e]:ze[e]={})}function He(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var o=t[r];o instanceof Array&&(o=o.concat([])),n[r]=o}return n}function Ue(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function $e(e,t,n){return!e.startState||e.startState(t,n)}var We=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Ge(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var o=n.children[r],i=o.chunkSize();if(t<i){n=o;break}t-=i}return n.lines[t]}function qe(e,t,n){var r=[],o=t.line;return e.iter(t.line,n.line+1,(function(e){var i=e.text;o==n.line&&(i=i.slice(0,n.ch)),o==t.line&&(i=i.slice(t.ch)),r.push(i),++o})),r}function Ke(e,t,n){var r=[];return e.iter(t,n,(function(e){r.push(e.text)})),r}function Ye(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function Xe(e){if(null==e.parent)return null;for(var t=e.parent,n=Z(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var o=0;r.children[o]!=t;++o)n+=r.children[o].chunkSize();return n+t.first}function Je(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var o=e.children[r],i=o.height;if(t<i){e=o;continue e}t-=i,n+=o.chunkSize()}return n}while(!e.lines);for(var a=0;a<e.lines.length;++a){var s=e.lines[a].height;if(t<s)break;t-=s}return n+a}function Qe(e,t){return t>=e.first&&t<e.first+e.size}function et(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function tt(e,t,n){if(void 0===n&&(n=null),!(this instanceof tt))return new tt(e,t,n);this.line=e,this.ch=t,this.sticky=n}function nt(e,t){return e.line-t.line||e.ch-t.ch}function rt(e,t){return e.sticky==t.sticky&&0==nt(e,t)}function ot(e){return tt(e.line,e.ch)}function it(e,t){return nt(e,t)<0?t:e}function at(e,t){return nt(e,t)<0?e:t}function st(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function lt(e,t){if(t.line<e.first)return tt(e.first,0);var n=e.first+e.size-1;return t.line>n?tt(n,Ge(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?tt(e.line,t):n<0?tt(e.line,0):e}(t,Ge(e,t.line).text.length)}function ct(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=lt(e,t[r]);return n}We.prototype.eol=function(){return this.pos>=this.string.length},We.prototype.sol=function(){return this.pos==this.lineStart},We.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},We.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},We.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},We.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},We.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},We.prototype.skipToEnd=function(){this.pos=this.string.length},We.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},We.prototype.backUp=function(e){this.pos-=e},We.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=F(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},We.prototype.indentation=function(){return F(this.string,null,this.tabSize)-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},We.prototype.match=function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var o=function(e){return n?e.toLowerCase():e};if(o(this.string.substr(this.pos,e.length))==o(e))return!1!==t&&(this.pos+=e.length),!0},We.prototype.current=function(){return this.string.slice(this.start,this.pos)},We.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},We.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},We.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ut=function(e,t){this.state=e,this.lookAhead=t},dt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function pt(e,t,n,r){var o=[e.state.modeGen],i={};kt(e,t.text,e.doc.mode,n,(function(e,t){return o.push(e,t)}),i,r);for(var a=n.state,s=function(r){n.baseTokens=o;var s=e.state.overlays[r],l=1,c=0;n.state=!0,kt(e,t.text,s.mode,n,(function(e,t){for(var n=l;c<e;){var r=o[l];r>e&&o.splice(l,1,e,o[l+1],r),l+=2,c=Math.min(e,r)}if(t)if(s.opaque)o.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;n<l;n+=2){var i=o[n+1];o[n+1]=(i?i+" ":"")+"overlay "+t}}),i),n.state=a,n.baseTokens=null,n.baseTokenPos=1},l=0;l<e.state.overlays.length;++l)s(l);return{styles:o,classes:i.bgClass||i.textClass?i:null}}function ht(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=mt(e,Xe(t)),o=t.text.length>e.options.maxHighlightLength&&He(e.doc.mode,r.state),i=pt(e,t,r);o&&(r.state=o),t.stateAfter=r.save(!o),t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function mt(e,t,n){var r=e.doc,o=e.display;if(!r.mode.startState)return new dt(r,!0,t);var i=function(e,t,n){for(var r,o,i=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=i.first)return i.first;var l=Ge(i,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof ut?c.lookAhead:0)<=i.modeFrontier))return s;var u=F(l.text,null,e.options.tabSize);(null==o||r>u)&&(o=s-1,r=u)}return o}(e,t,n),a=i>r.first&&Ge(r,i-1).stateAfter,s=a?dt.fromSaved(r,a,i):new dt(r,$e(r.mode),i);return r.iter(i,t,(function(n){ft(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=o.viewFrom&&r<o.viewTo?s.save():null,s.nextLine()})),n&&(r.modeFrontier=s.line),s}function ft(e,t,n,r){var o=e.doc.mode,i=new We(t,e.options.tabSize,n);for(i.start=i.pos=r||0,""==t&>(o,n.state);!i.eol();)bt(o,i,n.state),i.start=i.pos}function gt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=Ue(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function bt(e,t,n,r){for(var o=0;o<10;o++){r&&(r[0]=Ue(e,n).mode);var i=e.token(t,n);if(t.pos>t.start)return i}throw new Error("Mode "+e.name+" failed to advance stream.")}dt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},dt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},dt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},dt.fromSaved=function(e,t,n){return t instanceof ut?new dt(e,He(e.mode,t.state),n,t.lookAhead):new dt(e,He(e.mode,t),n)},dt.prototype.save=function(e){var t=!1!==e?He(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ut(t,this.maxLookAhead):t};var vt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function yt(e,t,n,r){var o,i,a=e.doc,s=a.mode,l=Ge(a,(t=lt(a,t)).line),c=mt(e,t.line,n),u=new We(l.text,e.options.tabSize,c);for(r&&(i=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,o=bt(s,u,c.state),r&&i.push(new vt(u,o,He(a.mode,c.state)));return r?i:new vt(u,o,c.state)}function _t(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function kt(e,t,n,r,o,i,a){var s=n.flattenSpans;null==s&&(s=e.options.flattenSpans);var l,c=0,u=null,d=new We(t,e.options.tabSize,r),p=e.options.addModeClass&&[null];for(""==t&&_t(gt(n,r.state),i);!d.eol();){if(d.pos>e.options.maxHighlightLength?(s=!1,a&&ft(e,t,r,d.pos),d.pos=t.length,l=null):l=_t(bt(n,d,r.state,p),i),p){var h=p[0].name;h&&(l="m-"+(l?h+" "+l:h))}if(!s||u!=l){for(;c<d.start;)o(c=Math.min(d.start,c+5e3),u);u=l}d.start=d.pos}for(;c<d.pos;){var m=Math.min(d.pos,c+5e3);o(m,u),c=m}}var wt=!1,Et=!1;function Ct(e,t,n){this.marker=e,this.from=t,this.to=n}function xt(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function St(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function It(e,t){if(t.full)return null;var n=Qe(e,t.from.line)&&Ge(e,t.from.line).markedSpans,r=Qe(e,t.to.line)&&Ge(e,t.to.line).markedSpans;if(!n&&!r)return null;var o=t.from.ch,i=t.to.ch,a=0==nt(t.from,t.to),s=function(e,t,n){var r;if(e)for(var o=0;o<e.length;++o){var i=e[o],a=i.marker;if(null==i.from||(a.inclusiveLeft?i.from<=t:i.from<t)||i.from==t&&"bookmark"==a.type&&(!n||!i.marker.insertLeft)){var s=null==i.to||(a.inclusiveRight?i.to>=t:i.to>t);(r||(r=[])).push(new Ct(a,i.from,s?null:i.to))}}return r}(n,o,a),l=function(e,t,n){var r;if(e)for(var o=0;o<e.length;++o){var i=e[o],a=i.marker;if(null==i.to||(a.inclusiveRight?i.to>=t:i.to>t)||i.from==t&&"bookmark"==a.type&&(!n||i.marker.insertLeft)){var s=null==i.from||(a.inclusiveLeft?i.from<=t:i.from<t);(r||(r=[])).push(new Ct(a,s?null:i.from-t,null==i.to?null:i.to-t))}}return r}(r,i,a),c=1==t.text.length,u=K(t.text).length+(c?o:0);if(s)for(var d=0;d<s.length;++d){var p=s[d];if(null==p.to){var h=xt(l,p.marker);h?c&&(p.to=null==h.to?null:h.to+u):p.to=o}}if(l)for(var m=0;m<l.length;++m){var f=l[m];null!=f.to&&(f.to+=u),null==f.from?xt(s,f.marker)||(f.from=u,c&&(s||(s=[])).push(f)):(f.from+=u,c&&(s||(s=[])).push(f))}s&&(s=Tt(s)),l&&l!=s&&(l=Tt(l));var g=[s];if(!c){var b,v=t.text.length-2;if(v>0&&s)for(var y=0;y<s.length;++y)null==s[y].to&&(b||(b=[])).push(new Ct(s[y].marker,null,null));for(var _=0;_<v;++_)g.push(b);g.push(l)}return g}function Tt(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Nt(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Pt(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Rt(e){return e.inclusiveLeft?-1:0}function At(e){return e.inclusiveRight?1:0}function Bt(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),o=t.find(),i=nt(r.from,o.from)||Rt(e)-Rt(t);return i?-i:nt(r.to,o.to)||At(e)-At(t)||t.id-e.id}function Lt(e,t){var n,r=Et&&e.markedSpans;if(r)for(var o=void 0,i=0;i<r.length;++i)(o=r[i]).marker.collapsed&&null==(t?o.from:o.to)&&(!n||Bt(n,o.marker)<0)&&(n=o.marker);return n}function Mt(e){return Lt(e,!0)}function Dt(e){return Lt(e,!1)}function Ot(e,t){var n,r=Et&&e.markedSpans;if(r)for(var o=0;o<r.length;++o){var i=r[o];i.marker.collapsed&&(null==i.from||i.from<t)&&(null==i.to||i.to>t)&&(!n||Bt(n,i.marker)<0)&&(n=i.marker)}return n}function Ft(e,t,n,r,o){var i=Ge(e,t),a=Et&&i.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(l.marker.collapsed){var c=l.marker.find(0),u=nt(c.from,n)||Rt(l.marker)-Rt(o),d=nt(c.to,r)||At(l.marker)-At(o);if(!(u>=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(l.marker.inclusiveRight&&o.inclusiveLeft?nt(c.to,n)>=0:nt(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&o.inclusiveLeft?nt(c.from,r)<=0:nt(c.from,r)<0)))return!0}}}function jt(e){for(var t;t=Mt(e);)e=t.find(-1,!0).line;return e}function Zt(e,t){var n=Ge(e,t),r=jt(n);return n==r?t:Xe(r)}function zt(e,t){if(t>e.lastLine())return t;var n,r=Ge(e,t);if(!Vt(e,r))return t;for(;n=Dt(r);)r=n.find(1,!0).line;return Xe(r)+1}function Vt(e,t){var n=Et&&t.markedSpans;if(n)for(var r=void 0,o=0;o<n.length;++o)if((r=n[o]).marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&Ht(e,t,r))return!0}}function Ht(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return Ht(e,r.line,xt(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var o=void 0,i=0;i<t.markedSpans.length;++i)if((o=t.markedSpans[i]).marker.collapsed&&!o.marker.widgetNode&&o.from==n.to&&(null==o.to||o.to!=n.from)&&(o.marker.inclusiveLeft||n.marker.inclusiveRight)&&Ht(e,t,o))return!0}function Ut(e){for(var t=0,n=(e=jt(e)).parent,r=0;r<n.lines.length;++r){var o=n.lines[r];if(o==e)break;t+=o.height}for(var i=n.parent;i;i=(n=i).parent)for(var a=0;a<i.children.length;++a){var s=i.children[a];if(s==n)break;t+=s.height}return t}function $t(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=Mt(r);){var o=t.find(0,!0);r=o.from.line,n+=o.from.ch-o.to.ch}for(r=e;t=Dt(r);){var i=t.find(0,!0);n-=r.text.length-i.from.ch,n+=(r=i.to.line).text.length-i.to.ch}return n}function Wt(e){var t=e.display,n=e.doc;t.maxLine=Ge(n,n.first),t.maxLineLength=$t(t.maxLine),t.maxLineChanged=!0,n.iter((function(e){var n=$t(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var Gt=function(e,t,n){this.text=e,Pt(this,t),this.height=n?n(this):1};function qt(e){e.parent=null,Nt(e)}Gt.prototype.lineNo=function(){return Xe(this)},ye(Gt);var Kt={},Yt={};function Xt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Yt:Kt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Jt(e,t){var n=P("span",null,null,l?"padding-right: .1px":null),r={pre:P("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var i=o?t.rest[o-1]:t.line,a=void 0;r.pos=0,r.addToken=en,Pe(e.display.measure)&&(a=ue(i,e.doc.direction))&&(r.addToken=tn(r.addToken,a)),r.map=[],rn(i,r,ht(e,i,t!=e.display.externalMeasured&&Xe(i))),i.styleClasses&&(i.styleClasses.bgClass&&(r.bgClass=L(i.styleClasses.bgClass,r.bgClass||"")),i.styleClasses.textClass&&(r.textClass=L(i.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Ne(e.display.measure))),0==o?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(l){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return fe(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=L(r.pre.className,r.textClass||"")),r}function Qt(e){var t=N("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function en(e,t,n,r,o,i,l){if(t){var c,u=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",o=0;o<e.length;o++){var i=e.charAt(o);" "!=i||!n||o!=e.length-1&&32!=e.charCodeAt(o+1)||(i=" "),r+=i,n=" "==i}return r}(t,e.trailingSpace):t,d=e.cm.state.specialChars,p=!1;if(d.test(t)){c=document.createDocumentFragment();for(var h=0;;){d.lastIndex=h;var m=d.exec(t),f=m?m.index-h:t.length-h;if(f){var g=document.createTextNode(u.slice(h,h+f));a&&s<9?c.appendChild(N("span",[g])):c.appendChild(g),e.map.push(e.pos,e.pos+f,g),e.col+=f,e.pos+=f}if(!m)break;h+=f+1;var b=void 0;if("\t"==m[0]){var v=e.cm.options.tabSize,y=v-e.col%v;(b=c.appendChild(N("span",q(y),"cm-tab"))).setAttribute("role","presentation"),b.setAttribute("cm-text","\t"),e.col+=y}else"\r"==m[0]||"\n"==m[0]?((b=c.appendChild(N("span","\r"==m[0]?"␍":"","cm-invalidchar"))).setAttribute("cm-text",m[0]),e.col+=1):((b=e.cm.options.specialCharPlaceholder(m[0])).setAttribute("cm-text",m[0]),a&&s<9?c.appendChild(N("span",[b])):c.appendChild(b),e.col+=1);e.map.push(e.pos,e.pos+1,b),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),a&&s<9&&(p=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),n||r||o||p||i||l){var _=n||"";r&&(_+=r),o&&(_+=o);var k=N("span",[c],_,i);if(l)for(var w in l)l.hasOwnProperty(w)&&"style"!=w&&"class"!=w&&k.setAttribute(w,l[w]);return e.content.appendChild(k)}e.content.appendChild(c)}}function tn(e,t){return function(n,r,o,i,a,s,l){o=o?o+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+r.length;;){for(var d=void 0,p=0;p<t.length&&!((d=t[p]).to>c&&d.from<=c);p++);if(d.to>=u)return e(n,r,o,i,a,s,l);e(n,r.slice(0,d.to-c),o,i,null,s,l),i=null,r=r.slice(d.to-c),c=d.to}}}function nn(e,t,n,r){var o=!r&&n.widgetNode;o&&e.map.push(e.pos,e.pos+t,o),!r&&e.cm.display.input.needsContentAttribute&&(o||(o=e.content.appendChild(document.createElement("span"))),o.setAttribute("cm-marker",n.id)),o&&(e.cm.display.input.setUneditable(o),e.content.appendChild(o)),e.pos+=t,e.trailingSpace=!1}function rn(e,t,n){var r=e.markedSpans,o=e.text,i=0;if(r)for(var a,s,l,c,u,d,p,h=o.length,m=0,f=1,g="",b=0;;){if(b==m){l=c=u=s="",p=null,d=null,b=1/0;for(var v=[],y=void 0,_=0;_<r.length;++_){var k=r[_],w=k.marker;if("bookmark"==w.type&&k.from==m&&w.widgetNode)v.push(w);else if(k.from<=m&&(null==k.to||k.to>m||w.collapsed&&k.to==m&&k.from==m)){if(null!=k.to&&k.to!=m&&b>k.to&&(b=k.to,c=""),w.className&&(l+=" "+w.className),w.css&&(s=(s?s+";":"")+w.css),w.startStyle&&k.from==m&&(u+=" "+w.startStyle),w.endStyle&&k.to==b&&(y||(y=[])).push(w.endStyle,k.to),w.title&&((p||(p={})).title=w.title),w.attributes)for(var E in w.attributes)(p||(p={}))[E]=w.attributes[E];w.collapsed&&(!d||Bt(d.marker,w)<0)&&(d=k)}else k.from>m&&b>k.from&&(b=k.from)}if(y)for(var C=0;C<y.length;C+=2)y[C+1]==b&&(c+=" "+y[C]);if(!d||d.from==m)for(var x=0;x<v.length;++x)nn(t,0,v[x]);if(d&&(d.from||0)==m){if(nn(t,(null==d.to?h+1:d.to)-m,d.marker,null==d.from),null==d.to)return;d.to==m&&(d=!1)}}if(m>=h)break;for(var S=Math.min(h,b);;){if(g){var I=m+g.length;if(!d){var T=I>S?g.slice(0,S-m):g;t.addToken(t,T,a?a+l:l,u,m+T.length==b?c:"",s,p)}if(I>=S){g=g.slice(S-m),m=S;break}m=I,u=""}g=o.slice(i,i=n[f++]),a=Xt(n[f++],t.cm.options)}}else for(var N=1;N<n.length;N+=2)t.addToken(t,o.slice(i,i=n[N]),Xt(n[N+1],t.cm.options))}function on(e,t,n){this.line=t,this.rest=function(e){for(var t,n;t=Dt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}(t),this.size=this.rest?Xe(K(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Vt(e,t)}function an(e,t,n){for(var r,o=[],i=t;i<n;i=r){var a=new on(e.doc,Ge(e.doc,i),i);r=i+a.size,o.push(a)}return o}var sn=null;var ln=null;function cn(e,t){var n=he(e,t);if(n.length){var r,o=Array.prototype.slice.call(arguments,2);sn?r=sn.delayedCallbacks:ln?r=ln:(r=ln=[],setTimeout(un,0));for(var i=function(e){r.push((function(){return n[e].apply(null,o)}))},a=0;a<n.length;++a)i(a)}}function un(){var e=ln;ln=null;for(var t=0;t<e.length;++t)e[t]()}function dn(e,t,n,r){for(var o=0;o<t.changes.length;o++){var i=t.changes[o];"text"==i?mn(e,t):"gutter"==i?gn(e,t,n,r):"class"==i?fn(e,t):"widget"==i&&bn(e,t,r)}t.changes=null}function pn(e){return e.node==e.text&&(e.node=N("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),a&&s<8&&(e.node.style.zIndex=2)),e.node}function hn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Jt(e,t)}function mn(e,t){var n=t.text.className,r=hn(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,fn(e,t)):n&&(t.text.className=n)}function fn(e,t){(function(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=pn(t);t.background=r.insertBefore(N("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}})(e,t),t.line.wrapClass?pn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function gn(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var o=pn(t);t.gutterBackground=N("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),o.insertBefore(t.gutterBackground,t.text)}var i=t.line.gutterMarkers;if(e.options.lineNumbers||i){var a=pn(t),s=t.gutter=N("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(s.setAttribute("aria-hidden","true"),e.display.input.setUneditable(s),a.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||i&&i["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(N("div",et(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),i)for(var l=0;l<e.display.gutterSpecs.length;++l){var c=e.display.gutterSpecs[l].className,u=i.hasOwnProperty(c)&&i[c];u&&s.appendChild(N("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[c]+"px; width: "+r.gutterWidth[c]+"px"))}}}function bn(e,t,n){t.alignable&&(t.alignable=null);for(var r=C("CodeMirror-linewidget"),o=t.node.firstChild,i=void 0;o;o=i)i=o.nextSibling,r.test(o.className)&&t.node.removeChild(o);yn(e,t,n)}function vn(e,t,n,r){var o=hn(e,t);return t.text=t.node=o.pre,o.bgClass&&(t.bgClass=o.bgClass),o.textClass&&(t.textClass=o.textClass),fn(e,t),gn(e,t,n,r),yn(e,t,r),t.node}function yn(e,t,n){if(_n(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)_n(e,t.rest[r],t,n,!1)}function _n(e,t,n,r,o){if(t.widgets)for(var i=pn(n),a=0,s=t.widgets;a<s.length;++a){var l=s[a],c=N("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),kn(l,c,n,r),e.display.input.setUneditable(c),o&&l.above?i.insertBefore(c,n.gutter||n.text):i.appendChild(c),cn(l,"redraw")}}function kn(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var o=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(o-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=o+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function wn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!R(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),T(t.display.measure,N("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function En(e,t){for(var n=Ce(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Cn(e){return e.lineSpace.offsetTop}function xn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Sn(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=T(e.measure,N("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function In(e){return z-e.display.nativeBarWidth}function Tn(e){return e.display.scroller.clientWidth-In(e)-e.display.barWidth}function Nn(e){return e.display.scroller.clientHeight-In(e)-e.display.barHeight}function Pn(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var o=0;o<e.rest.length;o++)if(Xe(e.rest[o])>n)return{map:e.measure.maps[o],cache:e.measure.caches[o],before:!0}}}function Rn(e,t,n,r){return Ln(e,Bn(e,t),n,r)}function An(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[dr(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function Bn(e,t){var n=Xe(t),r=An(e,n);r&&!r.text?r=null:r&&r.changes&&(dn(e,r,n,ar(e)),e.curOp.forceUpdate=!0),r||(r=function(e,t){var n=Xe(t=jt(t)),r=e.display.externalMeasured=new on(e.doc,t,n);r.lineN=n;var o=r.built=Jt(e,r);return r.text=o.pre,T(e.display.lineMeasure,o.pre),r}(e,t));var o=Pn(r,t,n);return{line:t,view:r,rect:null,map:o.map,cache:o.cache,before:o.before,hasHeights:!1}}function Ln(e,t,n,r,o){t.before&&(n=-1);var i,l=n+(r||"");return t.cache.hasOwnProperty(l)?i=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,n){var r=e.options.lineWrapping,o=r&&Tn(e);if(!t.measure.heights||r&&t.measure.width!=o){var i=t.measure.heights=[];if(r){t.measure.width=o;for(var a=t.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var l=a[s],c=a[s+1];Math.abs(l.bottom-c.bottom)>2&&i.push((l.bottom+c.top)/2-n.top)}}i.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(i=function(e,t,n,r){var o,i=On(t.map,n,r),l=i.node,c=i.start,u=i.end,d=i.collapse;if(3==l.nodeType){for(var p=0;p<4;p++){for(;c&&oe(t.line.text.charAt(i.coverStart+c));)--c;for(;i.coverStart+u<i.coverEnd&&oe(t.line.text.charAt(i.coverStart+u));)++u;if((o=a&&s<9&&0==c&&u==i.coverEnd-i.coverStart?l.parentNode.getBoundingClientRect():Fn(x(l,c,u).getClientRects(),r)).left||o.right||0==c)break;u=c,c-=1,d="right"}a&&s<11&&(o=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=Me)return Me;var t=T(e,N("span","x")),n=t.getBoundingClientRect(),r=x(t,0,1).getBoundingClientRect();return Me=Math.abs(n.left-r.left)>1}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}(e.display.measure,o))}else{var h;c>0&&(d=r="right"),o=e.options.lineWrapping&&(h=l.getClientRects()).length>1?h["right"==r?h.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!c&&(!o||!o.left&&!o.right)){var m=l.parentNode.getClientRects()[0];o=m?{left:m.left,right:m.left+ir(e.display),top:m.top,bottom:m.bottom}:Dn}for(var f=o.top-t.rect.top,g=o.bottom-t.rect.top,b=(f+g)/2,v=t.view.measure.heights,y=0;y<v.length-1&&!(b<v[y]);y++);var _=y?v[y-1]:0,k=v[y],w={left:("right"==d?o.right:o.left)-t.rect.left,right:("left"==d?o.left:o.right)-t.rect.left,top:_,bottom:k};return o.left||o.right||(w.bogus=!0),e.options.singleCursorHeightPerLine||(w.rtop=f,w.rbottom=g),w}(e,t,n,r)).bogus||(t.cache[l]=i)),{left:i.left,right:i.right,top:o?i.rtop:i.top,bottom:o?i.rbottom:i.bottom}}var Mn,Dn={left:0,right:0,top:0,bottom:0};function On(e,t,n){for(var r,o,i,a,s,l,c=0;c<e.length;c+=3)if(s=e[c],l=e[c+1],t<s?(o=0,i=1,a="left"):t<l?i=1+(o=t-s):(c==e.length-3||t==l&&e[c+3]>t)&&(o=(i=l-s)-1,t>=l&&(a="right")),null!=o){if(r=e[c+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==o)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[2+(c-=3)],a="left";if("right"==n&&o==l-s)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)r=e[(c+=3)+2],a="right";break}return{node:r,start:o,end:i,collapse:a,coverStart:s,coverEnd:l}}function Fn(e,t){var n=Dn;if("left"==t)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var o=e.length-1;o>=0&&(n=e[o]).left==n.right;o--);return n}function jn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Zn(e){e.display.externalMeasure=null,I(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)jn(e.display.view[t])}function zn(e){Zn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Vn(){return u&&g?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Hn(){return u&&g?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Un(e){var t=jt(e).widgets,n=0;if(t)for(var r=0;r<t.length;++r)t[r].above&&(n+=wn(t[r]));return n}function $n(e,t,n,r,o){if(!o){var i=Un(t);n.top+=i,n.bottom+=i}if("line"==r)return n;r||(r="local");var a=Ut(t);if("local"==r?a+=Cn(e.display):a-=e.display.viewOffset,"page"==r||"window"==r){var s=e.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==r?0:Hn());var l=s.left+("window"==r?0:Vn());n.left+=l,n.right+=l}return n.top+=a,n.bottom+=a,n}function Wn(e,t,n){if("div"==n)return t;var r=t.left,o=t.top;if("page"==n)r-=Vn(),o-=Hn();else if("local"==n||!n){var i=e.display.sizer.getBoundingClientRect();r+=i.left,o+=i.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:o-a.top}}function Gn(e,t,n,r,o){return r||(r=Ge(e.doc,t.line)),$n(e,r,Rn(e,r,t.ch,o),n)}function qn(e,t,n,r,o,i){function a(t,a){var s=Ln(e,o,t,a?"right":"left",i);return a?s.left=s.right:s.right=s.left,$n(e,r,s,n)}r=r||Ge(e.doc,t.line),o||(o=Bn(e,r));var s=ue(r,e.doc.direction),l=t.ch,c=t.sticky;if(l>=r.text.length?(l=r.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return a("before"==c?l-1:l,"before"==c);function u(e,t,n){return a(n?e-1:e,1==s[t].level!=n)}var d=le(s,l,c),p=se,h=u(l,d,"before"==c);return null!=p&&(h.other=u(l,p,"before"!=c)),h}function Kn(e,t){var n=0;t=lt(e.doc,t),e.options.lineWrapping||(n=ir(e.display)*t.ch);var r=Ge(e.doc,t.line),o=Ut(r)+Cn(e.display);return{left:n,right:n,top:o,bottom:o+r.height}}function Yn(e,t,n,r,o){var i=tt(e,t,n);return i.xRel=o,r&&(i.outside=r),i}function Xn(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return Yn(r.first,0,null,-1,-1);var o=Je(r,n),i=r.first+r.size-1;if(o>i)return Yn(r.first+r.size-1,Ge(r,i).text.length,null,1,1);t<0&&(t=0);for(var a=Ge(r,o);;){var s=tr(e,a,o,t,n),l=Ot(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var c=l.find(1);if(c.line==o)return c;a=Ge(r,o=c.line)}}function Jn(e,t,n,r){r-=Un(t);var o=t.text.length,i=ae((function(t){return Ln(e,n,t-1).bottom<=r}),o,0);return{begin:i,end:o=ae((function(t){return Ln(e,n,t).top>r}),i,o)}}function Qn(e,t,n,r){return n||(n=Bn(e,t)),Jn(e,t,n,$n(e,t,Ln(e,n,r),"line").top)}function er(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function tr(e,t,n,r,o){o-=Ut(t);var i=Bn(e,t),a=Un(t),s=0,l=t.text.length,c=!0,u=ue(t,e.doc.direction);if(u){var d=(e.options.lineWrapping?rr:nr)(e,t,n,i,u,r,o);s=(c=1!=d.level)?d.from:d.to-1,l=c?d.to:d.from-1}var p,h,m=null,f=null,g=ae((function(t){var n=Ln(e,i,t);return n.top+=a,n.bottom+=a,!!er(n,r,o,!1)&&(n.top<=o&&n.left<=r&&(m=t,f=n),!0)}),s,l),b=!1;if(f){var v=r-f.left<f.right-r,y=v==c;g=m+(y?0:1),h=y?"after":"before",p=v?f.left:f.right}else{c||g!=l&&g!=s||g++,h=0==g?"after":g==t.text.length?"before":Ln(e,i,g-(c?1:0)).bottom+a<=o==c?"after":"before";var _=qn(e,tt(n,g,h),"line",t,i);p=_.left,b=o<_.top?-1:o>=_.bottom?1:0}return Yn(n,g=ie(t.text,g,1),h,b,r-p)}function nr(e,t,n,r,o,i,a){var s=ae((function(s){var l=o[s],c=1!=l.level;return er(qn(e,tt(n,c?l.to:l.from,c?"before":"after"),"line",t,r),i,a,!0)}),0,o.length-1),l=o[s];if(s>0){var c=1!=l.level,u=qn(e,tt(n,c?l.from:l.to,c?"after":"before"),"line",t,r);er(u,i,a,!0)&&u.top>a&&(l=o[s-1])}return l}function rr(e,t,n,r,o,i,a){var s=Jn(e,t,r,a),l=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,d=null,p=0;p<o.length;p++){var h=o[p];if(!(h.from>=c||h.to<=l)){var m=Ln(e,r,1!=h.level?Math.min(c,h.to)-1:Math.max(l,h.from)).right,f=m<i?i-m+1e9:m-i;(!u||d>f)&&(u=h,d=f)}}return u||(u=o[o.length-1]),u.from<l&&(u={from:l,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}function or(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Mn){Mn=N("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Mn.appendChild(document.createTextNode("x")),Mn.appendChild(N("br"));Mn.appendChild(document.createTextNode("x"))}T(e.measure,Mn);var n=Mn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),I(e.measure),n||1}function ir(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=N("span","xxxxxxxxxx"),n=N("pre",[t],"CodeMirror-line-like");T(e.measure,n);var r=t.getBoundingClientRect(),o=(r.right-r.left)/10;return o>2&&(e.cachedCharWidth=o),o||10}function ar(e){for(var t=e.display,n={},r={},o=t.gutters.clientLeft,i=t.gutters.firstChild,a=0;i;i=i.nextSibling,++a){var s=e.display.gutterSpecs[a].className;n[s]=i.offsetLeft+i.clientLeft+o,r[s]=i.clientWidth}return{fixedPos:sr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function sr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function lr(e){var t=or(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/ir(e.display)-3);return function(o){if(Vt(e.doc,o))return 0;var i=0;if(o.widgets)for(var a=0;a<o.widgets.length;a++)o.widgets[a].height&&(i+=o.widgets[a].height);return n?i+(Math.ceil(o.text.length/r)||1)*t:i+t}}function cr(e){var t=e.doc,n=lr(e);t.iter((function(e){var t=n(e);t!=e.height&&Ye(e,t)}))}function ur(e,t,n,r){var o=e.display;if(!n&&"true"==Ce(t).getAttribute("cm-not-content"))return null;var i,a,s=o.lineSpace.getBoundingClientRect();try{i=t.clientX-s.left,a=t.clientY-s.top}catch(e){return null}var l,c=Xn(e,i,a);if(r&&c.xRel>0&&(l=Ge(e.doc,c.line).text).length==c.ch){var u=F(l,l.length,e.options.tabSize)-l.length;c=tt(c.line,Math.max(0,Math.round((i-Sn(e.display).left)/ir(e.display))-u))}return c}function dr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if((t-=n[r].size)<0)return r}function pr(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var o=e.display;if(r&&n<o.viewTo&&(null==o.updateLineNumbers||o.updateLineNumbers>t)&&(o.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=o.viewTo)Et&&Zt(e.doc,t)<o.viewTo&&mr(e);else if(n<=o.viewFrom)Et&&zt(e.doc,n+r)>o.viewFrom?mr(e):(o.viewFrom+=r,o.viewTo+=r);else if(t<=o.viewFrom&&n>=o.viewTo)mr(e);else if(t<=o.viewFrom){var i=fr(e,n,n+r,1);i?(o.view=o.view.slice(i.index),o.viewFrom=i.lineN,o.viewTo+=r):mr(e)}else if(n>=o.viewTo){var a=fr(e,t,t,-1);a?(o.view=o.view.slice(0,a.index),o.viewTo=a.lineN):mr(e)}else{var s=fr(e,t,t,-1),l=fr(e,n,n+r,1);s&&l?(o.view=o.view.slice(0,s.index).concat(an(e,s.lineN,l.lineN)).concat(o.view.slice(l.index)),o.viewTo+=r):mr(e)}var c=o.externalMeasured;c&&(n<c.lineN?c.lineN+=r:t<c.lineN+c.size&&(o.externalMeasured=null))}function hr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,o=e.display.externalMeasured;if(o&&t>=o.lineN&&t<o.lineN+o.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var i=r.view[dr(e,t)];if(null!=i.node){var a=i.changes||(i.changes=[]);-1==Z(a,n)&&a.push(n)}}}function mr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function fr(e,t,n,r){var o,i=dr(e,t),a=e.display.view;if(!Et||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var s=e.display.viewFrom,l=0;l<i;l++)s+=a[l].size;if(s!=t){if(r>0){if(i==a.length-1)return null;o=s+a[i].size-t,i++}else o=s-t;t+=o,n+=o}for(;Zt(e.doc,n)!=n;){if(i==(r<0?0:a.length-1))return null;n+=r*a[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function gr(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var o=t[r];o.hidden||o.node&&!o.changes||++n}return n}function br(e){e.display.input.showSelection(e.display.input.prepareSelection())}function vr(e,t){void 0===t&&(t=!0);var n=e.doc,r={},o=r.cursors=document.createDocumentFragment(),i=r.selection=document.createDocumentFragment(),a=e.options.$customCursor;a&&(t=!0);for(var s=0;s<n.sel.ranges.length;s++)if(t||s!=n.sel.primIndex){var l=n.sel.ranges[s];if(!(l.from().line>=e.display.viewTo||l.to().line<e.display.viewFrom)){var c=l.empty();if(a){var u=a(e,l);u&&yr(e,u,o)}else(c||e.options.showCursorWhenSelecting)&&yr(e,l.head,o);c||kr(e,l,i)}}return r}function yr(e,t,n){var r=qn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),o=n.appendChild(N("div"," ","CodeMirror-cursor"));if(o.style.left=r.left+"px",o.style.top=r.top+"px",o.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var i=Gn(e,t,"div",null,null),a=i.right-i.left;o.style.width=(a>0?a:e.defaultCharWidth())+"px"}if(r.other){var s=n.appendChild(N("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=r.other.left+"px",s.style.top=r.other.top+"px",s.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function _r(e,t){return e.top-t.top||e.left-t.left}function kr(e,t,n){var r=e.display,o=e.doc,i=document.createDocumentFragment(),a=Sn(e.display),s=a.left,l=Math.max(r.sizerWidth,Tn(e)-r.sizer.offsetLeft)-a.right,c="ltr"==o.direction;function u(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),i.appendChild(N("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?l-e:n)+"px;\n height: "+(r-t)+"px"))}function d(t,n,r){var i,a,d=Ge(o,t),p=d.text.length;function h(n,r){return Gn(e,tt(t,n),"div",d,r)}function m(t,n,r){var o=Qn(e,d,null,t),i="ltr"==n==("after"==r)?"left":"right";return h("after"==r?o.begin:o.end-(/\s/.test(d.text.charAt(o.end-1))?2:1),i)[i]}var f=ue(d,o.direction);return function(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var o=!1,i=0;i<e.length;++i){var a=e[i];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",i),o=!0)}o||r(t,n,"ltr")}(f,n||0,null==r?p:r,(function(e,t,o,d){var g="ltr"==o,b=h(e,g?"left":"right"),v=h(t-1,g?"right":"left"),y=null==n&&0==e,_=null==r&&t==p,k=0==d,w=!f||d==f.length-1;if(v.top-b.top<=3){var E=(c?_:y)&&w,C=(c?y:_)&&k?s:(g?b:v).left,x=E?l:(g?v:b).right;u(C,b.top,x-C,b.bottom)}else{var S,I,T,N;g?(S=c&&y&&k?s:b.left,I=c?l:m(e,o,"before"),T=c?s:m(t,o,"after"),N=c&&_&&w?l:v.right):(S=c?m(e,o,"before"):s,I=!c&&y&&k?l:b.right,T=!c&&_&&w?s:v.left,N=c?m(t,o,"after"):l),u(S,b.top,I-S,b.bottom),b.bottom<v.top&&u(s,b.bottom,null,v.top),u(T,v.top,N-T,v.bottom)}(!i||_r(b,i)<0)&&(i=b),_r(v,i)<0&&(i=v),(!a||_r(b,a)<0)&&(a=b),_r(v,a)<0&&(a=v)})),{start:i,end:a}}var p=t.from(),h=t.to();if(p.line==h.line)d(p.line,p.ch,h.ch);else{var m=Ge(o,p.line),f=Ge(o,h.line),g=jt(m)==jt(f),b=d(p.line,p.ch,g?m.text.length+1:null).end,v=d(h.line,g?0:null,h.ch).start;g&&(b.top<v.top-2?(u(b.right,b.top,null,b.bottom),u(s,v.top,v.left,v.bottom)):u(b.right,b.top,v.left-b.right,b.bottom)),b.bottom<v.top&&u(s,b.bottom,null,v.top)}n.appendChild(i)}function wr(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){e.hasFocus()||Sr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Er(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||xr(e))}function Cr(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Sr(e))}),100)}function xr(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(fe(e,"focus",e,t),e.state.focused=!0,B(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),wr(e))}function Sr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(fe(e,"blur",e,t),e.state.focused=!1,S(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Ir(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),o=t.lineDiv.getBoundingClientRect().top,i=0,l=0;l<t.view.length;l++){var c=t.view[l],u=e.options.lineWrapping,d=void 0,p=0;if(!c.hidden){if(o+=c.line.height,a&&s<8){var h=c.node.offsetTop+c.node.offsetHeight;d=h-n,n=h}else{var m=c.node.getBoundingClientRect();d=m.bottom-m.top,!u&&c.text.firstChild&&(p=c.text.firstChild.getBoundingClientRect().right-m.left-1)}var f=c.line.height-d;if((f>.005||f<-.005)&&(o<r&&(i-=f),Ye(c.line,d),Tr(c.line),c.rest))for(var g=0;g<c.rest.length;g++)Tr(c.rest[g]);if(p>e.display.sizerWidth){var b=Math.ceil(p/ir(e.display));b>e.display.maxLineLength&&(e.display.maxLineLength=b,e.display.maxLine=c.line,e.display.maxLineChanged=!0)}}}Math.abs(i)>2&&(t.scroller.scrollTop+=i)}function Tr(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Nr(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Cn(e));var o=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,i=Je(t,r),a=Je(t,o);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;s<i?(i=s,a=Je(t,Ut(Ge(t,s))+e.wrapper.clientHeight)):Math.min(l,t.lastLine())>=a&&(i=Je(t,Ut(Ge(t,l))-e.wrapper.clientHeight),a=l)}return{from:i,to:Math.max(a,i+1)}}function Pr(e,t){var n=e.display,r=or(e.display);t.top<0&&(t.top=0);var o=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,i=Nn(e),a={};t.bottom-t.top>i&&(t.bottom=t.top+i);var s=e.doc.height+xn(n),l=t.top<r,c=t.bottom>s-r;if(t.top<o)a.scrollTop=l?0:t.top;else if(t.bottom>o+i){var u=Math.min(t.top,(c?s:t.bottom)-i);u!=o&&(a.scrollTop=u)}var d=e.options.fixedGutter?0:n.gutters.offsetWidth,p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-d,h=Tn(e)-n.gutters.offsetWidth,m=t.right-t.left>h;return m&&(t.right=t.left+h),t.left<10?a.scrollLeft=0:t.left<p?a.scrollLeft=Math.max(0,t.left+d-(m?0:10)):t.right>h+p-3&&(a.scrollLeft=t.right+(m?0:10)-h),a}function Rr(e,t){null!=t&&(Lr(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Ar(e){Lr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Br(e,t,n){null==t&&null==n||Lr(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Lr(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Mr(e,Kn(e,t.from),Kn(e,t.to),t.margin))}function Mr(e,t,n,r){var o=Pr(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Br(e,o.scrollLeft,o.scrollTop)}function Dr(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||co(e,{top:t}),Or(e,t,!0),n&&co(e),oo(e,100))}function Or(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Fr(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,ho(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function jr(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+xn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+In(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Zr=function(e,t,n){this.cm=n;var r=this.vert=N("div",[N("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=N("div",[N("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=o.tabIndex=-1,e(r),e(o),pe(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),pe(o,"scroll",(function(){o.clientWidth&&t(o.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Zr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var o=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+o)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var i=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+i)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Zr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Zr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Zr.prototype.zeroWidthHack=function(){var e=v&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new j,this.disableVert=new j},Zr.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto",t.set(1e3,(function r(){var o=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(o.right-1,(o.top+o.bottom)/2):document.elementFromPoint((o.right+o.left)/2,o.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)}))},Zr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var zr=function(){};function Vr(e,t){t||(t=jr(e));var n=e.display.barWidth,r=e.display.barHeight;Hr(e,t);for(var o=0;o<4&&n!=e.display.barWidth||r!=e.display.barHeight;o++)n!=e.display.barWidth&&e.options.lineWrapping&&Ir(e),Hr(e,jr(e)),n=e.display.barWidth,r=e.display.barHeight}function Hr(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}zr.prototype.update=function(){return{bottom:0,right:0}},zr.prototype.setScrollLeft=function(){},zr.prototype.setScrollTop=function(){},zr.prototype.clear=function(){};var Ur={native:Zr,null:zr};function $r(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&S(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ur[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),pe(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?Fr(e,t):Dr(e,t)}),e),e.display.scrollbars.addClass&&B(e.display.wrapper,e.display.scrollbars.addClass)}var Wr=0;function Gr(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Wr,markArrays:null},t=e.curOp,sn?sn.ops.push(t):t.ownsGroup=sn={ops:[t],delayedCallbacks:[]}}function qr(e){var t=e.curOp;t&&function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var o=e.ops[r];if(o.cursorActivityHandlers)for(;o.cursorActivityCalled<o.cursorActivityHandlers.length;)o.cursorActivityHandlers[o.cursorActivityCalled++].call(null,o.cm)}}while(n<t.length)}(n)}finally{sn=null,t(n)}}(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,n=0;n<t.length;n++)Kr(t[n]);for(var r=0;r<t.length;r++)Yr(t[r]);for(var o=0;o<t.length;o++)Xr(t[o]);for(var i=0;i<t.length;i++)Jr(t[i]);for(var a=0;a<t.length;a++)Qr(t[a])}(e)}))}function Kr(e){var t=e.cm,n=t.display;(function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=In(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=In(e)+"px",t.scrollbarsClipped=!0)})(t),e.updateMaxLine&&Wt(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ao(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Yr(e){e.updatedDisplay=e.mustUpdate&&so(e.cm,e.update)}function Xr(e){var t=e.cm,n=t.display;e.updatedDisplay&&Ir(t),e.barMeasure=jr(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Rn(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+In(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Tn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Jr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Fr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==A();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Vr(t,e.barMeasure),e.updatedDisplay&&po(t,e.barMeasure),e.selectionChanged&&wr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Er(e.cm)}function Qr(e){var t=e.cm,n=t.display,r=t.doc;e.updatedDisplay&&lo(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&Or(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&Fr(t,e.scrollLeft,!0,!0),e.scrollToPos&&function(e,t){if(!ge(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),o=null;if(t.top+r.top<0?o=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!m){var i=N("div","",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Cn(e.display))+"px;\n height: "+(t.bottom-t.top+In(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(i),i.scrollIntoView(o),e.display.lineSpace.removeChild(i)}}}(t,function(e,t,n,r){var o;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==t.sticky?tt(t.line,t.ch+1,"before"):t,t=t.ch?tt(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var i=0;i<5;i++){var a=!1,s=qn(e,t),l=n&&n!=t?qn(e,n):s,c=Pr(e,o={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r}),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(Dr(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(Fr(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return o}(t,lt(r,e.scrollToPos.from),lt(r,e.scrollToPos.to),e.scrollToPos.margin));var o=e.maybeHiddenMarkers,i=e.maybeUnhiddenMarkers;if(o)for(var a=0;a<o.length;++a)o[a].lines.length||fe(o[a],"hide");if(i)for(var s=0;s<i.length;++s)i[s].lines.length&&fe(i[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&fe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function eo(e,t){if(e.curOp)return t();Gr(e);try{return t()}finally{qr(e)}}function to(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Gr(e);try{return t.apply(e,arguments)}finally{qr(e)}}}function no(e){return function(){if(this.curOp)return e.apply(this,arguments);Gr(this);try{return e.apply(this,arguments)}finally{qr(this)}}}function ro(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Gr(t);try{return e.apply(this,arguments)}finally{qr(t)}}}function oo(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,D(io,e))}function io(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=mt(e,t.highlightFrontier),o=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(i){if(r.line>=e.display.viewFrom){var a=i.styles,s=i.text.length>e.options.maxHighlightLength?He(t.mode,r.state):null,l=pt(e,i,r,!0);s&&(r.state=s),i.styles=l.styles;var c=i.styleClasses,u=l.classes;u?i.styleClasses=u:c&&(i.styleClasses=null);for(var d=!a||a.length!=i.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),p=0;!d&&p<a.length;++p)d=a[p]!=i.styles[p];d&&o.push(r.line),i.stateAfter=r.save(),r.nextLine()}else i.text.length<=e.options.maxHighlightLength&&ft(e,i.text,r),i.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return oo(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),o.length&&eo(e,(function(){for(var t=0;t<o.length;t++)hr(e,o[t],"text")}))}}var ao=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Nr(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Tn(e),this.force=n,this.dims=ar(e),this.events=[]};function so(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return mr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==gr(e))return!1;mo(e)&&(mr(e),t.dims=ar(e));var o=r.first+r.size,i=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(o,t.visible.to+e.options.viewportMargin);n.viewFrom<i&&i-n.viewFrom<20&&(i=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(o,n.viewTo)),Et&&(i=Zt(e.doc,i),a=zt(e.doc,a));var s=i!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;(function(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=an(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=an(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(dr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(an(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,dr(e,n)))),r.viewTo=n})(e,i,a),n.viewOffset=Ut(Ge(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var c=gr(e);if(!s&&0==c&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=function(e){if(e.hasFocus())return null;var t=A();if(!t||!R(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&R(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(e);return c>4&&(n.lineDiv.style.display="none"),function(e,t,n){var r=e.display,o=e.options.lineNumbers,i=r.lineDiv,a=i.firstChild;function s(t){var n=t.nextSibling;return l&&v&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var c=r.view,u=r.viewFrom,d=0;d<c.length;d++){var p=c[d];if(p.hidden);else if(p.node&&p.node.parentNode==i){for(;a!=p.node;)a=s(a);var h=o&&null!=t&&t<=u&&p.lineNumber;p.changes&&(Z(p.changes,"gutter")>-1&&(h=!1),dn(e,p,u,n)),h&&(I(p.lineNumber),p.lineNumber.appendChild(document.createTextNode(et(e.options,u)))),a=p.node.nextSibling}else{var m=vn(e,p,u,n);i.insertBefore(m,a)}u+=p.size}for(;a;)a=s(a)}(e,n.updateLineNumbers,t.dims),c>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=A()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&R(document.body,e.anchorNode)&&R(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}(u),I(n.cursorDiv),I(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,oo(e,400)),n.updateLineNumbers=null,!0}function lo(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Tn(e))r&&(t.visible=Nr(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+xn(e.display)-Nn(e),n.top)}),t.visible=Nr(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!so(e,t))break;Ir(e);var o=jr(e);br(e),Vr(e,o),po(e,o),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function co(e,t){var n=new ao(e,t);if(so(e,n)){Ir(e),lo(e,n);var r=jr(e);br(e),Vr(e,r),po(e,r),n.finish()}}function uo(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",cn(e,"gutterChanged",e)}function po(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+In(e)+"px"}function ho(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=sr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,o=t.gutters.offsetWidth,i=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=i),n[a].gutterBackground&&(n[a].gutterBackground.style.left=i));var s=n[a].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=i}e.options.fixedGutter&&(t.gutters.style.left=r+o+"px")}}function mo(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=et(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var o=r.measure.appendChild(N("div",[N("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),i=o.firstChild.offsetWidth,a=o.offsetWidth-i;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(i,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",uo(e.display),!0}return!1}function fo(e,t){for(var n=[],r=!1,o=0;o<e.length;o++){var i=e[o],a=null;if("string"!=typeof i&&(a=i.style,i=i.className),"CodeMirror-linenumbers"==i){if(!t)continue;r=!0}n.push({className:i,style:a})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function go(e){var t=e.gutters,n=e.gutterSpecs;I(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var o=n[r],i=o.className,a=o.style,s=t.appendChild(N("div",null,"CodeMirror-gutter "+i));a&&(s.style.cssText=a),"CodeMirror-linenumbers"==i&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",uo(e)}function bo(e){go(e.display),pr(e),ho(e)}function vo(e,t,r,o){var i=this;this.input=r,i.scrollbarFiller=N("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=N("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=P("div",null,"CodeMirror-code"),i.selectionDiv=N("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=N("div",null,"CodeMirror-cursors"),i.measure=N("div",null,"CodeMirror-measure"),i.lineMeasure=N("div",null,"CodeMirror-measure"),i.lineSpace=P("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var c=P("div",[i.lineSpace],"CodeMirror-lines");i.mover=N("div",[c],null,"position: relative"),i.sizer=N("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=N("div",null,null,"position: absolute; height: "+z+"px; width: 1px;"),i.gutters=N("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=N("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=N("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),i.wrapper.setAttribute("translate","no"),a&&s<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),l||n&&b||(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=fo(o.gutters,o.lineNumbers),go(i),r.init(i)}ao.prototype.signal=function(e,t){ve(e,t)&&this.events.push(arguments)},ao.prototype.finish=function(){for(var e=0;e<this.events.length;e++)fe.apply(null,this.events[e])};var yo=0,_o=null;function ko(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function wo(e){var t=ko(e);return t.x*=_o,t.y*=_o,t}function Eo(e,t){var r=ko(t),o=r.x,i=r.y,a=_o;0===t.deltaMode&&(o=t.deltaX,i=t.deltaY,a=1);var s=e.display,c=s.scroller,u=c.scrollWidth>c.clientWidth,p=c.scrollHeight>c.clientHeight;if(o&&u||i&&p){if(i&&v&&l)e:for(var h=t.target,m=s.view;h!=c;h=h.parentNode)for(var f=0;f<m.length;f++)if(m[f].node==h){e.display.currentWheelTarget=h;break e}if(o&&!n&&!d&&null!=a)return i&&p&&Dr(e,Math.max(0,c.scrollTop+i*a)),Fr(e,Math.max(0,c.scrollLeft+o*a)),(!i||i&&p)&&_e(t),void(s.wheelStartX=null);if(i&&null!=a){var g=i*a,b=e.doc.scrollTop,y=b+s.wrapper.clientHeight;g<0?b=Math.max(0,b+g-50):y=Math.min(e.doc.height,y+g+50),co(e,{top:b,bottom:y})}yo<20&&0!==t.deltaMode&&(null==s.wheelStartX?(s.wheelStartX=c.scrollLeft,s.wheelStartY=c.scrollTop,s.wheelDX=o,s.wheelDY=i,setTimeout((function(){if(null!=s.wheelStartX){var e=c.scrollLeft-s.wheelStartX,t=c.scrollTop-s.wheelStartY,n=t&&s.wheelDY&&t/s.wheelDY||e&&s.wheelDX&&e/s.wheelDX;s.wheelStartX=s.wheelStartY=null,n&&(_o=(_o*yo+n)/(yo+1),++yo)}}),200)):(s.wheelDX+=o,s.wheelDY+=i))}}a?_o=-.53:n?_o=15:u?_o=-.7:p&&(_o=-1/3);var Co=function(e,t){this.ranges=e,this.primIndex=t};Co.prototype.primary=function(){return this.ranges[this.primIndex]},Co.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!rt(n.anchor,r.anchor)||!rt(n.head,r.head))return!1}return!0},Co.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new xo(ot(this.ranges[t].anchor),ot(this.ranges[t].head));return new Co(e,this.primIndex)},Co.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Co.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(nt(t,r.from())>=0&&nt(e,r.to())<=0)return n}return-1};var xo=function(e,t){this.anchor=e,this.head=t};function So(e,t,n){var r=e&&e.options.selectionsMayTouch,o=t[n];t.sort((function(e,t){return nt(e.from(),t.from())})),n=Z(t,o);for(var i=1;i<t.length;i++){var a=t[i],s=t[i-1],l=nt(s.to(),a.from());if(r&&!a.empty()?l>0:l>=0){var c=at(s.from(),a.from()),u=it(s.to(),a.to()),d=s.empty()?a.from()==a.head:s.from()==s.head;i<=n&&--n,t.splice(--i,2,new xo(d?u:c,d?c:u))}}return new Co(t,n)}function Io(e,t){return new Co([new xo(e,t||e)],0)}function To(e){return e.text?tt(e.from.line+e.text.length-1,K(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function No(e,t){if(nt(e,t.from)<0)return e;if(nt(e,t.to)<=0)return To(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=To(t).ch-t.to.ch),tt(n,r)}function Po(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var o=e.sel.ranges[r];n.push(new xo(No(o.anchor,t),No(o.head,t)))}return So(e.cm,n,e.sel.primIndex)}function Ro(e,t,n){return e.line==t.line?tt(n.line,e.ch-t.ch+n.ch):tt(n.line+(e.line-t.line),e.ch)}function Ao(e){e.doc.mode=Ze(e.options,e.doc.modeOption),Bo(e)}function Bo(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,oo(e,100),e.state.modeGen++,e.curOp&&pr(e)}function Lo(e,t){return 0==t.from.ch&&0==t.to.ch&&""==K(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Mo(e,t,n,r){function o(e){return n?n[e]:null}function i(e,n,o){(function(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Nt(e),Pt(e,n);var o=r?r(e):1;o!=e.height&&Ye(e,o)})(e,n,o,r),cn(e,"change",e,t)}function a(e,t){for(var n=[],i=e;i<t;++i)n.push(new Gt(c[i],o(i),r));return n}var s=t.from,l=t.to,c=t.text,u=Ge(e,s.line),d=Ge(e,l.line),p=K(c),h=o(c.length-1),m=l.line-s.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(Lo(e,t)){var f=a(0,c.length-1);i(d,d.text,h),m&&e.remove(s.line,m),f.length&&e.insert(s.line,f)}else if(u==d)if(1==c.length)i(u,u.text.slice(0,s.ch)+p+u.text.slice(l.ch),h);else{var g=a(1,c.length-1);g.push(new Gt(p+u.text.slice(l.ch),h,r)),i(u,u.text.slice(0,s.ch)+c[0],o(0)),e.insert(s.line+1,g)}else if(1==c.length)i(u,u.text.slice(0,s.ch)+c[0]+d.text.slice(l.ch),o(0)),e.remove(s.line+1,m);else{i(u,u.text.slice(0,s.ch)+c[0],o(0)),i(d,p+d.text.slice(l.ch),h);var b=a(1,c.length-1);m>1&&e.remove(s.line+1,m-1),e.insert(s.line+1,b)}cn(e,"change",e,t)}function Do(e,t,n){!function e(r,o,i){if(r.linked)for(var a=0;a<r.linked.length;++a){var s=r.linked[a];if(s.doc!=o){var l=i&&s.sharedHist;n&&!l||(t(s.doc,l),e(s.doc,r,l))}}}(e,null,!0)}function Oo(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,cr(e),Ao(e),Fo(e),e.options.direction=t.direction,e.options.lineWrapping||Wt(e),e.options.mode=t.modeOption,pr(e)}function Fo(e){("rtl"==e.doc.direction?B:S)(e.display.lineDiv,"CodeMirror-rtl")}function jo(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function Zo(e,t){var n={from:ot(t.from),to:To(t),text:qe(e,t.from,t.to)};return $o(e,n,t.from.line,t.to.line+1),Do(e,(function(e){return $o(e,n,t.from.line,t.to.line+1)}),!0),n}function zo(e){for(;e.length&&K(e).ranges;)e.pop()}function Vo(e,t,n,r){var o=e.history;o.undone.length=0;var i,a,s=+new Date;if((o.lastOp==r||o.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&o.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(i=function(e,t){return t?(zo(e.done),K(e.done)):e.done.length&&!K(e.done).ranges?K(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),K(e.done)):void 0}(o,o.lastOp==r)))a=K(i.changes),0==nt(t.from,t.to)&&0==nt(t.from,a.to)?a.to=To(t):i.changes.push(Zo(e,t));else{var l=K(o.done);for(l&&l.ranges||Uo(e.sel,o.done),i={changes:[Zo(e,t)],generation:o.generation},o.done.push(i);o.done.length>o.undoDepth;)o.done.shift(),o.done[0].ranges||o.done.shift()}o.done.push(n),o.generation=++o.maxGeneration,o.lastModTime=o.lastSelTime=s,o.lastOp=o.lastSelOp=r,o.lastOrigin=o.lastSelOrigin=t.origin,a||fe(e,"historyAdded")}function Ho(e,t,n,r){var o=e.history,i=r&&r.origin;n==o.lastSelOp||i&&o.lastSelOrigin==i&&(o.lastModTime==o.lastSelTime&&o.lastOrigin==i||function(e,t,n,r){var o=t.charAt(0);return"*"==o||"+"==o&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,i,K(o.done),t))?o.done[o.done.length-1]=t:Uo(t,o.done),o.lastSelTime=+new Date,o.lastSelOrigin=i,o.lastSelOp=n,r&&!1!==r.clearRedo&&zo(o.undone)}function Uo(e,t){var n=K(t);n&&n.ranges&&n.equals(e)||t.push(e)}function $o(e,t,n,r){var o=t["spans_"+e.id],i=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((o||(o=t["spans_"+e.id]={}))[i]=n.markedSpans),++i}))}function Wo(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function Go(e,t){var n=function(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],o=0;o<t.text.length;++o)r.push(Wo(n[o]));return r}(e,t),r=It(e,t);if(!n)return r;if(!r)return n;for(var o=0;o<n.length;++o){var i=n[o],a=r[o];if(i&&a)e:for(var s=0;s<a.length;++s){for(var l=a[s],c=0;c<i.length;++c)if(i[c].marker==l.marker)continue e;i.push(l)}else a&&(n[o]=a)}return n}function qo(e,t,n){for(var r=[],o=0;o<e.length;++o){var i=e[o];if(i.ranges)r.push(n?Co.prototype.deepCopy.call(i):i);else{var a=i.changes,s=[];r.push({changes:s});for(var l=0;l<a.length;++l){var c=a[l],u=void 0;if(s.push({from:c.from,to:c.to,text:c.text}),t)for(var d in c)(u=d.match(/^spans_(\d+)$/))&&Z(t,Number(u[1]))>-1&&(K(s)[d]=c[d],delete c[d])}}}return r}function Ko(e,t,n,r){if(r){var o=e.anchor;if(n){var i=nt(t,o)<0;i!=nt(n,o)<0?(o=t,t=n):i!=nt(t,n)<0&&(t=n)}return new xo(o,t)}return new xo(n||t,t)}function Yo(e,t,n,r,o){null==o&&(o=e.cm&&(e.cm.display.shift||e.extend)),ti(e,new Co([Ko(e.sel.primary(),t,n,o)],0),r)}function Xo(e,t,n){for(var r=[],o=e.cm&&(e.cm.display.shift||e.extend),i=0;i<e.sel.ranges.length;i++)r[i]=Ko(e.sel.ranges[i],t[i],null,o);ti(e,So(e.cm,r,e.sel.primIndex),n)}function Jo(e,t,n,r){var o=e.sel.ranges.slice(0);o[t]=n,ti(e,So(e.cm,o,e.sel.primIndex),r)}function Qo(e,t,n,r){ti(e,Io(t,n),r)}function ei(e,t,n){var r=e.history.done,o=K(r);o&&o.ranges?(r[r.length-1]=t,ni(e,t,n)):ti(e,t,n)}function ti(e,t,n){ni(e,t,n),Ho(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function ni(e,t,n){(ve(e,"beforeSelectionChange")||e.cm&&ve(e.cm,"beforeSelectionChange"))&&(t=function(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new xo(lt(e,t[n].anchor),lt(e,t[n].head))},origin:n&&n.origin};return fe(e,"beforeSelectionChange",e,r),e.cm&&fe(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?So(e.cm,r.ranges,r.ranges.length-1):t}(e,t,n));var r=n&&n.bias||(nt(t.primary().head,e.sel.primary().head)<0?-1:1);ri(e,ii(e,t,r,!0)),n&&!1===n.scroll||!e.cm||"nocursor"==e.cm.getOption("readOnly")||Ar(e.cm)}function ri(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,be(e.cm)),cn(e,"cursorActivity",e))}function oi(e){ri(e,ii(e,e.sel,null,!1))}function ii(e,t,n,r){for(var o,i=0;i<t.ranges.length;i++){var a=t.ranges[i],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[i],l=si(e,a.anchor,s&&s.anchor,n,r),c=si(e,a.head,s&&s.head,n,r);(o||l!=a.anchor||c!=a.head)&&(o||(o=t.ranges.slice(0,i)),o[i]=new xo(l,c))}return o?So(e.cm,o,t.primIndex):t}function ai(e,t,n,r,o){var i=Ge(e,t.line);if(i.markedSpans)for(var a=0;a<i.markedSpans.length;++a){var s=i.markedSpans[a],l=s.marker,c="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,u="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==s.from||(c?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(u?s.to>=t.ch:s.to>t.ch))){if(o&&(fe(l,"beforeCursorEnter"),l.explicitlyCleared)){if(i.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var d=l.find(r<0?1:-1),p=void 0;if((r<0?u:c)&&(d=li(e,d,-r,d&&d.line==t.line?i:null)),d&&d.line==t.line&&(p=nt(d,n))&&(r<0?p<0:p>0))return ai(e,d,t,r,o)}var h=l.find(r<0?-1:1);return(r<0?c:u)&&(h=li(e,h,r,h.line==t.line?i:null)),h?ai(e,h,t,r,o):null}}return t}function si(e,t,n,r,o){var i=r||1;return ai(e,t,n,i,o)||!o&&ai(e,t,n,i,!0)||ai(e,t,n,-i,o)||!o&&ai(e,t,n,-i,!0)||(e.cantEdit=!0,tt(e.first,0))}function li(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?lt(e,tt(t.line-1)):null:n>0&&t.ch==(r||Ge(e,t.line)).text.length?t.line<e.first+e.size-1?tt(t.line+1,0):null:new tt(t.line,t.ch+n)}function ci(e){e.setSelection(tt(e.firstLine(),0),tt(e.lastLine()),H)}function ui(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(t,n,o,i){t&&(r.from=lt(e,t)),n&&(r.to=lt(e,n)),o&&(r.text=o),void 0!==i&&(r.origin=i)}),fe(e,"beforeChange",e,r),e.cm&&fe(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function di(e,t,n){if(e.cm){if(!e.cm.curOp)return to(e.cm,di)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(ve(e,"beforeChange")||e.cm&&ve(e.cm,"beforeChange"))||(t=ui(e,t,!0))){var r=wt&&!n&&function(e,t,n){var r=null;if(e.iter(t.line,n.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=Z(r,n)||(r||(r=[])).push(n)}})),!r)return null;for(var o=[{from:t,to:n}],i=0;i<r.length;++i)for(var a=r[i],s=a.find(0),l=0;l<o.length;++l){var c=o[l];if(!(nt(c.to,s.from)<0||nt(c.from,s.to)>0)){var u=[l,1],d=nt(c.from,s.from),p=nt(c.to,s.to);(d<0||!a.inclusiveLeft&&!d)&&u.push({from:c.from,to:s.from}),(p>0||!a.inclusiveRight&&!p)&&u.push({from:s.to,to:c.to}),o.splice.apply(o,u),l+=u.length-3}}return o}(e,t.from,t.to);if(r)for(var o=r.length-1;o>=0;--o)pi(e,{from:r[o].from,to:r[o].to,text:o?[""]:t.text,origin:t.origin});else pi(e,t)}}function pi(e,t){if(1!=t.text.length||""!=t.text[0]||0!=nt(t.from,t.to)){var n=Po(e,t);Vo(e,t,n,e.cm?e.cm.curOp.id:NaN),fi(e,t,n,It(e,t));var r=[];Do(e,(function(e,n){n||-1!=Z(r,e.history)||(yi(e.history,t),r.push(e.history)),fi(e,t,null,It(e,t))}))}}function hi(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var o,i=e.history,a=e.sel,s="undo"==t?i.done:i.undone,l="undo"==t?i.undone:i.done,c=0;c<s.length&&(o=s[c],n?!o.ranges||o.equals(e.sel):o.ranges);c++);if(c!=s.length){for(i.lastOrigin=i.lastSelOrigin=null;;){if(!(o=s.pop()).ranges){if(r)return void s.push(o);break}if(Uo(o,l),n&&!o.equals(e.sel))return void ti(e,o,{clearRedo:!1});a=o}var u=[];Uo(a,l),l.push({changes:u,generation:i.generation}),i.generation=o.generation||++i.maxGeneration;for(var d=ve(e,"beforeChange")||e.cm&&ve(e.cm,"beforeChange"),p=function(n){var r=o.changes[n];if(r.origin=t,d&&!ui(e,r,!1))return s.length=0,{};u.push(Zo(e,r));var i=n?Po(e,r):K(s);fi(e,r,i,Go(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:To(r)});var a=[];Do(e,(function(e,t){t||-1!=Z(a,e.history)||(yi(e.history,r),a.push(e.history)),fi(e,r,null,Go(e,r))}))},h=o.changes.length-1;h>=0;--h){var m=p(h);if(m)return m.v}}}}function mi(e,t){if(0!=t&&(e.first+=t,e.sel=new Co(Y(e.sel.ranges,(function(e){return new xo(tt(e.anchor.line+t,e.anchor.ch),tt(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){pr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)hr(e.cm,r,"gutter")}}function fi(e,t,n,r){if(e.cm&&!e.cm.curOp)return to(e.cm,fi)(e,t,n,r);if(t.to.line<e.first)mi(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var o=t.text.length-1-(e.first-t.from.line);mi(e,o),t={from:tt(e.first,0),to:tt(t.to.line+o,t.to.ch),text:[K(t.text)],origin:t.origin}}var i=e.lastLine();t.to.line>i&&(t={from:t.from,to:tt(i,Ge(e,i).text.length),text:[t.text[0]],origin:t.origin}),t.removed=qe(e,t.from,t.to),n||(n=Po(e,t)),e.cm?function(e,t,n){var r=e.doc,o=e.display,i=t.from,a=t.to,s=!1,l=i.line;e.options.lineWrapping||(l=Xe(jt(Ge(r,i.line))),r.iter(l,a.line+1,(function(e){if(e==o.maxLine)return s=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&be(e),Mo(r,t,n,lr(e)),e.options.lineWrapping||(r.iter(l,i.line+t.text.length,(function(e){var t=$t(e);t>o.maxLineLength&&(o.maxLine=e,o.maxLineLength=t,o.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var o=Ge(e,r).stateAfter;if(o&&(!(o instanceof ut)||r+o.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}(r,i.line),oo(e,400);var c=t.text.length-(a.line-i.line)-1;t.full?pr(e):i.line!=a.line||1!=t.text.length||Lo(e.doc,t)?pr(e,i.line,a.line+1,c):hr(e,i.line,"text");var u=ve(e,"changes"),d=ve(e,"change");if(d||u){var p={from:i,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&cn(e,"change",e,p),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(p)}e.display.selForContextMenu=null}(e.cm,t,r):Mo(e,t,r),ni(e,n,H),e.cantEdit&&si(e,tt(e.firstLine(),0))&&(e.cantEdit=!1)}}function gi(e,t,n,r,o){var i;r||(r=n),nt(r,n)<0&&(n=(i=[r,n])[0],r=i[1]),"string"==typeof t&&(t=e.splitLines(t)),di(e,{from:n,to:r,text:t,origin:o})}function bi(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function vi(e,t,n,r){for(var o=0;o<e.length;++o){var i=e[o],a=!0;if(i.ranges){i.copied||((i=e[o]=i.deepCopy()).copied=!0);for(var s=0;s<i.ranges.length;s++)bi(i.ranges[s].anchor,t,n,r),bi(i.ranges[s].head,t,n,r)}else{for(var l=0;l<i.changes.length;++l){var c=i.changes[l];if(n<c.from.line)c.from=tt(c.from.line+r,c.from.ch),c.to=tt(c.to.line+r,c.to.ch);else if(t<=c.to.line){a=!1;break}}a||(e.splice(0,o+1),o=0)}}}function yi(e,t){var n=t.from.line,r=t.to.line,o=t.text.length-(r-n)-1;vi(e.done,n,r,o),vi(e.undone,n,r,o)}function _i(e,t,n,r){var o=t,i=t;return"number"==typeof t?i=Ge(e,st(e,t)):o=Xe(t),null==o?null:(r(i,o)&&e.cm&&hr(e.cm,o,n),i)}function ki(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}function wi(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var o=e[r];t+=o.chunkSize(),n+=o.height,o.parent=this}this.size=t,this.height=n,this.parent=null}xo.prototype.from=function(){return at(this.anchor,this.head)},xo.prototype.to=function(){return it(this.anchor,this.head)},xo.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},ki.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var o=this.lines[n];this.height-=o.height,qt(o),cn(o,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},wi.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],o=r.chunkSize();if(e<o){var i=Math.min(t,o-e),a=r.height;if(r.removeInner(e,i),this.height-=a-r.height,o==i&&(this.children.splice(n--,1),r.parent=null),0==(t-=i))break;e=0}else e-=o}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof ki))){var s=[];this.collapse(s),this.children=[new ki(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var o=this.children[r],i=o.chunkSize();if(e<=i){if(o.insertInner(e,t,n),o.lines&&o.lines.length>50){for(var a=o.lines.length%25+25,s=a;s<o.lines.length;){var l=new ki(o.lines.slice(s,s+=25));o.height-=l.height,this.children.splice(++r,0,l),l.parent=this}o.lines=o.lines.slice(0,a),this.maybeSpill()}break}e-=i}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new wi(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=Z(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var r=new wi(e.children);r.parent=e,e.children=[r,t],e=r}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var o=this.children[r],i=o.chunkSize();if(e<i){var a=Math.min(t,i-e);if(o.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=i}}};var Ei=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};function Ci(e,t,n){Ut(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Rr(e,n)}Ei.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=Xe(n);if(null!=r&&t){for(var o=0;o<t.length;++o)t[o]==this&&t.splice(o--,1);t.length||(n.widgets=null);var i=wn(this);Ye(n,Math.max(0,n.height-i)),e&&(eo(e,(function(){Ci(e,n,-i),hr(e,r,"widget")})),cn(e,"lineWidgetCleared",e,this,r))}},Ei.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var o=wn(this)-t;o&&(Vt(this.doc,r)||Ye(r,r.height+o),n&&eo(n,(function(){n.curOp.forceUpdate=!0,Ci(n,r,o),cn(n,"lineWidgetChanged",n,e,Xe(r))})))},ye(Ei);var xi=0,Si=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++xi};function Ii(e,t,n,r,o){if(r&&r.shared)return function(e,t,n,r,o){(r=O(r)).shared=!1;var i=[Ii(e,t,n,r,o)],a=i[0],s=r.widgetNode;return Do(e,(function(e){s&&(r.widgetNode=s.cloneNode(!0)),i.push(Ii(e,lt(e,t),lt(e,n),r,o));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;a=K(i)})),new Ti(i,a)}(e,t,n,r,o);if(e.cm&&!e.cm.curOp)return to(e.cm,Ii)(e,t,n,r,o);var i=new Si(e,o),a=nt(t,n);if(r&&O(r,i,!1),a>0||0==a&&!1!==i.clearWhenEmpty)return i;if(i.replacedWith&&(i.collapsed=!0,i.widgetNode=P("span",[i.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||i.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(i.widgetNode.insertLeft=!0)),i.collapsed){if(Ft(e,t.line,t,n,i)||t.line!=n.line&&Ft(e,n.line,t,n,i))throw new Error("Inserting collapsed marker partially overlapping an existing one");Et=!0}i.addToHistory&&Vo(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,c=e.cm;if(e.iter(l,n.line+1,(function(r){c&&i.collapsed&&!c.options.lineWrapping&&jt(r)==c.display.maxLine&&(s=!0),i.collapsed&&l!=t.line&&Ye(r,0),function(e,t,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));r&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}(r,new Ct(i,l==t.line?t.ch:null,l==n.line?n.ch:null),e.cm&&e.cm.curOp),++l})),i.collapsed&&e.iter(t.line,n.line+1,(function(t){Vt(e,t)&&Ye(t,0)})),i.clearOnEnter&&pe(i,"beforeCursorEnter",(function(){return i.clear()})),i.readOnly&&(wt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),i.collapsed&&(i.id=++xi,i.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),i.collapsed)pr(c,t.line,n.line+1);else if(i.className||i.startStyle||i.endStyle||i.css||i.attributes||i.title)for(var u=t.line;u<=n.line;u++)hr(c,u,"text");i.atomic&&oi(c.doc),cn(c,"markerAdded",c,i)}return i}Si.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Gr(e),ve(this,"clear")){var n=this.find();n&&cn(this,"clear",n.from,n.to)}for(var r=null,o=null,i=0;i<this.lines.length;++i){var a=this.lines[i],s=xt(a.markedSpans,this);e&&!this.collapsed?hr(e,Xe(a),"text"):e&&(null!=s.to&&(o=Xe(a)),null!=s.from&&(r=Xe(a))),a.markedSpans=St(a.markedSpans,s),null==s.from&&this.collapsed&&!Vt(this.doc,a)&&e&&Ye(a,or(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var c=jt(this.lines[l]),u=$t(c);u>e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&pr(e,r,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&oi(e.doc)),e&&cn(e,"markerCleared",e,this,r,o),t&&qr(e),this.parent&&this.parent.clear()}},Si.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var o=0;o<this.lines.length;++o){var i=this.lines[o],a=xt(i.markedSpans,this);if(null!=a.from&&(n=tt(t?i:Xe(i),a.from),-1==e))return n;if(null!=a.to&&(r=tt(t?i:Xe(i),a.to),1==e))return r}return n&&{from:n,to:r}},Si.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;t&&r&&eo(r,(function(){var o=t.line,i=Xe(t.line),a=An(r,i);if(a&&(jn(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Vt(n.doc,o)&&null!=n.height){var s=n.height;n.height=null;var l=wn(n)-s;l&&Ye(o,o.height+l)}cn(r,"markerChanged",r,e)}))},Si.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=Z(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Si.prototype.detachLine=function(e){if(this.lines.splice(Z(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ye(Si);var Ti=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function Ni(e){return e.findMarks(tt(e.first,0),e.clipPos(tt(e.lastLine())),(function(e){return e.parent}))}function Pi(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];Do(n.primary.doc,(function(e){return r.push(e)}));for(var o=0;o<n.markers.length;o++){var i=n.markers[o];-1==Z(r,i.doc)&&(i.parent=null,n.markers.splice(o--,1))}},n=0;n<e.length;n++)t(n)}Ti.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();cn(this,"clear")}},Ti.prototype.find=function(e,t){return this.primary.find(e,t)},ye(Ti);var Ri=0,Ai=function(e,t,n,r,o){if(!(this instanceof Ai))return new Ai(e,t,n,r,o);null==n&&(n=0),wi.call(this,[new ki([new Gt("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var i=tt(n,0);this.sel=Io(i),this.history=new jo(null),this.id=++Ri,this.modeOption=t,this.lineSep=r,this.direction="rtl"==o?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Mo(this,{from:i,to:i,text:e}),ti(this,Io(i),H)};Ai.prototype=J(wi.prototype,{constructor:Ai,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Ke(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:ro((function(e){var t=tt(this.first,0),n=this.first+this.size-1;di(this,{from:t,to:tt(n,Ge(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Br(this.cm,0,0),ti(this,Io(t),H)})),replaceRange:function(e,t,n,r){gi(this,e,t=lt(this,t),n=n?lt(this,n):t,r)},getRange:function(e,t,n){var r=qe(this,lt(this,e),lt(this,t));return!1===n?r:""===n?r.join(""):r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Qe(this,e))return Ge(this,e)},getLineNumber:function(e){return Xe(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Ge(this,e)),jt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return lt(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ro((function(e,t,n){Qo(this,lt(this,"number"==typeof e?tt(e,t||0):e),null,n)})),setSelection:ro((function(e,t,n){Qo(this,lt(this,e),lt(this,t||e),n)})),extendSelection:ro((function(e,t,n){Yo(this,lt(this,e),t&<(this,t),n)})),extendSelections:ro((function(e,t){Xo(this,ct(this,e),t)})),extendSelectionsBy:ro((function(e,t){Xo(this,ct(this,Y(this.sel.ranges,e)),t)})),setSelections:ro((function(e,t,n){if(e.length){for(var r=[],o=0;o<e.length;o++)r[o]=new xo(lt(this,e[o].anchor),lt(this,e[o].head||e[o].anchor));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),ti(this,So(this.cm,r,t),n)}})),addSelection:ro((function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new xo(lt(this,e),lt(this,t||e))),ti(this,So(this.cm,r,r.length-1),n)})),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var o=qe(this,n[r].from(),n[r].to());t=t?t.concat(o):o}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var o=qe(this,n[r].from(),n[r].to());!1!==e&&(o=o.join(e||this.lineSeparator())),t[r]=o}return t},replaceSelection:function(e,t,n){for(var r=[],o=0;o<this.sel.ranges.length;o++)r[o]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:ro((function(e,t,n){for(var r=[],o=this.sel,i=0;i<o.ranges.length;i++){var a=o.ranges[i];r[i]={from:a.from(),to:a.to(),text:this.splitLines(e[i]),origin:n}}for(var s=t&&"end"!=t&&function(e,t,n){for(var r=[],o=tt(e.first,0),i=o,a=0;a<t.length;a++){var s=t[a],l=Ro(s.from,o,i),c=Ro(To(s),o,i);if(o=s.to,i=c,"around"==n){var u=e.sel.ranges[a],d=nt(u.head,u.anchor)<0;r[a]=new xo(d?c:l,d?l:c)}else r[a]=new xo(l,l)}return new Co(r,e.sel.primIndex)}(this,r,t),l=r.length-1;l>=0;l--)di(this,r[l]);s?ei(this,s):this.cm&&Ar(this.cm)})),undo:ro((function(){hi(this,"undo")})),redo:ro((function(){hi(this,"redo")})),undoSelection:ro((function(){hi(this,"undo",!0)})),redoSelection:ro((function(){hi(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var o=0;o<e.undone.length;o++)e.undone[o].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new jo(this.history),Do(this,(function(t){return t.history=e.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:qo(this.history.done),undone:qo(this.history.undone)}},setHistory:function(e){var t=this.history=new jo(this.history);t.done=qo(e.done.slice(0),null,!0),t.undone=qo(e.undone.slice(0),null,!0)},setGutterMarker:ro((function(e,t,n){return _i(this,e,"gutter",(function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&ne(r)&&(e.gutterMarkers=null),!0}))})),clearGutter:ro((function(e){var t=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[e]&&_i(t,n,"gutter",(function(){return n.gutterMarkers[e]=null,ne(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!Qe(this,e))return null;if(t=e,!(e=Ge(this,e)))return null}else if(null==(t=Xe(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:ro((function(e,t,n){return _i(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(C(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0}))})),removeLineClass:ro((function(e,t,n){return _i(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",o=e[r];if(!o)return!1;if(null==n)e[r]=null;else{var i=o.match(C(n));if(!i)return!1;var a=i.index+i[0].length;e[r]=o.slice(0,i.index)+(i.index&&a!=o.length?" ":"")+o.slice(a)||null}return!0}))})),addLineWidget:ro((function(e,t,n){return function(e,t,n,r){var o=new Ei(e,n,r),i=e.cm;return i&&o.noHScroll&&(i.display.alignWidgets=!0),_i(e,t,"widget",(function(t){var n=t.widgets||(t.widgets=[]);if(null==o.insertAt?n.push(o):n.splice(Math.min(n.length,Math.max(0,o.insertAt)),0,o),o.line=t,i&&!Vt(e,t)){var r=Ut(t)<e.scrollTop;Ye(t,t.height+wn(o)),r&&Rr(i,o.height),i.curOp.forceUpdate=!0}return!0})),i&&cn(i,"lineWidgetAdded",i,o,"number"==typeof t?t:Xe(t)),o}(this,e,t,n)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Ii(this,lt(this,e),lt(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return Ii(this,e=lt(this,e),e,n,"bookmark")},findMarksAt:function(e){var t=[],n=Ge(this,(e=lt(this,e)).line).markedSpans;if(n)for(var r=0;r<n.length;++r){var o=n[r];(null==o.from||o.from<=e.ch)&&(null==o.to||o.to>=e.ch)&&t.push(o.marker.parent||o.marker)}return t},findMarks:function(e,t,n){e=lt(this,e),t=lt(this,t);var r=[],o=e.line;return this.iter(e.line,t.line+1,(function(i){var a=i.markedSpans;if(a)for(var s=0;s<a.length;s++){var l=a[s];null!=l.to&&o==e.line&&e.ch>=l.to||null==l.from&&o!=e.line||null!=l.from&&o==t.line&&l.from>=t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++o})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)})),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter((function(o){var i=o.text.length+r;if(i>e)return t=e,!0;e-=i,++n})),lt(this,tt(n,t))},indexFromPos:function(e){var t=(e=lt(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+n})),t},copy:function(e){var t=new Ai(Ke(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new Ai(Ke(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n],o=r.find(),i=e.clipPos(o.from),a=e.clipPos(o.to);if(nt(i,a)){var s=Ii(e,i,a,r.primary,r.primary.type);r.markers.push(s),s.parent=r}}}(r,Ni(this)),r},unlinkDoc:function(e){if(e instanceof Ta&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Pi(Ni(this));break}if(e.history==this.history){var n=[e.id];Do(e,(function(e){return n.push(e.id)}),!0),e.history=new jo(null),e.history.done=qo(this.history.done,n),e.history.undone=qo(this.history.undone,n)}},iterLinkedDocs:function(e){Do(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Ae(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:ro((function(e){var t;"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&eo(t=this.cm,(function(){Fo(t),pr(t)})))}))}),Ai.prototype.eachLine=Ai.prototype.iter;var Bi=0;function Li(e){var t=this;if(Mi(t),!ge(t,e)&&!En(t.display,e)){_e(e),a&&(Bi=+new Date);var n=ur(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var o=r.length,i=Array(o),s=0,l=function(){++s==o&&to(t,(function(){var e={from:n=lt(t.doc,n),to:n,text:t.doc.splitLines(i.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};di(t.doc,e),ei(t.doc,Io(lt(t.doc,n),lt(t.doc,To(e))))}))()},c=function(e,n){if(t.options.allowDropFileTypes&&-1==Z(t.options.allowDropFileTypes,e.type))l();else{var r=new FileReader;r.onerror=function(){return l()},r.onload=function(){var e=r.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(i[n]=e),l()},r.readAsText(e)}},u=0;u<r.length;u++)c(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var d=e.dataTransfer.getData("Text");if(d){var p;if(t.state.draggingText&&!t.state.draggingText.copy&&(p=t.listSelections()),ni(t.doc,Io(n,n)),p)for(var h=0;h<p.length;++h)gi(t.doc,"",p[h].anchor,p[h].head,"drag");t.replaceSelection(d,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Mi(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Di(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var o=t[r].CodeMirror;o&&n.push(o)}n.length&&n[0].operation((function(){for(var t=0;t<n.length;t++)e(n[t])}))}}var Oi=!1;function Fi(){var e;Oi||(pe(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Di(ji)}),100))})),pe(window,"blur",(function(){return Di(Sr)})),Oi=!0)}function ji(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Zi={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},zi=0;zi<10;zi++)Zi[zi+48]=Zi[zi+96]=String(zi);for(var Vi=65;Vi<=90;Vi++)Zi[Vi]=String.fromCharCode(Vi);for(var Hi=1;Hi<=12;Hi++)Zi[Hi+111]=Zi[Hi+63235]="F"+Hi;var Ui={};function $i(e){var t,n,r,o,i=e.split(/-(?!$)/);e=i[i.length-1];for(var a=0;a<i.length-1;a++){var s=i[a];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Wi(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var o=Y(n.split(" "),$i),i=0;i<o.length;i++){var a=void 0,s=void 0;i==o.length-1?(s=o.join(" "),a=r):(s=o.slice(0,i+1).join(" "),a="...");var l=t[s];if(l){if(l!=a)throw new Error("Inconsistent bindings for "+s)}else t[s]=a}delete e[n]}for(var c in t)e[c]=t[c];return e}function Gi(e,t,n,r){var o=(t=Xi(t)).call?t.call(e,r):t[e];if(!1===o)return"nothing";if("..."===o)return"multi";if(null!=o&&n(o))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Gi(e,t.fallthrough,n,r);for(var i=0;i<t.fallthrough.length;i++){var a=Gi(e,t.fallthrough[i],n,r);if(a)return a}}}function qi(e){var t="string"==typeof e?e:Zi[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Ki(e,t,n){var r=e;return t.altKey&&"Alt"!=r&&(e="Alt-"+e),(w?t.metaKey:t.ctrlKey)&&"Ctrl"!=r&&(e="Ctrl-"+e),(w?t.ctrlKey:t.metaKey)&&"Mod"!=r&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=r&&(e="Shift-"+e),e}function Yi(e,t){if(d&&34==e.keyCode&&e.char)return!1;var n=Zi[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),Ki(n,e,t))}function Xi(e){return"string"==typeof e?Ui[e]:e}function Ji(e,t){for(var n=e.doc.sel.ranges,r=[],o=0;o<n.length;o++){for(var i=t(n[o]);r.length&&nt(i.from,K(r).to)<=0;){var a=r.pop();if(nt(a.from,i.from)<0){i.from=a.from;break}}r.push(i)}eo(e,(function(){for(var t=r.length-1;t>=0;t--)gi(e.doc,"",r[t].from,r[t].to,"+delete");Ar(e)}))}function Qi(e,t,n){var r=ie(e.text,t+n,n);return r<0||r>e.text.length?null:r}function ea(e,t,n){var r=Qi(e,t.ch,n);return null==r?null:new tt(t.line,r,n<0?"after":"before")}function ta(e,t,n,r,o){if(e){"rtl"==t.doc.direction&&(o=-o);var i=ue(n,t.doc.direction);if(i){var a,s=o<0?K(i):i[0],l=o<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var c=Bn(t,n);a=o<0?n.text.length-1:0;var u=Ln(t,c,a).top;a=ae((function(e){return Ln(t,c,e).top==u}),o<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Qi(n,a,1))}else a=o<0?s.to:s.from;return new tt(r,a,l)}}return new tt(r,o<0?n.text.length:0,o<0?"before":"after")}Ui.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Ui.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Ui.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ui.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Ui.default=v?Ui.macDefault:Ui.pcDefault;var na={selectAll:ci,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),H)},killLine:function(e){return Ji(e,(function(t){if(t.empty()){var n=Ge(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:tt(t.head.line+1,0)}:{from:t.head,to:tt(t.head.line,n)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return Ji(e,(function(t){return{from:tt(t.from().line,0),to:lt(e.doc,tt(t.to().line+1,0))}}))},delLineLeft:function(e){return Ji(e,(function(e){return{from:tt(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return Ji(e,(function(t){var n=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:n},"div"),to:t.from()}}))},delWrappedLineRight:function(e){return Ji(e,(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}}))},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(tt(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(tt(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return ra(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return oa(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return function(e,t){var n=Ge(e.doc,t),r=function(e){for(var t;t=Dt(e);)e=t.find(1,!0).line;return e}(n);return r!=n&&(t=Xe(r)),ta(!0,e,n,t,-1)}(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")}),$)},goLineLeft:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")}),$)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?oa(e,t.head):r}),$)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,o=0;o<n.length;o++){var i=n[o].from(),a=F(e.getLine(i.line),i.ch,r);t.push(q(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return eo(e,(function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var o=t[r].head,i=Ge(e.doc,o.line).text;if(i)if(o.ch==i.length&&(o=new tt(o.line,o.ch-1)),o.ch>0)o=new tt(o.line,o.ch+1),e.replaceRange(i.charAt(o.ch-1)+i.charAt(o.ch-2),tt(o.line,o.ch-2),o,"+transpose");else if(o.line>e.doc.first){var a=Ge(e.doc,o.line-1).text;a&&(o=new tt(o.line,1),e.replaceRange(i.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),tt(o.line-1,a.length-1),o,"+transpose"))}n.push(new xo(o,o))}e.setSelections(n)}))},newlineAndIndent:function(e){return eo(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Ar(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function ra(e,t){var n=Ge(e.doc,t),r=jt(n);return r!=n&&(t=Xe(r)),ta(!0,e,r,t,1)}function oa(e,t){var n=ra(e,t.line),r=Ge(e.doc,n.line),o=ue(r,e.doc.direction);if(!o||0==o[0].level){var i=Math.max(n.ch,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=i&&t.ch;return tt(n.line,a?0:i,n.sticky)}return n}function ia(e,t,n){if("string"==typeof t&&!(t=na[t]))return!1;e.display.input.ensurePolled();var r=e.display.shift,o=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),o=t(e)!=V}finally{e.display.shift=r,e.state.suppressEdits=!1}return o}var aa=new j;function sa(e,t,n,r){var o=e.state.keySeq;if(o){if(qi(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:aa.set(50,(function(){e.state.keySeq==o&&(e.state.keySeq=null,e.display.input.reset())})),la(e,o+" "+t,n,r))return!0}return la(e,t,n,r)}function la(e,t,n,r){var o=function(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var o=Gi(t,e.state.keyMaps[r],n,e);if(o)return o}return e.options.extraKeys&&Gi(t,e.options.extraKeys,n,e)||Gi(t,e.options.keyMap,n,e)}(e,t,r);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&cn(e,"keyHandled",e,t,n),"handled"!=o&&"multi"!=o||(_e(n),wr(e)),!!o}function ca(e,t){var n=Yi(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?sa(e,"Shift-"+n,t,(function(t){return ia(e,t,!0)}))||sa(e,n,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return ia(e,t)})):sa(e,n,t,(function(t){return ia(e,t)})))}var ua=null;function da(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||(t.curOp.focus=A(),ge(t,e)))){a&&s<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var o=ca(t,e);d&&(ua=o?r:null,o||88!=r||Le||!(v?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),n&&!v&&!o&&46==r&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(S(t,"CodeMirror-crosshair"),me(document,"keyup",n),me(document,"mouseover",n))}B(t,"CodeMirror-crosshair"),pe(document,"keyup",n),pe(document,"mouseover",n)}(t)}}function pa(e){16==e.keyCode&&(this.doc.sel.shift=!1),ge(this,e)}function ha(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||En(t.display,e)||ge(t,e)||e.ctrlKey&&!e.altKey||v&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(d&&n==ua)return ua=null,void _e(e);if(!d||e.which&&!(e.which<10)||!ca(t,e)){var o=String.fromCharCode(null==r?n:r);"\b"!=o&&(function(e,t,n){return sa(e,"'"+n+"'",t,(function(t){return ia(e,t,!0)}))}(t,e,o)||t.display.input.onKeyPress(e))}}}var ma,fa,ga=function(e,t,n){this.time=e,this.pos=t,this.button=n};function ba(e){var t=this,n=t.display;if(!(ge(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,En(n,e))l||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!_a(t,e)){var r=ur(t,e),o=xe(e),i=r?function(e,t){var n=+new Date;return fa&&fa.compare(n,e,t)?(ma=fa=null,"triple"):ma&&ma.compare(n,e,t)?(fa=new ga(n,e,t),ma=null,"double"):(ma=new ga(n,e,t),fa=null,"single")}(r,o):"single";window.focus(),1==o&&t.state.selectingText&&t.state.selectingText(e),r&&function(e,t,n,r,o){var i="Click";return"double"==r?i="Double"+i:"triple"==r&&(i="Triple"+i),sa(e,Ki(i=(1==t?"Left":2==t?"Middle":"Right")+i,o),o,(function(t){if("string"==typeof t&&(t=na[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=V}finally{e.state.suppressEdits=!1}return r}))}(t,o,r,i,e)||(1==o?r?function(e,t,n,r){a?setTimeout(D(Er,e),0):e.curOp.focus=A();var o,i=function(e,t,n){var r=e.getOption("configureMouse"),o=r?r(e,t,n):{};if(null==o.unit){var i=y?n.shiftKey&&n.metaKey:n.altKey;o.unit=i?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==o.extend||e.doc.extend)&&(o.extend=e.doc.extend||n.shiftKey),null==o.addNew&&(o.addNew=v?n.metaKey:n.ctrlKey),null==o.moveOnDrag&&(o.moveOnDrag=!(v?n.altKey:n.ctrlKey)),o}(e,n,r),c=e.doc.sel;e.options.dragDrop&&Te&&!e.isReadOnly()&&"single"==n&&(o=c.contains(t))>-1&&(nt((o=c.ranges[o]).from(),t)<0||t.xRel>0)&&(nt(o.to(),t)>0||t.xRel<0)?function(e,t,n,r){var o=e.display,i=!1,c=to(e,(function(t){l&&(o.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Cr(e)),me(o.wrapper.ownerDocument,"mouseup",c),me(o.wrapper.ownerDocument,"mousemove",u),me(o.scroller,"dragstart",d),me(o.scroller,"drop",c),i||(_e(t),r.addNew||Yo(e.doc,n,null,null,r.extend),l&&!p||a&&9==s?setTimeout((function(){o.wrapper.ownerDocument.body.focus({preventScroll:!0}),o.input.focus()}),20):o.input.focus())})),u=function(e){i=i||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return i=!0};l&&(o.scroller.draggable=!0),e.state.draggingText=c,c.copy=!r.moveOnDrag,pe(o.wrapper.ownerDocument,"mouseup",c),pe(o.wrapper.ownerDocument,"mousemove",u),pe(o.scroller,"dragstart",d),pe(o.scroller,"drop",c),e.state.delayingBlurEvent=!0,setTimeout((function(){return o.input.focus()}),20),o.scroller.dragDrop&&o.scroller.dragDrop()}(e,r,t,i):function(e,t,n,r){a&&Cr(e);var o=e.display,i=e.doc;_e(t);var s,l,c=i.sel,u=c.ranges;if(r.addNew&&!r.extend?(l=i.sel.contains(n),s=l>-1?u[l]:new xo(n,n)):(s=i.sel.primary(),l=i.sel.primIndex),"rectangle"==r.unit)r.addNew||(s=new xo(n,n)),n=ur(e,t,!0,!0),l=-1;else{var d=va(e,n,r.unit);s=r.extend?Ko(s,d.anchor,d.head,r.extend):d}r.addNew?-1==l?(l=u.length,ti(i,So(e,u.concat([s]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&"char"==r.unit&&!r.extend?(ti(i,So(e,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),c=i.sel):Jo(i,l,s,U):(l=0,ti(i,new Co([s],0),U),c=i.sel);var p=n;function h(t){if(0!=nt(p,t))if(p=t,"rectangle"==r.unit){for(var o=[],a=e.options.tabSize,u=F(Ge(i,n.line).text,n.ch,a),d=F(Ge(i,t.line).text,t.ch,a),h=Math.min(u,d),m=Math.max(u,d),f=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));f<=g;f++){var b=Ge(i,f).text,v=W(b,h,a);h==m?o.push(new xo(tt(f,v),tt(f,v))):b.length>v&&o.push(new xo(tt(f,v),tt(f,W(b,m,a))))}o.length||o.push(new xo(n,n)),ti(i,So(e,c.ranges.slice(0,l).concat(o),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var y,_=s,k=va(e,t,r.unit),w=_.anchor;nt(k.anchor,w)>0?(y=k.head,w=at(_.from(),k.anchor)):(y=k.anchor,w=it(_.to(),k.head));var E=c.ranges.slice(0);E[l]=function(e,t){var n=t.anchor,r=t.head,o=Ge(e.doc,n.line);if(0==nt(n,r)&&n.sticky==r.sticky)return t;var i=ue(o);if(!i)return t;var a=le(i,n.ch,n.sticky),s=i[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var l,c=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==c||c==i.length)return t;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=le(i,r.ch,r.sticky),d=u-a||(r.ch-n.ch)*(1==s.level?-1:1);l=u==c-1||u==c?d<0:d>0}var p=i[c+(l?-1:0)],h=l==(1==p.level),m=h?p.from:p.to,f=h?"after":"before";return n.ch==m&&n.sticky==f?t:new xo(new tt(n.line,m,f),r)}(e,new xo(lt(i,w),y)),ti(i,So(e,E,l),U)}}var m=o.wrapper.getBoundingClientRect(),f=0;function g(t){var n=++f,a=ur(e,t,!0,"rectangle"==r.unit);if(a)if(0!=nt(a,p)){e.curOp.focus=A(),h(a);var s=Nr(o,i);(a.line>=s.to||a.line<s.from)&&setTimeout(to(e,(function(){f==n&&g(t)})),150)}else{var l=t.clientY<m.top?-20:t.clientY>m.bottom?20:0;l&&setTimeout(to(e,(function(){f==n&&(o.scroller.scrollTop+=l,g(t))})),50)}}function b(t){e.state.selectingText=!1,f=1/0,t&&(_e(t),o.input.focus()),me(o.wrapper.ownerDocument,"mousemove",v),me(o.wrapper.ownerDocument,"mouseup",y),i.history.lastSelOrigin=null}var v=to(e,(function(e){0!==e.buttons&&xe(e)?g(e):b(e)})),y=to(e,b);e.state.selectingText=y,pe(o.wrapper.ownerDocument,"mousemove",v),pe(o.wrapper.ownerDocument,"mouseup",y)}(e,r,t,i)}(t,r,i,e):Ce(e)==n.scroller&&_e(e):2==o?(r&&Yo(t.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==o&&(E?t.display.input.onContextMenu(e):Cr(t)))}}function va(e,t,n){if("char"==n)return new xo(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new xo(tt(t.line,0),lt(e.doc,tt(t.line+1,0)));var r=n(e,t);return new xo(r.from,r.to)}function ya(e,t,n,r){var o,i;if(t.touches)o=t.touches[0].clientX,i=t.touches[0].clientY;else try{o=t.clientX,i=t.clientY}catch(e){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&_e(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(i>s.bottom||!ve(e,n))return we(t);i-=s.top-a.viewOffset;for(var l=0;l<e.display.gutterSpecs.length;++l){var c=a.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=o)return fe(e,n,e,Je(e.doc,i),e.display.gutterSpecs[l].className,t),we(t)}}function _a(e,t){return ya(e,t,"gutterClick",!0)}function ka(e,t){En(e.display,t)||function(e,t){return!!ve(e,"gutterContextMenu")&&ya(e,t,"gutterContextMenu",!1)}(e,t)||ge(e,t,"contextmenu")||E||e.display.input.onContextMenu(t)}function wa(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),zn(e)}ga.prototype.compare=function(e,t,n){return this.time+400>e&&0==nt(t,this.pos)&&n==this.button};var Ea={toString:function(){return"CodeMirror.Init"}},Ca={},xa={};function Sa(e,t,n){if(!t!=!(n&&n!=Ea)){var r=e.display.dragFunctions,o=t?pe:me;o(e.display.scroller,"dragstart",r.start),o(e.display.scroller,"dragenter",r.enter),o(e.display.scroller,"dragover",r.over),o(e.display.scroller,"dragleave",r.leave),o(e.display.scroller,"drop",r.drop)}}function Ia(e){e.options.lineWrapping?(B(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(S(e.display.wrapper,"CodeMirror-wrap"),Wt(e)),cr(e),pr(e),zn(e),setTimeout((function(){return Vr(e)}),100)}function Ta(e,t){var n=this;if(!(this instanceof Ta))return new Ta(e,t);this.options=t=t?O(t):{},O(Ca,t,!1);var r=t.value;"string"==typeof r?r=new Ai(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var o=new Ta.inputStyles[t.inputStyle](this),i=this.display=new vo(e,r,o,t);for(var c in i.wrapper.CodeMirror=this,wa(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),$r(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new j,keySeq:null,specialChars:null},t.autofocus&&!b&&i.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(e){var t=e.display;pe(t.scroller,"mousedown",to(e,ba)),pe(t.scroller,"dblclick",a&&s<11?to(e,(function(t){if(!ge(e,t)){var n=ur(e,t);if(n&&!_a(e,t)&&!En(e.display,t)){_e(t);var r=e.findWordAt(n);Yo(e.doc,r.anchor,r.head)}}})):function(t){return ge(e,t)||_e(t)}),pe(t.scroller,"contextmenu",(function(t){return ka(e,t)})),pe(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||ka(e,n)}));var n,r={end:0};function o(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),(r=t.activeTouch).end=+new Date)}function i(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function l(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}pe(t.scroller,"touchstart",(function(o){if(!ge(e,o)&&!i(o)&&!_a(e,o)){t.input.ensurePolled(),clearTimeout(n);var a=+new Date;t.activeTouch={start:a,moved:!1,prev:a-r.end<=300?r:null},1==o.touches.length&&(t.activeTouch.left=o.touches[0].pageX,t.activeTouch.top=o.touches[0].pageY)}})),pe(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),pe(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!En(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var i,a=e.coordsChar(t.activeTouch,"page");i=!r.prev||l(r,r.prev)?new xo(a,a):!r.prev.prev||l(r,r.prev.prev)?e.findWordAt(a):new xo(tt(a.line,0),lt(e.doc,tt(a.line+1,0))),e.setSelection(i.anchor,i.head),e.focus(),_e(n)}o()})),pe(t.scroller,"touchcancel",o),pe(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(Dr(e,t.scroller.scrollTop),Fr(e,t.scroller.scrollLeft,!0),fe(e,"scroll",e))})),pe(t.scroller,"mousewheel",(function(t){return Eo(e,t)})),pe(t.scroller,"DOMMouseScroll",(function(t){return Eo(e,t)})),pe(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){ge(e,t)||Ee(t)},over:function(t){ge(e,t)||(function(e,t){var n=ur(e,t);if(n){var r=document.createDocumentFragment();yr(e,n,r),e.display.dragCursor||(e.display.dragCursor=N("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),T(e.display.dragCursor,r)}}(e,t),Ee(t))},start:function(t){return function(e,t){if(a&&(!e.state.draggingText||+new Date-Bi<100))Ee(t);else if(!ge(e,t)&&!En(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!p)){var n=N("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),d&&n.parentNode.removeChild(n)}}(e,t)},drop:to(e,Li),leave:function(t){ge(e,t)||Mi(e)}};var c=t.input.getField();pe(c,"keyup",(function(t){return pa.call(e,t)})),pe(c,"keydown",to(e,da)),pe(c,"keypress",to(e,ha)),pe(c,"focus",(function(t){return xr(e,t)})),pe(c,"blur",(function(t){return Sr(e,t)}))}(this),Fi(),Gr(this),this.curOp.forceUpdate=!0,Oo(this,r),t.autofocus&&!b||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&xr(n)}),20):Sr(this),xa)xa.hasOwnProperty(c)&&xa[c](this,t[c],Ea);mo(this),t.finishInit&&t.finishInit(this);for(var u=0;u<Na.length;++u)Na[u](this);qr(this),l&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(i.lineDiv).textRendering&&(i.lineDiv.style.textRendering="auto")}Ta.defaults=Ca,Ta.optionHandlers=xa;var Na=[];function Pa(e,t,n,r){var o,i=e.doc;null==n&&(n="add"),"smart"==n&&(i.mode.indent?o=mt(e,t).state:n="prev");var a=e.options.tabSize,s=Ge(i,t),l=F(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((c=i.mode.indent(o,s.text.slice(u.length),s.text))==V||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>i.first?F(Ge(i,t-1).text,null,a):0:"add"==n?c=l+e.options.indentUnit:"subtract"==n?c=l-e.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var d="",p=0;if(e.options.indentWithTabs)for(var h=Math.floor(c/a);h;--h)p+=a,d+="\t";if(p<c&&(d+=q(c-p)),d!=u)return gi(i,d,tt(t,0),tt(t,u.length),"+input"),s.stateAfter=null,!0;for(var m=0;m<i.sel.ranges.length;m++){var f=i.sel.ranges[m];if(f.head.line==t&&f.head.ch<u.length){var g=tt(t,u.length);Jo(i,m,new xo(g,g));break}}}Ta.defineInitHook=function(e){return Na.push(e)};var Ra=null;function Aa(e){Ra=e}function Ba(e,t,n,r,o){var i=e.doc;e.display.shift=!1,r||(r=i.sel);var a=+new Date-200,s="paste"==o||e.state.pasteIncoming>a,l=Ae(t),c=null;if(s&&r.ranges.length>1)if(Ra&&Ra.text.join("\n")==t){if(r.ranges.length%Ra.text.length==0){c=[];for(var u=0;u<Ra.text.length;u++)c.push(i.splitLines(Ra.text[u]))}}else l.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(c=Y(l,(function(e){return[e]})));for(var d=e.curOp.updateInput,p=r.ranges.length-1;p>=0;p--){var h=r.ranges[p],m=h.from(),f=h.to();h.empty()&&(n&&n>0?m=tt(m.line,m.ch-n):e.state.overwrite&&!s?f=tt(f.line,Math.min(Ge(i,f.line).text.length,f.ch+K(l).length)):s&&Ra&&Ra.lineWise&&Ra.text.join("\n")==l.join("\n")&&(m=f=tt(m.line,0)));var g={from:m,to:f,text:c?c[p%c.length]:l,origin:o||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};di(e.doc,g),cn(e,"inputRead",e,g)}t&&!s&&Ma(e,t),Ar(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function La(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||eo(t,(function(){return Ba(t,n,0,null,"paste")})),!0}function Ma(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var o=n.ranges[r];if(!(o.head.ch>100||r&&n.ranges[r-1].head.line==o.head.line)){var i=e.getModeAt(o.head),a=!1;if(i.electricChars){for(var s=0;s<i.electricChars.length;s++)if(t.indexOf(i.electricChars.charAt(s))>-1){a=Pa(e,o.head.line,"smart");break}}else i.electricInput&&i.electricInput.test(Ge(e.doc,o.head.line).text.slice(0,o.head.ch))&&(a=Pa(e,o.head.line,"smart"));a&&cn(e,"electricInput",e,o.head.line)}}}function Da(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var o=e.doc.sel.ranges[r].head.line,i={anchor:tt(o,0),head:tt(o+1,0)};n.push(i),t.push(e.getRange(i.anchor,i.head))}return{text:t,ranges:n}}function Oa(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Fa(){var e=N("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=N("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return l?e.style.width="1000px":e.setAttribute("wrap","off"),f&&(e.style.border="1px solid black"),Oa(e),t}function ja(e,t,n,r,o){var i=t,a=n,s=Ge(e,t.line),l=o&&"rtl"==e.direction?-n:n;function c(i){var a,c;if("codepoint"==r){var u=s.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(u))a=null;else{var d=n>0?u>=55296&&u<56320:u>=56320&&u<57343;a=new tt(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(d?2:1))),-n)}}else a=o?function(e,t,n,r){var o=ue(t,e.doc.direction);if(!o)return ea(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var i=le(o,n.ch,n.sticky),a=o[i];if("ltr"==e.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from<n.ch))return ea(t,n,r);var s,l=function(e,n){return Qi(t,e instanceof tt?e.ch:e,n)},c=function(n){return e.options.lineWrapping?(s=s||Bn(e,t),Qn(e,t,s,n)):{begin:0,end:t.text.length}},u=c("before"==n.sticky?l(n,-1):n.ch);if("rtl"==e.doc.direction||1==a.level){var d=1==a.level==r<0,p=l(n,d?1:-1);if(null!=p&&(d?p<=a.to&&p<=u.end:p>=a.from&&p>=u.begin)){var h=d?"before":"after";return new tt(n.line,p,h)}}var m=function(e,t,r){for(var i=function(e,t){return t?new tt(n.line,l(e,1),"before"):new tt(n.line,e,"after")};e>=0&&e<o.length;e+=t){var a=o[e],s=t>0==(1!=a.level),c=s?r.begin:l(r.end,-1);if(a.from<=c&&c<a.to)return i(c,s);if(c=s?a.from:l(a.to,-1),r.begin<=c&&c<r.end)return i(c,s)}},f=m(i+r,r,u);if(f)return f;var g=r>0?u.end:l(u.begin,-1);return null==g||r>0&&g==t.text.length||!(f=m(r>0?0:o.length-1,r,c(g)))?null:f}(e.cm,s,t,n):ea(s,t,n);if(null==a){if(i||((c=t.line+l)<e.first||c>=e.first+e.size||(t=new tt(c,t.ch,t.sticky),!(s=Ge(e,c)))))return!1;t=ta(o,e.cm,s,t.line,l)}else t=a;return!0}if("char"==r||"codepoint"==r)c();else if("column"==r)c(!0);else if("word"==r||"group"==r)for(var u=null,d="group"==r,p=e.cm&&e.cm.getHelper(t,"wordChars"),h=!0;!(n<0)||c(!h);h=!1){var m=s.text.charAt(t.ch)||"\n",f=te(m,p)?"w":d&&"\n"==m?"n":!d||/\s/.test(m)?null:"p";if(!d||h||f||(f="s"),u&&u!=f){n<0&&(n=1,c(),t.sticky="after");break}if(f&&(u=f),n>0&&!c(!h))break}var g=si(e,t,i,a,!0);return rt(i,g)&&(g.hitSide=!0),g}function Za(e,t,n,r){var o,i,a=e.doc,s=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*or(e.display),3);o=(n>0?t.bottom:t.top)+n*c}else"line"==r&&(o=n>0?t.bottom+3:t.top-3);for(;(i=Xn(e,s,o)).outside;){if(n<0?o<=0:o>=a.height){i.hitSide=!0;break}o+=5*n}return i}var za=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new j,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Va(e,t){var n=An(e,t.line);if(!n||n.hidden)return null;var r=Ge(e.doc,t.line),o=Pn(n,r,t.line),i=ue(r,e.doc.direction),a="left";i&&(a=le(i,t.ch)%2?"right":"left");var s=On(o.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function Ha(e,t){return t&&(e.bad=!0),e}function Ua(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return Ha(e.clipPos(tt(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var o=0;o<e.display.view.length;o++){var i=e.display.view[o];if(i.node==r)return $a(i,t,n)}}function $a(e,t,n){var r=e.text.firstChild,o=!1;if(!t||!R(r,t))return Ha(tt(Xe(e.line),0),!0);if(t==r&&(o=!0,t=r.childNodes[n],n=0,!t)){var i=e.rest?K(e.rest):e.line;return Ha(tt(Xe(i),i.text.length),o)}var a=3==t.nodeType?t:null,s=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,n&&(n=a.nodeValue.length));s.parentNode!=r;)s=s.parentNode;var l=e.measure,c=l.maps;function u(t,n,r){for(var o=-1;o<(c?c.length:0);o++)for(var i=o<0?l.map:c[o],a=0;a<i.length;a+=3){var s=i[a+2];if(s==t||s==n){var u=Xe(o<0?e.line:e.rest[o]),d=i[a]+r;return(r<0||s!=t)&&(d=i[a+(r?1:0)]),tt(u,d)}}}var d=u(a,s,n);if(d)return Ha(d,o);for(var p=s.nextSibling,h=a?a.nodeValue.length-n:0;p;p=p.nextSibling){if(d=u(p,p.firstChild,0))return Ha(tt(d.line,d.ch-h),o);h+=p.textContent.length}for(var m=s.previousSibling,f=n;m;m=m.previousSibling){if(d=u(m,m.firstChild,-1))return Ha(tt(d.line,d.ch+f),o);f+=m.textContent.length}}za.prototype.init=function(e){var t=this,n=this,r=n.cm,o=n.div=e.lineDiv;function i(e){for(var t=e.target;t;t=t.parentNode){if(t==o)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function a(e){if(i(e)&&!ge(r,e)){if(r.somethingSelected())Aa({lineWise:!1,text:r.getSelections()}),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=Da(r);Aa({lineWise:!0,text:t.text}),"cut"==e.type&&r.operation((function(){r.setSelections(t.ranges,0,H),r.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var a=Ra.text.join("\n");if(e.clipboardData.setData("Text",a),e.clipboardData.getData("Text")==a)return void e.preventDefault()}var s=Fa(),l=s.firstChild;r.display.lineSpace.insertBefore(s,r.display.lineSpace.firstChild),l.value=Ra.text.join("\n");var c=A();M(l),setTimeout((function(){r.display.lineSpace.removeChild(s),c.focus(),c==o&&n.showPrimarySelection()}),50)}}o.contentEditable=!0,Oa(o,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize),pe(o,"paste",(function(e){!i(e)||ge(r,e)||La(e,r)||s<=11&&setTimeout(to(r,(function(){return t.updateFromDOM()})),20)})),pe(o,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),pe(o,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),pe(o,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),pe(o,"touchstart",(function(){return n.forceCompositionEnd()})),pe(o,"input",(function(){t.composing||t.readFromDOMSoon()})),pe(o,"copy",a),pe(o,"cut",a)},za.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},za.prototype.prepareSelection=function(){var e=vr(this.cm,!1);return e.focus=A()==this.div,e},za.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},za.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},za.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),o=r.from(),i=r.to();if(t.display.viewTo==t.display.viewFrom||o.line>=t.display.viewTo||i.line<t.display.viewFrom)e.removeAllRanges();else{var a=Ua(t,e.anchorNode,e.anchorOffset),s=Ua(t,e.focusNode,e.focusOffset);if(!a||a.bad||!s||s.bad||0!=nt(at(a,s),o)||0!=nt(it(a,s),i)){var l=t.display.view,c=o.line>=t.display.viewFrom&&Va(t,o)||{node:l[0].measure.map[2],offset:0},u=i.line<t.display.viewTo&&Va(t,i);if(!u){var d=l[l.length-1].measure,p=d.maps?d.maps[d.maps.length-1]:d.map;u={node:p[p.length-1],offset:p[p.length-2]-p[p.length-3]}}if(c&&u){var h,m=e.rangeCount&&e.getRangeAt(0);try{h=x(c.node,c.offset,u.offset,u.node)}catch(e){}h&&(!n&&t.state.focused?(e.collapse(c.node,c.offset),h.collapsed||(e.removeAllRanges(),e.addRange(h))):(e.removeAllRanges(),e.addRange(h)),m&&null==e.anchorNode?e.addRange(m):n&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},za.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation((function(){return e.cm.curOp.selectionChanged=!0}))}),20)},za.prototype.showMultipleSelections=function(e){T(this.cm.display.cursorDiv,e.cursors),T(this.cm.display.selectionDiv,e.selection)},za.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},za.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return R(this.div,t)},za.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&A()==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},za.prototype.blur=function(){this.div.blur()},za.prototype.getField=function(){return this.div},za.prototype.supportsTouch=function(){return!0},za.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout((function(){return e.pollSelection()}),20):eo(this.cm,(function(){return t.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}))},za.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},za.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(g&&u&&this.cm.display.gutterSpecs.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=Ua(t,e.anchorNode,e.anchorOffset),r=Ua(t,e.focusNode,e.focusOffset);n&&r&&eo(t,(function(){ti(t.doc,Io(n,r),H),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)}))}}},za.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,n,r=this.cm,o=r.display,i=r.doc.sel.primary(),a=i.from(),s=i.to();if(0==a.ch&&a.line>r.firstLine()&&(a=tt(a.line-1,Ge(r.doc,a.line-1).length)),s.ch==Ge(r.doc,s.line).text.length&&s.line<r.lastLine()&&(s=tt(s.line+1,0)),a.line<o.viewFrom||s.line>o.viewTo-1)return!1;a.line==o.viewFrom||0==(e=dr(r,a.line))?(t=Xe(o.view[0].line),n=o.view[0].node):(t=Xe(o.view[e].line),n=o.view[e-1].node.nextSibling);var l,c,u=dr(r,s.line);if(u==o.view.length-1?(l=o.viewTo-1,c=o.lineDiv.lastChild):(l=Xe(o.view[u+1].line)-1,c=o.view[u+1].node.previousSibling),!n)return!1;for(var d=r.doc.splitLines(function(e,t,n,r,o){var i="",a=!1,s=e.doc.lineSeparator(),l=!1;function c(){a&&(i+=s,l&&(i+=s),a=l=!1)}function u(e){e&&(c(),i+=e)}function d(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void u(n);var i,p=t.getAttribute("cm-marker");if(p){var h=e.findMarks(tt(r,0),tt(o+1,0),(g=+p,function(e){return e.id==g}));return void(h.length&&(i=h[0].find(0))&&u(qe(e.doc,i.from,i.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var m=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;m&&c();for(var f=0;f<t.childNodes.length;f++)d(t.childNodes[f]);/^(pre|p)$/i.test(t.nodeName)&&(l=!0),m&&(a=!0)}else 3==t.nodeType&&u(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var g}for(;d(t),t!=n;)t=t.nextSibling,l=!1;return i}(r,n,c,t,l)),p=qe(r.doc,tt(t,0),tt(l,Ge(r.doc,l).text.length));d.length>1&&p.length>1;)if(K(d)==K(p))d.pop(),p.pop(),l--;else{if(d[0]!=p[0])break;d.shift(),p.shift(),t++}for(var h=0,m=0,f=d[0],g=p[0],b=Math.min(f.length,g.length);h<b&&f.charCodeAt(h)==g.charCodeAt(h);)++h;for(var v=K(d),y=K(p),_=Math.min(v.length-(1==d.length?h:0),y.length-(1==p.length?h:0));m<_&&v.charCodeAt(v.length-m-1)==y.charCodeAt(y.length-m-1);)++m;if(1==d.length&&1==p.length&&t==a.line)for(;h&&h>a.ch&&v.charCodeAt(v.length-m-1)==y.charCodeAt(y.length-m-1);)h--,m++;d[d.length-1]=v.slice(0,v.length-m).replace(/^\u200b+/,""),d[0]=d[0].slice(h).replace(/\u200b+$/,"");var k=tt(t,h),w=tt(l,p.length?K(p).length-m:0);return d.length>1||d[0]||nt(k,w)?(gi(r.doc,d,k,w,"+input"),!0):void 0},za.prototype.ensurePolled=function(){this.forceCompositionEnd()},za.prototype.reset=function(){this.forceCompositionEnd()},za.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},za.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},za.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||eo(this.cm,(function(){return pr(e.cm)}))},za.prototype.setUneditable=function(e){e.contentEditable="false"},za.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||to(this.cm,Ba)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},za.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},za.prototype.onContextMenu=function(){},za.prototype.resetPosition=function(){},za.prototype.needsContentAttribute=!0;var Wa=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new j,this.hasSelection=!1,this.composing=null};Wa.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var o=this.textarea;function i(e){if(!ge(r,e)){if(r.somethingSelected())Aa({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=Da(r);Aa({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,H):(n.prevInput="",o.value=t.text.join("\n"),M(o))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),f&&(o.style.width="0px"),pe(o,"input",(function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),pe(o,"paste",(function(e){ge(r,e)||La(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),pe(o,"cut",i),pe(o,"copy",i),pe(e.scroller,"paste",(function(t){if(!En(e,t)&&!ge(r,t)){if(!o.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var i=new Event("paste");i.clipboardData=t.clipboardData,o.dispatchEvent(i)}})),pe(e.lineSpace,"selectstart",(function(t){En(e,t)||_e(t)})),pe(o,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),pe(o,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},Wa.prototype.createField=function(e){this.wrapper=Fa(),this.textarea=this.wrapper.firstChild},Wa.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Wa.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=vr(e);if(e.options.moveInputWithCursor){var o=qn(e,n.sel.primary().head,"div"),i=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,o.top+a.top-i.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,o.left+a.left-i.left))}return r},Wa.prototype.showSelection=function(e){var t=this.cm.display;T(t.cursorDiv,e.cursors),T(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Wa.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&M(this.textarea),a&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},Wa.prototype.getField=function(){return this.textarea},Wa.prototype.supportsTouch=function(){return!1},Wa.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!b||A()!=this.textarea))try{this.textarea.focus()}catch(e){}},Wa.prototype.blur=function(){this.textarea.blur()},Wa.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Wa.prototype.receivedFocus=function(){this.slowPoll()},Wa.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},Wa.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}))},Wa.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Be(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var o=n.value;if(o==r&&!t.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===o||v&&/[\uf700-\uf7ff]/.test(o))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var i=o.charCodeAt(0);if(8203!=i||r||(r=""),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var l=0,c=Math.min(r.length,o.length);l<c&&r.charCodeAt(l)==o.charCodeAt(l);)++l;return eo(t,(function(){Ba(t,o.slice(l),r.length-l,null,e.composing?"*compose":null),o.length>1e3||o.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=o,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},Wa.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Wa.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},Wa.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,o=t.textarea;t.contextMenuPending&&t.contextMenuPending();var i=ur(n,e),c=r.scroller.scrollTop;if(i&&!d){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(i)&&to(n,ti)(n.doc,Io(i),H);var u,p=o.style.cssText,h=t.wrapper.style.cssText,m=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",o.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-m.top-5)+"px; left: "+(e.clientX-m.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(u=window.scrollY),r.input.focus(),l&&window.scrollTo(null,u),r.input.reset(),n.somethingSelected()||(o.value=t.prevInput=" "),t.contextMenuPending=b,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&s>=9&&g(),E){Ee(e);var f=function(){me(window,"mouseup",f),setTimeout(b,20)};pe(window,"mouseup",f)}else setTimeout(b,50)}function g(){if(null!=o.selectionStart){var e=n.somethingSelected(),i=""+(e?o.value:"");o.value="⇚",o.value=i,t.prevInput=e?"":"",o.selectionStart=1,o.selectionEnd=i.length,r.selForContextMenu=n.doc.sel}}function b(){if(t.contextMenuPending==b&&(t.contextMenuPending=!1,t.wrapper.style.cssText=h,o.style.cssText=p,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=c),null!=o.selectionStart)){(!a||a&&s<9)&&g();var e=0,i=function(){r.selForContextMenu==n.doc.sel&&0==o.selectionStart&&o.selectionEnd>0&&""==t.prevInput?to(n,ci)(n):e++<10?r.detectingSelectAll=setTimeout(i,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(i,200)}}},Wa.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},Wa.prototype.setUneditable=function(){},Wa.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,r,o,i){e.defaults[n]=r,o&&(t[n]=i?function(e,t,n){n!=Ea&&o(e,t,n)}:o)}e.defineOption=n,e.Init=Ea,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,Ao(e)}),!0),n("indentUnit",2,Ao,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){Bo(e),zn(e),pr(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var o=0;;){var i=e.text.indexOf(t,o);if(-1==i)break;o=i+t.length,n.push(tt(r,i))}r++}));for(var o=n.length-1;o>=0;o--)gi(e.doc,t,n[o],tt(n[o].line,n[o].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Ea&&e.refresh()})),n("specialCharPlaceholder",Qt,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",b?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!_),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){wa(e),bo(e)}),!0),n("keyMap","default",(function(e,t,n){var r=Xi(t),o=n!=Ea&&Xi(n);o&&o.detach&&o.detach(e,r),r.attach&&r.attach(e,o||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ia,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=fo(t,e.options.lineNumbers),bo(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?sr(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return Vr(e)}),!0),n("scrollbarStyle","native",(function(e){$r(e),Vr(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=fo(e.options.gutters,t),bo(e)}),!0),n("firstLineNumber",1,bo,!0),n("lineNumberFormatter",(function(e){return e}),bo,!0),n("showCursorWhenSelecting",!1,br,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Sr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,Sa),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,br,!0),n("singleCursorHeightPerLine",!0,br,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Bo,!0),n("addModeClass",!1,Bo,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,Bo,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}(Ta),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,o=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&to(this,t[e])(this,n,o),fe(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Xi(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:no((function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");(function(e,t,n){for(var r=0,o=n(t);r<e.length&&n(e[r])<=o;)r++;e.splice(r,0,t)})(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(e){return e.priority})),this.state.modeGen++,pr(this)})),removeOverlay:no((function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void pr(this)}})),indentLine:no((function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),Qe(this.doc,e)&&Pa(this,e,t,n)})),indentSelection:no((function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var o=t[r];if(o.empty())o.head.line>n&&(Pa(this,o.head.line,e,!0),n=o.head.line,r==this.doc.sel.primIndex&&Ar(this));else{var i=o.from(),a=o.to(),s=Math.max(n,i.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l<n;++l)Pa(this,l,e);var c=this.doc.sel.ranges;0==i.ch&&t.length==c.length&&c[r].from().ch>0&&Jo(this.doc,r,new xo(i,c[r].to()),H)}}})),getTokenAt:function(e,t){return yt(this,e,t)},getLineTokens:function(e,t){return yt(this,tt(e),t,!0)},getTokenTypeAt:function(e){e=lt(this.doc,e);var t,n=ht(this,Ge(this.doc,e.line)),r=0,o=(n.length-1)/2,i=e.ch;if(0==i)t=n[2];else for(;;){var a=r+o>>1;if((a?n[2*a-1]:0)>=i)o=a;else{if(!(n[2*a+1]<i)){t=n[2*a+2];break}r=a+1}}var s=t?t.indexOf("overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!n.hasOwnProperty(t))return r;var o=n[t],i=this.getModeAt(e);if("string"==typeof i[t])o[i[t]]&&r.push(o[i[t]]);else if(i[t])for(var a=0;a<i[t].length;a++){var s=o[i[t][a]];s&&r.push(s)}else i.helperType&&o[i.helperType]?r.push(o[i.helperType]):o[i.name]&&r.push(o[i.name]);for(var l=0;l<o._global.length;l++){var c=o._global[l];c.pred(i,this)&&-1==Z(r,c.val)&&r.push(c.val)}return r},getStateAfter:function(e,t){var n=this.doc;return mt(this,(e=st(n,null==e?n.first+n.size-1:e))+1,t).state},cursorCoords:function(e,t){var n=this.doc.sel.primary();return qn(this,null==e?n.head:"object"==typeof e?lt(this.doc,e):e?n.from():n.to(),t||"page")},charCoords:function(e,t){return Gn(this,lt(this.doc,e),t||"page")},coordsChar:function(e,t){return Xn(this,(e=Wn(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Wn(this,{top:e,left:0},t||"page").top,Je(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r,o=!1;if("number"==typeof e){var i=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>i&&(e=i,o=!0),r=Ge(this.doc,e)}else r=e;return $n(this,r,{top:0,left:0},t||"page",n||o).top+(o?this.doc.height-Ut(r):0)},defaultTextHeight:function(){return or(this.display)},defaultCharWidth:function(){return ir(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,o){var i,a,s,l=this.display,c=(e=qn(this,lt(this.doc,e))).bottom,u=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),l.sizer.appendChild(t),"over"==r)c=e.top;else if("above"==r||"near"==r){var d=Math.max(l.wrapper.clientHeight,this.doc.height),p=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>d)&&e.top>t.offsetHeight?c=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=d&&(c=e.bottom),u+t.offsetWidth>p&&(u=p-t.offsetWidth)}t.style.top=c+"px",t.style.left=t.style.right="","right"==o?(u=l.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==o?u=0:"middle"==o&&(u=(l.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),n&&(i=this,a={left:u,top:c,right:u+t.offsetWidth,bottom:c+t.offsetHeight},null!=(s=Pr(i,a)).scrollTop&&Dr(i,s.scrollTop),null!=s.scrollLeft&&Fr(i,s.scrollLeft))},triggerOnKeyDown:no(da),triggerOnKeyPress:no(ha),triggerOnKeyUp:pa,triggerOnMouseDown:no(ba),execCommand:function(e){if(na.hasOwnProperty(e))return na[e].call(null,this)},triggerElectric:no((function(e){Ma(this,e)})),findPosH:function(e,t,n,r){var o=1;t<0&&(o=-1,t=-t);for(var i=lt(this.doc,e),a=0;a<t&&!(i=ja(this.doc,i,o,n,r)).hitSide;++a);return i},moveH:no((function(e,t){var n=this;this.extendSelectionsBy((function(r){return n.display.shift||n.doc.extend||r.empty()?ja(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()}),$)})),deleteH:no((function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Ji(this,(function(n){var o=ja(r,n.head,e,t,!1);return e<0?{from:o,to:n.head}:{from:n.head,to:o}}))})),findPosV:function(e,t,n,r){var o=1,i=r;t<0&&(o=-1,t=-t);for(var a=lt(this.doc,e),s=0;s<t;++s){var l=qn(this,a,"div");if(null==i?i=l.left:l.left=i,(a=Za(this,l,o,n)).hitSide)break}return a},moveV:no((function(e,t){var n=this,r=this.doc,o=[],i=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy((function(a){if(i)return e<0?a.from():a.to();var s=qn(n,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn),o.push(s.left);var l=Za(n,s,e,t);return"page"==t&&a==r.sel.primary()&&Rr(n,Gn(n,l,"div").top-s.top),l}),$),o.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=o[a]})),findWordAt:function(e){var t=Ge(this.doc,e.line).text,n=e.ch,r=e.ch;if(t){var o=this.getHelper(e,"wordChars");"before"!=e.sticky&&r!=t.length||!n?++r:--n;for(var i=t.charAt(n),a=te(i,o)?function(e){return te(e,o)}:/\s/.test(i)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!te(e)};n>0&&a(t.charAt(n-1));)--n;for(;r<t.length&&a(t.charAt(r));)++r}return new xo(tt(e.line,n),tt(e.line,r))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?B(this.display.cursorDiv,"CodeMirror-overwrite"):S(this.display.cursorDiv,"CodeMirror-overwrite"),fe(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==A()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:no((function(e,t){Br(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-In(this)-this.display.barHeight,width:e.scrollWidth-In(this)-this.display.barWidth,clientHeight:Nn(this),clientWidth:Tn(this)}},scrollIntoView:no((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:tt(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?function(e,t){Lr(e),e.curOp.scrollToPos=t}(this,e):Mr(this,e.from,e.to,e.margin)})),setSize:no((function(e,t){var n=this,r=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&Zn(this);var o=this.display.viewFrom;this.doc.iter(o,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){hr(n,o,"widget");break}++o})),this.curOp.forceUpdate=!0,fe(this,"refresh",this)})),operation:function(e){return eo(this,e)},startOperation:function(){return Gr(this)},endOperation:function(){return qr(this)},refresh:no((function(){var e=this.display.cachedTextHeight;pr(this),this.curOp.forceUpdate=!0,zn(this),Br(this,this.doc.scrollLeft,this.doc.scrollTop),uo(this.display),(null==e||Math.abs(e-or(this.display))>.5||this.options.lineWrapping)&&cr(this),fe(this,"refresh",this)})),swapDoc:no((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Oo(this,e),zn(this),this.display.input.reset(),Br(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,cn(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ye(e),e.registerHelper=function(t,r,o){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=o},e.registerGlobalHelper=function(t,r,o,i){e.registerHelper(t,r,i),n[t]._global.push({pred:o,val:i})}}(Ta);var Ga="iter insert remove copy getEditor constructor".split(" ");for(var qa in Ai.prototype)Ai.prototype.hasOwnProperty(qa)&&Z(Ga,qa)<0&&(Ta.prototype[qa]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ai.prototype[qa]));return ye(Ai),Ta.inputStyles={textarea:Wa,contenteditable:za},Ta.defineMode=function(e){Ta.defaults.mode||"null"==e||(Ta.defaults.mode=e),Fe.apply(this,arguments)},Ta.defineMIME=function(e,t){Oe[e]=t},Ta.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Ta.defineMIME("text/plain","null"),Ta.defineExtension=function(e,t){Ta.prototype[e]=t},Ta.defineDocExtension=function(e,t){Ai.prototype[e]=t},Ta.fromTextArea=function(e,t){if((t=t?O(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=A();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=s.getValue()}var o;if(e.form&&(pe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var i=e.form;o=i.submit;try{var a=i.submit=function(){r(),i.submit=o,i.submit(),i.submit=a}}catch(e){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(me(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=o))}},e.style.display="none";var s=Ta((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s},function(e){e.off=me,e.on=pe,e.wheelEventPixels=wo,e.Doc=Ai,e.splitLines=Ae,e.countColumn=F,e.findColumn=W,e.isWordChar=ee,e.Pass=V,e.signal=fe,e.Line=Gt,e.changeEnd=To,e.scrollbarModel=Ur,e.Pos=tt,e.cmpPos=nt,e.modes=De,e.mimeModes=Oe,e.resolveMode=je,e.getMode=Ze,e.modeExtensions=ze,e.extendMode=Ve,e.copyState=He,e.startState=$e,e.innerMode=Ue,e.commands=na,e.keyMap=Ui,e.keyName=Yi,e.isModifierKey=qi,e.lookupKey=Gi,e.normalizeKeyMap=Wi,e.StringStream=We,e.SharedTextMarker=Ti,e.TextMarker=Si,e.LineWidget=Ei,e.e_preventDefault=_e,e.e_stopPropagation=ke,e.e_stop=Ee,e.addClass=B,e.contains=R,e.rmClass=S,e.keyNames=Zi}(Ta),Ta.version="5.65.2",Ta}()},25002:function(e,t,n){!function(e){"use strict";function t(e){for(var t={},n=0;n<e.length;++n)t[e[n].toLowerCase()]=!0;return t}e.defineMode("css",(function(t,n){var r=n.inline;n.propertyKeywords||(n=e.resolveMode("text/css"));var o,i,a=t.indentUnit,s=n.tokenHooks,l=n.documentTypes||{},c=n.mediaTypes||{},u=n.mediaFeatures||{},d=n.mediaValueKeywords||{},p=n.propertyKeywords||{},h=n.nonStandardPropertyKeywords||{},m=n.fontProperties||{},f=n.counterDescriptors||{},g=n.colorKeywords||{},b=n.valueKeywords||{},v=n.allowNested,y=n.lineComment,_=!0===n.supportsAtComponent,k=!1!==t.highlightNonStandardPropertyKeywords;function w(e,t){return o=t,e}function E(e,t){var n=e.next();if(s[n]){var r=s[n](e,t);if(!1!==r)return r}return"@"==n?(e.eatWhile(/[\w\\\-]/),w("def",e.current())):"="==n||("~"==n||"|"==n)&&e.eat("=")?w(null,"compare"):'"'==n||"'"==n?(t.tokenize=C(n),t.tokenize(e,t)):"#"==n?(e.eatWhile(/[\w\\\-]/),w("atom","hash")):"!"==n?(e.match(/^\s*\w*/),w("keyword","important")):/\d/.test(n)||"."==n&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),w("number","unit")):"-"!==n?/[,+>*\/]/.test(n)?w(null,"select-op"):"."==n&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?w("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?w(null,n):e.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(e.current())&&(t.tokenize=x),w("variable callee","variable")):/[\w\\\-]/.test(n)?(e.eatWhile(/[\w\\\-]/),w("property","word")):w(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),w("number","unit")):e.match(/^-[\w\\\-]*/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?w("variable-2","variable-definition"):w("variable-2","variable")):e.match(/^\w+-/)?w("meta","meta"):void 0}function C(e){return function(t,n){for(var r,o=!1;null!=(r=t.next());){if(r==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==r}return(r==e||!o&&")"!=e)&&(n.tokenize=null),w("string","string")}}function x(e,t){return e.next(),e.match(/^\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=C(")"),w(null,"(")}function S(e,t,n){this.type=e,this.indent=t,this.prev=n}function I(e,t,n,r){return e.context=new S(n,t.indentation()+(!1===r?0:a),e.context),n}function T(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function N(e,t,n){return A[n.context.type](e,t,n)}function P(e,t,n,r){for(var o=r||1;o>0;o--)n.context=n.context.prev;return N(e,t,n)}function R(e){var t=e.current().toLowerCase();i=b.hasOwnProperty(t)?"atom":g.hasOwnProperty(t)?"keyword":"variable"}var A={top:function(e,t,n){if("{"==e)return I(n,t,"block");if("}"==e&&n.context.prev)return T(n);if(_&&/@component/i.test(e))return I(n,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return I(n,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return I(n,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return n.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return I(n,t,"at");if("hash"==e)i="builtin";else if("word"==e)i="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return I(n,t,"interpolation");if(":"==e)return"pseudo";if(v&&"("==e)return I(n,t,"parens")}return n.context.type},block:function(e,t,n){if("word"==e){var r=t.current().toLowerCase();return p.hasOwnProperty(r)?(i="property","maybeprop"):h.hasOwnProperty(r)?(i=k?"string-2":"property","maybeprop"):v?(i=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(i+=" error","maybeprop")}return"meta"==e?"block":v||"hash"!=e&&"qualifier"!=e?A.top(e,t,n):(i="error","block")},maybeprop:function(e,t,n){return":"==e?I(n,t,"prop"):N(e,t,n)},prop:function(e,t,n){if(";"==e)return T(n);if("{"==e&&v)return I(n,t,"propBlock");if("}"==e||"{"==e)return P(e,t,n);if("("==e)return I(n,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)R(t);else if("interpolation"==e)return I(n,t,"interpolation")}else i+=" error";return"prop"},propBlock:function(e,t,n){return"}"==e?T(n):"word"==e?(i="property","maybeprop"):n.context.type},parens:function(e,t,n){return"{"==e||"}"==e?P(e,t,n):")"==e?T(n):"("==e?I(n,t,"parens"):"interpolation"==e?I(n,t,"interpolation"):("word"==e&&R(t),"parens")},pseudo:function(e,t,n){return"meta"==e?"pseudo":"word"==e?(i="variable-3",n.context.type):N(e,t,n)},documentTypes:function(e,t,n){return"word"==e&&l.hasOwnProperty(t.current())?(i="tag",n.context.type):A.atBlock(e,t,n)},atBlock:function(e,t,n){if("("==e)return I(n,t,"atBlock_parens");if("}"==e||";"==e)return P(e,t,n);if("{"==e)return T(n)&&I(n,t,v?"block":"top");if("interpolation"==e)return I(n,t,"interpolation");if("word"==e){var r=t.current().toLowerCase();i="only"==r||"not"==r||"and"==r||"or"==r?"keyword":c.hasOwnProperty(r)?"attribute":u.hasOwnProperty(r)?"property":d.hasOwnProperty(r)?"keyword":p.hasOwnProperty(r)?"property":h.hasOwnProperty(r)?k?"string-2":"property":b.hasOwnProperty(r)?"atom":g.hasOwnProperty(r)?"keyword":"error"}return n.context.type},atComponentBlock:function(e,t,n){return"}"==e?P(e,t,n):"{"==e?T(n)&&I(n,t,v?"block":"top",!1):("word"==e&&(i="error"),n.context.type)},atBlock_parens:function(e,t,n){return")"==e?T(n):"{"==e||"}"==e?P(e,t,n,2):A.atBlock(e,t,n)},restricted_atBlock_before:function(e,t,n){return"{"==e?I(n,t,"restricted_atBlock"):"word"==e&&"@counter-style"==n.stateArg?(i="variable","restricted_atBlock_before"):N(e,t,n)},restricted_atBlock:function(e,t,n){return"}"==e?(n.stateArg=null,T(n)):"word"==e?(i="@font-face"==n.stateArg&&!m.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==n.stateArg&&!f.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(e,t,n){return"word"==e?(i="variable","keyframes"):"{"==e?I(n,t,"top"):N(e,t,n)},at:function(e,t,n){return";"==e?T(n):"{"==e||"}"==e?P(e,t,n):("word"==e?i="tag":"hash"==e&&(i="builtin"),"at")},interpolation:function(e,t,n){return"}"==e?T(n):"{"==e||";"==e?P(e,t,n):("word"==e?i="variable":"variable"!=e&&"("!=e&&")"!=e&&(i="error"),"interpolation")}};return{startState:function(e){return{tokenize:null,state:r?"block":"top",stateArg:null,context:new S(r?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||E)(e,t);return n&&"object"==typeof n&&(o=n[1],n=n[0]),i=n,"comment"!=o&&(t.state=A[t.state](o,e,t)),i},indent:function(e,t){var n=e.context,r=t&&t.charAt(0),o=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev),n.prev&&("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=r||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=r||"at"!=n.type&&"atBlock"!=n.type)||(o=Math.max(0,n.indent-a)):o=(n=n.prev).indent),o},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:y,fold:"brace"}}));var n=["domain","regexp","url","url-prefix"],r=t(n),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],i=t(o),a=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme","dynamic-range","video-dynamic-range"],s=t(a),l=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],c=t(l),u=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],d=t(u),p=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],h=t(p),m=t(["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),f=t(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),g=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],b=t(g),v=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],y=t(v),_=n.concat(o).concat(a).concat(l).concat(u).concat(p).concat(g).concat(v);function k(e,t){for(var n,r=!1;null!=(n=e.next());){if(r&&"/"==n){t.tokenize=null;break}r="*"==n}return["comment","comment"]}e.registerHelper("hintWords","css",_),e.defineMIME("text/css",{documentTypes:r,mediaTypes:i,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:h,fontProperties:m,counterDescriptors:f,colorKeywords:b,valueKeywords:y,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=k,k(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:i,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:h,colorKeywords:b,valueKeywords:y,fontProperties:m,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=k,k(e,t)):["operator","operator"]},":":function(e){return!!e.match(/^\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:i,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:h,colorKeywords:b,valueKeywords:y,fontProperties:m,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=k,k(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:r,mediaTypes:i,mediaFeatures:s,propertyKeywords:d,nonStandardPropertyKeywords:h,fontProperties:m,counterDescriptors:f,colorKeywords:b,valueKeywords:y,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=k,k(e,t))}},name:"css",helperType:"gss"})}(n(70907))},24481:function(e){e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},35572:function(e,t,n){t.parse=n(73603),t.stringify=n(64335)},73603:function(e){var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function n(e){return e?e.replace(/^\s+|\s+$/g,""):""}function r(e,t){var n=e&&"string"==typeof e.type,o=n?e:t;for(var i in e){var a=e[i];Array.isArray(a)?a.forEach((function(e){r(e,o)})):a&&"object"==typeof a&&r(a,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}e.exports=function(e,o){o=o||{};var i=1,a=1;function s(e){var t=e.match(/\n/g);t&&(i+=t.length);var n=e.lastIndexOf("\n");a=~n?e.length-n:a+e.length}function l(){var e={line:i,column:a};return function(t){return t.position=new c(e),g(),t}}function c(e){this.start=e,this.end={line:i,column:a},this.source=o.source}c.prototype.content=e;var u=[];function d(t){var n=new Error(o.source+":"+i+":"+a+": "+t);if(n.reason=t,n.filename=o.source,n.line=i,n.column=a,n.source=e,!o.silent)throw n;u.push(n)}function p(){return f(/^{\s*/)}function h(){return f(/^}/)}function m(){var t,n,r,o=[];for(g(),b(o);e.length&&"}"!=e.charAt(0)&&(t=T()||(n=void 0,r=void 0,n=l(),(r=y())?(b(),n({type:"rule",selectors:r,declarations:k()})):d("selector missing")));)!1!==t&&(o.push(t),b(o));return o}function f(t){var n=t.exec(e);if(n){var r=n[0];return s(r),e=e.slice(r.length),n}}function g(){f(/^\s*/)}function b(e){var t;for(e=e||[];t=v();)!1!==t&&e.push(t);return e}function v(){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 r=e.slice(2,n-2);return a+=2,s(r),e=e.slice(n),a+=2,t({type:"comment",comment:r})}}function y(){var e=f(/^([^{]+)/);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(),r=f(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(r){if(r=n(r[0]),!f(/^:\s*/))return d("property missing ':'");var o=f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),i=e({type:"declaration",property:r.replace(t,""),value:o?n(o[0]).replace(t,""):""});return f(/^[;\s]*/),i}}function k(){var e,t=[];if(!p())return d("missing '{'");for(b(t);e=_();)!1!==e&&(t.push(e),b(t));return h()?t:d("missing '}'")}function w(){for(var e,t=[],n=l();e=f(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),f(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:k()})}var E,C=I("import"),x=I("charset"),S=I("namespace");function I(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var n=l(),r=f(t);if(r){var o={type:e};return o[e]=r[1].trim(),n(o)}}}function T(){if("@"==e[0])return function(){var e=l();if(t=f(/^@([-\w]+)?keyframes\s*/)){var t,n=t[1];if(!(t=f(/^([-\w]+)\s*/)))return d("@keyframes missing name");var r,o=t[1];if(!p())return d("@keyframes missing '{'");for(var i=b();r=w();)i.push(r),i=i.concat(b());return h()?e({type:"keyframes",name:o,vendor:n,keyframes:i}):d("@keyframes missing '}'")}}()||function(){var e=l(),t=f(/^@media *([^{]+)/);if(t){var r=n(t[1]);if(!p())return d("@media missing '{'");var o=b().concat(m());return h()?e({type:"media",media:r,rules:o}):d("@media missing '}'")}}()||function(){var e=l(),t=f(/^@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=f(/^@supports *([^{]+)/);if(t){var r=n(t[1]);if(!p())return d("@supports missing '{'");var o=b().concat(m());return h()?e({type:"supports",supports:r,rules:o}):d("@supports missing '}'")}}()||C()||x()||S()||function(){var e=l(),t=f(/^@([-\w]+)?document *([^{]+)/);if(t){var r=n(t[1]),o=n(t[2]);if(!p())return d("@document missing '{'");var i=b().concat(m());return h()?e({type:"document",document:o,vendor:r,rules:i}):d("@document missing '}'")}}()||function(){var e=l();if(f(/^@page */)){var t=y()||[];if(!p())return d("@page missing '{'");for(var n,r=b();n=_();)r.push(n),r=r.concat(b());return h()?e({type:"page",selectors:t,declarations:r}):d("@page missing '}'")}}()||function(){var e=l();if(f(/^@host\s*/)){if(!p())return d("@host missing '{'");var t=b().concat(m());return h()?e({type:"host",rules:t}):d("@host missing '}'")}}()||function(){var e=l();if(f(/^@font-face\s*/)){if(!p())return d("@font-face missing '{'");for(var t,n=b();t=_();)n.push(t),n=n.concat(b());return h()?e({type:"font-face",declarations:n}):d("@font-face missing '}'")}}()}return r((E=m(),{type:"stylesheet",stylesheet:{source:o.source,rules:E,parsingErrors:u}}))}},68829:function(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 r=0,o=e.length;r<o;r++)n+=this.visit(e[r]),t&&r<o-1&&(n+=this.emit(t));return n}},21352:function(e,t,n){var r=n(68829),o=n(89118);function i(e){r.call(this,e)}e.exports=i,o(i,r),i.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},i.prototype.comment=function(e){return this.emit("",e.position)},i.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},i.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},i.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("}")},i.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},i.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},i.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},i.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},i.prototype.keyframe=function(e){var t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},i.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("}")},i.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},i.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},i.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},i.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("}"):""},i.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")}},20478:function(e,t,n){var r=n(68829),o=n(89118);function i(e){e=e||{},r.call(this,e),this.indentation=e.indent}e.exports=i,o(i,r),i.prototype.compile=function(e){return this.stylesheet(e)},i.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},i.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},i.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},i.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}")},i.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}")},i.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},i.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},i.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}")},i.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)+"}")},i.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")},i.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}")},i.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}")},i.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}")},i.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},i.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()+"}"):""},i.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},i.prototype.indent=function(e){return this.level=this.level||1,null!=e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")}},64335:function(e,t,n){var r=n(21352),o=n(20478);e.exports=function(e,t){var i=(t=t||{}).compress?new r(t):new o(t);if(t.sourcemap){n(51073)(i);var a=i.compile(e);return i.applySourceMaps(),{code:a,map:"generator"===t.sourcemap?i.map:i.map.toJSON()}}return i.compile(e)}},51073:function(e,t,n){var r=n(20065).SourceMapGenerator,o=n(20065).SourceMapConsumer,i=n(14471),a=n(37019),s=n(96344);e.exports=function(e){for(var n in e._comment=e.comment,e.map=new r,e.position={line:1,column:1},e.files={},t)e[n]=t[n]};const l=function(e){return"\\"===s.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=i.resolveSync(t,e,a.readFileSync);if(n){var r=new o(n.map),c=n.sourcesRelativeTo;this.map.applySourceMap(r,e,l(s.dirname(c)))}}}),this)},t.comment=function(e){return/^# sourceMappingURL=/.test(e.comment)?this.emit("",e.position):this._comment(e)}},20242:function(e){"use strict";var t="%[a-f0-9]{2}",n=new RegExp(t,"gi"),r=new RegExp("("+t+")+","gi");function o(e,t){try{return decodeURIComponent(e.join(""))}catch(e){}if(1===e.length)return e;t=t||1;var n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],o(n),o(r))}function i(e){try{return decodeURIComponent(e)}catch(i){for(var t=e.match(n),r=1;r<t.length;r++)t=(e=o(t,r).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=r.exec(e);n;){try{t[n[0]]=decodeURIComponent(n[0])}catch(e){var o=i(n[0]);o!==n[0]&&(t[n[0]]=o)}n=r.exec(e)}t["%C2"]="�";for(var a=Object.keys(t),s=0;s<a.length;s++){var l=a[s];e=e.replace(new RegExp(l,"g"),t[l])}return e}(e)}}},22897:function(e,t){"use strict";function n(){}function r(e,t,n,r,o){for(var i=0,a=t.length,s=0,l=0;i<a;i++){var c=t[i];if(c.removed){if(c.value=e.join(r.slice(l,l+c.count)),l+=c.count,i&&t[i-1].added){var u=t[i-1];t[i-1]=t[i],t[i]=u}}else{if(!c.added&&o){var d=n.slice(s,s+c.count);d=d.map((function(e,t){var n=r[l+t];return n.length>e.length?n:e})),c.value=e.join(d)}else c.value=e.join(n.slice(s,s+c.count));s+=c.count,c.added||(l+=c.count)}}var p=t[a-1];return a>1&&"string"==typeof p.value&&(p.added||p.removed)&&e.equals("",p.value)&&(t[a-2].value+=p.value,t.pop()),t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.callback;"function"==typeof n&&(o=n,n={}),this.options=n;var i=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 s=(t=this.removeEmpty(this.tokenize(t))).length,l=e.length,c=1,u=s+l,d=[{newPos:-1,components:[]}],p=this.extractCommon(d[0],t,e,0);if(d[0].newPos+1>=s&&p+1>=l)return a([{value:this.join(t),count:t.length}]);function h(){for(var n=-1*c;n<=c;n+=2){var o=void 0,u=d[n-1],p=d[n+1],h=(p?p.newPos:0)-n;u&&(d[n-1]=void 0);var m=u&&u.newPos+1<s,f=p&&0<=h&&h<l;if(m||f){if(!m||f&&u.newPos<p.newPos?(o={newPos:(g=p).newPos,components:g.components.slice(0)},i.pushComponent(o.components,void 0,!0)):((o=u).newPos++,i.pushComponent(o.components,!0,void 0)),h=i.extractCommon(o,t,e,n),o.newPos+1>=s&&h+1>=l)return a(r(i,o.components,t,e,i.useLongestToken));d[n]=o}else d[n]=void 0}var g;c++}if(o)!function e(){setTimeout((function(){if(c>u)return o();h()||e()}),0)}();else for(;c<=u;){var m=h();if(m)return m}},pushComponent:function(e,t,n){var r=e[e.length-1];r&&r.added===t&&r.removed===n?e[e.length-1]={count:r.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,r){for(var o=t.length,i=n.length,a=e.newPos,s=a-r,l=0;a+1<o&&s+1<i&&this.equals(t[a+1],n[s+1]);)a++,s++,l++;return l&&e.components.push({count:l}),e.newPos=a,s},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("")}}},79646:function(e,t,n){"use strict";var r;t.Kx=function(e,t,n){return o.diff(e,t,n)};var o=new(((r=n(22897))&&r.__esModule?r:{default:r}).default)},3099:function(e,t,n){var r=n(24481);e.exports=function(e){var t=r(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var o=e.style.lineHeight;e.style.lineHeight=t+"em",t=r(e,"line-height"),n=parseFloat(t,10),o?e.style.lineHeight=o:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var i=e.nodeName,a=document.createElement(i);a.innerHTML=" ","TEXTAREA"===i.toUpperCase()&&a.setAttribute("rows","1");var s=r(e,"font-size");a.style.fontSize=s,a.style.padding="0px",a.style.border="0px";var l=document.body;l.appendChild(a),n=a.offsetHeight,l.removeChild(a)}return n}},91544:function(e,t,n){e.exports=n(42802)},23762:function(e){"use strict";var t=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:t,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:t&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:t&&!!window.screen,isInWorker:!t};e.exports=n},79775:function(e){var t,n,r,o,i,a,s,l,c,u,d,p,h,m,f,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),v=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(p=/\b(iPhone|iP[ao]d)/.exec(e),h=/\b(iP[ao]d)/.exec(e),u=/Android/i.exec(e),m=/FBAN\/\w+;/i.exec(e),f=/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 y=/(?:Trident\/(\d+.\d+))/.exec(e);a=y?parseFloat(y[1])+4:t,n=b[2]?parseFloat(b[2]):NaN,r=b[3]?parseFloat(b[3]):NaN,(o=b[4]?parseFloat(b[4]):NaN)?(b=/(?:Chrome\/(\d+\.\d+))/.exec(e),i=b&&b[1]?parseFloat(b[1]):NaN):i=NaN}else t=n=r=i=o=NaN;if(v){if(v[1]){var _=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);s=!_||parseFloat(_[1].replace("_","."))}else s=!1;l=!!v[2],c=!!v[3]}else s=l=c=!1}}var v={ie:function(){return b()||t},ieCompatibilityMode:function(){return b()||a>t},ie64:function(){return v.ie()&&d},firefox:function(){return b()||n},opera:function(){return b()||r},webkit:function(){return b()||o},safari:function(){return v.webkit()},chrome:function(){return b()||i},windows:function(){return b()||l},osx:function(){return b()||s},linux:function(){return b()||c},iphone:function(){return b()||p},mobile:function(){return b()||p||h||u||f},nativeApp:function(){return b()||m},android:function(){return b()||u},ipad:function(){return b()||h}};e.exports=v},87305:function(e,t,n){"use strict";var r,o=n(23762);o.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),e.exports=function(e,t){if(!o.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,i=n in document;if(!i){var a=document.createElement("div");a.setAttribute(n,"return;"),i="function"==typeof a[n]}return!i&&r&&"wheel"===e&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}},42802:function(e,t,n){"use strict";var r=n(79775),o=n(87305);function i(e){var t=0,n=0,r=0,o=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),r=10*t,o=10*n,"deltaY"in e&&(o=e.deltaY),"deltaX"in e&&(r=e.deltaX),(r||o)&&e.deltaMode&&(1==e.deltaMode?(r*=40,o*=40):(r*=800,o*=800)),r&&!t&&(t=r<1?-1:1),o&&!n&&(n=o<1?-1:1),{spinX:t,spinY:n,pixelX:r,pixelY:o}}i.getEventType=function(){return r.firefox()?"DOMMouseScroll":o("wheel")?"wheel":"mousewheel"},e.exports=i},90308:function(e,t,n){var r;e=n.nmd(e),function(o){t&&t.nodeType,e&&e.nodeType;var i="object"==typeof n.g&&n.g;i.global!==i&&i.window!==i&&i.self;var a,s=2147483647,l=36,c=26,u=38,d=700,p=/^xn--/,h=/[^\x20-\x7E]/,m=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=l-1,b=Math.floor,v=String.fromCharCode;function y(e){throw new RangeError(f[e])}function _(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function k(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+_((e=e.replace(m,".")).split("."),t).join(".")}function w(e){for(var t,n,r=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(n=e.charCodeAt(o++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--):r.push(t);return r}function E(e){return _(e,(function(e){var t="";return e>65535&&(t+=v((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+v(e)})).join("")}function C(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function x(e,t,n){var r=0;for(e=n?b(e/d):e>>1,e+=b(e/t);e>g*c>>1;r+=l)e=b(e/g);return b(r+(g+1)*e/(e+u))}function S(e){var t,n,r,o,i,a,u,d,p,h,m,f=[],g=e.length,v=0,_=128,k=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&y("not-basic"),f.push(e.charCodeAt(r));for(o=n>0?n+1:0;o<g;){for(i=v,a=1,u=l;o>=g&&y("invalid-input"),((d=(m=e.charCodeAt(o++))-48<10?m-22:m-65<26?m-65:m-97<26?m-97:l)>=l||d>b((s-v)/a))&&y("overflow"),v+=d*a,!(d<(p=u<=k?1:u>=k+c?c:u-k));u+=l)a>b(s/(h=l-p))&&y("overflow"),a*=h;k=x(v-i,t=f.length+1,0==i),b(v/t)>s-_&&y("overflow"),_+=b(v/t),v%=t,f.splice(v++,0,_)}return E(f)}function I(e){var t,n,r,o,i,a,u,d,p,h,m,f,g,_,k,E=[];for(f=(e=w(e)).length,t=128,n=0,i=72,a=0;a<f;++a)(m=e[a])<128&&E.push(v(m));for(r=o=E.length,o&&E.push("-");r<f;){for(u=s,a=0;a<f;++a)(m=e[a])>=t&&m<u&&(u=m);for(u-t>b((s-n)/(g=r+1))&&y("overflow"),n+=(u-t)*g,t=u,a=0;a<f;++a)if((m=e[a])<t&&++n>s&&y("overflow"),m==t){for(d=n,p=l;!(d<(h=p<=i?1:p>=i+c?c:p-i));p+=l)k=d-h,_=l-h,E.push(v(C(h+k%_,0))),d=b(k/_);E.push(v(C(d,0))),i=x(n,g,r==o),n=0,++r}++n,++t}return E.join("")}a={version:"1.4.1",ucs2:{decode:w,encode:E},decode:S,encode:I,toASCII:function(e){return k(e,(function(e){return h.test(e)?"xn--"+I(e):e}))},toUnicode:function(e){return k(e,(function(e){return p.test(e)?S(e.slice(4).toLowerCase()):e}))}},void 0===(r=function(){return a}.call(t,n,t,e))||(e.exports=r)}()},82162:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=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}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]])}return n};t.__esModule=!0;var s=n(70079),l=n(39519),c=n(17121),u=n(3099),d="autosize:resized",p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return o(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.maxRows,r=t.async;"number"==typeof n&&this.updateLineHeight(),"number"==typeof n||r?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),r=(t.onChange,t.style),o=(t.innerRef,t.children),l=a(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return s.createElement("textarea",i({},l,{onChange:this.onChange,style:u?i({},r,{maxHeight:u}):r,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),o)},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}(s.Component);t.TextareaAutosize=s.forwardRef((function(e,t){return s.createElement(p,i({},e,{innerRef:t}))}))},49710:function(e,t,n){"use strict";var r=n(82162);t.Z=r.TextareaAutosize},52965:function(e,t,n){var r;(function(){function o(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 r in t)t.hasOwnProperty(r)&&(n[r]=t[r].defaultValue);return n}var i={},a={},s={},l=o(!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:o(!0),allOn:function(){"use strict";var e=o(!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",r={valid:!0,error:""};i.helper.isArray(e)||(e=[e]);for(var o=0;o<e.length;++o){var a=n+" sub-extension "+o+": ",s=e[o];if("object"!=typeof s)return r.valid=!1,r.error=a+"must be an object, but "+typeof s+" given",r;if(!i.helper.isString(s.type))return r.valid=!1,r.error=a+'property "type" must be a string, but '+typeof s.type+" given",r;var l=s.type=s.type.toLowerCase();if("language"===l&&(l=s.type="lang"),"html"===l&&(l=s.type="output"),"lang"!==l&&"output"!==l&&"listener"!==l)return r.valid=!1,r.error=a+"type "+l+' is not recognized. Valid values: "lang/language", "output/html" or "listener"',r;if("listener"===l){if(i.helper.isUndefined(s.listeners))return r.valid=!1,r.error=a+'. Extensions of type "listener" must have a property called "listeners"',r}else if(i.helper.isUndefined(s.filter)&&i.helper.isUndefined(s.regex))return r.valid=!1,r.error=a+l+' extensions must define either a "regex" property or a "filter" method',r;if(s.listeners){if("object"!=typeof s.listeners)return r.valid=!1,r.error=a+'"listeners" property must be an object but '+typeof s.listeners+" given",r;for(var c in s.listeners)if(s.listeners.hasOwnProperty(c)&&"function"!=typeof s.listeners[c])return r.valid=!1,r.error=a+'"listeners" property must be an hash of [event name]: [callback]. listeners.'+c+" must be a function but "+typeof s.listeners[c]+" given",r}if(s.filter){if("function"!=typeof s.filter)return r.valid=!1,r.error=a+'"filter" must be a function, but '+typeof s.filter+" given",r}else if(s.regex){if(i.helper.isString(s.regex)&&(s.regex=new RegExp(s.regex,"g")),!(s.regex instanceof RegExp))return r.valid=!1,r.error=a+'"regex" property must either be a string or a RegExp object, but '+typeof s.regex+" given",r;if(i.helper.isUndefined(s.replace))return r.valid=!1,r.error=a+'"regex" extensions must implement a replace string or function',r}}return r}function p(e,t){"use strict";return"¨E"+t.charCodeAt(0)+"E"}i.helper={},i.extensions={},i.setOption=function(e,t){"use strict";return l[e]=t,this},i.getOption=function(e){"use strict";return l[e]},i.getOptions=function(){"use strict";return l},i.resetOptions=function(){"use strict";l=o(!0)},i.setFlavor=function(e){"use strict";if(!u.hasOwnProperty(e))throw Error(e+" flavor was not found");i.resetOptions();var t=u[e];for(var n in c=e,t)t.hasOwnProperty(n)&&(l[n]=t[n])},i.getFlavor=function(){"use strict";return c},i.getFlavorOptions=function(e){"use strict";if(u.hasOwnProperty(e))return u[e]},i.getDefaultOptions=function(e){"use strict";return o(e)},i.subParser=function(e,t){"use strict";if(i.helper.isString(e)){if(void 0===t){if(a.hasOwnProperty(e))return a[e];throw Error("SubParser named "+e+" not registered!")}a[e]=t}},i.extension=function(e,t){"use strict";if(!i.helper.isString(e))throw Error("Extension 'name' must be a string");if(e=i.helper.stdExtName(e),i.helper.isUndefined(t)){if(!s.hasOwnProperty(e))throw Error("Extension named "+e+" is not registered!");return s[e]}"function"==typeof t&&(t=t()),i.helper.isArray(t)||(t=[t]);var n=d(t,e);if(!n.valid)throw Error(n.error);s[e]=t},i.getAllExtensions=function(){"use strict";return s},i.removeExtension=function(e){"use strict";delete s[e]},i.resetExtensions=function(){"use strict";s={}},i.validateExtension=function(e){"use strict";var t=d(e,null);return!!t.valid||(console.warn(t.error),!1)},i.hasOwnProperty("helper")||(i.helper={}),i.helper.isString=function(e){"use strict";return"string"==typeof e||e instanceof String},i.helper.isFunction=function(e){"use strict";return e&&"[object Function]"==={}.toString.call(e)},i.helper.isArray=function(e){"use strict";return Array.isArray(e)},i.helper.isUndefined=function(e){"use strict";return void 0===e},i.helper.forEach=function(e,t){"use strict";if(i.helper.isUndefined(e))throw new Error("obj param is required");if(i.helper.isUndefined(t))throw new Error("callback param is required");if(!i.helper.isFunction(t))throw new Error("callback param must be a function/closure");if("function"==typeof e.forEach)e.forEach(t);else if(i.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 r in e)e.hasOwnProperty(r)&&t(e[r],r,e)}},i.helper.stdExtName=function(e){"use strict";return e.replace(/[_?*+\/\\.^-]/g,"").replace(/\s/g,"").toLowerCase()},i.helper.escapeCharactersCallback=p,i.helper.escapeCharacters=function(e,t,n){"use strict";var r="(["+t.replace(/([\[\]\\])/g,"\\$1")+"])";n&&(r="\\\\"+r);var o=new RegExp(r,"g");return e.replace(o,p)},i.helper.unescapeHTMLEntities=function(e){"use strict";return e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")};var h=function(e,t,n,r){"use strict";var o,i,a,s,l,c=r||"",u=c.indexOf("g")>-1,d=new RegExp(t+"|"+n,"g"+c.replace(/g/g,"")),p=new RegExp(t,c.replace(/g/g,"")),h=[];do{for(o=0;a=d.exec(e);)if(p.test(a[0]))o++||(s=(i=d.lastIndex)-a[0].length);else if(o&&! --o){l=a.index+a[0].length;var m={left:{start:s,end:i},match:{start:i,end:a.index},right:{start:a.index,end:l},wholeMatch:{start:s,end:l}};if(h.push(m),!u)return h}}while(o&&(d.lastIndex=i));return h};i.helper.matchRecursiveRegExp=function(e,t,n,r){"use strict";for(var o=h(e,t,n,r),i=[],a=0;a<o.length;++a)i.push([e.slice(o[a].wholeMatch.start,o[a].wholeMatch.end),e.slice(o[a].match.start,o[a].match.end),e.slice(o[a].left.start,o[a].left.end),e.slice(o[a].right.start,o[a].right.end)]);return i},i.helper.replaceRecursiveRegExp=function(e,t,n,r,o){"use strict";if(!i.helper.isFunction(t)){var a=t;t=function(){return a}}var s=h(e,n,r,o),l=e,c=s.length;if(c>0){var u=[];0!==s[0].wholeMatch.start&&u.push(e.slice(0,s[0].wholeMatch.start));for(var d=0;d<c;++d)u.push(t(e.slice(s[d].wholeMatch.start,s[d].wholeMatch.end),e.slice(s[d].match.start,s[d].match.end),e.slice(s[d].left.start,s[d].left.end),e.slice(s[d].right.start,s[d].right.end))),d<c-1&&u.push(e.slice(s[d].wholeMatch.end,s[d+1].wholeMatch.start));s[c-1].wholeMatch.end<e.length&&u.push(e.slice(s[c-1].wholeMatch.end)),l=u.join("")}return l},i.helper.regexIndexOf=function(e,t,n){"use strict";if(!i.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 r=e.substring(n||0).search(t);return r>=0?r+(n||0):r},i.helper.splitAtIndex=function(e,t){"use strict";if(!i.helper.isString(e))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[e.substring(0,t),e.substring(t)]},i.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}))},i.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}}),i.helper.regexes={asteriskDashAndColon:/([*_:~])/g},i.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>"},i.Converter=function(e){"use strict";var t={},n=[],r=[],o={},a=c,p={parsed:{},raw:"",format:""};function h(e,t){if(t=t||null,i.helper.isString(e)){if(t=e=i.helper.stdExtName(e),i.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 i.Converter)),i.helper.isArray(e)||(e=[e]);var o=d(e,t);if(!o.valid)throw Error(o.error);for(var a=0;a<e.length;++a)switch(e[a].type){case"lang":n.push(e[a]);break;case"output":r.push(e[a]);break;default:throw Error("Extension loader error: Type unrecognized!!!")}}(i.extensions[e],e);if(i.helper.isUndefined(s[e]))throw Error('Extension "'+e+'" could not be loaded. It was either not found or is not a valid extension.');e=s[e]}"function"==typeof e&&(e=e()),i.helper.isArray(e)||(e=[e]);var o=d(e,t);if(!o.valid)throw Error(o.error);for(var a=0;a<e.length;++a){switch(e[a].type){case"lang":n.push(e[a]);break;case"output":r.push(e[a])}if(e[a].hasOwnProperty("listeners"))for(var l in e[a].listeners)e[a].listeners.hasOwnProperty(l)&&m(l,e[a].listeners[l])}}function m(e,t){if(!i.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");o.hasOwnProperty(e)||(o[e]=[]),o[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 r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.extensions&&i.helper.forEach(t.extensions,h)}(),this._dispatch=function(e,t,n,r){if(o.hasOwnProperty(e))for(var i=0;i<o[e].length;++i){var a=o[e][i](e,t,this,n,r);a&&void 0!==a&&(t=a)}return t},this.listen=function(e,t){return m(e,t),this},this.makeHtml=function(e){if(!e)return e;var o={gHtmlBlocks:[],gHtmlMdBlocks:[],gHtmlSpans:[],gUrls:{},gTitles:{},gDimensions:{},gListLevel:0,hashLinkCounts:{},langExtensions:n,outputModifiers:r,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=i.subParser("detab")(e,t,o)).replace(/^[ \t]+$/gm,""),i.helper.forEach(n,(function(n){e=i.subParser("runExtension")(n,e,t,o)})),e=i.subParser("metadata")(e,t,o),e=i.subParser("hashPreCodeTags")(e,t,o),e=i.subParser("githubCodeBlocks")(e,t,o),e=i.subParser("hashHTMLBlocks")(e,t,o),e=i.subParser("hashCodeTags")(e,t,o),e=i.subParser("stripLinkDefinitions")(e,t,o),e=i.subParser("blockGamut")(e,t,o),e=i.subParser("unhashHTMLSpans")(e,t,o),e=(e=(e=i.subParser("unescapeSpecialChars")(e,t,o)).replace(/¨D/g,"$$")).replace(/¨T/g,"¨"),e=i.subParser("completeHTMLDocument")(e,t,o),i.helper.forEach(r,(function(n){e=i.subParser("runExtension")(n,e,t,o)})),p=o.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 r={preList:function(e){for(var t=e.querySelectorAll("pre"),n=[],r=0;r<t.length;++r)if(1===t[r].childElementCount&&"code"===t[r].firstChild.tagName.toLowerCase()){var o=t[r].firstChild.innerHTML.trim(),a=t[r].firstChild.getAttribute("data-language")||"";if(""===a)for(var s=t[r].firstChild.className.split(" "),l=0;l<s.length;++l){var c=s[l].match(/^language-(.+)$/);if(null!==c){a=c[1];break}}o=i.helper.unescapeHTMLEntities(o),n.push(o),t[r].outerHTML='<precode language="'+a+'" precodenum="'+r.toString()+'"></precode>'}else n.push(t[r].innerHTML),t[r].innerHTML="",t[r].setAttribute("prenum",r.toString());return n}(n)};!function e(t){for(var n=0;n<t.childNodes.length;++n){var r=t.childNodes[n];3===r.nodeType?/\S/.test(r.nodeValue)?(r.nodeValue=r.nodeValue.split("\n").join(" "),r.nodeValue=r.nodeValue.replace(/(\s)+/g,"$1")):(t.removeChild(r),--n):1===r.nodeType&&e(r)}}(n);for(var o=n.childNodes,a="",s=0;s<o.length;s++)a+=i.subParser("makeMarkdown.node")(o[s],r);return a},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){h(e,t=t||null)},this.useExtension=function(e){h(e)},this.setFlavor=function(e){if(!u.hasOwnProperty(e))throw Error(e+" flavor was not found");var n=u[e];for(var r in a=e,n)n.hasOwnProperty(r)&&(t[r]=n[r])},this.getFlavor=function(){return a},this.removeExtension=function(e){i.helper.isArray(e)||(e=[e]);for(var t=0;t<e.length;++t){for(var o=e[t],a=0;a<n.length;++a)n[a]===o&&n[a].splice(a,1);for(;0<r.length;++a)r[0]===o&&r[0].splice(a,1)}},this.getAllExtensions=function(){return{language:n,output:r}},this.getMetadata=function(e){return e?p.raw:p.parsed},this.getMetadataFormat=function(){return p.format},this._setMetadataPair=function(e,t){p.parsed[e]=t},this._setMetadataFormat=function(e){p.format=e},this._setMetadataRaw=function(e){p.raw=e}},i.subParser("anchors",(function(e,t,n){"use strict";var r=function(e,r,o,a,s,l,c){if(i.helper.isUndefined(c)&&(c=""),o=o.toLowerCase(),e.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)a="";else if(!a){if(o||(o=r.toLowerCase().replace(/ ?\n/g," ")),a="#"+o,i.helper.isUndefined(n.gUrls[o]))return e;a=n.gUrls[o],i.helper.isUndefined(n.gTitles[o])||(c=n.gTitles[o])}var u='<a href="'+(a=a.replace(i.helper.regexes.asteriskDashAndColon,i.helper.escapeCharactersCallback))+'"';return""!==c&&null!==c&&(u+=' title="'+(c=(c=c.replace(/"/g,""")).replace(i.helper.regexes.asteriskDashAndColon,i.helper.escapeCharactersCallback))+'"'),t.openLinksInNewWindow&&!/^#/.test(a)&&(u+=' rel="noopener noreferrer" target="¨E95Eblank"'),u+">"+r+"</a>"};return e=(e=(e=(e=(e=n.converter._dispatch("anchors.before",e,t,n)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,r)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,r)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,r)).replace(/\[([^\[\]]+)]()()()()()/g,r),t.ghMentions&&(e=e.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gim,(function(e,n,r,o,a){if("\\"===r)return n+o;if(!i.helper.isString(t.ghMentionsLink))throw new Error("ghMentionsLink option must be a string");var s=t.ghMentionsLink.replace(/\{u}/g,a),l="";return t.openLinksInNewWindow&&(l=' rel="noopener noreferrer" target="¨E95Eblank"'),n+'<a href="'+s+'"'+l+">"+o+"</a>"}))),n.converter._dispatch("anchors.after",e,t,n)}));var m=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,f=/([*~_]+|\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,v=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,y=function(e){"use strict";return function(t,n,r,o,a,s,l){var c=r=r.replace(i.helper.regexes.asteriskDashAndColon,i.helper.escapeCharactersCallback),u="",d="",p=n||"",h=l||"";return/^www\./i.test(r)&&(r=r.replace(/^www\./i,"http://www.")),e.excludeTrailingPunctuationFromURLs&&s&&(u=s),e.openLinksInNewWindow&&(d=' rel="noopener noreferrer" target="¨E95Eblank"'),p+'<a href="'+r+'"'+d+">"+c+"</a>"+u+h}},_=function(e,t){"use strict";return function(n,r,o){var a="mailto:";return r=r||"",o=i.subParser("unescapeSpecialChars")(o,e,t),e.encodeEmails?(a=i.helper.encodeEmailAddress(a+o),o=i.helper.encodeEmailAddress(o)):a+=o,r+'<a href="'+a+'">'+o+"</a>"}};i.subParser("autoLinks",(function(e,t,n){"use strict";return e=(e=(e=n.converter._dispatch("autoLinks.before",e,t,n)).replace(g,y(t))).replace(v,_(t,n)),n.converter._dispatch("autoLinks.after",e,t,n)})),i.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(f,y(t)):e.replace(m,y(t))).replace(b,_(t,n)),e=n.converter._dispatch("simplifiedAutoLinks.after",e,t,n)):e})),i.subParser("blockGamut",(function(e,t,n){"use strict";return e=n.converter._dispatch("blockGamut.before",e,t,n),e=i.subParser("blockQuotes")(e,t,n),e=i.subParser("headers")(e,t,n),e=i.subParser("horizontalRule")(e,t,n),e=i.subParser("lists")(e,t,n),e=i.subParser("codeBlocks")(e,t,n),e=i.subParser("tables")(e,t,n),e=i.subParser("hashHTMLBlocks")(e,t,n),e=i.subParser("paragraphs")(e,t,n),n.converter._dispatch("blockGamut.after",e,t,n)})),i.subParser("blockQuotes",(function(e,t,n){"use strict";e=n.converter._dispatch("blockQuotes.before",e,t,n),e+="\n\n";var r=/(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;return t.splitAdjacentBlockquotes&&(r=/^ {0,3}>[\s\S]*?(?:\n\n)/gm),e=e.replace(r,(function(e){return e=(e=(e=e.replace(/^[ \t]*>[ \t]?/gm,"")).replace(/¨0/g,"")).replace(/^[ \t]+$/gm,""),e=i.subParser("githubCodeBlocks")(e,t,n),e=(e=(e=i.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,"")})),i.subParser("hashBlock")("<blockquote>\n"+e+"\n</blockquote>",t,n)})),n.converter._dispatch("blockQuotes.after",e,t,n)})),i.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,r,o){var a=r,s=o,l="\n";return a=i.subParser("outdent")(a,t,n),a=i.subParser("encodeCode")(a,t,n),a=(a=(a=i.subParser("detab")(a,t,n)).replace(/^\n+/g,"")).replace(/\n+$/g,""),t.omitExtraWLInCodeBlocks&&(l=""),a="<pre><code>"+a+l+"</code></pre>",i.subParser("hashBlock")(a,t,n)+s}))).replace(/¨0/,""),n.converter._dispatch("codeBlocks.after",e,t,n)})),i.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,r,o,a){var s=a;return s=(s=s.replace(/^([ \t]*)/g,"")).replace(/[ \t]*$/g,""),s=r+"<code>"+(s=i.subParser("encodeCode")(s,t,n))+"</code>",i.subParser("hashHTMLSpans")(s,t,n)})),n.converter._dispatch("codeSpans.after",e,t,n)})),i.subParser("completeHTMLDocument",(function(e,t,n){"use strict";if(!t.completeHTMLDocument)return e;e=n.converter._dispatch("completeHTMLDocument.before",e,t,n);var r="html",o="<!DOCTYPE HTML>\n",i="",a='<meta charset="utf-8">\n',s="",l="";for(var c in void 0!==n.metadata.parsed.doctype&&(o="<!DOCTYPE "+n.metadata.parsed.doctype+">\n","html"!==(r=n.metadata.parsed.doctype.toString().toLowerCase())&&"html5"!==r||(a='<meta charset="utf-8">')),n.metadata.parsed)if(n.metadata.parsed.hasOwnProperty(c))switch(c.toLowerCase()){case"doctype":break;case"title":i="<title>"+n.metadata.parsed.title+"</title>\n";break;case"charset":a="html"===r||"html5"===r?'<meta charset="'+n.metadata.parsed.charset+'">\n':'<meta name="charset" content="'+n.metadata.parsed.charset+'">\n';break;case"language":case"lang":s=' 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=o+"<html"+s+">\n<head>\n"+i+a+l+"</head>\n<body>\n"+e.trim()+"\n</body>\n</html>",n.converter._dispatch("completeHTMLDocument.after",e,t,n)})),i.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,r=4-n.length%4,o=0;o<r;o++)n+=" ";return n}))).replace(/¨A/g," ")).replace(/¨B/g,""),n.converter._dispatch("detab.after",e,t,n)})),i.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)})),i.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 i.helper.emojis.hasOwnProperty(t)?i.helper.emojis[t]:e})),n.converter._dispatch("emoji.after",e,t,n)):e})),i.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)})),i.subParser("encodeBackslashEscapes",(function(e,t,n){"use strict";return e=(e=(e=n.converter._dispatch("encodeBackslashEscapes.before",e,t,n)).replace(/\\(\\)/g,i.helper.escapeCharactersCallback)).replace(/\\([`*_{}\[\]()>#+.!~=|-])/g,i.helper.escapeCharactersCallback),n.converter._dispatch("encodeBackslashEscapes.after",e,t,n)})),i.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,i.helper.escapeCharactersCallback),n.converter._dispatch("encodeCode.after",e,t,n)})),i.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,i.helper.escapeCharactersCallback)}))).replace(/<!(--(?:(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>/gi,(function(e){return e.replace(/([\\`*_~=|])/g,i.helper.escapeCharactersCallback)})),n.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after",e,t,n)})),i.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,r,o,a){var s=t.omitExtraWLInCodeBlocks?"":"\n";return a=i.subParser("encodeCode")(a,t,n),a="<pre><code"+(o?' class="'+o+" language-"+o+'"':"")+">"+(a=(a=(a=i.subParser("detab")(a,t,n)).replace(/^\n+/g,"")).replace(/\n+$/g,""))+s+"</code></pre>",a=i.subParser("hashBlock")(a,t,n),"\n\n¨G"+(n.ghCodeBlocks.push({text:e,codeblock:a})-1)+"G\n\n"}))).replace(/¨0/,""),n.converter._dispatch("githubCodeBlocks.after",e,t,n)):e})),i.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)})),i.subParser("hashCodeTags",(function(e,t,n){"use strict";return e=n.converter._dispatch("hashCodeTags.before",e,t,n),e=i.helper.replaceRecursiveRegExp(e,(function(e,r,o,a){var s=o+i.subParser("encodeCode")(r,t,n)+a;return"¨C"+(n.gHtmlSpans.push(s)-1)+"C"}),"<code\\b[^>]*>","</code>","gim"),n.converter._dispatch("hashCodeTags.after",e,t,n)})),i.subParser("hashElement",(function(e,t,n){"use strict";return function(e,t){var r=t;return r=(r=(r=r.replace(/\n\n/g,"\n")).replace(/^\n/,"")).replace(/\n+$/g,""),"\n\n¨K"+(n.gHtmlBlocks.push(r)-1)+"K\n\n"}})),i.subParser("hashHTMLBlocks",(function(e,t,n){"use strict";e=n.converter._dispatch("hashHTMLBlocks.before",e,t,n);var r=["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"],o=function(e,t,r,o){var i=e;return-1!==r.search(/\bmarkdown\b/)&&(i=r+n.converter.makeHtml(t)+o),"\n\n¨K"+(n.gHtmlBlocks.push(i)-1)+"K\n\n"};t.backslashEscapesHTMLTags&&(e=e.replace(/\\<(\/?[^>]+?)>/g,(function(e,t){return"<"+t+">"})));for(var a=0;a<r.length;++a)for(var s,l=new RegExp("^ {0,3}(<"+r[a]+"\\b[^>]*>)","im"),c="<"+r[a]+"\\b[^>]*>",u="</"+r[a]+">";-1!==(s=i.helper.regexIndexOf(e,l));){var d=i.helper.splitAtIndex(e,s),p=i.helper.replaceRecursiveRegExp(d[1],o,c,u,"im");if(p===d[1])break;e=d[0].concat(p)}return e=e.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,i.subParser("hashElement")(e,t,n)),e=(e=i.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,i.subParser("hashElement")(e,t,n)),n.converter._dispatch("hashHTMLBlocks.after",e,t,n)})),i.subParser("hashHTMLSpans",(function(e,t,n){"use strict";function r(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 r(e)}))).replace(/<([^>]+?)>[\s\S]*?<\/\1>/g,(function(e){return r(e)}))).replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,(function(e){return r(e)}))).replace(/<[^>]+?>/gi,(function(e){return r(e)})),n.converter._dispatch("hashHTMLSpans.after",e,t,n)})),i.subParser("unhashHTMLSpans",(function(e,t,n){"use strict";e=n.converter._dispatch("unhashHTMLSpans.before",e,t,n);for(var r=0;r<n.gHtmlSpans.length;++r){for(var o=n.gHtmlSpans[r],i=0;/¨C(\d+)C/.test(o);){var a=RegExp.$1;if(o=o.replace("¨C"+a+"C",n.gHtmlSpans[a]),10===i){console.error("maximum nesting of 10 spans reached!!!");break}++i}e=e.replace("¨C"+r+"C",o)}return n.converter._dispatch("unhashHTMLSpans.after",e,t,n)})),i.subParser("hashPreCodeTags",(function(e,t,n){"use strict";return e=n.converter._dispatch("hashPreCodeTags.before",e,t,n),e=i.helper.replaceRecursiveRegExp(e,(function(e,r,o,a){var s=o+i.subParser("encodeCode")(r,t,n)+a;return"\n\n¨G"+(n.ghCodeBlocks.push({text:e,codeblock:s})-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)})),i.subParser("headers",(function(e,t,n){"use strict";e=n.converter._dispatch("headers.before",e,t,n);var r=isNaN(parseInt(t.headerLevelStart))?1:parseInt(t.headerLevelStart),o=t.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,a=t.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm;e=(e=e.replace(o,(function(e,o){var a=i.subParser("spanGamut")(o,t,n),s=t.noHeaderId?"":' id="'+l(o)+'"',c="<h"+r+s+">"+a+"</h"+r+">";return i.subParser("hashBlock")(c,t,n)}))).replace(a,(function(e,o){var a=i.subParser("spanGamut")(o,t,n),s=t.noHeaderId?"":' id="'+l(o)+'"',c=r+1,u="<h"+c+s+">"+a+"</h"+c+">";return i.subParser("hashBlock")(u,t,n)}));var s=t.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;function l(e){var r,o;if(t.customizedHeaderId){var a=e.match(/\{([^{]+?)}\s*$/);a&&a[1]&&(e=a[1])}return r=e,o=i.helper.isString(t.prefixHeaderId)?t.prefixHeaderId:!0===t.prefixHeaderId?"section-":"",t.rawPrefixHeaderId||(r=o+r),r=t.ghCompatibleHeaderId?r.replace(/ /g,"-").replace(/&/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"").toLowerCase():t.rawHeaderId?r.replace(/ /g,"-").replace(/&/g,"&").replace(/¨T/g,"¨").replace(/¨D/g,"$").replace(/["']/g,"-").toLowerCase():r.replace(/[^\w]/g,"").toLowerCase(),t.rawPrefixHeaderId&&(r=o+r),n.hashLinkCounts[r]?r=r+"-"+n.hashLinkCounts[r]++:n.hashLinkCounts[r]=1,r}return e=e.replace(s,(function(e,o,a){var s=a;t.customizedHeaderId&&(s=a.replace(/\s?\{([^{]+?)}\s*$/,""));var c=i.subParser("spanGamut")(s,t,n),u=t.noHeaderId?"":' id="'+l(a)+'"',d=r-1+o.length,p="<h"+d+u+">"+c+"</h"+d+">";return i.subParser("hashBlock")(p,t,n)})),n.converter._dispatch("headers.after",e,t,n)})),i.subParser("horizontalRule",(function(e,t,n){"use strict";e=n.converter._dispatch("horizontalRule.before",e,t,n);var r=i.subParser("hashBlock")("<hr />",t,n);return e=(e=(e=e.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,r)).replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,r)).replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,r),n.converter._dispatch("horizontalRule.after",e,t,n)})),i.subParser("images",(function(e,t,n){"use strict";function r(e,t,r,o,a,s,l,c){var u=n.gUrls,d=n.gTitles,p=n.gDimensions;if(r=r.toLowerCase(),c||(c=""),e.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)o="";else if(""===o||null===o){if(""!==r&&null!==r||(r=t.toLowerCase().replace(/ ?\n/g," ")),o="#"+r,i.helper.isUndefined(u[r]))return e;o=u[r],i.helper.isUndefined(d[r])||(c=d[r]),i.helper.isUndefined(p[r])||(a=p[r].width,s=p[r].height)}t=t.replace(/"/g,""").replace(i.helper.regexes.asteriskDashAndColon,i.helper.escapeCharactersCallback);var h='<img src="'+(o=o.replace(i.helper.regexes.asteriskDashAndColon,i.helper.escapeCharactersCallback))+'" alt="'+t+'"';return c&&i.helper.isString(c)&&(h+=' title="'+(c=c.replace(/"/g,""").replace(i.helper.regexes.asteriskDashAndColon,i.helper.escapeCharactersCallback))+'"'),a&&s&&(h+=' width="'+(a="*"===a?"auto":a)+'"',h+=' height="'+(s="*"===s?"auto":s)+'"'),h+" />"}return e=(e=(e=(e=(e=(e=n.converter._dispatch("images.before",e,t,n)).replace(/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,r)).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,o,i,a,s,l){return r(e,t,n,o=o.replace(/\s/g,""),i,a,0,l)}))).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,r)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,r)).replace(/!\[([^\[\]]+)]()()()()()/g,r),n.converter._dispatch("images.after",e,t,n)})),i.subParser("italicsAndBold",(function(e,t,n){"use strict";function r(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 r(t,"<strong><em>","</em></strong>")}))).replace(/\b__(\S[\s\S]*?)__\b/g,(function(e,t){return r(t,"<strong>","</strong>")}))).replace(/\b_(\S[\s\S]*?)_\b/g,(function(e,t){return r(t,"<em>","</em>")})):(e=(e=e.replace(/___(\S[\s\S]*?)___/g,(function(e,t){return/\S$/.test(t)?r(t,"<strong><em>","</em></strong>"):e}))).replace(/__(\S[\s\S]*?)__/g,(function(e,t){return/\S$/.test(t)?r(t,"<strong>","</strong>"):e}))).replace(/_([^\s_][\s\S]*?)_/g,(function(e,t){return/\S$/.test(t)?r(t,"<em>","</em>"):e})),e=t.literalMidWordAsterisks?(e=(e=e.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g,(function(e,t,n){return r(n,t+"<strong><em>","</em></strong>")}))).replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g,(function(e,t,n){return r(n,t+"<strong>","</strong>")}))).replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g,(function(e,t,n){return r(n,t+"<em>","</em>")})):(e=(e=e.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g,(function(e,t){return/\S$/.test(t)?r(t,"<strong><em>","</em></strong>"):e}))).replace(/\*\*(\S[\s\S]*?)\*\*/g,(function(e,t){return/\S$/.test(t)?r(t,"<strong>","</strong>"):e}))).replace(/\*([^\s*][\s\S]*?)\*/g,(function(e,t){return/\S$/.test(t)?r(t,"<em>","</em>"):e})),n.converter._dispatch("italicsAndBold.after",e,t,n)})),i.subParser("lists",(function(e,t,n){"use strict";function r(e,r){n.gListLevel++,e=e.replace(/\n{2,}$/,"\n");var o=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,a=/\n[ \t]*\n(?!¨0)/.test(e+="¨0");return t.disableForced4SpacesIndentedSublists&&(o=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),e=(e=e.replace(o,(function(e,r,o,s,l,c,u){u=u&&""!==u.trim();var d=i.subParser("outdent")(l,t,n),p="";return c&&t.tasklists&&(p=' 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})),r||d.search(/\n{2,}/)>-1?(d=i.subParser("githubCodeBlocks")(d,t,n),d=i.subParser("blockGamut")(d,t,n)):(d=(d=i.subParser("lists")(d,t,n)).replace(/\n$/,""),d=(d=i.subParser("hashHTMLBlocks")(d,t,n)).replace(/\n\n+/g,"\n\n"),d=a?i.subParser("paragraphs")(d,t,n):i.subParser("spanGamut")(d,t,n)),"<li"+p+">"+(d=d.replace("¨A",""))+"</li>\n"}))).replace(/¨0/g,""),n.gListLevel--,r&&(e=e.replace(/\s+$/,"")),e}function o(e,t){if("ol"===t){var n=e.match(/^ *(\d+)\./);if(n&&"1"!==n[1])return' start="'+n[1]+'"'}return""}function a(e,n,i){var a=t.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,s=t.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,l="ul"===n?a:s,c="";if(-1!==e.search(l))!function t(u){var d=u.search(l),p=o(e,n);-1!==d?(c+="\n\n<"+n+p+">\n"+r(u.slice(0,d),!!i)+"</"+n+">\n",l="ul"==(n="ul"===n?"ol":"ul")?a:s,t(u.slice(d))):c+="\n\n<"+n+p+">\n"+r(u,!!i)+"</"+n+">\n"}(e);else{var u=o(e,n);c="\n\n<"+n+u+">\n"+r(e,!!i)+"</"+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 a(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,r){return a(n,r.search(/[*+-]/g)>-1?"ul":"ol",!1)}))).replace(/¨0/,""),n.converter._dispatch("lists.after",e,t,n)})),i.subParser("metadata",(function(e,t,n){"use strict";if(!t.metadata)return e;function r(e){n.metadata.raw=e,(e=(e=e.replace(/&/g,"&").replace(/"/g,""")).replace(/\n {4}/g," ")).replace(/^([\S ]+): +([\s\S]+?)$/gm,(function(e,t,r){return n.metadata.parsed[t]=r,""}))}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 r(n),"¨M"}))).replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/,(function(e,t,o){return t&&(n.metadata.format=t),r(o),"¨M"}))).replace(/¨M/g,""),n.converter._dispatch("metadata.after",e,t,n)})),i.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)})),i.subParser("paragraphs",(function(e,t,n){"use strict";for(var r=(e=(e=(e=n.converter._dispatch("paragraphs.before",e,t,n)).replace(/^\n+/g,"")).replace(/\n+$/g,"")).split(/\n{2,}/g),o=[],a=r.length,s=0;s<a;s++){var l=r[s];l.search(/¨(K|G)(\d+)\1/g)>=0?o.push(l):l.search(/\S/)>=0&&(l=(l=i.subParser("spanGamut")(l,t,n)).replace(/^([ \t]*)/g,"<p>"),l+="</p>",o.push(l))}for(a=o.length,s=0;s<a;s++){for(var c="",u=o[s],d=!1;/¨(K|G)(\d+)\1/.test(u);){var p=RegExp.$1,h=RegExp.$2;c=(c="K"===p?n.gHtmlBlocks[h]:d?i.subParser("encodeCode")(n.ghCodeBlocks[h].text,t,n):n.ghCodeBlocks[h].codeblock).replace(/\$/g,"$$$$"),u=u.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/,c),/^<pre\b[^>]*>\s*<code\b[^>]*>/.test(u)&&(d=!0)}o[s]=u}return e=(e=(e=o.join("\n")).replace(/^\n+/g,"")).replace(/\n+$/g,""),n.converter._dispatch("paragraphs.after",e,t,n)})),i.subParser("runExtension",(function(e,t,n,r){"use strict";if(e.filter)t=e.filter(t,r.converter,n);else if(e.regex){var o=e.regex;o instanceof RegExp||(o=new RegExp(o,"g")),t=t.replace(o,e.replace)}return t})),i.subParser("spanGamut",(function(e,t,n){"use strict";return e=n.converter._dispatch("spanGamut.before",e,t,n),e=i.subParser("codeSpans")(e,t,n),e=i.subParser("escapeSpecialCharsWithinTagAttributes")(e,t,n),e=i.subParser("encodeBackslashEscapes")(e,t,n),e=i.subParser("images")(e,t,n),e=i.subParser("anchors")(e,t,n),e=i.subParser("autoLinks")(e,t,n),e=i.subParser("simplifiedAutoLinks")(e,t,n),e=i.subParser("emoji")(e,t,n),e=i.subParser("underline")(e,t,n),e=i.subParser("italicsAndBold")(e,t,n),e=i.subParser("strikethrough")(e,t,n),e=i.subParser("ellipsis")(e,t,n),e=i.subParser("hashHTMLSpans")(e,t,n),e=i.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)})),i.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,r){return function(e){return t.simplifiedAutoLink&&(e=i.subParser("simplifiedAutoLinks")(e,t,n)),"<del>"+e+"</del>"}(r)})),e=n.converter._dispatch("strikethrough.after",e,t,n)),e})),i.subParser("stripLinkDefinitions",(function(e,t,n){"use strict";var r=function(e,r,o,a,s,l,c){return r=r.toLowerCase(),o.match(/^data:.+?\/.+?;base64,/)?n.gUrls[r]=o.replace(/\s/g,""):n.gUrls[r]=i.subParser("encodeAmpsAndAngles")(o,t,n),l?l+c:(c&&(n.gTitles[r]=c.replace(/"|'/g,""")),t.parseImgDimensions&&a&&s&&(n.gDimensions[r]={width:a,height:s}),"")};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,r)).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,r)).replace(/¨0/,"")})),i.subParser("tables",(function(e,t,n){"use strict";if(!t.tables)return e;function r(e,r){return"<td"+r+">"+i.subParser("spanGamut")(e,t,n)+"</td>\n"}function o(e){var o,a=e.split("\n");for(o=0;o<a.length;++o)/^ {0,3}\|/.test(a[o])&&(a[o]=a[o].replace(/^ {0,3}\|/,"")),/\|[ \t]*$/.test(a[o])&&(a[o]=a[o].replace(/\|[ \t]*$/,"")),a[o]=i.subParser("codeSpans")(a[o],t,n);var s,l,c,u,d=a[0].split("|").map((function(e){return e.trim()})),p=a[1].split("|").map((function(e){return e.trim()})),h=[],m=[],f=[],g=[];for(a.shift(),a.shift(),o=0;o<a.length;++o)""!==a[o].trim()&&h.push(a[o].split("|").map((function(e){return e.trim()})));if(d.length<p.length)return e;for(o=0;o<p.length;++o)f.push((s=p[o],/^:[ \t]*--*$/.test(s)?' style="text-align:left;"':/^--*[ \t]*:[ \t]*$/.test(s)?' style="text-align:right;"':/^:[ \t]*--*[ \t]*:$/.test(s)?' style="text-align:center;"':""));for(o=0;o<d.length;++o)i.helper.isUndefined(f[o])&&(f[o]=""),m.push((l=d[o],c=f[o],u=void 0,u="",l=l.trim(),(t.tablesHeaderId||t.tableHeaderId)&&(u=' id="'+l.replace(/ /g,"_").toLowerCase()+'"'),"<th"+u+c+">"+(l=i.subParser("spanGamut")(l,t,n))+"</th>\n"));for(o=0;o<h.length;++o){for(var b=[],v=0;v<m.length;++v)i.helper.isUndefined(h[o][v]),b.push(r(h[o][v],f[v]));g.push(b)}return function(e,t){for(var n="<table>\n<thead>\n<tr>\n",r=e.length,o=0;o<r;++o)n+=e[o];for(n+="</tr>\n</thead>\n<tbody>\n",o=0;o<t.length;++o){n+="<tr>\n";for(var i=0;i<r;++i)n+=t[o][i];n+="</tr>\n"}return n+"</tbody>\n</table>\n"}(m,g)}return e=(e=(e=(e=n.converter._dispatch("tables.before",e,t,n)).replace(/\\(\|)/g,i.helper.escapeCharactersCallback)).replace(/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,o)).replace(/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm,o),n.converter._dispatch("tables.after",e,t,n)})),i.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,i.helper.escapeCharactersCallback),e=n.converter._dispatch("underline.after",e,t,n)):e})),i.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)})),i.subParser("makeMarkdown.blockquote",(function(e,t){"use strict";var n="";if(e.hasChildNodes())for(var r=e.childNodes,o=r.length,a=0;a<o;++a){var s=i.subParser("makeMarkdown.node")(r[a],t);""!==s&&(n+=s)}return"> "+(n=n.trim()).split("\n").join("\n> ")})),i.subParser("makeMarkdown.codeBlock",(function(e,t){"use strict";var n=e.getAttribute("language"),r=e.getAttribute("precodenum");return"```"+n+"\n"+t.preList[r]+"\n```"})),i.subParser("makeMarkdown.codeSpan",(function(e){"use strict";return"`"+e.innerHTML+"`"})),i.subParser("makeMarkdown.emphasis",(function(e,t){"use strict";var n="";if(e.hasChildNodes()){n+="*";for(var r=e.childNodes,o=r.length,a=0;a<o;++a)n+=i.subParser("makeMarkdown.node")(r[a],t);n+="*"}return n})),i.subParser("makeMarkdown.header",(function(e,t,n){"use strict";var r=new Array(n+1).join("#"),o="";if(e.hasChildNodes()){o=r+" ";for(var a=e.childNodes,s=a.length,l=0;l<s;++l)o+=i.subParser("makeMarkdown.node")(a[l],t)}return o})),i.subParser("makeMarkdown.hr",(function(){"use strict";return"---"})),i.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})),i.subParser("makeMarkdown.links",(function(e,t){"use strict";var n="";if(e.hasChildNodes()&&e.hasAttribute("href")){var r=e.childNodes,o=r.length;n="[";for(var a=0;a<o;++a)n+=i.subParser("makeMarkdown.node")(r[a],t);n+="](",n+="<"+e.getAttribute("href")+">",e.hasAttribute("title")&&(n+=' "'+e.getAttribute("title")+'"'),n+=")"}return n})),i.subParser("makeMarkdown.list",(function(e,t,n){"use strict";var r="";if(!e.hasChildNodes())return"";for(var o=e.childNodes,a=o.length,s=e.getAttribute("start")||1,l=0;l<a;++l)void 0!==o[l].tagName&&"li"===o[l].tagName.toLowerCase()&&(r+=("ol"===n?s.toString()+". ":"- ")+i.subParser("makeMarkdown.listItem")(o[l],t),++s);return(r+="\n\x3c!-- --\x3e\n").trim()})),i.subParser("makeMarkdown.listItem",(function(e,t){"use strict";for(var n="",r=e.childNodes,o=r.length,a=0;a<o;++a)n+=i.subParser("makeMarkdown.node")(r[a],t);return/\n$/.test(n)?n=n.split("\n").join("\n ").replace(/^ {4}$/gm,"").replace(/\n\n+/g,"\n\n"):n+="\n",n})),i.subParser("makeMarkdown.node",(function(e,t,n){"use strict";n=n||!1;var r="";if(3===e.nodeType)return i.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||(r=i.subParser("makeMarkdown.header")(e,t,1)+"\n\n");break;case"h2":n||(r=i.subParser("makeMarkdown.header")(e,t,2)+"\n\n");break;case"h3":n||(r=i.subParser("makeMarkdown.header")(e,t,3)+"\n\n");break;case"h4":n||(r=i.subParser("makeMarkdown.header")(e,t,4)+"\n\n");break;case"h5":n||(r=i.subParser("makeMarkdown.header")(e,t,5)+"\n\n");break;case"h6":n||(r=i.subParser("makeMarkdown.header")(e,t,6)+"\n\n");break;case"p":n||(r=i.subParser("makeMarkdown.paragraph")(e,t)+"\n\n");break;case"blockquote":n||(r=i.subParser("makeMarkdown.blockquote")(e,t)+"\n\n");break;case"hr":n||(r=i.subParser("makeMarkdown.hr")(e,t)+"\n\n");break;case"ol":n||(r=i.subParser("makeMarkdown.list")(e,t,"ol")+"\n\n");break;case"ul":n||(r=i.subParser("makeMarkdown.list")(e,t,"ul")+"\n\n");break;case"precode":n||(r=i.subParser("makeMarkdown.codeBlock")(e,t)+"\n\n");break;case"pre":n||(r=i.subParser("makeMarkdown.pre")(e,t)+"\n\n");break;case"table":n||(r=i.subParser("makeMarkdown.table")(e,t)+"\n\n");break;case"code":r=i.subParser("makeMarkdown.codeSpan")(e,t);break;case"em":case"i":r=i.subParser("makeMarkdown.emphasis")(e,t);break;case"strong":case"b":r=i.subParser("makeMarkdown.strong")(e,t);break;case"del":r=i.subParser("makeMarkdown.strikethrough")(e,t);break;case"a":r=i.subParser("makeMarkdown.links")(e,t);break;case"img":r=i.subParser("makeMarkdown.image")(e,t);break;default:r=e.outerHTML+"\n\n"}return r})),i.subParser("makeMarkdown.paragraph",(function(e,t){"use strict";var n="";if(e.hasChildNodes())for(var r=e.childNodes,o=r.length,a=0;a<o;++a)n+=i.subParser("makeMarkdown.node")(r[a],t);return n.trim()})),i.subParser("makeMarkdown.pre",(function(e,t){"use strict";var n=e.getAttribute("prenum");return"<pre>"+t.preList[n]+"</pre>"})),i.subParser("makeMarkdown.strikethrough",(function(e,t){"use strict";var n="";if(e.hasChildNodes()){n+="~~";for(var r=e.childNodes,o=r.length,a=0;a<o;++a)n+=i.subParser("makeMarkdown.node")(r[a],t);n+="~~"}return n})),i.subParser("makeMarkdown.strong",(function(e,t){"use strict";var n="";if(e.hasChildNodes()){n+="**";for(var r=e.childNodes,o=r.length,a=0;a<o;++a)n+=i.subParser("makeMarkdown.node")(r[a],t);n+="**"}return n})),i.subParser("makeMarkdown.table",(function(e,t){"use strict";var n,r,o="",a=[[],[]],s=e.querySelectorAll("thead>tr>th"),l=e.querySelectorAll("tbody>tr");for(n=0;n<s.length;++n){var c=i.subParser("makeMarkdown.tableCell")(s[n],t),u="---";if(s[n].hasAttribute("style"))switch(s[n].getAttribute("style").toLowerCase().replace(/\s/g,"")){case"text-align:left;":u=":---";break;case"text-align:right;":u="---:";break;case"text-align:center;":u=":---:"}a[0][n]=c.trim(),a[1][n]=u}for(n=0;n<l.length;++n){var d=a.push([])-1,p=l[n].getElementsByTagName("td");for(r=0;r<s.length;++r){var h=" ";void 0!==p[r]&&(h=i.subParser("makeMarkdown.tableCell")(p[r],t)),a[d].push(h)}}var m=3;for(n=0;n<a.length;++n)for(r=0;r<a[n].length;++r){var f=a[n][r].length;f>m&&(m=f)}for(n=0;n<a.length;++n){for(r=0;r<a[n].length;++r)1===n?":"===a[n][r].slice(-1)?a[n][r]=i.helper.padEnd(a[n][r].slice(-1),m-1,"-")+":":a[n][r]=i.helper.padEnd(a[n][r],m,"-"):a[n][r]=i.helper.padEnd(a[n][r],m);o+="| "+a[n].join(" | ")+" |\n"}return o.trim()})),i.subParser("makeMarkdown.tableCell",(function(e,t){"use strict";var n="";if(!e.hasChildNodes())return"";for(var r=e.childNodes,o=r.length,a=0;a<o;++a)n+=i.subParser("makeMarkdown.node")(r[a],t,!0);return n.trim()})),i.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=i.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===(r=function(){"use strict";return i}.call(t,n,t,e))||(e.exports=r)}).call(this)},47973:function(e,t,n){var r,o,i;e.exports=(r=Math.floor,o=Math.abs,i=Math.pow,function e(t,n,r){function o(a,s){if(!n[a]){if(!t[a]){if(i)return i(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};t[a][0].call(c.exports,(function(e){return o(t[a][1][e]||e)}),c,c.exports,e,t,n,r)}return n[a].exports}for(var i=void 0,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(e,t,n){"use strict";function r(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function o(e){return a[63&e>>18]+a[63&e>>12]+a[63&e>>6]+a[63&e]}function i(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(16711680&e[a]<<16)+(65280&e[a+1]<<8)+(255&e[a+2]),i.push(o(r));return i.join("")}n.byteLength=function(e){var t=r(e),n=t[0],o=t[1];return 3*(n+o)/4-o},n.toByteArray=function(e){var t,n,o=r(e),i=o[0],a=o[1],c=new l(function(e,t,n){return 3*(t+n)/4-n}(0,i,a)),u=0,d=0<a?i-4:i;for(n=0;n<d;n+=4)t=s[e.charCodeAt(n)]<<18|s[e.charCodeAt(n+1)]<<12|s[e.charCodeAt(n+2)]<<6|s[e.charCodeAt(n+3)],c[u++]=255&t>>16,c[u++]=255&t>>8,c[u++]=255&t;return 2===a&&(t=s[e.charCodeAt(n)]<<2|s[e.charCodeAt(n+1)]>>4,c[u++]=255&t),1===a&&(t=s[e.charCodeAt(n)]<<10|s[e.charCodeAt(n+1)]<<4|s[e.charCodeAt(n+2)]>>2,c[u++]=255&t>>8,c[u++]=255&t),c},n.fromByteArray=function(e){for(var t,n=e.length,r=n%3,o=[],s=16383,l=0,c=n-r;l<c;l+=s)o.push(i(e,l,l+s>c?c:l+s));return 1===r?(t=e[n-1],o.push(a[t>>2]+a[63&t<<4]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],o.push(a[t>>10]+a[63&t>>4]+a[63&t<<2]+"=")),o.join("")};for(var a=[],s=[],l="undefined"==typeof Uint8Array?Array:Uint8Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0;u<64;++u)a[u]=c[u],s[c.charCodeAt(u)]=u;s[45]=62,s[95]=63},{}],2:[function(){},{}],3:[function(e,t,n){(function(){(function(){"use strict";var t=String.fromCharCode,r=Math.min;function o(e){if(2147483647<e)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=a.prototype,t}function a(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return c(e)}return s(e,t,n)}function s(e,t,n){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|p(e,t),r=o(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return u(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(j(e,ArrayBuffer)||e&&j(e.buffer,ArrayBuffer))return function(e,t,n){if(0>t||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');var r;return(r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n)).__proto__=a.prototype,r}(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return a.from(r,t,n);var i=function(e){if(a.isBuffer(e)){var t=0|d(e.length),n=o(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0===e.length?"Buffer"===e.type&&Array.isArray(e.data)?u(e.data):void 0:"number"!=typeof e.length||Z(e.length)?o(0):u(e)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(0>e)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return l(e),o(0>e?0:0|d(e))}function u(e){for(var t=0>e.length?0:0|d(e.length),n=o(t),r=0;r<t;r+=1)n[r]=255&e[r];return n}function d(e){if(e>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|e}function p(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||j(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=2<arguments.length&&!0===arguments[2];if(!r&&0===n)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return D(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return O(e).length;default:if(o)return r?-1:D(e).length;t=(""+t).toLowerCase(),o=!0}}function h(e,t,n){var r=!1;if((void 0===t||0>t)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),0>=n)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return T(this,t,n);case"utf8":case"utf-8":return C(this,t,n);case"ascii":return S(this,t,n);case"latin1":case"binary":return I(this,t,n);case"base64":return E(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function f(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):2147483647<n?n=2147483647:-2147483648>n&&(n=-2147483648),Z(n=+n)&&(n=o?0:e.length-1),0>n&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(0>n){if(!o)return-1;n=0}if("string"==typeof t&&(t=a.from(t,r)),a.isBuffer(t))return 0===t.length?-1:g(e,t,n,r,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):g(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function g(e,t,n,r,o){function i(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}var a,s=1,l=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=(r+"").toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(2>e.length||2>t.length)return-1;s=2,l/=2,c/=2,n/=2}if(o){var u=-1;for(a=n;a<l;a++)if(i(e,a)!==i(t,-1===u?0:a-u))-1!==u&&(a-=a-u),u=-1;else if(-1===u&&(u=a),a-u+1===c)return u*s}else for(n+c>l&&(n=l-c),a=n;0<=a;a--){for(var d=!0,p=0;p<c;p++)if(i(e,a+p)!==i(t,p)){d=!1;break}if(d)return a}return-1}function b(e,t,n,r){n=+n||0;var o=e.length-n;r?(r=+r)>o&&(r=o):r=o;var i=t.length;r>i/2&&(r=i/2);for(var a,s=0;s<r;++s){if(Z(a=parseInt(t.substr(2*s,2),16)))return s;e[n+s]=a}return s}function v(e,t,n,r){return F(D(t,e.length-n),e,n,r)}function y(e,t,n,r){return F(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function _(e,t,n,r){return y(e,t,n,r)}function k(e,t,n,r){return F(O(t),e,n,r)}function w(e,t,n,r){return F(function(e,t){for(var n,r,o,i=[],a=0;a<e.length&&!(0>(t-=2));++a)r=(n=e.charCodeAt(a))>>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function E(e,t,n){return 0===t&&n===e.length?z.fromByteArray(e):z.fromByteArray(e.slice(t,n))}function C(e,t,n){n=r(e.length,n);for(var o=[],i=t;i<n;){var a,s,l,c,u=e[i],d=null,p=239<u?4:223<u?3:191<u?2:1;i+p<=n&&(1===p?128>u&&(d=u):2===p?128==(192&(a=e[i+1]))&&127<(c=(31&u)<<6|63&a)&&(d=c):3===p?(a=e[i+1],s=e[i+2],128==(192&a)&&128==(192&s)&&2047<(c=(15&u)<<12|(63&a)<<6|63&s)&&(55296>c||57343<c)&&(d=c)):4===p&&(a=e[i+1],s=e[i+2],l=e[i+3],128==(192&a)&&128==(192&s)&&128==(192&l)&&65535<(c=(15&u)<<18|(63&a)<<12|(63&s)<<6|63&l)&&1114112>c&&(d=c))),null===d?(d=65533,p=1):65535<d&&(d-=65536,o.push(55296|1023&d>>>10),d=56320|1023&d),o.push(d),i+=p}return x(o)}function x(e){var n=e.length;if(n<=4096)return t.apply(String,e);for(var r="",o=0;o<n;)r+=t.apply(String,e.slice(o,o+=4096));return r}function S(e,n,o){var i="";o=r(e.length,o);for(var a=n;a<o;++a)i+=t(127&e[a]);return i}function I(e,n,o){var i="";o=r(e.length,o);for(var a=n;a<o;++a)i+=t(e[a]);return i}function T(e,t,n){var r=e.length;(!t||0>t)&&(t=0),(!n||0>n||n>r)&&(n=r);for(var o="",i=t;i<n;++i)o+=M(e[i]);return o}function N(e,n,r){for(var o=e.slice(n,r),i="",a=0;a<o.length;a+=2)i+=t(o[a]+256*o[a+1]);return i}function P(e,t,n){if(0!=e%1||0>e)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,n,r,o,i){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function A(e,t,n,r){if(n+r>e.length)throw new RangeError("Index out of range");if(0>n)throw new RangeError("Index out of range")}function B(e,t,n,r,o){return t=+t,n>>>=0,o||A(e,0,n,4),V.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,o){return t=+t,n>>>=0,o||A(e,0,n,8),V.write(e,t,n,r,52,8),n+8}function M(e){return 16>e?"0"+e.toString(16):e.toString(16)}function D(e,t){t=t||1/0;for(var n,r=e.length,o=null,i=[],a=0;a<r;++a){if(55295<(n=e.charCodeAt(a))&&57344>n){if(!o){if(56319<n){-1<(t-=3)&&i.push(239,191,189);continue}if(a+1===r){-1<(t-=3)&&i.push(239,191,189);continue}o=n;continue}if(56320>n){-1<(t-=3)&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&-1<(t-=3)&&i.push(239,191,189);if(o=null,128>n){if(0>(t-=1))break;i.push(n)}else if(2048>n){if(0>(t-=2))break;i.push(192|n>>6,128|63&n)}else if(65536>n){if(0>(t-=3))break;i.push(224|n>>12,128|63&n>>6,128|63&n)}else{if(!(1114112>n))throw new Error("Invalid code point");if(0>(t-=4))break;i.push(240|n>>18,128|63&n>>12,128|63&n>>6,128|63&n)}}return i}function O(e){return z.toByteArray(function(e){if(2>(e=(e=e.split("=")[0]).trim().replace(H,"")).length)return"";for(;0!=e.length%4;)e+="=";return e}(e))}function F(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function j(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Z(e){return e!=e}var z=e("base64-js"),V=e("ieee754");n.Buffer=a,n.SlowBuffer=function(e){return+e!=e&&(e=0),a.alloc(+e)},n.INSPECT_MAX_BYTES=50,n.kMaxLength=2147483647,a.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}(),a.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){return a.isBuffer(this)?this.buffer:void 0}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){return a.isBuffer(this)?this.byteOffset:void 0}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),a.poolSize=8192,a.from=function(e,t,n){return s(e,t,n)},a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,a.alloc=function(e,t,n){return function(e,t,n){return l(e),0>=e||void 0===t?o(e):"string"==typeof n?o(e).fill(t,n):o(e).fill(t)}(e,t,n)},a.allocUnsafe=function(e){return c(e)},a.allocUnsafeSlow=function(e){return c(e)},a.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(j(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),j(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,o=t.length,i=0,s=r(n,o);i<s;++i)if(e[i]!==t[i]){n=e[i],o=t[i];break}return n<o?-1:o<n?1:0},a.isEncoding=function(e){switch((e+"").toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=a.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var i=e[n];if(j(i,Uint8Array)&&(i=a.from(i)),!a.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(r,o),o+=i.length}return r},a.byteLength=p,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var e=this.length;if(0!=e%2)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},a.prototype.swap32=function(){var e=this.length;if(0!=e%4)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},a.prototype.swap64=function(){var e=this.length;if(0!=e%8)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},a.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?C(this,0,e):h.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){var e="",t=n.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},a.prototype.compare=function(e,t,n,o,i){if(j(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===o&&(o=0),void 0===i&&(i=this.length),0>t||n>e.length||0>o||i>this.length)throw new RangeError("out of range index");if(o>=i&&t>=n)return 0;if(o>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var s=(i>>>=0)-(o>>>=0),l=(n>>>=0)-(t>>>=0),c=r(s,l),u=this.slice(o,i),d=e.slice(t,n),p=0;p<c;++p)if(u[p]!==d[p]){s=u[p],l=d[p];break}return s<l?-1:l<s?1:0},a.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},a.prototype.indexOf=function(e,t,n){return f(this,e,t,n,!0)},a.prototype.lastIndexOf=function(e,t,n){return f(this,e,t,n,!1)},a.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-t;if((void 0===n||n>o)&&(n=o),0<e.length&&(0>n||0>t)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return v(this,e,t,n);case"ascii":return y(this,e,t,n);case"latin1":case"binary":return _(this,e,t,n);case"base64":return k(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.prototype.slice=function(e,t){var n=this.length;0>(e=~~e)?0>(e+=n)&&(e=0):e>n&&(e=n),0>(t=void 0===t?n:~~t)?0>(t+=n)&&(t=0):t>n&&(t=n),t<e&&(t=e);var r=this.subarray(e,t);return r.__proto__=a.prototype,r},a.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r},a.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);for(var r=this[e+--t],o=1;0<t&&(o*=256);)r+=this[e+--t]*o;return r},a.prototype.readUInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);for(var r=this[e],o=1,a=0;++a<t&&(o*=256);)r+=this[e+a]*o;return r>=(o*=128)&&(r-=i(2,8*t)),r},a.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);for(var r=t,o=1,a=this[e+--r];0<r&&(o*=256);)a+=this[e+--r]*o;return a>=(o*=128)&&(a-=i(2,8*t)),a},a.prototype.readInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||P(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt16BE=function(e,t){e>>>=0,t||P(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return e>>>=0,t||P(e,4,this.length),V.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||P(e,4,this.length),V.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||P(e,8,this.length),V.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||P(e,8,this.length),V.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||R(this,e,t,n,i(2,8*n)-1,0);var o=1,a=0;for(this[t]=255&e;++a<n&&(o*=256);)this[t+a]=255&e/o;return t+n},a.prototype.writeUIntBE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||R(this,e,t,n,i(2,8*n)-1,0);var o=n-1,a=1;for(this[t+o]=255&e;0<=--o&&(a*=256);)this[t+o]=255&e/a;return t+n},a.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var o=i(2,8*n-1);R(this,e,t,n,o-1,-o)}var a=0,s=1,l=0;for(this[t]=255&e;++a<n&&(s*=256);)0>e&&0===l&&0!==this[t+a-1]&&(l=1),this[t+a]=255&(e/s>>0)-l;return t+n},a.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var o=i(2,8*n-1);R(this,e,t,n,o-1,-o)}var a=n-1,s=1,l=0;for(this[t+a]=255&e;0<=--a&&(s*=256);)0>e&&0===l&&0!==this[t+a+1]&&(l=1),this[t+a]=255&(e/s>>0)-l;return t+n},a.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,1,127,-128),0>e&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeFloatLE=function(e,t,n){return B(this,e,t,!0,n)},a.prototype.writeFloatBE=function(e,t,n){return B(this,e,t,!1,n)},a.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},a.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},a.prototype.copy=function(e,t,n,r){if(!a.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),0<r&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(0>t)throw new RangeError("targetStart out of bounds");if(0>n||n>=this.length)throw new RangeError("Index out of range");if(0>r)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var o=r-n;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,n,r);else if(this===e&&n<t&&t<r)for(var i=o-1;0<=i;--i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,r),t);return o},a.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){var o=e.charCodeAt(0);("utf8"===r&&128>o||"latin1"===r)&&(e=o)}}else"number"==typeof e&&(e&=255);if(0>t||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{var s=a.isBuffer(e)?e:a.from(e,r),l=s.length;if(0===l)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<n-t;++i)this[i+t]=s[i%l]}return this};var H=/[^+/0-9A-Za-z-_]/g}).call(this)}).call(this,e("buffer").Buffer)},{"base64-js":1,buffer:3,ieee754:9}],4:[function(e,t,n){(function(r){(function(){n.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0,o=0;e[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"===e||(r++,"%c"===e&&(o=r))})),e.splice(o,0,n)},n.save=function(e){try{e?n.storage.setItem("debug",e):n.storage.removeItem("debug")}catch(e){}},n.load=function(){let e;try{e=n.storage.getItem("debug")}catch(e){}return!e&&void 0!==r&&"env"in r&&(e=r.env.DEBUG),e},n.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||!("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&31<=parseInt(RegExp.$1,10)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},n.storage=function(){try{return localStorage}catch(e){}}(),n.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),n.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],n.log=console.debug||console.log||(()=>{}),t.exports=e("./common")(n);const{formatters:o}=t.exports;o.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this)}).call(this,e("_process"))},{"./common":5,_process:12}],5:[function(e,t){t.exports=function(t){function n(e){function t(...e){if(!t.enabled)return;const r=t,i=+new Date,a=i-(o||i);r.diff=a,r.prev=o,r.curr=i,o=i,e[0]=n.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((t,o)=>{if("%%"===t)return"%";s++;const i=n.formatters[o];if("function"==typeof i){const n=e[s];t=i.call(r,n),e.splice(s,1),s--}return t})),n.formatArgs.call(r,e),(r.log||n.log).apply(r,e)}let o,i=null;return t.namespace=e,t.useColors=n.useColors(),t.color=n.selectColor(e),t.extend=r,t.destroy=n.destroy,Object.defineProperty(t,"enabled",{enumerable:!0,configurable:!1,get:()=>null===i?n.enabled(e):i,set:e=>{i=e}}),"function"==typeof n.init&&n.init(t),t}function r(e,t){const r=n(this.namespace+(void 0===t?":":t)+e);return r.log=this.log,r}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return n.debug=n,n.default=n,n.coerce=function(e){return e instanceof Error?e.stack||e.message:e},n.disable=function(){const e=[...n.names.map(i),...n.skips.map(i).map((e=>"-"+e))].join(",");return n.enable(""),e},n.enable=function(e){let t;n.save(e),n.names=[],n.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(t=0;t<o;t++)r[t]&&("-"===(e=r[t].replace(/\*/g,".*?"))[0]?n.skips.push(new RegExp("^"+e.substr(1)+"$")):n.names.push(new RegExp("^"+e+"$")))},n.enabled=function(e){if("*"===e[e.length-1])return!0;let t,r;for(t=0,r=n.skips.length;t<r;t++)if(n.skips[t].test(e))return!1;for(t=0,r=n.names.length;t<r;t++)if(n.names[t].test(e))return!0;return!1},n.humanize=e("ms"),n.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach((e=>{n[e]=t[e]})),n.names=[],n.skips=[],n.formatters={},n.selectColor=function(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[o(t)%n.colors.length]},n.enable(n.load()),n}},{ms:11}],6:[function(e,t){"use strict";function n(e,t){for(const n in t)Object.defineProperty(e,n,{value:t[n],enumerable:!0,configurable:!0});return e}t.exports=function(e,t,r){if(!e||"string"==typeof e)throw new TypeError("Please pass an Error to err-code");r||(r={}),"object"==typeof t&&(r=t,t=""),t&&(r.code=t);try{return n(e,r)}catch(t){r.message=e.message,r.stack=e.stack;const o=function(){};return o.prototype=Object.create(Object.getPrototypeOf(e)),n(new o,r)}}},{}],7:[function(e,t){"use strict";function n(){n.init.call(this)}function r(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function o(e){return void 0===e._maxListeners?n.defaultMaxListeners:e._maxListeners}function i(e,t,n,i){var a,s,l;if(r(n),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),l=s[t]),void 0===l)l=s[t]=n,++e._eventsCount;else if("function"==typeof l?l=s[t]=i?[n,l]:[l,n]:i?l.unshift(n):l.push(n),0<(a=o(e))&&l.length>a&&!l.warned){l.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=l.length,function(e){console&&console.warn&&console.warn(e)}(c)}return e}function a(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function s(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=a.bind(r);return o.listener=n,r.wrapFn=o,o}function l(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):u(o,o.length)}function c(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function u(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e[r];return n}function d(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){r.once&&e.removeEventListener(t,o),n(i)}))}}var p,h="object"==typeof Reflect?Reflect:null,m=h&&"function"==typeof h.apply?h.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};p=h&&"function"==typeof h.ownKeys?h.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var f=Number.isNaN||function(e){return e!=e};t.exports=n,t.exports.once=function(e,t){return new Promise((function(n,r){function o(n){e.removeListener(t,i),r(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}d(e,t,i,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&d(e,"error",t,n)}(e,o,{once:!0})}))},n.EventEmitter=n,n.prototype._events=void 0,n.prototype._eventsCount=0,n.prototype._maxListeners=void 0;var g=10;Object.defineProperty(n,"defaultMaxListeners",{enumerable:!0,get:function(){return g},set:function(e){if("number"!=typeof e||0>e||f(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");g=e}}),n.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},n.prototype.setMaxListeners=function(e){if("number"!=typeof e||0>e||f(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},n.prototype.getMaxListeners=function(){return o(this)},n.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,o=this._events;if(void 0!==o)r=r&&void 0===o.error;else if(!r)return!1;if(r){var i;if(0<t.length&&(i=t[0]),i instanceof Error)throw i;var a=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw a.context=i,a}var s=o[e];if(void 0===s)return!1;if("function"==typeof s)m(s,this,t);else{var l=s.length,c=u(s,l);for(n=0;n<l;++n)m(c[n],this,t)}return!0},n.prototype.addListener=function(e,t){return i(this,e,t,!1)},n.prototype.on=n.prototype.addListener,n.prototype.prependListener=function(e,t){return i(this,e,t,!0)},n.prototype.once=function(e,t){return r(t),this.on(e,s(this,e,t)),this},n.prototype.prependOnceListener=function(e,t){return r(t),this.prependListener(e,s(this,e,t)),this},n.prototype.removeListener=function(e,t){var n,o,i,a,s;if(r(t),void 0===(o=this._events))return this;if(void 0===(n=o[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete o[e],o.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,a=n.length-1;0<=a;a--)if(n[a]===t||n[a].listener===t){s=n[a].listener,i=a;break}if(0>i)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(o[e]=n[0]),void 0!==o.removeListener&&this.emit("removeListener",e,s||t)}return this},n.prototype.off=n.prototype.removeListener,n.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;0<=r;r--)this.removeListener(e,t[r]);return this},n.prototype.listeners=function(e){return l(this,e,!0)},n.prototype.rawListeners=function(e){return l(this,e,!1)},n.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):c.call(e,t)},n.prototype.listenerCount=c,n.prototype.eventNames=function(){return 0<this._eventsCount?p(this._events):[]}},{}],8:[function(e,t){t.exports=function(){if("undefined"==typeof globalThis)return null;var e={RTCPeerConnection:globalThis.RTCPeerConnection||globalThis.mozRTCPeerConnection||globalThis.webkitRTCPeerConnection,RTCSessionDescription:globalThis.RTCSessionDescription||globalThis.mozRTCSessionDescription||globalThis.webkitRTCSessionDescription,RTCIceCandidate:globalThis.RTCIceCandidate||globalThis.mozRTCIceCandidate||globalThis.webkitRTCIceCandidate};return e.RTCPeerConnection?e:null}},{}],9:[function(e,t,n){n.read=function(e,t,n,r,o){var a,s,l=8*o-r-1,c=(1<<l)-1,u=c>>1,d=-7,p=n?o-1:0,h=n?-1:1,m=e[t+p];for(p+=h,a=m&(1<<-d)-1,m>>=-d,d+=l;0<d;a=256*a+e[t+p],p+=h,d-=8);for(s=a&(1<<-d)-1,a>>=-d,d+=r;0<d;s=256*s+e[t+p],p+=h,d-=8);if(0===a)a=1-u;else{if(a===c)return s?NaN:1/0*(m?-1:1);s+=i(2,r),a-=u}return(m?-1:1)*s*i(2,a-r)},n.write=function(e,t,n,a,s,l){var c,u,d,p=Math.LN2,h=Math.log,m=8*l-s-1,f=(1<<m)-1,g=f>>1,b=23===s?i(2,-24)-i(2,-77):0,v=a?0:l-1,y=a?1:-1,_=0>t||0===t&&0>1/t?1:0;for(t=o(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,c=f):(c=r(h(t)/p),1>t*(d=i(2,-c))&&(c--,d*=2),2<=(t+=1<=c+g?b/d:b*i(2,1-g))*d&&(c++,d/=2),c+g>=f?(u=0,c=f):1<=c+g?(u=(t*d-1)*i(2,s),c+=g):(u=t*i(2,g-1)*i(2,s),c=0));8<=s;e[n+v]=255&u,v+=y,u/=256,s-=8);for(c=c<<s|u,m+=s;0<m;e[n+v]=255&c,v+=y,c/=256,m-=8);e[n+v-y]|=128*_}},{}],10:[function(e,t){t.exports="function"==typeof Object.create?function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},{}],11:[function(e,t){var n=Math.round;function r(e){var t=o(e);return 864e5<=t?n(e/864e5)+"d":36e5<=t?n(e/36e5)+"h":6e4<=t?n(e/6e4)+"m":1e3<=t?n(e/1e3)+"s":e+"ms"}function i(e){var t=o(e);return 864e5<=t?a(e,t,864e5,"day"):36e5<=t?a(e,t,36e5,"hour"):6e4<=t?a(e,t,6e4,"minute"):1e3<=t?a(e,t,1e3,"second"):e+" ms"}function a(e,t,r,o){return n(e/r)+" "+o+(t>=1.5*r?"s":"")}t.exports=function(e,t){t=t||{};var n=typeof e;if("string"==n&&0<e.length)return function(e){if(!(100<(e+="").length)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();return"years"===r||"year"===r||"yrs"===r||"yr"===r||"y"===r?315576e5*n:"weeks"===r||"week"===r||"w"===r?6048e5*n:"days"===r||"day"===r||"d"===r?864e5*n:"hours"===r||"hour"===r||"hrs"===r||"hr"===r||"h"===r?36e5*n:"minutes"===r||"minute"===r||"mins"===r||"min"===r||"m"===r?6e4*n:"seconds"===r||"second"===r||"secs"===r||"sec"===r||"s"===r?1e3*n:"milliseconds"===r||"millisecond"===r||"msecs"===r||"msec"===r||"ms"===r?n:void 0}}}(e);if("number"===n&&isFinite(e))return t.long?i(e):r(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},{}],12:[function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function i(){m&&p&&(m=!1,p.length?h=p.concat(h):f=-1,h.length&&a())}function a(){if(!m){var e=o(i);m=!0;for(var t=h.length;t;){for(p=h,h=[];++f<t;)p&&p[f].run();f=-1,t=h.length}p=null,m=!1,function(e){if(u===clearTimeout)return clearTimeout(e);if((u===r||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(e);try{return u(e)}catch(t){try{return u.call(null,e)}catch(t){return u.call(this,e)}}}(e)}}function s(e,t){this.fun=e,this.array=t}function l(){}var c,u,d=t.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:n}catch(e){c=n}try{u="function"==typeof clearTimeout?clearTimeout:r}catch(e){u=r}}();var p,h=[],m=!1,f=-1;d.nextTick=function(e){var t=Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];h.push(new s(e,t)),1!==h.length||m||o(a)},s.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=l,d.addListener=l,d.once=l,d.off=l,d.removeListener=l,d.removeAllListeners=l,d.emit=l,d.prependListener=l,d.prependOnceListener=l,d.listeners=function(){return[]},d.binding=function(){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},{}],13:[function(e,t){(function(e){(function(){let n;t.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"==typeof window?e:window):e=>(n||(n=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0)))}).call(this)}).call(this,void 0===n.g?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:n.g)},{}],14:[function(e,t){(function(n,r){(function(){"use strict";var o=e("safe-buffer").Buffer,i=r.crypto||r.msCrypto;t.exports=i&&i.getRandomValues?function(e,t){if(e>4294967295)throw new RangeError("requested too many random bytes");var r=o.allocUnsafe(e);if(0<e)if(65536<e)for(var a=0;a<e;a+=65536)i.getRandomValues(r.slice(a,a+65536));else i.getRandomValues(r);return"function"==typeof t?n.nextTick((function(){t(null,r)})):r}:function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this)}).call(this,e("_process"),void 0===n.g?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:n.g)},{_process:12,"safe-buffer":30}],15:[function(e,t){"use strict";function n(e,t,n){function r(e,n,r){return"string"==typeof t?t:t(e,n,r)}n||(n=Error);var i=function(e){function t(t,n,o){return e.call(this,r(t,n,o))||this}return function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(t,e),t}(n);i.prototype.name=n.name,i.prototype.code=e,o[e]=i}function r(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map((function(e){return e+""})),2<n?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(e+"")}var o={};n("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(e,t,n){var o,i;if("string"==typeof t&&function(e,t,n){return e.substr(!n||0>n?0:+n,t.length)===t}(t,"not ")?(o="must not be",t=t.replace(/^not /,"")):o="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument"))i="The ".concat(e," ").concat(o," ").concat(r(t,"type"));else{var a=function(e,t,n){return"number"!=typeof n&&(n=0),!(n+t.length>e.length)&&-1!==e.indexOf(t,n)}(e,".")?"property":"argument";i='The "'.concat(e,'" ').concat(a," ").concat(o," ").concat(r(t,"type"))}return i+". Received type ".concat(typeof n)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=o},{}],16:[function(e,t){(function(n){(function(){"use strict";function r(e){return this instanceof r?(s.call(this,e),l.call(this,e),this.allowHalfOpen=!0,void(e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",o))))):new r(e)}function o(){this._writableState.ended||n.nextTick(i,this)}function i(e){e.end()}var a=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=r;var s=e("./_stream_readable"),l=e("./_stream_writable");e("inherits")(r,s);for(var c,u=a(l.prototype),d=0;d<u.length;d++)c=u[d],r.prototype[c]||(r.prototype[c]=l.prototype[c]);Object.defineProperty(r.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(r.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(r.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(r.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0===this._readableState||void 0===this._writableState||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}).call(this)}).call(this,e("_process"))},{"./_stream_readable":18,"./_stream_writable":20,_process:12,inherits:10}],17:[function(e,t){"use strict";function n(e){return this instanceof n?void r.call(this,e):new n(e)}t.exports=n;var r=e("./_stream_transform");e("inherits")(n,r),n.prototype._transform=function(e,t,n){n(null,e)}},{"./_stream_transform":19,inherits:10}],18:[function(e,t){(function(n,r){(function(){"use strict";function o(t,n,r){w=w||e("./_stream_duplex"),t=t||{},"boolean"!=typeof r&&(r=n instanceof w),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=L(this,t,"readableHighWaterMark",r),this.buffer=new A,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(!N&&(N=e("string_decoder/").StringDecoder),this.decoder=new N(t.encoding),this.encoding=t.encoding)}function i(t){if(w=w||e("./_stream_duplex"),!(this instanceof i))return new i(t);var n=this instanceof w;this._readableState=new o(t,this,n),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),x.call(this)}function a(e,t,n,r,o){E("readableAddChunk",t);var i,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(E("onEofChunk"),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?u(e):(t.needReadable=!1,!t.emittedReadable&&(t.emittedReadable=!0,d(e)))}}(e,a);else if(o||(i=l(a,t)),i)Z(e,i);else if(a.objectMode||t&&0<t.length)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===S.prototype||(t=function(e){return S.from(e)}(t)),r)a.endEmitted?Z(e,new j):s(e,a,t,!0);else if(a.ended)Z(e,new O);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?s(e,a,t,!1):p(e,a)):s(e,a,t,!1)}else r||(a.reading=!1,p(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function s(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&u(e)),p(e,t)}function l(e,t){var n;return function(e){return S.isBuffer(e)||e instanceof I}(t)||"string"==typeof t||void 0===t||e.objectMode||(n=new D("chunk",["string","Buffer","Uint8Array"],t)),n}function c(e,t){return 0>=e||0===t.length&&t.ended?0:t.objectMode?1:e==e?(e>t.highWaterMark&&(t.highWaterMark=function(e){return 1073741824<=e?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0)):t.flowing&&t.length?t.buffer.head.data.length:t.length}function u(e){var t=e._readableState;E("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(E("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(d,e))}function d(e){var t=e._readableState;E("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,b(e)}function p(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(h,e,t))}function h(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var n=t.length;if(E("maybeReadMore read 0"),e.read(0),n===t.length)break}t.readingMore=!1}function m(e){var t=e._readableState;t.readableListening=0<e.listenerCount("readable"),t.resumeScheduled&&!t.paused?t.flowing=!0:0<e.listenerCount("data")&&e.resume()}function f(e){E("readable nexttick read 0"),e.read(0)}function g(e,t){E("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),b(e),t.flowing&&!t.reading&&e.read(0)}function b(e){var t=e._readableState;for(E("flow",t.flowing);t.flowing&&null!==e.read(););}function v(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function y(e){var t=e._readableState;E("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(_,t,e))}function _(e,t){if(E("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function k(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}var w;t.exports=i,i.ReadableState=o,e("events").EventEmitter;var E,C=function(e,t){return e.listeners(t).length},x=e("./internal/streams/stream"),S=e("buffer").Buffer,I=r.Uint8Array||function(){},T=e("util");E=T&&T.debuglog?T.debuglog("stream"):function(){};var N,P,R,A=e("./internal/streams/buffer_list"),B=e("./internal/streams/destroy"),L=e("./internal/streams/state").getHighWaterMark,M=e("../errors").codes,D=M.ERR_INVALID_ARG_TYPE,O=M.ERR_STREAM_PUSH_AFTER_EOF,F=M.ERR_METHOD_NOT_IMPLEMENTED,j=M.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;e("inherits")(i,x);var Z=B.errorOrDestroy,z=["error","close","destroy","pause","resume"];Object.defineProperty(i.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),i.prototype.destroy=B.destroy,i.prototype._undestroy=B.undestroy,i.prototype._destroy=function(e,t){t(e)},i.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=S.from(e,t),t=""),n=!0),a(this,e,t,!1,n)},i.prototype.unshift=function(e){return a(this,e,null,!0,!1)},i.prototype.isPaused=function(){return!1===this._readableState.flowing},i.prototype.setEncoding=function(t){N||(N=e("string_decoder/").StringDecoder);var n=new N(t);this._readableState.decoder=n,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,o="";null!==r;)o+=n.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==o&&this._readableState.buffer.push(o),this._readableState.length=o.length,this},i.prototype.read=function(e){E("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0===t.highWaterMark?0<t.length:t.length>=t.highWaterMark)||t.ended))return E("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?y(this):u(this),null;if(0===(e=c(e,t))&&t.ended)return 0===t.length&&y(this),null;var r,o=t.needReadable;return E("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&E("length less than watermark",o=!0),t.ended||t.reading?E("reading or ended",o=!1):o&&(E("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,!t.reading&&(e=c(n,t))),null===(r=0<e?v(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(!t.ended&&(t.needReadable=!0),n!==e&&t.ended&&y(this)),null!==r&&this.emit("data",r),r},i.prototype._read=function(){Z(this,new F("_read()"))},i.prototype.pipe=function(e,t){function r(e,t){E("onunpipe"),e===d&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,i())}function o(){E("onend"),e.end()}function i(){E("cleanup"),e.removeListener("close",l),e.removeListener("finish",c),e.removeListener("drain",m),e.removeListener("error",s),e.removeListener("unpipe",r),d.removeListener("end",o),d.removeListener("end",u),d.removeListener("data",a),f=!0,p.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&m()}function a(t){E("ondata");var n=e.write(t);E("dest.write",n),!1===n&&((1===p.pipesCount&&p.pipes===e||1<p.pipesCount&&-1!==k(p.pipes,e))&&!f&&(E("false write response, pause",p.awaitDrain),p.awaitDrain++),d.pause())}function s(t){E("onerror",t),u(),e.removeListener("error",s),0===C(e,"error")&&Z(e,t)}function l(){e.removeListener("finish",c),u()}function c(){E("onfinish"),e.removeListener("close",l),u()}function u(){E("unpipe"),d.unpipe(e)}var d=this,p=this._readableState;switch(p.pipesCount){case 0:p.pipes=e;break;case 1:p.pipes=[p.pipes,e];break;default:p.pipes.push(e)}p.pipesCount+=1,E("pipe count=%d opts=%j",p.pipesCount,t);var h=t&&!1===t.end||e===n.stdout||e===n.stderr?u:o;p.endEmitted?n.nextTick(h):d.once("end",h),e.on("unpipe",r);var m=function(e){return function(){var t=e._readableState;E("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&C(e,"data")&&(t.flowing=!0,b(e))}}(d);e.on("drain",m);var f=!1;return d.on("data",a),function(e,t,n){"function"==typeof e.prependListener?e.prependListener(t,n):e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",s),e.once("close",l),e.once("finish",c),e.emit("pipe",d),p.flowing||(E("pipe resume"),d.resume()),e},i.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<o;i++)r[i].emit("unpipe",this,{hasUnpiped:!1});return this}var a=k(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},i.prototype.on=function(e,t){var r=x.prototype.on.call(this,e,t),o=this._readableState;return"data"===e?(o.readableListening=0<this.listenerCount("readable"),!1!==o.flowing&&this.resume()):"readable"==e&&!o.endEmitted&&!o.readableListening&&(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,E("on readable",o.length,o.reading),o.length?u(this):!o.reading&&n.nextTick(f,this)),r},i.prototype.addListener=i.prototype.on,i.prototype.removeListener=function(e,t){var r=x.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(m,this),r},i.prototype.removeAllListeners=function(e){var t=x.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&n.nextTick(m,this),t},i.prototype.resume=function(){var e=this._readableState;return e.flowing||(E("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(g,e,t))}(this,e)),e.paused=!1,this},i.prototype.pause=function(){return E("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(E("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},i.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var o in e.on("end",(function(){if(E("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(o){E("wrapped data"),n.decoder&&(o=n.decoder.write(o)),n.objectMode&&null==o||!(n.objectMode||o&&o.length)||t.push(o)||(r=!0,e.pause())})),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var i=0;i<z.length;i++)e.on(z[i],this.emit.bind(this,z[i]));return this._read=function(t){E("wrapped _read",t),r&&(r=!1,e.resume())},this},"function"==typeof Symbol&&(i.prototype[Symbol.asyncIterator]=function(){return void 0===P&&(P=e("./internal/streams/async_iterator")),P(this)}),Object.defineProperty(i.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(i.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(i.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),i._fromList=v,Object.defineProperty(i.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(i.from=function(t,n){return void 0===R&&(R=e("./internal/streams/from")),R(i,t,n)})}).call(this)}).call(this,e("_process"),void 0===n.g?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:n.g)},{"../errors":15,"./_stream_duplex":16,"./internal/streams/async_iterator":21,"./internal/streams/buffer_list":22,"./internal/streams/destroy":23,"./internal/streams/from":25,"./internal/streams/state":27,"./internal/streams/stream":28,_process:12,buffer:3,events:7,inherits:10,"string_decoder/":31,util:2}],19:[function(e,t){"use strict";function n(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new l);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}function r(e){return this instanceof r?(d.call(this,e),this._transformState={afterTransform:n.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),void this.on("prefinish",o)):new r(e)}function o(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?i(this,null,null):this._flush((function(t,n){i(e,t,n)}))}function i(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new u;if(e._transformState.transforming)throw new c;return e.push(null)}t.exports=r;var a=e("../errors").codes,s=a.ERR_METHOD_NOT_IMPLEMENTED,l=a.ERR_MULTIPLE_CALLBACK,c=a.ERR_TRANSFORM_ALREADY_TRANSFORMING,u=a.ERR_TRANSFORM_WITH_LENGTH_0,d=e("./_stream_duplex");e("inherits")(r,d),r.prototype.push=function(e,t){return this._transformState.needTransform=!1,d.prototype.push.call(this,e,t)},r.prototype._transform=function(e,t,n){n(new s("_transform()"))},r.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var o=this._readableState;(r.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},r.prototype._read=function(){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},r.prototype._destroy=function(e,t){d.prototype._destroy.call(this,e,(function(e){t(e)}))}},{"../errors":15,"./_stream_duplex":16,inherits:10}],20:[function(e,t){(function(n,r){(function(){"use strict";function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;for(e.entry=null;r;){var o=r.callback;t.pendingcb--,o(n),r=r.next}t.corkedRequestsFree.next=e}(t,e)}}function i(){}function a(t,n,r){_=_||e("./_stream_duplex"),t=t||{},"boolean"!=typeof r&&(r=n instanceof _),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=I(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=!1===t.decodeStrings;this.decodeStrings=!i,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){p(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function s(t){var n=this instanceof(_=_||e("./_stream_duplex"));return n||k.call(s,this)?(this._writableState=new a(t,this,n),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),void E.call(this)):new s(t)}function l(e,t){var r=new M;O(e,r),n.nextTick(t,r)}function c(e,t,r,o){var i;return null===r?i=new L:"string"!=typeof r&&!t.objectMode&&(i=new N("chunk",["string","Buffer"],r)),!i||(O(e,i),n.nextTick(o,i),!1)}function u(e,t,n,r,o,i){if(!n){var a=function(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=C.from(t,n)),t}(t,r,o);r!==a&&(n=!0,o="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var l=t.length<t.highWaterMark;if(l||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:o,isBuf:n,callback:i,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else d(e,t,!1,s,r,o,i);return l}function d(e,t,n,r,o,i,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new B("write")):n?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function p(e,t){var r=e._writableState,o=r.sync,i=r.writecb;if("function"!=typeof i)throw new R;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,o,i){--t.pendingcb,r?(n.nextTick(i,o),n.nextTick(v,e,t),e._writableState.errorEmitted=!0,O(e,o)):(i(o),e._writableState.errorEmitted=!0,O(e,o),v(e,t))}(e,r,o,t,i);else{var a=f(r)||e.destroyed;a||r.corked||r.bufferProcessing||!r.bufferedRequest||m(e,r),o?n.nextTick(h,e,r,a,i):h(e,r,a,i)}}function h(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),v(e,t)}function m(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=Array(r),a=t.corkedRequestsFree;a.entry=n;for(var s=0,l=!0;n;)i[s]=n,n.isBuf||(l=!1),n=n.next,s+=1;i.allBuffers=l,d(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,u=n.encoding,p=n.callback;if(d(e,t,!1,t.objectMode?1:c.length,c,u,p),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function f(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function g(e,t){e._final((function(n){t.pendingcb--,n&&O(e,n),t.prefinished=!0,e.emit("prefinish"),v(e,t)}))}function b(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,n.nextTick(g,e,t)))}function v(e,t){var n=f(t);if(n&&(b(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}function y(e,t,r){t.ending=!0,v(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}var _;t.exports=s,s.WritableState=a;var k,w={deprecate:e("util-deprecate")},E=e("./internal/streams/stream"),C=e("buffer").Buffer,x=r.Uint8Array||function(){},S=e("./internal/streams/destroy"),I=e("./internal/streams/state").getHighWaterMark,T=e("../errors").codes,N=T.ERR_INVALID_ARG_TYPE,P=T.ERR_METHOD_NOT_IMPLEMENTED,R=T.ERR_MULTIPLE_CALLBACK,A=T.ERR_STREAM_CANNOT_PIPE,B=T.ERR_STREAM_DESTROYED,L=T.ERR_STREAM_NULL_VALUES,M=T.ERR_STREAM_WRITE_AFTER_END,D=T.ERR_UNKNOWN_ENCODING,O=S.errorOrDestroy;e("inherits")(s,E),a.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(a.prototype,"buffer",{get:w.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(k=Function.prototype[Symbol.hasInstance],Object.defineProperty(s,Symbol.hasInstance,{value:function(e){return!!k.call(this,e)||!(this!==s)&&e&&e._writableState instanceof a}})):k=function(e){return e instanceof this},s.prototype.pipe=function(){O(this,new A)},s.prototype.write=function(e,t,n){var r=this._writableState,o=!1,a=!r.objectMode&&function(e){return C.isBuffer(e)||e instanceof x}(e);return a&&!C.isBuffer(e)&&(e=function(e){return C.from(e)}(e)),"function"==typeof t&&(n=t,t=null),a?t="buffer":!t&&(t=r.defaultEncoding),"function"!=typeof n&&(n=i),r.ending?l(this,n):(a||c(this,r,e,n))&&(r.pendingcb++,o=u(this,r,a,e,t,n)),o},s.prototype.cork=function(){this._writableState.corked++},s.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&m(this,e))},s.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(-1<["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())))throw new D(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(s.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),s.prototype._write=function(e,t,n){n(new P("_write()"))},s.prototype._writev=null,s.prototype.end=function(e,t,n){var r=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||y(this,r,n),this},Object.defineProperty(s.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(s.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),s.prototype.destroy=S.destroy,s.prototype._undestroy=S.undestroy,s.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),void 0===n.g?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:n.g)},{"../errors":15,"./_stream_duplex":16,"./internal/streams/destroy":23,"./internal/streams/state":27,"./internal/streams/stream":28,_process:12,buffer:3,inherits:10,"util-deprecate":32}],21:[function(e,t){(function(n){(function(){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){return{value:e,done:t}}function i(e){var t=e[c];if(null!==t){var n=e[f].read();null!==n&&(e[h]=null,e[c]=null,e[u]=null,t(o(n,!1)))}}function a(e){n.nextTick(i,e)}var s,l=e("./end-of-stream"),c=Symbol("lastResolve"),u=Symbol("lastReject"),d=Symbol("error"),p=Symbol("ended"),h=Symbol("lastPromise"),m=Symbol("handlePromise"),f=Symbol("stream"),g=Object.getPrototypeOf((function(){})),b=Object.setPrototypeOf((s={get stream(){return this[f]},next:function(){var e=this,t=this[d];if(null!==t)return Promise.reject(t);if(this[p])return Promise.resolve(o(void 0,!0));if(this[f].destroyed)return new Promise((function(t,r){n.nextTick((function(){e[d]?r(e[d]):t(o(void 0,!0))}))}));var r,i=this[h];if(i)r=new Promise(function(e,t){return function(n,r){e.then((function(){return t[p]?void n(o(void 0,!0)):void t[m](n,r)}),r)}}(i,this));else{var a=this[f].read();if(null!==a)return Promise.resolve(o(a,!1));r=new Promise(this[m])}return this[h]=r,r}},r(s,Symbol.asyncIterator,(function(){return this})),r(s,"return",(function(){var e=this;return new Promise((function(t,n){e[f].destroy(null,(function(e){return e?void n(e):void t(o(void 0,!0))}))}))})),s),g);t.exports=function(e){var t,n=Object.create(b,(r(t={},f,{value:e,writable:!0}),r(t,c,{value:null,writable:!0}),r(t,u,{value:null,writable:!0}),r(t,d,{value:null,writable:!0}),r(t,p,{value:e._readableState.endEmitted,writable:!0}),r(t,m,{value:function(e,t){var r=n[f].read();r?(n[h]=null,n[c]=null,n[u]=null,e(o(r,!1))):(n[c]=e,n[u]=t)},writable:!0}),t));return n[h]=null,l(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[u];return null!==t&&(n[h]=null,n[c]=null,n[u]=null,t(e)),void(n[d]=e)}var r=n[c];null!==r&&(n[h]=null,n[c]=null,n[u]=null,r(o(void 0,!0))),n[p]=!0})),e.on("readable",a.bind(null,n)),n}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":24,_process:12}],22:[function(e,t){"use strict";function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}function i(e,t,n){a.prototype.copy.call(e,t,n)}var a=e("buffer").Buffer,s=e("util").inspect,l=s&&s.custom||"inspect";t.exports=function(){function e(){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.head=null,this.tail=null,this.length=0}return function(e,t,n){t&&o(e.prototype,t),n&&o(e,n)}(e,[{key:"push",value:function(e){var t={data:e,next:null};0<this.length?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t=a.allocUnsafe(e>>>0),n=this.head,r=0;n;)i(n.data,t,r),r+=n.data.length,n=n.next;return t}},{key:"consume",value:function(e,t){var n;return e<this.head.data.length?(n=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):n=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,n=1,r=t.data;for(e-=r.length;t=t.next;){var o=t.data,i=e>o.length?o.length:e;if(r+=i===o.length?o:o.slice(0,e),0==(e-=i)){i===o.length?(++n,this.head=t.next?t.next:this.tail=null):(this.head=t,t.data=o.slice(i));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var o=n.data,i=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,i),0==(e-=i)){i===o.length?(++r,this.head=n.next?n.next:this.tail=null):(this.head=n,n.data=o.slice(i));break}++r}return this.length-=r,t}},{key:l,value:function(e,t){return s(this,function(e){for(var t,o=1;o<arguments.length;o++)t=null==arguments[o]?{}:arguments[o],o%2?n(Object(t),!0).forEach((function(n){r(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):n(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}({},t,{depth:0,customInspect:!1}))}}]),e}()},{buffer:3,util:2}],23:[function(e,t){(function(e){(function(){"use strict";function n(e,t){o(e,t),r(e)}function r(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function o(e,t){e.emit("error",t)}t.exports={destroy:function(t,i){var a=this,s=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return s||l?(i?i(t):t&&(this._writableState?!this._writableState.errorEmitted&&(this._writableState.errorEmitted=!0,e.nextTick(o,this,t)):e.nextTick(o,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!i&&t?a._writableState?a._writableState.errorEmitted?e.nextTick(r,a):(a._writableState.errorEmitted=!0,e.nextTick(n,a,t)):e.nextTick(n,a,t):i?(e.nextTick(r,a),i(t)):e.nextTick(r,a)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit("error",t)}}}).call(this)}).call(this,e("_process"))},{_process:12}],24:[function(e,t){"use strict";function n(){}var r=e("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;t.exports=function e(t,o,i){if("function"==typeof o)return e(t,null,o);o||(o={}),i=function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];e.apply(this,r)}}}(i||n);var a=o.readable||!1!==o.readable&&t.readable,s=o.writable||!1!==o.writable&&t.writable,l=function(){t.writable||u()},c=t._writableState&&t._writableState.finished,u=function(){s=!1,c=!0,a||i.call(t)},d=t._readableState&&t._readableState.endEmitted,p=function(){a=!1,d=!0,s||i.call(t)},h=function(e){i.call(t,e)},m=function(){var e;return a&&!d?(t._readableState&&t._readableState.ended||(e=new r),i.call(t,e)):s&&!c?(t._writableState&&t._writableState.ended||(e=new r),i.call(t,e)):void 0},f=function(){t.req.on("finish",u)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",u),t.on("abort",m),t.req?f():t.on("request",f)):s&&!t._writableState&&(t.on("end",l),t.on("close",l)),t.on("end",p),t.on("finish",u),!1!==o.error&&t.on("error",h),t.on("close",m),function(){t.removeListener("complete",u),t.removeListener("abort",m),t.removeListener("request",f),t.req&&t.req.removeListener("finish",u),t.removeListener("end",l),t.removeListener("close",l),t.removeListener("finish",u),t.removeListener("end",p),t.removeListener("error",h),t.removeListener("close",m)}}},{"../../../errors":15}],25:[function(e,t){t.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],26:[function(e,t){"use strict";function n(e){if(e)throw e}function r(t,n,r,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var i=!1;t.on("close",(function(){i=!0})),void 0===s&&(s=e("./end-of-stream")),s(t,{readable:n,writable:r},(function(e){return e?o(e):(i=!0,void o())}));var a=!1;return function(e){if(!i)return a?void 0:(a=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new u("pipe")))}}function o(e){e()}function i(e,t){return e.pipe(t)}function a(e){return e.length&&"function"==typeof e[e.length-1]?e.pop():n}var s,l=e("../../../errors").codes,c=l.ERR_MISSING_ARGS,u=l.ERR_STREAM_DESTROYED;t.exports=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var s=a(t);if(Array.isArray(t[0])&&(t=t[0]),2>t.length)throw new c("streams");var l,u=t.map((function(e,n){var i=n<t.length-1;return r(e,i,0<n,(function(e){l||(l=e),e&&u.forEach(o),i||(u.forEach(o),s(l))}))}));return t.reduce(i)}},{"../../../errors":15,"./end-of-stream":24}],27:[function(e,t){"use strict";var n=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,o,i){var a=function(e,t,n){return null==e.highWaterMark?t?e[n]:null:e.highWaterMark}(t,i,o);if(null!=a){if(!isFinite(a)||r(a)!==a||0>a)throw new n(i?o:"highWaterMark",a);return r(a)}return e.objectMode?16:16384}}},{"../../../errors":15}],28:[function(e,t){t.exports=e("events").EventEmitter},{events:7}],29:[function(e,t,n){(n=t.exports=e("./lib/_stream_readable.js")).Stream=n,n.Readable=n,n.Writable=e("./lib/_stream_writable.js"),n.Duplex=e("./lib/_stream_duplex.js"),n.Transform=e("./lib/_stream_transform.js"),n.PassThrough=e("./lib/_stream_passthrough.js"),n.finished=e("./lib/internal/streams/end-of-stream.js"),n.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":16,"./lib/_stream_passthrough.js":17,"./lib/_stream_readable.js":18,"./lib/_stream_transform.js":19,"./lib/_stream_writable.js":20,"./lib/internal/streams/end-of-stream.js":24,"./lib/internal/streams/pipeline.js":26}],30:[function(e,t,n){function r(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return a(e,t,n)}var i=e("buffer"),a=i.Buffer;a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?t.exports=i:(r(i,n),n.Buffer=o),o.prototype=Object.create(a.prototype),r(a,o),o.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return a(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=a(e);return void 0===t?r.fill(0):"string"==typeof n?r.fill(t,n):r.fill(t),r},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return a(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i.SlowBuffer(e)}},{buffer:3}],31:[function(e,t,n){"use strict";function r(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(p.isEncoding===h||!h(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=a,this.end=s,t=4;break;case"utf8":this.fillLast=i,t=4;break;case"base64":this.text=l,this.end=c,t=3;break;default:return this.write=u,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=p.allocUnsafe(t)}function o(e){return 127>=e?0:6==e>>5?2:14==e>>4?3:30==e>>3?4:2==e>>6?-1:-2}function i(e){var t=this.lastTotal-this.lastNeed,n=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(1<e.lastNeed&&1<t.length){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(2<e.lastNeed&&2<t.length&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0===n?this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length)):n}function a(e,t){if(0==(e.length-t)%2){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(55296<=r&&56319>=r)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function s(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function l(e,t){var n=(e.length-t)%3;return 0==n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1==n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function c(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function u(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}var p=e("safe-buffer").Buffer,h=p.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};n.StringDecoder=r,r.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},r.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},r.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=o(t[r]);return 0<=i?(0<i&&(e.lastNeed=i-1),i):--r<n||-2===i?0:0<=(i=o(t[r]))?(0<i&&(e.lastNeed=i-2),i):--r<n||-2===i?0:0<=(i=o(t[r]))?(0<i&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},r.prototype.fillLast=function(e){return this.lastNeed<=e.length?(e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),void(this.lastNeed-=e.length))}},{"safe-buffer":30}],32:[function(e,t){(function(e){(function(){function n(t){try{if(!e.localStorage)return!1}catch(e){return!1}var n=e.localStorage[t];return null!=n&&"true"===(n+"").toLowerCase()}t.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this)}).call(this,void 0===n.g?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:n.g)},{}],"/":[function(e,t){function n(e){return e.replace(/a=ice-options:trickle\s\n/g,"")}const r=e("debug")("simple-peer"),o=e("get-browser-rtc"),i=e("randombytes"),a=e("readable-stream"),s=e("queue-microtask"),l=e("err-code"),{Buffer:c}=e("buffer"),u=65536;class d extends a.Duplex{constructor(e){if(super(e=Object.assign({allowHalfOpen:!1},e)),this._id=i(4).toString("hex").slice(0,7),this._debug("new peer %o",e),this.channelName=e.initiator?e.channelName||i(20).toString("hex"):null,this.initiator=e.initiator||!1,this.channelConfig=e.channelConfig||d.channelConfig,this.channelNegotiated=this.channelConfig.negotiated,this.config=Object.assign({},d.config,e.config),this.offerOptions=e.offerOptions||{},this.answerOptions=e.answerOptions||{},this.sdpTransform=e.sdpTransform||(e=>e),this.streams=e.streams||(e.stream?[e.stream]:[]),this.trickle=void 0===e.trickle||e.trickle,this.allowHalfTrickle=void 0!==e.allowHalfTrickle&&e.allowHalfTrickle,this.iceCompleteTimeout=e.iceCompleteTimeout||5e3,this.destroyed=!1,this.destroying=!1,this._connected=!1,this.remoteAddress=void 0,this.remoteFamily=void 0,this.remotePort=void 0,this.localAddress=void 0,this.localFamily=void 0,this.localPort=void 0,this._wrtc=e.wrtc&&"object"==typeof e.wrtc?e.wrtc:o(),!this._wrtc)throw"undefined"==typeof window?l(new Error("No WebRTC support: Specify `opts.wrtc` option in this environment"),"ERR_WEBRTC_SUPPORT"):l(new Error("No WebRTC support: Not a supported browser"),"ERR_WEBRTC_SUPPORT");this._pcReady=!1,this._channelReady=!1,this._iceComplete=!1,this._iceCompleteTimer=null,this._channel=null,this._pendingCandidates=[],this._isNegotiating=!1,this._firstNegotiation=!0,this._batchedNegotiation=!1,this._queuedNegotiation=!1,this._sendersAwaitingStable=[],this._senderMap=new Map,this._closingInterval=null,this._remoteTracks=[],this._remoteStreams=[],this._chunk=null,this._cb=null,this._interval=null;try{this._pc=new this._wrtc.RTCPeerConnection(this.config)}catch(e){return void this.destroy(l(e,"ERR_PC_CONSTRUCTOR"))}this._isReactNativeWebrtc="number"==typeof this._pc._peerConnectionId,this._pc.oniceconnectionstatechange=()=>{this._onIceStateChange()},this._pc.onicegatheringstatechange=()=>{this._onIceStateChange()},this._pc.onconnectionstatechange=()=>{this._onConnectionStateChange()},this._pc.onsignalingstatechange=()=>{this._onSignalingStateChange()},this._pc.onicecandidate=e=>{this._onIceCandidate(e)},"object"==typeof this._pc.peerIdentity&&this._pc.peerIdentity.catch((e=>{this.destroy(l(e,"ERR_PC_PEER_IDENTITY"))})),this.initiator||this.channelNegotiated?this._setupData({channel:this._pc.createDataChannel(this.channelName,this.channelConfig)}):this._pc.ondatachannel=e=>{this._setupData(e)},this.streams&&this.streams.forEach((e=>{this.addStream(e)})),this._pc.ontrack=e=>{this._onTrack(e)},this._debug("initial negotiation"),this._needsNegotiation(),this._onFinishBound=()=>{this._onFinish()},this.once("finish",this._onFinishBound)}get bufferSize(){return this._channel&&this._channel.bufferedAmount||0}get connected(){return this._connected&&"open"===this._channel.readyState}address(){return{port:this.localPort,family:this.localFamily,address:this.localAddress}}signal(e){if(!this.destroying){if(this.destroyed)throw l(new Error("cannot signal after peer is destroyed"),"ERR_DESTROYED");if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e={}}this._debug("signal()"),e.renegotiate&&this.initiator&&(this._debug("got request to renegotiate"),this._needsNegotiation()),e.transceiverRequest&&this.initiator&&(this._debug("got request for transceiver"),this.addTransceiver(e.transceiverRequest.kind,e.transceiverRequest.init)),e.candidate&&(this._pc.remoteDescription&&this._pc.remoteDescription.type?this._addIceCandidate(e.candidate):this._pendingCandidates.push(e.candidate)),e.sdp&&this._pc.setRemoteDescription(new this._wrtc.RTCSessionDescription(e)).then((()=>{this.destroyed||(this._pendingCandidates.forEach((e=>{this._addIceCandidate(e)})),this._pendingCandidates=[],"offer"===this._pc.remoteDescription.type&&this._createAnswer())})).catch((e=>{this.destroy(l(e,"ERR_SET_REMOTE_DESCRIPTION"))})),e.sdp||e.candidate||e.renegotiate||e.transceiverRequest||this.destroy(l(new Error("signal() called with invalid signal data"),"ERR_SIGNALING"))}}_addIceCandidate(e){const t=new this._wrtc.RTCIceCandidate(e);this._pc.addIceCandidate(t).catch((e=>{!t.address||t.address.endsWith(".local")?function(e){console.warn(e)}("Ignoring unsupported ICE candidate."):this.destroy(l(e,"ERR_ADD_ICE_CANDIDATE"))}))}send(e){if(!this.destroying){if(this.destroyed)throw l(new Error("cannot send after peer is destroyed"),"ERR_DESTROYED");this._channel.send(e)}}addTransceiver(e,t){if(!this.destroying){if(this.destroyed)throw l(new Error("cannot addTransceiver after peer is destroyed"),"ERR_DESTROYED");if(this._debug("addTransceiver()"),this.initiator)try{this._pc.addTransceiver(e,t),this._needsNegotiation()}catch(e){this.destroy(l(e,"ERR_ADD_TRANSCEIVER"))}else this.emit("signal",{type:"transceiverRequest",transceiverRequest:{kind:e,init:t}})}}addStream(e){if(!this.destroying){if(this.destroyed)throw l(new Error("cannot addStream after peer is destroyed"),"ERR_DESTROYED");this._debug("addStream()"),e.getTracks().forEach((t=>{this.addTrack(t,e)}))}}addTrack(e,t){if(this.destroying)return;if(this.destroyed)throw l(new Error("cannot addTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("addTrack()");const n=this._senderMap.get(e)||new Map;let r=n.get(t);if(r)throw r.removed?l(new Error("Track has been removed. You should enable/disable tracks that you want to re-add."),"ERR_SENDER_REMOVED"):l(new Error("Track has already been added to that stream."),"ERR_SENDER_ALREADY_ADDED");r=this._pc.addTrack(e,t),n.set(t,r),this._senderMap.set(e,n),this._needsNegotiation()}replaceTrack(e,t,n){if(this.destroying)return;if(this.destroyed)throw l(new Error("cannot replaceTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("replaceTrack()");const r=this._senderMap.get(e),o=r?r.get(n):null;if(!o)throw l(new Error("Cannot replace track that was never added."),"ERR_TRACK_NOT_ADDED");t&&this._senderMap.set(t,r),null==o.replaceTrack?this.destroy(l(new Error("replaceTrack is not supported in this browser"),"ERR_UNSUPPORTED_REPLACETRACK")):o.replaceTrack(t)}removeTrack(e,t){if(this.destroying)return;if(this.destroyed)throw l(new Error("cannot removeTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSender()");const n=this._senderMap.get(e),r=n?n.get(t):null;if(!r)throw l(new Error("Cannot remove track that was never added."),"ERR_TRACK_NOT_ADDED");try{r.removed=!0,this._pc.removeTrack(r)}catch(e){"NS_ERROR_UNEXPECTED"===e.name?this._sendersAwaitingStable.push(r):this.destroy(l(e,"ERR_REMOVE_TRACK"))}this._needsNegotiation()}removeStream(e){if(!this.destroying){if(this.destroyed)throw l(new Error("cannot removeStream after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSenders()"),e.getTracks().forEach((t=>{this.removeTrack(t,e)}))}}_needsNegotiation(){this._debug("_needsNegotiation"),this._batchedNegotiation||(this._batchedNegotiation=!0,s((()=>{this._batchedNegotiation=!1,this.initiator||!this._firstNegotiation?(this._debug("starting batched negotiation"),this.negotiate()):this._debug("non-initiator initial negotiation request discarded"),this._firstNegotiation=!1})))}negotiate(){if(!this.destroying){if(this.destroyed)throw l(new Error("cannot negotiate after peer is destroyed"),"ERR_DESTROYED");this.initiator?this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("start negotiation"),setTimeout((()=>{this._createOffer()}),0)):this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("requesting negotiation from initiator"),this.emit("signal",{type:"renegotiate",renegotiate:!0})),this._isNegotiating=!0}}destroy(e){this._destroy(e,(()=>{}))}_destroy(e,t){this.destroyed||this.destroying||(this.destroying=!0,this._debug("destroying (error: %s)",e&&(e.message||e)),s((()=>{if(this.destroyed=!0,this.destroying=!1,this._debug("destroy (error: %s)",e&&(e.message||e)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this._connected=!1,this._pcReady=!1,this._channelReady=!1,this._remoteTracks=null,this._remoteStreams=null,this._senderMap=null,clearInterval(this._closingInterval),this._closingInterval=null,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._onFinishBound&&this.removeListener("finish",this._onFinishBound),this._onFinishBound=null,this._channel){try{this._channel.close()}catch(e){}this._channel.onmessage=null,this._channel.onopen=null,this._channel.onclose=null,this._channel.onerror=null}if(this._pc){try{this._pc.close()}catch(e){}this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ontrack=null,this._pc.ondatachannel=null}this._pc=null,this._channel=null,e&&this.emit("error",e),this.emit("close"),t()})))}_setupData(e){if(!e.channel)return this.destroy(l(new Error("Data channel event is missing `channel` property"),"ERR_DATA_CHANNEL"));this._channel=e.channel,this._channel.binaryType="arraybuffer","number"==typeof this._channel.bufferedAmountLowThreshold&&(this._channel.bufferedAmountLowThreshold=u),this.channelName=this._channel.label,this._channel.onmessage=e=>{this._onChannelMessage(e)},this._channel.onbufferedamountlow=()=>{this._onChannelBufferedAmountLow()},this._channel.onopen=()=>{this._onChannelOpen()},this._channel.onclose=()=>{this._onChannelClose()},this._channel.onerror=e=>{const t=e.error instanceof Error?e.error:new Error(`Datachannel error: ${e.message} ${e.filename}:${e.lineno}:${e.colno}`);this.destroy(l(t,"ERR_DATA_CHANNEL"))};let t=!1;this._closingInterval=setInterval((()=>{this._channel&&"closing"===this._channel.readyState?(t&&this._onChannelClose(),t=!0):t=!1}),5e3)}_read(){}_write(e,t,n){if(this.destroyed)return n(l(new Error("cannot write after peer is destroyed"),"ERR_DATA_CHANNEL"));if(this._connected){try{this.send(e)}catch(e){return this.destroy(l(e,"ERR_DATA_CHANNEL"))}this._channel.bufferedAmount>u?(this._debug("start backpressure: bufferedAmount %d",this._channel.bufferedAmount),this._cb=n):n(null)}else this._debug("write before connect"),this._chunk=e,this._cb=n}_onFinish(){if(!this.destroyed){const e=()=>{setTimeout((()=>this.destroy()),1e3)};this._connected?e():this.once("connect",e)}}_startIceCompleteTimeout(){this.destroyed||this._iceCompleteTimer||(this._debug("started iceComplete timeout"),this._iceCompleteTimer=setTimeout((()=>{this._iceComplete||(this._iceComplete=!0,this._debug("iceComplete timeout completed"),this.emit("iceTimeout"),this.emit("_iceComplete"))}),this.iceCompleteTimeout))}_createOffer(){this.destroyed||this._pc.createOffer(this.offerOptions).then((e=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e.sdp=n(e.sdp)),e.sdp=this.sdpTransform(e.sdp);const t=()=>{if(!this.destroyed){const t=this._pc.localDescription||e;this._debug("signal"),this.emit("signal",{type:t.type,sdp:t.sdp})}};this._pc.setLocalDescription(e).then((()=>{this._debug("createOffer success"),this.destroyed||(this.trickle||this._iceComplete?t():this.once("_iceComplete",t))})).catch((e=>{this.destroy(l(e,"ERR_SET_LOCAL_DESCRIPTION"))}))})).catch((e=>{this.destroy(l(e,"ERR_CREATE_OFFER"))}))}_requestMissingTransceivers(){this._pc.getTransceivers&&this._pc.getTransceivers().forEach((e=>{e.mid||!e.sender.track||e.requested||(e.requested=!0,this.addTransceiver(e.sender.track.kind))}))}_createAnswer(){this.destroyed||this._pc.createAnswer(this.answerOptions).then((e=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e.sdp=n(e.sdp)),e.sdp=this.sdpTransform(e.sdp);const t=()=>{if(!this.destroyed){const t=this._pc.localDescription||e;this._debug("signal"),this.emit("signal",{type:t.type,sdp:t.sdp}),this.initiator||this._requestMissingTransceivers()}};this._pc.setLocalDescription(e).then((()=>{this.destroyed||(this.trickle||this._iceComplete?t():this.once("_iceComplete",t))})).catch((e=>{this.destroy(l(e,"ERR_SET_LOCAL_DESCRIPTION"))}))})).catch((e=>{this.destroy(l(e,"ERR_CREATE_ANSWER"))}))}_onConnectionStateChange(){this.destroyed||"failed"===this._pc.connectionState&&this.destroy(l(new Error("Connection failed."),"ERR_CONNECTION_FAILURE"))}_onIceStateChange(){if(this.destroyed)return;const e=this._pc.iceConnectionState,t=this._pc.iceGatheringState;this._debug("iceStateChange (connection: %s) (gathering: %s)",e,t),this.emit("iceStateChange",e,t),("connected"===e||"completed"===e)&&(this._pcReady=!0,this._maybeReady()),"failed"===e&&this.destroy(l(new Error("Ice connection failed."),"ERR_ICE_CONNECTION_FAILURE")),"closed"===e&&this.destroy(l(new Error("Ice connection closed."),"ERR_ICE_CONNECTION_CLOSED"))}getStats(e){const t=e=>("[object Array]"===Object.prototype.toString.call(e.values)&&e.values.forEach((t=>{Object.assign(e,t)})),e);0===this._pc.getStats.length||this._isReactNativeWebrtc?this._pc.getStats().then((n=>{const r=[];n.forEach((e=>{r.push(t(e))})),e(null,r)}),(t=>e(t))):0<this._pc.getStats.length?this._pc.getStats((n=>{if(this.destroyed)return;const r=[];n.result().forEach((e=>{const n={};e.names().forEach((t=>{n[t]=e.stat(t)})),n.id=e.id,n.type=e.type,n.timestamp=e.timestamp,r.push(t(n))})),e(null,r)}),(t=>e(t))):e(null,[])}_maybeReady(){if(this._debug("maybeReady pc %s channel %s",this._pcReady,this._channelReady),this._connected||this._connecting||!this._pcReady||!this._channelReady)return;this._connecting=!0;const e=()=>{this.destroyed||this.getStats(((t,n)=>{if(this.destroyed)return;t&&(n=[]);const r={},o={},i={};let a=!1;n.forEach((e=>{("remotecandidate"===e.type||"remote-candidate"===e.type)&&(r[e.id]=e),("localcandidate"===e.type||"local-candidate"===e.type)&&(o[e.id]=e),("candidatepair"===e.type||"candidate-pair"===e.type)&&(i[e.id]=e)}));const s=e=>{a=!0;let t=o[e.localCandidateId];t&&(t.ip||t.address)?(this.localAddress=t.ip||t.address,this.localPort=+t.port):t&&t.ipAddress?(this.localAddress=t.ipAddress,this.localPort=+t.portNumber):"string"==typeof e.googLocalAddress&&(t=e.googLocalAddress.split(":"),this.localAddress=t[0],this.localPort=+t[1]),this.localAddress&&(this.localFamily=this.localAddress.includes(":")?"IPv6":"IPv4");let n=r[e.remoteCandidateId];n&&(n.ip||n.address)?(this.remoteAddress=n.ip||n.address,this.remotePort=+n.port):n&&n.ipAddress?(this.remoteAddress=n.ipAddress,this.remotePort=+n.portNumber):"string"==typeof e.googRemoteAddress&&(n=e.googRemoteAddress.split(":"),this.remoteAddress=n[0],this.remotePort=+n[1]),this.remoteAddress&&(this.remoteFamily=this.remoteAddress.includes(":")?"IPv6":"IPv4"),this._debug("connect local: %s:%s remote: %s:%s",this.localAddress,this.localPort,this.remoteAddress,this.remotePort)};if(n.forEach((e=>{"transport"===e.type&&e.selectedCandidatePairId&&s(i[e.selectedCandidatePairId]),("googCandidatePair"===e.type&&"true"===e.googActiveConnection||("candidatepair"===e.type||"candidate-pair"===e.type)&&e.selected)&&s(e)})),a||Object.keys(i).length&&!Object.keys(o).length){if(this._connecting=!1,this._connected=!0,this._chunk){try{this.send(this._chunk)}catch(e){return this.destroy(l(e,"ERR_DATA_CHANNEL"))}this._chunk=null,this._debug('sent chunk from "write before connect"');const e=this._cb;this._cb=null,e(null)}"number"!=typeof this._channel.bufferedAmountLowThreshold&&(this._interval=setInterval((()=>this._onInterval()),150),this._interval.unref&&this._interval.unref()),this._debug("connect"),this.emit("connect")}else setTimeout(e,100)}))};e()}_onInterval(){this._cb&&this._channel&&!(this._channel.bufferedAmount>u)&&this._onChannelBufferedAmountLow()}_onSignalingStateChange(){this.destroyed||("stable"===this._pc.signalingState&&(this._isNegotiating=!1,this._debug("flushing sender queue",this._sendersAwaitingStable),this._sendersAwaitingStable.forEach((e=>{this._pc.removeTrack(e),this._queuedNegotiation=!0})),this._sendersAwaitingStable=[],this._queuedNegotiation?(this._debug("flushing negotiation queue"),this._queuedNegotiation=!1,this._needsNegotiation()):(this._debug("negotiated"),this.emit("negotiated"))),this._debug("signalingStateChange %s",this._pc.signalingState),this.emit("signalingStateChange",this._pc.signalingState))}_onIceCandidate(e){this.destroyed||(e.candidate&&this.trickle?this.emit("signal",{type:"candidate",candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}}):!e.candidate&&!this._iceComplete&&(this._iceComplete=!0,this.emit("_iceComplete")),e.candidate&&this._startIceCompleteTimeout())}_onChannelMessage(e){if(this.destroyed)return;let t=e.data;t instanceof ArrayBuffer&&(t=c.from(t)),this.push(t)}_onChannelBufferedAmountLow(){if(!this.destroyed&&this._cb){this._debug("ending backpressure: bufferedAmount %d",this._channel.bufferedAmount);const e=this._cb;this._cb=null,e(null)}}_onChannelOpen(){this._connected||this.destroyed||(this._debug("on channel open"),this._channelReady=!0,this._maybeReady())}_onChannelClose(){this.destroyed||(this._debug("on channel close"),this.destroy())}_onTrack(e){this.destroyed||e.streams.forEach((t=>{this._debug("on track"),this.emit("track",e.track,t),this._remoteTracks.push({track:e.track,stream:t}),this._remoteStreams.some((e=>e.id===t.id))||(this._remoteStreams.push(t),s((()=>{this._debug("on stream"),this.emit("stream",t)})))}))}_debug(){const e=[].slice.call(arguments);e[0]="["+this._id+"] "+e[0],r.apply(null,e)}}d.WEBRTC_SUPPORT=!!o(),d.config={iceServers:[{urls:["stun:stun.l.google.com:19302","stun:global.stun.twilio.com:3478"]}],sdpSemantics:"unified-plan"},d.channelConfig={},t.exports=d},{buffer:3,debug:4,"err-code":6,"get-browser-rtc":8,"queue-microtask":13,randombytes:14,"readable-stream":29}]},{},[])("/"))},14471:function(e,t,n){var r=n(89504),o=n(16058),i=n(439),a=n(20242);function s(){return Array.prototype.reduce.call(arguments,(function(e,t){return o.resolve(e,t)}))}function l(e){return"\\"===i.sep?e.replace(/\\/g,"/").replace(/^[a-z]:\/?/i,"/"):e}function c(e){return a(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 p(e,t,n){var r=c(t);try{return String(e(r))}catch(e){throw e.sourceMapData=n,e}}var h=/[#@] sourceMappingURL=([^\s'"]*)/,m=RegExp("(?:/\\*(?:\\s*\r?\n(?://)?)?(?:"+h.source+")\\s*\\*/|//(?:"+h.source+"))\\s*");function f(e,t,n,r){var o;try{o=_(e,t)}catch(e){return u(r,e)}if(!o||o.map)return u(r,null,o);n(c(o.url),(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)}r(null,o)}))}function g(e,t,n){var r=_(e,t);return!r||r.map||(r.map=p(n,r.url,r),r.map=d(r.map,r)),r}var b=/^data:([^,;]*)(;[^,;]*)*(?:,(.*))?$/,v=/^(?:application|text)\/json$/,y="utf-8";function _(e,t){t=l(t);var n=function(e){var t=e.match(m);return t?t[1]||t[2]||"":null}(e);if(!n)return null;var o=n.match(b);if(o){var i=o[1]||"text/plain",a=o[2]||"",c=o[3]||"",u={sourceMappingURL:n,url:null,sourcesRelativeTo:t,map:c};if(!v.test(i)){var p=new Error("Unuseful data uri mime type: "+i);throw p.sourceMapData=u,p}try{u.map=d(";base64"===a?function(e){if("undefined"==typeof TextDecoder||"undefined"==typeof Uint8Array)return r(e);var t=function(e){for(var t=r(e),n=t.length,o=new Uint8Array(n),i=0;i<n;i++)o[i]=t.charCodeAt(i);return o}(e);return new TextDecoder(y,{fatal:!0}).decode(t)}(c):decodeURIComponent(c),u)}catch(p){throw p.sourceMapData=u,p}return u}var h=s(t,n);return{sourceMappingURL:n,url:h,sourcesRelativeTo:h,map:null}}function k(e,t,n,r,o){"function"==typeof r&&(o=r,r={});var i=e.sources?e.sources.length:0,a={sourcesResolved:[],sourcesContent:[]};if(0!==i){var s=function(){0==--i&&o(null,a)};C(e,t,r,(function(e,t,r){if(a.sourcesResolved[r]=e,"string"==typeof t)a.sourcesContent[r]=t,u(s,null);else{var o=c(e);n(o,(function(e,t){a.sourcesContent[r]=e||String(t),s()}))}}))}else u(o,null,a)}function w(e,t,n,r){var o={sourcesResolved:[],sourcesContent:[]};return e.sources&&0!==e.sources.length?(C(e,t,r,(function(e,t,r){if(o.sourcesResolved[r]=e,null!==n)if("string"==typeof t)o.sourcesContent[r]=t;else{var i=c(e);try{o.sourcesContent[r]=String(n(i))}catch(e){o.sourcesContent[r]=e}}})),o):o}var E=/\/?$/;function C(e,t,n,r){var o;n=n||{},t=l(t);for(var i=0,a=e.sources.length;i<a;i++)o=null,"string"==typeof n.sourceRoot?o=n.sourceRoot:"string"==typeof e.sourceRoot&&!1!==n.sourceRoot&&(o=e.sourceRoot),r(null===o||""===o?s(t,e.sources[i]):s(t,o.replace(E,"/"),e.sources[i]),(e.sourcesContent||[])[i],i)}e.exports={resolveSourceMap:f,resolveSourceMapSync:g,resolveSources:k,resolveSourcesSync:w,resolve:function(e,t,n,r,o){if("function"==typeof r&&(o=r,r={}),null===e){var i={sourceMappingURL:null,url:t,sourcesRelativeTo:t,map:null},a=c(t);n(a,(function(e,t){if(e)return e.sourceMapData=i,o(e);i.map=String(t);try{i.map=d(i.map,i)}catch(e){return o(e)}s(i)}))}else f(e,t,n,(function(e,t){return e?o(e):t?void s(t):o(null,null)}));function s(e){k(e.map,e.sourcesRelativeTo,n,r,(function(t,n){if(t)return o(t);e.sourcesResolved=n.sourcesResolved,e.sourcesContent=n.sourcesContent,o(null,e)}))}},resolveSync:function(e,t,n,r){var o;if(null===e)(o={sourceMappingURL:null,url:t,sourcesRelativeTo:t,map:null}).map=p(n,t,o),o.map=d(o.map,o);else if(!(o=g(e,t,n)))return null;var i=w(o.map,o.sourcesRelativeTo,n,r);return o.sourcesResolved=i.sourcesResolved,o.sourcesContent=i.sourcesContent,o},parseMapToJSON:d}},7402:function(e,t,n){var r=n(23114),o=Object.prototype.hasOwnProperty,i="undefined"!=typeof Map;function a(){this._array=[],this._set=i?new Map:Object.create(null)}a.fromArray=function(e,t){for(var n=new a,r=0,o=e.length;r<o;r++)n.add(e[r],t);return n},a.prototype.size=function(){return i?this._set.size:Object.getOwnPropertyNames(this._set).length},a.prototype.add=function(e,t){var n=i?e:r.toSetString(e),a=i?this.has(e):o.call(this._set,n),s=this._array.length;a&&!t||this._array.push(e),a||(i?this._set.set(e,s):this._set[n]=s)},a.prototype.has=function(e){if(i)return this._set.has(e);var t=r.toSetString(e);return o.call(this._set,t)},a.prototype.indexOf=function(e){if(i){var t=this._set.get(e);if(t>=0)return t}else{var n=r.toSetString(e);if(o.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},a.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},a.prototype.toArray=function(){return this._array.slice()},t.I=a},93719:function(e,t,n){var r=n(8407);t.encode=function(e){var t,n="",o=function(e){return e<0?1+(-e<<1):0+(e<<1)}(e);do{t=31&o,(o>>>=5)>0&&(t|=32),n+=r.encode(t)}while(o>0);return n},t.decode=function(e,t,n){var o,i,a,s,l=e.length,c=0,u=0;do{if(t>=l)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(i=r.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));o=!!(32&i),c+=(i&=31)<<u,u+=5}while(o);n.value=(s=(a=c)>>1,1==(1&a)?-s:s),n.rest=t}},8407:function(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}},54397:function(e,t){function n(e,r,o,i,a,s){var l=Math.floor((r-e)/2)+e,c=a(o,i[l],!0);return 0===c?l:c>0?r-l>1?n(l,r,o,i,a,s):s==t.LEAST_UPPER_BOUND?r<i.length?r:-1:l:l-e>1?n(e,l,o,i,a,s):s==t.LEAST_UPPER_BOUND?l:e<0?-1:e}t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.search=function(e,r,o,i){if(0===r.length)return-1;var a=n(-1,r.length,e,r,o,i||t.GREATEST_LOWER_BOUND);if(a<0)return-1;for(;a-1>=0&&0===o(r[a],r[a-1],!0);)--a;return a}},3307:function(e,t,n){var r=n(23114);function o(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}o.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},o.prototype.add=function(e){var t,n,o,i,a,s;n=e,o=(t=this._last).generatedLine,i=n.generatedLine,a=t.generatedColumn,s=n.generatedColumn,i>o||i==o&&s>=a||r.compareByGeneratedPositionsInflated(t,n)<=0?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},o.prototype.toArray=function(){return this._sorted||(this._array.sort(r.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},t.H=o},90384:function(e,t){function n(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function r(e,t,o,i){if(o<i){var a=o-1;n(e,(u=o,d=i,Math.round(u+Math.random()*(d-u))),i);for(var s=e[i],l=o;l<i;l++)t(e[l],s)<=0&&n(e,a+=1,l);n(e,a+1,l);var c=a+1;r(e,t,o,c-1),r(e,t,c+1,i)}var u,d}t.U=function(e,t){r(e,t,0,e.length-1)}},22799:function(e,t,n){var r=n(23114),o=n(54397),i=n(7402).I,a=n(93719),s=n(90384).U;function l(e,t){var n=e;return"string"==typeof e&&(n=r.parseSourceMapInput(e)),null!=n.sections?new d(n,t):new c(n,t)}function c(e,t){var n=e;"string"==typeof e&&(n=r.parseSourceMapInput(e));var o=r.getArg(n,"version"),a=r.getArg(n,"sources"),s=r.getArg(n,"names",[]),l=r.getArg(n,"sourceRoot",null),c=r.getArg(n,"sourcesContent",null),u=r.getArg(n,"mappings"),d=r.getArg(n,"file",null);if(o!=this._version)throw new Error("Unsupported version: "+o);l&&(l=r.normalize(l)),a=a.map(String).map(r.normalize).map((function(e){return l&&r.isAbsolute(l)&&r.isAbsolute(e)?r.relative(l,e):e})),this._names=i.fromArray(s.map(String),!0),this._sources=i.fromArray(a,!0),this._absoluteSources=this._sources.toArray().map((function(e){return r.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=r.parseSourceMapInput(e));var o=r.getArg(n,"version"),a=r.getArg(n,"sections");if(o!=this._version)throw new Error("Unsupported version: "+o);this._sources=new i,this._names=new i;var s={line:-1,column:0};this._sections=a.map((function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var n=r.getArg(e,"offset"),o=r.getArg(n,"line"),i=r.getArg(n,"column");if(o<s.line||o===s.line&&i<s.column)throw new Error("Section offsets must be ordered and non-overlapping.");return s=n,{generatedOffset:{generatedLine:o+1,generatedColumn:i+1},consumer:new l(r.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 o,i=t||null;switch(n||l.GENERATED_ORDER){case l.GENERATED_ORDER:o=this._generatedMappings;break;case l.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var a=this.sourceRoot;o.map((function(e){var t=null===e.source?null:this._sources.at(e.source);return{source:t=r.computeSourceURL(a,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,i)},l.prototype.allGeneratedPositionsFor=function(e){var t=r.getArg(e,"line"),n={source:r.getArg(e,"source"),originalLine:t,originalColumn:r.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var i=[],a=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",r.compareByOriginalPositions,o.LEAST_UPPER_BOUND);if(a>=0){var s=this._originalMappings[a];if(void 0===e.column)for(var l=s.originalLine;s&&s.originalLine===l;)i.push({line:r.getArg(s,"generatedLine",null),column:r.getArg(s,"generatedColumn",null),lastColumn:r.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++a];else for(var c=s.originalColumn;s&&s.originalLine===t&&s.originalColumn==c;)i.push({line:r.getArg(s,"generatedLine",null),column:r.getArg(s,"generatedColumn",null),lastColumn:r.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++a]}return i},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=r.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),o=n._names=i.fromArray(e._names.toArray(),!0),a=n._sources=i.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 r.computeSourceURL(n.sourceRoot,e,t)}));for(var l=e._mappings.toArray().slice(),d=n.__generatedMappings=[],p=n.__originalMappings=[],h=0,m=l.length;h<m;h++){var f=l[h],g=new u;g.generatedLine=f.generatedLine,g.generatedColumn=f.generatedColumn,f.source&&(g.source=a.indexOf(f.source),g.originalLine=f.originalLine,g.originalColumn=f.originalColumn,f.name&&(g.name=o.indexOf(f.name)),p.push(g)),d.push(g)}return s(n.__originalMappings,r.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,o,i,l,c,d=1,p=0,h=0,m=0,f=0,g=0,b=e.length,v=0,y={},_={},k=[],w=[];v<b;)if(";"===e.charAt(v))d++,v++,p=0;else if(","===e.charAt(v))v++;else{for((n=new u).generatedLine=d,l=v;l<b&&!this._charIsMappingSeparator(e,l);l++);if(i=y[o=e.slice(v,l)])v+=o.length;else{for(i=[];v<l;)a.decode(e,v,_),c=_.value,v=_.rest,i.push(c);if(2===i.length)throw new Error("Found a source, but no line and column");if(3===i.length)throw new Error("Found a source and line, but no column");y[o]=i}n.generatedColumn=p+i[0],p=n.generatedColumn,i.length>1&&(n.source=f+i[1],f+=i[1],n.originalLine=h+i[2],h=n.originalLine,n.originalLine+=1,n.originalColumn=m+i[3],m=n.originalColumn,i.length>4&&(n.name=g+i[4],g+=i[4])),w.push(n),"number"==typeof n.originalLine&&k.push(n)}s(w,r.compareByGeneratedPositionsDeflated),this.__generatedMappings=w,s(k,r.compareByOriginalPositions),this.__originalMappings=k},c.prototype._findMapping=function(e,t,n,r,i,a){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[r]);return o.search(e,t,i,a)},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:r.getArg(e,"line"),generatedColumn:r.getArg(e,"column")},n=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",r.compareByGeneratedPositionsDeflated,r.getArg(e,"bias",l.GREATEST_LOWER_BOUND));if(n>=0){var o=this._generatedMappings[n];if(o.generatedLine===t.generatedLine){var i=r.getArg(o,"source",null);null!==i&&(i=this._sources.at(i),i=r.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var a=r.getArg(o,"name",null);return null!==a&&(a=this._names.at(a)),{source:i,line:r.getArg(o,"originalLine",null),column:r.getArg(o,"originalColumn",null),name:a}}}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 o,i=e;if(null!=this.sourceRoot&&(i=r.relative(this.sourceRoot,i)),null!=this.sourceRoot&&(o=r.urlParse(this.sourceRoot))){var a=i.replace(/^file:\/\//,"");if("file"==o.scheme&&this._sources.has(a))return this.sourcesContent[this._sources.indexOf(a)];if((!o.path||"/"==o.path)&&this._sources.has("/"+i))return this.sourcesContent[this._sources.indexOf("/"+i)]}if(t)return null;throw new Error('"'+i+'" is not in the SourceMap.')},c.prototype.generatedPositionFor=function(e){var t=r.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};var n={source:t,originalLine:r.getArg(e,"line"),originalColumn:r.getArg(e,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",r.compareByOriginalPositions,r.getArg(e,"bias",l.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===n.source)return{line:r.getArg(i,"generatedLine",null),column:r.getArg(i,"generatedColumn",null),lastColumn:r.getArg(i,"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:r.getArg(e,"line"),generatedColumn:r.getArg(e,"column")},n=o.search(t,this._sections,(function(e,t){return e.generatedLine-t.generatedOffset.generatedLine||e.generatedColumn-t.generatedOffset.generatedColumn})),i=this._sections[n];return i?i.consumer.originalPositionFor({line:t.generatedLine-(i.generatedOffset.generatedLine-1),column:t.generatedColumn-(i.generatedOffset.generatedLine===t.generatedLine?i.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 r=this._sections[n].consumer.sourceContentFor(e,!0);if(r)return r}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(r.getArg(e,"source"))){var o=n.consumer.generatedPositionFor(e);if(o)return{line:o.line+(n.generatedOffset.generatedLine-1),column:o.column+(n.generatedOffset.generatedLine===o.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 o=this._sections[n],i=o.consumer._generatedMappings,a=0;a<i.length;a++){var l=i[a],c=o.consumer._sources.at(l.source);c=r.computeSourceURL(o.consumer.sourceRoot,c,this._sourceMapURL),this._sources.add(c),c=this._sources.indexOf(c);var u=null;l.name&&(u=o.consumer._names.at(l.name),this._names.add(u),u=this._names.indexOf(u));var d={source:c,generatedLine:l.generatedLine+(o.generatedOffset.generatedLine-1),generatedColumn:l.generatedColumn+(o.generatedOffset.generatedLine===l.generatedLine?o.generatedOffset.generatedColumn-1:0),originalLine:l.originalLine,originalColumn:l.originalColumn,name:u};this.__generatedMappings.push(d),"number"==typeof d.originalLine&&this.__originalMappings.push(d)}s(this.__generatedMappings,r.compareByGeneratedPositionsDeflated),s(this.__originalMappings,r.compareByOriginalPositions)}},67819:function(e,t,n){var r=n(93719),o=n(23114),i=n(7402).I,a=n(3307).H;function s(e){e||(e={}),this._file=o.getArg(e,"file",null),this._sourceRoot=o.getArg(e,"sourceRoot",null),this._skipValidation=o.getArg(e,"skipValidation",!1),this._sources=new i,this._names=new i,this._mappings=new a,this._sourcesContents=null}s.prototype._version=3,s.fromSourceMap=function(e){var t=e.sourceRoot,n=new s({file:e.file,sourceRoot:t});return e.eachMapping((function(e){var r={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(r.source=e.source,null!=t&&(r.source=o.relative(t,r.source)),r.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(r.name=e.name)),n.addMapping(r)})),e.sources.forEach((function(r){var i=r;null!==t&&(i=o.relative(t,r)),n._sources.has(i)||n._sources.add(i);var a=e.sourceContentFor(r);null!=a&&n.setSourceContent(r,a)})),n},s.prototype.addMapping=function(e){var t=o.getArg(e,"generated"),n=o.getArg(e,"original",null),r=o.getArg(e,"source",null),i=o.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,n,r,i),null!=r&&(r=String(r),this._sources.has(r)||this._sources.add(r)),null!=i&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=n&&n.line,originalColumn:null!=n&&n.column,source:r,name:i})},s.prototype.setSourceContent=function(e,t){var n=e;null!=this._sourceRoot&&(n=o.relative(this._sourceRoot,n)),null!=t?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[o.toSetString(n)]=t):this._sourcesContents&&(delete this._sourcesContents[o.toSetString(n)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},s.prototype.applySourceMap=function(e,t,n){var r=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.');r=e.file}var a=this._sourceRoot;null!=a&&(r=o.relative(a,r));var s=new i,l=new i;this._mappings.unsortedForEach((function(t){if(t.source===r&&null!=t.originalLine){var i=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=i.source&&(t.source=i.source,null!=n&&(t.source=o.join(n,t.source)),null!=a&&(t.source=o.relative(a,t.source)),t.originalLine=i.line,t.originalColumn=i.column,null!=i.name&&(t.name=i.name))}var c=t.source;null==c||s.has(c)||s.add(c);var u=t.name;null==u||l.has(u)||l.add(u)}),this),this._sources=s,this._names=l,e.sources.forEach((function(t){var r=e.sourceContentFor(t);null!=r&&(null!=n&&(t=o.join(n,t)),null!=a&&(t=o.relative(a,t)),this.setSourceContent(t,r))}),this)},s.prototype._validateMapping=function(e,t,n,r){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||r)&&!(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:r}))},s.prototype._serializeMappings=function(){for(var e,t,n,i,a=0,s=1,l=0,c=0,u=0,d=0,p="",h=this._mappings.toArray(),m=0,f=h.length;m<f;m++){if(e="",(t=h[m]).generatedLine!==s)for(a=0;t.generatedLine!==s;)e+=";",s++;else if(m>0){if(!o.compareByGeneratedPositionsInflated(t,h[m-1]))continue;e+=","}e+=r.encode(t.generatedColumn-a),a=t.generatedColumn,null!=t.source&&(i=this._sources.indexOf(t.source),e+=r.encode(i-d),d=i,e+=r.encode(t.originalLine-1-c),c=t.originalLine-1,e+=r.encode(t.originalColumn-l),l=t.originalColumn,null!=t.name&&(n=this._names.indexOf(t.name),e+=r.encode(n-u),u=n)),p+=e}return p},s.prototype._generateSourcesContent=function(e,t){return e.map((function(e){if(!this._sourcesContents)return null;null!=t&&(e=o.relative(t,e));var n=o.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null}),this)},s.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},s.prototype.toString=function(){return JSON.stringify(this.toJSON())},t.SourceMapGenerator=s},25421:function(e,t,n){var r=n(67819).SourceMapGenerator,o=n(23114),i=/(\r?\n)/,a="$$$isSourceNode$$$";function s(e,t,n,r,o){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==o?null:o,this[a]=!0,null!=r&&this.add(r)}s.fromStringWithSourceMap=function(e,t,n){var r=new s,a=e.split(i),l=0,c=function(){return e()+(e()||"");function e(){return l<a.length?a[l++]:void 0}},u=1,d=0,p=null;return t.eachMapping((function(e){if(null!==p){if(!(u<e.generatedLine)){var t=(n=a[l]||"").substr(0,e.generatedColumn-d);return a[l]=n.substr(e.generatedColumn-d),d=e.generatedColumn,h(p,t),void(p=e)}h(p,c()),u++,d=0}for(;u<e.generatedLine;)r.add(c()),u++;if(d<e.generatedColumn){var n=a[l]||"";r.add(n.substr(0,e.generatedColumn)),a[l]=n.substr(e.generatedColumn),d=e.generatedColumn}p=e}),this),l<a.length&&(p&&h(p,c()),r.add(a.splice(l).join(""))),t.sources.forEach((function(e){var i=t.sourceContentFor(e);null!=i&&(null!=n&&(e=o.join(n,e)),r.setSourceContent(e,i))})),r;function h(e,t){if(null===e||void 0===e.source)r.add(t);else{var i=n?o.join(n,e.source):e.source;r.add(new s(e.originalLine,e.originalColumn,i,t,e.name))}}},s.prototype.add=function(e){if(Array.isArray(e))e.forEach((function(e){this.add(e)}),this);else{if(!e[a]&&"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},s.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else{if(!e[a]&&"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},s.prototype.walk=function(e){for(var t,n=0,r=this.children.length;n<r;n++)(t=this.children[n])[a]?t.walk(e):""!==t&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})},s.prototype.join=function(e){var t,n,r=this.children.length;if(r>0){for(t=[],n=0;n<r-1;n++)t.push(this.children[n]),t.push(e);t.push(this.children[n]),this.children=t}return this},s.prototype.replaceRight=function(e,t){var n=this.children[this.children.length-1];return n[a]?n.replaceRight(e,t):"string"==typeof n?this.children[this.children.length-1]=n.replace(e,t):this.children.push("".replace(e,t)),this},s.prototype.setSourceContent=function(e,t){this.sourceContents[o.toSetString(e)]=t},s.prototype.walkSourceContents=function(e){for(var t=0,n=this.children.length;t<n;t++)this.children[t][a]&&this.children[t].walkSourceContents(e);var r=Object.keys(this.sourceContents);for(t=0,n=r.length;t<n;t++)e(o.fromSetString(r[t]),this.sourceContents[r[t]])},s.prototype.toString=function(){var e="";return this.walk((function(t){e+=t})),e},s.prototype.toStringWithSourceMap=function(e){var t={code:"",line:1,column:0},n=new r(e),o=!1,i=null,a=null,s=null,l=null;return this.walk((function(e,r){t.code+=e,null!==r.source&&null!==r.line&&null!==r.column?(i===r.source&&a===r.line&&s===r.column&&l===r.name||n.addMapping({source:r.source,original:{line:r.line,column:r.column},generated:{line:t.line,column:t.column},name:r.name}),i=r.source,a=r.line,s=r.column,l=r.name,o=!0):o&&(n.addMapping({generated:{line:t.line,column:t.column}}),i=null,o=!1);for(var c=0,u=e.length;c<u;c++)10===e.charCodeAt(c)?(t.line++,t.column=0,c+1===u?(i=null,o=!1):o&&n.addMapping({source:r.source,original:{line:r.line,column:r.column},generated:{line:t.line,column:t.column},name:r.name})):t.column++})),this.walkSourceContents((function(e,t){n.setSourceContent(e,t)})),{code:t.code,map:n}}},23114:function(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+))?(.*)$/,r=/^data:.+\,.+$/;function o(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 i(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 a(e){var n=e,r=o(e);if(r){if(!r.path)return e;n=r.path}for(var a,s=t.isAbsolute(n),l=n.split(/\/+/),c=0,u=l.length-1;u>=0;u--)"."===(a=l[u])?l.splice(u,1):".."===a?c++:c>0&&(""===a?(l.splice(u+1,c),c=0):(l.splice(u,2),c--));return""===(n=l.join("/"))&&(n=s?"/":"."),r?(r.path=n,i(r)):n}function s(e,t){""===e&&(e="."),""===t&&(t=".");var n=o(t),s=o(e);if(s&&(e=s.path||"/"),n&&!n.scheme)return s&&(n.scheme=s.scheme),i(n);if(n||t.match(r))return t;if(s&&!s.host&&!s.path)return s.host=t,i(s);var l="/"===t.charAt(0)?t:a(e.replace(/\/+$/,"")+"/"+t);return s?(s.path=l,i(s)):l}t.urlParse=o,t.urlGenerate=i,t.normalize=a,t.join=s,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 r=e.lastIndexOf("/");if(r<0)return t;if((e=e.slice(0,r)).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 r=d(e.source,t.source);return 0!==r||0!=(r=e.originalLine-t.originalLine)||0!=(r=e.originalColumn-t.originalColumn)||n||0!=(r=e.generatedColumn-t.generatedColumn)||0!=(r=e.generatedLine-t.generatedLine)?r:d(e.name,t.name)},t.compareByGeneratedPositionsDeflated=function(e,t,n){var r=e.generatedLine-t.generatedLine;return 0!==r||0!=(r=e.generatedColumn-t.generatedColumn)||n||0!==(r=d(e.source,t.source))||0!=(r=e.originalLine-t.originalLine)||0!=(r=e.originalColumn-t.originalColumn)?r: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 r=o(n);if(!r)throw new Error("sourceMapURL could not be parsed");if(r.path){var l=r.path.lastIndexOf("/");l>=0&&(r.path=r.path.substring(0,l+1))}t=s(i(r),t)}return a(t)}},20065:function(e,t,n){t.SourceMapGenerator=n(67819).SourceMapGenerator,t.SourceMapConsumer=n(22799).SourceMapConsumer,n(25421)},28771:function(e){"use strict";function t(e){return Object.prototype.toString.call(e)}var n=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function r(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)}var o=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t},i=Object.prototype.hasOwnProperty||function(e,t){return t in e};function a(e){if("object"==typeof e&&null!==e){var i;if(n(e))i=[];else if("[object Date]"===t(e))i=new Date(e.getTime?e.getTime():e);else if("[object RegExp]"===t(e))i=new RegExp(e);else if(function(e){return"[object Error]"===t(e)}(e))i={message:e.message};else if(function(e){return"[object Boolean]"===t(e)}(e)||function(e){return"[object Number]"===t(e)}(e)||function(e){return"[object String]"===t(e)}(e))i=Object(e);else if(Object.create&&Object.getPrototypeOf)i=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)i={};else{var a=e.constructor&&e.constructor.prototype||e.__proto__||{},s=function(){};s.prototype=a,i=new s}return r(o(e),(function(t){i[t]=e[t]})),i}return e}function s(e,t,s){var l=[],c=[],u=!0;return function e(d){var p=s?a(d):d,h={},m=!0,f={node:p,node_:d,path:[].concat(l),parent:c[c.length-1],parents:c,key:l[l.length-1],isRoot:0===l.length,level:l.length,circular:null,update:function(e,t){f.isRoot||(f.parent.node[f.key]=e),f.node=e,t&&(m=!1)},delete:function(e){delete f.parent.node[f.key],e&&(m=!1)},remove:function(e){n(f.parent.node)?f.parent.node.splice(f.key,1):delete f.parent.node[f.key],e&&(m=!1)},keys:null,before:function(e){h.before=e},after:function(e){h.after=e},pre:function(e){h.pre=e},post:function(e){h.post=e},stop:function(){u=!1},block:function(){m=!1}};if(!u)return f;function g(){if("object"==typeof f.node&&null!==f.node){f.keys&&f.node_===f.node||(f.keys=o(f.node)),f.isLeaf=0===f.keys.length;for(var e=0;e<c.length;e++)if(c[e].node_===d){f.circular=c[e];break}}else f.isLeaf=!0,f.keys=null;f.notLeaf=!f.isLeaf,f.notRoot=!f.isRoot}g();var b=t.call(f,f.node);return void 0!==b&&f.update&&f.update(b),h.before&&h.before.call(f,f.node),m?("object"!=typeof f.node||null===f.node||f.circular||(c.push(f),g(),r(f.keys,(function(t,n){l.push(t),h.pre&&h.pre.call(f,f.node[t],t);var r=e(f.node[t]);s&&i.call(f.node,t)&&(f.node[t]=r.node),r.isLast=n===f.keys.length-1,r.isFirst=0===n,h.post&&h.post.call(f,r),l.pop()})),c.pop()),h.after&&h.after.call(f,f.node),f):f}(e).node}function l(e){this.value=e}function c(e){return new l(e)}l.prototype.get=function(e){for(var t=this.value,n=0;n<e.length;n++){var r=e[n];if(!t||!i.call(t,r))return;t=t[r]}return t},l.prototype.has=function(e){for(var t=this.value,n=0;n<e.length;n++){var r=e[n];if(!t||!i.call(t,r))return!1;t=t[r]}return!0},l.prototype.set=function(e,t){for(var n=this.value,r=0;r<e.length-1;r++){var o=e[r];i.call(n,o)||(n[o]={}),n=n[o]}return n[e[r]]=t,t},l.prototype.map=function(e){return s(this.value,e,!0)},l.prototype.forEach=function(e){return this.value=s(this.value,e,!1),this.value},l.prototype.reduce=function(e,t){var n=1===arguments.length,r=n?this.value:t;return this.forEach((function(t){this.isRoot&&n||(r=e.call(this,r,t))})),r},l.prototype.paths=function(){var e=[];return this.forEach((function(){e.push(this.path)})),e},l.prototype.nodes=function(){var e=[];return this.forEach((function(){e.push(this.node)})),e},l.prototype.clone=function(){var e=[],t=[];return function n(i){for(var s=0;s<e.length;s++)if(e[s]===i)return t[s];if("object"==typeof i&&null!==i){var l=a(i);return e.push(i),t.push(l),r(o(i),(function(e){l[e]=n(i[e])})),e.pop(),t.pop(),l}return i}(this.value)},r(o(l.prototype),(function(e){c[e]=function(t){var n=[].slice.call(arguments,1),r=new l(t);return r[e].apply(r,n)}})),e.exports=c},16058:function(e,t,n){"use strict";var r=n(90308);function o(){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 i=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,s=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(l),u=["%","/","?",";","#"].concat(c),d=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},f={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(84083);function v(e,t,n){if(e&&"object"==typeof e&&e instanceof o)return e;var r=new o;return r.parse(e,t,n),r}o.prototype.parse=function(e,t,n){if("string"!=typeof e)throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),a=-1!==o&&o<e.indexOf("#")?"?":"#",l=e.split(a);l[0]=l[0].replace(/\\/g,"/");var v=e=l.join(a);if(v=v.trim(),!n&&1===e.split("#").length){var y=s.exec(v);if(y)return this.path=v,this.href=v,this.pathname=y[1],y[2]?(this.search=y[2],this.query=t?b.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var _=i.exec(v);if(_){var k=(_=_[0]).toLowerCase();this.protocol=k,v=v.substr(_.length)}if(n||_||v.match(/^\/\/[^@/]+@[^@/]+/)){var w="//"===v.substr(0,2);!w||_&&f[_]||(v=v.substr(2),this.slashes=!0)}if(!f[_]&&(w||_&&!g[_])){for(var E,C,x=-1,S=0;S<d.length;S++)-1!==(I=v.indexOf(d[S]))&&(-1===x||I<x)&&(x=I);for(-1!==(C=-1===x?v.lastIndexOf("@"):v.lastIndexOf("@",x))&&(E=v.slice(0,C),v=v.slice(C+1),this.auth=decodeURIComponent(E)),x=-1,S=0;S<u.length;S++){var I;-1!==(I=v.indexOf(u[S]))&&(-1===x||I<x)&&(x=I)}-1===x&&(x=v.length),this.host=v.slice(0,x),v=v.slice(x),this.parseHost(),this.hostname=this.hostname||"";var T="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!T)for(var N=this.hostname.split(/\./),P=(S=0,N.length);S<P;S++){var R=N[S];if(R&&!R.match(p)){for(var A="",B=0,L=R.length;B<L;B++)R.charCodeAt(B)>127?A+="x":A+=R[B];if(!A.match(p)){var M=N.slice(0,S),D=N.slice(S+1),O=R.match(h);O&&(M.push(O[1]),D.unshift(O[2])),D.length&&(v="/"+D.join(".")+v),this.hostname=M.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),T||(this.hostname=r.toASCII(this.hostname));var F=this.port?":"+this.port:"",j=this.hostname||"";this.host=j+F,this.href+=this.host,T&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==v[0]&&(v="/"+v))}if(!m[k])for(S=0,P=c.length;S<P;S++){var Z=c[S];if(-1!==v.indexOf(Z)){var z=encodeURIComponent(Z);z===Z&&(z=escape(Z)),v=v.split(Z).join(z)}}var V=v.indexOf("#");-1!==V&&(this.hash=v.substr(V),v=v.slice(0,V));var H=v.indexOf("?");if(-1!==H?(this.search=v.substr(H),this.query=v.substr(H+1),t&&(this.query=b.parse(this.query)),v=v.slice(0,H)):t&&(this.search="",this.query={}),v&&(this.pathname=v),g[k]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){F=this.pathname||"";var U=this.search||"";this.path=F+U}return this.href=this.format(),this},o.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",o=!1,i="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&"object"==typeof this.query&&Object.keys(this.query).length&&(i=b.stringify(this.query));var a=this.search||i&&"?"+i||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||g[t])&&!1!==o?(o="//"+(o||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):o||(o=""),r&&"#"!==r.charAt(0)&&(r="#"+r),a&&"?"!==a.charAt(0)&&(a="?"+a),t+o+(n=n.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(a=a.replace("#","%23"))+r},o.prototype.resolve=function(e){return this.resolveObject(v(e,!1,!0)).format()},o.prototype.resolveObject=function(e){if("string"==typeof e){var t=new o;t.parse(e,!1,!0),e=t}for(var n=new o,r=Object.keys(this),i=0;i<r.length;i++){var a=r[i];n[a]=this[a]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var s=Object.keys(e),l=0;l<s.length;l++){var c=s[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 p=u[d];n[p]=e[p]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||f[e.protocol])n.pathname=e.pathname;else{for(var h=(e.pathname||"").split("/");h.length&&!(e.host=h.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==h[0]&&h.unshift(""),h.length<2&&h.unshift(""),n.pathname=h.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 m=n.pathname||"",b=n.search||"";n.path=m+b}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var v=n.pathname&&"/"===n.pathname.charAt(0),y=e.host||e.pathname&&"/"===e.pathname.charAt(0),_=y||v||n.host&&e.pathname,k=_,w=n.pathname&&n.pathname.split("/")||[],E=(h=e.pathname&&e.pathname.split("/")||[],n.protocol&&!g[n.protocol]);if(E&&(n.hostname="",n.port=null,n.host&&(""===w[0]?w[0]=n.host:w.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===h[0]?h[0]=e.host:h.unshift(e.host)),e.host=null),_=_&&(""===h[0]||""===w[0])),y)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,w=h;else if(h.length)w||(w=[]),w.pop(),w=w.concat(h),n.search=e.search,n.query=e.query;else if(null!=e.search)return E&&(n.host=w.shift(),n.hostname=n.host,(T=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=T.shift(),n.hostname=T.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(!w.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var C=w.slice(-1)[0],x=(n.host||e.host||w.length>1)&&("."===C||".."===C)||""===C,S=0,I=w.length;I>=0;I--)"."===(C=w[I])?w.splice(I,1):".."===C?(w.splice(I,1),S++):S&&(w.splice(I,1),S--);if(!_&&!k)for(;S--;S)w.unshift("..");!_||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),x&&"/"!==w.join("/").substr(-1)&&w.push("");var T,N=""===w[0]||w[0]&&"/"===w[0].charAt(0);return E&&(n.hostname=N?"":w.length?w.shift():"",n.host=n.hostname,(T=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=T.shift(),n.hostname=T.shift(),n.host=n.hostname)),(_=_||n.host&&w.length)&&!N&&w.unshift(""),w.length>0?n.pathname=w.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},o.prototype.parseHost=function(){var e=this.host,t=a.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=v,t.resolve=function(e,t){return v(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?v(e,!1,!0).resolveObject(t):t},t.format=function(e){return"string"==typeof e&&(e=v(e)),e instanceof o?e.format():o.prototype.format.call(e)},t.Url=o},65311:function(e){"use strict";e.exports=jQuery},37019:function(){},96344:function(){},439:function(){}},function(e){e.O(0,[351],(function(){return 9393,e(e.s=9393)})),e.O()}]);
[-] form_editor.js
[edit]
[-] automation_editor.js
[edit]
[-] automation.js
[edit]
[-] index.php
[edit]
[-] form_preview.js
[edit]
[+]
..
[-] admin.js
[edit]
[-] post_editor_block.js
[edit]
[-] vendor.js
[edit]
[-] mailpoet.js
[edit]
[-] commons.js
[edit]
[+]
marketing-optin-block
[-] newsletter_editor.js
[edit]
[-] mailpoet.js.LICENSE.txt
[edit]
[-] automation_analytics.js.LICENSE.txt
[edit]
[-] settings.js
[edit]
[-] commons.js.LICENSE.txt
[edit]
[-] manifest.json
[edit]
[-] admin_vendor.js
[edit]
[-] public.js.LICENSE.txt
[edit]
[+]
skins
[+]
email-editor
[-] public.js
[edit]
[-] newsletter_editor.js.LICENSE.txt
[edit]
[-] automation_analytics.js
[edit]
[-] automation_templates.js
[edit]
[-] runtime.js
[edit]
[-] form_editor.js.LICENSE.txt
[edit]
[-] admin.js.LICENSE.txt
[edit]
[-] post_editor_block.js.LICENSE.txt
[edit]